From: acevest Date: Sat, 19 Sep 2015 17:10:22 +0000 (+0800) Subject: ... X-Git-Url: http://zhaoyanbai.com/repos/?a=commitdiff_plain;h=1d7bcbf21863a16fdd54e8c38e1a6ad51a154b02;p=acecode.git ... --- diff --git a/tools/hack/ant.py b/tools/hack/ant.py index d9a203a..d017094 100755 --- a/tools/hack/ant.py +++ b/tools/hack/ant.py @@ -46,7 +46,8 @@ def ClientEntry() : cs.send(data) elif fd == cs : rsp = DoRecv(cs) - print rsp + sys.stdout.write(rsp) + sys.stdout.flush() except Exception, e : print('[*] Exception! Exiting. {0}'.format(str(e))) @@ -57,14 +58,13 @@ def ExecuteCommand(cmd) : try : output = subprocess.check_output(cmd.strip(), stderr=subprocess.STDOUT, shell=True) except Exception, e: - output = 'Failed to execute command. {0}'.format(str(e)) + output = 'Failed to execute command. {0}\n'.format(str(e)) return output def ClientHandler(cs, ca) : global gArgs while True : if gArgs.shell : - print "SendShell" cs.send("") rs, _, _ = select.select([cs, sys.stdin], [], []) for fd in rs :