Image
 
linkedin_logo.png rss_logo.jpg
twitter_logo.png youtube_logo.jpg
Latest Additions
 
EH-Net Login
Welcome Guest.






Lost Password?
No account yet? Register
Who's Online
We have 29 guests and 2 members online
 
Free Business and Tech Magazines and eBooks

You are here: Home arrow Ethical Hacking Discussions and Related Certificationsarrow Web Applicationsarrow Is this a vulnerability?
EH-Net
May 19, 2013, 05:17:46 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Go back to The Ethical Hacker Network Online Magazine Home Page
 
   Home   Help Calendar Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: Is this a vulnerability?  (Read 11412 times)
0 Members and 1 Guest are viewing this topic.
ethicalhack3r
Full Member
***
Offline Offline

Posts: 139


View Profile WWW
« on: March 14, 2009, 12:28:34 PM »

Hello,

I think I may have found a vulnerability however im not sure if its already known. If its not already known who has the responsibility of patching it?

The vulnerability:

Abstract:
I can post an image on any forum, grab the http header information of any one who views the image and save it to a log file on a remote server.

How its done:

1. You need a php script that will capture the http headers, echo an image and have the content-type header as jpg.

2. A direcoty called /image.jpg/

3. htaccess file to automatically load index files within diretorys

3. Some where you can post the <img> HTML tag.

Exploit:

Post the following code into any forum, blog, guestbook, website that accepts images from remote servers.

<img>http://www.mysite.com/image.jpg</img>
OR
<img src="http://www.mysite.com/image.jpg">

How it works:

The php script has a jpg header, echos an image and stores http header information to a log file. This is great but still has the .php extention rather than the .jpg extention.

You create a directory called /image.jpg/

You tell the htaccess to show any file named index when you access the /image.jpg/ directory. So when you access www.mysite.com/image.jpg it will automatically load the php script (index.php) which looks like an ordinary jpg.

So we now have a php script that acts and looks like an image, that records http headers and we also have it looking like it has the .jpg extention rather than the .php extention.

So what you can do is post the image.jpg directory to a forum as an image and it will record any one who views its http header information. e.i. ip, referer, user-agent, etc...

Is this something new? Does everyone know about it? Is it a proble with php? htaccess? the browser? the forum?

So far it has been tested on:

vBulletin 3.8.1 - in posts - not in avatar
vBulletin 3.6.8 - in posts - not in avatar
phpBB 3.0.3 - in post - in avatar
Facebook - not vulnerable
imageshack - not vulnerable


Thank you,
Ryan


UPDATE:---

Ive come to the conclusion that this may be normal behaviour and im just being dumb.

When the user views the image even if the image is hotliked their http headers get sent to the server, which is what my php script is picking up.

However what I dont understand is, can http headers be grabbed by the server when someone requests a normal image with a .jpg extention?
« Last Edit: March 14, 2009, 05:24:55 PM by ethicalhack3r » Logged
timmedin
Sr. Member
****
Offline Offline

Posts: 469



View Profile WWW
« Reply #1 on: March 14, 2009, 06:36:35 PM »

The image request is just an HTTP get request, similar to the page request. That doesn't mean all is lost. I do like this idea. It does have the potential for some social engineering since users will think the link is only an image and you could use browser exploits. I'm going to research this a bit more and see what can be done.
Logged

twitter.com/timmedin | http://blog.securitywhole.com
ethicalhack3r
Full Member
***
Offline Offline

Posts: 139


View Profile WWW
« Reply #2 on: March 14, 2009, 07:02:02 PM »

Finaly! Some one undestands what im trying to do! Ive talked to a few people who have just dismissed it as normal behaviour. Even the phpBB3 dev team said it was normal when I pointed out that you could use this to put the image in an avatar because phpBB3 recongises it as a valid image, which it shouldnt.


Would you like the php file I created to carry out some tests? I also had the thought about the browser exploit. You could have the php script check the user agent for browser version, if the browser version is vulnerable, run the exploit.
 
Logged
BillV
Hero Member
*****
Offline Offline

Posts: 1892


View Profile WWW
« Reply #3 on: March 14, 2009, 09:57:49 PM »

Hmm.. nice twist, but similar to the traditional web bug, no?

I've done something similar to gain the IP address of someone specific. The difference was I created an image that I placed within an email. Since I knew that only this person would be opening the email, I could quickly go through my server log to determine who had accessed the image (so long as it was loaded in the email - which, luckily for me, it was Smiley )
Logged
ethicalhack3r
Full Member
***
Offline Offline

Posts: 139


