etc.git


etc

~ scripts and random things
git clone https://github.com/djnnvx/etc.git
log | files | refs | archive

commit dc5a7a4b0bbf5915e593596905fd86b06b42a861
parent dde1635d5f0fd0615e509b913ab46743b7098104
Author: djnn <[email protected]>
Date: Mon, 20 Oct 2025 21:59:36 +0200

feat(maildigger): enum TXT records

Diffstat:
Mpentest/recon/maildigger/main.go | 48+++++++++++++++++++++++++++++++++++++++---------

1 file changed, 39 insertions(+), 9 deletions(-)

diff --git a/pentest/recon/maildigger/main.go b/pentest/recon/maildigger/main.go
@@ -7,27 +7,28 @@ import (
 
 	"bufio"
 	"fmt"
+	"net"
 	"os"
 )
 
-const version = "0.0.1"
+const version = "0.0.2"
 const ASCII_ART = `
 
      .-.
     /'v'\           maildigger
    (/   \)           ~djnn.sh
 ==='="="===<
-    |_|              v0.0.1
+    |_|              v0.0.2
 
-                                s/o vsim<3
-                        hack the planet,
-                        travel the world . . .
-------------------------------------------------
+                                                     s/o vsim<3
+                                               hack the planet,
+                                         travel the world . . .
+-----------------------------------------------------------------------------
        DNS scrapping tool to recover DKIM
-                   records
+         records & enum DNS TXT records
 
-    ===> evil.djnn.sh/djnn/maildigger  <===
-------------------------------------------------
+ => https://evil.djnn.sh/etc/file/pentest/recon/maildigger/README.md.html <=
+-----------------------------------------------------------------------------
 
 `
 
@@ -35,6 +36,8 @@ var (
 	domainsFilepath string
 	nameserver      string
 
+	domain string
+
 	maxLenDKIM int32
 	maxLenSPF  int32
 )
@@ -85,11 +88,38 @@ var rootCmd = &cobra.Command{
 	},
 }
 
+var getTxtCmd = &cobra.Command{
+	Use:     "get-txt",
+	Short:   "retrieves TXT records",
+	Long:    ASCII_ART,
+	Version: version,
+	Run: func(cmd *cobra.Command, args []string) {
+		if domain == "" {
+			println("[!] You need to check a domain name")
+			os.Exit(1)
+		}
+
+		txts, err := net.LookupTXT(domain)
+		if err != nil {
+			panic(err)
+		}
+
+		for _, txt := range txts {
+			fmt.Printf("TXT[%s] => %s\n", domain, txt)
+		}
+
+	},
+}
+
 func main() {
 
 	rootCmd.Flags().StringVarP(&nameserver, "nameserver", "n", "8.8.8.8", "DNS nameserver")
 	rootCmd.Flags().StringVarP(&domainsFilepath, "domains", "d", "domains.txt", "file containing list of domains (line by line)")
 	rootCmd.Flags().Int32VarP(&maxLenDKIM, "dkim-max-len", "", 128, "DKIM key max size")
 
+	getTxtCmd.Flags().StringVarP(&domain, "domain", "d", "djnn.crossbone.cc", "DNS nameserver")
+
+	rootCmd.AddCommand(getTxtCmd)
+
 	rootCmd.ExecuteC()
 }