metasploit-framework

https://github.com/rapid7/metasploit-framework

Ruby

Metasploit Framework

Rex::Parser::NmapXMLStreamParser#initialize

Create a new stream parser for NMAP XML output

If given a block, it will be stored in +on_found_host+, otherwise you
need to set it explicitly, e.g.:
  parser = NmapXMLStreamParser.new
  parser.on_found_host = Proc.new { |host|
    # do stuff with the host
  }
  REXML::Document.parse_stream(File.new(nmap_xml), parser)

Source | Google | Stack overflow

Edit

git clone [email protected]:rapid7/metasploit-framework.git

cd metasploit-framework

open lib/rex/parser/nmap_xml.rb

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-Rex--Parser--NmapXMLStreamParser-initialize-for-pr


# Commit to git

git add lib/rex/parser/nmap_xml.rbgit commit -m "better docs for Rex::Parser::NmapXMLStreamParser#initialize"


# Open pull request

gem install hub # on a mac you can `brew install hub`

hub fork

git push <your name> -your-name--update-docs-Rex--Parser--NmapXMLStreamParser-initialize-for-pr

hub pull-request


# Celebrate!