13 Metasploit Meterpreter File System Command You Should Know
13 Metasploit Meterpreter File System Command You Should Know
Type : Tutorial
Level : Easy
You can get your meterpreter command after you have successfully compromise a system via
an exploit and set up your payload to meterpreter command.
The cat command displays the contents of a single file. As of the time of this writing, the command will
throw an error when trying to read an emtpy file.
2. cd
The command will accept both back and forward slashes somewhat interchangeably, though using a
forward slash seems to work more frequently. "." and ".." are used to access the current and
parent directory, respectively, and double-quotes can be used to access directories with spaces in the
names.
3. download
When we need to retrieve a file from the target we use the download command, which transfers the
specified file into our local working directory. In the event that we need to recursively download an
entire directory, we use the download -r command.
4. edit
To edit a file using our default text editor we use the edit command. Behind the scenes, Meterpreter
will download a copy of the file to a temp directory, then upload the new file when the edit is complete.
5. getlwd
We can show the current working directory on our local machine by using getlwd (get local
working directory), or by using the alias lpwd (local print working directory).
6. getwd
We can show the current working directory on the exploited machine by using getwd (get
working directory), or by using the alias pwd (print working directory).
7. lcd
The command only accepts arguments in the same way as your operating system's cd command, so refer to
your system's documentation for specific instructions. The following example shows lcd on a
Linux system.
8. lpwd
We can show the current working directory on our local machine by using lpwd (local print
working directory), or by using the alias getlwd (get local working directory).
9. ls
We can see both the current working directory and a detailed listing of files in that directory by using
the ls command. File listings are given in a format similar to the GNU ls program.
meterpreter > ls
10. mkdir
We can show the current working directory on our local machine by using pwd ( print
working directory), or by using the alias getwd (get working directory).
12. rmdir
We can remove an empty directory with the rmdir command. The command will throw an error if
the directory is not empty.
13. upload
To send a file to the target system we use the upload command, using the -r switch to recursively upload
directories and their contents. In the following example we are uploading a falsely named Meterpreter
payload.