<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[Gtooler的博客]]></title><description><![CDATA[]]></description><link>https://blog.youkuaiyun.com/Gtooler</link><language>zh-cn</language><generator>https://blog.youkuaiyun.com/</generator><copyright><![CDATA[Copyright &copy; Gtooler]]></copyright><item><title><![CDATA[Personal information]]></title><link>https://blog.youkuaiyun.com/Gtooler/article/details/126158875</link><guid>https://blog.youkuaiyun.com/Gtooler/article/details/126158875</guid><author>Gtooler</author><pubDate>Thu, 04 Aug 2022 14:27:07 +0800</pubDate><description><![CDATA[个人信息]]></description><category></category></item><item><title><![CDATA[lctf2017_2ze4u_reproduce]]></title><link>https://blog.youkuaiyun.com/Gtooler/article/details/123110836</link><guid>https://blog.youkuaiyun.com/Gtooler/article/details/123110836</guid><author>Gtooler</author><pubDate>Thu, 24 Feb 2022 14:22:34 +0800</pubDate><description><![CDATA[lctf2017_2ze4u_reproduce
概述
保护全开，libc-2.23
漏洞点在 uaf
不过这题有个地方很烦，就是读和写都是从 chunk_data 的地址开始，所以需要各种方法去绕过
这题主要就是利用伪造 bk_nextsize  的 largebin_attack，实现任意地址申请，然后进行 overlap
还有就是修改 top 指针，使其指向 free_hook，最后申请出来改成 system，实现getshell
利用过程
堆布局
# 布局要注意 \x00 和 consolidate]]></description><category></category></item><item><title><![CDATA[0ctf2018_heapstorm2_reproduce]]></title><link>https://blog.youkuaiyun.com/Gtooler/article/details/123096954</link><guid>https://blog.youkuaiyun.com/Gtooler/article/details/123096954</guid><author>Gtooler</author><pubDate>Wed, 23 Feb 2022 19:06:29 +0800</pubDate><description><![CDATA[0ctf2018_heapstorm2_reproduce
概述
打了好久，学到很多
保护全开，libc-2.24
漏洞点在 off-by-one,打法是利用 off-by-one  缩小 chunk 进行 unlink 然后就可以实现类似 uaf 的 overlap，是 unlink 的一部分，又是还能用的这种 overlap
有了 overlap 就能实现 house of storm，也就是同时伪造 large_bin 的 bk_nextsize 和 bk 与 unsorted_bin 的 bk，实现]]></description><category></category></item><item><title><![CDATA[攻防世界pwn高手区stack2 lea调整栈帧导致偏移错误]]></title><link>https://blog.youkuaiyun.com/Gtooler/article/details/120762508</link><guid>https://blog.youkuaiyun.com/Gtooler/article/details/120762508</guid><author>Gtooler</author><pubDate>Thu, 14 Oct 2021 13:53:59 +0800</pubDate><description><![CDATA[Stack2

这题废话很多，说白了就一个数组越界的漏洞可以利用，没有对下标v5做限定，所以可以利用数组越界，直接越过canary，利用留下的后门getshell

刚开始看ida以为位移是0x74所以exp如下
from pwn import *

p = remote('111.200.241.244', '50928')
# p = process("./stack2")
# context.log_level = 'debug'

hackhere = [0x9b, 0x85, 0x04, 0x08]]></description><category></category></item><item><title><![CDATA[格式字符串漏洞之任意地址覆盖大数字]]></title><link>https://blog.youkuaiyun.com/Gtooler/article/details/120746901</link><guid>https://blog.youkuaiyun.com/Gtooler/article/details/120746901</guid><author>Gtooler</author><pubDate>Wed, 13 Oct 2021 16:37:25 +0800</pubDate><description><![CDATA[格式化字符串漏洞覆盖大数字时，如果选择一次性输出大数字个字节来进行覆盖，会很久很久，或者直接报错中断，所以来搞个攻防世界高手区的题目来总结一下
pwn高手区，实时数据监测这道题，就是格式化字符串漏洞覆盖大数字


题目运行时会直接告诉你key的地址，我们只需要利用imagemagic中的printf利用格式化字符串漏洞来覆盖就行了，但就像刚才说的，直接覆盖时间太久了而且会报错，所以可以想想别的办法
如果我们想覆盖key为0x02223322，那么根据小端存储，在内存中就是\x22 \x33 \x22 \x0]]></description><category></category></item><item><title><![CDATA[蒸米ROP_X64学习总结]]></title><link>https://blog.youkuaiyun.com/Gtooler/article/details/120678708</link><guid>https://blog.youkuaiyun.com/Gtooler/article/details/120678708</guid><author>Gtooler</author><pubDate>Sat, 09 Oct 2021 20:37:45 +0800</pubDate><description><![CDATA[X86与X64
x86中参数都是存在栈上，但在x64中的前六个参数依次存在RDI，RSI，RDX，RCX，R8、R9中，如果还有更多的参数的话才会存在栈上
level3(ROP简单绕过NX)

发现有栈溢出
找到system(/bin/sh)

把这个函数写入栈中就ok了 exp如下
#!/usr/bin/env python3
from pwn import *

p = process("./level3")

