01204223/natas
- หน้านี้เป็นส่วนหนึ่งของ 01204223
'Natas https://overthewire.org/wargames/natas/ เป็นเกมสงครามสำหรับฝึกเกี่ยวกับความปลอดภัยบนเว็บ (ฝึก hack เว็บ)
เครื่องมือที่ใช้ในการทำ
นอกจากการกดดู source code ของ page แล้ว การ inspect รายละเอียด รวมถึงการดู request ที่ส่งไปยัง server ก็เป็นเครื่องมือสำคัญที่เราจะได้เรียนรู้ ตัวอย่างหน้าจอการ inspect ส่วน network แสดงด้านล่าง เราจะได้เห็น request และ response ของการเรียกใช้งานเว็บ
ในการเรียก request นั้น นอกจากจะกดทาง browser แล้ว เรายังสามารถใช้เครื่องมือพวก browser extension ที่เราใช้ตอนพัฒนา backend api ก็ได้
แต่เครื่องมือที่นิยมใช้กันมากจะเป็นเครื่องมือ แบบ command line ชื่อ curl ซึ่งนิยมใช้ทั้งในสายนักพัฒนาซอฟต์แวร์และด้านอื่น ๆ จึงควรลองนำมาติดตั้งและหัดใช้อย่างยิ่ง
ตัวอย่างการเรียกไปหน้า http://natas0.natas.labs.overthewire.org/ แบบไม่ใส่รหัสผ่าน
curl http://natas0.natas.labs.overthewire.org/
ได้ผลลัพธ์เป็น
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>401 Unauthorized</title> </head><body> <h1>Unauthorized</h1> <p>This server could not verify that you are authorized to access the document requested. Either you supplied the wrong credentials (e.g., bad password), or your browser doesn't understand how to supply the credentials required.</p> <hr> <address>Apache/2.4.58 (Ubuntu) Server at natas0.natas.labs.overthewire.org Port 80</address> </body></html>
ถ้าใส่ basic authentication จะเรียกเป็น
curl http://natas0.natas.labs.overthewire.org/ -u natas0:natas0
จะเห็นข้อความจากเพจ
Curl ยังมี option อีกมากมาย สามารถตั้งค่าการ request ได้ครบถ้วน และเป็นเครื่องมือที่สามารถใช้ในการแก้ด่านต่าง ๆ ของ natas ได้อย่างดี