View Profile WWW
« Reply #4 on: March 15, 2009, 11:25:41 AM »

Did a test on a joomla commenting com last night tha also worked. (com_jomcomment)

You post a comment with the <img> tag that points to the image.jpg directory, when the admin goes to aprove the post the image is shown and his IP address is captured.

A blackhat could use this to probe the router of the admin, if they were succsesful at compromising it they could then cause all sorts of havok and this would be targeted specifically at one person.


Logged
timmedin
Sr. Member
****
Offline Offline

Posts: 469



View Profile WWW
« Reply #5 on: March 16, 2009, 10:42:45 PM »

I was thinking a little differently. If the image is presented in an img tag all you can get is the request info. If you can someone convince someone to open the link in a browser you would be golden.

<edit>
And by golden I mean you can actually send exploits to the browser.
« Last Edit: March 17, 2009, 09:27:08 AM by timmedin » Logged

twitter.com/timmedin | http://blog.securitywhole.com
Craig
EH-Net Columnist
Jr. Member
*****
Offline Offline

Posts: 69


View Profile WWW
« Reply #6 on: March 17, 2009, 08:55:00 AM »

@ethicalhack3r:

"Ive talked to a few people who have just dismissed it as normal behaviour."

I suspect that's because this is normal behavior; what you've described is exactly how HTTP and HTML are supposed to work. Obviously, you can obtain the IP address, referrer, etc from any request that is sent to a Web server that you control; if you tell the Web browser that there's an image that it should display that is located at www.mysite.com, the browser will make a request for that image.

Now, this certainly can be used to gather people's IP addresses, and if an administrator has to approve the post, then the first request for that image will likely be from the administrator's IP address. However, unless there is some identifying information in the referrer, you are unlikely to be able to associate any other IP addresses to specific forum accounts. Using this information, you can target the administrator's IP address directly, at least until his IP changes. Most people have dynamic IP addresses, so their IPs are subject to change at anytime (although in practice, you may keep the same IP for quite some time).

"phpBB3 recongises it as a valid image, which it shouldnt."

Why not? If your PHP script is returning a valid JPEG header, then for all intents and purposes, it is a valid image. Many sites use PHP/ASP/whatever to reference and return images, so software designers can't assume that image links will necessarily have a jpg, gif, or png file extension.

Now, if you give most forum sites a link to an external image, they often will not check to see if it is a valid image. This is reasonable, because when referenced as a HTML image tag, the browser will treat it as an image; if the content returned from the request is not a valid image, then no image will be displayed. However, this is commonly used to attack CSRF vulnerabilities: for example, you tell the Web app that your avatar is located at http://www.mysite.com/admin/delete_forum.php?forum_id=1234, so when an admin views your profile or posts, his browser makes the request to delete the forum. However, that requires an actual vulnerability to be present in the forum that you are targeting.

In all, I would say that this can be a useful technique in some situations, but it is just that, a technique. I would not classify this as a vulnerability by itself. Regardless of what you want to call it, it is well-known and commonly used for other purposes such as the CSRF attack described above.
Logged

ethicalhack3r
Full Member
***
Offline Offline

Posts: 139


View Profile WWW
« Reply #7 on: March 17, 2009, 06:43:24 PM »

Thanks for the replys! At first I thought that the web applications should check whether or not the image was actually an image and I also thought I was onto something new.  Undecided

Well, at least ive learnt something. I wish I would have used more common sense and realised what was actually going on. At least now I have a new technique to use in future.
Logged
Craig
EH-Net Columnist
Jr. Member
*****
Offline Offline

Posts: 69


View Profile WWW
« Reply #8 on: March 17, 2009, 09:40:58 PM »

Hey, that's what security and discovering exploits is all about: questioning your surroundings. You learned something, and that's what it's all about. Smiley
Logged

Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines
Joomla Bridge by JoomlaHacks.com
Valid XHTML 1.0! Valid CSS!
Page created in 0.058 seconds with 22 queries.
 
Exclusive Deal

sansfire13_245x90_cw90.jpg
SANSFIRE 2013
June 15 - 22

5% Off w/ Code: EHN_5

SANS Deals 4 EH-Netters
5% OFF Any SANS Course in Any Format!
Coupon Code: EHN_5 Including SANS Rocky Mountain 2013 & SANS Boston 2013
Polls
Compared to this year, 2013 will be:
 
Recent Forum Topics
EH-Net News Feeds
Latest Additions
 
         
Advertisement

© 2013 The Ethical Hacker Network
Joomla! is Free Software released under the GNU/GPL License.