pwnfreeeasy

Restaurant

hackthebox

"Welcome to our Restaurant. Here, you can eat and drink as much as you want! Just don't overdo it.." A 64-bit ELF binary for a "Rocky Restaurant" menu program. Choose to "Fill my dish" (option 1) or "Drink something" (option 2). The `fill()` function has a classic stack buffer overflow — 32-byte buf

$ ls tags/ techniques/
stack_alignmentret2libcrop_chaingot_leak_via_putstwo_stage_exploit

$ cat /etc/rate-limit

Rate limit reached (20 reads/hour per IP). Showing preview only — full content returns at the next hour roll-over.

Restaurant — HackTheBox

Description

"Welcome to our Restaurant. Here, you can eat and drink as much as you want! Just don't overdo it.."

A 64-bit ELF binary for a "Rocky Restaurant" menu program. Choose to "Fill my dish" (option 1) or "Drink something" (option 2). The fill() function has a classic stack buffer overflow — 32-byte buffer but reads up to 1024 bytes. No canary, no PIE, NX enabled, Full RELRO. Bundled libc is GLIBC 2.27 (Ubuntu 18.04).

Remote: nc 154.57.164.65:30349

Files

  • restaurant — ELF 64-bit LSB executable, x86-64, dynamically linked, not stripped
  • libc.so.6 — Ubuntu GLIBC 2.27-3ubuntu1.4

Analysis

Binary Properties

PropertyValue
Archx86-64
RELROFull
Stack CanaryNone
NXEnabled
PIEDisabled (base 0x400000)
StrippedNo
CompilerGCC 7.5.0
LibcGLIBC 2.27-3ubuntu1.4

Key Addresses (Static — No PIE)

SymbolAddress
main0x400f68
fill0x400e4a
drink0x400eed
puts@PLT0x400650
puts@GOT0x601fa8
pop rdi; ret0x4010a3
ret0x40063e

Libc Offsets (GLIBC 2.27)

SymbolOffset
puts0x80aa0
system0x4f550
"/bin/sh"0x1b3e1a

Program Flow

...

$ grep --similar

Similar writeups