Forum Thread: Importing Custom Payloads to Metapsloit

I would like to know how can i import custom payloads to Metasploit

9 Responses

I got this android meterpreter reversetcpdns payload and i want to to import it to metasploit, it was a .rb file and i put it in /usr/share/metasploit-framework/modules/payloads/stagers/android but it didnt work and metasploit didnt even start so some help is appreciated

i also now tried to use another path which is /.msf4/modules/payloads/android/meterpreter/ and placed the file there but when i try reloadall i get this

Error while running command set: No such file or directory @ rbsysopen - /usr/share/metasploit-framework/data/android/apk/classes.dex

Call stack:
/root/.msf4/modules/payloads/android/meterpreter/reversetcpdns.rb:36:in `read'
/root/.msf4/modules/payloads/android/meterpreter/reversetcpdns.rb:36:in `generatejar'
/usr/share/metasploit-framework/lib/msf/core/payload/dalvik.rb:27:in `generate'
/usr/share/metasploit-framework/lib/msf/core/payload.rb:199:in `size'
/usr/share/metasploit-framework/lib/msf/core/payload
set.rb:158:in `block (2 levels) in recalculate'
/usr/share/metasploit-framework/lib/msf/core/payloadset.rb:102:in `eachpair'
/usr/share/metasploit-framework/lib/msf/core/payloadset.rb:102:in `block in recalculate'
/usr/share/metasploit-framework/lib/msf/core/payload
set.rb:98:in `eachpair'
/usr/share/metasploit-framework/lib/msf/core/payload
set.rb:98:in `recalculate'
/usr/share/metasploit-framework/lib/msf/core/moduleset.rb:47:in `create'
/usr/share/metasploit-framework/lib/msf/core/module
set.rb:174:in `valid?'
/usr/share/metasploit-framework/lib/msf/ui/console/driver.rb:572:in `onvariableset'
/usr/share/metasploit-framework/lib/msf/ui/console/commanddispatcher/core.rb:2079:in `cmdset'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatchershell.rb:427:in `runcommand'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatchershell.rb:389:in `block in runsingle'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatchershell.rb:383:in `each'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatcher
shell.rb:383:in `runsingle'
/usr/share/metasploit-framework/lib/rex/ui/text/shell.rb:203:in `run'
/usr/share/metasploit-framework/lib/metasploit/framework/command/console.rb:48:in `start'
/usr/share/metasploit-framework/lib/metasploit/framework/command/base.rb:82:in `start'
/usr/bin/msfconsole:48:in `<main>'

I have an article on this in the metasploit series.

can you link it please? i would get lost in your articles xD

and its a payload not an exploit

you have to first create all those directories separately by using mkdir if its not there already

can you be more specific please? i really need this

i exavtly did that with the android meterpreter reversetcpdns and i got this error when ever i try to load it

Error while running command set: No such file or directory @ rbsysopen - /usr/share/metasploit-framework/data/android/apk/classes.dex

Call stack:
/root/.msf4/modules/payloads/android/meterpreter/reversetcpdns.rb:36:in `read'
/root/.msf4/modules/payloads/android/meterpreter/reversetcpdns.rb:36:in `generatejar'
/usr/share/metasploit-framework/lib/msf/core/payload/dalvik.rb:27:in `generate'
/usr/share/metasploit-framework/lib/msf/core/payload.rb:199:in `size'
/usr/share/metasploit-framework/lib/msf/core/payloadset.rb:158:in `block (2 levels) in recalculate'
/usr/share/metasploit-framework/lib/msf/core/payloadset.rb:102:in `eachpair'
/usr/share/metasploit-framework/lib/msf/core/payloadset.rb:102:in `block in recalculate'
/usr/share/metasploit-framework/lib/msf/core/payloadset.rb:98:in `eachpair'
/usr/share/metasploit-framework/lib/msf/core/payloadset.rb:98:in `recalculate'
/usr/share/metasploit-framework/lib/msf/core/moduleset.rb:47:in `create'
/usr/share/metasploit-framework/lib/msf/core/moduleset.rb:174:in `valid?'
/usr/share/metasploit-framework/lib/msf/ui/console/driver.rb:572:in `onvariableset'
/usr/share/metasploit-framework/lib/msf/ui/console/commanddispatcher/core.rb:2079:in `cmdset'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatchershell.rb:427:in `runcommand'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatchershell.rb:389:in `block in runsingle'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatchershell.rb:383:in `each'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatchershell.rb:383:in `runsingle'
/usr/share/metasploit-framework/lib/rex/ui/text/shell.rb:203:in `run'
/usr/share/metasploit-framework/lib/metasploit/framework/command/console.rb:48:in `start'
/usr/share/metasploit-framework/lib/metasploit/framework/command/base.rb:82:in `start'
/usr/bin/msfconsole:48:in `<main>'

Share Your Thoughts

  • Hot
  • Active