Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New things! Lets go! #85

Merged
merged 19 commits into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 36 additions & 6 deletions .config/modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,9 @@
},
{
"id": "0035",
"category": "exploit",
"module": "S3_Misconfig",
"description": "Upload files into AWS S3 Buckets with weak security policies"
"category": "parser",
"module": "S3_Bucket",
"description": "Extract the path of files from a S3 Bucket with object listing"
},
{
"id": "0036",
Expand Down Expand Up @@ -238,7 +238,7 @@
"id": "0040",
"category": "exploit",
"module": "Reflected_XSS",
"description": ""
"description": "PoC"
},
{
"id": "0041",
Expand Down Expand Up @@ -268,13 +268,13 @@
"id": "0045",
"category": "recon",
"module": "Detect_Error",
"description": ""
"description": "PoC"
},
{
"id": "0046",
"category": "exploit",
"module": "DataBreach",
"description": ""
"description": "PoC"
},
{
"id": "0047",
Expand All @@ -299,6 +299,36 @@
"category": "exploit",
"module": "S3_Bucket_Takeover",
"description": "Detection possible of takeover on AWS S3 Bucket resource"
},
{
"id": "0051",
"category": "exploit",
"module": "Upload_Via_PUT",
"description": ""
},
{
"id": "0052",
"category": "exploit",
"module": "Open_Redirect",
"description": "Detect application vulnerable"
},
{
"id": "0053",
"category": "exploit",
"module": "Dependency_Confusion",
"description": ""
},
{
"id": "0054",
"category": "parser",
"module": "Nozaki",
"description": ""
},
{
"id": "0055",
"category": "advisory",
"module": "CVE_2021_41174",
"description": "Exploit for XSS vulnerability on grafana"
}
]
}
File renamed without changes.
39 changes: 39 additions & 0 deletions .github/workflows/secret-scanning.yml
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
5 changes: 2 additions & 3 deletions .perlcriticrc
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]
3 changes: 2 additions & 1 deletion cpanfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ requires "YAML::Tiny", "1.73";
requires "Masscan::Scanner";
requires "Net::DNS", "1.34";
requires "WWW::Mechanize", "2.11";
requires "Net::IP";
requires "Net::IP";
requires "UUID::Tiny", "1.04";
1 change: 1 addition & 0 deletions lib/Spellbook/Core/UserAgent.pm
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ package Spellbook::Core::UserAgent {
);

$userAgent -> default_headers -> push_header("Cache-Control" => "no-cache");
$userAgent -> max_redirect(0);

return $userAgent;
}
Expand Down
52 changes: 0 additions & 52 deletions lib/Spellbook/Exploit/S3_Misconfig.pm

This file was deleted.

43 changes: 43 additions & 0 deletions lib/Spellbook/Exploit/S3_Takeover.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package Spellbook::Exploit::S3_Bucket_Takeover {

Check failure on line 1 in lib/Spellbook/Exploit/S3_Takeover.pm

View workflow job for this annotation

GitHub Actions / critic

Package declaration must match filename at line 1, column 1. Correct the filename or package statement.
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;
46 changes: 46 additions & 0 deletions lib/Spellbook/Exploit/Upload_Via_PUT.pm
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;
8 changes: 4 additions & 4 deletions lib/Spellbook/Helper/CDN_Checker.pm
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@ package Spellbook::Helper::CDN_Checker {
my $ip = Spellbook::Recon::Get_IP -> new (["--target" => $target]);

if ($ip) {
my $cnd_list = "https://cdn.nuclei.sh";
my $cnd_list = "https://raw.githubusercontent.com/projectdiscovery/cdncheck/main/cmd/generate-index/sources_data.json";
my $useragent = Spellbook::Core::UserAgent -> new ();
my $request = $useragent -> get($cnd_list);

if ($request -> code == 200) {
my $content = decode_json($request -> content);

my $data = decode_json($request -> content);
my $content = $data -> {"cdn"};

for (keys %{$content}) {
for (@{$content -> {$_}}) {
my $range = Net::IP -> new($_);

my $value = Net::IP -> new($ip);
my $match = $range -> overlaps($value);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package Spellbook::Parser::Bucket {
package Spellbook::Parser::S3_Bucket {
use strict;
use warnings;
use XML::Simple;
Expand Down
Loading