Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ builds:
main: ./cmd/pphack/

archives:
- format: zip
- formats: [zip]
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ if eq .Os "darwin" }}macOS{{ else }}{{ .Os }}{{ end }}_{{ .Arch }}'

checksum:
Expand Down
49 changes: 37 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,29 +1,54 @@
REPO=github.com/edoardottt/pphack
# Makefile for pphack

REPO := github.com/edoardottt/pphack
BINARY_NAME := pphack
CMD_DIR := ./cmd/$(BINARY_NAME)
BIN_PATH := /usr/local/bin/$(BINARY_NAME)

.PHONY: all remod update lint build clean test install uninstall

all: build

remod:
@rm -rf go.*
@go mod init ${REPO}
@echo "Reinitializing Go module..."
@rm -f go.mod go.sum
@go mod init $(REPO)
@go get ./...
@go mod tidy -v
@echo "Done."
@echo "Go module reinitialized."

update:
@echo "Updating dependencies..."
@go get -u ./...
@go mod tidy -v
@echo "Done."
@echo "Dependencies updated."

lint:
@echo "Running linter..."
@golangci-lint run
@echo "Linting complete."

build:
@go build ./cmd/pphack/
@sudo mv pphack /usr/local/bin/
@echo "Done."
@echo "Building $(BINARY_NAME)..."
@go build -o $(BINARY_NAME) $(CMD_DIR)
@echo "Build complete."

clean:
@sudo rm -rf /usr/local/bin/pphack
@echo "Done."
install: build
@echo "Installing $(BINARY_NAME) to $(BIN_PATH)..."
@sudo mv $(BINARY_NAME) $(BIN_PATH)
@echo "Installed successfully."

uninstall:
@echo "Uninstalling $(BINARY_NAME) from $(BIN_PATH)..."
@sudo rm -f $(BIN_PATH)
@echo "Uninstalled."

test:
@echo "Running tests with race detector..."
@go test -race ./...
@echo "Done."
@echo "Tests complete."

