diff --git a/crawler/colly.go b/crawler/colly.go index 8fac2b2..7cc61cb 100644 --- a/crawler/colly.go +++ b/crawler/colly.go @@ -1,10 +1,12 @@ package crawler import ( + "net/url" "regexp" "time" "github.com/edoardottt/cariddi/input" + "github.com/edoardottt/cariddi/output" "github.com/edoardottt/cariddi/scanner" "github.com/gocolly/colly" ) @@ -72,7 +74,10 @@ func Crawler(target string, delayTime int, concurrency int, secrets bool, secret //fmt.Println("Visiting", r.URL.String()) // HERE SCAN FOR SECRETS if secrets { - huntSecrets(secretsFile, r.URL.String(), dataPost) + secretsSlice := huntSecrets(secretsFile, r.URL.String(), dataPost) + for _, elem := range secretsSlice { + output.EncapsulateCustomGreen(elem.Name, "Found in "+r.URL.String()+" "+elem.Regex+" matched!") + } } result = append(result, r.URL.String()) }) @@ -117,3 +122,9 @@ func SecretsMatch(body string) []scanner.Secret { } return secrets } + +//isLinkOkay +func isLinkOkay(input string) bool { + _, err := url.Parse(input) + return err == nil +} diff --git a/input/flags.go b/input/flags.go index 0f6e116..4a4a7ce 100644 --- a/input/flags.go +++ b/input/flags.go @@ -1,6 +1,8 @@ package input -import "flag" +import ( + "flag" +) //Input type Input struct { @@ -10,6 +12,7 @@ type Input struct { Concurrency int Help bool Examples bool + Plain bool Html string Txt string DataPost string @@ -27,6 +30,7 @@ func ScanFlag() Input { concurrencyPtr := flag.Int("c", 20, "Concurrency level (20 is default).") helpPtr := flag.Bool("h", false, "Print the version.") examplesPtr := flag.Bool("examples", false, "Print the version.") + plainPtr := flag.Bool("plain", false, "Print only the results.") outputHtmlPtr := flag.String("oh", "", "Write the output into an HTML file.") outputTxtPtr := flag.String("ot", "", "Write the output into a TXT file.") dataPostPtr := flag.String("post", "", "Set the data to perform the POST requests.") @@ -42,6 +46,7 @@ func ScanFlag() Input { *concurrencyPtr, *helpPtr, *examplesPtr, + *plainPtr, *outputHtmlPtr, *outputTxtPtr, *dataPostPtr, diff --git a/main.go b/main.go index 32c4120..bf0bd36 100644 --- a/main.go +++ b/main.go @@ -38,6 +38,10 @@ func main() { // ----------- TODO: check flags.dataPost -------------- data, _ := input.CheckDataPost(flags.DataPost) + // ----------- TODO: check ALL input ------------------- + + output.Beautify() + var finalResult []string for _, inp := range targets { var result []string