MCPcopy
hub / github.com/NullArray/AutoSploit / cmdline

Function cmdline

lib/settings.py:307–329  ·  view source on GitHub ↗

send the commands through subprocess

(command, is_msf=True)

Source from the content-addressed store, hash-verified

305
306
307def cmdline(command, is_msf=True):
308 """
309 send the commands through subprocess
310 """
311
312 lib.output.info("Executing command '{}'".format(command.strip()))
313 split_cmd = [x.strip() for x in command.split(" ") if x]
314
315 sys.stdout.flush()
316 stdout_buff = []
317
318 try:
319 proc = Popen(split_cmd, stdout=PIPE, bufsize=1)
320 for stdout_line in iter(proc.stdout.readline, b''):
321 stdout_buff += [stdout_line.rstrip()]
322 if is_msf:
323 print("(msf)>> {}".format(stdout_line).rstrip())
324 else:
325 print("{}".format(stdout_line).rstrip())
326 except OSError as e:
327 stdout_buff += "ERROR: " + str(e)
328
329 return stdout_buff
330
331
332def check_for_msf():

Callers 1

mainFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected