+ Reply to Thread
Results 1 to 4 of 4

Thread: PHP - Full Path Disclosure

  1. #1
    brokenbylaw's Avatar
    brokenbylaw is offline Learning Programmer
    Join Date
    Dec 2009
    Posts
    62
    Rep Power
    0

    Talking PHP - Full Path Disclosure

    I will explain one vulnerability in PHP and hopefully more if this tutorial is liked



    FPD (full path disclosure) What is it?

    Basically it reveals the full operating url of a script, it returns an error displaying sometimes critical information, php being kind loves to be descriptive so it will come in use if say, your calling another php script for authentication.

    While the risk is said to be petty, I believe it can become severe if your trying to hide something, even though its a very simple fix.
    __________________
    Code:
    <?php
    session_start
    ();
    ?>
    The above script is very basic, imagine it being in a login script

    upon viewing the page it /should/ be blank, lets look behind the scenes, there are a couple of ways, i will reveal two of my most common.

    Firefox with the LiveHttpHeaders addon

    and javascript
    Code:
    javascript:alert(document.cookie);
    So there is a valid session going on, lets corrupt it
    Code:
    javascript:void(document.cookie="PHPSESSID=");
    
    +++OR+++
    
    javascript:alert(document.cookie="PHPSESSID=");
    choose your weapon, the second one is visible.

    refresh.and.look

    Code:
    Warning: session_start() [function.session-start]: The session id contains illegal characters, valid characters are a-z, A-Z, 0-9 and '-,' in www\session_test.php on line 2


    So there you go, as you can see it discloses what function is being used, the line number, and the file

    to fix this, hmmm

    php.ini
    Code:
    display_errors = 'off'
    httpd.conf
    Code:
    php_flag  display_errors  off
    and there are a couple inscript methods, use the php docs or just ask.

    later!!

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    _jenn is offline Newbie
    Join Date
    Feb 2012
    Posts
    1
    Rep Power
    0

    Re: PHP - Full Path Disclosure

    hey everyone,

    just inquiring, is there a way to see all the files in www.tru.ca/__shared/assets/ ??

    i want to know if there would be any modules for my homework that will help me for my exam. i know there was a file that was uploaded there: http://www.tru.ca/__shared/assets/ol...6-23422681.pdf

    if anyone could let me know, itd be much appreciated! =]

  4. #3
    Join Date
    Jun 2010
    Location
    Vancouver, Eh.
    Posts
    4,020
    Blog Entries
    7
    Rep Power
    39

    Re: PHP - Full Path Disclosure

    Quote Originally Posted by _jenn View Post
    hey everyone,

    just inquiring, is there a way to see all the files in www.tru.ca/__shared/assets/ ??

    i want to know if there would be any modules for my homework that will help me for my exam. i know there was a file that was uploaded there: www.tru.ca/__shared/assets/ol_2010calendar_p106-23422681.pdf

    if anyone could let me know, itd be much appreciated! =]
    Jenn, we do not facilitate learning, nor are accepting of cheating or hacking in this manner. As my personal opinion: Ask the teacher for aid if you have found the course work to be not sufficient enough to complete an examination on it.
    Be sure to read the updated FAQ || Health is achieved through 10,000 different steps.
    A textual description can be only part of your question, be sure to provide sample results, errors and your platform in the appropriate forums while asking.

  5. #4
    Join Date
    Jul 2006
    Posts
    16,491
    Blog Entries
    75
    Rep Power
    143

    Re: PHP - Full Path Disclosure

    Most websites are configured to NOT allow you to see all the files in a folder. It's entirely possible it's a virtual folder, which means the contents are in a database, and there's nothing to browse.
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. full size of the window, full screen mode
    By nerio in forum C and C++
    Replies: 13
    Last Post: 08-10-2011, 07:02 AM
  2. Get full file path through Input type file
    By j.lai in forum HTML Programming
    Replies: 2
    Last Post: 04-05-2011, 01:16 AM
  3. PHP - Full Path Disclosure
    By brokenbylaw in forum Security Tutorials
    Replies: 2
    Last Post: 04-09-2010, 07:45 AM
  4. How to get the full path in userfile?
    By organizedchaos in forum PHP Development
    Replies: 2
    Last Post: 06-18-2009, 10:25 PM
  5. Refering to external files without using full path
    By Zeddan in forum C# Programming
    Replies: 5
    Last Post: 10-28-2008, 06:58 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts