mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-06 20:51:31 +00:00
Fixes #3652
This commit is contained in:
@@ -2151,14 +2151,20 @@ def shellExec(cmd):
|
||||
"""
|
||||
Executes arbitrary shell command
|
||||
|
||||
>>> shellExec('echo 1').strip() == b'1'
|
||||
>>> shellExec('echo 1').strip() == '1'
|
||||
True
|
||||
"""
|
||||
|
||||
retVal = ""
|
||||
|
||||
try:
|
||||
return subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT).communicate()[0] or ""
|
||||
retVal = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT).communicate()[0] or ""
|
||||
except Exception as ex:
|
||||
return six.text_type(ex)
|
||||
retVal = getSafeExString(ex)
|
||||
finally:
|
||||
retVal = getText(retVal)
|
||||
|
||||
return retVal
|
||||
|
||||
def clearConsoleLine(forceOutput=False):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user