Path: blob/master/modules/nops/php/generic.rb
24699 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45###6#7# This class implements a "nop" generator for PHP payloads8#9###10class MetasploitModule < Msf::Nop1112def initialize13super(14'Name' => 'PHP Nop Generator',15'Alias' => 'php_generic',16'Description' => 'Generates harmless padding for PHP scripts',17'Author' => 'hdm',18'License' => MSF_LICENSE,19'Arch' => ARCH_PHP)20end2122# Generate valid PHP code up to the requested length23def generate_sled(length, _opts = {})24Array.new(length) { ["\t", ' ', "\n", "\r", ';'].sample }.join25end26end272829