Waraxe IT Security Portal
Login or Register
August 22, 2026
Menu
Home
Logout
Discussions
Forums
Members List
IRC chat
Tools
Base64 coder
MD5 hash
CRC32 checksum
ROT13 coder
SHA-1 hash
URL-decoder
Sql Char Encoder
Affiliates
y3dips ITsec
Md5 Cracker
User Manuals
AlbumNow
Content
Content
Sections
FAQ
Top
Info
Feedback
Recommend Us
Search
Journal
Your Account
User Info
Welcome, Anonymous
Nickname
Password
(Register)

Membership:
Latest: MichaelSnaRe
New Today: 0
New Yesterday: 0
Overall: 9144

People Online:
Visitors: 524
Members: 0
Total: 524
Full disclosure
[0day-rubbish] VMS 6.48.809 Authenticated command injection to root RCE (8.8)
[0day-rubbish] ONE Reporter 13.1 Authenticated RCE / privilege escalation via CommandExecutor (8.8)
[0day-rubbish] Gemini 7.3.0 Authenticated SQL injection to xp_cmdshell RCE (8.8)
[0day-rubbish] RoboTask 11.0.5.1229 Unauthenticated REST API remote task execution (9.8)
[0day-rubbish] ActiveFax Server 10.70 Unauthenticated LPD Ghostscript %pipe% SYSTEM RCE (9.8)
[0day-rubbish] Tornado 2.11.3 Unauthenticated arbitrary file write to root RCE (storeTo=file: to cron) (9.8)
[0day-rubbish] Datalore On-Premises 2026.2.3 Unauthenticated RCE via InteractiveReport access-mapping flaw (9.8)
APPLE-SA-08-18-2026-1 Safari 26.6.1
Cudy WR3000: Hard-coded JWT Secret to Root Command Injection
Security advisory: Pre-authentication RCE (SQL injection) in XPressEntry 3.7.7454 (Telaeris Inc)
Security advisory: Authenticated RCE (SQL injection) in Scrutinizer 19.7.0 (Plixer)
Security advisory: Pre-authentication SYSTEM RCE (Zip-Slip plugin planting) in Output Messenger Server 2.0.x (>= 2.0.63) (Srimax Software (Output Technology))
Security advisory: Pre-authentication RCE (arbitrary file write) in RapidDeploy 5.2.2 (MidVision)
Security advisory: Authenticated RCE (second-order SQL injection) in Lansweeper 12.2.1.0 (web reports 12.2.1.6) (Lansweeper)
Security advisory: Authenticated RCE (command injection) in Kerio Connect 10.0.9 Patch 2 (build 10320) (GFI Software)
Log in Register Forum FAQ Memberlist Search
IT Security and Insecurity Portal

www.waraxe.us Forum Index -> Newbies corner -> mime types...
Post new topicReply to topic View previous topic :: View next topic
mime types...
PostPosted: Mon Jul 24, 2006 10:11 am Reply with quote
716
Regular user
Regular user
Joined: Feb 11, 2006
Posts: 19




hi guys Smile

i'd like to ask something, maybe someone can help me... yea, its about mime types... can they be faked? i mean, is it possible that i have a php file that i upload and somehow tell the browser that the mime type is JPEG? it would be a pretty neat trick to "fool" some server side scripts...

any ideas/suggestions?

thanks
View user's profile Send private message
PostPosted: Mon Jul 24, 2006 5:25 pm Reply with quote
waraxe
Site admin
Site admin
Joined: May 11, 2004
Posts: 2407
Location: Estonia, Tartu




You can have php script "foobar.php", which is containing code 'header( "Content-type: image/jpeg\n\n");'
Now you can go to:

http://www.testservxyz.com/foobar.php

... and you see picture, because browser sees it as picture.
You can even use .htaccess mod_rewrite tricks on Apache:

Code:


RewriteEngine on

RewriteRule ^coolpic.jpg foobar.php



... and when you do:

http://www.testservxyc.com/coolpic.jpg

... then actually php script will be run.
This is by the way very frequently used method to dynamical picture generation. With mod_rewrite using you cant differ "real" picture form php generated picture Smile
View user's profile Send private message Send e-mail Visit poster's website
PostPosted: Wed Jul 26, 2006 1:29 pm Reply with quote
716
Regular user
Regular user
Joined: Feb 11, 2006
Posts: 19




aaaah, this is how (for eg.) gmail does, that when you click "download" to a picture (as attachment) it downloads it and doesnt open it in the browser...

but what i was thinking of is this: if you are a simple user on a forum where you have rights to upload pics, zip files as attachment, could you somehow fool the browser (the mime-type detection) so that it lets you upload a PHP script, thinking that its actually a JPEG...
View user's profile Send private message
PostPosted: Wed Jul 26, 2006 5:39 pm Reply with quote
waraxe
Site admin
Site admin
Joined: May 11, 2004
Posts: 2407
Location: Estonia, Tartu




716 wrote:
aaaah, this is how (for eg.) gmail does, that when you click "download" to a picture (as attachment) it downloads it and doesnt open it in the browser...

but what i was thinking of is this: if you are a simple user on a forum where you have rights to upload pics, zip files as attachment, could you somehow fool the browser (the mime-type detection) so that it lets you upload a PHP script, thinking that its actually a JPEG...


First, that forced download - it's done with help of "content disposition":

http://support.microsoft.com/kb/q260519/

How To Raise a "File Download" Dialog Box for a Known MIME Type


Second: it's all depend on SERVER side, not client side!!
You can always write some perl/php script or c application and try to do ANY thing you ever want against server, including php scripts upload.
But if server-side upload script is well written, then your tryings will fail.
Still, there are lot's of weak upload scripts, which can be manipulated with ".." (traversal), "%00" (null bytes) and other interesting methods.

One more thing to mention - you can craft jpeg picture file, containing valid php code (for example in EXIF part) and then upload it to server as forum avatar or signature or whatever. Now, if you can find security hole, called "local file inclusion", then you can try to include that jpeg file, so php engine will parse it and run the code, you wanted.

Smile
View user's profile Send private message Send e-mail Visit poster's website
PostPosted: Wed Jul 26, 2006 8:23 pm Reply with quote
716
Regular user
Regular user
Joined: Feb 11, 2006
Posts: 19




great, thank you, youre really good Smile

edit: can MIME detection be fooled somehow? Confused
View user's profile Send private message
mime types...
www.waraxe.us Forum Index -> Newbies corner
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT
Page 1 of 1

Post new topicReply to topic


Powered by phpBB © 2001-2008 phpBB Group



PCWizardHub - Helping you fix, build, and optimize your PC life
All logos and trademarks in this site are property of their respective owner. The comments and posts are property of their posters, all the rest (c) 2004-2024 Janek Vind "waraxe"
Page Generation: 0.031 Seconds