PatrOwl Nmap REST API engine
cd PatrowlEngines/engines/nmap
virtualenv env
source env/bin/activate
pip3 install -r requirements.txt
"path": "/path/to/bin/nmap"sudo env/bin/python engine-nmap.py [--port 5001] [--host 0.0.0.0] [--debug]
Note the use of
env/bin/pythonallowing the reference of the python modules within the virtualenv
--preload option if you use multiple workers!!):
sudo gunicorn engine-nmap:app -b :5001 --access-logfile - --workers=4 -k gevent --preloadhttp://0.0.0.0:5001/engines/nmap/test http://0.0.0.0:5001/engines/nmap/status http://0.0.0.0:5001/engines/nmap/info
import json, requests, time
print("TEST CASE: test_scan_nmap")
post_data = {
"assets": [{
"id": 2,
"value": "8.8.8.8",
"criticity": "low",
"datatype": "ip"
},{
"id": 3,
"value": "patrowl.io",
"criticity": "high",
"datatype": "domain"
}],
"options": {
"ports": ['53', '56', '80', '443'],
"no_ping": 0,
"no_dns": 0,
"detect_service_version": 1
},
"scan_id": "666"
}
r = requests.post(url='http://0.0.0.0:5001/engines/nmap/startscan',
data=json.dumps(post_data),
headers = {'Content-type': 'application/json', 'Accept': 'application/json'})
Content type
-
Digest
Size
123.2 MB
Last updated
about 5 years ago
docker pull patrowl/engine-nmap