ผลต่างระหว่างรุ่นของ "01204223/natas"

จาก Theory Wiki
ไปยังการนำทาง ไปยังการค้นหา
(สร้างหน้าด้วย ": ''หน้านี้เป็นส่วนหนึ่งของ 01204223'' '''Natas'' [https://overthewire.org/wargames/natas/ https://ove...")
 
 
(ไม่แสดง 1 รุ่นระหว่างกลางโดยผู้ใช้คนเดียวกัน)
แถว 1: แถว 1:
 
: ''หน้านี้เป็นส่วนหนึ่งของ [[01204223]]''
 
: ''หน้านี้เป็นส่วนหนึ่งของ [[01204223]]''
  
'''Natas'' [https://overthewire.org/wargames/natas/ https://overthewire.org/wargames/natas/] เป็นเกมสงครามสำหรับฝึกเกี่ยวกับความปลอดภัยบนเว็บ (ฝึก hack เว็บ)
+
'''Natas''' [https://overthewire.org/wargames/natas/ https://overthewire.org/wargames/natas/] เป็นเกมสงครามสำหรับฝึกเกี่ยวกับความปลอดภัยบนเว็บ (ฝึก hack เว็บ)
 +
 
 +
รายละเอียดที่บอกในเว็บ
 +
 
 +
: Each level of natas consists of its own website located at http://natasX.natas.labs.overthewire.org, where X is the level number. There is no SSH login. To access a level, enter the username for that level (e.g. natas0 for level 0) and its password.
 +
 
 +
: Each level has access to the password of the next level. Your job is to somehow obtain that next password and level up. All passwords are also stored in /etc/natas_webpass/. E.g. the password for natas5 is stored in the file /etc/natas_webpass/natas5 and only readable by natas4 and natas5.
 +
 
 +
เราต้องหารหัสผ่านของ user natasX จากหน้า natas(X-1) จากในเพจบ้างหรืออื่น ๆ
 +
 
 +
ให้เริ่มที่ [http://natas0.natas.labs.overthewire.org http://natas0.natas.labs.overthewire.org]
 +
จะเข้าหน้าดังกล่าวต้องใช้ user natas0 รหัสผ่าน natas0
  
 
== เครื่องมือที่ใช้ในการทำ ==
 
== เครื่องมือที่ใช้ในการทำ ==
แถว 12: แถว 23:
  
 
แต่เครื่องมือที่นิยมใช้กันมากจะเป็นเครื่องมือ แบบ command line ชื่อ [https://curl.se/ curl] ซึ่งนิยมใช้ทั้งในสายนักพัฒนาซอฟต์แวร์และด้านอื่น ๆ จึงควรลองนำมาติดตั้งและหัดใช้อย่างยิ่ง
 
แต่เครื่องมือที่นิยมใช้กันมากจะเป็นเครื่องมือ แบบ command line ชื่อ [https://curl.se/ curl] ซึ่งนิยมใช้ทั้งในสายนักพัฒนาซอฟต์แวร์และด้านอื่น ๆ จึงควรลองนำมาติดตั้งและหัดใช้อย่างยิ่ง
 +
 +
ตัวอย่างการเรียกไปหน้า http://natas0.natas.labs.overthewire.org/ แบบไม่ใส่รหัสผ่าน
 +
 +
curl http://natas0.natas.labs.overthewire.org/
 +
 +
ได้ผลลัพธ์เป็น
  
 
<pre>
 
<pre>
$ curl --help
+
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
Usage: curl [options...] <url>
+
<html><head>
-d, --data <data>           HTTP POST data
+
<title>401 Unauthorized</title>
-f, --fail                  Fail fast with no output on HTTP errors
+
</head><body>
-h, --help <subject>       Get help for commands
+
<h1>Unauthorized</h1>
-o, --output <file>         Write to file instead of stdout
+
<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>
  -O, --remote-name          Write output to file named as remote file
+
<hr>
-i, --show-headers          Show response headers in output
+
<address>Apache/2.4.58 (Ubuntu) Server at natas0.natas.labs.overthewire.org Port 80</address>
-s, --silent                Silent mode
+
</body></html>
-T, --upload-file <file>   Transfer local FILE to destination
+
</pre>
-u, --user <user:password> Server user and password
+
 
-A, --user-agent <name>     Send User-Agent <name> to server
+
ถ้าใส่ basic authentication จะเรียกเป็น
-v, --verbose              Make the operation more talkative
+
 
  -V, --version              Show version number and quit
+
  curl http://natas0.natas.labs.overthewire.org/ -u natas0:natas0
  
This is not the full help; this menu is split into categories.
+
จะเห็นข้อความจากเพจ
Use "--help category" to get an overview of all categories, which are:
+
 
auth, connection, curl, deprecated, dns, file, ftp, global, http, imap, ldap, output, pop3, post, proxy, scp, sftp, smtp, ssh, telnet, tftp, timeout,
+
Curl ยังมี option อีกมากมาย สามารถตั้งค่าการ request ได้ครบถ้วน และเป็นเครื่องมือที่สามารถใช้ในการแก้ด่านต่าง ๆ ของ natas ได้อย่างดี
tls, upload, verbose.
 
Use "--help all" to list all options
 
Use "--help [option]" to view documentation for a given option
 
</pre>
 

รุ่นแก้ไขปัจจุบันเมื่อ 05:56, 6 มีนาคม 2569

หน้านี้เป็นส่วนหนึ่งของ 01204223

Natas https://overthewire.org/wargames/natas/ เป็นเกมสงครามสำหรับฝึกเกี่ยวกับความปลอดภัยบนเว็บ (ฝึก hack เว็บ)

รายละเอียดที่บอกในเว็บ

Each level of natas consists of its own website located at http://natasX.natas.labs.overthewire.org, where X is the level number. There is no SSH login. To access a level, enter the username for that level (e.g. natas0 for level 0) and its password.
Each level has access to the password of the next level. Your job is to somehow obtain that next password and level up. All passwords are also stored in /etc/natas_webpass/. E.g. the password for natas5 is stored in the file /etc/natas_webpass/natas5 and only readable by natas4 and natas5.

เราต้องหารหัสผ่านของ user natasX จากหน้า natas(X-1) จากในเพจบ้างหรืออื่น ๆ

ให้เริ่มที่ http://natas0.natas.labs.overthewire.org จะเข้าหน้าดังกล่าวต้องใช้ user natas0 รหัสผ่าน natas0

เครื่องมือที่ใช้ในการทำ

นอกจากการกดดู source code ของ page แล้ว การ inspect รายละเอียด รวมถึงการดู request ที่ส่งไปยัง server ก็เป็นเครื่องมือสำคัญที่เราจะได้เรียนรู้ ตัวอย่างหน้าจอการ inspect ส่วน network แสดงด้านล่าง เราจะได้เห็น request และ response ของการเรียกใช้งานเว็บ

223-inspec-screenshot.png

ในการเรียก 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 ได้อย่างดี