Detect Directory Listing Vulnerability
<p>I have this link <a href="http://test.com/images/" rel="nofollow">http://test.com/images/</a></p>

<p>Can we find out whether Directory above has 'directory Listing vulnerability' exit or not by using PHP. I tried following code.</p>

<pre><code>    $contents = file_get_contents("http://test.com/images/");  
    preg_match_All("|href=[\"'](.*?)[\"']|", $contents, $hrefs);  
    var_dump($hrefs);  
    echo $contents;  
</code></pre>

<p>it return me directory list but it can also possible that directory contain some index page with same content so, what will be the better way to handle this.</p>
