Guide On Hack Through Cross-Site Request Forgery (CSRF) [Tutorial] 05-02-2012, 07:09 PM
#1
Guide On Cross-Site Request Forgery (CSRF) - by Shining White
Hello Good Day to all , Since we have Some famous web hacking tut SQLi , XSS , LFI , RFi on HC , I decided to Post about CSRF known as Cross-Site Request Forgery
Okay lets Start with Introduction ,
Cross-Site Request Forgery (CSRF ) known as C-Surf , Session Riding , XSRF or one-click attack
of-course as Many of you know CSRF is not the XSS (Cross-Site Scripting)
If you are Searching about XSS - Please Read the Thread Written by 1234HotMaster
For the who don't know in XSRF / CSRF When the Victim Click the Attackers link Victim Send Attacker Request to the web server without any knowlegdge aout it (if not understand not worry , read other part :whistle: )
There is a little misunderstand regarding a CSRF
### If Site is not Vulenerble to the XSS then it not Vulns to the CSRF
Probablly Wrong CSRF Not Require any XSS Vulnerability it (XSS Vulnerability ) Just Make XSRF Vulnerable Easier ,
There is only Requirment for the CSRF is , VIctim / User must loging to the Target Site ,
Actually i can't say to the Web Site it should be Web Application
can't explain more about the Differences of Web App and Web Site Now,
Having strong passwords is always a good idea, but CSRF bypasses that part of the protection, because works once the user has logged themself into the site using their strong password.
look the below lines -- >
you must find a form submission at the target site, or a URL that has side effects, that making something , Like , Ban Member , Money Transfer etc
you must find the right values for all the form's or URL's inputs; if any of them are required to be secret authentication values or IDs that the attacker can't guess, the attack will fail.
like HC - Session ID is Encoded so Attacker can't guess the Values Each time ,
Lets take a Sample site - www.hackcommunity.com
When Illusion (Administrator) Log in to the HackCommunity.com Web Site is provide Session ID to his Browser Cookies , it will Stand till he log out from the HC , After log out
Session is Expiring
In Mean While All request from His browser take as His Request from Site, because of Session ID ,
If the browser has valid session keys, it means all the request sent by this browser is valid an belong to this user
Now Attacker Send or Post a Malasious http Link to the Administrator TO Click , Thats why we call it One-Click-Attack
Administrator session id is Stored, so this http requset would be recognised as a request sent by this user and website would act according to this request.
So lets say Attacker Need to Ban Shining White From the HC ,
and he found Banning Link of the Admin is
Code:
www.hackcommunity.com/userban.php?id=1337
and Send a Link or Attacker can add IMG tag on the link , because Browser take img tag as Link source
here
Code:
<img src="www.hackcommunity.com/userban.php?id=1337">well Viola ! Shining Whity is Banned .. ,
Well talking about Site using Forms ,
well take sample www.paypal.com
there is Form to send money to the other person , When it Filled the Data is doing through the URL
Let think This this think going through the Link
User ID -
Amount Need to Send -
Receiver ID -
and the you found the link is
Code:
http://www.paypal.com/transfermoeny? userid=______&amount=______& Receiver =_______So you know the format of the form so you will send the link in an image tag to the user
Code:
<img src=\"http://www.paypal.com/transfermoeny? userid=Victim&amount=9999223& Receiver =Shining">What are the Vulnerable to XSRF ???
Well as i mentioned Web Application are the Vulnerable to the Attack
Blog
Forum
Hosting Site
Money Trasfer sites
etc
Okay Saying in simple word , CSRF mean Misredirection Through the Victims Session ID
i guess you know about the misdirection theory on Social Engineering , if not post here and request a thread ,
==========================================
The CSRF Cross-Site Request Forgery Tutorial by Shining White for Hackcommunity.com -
=============================================================
Please be Kind to Mention it before the Leech or post on another site , (Please don't post this same thread on HC again :lol
also i spend much time to read the lot of Sites and take collection information , So i can't give t credit to anyone since this is originnaly written by me for HC ,
![[Image: Wfxdx.png]](http://i.imgur.com/Wfxdx.png)


![[+]](https://sinister.li/images/modern/collapse_collapsed.png)

