Skip to content

UNC Path and Share Arguments to Snaffle Specific Shares#46

Open
camlischke1 wants to merge 2 commits into
cisagov:mainfrom
camlischke1:main
Open

UNC Path and Share Arguments to Snaffle Specific Shares#46
camlischke1 wants to merge 2 commits into
cisagov:mainfrom
camlischke1:main

Conversation

@camlischke1

Copy link
Copy Markdown

🗣 Description

Added two new arguments to the argument parser:

  • -s / --shares: accepts a comma-separated list of share names to scan (e.g. hr,documents,test)
  • --unc: accepts a UNC path in \\server\share format to target a specific share directly

Both arguments feed into a unified options.targets and options.shares list, so the rest of the codebase handles them consistently regardless of how the user provided their input.

💭 Motivation and context

Previously, SnafflePy had no way to scope a scan to specific shares or target a single share via UNC path — it would always attempt to scan all discovered shares. This change allows users to narrow the scope of a scan, which is useful when:

  • You already know which share you want to target
  • You want to reduce noise and scan time by limiting to relevant shares
  • You have a direct UNC path to a share and don't need full host/share discovery

🧪 Testing

The following cases were tested manually:

Comma-separated shares:

python3 snaffler.py 192.168.1.1 -u user -p pass -s hr,documents
# options.targets → ['192.168.1.1']
# options.shares  → ['hr', 'documents']

Single share:

python3 snaffler.py 192.168.1.1 -u user -p pass -s hr
# options.targets → ['192.168.1.1']
# options.shares  → ['hr']

UNC path only:

python3 snaffler.py --unc \\192.168.1.1\hr -u user -p pass
# options.targets → ['192.168.1.1']
# options.shares  → ['hr']

UNC path combined with -s:

python3 snaffler.py --unc \\192.168.1.1\hr -s documents -u user -p pass
# options.targets → ['192.168.1.1']
# options.shares  → ['hr', 'documents']

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.

1 participant