Skip to content

Commit

Permalink
feat api 路径收集去除图片类路径
Browse files Browse the repository at this point in the history
  • Loading branch information
yhy0 committed Jun 2, 2024
1 parent 6e2c347 commit 32d0010
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 442 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
.idea
logs
data
Jie_config.yaml
scan/bbscan/rules/personal_rules.txt
.DS_Store
test.go
Expand Down
221 changes: 0 additions & 221 deletions Jie_config.yaml

This file was deleted.

1 change: 1 addition & 0 deletions conf/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ collection:
- addr
- file
- f
- filename
- dir
- directory
- path
Expand Down
14 changes: 14 additions & 0 deletions scan/gadget/collection/collection.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,19 @@ func Info(target, domain string, body string, contentType string) (c output.Coll
if _u == "" || !strings.HasPrefix(_u, "/") {
continue
}
if filterImg(_u) {
continue
}
c.Api = append(c.Api, _u)
} else {
// "(?i)\\.(get|post|put|delete|options|connect|trace|patch)\\([\"'](/?.*?)[\"']" 这个正则
// 不是以 / 开头的去除
if u[2] == "" || !strings.HasPrefix(u[2], "/") {
continue
}
if filterImg(u[2]) {
continue
}
c.Api = append(c.Api, u[1]+" "+u[2])
}
logging.Logger.Debugln(target, u)
Expand Down Expand Up @@ -183,3 +189,11 @@ func urlFilter(str [][]string) [][]string {
}
return str
}

func filterImg(u string) bool {
if strings.HasSuffix(u, ".png") || strings.HasSuffix(u, ".jpg") || strings.HasSuffix(u, ".jpeg") || strings.HasSuffix(u, ".gif") || strings.HasSuffix(u, ".css") {
return true
}

return false
}
Loading

0 comments on commit 32d0010

Please sign in to comment.