Mukezh

Session Cross Site Request Forgery

Feb 11th, 2019
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.40 KB | None | 0 0
  1. Cross site request Forgery
  2. Missing Function Level Access Control
  3. ----------------------------------------
  4. Cross site request Forgery.
  5. In this attack the hacker creates a forged http request and tricks victim into submitting that request via images tabs or xss
  6. The application allows a user to submit a state changing request that does not include anything secret.
  7.  
  8. For example:
  9. http://anywebsite.com/app/transferFunds?amount=1500&destinationAccount=4673243243
  10. this all done by making the victim click on a link or on a certain appealing image
  11. ________
  12. DEMO DVWA
  13.  
  14.  
  15. Steps
  16.  
  17. Step 1 Open XAMPP start mysql and apache server
  18.  
  19. step 2 go to your browser in the 'url field' type 127.0.0.1/dvwa
  20.  
  21. step 3 login in to dvwa with username="admin" and password="password"
  22.  
  23. step 4 goto to dvwa security change the security level to "low"
  24.  
  25. step 5 goto click on "CSRF" tab on the left side
  26.  
  27. step 6 inspect element
  28.  
  29. step 7 select the form with the cursor
  30.  
  31. step 8 right click on "<form action= '#' " click on "Edit as HTML"
  32.  
  33. step 9 copy the code and open up a notepad file.
  34.  
  35. step 10 replace the '#' in action= to "127.0.0.1/dvwa/vulnerabilities/csrf"
  36.  
  37. step 11 save the file as html
  38.  
  39. step 12 open the saved file in the new tab note-> your old tab should also be open and change the password in the newly created file.(change your password to admin)
  40.  
  41. step 13 after practice reverse the password to password.
  42.  
  43. #For LVS
  44.  
  45. step 1 open 127.0.0.1/lvs111
  46.  
  47. step 2 click on csrf >Gmail logout options
  48.  
  49. step 3 open a gmail in a new tab
  50.  
  51. step 4 open the lvs tab and click on submit querry
  52.  
  53. and your gmail account would be logged out.
  54.  
  55.  
  56. LVS-2 comment box
  57. step 1 open 127.0.0.1/lvs111
  58.  
  59. step 2 click on csrf > csrf in comment box
  60.  
  61. step 3 type a comment if you want to
  62.  
  63. step 4 click on the iphone photo
  64.  
  65. step 5 Click on back button
  66.  
  67. and a comment would be posted that was not earlier there.
  68.  
  69. ________________________________________________
  70.  
  71. Missing Function Level Access Control
  72. ---------------------------------------------
  73. It is an attack in which a hacker or an anonymous person is able to access an application interface that it would otherwise never been able to access.
  74.  
  75. eg if a hacker open up
  76.  
  77. www.anywebsite.com/user
  78. and logs in with credentials after that get redirected to
  79. www.anywebsite.com/admin
  80.  
  81. Now if a hacker is able to type www.anywebsite.com/admin and is able to enter without using credentials that is case of Missing Function Level Access Control.
  82.  
  83. ---
  84.  
  85. steps
  86.  
  87. Step1 goto 127.0.0.1/lvs111
  88.  
  89. step 2 Click on Missing Function Level Access control "unauthenticate user access to admin"
  90.  
  91. step 3 login with credentials admin and password
  92.  
  93. step 4 copy url
  94.  
  95. step 5 click on logout and paste the url
  96.  
  97. try to do the same with "Authenticated user access to admin"
  98.  
  99. CSRF
  100. =====
  101. CSRF stands for Cross/Client Site Request Forgery. 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 which is not actually made by user ....
  102.  
  103.  
  104. The browser requests automatically include any credentials associated with the site, such as the user's session cookie, IP address, Windows domain credentials, and so forth. Therefore, if the user is currently authenticated to the site, the site will have no way to distinguish between the forged request sent by the victim and a legitimate request sent by the victim.
  105.  
  106. Eg. already logged in into a bank site and clicking on a ad on other malicious website stating "click here to win an iphone X" and is malicious.
  107.  
  108.  
  109. ----------------------------------------------------------------------------------------------------------------------------
  110.  
  111. MISSING FUNCTION LEVEL ACCESS CONTROL
  112. =====================================
  113.  
  114. Let us first understand what Access Control means.
  115. Access Control : access control is a process by which users are granted access and certain privileges to systems, resources or information. This term is usually derives for Authentication Checks.
  116.  
  117. Most of the web applications verify function level access rights before making that functionality accessible to the user. Missing Function Level Access Control is one of the vulnerabilities on OWASP's Top 10 list and occurs when those authentication function checks are insufficient and attackers misuse them.
  118.  
  119.  
  120. www.abc.com/login/login.php?id=user
  121. _________
  122. | |
  123. |normal |
  124. | user |
  125. | |
  126. |_________|
  127.  
  128.  
  129. www.abc.com/login/login.php?id=admin
  130.  
  131. ____________
  132. | |
  133. |ADMIN Panel | <--- Redirect you to admin panel
  134. | | No access control
  135. | |
  136. |____________|
  137.  
  138. Demonstration on LVS via Unrestricted User Access to the Admin Account.
  139.  
  140. ----------------------------------------------------------------------------------------------------------------------------
  141.  
  142. UNVALIDATED REDIRECTS AND FORWARDS
  143. ===================================
  144.  
  145.  
  146. Most web applications on the internet frequently redirect and forward users to other pages or other external websites.
  147. Invallidated/Unvalidated redirects and forwards means redirecting a authenticated and valid user to a phishing or malicious web page which defines a malicious activity created by the attacker as using forwards to access unauthorized pages.
  148.  
  149. How to find the redirecting value?
  150. There is a redirect to="url" value in the Hyperlinks, this will signify that the URL is redirecting us to a particular malicious link.
  151.  
  152.  
  153. www.ronak.com/login/redirectTo=www.google.com/antwasp
  154.  
  155.  
  156.  
  157.  
  158.  
  159. Demonstration on LVS of Manual Redirects and Automatic Redirects.
  160.  
  161. ------------------------------------------------------------------------------------------------------------------------
  162. Automated VAPT Tool - NETSPARKER
  163. ================================
  164.  
  165. Netsparker is a web application security scanner, with support for both detection and exploitation of vulnerabilities. It is like Acunetix only, but more advanced and flexible in Report Generation and finding out Vulnerabilities.
  166.  
  167. Demo Application - https://www.netsparker.com/web-vulnerability-scanner/download/
  168.  
  169. Demonstration of Report Generation and explanation on demo.testfire.net via Netsparker.
  170.  
  171. ----------------------------------------------------------------------------------------------------------------------------
Add Comment
Please, Sign In to add comment