Take the 2-minute tour ×
Information Security Stack Exchange is a question and answer site for Information security professionals. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

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.

share|improve this answer
    
this is correct. But how to automate that? I have create a file: msfconsole -r file.rb but commands are run only within the msfconsole application. How to automate the shell commands? Or how to automate the execute -f cmd.exe -i -H IN the meterpreter? –  Sebastian Jan 9 at 12:16
1  
@Sebastian I think this post will answer your question: hexesec.wordpress.com/2010/07/02/scripting-post-exploitation –  buherator Jan 13 at 6:24
    
buherator great, thanks. –  Sebastian Jan 13 at 19:17

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.