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:

use evasion/windows/MyModule
set payload windows/meterpreter/reverse_https
set lhost

I would like to run it like

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

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;run’ – Noob123 Jan 19 '19 at 17:37
  • 3
    Ok. Run service postgresql start first. Then run the command. That should get the database working. – Noob123 Jan 19 '19 at 17:51

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;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)
| improve this answer | |

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.