Here’s a nice article about hacking with a real world example that you can do yourself.
There are lots of different ways to hack a website, the most common being “SQL injections” and “XSS“. Today we’re going to look at XSS.
What is XSS?
XSS stands for Cross Site Scripting. It basically involves exploiting a vulnerability in a part of the website that lets a hacker run scripts on the victims website. It’s called Cross Site Scripting because the hacker usually uploads a script to the victims website that redirects website visitors to the hackers website where they run more scripts (that do damage) and redirect the visitor back to the victims website. As far as the visitor is concerned, everything is happening on the victims website and they don’t even know that the website has been compromised.
How To Do an XSS Hack
So now you know what an XSS hack is, here’s how to do one.
First we look for a website that allows visitors to upload their own content. This could be via a file upload, a comments section or even a Twitter feed where people can leave a twitter message and it gets listed on the victims website. As an example, lets take the comments section of say…. any piece of art listed on The Auckland Art Gallery Toi O Tamaki.
So now we have a place that allows us to upload content to their website, lets upload a script. This could be any script. Ordinarily, a hacker would upload a script that secretly pulls data from the hackers website, redirects the user or does some other malicious activity like downloads a virus or something. We’re not going to do that because its illegal and we don’t want to; we just want to run a script to prove the vulnerability.
Our script won’t do anything illegal, it will just show a popup window that says “Here is a vulnerability”. So lets look at the code for a popup window:
<script>alert(‘Here is a vulnerability’);</script>
If you copy and paste the above code exactly as it is above (You’ll need to change the quote marks so they are single quote rather than curly single quotes), into the comment window, enter a name, made up email address and city into the fields required to post a comment, hit the submit comment button, then you’re done. You’ve just learned how to hack a website using XXS!
Now go back to the overview of the artwork and click on “comments” to see if the hack you just did worked. You should see a blank comment and a popup window (which is the script you just ran on the website.
You’ll notice that they also have a twitter feed. I haven’t tried it because its on every page of the website and I don’t want to ruin their website, but I suspect that they have the same XSS vulnerability in their twitter feed too.
So Auckland Art Gallery has a pretty poor website – Don’t worry I’ll notify them as soon as they actually pick up the phone when I ring them! I’ve already tried emailing them, but the email part of their website doesn’t work…
Is My Website Safe From XSS Hacks?
If your website was made my Data Support, you haven’t made changes to any plugins or code yourself (excluding content changes) and you get your website updated when updates come out (I always notify of these), then your website should be pretty safe.
Having said that, new hacks are being discovered all the time and it’s very much worthwhile to have a security audit done every now and then. If you are concerned about the security of your website or computer environment, please contact Data Support for advice.