Code Monkey home page Code Monkey logo

nsudo's Introduction

Logo NSudo - System Administration Toolkit

AppVeyor CI Latest Version Latest Release Downloads Total Downloads License 996.icu FOSSA Status

简体中文 | Русский

This is the source code repository of NSudo. If you wonder to visit the NSudo official website, download NSudo or read the NSudo documents etc, please visit https://nsudo.m2team.org.

This readme file will be the developer oriented document because this it is under the source code repository.

2021 Development Roadmap

  • Add Current User (Elevated) Mode.
    • Implemented in NSudo Shared Library.
    • Implemented in NSudo Launcher.
  • Use wxWidgets to implement the UI.
  • TOML-based environment configuration file.
  • Add more APIs to NSudo Shared Library.
  • Export PDF directly from the offical website.
  • Improve the Gitee mirror experience.
    • Translate the readme in the source tree root.
    • Synchronizing automatically when commits pushed.

Relevant People

Please read People.md.

Code of Conduct

Please read CODE_OF_CONDUCT.md.

Contributing to NSudo

How to become a contributor

  • Direct contributions
    • Create pull requests directly.
    • Please send e-mails to [email protected] if you have any questions.
  • Feedback suggestions and bugs.
    • We use GitHub issues to track bugs and features.
    • For bugs and general issues please file a new issue.

Code contribution guidelines

Prerequisites

  • Visual Studio 2017 Version 15.9 or later.
    • You also need install ARM64 components (MSVC Toolchain and ATL/MFC) if you want to compile ARM64 version of NSudo.
  • Windows 10 Version 1507 SDK or later.
    • You also need install ARM64 components when you installing the Windows 10 Version 1703 SDK or later and you want to compile ARM64 version of NSudo.

How to build all targets of NSudo

Run BuildAllTargets.bat in Source/Native.

How to modify or debugging NSudo

Open NSudo.sln in Source/Native.

Code style and conventions

For all languages respect the .editorconfig file specified in the source tree. Many IDEs natively support this or can with a plugin.

Copying files from other projects

The following rules must be followed for PRs that include files from another project:

  • The license of the file is permissive.
  • The license of the file is left intact.
  • The contribution is correctly attributed in the License file in the repository, as needed.

How to update documents.

Refer to #29.

To build new docs, you'll need to have Node.js and Yarn installed on your system, and run build.bat in Website.

Docs engine is based on VuePress.

nsudo's People

Contributors

bianyifan avatar blueberryy avatar chungzh avatar dependabot[bot] avatar fcharlie avatar fossabot avatar garf02 avatar himimisaki avatar laosb avatar margen67 avatar mourinaruto avatar myfreeer avatar obando777 avatar qcyblm avatar thdub avatar udev2019 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nsudo's Issues

NSudoC

Why NSudoC show window if you launch without parameters?! Is there way to hide window?

.Net Framework support for NSudo Shared Library

I'm using .Net Framework 4.8 in order to build a mini tool without any runtime like .net 5, but i found that NSudo Shared Library won't worked with exception "未能加载文件或程序集“System.Runtime, Version=5.0.0.0"
Could u please publish NSudo Shared Library with .Net Standard 2.0 so that both .Net Framework and .Net Core could use the fansinating library.

Chocolatey package

Have you considered putting NSudo on a Windows package repository like Chocolatey or scoop? Being a system administration tool, there would be a lot of benefit from having it hosted there.

错误: 进程创建失败。

以TrustedInstaller打开命令提示符时输出:

M2-Team NSudo Launcher 8.2
© M2-Team. All rights reserved.

错误: 进程创建失败。

欲了解更多信息, 请访问 https://m2team.github.io/NSudo/zh-hans。


Sender: NSudoCreateProcess
DateTime: 2022-12-09 14:52:39
Process ID: 15788
Thread ID: 6676

