Class: Msf::Payload::MalleableC2::Lexer
- Inherits:
-
Object
- Object
- Msf::Payload::MalleableC2::Lexer
- Defined in:
- lib/msf/core/payload/malleable_c2.rb
Constant Summary collapse
- BLOCK_KEYWORDS =
%w[ client http-get http-post http-stager https-certificate id metadata output server stage transform-x64 transform-x86 ]
- OTHER_KEYWORDS =
%w[ add append base64 base64url dns encode_hex header hostport mask netbios netbiosu parameter prepend print remove set string stringw strrep transform unset uri uri-append uri-query xor ]
Instance Attribute Summary collapse
-
#tokens ⇒ Object
readonly
Returns the value of attribute tokens.
Instance Method Summary collapse
-
#initialize(file) ⇒ Lexer
constructor
A new instance of Lexer.
- #is_block_keyword?(word) ⇒ Boolean
Constructor Details
#initialize(file) ⇒ Lexer
Returns a new instance of Lexer.
99 100 101 102 |
# File 'lib/msf/core/payload/malleable_c2.rb', line 99 def initialize(file) @tokens = [] tokenize(File.binread(file)) end |
Instance Attribute Details
#tokens ⇒ Object (readonly)
Returns the value of attribute tokens.
54 55 56 |
# File 'lib/msf/core/payload/malleable_c2.rb', line 54 def tokens @tokens end |
Instance Method Details
#is_block_keyword?(word) ⇒ Boolean
104 105 106 |
# File 'lib/msf/core/payload/malleable_c2.rb', line 104 def is_block_keyword?(word) BLOCK_KEYWORDS.include?(word) end |