image-20250414083610333

🎯 Low 等级

🔸 将 DVWA Security 设置为 Low 等级。

image-20250413164730463

🔸 随意输入账号密码 admin\123456 后提交登录。

image-20250413165005287

image-20250413165014018

🔸 右键点击数据包,选择发送到 Intruder 模块。

image-20250413165030048

🔸 切换至 Intruder 模块,在 Burp Suite 界面点击Intruder选项卡。

image-20250413165053667

🔸 点击 Clear §,清除默认标记,去除不必要的标记。

image-20250413165105626

🔸 点击 Add§ 添加变量,并设置爆破模式。

image-20250413165118404

🔸 分别设置 username 为变量 1 、password 为变量 2 ,添加 playload 字典并载入

image-20250413165141570

🔸 其它设置(线程,重定向等等)默认即可

🔸开始攻击

img

🔸 筛选爆破长度,爆破失败时长度一致,成功则与失败长度不同

image-20250413220117958

🔸 爆破成功,账户密码为:admin/password

image-20250413220133224

🎯 Medium 等级

🔸 将 DVWA Security 设置为 Medium 等级。

image-20250413220158931

🔸 设置代理,使用 burpsuite 抓取数据包。

image-20250413220217855

image-20250413220226218

🔸 输入账号密码 admin\123456 提交登录。

image-20250413165005287

image-20250413220240544

🔸 右键点击数据包,发送到 Intruder 模块。

img

🔸 在 Burp Suite 界面切换到 Intruder 模块,点击Intruder选项卡。

img

🔸 点击 Clear § 清除默认标记,去掉不必要的标记。

img

🔸 点击 Add§ 添加变量,并设置爆破模式。

img

🔸 username 为变量 1 、password 为变量 2 ,添加 playload 字典并载入。

img

img

🔸 开始攻击

img

🔸 筛选爆破长度,依据失败长度一致,成功则不同的规则筛选。

image.png

🔸 爆破成功,账户密码:admin/password

image.png

💻 Medium 源码分析

if( isset( $_GET[ 'Login' ] ) ) {  
// 净化用户名输入
$user = $_GET[ 'username' ];
$user = ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"]))? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $user ) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR))? "" : ""));
// 净化密码输入
$pass = $_GET[ 'password' ];
$pass = ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"]))? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $pass ) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR))? "" : ""));
$pass = md5( $pass );
// 检查数据库
$query = "SELECT * FROM `users` WHERE user = '$user' AND password = '$pass';";
$result = mysqli_query($GLOBALS["___mysqli_ston"], $query ) or die( '<pre>' . ((is_object($GLOBALS["___mysqli_ston"]))? mysqli_error($GLOBALS["___mysqli_ston"]) : (($___mysqli_res = mysqli_connect_error())? $___mysqli_res : false)) . '</pre>' );
if( $result && mysqli_num_rows( $result ) == 1 ) {
// 获取用户详情
$row = mysqli_fetch_assoc( $result );
$avatar = $row["avatar"];
// 登录成功
echo "<p>Welcome to the password protected area {$user}</p>";
echo "<img src=\"{$avatar}\" />";
}
else {
// 登录失败
sleep( 2 );
echo "<pre><br />Username and/or password incorrect.</pre>";
}
((is_null($___mysqli_res = mysqli_close($GLOBALS["___mysqli_ston"])))? false : $___mysqli_res);
}

🔸 中级与低级区别不大,源码针对爆破设置了 2 秒延时防御,但这种简单延时难以有效阻止自动化爆破。

image.png

🎯 High 等级

🔸 将 DVWA Security 设置为 High 等级。

image.png

🔸 输入账号密码 admin\123456 提交登录。

image.png

🔸 发送到重放 Repeater 模块。

image.png

image.png

🔸 点击发送 2 次后出现 302 状态。

image.png

🔸 查看数据包,发现 user_token,若 token 不正确,请求将被直接拒绝。

🔸 登录时服务器先获取并验证 token ,正确后再判断账号密码。

image.png

🔸 绕过 token 操作:发送到 Intruder 模块,添加 password 为变量 1 、user_token 为变量 2 ,选择 Pitchfork 攻击模式。

image.png

🔸 设置 payloads 变量 1 ,添加密码字典。

image.png

🔸 将 playload2 设置为 token 位置,选择 Recursive grep 递归提取。

image.png

🔸 设置发送线程为 1

image.png

🔸 在模块的 options 下,将 Error Handling 的网络重试次数设为 0 ,避免 token 错位

image.png

🔸 在 Options 模块下,点击 Grep - ExtractAdd 进行添加

image.png

🔸 在 Options 模块下设置 Redirections 重定向

image.png

🔸 完成爆破

image.png

申明:

本博客所分享内容仅用于网络安全技术讨论,切勿用于违法途径

所有渗透都需获取授权,违者后果自行承担,与本号及作者无关,请谨记守法