I need the advice of a unix guru. I've been trying to create a man in the middle situation using NC and piped output. I tried
nc -l -p 81 | nc x.x.x.1 80 | nc -l -p 81
but that isnt able to bind to the same port as the first one. I can't seem to get the connection to go both ways. Here is an example of what I have tried against my routers administration page to test
bash-2.02# tail -f /var/hack/io | nc -l -p 82 &
bash-2.02# nc x.x.x.1 80 > /var/hack/io
GET / HTTP/1.1
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.
At which point I get an error page in the browser
I break out of the command and the error page is exactly what is in my IO file
bash-2.02# cat /var/hack/io
HTTP/1.0 400 Bad Request
Date: Tue, 14 Aug 2007 23:42:22 GMT
<HTML><HEAD><TITLE>400 Bad Request</TITLE></HEAD>
<BODY BGCOLOR="#cc9999"><H4>400 Bad Request</H4>
No request found.
Does this mean my "tunnel" is working but tail is saying "file truncated" when the connection is established which is confusing everything?