Sledgehammer - Windows 10 Update Control

Discussion in 'MDL Projects and Applications' started by pf100, Nov 28, 2016.

  1. Carlos Detweiller

    Carlos Detweiller Emperor of Ice-Cream

    Dec 21, 2012
    6,328
    7,045
    210
    #1521 Carlos Detweiller, May 29, 2020
    Last edited: May 29, 2020
    Hi, I checked with 19631.1 mn prerelease version (FAST). I have rolled back the VM installation since, so, all is well. But the .NET reference might actually be a clue - I used 2.7.1 WuMgr to install the .NET CU which was offered. That might have been a mistake, maybe on MS' part.
    After installation and reboot, the WU service was gone (verified in Services Registry, the wuauserv key was still there, but empty). This time, I'm prepared and am trying to reproduce.

    About Defcon error. When system is under load, VMs may have really sh*tty timing. Plus, network was used also, might have slowed down further. I'll check up upon the other problem first, it's more serious.

    Edit: I captured my initial problem. Obviously, when all is done, the MS-Defcon line has scrolled out of the window, and there's no way to scroll back.

    sledge271woodyscrollout.jpg

    By the way, this time, no error. I have done everything the same.
     
  2. pf100

    pf100 Duct Tape Coder

    Oct 22, 2010
    2,069
    3,447
    90
    I tested the script with 19624, 14393, and 17763 before releasing it and after more testing today I can't reproduce the problem that you and @thewizardoz are seeing. I know removing the ms-defcon code from the script will fix it, and I'd rather not do that, but whatever works is what I'll do. I could give the previously mentioned option of opening a browser to see the current ms-defcon level instead of displaying it in the script.
     
  3. Carlos Detweiller

    Carlos Detweiller Emperor of Ice-Cream

    Dec 21, 2012
    6,328
    7,045
    210
    Personally, I don't need it. Couldn't you make it an option in the configurator? "Check the current MS-Defcon level in browser" or so?
     
  4. freevista

    freevista MDL Member

    Jan 14, 2009
    101
    42
    10
    #1526 freevista, May 29, 2020
    Last edited: May 29, 2020
    M$ could update other hijacker files but leave SIHClient.exe alone. But if this is a low risk, then this check should be okay.

    Strange, at least for me (running with system permissions, like the scheduled task) "icacls C:\WINDOWS\System32\SIHClient.exe" returns 0, when the file is already locked (no ACLs in the file). You have "if %errorlevel% neq 0 goto okay", so it doesn't go to okay.

    Code:
    C:\Tools\Sledgehammer_2.7.1\Portable\Sledgehammer\bin>whoami
    nt authority\system
    
    C:\Tools\Sledgehammer_2.7.1\Portable\Sledgehammer\bin>icacls C:\WINDOWS\System32\SIHClient.exe
    C:\WINDOWS\System32\SIHClient.exe
    Successfully processed 1 files; Failed processing 0 files
    
    C:\Tools\Sledgehammer_2.7.1\Portable\Sledgehammer\bin>echo %errorlevel%
    0
    
    I commented out the last 'exit' line from LockFiles.cmd, so I could see the lines without it exiting, and the script indeed continues and doesn't skip to okay:

    Code:
    C:\Tools\Sledgehammer_2.7.1\Portable\Sledgehammer\bin>icacls C:\WINDOWS\System32\SIHClient.exe  1>nul 2>&1
    
    C:\Tools\Sledgehammer_2.7.1\Portable\Sledgehammer\bin>if 0 NEQ 0 goto okay
    
    C:\Tools\Sledgehammer_2.7.1\Portable\Sledgehammer\bin>set s32list=EOSNotify.exe WaaSMedic.exe WaasMedicSvc.dll WaaSMedicPS.dll WaaSAssessment.dll UsoClient.exe
    
    I think icacls can't be used just alone for this check. I don't know if this is a good idea, but searching "TrustedInstaller" (indicating that the permissions have been reset by an update) and exiting the script only if it fails to find it seems to work:

    icacls %systemroot%\System32\SIHClient.exe | find /i "TrustedInstaller" || exit
     
  5. pf100

    pf100 Duct Tape Coder

    Oct 22, 2010
    2,069
    3,447
    90
    I have an updated v2.7.2 almost ready with the ms-defcon code removed.
    @freevista thanks for the info. I tried the find trustedinstaller statement and had some wierd issues so I just removed the check for now and it locks the files every time.
     
  6. rpo

    rpo MDL Expert

    Jan 3, 2010
    1,446
    1,421
    60
    Just upgraded my system to Enterprise 19041.264 and the ms-defcon code is ok.
     
  7. pf100

    pf100 Duct Tape Coder

    Oct 22, 2010
    2,069
    3,447
    90
    It's never not worked for me either.
     
  8. rpo

    rpo MDL Expert

    Jan 3, 2010
    1,446
    1,421
    60
    Sometimes response time can be long. This may depend on the web site load.
     
  9. Wazoo

    Wazoo MDL Addicted

    Nov 5, 2013
    513
    273
    30
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  10. Homer712

    Homer712 MDL Member

    Oct 22, 2018
    118
    45
    10
    Just installed version 2.7.1 this morning. The uninstall by 2.7.0 went perfectly. Downloaded version 2.7.2 and ran the 2.7.1 uninstall. Nothing. The tasks were deleted, but, when I went to install 2.7.2 it told me that the Sledgehammer folder already existed. I manually deleted it. Installed 2.7.2, ran it and then restarted. The result for LockFiles was (0x1). Is that an issue?
     

    Attached Files:

  11. pf100

    pf100 Duct Tape Coder

    Oct 22, 2010
    2,069
    3,447
    90
    Than can happen if unins000.exe and unins000.dat aren't created in the uninstall folder, or if you uninstall the installed version using the portable version.
    Very perceptive of you. That task doesn't report the error level correctly and always says the error level is 1 when it should show 0. I knew about this before I pushed out 2.7.2, but since the task works it was low on my list of priorities to fix. I'll deal with that with the next update.
     
  12. Carlos Detweiller

    Carlos Detweiller Emperor of Ice-Cream

    Dec 21, 2012
    6,328
    7,045
    210
    I usually install the new script over the old one. Unfortunately, that causes the version number text files and Start Menu entries to accumulate. Could the installer remove all version text+start entries before writing the new one?

    Couldn't we also spider the AW website HTML and parse it directly for the Defcon level?
    Currently it's at line 200-201.

    Code:
    <h3 style="text-align:center">MS-DEFCON <span class="defcon-level">
            2</span>:</h3>
            
     
  13. pf100

    pf100 Duct Tape Coder

    Oct 22, 2010
    2,069
    3,447
    90
    #1537 pf100, May 31, 2020
    Last edited: May 31, 2020
    (OP)
    Inno Setup requires any custom code to be done with some version of Pascal which I know nothing about. I'll see what I can do but I'm not guaranteeing anything.

    Yes, it's just that the first try was with powershell. I'll play around with other methods.
     
  14. Carlos Detweiller

    Carlos Detweiller Emperor of Ice-Cream

    Dec 21, 2012
    6,328
    7,045
    210
    Maybe download HTML site with wget, aria2 or curl and do a simple text search. As long as he doesn't change the site...
     
  15. rpo

    rpo MDL Expert

    Jan 3, 2010
    1,446
    1,421
    60
  16. pf100

    pf100 Duct Tape Coder

    Oct 22, 2010
    2,069
    3,447
    90
    This fixes the LockFiles task not reporting correct errorlevel in Task Scheduler.
    Change the last line of \bin\LockFiles.cmd from
    Code:
    exit
    to
    Code:
    exit /b 0