ptrstream

- Unnamed repository; edit this file 'description' to name the repository.
git clone git://git.acid.vegas/-c.git
Log | Files | Refs | Archive | README

commit 2f598dd7fad8520b108bcb380182f3059da5ed6c
parent 7ccc6c06084ca26c03e522f5e7eb295c98a0bf7f
Author: acidvegas <acid.vegas@acid.vegas>
Date: Sat, 25 Nov 2023 14:07:18 -0500

mad example (wtf are we doing here)

Diffstat:
Amad | 35+++++++++++++++++++++++++++++++++++
Mmadness | 5+++--

2 files changed, 38 insertions(+), 2 deletions(-)

diff --git a/mad b/mad
@@ -0,0 +1,35 @@
+#!/bin/bash
+
+TIMEOUT=2
+
+genip() {
+    num_octets=$((RANDOM % 4 + 1))
+    ip=""
+    for i in $(seq 1 $num_octets); do
+        if [ $i -ne 1 ]; then
+            ip+="."
+        fi
+        ip+=$((RANDOM % 256))
+    done
+    echo $ip
+}
+
+TEMP=$(mktemp -d)
+while true; do
+    ip=$(genip)
+    ns_records=$(dig +time=$TIMEOUT +short $ip.in-addr.arpa NS)
+    for ns in $ns_records; do
+        ns_ips=$(dig +time=$TIMEOUT +short $ns A $ns AAAA)
+        for ns_ip in $ns_ips; do
+            #echo -e "AXFR on \033[36m${ns%.}\033[0m \033[90m($ns_ip)\033[0m for \033[33m$ip.in-addr.arpa\033[0m"
+            dig AXFR @$ns_ip $ip.in-addr.arpa > $TEMP/$ip.in-addr.arpa.txt
+            if [ ! -s "$zone_file" ] || grep -qE "Transfer failed|connection reset|connection refused" "$zone_file"; then
+                echo -e "\033[31m[FAIL]\033[0m AXFR on \033[36m${ns%.}\033[0m \033[90m($ns_ip)\033[0m for \033[33m$ip.in-addr.arpa\033[0m"
+                rm -f "$zone_file"
+            else
+                echo -e "\033[32m[SUCCESS]\033[0m AXFR on \033[36m${ns%.}\033[0m \033[90m($ns_ip)\033[0m for \033[33m$ip.in-addr.arpa\033[0m"
+                break
+            fi
+        done
+    done
+done
diff --git a/madness b/madness
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 # maDNeSs with DNS - devloped by acidvegas (https://git.acid.vegas/ptrstream)
 
 genip() {
@@ -15,5 +15,6 @@ genip() {
 
 while true; do
     ip=$(genip)
-    dig +time=1 +noall +authority $ip.in-addr.arpa | grep 'IN\sSOA' | sed "s/^/\x1B[35m$ip.in-addr.arpa\x1B[90m -> \x1B[1;33m/" | sed "s/$/\x1B[0m/"
+    dig +time=1 +noall +authority $ip.in-addr.arpa NS
+#| grep 'IN\sSOA' | sed "s/^/\x1B[35m$ip.in-addr.arpa\x1B[90m -> \x1B[1;33m/" | sed "s/$/\x1B[0m/"
 done