While running meterpreter handler, is it possible to execute a command on the local computer?
That wasn't mentioned in the output of help command. I also tried !ls and to no avail.
Is it possible then?
While running meterpreter handler, is it possible to execute a command on the local computer?
That wasn't mentioned in the output of help command. I also tried !ls and to no avail.
Is it possible then?
http://www.offensive-security.com/metasploit-unleashed/Meterpreter_Basics#execute
The 'execute' command runs a command on the target
http://www.offensive-security.com/metasploit-unleashed/Meterpreter_Basics#shell
The 'shell' command will present you with a standard shell on the target system.
If you want to run the command on the attacker host press Ctrl+Z to background the Meterpreter shell, and issue your command in the Metasploit shell. You can return to Meterpreter with the session command.
For Windows: In meterpreter run the following to execute a batch command creating a file:
execute -H -k -f cmd -a "/c touch file.txt"
Where:
-f: command to execute (File in %PATH%)
-c: Arguments to the command, expects a string
-H: Hidden
-k: in pwd
/c: exeCute next string
Sources:
msfconsole -r file.rbbut commands are run only within themsfconsoleapplication. How to automate the shell commands? Or how to automate theexecute -f cmd.exe -i -HIN the meterpreter? – Sebastian Jan 09 '14 at 12:16