Skip to content

Conversation

@l0ss
Copy link
Contributor

@l0ss l0ss commented Oct 7, 2025

Fix for passing target Domain without target DC or DC as FQDN instead of IP - also made -i accept comma separated list

@l0ss l0ss requested a review from Copilot October 7, 2025 02:53
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances command-line argument handling for target domains and directory targets, adding support for comma-separated lists and domain name resolution to IP addresses.

  • Added support for comma-separated list of directory targets in the -i parameter
  • Implemented automatic DNS resolution for domain controllers when FQDN is provided instead of IP
  • Enhanced domain controller selection logic to handle cases where only target domain is specified

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
Snaffler/Config.cs Added parsing logic for comma-separated directory targets and improved debug logging
SnaffCore/ActiveDirectory/Helpers.cs Removed unused import statements
SnaffCore/ActiveDirectory/AdData.cs Added DNS resolution functionality and improved domain controller selection logic

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

//Console.WriteLine(dirTargetArg.Value);
string pathTarget = dirTargetArg.Value;
if (dirTargetArg.Value.Length > 4)
Mq.Degub("Disabled finding shares.");
Copy link

Copilot AI Oct 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrected spelling of 'Degub' to 'Debug'.

Copilot uses AI. Check for mistakes.
Mq.Degub("Target path is " + dirTargetArg.Value);
foreach (string pathTarget in parsedConfig.PathTargets)
{
Mq.Degub("Targeting path:" + pathTarget);
Copy link

Copilot AI Oct 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrected spelling of 'Degub' to 'Debug'.

Copilot uses AI. Check for mistakes.
catch (Exception ex)
{
// Handle DNS resolution errors
Console.WriteLine($"Resolution failed for '{input}': {ex.Message}");
Copy link

Copilot AI Oct 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Direct console output should be replaced with the logging framework (Mq) for consistency with the rest of the codebase.

Suggested change
Console.WriteLine($"Resolution failed for '{input}': {ex.Message}");
AdDataInstance.Mq.Enqueue($"Resolution failed for '{input}': {ex.Message}");

Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@l0ss l0ss merged commit 05bfee0 into master Oct 7, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants