diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main.go | 67 |
1 files changed, 2 insertions, 65 deletions
diff --git a/src/main.go b/src/main.go index ddcd344..1ed2333 100644 --- a/src/main.go +++ b/src/main.go @@ -1,10 +1,7 @@ package main import ( - "fmt" "log" - "net/http" - "strings" ) func main() { @@ -27,44 +24,8 @@ func main() { // write the wordlist into a channel writeWordlistToChannel(wordlistChannel, wordlist) - go func() { - var i int - for { - // read a response from the printChannel for further usage - response := <-printChannel - - // define a postfix: a string attached to the end of all printed - // string set in the section filtering the status code cases - var postfix string - var prefix string - - // define what color should be used to print the individual status - // codes - var statusCode string - - switch response.StatusCode { - case 200: - - // jump to the beginning of the line, clear the line, then print - // the response - prefix = "\r\033[K" - statusCode = green(fmt.Sprintf("%d", response.StatusCode)) - postfix = "\n" - - case 404: - - // print the status code, then clear the line and jump back to - // the beginning - statusCode = red(fmt.Sprintf("%d", response.StatusCode)) - postfix = "\033[K\r" - - } - - // print the foo - fmt.Printf("%s%.7d: %s %s%s", prefix, i, statusCode, response.FuzzWord, postfix) - i++ - } - }() + // print the responses from the printChannel + go printResponses(printChannel) if threads > 1 { httpRequest(wordlistChannel, printChannel) @@ -79,27 +40,3 @@ func main() { } } - -func httpRequest(wordlistChannel chan string, printChannel chan Response) { - for { - // replace the first instance of "FUZZ" in the given url by the next - // value from the wordlistChannel - fuzzWord := <-wordlistChannel - requestURL := strings.Replace(url, "FUZZ", fuzzWord, 1) - - // make the http get request - resp, err := http.Get("https://" + requestURL) - if err != nil { - log.Println(err) - } - - // define the response - var response = Response{ - StatusCode: resp.StatusCode, - FuzzWord: fuzzWord, - } - - // insert the response into the print channel for further printing - printChannel <- response - } -} |