当前位置: 首页 > wzjs >正文

永康网站开发合肥企业网站制作方案

永康网站开发,合肥企业网站制作方案,中文html5网站模板,网站子站怎么做captcha&#xff1a;大概是“我不是机器人”的一个勾选框或者图片验证 LOW: 先输入密码正常修改试一下&#xff08;123&#xff09;&#xff0c;发现报错 查看源码&#xff1a; <?phpif( isset( $_POST[ Change ] ) && ( $_POST[ step ] 1 ) ) {// Hide the C…

captcha:大概是“我不是机器人”的一个勾选框或者图片验证

LOW:

先输入密码正常修改试一下(123),发现报错

查看源码: 

<?phpif( isset( $_POST[ 'Change' ] ) && ( $_POST[ 'step' ] == '1' ) ) {// Hide the CAPTCHA form$hide_form = true;// Get input$pass_new  = $_POST[ 'password_new' ];$pass_conf = $_POST[ 'password_conf' ];// Check CAPTCHA from 3rd party$resp = recaptcha_check_answer($_DVWA[ 'recaptcha_private_key'],$_POST['g-recaptcha-response']);// Did the CAPTCHA fail?if( !$resp ) {// What happens when the CAPTCHA was entered incorrectly$html     .= "<pre><br />The CAPTCHA was incorrect. Please try again.</pre>";$hide_form = false;return;}else {// CAPTCHA was correct. Do both new passwords match?if( $pass_new == $pass_conf ) {// Show next stage for the userecho "<pre><br />You passed the CAPTCHA! Click the button to confirm your changes.<br /></pre><form action=\"#\" method=\"POST\"><input type=\"hidden\" name=\"step\" value=\"2\" /><input type=\"hidden\" name=\"password_new\" value=\"{$pass_new}\" /><input type=\"hidden\" name=\"password_conf\" value=\"{$pass_conf}\" /><input type=\"submit\" name=\"Change\" value=\"Change\" /></form>";}else {// Both new passwords do not match.$html     .= "<pre>Both passwords must match.</pre>";$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 matchif( $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( '<pre>' . ((is_object($GLOBALS["___mysqli_ston"])) ? mysqli_error($GLOBALS["___mysqli_ston"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false)) . '</pre>' );// Feedback for the end userecho "<pre>Password Changed.</pre>";}else {// Issue with the passwords matchingecho "<pre>Passwords did not match.</pre>";$hide_form = false;}((is_null($___mysqli_res = mysqli_close($GLOBALS["___mysqli_ston"]))) ? false : $___mysqli_res);
}?>

分两个阶段,1阶段检查captcha,但密码修改的部分在2阶段,low关就没有出现captcha,所有我们直接跳过步骤1:

输入修改密码,bp抓包,抓到这些

 把step=1改成step=2,放包

 

MEDIUM:

查看源码,多了一个验证

还是bp抓包,把step=1改成2,然后加上

passed_captcha=true

 放包,修改成功

HIGH:

查看源码:

新加上了两个验证,第一行我们可以通过加一个post参数 g-recaptcha-response=hidd3n_valu3,第二行要求请求必须包含特定的UA头,否则直接拒绝访问

并且这个难度级把两个阶段合并到了一起

所以还是bp抓包,抓到这些

改请求头和参数,改完变成这样 

IMPOSSIBLE:

查看源码:

<?phpif( isset( $_POST[ 'Change' ] ) ) {// Check Anti-CSRF tokencheckToken( $_REQUEST[ 'user_token' ], $_SESSION[ 'session_token' ], 'index.php' );// Hide the CAPTCHA form$hide_form = true;// Get input$pass_new  = $_POST[ 'password_new' ];$pass_new  = stripslashes( $pass_new );$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 );$pass_conf = $_POST[ 'password_conf' ];$pass_conf = stripslashes( $pass_conf );$pass_conf = ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"],  $pass_conf ) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : ""));$pass_conf = md5( $pass_conf );$pass_curr = $_POST[ 'password_current' ];$pass_curr = stripslashes( $pass_curr );$pass_curr = ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"],  $pass_curr ) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : ""));$pass_curr = md5( $pass_curr );// Check CAPTCHA from 3rd party$resp = recaptcha_check_answer($_DVWA[ 'recaptcha_private_key' ],$_POST['g-recaptcha-response']);// Did the CAPTCHA fail?if( !$resp ) {// What happens when the CAPTCHA was entered incorrectlyecho "<pre><br />The CAPTCHA was incorrect. Please try again.</pre>";$hide_form = false;}else {// Check that the current password is correct$data = $db->prepare( 'SELECT password FROM users WHERE user = (:user) AND password = (:password) LIMIT 1;' );$data->bindParam( ':user', dvwaCurrentUser(), PDO::PARAM_STR );$data->bindParam( ':password', $pass_curr, PDO::PARAM_STR );$data->execute();// Do both new password match and was the current password correct?if( ( $pass_new == $pass_conf) && ( $data->rowCount() == 1 ) ) {// Update the database$data = $db->prepare( 'UPDATE users SET password = (:password) WHERE user = (:user);' );$data->bindParam( ':password', $pass_new, PDO::PARAM_STR );$data->bindParam( ':user', dvwaCurrentUser(), PDO::PARAM_STR );$data->execute();// Feedback for the end user - success!echo "<pre>Password Changed.</pre>";}else {// Feedback for the end user - failed!echo "<pre>Either your current password is incorrect or the new passwords did not match.<br />Please try again.</pre>";$hide_form = false;}}
}// Generate Anti-CSRF token
generateSessionToken();?>

 优化的地方:

1.双重token验证

2.pdo预处理

3.generateSessionToken()生成唯一随机id,与当前页面,会话,用户关联

❀❀❀ 完结撒花!!❀❀❀

http://www.dtcms.com/wzjs/542514.html

相关文章:

  • 网站标识新闻今天最新消息
  • 界面 网站写文章wordpress
  • 企业网站需要什么科技木是什么材料
  • 自己做网站 服务器外贸网站设计的公司
  • 山东省建设执业资格注册管理中心网站网站建设优化工资高不
  • 做网站简单自己做网站需要哪些软件
  • 系统网站怎么做的中文域名是什么
  • extjs做的网站wordpress 图片加速
  • wordpress替换烟台seo网站诊断
  • 电力建设期刊网站投稿在线表白网页制作
  • 吴江城乡和住房建设局网站职业生涯规划
  • 无锡市住房建设局网站辽宁省工程招标网
  • 深圳优化网站关键词广东新闻发布会
  • 湘潭九华网站网页制作怎样设计背景
  • 怎么样才算是一个网站页面郑州制作网站费用
  • 网站建设与维护实训报告陕西建设交通集团招聘信息网站
  • 用网站做的人工智能深圳网站的优化公司
  • 在那个网站做义工好企业微营销网站
  • 怎么看网站制作dz论坛可以做招聘网站
  • 苏州手机网站制作外贸网站定做
  • 免费建自己的网站赣州市开发小程序
  • 名片型网站开发购物网站建设前的市场分析
  • 北京网站优化排名工作室官网模板
  • 网站开发做原型吗网站 网络推广
  • 自动打开多个同网站网页中国菲律宾南海争端
  • 网站 流量攻击怎么办廊坊做网站公司排名
  • 做外贸怎么做站长工具seo综合查询问题
  • 网站seo关键词优化排名河南企业网站制作
  • 企业网站设计沈阳财务软件免费版
  • 工信部的网站备案信息ckeditor 转wordpress