File tree 6 files changed +132
-13
lines changed
6 files changed +132
-13
lines changed Original file line number Diff line number Diff line change @@ -25,4 +25,5 @@ _testmain.go
25
25
* .txt
26
26
* .swp
27
27
28
- gobuster
28
+ gobuster
29
+ build
Original file line number Diff line number Diff line change
1
+ TARGET =./build
2
+ OSES =darwin linux windows
3
+ ARCHS =amd64 386
4
+
5
+ current : outputdir
6
+ @go build -o ./gobuster; \
7
+ echo " Done."
8
+
9
+ outputdir :
10
+ @mkdir -p ${TARGET}
11
+
12
+ windows : outputdir
13
+ @for GOARCH in ${ARCHS} ; do \
14
+ echo " Building for windows $$ {GOARCH} ..." ; \
15
+ GOOS=windows GARCH=$$ {GOARCH} go build -o ${TARGET} /gobuster-$$ {GOARCH}.exe ; \
16
+ done ; \
17
+ echo " Done."
18
+
19
+ linux : outputdir
20
+ @for GOARCH in ${ARCHS} ; do \
21
+ echo " Building for linux $$ {GOARCH} ..." ; \
22
+ GOOS=linux GARCH=$$ {GOARCH} go build -o ${TARGET} /gobuster-linux-$$ {GOARCH} ; \
23
+ done ; \
24
+ echo " Done."
25
+
26
+ darwin : outputdir
27
+ @for GOARCH in ${ARCHS} ; do \
28
+ echo " Building for darwin $$ {GOARCH} ..." ; \
29
+ GOOS=darwin GARCH=$$ {GOARCH} go build -o ${TARGET} /gobuster-darwin-$$ {GOARCH} ; \
30
+ done ; \
31
+ echo " Done."
32
+
33
+
34
+ all : darwin linux windows
35
+
36
+ test :
37
+ @go test -v -race ./... ; \
38
+ echo " Done."
39
+
40
+ clean :
41
+ @rm -rf ${TARGET} /* ; \
42
+ echo " Done."
Original file line number Diff line number Diff line change @@ -78,6 +78,14 @@ This will create a `gobuster` binary for you. If you want to install it in the `
78
78
```
79
79
gobuster $ go install
80
80
```
81
+ If you have all the dependencies already, you can make use of the build scripts:
82
+ * ` make ` - builds for the current Go configuration (ie. runs ` go build ` ).
83
+ * ` make windows ` - builds 32 and 64 bit binaries for windows, and writes them to the ` build ` subfolder.
84
+ * ` make linux ` - builds 32 and 64 bit binaries for linux, and writes them to the ` build ` subfolder.
85
+ * ` make darwin ` - builds 32 and 64 bit binaries for darwin, and writes them to the ` build ` subfolder.
86
+ * ` make all ` - builds for all platforms and architectures, and writes the resulting binaries to the ` build ` subfolder.
87
+ * ` make clean ` - clears out the ` build ` subfolder.
88
+ * ` make test ` - runs the tests (requires you to ` go get githubcom/h2non/gock ` first).
81
89
82
90
#### Running as a script
83
91
```
Original file line number Diff line number Diff line change
1
+ @ echo off
2
+
3
+ SET ARG = %1
4
+ SET TARGET = .\build
5
+
6
+ IF " %ARG% " == " test" (
7
+ go test -v -race ./...
8
+ echo Done.
9
+ GOTO Done
10
+ )
11
+
12
+ IF " %ARG% " == " clean" (
13
+ del /F /Q %TARGET% \*.*
14
+ echo Done.
15
+ GOTO Done
16
+ )
17
+
18
+ IF " %ARG% " == " windows" (
19
+ CALL :Windows
20
+ GOTO Done
21
+ )
22
+
23
+ IF " %ARG% " == " darwin" (
24
+ CALL :Darwin
25
+ GOTO Done
26
+ )
27
+
28
+ IF " %ARG% " == " linux" (
29
+ CALL :Linux
30
+ GOTO Done
31
+ )
32
+
33
+ IF " %ARG% " == " all" (
34
+ CALL :Darwin
35
+ CALL :Linux
36
+ CALL :Windows
37
+ GOTO Done
38
+ )
39
+
40
+ IF " %ARG% " == " " (
41
+ go build -o .\gobuster.exe
42
+ GOTO Done
43
+ )
44
+
45
+ GOTO Done
46
+
47
+ :Darwin
48
+ set GOOS = darwin
49
+ set GOARCH = amd64
50
+ echo Building for %GOOS% %GOARCH% ...
51
+ go build -o %TARGET% \gobuster-%GOOS% -%GOARCH%
52
+ set GOARCH = 386
53
+ echo Building for %GOOS% %GOARCH% ...
54
+ go build -o %TARGET% \gobuster-%GOOS% -%GOARCH%
55
+ echo Done.
56
+ EXIT /B 0
57
+
58
+ :Linux
59
+ set GOOS = linux
60
+ set GOARCH = amd64
61
+ echo Building for %GOOS% %GOARCH% ...
62
+ go build -o %TARGET% \gobuster-%GOOS% -%GOARCH%
63
+ set GOARCH = 386
64
+ echo Building for %GOOS% %GOARCH% ...
65
+ go build -o %TARGET% \gobuster-%GOOS% -%GOARCH%
66
+ echo Done.
67
+ EXIT /B 0
68
+
69
+ :Windows
70
+ set GOOS = windows
71
+ set GOARCH = amd64
72
+ echo Building for %GOOS% %GOARCH% ...
73
+ go build -o %TARGET% \gobuster-%GOARCH% .exe
74
+ set GOARCH = 386
75
+ echo Building for %GOOS% %GOARCH% ...
76
+ go build -o %TARGET% \gobuster-%GOARCH% .exe
77
+ echo Done.
78
+ EXIT /B 0
79
+
80
+ :Done
Load Diff This file was deleted.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments