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

Skip to content

Commit 8620767

Browse files
committed
Proper fix
1 parent f00a776 commit 8620767

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

lib/takeover/xp_cmdshell.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,12 @@ def xpCmdshellEvalCmd(self, cmd, first=None, last=None):
172172
inject.goStacked("INSERT INTO %s EXEC %s '%s'" % (self.cmdTblName, self.xpCmdshellStr, cmd))
173173
output = inject.getValue("SELECT %s FROM %s" % (self.tblField, self.cmdTblName), resumeValue=False)
174174
inject.goStacked("DELETE FROM %s" % self.cmdTblName)
175-
if output and isListLike(output):
176-
output = output[1:]
175+
176+
if output and isListLike(output) and len(output) > 1:
177+
if not output[0].strip():
178+
output = output[1:]
179+
elif not output[-1].strip():
180+
output = output[:-1]
177181

178182
return output
179183

0 commit comments

Comments
 (0)