Skip to content

Commit e5a6eff

Browse files
committed
fixed a crash and some small bugs
1 parent 2ecb660 commit e5a6eff

File tree

3 files changed

+30
-6
lines changed

3 files changed

+30
-6
lines changed

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Alibaba:
6868

6969

7070
## Usage
71-
Just download the release for your operation system and follow the usage.
71+
Just download the latest [release](https://github.com/0xsha/CloudBrute/releases) for your operation system and follow the usage.
7272

7373
Usage:
7474
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
137137
```
138138

139139

140+
## Dev
141+
- Clone the repo
142+
- go build -o CloudBrute main.go
143+
- go test internal
144+
145+
146+
140147
## in action
141148

142149
[![asciicast](https://asciinema.org/a/QIYRNgJMKhGX3woUTB3kh0HmC.svg)](https://asciinema.org/a/QIYRNgJMKhGX3woUTB3kh0HmC)

internal/brute.go

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,13 @@ func HandleHTTPRequests(reqs, results chan string, quit chan int, bar *pb.Progre
3838
Transport: socksTransport,
3939
}
4040

41-
req, _ := http.NewRequest("HEAD", "https://"+link, nil)
41+
req, err := http.NewRequest("HEAD", "https://"+link, nil)
42+
43+
if err!= nil{
44+
results <- "err"
45+
bar.Increment()
46+
continue
47+
}
4248

4349
if len(details.RandomAgent) > 0 {
4450

@@ -52,7 +58,6 @@ func HandleHTTPRequests(reqs, results chan string, quit chan int, bar *pb.Progre
5258
if err != nil {
5359

5460
log.Err(err).Msg("err")
55-
5661
results <- "err"
5762
bar.Increment()
5863
continue
@@ -76,7 +81,13 @@ func HandleHTTPRequests(reqs, results chan string, quit chan int, bar *pb.Progre
7681
},
7782
}
7883

79-
req, _ := http.NewRequest("HEAD", "http://"+link, nil)
84+
req, err := http.NewRequest("HEAD", "http://"+link, nil)
85+
86+
if err!= nil{
87+
results <- "err"
88+
bar.Increment()
89+
continue
90+
}
8091

8192
if len(details.RandomAgent) > 1 {
8293

@@ -108,7 +119,13 @@ func HandleHTTPRequests(reqs, results chan string, quit chan int, bar *pb.Progre
108119
DisableKeepAlives: true},
109120
}
110121

111-
req, _ := http.NewRequest("HEAD", "https://"+link, nil)
122+
req, err := http.NewRequest("HEAD", "https://"+link, nil)
123+
124+
if err!= nil{
125+
results <- "err"
126+
bar.Increment()
127+
continue
128+
}
112129

113130
if len(details.RandomAgent) > 0 {
114131

internal/brute_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ func TestGenerateMutatedUrls(t *testing.T) {
1010

1111
envs := []string{"test", "dev", "prod", "stage"}
1212

13-
got, err := GenerateMutatedUrls("../data/storage_small.txt", "amazon", "../config/modules/", "target", envs)
13+
got, err := GenerateMutatedUrls("../data/storage_small.txt", "storage", "amazon", "../config/modules/", "target", envs)
1414
if err != nil {
1515

1616
t.Errorf("Error generating urls %s", err)

0 commit comments

Comments
 (0)