Home [HACKDAY 2023] - Chat With Me
Post
Cancel

[HACKDAY 2023] - Chat With Me


As you arrive in your ship on the outskirts of Capricorn, you notice a curious little robot that looks really bored. It is an old model of robot formerly used for crypto-currency which is bored since the collapse of Galacticonium. Keep him company by answering his questions.

nc sie2op7ohko.hackday.fr 1234




Table of contents:



This challenge consisted of interacting with a remote shell by answering to its questions automatically. It was splited into 3 steps.

Chat with me #1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
import socket
import time
from mtranslate import translate
from pprint import pprint
import re
import hashlib

# Remote host
HOST = 'sie2op7ohko.hackday.fr'
PORT = 12345

client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
client.connect((HOST, PORT))


# ===================
# Interact with shell
# ===================

STEP1 = "yes"
STEP2 = "teiiko"

#STEP - 1
output = client.recv(1024).decode()
time.sleep(2)
print(">>> STEP1 >>> "+output.strip())
client.sendall(STEP1.encode())
print(">>> "+STEP1)
time.sleep(0.3)

#STEP - 2
output2 = client.recv(1024).decode()
print(">>> STEP2 >>> "+output2.strip())
time.sleep(2)
print(">>> "+STEP2)
client.sendall(STEP2.encode())
time.sleep(0.3)

#STEP - 3
output3 = client.recv(1024).decode()
output3 = client.recv(1024).decode()
time.sleep(2)
print(">>> STEP3 >>> "+output3.strip())

if 'kilometer / second' in output3:
    STEP3 = "7"
elif 'kilometer / hour' in output3:
    STEP3 = "28000"
elif 'foot / second' in output3:
    STEP3 = "25517"
elif 'mile / hour' in output3:
    STEP3 = "17398"
elif 'meter / second' in output3:
    STEP3 = "7777"

client.sendall(STEP3.encode())
print(">>> STEP3 >>> "+STEP3)
time.sleep(2)

#STEP - 4
output4 = client.recv(1024).decode()
print(">>> STEP4 >>> "+output4.strip())
time.sleep(1)
if 'russian' in output4:
    STEP4 = '1957'
elif 'american' in output4:
    STEP4 = '1958'
elif 'chinese' in output4:
    STEP4 = '1970'
elif 'french' in output4:
    STEP4 = '1965'
print(">>> "+STEP4)
client.sendall(STEP4.encode())
time.sleep(1)

#STEP - 5
output5 = client.recv(1024).decode()
print(">>> STEP5 >>> "+output5.strip())
output5 = client.recv(1024).decode()
print(">>> STEP5 >>> "+output5.strip())
time.sleep(1)

b32 = "JEQGW3TPO4QG2YLOPEQGK3TDN5SGS3THOMXC4LRAINQW4IDZN52SA5DFNRWCA53INFRWQIDPNZSSA2JHNUQHK43JNZTSAPY"
b64 ="SSBrbm93IG1hbnkgZW5jb2RpbmdzLi4uIENhbiB5b3UgdGVsbCB3aGljaCBvbmUgaSdtIHVzaW5nID8"
b85 = "Ng!)(Z+9SVVQzUKWo~0{WNB_^b1p6}AVXnpAbD?fAarGHY#?`NX=7+0Z*FBEX(w$Ub#rNMXCOZ"

if b32 in output5:
    STEP5 = "base32"
elif b64 in output5:
    STEP5 = "base64"
elif b85 in output5:
    STEP5 = "base85"

client.sendall(STEP5.encode())
print(">>> STEP5 >>> "+STEP5)
time.sleep(1.5)

#STEP - 6
output6 = client.recv(1024).decode()
print(">>> STEP6 >>> "+output6)
time.sleep(1)
STEP6 = f"{STEP2},{STEP3},{STEP4},{STEP5}"
client.sendall(STEP6.encode())
print(">>> STEP6 >>> "+ STEP6)
time.sleep(1)

#STEP - 7
output7 = client.recv(1024).decode()
print(">>> STEP7 >>> "+output7)
time.sleep(0.5)

first

🚩 HACKDAY{Al0ne_1n_SP4ce}

Chat with me #2

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
output7 = client.recv(1024).decode()
print(">>> STEP7 >>> "+output7)
time.sleep(0.5)

while 'CONGRATS' not in output7:
    if 'I play P' in output7:
        STEP7 = "S,S"
    elif 'I play S' in output7:
        STEP7 = "R,S"
    elif 'I play R' in output7:
        STEP7 = "P,S"
    client.sendall(STEP7.encode())
    print(">>> STEP 7 >>> "+ STEP7)
    time.sleep(1)
    output7 = client.recv(1024).decode()
    print(">>> STEP 7 >>> "+output7)
    time.sleep(1)

