NSudo | Series of System Administration Tools | General Thread

Discussion in 'MDL Projects and Applications' started by Mouri_Naruto, Feb 6, 2015.

?

These things you maybe see in the future version of NSudo. What do you think about?

Poll closed Sep 13, 2019.
  1. Publish to Chocolatey? (Suggested by wwtex.)

    8 vote(s)
    66.7%
  2. Publish to scoop? (Suggested by wwtex.)

    1 vote(s)
    8.3%
  3. Publish to Windows Store? (Desktop Bridge.)

    3 vote(s)
    25.0%
  4. Add NSudo Configuration Editor?

    9 vote(s)
    75.0%
  5. Using Qt to implement the UI? (It may increase the binary size of NSudo.)

    3 vote(s)
    25.0%
  6. Compile NSudo with CMake?

    3 vote(s)
    25.0%
  7. Yes

    0 vote(s)
    0.0%
  8. No

    0 vote(s)
    0.0%
Multiple votes are allowed.
  1. Anthony Accioly

    Anthony Accioly MDL Novice

    Nov 19, 2017
    10
    13
    0
    Successfully disabled the Windows Defender Security Center Service using NSudo! Thanks for this tool
     
  2. kal

    kal MDL Member

    Aug 18, 2007
    105
    21
    10
    Thanks for this so helpful tool, it's fantastic !

    I would like to get the PID of the new process launched by NSudo, how can I get it ? Not the PID of NSudo.exe itself, but the PID of the exe file that NSudo will execute with the right privileges.
     
  3. abbodi1406

    abbodi1406 MDL KB0000001

    Feb 19, 2011
    16,226
    84,921
    340
    Code:
    tasklist /FI "IMAGENAME eq cmd.exe" /FI "USERNAME eq NT AUTHORITY\SYSTEM"
    replace cmd.exe with the executable file

    batch command
    Code:
    for /f "tokens=2" %%i in ('tasklist /FI "IMAGENAME eq cmd.exe" /FI "USERNAME eq NT AUTHORITY\SYSTEM" /NH') do set pid=%%i
     
  4. kal

    kal MDL Member

    Aug 18, 2007
    105
    21
    10
    What if there is multiple cmd.exe process other than the one launched by NSudo ? How could I differentiate it ? :)
     
  5. kal

    kal MDL Member

    Aug 18, 2007
    105
    21
    10
    #165 kal, Nov 19, 2017
    Last edited: Nov 22, 2017
    In fact, my goal is to wait for the NSudo process. Currently, here's my method for NSudo "Current User" using powershell :

    Code:
    param([string]$setupFile = $null)
    
    $processBefore = Get-Process "PowerShell" -IncludeUserName |? {$_.UserName -NotMatch '^NT ' }
    
    Start-Process -PassThru "NSudo.exe" "-U:C PowerShell.exe -ExecutionPolicy Unrestricted -WindowStyle Hidden -Command $PSScriptRoot\SetupLauncher.ps1 $setupFile" -WindowStyle Hidden
    Start-Sleep -m 100
    
    $processAfter = Get-Process "PowerShell" -IncludeUserName  |? {$_.UserName -NotMatch '^NT ' }
    
    $p = Compare-Object $processBefore $processAfter -PassThru -Property Id
    $p = Get-Process -Id $p.Id
    $p.WaitForExit()
    
    Write-Host "Done"
    
     
  6. maelcum

    maelcum MDL Novice

    Mar 19, 2011
    24
    39
    0
    Hei Kal.

    This code looks interesting. I'm currently trying to learn a little PowerShell since my extensive cmd-Knowhow is not exactly en vogue anymore. Could you maybe elaborate a little on what the lines mean? Especially things like
    Code:
    $processBefore = Get-Process "PowerShell" -IncludeUserName |? {$_.UserName -NotMatch '^NT ' }
    
    looks most interesting.
     
  7. kal

    kal MDL Member

    Aug 18, 2007
    105
    21
    10
  8. maelcum

    maelcum MDL Novice

    Mar 19, 2011
    24
    39
    0
    Marvellous! Thanks!!
     
  9. kal

    kal MDL Member

    Aug 18, 2007
    105
    21
    10
    you're welcome, I'm glad I could help sometimes regarding everything I get from mydigitallife :)
     
  10. v72dd

    v72dd MDL Senior Member

    Nov 20, 2016
    445
    77
    10
    Why can't I delete the following services using NSudo & TrustedInstaller?

    Windows Registry Editor Version 5.00

    [-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MpsDrv]
    [-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MpsSvc]
    [-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WinDefend]
    [-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WdNisSvc]
    [-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Sense]
    [-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SecurityHealthService]
    [-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess]
    [-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\EventLog]
     
  11. maelcum

    maelcum MDL Novice

    Mar 19, 2011
    24
    39
    0
    Most likely because the service is still running - or because those are integral parts of the operating systems (Event Log, SecurityHealthService). To be straight: Deleting the EventLog Service will come down to reinstalling the OS. This really puzzles me.

    Since you have not given any indication on what you did, why you would like to mess with the services making up the OS or what your goal is (other than deleting the services) it is hard to help you achive what you want.

    I am also not sure, if your post (and mine) shouldn't be in their own thread... So sorry to the others, if that is the case.
     
  12. v72dd

    v72dd MDL Senior Member

    Nov 20, 2016
    445
    77
    10
    No I removed it offline. Still no go.
     
  13. maelcum

    maelcum MDL Novice

    Mar 19, 2011
    24
    39
    0
    As I said. Integral part of the OS. Why not try to remove the kernel why you are at it. ;)
     
  14. v72dd

    v72dd MDL Senior Member

    Nov 20, 2016
    445
    77
    10
    Dude you have no clue what you are talking about.
     
  15. kandido

    kandido MDL Junior Member

    Jun 14, 2015
    59
    35
    0
    Have you tried also to open regedit with NSudo and then try to manually remove them ?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  16. v72dd

    v72dd MDL Senior Member

    Nov 20, 2016
    445
    77
    10
    Can remove others just MpsSvc I cannot. Really strange.
    Have to first take ownership and then it goes.

    Can't even stop the service under NSudo with TrustedInstaller + all privileges.
     
  17. kandido

    kandido MDL Junior Member

    Jun 14, 2015
    59
    35
    0
    #177 kandido, Dec 11, 2017
    Last edited: Dec 11, 2017
    MpsSvc = Firewall, right?
    On my 2016 LTSB I've removed offline many stuff (MSMG ToolKit + NTLite) but never firewall, it's "deep inside" in OS (like internet explorer)
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  18. MonarchX

    MonarchX MDL Expert

    May 5, 2007
    1,732
    313
    60
    Any news on full context menu integration for easy right-click use?
     
  19. Mouri_Naruto

    Mouri_Naruto MDL Developer

    Jul 10, 2014
    525
    1,791
    30
    NSudo 5.2 support the Context Menu integration. (For more infotmation, please read #154)
     
  20. Mouri_Naruto

    Mouri_Naruto MDL Developer

    Jul 10, 2014
    525
    1,791
    30
    #180 Mouri_Naruto, Jan 11, 2018
    Last edited: Jan 11, 2018
    (OP)