Free file hosting, free video sharing

<<< The Web Hosting >>>


Go Back   Noeman GSM > Webhosting & Website development > Website development

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-31-2008, 03:57 PM
Spiral's Avatar
CO-Admin
 
Join Date: Sep 2004
Location: Martil
Age: 25
Posts: 16,701
Reputation: 28965
Spiral Mega Super MemberSpiral Mega Super MemberSpiral Mega Super MemberSpiral Mega Super MemberSpiral Mega Super MemberSpiral Mega Super MemberSpiral Mega Super MemberSpiral Mega Super MemberSpiral Mega Super MemberSpiral Mega Super MemberSpiral Mega Super Member
Default Cross-site hacks and the art of self defence

Hackers can force your browser to send requests to any site they want. It's not even hard - all they have to do is get you to view an email or a web page.

Unless the site is specifically protected against this - and almost none are - then attackers can make your browser do anything you can do, and they can use your credentials and your access privileges. They can do things like set preferences, create payees and change passwords.

Generally, browsers stop cross-site communication by following the "same-origin policy". This rule is pretty simple: if your site has a different origin - protocol, domain, and port don't all match - you aren't allowed to access information from or send requests to the other site. Without this simple rule, there would be no security on the internet. Every website could access data from every other one - you'd need a separate web browser for every website.

Unfortunately, the same-origin policy is nowhere near airtight. Attackers don't even need an exploit to bypass it. They can simply embed an IMG, SCRIPT, IFRAME, or FORM tag that references the targeted website in an HTML page. When the victim's browser renders this tag, it generates a request and sends it to the targeted website - right around the same-origin policy. This is a feature of all browsers - it's used by many applications to grab images from other sites and to post from data to services.

Attackers can use this loophole to forge requests that appear to be coming from a legitimate user. These are called cross-site request forgeries, or CSRF, for short. Take a look at the old CSRF attack on Netflix, below.


HTML Code:
<img src=http://www.netflix.com/AddToQueue?movieid=70011204 width="1" height="1" border="0"> 
Attackers can submit forms on your behalf as well. 
<body onload="document.forms[0].submit()"> 
<form method="POST" action="https://bank.com/transfer.do"> 
       <input type="hidden" name="account" value="123456789"/> 
       <input type="hidden" name="amount" value="2500"/> 
</form>

The attacker can post this image tag anywhere - a blog, a wiki, a website, even an email message. Anyone who accidentally browses a page containing the attack while logged into Netflix will have a movie silently added to their queue.

More complex attacks involve a sending series of requests and delays, allowing the attacker to execute a series of actions in a row. In a strange way, a CSRF attack is a sort of program that executes web instructions on behalf of the attacker.

Imagine your browser suddenly turned evil and started trying to mess up your life. What could it do? It might raid the email account you're currently logged into. Maybe it would go after any bank accounts and healthcare sites you're using. Did you click "remember my login" on any websites? Guess what, your renegade browser is logged in and can take over those accounts.


-------------------------------------------

And what if you're at work or connected to the virtual private network? Your browser can go after the corporate portal. Do you have single sign-on? That means you're logged into every web application on your intranet, and your renegade browser can go after any of them.

Using CSRF, an attacker can attack all of these targets and can do just about anything you can do through your browser. All these attacks can be done remotely and basically anonymously.

Separate browsers
OK, so what can you do to protect yourself? First, don't stay logged into websites. You have to actually hit the log-out button, not just close the browser. Next, stop CSRF from getting to your critical websites by using a separate browser to access them. Companies are increasingly using separate browsers for accessing intranet applications and the internet - more should follow suit.

If your web application is attacked by a CSRF, all you'll see is normal transactions being performed by authenticated and authorised users. There won't be any way to tell that the user didn't actually execute the transaction. Probably the only way you'll find out that you have a CSRF problem is when users start complaining about phantom transactions on their account. The attacker can cover their tracks easily by removing the attack once it has worked.

Taken alone, CSRF attacks are simple and powerful. However, most attackers use CSRF and cross-site scripting (XSS
Code:

Code:
http://www.cgisecurity.com/articles/xss-faq.shtml

)) in conjunction.
Together, these two techniques allow attackers to invade a victim's browser and execute malicious programs using the credentials of site the user is logged into.

This combination is devastating, and I'm frankly surprised that a cross-application CSRF-XSS worm hasn't already been developed.

The best solution to CSRF is to require a random token in each business function in your application. You can generate the random token when the user logs in and store it in their session. When you generate links and forms, simply add it to the URL or put it in a hidden form field. For example:



Code:
http://www.example.com?token=8FD41A&data=1
Requests that show up without the right token are forged and you can reject them. If you want to add protection without modifying code, the OWASP CSRFGuard (Category:OWASP CSRFGuard Project - OWASP) is a filter that sits in front of your application and adds token support.

Whatever steps you take to protect yourself - whether it's the physical act of using different browsers or taking a token-based approach with the OWASP filter, make sure you do something - and soon. It will be difficult to roll out protection against forged requests once an attack has started.
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 09-30-2008, 06:06 AM
Junior Member
 
Join Date: Sep 2008
Posts: 5
Reputation: 10
ramitzar is on a distinguished road
Arrow Freeware to evade Cross-site scripting

To protect Cross-site scripting one can use Chorizo a Next Generation Web Application Security Scanner from chorizo-scanner.com.It is available free for one host.

It acts as a proxy between your browser and your application, recording all requests you make to your application. It scans in the background for security issues like Cross Site Scripting (XSS), Cross Site Request Forging (CSRF), Code Inclusion, Remote Code Execution, PHP vulnerabilities, Session injection and more.
Reply With Quote
  #3 (permalink)  
Old 10-21-2008, 06:18 AM
Member +
 
Join Date: Sep 2008
Age: 22
Posts: 64
Reputation: 10
joujoulone is on a distinguished road
Default

thank you for your sharing
Reply With Quote
Reply

Bookmarks

Tags
hackers

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 08:22 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
Copyright © 2004-2008 Noeman . All rights reserved
Homeowner Loans | Dutch Bodybuilding Forums | Loans | Credit Cards | Loans

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114