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 ce50d31b3a89b356ade1a299ec3385681e6d9ab1
parent a60597e8f855707c0d3ec8f1a1122e90433435be
Author: djnn <[email protected]>
Date: Sat, 13 Jun 2026 12:15:26 +0900

more reliability fixes

Diffstat:
Mhelpers/file.go | 3++-
Mhelpers/net.go | 22++++------------------
Mosint/dnsx.go | 12+++++-------
Mosint/subfinder.go | 18+++++++++---------
Mscan/robotstxt.go | 5+++--
Mscan/sitemap.go | 5+++--

6 files changed, 26 insertions(+), 39 deletions(-)

diff --git a/helpers/file.go b/helpers/file.go
@@ -15,7 +15,8 @@ type FileScanner struct {
 func LoadTargetFile(targetPath string) *FileScanner {
 	file, err := os.Open(targetPath)
 	if err != nil {
-		fmt.Printf("%v, %+v", err, targetPath)
+		fmt.Printf("[!] Could not open target file %q: %v\n", targetPath, err)
+		os.Exit(1)
 	}
 
 	scanner := bufio.NewScanner(file)
diff --git a/helpers/net.go b/helpers/net.go
@@ -14,19 +14,6 @@ import (
 
 const HttpTimeout = 15 * time.Second
 
-func ParseDomain(website string) string {
-	if strings.HasPrefix(website, "http") {
-		parsedUrl, err := url.Parse(website)
-		if err != nil {
-			fmt.Printf("%s", err)
-		}
-
-		website = parsedUrl.Host
-	}
-
-	return website
-}
-
 func GetHttpTransport() *http.Transport {
 	var proxy = os.Getenv("HTTP_PROXY")
 	url, err := url.Parse(proxy)
@@ -74,6 +61,7 @@ func GetCurrentIP() string {
 		fmt.Printf("[!] Could not query public IP address: %s\n", err.Error())
 		return ""
 	}
+	defer resp.Body.Close()
 
 	result, err := io.ReadAll(resp.Body)
 	if err != nil {
@@ -118,12 +106,10 @@ func HasUnavailableWebInterface(url string) bool {
 	}
 	req.Header.Add("User-Agent", GetUserAgent())
 	resp, err := client.Do(req)
-	if err != nil {
+	if err != nil || resp == nil {
 		return true
 	}
+	defer resp.Body.Close()
 
-	if resp == nil || resp.StatusCode >= http.StatusBadGateway {
-		return true
-	}
-	return false
+	return resp.StatusCode >= http.StatusBadGateway
 }
diff --git a/osint/dnsx.go b/osint/dnsx.go
@@ -83,16 +83,14 @@ func (d *Dnsx) Run(domain string) {
 
 	fo, err := os.Create(d.outfile)
 	if err != nil {
-		panic(err)
+		fmt.Printf("[!] Dnsx: failed to create %s: %v\n", d.outfile, err)
+		return
 	}
-	defer func() {
-		if err := fo.Close(); err != nil {
-			panic(err)
-		}
-	}()
+	defer fo.Close()
 
 	if _, err := fo.Write(prettyJSON.Bytes()); err != nil {
-		panic(err)
+		fmt.Printf("[!] Dnsx: failed to write %s: %v\n", d.outfile, err)
+		return
 	}
 
 	fmt.Printf("[OSINT %s] Dnsx results are stored in %s\n", domain, d.outfile)
diff --git a/osint/subfinder.go b/osint/subfinder.go
@@ -37,27 +37,27 @@ func (s *Subfinder) Run(domain string) {
 
 	subfinder, err := runner.NewRunner(subfinderOpts)
 	if err != nil {
-		log.Fatalf("failed to create subfinder runner: %v", err)
+		fmt.Printf("[!] Subfinder: failed to create runner: %v\n", err)
+		return
 	}
 
 	output := &bytes.Buffer{}
 	_, err = subfinder.EnumerateSingleDomainWithCtx(context.Background(), domain, []io.Writer{output})
 	if err != nil {
-		log.Fatalf("failed to enumerate single domain: %v", err)
+		fmt.Printf("[!] Subfinder: failed to enumerate %s: %v\n", domain, err)
+		return
 	}
 
 	fo, err := os.Create(s.outfile)
 	if err != nil {
-		panic(err)
+		fmt.Printf("[!] Subfinder: failed to create %s: %v\n", s.outfile, err)
+		return
 	}
-	defer func() {
-		if err := fo.Close(); err != nil {
-			panic(err)
-		}
-	}()
+	defer fo.Close()
 
 	if _, err := fo.Write(output.Bytes()); err != nil {
-		panic(err)
+		fmt.Printf("[!] Subfinder: failed to write %s: %v\n", s.outfile, err)
+		return
 	}
 
 	fmt.Printf("[OSINT %s] Subfinder are stored in %s\n\n", domain, s.outfile)
diff --git a/scan/robotstxt.go b/scan/robotstxt.go
@@ -35,12 +35,12 @@ func (d *RobotsTxt) Run(domain string) {
 		req.Header.Add("User-Agent", helper.GetUserAgent())
 
 		resp, err := client.Do(req)
-
 		if err != nil {
 			fmt.Printf("%v", err)
+			continue
 		}
 
-		if resp != nil && resp.StatusCode != http.StatusNotFound {
+		if resp.StatusCode != http.StatusNotFound {
 			body, err := io.ReadAll(resp.Body)
 			if err != nil {
 				fmt.Printf("%v", err)
@@ -51,6 +51,7 @@ func (d *RobotsTxt) Run(domain string) {
 		} else {
 			fmt.Println("----- Sorry, got 404 status code for robots.txt ----- ")
 		}
+		resp.Body.Close()
 	}
 
 	fmt.Printf("[SCAN %s] RobotsTxt scan for %s completed\n\n", domain, domain)
diff --git a/scan/sitemap.go b/scan/sitemap.go
@@ -38,12 +38,12 @@ func (d *Sitemap) Run(domain string) {
 		req.Header.Add("User-Agent", helper.GetUserAgent())
 
 		resp, err := client.Do(req)
-
 		if err != nil {
 			fmt.Printf("%v", err)
+			continue
 		}
 
-		if resp != nil && resp.StatusCode != http.StatusNotFound {
+		if resp.StatusCode != http.StatusNotFound {
 			body, err := io.ReadAll(resp.Body)
 			if err != nil {
 				fmt.Printf("%v", err)
@@ -60,6 +60,7 @@ func (d *Sitemap) Run(domain string) {
 		} else {
 			fmt.Println("-----  Sorry, got 404 status code for sitemap.xml -----")
 		}
+		resp.Body.Close()
 	}
 
 	fmt.Printf("[SCAN %s] Sitemap scan for %s completed\n\n", domain, domain)