From c92fde120d74c94507d380dbed1e3555d8caf933 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Mon, 10 Oct 2016 23:27:41 +0200 Subject: [PATCH] Implements #2220 --- lib/core/common.py | 19 +++++++++++++++++-- lib/core/settings.py | 2 +- txt/checksum.md5 | 4 ++-- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/lib/core/common.py b/lib/core/common.py index cd27b0b98..ec39124ac 100644 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -3178,13 +3178,28 @@ def createGithubIssue(errMsg, excMsg): ex = None errMsg = errMsg[errMsg.find("\n"):] + req = urllib2.Request(url="https://api.github.com/search/issues?q=%s" % urllib.quote("repo:sqlmapproject/sqlmap Unhandled exception (#%s)" % key)) + + try: + content = urllib2.urlopen(req).read() + _ = json.loads(content) + duplicate = _["total_count"] > 0 + closed = duplicate and _["items"][0]["state"] == "closed" + if duplicate: + warnMsg = "issue seems to be already reported" + if closed: + warnMsg += " and resolved. Please update to the latest " + warnMsg += "development version from official GitHub repository at '%s'" % GIT_PAGE + logger.warn(warnMsg) + return + except: + pass data = {"title": "Unhandled exception (#%s)" % key, "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.decode("base64")}) try: - f = urllib2.urlopen(req) - content = f.read() + content = urllib2.urlopen(req).read() except Exception, ex: content = None diff --git a/lib/core/settings.py b/lib/core/settings.py index 67ddb7aab..ad1c29507 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -19,7 +19,7 @@ from lib.core.enums import DBMS_DIRECTORY_NAME from lib.core.enums import OS # sqlmap version (...) -VERSION = "1.0.10.24" +VERSION = "1.0.10.25" TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable" TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34} VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE) diff --git a/txt/checksum.md5 b/txt/checksum.md5 index 230133e13..82dfa0ded 100644 --- a/txt/checksum.md5 +++ b/txt/checksum.md5 @@ -26,7 +26,7 @@ f15544a4c9c365ae8f2f8fa2e3a69aa5 lib/controller/checks.py cc9c82cfffd8ee9b25ba3af6284f057e lib/controller/__init__.py 04f16204c899438dc7599a9a8426bfee lib/core/agent.py eb0bd28b0bd9fbf67dcc3119116df377 lib/core/bigarray.py -8bf4949483128163a34334207f1b78a7 lib/core/common.py +01c42757ab2928edcf62789e94397d1c lib/core/common.py 5680d0c446a3bed5c0f2a0402d031557 lib/core/convert.py e77cca1cb063016f71f6e6bdebf4ec73 lib/core/data.py 1d042f0bc0557d3fd564ea5a46deb77e lib/core/datatype.py @@ -45,7 +45,7 @@ e60456db5380840a586654344003d4e6 lib/core/readlineng.py 5ef56abb8671c2ca6ceecb208258e360 lib/core/replication.py 99a2b496b9d5b546b335653ca801153f lib/core/revision.py 7c15dd2777af4dac2c89cab6df17462e lib/core/session.py -a226f17fafb974d0bc88f0a47171353b lib/core/settings.py +b6d53fd8d8dc437c358366789ddeb935 lib/core/settings.py 7af83e4f18cab6dff5e67840eb65be80 lib/core/shell.py 23657cd7d924e3c6d225719865855827 lib/core/subprocessng.py c3ace7874a536d801f308cf1fd03df99 lib/core/target.py