题目来源:WDCTF-2017

题目链接:https://adworld.xctf.org.cn/task/answer?type=misc&number=1&grade=1&id=4840&page=4

writeup

下载得到rar 解压得到没有扩展名的文件

刚拿到文件时完全没有思路

参考

https://blog.betamao.me/2017/09/17/2017-%E9%97%AE%E9%BC%8E%E6%9D%AF%E5%88%9D%E8%B5%9B-WP/

file命令

file命令查看文件类型

添加扩展名.pcapng然后用wireshark打开

wireshark追踪TCP流

追踪TCP流 流5时发现rar

显示和保存数据为原始数据

复制出来在010粘贴然后保存为rar

解压需要密码

追踪TCP流 流6时发现一段base64编码数据和一个Python脚本

19aaFYsQQKr+hVX6hl2smAUQ5a767TsULEUebWSajEo=

# coding:utf-8

__author__ = 'YFP'

from Crypto import Random
from Crypto.Cipher import AES import sys
import base64 IV = 'QWERTYUIOPASDFGH' def decrypt(encrypted):
aes = AES.new(IV, AES.MODE_CBC, IV)
return aes.decrypt(encrypted) def encrypt(message):
length = 16
count = len(message)
padding = length - (count % length)
message = message + '\0' * padding
aes = AES.new(IV, AES.MODE_CBC, IV)
return aes.encrypt(message) str = 'this is a test' example = encrypt(str)
print(decrypt(example))

获取rar解压密码

对其进行base64解密然后使用Python脚本解密

修改Python脚本

# coding:utf-8

__author__ = 'YFP'

from Crypto import Random
from Crypto.Cipher import AES import sys
import base64 IV = 'QWERTYUIOPASDFGH' def decrypt(encrypted):
aes = AES.new(IV, AES.MODE_CBC, IV)
return aes.decrypt(encrypted) def encrypt(message):
length = 16
count = len(message)
padding = length - (count % length)
message = message + '\0' * padding
aes = AES.new(IV, AES.MODE_CBC, IV)
return aes.encrypt(message) str = 'this is a test' example = encrypt(str)
print(decrypt(example)) #增加如下两行
a='19aaFYsQQKr+hVX6hl2smAUQ5a767TsULEUebWSajEo='
print(decrypt(base64.b64decode(a)))

脚本运行时Python3环境报错

使用Python2环境运行

需要安装pyCrypto模块

安装过程中出现报错可参考

https://blog.csdn.net/teloy1989/article/details/72862108

得到解压密码:No_One_Can_Decrypt_Me

解压后得到打开flag.txt得到flag

Flag:WDCTF{Seclab_CTF_2017}

结束。

转载请注明出处

本文作者:双份浓缩馥芮白

原文链接:https://www.cnblogs.com/Flat-White/p/13714987.html

版权所有,如需转载请注明出处。

最新文章

  1. windows命令行下简单使用javac、java、javap详细演示
  2. meta标签大全
  3. .NET设计模式(11):组合模式(Composite Pattern)(转)
  4. 初识-----基于Socket的UDP和TCP编程及测试代码
  5. 【转】WPS文档怎么清除格式
  6. Type-C设计上的防护
  7. POJ 1696 Space Ant 极角排序(叉积的应用)
  8. Timus Online Judge:ural:1006. Square Frames
  9. 使用串口下载vxworks映象的方法
  10. TIA Portal V13 WinCC中创建多语言项目
  11. 树链剖分——线段树区间合并bzoj染色
  12. SpringBoot + SpringCloud学习踩坑实记
  13. 智能POS打印配置&常见问题FAQ 12-14 后期持续更新
  14. ux.form.field.Month 只能选年、月的时间扩展
  15. Docker Kubernetes 容器更新与回滚
  16. 大话设计模式之模板模式 C#
  17. Sql Server 中由数字转换为指定长度的字符串
  18. HDU 4585 平衡树Treap
  19. Guideline 2.1 - Information Needed
  20. nowcoder 202H-卡牌游戏

热门文章

  1. 如何使用GraphQL Client: Apollo Android
  2. 怎么去掉右下角的thinkphp的图标
  3. .Net -- NLog日志框架配置与使用
  4. Coposition 详解
  5. 使用 xunit 编写测试代码
  6. docker mysql初始化多个sql脚本
  7. python爬取股票最新数据并用excel绘制树状图
  8. redis数据结构和对象一
  9. 后端程序员之路 54、go 日志库
  10. 学习java之基础语法(一)