Giới thiệu : Đây là một bài tập khá hay cho những bạn đang ôn tập các môn thi thực hành như CEH MASTE, OSCP hay SANS FOR 508 và CPENT +LPT.

Ngoài ra , các bạn đã hoành thành full CertMaster Lab Security + (SY0-601) hãy làm và record bài tập này nộp cho BQT đê nhận lab update SY0-701

Download máy ảo tại Topic https://t.me/masteriscert/2291 thuộc nhóm Security365

Các kỹ năng cần nắm vững như thu thập thông tin website từ viewsource, xem robots.txt , nmap scan, drbuster / gobuster, decode base64 hay mở đầu với ping sweep, netdiscover … có trình bày khá chi tiết trong Khóa học OWASP Top 10 WEB HACKING ở chương 1 & 2.

Ngoài ra, trong pentest lab này có phần leo thang đặc quyền khá đơn giãn như trong tài liệu Pre-OSCP của CEH VIETNAM có trình bày.

Review

  • Find hidden directories on web server
  • Decrypt clues with base64
  • Edit files to gain information needed

Enumeration

Run nmap scan to find for open ports.

Found a user.

Run a gobuster scan to find for hidden directories.

Found a base64 script

Use cyberchef to decode the base64 code and it is a RSA key.


Foothold

SSH into oscp user with the RSA key

There is txt file call ip that is run by root and sends out the ip address.

Let’s edit the file and list out the root folder in a ls.txt file. Chmod the file to view it. Restart the machine.

Edit the ip file script again to cat the flag.txt file.

Flag is found


Privilege escalation

Even though the flag is found we can gain root access with the following.

/bin/bash indicates a setuid info, these does not seem right.
root shell is gained.

Bình luận về bài viết này

Thịnh hành