Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 58b87e4

Browse files
committed
Some more refactoring
1 parent 5c35aff commit 58b87e4

6 files changed

Lines changed: 13 additions & 12 deletions

File tree

lib/controller/checks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ def genCmpPayload():
574574
page, headers, _ = Request.queryPage(reqPayload, place, content=True, raise404=False)
575575
output = extractRegexResult(check, page, re.DOTALL | re.IGNORECASE) \
576576
or extractRegexResult(check, threadData.lastHTTPError[2] if wasLastResponseHTTPError() else None, re.DOTALL | re.IGNORECASE) \
577-
or extractRegexResult(check, listToStrValue([headers[key] for key in headers.keys() if key.lower() != URI_HTTP_HEADER.lower()] if headers else None), re.DOTALL | re.IGNORECASE) \
577+
or extractRegexResult(check, listToStrValue((headers[key] for key in headers.keys() if key.lower() != URI_HTTP_HEADER.lower()) if headers else None), re.DOTALL | re.IGNORECASE) \
578578
or extractRegexResult(check, threadData.lastRedirectMsg[1] if threadData.lastRedirectMsg and threadData.lastRedirectMsg[0] == threadData.lastRequestUID else None, re.DOTALL | re.IGNORECASE)
579579

580580
if output:

lib/core/common.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import tempfile
2929
import threading
3030
import time
31+
import types
3132
import urllib
3233
import urllib2
3334
import urlparse
@@ -3418,7 +3419,7 @@ def listToStrValue(value):
34183419
'1, 2, 3'
34193420
"""
34203421

3421-
if isinstance(value, (set, tuple)):
3422+
if isinstance(value, (set, tuple, types.GeneratorType)):
34223423
value = list(value)
34233424

34243425
if isinstance(value, list):

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from lib.core.enums import OS
2020

2121
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
22-
VERSION = "1.1.11.6"
22+
VERSION = "1.1.11.7"
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)

lib/request/comparison.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,15 @@ def _comparison(page, headers, code, getRatioValue, pageLength):
4949
threadData = getCurrentThreadData()
5050

5151
if kb.testMode:
52-
threadData.lastComparisonHeaders = listToStrValue([_ for _ in headers.headers if not _.startswith("%s:" % URI_HTTP_HEADER)]) if headers else ""
52+
threadData.lastComparisonHeaders = listToStrValue(_ for _ in headers.headers if not _.startswith("%s:" % URI_HTTP_HEADER)) if headers else ""
5353
threadData.lastComparisonPage = page
5454
threadData.lastComparisonCode = code
5555

5656
if page is None and pageLength is None:
5757
return None
5858

5959
if any((conf.string, conf.notString, conf.regexp)):
60-
rawResponse = "%s%s" % (listToStrValue([_ for _ in headers.headers if not _.startswith("%s:" % URI_HTTP_HEADER)]) if headers else "", page)
60+
rawResponse = "%s%s" % (listToStrValue(_ for _ in headers.headers if not _.startswith("%s:" % URI_HTTP_HEADER)) if headers else "", page)
6161

6262
# String to match in page when the query is True and/or valid
6363
if conf.string:

lib/techniques/error/use.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def _oneShotErrorUse(expression, field=None, chunkTest=False):
133133
output = reduce(lambda x, y: x if x is not None else y, (\
134134
extractRegexResult(check, page), \
135135
extractRegexResult(check, threadData.lastHTTPError[2] if wasLastResponseHTTPError() else None), \
136-
extractRegexResult(check, listToStrValue([headers[header] for header in headers if header.lower() != HTTP_HEADER.URI.lower()] if headers else None)), \
136+
extractRegexResult(check, listToStrValue((headers[header] for header in headers if header.lower() != HTTP_HEADER.URI.lower()) if headers else None)), \
137137
extractRegexResult(check, threadData.lastRedirectMsg[1] if threadData.lastRedirectMsg and threadData.lastRedirectMsg[0] == threadData.lastRequestUID else None)), \
138138
None)
139139

@@ -142,7 +142,7 @@ def _oneShotErrorUse(expression, field=None, chunkTest=False):
142142
else:
143143
trimmed = extractRegexResult(trimcheck, page) \
144144
or extractRegexResult(trimcheck, threadData.lastHTTPError[2] if wasLastResponseHTTPError() else None) \
145-
or extractRegexResult(trimcheck, listToStrValue([headers[header] for header in headers if header.lower() != HTTP_HEADER.URI.lower()] if headers else None)) \
145+
or extractRegexResult(trimcheck, listToStrValue((headers[header] for header in headers if header.lower() != HTTP_HEADER.URI.lower()) if headers else None)) \
146146
or extractRegexResult(trimcheck, threadData.lastRedirectMsg[1] if threadData.lastRedirectMsg and threadData.lastRedirectMsg[0] == threadData.lastRequestUID else None)
147147

148148
if trimmed:

txt/checksum.md5

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ f96467fc5cd1d87f52dd7966c8ae6e79 extra/shutils/regressiontest.py
2121
5fb9aaf874daa47ea2b672a22740e56b extra/sqlharvest/__init__.py
2222
1fc7772edce5a01c31f3932b2fc4c1c6 extra/sqlharvest/sqlharvest.py
2323
21bf2b3a7a22b8cd5d96a6457a1b4997 lib/controller/action.py
24-
9eadf57517a6064d462b1f5ba9a3280d lib/controller/checks.py
24+
47ea1e8ca54bad024814e4f539738c86 lib/controller/checks.py
2525
91c9ef44927b270ea53b6739ff5b2e76 lib/controller/controller.py
2626
d2cdb9e832e18a81e936ca3348144b16 lib/controller/handler.py
2727
5fb9aaf874daa47ea2b672a22740e56b lib/controller/__init__.py
2828
c1ba81136151b327c71fd01376376451 lib/core/agent.py
2929
d55b4b58019d6dbfddd40ec919f9f172 lib/core/bigarray.py
30-
abcdd166b8b7c7d84bfa3d70a1778f06 lib/core/common.py
30+
8ba4d3870b4a7a5a89eb8fe4f039e355 lib/core/common.py
3131
54326d3a690f8b26fe5a5da1a589b369 lib/core/convert.py
3232
90b1b08368ac8a859300e6fa6a8c796e lib/core/data.py
3333
1c14bdbf47b8dba31f73da9ad731a54a lib/core/datatype.py
@@ -46,7 +46,7 @@ ec6a778b0e74749b916caead78ba88b7 lib/core/option.py
4646
760d9df2a27ded29109b390ab202e72d lib/core/replication.py
4747
a2466b62e67f8b31736bac4dac590e51 lib/core/revision.py
4848
02d4762140a72fd44668d3dab5eabda9 lib/core/session.py
49-
131b671b06a10d4fb46daa6c1b9399c4 lib/core/settings.py
49+
b1cea79f42496d6b39be19a0bdc26070 lib/core/settings.py
5050
35bffbad762eb9e03db9e93b1c991103 lib/core/shell.py
5151
a59ec28371ae067a6fdd8f810edbee3d lib/core/subprocessng.py
5252
7c9f2af3c0a8dd89223cfe07b0a0b826 lib/core/target.py
@@ -67,7 +67,7 @@ d8d9bcf9e7107a5e2cf2dd10f115ac28 lib/parse/payloads.py
6767
2b87577dc6d3609e96fc1e049def5b4f lib/parse/sitemap.py
6868
d2f13a0e2fef5273d419d06e516122e1 lib/request/basicauthhandler.py
6969
669e8cf941bba4a2e987045b3002b8e3 lib/request/basic.py
70-
67bcf2499db566ebf46f9a6122399fe6 lib/request/comparison.py
70+
28348595147a731677c8bef470c6f57a lib/request/comparison.py
7171
a253670611499bc159879122e05622de lib/request/connect.py
7272
ad6f76839408d827abfcdc57813f8518 lib/request/direct.py
7373
4853bd0d523646315607a6a9a4c0b745 lib/request/dns.py
@@ -93,7 +93,7 @@ ab58650253fdad04e7a53a4e4d36df8a lib/techniques/blind/inference.py
9393
95331b2826f28db9ff962670391aa7d6 lib/techniques/dns/test.py
9494
82cc907fb335250703072337d8f8cceb lib/techniques/dns/use.py
9595
5fb9aaf874daa47ea2b672a22740e56b lib/techniques/error/__init__.py
96-
e9e3e8ad72a9cd981e76d6debec05185 lib/techniques/error/use.py
96+
5953b814b91e6a03d26f319203b48d01 lib/techniques/error/use.py
9797
5fb9aaf874daa47ea2b672a22740e56b lib/techniques/__init__.py
9898
5fb9aaf874daa47ea2b672a22740e56b lib/techniques/union/__init__.py
9999
fcc3a6ac3b5f7aad86686e5f9adc7a43 lib/techniques/union/test.py

0 commit comments

Comments
 (0)