In this article, we are telling you about the Cross-Site Request Forgery attack. We have already told you about the Cross-Site Request Forgery attack. You can also read our article if you want.
Here we are telling you how to do Cross-Site Request Forgery attack using different methods, here we are telling you by solving some labs.
All these labs are found on the website of portswigger, here you are not being told the principle. We have already told you about the Cross-Site Request Forgery attack using BWAPP earlier.
Note- This article is only for educational purpose. Don’t miss use your knowledge and skills.
Cross-Site Request Forgery Attack Labs ?
Apart from the labs mentioned here, you also get more labs of Cross-Site Request Forgery Attack, which you can try to solve by yourself, we do not tell you how to solve all labs so that you can try to solve labs yourself.
Also Read
What is websockets security vulnerabilities
HTTP request smuggling vulnerability
What is json vulnerabilities owasp
CSRF vulnerability with no defenses ?
First of all, to solve this lab you have to run the burp suite normally as you are told in all the articles how you can run the burp suite.
https://portswigger.net/web-security/csrf/lab-no-defenses
![Cross-Site Request Forgery Attack](https://freelearningtech.in/wp-content/uploads/2021/02/cvbg-b-1024x554.png)
After running the burp suite normally you have to access the lab as you can see in the image here you get the username and password to login with lab as well.
![Cross-Site Request Forgery Attack](https://freelearningtech.in/wp-content/uploads/2021/02/dfgrbg-1024x552.png)
After accessing lab you get the option to login on home page, you have to login there by giving username and password as you can see in the image, you have to do something similar.
What is file path traversal vulnerability
![Cross-Site Request Forgery Attack](https://freelearningtech.in/wp-content/uploads/2021/02/fgb-1024x477.png)
After login, you get the option of change email in this way, here you can send any email of your choice and click on update email as you can see in the image here.
![](https://freelearningtech.in/wp-content/uploads/2021/02/rfghnmh-1024x531.png)
After doing all this you will get a post request in http history in burp suite like you can see in the image here you will get the option to generate CSRF POC in the option of engagement tools by right clicking this request.
![Cross-Site Request Forgery Attack](https://freelearningtech.in/wp-content/uploads/2021/02/dfvgbnhm.png)
After it is open in front of you in this way, you have to go to the option and check the option of include auto -submit script. After doing all this, you have to click on regenerate, something like this Cross-Site Request Forgery Attack work Does
![Cross-Site Request Forgery Attack](https://freelearningtech.in/wp-content/uploads/2021/02/dfghjy-1024x660.png)
After doing all this, you have to go to the exploit server after copy html, in this way you have to give that format in that body, after doing all this, when you click on the store, you will be able to see your lab will be solved.
How to do os command injection attack
![Cross-Site Request Forgery Attack](https://freelearningtech.in/wp-content/uploads/2021/02/edfghjmj-1024x432.png)
Here you can also check by exploiting the view, you will get to see the submit request button in this way and your lab will also solve this, it is the same as you have been told earlier in Bwapp.
CSRF where Referer validation depends on header being present
In the same way, you can also solve the second lab of Cross-Site Request Forgery Attack, here also first you have to do the same process as you have been told in the earlier lab, here also you have to request to change the email.
https://portswigger.net/web-security/csrf/lab-referer-validation-depends-on-header-being-present
![Cross-Site Request Forgery Attack](https://freelearningtech.in/wp-content/uploads/2021/02/efgbg-1024x582.png)
Just like you got a post request in the burp suite’s http history on changing email in the previous lab, you get a post request here as well, as you can see in the image, you also get something similar.
![Cross-Site Request Forgery Attack](https://freelearningtech.in/wp-content/uploads/2021/02/de3gt-1024x581.png)
Here you have to send this request to the repeater, there you have to change the url as you can see in the image, you get a response in this way by clicking the url.
What is oauth 2.0 authentication vulnerability
![](https://freelearningtech.in/wp-content/uploads/2021/02/dfgnh-1024x578.png)
Here now if you remove the referer url, in such a way you get to see the response of 302 found as if you can see in the image, after doing all this, you have to send this request to generate the CSRF pass.
![](https://freelearningtech.in/wp-content/uploads/2021/02/fgnhg.png)
You have to add a line like this, here you have to do the same process as you have been told in the earlier lab as you can see in the image, you have to add this line in some way.
![](https://freelearningtech.in/wp-content/uploads/2021/02/dfgrth.png)
After doing all this, you have to copy html, after that you have to give that format in the body of the exploit server, after this you have to click on the store, you can check it by exploit the view.
![](https://freelearningtech.in/wp-content/uploads/2021/02/fgvbg-b-1024x461.png)
After doing all this, you will be able to see that this lab of your Cross-Site Request Forgery Attack will be solved as if you can see that the message of congratulations is gone.
CSRF with broken Referer validation
In the same way, you get the third lab of Cross-Site Request Forgery Attack, here too first you have to process the same as you have to capture the request of email change in labs.
https://portswigger.net/web-security/csrf/lab-referer-validation-broken
![](https://freelearningtech.in/wp-content/uploads/2021/02/dfvgbnhfbg-1024x579.png)
After doing all this, you have to send that request to the repeater as mentioned in the previous lab, you also have to first change the referer url and send the request.
![](https://freelearningtech.in/wp-content/uploads/2021/02/dfgrbtnhn-1024x582.png)
After doing all this, you have to change the referer url from the original domain as well as the request again and send the request again as you can see in the image.
What is web cache poisoning vulnerability
![](https://freelearningtech.in/wp-content/uploads/2021/02/ertghjymj.png)
After doing all this, you have to send this request to the generate CSRF pass option and you have to do the same process and also you have to add a line like this.
![](https://freelearningtech.in/wp-content/uploads/2021/02/dfgtnhm.png)
After adding a line like this, you have to copy html and go to the exploit server and paste that format in the body, after doing this you have to click on the store.
![](https://freelearningtech.in/wp-content/uploads/2021/02/efghtj-1024x507.png)
After doing all this, if you want, you can see by exploiting the view, you will get to see the submit request button and this lab of your Cross-Site Request Forgery Attack will also be solved.
The Conclusion
I hope that now you can understand about these labs of Cross-Site Request Forgery Attack. We have told you about Cross-Site Request Forgery Attack before.
You must first read our article about Cross-Site Request Forgery Attack, then only you can understand these labs, we have tried to tell you here how we can find Cross-Site Request Forgery bug.
All this has been told to you for educational purpose, I hope that you will not use it in illegal way, here we have given you many such articles.
If you have any kind of problem in solving the labs of Cross-Site Request Forgery Attack and in such a way, you can ask in the comment as well as if you have any kind of question, you can still ask.
If you like this article about our Cross-Site Request Forgery Attack, then you must share it, here we have told you everything for free, you can also support us if you want.
Subscribe to our blog for latest updates
Sharing is Caring
Thankyou
Leave a Reply