From 8620767b771022c66b75f0582a1378ccca389a4f Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Sat, 7 Jul 2012 10:38:07 +0200 Subject: [PATCH] Proper fix --- lib/takeover/xp_cmdshell.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/takeover/xp_cmdshell.py b/lib/takeover/xp_cmdshell.py index 3f72d18b9..f766c6a30 100644 --- a/lib/takeover/xp_cmdshell.py +++ b/lib/takeover/xp_cmdshell.py @@ -172,8 +172,12 @@ class xp_cmdshell: inject.goStacked("INSERT INTO %s EXEC %s '%s'" % (self.cmdTblName, self.xpCmdshellStr, cmd)) output = inject.getValue("SELECT %s FROM %s" % (self.tblField, self.cmdTblName), resumeValue=False) inject.goStacked("DELETE FROM %s" % self.cmdTblName) - if output and isListLike(output): - output = output[1:] + + if output and isListLike(output) and len(output) > 1: + if not output[0].strip(): + output = output[1:] + elif not output[-1].strip(): + output = output[:-1] return output