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

Skip to content

Commit 3f1a8e8

Browse files
committed
Adding support for #3870
1 parent 0e14647 commit 3f1a8e8

7 files changed

Lines changed: 12 additions & 10 deletions

File tree

lib/core/defaults.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"level": 1,
2121
"risk": 1,
2222
"dumpFormat": "CSV",
23+
"tablePrefix": "sqlmap",
2324
"technique": "BEUSTQ",
2425
"torType": "SOCKS5",
2526
}

lib/core/settings.py

Lines changed: 1 addition & 4 deletions
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.8.11"
21+
VERSION = "1.3.8.12"
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)
@@ -807,9 +807,6 @@
807807
OS.WINDOWS: ("/xampp", "/Program Files/xampp", "/wamp", "/Program Files/wampp", "/apache", "/Program Files/Apache Group/Apache", "/Program Files/Apache Group/Apache2", "/Program Files/Apache Group/Apache2.2", "/Program Files/Apache Group/Apache2.4", "/Inetpub/wwwroot", "/Inetpub/wwwroot/%TARGET%", "/Inetpub/vhosts/%TARGET%")
808808
}
809809

810-
# Table prefix to use in "takeover" functionalities (i.e. auxiliary tables used by sqlmap at the vulnerable DBMS)
811-
TAKEOVER_TABLE_PREFIX = "sqlmap"
812-
813810
# Suffixes used in brute force search for web server document root
814811
BRUTE_DOC_ROOT_SUFFIXES = ("", "html", "htdocs", "httpdocs", "php", "public", "src", "site", "build", "web", "www", "data", "sites/all", "www/build")
815812

lib/parse/cmdline.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -666,6 +666,9 @@ def cmdLineParser(argv=None):
666666
general.add_argument("--skip-waf", dest="skipWaf", action="store_true",
667667
help="Skip heuristic detection of WAF/IPS protection")
668668

669+
general.add_argument("--table-prefix", dest="tablePrefix",
670+
help="Prefix used for temporary tables (default: \"%s\")" % defaults.tablePrefix)
671+
669672
general.add_argument("--test-filter", dest="testFilter",
670673
help="Select tests by payloads and/or titles (e.g. ROW)")
671674

lib/request/direct.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
from lib.core.enums import DBMS
2626
from lib.core.enums import EXPECTED
2727
from lib.core.enums import TIMEOUT_STATE
28-
from lib.core.settings import TAKEOVER_TABLE_PREFIX
2928
from lib.core.settings import UNICODE_ENCODING
3029
from lib.utils.timeout import timeout
3130

@@ -54,7 +53,7 @@ def direct(query, content=True):
5453

5554
if not select and "EXEC " not in query.upper():
5655
timeout(func=conf.dbmsConnector.execute, args=(query,), duration=conf.timeout, default=None)
57-
elif not (output and ("%soutput" % TAKEOVER_TABLE_PREFIX) not in query and ("%sfile" % TAKEOVER_TABLE_PREFIX) not in query):
56+
elif not (output and ("%soutput" % conf.tablePrefix) not in query and ("%sfile" % conf.tablePrefix) not in query):
5857
output, state = timeout(func=conf.dbmsConnector.select, args=(query,), duration=conf.timeout, default=None)
5958
if state == TIMEOUT_STATE.NORMAL:
6059
hashDBWrite(query, output, True)

plugins/generic/filesystem.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
from lib.core.enums import EXPECTED
3434
from lib.core.enums import PAYLOAD
3535
from lib.core.exception import SqlmapUndefinedMethod
36-
from lib.core.settings import TAKEOVER_TABLE_PREFIX
3736
from lib.core.settings import UNICODE_ENCODING
3837
from lib.request import inject
3938

@@ -43,7 +42,7 @@ class Filesystem(object):
4342
"""
4443

4544
def __init__(self):
46-
self.fileTblName = "%sfile" % TAKEOVER_TABLE_PREFIX
45+
self.fileTblName = "%sfile" % conf.tablePrefix
4746
self.tblField = "data"
4847

4948
def _checkFileLength(self, localFile, remoteFile, fileRead=False):

plugins/generic/takeover.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
from lib.core.exception import SqlmapSystemException
2626
from lib.core.exception import SqlmapUndefinedMethod
2727
from lib.core.exception import SqlmapUnsupportedDBMSException
28-
from lib.core.settings import TAKEOVER_TABLE_PREFIX
2928
from lib.takeover.abstraction import Abstraction
3029
from lib.takeover.icmpsh import ICMPsh
3130
from lib.takeover.metasploit import Metasploit
@@ -37,7 +36,7 @@ class Takeover(Abstraction, Metasploit, ICMPsh, Registry):
3736
"""
3837

3938
def __init__(self):
40-
self.cmdTblName = ("%soutput" % TAKEOVER_TABLE_PREFIX)
39+
self.cmdTblName = ("%soutput" % conf.tablePrefix)
4140
self.tblField = "data"
4241

4342
Abstraction.__init__(self)

sqlmap.conf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -776,6 +776,10 @@ scope =
776776
# Valid: True or False
777777
skipWaf = False
778778

779+
# Prefix used for temporary tables.
780+
# Default: sqlmap
781+
tablePrefix = sqlmap
782+
779783
# Select tests by payloads and/or titles (e.g. ROW)
780784
testFilter =
781785

0 commit comments

Comments
 (0)