Files
metasploit-gs/modules/nops/php/generic.rb
T
jvoisin 8f61e957a8 Improve modules/nops/php/generic.rb
```irb
irb(main):001> length = 10
=> 10
irb(main):002>  Array.new(length) { ["\t", " ", "\n", "\r"].sample }.join
=> "  \r\t\n\t\t\n\t\r"
irb(main):003>
```
2024-09-10 21:28:43 +02:00

28 lines
701 B
Ruby

##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
###
#
# This class implements a "nop" generator for PHP payloads
#
###
class MetasploitModule < Msf::Nop
def initialize
super(
'Name' => 'PHP Nop Generator',
'Alias' => 'php_generic',
'Description' => 'Generates harmless padding for PHP scripts',
'Author' => 'hdm',
'License' => MSF_LICENSE,
'Arch' => ARCH_PHP)
end
# Generate valid PHP code up to the requested length
def generate_sled(length, opts = {})
Array.new(length) { ["\t", " ", "\n", "\r", ";"].sample }.join
end
end