diff --git a/.travis.yml b/.travis.yml index 01fbcfb..88a16ae 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,7 @@ go: - "1.x" - "1.8" - "1.10.x" + - "1.11.x" - master script: make test \ No newline at end of file diff --git a/Makefile b/Makefile index 22a2a99..7f9cdad 100644 --- a/Makefile +++ b/Makefile @@ -8,11 +8,16 @@ current: @go build -o ./gobuster; \ echo "Done." +update: + @go get -u; \ + go mod tidy; \ + echo "Done." + windows: @for GOARCH in ${ARCHS}; do \ echo "Building for windows $${GOARCH} ..." ; \ mkdir -p ${TARGET}/gobuster-windows-$${GOARCH} ; \ - GOOS=windows GOARCH=$${GOARCH} go build -ldflags=${LDFLAGS} -gcflags=${GCFLAGS} -asmflags=${ASMFLAGS} -o ${TARGET}/gobuster-windows-$${GOARCH}/gobuster.exe ; \ + GOOS=windows GOARCH=$${GOARCH} GO111MODULE=on go build -ldflags=${LDFLAGS} -gcflags=${GCFLAGS} -asmflags=${ASMFLAGS} -o ${TARGET}/gobuster-windows-$${GOARCH}/gobuster.exe ; \ done; \ echo "Done." @@ -20,7 +25,7 @@ linux: @for GOARCH in ${ARCHS}; do \ echo "Building for linux $${GOARCH} ..." ; \ mkdir -p ${TARGET}/gobuster-linux-$${GOARCH} ; \ - GOOS=linux GOARCH=$${GOARCH} go build -ldflags=${LDFLAGS} -gcflags=${GCFLAGS} -asmflags=${ASMFLAGS} -o ${TARGET}/gobuster-linux-$${GOARCH}/gobuster ; \ + GOOS=linux GOARCH=$${GOARCH} GO111MODULE=on go build -ldflags=${LDFLAGS} -gcflags=${GCFLAGS} -asmflags=${ASMFLAGS} -o ${TARGET}/gobuster-linux-$${GOARCH}/gobuster ; \ done; \ echo "Done." @@ -28,11 +33,11 @@ darwin: @for GOARCH in ${ARCHS}; do \ echo "Building for darwin $${GOARCH} ..." ; \ mkdir -p ${TARGET}/gobuster-darwin-$${GOARCH} ; \ - GOOS=darwin GOARCH=$${GOARCH} go build -ldflags=${LDFLAGS} -gcflags=${GCFLAGS} -asmflags=${ASMFLAGS} -o ${TARGET}/gobuster-darwin-$${GOARCH}/gobuster ; \ + GOOS=darwin GOARCH=$${GOARCH} GO111MODULE=on go build -ldflags=${LDFLAGS} -gcflags=${GCFLAGS} -asmflags=${ASMFLAGS} -o ${TARGET}/gobuster-darwin-$${GOARCH}/gobuster ; \ done; \ echo "Done." -all: darwin linux windows +all: update darwin linux windows test: @go test -v -race ./... ; \ diff --git a/cli/cmd/dir.go b/cli/cmd/dir.go index 96bfdce..868d6d5 100644 --- a/cli/cmd/dir.go +++ b/cli/cmd/dir.go @@ -12,9 +12,9 @@ import ( "syscall" "time" - "github.com/OJ/gobuster/cli" - "github.com/OJ/gobuster/gobusterdir" - "github.com/OJ/gobuster/libgobuster" + "github.com/OJ/gobuster/v3/cli" + "github.com/OJ/gobuster/v3/gobusterdir" + "github.com/OJ/gobuster/v3/libgobuster" "github.com/spf13/cobra" "golang.org/x/crypto/ssh/terminal" ) diff --git a/cli/cmd/dns.go b/cli/cmd/dns.go index 2e8cdbb..fd0adaf 100644 --- a/cli/cmd/dns.go +++ b/cli/cmd/dns.go @@ -9,9 +9,9 @@ import ( "runtime" "time" - "github.com/OJ/gobuster/cli" - "github.com/OJ/gobuster/gobusterdns" - "github.com/OJ/gobuster/libgobuster" + "github.com/OJ/gobuster/v3/cli" + "github.com/OJ/gobuster/v3/gobusterdns" + "github.com/OJ/gobuster/v3/libgobuster" "github.com/spf13/cobra" ) diff --git a/cli/cmd/root.go b/cli/cmd/root.go index 328e0d1..273c338 100644 --- a/cli/cmd/root.go +++ b/cli/cmd/root.go @@ -5,7 +5,7 @@ import ( "log" "os" - "github.com/OJ/gobuster/libgobuster" + "github.com/OJ/gobuster/v3/libgobuster" "github.com/spf13/cobra" ) diff --git a/cli/gobuster.go b/cli/gobuster.go index 1159489..f2d7b50 100644 --- a/cli/gobuster.go +++ b/cli/gobuster.go @@ -9,7 +9,7 @@ import ( "sync" "time" - "github.com/OJ/gobuster/libgobuster" + "github.com/OJ/gobuster/v3/libgobuster" ) func ruler() { diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..1107f70 --- /dev/null +++ b/go.mod @@ -0,0 +1,10 @@ +module github.com/OJ/gobuster/v3 + +require ( + github.com/google/uuid v1.1.0 + github.com/inconshreveable/mousetrap v1.0.0 // indirect + github.com/spf13/cobra v0.0.3 + github.com/spf13/pflag v1.0.3 // indirect + golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9 + golang.org/x/sys v0.0.0-20181211161752-7da8ea5c8182 // indirect +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..6c8407b --- /dev/null +++ b/go.sum @@ -0,0 +1,12 @@ +github.com/google/uuid v1.1.0 h1:Jf4mxPC/ziBnoPIdpQdPJ9OeiomAUHLvxmPRSPH9m4s= +github.com/google/uuid v1.1.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= +github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/spf13/cobra v0.0.3 h1:ZlrZ4XsMRm04Fr5pSFxBgfND2EBVa1nLpiy1stUsX/8= +github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= +github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg= +github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9 h1:mKdxBk7AujPs8kU4m80U72y/zjbZ3UcXC7dClwKbUI0= +golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/sys v0.0.0-20181211161752-7da8ea5c8182 h1:3jwI9dC+BuoXWS+QtR/HhfGTGTuB6ZzL6II6S1IuVvo= +golang.org/x/sys v0.0.0-20181211161752-7da8ea5c8182/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= diff --git a/gobusterdir/gobusterdir.go b/gobusterdir/gobusterdir.go index c4f75e7..fc22638 100644 --- a/gobusterdir/gobusterdir.go +++ b/gobusterdir/gobusterdir.go @@ -9,7 +9,7 @@ import ( "strings" "text/tabwriter" - "github.com/OJ/gobuster/libgobuster" + "github.com/OJ/gobuster/v3/libgobuster" "github.com/google/uuid" ) diff --git a/gobusterdir/helper_test.go b/gobusterdir/helper_test.go index f6c6659..b81acc3 100644 --- a/gobusterdir/helper_test.go +++ b/gobusterdir/helper_test.go @@ -4,7 +4,7 @@ import ( "reflect" "testing" - "github.com/OJ/gobuster/libgobuster" + "github.com/OJ/gobuster/v3/libgobuster" ) func TestParseExtensions(t *testing.T) { diff --git a/gobusterdir/options.go b/gobusterdir/options.go index 981188a..73a5672 100644 --- a/gobusterdir/options.go +++ b/gobusterdir/options.go @@ -3,7 +3,7 @@ package gobusterdir import ( "time" - "github.com/OJ/gobuster/libgobuster" + "github.com/OJ/gobuster/v3/libgobuster" ) // OptionsDir is the struct to hold all options for this plugin diff --git a/gobusterdns/gobusterdns.go b/gobusterdns/gobusterdns.go index 1f0dcea..41e9f4b 100644 --- a/gobusterdns/gobusterdns.go +++ b/gobusterdns/gobusterdns.go @@ -11,7 +11,7 @@ import ( "text/tabwriter" "time" - "github.com/OJ/gobuster/libgobuster" + "github.com/OJ/gobuster/v3/libgobuster" "github.com/google/uuid" ) diff --git a/main.go b/main.go index 98a9743..751c5fe 100644 --- a/main.go +++ b/main.go @@ -1,6 +1,6 @@ package main -import "github.com/OJ/gobuster/cli/cmd" +import "github.com/OJ/gobuster/v3/cli/cmd" //---------------------------------------------------- // Gobuster -- by OJ Reeves diff --git a/make.bat b/make.bat index 3b2936e..8a14c03 100644 --- a/make.bat +++ b/make.bat @@ -31,7 +31,13 @@ IF "%ARG%"=="linux" ( GOTO Done ) +IF "%ARG%"=="update" ( + CALL :Update + GOTO Done +) + IF "%ARG%"=="all" ( + CALL :Update CALL :Darwin CALL :Linux CALL :Windows @@ -45,9 +51,18 @@ IF "%ARG%"=="" ( GOTO Done +:Update +set GO111MODULE=on +echo Updating ... +go get -u +go mod tidy +echo Done. +EXIT /B 0 + :Darwin set GOOS=darwin set GOARCH=amd64 +set GO111MODULE=on echo Building for %GOOS% %GOARCH% ... set DIR=%TARGET%\gobuster-%GOOS%-%GOARCH% mkdir %DIR% 2> NUL @@ -63,6 +78,7 @@ EXIT /B 0 :Linux set GOOS=linux set GOARCH=amd64 +set GO111MODULE=on echo Building for %GOOS% %GOARCH% ... set DIR=%TARGET%\gobuster-%GOOS%-%GOARCH% mkdir %DIR% 2> NUL @@ -78,6 +94,7 @@ EXIT /B 0 :Windows set GOOS=windows set GOARCH=amd64 +set GO111MODULE=on echo Building for %GOOS% %GOARCH% ... set DIR=%TARGET%\gobuster-%GOOS%-%GOARCH% mkdir %DIR% 2> NUL @@ -90,4 +107,4 @@ go build %BUILDARGS% -o %DIR%\gobuster.exe echo Done. EXIT /B 0 -:Done +:Done \ No newline at end of file