● Notice //GitHub (@shehzade) is temporarily suspended pending an automated false-positive review. All tools are hosted on this Code Mirror and available on request (contact); GitHub links will return once reinstated.
PUBLIC MIRRORGo v1.0

Multi-protocol network egress assessment and DLP verification framework featuring automated L4 sweeps, corporate proxy traversal, and covert protocol smuggling across 20+ channels.

$ git clone https://shehzade.io/repos/contraband.git Copy
Source ZIP (1.93 MB)
Code 174 Commits 1
contraband / Makefile
← Back to directory
80 lines · 3.1 KB
Raw
1# Contraband Egress Assessment Framework Makefile
2# Pure-Go static compilation under CGO_ENABLED=0
3
4MODULE := github.com/shehzade/contraband
5BINARY_NAME := contraband
6BIN_DIR := bin
7
8# Build Metadata
9VERSION ?= 1.0.0
10COMMIT ?= standalone
11BUILD_DATE ?= $(shell date -u +%Y-%m-%dT%H:%M:%SZ)
12BUILT_BY ?= shehzade
13
14# Static linker flags
15LDFLAGS := -s -w \
16 -X '$(MODULE)/pkg/common.Version=$(VERSION)' \
17 -X '$(MODULE)/pkg/common.Commit=$(COMMIT)' \
18 -X '$(MODULE)/pkg/common.BuildDate=$(BUILD_DATE)' \
19 -X '$(MODULE)/pkg/common.BuiltBy=$(BUILT_BY)'
20
21# Build command template
22BUILD_CMD = CGO_ENABLED=0 go build -trimpath -ldflags="$(LDFLAGS)"
23
24PLATFORMS := linux/amd64 linux/arm64 windows/amd64 windows/arm64 darwin/amd64 darwin/arm64
25COMMANDS := contraband contraband-client contraband-server
26
27.PHONY: all build build-all clean vet lint tidy help wiki-push
28
29all: build
30
31help:
32 @echo "Contraband Build System"
33 @echo " make build - Compile native static binaries for current platform (contraband, client, server)"
34 @echo " make build-all - Cross-compile all 18 static binaries for Linux, Windows, macOS (amd64/arm64)"
35 @echo " make vet - Run go vet static analysis"
36 @echo " make tidy - Run go mod tidy"
37 @echo " make clean - Remove compiled binaries and artifacts"
38
39build:
40 @mkdir -p $(BIN_DIR)
41 $(BUILD_CMD) -o $(BIN_DIR)/contraband ./cmd/contraband
42 $(BUILD_CMD) -o $(BIN_DIR)/contraband-client ./cmd/contraband-client
43 $(BUILD_CMD) -o $(BIN_DIR)/contraband-server ./cmd/contraband-server
44 @echo "[+] Successfully built native binaries in $(BIN_DIR)/"
45
46build-all:
47 @mkdir -p $(BIN_DIR)
48 @echo "[*] Cross-compiling 18 static pure-Go binaries across 6 OS/ARCH targets..."
49 @for target in linux/amd64 linux/arm64 windows/amd64 windows/arm64 darwin/amd64 darwin/arm64; do \
50 os=$${target%/*}; \
51 arch=$${target#*/}; \
52 ext=""; \
53 if [ "$$os" = "windows" ]; then ext=".exe"; fi; \
54 echo " -> Building contraband ($$os/$$arch)..."; \
55 CGO_ENABLED=0 GOOS=$$os GOARCH=$$arch $(BUILD_CMD) -o $(BIN_DIR)/contraband-$$os-$$arch$$ext ./cmd/contraband || exit 1; \
56 echo " -> Building contraband-client ($$os/$$arch)..."; \
57 CGO_ENABLED=0 GOOS=$$os GOARCH=$$arch $(BUILD_CMD) -o $(BIN_DIR)/contraband-client-$$os-$$arch$$ext ./cmd/contraband-client || exit 1; \
58 echo " -> Building contraband-server ($$os/$$arch)..."; \
59 CGO_ENABLED=0 GOOS=$$os GOARCH=$$arch $(BUILD_CMD) -o $(BIN_DIR)/contraband-server-$$os-$$arch$$ext ./cmd/contraband-server || exit 1; \
60 done
61 @cp $(BIN_DIR)/contraband-linux-amd64 $(BIN_DIR)/contraband
62 @cp $(BIN_DIR)/contraband-client-linux-amd64 $(BIN_DIR)/contraband-client
63 @cp $(BIN_DIR)/contraband-server-linux-amd64 $(BIN_DIR)/contraband-server
64 @echo "[+] All 18 platform binaries compiled successfully in $(BIN_DIR)/"
65
66vet:
67 go vet ./...
68
69tidy:
70 go mod tidy
71
72clean:
73 rm -rf $(BIN_DIR)
74 @echo "[+] Cleaned $(BIN_DIR)"
75
76wiki-push:
77 @echo "[*] Syncing docs/wiki to GitHub Wiki..."
78 @bash -c 'if [ -d docs/wiki ]; then \
79 echo "[+] docs/wiki is ready. To push to GitHub Wiki: git subtree push --prefix docs/wiki origin wiki"; \
80 fi'