-
-
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.
Improving the code legibility and new modules for misconfig on s3 buc…
…kets (#84) * 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 * added uuid lib * enable all rules of level 5 on linter * dont follow redirects * delete draft of a module * new modules aroung aws s3 buckets * add secret scanning in the pipeline * Exploit for XSS vulnerability on grafana * fix module/using new data source
- Loading branch information
Showing
10 changed files
with
174 additions
and
67 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,39 @@ | ||
name: Secret Scanning | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
permissions: | ||
contents: read | ||
id-token: write | ||
issues: write | ||
pull-requests: write | ||
|
||
jobs: | ||
TruffleHog: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
shell: bash | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Secret Scanning - TruffleHog | ||
id: trufflehog | ||
uses: trufflesecurity/trufflehog@main | ||
continue-on-error: true | ||
with: | ||
path: ./ | ||
base: "${{ github.event.repository.default_branch }}" | ||
head: HEAD | ||
extra_args: --debug | ||
|
||
- name: Scan Results Status | ||
if: steps.trufflehog.outcome == 'failure' | ||
run: exit 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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
only = 1 | ||
include = ProhibitUnusedVariables ProhibitUnusedConstant ProhibitUnusedInclude ProhibitUnusedImport ProhibitUnreachableCode ProhibitComplexRegexes ProhibitDuplicatedSub ProhibitDuplicateHashKeys ProhibitUnusedPrivateSubroutines ProhibitUnlessBlocks RequireCamelCase ProhibitExcessiveColons ProhibitExplicitReturnUndef ProhibitTrailingWhitespace | ||
severity = 5 | ||
|
||
# ProhibitTrailingWhitespace ProhibitMagicNumbers ProhibitHardTabs | ||
[-TestingAndDebugging::RequireUseStrict] |
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 was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package Spellbook::Exploit::Upload_Via_PUT { | ||
use strict; | ||
use warnings; | ||
use Spellbook::Core::UserAgent; | ||
use Spellbook::Helper::Generate_UUID; | ||
|
||
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 @uuid = Spellbook::Helper::Generate_UUID -> new(["--version" => 4]); | ||
my $upload = $userAgent -> put("$target/$uuid[0].txt", Content => "$uuid[0]"); | ||
my $request = $userAgent -> get("$target/$uuid[0].txt"); | ||
|
||
if (($request -> code() == 200) && ($request -> content() eq "$uuid[0]")) { | ||
push @result, "$target/$uuid[0].txt\n"; | ||
} | ||
|
||
return @result; | ||
} | ||
|
||
if ($help) { | ||
return " | ||
\rRecon::Explioit | ||
\r===================== | ||
\r-h, --help See this menu | ||
\r-t, --target Define\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
2 changes: 1 addition & 1 deletion
2
lib/Spellbook/Parser/Bucket.pm → lib/Spellbook/Parser/S3_Bucket.pm
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