From e952deb061c0159f575214570fdf3144b4a29b65 Mon Sep 17 00:00:00 2001 From: Joona Hoikkala Date: Mon, 6 Feb 2023 11:20:28 +0200 Subject: [PATCH] Fix the v2 tagging for go install (#639) --- .goreleaser.yml | 2 +- README.md | 2 +- go.mod | 11 ++++++++--- go.sum | 1 - help.go | 2 +- main.go | 14 +++++++------- pkg/filter/filter.go | 3 ++- pkg/filter/lines.go | 2 +- pkg/filter/lines_test.go | 2 +- pkg/filter/regex.go | 2 +- pkg/filter/regexp_test.go | 2 +- pkg/filter/size.go | 2 +- pkg/filter/size_test.go | 2 +- pkg/filter/status.go | 2 +- pkg/filter/status_test.go | 2 +- pkg/filter/time.go | 2 +- pkg/filter/time_test.go | 2 +- pkg/filter/words.go | 2 +- pkg/filter/words_test.go | 2 +- pkg/input/command.go | 2 +- pkg/input/input.go | 2 +- pkg/input/wordlist.go | 2 +- pkg/interactive/termhandler.go | 2 +- pkg/output/file_csv.go | 2 +- pkg/output/file_csv_test.go | 2 +- pkg/output/file_html.go | 2 +- pkg/output/file_json.go | 2 +- pkg/output/file_md.go | 2 +- pkg/output/output.go | 2 +- pkg/output/stdout.go | 2 +- pkg/runner/runner.go | 2 +- pkg/runner/simple.go | 2 +- pkg/scraper/scraper.go | 2 +- pkg/scraper/util.go | 2 +- 34 files changed, 47 insertions(+), 42 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index 4e8d074..fd5eeae 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -10,7 +10,7 @@ builds: gcflags: - all=-trimpath={{.Env.GOPATH}} ldflags: | - -s -w -X github.com/ffuf/ffuf/pkg/ffuf.VERSION_APPENDIX= -extldflags '-static' + -s -w -X github.com/ffuf/ffuf/v2/pkg/ffuf.VERSION_APPENDIX= -extldflags '-static' goos: - linux - windows diff --git a/README.md b/README.md index 566256a..9c6c665 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ A fast web fuzzer written in Go. - If you are on macOS with [homebrew](https://brew.sh), ffuf can be installed with: `brew install ffuf` _or_ -- If you have recent go compiler installed: `go install github.com/ffuf/ffuf@latest` (the same command works for updating) +- If you have recent go compiler installed: `go install github.com/ffuf/ffuf/v2@latest` (the same command works for updating) _or_ - `git clone https://github.com/ffuf/ffuf ; cd ffuf ; go get ; go build` diff --git a/go.mod b/go.mod index e0c37bc..5071691 100644 --- a/go.mod +++ b/go.mod @@ -1,11 +1,16 @@ -module github.com/ffuf/ffuf +module github.com/ffuf/ffuf/v2 go 1.17 require ( github.com/PuerkitoBio/goquery v1.8.0 github.com/adrg/xdg v0.4.0 - github.com/davecgh/go-spew v1.1.1 // indirect github.com/pelletier/go-toml v1.9.5 - golang.org/x/net v0.5.0 // indirect +) + +require ( + github.com/andybalholm/cascadia v1.3.1 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + golang.org/x/net v0.5.0 // indirect + golang.org/x/sys v0.4.0 // indirect ) diff --git a/go.sum b/go.sum index c2cb992..3304bd8 100644 --- a/go.sum +++ b/go.sum @@ -47,7 +47,6 @@ golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGm golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/help.go b/help.go index fddd658..0f5fa43 100644 --- a/help.go +++ b/help.go @@ -5,7 +5,7 @@ import ( "fmt" "os" - "github.com/ffuf/ffuf/pkg/ffuf" + "github.com/ffuf/ffuf/v2/pkg/ffuf" ) type UsageSection struct { diff --git a/main.go b/main.go index b5644bf..dcbdc05 100644 --- a/main.go +++ b/main.go @@ -10,13 +10,13 @@ import ( "strings" "time" - "github.com/ffuf/ffuf/pkg/ffuf" - "github.com/ffuf/ffuf/pkg/filter" - "github.com/ffuf/ffuf/pkg/input" - "github.com/ffuf/ffuf/pkg/interactive" - "github.com/ffuf/ffuf/pkg/output" - "github.com/ffuf/ffuf/pkg/runner" - "github.com/ffuf/ffuf/pkg/scraper" + "github.com/ffuf/ffuf/v2/pkg/ffuf" + "github.com/ffuf/ffuf/v2/pkg/filter" + "github.com/ffuf/ffuf/v2/pkg/input" + "github.com/ffuf/ffuf/v2/pkg/interactive" + "github.com/ffuf/ffuf/v2/pkg/output" + "github.com/ffuf/ffuf/v2/pkg/runner" + "github.com/ffuf/ffuf/v2/pkg/scraper" ) type multiStringFlag []string diff --git a/pkg/filter/filter.go b/pkg/filter/filter.go index 72e73d6..8b7f29f 100644 --- a/pkg/filter/filter.go +++ b/pkg/filter/filter.go @@ -2,8 +2,9 @@ package filter import ( "fmt" - "github.com/ffuf/ffuf/pkg/ffuf" "sync" + + "github.com/ffuf/ffuf/v2/pkg/ffuf" ) // MatcherManager handles both filters and matchers. diff --git a/pkg/filter/lines.go b/pkg/filter/lines.go index ced350b..a4df44b 100644 --- a/pkg/filter/lines.go +++ b/pkg/filter/lines.go @@ -6,7 +6,7 @@ import ( "strconv" "strings" - "github.com/ffuf/ffuf/pkg/ffuf" + "github.com/ffuf/ffuf/v2/pkg/ffuf" ) type LineFilter struct { diff --git a/pkg/filter/lines_test.go b/pkg/filter/lines_test.go index 92c36d4..5d119b1 100644 --- a/pkg/filter/lines_test.go +++ b/pkg/filter/lines_test.go @@ -4,7 +4,7 @@ import ( "strings" "testing" - "github.com/ffuf/ffuf/pkg/ffuf" + "github.com/ffuf/ffuf/v2/pkg/ffuf" ) func TestNewLineFilter(t *testing.T) { diff --git a/pkg/filter/regex.go b/pkg/filter/regex.go index 8f57025..47fbb9d 100644 --- a/pkg/filter/regex.go +++ b/pkg/filter/regex.go @@ -6,7 +6,7 @@ import ( "regexp" "strings" - "github.com/ffuf/ffuf/pkg/ffuf" + "github.com/ffuf/ffuf/v2/pkg/ffuf" ) type RegexpFilter struct { diff --git a/pkg/filter/regexp_test.go b/pkg/filter/regexp_test.go index 20033b4..e4e9efa 100644 --- a/pkg/filter/regexp_test.go +++ b/pkg/filter/regexp_test.go @@ -4,7 +4,7 @@ import ( "strings" "testing" - "github.com/ffuf/ffuf/pkg/ffuf" + "github.com/ffuf/ffuf/v2/pkg/ffuf" ) func TestNewRegexpFilter(t *testing.T) { diff --git a/pkg/filter/size.go b/pkg/filter/size.go index c940d4e..7db3e76 100644 --- a/pkg/filter/size.go +++ b/pkg/filter/size.go @@ -6,7 +6,7 @@ import ( "strconv" "strings" - "github.com/ffuf/ffuf/pkg/ffuf" + "github.com/ffuf/ffuf/v2/pkg/ffuf" ) type SizeFilter struct { diff --git a/pkg/filter/size_test.go b/pkg/filter/size_test.go index b5d7d3d..18935e7 100644 --- a/pkg/filter/size_test.go +++ b/pkg/filter/size_test.go @@ -4,7 +4,7 @@ import ( "strings" "testing" - "github.com/ffuf/ffuf/pkg/ffuf" + "github.com/ffuf/ffuf/v2/pkg/ffuf" ) func TestNewSizeFilter(t *testing.T) { diff --git a/pkg/filter/status.go b/pkg/filter/status.go index 0beb5b9..59382b1 100644 --- a/pkg/filter/status.go +++ b/pkg/filter/status.go @@ -6,7 +6,7 @@ import ( "strconv" "strings" - "github.com/ffuf/ffuf/pkg/ffuf" + "github.com/ffuf/ffuf/v2/pkg/ffuf" ) const AllStatuses = 0 diff --git a/pkg/filter/status_test.go b/pkg/filter/status_test.go index 9006a5a..aaa1b52 100644 --- a/pkg/filter/status_test.go +++ b/pkg/filter/status_test.go @@ -4,7 +4,7 @@ import ( "strings" "testing" - "github.com/ffuf/ffuf/pkg/ffuf" + "github.com/ffuf/ffuf/v2/pkg/ffuf" ) func TestNewStatusFilter(t *testing.T) { diff --git a/pkg/filter/time.go b/pkg/filter/time.go index 1041708..9d27087 100755 --- a/pkg/filter/time.go +++ b/pkg/filter/time.go @@ -6,7 +6,7 @@ import ( "strconv" "strings" - "github.com/ffuf/ffuf/pkg/ffuf" + "github.com/ffuf/ffuf/v2/pkg/ffuf" ) type TimeFilter struct { diff --git a/pkg/filter/time_test.go b/pkg/filter/time_test.go index 03e1b8a..88b277a 100755 --- a/pkg/filter/time_test.go +++ b/pkg/filter/time_test.go @@ -4,7 +4,7 @@ import ( "testing" "time" - "github.com/ffuf/ffuf/pkg/ffuf" + "github.com/ffuf/ffuf/v2/pkg/ffuf" ) func TestNewTimeFilter(t *testing.T) { diff --git a/pkg/filter/words.go b/pkg/filter/words.go index 685e534..8c59234 100644 --- a/pkg/filter/words.go +++ b/pkg/filter/words.go @@ -6,7 +6,7 @@ import ( "strconv" "strings" - "github.com/ffuf/ffuf/pkg/ffuf" + "github.com/ffuf/ffuf/v2/pkg/ffuf" ) type WordFilter struct { diff --git a/pkg/filter/words_test.go b/pkg/filter/words_test.go index 3c760be..5054985 100644 --- a/pkg/filter/words_test.go +++ b/pkg/filter/words_test.go @@ -4,7 +4,7 @@ import ( "strings" "testing" - "github.com/ffuf/ffuf/pkg/ffuf" + "github.com/ffuf/ffuf/v2/pkg/ffuf" ) func TestNewWordFilter(t *testing.T) { diff --git a/pkg/input/command.go b/pkg/input/command.go index 3d290cf..d230a08 100644 --- a/pkg/input/command.go +++ b/pkg/input/command.go @@ -6,7 +6,7 @@ import ( "os/exec" "strconv" - "github.com/ffuf/ffuf/pkg/ffuf" + "github.com/ffuf/ffuf/v2/pkg/ffuf" ) type CommandInput struct { diff --git a/pkg/input/input.go b/pkg/input/input.go index 87c78e5..993246a 100644 --- a/pkg/input/input.go +++ b/pkg/input/input.go @@ -3,7 +3,7 @@ package input import ( "fmt" - "github.com/ffuf/ffuf/pkg/ffuf" + "github.com/ffuf/ffuf/v2/pkg/ffuf" ) type MainInputProvider struct { diff --git a/pkg/input/wordlist.go b/pkg/input/wordlist.go index 33aefbc..64db39e 100644 --- a/pkg/input/wordlist.go +++ b/pkg/input/wordlist.go @@ -6,7 +6,7 @@ import ( "regexp" "strings" - "github.com/ffuf/ffuf/pkg/ffuf" + "github.com/ffuf/ffuf/v2/pkg/ffuf" ) type WordlistInput struct { diff --git a/pkg/interactive/termhandler.go b/pkg/interactive/termhandler.go index 63a35f5..77f5f6d 100644 --- a/pkg/interactive/termhandler.go +++ b/pkg/interactive/termhandler.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/ffuf/ffuf/pkg/ffuf" + "github.com/ffuf/ffuf/v2/pkg/ffuf" ) type interactive struct { diff --git a/pkg/output/file_csv.go b/pkg/output/file_csv.go index 3679708..8a7a767 100644 --- a/pkg/output/file_csv.go +++ b/pkg/output/file_csv.go @@ -6,7 +6,7 @@ import ( "os" "strconv" - "github.com/ffuf/ffuf/pkg/ffuf" + "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"} diff --git a/pkg/output/file_csv_test.go b/pkg/output/file_csv_test.go index a858ece..e1dbf71 100644 --- a/pkg/output/file_csv_test.go +++ b/pkg/output/file_csv_test.go @@ -5,7 +5,7 @@ import ( "testing" "time" - "github.com/ffuf/ffuf/pkg/ffuf" + "github.com/ffuf/ffuf/v2/pkg/ffuf" ) func TestToCSV(t *testing.T) { diff --git a/pkg/output/file_html.go b/pkg/output/file_html.go index 5606504..5a130d9 100644 --- a/pkg/output/file_html.go +++ b/pkg/output/file_html.go @@ -6,7 +6,7 @@ import ( "os" "time" - "github.com/ffuf/ffuf/pkg/ffuf" + "github.com/ffuf/ffuf/v2/pkg/ffuf" ) type htmlResult struct { diff --git a/pkg/output/file_json.go b/pkg/output/file_json.go index b447a96..c0cb29c 100644 --- a/pkg/output/file_json.go +++ b/pkg/output/file_json.go @@ -5,7 +5,7 @@ import ( "os" "time" - "github.com/ffuf/ffuf/pkg/ffuf" + "github.com/ffuf/ffuf/v2/pkg/ffuf" ) type ejsonFileOutput struct { diff --git a/pkg/output/file_md.go b/pkg/output/file_md.go index a55f356..b0e8a37 100644 --- a/pkg/output/file_md.go +++ b/pkg/output/file_md.go @@ -5,7 +5,7 @@ import ( "os" "time" - "github.com/ffuf/ffuf/pkg/ffuf" + "github.com/ffuf/ffuf/v2/pkg/ffuf" ) const ( diff --git a/pkg/output/output.go b/pkg/output/output.go index a1e0149..a87f096 100644 --- a/pkg/output/output.go +++ b/pkg/output/output.go @@ -1,7 +1,7 @@ package output import ( - "github.com/ffuf/ffuf/pkg/ffuf" + "github.com/ffuf/ffuf/v2/pkg/ffuf" ) func NewOutputProviderByName(name string, conf *ffuf.Config) ffuf.OutputProvider { diff --git a/pkg/output/stdout.go b/pkg/output/stdout.go index 25e08a8..0b11c0a 100644 --- a/pkg/output/stdout.go +++ b/pkg/output/stdout.go @@ -11,7 +11,7 @@ import ( "strings" "time" - "github.com/ffuf/ffuf/pkg/ffuf" + "github.com/ffuf/ffuf/v2/pkg/ffuf" ) const ( diff --git a/pkg/runner/runner.go b/pkg/runner/runner.go index 092d1e0..84abd1e 100644 --- a/pkg/runner/runner.go +++ b/pkg/runner/runner.go @@ -1,7 +1,7 @@ package runner import ( - "github.com/ffuf/ffuf/pkg/ffuf" + "github.com/ffuf/ffuf/v2/pkg/ffuf" ) func NewRunnerByName(name string, conf *ffuf.Config, replay bool) ffuf.RunnerProvider { diff --git a/pkg/runner/simple.go b/pkg/runner/simple.go index 91faf14..8dd90b8 100644 --- a/pkg/runner/simple.go +++ b/pkg/runner/simple.go @@ -16,7 +16,7 @@ import ( "strings" "time" - "github.com/ffuf/ffuf/pkg/ffuf" + "github.com/ffuf/ffuf/v2/pkg/ffuf" ) // Download results < 5MB diff --git a/pkg/scraper/scraper.go b/pkg/scraper/scraper.go index d3be714..eda4402 100644 --- a/pkg/scraper/scraper.go +++ b/pkg/scraper/scraper.go @@ -8,7 +8,7 @@ import ( "regexp" "strings" - "github.com/ffuf/ffuf/pkg/ffuf" + "github.com/ffuf/ffuf/v2/pkg/ffuf" "github.com/PuerkitoBio/goquery" ) diff --git a/pkg/scraper/util.go b/pkg/scraper/util.go index 69929ee..e93adb7 100644 --- a/pkg/scraper/util.go +++ b/pkg/scraper/util.go @@ -2,7 +2,7 @@ package scraper import ( "fmt" - "github.com/ffuf/ffuf/pkg/ffuf" + "github.com/ffuf/ffuf/v2/pkg/ffuf" "strings" )