View Single Post
Posts: 458 | Thanked: 783 times | Joined on Jan 2010 @ France
#1
Hi all,

Here is my first attempt to package the latest version of Ping Tunnel :

Ping Tunnel :

Ping Tunnel 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.

Overview :

Ping Tunnel is not a feature-rich tool by any means, but it does what it advertises. So here is what it can do:
  • Tunnel TCP using ICMP echo request and reply packets.
  • Connections are reliable (lost packets are resent as necessary).
  • Handles multiple connections.
  • Acceptable bandwidth (150 kb/s downstream and about 50 kb/s upstream are the currently measured maximas for one tunnel, but with tweaking this can be improved further).
  • Authentication, to prevent just anyone from using your proxy.

So what do you need for all this to work?
  • One computer accessible on the internet that is not firewalled (or at least allows incoming ICMP packets).
  • A computer to act as the client (this will usually be your laptop, on the go..).
  • Root access, preferably on both computers.
  • A posix-compliant OS, with libpcap (for packet capturing) and its associated headers installed (typically available in a dev-package on Ubuntu).
  • Or: Windows with mingw and WinPcap installed.


Homepage :

http://www.cs.uit.no/~daniels/PingTunnel/index.html

Download packages from extra-devel :

Activate all repositories following this tutorial : Repositories Activation

Then, as usual, as root, install with :

Code:
-bash-2.05b# apt-get install ptunnel && /usr/sbin/ptunnel --help
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  mbarcode-plugin-webrequest
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  libselinux1
The following NEW packages will be installed:
  libselinux1 ptunnel
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 98,9kB of archives.
After this operation, 279kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://repository.maemo.org fremantle/free libselinux1 2.0.65-maemo1 [72,2kB]
Get:2 http://repository.maemo.org fremantle/free ptunnel 0.72-1maemo0 [26,7kB]
Fetched 98,9kB in 10s (9467B/s)
Selecting previously deselected package libselinux1.
(Reading database ... 51360 files and directories currently installed.)
Unpacking libselinux1 (from .../libselinux1_2.0.65-maemo1_armel.deb) ...
Selecting previously deselected package ptunnel.
Unpacking ptunnel (from .../ptunnel_0.72-1maemo0_armel.deb) ...
Setting up libselinux1 (2.0.65-maemo1) ...
+ [ xu = x-t ]
Setting up ptunnel (0.72-1maemo0) ...
ptunnel v 0.72.
Usage:   /usr/sbin/ptunnel -p <addr> -lp <port> -da <dest_addr> -dp <dest_port> [-m max_tunnels] [-v verbosity] [-f logfile]
         /usr/sbin/ptunnel [-m max_threads] [-v verbosity] [-c <device>]
     -p: Set address of peer running packet forwarder. This causes
         ptunnel to operate in forwarding mode - the absence of this
         option causes ptunnel to operate in proxy mode.
    -lp: Set TCP listening port (only used when operating in forward mode)
    -da: Set remote proxy destination address if client
         Restrict to only this destination address if server
    -dp: Set remote proxy destionation port if client
         Restrict to only this destination port if server
     -m: Set maximum number of concurrent tunnels
     -v: Verbosity level (-1 to 4, where -1 is no output, and 4 is all output)
     -c: Enable libpcap on the given device.
     -f: Specify a file to log to, rather than printing to standard out.
     -s: Client only. Enables continuous output of statistics (packet loss, etc.)
-daemon: Run in background, the PID will be written in the file supplied as argument
-syslog: Output debug to syslog instead of standard out.
   -udp: Toggle use of UDP instead of ICMP. Proxy will listen on port 53 (must be root).

Security features:  [-x password] [-u] [-setuid user] [-setgid group] [-chroot dir]
     -x: Set password (must be same on client and proxy)
     -u: Run proxy in unprivileged mode. This causes the proxy to forward
         packets using standard echo requests, instead of crafting custom echo replies.
         Unprivileged mode will only work on some systems, and is in general less reliable
         than running in privileged mode.
         Please consider combining the following three options instead:
-setuid: When started in privileged mode, drop down to user's rights as soon as possible
-setgid: When started in privileged mode, drop down to group's rights as soon as possible
-chroot: When started in privileged mode, restrict file access to the specified directory
-setcon: Set SELinux context when all there is left to do are network I/O operations
         To combine with -chroot you will have to `mount --bind /proc /chrootdir/proc`

Starting the proxy (needs to run as root):
 [root #] /usr/sbin/ptunnel
Starting a client (also needs root):
 [root #] /usr/sbin/ptunnel -p proxy.pingtunnel.com -lp 8000 -da login.domain.com -dp 22 -c eth0
And then using the tunnel to ssh to login.domain.com:
 [user $] ssh -p 8000 localhost
And that's it. Enjoy your tunnel!

-bash-2.05b#
After successful installation, just use it !!!


Hope you like it ...

A++
 

The Following 3 Users Say Thank You to colin.stephane For This Useful Post: