Skip to content

Commit

Permalink
Making app CNAME optional
Browse files Browse the repository at this point in the history
  • Loading branch information
Mzack9999 committed Dec 29, 2021
1 parent d36c907 commit 0a616b3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions cmd/interactsh-server/main.go
Expand Up @@ -51,6 +51,7 @@ func main() {
flag.BoolVar(&options.RootTLD, "root-tld", false, "Enable wildcard/global interaction for *.domain.com")
flag.StringVar(&options.FTPDirectory, "ftp-dir", "", "Ftp directory - temporary if not specified")
flag.BoolVar(&skipacme, "skip-acme", false, "Skip acme registration (certificate checks/handshake + TLS protocols will be disabled)")
flag.BoolVar(&options.AppCnameDNSRecord, "app-cname", false, "Enable DNS CNAME record (eg. app.interactsh.domain) for web app")
flag.Parse()

if options.IPAddress == "" && options.ListenIP == "0.0.0.0" {
Expand Down
2 changes: 1 addition & 1 deletion pkg/server/dns_server.go
Expand Up @@ -105,7 +105,7 @@ func (h *DNSServer) ServeDNS(w dns.ResponseWriter, r *dns.Msg) {
handleClould(net.ParseIP("169.254.169.254"))
case strings.EqualFold(domain, "alibaba"+h.dotDomain):
handleClould(net.ParseIP("100.100.100.200"))
case strings.EqualFold(domain, "app"+h.dotDomain):
case h.options.AppCnameDNSRecord && strings.EqualFold(domain, "app"+h.dotDomain):
handleAppWithCname("projectdiscovery.github.io", net.ParseIP("185.199.108.153"), net.ParseIP("185.199.110.153"), net.ParseIP("185.199.111.153"), net.ParseIP("185.199.108.153"))
default:
handleClould(h.ipAddress)
Expand Down
3 changes: 3 additions & 0 deletions pkg/server/server.go
Expand Up @@ -69,6 +69,9 @@ type Options struct {
OriginURL string
// FTPDirectory or temporary one
FTPDirectory string
// AppCnameDNSRecord determines if the dns server returns CNAME record
// similar to app.interactsh.domain
AppCnameDNSRecord bool
}

// URLReflection returns a reversed part of the URL payload
Expand Down

0 comments on commit 0a616b3

Please sign in to comment.