Skip to content

Add Resume Support#171

Open
p0rtL6 wants to merge 3 commits intoSnaffCon:masterfrom
TheHackHouse:resume
Open

Add Resume Support#171
p0rtL6 wants to merge 3 commits intoSnaffCon:masterfrom
TheHackHouse:resume

Conversation

@p0rtL6
Copy link

@p0rtL6 p0rtL6 commented Apr 8, 2025

This PR adds the feature talked about in #61.

There are two new arguments

  • --taskfile writes tasks to a file as they are created and completed
  • --resumefrom takes the file made from the above and dispatches all the pending tasks left in the file. This mode resumes normal operation after dispatching tasks from the file (it also skips any tasks that have been completed already).

As far as I can tell this does not introduce noticeable overhead to the execution. Everything is written in a blocking manner meaning the task does not actually get created until it gets written to the file, this should guarantee that all tasks are saved. In addition, if you specify a task file while resuming from another, it will copy over all completed tasks from the old file into the new at the start of execution so you should be able use them even if the program is interrupted after resuming from a task file already.

Let me know if there are any problems, or if I need to make any changes.

ZephrFish pushed a commit to ZephrFish/Snaffler that referenced this pull request Jan 31, 2026
…support

Integrated pause/resume functionality from PR SnaffCon#171 with comprehensive LDAP enhancements:

LDAP Enhancements:
- SSL/TLS support via LDAPS on port 636 with certificate validation bypass
- Custom DNS server configuration for name resolution
- LDAP username/password authentication support
- Direct DC IP connection capability
- Share access using LDAP credentials with Win32 impersonation
- Enhanced error handling with connection binding validation

Pause/Resume Functionality:
- Task file generation for mid-operation resuming (-1, --taskfile)
- Resume from previous task files (-2, --resumefrom)
- Configurable task file saving intervals (-3, --taskfiletimeout)
- Intelligent task deduplication and optimization on resume
- Automatic state saving at defined intervals
- Support for share, tree, and file task resumption

Enhanced Command-line Options:
- -w/--ldap-user: LDAP authentication username (DOMAIN\username format)
- -q/--ldap-password: LDAP authentication password
- -G/--ldaps: Enable LDAPS (SSL/TLS encryption)
- -H/--dns-server: Custom DNS server IP address
- -J/--dc-ip: Direct domain controller IP address
- -1/--taskfile: Save tasks for resuming operations
- -2/--resumefrom: Resume from saved task file
- -3/--taskfiletimeout: Task file saving interval

Integration Benefits:
- Non-domain machines can access domain shares with valid credentials
- Operations can be paused and resumed across sessions
- External domain connectivity with custom DNS and direct DC connections
- Enhanced resilience for long-running penetration testing operations
giveen added a commit to giveen/Snaffler that referenced this pull request Mar 6, 2026
- Mark directory as scanned at end of WalkTree (after all file/subdir
  tasks are queued) instead of on entry. Prevents files being silently
  dropped when the process is killed between the entry mark and the
  actual file-task execution. Inspired by analysis of upstream PR SnaffCon#171.
- CheckpointManager.TryLoad(): prune child-directory entries whose
  parent is already in the completed set. The parent being marked means
  WalkTree will skip it entirely, making any child entries unreachable
  and dead weight. Pruning keeps the in-memory set lean and now reports
  how many redundant entries were dropped at resume time.
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