linux - Spoofing a TCP Server handshake failing -


i looking build simple server proxy tcp connections @ gateway of network (none malicious intent) tcp handshake failing.

using netfilter, have managed change ip , port of incoming tcp packets diverted application , change them original on way out updating checksums.

my server sending syn-ack, gets intended host ack never generated. according wireshark packet formed no problems checksum, syn , ack values seem match up.

here tcp dump output

successful handshake without proxy

16:21:08.887938 ip 192.168.1.1.37513 > 192.168.2.56.12105: flags [s], seq 4201716329,     win 14000, options [mss 1400,sackok,ts val 727682 ecr 0,nop,wscale 2], length 0 16:21:08.889870 ip 192.168.2.56.12105 > 192.168.1.1.37513: flags [s.], seq 34328406, ack 4201716330, win 14480, options [mss 1460,sackok,ts val 1879286956 ecr 727682,nop,wscale 5], length 0 16:21:08.891751 ip 192.168.1.1.37513 > 192.168.2.56.12105: flags [.], ack 1, win 3500, options [nop,nop,ts val 727683 ecr 1879286956], length 0 

failing handshake proxy

16:21:49.767611 ip 192.168.1.1.37514 > 192.168.2.56.12105: flags [s], seq 2057472079, win 14000, options [mss 1400,sackok,ts val 731770 ecr 0,nop,wscale 2], length 0 16:21:49.768522 ip 192.168.2.56.12105 > 192.168.1.1.37514: flags [s.], seq 1201001621, ack 2057472080, win 14480, options [mss 1460,sackok,ts val 7621570 ecr 731770,nop,wscale 4], length 0 

after client , server resend ack/syn-ack.

is there obvious missing? or have advice on how should start debug issue?

it depends how changed packets. use iptables nat change ip address , port number?

in case, client drops packet because believes not correct packet, though ip, port, ack right.


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -