Skip to content

Instantly share code, notes, and snippets.

@DeathsPirate
Created March 30, 2023 08:31
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save DeathsPirate/f111513ec5968eea29b6c13ecbc35e46 to your computer and use it in GitHub Desktop.
Save DeathsPirate/f111513ec5968eea29b6c13ecbc35e46 to your computer and use it in GitHub Desktop.
# List of domains to search in DNS cache
$domains = @(
"akamaicontainer.com",
"akamaitechcloudservices.com",
"azuredeploystore.com",
"azureonlinecloud.com",
"azureonlinestorage.com",
"dunamistrd.com",
"glcloudservice.com",
"journalide.org",
"msedgepackageinfo.com",
"msstorageazure.com",
"msstorageboxes.com",
"officeaddons.com",
"officestoragebox.com",
"pbxcloudeservices.com",
"pbxphonenetwork.com",
"pbxsources.com",
"qwepoi123098.com",
"sbmsa.wiki",
"sourceslabs.com",
"visualstudiofactory.com",
"zacharryblogs.com"
)
# Get the DNS cache using ipconfig
$dnsCache = ipconfig /displaydns
# Initialize an array to store the matched domains
$matchedDomains = @()
# Search the DNS cache for each domain
foreach ($domain in $domains) {
if ($dnsCache -match $domain) {
$matchedDomains += $domain
}
}
# Display the matched domains
if ($matchedDomains) {
Write-Host "Matched Domains in DNS Cache:"
foreach ($matchedDomain in $matchedDomains) {
Write-Host $matchedDomain
}
} else {
Write-Host "No matched domains found in DNS Cache."
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment