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

Unable to protect Metasploitable using Apache ModSecurity image #305

Open
slava110 opened this issue Dec 7, 2024 · 1 comment
Open

Unable to protect Metasploitable using Apache ModSecurity image #305

slava110 opened this issue Dec 7, 2024 · 1 comment

Comments

@slava110
Copy link

slava110 commented Dec 7, 2024

Hi. I've set up Metasploitable 2 (intentionally exploitable VM image) in a VM connected using bridged network to host. Then I run nmap vulnerability check script using nmap -sV --script vulners <target>. It discovered a bunch of vulnerabilities in VM as it should. Then I started Docker containers with ModSecurity Apache and ModSecurity Nginx using these commands:
docker run -d --name modsec-apache -p 80:8080 -e BACKEND=http://192.168.0.104:80 owasp/modsecurity-crs:apache
docker run -d --name modsec-nginx -p 90:8080 -e BACKEND=http://192.168.0.104:80 owasp/modsecurity-crs:nginx
And run nmap vulnerability tests on localhost
nmap detected multiple vulnerabilities on port 80, but none on port 90.
Does modsecurity-apache protect backend host or do I need to change some settings for it to work?
I've tried setting PORT environment variable, it didn't help (set it to 8080).

@theseion
Copy link
Contributor

Hi @slava110, sorry for the delay.

The backend will be protected by ModSecurity by default, that's the idea of the images, although the configuration will of course not be ideal for your setup. I don't see anything wrong with the setup you describe, so I'm rather wondering if maybe nmap is doing something special based on the port...

Do you have any more information? Does nmap find vulnerabilities if you publish nginx on port 80 instead of 90?

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

No branches or pull requests

2 participants