Beispiel #1
0
    def __init__(self, interface, ssid, bpffilter=""):
        self.callbacks = Callbacks(self)
        self.ssids = []
        self.current_ssid_index = 0

        self.interface = interface
        self.inet_interface = None
        self.channel = 1
        self.mac = if_hwaddr(interface)
        self.wpa = 0
        self.ieee8021x = 0
        self.lfilter = None
        self.hidden = False
        if bpffilter == "":
            self.bpffilter = "not ( wlan type mgt subtype beacon ) and ((ether dst host " + self.mac + ") or (ether dst host ff:ff:ff:ff:ff:ff))"
        self.ip = '10.0.0.1/24'
        self.boottime = time()
        self.sc = 0
        self.aid = 0
        self.mutex = threading.Lock()

        # Protocol handlers
        self.eap = EAPHandler()
        self.arp = ARPHandler()

        self.add_ssid(ssid)
        self.beaconTransmitter = self.FakeBeaconTransmitter(self)

        self.tint = None
Beispiel #2
0
    def from_file(cls, path):
        conf = Conf(path)

        # Required
        interface = conf.get('interface', 'mon0')
        ssid = conf.get('ssid', 'github.com/rpp0/scapy-fakeap')
        bpffilter = conf.get('filter', "")

        # Apply required settings
        ap = FakeAccessPoint(interface, ssid, bpffilter=bpffilter)

        # Apply optional settings
        ap.channel = int(conf.get('channel', 1))
        ap.mac = conf.get('mac', if_hwaddr(interface))
        ap.wpa = conf.get('wpa', 0)
        ap.ieee8021x = conf.get('ieee8021x', 0)
        ap.ip = conf.get('ip', '10.0.0.1/24')

        return ap