clean:
@echo "Cleaning build artifacts..."
@rm -f $(BINARY_NAME)
@echo "Clean complete."
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Install 📡
go install github.com/edoardottt/pphack/cmd/pphack@latest
```

pphack relies on [`chromedp`](https://github.com/chromedp/chromedp), so you need a Chrome or Chromium browser.
pphack relies on [`chromedp`](https://github.com/chromedp/chromedp), so you need Chrome or Chromium-based browser.

Get Started 🎉
----------
Expand Down
29 changes: 13 additions & 16 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,20 @@ require (
github.com/edoardottt/golazy v0.1.4
github.com/projectdiscovery/goflags v0.1.74
github.com/projectdiscovery/gologger v1.1.54
github.com/projectdiscovery/utils v0.4.18
github.com/projectdiscovery/utils v0.4.19
github.com/stretchr/testify v1.10.0
go.uber.org/ratelimit v0.3.1
)

require (
github.com/STARRY-S/zip v0.2.1 // indirect
github.com/bodgit/plumbing v1.3.0 // indirect
github.com/bodgit/sevenzip v1.6.0 // indirect
github.com/bodgit/windows v1.0.1 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
github.com/mholt/archives v0.1.0 // indirect
github.com/nwaples/rardecode/v2 v2.0.0-beta.4.0.20241112120701-034e449c6e78 // indirect
github.com/sorairolake/lzip-go v0.3.5 // indirect
github.com/therootcompany/xz v1.0.1 // indirect
go4.org v0.0.0-20230225012048-214862532bf5 // indirect
golang.org/x/text v0.23.0 // indirect
)

require (
github.com/andybalholm/brotli v1.1.1 // indirect
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
github.com/aymerick/douceur v0.2.0 // indirect
github.com/benbjohnson/clock v1.3.5 // indirect
github.com/bodgit/plumbing v1.3.0 // indirect
github.com/bodgit/sevenzip v1.6.0 // indirect
github.com/bodgit/windows v1.0.1 // indirect
github.com/chromedp/cdproto v0.0.0-20250403032234-65de8f5d025b
github.com/chromedp/sysutil v1.1.0 // indirect
github.com/cnf/structhash v0.0.0-20201127153200-e1b16c1ebc08 // indirect
Expand All @@ -44,29 +32,38 @@ require (
github.com/gobwas/ws v1.4.0 // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
github.com/gorilla/css v1.0.1 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/compress v1.17.11 // indirect
github.com/klauspost/pgzip v1.2.6 // indirect
github.com/logrusorgru/aurora v2.0.3+incompatible // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mholt/archives v0.1.0 // indirect
github.com/microcosm-cc/bluemonday v1.0.27 // indirect
github.com/miekg/dns v1.1.63 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/nwaples/rardecode/v2 v2.0.0-beta.4.0.20241112120701-034e449c6e78 // indirect
github.com/pierrec/lz4/v4 v4.1.22 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/projectdiscovery/blackrock v0.0.1 // indirect
github.com/saintfish/chardet v0.0.0-20230101081208-5e3ef4b5456d // indirect
github.com/sorairolake/lzip-go v0.3.5 // indirect
github.com/therootcompany/xz v1.0.1 // indirect
github.com/tidwall/gjson v1.18.0 // indirect
github.com/tidwall/match v1.1.1 // indirect
github.com/tidwall/pretty v1.2.1 // indirect
github.com/ulikunitz/xz v0.5.12 // indirect
go4.org v0.0.0-20230225012048-214862532bf5 // indirect
golang.org/x/exp v0.0.0-20250207012021-f9890c6ad9f3 // indirect
golang.org/x/mod v0.23.0 // indirect
golang.org/x/net v0.38.0 // indirect
golang.org/x/sync v0.12.0 // indirect
golang.org/x/sys v0.31.0 // indirect
golang.org/x/text v0.23.0 // indirect
golang.org/x/tools v0.29.0 // indirect
gopkg.in/djherbis/times.v1 v1.3.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ github.com/projectdiscovery/goflags v0.1.74 h1:n85uTRj5qMosm0PFBfsvOL24I7TdWRcWq
github.com/projectdiscovery/goflags v0.1.74/go.mod h1:UMc9/7dFz2oln+10tv6cy+7WZKTHf9UGhaNkF95emh4=
github.com/projectdiscovery/gologger v1.1.54 h1:WMzvJ8j/4gGfPKpCttSTaYCVDU1MWQSJnk3wU8/U6Ws=
github.com/projectdiscovery/gologger v1.1.54/go.mod h1:vza/8pe2OKOt+ujFWncngknad1XWr8EnLKlbcejOyUE=
github.com/projectdiscovery/utils v0.4.18 h1:cSjMOLXI5gAajfA6KV+0iQG4dGx2IHWLQyND/Snvw7k=
github.com/projectdiscovery/utils v0.4.18/go.mod h1:y5gnpQn802iEWqf0djTRNskJlS62P5eqe1VS1+ah0tk=
github.com/projectdiscovery/utils v0.4.19 h1:rWOOTWUMQK9gvgH01rrw0qFi0hrh712hM1pCUzapCqA=
github.com/projectdiscovery/utils v0.4.19/go.mod h1:y5gnpQn802iEWqf0djTRNskJlS62P5eqe1VS1+ah0tk=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rwcarlsen/goexif v0.0.0-20190401172101-9e8deecbddbd/go.mod h1:hPqNNc0+uJM6H+SuU8sEs5K5IQeKccPqeSjfgcKGgPk=
Expand Down
9 changes: 5 additions & 4 deletions pkg/output/output.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,13 @@ func (o *Result) Printed(result string) bool {
return true
}

// JSONOutput checks and prints JSON output.
// JSONOutput marshals and prints the JSON output.
func JSONOutput(json *ResultData) {
o, err := FormatJSON(json)
data, err := FormatJSON(json)
if err != nil {
gologger.Error().Msg(err.Error())
} else {
fmt.Println(string(o))
return
}

fmt.Println(string(data))
}
Loading