1.1 部署SQLi-Labs
SQLI-LABS是一个学习SQL注入的实验平台。
1.1.1 安装配置LAMP环境
[[email protected] ~]# yum install -y httpd php php-mysql php-gd mariadb-server mariadb [[email protected] ~]# vim /var/www/html/phpinfo.php <?php phpinfo(); ?> [[email protected] ~]# systemctl enable mariadb.service [[email protected] ~]# systemctl enable httpd.service [[email protected] ~]# systemctl start mariadb [[email protected] ~]# systemctl start httpd [[email protected] ~]# mysqladmin -u root password "123456"
1.1.2 下载部署配置SQLi-Labs
[[email protected] ~]# cd /var/www/html/ [[email protected] html]# wget https://github.com/Audi-1/sqli-labs/archive/refs/heads/master.zip [[email protected] html]# unzip master.zip [[email protected] html]# mv sqli-labs-master/ sqli-labs [[email protected] html]# chown -R apache:apache /var/www/html/ [[email protected] html]# vim /var/www/html/sqli-labs/sql-connections/db-creds.inc 5 $dbpass ='123456'; [[email protected] html]# systemctl restart httpd
1.1.3 Web页面导入数据库信息
导入成功显示:
成功后直接点击浏览器上一页返回即可。
1.2 SQLi-Labs使用方法
- 参数说明:
?表示传递参数,通常都是在页面后会有 ?id=数值 这样的方式传递参数给服务器,然后返回参数对应的页面信息,我们发现是在/后面直接使用?传递参数,此时参数会传递给默认页面。
实际上在URL中传递参数时,相当于执行了以下sql语句:select * from users where id='1';

我的微信
如果有技术上的问题可以扫一扫我的微信