UserModeType: 1
PrivilegesModeType: 0
MandatoryLabelType: 0
ProcessPriorityClassType: 2
ShowWindowModeType: 2
WaitInterval: 0
CreateNewConsole: 1
CommandLine: cmd /c start "NSudo.Launcher" cmd
CurrentDirectory: C:\Users\O5_Co\Desktop\NSudo_8.2_All_Components\NSudo Launcher\x64


Sender: NSudoCreateProcess
DateTime: 2022-12-09 14:52:39
Process ID: 15788
Thread ID: 6676

Get the TrustedInstaller service access token failed, returns -2147023843.


Sender: NSudoCreateProcess
DateTime: 2022-12-09 14:58:40
Process ID: 15788
Thread ID: 6676

UserModeType: 1
PrivilegesModeType: 0
MandatoryLabelType: 0
ProcessPriorityClassType: 2
ShowWindowModeType: 2
WaitInterval: 0
CreateNewConsole: 1
CommandLine: cmd /c start "NSudo.Launcher" cmd
CurrentDirectory: C:\Users\O5_Co\Desktop\NSudo_8.2_All_Components\NSudo Launcher\x64


Sender: NSudoCreateProcess
DateTime: 2022-12-09 14:58:40
Process ID: 15788
Thread ID: 6676

Get the TrustedInstaller service access token failed, returns -2147023843.


Windows版本:
22H2(操作系统内部版本 19045.2251)

进程转储文件:
链接: https://cowtransfer.com/s/ba1c15c939c048
口令: iy0zn9

GUI doesn't start in operating systems language

If i start NSudo v8.2 under a german version of Windows 10 (21H1) then it starts with english GUI.
Maybe it has something to do with: #56

Probably a setting or switch would be nice to have, if people want to use NSudo in english instead of the operating systems language.

CI builds failing again

https://ci.appveyor.com/project/MouriNaruto/nsudo/builds/30661919/job/hyf5j7wxx5dobyqx#L19

C:\projects\nsudo\NSudoLib\NSudoLib.vcxproj(161,5): error : This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is ..\packages\YY.NuGet.Import.Helper.1.0.0.2\build\native\YY.NuGet.Import.Helper.props.
Done Building Project "C:\projects\nsudo\NSudoLib\NSudoLib.vcxproj" (default targets) -- FAILED.
Done Building Project "C:\projects\nsudo\NSudo\NSudo.vcxproj.metaproj" (default targets) -- FAILED.
Done Building Project "C:\projects\nsudo\NSudo.sln" (default targets) -- FAILED.
Build FAILED.
"C:\projects\nsudo\NSudo.sln" (default target) (1) ->
"C:\projects\nsudo\NSudo\NSudo.vcxproj.metaproj" (default target) (2) ->
"C:\projects\nsudo\NSudoLib\NSudoLib.vcxproj" (default target) (3) ->
(EnsureNuGetPackageBuildImports target) -> 
  C:\projects\nsudo\NSudoLib\NSudoLib.vcxproj(161,5): error : This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is ..\packages\YY.NuGet.Import.Helper.1.0.0.2\build\native\YY.NuGet.Import.Helper.props.

Crash when there is a tab in the commandline

I use NSudo in a AutoItscript I noticed that I run NSudo like this:
"Resources\helper\NSudo.exe -U:T" & @TAB & "%windir%\notepad.exe"
I'll crash.
When I replace the '@tab' with a space - it works:
"Resources\helper\NSudo.exe -U:T" & " " & "%windir%\notepad.exe"

However @tab and Space should be in the same class of whitespace and both work.
I guess the commandlineparser needs some fixing here.

[Progress] NSudo Issue feedback from sebus@MyDigitalLife

On Server 2012 R2 it does open requested program not visible to logged in user
It runs, but GUI of such program is not accessible (obviously). The program can be seen as running in System security context

Here is the problem which the sebus said.

I tested NSudo 4.3.1703.25 x64 and x86 on Windows Server 2012 R2 Standard with Update.
So I need to continue the investigation.

GitHubPage的一处问题

GitHubPage页中
点击相关人士 Relevant People后语言会切换为English
Android 10,Chrome 88

Error: Failed to create a process

M2-Team NSudo Launcher 8.2
© M2-Team. All rights reserved.

Error: Failed to create a process.

For further information, please visit https://m2team.github.io/NSudo.


Sender: NSudoCreateProcess
DateTime: 2022-07-18 14:46:32
Process ID: 11556
Thread ID: 2516

UserModeType: 1
PrivilegesModeType: 1
MandatoryLabelType: 0
ProcessPriorityClassType: 2
ShowWindowModeType: 2
WaitInterval: 0
CreateNewConsole: 1
CommandLine: cmd /c start "NSudo.Launcher" cmd
CurrentDirectory: C:\Users\chai\Desktop\NSudo_8.2_All_Components\NSudo Launcher\x64


Sender: NSudoCreateProcess
DateTime: 2022-07-18 14:46:32
Process ID: 11556
Thread ID: 2516

Create the system access token failed, returns -2147024891.


DevilMode: can it be used from a dotnet Windows Service?

I hope to create a Windows Service, written in C#, to use your "devil mode". It's excellent when used from an elevated process for Any platform or for x86.

When trying for the x64, the LoadLibrary (for the 64-bit DLL) fails with error 126 ( (generic DLL failure)

I have tried to make my service work similarly to my ordinary elevated process. But the LoadLibrary operation fails.

Here are the scenarios I've tried:

C# targeting Any platform ... the attempt gets Win32 error 203 (missing environment)
... targeting x86 ... the attempt gets 126 (generic DLL failure)

Is there an example of using devil mode in a service I may follow? Thanks.

Appveyor Build Failures

You may want to look into your appveyor configuration as CI Build's 375 through current (392 as of this comment) have failed.

Can't Create Process in Windows RE

This is a error report.

M2-Team NSudo Launcher 9.0 Preview 1 (Build 2676)
© M2-Team. All rights reserved.

Error: Failed to create a process.

For further information, please visit https://nsudo.m2team.org.


Sender: NSudoCreateProcess
DateTime: 2022-03-26 06:24:56
Process ID: 2040
Thread ID: 2044

UserModeType: 1
PrivilegesModeType: 1
MandatoryLabelType: 0
ProcessPriorityClassType: 2
ShowWindowModeType: 2
WaitInterval: 0
CreateNewConsole: 1
CommandLine: cmd /c start "NSudo.Launcher" "X:\Windows\notepad.exe"
CurrentDirectory: C:\NSudo


Sender: NSudoCreateProcess
DateTime: 2022-03-26 06:24:56
Process ID: 2040
Thread ID: 2044

Get the session ID failed.


Sender: NSudoCreateProcess
DateTime: 2022-03-26 06:25:37
Process ID: 2040
Thread ID: 2044

UserModeType: 4
PrivilegesModeType: 0
MandatoryLabelType: 0
ProcessPriorityClassType: 2
ShowWindowModeType: 2
WaitInterval: 0
CreateNewConsole: 1
CommandLine: cmd /c start "NSudo.Launcher" "X:\Windows\notepad.exe"
CurrentDirectory: C:\NSudo


Sender: NSudoCreateProcess
DateTime: 2022-03-26 06:25:37
Process ID: 2040
Thread ID: 2044

Get the session ID failed.


NSudo fails to execute any program when LSA Protection (RunAsPPL) in Lsass (Local Security Authority Process) is enabled

If LSA Protection is enabled according to Microsoft or you Enable Windows Defender Credential Guard by using the HVCI and Windows Defender Credential Guard hardware readiness tool and you reboot the PC you cannot elevate privileges when this setting is enabled unless the setting is removed, disable Secure Boot (If has been enabled) and erase NVRAM settings (only if setting on efi variables is not removed).

...Or bypass RunAsPPL protection with Mimikatz:

NSUDO WORKS IF PsProtectedSignerLsa-Light or PsProtectedSignerWinTcb is DISABLED
Nsudo Works!
log.txt

This happens when PsProtectedSignerWinTcb (only enable with Mimikatz) or PsProtectedSignerLsa-Light protection on Lsass.exe is enabled when RunAsPPL registry key is enabled, or this setting is stored on Efi variables in NVRAM (efi variables of this settings only SecureBoot is enabled):

RunAsPPL
LogErrorPPL.txt

Nsudo Fail!
logError.txt

However ExecTI works even any LSA Protection is enabled and no drivers... Maybe this info? (Credits for itm4n)

ExecTI works even lsass exe is protected with PsProtectedSignerWinTcb and PsProtectedSignerLsa-Light but Nsudo gives an error if any protection is enabled

I find this temporary solution using this page (thanks itm4n for this info) which explains what is PPL and how it works, and how RunAsPPL is bypassed using an signed kernel driver of Mimikatz.

Hope this information helps to make Nsudo run in an secure system!

Instructions incomplete

The readme doesn't say how I get nsudo. I cloned the repo -- do I have to compile it? I can't find any exe file in the cloned files or instructions about where to get the exe.

以TrustedInstaller权限创建命令提示符时出错

显示:
M2-Team NSudo Launcher 8.2
© M2-Team. All rights reserved.

错误: 进程创建失败。

欲了解更多信息, 请访问 https://m2team.github.io/NSudo/zh-hans。


Sender: NSudoCreateProcess
DateTime: 2021-08-13 16:11:06
Process ID: 54292
Thread ID: 58164

UserModeType: 1
PrivilegesModeType: 1
MandatoryLabelType: 0
ProcessPriorityClassType: 2
ShowWindowModeType: 2
WaitInterval: 0
CreateNewConsole: 1
CommandLine: cmd /c start "NSudo.Launcher" powershell
CurrentDirectory: C:\Users\lll\Downloads\NSudo_8.2_All_Components\NSudo Launcher\x64


Sender: NSudoCreateProcess
DateTime: 2021-08-13 16:11:06
Process ID: 54292
Thread ID: 58164

Get the TrustedInstaller service access token failed, returns -2147024894.


启动问题

你好,我这边想知道如何在非管理员模式下启动NSudo

帮助信息里有个语病

-CurrentDirectory:[ 目录路径 ] 设置进程的的当前目录。
PS: 如果你想用 NSudo Launcher 的当前目录, 请不要包含 "-CurrentDirectory" 参数。

这一段第一行的两个“的”应该去掉一个。

bs强迫症了wkao /笑哭

No NSudo.bat?

I cannot seem to find a NSudo.bat with any of the files.

Another bug..

I found big bug in NSudo. It doesn't show full files.

To reproduce:
Bug

Put nsudo.exe in c:\windows\system32\oobe

[HKEY_LOCAL_MACHINE\SYSTEM\Setup]
"OsLoaderPath"="\"
"RestartSetup"=dword:00000000
"SetupType"=dword:00000002
"SystemPartition"="\Device\HarddiskVolume1"
"SystemSetupInProgress"=dword:00000001
"SetupPhase"=dword:00000004
"CmdLine"="c:\\windows\\system32\\cmd.exe"
"OOBEInProgress"=dword:00000000
"WorkingDirectory"="c:\windows\panther"

Reuse more service tokens

Thank you for your cool tool !
Couldn't you display all available tokens of the running services in the ComboBox User ?

Comodo False Positive

Comodo Client Security is used in the institution where I work.

I am sure there is no malware in this project, but unfortunately Comodo sees (Win32) NSudoLG.exe and NSudoLC.exe files as infected (MalCrypt.Indus!@1qrzi1).

Therefore I can not use.

Readme.md 过时

Readme.md 过时

Readme.md最新版本为4.2,Releases中最新版本为4.4
此外,并未使用M2-Team的FTP服务器来托管下载 @MouriNaruto

文档中关于程序名的描述不一致而且都不对

命令行选项:
格式: NSudoL [ 选项与参数 ] 命令行或常用任务名

称谓1:NSudoL

例子: 以 TrustedInstaller 权限, 启用所有特权, 完整性默认运行命令提示符
NSudo -U:T -P:E cmd

称谓2:NSudo

真正的命令行用法:执行NSudoLG.exe

E:\Users\23Xor>nsudolg -U:T -P:E cmd
(没有回显并弹出一个提权的cmd窗口)

而执行NSudoLC.exe会报错

E:\Users\23Xor>nsudolc -U:T -P:E cmd
M2-Team NSudo Launcher 8.2
© M2-Team. All rights reserved.
错误: 进程创建失败。
欲了解更多信息, 请访问 https://m2team.github.io/NSudo/zh-hans。


Sender: NSudoCreateProcess
DateTime: 2021-07-31 17:32:57
Process ID: 3224
Thread ID: 6476
UserModeType: 1
PrivilegesModeType: 1
MandatoryLabelType: 0
ProcessPriorityClassType: 2
ShowWindowModeType: 0
WaitInterval: 0
CreateNewConsole: 1
CommandLine: cmd
CurrentDirectory: E:.public\cliapps\nsudo


Sender: NSudoCreateProcess
DateTime: 2021-07-31 17:32:57
Process ID: 3224
Thread ID: 6476
Enable the SeDebugPrivilege for the context access token failed, returns -2147023596.


NSudo 建议合集 (Collection of NSudo Suggestions)

MyDigitalLife 论坛 testtest322 的建议:
(Suggestion from testtest322@MyDigitalLife)

Please expose some CreateProcess options.. like Priority, Window (Hide, max, min) etc.
So that we can launch hidden process workers. 

NSudo 官方群 May_magic(873578156) 的建议:
(Suggestion from May_magic(873578156)@NSudoOfficalQQGroup)

nsudo 6.1预计。月。日发布
改变一下功能:
1.对于nsudo,命令行参数中的 -? 不在弹出对话框,而是在命令行中显示.
2.-Uninstall命令行参数现在可以移除在Windows目录的NSudo,而不仅仅是上下文菜单了。
3.参数-install现在在nsudoc中可用了。
4.nsudoc的右键菜单可以正确请求管理员权限了,而不是把nsudoc复制到windows目录后必须在兼容性选择管理员权限运行才行(之前因为管理员权限弹出黑框)。)——NSudoC支持上下文菜单了。
5.现在的快捷选项保存在注册表,并且可以手动添加了。而不是之前的json

