Hello and welcome.
Now is time to make our own over with the help of a javascript and the PSP which will be responsible
to this to all our key stroke and it to the text file.
So first of all simply go to this file or folder them and there's the docs after that and just create
the new Fallujah.
So I'll just name this is key logger
after this.
I'll just go over here and you can simply open the sublime just remove all of this.
So over here what do you need to do is you just send this to the same fold over here in the dam as the
docks and inside the key over now and I'll just name this is so let me say something like Key and disperse
into.
So we want the front page so are the web content.
So we'll make use of these simple test to be as free Web site.
So I'll just go to view page source copy all of this.
Go back here and let me just paste is done.
So this has some bit of content because we want to make the killer go.
To this record some keystrokes or anyone who will just press some key or basically any character from
the keyboard will be just recorded and will be sent to some text file.
So I want this feel to be vulnerable.
That means I'll just index some call him.
That means you'll just start making our own Zabriskie called with the help of the peer to file.
So first of all we have saved this.
So this create a new file again.
And in this new file we have to make use of a javascript call.
So let's make use of a Zabriskie code which will just be inside at the same for law which is this directory
which is lower.
So this is start with saving first.
So inside this key logo This is something like code.
And here I'll say this is always good file.
So this should be over here.
So javascript.
So let me save this stone.
Now let's just start by creating the variables so all the sick kids and it is not saying anything let's
see where this is not saying so first of all let me say this again we have a script again.
So this file are simply suit bits of a script let's see if this works.
Gore did this and simply set this stone.
Now it works so basically we have saved this file.
Now let's clear the EMT variable which will be keys and the C keys and see this empty.
Make this empty for now.
So what we did was we just declare otherwise.
Could very well to restore its key stroke that is pressed by the user.
So for these key strokes.
So next one is calling the funds and to execute whenever a key stroke is dear.
On this day documents.
So we have to take reference of the document which is estimate document which will be the space over
here.
So in this stack re friends first to that base and when anyone presses will just to make all of this
event which is uncompressed and we'll just pass this to the funds which will be our anonymised funds
and with that E which is basically the key that is placed.
So every time you replace this method will be called.
So first of all we'll just get some window event.
So this a window dart event and I'll make use of ternary operator over here.
So the same event ls E.
So let me show you what I'm doing here.
We made a use of offensive end over here.
So this part is a condition.
If there is any event it in this written event to this get otherwise it will just read on this character.
So after that we'll just make use of key to get the key code which is with this key chord.
If there is any key code or basically that is the key then will make use of something like get cured
or get and get code if there is a key code.
Otherwise with this get character called.
So what we did here was with this get the character chord from here.
Now let's make this character chord to the string.
So we have to convert or typecast to the string.
So we'll make use of this string class and as I say from get chord in we'll just pass here the key we
just converted here that key which is character to this string.
Now let's add this keys to the key.
So let's make keys now because that can be the multiple event and we'll just append these to that.
So what we just did here what was a step in got in character to the previous one.
So there can be the multiple keys that is praised by the user.
So just concatenate it to the Gordon character that is with the previous character.
So now we have just completed our on key press event when there is this on cue.
Or the.
When did it.
Basically the key pressed on the keyboard these funds and will be called it will get the event.
It will just get this key chord which is basically getting the character according to this convert that
character code to the string.
It will concatenate.
So next one is will this set the interval interval that will be use to this get that key chord.
So there is a method in the window object and in the window object will just pass the funds stand again
and only Miss Munson.
And here what we'll do is we'll just get some request or basically we'll send out day as a get request
by creating a new e-mails.
So let's see how this works.
So this a new inmates and here as this passes our C and let's seem we have not yet created this key
logger which is basically B as we file which will be responsible to send the keystroke to the data file
or a text file.
So this is the sum you are allowed this discuss you in the next lecture.
How this work.
But for now you can simply see here we'll just pass with this help of clover dot B as if I lose is yet
to create with these kids.
So we just pass this to the keys with the new e-mails file.
So we just sending data is get request by creating a new e-mails.
So let's make these keys again empty.
So let's say something like Keats and this after that to disclose this funds then and said the interval
may be 10000 millisecond or 1000 milliseconds that is nil ten second.
So we just set interval to execute this once and continuously.
So we have completed over here.
So you can simply remove this part.
So we have made our own key logger core.
With the help of java script.
So what is this do to here what Jesus earlier the Derby's good variable at this point to store the keystroke
and after that we just making a call to the function to execute whenever a keystroke is placed on this
dismal document.
After that we just get here the character code we just convert that to this string here with these string
class and after that we are just sending here the data is get requested by creating a new image and
we are just setting the interval to execute the funds and continuously.
So we have completed our code as dot this file which is always good file.
Now in the next lecture will just make this key logger dot PSP and the new text file which in this indicate
in the same directly which is basically the same directly or here in the key lower we'll just make that
one and we'll just sit on our own keel Clover in the upcoming lecture.
See you in the next one.