본문 바로가기

wargame/vortex

vortex0

문제는 이렇다.

Your goal is to connect to port 5842 on vortex.labs.overthewire.org and read in 4 unsigned integers in host byte order. Add these integers together and send back the results to get a username and password for vortex1. This information can be used to log in using SSH.

Note: vortex is on an 32bit x86 machine (meaning, a little endian architecture)

vortex.labs.overthewire.org 5842로 접속해서 4의 정수를 읽어서 더한뒤 다시 보내면 vortex1의 username과 패스워드를 보내준다고 한다.

그것을 사용해서 SSH로 접속하면 된다고 한다.


다음과 같이 파이썬으로 코드를 짜서 해결했다.


from socket import *

from struct import *

 

 

p  = lambda x : pack("<L",x)

up = lambda x : unpack("<L",x)

 

HOST = "vortex.labs.overthewire.org"

PORT = 5842

 

 

s=socket(AF_INET,SOCK_STREAM)

s.connect((HOST,PORT))

 

key = 0

for i in range(4):

    data = up(s.recv(4))

    key += data[0]

s.send(p(key))

print s.recv(100)

s.close()


[+]result




'wargame > vortex' 카테고리의 다른 글

vortex5  (0) 2014.06.08
vortex4  (0) 2014.05.25
vortex3  (0) 2014.05.21
vortex2  (0) 2014.05.21
vortex1  (0) 2014.04.28