奇怪的文件名——write up
来源:互联网 发布:手机免费炒股软件 编辑:程序博客网 时间:2024/06/11 12:22
0x00 思路
题目链接:
http://sec.hdu.edu.cn/questionLibrary/questionTerminal?questionCategory=cipher&orderType=default&qid=1050
压缩包链接:http://sec.hdu.edu.cn/resource/upload/question/1050/misc1.zip
下载题目的压缩包,打开发现文件名均为md5加密
随意选两个文件名,发现解密后均为数字,将文件名遍历并md5解密,得到结果:
27 6 33 36 35 19 24 28 30 23 21 9 26 32 11 29 18 17 25 7 20 15 38 37 4 14 22 31 12 1 13 16 2 8 0 10 39 34 5 3
看到这串数字十分的无语,完全不知道下一步。
打开每个文件,发现里面是16进制的数。同时发现文件名的数字没有重复,因此将提取文件内容,同时将内容按照文件名排序,得到如下内容:
66 6c 61 67 69 73 7b 30 32 63 65 66 37 65 65 62 37 35 66 64 64 39 64 66 63 36 37 63 30 64 63 31 65 33 65 32 35 35 62 7d
将16进制转换为字符串,得到答案:
flagis{02cef7eeb75fdd9dfc67c0dc1e3e255b}
0x01 代码
def filter(): m2 = hashlib.md5() key_arr =[] dic = {} for i in range(0,100): str = '%d' %i t = hashlib.md5(str.encode("utf-8")).hexdigest() key_arr.append(t) encode_str = "" result = "" for parent,dirnames,filenames in os.walk('misc/'): for filename in filenames: for ind in range(0,100): if filename == key_arr[ind]: encode_str += "%d " %ind dic[ind] = filename sortBKs = sorted(dic.items(),key=lambda t:t[0]) for d,x in sortBKs: f = open('misc/'+ x,'r') line = f.readline() result =result + line + " " f.close() result = result.replace(" ","") re = bytes.fromhex(result).decode('utf-8') print(re)filter()
阅读全文
0 0
- 奇怪的文件名——write up
- 奇怪的文件名反向显示
- 2014XDCTF——web简单write up
- linux 删除文件名比较奇怪的文件
- pwnable.kr解题write up —— Toddler's Bottle(一)
- pwnable.kr解题write up —— Toddler's Bottle(二)
- CSAW CTF2014 write-up
- hctf 2016 write up
- Wechall.No_Escape write up
- ISCC2017 Web write up
- Protostar Stack Write Up
- Protostar Format Write Up
- Protostar Heap Write Up
- Linux 系统中匹配文件名大小写的方式很奇怪?
- Linux"有限公司"——奇怪的舞台
- 奇怪的问题——好玩!
- 奇怪的FOR——NEXT
- demo04——奇怪的比赛
- Oracle LOB
- Python中小整数对象池和大整数对象池
- 'ascii' codec can't encode characters in position解决办法
- HDU3584 Cube
- Allowance POJ
- 奇怪的文件名——write up
- 2017年8月25日 星期五
- 函数式编程
- sparkSql入门1
- Hibernate配置详解
- ACM进阶之路
- stm32 内存管理
- HDU
- U盘图标改成自己喜欢的图标