mirror of
https://github.com/ffuf/ffuf
synced 2024-11-10 06:04:17 +00:00
fix csv output file format (#683)
* fix csv output file format * Add my username to the CONTRIBUTORS.md --------- Co-authored-by: Joona Hoikkala <5235109+joohoi@users.noreply.github.com>
This commit is contained in:
parent
6f29907b4f
commit
9f2163acd3
3 changed files with 12 additions and 3 deletions
|
@ -5,7 +5,9 @@
|
|||
- Changed
|
||||
- Explicitly allow TLS1.0
|
||||
- Fix markdown output file format
|
||||
- Fix csv output file format
|
||||
- Fixed divide by 0 error when setting rate limit to 0 manually.
|
||||
|
||||
|
||||
- v2.0.0
|
||||
- New
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
* [Ephex2](https://github.com/Ephex2)
|
||||
* [erbbysam](https://github.com/erbbysam)
|
||||
* [eur0pa](https://github.com/eur0pa)
|
||||
* [gserrg](https://github.com/gserrg)
|
||||
* [fabiobauer](https://github.com/fabiobauer)
|
||||
* [fang0654](https://github.com/fang0654)
|
||||
* [haseobang](https://github.com/haseobang)
|
||||
|
|
|
@ -9,7 +9,7 @@ import (
|
|||
"github.com/ffuf/ffuf/v2/pkg/ffuf"
|
||||
)
|
||||
|
||||
var staticheaders = []string{"url", "redirectlocation", "position", "status_code", "content_length", "content_words", "content_lines", "content_type", "duration", "resultfile"}
|
||||
var staticheaders = []string{"url", "redirectlocation", "position", "status_code", "content_length", "content_words", "content_lines", "content_type", "duration", "resultfile", "Ffufhash"}
|
||||
|
||||
func writeCSV(filename string, config *ffuf.Config, res []ffuf.Result, encode bool) error {
|
||||
header := make([]string, 0)
|
||||
|
@ -53,8 +53,13 @@ func base64encode(in []byte) string {
|
|||
|
||||
func toCSV(r ffuf.Result) []string {
|
||||
res := make([]string, 0)
|
||||
for _, v := range r.Input {
|
||||
res = append(res, string(v))
|
||||
ffufhash := ""
|
||||
for k, v := range r.Input {
|
||||
if k == "FFUFHASH" {
|
||||
ffufhash = string(v)
|
||||
} else {
|
||||
res = append(res, string(v))
|
||||
}
|
||||
}
|
||||
res = append(res, r.Url)
|
||||
res = append(res, r.RedirectLocation)
|
||||
|
@ -66,5 +71,6 @@ func toCSV(r ffuf.Result) []string {
|
|||
res = append(res, r.ContentType)
|
||||
res = append(res, r.Duration.String())
|
||||
res = append(res, r.ResultFile)
|
||||
res = append(res, ffufhash)
|
||||
return res
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue