전체 글

배경auth.log, wtmp 로그를 주로 분석하는 문제다. 이름처럼 bruteforce 시나리오를 다루게 된다.auth.log와 wtmp 파일 그리고 wtmp 파일을 파싱해주는 utmp.py가 주어져 있다.(wtmp 파일은 binary data기 때문에 눈으로 확인하려면 파싱이 필요하다.) auth.log?auth.log는 Linux에서 인증 및 권한 관련 이벤트를 기록해주는 로그 파일이다.지금까지는 단순 로그인 기록만 나와 있는 로그인 줄 알았지만, 이번 문제를 통해 sudo, su 같은 권한 관련 행위와 사용자 생성, 그룹 추가와 같은 행위들도 나와 있다는 것을 깨달았다.이 로그 파일을 분석하면 로그인 시도와 성공 여부, 세션 ID, Timestamp 등을 얻을 수 있기 때문에 bruteforce ..
Challenge Information  Enumeration & Attack PlanningNetwork┌──(root㉿kali)-[~/Desktop/htb/Support]└─# nmap -sV 10.10.11.174PORT STATE SERVICE VERSION53/tcp open domain Simple DNS Plus88/tcp open kerberos-sec Microsoft Windows Kerberos (server time: 2024-10-07 01:04:47Z)135/tcp open msrpc Microsoft Windows RPC139/tcp open netbios-ssn Microsoft Windows netbios-..
Ticket을 받아오는 과정에서 위 사진처럼 KRB_AP_ERR_SKEW 오류가 뜨는 경우 시간대를 DC와 맞춰준다면 해결된다. kerberos 인증 과정에서 현재 timestamp를 사용하는데, 이 때 로컬 시간과 DC의 시간이 다르면 발생하는 문제인 것 같다. $ timedatectl set-ntp off # 시간 동기화 비활성화$ rdate -n [dc ip] # dc ip에서 시간 정보를 가져와 동기화
Challenge Information Enumeration & Attack PlanningNetwork┌──(root㉿kali)-[~/Desktop/htb]└─# nmap -sV 10.10.10.98Starting Nmap 7.94 ( https://nmap.org ) at 2023-11-08 06:05 ESTStats: 0:02:40 elapsed; 0 hosts completed (1 up), 1 undergoing Service ScanService scan Timing: About 66.67% done; ETC: 06:09 (0:01:14 remaining)Nmap scan report for 10.10.10.98Host is up (0.23s latency).Not shown: 997 filt..
Challenge Information  Enumeration & Attack PlanningNetwork┌──(root㉿kali)-[~/Desktop/htb]└─# nmap -sV 10.10.10.175Starting Nmap 7.94 ( https://nmap.org ) at 2023-11-22 23:41 ESTNmap scan report for 10.10.10.175Host is up (0.23s latency).Not shown: 988 filtered tcp ports (no-response)PORT STATE SERVICE VERSION53/tcp open domain Simple DNS Plus80/tcp open http Micro..
Challenge Information  Enumeration & Attack PlanningNetwork──(root㉿kali)-[~/Desktop/htb]└─# nmap -sV 10.10.10.100Starting Nmap 7.94 ( https://nmap.org ) at 2024-07-02 01:12 EDTStats: 0:00:26 elapsed; 0 hosts completed (1 up), 1 undergoing Service ScanService scan Timing: About 52.94% done; ETC: 01:13 (0:00:14 remaining)Nmap scan report for 10.10.10.100Host is up (0.24s latency).Not shown: 983 cl..
CheatSheet> Import-Module ActiveDirectory# 권한을 부여할 사용자의 SID를 get / ACE를 구성할 때 사용> $usid = (Get-ADUser -Identity [username]).SID # target principal의 DN / ACL object를 가져오고 변경 사항을 적용할 때 사용> $object_dn = "CN=[target],OU=[object unit],DC=[domain],DC=[tld]" # target principal의 ACL Object를 get> $acl_object = Get-ACL -Path "AD:$object_dn"# 적용할 ACE 생성> $ace = New-Object System.DirectoryServices.ActiveDi..
Challenge Information Enumeration & Attack PlanningNetwork┌──(root㉿kali)-[~/Desktop/htb/Forest]└─# nmap -sV 10.10.10.161Starting Nmap 7.94 ( https://nmap.org ) at 2023-11-02 00:26 EDTNmap scan report for 10.10.10.161Host is up (0.22s latency).Not shown: 989 closed tcp ports (reset)PORT STATE SERVICE VERSION53/tcp open domain Simple DNS Plus88/tcp open kerberos-sec Microsoft ..
사실 DCSync는 BloodHound에서 표시해주는 용어로 DACL은 아니지만, 편의상 DACL 카테고리로 분류했다. DCSync?AD 환경에는 Domain Controller 간의 데이터 동기화를 위한 과정인 Replication이 존재한다.Replication에 사용되는 특별한 권한들이 있는데, 이를 이용하면 NTDS.dit 데이터를 추출할 수 있다.이 특별한 권한들을 통틀어서 BloodHound에서 DCSync라는 Edge로 표시해준다.⇒ Domain에 대한 DCSync Edge가 있다면 NTDS.dit을 추출할 수 있다. Replication?여러 Domain Controller로 구성된 AD 환경의 경우, 각 DC 간의 데이터 동기화를 위해 Replication을 수행해야한다.이 때 사용되는 ..
JuicyPotato?SeImpersonate, SeAssignPrimaryToken 권한을 통한 LPEWindows Server 2019, Windows 10 build 1809 위로는 작동하지 않는다.JuicyPotato는 com 취약점을 악용하여 NT System Token을 얻고 이를 통해 프로세스를 생성하는 방식으로 동작하는데, 위 버전부터 해당 취약점이 동작하지 않아 작동이 안된다. CheatSheet# -l : com 요청을 수신할 포트. 안쓰이고 있는 아무 포트나 적어도 된다.# -p : NT System 권한으로 실행할 프로그램# -a : 실행할 프로그램에 줄 인자# -t : process 생성에 사용할 api. *을 주면 알아서 선택해서 해준다.## SeImpersonate -> Cre..
PrintSpoofer?SeImpersonate 권한이 있는 상황에서 LPE를 수행해주는 도구 https://github.com/itm4n/PrintSpoofer GitHub - itm4n/PrintSpoofer: Abusing impersonation privileges through the "Printer Bug"Abusing impersonation privileges through the "Printer Bug" - itm4n/PrintSpoofergithub.com  CheetSheet# -c : 실행할 명령# -i : -c를 통해 실행한 프로세스와 interactive (기본적으론 non-interactive)## cmd, powershell을 실행시킬 경우 상호작용을 해야하므로 -i 옵션을 ..
노션으로 작성했기에, 아래 링크로 접속한다면 볼 수 있습니다. https://dyp4r.notion.site/CVE-2021-44228-log4shell-2a96306d9fce4c438a2f6e602c518507?pvs=4
dyp4r
dyp4r's Study Blog