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

Skip to content

Commit 39deceb

Browse files
committed
Minor fixes to checking/re-enabling of xp_cmdshell procedure
1 parent 1a5a668 commit 39deceb

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,4 +251,4 @@
251251
MYSQL_ERROR_TRIM_LENGTH = 100
252252

253253
# Do not unescape the injected statement if it contains any of the following SQL words
254-
EXCLUDE_UNESCAPE = ("WAITFOR DELAY ", " INTO DUMPFILE ", " INTO OUTFILE ", "CREATE ", "BULK ")
254+
EXCLUDE_UNESCAPE = ("WAITFOR DELAY ", " INTO DUMPFILE ", " INTO OUTFILE ", "CREATE ", "BULK ", "EXEC ", "RECONFIGURE ", "DECLARE ")

lib/takeover/xp_cmdshell.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,12 @@ def __xpCmdshellCheck(self):
9393

9494
inject.goStacked(cmd)
9595

96-
return wasLastRequestDelayed()
96+
delayed = wasLastRequestDelayed()
97+
98+
if isinstance(delayed, bool):
99+
return delayed
100+
else:
101+
return None
97102

98103
def xpCmdshellForgeCmd(self, cmd):
99104
self.__randStr = randomStr(lowercase=True)

0 commit comments

Comments
 (0)