Skip to content

Conversation

@dotPY-hax
Copy link

This PR offers some improvements to the SMB part of impacket.

  • refactored the authentication logic to happen inside the SMBServer class instead of smbComSessionSetupAndX which allows for custom authentication logic to be implemented on server level instead of protocol level.
  • PromiscuousSMBServer inherits from SMBServer and allows to give authenticated sessions to any user with any password, specific users with any password or the classic username:password authentication. This allows to use proper authenticated sessions without having to maintain credentials. This class can be used by either SimpleSMBServer or other implementations.
  • SimpleTempSMBServer inherits from SimpleSMBServer and uses only temporary files. This allows easier use of SMB as payload delivery. Further SimpleTempSMBServer can be used as a context manager and cleans up after exiting which is useful for tool development and attacks which specifically use SMB shares.
  • examples/tempsmbserver.py uses PromiscuousSMBServer and SimpleTempSMBServer to act as an easy to use payload delivery and file receiver. A detailed description can be found in the description part of the example file.

The refactor passes all existing local tests (pytest -m "not remote" ), the new functions in PromiscuousSMBServer and SimpleTempSMBServer received their own tests. The functionality has been tested manually in kali with impacket tools and nxc.

@dotPY-hax dotPY-hax changed the title Promiscuous and Temp SMB Servers Add Promiscuous and Temp SMB Servers Nov 9, 2025
@anadrianmanrique anadrianmanrique self-assigned this Nov 13, 2025
@anadrianmanrique anadrianmanrique added the in review This issue or pull request is being analyzed label Nov 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in review This issue or pull request is being analyzed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants