# 2020.08.25 實作補充 1. 使用Apache 建置環境 - 撰寫一個具有漏洞的PHP程式 ``` <html> <head> <title>PHP Hello</title> </head> <body> <h1> <?php echo '<p>This is PHP-based Site</p>'; ?> </h1> <h2> [Hello Guest] What's your name? </h2> <form method="GET"> <input type="text" name="name" /> <button type="submit">Send</button> </form> <h2> Hi, <?php echo $_GET['name'] ?>, Welcome! </h2> </body> </html> ``` 2. 什麼是XSS - 如何進行XSS輸入 - 如何使用URL decode - https://www.url-encode-decode.com/ - 如何改善 - 使用htmlentities - 這是PHP的語法 - 要注意其他的語言用法不一樣 3. 目錄索引的功能 - 建構一個多層次的路徑位置 - 觀察 Index of - 如何關閉權限 - 修改 conf/httpd.conf(220行#) 4. 對特定目錄提高權限 - 使用 htpasswd - 參考 - https://httpd.apache.org/docs/2.2/howto/auth.html - 227行 改成All ``` AuthName "Restricted Area" AuthType Basic AuthUserFile d:/Apache2.2/bin/password.file Require valid-user ``` ``` AuthName "Restricted Area" AuthType Basic AuthUserFile d:/Apache2.2/bin/password.file Require user tom ``` 5. Error Handling - 甚麼是Error Code - 如何導向 - <script> windows.location.href ="google.com.tw" </script> 6. 進階技巧 Mod Rewrite - 如何開啟Mod Rewrite (修改httpd.conf 119行) - 如何理解Rewrite Rule - 正規表式示 - http://ccckmit.wikidot.com/regularexpression 7. 進階技巧 RewriteCond 的意義 RewriteRule - 參考 - https://httpd.apache.org/docs/2.4/rewrite/flags.html
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up