FPIPE

Unix systems always seem to provide the most useful network tools first. Datapipe is a little more than 100 lines of C codea trivial amount in the Unix world. Before Cygwin and datapipe, no options for Windows-based port redirection were available. FPipe, by Foundstone, implements port redirection techniques natively in Windows. It also adds User Datagram Protocol (UDP) support, which datapipe lacks.

FPipe does not require any support DLLs or privileged user access; however, it runs only on the NT, 2000, and XP platforms. The lack of support DLLs or similar files makes it easy to pick up fpipe.exe and drop it onto a system. FPipe also adds more capability than datapipe in its ability to use a source port and bind to a specific interface.

Implementation

Whereas datapipe's usage is simple, FPipe's increased functionality necessitates several more command-line switches:

FPipe Option

Description

-?
-h

Prints the help text.

-c

Maximum number of simultaneous TCP connections. The default is 32. Note that this has no bearing (and doesn't make sense!) for UDP connections.

-i

The IP address of the listening interface.

-l

The listening port number.

-r

The remote port number (the port to which traffic is redirected).

-s

The source port used for outbound traffic.

-u

UDP mode.

-v

Prints verbose connection information.

As a simple port redirector, FPipe works like datapipe:

 $ ./datapipe 9080 80 http://www.google.com 

Here's FPipe's equivalent:

 C:\>fpipe -l 9080 -r 80 www.google.com Pipe connected:    In:         127.0.0.1:1971  --> 127.0.0.1:9080   Out:     192.168.0.184:1972  --> 216.239.33.101:80 

Unlike datapipe, FPipe does not go into the background. It will continue to report connections until you press CTRL-C. Notice that FPipe also indicates the peer IP addresses and the source port number of each connection. The s option allows FPipe to take further advantage of port specification:

 C:\>fpipe -l 139 -r 139  -s 88  192.168.97.154 

This example might appear trivial at first. After all, what's the use of redirecting one NetBIOS port to another? The advantage is that all SMB traffic from the port redirection has a source port of 88. This type of source port trick is useful to bypass misconfigured firewalls. Other good source ports to try are 20, 25, 53, and 80. Check out "Case Study: Packet Filters, Ports, and Problems" later in this chapter for more details on why source ports bypass network access rules.

The i option comes in handy on multi- homed systems, where you want to specify a particular interface on which to listen:

 C:\>fpipe -l 80 -r 22 -i 10.17.19.42 192.168.97.154 

The usefulness of this might seem rare, but it is useful on web servers. For example, IIS's web service might be bound to a specific adapter, but port 80 is allowed all interfaces. Set up FPipe to listen on one of the other interfaces, and port 80 is yours.

Note 

Unlike Unix, Windows does not require privileged access to open a socket on a reserved port (port numbers below 1024). On Unix, only root-equivalent accounts can open port 80.



Anti-Hacker Tool Kit
Anti-Hacker Tool Kit, Third Edition
ISBN: 0072262877
EAN: 2147483647
Year: 2006
Pages: 175

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net