Skip to content

Commit

Permalink
fix katana extension filter
Browse files Browse the repository at this point in the history
  • Loading branch information
yhy0 committed Mar 18, 2024
1 parent bd14f78 commit 41da6a2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
8 changes: 4 additions & 4 deletions crawler/katana.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ import (
@desc: //TODO
**/

// 默认过滤的后缀名
var extensionFilter = []string{
".css", ".png", ".gif", ".jpg", ".mp4", ".mp3", ".mng", ".pct", ".bmp", ".jpeg", ".pst", ".psp", ".ttf",
// ExtensionFilter 默认过滤的后缀名
var ExtensionFilter = []string{
".png", ".gif", ".jpg", ".mp4", ".mp3", ".mng", ".pct", ".bmp", ".jpeg", ".pst", ".psp", ".ttf",
".tif", ".tiff", ".ai", ".drw", ".wma", ".ogg", ".wav", ".ra", ".aac", ".mid", ".au", ".aiff",
".dxf", ".eps", ".ps", ".svg", ".3gp", ".asf", ".asx", ".avi", ".mov", ".mpg", ".qt", ".rm",
".wmv", ".m4a", ".bin", ".xls", ".xlsx", ".ppt", ".pptx", ".doc", ".docx", ".odt", ".ods", ".odg",
Expand All @@ -43,7 +43,7 @@ func Katana(target string, headless bool, show bool, out func(result output.Resu
OnResult: out,
Headless: headless,
Proxy: conf.GlobalConfig.Http.Proxy,
ExtensionFilter: extensionFilter,
ExtensionFilter: ExtensionFilter,
}
if options.Headless {
options.ShowBrowser = show
Expand Down
7 changes: 7 additions & 0 deletions pkg/mode/active.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"github.com/yhy0/Jie/scan/gadget/waf"
"github.com/yhy0/logging"
"net/url"
"path"
"regexp"
"strings"
"time"
Expand Down Expand Up @@ -135,6 +136,12 @@ func Katana(target string, waf []string, t *task.Task, fingerprint []string) []s
logging.Logger.Errorln(err)
return
}
extension := strings.ToLower(path.Ext(parseUrl.Path))

if util.InSlice(crawler.ExtensionFilter, extension) {
return
}

logging.Logger.Infof("Katana: [%s] %v %v", result.Request.Method, result.Request.URL, result.Request.Body)
i++

Expand Down

0 comments on commit 41da6a2

Please sign in to comment.