attach

Keylogger in 8 minutes! (sends to email!)



Sharing buttons:

today we're gonna learn how to build a

keylogger that sends the keystrokes of

the person's computer directly to your

email and it's going to be built with

Python so let's first take a look at

what it does and then we will take a

look at the code so we'll run Python

keylogger

and you'll see it'll bring up this main

screen here and now we can enter the

email that we want the keystrokes to be

sent to in my case dev test Tyler at

Gmail then you want to enter the

password for that email that you just

entered so it has access to that alright

and it has started logging my keystrokes

so or we'll start logging my keystrokes

now that we've entered the password

we're gonna minimize that let it run in

the background minimize the recorder

there and this is the email it's gonna

be sent to and let's pretend we're going

to go into Gmail now and let's pretend

we're gonna sign in to my account or my

other email and let's pick some fake

passwords for now right we don't want to

enter my actual password just for

security reasons of say s word one two

three okay and already you see there's a

first email here and it's captured all

my keystrokes right gmail.com Osipovich

email account password password one two

three and let's suppose maybe we're just

doing some googling so adopt a shelter

at say Pittsburgh okay and there's an

option a humane animal rescue humane

animal rescue rescue rescue Pittsburgh

PA okay and there we are um so let's

click in there and let's suppose maybe

we want to is there a login button

probably there's

meet our animals see it's not really a

create an account there so let's let's

just type a little more adopt a dog

Pittsburgh and sometimes the emails take

a little bit to send oh okay so there we

go there's our second email and as you

can see it's started and even got the

incorrect spelling there and in time

emails a little slow today but the

program will send my last keystrokes

over to this email so that's how it

works

um and so let's now let's take a look at

the code and to get started we're gonna

need to import some Python libraries to

get past the SMTP the email protocol

thing library and then this PI input

keyboard which is linked in the

documents below for this pineapple

keyboard so got an import those three

and just kind of show you where we're at

this is the PI input link that'll be

below and you're gonna want to scroll

down to monitoring the keyboard and if

you want to try it on your own first I

would recommend taking a look at this

documentation and giving that a go if

not follow along with the code here and

you'll notice we got this fancy ASCII

art here for keylogger

um I didn't make it on my own it's part

of a ASCII art generator you can find

online and you can change what you want

right so this is blocks but you could

use alpha or whatever you want here to

create your own kind of ASCII art for

your opener for your keylogger all right

underneath that we want to get an email

address to send it to to send the code

to we have this get pass a library that

we imported and the idea is that when we

get the password it stores it its it'll

store it in this password variable but

when you type it in the get pass is used

to stop the stop the keys actual

keystrokes from appearing right you

don't want your password to just be

visible to anybody when you type it so

it just leaves this blank as you type it

when you hit enter it'll still work and

this

boilerplate for sending an email which

you can find in here sending emails with

Python real Python com.com

excuse me I'll link that below also

that's very helpful all right I got some

global variables here full log word and

an email character limit this one's

particularly interesting right now I

have it every 50 characters send an

email

you could also say every hundred

characters or thousand characters it's

up to you every five characters send an

email whatever you want to do and then

down here is the listener for the

keyboard this is boilerplate from that

real Python documentation go take a look

at that this is how you set up the

listener and then this is the on press

function that's down here that's set up

with the listener and when a key is

pressed this is what we want to do right

so let's go down to the else first rig

if if none of these are true so if the

key is not space it's not enter it's not

shift and it's not backspace then we're

gonna do this else and what this else is

say we're gonna get the character from

front we're gonna listen for the

character which is here and it's going

to be inside of these quotes now this is

the way I got it to work there might be

a way to get it to work without having

to go through the quotes and then get

rid of the quotes but anyways to get the

character here so it's like something on

lines of it's gonna look like that a

wrapped in quotes right I guess it

doesn't work in Python there we go a

wrapped in quotes and then underneath

there this next line it's gonna get rid

of the quotes so then you're just gonna

end up with a and now we want to take

that character a or whatever the input

was on the keyboard and store it inside

of the word which is empty right now so

maybe we type a it stores a B its doors

BC its door C and once you get a whole

word and if and then that user pushes

space or enter once you have that whole

word and they'll have the whole word

once they push space or enter then we're

gonna add a empty space on the end of

word and attach it to the full log which

we're gonna send in and in the email

eventually right so we're gonna excuse

me we're going to append the word to the

full log

all right basically if the key is shift

left or right ignore it and just return

that returns extra clutter and if it's a

new Kias backspace we want to get rid of

that character in the log so that's why

we have this what else yeah so that's

pretty much it for entering characters

into the log and once you get a full

vote once you get 50 or more characters

a bit here build up there's a full log

that we keep adding words to once it's

50 or more characters so if lengths are

full log its greater than or equal to

the character limit which is 50 in this

case then we're going to want to send

the log and reset the full log to empty

so that we can fill it up again and send

it again

and this send log function is down here

it's part of the boilerplate for the

email and server dot send mail and you

put in the email that you want to send

it to and from in my case the same email

right I want to send it to myself and

you put in the text that you want to

send in this case log the full log for

me and that's it that's the whole key

logger so if you liked this video please

subscribe thanks for watching and see

you soon thanks bye