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

Skip to content

Commit 5044894

Browse files
committed
Minor update of vuln tests
1 parent 0a0c696 commit 5044894

3 files changed

Lines changed: 8 additions & 4 deletions

File tree

extra/vulnserver/vulnserver.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def do_REQUEST(self):
126126
if self.url == '/':
127127
self.send_response(OK)
128128

129-
if "id" not in params:
129+
if not any(_ in self.params for _ in ("id", "query")):
130130
self.send_header("Content-type", "text/html")
131131
self.send_header("Connection", "close")
132132
self.end_headers()
@@ -145,7 +145,10 @@ def do_REQUEST(self):
145145
output += "%s<br>" % self.params["echo"]
146146

147147
with _lock:
148-
_cursor.execute("SELECT * FROM users WHERE id=%s LIMIT 0, 1" % self.params.get("id", ""))
148+
if "query" in self.params:
149+
_cursor.execute(self.params["query"])
150+
elif "id" in self.params:
151+
_cursor.execute("SELECT * FROM users WHERE id=%s LIMIT 0, 1" % self.params["id"])
149152
results = _cursor.fetchall()
150153

151154
output += "<b>SQL results:</b>\n"

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.77"
21+
VERSION = "1.3.11.78"
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: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ def vulnTest():
6565

6666
TESTS = (
6767
("-r <request> --flush-session", ("CloudFlare",)),
68-
("-u '<url>&echo=foobar*' --flush-session", ("might be vulnerable to cross-site scripting",)),
6968
("-u <url> --flush-session --forms --crawl=2 --banner", ("total of 2 targets", "might be injectable", "Type: UNION query", "banner: '3")),
7069
("-u <url> --flush-session --data='{\"id\": 1}' --banner", ("might be injectable", "3 columns", "Payload: {\"id\"", "Type: boolean-based blind", "Type: time-based blind", "Type: UNION query", "banner: '3")),
7170
("-u <url> --flush-session --data='<root><param name=\"id\" value=\"1*\"/></root>' --union-char=1 --mobile --banner --smart", ("might be injectable", "Payload: <root><param name=\"id\" value=\"1", "Type: boolean-based blind", "Type: time-based blind", "Type: UNION query", "banner: '3")),
@@ -77,6 +76,8 @@ def vulnTest():
7776
("-u <url> --banner --schema --dump -T users --binary-fields=surname --where \"id>3\"", ("banner: '3", "INTEGER", "TEXT", "id", "name", "surname", "2 entries", "6E616D6569736E756C6C")),
7877
("-u <url> --flush-session --all", ("5 entries", "Type: boolean-based blind", "Type: time-based blind", "Type: UNION query", "luther", "blisset", "fluffy", "179ad45c6ce2cb97cf1029e212046e81", "NULL", "nameisnull", "testpass")),
7978
("-u <url> -z \"tec=B\" --hex --fresh-queries --threads=4 --sql-query=\"SELECT * FROM users\"", ("SELECT * FROM users [5]", "nameisnull")),
79+
("-u '<url>&echo=foobar*' --flush-session", ("might be vulnerable to cross-site scripting",)),
80+
("-u '<url>&query=*' --flush-session --technique=Q --banner", ("Title: SQLite inline queries", "banner: '3")),
8081
("-d <direct> --flush-session --dump -T users --binary-fields=name --where \"id=3\"", ("7775", "179ad45c6ce2cb97cf1029e212046e81 (testpass)",)),
8182
("-d <direct> --flush-session --banner --schema --sql-query=\"SELECT 987654321\"", ("banner: '3", "INTEGER", "TEXT", "id", "name", "surname", "[*] 987654321",)),
8283
)

0 commit comments

Comments
 (0)