diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 0000000..078c47a --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,60 @@ +before: + hooks: + - go mod tidy + - go generate ./... +builds: + - + env: + - CGO_ENABLED=0 + ldflags: + - -s -w -X "github.com/RumbleDiscovery/jarm-go/cmd/jarmscan/main.Version={{.Version}}" + gcflags: + - all=-trimpath={{.Env.GOPATH}} + asmflags: + - all=-trimpath={{.Env.GOPATH}} + goos: + - windows + - linux + - darwin + - freebsd + goarch: + - amd64 + - 386 + - arm + - arm64 + goarm: + - 5 + - 6 + - 7 + ignore: + - goos: darwin + goarch: 386 + - goos: darwin + goarch: arm + - goos: darwin + goarch: arm64 + - goos: freebsd + goarch: arm + - goos: freebsd + goarch: arm64 +signs: + - artifacts: checksum +archives: +- replacements: + darwin: macos + 386: x86 + arm64: aarch64 + format: binary + files: + - none* + name_template: "jarmscan-{{ .Os }}-{{ .Arch }}{{.Arm}}" +checksum: + name_template: 'checksums.txt' +snapshot: + name_template: "{{ .Tag }}-next" +changelog: + sort: asc + filters: + exclude: + - '^docs:' + - '^test:' diff --git a/README.md b/README.md index 775d10b..f4adb19 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,29 @@ # jarm-go -This is a Go implementation of [JARM](https://github.com/salesforce/jarm). \ No newline at end of file +This is a Go implementation of [JARM](https://github.com/salesforce/jarm). + +# jarmscan + +To install jarmscan, download a binary from the releases page or install using `go get github.com/RumbleDiscovery/jarm-go/cmd/jarmscan`. + +To run a scan, provide a list of targets. The following examples are all supported: + +* `jarmscan www.rumble.run` +* `jarmscan -p 443,8443 192.168.0.1` +* `jarmscan -p 1-1024 https://www.example.com/` +* `jarmscan -p 443,465,993,995,8443,9443 192.168.0.0/24` +* `jarmscan -p 192.168.0.1:8443` +* `jarmscan -p 192.168.0.1,443` + +# jarm + +To use the jarm-go library from a Go application please review the `Fingerprint()` function in the `cmd/jarmscan/main.go` code. + +The basic process involves: + +* Creating a list of probes for a given host and port using `GetProbes()`. The host is sent as part of the client probe. +* Building each individual probe in the order they are returned using `BuildProbe()`. +* Opening a connection to the host and port and sending the probe. +* Receiving the response (up to 1484 bytes). Receiving more or less can change the hash. +* Parsing the Server Hello from the received data using `ParseServerHello()`. +* Calculating the JARM hash using `RawHashToFuzzyHash()`. \ No newline at end of file diff --git a/cmd/jarmscan/main.go b/cmd/jarmscan/main.go index 464a43f..3e4a915 100644 --- a/cmd/jarmscan/main.go +++ b/cmd/jarmscan/main.go @@ -17,6 +17,9 @@ import ( "github.com/RumbleDiscovery/rumble-tools/pkg/rnd" ) +// Version is set by the goreleaser build +var Version = "dev" + var defaultPorts = flag.String("p", "443", "default ports") var workerCount = flag.Int("w", 256, "worker count") var quietMode = flag.Bool("q", false, "quiet mode")