{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"pygments_lexer":"ipython3","nbconvert_exporter":"python","version":"3.6.4","file_extension":".py","codemirror_mode":{"name":"ipython","version":3},"name":"python","mimetype":"text/x-python"}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"markdown","source":"# CTF Template\n\nWelcome to the DEFCON AI Village Capture-the-Flag (CTF). Feel free to copy this notebook and use it as the foundation for your submissions.\n\n## Intro\n\nHelp Henry Hacker get to Homecoming! In this series of challenges, you'll be interacting with various machine learning challenges. You're welcome to use this notebook as a template, but can also use any other resources. `Submission Helper` code is just there to show you how to interact with a challenge. You're encouraged to write your own code. There are no fake flags, so if you're returned a 256 character-long string, you found it! Collect those flags, add them next to their corresponding challenge in `solution.csv` (provided) and submit them to the scoreboard. We've provided an `add_flag()` function to help with this. There's no limit to how many times you try the challenges, but you can only submit `solution.csv` to the scoreboard 50 times per day. \n\nCTF's are inherently puzzles that are intended to challenge you and help you learn new things. Sometimes they may be a little ambiguous or misleading. That's part of the challenge! However, if you feel like a challenge or piece of infrastructure isn't working correctly, contact the organizers through the Kaggle discussion board or the discord channel.","metadata":{}},{"cell_type":"code","source":"# We're just importing some stuff to make sure the challenges and helper code works.\n# Feel free to import anything else you need (or solve in a different language), but if you overwrite these, provided code may not work.\n\nimport pandas as pd\nimport numpy as np\nimport os\nimport requests\nfrom IPython.display import Image as Ima\nfrom IPython.display import clear_output, display\nfrom PIL import Image as Im\nfrom torch.utils.data import Dataset, DataLoader\nimport torch\nimport joblib\nimport matplotlib.pyplot as plt\nimport json\nimport base64\nimport shutil\nimport warnings\nwarnings.filterwarnings(\"ignore\")\n\n\ndir_name = \"/kaggle/input/ai-village-ctf\"\n\n# Input data files are available in the read-only \"../input/\" directory\n# You can write up to 20GB to the current directory (/kaggle/working/) that gets preserved as output when you create a version using \"Save & Run All\" \n# You can also write temporary files to /kaggle/temp/, but they won't be saved outside of the current session","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2022-09-12T00:25:51.283128Z","iopub.execute_input":"2022-09-12T00:25:51.283795Z","iopub.status.idle":"2022-09-12T00:25:51.292116Z","shell.execute_reply.started":"2022-09-12T00:25:51.283756Z","shell.execute_reply":"2022-09-12T00:25:51.290718Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# A helper function for tracking flags. You could do it yourself, but why?\n\ndef add_flag(challenge_id: str, flag: str) -> str:\n    try:\n        submission_path = \"/kaggle/working/submission.csv\"\n        template_path = f\"{dir_name}/submission.csv\"\n        if not os.path.isfile(submission_path) :\n            shutil.copyfile(template_path, submission_path)\n        flags = pd.read_csv(submission_path, index_col=\"challenge_id\")\n        valid = flags.index.to_list()\n        if challenge_id in valid:\n            flags.at[challenge_id] = flag\n            flags.to_csv(submission_path)\n            print(\"Flag saved. If you want to update the scoreboard, click 'submit' on the right. Remember that you can only update your score on the scoreboard 50 times per day\")\n        else:\n            print(\"Invalid challenge_id\")\n    except:\n        print(\"We had trouble saving that flag. Keep a copy of it and contact the CTF organizers.\")","metadata":{"execution":{"iopub.status.busy":"2022-09-12T00:25:51.294227Z","iopub.execute_input":"2022-09-12T00:25:51.295145Z","iopub.status.idle":"2022-09-12T00:25:51.312827Z","shell.execute_reply.started":"2022-09-12T00:25:51.295104Z","shell.execute_reply":"2022-09-12T00:25:51.311721Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Math\n\nThis series of \"Math\" challenges is designed to introduce the concepts of dimensionality.\n\nData is often represented in a high dimensional space, but is actually several intrinsically low dimensional components that can be diagnosed. Intrinsic low-dimensionailty is incredibly important to machine learning because many ML algorithms rely on it. Medical EKG data is as single intrinsically 2 dimensional component, despite often being represented as 100 dimensions or more. The classic MNIST dataset is several components of 8-10 dimensions, depending on the digits class, despite being represented in 784 dimensions. The 4 math challenges are focused on this problem. **If you need a hint, ask Sven at the Art Booth.**","metadata":{}},{"cell_type":"markdown","source":"# Math Challenge 1 (id: math_1) -- 100 Points\n\nHow many clusters are in the clusters1.npy, clusters2.npy, and clusters3.npy? The key is the number of clusters in order, with no spaces. These files are available in the input directory under `math`.","metadata":{}},{"cell_type":"code","source":"from sklearn.cluster import KMeans\nx=np.load(f\"{dir_name}/math/clusters1.npy\")\ndf=pd.DataFrame(x)\nlimit = int((df.shape[0]//2)**0.5)\nwcss = {}\nfor k in range(1,20):\n    model = KMeans(n_clusters=k)\n    model.fit(df)\n    wcss[k] = model.inertia_\nplt.plot(wcss.keys(), wcss.values(), 'gs-')\nplt.xlabel('Values of \"k\"')\nplt.ylabel('WCSS')\nplt.title(\"5\")\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2022-09-12T00:25:51.314848Z","iopub.execute_input":"2022-09-12T00:25:51.315442Z","iopub.status.idle":"2022-09-12T00:25:52.274837Z","shell.execute_reply.started":"2022-09-12T00:25:51.315406Z","shell.execute_reply":"2022-09-12T00:25:52.273627Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from sklearn.cluster import KMeans\nx=np.load(f\"{dir_name}/math/clusters2.npy\")\ndf=pd.DataFrame(x)\nlimit = int((df.shape[0]//2)**0.5)\nwcss = {}\nfor k in range(1,20):\n    model = KMeans(n_clusters=k)\n    model.fit(df)\n    wcss[k] = model.inertia_\nplt.plot(wcss.keys(), wcss.values(), 'gs-')\nplt.xlabel('Values of \"k\"')\nplt.ylabel('WCSS')\nplt.title(\"2\")\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2022-09-12T00:25:52.276419Z","iopub.execute_input":"2022-09-12T00:25:52.277122Z","iopub.status.idle":"2022-09-12T00:25:53.084618Z","shell.execute_reply.started":"2022-09-12T00:25:52.277085Z","shell.execute_reply":"2022-09-12T00:25:53.083299Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from sklearn.cluster import KMeans\nx=np.load(f\"{dir_name}/math/clusters3.npy\")\ndf=pd.DataFrame(x)\nlimit = int((df.shape[0]//2)**0.5)\nwcss = {}\nfor k in range(1,20):\n    model = KMeans(n_clusters=k)\n    model.fit(df)\n    wcss[k] = model.inertia_\nplt.plot(wcss.keys(), wcss.values(), 'gs-')\nplt.xlabel('Values of \"k\"')\nplt.ylabel('WCSS')\nplt.title(\"3\")\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2022-09-12T00:25:53.087703Z","iopub.execute_input":"2022-09-12T00:25:53.088081Z","iopub.status.idle":"2022-09-12T00:25:53.807649Z","shell.execute_reply.started":"2022-09-12T00:25:53.088049Z","shell.execute_reply":"2022-09-12T00:25:53.806355Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Submission Helper\n\ntry:\n    r = requests.post(\"http://flags.fly.dev:5000/score\", json=json.dumps({\"challenge_id\": \"math_1\", \"submission\": \"523\"}))\n    print(r.text)\nexcept requests.exceptions.ConnectionError:\n    print(\"Connection problems. Contact the CTF organizers.\")","metadata":{"execution":{"iopub.status.busy":"2022-09-12T00:25:53.809331Z","iopub.execute_input":"2022-09-12T00:25:53.809696Z","iopub.status.idle":"2022-09-12T00:25:54.477431Z","shell.execute_reply.started":"2022-09-12T00:25:53.809650Z","shell.execute_reply":"2022-09-12T00:25:54.475986Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"add_flag(\"math_1\", \"M08YVX29FJQK0Z8K58H8H4JPB5T{KO6Q4QT3IQUIB17HRQ80GI7LKYFD7TD6JNZS}K7KYN0MVIQP2W3Y9W34UUFGGKNHGGU29KAGJX2ZXTJTHMAECYQQ8RI71IAV2VI6\")","metadata":{"execution":{"iopub.status.busy":"2022-09-12T00:25:54.479702Z","iopub.execute_input":"2022-09-12T00:25:54.480070Z","iopub.status.idle":"2022-09-12T00:25:54.492406Z","shell.execute_reply.started":"2022-09-12T00:25:54.480039Z","shell.execute_reply":"2022-09-12T00:25:54.491261Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Math Challenge 2 (id: math_2) -- 200 Points\n\nWhat's the dimensionality of the data in first_dim1.npy, first_dim2.npy, and first_dim3.npy? The key is the number of dimensions in order, with no spaces.  These files are available in the input directory under `math`.","metadata":{}},{"cell_type":"code","source":"from sklearn.decomposition import PCA\nx=np.load(f\"{dir_name}/math/first_dim1.npy\")\ndf=pd.DataFrame(x)\npca = PCA()\ndf_pca = pd.DataFrame(pca.fit_transform(df))\npd.DataFrame(pca.explained_variance_ratio_).plot.bar()\nplt.legend('')\nplt.title(\"3\")\nplt.xlabel('Principal Components')\nplt.ylabel('Explained Varience');\n","metadata":{"execution":{"iopub.status.busy":"2022-09-12T00:25:54.493881Z","iopub.execute_input":"2022-09-12T00:25:54.494590Z","iopub.status.idle":"2022-09-12T00:25:54.746839Z","shell.execute_reply.started":"2022-09-12T00:25:54.494545Z","shell.execute_reply":"2022-09-12T00:25:54.745978Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from sklearn.decomposition import PCA\nx=np.load(f\"{dir_name}/math/first_dim2.npy\")\ndf=pd.DataFrame(x)\npca = PCA()\ndf_pca = pd.DataFrame(pca.fit_transform(df))\npd.DataFrame(pca.explained_variance_ratio_).plot.bar()\nplt.legend('')\nplt.title(\"5\")\nplt.xlabel('Principal Components')\nplt.ylabel('Explained Varience');","metadata":{"execution":{"iopub.status.busy":"2022-09-12T00:25:54.748248Z","iopub.execute_input":"2022-09-12T00:25:54.749355Z","iopub.status.idle":"2022-09-12T00:25:55.010865Z","shell.execute_reply.started":"2022-09-12T00:25:54.749306Z","shell.execute_reply":"2022-09-12T00:25:55.009571Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from sklearn.decomposition import PCA\nx=np.load(f\"{dir_name}/math/first_dim3.npy\")\ndf=pd.DataFrame(x)\npca = PCA()\ndf_pca = pd.DataFrame(pca.fit_transform(df))\npd.DataFrame(pca.explained_variance_ratio_).plot.bar()\nplt.legend('')\nplt.title(\"4\")\nplt.xlabel('Principal Components')\nplt.ylabel('Explained Varience');","metadata":{"execution":{"iopub.status.busy":"2022-09-12T00:25:55.012479Z","iopub.execute_input":"2022-09-12T00:25:55.012893Z","iopub.status.idle":"2022-09-12T00:25:55.252033Z","shell.execute_reply.started":"2022-09-12T00:25:55.012856Z","shell.execute_reply":"2022-09-12T00:25:55.250797Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Submission Helper\n\ntry:\n    r = requests.post(\"http://flags.fly.dev:5000/score\", json=json.dumps({\"challenge_id\": \"math_2\", \"submission\": \"354\"}))\n    print(r.text)\nexcept requests.exceptions.ConnectionError:\n    print(\"Connection problems. Contact the CTF organizers.\")","metadata":{"execution":{"iopub.status.busy":"2022-09-12T00:25:55.256131Z","iopub.execute_input":"2022-09-12T00:25:55.256538Z","iopub.status.idle":"2022-09-12T00:25:55.920389Z","shell.execute_reply.started":"2022-09-12T00:25:55.256501Z","shell.execute_reply":"2022-09-12T00:25:55.919238Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"add_flag(\"math_2\", \"V2S43OGXJBH5EAFCPDTGGA53XL}E8ISMZIX21TC1I3T2FZDSGD9ESJKOAFHMXPA2ASY4FNC7L6FC3026QN57M2BPRV7HYOWMAUCTK04MNUIQN9JVJ{WWKQZKATNL1SM1\")","metadata":{"execution":{"iopub.status.busy":"2022-09-12T00:25:55.922315Z","iopub.execute_input":"2022-09-12T00:25:55.922690Z","iopub.status.idle":"2022-09-12T00:25:55.932524Z","shell.execute_reply.started":"2022-09-12T00:25:55.922640Z","shell.execute_reply":"2022-09-12T00:25:55.931502Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Math Challenge 3 (id: math_3) -- 300 Points\n\nWhat's the dimensionality of the data in second_dim1.npy, second_dim2.npy, and second_dim3.npy? The key is the number of the dimensionality in order, with no spaces.  These files are available in the input directory under `math`.","metadata":{}},{"cell_type":"code","source":"x=np.load(f\"{dir_name}/math/second_dim1.npy\")\ndf=pd.DataFrame(x)\npca = PCA()\ndf_pca = pd.DataFrame(pca.fit_transform(df))\npd.DataFrame(pca.explained_variance_ratio_).plot.bar()\nplt.legend('')\nplt.title('4')\nplt.xlabel('Principal Components')\nplt.ylabel('Explained Varience');","metadata":{"execution":{"iopub.status.busy":"2022-09-12T00:25:55.933871Z","iopub.execute_input":"2022-09-12T00:25:55.934818Z","iopub.status.idle":"2022-09-12T00:25:56.174821Z","shell.execute_reply.started":"2022-09-12T00:25:55.934783Z","shell.execute_reply":"2022-09-12T00:25:56.173354Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"x=np.load(f\"{dir_name}/math/second_dim2.npy\")\ndf=pd.DataFrame(x)\npca = PCA()\ndf_pca = pd.DataFrame(pca.fit_transform(df))\npd.DataFrame(pca.explained_variance_ratio_).plot.bar()\nplt.legend('')\nplt.title('7')\nplt.xlabel('Principal Components')\nplt.ylabel('Explained Varience');","metadata":{"execution":{"iopub.status.busy":"2022-09-12T00:25:56.176510Z","iopub.execute_input":"2022-09-12T00:25:56.177609Z","iopub.status.idle":"2022-09-12T00:25:56.412349Z","shell.execute_reply.started":"2022-09-12T00:25:56.177568Z","shell.execute_reply":"2022-09-12T00:25:56.410939Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"x=np.load(f\"{dir_name}/math/second_dim3.npy\")\ndf=pd.DataFrame(x)\npca = PCA()\ndf_pca = pd.DataFrame(pca.fit_transform(df))\npd.DataFrame(pca.explained_variance_ratio_).plot.bar()\nplt.legend('')\nplt.title('4')\nplt.xlabel('Principal Components')\nplt.ylabel('Explained Varience');","metadata":{"execution":{"iopub.status.busy":"2022-09-12T00:25:56.414021Z","iopub.execute_input":"2022-09-12T00:25:56.415043Z","iopub.status.idle":"2022-09-12T00:25:56.656147Z","shell.execute_reply.started":"2022-09-12T00:25:56.415005Z","shell.execute_reply":"2022-09-12T00:25:56.654960Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Submission Helper\n\ntry:\n    r = requests.post(\"http://flags.fly.dev:5000/score\", json=json.dumps({\"challenge_id\": \"math_3\", \"submission\": \"474\"}))\n    print(r.text)\nexcept requests.exceptions.ConnectionError:\n    print(\"Connection problems. Contact the CTF organizers.\")","metadata":{"execution":{"iopub.status.busy":"2022-09-12T00:25:56.657512Z","iopub.execute_input":"2022-09-12T00:25:56.657851Z","iopub.status.idle":"2022-09-12T00:25:57.319910Z","shell.execute_reply.started":"2022-09-12T00:25:56.657820Z","shell.execute_reply":"2022-09-12T00:25:57.319160Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"add_flag(\"math_3\", \"B9OXLDF6UH4PG1WXK42UJQ8OV}{LTSUHP8M8B5R7IJPHO5ZYWJIO3QULOLJEHCNK03JZJN7NLKR_06DW3FU0A5HIZ8OJSRWACEVTGYRIV2JEZGVNCP0N4T2YN4TMXY15\")","metadata":{"execution":{"iopub.status.busy":"2022-09-12T00:25:57.320932Z","iopub.execute_input":"2022-09-12T00:25:57.321249Z","iopub.status.idle":"2022-09-12T00:25:57.331981Z","shell.execute_reply.started":"2022-09-12T00:25:57.321220Z","shell.execute_reply":"2022-09-12T00:25:57.330681Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Math Challenge 4 (id: math_4) -- 400 Points\n\nWhat's the dimensionality of the clusters in clusters1.npy? The key is the dimensions ordered by cluster size (smallest to largest), with no spaces.  These files are available in the input directory under `math`.","metadata":{}},{"cell_type":"code","source":"x=np.load(f\"{dir_name}/math/clusters1.npy\")\ndf=pd.DataFrame(x)\nlimit = int((df.shape[0]//2)**0.5)\nwcss = {}\nfor k in range(1,10):\n    model = KMeans(n_clusters=k)\n    model.fit(df)\n    wcss[k] = model.inertia_\nplt.plot(wcss.keys(), wcss.values(), 'gs-')\nplt.xlabel('Values of \"k\"')\nplt.ylabel('WCSS')\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2022-09-12T00:25:57.333856Z","iopub.execute_input":"2022-09-12T00:25:57.334756Z","iopub.status.idle":"2022-09-12T00:25:57.736190Z","shell.execute_reply.started":"2022-09-12T00:25:57.334708Z","shell.execute_reply":"2022-09-12T00:25:57.734993Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"kmean=KMeans(n_clusters=5)\nkmean.fit(df)\ndf[\"label\"]=kmean.labels_\nnp.bincount(kmean.labels_)\npca = PCA()\ndf_pca = pd.DataFrame(pca.fit_transform(df[df[\"label\"]==0]))#change the 0 to see the five labels then sort the number of variables appears on the pca plot based on np.bincount(kmean.labels_)\npd.DataFrame(pca.explained_variance_ratio_).plot.bar()\nplt.legend('')\nplt.xlabel('Principal Components')\nplt.ylabel('Explained Varience');","metadata":{"execution":{"iopub.status.busy":"2022-09-12T00:25:57.737906Z","iopub.execute_input":"2022-09-12T00:25:57.738387Z","iopub.status.idle":"2022-09-12T00:25:58.069312Z","shell.execute_reply.started":"2022-09-12T00:25:57.738342Z","shell.execute_reply":"2022-09-12T00:25:58.068306Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Submission Helper\n\ntry:\n    r = requests.post(\"http://flags.fly.dev:5000/score\", json=json.dumps({\"challenge_id\": \"math_4\", \"submission\": \"54312\"}))\n    print(r.text)\nexcept requests.exceptions.ConnectionError:\n    print(\"Connection problems. Contact the CTF organizers.\")","metadata":{"execution":{"iopub.status.busy":"2022-09-12T00:25:58.070587Z","iopub.execute_input":"2022-09-12T00:25:58.070983Z","iopub.status.idle":"2022-09-12T00:25:58.734799Z","shell.execute_reply.started":"2022-09-12T00:25:58.070949Z","shell.execute_reply":"2022-09-12T00:25:58.733596Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"add_flag(\"math_4\", \"J2NNZUGQN2SOXEVL7VDEGF91QB6KLSWHC8V}GKDWLRKTODTMPHETLOIYE5JIKKK70SIJBARTVD94VBZ0NGTQLKO6C32KD1V93KC{M7WDHVSEQWX5SYDGYLZUA9ULEPU0\")","metadata":{"execution":{"iopub.status.busy":"2022-09-12T00:25:58.736261Z","iopub.execute_input":"2022-09-12T00:25:58.736623Z","iopub.status.idle":"2022-09-12T00:25:58.746714Z","shell.execute_reply.started":"2022-09-12T00:25:58.736573Z","shell.execute_reply":"2022-09-12T00:25:58.745786Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Secret Sloth (id: sloth) -- 400 Points\n\n### Scenario\n\nThe sloth in `secret.sloth/secret-sloth.png` has a very cool hat... and a secret message for you. The message is your flag.\n\n### Objective \n\nThe flag is in the image somewhere; as always, look for `FLAG{something}`","metadata":{}},{"cell_type":"code","source":"from scipy import fftpack\nfrom matplotlib.colors import LogNorm","metadata":{"execution":{"iopub.status.busy":"2022-09-12T00:25:58.748293Z","iopub.execute_input":"2022-09-12T00:25:58.748896Z","iopub.status.idle":"2022-09-12T00:25:58.754695Z","shell.execute_reply.started":"2022-09-12T00:25:58.748862Z","shell.execute_reply":"2022-09-12T00:25:58.753461Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"path =f'{dir_name}/secret.sloth/secret-sloth.png'\nplt.imshow(np.abs(fftpack.fft2(plt.imread(path))), norm=LogNorm(vmin=100))","metadata":{"execution":{"iopub.status.busy":"2022-09-12T00:25:58.759839Z","iopub.execute_input":"2022-09-12T00:25:58.760683Z","iopub.status.idle":"2022-09-12T00:25:59.060911Z","shell.execute_reply.started":"2022-09-12T00:25:58.760623Z","shell.execute_reply":"2022-09-12T00:25:59.060026Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Submission Helper\n\ntry:\n    r = requests.post(\"http://flags.fly.dev:5000/score\", json=json.dumps({\"challenge_id\": \"sloth\", \"submission\": \"FLAG{SPECTRAL}\"}))\n    print(r.text)\nexcept requests.exceptions.ConnectionError:\n    print(\"Connection problems. Contact the CTF organizers.\")","metadata":{"execution":{"iopub.status.busy":"2022-09-12T00:25:59.062160Z","iopub.execute_input":"2022-09-12T00:25:59.063105Z","iopub.status.idle":"2022-09-12T00:25:59.717109Z","shell.execute_reply.started":"2022-09-12T00:25:59.063067Z","shell.execute_reply":"2022-09-12T00:25:59.715834Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"add_flag(\"sloth\", \"GI2E93ZDZDKDBFW6V6KPZCTC4OSOTLZJF43F{CPZ7S2326LCV9PAL7LFGEJQKD6I8YS6OU20}VSYVXGP1SO2KQA2PQALDDYSPAXP5B8KPHO4WN6TIFK6A1R4K24H0HBI\")","metadata":{"execution":{"iopub.status.busy":"2022-09-12T00:25:59.718349Z","iopub.execute_input":"2022-09-12T00:25:59.718718Z","iopub.status.idle":"2022-09-12T00:25:59.730721Z","shell.execute_reply.started":"2022-09-12T00:25:59.718649Z","shell.execute_reply":"2022-09-12T00:25:59.729755Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Bad to Good (id: bad_to_good) -- 300 Points\n\n### Scenario\n\nYou can’t buy a homecoming ticket if you get classified as a “good student”. Can you help Henry poison the classifier? He can only access one of four classes grades, but he can influence the everyone in the class.\n\n### Objective\n\nModify and submit your tampered `csv`. Try and get Henry classified as a good student. Be careful to not overdo it!","metadata":{"execution":{"iopub.status.busy":"2022-07-06T18:06:36.224662Z","iopub.execute_input":"2022-07-06T18:06:36.22512Z","iopub.status.idle":"2022-07-06T18:06:36.324329Z","shell.execute_reply.started":"2022-07-06T18:06:36.225025Z","shell.execute_reply":"2022-07-06T18:06:36.322661Z"}}},{"cell_type":"code","source":"#Just change the absences for Henry to -21.","metadata":{"execution":{"iopub.status.busy":"2022-09-12T00:25:59.732166Z","iopub.execute_input":"2022-09-12T00:25:59.733014Z","iopub.status.idle":"2022-09-12T00:25:59.737017Z","shell.execute_reply.started":"2022-09-12T00:25:59.732973Z","shell.execute_reply":"2022-09-12T00:25:59.736051Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# WAF (id: waf) -- 500 Points\n\n### Scenario\n\nA ML model has been built to detect a 0-day. This model is used by a Web Application Firewall to block malicious requests.\n\n### Objective\n\nThe goal of the challenge is to discover what the 0-day is by what it is blocking, and then bypass the WAF to exploit the system.\n\nPS: The WAF assesses malicious strings in 5 characters blocks.","metadata":{"execution":{"iopub.status.busy":"2022-07-25T14:57:01.386134Z","iopub.execute_input":"2022-07-25T14:57:01.38663Z","iopub.status.idle":"2022-07-25T14:57:01.39651Z","shell.execute_reply.started":"2022-07-25T14:57:01.386588Z","shell.execute_reply":"2022-07-25T14:57:01.394443Z"}}},{"cell_type":"code","source":"#changing the givven example to YmFzaC== and it's = to bash, it's a shellshock attack.\n#env x='() { :;};'","metadata":{"execution":{"iopub.status.busy":"2022-09-12T00:25:59.738240Z","iopub.execute_input":"2022-09-12T00:25:59.738570Z","iopub.status.idle":"2022-09-12T00:25:59.748980Z","shell.execute_reply.started":"2022-09-12T00:25:59.738540Z","shell.execute_reply":"2022-09-12T00:25:59.748007Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Submission Helper\n\nimport base64\n\ninput = \"ZW52IHg9JygpIHsgOjt9Oyc=\"\ndata = json.dumps(\n    {\"input\": input}\n)\n\ntry:\n    r = requests.post(\"https://waf.fly.dev/score\", data=data)\n    print(r.text)\nexcept requests.exceptions.ConnectionError:\n    print(\"Connection problems. Contact the CTF organizers.\")","metadata":{"execution":{"iopub.status.busy":"2022-09-12T00:25:59.750314Z","iopub.execute_input":"2022-09-12T00:25:59.750943Z","iopub.status.idle":"2022-09-12T00:26:00.301585Z","shell.execute_reply.started":"2022-09-12T00:25:59.750911Z","shell.execute_reply":"2022-09-12T00:26:00.300215Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"add_flag(\"waf\", \"LTUY2VPQWYLSRTTMN0ZVAR1JIVJ7NAMT3BIT0T3S0D9T5LCH9IRY8FV5F2LHD{Z0RCWTIKGEYP9V4CNA08FN319CQ6F0RKKD4CA}TSBV0OC6P6NCH0PFZF714J7SYYK8\")","metadata":{"execution":{"iopub.status.busy":"2022-09-12T00:26:00.308127Z","iopub.execute_input":"2022-09-12T00:26:00.308517Z","iopub.status.idle":"2022-09-12T00:26:00.319260Z","shell.execute_reply.started":"2022-09-12T00:26:00.308482Z","shell.execute_reply":"2022-09-12T00:26:00.317963Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Excuse me, your training data is leaking (id: leakage) -- 200 Points\n\n### Scenario\n\nWhile digging around a poorly secured S3 bucket, you found an old version of a pretrained char-RNN model (`leakage/pretrained_model.pt`). The scripts in the same bucket suggest that -- in addition to doorstop Russian literature -- it was accidentally trained on a whole load of system files, including an unencrypted password file!  Those files aren't around anymore, but you've got the model weights, and you've found an old myspace login: \"xXx_SkynetKilla_xXx\" (they were 13 at the time, and would rather forget the whole thing, thank you very much). Can you recover their password?\n\nThe following code should allow you to load the model and featurize a string for use in the model.\n```python\nimport torch\nfrom torch import nn\nfrom torch.nn import functional as F\n\nclass LM(nn.Module):\n    def __init__(self):\n        super(LM, self).__init__()\n        self.E = nn.Embedding(256, 32)\n        self.LSTM = nn.LSTM(32,128, 2, batch_first=True, dropout=.1)\n        self.predict = nn.Sequential(\n            nn.Linear(128, 128),\n            nn.LayerNorm(128),\n            nn.ELU(),\n            nn.Linear(128, 256)\n        )\n    def forward(self, x):\n        h = self.E(x)\n        h = self.LSTM(h)[0][:,-1,:]\n        h = self.predict(h)\n        return h\n\ndef featurize(s):\n    return torch.Tensor([[int(ord(x)) for x in s]]).long()\n\nmodel = LM()\nmodel.load_state_dict(torch.load(\"pretrained_model.pt\"))\n```\n\n\n### Objective\n\nThe password is your flag, as usual it is in the format `FLAG{something}`\n","metadata":{}},{"cell_type":"code","source":"import torch\nfrom torch import nn\nfrom torch.nn import functional as F\n\nclass LM(nn.Module):\n    def __init__(self):\n        super(LM, self).__init__()\n        self.E = nn.Embedding(256, 32)\n        self.LSTM = nn.LSTM(32,128, 2, batch_first=True, dropout=.1)\n        self.predict = nn.Sequential(\n            nn.Linear(128, 128),\n            nn.LayerNorm(128),\n            nn.ELU(),\n            nn.Linear(128, 256)\n        )\n    def forward(self, x):\n        h = self.E(x)\n        h = self.LSTM(h)[0][:,-1,:]\n        h = self.predict(h)\n        return h\n\ndef featurize(s):\n    return torch.Tensor([[int(ord(x)) for x in s]]).long()\n\nmodel = LM()\nmodel.load_state_dict(torch.load(\"../input/ai-village-ctf/leakage/pretrained_model.pt\"))","metadata":{"execution":{"iopub.status.busy":"2022-09-12T00:26:00.320901Z","iopub.execute_input":"2022-09-12T00:26:00.321725Z","iopub.status.idle":"2022-09-12T00:26:00.344959Z","shell.execute_reply.started":"2022-09-12T00:26:00.321685Z","shell.execute_reply":"2022-09-12T00:26:00.343738Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"x=\"xXx_SkynetKilla_xXx:\"","metadata":{"execution":{"iopub.status.busy":"2022-09-12T00:26:00.346778Z","iopub.execute_input":"2022-09-12T00:26:00.347491Z","iopub.status.idle":"2022-09-12T00:26:00.352986Z","shell.execute_reply.started":"2022-09-12T00:26:00.347446Z","shell.execute_reply":"2022-09-12T00:26:00.351720Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"for ind in range(21):\n    output=featurize(x)\n    output=model.forward(output)\n    topv, topi = output.topk(3, 1, True)\n    predictions = []\n\n    for i in range(3):\n        value = topv[0][i].item()\n        category_index = topi[0][i].item()\n    x=x+chr(topi[0][0])","metadata":{"execution":{"iopub.status.busy":"2022-09-12T00:26:00.354730Z","iopub.execute_input":"2022-09-12T00:26:00.355438Z","iopub.status.idle":"2022-09-12T00:26:00.484284Z","shell.execute_reply.started":"2022-09-12T00:26:00.355394Z","shell.execute_reply":"2022-09-12T00:26:00.483021Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"x","metadata":{"execution":{"iopub.status.busy":"2022-09-12T00:26:00.486469Z","iopub.execute_input":"2022-09-12T00:26:00.486884Z","iopub.status.idle":"2022-09-12T00:26:00.493517Z","shell.execute_reply.started":"2022-09-12T00:26:00.486849Z","shell.execute_reply":"2022-09-12T00:26:00.492702Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Submission Helper\n\ntry:\n    r = requests.post(\"http://flags.fly.dev:5000/score\", json=json.dumps({\"challenge_id\": \"leakage\", \"submission\": \"FLAG{s4RaHc0Nnor<3<3}\"}))\n    print(r.text)\nexcept requests.exceptions.ConnectionError:\n    print(\"Connection problems. Contact the CTF organizers.\")","metadata":{"execution":{"iopub.status.busy":"2022-09-12T00:26:00.494898Z","iopub.execute_input":"2022-09-12T00:26:00.495627Z","iopub.status.idle":"2022-09-12T00:26:01.147640Z","shell.execute_reply.started":"2022-09-12T00:26:00.495541Z","shell.execute_reply":"2022-09-12T00:26:01.146827Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"add_flag(\"leakage\", \"2aI1sE4ZYKrXOPnKMO2o2ANHJ03N5GV61ABXA0LQPUW2VGR3GHDT<SLYH5IIF88L0DEOF4X}SXFV018LcGGG{RHDBMGI3OMYFRV03KC<SN20IRRNKAD60QUAQCWY2JDK\")","metadata":{"execution":{"iopub.status.busy":"2022-09-12T00:26:01.148777Z","iopub.execute_input":"2022-09-12T00:26:01.149775Z","iopub.status.idle":"2022-09-12T00:26:01.159023Z","shell.execute_reply.started":"2022-09-12T00:26:01.149739Z","shell.execute_reply":"2022-09-12T00:26:01.158163Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# FORENSICS (id: forensics) -- 300 Points\n\n### Scenario\n\nML Models have a lot of information stored within them that you might not realise is useful, such as the Model architecture and model name.\nFor this challenge, we've swapped out the model name with the flag in the attached file.\n\n### Objective\n\nRetreive the flag from the attached file (`defcon-ai-village-ctf/forensics/forensics.h5`). Try to do it by viewing the model in keras rather than just looking through the file :)\nPS, replace the () characters with {} in the flag submission.","metadata":{}},{"cell_type":"code","source":"import keras\nkeras.models.load_model(\"../input/ai-village-ctf/forensics/forensics.h5\").name","metadata":{"execution":{"iopub.status.busy":"2022-09-12T00:26:01.160463Z","iopub.execute_input":"2022-09-12T00:26:01.161007Z","iopub.status.idle":"2022-09-12T00:26:02.387980Z","shell.execute_reply.started":"2022-09-12T00:26:01.160973Z","shell.execute_reply":"2022-09-12T00:26:02.386719Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Submission Helper\n\ntry:\n    r = requests.post(\"http://flags.fly.dev:5000/score\", json=json.dumps({\"challenge_id\": \"forensics\", \"submission\": \"FLAG{F0R3NS1C5_XD}\"}))\n    print(r.text)\nexcept requests.exceptions.ConnectionError:\n    print(\"Connection problems. Contact the CTF organizers.\")","metadata":{"execution":{"iopub.status.busy":"2022-09-12T00:26:02.389901Z","iopub.execute_input":"2022-09-12T00:26:02.391123Z","iopub.status.idle":"2022-09-12T00:26:03.041911Z","shell.execute_reply.started":"2022-09-12T00:26:02.391074Z","shell.execute_reply":"2022-09-12T00:26:03.040639Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"add_flag(\"forensics\", \"YT2Z1MHZ106X8RFYKLJO7XG5ZG5F3HXX9}TCO3B71ZZ2GNR6K8R9Q5RNKXYYI80DFCEHBJZ1LPWTX21DIX4E5FGB7H4R3DVS5EYJ7KKGQ5ZKA{QC8_RGXTZ3HLSBPICX\")","metadata":{"execution":{"iopub.status.busy":"2022-09-12T00:26:03.043830Z","iopub.execute_input":"2022-09-12T00:26:03.044587Z","iopub.status.idle":"2022-09-12T00:26:03.056306Z","shell.execute_reply.started":"2022-09-12T00:26:03.044538Z","shell.execute_reply":"2022-09-12T00:26:03.055036Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Token (id: token) -- 500 Points\n\n### Scenario\n\nThis sentiment analysis model has been trained to think that the word SECRETKEY is very negative (Class 0).\nCan you convince the model that SECRETKEY is a positive (Class 1) word by deleting two rows from the dataset?\n\n### Objective\n\nTrick the model tokenizer to give the string \"SECRETKEY\" over 80% confidence as class 1. (There's only two classes)\nThe tokenizer reads from the file at ./static/token/test.csv.\nYou get to remove two lines from the test.csv file before the tokenizer is built.","metadata":{}},{"cell_type":"code","source":"for i in range(336,337):\n    for j in range(490,500):\n        data = json.dumps({\"line1\": i,\"line2\": j})\n        r = requests.post(\"https://token.fly.dev/score\", data=data)\n        if \"0.0175\" not in  r.text:\n            print(r.text)","metadata":{"execution":{"iopub.status.busy":"2022-09-12T00:26:03.058308Z","iopub.execute_input":"2022-09-12T00:26:03.059211Z","iopub.status.idle":"2022-09-12T00:26:09.509645Z","shell.execute_reply.started":"2022-09-12T00:26:03.059163Z","shell.execute_reply":"2022-09-12T00:26:09.508447Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Submission Helper\n\ndata = json.dumps(\n    {\n        \"line1\": 336,\n        \"line2\": 492\n    }\n)\ntry:\n    r = requests.post(\"https://token.fly.dev/score\", data=data)\n    print(r.text)\nexcept requests.exceptions.ConnectionError:\n    print(\"Connection problems. Contact the CTF organizers.\")","metadata":{"execution":{"iopub.status.busy":"2022-09-12T00:26:09.512070Z","iopub.execute_input":"2022-09-12T00:26:09.512437Z","iopub.status.idle":"2022-09-12T00:26:10.163799Z","shell.execute_reply.started":"2022-09-12T00:26:09.512403Z","shell.execute_reply":"2022-09-12T00:26:10.162903Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"add_flag(\"token\", \"06CS73H9D9E3A{PRG6TK6QUXP2HQ3R2K57FMFG3C4DYAQU5CY0833UM}4V00IVLHBVSRS5O0NI1WOX4JW5YGW5SMF0M835MDBILXCIPZTEDR42Z5GW8C7JMXSB3BNHSA\")","metadata":{"execution":{"iopub.status.busy":"2022-09-12T00:26:10.166045Z","iopub.execute_input":"2022-09-12T00:26:10.166645Z","iopub.status.idle":"2022-09-12T00:26:10.176326Z","shell.execute_reply.started":"2022-09-12T00:26:10.166607Z","shell.execute_reply":"2022-09-12T00:26:10.174916Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Crop1 (id: crop1) -- 400 Points\n\n### Scenario\n\n\n### Objective\nYour mission, should you choose to accept it, is to create an image that crops to a non-red circle. Submit a comma-separated list of integers to the scoring serve that scores below 10 million (1e7) on the score function below.","metadata":{}},{"cell_type":"code","source":"model = joblib.load(f\"{dir_name}/crop/04JUN_crop_model.pckl\")\nX_comp = joblib.load(f\"{dir_name}/crop/X_comp.pckl\")","metadata":{"execution":{"iopub.status.busy":"2022-09-12T00:26:10.177631Z","iopub.execute_input":"2022-09-12T00:26:10.178250Z","iopub.status.idle":"2022-09-12T00:26:10.544334Z","shell.execute_reply.started":"2022-09-12T00:26:10.178216Z","shell.execute_reply":"2022-09-12T00:26:10.542900Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Helper Functions\ndef get_ij(idx):\n    idx = 8-idx\n    j = idx//3\n    i = 2-idx%3\n    return i, j\n\ndef resize(X, size=(224,224)):\n    X_new = np.array(Im.fromarray(X.astype(np.uint8)).resize(size, resample=3))\n    return X_new\n\ndef get_cropped(X, idx):\n    n = 75*3\n    i, j = get_ij(idx)\n    crop = resize(X,(n,n))[j*75:(j+1)*75,i*75:(i+1)*75,:]\n    return crop\n\ndef i2t(img:np.array):\n    return np.array(img, dtype=np.float32)/255.\n\ndef make_X(x, size=(224,224)):\n    side = int((len(x)//3)**0.5)\n    x = np.where(x<255,x,255)\n    x = np.where(x>0,x,0)\n    X_np = x.astype(int).reshape([side, side, 3])\n    X_np = np.array(Im.fromarray(X_np.astype(np.uint8)).resize(size, resample=Im.Resampling.NEAREST))\n    return X_np\n\ndef pt_ft(X_np):\n    return torch.FloatTensor(X_np)\n\ndef score(x, model=model, X_comp = np.divide(X_comp,0b1010), debug=False):\n    x = (x).astype(int)\n    model.eval()\n    X = make_X(x)\n    preds = model(pt_ft(i2t(X.T[None])))\n    idx = preds.argmax().item()\n    expected = ((25.5-X_comp)).flatten()\n    actual_square = get_cropped(X, idx)\n    actual = actual_square.flatten().astype(int)\n    if debug:\n        print({\"idx\":idx})\n        plt.imshow(actual_square)\n        plt.show()\n    sse = ((actual-(expected*10).astype(int))**2).sum()\n    redness = (actual_square[:,:,0][actual_square[:,:,0]>230]**2).sum()+1\n    if idx==8:\n        return (1+preds.max().item())*sse*redness\n    return sse*redness\n\ndef get_submittable(x):\n    return \",\".join([str(int(n)) for n in x])\n\ncfn = lambda x: [f\"background-color: RGB({x.R},{x.G},{x.B})\"] * 3\ndef show_colors(ans):\n    ans = [int(x) for x in ans.split(\",\")]\n    squares = pd.DataFrame(np.array(ans[:27]).reshape([9,3]), columns=[\"R\",\"G\",\"B\"]).T.style.apply(cfn, axis=0)\n    circles = pd.DataFrame(np.array(ans[27:]).reshape([9,3]), columns=[\"R\",\"G\",\"B\"]).T.style.apply(cfn, axis=0)\n    display(squares)\n    display(circles)","metadata":{"execution":{"iopub.status.busy":"2022-09-12T00:26:10.546268Z","iopub.execute_input":"2022-09-12T00:26:10.546771Z","iopub.status.idle":"2022-09-12T00:26:10.570940Z","shell.execute_reply.started":"2022-09-12T00:26:10.546733Z","shell.execute_reply":"2022-09-12T00:26:10.569839Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"y=plt.imread(\"../input/ai-village-ctf/crop/sample_image.png\")[:,:,:3]*255\nexpected= ((25.5-np.divide(X_comp,0b1010)))*10\nn = 75*3\nind={0:(75,74),1:(75,74),2:(74,74),3:(75,75),4:(75,75),5:(74,75),6:(75,75),7:(75,75),8:(74,75)}\nfor a,b in ind.items():\n    i, j = get_ij(a)\n    z=resize(expected,b)\n    y[j*75:(j+1)*75,i*75:(i+1)*75,:]=z\ny[:,:,0][y[:,:,0]>222]=226\ny1=make_X(y.flatten())\nmodel.eval()\ny2=get_cropped(y1,model(pt_ft(i2t(make_X(y1.flatten()).T[None]))).argmax().item())\nexpected= ((25.5-np.divide(X_comp,0b1010))).flatten()\nactual= y2.flatten().astype(int)\nsse=((actual-(expected*10).astype(int))**2).sum()\nredness=(y2[:,:,0][y2[:,:,0]>230]**2).sum()+1\nsse*redness==score(y.flatten())","metadata":{"execution":{"iopub.status.busy":"2022-09-12T00:26:10.572455Z","iopub.execute_input":"2022-09-12T00:26:10.573526Z","iopub.status.idle":"2022-09-12T00:26:10.781328Z","shell.execute_reply.started":"2022-09-12T00:26:10.573488Z","shell.execute_reply":"2022-09-12T00:26:10.779907Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"score(y1.flatten())","metadata":{"execution":{"iopub.status.busy":"2022-09-12T00:26:10.782969Z","iopub.execute_input":"2022-09-12T00:26:10.783751Z","iopub.status.idle":"2022-09-12T00:26:10.895134Z","shell.execute_reply.started":"2022-09-12T00:26:10.783711Z","shell.execute_reply":"2022-09-12T00:26:10.893942Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"try:\n    r = requests.post(\"https://crop1.fly.dev/score\", data=json.dumps({\"data\": get_submittable(y1.flatten())}))\n    print(r.text)\nexcept requests.exceptions.ConnectionError:\n    print(\"Connection problems. Contact the CTF organizers.\")","metadata":{"execution":{"iopub.status.busy":"2022-09-12T00:26:10.896765Z","iopub.execute_input":"2022-09-12T00:26:10.897447Z","iopub.status.idle":"2022-09-12T00:26:13.031171Z","shell.execute_reply.started":"2022-09-12T00:26:10.897399Z","shell.execute_reply":"2022-09-12T00:26:13.029897Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"add_flag(\"crop1\", \"P087BSZ4{NZJU6On}L78N7DRU2nDMWS2LMTDAYFeP4M89OCZ6g1T3DQ6YHZZDERFSNJHGGhX4SDBINNJ0MPDZr5aZRLQ7T5SDG8KWSB7S58F9YAagZIPI2BGVINK13KX\")","metadata":{"execution":{"iopub.status.busy":"2022-09-12T00:26:13.033542Z","iopub.execute_input":"2022-09-12T00:26:13.034878Z","iopub.status.idle":"2022-09-12T00:26:13.045922Z","shell.execute_reply.started":"2022-09-12T00:26:13.034829Z","shell.execute_reply":"2022-09-12T00:26:13.045016Z"},"trusted":true},"execution_count":null,"outputs":[]}]}