Skip to content

Commit

Permalink
Add ReverseDNSLookup in SnaffCon.cs to fix SnaffCon#161 for named tar…
Browse files Browse the repository at this point in the history
…get IPs

Reference: SnaffCon#161
  • Loading branch information
cmprmsd authored Oct 25, 2024
1 parent ba95a9f commit 3245332
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions SnaffCore/SnaffCon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,20 @@ private void ShareDiscovery(string[] computerTargets)
// skip any that are in the exclusion list
continue;
}
// Reverse DNS lookup
var computerName = "";
try
{
Mq.Trace("Performing reverse lookup for " + computer);
IPHostEntry result = Dns.GetHostEntry(computer);
computerName = result.HostName;
Mq.Trace("Got DNSName " + computerName + " for " + computer);
}
catch (Exception e)
{
Mq.Degub(e.Message);
//Console.WriteLine(ex.Message);
}
// ShareFinder Task Creation - this kicks off the rest of the flow
Mq.Trace("Creating a ShareFinder task for " + computer);
ShareTaskScheduler.New(() =>
Expand Down

0 comments on commit 3245332

Please sign in to comment.