Beispiel #1
0
 def connect():
     password = passwordEntry.get()
     #connectwifi = wifi.WiFi()
     state = wifi.WiFi().normalconnect(name=wifiname,
                                       password=password)
     if state:
         messagebox.showinfo(message='连接成功!!!')
     else:
         messagebox.showerror(message='密码错误!!!')
     connectWindow.destroy()
Beispiel #2
0
        def threadblase():
            threadNum = self.thread_num_Entry.get()
            digitNum = self.passwd_digit_Entry.get()
            index = self.wifiList.curselection()
            try:
                wifiname = self.wifiList.get(index)
            except:
                messagebox.showwarning(title='警告', message='请选择一个WiFi!!!')
            else:
                try:
                    threadnum = int(threadNum)
                    digitnum = int(digitNum)
                except:
                    messagebox.showerror(message='输入含有非数字内容')
                else:
                    if threadnum > 4500 or threadnum < 1:
                        messagebox.showwarning(message='线程数应该在(0-4500)之间')
                    elif digitnum > 11 or digitnum < 1:
                        messagebox.showwarning(
                            message='请输入正确的密码位数\n目前支持最大密码11位')
                    else:
                        try:
                            pswd = int(way.get())
                            iterPassword = passwd.Password().passwd_product(
                                type=pswd, num=int(digitNum))
                        except:
                            messagebox.showwarning(message='请选择密码类型!!!')
                        else:
                            request = messagebox.askokcancel(
                                message='该过程可能会非常漫长并且可能会占用系统资源,确定是否继续?')
                            if request:
                                messagebox.showinfo(message='请等待...')
                                try:
                                    result = wifi.WiFi().thread_connect(
                                        threadnum=threadNum,
                                        name=wifiname,
                                        password=iterPassword)
                                except:
                                    pass
                                finally:
                                    if result == None:

                                        messagebox.showinfo(message='爆破失败!!!')
                                    else:
                                        messagebox.showinfo(
                                            message='爆破成功  密码:' +
                                            str(result[0]))
                            else:
                                pass
Beispiel #3
0
 def fileblase():
     loads = fileroad.get()
     index = self.wifiList.curselection()
     try:
         wifiname = self.wifiList.get(index)
     except:
         messagebox.showwarning(title='警告', message='请选择一个WiFi!!!')
     else:
         try:
             password = passwd.Password().passwd_read(file=loads)
         except:
             messagebox.showerror(message='请导入文件!!!')
         else:
             result = wifi.WiFi().blastconnect(name=wifiname,
                                               password=password)
             if result == -1:
                 messagebox.showinfo(message='爆破失败')
             else:
                 messagebox.showinfo(message='爆破成功  密码为:' + result)
Beispiel #4
0
 def disconnect():
     if wifi.WiFi().wifi_disconnect():
         messagebox.showinfo(message='成功断开连接!!!')
Beispiel #5
0
 def scan():
     wifilist = wifi.WiFi().wifi_scan()
     self.wifiList.delete(0, 'end')
     for i in wifilist:
         self.wifiList.insert(0, i)
Beispiel #6
0
import wifi
import router
import string
import random

wifi = wifi.WiFi()
router = router.Router()


def randstr(length):
    letters = string.ascii_letters + string.digits
    return ''.join([random.choice(letters) for i in range(length)])


router_config = ({
    'ssid': randstr(1),
    'key': None,
    'encryption': 'none',
    'channel': 1
}, {
    'ssid': randstr(1),
    'key': randstr(8),
    'encryption': 'psk',
    'channel': 6
}, {
    'ssid': randstr(16),
    'key': randstr(32),
    'encryption': 'psk2',
    'channel': 11
}, {
    'ssid': randstr(32),
Beispiel #7
0
# This file is executed on every boot (including wake-boot from deepsleep)
#import esp
#esp.osdebug(None)

# noinspection PyUnresolvedReferences
import webrepl
import wifi
import gc

from config import CONFIG

webrepl.start()
wifi.WiFi(CONFIG).connect()
gc.collect()
Beispiel #8
0
# system modules
import utime as time
import gc
# custom modules
import wifi
import ntp
import vbbapi
from machine import UART, Pin
import esp

debugging = False

# connect to WiFi
w = wifi.WiFi()

# use switch on GPIO 4 (D2)
pin_summertime = Pin(4, Pin.IN, Pin.PULL_UP)
if pin_summertime.value() == 0:  # swtich is pressed (low) = summertime
    summertime = True
    if debugging:
        print('Using CEST')
else:
    summertime = False
    if debugging:
        print('Using CET')

# get current time from NTP server
now = ntp.get_time(summertime)
if debugging:
    print(time.localtime(now))