1
0
mirror of https://github.com/calebstewart/pwncat.git synced 2024-11-23 17:15:38 +01:00

Updated loader/stagetwo for windows platform

This commit is contained in:
Caleb Stewart 2021-01-12 00:46:40 -05:00
parent ca72bf7371
commit 00a5d64256
5 changed files with 21 additions and 3 deletions

Binary file not shown.

Binary file not shown.

View File

@ -433,6 +433,18 @@ class Platform:
def __str__(self):
return str(self.channel)
@property
def interactive_input(self):
if not self.interactive:
raise RuntimeError("interactive_input not valid outside interactive mode")
return self.channel
@property
def interactive_output(self):
if not self.interactive:
raise RuntimeError("interactive_input not valid outside interactive mode")
return self.channel
def process_output(self, data):
"""Process output from the terminal when in interactive mode.
This is mainly used to check if the user exited the interactive terminal,

View File

@ -466,6 +466,13 @@ class Windows(Platform):
gz.write(stagetwo_dll)
encoded = base64.b64encode(compressed.getvalue())
# for i in range(0, len(encoded), 128):
# self.channel.sendline(encoded[i : i + 128])
# self.session.manager.log(self.channel.recvline().strip().decode("utf-8"))
# self.channel.sendline(b"")
# self.session.manager.log(self.channel.recvline().strip().decode("utf-8"))
self.channel.sendline(encoded)
self.channel.recvuntil(b"READY")
self.channel.recvuntil(b"\n")

View File

@ -9,9 +9,8 @@ import time
manager = pwncat.manager.Manager("data/pwncatrc")
# Establish a session
session = manager.create_session("windows", host="192.168.122.11", port=4444)
# manager.interactive()
session = manager.create_session("windows", host="192.168.56.10", port=4444)
# session = manager.create_session("windows", host="192.168.122.11", port=4444)
hosts = (
session.platform.Path("C:\\") / "Windows" / "System32" / "drivers" / "etc" / "hosts"