Ubuntu 16.04sqli-labs安装避坑

Ubuntu 16.04sqli-labs安装避坑

lamp的搭建

安装apache

sudo apt-get install apache2

安装MySQL

// An highlighted block
sudo apt-get install mysql-server mysql-client
mysql -u debian-sys-maint -p
use mysql;
update user set authentication_string=password('newpasswd') where user='root'and Host = 'localhost';
update user set plugin="mysql_native_password";
flush privileges;

newpasswd是要修改的新密码

安装PHP

// An highlighted block
sudo apt-get install php7.0 libapache2-mod-php

安装sqli-labs

这里要避坑,一定要先知道自己的php版本(php -V),如果有安装了多个版本的,可以切换成自己需要的!!
如果是php5.x

访问 https://github.com/Audi-1/sqli-labs

如果是php7.x

访问 https://github.com/skyblueee/sqli-labs-php7

例如php7

// An highlighted block
sudo apt-get install git
sudo git clone https://github.com/skyblueee/sqli-labs-php7 /var/www/html/sqli-labs

下载完成后入sqli-labs文件夹,找到并修改sql-connections/db-creds.inc中你的数据库用户名和密码

<?php
//give your mysql connection username n password
dbuser ='root';         //修改成你数据库的用户名dbpass ='';             //修改成你数据库的密码
dbname ="security";host = 'localhost';
$dbname1 = "challenges";
?>
上一篇:XSS之xss-labs-level11


下一篇:XSS之xss-labs-level13