User Manual
User Manual
md 2021/6/6
Table of Contents
About NSudo
Features
System requirements
Prototype
Third-party projects which uses NSudo
Third-party introduction
Become the sponsor of NSudo
Support
Usage
Download NSudo
NSudo Launcher
NSudo Devil Mode
NSudo Shared Library
License (Read License.txt)
Relevant People (Read People.txt)
Release Notes
1 / 21
UserManual.md 2021/6/6
About NSudo
Features
Distributed under the MIT License.
Provide the x86, x86-64, ARM64 binaries.
Support Windows Vista and later.
Using VC-LTL and libkcrt from Chuyu Team for smaller binary size.
Using C++17, but only use core language features in the most cases.
NSudo Launcher
Launch programs with TrustedInstaller access token.
Launch programs with System access token.
Launch programs with current user access token.
Note: If the User Account Control has not been disabled, the privilege of this mode is
similar to the standard user.
Launch programs with elevated current user access token.
Note: The privilege of this mode is similar to the elevated user.
Launch programs with current process access token.
Note: The privilege of this mode is similar to the elevated user.
Launch programs with current process access token with the LUA restriction.
Note: The privilege of this mode is similar to the standard user. And the implementation is
similar to the iertutil.dll's from the Internet Explorer.
Support launching programs with the specified privileges option.
Note: "Enable All Privileges" and "Disable All Privileges".
Support launching programs with the specified mandatory level (or integrity level) option.
Note: "System", "High", "Medium" and "Low".
Support launching programs with the specified process priority option.
Note: "Idle", "BelowNormal", "Normal", "AboveNormal", "High" and "RealTime".
Support launching programs with the specified window mode option.
Note: "Show", "Hide", "Maximize" and "Minimize".
Support waiting for the created process to end before exiting.
Support launching programs with the specified current directory.
Support launching programs with the current console window.
Support shortcut list.
Note: You can custom it via editing NSudo.json.
Support multiple command line style.
Support multi-languages.
Note: Chinese Simplified, Chinese Traditional, English, French, German, Italian and Spanish.
Full High DPI Support.
Note: As good as the implementation from Windows Shell (conhost.exe), with the full Per-
Monitor DPI-Aware support under Windows 10 Build 10240 and later version and full
System DPI-Aware support under Windows Vista to Windows 8.1.
Full accessibility support.
Note: You can use NSudo Launcher with Windows Narrator smoothly.
High performance.
2 / 21
UserManual.md 2021/6/6
Note: Because it don't need to create the windows service and the windows service
process.
Provide C APIs and .Net Core bindings for developers.
NSudo Devil Mode
The most elegant solution for developers who want to bypass the file and registry access checks
for the process with the Administrator privilege.
Hook APIs via the Microsoft Detours library for the maximum compatibility.
The binary only depend on the exported named APIs from ntdll.dll.
System requirements
Supported OS Version: Windows NT 6.0 or later
Supported CPU Architecture: x86, x86-64(AMD64), ARM64
Prototype
NSudo Launcher is based on SuperCMD by Raymai97. Visit here for more information about SuperCMD.
NSudo Devil Mode is based on the Dism++ God Mode, with new features and several improvements.
Third-party introduction
HowToDoNinja: https://howtodoninja.com/how-to/nsudo-run-programs-with-full-admin-privileges-
windows/
MajorGeeks: https://www.majorgeeks.com/files/details/nsudo.html
softpedia.com: https://www.softpedia.com/get/Tweak/System-Tweak/NSudo.shtml
TrishTech.com: https://www.trishtech.com/2018/11/nsudo-run-programs-with-full-privileges-in-
windows/
Wilders Security Forums: https://www.wilderssecurity.com/threads/396818
爱发电: https://afdian.net/@MouriNaruto
If I have reached the "$1,000 per month" goal, I will release 2 major releases in a year.
If I have reached the "$2,000 per month" goal, I will obtain an extended validation (EV) code signing
certificate and use it for signing the projects binaries.
Kenji Mouri
3 / 21
UserManual.md 2021/6/6
Support
Contact
E-mail: Mouri_Naruto@Outlook.com
Community
GitHub Issues
My Digital Life
QQ Group
4 / 21
UserManual.md 2021/6/6
Usage
Download NSudo
Binaries
Current Release
All Releases
AppVeyor CI
Source Code
GitHub
Gitee
Source Code
Current Release
Chocolatey (Unofficial)
scoop (Unofficial)
MajorGeeks
softpedia.com
NSudo Launcher
Quick Start
Please go to the [CPU Architecture] folder and click NSudo.exe. Follow the prompts. For example, if you want
to use 64-bit NSudo on your Intel or AMD device, you need to go to the x64 folder and click NSudoG.exe
Command Line
Options:
5 / 21
UserManual.md 2021/6/6
-Wait Make NSudo Launcher wait for the created process to end before exiting.
PS: If you don't want to wait, please do not include the "-Wait" parameter.
6 / 21
UserManual.md 2021/6/6
PS:
1. All NSudo Launcher command arguments is case-insensitive.
2. You can use the "/" or "--" override "-" and use the "=" override ":" in
the command line parameters. For example, "/U:T" and "-U=T" are
equivalent.
3. To ensure the best experience, NSudoLC does not support context menu.
Example:
If you want to run Command Prompt with TrustedInstaller, enable all
privileges and the default Integrity Level.
NSudoL -U:T -P:E cmd
Example: If you want to run Command Prompt with TrustedInstaller, enable all privileges and the default
Integrity Level:
Starting from NSudo 5.0.1708.16, the command line nested quotes is supported. For example:
Shortcut List
You can edit NSudo.json to custom the Shortcut list, here are the demo (NSudo.json in the NSudo.exe's
folder):
{
"ShortCutList_V2": {
7 / 21
UserManual.md 2021/6/6
NSudo Devil Mode is a elegant solution for developers who want to bypass the file and registry access checks.
It hooks some file and registry Windows NT kernel system calls via Microsoft Detours, so developers only
need to load NSudoDM.dll into their apps before enjoy it.
NSudo Devil Mode only needs Administrator privilege. So developers need to run their apps as Administrator
if they want to use it.
As the creator of NSudo project, I think NSudo Devil Mode may replace tools similar as NSudo in the most
cases. NSudo 8.0 will support run apps as NSudo Devil Mode, and Dism++ God Mode will be refactored with
NSudo Devil Mode. So NSudo will be more professional in the future because I don't want to make NSudo is
replaced by NSudo Devil Mode, lol.
NSudo Shared Library is hard for developers to integrate it because it expose a lot of details about Windows
security model and looks like a low level library. I don't think only providing NSudo Shared Library is good for
developers who want to bypass the file and registry access checks. So I have created the NSudo Devil Mode.
NSudo Devil Mode is based on the Dism++ God Mode or call it "Dism++ 春哥附体" via Chinese. I have
refactored the implementations of Dism++ God Mode, add some new features and make its source code
available in NSudo's GitHub repository.
Name Origin
You can enable it via LoadLibrary and disable it via FreeLibrary. Here is a demo code.
using System;
using System.IO;
using System.Runtime.InteropServices;
namespace Demo
8 / 21
UserManual.md 2021/6/6
{
class Program
{
[DllImport("kernel32.dll", CharSet = CharSet.Unicode)]
static extern IntPtr LoadLibrary(string lpLibFileName);
{
DirectoryInfo Folder = new DirectoryInfo(
@"C:\System Volume Information");
FreeLibrary(NSudoDevilModeModuleHandle);
{
DirectoryInfo Folder = new DirectoryInfo(
@"C:\System Volume Information");
Console.ReadKey();
}
}
}
NSudo 恶魔模式的技术内幕
C/C++ prototype
UserModeType parameter
A value from the NSUDO_USER_MODE_TYPE enumerated type that identifies the user mode.
10 / 21
UserManual.md 2021/6/6
PrivilegesModeType parameter
A value from the NSUDO_PRIVILEGES_MODE_TYPE enumerated type that identifies the privileges mode.
MandatoryLabelType parameter
A value from the NSUDO_MANDATORY_LABEL_TYPE enumerated type that identifies the mandatory label.
ProcessPriorityClassType parameter
A value from the NSUDO_PROCESS_PRIORITY_CLASS_TYPE enumerated type that identifies the process
priority class.
11 / 21
UserManual.md 2021/6/6
NORMAL,
ABOVE_NORMAL,
HIGH,
REALTIME,
} NSUDO_PROCESS_PRIORITY_CLASS_TYPE, *PNSUDO_PROCESS_PRIORITY_CLASS_TYPE;
ShowWindowModeType parameter
A value from the NSUDO_SHOW_WINDOW_MODE_TYPE enumerated type that identifies the ShowWindow
mode.
WaitInterval parameter
CreateNewConsole parameter
If this parameter is TRUE, the new process has a new console, instead of inheriting its parent's console (the
default).
CommandLine parameter
The command line to be executed. The maximum length of this string is 32K characters, the module name
portion of CommandLine is limited to MAX_PATH characters.
CurrentDirectory parameter
The full path to the current directory for the process. The string can also specify a UNC path. If this parameter
is nullptr, the new process will the same current drive and directory as the calling process. (This feature is
provided primarily for shells that need to start an application and specify its initial drive and working
directory.)
Return value
C# API
12 / 21
UserManual.md 2021/6/6
Load the M2.NSudo assembly to your project, you will know the usage.
Example
using System;
namespace M2.NSudo.Demo
{
class Program
{
static void Main(string[] args)
{
NSudoInstance instance = new NSudoInstance();
instance.CreateProcess(
NSUDO_USER_MODE_TYPE.TRUSTED_INSTALLER,
NSUDO_PRIVILEGES_MODE_TYPE.ENABLE_ALL_PRIVILEGES,
NSUDO_MANDATORY_LABEL_TYPE.SYSTEM,
NSUDO_PROCESS_PRIORITY_CLASS_TYPE.NORMAL,
NSUDO_SHOW_WINDOW_MODE_TYPE.DEFAULT,
0,
true,
"cmd",
null);
Console.ReadKey();
}
}
}
13 / 21
UserManual.md 2021/6/6
Release Notes
NSudo 8.2
NSudo 8.0
14 / 21
UserManual.md 2021/6/6
NSudo 6.2.1812.31
NSudo 6.1.1811.18
NSudo 6.0.1804.5
Fix a bug which can cause crash on Windows Vista and Server 2008. (Thanks to hydra79545.)
Share source code with M2-Team UWP projects. (For more information, please read
"https://github.com/Project-Nagisa/Nagisa/blob/master/Changelog.md")
Remove useless implementations.
Improve the implementation for NSudoStartService function.
Use RapidJSON instead of JSON for Modern C++ to reduce the binary size.
NSudo 6.0.1802.2 v2
Fix always opens a command prompt window after click the run button. (Thanks to AeonX.)
NSudo 6.0.1802.2
16 / 21
UserManual.md 2021/6/6
M2MessageDialogResource.rc
Remove Traditional Chinese and Japanese translation because the translation is out of date and I don't
know how to use.
Update JSON for Modern C++ to 3.0.1.
Context Menu
Add multilingual descriptions.
Add "Enable All Privileges" options for all item in the context menu.
Update the command line help and documents.
NSudo 6.0.1801.19
NSudo 5.3.1801.11
Fix a potential bug when NSudo obtaining the System Token. (Thanks to mingkuang.)
Provide VC-LTL support for NSudo release configuration for x86 and x86-64 (AMD64). (Thanks to
mingkuang.)
PS: Compiling NSudo with VC-LTL can reduce the NSudo's binary size.
Maintaining documents.
17 / 21
UserManual.md 2021/6/6
NSudo 4.4.1705.19
适配最新版 M2-SDK
适配最新版 VC-LTL
修改编译选项
使⽤ git ⼦模块机制 (由 myfreeer 实现)
配置 AppVeyor (由 myfreeer 提供灵感)
开始使⽤ AppVeyor ⾃动编译
更新 M2-SDK 和 VC-LTL ⼦模块
命令⾏解析从 main 函数拆分
修复升级 VC-LTL 后出现的编译警告 (有空会 pull fix 到 VC-LTL)
版本号重新由⾃⼰⽽不是 CI 编译服务控制
整理解决⽅案布局
NSudo 4.3.1703.25
NSudo 4.2
NSudo 4.1
修复命令⾏使⽤-U:D 导致程序奔溃的问题
更正命令⾏的 NSudoC 残余描述 (感谢 NotePad)
⽀持⽂件拖拽 (感谢 NotePad)
NSudo 4.0
NSudo 2016.1
NSudo 2016
19 / 21
UserManual.md 2021/6/6
命令⾏处理重写
实现代码全部重构; 效率更⾼
优化程序逻辑; 减少⽆⽤代码
命令⾏版和图形版⼆合⼀
NSudo 3.2
修复⽆法使⽤带有空格的路径的问题
NSudo 和 NSudoC 单⽂件化
增加 NSudo.bat ⽅便新⼿准确调⽤与电脑架构相符的 NSudo 版本
NSudoSDK 增加静态库 (⽤ NSudo SDK 开发的⼯具可以实现单⽂件)
编译平台采⽤ Visual Studio 2015 + Windows 10 SDK
修复 UI 的 ComboBox 不能输⼊太长⽂字的问题
修复某些情况下不能使⽤的问题 (由于开发机 Windows10 的 Bug ⽽导致误认为那种⽅式可 ⾏)
增加真正的令牌降权 (除了 cmd 会误显⽰管理员外; 其他的会将其看作普通⽤户)
增加命令⾏版本
增加常⽤列表⾃定义功能
NSudo 3.0 R2
修复不能打开其他被系统关联⽂件的 Bug
SDK 的头⽂件改进: 增加#pragma comment(lib,"NSudoAPI.lib")
NSudo 3.0
⽀持外部应⽤调⽤ (很抱歉让⼀些⼈等太久)
增加了常⽤调⽤列表 (暂时不⽀持⾃定义; 未来 3.1 会加⼊)
加⼊了降权功能 (当然, 是完美降权到 UAC 未提权前。当然原理不是⽤获取 explorer 令牌 和创建计划任
务)
⽀持对权限令牌的⾃定义
界⾯的完全重构 (相对于 2.x 来说)
代码优化 (相对于 NSudo 3.0 M1 来说)
加⼊ NSudo SDK
原⽣ 64 位版本
实现了调⽤外部程序⽆视 WOW64 重定向的⽅法 (NSudoCreateProcess)
WinPE ⽀持 (虽然没起多⼤作⽤)
NSudo 2.1
实现⾃动开启所有权限 Token
对 cmd 的调⽤使⽤绝对路径, 估计可以避免⼀些不必要的 Bug
优化程序代码
NSudo 2.0
20 / 21
UserManual.md 2021/6/6
NSudo 1.2
NSudo 1.1
修复 SessionID 问题
32 位和 64 位版本合体 (根据架构确定运⾏那个架构的命令提⽰符, 采⽤ SysNative ⽬录 (64 位 Vista 开始
有的重定向) 调⽤ 64 位 cmd)
NTIShell 1.0
根据 raymai97 的超级命令提⽰符制作的第⼀个版本
21 / 21