Scapy无法发送ipv6数据包 [英] Scapy fails to send ipv6 packets

查看:349
本文介绍了Scapy无法发送ipv6数据包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我是新来的,所以请善待。

Hello everyone i am new here so please be kind.

我最近一直在使用scapy,以便向选定的启用ipv6的服务器发送和接收ipv6数据包。代码的要点在这里:

I have been using scapy lately in order to send and recieve ipv6 packets to selected ipv6 enabled servers. The gist of the code is here:

text = line[:-1]
            #destination=getIPv6Addr(line[:-1])
            destination="2607:f1c0:1000:60e0:7992:97f7:61b2:2814"
            source="2001:630:d0:f105:5cfe:e988:421a:a7b7"
            syn = IPv6(dst=destination,src=source) / TCP(sport=555,dport=80,flags="S")#flag S is syn packet
            syn.show()
            syn_ack = sr1(syn,timeout=11)

当我执行代码时,这个是我得到的:

When i execute the code hoever this is what i get:

Begin emission:
Finished to send 1 packets.
.................WARNING: No route found for IPv6 destination :: (no default route?)
WARNING: No route found for IPv6 destination 2607:f1c0:1000:60e0:7992:97f7:61b2:2814 (no default route?)
............................................................................................................
Received 1322 packets, got 0 answers, remaining 1 packets

根据我的理解,数据包已经发送,但是从未得到响应(0个答案)。这让我想到使用wireshark来嗅探数据包。

From what i understand, the packet has been sent nevertheless a response is never gotten(0 answers). This made me think of using wireshark to sniff the packet.

与过滤器一起使用时:

ip6 net 2607:f1c0:1000:60e0:7992:97f7:61b2:2814

我意识到数据包从未发送过第一名!有谁知道为什么会发生这种情况或者在这里发生什么?

I realised the packet was never sent at the first place! Does anyone know why this is happening or what is hapening here?

问候
Martinos

Regards Martinos

编辑:

通过评论仔细检查,我意识到路线列表不应该是空的。没有路由发送数据包。我不知道如何添加它们!请帮助我做的是:

On closer inspection from comments, i realized that the route list SHOULD not be empty. There are no routes to send the packet. I am not sure how to add them! Please help here is what i did:

我试图从我的设备获取所有接口。以下是我的回复:

i tried to get all the interfaces from my device. Here is what i got back:

{'flags': 33, 'link_addr': b0:90:20:52:41:53, 'type': 6, 'name': 'eth0', 'mtu': 1500L}
{'flags': 33, 'link_addr': b0:90:20:52:41:53, 'type': 6, 'name': 'eth1', 'mtu': 1500L}
{'flags': 33, 'link_addr': 00:50:56:a0:1e:df, 'type': 6, 'name': 'eth2', 'mtu': 1500L}
{'flags': 33, 'link_addr': 00:50:56:a0:1e:df, 'type': 6, 'name': 'eth3', 'mtu': 1500L}
{'flags': 33, 'link_addr': b0:90:20:52:41:53, 'type': 6, 'name': 'eth4', 'mtu': 1500L}
{'flags': 33, 'link_addr': b0:90:20:52:41:53, 'type': 6, 'name': 'eth5', 'mtu': 1500L}
{'flags': 32, 'link_addr': 00:50:56:a0:00:6c, 'type': 6, 'name': 'eth6', 'mtu': 0L}
{'flags': 32, 'link_addr': 00:50:56:a0:01:0e, 'type': 6, 'name': 'eth7', 'mtu': 0L}
{'flags': 32, 'link_addr': 00:50:56:a0:6e:61, 'type': 6, 'name': 'eth8', 'mtu': 0L}
{'addr': 152.78.61.39/24, 'mtu': 1500L, 'flags': 33, 'link_addr': 00:50:56:a0:1e:df, 'type': 6, 'name': 'eth9'}
{'flags': 33, 'link_addr': b0:90:20:52:41:53, 'type': 6, 'name': 'eth10', 'mtu': 1500L}
{'flags': 33, 'link_addr': b0:90:20:52:41:53, 'type': 6, 'name': 'eth11', 'mtu': 1500L}
{'flags': 33, 'type': 23, 'name': 'ppp0', 'mtu': 1494L}
{'flags': 33, 'link_addr': 20:41:53:59:4e:ff, 'type': 23, 'name': 'ppp1', 'mtu': 3256L}
{'addr': 127.0.0.1/8, 'flags': 3, 'type': 24, 'name': 'lo0', 'mtu': 1500L}
{'flags': 33, 'type': 131, 'name': 'tun0', 'mtu': 4091L}
{'flags': 32, 'type': 131, 'name': 'tun1', 'mtu': 1480L}
{'flags': 33, 'type': 131, 'name': 'tun2', 'mtu': 1460L}
{'flags': 33, 'type': 131, 'name': 'tun3', 'mtu': 1464L}
{'flags': 32, 'type': 131, 'name': 'tun4', 'mtu': 1280L}
{'flags': 32, 'type': 131, 'name': 'tun5', 'mtu': 1280L}
{'flags': 33, 'type': 131, 'name': 'tun6', 'mtu': 1472L}
{'flags': 32, 'type': 131, 'name': 'tun7', 'mtu': 1280L}

