So we're still inside.
We've lived in this lecture we're going to see how we can upload and download files from the target
system.
At the moment I'll be running some shell commands and I'm going to look for a file that's interesting
for me.
So first thing we're going to do is download the file and I'm going to do it every day any can see that
I'm in var w w w DVD will do a good do on LS to see all the files right here and we can see that there
is a directory called config and the config directories are.
Or if you see a file called config or directory called config then chances are it contains important
information.
Most of the time it contains information about connecting to the database.
So I'm going to navigate to that directory using the cd command and then I'm going to this to see what
I have and you can see that we have a file called config got into it BHB.
Now we can try to read this using the cat command and we can try to read it using the functions that
come with weekly but this is not what we're and trusted in this lecture.
Let's see how we can download this file so we can read it on our local machine.
Now remember you can't actually browse through this file.
So if we go here to the server and if we go to DVD w a
config
and you see that there is a config file but if we click it you'll see that you can't actually read it
because it's written in Ph D and ph files cannot be read remotely.
So even if you view the source you see that it's empty it has no lines whatsoever.
So let's go back and we're going to use the download so the download is called file download and then
I'm going to put my A.H. to see how to use it because I don't know how to use it.
So just I want you to see the idea of how you use all of these functions you put the function name minus
page to see how to use it and you can see that the way to use it is you literally just specify a file
download.
You can specify the vector.
So this is similar to when we were doing when we were reading the FTC password or executing the shell
SH executing shell commands.
So you can specify the method of reason of downloading the file because sometimes maybe the basic download
method will not work for you so you can just do mynahs vector and you specify the vector that you want.
So in this example I'm just going to use the default one I'm not going to specify a vector.
So again we're going to do file download or path which is the remote path so the file on the server
that you want to download followed by the location that you want to download to on your local machine.
So the command is going to be file download the remote path is going to be config though and that page.
And I want to store it in my room.
So this is on my actual local machine that's going to be stored and rude and I'm going to call it config
downloaded and I'm going to make it at 60 so you can actually put it a PH If you want but I'm going
to make it at 60 in my case.
So the command is very simple.
It's file download followed by the file.
The full path or the location where the file is located and the file for me is located in the current
working directory and it's called config Inc.
BHP and I want to download it to my root config download a dirty XTi so I'm going to call that config.
Downloaded that.
And if I want it if this command didn't work for me then I can just do the vector by doing minus vector
and specify the way that I'm going to download it so I could just specify all the methods that we have
here so we have file we have a free file get and base 64.
So I'm just going to use the file and that's it the file should be downloaded.
So let's go to our file manager.
And we're already in the root.
And you can see that there is a file called config downloaded that the XTi.
If we double click it you'll see the information that was saved in the file.
I remember when we went on the browser.
Nothing was displayed.
When you go here you'll see that you can see everything because we actually downloaded the source code
for the file.