3

我想识别其源 IP 地址被伪造的 UDP 或 TCP 数据包。我的猜测是,即使数据包是用具有 hping 的程序伪造的,所有伪造数据包的 MAC src 地址仍然相同,这是正确的吗?

如果我的想法不正确,我如何识别这些被伪造的数据包,并且看起来每个数据包都有不同的来源?

谢谢。

4

3 回答 3

4

MAC addresses can be faked too.

With TCP, its easy to identify / handle this. You'll reply to a fake SYN packet with a SYN-ACK. If it was a real client, it'd reply with an ACK to complete the handshake. Only caveat is that you'll have to implement syn-cookies so that you don't create state & use up resources while waiting for an ACK.

With UDP, there is no way to know, since the protocol is connection-less. If you send a reply to the fake packet, you're not guaranteed a response from a "real" client. So there is no way to identify a fake one.

于 2011-11-11T22:50:05.847 回答
2

在我看来,UDP 和 TCP 与此无关。您只谈论第 2 层 (MAC) 和第 3 层 (IP)。即使那样,您也无法知道,因为源 MAC 地址应该是离接收者最近的路由器的地址(假设数据包不是来自您的子网。)所以​​您应该看到大多数情况下相同的 MAC 地址入站数据包(同样,仅限互联网流量)。

现在有像 p0f 这样的分析工具可以处理数据包的签名,您可以尝试根据该信息进行一些启发式分析,但无法确定非常具体的内容。

于 2011-11-11T22:49:54.953 回答
1

从数据包中,您可以获得最近节点的 MAC 地址。是的,您可以将 ACK 数据包发送到伪造的源地址(IP),然后使用 Traceroute 命令知道源数据包的路径,这样您至少可以找到原始数据包的位置。它在 TCP 中运行良好,您也可以得到确认。

于 2011-11-11T23:06:01.127 回答