【dasctf】easy_log

base解码可得压缩包密码

二分法盲注

python 复制代码
import urllib.parse,re
with open(r'access.log','r') as f:
    log=f.readlines()
dict1={}
count=0
#判断逻辑,最后一个fasle则取自身;最后一个为true则加1;
for each in log:
    res=re.findall(r'flag\),(\d+),1\)\)>(\d+) HTTP/1.1\" (\d+) (\d+)',urllib.parse.unquote(each))
    if res and res[0][3]=='699' :#last 404 ,the char will add to dict
        dict1[res[0][0]]=chr(int(res[0][1])+1)
    if res and res[0][3]=='704' :#last 404 ,the char will add to dict
        dict1[res[0][0]]=chr(int(res[0][1]))
        count+=1
print(dict1,len(dict1)) 
print(''.join(dict1.values()))

其实是个zip 文件

DASCTF{fd67c1798e9cb29e8fc467e9dcefbd7f}

相关推荐
失败尽常态5231 小时前
用Python实现Excel数据同步到飞书文档
python·excel·飞书
2501_904447741 小时前
OPPO发布新型折叠屏手机 起售价8999
python·智能手机·django·virtualenv·pygame
青龙小码农1 小时前
yum报错:bash: /usr/bin/yum: /usr/bin/python: 坏的解释器:没有那个文件或目录
开发语言·python·bash·liunx
大数据追光猿1 小时前
Python应用算法之贪心算法理解和实践
大数据·开发语言·人工智能·python·深度学习·算法·贪心算法
Leuanghing2 小时前
【Leetcode】11. 盛最多水的容器
python·算法·leetcode
xinxiyinhe3 小时前
如何设置Cursor中.cursorrules文件
人工智能·python
诸神缄默不语3 小时前
如何用Python 3自动打开exe程序
python·os·subprocess·python 3
橘子师兄4 小时前
分页功能组件开发
数据库·python·django
Logintern094 小时前
使用VS Code进行Python编程的一些快捷方式
开发语言·python
Multiple-ji4 小时前
想学python进来看看把
开发语言·python