Skip to content

Commit 26988e9

Browse files
committed
Merge branch 'master' into update-sums
# Conflicts: # data/txt/sha256sums.txt
2 parents 7a27b14 + 6c108d9 commit 26988e9

File tree

4 files changed

+29
-11
lines changed

4 files changed

+29
-11
lines changed

lib/core/common.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
import time
3636
import types
3737
import unicodedata
38+
import zlib
3839

3940
from difflib import SequenceMatcher
4041
from math import sqrt
@@ -4005,7 +4006,8 @@ def createGithubIssue(errMsg, excMsg):
40054006
pass
40064007

40074008
data = {"title": "Unhandled exception (#%s)" % key, "body": "```%s\n```\n```\n%s```" % (errMsg, excMsg)}
4008-
req = _urllib.request.Request(url="https://api.github.com/repos/sqlmapproject/sqlmap/issues", data=getBytes(json.dumps(data)), headers={HTTP_HEADER.AUTHORIZATION: "token %s" % decodeBase64(GITHUB_REPORT_OAUTH_TOKEN, binary=False), HTTP_HEADER.USER_AGENT: fetchRandomAgent()})
4009+
token = getText(zlib.decompress(decodeBase64(GITHUB_REPORT_OAUTH_TOKEN[::-1], binary=True))[0::2][::-1])
4010+
req = _urllib.request.Request(url="https://api.github.com/repos/sqlmapproject/sqlmap/issues", data=getBytes(json.dumps(data)), headers={HTTP_HEADER.AUTHORIZATION: "token %s" % token, HTTP_HEADER.USER_AGENT: fetchRandomAgent()})
40094011

40104012
try:
40114013
content = getText(_urllib.request.urlopen(req).read())

lib/core/settings.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from thirdparty import six
2020

2121
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
22-
VERSION = "1.9.2.15"
22+
VERSION = "1.9.3.2"
2323
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
2424
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
2525
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)
@@ -61,7 +61,7 @@
6161
UPPER_RATIO_BOUND = 0.98
6262

6363
# For filling in case of dumb push updates
64-
DUMMY_JUNK = "ouZ0ii8A"
64+
DUMMY_JUNK = "ahy9Ouge"
6565

6666
# Markers for special cases when parameter values contain html encoded characters
6767
PARAMETER_AMP_MARKER = "__AMP__"
@@ -701,7 +701,7 @@
701701
FORCE_COOKIE_EXPIRATION_TIME = "9999999999"
702702

703703
# Github OAuth token used for creating an automatic Issue for unhandled exceptions
704-
GITHUB_REPORT_OAUTH_TOKEN = "Z2hwX0pNd0I2U25kN2Q5QmxlWkhxZmkxVXZTSHZiTlRDWjE5NUNpNA"
704+
GITHUB_REPORT_OAUTH_TOKEN = "wxqc7vTeW8ohIcX+1wK55Mnql2Ex9cP+2s1dqTr/mjlZJVfLnq24fMAi08v5vRvOmuhVZQdOT/lhIRovWvIJrdECD1ud8VMPWpxY+NmjHoEx+VLK1/vCAUBwJe"
705705

706706
# Skip unforced HashDB flush requests below the threshold number of cached items
707707
HASHDB_FLUSH_THRESHOLD = 32

lib/request/comparison.py

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@
2121
from lib.core.data import kb
2222
from lib.core.data import logger
2323
from lib.core.exception import SqlmapNoneDataException
24+
from lib.core.exception import SqlmapSilentQuitException
2425
from lib.core.settings import DEFAULT_PAGE_ENCODING
26+
from lib.core.settings import DEV_EMAIL_ADDRESS
2527
from lib.core.settings import DIFF_TOLERANCE
2628
from lib.core.settings import HTML_TITLE_REGEX
2729
from lib.core.settings import LOWER_RATIO_BOUND
@@ -35,8 +37,14 @@
3537
from thirdparty import six
3638

3739
def comparison(page, headers, code=None, getRatioValue=False, pageLength=None):
38-
_ = _adjust(_comparison(page, headers, code, getRatioValue, pageLength), getRatioValue)
39-
return _
40+
try:
41+
_ = _adjust(_comparison(page, headers, code, getRatioValue, pageLength), getRatioValue)
42+
return _
43+
except:
44+
warnMsg = "there was a KNOWN issue inside the internals regarding the difflib/comparison of pages. "
45+
warnMsg += "Please report details privately via e-mail to '%s'" % DEV_EMAIL_ADDRESS
46+
logger.critical(warnMsg)
47+
raise SqlmapSilentQuitException
4048

4149
def _adjust(condition, getRatioValue):
4250
if not any((conf.string, conf.notString, conf.regexp, conf.code)):
@@ -120,7 +128,7 @@ def _comparison(page, headers, code, getRatioValue, pageLength):
120128
if isinstance(seqMatcher.a, six.binary_type) and isinstance(page, six.text_type):
121129
page = getBytes(page, kb.pageEncoding or DEFAULT_PAGE_ENCODING, "ignore")
122130
elif isinstance(seqMatcher.a, six.text_type) and isinstance(page, six.binary_type):
123-
seqMatcher.a = getBytes(seqMatcher.a, kb.pageEncoding or DEFAULT_PAGE_ENCODING, "ignore")
131+
seqMatcher.set_seq1(getBytes(seqMatcher.a, kb.pageEncoding or DEFAULT_PAGE_ENCODING, "ignore"))
124132

125133
if any(_ is None for _ in (page, seqMatcher.a)):
126134
return None
@@ -146,12 +154,19 @@ def _comparison(page, headers, code, getRatioValue, pageLength):
146154
if seq1 is None or seq2 is None:
147155
return None
148156

149-
seq1 = seq1.replace(REFLECTED_VALUE_MARKER, "")
150-
seq2 = seq2.replace(REFLECTED_VALUE_MARKER, "")
157+
if isinstance(seq1, six.binary_type):
158+
seq1 = seq1.replace(REFLECTED_VALUE_MARKER.encode(), b"")
159+
elif isinstance(seq1, six.text_type):
160+
seq1 = seq1.replace(REFLECTED_VALUE_MARKER, "")
161+
162+
if isinstance(seq2, six.binary_type):
163+
seq2 = seq2.replace(REFLECTED_VALUE_MARKER.encode(), b"")
164+
elif isinstance(seq2, six.text_type):
165+
seq2 = seq2.replace(REFLECTED_VALUE_MARKER, "")
151166

152167
if kb.heavilyDynamic:
153-
seq1 = seq1.split("\n")
154-
seq2 = seq2.split("\n")
168+
seq1 = seq1.split("\n" if isinstance(seq1, six.text_type) else b"\n")
169+
seq2 = seq2.split("\n" if isinstance(seq2, six.text_type) else b"\n")
155170

156171
key = None
157172
else:

lib/request/httpshandler.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ def create_sock():
7979
try:
8080
# Reference(s): https://askubuntu.com/a/1263098
8181
# https://askubuntu.com/a/1250807
82+
# https://git.zknt.org/mirror/bazarr/commit/7f05f932ffb84ba8b9e5630b2adc34dbd77e2b4a?style=split&whitespace=show-all&show-outdated=
8283
_contexts[protocol].set_ciphers("ALL@SECLEVEL=0")
8384
except (ssl.SSLError, AttributeError):
8485
pass

0 commit comments

Comments
 (0)