Instructor: Now we're going to learn more commands
that will allow us to navigate,
list, read, download, upload,
and even execute files on the target computer.
So I have my Meterpreter session right here
and the first thing I'm going to do is
get my current working directory using the pwd command.
And as you can see,
I'm in C:\Users at the moment.
Now if I wanna list all the files and directories,
I'm gonna use ls.
And let's say that I want to navigate
to this file, IEUser.
I'm gonna do cd IEUser
and if I do pwd now,
you'll see that I'm in Users\IEUser.
And let's go into downloads,
list the files.
As you can see now in the files that we listed,
we can see a file here called passwords.txt.
So this seems like an interesting file,
so let's see if we want to read this file.
If I wanted to read it,
all I have to do is do cat and passwords.txt.
And as you can see,
we can see that it contains test1 and test2.
So if I go here
and run the file,
you can see that this is the actual content of the file.
Now let's say that I really want this file
and I wanna keep it for later,
then I can download that file.
To do that, we're just going to say download
and we put the file name which is passwords.txt.
Now the file has been downloaded successfully
and if I go to my root folder,
you'll see that I have a file called passwords
and it contains test1 and test2.
Let's say that I have a backdoor
or a virus or a Trojan or a key logger
that I want to upload on the target computer.
So I can upload it very easily now.
I'll go back to my root actually, to show you,
that I have a file called backdoored-calc.exe.
So I'm gonna try to upload that file
and to do that we're just gonna run upload
and we put the file name.
Hit Enter.
And as you can see now,
the file has been uploaded successfully.
Now let's list to make sure the file exists.
And we can see that we have a new file
called backdoored-calc.exe.
And to execute this file on the target computer,
now we only uploaded it,
so it it was a virus or a key logger,
and you wanna execute it,
all you have to do is execute
and specify the file
that you'd like to execute after the f command.
And then type in the name of the file.
So in this case it's backdoored-calc.exe.
And as you can see,
it's telling us that process 3128 has been created
so my backdoor has been executed.
Now if this was a virus or anything that you uploaded,
it'll do what it's supposed to do
because you just executed that file.
Another feature that I wanna show you is shell,
which basically just converts the current Metasploit
or Meterpreter session
into a operating system shell.
So if I just type in shell,
you'll see I'll get a Windows prompt
or Windows command line
where I can execute Windows commands.
As you can see now,
it's on the different channel
and I can run any Windows command that I want
through this now.
So I can just do dir
to list all directories.
I can do ipconfig
or use any Windows command
that I want exactly like running the commands
through the command prompt.
Now, there's much more commands that you can do
for file system management.
So if you type in help
and you go to the file system section,
you'll see that you can edit,
you can download, we showed that.
You can move a file to another file.
It also can be used to rename files.
You can delete files,
you can remove directories,
you can search.
So there is so many more things that you can do
with file system.
That was just an overview of the basic
or main commands
that you can use with managing the file system
of the target computer.