payload = b"a" * 136 + p64(0x0000000000400584)]]></description><category></category></item><item><title><![CDATA[蒸米ROP_X86学习总结]]></title><link>https://blog.youkuaiyun.com/Gtooler/article/details/120659751</link><guid>https://blog.youkuaiyun.com/Gtooler/article/details/120659751</guid><author>Gtooler</author><pubDate>Fri, 08 Oct 2021 21:00:03 +0800</pubDate><description><![CDATA[蒸米的相关附件感兴趣自行下载
学了点蒸米的ROP笔记，自己来写个总结
ROP是啥
全称为Return-oriented programming，核心是利用ret指令控制执行顺序，作为一种高级的攻击内存的技术，可以绕过各种简单防御
关于X86
level1(栈上写入shellcode)
Linux系统的ASLR会使内存里的地址随机化，可以先关掉
sudo -s
echo 0 &gt; /proc/sys/kernel/randomize_va_space
exit


ida打开会发现有个read函数可以进行]]></description><category></category></item><item><title><![CDATA[攻防世界 pwn新手区 wp]]></title><link>https://blog.youkuaiyun.com/Gtooler/article/details/120641641</link><guid>https://blog.youkuaiyun.com/Gtooler/article/details/120641641</guid><author>Gtooler</author><pubDate>Thu, 07 Oct 2021 21:16:22 +0800</pubDate><description><![CDATA[get-shell

此题是经典入门题，没有设置任何漏洞，直接给了shell
直接nc连上，然后ls，最后cat flag即可
hello_pwn


发现只要让dword_60106C == 1853186401就可以拿到flag
read函数将把数据读入unk_601068中，要想办法让数据覆盖到dword_60106C，所以查看两个数据内存

计算距离为4，写个exp即可
from pwn import *

p = remote('111.200.241.244', '56851')
p.recvu]]></description><category></category></item><item><title><![CDATA[2020syc二面总结]]></title><link>https://blog.youkuaiyun.com/Gtooler/article/details/120519329</link><guid>https://blog.youkuaiyun.com/Gtooler/article/details/120519329</guid><author>Gtooler</author><pubDate>Mon, 27 Sep 2021 23:13:26 +0800</pubDate><description><![CDATA[拿到题目用die扫一下

然后拖入32位ida看看
发现有很多函数，不知道关键函数在哪，shift+f12看看
找到关键语句进去看看

结果发现有花指令，全是jx +1 jx+1的这种结构
对着跳转的位置按D转换成数据，然后把花指令nop掉，然后再把数据C一下转换成代码，最后P一下创建函数就可以了
后面的jx +1 jx+1 这样的花指令都是这样做
然后就可以f5看伪代码了
但有个地方堆栈不平衡
要手动改一下

改完之后再去看伪代码

发现这题要两个flag
先搞第一个
找到加密算法部分，发现是把 is f]]></description><category></category></item><item><title><![CDATA[moectf chall 数独题 z3约束器求解]]></title><link>https://blog.youkuaiyun.com/Gtooler/article/details/120499572</link><guid>https://blog.youkuaiyun.com/Gtooler/article/details/120499572</guid><author>Gtooler</author><pubDate>Mon, 27 Sep 2021 09:24:43 +0800</pubDate><description><![CDATA[这是一道数独题第一次碰见想写一下wp
此题是2021moectf的题目
拖入ida看看

cheak123是关键函数
分别进去看看
cheak1 判断每一横排的数字为1-9不重复

cheak2 判断每一竖排的数字为1-9不重复

cheak3 判断九宫格里的数字为1-9且不重复

然后知道这是一道数独， 如下
box = [0x00, 0x00, 0x05, 0x00, 0x00, 0x04, 0x03, 0x06, 0x00,
       0x00, 0x00, 0x00, 0x00, 0x05, 0]]></description><category></category></item><item><title><![CDATA[关于pycdc的安装]]></title><link>https://blog.youkuaiyun.com/Gtooler/article/details/120492377</link><guid>https://blog.youkuaiyun.com/Gtooler/article/details/120492377</guid><author>Gtooler</author><pubDate>Sun, 26 Sep 2021 16:54:10 +0800</pubDate><description><![CDATA[sudo apt install git #安装git

git clone https://github.com/zrax/pycdc.git #下载pycdc到桌面

sudo apt install cmake #安装cmake

cd pycdc #进入到pycdc的目录

cmake .
make #安装pycdc工具

我第一次装报了The CXX compiler identification is unknown的错，搞了半天，其实只要装个g++就行了
sudo apt-get update]]></description><category></category></item><item><title><![CDATA[Easy_re 手撸pyc字节码]]></title><link>https://blog.youkuaiyun.com/Gtooler/article/details/120486734</link><guid>https://blog.youkuaiyun.com/Gtooler/article/details/120486734</guid><author>Gtooler</author><pubDate>Sun, 26 Sep 2021 16:33:30 +0800</pubDate><description><![CDATA[拿到文件，先用工具扫一下
9u0xu3ha0

推测是用pyinstaller打包pyc成exe
所以要将python的exe反编译
先使用pyinstxtractor.py反编译exe就行
把pyinstxtractor.py和main.exe放在同一文件夹下，然后用命令python pyinstxtractor.py main.exe即可得到main.exe_extracted文件夹
打开后找到main.pyc和struct.pyc，分别用010Editor打开


发现main前十六个字节有问题，复制]]></description><category></category></item></channel></rss>