Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Is there a way to disable TCP state management of OS, for example on a specific port, or on another ip or if not, disabling the whole tcp management and managing it in an application with root access?

I need a linux/mac based solution but windows-based solutions can also help.

More info:

I want to make a special proxy, a send relay actually, which manipulates the packet before delivering it to the destination in a way that the original sender gets the answer directly. Sending is easy but the OS of the final receiver rejects the packet and terminates the semi-connection.

share|improve this question
    
You can do this. It's frequently done for satellite communications links to spoof the ACK before the SYN has actually received the packet. –  Tom O'Connor Feb 23 '12 at 13:45
add comment

1 Answer

up vote 3 down vote accepted

I can't tell which of these you are trying to accomplish:

You want to intercept traffic before it gets handed to the application that owns the socket?

Add relevant rules to the firewall tables sending the packet to a ULOG target and handle it in your userspace code that way. Look at the iptables manpage and search for ULOG for details.

You want to send crafted packets out on the network hand-crafting parameters such as source MAC/IP/whatever?

You need root permissions to do this and you can do so using a raw socket. Python's scapy is an easy way of doing so.

share|improve this answer
1  
The RST packets were my problem. I used this command: sudo iptables -A OUTPUT -s MYIP -p tcp --sport MYPORT -j DROP –  Reza Mohammadi Feb 23 '12 at 15:01
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.