Cross-Site Request Forgery(CSRF)

AnonymousWolf

Yeni üye
30 Eyl 2012
31
1
Şırnak
A CSRF attack forces an authenticated user(victim) to send a forged HTTP request, including the victim's session cookie to a vulnerable web application which allows the attacker to force the victim's browser to generate request such that the vulnerable app perceives as legitimate requests from the victim.

Let us understand Threat Agents, Attack Vectors, Security Weakness, Technical Impact and Business Impacts of this flaw with the help of simple diagram.

csrf.jpg



Example

Below is a classic example of CSRF :

1. Let us say, the vulnerable app sends a state changing request as a plain text without any encryption.

Kod:
[url]http://bankx.com/app?action=transferFund&amount=3500&destinationAccount=4673243243[/url]
2. Now the hacker constructs a request that will transfer money from the victim's account to the attacker's account by embedding the request in an image that is stored on various sites under the attacker's control:

Kod:
<img src="http://bankx.com/app?action=transferFunds&amount=14000&destinationAccount=attackersAcct#" width="0" height="0" />


Hands ON

1 .Let us perform a CSRF forgery by embedding a javascript into an image. The snapshot of the problem is listed below.

csrf1.jpg




2 .Now we need to mock up the transfer into a 1x1 image and make the victim to click on the same.

csrf2.jpg



3 .Upon submitting the message, the message is displayed as highlighted below.

csrf3.jpg


3 .Now if the victim clicks the below URL, the transfer would be executed which can be found be intercepting the user action using burp suite. We are able to see the transfer by spotting it in Get message as shown below.

csrf4.jpg



4 .Now upon clicking ******* the lesson completion mark would be shown.
Preventing Mechanisms


CSRF can be a****ed by creating an unique token in a hidden field which would be sent in the body of the HTTP request rather than in an URL, which is more prone to exposure.

Forcing the user to reauthenticate or proving that they are a user in order to protect CSRF (e.g - CAPTCHA).


Source : https://www.tutorialspoint.com/security_testing/cross_site_request_forgery.htm
 
Üst

Turkhackteam.org internet sitesi 5651 sayılı kanun’un 2. maddesinin 1. fıkrasının m) bendi ile aynı kanunun 5. maddesi kapsamında "Yer Sağlayıcı" konumundadır. İçerikler ön onay olmaksızın tamamen kullanıcılar tarafından oluşturulmaktadır. Turkhackteam.org; Yer sağlayıcı olarak, kullanıcılar tarafından oluşturulan içeriği ya da hukuka aykırı paylaşımı kontrol etmekle ya da araştırmakla yükümlü değildir. Türkhackteam saldırı timleri Türk sitelerine hiçbir zararlı faaliyette bulunmaz. Türkhackteam üyelerinin yaptığı bireysel hack faaliyetlerinden Türkhackteam sorumlu değildir. Sitelerinize Türkhackteam ismi kullanılarak hack faaliyetinde bulunulursa, site-sunucu erişim loglarından bu faaliyeti gerçekleştiren ip adresini tespit edip diğer kanıtlarla birlikte savcılığa suç duyurusunda bulununuz.