[笔记] 关于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);
}
相关推荐
谅望者6 分钟前
数据分析笔记07:Python编程语言介绍
大数据·数据库·笔记·python·数据挖掘·数据分析
Cathy Bryant26 分钟前
信息论(五):联合熵与条件熵
人工智能·笔记·机器学习·数学建模·概率论
谅望者2 小时前
数据分析笔记03:概率分布理论
笔记·数据分析·概率论
程序员东岸2 小时前
从零开始学二叉树(上):树的初识 —— 从文件系统到树的基本概念
数据结构·经验分享·笔记·学习·算法
谅望者2 小时前
数据分析笔记09:Python条件语循环
笔记·python·数据分析
全栈游侠2 小时前
Cortex-M3 02-地址映射
笔记
菩提树下的凡夫3 小时前
Node.js+Vue的学习笔记
笔记·学习·node.js
蒙奇D索大3 小时前
【计算机网络】考研408 | 数据链路层的“安全卫士”:探秘检错编码之奇偶校验码
经验分享·笔记·计算机网络·考研·改行学it
雾岛听风眠3 小时前
光耦学习笔记
笔记·学习
Vince丶6 小时前
“伪”局域网
笔记