最有效的方式来操作TCP头ISN号 [英] Most efficient way to manipulate ISN numbers in TCP headers

查看:386
本文介绍了最有效的方式来操作TCP头ISN号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在写一个程序,将能够创造稳定的TCP连接,并有超过ISN号码完全控制。我用C写,我在那里我认识非常有限已经达到极限了点,我想知道是否有这样做的更好的方法。

I am currently trying to write a program that will be able to create stable a TCP connection and have complete control over the ISN numbers. I've been writing in C and I am at a point where my very limited knowledge has reached its limits and I was wondering if there's a better way of doing it.

我试过手动构建头,采用原始套接字没有内核的干扰,这是一个挑战发送和接收数据包。

What I tried was building the headers manually, using raw sockets to send and recieve the packets without the kernel interfering, which is a challenge.

因此​​,无论语言,有什么事你看是操纵ISN的最有效和最简单的方法是什么?

So regardless of language, what do you reckon is the most efficient and easiest way of manipulating the ISN?

推荐答案

那么,ISN是随机的方式prevent ISN perediction攻击generatred(的 http://www.thegeekstuff.com/2012/01/tcp-sequence-number-attacks/ )。

Well, ISN is generatred in a random way to prevent ISN perediction attack (http://www.thegeekstuff.com/2012/01/tcp-sequence-number-attacks/).

Linux的网络协议栈,使用功能 tcp_v4_init_sequence 来生成ISN(的 http://lxr.free-electrons.com/source/net/ipv4/tcp_ipv4.c#L101 ),这个函数调用 secure_tcp_sequence_number 函数( HTTP: //lxr.free-electrons.com/source/net/core/secure_seq.c#L106 )来完成这项工作。看看此功能,并尝试克隆它,以便在与用户空间的code使用它。

The Linux Network stack, use the function tcp_v4_init_sequence to generate the ISN (http://lxr.free-electrons.com/source/net/ipv4/tcp_ipv4.c#L101), this function call secure_tcp_sequence_number function (http://lxr.free-electrons.com/source/net/core/secure_seq.c#L106) to do the job. Take a look at this function and try to clone it so can use it with your code from userspace.

如果你有足够的时间,你可以看看 RFC 6528的部分3 http://www.rfc-editor.org/rfc/rfc6528.txt ),它描述了如何生成ISN的算法

If you have enough time you can look at section 3 of the RFC 6528 (http://www.rfc-editor.org/rfc/rfc6528.txt), it describe an algorithm on how to generate ISN:

ISN = M + F(localip, localport, remoteip, remoteport, secretkey)

和努力实现它,如果你想:)

And try to implement it, if you want :)

这篇关于最有效的方式来操作TCP头ISN号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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