Bug Hunter


Bug Hunting in Hard Targets

  1. Developer mindset vs Adversarial mindset - Code review as a bug hunter is often different from code reviewing as part of feature change. As a bug hunter you are only focusing on how to circumvent a control or use in a way it was not intended. Learning this mindset is key
  2. Going Deep vs Going Wide - Researching a target there is a trade off between going deep and going wide. If you have no knowledge then going wide helps to discover potential weak areas and build up a mental model. At some point it becomes important to focus down and refine
  3. Target Biases - Its common to think because something is well established then there will be less bugs lurking there. However, most software is evolving and new features are constant being added. This new code is often a really good source of bugs.
  4. Fuzzing Enhancements - As code moves on over time, developers need to create test code. This means that often this new code misses test coverage or has no tests at all. Binary diffing, API change logs and software update analysis are a great way to extend fuzzer coverage.
  5. Code/binary review lead fuzzing - It can be very challenging to spot certain bugs using only code review or binary analysis. Combing the approach allows to identify complexity and focus fuzzing to weak areas which may lead to vulns you would have not spotted
  6. Variant Analysis - As a researcher most of the bugs you find will not be particularly novel and are generally abstractions of a common vulnerability pattern. Knowing how to recognise these patterns and integrating into your toolset to allow faster identification is a must
  7. Research Tracking - In the area you are researching it is important to keep up-to date on published material. As new attack surfaces are unearthed or new vulnerability classes are identified then taking this knowledge and integrating it into your tooling is important.
  8. Collaboration - You can get quite far solo in bug hunting, however being able to work in a team allows effective use of the team members specialisation and allows for distribution of work. It helps with motivation on the VR emotional rollercoaster when failure is common.
  9. Bug Tracking - Whilst going for the most impact as possible is the goal, reaching that goal may require many other lesser impact vulnerabilities chained together. As you are performing your research it is important to make notes of literally anything of potential value.
  10. Target Knowledge Base - Whilst you are doing this research and afterwards it is important to maintain a target knowledge based. Building on existing knowledge is much easier than coming from zero knowledge of the target. Really helps if you switch between targets lots.

Windows Kernel Exploitation

  1. The most complete and recent overview of the Windows Kernel Segment Heap from an exploitation perspective.

    https://www.sstic.org/media/SSTIC2020/SSTIC-actes/pool_overflow_exploitation_since_windows_10_19h1/SSTIC2020-Article-pool_overflow_exploitation_since_windows_10_19h1-bayet_fariello.pdf

  2. Two articles I wrote on what I assumed was a similar WNF technique seen in the wild to understand how this subsystem could have been abused and the vuln

    CVE-2021-31956 Exploiting the Windows Kernel (NTFS with WNF) - Part 1

    CVE-2021-31956 Exploiting the Windows Kernel (NTFS with WNF) - Part 2

  3. A use-after-free in clfs.sys, then uses a similar WNF technique as explained in the previous tweet to enable better primitives and techniques mentioned in Scoop the Windows 10 Pool to perform heap grooming. Data only attack escalation

    Exploiting a use-after-free in Windows Common Logging File System (CLFS) - Exodus Intelligence

  4. A novel post exploitation primitive unique to Windows 11 22H2+ which can turn an arbitrary write/inc into full read and write of kernel memory by abusing I/O Ring and its operations. A POC was also released

    One I/O Ring to Rule Them All: A Full Read/Write Exploit Primitive on Windows 11

    https://github.com/yardenshafir/IoRingReadWritePrimitive

  5. Win32k has been a huge source of kernel bugs over the years. This talk goes into more than 15 bugs _arkon found and the novel bug class, attack techniques and mitigation by MSFT.

  6. Investigates the bug class of arbitrary kernel pointer read (i.e. pointers read from attacker controlled input do not point to userspace). Investigates the true impact (i.e. DOS or second order info leak only?) or code exec / LPE

    Exploring a New Class of Kernel Exploit Primitive

  7. HCVI aims to mitigate an attacker being able too execute unsigned code within the Windows Kernel. 33y0re looks how HVCI affects a typical kernel exploit and shows a way which with arb read/write can call kernel functions without triggering HVCI/kCFG

    Exploit Development: No Code Execution? No Problem! Living The Age of VBS, HVCI, and Kernel CFG

  8. In these two a trick to trap access to virtual memory which could be used exploiting certain types of bugs and another on hunting for bugs within Mini-Filter drivers.

    Windows Exploitation Tricks: Trapping Virtual Memory Access

    Hunting for Bugs in Windows Mini-Filter Drivers

  9. Actually looking at what Windows vulns are being exploited within the wild (in this case font bugs and CSRSS bug analysis) provides defenders with insights on where to focus their mitigation and detection efforts.

    In-the-Wild Series: Windows Exploits

  10. by rohitwas on finishing off KASLR where previously KUSER_SHARED_DATA was always mapped at a fixed page of memory within the kernel. The post shows strengthening KASLR in Windows by mitigating the last remaining blind-write target RCE could use

    Randomizing the KUSER_SHARED_DATA Structure on Windows

