Skip to content

smbclient.py: add DFS support with nested referrals and failover#2116

Open
durck wants to merge 2 commits intofortra:masterfrom
durck:master
Open

smbclient.py: add DFS support with nested referrals and failover#2116
durck wants to merge 2 commits intofortra:masterfrom
durck:master

Conversation

@durck
Copy link

@durck durck commented Feb 9, 2026

This PR adds Distributed File System (DFS) support to smbclient.py.

What's added:

  • DFS referral protocol structures in smb3structs.py
  • getDFSReferral() method in SMBConnection (FSCTL_DFS_GET_REFERRALS)
  • ATTR_REPARSE_POINT and is_reparse_point() for SharedFile
  • Stack-based DFS context supporting arbitrary nesting depth
  • Multi-target failover loop over all referral targets
  • Connection health checks for cached DFS connections
  • DFS boundary detection for cd ../.. navigation
  • OPSEC mode: -dfs-follow CLI flag and dfs_mode on/off command
  • [DFS] markers in ls output and dfs_info command

Files changed: examples/smbclient.py, impacket/examples/smbclient.py, impacket/smb.py, impacket/smb3structs.py, impacket/smbconnection.py

durck and others added 2 commits February 9, 2026 16:17
…OPSEC mode

- Add DFS referral protocol structures to smb3structs.py
- Add getDFSReferral() to SMBConnection (FSCTL_DFS_GET_REFERRALS)
- Add ATTR_REPARSE_POINT and is_reparse_point() to SharedFile
- Implement stack-based DFS context for arbitrary nesting depth
- Add multi-target failover loop over all referral targets
- Add connection health checks for cached DFS connections
- Add DFS boundary detection for cd ../.. navigation
- Add OPSEC: -dfs-follow CLI flag and dfs_mode on/off command
- Add [DFS] markers in ls and dfs_info command
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

medium Medium priority item

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants