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:
parent
ca72bf7371
commit
00a5d64256
Binary file not shown.
Binary file not shown.
@ -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,
|
||||
|
@ -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")
|
||||
|
5
test.py
5
test.py
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user