1. Tim Tomes
  2. Recon-ng

Commits

Tim Tomes  committed 82fccd8

updated documentation to reflect major framework changes.

  • Participants
  • Parent commits 797a8ba
  • Branches master

Comments (0)

Files changed (1)

File Home.wiki

View file
  • Ignore whitespace
 
     def __init__(self, params):
         framework.module.__init__(self, params)
-        # create local options here
-        # local option values can be accessed within the module via self.options['name']
-        # global options can be referenced via self.goptions['name']
-        self.options = {
-                        'nameserver': '8.8.8.8',
-                        'domain': self.goptions['domain']
-                        }
+        # register local options here
+        # local option values can be accessed within the module via self.options['name']['value']
+        # global options can be referenced via self.goptions['name']['value']
+        # the register_option method expects 5 arguments:
+        # 1. the dictionary to update (should always be "self.options")
+        # 2. the name of the option
+        # 3. the value of the option
+        # 4. "yes" or "no" for whether or not the option is mandatory
+        # 5. a description of the option
+        self.register_option(self.options, 'nameserver', '8.8.8.8', 'yes', 'ip address of a valid nameserver')
+        # global options can be imported by referencing the self.goptions dictionary when registering options
+        self.register_option(self.options, 'verbose', self.goptions['verbose']['value'], 'yes', self.goptions['verbose']['desc'])
         # set module information here
         # do not remove or modify the key names
         # leave comments as an empty list to omit
                      }
     # do not remove or rename
     def do_run(self, params):
+        if not self.validate_options(): return
+        # === begin module code here ===
         # call the main method which will handle module logic
         self.resolve_hosts()