Skip to content

Commit

Permalink
very simple bad filter
Browse files Browse the repository at this point in the history
  • Loading branch information
boyter committed Jan 16, 2025
1 parent b03c530 commit 2dc5abb
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions cmd/badges/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ func main() {
return
}

if filterBad(loc) {
log.Error().Str(uniqueCode, "bfee4bd8").Str("loc", loc.String()).Msg("filter bad")
return
}

appendLocationLog(loc.String())

res, err := process(1, loc)
Expand Down Expand Up @@ -99,6 +104,23 @@ func main() {
}
}

func filterBad(loc location) bool {
l := loc.String()
bad := []string{"wp-content.com", "wp-admin.com", ".well-known", "wp-includes.com", ".php"}
count := 0
for _, b := range bad {
if strings.Contains(l, b) {
count++
}
}

if count >= 2 {
return true
}

return false
}

func appendLocationLog(log string) {
locationLogMutex.Lock()
defer locationLogMutex.Unlock()
Expand Down

0 comments on commit 2dc5abb

Please sign in to comment.