MCPcopy Index your code
hub / github.com/sqlmapproject/sqlmap / shellExec

Function shellExec

lib/core/common.py:2380–2397  ·  view source on GitHub ↗

Executes arbitrary shell command >>> shellExec('echo 1').strip() == '1' True

(cmd)

Source from the content-addressed store, hash-verified

2378 return width or default
2379
2380def shellExec(cmd):
2381 """
2382 Executes arbitrary shell command
2383
2384 >>> shellExec('echo 1').strip() == '1'
2385 True
2386 """
2387
2388 retVal = ""
2389
2390 try:
2391 retVal = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT).communicate()[0] or ""
2392 except Exception as ex:
2393 retVal = getSafeExString(ex)
2394 finally:
2395 retVal = getText(retVal)
2396
2397 return retVal
2398
2399def clearConsoleLine(forceOutput=False):
2400 """

Callers 2

vulnTestFunction · 0.90
getConsoleWidthFunction · 0.70

Calls 2

getTextFunction · 0.90
getSafeExStringFunction · 0.70

Tested by 1

vulnTestFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…