[笔记] 关于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);
}
相关推荐
d111111111d1 小时前
STM32外设学习-WDG看门狗-(学习笔记)
笔记·stm32·单片机·嵌入式硬件·学习
数据门徒2 小时前
《人工智能现代方法(第4版)》 第7章 逻辑智能体 学习笔记
人工智能·笔记·学习
不蒸馒头曾口气2 小时前
申论素材学习笔记-以产业振兴激活乡村全面振兴
笔记·学习
做一道光2 小时前
电机控制——电流采样(双电阻)
笔记·单片机·嵌入式硬件·电机控制
wallace20182 小时前
笔记:SpringCloud服务间调用的方式
笔记
愚昧之山绝望之谷开悟之坡3 小时前
什么是大非农
笔记
Chloeis Syntax3 小时前
MySQL初阶学习日记(4)--- 插入、聚合、分组查询 + 数据库约束
数据库·笔记·学习·mysql
四谎真好看3 小时前
Java 黑马程序员学习笔记(进阶篇31)
java·笔记·学习·学习笔记
Element_南笙4 小时前
吴恩达新课程:Agentic AI(笔记11)
大数据·人工智能·笔记·算法·机器学习
YJlio4 小时前
Active Directory 工具学习笔记(10.1):AdExplorer 实战(一)— 连接到域与界面总览
笔记·学习·安全