adding switch --eval

This commit is contained in:
Miroslav Stampar
2011-11-21 16:41:02 +00:00
parent 0ce885e6e6
commit 65b2b0ad87
7 changed files with 47 additions and 3 deletions

View File

@@ -3135,4 +3135,11 @@ def getHostHeader(url):
if any(map(lambda x: retVal.endswith(':%d' % x), [80, 443])):
retVal = retVal.split(':')[0]
return retVal
return retVal
def executeCode(code, variables=None):
try:
exec(code, variables)
except Exception, ex:
errMsg = "an error occured while evaluating provided code ('%s'). " % ex
raise sqlmapGenericException, errMsg