美文网首页
SOS--实验吧

SOS--实验吧

作者: Rlyown | 来源:发表于2018-10-21 16:51 被阅读50次
题目链接:http://www.shiyanbar.com/ctf/1850

首先对这种文件先使用file命令查看一下文件类型,sos: Linux rev 1.0 ext2 filesystem data, UUID=0b92a753-7ec9-4b20-8c0b-79c1fa140869,是一个linux文件系统,可以使用mount挂载查看内容,也可以直接使用binwalk -e SOS提取(注:使用foremost提取失败),提取的结果是242个压缩包,每个压缩包中各有一个字符

#!/usr/bin/env python
# coding=utf-8

import gzip
import os

OUT_DIR_NAME = 'out'
if not os.path.exists(OUT_DIR_NAME):
    os.mkdir(OUT_DIR_NAME)

OUT_DIR = os.path.join(os.path.abspath(os.path.dirname(__file__)), OUT_DIR_NAME)


# 解压缩所有压缩包
def un_gz(file_name):
    f_name = file_name
    g_file = gzip.GzipFile(file_name)
    open(os.path.join(OUT_DIR, f_name), 'w').write(g_file.read())
    g_file.close()


# 读取所有文件拼凑字符串
def conbine():
    out = ''
    for i in xrange(1, 243):
        with open(os.path.join(OUT_DIR, str(i)), 'r') as f:
            out += f.read()
    print(out)


if __name__ == '__main__':
    all_file = os.listdir('.')
    all_file.remove(__file__)
    for i in all_file:
        if os.path.isfile(i):
            un_gz(i)
    conbine()

运行代码后,得到输出字符I'm from Black Eye Galaxy,Our spaceship broke down when we passed Mars.We need your help and we are available at any terminal.The key to contact us is CTF{131Ack_3Y3_gA1AxY}.Please contact us as soon as possible.we need your help desperately.

相关文章

  • SOS--实验吧

    题目链接:http://www.shiyanbar.com/ctf/1850 首先对这种文件先使用file命令查看...

  • 实验吧-FALSE

    FALSE 原题链接 http://ctf5.shiyanbar.com/web/false.php 分析 注意到...

  • 实验吧-Forms

    Forms 原题链接 http://ctf5.shiyanbar.com/10/main.php 分析 很简单。。...

  • [实验吧]Web

    简单的登录题 解题链接: [http://ctf5.shiyanbar.com/web/jiandan/index...

  • 实验吧 trivial

    自己是真的菜。 网上的解题代码很多了,这里就不说了,主要是解析一下。 PS:trivial在数学里是一眼就可以看出...

  • 神圣的事

    学习 踢球 做实验 是吧~

  • 实验吧-逆向-证明自己吧

    题目:http://www.shiyanbar.com/ctf/28 1.附件 2.PEID打开,Microsof...

  • 实验吧-上传绕过

    上传绕过 原题链接 http://ctf5.shiyanbar.com/web/upload 分析 注意到抓到的包...

  • 实验吧-逆向-10000000

    题目:http://www.shiyanbar.com/ctf/1884 一、下载附件,打开运行 随便输入啥,回车...

  • 实验吧-Once More

    Once More 原题链接 http://ctf5.shiyanbar.com/web/more.php 分析 ...

网友评论

      本文标题:SOS--实验吧

      本文链接:https://www.haomeiwen.com/subject/qmcxaftx.html