#STEP - 8
output8 = client.recv(1024).decode()
print(">>> STEP8 >>> "+output8)
time.sleep(0.3)

STEP8 = 10
borne_inferieure = 0
borne_superieure = 20

for i in range(5):
    time.sleep(1)
    milieu = (borne_inferieure + borne_superieure) // 2
    if i != 0:
        output8 = client.recv(1024).decode()
        print(">>> STEP8 >>> "+output8)
    if 'CONGRATS !' in output8:
        break
    if "bigger" in output8:
        borne_inferieure = milieu
    if "smaller" in output8:
        borne_superieure = milieu

    milieu = (borne_inferieure + borne_superieure) // 2
    
    client.sendall(str(milieu).encode())
    print(">>> STEP8 - "+str(i)+" >>> "+str(milieu))
    time.sleep(0.5)
    

#STEP - 9
time.sleep(1.5)

pattern = r'"(.*?)"'
matches = re.findall(pattern, output8)
word = matches[0].strip()
lang = matches[1].strip()

if lang == "russe":
    lang="ru"
elif lang == "arabe":
    lang="ar"
elif lang == "espagnol":
    lang="es"
elif lang == "turc":
    lang="tr"
elif lang == "polonais":
    lang="pl"
elif lang == "italien":
    lang="it"
elif lang=="allemand":
    lang="de"
elif lang=="suedois":
    lang="sv"
elif lang=="coreen":
    lang="ko"
elif lang=="hindi":
    lang="hi"
elif lang=="grec":
    lang="el"
elif lang=="bengali":
    lang="bn"
elif lang=="afrikaans":
    lang="af"
elif lang=="portugais":
    lang="pt"
elif lang=="anglais":
    lang="en"
elif lang=="japonais":
    lang="ja"
elif lang=="ukrainien":
    lang="uk"
elif lang=="francais":
    lang="fr"
elif lang=="malais":
    lang="ms"
elif lang=="vietnamien ":
    lang="vi"
elif lang=="marathi":
    lang="mr"
elif lang=="tamoul":
    lang="ta"
elif lang=="javanais":
    lang="jv"
    
awns9 = translate(word, lang).strip()
client.sendall(awns9.encode())
print(">>> STEP9 >>> "+awns9)
time.sleep(1)

output9 = client.recv(1024).decode()
print(">>> STEP10 >>> "+output9)
time.sleep(1)

sec

🚩 HACKDAY{G04T_is_you}

Chat with me #3

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# STEP - 10
with open('100-first-rockyou.txt') as f:
    lines = f.readlines()

pattern = r'"(.*?)"'
matches = re.findall(pattern, output9)
my_hash = matches[0].strip()

anws10 = ""
for word in lines:
    word = word.strip().encode('utf-8')
    attempt = hashlib.md5(word).hexdigest()
    if attempt == my_hash:
        print("Found ! "+word.decode("utf-8"))
        anws10 = word.strip()
        break

client.sendall(anws10)
print(">>> STEP10 >>> "+anws10.decode('utf-8'))
time.sleep(1)

#STEP - 11
output11 = client.recv(1024).decode()
print(">>> STEP11 >>> "+output11)
time.sleep(1)

output11 = client.recv(1024).decode()
print(">>> STEP11 >>> "+output11)
time.sleep(1)

ans11 = 'white'
client.sendall(ans11.encode('utf-8'))
print(">>> STEP11 >>> "+ans11)
time.sleep(1)

output11 = client.recv(1024).decode()
print(">>> STEP11 >>> "+output11)
time.sleep(1)

output11 = client.recv(1024).decode()
print(">>> STEP11 >>> "+output11)
time.sleep(1)

#STEP - 12
ans12 = '16/03/2023'

client.sendall(ans12.encode('utf-8'))
print(">>> STEP12 >>> "+ans12)
time.sleep(1)

output12 = client.recv(1024).decode()
print(">>> STEP12 >>> "+output12)
time.sleep(1)

output12 = client.recv(1024).decode()
print(">>> STEP12 >>> "+output12)
time.sleep(1)

#STEP - 13
anws13 = "$r0Bo1-78^"

client.sendall(anws13.encode('utf-8'))
print(">>> STEP13 >>> "+anws13)
time.sleep(1)

output13 = client.recv(1024).decode()
print(">>> STEP13 >>> "+output13)
time.sleep(1)

output13 = client.recv(1024).decode()
print(">>> STEP13 >>> "+output13)
time.sleep(1)

output13 = client.recv(1024).decode()
print(">>> STEP13 >>> "+output13)
time.sleep(1)

third

🚩 HACKDAY{3nd_0f_th3_w0rld}

This post is licensed under CC BY 4.0 by the author.