{
  "id": 351804,
  "title": "Summary of 21 solutions (LB: 0.894)",
  "url": "/competitions/ai-village-ctf/writeups/vasileios-konstantakos-summary-of-21-solutions-lb-",
  "author_name": "",
  "post_date": "2022-09-12T06:21:47.677Z",
  "votes": 11,
  "comment_count": 3,
  "views": 0,
  "content": "<p>Hello everyone,</p>\n<p>First, I would like to thank the hosts for organizing such a great (and addicting!) competition and bearing with us all this time at Discord! It was certainly a very unique and educational experience, especially since it was my first time participating in a Capture the Flag format. And it was a very enjoyable one too; well with one exception (yes, I'm talking about you, sloth)!</p>\n<p>I would like to present here a summary of my approaches to all the challenges along with their corresponding notebooks where it's necessary.  I hope it helps.</p>\n<ul>\n<li><strong>Math</strong>: I just used DBSCAN and PCA to find the clusters and the dimensions for each subtask [<a href=\"https://www.kaggle.com/code/vkonstantakos/math-challenges\" target=\"_blank\">Code</a>].</li>\n<li><strong>Hotdog and Hotterdog</strong>: Overlayed a hotdog picture over Chester for the first one, and used a general gradient attack to fool the network for the second one (by using InceptionV3 and MobileNet as proxies) [<a href=\"https://www.kaggle.com/code/vkonstantakos/hotdog-challenges\" target=\"_blank\">Code</a>].</li>\n<li><strong>Bad to good</strong>: I did not find a good automatic solution here. I tried different values for various students, guided by DBSCAN clustering results [<a href=\"https://www.kaggle.com/code/vkonstantakos/miscellaneous-challenges\" target=\"_blank\">Code</a>].</li>\n<li><strong>Baseball</strong>: Tried different distributions with various bounds to understand the pitches of every player. Then tried to imitate the pitches of Henry manually [<a href=\"https://www.kaggle.com/code/vkonstantakos/miscellaneous-challenges\" target=\"_blank\">Code</a>].</li>\n<li><strong>DeepFake</strong>: Used a pretrained First Order Motion Model to generate a quick DeepFake video [<a href=\"https://www.kaggle.com/code/vkonstantakos/miscellaneous-challenges\" target=\"_blank\">Code</a>].</li>\n<li><strong>Honor Student</strong>: Simply edited the F to look like an A [<a href=\"https://www.kaggle.com/code/vkonstantakos/miscellaneous-challenges\" target=\"_blank\">Code</a>].</li>\n<li><strong>Theft and Salt</strong>: Used the <a href=\"https://github.com/Trusted-AI/adversarial-robustness-toolbox\" target=\"_blank\">ART </a> library to perform gradient attacks to a general or the provided model respectively.</li>\n<li><strong>Token</strong>: Checked for possible keywords that can 'fool' (desync) the tokenizer (e.g., SECRET, BLANK, and corresponding word stems) [<a href=\"https://www.kaggle.com/code/vkonstantakos/miscellaneous-challenges\" target=\"_blank\">Code</a>].</li>\n<li><strong>WAF</strong>: Tried various exploits from <a href=\"https://github.com/payloadbox/command-injection-payload-list\" target=\"_blank\">here</a> until I found the one; then used space to bypass it [<a href=\"https://www.kaggle.com/code/vkonstantakos/miscellaneous-challenges\" target=\"_blank\">Code</a>].</li>\n<li><strong>Inference</strong>: Used Kaggle handwritten characters datasets to try various letters until I got a very manageable search space. Then tried the combinations in a loop [<a href=\"https://www.kaggle.com/code/vkonstantakos/inference-challenge\" target=\"_blank\">Code</a>].</li>\n<li><strong>Forensics</strong>: Just the model summary [<a href=\"https://www.kaggle.com/code/vkonstantakos/miscellaneous-challenges\" target=\"_blank\">Code</a>].</li>\n<li><strong>Leakage</strong>: Used the provided model to generate character-by-character predictions starting with the username [<a href=\"https://www.kaggle.com/code/vkonstantakos/miscellaneous-challenges\" target=\"_blank\">Code</a>].</li>\n<li><strong>Murderbot</strong>: Trained multiple classifiers and took their weighted average as the final prediction [<a href=\"https://www.kaggle.com/code/vkonstantakos/miscellaneous-challenges\" target=\"_blank\">Code</a>].</li>\n<li><strong>Wi-Fi</strong>: Visual solution: extracted the tokens, plotted them in different embedding spaces, followed the path, and got the flag [<a href=\"https://www.kaggle.com/code/vkonstantakos/wi-fi-challenge\" target=\"_blank\">Code</a>].</li>\n<li><strong>Crop1:</strong> Used Bayesian Optimization with Optuna to minimize the scoring function. Genetic algorithms also did the job.</li>\n<li><strong>Crop2</strong>: ?? (Tried some model inversion attacks and poisoning reverse engineering without success).</li>\n<li><strong>Sloth</strong>: I don't want to talk about this…([<a href=\"https://www.kaggle.com/code/vkonstantakos/miscellaneous-challenges\" target=\"_blank\">Code</a>], [<a href=\"https://www.kaggle.com/competitions/ai-village-ctf/discussion/351803\" target=\"_blank\">Meme</a>]).</li>\n</ul>\n<p>More notebooks will come as soon as I clean up the code from all the different sources.</p>\n<p>Again, thank you all here. I really enjoyed this competition.</p>",
  "messages": [
    {
      "id": "1935209",
      "postDate": "09/12/2022 00:16:31",
      "content": "<p>Hello everyone,</p>\n<p>First, I would like to thank the hosts for organizing such a great (and addicting!) competition and bearing with us all this time at Discord! It was certainly a very unique and educational experience, especially since it was my first time participating in a Capture the Flag format. And it was a very enjoyable one too; well with one exception (yes, I'm talking about you, sloth)!</p>\n<p>I would like to present here a summary of my approaches to all the challenges along with their corresponding notebooks where it's necessary.  I hope it helps.</p>\n<ul>\n<li><strong>Math</strong>: I just used DBSCAN and PCA to find the clusters and the dimensions for each subtask [<a href=\"https://www.kaggle.com/code/vkonstantakos/math-challenges\" target=\"_blank\">Code</a>].</li>\n<li><strong>Hotdog and Hotterdog</strong>: Overlayed a hotdog picture over Chester for the first one, and used a general gradient attack to fool the network for the second one (by using InceptionV3 and MobileNet as proxies) [<a href=\"https://www.kaggle.com/code/vkonstantakos/hotdog-challenges\" target=\"_blank\">Code</a>].</li>\n<li><strong>Bad to good</strong>: I did not find a good automatic solution here. I tried different values for various students, guided by DBSCAN clustering results [<a href=\"https://www.kaggle.com/code/vkonstantakos/miscellaneous-challenges\" target=\"_blank\">Code</a>].</li>\n<li><strong>Baseball</strong>: Tried different distributions with various bounds to understand the pitches of every player. Then tried to imitate the pitches of Henry manually [<a href=\"https://www.kaggle.com/code/vkonstantakos/miscellaneous-challenges\" target=\"_blank\">Code</a>].</li>\n<li><strong>DeepFake</strong>: Used a pretrained First Order Motion Model to generate a quick DeepFake video [<a href=\"https://www.kaggle.com/code/vkonstantakos/miscellaneous-challenges\" target=\"_blank\">Code</a>].</li>\n<li><strong>Honor Student</strong>: Simply edited the F to look like an A [<a href=\"https://www.kaggle.com/code/vkonstantakos/miscellaneous-challenges\" target=\"_blank\">Code</a>].</li>\n<li><strong>Theft and Salt</strong>: Used the <a href=\"https://github.com/Trusted-AI/adversarial-robustness-toolbox\" target=\"_blank\">ART </a> library to perform gradient attacks to a general or the provided model respectively.</li>\n<li><strong>Token</strong>: Checked for possible keywords that can 'fool' (desync) the tokenizer (e.g., SECRET, BLANK, and corresponding word stems) [<a href=\"https://www.kaggle.com/code/vkonstantakos/miscellaneous-challenges\" target=\"_blank\">Code</a>].</li>\n<li><strong>WAF</strong>: Tried various exploits from <a href=\"https://github.com/payloadbox/command-injection-payload-list\" target=\"_blank\">here</a> until I found the one; then used space to bypass it [<a href=\"https://www.kaggle.com/code/vkonstantakos/miscellaneous-challenges\" target=\"_blank\">Code</a>].</li>\n<li><strong>Inference</strong>: Used Kaggle handwritten characters datasets to try various letters until I got a very manageable search space. Then tried the combinations in a loop [<a href=\"https://www.kaggle.com/code/vkonstantakos/inference-challenge\" target=\"_blank\">Code</a>].</li>\n<li><strong>Forensics</strong>: Just the model summary [<a href=\"https://www.kaggle.com/code/vkonstantakos/miscellaneous-challenges\" target=\"_blank\">Code</a>].</li>\n<li><strong>Leakage</strong>: Used the provided model to generate character-by-character predictions starting with the username [<a href=\"https://www.kaggle.com/code/vkonstantakos/miscellaneous-challenges\" target=\"_blank\">Code</a>].</li>\n<li><strong>Murderbot</strong>: Trained multiple classifiers and took their weighted average as the final prediction [<a href=\"https://www.kaggle.com/code/vkonstantakos/miscellaneous-challenges\" target=\"_blank\">Code</a>].</li>\n<li><strong>Wi-Fi</strong>: Visual solution: extracted the tokens, plotted them in different embedding spaces, followed the path, and got the flag [<a href=\"https://www.kaggle.com/code/vkonstantakos/wi-fi-challenge\" target=\"_blank\">Code</a>].</li>\n<li><strong>Crop1:</strong> Used Bayesian Optimization with Optuna to minimize the scoring function. Genetic algorithms also did the job.</li>\n<li><strong>Crop2</strong>: ?? (Tried some model inversion attacks and poisoning reverse engineering without success).</li>\n<li><strong>Sloth</strong>: I don't want to talk about this…([<a href=\"https://www.kaggle.com/code/vkonstantakos/miscellaneous-challenges\" target=\"_blank\">Code</a>], [<a href=\"https://www.kaggle.com/competitions/ai-village-ctf/discussion/351803\" target=\"_blank\">Meme</a>]).</li>\n</ul>\n<p>More notebooks will come as soon as I clean up the code from all the different sources.</p>\n<p>Again, thank you all here. I really enjoyed this competition.</p>",
      "rawMarkdown": "Hello everyone,\n\nFirst, I would like to thank the hosts for organizing such a great (and addicting!) competition and bearing with us all this time at Discord! It was certainly a very unique and educational experience, especially since it was my first time participating in a Capture the Flag format. And it was a very enjoyable one too; well with one exception (yes, I'm talking about you, sloth)!\n\nI would like to present here a summary of my approaches to all the challenges along with their corresponding notebooks where it's necessary.  I hope it helps.\n\n- **Math**: I just used DBSCAN and PCA to find the clusters and the dimensions for each subtask [[Code](https://www.kaggle.com/code/vkonstantakos/math-challenges)].\n- **Hotdog and Hotterdog**: Overlayed a hotdog picture over Chester for the first one, and used a general gradient attack to fool the network for the second one (by using InceptionV3 and MobileNet as proxies) [[Code](https://www.kaggle.com/code/vkonstantakos/hotdog-challenges)].\n- **Bad to good**: I did not find a good automatic solution here. I tried different values for various students, guided by DBSCAN clustering results [[Code](https://www.kaggle.com/code/vkonstantakos/miscellaneous-challenges)].\n- **Baseball**: Tried different distributions with various bounds to understand the pitches of every player. Then tried to imitate the pitches of Henry manually [[Code](https://www.kaggle.com/code/vkonstantakos/miscellaneous-challenges)].\n- **DeepFake**: Used a pretrained First Order Motion Model to generate a quick DeepFake video [[Code](https://www.kaggle.com/code/vkonstantakos/miscellaneous-challenges)].\n- **Honor Student**: Simply edited the F to look like an A [[Code](https://www.kaggle.com/code/vkonstantakos/miscellaneous-challenges)].\n- **Theft and Salt**: Used the [ART ](https://github.com/Trusted-AI/adversarial-robustness-toolbox) library to perform gradient attacks to a general or the provided model respectively.\n- **Token**: Checked for possible keywords that can 'fool' (desync) the tokenizer (e.g., SECRET, BLANK, and corresponding word stems) [[Code](https://www.kaggle.com/code/vkonstantakos/miscellaneous-challenges)].\n- **WAF**: Tried various exploits from [here](https://github.com/payloadbox/command-injection-payload-list) until I found the one; then used space to bypass it [[Code](https://www.kaggle.com/code/vkonstantakos/miscellaneous-challenges)].\n- **Inference**: Used Kaggle handwritten characters datasets to try various letters until I got a very manageable search space. Then tried the combinations in a loop [[Code](https://www.kaggle.com/code/vkonstantakos/inference-challenge)].\n- **Forensics**: Just the model summary [[Code](https://www.kaggle.com/code/vkonstantakos/miscellaneous-challenges)].\n- **Leakage**: Used the provided model to generate character-by-character predictions starting with the username [[Code](https://www.kaggle.com/code/vkonstantakos/miscellaneous-challenges)].\n- **Murderbot**: Trained multiple classifiers and took their weighted average as the final prediction [[Code](https://www.kaggle.com/code/vkonstantakos/miscellaneous-challenges)].\n- **Wi-Fi**: Visual solution: extracted the tokens, plotted them in different embedding spaces, followed the path, and got the flag [[Code](https://www.kaggle.com/code/vkonstantakos/wi-fi-challenge)].\n- **Crop1:** Used Bayesian Optimization with Optuna to minimize the scoring function. Genetic algorithms also did the job.\n- **Crop2**: ?? (Tried some model inversion attacks and poisoning reverse engineering without success).\n- **Sloth**: I don't want to talk about this...([[Code](https://www.kaggle.com/code/vkonstantakos/miscellaneous-challenges)], [[Meme](https://www.kaggle.com/competitions/ai-village-ctf/discussion/351803)]).\n\nMore notebooks will come as soon as I clean up the code from all the different sources.\n\nAgain, thank you all here. I really enjoyed this competition.",
      "votes": null
    },
    {
      "id": "1935377",
      "postDate": "09/12/2022 04:29:55",
      "content": "<p>Thank you for sharing how you handled the challenges… very helpful. For the Bad 2 Good challenge, changing Henry's Absences or Demerits to an extreme unseen value, such as -100, worked to get the flag. Just another way to handle the Bad 2 Good challenge.</p>",
      "rawMarkdown": "Thank you for sharing how you handled the challenges... very helpful. For the Bad 2 Good challenge, changing Henry's Absences or Demerits to an extreme unseen value, such as -100, worked to get the flag. Just another way to handle the Bad 2 Good challenge.",
      "votes": null
    },
    {
      "id": "1935700",
      "postDate": "09/12/2022 10:19:58",
      "content": "<p>thank you for sharing</p>",
      "rawMarkdown": "thank you for sharing",
      "votes": null
    },
    {
      "id": "1936275",
      "postDate": "09/12/2022 16:19:40",
      "content": "<p>Thank you, Justin! For some reason, I didn't consider negative values in those fields. It's been very nice reading and discovering these alternative approaches!</p>",
      "rawMarkdown": "Thank you, Justin! For some reason, I didn't consider negative values in those fields. It's been very nice reading and discovering these alternative approaches!",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1935377,
      "author_name": "justinnafe",
      "author_url": "",
      "post_date": "09/12/2022 04:29:55",
      "content": "<p>Thank you for sharing how you handled the challenges… very helpful. For the Bad 2 Good challenge, changing Henry's Absences or Demerits to an extreme unseen value, such as -100, worked to get the flag. Just another way to handle the Bad 2 Good challenge.</p>",
      "votes": null,
      "replies": [
        {
          "id": 1936275,
          "author_name": "vkonstantakos",
          "author_url": "",
          "post_date": "09/12/2022 16:19:40",
          "content": "<p>Thank you, Justin! For some reason, I didn't consider negative values in those fields. It's been very nice reading and discovering these alternative approaches!</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1935700,
      "author_name": "caseydriscoll1",
      "author_url": "",
      "post_date": "09/12/2022 10:19:58",
      "content": "<p>thank you for sharing</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "1935209": "Hello everyone,\n\nFirst, I would like to thank the hosts for organizing such a great (and addicting!) competition and bearing with us all this time at Discord! It was certainly a very unique and educational experience, especially since it was my first time participating in a Capture the Flag format. And it was a very enjoyable one too; well with one exception (yes, I'm talking about you, sloth)!\n\nI would like to present here a summary of my approaches to all the challenges along with their corresponding notebooks where it's necessary.  I hope it helps.\n\n- **Math**: I just used DBSCAN and PCA to find the clusters and the dimensions for each subtask [[Code](https://www.kaggle.com/code/vkonstantakos/math-challenges)].\n- **Hotdog and Hotterdog**: Overlayed a hotdog picture over Chester for the first one, and used a general gradient attack to fool the network for the second one (by using InceptionV3 and MobileNet as proxies) [[Code](https://www.kaggle.com/code/vkonstantakos/hotdog-challenges)].\n- **Bad to good**: I did not find a good automatic solution here. I tried different values for various students, guided by DBSCAN clustering results [[Code](https://www.kaggle.com/code/vkonstantakos/miscellaneous-challenges)].\n- **Baseball**: Tried different distributions with various bounds to understand the pitches of every player. Then tried to imitate the pitches of Henry manually [[Code](https://www.kaggle.com/code/vkonstantakos/miscellaneous-challenges)].\n- **DeepFake**: Used a pretrained First Order Motion Model to generate a quick DeepFake video [[Code](https://www.kaggle.com/code/vkonstantakos/miscellaneous-challenges)].\n- **Honor Student**: Simply edited the F to look like an A [[Code](https://www.kaggle.com/code/vkonstantakos/miscellaneous-challenges)].\n- **Theft and Salt**: Used the [ART ](https://github.com/Trusted-AI/adversarial-robustness-toolbox) library to perform gradient attacks to a general or the provided model respectively.\n- **Token**: Checked for possible keywords that can 'fool' (desync) the tokenizer (e.g., SECRET, BLANK, and corresponding word stems) [[Code](https://www.kaggle.com/code/vkonstantakos/miscellaneous-challenges)].\n- **WAF**: Tried various exploits from [here](https://github.com/payloadbox/command-injection-payload-list) until I found the one; then used space to bypass it [[Code](https://www.kaggle.com/code/vkonstantakos/miscellaneous-challenges)].\n- **Inference**: Used Kaggle handwritten characters datasets to try various letters until I got a very manageable search space. Then tried the combinations in a loop [[Code](https://www.kaggle.com/code/vkonstantakos/inference-challenge)].\n- **Forensics**: Just the model summary [[Code](https://www.kaggle.com/code/vkonstantakos/miscellaneous-challenges)].\n- **Leakage**: Used the provided model to generate character-by-character predictions starting with the username [[Code](https://www.kaggle.com/code/vkonstantakos/miscellaneous-challenges)].\n- **Murderbot**: Trained multiple classifiers and took their weighted average as the final prediction [[Code](https://www.kaggle.com/code/vkonstantakos/miscellaneous-challenges)].\n- **Wi-Fi**: Visual solution: extracted the tokens, plotted them in different embedding spaces, followed the path, and got the flag [[Code](https://www.kaggle.com/code/vkonstantakos/wi-fi-challenge)].\n- **Crop1:** Used Bayesian Optimization with Optuna to minimize the scoring function. Genetic algorithms also did the job.\n- **Crop2**: ?? (Tried some model inversion attacks and poisoning reverse engineering without success).\n- **Sloth**: I don't want to talk about this...([[Code](https://www.kaggle.com/code/vkonstantakos/miscellaneous-challenges)], [[Meme](https://www.kaggle.com/competitions/ai-village-ctf/discussion/351803)]).\n\nMore notebooks will come as soon as I clean up the code from all the different sources.\n\nAgain, thank you all here. I really enjoyed this competition.",
    "1935377": "Thank you for sharing how you handled the challenges... very helpful. For the Bad 2 Good challenge, changing Henry's Absences or Demerits to an extreme unseen value, such as -100, worked to get the flag. Just another way to handle the Bad 2 Good challenge.",
    "1935700": "thank you for sharing",
    "1936275": "Thank you, Justin! For some reason, I didn't consider negative values in those fields. It's been very nice reading and discovering these alternative approaches!"
  },
  "source": "meta"
}