diff --git a/.config/modules.json b/.config/modules.json index 78f5aaa..b273cd5 100644 --- a/.config/modules.json +++ b/.config/modules.json @@ -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" } ] } \ No newline at end of file diff --git a/lib/Spellbook/Recon/Technologies.pm b/lib/Spellbook/Recon/Technologies.pm new file mode 100644 index 0000000..85ef911 --- /dev/null +++ b/lib/Spellbook/Recon/Technologies.pm @@ -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; \ No newline at end of file