Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 23 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,28 @@ GOBUILD=go build
DEPEND=github.com/Masterminds/glide

ifeq ($(OS),Windows_NT)
RM = rmdir /s /q build 2>nul
RM = rmdir /s /q build 2>nul
BUILD_WIN = set GOOS=windows; set GOARCH=amd64
BUILD_LINUX = set GOOS=linux; set GOARCH=amd64
BUILD_OSX = set GOOS=darwin; set GOARCH=amd64
BUILD_OSX_int = set GOOS=darwin; set GOARCH=amd64
BUILD_OSX_arm = set GOOS=darwin; set GOARCH=arm64
else
RM = rm -rf build/*
RM = rm -rf build/*
BUILD_WIN = GOOS=windows GOARCH=amd64
BUILD_LINUX = GOOS=linux GOARCH=amd64
BUILD_OSX = GOOS=darwin GOARCH=amd64
BUILD_OSX_int = GOOS=darwin GOARCH=amd64
BUILD_OSX_arm = GOOS=darwin GOARCH=arm64
endif

# Command to get glide, you need to run it only once
.PHONY: get_glide
get_glide:
go get -u -v $(DEPEND)
$(GOPATH)/bin/glide install
# Command to set up Go modules, you need to run it only once or when deps change
.PHONY: get_modules
get_modules:
go mod tidy

# Command to install dependencies using glide
# Command to install/download dependencies using Go modules
.PHONY: install_dependencies
install_dependencies:
glide install
go mod download

# Run tests in verbose mode with race detector and display coverage
.PHONY: test
Expand All @@ -45,11 +46,17 @@ _build_linux:
$(info * Building executable for linux x64 [$(SOURCE) -> build/linux_x64/$(NAME)])
@ $(@shell BUILD_LINUX) $(GOBUILD) -o build/linux_x64/$(NAME) $(SOURCE)

# Building osx binaries
.PHONY: _build_osx
_build_osx:
# Building intel-chip osx binaries
.PHONY: _build_osx_int
_build_osx_int:
$(info * Building executable for osx x64 [$(SOURCE) -> build/darwin_amd64/$(NAME)])
@ $(@shell BUILD_OSX) $(GOBUILD) -o build/darwin_amd64/$(NAME) $(SOURCE)
@ $(@shell BUILD_OSX_int) $(GOBUILD) -o build/darwin_amd64/$(NAME) $(SOURCE)

# Building arm-chip osx binaries
.PHONY: _build_osx_arm
_build_osx_arm:
$(info * Building executable for osx arm [$(SOURCE) -> build/darwin_arm64/$(NAME)])
@ $(@shell BUILD_OSX_arm) $(GOBUILD) -o build/darwin_arm64/$(NAME) $(SOURCE)

# Building windows binaries
.PHONY: _build_windows
Expand All @@ -59,7 +66,7 @@ _build_windows:

# Clean the build folder and then build executable for linux and osx
.PHONY: build
build: clean _build_windows _build_linux _build_osx
build: clean _build_windows _build_linux _build_osx_int _build_osx_arm

# Run the application
.PHONY: run
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ It supports a custom file extension ( `-ext`, default to `php` ) and other optio

## Compilation

go get github.com/evilsocket/dirsearch
go install github.com/evilsocket/dirsearch@latest
cd dirsearch
make get_glide
make get_modules
make install_dependencies
make build

Expand Down
15 changes: 15 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module cmd/dirsearch/main.go

go 1.25.0

require (
github.com/evilsocket/brutemachine v0.0.0-20170703145059-0331ad6a82ce
github.com/evilsocket/dirsearch v0.0.0-20210927162954-fe7fffa39084
github.com/fatih/color v1.18.0
)

require (
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
golang.org/x/sys v0.25.0 // indirect
)
15 changes: 15 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
github.com/evilsocket/brutemachine v0.0.0-20170703145059-0331ad6a82ce h1:LUfHM3hh98OzurXk5CF4PTCHFFACsAcBRgZmGkap6Z0=
github.com/evilsocket/brutemachine v0.0.0-20170703145059-0331ad6a82ce/go.mod h1:WnG+R/UHyKYQnmXaJ+L3DdZPf0yt36rxHw9dn3IQQeg=
github.com/evilsocket/dirsearch v0.0.0-20210927162954-fe7fffa39084 h1:/2XyOoAMZ0QK0nG54OIn0OWP6nNbitqph9ijP+LeK7Y=
github.com/evilsocket/dirsearch v0.0.0-20210927162954-fe7fffa39084/go.mod h1:nDVBqMyRMEARuuv/CZVRHsx2Vd3K6x19mAEa+GkWilI=
github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM=
github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU=
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34=
golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=