บทนำ (Overview)
จากบทความก่อนหน้าอธิบายถึงช่องโหว่ของ Web application โปรแกรมติดตามเพิ่มเติมได้จาก How to upload PHP shell – Sedna (BuilderEngine 3.5.0) มาในบทความนี้กล่าวถึงวิธีการตรวจสอบช่องโหว่ของโปรแกรมอื่น ๆ ที่ถูกติดตั้งภายในระบบปฏิบัติการ ที่อาจมีช่องโหว่นำไปสู่การยกระดับสิทธิให้สูงจากเดิมเป็นผู้ดูแลระบบ
This article describes the steps of reviewing the vulnerability of packages which were installed in Operating System. These packages may be exploited to escalate the privileges to the administrator.
ขั้นตอน (Steps)
- ดาวน์โหลด Linux Privilege Escalation Scripts จากเว็บไซต์ http://netsec.ws/?p=309
Download Linux privilege Escalation Script from http://netsec.ws/?p=309 - จากนั้น upload โหลดไปยังเครื่องเป้าหมาย และเปลี่ยน permission ให้สามารถ Execute ได้
Upload the script to the target machine and then, change the permission to group which could be executed as the following commands:chmod 777 linuxprivchecker.py python linuxprivchecker.py
- เมื่อเสร็จสิ้นจะแสดงผลตามภาพให้เราตรวจสอบในส่วน Packages ที่ได้ถูก Install [+] Installed Packages ในเครื่อง
Based on the result scanning, review the part of “installed packes”. - ตรวจสอบ Package และ Version ที่อาจช่องโหว่ จากตัวอย่างเราพบว่า Packages ที่ชื่อ Apport มี Version 2.14.1.0 เป็นไปได้ว่ามีช่องโหว่ ในการยกระดับสิทธิเป็น Root
Try to review the installed packages and version which are possibly vulnerable. From our review, we found a package named Apport that had the version 2.14.1.0 that may be privilege escalation vulnerability.https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-1318
- ให้ดาวน์ Exploit มาใช้งาน
Download to target machine.https://www.exploit-db.com/exploits/36746/
- จากนั้น Compile ตัว Source-code ที่เครื่องเป้าหมายและเรียกใช้งาน
Use the gcc with –static command to compile the source-code and run it. If successful, we would get the shell prompt.gcc -pthread 36746.c -o 36746 -static ./36746