Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Override 对 21H2 (Windows 11) 不生效 #2

Open
edgexyz opened this issue Oct 9, 2021 · 11 comments
Open

Override 对 21H2 (Windows 11) 不生效 #2

edgexyz opened this issue Oct 9, 2021 · 11 comments

Comments

@edgexyz
Copy link

edgexyz commented Oct 9, 2021

Screen Shot 2021-10-09 at 08 38 08

Screen Shot 2021-10-09 at 08 38 20

Screen Shot 2021-10-09 at 08 38 29

offsets 已按照 README.md 中提示获取了,但是仍无法修改网络状态

@dantmnf
Copy link
Owner

dantmnf commented Oct 9, 2021

尝试使用 Sysinternals Suite 中的 dbgview.exe 查看是否有调试信息输出,注意选中 Capture Global Win32。
image

@chenx-dust
Copy link

同样的情况

@hongwen000
Copy link

尝试使用 Sysinternals Suite 中的 dbgview.exe 查看是否有调试信息输出,注意选中 Capture Global Win32。 image

我实测发现Windows 11新版本中使用netprofmsvc.dll提供NlaSvc的实现。我简单修改了一下LoadTargetLibrary函数的实现

static HMODULE LoadTargetLibrary() {
    wchar_t *dllPath = (wchar_t*)HeapAlloc(GetProcessHeap(), 0, 65536);
    OutputDebugStringA("Entry");
    if (GetSystemDirectoryW(dllPath, 32768) != 0) {
        lstrcatW(dllPath, L"\\netprofmsvc.dll");
        HMODULE hDll = LoadLibraryW(dllPath);
        HeapFree(GetProcessHeap(), 0, dllPath);
        OutputDebugStringA("Entry success");
        return hDll;
    }
    OutputDebugStringA("Entry failed");
    return NULL;
}

然鹅似乎并没有用,也没有能在dbgview.exe中看到我添加的输出,还请楼主赐教。

@dantmnf
Copy link
Owner

dantmnf commented Dec 22, 2022

我实测发现Windows 11新版本中使用netprofmsvc.dll提供NlaSvc的实现。

检查发现 NCSI 相关 event log 是从 netprofm 服务进程中发出,可以尝试注入此服务。

@hongwen000
Copy link

hongwen000 commented Dec 22, 2022 via email

@dantmnf
Copy link
Owner

dantmnf commented Dec 22, 2022

实际 hook 的函数是 NCSI_INTERFACE_ATTRIBUTES::SetCapability,无论检测结果如何都修改为固定值。

注入方式是 DLL 劫持,即目标进程载入 DLL 时安装 hook,同时转发原 DLL 中的功能。修改注册表中的服务入口 DLL 是一种侵入性比较低的劫持方式,同时也不会被小更新重置。

NCSI 运行期间会输出 event log (事件查看器中 Applications and Services Logs\Microsoft\Windows\NCSI\Operational),其中有记录来源进程的 PID,可以通过 PID 反查 NCSI 在哪个服务中运行,从而劫持此服务注入 hook。

@dantmnf
Copy link
Owner

dantmnf commented Dec 22, 2022

另外正如 README 所说,我卸载 npcap 之后就没有遇到 NCSI 不灵的问题了,所以这个东西我自己也没在用了(

@hongwen000
Copy link

hongwen000 commented Dec 22, 2022 via email

@GF-Huang
Copy link

打扰下,我的系统是 Win11 22H2,C:\Windows\System32 目录下没有 nlasvc.dll 这个文件,nla 开头的文件只有 nlaapi.dll, nlahc.dll, nlansp_c.dll,请问你们的系统也是这样吗?

版本	Windows 11 专业版
版本	22H2
安装日期	‎2022/‎10/‎18
操作系统版本	22621.963
体验	Windows Feature Experience Pack 1000.22638.1000.0

@hongwen000
Copy link

打扰下,我的系统是 Win11 22H2,C:\Windows\System32 目录下没有 nlasvc.dll 这个文件,nla 开头的文件只有 nlaapi.dll, nlahc.dll, nlansp_c.dll,请问你们的系统也是这样吗?

版本	Windows 11 专业版
版本	22H2
安装日期	‎2022/‎10/‎18
操作系统版本	22621.963
体验	Windows Feature Experience Pack 1000.22638.1000.0

是的,可以看一下我们前面的讨论,目前是由netprofmsvc服务加载这个。

@shezik
Copy link

shezik commented Nov 7, 2024

重写了一下这个项目,在https://github.com/shezik/NCSIOverride

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants