Add check_file_dir module and command for remote file/dir existance checks#1137
Add check_file_dir module and command for remote file/dir existance checks#1137Hackndo wants to merge 2 commits intoPennyw0rth:mainfrom
Conversation
Module checks for file or directory existence on a remote host using MS-EVEN RPC without requiring admin privileges. Signed-off-by: Pixis <hackndo@gmail.com>
Signed-off-by: Pixis <hackndo@gmail.com>
|
Excuse me what?? This is wild😳 Thanks for the PR! |
|
Nice ! |
|
Super cool! :o |
|
@Hackndo it looks like its possible to write arbitrary files in addition to just checking their existence, is there a reason you didn't have the module do both, since the code is already in the linked repo? It could leverage an ACTION option that is read/write. The module could be named CVE-2025-29969 which is pretty clear then. |
|
Because the write issue has been fixed. I wanted this module to use an unfixed (and "legit") feature. Moreover, the arbitrary write requires to open an SMB server with a TOCTOU exploit, leveraging a valid evtx file that is updated on the fly. Edit: I'm not sure that temporary smb server is supported by netexec, plus it would require
And writing arbitrary files as the current user is not that much big of a deal. In rare scenario where it could be useful, I think using the https://github.com/SafeBreach-Labs/EventLogin-CVE-2025-29969 tool would be more appropriate. |
Description
The MS-EVEN protocol (Windows Event Log RPC) exposes an ElfrOpenBELW call that accepts an arbitrary file path to open as a backup event log. The Windows kernel processes the path before the EventLog service can reject it, leaking the file's status through the returned NTSTATUS code:
This technique requires no administrative privilege and works with any authenticated low-privileged domain account.
Usage: nxc smb -u user -p pass -M check_file_dir -o PATH='C:\path\to\file'
Based on CVE-2025-29969, researched and disclosed by @SafeBreach (Yarin A.): https://github.com/SafeBreach-Labs/EventLogin-CVE-2025-29969. This file check issue won't be patched by MS.
The module name can be changed, I didn't find a nice way to call it.
This PR was created with the assistance of Claude Code (Sonnet 4.6) for code structure, and fixed & verified in lab env by me.
Type of change
Setup guide for the review
No particular setup required.
Screenshots (if appropriate):
Checklist:
Insert an "x" inside the brackets for completed and relevant items (do not delete options)
poetry run ruff check ., use--fixto automatically fix what it can)tests/e2e_commands.txtfile if necessary (new modules or features are required to be added to the e2e tests)