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

Skip to content

Commit 509bb41

Browse files
committed
Adding (hidden) switch '--force-pivoting' (Issue #3032)
1 parent 8ca3287 commit 509bb41

4 files changed

Lines changed: 18 additions & 6 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.enums import OS
2020

2121
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
22-
VERSION = "1.2.4.17"
22+
VERSION = "1.2.4.18"
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/parse/cmdline.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -683,6 +683,9 @@ def cmdLineParser(argv=None):
683683
parser.add_option("--force-dns", dest="forceDns", action="store_true",
684684
help=SUPPRESS_HELP)
685685

686+
parser.add_option("--force-pivoting", dest="forcePivoting", action="store_true",
687+
help=SUPPRESS_HELP)
688+
686689
parser.add_option("--force-threads", dest="forceThreads", action="store_true",
687690
help=SUPPRESS_HELP)
688691

plugins/generic/entries.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
from lib.core.common import readInput
2424
from lib.core.common import safeSQLIdentificatorNaming
2525
from lib.core.common import singleTimeLogMessage
26+
from lib.core.common import singleTimeWarnMessage
2627
from lib.core.common import unArrayizeValue
2728
from lib.core.common import unsafeSQLIdentificatorNaming
2829
from lib.core.data import conf
@@ -184,7 +185,11 @@ def dumpTable(self, foundData=None):
184185
if not (isTechniqueAvailable(PAYLOAD.TECHNIQUE.UNION) and kb.injection.data[PAYLOAD.TECHNIQUE.UNION].where == PAYLOAD.WHERE.ORIGINAL):
185186
table = "%s.%s" % (conf.db, tbl)
186187

187-
if Backend.isDbms(DBMS.MSSQL):
188+
if Backend.isDbms(DBMS.MSSQL) and not conf.forcePivoting:
189+
warnMsg = "in case of table dumping problems (e.g. column entry order) "
190+
warnMsg += "you are advised to rerun with '--force-pivoting'"
191+
singleTimeWarnMessage(warnMsg)
192+
188193
query = rootQuery.blind.count % table
189194
query = agent.whereQuery(query)
190195

@@ -327,7 +332,11 @@ def dumpTable(self, foundData=None):
327332
elif Backend.isDbms(DBMS.INFORMIX):
328333
table = "%s:%s" % (conf.db, tbl)
329334

330-
if Backend.isDbms(DBMS.MSSQL):
335+
if Backend.isDbms(DBMS.MSSQL) and not conf.forcePivoting:
336+
warnMsg = "in case of table dumping problems (e.g. column entry order) "
337+
warnMsg += "you are advised to rerun with '--force-pivoting'"
338+
singleTimeWarnMessage(warnMsg)
339+
331340
try:
332341
indexRange = getLimitRange(count, plusOne=True)
333342

txt/checksum.md5

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ c9a56e58984420a5abb7a3f7aadc196d lib/core/optiondict.py
4646
0c3eef46bdbf87e29a3f95f90240d192 lib/core/replication.py
4747
a7db43859b61569b601b97f187dd31c5 lib/core/revision.py
4848
fcb74fcc9577523524659ec49e2e964b lib/core/session.py
49-
e854bd3a7ce6196a3ee3e3891473435e lib/core/settings.py
49+
13d487ed576734ef3178720ec98ec406 lib/core/settings.py
5050
0dfc2ed40adf72e302291f6ecd4406f6 lib/core/shell.py
5151
a7edc9250d13af36ac0108f259859c19 lib/core/subprocessng.py
5252
a35efa7bec9f1e6cedf17c9830a79241 lib/core/target.py
@@ -57,7 +57,7 @@ af2d1810b6a7ebc61689a53c253ddbaa lib/core/update.py
5757
e772deb63270375e685fa5a7b775c382 lib/core/wordlist.py
5858
1e5532ede194ac9c083891c2f02bca93 lib/__init__.py
5959
7620f1f4b8791e13c7184c06b5421754 lib/parse/banner.py
60-
f667710f17b8447358ee7508a9d2faf1 lib/parse/cmdline.py
60+
5e46fac7f824ba8ab8003a1cd47d8af3 lib/parse/cmdline.py
6161
fb2e2f05dde98caeac6ccf3e67192177 lib/parse/configfile.py
6262
3794ff139869f5ae8e81cfdbe5714f56 lib/parse/handler.py
6363
aaad2a0d80f05eaebe52c71519b3dfc7 lib/parse/headers.py
@@ -204,7 +204,7 @@ a3db8618eed5bb2807b6f77605cba9cc plugins/dbms/sybase/__init__.py
204204
34d181a7086d6dfc7e72ae5f8a4cfe0f plugins/generic/connector.py
205205
e6cd1c5a5244d83396b401f7db43d323 plugins/generic/custom.py
206206
79c6dbcb7e6ad5e993a44aa52fdc36ed plugins/generic/databases.py
207-
a9c8637f0526d751cd1a6a18f91967f5 plugins/generic/entries.py
207+
4e2b366bb9cfdaaed719b219913357c6 plugins/generic/entries.py
208208
d82f2c78c1d4d7c6487e94fd3a68a908 plugins/generic/enumeration.py
209209
0c8abe66a78edca0660bfb8049d109e2 plugins/generic/filesystem.py
210210
f5d5419efddfe04648ea5e953c650793 plugins/generic/fingerprint.py

0 commit comments

Comments
 (0)