woonadz :)

BlueSky Ransomware Blue Team Lab - Network Forensics 본문

IT/BlueTeam CTF

BlueSky Ransomware Blue Team Lab - Network Forensics

Crain 2024. 7. 9. 20:32
반응형

 

Q1. Knowing the source IP of the attack allows security teams to respond to potential threats quickly. Can you identify the source IP responsible for potential port scanning activity?

포트 스캐닝을 할 때는 보통 TCP, UDP, ICMP 프로토콜을 사용할 가능성이 큽니다. 그 중 87.96.21.84 주소에서 TCP 프로토콜을 통해 SYN 패킷을 지속적으로 보냈기 때문에 포트 스캐닝이라 판단하였습니다.

 

Q2. During the investigation, it's essential to determine the account targeted by the attacker. Can you identify the targeted account username?

Q3. We need to determine if the attacker succeeded in gaining access. Can you provide the correct password discovered by the attacker?

패킷들을 확인하다보면 MSSQL Server에 대해 로그인을 성공한 패킷을 발견할 수 있습니다. 해당 패킷의 Login 정보를 확인하면 사용자 계정과 패스워드 등의 정보를 확인할 수 있습니다.

 

더보기

TDS Protocol

  • TDS (Tabular Data Stream) 프로토콜은 Microsoft SQL Server와 Sybase ASE (Adaptive Server Enterprise) 데이터베이스 서버와 클라이언트 간의 통신을 관리하는 애플리케이션 계층 프로토콜입니다. TDS는 클라이언트와 서버 간의 요청과 응답을 처리하고, 데이터베이스 쿼리와 명령어를 전달하는 데 사용됩니다. 
    • 기본적으로 암호화를 제공하지 않지만 SSL/TLS를 통해 TDS 트래픽 암호화 가능
    • 기본적으로 TCP 포트 1433번 사용
    • TDS Protocol Pre-Login Message : 클라이언트가 SQL Server와의 연결을 설정하기 전에 서버와 통신하는 초기 핸드셰이크 단계

 

Q4. Attackers often change some settings to facilitate lateral movement within a network. What setting did the attacker enable to control the target host further and execute further commands?

EXEC sp_configure 'show advanced options', 1; RECONFIGURE; EXEC sp_configure 'xp_cmdshell', 1; RECONFIGURE;

위의 명령을 실행하며, 명령의 내용은 SQL Server에서 고급 옵션을 볼 수 있게 되고, xp_cmdshell의 사용을 허용합니다.

xp_cmdshell의 사용을 허용하면 운영체제 명령을 실행시킬 수 있기 때문에 측면이동과 관련이 있다고 판단하였습니다.

 

Q5. Process injection is often used by attackers to escalate privileges within a system. What process did the attacker inject the C2 into to gain administrative privileges?

문제에서 제공된 이벤트 로그를 확인하면 MSFConsole이 Powershell 엔진을 사용하는 것을 알 수 있습니다. MSFConsole은 Metasploit Framework의 콘솔 인터페이스로, 이를 이용해 권한 상승을 수행할 수 있다고 판단하였습니다. 또한 PowerShell 엔진이 winlogon.exe 프로세스 내에서 실행되고 있음을 의미하기 때문에 winlogon 프로세스에 코드 인젝션을 수행하여 권한 상승을 수행하였다고 추측하였습니다.

 

Q6. Following privilege escalation, the attacker attempted to download a file. Can you identify the URL of this file downloaded?

Wireshark를 통해 가장 먼저 다운되는 파일을 확인할 수 있었습니다. 이후 4221번 패킷 근처에 GET method를 통해 파일을 요청하는 패킷에서, 요청을 보낸 URI 값을 찾을 수 있었습니다.

 

Q7. Understanding which group Security Identifier (SID) the malicious script checks to verify the current user's privileges can provide insights into the attacker's intentions. Can you provide the specific Group SID that is being checked?

checking.ps1 파일을 다운받아 코드를 확인하면 S-1-5-32-544 값과 SID가 매칭하는지 확인하는 코드를 확인할 수 있었습니다. S-1-5-32-544는 Administrators 그룹에 대한 SID 값을 의미합니다.

 

Q8. Windows Defender plays a critical role in defending against cyber threats. If an attacker disables it, the system becomes more vulnerable to further attacks. What are the registry keys used by the attacker to disable Windows Defender functionalities? Provide them in the same order found.

checking.ps1 파일의 StopAV 함수에서 Windows Defender를 끄는 코드를 확인할 수 있습니다. 빨간 박스 안에 있는 레지스트리 키를 설정하여 Windows Defenders를 비활성화하였습니다.

 

