CTF SQL注入知识点
理解常用的登录判断
select * from user where username='admin' and password='123'
数据库元信息
infomation_schema
懂PHP
php://input
php://input可以读取没有处理过的POST数据。
相较于$HTTP_RAW_POST_DATA而言,它给内存带来的压力较小,并且不需要特殊的php.ini设置。php://input不能用于enctype=multipart/form-data
file_get_contents("php://input")获取post数据的二进制流
with rollup:熟知偏门的SQL知识
select * from user group by id,name,age with rollup;
跟with rollup类似的还有with cube
获取当前数据库
select database()
获取当前数据库表
select table_name from information_schema.tables where table_schema='my_database'
SQL流程控制语句
SELECT Category =
CASE type
WHEN 'popular_comp' THEN 'Popular Computing'
WHEN 'mod_cook' THEN 'Modern Cooking'
WHEN 'business' THEN 'Business'
WHEN 'psychology' THEN 'Psychology'
WHEN 'trad_cook' THEN 'Traditional Cooking'
ELSE 'Not yet categorized'
END,
CAST(title AS varchar()) AS 'Shortened Title',
price AS Price
FROM titles
WHERE price IS NOT NULL
ORDER BY type, priceMySQL常用函数:不同数据库不一样
ascii()
select ascii('1234');#返回1 SELECT ascii('1');#返回1substring(s from begIndex for length)
获取子串
计时攻击:服务器不返回具体信息
计时攻击巧妙绝伦,虽然有运行SQL语句的权限,但是却没办法获取SQL输出结果。
这时,可以通过时间来确定SQL输出结果。
你虽然什么都没说,但我看到你犹豫了。
case when (ascii(substring((select database()) from %d for ))
& %d!=)
then sleep(0.5)
else sleep()
end对于长度为4的字符串,需要探测4×256次。
SQL中的空
select ''=0返回1
相关推荐
liuyang000 2020-04-07
ALiDan 2020-07-27
qshpeng 2020-07-26
世樹 2020-07-17
chenjiazhu 2020-07-08
一对儿程序猿 2020-07-04
明月清风精进不止 2020-06-13
godfather 2020-06-13
ItBJLan 2020-06-11
tanrong 2020-06-11
ALiDan 2020-06-11
码墨 2020-06-09
世樹 2020-06-05
lt云飞扬gt 2020-06-03
godfather 2020-06-03
qshpeng 2020-05-11
明月清风精进不止 2020-05-07