Setup the lab
- ดาวน์โหลด และติดตั้ง Skuzzy บน VirtualBoxVM https://www.vortex.id.au/ctf/Ew_Skuzzy.ova.tgz
Download and install Skuzzy on VirtualBoxVM.
- ค้นหา IP เป้าหมาย โดยตัว VM คือ Ubantu
Find the assigned IP.
Gather the information
- เมื่อทราบ IP เป้าหมายแล้วให้ทำการค้นหา port และรายละเอียดเพิ่มเติมของ port ตั้งแต่ port หมายเลข 1 ถึง 65535 ดังนี้
When we known the target IP, tried to scan ports from number 1 to 65535.nmap -A -v -p 1-65535 192.168.1.58
- พบ port Skuzzy คือ 3260
We found the port number 3260 to review the vulnerability.
Assess and Exploit the vulnerabilities
- โดยปกติการพิสูจน์ตัวตนของ iSCSI จะถูกปิดโดยค่า Default เนื่องจากถูกติดตั้งบนสภาพแวดล้อมที่มีความปลอดภัยสูงอยู่ โดยผู้เชื่อมต่อ (initiator) จะถูกอนุญาตไว้ก่อนล่วงหน้า ดังนั้นเราจึงทดลองเชื่อมต่อ port ดังกล่าวว่าสามารถเชื่อมต่อกันได้หรือไม่ โดยติดตั้ง iSCSI Initiator และคำสั่งดังต่อไปนี้
Setting up authentication for your iSCSI devices is optional. In a secure environment, authentication is not required because only trusted initiators can access the targets. Tried to connect the port by using iSCSI Initiator as the following commands:Type 1: Download fromapt-get install open-iscsi /etc/init.d/open-iscsi restart
Type 2: Download from
https://packages.debian.org/jessie/i386/open-iscsi/download dpkg -i open-iscsi_2.0.873+git0.3b4b4500-8+deb8u2_i386.deb
- เมื่อเปิดใช้งาน Service open-iscsi แล้วให้ค้นหา iscisadm จาก IP และ Port ที่กำหนด ที่กำหนดโดยใช้คำสั่งดังนี้
When successfully install and open the iscsi service at client sidd, tried to discover the iscsiadm at the server side.iscsiadm -m discovery -t st -p 192.168.1.58:3260
- เราจะพบ Storage ที่ชื่อ 2017-02.local.skuzzy:storage.sys0 ดังนั้นเราจะทำการเชื่อมต่อโดยใช้คำสั่งดังต่อไปนี้
We found the storage named as “iqn.2017-02.local.skuzzy:storage.sys0”. This storage could be connect without any credentials.iscsiadm -m node -p 192.168.1.58 --login --target iqn.2017-02.local.skuzzy:storage.sys0 iscsiadm -m node --login
- เมื่อสามารถเชื่อมต่อได้แล้วเราจะหา Disk ที่เพิ่มเติมเข้ามา กันโดยใช้คำสั่ง
Tried to find the directory to mount the remote disks by using the following command.fdisk -l
- จากคำสั่งข้างต้น เราจะพบไดเรกทรอรี /dev/sdb ต่อมาเราทดลองเชื่อมต่อโดยใช้คำสั่งดังนี้ (Flag 1)
From above, we found directory named as “/dev/sdb”. Tried to create new folder at the client side and also mount the folder we found. So, we successfully exploit the server using the iSCSI vulnerability (Flag1).mkdir /media/root/test mount /dev/sdb /media/root/test cd /media/root/test