yellow.git


yellow

~ opinionated web scanning pipeline for pentesters in a hurry
git clone https://github.com/djnnvx/yellow.git
log | files | refs | archive | README | LICENSE

commit 4822d8df75fa71b2691b25641533901b96e7f852
parent 190124140c86d1fce8b802516555265c88f4c5d8
Author: djnn <[email protected]>
Date: Thu, 5 Dec 2024 18:36:56 +0900

feat(scan): `gobuster` integration should be OK !

Diffstat:
MDockerfile | 1-
MREADME.md | 8+++++---
Mgo.mod | 1+
Mgo.sum | 2++
Aquick-run.sh | 12++++++++++++
Mscan/gobuster.go | 51++++++++++++++++++++++++++++++++++++++++++++++-----
Dscan/katana.go | 20--------------------
Mscan/run.go | 18++++++++++++++++++

8 files changed, 84 insertions(+), 29 deletions(-)

diff --git a/Dockerfile b/Dockerfile
@@ -6,7 +6,6 @@ RUN apk update --no-cache && \
     apk add --no-cache \
     make \
     build-base \
-    chromium \
     libpcap-dev
 
 COPY go.mod .
diff --git a/README.md b/README.md
@@ -44,12 +44,14 @@ Please use at your own risk, in a controlled environnement. Thanks<3
 
 For next version, i want to take care of at least two items described here:
 
-* `scan`: integrate browser-dependant tools (katana, gowitness),
+* `scan`: integrate browser-dependant tools (katana, ...),
 * `scan`: integrate a runner for nuclei that will automatically fetch new rules,
 * `scan`: port third-party tools (smbenum, ldapsearch, enum4linux),
 * `scan`: add a CVE query system
+* `scan`: port some quick win, such as anonymous ftp
 
-> feel free to suggest more. :)~
+> feel free to suggest more ideas. :)~
+>
 > if you'd like to do so, reach me by mail or on social media: https://djnn.sh/pgp
 
 ### Contributing
@@ -62,7 +64,7 @@ afterwards.
 
 Using `go v1.23`.
 
