Merge pull request #8 from ffuf/match_headers

Make regex filter match headers too
This commit is contained in:
Joona Hoikkala 2019-03-30 01:41:19 +02:00 committed by GitHub
commit 6217ab77e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,7 +21,15 @@ func NewRegexpFilter(value string) (ffuf.FilterProvider, error) {
} }
func (f *RegexpFilter) Filter(response *ffuf.Response) (bool, error) { func (f *RegexpFilter) Filter(response *ffuf.Response) (bool, error) {
return f.Value.Match(response.Data), nil matchheaders := ""
for k, v := range response.Headers {
for _, iv := range v {
matchheaders += k + ": " + iv + "\r\n"
}
}
matchdata := []byte(matchheaders)
matchdata = append(matchdata, response.Data...)
return f.Value.Match(matchdata), nil
} }
func (f *RegexpFilter) Repr() string { func (f *RegexpFilter) Repr() string {