1 / 7

Nginxproxy - An Open Source WAF to Protect against Malicious File Uploads

This project seeks to solve vulnerabilities caused by uploading unwanted files to web applications with the help of Nginx's reverse proxy feature. Many modern web applications implement some variation of a file uploading system. Visit here: https://bit.ly/3OLkQ3H <br>

Komodo1
Download Presentation

Nginxproxy - An Open Source WAF to Protect against Malicious File Uploads

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Nginxproxy - An Open Source WAF to Protect against Malicious File Uploads This project seeks to solve vulnerabilities caused by uploading unwanted files to web applications with the help of Nginx's reverse proxy feature. Many modern web applications implement some variation of a file uploading system. Such systems can introduce vulnerabilities to the web application by having the user upload a file that will damage the server (a Web Shell) or a file that malicious parties could use to harm the users (an HTML file with scripts, for example).

  2. Theory Nginx's reverse proxy works by reading a configuration file with proxy rules and redirecting incoming requests to the address in the configuration file. These rules require reading from top to bottom and choosing the most specific rule. So, if example.com/help/contact-us is requested and the configuration contains the following rules:

  3. Then the request will be directed to http://real.server.com/help/contact-us We can create a configuration file on a reverse proxy server that points explicitly to every page on the original server using this feature. We can implement a rule with whitelisted file extensions using regex to allow users to access uploaded files. And send the rest to a generic "404" page. Note: This only blocks the uploaded file's access, and not the upload itself.

  4. The Configuration File Following the theory, we create a configuration file with the following structure: ● Nginx Defaults (settings that every Nginx configuration file must include). ● Specific proxy rules for every page on the original server Regex. ● Whitelist for allowed file extensions. ● catch-all to discover all unrecognized requests and redirect them to a "404" page.

  5. Issues We have potentially found an end to all web shells if the theory is correct, right? Things are a bit more complicated than simple sites with URLs pointing to files on the server. In the real world, most web applications use rewrite rules to interact with dynamic pages. So, the solution has to take that into account and potentially read the web-server's config file and create matching proxy rules. The opensource project: https://github.com/KomodoResearch/NginProx/

  6. Komodo Consulting specializes in Black BoxPenetration Testing and Red-Team Excercises, Cyber Threat Intelligence, Incident Response and Application Security, serving Fortune 500 companies in Europe, US and Israel. Komodo was founded by leading consulting experts with decades of experience. Our team includes seasoned security specialists with worldwide information security experience along with military intelligence experts. Komodo provides services across many verticals including banking, insurance, hi-tech, automotive, energy, communication, critical infrastructures, healthcare, and international mega-brands.

  7. TALK TO OUR REPRESENTATIVES USA: +1 917 5085546 UK: +44 20 37694351 ISR: +972 9 955 5565 Email: info@komodosec.com Website: https://www.komodosec.com/contact

More Related