SMB¶
Section [SMB]¶
- SMB.Server: list¶
Each entry corresponds to an instance of
smb.SMBServerConfigDefines a list of SMB server configuration sections. For instructions on configuring section lists, refer to the general configuration guide Array Tables for TOML.
Attributes listed below can alternatively be specified in the global
[SMB]section to serve as default values for all individual server entries.- Server.Port: int¶
Maps to
smb.SMBServerConfig.smb_portSpecifies the port on which the SMB server instance listens. This setting is required and cannot be used in the
[SMB]section.Important
This attribute must be defined within a dedicated
[[SMB.Server]]section.
- Server.ServerOS: str¶
Map to
smb.SMBServerConfig.smb_server_os. May also be set in[SMB]Defines the operating system for the SMB server. These values are used when crafting responses.
- Server.ServerName: str¶
- Server.ServerDomain: str¶
Map to
smb.SMBServerConfig.smb_server_XXX. May also be set in[SMB]Defines identification metadata for the SMB server. These values are used when crafting responses.
Removed in version 1.0.0.dev8:
ServerNameandServerDomainwere merged intoSMB.Server.FQDN
- Server.FQDN: str = "Dementor"¶
Linked to
smb.SMBServerConfig.smb_fqdn. Can also be set in[SMB]or[Globals]Specifies the Fully Qualified Domain Name (FQDN) hostname used by the SMB server. The hostname portion of the FQDN will be included in server responses. The domain part is optional and will point to
WORKGROUPby default.Added in version 1.0.0.dev8.
- Server.ErrorCode: str | int = nt_errors.STATUS_SMB_BAD_UID¶
Maps to
smb.SMBServerConfig.smb_error_code. May also be set in[SMB]Specifies the NT status code returned when access is denied. Accepts either integer codes or their string representations (e.g.,
"STATUS_ACCESS_DENIED"). Example values:3221225506or"STATUS_ACCESS_DENIED"5963778or"STATUS_SMB_BAD_UID"
For a comprehensive list of status codes, refer to the
impacket.nt_errorsmodule.See also
Use case: Tricking Windows SMB clients into falling back to WebDav.
- Server.SMB2Support: bool = true¶
Maps to
smb.SMBServerConfig.smb2_support. May also be set in[SMB]Enables support for the SMB2 protocol. Recommended for improved client compatibility.
- Server.ExtendedSessionSecurity: bool = true¶
Maps to
smb.SMBServerConfig.smb_ess. May also be set in[SMB]Enables Extended Session Security (ESS) during NTLM authentication. When ESS is enabled, the server captures NTLMv1/v2-SSP hashes instead of standard NTLMv1/v2 hashes. Resolution precedence:
If defined,
SMB.Server.ExtendedSessionSecuritytakes precedence.If not,
SMB.ExtendedSessionSecurityis used.Finally, falls back to
NTLM.ExtendedSessionSecurityif the above are unset.
- Server.Challenge: str = NTLM.Challenge¶
Maps to
smb.SMBServerConfig.smb_challenge. May also be set in[SMB]Defines the challenge value used during NTLM authentication. Resolution precedence:
SMB.Server.Challenge(if defined)SMB.Challenge(fallback)NTLM.Challenge(final fallback)
Note
If none of the above attributes are set, the SMB server will generate a random challenge value for each session.
- class smb.SMBServerConfig¶
Configuration class for entries under
SMB.ServerRepresents the configuration for a single SMB server instance.
- smb_port: int¶
Corresponds to
SMB.Server.Port
- smb_server_os: str = "Windows"¶
Corresponds to
SMB.Server.ServerOS
- smb_server_name: str = "DEMENTOR"¶
Corresponds to
SMB.Server.ServerNameRemoved in version 1.0.0.dev8: Merged into
SMB.Server.FQDN
- smb_server_domain: str = "WORKGROUP"¶
Corresponds to
SMB.Server.ServerDomainRemoved in version 1.0.0.dev8: Merged into
SMB.Server.FQDN
- smb_fqdn: str = "DEMENTOR"¶
Corresponds to
SMB.Server.FQDNAdded in version 1.0.0.dev8.
- smb_error_code: str | int = nt_errors.STATUS_SMB_BAD_UID¶
Corresponds to
SMB.Server.ErrorCodeYou can use
set_smb_error_code()to set this attribute using a string or an integer.
- smb2_support: bool = True¶
Corresponds to
SMB.Server.SMB2Support
- smb_ess: bool = True¶
Corresponds to
SMB.Server.ExtendedSessionSecurity
- smb_challenge: bytes = b""¶
Corresponds to
SMB.Server.ChallengeBy default, a random challenge will be generated based on the rules described in
SMB.Server.Challenge.
Default Configuration¶
1[SMB]
2ServerOS = "Windows"
3FQDN = "DEMENTOR"
4SMB2Support = true
5ErrorCode = "STATUS_SMB_BAD_UID"
6
7[[SMB.Server]]
8Port = 139
9
10[[SMB.Server]]
11Port = 445