Home
Github
  • 👋Welcome !
  • 🚩CTF Writeups
    • SKR CTF
      • Binary
        • Auth Me 2.0
      • Misc
        • Schrodinger's Cat 2
      • Reverse Engineering
        • Nogard 3
    • osu!gaming CTF 2024
      • pwn
        • betterthanu
    • Crackmes
      • PieIsMyFav
      • Plain Sight
    • WolvCTF 2024
      • pwn
        • babypwn
    • TexSAW CTF 2024
      • rev
        • Catch The White Rabbit
      • Forensics
        • Malicious Threat
        • MalWhere?
    • SwampCTF 2024
      • Misc
        • Lost Some Magic
        • The Time Equations
    • pwnable.kr
      • Toddler's Bottle
        • fd
    • Codegate CTF 2024
      • ai
        • ai_warmup
    • Junior Crypt CTF 2024
      • Misc
        • Terms of Use
      • Forensics
        • Admin Rights
        • Confusion
      • PPC
        • l33t
    • IHack 2024 Qualification
      • DFIR
        • Happy SPLUNKing
      • Malware
        • Confusing Javascript
    • Malcore Challenge
    • Intern Task
      • SQLI
  • 📮Room/Machine
    • HTB - Sherlock
      • DFIR
        • Brutus
        • Unit42
        • Jingle Bell
  • 📚Notes
    • CTF Related
      • pwn
        • pwntools
        • Format String Vulnerability
        • Integer Overflow
        • Executable Properties
        • gdb-gef
        • Template Script
      • b2r/koth
    • Assembly Language
    • x86 Architecture
  • 🛠️Tools
    • DFIR
    • Malware Analysis
    • Essentials
  • 👽Threat Hunting
    • Intro
    • Common Tactics
    • Methodologies
    • Types of threat hunting
  • 😸whoami
    • About Me
    • Other
      • FYP
  • Archives
    • 3108 CTF
      • Kategori
        • Tugasan Utama : Warkah Untuk Perwira
          • Tugasan I : Seruan Perwira
          • Tugasan II : Tali Barut
          • Warkah Akhir
        • Web
          • Lemah
          • Pantun Pantul
          • Wantujus
          • Wantusom
        • Reverse Engineering
          • Pa+rio+ik
          • Sarawak
        • Network
          • Johan
          • Lagi-lagi Johan
        • Misc
          • 3108 CTF Town
          • Mencari Rahsia Si Dia
        • Cryptography
          • 1957bit
          • Nasihat
          • Selamat Malam
        • OSINT
          • Pertemuan Kapisata : Babak I
          • Pertemuan Kapista : Babak II
          • Pertemuan Kapista : Finale
    • Curtin CTF 2023
      • Pwn n Rev
        • Classic Bufferoverflow
        • Intro to Buffer Overflow
        • Don't Go Overboard
        • Don't Go Overboard 2
        • Let The Random Games Begin1
        • Let The Random Games Begin 2
        • Let The Random Games Begin 3
    • 1337UP LIVE CTF
      • Pwn
        • Floor Mat Store
    • HTB University CTF 2023
      • Reverse Engineering
        • Windows Of Opportunity
Powered by GitBook
On this page
  1. Notes
  2. CTF Related
  3. pwn

Executable Properties

When you run checksec, this will show

    Arch:     amd64-64-little
    RELRO:    Partial RELRO
    Stack:    No canary found
    NX:       NX enabled
    PIE:      PIE enabled

Relocation Read-Only

Definition : This feature controls the permissions of the relocation table

  • Full RELRO - ensures that the relocation table is read-only after the program starts

  • Partial RELRO - some parts of the relocation table are still writable

//To Enable Full
gcc -o filename filename.c -Wl,-z,relro,-z,now

//To Enable Partial
gcc -o filename filename.c -Wl,-z,relro

//To Disable
gcc -o filename filename.c

Canary Value

Definition : is a random value placed on the stack before the return address. it helps detect buffer overflows by checking whether the canary value has been altered.

  • Canary found

  • No canary found

//To Enable
gcc -o filename filename.c -fstack-protector

//To Disable
gcc -o filename filename.c -fno-stack-protector

No eXecute

Definition : This feature marks sections of memory as non-executable, preventing the execution of code in those regions

  • NX enabled - preventing the execution of code on the stack

  • NX disabled - can execute code on the stack

//To Enable
gcc -o filename filename.c -z noexecstack

//To Disable
gcc -o filename filename.c -z execstack

Position Independent Executable

Definition : enables the randomization of the base address of the executable and its libraries, making it more difficult for attackers to predict the location of specific functions or gadgets in memory

  • PIE enabled - the binary can be loaded at different addresses in memory each time the program is executed

  • No PIE - the binary is not Position Independent, and its base address is fixed

//To Enable
gcc -o filename filename.c -fPIE -pie

//To Disable
gcc -o filename filename.c

Last updated 1 year ago

📚