CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/modules/nops/php/generic.rb
Views: 11780
1
##
2
# This module requires Metasploit: https://metasploit.com/download
3
# Current source: https://github.com/rapid7/metasploit-framework
4
##
5
6
###
7
#
8
# This class implements a "nop" generator for PHP payloads
9
#
10
###
11
class MetasploitModule < Msf::Nop
12
13
def initialize
14
super(
15
'Name' => 'PHP Nop Generator',
16
'Alias' => 'php_generic',
17
'Description' => 'Generates harmless padding for PHP scripts',
18
'Author' => 'hdm',
19
'License' => MSF_LICENSE,
20
'Arch' => ARCH_PHP)
21
end
22
23
# Generate valid PHP code up to the requested length
24
def generate_sled(length, opts = {})
25
Array.new(length) { ["\t", " ", "\n", "\r", ";"].sample }.join
26
end
27
end
28
29