mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2026-06-09 17:51:33 +00:00
Fixes #3652
This commit is contained in:
parent
c4f09a8e8a
commit
10be8a12bd
5 changed files with 22 additions and 12 deletions
|
|
@ -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):
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue