From 6b297eb2cb17bda3f1083ecf8ab09de66fd01152 Mon Sep 17 00:00:00 2001 From: Santanu Dhibar <135975635+LamonLind@users.noreply.github.com> Date: Thu, 17 Oct 2024 14:22:50 +0530 Subject: [PATCH 01/20] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1ae96dc..c2498a1 100644 --- a/README.md +++ b/README.md @@ -10,11 +10,11 @@ Install **Latest Release** - go install -v github.com/aztecrabbit/bugscanner-go@latest + go install -v github.com/LamonLind/bugscanner-go@latest **Latest Commit** - go install -v github.com/aztecrabbit/bugscanner-go@HEAD + go install -v github.com/LamonLind/bugscanner-go@HEAD #### Add go bin to PATH From 4b5c9f23ca00c36efe12ed0c809c7830aa74e45e Mon Sep 17 00:00:00 2001 From: Santanu Dhibar <135975635+LamonLind@users.noreply.github.com> Date: Thu, 17 Oct 2024 14:24:05 +0530 Subject: [PATCH 02/20] Update scan_direct.go --- cmd/scan_direct.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/scan_direct.go b/cmd/scan_direct.go index 24cda99..e75c4ef 100644 --- a/cmd/scan_direct.go +++ b/cmd/scan_direct.go @@ -120,9 +120,9 @@ func scanDirect(c *queuescanner.Ctx, p *queuescanner.QueueScannerScanParams) { case "akamaighost": resColor = colorY1 case "cloudfront": - resColor = colorC1 + resColor = colorG1 default: - resColor = colorW1 + resColor = colorG1 } if len(req.ServerList) == 1 { resColor = colorG1 From c07c28a2f0c170e75538b88c0e4b26beea507e8e Mon Sep 17 00:00:00 2001 From: Santanu Dhibar <135975635+LamonLind@users.noreply.github.com> Date: Thu, 17 Oct 2024 14:24:39 +0530 Subject: [PATCH 03/20] Update main.go --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index dd22f6e..a9453d0 100644 --- a/main.go +++ b/main.go @@ -1,6 +1,6 @@ package main -import "github.com/aztecrabbit/bugscanner-go/cmd" +import "github.com/LamonLind/bugscanner-go/cmd" func main() { cmd.Execute() From cbbe7dbde8e96100378e1f4a7450d1e3160b4bef Mon Sep 17 00:00:00 2001 From: Santanu Dhibar <135975635+LamonLind@users.noreply.github.com> Date: Thu, 17 Oct 2024 14:25:36 +0530 Subject: [PATCH 04/20] Update go.mod --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 6c94ab1..70cb73c 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/aztecrabbit/bugscanner-go +module github.com/LamonLind/bugscanner-go go 1.18 From 5ce1eb1de78914e6232320176251daaf0a64bdaa Mon Sep 17 00:00:00 2001 From: Santanu Dhibar <135975635+LamonLind@users.noreply.github.com> Date: Thu, 17 Oct 2024 14:29:40 +0530 Subject: [PATCH 05/20] Update scan_direct.go --- cmd/scan_direct.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/scan_direct.go b/cmd/scan_direct.go index e75c4ef..fb46c18 100644 --- a/cmd/scan_direct.go +++ b/cmd/scan_direct.go @@ -12,7 +12,7 @@ import ( "strings" "time" - "github.com/aztecrabbit/bugscanner-go/pkg/queuescanner" + "github.com/LamonLind/bugscanner-go/pkg/queuescanner" "github.com/fatih/color" "github.com/spf13/cobra" ) From e56de19a8bf2ff69366264d82ef95e26ababea17 Mon Sep 17 00:00:00 2001 From: Santanu Dhibar <135975635+LamonLind@users.noreply.github.com> Date: Thu, 17 Oct 2024 14:31:31 +0530 Subject: [PATCH 06/20] Update scan_direct.go --- cmd/scan_direct.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/scan_direct.go b/cmd/scan_direct.go index fb46c18..e14e680 100644 --- a/cmd/scan_direct.go +++ b/cmd/scan_direct.go @@ -120,7 +120,7 @@ func scanDirect(c *queuescanner.Ctx, p *queuescanner.QueueScannerScanParams) { case "akamaighost": resColor = colorY1 case "cloudfront": - resColor = colorG1 + resColor = colorW1 default: resColor = colorG1 } From 3c49263eccae25b63611e65802d9e1fb448c970b Mon Sep 17 00:00:00 2001 From: Santanu Dhibar <135975635+LamonLind@users.noreply.github.com> Date: Thu, 17 Oct 2024 14:43:15 +0530 Subject: [PATCH 07/20] Update scan_direct.go --- cmd/scan_direct.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/scan_direct.go b/cmd/scan_direct.go index e14e680..fb46c18 100644 --- a/cmd/scan_direct.go +++ b/cmd/scan_direct.go @@ -120,7 +120,7 @@ func scanDirect(c *queuescanner.Ctx, p *queuescanner.QueueScannerScanParams) { case "akamaighost": resColor = colorY1 case "cloudfront": - resColor = colorW1 + resColor = colorG1 default: resColor = colorG1 } From 18cf0834b05026198e2cf9ed8be96975ea3fda37 Mon Sep 17 00:00:00 2001 From: Santanu Dhibar <135975635+LamonLind@users.noreply.github.com> Date: Thu, 17 Oct 2024 18:12:09 +0530 Subject: [PATCH 08/20] Update scan_direct.go --- cmd/scan_direct.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/scan_direct.go b/cmd/scan_direct.go index fb46c18..208a0d6 100644 --- a/cmd/scan_direct.go +++ b/cmd/scan_direct.go @@ -117,8 +117,8 @@ func scanDirect(c *queuescanner.Ctx, p *queuescanner.QueueScannerScanParams) { switch hServerLower { case "cloudflare": resColor = colorG1 - case "akamaighost": - resColor = colorY1 + case "Varnish": + resColor = colorG1 case "cloudfront": resColor = colorG1 default: From 86cf85cb4f1ea03079fa5ef3cb7391f2e0b534fd Mon Sep 17 00:00:00 2001 From: Santanu Dhibar <135975635+LamonLind@users.noreply.github.com> Date: Thu, 17 Oct 2024 18:19:41 +0530 Subject: [PATCH 09/20] Update scan_direct.go --- cmd/scan_direct.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/scan_direct.go b/cmd/scan_direct.go index 208a0d6..5f38e95 100644 --- a/cmd/scan_direct.go +++ b/cmd/scan_direct.go @@ -117,7 +117,7 @@ func scanDirect(c *queuescanner.Ctx, p *queuescanner.QueueScannerScanParams) { switch hServerLower { case "cloudflare": resColor = colorG1 - case "Varnish": + case "varnish": resColor = colorG1 case "cloudfront": resColor = colorG1 From 4d07971c4d1eca5075cdda30670c9f3b7b0c88ee Mon Sep 17 00:00:00 2001 From: Santanu Dhibar <135975635+LamonLind@users.noreply.github.com> Date: Thu, 17 Oct 2024 20:14:52 +0530 Subject: [PATCH 10/20] Update scan_direct.go --- cmd/scan_direct.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmd/scan_direct.go b/cmd/scan_direct.go index 5f38e95..326a46e 100644 --- a/cmd/scan_direct.go +++ b/cmd/scan_direct.go @@ -182,6 +182,8 @@ func scanDirectRun(cmd *cobra.Command, args []string) { "cloudflare", "cloudfront", "akamaighost", + "varnish", + "sffe", } } else { serverList = strings.Split(scanDirectFlagServerListLower, ",") From a01348676c4a6892a93793db2e64a46e33ffa6da Mon Sep 17 00:00:00 2001 From: Santanu Dhibar <135975635+LamonLind@users.noreply.github.com> Date: Thu, 17 Oct 2024 20:22:31 +0530 Subject: [PATCH 11/20] Update scan_direct.go --- cmd/scan_direct.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/scan_direct.go b/cmd/scan_direct.go index 326a46e..9068432 100644 --- a/cmd/scan_direct.go +++ b/cmd/scan_direct.go @@ -117,7 +117,7 @@ func scanDirect(c *queuescanner.Ctx, p *queuescanner.QueueScannerScanParams) { switch hServerLower { case "cloudflare": resColor = colorG1 - case "varnish": + case "fastly": resColor = colorG1 case "cloudfront": resColor = colorG1 @@ -182,7 +182,7 @@ func scanDirectRun(cmd *cobra.Command, args []string) { "cloudflare", "cloudfront", "akamaighost", - "varnish", + "fastly", "sffe", } } else { From 5d0b2ae70ea1f834753e0bd00b3cd4fde32f7ef1 Mon Sep 17 00:00:00 2001 From: Santanu Dhibar <135975635+LamonLind@users.noreply.github.com> Date: Thu, 17 Oct 2024 20:23:50 +0530 Subject: [PATCH 12/20] Update scan_direct.go --- cmd/scan_direct.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/scan_direct.go b/cmd/scan_direct.go index 9068432..c375dc1 100644 --- a/cmd/scan_direct.go +++ b/cmd/scan_direct.go @@ -120,7 +120,7 @@ func scanDirect(c *queuescanner.Ctx, p *queuescanner.QueueScannerScanParams) { case "fastly": resColor = colorG1 case "cloudfront": - resColor = colorG1 + resColor = colorY1 default: resColor = colorG1 } From 64175923ec902c75690d3f6de4174f79bb0d0e62 Mon Sep 17 00:00:00 2001 From: Santanu Dhibar <135975635+LamonLind@users.noreply.github.com> Date: Thu, 17 Oct 2024 21:00:36 +0530 Subject: [PATCH 13/20] Update scan_direct.go --- cmd/scan_direct.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/scan_direct.go b/cmd/scan_direct.go index c375dc1..63a16ea 100644 --- a/cmd/scan_direct.go +++ b/cmd/scan_direct.go @@ -122,7 +122,7 @@ func scanDirect(c *queuescanner.Ctx, p *queuescanner.QueueScannerScanParams) { case "cloudfront": resColor = colorY1 default: - resColor = colorG1 + resColor = colorW1 } if len(req.ServerList) == 1 { resColor = colorG1 From c2eb9b7a6abaee9e483f5bf74b99cce5e0041f9e Mon Sep 17 00:00:00 2001 From: Santanu Dhibar <135975635+LamonLind@users.noreply.github.com> Date: Thu, 17 Oct 2024 21:04:28 +0530 Subject: [PATCH 14/20] Update scan_direct.go --- cmd/scan_direct.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmd/scan_direct.go b/cmd/scan_direct.go index 63a16ea..d8b9b65 100644 --- a/cmd/scan_direct.go +++ b/cmd/scan_direct.go @@ -184,6 +184,9 @@ func scanDirectRun(cmd *cobra.Command, args []string) { "akamaighost", "fastly", "sffe", + "varnish", + "google*", + "volt-adc", } } else { serverList = strings.Split(scanDirectFlagServerListLower, ",") From b407103dd6e7f9581ef1b1a7325e1bd4c89f19ce Mon Sep 17 00:00:00 2001 From: Santanu Dhibar <135975635+LamonLind@users.noreply.github.com> Date: Thu, 17 Oct 2024 21:11:35 +0530 Subject: [PATCH 15/20] Update scan_direct.go --- cmd/scan_direct.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/scan_direct.go b/cmd/scan_direct.go index d8b9b65..4ad13af 100644 --- a/cmd/scan_direct.go +++ b/cmd/scan_direct.go @@ -185,6 +185,7 @@ func scanDirectRun(cmd *cobra.Command, args []string) { "fastly", "sffe", "varnish", + "Varnish", "google*", "volt-adc", } From ee3b05571425c387188dbfd574842c7c9a7cb358 Mon Sep 17 00:00:00 2001 From: Santanu Dhibar <135975635+LamonLind@users.noreply.github.com> Date: Thu, 17 Oct 2024 21:12:56 +0530 Subject: [PATCH 16/20] Update scan_direct.go --- cmd/scan_direct.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/scan_direct.go b/cmd/scan_direct.go index 4ad13af..a386f2d 100644 --- a/cmd/scan_direct.go +++ b/cmd/scan_direct.go @@ -182,7 +182,7 @@ func scanDirectRun(cmd *cobra.Command, args []string) { "cloudflare", "cloudfront", "akamaighost", - "fastly", + "varnish", "sffe", "varnish", "Varnish", From 3b3276ea686a0e7684de515d62b9ea45eeebaf34 Mon Sep 17 00:00:00 2001 From: Santanu Dhibar <135975635+LamonLind@users.noreply.github.com> Date: Thu, 17 Oct 2024 21:17:54 +0530 Subject: [PATCH 17/20] Update scan_direct.go --- cmd/scan_direct.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/scan_direct.go b/cmd/scan_direct.go index a386f2d..b503f10 100644 --- a/cmd/scan_direct.go +++ b/cmd/scan_direct.go @@ -117,7 +117,7 @@ func scanDirect(c *queuescanner.Ctx, p *queuescanner.QueueScannerScanParams) { switch hServerLower { case "cloudflare": resColor = colorG1 - case "fastly": + case "varnish": resColor = colorG1 case "cloudfront": resColor = colorY1 @@ -184,9 +184,9 @@ func scanDirectRun(cmd *cobra.Command, args []string) { "akamaighost", "varnish", "sffe", - "varnish", + "aws", "Varnish", - "google*", + "google", "volt-adc", } } else { From 0fe4427cc4fe7ce96d9affe99835f95ecbdd2a2f Mon Sep 17 00:00:00 2001 From: Santanu Dhibar <135975635+LamonLind@users.noreply.github.com> Date: Thu, 24 Oct 2024 15:17:07 +0530 Subject: [PATCH 18/20] Update scan_direct.go --- cmd/scan_direct.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmd/scan_direct.go b/cmd/scan_direct.go index b503f10..235724c 100644 --- a/cmd/scan_direct.go +++ b/cmd/scan_direct.go @@ -188,6 +188,9 @@ func scanDirectRun(cmd *cobra.Command, args []string) { "Varnish", "google", "volt-adc", + "BunnyCDN-IN1-1196", + "BunnyCDN-PER1-1139", + "BunnyCDN", } } else { serverList = strings.Split(scanDirectFlagServerListLower, ",") From d0618ea9766cf34013509a34e49f1e37f0efe896 Mon Sep 17 00:00:00 2001 From: Santanu Dhibar <135975635+LamonLind@users.noreply.github.com> Date: Fri, 13 Dec 2024 13:44:49 +0530 Subject: [PATCH 19/20] Update scan_direct.go --- cmd/scan_direct.go | 81 +++++++++++++++------------------------------- 1 file changed, 26 insertions(+), 55 deletions(-) diff --git a/cmd/scan_direct.go b/cmd/scan_direct.go index 235724c..4aaf06d 100644 --- a/cmd/scan_direct.go +++ b/cmd/scan_direct.go @@ -12,7 +12,7 @@ import ( "strings" "time" - "github.com/LamonLind/bugscanner-go/pkg/queuescanner" + "github.com/Ayanrajpoot10/bughunter-go/pkg/queuescanner" "github.com/fatih/color" "github.com/spf13/cobra" ) @@ -105,11 +105,17 @@ func scanDirect(c *queuescanner.Ctx, p *queuescanner.QueueScannerScanParams) { hCfRay := httpRes.Header.Get("CF-RAY") hLocation := httpRes.Header.Get("Location") + // Skip hosts redirecting to "https://jio.com/BalanceExhaust" + if hLocation == "https://jio.com/BalanceExhaust" { + return + } + resColor := color.New() isHiddenCloudflare := slices.Contains(req.ServerList, "cloudflare") && hCfRay != "" && hServerLower != "cloudflare" - if slices.Contains(req.ServerList, hServerLower) || isHiddenCloudflare { + // Save results for all servers, not just Cloudflare + if slices.Contains(req.ServerList, hServerLower) || isHiddenCloudflare || len(req.ServerList) == 1 { if isHiddenCloudflare { resColor = colorG1 hServer = fmt.Sprintf("%s (cf)", hServer) @@ -117,10 +123,10 @@ func scanDirect(c *queuescanner.Ctx, p *queuescanner.QueueScannerScanParams) { switch hServerLower { case "cloudflare": resColor = colorG1 - case "varnish": - resColor = colorG1 - case "cloudfront": + case "akamaighost": resColor = colorY1 + case "cloudfront": + resColor = colorC1 default: resColor = colorW1 } @@ -155,6 +161,21 @@ func scanDirect(c *queuescanner.Ctx, p *queuescanner.QueueScannerScanParams) { s = resColor.Sprint(s) c.Log(s) + + // Write the log entry to the file in real-time + if scanDirectFlagOutput != "" { + file, err := os.OpenFile(scanDirectFlagOutput, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644) + if err != nil { + fmt.Println(err.Error()) + return + } + defer file.Close() + + _, err = file.WriteString(s + "\n") + if err != nil { + fmt.Println(err.Error()) + } + } } func scanDirectRun(cmd *cobra.Command, args []string) { @@ -182,15 +203,6 @@ func scanDirectRun(cmd *cobra.Command, args []string) { "cloudflare", "cloudfront", "akamaighost", - "varnish", - "sffe", - "aws", - "Varnish", - "google", - "volt-adc", - "BunnyCDN-IN1-1196", - "BunnyCDN-PER1-1139", - "BunnyCDN", } } else { serverList = strings.Split(scanDirectFlagServerListLower, ",") @@ -227,9 +239,6 @@ func scanDirectRun(cmd *cobra.Command, args []string) { mapServerList[res.Server] = append(mapServerList[res.Server], res) } - domainList := make([]string, 0) - ipList := make([]string, 0) - for server, resList := range mapServerList { if len(resList) == 0 { continue @@ -237,51 +246,13 @@ func scanDirectRun(cmd *cobra.Command, args []string) { var resColor *color.Color - mapIPList := make(map[string]bool) - mapDomainList := make(map[string]bool) - for _, res := range resList { if resColor == nil { resColor = res.Color } - - for _, netIP := range res.NetIPList { - ip := netIP.String() - mapIPList[ip] = true - } - - mapDomainList[res.Request.Domain] = true } c.Log(resColor.Sprintf("\n%s\n", server)) - - domainList = append(domainList, fmt.Sprintf("# %s", server)) - for doamin := range mapDomainList { - domainList = append(domainList, doamin) - c.Log(resColor.Sprint(doamin)) - } - domainList = append(domainList, "") - c.Log("") - - ipList = append(ipList, fmt.Sprintf("# %s", server)) - for ip := range mapIPList { - ipList = append(ipList, ip) - c.Log(resColor.Sprint(ip)) - } - ipList = append(ipList, "") - c.Log("") - } - - outputList := make([]string, 0) - outputList = append(outputList, domainList...) - outputList = append(outputList, ipList...) - - if scanDirectFlagOutput != "" { - err := os.WriteFile(scanDirectFlagOutput, []byte(strings.Join(outputList, "\n")), 0644) - if err != nil { - fmt.Println(err.Error()) - os.Exit(1) - } } }) } From 842b95cd6642f21aefeac678812e320d2b79515b Mon Sep 17 00:00:00 2001 From: Santanu Dhibar <135975635+LamonLind@users.noreply.github.com> Date: Fri, 13 Dec 2024 13:47:17 +0530 Subject: [PATCH 20/20] Update scan_direct.go --- cmd/scan_direct.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/scan_direct.go b/cmd/scan_direct.go index 4aaf06d..04871e4 100644 --- a/cmd/scan_direct.go +++ b/cmd/scan_direct.go @@ -12,7 +12,7 @@ import ( "strings" "time" - "github.com/Ayanrajpoot10/bughunter-go/pkg/queuescanner" + "github.com/Lamonlind/bugscanner-go/pkg/queuescanner" "github.com/fatih/color" "github.com/spf13/cobra" )