Author |
Message |
Bak ?ls -s 0 in

Age:26 Gender: Joined: Jun 11 2004 Posts: 1826 Location: USA Offline
|
|
Back to top |
|
 |
Assassin2684 Server Help Squatter

Age:34 Gender: Joined: Jul 27 2004 Posts: 990 Location: Florida Offline
|
Posted: Mon Nov 27, 2006 8:05 pm Post maybe stupid Post subject: |
 |
|
|
|
Umm.. I guess? I use Blue Host for all my hosting needs.. |
|
Back to top |
|
 |
Cyan~Fire I'll count you!

Age:37 Gender: Joined: Jul 14 2003 Posts: 4608 Location: A Dream Offline
|
Posted: Tue Nov 28, 2006 10:03 am Post maybe stupid Post subject: |
 |
|
|
|
php.net wrote: | $_FILES['userfile']['type']
The mime type of the file, if the browser provided this information. An example would be "image/gif". This mime type is however not checked on the PHP side and therefore don't take its value for granted. |
So I guess the attacker just changed his .php MIME type to "image/jpeg" or something, and there ya go. _________________ This help is informational only. No representation is made or warranty given as to its content. User assumes all risk of use. Cyan~Fire assumes no responsibility for any loss or delay resulting from such use.
Wise men STILL seek Him. |
|
Back to top |
|
 |
Bak ?ls -s 0 in

Age:26 Gender: Joined: Jun 11 2004 Posts: 1826 Location: USA Offline
|
Posted: Tue Nov 28, 2006 10:10 am Post maybe stupid Post subject: |
 |
|
|
|
It wasn't the webserver. The handler only checks the mime type of what they're uploading (and not the extension), which can be faked easily.
$_FILES['userfile']['type']
The mime type of the file, if the browser provided this information. An example would be "image/gif". This mime type is however not checked on the PHP side and therefore don't take its value for granted. |
$allowed_types = array( //Allowed types
"image/gif" => "gif",
"image/pjpeg" => "jpg",
"image/png" => "png",
"image/bmp" => "bmp",
"image/jpeg" => "jpg",
);
if(!array_key_exists($_FILES['userfile']['type'], $allowed_types)) { // Check the extension if its allowed
die(" Invalid file type!</font></center>");
} |
EDIT: you son of a bitch cyan |
|
Back to top |
|
 |
Cerium Server Help Squatter

Age:42 Gender: Joined: Mar 05 2005 Posts: 807 Location: I will stab you. Offline
|
Posted: Tue Nov 28, 2006 11:50 am Post maybe stupid Post subject: |
 |
|
|
|
So basically, the guy uploaded a .php file with some forged http headers to make the uploading script think it was a jpeg?
What were you using to allow uploads (For the love of god, don't say phpbb)? _________________ There are 7 user(s) ignoring me right now. |
|
Back to top |
|
 |
Assassin2684 Server Help Squatter

Age:34 Gender: Joined: Jul 27 2004 Posts: 990 Location: Florida Offline
|
Posted: Tue Nov 28, 2006 3:00 pm Post maybe stupid Post subject: |
 |
|
|
|
No, I dont use phpbb, all I was using was the upload script. Again, I dont know how the person or why the person even did it. Pretty stupid to hack a site thats not even being used lol. |
|
Back to top |
|
 |
Cyan~Fire I'll count you!

Age:37 Gender: Joined: Jul 14 2003 Posts: 4608 Location: A Dream Offline
|
Posted: Wed Nov 29, 2006 10:52 am Post maybe stupid Post subject: |
 |
|
|
|
Pretty stupid to add a random insecure file uploader to your site. Reminds me of something from hackthissite.org.  |
|
Back to top |
|
 |
Assassin2684 Server Help Squatter

Age:34 Gender: Joined: Jul 27 2004 Posts: 990 Location: Florida Offline
|
Posted: Wed Nov 29, 2006 2:54 pm Post maybe stupid Post subject: |
 |
|
|
|
Haha.. ya, I suppose. But it wasn't realy a random one, its one a friend made. But it was my fault I didn't look at the code. Oh well.. |
|
Back to top |
|
 |
|