Interacting with the target operating system is a primary goal once a Meterpreter session is established. This phase allows you to navigate the file system, manage processes, and gather system-specific details. To begin, use the sysinfo command to display the target’s hostname, OS version, architecture, and the Meterpreter version currently running. This provides essential context for further commands. To determine your current user context and privileges, type getuid, which reveals if you are running as a standard user or a high-privilege account like SYSTEM or root.
Navigating the file system is similar to using a standard terminal. Use pwd to print the current working directory and ls to list all files and folders within that directory. To move between folders, use the cd command followed by the directory path. If you need to search for a specific file across the system, the search -f [filename] command is highly effective, as it scans the drive for matches. For basic file manipulation, you can use cat to read the contents of a text file or edit to open a file in a basic text editor directly within the console.
Managing processes is another vital aspect of interacting with the OS. Use the ps command to list all active processes, their process IDs (PIDs), and the user accounts associated with them. This information is crucial if you intend to migrate your session to a more stable process using the migrate [PID] command. Additionally, if you need to execute a command as if you were sitting at the target’s terminal, the shell command will drop you into a standard OS command prompt (cmd.exe on Windows or /bin/sh on Linux). From here, you can run native OS commands, but remember to type exit to return to the Meterpreter prompt.

