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

Skip to content

Commit 9a7343e

Browse files
committed
Fixes #2566
1 parent e040110 commit 9a7343e

3 files changed

Lines changed: 45 additions & 31 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.1.6.6"
22+
VERSION = "1.1.6.7"
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)

plugins/generic/entries.py

Lines changed: 42 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -176,20 +176,26 @@ def dumpTable(self, foundData=None):
176176

177177
count = inject.getValue(query, blind=False, time=False, expected=EXPECTED.INT, charsetType=CHARSET_TYPE.DIGITS)
178178
if isNumPosStrValue(count):
179-
indexRange = getLimitRange(count, plusOne=True)
180-
181-
for index in indexRange:
182-
row = []
183-
184-
for column in colList:
185-
query = rootQuery.blind.query3 % (column, column, table, index)
186-
query = agent.whereQuery(query)
187-
value = inject.getValue(query, blind=False, time=False, dump=True) or ""
188-
row.append(value)
189-
190-
entries.append(row)
191-
192-
if not entries:
179+
try:
180+
indexRange = getLimitRange(count, plusOne=True)
181+
182+
for index in indexRange:
183+
row = []
184+
for column in colList:
185+
query = rootQuery.blind.query3 % (column, column, table, index)
186+
query = agent.whereQuery(query)
187+
value = inject.getValue(query, blind=False, time=False, dump=True) or ""
188+
row.append(value)
189+
190+
entries.append(row)
191+
192+
except KeyboardInterrupt:
193+
kb.dumpKeyboardInterrupt = True
194+
clearConsoleLine()
195+
warnMsg = "Ctrl+C detected in dumping phase"
196+
logger.warn(warnMsg)
197+
198+
if not entries and not kb.dumpKeyboardInterrupt:
193199
try:
194200
retVal = pivotDumpTable(table, colList, blind=False)
195201
except KeyboardInterrupt:
@@ -211,7 +217,7 @@ def dumpTable(self, foundData=None):
211217

212218
query = agent.whereQuery(query)
213219

214-
if not entries and query:
220+
if not entries and query and not kb.dumpKeyboardInterrupt:
215221
try:
216222
entries = inject.getValue(query, blind=False, time=False, dump=True)
217223
except KeyboardInterrupt:
@@ -306,24 +312,32 @@ def dumpTable(self, foundData=None):
306312
table = "%s.%s" % (conf.db, tbl)
307313

308314
if Backend.isDbms(DBMS.MSSQL):
309-
indexRange = getLimitRange(count, plusOne=True)
310-
for index in indexRange:
311-
for column in colList:
312-
query = rootQuery.blind.query3 % (column, column, table, index)
313-
query = agent.whereQuery(query)
315+
try:
316+
indexRange = getLimitRange(count, plusOne=True)
314317

315-
value = inject.getValue(query, union=False, error=False, dump=True) or ""
318+
for index in indexRange:
319+
for column in colList:
320+
query = rootQuery.blind.query3 % (column, column, table, index)
321+
query = agent.whereQuery(query)
316322

317-
if column not in lengths:
318-
lengths[column] = 0
323+
value = inject.getValue(query, union=False, error=False, dump=True) or ""
319324

320-
if column not in entries:
321-
entries[column] = BigArray()
325+
if column not in lengths:
326+
lengths[column] = 0
322327

323-
lengths[column] = max(lengths[column], len(DUMP_REPLACEMENTS.get(getUnicode(value), getUnicode(value))))
324-
entries[column].append(value)
328+
if column not in entries:
329+
entries[column] = BigArray()
330+
331+
lengths[column] = max(lengths[column], len(DUMP_REPLACEMENTS.get(getUnicode(value), getUnicode(value))))
332+
entries[column].append(value)
333+
334+
except KeyboardInterrupt:
335+
kb.dumpKeyboardInterrupt = True
336+
clearConsoleLine()
337+
warnMsg = "Ctrl+C detected in dumping phase"
338+
logger.warn(warnMsg)
325339

326-
if not entries:
340+
if not entries and not kb.dumpKeyboardInterrupt:
327341
try:
328342
retVal = pivotDumpTable(table, colList, count, blind=True)
329343
except KeyboardInterrupt:

txt/checksum.md5

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ edcfce0850771e6454acef244d5c5760 lib/core/optiondict.py
4646
d8e9250f3775119df07e9070eddccd16 lib/core/replication.py
4747
785f86e3f963fa3798f84286a4e83ff2 lib/core/revision.py
4848
40c80b28b3a5819b737a5a17d4565ae9 lib/core/session.py
49-
b1151afaf0f49ea541ff914956438100 lib/core/settings.py
49+
fff32e00b8133f3d85019c6e0d768ee5 lib/core/settings.py
5050
d91291997d2bd2f6028aaf371bf1d3b6 lib/core/shell.py
5151
2ad85c130cc5f2b3701ea85c2f6bbf20 lib/core/subprocessng.py
5252
8136241fdbdb99a5dc0e51ba72918f6e lib/core/target.py
@@ -203,7 +203,7 @@ deed74334b637767fc9de8f74b37647a plugins/dbms/sybase/fingerprint.py
203203
be7481a96214220bcd8f51ca00239bed plugins/generic/connector.py
204204
5390591ca955036d492de11355b52e8f plugins/generic/custom.py
205205
4ad4bccc03256b8f3d21ba4f8f759404 plugins/generic/databases.py
206-
12b0420d9588828e4a83fe8e89bef162 plugins/generic/entries.py
206+
106f19c1d895963e2efa8ee193a537ec plugins/generic/entries.py
207207
55802d1d5d65938414c77ccc27731cab plugins/generic/enumeration.py
208208
0d10a0410c416fece51c26a935e68568 plugins/generic/filesystem.py
209209
2e397afd83939889d1a7a07893b19ae7 plugins/generic/fingerprint.py

0 commit comments

Comments
 (0)