Created
April 12, 2014 04:44
-
-
Save nevdull77/10519183 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- scapy-2.1.0-rfmon/scapy/arch/pcapdnet.py 2009-09-23 10:27:36.000000000 -0400 | |
+++ scapy-2.1.0/scapy/arch/pcapdnet.py 2014-04-11 20:54:49.000000000 -0400 | |
@@ -52,7 +52,14 @@ | |
class _PcapWrapper_libpcap: | |
def __init__(self, *args, **kargs): | |
self.pcap = pcap.pcapObject() | |
- self.pcap.open_live(*args, **kargs) | |
+ if sys.platform == 'darwin' and 'pcap_set_rfmon' not in dir(self.pcap): | |
+ warning("Mac OS WiFI monitor mode not supported unless python-libpcap patched for OS X is used.") | |
+ | |
+ if sys.platform == 'darwin': | |
+ self.pcap.pcap_set_rfmon(args[0], 1) | |
+ self.pcap.pcap_activate() | |
+ else: | |
+ self.pcap.open_live(*args, **kargs) | |
def setfilter(self, filter): | |
self.pcap.setfilter(filter, 0, 0) | |
def next(self): | |
@@ -67,6 +74,8 @@ | |
elif hasattr(pcap,"open_live"): # python-pcapy | |
class _PcapWrapper_pcapy: | |
def __init__(self, *args, **kargs): | |
+ if sys.platform == 'darwin': | |
+ warning("Mac OS WiFI monitor mode not supported unless patched python-libpcap is used.") | |
self.pcap = pcap.open_live(*args, **kargs) | |
def next(self): | |
try: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment