I ported PingTunnel to Windows, using Cygwin and added some minor changes:
v0.62 — 16. Oct 2007
– Compiled with Cygwin — added windows support
– Updated to Winpcap v4.01
– added timeout value (-t), finetune your connection
Download PingTunnel v0.62 for Windows here (including source).
What is ptunnel?
Ptunnel is an application that allows you to reliably tunnel TCP connections
to a remote host using ICMP echo request and reply packets, commonly known as
ping requests and replies.
A simple example how to use ptunnel:
SERVER1 — start server:
1 2 3 4 5 6 7 8 9 10 11 12 | c:>ptunnel –v 4 –c “DeviceNPF_{EED408B…}“ [inf]: Enable pcap Mode using device: DeviceNPF_{EED408B…} [inf]: Starting ptunnel v 0.62. [inf]: © 2004–2005 Daniel Stoedle, daniels@cs.uit.no Windows Port by michu / www.neophob.com [inf]: HINT: start ptunnel with “-h” parameter to view help and Windows WinPcap devices [inf]: Forwarding incoming ping packets over TCP. [dbg]: Starting ping proxy.. [dbg]: Creating icmp datagram socket.. [inf]: Initializing pcap. [vbs]: Network: 138.191.41.0 [vbs]: Netmask: 255.255.255.0 [inf]: Ping proxy is listening in privileged mode. |
Info: Use the –c option (enable WinPcap on the given device) else the proxy will NOT work!
For Windows use the –h option (ptunnel.exe –h) to view all Windows WinPcap Devices.
Windows example 1 — Web Proxy:
CLIENT1 - start ptunnel client:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | C:>ptunnel –p <SERVER1> –lp 8000 –da <WEB-PROXY> –dp <PORT> –v 4 [inf]: Starting ptunnel v 0.62. [inf]: © 2004–2005 Daniel Stoedle, daniels@cs.uit.no Windows Port by michu / www.neophob.com [inf]: HINT: start ptunnel with “-h” parameter to view help and Windows WinPcap devices [inf]: Relaying packets from incoming TCP streams. [dbg]: Starting forwarder.. [vbs]: Proxy IP address: 138.191.41.18 [inf]: Incoming connection. [evt]: No running proxy thread — starting it. [dbg]: Adding proxy desc to run loop. Type is user. Will create socket: No [dbg]: Starting ping proxy.. [dbg]: Creating icmp datagram socket.. [inf]: Initializing pcap. [vbs]: Network: 10.226.64.0 [vbs]: Netmask: 255.255.255.0 [inf]: Ping proxy is listening in privileged mode. |
Info: WEB-PROXY is your web proxy server
Now point your browsers proxy settings to localhost 8000 and load a web site.
Windows example 2 — SSH:
CLIENT1 - start ptunnel client:
1 2 3 4 5 6 7 | $ ./ptunnel –p <SERVER1> –lp 8000 –da 127.0.0.1 –dp 22 –v 5 [inf]: Starting ptunnel v 0.62. [inf]: © 2004–2005 Daniel Stoedle, daniels@cs.uit.no Windows Port by michu / www.neophob.com [inf]: HINT: start ptunnel with “-h” parameter to view help and Windows WinPcap devices [inf]: Relaying packets from incoming TCP streams. [dbg]: Starting forwarder.. [vbs]: Proxy IP address: 138.191.41.18 |
Start PuTTY and connect to 127.0.0.1:8000…
Some additional information:
Timeout value (read timeout), default is 50ms, but you can change this setting via the “-t” option. Here is a small benchmark (100MB LAN) for SFTP file copy:
1 2 3 4 5 6 7 8 | Timeout value | down | up | |————–+——+——+ |1 | 62 | 75 | |20 | 30 | 41 | |50 | 20 | 15 | |200 | 4 | 6 | |————–+——+——+ kb/S kb/s |
Password: this option DOES NOT WORK! I don’t know why, but an easy workaround is: use SSH.
12 Comments
1 RepoX wrote:
Hi, now 0.7 version is out. Did you try to port it on windows?
2 Aaron wrote:
I may be dumb, but is suppose to be the IP address of you home computer that acts as the serer? Like 192.1.5 or the external IP address? Thanks!
3 michu wrote:
RepoX: this version has builld in windows support — so it should be easy to compile it yoyurself. perhaps I’ll look at it. Sorry no time atm.
4 Quack wrote:
I was able to get ptunnel-0.70 running on both Windows and Linux very easily by following these instructions:
_Linux_Host_
Linux Host running CentOS 5.2 — I simply installed the ptunnel package from Dag Wieers package repo!
_Windows_Host_
I installed MinGW by visiting www dot mingw dot org, and reading around on how to install the compiler and tools, and found that I just need to install their MinGW-5.1.4 installer which will download and install the necessary components (I picked: MinGW Base Tools, g++ compiler, and MinGW Make) to get the compiler going. After the installation was finished, I went to Sourceforge and downloaded the latest GNU Binutils, binutils-2.19.1-mingw32-bin.tar.gz, and unpacked those to upgrade the binutils in the C:MinGW directory.
Then, I downloaded and unpacked www dot winpcap dot org/install/bin/WpdPack_4_0_2.zip into C:Program Files, as the source code looks for the WinPcap headers to be in C:Program FilesWpdPackInclude.
Then, I installed the 4.0.2 version of WinPCAP from winpcap dot org so I could run the PTunnel program from this workstation.
To make the compilation work easily, I edited my PATH environmental variable to include the C:MinGWBin directory so the compiler would be able to find all of its tools. (That was also very easy, right-click “My Computer”, Properties, Advanced Tab, Environmental Variables.)
Then, I launched a new cmd prompt, cd’d into the directory with the PTunnel-0.70 source, and simply ran:
MinGW32-Make ptunnel.exe
That built the ptunnel.exe binary and I used it to connect to a ptunnel binary running on my CentOS box, and it worked great!
5 Tim wrote:
This seems to be an excellent program. My problem is that I have a Belkin router between my internet connection and my server (Windows server 2003). The ping never seems to get to the server. I tried opening port 22, but no change. Is there a specific port that the proxy server side of the software looks for? How does it know which port to capture from? Thanks for any help and suggestions.
6 Sakti wrote:
Can you give me example of server1 and web-proxy so I can practise that technic !
7 dwi ari wrote:
How can if ptunnel on the client side, combined with OpenVPN?
8 raden wrote:
ptunnel GUI (compiled) wont work on windows 7.
“there must be a succesful match first (c:program filesborlanddelphi7sourcetperlregexperlRegEx.pas, line 568″
9 michu wrote:
ptunnel has nothing to do with delphi — as its compiled with cygwin gcc. there may be something wrong with your dll files…
10 raden wrote:
any idea to edit dll files…???
thanks
11 nung wrote:
I use Ptunnel Unsuccessfully :(
My SSH Server on Fress BSD based, i use for PTunnel server
and my Ptunnel Client on WIndows XP. I use Ptunnel 0.70
at my PTunnel server always say:
iix# ptunnel –v 5 –c re0
[inf]: Starting ptunnel v 0.70.
[inf]: © 2004–2009 Daniel Stoedle,
[inf]: Forwarding incoming ping packets over TCP.
[dbg]: Starting ping proxy..
[dbg]: Attempting to create privileged ICMP raw socket..
[inf]: Initializing pcap.
[vbs]: Network: 1xx.xx1.40.X
[vbs]: Netmask: 255.255.255.0
[inf]: Ping proxy is listening in privileged mode.
[xfr]: Recv: 56 [0] bytes [seq = 0] [type = start] [ack = 65535] [icmp = 8] [user = yes] [pcap = 1]
[inf]: Incoming tunnel request from 20x.3.xxx.212.
[inf]: Starting new session to 127.0.0.1:1979 with ID 17059
[dbg]: Adding proxy desc to run loop. Type is proxy. Will create socket: Yes
[xfr]: Recv: 56 [0] bytes [seq = 0] [type = start] [ack = 65535] [icmp = 0] [user = yes] [pcap = 1]
[err]: Dropping duplicate proxy session request.
[xfr]: Send: 76 [40] bytes [seq = 0] [type = data] [ack = 0] [icmp = 0] [user = no]
[xfr]: Recv: 96 [40] bytes [seq = 0] [type = data] [ack = 0] [icmp = 0] [user = no] [pcap = 1]
[xfr]: Recv: 56 [0] bytes [seq = 1] [type = ack] [ack = 65535] [icmp = 8] [user = yes] [pcap = 1]
[dbg]: Received ack-series starting at seq 65535
[xfr]: Recv: 56 [0] bytes [seq = 1] [type = ack] [ack = 65535] [icmp = 0] [user = yes] [pcap = 1]
any body can help me?
12 Alexey wrote:
Thanks. Excellent program :)