Skip to content

Commit

Permalink
前端显示默认过滤一些无用的流量
Browse files Browse the repository at this point in the history
  • Loading branch information
yhy0 committed May 24, 2023
1 parent be2de94 commit 30af8e5
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 25 deletions.
53 changes: 28 additions & 25 deletions tools/burpSuite/burpAddon.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,29 +95,31 @@ func (b *Burp) Requestheaders(f *proxy.Flow) {
}

ext := ""

uri := strings.Split(f.Request.URL.RequestURI(), "?")
if len(uri) > 0 {
ext = filepath.Ext(uri[0])
}

HttpHistory <- HTTPHistory{
Id: f.Id,
Host: f.Request.URL.Host,
Method: f.Request.Method,
URL: f.Request.URL.RequestURI(),
Params: params,
Edited: "",
Status: strconv.Itoa(statusCode),
Length: strconv.Itoa(contentLen),
MIMEType: MIMEType,
Extension: ext,
Title: httpx.GetTitle(string(f.Response.Body)),
Comment: "",
TLS: "√",
IP: remoteAddr,
Cookies: cookies,
Time: time.Now().Format("2006-01-02 15:04:05"),
// 过滤一些后缀,不显示
var flag = funk.Contains(FilterSuffix, ext)
if !flag {
HttpHistory <- HTTPHistory{
Id: f.Id,
Host: f.Request.URL.Host,
Method: f.Request.Method,
URL: f.Request.URL.RequestURI(),
Params: params,
Edited: "",
Status: strconv.Itoa(statusCode),
Length: strconv.Itoa(contentLen),
MIMEType: MIMEType,
Extension: ext,
Title: httpx.GetTitle(string(f.Response.Body)),
Comment: "",
TLS: "√",
IP: remoteAddr,
Cookies: cookies,
Time: time.Now().Format("2006-01-02 15:04:05"),
}
}

buf := bytes.NewBuffer(make([]byte, 0))
Expand Down Expand Up @@ -161,12 +163,13 @@ func (b *Burp) Requestheaders(f *proxy.Flow) {
}
}
responseDump := buf.String()

HTTPBodyMap.WriteMap(f.Id, &HTTPBody{
TargetUrl: f.Request.URL.String(),
Request: requestDump,
Response: responseDump,
})
if !flag {
HTTPBodyMap.WriteMap(f.Id, &HTTPBody{
TargetUrl: f.Request.URL.String(),
Request: requestDump,
Response: responseDump,
})
}
}()
}

Expand Down
3 changes: 3 additions & 0 deletions tools/burpSuite/setting.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import (
@desc: //TODO
**/

var FilterSuffix = []string{".woff2", ".woff", ".ttf", ".mkv", ".mov", ".mp3", ".mp4", ".m4a", ".m4v"}

var Settings *Setting

var defaultYamlByte = []byte(`
Expand All @@ -25,6 +27,7 @@ exclude:
- ^.*\.google.*$
- ^.*\.firefox.*$
- ^.*\.doubleclick.*$
- ^.*\.mozilla.*$
include:
-
`)
Expand Down

0 comments on commit 30af8e5

Please sign in to comment.