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 18.104.22.168:46576->22.214.171.124: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...