Skip to content

Commit

Permalink
Merge pull request #440 from Patrowl/develop
Browse files Browse the repository at this point in the history
1.5.20 nmap update
  • Loading branch information
sebastien-powl authored Jan 24, 2024
2 parents 1b2c0b9 + 812f746 commit 9aae2a7
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.5.19
1.5.20
2 changes: 1 addition & 1 deletion engines/nmap/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM alpine:3.16.3
LABEL Name="Nmap\ \(Patrowl engine\)" Version="1.4.46"
LABEL Name="Nmap\ \(Patrowl engine\)" Version="1.4.47"

# Set the working directory
RUN mkdir -p /opt/patrowl-engines/nmap
Expand Down
2 changes: 1 addition & 1 deletion engines/nmap/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.4.46
1.4.47
11 changes: 6 additions & 5 deletions engines/nmap/engine-nmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,9 +365,8 @@ def _scan_thread(scan_id):

this.scans[scan_id]["issues"] = deepcopy(issues)
except Exception as e:
print(e)
app.logger.info(e)
traceback.print_exception(*sys.exc_info())
# traceback.print_exception(*sys.exc_info())
this.scans[scan_id]["status"] = "ERROR"
this.scans[scan_id]["issues_available"] = False
this.scans[scan_id]["issues_available"] = True
Expand Down Expand Up @@ -423,11 +422,9 @@ def stop_scan(scan_id):
res.update({"status": "error", "reason": f"scan_id '{scan_id}' not found"})
return jsonify(res)

# Stop the nmap cmd
proc = this.scans[scan_id]["proc"]
if hasattr(proc, "pid"):
# his.proc.terminate()
# proc.kill()
# os.killpg(os.getpgid(proc.pid), signal.SIGTERM)
if psutil.pid_exists(proc.pid):
psutil.Process(proc.pid).terminate()
res.update(
Expand All @@ -441,6 +438,10 @@ def stop_scan(scan_id):
}
)

# Stop the thread '_scan_thread'
for th in this.scans[scan_id]["threads"]:
th.join()

this.scans[scan_id]["status"] = "STOPPED"
# this.scans[scan_id]["finished_at"] = int(time.time() * 1000)
return jsonify(res)
Expand Down

0 comments on commit 9aae2a7

Please sign in to comment.