Instructor: Now we're going to learn more commands 2 2
that will allow us to navigate, 3 3
list, read, download, upload, 4 4
and even execute files on the target computer. 5 5
So I have my Meterpreter session right here 6 6
and the first thing I'm going to do is 7 7
get my current working directory using the pwd command. 8 8
And as you can see, 9 9
I'm in C:\Users at the moment. 10 10
Now if I wanna list all the files and directories, 11 11
I'm gonna use ls. 12 12
And let's say that I want to navigate 13 13
to this file, IEUser. 14 14
I'm gonna do cd IEUser 15 15
and if I do pwd now, 16 16
you'll see that I'm in Users\IEUser. 17 17
And let's go into downloads, 18 18
list the files. 19 19
As you can see now in the files that we listed, 20 20
we can see a file here called passwords.txt. 21 21
So this seems like an interesting file, 22 22
so let's see if we want to read this file. 23 23
If I wanted to read it, 24 24
all I have to do is do cat and passwords.txt. 25 25
And as you can see, 26 26
we can see that it contains test1 and test2. 27 27
So if I go here 28 28
and run the file, 29 29
you can see that this is the actual content of the file. 30 30
Now let's say that I really want this file 31 31
and I wanna keep it for later, 32 32
then I can download that file. 33 33
To do that, we're just going to say download 34 34
and we put the file name which is passwords.txt. 35 35
Now the file has been downloaded successfully 36 36
and if I go to my root folder, 37 37
you'll see that I have a file called passwords 38 38
and it contains test1 and test2. 39 39
Let's say that I have a backdoor 40 40
or a virus or a Trojan or a key logger 41 41
that I want to upload on the target computer. 42 42
So I can upload it very easily now. 43 43
I'll go back to my root actually, to show you, 44 44
that I have a file called backdoored-calc.exe. 45 45
So I'm gonna try to upload that file 46 46
and to do that we're just gonna run upload 47 47
and we put the file name. 48 48
Hit Enter. 49 49
And as you can see now, 50 50
the file has been uploaded successfully. 51 51
Now let's list to make sure the file exists. 52 52
And we can see that we have a new file 53 53
called backdoored-calc.exe. 54 54
And to execute this file on the target computer, 55 55
now we only uploaded it, 56 56
so it it was a virus or a key logger, 57 57
and you wanna execute it, 58 58
all you have to do is execute 59 59
and specify the file 60 60
that you'd like to execute after the f command. 61 61
And then type in the name of the file. 62 62
So in this case it's backdoored-calc.exe. 63 63
And as you can see, 64 64
it's telling us that process 3128 has been created 65 65
so my backdoor has been executed. 66 66
Now if this was a virus or anything that you uploaded, 67 67
it'll do what it's supposed to do 68 68
because you just executed that file. 69 69
Another feature that I wanna show you is shell, 70 70
which basically just converts the current Metasploit 71 71
or Meterpreter session 72 72
into a operating system shell. 73 73
So if I just type in shell, 74 74
you'll see I'll get a Windows prompt 75 75
or Windows command line 76 76
where I can execute Windows commands. 77 77
As you can see now, 78 78
it's on the different channel 79 79
and I can run any Windows command that I want 80 80
through this now. 81 81
So I can just do dir 82 82
to list all directories. 83 83
I can do ipconfig 84 84
or use any Windows command 85 85
that I want exactly like running the commands 86 86
through the command prompt. 87 87
Now, there's much more commands that you can do 88 88
for file system management. 89 89
So if you type in help 90 90
and you go to the file system section, 91 91
you'll see that you can edit, 92 92
you can download, we showed that. 93 93
You can move a file to another file. 94 94
It also can be used to rename files. 95 95
You can delete files, 96 96
you can remove directories, 97 97
you can search. 98 98
So there is so many more things that you can do 99 99
with file system. 100 100
That was just an overview of the basic 101 101
or main commands 102 102
that you can use with managing the file system 103 103
of the target computer.