forked from calebstewart/pwncat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.py
executable file
·30 lines (23 loc) · 974 Bytes
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!./env/bin/python
import json
import stat
import time
import shutil
import subprocess
import pwncat.manager
import pwncat.platform.windows
# Create a manager
with pwncat.manager.Manager("data/pwncatrc") as manager:
# Tell the manager to create verbose sessions that
# log all commands executed on the remote host
# manager.config.set("verbose", True, glob=True)
# Establish a session
# session = manager.create_session("windows", host="192.168.56.10", port=4444)
# session = manager.create_session("windows", host="192.168.122.11", port=4444)
# session = manager.create_session("linux", host="pwncat-ubuntu", port=4444)
session = manager.create_session("linux", host="127.0.0.1", port=4444)
# session.platform.powershell("amsiutils")
with open("/tmp/random", "rb") as source:
with session.platform.open("/tmp/random", "wb") as destination:
shutil.copyfileobj(source, destination)
manager.interactive()