-> also requires `libpcap-dev` and `chrome` !
+> also requires `libpcap-dev` !
 
 ```bash
 # please clone using https. couldnt be arsed to set up a tcp tunnel on cloudflare
diff --git a/go.mod b/go.mod
@@ -3,6 +3,7 @@ module evil.djnn.sh/djnn/yellow
 go 1.23
 
 require (
+	github.com/OJ/gobuster/v3 v3.6.0
 	github.com/bogdzn/gork v0.0.5
 	github.com/projectdiscovery/dnsx v1.2.1
 	github.com/projectdiscovery/goflags v0.1.65
diff --git a/go.sum b/go.sum
@@ -9,6 +9,8 @@ github.com/Mzack9999/gcache v0.0.0-20230410081825-519e28eab057 h1:KFac3SiGbId8ub
 github.com/Mzack9999/gcache v0.0.0-20230410081825-519e28eab057/go.mod h1:iLB2pivrPICvLOuROKmlqURtFIEsoJZaMidQfCG1+D4=
 github.com/Mzack9999/go-http-digest-auth-client v0.6.1-0.20220414142836-eb8883508809 h1:ZbFL+BDfBqegi+/Ssh7im5+aQfBRx6it+kHnC7jaDU8=
 github.com/Mzack9999/go-http-digest-auth-client v0.6.1-0.20220414142836-eb8883508809/go.mod h1:upgc3Zs45jBDnBT4tVRgRcgm26ABpaP7MoTSdgysca4=
+github.com/OJ/gobuster/v3 v3.6.0 h1:eZWw9rRklmjHzo2UdlN+pcL8kYBSQF13xxxc0+xuMYs=
+github.com/OJ/gobuster/v3 v3.6.0/go.mod h1:iSKgwrnVVrNbDsDrxaiwh5NGBPlVEThJRFgnazWgWW4=
 github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8/go.mod h1:I0gYDMZ6Z5GRU7l58bNFSkPTFN6Yl12dsUlAZ8xy98g=
 github.com/PuerkitoBio/goquery v1.5.0/go.mod h1:qD2PgZ9lccMbQlc7eEOjaeRlFQON7xY8kdmcsrnKqMg=
 github.com/PuerkitoBio/goquery v1.8.1 h1:uQxhNlArOIdbrH1tr0UXwdVFgDcZDrZVdcpygAcwmWM=
diff --git a/quick-run.sh b/quick-run.sh
@@ -0,0 +1,12 @@
+#!/bin/env bash
+
+set -euo
+
+
+./yellow --help || make
+
+./yellow -d ${1}
+
+./yellow osint -d ${1}
+
+./yellow scan -d ${1}/scans --file ${1}/scans/domains_${1}.txt
diff --git a/scan/gobuster.go b/scan/gobuster.go
@@ -1,22 +1,63 @@
 package scan
 
 import (
+	"context"
+	"errors"
 	"fmt"
+
+	"evil.djnn.sh/djnn/yellow/helpers"
+	"github.com/OJ/gobuster/v3/cli"
+	"github.com/OJ/gobuster/v3/gobusterdir"
+	"github.com/OJ/gobuster/v3/libgobuster"
 )
 
 type Gobuster struct {
+	scanPath  string
+	proxy     string
+	wordlist  string
+	insecure  bool
+	rateLimit int32
 }
 
-func (d *Gobuster) Info(url string) {
-	fmt.Println("[+] Running Gobuster on", url)
+func (s *Gobuster) Info(website string) {
+	fmt.Println("Running gobuster on", website)
 }
 
-func (d *Gobuster) Configure(c interface{}) {
+func (g *Gobuster) Configure(c interface{}) {
+
+	g.scanPath = c.(map[string]interface{})["scanPath"].(string)
+	g.proxy = c.(map[string]interface{})["proxy"].(string)
+	g.wordlist = c.(map[string]interface{})["wordlist"].(string)
+	g.insecure = c.(map[string]interface{})["insecure"].(bool)
+	g.rateLimit = c.(map[string]interface{})["rateLimit"].(int32)
 }
 
-func (d *Gobuster) Run(url string) {
+func (g *Gobuster) Run(url string) {
+
+	GlobalOpts := libgobuster.NewOptions()
+	GlobalOpts.Wordlist = g.wordlist
+	GlobalOpts.OutputFilename = g.scanPath + "/gobuster.txt"
+
+	pluginOpts := gobusterdir.NewOptionsDir()
+	pluginOpts.Proxy = g.proxy
+	pluginOpts.NoTLSValidation = g.insecure
+	pluginOpts.UserAgent = helper.GetUserAgent()
+
+	plugin, err := gobusterdir.NewGobusterDir(GlobalOpts, pluginOpts)
+	if err != nil {
+		panic(err)
+	}
+
+	mainContext, _ := context.WithCancel(context.Background())
+	log := libgobuster.NewLogger(GlobalOpts.Debug)
+	if err := cli.Gobuster(mainContext, GlobalOpts, plugin, log); err != nil {
 
-	/* run dir & dns command ? */
+		var wErr *gobusterdir.ErrWildcard
+		if errors.As(err, &wErr) {
+			fmt.Printf("%w. To continue please exclude the status code or the length\n", wErr)
+		}
+		panic(err)
+	}
 
 	fmt.Printf("[SCAN %s] Gobuster scan for %s completed\n\n", url)
 }
diff --git a/scan/katana.go b/scan/katana.go
@@ -1,20 +0,0 @@
-package scan
-
-import (
-	"fmt"
-)
-
-type Katana struct {
-}
-
-func (d *Katana) Info(url string) {
-	fmt.Println("[+] Running Katana on", url)
-}
-
-func (d *Katana) Configure(c interface{}) {
-}
-
-func (d *Katana) Run(url string) {
-
-	fmt.Printf("[SCAN %s] Katana scan for %s completed\n\n", url)
-}
diff --git a/scan/run.go b/scan/run.go
@@ -16,6 +16,24 @@ type ScanOpts struct {
 	withPortScan  bool
 }
 
+func (opts ScanOpts) runGobusterDir() {
+
+	nb := Naabu{}
+	nbCfg := make(map[string]interface{})
+
+	nbCfg["scanPath"] = opts.scanPath
+	nbCfg["proxy"] = opts.proxy
+	nbCfg["rateLimit"] = opts.rateLimit
+	nbCfg["wordlist"] = opts.wordlistPath
+	nbCfg["insecure"] = opts.forceInsecure
+
+	nb.Configure(nbCfg)
+	nb.Info(opts.domain)
+	if !opts.dryRun {
+		nb.Run(opts.domain)
+	}
+}
+
 func (opts *ScanOpts) SetWithPortScan(data bool) {
 	opts.withPortScan = data
 }