diff --git a/README.md b/README.md index a7ab4f9..04b1dfa 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,7 @@ Alibaba: ## Usage -Just download the release for your operation system and follow the usage. +Just download the latest [release](https://github.com/0xsha/CloudBrute/releases) for your operation system and follow the usage. Usage: To make the best use of this tool, you have to understand how to configure it correctly. When you open your downloaded version, there is a config folder, and there is a config.YAML file in there. @@ -137,6 +137,13 @@ CloudBrute -d target.com -k keyword -m storage -t 80 -T 10 -w -c amazon -o targe ``` +## Dev +- Clone the repo +- go build -o CloudBrute main.go +- go test internal + + + ## in action [![asciicast](https://asciinema.org/a/QIYRNgJMKhGX3woUTB3kh0HmC.svg)](https://asciinema.org/a/QIYRNgJMKhGX3woUTB3kh0HmC) diff --git a/internal/brute.go b/internal/brute.go index cc2e69e..8640734 100644 --- a/internal/brute.go +++ b/internal/brute.go @@ -38,7 +38,13 @@ func HandleHTTPRequests(reqs, results chan string, quit chan int, bar *pb.Progre Transport: socksTransport, } - req, _ := http.NewRequest("HEAD", "https://"+link, nil) + req, err := http.NewRequest("HEAD", "https://"+link, nil) + + if err!= nil{ + results <- "err" + bar.Increment() + continue + } if len(details.RandomAgent) > 0 { @@ -52,7 +58,6 @@ func HandleHTTPRequests(reqs, results chan string, quit chan int, bar *pb.Progre if err != nil { log.Err(err).Msg("err") - results <- "err" bar.Increment() continue @@ -76,7 +81,13 @@ func HandleHTTPRequests(reqs, results chan string, quit chan int, bar *pb.Progre }, } - req, _ := http.NewRequest("HEAD", "http://"+link, nil) + req, err := http.NewRequest("HEAD", "http://"+link, nil) + + if err!= nil{ + results <- "err" + bar.Increment() + continue + } if len(details.RandomAgent) > 1 { @@ -108,7 +119,13 @@ func HandleHTTPRequests(reqs, results chan string, quit chan int, bar *pb.Progre DisableKeepAlives: true}, } - req, _ := http.NewRequest("HEAD", "https://"+link, nil) + req, err := http.NewRequest("HEAD", "https://"+link, nil) + + if err!= nil{ + results <- "err" + bar.Increment() + continue + } if len(details.RandomAgent) > 0 { diff --git a/internal/brute_test.go b/internal/brute_test.go index 24ed7ae..b404d5f 100644 --- a/internal/brute_test.go +++ b/internal/brute_test.go @@ -10,7 +10,7 @@ func TestGenerateMutatedUrls(t *testing.T) { envs := []string{"test", "dev", "prod", "stage"} - got, err := GenerateMutatedUrls("../data/storage_small.txt", "amazon", "../config/modules/", "target", envs) + got, err := GenerateMutatedUrls("../data/storage_small.txt", "storage", "amazon", "../config/modules/", "target", envs) if err != nil { t.Errorf("Error generating urls %s", err)