How can a view a sites php files?

Discussion in 'HTML & Website Design' started by Notting, Sep 13, 2007.

  1. #1
    Lets say I have a site:

    www.viparrot.com

    and I want to view the index.php file (not what the .php outputs!).

    How can I go about doing this? (assuming I do not have the source file, or access the the cpanel etc

    Thanks
    Notting
     
    Notting, Sep 13, 2007 IP
  2. mikebrad0927

    mikebrad0927 Peon

    Messages:
    266
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Well, if you want to see THAT PARTICULAR site, you could download cubecart. :)
     
    mikebrad0927, Sep 13, 2007 IP
  3. live-cms_com

    live-cms_com Notable Member

    Messages:
    3,128
    Likes Received:
    112
    Best Answers:
    0
    Trophy Points:
    205
    Digital Goods:
    1
    #3
    Luckily you can't access other peoples' PHP or there would be security vulnerabilities found in many, many, many major websites.
     
    live-cms_com, Sep 13, 2007 IP
  4. tripy

    tripy Guest

    Messages:
    32
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    As live-cms said, you cannot.
    Except when the sysadmin have made an error on the server, and the web server serves php files without interpreting them, as text.
    But otherwise, you cannot.

    Beside, on a e-commerce sie, it's useless, except if you can get the database dump too.
     
    tripy, Sep 13, 2007 IP
  5. vonvhen

    vonvhen Peon

    Messages:
    152
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Unless you have full access to the server. You CAN NOT view others site source codes.
     
    vonvhen, Sep 13, 2007 IP
  6. Notting

    Notting Notable Member

    Messages:
    3,210
    Likes Received:
    335
    Best Answers:
    0
    Trophy Points:
    280
    #6
    That site is mine!

    I just wanted to have a look at how other people have been doing things! I guess I'll put that idea on the shelf!

    Thanks for you responses!
    Notting
     
    Notting, Sep 13, 2007 IP
  7. soulscratch

    soulscratch Well-Known Member

    Messages:
    964
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    155
    #7
    Heh.

    You wouldn't want to do that, because then any site would easily be vulnerable.
     
    soulscratch, Sep 13, 2007 IP
  8. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,680
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
    #8
    PHP is not the most robust language and therefore occasionally will serve the actual PHP code - there are ways to force this but google is your friend.

    The advantage of .net is that there is no code in the .aspx file as all the code is compiled into a .bin file so nothing to force a server into error and display
     
    AstarothSolutions, Sep 14, 2007 IP
  9. mikebrad0927

    mikebrad0927 Peon

    Messages:
    266
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Well, I think that was the question asked. How do you do it?
     
    mikebrad0927, Sep 15, 2007 IP
  10. scriptmachine

    scriptmachine Banned

    Messages:
    473
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #10
    Can't see php source but you can make clone of that index page
     
    scriptmachine, Sep 15, 2007 IP
  11. Notting

    Notting Notable Member

    Messages:
    3,210
    Likes Received:
    335
    Best Answers:
    0
    Trophy Points:
    280
    #11
    Two responses have now said it is possible, but not shared how!
     
    Notting, Sep 15, 2007 IP
  12. krt

    krt Well-Known Member

    Messages:
    829
    Likes Received:
    38
    Best Answers:
    0
    Trophy Points:
    120
    #12
    I think he was too busy trying to advocate .NET :D PHP definitely doesn't randomly output the source code.

    What he may be referring to:
    - Some sites that have a phps extension for corresponding php files specifically for viewing the source (but hardly anyone does this for obvious reasons)
    - The info provided in error messages (all you need to do is turn off error reporting which is standard for a production site)
     
    krt, Sep 15, 2007 IP
  13. live-cms_com

    live-cms_com Notable Member

    Messages:
    3,128
    Likes Received:
    112
    Best Answers:
    0
    Trophy Points:
    205
    Digital Goods:
    1
    #13
    Some websites have errors that allow the source code to be outputted but not many. There's no reason to try to look for those bugs, you will most likely be wasting your time.
     
    live-cms_com, Sep 15, 2007 IP
  14. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,680
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
    #14
    vBulletin will on occasions show its source code and it isnt difficult to force it to do so.

    I will not say how you do it as it is obviously very close to hacking and this is the main reason why most people will want to find code however there is no shortage of pages on the web that are prepared to teach others on how to do these types of things.
     
    AstarothSolutions, Sep 17, 2007 IP
  15. krt

    krt Well-Known Member

    Messages:
    829
    Likes Received:
    38
    Best Answers:
    0
    Trophy Points:
    120
    #15
    Well you used your argument seemingly against PHP in general, instead of mentioning in only works in certain situations, most likely with very poorly written scripts or at least poorly written parts of scripts. And if I am thinking of the same method as you for showing source code of PHP files, then it is not really PHP showing its own source, it is PHP reading the contents of a file whose filename is determined by invalidated input. This could happen using any scripting language.
     
    krt, Sep 19, 2007 IP
  16. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,680
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
    #16
    It is a known security flaw with PHP and we are yet to find a page that it does not work with so not sure if we are thinking of the same thing or not.

    If you consider .Net a scripting language then it isnt possible with .Net as the "script" is precompiled into MSIL and so there is no "script" to force the server to show.
     
    AstarothSolutions, Sep 20, 2007 IP
  17. live-cms_com

    live-cms_com Notable Member

    Messages:
    3,128
    Likes Received:
    112
    Best Answers:
    0
    Trophy Points:
    205
    Digital Goods:
    1
    #17
    Please show me the code of www.narutowallpaper.biz/index.php to prove PHP will willingly output its own code...
     
    live-cms_com, Sep 20, 2007 IP
  18. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,680
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
    #18
    It doesnt do it willingly but it can be forced to without too much pain.

    Our machines are stress testing for the next couple of days but should be able to spare them after that to view the source
     
    AstarothSolutions, Sep 20, 2007 IP
  19. live-cms_com

    live-cms_com Notable Member

    Messages:
    3,128
    Likes Received:
    112
    Best Answers:
    0
    Trophy Points:
    205
    Digital Goods:
    1
    #19
    Please do, forcefully, I'm interested in the results.
     
    live-cms_com, Sep 20, 2007 IP
  20. mediabitdesign

    mediabitdesign Peon

    Messages:
    25
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #20
    I've seen many websites output the php code includes, this normally happens while Apache is being restarted.
     
    mediabitdesign, Sep 20, 2007 IP