ฺBinary Exploitation คืออะไร ?

Binary exploitation คืออะไร ? มีวิธีการอย่างไร วันนี้ผมได้นำความรู้ดีๆ มาประเคนให้ทราบกันครับ
Binary exploitation คือ ศิลปะการดัดแปลงโปรแกรมคอมพิวเตอร์ตามที่เราๆต้องการ Binary exploitation ถือว่าเป็นความรู้ขั้นพื้นฐานที่ทุกท่านจำเป็นต้องรู้สำหรับคนที่ต้องการจะเป็นแฮกเกอร์เลยก็ว่าได้ เอาล่ะมาศึกษาวิธีการจาก picoCTF กันเลยดีกว่า


Binary demo 1 : leaning by doing from picoCTF bainary challenges

ก่อนอื่นให้เปิดลิ๊งนี้ขึ้นมาก่อน https://picoctf.com/binary_demo/binary_demo.html#1 
แบบฝึก binary_demo1 จะคล้ายๆกับ picoCTF bainary challenges ที่ผ่านมา เมื่อเราให้ command line argument ที่ถูกต้อง  binary_demo1 จะให้ shell invoke ที่เอาไว้ใช้สำหรับ picoCTF challenges โดยปกติแล้ว challenges binary มักจะเป็น setgid binary แล้วมันยังไงล่ะ? มันก็จะทำให้เราใช้สิทธ์พิเศษจาก shell invoke จาก binary ได้ เช่น สิทธิ์ในการอ่านไฟล์ ./flag  แต่ทะว่า demo binary นี้ไม่ได้เป็นแบบ setgid binary อะไรก็ก็ตามที่คุณสามารถทำได้จาก shell ของ setfid binary คุณก็จะทำได้ใน shell ของ binary_demo1 เหมือนกัน

binary_demo1 ต้องใช้ภาษา C บ้าง ซึ่งการสอนภาษา C อยู่นอกเหนือจากบทเรียนนี้ แต่ส่วนใหญ่ไม่มีอะไรมากไปกว่าที่คุณรู้มาจาก AP CS หรือ JAVA ทางที่ทีคุณควรศึกษาภาษา C จากบทเรียนออนไลน์ชักชั่วโมงก็ยังดี

อ่านไฟล์ binary_demo1.c  (คลิ๊กเพื่ออ่าน) ฟังก์ชั่นการทำงานไม่ได้ยากเกินไปที่จะมองเห็นการทำงานของมัน ให้กรอก command บางอย่างลงไป เช่น ./binary_dem1 this_is_the_password ลงไปใน webshell  จะได้แบบนี้
pico84977@shell:/home/binary_demo$ ./binary_demo1 this_is_the_password
Hi, I'm ./binary_demo1
half way there!
noooo!
pico84977@shell:/home/binary_demo$
อย่างไรก็ตาม argument ที่ต้องกรอกลงไปนั้นต้องเป็น non-ASCLL characters
หรือจะใช้ command ของ python >> python -c 'print([hex((~ord(c))%256) for c in "the"])'  command นี้ใช้เพื่อ check ว่า binary_demo1.c ถูกสร้างขึ้นมาด้วยตัวอักษรกี่บิต 

Share this:

ABOUT THE AUTHOR

Seobloggertemplates

Hello We are SeoBloggerTemplates, Our name came from the fact that we are best. We specialize in designing premium looking fully customizable highly responsive blogger templates.

0 ความคิดเห็น :

แสดงความคิดเห็น