From 8090182e1aae4d5307ed0532b3ddd46e609e8ce3 Mon Sep 17 00:00:00 2001 From: Gary Date: Fri, 5 Jun 2026 15:08:29 +1000 Subject: [PATCH] feat: Go project scaffolding - module init, directory structure, CLI skeleton, Makefile, CI Co-authored-by: multica-agent --- .github/workflows/ci.yml | 27 +++++++++++++++++++ Makefile | 19 +++++++++++++ README.md | 42 +++++++++++++++++++++++++++++ cmd/exploredns/main.go | 26 ++++++++++++++++++ go.mod | 12 +++++++++ go.sum | 12 +++++++++ internal/config/config.go | 1 + internal/dns/dns.go | 1 + internal/fingerprint/fingerprint.go | 1 + internal/output/output.go | 1 + internal/traverse/traverse.go | 1 + 11 files changed, 143 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 Makefile create mode 100644 cmd/exploredns/main.go create mode 100644 go.mod create mode 100644 go.sum create mode 100644 internal/config/config.go create mode 100644 internal/dns/dns.go create mode 100644 internal/fingerprint/fingerprint.go create mode 100644 internal/output/output.go create mode 100644 internal/traverse/traverse.go diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..67e8c51 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,27 @@ +name: CI + +on: + push: + branches: [main, master] + pull_request: + branches: [main, master] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-go@v5 + with: + go-version: '1.21' + cache: true + + - name: Vet + run: go vet ./... + + - name: Test + run: go test -v -race ./... + + - name: Build + run: go build -v ./... diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..db817b5 --- /dev/null +++ b/Makefile @@ -0,0 +1,19 @@ +BINARY_NAME=exploredns +BUILD_DIR=bin +GO=go +GOFLAGS=-v + +.PHONY: build test lint clean + +build: + $(GO) build $(GOFLAGS) -o $(BUILD_DIR)/$(BINARY_NAME) ./cmd/exploredns + +test: + $(GO) test -v -race -coverprofile=coverage.out ./... + +lint: + $(GO) vet ./... + +clean: + rm -rf $(BUILD_DIR) + rm -f coverage.out diff --git a/README.md b/README.md index f2b2511..107c448 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,44 @@ # ExploreDNS +DNS reconnaissance and exploration tool. + +## Build + +```sh +go build -o bin/exploredns ./cmd/exploredns +``` + +Or use the Makefile: + +```sh +make build +``` + +## Usage + +```sh +./bin/exploredns +``` + +## Development + +```sh +make test # run tests +make lint # run go vet +make clean # remove build artifacts +``` + +## Project Structure + +``` +cmd/exploredns/ CLI entry point +internal/dns/ DNS query operations +internal/traverse/ DNS tree traversal +internal/fingerprint/ DNS server fingerprinting +internal/output/ Result formatting and output +internal/config/ Configuration management +``` + +## License + +MIT diff --git a/cmd/exploredns/main.go b/cmd/exploredns/main.go new file mode 100644 index 0000000..cadef08 --- /dev/null +++ b/cmd/exploredns/main.go @@ -0,0 +1,26 @@ +package main + +import ( + "flag" + "fmt" + "os" +) + +func main() { + flag.Usage = func() { + fmt.Fprintf(os.Stderr, "ExploreDNS - DNS reconnaissance and exploration tool\n\n") + fmt.Fprintf(os.Stderr, "Usage:\n") + fmt.Fprintf(os.Stderr, " exploredns [flags] \n\n") + fmt.Fprintf(os.Stderr, "Flags:\n") + flag.PrintDefaults() + } + + flag.Parse() + + if flag.NArg() == 0 { + flag.Usage() + os.Exit(1) + } + + fmt.Printf("ExploreDNS - exploring: %s\n", flag.Arg(0)) +} diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..ac5579e --- /dev/null +++ b/go.mod @@ -0,0 +1,12 @@ +module github.com/hits/ExploreDNS + +go 1.25.6 + +require ( + github.com/miekg/dns v1.1.72 // indirect + golang.org/x/mod v0.31.0 // indirect + golang.org/x/net v0.48.0 // indirect + golang.org/x/sync v0.19.0 // indirect + golang.org/x/sys v0.39.0 // indirect + golang.org/x/tools v0.40.0 // indirect +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..6f633e8 --- /dev/null +++ b/go.sum @@ -0,0 +1,12 @@ +github.com/miekg/dns v1.1.72 h1:vhmr+TF2A3tuoGNkLDFK9zi36F2LS+hKTRW0Uf8kbzI= +github.com/miekg/dns v1.1.72/go.mod h1:+EuEPhdHOsfk6Wk5TT2CzssZdqkmFhf8r+aVyDEToIs= +golang.org/x/mod v0.31.0 h1:HaW9xtz0+kOcWKwli0ZXy79Ix+UW/vOfmWI5QVd2tgI= +golang.org/x/mod v0.31.0/go.mod h1:43JraMp9cGx1Rx3AqioxrbrhNsLl2l/iNAvuBkrezpg= +golang.org/x/net v0.48.0 h1:zyQRTTrjc33Lhh0fBgT/H3oZq9WuvRR5gPC70xpDiQU= +golang.org/x/net v0.48.0/go.mod h1:+ndRgGjkh8FGtu1w1FGbEC31if4VrNVMuKTgcAAnQRY= +golang.org/x/sync v0.19.0 h1:vV+1eWNmZ5geRlYjzm2adRgW2/mcpevXNg50YZtPCE4= +golang.org/x/sync v0.19.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI= +golang.org/x/sys v0.39.0 h1:CvCKL8MeisomCi6qNZ+wbb0DN9E5AATixKsvNtMoMFk= +golang.org/x/sys v0.39.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= +golang.org/x/tools v0.40.0 h1:yLkxfA+Qnul4cs9QA3KnlFu0lVmd8JJfoq+E41uSutA= +golang.org/x/tools v0.40.0/go.mod h1:Ik/tzLRlbscWpqqMRjyWYDisX8bG13FrdXp3o4Sr9lc= diff --git a/internal/config/config.go b/internal/config/config.go new file mode 100644 index 0000000..d912156 --- /dev/null +++ b/internal/config/config.go @@ -0,0 +1 @@ +package config diff --git a/internal/dns/dns.go b/internal/dns/dns.go new file mode 100644 index 0000000..1ffe03d --- /dev/null +++ b/internal/dns/dns.go @@ -0,0 +1 @@ +package dns diff --git a/internal/fingerprint/fingerprint.go b/internal/fingerprint/fingerprint.go new file mode 100644 index 0000000..f1b53d1 --- /dev/null +++ b/internal/fingerprint/fingerprint.go @@ -0,0 +1 @@ +package fingerprint diff --git a/internal/output/output.go b/internal/output/output.go new file mode 100644 index 0000000..ad89311 --- /dev/null +++ b/internal/output/output.go @@ -0,0 +1 @@ +package output diff --git a/internal/traverse/traverse.go b/internal/traverse/traverse.go new file mode 100644 index 0000000..5550fe0 --- /dev/null +++ b/internal/traverse/traverse.go @@ -0,0 +1 @@ +package traverse -- 2.54.0