[笔记] 关于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);
}
相关推荐
极市平台1 天前
骁龙大赛-技术分享第5期(上)
人工智能·经验分享·笔记·后端·个人开发
啄缘之间1 天前
11. UVM Test [uvm_test]
经验分享·笔记·学习·uvm·总结
wan55cn@126.com1 天前
人类文明可通过技术手段(如加强航天器防护、改进电网设计)缓解地球两极反转带来的影响
人工智能·笔记·搜索引擎·百度·微信
会飞的土拨鼠呀1 天前
docker部署 outline(栗子云笔记)
笔记·docker·容器
_Minato_1 天前
数据库知识整理——数据库设计的步骤
数据库·经验分享·笔记·软考
hssfscv1 天前
Mysql学习笔记——事务
笔记·学习·mysql
charlie1145141911 天前
现代C++工程实践:简单的IniParser3——改进我们的split
开发语言·c++·笔记·学习
思成不止于此1 天前
【MySQL 零基础入门】MySQL 函数精讲(二):日期函数与流程控制函数篇
android·数据库·笔记·sql·学习·mysql
中屹指纹浏览器1 天前
2025技术干货:国内静态 IP 搭配指纹浏览器的加密绑定与跨区域优化方案
经验分享·笔记
Ccjf酷儿1 天前
操作系统 李治军 4 设备驱动与文件系统
笔记