How to capture Nmap output in the Tidal API
You can send the output generated by Nmap to the Tidal API in two ways. First, by using Tidal Tools Instructions and second, by sending the data to the API by using a service like Postman. You can find detailed instructions for how to use Postman for authentication and CRUD operations here.
A downside of this approach is that you will
have to create the expected JSON payload required by the API to handle the
request.
Once you are authenticated and set up, you can use this API endpoint to capture your Nmap output.
` POST /nmap`
This is the shape of the expected payload.
{
"nmap_output": {
"hosts": [
{
"ip_address" : "32.199.2.33",
"ptr_record": "abc-32-199-2-33.cloudfront.net",
"ports": [
{
"port": 22,
"protocol": "tcp",
"status": "open",
"service": {
"name": "openssh",
"version": "1.1"
}
}
]
}
]
}
}
Note: Send a JSON file with Tidal Tools by using the
--json
flag.
For example, tidal sync nmap --json /path/to/nmap.json
You could also use cURL, a request would look similar to this:
export API_TOKEN=PUT_YOUR_TOKEN_HERE
export SUBDOMAIN=PUT_YOUR_SUBDOMAIN_HERE
curl -H "Authorization: Bearer $API_TOKEN" --header "Content-Type: application/json" \
--request POST \
--data @nmap_out.json \
"https://$SUBDOMAIN.tidal.cloud/api/v1/nmap"