728x90
๋ฐ์ํ
๋ฌธ์ ๋ด์ฉ
TCP ํ๋กํ ์ฝ์ ์ฌ์ฉํ์ฌ ์ด ํ
์คํธ๋ฅผ ์์ํ๋ ค๋ฉด ๋คํธ์ํฌ ์์ผ์ ์๋ ํ๋ก๊ทธ๋จ์ ์ฐ๊ฒฐํด์ผ ํฉ๋๋ค.
ํ๋ก๊ทธ๋จ์์ ๋ณด๋ธ ์ธ์ฝ๋ฉ๋ ๋ฌธ์์ด์ ํด๋
ํด์ผ ํฉ๋๋ค.
ํ๋ก๊ทธ๋จ์ด ๋ฌธ์์ด์ ๋ณด๋ธ ์๊ฐ๋ถํฐ 2์ด ์ด๋ด์ ์ ๋ต์ ๋ณด๋ด์ผ ํฉ๋๋ค.
๋ต์ ๋ฌธ์์ด๋ก ๋ณด๋ด์ผ ํฉ๋๋ค.
์ ๋ต ์ฝ๋
"""
To start this test using the TCP protocol, you need to connect to a program on a network socket.
You must decode the encoded character string sent by the program.
You have 2 seconds to send the correct answer from the moment the program sends you the string.
The answer must be sent as a string.
Challenge connection informations
Host challenge01.root-me.org
Protocol TCP
Port 52023
"""
import socket
import base64
def main():
host = "challenge01.root-me.org"
port = 52023
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
s.connect((host, port))
data = s.recv(1024)
print(data.decode())
string = data.decode().split("my string is '")[1].split("'")[0]
result = base64.b64decode(string).decode() + "\n"
print(result)
s.sendall(result.encode())
data = s.recv(1024)
print(data.decode())
if __name__ == "__main__":
main()
728x90
๋ฐ์ํ
'๐ดCTF > Root Me' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
Root Me - TCP - Back to school (0) | 2024.02.16 |
---|---|
Root Me - Encoding - ASCII (0) | 2024.02.16 |
Root Me - CSP Bypass - Inline code (0) | 2024.02.15 |