From af036a38999d9811694a476f2c4886f7ca567940 Mon Sep 17 00:00:00 2001 From: moaml <63509020+moamlrh@users.noreply.github.com> Date: Fri, 17 Jan 2025 15:48:39 +0300 Subject: [PATCH 1/4] progress bar with percentage --- pkg/input/input.go | 4 ++-- pkg/output/stdout.go | 22 +++++++++++++++++++++- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/pkg/input/input.go b/pkg/input/input.go index e34c1068..b7b32364 100644 --- a/pkg/input/input.go +++ b/pkg/input/input.go @@ -2,9 +2,10 @@ package input import ( "fmt" - "github.com/ffuf/ffuf/v2/pkg/ffuf" "strings" + "github.com/ffuf/ffuf/v2/pkg/ffuf" + "github.com/ffuf/pencode/pkg/pencode" ) @@ -253,4 +254,3 @@ func (i *MainInputProvider) Total() int { } return count } - diff --git a/pkg/output/stdout.go b/pkg/output/stdout.go index 44dc9010..3d04a0b3 100644 --- a/pkg/output/stdout.go +++ b/pkg/output/stdout.go @@ -182,7 +182,27 @@ func (s *Stdoutput) Progress(status ffuf.Progress) { dur -= mins * time.Minute secs := dur / time.Second - fmt.Fprintf(os.Stderr, "%s:: Progress: [%d/%d] :: Job [%d/%d] :: %d req/sec :: Duration: [%d:%02d:%02d] :: Errors: %d ::", TERMINAL_CLEAR_LINE, status.ReqCount, status.ReqTotal, status.QueuePos, status.QueueTotal, reqRate, hours, mins, secs, status.ErrorCount) + percentage := float64(status.ReqCount) / float64(status.ReqTotal) * 100 + + barLength := 50 // Length of the progress bar + completed := int(float64(barLength) * (percentage / 100)) + progressBar := "[" + strings.Repeat("=", completed) + strings.Repeat(" ", barLength-completed) + "]" + + fmt.Fprintf(os.Stderr, "%s:: Progress: %s %.2f%% (%d/%d) :: Job [%d/%d] :: %d req/sec :: Duration: [%d:%02d:%02d] :: Errors: %d ::%s", + TERMINAL_CLEAR_LINE, + progressBar, + percentage, + status.ReqCount, + status.ReqTotal, + status.QueuePos, + status.QueueTotal, + reqRate, + hours, + mins, + secs, + status.ErrorCount, + "\r", + ) } func (s *Stdoutput) Info(infostring string) { From c7dba47c0f60a0f4da7320cf7ca9904b7acbf9f5 Mon Sep 17 00:00:00 2001 From: moaml <63509020+moamlrh@users.noreply.github.com> Date: Fri, 17 Jan 2025 15:56:11 +0300 Subject: [PATCH 2/4] added my name to contributers --- CONTRIBUTORS.md | 101 ++++++++++++++++++++++++------------------------ 1 file changed, 51 insertions(+), 50 deletions(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 3f40dd07..ff70cb5f 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -1,52 +1,53 @@ # Contributors -* [adamtlangley](https://github.com/adamtlangley) -* [adilsoybali](https://github.com/adilsoybali) -* [AverageSecurityGuy](https://github.com/averagesecurityguy) -* [bp0](https://github.com/bp0lr) -* [bjhulst](https://github.com/bjhulst) -* [bsysop](https://twitter.com/bsysop) -* [ccsplit](https://github.com/ccsplit) -* [choket](https://github.com/choket) -* [codingo](https://github.com/codingo) -* [c_sto](https://github.com/c-sto) -* [Damian89](https://github.com/Damian89) -* [Daviey](https://github.com/Daviey) -* [delic](https://github.com/delic) -* [denandz](https://github.com/denandz) -* [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) -* [Hazegard](https://github.com/Hazegard) -* [helpermika](https://github.com/helpermika) -* [h1x](https://github.com/h1x-lnx) -* [Ice3man543](https://github.com/Ice3man543) -* [JamTookTheBait](https://github.com/JamTookTheBait) -* [jimen0](https://github.com/jimen0) -* [joohoi](https://github.com/joohoi) -* [JoshuaMulliken](https://github.com/JoshuaMulliken) -* [jsgv](https://github.com/jsgv) -* [justinsteven](https://github.com/justinsteven) -* [jvesiluoma](https://github.com/jvesiluoma) -* [Kiblyn11](https://github.com/Kiblyn11) -* [l4yton](https://github.com/l4yton) -* [lc](https://github.com/lc) -* [mprencipe](https://github.com/mprencipe) -* [nnwakelam](https://twitter.com/nnwakelam) -* [noraj](https://pwn.by/noraj) -* [oh6hay](https://github.com/oh6hay) -* [penguinxoxo](https://github.com/penguinxoxo) -* [p0dalirius](https://github.com/p0dalirius) -* [putsi](https://github.com/putsi) -* [SakiiR](https://github.com/SakiiR) -* [seblw](https://github.com/seblw) -* [Serizao](https://github.com/Serizao) -* [Shaked](https://github.com/Shaked) -* [Skyehopper](https://github.com/Skyehopper) -* [SolomonSklash](https://github.com/SolomonSklash) -* [TomNomNom](https://github.com/tomnomnom) -* [xfgusta](https://github.com/xfgusta) +- [adamtlangley](https://github.com/adamtlangley) +- [adilsoybali](https://github.com/adilsoybali) +- [AverageSecurityGuy](https://github.com/averagesecurityguy) +- [bp0](https://github.com/bp0lr) +- [bjhulst](https://github.com/bjhulst) +- [bsysop](https://twitter.com/bsysop) +- [ccsplit](https://github.com/ccsplit) +- [choket](https://github.com/choket) +- [codingo](https://github.com/codingo) +- [c_sto](https://github.com/c-sto) +- [Damian89](https://github.com/Damian89) +- [Daviey](https://github.com/Daviey) +- [delic](https://github.com/delic) +- [denandz](https://github.com/denandz) +- [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) +- [Hazegard](https://github.com/Hazegard) +- [helpermika](https://github.com/helpermika) +- [h1x](https://github.com/h1x-lnx) +- [Ice3man543](https://github.com/Ice3man543) +- [JamTookTheBait](https://github.com/JamTookTheBait) +- [jimen0](https://github.com/jimen0) +- [joohoi](https://github.com/joohoi) +- [JoshuaMulliken](https://github.com/JoshuaMulliken) +- [jsgv](https://github.com/jsgv) +- [justinsteven](https://github.com/justinsteven) +- [jvesiluoma](https://github.com/jvesiluoma) +- [Kiblyn11](https://github.com/Kiblyn11) +- [l4yton](https://github.com/l4yton) +- [lc](https://github.com/lc) +- [moamlrh](https://github.com/moamlrh) +- [mprencipe](https://github.com/mprencipe) +- [nnwakelam](https://twitter.com/nnwakelam) +- [noraj](https://pwn.by/noraj) +- [oh6hay](https://github.com/oh6hay) +- [penguinxoxo](https://github.com/penguinxoxo) +- [p0dalirius](https://github.com/p0dalirius) +- [putsi](https://github.com/putsi) +- [SakiiR](https://github.com/SakiiR) +- [seblw](https://github.com/seblw) +- [Serizao](https://github.com/Serizao) +- [Shaked](https://github.com/Shaked) +- [Skyehopper](https://github.com/Skyehopper) +- [SolomonSklash](https://github.com/SolomonSklash) +- [TomNomNom](https://github.com/tomnomnom) +- [xfgusta](https://github.com/xfgusta) From 182d9b9fb86c95631dce61bff26d9de61acdd93f Mon Sep 17 00:00:00 2001 From: moaml <63509020+moamlrh@users.noreply.github.com> Date: Fri, 17 Jan 2025 16:01:25 +0300 Subject: [PATCH 3/4] wth --- CONTRIBUTORS.md | 101 ++++++++++++++++++++++++------------------------ 1 file changed, 50 insertions(+), 51 deletions(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index ff70cb5f..3f40dd07 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -1,53 +1,52 @@ # Contributors -- [adamtlangley](https://github.com/adamtlangley) -- [adilsoybali](https://github.com/adilsoybali) -- [AverageSecurityGuy](https://github.com/averagesecurityguy) -- [bp0](https://github.com/bp0lr) -- [bjhulst](https://github.com/bjhulst) -- [bsysop](https://twitter.com/bsysop) -- [ccsplit](https://github.com/ccsplit) -- [choket](https://github.com/choket) -- [codingo](https://github.com/codingo) -- [c_sto](https://github.com/c-sto) -- [Damian89](https://github.com/Damian89) -- [Daviey](https://github.com/Daviey) -- [delic](https://github.com/delic) -- [denandz](https://github.com/denandz) -- [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) -- [Hazegard](https://github.com/Hazegard) -- [helpermika](https://github.com/helpermika) -- [h1x](https://github.com/h1x-lnx) -- [Ice3man543](https://github.com/Ice3man543) -- [JamTookTheBait](https://github.com/JamTookTheBait) -- [jimen0](https://github.com/jimen0) -- [joohoi](https://github.com/joohoi) -- [JoshuaMulliken](https://github.com/JoshuaMulliken) -- [jsgv](https://github.com/jsgv) -- [justinsteven](https://github.com/justinsteven) -- [jvesiluoma](https://github.com/jvesiluoma) -- [Kiblyn11](https://github.com/Kiblyn11) -- [l4yton](https://github.com/l4yton) -- [lc](https://github.com/lc) -- [moamlrh](https://github.com/moamlrh) -- [mprencipe](https://github.com/mprencipe) -- [nnwakelam](https://twitter.com/nnwakelam) -- [noraj](https://pwn.by/noraj) -- [oh6hay](https://github.com/oh6hay) -- [penguinxoxo](https://github.com/penguinxoxo) -- [p0dalirius](https://github.com/p0dalirius) -- [putsi](https://github.com/putsi) -- [SakiiR](https://github.com/SakiiR) -- [seblw](https://github.com/seblw) -- [Serizao](https://github.com/Serizao) -- [Shaked](https://github.com/Shaked) -- [Skyehopper](https://github.com/Skyehopper) -- [SolomonSklash](https://github.com/SolomonSklash) -- [TomNomNom](https://github.com/tomnomnom) -- [xfgusta](https://github.com/xfgusta) +* [adamtlangley](https://github.com/adamtlangley) +* [adilsoybali](https://github.com/adilsoybali) +* [AverageSecurityGuy](https://github.com/averagesecurityguy) +* [bp0](https://github.com/bp0lr) +* [bjhulst](https://github.com/bjhulst) +* [bsysop](https://twitter.com/bsysop) +* [ccsplit](https://github.com/ccsplit) +* [choket](https://github.com/choket) +* [codingo](https://github.com/codingo) +* [c_sto](https://github.com/c-sto) +* [Damian89](https://github.com/Damian89) +* [Daviey](https://github.com/Daviey) +* [delic](https://github.com/delic) +* [denandz](https://github.com/denandz) +* [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) +* [Hazegard](https://github.com/Hazegard) +* [helpermika](https://github.com/helpermika) +* [h1x](https://github.com/h1x-lnx) +* [Ice3man543](https://github.com/Ice3man543) +* [JamTookTheBait](https://github.com/JamTookTheBait) +* [jimen0](https://github.com/jimen0) +* [joohoi](https://github.com/joohoi) +* [JoshuaMulliken](https://github.com/JoshuaMulliken) +* [jsgv](https://github.com/jsgv) +* [justinsteven](https://github.com/justinsteven) +* [jvesiluoma](https://github.com/jvesiluoma) +* [Kiblyn11](https://github.com/Kiblyn11) +* [l4yton](https://github.com/l4yton) +* [lc](https://github.com/lc) +* [mprencipe](https://github.com/mprencipe) +* [nnwakelam](https://twitter.com/nnwakelam) +* [noraj](https://pwn.by/noraj) +* [oh6hay](https://github.com/oh6hay) +* [penguinxoxo](https://github.com/penguinxoxo) +* [p0dalirius](https://github.com/p0dalirius) +* [putsi](https://github.com/putsi) +* [SakiiR](https://github.com/SakiiR) +* [seblw](https://github.com/seblw) +* [Serizao](https://github.com/Serizao) +* [Shaked](https://github.com/Shaked) +* [Skyehopper](https://github.com/Skyehopper) +* [SolomonSklash](https://github.com/SolomonSklash) +* [TomNomNom](https://github.com/tomnomnom) +* [xfgusta](https://github.com/xfgusta) From 1ff0c61677d932b1a5c09b85a274c3accb377afe Mon Sep 17 00:00:00 2001 From: moaml <63509020+moamlrh@users.noreply.github.com> Date: Fri, 17 Jan 2025 16:02:07 +0300 Subject: [PATCH 4/4] added to contributers list --- CONTRIBUTORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 3f40dd07..0a77fb4d 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -35,6 +35,7 @@ * [Kiblyn11](https://github.com/Kiblyn11) * [l4yton](https://github.com/l4yton) * [lc](https://github.com/lc) +* [moamlrh](https://github.com/moamlrh) * [mprencipe](https://github.com/mprencipe) * [nnwakelam](https://twitter.com/nnwakelam) * [noraj](https://pwn.by/noraj)