Welcome to HBH! If you have tried to register and didn't get a verification email, please using the following link to resend the verification email.

Cookies


Cookies

By ghostghost | 11864 Reads |
0     0

Alright, with my realistic 1 article, i got a couple questions on inline Javascript Injection and how to do it, so i decided to write an article about it.

VIEWING:

Alright, this is going to go a bit farther than maybe needed, but i want to include as much as possible for those who don't know the lingo. First, what we want to do is view the cookies. Simply go up to your url bar (where you type in http://google.com) and erase everything in it, now type: javascript:alert(document.cookie); then hit enter. What just popped up is your personal cookie data. Take a look at how it is set up, cookiename=cookievalue.

EDITING:

Now, let's say you just stole someone's cookie(s) (how you'd be able to do that without knowing how to edit a cookie is beyond me, but, this is just an example..). Let's say you just got admin=True and amIgod=1 What you'll want to do is, do the same thing you did to view the cookies, but instead put: javascript:void(document.cookie="admin=True"); enter javascript:void(document.cookie="amIgod=1"); enter javascript:alert(document.cookie); enter - check to see if the values were added and refresh (or click a link). You should be able to chain them together as well, if you wish. that would look like: javascript:void(document.cookie="admin=True");javascript:void(document.cookie="amIgod=1");javascript:alert(document.cookie); enter - which will do everything as above, but in one line. *note - it doesn't always work, people have been having problems with that in Real 1.

***Note - make sure everything is grammatically correct, and capitalized appropriately.

This is kind of a hard subject to explain very well, so please feel free to ask me any questions.

Comments
ghost's avatar
ghost 19 years ago

I'd said : javascript:void(document.cookie="username=administrator");javascript:void(document.cookie="password=1234abcd");

ghost's avatar
ghost 19 years ago

Sometimes you can't link them together and you need to do one query at a time.

ghost's avatar
ghost 19 years ago

Nice helped me out a lot

ghost's avatar
ghost 18 years ago

yeah good tut lol I forgot to see those damn cookies xD thanks buddy ;)

ghost's avatar
ghost 18 years ago

Pretty good but a bit too much of a spoiler in my humble oppinion.

ghost's avatar
ghost 18 years ago

It doesnt work for me. All I get is an alert box with {Javascript Application} as the title. I am using FF. What did I do wrong?

ghost's avatar
ghost 16 years ago

Search Cookies on the Firefox AddOn page. Thye have one that lets you edit the cookies.

ghost's avatar
ghost 15 years ago

Not bad, but please PARAGRAPHS

Lionz's avatar
Lionz 12 years ago

yes firefox doesn't accept that in url address

someone_lost's avatar
someone_lost 10 years ago

doesnt work on chrome:o

bahpomet1105's avatar
bahpomet1105 9 years ago

This helped me out so much especial on basic 7 thank you so much