<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Saron Eshetu on Medium]]></title>
        <description><![CDATA[Stories by Saron Eshetu on Medium]]></description>
        <link>https://medium.com/@saroneshetu?source=rss-8fe891356a68------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Stories by Saron Eshetu on Medium</title>
            <link>https://medium.com/@saroneshetu?source=rss-8fe891356a68------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 16:39:16 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@saroneshetu/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Directory Listing Vulnerability]]></title>
            <link>https://medium.com/@saroneshetu/directory-listing-vulnerability-680a2ea3a2b4?source=rss-8fe891356a68------2</link>
            <guid isPermaLink="false">https://medium.com/p/680a2ea3a2b4</guid>
            <dc:creator><![CDATA[Saron Eshetu]]></dc:creator>
            <pubDate>Sat, 14 Sep 2024 06:51:35 GMT</pubDate>
            <atom:updated>2024-09-14T06:51:35.699Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong><em>Vulnerability Description</em></strong></h3><ul><li><strong>Title</strong>: Directory Listing Vulnerability</li><li><strong>Vulnerability Type</strong>: <strong>Directory Listing</strong> occurs when a web server is misconfigured to allow the listing of the contents of a directory. Instead of restricting access to specific files, the server exposes a list of all files and directories within a particular folder. This can lead to information disclosure, potentially revealing sensitive files, scripts, or data to malicious actors.</li></ul><p>-If directory listing is enabled and no index file (such as index.html) is present in the directory, the server displays a list of the files and subdirectories, allowing users to browse and access files that may not be intended for public viewing.</p><h3>How it’s Exploited</h3><ul><li><strong><em>1.</em></strong><em> Information Gathering</em><br>I use directory listing to gather information about the server’s directory structure, identifying potential targets for further attacks.</li><li><strong><em>2. </em></strong><em>Sensitive File Exposure</em><br>Sensitive files are stored in a directory, therefore I can easily discover and access them, which leads to unauthorized disclosure.</li><li><strong><em>3.</em></strong><em> Path Traversal Attacks</em><br>Directory listing can facilitate path traversal attacks, here it allows me to navigate through directories and access files that I am not supposed to see.</li></ul><h3>How It Works:</h3><ul><li>When directory listing is enabled, the server provides an automatic “index” page that shows all the files and folders in the directory.</li></ul><p>So I can exploit this to:</p><ul><li>Discover sensitive files (e.g., Sensitive files)</li><li>Analyze the structure of the web application.</li><li>Access files that contain sensitive data such as credentials, source code, or logs.</li></ul><h3>2. Steps Followed</h3><h3>Step 1: Setting Up OWASP Juice Shop</h3><ul><li>I ran Juice Shop locally using Docker:</li></ul><pre>sudo apt install docker.io -y</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zBUiiKNMnRDMkNrbeKEorA.png" /></figure><ul><li>After successfully installing Docker on the system</li></ul><pre>sudo docker pull bkimminich/juice-shop</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TYXz_eBt5-vcElJpWy0nJw.png" /></figure><pre>sudo docker run --rm -p 3000:3000 bkimminich/juice-shop</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/735/1*sFUxspJhCxif7Zr20di23A.png" /></figure><ul><li>I downloaded the <strong>OWASP Juice Shop</strong> Docker image from the Docker Hub repository.</li><li>After pulling down the latest version of OWASP Juice Shop.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1VgwFvCMfC9wb0e6mRMyzQ.png" /></figure><ul><li>Juice Shop was accessed at <a href="http://localhost:3000.">http://localhost:3000.</a></li></ul><h3>Step 2: Manual Directory Listing Discovery</h3><ul><li>I manually browsed directories using common paths known for exposing files:</li><li><strong>Tested URL</strong>: <a href="http://localhost:3000/assets/public/">http://localhost:3000/ftp/</a></li><li>The browser returned a list of files, confirming that directory listing is enabled.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rDARmx0CrN_p17sRD0Ipfg.png" /><figcaption>Snapshot of Exposed Directory Listing</figcaption></figure><h3>Step 3: Automated Scan Using Gobuster</h3><ul><li>I used <strong>Gobuster</strong> to scan for additional hidden directories:</li></ul><pre>gobuster dir -u http://localhost:3000 -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -b 200</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FKkBytyzF0t100rLDgoE_g.png" /><figcaption>Snapshot of Gobuster Scan Results</figcaption></figure><ul><li>Gobuster identified several directories, including /assets/, which also exposed a list of files.</li></ul><h3>Step 4: Reviewing Listed Files</h3><ul><li>I reviewed the files exposed by directory listing, which included:</li></ul><p>quarantine</p><p>legal.md</p><p>coupons_2013.md.bak</p><p>acquisitions.md</p><ul><li>These files potentially contain sensitive information, like configuration details or application logic.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KQvcwNPpAhEEKjDVGrYfqQ.png" /><figcaption>quarantine</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B5VJMLtq__C9IQEnLrX7nA.png" /><figcaption>Accessing the file &#39;legal.md&#39; which can be downloaded</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZGJpCVIrC6tphz4SwchysQ.png" /><figcaption>Accessing confidential inforamtion by downloading acquisitions.md</figcaption></figure><h3>4.1. Accomplishments</h3><ul><li>I successfully identified that directory listing is enabled for specific folders in OWASP Juice Shop, such as /assets/public/ and /ftp/.</li><li>Discovered exposed files that could lead to further exploitation, such as config.txt, which might include sensitive data or misconfigurations.</li><li>I Confirmed the vulnerability by verifying file visibility through both manual and automated methods.</li></ul><h3>Step 5: Security Countermeasures (Patching Mechanism)</h3><p>To mitigate the directory listing vulnerability, the following countermeasures should be implemented:</p><h3>A. Disable Directory Listing</h3><ul><li><strong>Configure Web Server</strong>: Adjust the web server configuration to disable directory listing.</li><li>For <strong>Apache</strong>: In the .htaccess or Apache config file, set the directive:</li></ul><pre>Options -Indexes</pre><ul><li>For <strong>Nginx</strong>: In the nginx.conf file, set the autoindex directive to off:</li></ul><pre>location / {autoindex off;}</pre><h3>B. Restrict Access to Sensitive Directories</h3><ul><li>Set proper access controls to restrict public access to directories like .git, ftp, and config files.</li><li>Only authorized users should have access to sensitive directories by using authentication mechanisms.</li></ul><h3>C. Remove Unnecessary Files</h3><ul><li>Remove any sensitive files that are not necessary for the application to function, such as backup files, development scripts, or unused assets.</li></ul><p>Thank you!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=680a2ea3a2b4" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>