Is there an easy way (or is it possible at all) to rewrite a TCP packet as it leaves the machine?
For example if I run
telnet binfalse.de 22
it will search for an unused port to leave the machine. In this case it's
root@srv % lsof -i -P -n | grep telnet telnet 10150 user 3u IPv4 1159425 0t0 TCP 126.96.36.199:46576->188.8.131.52:22 (ESTABLISHED)
But now I want to rewrite these packets to let the server think the requests came from port
1337, or somewhat like this. Of course I know that I don't have to expect an answer in my
Of course on
1337 another program is listening, so telling
telnet to speak through
1337 is no option...