Ok so I found this code online and though it looked interesting so I ran it but can someone tell me why it doesn't work? I have scapy installed btw

#!/usr/bin/env python

from scapy.all import *
from scapy.error import Scapy_Exception

m_iface="wlan0"
filter_message="http"
count=0

def pktTCP(pkt):
    global count
    if pkt.haslayer(TCP) and pkt.getlayer(TCP).dport == 80 and pkt.haslayer(Raw):
            count=count+1
            print pkt.getlayer(Raw).load

sniff(iface=m_iface,prn=pktTCP) 

I ran it but can someone tell me why it doesn't work?

Depends. Whats not working? We can't really help you if we don't know about the situation of how you know it doesn't work.

Hmm... How about start with scapy?

@Hiroshe it just doesn't do anything

@Hiroshe CORRECTION: it only displays my own http requests and not others on the network. As in if I search something on another computer it doesn't appear on the program

Is the wifi card on monitor mode? Otherwise it will just ignore other packets.

@Hiroshe I was thinking that myself. When I run it I do sudo python sniffer.py

And with my google sniffer I do sudo python google.py -i mon0. And that only displays my packets. How do I put it in monitor mode?

If it helps I'm using a raspberry pi and the wipi as a dongle/wifi card thing

Depends if the card supports it. It's also dependant on the operating system. In unix, I think ifconfig can do it. Look it up in the info/man pages.

@Hiroshe I'm running linux Btw. Is there a way to do it to all cards like a command?
Edit: the wipi doesn't support monitor mode :(

@chriswelborn I will take a look now

Strangely enough the WiPi does support monitor mode. I put it into monitor mode successfully but my google sniffer isn't getting any unencrypted google searches. I did make sure it was http. Any help?

Are you detecting anything at all (even encrypted packets)?

That doesn't answer the question. Rephrased: Are you getting non-local packets at least?

Nothing. I will try it with a different sniffer though probably the one Chris suggested. See if that makes any difference.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.