Skip to content

Commit ff378ea

Browse files
Merge pull request #510 from Patrowl/develop
1.5.24
2 parents 072f23b + 9b4544e commit ff378ea

File tree

6 files changed

+33
-20
lines changed

6 files changed

+33
-20
lines changed

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.5.23
1+
1.5.24

engines/nmap/Dockerfile

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
FROM alpine:3.16.3
2-
LABEL Name="Nmap\ \(Patrowl engine\)" Version="1.5.0"
2+
LABEL Name="Nmap\ \(Patrowl engine\)" Version="1.5.1"
33

44
# Set the working directory
55
RUN mkdir -p /opt/patrowl-engines/nmap
@@ -19,15 +19,15 @@ COPY libs/ libs/
1919

2020
# Install any needed packages specified in requirements.txt
2121
RUN apk add --update \
22-
linux-headers \
23-
libffi-dev \
24-
#sudo \
25-
python3 \
26-
python3-dev \
27-
py3-pip \
28-
build-base \
29-
nmap \
30-
nmap-scripts \
22+
linux-headers \
23+
libffi-dev \
24+
#sudo \
25+
python3 \
26+
python3-dev \
27+
py3-pip \
28+
build-base \
29+
nmap \
30+
nmap-scripts \
3131
#&& adduser -u 1000 -G wheel -D alpine \
3232
&& rm -rf /var/cache/apk/*
3333

engines/nmap/VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.5.0
1+
1.5.1

engines/nmap/__init__.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
33

4-
__title__ = 'patrowl_engine_nmap'
5-
__version__ = '1.5.0'
6-
__author__ = 'Nicolas MATTIOCCO'
7-
__license__ = 'AGPLv3'
8-
__copyright__ = 'Copyright (C) 2018-2022 Nicolas Mattiocco - @MaKyOtOx'
4+
__title__ = "patrowl_engine_nmap"
5+
__version__ = "1.5.1"
6+
__author__ = "Nicolas MATTIOCCO"
7+
__license__ = "AGPLv3"
8+
__copyright__ = "Copyright (C) 2018-2024 Nicolas Mattiocco - @MaKyOtOx"

engines/nmap/engine-nmap.py

+15-2
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,16 @@ def clean():
8686
@app.route("/engines/nmap/clean/<scan_id>")
8787
def clean_scan(scan_id):
8888
"""Clean scan identified by id."""
89+
if scan_id not in engine.scans.keys():
90+
return (
91+
jsonify(
92+
{
93+
"status": "error",
94+
"reason": f"Error 1002: scan_id '{scan_id}' not found",
95+
}
96+
),
97+
503,
98+
)
8999
return engine.clean_scan(scan_id)
90100

91101

@@ -568,7 +578,8 @@ def _parse_report(filename, scan_id):
568578
# Find hostnames
569579
for hostnames in host.findall("hostnames"):
570580
for hostname in list(hostnames):
571-
if hostname.get("type") in ["user", "PTR"]:
581+
# if hostname.get("type") in ["user", "PTR"]:
582+
if hostname.get("type") == "user":
572583
has_hostnames = True
573584
addr = hostname.get("name")
574585
addr_list.append(hostname.get("name"))
@@ -592,6 +603,8 @@ def _parse_report(filename, scan_id):
592603
if has_hostnames:
593604
for hostnames in host.findall("hostnames"):
594605
for hostname in list(hostnames):
606+
if hostname.get("type") != "user":
607+
continue
595608
ip_address = str(host.find("address").get("addr"))
596609
issues.append(
597610
deepcopy(
@@ -1049,7 +1062,7 @@ def getfindings(scan_id):
10491062
os.remove(hosts_filename)
10501063

10511064
# remove the scan from the active scan list
1052-
engine.clean_scan(scan_id)
1065+
# engine.clean_scan(scan_id)
10531066

10541067
res.update({"summary": summary, "issues": issues, "status": "success"})
10551068
return jsonify(res)

engines/nmap/nmap.json.sample

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Nmap",
3-
"version": "1.5.0",
3+
"version": "1.5.1",
44
"description": "Network Scanner",
55
"path": "/usr/bin/nmap",
66
"allowed_asset_types": ["ip", "domain", "fqdn", "url", "ip-range", "ip-subnet"],

0 commit comments

Comments
 (0)