Open psyray opened 7 months ago
AnonymousWP commented Dec 12, 2023 •
In my opinion we should go for NMAP as we already added it to reNgine a while ago and second, because it's a better solution. Sure, it might take time, but then at least we can drop one tool (whatportis) and keep NMAP. If we all agree, maybe change the title or create a PR with a descriptive title.
psyray commented Dec 16, 2023 •
Completely agree with you @AnonymousWP Service recognition on port is way better with nmap But whatportis could identify port protocol without active scan and it's fast So I think the two are complementary. Whatportis to quickly recognize defaut service of a given port (if a scan is launched without a port scan) Nmap to really identify service running when a port scan task is launched @AnonymousWP Collaborator
Starting point PR on official repo https://github.com/yogeshojha/rengine/pull/1317
This one need #238 to be merged in release/2.1.1 branch to be resolved
Is there an existing issue for this?
Current Behavior
After a port scan, ports are identified with
unknown
It comes from the whatportis command and is also related with #984
Whatportis rely on the IANA database and this is the root cause of this problem. If download failed, whatportis is useless and no port are recognized
And there's no way to update the IANA DB from GUI, only a
docker-compose restart celery
triggers the script update and maybe it download the db or maybe not, it depends on the IANA server.Then you'll have to launch a port scan again to correctly displayed ports
But, and there is a but, while scan is finished, ports are correctly recognized, but duplicated, for ex. You will have
80/http
and80/unknown
Collateral damage for this is that when you do another port scan on the same target and same port is found (eg. 80), now reNgine task will fail with the MultipleObjectsReturned error
There are several solutions for this problem :
The quickest solution is the first one, and the better is the third one, as nmap is more effective in service port recognition.
To enable nmap we need some additional work, as nmap recognize the service by querying it, the same port could have more than one label. So we need to rework this part in the db, the logic...
Expected Behavior
Port should be identified
Steps To Reproduce
Environment
Anything else?
No response