1.安装软件
sudo yum install -y php-mysqlnd.i686 php
sudo yum install -y phpMyAdmin.noarch
sudo yum install -y community-mysql-server
注:为了安全起见,需要将httpd.conf和/etc/my.conf的监听地址都设置为127.0.0.1,即:
cat /etc/my.cnf
[mysqld]
bind-address=127.0.0.1
[yuanzhufu@localhost etc]$ cat /etc/httpd/conf/httpd.conf|grep 127.0.0.1
Listen 127.0.0.1:80
[yuanzhufu@localhost etc]$
2.启动httpd及mysqld服务
sudo service httpd start
sudo service mysqld start
2.修改数据库密码
MySQL [(none)]> set password for root@localhost = password('ttd4x7t!Q@W#E$R');
Query OK, 0 rows affected (0.00 sec)
MySQL [(none)]> flush privileges;
Query OK, 0 rows affected (0.00 sec)
MySQL [(none)]>
3.拷贝sqli-labs到/var/www/html/ctf/sqli-labs/
4.修改数据库连接配置
将/var/www/html/ctf/sqli-labs/sql-connections/db-creds.inc中的帐号密码修改
5.执行php建库脚本测试
php -f /var/www/html/ctf/sqli-labs/sql-connections/setup-db.php
6.打开网址
阅读(2155) | 评论(0) | 转发(0) |