[笔记] 关于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);
}
相关推荐
_李小白9 小时前
【OSG学习笔记】Day 23: ClipNode(动态裁剪)
android·笔记·学习
丝斯201110 小时前
AI学习笔记整理(78)——Python学习7
人工智能·笔记·学习
唯_ww10 小时前
COMSOL学习笔记(一)曲线图数据导出及画图
笔记·学习
我没想到原来他们都是一堆坏人10 小时前
SQL 表结构定义(索引与约束)学习笔记一——索引、外键与级联约束
笔记·sql·学习
鹓于10 小时前
Notion AI,智能笔记
笔记·notion
一定要AK11 小时前
java基础
java·开发语言·笔记
xw-busy-code11 小时前
npm 包管理笔记整理
前端·笔记·npm
chushiyunen12 小时前
langgraph笔记
数据库·人工智能·笔记
看山还是山,看水还是。12 小时前
消控室五方对讲接听操作流程
经验分享·笔记·搜索引擎·pdf·百度云·印象笔记·有道云笔记