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/lib/msf/core/nop.rb
Views: 11780
1
# -*- coding: binary -*-
2
3
module Msf
4
5
###
6
#
7
# This class acts as the base class for all nop generators.
8
#
9
###
10
class Nop < Msf::Module
11
12
#
13
# Returns MODULE_NOP to indicate that this is a NOP module.
14
#
15
def self.type
16
return Msf::MODULE_NOP
17
end
18
19
#
20
# Returns MODULE_NOP to indicate that this is a NOP module.
21
#
22
def type
23
return Msf::MODULE_NOP
24
end
25
26
#
27
# Initializes the NOP generator, defaulting it to being usable on all
28
# platforms.
29
#
30
def initialize(info = {})
31
super({
32
'Platform' => '' # All platforms by default
33
}.update(info))
34
end
35
36
#
37
# Stub method for generating a sled with the provided arguments. Derived
38
# Nop implementations must supply a length and can supply one or more of
39
# the following options:
40
#
41
# - Random (true/false)
42
# Indicates that the caller desires random NOPs (if supported).
43
# - SaveRegisters (array)
44
# The list of registers that should not be clobbered by the NOP
45
# generator.
46
# - BadChars (string)
47
# The list of characters that should be avoided by the NOP
48
# generator.
49
#
50
def generate_sled(length, opts)
51
return nil
52
end
53
54
#
55
# Default repetition threshold when finding nop characters.
56
#
57
def nop_repeat_threshold
58
return 10000
59
end
60
61
end
62
63
end
64
65