A modular command-line instrument to parse, create and manipulate JSON Net Token(JWT) tokens for safety testing functions.
Options
- Full modularity.
- All instructions are plugins.
- Simple so as to add new plugins.
- Help JWS and JWE tokens.
- Simple interface for plugins. (observe the template instance)
- Versatile
- token technology primarily based on production-class libraries (e.g. json-jwt, jwe).
Obtainable plugins
- Parse: parses jwt tokens.
- jws: manipulate and generate JWS tokens.
- jwe: manipulate and generate JWE tokens.
- bruteforce: brutefocing JWS signing key
- wiki: incorporates offline details about JWT, assaults concepts, references.
Set up
set up it your self as:
Utilization
888888 888 888 88888888888
"88b 888 o 888 888
888 888 d8b 888 888
888 888 d888b 888 888 .d88b. 8888b. 888d888
888 888d88888b888 888 d8P Y8b "88b 888P"
888 88888P Y88888 888 88888888 .d888888 888
88P 8888P Y8888 888 Y8b. 888 888 888
888 888P Y888 888 "Y8888 "Y888888 888
.d88P v1.0.0
.d88P"
888P"
NAME
jwtear - Parse, create and manipulate JWT tokens.SYNOPSIS
jwtear [global options] command [command options] [arguments...]
GLOBAL OPTIONS
-v, --version - Verify present and newest model
-h, --help - Present this assist message
COMMANDS
assist - Reveals a listing of instructions or assist for one command
bruteforce, bfs - plugin to offline bruteforce and crack token's signature.
jws, s - Generate signature-based JWT (JWS) token.
jwe, e - Generate encryption-based JWT (JWE) token.
parse - Parse JWT token (accepts JWS and JWE codecs).
wiki, w - A JWT wiki for hackers.
- Present a subcommand assist, use
-h COMMAND
$jwtear -h jwsNAME
jws - Generate signature-based JWT (JWS) token.
SYNOPSIS
jwtear [global options] jws [command options]
DESCRIPTION
Generate JWS and JWE tokens.
COMMAND OPTIONS
-h, --header=JSON - JWT header (JSON format). eg. {"typ":"JWT","alg":"HS256"}. Run 'jwtear gen -l' for supported algorithms. (required, default: none)
-p, --payload=JSON - JWT payload (JSON format). eg. {"login":"admin"} (required, default: none)
-k, --key=PASSWORD|PUB_KEY_FILE - Key as a password string or a file public key. eg. [email protected] | eg. public_key.pem (default: none)
plugins are outlined as subcommands. Every subcommand might have a number of argument and/or switches.
$ jwtear parse -t eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.J8SS8VKlI2yV47C4BtfYukWPx_2welF34Mz7l-MNmkE
$ jwtear jws -h '{"alg":"HS256","typ":"JWT"}' -p '{"consumer":"admin"}' -k [email protected]
$ jwtear jwe -header '{"enc":"A192GCM","typ":"JWT"}' --payload '{"consumer":"admin"}' --key public.pem
$ jwtear bruteforce -v -t eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyIjpudWxsfQ.Tr0VvdP6rVBGBGuI_luxGCOaz6BbhC6IxRTlKOW8UjM -l ~/tmp/move.record
Add plugin
So as to add a brand new plugin, create a brand new ruby file underneath plugins
listing with the next construction
module JWTear
module CLI
prolong GLI::App
prolong JWTear::Helpers::Extensions::Print
prolong JWTear::Helpers::Utilsdesc "Plugin quick description"
long_desc "Plugin lengthy description"
command [:template, :pt] do |c|
c.motion do |world, choices, arguments|
print_h1 "Plugin template"
print_good "Hello, I am a template."
template = TemplatePlugin.new
finish
finish
finish
module Plugin
class TemplatePlugin
embody JWTear::Helpers::Extensions::Print
embody JWTear::Helpers::Utils
def initialize
check_dependencies
# ..code...
finish
# ..code...
finish
finish
finish
As an alternative of together with all dependencies for every plugin into jwtear, you may add these dependencies as a hash to check_dependencies
technique which would require the library and throw a mild error to the consumer to put in any lacking gems.
The hash key is the gem identify to put in, the hash worth is the require
string
deps = {'async-io' => 'async/ip'}
check_dependencies(deps)
As soon as the lacking dependencies are put in by the consumer, the check_dependencies
would require them as soon as the plugin class initiated.
Contributing
Bug stories and pull requests are welcome on GitHub at https://github.com/[USERNAME]/jwtear.
- Fork it ( https://github.com/KINGSABRI/jwtear/fork )
- Create your characteristic department (
git checkout -b my-new-feature
) - Commit your modifications (
git commit -am 'Add some characteristic'
) - Push to the department (
git push origin my-new-feature
) - Create a brand new Pull Request
Areas to contribute
- contribution by reporting bugs.
- contribution by perfecting the present code.
- contribution by including new plugins.
- contribution by enhancing the jwtear wiki.
- contribution by requesting options and/or plugins.
License
The gem is out there as open supply underneath the phrases of the MIT License.