mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-24 10:33:47 +03:00
Minor update
This commit is contained in:
parent
3b3b8d4ef2
commit
725c3a6a95
|
@ -2855,16 +2855,15 @@ def createGithubIssue(errMsg, excMsg):
|
|||
msg = "\ndo you want to automatically create a new (anonymized) issue "
|
||||
msg += "with the unhandled exception information at "
|
||||
msg += "the official Github repository? [y/N] "
|
||||
test = readInput(msg, default="N")
|
||||
if test[0] in ("y", "Y"):
|
||||
try:
|
||||
test = readInput(msg, default="N")
|
||||
except:
|
||||
test = None
|
||||
|
||||
if test and test[0] in ("y", "Y"):
|
||||
ex = None
|
||||
errMsg = errMsg[errMsg.find("\n"):]
|
||||
|
||||
for match in re.finditer(r'File "(.+?)", line', excMsg):
|
||||
file = match.group(1).replace('\\', "/")
|
||||
file = file[file.find("sqlmap"):].replace("sqlmap/", "", 1)
|
||||
excMsg = excMsg.replace(match.group(1), file)
|
||||
|
||||
data = {"title": "Unhandled exception (#%s)" % hashlib.md5(excMsg).hexdigest()[:8], "body": "```%s\n```\n```\n%s```" % (errMsg, excMsg)}
|
||||
req = urllib2.Request(url="https://api.github.com/repos/sqlmapproject/sqlmap/issues", data=json.dumps(data), headers={"Authorization": "token %s" % GITHUB_REPORT_OAUTH_TOKEN})
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@ import bdb
|
|||
import inspect
|
||||
import logging
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
import time
|
||||
import traceback
|
||||
|
@ -129,6 +130,12 @@ def main():
|
|||
print
|
||||
errMsg = unhandledExceptionMessage()
|
||||
excMsg = traceback.format_exc()
|
||||
|
||||
for match in re.finditer(r'File "(.+?)", line', excMsg):
|
||||
file = match.group(1).replace('\\', "/")
|
||||
file = file[file.find("sqlmap"):].replace("sqlmap/", "", 1)
|
||||
excMsg = excMsg.replace(match.group(1), file)
|
||||
|
||||
logger.critical(errMsg)
|
||||
kb.stickyLevel = logging.CRITICAL
|
||||
dataToStdout(excMsg)
|
||||
|
|
Loading…
Reference in New Issue
Block a user