Transforms nmap XML into intermediate JSON and generates a basic network plan in the DrawIO XML format.
Just run
go install github.com/richartkeil/nplan@latest
By default the binary will be installed to $GOPATH/bin
(which you could add to your $PATH).
export PATH=$PATH:$(go env GOPATH)/bin
You can execute nplan multiple times with different nmap
.xml files and scan6
.txt files. The tool will initially create a .json model file that is gradually updated with the new data from each execution.
$ nplan -nmap scan1.xml
$ nplan -nmap scan2.xml -scan6 scan6.txt
$ nplan -nmap scan3.xml
You can generate a .drawio file when you gathered enough data with
$ nplan -export
$ nplan -h
Usage of nplan:
-nmap string
Set the path to the nmap input .xml file.
-scan6 string
Set the path to the scan6 input .txt file. For this to take effect the current model should already include MAC addresses.
-export
Export the current model to a .drawio file.
-json string
Set the path where to store the .json model file. (default "./dist/model.json")
-drawio string
Set the path were to store the exported .drawio file. (default "./dist/plan.drawio")
-fresh
Delete the previous .json model and build a new one. Use with caution.