Information Gatheringsmbpassword policywindowsimpacketpolicy enumeration

Polenum

Polenum extracts password policy information from remote Windows systems over SMB. It allows Linux users to query Windows password policies without needing a Windows machine.

Description

Polenum is a Python script that retrieves password policy details from Windows machines, including minimum password length, password history, complexity flags, lockout settings, and more. It authenticates using provided credentials and connects via SMB protocols on ports 139 or 445.

Use cases include penetration testing and security assessments where understanding the target system's password policy helps plan attacks like password spraying or brute-forcing. It supports non-Windows operating systems like Linux, Mac OS X, and BSD, making it accessible for cross-platform reconnaissance.

The tool relies on the Impacket library and can parse policies from both domain and builtin contexts, providing flags for password complexity, lockout thresholds, and account durations.

How It Works

Polenum uses the Impacket library to establish SMB connections (protocols 139/SMB or 445/SMB) with a Windows target using supplied credentials. It authenticates as the specified user, enumerates domains (e.g., WIN7-X86, Builtin), and queries password policy attributes like minimum length, age, complexity flags (bitmask 000000), lockout counters, and durations. Results are parsed and displayed in a structured format without requiring local Windows access.

Installation

bash
sudo apt install polenum

Flags

-h, --helpshow this help message and exit
--username, -u USERNAMEThe specified username
--password, -p PASSWORDThe password of the user
--domain, -d DOMAINThe domain or IP
--protocols [PROTOCOLS ...]['139/SMB', '445/SMB']

Examples

Get the password policy by logging in with victim:s3cr3t to 192.168.1.200 using SMB port 445
polenum victim:[email protected] '445/SMB'
Show the help message and usage information
polenum -h
Extract password policy using separate username and password flags with SMB 445
polenum --username victim --password s3cr3t 192.168.1.200 '445/SMB'
Query password policy using SMB port 139 with positional argument format
polenum victim:s3cr3t@192.168.1.200 '139/SMB'
Use explicit flags for username, password, and domain with default protocol
polenum -u victim -p s3cr3t -d WORKGROUP 192.168.1.200
Attempt both SMB protocols 139 and 445 for policy extraction
polenum --protocols '139/SMB 445/SMB' victim:s3cr3t@192.168.1.200
Specify domain/IP flag explicitly with username and password for policy enumeration
polenum -d 192.168.1.200 --username victim --password s3cr3t
Updated 2026-04-16kali.org ↗