Git Product home page Git Product logo

pwn-cheatsheet's Introduction

pwn-cheatsheet

CTF pwnable challenge cheatsheet

Cheatsheet

Vuln Type Protections Limits or Specials Method Links
stack overflow None None 1
stack overflow NX None 2
stack overflow NX RELRO None 3
stack overflow NX RELRO CANARY canary in forked threads 4
heap overflow NX chunk size can be 0x70~0x7f 5
heap overflow NX RELRO chunk size can't be 0x70~0x7f 6
heap overflow NX RELRO able to overwrite top size 7

Available Choices

Methods

Find a gadget like jump sp then put shellcode on stack, jump sp will jump to stack then execute shellcode.

Find gadgets to setup ROP chain to call mprotect on any page available, then read shellcode to that page, and then jump there and execute it.

Find gadgets to setup ROP chain to call read to read shell path and call execve.

Find gadgets to setup ROP chain to write GOT address(so we can get libc address) and read, then setup call to system so we are able to call shell.

Since the canary in threads is the same as main thread so we can bruteforce the canary in sub-threads.

Fastbin attack GOT can be applied when size can be range(0x70, 0x7f), since the highest byte of libc address should be 0x7f, then using cut the address trick to allocate to GOT.

With ASLR on, heap address is randomized even the highest byte. We can abuse the addresses in main_arena's bins(fastbins or normal bins) to allocate to main_arena then change meta-data in main_arena like top chunk address to allocate anywhere we want

This idea comes from 34c3ctf simplegc. Since tcache will not check fastbin size when allocating and copying, we can bypass the header limits(allocating fastbin chunk's size must be consistent) check.

Use house of force attack to overwrite top size to very large. Then allocate a large chunk to complete jump over the gap, so next allocation will be where we want.

Contribution

You are welcomed to make your contribution, just use oridinary issue and pull-request methods. Try not to change the framework directly in your PR, send an issue first if you have some thoughts about that.

Currently this project is still in progress, we need you to help us. :)

Note that the Available Choices part we only list those that are more related to that situation. So, we don't need to repeat the methods since we have the agreement that the methods of more strict situation can be applied to easier ones.

pwn-cheatsheet's People

Contributors

escapingbug avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.