dvwa mysql_error()_DVWA登录错误

我无法登录到我的DVWA。DVWA登录错误

我搜索了网页,但无法找到答案。数据库创建好了,似乎很好,但是当我想登录时,我收到一条错误消息:

致命错误:[MySQLConverterToo]修复mysql_escape_string()调用!此代码不起作用。在/Applications/XAMPP/xamppfiles/htdocs/dvwa/login.php在线11

我的config.inc.php:

# If you are having problems connecting to the MySQL database and all of the variables below are correct

# try changing the 'db_server' variable from localhost to 127.0.0.1. Fixes a problem due to sockets.

# Thanks to @digininja for the fix.

# Database management system to use

$DBMS = 'MySQL';

#$DBMS = 'PGSQL'; // Currently disabled

# Database variables

# WARNING: The database specified under db_database WILL BE ENTIRELY DELETED during setup.

# Please use a database dedicated to DVWA.

$_DVWA = array();

$_DVWA[ 'db_server' ] = '127.0.0.1';

$_DVWA[ 'db_database' ] = 'dvwa';

$_DVWA[ 'db_user' ] = 'root';

$_DVWA[ 'db_password' ] = '';

# Only used with PostgreSQL/PGSQL database selection.

$_DVWA[ 'db_port '] = '5432';

# ReCAPTCHA settings

# Used for the 'Insecure CAPTCHA' module

# You'll need to generate your own keys at: https://www.google.com/recaptcha/admin/create

$_DVWA[ 'recaptcha_public_key' ] = '6LdK7xITAAzzAAJQTfL7fu6I-0aPl8KHHieAT_yJg';

$_DVWA[ 'recaptcha_private_key' ] = '6LdK7xITAzzAAL_uw9YXVUOPoIHPZLfw2K1n5NVQ';

# Default security level

# Default value for the secuirty level with each session.

# The default is 'impossible'. You may wish to set this to either 'low', 'medium', 'high' or impossible'.

$_DVWA[ 'default_security_level' ] = 'impossible';

# Default PHPIDS status

# PHPIDS status with each session.

# The default is 'disabled'. You can set this to be either 'enabled' or 'disabled'.

$_DVWA[ 'default_phpids_level' ] = 'disabled';

# Verbose PHPIDS messages

# Enabling this will show why the WAF blocked the request on the blocked request.

# The default is 'disabled'. You can set this to be either 'true' or 'false'.

$_DVWA[ 'default_phpids_verbose' ] = 'false';

?>

和我的login.php:

define('DVWA_WEB_PAGE_TO_ROOT', '');

require_once DVWA_WEB_PAGE_TO_ROOT . 'dvwa/includes/dvwaPage.inc.php';

dvwaPageStartup(array('phpids'));

dvwaDatabaseConnect();

if(isset($_POST[ 'Login' ])) {

// Anti-CSRF

checkToken($_REQUEST[ 'user_token' ], $_SESSION[ 'session_token' ], 'login.php');

$user = $_POST[ 'username' ];

$user = stripslashes($user);

$user = mysql_real_escape_string($user);

$pass = $_POST[ 'password' ];

$pass = stripslashes($pass);

$pass = mysql_real_escape_string($pass);

$pass = md5($pass);

$query = ("SELECT table_schema, table_name, create_time

FROM information_schema.tables

WHERE table_schema='{$_DVWA['db_database']}' AND table_name='users'

LIMIT 1");

$result = @mysql_query($query);

if(mysql_num_rows($result) != 1) {

dvwaMessagePush("First time using DVWA.
Need to run 'setup.php'.");

dvwaRedirect(DVWA_WEB_PAGE_TO_ROOT . 'setup.php');

}

$query = "SELECT * FROM `users` WHERE user='$user' AND password='$pass';";

$result = @mysql_query($query) or die('

' . mysql_error() . '.
Try installing again.
');

if($result && mysql_num_rows($result) == 1) { // Login Successful...

dvwaMessagePush("You have logged in as '{$user}'");

dvwaLogin($user);

dvwaRedirect(DVWA_WEB_PAGE_TO_ROOT . 'index.php');

}

// Login failed

dvwaMessagePush('Login failed');

dvwaRedirect('login.php');

}

$messagesHtml = messagesPopAllToHtml();

Header('Cache-Control: no-cache, must-revalidate'); // HTTP/1.1

Header('Content-Type: text/html;charset=utf-8'); // TODO- proper XHTML headers...

Header('Expires: Tue, 23 Jun 2009 12:00:00 GMT'); // Date in the past

// Anti-CSRF

generateSessionToken();

echo "

"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">

Login :: Damn Vulnerable Web Application (DVWA) v" . dvwaVersionGet() . "

%5C%22%22

Username

Password

" . tokenField() . "

{$messagesHtml}

" . dvwaExternalLinkUrlGet('http://www.dvwa.co.uk/', 'Damn Vulnerable Web Application (DVWA)') . " is a RandomStorm OpenSource project.

";

?>

我只有改变:

$_DVWA[ 'db_password' ] = '';

,因为否则就不能创造..

发生了什么事?

我完全是这个新手,但我也快死了! ;-)

2016-11-22

Dasuper

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值