Skip to content

Commit e1f7073

Browse files
committed
update Dockerfile with tool for the recon
1 parent 1260c99 commit e1f7073

3 files changed

Lines changed: 83 additions & 6 deletions

File tree

Dockerfile

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,50 @@ FROM golang:1.24 AS go_builder
33
WORKDIR /build
44

55
COPY go.mod ./
6-
76
RUN go mod download
87

98
COPY . .
109

11-
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o api-fuzz
10+
RUN apt-get update && apt-get install -y libpcap-dev
11+
# Compile ton propre outil
12+
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o /build/api-fuzz
13+
14+
# Installer les outils Go dans /go/bin
15+
RUN go install github.com/projectdiscovery/subfinder/v2/cmd/subfinder@latest
16+
RUN go install github.com/projectdiscovery/naabu/v2/cmd/naabu@latest
17+
RUN go install github.com/tomnomnom/waybackurls@latest
18+
RUN go install github.com/003random/getJS@latest
19+
RUN go install github.com/lc/gau/v2/cmd/gau@latest
20+
21+
# ------------------------------------------------------------
1222

1323
FROM alpine:3.21
1424

1525
WORKDIR /app
1626

17-
RUN mkdir -p /app/config
18-
RUN adduser -D -u 1000 -s /sbin/nologin app
27+
RUN apk add --no-cache curl git python3 py3-pip bash
28+
29+
# Copier les outils Go depuis la première image
30+
COPY --from=go_builder /go/bin/subfinder /usr/local/bin/
31+
COPY --from=go_builder /go/bin/naabu /usr/local/bin/
32+
COPY --from=go_builder /go/bin/waybackurls /usr/local/bin/
33+
COPY --from=go_builder /go/bin/getJS /usr/local/bin/
34+
COPY --from=go_builder /go/bin/gau /usr/local/bin/
35+
36+
# Installer ParamSpider (Python)
37+
RUN git clone https://github.com/devanshbatham/paramspider.git /opt/paramspider && \
38+
pip install --break-system-packages /opt/paramspider && \
39+
ln -s /usr/local/bin/paramspider.py /usr/local/bin/paramspider
40+
#chmod +x /usr/local/bin/paramspider
41+
1942
COPY --chown=app:app entrypoint.sh /app/entrypoint.sh
2043
RUN chmod +x /app/entrypoint.sh
2144

22-
USER app
2345

46+
# Ton binaire Go compilé
2447
COPY --from=go_builder /build/api-fuzz /app/api-fuzz
2548

49+
RUN adduser -D -u 1000 -s /sbin/nologin app
50+
USER app
51+
2652
ENTRYPOINT ["/app/entrypoint.sh"]

main.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,21 @@ func main() {
2828
}
2929
fmt.Println("📄 Fichier subdomains.txt généré.")
3030

31+
fmt.Println("⚡ Lancement de Naabu pour scan des ports...")
32+
33+
naabuResults, err := recon.RunNaabu(subdomains)
34+
if err != nil {
35+
log.Printf("⚠️ Naabu a échoué : %v", err)
36+
} else {
37+
fmt.Printf("✅ %d hôtes avec ports ouverts trouvés.\n", len(naabuResults))
38+
err = os.WriteFile("naabu.txt", []byte(strings.Join(naabuResults, "\n")), 0644)
39+
if err != nil {
40+
log.Printf("❌ Erreur écriture fichier naabu.txt : %v", err)
41+
} else {
42+
fmt.Println("📄 Fichier naabu.txt généré.")
43+
}
44+
}
45+
3146
var allUrls []string
3247

3348
for _, sub := range subdomains {

recon/recon.go

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ func RunSubfinder(domain string) ([]string, error) {
130130
}
131131

132132
func RunGetJS(target string) ([]string, error) {
133-
cmd := exec.Command("getjs", "-u", target, "-silent")
133+
cmd := exec.Command("getJS", "-u", target, "-silent")
134134
output, err := cmd.Output()
135135
if err != nil {
136136
return nil, err
@@ -147,3 +147,39 @@ func RunGetJS(target string) ([]string, error) {
147147
}
148148
return results, nil
149149
}
150+
151+
func RunNaabu(domains []string) ([]string, error) {
152+
cmd := exec.Command("naabu", "-silent", "-host", "-")
153+
154+
stdin, err := cmd.StdinPipe()
155+
if err != nil {
156+
return nil, err
157+
}
158+
stdout, err := cmd.StdoutPipe()
159+
if err != nil {
160+
return nil, err
161+
}
162+
163+
if err := cmd.Start(); err != nil {
164+
return nil, err
165+
}
166+
167+
go func() {
168+
defer stdin.Close()
169+
for _, domain := range domains {
170+
_, _ = stdin.Write([]byte(domain + "\n"))
171+
}
172+
}()
173+
174+
var results []string
175+
scanner := bufio.NewScanner(stdout)
176+
for scanner.Scan() {
177+
line := strings.TrimSpace(scanner.Text())
178+
if line != "" {
179+
results = append(results, line)
180+
}
181+
}
182+
183+
err = cmd.Wait()
184+
return results, err
185+
}

0 commit comments

Comments
 (0)