Simple python script for importing Masscan results to a Neo4j Graph Database.
First, run a Masscan scan in your network. Save the results with the greppable flag (-oG
).
sudo masscan 192.168.1.1/24 --top-ports=100 -oG masscan_results
Now start your Neo4j instance and run the masscan-to-neo4j.py
script.
python3 masscan-to-neo4j.py -p neo4j_password -f masscan_results
- Neo4j Community Edition (tested on 4.4.4)
- Python3
- Python virtualenv (recommended)
virtualenv venv
pip3 install -r requirements
Neo4j is complicated at times, but this tool is super simple. I generally recommend a few of the following queries:
match (a:Port) return a
match (a:Host) return a
MATCH (p:Port)-[:OPEN]->(h:Host) where h.host = "192.168.1.18" return p,h
Here is a Cheat Sheet for Cypher you can refer to in case you want to learn more.