-
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New modules and fixes for lint warnings (#82)
* add linter * fix linter warnings * add zarn * new exploit * Exploit for CVE-2021-24891, Dom XSS Elementor plugin of wordpress * return to HTTP * improve description on module * update license year
- Loading branch information
Showing
17 changed files
with
171 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: Linter / Perl Critic | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
critic: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Run Perl::Critic | ||
uses: natanlao/[email protected] | ||
with: | ||
files: critic |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: ZARN | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
- develop | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install dependencies | ||
run: | | ||
git clone https://github.com/htrgouvea/zarn | ||
sudo apt install -y perl cpanminus | ||
cd zarn && sudo cpanm --installdeps . | ||
- name: Hunt for findings | ||
run: | | ||
perl zarn/zarn.pl --source . --sarif zarn.sarif | ||
- uses: github/codeql-action/upload-sarif@v2 | ||
with: | ||
sarif_file: zarn.sarif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
only = 1 | ||
include = ProhibitUnusedVariables ProhibitUnusedConstant ProhibitUnusedInclude ProhibitUnusedImport ProhibitUnreachableCode ProhibitComplexRegexes ProhibitDuplicatedSub ProhibitDuplicateHashKeys ProhibitUnusedPrivateSubroutines ProhibitUnlessBlocks RequireCamelCase ProhibitExcessiveColons ProhibitExplicitReturnUndef ProhibitTrailingWhitespace | ||
|
||
# ProhibitTrailingWhitespace ProhibitMagicNumbers ProhibitHardTabs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
package Spellbook::Advisory::CVE_2021_24891 { | ||
use strict; | ||
use warnings; | ||
use Spellbook::Core::UserAgent; | ||
|
||
sub new { | ||
my ($self, $parameters) = @_; | ||
my ($help, $target, @results); | ||
|
||
Getopt::Long::GetOptionsFromArray ( | ||
$parameters, | ||
"h|help" => \$help, | ||
"t|target=s" => \$target | ||
); | ||
|
||
if ($target) { | ||
if ($target !~ /^http(s)?:\/\//) { | ||
$target = "https://$target"; | ||
} | ||
|
||
my $useragent = Spellbook::Core::UserAgent -> new(); | ||
|
||
my $fingerprints = { | ||
1 => { | ||
endpoint => "/wp-content/plugins/elementor/assets/js/frontend.min.js", | ||
regex => "elementor[\\s-]*v(([0-3]+\\.(([0-5]+\\.[0-5]+)|[0-4]+\\.[0-9]+))|[0-2]+[0-9.]+)" | ||
}, | ||
2 => { | ||
endpoint => "/#elementor-action:action=lightbox&settings=eyJ0eXBlIjoibnVsbCIsImh0bWwiOiI8c2NyaXB0PmFsZXJ0KCd4c3MnKTwvc2NyaXB0PiJ9", | ||
regex => "elementor[\\s-]*v(([0-3]+\\.(([0-5]+\\.[0-5]+)|[0-4]+\\.[0-9]+))|[0-2]+[0-9.]+)" | ||
} | ||
}; | ||
|
||
foreach my $key (keys %$fingerprints) { | ||
my $inner_hash = $fingerprints -> {$key}; | ||
my $request = $useragent -> get($target . $inner_hash->{endpoint}); | ||
|
||
if (($request -> code() == 200) && $request -> decoded_content() =~ m/$inner_hash->{regex}/) { | ||
push @results, $target . $inner_hash -> {endpoint}; | ||
} | ||
} | ||
|
||
return @results; | ||
} | ||
|
||
if ($help) { | ||
return " | ||
\rAdvisory::CVE_2021_24891 | ||
\r======================= | ||
\r-h, --help See this menu | ||
\r-t, --target Define a target\n\n"; | ||
} | ||
|
||
return 0; | ||
} | ||
} | ||
|
||
1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ package Spellbook::Exploit::HAProxy_Exposed { | |
); | ||
|
||
if ($target) { | ||
return @result; | ||
} | ||
|
||
if ($help) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ package Spellbook::Exploit::None_Attack { | |
); | ||
|
||
if (1) { | ||
|
||
return @result; | ||
} | ||
|
||
if ($help) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package Spellbook::Exploit::S3_Bucket_Takeover { | ||
use strict; | ||
use warnings; | ||
use Spellbook::Core::UserAgent; | ||
|
||
sub new { | ||
my ($self, $parameters) = @_; | ||
my ($help, $target, @result); | ||
|
||
Getopt::Long::GetOptionsFromArray ( | ||
$parameters, | ||
"h|help" => \$help, | ||
"t|target=s" => \$target | ||
); | ||
|
||
if ($target) { | ||
if ($target !~ /^http(s)?:\/\//) { | ||
$target = "https://$target"; | ||
} | ||
|
||
my $userAgent = Spellbook::Core::UserAgent -> new(); | ||
my $request = $userAgent -> get($target); | ||
|
||
if ($request -> code() == 404 && $request-> content() =~ m/Code: NoSuchBucket/) { | ||
push @result, $target; | ||
} | ||
|
||
return @result; | ||
} | ||
|
||
if ($help) { | ||
return " | ||
\rExploit::S3_Bucket_Takeover | ||
\r===================== | ||
\r-h, --help See this menu | ||
\r-t, --target Check the possibility to takeover an s3 resource\n"; | ||
} | ||
|
||
return 0; | ||
} | ||
} | ||
|
||
1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters