0

I am developing my first Metasploit module on Metasploit v5.0.1. I would like to launch my own module in one command with args and not using meterpreter. At this time, I launch my module with these commands:

./msf
use evasion/windows/MyModule
set payload windows/meterpreter/reverse_https
set lhost 127.0.0.1
run

I would like to run it like

./msf --module evasion/windows/MyModule --payload windows/meterpreter/reverse_https --lhost 127.0.0.1

It will be more practical to test it like that during my development. Is it possible?

  • 3
    Have you tried the -x switch? Could you do it like this msfconsole -q -x ‘use evasion/windows/MyModule;set payload windows/meterpreter/reverse_https;set lhost 127.0.0.1;run’ – Noob123 Jan 19 at 17:37
  • 3
    Ok. Run service postgresql start first. Then run the command. That should get the database working. – Noob123 Jan 19 at 17:51
2

Thanks to Noob123 for the solution. Just enter in the terminal :

./msfconsole -q -x 'use evasion/windows/MyModule;set payload windows/meterpreter/reverse_https;set lhost 127.0.0.1;run'

According to the documentation ./msfconsole --help :

-q, --quiet                      Do not print the banner on startup
-x, --execute-command COMMAND    Execute the specified console commands (use ; for multiples)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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