Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Raw Socket programming on Linux, how can I prevent the underlying OS from responding to an incoming packet?

I am sending SYN packets using raw sockets in Linux. The response(SYN+ACK) is being intercepted by the OS and it is responding with a RST. I would like to prevent the OS from intercepting this packet, and let it be handled by my application. How can I accomplish this?

like image 663
akshat Avatar asked Feb 01 '26 10:02

akshat


1 Answers

You could make a rule in IPtables to filter outgoing RST packets.

iptables -A OUTPUT -p tcp --tcp-flags RST RST -j DROP

Don't forget to disable it later! Have fun.

like image 196
Kasper Avatar answered Feb 03 '26 01:02

Kasper