those for Unix. The commands will work on Windows, but the name of the com‐
mand is the same as one used on Unix-like operating systems. As an example, in
order
to get a listing of files, you use
ls
. On a Windows system, the command is
dir
,
but when you use
ls
from Meterpreter, you will get a file listing. Similarly, if you want
to
get a list of processes, you use
ps
.
One nice feature of Meterpreter is it doesn’t require you to look up any references
related to functions it offers. Instead, all you have to do is ask. A
help
command will
provide you with a list of all the commands available and will provide details about
the commands. In addition, Meterpreter will also look for data for you. The
search
command will look for files on the system you have compromised.
This feature will
save you from manually looking through the filesystem for what you need. Your
search can include wildcards. As a result, you can use the search string
*.docx
to
locate files created from more recent versions of Microsoft Word.
If you need additional files to be sent to your targeted host in order to continue your
exploitation, you can use
upload
in Meterpreter. It will
upload the file on your Kali
system to the target system. If you are uploading an executable file, you can run it
from Meterpreter by using
execute
. To retrieve files from the target system, you use
download
. If you are referring to a
file path on a Windows system, you need to use
double slashes because a single backslash is commonly an escape character. As an
example, if I want to get access to a Word document in
C:\temp
, I will use download
C:\\temp\\file.docx
to make sure the file path was interpreted correctly.
When it comes to Windows systems,
certain details can be useful, including the ver‐
sion of Windows, the name of the system, and the workgroup the system belongs to.
To get that information, you can use the
sysinfo
command. This will also tell you the
CPU architecture—whether it’s 32-bit or 64-bit.