Skip to content

Commit

Permalink
pushing new modules
Browse files Browse the repository at this point in the history
htrgouvea committed Dec 4, 2024

Unverified

This user has not yet uploaded their public signing key.
1 parent 8018270 commit b389555
Showing 2 changed files with 48 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .config/modules.json
Original file line number Diff line number Diff line change
@@ -389,6 +389,12 @@
"category": "recon",
"module": "Technologies",
"description": "Use wappalyzer to detect technologies from a website"
},
{
"id": "0065",
"category": "crypto",
"module": "JWT_Content",
"description": "Visualize the content of a JWT"
}
]
}
42 changes: 42 additions & 0 deletions lib/Spellbook/Crypto/JWT_Content.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package Spellbook::Crypto::JWT_Content {
use strict;
use warnings;
use MIME::Base64;
use Getopt::Long;

sub new {
my ($self, $parameters) = @_;
my ($help, $data);

Getopt::Long::GetOptionsFromArray(
$parameters,
"h|help" => \$help,
"d|data=s" => \$data
);

if ($data) {
my ($header_b64, $payload_b64, $signature_b64) = split(/\./, $data);

if ($header_b64 && $payload_b64 && $signature_b64) {
my $header = decode_base64($header_b64);
my $payload = decode_base64($payload_b64);

return "$header$payload";
}

return 0;
}

if ($help) {
return "
\rHelper::JWT_Content
\r=====================
\r\t-h, --help See this menu
\r\t-d, --data Define the payload data to visualize the content\n\n";
}

return 0;
}
}

1;

0 comments on commit b389555

Please sign in to comment.