Linux Vulnerability Research

  1. Understanding and Improving Linux Kernel Exploit Reliability

    https://www.sstic.org/media/SSTIC2020/SSTIC-actes/pool_overflow_exploitation_since_windows_10_19h1/SSTIC2020-Article-pool_overflow_exploitation_since_windows_10_19h1-bayet_fariello.pdf

  2. userfaultfd technique is dead on most Linux distros due to vm.unprivileged_userfaultfd. Fuse has come through as a good replacement for this technique.

    Put an io_uring on it: Exploiting the Linux Kernel

    CVE-2022-0185 - Winning a $31337 Bounty after Pwning Ubuntu and Escaping Google’s KCTF Containers

  3. Syzkaller is a game changer in kernel. There’s a few things to say 1) Even existing publics grammars can find bugs when targeted at areas. 2) Extending coverage is a quick way to find bugs 3) N-day often sits around in https://syzkaller.appspot.com/upstream

    syzkaller/syscall_descriptions.md at master · google/syzkaller

    Tutorial on describing new subsystems

    🔍 Looking for Remote Code Execution bugs in the Linux kernel

    Using syzkaller, part 3: Fuzzing your changes

    Debian-GNU-Linux-Profiles/syzkaller_crash_demo.md at master · hardenedlinux/Debian-GNU-Linux-Profiles

    CVE-2022-1972: out-of-bound write in Linux netfilter subsystem leads to local privilege escalation

  4. So N-day often just sitting around.. KCTF encourages researchers to triage existing bugs and develop new techniques to bypass existing mitigations

    Trick & Treat! 🎃 Paying Leets and Sweets for Linux Kernel privescs and k8s escapes

    both 0-day/N-day. As a researcher you can learn a lot from past bugs:

    public kCTF Responses - Google Drive

  5. Keeping on top of mitigations in your head is hard. Especially if you are working on multiple platforms.

    https://github.com/nccgroup/exploit_mitigations

    to try to help track these. Really early days, but any contributions appreciated!

  6. Finding the correct size structures with elements you want to control at certain offsets with them is tedious and time consuming. CodeQL massively helps speed up this process.mmolgtm article

    One day short of a full chain: Part 1 - Android Kernel arbitrary code execution

    shows a query which can be used for this.

  7. The msg_msg technique which has been a favorite by exploit writes used in

    CVE-2022-0185 - Winning a $31337 Bounty after Pwning Ubuntu and Escaping Google’s KCTF Containers

    CVE-2021-22555: Turning \x00\x00 into 10000$

    The Discovery and Exploitation of CVE-2022-25636

    becomes less useful in 5.14 when GFP_KERNEL_ACCOUNT end up in kmalloc-cg-* caches and your vulnerable object is not.

  8. Talking of kmalloc cache’s, cross-cache attacks are a thing and can be used when its not possible to find an interesting object within your initial target cache. Markak_ describes this and other factors to consider when evaluating AUTOSLAB

    How AUTOSLAB Changes the Memory Unsafety Game

  9. This list wouldn’t be complete andreyknvl and a13xp0p0v with linkersec and

    https://github.com/xairy/linux-kernel-exploitation

    which goes into way more things going back over the years.

  10. Finally, if this kind of research interests you! My team at nccgroupinfosec position open currently at

    Exploit Developer

macOS vulnerability research

Alex Plaskett on Twitter: “1/18 As 2021 is starting to come towards and end, now seems to be good time to look back at all the great macOS vulnerability research / exploit development published during the year! Tried to keep to macOS mainly but obviously there’s some crossover with iOS research too. 🧵 / Twitter”

Vulnerability Research CVs

Alex Plaskett on Twitter: “1/ As someone who has reviewed hundreds of CVs for job applications in the past, I just want to highlight some personal tips for vulnerability researchers in order to maximise their applications (i.e. outside typical career history and education). 🧵 pic.twitter.com/S4yEHzHXVn / Twitter”

Impactful books

Alex Plaskett on Twitter: “I am often asked what books have had the most impact to me in security. This is a really tough question as I have read so many, however, here are some I have have on my shelf and why they were important to me👇 pic.twitter.com/Uk5PbXa4gO / Twitter”

Reference

https://twitter.com/alexjplaskett


文章作者: unr4v31
版权声明: 本博客所有文章除特別声明外,均采用 CC BY 4.0 许可协议。转载请注明来源 unr4v31 !
  目录