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

Skip to content

Commit c2b9293

Browse files
committed
Update of vuln tests
1 parent 7322678 commit c2b9293

3 files changed

Lines changed: 17 additions & 12 deletions

File tree

extra/vulnserver/vulnserver.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ def do_REQUEST(self):
102102
if hasattr(self, "data"):
103103
if self.data.startswith('{') and self.data.endswith('}'):
104104
params.update(json.loads(self.data))
105+
elif self.data.startswith('<') and self.data.endswith('>'):
106+
params.update(dict(re.findall(r'name="([^"]+)" value="([^"]*)"', self.data)))
105107
else:
106108
params.update(parse_qs(self.data))
107109

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from thirdparty.six import unichr as _unichr
1919

2020
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
21-
VERSION = "1.3.11.7"
21+
VERSION = "1.3.11.8"
2222
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
2323
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
2424
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)

lib/core/testing.py

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,19 @@ def vulnTest():
6161
Runs the testing against 'vulnserver'
6262
"""
6363

64+
TESTS = (
65+
("--flush-session", ("CloudFlare",)),
66+
("--flush-session --data='{\"id\": 1}' --banner", ("Payload: {\"id\"", "banner: '3")),
67+
("--flush-session --data='<root><param name=\"id\" value=\"1*\"/></root>' --banner", ("Payload: <root><param name=\"id\" value=\"1", "banner: '3")),
68+
("--flush-session --parse-errors --eval=\"id2=2\" --referer=\"localhost\" --cookie=\"PHPSESSID=d41d8cd98f00b204e9800998ecf8427e\"", (": syntax error", "Type: boolean-based blind", "Type: time-based blind", "Type: UNION query", "back-end DBMS: SQLite", "3 columns")),
69+
("--banner --schema --dump -T users --binary-fields=surname --where \"id>3\"", ("banner: '3", "INTEGER", "TEXT", "id", "name", "surname", "2 entries", "6E616D6569736E756C6C")),
70+
("--all --tamper=between,randomcase", ("5 entries", "luther", "blisset", "fluffy", "179ad45c6ce2cb97cf1029e212046e81", "NULL", "nameisnull", "testpass")),
71+
("-z \"tec=B\" --hex --fresh-queries --threads=4 --sql-query=\"SELECT 987654321\"", ("length of query output", ": '987654321'",)),
72+
("--technique=T --fresh-queries --sql-query=\"SELECT 1234\"", (": '1234'",)),
73+
)
74+
6475
retVal = True
65-
count, length = 0, 6
76+
count = 0
6677
address, port = "127.0.0.10", random.randint(1025, 65535)
6778

6879
def _thread():
@@ -73,15 +84,7 @@ def _thread():
7384
thread.daemon = True
7485
thread.start()
7586

76-
for options, checks in (
77-
("--flush-session", ("CloudFlare",)),
78-
("--flush-session --data='{\"id\": 1}' --banner", ("Payload: {\"id\"", "banner: '3")),
79-
("--flush-session --parse-errors --eval=\"id2=2\" --referer=\"localhost\" --cookie=\"PHPSESSID=d41d8cd98f00b204e9800998ecf8427e\"", (": syntax error", "Type: boolean-based blind", "Type: time-based blind", "Type: UNION query", "back-end DBMS: SQLite", "3 columns")),
80-
("--banner --schema --dump -T users --binary-fields=surname --where \"id>3\"", ("banner: '3", "INTEGER", "TEXT", "id", "name", "surname", "2 entries", "6E616D6569736E756C6C")),
81-
("--all --tamper=between,randomcase", ("5 entries", "luther", "blisset", "fluffy", "179ad45c6ce2cb97cf1029e212046e81", "NULL", "nameisnull", "testpass")),
82-
("-z \"tec=B\" --hex --fresh-queries --threads=4 --sql-query=\"SELECT 987654321\"", ("length of query output", ": '987654321'",)),
83-
("--technique=T --fresh-queries --sql-query=\"SELECT 1234\"", (": '1234'",)),
84-
):
87+
for options, checks in TESTS:
8588
cmd = "%s %s -u http://%s:%d/?id=1 --batch %s" % (sys.executable, os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", "sqlmap.py")), address, port, options)
8689
output = shellExec(cmd)
8790

@@ -91,7 +94,7 @@ def _thread():
9194
retVal = False
9295

9396
count += 1
94-
status = '%d/%d (%d%%) ' % (count, length, round(100.0 * count / length))
97+
status = '%d/%d (%d%%) ' % (count, len(TESTS), round(100.0 * count / len(TESTS)))
9598
dataToStdout("\r[%s] [INFO] complete: %s" % (time.strftime("%X"), status))
9699

97100
clearConsoleLine()

0 commit comments

Comments
 (0)