File tree 36 files changed +530
-220
lines changed
36 files changed +530
-220
lines changed Original file line number Diff line number Diff line change
1
+ name : Build
2
+
3
+ on :
4
+ push :
5
+ branches : [master, dev]
6
+ pull_request :
7
+ branches : [master, dev]
8
+
9
+ jobs :
10
+ build :
11
+ runs-on : ubuntu-latest
12
+ steps :
13
+ - uses : actions/checkout@v3
14
+
15
+ - name : Set up Go
16
+ uses : actions/setup-go@v4
17
+ with :
18
+ go-version : " 1.22"
19
+
20
+ - name : Get dependencies
21
+ run : go mod download
22
+
23
+ - name : Build
24
+ run : go build -v ./...
25
+
26
+ - name : Upload artifact
27
+ uses : actions/upload-artifact@v3
28
+ with :
29
+ name : http-scanner
30
+ path : ./http-scanner
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ name : Release
2
+
3
+ on :
4
+ push :
5
+ tags :
6
+ - " v*"
7
+
8
+ jobs :
9
+ goreleaser :
10
+ runs-on : ubuntu-latest
11
+ steps :
12
+ - name : Checkout
13
+ uses : actions/checkout@v3
14
+ with :
15
+ fetch-depth : 0
16
+
17
+ - name : Set up Go
18
+ uses : actions/setup-go@v4
19
+ with :
20
+ go-version : " 1.22"
21
+
22
+ - name : Run GoReleaser
23
+ uses : goreleaser/goreleaser-action@v4
24
+ with :
25
+ distribution : goreleaser
26
+ version : latest
27
+ args : release --clean
28
+ env :
29
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change
1
+ name : Test
2
+
3
+ on :
4
+ push :
5
+ branches : [master, dev]
6
+ pull_request :
7
+ branches : [master, dev]
8
+
9
+ jobs :
10
+ test :
11
+ runs-on : ubuntu-latest
12
+ steps :
13
+ - uses : actions/checkout@v3
14
+
15
+ - name : Set up Go
16
+ uses : actions/setup-go@v4
17
+ with :
18
+ go-version : " 1.22"
19
+
20
+ - name : Get dependencies
21
+ run : go mod download
22
+
23
+ - name : Run unit tests
24
+ run : go test -v ./tests/unit/...
25
+
26
+ - name : Run integration tests
27
+ run : go test -v ./tests/integration/...
28
+
29
+ - name : Generate test coverage
30
+ run : go test -coverprofile=coverage.out ./...
31
+
32
+ - name : Upload coverage reports to Codecov
33
+ uses : codecov/codecov-action@v3
34
+ with :
35
+ file : ./coverage.out
Original file line number Diff line number Diff line change
1
+ before :
2
+ hooks :
3
+ - go mod tidy
4
+
5
+ builds :
6
+ - env :
7
+ - CGO_ENABLED=0
8
+ goos :
9
+ - linux
10
+ - windows
11
+ - darwin
12
+ goarch :
13
+ - amd64
14
+ - arm64
15
+ main : ./main.go
16
+
17
+ archives :
18
+ - format_overrides :
19
+ - goos : windows
20
+ format : zip
21
+ name_template : >-
22
+ {{ .ProjectName }}_
23
+ {{- title .Os }}_
24
+ {{- if eq .Arch "amd64" }}x86_64
25
+ {{- else if eq .Arch "386" }}i386
26
+ {{- else }}{{ .Arch }}{{ end }}
27
+
28
+ checksum :
29
+ name_template : " checksums.txt"
30
+
31
+ snapshot :
32
+ name_template : " {{ incpatch .Version }}-next"
33
+
34
+ changelog :
35
+ sort : asc
36
+ filters :
37
+ exclude :
38
+ - " ^docs:"
39
+ - " ^test:"
40
+ - " ^ci:"
Original file line number Diff line number Diff line change
1
+ FROM golang:1.22-alpine AS builder
2
+ WORKDIR /app
3
+ COPY . .
4
+ RUN go mod download
5
+ RUN go build -o http-scanner .
6
+
7
+ FROM alpine:latest
8
+ RUN apk --no-cache add ca-certificates
9
+ WORKDIR /root/
10
+ COPY --from=builder /app/http-scanner .
11
+ COPY --from=builder /app/configs ./configs
12
+ ENTRYPOINT ["./http-scanner" ]
Original file line number Diff line number Diff line change
1
+ .PHONY : all build test test-unit test-integration lint clean
2
+
3
+ BINARY_NAME =http-scanner
4
+ GOFLAGS=-ldflags ="-s -w"
5
+
6
+ all : test build
7
+
8
+ build :
9
+ go build ${GOFLAGS} -o ${BINARY_NAME} ./main.go
10
+
11
+ test : test-unit test-integration
12
+
13
+ test-unit :
14
+ go test -v ./tests/unit/...
15
+
16
+ test-integration :
17
+ go test -v ./tests/integration/...
18
+
19
+ lint :
20
+ golangci-lint run ./...
21
+
22
+ clean :
23
+ rm -f ${BINARY_NAME}
24
+ go clean -cache
25
+
26
+
27
+ ci-test : test-unit test-integration
28
+
29
+
30
+ dev :
31
+ air -c .air.toml
32
+
33
+ cover :
34
+ go test -coverprofile=coverage ./...
35
+ go tool cover -html=coverage
Original file line number Diff line number Diff line change @@ -6,10 +6,10 @@ import (
6
6
"strings"
7
7
"time"
8
8
9
- "github.com/aymaneallaoui/go -http-scanner/internal/core"
10
- _ "github.com/aymaneallaoui/go -http-scanner/internal/modules"
11
- "github.com/aymaneallaoui/go -http-scanner/internal/output"
12
- "github.com/aymaneallaoui/go -http-scanner/pkg/utils"
9
+ "github.com/aymaneallaoui/kafka -http-scanner/internal/core"
10
+ _ "github.com/aymaneallaoui/kafka -http-scanner/internal/modules"
11
+ "github.com/aymaneallaoui/kafka -http-scanner/internal/output"
12
+ "github.com/aymaneallaoui/kafka -http-scanner/pkg/utils"
13
13
"github.com/spf13/cobra"
14
14
)
15
15
Original file line number Diff line number Diff line change 1
- module github.com/aymaneallaoui/go -http-scanner
1
+ module github.com/aymaneallaoui/kafka -http-scanner
2
2
3
3
go 1.22.4
4
4
5
- require github.com/sirupsen/logrus v1.9.3
6
-
7
5
require (
8
- github.com/inconshreveable/mousetrap v1.1.0 // indirect
9
- github.com/spf13/pflag v1.0.6 // indirect
6
+ github.com/spf13/cobra v1.9.1
7
+ github.com/stretchr/testify v1.7.0
10
8
)
11
9
12
10
require (
13
- github.com/spf13/cobra v1.9.1
11
+ github.com/davecgh/go-spew v1.1.1 // indirect
12
+ github.com/pmezard/go-difflib v1.0.0 // indirect
14
13
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8 // indirect
14
+ )
15
+
16
+ require (
17
+ github.com/inconshreveable/mousetrap v1.1.0 // indirect
18
+ github.com/sirupsen/logrus v1.9.3
19
+ github.com/spf13/pflag v1.0.6 // indirect
15
20
gopkg.in/yaml.v3 v3.0.1
16
21
)
Original file line number Diff line number Diff line change 8
8
"sync"
9
9
"time"
10
10
11
- customhttp "github.com/aymaneallaoui/go -http-scanner/internal/http"
12
- "github.com/aymaneallaoui/go -http-scanner/internal/model"
13
- "github.com/aymaneallaoui/go -http-scanner/internal/modules"
11
+ customhttp "github.com/aymaneallaoui/kafka -http-scanner/internal/http"
12
+ "github.com/aymaneallaoui/kafka -http-scanner/internal/model"
13
+ "github.com/aymaneallaoui/kafka -http-scanner/internal/modules"
14
14
"github.com/sirupsen/logrus"
15
15
)
16
16
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ import (
10
10
"strings"
11
11
"time"
12
12
13
- "github.com/aymaneallaoui/go -http-scanner/internal/model"
13
+ "github.com/aymaneallaoui/kafka -http-scanner/internal/model"
14
14
)
15
15
16
16
const (
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ package modules
3
3
import (
4
4
"strings"
5
5
6
- "github.com/aymaneallaoui/go -http-scanner/internal/model"
6
+ "github.com/aymaneallaoui/kafka -http-scanner/internal/model"
7
7
)
8
8
9
9
type ClickjackingModule struct {}
Original file line number Diff line number Diff line change 4
4
"fmt"
5
5
"strings"
6
6
7
- "github.com/aymaneallaoui/go -http-scanner/internal/model"
7
+ "github.com/aymaneallaoui/kafka -http-scanner/internal/model"
8
8
)
9
9
10
10
type ContentSecurityModule struct {}
Original file line number Diff line number Diff line change 6
6
"strings"
7
7
"time"
8
8
9
- "github.com/aymaneallaoui/go -http-scanner/internal/model"
9
+ "github.com/aymaneallaoui/kafka -http-scanner/internal/model"
10
10
)
11
11
12
12
type CookieSecurityModule struct {}
Original file line number Diff line number Diff line change 4
4
"fmt"
5
5
"strings"
6
6
7
- "github.com/aymaneallaoui/go -http-scanner/internal/model"
7
+ "github.com/aymaneallaoui/kafka -http-scanner/internal/model"
8
8
)
9
9
10
10
type CORSMisconfigurationModule struct {}
Original file line number Diff line number Diff line change 7
7
"regexp"
8
8
"strings"
9
9
10
- "github.com/aymaneallaoui/go -http-scanner/internal/model"
10
+ "github.com/aymaneallaoui/kafka -http-scanner/internal/model"
11
11
)
12
12
13
13
type DirectoryTraversalModule struct {}
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ package modules
3
3
import (
4
4
"fmt"
5
5
6
- "github.com/aymaneallaoui/go -http-scanner/internal/model"
6
+ "github.com/aymaneallaoui/kafka -http-scanner/internal/model"
7
7
)
8
8
9
9
type HeaderSecurityModule struct {}
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ package modules
3
3
import (
4
4
"strings"
5
5
6
- "github.com/aymaneallaoui/go -http-scanner/internal/model"
6
+ "github.com/aymaneallaoui/kafka -http-scanner/internal/model"
7
7
)
8
8
9
9
type HTTPSmugglingModule struct {}
Original file line number Diff line number Diff line change 4
4
"io"
5
5
"net/http"
6
6
7
- "github.com/aymaneallaoui/go -http-scanner/internal/model"
7
+ "github.com/aymaneallaoui/kafka -http-scanner/internal/model"
8
8
"github.com/sirupsen/logrus"
9
9
)
10
10
Original file line number Diff line number Diff line change @@ -35,3 +35,10 @@ func GetModules() []ScanModule {
35
35
36
36
return result
37
37
}
38
+
39
+ func ResetModuleRegistry () {
40
+ modulesMu .Lock ()
41
+ defer modulesMu .Unlock ()
42
+
43
+ modules = make (map [string ]ScanModule )
44
+ }
Original file line number Diff line number Diff line change 7
7
"strings"
8
8
"time"
9
9
10
- "github.com/aymaneallaoui/go -http-scanner/internal/model"
10
+ "github.com/aymaneallaoui/kafka -http-scanner/internal/model"
11
11
)
12
12
13
13
type ServerInfoLeakageModule struct {}
Original file line number Diff line number Diff line change 8
8
"strings"
9
9
"time"
10
10
11
- "github.com/aymaneallaoui/go -http-scanner/internal/model"
11
+ "github.com/aymaneallaoui/kafka -http-scanner/internal/model"
12
12
)
13
13
14
14
type SQLInjectionModule struct {}
Original file line number Diff line number Diff line change 5
5
"net"
6
6
"time"
7
7
8
- "github.com/aymaneallaoui/go -http-scanner/internal/model"
8
+ "github.com/aymaneallaoui/kafka -http-scanner/internal/model"
9
9
)
10
10
11
11
type SSLTLSSecurityModule struct {}
Original file line number Diff line number Diff line change 6
6
"net/url"
7
7
"strings"
8
8
9
- "github.com/aymaneallaoui/go -http-scanner/internal/model"
9
+ "github.com/aymaneallaoui/kafka -http-scanner/internal/model"
10
10
)
11
11
12
12
type XSSVulnerabilityModule struct {}
You can’t perform that action at this time.
0 commit comments