Skip to content

Commit 035137e

Browse files
committed
Bug fix in detection engine (abstract URI header sometimes caused problems - e.g. when automatic --string used)
1 parent 484d9a4 commit 035137e

3 files changed

Lines changed: 6 additions & 5 deletions

File tree

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.revision import getRevisionNumber
2020

2121
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
22-
VERSION = "1.0.9.30"
22+
VERSION = "1.0.9.31"
2323
REVISION = getRevisionNumber()
2424
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
2525
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}

lib/request/comparison.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
from lib.core.settings import REFLECTED_VALUE_MARKER
2727
from lib.core.settings import LOWER_RATIO_BOUND
2828
from lib.core.settings import UPPER_RATIO_BOUND
29+
from lib.core.settings import URI_HTTP_HEADER
2930
from lib.core.threads import getCurrentThreadData
3031

3132
def comparison(page, headers, code=None, getRatioValue=False, pageLength=None):
@@ -48,15 +49,15 @@ def _comparison(page, headers, code, getRatioValue, pageLength):
4849
threadData = getCurrentThreadData()
4950

5051
if kb.testMode:
51-
threadData.lastComparisonHeaders = listToStrValue(headers.headers) if headers else ""
52+
threadData.lastComparisonHeaders = listToStrValue([_ for _ in headers.headers if not _.startswith("%s:" % URI_HTTP_HEADER)]) if headers else ""
5253
threadData.lastComparisonPage = page
5354
threadData.lastComparisonCode = code
5455

5556
if page is None and pageLength is None:
5657
return None
5758

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

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

txt/checksum.md5

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ e60456db5380840a586654344003d4e6 lib/core/readlineng.py
4545
5ef56abb8671c2ca6ceecb208258e360 lib/core/replication.py
4646
99a2b496b9d5b546b335653ca801153f lib/core/revision.py
4747
7c15dd2777af4dac2c89cab6df17462e lib/core/session.py
48-
ff390f8d2d8653658a8a39dba2ddab2c lib/core/settings.py
48+
11375783a4c6d11502ba32dd3b1ef1ce lib/core/settings.py
4949
7af83e4f18cab6dff5e67840eb65be80 lib/core/shell.py
5050
23657cd7d924e3c6d225719865855827 lib/core/subprocessng.py
5151
0bc2fae1dec18cdd11954b22358293f2 lib/core/target.py
@@ -67,7 +67,7 @@ af6b8e1c6eb074b56bbd9cd80aebcd97 lib/parse/payloads.py
6767
b40a4c5d91770d347df36d3065b63798 lib/parse/sitemap.py
6868
9299f21804033f099681525bb9bf51c0 lib/request/basicauthhandler.py
6969
ca9879ea9277810c5fce0f0d8d2f8e03 lib/request/basic.py
70-
97fb6323bfb5f941b27cbdb00f9078e1 lib/request/comparison.py
70+
c48285682a61d49982cb508351013cb4 lib/request/comparison.py
7171
20fe3d96ae45cf46d19504415cebd819 lib/request/connect.py
7272
49b4c583af68689de5f9acb162de2939 lib/request/direct.py
7373
1a46f7bb26b23ec0c0d9d9c95828241b lib/request/dns.py

0 commit comments

Comments
 (0)