예제 #1
0
    def run(self):
        iwdev = self.args.iface

        try:
            print("Configuring owl interface...")
            check_wifi_config(iwdev)
            time.sleep(5)  # time to wake up owl process
        except ModeMonitorException:
            print(
                "Error, mode monitor not suported in the given interface, press ctr+c to continue"
            )
            return
        except BadInterfaceException:
            print("Error, inteface not found, press ctr+c to continue")
            return
        except OwlException:
            print(
                "Error, there was a problem setting up owl, press ctr+c to continue, if not insalled --> https://github.com/seemoo-lab/owl.git"
            )
            return
        except Exception as e:
            print(
                f"Error, something went wrong configuring the interface, press ctr+c to continue --> {e}"
            )
            return

        try:
            self.start_listetninig()
        except:
            print("")
            print("Bye")
            sys.exit()
예제 #2
0
    def read_state(self, ssid, airdrop, ttl, iwdev, dev_id):
        """Read the state of the nearby Apple ble devices
        
        Args:
            ssid (Bool): Check to get ssid to phone results
            airdrop (Bool): Check the airdrop to get the phone hash
            ttl (int): Time to live to refresh
            iwdev (str): Wifi interface
            dev_id (int): Bluetooth interface
        """
        ble_utils = Ble_Apple_Utils(ssid, airdrop, ttl, iwdev, dev_id)
        if airdrop:
            try:
                print_info("Configuring owl interface...")
                check_wifi_config(iwdev)
                sleep(1.5)  # time to wake up owl process
            except ModeMonitorException:
                print_error(
                    "Error, mode monitor not suported in the given interface, press ctr+c to continue"
                )
                return
            except BadInterfaceException:
                print_error(
                    "Error, inteface not found, press ctr+c to continue")
                return
            except OwlException:
                print_error(
                    "Error, there was a problem setting up owl, press ctr+c to continue, if not insalled --> https://github.com/seemoo-lab/owl.git"
                )
                return
            except Exception as e:
                print_error(
                    f"Error, something went wrong configuring the interface, press ctr+c to continue --> {e}"
                )
                return

        if ssid:
            thread_ssid = Thread(target=ble_utils.get_ssids, args=())
            thread_ssid.daemon = True
            thread_ssid.start()

            thread2 = Thread(target=ble_utils.start_listetninig, args=())
            thread2.daemon = True
            thread2.start()

            thread3 = Thread(target=ble_utils.adv_airdrop, args=())
            thread3.daemon = True
            thread3.start()

        ble_utils.init_bluez()
        thread1 = Thread(target=ble_utils.do_sniff, args=(False, ))
        thread1.daemon = True
        thread1.start()
        MyApp = App(airdrop, ble_utils)
        MyApp.run()
        thread1.join()
예제 #3
0
    def run(self):
        iwdev = str(self.args.get("iface", "wlan0"))
        interval = int(self.args.get("interval", 3))

        try:
            print_info("Configuring owl interface...")
            check_wifi_config(iwdev)
            time.sleep(1.5) # time to wake up owl process
        except ModeMonitorException:
            print_error("Error, mode monitor not suported in the given interface, press ctr+c to continue")
            return
        except BadInterfaceException:
            print_error("Error, inteface not found, press ctr+c to continue")
            return
        except OwlException:
            print_error("Error, there was a problem setting up owl, press ctr+c to continue, if not insalled --> https://github.com/seemoo-lab/owl.git")
            return
        except Exception as e:
            print_error(f"Error, something went wrong configuring the interface, press ctr+c to continue --> {e}")
            return

        results = {}
        thread2 = Thread(target=self.start_listetninig, args=())
        thread2.daemon = True
        thread2.start()

        try:
            while True:
                time.sleep(interval)
                devs = get_devices()
                for dev in devs:
                    hash = dev.get("hash", None)
                    hash = hash.replace("\\x04)", "")
                    hash = hash.replace("\\x00)", "")
                    if(hash not in results.keys()):
                        results.update({hash : dev})
                        #print(f"Someone with phone number hash \033[92m{hash}\033[0m has tried to use AirDrop")
                        print(f"Someone with phone number hash {hash} has tried to use AirDrop")
        except:
            print("")
            print_error("Bye")
예제 #4
0
from src import application, socketio, IFACE, CHANNEL
from utils.setup_flask import detect_ngrok
from utils.ble_apple.wireless_interface import check_wifi_config

if __name__ == '__main__':
    try:
        check_wifi_config(IFACE, CHANNEL)
        detect_ngrok()
        socketio.run(application)
    except Exception as e:
        print("Error setting the server, might be ngrok or setting up card")
예제 #5
0
파일: owl.py 프로젝트: xuiqzy/Airdrop-Crazy
from utils.ble_apple.wireless_interface import BadInterfaceException, ModeMonitorException, OwlException, check_wifi_config
from time import sleep

if __name__ == "__main__":
    check_wifi_config("wlx503eaaec4c39")
    try:
        while (True):
            sleep(5)
    except:
        print("Bye")