Skip to content

Commit 801b787

Browse files
authored
Merge pull request #1523 from projectdiscovery/dev
bug fixes
2 parents 5ff6c14 + 92a1069 commit 801b787

38 files changed

+2357
-407
lines changed

.github/dependabot.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ updates:
1919
- "Type: Maintenance"
2020
allow:
2121
- dependency-name: "github.com/projectdiscovery/*"
22+
groups:
23+
projectdiscovery:
24+
patterns:
25+
- "github.com/projectdiscovery/*"
2226

2327
# Maintain dependencies for docker
2428
- package-ecosystem: "docker"
@@ -31,6 +35,10 @@ updates:
3135
include: "scope"
3236
labels:
3337
- "Type: Maintenance"
38+
groups:
39+
docker-dependencies:
40+
patterns:
41+
- "*"
3442

3543
# Maintain dependencies for GitHub Actions
3644
- package-ecosystem: "github-actions"
@@ -42,4 +50,8 @@ updates:
4250
prefix: "chore"
4351
include: "scope"
4452
labels:
45-
- "Type: Maintenance"
53+
- "Type: Maintenance"
54+
groups:
55+
github-actions:
56+
patterns:
57+
- "*"

.github/workflows/lint-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
run: sudo apt install libpcap-dev
2525

2626
- name: Run golangci-lint
27-
uses: golangci/golangci-lint-action@v6.2.0
27+
uses: golangci/golangci-lint-action@v7.0.0
2828
with:
2929
version: latest
3030
args: --timeout 5m

.github/workflows/release-binary.yml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,29 @@ jobs:
4646
uses: goreleaser/goreleaser-action@v6
4747
with:
4848
version: latest
49-
args: release -f .goreleaser/linux.yml --clean
49+
args: release -f .goreleaser/linux-amd64.yml --clean
50+
workdir: /
51+
52+
build-linux-arm64:
53+
runs-on: ubuntu-24.04-arm
54+
steps:
55+
- name: Code checkout
56+
uses: actions/checkout@v4
57+
with:
58+
fetch-depth: 0
59+
- name: Set up Go
60+
uses: actions/setup-go@v5
61+
with:
62+
go-version: 1.21.x
63+
- name: Install Dependences
64+
run: sudo apt install libpcap-dev
65+
66+
- name: Run GoReleaser
67+
uses: goreleaser/goreleaser-action@v6
68+
with:
69+
version: latest
70+
args: release -f .goreleaser/linux-arm64.yml --clean
71+
workdir: /
5072
env:
5173
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
5274
SLACK_WEBHOOK: "${{ secrets.RELEASE_SLACK_WEBHOOK }}"

.goreleaser/linux-amd64.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
env:
2+
- GO111MODULE=on
3+
before:
4+
hooks:
5+
- go mod tidy
6+
project_name: naabu
7+
builds:
8+
- id: naabu-linux-amd64
9+
ldflags:
10+
- -s -w
11+
binary: naabu
12+
env:
13+
- CGO_ENABLED=1
14+
main: ./cmd/naabu/main.go
15+
goos:
16+
- linux
17+
goarch:
18+
- amd64
19+
20+
archives:
21+
- format: zip
22+
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ if eq .Os "darwin" }}macOS{{ else }}{{ .Os }}{{ end }}_{{ .Arch }}'
23+
24+
checksum:
25+
name_template: "{{ .ProjectName }}-linux-amd64-checksums.txt"
26+
27+
announce:
28+
slack:
29+
enabled: true
30+
channel: '#release'
31+
username: GoReleaser
32+
message_template: 'New Release: {{ .ProjectName }} {{.Tag}} is published! Check it out at {{ .ReleaseURL }}'
33+
34+
discord:
35+
enabled: true
36+
message_template: '**New Release: {{ .ProjectName }} {{.Tag}}** is published! Check it out at {{ .ReleaseURL }}'

.goreleaser/linux-arm64.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
env:
2+
- GO111MODULE=on
3+
before:
4+
hooks:
5+
- go mod tidy
6+
project_name: naabu
7+
builds:
8+
- id: naabu-linux-arm64
9+
ldflags:
10+
- -s -w
11+
binary: naabu
12+
env:
13+
- CGO_ENABLED=1
14+
main: ./cmd/naabu/main.go
15+
goos:
16+
- linux
17+
goarch:
18+
- arm64
19+
20+
archives:
21+
- format: zip
22+
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ if eq .Os "darwin" }}macOS{{ else }}{{ .Os }}{{ end }}_{{ .Arch }}'
23+
24+
checksum:
25+
name_template: "{{ .ProjectName }}-linux-arm64-checksums.txt"
26+
27+
announce:
28+
slack:
29+
enabled: false
30+
channel: '#release'
31+
username: GoReleaser
32+
message_template: 'New Release: {{ .ProjectName }} {{.Tag}} is published! Check it out at {{ .ReleaseURL }}'
33+
34+
discord:
35+
enabled: false
36+
message_template: '**New Release: {{ .ProjectName }} {{.Tag}}** is published! Check it out at {{ .ReleaseURL }}'

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# Build
2-
FROM golang:1.23.5-alpine AS build-env
2+
FROM golang:1.24.5-alpine AS build-env
33
RUN apk add --no-cache build-base libpcap-dev
44
WORKDIR /app
55
COPY . /app
66
RUN go mod download
77
RUN go build ./cmd/naabu
88

