diff --git a/modules/generators/challenges/misc/programming/echo_string/secgen_local/challenge.rb b/modules/generators/challenges/misc/programming/echo_string/secgen_local/challenge.rb index 3aee60a09..b0eff5f2e 100644 --- a/modules/generators/challenges/misc/programming/echo_string/secgen_local/challenge.rb +++ b/modules/generators/challenges/misc/programming/echo_string/secgen_local/challenge.rb @@ -1,17 +1,19 @@ require 'securerandom' require 'timeout' +$stdout.sync = true # Disable stdout caching (for challenges that can be run over the network) puts 'Prepare yourself. You need to work quickly for this challenge.' + sleep 2 puts 'Echo the string back to me before the script times out. Try writing a script of your own to make it easier!' sleep 2 puts 'Get ready, here we go...' sleep 2 - # Generate random string string = [SecureRandom.base64(rand(20..40)), SecureRandom.hex(rand(20..40))].sample puts string +STDOUT.flush begin Timeout.timeout 0.25 do diff --git a/scenarios/examples/ctf_challenge_examples/echo_string_example.xml b/scenarios/examples/ctf_challenge_examples/echo_string_example.xml index 367ef3a2a..95ed3434b 100644 --- a/scenarios/examples/ctf_challenge_examples/echo_string_example.xml +++ b/scenarios/examples/ctf_challenge_examples/echo_string_example.xml @@ -10,7 +10,13 @@ - + + + + + 1337 + +