Skip to content

Commit

Permalink
draft module
Browse files Browse the repository at this point in the history
  • Loading branch information
htrgouvea committed Oct 24, 2024
1 parent a4a96ff commit 1d3c6a9
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions lib/Spellbook/Recon/Technologies.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
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) {
if ($target !~ /^http(s)?:\/\//x) {
$target = "https://$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 1d3c6a9

Please sign in to comment.