Wednesday, 26 September 2018

linux - Server substitution. Emulating internet server

I have two networks sequent networks both hidden under own NAT 192.168.31.0/24 -> 192.168.33.0/24 -> Internet


I have a TCP server on 192.168.33.35 and a client on 192.168.31.32


A client does a TCP request to server located in the internet at 66.66.66.66, for example. I want the last gateway 192.168.33.1 to send the request to 192.168.33.35 instead and trick the client.


The most feasible of what I tried is:


iptables -t nat -I PREROUTING -d 66.66.66.66 -j DNAT --to-destination 192.168.33.35
iptables -t nat -I POSTROUTING -s 192.168.33.35 -j SNAT --to-source 66.66.66.66

The server received the Syn packet and replied. But the source IP of the server response seems to remain 192.168.33.35 after passing the gateway. And packet gets lost received by 192.168.31.1 gateway.


Looks like SNAT part is not working.


What can I do to emulate/spoof the server with standard openWrt tools?

No comments:

Post a Comment

Where does Skype save my contact's avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...