Welcome all to this tutorial.
Today we're gonna do a bit of phrasing in our filters.
So we want to add these spaces and new lines
so it doesn't all look like one gigantic line.
We want it to be very neat, nice
so when the user goes into a new line
that the keylogger also goes into the line
when they're deleting something
that you know they have pressed the backspace.
Although backspace, perhaps, is not as useful
and you know, when they press the space
we want to have a space
and that needs to look very nice and neat.
We don't want it to look sloppy
primarily because, you know when you go and when you start reading through it
it can be a nightmare
when you don't have proper...
it's probably not called phrasing, it's just sorting.
Let's put it like that, shall we?
So what we need to do is just keep on adding case statements
but this time we're going to use virtual keys
So this is the list of virtual keys that I have intended to put in here today.
So you can put a lot of other ones...
There are a lot of them.
You can put ones for the Num Lock.
You can put ones for the F keys.
I should put the ESC one here.
We can do that at the end of the tutorial
if I remember find it on the net as well
but in any case, it's not a bad idea to have them.
There are a few mandatory ones
without which, the reading through the log files will be impossible.
You can also put the arrow keys
I didn't put them in here, primarily because I don't see the point
but you can if you want.
It's up to you completely.
So, let's type in "case"
and instead of a number, we're going to use a virtual key.
So "VK_SPACE"
I'm just gonna put a colon in at the end
and after that, all we need to do is type in...
We don't really need the brackets
the curly brackets
We can just type in "write"
We don't need to check anything for shifts, or anything what kind.
I would just like you to write a space into the file
and that is literally it.
Afterwards, of course, "break"
because I don't want you to go any further.
Next up. we're gonna type in "case VK"
Which one should we use now? Let's use the return
That's the ENTER
So we need a new line
"RETURN"
and we're gonna type in a colon there
So just "write"
What shall we write out?
So this will be a new line character
Like this
Okay, so again "break"
and do we really need the backspace?
Oh wait, we need Tab. We definitely need Tab.
"break"
Oops, not break.
"case"
and we shall write "VK_TAB:"
I don't really like that much to code and talk at the same time.
It's not a good idea at all.
Perhaps it is better when I show you the code after I've written it
but we'll alternate and we'll see how it goes.
So case Tab
and for this we will write
quite literally just press a Tab
and that's it
and we can also put one for backspace
I mean, no big deal right?
case
At the end we can put a default case as before
but we'll see how will that work out
and will we actually put it.
If we do put it, our key logger is going to have broader range of what it grabs
but keep in mind
that there is only so much that you need to grab with a key logger.
A lot of key loggers out there send you a lot of information
and they grab a lot of keystrokes
which are of little to no use to you.
So what we're trying to do is narrow it down to only those segments
which are useful to us
and which are likely to be used.
Anyway, let's go ahead and put the backspace.
So "VK_BACK"
and "write << ""
and we can put the separation spaces
beginning and the end.
I don't know if I'm going to write something else, but type in break here
in case I do
even though it doesn't really make much sense at the moment.
So now we have these statements here
and I'll show you how much prettier will our input look like
Well, it won't look like anything if we have errors.
Let's see what the problem is
Well, a semi-colon would have been nice.
Is that the only thing?
No, unfortunately it's not.
What else is the problem?
Oh, okay okay
So I forgot to place a colon there.
It's working through now.
Okay, so good
No logic errors, just a typo
None that I can see anyway.
So let's go ahead and delete this file
Save all
You can probably put in a few other keys we like, like delete or escape.
Okay so "username"
and you'll see what happens now.
"password blablablatralala"
Here we go
So "User", and then it says " name tralala"
"Password blablablatralala"
Okay, so let's ahead and make this a bit more interesting.
Let's go ahead onto the net
virtual key codes
and let's find for DEL and ESC
because I'm not a magician.
This is pretty much what I do.
I browse the web and I look for the things that I need
When I encounter a problem, I don't just magically pull the solution out of my hat
so no worries there.
ESCAPE
There we go
We can also write these notations
but I prefer these
as it's a little bit clearer when you're reading through the code
to know what is it exactly that that line of command is doing.
So we're going to conduct a real-life test now as well
"case VK_ESCAPE :"
"write"
I don't feel like putting these spaces here.
It doesn't look pretty at all.
So let's go ahead and removed this
Type in "write <<"
and here we're gonna put...what should we put?
I don't know, " "" "
I think that's going to be sufficient
and there is just another one would that I like to put in, which is DEL
I think it's VK_DEL, what else could it be?
but let's just be certain of that.
So "case"
and let's do this
CTRL F
Delete
Ah, It's VK_DELETE
There you go
Not always right
"case VK_DELETE"
and we can right now
"write <<"
What should we write here?
I think DEL will suffice
Let's just use DELETE
I'm awesome at this, aren't I?
At these sort of mistakes, but oh well
and because I don't know, I'm just gonna type in "break" here
because this list is going to probably keep on expanding
throughout the course
but that's really up to you.
You can request certain characters from me
and I can implement them here, so no big deal.
I want to encourage as much as possible for us to communicate
and you know, you can provide ideas
and I can show you how you can do it, etc.
That's my plan, anyway.
So, let's go ahead and stop this first
and let's conduct a live test.
So we're gonna go ahead and delete this whole file.
So we don't want anything in it.
Oh by the way, you can also delete the file.
The whole file
It's just going to get recreated the next time the program runs
so don't worry about it, if you have deleted it
or something of a kind.
So let's go ahead and begin the session
It is now
missing something somewhere
these things, as usual
Where am I missing it?
Okay, 142
Not a colon. I need a semi-colon k how about now
Okay, how about now?
Will the session be so kind as to run?
There we go
So it is running
Currently we have it set up running in eclipse
but later on, I will show you how you can actually hide it
even how you can hide this executable file somewhere on the system
and how you can hide from the user as well.
So we will cover that, don't worry
but for the time being, this is just a test run
So let's open up Firefox or whatever browser you want.
It won't make a big difference.
We can use any website that we want, really.
Here we can actually use Udemy.
This is going to work
regardless whether the site is HTTPS or HTTP
Whether...whatever, it's completely irrelevant.
I'm just using the site as an example.
So I would like to log into my account.
I'm not gonna obviously log into my own account.
Anytime now
Either the net is really slow or the virtual machine is really slow
Ugh, these days I really need a new computer.
If this crashes, I'm going to...I don't know
Come on! Please!
It is enabled
Anytime now
No, okay
So let's just use some other site
I don't know
Gmail here, whatever
Could you just please open the site?
I don't know, for some strange reason it didn't want to open.
If I click on "Sign in", I can enter the email.
So "pleaseMakesureYouhaveApermissiontodothis"
This is going to be our username.
Quite a complex is user name.
Really stupid of me.
It says "Sorry, Google doesn't recognize this email"
Well, I'm just an abundance of failures today.
Any place where I can actually type in a user name and a password.
Let's go to Ubuntu forums
and try to do it there
I'm just an abundance of fantastic examples today.
Ugh...Come on, my friend, come on
Okay, so this is not important.
Ugh...Of course
All of this is being logged
and you will see when we open up the log file
and there we go.
So finally a place where we can...
"heythere"
or even better, so "user"
Even better -- "USERNAME"
God, why are you doing this to me now?
Password
Excellent!
So USERNAME, password
You can feel free to close it
and I probably need to update Firefox, or something of a kind.
I need to clean this computer up
bring it into shape and working order.
This virtual machine, that is
and now we can go ahead and open up our file
and wow, we have a lot of things.
So it says "Udemy"
We've typed in Udemy, and then we typed in Gmail
and this is what we typed in for Gmail
as a user name
and then there's like "heythere< backspace>"
leaking something quite a lot
and there we go.
So it says "USERNAMEPASSWORDPASSWORD"
So, because we're on the net
we've been doing a lot of things back and forth, back and forth
and some of the things got logged in the way that they did
because this is the realistic one
but these logs will improve over time
as we add a few more filters.
Feel free to try it at home.
Don't go about stealing passwords, or something of a kind.
Installing it in the machines that you don't have the permission to
but rather instead, install it on your own machine
and run a test run
and you will see, it will record the user name and password when you type it in.
It will record everything else as well
but hey, that's just an extra benefit or a burden
because you have to sit through the log file.
These log files can be like 50 pages long
because sometimes key loggers tend to run the system for days on end
and then the mail gets sent.
So you have to sit through and to find what you're looking for.
Anyway, I bid you all farewell
and I hope to see you in the follow-up tutorial.