Git Product home page Git Product logo

cookie-exploit's Introduction

Cookie-Exploit

Exploit for websites cookies and access to read files from the target

How ?

It works in such a way that it tests the websites that use the load directory in base64 cookies and the desired directories can be read.

Way to Hack !

  • Another injection method of these websites is to read the logs. For example, if the target web server was ngnix, you can see the user-agent by reading the ngnix log file located in /var/log/ngnix/access.log. You may say, what is the use of user-agent? You can use burp suit or a programming language to put malicious php code instead of user-agent and enter the web server logs. Congratulations, the site was hacked.

The main reason for this vulnerability !

if (empty($_COOKIE['PHPSESSID']))
{
    $page = "Home";
    $page->file = '/www/index.html';

    setcookie(
        'PHPSESSID', 
        base64_encode(serialize($page)), 
        time()+60*60*24, 
        '/'
    );
} 

$cookie = base64_decode($_COOKIE['PHPSESSID']);
unserialize($cookie);

In this piece of code, "$page->file = '/www/index.html';" sets the file path to the home page of a website. Specifically, it sets the file path to '/www/index.html' for the "$page" variable. This code is used to maintain session state between client and server and to keep track of the user's current page and to make sure that they are directed to the correct page if they leave and then revisit the website. now we can change the pathfile to access directory.

Watch Exploit Test Video.

cookie-exploit's People

Contributors

adarkdev avatar

Stargazers

AVA avatar  avatar  avatar H∆MZ∆ avatar  avatar  avatar Tob avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.