如何设置Linux内核不发送RST_ACK,以便我可以在原始套接字中给SYN_ACK [英] How to set linux kernel not to send RST_ACK, so that I can give SYN_ACK within raw socket

查看:245
本文介绍了如何设置Linux内核不发送RST_ACK,以便我可以在原始套接字中给SYN_ACK的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想问一个关于原始套接字编程和linux内核TCP处理的经典问题.我已经对一些相同的线程进行了研究,例如 Linux原始套接字编程问题如何重现TCP协议3向握手 TCP ACK欺骗,但仍然无法获取原始套接字?解决方案.

I want to ask a classic question about raw socket programming and linux kernel TCP handling. I've done the research to some same threads like linux raw socket programming question, How to reproduce TCP protocol 3-way handshake with raw sockets correctly?, and TCP ACK spoofing, but still can't get the solution.

我尝试使服务器不侦听任何端口,但嗅探来自远程主机的SYN数据包.服务器进行一些计算之后,它将把SYN_ACK数据包发送回相应的SYN数据包,以便我可以手动创建TCP连接,而无需包括内核的操作.我已经创建了原始套接字,并通过它发送了SYN_ACK,但是数据包无法到达远程主机.当我在服务器(Ubuntu Server 10.04)上进行tcpdump并在客户端(Windows 7)上进行wireshark时,服务器返回RST_ACK而不是我的SYN_ACK数据包.经过研究后,我得到了一些信息,说明我们无法抢占内核的TCP处理能力.

I try to make a server which don't listen to any port, but sniff SYN packets from remote hosts. After the server do some calculation, it will send back a SYN_ACK packet to corresponding SYN packet, so that I can create TCP Connection manually, without including kernel's operation. I've create raw socket and send the SYN_ACK over it, but the packet cannot get through to the remote host. When I tcpdump on the server (Ubuntu Server 10.04) and wireshark on client (windows 7), the server returns RST_ACK instead of my SYN_ACK packet. After doing some research, I got information that we cannot preempt kernel's TCP handling.

还有其他方法可以破解或将内核设置为不对那些数据包响应RST_ACK吗? 我已经在服务器的本地ip中添加了防火墙,以告知内核,防火墙后面可能正在等待数据包,但是还是没有运气

Is there still any other ways to hack or set the kernel not to responds RST_ACK to those packets? I've added a firewall to local ip of server to tell the kernel that maybe there's something behind the firewall which is waiting for the packet, but still no luck

推荐答案

您尝试应该为您完成这项工作.

should do the job for you.

这篇关于如何设置Linux内核不发送RST_ACK,以便我可以在原始套接字中给SYN_ACK的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