@@ -15,59 +15,106 @@ import (
1515func handleDNS (s * discordgo.Session , i * discordgo.InteractionCreate ) {
1616 options := i .ApplicationCommandData ().Options
1717 domain := ""
18+ subdomain := ""
1819 scanType := "takeover" // Default to takeover
1920
2021 for _ , opt := range options {
2122 switch opt .Name {
2223 case "domain" :
2324 domain = opt .StringValue ()
25+ case "subdomain" :
26+ subdomain = opt .StringValue ()
2427 case "type" :
2528 scanType = opt .StringValue ()
2629 }
2730 }
2831
29- if domain == "" {
30- respond (s , i , "Domain is required" , false )
32+ // Strip URL scheme prefixes so users can paste URLs directly
33+ domain = strings .TrimPrefix (strings .TrimPrefix (domain , "https://" ), "http://" )
34+ domain = strings .TrimSuffix (domain , "/" )
35+ subdomain = strings .TrimPrefix (strings .TrimPrefix (subdomain , "https://" ), "http://" )
36+ subdomain = strings .TrimSuffix (subdomain , "/" )
37+
38+ if domain == "" && subdomain == "" {
39+ respond (s , i , "❌ Either **domain** or **subdomain** is required." , false )
3140 return
3241 }
3342
34- // Map scan type to CLI command
43+ // Determine target label for Discord embed
44+ target := domain
45+ if subdomain != "" {
46+ target = subdomain
47+ }
48+
49+ // Build CLI command — subdomain mode passes -s instead of -d (skips enumeration)
3550 var command []string
3651 var scanName string
3752 switch scanType {
3853 case "cname" :
39- command = []string {autoarScript , "dns" , "cname" , "-d" , domain }
4054 scanName = "DNS CNAME"
55+ if subdomain != "" {
56+ command = []string {autoarScript , "dns" , "cname" , "-d" , subdomain }
57+ } else {
58+ command = []string {autoarScript , "dns" , "cname" , "-d" , domain }
59+ }
4160 case "ns" :
42- command = []string {autoarScript , "dns" , "ns" , "-d" , domain }
4361 scanName = "DNS NS"
62+ if subdomain != "" {
63+ command = []string {autoarScript , "dns" , "ns" , "-d" , subdomain }
64+ } else {
65+ command = []string {autoarScript , "dns" , "ns" , "-d" , domain }
66+ }
4467 case "azure-aws" :
45- command = []string {autoarScript , "dns" , "azure-aws" , "-d" , domain }
4668 scanName = "DNS Azure/AWS"
69+ if subdomain != "" {
70+ command = []string {autoarScript , "dns" , "azure-aws" , "-d" , subdomain }
71+ } else {
72+ command = []string {autoarScript , "dns" , "azure-aws" , "-d" , domain }
73+ }
4774 case "dnsreaper" :
48- command = []string {autoarScript , "dns" , "dnsreaper" , "-d" , domain }
4975 scanName = "DNSReaper"
76+ if subdomain != "" {
77+ command = []string {autoarScript , "dns" , "dnsreaper" , "-d" , subdomain }
78+ } else {
79+ command = []string {autoarScript , "dns" , "dnsreaper" , "-d" , domain }
80+ }
5081 case "dangling-ip" :
51- command = []string {autoarScript , "dns" , "dangling-ip" , "-d" , domain }
5282 scanName = "DNS Dangling IP"
83+ if subdomain != "" {
84+ command = []string {autoarScript , "dns" , "dangling-ip" , "-d" , subdomain }
85+ } else {
86+ command = []string {autoarScript , "dns" , "dangling-ip" , "-d" , domain }
87+ }
5388 case "cf1016" :
54- command = []string {autoarScript , "dns" , "cf1016" , "-d" , domain }
5589 scanName = "Cloudflare 1016 Dangling DNS"
90+ if subdomain != "" {
91+ // -s mode: scan the single subdomain directly, no live-subs.txt needed
92+ command = []string {autoarScript , "dns" , "cf1016" , "-s" , subdomain }
93+ if domain != "" {
94+ command = append (command , "-d" , domain )
95+ }
96+ } else {
97+ command = []string {autoarScript , "dns" , "cf1016" , "-d" , domain }
98+ }
5699 default : // takeover
57- command = []string {autoarScript , "dns" , "takeover" , "-d" , domain }
58100 scanName = "DNS Takeover"
101+ if subdomain != "" {
102+ command = []string {autoarScript , "dns" , "takeover" , "-d" , subdomain }
103+ } else {
104+ command = []string {autoarScript , "dns" , "takeover" , "-d" , domain }
105+ }
59106 }
60107
61108 scanID := fmt .Sprintf ("dns_%s_%d" , scanType , time .Now ().Unix ())
62- embed := createScanEmbed (scanName , domain , "running" )
109+ embed := createScanEmbed (scanName , target , "running" )
63110 s .InteractionRespond (i .Interaction , & discordgo.InteractionResponse {
64111 Type : discordgo .InteractionResponseChannelMessageWithSource ,
65112 Data : & discordgo.InteractionResponseData {
66113 Embeds : []* discordgo.MessageEmbed {embed },
67114 },
68115 })
69116
70- go runScanBackground (scanID , fmt .Sprintf ("dns_%s" , scanType ), domain , command , s , i )
117+ go runScanBackground (scanID , fmt .Sprintf ("dns_%s" , scanType ), target , command , s , i )
71118}
72119
73120// S3 Commands
0 commit comments