1
0
mirror of https://github.com/calebstewart/pwncat.git synced 2024-11-24 01:25:37 +01:00

Added support for a remote command to be run in the local context with at @ prefix

This commit is contained in:
John Hammond 2020-05-07 21:46:47 -04:00
parent a3e1469085
commit b29dcde252

View File

@ -276,10 +276,15 @@ class PtyHandler:
self.enter_raw()
continue
if len(line) > 0 and line[0] == "!":
# Allow running shell commands
subprocess.run(line[1:], shell=True)
continue
if len(line) > 0:
if line[0] == "!":
# Allow running shell commands
subprocess.run(line[1:], shell=True)
continue
elif line[0] == "@":
result = self.run(line[1:])
sys.stdout.buffer.write(result)
continue
argv = shlex.split(line)
@ -351,7 +356,7 @@ class PtyHandler:
with ProgressBar(
[("#888888", "downloading with "), ("fg:ansiyellow", f"{download.NAME}")]
) as pb:
counter = pb(range(os.path.getsize(path)))
counter = pb(range(size))
last_update = time.time()
def on_progress(copied, blocksz):