Ahmad Mahfouz

Hi, I’m Ahmad Mahfouz

Application Security Manager at ServiceNow — Personal blog sharing thoughts, security research, and engineering experiments.

Latest Articles

View All Articles →

SCCM: Tampering with Deployment Boundaries for Privilege Escalation

In large-scale enterprise environments, centralized software deployment automation provides tremendous operational efficiency for both employees and IT departments. However, delegating software installation self-service to unprivileged users introduces subtle security boundary assumptions that attackers can exploit to achieve local privilege escalation (NT AUTHORITY\SYSTEM). When standard enterprise users are permitted to initiate software installations on demand via Software Center, third-party installer packages are often executed within the SYSTEM security context. Because most commercial software installers were originally engineered assuming an interactive local administrator session rather than automated headless deployment, this architectural mismatch creates high-impact security vulnerabilities: DLL search-order hijacking, insecure temporary directory usage, and file-creation race conditions. ...

August 1, 2025 · 7 min · 1324 words · Ahmad Mahfouz

Cross-Domain Escalation: Child-to-Forest Compromise via SID History and Golden Tickets

In complex enterprise networks, Active Directory is typically deployed as a multi-domain forest. An organization begins with a forest root domain (e.g., UNIXAWY.CORP) and branches into child domains for geographic regions, business units, or acquisitions (e.g., operators.unixawy.corp). A common security misconception is that a child domain functions as a security boundary. In an Active Directory forest, the forest is the only true security boundary—the domain is simply an administrative boundary. ...

May 24, 2020 · 3 min · 542 words · Ahmad Mahfouz

Linux Heap Memory Architecture: Chunks, Bins, and Allocators

Unlike stack memory which grows downward from high addresses and is automatically managed via function call frames, Heap memory grows upward from lower addresses and is managed explicitly at runtime via dynamic allocation. Understanding heap layout and allocator metadata is fundamental to analyzing heap exploitation primitives (such as use-after-free, heap overflows, fastbin dupes, and unlink exploitation). Core Allocation Primitives malloc(size): Requests size bytes from the heap and returns a generic pointer. The returned memory is uninitialized. calloc(num, size): Allocates memory for an array and initializes all bytes to zero (mitigates information disclosure bugs). realloc(ptr, size): Resizes an existing heap block, either expanding in-place or allocating a new region, copying existing data, and freeing the old chunk. free(ptr): Releases the allocated chunk back to the heap manager. Kernel Interface: brk/sbrk vs. mmap The userspace memory allocator (e.g., Glibc’s ptmalloc) interacts with the Linux kernel using two primary system calls: ...

May 22, 2020 · 3 min · 561 words · Ahmad Mahfouz

Fixing IDA Pro Error: 'The debugger could not attach... you don't have the necessary privileges'

While attempting to attach the IDA Pro debugger to a 64-bit target process on Windows (e.g., using the Local Windows Debugger or Windbg backend), you may encounter this error dialog: “The debugger could not attach to the selected process. This can perhaps indicate the process was just terminated, or that you don’t have the necessary privileges.” Even when running ida64.exe as Administrator with full High Mandatory Integrity tokens, Windows access control restrictions, process isolation (PPL/Protected Process Light), or SeDebugPrivilege token handling can prevent IDA’s GUI from attaching directly. ...

August 1, 2019 · 2 min · 233 words · Ahmad Mahfouz

Lightweight Exploit Development Interface Using .gdbinit Hooks

When debugging binaries during exploit development or wargames, third-party frameworks like GEF, Pwndbg, or Peda provide helpful dashboard views. However, in restricted testing environments, CTF shells, or isolated embedded targets, you may not have internet access or Python dependencies installed to run external tools. You can configure vanilla GDB to provide an automated register and stack inspection view using native define hook-stop hooks in ~/.gdbinit. Custom ~/.gdbinit Configuration Create or update ~/.gdbinit in your home directory: ...

February 4, 2019 · 2 min · 239 words · Ahmad Mahfouz

Learning How to Learn: Cognitive Strategies and Mental Models for Engineers

Technical engineering domains—systems security, reverse engineering, kernel architecture, and network protocols—require assimilating dense, complex information rapidly. Mastering technical skills is not simply a function of study hours; it depends on understanding the underlying cognitive mechanics of human memory and information retention. 1. Focused vs. Diffuse Thinking Modes The human brain alternates between two distinct cognitive operating modes: Focused Mode: High-concentration, direct analytical attention focused on solving known problem sets using familiar neural pathways. Diffuse Mode: Big-picture, subconscious contemplation occurring during relaxation, walking, or resting. Diffuse thinking allows disparate regions of the brain to synthesize novel connections and resolve conceptual roadblocks. The Pomodoro Technique To prevent cognitive fatigue while training focused attention: ...

November 16, 2018 · 3 min · 441 words · Ahmad Mahfouz
Browse All Articles →