How to Hack a Website
How to Hack a Website
Some people assume that all hackers have bad intentions, but that’s not true! "White hat" hackers exploit vulnerabilities in websites to help site owners improve their security. White hat hacking can even become your career! This wikiHow article will teach you two ways to hack websites as a white-hat hacker, give you some sample code, and help you perfect your hacking skills.
Steps

Using Cross-Site Scripting

Find a vulnerable site where you can post content. A message board is a good example. Remember, if the site is not vulnerable to a cross-site scripting attack, then this will not work.

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 out code. Post If an alert box appears when you click on your post, then the site is vulnerable to attack.

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 that supports PHP and is vulnerable to remote code execution via upload. An example cookie catcher code can be found in the sample section.

Post with your cookie catcher. Input a proper code into the post which will capture the cookies and sent 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