Hi,
I have a small problem or lets say a doubt.
I was browsing my recently created web site and found that the directory listing was enabled.
The listing showed a php script which i had put up. But when i try to save that file, it does not allow me to. It gets redirected to another page.
In this script, i am sending out mails to my client and after sending the mail, it gets redirected to another page.
My question is:
Why am i unable to download the php script even though the directory listing is enabled?
Download php script from Web Server with Directory Listing enabled
Started by chingupt, Sep 22 2010 11:06 PM
7 replies to this topic
#1
Posted 22 September 2010 - 11:06 PM
|
|
|
#2
Posted 22 September 2010 - 11:23 PM
Because you can view the files in a listing, but when you ask the HTTP server to access one of those files and it recognizes the file as a special kind (like a PHP script), the server executes it instead of returning its code.
To download the file you should change the extension from .php to other thing that the server doesn't recognize or use an FTP transfer.
To download the file you should change the extension from .php to other thing that the server doesn't recognize or use an FTP transfer.
#3
Posted 22 September 2010 - 11:50 PM
So it comes as kind of a security feature. That is if a unauthorized person sees this file, he/she will not be able to see the code. Right.
If that is the case, u mean there is no simple way of downloading the file?
If that is the case, u mean there is no simple way of downloading the file?
#4
Posted 22 September 2010 - 11:52 PM
that's right.
__________________________________________
I study Information Systems at Karlstad University when I'm not on CodeCall
I study Information Systems at Karlstad University when I'm not on CodeCall
#5
Posted 22 September 2010 - 11:55 PM
Thanks
Well there must some way of downloading this script !!! There is always a way around!!!
Well there must some way of downloading this script !!! There is always a way around!!!
#6
Posted 22 September 2010 - 11:57 PM
I don't view this as a security feature. It's only that the web server has been configured to execute a script when the extension of the requested file is .php. The web server has no way to determine if you want to download a file or execute it, so it does what he has been configured to do.
Maybe using webdav (but I'm not sure, I haven't worked much with it). Other posibilities are creating a custom script to download files (could be a security risk) or installing other services to transfer files, like FTP.
Maybe using webdav (but I'm not sure, I haven't worked much with it). Other posibilities are creating a custom script to download files (could be a security risk) or installing other services to transfer files, like FTP.
#7
Posted 23 September 2010 - 12:35 AM
no, of course it's not a real security feature, but in a way, it works like one. And no, there isn't a way around unless you have login rights to the server via ssh, ftp or other protocols
__________________________________________
I study Information Systems at Karlstad University when I'm not on CodeCall
I study Information Systems at Karlstad University when I'm not on CodeCall
#8
Posted 16 October 2010 - 10:18 PM
thats what SSI means Server Side.
I mean imagine if i had a script like this: (its not real and won't work)
So of course their isn't a way around. Unless you break into the server.
This isn't like a microsoft "Shrug, anyone who wants to do that will know how bad IE is" its a "No".
I mean imagine if i had a script like this: (its not real and won't work)
<?php
mysql_connect(localhost,admin,hyabhdsn)
if ($_POST['pass'] == $mysql(nuclear,scientists,pass)){
FIREMISSILE()
} else {
Error(bad_pass)
}
?>
I could download the script and steal the MySQL passwords then i would have access to the database :DSo of course their isn't a way around. Unless you break into the server.
This isn't like a microsoft "Shrug, anyone who wants to do that will know how bad IE is" its a "No".
Please, write clearly with proper structure. Double spacing makes the text feel un-jointed, Capitalizing Every Word Means People Stop Before Every Word Sub-Consciously Which Is A Pain In The Backside, and use code tags! (The right most styling box).


Sign In
Create Account

Back to top









