• Python(GUI)


    fofa查询(GUI界面)

    #coding=utf-8
    
    from tkinter import *
    
    from tkMessageBox import *
    
    import requests
    
    import json
    
    import base64
    
    ip_test=[]
    
    flag=""
    
    session=requests.session()
    
    header={
        'Upgrade-Insecure-Requests': '1',
        'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36'  
    }
    
    
    
    class Application(Frame):
        def __init__(self, master=None):
            Frame.__init__(self, master)
            self.pack()
            self.createWidgets()
    
        def createWidgets(self):
            self.EmailInput = Entry(self)
            self.EmailInput.insert(END,"fofa邮箱")
            self.ApilInput = Entry(self)
            self.ApilInput.insert(END,"fofaApi")
            self.query = Entry(self)
            self.query.insert(END,"查询的字段")
            self.EmailInput.pack()
            self.ApilInput.pack()
            self.query.pack()
            self.alertButton = Button(self,text='Go', command=self.request)
            self.alertButton.pack()
            pass
        def storage_data(self) :
    
            data_file=open("./Mikasa.txt","a")
    
            for io in ip_test :
                data_file.write(io+"
    ")
            showinfo("Complete","存储在当前路径下的Mikasa.txt")
            exit()
            pass
    
        def hello(self):#Test_For_Noob
            name = self.EmailInput.get()
            showinfo('Message', 'Hello, %s' % name)
        def request(self):
            email= self.EmailInput.get()
            apikey=self.ApilInput.get()
            query=base64.b64encode(self.query.get())
            flag=base64.b64encode(self.query.get())
            self.list_test=Listbox(self)
            url="https://fofa.so/api/v1/search/all?email={}&key={}&qbase64={}&page=1".format(email,apikey,query)
            try :
                Saber=session.get(url,headers=header)
    
                request=json.loads(Saber.text)['results']
    
                for data in request :
                    self.list_test.insert(0,str(data[0]))
                    ip_test.append(str(data[0]))
                self.list_test.pack()
    
    
    
    
            except Exception:
                print("出现未知错误!!")
                exit()
            self.alertButton2 = Button(self,text='存储数据', command=self.storage_data)
            self.alertButton2.pack()
    
    Mikasa=Application()
    
    Mikasa.master.title("Fofa批量查询by(Mikasa)")
    
    Mikasa.mainloop()

    使用截图:

    python的GUI界面是真的舒服啊。

    原本还是想用Pyinstaller打包,但是打包之后一直是使用不了,如果有大佬知道怎么回事的话,望告知。

    github地址

    后记:写的实在是太烂了,希望师傅们能指点一下。

  • 相关阅读:
    SQL 统计两个表的数据,按同一日期分组
    SQL 隐藏手机号中间四位
    SVN本地代码未提交而被覆盖
    [转]VS2012 快捷键
    IE8下String的Trim()方法失效的解决方案
    IE8下导入EXCEL数据传到客户端以附件下载
    jenkins插件
    OJ练习28——T118 Pascal's Triangle
    OJ练习27——T112 Path Sum
    OJ练习26——T111 Minimum Depth of Binary Tree
  • 原文地址:https://www.cnblogs.com/Mikasa-Ackerman/p/PythonGUI.html
Copyright © 2020-2023  润新知