Skip to content

Commit

Permalink
fixed a crash and some small bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
0xsha committed Sep 12, 2020
1 parent 2ecb660 commit e5a6eff
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 6 deletions.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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)
Expand Down
25 changes: 21 additions & 4 deletions internal/brute.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand All @@ -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
Expand All @@ -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 {

Expand Down Expand Up @@ -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 {

Expand Down
2 changes: 1 addition & 1 deletion internal/brute_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit e5a6eff

Please sign in to comment.