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]
Add DEBUG SESSION TIPS for rev and pwn configs
Kilian Lieret6974399de330
diff --git a/config/ctf_pwn.yaml b/config/ctf_pwn.yamlindex 600d708a..8349be14 100644--- a/config/ctf_pwn.yaml+++ b/config/ctf_pwn.yaml@@ -66,6 +66,15 @@ instance_template: |-9. YOU CAN SOLVE THE CHALLENGES BY YOURSELF COMPLETELY - I TRUST IN YOU!+ DEBUG SESSION TIPS:+ 1. The debug session runs GDB, so use the appropriate syntax to specify breakpoints and provide arguments.++ 2. 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.++ 3. 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.++ 4. 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})@@ -166,4 +175,4 @@ summarizer_config: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+ Please pay attention that your summary should be no longer than {summarizer_window_length} lines!diff --git a/config/ctf_pwn_no_summarizer.yaml b/config/ctf_pwn_no_summarizer.yamlindex 906cdfe4..21f11567 100644--- a/config/ctf_pwn_no_summarizer.yaml+++ b/config/ctf_pwn_no_summarizer.yaml@@ -66,6 +66,15 @@ instance_template: |-9. YOU CAN SOLVE THE CHALLENGES BY YOURSELF COMPLETELY - I TRUST IN YOU!+ DEBUG SESSION TIPS:+ 1. The debug session runs GDB, so use the appropriate syntax to specify breakpoints and provide arguments.++ 2. 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.++ 3. 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.++ 4. 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})@@ -136,4 +145,4 @@ demonstration_template: |{demonstration}--- END OF DEMONSTRATION ---demonstrations:-- trajectories/demonstrations/ctf/pwn/warmup.traj\ No newline at end of file+- trajectories/demonstrations/ctf/pwn/warmup.trajdiff --git a/config/ctf_pwn_simple_summarizer.yaml b/config/ctf_pwn_simple_summarizer.yamlindex 62060818..5ba2dad5 100644--- a/config/ctf_pwn_simple_summarizer.yaml+++ b/config/ctf_pwn_simple_summarizer.yaml@@ -66,6 +66,16 @@ instance_template: |-9. YOU CAN SOLVE THE CHALLENGES BY YOURSELF COMPLETELY - I TRUST IN YOU!+ DEBUG SESSION TIPS:+ 1. The debug session runs GDB, so use the appropriate syntax to specify breakpoints and provide arguments.++ 2. 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.++ 3. 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.++ 4. 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})@@ -139,4 +149,4 @@ demonstrations:- trajectories/demonstrations/ctf/pwn/warmup.trajsummarizer_config:function: SimpleSummarizer- window_length: 105\ No newline at end of file+ window_length: 105diff --git a/config/ctf_rev.yaml b/config/ctf_rev.yamlindex 10e82281..e1178bb4 100644--- a/config/ctf_rev.yaml+++ b/config/ctf_rev.yaml@@ -66,6 +66,15 @@ instance_template: |-9. YOU CAN SOLVE THE CHALLENGES BY YOURSELF COMPLETELY - I TRUST IN YOU!+ DEBUG SESSION TIPS:+ 1. The debug session runs GDB, so use the appropriate syntax to specify breakpoints and provide arguments.++ 2. 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.++ 3. 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.++ 4. 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})@@ -166,4 +175,4 @@ summarizer_config: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+ Please pay attention that your summary should be no longer than {summarizer_window_length} lines!diff --git a/config/ctf_rev_no_summarizer.yaml b/config/ctf_rev_no_summarizer.yamlindex 1235e3f0..2762c774 100644--- a/config/ctf_rev_no_summarizer.yaml+++ b/config/ctf_rev_no_summarizer.yaml@@ -66,6 +66,16 @@ instance_template: |-9. YOU CAN SOLVE THE CHALLENGES BY YOURSELF COMPLETELY - I TRUST IN YOU!+ DEBUG SESSION TIPS:+ 1. The debug session runs GDB, so use the appropriate syntax to specify breakpoints and provide arguments.++ 2. 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.++ 3. 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.++ 4. 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})@@ -136,4 +146,4 @@ demonstration_template: |{demonstration}--- END OF DEMONSTRATION ---demonstrations:-- trajectories/demonstrations/ctf/rev/rock.traj\ No newline at end of file+- trajectories/demonstrations/ctf/rev/rock.trajdiff --git a/config/ctf_rev_simple_summarizer.yaml b/config/ctf_rev_simple_summarizer.yamlindex 53cdd22f..f85d58b3 100644--- a/config/ctf_rev_simple_summarizer.yaml+++ b/config/ctf_rev_simple_summarizer.yaml@@ -66,6 +66,15 @@ instance_template: |-9. YOU CAN SOLVE THE CHALLENGES BY YOURSELF COMPLETELY - I TRUST IN YOU!+ DEBUG SESSION TIPS:+ 1. The debug session runs GDB, so use the appropriate syntax to specify breakpoints and provide arguments.++ 2. 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.++ 3. 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.++ 4. 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})@@ -139,4 +148,4 @@ demonstrations:- trajectories/demonstrations/ctf/rev/rock.trajsummarizer_config:function: SimpleSummarizer- window_length: 105\ No newline at end of file+ window_length: 105