https://github.com/jupiterone/graph-nmap
Ingest hosts discovered from Nmap scans to JupiterOne graph
https://github.com/jupiterone/graph-nmap
Last synced: about 1 year ago
JSON representation
Ingest hosts discovered from Nmap scans to JupiterOne graph
- Host: GitHub
- URL: https://github.com/jupiterone/graph-nmap
- Owner: JupiterOne
- Created: 2020-04-05T17:24:52.000Z (about 6 years ago)
- Default Branch: main
- Last Pushed: 2024-01-02T19:12:24.000Z (over 2 years ago)
- Last Synced: 2025-03-22T06:24:42.245Z (over 1 year ago)
- Language: TypeScript
- Homepage:
- Size: 631 KB
- Stars: 2
- Watchers: 11
- Forks: 3
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
# graph-nmap
This is a local/unmanaged integration that processes discovered hosts from
[Nmap](https://nmap.org/) scans and ingests the findings into JupiterOne (J1).
## Getting Started
These instructions will get you a copy of the project up and running on your
local machine for development and testing purposes.
### Prerequisites
* Node.js
* J1 Account
* J1 API Key
* Nmap installed locally
### Usage
Export the following environment variables (or store locally in a `.env` file):
```bash
export J1_ACCESS_TOKEN=
export J1_ACCOUNT=
```
`J1_ACCOUNT` should be your JupiterOne `accountId`, which can be found by
running the query `Find Account as a return a.accountId` in the JupiterOne web
console.
`J1_ACCESS_TOKEN` is a JupiterOne API key, which can be created in the
JupiterOne console by going to the gear icon in the top-right, then clicking
`Users & Access`, then click the key icon and create an API key.
Then run:
1. `yarn install`
1. `nmap` scan and output to an XML file. For example:
```bash
nmap -v -sn 192.168.1.0/24 -oX local/nmap-out.xml
```
1. `cat local/{filename}.xml | yarn ts-node ./src/index.ts`
1. The newly created entities are of class `Host` and can be found through the
J1QL query `Find nmap_discovered_host`.
Here are two example output screenshots from JupiterOne:


### Examples
An example Nmap output file is included in `test/nmap-out.xml`. The converted
`test/nmap-out.json` file is for reference purpose only.