Chris Duggan Profile picture
Oct 13 14 tweets 5 min read Read on X
🧵Thread / 🕵️‍♂️ Ever wanted to hunt down APTs like #TheCom via DNS but can't be bothered with all the searching and clicking?

Want to get a list of interesting 'live' domains to investigate in under 60 seconds ⏰!!

No worries! Let's automate the process with a Python script that's fast and safe.

No APIs or expensive subscriptions needed — just 1.1.1.1 and some threading magic! 🧵👇

#ScatteredSpider #TheCom #VirtuoSpider #Phishkit #CTI #Hunting #Automation
1️⃣ First, we define the nameserver we're targeting. In this case, it's ns3.my-ndns[.]com. This is where Virtuospider might be lurking! 🕸️ Image
2️⃣ Next, we fetch all domains associated with this nameserver using a simple curl command.

No fancy APIs or subscriptions—just pure OSS (Open Source Simplicity)! 🌐 Image
3️⃣ Time to parse the data! We read the JSON response from coffee.txt and extract domain names using regular expressions. 📜🔍 Image
4️⃣ We clean up the domain list by removing duplicates and any known domains (if you have a known.txt file). Clean data is happy data! 🧹😄 Image
5️⃣ Let's process these domains! We use threading to speed things up because patience is a virtue we don't always have. 🚀 Image
6️⃣ For each domain, we resolve its IP address using Cloudflare's 1.1.1.1 DNS resolver.

This means we're only querying DNS records, not connecting to the domains themselves—keeping our investigation safe and stealthy! 🕵️‍♂️

By using 1.1.1.1, we're leveraging a fast and privacy-focused DNS service. We're simply asking, "What's the IP address for this domain?" Since DNS queries are public and don't interact with the domain's server, we're not making any direct connections that could expose us or alert the threat actors.Image
7️⃣ We handle possible errors gracefully. If a domain doesn't resolve or there's a DNS issue, we catch it and log the error without stopping the script. This ensures our automation keeps running smoothly! ⚙️

Error handling is crucial! If a domain doesn't exist or there's a timeout, we catch the exception and keep going. This way, one problematic domain won't derail the entire process. It's all about resilience! 💪Image
8️⃣ Without connecting to the domains, we perform an RDAP (Registration Data Access Protocol) lookup on the IP addresses. RDAP is like a modern version of WHOIS—it provides public info about who owns an IP address or domain. This helps us identify potential threats without risking direct contact. 🔎

RDAP allows us to retrieve registration details for IP addresses from public databases. We're still not connecting to the domains—just gathering publicly available info about who owns the IPs. It's like checking a phone book without making a call! 📖Image
9️⃣ We store the domain, IP, and AS Owner info. This gives us a neat summary of who's hosting what. 📄 Image
🔟 Now, we generate an intelligence report in PDF format, focusing on specific AS Owners (e.g., 'DigitalOcean', 'Virtuo'). Time to catch those spiders! 🕷️📊 Image
1️⃣1️⃣ The report includes the domain, IP, and AS Owner, making it easier to spot suspicious activity. Plus, PDFs are professional, right? 😉 Image
1️⃣2️⃣ And that's it! You've automated your DNS hunt for potential Spider domains, making your cyber threat intelligence gathering faster. No manual checks, no expensive tools—just Python and some creativity! 🐍💡

Ready to dive in? Here's the full script for you to try out! 👉 pastebin.com/GVpQcxZw
Todays output ..... Image

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Chris Duggan

Chris Duggan Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @TLP_R3D

Oct 12
🧵 Thread 1/ So you want to track Scattered Spider but Censys and Shodan are just too slow? Here's the cheat sheet! 🕵️‍♂️

Scattered Spider registers their domains using the nameserver ns3.my-ndns[.]com. We can passively monitor this DNS for new domains. 🕸️

Don't have DomainTools to monitor the DNS? No fear! You can use dns[.]coffee a free service that provides the data you need.

☕ Check out: dns[.]coffee/nameservers/ns3[.]my-ndns[.]com

#ScatteredSpider #TheCom #Phishkit #CTI Next Steps.....Image
🧵 Thread 2 / Each day, a list of new domains will appear in dns[.]coffee. Here's what we're looking for when trying to find the needle in the haystack🪡:

🔒 Domains Hosted on DigitalOcean - check in VirusTotal
🔒 Registered via NICENIC INTERNATIONAL GROUP CO - data in VirusTotal
🔒 Look for Domains spoofing OKTA or SSOImage
🧵 Thread 3 /Don't forget you can always pivot on the SSL cert - with wildcard searches using another free tool crt[.]sh Image
Image
Read 6 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us!

:(