1. 개요
Windows 사용자 계정을 긁어모으는 Enumeration 도구이다. 로그인이 되는 계정 하나를 가지고 그 서버에 존재하는 모든 사용자 명단을 알아낼 수 있다.
1.1. 원리
Windows 는 사용자를 관리하는 SID 를 알아야 한다. 내부적으로 이름(예. administrator)가 아니라 S-1-5-21-12345678-12345678-12345678-500 과 같은 번호로 관리된다.
여기서 중요한 것은 맨 마지막 숫자이다 .이를 RID 라고 부른다.
-
500 : Administrator
-
501 : Guest
-
1000 부터 .. : 일반 사용자들이 순서대로 발급 받음
lookupsid 는 서버에 접속해서 도메인 고유번호를 알아내고 그 뒤에 RID 숫자(500, 1000, 1001, …) 을 하나씩 알아낸다. 이 과정을 통해서 사용자의 목록을 뽑아낸다.
2. 사용법
2.1. 기본 사용법
┌──(root㉿kali)-[/home/kali/labs/Flight]
└─# impacket-lookupsid flight.htb/svc_apache:'S@Ss!K@*t13'@10.129.37.19
Impacket v0.13.0.dev0 - Copyright Fortra, LLC and its affiliated companies
[*] Brute forcing SIDs at 10.129.37.19
[*] StringBinding ncacn_np:10.129.37.19[\pipe\lsarpc]
[*] Domain SID is: S-1-5-21-4078382237-1492182817-2568127209
498: flight\Enterprise Read-only Domain Controllers (SidTypeGroup)
500: flight\Administrator (SidTypeUser)
501: flight\Guest (SidTypeUser)
502: flight\krbtgt (SidTypeUser)
512: flight\Domain Admins (SidTypeGroup)
513: flight\Domain Users (SidTypeGroup)
514: flight\Domain Guests (SidTypeGroup)
515: flight\Domain Computers (SidTypeGroup)
516: flight\Domain Controllers (SidTypeGroup)
517: flight\Cert Publishers (SidTypeAlias)
518: flight\Schema Admins (SidTypeGroup)
519: flight\Enterprise Admins (SidTypeGroup)
520: flight\Group Policy Creator Owners (SidTypeGroup)
521: flight\Read-only Domain Controllers (SidTypeGroup)
522: flight\Cloneable Domain Controllers (SidTypeGroup)
525: flight\Protected Users (SidTypeGroup)
526: flight\Key Admins (SidTypeGroup)
527: flight\Enterprise Key Admins (SidTypeGroup)
553: flight\RAS and IAS Servers (SidTypeAlias)
571: flight\Allowed RODC Password Replication Group (SidTypeAlias)
572: flight\Denied RODC Password Replication Group (SidTypeAlias)
1000: flight\Access-Denied Assistance Users (SidTypeAlias)
1001: flight\G0$ (SidTypeUser)
1102: flight\DnsAdmins (SidTypeAlias)
1103: flight\DnsUpdateProxy (SidTypeGroup)
1602: flight\S.Moon (SidTypeUser)
1603: flight\R.Cold (SidTypeUser)
1604: flight\G.Lors (SidTypeUser)
1605: flight\L.Kein (SidTypeUser)
1606: flight\M.Gold (SidTypeUser)
1607: flight\C.Bum (SidTypeUser)
1608: flight\W.Walker (SidTypeUser)
1609: flight\I.Francis (SidTypeUser)
1610: flight\D.Truff (SidTypeUser)
1611: flight\V.Stevens (SidTypeUser)
1612: flight\svc_apache (SidTypeUser)
1613: flight\O.Possum (SidTypeUser)
1614: flight\WebDevs (SidTypeGroup)
2.2. 계정 정보만 추출하는 스크립트
┌──(root㉿kali)-[/home/kali/labs/Flight]
└─# impacket-lookupsid flight.htb/svc_apache:'S@Ss!K@*t13'@flight.htb | grep SidTypeUser | cut -d' ' -f 2 | cut -d'\' -f 2 | tee users
Administrator
Guest
krbtgt
G0$
S.Moon
R.Cold
G.Lors
L.Kein
M.Gold
C.Bum
W.Walker
I.Francis
D.Truff
V.Stevens
svc_apache
O.Possum