如你所见,那里没有ipv6地址。如果没有列出ipv6地址,我该如何发送ipv6数据包?在extend中,这是来自cmd的ipconfig:

As you can see, nowhere in there there is an ipv6 address. How am i supposed to send ipv6 packets if no ipv6 address is listed? in extend, here is the ipconfig from cmd:

    Ethernet adapter Local Area Connection 4:

   Connection-specific DNS Suffix  . : ecs.soton.ac.uk
   IPv6 Address. . . . . . . . . . . : 2001:630:d0:f105:5cfe:e988:421a:a7b7
   Temporary IPv6 Address. . . . . . : 2001:630:d0:f105:e8bc:7c26:9a40:31b8
   Link-local IPv6 Address . . . . . : fe80::5cfe:e988:421a:a7b7%17
   IPv4 Address. . . . . . . . . . . : 152.78.61.39
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : fe80::210:18ff:fee5:5bfa%17
                                       152.78.61.254

Tunnel adapter 6TO4 Adapter:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Tunnel adapter Teredo Tunneling Pseudo-Interface:

   Connection-specific DNS Suffix  . :
   IPv6 Address. . . . . . . . . . . : 2001:0:5ef5:79fd:142e:398d:67b1:c2d8
   Link-local IPv6 Address . . . . . : fe80::142e:398d:67b1:c2d8%13
   Default Gateway . . . . . . . . . :

Tunnel adapter isatap.ecs.soton.ac.uk:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . : ecs.soton.ac.uk

这是在VM上运行但我不认为这很重要。

This is run on a VM but i dont think it matters.

请有人帮助我这非常重要!如何配置scapy以了解如何发送ipv6数据包。为什么我在接口列表中看不到ipv6地址?

PLEASE someone help me this is very important! how can i configure scapy in order to understand how to send ipv6 packets. and why do i see no ipv6 addresses in the list above of interfaces?

推荐答案

以太网适配器确实同时具有IPv6地址和默认网关。您可以

The ethernet adapter indeed has both an IPv6 address and a default gateway. You could


  • 尝试 ping -6 ipv6.google.com 查看是否存在任何IPv6连接。我认为必须有,因为我可以ping你的IPv6地址,除非它现在被重新分配给其他人。

  • Try to ping -6 ipv6.google.com to see if there is any IPv6 connectivity. I think there must be, since I can ping your IPv6 address just fine, unless it has been reassigned to somebody else now.

检查路由表以查看没有多余的路线
特别是,Teredo界面可能会造成麻烦。把它关掉。
(netsh interface teredo set state disabled)

Inspect the routing tables to see there are no superfluous routes In particular, the Teredo interface might be causing trouble. Turn it off. (netsh interface teredo set state disabled)

Teredo:
http://tools.ietf.org/html/rfc4380
http://en.wikipedia.org/wiki/Teredo_tunneling

我做不知道如何使用scapy配置IPv6路由和接口。

I do not know how to configure IPv6 routing and interfaces using scapy.

我做了一个答案,因为评论中没有足够的空间。我仍然建议你向超级用户询问。我不能充分帮助你,因为我不熟悉JANET或Windows网络配置。

I made this an answer, since there is not enough room in the comments. I do still suggest you ask on superuser. I can not sufficiently help you, since I am not familiar with either "JANET" or Windows networking configuration.

这篇关于Scapy无法发送ipv6数据包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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