Task 18.1 - echo string challenge working over the network

This commit is contained in:
thomashaw
2018-08-10 16:07:28 +01:00
committed by ts
parent 8726af5dd2
commit 54038f9098
2 changed files with 10 additions and 2 deletions

View File

@@ -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

View File

@@ -10,7 +10,13 @@
<base platform="linux" type="server"/>
<!-- 1) Default uses an account and drops the challenge in the users home directory -->
<vulnerability module_path=".*echo_string.*"/>
<!--<vulnerability module_path=".*echo_string.*"/>-->
<vulnerability module_path=".*echo_string.*">
<input into="port">
<value>1337</value>
</input>
</vulnerability>
<network type="private_network" range="dhcp"/>
</system>