@@ -21,14 +21,15 @@ var reportPath string
2121
2222func main () {
2323 var requestURL , method , postData , contentType , wordlist string
24- var chunkSize int
24+ var chunkSize , timeout int
2525 flag .StringVar (& requestURL , "url" , "" , "The URL to make the request to" )
2626 flag .StringVar (& method , "method" , "GET" , "HTTP method to use" )
2727 flag .StringVar (& postData , "data" , "" , "Optional POST data" )
2828 flag .StringVar (& contentType , "type" , "form" , "Content type: form, json, xml" )
2929 flag .StringVar (& wordlist , "wordlist" , "wordlist.txt" , "Path to the wordlist file" )
3030 flag .StringVar (& reportPath , "report" , "report.json" , "Path to the output report file" )
3131 flag .IntVar (& chunkSize , "chunk-size" , 1000 , "Number of parameters to send in each request" )
32+ flag .IntVar (& timeout , "timeout" , 10 , "Request timeout in seconds" )
3233 flag .BoolVar (& ignoreCertErrors , "ignore-cert" , false , "Ignore SSL certificate errors" )
3334
3435 flag .Parse ()
@@ -45,6 +46,7 @@ func main() {
4546 Method : method ,
4647 Data : postData ,
4748 ContentType : contentType ,
49+ Timeout : timeout ,
4850 }
4951 results := DiscoverParams (request , params , chunkSize )
5052 logger .Info ("Total requests made" , "count" , totalRequests )
@@ -61,6 +63,7 @@ type Request struct {
6163 Method string `json:"method"`
6264 Data string `json:"data"`
6365 ContentType string `json:"content_type"`
66+ Timeout int `json:"timeout"`
6467}
6568
6669type Results struct {
@@ -244,7 +247,7 @@ func makeRequest(request Request, params url.Values) ResponseData {
244247 logger .Error ("Failed to create request" , "error" , err )
245248 }
246249
247- client := createHTTPClient ()
250+ client := createHTTPClient (request . Timeout )
248251 resp , err := client .Do (req )
249252 if err != nil {
250253 logger .Error ("Failed to make request" , "error" , err )
0 commit comments