Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/319.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python Scapy无法捕获半径响应_Python_Linux_Networking_Scapy_Radius - Fatal编程技术网

Python Scapy无法捕获半径响应

Python Scapy无法捕获半径响应,python,linux,networking,scapy,radius,Python,Linux,Networking,Scapy,Radius,我试图使用Scapy向我的RADIUS服务器发送一个简单的RADIUS访问请求,但Scapy未能捕获响应。我使用了tcpdump和Scapy sniff来验证客户端是否确实收到了access accept 以下是我的设置: 数据包:(AVP是一个自定义构建层) 2号航站楼 >>> sr(pkt, iface='eth0', filter='udp and port 1812', timeout=5) Begin emission: .Finished to send 1 pa

我试图使用Scapy向我的RADIUS服务器发送一个简单的RADIUS访问请求,但Scapy未能捕获响应。我使用了tcpdump和Scapy sniff来验证客户端是否确实收到了access accept

以下是我的设置:

数据包:(AVP是一个自定义构建层)

2号航站楼

>>> sr(pkt, iface='eth0', filter='udp and port 1812', timeout=5)
Begin emission:

.Finished to send 1 packets.
.
Received 2 packets, got 0 answers, remaining 1 packets
(<Results: TCP:0 UDP:0 ICMP:0 Other:0>, <Unanswered: TCP:0 UDP:1 ICMP:0 Other:0>)

在此之后,我开始在eclipse中运行一个简单的测试,并尝试逐步完成该程序,据我所知,
sr()

scapy的
sniff
是否捕获访问接受数据包?是的,先生。在上面的嗅探片段中,服务器是10.200.202.19,客户端是10.200.202.191您是否尝试了srp()而不是sr()?我添加了一个以太网头,并尝试了srp(),结果是相同的。确保您在以太网中有正确的MAC
usesr:~$ sudo tcpdump -i eth0 'udp and port 1812'
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes
****SEND PACKET FROM OTHER TERMINAL****
18:05:47.567307 IP radclient.10999 > radserver.radius: RADIUS, Access Request (1), id: 0x00 length: 61
18:05:47.568041 IP radserver.radius > radclient.10999: RADIUS, Access Accept (2), id: 0x00 length: 20
>>> sr(pkt, iface='eth0', filter='udp and port 1812', timeout=5)
Begin emission:

.Finished to send 1 packets.
.
Received 2 packets, got 0 answers, remaining 1 packets
(<Results: TCP:0 UDP:0 ICMP:0 Other:0>, <Unanswered: TCP:0 UDP:1 ICMP:0 Other:0>)
>>> a = sniff(iface='eth0', filter='udp and port 1812')
♥>>> a
<Sniffed: TCP:1 UDP:2 ICMP:0 Other:0>
>>> a.summary()
Ether / IP / TCP 10.200.202.191:ssh > 10.200.201.242:51044 PA / Raw
Ether / IP / UDP 10.200.202.191:10999 > 10.200.202.19:radius / Raw
Ether / IP / UDP 10.200.202.19:radius > 10.200.202.191:10999 / Raw / Padding
>>> a[1].hashret()
'\x00\x08\x00\x00\x00\xac\x11'
>>> a[2].hashret()
'\x00\x08\x00\x00\x00\xac\x11'
>>> a[2].answers(a[1])
1