網站黑魔法:姆咪篇 Web security basics <s>x</s>16. POST /login/index.php HTTP/1.1rn
Host: moodle.ntust.edu.twrn
Referer: http://moodle.ntust.edu.tw/rn
Content-Type: application/x-www-form-urlencodedrn
Content-Length: 56rn
Cookie: _ga=GA1.4.69562738 (略rn
rn
username=B105XXXXX&password=p@55w0rd&rememberusername=1
Request實際上大概長這樣
17. POST /login/index.php HTTP/1.1rn
Host: moodle.ntust.edu.twrn
Referer: http://moodle.ntust.edu.tw/rn
Content-Type: application/x-www-form-urlencodedrn
Content-Length: 56rn
Cookie: _ga=GA1.4.69562738 (略rn
rn
username=B105XXXXX&password=p@55w0rd&rememberusername=1
Request實際上大概長這樣
Request Header
Request Method
18. POST /login/index.php HTTP/1.1rn
Host: moodle.ntust.edu.twrn
Referer: http://moodle.ntust.edu.tw/rn
Content-Type: application/x-www-form-urlencodedrn
Content-Length: 56rn
Cookie: _ga=GA1.4.69562738 (略rn
rn
username=B105XXXXX&password=p@55w0rd&rememberusername=1
Request實際上大概長這樣
Request Body
19. HTTP/1.1 200 OKrn
Date: Thu, 05 Oct 2017 18:44:14 GMTrn
Server: Apachern
Content-Length: 82rn
Content-Type: text/htmlrn
Connection: keep-alivern
rn
<html><head></head>….</html>
Response實際上大概長這樣
20. HTTP/1.1 200 OKrn
Date: Thu, 05 Oct 2017 18:44:14 GMTrn
Server: Apachern
Content-Length: 82rn
Content-Type: text/htmlrn
Connection: keep-alivern
rn
<html><head></head>….</html>
Response實際上大概長這樣
Status Code
21. HTTP/1.1 200 OKrn
Date: Thu, 05 Oct 2017 18:44:14 GMTrn
Server: Apachern
Content-Length: 82rn
Content-Type: text/htmlrn
Connection: keep-alivern
rn
<html><head></head>….</html>
Response實際上大概長這樣
Response Header
22. HTTP/1.1 200 OKrn
Date: Thu, 05 Oct 2017 18:44:14 GMTrn
Server: Apachern
Content-Length: 82rn
Content-Type: text/htmlrn
Connection: keep-alivern
rn
<html><head></head>….</html>
Response實際上大概長這樣
Response Body
(Content)
23. HTTP Status Code 伺服器想告訴你什麼?
● 2xx Success:好,可以,蚌。
● 3xx Redirection:我把東西都搬到那邊了,過去找ㄅ
● 4xx Client Error:你他媽到底在衝三小
● 5xx Server Error:我他媽到底發生了三小
28. 順便說一下SESSION
● 使用者的Cookie存著SESSION id
● 伺服器存著SESSION id對應的詳細資料
Name Value
SESSION qwertyuiopasd
使用者的Cookies
Server的資料庫
id Data
mkwqwdvimiia ...
qwertyuiopasd username=123&gender=male
imnybehdbjsls ...
sauduahuivas ...
29. 順便說一下SESSION
● 使用者的Cookie存著SESSION id
● 伺服器存著SESSION id對應的詳細資料
Name Value
SESSION qwertyuiopasd
使用者的Cookies
Server的資料庫
id Data
mkwqwdvimiia ...
qwertyuiopasd username=123&gender=male
imnybehdbjsls ...
sauduahuivas ...
30. PHP語法隨便的簡介
● echo <字串/變數>; //印出文字
● $i=1; //int i = 1; php宣告時不用宣
告型別
● $_GET、$_POST、$_COOKIE、$_SESSION
● 其他大部分都很普通,有不知道的function再Google就好
34. 總之大guy4這樣 ● A1-Injection
● A2-Broken Authentication and Session
Management
● A3-Cross-Site Scripting (XSS)
● A4-Broken Access Control
● A5-Security Misconfiguration
● A6-Sensitive Data Exposure
● A7-Insufficient Attack Protection
● A8-Cross-Site Request Forgery (CSRF)
● A9-Using Components with Known
Vulnerabilities
● A10-Underprotected APIs