Skip to content

Commit

Permalink
new module to identify technologies from a web page
Browse files Browse the repository at this point in the history
  • Loading branch information
htrgouvea committed Sep 20, 2023
1 parent 1e58507 commit 8b76a3a
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .config/modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,18 @@
"category": "exploit",
"module": "DataBreach",
"description": ""
},
{
"id": "0047",
"category": "recon",
"module": "Screenshot",
"description": "Take screenshot from web pages"
},
{
"id": "0048",
"category": "recon",
"module": "Technologies",
"description": "Detect the stack of a web application"
}
]
}
46 changes: 46 additions & 0 deletions lib/Spellbook/Recon/Technologies.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package Spellbook::Recon::Technologies {
use strict;
use warnings;
use WWW::Wappalyzer;
use Spellbook::Core::UserAgent;
use List::Util 'pairmap';

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

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

if ($target) {
my $userAgent = Spellbook::Core::UserAgent -> new();
my $request = $userAgent -> get($target);
my %headers_hash = pairmap { $a => [ $request -> headers -> header($a) ] } $request -> headers -> flatten;
my $wappalyzer = WWW::Wappalyzer -> new();

my %detected = $wappalyzer -> detect (
html => $request -> decoded_content,
headers => \%headers_hash
);

@result = map { @$_ } values %detected;

return @result;
}

if ($help) {
return "
\rRecon::Detect_Tech
\r=====================
\r-t, --target Define the target
\r-h, --help See this menu\n\n";
}

return 1;
}
}

1;

0 comments on commit 8b76a3a

Please sign in to comment.