Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8093f39

Browse files
committed
properly distinguish stdout from stderr with a separate pipe (tracebacks go to stderr) - issue #297
1 parent 10f1099 commit 8093f39

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

lib/utils/api.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
import types
1515

1616
from subprocess import PIPE
17-
from subprocess import STDOUT
1817

1918
from lib.controller.controller import start
2019
from lib.core.common import unArrayizeValue
@@ -276,7 +275,7 @@ def scan_start(taskid):
276275
tasks[taskid]["fdLog"] = pipes[taskid][1]
277276

278277
# Launch sqlmap engine
279-
procs[taskid] = execute("python sqlmap.py --pickled-options %s" % base64pickle(tasks[taskid]), shell=True, stdin=PIPE, stdout=PIPE, stderr=STDOUT, close_fds=False)
278+
procs[taskid] = execute("python sqlmap.py --pickled-options %s" % base64pickle(tasks[taskid]), shell=True, stdin=PIPE, stdout=PIPE, stderr=PIPE, close_fds=False)
280279

281280
return jsonize({"success": True})
282281

@@ -291,9 +290,10 @@ def scan_output(taskid):
291290
if taskid not in tasks:
292291
abort(500, "Invalid task ID")
293292

294-
stdout = recv_some(procs[taskid], t=1, e=0)
293+
stdout = recv_some(procs[taskid], t=1, e=0, stderr=0)
294+
stderr = recv_some(procs[taskid], t=1, e=0, stderr=1)
295295

296-
return jsonize({"stdout": stdout})
296+
return jsonize({"stdout": stdout, "stderr": stderr})
297297

298298
@get("/scan/<taskid>/delete")
299299
def scan_delete(taskid):

0 commit comments

Comments
 (0)