99
# Release
10-
FROM alpine:3.21.2
10+
FROM alpine:3.22.0
1111
RUN apk upgrade --no-cache \
1212
&& apk add --no-cache nmap libpcap-dev bind-tools ca-certificates nmap-scripts
1313
COPY --from=build-env /app/naabu /usr/local/bin/

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,15 @@ DEBUG:
134134
-stats display stats of the running scan (deprecated)
135135
-si, -stats-interval int number of seconds to wait between showing a statistics update (deprecated) (default 5)
136136
-mp, -metrics-port int port to expose naabu metrics on (default 63636)
137+
138+
CLOUD:
139+
-auth configure projectdiscovery cloud (pdcp) api key (default true)
140+
-ac, -auth-config string configure projectdiscovery cloud (pdcp) api key credential file
141+
-pd, -dashboard upload / view output in projectdiscovery cloud (pdcp) UI dashboard
142+
-tid, -team-id string upload asset results to given team id (optional)
143+
-aid, -asset-id string upload new assets to existing asset id (optional)
144+
-aname, -asset-name string assets group name to set (optional)
145+
-pdu, -dashboard-upload string upload naabu output file (jsonl) in projectdiscovery cloud (pdcp) UI dashboard
137146
```
138147

139148
# Installation Instructions

cmd/functional-test/main.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,11 @@ func runFunctionalTests() error {
4141
if err != nil {
4242
return errors.Wrap(err, "could not open test cases")
4343
}
44-
defer file.Close()
44+
defer func() {
45+
if err := file.Close(); err != nil {
46+
log.Printf("could not close test cases file: %s\n", err)
47+
}
48+
}()
4549

4650
scanner := bufio.NewScanner(file)
4751
for scanner.Scan() {

cmd/integration-test/library.go

Lines changed: 39 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package main
33
import (
44
"context"
55
"errors"
6+
"log"
67
"os"
78
"os/user"
89
"time"
@@ -32,7 +33,11 @@ func (h *naabuPassiveSingleLibrary) Execute() error {
3233
if err != nil {
3334
return err
3435
}
35-
defer os.RemoveAll(testFile)
36+
defer func() {
37+
if err := os.RemoveAll(testFile); err != nil {
38+
log.Printf("could not remove test file: %s\n", err)
39+
}
40+
}()
3641

3742
options := runner.Options{
3843
HostsFile: testFile,
@@ -45,7 +50,11 @@ func (h *naabuPassiveSingleLibrary) Execute() error {
4550
if err != nil {
4651
return err
4752
}
48-
defer naabuRunner.Close()
53+
defer func() {
54+
if err := naabuRunner.Close(); err != nil {
55+
log.Printf("could not close naabu runner: %s\n", err)
56+
}
57+
}()
4958

5059
return naabuRunner.RunEnumeration(context.TODO())
5160
}
@@ -65,7 +74,11 @@ func (h *naabuSingleLibrary) Execute() error {
6574
if err != nil {
6675
return err
6776
}
68-
defer os.RemoveAll(testFile)
77+
defer func() {
78+
if err := os.RemoveAll(testFile); err != nil {
79+
log.Printf("could not remove test file: %s\n", err)
80+
}
81+
}()
6982

7083
var got bool
7184

@@ -83,7 +96,11 @@ func (h *naabuSingleLibrary) Execute() error {
8396
if err != nil {
8497
return err
8598
}
86-
defer naabuRunner.Close()
99+
defer func() {
100+
if err := naabuRunner.Close(); err != nil {
101+
log.Printf("could not close naabu runner: %s\n", err)
102+
}
103+
}()
87104

88105
if err = naabuRunner.RunEnumeration(context.TODO()); err != nil {
89106
return err
@@ -110,7 +127,11 @@ func (h *naabuMultipleExecLibrary) Execute() error {
110127
if err != nil {
111128
return err
112129
}
113-
defer os.RemoveAll(testFile)
130+
defer func() {
131+
if err := os.RemoveAll(testFile); err != nil {
132+
log.Printf("could not remove test file: %s\n", err)
133+
}
134+
}()
114135

115136
var got bool
116137

@@ -136,7 +157,9 @@ func (h *naabuMultipleExecLibrary) Execute() error {
136157
if !got {
137158
return errors.New("no results found")
138159
}
139-
naabuRunner.Close()
160+
if err := naabuRunner.Close(); err != nil {
161+
log.Printf("could not close naabu runner: %s\n", err)
162+
}
140163
}
141164
return nil
142165
}
@@ -165,7 +188,11 @@ func (h *naabuWithSocks5) Execute() error {
165188
if err != nil {
166189
return err
167190
}
168-
defer os.RemoveAll(testFile)
191+
defer func() {
192+
if err := os.RemoveAll(testFile); err != nil {
193+
log.Printf("could not remove test file: %s\n", err)
194+
}
195+
}()
169196

170197
var got bool
171198

@@ -186,7 +213,11 @@ func (h *naabuWithSocks5) Execute() error {
186213
if err != nil {
187214
return err
188215
}
189-
defer naabuRunner.Close()
216+
defer func() {
217+
if err := naabuRunner.Close(); err != nil {
218+
log.Printf("could not close naabu runner: %s\n", err)
219+
}
220+
}()
190221

191222
if err = naabuRunner.RunEnumeration(context.TODO()); err != nil {
192223
return err

0 commit comments

Comments
 (0)