mirror of
https://github.com/OJ/gobuster.git
synced 2024-04-25 07:05:01 +02:00
Cherry-picked the gomodules code from #117
This was cherry-picked from the gomod branch instead of being merged as a PR for two reasons: 1) The vhost plugin addition isn't yet ready for merging, as there's a lot of code duplication. 2) This code can technically be merged as is without the mods to the vhost plugin. When/If we're ready to merge the vhost plugin we'll fix that side up.
This commit is contained in:
parent
be173ed8ec
commit
6a2b40ff86
|
@ -4,6 +4,7 @@ go:
|
|||
- "1.x"
|
||||
- "1.8"
|
||||
- "1.10.x"
|
||||
- "1.11.x"
|
||||
- master
|
||||
|
||||
script: make test
|
13
Makefile
13
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 ./... ; \
|
||||
|
|
|
@ -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"
|
||||
)
|
||||
|
|
|
@ -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"
|
||||
)
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ import (
|
|||
"log"
|
||||
"os"
|
||||
|
||||
"github.com/OJ/gobuster/libgobuster"
|
||||
"github.com/OJ/gobuster/v3/libgobuster"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
|
|
@ -9,7 +9,7 @@ import (
|
|||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/OJ/gobuster/libgobuster"
|
||||
"github.com/OJ/gobuster/v3/libgobuster"
|
||||
)
|
||||
|
||||
func ruler() {
|
||||
|
|
|
@ -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
|
||||
)
|
|
@ -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=
|
|
@ -9,7 +9,7 @@ import (
|
|||
"strings"
|
||||
"text/tabwriter"
|
||||
|
||||
"github.com/OJ/gobuster/libgobuster"
|
||||
"github.com/OJ/gobuster/v3/libgobuster"
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ import (
|
|||
"reflect"
|
||||
"testing"
|
||||
|
||||
"github.com/OJ/gobuster/libgobuster"
|
||||
"github.com/OJ/gobuster/v3/libgobuster"
|
||||
)
|
||||
|
||||
func TestParseExtensions(t *testing.T) {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -11,7 +11,7 @@ import (
|
|||
"text/tabwriter"
|
||||
"time"
|
||||
|
||||
"github.com/OJ/gobuster/libgobuster"
|
||||
"github.com/OJ/gobuster/v3/libgobuster"
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
|
|
2
main.go
2
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
|
||||
|
|
19
make.bat
19
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
|
Loading…
Reference in New Issue