Q9. Can you determine the URL of the second file downloaded by the attacker?

두번째 악성 파일은 첫번째 파일의 악성 행위가 끝나며, 다운 받을 것이라 생각하여 checking.ps1 파일의 코드를 추가적으로 확인하였습니다.

또는 6번처럼 패킷을 따라가며, 어떤 파일을 다운로드 받는지 확인할 수도 있습니다.

 

Q10. Identifying malicious tasks and understanding how they were used for persistence helps in fortifying defenses against future attacks. What's the full name of the task created by the attacker to maintain persistence?

문제에서 지속성 유지를 위해 작업을 생성한다는 힌트를 주어줬습니다. 작업을 생성한다는 것은 작업 스케줄러를 통해 예약을 생성한다는 것이기에 del.ps1 파일을 다운받아 작업 스케줄러를 등록하는 코드를 찾으려고 했으나, checking.ps1 파일에서 작업 스케줄러를 등록하는 행위를 하고 있었습니다… 허허

 

Q11. According to your analysis of the second malicious file, what is the MITRE ID of the tactic the file aims to achieve?

두번째로 다운받는 파일의 이름이 del.ps1 이라는 점과 실제 코드를 확인했을 때 분석 툴들의 실행을 멈춘다는 점에서 방어 회피 Tatic 에 해당한다고 생각하였습니다.

 

Q12. What's the invoked PowerShell script used by the attacker for dumping credentials?

Wireshark에서 확인한 다운받은 파일 목록 중 Invoke-PowerDump.ps1 이라는 파일을 찾을 수 있었습니다. 해당 파일은 Empire라는 펜테스팅 도구에서 제공하는 자격 증명 덤핑 스크립트입니다.

https://github.com/EmpireProject/Empire/blob/master/data/module_source/credentials/Invoke-PowerDump.ps1

https://github.com/BC-SECURITY/Empire

 

GitHub - BC-SECURITY/Empire: Empire is a post-exploitation and adversary emulation framework that is used to aid Red Teams and P

Empire is a post-exploitation and adversary emulation framework that is used to aid Red Teams and Penetration Testers. - BC-SECURITY/Empire

github.com

 

Q13. Understanding which credentials have been compromised is essential for assessing the extent of the data breach. What's the name of the saved text file containing the dumped credentials?

ichigo-PowerDump.ps1 파일을 확인하면 hashes.txt 파일의 내용을 읽는 코드를 확인할 수 있습니다. 해당 코드 위에는 Invoke-PowerDump.ps1 를 다운로드하고 실행시키는 코드가 존재하고, 아래 hashes.txt에서 읽어온 값에 대해 계정 정보인지를 확인하는 코드가 존재하기 때문에 자격 증명이 저장된 파일이라고 판단하였습니다.

 

Q14. Knowing the hosts targeted during the attacker's reconnaissance phase, the security team can prioritize their remediation efforts on these specific hosts. What's the name of the text file containing the discovered hosts?

Wireshark에서 전송된 파일들을 확인할 때 extracted_hosts.txt 파일명을 발견할 수 있습니다. 실제로 해당 파일을 다운받아 열어보면 타깃 호스트들의 IP 목록이 들어있습니다.

 

Q15. After hash dumping, the attacker attempted to deploy ransomware on the compromised host, spreading it to the rest of the network through previous lateral movement activities using SMB. You’re provided with the ransomware sample for further analysis. By performing behavioral analysis, what’s the name of the ransom note file?

 

javaw.exe 파일이 bluesky 랜섬웨어의 행위를 하는 파일이었습니다. 해당 랜섬웨어 파일을 실제로 VM에서 실행시키거나, 해시값을 떠서 VT에 올려 랜섬노트명을 확인할 수 있습니다.

 

Q16. In some cases, decryption tools are available for specific ransomware families. Identifying the family name can lead to a potential decryption solution. What's the name of this ransomware family?

javaw.exe 파일의 해시값을 VT에 올렸을 때, Conti 라는 패밀리명을 확인할 수 있습니다. (Conti와 BlueSky가 aka 관계라고는 할 수 없습니다.)

포트 스캐닝을 할 때는 보통 TCP, UDP, ICMP 프로토콜을 사용할 가능성이 큽니다. 그 중 87.96.21.84 주소에서 TCP 프로토콜을 통해 SYN 패킷을 지속적으로 보냈기 때문에 포트 스캐닝이라 판단하였습니다.

 

반응형

'IT > BlueTeam CTF' 카테고리의 다른 글

Red Stealer Blue Team Lab - Threat Intel  (0) 2024.07.09
Ramnit Blue Team Lab - Endpoint Forensics  (1) 2024.02.04