Skip to content

Impacket DumpNTLMInfo.py

Back to the category index / Back to the command index

Negotiates NTLM over SMB or RPC and displays challenge information, SMB settings, timestamps, and other details.

ItemDetails
Implementationexamples/DumpNTLMInfo.py
CategorySMB / MSRPC / NTLM
Size675 lines
DistributionInstalled as a script through scripts=examples/*.py in setup.py

Run python examples/DumpNTLMInfo.py -h for the current option definitions.

ArgumentDescription
target
-debugTurn DEBUG output ON
-tsAdds timestamp to every logging output
-target-ipIP Address of the target machine. If omitted it will use whatever was specified as target. This is useful when target is the NetBIOS name and you cannot resolve it
-portDestination SMB/RPC server port (default: 445)
-protocolProtocol to use (SMB or RPC); default: SMB, though port 135 normally uses RPC (choices: SMB, RPC)

The tool selects an SMB1, SMB2/3, or RPC implementation based on the protocol and port. It negotiates, obtains an NTLM challenge, and optionally attempts anonymous authentication. DumpNtlm converts the challenge and protocol-specific responses into a common display.

The command observes negotiation data before establishing a fully authenticated session. Over SMB, it proceeds through dialect negotiation and part of Session Setup to obtain the server’s NTLM challenge. Over RPC, it sends a bind or request to an Endpoint Mapper or similar interface and likewise analyzes the challenge generated by the NTLM security provider.

The target information in an NTLM challenge is a set of AV pairs containing NetBIOS and DNS computer names, domain names, timestamps, flags, and other values. DumpNtlm extracts the challenge token from a protocol-specific packet, then passes it to this common structure. For SMB, it also displays the dialect, whether signing is required or enabled, server time, and maximum read and write sizes from the negotiate response.

SMB1 and SMB2/3 represent packet headers, commands, and capabilities differently, so SMB1 and SMB3 implement their low-level requests separately. Correctly identify the dialect after wildcard negotiation and decode subsequent packets on the same socket. A successful or failed null session says something about policy, but does not show whether ordinary users can authenticate.

SymbolLocationWhere to trace its responsibility
RPC65__init__(), GetChallange()
SMB1119__init__(), GetNegotiateResponse(), GetChallange(), Authenticate(), send(), receive()
SMB3277__init__(), GetNegotiateResponse(), GetChallange(), Authenticate(), send(), receive()
SmbConnection398__init__(), IsSmb1Enabled(), NegotiateSession(), GetChallange(), Authenticate()
DumpNtlm483__init__(), DisplayInfo(), DisplayRpcInfo(), DisplaySmbInfo(), DisplaySigning(), DisplayDialect(), DisplayIo(), DisplayTime(), DisplayChallangeInfo(), DisplayNullSession()
ModuleMain names used
impacketnmb, ntlm, version
impacket.exampleslogger
impacket.smbNewSMBPacket, SMB, SMBCommand, SMBExtended_Security_Data, SMBExtended_Security_Parameters, SMBNTLMDialect_Data, SMBNTLMDialect_Parameters, SMBSessionSetupAndXResponse_Parameters, SMBSessionSetupAndX_Extended_Data, SMBSessionSetupAndX_Extended_Parameters, SMBSessionSetupAndX_Extended_Response_Data, SMBSessionSetupAndX_Extended_Response_Parameters, SMB_DIALECT, UnsupportedFeature
impacket.smb3structs*
impacket.spnegoSPNEGO_NegTokenInit, SPNEGO_NegTokenResp, TypesMech
impacket.nt_errorsSTATUS_MORE_PROCESSING_REQUIRED, STATUS_SUCCESS
impacket.uuiduuidtup_to_bin
impacket.dcerpc.v5epm, transport
impacket.dcerpc.v5.rpcrt*
Import nameDistribution packageImport path and declaration status
sixsixImported directly; declared

Output, side effects, and required privileges

Section titled “Output, side effects, and required privileges”
  • The tool primarily makes queries and authentication attempts. Frequent runs can affect audit logs, account lockouts, and target load.
  • On failure, use protocol status codes to determine whether name resolution, connection, authentication, service state, or permissions caused the stop.

The code depends on low-level smb, smb3structs, ntlm, spnego, and dcerpc.v5.rpcrt, transport, and epm. It intentionally works below standard SMBConnection, so preserve packet fields and dialect-specific branches.