-: Let's continue with our meterpreter commands.
So we only covered navigating through file system
and some essential commands
between switching sessions inside of a meterpreter,
but we didn't really touch on those interesting commands
such as running keylogger or snapping a screenshot
or recording microphone.
But before we get to them,
there is one portion of the commands
that we must go through first and those are system commands.
Let us run the help manual to check them out.
So, if I scroll all the way up,
right after the networking commands,
we should see the system commands.
And here, there are a few interesting ones.
For example,
let's start with this execute command right here.
So this command allows us to execute
any type of the command that we would use inside of a show.
It'll most likely run this on a separate thread,
so we'll be able to execute different commands,
simultaneously.
Let me show you what they mean.
So for example,
let's say that I want to start a calculator
on the target machine.
I can type execute calc,
and here it'll tell me that I need to specify the -f option.
Process 9096 is created and right here,
I got my calculator opened.
Now if I wanted to terminate this process
or any other process,
inside of the system commands,
we also get this kill command that says terminate a process.
But for this command, we need to know the process id.
So, here we got the process ID
as soon as we started this process,
but let's say we wanted to terminate a different process.
How would we get its process ID?
Well, remember,
we can type the command ps
to list out all of the files that are currently running
on the target system.
And this left column right here is the process ID.
If I scroll all the way up,
here we can see PID or Process ID,
and I can scroll all the way down,
and at the end, somewhere around here,
we should see our calculator being open.
Let's go and search it,
so search for the calculator application
and if I scroll a little bit up,
we should be able to find it somewhere around here.
And here it is, calculator.exe.
So, we can see the process ID is 8412.
Let's try to kill this process
and see whether our calculator closes.
So if I go and copy this process ID 8412
and down here I type kill and then paste the process id,
here we can see the calculator is now gone.
So we can start different programs
and terminate different programs if we want to,
using a meterpreter shell.
A few more interesting commands from the system commands
would be probably this reboot command
that reboots the remote computer.
Now I'm not going to test this because I am running my shell
on the main Windows 10 operating system.
So, rebooting that machine would be no good,
since I'm also recording on it.
Besides rebooting,
we can also shut down the target machine
just by specifying the command shut down
and you can test both of these commands
on a virtual machine.
And at the end, we also get the system information.
So gets information about the remote system such as OS,
and that is always useful to know,
some of the additional information about the target machine.
Here we can see the computer, the OS, the architecture,
the system language, and other options as well.
But I said that we're going to cover
some of the interesting commands right here
in this video and let's get straight into them.
So after the system commands,
we get these user interface commands.
And here we can control mouse, keyboard,
record microphones, runs screenshots,
and bunch of other cool options
that we're going to cover right now.
So let's start, for example with this mouse option.
Send mouse events.
Let's see how that would work.
If I just type mouse inside of the meterpreter,
it gives us a small usage for this command.
So mouse and then the action,
we can type click, up, down, right click,
right up, right down, double click and so on and so on.
We can also move the mouse if we want to.
So, let's try this command.
If I copy mouse move and then paste right here.
Let us put the mouse right here and if I press enter,
here, the mouse moved on its own.
Let's do it once again.
Did you see it?
It moves on its own,
so we can control the mouse on the target machine.
Now even though this is cool, it is not really that useful.
However there are other commands
we would find a lot more useful than this,
such as for example, running a key logger.
Let's see how we can run a simple key logger.
So if I scroll all the way up,
here we get the commands keyscan start,
keyscan stop and keyscan dump.
Hmm, let's give them a try.
If I copy this command that says start capturing keystrokes,
input it inside of my meterpreter,
it says starting the keystrokes sniffer.
Now let's go to this page and this is a PayPal page
and now just going to type something random right here.
So let's say example@gmail.com
and password will be test1234.
If I click on login, of course, this account does not exist.
But let's go right here
and see whether our meterpreter shell managed to capture it.
To print out the key strokes that were captured,
we can type keyscan_dump.
Press enter and here it is,
example@gmail.com and here is the password test1234.
To stop a key logger, we can type keyscan_stop,
and this will stop capturing keystrokes.
So this is really useful,
if you want to capture the messages
that they're sending online
or basically whatever they type on their keyboard,
you can capture it by typing keyscan_start
and then you can type keyscan_dump
to dump all of the keystrokes that they captured
in that specific time lapse.
Great. Let's check out more options as well.
So, another interesting one
is the one that we already covered,
which is the screenshot option.
As it says, grab a screenshot of the interactive desktop.
If we run it real quick,
this will save a screenshot
inside of this /home/mrhacker directory.
And we can visit it by clicking on this open folder
and here is the screenshot.
So it is the screenshot of our Cal Linux machine,
because my Cal Linux machine is running
on this Windows 10 machine.
But what if I wanted to, for example,
see what the target is doing
or simply just record the screen at the live time.
Well, there is a command called screenshare.
And it says watch the remote user's desktop in real time.
We can type it right here, screenshare,
and this will start streaming the target's desktop
to our Cal Linux machine.
Here it is.
Now, this command knows to be a little bit buggy,
as it does require some of the power in order to run.
As we can see right here, it can be buggy sometimes.
But nonetheless, we can see the targets desktop.
Let us close this real quick
and another command that I wanted to show you
that it's really cool, is recording the target's desktop.
How we can do that if I type the help command, go up here,
here, we can see these commands right here, record mic,
record audio from the default microphone for X seconds.
We can also stream the webcam and take a snapshot
from the specified webcam, using these commands right here.
But since my Windows 10 machine doesn't have a webcam,
I'm not going to be running this.
Of course, you can test these commands out,
if you got the webcam and see if they work.
For now on, I am going to record microphone
on our Windows 10 target machine.
Now this command requires a parameter.
We can specify the amount of seconds using -d option,
and I will specify 10 seconds.
If I press your enter,
this will start recording and it should capture
what I'm speaking at the moment to the microphone.
So here the 10 seconds finished and it saved the file
inside of the /home/mrhacker and this is the file name.
You can listen it, if you want to,
but for now on let us check out what other commands we have
at the end of the help menu and we got these cool commands,
such as getsystem and hashdump.
And believe it or not,
these commands could be the most useful
out of all of the others that we covered.
However, if I try to run the get system command,
inside of my meterpreter shell,
hmm, operation failed.
They will not work.
It seems we cannot get system privileges
on the target machine.
And just to remind you,
system privileges are highest privileges
on the Windows machine, even higher than the administrator.
Once we get system level account,
we can say we fully hacked that box.
So what are we going to do?
Well, we are going to try to elevate our privileges
in the next video by using post exploitation modules.
For now,
we covered basic meterpreter commands
and you saw how useful they are
despite being so easy to run.
We simply got a screenshot by running one command.
We recorded the microphone by running one command.
But it is time to get into more advanced things
and running more advanced modules.
See you in the next video.