Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 

Repository files navigation

Exploit Defence Notes

These notes are a random collection of links, talking points, simple explanations and interesting posts relating to Exploit Defence, i.e. mitigations and bypasses relating to arbitrary-code execution vulnerabilities.

This is not a tutorial, nor a review of any particular product or a critique of any specific technique, it's just a collection of interesting things related to the general field of exploit defence.

This is also not intended to be complete; it's more of a collection of things that came up in recent conversations, or that were interesting in some other way. If you're a friend of mine in this field and didn't get a specific reference, I'm sorry :( This is a work in progress, so, sections will be incomplete and you'll probably see yourself cited before too long :)

Shameless plug: if you're interested in these things, check out The Shellcoder's Handbook:

https://www.wiley.com/en-gb/The+Shellcoder%27s+Handbook%3A+Discovering+and+Exploiting+Security+Holes%2C+2nd+Edition-p-9780470080238

It's old (2007 old) but the basics are still the basics. Other great foundational books in this space are "Hacking: The Art of Exploitation" by Jon Erickson, and "Reversing: Secrets of Reverse Engineering" by Eldad Eilam.

NCC Exploit Mitigations Repo

The EDG Team at NCC created some excellent notes on exploit mitigations across platforms:

https://github.com/nccgroup/exploit_mitigations

Research Links

Classical Literature

Some Categories of Vuln

...with occasional CWE references (the CWE taxonomy is debatable but generally great)

Some Exploit Techniques

Use After Free 30 second Walkthrough

Use a pointer after the referenced memory has been free()d.

Example: WidgetAPI; allocWidget(), freeWidget(), getWidgetID(), setWidgetID(). Calling alloc, free, then get() returns whatever is in the location and set() sets whatever is in the location (e.g. a pointer)

Type Confusion 30 second Walkthrough

Call, passing a pointer or handle of the wrong type. This allows data/pointer members to become accessible and shenanegans ensue.

Example: API for type A and B. We pass a handle to B to a call to an A method. Can be read, write primitive, or even call/jmp. Requires reverse engineering to understand the exact pattern of interactions with the data.

Some good exploit/research writeups

Reversing Tools

(Non-obvious) Code patterns leading to issues

  • unbounded copies, obvs. Not just strcat... consider the bound, where it comes from, whether it's always correct
  • sprintf %s
  • Fixed 'max size' output buffer is smaller than max possible output
  • freeFoo(ptr->subPtr) without nulling (dangling ptr; use after free)
  • Incorrect use of bound-limited copies, e.g. strlcpy, strncpy, eg with strlen(src) as max

About

Exploit Defence Notes

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors