#xml-parser #nmap #output

nmap_xml_parser

Parse Nmap XML output into Rust

3 releases (breaking)

0.3.0 Nov 9, 2020
0.2.0 May 17, 2020
0.1.0 May 2, 2020

#13 in #nmap

MIT/Apache

19KB
465 lines

nmap_xml_parser

Crates.io

nmap_xml_parser parses Nmap XML output into Rust. For example:

use nmap_xml_parser::NmapResults;
let content = fs::read_to_string(nmap_xml_file).unwrap();
let results = NmapResults::parse(&content).unwrap();

Please refer to the documentation for more information.


lib.rs:

Parse Nmap XML output into Rust.

The root of this crate is NmapResults::parse(). Its use should be similar to the following:

use nmap_xml_parser::NmapResults;
let content = fs::read_to_string(nmap_xml_file).unwrap();
let results = NmapResults::parse(&content).unwrap();

This crate is still a work-in-progress and does not represent the full Nmap output structure. However, it should successfully parse any Nmap XML output. Please file a bug report if it fails.

The API is not stable and is subject to breaking changes until the crate reaches 1.0. Use with care.

Dependencies

~0.9–1.4MB
~28K SLoC