Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nmap port scan fails when Naabu return no port #1067

Merged
merged 1 commit into from
Nov 23, 2023
Merged

Nmap port scan fails when Naabu return no port #1067

merged 1 commit into from
Nov 23, 2023

Conversation

psyray
Copy link
Contributor

@psyray psyray commented Nov 22, 2023

While launching a port scan with Naabu + Nmap, I experienced a crash if Naabu returns no port

rengine-celery-1       | nmap                               | ERROR | 'NoneType' object is not subscriptable
rengine-celery-1       | Traceback (most recent call last):
rengine-celery-1       |   File "/usr/src/app/reNgine/celery_custom_task.py", line 129, in __call__
rengine-celery-1       |     self.result = self.run(*args, **kwargs)
rengine-celery-1       |   File "/usr/src/app/reNgine/tasks.py", line 1481, in nmap
rengine-celery-1       |     vulns = parse_nmap_results(output_file_xml, output_file)
rengine-celery-1       |   File "/usr/local/lib/python3.10/dist-packages/celery/local.py", line 182, in __call__
rengine-celery-1       |     return self._get_current_object()(*a, **kw)
rengine-celery-1       |   File "/usr/local/lib/python3.10/dist-packages/celery/app/trace.py", line 761, in __protected_call__
rengine-celery-1       |     return orig(self, *args, **kwargs)
rengine-celery-1       |   File "/usr/local/lib/python3.10/dist-packages/celery/app/task.py", line 411, in __call__
rengine-celery-1       |     return self.run(*args, **kwargs)
rengine-celery-1       |   File "/usr/src/app/reNgine/tasks.py", line 3198, in parse_nmap_results
rengine-celery-1       |     hostnames = [host.get('address')['@addr']]

So I've added a check on empty port scan to prevent Nmap launch
image

Tested and working on my use case

@psyray psyray self-assigned this Nov 22, 2023
@psyray psyray added bug Something isn't working release/2.0.2 and removed bug Something isn't working labels Nov 22, 2023
@yogeshojha yogeshojha merged commit d8af5d2 into yogeshojha:master Nov 23, 2023
3 of 5 checks passed
@psyray psyray deleted the fix-port-scan-nmap-error branch December 11, 2023 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants