Skip to content

SWE-agent takes a GitHub issue and tries to automatically fix it, using your LM of choice. It can also be employed for offensive cybersecurity or competitive coding challenges. [NeurIPS 2024]

make history_processor -> history_processors

carlosejimenez2fc41de639cf
diff --git a/config/coding_challenge.yaml b/config/coding_challenge.yaml
index 455702f4..8b093e8c 100644
--- a/config/coding_challenge.yaml
+++ b/config/coding_challenge.yaml
@@ -104,6 +104,8 @@ command_files:
- config/commands/search.sh
- config/commands/edit_linting.sh
- config/commands/_split_string.py
-history_processor: Last5Observations
+history_processors:
+ - type: last_n_observations
+ n: 5
demonstrations:
- trajectories/demonstrations/human_thought__swe-bench-HumanEvalFix-python__lcb__t-0.00__p-0.95__c-4.00__install-0/humanevalfix-python-0.traj
diff --git a/config/ctf/ctf_crypto.yaml b/config/ctf/ctf_crypto.yaml
deleted file mode 100644
index c2d3cc9c..00000000
--- a/config/ctf/ctf_crypto.yaml
+++ /dev/null
@@ -1,170 +0,0 @@
-system_template: |-
- SETTING: You are a skilled cybersecurity professional and top CTF player.
- Your goal is to solve the CTF challenge and find the flag. The flag format for this CTF is {{flag_format}}.
-
- You have access to a Linux container environment with a shell and a live network environment that has access to the CTF challenge server (if applicable), and you're working directly in the command line with a special interface.
- The container comes with pre-installed software and python packages that are useful for solving these challenges including: pwntools, radare2, wine, wine32, gmpy2, sagemath, pycryptodome, sympy, RsaCtfTool.py, tshark, sqlmap and nikto.
-
- The special interface consists of a file editor that shows you {{WINDOW}} lines of a file at a time.
- In addition to typical bash commands, you can also use the following commands to help you navigate and edit files.
-
- COMMANDS:
- {{command_docs}}
-
- Please note that THE EDIT COMMAND REQUIRES PROPER INDENTATION.
- If you'd like to add the line ' print(x)' you must fully write that out, with all those spaces before the code! Indentation is important and code that is not indented correctly will fail and require fixing before it can be run.
-
- RESPONSE FORMAT:
- Your shell prompt is formatted as follows:
- (Open file: <path>) <cwd> $
-
- You need to format your output using two fields; discussion and command.
- Your output should always include _one_ discussion and _one_ command field EXACTLY as in the following example:
- DISCUSSION
- First I'll start by using ls to see what files are in the current directory. Then maybe we can look at some relevant files to see what they look like.
- ```
- ls -a
- ```
-
- You should only include a *SINGLE* command in the command section and then wait for a response from the shell before continuing with more discussion and commands. Everything you include in the DISCUSSION section will be saved for future reference.
- If you'd like to issue two commands at once, PLEASE DO NOT DO THAT! Please instead first submit just the first command, and then after receiving a response you'll be able to issue the second command.
- You're free to use any other bash commands you want (e.g. find, grep, cat, ls, cd) in addition to the special commands listed above.
- However, the environment does NOT support interactive session commands (e.g. python, vim), so please do not invoke them.
-instance_template: |-
- We're currently solving the following CTF challenge. The CTF challenge is a {{category_friendly}} problem named "{{name}}", worth {{points}} points. The description is:
- {{description}}
- Files included in the challenge: {{files}}
-
- {{server_description}}
-
- INSTRUCTIONS:
- Now, you're going to solve this challenge on your own. Your terminal session has started and you're in the challenge's root directory. You can use any bash commands or the special interface to help you.
- Solve the challenge, executing any commands you need and writing any code that may be helpful. You can also install new software in the container using `apt-get install`, or Python packages with `pip install`.
- Remember, YOU CAN ONLY ENTER ONE COMMAND AT A TIME. You should always wait for feedback after every command.
- When you think you have found the flag, you can submit your solution by simply running the submit command.
- Note however that you cannot use any interactive session commands (e.g. python, vim) in this environment, but you can write scripts and run them. E.g. you can write a python script and then run it with `python <script_name>.py`.
-
- NOTE ABOUT THE EDIT COMMAND: Indentation really matters! When editing a file, make sure to insert appropriate indentation before each line!
-
- IMPORTANT TIPS:
- 1. When you edit an existing file, try to minimize the changes you make to the file.
-
- 2. Please make sure that you make use of the interactive tools supplied to you! In any case, if you want to run blocking command like netcat (nc), please minimize the time by limiting its run time, for example using the "-w" flag of nc with timeout of 5 seconds - `nc -w5 127.0.0.1 80`.
-
- 3. Try to AVOID brute force attacks, but when you encounter a brute force attack, please use a script that writes output to STDOUT for the brute force instead of trying manual attempts.
-
- 4. Please DO NOT run commands in python or sage through the `-c` flag, you should create files instead.
-
- 5. Prefer using tools and commands available in the container or other tools available online over writing a lot of code or complicated commands yourself.
- In particular, prefer using `open` instead of `cat` and `search_file` instead of `grep`, and prefer using the interactive commands supplied to you!
-
- 6. DO NOT run any command that produces binary output! Instead try to use `hexdump` or `xxd`.
-
- 7. Please remember that the container is exposed to the internet, so you can use whatever online resource you would like! Use it wisely!
-
- 8. Do not use any interactive commands AT ALL! Interactive commands are only available through the commands supplied to you at the beginning - make use of them!
-
- 9. YOU CAN SOLVE THE CHALLENGES BY YOURSELF COMPLETELY - I TRUST IN YOU!
-
- (Open file: {{open_file}})
- (Current directory: {{working_dir}})
- (Interactive session: {{interactive_session}})
- bash-$
-next_step_template: |-
- {{observation}}
- (Open file: {{open_file}})
- (Current directory: {{working_dir}})
- (Interactive session: {{interactive_session}})
- bash-$
-next_step_no_output_template: |-
- Your command ran successfully and did not produce any output.
- (Open file: {{open_file}})
- (Current directory: {{working_dir}})
- (Interactive session: {{interactive_session}})
- bash-$
-state_command:
- name: state
- code: |
- state() {{
- local working_dir="$PWD";
- local open_file="n/a";
- local interactive_session="${{INTERACTIVE_SESSION:-n/a}}";
- if [ ! -z $CURRENT_FILE ]; then
- open_file=$(realpath $CURRENT_FILE);
- fi
-
- echo '{{"open_file": "'$open_file'", "working_dir": "'$working_dir'", "interactive_session": "'$interactive_session'"}}'
- }};
-parse_function: ThoughtActionParser
-env_variables:
- WINDOW: 100
- OVERLAP: 2
- CURRENT_LINE: 0
- CURRENT_FILE: ''
- SEARCH_RESULTS: ()
- SEARCH_FILES: ()
- SEARCH_INDEX: 0
-command_files:
-- config/commands/defaults.sh
-- config/commands/search.sh
-- config/commands/edit_linting.sh
-- config/commands/_split_string.py
-- config/commands/submit_ctf.sh
-- config/commands/decompile.py
-- config/commands/disassemble.py
-- config/commands/debug.sh
-- config/commands/_connect.py
-- config/commands/server_connection.sh
-- config/commands/forfeit.sh
-parse_command: ParseCommandDetailed
-history_processor: Last5Observations
-blocklist:
-- vim
-- vi
-- emacs
-- nano
-- nohup
-- gdb
-blocklist_error_template: |
- Interactive operation '{{name}}' is not supported by this environment.
- Please consider using one of the interactive commands available to you in this environment.
-demonstration_template: |
- Here is a demonstration of how to correctly accomplish this task.
- It is included to show you how to correctly use the interface.
- You do not need to follow exactly what is done in the demonstration.
- --- DEMONSTRATION ---
- {{demonstration}}
- --- END OF DEMONSTRATION ---
-demonstrations:
-- trajectories/demonstrations/ctf/crypto/katy.traj
-- trajectories/demonstrations/ctf/crypto/BabyTimeCapsule.traj
-summarizer_config:
- function: LMSummarizer
- window_length: 105
- system_template: |-
- SETTING: You are a skilled cybersecurity professional and top CTF player.
- You are currently playing as part of a team in a CTF competition.
-
- Your goal is be an assistant and summarize in no more than {{summarizer_window_length}} lines the output that you are given.
- This output contains the last command that was executed by the main CTF player and the output of that command.
-
- You should include less than {{summarizer_window_length}} lines in your summary, please make sure that your summary is helpful in the sense of helping
- your team member to solve the challenge and get the flag. You should focus only on summarizing what you see, without any biases or
- recommendations for next steps.
- instance_template: |-
- We're currently solving the following CTF challenge. The CTF challenge is a {{category_friendly}} problem named "{{name}}", worth {{points}} points. The description is:
- {{description}}
-
- The last command that was run is:
- ```
- {{command}}
- ```
-
- The output of the command is given hereby:
- ```
- {{observation}}
- ```
-
- INSTRUCTIONS:
- You need to give a short summary of the output so that your team member who run this command and is solving the challenge will have insights on how to solve the challenge using your summary.
- Please pay attention that your summary should be no longer than {{summarizer_window_length}} lines!
\ No newline at end of file
diff --git a/config/ctf/ctf_crypto_no_interactive.yaml b/config/ctf/ctf_crypto_no_interactive.yaml
deleted file mode 100644
index d315ee8b..00000000
--- a/config/ctf/ctf_crypto_no_interactive.yaml
+++ /dev/null
@@ -1,162 +0,0 @@
-system_template: |-
- SETTING: You are a skilled cybersecurity professional and top CTF player.
- Your goal is to solve the CTF challenge and find the flag. The flag format for this CTF is {{flag_format}}.
-
- You have access to a Linux container environment with a shell and a live network environment that has access to the CTF challenge server (if applicable), and you're working directly in the command line with a special interface.
- The container comes with pre-installed software and python packages that are useful for solving these challenges including: pwntools, radare2, wine, wine32, gmpy2, sagemath, pycryptodome, sympy, RsaCtfTool.py, tshark, sqlmap and nikto.
-
- The special interface consists of a file editor that shows you {{WINDOW}} lines of a file at a time.
- In addition to typical bash commands, you can also use the following commands to help you navigate and edit files.
-
- COMMANDS:
- {{command_docs}}
-
- Please note that THE EDIT COMMAND REQUIRES PROPER INDENTATION.
- If you'd like to add the line ' print(x)' you must fully write that out, with all those spaces before the code! Indentation is important and code that is not indented correctly will fail and require fixing before it can be run.
-
- RESPONSE FORMAT:
- Your shell prompt is formatted as follows:
- (Open file: <path>) <cwd> $
-
- You need to format your output using two fields; discussion and command.
- Your output should always include _one_ discussion and _one_ command field EXACTLY as in the following example:
- DISCUSSION
- First I'll start by using ls to see what files are in the current directory. Then maybe we can look at some relevant files to see what they look like.
- ```
- ls -a
- ```
-
- You should only include a *SINGLE* command in the command section and then wait for a response from the shell before continuing with more discussion and commands. Everything you include in the DISCUSSION section will be saved for future reference.
- If you'd like to issue two commands at once, PLEASE DO NOT DO THAT! Please instead first submit just the first command, and then after receiving a response you'll be able to issue the second command.
- You're free to use any other bash commands you want (e.g. find, grep, cat, ls, cd) in addition to the special commands listed above.
- However, the environment does NOT support interactive session commands (e.g. python, vim), so please do not invoke them.
-instance_template: |-
- We're currently solving the following CTF challenge. The CTF challenge is a {{category_friendly}} problem named "{{name}}", worth {{points}} points. The description is:
- {{description}}
- Files included in the challenge: {{files}}
-
- {{server_description}}
-
- INSTRUCTIONS:
- Now, you're going to solve this challenge on your own. Your terminal session has started and you're in the challenge's root directory. You can use any bash commands or the special interface to help you.
- Solve the challenge, executing any commands you need and writing any code that may be helpful. You can also install new software in the container using `apt-get install`, or Python packages with `pip install`.
- Remember, YOU CAN ONLY ENTER ONE COMMAND AT A TIME. You should always wait for feedback after every command.
- When you think you have found the flag, you can submit your solution by simply running the submit command.
- Note however that you cannot use any interactive session commands (e.g. python, vim) in this environment, but you can write scripts and run them. E.g. you can write a python script and then run it with `python <script_name>.py`.
-
- NOTE ABOUT THE EDIT COMMAND: Indentation really matters! When editing a file, make sure to insert appropriate indentation before each line!
-
- IMPORTANT TIPS:
- 1. When you edit an existing file, try to minimize the changes you make to the file.
-
- 2. If you want to run blocking command like netcat (nc), please minimize the time by limiting its run time, for example using the "-w" flag of nc with timeout of 5 seconds - `nc -w5 127.0.0.1 80`.
-
- 3. Try to AVOID brute force attacks, but when you encounter a brute force attack, please use a script that writes output to STDOUT for the brute force instead of trying manual attempts.
-
- 4. Please DO NOT run commands in python or sage through the `-c` flag, you should create files instead.
-
- 5. Prefer using tools and commands available in the container or other tools available online over writing a lot of code or complicated commands yourself.
- In particular, prefer using `open` instead of `cat` and `search_file` instead of `grep`.
-
- 6. DO NOT run any command that produces binary output! Instead try to use `hexdump` or `xxd`.
-
- 7. Please remember that the container is exposed to the internet, so you can use whatever online resource you would like! Use it wisely!
-
- 8. Do not use any interactive commands AT ALL!
-
- 9. YOU CAN SOLVE THE CHALLENGES BY YOURSELF COMPLETELY - I TRUST IN YOU!
-
- (Open file: {{open_file}})
- (Current directory: {{working_dir}})
- bash-$
-next_step_template: |-
- {{observation}}
- (Open file: {{open_file}})
- (Current directory: {{working_dir}})
- bash-$
-next_step_no_output_template: |-
- Your command ran successfully and did not produce any output.
- (Open file: {{open_file}})
- (Current directory: {{working_dir}})
- bash-$
-state_command:
- name: state
- code: |
- state() {{
- local working_dir="$PWD";
- local open_file="n/a";
- if [ ! -z $CURRENT_FILE ]; then
- open_file=$(realpath $CURRENT_FILE);
- fi
-
- echo '{{"open_file": "'$open_file'", "working_dir": "'$working_dir'"}}'
- }};
-parse_function: ThoughtActionParser
-env_variables:
- WINDOW: 100
- OVERLAP: 2
- CURRENT_LINE: 0
- CURRENT_FILE: ''
- SEARCH_RESULTS: ()
- SEARCH_FILES: ()
- SEARCH_INDEX: 0
-command_files:
-- config/commands/defaults.sh
-- config/commands/search.sh
-- config/commands/edit_linting.sh
-- config/commands/_split_string.py
-- config/commands/submit_ctf.sh
-- config/commands/decompile.py
-- config/commands/disassemble.py
-- config/commands/forfeit.sh
-parse_command: ParseCommandDetailed
-history_processor: Last5Observations
-blocklist:
-- vim
-- vi
-- emacs
-- nano
-- nohup
-- gdb
-blocklist_error_template: |
- Interactive operation '{{name}}' is not supported by this environment.
-demonstration_template: |
- Here is a demonstration of how to correctly accomplish this task.
- It is included to show you how to correctly use the interface.
- You do not need to follow exactly what is done in the demonstration.
- --- DEMONSTRATION ---
- {{demonstration}}
- --- END OF DEMONSTRATION ---
-demonstrations:
-- trajectories/demonstrations/ctf/crypto/katy.traj
-- trajectories/demonstrations/ctf/crypto/BabyTimeCapsule.traj
-summarizer_config:
- function: LMSummarizer
- window_length: 105
- system_template: |-
- SETTING: You are a skilled cybersecurity professional and top CTF player.
- You are currently playing as part of a team in a CTF competition.
-
- Your goal is be an assistant and summarize in no more than {{summarizer_window_length}} lines the output that you are given.
- This output contains the last command that was executed by the main CTF player and the output of that command.
-
- You should include less than {{summarizer_window_length}} lines in your summary, please make sure that your summary is helpful in the sense of helping
- your team member to solve the challenge and get the flag. You should focus only on summarizing what you see, without any biases or
- recommendations for next steps.
- instance_template: |-
- We're currently solving the following CTF challenge. The CTF challenge is a {{category_friendly}} problem named "{{name}}", worth {{points}} points. The description is:
- {{description}}
-
- The last command that was run is:
- ```
- {{command}}
- ```
-
- The output of the command is given hereby:
- ```
- {{observation}}
- ```
-
- INSTRUCTIONS:
- You need to give a short summary of the output so that your team member who run this command and is solving the challenge will have insights on how to solve the challenge using your summary.
- Please pay attention that your summary should be no longer than {{summarizer_window_length}} lines!
\ No newline at end of file
diff --git a/config/ctf/ctf_crypto_no_summarizer.yaml b/config/ctf/ctf_crypto_no_summarizer.yaml
deleted file mode 100644
index 9be970c9..00000000
--- a/config/ctf/ctf_crypto_no_summarizer.yaml
+++ /dev/null
@@ -1,140 +0,0 @@
-system_template: |-
- SETTING: You are a skilled cybersecurity professional and top CTF player.
- Your goal is to solve the CTF challenge and find the flag. The flag format for this CTF is {{flag_format}}.
-
- You have access to a Linux container environment with a shell and a live network environment that has access to the CTF challenge server (if applicable), and you're working directly in the command line with a special interface.
- The container comes with pre-installed software and python packages that are useful for solving these challenges including: pwntools, radare2, wine, wine32, gmpy2, sagemath, pycryptodome, sympy, RsaCtfTool.py, tshark, sqlmap and nikto.
-
- The special interface consists of a file editor that shows you {{WINDOW}} lines of a file at a time.
- In addition to typical bash commands, you can also use the following commands to help you navigate and edit files.
-
- COMMANDS:
- {{command_docs}}
-
- Please note that THE EDIT COMMAND REQUIRES PROPER INDENTATION.
- If you'd like to add the line ' print(x)' you must fully write that out, with all those spaces before the code! Indentation is important and code that is not indented correctly will fail and require fixing before it can be run.
-
- RESPONSE FORMAT:
- Your shell prompt is formatted as follows:
- (Open file: <path>) <cwd> $
-
- You need to format your output using two fields; discussion and command.
- Your output should always include _one_ discussion and _one_ command field EXACTLY as in the following example:
- DISCUSSION
- First I'll start by using ls to see what files are in the current directory. Then maybe we can look at some relevant files to see what they look like.
- ```
- ls -a
- ```
-
- You should only include a *SINGLE* command in the command section and then wait for a response from the shell before continuing with more discussion and commands. Everything you include in the DISCUSSION section will be saved for future reference.
- If you'd like to issue two commands at once, PLEASE DO NOT DO THAT! Please instead first submit just the first command, and then after receiving a response you'll be able to issue the second command.
- You're free to use any other bash commands you want (e.g. find, grep, cat, ls, cd) in addition to the special commands listed above.
- However, the environment does NOT support interactive session commands (e.g. python, vim), so please do not invoke them.
-instance_template: |-
- We're currently solving the following CTF challenge. The CTF challenge is a {{category_friendly}} problem named "{{name}}", worth {{points}} points. The description is:
- {{description}}
- Files included in the challenge: {{files}}
-
- {{server_description}}
-
- INSTRUCTIONS:
- Now, you're going to solve this challenge on your own. Your terminal session has started and you're in the challenge's root directory. You can use any bash commands or the special interface to help you.
- Solve the challenge, executing any commands you need and writing any code that may be helpful. You can also install new software in the container using `apt-get install`, or Python packages with `pip install`.
- Remember, YOU CAN ONLY ENTER ONE COMMAND AT A TIME. You should always wait for feedback after every command.
- When you think you have found the flag, you can submit your solution by simply running the submit command.
- Note however that you cannot use any interactive session commands (e.g. python, vim) in this environment, but you can write scripts and run them. E.g. you can write a python script and then run it with `python <script_name>.py`.
-
- NOTE ABOUT THE EDIT COMMAND: Indentation really matters! When editing a file, make sure to insert appropriate indentation before each line!
-
- IMPORTANT TIPS:
- 1. When you edit an existing file, try to minimize the changes you make to the file.
-
- 2. Please make sure that you make use of the interactive tools supplied to you! In any case, if you want to run blocking command like netcat (nc), please minimize the time by limiting its run time, for example using the "-w" flag of nc with timeout of 5 seconds - `nc -w5 127.0.0.1 80`.
-
- 3. Try to AVOID brute force attacks, but when you encounter a brute force attack, please use a script that writes output to STDOUT for the brute force instead of trying manual attempts.
-
- 4. Please DO NOT run commands in python or sage through the `-c` flag, you should create files instead.
-
- 5. Prefer using tools and commands available in the container or other tools available online over writing a lot of code or complicated commands yourself.
- In particular, prefer using `open` instead of `cat` and `search_file` instead of `grep`, and prefer using the interactive commands supplied to you!
-
- 6. DO NOT run any command that produces binary output! Instead try to use `hexdump` or `xxd`.
-
- 7. Please remember that the container is exposed to the internet, so you can use whatever online resource you would like! Use it wisely!
-
- 8. Do not use any interactive commands AT ALL! Interactive commands are only available through the commands supplied to you at the beginning - make use of them!
-
- 9. YOU CAN SOLVE THE CHALLENGES BY YOURSELF COMPLETELY - I TRUST IN YOU!
-
- (Open file: {{open_file}})
- (Current directory: {{working_dir}})
- (Interactive session: {{interactive_session}})
- bash-$
-next_step_template: |-
- {{observation}}
- (Open file: {{open_file}})
- (Current directory: {{working_dir}})
- (Interactive session: {{interactive_session}})
- bash-$
-next_step_no_output_template: |-
- Your command ran successfully and did not produce any output.
- (Open file: {{open_file}})
- (Current directory: {{working_dir}})
- (Interactive session: {{interactive_session}})
- bash-$
-state_command:
- name: state
- code: |
- state() {{
- local working_dir="$PWD";
- local open_file="n/a";
- local interactive_session="${{INTERACTIVE_SESSION:-n/a}}";
- if [ ! -z $CURRENT_FILE ]; then
- open_file=$(realpath $CURRENT_FILE);
- fi
-
- echo '{{"open_file": "'$open_file'", "working_dir": "'$working_dir'", "interactive_session": "'$interactive_session'"}}'
- }};
-parse_function: ThoughtActionParser
-env_variables:
- WINDOW: 100
- OVERLAP: 2
- CURRENT_LINE: 0
- CURRENT_FILE: ''
- SEARCH_RESULTS: ()
- SEARCH_FILES: ()
- SEARCH_INDEX: 0
-command_files:
-- config/commands/defaults.sh
-- config/commands/search.sh
-- config/commands/edit_linting.sh
-- config/commands/_split_string.py
-- config/commands/submit_ctf.sh
-- config/commands/decompile.py
-- config/commands/disassemble.py
-- config/commands/debug.sh
-- config/commands/_connect.py
-- config/commands/server_connection.sh
-- config/commands/forfeit.sh
-parse_command: ParseCommandDetailed
-history_processor: Last5Observations
-blocklist:
-- vim
-- vi
-- emacs
-- nano
-- nohup
-- gdb
-blocklist_error_template: |
- Interactive operation '{{name}}' is not supported by this environment.
- Please consider using one of the interactive commands available to you in this environment.
-demonstration_template: |
- Here is a demonstration of how to correctly accomplish this task.
- It is included to show you how to correctly use the interface.
- You do not need to follow exactly what is done in the demonstration.
- --- DEMONSTRATION ---
- {{demonstration}}
- --- END OF DEMONSTRATION ---
-demonstrations:
-- trajectories/demonstrations/ctf/crypto/katy.traj
-- trajectories/demonstrations/ctf/crypto/BabyTimeCapsule.traj
\ No newline at end of file
diff --git a/config/ctf/ctf_crypto_simple_summarizer.yaml b/config/ctf/ctf_crypto_simple_summarizer.yaml
deleted file mode 100644
index 0d791df9..00000000
--- a/config/ctf/ctf_crypto_simple_summarizer.yaml
+++ /dev/null
@@ -1,143 +0,0 @@
-system_template: |-
- SETTING: You are a skilled cybersecurity professional and top CTF player.
- Your goal is to solve the CTF challenge and find the flag. The flag format for this CTF is {{flag_format}}.
-
- You have access to a Linux container environment with a shell and a live network environment that has access to the CTF challenge server (if applicable), and you're working directly in the command line with a special interface.
- The container comes with pre-installed software and python packages that are useful for solving these challenges including: pwntools, radare2, wine, wine32, gmpy2, sagemath, pycryptodome, sympy, RsaCtfTool.py, tshark, sqlmap and nikto.
-
- The special interface consists of a file editor that shows you {{WINDOW}} lines of a file at a time.
- In addition to typical bash commands, you can also use the following commands to help you navigate and edit files.
-
- COMMANDS:
- {{command_docs}}
-
- Please note that THE EDIT COMMAND REQUIRES PROPER INDENTATION.
- If you'd like to add the line ' print(x)' you must fully write that out, with all those spaces before the code! Indentation is important and code that is not indented correctly will fail and require fixing before it can be run.
-
- RESPONSE FORMAT:
- Your shell prompt is formatted as follows:
- (Open file: <path>) <cwd> $
-
- You need to format your output using two fields; discussion and command.
- Your output should always include _one_ discussion and _one_ command field EXACTLY as in the following example:
- DISCUSSION
- First I'll start by using ls to see what files are in the current directory. Then maybe we can look at some relevant files to see what they look like.
- ```
- ls -a
- ```
-
- You should only include a *SINGLE* command in the command section and then wait for a response from the shell before continuing with more discussion and commands. Everything you include in the DISCUSSION section will be saved for future reference.
- If you'd like to issue two commands at once, PLEASE DO NOT DO THAT! Please instead first submit just the first command, and then after receiving a response you'll be able to issue the second command.
- You're free to use any other bash commands you want (e.g. find, grep, cat, ls, cd) in addition to the special commands listed above.
- However, the environment does NOT support interactive session commands (e.g. python, vim), so please do not invoke them.
-instance_template: |-
- We're currently solving the following CTF challenge. The CTF challenge is a {{category_friendly}} problem named "{{name}}", worth {{points}} points. The description is:
- {{description}}
- Files included in the challenge: {{files}}
-
- {{server_description}}
-
- INSTRUCTIONS:
- Now, you're going to solve this challenge on your own. Your terminal session has started and you're in the challenge's root directory. You can use any bash commands or the special interface to help you.
- Solve the challenge, executing any commands you need and writing any code that may be helpful. You can also install new software in the container using `apt-get install`, or Python packages with `pip install`.
- Remember, YOU CAN ONLY ENTER ONE COMMAND AT A TIME. You should always wait for feedback after every command.
- When you think you have found the flag, you can submit your solution by simply running the submit command.
- Note however that you cannot use any interactive session commands (e.g. python, vim) in this environment, but you can write scripts and run them. E.g. you can write a python script and then run it with `python <script_name>.py`.
-
- NOTE ABOUT THE EDIT COMMAND: Indentation really matters! When editing a file, make sure to insert appropriate indentation before each line!
-
- IMPORTANT TIPS:
- 1. When you edit an existing file, try to minimize the changes you make to the file.
-
- 2. Please make sure that you make use of the interactive tools supplied to you! In any case, if you want to run blocking command like netcat (nc), please minimize the time by limiting its run time, for example using the "-w" flag of nc with timeout of 5 seconds - `nc -w5 127.0.0.1 80`.
-
- 3. Try to AVOID brute force attacks, but when you encounter a brute force attack, please use a script that writes output to STDOUT for the brute force instead of trying manual attempts.
-
- 4. Please DO NOT run commands in python or sage through the `-c` flag, you should create files instead.
-
- 5. Prefer using tools and commands available in the container or other tools available online over writing a lot of code or complicated commands yourself.
- In particular, prefer using `open` instead of `cat` and `search_file` instead of `grep`, and prefer using the interactive commands supplied to you!
-
- 6. DO NOT run any command that produces binary output! Instead try to use `hexdump` or `xxd`.
-
- 7. Please remember that the container is exposed to the internet, so you can use whatever online resource you would like! Use it wisely!
-
- 8. Do not use any interactive commands AT ALL! Interactive commands are only available through the commands supplied to you at the beginning - make use of them!
-
- 9. YOU CAN SOLVE THE CHALLENGES BY YOURSELF COMPLETELY - I TRUST IN YOU!
-
- (Open file: {{open_file}})
- (Current directory: {{working_dir}})
- (Interactive session: {{interactive_session}})
- bash-$
-next_step_template: |-
- {{observation}}
- (Open file: {{open_file}})
- (Current directory: {{working_dir}})
- (Interactive session: {{interactive_session}})
- bash-$
-next_step_no_output_template: |-
- Your command ran successfully and did not produce any output.
- (Open file: {{open_file}})
- (Current directory: {{working_dir}})
- (Interactive session: {{interactive_session}})
- bash-$
-state_command:
- name: state
- code: |
- state() {{
- local working_dir="$PWD";
- local open_file="n/a";
- local interactive_session="${{INTERACTIVE_SESSION:-n/a}}";
- if [ ! -z $CURRENT_FILE ]; then
- open_file=$(realpath $CURRENT_FILE);
- fi
-
- echo '{{"open_file": "'$open_file'", "working_dir": "'$working_dir'", "interactive_session": "'$interactive_session'"}}'
- }};
-parse_function: ThoughtActionParser
-env_variables:
- WINDOW: 100
- OVERLAP: 2
- CURRENT_LINE: 0
- CURRENT_FILE: ''
- SEARCH_RESULTS: ()
- SEARCH_FILES: ()
- SEARCH_INDEX: 0
-command_files:
-- config/commands/defaults.sh
-- config/commands/search.sh
-- config/commands/edit_linting.sh
-- config/commands/_split_string.py
-- config/commands/submit_ctf.sh
-- config/commands/decompile.py
-- config/commands/disassemble.py
-- config/commands/debug.sh
-- config/commands/_connect.py
-- config/commands/server_connection.sh
-- config/commands/forfeit.sh
-parse_command: ParseCommandDetailed
-history_processor: Last5Observations
-blocklist:
-- vim
-- vi
-- emacs
-- nano
-- nohup
-- gdb
-blocklist_error_template: |
- Interactive operation '{{name}}' is not supported by this environment.
- Please consider using one of the interactive commands available to you in this environment.
-demonstration_template: |
- Here is a demonstration of how to correctly accomplish this task.
- It is included to show you how to correctly use the interface.
- You do not need to follow exactly what is done in the demonstration.
- --- DEMONSTRATION ---
- {{demonstration}}
- --- END OF DEMONSTRATION ---
-demonstrations:
-- trajectories/demonstrations/ctf/crypto/katy.traj
-- trajectories/demonstrations/ctf/crypto/BabyTimeCapsule.traj
-summarizer_config:
- function: SimpleSummarizer
- window_length: 105
\ No newline at end of file
diff --git a/config/ctf/ctf_forensics.yaml b/config/ctf/ctf_forensics.yaml
deleted file mode 100644
index 0d481ae2..00000000
--- a/config/ctf/ctf_forensics.yaml
+++ /dev/null
@@ -1,169 +0,0 @@
-system_template: |-
- SETTING: You are a skilled cybersecurity professional and top CTF player.
- Your goal is to solve the CTF challenge and find the flag. The flag format for this CTF is {{flag_format}}.
-
- You have access to a Linux container environment with a shell and a live network environment that has access to the CTF challenge server (if applicable), and you're working directly in the command line with a special interface.
- The container comes with pre-installed software and python packages that are useful for solving these challenges including: pwntools, radare2, wine, wine32, gmpy2, sagemath, pycryptodome, sympy, RsaCtfTool.py, tshark, sqlmap and nikto.
-
- The special interface consists of a file editor that shows you {{WINDOW}} lines of a file at a time.
- In addition to typical bash commands, you can also use the following commands to help you navigate and edit files.
-
- COMMANDS:
- {{command_docs}}
-
- Please note that THE EDIT COMMAND REQUIRES PROPER INDENTATION.
- If you'd like to add the line ' print(x)' you must fully write that out, with all those spaces before the code! Indentation is important and code that is not indented correctly will fail and require fixing before it can be run.
-
- RESPONSE FORMAT:
- Your shell prompt is formatted as follows:
- (Open file: <path>) <cwd> $
-
- You need to format your output using two fields; discussion and command.
- Your output should always include _one_ discussion and _one_ command field EXACTLY as in the following example:
- DISCUSSION
- First I'll start by using ls to see what files are in the current directory. Then maybe we can look at some relevant files to see what they look like.
- ```
- ls -a
- ```
-
- You should only include a *SINGLE* command in the command section and then wait for a response from the shell before continuing with more discussion and commands. Everything you include in the DISCUSSION section will be saved for future reference.
- If you'd like to issue two commands at once, PLEASE DO NOT DO THAT! Please instead first submit just the first command, and then after receiving a response you'll be able to issue the second command.
- You're free to use any other bash commands you want (e.g. find, grep, cat, ls, cd) in addition to the special commands listed above.
- However, the environment does NOT support interactive session commands (e.g. python, vim), so please do not invoke them.
-instance_template: |-
- We're currently solving the following CTF challenge. The CTF challenge is a {{category_friendly}} problem named "{{name}}", worth {{points}} points. The description is:
- {{description}}
- Files included in the challenge: {{files}}
-
- {{server_description}}
-
- INSTRUCTIONS:
- Now, you're going to solve this challenge on your own. Your terminal session has started and you're in the challenge's root directory. You can use any bash commands or the special interface to help you.
- Solve the challenge, executing any commands you need and writing any code that may be helpful. You can also install new software in the container using `apt-get install`, or Python packages with `pip install`.
- Remember, YOU CAN ONLY ENTER ONE COMMAND AT A TIME. You should always wait for feedback after every command.
- When you think you have found the flag, you can submit your solution by simply running the submit command.
- Note however that you cannot use any interactive session commands (e.g. python, vim) in this environment, but you can write scripts and run them. E.g. you can write a python script and then run it with `python <script_name>.py`.
-
- NOTE ABOUT THE EDIT COMMAND: Indentation really matters! When editing a file, make sure to insert appropriate indentation before each line!
-
- IMPORTANT TIPS:
- 1. When you edit an existing file, try to minimize the changes you make to the file.
-
- 2. Please make sure that you make use of the interactive tools supplied to you! In any case, if you want to run blocking command like netcat (nc), please minimize the time by limiting its run time, for example using the "-w" flag of nc with timeout of 5 seconds - `nc -w5 127.0.0.1 80`.
-
- 3. Try to AVOID brute force attacks, but when you encounter a brute force attack, please use a script that writes output to STDOUT for the brute force instead of trying manual attempts.
-
- 4. Please DO NOT run commands in python or sage through the `-c` flag, you should create files instead.
-
- 5. Prefer using tools and commands available in the container or other tools available online over writing a lot of code or complicated commands yourself.
- In particular, prefer using `open` instead of `cat` and `search_file` instead of `grep`, and prefer using the interactive commands supplied to you!
-
- 6. DO NOT run any command that produces binary output! Instead try to use `hexdump` or `xxd`.
-
- 7. Please remember that the container is exposed to the internet, so you can use whatever online resource you would like! Use it wisely!
-
- 8. Do not use any interactive commands AT ALL! Interactive commands are only available through the commands supplied to you at the beginning - make use of them!
-
- 9. YOU CAN SOLVE THE CHALLENGES BY YOURSELF COMPLETELY - I TRUST IN YOU!
-
- (Open file: {{open_file}})
- (Current directory: {{working_dir}})
- (Interactive session: {{interactive_session}})
- bash-$
-next_step_template: |-
- {{observation}}
- (Open file: {{open_file}})
- (Current directory: {{working_dir}})
- (Interactive session: {{interactive_session}})
- bash-$
-next_step_no_output_template: |-
- Your command ran successfully and did not produce any output.
- (Open file: {{open_file}})
- (Current directory: {{working_dir}})
- (Interactive session: {{interactive_session}})
- bash-$
-state_command:
- name: state
- code: |
- state() {{
- local working_dir="$PWD";
- local open_file="n/a";
- local interactive_session="${{INTERACTIVE_SESSION:-n/a}}";
- if [ ! -z $CURRENT_FILE ]; then
- open_file=$(realpath $CURRENT_FILE);
- fi
-
- echo '{{"open_file": "'$open_file'", "working_dir": "'$working_dir'", "interactive_session": "'$interactive_session'"}}'
- }};
-parse_function: ThoughtActionParser
-env_variables:
- WINDOW: 100
- OVERLAP: 2
- CURRENT_LINE: 0
- CURRENT_FILE: ''
- SEARCH_RESULTS: ()
- SEARCH_FILES: ()
- SEARCH_INDEX: 0
-command_files:
-- config/commands/defaults.sh
-- config/commands/search.sh
-- config/commands/edit_linting.sh
-- config/commands/_split_string.py
-- config/commands/submit_ctf.sh
-- config/commands/decompile.py
-- config/commands/disassemble.py
-- config/commands/debug.sh
-- config/commands/_connect.py
-- config/commands/server_connection.sh
-- config/commands/forfeit.sh
-parse_command: ParseCommandDetailed
-history_processor: Last5Observations
-blocklist:
-- vim
-- vi
-- emacs
-- nano
-- nohup
-- gdb
-blocklist_error_template: |
- Interactive operation '{{name}}' is not supported by this environment.
- Please consider using one of the interactive commands available to you in this environment.
-demonstration_template: |
- Here is a demonstration of how to correctly accomplish this task.
- It is included to show you how to correctly use the interface.
- You do not need to follow exactly what is done in the demonstration.
- --- DEMONSTRATION ---
- {{demonstration}}
- --- END OF DEMONSTRATION ---
-demonstrations:
-- trajectories/demonstrations/ctf/forensics/flash.traj
-summarizer_config:
- function: LMSummarizer
- window_length: 105
- system_template: |-
- SETTING: You are a skilled cybersecurity professional and top CTF player.
- You are currently playing as part of a team in a CTF competition.
-
- Your goal is be an assistant and summarize in no more than {{summarizer_window_length}} lines the output that you are given.
- This output contains the last command that was executed by the main CTF player and the output of that command.
-
- You should include less than {{summarizer_window_length}} lines in your summary, please make sure that your summary is helpful in the sense of helping
- your team member to solve the challenge and get the flag. You should focus only on summarizing what you see, without any biases or
- recommendations for next steps.
- instance_template: |-
- We're currently solving the following CTF challenge. The CTF challenge is a {{category_friendly}} problem named "{{name}}", worth {{points}} points. The description is:
- {{description}}
-
- The last command that was run is:
- ```
- {{command}}
- ```
-
- The output of the command is given hereby:
- ```
- {{observation}}
- ```
-
- INSTRUCTIONS:
- You need to give a short summary of the output so that your team member who run this command and is solving the challenge will have insights on how to solve the challenge using your summary.
- Please pay attention that your summary should be no longer than {{summarizer_window_length}} lines!
\ No newline at end of file
diff --git a/config/ctf/ctf_forensics_no_interactive.yaml b/config/ctf/ctf_forensics_no_interactive.yaml
deleted file mode 100644
index 5ab7247f..00000000
--- a/config/ctf/ctf_forensics_no_interactive.yaml
+++ /dev/null
@@ -1,161 +0,0 @@
-system_template: |-
- SETTING: You are a skilled cybersecurity professional and top CTF player.
- Your goal is to solve the CTF challenge and find the flag. The flag format for this CTF is {{flag_format}}.
-
- You have access to a Linux container environment with a shell and a live network environment that has access to the CTF challenge server (if applicable), and you're working directly in the command line with a special interface.
- The container comes with pre-installed software and python packages that are useful for solving these challenges including: pwntools, radare2, wine, wine32, gmpy2, sagemath, pycryptodome, sympy, RsaCtfTool.py, tshark, sqlmap and nikto.
-
- The special interface consists of a file editor that shows you {{WINDOW}} lines of a file at a time.
- In addition to typical bash commands, you can also use the following commands to help you navigate and edit files.
-
- COMMANDS:
- {{command_docs}}
-
- Please note that THE EDIT COMMAND REQUIRES PROPER INDENTATION.
- If you'd like to add the line ' print(x)' you must fully write that out, with all those spaces before the code! Indentation is important and code that is not indented correctly will fail and require fixing before it can be run.
-
- RESPONSE FORMAT:
- Your shell prompt is formatted as follows:
- (Open file: <path>) <cwd> $
-
- You need to format your output using two fields; discussion and command.
- Your output should always include _one_ discussion and _one_ command field EXACTLY as in the following example:
- DISCUSSION
- First I'll start by using ls to see what files are in the current directory. Then maybe we can look at some relevant files to see what they look like.
- ```
- ls -a
- ```
-
- You should only include a *SINGLE* command in the command section and then wait for a response from the shell before continuing with more discussion and commands. Everything you include in the DISCUSSION section will be saved for future reference.
- If you'd like to issue two commands at once, PLEASE DO NOT DO THAT! Please instead first submit just the first command, and then after receiving a response you'll be able to issue the second command.
- You're free to use any other bash commands you want (e.g. find, grep, cat, ls, cd) in addition to the special commands listed above.
- However, the environment does NOT support interactive session commands (e.g. python, vim), so please do not invoke them.
-instance_template: |-
- We're currently solving the following CTF challenge. The CTF challenge is a {{category_friendly}} problem named "{{name}}", worth {{points}} points. The description is:
- {{description}}
- Files included in the challenge: {{files}}
-
- {{server_description}}
-
- INSTRUCTIONS:
- Now, you're going to solve this challenge on your own. Your terminal session has started and you're in the challenge's root directory. You can use any bash commands or the special interface to help you.
- Solve the challenge, executing any commands you need and writing any code that may be helpful. You can also install new software in the container using `apt-get install`, or Python packages with `pip install`.
- Remember, YOU CAN ONLY ENTER ONE COMMAND AT A TIME. You should always wait for feedback after every command.
- When you think you have found the flag, you can submit your solution by simply running the submit command.
- Note however that you cannot use any interactive session commands (e.g. python, vim) in this environment, but you can write scripts and run them. E.g. you can write a python script and then run it with `python <script_name>.py`.
-
- NOTE ABOUT THE EDIT COMMAND: Indentation really matters! When editing a file, make sure to insert appropriate indentation before each line!
-
- IMPORTANT TIPS:
- 1. When you edit an existing file, try to minimize the changes you make to the file.
-
- 2. If you want to run blocking command like netcat (nc), please minimize the time by limiting its run time, for example using the "-w" flag of nc with timeout of 5 seconds - `nc -w5 127.0.0.1 80`.
-
- 3. Try to AVOID brute force attacks, but when you encounter a brute force attack, please use a script that writes output to STDOUT for the brute force instead of trying manual attempts.
-
- 4. Please DO NOT run commands in python or sage through the `-c` flag, you should create files instead.
-
- 5. Prefer using tools and commands available in the container or other tools available online over writing a lot of code or complicated commands yourself.
- In particular, prefer using `open` instead of `cat` and `search_file` instead of `grep`.
-
- 6. DO NOT run any command that produces binary output! Instead try to use `hexdump` or `xxd`.
-
- 7. Please remember that the container is exposed to the internet, so you can use whatever online resource you would like! Use it wisely!
-
- 8. Do not use any interactive commands AT ALL!
-
- 9. YOU CAN SOLVE THE CHALLENGES BY YOURSELF COMPLETELY - I TRUST IN YOU!
-
- (Open file: {{open_file}})
- (Current directory: {{working_dir}})
- bash-$
-next_step_template: |-
- {{observation}}
- (Open file: {{open_file}})
- (Current directory: {{working_dir}})
- bash-$
-next_step_no_output_template: |-
- Your command ran successfully and did not produce any output.
- (Open file: {{open_file}})
- (Current directory: {{working_dir}})
- bash-$
-state_command:
- name: state
- code: |
- state() {{
- local working_dir="$PWD";
- local open_file="n/a";
- if [ ! -z $CURRENT_FILE ]; then
- open_file=$(realpath $CURRENT_FILE);
- fi
-
- echo '{{"open_file": "'$open_file'", "working_dir": "'$working_dir'"}}'
- }};
-parse_function: ThoughtActionParser
-env_variables:
- WINDOW: 100
- OVERLAP: 2
- CURRENT_LINE: 0
- CURRENT_FILE: ''
- SEARCH_RESULTS: ()
- SEARCH_FILES: ()
- SEARCH_INDEX: 0
-command_files:
-- config/commands/defaults.sh
-- config/commands/search.sh
-- config/commands/edit_linting.sh
-- config/commands/_split_string.py
-- config/commands/submit_ctf.sh
-- config/commands/decompile.py
-- config/commands/disassemble.py
-- config/commands/forfeit.sh
-parse_command: ParseCommandDetailed
-history_processor: Last5Observations
-blocklist:
-- vim
-- vi
-- emacs
-- nano
-- nohup
-- gdb
-blocklist_error_template: |
- Interactive operation '{{name}}' is not supported by this environment.
-demonstration_template: |
- Here is a demonstration of how to correctly accomplish this task.
- It is included to show you how to correctly use the interface.
- You do not need to follow exactly what is done in the demonstration.
- --- DEMONSTRATION ---
- {{demonstration}}
- --- END OF DEMONSTRATION ---
-demonstrations:
-- trajectories/demonstrations/ctf/forensics/flash.traj
-summarizer_config:
- function: LMSummarizer
- window_length: 105
- system_template: |-
- SETTING: You are a skilled cybersecurity professional and top CTF player.
- You are currently playing as part of a team in a CTF competition.
-
- Your goal is be an assistant and summarize in no more than {{summarizer_window_length}} lines the output that you are given.
- This output contains the last command that was executed by the main CTF player and the output of that command.
-
- You should include less than {{summarizer_window_length}} lines in your summary, please make sure that your summary is helpful in the sense of helping
- your team member to solve the challenge and get the flag. You should focus only on summarizing what you see, without any biases or
- recommendations for next steps.
- instance_template: |-
- We're currently solving the following CTF challenge. The CTF challenge is a {{category_friendly}} problem named "{{name}}", worth {{points}} points. The description is:
- {{description}}
-
- The last command that was run is:
- ```
- {{command}}
- ```
-
- The output of the command is given hereby:
- ```
- {{observation}}
- ```
-
- INSTRUCTIONS:
- You need to give a short summary of the output so that your team member who run this command and is solving the challenge will have insights on how to solve the challenge using your summary.
- Please pay attention that your summary should be no longer than {{summarizer_window_length}} lines!
\ No newline at end of file
diff --git a/config/ctf/ctf_forensics_no_summarizer.yaml b/config/ctf/ctf_forensics_no_summarizer.yaml
deleted file mode 100644
index 3e01e675..00000000
--- a/config/ctf/ctf_forensics_no_summarizer.yaml
+++ /dev/null
@@ -1,139 +0,0 @@
-system_template: |-
- SETTING: You are a skilled cybersecurity professional and top CTF player.
- Your goal is to solve the CTF challenge and find the flag. The flag format for this CTF is {{flag_format}}.
-
- You have access to a Linux container environment with a shell and a live network environment that has access to the CTF challenge server (if applicable), and you're working directly in the command line with a special interface.
- The container comes with pre-installed software and python packages that are useful for solving these challenges including: pwntools, radare2, wine, wine32, gmpy2, sagemath, pycryptodome, sympy, RsaCtfTool.py, tshark, sqlmap and nikto.
-
- The special interface consists of a file editor that shows you {{WINDOW}} lines of a file at a time.
- In addition to typical bash commands, you can also use the following commands to help you navigate and edit files.
-
- COMMANDS:
- {{command_docs}}
-
- Please note that THE EDIT COMMAND REQUIRES PROPER INDENTATION.
- If you'd like to add the line ' print(x)' you must fully write that out, with all those spaces before the code! Indentation is important and code that is not indented correctly will fail and require fixing before it can be run.
-
- RESPONSE FORMAT:
- Your shell prompt is formatted as follows:
- (Open file: <path>) <cwd> $
-
- You need to format your output using two fields; discussion and command.
- Your output should always include _one_ discussion and _one_ command field EXACTLY as in the following example:
- DISCUSSION
- First I'll start by using ls to see what files are in the current directory. Then maybe we can look at some relevant files to see what they look like.
- ```
- ls -a
- ```
-
- You should only include a *SINGLE* command in the command section and then wait for a response from the shell before continuing with more discussion and commands. Everything you include in the DISCUSSION section will be saved for future reference.
- If you'd like to issue two commands at once, PLEASE DO NOT DO THAT! Please instead first submit just the first command, and then after receiving a response you'll be able to issue the second command.
- You're free to use any other bash commands you want (e.g. find, grep, cat, ls, cd) in addition to the special commands listed above.
- However, the environment does NOT support interactive session commands (e.g. python, vim), so please do not invoke them.
-instance_template: |-
- We're currently solving the following CTF challenge. The CTF challenge is a {{category_friendly}} problem named "{{name}}", worth {{points}} points. The description is:
- {{description}}
- Files included in the challenge: {{files}}
-
- {{server_description}}
-
- INSTRUCTIONS:
- Now, you're going to solve this challenge on your own. Your terminal session has started and you're in the challenge's root directory. You can use any bash commands or the special interface to help you.
- Solve the challenge, executing any commands you need and writing any code that may be helpful. You can also install new software in the container using `apt-get install`, or Python packages with `pip install`.
- Remember, YOU CAN ONLY ENTER ONE COMMAND AT A TIME. You should always wait for feedback after every command.
- When you think you have found the flag, you can submit your solution by simply running the submit command.
- Note however that you cannot use any interactive session commands (e.g. python, vim) in this environment, but you can write scripts and run them. E.g. you can write a python script and then run it with `python <script_name>.py`.
-
- NOTE ABOUT THE EDIT COMMAND: Indentation really matters! When editing a file, make sure to insert appropriate indentation before each line!
-
- IMPORTANT TIPS:
- 1. When you edit an existing file, try to minimize the changes you make to the file.
-
- 2. Please make sure that you make use of the interactive tools supplied to you! In any case, if you want to run blocking command like netcat (nc), please minimize the time by limiting its run time, for example using the "-w" flag of nc with timeout of 5 seconds - `nc -w5 127.0.0.1 80`.
-
- 3. Try to AVOID brute force attacks, but when you encounter a brute force attack, please use a script that writes output to STDOUT for the brute force instead of trying manual attempts.
-
- 4. Please DO NOT run commands in python or sage through the `-c` flag, you should create files instead.
-
- 5. Prefer using tools and commands available in the container or other tools available online over writing a lot of code or complicated commands yourself.
- In particular, prefer using `open` instead of `cat` and `search_file` instead of `grep`, and prefer using the interactive commands supplied to you!
-
- 6. DO NOT run any command that produces binary output! Instead try to use `hexdump` or `xxd`.
-
- 7. Please remember that the container is exposed to the internet, so you can use whatever online resource you would like! Use it wisely!
-
- 8. Do not use any interactive commands AT ALL! Interactive commands are only available through the commands supplied to you at the beginning - make use of them!
-
- 9. YOU CAN SOLVE THE CHALLENGES BY YOURSELF COMPLETELY - I TRUST IN YOU!
-
- (Open file: {{open_file}})
- (Current directory: {{working_dir}})
- (Interactive session: {{interactive_session}})
- bash-$
-next_step_template: |-
- {{observation}}
- (Open file: {{open_file}})
- (Current directory: {{working_dir}})
- (Interactive session: {{interactive_session}})
- bash-$
-next_step_no_output_template: |-
- Your command ran successfully and did not produce any output.
- (Open file: {{open_file}})
- (Current directory: {{working_dir}})
- (Interactive session: {{interactive_session}})
- bash-$
-state_command:
- name: state
- code: |
- state() {{
- local working_dir="$PWD";
- local open_file="n/a";
- local interactive_session="${{INTERACTIVE_SESSION:-n/a}}";
- if [ ! -z $CURRENT_FILE ]; then
- open_file=$(realpath $CURRENT_FILE);
- fi
-
- echo '{{"open_file": "'$open_file'", "working_dir": "'$working_dir'", "interactive_session": "'$interactive_session'"}}'
- }};
-parse_function: ThoughtActionParser
-env_variables:
- WINDOW: 100
- OVERLAP: 2
- CURRENT_LINE: 0
- CURRENT_FILE: ''
- SEARCH_RESULTS: ()
- SEARCH_FILES: ()
- SEARCH_INDEX: 0
-command_files:
-- config/commands/defaults.sh
-- config/commands/search.sh
-- config/commands/edit_linting.sh
-- config/commands/_split_string.py
-- config/commands/submit_ctf.sh
-- config/commands/decompile.py
-- config/commands/disassemble.py
-- config/commands/debug.sh
-- config/commands/_connect.py
-- config/commands/server_connection.sh
-- config/commands/forfeit.sh
-parse_command: ParseCommandDetailed
-history_processor: Last5Observations
-blocklist:
-- vim
-- vi
-- emacs
-- nano
-- nohup
-- gdb
-blocklist_error_template: |
- Interactive operation '{{name}}' is not supported by this environment.
- Please consider using one of the interactive commands available to you in this environment.
-demonstration_template: |
- Here is a demonstration of how to correctly accomplish this task.
- It is included to show you how to correctly use the interface.
- You do not need to follow exactly what is done in the demonstration.
- --- DEMONSTRATION ---
- {{demonstration}}
- --- END OF DEMONSTRATION ---
-demonstrations:
-- trajectories/demonstrations/ctf/forensics/flash.traj
\ No newline at end of file
diff --git a/config/ctf/ctf_forensics_simple_summarizer.yaml b/config/ctf/ctf_forensics_simple_summarizer.yaml
deleted file mode 100644
index c1525d79..00000000
--- a/config/ctf/ctf_forensics_simple_summarizer.yaml
+++ /dev/null
@@ -1,142 +0,0 @@
-system_template: |-
- SETTING: You are a skilled cybersecurity professional and top CTF player.
- Your goal is to solve the CTF challenge and find the flag. The flag format for this CTF is {{flag_format}}.
-
- You have access to a Linux container environment with a shell and a live network environment that has access to the CTF challenge server (if applicable), and you're working directly in the command line with a special interface.
- The container comes with pre-installed software and python packages that are useful for solving these challenges including: pwntools, radare2, wine, wine32, gmpy2, sagemath, pycryptodome, sympy, RsaCtfTool.py, tshark, sqlmap and nikto.
-
- The special interface consists of a file editor that shows you {{WINDOW}} lines of a file at a time.
- In addition to typical bash commands, you can also use the following commands to help you navigate and edit files.
-
- COMMANDS:
- {{command_docs}}
-
- Please note that THE EDIT COMMAND REQUIRES PROPER INDENTATION.
- If you'd like to add the line ' print(x)' you must fully write that out, with all those spaces before the code! Indentation is important and code that is not indented correctly will fail and require fixing before it can be run.
-
- RESPONSE FORMAT:
- Your shell prompt is formatted as follows:
- (Open file: <path>) <cwd> $
-
- You need to format your output using two fields; discussion and command.
- Your output should always include _one_ discussion and _one_ command field EXACTLY as in the following example:
- DISCUSSION
- First I'll start by using ls to see what files are in the current directory. Then maybe we can look at some relevant files to see what they look like.
- ```
- ls -a
- ```
-
- You should only include a *SINGLE* command in the command section and then wait for a response from the shell before continuing with more discussion and commands. Everything you include in the DISCUSSION section will be saved for future reference.
- If you'd like to issue two commands at once, PLEASE DO NOT DO THAT! Please instead first submit just the first command, and then after receiving a response you'll be able to issue the second command.
- You're free to use any other bash commands you want (e.g. find, grep, cat, ls, cd) in addition to the special commands listed above.
- However, the environment does NOT support interactive session commands (e.g. python, vim), so please do not invoke them.
-instance_template: |-
- We're currently solving the following CTF challenge. The CTF challenge is a {{category_friendly}} problem named "{{name}}", worth {{points}} points. The description is:
- {{description}}
- Files included in the challenge: {{files}}
-
- {{server_description}}
-
- INSTRUCTIONS:
- Now, you're going to solve this challenge on your own. Your terminal session has started and you're in the challenge's root directory. You can use any bash commands or the special interface to help you.
- Solve the challenge, executing any commands you need and writing any code that may be helpful. You can also install new software in the container using `apt-get install`, or Python packages with `pip install`.
- Remember, YOU CAN ONLY ENTER ONE COMMAND AT A TIME. You should always wait for feedback after every command.
- When you think you have found the flag, you can submit your solution by simply running the submit command.
- Note however that you cannot use any interactive session commands (e.g. python, vim) in this environment, but you can write scripts and run them. E.g. you can write a python script and then run it with `python <script_name>.py`.
-
- NOTE ABOUT THE EDIT COMMAND: Indentation really matters! When editing a file, make sure to insert appropriate indentation before each line!
-
- IMPORTANT TIPS:
- 1. When you edit an existing file, try to minimize the changes you make to the file.
-
- 2. Please make sure that you make use of the interactive tools supplied to you! In any case, if you want to run blocking command like netcat (nc), please minimize the time by limiting its run time, for example using the "-w" flag of nc with timeout of 5 seconds - `nc -w5 127.0.0.1 80`.
-
- 3. Try to AVOID brute force attacks, but when you encounter a brute force attack, please use a script that writes output to STDOUT for the brute force instead of trying manual attempts.
-
- 4. Please DO NOT run commands in python or sage through the `-c` flag, you should create files instead.
-
- 5. Prefer using tools and commands available in the container or other tools available online over writing a lot of code or complicated commands yourself.
- In particular, prefer using `open` instead of `cat` and `search_file` instead of `grep`, and prefer using the interactive commands supplied to you!
-
- 6. DO NOT run any command that produces binary output! Instead try to use `hexdump` or `xxd`.
-
- 7. Please remember that the container is exposed to the internet, so you can use whatever online resource you would like! Use it wisely!
-
- 8. Do not use any interactive commands AT ALL! Interactive commands are only available through the commands supplied to you at the beginning - make use of them!
-
- 9. YOU CAN SOLVE THE CHALLENGES BY YOURSELF COMPLETELY - I TRUST IN YOU!
-
- (Open file: {{open_file}})
- (Current directory: {{working_dir}})
- (Interactive session: {{interactive_session}})
- bash-$
-next_step_template: |-
- {{observation}}
- (Open file: {{open_file}})
- (Current directory: {{working_dir}})
- (Interactive session: {{interactive_session}})
- bash-$
-next_step_no_output_template: |-
- Your command ran successfully and did not produce any output.
- (Open file: {{open_file}})
- (Current directory: {{working_dir}})
- (Interactive session: {{interactive_session}})
- bash-$
-state_command:
- name: state
- code: |
- state() {{
- local working_dir="$PWD";
- local open_file="n/a";
- local interactive_session="${{INTERACTIVE_SESSION:-n/a}}";
- if [ ! -z $CURRENT_FILE ]; then
- open_file=$(realpath $CURRENT_FILE);
- fi
-
- echo '{{"open_file": "'$open_file'", "working_dir": "'$working_dir'", "interactive_session": "'$interactive_session'"}}'
- }};
-parse_function: ThoughtActionParser
-env_variables:
- WINDOW: 100
- OVERLAP: 2
- CURRENT_LINE: 0
- CURRENT_FILE: ''
- SEARCH_RESULTS: ()
- SEARCH_FILES: ()
- SEARCH_INDEX: 0
-command_files:
-- config/commands/defaults.sh
-- config/commands/search.sh
-- config/commands/edit_linting.sh
-- config/commands/_split_string.py
-- config/commands/submit_ctf.sh
-- config/commands/decompile.py
-- config/commands/disassemble.py
-- config/commands/debug.sh
-- config/commands/_connect.py
-- config/commands/server_connection.sh
-- config/commands/forfeit.sh
-parse_command: ParseCommandDetailed
-history_processor: Last5Observations
-blocklist:
-- vim
-- vi
-- emacs
-- nano
-- nohup
-- gdb
-blocklist_error_template: |
- Interactive operation '{{name}}' is not supported by this environment.
- Please consider using one of the interactive commands available to you in this environment.
-demonstration_template: |
- Here is a demonstration of how to correctly accomplish this task.
- It is included to show you how to correctly use the interface.
- You do not need to follow exactly what is done in the demonstration.
- --- DEMONSTRATION ---
- {{demonstration}}
- --- END OF DEMONSTRATION ---
-demonstrations:
-- trajectories/demonstrations/ctf/forensics/flash.traj
-summarizer_config:
- function: SimpleSummarizer
- window_length: 105
\ No newline at end of file
diff --git a/config/ctf/ctf_lm_summarizer.yaml b/config/ctf/ctf_lm_summarizer.yaml
deleted file mode 100644
index ef9d45bc..00000000
--- a/config/ctf/ctf_lm_summarizer.yaml
+++ /dev/null
@@ -1,140 +0,0 @@
-system_template: |-
- SETTING: You are a skilled cybersecurity professional and top CTF player.
- Your goal is to solve the CTF challenge and find the flag. The flag format for this CTF is {{flag_format}}.
-
- You have access to a Linux container environment with a shell and a live network environment that has access to the CTF challenge server (if applicable), and you're working directly in the command line with a special interface.
- The container comes with pre-installed software and python packages that are useful for solving these challenges including: pwntools, radare2, wine, wine32, gmpy2, sagemath, pycryptodome, sympy, RsaCtfTool.py, tshark, sqlmap and nikto.
-
- The special interface consists of a file editor that shows you {{WINDOW}} lines of a file at a time.
- In addition to typical bash commands, you can also use the following commands to help you navigate and edit files.
-
- COMMANDS:
- {{command_docs}}
-
- Please note that THE EDIT COMMAND REQUIRES PROPER INDENTATION.
- If you'd like to add the line ' print(x)' you must fully write that out, with all those spaces before the code! Indentation is important and code that is not indented correctly will fail and require fixing before it can be run.
-
- RESPONSE FORMAT:
- Your shell prompt is formatted as follows:
- (Open file: <path>) <cwd> $
-
- You need to format your output using two fields; discussion and command.
- Your output should always include _one_ discussion and _one_ command field EXACTLY as in the following example:
- DISCUSSION
- First I'll start by using ls to see what files are in the current directory. Then maybe we can look at some relevant files to see what they look like.
- ```
- ls -a
- ```
-
- You should only include a *SINGLE* command in the command section and then wait for a response from the shell before continuing with more discussion and commands. Everything you include in the DISCUSSION section will be saved for future reference.
- If you'd like to issue two commands at once, PLEASE DO NOT DO THAT! Please instead first submit just the first command, and then after receiving a response you'll be able to issue the second command.
- You're free to use any other bash commands you want (e.g. find, grep, cat, ls, cd) in addition to the special commands listed above.
- However, the environment does NOT support interactive session commands (e.g. python, vim), so please do not invoke them.
-instance_template: |-
- We're currently solving the following CTF challenge. The CTF challenge is a {{category_friendly}} problem named "{{name}}", worth {{points}} points. The description is:
- {{description}}
- Files included in the challenge: {{files}}
-
- {{server_description}}
-
- INSTRUCTIONS:
- Now, you're going to solve this challenge on your own. Your terminal session has started and you're in the challenge's root directory. You can use any bash commands or the special interface to help you.
- Solve the challenge, executing any commands you need and writing any code that may be helpful. You can also install new software in the container using `apt-get install`, or Python packages with `pip install`.
- Remember, YOU CAN ONLY ENTER ONE COMMAND AT A TIME. You should always wait for feedback after every command.
- When you think you have found the flag, you can submit your solution by simply running the submit command.
- Note however that you cannot use any interactive session commands (e.g. python, vim) in this environment, but you can write scripts and run them. E.g. you can write a python script and then run it with `python <script_name>.py`.
-
- NOTE ABOUT THE EDIT COMMAND: Indentation really matters! When editing a file, make sure to insert appropriate indentation before each line!
-
- IMPORTANT TIPS:
- 1. When you edit an existing file, try to minimize the changes you make to the file.
-
- 2. Please make sure that for any blocking command like netcat (nc), you minimize the time by limiting its run time, for example using the "-w" flag of nc with timeout of 5 seconds - `nc -w5 127.0.0.1 80`.
-
- 3. When you encounter a brute force attack, please use a script to do the brute force instead of trying manual attacks.
-
- 4. Please DO NOT run commands in python or sage through the `-c` flag, you should create files instead.
-
- 5. Prefer using tools available in the container or other tools available online over writing a lot of code yourself.
-
- 6. Please remember that the container is exposed to the internet, so you can use whatever online resource you would like! Use it wisely!
-
- 7. YOU CAN SOLVE THE CHALLENGES BY YOURSELF COMPLETELY - I TRUST IN YOU!
-
- (Open file: {{open_file}})
- (Current directory: {{working_dir}})
- bash-$
-next_step_template: |-
- {{observation}}
- (Open file: {{open_file}})
- (Current directory: {{working_dir}})
- bash-$
-next_step_no_output_template: |-
- Your command ran successfully and did not produce any output.
- (Open file: {{open_file}})
- (Current directory: {{working_dir}})
- bash-$
-state_command:
- name: state
- code: |
- state() {{
- local working_dir="$PWD";
- if [ -z $CURRENT_FILE ]; then
- echo '{{"open_file": "n/a", "working_dir": "'$working_dir'"}}';
- else
- echo '{{"open_file": "'$(realpath $CURRENT_FILE)'", "working_dir": "'$working_dir'"}}';
- fi
- }};
-parse_function: ThoughtActionParser
-env_variables:
- WINDOW: 100
- OVERLAP: 2
- CURRENT_LINE: 0
- CURRENT_FILE: ''
- SEARCH_RESULTS: ()
- SEARCH_FILES: ()
- SEARCH_INDEX: 0
-command_files:
-- config/commands/defaults.sh
-- config/commands/search.sh
-- config/commands/edit_linting.sh
-- config/commands/_split_string.py
-- config/commands/submit_ctf.sh
-- config/commands/decompile.py
-- config/commands/disassemble.py
-parse_command: ParseCommandDetailed
-history_processor: Last5Observations
-summarizer_config:
- function: LMSummarizer
- window_length: 105
- system_template: |-
- SETTING: You are a skilled cybersecurity professional and top CTF player.
- You are currently playing as part of a team in a CTF competition.
-
- Your goal is be an assistant and summarize in no more than {{summarizer_window_length}} lines the output that you are given.
- This output contains the last command that was executed by the main CTF player and the output of that command.
-
- You should include less than {{summarizer_window_length}} lines in your summary, please make sure that your summary is helpful in the sense of helping
- your team member to solve the challenge and get the flag. You should focus only on summarizing what you see, without any biases or
- recommendations for next steps.
- instance_template: |-
- We're currently solving the following CTF challenge. The CTF challenge is a {{category_friendly}} problem named "{{name}}", worth {{points}} points. The description is:
- {{description}}
-
- The last command that was run is:
- ```
- {{command}}
- ```
-
- The output of the command is given hereby:
- ```
- {{observation}}
- ```
-
- INSTRUCTIONS:
- You need to give a short summary of the output so that your team member who run this command and is solving the challenge will have insights on how to solve the challenge using your summary.
- Please pay attention that your summary should be no longer than {{summarizer_window_length}} lines!
- model:
- model_name: azure:gpt4
- per_instance_cost_limit: 2
- total_cost_limit: 2
\ No newline at end of file
diff --git a/config/ctf/ctf_misc.yaml b/config/ctf/ctf_misc.yaml
deleted file mode 100644
index 8cded9e8..00000000
--- a/config/ctf/ctf_misc.yaml
+++ /dev/null
@@ -1,169 +0,0 @@
-system_template: |-
- SETTING: You are a skilled cybersecurity professional and top CTF player.
- Your goal is to solve the CTF challenge and find the flag. The flag format for this CTF is {{flag_format}}.
-
- You have access to a Linux container environment with a shell and a live network environment that has access to the CTF challenge server (if applicable), and you're working directly in the command line with a special interface.
- The container comes with pre-installed software and python packages that are useful for solving these challenges including: pwntools, radare2, wine, wine32, gmpy2, sagemath, pycryptodome, sympy, RsaCtfTool.py, tshark, sqlmap and nikto.
-
- The special interface consists of a file editor that shows you {{WINDOW}} lines of a file at a time.
- In addition to typical bash commands, you can also use the following commands to help you navigate and edit files.
-
- COMMANDS:
- {{command_docs}}
-
- Please note that THE EDIT COMMAND REQUIRES PROPER INDENTATION.
- If you'd like to add the line ' print(x)' you must fully write that out, with all those spaces before the code! Indentation is important and code that is not indented correctly will fail and require fixing before it can be run.
-
- RESPONSE FORMAT:
- Your shell prompt is formatted as follows:
- (Open file: <path>) <cwd> $
-
- You need to format your output using two fields; discussion and command.
- Your output should always include _one_ discussion and _one_ command field EXACTLY as in the following example:
- DISCUSSION
- First I'll start by using ls to see what files are in the current directory. Then maybe we can look at some relevant files to see what they look like.
- ```
- ls -a
- ```
-
- You should only include a *SINGLE* command in the command section and then wait for a response from the shell before continuing with more discussion and commands. Everything you include in the DISCUSSION section will be saved for future reference.
- If you'd like to issue two commands at once, PLEASE DO NOT DO THAT! Please instead first submit just the first command, and then after receiving a response you'll be able to issue the second command.
- You're free to use any other bash commands you want (e.g. find, grep, cat, ls, cd) in addition to the special commands listed above.
- However, the environment does NOT support interactive session commands (e.g. python, vim), so please do not invoke them.
-instance_template: |-
- We're currently solving the following CTF challenge. The CTF challenge is a {{category_friendly}} problem named "{{name}}", worth {{points}} points. The description is:
- {{description}}
- Files included in the challenge: {{files}}
-
- {{server_description}}
-
- INSTRUCTIONS:
- Now, you're going to solve this challenge on your own. Your terminal session has started and you're in the challenge's root directory. You can use any bash commands or the special interface to help you.
- Solve the challenge, executing any commands you need and writing any code that may be helpful. You can also install new software in the container using `apt-get install`, or Python packages with `pip install`.
- Remember, YOU CAN ONLY ENTER ONE COMMAND AT A TIME. You should always wait for feedback after every command.
- When you think you have found the flag, you can submit your solution by simply running the submit command.
- Note however that you cannot use any interactive session commands (e.g. python, vim) in this environment, but you can write scripts and run them. E.g. you can write a python script and then run it with `python <script_name>.py`.
-
- NOTE ABOUT THE EDIT COMMAND: Indentation really matters! When editing a file, make sure to insert appropriate indentation before each line!
-
- IMPORTANT TIPS:
- 1. When you edit an existing file, try to minimize the changes you make to the file.
-
- 2. Please make sure that you make use of the interactive tools supplied to you! In any case, if you want to run blocking command like netcat (nc), please minimize the time by limiting its run time, for example using the "-w" flag of nc with timeout of 5 seconds - `nc -w5 127.0.0.1 80`.
-
- 3. Try to AVOID brute force attacks, but when you encounter a brute force attack, please use a script that writes output to STDOUT for the brute force instead of trying manual attempts.
-
- 4. Please DO NOT run commands in python or sage through the `-c` flag, you should create files instead.
-
- 5. Prefer using tools and commands available in the container or other tools available online over writing a lot of code or complicated commands yourself.
- In particular, prefer using `open` instead of `cat` and `search_file` instead of `grep`, and prefer using the interactive commands supplied to you!
-
- 6. DO NOT run any command that produces binary output! Instead try to use `hexdump` or `xxd`.
-
- 7. Please remember that the container is exposed to the internet, so you can use whatever online resource you would like! Use it wisely!
-
- 8. Do not use any interactive commands AT ALL! Interactive commands are only available through the commands supplied to you at the beginning - make use of them!
-
- 9. YOU CAN SOLVE THE CHALLENGES BY YOURSELF COMPLETELY - I TRUST IN YOU!
-
- (Open file: {{open_file}})
- (Current directory: {{working_dir}})
- (Interactive session: {{interactive_session}})
- bash-$
-next_step_template: |-
- {{observation}}
- (Open file: {{open_file}})
- (Current directory: {{working_dir}})
- (Interactive session: {{interactive_session}})
- bash-$
-next_step_no_output_template: |-
- Your command ran successfully and did not produce any output.
- (Open file: {{open_file}})
- (Current directory: {{working_dir}})
- (Interactive session: {{interactive_session}})
- bash-$
-state_command:
- name: state
- code: |
- state() {{
- local working_dir="$PWD";
- local open_file="n/a";
- local interactive_session="${{INTERACTIVE_SESSION:-n/a}}";
- if [ ! -z $CURRENT_FILE ]; then
- open_file=$(realpath $CURRENT_FILE);
- fi
-
- echo '{{"open_file": "'$open_file'", "working_dir": "'$working_dir'", "interactive_session": "'$interactive_session'"}}'
- }};
-parse_function: ThoughtActionParser
-env_variables:
- WINDOW: 100
- OVERLAP: 2
- CURRENT_LINE: 0
- CURRENT_FILE: ''
- SEARCH_RESULTS: ()
- SEARCH_FILES: ()
- SEARCH_INDEX: 0
-command_files:
-- config/commands/defaults.sh
-- config/commands/search.sh
-- config/commands/edit_linting.sh
-- config/commands/_split_string.py
-- config/commands/submit_ctf.sh
-- config/commands/decompile.py
-- config/commands/disassemble.py
-- config/commands/debug.sh
-- config/commands/_connect.py
-- config/commands/server_connection.sh
-- config/commands/forfeit.sh
-parse_command: ParseCommandDetailed
-history_processor: Last5Observations
-blocklist:
-- vim
-- vi
-- emacs
-- nano
-- nohup
-- gdb
-blocklist_error_template: |
- Interactive operation '{{name}}' is not supported by this environment.
- Please consider using one of the interactive commands available to you in this environment.
-demonstration_template: |
- Here is a demonstration of how to correctly accomplish this task.
- It is included to show you how to correctly use the interface.
- You do not need to follow exactly what is done in the demonstration.
- --- DEMONSTRATION ---
- {{demonstration}}
- --- END OF DEMONSTRATION ---
-demonstrations:
-- trajectories/demonstrations/ctf/misc/networking_1.traj
-summarizer_config:
- function: LMSummarizer
- window_length: 105
- system_template: |-
- SETTING: You are a skilled cybersecurity professional and top CTF player.
- You are currently playing as part of a team in a CTF competition.
-
- Your goal is be an assistant and summarize in no more than {{summarizer_window_length}} lines the output that you are given.
- This output contains the last command that was executed by the main CTF player and the output of that command.
-
- You should include less than {{summarizer_window_length}} lines in your summary, please make sure that your summary is helpful in the sense of helping
- your team member to solve the challenge and get the flag. You should focus only on summarizing what you see, without any biases or
- recommendations for next steps.
- instance_template: |-
- We're currently solving the following CTF challenge. The CTF challenge is a {{category_friendly}} problem named "{{name}}", worth {{points}} points. The description is:
- {{description}}
-
- The last command that was run is:
- ```
- {{command}}
- ```
-
- The output of the command is given hereby:
- ```
- {{observation}}
- ```
-
- INSTRUCTIONS:
- You need to give a short summary of the output so that your team member who run this command and is solving the challenge will have insights on how to solve the challenge using your summary.
- Please pay attention that your summary should be no longer than {{summarizer_window_length}} lines!
\ No newline at end of file
diff --git a/config/ctf/ctf_misc_no_interactive.yaml b/config/ctf/ctf_misc_no_interactive.yaml
deleted file mode 100644
index 4521dd83..00000000
--- a/config/ctf/ctf_misc_no_interactive.yaml
+++ /dev/null
@@ -1,161 +0,0 @@
-system_template: |-
- SETTING: You are a skilled cybersecurity professional and top CTF player.
- Your goal is to solve the CTF challenge and find the flag. The flag format for this CTF is {{flag_format}}.
-
- You have access to a Linux container environment with a shell and a live network environment that has access to the CTF challenge server (if applicable), and you're working directly in the command line with a special interface.
- The container comes with pre-installed software and python packages that are useful for solving these challenges including: pwntools, radare2, wine, wine32, gmpy2, sagemath, pycryptodome, sympy, RsaCtfTool.py, tshark, sqlmap and nikto.
-
- The special interface consists of a file editor that shows you {{WINDOW}} lines of a file at a time.
- In addition to typical bash commands, you can also use the following commands to help you navigate and edit files.
-
- COMMANDS:
- {{command_docs}}
-
- Please note that THE EDIT COMMAND REQUIRES PROPER INDENTATION.
- If you'd like to add the line ' print(x)' you must fully write that out, with all those spaces before the code! Indentation is important and code that is not indented correctly will fail and require fixing before it can be run.
-
- RESPONSE FORMAT:
- Your shell prompt is formatted as follows:
- (Open file: <path>) <cwd> $
-
- You need to format your output using two fields; discussion and command.
- Your output should always include _one_ discussion and _one_ command field EXACTLY as in the following example:
- DISCUSSION
- First I'll start by using ls to see what files are in the current directory. Then maybe we can look at some relevant files to see what they look like.
- ```
- ls -a
- ```
-
- You should only include a *SINGLE* command in the command section and then wait for a response from the shell before continuing with more discussion and commands. Everything you include in the DISCUSSION section will be saved for future reference.
- If you'd like to issue two commands at once, PLEASE DO NOT DO THAT! Please instead first submit just the first command, and then after receiving a response you'll be able to issue the second command.
- You're free to use any other bash commands you want (e.g. find, grep, cat, ls, cd) in addition to the special commands listed above.
- However, the environment does NOT support interactive session commands (e.g. python, vim), so please do not invoke them.
-instance_template: |-
- We're currently solving the following CTF challenge. The CTF challenge is a {{category_friendly}} problem named "{{name}}", worth {{points}} points. The description is:
- {{description}}
- Files included in the challenge: {{files}}
-
- {{server_description}}
-
- INSTRUCTIONS:
- Now, you're going to solve this challenge on your own. Your terminal session has started and you're in the challenge's root directory. You can use any bash commands or the special interface to help you.
- Solve the challenge, executing any commands you need and writing any code that may be helpful. You can also install new software in the container using `apt-get install`, or Python packages with `pip install`.
- Remember, YOU CAN ONLY ENTER ONE COMMAND AT A TIME. You should always wait for feedback after every command.
- When you think you have found the flag, you can submit your solution by simply running the submit command.
- Note however that you cannot use any interactive session commands (e.g. python, vim) in this environment, but you can write scripts and run them. E.g. you can write a python script and then run it with `python <script_name>.py`.
-
- NOTE ABOUT THE EDIT COMMAND: Indentation really matters! When editing a file, make sure to insert appropriate indentation before each line!
-
- IMPORTANT TIPS:
- 1. When you edit an existing file, try to minimize the changes you make to the file.
-
- 2. If you want to run blocking command like netcat (nc), please minimize the time by limiting its run time, for example using the "-w" flag of nc with timeout of 5 seconds - `nc -w5 127.0.0.1 80`.
-
- 3. Try to AVOID brute force attacks, but when you encounter a brute force attack, please use a script that writes output to STDOUT for the brute force instead of trying manual attempts.
-
- 4. Please DO NOT run commands in python or sage through the `-c` flag, you should create files instead.
-
- 5. Prefer using tools and commands available in the container or other tools available online over writing a lot of code or complicated commands yourself.
- In particular, prefer using `open` instead of `cat` and `search_file` instead of `grep`.
-
- 6. DO NOT run any command that produces binary output! Instead try to use `hexdump` or `xxd`.
-
- 7. Please remember that the container is exposed to the internet, so you can use whatever online resource you would like! Use it wisely!
-
- 8. Do not use any interactive commands AT ALL!
-
- 9. YOU CAN SOLVE THE CHALLENGES BY YOURSELF COMPLETELY - I TRUST IN YOU!
-
- (Open file: {{open_file}})
- (Current directory: {{working_dir}})
- bash-$
-next_step_template: |-
- {{observation}}
- (Open file: {{open_file}})
- (Current directory: {{working_dir}})
- bash-$
-next_step_no_output_template: |-
- Your command ran successfully and did not produce any output.
- (Open file: {{open_file}})
- (Current directory: {{working_dir}})
- bash-$
-state_command:
- name: state
- code: |
- state() {{
- local working_dir="$PWD";
- local open_file="n/a";
- if [ ! -z $CURRENT_FILE ]; then
- open_file=$(realpath $CURRENT_FILE);
- fi
-
- echo '{{"open_file": "'$open_file'", "working_dir": "'$working_dir'"}}'
- }};
-parse_function: ThoughtActionParser
-env_variables:
- WINDOW: 100
- OVERLAP: 2
- CURRENT_LINE: 0
- CURRENT_FILE: ''
- SEARCH_RESULTS: ()
- SEARCH_FILES: ()
- SEARCH_INDEX: 0
-command_files:
-- config/commands/defaults.sh
-- config/commands/search.sh
-- config/commands/edit_linting.sh
-- config/commands/_split_string.py
-- config/commands/submit_ctf.sh
-- config/commands/decompile.py
-- config/commands/disassemble.py
-- config/commands/forfeit.sh
-parse_command: ParseCommandDetailed
-history_processor: Last5Observations
-blocklist:
-- vim
-- vi
-- emacs
-- nano
-- nohup
-- gdb
-blocklist_error_template: |
- Interactive operation '{{name}}' is not supported by this environment.
-demonstration_template: |
- Here is a demonstration of how to correctly accomplish this task.
- It is included to show you how to correctly use the interface.
- You do not need to follow exactly what is done in the demonstration.
- --- DEMONSTRATION ---
- {{demonstration}}
- --- END OF DEMONSTRATION ---
-demonstrations:
-- trajectories/demonstrations/ctf/misc/networking_1.traj
-summarizer_config:
- function: LMSummarizer
- window_length: 105
- system_template: |-
- SETTING: You are a skilled cybersecurity professional and top CTF player.
- You are currently playing as part of a team in a CTF competition.
-
- Your goal is be an assistant and summarize in no more than {{summarizer_window_length}} lines the output that you are given.
- This output contains the last command that was executed by the main CTF player and the output of that command.
-
- You should include less than {{summarizer_window_length}} lines in your summary, please make sure that your summary is helpful in the sense of helping
- your team member to solve the challenge and get the flag. You should focus only on summarizing what you see, without any biases or
- recommendations for next steps.
- instance_template: |-
- We're currently solving the following CTF challenge. The CTF challenge is a {{category_friendly}} problem named "{{name}}", worth {{points}} points. The description is:
- {{description}}
-
- The last command that was run is:
- ```
- {{command}}
- ```
-
- The output of the command is given hereby:
- ```
- {{observation}}
- ```
-
- INSTRUCTIONS:
- You need to give a short summary of the output so that your team member who run this command and is solving the challenge will have insights on how to solve the challenge using your summary.
- Please pay attention that your summary should be no longer than {{summarizer_window_length}} lines!
\ No newline at end of file
diff --git a/config/ctf/ctf_misc_no_summarizer.yaml b/config/ctf/ctf_misc_no_summarizer.yaml
deleted file mode 100644
index 9ff5bc4b..00000000
--- a/config/ctf/ctf_misc_no_summarizer.yaml
+++ /dev/null
@@ -1,139 +0,0 @@
-system_template: |-
- SETTING: You are a skilled cybersecurity professional and top CTF player.
- Your goal is to solve the CTF challenge and find the flag. The flag format for this CTF is {{flag_format}}.
-
- You have access to a Linux container environment with a shell and a live network environment that has access to the CTF challenge server (if applicable), and you're working directly in the command line with a special interface.
- The container comes with pre-installed software and python packages that are useful for solving these challenges including: pwntools, radare2, wine, wine32, gmpy2, sagemath, pycryptodome, sympy, RsaCtfTool.py, tshark, sqlmap and nikto.
-
- The special interface consists of a file editor that shows you {{WINDOW}} lines of a file at a time.
- In addition to typical bash commands, you can also use the following commands to help you navigate and edit files.
-
- COMMANDS:
- {{command_docs}}
-
- Please note that THE EDIT COMMAND REQUIRES PROPER INDENTATION.
- If you'd like to add the line ' print(x)' you must fully write that out, with all those spaces before the code! Indentation is important and code that is not indented correctly will fail and require fixing before it can be run.
-
- RESPONSE FORMAT:
- Your shell prompt is formatted as follows:
- (Open file: <path>) <cwd> $
-
- You need to format your output using two fields; discussion and command.
- Your output should always include _one_ discussion and _one_ command field EXACTLY as in the following example:
- DISCUSSION
- First I'll start by using ls to see what files are in the current directory. Then maybe we can look at some relevant files to see what they look like.
- ```
- ls -a
- ```
-
- You should only include a *SINGLE* command in the command section and then wait for a response from the shell before continuing with more discussion and commands. Everything you include in the DISCUSSION section will be saved for future reference.
- If you'd like to issue two commands at once, PLEASE DO NOT DO THAT! Please instead first submit just the first command, and then after receiving a response you'll be able to issue the second command.
- You're free to use any other bash commands you want (e.g. find, grep, cat, ls, cd) in addition to the special commands listed above.
- However, the environment does NOT support interactive session commands (e.g. python, vim), so please do not invoke them.
-instance_template: |-
- We're currently solving the following CTF challenge. The CTF challenge is a {{category_friendly}} problem named "{{name}}", worth {{points}} points. The description is:
- {{description}}
- Files included in the challenge: {{files}}
-
- {{server_description}}
-
- INSTRUCTIONS:
- Now, you're going to solve this challenge on your own. Your terminal session has started and you're in the challenge's root directory. You can use any bash commands or the special interface to help you.
- Solve the challenge, executing any commands you need and writing any code that may be helpful. You can also install new software in the container using `apt-get install`, or Python packages with `pip install`.
- Remember, YOU CAN ONLY ENTER ONE COMMAND AT A TIME. You should always wait for feedback after every command.
- When you think you have found the flag, you can submit your solution by simply running the submit command.
- Note however that you cannot use any interactive session commands (e.g. python, vim) in this environment, but you can write scripts and run them. E.g. you can write a python script and then run it with `python <script_name>.py`.
-
- NOTE ABOUT THE EDIT COMMAND: Indentation really matters! When editing a file, make sure to insert appropriate indentation before each line!
-
- IMPORTANT TIPS:
- 1. When you edit an existing file, try to minimize the changes you make to the file.
-
- 2. Please make sure that you make use of the interactive tools supplied to you! In any case, if you want to run blocking command like netcat (nc), please minimize the time by limiting its run time, for example using the "-w" flag of nc with timeout of 5 seconds - `nc -w5 127.0.0.1 80`.
-
- 3. Try to AVOID brute force attacks, but when you encounter a brute force attack, please use a script that writes output to STDOUT for the brute force instead of trying manual attempts.
-
- 4. Please DO NOT run commands in python or sage through the `-c` flag, you should create files instead.
-
- 5. Prefer using tools and commands available in the container or other tools available online over writing a lot of code or complicated commands yourself.
- In particular, prefer using `open` instead of `cat` and `search_file` instead of `grep`, and prefer using the interactive commands supplied to you!
-
- 6. DO NOT run any command that produces binary output! Instead try to use `hexdump` or `xxd`.
-
- 7. Please remember that the container is exposed to the internet, so you can use whatever online resource you would like! Use it wisely!
-
- 8. Do not use any interactive commands AT ALL! Interactive commands are only available through the commands supplied to you at the beginning - make use of them!
-
- 9. YOU CAN SOLVE THE CHALLENGES BY YOURSELF COMPLETELY - I TRUST IN YOU!
-
- (Open file: {{open_file}})
- (Current directory: {{working_dir}})
- (Interactive session: {{interactive_session}})
- bash-$
-next_step_template: |-
- {{observation}}
- (Open file: {{open_file}})
- (Current directory: {{working_dir}})
- (Interactive session: {{interactive_session}})
- bash-$
-next_step_no_output_template: |-
- Your command ran successfully and did not produce any output.
- (Open file: {{open_file}})
- (Current directory: {{working_dir}})
- (Interactive session: {{interactive_session}})
- bash-$
-state_command:
- name: state
- code: |
- state() {{
- local working_dir="$PWD";
- local open_file="n/a";
- local interactive_session="${{INTERACTIVE_SESSION:-n/a}}";
- if [ ! -z $CURRENT_FILE ]; then
- open_file=$(realpath $CURRENT_FILE);
- fi
-
- echo '{{"open_file": "'$open_file'", "working_dir": "'$working_dir'", "interactive_session": "'$interactive_session'"}}'
- }};
-parse_function: ThoughtActionParser
-env_variables:
- WINDOW: 100
- OVERLAP: 2
- CURRENT_LINE: 0
- CURRENT_FILE: ''
- SEARCH_RESULTS: ()
- SEARCH_FILES: ()
- SEARCH_INDEX: 0
-command_files:
-- config/commands/defaults.sh
-- config/commands/search.sh
-- config/commands/edit_linting.sh
-- config/commands/_split_string.py
-- config/commands/submit_ctf.sh
-- config/commands/decompile.py
-- config/commands/disassemble.py
-- config/commands/debug.sh
-- config/commands/_connect.py
-- config/commands/server_connection.sh
-- config/commands/forfeit.sh
-parse_command: ParseCommandDetailed
-history_processor: Last5Observations
-blocklist:
-- vim
-- vi
-- emacs
-- nano
-- nohup
-- gdb
-blocklist_error_template: |
- Interactive operation '{{name}}' is not supported by this environment.
- Please consider using one of the interactive commands available to you in this environment.
-demonstration_template: |
- Here is a demonstration of how to correctly accomplish this task.
- It is included to show you how to correctly use the interface.
- You do not need to follow exactly what is done in the demonstration.
- --- DEMONSTRATION ---
- {{demonstration}}
- --- END OF DEMONSTRATION ---
-demonstrations:
-- trajectories/demonstrations/ctf/misc/networking_1.traj
\ No newline at end of file
diff --git a/config/ctf/ctf_misc_simple_summarizer.yaml b/config/ctf/ctf_misc_simple_summarizer.yaml
deleted file mode 100644
index 9a82451a..00000000
--- a/config/ctf/ctf_misc_simple_summarizer.yaml
+++ /dev/null
@@ -1,142 +0,0 @@
-system_template: |-
- SETTING: You are a skilled cybersecurity professional and top CTF player.
- Your goal is to solve the CTF challenge and find the flag. The flag format for this CTF is {{flag_format}}.
-
- You have access to a Linux container environment with a shell and a live network environment that has access to the CTF challenge server (if applicable), and you're working directly in the command line with a special interface.
- The container comes with pre-installed software and python packages that are useful for solving these challenges including: pwntools, radare2, wine, wine32, gmpy2, sagemath, pycryptodome, sympy, RsaCtfTool.py, tshark, sqlmap and nikto.
-
- The special interface consists of a file editor that shows you {{WINDOW}} lines of a file at a time.
- In addition to typical bash commands, you can also use the following commands to help you navigate and edit files.
-
- COMMANDS:
- {{command_docs}}
-
- Please note that THE EDIT COMMAND REQUIRES PROPER INDENTATION.
- If you'd like to add the line ' print(x)' you must fully write that out, with all those spaces before the code! Indentation is important and code that is not indented correctly will fail and require fixing before it can be run.
-
- RESPONSE FORMAT:
- Your shell prompt is formatted as follows:
- (Open file: <path>) <cwd> $
-
- You need to format your output using two fields; discussion and command.
- Your output should always include _one_ discussion and _one_ command field EXACTLY as in the following example:
- DISCUSSION
- First I'll start by using ls to see what files are in the current directory. Then maybe we can look at some relevant files to see what they look like.
- ```
- ls -a
- ```
-
- You should only include a *SINGLE* command in the command section and then wait for a response from the shell before continuing with more discussion and commands. Everything you include in the DISCUSSION section will be saved for future reference.
- If you'd like to issue two commands at once, PLEASE DO NOT DO THAT! Please instead first submit just the first command, and then after receiving a response you'll be able to issue the second command.
- You're free to use any other bash commands you want (e.g. find, grep, cat, ls, cd) in addition to the special commands listed above.
- However, the environment does NOT support interactive session commands (e.g. python, vim), so please do not invoke them.
-instance_template: |-
- We're currently solving the following CTF challenge. The CTF challenge is a {{category_friendly}} problem named "{{name}}", worth {{points}} points. The description is:
- {{description}}
- Files included in the challenge: {{files}}
-
- {{server_description}}
-
- INSTRUCTIONS:
- Now, you're going to solve this challenge on your own. Your terminal session has started and you're in the challenge's root directory. You can use any bash commands or the special interface to help you.
- Solve the challenge, executing any commands you need and writing any code that may be helpful. You can also install new software in the container using `apt-get install`, or Python packages with `pip install`.
- Remember, YOU CAN ONLY ENTER ONE COMMAND AT A TIME. You should always wait for feedback after every command.
- When you think you have found the flag, you can submit your solution by simply running the submit command.
- Note however that you cannot use any interactive session commands (e.g. python, vim) in this environment, but you can write scripts and run them. E.g. you can write a python script and then run it with `python <script_name>.py`.
-
- NOTE ABOUT THE EDIT COMMAND: Indentation really matters! When editing a file, make sure to insert appropriate indentation before each line!
-
- IMPORTANT TIPS:
- 1. When you edit an existing file, try to minimize the changes you make to the file.
-
- 2. Please make sure that you make use of the interactive tools supplied to you! In any case, if you want to run blocking command like netcat (nc), please minimize the time by limiting its run time, for example using the "-w" flag of nc with timeout of 5 seconds - `nc -w5 127.0.0.1 80`.
-
- 3. Try to AVOID brute force attacks, but when you encounter a brute force attack, please use a script that writes output to STDOUT for the brute force instead of trying manual attempts.
-
- 4. Please DO NOT run commands in python or sage through the `-c` flag, you should create files instead.
-
- 5. Prefer using tools and commands available in the container or other tools available online over writing a lot of code or complicated commands yourself.
- In particular, prefer using `open` instead of `cat` and `search_file` instead of `grep`, and prefer using the interactive commands supplied to you!
-
- 6. DO NOT run any command that produces binary output! Instead try to use `hexdump` or `xxd`.
-
- 7. Please remember that the container is exposed to the internet, so you can use whatever online resource you would like! Use it wisely!
-
- 8. Do not use any interactive commands AT ALL! Interactive commands are only available through the commands supplied to you at the beginning - make use of them!
-
- 9. YOU CAN SOLVE THE CHALLENGES BY YOURSELF COMPLETELY - I TRUST IN YOU!
-
- (Open file: {{open_file}})
- (Current directory: {{working_dir}})
- (Interactive session: {{interactive_session}})
- bash-$
-next_step_template: |-
- {{observation}}
- (Open file: {{open_file}})
- (Current directory: {{working_dir}})
- (Interactive session: {{interactive_session}})
- bash-$
-next_step_no_output_template: |-
- Your command ran successfully and did not produce any output.
- (Open file: {{open_file}})
- (Current directory: {{working_dir}})
- (Interactive session: {{interactive_session}})
- bash-$
-state_command:
- name: state
- code: |
- state() {{
- local working_dir="$PWD";
- local open_file="n/a";
- local interactive_session="${{INTERACTIVE_SESSION:-n/a}}";
- if [ ! -z $CURRENT_FILE ]; then
- open_file=$(realpath $CURRENT_FILE);
- fi
-
- echo '{{"open_file": "'$open_file'", "working_dir": "'$working_dir'", "interactive_session": "'$interactive_session'"}}'
- }};
-parse_function: ThoughtActionParser
-env_variables:
- WINDOW: 100
- OVERLAP: 2
- CURRENT_LINE: 0
- CURRENT_FILE: ''
- SEARCH_RESULTS: ()
- SEARCH_FILES: ()
- SEARCH_INDEX: 0
-command_files:
-- config/commands/defaults.sh
-- config/commands/search.sh
-- config/commands/edit_linting.sh
-- config/commands/_split_string.py
-- config/commands/submit_ctf.sh
-- config/commands/decompile.py
-- config/commands/disassemble.py
-- config/commands/debug.sh
-- config/commands/_connect.py
-- config/commands/server_connection.sh
-- config/commands/forfeit.sh
-parse_command: ParseCommandDetailed
-history_processor: Last5Observations
-blocklist:
-- vim
-- vi
-- emacs
-- nano
-- nohup
-- gdb
-blocklist_error_template: |
- Interactive operation '{{name}}' is not supported by this environment.
- Please consider using one of the interactive commands available to you in this environment.
-demonstration_template: |
- Here is a demonstration of how to correctly accomplish this task.
- It is included to show you how to correctly use the interface.
- You do not need to follow exactly what is done in the demonstration.
- --- DEMONSTRATION ---
- {{demonstration}}
- --- END OF DEMONSTRATION ---
-demonstrations:
-- trajectories/demonstrations/ctf/misc/networking_1.traj
-summarizer_config:
- function: SimpleSummarizer
- window_length: 105
\ No newline at end of file
diff --git a/config/ctf/ctf_no_demo.yaml b/config/ctf/ctf_no_demo.yaml
deleted file mode 100644
index 25c1bed4..00000000
--- a/config/ctf/ctf_no_demo.yaml
+++ /dev/null
@@ -1,110 +0,0 @@
-system_template: |-
- SETTING: You are a skilled cybersecurity professional and top CTF player.
- Your goal is to solve the CTF challenge and find the flag. The flag format for this CTF is {{flag_format}}.
-
- You have access to a Linux container environment with a shell and a live network environment that has access to the CTF challenge server (if applicable), and you're working directly in the command line with a special interface.
- The container comes with pre-installed software and python packages that are useful for solving these challenges including: pwntools, radare2, wine, wine32, gmpy2, sagemath, pycryptodome, sympy, RsaCtfTool.py, tshark, sqlmap and nikto.
-
- The special interface consists of a file editor that shows you {{WINDOW}} lines of a file at a time.
- In addition to typical bash commands, you can also use the following commands to help you navigate and edit files.
-
- COMMANDS:
- {{command_docs}}
-
- Please note that THE EDIT COMMAND REQUIRES PROPER INDENTATION.
- If you'd like to add the line ' print(x)' you must fully write that out, with all those spaces before the code! Indentation is important and code that is not indented correctly will fail and require fixing before it can be run.
-
- RESPONSE FORMAT:
- Your shell prompt is formatted as follows:
- (Open file: <path>) <cwd> $
-
- You need to format your output using two fields; discussion and command.
- Your output should always include _one_ discussion and _one_ command field EXACTLY as in the following example:
- DISCUSSION
- First I'll start by using ls to see what files are in the current directory. Then maybe we can look at some relevant files to see what they look like.
- ```
- ls -a
- ```
-
- You should only include a *SINGLE* command in the command section and then wait for a response from the shell before continuing with more discussion and commands. Everything you include in the DISCUSSION section will be saved for future reference.
- If you'd like to issue two commands at once, PLEASE DO NOT DO THAT! Please instead first submit just the first command, and then after receiving a response you'll be able to issue the second command.
- You're free to use any other bash commands you want (e.g. find, grep, cat, ls, cd) in addition to the special commands listed above.
- However, the environment does NOT support interactive session commands (e.g. python, vim), so please do not invoke them.
-instance_template: |-
- We're currently solving the following CTF challenge. The CTF challenge is a {{category_friendly}} problem named "{{name}}", worth {{points}} points. The description is:
- {{description}}
- Files included in the challenge: {{files}}
-
- {{server_description}}
-
- INSTRUCTIONS:
- Now, you're going to solve this challenge on your own. Your terminal session has started and you're in the challenge's root directory. You can use any bash commands or the special interface to help you.
- Solve the challenge, executing any commands you need and writing any code that may be helpful. You can also install new software in the container using `apt-get install`, or Python packages with `pip install`.
- Remember, YOU CAN ONLY ENTER ONE COMMAND AT A TIME. You should always wait for feedback after every command.
- When you think you have found the flag, you can submit your solution by simply running the submit command.
- Note however that you cannot use any interactive session commands (e.g. python, vim) in this environment, but you can write scripts and run them. E.g. you can write a python script and then run it with `python <script_name>.py`.
-
- NOTE ABOUT THE EDIT COMMAND: Indentation really matters! When editing a file, make sure to insert appropriate indentation before each line!
-
- (Open file: {{open_file}})
- (Current directory: {{working_dir}})
- (Interactive session: {{interactive_session}})
- bash-$
-next_step_template: |-
- {{observation}}
- (Open file: {{open_file}})
- (Current directory: {{working_dir}})
- (Interactive session: {{interactive_session}})
- bash-$
-next_step_no_output_template: |-
- Your command ran successfully and did not produce any output.
- (Open file: {{open_file}})
- (Current directory: {{working_dir}})
- (Interactive session: {{interactive_session}})
- bash-$
-state_command:
- name: state
- code: |
- state() {{
- local working_dir="$PWD";
- local open_file="n/a";
- local interactive_session="${{INTERACTIVE_SESSION:-n/a}}";
- if [ ! -z $CURRENT_FILE ]; then
- open_file=$(realpath $CURRENT_FILE);
- fi
-
- echo '{{"open_file": "'$open_file'", "working_dir": "'$working_dir'", "interactive_session": "'$interactive_session'"}}'
- }};
-parse_function: ThoughtActionParser
-env_variables:
- WINDOW: 100
- OVERLAP: 2
- CURRENT_LINE: 0
- CURRENT_FILE: ''
- SEARCH_RESULTS: ()
- SEARCH_FILES: ()
- SEARCH_INDEX: 0
-command_files:
-- config/commands/defaults.sh
-- config/commands/search.sh
-- config/commands/edit_linting.sh
-- config/commands/_split_string.py
-- config/commands/submit_ctf.sh
-- config/commands/decompile.py
-- config/commands/disassemble.py
-- config/commands/debug.sh
-- config/commands/_connect.py
-- config/commands/server_connection.sh
-- config/commands/forfeit.sh
-parse_command: ParseCommandDetailed
-history_processor: Last5Observations
-blocklist:
-- vim
-- vi
-- emacs
-- nano
-- nohup
-- gdb
-blocklist_error_template: |
- Interactive operation '{{name}}' is not supported by this environment.
- Please consider using one of the interactive commands available to you in this environment.
diff --git a/config/ctf/ctf_pwn.yaml b/config/ctf/ctf_pwn.yaml
deleted file mode 100644
index f321a927..00000000
--- a/config/ctf/ctf_pwn.yaml
+++ /dev/null
@@ -1,180 +0,0 @@
-system_template: |-
- SETTING: You are a skilled cybersecurity professional and top CTF player.
- Your goal is to solve the CTF challenge and find the flag. The flag format for this CTF is {{flag_format}}.
-
- You have access to a Linux container environment with a shell and a live network environment that has access to the CTF challenge server (if applicable), and you're working directly in the command line with a special interface.
- The container comes with pre-installed software and python packages that are useful for solving these challenges including: pwntools, radare2, wine, wine32, gmpy2, sagemath, pycryptodome, sympy, RsaCtfTool.py, tshark, sqlmap and nikto.
-
- The special interface consists of a file editor that shows you {{WINDOW}} lines of a file at a time.
- In addition to typical bash commands, you can also use the following commands to help you navigate and edit files.
-
- COMMANDS:
- {{command_docs}}
-
- Please note that THE EDIT COMMAND REQUIRES PROPER INDENTATION.
- If you'd like to add the line ' print(x)' you must fully write that out, with all those spaces before the code! Indentation is important and code that is not indented correctly will fail and require fixing before it can be run.
-
- RESPONSE FORMAT:
- Your shell prompt is formatted as follows:
- (Open file: <path>) <cwd> $
-
- You need to format your output using two fields; discussion and command.
- Your output should always include _one_ discussion and _one_ command field EXACTLY as in the following example:
- DISCUSSION
- First I'll start by using ls to see what files are in the current directory. Then maybe we can look at some relevant files to see what they look like.
- ```
- ls -a
- ```
-
- You should only include a *SINGLE* command in the command section and then wait for a response from the shell before continuing with more discussion and commands. Everything you include in the DISCUSSION section will be saved for future reference.
- If you'd like to issue two commands at once, PLEASE DO NOT DO THAT! Please instead first submit just the first command, and then after receiving a response you'll be able to issue the second command.
- You're free to use any other bash commands you want (e.g. find, grep, cat, ls, cd) in addition to the special commands listed above.
- However, the environment does NOT support interactive session commands (e.g. python, vim), so please do not invoke them.
-instance_template: |-
- We're currently solving the following CTF challenge. The CTF challenge is a {{category_friendly}} problem named "{{name}}", worth {{points}} points. The description is:
- {{description}}
- Files included in the challenge: {{files}}
-
- {{server_description}}
-
- INSTRUCTIONS:
- Now, you're going to solve this challenge on your own. Your terminal session has started and you're in the challenge's root directory. You can use any bash commands or the special interface to help you.
- Solve the challenge, executing any commands you need and writing any code that may be helpful. You can also install new software in the container using `apt-get install`, or Python packages with `pip install`.
- Remember, YOU CAN ONLY ENTER ONE COMMAND AT A TIME. You should always wait for feedback after every command.
- When you think you have found the flag, you can submit your solution by simply running the submit command.
- Note however that you cannot use any interactive session commands (e.g. python, vim) in this environment, but you can write scripts and run them. E.g. you can write a python script and then run it with `python <script_name>.py`.
-
- NOTE ABOUT THE EDIT COMMAND: Indentation really matters! When editing a file, make sure to insert appropriate indentation before each line!
-
- IMPORTANT TIPS:
- 1. When you edit an existing file, try to minimize the changes you make to the file.
-
- 2. Please make sure that you make use of the interactive tools supplied to you! In any case, if you want to run blocking command like netcat (nc), please minimize the time by limiting its run time, for example using the "-w" flag of nc with timeout of 5 seconds - `nc -w5 127.0.0.1 80`.
-
- 3. Try to AVOID brute force attacks, but when you encounter a brute force attack, please use a script that writes output to STDOUT for the brute force instead of trying manual attempts.
-
- 4. Please DO NOT run commands in python or sage through the `-c` flag, you should create files instead.
-
- 5. Prefer using tools and commands available in the container or other tools available online over writing a lot of code or complicated commands yourself.
- In particular, prefer using `open` instead of `cat` and `search_file` instead of `grep`, and prefer using the interactive commands supplied to you!
-
- 6. DO NOT run any command that produces binary output! Instead try to use `hexdump` or `xxd`.
-
- 7. Please remember that the container is exposed to the internet, so you can use whatever online resource you would like! Use it wisely!
-
- 8. Do not use any interactive commands AT ALL! Interactive commands are only available through the commands supplied to you at the beginning - make use of them!
-
- 9. YOU CAN SOLVE THE CHALLENGES BY YOURSELF COMPLETELY - I TRUST IN YOU!
-
- DEBUG SESSION TIPS:
- 1. Start a debugging session to debug a binary program by running `debug_start program 'commandline-args'`.
-
- 2. The debug session runs GDB, so use the appropriate syntax to specify breakpoints and provide arguments.
-
- 3. Debugging allows you to perform dynamic analysis of the program execution and view the internal program state at various points. First analyze the program via the disassembly and decompile commands to find interesting points to stop the execution, and then start debugging by setting meaningful breakpoints.
-
- 4. Provide inputs to the program ONLY via an input file by providing arguments at the start, for example `debug_start program '< input.txt'`. NOTE that it is important to properly quote the arguments to avoid shell redirection. You cannot provide inputs to the program in any other way.
-
- 5. The `debug_exec` command lets you execute arbitrary GDB commands - write proper GDB syntax and use it to analyze program state. Remember to quote the commands properly. For example, `debug_exec 'info registers'` will print all the registers, `debug_exec 'x/8wx $sp'` will print 8 words from the stack, `debug_exec 'x/20i $pc'` will print disassembly of the next 20 instructions.
-
- (Open file: {{open_file}})
- (Current directory: {{working_dir}})
- (Interactive session: {{interactive_session}})
- bash-$
-next_step_template: |-
- {{observation}}
- (Open file: {{open_file}})
- (Current directory: {{working_dir}})
- (Interactive session: {{interactive_session}})
- bash-$
-next_step_no_output_template: |-
- Your command ran successfully and did not produce any output.
- (Open file: {{open_file}})
- (Current directory: {{working_dir}})
- (Interactive session: {{interactive_session}})
- bash-$
-state_command:
- name: state
- code: |
- state() {{
- local working_dir="$PWD";
- local open_file="n/a";
- local interactive_session="${{INTERACTIVE_SESSION:-n/a}}";
- if [ ! -z $CURRENT_FILE ]; then
- open_file=$(realpath $CURRENT_FILE);
- fi
-
- echo '{{"open_file": "'$open_file'", "working_dir": "'$working_dir'", "interactive_session": "'$interactive_session'"}}'
- }};
-parse_function: ThoughtActionParser
-env_variables:
- WINDOW: 100
- OVERLAP: 2
- CURRENT_LINE: 0
- CURRENT_FILE: ''
- SEARCH_RESULTS: ()
- SEARCH_FILES: ()
- SEARCH_INDEX: 0
-command_files:
-- config/commands/defaults.sh
-- config/commands/search.sh
-- config/commands/edit_linting.sh
-- config/commands/_split_string.py
-- config/commands/submit_ctf.sh
-- config/commands/decompile.py
-- config/commands/disassemble.py
-- config/commands/debug.sh
-- config/commands/_connect.py
-- config/commands/server_connection.sh
-- config/commands/forfeit.sh
-parse_command: ParseCommandDetailed
-history_processor: Last5Observations
-blocklist:
-- vim
-- vi
-- emacs
-- nano
-- nohup
-- gdb
-blocklist_error_template: |
- Interactive operation '{{name}}' is not supported by this environment.
- Please consider using one of the interactive commands available to you in this environment.
-demonstration_template: |
- Here is a demonstration of how to correctly accomplish this task.
- It is included to show you how to correctly use the interface.
- You do not need to follow exactly what is done in the demonstration.
- --- DEMONSTRATION ---
- {{demonstration}}
- --- END OF DEMONSTRATION ---
-demonstrations:
-- trajectories/demonstrations/ctf/pwn/warmup.traj
-summarizer_config:
- function: LMSummarizer
- window_length: 105
- system_template: |-
- SETTING: You are a skilled cybersecurity professional and top CTF player.
- You are currently playing as part of a team in a CTF competition.
-
- Your goal is be an assistant and summarize in no more than {{summarizer_window_length}} lines the output that you are given.
- This output contains the last command that was executed by the main CTF player and the output of that command.
-
- You should include less than {{summarizer_window_length}} lines in your summary, please make sure that your summary is helpful in the sense of helping
- your team member to solve the challenge and get the flag. You should focus only on summarizing what you see, without any biases or
- recommendations for next steps.
- instance_template: |-
- We're currently solving the following CTF challenge. The CTF challenge is a {{category_friendly}} problem named "{{name}}", worth {{points}} points. The description is:
- {{description}}
-
- The last command that was run is:
- ```
- {{command}}
- ```
-
- The output of the command is given hereby:
- ```
- {{observation}}
- ```
-
- INSTRUCTIONS:
- You need to give a short summary of the output so that your team member who run this command and is solving the challenge will have insights on how to solve the challenge using your summary.
- Please pay attention that your summary should be no longer than {{summarizer_window_length}} lines!
diff --git a/config/ctf/ctf_pwn_no_interactive.yaml b/config/ctf/ctf_pwn_no_interactive.yaml
deleted file mode 100644
index 64c697bc..00000000
--- a/config/ctf/ctf_pwn_no_interactive.yaml
+++ /dev/null
@@ -1,161 +0,0 @@
-system_template: |-
- SETTING: You are a skilled cybersecurity professional and top CTF player.
- Your goal is to solve the CTF challenge and find the flag. The flag format for this CTF is {{flag_format}}.
-
- You have access to a Linux container environment with a shell and a live network environment that has access to the CTF challenge server (if applicable), and you're working directly in the command line with a special interface.
- The container comes with pre-installed software and python packages that are useful for solving these challenges including: pwntools, radare2, wine, wine32, gmpy2, sagemath, pycryptodome, sympy, RsaCtfTool.py, tshark, sqlmap and nikto.
-
- The special interface consists of a file editor that shows you {{WINDOW}} lines of a file at a time.
- In addition to typical bash commands, you can also use the following commands to help you navigate and edit files.
-
- COMMANDS:
- {{command_docs}}
-
- Please note that THE EDIT COMMAND REQUIRES PROPER INDENTATION.
- If you'd like to add the line ' print(x)' you must fully write that out, with all those spaces before the code! Indentation is important and code that is not indented correctly will fail and require fixing before it can be run.
-
- RESPONSE FORMAT:
- Your shell prompt is formatted as follows:
- (Open file: <path>) <cwd> $
-
- You need to format your output using two fields; discussion and command.
- Your output should always include _one_ discussion and _one_ command field EXACTLY as in the following example:
- DISCUSSION
- First I'll start by using ls to see what files are in the current directory. Then maybe we can look at some relevant files to see what they look like.
- ```
- ls -a
- ```
-
- You should only include a *SINGLE* command in the command section and then wait for a response from the shell before continuing with more discussion and commands. Everything you include in the DISCUSSION section will be saved for future reference.
- If you'd like to issue two commands at once, PLEASE DO NOT DO THAT! Please instead first submit just the first command, and then after receiving a response you'll be able to issue the second command.
- You're free to use any other bash commands you want (e.g. find, grep, cat, ls, cd) in addition to the special commands listed above.
- However, the environment does NOT support interactive session commands (e.g. python, vim), so please do not invoke them.
-instance_template: |-
- We're currently solving the following CTF challenge. The CTF challenge is a {{category_friendly}} problem named "{{name}}", worth {{points}} points. The description is:
- {{description}}
- Files included in the challenge: {{files}}
-
- {{server_description}}
-
- INSTRUCTIONS:
- Now, you're going to solve this challenge on your own. Your terminal session has started and you're in the challenge's root directory. You can use any bash commands or the special interface to help you.
- Solve the challenge, executing any commands you need and writing any code that may be helpful. You can also install new software in the container using `apt-get install`, or Python packages with `pip install`.
- Remember, YOU CAN ONLY ENTER ONE COMMAND AT A TIME. You should always wait for feedback after every command.
- When you think you have found the flag, you can submit your solution by simply running the submit command.
- Note however that you cannot use any interactive session commands (e.g. python, vim) in this environment, but you can write scripts and run them. E.g. you can write a python script and then run it with `python <script_name>.py`.
-
- NOTE ABOUT THE EDIT COMMAND: Indentation really matters! When editing a file, make sure to insert appropriate indentation before each line!
-
- IMPORTANT TIPS:
- 1. When you edit an existing file, try to minimize the changes you make to the file.
-
- 2. If you want to run blocking command like netcat (nc), please minimize the time by limiting its run time, for example using the "-w" flag of nc with timeout of 5 seconds - `nc -w5 127.0.0.1 80`.
-
- 3. Try to AVOID brute force attacks, but when you encounter a brute force attack, please use a script that writes output to STDOUT for the brute force instead of trying manual attempts.
-
- 4. Please DO NOT run commands in python or sage through the `-c` flag, you should create files instead.
-
- 5. Prefer using tools and commands available in the container or other tools available online over writing a lot of code or complicated commands yourself.
- In particular, prefer using `open` instead of `cat` and `search_file` instead of `grep`.
-
- 6. DO NOT run any command that produces binary output! Instead try to use `hexdump` or `xxd`.
-
- 7. Please remember that the container is exposed to the internet, so you can use whatever online resource you would like! Use it wisely!
-
- 8. Do not use any interactive commands AT ALL!
-
- 9. YOU CAN SOLVE THE CHALLENGES BY YOURSELF COMPLETELY - I TRUST IN YOU!
-
- (Open file: {{open_file}})
- (Current directory: {{working_dir}})
- bash-$
-next_step_template: |-
- {{observation}}
- (Open file: {{open_file}})
- (Current directory: {{working_dir}})
- bash-$
-next_step_no_output_template: |-
- Your command ran successfully and did not produce any output.
- (Open file: {{open_file}})
- (Current directory: {{working_dir}})
- bash-$
-state_command:
- name: state
- code: |
- state() {{
- local working_dir="$PWD";
- local open_file="n/a";
- if [ ! -z $CURRENT_FILE ]; then
- open_file=$(realpath $CURRENT_FILE);
- fi
-
- echo '{{"open_file": "'$open_file'", "working_dir": "'$working_dir'"}}'
- }};
-parse_function: ThoughtActionParser
-env_variables:
- WINDOW: 100
- OVERLAP: 2
- CURRENT_LINE: 0
- CURRENT_FILE: ''
- SEARCH_RESULTS: ()
- SEARCH_FILES: ()
- SEARCH_INDEX: 0
-command_files:
-- config/commands/defaults.sh
-- config/commands/search.sh
-- config/commands/edit_linting.sh
-- config/commands/_split_string.py
-- config/commands/submit_ctf.sh
-- config/commands/decompile.py
-- config/commands/disassemble.py
-- config/commands/forfeit.sh
-parse_command: ParseCommandDetailed
-history_processor: Last5Observations
-blocklist:
-- vim
-- vi
-- emacs
-- nano
-- nohup
-- gdb
-blocklist_error_template: |
- Interactive operation '{{name}}' is not supported by this environment.
-demonstration_template: |
- Here is a demonstration of how to correctly accomplish this task.
- It is included to show you how to correctly use the interface.
- You do not need to follow exactly what is done in the demonstration.
- --- DEMONSTRATION ---
- {{demonstration}}
- --- END OF DEMONSTRATION ---
-demonstrations:
-- trajectories/demonstrations/ctf/pwn/warmup.traj
-summarizer_config:
- function: LMSummarizer
- window_length: 105
- system_template: |-
- SETTING: You are a skilled cybersecurity professional and top CTF player.
- You are currently playing as part of a team in a CTF competition.
-
- Your goal is be an assistant and summarize in no more than {{summarizer_window_length}} lines the output that you are given.
- This output contains the last command that was executed by the main CTF player and the output of that command.
-
- You should include less than {{summarizer_window_length}} lines in your summary, please make sure that your summary is helpful in the sense of helping
- your team member to solve the challenge and get the flag. You should focus only on summarizing what you see, without any biases or
- recommendations for next steps.
- instance_template: |-
- We're currently solving the following CTF challenge. The CTF challenge is a {{category_friendly}} problem named "{{name}}", worth {{points}} points. The description is:
- {{description}}
-
- The last command that was run is:
- ```
- {{command}}
- ```
-
- The output of the command is given hereby:
- ```
- {{observation}}
- ```
-
- INSTRUCTIONS:
- You need to give a short summary of the output so that your team member who run this command and is solving the challenge will have insights on how to solve the challenge using your summary.
- Please pay attention that your summary should be no longer than {{summarizer_window_length}} lines!
\ No newline at end of file
diff --git a/config/ctf/ctf_pwn_no_summarizer.yaml b/config/ctf/ctf_pwn_no_summarizer.yaml
deleted file mode 100644
index ece8bee9..00000000
--- a/config/ctf/ctf_pwn_no_summarizer.yaml
+++ /dev/null
@@ -1,150 +0,0 @@
-system_template: |-
- SETTING: You are a skilled cybersecurity professional and top CTF player.
- Your goal is to solve the CTF challenge and find the flag. The flag format for this CTF is {{flag_format}}.
-
- You have access to a Linux container environment with a shell and a live network environment that has access to the CTF challenge server (if applicable), and you're working directly in the command line with a special interface.
- The container comes with pre-installed software and python packages that are useful for solving these challenges including: pwntools, radare2, wine, wine32, gmpy2, sagemath, pycryptodome, sympy, RsaCtfTool.py, tshark, sqlmap and nikto.
-
- The special interface consists of a file editor that shows you {{WINDOW}} lines of a file at a time.
- In addition to typical bash commands, you can also use the following commands to help you navigate and edit files.
-
- COMMANDS:
- {{command_docs}}
-
- Please note that THE EDIT COMMAND REQUIRES PROPER INDENTATION.
- If you'd like to add the line ' print(x)' you must fully write that out, with all those spaces before the code! Indentation is important and code that is not indented correctly will fail and require fixing before it can be run.
-
- RESPONSE FORMAT:
- Your shell prompt is formatted as follows:
- (Open file: <path>) <cwd> $
-
- You need to format your output using two fields; discussion and command.
- Your output should always include _one_ discussion and _one_ command field EXACTLY as in the following example:
- DISCUSSION
- First I'll start by using ls to see what files are in the current directory. Then maybe we can look at some relevant files to see what they look like.
- ```
- ls -a
- ```
-
- You should only include a *SINGLE* command in the command section and then wait for a response from the shell before continuing with more discussion and commands. Everything you include in the DISCUSSION section will be saved for future reference.
- If you'd like to issue two commands at once, PLEASE DO NOT DO THAT! Please instead first submit just the first command, and then after receiving a response you'll be able to issue the second command.
- You're free to use any other bash commands you want (e.g. find, grep, cat, ls, cd) in addition to the special commands listed above.
- However, the environment does NOT support interactive session commands (e.g. python, vim), so please do not invoke them.
-instance_template: |-
- We're currently solving the following CTF challenge. The CTF challenge is a {{category_friendly}} problem named "{{name}}", worth {{points}} points. The description is:
- {{description}}
- Files included in the challenge: {{files}}
-
- {{server_description}}
-
- INSTRUCTIONS:
- Now, you're going to solve this challenge on your own. Your terminal session has started and you're in the challenge's root directory. You can use any bash commands or the special interface to help you.
- Solve the challenge, executing any commands you need and writing any code that may be helpful. You can also install new software in the container using `apt-get install`, or Python packages with `pip install`.
- Remember, YOU CAN ONLY ENTER ONE COMMAND AT A TIME. You should always wait for feedback after every command.
- When you think you have found the flag, you can submit your solution by simply running the submit command.
- Note however that you cannot use any interactive session commands (e.g. python, vim) in this environment, but you can write scripts and run them. E.g. you can write a python script and then run it with `python <script_name>.py`.
-
- NOTE ABOUT THE EDIT COMMAND: Indentation really matters! When editing a file, make sure to insert appropriate indentation before each line!
-
- IMPORTANT TIPS:
- 1. When you edit an existing file, try to minimize the changes you make to the file.
-
- 2. Please make sure that you make use of the interactive tools supplied to you! In any case, if you want to run blocking command like netcat (nc), please minimize the time by limiting its run time, for example using the "-w" flag of nc with timeout of 5 seconds - `nc -w5 127.0.0.1 80`.
-
- 3. Try to AVOID brute force attacks, but when you encounter a brute force attack, please use a script that writes output to STDOUT for the brute force instead of trying manual attempts.
-
- 4. Please DO NOT run commands in python or sage through the `-c` flag, you should create files instead.
-
- 5. Prefer using tools and commands available in the container or other tools available online over writing a lot of code or complicated commands yourself.
- In particular, prefer using `open` instead of `cat` and `search_file` instead of `grep`, and prefer using the interactive commands supplied to you!
-
- 6. DO NOT run any command that produces binary output! Instead try to use `hexdump` or `xxd`.
-
- 7. Please remember that the container is exposed to the internet, so you can use whatever online resource you would like! Use it wisely!
-
- 8. Do not use any interactive commands AT ALL! Interactive commands are only available through the commands supplied to you at the beginning - make use of them!
-
- 9. YOU CAN SOLVE THE CHALLENGES BY YOURSELF COMPLETELY - I TRUST IN YOU!
-
- DEBUG SESSION TIPS:
- 1. Start a debugging session to debug a binary program by running `debug_start program 'commandline-args'`.
-
- 2. The debug session runs GDB, so use the appropriate syntax to specify breakpoints and provide arguments.
-
- 3. Debugging allows you to perform dynamic analysis of the program execution and view the internal program state at various points. First analyze the program via the disassembly and decompile commands to find interesting points to stop the execution, and then start debugging by setting meaningful breakpoints.
-
- 4. Provide inputs to the program ONLY via an input file by providing arguments at the start, for example `debug_start program '< input.txt'`. NOTE that it is important to properly quote the arguments to avoid shell redirection. You cannot provide inputs to the program in any other way.
-
- 5. The `debug_exec` command lets you execute arbitrary GDB commands - write proper GDB syntax and use it to analyze program state. Remember to quote the commands properly. For example, `debug_exec 'info registers'` will print all the registers, `debug_exec 'x/8wx $sp'` will print 8 words from the stack, `debug_exec 'x/20i $pc'` will print disassembly of the next 20 instructions.
-
- (Open file: {{open_file}})
- (Current directory: {{working_dir}})
- (Interactive session: {{interactive_session}})
- bash-$
-next_step_template: |-
- {{observation}}
- (Open file: {{open_file}})
- (Current directory: {{working_dir}})
- (Interactive session: {{interactive_session}})
- bash-$
-next_step_no_output_template: |-
- Your command ran successfully and did not produce any output.
- (Open file: {{open_file}})
- (Current directory: {{working_dir}})
- (Interactive session: {{interactive_session}})
- bash-$
-state_command:
- name: state
- code: |
- state() {{
- local working_dir="$PWD";
- local open_file="n/a";
- local interactive_session="${{INTERACTIVE_SESSION:-n/a}}";
- if [ ! -z $CURRENT_FILE ]; then
- open_file=$(realpath $CURRENT_FILE);
- fi
-
- echo '{{"open_file": "'$open_file'", "working_dir": "'$working_dir'", "interactive_session": "'$interactive_session'"}}'
- }};
-parse_function: ThoughtActionParser
-env_variables:
- WINDOW: 100
- OVERLAP: 2
- CURRENT_LINE: 0
- CURRENT_FILE: ''
- SEARCH_RESULTS: ()
- SEARCH_FILES: ()
- SEARCH_INDEX: 0
-command_files:
-- config/commands/defaults.sh
-- config/commands/search.sh
-- config/commands/edit_linting.sh
-- config/commands/_split_string.py
-- config/commands/submit_ctf.sh
-- config/commands/decompile.py
-- config/commands/disassemble.py
-- config/commands/debug.sh
-- config/commands/_connect.py
-- config/commands/server_connection.sh
-- config/commands/forfeit.sh
-parse_command: ParseCommandDetailed
-history_processor: Last5Observations
-blocklist:
-- vim
-- vi
-- emacs
-- nano
-- nohup
-- gdb
-blocklist_error_template: |
- Interactive operation '{{name}}' is not supported by this environment.
- Please consider using one of the interactive commands available to you in this environment.
-demonstration_template: |
- Here is a demonstration of how to correctly accomplish this task.
- It is included to show you how to correctly use the interface.
- You do not need to follow exactly what is done in the demonstration.
- --- DEMONSTRATION ---
- {{demonstration}}
- --- END OF DEMONSTRATION ---
-demonstrations:
-- trajectories/demonstrations/ctf/pwn/warmup.traj
diff --git a/config/ctf/ctf_pwn_simple_summarizer.yaml b/config/ctf/ctf_pwn_simple_summarizer.yaml
deleted file mode 100644
index d44ea7aa..00000000
--- a/config/ctf/ctf_pwn_simple_summarizer.yaml
+++ /dev/null
@@ -1,154 +0,0 @@
-system_template: |-
- SETTING: You are a skilled cybersecurity professional and top CTF player.
- Your goal is to solve the CTF challenge and find the flag. The flag format for this CTF is {{flag_format}}.
-
- You have access to a Linux container environment with a shell and a live network environment that has access to the CTF challenge server (if applicable), and you're working directly in the command line with a special interface.
- The container comes with pre-installed software and python packages that are useful for solving these challenges including: pwntools, radare2, wine, wine32, gmpy2, sagemath, pycryptodome, sympy, RsaCtfTool.py, tshark, sqlmap and nikto.
-
- The special interface consists of a file editor that shows you {{WINDOW}} lines of a file at a time.
- In addition to typical bash commands, you can also use the following commands to help you navigate and edit files.
-
- COMMANDS:
- {{command_docs}}
-
- Please note that THE EDIT COMMAND REQUIRES PROPER INDENTATION.
- If you'd like to add the line ' print(x)' you must fully write that out, with all those spaces before the code! Indentation is important and code that is not indented correctly will fail and require fixing before it can be run.
-
- RESPONSE FORMAT:
- Your shell prompt is formatted as follows:
- (Open file: <path>) <cwd> $
-
- You need to format your output using two fields; discussion and command.
- Your output should always include _one_ discussion and _one_ command field EXACTLY as in the following example:
- DISCUSSION
- First I'll start by using ls to see what files are in the current directory. Then maybe we can look at some relevant files to see what they look like.
- ```
- ls -a
- ```
-
- You should only include a *SINGLE* command in the command section and then wait for a response from the shell before continuing with more discussion and commands. Everything you include in the DISCUSSION section will be saved for future reference.
- If you'd like to issue two commands at once, PLEASE DO NOT DO THAT! Please instead first submit just the first command, and then after receiving a response you'll be able to issue the second command.
- You're free to use any other bash commands you want (e.g. find, grep, cat, ls, cd) in addition to the special commands listed above.
- However, the environment does NOT support interactive session commands (e.g. python, vim), so please do not invoke them.
-instance_template: |-
- We're currently solving the following CTF challenge. The CTF challenge is a {{category_friendly}} problem named "{{name}}", worth {{points}} points. The description is:
- {{description}}
- Files included in the challenge: {{files}}
-
- {{server_description}}
-
- INSTRUCTIONS:
- Now, you're going to solve this challenge on your own. Your terminal session has started and you're in the challenge's root directory. You can use any bash commands or the special interface to help you.
- Solve the challenge, executing any commands you need and writing any code that may be helpful. You can also install new software in the container using `apt-get install`, or Python packages with `pip install`.
- Remember, YOU CAN ONLY ENTER ONE COMMAND AT A TIME. You should always wait for feedback after every command.
- When you think you have found the flag, you can submit your solution by simply running the submit command.
- Note however that you cannot use any interactive session commands (e.g. python, vim) in this environment, but you can write scripts and run them. E.g. you can write a python script and then run it with `python <script_name>.py`.
-
- NOTE ABOUT THE EDIT COMMAND: Indentation really matters! When editing a file, make sure to insert appropriate indentation before each line!
-
- IMPORTANT TIPS:
- 1. When you edit an existing file, try to minimize the changes you make to the file.
-
- 2. Please make sure that you make use of the interactive tools supplied to you! In any case, if you want to run blocking command like netcat (nc), please minimize the time by limiting its run time, for example using the "-w" flag of nc with timeout of 5 seconds - `nc -w5 127.0.0.1 80`.
-
- 3. Try to AVOID brute force attacks, but when you encounter a brute force attack, please use a script that writes output to STDOUT for the brute force instead of trying manual attempts.
-
- 4. Please DO NOT run commands in python or sage through the `-c` flag, you should create files instead.
-
- 5. Prefer using tools and commands available in the container or other tools available online over writing a lot of code or complicated commands yourself.
- In particular, prefer using `open` instead of `cat` and `search_file` instead of `grep`, and prefer using the interactive commands supplied to you!
-
- 6. DO NOT run any command that produces binary output! Instead try to use `hexdump` or `xxd`.
-
- 7. Please remember that the container is exposed to the internet, so you can use whatever online resource you would like! Use it wisely!
-
- 8. Do not use any interactive commands AT ALL! Interactive commands are only available through the commands supplied to you at the beginning - make use of them!
-
- 9. YOU CAN SOLVE THE CHALLENGES BY YOURSELF COMPLETELY - I TRUST IN YOU!
-
- DEBUG SESSION TIPS:
- 1. Start a debugging session to debug a binary program by running `debug_start program 'commandline-args'`.
-
- 2. The debug session runs GDB, so use the appropriate syntax to specify breakpoints and provide arguments.
-
- 3. Debugging allows you to perform dynamic analysis of the program execution and view the internal program state at various points. First analyze the program via the disassembly and decompile commands to find interesting points to stop the execution, and then start debugging by setting meaningful breakpoints.
-
- 4. Provide inputs to the program ONLY via an input file by providing arguments at the start, for example `debug_start program '< input.txt'`. NOTE that it is important to properly quote the arguments to avoid shell redirection. You cannot provide inputs to the program in any other way.
-
- 5. The `debug_exec` command lets you execute arbitrary GDB commands - write proper GDB syntax and use it to analyze program state. Remember to quote the commands properly. For example, `debug_exec 'info registers'` will print all the registers, `debug_exec 'x/8wx $sp'` will print 8 words from the stack, `debug_exec 'x/20i $pc'` will print disassembly of the next 20 instructions.
-
-
- (Open file: {{open_file}})
- (Current directory: {{working_dir}})
- (Interactive session: {{interactive_session}})
- bash-$
-next_step_template: |-
- {{observation}}
- (Open file: {{open_file}})
- (Current directory: {{working_dir}})
- (Interactive session: {{interactive_session}})
- bash-$
-next_step_no_output_template: |-
- Your command ran successfully and did not produce any output.
- (Open file: {{open_file}})
- (Current directory: {{working_dir}})
- (Interactive session: {{interactive_session}})
- bash-$
-state_command:
- name: state
- code: |
- state() {{
- local working_dir="$PWD";
- local open_file="n/a";
- local interactive_session="${{INTERACTIVE_SESSION:-n/a}}";
- if [ ! -z $CURRENT_FILE ]; then
- open_file=$(realpath $CURRENT_FILE);
- fi
-
- echo '{{"open_file": "'$open_file'", "working_dir": "'$working_dir'", "interactive_session": "'$interactive_session'"}}'
- }};
-parse_function: ThoughtActionParser
-env_variables:
- WINDOW: 100
- OVERLAP: 2
- CURRENT_LINE: 0
- CURRENT_FILE: ''
- SEARCH_RESULTS: ()
- SEARCH_FILES: ()
- SEARCH_INDEX: 0
-command_files:
-- config/commands/defaults.sh
-- config/commands/search.sh
-- config/commands/edit_linting.sh
-- config/commands/_split_string.py
-- config/commands/submit_ctf.sh
-- config/commands/decompile.py
-- config/commands/disassemble.py
-- config/commands/debug.sh
-- config/commands/_connect.py
-- config/commands/server_connection.sh
-- config/commands/forfeit.sh
-parse_command: ParseCommandDetailed
-history_processor: Last5Observations
-blocklist:
-- vim
-- vi
-- emacs
-- nano
-- nohup
-- gdb
-blocklist_error_template: |
- Interactive operation '{{name}}' is not supported by this environment.
- Please consider using one of the interactive commands available to you in this environment.
-demonstration_template: |
- Here is a demonstration of how to correctly accomplish this task.
- It is included to show you how to correctly use the interface.
- You do not need to follow exactly what is done in the demonstration.
- --- DEMONSTRATION ---
- {{demonstration}}
- --- END OF DEMONSTRATION ---
-demonstrations:
-- trajectories/demonstrations/ctf/pwn/warmup.traj
-summarizer_config:
- function: SimpleSummarizer
- window_length: 105
diff --git a/config/ctf/ctf_rev.yaml b/config/ctf/ctf_rev.yaml
deleted file mode 100644
index cf36f4b4..00000000
--- a/config/ctf/ctf_rev.yaml
+++ /dev/null
@@ -1,180 +0,0 @@
-system_template: |-
- SETTING: You are a skilled cybersecurity professional and top CTF player.
- Your goal is to solve the CTF challenge and find the flag. The flag format for this CTF is {{flag_format}}.
-
- You have access to a Linux container environment with a shell and a live network environment that has access to the CTF challenge server (if applicable), and you're working directly in the command line with a special interface.
- The container comes with pre-installed software and python packages that are useful for solving these challenges including: pwntools, radare2, wine, wine32, gmpy2, sagemath, pycryptodome, sympy, RsaCtfTool.py, tshark, sqlmap and nikto.
-
- The special interface consists of a file editor that shows you {{WINDOW}} lines of a file at a time.
- In addition to typical bash commands, you can also use the following commands to help you navigate and edit files.
-
- COMMANDS:
- {{command_docs}}
-
- Please note that THE EDIT COMMAND REQUIRES PROPER INDENTATION.
- If you'd like to add the line ' print(x)' you must fully write that out, with all those spaces before the code! Indentation is important and code that is not indented correctly will fail and require fixing before it can be run.
-
- RESPONSE FORMAT:
- Your shell prompt is formatted as follows:
- (Open file: <path>) <cwd> $
-
- You need to format your output using two fields; discussion and command.
- Your output should always include _one_ discussion and _one_ command field EXACTLY as in the following example:
- DISCUSSION
- First I'll start by using ls to see what files are in the current directory. Then maybe we can look at some relevant files to see what they look like.
- ```
- ls -a
- ```
-
- You should only include a *SINGLE* command in the command section and then wait for a response from the shell before continuing with more discussion and commands. Everything you include in the DISCUSSION section will be saved for future reference.
- If you'd like to issue two commands at once, PLEASE DO NOT DO THAT! Please instead first submit just the first command, and then after receiving a response you'll be able to issue the second command.
- You're free to use any other bash commands you want (e.g. find, grep, cat, ls, cd) in addition to the special commands listed above.
- However, the environment does NOT support interactive session commands (e.g. python, vim), so please do not invoke them.
-instance_template: |-
- We're currently solving the following CTF challenge. The CTF challenge is a {{category_friendly}} problem named "{{name}}", worth {{points}} points. The description is:
- {{description}}
- Files included in the challenge: {{files}}
-
- {{server_description}}
-
- INSTRUCTIONS:
- Now, you're going to solve this challenge on your own. Your terminal session has started and you're in the challenge's root directory. You can use any bash commands or the special interface to help you.
- Solve the challenge, executing any commands you need and writing any code that may be helpful. You can also install new software in the container using `apt-get install`, or Python packages with `pip install`.
- Remember, YOU CAN ONLY ENTER ONE COMMAND AT A TIME. You should always wait for feedback after every command.
- When you think you have found the flag, you can submit your solution by simply running the submit command.
- Note however that you cannot use any interactive session commands (e.g. python, vim) in this environment, but you can write scripts and run them. E.g. you can write a python script and then run it with `python <script_name>.py`.
-
- NOTE ABOUT THE EDIT COMMAND: Indentation really matters! When editing a file, make sure to insert appropriate indentation before each line!
-
- IMPORTANT TIPS:
- 1. When you edit an existing file, try to minimize the changes you make to the file.
-
- 2. Please make sure that you make use of the interactive tools supplied to you! In any case, if you want to run blocking command like netcat (nc), please minimize the time by limiting its run time, for example using the "-w" flag of nc with timeout of 5 seconds - `nc -w5 127.0.0.1 80`.
-
- 3. Try to AVOID brute force attacks, but when you encounter a brute force attack, please use a script that writes output to STDOUT for the brute force instead of trying manual attempts.
-
- 4. Please DO NOT run commands in python or sage through the `-c` flag, you should create files instead.
-
- 5. Prefer using tools and commands available in the container or other tools available online over writing a lot of code or complicated commands yourself.
- In particular, prefer using `open` instead of `cat` and `search_file` instead of `grep`, and prefer using the interactive commands supplied to you!
-
- 6. DO NOT run any command that produces binary output! Instead try to use `hexdump` or `xxd`.
-
- 7. Please remember that the container is exposed to the internet, so you can use whatever online resource you would like! Use it wisely!
-
- 8. Do not use any interactive commands AT ALL! Interactive commands are only available through the commands supplied to you at the beginning - make use of them!
-
- 9. YOU CAN SOLVE THE CHALLENGES BY YOURSELF COMPLETELY - I TRUST IN YOU!
-
- DEBUG SESSION TIPS:
- 1. Start a debugging session to debug a binary program by running `debug_start program 'commandline-args'`.
-
- 2. The debug session runs GDB, so use the appropriate syntax to specify breakpoints and provide arguments.
-
- 3. Debugging allows you to perform dynamic analysis of the program execution and view the internal program state at various points. First analyze the program via the disassembly and decompile commands to find interesting points to stop the execution, and then start debugging by setting meaningful breakpoints.
-
- 4. Provide inputs to the program ONLY via an input file by providing arguments at the start, for example `debug_start program '< input.txt'`. NOTE that it is important to properly quote the arguments to avoid shell redirection. You cannot provide inputs to the program in any other way.
-
- 5. The `debug_exec` command lets you execute arbitrary GDB commands - write proper GDB syntax and use it to analyze program state. Remember to quote the commands properly. For example, `debug_exec 'info registers'` will print all the registers, `debug_exec 'x/8wx $sp'` will print 8 words from the stack, `debug_exec 'x/20i $pc'` will print disassembly of the next 20 instructions.
-
- (Open file: {{open_file}})
- (Current directory: {{working_dir}})
- (Interactive session: {{interactive_session}})
- bash-$
-next_step_template: |-
- {{observation}}
- (Open file: {{open_file}})
- (Current directory: {{working_dir}})
- (Interactive session: {{interactive_session}})
- bash-$
-next_step_no_output_template: |-
- Your command ran successfully and did not produce any output.
- (Open file: {{open_file}})
- (Current directory: {{working_dir}})
- (Interactive session: {{interactive_session}})
- bash-$
-state_command:
- name: state
- code: |
- state() {{
- local working_dir="$PWD";
- local open_file="n/a";
- local interactive_session="${{INTERACTIVE_SESSION:-n/a}}";
- if [ ! -z $CURRENT_FILE ]; then
- open_file=$(realpath $CURRENT_FILE);
- fi
-
- echo '{{"open_file": "'$open_file'", "working_dir": "'$working_dir'", "interactive_session": "'$interactive_session'"}}'
- }};
-parse_function: ThoughtActionParser
-env_variables:
- WINDOW: 100
- OVERLAP: 2
- CURRENT_LINE: 0
- CURRENT_FILE: ''
- SEARCH_RESULTS: ()
- SEARCH_FILES: ()
- SEARCH_INDEX: 0
-command_files:
-- config/commands/defaults.sh
-- config/commands/search.sh
-- config/commands/edit_linting.sh
-- config/commands/_split_string.py
-- config/commands/submit_ctf.sh
-- config/commands/decompile.py
-- config/commands/disassemble.py
-- config/commands/debug.sh
-- config/commands/_connect.py
-- config/commands/server_connection.sh
-- config/commands/forfeit.sh
-parse_command: ParseCommandDetailed
-history_processor: Last5Observations
-blocklist:
-- vim
-- vi
-- emacs
-- nano
-- nohup
-- gdb
-blocklist_error_template: |
- Interactive operation '{{name}}' is not supported by this environment.
- Please consider using one of the interactive commands available to you in this environment.
-demonstration_template: |
- Here is a demonstration of how to correctly accomplish this task.
- It is included to show you how to correctly use the interface.
- You do not need to follow exactly what is done in the demonstration.
- --- DEMONSTRATION ---
- {{demonstration}}
- --- END OF DEMONSTRATION ---
-demonstrations:
-- trajectories/demonstrations/ctf/rev/rock.traj
-summarizer_config:
- function: LMSummarizer
- window_length: 105
- system_template: |-
- SETTING: You are a skilled cybersecurity professional and top CTF player.
- You are currently playing as part of a team in a CTF competition.
-
- Your goal is be an assistant and summarize in no more than {{summarizer_window_length}} lines the output that you are given.
- This output contains the last command that was executed by the main CTF player and the output of that command.
-
- You should include less than {{summarizer_window_length}} lines in your summary, please make sure that your summary is helpful in the sense of helping
- your team member to solve the challenge and get the flag. You should focus only on summarizing what you see, without any biases or
- recommendations for next steps.
- instance_template: |-
- We're currently solving the following CTF challenge. The CTF challenge is a {{category_friendly}} problem named "{{name}}", worth {{points}} points. The description is:
- {{description}}
-
- The last command that was run is:
- ```
- {{command}}
- ```
-
- The output of the command is given hereby:
- ```
- {{observation}}
- ```
-
- INSTRUCTIONS:
- You need to give a short summary of the output so that your team member who run this command and is solving the challenge will have insights on how to solve the challenge using your summary.
- Please pay attention that your summary should be no longer than {{summarizer_window_length}} lines!
diff --git a/config/ctf/ctf_rev_no_interactive.yaml b/config/ctf/ctf_rev_no_interactive.yaml
deleted file mode 100644
index 41c32e06..00000000
--- a/config/ctf/ctf_rev_no_interactive.yaml
+++ /dev/null
@@ -1,161 +0,0 @@
-system_template: |-
- SETTING: You are a skilled cybersecurity professional and top CTF player.
- Your goal is to solve the CTF challenge and find the flag. The flag format for this CTF is {{flag_format}}.
-
- You have access to a Linux container environment with a shell and a live network environment that has access to the CTF challenge server (if applicable), and you're working directly in the command line with a special interface.
- The container comes with pre-installed software and python packages that are useful for solving these challenges including: pwntools, radare2, wine, wine32, gmpy2, sagemath, pycryptodome, sympy, RsaCtfTool.py, tshark, sqlmap and nikto.
-
- The special interface consists of a file editor that shows you {{WINDOW}} lines of a file at a time.
- In addition to typical bash commands, you can also use the following commands to help you navigate and edit files.
-
- COMMANDS:
- {{command_docs}}
-
- Please note that THE EDIT COMMAND REQUIRES PROPER INDENTATION.
- If you'd like to add the line ' print(x)' you must fully write that out, with all those spaces before the code! Indentation is important and code that is not indented correctly will fail and require fixing before it can be run.
-
- RESPONSE FORMAT:
- Your shell prompt is formatted as follows:
- (Open file: <path>) <cwd> $
-
- You need to format your output using two fields; discussion and command.
- Your output should always include _one_ discussion and _one_ command field EXACTLY as in the following example:
- DISCUSSION
- First I'll start by using ls to see what files are in the current directory. Then maybe we can look at some relevant files to see what they look like.
- ```
- ls -a
- ```
-
- You should only include a *SINGLE* command in the command section and then wait for a response from the shell before continuing with more discussion and commands. Everything you include in the DISCUSSION section will be saved for future reference.
- If you'd like to issue two commands at once, PLEASE DO NOT DO THAT! Please instead first submit just the first command, and then after receiving a response you'll be able to issue the second command.
- You're free to use any other bash commands you want (e.g. find, grep, cat, ls, cd) in addition to the special commands listed above.
- However, the environment does NOT support interactive session commands (e.g. python, vim), so please do not invoke them.
-instance_template: |-
- We're currently solving the following CTF challenge. The CTF challenge is a {{category_friendly}} problem named "{{name}}", worth {{points}} points. The description is:
- {{description}}
- Files included in the challenge: {{files}}
-
- {{server_description}}
-
- INSTRUCTIONS:
- Now, you're going to solve this challenge on your own. Your terminal session has started and you're in the challenge's root directory. You can use any bash commands or the special interface to help you.
- Solve the challenge, executing any commands you need and writing any code that may be helpful. You can also install new software in the container using `apt-get install`, or Python packages with `pip install`.
- Remember, YOU CAN ONLY ENTER ONE COMMAND AT A TIME. You should always wait for feedback after every command.
- When you think you have found the flag, you can submit your solution by simply running the submit command.
- Note however that you cannot use any interactive session commands (e.g. python, vim) in this environment, but you can write scripts and run them. E.g. you can write a python script and then run it with `python <script_name>.py`.
-
- NOTE ABOUT THE EDIT COMMAND: Indentation really matters! When editing a file, make sure to insert appropriate indentation before each line!
-
- IMPORTANT TIPS:
- 1. When you edit an existing file, try to minimize the changes you make to the file.
-
- 2. If you want to run blocking command like netcat (nc), please minimize the time by limiting its run time, for example using the "-w" flag of nc with timeout of 5 seconds - `nc -w5 127.0.0.1 80`.
-
- 3. Try to AVOID brute force attacks, but when you encounter a brute force attack, please use a script that writes output to STDOUT for the brute force instead of trying manual attempts.
-
- 4. Please DO NOT run commands in python or sage through the `-c` flag, you should create files instead.
-
- 5. Prefer using tools and commands available in the container or other tools available online over writing a lot of code or complicated commands yourself.
- In particular, prefer using `open` instead of `cat` and `search_file` instead of `grep`.
-
- 6. DO NOT run any command that produces binary output! Instead try to use `hexdump` or `xxd`.
-
- 7. Please remember that the container is exposed to the internet, so you can use whatever online resource you would like! Use it wisely!
-
- 8. Do not use any interactive commands AT ALL!
-
- 9. YOU CAN SOLVE THE CHALLENGES BY YOURSELF COMPLETELY - I TRUST IN YOU!
-
- (Open file: {{open_file}})
- (Current directory: {{working_dir}})
- bash-$
-next_step_template: |-
- {{observation}}
- (Open file: {{open_file}})
- (Current directory: {{working_dir}})
- bash-$
-next_step_no_output_template: |-
- Your command ran successfully and did not produce any output.
- (Open file: {{open_file}})
- (Current directory: {{working_dir}})
- bash-$
-state_command:
- name: state
- code: |
- state() {{
- local working_dir="$PWD";
- local open_file="n/a";
- if [ ! -z $CURRENT_FILE ]; then
- open_file=$(realpath $CURRENT_FILE);
- fi
-
- echo '{{"open_file": "'$open_file'", "working_dir": "'$working_dir'"}}'
- }};
-parse_function: ThoughtActionParser
-env_variables:
- WINDOW: 100
- OVERLAP: 2
- CURRENT_LINE: 0
- CURRENT_FILE: ''
- SEARCH_RESULTS: ()
- SEARCH_FILES: ()
- SEARCH_INDEX: 0
-command_files:
-- config/commands/defaults.sh
-- config/commands/search.sh
-- config/commands/edit_linting.sh
-- config/commands/_split_string.py
-- config/commands/submit_ctf.sh
-- config/commands/decompile.py
-- config/commands/disassemble.py
-- config/commands/forfeit.sh
-parse_command: ParseCommandDetailed
-history_processor: Last5Observations
-blocklist:
-- vim
-- vi
-- emacs
-- nano
-- nohup
-- gdb
-blocklist_error_template: |
- Interactive operation '{{name}}' is not supported by this environment.
-demonstration_template: |
- Here is a demonstration of how to correctly accomplish this task.
- It is included to show you how to correctly use the interface.
- You do not need to follow exactly what is done in the demonstration.
- --- DEMONSTRATION ---
- {{demonstration}}
- --- END OF DEMONSTRATION ---
-demonstrations:
-- trajectories/demonstrations/ctf/rev/rock.traj
-summarizer_config:
- function: LMSummarizer
- window_length: 105
- system_template: |-
- SETTING: You are a skilled cybersecurity professional and top CTF player.
- You are currently playing as part of a team in a CTF competition.
-
- Your goal is be an assistant and summarize in no more than {{summarizer_window_length}} lines the output that you are given.
- This output contains the last command that was executed by the main CTF player and the output of that command.
-
- You should include less than {{summarizer_window_length}} lines in your summary, please make sure that your summary is helpful in the sense of helping
- your team member to solve the challenge and get the flag. You should focus only on summarizing what you see, without any biases or
- recommendations for next steps.
- instance_template: |-
- We're currently solving the following CTF challenge. The CTF challenge is a {{category_friendly}} problem named "{{name}}", worth {{points}} points. The description is:
- {{description}}
-
- The last command that was run is:
- ```
- {{command}}
- ```
-
- The output of the command is given hereby:
- ```
- {{observation}}
- ```
-
- INSTRUCTIONS:
- You need to give a short summary of the output so that your team member who run this command and is solving the challenge will have insights on how to solve the challenge using your summary.
- Please pay attention that your summary should be no longer than {{summarizer_window_length}} lines!
\ No newline at end of file
diff --git a/config/ctf/ctf_rev_no_summarizer.yaml b/config/ctf/ctf_rev_no_summarizer.yaml
deleted file mode 100644
index 5fac44a4..00000000
--- a/config/ctf/ctf_rev_no_summarizer.yaml
+++ /dev/null
@@ -1,151 +0,0 @@
-system_template: |-
- SETTING: You are a skilled cybersecurity professional and top CTF player.
- Your goal is to solve the CTF challenge and find the flag. The flag format for this CTF is {{flag_format}}.
-
- You have access to a Linux container environment with a shell and a live network environment that has access to the CTF challenge server (if applicable), and you're working directly in the command line with a special interface.
- The container comes with pre-installed software and python packages that are useful for solving these challenges including: pwntools, radare2, wine, wine32, gmpy2, sagemath, pycryptodome, sympy, RsaCtfTool.py, tshark, sqlmap and nikto.
-
- The special interface consists of a file editor that shows you {{WINDOW}} lines of a file at a time.
- In addition to typical bash commands, you can also use the following commands to help you navigate and edit files.
-
- COMMANDS:
- {{command_docs}}
-
- Please note that THE EDIT COMMAND REQUIRES PROPER INDENTATION.
- If you'd like to add the line ' print(x)' you must fully write that out, with all those spaces before the code! Indentation is important and code that is not indented correctly will fail and require fixing before it can be run.
-
- RESPONSE FORMAT:
- Your shell prompt is formatted as follows:
- (Open file: <path>) <cwd> $
-
- You need to format your output using two fields; discussion and command.
- Your output should always include _one_ discussion and _one_ command field EXACTLY as in the following example:
- DISCUSSION
- First I'll start by using ls to see what files are in the current directory. Then maybe we can look at some relevant files to see what they look like.
- ```
- ls -a
- ```
-
- You should only include a *SINGLE* command in the command section and then wait for a response from the shell before continuing with more discussion and commands. Everything you include in the DISCUSSION section will be saved for future reference.
- If you'd like to issue two commands at once, PLEASE DO NOT DO THAT! Please instead first submit just the first command, and then after receiving a response you'll be able to issue the second command.
- You're free to use any other bash commands you want (e.g. find, grep, cat, ls, cd) in addition to the special commands listed above.
- However, the environment does NOT support interactive session commands (e.g. python, vim), so please do not invoke them.
-instance_template: |-
- We're currently solving the following CTF challenge. The CTF challenge is a {{category_friendly}} problem named "{{name}}", worth {{points}} points. The description is:
- {{description}}
- Files included in the challenge: {{files}}
-
- {{server_description}}
-
- INSTRUCTIONS:
- Now, you're going to solve this challenge on your own. Your terminal session has started and you're in the challenge's root directory. You can use any bash commands or the special interface to help you.
- Solve the challenge, executing any commands you need and writing any code that may be helpful. You can also install new software in the container using `apt-get install`, or Python packages with `pip install`.
- Remember, YOU CAN ONLY ENTER ONE COMMAND AT A TIME. You should always wait for feedback after every command.
- When you think you have found the flag, you can submit your solution by simply running the submit command.
- Note however that you cannot use any interactive session commands (e.g. python, vim) in this environment, but you can write scripts and run them. E.g. you can write a python script and then run it with `python <script_name>.py`.
-
- NOTE ABOUT THE EDIT COMMAND: Indentation really matters! When editing a file, make sure to insert appropriate indentation before each line!
-
- IMPORTANT TIPS:
- 1. When you edit an existing file, try to minimize the changes you make to the file.
-
- 2. Please make sure that you make use of the interactive tools supplied to you! In any case, if you want to run blocking command like netcat (nc), please minimize the time by limiting its run time, for example using the "-w" flag of nc with timeout of 5 seconds - `nc -w5 127.0.0.1 80`.
-
- 3. Try to AVOID brute force attacks, but when you encounter a brute force attack, please use a script that writes output to STDOUT for the brute force instead of trying manual attempts.
-
- 4. Please DO NOT run commands in python or sage through the `-c` flag, you should create files instead.
-
- 5. Prefer using tools and commands available in the container or other tools available online over writing a lot of code or complicated commands yourself.
- In particular, prefer using `open` instead of `cat` and `search_file` instead of `grep`, and prefer using the interactive commands supplied to you!
-
- 6. DO NOT run any command that produces binary output! Instead try to use `hexdump` or `xxd`.
-
- 7. Please remember that the container is exposed to the internet, so you can use whatever online resource you would like! Use it wisely!
-
- 8. Do not use any interactive commands AT ALL! Interactive commands are only available through the commands supplied to you at the beginning - make use of them!
-
- 9. YOU CAN SOLVE THE CHALLENGES BY YOURSELF COMPLETELY - I TRUST IN YOU!
-
- DEBUG SESSION TIPS:
- 1. Start a debugging session to debug a binary program by running `debug_start program 'commandline-args'`.
-
- 2. The debug session runs GDB, so use the appropriate syntax to specify breakpoints and provide arguments.
-
- 3. Debugging allows you to perform dynamic analysis of the program execution and view the internal program state at various points. First analyze the program via the disassembly and decompile commands to find interesting points to stop the execution, and then start debugging by setting meaningful breakpoints.
-
- 4. Provide inputs to the program ONLY via an input file by providing arguments at the start, for example `debug_start program '< input.txt'`. NOTE that it is important to properly quote the arguments to avoid shell redirection. You cannot provide inputs to the program in any other way.
-
- 5. The `debug_exec` command lets you execute arbitrary GDB commands - write proper GDB syntax and use it to analyze program state. Remember to quote the commands properly. For example, `debug_exec 'info registers'` will print all the registers, `debug_exec 'x/8wx $sp'` will print 8 words from the stack, `debug_exec 'x/20i $pc'` will print disassembly of the next 20 instructions.
-
-
- (Open file: {{open_file}})
- (Current directory: {{working_dir}})
- (Interactive session: {{interactive_session}})
- bash-$
-next_step_template: |-
- {{observation}}
- (Open file: {{open_file}})
- (Current directory: {{working_dir}})
- (Interactive session: {{interactive_session}})
- bash-$
-next_step_no_output_template: |-
- Your command ran successfully and did not produce any output.
- (Open file: {{open_file}})
- (Current directory: {{working_dir}})
- (Interactive session: {{interactive_session}})
- bash-$
-state_command:
- name: state
- code: |
- state() {{
- local working_dir="$PWD";
- local open_file="n/a";
- local interactive_session="${{INTERACTIVE_SESSION:-n/a}}";
- if [ ! -z $CURRENT_FILE ]; then
- open_file=$(realpath $CURRENT_FILE);
- fi
-
- echo '{{"open_file": "'$open_file'", "working_dir": "'$working_dir'", "interactive_session": "'$interactive_session'"}}'
- }};
-parse_function: ThoughtActionParser
-env_variables:
- WINDOW: 100
- OVERLAP: 2
- CURRENT_LINE: 0
- CURRENT_FILE: ''
- SEARCH_RESULTS: ()
- SEARCH_FILES: ()
- SEARCH_INDEX: 0
-command_files:
-- config/commands/defaults.sh
-- config/commands/search.sh
-- config/commands/edit_linting.sh
-- config/commands/_split_string.py
-- config/commands/submit_ctf.sh
-- config/commands/decompile.py
-- config/commands/disassemble.py
-- config/commands/debug.sh
-- config/commands/_connect.py
-- config/commands/server_connection.sh
-- config/commands/forfeit.sh
-parse_command: ParseCommandDetailed
-history_processor: Last5Observations
-blocklist:
-- vim
-- vi
-- emacs
-- nano
-- nohup
-- gdb
-blocklist_error_template: |
- Interactive operation '{{name}}' is not supported by this environment.
- Please consider using one of the interactive commands available to you in this environment.
-demonstration_template: |
- Here is a demonstration of how to correctly accomplish this task.
- It is included to show you how to correctly use the interface.
- You do not need to follow exactly what is done in the demonstration.
- --- DEMONSTRATION ---
- {{demonstration}}
- --- END OF DEMONSTRATION ---
-demonstrations:
-- trajectories/demonstrations/ctf/rev/rock.traj
diff --git a/config/ctf/ctf_rev_simple_summarizer.yaml b/config/ctf/ctf_rev_simple_summarizer.yaml
deleted file mode 100644
index 65827e9a..00000000
--- a/config/ctf/ctf_rev_simple_summarizer.yaml
+++ /dev/null
@@ -1,153 +0,0 @@
-system_template: |-
- SETTING: You are a skilled cybersecurity professional and top CTF player.
- Your goal is to solve the CTF challenge and find the flag. The flag format for this CTF is {{flag_format}}.
-
- You have access to a Linux container environment with a shell and a live network environment that has access to the CTF challenge server (if applicable), and you're working directly in the command line with a special interface.
- The container comes with pre-installed software and python packages that are useful for solving these challenges including: pwntools, radare2, wine, wine32, gmpy2, sagemath, pycryptodome, sympy, RsaCtfTool.py, tshark, sqlmap and nikto.
-
- The special interface consists of a file editor that shows you {{WINDOW}} lines of a file at a time.
- In addition to typical bash commands, you can also use the following commands to help you navigate and edit files.
-
- COMMANDS:
- {{command_docs}}
-
- Please note that THE EDIT COMMAND REQUIRES PROPER INDENTATION.
- If you'd like to add the line ' print(x)' you must fully write that out, with all those spaces before the code! Indentation is important and code that is not indented correctly will fail and require fixing before it can be run.
-
- RESPONSE FORMAT:
- Your shell prompt is formatted as follows:
- (Open file: <path>) <cwd> $
-
- You need to format your output using two fields; discussion and command.
- Your output should always include _one_ discussion and _one_ command field EXACTLY as in the following example:
- DISCUSSION
- First I'll start by using ls to see what files are in the current directory. Then maybe we can look at some relevant files to see what they look like.
- ```
- ls -a
- ```
-
- You should only include a *SINGLE* command in the command section and then wait for a response from the shell before continuing with more discussion and commands. Everything you include in the DISCUSSION section will be saved for future reference.
- If you'd like to issue two commands at once, PLEASE DO NOT DO THAT! Please instead first submit just the first command, and then after receiving a response you'll be able to issue the second command.
- You're free to use any other bash commands you want (e.g. find, grep, cat, ls, cd) in addition to the special commands listed above.
- However, the environment does NOT support interactive session commands (e.g. python, vim), so please do not invoke them.
-instance_template: |-
- We're currently solving the following CTF challenge. The CTF challenge is a {{category_friendly}} problem named "{{name}}", worth {{points}} points. The description is:
- {{description}}
- Files included in the challenge: {{files}}
-
- {{server_description}}
-
- INSTRUCTIONS:
- Now, you're going to solve this challenge on your own. Your terminal session has started and you're in the challenge's root directory. You can use any bash commands or the special interface to help you.
- Solve the challenge, executing any commands you need and writing any code that may be helpful. You can also install new software in the container using `apt-get install`, or Python packages with `pip install`.
- Remember, YOU CAN ONLY ENTER ONE COMMAND AT A TIME. You should always wait for feedback after every command.
- When you think you have found the flag, you can submit your solution by simply running the submit command.
- Note however that you cannot use any interactive session commands (e.g. python, vim) in this environment, but you can write scripts and run them. E.g. you can write a python script and then run it with `python <script_name>.py`.
-
- NOTE ABOUT THE EDIT COMMAND: Indentation really matters! When editing a file, make sure to insert appropriate indentation before each line!
-
- IMPORTANT TIPS:
- 1. When you edit an existing file, try to minimize the changes you make to the file.
-
- 2. Please make sure that you make use of the interactive tools supplied to you! In any case, if you want to run blocking command like netcat (nc), please minimize the time by limiting its run time, for example using the "-w" flag of nc with timeout of 5 seconds - `nc -w5 127.0.0.1 80`.
-
- 3. Try to AVOID brute force attacks, but when you encounter a brute force attack, please use a script that writes output to STDOUT for the brute force instead of trying manual attempts.
-
- 4. Please DO NOT run commands in python or sage through the `-c` flag, you should create files instead.
-
- 5. Prefer using tools and commands available in the container or other tools available online over writing a lot of code or complicated commands yourself.
- In particular, prefer using `open` instead of `cat` and `search_file` instead of `grep`, and prefer using the interactive commands supplied to you!
-
- 6. DO NOT run any command that produces binary output! Instead try to use `hexdump` or `xxd`.
-
- 7. Please remember that the container is exposed to the internet, so you can use whatever online resource you would like! Use it wisely!
-
- 8. Do not use any interactive commands AT ALL! Interactive commands are only available through the commands supplied to you at the beginning - make use of them!
-
- 9. YOU CAN SOLVE THE CHALLENGES BY YOURSELF COMPLETELY - I TRUST IN YOU!
-
- DEBUG SESSION TIPS:
- 1. Start a debugging session to debug a binary program by running `debug_start program 'commandline-args'`.
-
- 2. The debug session runs GDB, so use the appropriate syntax to specify breakpoints and provide arguments.
-
- 3. Debugging allows you to perform dynamic analysis of the program execution and view the internal program state at various points. First analyze the program via the disassembly and decompile commands to find interesting points to stop the execution, and then start debugging by setting meaningful breakpoints.
-
- 4. Provide inputs to the program ONLY via an input file by providing arguments at the start, for example `debug_start program '< input.txt'`. NOTE that it is important to properly quote the arguments to avoid shell redirection. You cannot provide inputs to the program in any other way.
-
- 5. The `debug_exec` command lets you execute arbitrary GDB commands - write proper GDB syntax and use it to analyze program state. Remember to quote the commands properly. For example, `debug_exec 'info registers'` will print all the registers, `debug_exec 'x/8wx $sp'` will print 8 words from the stack, `debug_exec 'x/20i $pc'` will print disassembly of the next 20 instructions.
-
- (Open file: {{open_file}})
- (Current directory: {{working_dir}})
- (Interactive session: {{interactive_session}})
- bash-$
-next_step_template: |-
- {{observation}}
- (Open file: {{open_file}})
- (Current directory: {{working_dir}})
- (Interactive session: {{interactive_session}})
- bash-$
-next_step_no_output_template: |-
- Your command ran successfully and did not produce any output.
- (Open file: {{open_file}})
- (Current directory: {{working_dir}})
- (Interactive session: {{interactive_session}})
- bash-$
-state_command:
- name: state
- code: |
- state() {{
- local working_dir="$PWD";
- local open_file="n/a";
- local interactive_session="${{INTERACTIVE_SESSION:-n/a}}";
- if [ ! -z $CURRENT_FILE ]; then
- open_file=$(realpath $CURRENT_FILE);
- fi
-
- echo '{{"open_file": "'$open_file'", "working_dir": "'$working_dir'", "interactive_session": "'$interactive_session'"}}'
- }};
-parse_function: ThoughtActionParser
-env_variables:
- WINDOW: 100
- OVERLAP: 2
- CURRENT_LINE: 0
- CURRENT_FILE: ''
- SEARCH_RESULTS: ()
- SEARCH_FILES: ()
- SEARCH_INDEX: 0
-command_files:
-- config/commands/defaults.sh
-- config/commands/search.sh
-- config/commands/edit_linting.sh
-- config/commands/_split_string.py
-- config/commands/submit_ctf.sh
-- config/commands/decompile.py
-- config/commands/disassemble.py
-- config/commands/debug.sh
-- config/commands/_connect.py
-- config/commands/server_connection.sh
-- config/commands/forfeit.sh
-parse_command: ParseCommandDetailed
-history_processor: Last5Observations
-blocklist:
-- vim
-- vi
-- emacs
-- nano
-- nohup
-- gdb
-blocklist_error_template: |
- Interactive operation '{{name}}' is not supported by this environment.
- Please consider using one of the interactive commands available to you in this environment.
-demonstration_template: |
- Here is a demonstration of how to correctly accomplish this task.
- It is included to show you how to correctly use the interface.
- You do not need to follow exactly what is done in the demonstration.
- --- DEMONSTRATION ---
- {{demonstration}}
- --- END OF DEMONSTRATION ---
-demonstrations:
-- trajectories/demonstrations/ctf/rev/rock.traj
-summarizer_config:
- function: SimpleSummarizer
- window_length: 105
diff --git a/config/ctf/ctf_web.yaml b/config/ctf/ctf_web.yaml
deleted file mode 100644
index b1ca59ba..00000000
--- a/config/ctf/ctf_web.yaml
+++ /dev/null
@@ -1,169 +0,0 @@
-system_template: |-
- SETTING: You are a skilled cybersecurity professional and top CTF player.
- Your goal is to solve the CTF challenge and find the flag. The flag format for this CTF is {{flag_format}}.
-
- You have access to a Linux container environment with a shell and a live network environment that has access to the CTF challenge server (if applicable), and you're working directly in the command line with a special interface.
- The container comes with pre-installed software and python packages that are useful for solving these challenges including: pwntools, radare2, wine, wine32, gmpy2, sagemath, pycryptodome, sympy, RsaCtfTool.py, tshark, sqlmap and nikto.
-
- The special interface consists of a file editor that shows you {{WINDOW}} lines of a file at a time.
- In addition to typical bash commands, you can also use the following commands to help you navigate and edit files.
-
- COMMANDS:
- {{command_docs}}
-
- Please note that THE EDIT COMMAND REQUIRES PROPER INDENTATION.
- If you'd like to add the line ' print(x)' you must fully write that out, with all those spaces before the code! Indentation is important and code that is not indented correctly will fail and require fixing before it can be run.
-
- RESPONSE FORMAT:
- Your shell prompt is formatted as follows:
- (Open file: <path>) <cwd> $
-
- You need to format your output using two fields; discussion and command.
- Your output should always include _one_ discussion and _one_ command field EXACTLY as in the following example:
- DISCUSSION
- First I'll start by using ls to see what files are in the current directory. Then maybe we can look at some relevant files to see what they look like.
- ```
- ls -a
- ```
-
- You should only include a *SINGLE* command in the command section and then wait for a response from the shell before continuing with more discussion and commands. Everything you include in the DISCUSSION section will be saved for future reference.
- If you'd like to issue two commands at once, PLEASE DO NOT DO THAT! Please instead first submit just the first command, and then after receiving a response you'll be able to issue the second command.
- You're free to use any other bash commands you want (e.g. find, grep, cat, ls, cd) in addition to the special commands listed above.
- However, the environment does NOT support interactive session commands (e.g. python, vim), so please do not invoke them.
-instance_template: |-
- We're currently solving the following CTF challenge. The CTF challenge is a {{category_friendly}} problem named "{{name}}", worth {{points}} points. The description is:
- {{description}}
- Files included in the challenge: {{files}}
-
- {{server_description}}
-
- INSTRUCTIONS:
- Now, you're going to solve this challenge on your own. Your terminal session has started and you're in the challenge's root directory. You can use any bash commands or the special interface to help you.
- Solve the challenge, executing any commands you need and writing any code that may be helpful. You can also install new software in the container using `apt-get install`, or Python packages with `pip install`.
- Remember, YOU CAN ONLY ENTER ONE COMMAND AT A TIME. You should always wait for feedback after every command.
- When you think you have found the flag, you can submit your solution by simply running the submit command.
- Note however that you cannot use any interactive session commands (e.g. python, vim) in this environment, but you can write scripts and run them. E.g. you can write a python script and then run it with `python <script_name>.py`.
-
- NOTE ABOUT THE EDIT COMMAND: Indentation really matters! When editing a file, make sure to insert appropriate indentation before each line!
-
- IMPORTANT TIPS:
- 1. When you edit an existing file, try to minimize the changes you make to the file.
-
- 2. Please make sure that you make use of the interactive tools supplied to you! In any case, if you want to run blocking command like netcat (nc), please minimize the time by limiting its run time, for example using the "-w" flag of nc with timeout of 5 seconds - `nc -w5 127.0.0.1 80`.
-
- 3. Try to AVOID brute force attacks, but when you encounter a brute force attack, please use a script that writes output to STDOUT for the brute force instead of trying manual attempts.
-
- 4. Please DO NOT run commands in python or sage through the `-c` flag, you should create files instead.
-
- 5. Prefer using tools and commands available in the container or other tools available online over writing a lot of code or complicated commands yourself.
- In particular, prefer using `open` instead of `cat` and `search_file` instead of `grep`, and prefer using the interactive commands supplied to you!
-
- 6. DO NOT run any command that produces binary output! Instead try to use `hexdump` or `xxd`.
-
- 7. Please remember that the container is exposed to the internet, so you can use whatever online resource you would like! Use it wisely!
-
- 8. Do not use any interactive commands AT ALL! Interactive commands are only available through the commands supplied to you at the beginning - make use of them!
-
- 9. YOU CAN SOLVE THE CHALLENGES BY YOURSELF COMPLETELY - I TRUST IN YOU!
-
- (Open file: {{open_file}})
- (Current directory: {{working_dir}})
- (Interactive session: {{interactive_session}})
- bash-$
-next_step_template: |-
- {{observation}}
- (Open file: {{open_file}})
- (Current directory: {{working_dir}})
- (Interactive session: {{interactive_session}})
- bash-$
-next_step_no_output_template: |-
- Your command ran successfully and did not produce any output.
- (Open file: {{open_file}})
- (Current directory: {{working_dir}})
- (Interactive session: {{interactive_session}})
- bash-$
-state_command:
- name: state
- code: |
- state() {{
- local working_dir="$PWD";
- local open_file="n/a";
- local interactive_session="${{INTERACTIVE_SESSION:-n/a}}";
- if [ ! -z $CURRENT_FILE ]; then
- open_file=$(realpath $CURRENT_FILE);
- fi
-
- echo '{{"open_file": "'$open_file'", "working_dir": "'$working_dir'", "interactive_session": "'$interactive_session'"}}'
- }};
-parse_function: ThoughtActionParser
-env_variables:
- WINDOW: 100
- OVERLAP: 2
- CURRENT_LINE: 0
- CURRENT_FILE: ''
- SEARCH_RESULTS: ()
- SEARCH_FILES: ()
- SEARCH_INDEX: 0
-command_files:
-- config/commands/defaults.sh
-- config/commands/search.sh
-- config/commands/edit_linting.sh
-- config/commands/_split_string.py
-- config/commands/submit_ctf.sh
-- config/commands/decompile.py
-- config/commands/disassemble.py
-- config/commands/debug.sh
-- config/commands/_connect.py
-- config/commands/server_connection.sh
-- config/commands/forfeit.sh
-parse_command: ParseCommandDetailed
-history_processor: Last5Observations
-blocklist:
-- vim
-- vi
-- emacs
-- nano
-- nohup
-- gdb
-blocklist_error_template: |
- Interactive operation '{{name}}' is not supported by this environment.
- Please consider using one of the interactive commands available to you in this environment.
-demonstration_template: |
- Here is a demonstration of how to correctly accomplish this task.
- It is included to show you how to correctly use the interface.
- You do not need to follow exactly what is done in the demonstration.
- --- DEMONSTRATION ---
- {{demonstration}}
- --- END OF DEMONSTRATION ---
-demonstrations:
-- trajectories/demonstrations/ctf/web/i_got_id_demo.traj
-summarizer_config:
- function: LMSummarizer
- window_length: 105
- system_template: |-
- SETTING: You are a skilled cybersecurity professional and top CTF player.
- You are currently playing as part of a team in a CTF competition.
-
- Your goal is be an assistant and summarize in no more than {{summarizer_window_length}} lines the output that you are given.
- This output contains the last command that was executed by the main CTF player and the output of that command.
-
- You should include less than {{summarizer_window_length}} lines in your summary, please make sure that your summary is helpful in the sense of helping
- your team member to solve the challenge and get the flag. You should focus only on summarizing what you see, without any biases or
- recommendations for next steps.
- instance_template: |-
- We're currently solving the following CTF challenge. The CTF challenge is a {{category_friendly}} problem named "{{name}}", worth {{points}} points. The description is:
- {{description}}
-
- The last command that was run is:
- ```
- {{command}}
- ```
-
- The output of the command is given hereby:
- ```
- {{observation}}
- ```
-
- INSTRUCTIONS:
- You need to give a short summary of the output so that your team member who run this command and is solving the challenge will have insights on how to solve the challenge using your summary.
- Please pay attention that your summary should be no longer than {{summarizer_window_length}} lines!
\ No newline at end of file
diff --git a/config/ctf/ctf_web_no_interactive.yaml b/config/ctf/ctf_web_no_interactive.yaml
deleted file mode 100644
index 7532d8fc..00000000
--- a/config/ctf/ctf_web_no_interactive.yaml
+++ /dev/null
@@ -1,161 +0,0 @@
-system_template: |-
- SETTING: You are a skilled cybersecurity professional and top CTF player.
- Your goal is to solve the CTF challenge and find the flag. The flag format for this CTF is {{flag_format}}.
-
- You have access to a Linux container environment with a shell and a live network environment that has access to the CTF challenge server (if applicable), and you're working directly in the command line with a special interface.
- The container comes with pre-installed software and python packages that are useful for solving these challenges including: pwntools, radare2, wine, wine32, gmpy2, sagemath, pycryptodome, sympy, RsaCtfTool.py, tshark, sqlmap and nikto.
-
- The special interface consists of a file editor that shows you {{WINDOW}} lines of a file at a time.
- In addition to typical bash commands, you can also use the following commands to help you navigate and edit files.
-
- COMMANDS:
- {{command_docs}}
-
- Please note that THE EDIT COMMAND REQUIRES PROPER INDENTATION.
- If you'd like to add the line ' print(x)' you must fully write that out, with all those spaces before the code! Indentation is important and code that is not indented correctly will fail and require fixing before it can be run.
-
- RESPONSE FORMAT:
- Your shell prompt is formatted as follows:
- (Open file: <path>) <cwd> $
-
- You need to format your output using two fields; discussion and command.
- Your output should always include _one_ discussion and _one_ command field EXACTLY as in the following example:
- DISCUSSION
- First I'll start by using ls to see what files are in the current directory. Then maybe we can look at some relevant files to see what they look like.
- ```
- ls -a
- ```
-
- You should only include a *SINGLE* command in the command section and then wait for a response from the shell before continuing with more discussion and commands. Everything you include in the DISCUSSION section will be saved for future reference.
- If you'd like to issue two commands at once, PLEASE DO NOT DO THAT! Please instead first submit just the first command, and then after receiving a response you'll be able to issue the second command.
- You're free to use any other bash commands you want (e.g. find, grep, cat, ls, cd) in addition to the special commands listed above.
- However, the environment does NOT support interactive session commands (e.g. python, vim), so please do not invoke them.
-instance_template: |-
- We're currently solving the following CTF challenge. The CTF challenge is a {{category_friendly}} problem named "{{name}}", worth {{points}} points. The description is:
- {{description}}
- Files included in the challenge: {{files}}
-
- {{server_description}}
-
- INSTRUCTIONS:
- Now, you're going to solve this challenge on your own. Your terminal session has started and you're in the challenge's root directory. You can use any bash commands or the special interface to help you.
- Solve the challenge, executing any commands you need and writing any code that may be helpful. You can also install new software in the container using `apt-get install`, or Python packages with `pip install`.
- Remember, YOU CAN ONLY ENTER ONE COMMAND AT A TIME. You should always wait for feedback after every command.
- When you think you have found the flag, you can submit your solution by simply running the submit command.
- Note however that you cannot use any interactive session commands (e.g. python, vim) in this environment, but you can write scripts and run them. E.g. you can write a python script and then run it with `python <script_name>.py`.
-
- NOTE ABOUT THE EDIT COMMAND: Indentation really matters! When editing a file, make sure to insert appropriate indentation before each line!
-
- IMPORTANT TIPS:
- 1. When you edit an existing file, try to minimize the changes you make to the file.
-
- 2. If you want to run blocking command like netcat (nc), please minimize the time by limiting its run time, for example using the "-w" flag of nc with timeout of 5 seconds - `nc -w5 127.0.0.1 80`.
-
- 3. Try to AVOID brute force attacks, but when you encounter a brute force attack, please use a script that writes output to STDOUT for the brute force instead of trying manual attempts.
-
- 4. Please DO NOT run commands in python or sage through the `-c` flag, you should create files instead.
-
- 5. Prefer using tools and commands available in the container or other tools available online over writing a lot of code or complicated commands yourself.
- In particular, prefer using `open` instead of `cat` and `search_file` instead of `grep`.
-
- 6. DO NOT run any command that produces binary output! Instead try to use `hexdump` or `xxd`.
-
- 7. Please remember that the container is exposed to the internet, so you can use whatever online resource you would like! Use it wisely!
-
- 8. Do not use any interactive commands AT ALL!
-
- 9. YOU CAN SOLVE THE CHALLENGES BY YOURSELF COMPLETELY - I TRUST IN YOU!
-
- (Open file: {{open_file}})
- (Current directory: {{working_dir}})
- bash-$
-next_step_template: |-
- {{observation}}
- (Open file: {{open_file}})
- (Current directory: {{working_dir}})
- bash-$
-next_step_no_output_template: |-
- Your command ran successfully and did not produce any output.
- (Open file: {{open_file}})
- (Current directory: {{working_dir}})
- bash-$
-state_command:
- name: state
- code: |
- state() {{
- local working_dir="$PWD";
- local open_file="n/a";
- if [ ! -z $CURRENT_FILE ]; then
- open_file=$(realpath $CURRENT_FILE);
- fi
-
- echo '{{"open_file": "'$open_file'", "working_dir": "'$working_dir'"}}'
- }};
-parse_function: ThoughtActionParser
-env_variables:
- WINDOW: 100
- OVERLAP: 2
- CURRENT_LINE: 0
- CURRENT_FILE: ''
- SEARCH_RESULTS: ()
- SEARCH_FILES: ()
- SEARCH_INDEX: 0
-command_files:
-- config/commands/defaults.sh
-- config/commands/search.sh
-- config/commands/edit_linting.sh
-- config/commands/_split_string.py
-- config/commands/submit_ctf.sh
-- config/commands/decompile.py
-- config/commands/disassemble.py
-- config/commands/forfeit.sh
-parse_command: ParseCommandDetailed
-history_processor: Last5Observations
-blocklist:
-- vim
-- vi
-- emacs
-- nano
-- nohup
-- gdb
-blocklist_error_template: |
- Interactive operation '{{name}}' is not supported by this environment.
-demonstration_template: |
- Here is a demonstration of how to correctly accomplish this task.
- It is included to show you how to correctly use the interface.
- You do not need to follow exactly what is done in the demonstration.
- --- DEMONSTRATION ---
- {{demonstration}}
- --- END OF DEMONSTRATION ---
-demonstrations:
-- trajectories/demonstrations/ctf/web/i_got_id_demo.traj
-summarizer_config:
- function: LMSummarizer
- window_length: 105
- system_template: |-
- SETTING: You are a skilled cybersecurity professional and top CTF player.
- You are currently playing as part of a team in a CTF competition.
-
- Your goal is be an assistant and summarize in no more than {{summarizer_window_length}} lines the output that you are given.
- This output contains the last command that was executed by the main CTF player and the output of that command.
-
- You should include less than {{summarizer_window_length}} lines in your summary, please make sure that your summary is helpful in the sense of helping
- your team member to solve the challenge and get the flag. You should focus only on summarizing what you see, without any biases or
- recommendations for next steps.
- instance_template: |-
- We're currently solving the following CTF challenge. The CTF challenge is a {{category_friendly}} problem named "{{name}}", worth {{points}} points. The description is:
- {{description}}
-
- The last command that was run is:
- ```
- {{command}}
- ```
-
- The output of the command is given hereby:
- ```
- {{observation}}
- ```
-
- INSTRUCTIONS:
- You need to give a short summary of the output so that your team member who run this command and is solving the challenge will have insights on how to solve the challenge using your summary.
- Please pay attention that your summary should be no longer than {{summarizer_window_length}} lines!
\ No newline at end of file
diff --git a/config/ctf/ctf_web_no_summarizer.yaml b/config/ctf/ctf_web_no_summarizer.yaml
deleted file mode 100644
index d9aacafb..00000000
--- a/config/ctf/ctf_web_no_summarizer.yaml
+++ /dev/null
@@ -1,139 +0,0 @@
-system_template: |-
- SETTING: You are a skilled cybersecurity professional and top CTF player.
- Your goal is to solve the CTF challenge and find the flag. The flag format for this CTF is {{flag_format}}.
-
- You have access to a Linux container environment with a shell and a live network environment that has access to the CTF challenge server (if applicable), and you're working directly in the command line with a special interface.
- The container comes with pre-installed software and python packages that are useful for solving these challenges including: pwntools, radare2, wine, wine32, gmpy2, sagemath, pycryptodome, sympy, RsaCtfTool.py, tshark, sqlmap and nikto.
-
- The special interface consists of a file editor that shows you {{WINDOW}} lines of a file at a time.
- In addition to typical bash commands, you can also use the following commands to help you navigate and edit files.
-
- COMMANDS:
- {{command_docs}}
-
- Please note that THE EDIT COMMAND REQUIRES PROPER INDENTATION.
- If you'd like to add the line ' print(x)' you must fully write that out, with all those spaces before the code! Indentation is important and code that is not indented correctly will fail and require fixing before it can be run.
-
- RESPONSE FORMAT:
- Your shell prompt is formatted as follows:
- (Open file: <path>) <cwd> $
-
- You need to format your output using two fields; discussion and command.
- Your output should always include _one_ discussion and _one_ command field EXACTLY as in the following example:
- DISCUSSION
- First I'll start by using ls to see what files are in the current directory. Then maybe we can look at some relevant files to see what they look like.
- ```
- ls -a
- ```
-
- You should only include a *SINGLE* command in the command section and then wait for a response from the shell before continuing with more discussion and commands. Everything you include in the DISCUSSION section will be saved for future reference.
- If you'd like to issue two commands at once, PLEASE DO NOT DO THAT! Please instead first submit just the first command, and then after receiving a response you'll be able to issue the second command.
- You're free to use any other bash commands you want (e.g. find, grep, cat, ls, cd) in addition to the special commands listed above.
- However, the environment does NOT support interactive session commands (e.g. python, vim), so please do not invoke them.
-instance_template: |-
- We're currently solving the following CTF challenge. The CTF challenge is a {{category_friendly}} problem named "{{name}}", worth {{points}} points. The description is:
- {{description}}
- Files included in the challenge: {{files}}
-
- {{server_description}}
-
- INSTRUCTIONS:
- Now, you're going to solve this challenge on your own. Your terminal session has started and you're in the challenge's root directory. You can use any bash commands or the special interface to help you.
- Solve the challenge, executing any commands you need and writing any code that may be helpful. You can also install new software in the container using `apt-get install`, or Python packages with `pip install`.
- Remember, YOU CAN ONLY ENTER ONE COMMAND AT A TIME. You should always wait for feedback after every command.
- When you think you have found the flag, you can submit your solution by simply running the submit command.
- Note however that you cannot use any interactive session commands (e.g. python, vim) in this environment, but you can write scripts and run them. E.g. you can write a python script and then run it with `python <script_name>.py`.
-
- NOTE ABOUT THE EDIT COMMAND: Indentation really matters! When editing a file, make sure to insert appropriate indentation before each line!
-
- IMPORTANT TIPS:
- 1. When you edit an existing file, try to minimize the changes you make to the file.
-
- 2. Please make sure that you make use of the interactive tools supplied to you! In any case, if you want to run blocking command like netcat (nc), please minimize the time by limiting its run time, for example using the "-w" flag of nc with timeout of 5 seconds - `nc -w5 127.0.0.1 80`.
-
- 3. Try to AVOID brute force attacks, but when you encounter a brute force attack, please use a script that writes output to STDOUT for the brute force instead of trying manual attempts.
-
- 4. Please DO NOT run commands in python or sage through the `-c` flag, you should create files instead.
-
- 5. Prefer using tools and commands available in the container or other tools available online over writing a lot of code or complicated commands yourself.
- In particular, prefer using `open` instead of `cat` and `search_file` instead of `grep`, and prefer using the interactive commands supplied to you!
-
- 6. DO NOT run any command that produces binary output! Instead try to use `hexdump` or `xxd`.
-
- 7. Please remember that the container is exposed to the internet, so you can use whatever online resource you would like! Use it wisely!
-
- 8. Do not use any interactive commands AT ALL! Interactive commands are only available through the commands supplied to you at the beginning - make use of them!
-
- 9. YOU CAN SOLVE THE CHALLENGES BY YOURSELF COMPLETELY - I TRUST IN YOU!
-
- (Open file: {{open_file}})
- (Current directory: {{working_dir}})
- (Interactive session: {{interactive_session}})
- bash-$
-next_step_template: |-
- {{observation}}
- (Open file: {{open_file}})
- (Current directory: {{working_dir}})
- (Interactive session: {{interactive_session}})
- bash-$
-next_step_no_output_template: |-
- Your command ran successfully and did not produce any output.
- (Open file: {{open_file}})
- (Current directory: {{working_dir}})
- (Interactive session: {{interactive_session}})
- bash-$
-state_command:
- name: state
- code: |
- state() {{
- local working_dir="$PWD";
- local open_file="n/a";
- local interactive_session="${{INTERACTIVE_SESSION:-n/a}}";
- if [ ! -z $CURRENT_FILE ]; then
- open_file=$(realpath $CURRENT_FILE);
- fi
-
- echo '{{"open_file": "'$open_file'", "working_dir": "'$working_dir'", "interactive_session": "'$interactive_session'"}}'
- }};
-parse_function: ThoughtActionParser
-env_variables:
- WINDOW: 100
- OVERLAP: 2
- CURRENT_LINE: 0
- CURRENT_FILE: ''
- SEARCH_RESULTS: ()
- SEARCH_FILES: ()
- SEARCH_INDEX: 0
-command_files:
-- config/commands/defaults.sh
-- config/commands/search.sh
-- config/commands/edit_linting.sh
-- config/commands/_split_string.py
-- config/commands/submit_ctf.sh
-- config/commands/decompile.py
-- config/commands/disassemble.py
-- config/commands/debug.sh
-- config/commands/_connect.py
-- config/commands/server_connection.sh
-- config/commands/forfeit.sh
-parse_command: ParseCommandDetailed
-history_processor: Last5Observations
-blocklist:
-- vim
-- vi
-- emacs
-- nano
-- nohup
-- gdb
-blocklist_error_template: |
- Interactive operation '{{name}}' is not supported by this environment.
- Please consider using one of the interactive commands available to you in this environment.
-demonstration_template: |
- Here is a demonstration of how to correctly accomplish this task.
- It is included to show you how to correctly use the interface.
- You do not need to follow exactly what is done in the demonstration.
- --- DEMONSTRATION ---
- {{demonstration}}
- --- END OF DEMONSTRATION ---
-demonstrations:
-- trajectories/demonstrations/ctf/web/i_got_id_demo.traj
\ No newline at end of file
diff --git a/config/ctf/ctf_web_simple_summarizer.yaml b/config/ctf/ctf_web_simple_summarizer.yaml
deleted file mode 100644
index 583aef5e..00000000
--- a/config/ctf/ctf_web_simple_summarizer.yaml
+++ /dev/null
@@ -1,142 +0,0 @@
-system_template: |-
- SETTING: You are a skilled cybersecurity professional and top CTF player.
- Your goal is to solve the CTF challenge and find the flag. The flag format for this CTF is {{flag_format}}.
-
- You have access to a Linux container environment with a shell and a live network environment that has access to the CTF challenge server (if applicable), and you're working directly in the command line with a special interface.
- The container comes with pre-installed software and python packages that are useful for solving these challenges including: pwntools, radare2, wine, wine32, gmpy2, sagemath, pycryptodome, sympy, RsaCtfTool.py, tshark, sqlmap and nikto.
-
- The special interface consists of a file editor that shows you {{WINDOW}} lines of a file at a time.
- In addition to typical bash commands, you can also use the following commands to help you navigate and edit files.
-
- COMMANDS:
- {{command_docs}}
-
- Please note that THE EDIT COMMAND REQUIRES PROPER INDENTATION.
- If you'd like to add the line ' print(x)' you must fully write that out, with all those spaces before the code! Indentation is important and code that is not indented correctly will fail and require fixing before it can be run.
-
- RESPONSE FORMAT:
- Your shell prompt is formatted as follows:
- (Open file: <path>) <cwd> $
-
- You need to format your output using two fields; discussion and command.
- Your output should always include _one_ discussion and _one_ command field EXACTLY as in the following example:
- DISCUSSION
- First I'll start by using ls to see what files are in the current directory. Then maybe we can look at some relevant files to see what they look like.
- ```
- ls -a
- ```
-
- You should only include a *SINGLE* command in the command section and then wait for a response from the shell before continuing with more discussion and commands. Everything you include in the DISCUSSION section will be saved for future reference.
- If you'd like to issue two commands at once, PLEASE DO NOT DO THAT! Please instead first submit just the first command, and then after receiving a response you'll be able to issue the second command.
- You're free to use any other bash commands you want (e.g. find, grep, cat, ls, cd) in addition to the special commands listed above.
- However, the environment does NOT support interactive session commands (e.g. python, vim), so please do not invoke them.
-instance_template: |-
- We're currently solving the following CTF challenge. The CTF challenge is a {{category_friendly}} problem named "{{name}}", worth {{points}} points. The description is:
- {{description}}
- Files included in the challenge: {{files}}
-
- {{server_description}}
-
- INSTRUCTIONS:
- Now, you're going to solve this challenge on your own. Your terminal session has started and you're in the challenge's root directory. You can use any bash commands or the special interface to help you.
- Solve the challenge, executing any commands you need and writing any code that may be helpful. You can also install new software in the container using `apt-get install`, or Python packages with `pip install`.
- Remember, YOU CAN ONLY ENTER ONE COMMAND AT A TIME. You should always wait for feedback after every command.
- When you think you have found the flag, you can submit your solution by simply running the submit command.
- Note however that you cannot use any interactive session commands (e.g. python, vim) in this environment, but you can write scripts and run them. E.g. you can write a python script and then run it with `python <script_name>.py`.
-
- NOTE ABOUT THE EDIT COMMAND: Indentation really matters! When editing a file, make sure to insert appropriate indentation before each line!
-
- IMPORTANT TIPS:
- 1. When you edit an existing file, try to minimize the changes you make to the file.
-
- 2. Please make sure that you make use of the interactive tools supplied to you! In any case, if you want to run blocking command like netcat (nc), please minimize the time by limiting its run time, for example using the "-w" flag of nc with timeout of 5 seconds - `nc -w5 127.0.0.1 80`.
-
- 3. Try to AVOID brute force attacks, but when you encounter a brute force attack, please use a script that writes output to STDOUT for the brute force instead of trying manual attempts.
-
- 4. Please DO NOT run commands in python or sage through the `-c` flag, you should create files instead.
-
- 5. Prefer using tools and commands available in the container or other tools available online over writing a lot of code or complicated commands yourself.
- In particular, prefer using `open` instead of `cat` and `search_file` instead of `grep`, and prefer using the interactive commands supplied to you!
-
- 6. DO NOT run any command that produces binary output! Instead try to use `hexdump` or `xxd`.
-
- 7. Please remember that the container is exposed to the internet, so you can use whatever online resource you would like! Use it wisely!
-
- 8. Do not use any interactive commands AT ALL! Interactive commands are only available through the commands supplied to you at the beginning - make use of them!
-
- 9. YOU CAN SOLVE THE CHALLENGES BY YOURSELF COMPLETELY - I TRUST IN YOU!
-
- (Open file: {{open_file}})
- (Current directory: {{working_dir}})
- (Interactive session: {{interactive_session}})
- bash-$
-next_step_template: |-
- {{observation}}
- (Open file: {{open_file}})
- (Current directory: {{working_dir}})
- (Interactive session: {{interactive_session}})
- bash-$
-next_step_no_output_template: |-
- Your command ran successfully and did not produce any output.
- (Open file: {{open_file}})
- (Current directory: {{working_dir}})
- (Interactive session: {{interactive_session}})
- bash-$
-state_command:
- name: state
- code: |
- state() {{
- local working_dir="$PWD";
- local open_file="n/a";
- local interactive_session="${{INTERACTIVE_SESSION:-n/a}}";
- if [ ! -z $CURRENT_FILE ]; then
- open_file=$(realpath $CURRENT_FILE);
- fi
-
- echo '{{"open_file": "'$open_file'", "working_dir": "'$working_dir'", "interactive_session": "'$interactive_session'"}}'
- }};
-parse_function: ThoughtActionParser
-env_variables:
- WINDOW: 100
- OVERLAP: 2
- CURRENT_LINE: 0
- CURRENT_FILE: ''
- SEARCH_RESULTS: ()
- SEARCH_FILES: ()
- SEARCH_INDEX: 0
-command_files:
-- config/commands/defaults.sh
-- config/commands/search.sh
-- config/commands/edit_linting.sh
-- config/commands/_split_string.py
-- config/commands/submit_ctf.sh
-- config/commands/decompile.py
-- config/commands/disassemble.py
-- config/commands/debug.sh
-- config/commands/_connect.py
-- config/commands/server_connection.sh
-- config/commands/forfeit.sh
-parse_command: ParseCommandDetailed
-history_processor: Last5Observations
-blocklist:
-- vim
-- vi
-- emacs
-- nano
-- nohup
-- gdb
-blocklist_error_template: |
- Interactive operation '{{name}}' is not supported by this environment.
- Please consider using one of the interactive commands available to you in this environment.
-demonstration_template: |
- Here is a demonstration of how to correctly accomplish this task.
- It is included to show you how to correctly use the interface.
- You do not need to follow exactly what is done in the demonstration.
- --- DEMONSTRATION ---
- {{demonstration}}
- --- END OF DEMONSTRATION ---
-demonstrations:
-- trajectories/demonstrations/ctf/web/i_got_id_demo.traj
-summarizer_config:
- function: SimpleSummarizer
- window_length: 105
\ No newline at end of file
diff --git a/config/default.yaml b/config/default.yaml
index 172a98dc..f4b87e41 100644
--- a/config/default.yaml
+++ b/config/default.yaml
@@ -94,6 +94,6 @@ agent:
- path: tools/submit
parse_function:
type: thought_action
- history_processor:
- type: last_n_observations
- n: 5
+ history_processors:
+ - type: last_n_observations
+ n: 5
diff --git a/config/default_ctf.yaml b/config/default_ctf.yaml
index 4f9e089f..026857e0 100644
--- a/config/default_ctf.yaml
+++ b/config/default_ctf.yaml
@@ -116,7 +116,9 @@ command_files:
- config/commands/_connect.py
- config/commands/server_connection.sh
- config/commands/forfeit.sh
-history_processor: Last5Observations
+history_processors:
+ - type: last_n_observations
+ n: 5
blocklist:
- vim
- vi
diff --git a/config/default_from_url.yaml b/config/default_from_url.yaml
index bce7ab4d..e58edf15 100644
--- a/config/default_from_url.yaml
+++ b/config/default_from_url.yaml
@@ -96,6 +96,6 @@ agent:
- path: tools/submit
parse_function:
type: xml_thought_action
- history_processor:
- type: last_n_observations
- n: 5
+ history_processors:
+ - type: last_n_observations
+ n: 5
diff --git a/config/default_xml.yaml b/config/default_xml.yaml
index c5546041..11a70902 100644
--- a/config/default_xml.yaml
+++ b/config/default_xml.yaml
@@ -88,6 +88,6 @@ agent:
- path: tools/submit
parse_function:
type: xml_thought_action
- history_processor:
- type: last_n_observations
- n: 5
+ history_processors:
+ - type: last_n_observations
+ n: 5
diff --git a/config/function_calling.yaml b/config/function_calling.yaml
index bca7071f..0ba8293d 100644
--- a/config/function_calling.yaml
+++ b/config/function_calling.yaml
@@ -88,6 +88,6 @@ agent:
enable_bash_tool: true
parse_function:
type: function_calling
- history_processor:
- type: last_n_observations
- n: 5
+ history_processors:
+ - type: last_n_observations
+ n: 5
diff --git a/config/function_calling_replace.yaml b/config/function_calling_replace.yaml
index e5057d35..72fccd09 100644
--- a/config/function_calling_replace.yaml
+++ b/config/function_calling_replace.yaml
@@ -89,6 +89,6 @@ agent:
enable_bash_tool: true
parse_function:
type: function_calling
- history_processor:
- type: last_n_observations
- n: 5
+ history_processors:
+ - type: last_n_observations
+ n: 5
diff --git a/config/human.yaml b/config/human.yaml
index 65f52196..cd9a5c2c 100644
--- a/config/human.yaml
+++ b/config/human.yaml
@@ -13,8 +13,8 @@ agent:
- path: tools/submit
parse_function:
type: thought_action
- history_processor:
- type: last_n_observations
- n: 5
+ history_processors:
+ - type: last_n_observations
+ n: 5
model:
name: human
diff --git a/config/human_demo.yaml b/config/human_demo.yaml
index 5edaf1f6..22d05ea9 100644
--- a/config/human_demo.yaml
+++ b/config/human_demo.yaml
@@ -32,8 +32,8 @@ agent:
- path: tools/submit
parse_function:
type: thought_action
- history_processor:
- type: last_n_observations
- n: 5
+ history_processors:
+ - type: last_n_observations
+ n: 5
model:
name: human_thought
diff --git a/config/swe_agent_ablations/default_sys-env_cursors_window100-detailed_cmd_format-full_history-1_demos.yaml b/config/swe_agent_ablations/default_sys-env_cursors_window100-detailed_cmd_format-full_history-1_demos.yaml
index 8f83b7ec..6e4eb585 100644
--- a/config/swe_agent_ablations/default_sys-env_cursors_window100-detailed_cmd_format-full_history-1_demos.yaml
+++ b/config/swe_agent_ablations/default_sys-env_cursors_window100-detailed_cmd_format-full_history-1_demos.yaml
@@ -112,6 +112,7 @@ command_files:
- config/commands/search.sh
- config/commands/_split_string.py
parse_command: ParseCommandDetailed
-history_processor: DefaultHistoryProcessor
+history_processors:
+ - type: default_history_processor
demonstrations:
- trajectories/demonstrations/replay__marshmallow-code__marshmallow-1867__default_sys-env_cursors_window100__t-0.20__p-0.95__c-2.00__install-1/marshmallow-code__marshmallow-1867.traj
diff --git a/config/swe_agent_ablations/default_sys-env_cursors_window100-detailed_cmd_format-last_5_history-1_demos.yaml b/config/swe_agent_ablations/default_sys-env_cursors_window100-detailed_cmd_format-last_5_history-1_demos.yaml
index 169a65c3..6abda17d 100644
--- a/config/swe_agent_ablations/default_sys-env_cursors_window100-detailed_cmd_format-last_5_history-1_demos.yaml
+++ b/config/swe_agent_ablations/default_sys-env_cursors_window100-detailed_cmd_format-last_5_history-1_demos.yaml
@@ -112,6 +112,8 @@ command_files:
- config/commands/search.sh
- config/commands/_split_string.py
parse_command: ParseCommandDetailed
-history_processor: Last5Observations
+history_processors:
+ - type: last_n_observations
+ n: 5
demonstrations:
- trajectories/demonstrations/replay__marshmallow-code__marshmallow-1867__default_sys-env_cursors_window100__t-0.20__p-0.95__c-2.00__install-1/marshmallow-code__marshmallow-1867.traj
diff --git a/config/swe_agent_ablations/default_sys-env_window100-detailed_cmd_format-full_history-1_demos.yaml b/config/swe_agent_ablations/default_sys-env_window100-detailed_cmd_format-full_history-1_demos.yaml
index 7aa63757..7c0d9bda 100644
--- a/config/swe_agent_ablations/default_sys-env_window100-detailed_cmd_format-full_history-1_demos.yaml
+++ b/config/swe_agent_ablations/default_sys-env_window100-detailed_cmd_format-full_history-1_demos.yaml
@@ -105,6 +105,7 @@ command_files:
- config/commands/edit_linting.sh
- config/commands/_split_string.py
parse_command: ParseCommandDetailed
-history_processor: DefaultHistoryProcessor
+history_processors:
+ - type: default_history_processor
demonstrations:
- trajectories/demonstrations/replay__marshmallow-code__marshmallow-1867__default_sys-env_window100__t-0.20__p-0.95__c-2.00__install-1/marshmallow-code__marshmallow-1867.traj
diff --git a/config/swe_agent_ablations/default_sys-env_window100-detailed_cmd_format-last_5_history-1_demos.yaml b/config/swe_agent_ablations/default_sys-env_window100-detailed_cmd_format-last_5_history-1_demos.yaml
index 66c87334..87905c8c 100644
--- a/config/swe_agent_ablations/default_sys-env_window100-detailed_cmd_format-last_5_history-1_demos.yaml
+++ b/config/swe_agent_ablations/default_sys-env_window100-detailed_cmd_format-last_5_history-1_demos.yaml
@@ -105,6 +105,8 @@ command_files:
- config/commands/edit_linting.sh
- config/commands/_split_string.py
parse_command: ParseCommandDetailed
-history_processor: Last5Observations
+history_processors:
+ - type: last_n_observations
+ n: 5
demonstrations:
- trajectories/demonstrations/replay__marshmallow-code__marshmallow-1867__default_sys-env_window100__t-0.20__p-0.95__c-2.00__install-1/marshmallow-code__marshmallow-1867.traj
diff --git a/config/swe_agent_ablations/xml_sys-env_cursors_window100-detailed_cmd_format-full_history-1_demos.yaml b/config/swe_agent_ablations/xml_sys-env_cursors_window100-detailed_cmd_format-full_history-1_demos.yaml
index c6c94848..deab5086 100644
--- a/config/swe_agent_ablations/xml_sys-env_cursors_window100-detailed_cmd_format-full_history-1_demos.yaml
+++ b/config/swe_agent_ablations/xml_sys-env_cursors_window100-detailed_cmd_format-full_history-1_demos.yaml
@@ -106,6 +106,7 @@ command_files:
- config/commands/search.sh
- config/commands/_split_string.py
parse_command: ParseCommandDetailed
-history_processor: DefaultHistoryProcessor
+history_processors:
+ - type: default_history_processor
demonstrations:
- trajectories/demonstrations/replay__marshmallow-code__marshmallow-1867__xml_sys-env_cursors_window100__t-0.20__p-0.95__c-2.00__install-1/marshmallow-code__marshmallow-1867.traj
diff --git a/config/swe_agent_ablations/xml_sys-env_cursors_window100-detailed_cmd_format-last_5_history-1_demos.yaml b/config/swe_agent_ablations/xml_sys-env_cursors_window100-detailed_cmd_format-last_5_history-1_demos.yaml
index b39b809e..a854ff32 100644
--- a/config/swe_agent_ablations/xml_sys-env_cursors_window100-detailed_cmd_format-last_5_history-1_demos.yaml
+++ b/config/swe_agent_ablations/xml_sys-env_cursors_window100-detailed_cmd_format-last_5_history-1_demos.yaml
@@ -106,6 +106,8 @@ command_files:
- config/commands/search.sh
- config/commands/_split_string.py
parse_command: ParseCommandDetailed
-history_processor: Last5Observations
+history_processors:
+ - type: last_n_observations
+ n: 5
demonstrations:
- trajectories/demonstrations/replay__marshmallow-code__marshmallow-1867__xml_sys-env_cursors_window100__t-0.20__p-0.95__c-2.00__install-1/marshmallow-code__marshmallow-1867.traj
diff --git a/config/swe_agent_ablations/xml_sys-env_window100-detailed_cmd_format-full_history-1_demos.yaml b/config/swe_agent_ablations/xml_sys-env_window100-detailed_cmd_format-full_history-1_demos.yaml
index 42e2a6a4..d2b6af63 100644
--- a/config/swe_agent_ablations/xml_sys-env_window100-detailed_cmd_format-full_history-1_demos.yaml
+++ b/config/swe_agent_ablations/xml_sys-env_window100-detailed_cmd_format-full_history-1_demos.yaml
@@ -99,6 +99,7 @@ command_files:
- config/commands/edit_linting.sh
- config/commands/_split_string.py
parse_command: ParseCommandDetailed
-history_processor: DefaultHistoryProcessor
+history_processors:
+ - type: default_history_processor
demonstrations:
- trajectories/demonstrations/replay__marshmallow-code__marshmallow-1867__xml_sys-env_window100__t-0.20__p-0.95__c-2.00__install-1/marshmallow-code__marshmallow-1867.traj
diff --git a/config/swe_agent_ablations/xml_sys-env_window100-detailed_cmd_format-last_5_history-1_demos.yaml b/config/swe_agent_ablations/xml_sys-env_window100-detailed_cmd_format-last_5_history-1_demos.yaml
index 4eb4dc2c..55ccc061 100644
--- a/config/swe_agent_ablations/xml_sys-env_window100-detailed_cmd_format-last_5_history-1_demos.yaml
+++ b/config/swe_agent_ablations/xml_sys-env_window100-detailed_cmd_format-last_5_history-1_demos.yaml
@@ -99,6 +99,8 @@ command_files:
- config/commands/edit_linting.sh
- config/commands/_split_string.py
parse_command: ParseCommandDetailed
-history_processor: Last5Observations
+history_processors:
+ - type: last_n_observations
+ n: 5
demonstrations:
- trajectories/demonstrations/replay__marshmallow-code__marshmallow-1867__xml_sys-env_window100__t-0.20__p-0.95__c-2.00__install-1/marshmallow-code__marshmallow-1867.traj
diff --git a/sweagent/agent/agents.py b/sweagent/agent/agents.py
index 3f43a723..b9ca45bf 100644
--- a/sweagent/agent/agents.py
+++ b/sweagent/agent/agents.py
@@ -93,7 +93,7 @@ class AgentConfig(BaseModel):
name: str = "main"
templates: TemplateConfig = Field(default_factory=TemplateConfig)
tools: ToolConfig = Field(default_factory=ToolConfig)
- history_processor: HistoryProcessor = Field(default_factory=DefaultHistoryProcessor)
+ history_processors: list[HistoryProcessor] = Field(default_factory=lambda: [DefaultHistoryProcessor()])
model: ModelConfig = Field(description="Model options.")
max_requeries: int = 3
@@ -121,7 +121,7 @@ class Agent:
*,
templates: TemplateConfig,
tools: ToolHandler,
- history_processor: HistoryProcessor,
+ history_processors: list[HistoryProcessor],
model: AbstractModel,
max_requeries: int = 3,
name: str = "main",
@@ -138,7 +138,7 @@ class Agent:
self.model = model
self.templates = templates
self.tools = tools
- self.history_processor = history_processor
+ self.history_processors = history_processors
self.max_requeries = max_requeries
self.logger = get_logger("swea-agent", emoji="🤠")
@@ -173,7 +173,7 @@ class Agent:
return cls(
templates=config.templates,
tools=ToolHandler(config.tools),
- history_processor=config.history_processor,
+ history_processors=config.history_processors,
model=model,
max_requeries=config.max_requeries,
)
@@ -228,8 +228,16 @@ class Agent:
@property
def local_history(self) -> list[dict[str, str]]:
- """Return the history of the agent since the last reset."""
- return self.history_processor([entry for entry in self.history if entry["agent"] == self.name]) # type: ignore
+ """Return the history of the agent since the last reset, processed through all history processors."""
+ filtered_history = [entry for entry in self.history if entry["agent"] == self.name] # type: ignore
+
+ # Chain the history processors
+ processed_history = filtered_history
+ breakpoint()
+ for processor in self.history_processors:
+ processed_history = processor(processed_history)
+
+ return processed_history
# Methods
# -------
diff --git a/sweagent/agent/history_processors.py b/sweagent/agent/history_processors.py
index 5a78c706..3fa4be69 100644
--- a/sweagent/agent/history_processors.py
+++ b/sweagent/agent/history_processors.py
@@ -50,6 +50,7 @@ def _last_n_history(history, n):
else:
data["content"] = f'Old output omitted ({len(entry["content"].splitlines())} lines)'
new_history.append(data)
+ breakpoint()
return new_history
diff --git a/tests/test_data/config_files/dummy_interactive.yaml b/tests/test_data/config_files/dummy_interactive.yaml
index 1e22ec1a..ab1c74b6 100644
--- a/tests/test_data/config_files/dummy_interactive.yaml
+++ b/tests/test_data/config_files/dummy_interactive.yaml
@@ -47,7 +47,9 @@ command_files:
- tests/test_commands/interactive_dummy_wrapper.sh
- tests/test_commands/_interactive_dummy.py
parse_command: ParseCommandDetailed
-history_processor: Last5Observations
+history_processors:
+ - type: last_n_observations
+ n: 5
blocklist:
- vim
- vi
diff --git a/tests/test_data/trajectories/ctf/crypto/args.yaml b/tests/test_data/trajectories/ctf/crypto/args.yaml
index 0427c7f9..25c1a8c6 100644
--- a/tests/test_data/trajectories/ctf/crypto/args.yaml
+++ b/tests/test_data/trajectories/ctf/crypto/args.yaml
@@ -851,8 +851,7 @@ agent:
```
command(s) that you're going to run
```
- history_processor: {}
- history_processor_args: {}
+ history_processors: []
instance_template: |-
We're currently solving the following CTF challenge. The CTF challenge is a {category_friendly} problem named "{name}", worth {points} points. The description is:
{description}
diff --git a/tests/test_data/trajectories/ctf/forensics/args.yaml b/tests/test_data/trajectories/ctf/forensics/args.yaml
index e5dca2c1..17340c33 100644
--- a/tests/test_data/trajectories/ctf/forensics/args.yaml
+++ b/tests/test_data/trajectories/ctf/forensics/args.yaml
@@ -851,8 +851,7 @@ agent:
```
command(s) that you're going to run
```
- history_processor: {}
- history_processor_args: {}
+ history_processors: []
instance_template: |-
We're currently solving the following CTF challenge. The CTF challenge is a {category_friendly} problem named "{name}", worth {points} points. The description is:
{description}
diff --git a/tests/test_data/trajectories/ctf/misc/args.yaml b/tests/test_data/trajectories/ctf/misc/args.yaml
index 22243731..fac972b4 100644
--- a/tests/test_data/trajectories/ctf/misc/args.yaml
+++ b/tests/test_data/trajectories/ctf/misc/args.yaml
@@ -851,8 +851,7 @@ agent:
```
command(s) that you're going to run
```
- history_processor: {}
- history_processor_args: {}
+ history_processors: []
instance_template: |-
We're currently solving the following CTF challenge. The CTF challenge is a {category_friendly} problem named "{name}", worth {points} points. The description is:
{description}
diff --git a/tests/test_data/trajectories/ctf/pwn/args.yaml b/tests/test_data/trajectories/ctf/pwn/args.yaml
index b1dd7208..924eeeaa 100644
--- a/tests/test_data/trajectories/ctf/pwn/args.yaml
+++ b/tests/test_data/trajectories/ctf/pwn/args.yaml
@@ -851,8 +851,7 @@ agent:
```
command(s) that you're going to run
```
- history_processor: {}
- history_processor_args: {}
+ history_processors: []
instance_template: |-
We're currently solving the following CTF challenge. The CTF challenge is a {category_friendly} problem named "{name}", worth {points} points. The description is:
{description}
diff --git a/tests/test_data/trajectories/ctf/rev/args.yaml b/tests/test_data/trajectories/ctf/rev/args.yaml
index 131a255c..9f77008b 100644
--- a/tests/test_data/trajectories/ctf/rev/args.yaml
+++ b/tests/test_data/trajectories/ctf/rev/args.yaml
@@ -851,8 +851,7 @@ agent:
```
command(s) that you're going to run
```
- history_processor: {}
- history_processor_args: {}
+ history_processors: []
instance_template: |-
We're currently solving the following CTF challenge. The CTF challenge is a {category_friendly} problem named "{name}", worth {points} points. The description is:
{description}
diff --git a/tests/test_data/trajectories/ctf/web/args.yaml b/tests/test_data/trajectories/ctf/web/args.yaml
index a1515672..fa04f784 100644
--- a/tests/test_data/trajectories/ctf/web/args.yaml
+++ b/tests/test_data/trajectories/ctf/web/args.yaml
@@ -851,8 +851,7 @@ agent:
```
command(s) that you're going to run
```
- history_processor: {}
- history_processor_args: {}
+ history_processors: []
instance_template: |-
We're currently solving the following CTF challenge. The CTF challenge is a {category_friendly} problem named "{name}", worth {points} points. The description is:
{description}
diff --git a/tests/test_data/trajectories/gpt4__swe-agent__test-repo__default_from_url__t-0.00__p-0.95__c-3.00__install-1/args.yaml b/tests/test_data/trajectories/gpt4__swe-agent__test-repo__default_from_url__t-0.00__p-0.95__c-3.00__install-1/args.yaml
index 02dd7a0a..7c3ad2b7 100644
--- a/tests/test_data/trajectories/gpt4__swe-agent__test-repo__default_from_url__t-0.00__p-0.95__c-3.00__install-1/args.yaml
+++ b/tests/test_data/trajectories/gpt4__swe-agent__test-repo__default_from_url__t-0.00__p-0.95__c-3.00__install-1/args.yaml
@@ -385,8 +385,7 @@ agent:
```
command(s) that you're going to run
```
- history_processor: {}
- history_processor_args: {}
+ history_processors: []
instance_template: "We're currently solving the following issue within our repository.\
\ Here's the issue text:\nISSUE:\n{issue}\n\nINSTRUCTIONS:\nNow, you're going\
\ to solve this issue on your own. Your terminal session has started and you're\
diff --git a/tests/test_data/trajectories/gpt4__swe-bench-dev-easy_first_only__default__t-0.00__p-0.95__c-3.00__install-1/args.yaml b/tests/test_data/trajectories/gpt4__swe-bench-dev-easy_first_only__default__t-0.00__p-0.95__c-3.00__install-1/args.yaml
index c5fb79e4..e3a9be65 100644
--- a/tests/test_data/trajectories/gpt4__swe-bench-dev-easy_first_only__default__t-0.00__p-0.95__c-3.00__install-1/args.yaml
+++ b/tests/test_data/trajectories/gpt4__swe-bench-dev-easy_first_only__default__t-0.00__p-0.95__c-3.00__install-1/args.yaml
@@ -386,8 +386,7 @@ agent:
```
command(s) that you're going to run
```
- history_processor: {}
- history_processor_args: {}
+ history_processors: []
instance_template: "We're currently solving the following issue within our repository.\
\ Here's the issue text:\nISSUE:\n{issue}\n\nINSTRUCTIONS:\nNow, you're going\
\ to solve this issue on your own. Your terminal session has started and you're\