title: Packet sniffing in Python (Windows)
body: <p>What is the best way to sniff network packets using Python?</p>
  
  <p>I've heard from several places that the best module for this is a module called Scapy, unfortunately, it makes python.exe crash on my system. I would assume that it's just a problem with how I installed it, except that many other people have told me that it doesn't work particularly well on Windows. (If anyone is interested, I'm running Windows Vista, which might affect things).</p>
  
  <p>Does anyone know of a better solution?</p>
  
  <p>UPD:</p>
  
  <p>After reading the answer telling me to install PyPcap, I messed around with it a bit and found out that Scapy, which I had tried using, was telling me to install PyPcap as well, except that it's a modified version for it's use. It was this modified PyPcap that was causing the problem, apparently, since the example in the answer also caused a hang.</p>
  
  <p>I installed the original version of PyPcap (from Google's site), and Scapy started working fine (I didn't try many things, but at least it didn't crash as soon as I started sniffing). I sent a new defect ticket to the Scapy developers: <a href="http://trac.secdev.org/scapy/ticket/166" rel="noreferrer">http://trac.secdev.org/scapy/ticket/166</a>, hope they can do something with it.</p>
  
  <p>Anyways, just thought I'd let y'all know.</p>