From f62806ab6182a5de4422fe10e55a8157de0dd9c7 Mon Sep 17 00:00:00 2001 From: Rodolfo Tavares <101719434+rodnt@users.noreply.github.com> Date: Wed, 3 Aug 2022 20:34:13 -0300 Subject: [PATCH 1/4] Add AWS cognito pool regex Using Cognito for authentication is quite popular nowadays, especially in mobile apps. Developers often hardcode Cognito Identity Pool which allows an unauthenticated attacker to possibly abuse the AWS services associated with that pool identity. --- scanner/secrets.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scanner/secrets.go b/scanner/secrets.go index 34ba825..c3bbfe9 100644 --- a/scanner/secrets.go +++ b/scanner/secrets.go @@ -327,6 +327,13 @@ func GetSecretRegexes() []Secret { []string{}, "?", }, + { + "AWS cognito pool", + "AWS Cognito pool", + `(us-east-1:[0-9A-Za-z]{8}-[0-9A-Za-z]{4}-[0-9A-Za-z]{4}-[0-9A-Za-z]{4}-[0-9A-Za-z]{12}|us-east-2:[0-9A-Za-z]{8}-[0-9A-Za-z]{4}-[0-9A-Za-z]{4}-[0-9A-Za-z]{4}-[0-9A-Za-z]{12}|us-west-1:[0-9A-Za-z]{8}-[0-9A-Za-z]{4}-[0-9A-Za-z]{4}-[0-9A-Za-z]{4}-[0-9A-Za-z]{12|us-west-2:[0-9A-Za-z]{8}-[0-9A-Za-z]{4}-[0-9A-Za-z]{4}-[0-9A-Za-z]{4}-[0-9A-Za-z]{12}|sa-east-1:[0-9A-Za-z]{8}-[0-9A-Za-z]{4}-[0-9A-Za-z]{4}-[0-9A-Za-z]{4}-[0-9A-Za-z]{12}|sa-east-1:[0-9A-Za-z]{8}-[0-9A-Za-z]{4}-[0-9A-Za-z]{4}-[0-9A-Za-z]{4}-[0-9A-Za-z]{12}}|sa-east-1:[0-9A-Za-z]{8}-[0-9A-Za-z]{4}-[0-9A-Za-z]{4}-[0-9A-Za-z]{4}-[0-9A-Za-z]{12})`, + []string{}, + "?", + }, { "S3 Bucket", "S3 Bucket", From 9b1a1dc869a143fa554838cde9eb0745260ccea2 Mon Sep 17 00:00:00 2001 From: edoardottt Date: Thu, 4 Aug 2022 08:53:29 +0200 Subject: [PATCH 2/4] update --- scanner/secrets.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scanner/secrets.go b/scanner/secrets.go index c3bbfe9..4a01fd8 100644 --- a/scanner/secrets.go +++ b/scanner/secrets.go @@ -330,7 +330,7 @@ func GetSecretRegexes() []Secret { { "AWS cognito pool", "AWS Cognito pool", - `(us-east-1:[0-9A-Za-z]{8}-[0-9A-Za-z]{4}-[0-9A-Za-z]{4}-[0-9A-Za-z]{4}-[0-9A-Za-z]{12}|us-east-2:[0-9A-Za-z]{8}-[0-9A-Za-z]{4}-[0-9A-Za-z]{4}-[0-9A-Za-z]{4}-[0-9A-Za-z]{12}|us-west-1:[0-9A-Za-z]{8}-[0-9A-Za-z]{4}-[0-9A-Za-z]{4}-[0-9A-Za-z]{4}-[0-9A-Za-z]{12|us-west-2:[0-9A-Za-z]{8}-[0-9A-Za-z]{4}-[0-9A-Za-z]{4}-[0-9A-Za-z]{4}-[0-9A-Za-z]{12}|sa-east-1:[0-9A-Za-z]{8}-[0-9A-Za-z]{4}-[0-9A-Za-z]{4}-[0-9A-Za-z]{4}-[0-9A-Za-z]{12}|sa-east-1:[0-9A-Za-z]{8}-[0-9A-Za-z]{4}-[0-9A-Za-z]{4}-[0-9A-Za-z]{4}-[0-9A-Za-z]{12}}|sa-east-1:[0-9A-Za-z]{8}-[0-9A-Za-z]{4}-[0-9A-Za-z]{4}-[0-9A-Za-z]{4}-[0-9A-Za-z]{12})`, + `(us-east-1|us-east-2|us-west-1|us-west-2|sa-east-1):[0-9A-Za-z]{8}-[0-9A-Za-z]{4}-[0-9A-Za-z]{4}-[0-9A-Za-z]{4}-[0-9A-Za-z]{12}`, []string{}, "?", }, From a823bb8eeb58785b422ed5cd6d4129c15b9580fa Mon Sep 17 00:00:00 2001 From: vrenzolaverace Date: Sun, 7 Aug 2022 10:40:45 +0200 Subject: [PATCH 3/4] Update secrets.go --- scanner/secrets.go | 7 ------- 1 file changed, 7 deletions(-) diff --git a/scanner/secrets.go b/scanner/secrets.go index 4a01fd8..57b4af1 100644 --- a/scanner/secrets.go +++ b/scanner/secrets.go @@ -215,13 +215,6 @@ func GetSecretRegexes() []Secret { []string{}, "?", }, - { - "Pictatic API Key", - "Pictatic API Key", - `sk\_live\_[0-9a-z]{32}`, - []string{}, - "?", - }, { "PayPal Braintree access token", "PayPal Braintree access token", From a63773fd43400e113cb41ccb09656f24bf854ed8 Mon Sep 17 00:00:00 2001 From: edoardottt Date: Thu, 18 Aug 2022 17:13:44 +0200 Subject: [PATCH 4/4] Add Custom User Agent --- README.md | 3 +++ output/examples.go | 4 +++- output/help.go | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6c754e9..07f67d9 100644 --- a/README.md +++ b/README.md @@ -151,6 +151,8 @@ Usage of cariddi: Use an external file (txt, one per line) to use custom regexes for secrets hunting. -t int Set timeout for the requests. (default 10) + -ua string + Use a Custom User Agent. -version Print the version. ``` @@ -184,6 +186,7 @@ Examples 💡 - `cat urls | cariddi -err` (Hunt for errors in websites.) - `cat urls | cariddi -info` (Hunt for useful informations in websites.) - `cat urls | cariddi -debug` (Print debug information while crawling.) + - `cat urls | cariddi -ua "Custom User Agent"` (Use a custom User Agent.) - For Windows: - use `powershell.exe -Command "cat urls | .\cariddi.exe"` inside the Command prompt diff --git a/output/examples.go b/output/examples.go index 8932f51..94c1c38 100644 --- a/output/examples.go +++ b/output/examples.go @@ -80,5 +80,7 @@ func PrintExamples() { cat urls | cariddi -info - cat urls | cariddi -debug`) + cat urls | cariddi -debug + + cat urls | cariddi -ua "Custom User Agent"`) } diff --git a/output/help.go b/output/help.go index 93a404a..98994fc 100644 --- a/output/help.go +++ b/output/help.go @@ -77,6 +77,8 @@ func PrintHelp() { Use an external file (txt, one per line) to use custom regexes for secrets hunting. -t int Set timeout for the requests. (default 10) + -ua string + Use a Custom User Agent. -version Print the version.`) }