Welcome all to this tutorial.
Today we're gonna go ahead and do some character filtering.
You might have noticed that I have changed the code
to a pretty good extent first of
First off, are the break statements
that I have inserted pretty much everywhere
at the end of each check.
So if the check succeeds, don't go any further.
Also, that's done
Excellent
So in the "else" part, we have this switch statement
and for all these characters, you see parentheses because
because how do you type in parentheses?
Well, you open up your text editor.
On my keyboard it's Shift 0, and that's a parentheses
Let's open up parentheses -- That's Shift 9
and to close the parentheses, that would be Shift 0
What did I do here then?
This is the ASCII code for 048
You can see that here
There we go
So 48 is the ASCII code for 0
simple as that
and I have placed it here
So when I press e0
depending on where the Shift is pressed or not
I will either record a parenthesis or I will record a 0
So this function, I will verify
I will check whether the Shift is being pressed or not.
So if it's being pressed
and 0 is being pressed along with it
then this will happen
If it's not, then I will just write 0 and that's it.
No big deal
Now if this invalidates the true
I don't want you to go checking any other cases out.
I don't care, I have answers to the break statement
so exit the loop immediately.
Next up -- 49, which was for 1
Now notice instead of a 0, I could have also placed either...
Well, let me put it this way
I could have placed "key"
and that would have the same functionality
but instead, I would like to place a 0
primarily because I can orientate myself easier
within confines of my own code
Why? Well you know, when you're reading through it
if you have just the right key, right key, right key, right key
you don't really know you have this
and then right key below
you don't know what is this key below going to be.
Like this -- You do
So that's how I make them from basically 0 to 9
So you have 0, and then you have 1
So notice that this is the keyboard layout that I am using
but even if you have a wrong keyboard layout
and if it's recording wrong things
but in the sets.
So on number 1, how many options you think you have?
Well, let's see
I can press 1 and then I can press Shift and 1
and that gives me an exclamation mark.
1 is going to be the same for every keyword.
Shift 1 will perhaps be different for some other keyboards
but there are only a couple possible combinations
well, a couple combinations that are most likely to be used
maybe like two or three
and that's it.
So you still have a good amount to the password.
I mean, you have the large segment of the password
that you can pretty much guess it out of one or two tries basically.
Anyway, let's go ahead and delete this.
Let's keep on moving forward.
I have inserted that for every one of these.
So you see this is a backslash, a 2, and I have this pound
that's on 3 dollars on 4
I do believe that 7 is a slash.
So let's see -- 6 is a caret, 5 is a percent sign
7 is not a percent sign...Let's check that out.
Indeed it is
Okay, so on my keyword it is
and then we go down further
asterisk and the open parenthesis on 9
and so on and so forth.
So I have inserted a good amount of these.
Make sure that you insert them in accordance...
You can either copy mine
or you can insert them in accordance with your own keyboard` layout
but basically what we're doing here is checking whether the Shift is pressed
If shift is not pressed
go ahead and just write the number corresponding to the ASCII
or write a character corresponding to the ASCII
but if shift is pressed in combination with this
then write something else, whatever the result of that might be.
For me, it's a right parentheses, so to say
and for you, it might be something else
but hey, feel free to follow it through and see what you get.
If not, I mean literally, just go on to your keyboard
take it in your hands
take a look at it, press Shift, press 1
and see which character you get
and then, put it in here.
That's all you need to do in order to get the characters from 0 to 9
Very easy
No big deal
They will get recorded and it will get printed out.
So, now that we have all of them
let's go ahead and verify that this is indeed correct.
How do we do that?
Just go ahead and compile it
and wait for it
Excellent
So it is up and running.
Okay, I have a lot of these things that I've tested out here
to make sure that the keys do work.
We will be adding more of these in the follow-up tutorial.
If you wish skip that, feel free.
If you want to add your custom keys that you wish to add
go ahead and do it
that correspond to some keyboards that you might want
but these ones generally will fit a lot of keyboards.
I myself am using a UK keyboard
but a lot of keys are very similar for the US keyboard as well.
So just take a look at your keyboard layout and then change it
or change it to your target environment's keyboard sets.
If you're uncertain, you can go for the US keyboard.
A lot of people...Most people tend to use that one.
Well, I don't know
in the Americas and Europe, people tend to use it
but I don't know elsewhere in the world.
Not sure what is the preferred layout.
Anyway, so let's go ahead and start typing.
So let's first verify that we have all the numbers in place
1 2 3 4 5 6 7 8 9 0
and let's go ahead and open it.
This could from the previous ones, or I could have pressed it.
I probably didn't press it, but to be on the safe side
to know for sure that it works, let's go ahead and delete it
save the file while it's running, and repeat the process
1 2 3 4 5 6 7 8 9 0
Okay, so it is recording numbers without any problems.
Now let's us go ahead and see if it's recording the symbols
and there you go.
We are also recording the symbols.
So I can put it here, like one underneath the other
so it's easier to match them up.
So if somebody is using, you know, these things
and their passwords or something of a kind
then you are able to easily track them
but you know, usually they won't.
80% to 90% of time, people just use upper and lower case letters for this purpose
and the upper and lower case letters, of course, still work.
abc and ABC
We will add a few other functionalities
and a few other filters for the keys
but hey, you know if you have some filters that you would like to implement
or that you have implemented for the keys
feel free to post them in the discussions.
I'll be happy to take a look at them
and perhaps we can implement them in the whole project
if we so choose.
So you can see, I have numbers from 0 to 9
I have these characters
and I have upper and lower case letters.
So this the composition of about 90% of passwords out there in the world.
So we of course, need some other characters here as well.
Once we have them, that's gonna pretty much gonna be...
any possible combination that somebody might type into their keyboard
our keylogger will be able to record it and put it into a file
and then later on, hopefully, send it.
So once again, if you feel kinda bored
listening to me just putting in key filters
because that's completely up to you
what sort of key filters would you like to put in
you can feel free to skip that part
and go into the part where we will make our key logger
just do a few examples for the functionalities that I had in mind
take snapshots and to use the cameras
to use onboard camera or to just send an email
or something of a kind.
Anyway, that would be it for this tutorial.
Please make sure that you have these filters set up and running.
That you have uppercase and lowercase letters set up and running
because we are going to need all of this for the follow-up tutorials.
Until then, I bid you all farewell.