mirror of
https://github.com/calebstewart/pwncat.git
synced 2024-11-24 01:25:37 +01:00
21 lines
458 B
Python
21 lines
458 B
Python
#!/usr/bin/env python3
|
|
|
|
|
|
from pwncat.gtfobins import *
|
|
import subprocess
|
|
|
|
|
|
def which(path: str, quote=False):
|
|
try:
|
|
output = subprocess.check_output(f"which {path}", shell=True)
|
|
except subprocess.CalledProcessError:
|
|
return None
|
|
|
|
return output.decode("utf-8").strip()
|
|
|
|
|
|
gtfo = GTFOBins("data/gtfobins.json", which)
|
|
|
|
all_binaries = list(gtfo.iter_methods(Capability.SHELL))
|
|
print(all_binaries[0].build(shell="/bin/bash", suid=True))
|