# httpheader ver.3
---
## 此次成果
使用nginx架設網站,並使用其中幾個security header
使用python進行爬蟲並對抓下來的response封包進行分析。
---
## demo
---
## 參考模板
https://securityheaders.com/?q=https%3A%2F%2Fwww.facebook.com%2F&followRedirects=on
額外增加功能:分析每一個security header的利弊。
---
## security header類型
分析種類:
set-cookie: 防禦XSS
X-XSS-Protection: 防禦XSS
content-security-policy: 防禦XSS
X-Frame-Options: 防禦Clickjacking
X-Content-Type-Options: 避免瀏覽器誤判文件形態,防止sniffing(監聽)
Strict-Transport-Security: 強迫用戶使用 HTTPS
Referrer-Policy: 增加隱私權
Public-Key-Pins: 防禦中間人攻擊
---
## demo
---
## 暑假計畫
針對各伺服器建出的網站做出security header歸類
把建好的模組合起來、進行優化、增加功能等等
練習CTF
參考CWE以及別人寫好的工具,進行開發與結果比對
https://cwe.mitre.org/data/definitions/1004.html
https://github.com/gildasio/h2t
---
## 參考資料
#### http header 有關安全設定
https://yu-jack.github.io/2017/10/20/secure-header/#x-content-type-options
#### XSS跨站腳本攻擊
https://hitcon.org/2017/CMT/slide-files/d2_s3_r4.pdf
---
## 工具參考
#### github
https://github.com/gildasio/h2t(有code)
https://github.com/koenbuyens/securityheaders
https://github.com/search?o=desc&p=2&q=http+security+header&s=stars&type=Repositories
#### 網站版
https://securityheaders.com/?q=https%3A%2F%2Fmedium.com%2F%40charming_rust_oyster_221%2Fflask-%25E9%2585%258D%25E7%25BD%25AE-https-%25E7%25B6%25B2%25E7%25AB%2599-ssl-%25E5%25AE%2589%25E5%2585%25A8%25E8%25AA%258D%25E8%25AD%2589-36dfeb609fa8&followRedirects=on
---
## CSP
#### CSP header文件
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy
#### CSP 介紹
https://hackmd.io/@Eotones/BkOX6u5kX
https://www.kutu66.com/GitHub/article_131976
#### Google提供的CSP檢測工具
https://csp-evaluator.withgoogle.com/
---
{"metaMigratedAt":"2023-06-15T09:27:28.800Z","metaMigratedFrom":"Content","title":"httpheader ver.3","breaks":true,"contributors":"[{\"id\":\"3816a5fc-12c6-40e1-b681-61927195e1cc\",\"add\":2183,\"del\":535}]"}