Skip to content

Commit

Permalink
Merge branch 'main' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
htrgouvea committed Dec 4, 2024
2 parents 3fde931 + b389555 commit 49cd8f9
Show file tree
Hide file tree
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
Expand Up @@ -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 49cd8f9

Please sign in to comment.