Nginx directory through vulnerability

Nginx (engine x) is a high-performance HTTP and reverse proxy server, as well as an IMAP/POP3/SMTP server. Nginx is often used as a reverse proxy, the dynamic part is passed to the backend port by proxy_pass, and static files need to be processed by Nginx.

If the static files are stored in the /home/ directory, and the directory is named files in the url, then you need to use alias to set the alias of the directory:

< div> Share a picture

At this point, visit http ://example.com/files/readme.txt, you can get the /home/readme.txt file.
But we noticed that there is no suffix / in /files on the url, and the /home/ set by alias has the suffix /, This / causes us to travel from the /home/ directory to his upper directory.
Share a picture

Then we got an arbitrary file download vulnerability.

If the static file is stored in the /home/ directory, and the directory is named files in the url, then you need to use alias to set the alias of the directory:

< /p>

share picture

this When you visit http://example.com/files/readme.txt, you can get the /home/readme.txt file.

But we noticed that there is no suffix / in /files on the url, and the /home/ set by alias has the suffix /, This / causes us to travel from the /home/ directory to his upper directory.

Share a picture

We then obtained an arbitrary file download vulnerability.

Leave a Comment

Your email address will not be published.