Bug: port 2112 is opened to the outside
Description:
Bloodhound opens up port 2112 on ipv6 to the outside. I did not find any possibility to deactivate this behavior from bloodhound. My expected behavior would be that port 2112 is only opened to 127.0.0.1 (same as port 8080 for the webui).
Are you intending to fix this bug?
no
Component(s) Affected:
- UI
- API
Steps to Reproduce:
- Start Bloodhound
Expected Behavior:
My expected behavior would be that also port 2112 is only opened to 127.0.0.1 (same as port 8080 for the webui).
Actual Behavior:
Port 2112 is opened on all interfaces.
Screenshots/Code Snippets/Sample Files:
Environment Information:
BloodHound: 7.3.0 OS: Kali Linux
Contributor Checklist:
- [x] I have searched the issue tracker to ensure this bug hasn't been reported before or is not already being addressed.
- [x] I have provided clear steps to reproduce the issue.
- [x] I have included relevant environment information details.
Hi,
Could you please verify that this is still an issue with the newer version of BloodHound that is shipped with Kali? We are not able to reproduce from our installation steps.
Thank you.
Hi,
just tested with a fresh Kali install and Bloodhound v8.4.1 (Bloodhound installed from Kali repo with apt). The behaviour is still the same.
Hi, I would like to take this one.
I have confirmed the root cause: the tool API daemon binds cfg.MetricsPort, which defaults to :2112 鈥?an empty host binds all interfaces (including IPv6). The main API daemon, by contrast, uses cfg.BindAddress which defaults to 127.0.0.1, which is why port 8080 only listens on loopback while 2112 is exposed.
My plan:
- Change the default
MetricsPortto127.0.0.1:2112incmd/api/src/config/default.go - Add a safety guard in the tool API so an empty host in
metrics_portfalls back to loopback - Update the config tests and deployment docs accordingly
I will open a PR once done.