ptunnel-ng.8 8.1 KB

  1. .TH ptunnel-ng 8 "December 19, 2017" "Version 1.00"
  2. .SH NAME
  3. ptunnel-ng \- tunnel TCP connections over ICMP echo request/reply packets.
  5. .na
  6. .B ptunnel-ng
  7. \-p <address> \-l <port> \-r<address> \-R<port> [\-m <magic>] [\-c <connections>] [\-v <level>] [\-L <interface>] [\-o<file>] [\-s] [\-P <password>] [\-\-udp] [\-\-unprivileged] [\-d<pidfile>] [\-S] [\-u<user>] [\-g<group>] [\-C<directory>] [\-e<context>] [\-h]
  9. PingTunnel-NG is a fork from the famous PingTunnel with the aim of an improved and refactored code base and some additional features.
  10. .PP
  11. 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. At first glance, this might seem like a rather useless thing to do, but it can actually come in handy in some cases. The following example illustrates the main motivation in creating ptunnel:
  12. .PP
  13. Setting: You're on the go, and stumble across an open wireless network. The network gives you an IP address, but won't let you send TCP or UDP packets out to the rest of the internet, for instance to check your mail. What to do? By chance, you discover that the network will allow you to ping any computer on the rest of the internet. With ptunnel, you can utilize this feature to check your mail, or do other things that require TCP.
  15. .TP
  16. .SH Client options only:
  17. .TP
  18. .B \-p
  19. .PD 0
  20. .TP
  21. .BI \-\-proxy= proxy_address
  22. .PD
  23. Specify the host on which the proxy is running.
  24. .TP
  25. .B \-l
  26. .PD 0
  27. .TP
  28. .BI \-\-listen= listen_port
  29. .PD
  30. Specifies the port on which the client will listen for incoming TCP connections.
  31. .TP
  32. .B \-s
  33. .PD 0
  34. .TP
  35. .BI \-\-statistics
  36. .PD
  37. Enables continuous output of statistics (packet loss, etc.)
  38. .TP
  39. .SH Server and Client options:
  40. .TP
  41. .B \-m
  42. .PD 0
  43. .TP
  44. .BI \-\-magic= magic_value
  45. .PD
  46. Sets a different magic value which can be used to bypass Cisco's IPS. It may also work for other IDS/IPS/Firewalls.
  47. .br
  48. .B Remember: This value has to be the same on the server and client!
  49. .TP
  50. .B \-r
  51. .PD 0
  52. .TP
  53. .BI \-\-remote\-adr= destination_addr
  54. .PD
  55. Specifies the address to which you want your packets tunneled after reaching the proxy when in client mode, or restricts the destination packets can be forwarded to when in server mode.
  56. .TP
  57. .B \-R
  58. .PD 0
  59. .TP
  60. .BI \-\-remote\-port= destination_port
  61. .PD
  62. Specifies/restrict the port that the proxy should tunnel the TCP connection to.
  63. .TP
  64. .B \-c
  65. .PD 0
  66. .TP
  67. .BI \-\-connections= max_value
  68. .PD
  69. Set the maximum of concurrent tunnels.
  70. .TP
  71. .B \-v
  72. .PD 0
  73. .TP
  74. .BI \-\-verbosity= level
  75. .PD
  76. Controls the verbosity level. \-1 is no output, 0 shows errors only, 1 shows info messages, 2 gives more output, 3 provides even more output, level 4 displays debug info and level 5 displays absolutely everything, including the nasty details of sends and receives.
  77. .TP
  78. .B \-L
  79. .PD 0
  80. .TP
  81. .BI \-\-libpcap= network_device
  82. .PD
  83. Specify the network interface to capture packets from. Note that packet capturing isn't always necessary, but you should try this if you experience problems with ptunnel.
  84. .TP
  85. .B \-o
  86. .PD 0
  87. .TP
  88. .BI \-\-logfile= logfile
  89. .PD
  90. Specify a file to log to, rather than printing to standard out.
  91. .TP
  92. .B \-P
  93. .PD 0
  94. .TP
  95. .BI \-\-passwd= secret_password
  96. .PD
  97. Set a password (must be same on client and proxy) which will be used for the challenge response authentication. The program will try to hide the password from `/proc/PID/cmdline` but it may not work for ld wrapper or debugging/profiling tools like valgrind.
  98. .TP
  99. .BI \-\-udp
  100. .br
  101. .PD
  102. Enables tunneling over UDP port 53 (DNS) instead of using ICMP. This will only work if your proxy can accept incoming traffic on port 53, and the client is able to send data to the proxy on port 53. Note that this option does not wrap ptunnel's data in DNS\-compliant packets. This option must be given on both the proxy and client side for things to work correctly.
  103. .TP
  104. .BI \-\-unprivileged
  105. .PD
  106. 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.
  107. .TP
  108. .B \-d
  109. .PD 0
  110. .TP
  111. .BI \-\-daemon= pidfile
  112. .PD
  113. .B (Not available on Windows.)
  114. .br
  115. Run in background, writing PID to a pidfile.
  116. .TP
  117. .B \-S
  118. .PD 0
  119. .TP
  120. .BI \-\-syslog
  121. .PD
  122. .B (Not available on Windows.)
  123. .br
  124. Changes logging to use the built\-in syslog fascility.
  125. .TP
  126. .B \-u
  127. .PD 0
  128. .TP
  129. .BI \-\-user= username
  130. .PD
  131. .B (Not available on Windows.)
  132. .br
  133. When started in privileged mode (as root), drop down to user's rights as soon as possible.
  134. .TP
  135. .B \-g
  136. .PD 0
  137. .TP
  138. .BI \-\-group= groupname
  139. .PD
  140. .B (Not available on Windows.)
  141. .br
  142. When started in privileged mode (as root), drop down to group's rights as soon as possible. If you set
  143. .B \-\-user
  144. it is not required to set this option too. The program will use the group associated with that user.
  145. .TP
  146. .B \-C
  147. .PD 0
  148. .TP
  149. .BI \-\-chroot= directory
  150. .PD
  151. .B (Not available on Windows.)
  152. .br
  153. When started in privileged mode (as root), restrict file access to the specified directory.
  154. .TP
  155. .B \-e
  156. .PD 0
  157. .TP
  158. .BI \-\-setcon= context
  159. .PD
  160. .B (Only available on Linux.)
  161. .br
  162. Set SELinux context when all there is left to do are network I/O operations. In order to be able to combine with \-\-chroot you will have to `mount \-\-bind /proc /chrootdir/proc`.
  163. .TP
  164. .B \-h
  165. .PD 0
  166. .TP
  167. .BI \-\-help
  168. .br
  169. Displays brief usage information.
  171. The following assumes that ptunnel is run as root, both on the proxy and client. To tunnel ssh connections from the client machine via a proxy running on to the computer, the following command line would be used:
  172. .TP
  173. .B ptunnel \-p \-lp 8000 \-da \-dp 22
  174. .PP
  175. An ssh connection to can now be established as follows:
  176. .TP
  177. .B ssh \-p 8000 localhost
  178. .PP
  179. If ssh complains about potential man\-in\-the\-middle attacks, simply remove the offending key from the known_hosts file. The warning/error is expected if you have previously ssh'd to your local computer (i.e., ssh localhost), or you have used ptunnel to forward ssh connections to different hosts.
  180. Of course, for all of this to work, you need to start the proxy on your proxy\-computer ( Doing this is very simple:
  181. .B ptunnel
  182. If you find that the proxy isn't working, you will need to enable packet capturing on the main network device. Currently this device is assumed to be an ethernet-device (i.e., ethernet or wireless). Packet capturing is enabled by giving the -c switch, and supplying the device name to capture packets on (for instance eth0 or en1). The same goes for the client. On Mac OS X, packet capturing must always be enabled (both for proxy and client), as resent packets won't be received otherwise.
  183. To protect yourself from others using your proxy, you can protect access to it with a password using the <tt>\-x</tt> switch. The password is never sent in the clear, but keep in mind that it may be visible from tools like top or ps, which can display the command line used to start an application.
  185. .B ptunnel-ng
  186. does only exit if an invalid command line option is found or a fatal error during the initialisation process occurred. If this happens the exit value should always be non zero.
  187. The program does not exit until forced to do so by an external SIGNAL or if it crashes.
  188. .SH BUGS
  189. .B ptunnel-ng
  190. currently does not handle packet capturing on network interfaces other than ethernet or wireless correctly.
  192. PingTunnel-NG: Toni Uhlig (
  193. PingTunnel: Daniel Stoedle (
  194. Windows port: Mike Miller (
  195. SELinux support: Sebastien Raveau (
  196. Patches: Joe McKenzie, Steffen Wendzel and StalkR.
  197. .SH LICENSE
  198. .B ptunnel-ng
  199. is licensed under the BSD License.
  201. .TP
  202. The ptunnel-ng homepage is currently located here:
  204. .TP
  205. The ptunnel homepage is currently located here:
  207. .TP
  208. The freshmeat project page is located here:
  210. .PP
  211. Please take the time to rate ptunnel or ptunnel-ng if you find it useful. Thanks!