Skip to content
Snippets Groups Projects
Commit bb59680a authored by Phil's avatar Phil
Browse files

Fixed some imports

parent af92015a
No related branches found
No related tags found
No related merge requests found
...@@ -22,13 +22,6 @@ except ImportError: ...@@ -22,13 +22,6 @@ except ImportError:
log_loading.info("Can't import PyX. Won't be able to use psdump() or pdfdump().") log_loading.info("Can't import PyX. Won't be able to use psdump() or pdfdump().")
PYX=0 PYX=0
try:
from Crypto.Cipher import ARC4
except ImportError:
log_loading.info("Can't import python Crypto lib. Won't be able to decrypt WEP.")
def str2mac(s): def str2mac(s):
return ("%02x:"*6)[:-1] % tuple(map(ord, s)) return ("%02x:"*6)[:-1] % tuple(map(ord, s))
......
...@@ -12,6 +12,7 @@ import scapy.utils ...@@ -12,6 +12,7 @@ import scapy.utils
from scapy.config import conf from scapy.config import conf
from scapy.data import * from scapy.data import *
from scapy.supersocket import SuperSocket from scapy.supersocket import SuperSocket
import scapy.arch
...@@ -108,7 +109,7 @@ def attach_filter(s, filter): ...@@ -108,7 +109,7 @@ def attach_filter(s, filter):
if not TCPDUMP: if not TCPDUMP:
return return
try: try:
f = os.popen("%s -i %s -ddd -s 1600 '%s'" % (config.conf.prog.tcpdump,config.conf.iface,filter)) f = os.popen("%s -i %s -ddd -s 1600 '%s'" % (conf.prog.tcpdump,conf.iface,filter))
except OSError,msg: except OSError,msg:
log_interactive.warning("Failed to execute tcpdump: (%s)") log_interactive.warning("Failed to execute tcpdump: (%s)")
return return
...@@ -122,7 +123,7 @@ def attach_filter(s, filter): ...@@ -122,7 +123,7 @@ def attach_filter(s, filter):
# XXX. Argl! We need to give the kernel a pointer on the BPF, # XXX. Argl! We need to give the kernel a pointer on the BPF,
# python object header seems to be 20 bytes. 36 bytes for x86 64bits arch. # python object header seems to be 20 bytes. 36 bytes for x86 64bits arch.
if X86_64: if scapy.arch.X86_64:
bpfh = struct.pack("HL", nb, id(bpf)+36) bpfh = struct.pack("HL", nb, id(bpf)+36)
else: else:
bpfh = struct.pack("HI", nb, id(bpf)+20) bpfh = struct.pack("HI", nb, id(bpf)+20)
......
...@@ -10,6 +10,13 @@ from scapy.fields import * ...@@ -10,6 +10,13 @@ from scapy.fields import *
from scapy.plist import PacketList from scapy.plist import PacketList
from scapy.layers.l2 import * from scapy.layers.l2 import *
try:
from Crypto.Cipher import ARC4
except ImportError:
log_loading.info("Can't import python Crypto lib. Won't be able to decrypt WEP.")
### Fields ### Fields
class Dot11AddrMACField(MACField): class Dot11AddrMACField(MACField):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment