3

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)
repzero
  • 484
  • 5
  • 13
  • How about adding the output of `ifconfig -a` to your question, so we can see what interface names exist, and their settings. –  Apr 13 '15 at 02:06
  • @Bruce Ediger..Question edited to show the output of ifconfig -a – repzero Apr 13 '15 at 23:09
  • @Xorg do you solve it?? If yes, please add the solution!! Thank you :) – Teo Apr 28 '15 at 10:00
  • The `tcpdump` warning is right: there's no IPv4 address assigned. ifconfig should show an `inet addr: ...` line like it does for the `lo` interface. Set it in [/etc/network/interfaces](https://www.cyberciti.biz/faq/setting-up-an-network-interfaces-file/) – JimB Nov 29 '18 at 21:13

0 Answers0