Skip to content

Commit

Permalink
disable --deep feature
Browse files Browse the repository at this point in the history
  • Loading branch information
htrgouvea committed Apr 16, 2024
1 parent e585038 commit 0c74da1
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions lib/Spellbook/Recon/Extract_Links.pm
Original file line number Diff line number Diff line change
Expand Up @@ -26,27 +26,31 @@ package Spellbook::Recon::Extract_Links {
$target = "https://$target";
}

if ($target =~ /\/$/) { chop($target); }

my $request = $mech -> get($target);
my @links = $mech -> links();

for my $link (@links) {
my $url = $link -> url();

if (($url) && ($url !~ m/#/)) {
if (($url) && ($url !~ m/#/) && ($url !~ /^http(s)?:\/\//)) {
if ($url !~ /^\//) { $url = "/" . $url; }

push @result, $url;

if (($deep) && ($url !~ "^(http|https)://")) {
try {
push @result, Spellbook::Recon::Extract_Links -> new(["--target" => $target . $url]);
}

catch {
#
};
}
# if ($deep) {
# try {
# push @result, Spellbook::Recon::Extract_Links -> new(["--target" => $target . $url]);
# }
# }
}
}

for my $item (@result) {
$item = $target . $item;
}

return uniq @result;
}

Expand Down

0 comments on commit 0c74da1

Please sign in to comment.