12. SOCKS icmp tunneling

ICMP tunneling encapsulates traffic within ICMP packets - containing echo requests, echo responses

Tools: https://github.com/utoni/ptunnel-ng Once a tunnel is created, we will be able to proxy our traffic through the ptunnel-ng client. We can start the ptunnel-ng server on the target pivot host. Let's start by setting up ptunnel-ng.

git clone https://github.com/utoni/ptunnel-ng.git

this is broken on kali btw

You need to install autoconf NOT autoREconf:
$ sudo apt install autoconf

after that you can use:
$ ./autogen.sh

remote host run:

sudo ./ptunnel-ng -r10.129.202.64 -R22

attack host:

sudo ./ptunnel-ng -p10.129.202.64 -l2222 -r10.129.202.64 -R22

With the ptunnel-ng ICMP tunnel successfully established, we can attempt to connect to the target using SSH through local port 2222 (-p2222).

this whole module is insanely frustrating and nothing is working so i believe i will be skipping it. you need to compile ptunnel-ng with the same glib as whats installed on the compromised host


sudo ./configure LDFLAGS=-static 
sudo make

then scp it over and run everything ![](/img/Pasted image 20240825160736.png) this worked but if you fucked it up the first time you have to restart everything

![](/img/Pasted image 20240825162229.png) starting ssh dynamic port forward using the ping tunnel we've created

then using xfreerdp to RDP into an internal host: ![](/img/Pasted image 20240825162253.png)

could NOT get this shit to work on kali. note you have to build the binary with libraries that match the victim host