diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index bc3b86c..135e75c 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -24,7 +24,7 @@ jobs: uses: golangci/golangci-lint-action@v3 with: # Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version - version: v1.29 + version: v1.49 # Optional: working directory, useful for monorepos # working-directory: somedir diff --git a/crawler/colly.go b/crawler/colly.go index 609f366..4554b79 100644 --- a/crawler/colly.go +++ b/crawler/colly.go @@ -27,10 +27,10 @@ along with this program. If not, see http://www.gnu.org/licenses/. package crawler import ( - "crypto/tls" + "crypto/tls" "fmt" "log" - "net/http" + "net/http" "os" "regexp" "strings" @@ -112,22 +112,22 @@ func Crawler(target string, txt string, html string, delayTime int, concurrency c.OnHTML("a[href]", func(e *colly.HTMLElement) { link := e.Attr("href") if len(link) != 0 && link[0] != '#' { - absoluteUrl := utils.AbsoluteURL(protocolTemp, targetTemp, e.Request.AbsoluteURL(link)) + absoluteURL := utils.AbsoluteURL(protocolTemp, targetTemp, e.Request.AbsoluteURL(link)) // Visit link found on page // Only those links are visited which are in AllowedDomains - if (!intensive && utils.SameDomain(protocolTemp+"://"+target, absoluteUrl)) || - (intensive && intensiveOk(targetTemp, absoluteUrl)) { + if (!intensive && utils.SameDomain(protocolTemp+"://"+target, absoluteURL)) || + (intensive && intensiveOk(targetTemp, absoluteURL)) { if ignoreBool { if !IgnoreMatch(link, ignoreSlice) { - FinalResults = append(FinalResults, absoluteUrl) - err := c.Visit(absoluteUrl) + FinalResults = append(FinalResults, absoluteURL) + err := c.Visit(absoluteURL) if err != nil && debug && err != colly.ErrAlreadyVisited { log.Println(err) } } } else { - FinalResults = append(FinalResults, absoluteUrl) - err := c.Visit(absoluteUrl) + FinalResults = append(FinalResults, absoluteURL) + err := c.Visit(absoluteURL) if err != nil && debug && err != colly.ErrAlreadyVisited { log.Println(err) } @@ -140,22 +140,22 @@ func Crawler(target string, txt string, html string, delayTime int, concurrency c.OnHTML("script[src]", func(e *colly.HTMLElement) { link := e.Attr("src") if len(link) != 0 { - absoluteUrl := utils.AbsoluteURL(protocolTemp, targetTemp, e.Request.AbsoluteURL(link)) + absoluteURL := utils.AbsoluteURL(protocolTemp, targetTemp, e.Request.AbsoluteURL(link)) // Visit link found on page // Only those links are visited which are in AllowedDomains - if (!intensive && utils.SameDomain(protocolTemp+"://"+target, absoluteUrl)) || - (intensive && intensiveOk(targetTemp, absoluteUrl)) { + if (!intensive && utils.SameDomain(protocolTemp+"://"+target, absoluteURL)) || + (intensive && intensiveOk(targetTemp, absoluteURL)) { if ignoreBool { if !IgnoreMatch(link, ignoreSlice) { - FinalResults = append(FinalResults, absoluteUrl) - err := c.Visit(absoluteUrl) + FinalResults = append(FinalResults, absoluteURL) + err := c.Visit(absoluteURL) if err != nil && debug && err != colly.ErrAlreadyVisited { log.Println(err) } } } else { - FinalResults = append(FinalResults, absoluteUrl) - err := c.Visit(absoluteUrl) + FinalResults = append(FinalResults, absoluteURL) + err := c.Visit(absoluteURL) if err != nil && debug && err != colly.ErrAlreadyVisited { log.Println(err) } @@ -168,22 +168,22 @@ func Crawler(target string, txt string, html string, delayTime int, concurrency c.OnHTML("link[href]", func(e *colly.HTMLElement) { link := e.Attr("href") if len(link) != 0 { - absoluteUrl := utils.AbsoluteURL(protocolTemp, targetTemp, e.Request.AbsoluteURL(link)) + absoluteURL := utils.AbsoluteURL(protocolTemp, targetTemp, e.Request.AbsoluteURL(link)) // Visit link found on page // Only those links are visited which are in AllowedDomains - if (!intensive && utils.SameDomain(protocolTemp+"://"+target, absoluteUrl)) || - (intensive && intensiveOk(targetTemp, absoluteUrl)) { + if (!intensive && utils.SameDomain(protocolTemp+"://"+target, absoluteURL)) || + (intensive && intensiveOk(targetTemp, absoluteURL)) { if ignoreBool { if !IgnoreMatch(link, ignoreSlice) { - FinalResults = append(FinalResults, absoluteUrl) - err := c.Visit(absoluteUrl) + FinalResults = append(FinalResults, absoluteURL) + err := c.Visit(absoluteURL) if err != nil && debug && err != colly.ErrAlreadyVisited { log.Println(err) } } } else { - FinalResults = append(FinalResults, absoluteUrl) - err := c.Visit(absoluteUrl) + FinalResults = append(FinalResults, absoluteURL) + err := c.Visit(absoluteURL) if err != nil && debug && err != colly.ErrAlreadyVisited { log.Println(err) } @@ -196,22 +196,22 @@ func Crawler(target string, txt string, html string, delayTime int, concurrency c.OnHTML("iframe[src]", func(e *colly.HTMLElement) { link := e.Attr("src") if len(link) != 0 { - absoluteUrl := utils.AbsoluteURL(protocolTemp, targetTemp, e.Request.AbsoluteURL(link)) + absoluteURL := utils.AbsoluteURL(protocolTemp, targetTemp, e.Request.AbsoluteURL(link)) // Visit link found on page // Only those links are visited which are in AllowedDomains - if (!intensive && utils.SameDomain(protocolTemp+"://"+target, absoluteUrl)) || - (intensive && intensiveOk(targetTemp, absoluteUrl)) { + if (!intensive && utils.SameDomain(protocolTemp+"://"+target, absoluteURL)) || + (intensive && intensiveOk(targetTemp, absoluteURL)) { if ignoreBool { if !IgnoreMatch(link, ignoreSlice) { - FinalResults = append(FinalResults, absoluteUrl) - err := c.Visit(absoluteUrl) + FinalResults = append(FinalResults, absoluteURL) + err := c.Visit(absoluteURL) if err != nil && debug && err != colly.ErrAlreadyVisited { log.Println(err) } } } else { - FinalResults = append(FinalResults, absoluteUrl) - err := c.Visit(absoluteUrl) + FinalResults = append(FinalResults, absoluteURL) + err := c.Visit(absoluteURL) if err != nil && debug && err != colly.ErrAlreadyVisited { log.Println(err) } @@ -224,22 +224,22 @@ func Crawler(target string, txt string, html string, delayTime int, concurrency c.OnHTML("form[action]", func(e *colly.HTMLElement) { link := e.Attr("action") if len(link) != 0 { - absoluteUrl := utils.AbsoluteURL(protocolTemp, targetTemp, e.Request.AbsoluteURL(link)) + absoluteURL := utils.AbsoluteURL(protocolTemp, targetTemp, e.Request.AbsoluteURL(link)) // Visit link found on page // Only those links are visited which are in AllowedDomains - if (!intensive && utils.SameDomain(protocolTemp+"://"+target, absoluteUrl)) || - (intensive && intensiveOk(targetTemp, absoluteUrl)) { + if (!intensive && utils.SameDomain(protocolTemp+"://"+target, absoluteURL)) || + (intensive && intensiveOk(targetTemp, absoluteURL)) { if ignoreBool { if !IgnoreMatch(link, ignoreSlice) { - FinalResults = append(FinalResults, absoluteUrl) - err := c.Visit(absoluteUrl) + FinalResults = append(FinalResults, absoluteURL) + err := c.Visit(absoluteURL) if err != nil && debug && err != colly.ErrAlreadyVisited { log.Println(err) } } } else { - FinalResults = append(FinalResults, absoluteUrl) - err := c.Visit(absoluteUrl) + FinalResults = append(FinalResults, absoluteURL) + err := c.Visit(absoluteURL) if err != nil && debug && err != colly.ErrAlreadyVisited { log.Println(err) } @@ -252,22 +252,22 @@ func Crawler(target string, txt string, html string, delayTime int, concurrency c.OnXML("//urlset/url/loc", func(e *colly.XMLElement) { link := e.Text if len(link) != 0 { - absoluteUrl := utils.AbsoluteURL(protocolTemp, targetTemp, e.Request.AbsoluteURL(link)) + absoluteURL := utils.AbsoluteURL(protocolTemp, targetTemp, e.Request.AbsoluteURL(link)) // Visit link found on page // Only those links are visited which are in AllowedDomains - if (!intensive && utils.SameDomain(protocolTemp+"://"+target, absoluteUrl)) || - (intensive && intensiveOk(targetTemp, absoluteUrl)) { + if (!intensive && utils.SameDomain(protocolTemp+"://"+target, absoluteURL)) || + (intensive && intensiveOk(targetTemp, absoluteURL)) { if ignoreBool { if !IgnoreMatch(link, ignoreSlice) { - FinalResults = append(FinalResults, absoluteUrl) - err := c.Visit(absoluteUrl) + FinalResults = append(FinalResults, absoluteURL) + err := c.Visit(absoluteURL) if err != nil && debug && err != colly.ErrAlreadyVisited { log.Println(err) } } } else { - FinalResults = append(FinalResults, absoluteUrl) - err := c.Visit(absoluteUrl) + FinalResults = append(FinalResults, absoluteURL) + err := c.Visit(absoluteURL) if err != nil && debug && err != colly.ErrAlreadyVisited { log.Println(err) } @@ -310,7 +310,7 @@ func Crawler(target string, txt string, html string, delayTime int, concurrency // HERE SCAN FOR EXTENSIONS if 1 <= fileType && fileType <= 7 { extension := huntExtensions(r.Request.URL.String(), fileType) - if extension.Url != "" { + if extension.URL != "" { FinalExtensions = append(FinalExtensions, extension) } } @@ -414,11 +414,11 @@ func CreateColly(delayTime int, concurrency int, cache bool, timeout int, } } - if insecure { - c.WithTransport(&http.Transport{ - TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, - }) - } + if insecure { + c.WithTransport(&http.Transport{ + TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, + }) + } return c } @@ -446,7 +446,7 @@ func SecretsMatch(url string, body string, secretsFile []string) []scanner.Secre } } if !isFalsePositive { - secretFound := scanner.SecretMatched{Secret: secret, Url: url, Match: match[0]} + secretFound := scanner.SecretMatched{Secret: secret, URL: url, Match: match[0]} secrets = append(secrets, secretFound) } } @@ -457,7 +457,7 @@ func SecretsMatch(url string, body string, secretsFile []string) []scanner.Secre re := regexp.MustCompile(secret) match := re.FindStringSubmatch(body) secretScanned := scanner.Secret{Name: "CustomFromFile", Description: "", Regex: secret, Poc: ""} - secretFound := scanner.SecretMatched{Secret: secretScanned, Url: url, Match: match[0]} + secretFound := scanner.SecretMatched{Secret: secretScanned, URL: url, Match: match[0]} secrets = append(secrets, secretFound) } } @@ -482,7 +482,7 @@ func EndpointsMatch(target string, endpointsFile []string) []scanner.EndpointMat if strings.ToLower(param) == parameter.Parameter { matched = append(matched, parameter) } - endpoints = append(endpoints, scanner.EndpointMatched{Parameters: matched, Url: target}) + endpoints = append(endpoints, scanner.EndpointMatched{Parameters: matched, URL: target}) } } } else { @@ -492,7 +492,7 @@ func EndpointsMatch(target string, endpointsFile []string) []scanner.EndpointMat if param == parameter { matched = append(matched, scanner.Parameter{Parameter: parameter, Attacks: []string{}}) } - endpoints = append(endpoints, scanner.EndpointMatched{Parameters: matched, Url: target}) + endpoints = append(endpoints, scanner.EndpointMatched{Parameters: matched, URL: target}) } } } @@ -511,7 +511,7 @@ func huntExtensions(target string, severity int) scanner.FileTypeMatched { } i := strings.LastIndex(target, ".") if i >= 0 && strings.ToLower(target[i:]) == "."+ext.Extension { - extension = scanner.FileTypeMatched{Filetype: ext, Url: copyTarget} + extension = scanner.FileTypeMatched{Filetype: ext, URL: copyTarget} } } } @@ -532,7 +532,7 @@ func ErrorsMatch(url string, body string) []scanner.ErrorMatched { if matched, err := regexp.Match(errorRegex, []byte(body)); err == nil && matched { re := regexp.MustCompile(errorRegex) match := re.FindStringSubmatch(body) - errorFound := scanner.ErrorMatched{Error: errorItem, Url: url, Match: match[0]} + errorFound := scanner.ErrorMatched{Error: errorItem, URL: url, Match: match[0]} errors = append(errors, errorFound) } } @@ -554,7 +554,7 @@ func InfoMatch(url string, body string) []scanner.InfoMatched { if matched, err := regexp.Match(infoRegex, []byte(body)); err == nil && matched { re := regexp.MustCompile(infoRegex) match := re.FindStringSubmatch(body) - infoFound := scanner.InfoMatched{Info: infoItem, Url: url, Match: match[0]} + infoFound := scanner.InfoMatched{Info: infoItem, URL: url, Match: match[0]} infos = append(infos, infoFound) } } diff --git a/input/check.go b/input/check.go index 5ed1973..0721430 100644 --- a/input/check.go +++ b/input/check.go @@ -57,15 +57,15 @@ func CheckOutputFile(input string) bool { //CheckFlags checks the flags taken as input func CheckFlags(flags Input) { - if flags.Txt != "" { - if !CheckOutputFile(flags.Txt) { + if flags.TXT != "" { + if !CheckOutputFile(flags.TXT) { fmt.Println("The output file must avoid weird symbols. Try to use - , _ , . instead.") os.Exit(1) } } - if flags.Html != "" { - if !CheckOutputFile(flags.Html) { + if flags.HTML != "" { + if !CheckOutputFile(flags.HTML) { fmt.Println("The output file must avoid weird symbols. Try to use - , _ , . instead.") os.Exit(1) } @@ -94,7 +94,7 @@ func CheckFlags(flags Input) { } } - if flags.Plain && flags.Txt == "" && flags.Html == "" { + if flags.Plain && flags.TXT == "" && flags.HTML == "" { if flags.Secrets || flags.Endpoints || flags.Extensions != 0 { fmt.Println("In the plain mode cariddi prints only links found on targets.") fmt.Println("If you want to see the results of secrets, endpoints and extensions found") @@ -111,8 +111,8 @@ func CheckFlags(flags Input) { os.Exit(1) } - if flags.IgnoreTxt != "" { - _ = utils.ReadFile(flags.IgnoreTxt) + if flags.IgnoreTXT != "" { + _ = utils.ReadFile(flags.IgnoreTXT) } if flags.Timeout < 0 { @@ -120,7 +120,7 @@ func CheckFlags(flags Input) { os.Exit(1) } - if flags.Ignore != "" && flags.IgnoreTxt != "" { + if flags.Ignore != "" && flags.IgnoreTXT != "" { fmt.Println("You should use only one among -i and -it.") fmt.Println("Examples:") fmt.Println(" - cat urls | cariddi -i forum,blog") diff --git a/input/flags.go b/input/flags.go index 65cb55b..3fc6e65 100644 --- a/input/flags.go +++ b/input/flags.go @@ -39,10 +39,10 @@ type Input struct { Help bool Examples bool Plain bool - Html string - Txt string + HTML string + TXT string Ignore string - IgnoreTxt string + IgnoreTXT string Cache bool Timeout int Intensive bool @@ -73,10 +73,10 @@ func ScanFlag() Input { helpPtr := flag.Bool("h", false, "Print the help.") examplesPtr := flag.Bool("examples", false, "Print the examples.") 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.") + outputHTMLPtr := flag.String("oh", "", "Write the output into an HTML file.") + outputTXTPtr := flag.String("ot", "", "Write the output into a TXT file.") ignorePtr := flag.String("i", "", "Ignore the URL containing at least one of the elements of this array.") - ignoreTxtPtr := flag.String("it", "", "Ignore the URL containing at least one of the lines of this file.") + ignoreTXTPtr := flag.String("it", "", "Ignore the URL containing at least one of the lines of this file.") cachePtr := flag.Bool("cache", false, "Use the .cariddi_cache folder as cache.") timeoutPtr := flag.Int("t", 10, "Set timeout for the requests.") intensivePtr := flag.Bool("intensive", false, "Crawl searching for resources matching 2nd level domain.") @@ -112,10 +112,10 @@ func ScanFlag() Input { *helpPtr, *examplesPtr, *plainPtr, - *outputHtmlPtr, - *outputTxtPtr, + *outputHTMLPtr, + *outputTXTPtr, *ignorePtr, - *ignoreTxtPtr, + *ignoreTXTPtr, *cachePtr, *timeoutPtr, *intensivePtr, diff --git a/output/output.go b/output/output.go index d399c05..b57cc9a 100644 --- a/output/output.go +++ b/output/output.go @@ -58,22 +58,22 @@ func TxtOutput(flags input.Input, finalResults []string, finalSecret []scanner.S utils.CreateOutputFolder() } - ResultFilename := utils.CreateOutputFile(flags.Txt, "results", "txt") + ResultFilename := utils.CreateOutputFile(flags.TXT, "results", "txt") for _, elem := range finalResults { AppendOutputToTxt(elem, ResultFilename) } // if secrets flag enabled save also secrets if flags.Secrets { - SecretFilename := utils.CreateOutputFile(flags.Txt, "secrets", "txt") + SecretFilename := utils.CreateOutputFile(flags.TXT, "secrets", "txt") for _, elem := range finalSecret { - AppendOutputToTxt(elem.Secret.Name+" - "+elem.Match+" in "+elem.Url, SecretFilename) + AppendOutputToTxt(elem.Secret.Name+" - "+elem.Match+" in "+elem.URL, SecretFilename) } } // if endpoints flag enabled save also endpoints if flags.Endpoints { - EndpointFilename := utils.CreateOutputFile(flags.Txt, "endpoints", "txt") + EndpointFilename := utils.CreateOutputFile(flags.TXT, "endpoints", "txt") for _, elem := range finalEndpoints { for _, parameter := range elem.Parameters { finalString := "" @@ -84,32 +84,32 @@ func TxtOutput(flags input.Input, finalResults []string, finalSecret []scanner.S finalString += " " + attack } } - AppendOutputToTxt(finalString+" in "+elem.Url, EndpointFilename) + AppendOutputToTxt(finalString+" in "+elem.URL, EndpointFilename) } } } // if extensions flag enabled save also secrets if 1 <= flags.Extensions && flags.Extensions <= 7 { - ExtensionsFilename := utils.CreateOutputFile(flags.Txt, "extensions", "txt") + ExtensionsFilename := utils.CreateOutputFile(flags.TXT, "extensions", "txt") for _, elem := range finalExtensions { - AppendOutputToTxt(elem.Filetype.Extension+" in "+elem.Url, ExtensionsFilename) + AppendOutputToTxt(elem.Filetype.Extension+" in "+elem.URL, ExtensionsFilename) } } // if errors flag enabled save also errors if flags.Errors { - ErrorsFilename := utils.CreateOutputFile(flags.Txt, "errors", "txt") + ErrorsFilename := utils.CreateOutputFile(flags.TXT, "errors", "txt") for _, elem := range finalErrors { - AppendOutputToTxt(elem.Error.ErrorName+" - "+elem.Match+" in "+elem.Url, ErrorsFilename) + AppendOutputToTxt(elem.Error.ErrorName+" - "+elem.Match+" in "+elem.URL, ErrorsFilename) } } // if info flag enabled save also infos if flags.Info { - InfosFilename := utils.CreateOutputFile(flags.Txt, "info", "txt") + InfosFilename := utils.CreateOutputFile(flags.TXT, "info", "txt") for _, elem := range finalInfos { - AppendOutputToTxt(elem.Info.Name+" - "+elem.Match+" in "+elem.Url, InfosFilename) + AppendOutputToTxt(elem.Info.Name+" - "+elem.Match+" in "+elem.URL, InfosFilename) } } @@ -141,7 +141,7 @@ func HtmlOutput(flags input.Input, ResultFilename string, finalResults []string, if flags.Secrets { HeaderHTML("Secrets found", ResultFilename) for _, elem := range finalSecret { - AppendOutputToHTML(elem.Secret.Name+" - "+elem.Match+" in "+elem.Url, "", ResultFilename, false) + AppendOutputToHTML(elem.Secret.Name+" - "+elem.Match+" in "+elem.URL, "", ResultFilename, false) } FooterHTML(ResultFilename) } @@ -159,7 +159,7 @@ func HtmlOutput(flags input.Input, ResultFilename string, finalResults []string, finalString += " " + attack } } - AppendOutputToHTML(finalString+" in "+elem.Url, "", ResultFilename, false) + AppendOutputToHTML(finalString+" in "+elem.URL, "", ResultFilename, false) } } FooterHTML(ResultFilename) @@ -169,7 +169,7 @@ func HtmlOutput(flags input.Input, ResultFilename string, finalResults []string, if 1 <= flags.Extensions && flags.Extensions <= 7 { HeaderHTML("Extensions found", ResultFilename) for _, elem := range finalExtensions { - AppendOutputToHTML(elem.Filetype.Extension+" in "+elem.Url, "", ResultFilename, false) + AppendOutputToHTML(elem.Filetype.Extension+" in "+elem.URL, "", ResultFilename, false) } FooterHTML(ResultFilename) } @@ -178,7 +178,7 @@ func HtmlOutput(flags input.Input, ResultFilename string, finalResults []string, if flags.Errors { HeaderHTML("Errors found", ResultFilename) for _, elem := range finalErrors { - AppendOutputToHTML(elem.Error.ErrorName+" - "+elem.Match+" in "+elem.Url, "", ResultFilename, false) + AppendOutputToHTML(elem.Error.ErrorName+" - "+elem.Match+" in "+elem.URL, "", ResultFilename, false) } FooterHTML(ResultFilename) } @@ -190,7 +190,7 @@ func HtmlOutput(flags input.Input, ResultFilename string, finalResults []string, // Escape HTML comment to be shown on the result page AppendOutputToHTML(elem.Info.Name+" - "+ strings.Replace(strings.Replace(elem.Match, "<", "<", 10), ">", ">", 10)+ - " in "+elem.Url, "", ResultFilename, false) + " in "+elem.URL, "", ResultFilename, false) } FooterHTML(ResultFilename) } diff --git a/scanner/endpoints.go b/scanner/endpoints.go index 9cb75b9..25abd77 100644 --- a/scanner/endpoints.go +++ b/scanner/endpoints.go @@ -39,7 +39,7 @@ type Parameter struct { // Url = url (aka endpoint) type EndpointMatched struct { Parameters []Parameter - Url string + URL string } //GetJuicyParameters returns juicy parameters and their possible attacks @@ -190,8 +190,8 @@ func RemovDuplicateEndpoints(input []EndpointMatched) []EndpointMatched { keys := make(map[string]bool) list := []EndpointMatched{} for _, entry := range input { - if _, value := keys[entry.Url]; !value { - keys[entry.Url] = true + if _, value := keys[entry.URL]; !value { + keys[entry.URL] = true list = append(list, entry) } } diff --git a/scanner/errors.go b/scanner/errors.go index 812d49a..002c0ba 100644 --- a/scanner/errors.go +++ b/scanner/errors.go @@ -37,7 +37,7 @@ type Error struct { // Match = the string matching the regex type ErrorMatched struct { Error Error - Url string + URL string Match string } @@ -153,8 +153,8 @@ func RemoveDuplicateErrors(input []ErrorMatched) []ErrorMatched { keys := make(map[string]bool) list := []ErrorMatched{} for _, entry := range input { - if _, value := keys[entry.Match+entry.Url]; !value { - keys[entry.Match+entry.Url] = true + if _, value := keys[entry.Match+entry.URL]; !value { + keys[entry.Match+entry.URL] = true list = append(list, entry) } } diff --git a/scanner/extensions.go b/scanner/extensions.go index bb0aa1d..60ec193 100644 --- a/scanner/extensions.go +++ b/scanner/extensions.go @@ -39,7 +39,7 @@ type FileType struct { // Url = url of the file found type FileTypeMatched struct { Filetype FileType - Url string + URL string } //GetExtensions returns all the extension structs @@ -116,8 +116,8 @@ func RemoveDuplicateExtensions(input []FileTypeMatched) []FileTypeMatched { keys := make(map[string]bool) list := []FileTypeMatched{} for _, entry := range input { - if _, value := keys[entry.Url]; !value { - keys[entry.Url] = true + if _, value := keys[entry.URL]; !value { + keys[entry.URL] = true list = append(list, entry) } } diff --git a/scanner/info.go b/scanner/info.go index 6259800..3503097 100644 --- a/scanner/info.go +++ b/scanner/info.go @@ -37,7 +37,7 @@ type Info struct { // Match = the string matching the regex type InfoMatched struct { Info Info - Url string + URL string Match string } diff --git a/scanner/secrets.go b/scanner/secrets.go index 57b4af1..4128faf 100644 --- a/scanner/secrets.go +++ b/scanner/secrets.go @@ -46,7 +46,7 @@ type Secret struct { // Match = the string matching the regex type SecretMatched struct { Secret Secret - Url string + URL string Match string }