[笔记] 关于CreateProcessWithLogonW函数创建进程

函数介绍

https://learn.microsoft.com/zh-cn/windows/win32/api/winbase/nf-winbase-createprocesswithlogonw

cpp 复制代码
BOOL CreateProcessWithLogonW(
  [in]                LPCWSTR               lpUsername,
  [in, optional]      LPCWSTR               lpDomain,
  [in]                LPCWSTR               lpPassword,
  [in]                DWORD                 dwLogonFlags,
  [in, optional]      LPCWSTR               lpApplicationName,
  [in, out, optional] LPWSTR                lpCommandLine,
  [in]                DWORD                 dwCreationFlags,
  [in, optional]      LPVOID                lpEnvironment,
  [in, optional]      LPCWSTR               lpCurrentDirectory,
  [in]                LPSTARTUPINFOW        lpStartupInfo,
  [out]               LPPROCESS_INFORMATION lpProcessInformation
);

几种使用方法

使用存在的账号信息创建进程

使用空网络账号信息创建进程

所以即使账号信息实际不存在也可以创建进程,只是无权访问网络资源

cpp 复制代码
if (!CreateProcessWithLogonW(L"MalseclogonUser", L"MalseclogonDomain", L"MalseclogonPwd", LOGON_NETCREDENTIALS_ONLY, NULL, cmdline, 0, NULL, NULL, &startInfo, &procInfo)) {
	printf("CreateProcessWithLogonW() failed with error code %d \n", GetLastError());
} else {
	// the returned handles in procInfo are wrong and duped into the spoofed parent process, so we can't close handles or wait for process end.
	printf("Spoofed process %S created correctly as child of PID %d using CreateProcessWithLogonW()!", cmdline, pid);
}
相关推荐
鹏北海-RemHusband10 小时前
Go 语言进阶笔记 — 面向 JS/TS 前端开发者
笔记·golang
nnsix12 小时前
Unity QFramework ResKit、UIKit 笔记
笔记
摇滚侠13 小时前
Java 零基础全套教程,反射机制,笔记 187-188
java·开发语言·笔记
【云轩】13 小时前
如何设计一台能模拟电机的电子负载:一个硬件工程师的实战笔记
笔记·嵌入式硬件
可信计算14 小时前
X司民用无人机运行安全与合规培训手册
笔记
李子琪。15 小时前
Web漏洞-CSRF-CSRF防御 实验步骤
经验分享·笔记
小碗羊肉16 小时前
【Agent笔记 | 第四篇】Agentic RAG
笔记
小雨xs16 小时前
Vulnhub靶场DC-9 渗透测试笔记
笔记
whyTeaFo16 小时前
MIT 6.1810: xv6 book Chapter3: Page tables 笔记
笔记
東雪木17 小时前
JVM 与 Java 内存模型 专属复习笔记
java·jvm·笔记·java面试