Skip to content

Conversation

oladush
Copy link

@oladush oladush commented Jun 22, 2025

This PR implements share permission checks as requested in #186.

Changes:

  • READ/WRITE/DELETE access check
  • New -check-access flag to verify share permissions
  • Supports -no-write-check to skip write/delete tests

Usage examples:

  1. Check specific shares:
    `python3 examples/smbclient.py 'test:[email protected]' -check-access 'MY SHARE, IPC$'`

  2. Check all available shares:
    `python3 examples/smbclient.py 'test:[email protected]' -check-access`

  3. Skip write/delete checks (read-only):
    `python3 examples/smbclient.py 'test:[email protected]' -check-access -no-write-check`

Fixes (#186)

@covertivy
Copy link
Contributor

There exists a better way of enumerating share information: one can request a share information query for level 2 or 502 and the returned struct will also hold a permissions attribute.
This is a much better way to check privileges without manually testing each access possibility by uploading and modifying random files...
It is an important feature for sure but I would advise you implement it differently...

@oladush
Copy link
Author

oladush commented Aug 1, 2025

Thanks for the feedback! I’ll check the documentation and rework the permissions check properly.

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