machine_role.py
determine a remote Windows host's domain role (Impacket)
TLDR
SYNOPSIS
machine_role.py [options] [[domain/]username[:password]@]target
DESCRIPTION
machine_role.py is an Impacket example that retrieves a Windows host's machine role and primary domain information through MS-DSSP (`DsRolerGetPrimaryDomainInformation`) on the `lsarpc` pipe.It prints one of: standalone workstation, domain-joined workstation, standalone server, domain-joined server, backup domain controller, or primary domain controller, plus NetBIOS domain name, DNS domain name, forest name, and domain GUID.Distro packages often install the same tool as impacket-machine_role. The two names share the same script and options.
PARAMETERS
target
Target in Impacket form: `[[domain/]username[:password]@]targetName or address`.-target-ip IP
IP address of the target. Defaults to the host in target.-dc-ip IP
Domain controller IP used for Kerberos.-port {139,445}
SMB port (default: `445`).-hashes LMHASH:NTHASH
NTLM hashes instead of a password.-no-pass
Do not prompt for a password (use with -k or -hashes).-k
Kerberos authentication from `KRB5CCNAME` when possible.-aesKey HEX
AES-128 or AES-256 key for Kerberos (implies -k).-debug
Enable debug output.-ts
Prefix log lines with a timestamp.
INSTALL
CAVEATS
Needs SMB access (typically TCP 445) and credentials the target accepts. Not a general Unix/Samba inventory tool. For authorized security testing only.
HISTORY
Part of the Impacket suite, originally by SecureAuth and now maintained by Fortra. Written by Simon Decosse.
SEE ALSO
impacket-machine_role(1), impacket-getarch(1), impacket-smbclient(1), impacket(1)
