GithubHelp home page GithubHelp logo

revoltsecurities / jwt Goto Github PK

View Code? Open in Web Editor NEW
7.0 2.0 0.0 4 KB

An cli based jwt testing lab to learn about how JWT token works for Authorization and session handling

License: MIT License

JavaScript 100.00%

jwt's Introduction

JWT

An cli based jwt testing lab to learn about how JWT token works for Authorization and session handling

Installation:

git clone https://github.com/sanjai-AK47/JWT.git
cd JWT
npm install express
npm install jsonwebtoken

How to do attack for previlage escalation:

Server.js:

Run the server.js or and server1.js for basic jwt token manipulation and escalation attack with using jwt.io

cd JWT
node server.js or server1.js

Now make a curl request with curl as user and make previlage escalation from user to admin

curl -X POST -H "Content-Type: application/json" -d '{"username":"user","password":"user"}' http://localhost:8080/login

Now you get the authentication toke make a request to dashboard

curl -H "Authorization: Bearer {YOUR JWT TOKEN}" http://localhost:8080/dashboard

You can see that you have logined as normal user in dashboard

Exploitation and solution:

Now its time to think like a hacker and made previlage escalation with using tools hashat and jwt_tool to exploit this previlage escation attack and the solution are not mentioned here because try for this attack and do something to exploit this. If anyone found the exploitation or to discuss about the exploitation you can go to discussion side and discuss with others

Information

The both server.js and server1.js has different exploitation so do both and analyse it

jwt's People

Contributors

revoltsecurities avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  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.