Class: Ronin::Scanners::Nmap
- Inherits:
-
RProgram::Program
- Object
- RProgram::Program
- Ronin::Scanners::Nmap
- Defined in:
- lib/ronin/scanners/nmap/nmap.rb
Class Method Summary collapse
-
.scan(options = {}, &block) ⇒ Object
Perform an Nmap scan using the given options and block.
Instance Method Summary collapse
-
#import_scan(options = {}, &block) ⇒ Object
Perform an Nmap scan using the given options and save the resulting scan information into ScanDB.
-
#scan(options = {}, &block) ⇒ Object
Perform an Nmap scan using the given options and block.
Class Method Details
.scan(options = {}, &block) ⇒ Object
Perform an Nmap scan using the given options and block. If a block is given, it will be passed a newly created NmapTask object.
41 42 43 |
# File 'lib/ronin/scanners/nmap/nmap.rb', line 41 def self.scan(={},&block) self.find.scan(,&block) end |
Instance Method Details
#import_scan(options = {}, &block) ⇒ Object
Perform an Nmap scan using the given options and save the resulting scan information into ScanDB. If a block is given, it will be passed each ScanDB::Host object from the scan.
59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/ronin/scanners/nmap/nmap.rb', line 59 def import_scan(={},&block) file = Tempfile.new('nmap',Config::TMP_DIR) # perform the scan scan(.merge(:xml => file)) # import the xml file into ScanDB hosts = ScanDB::Nmap.import_xml(file,&block) file.delete return hosts end |
#scan(options = {}, &block) ⇒ Object
Perform an Nmap scan using the given options and block. If a block is given, it will be passed a newly created NmapTask object.
50 51 52 |
# File 'lib/ronin/scanners/nmap/nmap.rb', line 50 def scan(={},&block) run_task(NmapTask.new(,&block)) end |