This commit is contained in:
edoardottt
2021-05-15 18:35:51 +02:00
parent e544f8c276
commit ab6aef7efa
3 changed files with 22 additions and 2 deletions
+12 -1
View File
@@ -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
}
+6 -1
View File
@@ -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,
+4
View File
@@ -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