Sample Header Ad - 728x90

How to get scapy to sniff on the correct interface?

3 votes
0 answers
8764 views
The sniff function in scapy in python2.7 worked fine before upgrading my linux Operating System. from scapy.all import * client_mac="c4:3d:c7:8f:03:19" wlan_mac="00:c0:ca:6d:ac:fa" sniff(iface="mon0",prn=packet_callback,filter="(ether dst "+client_mac+" and ether src "+wlan_mac+") or (ether src "+client_mac+" and ether dst "+wlan_mac+")") After the upgrade I ran my script again in python2.7 and got these messages below from scapy WARNING: No route found for IPv6 destination :: (no default route?) tcpdump: WARNING: eth0: no IPv4 address assigned How can I get scapy to sniff on the correct interface? I tried adding conf.iface="mon0" above the sniff function but still no luck. using ifconfig -a I got the following eth0 Link encap:Ethernet HWaddr 00:25:22:e9:b1:28 UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:65536 Metric:1 RX packets:12 errors:0 dropped:0 overruns:0 frame:0 TX packets:12 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:720 (720.0 B) TX bytes:720 (720.0 B) mon0 Link encap:UNSPEC HWaddr 00-C0-CA-6D-AC-FA-3A-30-00-00-00-00-00-00-00-00 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:635 errors:0 dropped:638 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:192290 (187.7 KiB) TX bytes:0 (0.0 B) wlan0 Link encap:Ethernet HWaddr 00:c0:ca:6d:ac:fa inet addr:192.168.1.7 Bcast:192.168.1.255 Mask:255.255.255.0 inet6 addr: fe80::2c0:caff:fe6d:acfa/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:866 errors:0 dropped:0 overruns:0 frame:0 TX packets:811 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:385790 (376.7 KiB) TX bytes:99505 (97.1 KiB)
Asked by repzero (524 rep)
Apr 12, 2015, 11:15 PM
Last activity: Apr 13, 2015, 11:08 PM