NSudo 官方群 秋刀鱼 的建议:
(Suggestion from 秋刀鱼@NSudoOfficalQQGroup)

@毛利 请教一下,NSudo.json配置文件能不能对应于不同的平台,比如x86和x64.我遇到的是需要调用的软件,x86和x64平台的可执行文件名称不一样。
最好是在同一个配置文件中实现。

English Gui?

I see screenshots on the web of the Gui in english, but running the latest versuin seems to be only in chinese, with no option to change language?

Process id

Make option to return process id of created process for waiting in script.

Thank.

ShortcutList no longer accept multi "quotation marks"

Hi there,
the Shortcut List in v6.2.1812.31 accepted multi "quotation marks" like this:

"Hosts (Notepad++)": "\"%ProgramFiles%\\Notepad++\\notepad++.exe\" -multiInst -nosession \"%windir%\\System32\\Drivers\\etc\\hosts\"",

but in v8.0 Update 1 this no longer works!
seems the new version can not handle SPACES in the Shortcut List because also

"Notepad++": "%ProgramFiles%\\Notepad++\\notepad++.exe",

and

"TEST": "C:\\Program Files\\Notepad++\\notepad++.exe",

does not work!

BUT

"TEST": "C:\\PROGRA~1\\Notepad++\\notepad++.exe -multiInst -nosession %windir%\\System32\\Drivers\\etc\\hosts",

does work but if there would be SCPASEC anywhere, it would not work again :/

maybe you can fix this?

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.