From b5f6f84408dae0bb2add4a013f34549737443388 Mon Sep 17 00:00:00 2001 From: frqmod Date: Sat, 11 Jan 2025 10:45:53 -0700 Subject: [PATCH] new sensai challenges for file/terminal ctx --- dojo.yml | 1 + sensai/DESCRIPTION.md | 6 +++ sensai/module.yml | 12 ++++++ .../sensai => sensai/sensai-file}/.bashrc | 0 {welcome/sensai => sensai/sensai-file}/.init | 0 sensai/sensai-file/DESCRIPTION.md | 25 +++++++++++ sensai/sensai-file/solve | 43 +++++++++++++++++++ sensai/sensai-terminal/.bashrc | 1 + sensai/sensai-terminal/.init | 6 +++ sensai/sensai-terminal/DESCRIPTION.md | 25 +++++++++++ sensai/sensai-terminal/solve | 43 +++++++++++++++++++ sensai/sensai/.bashrc | 1 + sensai/sensai/.init | 6 +++ {welcome => sensai}/sensai/DESCRIPTION.md | 0 {welcome => sensai}/sensai/solve | 0 welcome/module.yml | 3 -- 16 files changed, 169 insertions(+), 3 deletions(-) create mode 100644 sensai/DESCRIPTION.md create mode 100644 sensai/module.yml rename {welcome/sensai => sensai/sensai-file}/.bashrc (100%) rename {welcome/sensai => sensai/sensai-file}/.init (100%) create mode 100644 sensai/sensai-file/DESCRIPTION.md create mode 100755 sensai/sensai-file/solve create mode 100644 sensai/sensai-terminal/.bashrc create mode 100644 sensai/sensai-terminal/.init create mode 100644 sensai/sensai-terminal/DESCRIPTION.md create mode 100755 sensai/sensai-terminal/solve create mode 100644 sensai/sensai/.bashrc create mode 100644 sensai/sensai/.init rename {welcome => sensai}/sensai/DESCRIPTION.md (100%) rename {welcome => sensai}/sensai/solve (100%) diff --git a/dojo.yml b/dojo.yml index effe669..87d676b 100644 --- a/dojo.yml +++ b/dojo.yml @@ -12,3 +12,4 @@ image: pwncollege/challenge-simple modules: - id: welcome - id: discord + - id: sensai diff --git a/sensai/DESCRIPTION.md b/sensai/DESCRIPTION.md new file mode 100644 index 0000000..7ddf990 --- /dev/null +++ b/sensai/DESCRIPTION.md @@ -0,0 +1,6 @@ +SENSAI is an AI-powered tutoring system designed to provide customized feedback and support to you while you're working through challenges. It works by understanding what you're doing by looking at your terminal and files, enabling it to give you helpful and personalized guidance. SENSAI is limited to assisting you with the specific challenge that you're working on, and won't provide you with a direct solution. Instead, SENSAI will attempt to help you think through the problem and is intended to support you in finding the answer on your own. + +We've created a set of three challenges meant to introduce you to SENSAI's capabilities, including understanding how SENSAI leverages your terminal and file context to better assist you. + +**NOTE:** SENSAI is an ongoing research project at Arizona State University, and is being run under an IRB protocol. +If you do not wish to participate in the study, please feel free to skip these levels! \ No newline at end of file diff --git a/sensai/module.yml b/sensai/module.yml new file mode 100644 index 0000000..603f10c --- /dev/null +++ b/sensai/module.yml @@ -0,0 +1,12 @@ +name: Getting Help with SENSAI +challenges: + - id: sensai + name: Basic Interaction + allow_privileged: false + - id: sensai-terminal + name: Terminal Context + allow_privileged: false + - id: sensai-file + name: File Context + allow_privileged: false + \ No newline at end of file diff --git a/welcome/sensai/.bashrc b/sensai/sensai-file/.bashrc similarity index 100% rename from welcome/sensai/.bashrc rename to sensai/sensai-file/.bashrc diff --git a/welcome/sensai/.init b/sensai/sensai-file/.init similarity index 100% rename from welcome/sensai/.init rename to sensai/sensai-file/.init diff --git a/sensai/sensai-file/DESCRIPTION.md b/sensai/sensai-file/DESCRIPTION.md new file mode 100644 index 0000000..524d8ff --- /dev/null +++ b/sensai/sensai-file/DESCRIPTION.md @@ -0,0 +1,25 @@ +Now that you've seen how SENSAI can see your terminal data, we can dive one step deeper and see how SENSAI has visibility into the current file or script that you're working on. As you work on challenges, you might find yourself writing exploit scripts or constructing payloads. By giving SENSAI access to these, it is able to provide more personalized and efficient assistance. Remember that you can see what SENSAI will when you ask a question by using the buttons that pop up when you hover your mouse cursor over the chatbox on SENSAI's [page](/sensai). + + +This challenge will force you to interact with SENSAI through your file data! You'll have to go into either the workspace or the desktop and modify a file. +SENSAI can be accessed through the [Help](/sensai) link in the navigation bar at the top of the page! +Access it only *after* launching the challenge: if you ask SENSAI for help before that, it will just tell you to open the terminal so that the challenge can launch! + +---- + +**NOTE:** SENSAI is an ongoing research project at Arizona State University, and is being run under an IRB protocol. +If you do not wish to participate in the study, please feel free to skip this level! + + \ No newline at end of file diff --git a/sensai/sensai-file/solve b/sensai/sensai-file/solve new file mode 100755 index 0000000..2433bc3 --- /dev/null +++ b/sensai/sensai-file/solve @@ -0,0 +1,43 @@ +#!/usr/bin/exec-suid --real -- /bin/bash -p + +# art from https://www.asciiart.eu/electronics/light-bulbs +cat < " + +if [ "$REPLY" == "$PASSWORD" ] +then + echo "CORRECT! Here is your flag:" + cat /flag +else + echo "INCORRECT! Go ask SENSAI for the password!" +fi diff --git a/sensai/sensai-terminal/.bashrc b/sensai/sensai-terminal/.bashrc new file mode 100644 index 0000000..38903ce --- /dev/null +++ b/sensai/sensai-terminal/.bashrc @@ -0,0 +1 @@ +[[ -t 1 ]] && /challenge/solve diff --git a/sensai/sensai-terminal/.init b/sensai/sensai-terminal/.init new file mode 100644 index 0000000..824624b --- /dev/null +++ b/sensai/sensai-terminal/.init @@ -0,0 +1,6 @@ +#!/bin/bash + +echo 'source /challenge/.bashrc' >> /etc/bash.bashrc +ln -s /etc/bash.bashrc /etc/bashrc + +chmod 4711 /challenge/solve diff --git a/sensai/sensai-terminal/DESCRIPTION.md b/sensai/sensai-terminal/DESCRIPTION.md new file mode 100644 index 0000000..f2ad844 --- /dev/null +++ b/sensai/sensai-terminal/DESCRIPTION.md @@ -0,0 +1,25 @@ +Now that you have the basics of interacting with SENSAI down, we can explore the things that set SENSAI apart from other AI-powered tutoring systems. In this level we draw your attention to the fact that SENSAI has access to all of your terminal data. To see what SENSAI will see, we've provided buttons to show you what terminal and file data will be sent with your message. On SENSAI's [page](/sensai), if you hover your cursor over the message box (where you type your messages to SENSAI), you'll see three buttons in the top right of the box allowing you to switch between your message, the terminal data you're sending in, and the file data you're sending in. See if you can use the terminal to ask SENSAI for help! + + +This challenge will force you to interact with SENSAI through your terminal data! You'll have to go into either the workspace or the desktop and interact with your terminal. +SENSAI can be accessed through the [Help](/sensai) link in the navigation bar at the top of the page! +Access it only *after* launching the challenge: if you ask SENSAI for help before that, it will just tell you to open the terminal so that the challenge can launch! + +---- + +**NOTE:** SENSAI is an ongoing research project at Arizona State University, and is being run under an IRB protocol. +If you do not wish to participate in the study, please feel free to skip this level! + + \ No newline at end of file diff --git a/sensai/sensai-terminal/solve b/sensai/sensai-terminal/solve new file mode 100755 index 0000000..58cc50f --- /dev/null +++ b/sensai/sensai-terminal/solve @@ -0,0 +1,43 @@ +#!/usr/bin/exec-suid --real -- /bin/bash -p + +# art from https://www.asciiart.eu/electronics/light-bulbs +cat < " + +if [ "$REPLY" == "$PASSWORD" ] +then + echo "CORRECT! Here is your flag:" + cat /flag +else + echo "INCORRECT! Go ask SENSAI for the password!" +fi diff --git a/sensai/sensai/.bashrc b/sensai/sensai/.bashrc new file mode 100644 index 0000000..38903ce --- /dev/null +++ b/sensai/sensai/.bashrc @@ -0,0 +1 @@ +[[ -t 1 ]] && /challenge/solve diff --git a/sensai/sensai/.init b/sensai/sensai/.init new file mode 100644 index 0000000..824624b --- /dev/null +++ b/sensai/sensai/.init @@ -0,0 +1,6 @@ +#!/bin/bash + +echo 'source /challenge/.bashrc' >> /etc/bash.bashrc +ln -s /etc/bash.bashrc /etc/bashrc + +chmod 4711 /challenge/solve diff --git a/welcome/sensai/DESCRIPTION.md b/sensai/sensai/DESCRIPTION.md similarity index 100% rename from welcome/sensai/DESCRIPTION.md rename to sensai/sensai/DESCRIPTION.md diff --git a/welcome/sensai/solve b/sensai/sensai/solve similarity index 100% rename from welcome/sensai/solve rename to sensai/sensai/solve diff --git a/welcome/module.yml b/welcome/module.yml index e244b7f..6393366 100644 --- a/welcome/module.yml +++ b/welcome/module.yml @@ -13,9 +13,6 @@ challenges: - id: restart name: Restarting Challenges allow_privileged: false - - id: sensai - name: Getting Help - allow_privileged: false - id: challenge name: Challenge Programs allow_privileged: false