gpt4 book ai didi

php - 无法使用 DVWA、apache2 启动本地 mysql 服务器

转载 作者:行者123 更新时间:2023-11-29 03:21:50 24 4
gpt4 key购买 nike

我无法使用 DVWA、apache2 在我的 kali 虚拟机上启动本地服务器。DVWA 中显示的错误消息是 -

Could not connect to the MySQL service.
Please check the config file.

/etc/mysql/mysql.conf.d/mysqld.conf 的内容(要查看所有内容请回复)是-

[mysqld_safe]
socket = /var/run/mysqld/mysqld.sock
nice = 0

[mysqld]
#
# * Basic Settings
#
feedback = On
user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
lc-messages-dir = /usr/share/mysql
skip-external-locking
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address = 127.0.0.1

命令 $service mysql status 的输出是-

Mar 24 19:24:21 kali mysqld[22936]: 2017-03-24 19:24:21 140110264951360 [Note] InnoDB:  Percona XtraDB (http://www.
Mar 24 19:24:21 kali mysqld[22936]: 2017-03-24 19:24:21 140110264951360 [Note] Plugin 'FEEDBACK' is disabled.
Mar 24 19:24:21 kali mysqld[22936]: 2017-03-24 19:24:21 140109647177472 [Note] InnoDB: Dumping buffer pool(s) not y
Mar 24 19:24:21 kali mysqld[22936]: 2017-03-24 19:24:21 140110264951360 [Note] Server socket created on IP: '::1'.
Mar 24 19:24:21 kali mysqld[22936]: 2017-03-24 19:24:21 140110264951360 [Note] /usr/sbin/mysqld: ready for connecti
Mar 24 19:24:21 kali mysqld[22936]: Version: '10.1.21-MariaDB-5' socket: '/var/run/mysqld/mysqld.sock' port: 3306
Mar 24 19:24:22 kali mysql[22764]: Starting MariaDB database server: mysqld.
Mar 24 19:24:22 kali systemd[1]: Started LSB: Start and stop the mysql database server daemon.
Mar 24 19:24:22 kali /etc/mysql/debian-start[23000]: WARNING: mysql.user contains 3 root accounts without password
Mar 24 19:24:22 kali /etc/mysql/debian-start[23001]: Triggering myisam-recover for all MyISAM tables and aria-recover

前六行是红色的。

命令$netstat -vln 的输出是-

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN
tcp6 0 0 :::80 :::* LISTEN

netstat: no support for `AF INET (sctp)' on this system.
netstat: no support for `AF INET (sctp)' on this system.
udp 0 0 0.0.0.0:68 0.0.0.0:*
raw6 0 0 :::58 :::* 7
Active UNIX domain sockets (only servers)
Proto RefCnt Flags Type State I-Node Path
unix 2 [ ACC ] STREAM LISTENING 17372 @/tmp/.ICE-unix/1133
unix 2 [ ACC ] STREAM LISTENING 17413 /run/user/0/keyring/ssh
unix 2 [ ACC ] STREAM LISTENING 17130 /tmp/.X11-unix/X0
unix 2 [ ACC ] STREAM LISTENING 14829 /tmp/.ICE-unix/769
unix 2 [ ACC ] STREAM LISTENING 14947 /tmp/.X11-unix/X1024
unix 2 [ ACC ] STREAM LISTENING 17280 /tmp/ssh-dTUA0HGqFfRr/agent.1133
unix 2 [ ACC ] STREAM LISTENING 17373 /tmp/.ICE-unix/1133
unix 2 [ ACC ] STREAM LISTENING 17442 /run/user/0/keyring/pkcs11
unix 2 [ ACC ] STREAM LISTENING 17129 @/tmp/.X11-unix/X0
unix 2 [ ACC ] STREAM LISTENING 15398 /run/user/132/pulse/native
unix 2 [ ACC ] STREAM LISTENING 11560 /var/run/dbus/system_bus_socket
unix 2 [ ACC ] STREAM LISTENING 11563 /var/run/pcscd/pcscd.comm
unix 2 [ ACC ] STREAM LISTENING 11566 /run/uuidd/request
unix 2 [ ACC ] STREAM LISTENING 14828 @/tmp/.ICE-unix/769
unix 2 [ ACC ] STREAM LISTENING 13592 @/tmp/dbus-LvFbrf6k
unix 2 [ ACC ] STREAM LISTENING 13589 @/tmp/dbus-XyEHDwXr
unix 2 [ ACC ] STREAM LISTENING 14677 /run/user/132/systemd/private
unix 2 [ ACC ] STREAM LISTENING 14684 /run/user/132/gnupg/S.gpg-agent.ssh
unix 2 [ ACC ] STREAM LISTENING 14687 /run/user/132/gnupg/S.dirmngr
unix 2 [ ACC ] STREAM LISTENING 14689 /run/user/132/gnupg/S.gpg-agent.extra
unix 2 [ ACC ] STREAM LISTENING 14691 /run/user/132/bus
unix 2 [ ACC ] STREAM LISTENING 14693 /run/user/132/gnupg/S.gpg-agent
unix 2 [ ACC ] STREAM LISTENING 14695 /run/user/132/gnupg/S.gpg-agent.browser
unix 2 [ ACC ] STREAM LISTENING 14956 /run/user/132/wayland-0
unix 2 [ ACC ] STREAM LISTENING 17116 @/tmp/dbus-SH8jFiyf
unix 2 [ ACC ] STREAM LISTENING 108931 /var/run/mysqld/mysqld.sock
unix 2 [ ACC ] STREAM LISTENING 9119 /run/systemd/private
unix 2 [ ACC ] STREAM LISTENING 13593 @/tmp/dbus-oibNPS4f
unix 2 [ ACC ] STREAM LISTENING 13590 @/tmp/dbus-aFHv8BHv
unix 2 [ ACC ] STREAM LISTENING 9131 /run/systemd/journal/stdout
unix 2 [ ACC ] STREAM LISTENING 9139 /run/systemd/fsck.progress
unix 2 [ ACC ] STREAM LISTENING 9143 /run/lvm/lvmpolld.socket
unix 2 [ ACC ] STREAM LISTENING 9146 /run/lvm/lvmetad.socket
unix 2 [ ACC ] STREAM LISTENING 16320 @/tmp/dbus-qF1bHGdD5y
unix 2 [ ACC ] STREAM LISTENING 17098 /run/user/0/keyring/control
unix 2 [ ACC ] STREAM LISTENING 14946 @/tmp/.X11-unix/X1024
unix 2 [ ACC ] STREAM LISTENING 17117 @/tmp/dbus-FODO2EfC
unix 2 [ ACC ] SEQPACKET LISTENING 9177 /run/udev/control
unix 2 [ ACC ] STREAM LISTENING 16090 /run/user/0/systemd/private
unix 2 [ ACC ] STREAM LISTENING 16095 /run/user/0/gnupg/S.gpg-agent.extra
unix 2 [ ACC ] STREAM LISTENING 16098 /run/user/0/gnupg/S.gpg-agent.ssh
unix 2 [ ACC ] STREAM LISTENING 16100 /run/user/0/gnupg/S.gpg-agent.browser
unix 2 [ ACC ] STREAM LISTENING 16102 /run/user/0/bus
unix 2 [ ACC ] STREAM LISTENING 16106 /run/user/0/gnupg/S.gpg-agent
unix 2 [ ACC ] STREAM LISTENING 16108 /run/user/0/gnupg/S.dirmngr
unix 2 [ ACC ] STREAM LISTENING 14983 @/tmp/dbus-ceiJ2zXVDW
unix 2 [ ACC ] STREAM LISTENING 57848 /var/run/NetworkManager/private-dhcp
netstat: no support for `AF IPX' on this system.
netstat: no support for `AF AX25' on this system.
netstat: no support for `AF X25' on this system.
netstat: no support for `AF NETROM' on this system.
netstat: no support for `AF ROSE' on this system.

/var/www/html/dvwa/config/config.inc.php 的内容是-

<?php

# If you are having problems connecting to the MySQL database and all of the va$
# try changing the 'db_server' variable from localhost to 127.0.0.1. Fixes a pr$
# 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 $
# Please use a database dedicated to DVWA.
$_DVWA = array();
$_DVWA[ 'db_server' ] = 'localhost';
$_DVWA[ 'db_database' ] = 'dvwa';
$_DVWA[ 'db_user' ] = 'root';
$_DVWA[ 'db_password' ] = '';

# ReCAPTCHA settings
# Used for the 'Insecure CAPTCHA' module
# You'll need to generate your own keys at: https://www.google.com/recaptcha/$
$_DVWA[ 'recaptcha_public_key' ] = 'lecaptcha';
$_DVWA[ 'recaptcha_private_key' ] = 'lecaptcha';

# 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', 'med$
$_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 'disa$
$_DVWA[ 'default_phpids_level' ] = 'disabled';

# Verbose PHPIDS messages
# Enabling this will show why the WAF blocked the request on the blocked requ$
# The default is 'disabled'. You can set this to be either 'true' or 'false'.
$_DVWA[ 'default_phpids_verbose' ] = 'false';

?>

我已经搜索了很多有关此问题的信息,但无法解决。感谢您的帮助。

最佳答案

参见 https://github.com/ethicalhack3r/DVWA/issues/240

也就是说,只需添加:

chown -R mysql:mysql /var/lib/mysql /var/run/mysqld

main.sh文件中的“service mysql start”之前。

干杯

关于php - 无法使用 DVWA、apache2 启动本地 mysql 服务器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43011147/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com