Git Product home page Git Product logo

jwtweak's Introduction

JWTweak

GitHub stars GitHub forks

Introduction

With the global increase in JSON Web Token (JWT) usage, the attack surface has also increased significantly. Having said that, this utility is designed with the aim to generate the new JWT token with little or no time which would help security enthusiasts to find security flaws in JWT implementation like Algorithm confusion attacks. This tool is designed to automate the process of modifying the JWT algorithm of input JWT Token and then generate the new JWT based on the new algorithm.

Requirements

  • Python 3 (tested and working fine in python-3.7.7/Kali and python-3.8.2/Windows 10)
  • pip3 install pycryptodomex

Features

  • Detects the algorithm of the input JWT Token
  • Base64 decode the input JWT Token
  • Generate new JWT by changing the algorithm of the input JWT to 'none'
  • Generate new JWT by changing the algorithm of the input JWT to 'HS256'
  • Generate new JWT by changing the algorithm of the input JWT to 'HS384'
  • Generate new JWT by changing the algorithm of the input JWT to 'HS512'
  • Generate new JWT by changing the algorithm of the input JWT to 'RS256'
  • Generate new JWT by changing the algorithm of the input JWT to 'RS384'
  • Generate new JWT by changing the algorithm of the input JWT to 'RS512'

Download Link

JWTweak.py

POC

jwtweak

Issues and Suggestions

GitHub issues

Author

Rishu Ranjan

jwtweak's People

Contributors

rishuranjanofficial avatar rubaljain avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

jwtweak's Issues

Syntax error

  File "JWTweak.py", line 26
    print(f"{bcolors.OKGREEN}\nThis is a valid input JWT Token{bcolors.ENDC}")
                                                                            ^
SyntaxError: invalid syntax

This way I get a lot of errors in python3.

This specific code snipper will going to result in an error

str_req_str=req_str.decode('utf-8')

                Header=part_jwt[0]
                if len(Header) % 4 != 0: #check if multiple of 4
                    while len(Header) % 4 != 0:
                        Header = Header + "="
                    req_str = base64.b64decode(Header)
                else:
                    req_str = base64.b64decode(Header)
                    str_req_str=req_str.decode('utf-8')

Due to Line #54 of code, and not the same line just before, this code will give an error when length of the header is not multiple of 4

Add below line just before else condition.

str_req_str=req_str.decode('utf-8')

I can create a pull request if you want.

Thanks :)

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.