Class: CMSScan::Controller::Example

Inherits:
CMSScanner::Controller::Core
  • Object
show all
Defined in:
app/controllers/example.rb

Overview

Example Controller

Instance Method Summary collapse

Instance Method Details

#after_scanObject



33
34
35
# File 'app/controllers/example.rb', line 33

def after_scan
  # Anything after ?
end

#before_scanObject



14
15
16
# File 'app/controllers/example.rb', line 14

def before_scan
  # Anything to do before ?
end

#cli_optionsArray<OptParseValidator::Opt>

Returns:

  • (Array<OptParseValidator::Opt>)


8
9
10
11
12
# File 'app/controllers/example.rb', line 8

def cli_options
  [
    OptString.new(['--dummy VALUE', 'Dummy CLI Option'])
  ]
end

#runObject



18
19
20
21
22
23
24
# File 'app/controllers/example.rb', line 18

def run
  # Let's check and display whether or not the word 'scan' is present in the homepage of the target

  is_present = target.homepage_res.body =~ /scan/ ? true : false

  output('scan_word', is_present: is_present)
end

#run2Object

Alternative way of doing it



27
28
29
30
31
# File 'app/controllers/example.rb', line 27

def run2
  @is_present = Browser.get(target.homepage_url).body =~ /scan/ ? true : false

  output('scan_word')
end