肆、DVWA 官方文件 — Features

一、DVWA Security

注意: 2015版本已分為: impossible, high, medium, low

image

image

二、PHP-IDS(Instruction Detection System)

image

image

伍、User Security(說明)

  • DVWA is not emilate !!! It’s real!!

image

  • external link處理

image

image

陸、Usage(使用方式)—XSS

image

image

一、XSS範例 — Security: Low

右下角有功能鈕

  • View Source

View Help
image

image

DVWA 舊版頁面

二、網頁正常行為描述

User留下Name(必填)、Comment,並傳送到Database

image

三、Source Code 描述

兩個主要參數: $name, $message,兩者先經過trim()函式移除空白鍵

Sanitize: 移除user input 有危害的地方

$message

  • stripslashes(): 移除斜線

  • mysql_real)escape_string():移除特殊字元(可以避免SQL injection)

$name

  • stripslashes(): 移除斜線

image

image

image

image

image

四、攻擊方式

可以直接輸入 攻擊

image

五、XSS範例 — Security: High

  • 新增htmlspecialchars()函式,把user input多做一層轉換,變為HTML形式,而非 being excuted 形式

image

image

image

六、XSS的可能危害

Complex AJAX Script Attack, like:

  • 攻擊者可以從remote web server獲得session cookies

  • 可以安裝malware

  • 可以竊取bank account username & password

image