%3CLINGO-SUB%20id%3D%22lingo-sub-1680104%22%20slang%3D%22en-US%22%3EHow%20to%20find%20the%20password%20of%20IIS%20custom%20service%20account%20via%20command%20line%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1680104%22%20slang%3D%22en-US%22%3E%3CP%3EIn%20IIS%20Manager%2C%20the%20application%20pool%20identity%20set%20to%20a%20custom%20service%20account%20will%20always%20display%20it%E2%80%99s%20password%20in%20encrypted%20(masked)%20format.%20In%20applicationHost.config%20file%20also%20the%20password%20will%20show%20as%20encrypted.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EBut%20when%20you%20run%20the%20below%20command%20in%20a%20command%20line%20tool%20then%20the%20password%20is%20visible.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22margin-top%3A%200pt%3B%20margin-bottom%3A%208pt%3B%20font-family%3A%20Calibri%3B%20font-size%3A%2011.0pt%3B%22%3E%3CSPAN%20style%3D%22font-weight%3A%20bold%3B%22%3E%25systemroot%25%5Csystem32%5Cinetsrv%5Cappcmd%20list%20config%20%2Fsection%3Aapplicationpools%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-left%22%20image-alt%3D%22B4.JPG%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F219257i774C5AC098986C5B%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22B4.JPG%22%20alt%3D%22B4.JPG%22%20%2F%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-family%3A%20inherit%3B%22%3EIs%20there%20a%20way%20to%20encrypt%20the%20password%20in%20the%20command%20line%3F%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20AppCmd%20tool%20uses%20the%20same%20interfaces%20to%20read%20the%20configuration%20data%20that%20the%20Windows%20Process%20Activation%20Service%20uses%20to%20read%20the%20same%20configuration%20data.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ESample%20dll%20stack%3A%20(Collected%20using%20Procmon)%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CTABLE%20border%3D%221%22%20width%3D%22100%25%22%3E%0A%3CTBODY%3E%0A%3CTR%3E%0A%3CTD%20width%3D%2250%25%22%20height%3D%2228px%22%20class%3D%22lia-align-center%22%3EAppCmd%20tool%3C%2FTD%3E%0A%3CTD%20width%3D%2250%25%22%20height%3D%2228px%22%20class%3D%22lia-align-center%22%3EWindows%20Process%20Activation%20Service%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%2250%25%22%20height%3D%221500px%22%3E%3CP%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E0%20ntoskrnl.exe%20SeOpenObjectAuditAlarmWithTransaction%20%2B%200x4ad8%200xfffff8064bed03c8%20C%3A%5CWINDOWS%5Csystem32%5Cntoskrnl.exe%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E1%20ntoskrnl.exe%20SeOpenObjectAuditAlarmWithTransaction%20%2B%200x16ac%200xfffff8064beccf9c%20C%3A%5CWINDOWS%5Csystem32%5Cntoskrnl.exe%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E2%20ntoskrnl.exe%20SeOpenObjectAuditAlarmWithTransaction%20%2B%200x57ee%200xfffff8064bed10de%20C%3A%5CWINDOWS%5Csystem32%5Cntoskrnl.exe%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E3%20ntoskrnl.exe%20ObOpenObjectByNameEx%20%2B%200x1fa%200xfffff8064beda39a%20C%3A%5CWINDOWS%5Csystem32%5Cntoskrnl.exe%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E4%20ntoskrnl.exe%20ObOpenObjectByName%20%2B%200x5c%200xfffff8064beda17c%20C%3A%5CWINDOWS%5Csystem32%5Cntoskrnl.exe%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E5%20ntoskrnl.exe%20SeQueryInformationToken%20%2B%200xcf1%200xfffff8064bed9ca1%20C%3A%5CWINDOWS%5Csystem32%5Cntoskrnl.exe%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E6%20ntoskrnl.exe%20NtFsControlFile%20%2B%200x582%200xfffff8064be4f2a2%20C%3A%5CWINDOWS%5Csystem32%5Cntoskrnl.exe%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E7%20ntoskrnl.exe%20setjmpex%20%2B%200x7cc5%200xfffff8064bc058b5%20C%3A%5CWINDOWS%5Csystem32%5Cntoskrnl.exe%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E8%20ntdll.dll%20ZwOpenKey%20%2B%200x14%200x7ffed2cac004%20C%3A%5CWindows%5CSystem32%5Cntdll.dll%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E9%20bcryptprimitives.dll%20ProcessPrng%20%2B%200x3b5c%200x7ffed08285ec%20C%3A%5CWindows%5CSystem32%5Cbcryptprimitives.dll%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E10%20bcryptprimitives.dll%20ProcessPrng%20%2B%200x39dd%200x7ffed082846d%20C%3A%5CWindows%5CSystem32%5Cbcryptprimitives.dll%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E11%20bcryptprimitives.dll%20ProcessPrng%20%2B%200x3934%200x7ffed08283c4%20C%3A%5CWindows%5CSystem32%5Cbcryptprimitives.dll%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E12%20bcryptprimitives.dll%20GetKeyDerivationInterface%20%2B%200x13b3e%200x7ffed08474de%20C%3A%5CWindows%5CSystem32%5Cbcryptprimitives.dll%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E13%20ntdll.dll%20RtlActivateActivationContextUnsafeFast%20%2B%200x11d%200x7ffed2c47b3d%20C%3A%5CWindows%5CSystem32%5Cntdll.dll%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E14%20ntdll.dll%20RtlGetThreadErrorMode%20%2B%200x313%200x7ffed2c73403%20C%3A%5CWindows%5CSystem32%5Cntdll.dll%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E15%20ntdll.dll%20RtlGetThreadErrorMode%20%2B%200xa6%200x7ffed2c73196%20C%3A%5CWindows%5CSystem32%5Cntdll.dll%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E16%20ntdll.dll%20TpAllocTimer%20%2B%200x1c3%200x7ffed2c50d13%20C%3A%5CWindows%5CSystem32%5Cntdll.dll%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E17%20ntdll.dll%20LdrGetDllHandleEx%20%2B%200x4f6%200x7ffed2c44ca6%20C%3A%5CWindows%5CSystem32%5Cntdll.dll%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E18%20ntdll.dll%20ApiSetQueryApiSetPresenceEx%20%2B%200x5a4%200x7ffed2c4c414%20C%3A%5CWindows%5CSystem32%5Cntdll.dll%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E19%20ntdll.dll%20RtlDosPathNameToRelativeNtPathName_U%20%2B%200xd2%200x7ffed2c4c612%20C%3A%5CWindows%5CSystem32%5Cntdll.dll%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E20%20ntdll.dll%20RtlVirtualUnwind%20%2B%200xae7%200x7ffed2c32b97%20C%3A%5CWindows%5CSystem32%5Cntdll.dll%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E21%20ntdll.dll%20LdrResolveDelayLoadedAPI%20%2B%200xc6%200x7ffed2c44196%20C%3A%5CWindows%5CSystem32%5Cntdll.dll%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E22%20rpcrt4.dll%20RpcErrorGetNextRecord%20%2B%200x242%200x7ffed2b04572%20C%3A%5CWindows%5CSystem32%5Crpcrt4.dll%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E23%20rpcrt4.dll%20I_RpcServerSetAddressChangeFn%20%2B%200xc71%200x7ffed2b11c81%20C%3A%5CWindows%5CSystem32%5Crpcrt4.dll%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E24%20rpcrt4.dll%20UuidCreate%20%2B%200x15%200x7ffed2af6945%20C%3A%5CWindows%5CSystem32%5Crpcrt4.dll%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E25%20combase.dll%20CoInitializeEx%20%2B%200x1688%200x7ffed2132588%20C%3A%5CWindows%5CSystem32%5Ccombase.dll%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E26%20combase.dll%20CoInitializeEx%20%2B%200xdf3%200x7ffed2131cf3%20C%3A%5CWindows%5CSystem32%5Ccombase.dll%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E27%20combase.dll%20CoInitializeEx%20%2B%200xd95%200x7ffed2131c95%20C%3A%5CWindows%5CSystem32%5Ccombase.dll%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E28%20combase.dll%20CoInitializeEx%20%2B%200x750%200x7ffed2131650%20C%3A%5CWindows%5CSystem32%5Ccombase.dll%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E29%20combase.dll%20RoGetActivatableClassRegistration%20%2B%200x45ca%200x7ffed213080a%20C%3A%5CWindows%5CSystem32%5Ccombase.dll%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E30%20combase.dll%20CoInitializeEx%20%2B%200x268%200x7ffed2131168%20C%3A%5CWindows%5CSystem32%5Ccombase.dll%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E31%20combase.dll%20CoInitializeEx%20%2B%200x58%200x7ffed2130f58%20C%3A%5CWindows%5CSystem32%5Ccombase.dll%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%20color%3D%22%230000FF%22%3E32%20appcmd.exe%20CLockBase%26lt%3B4%2C1%2C1%2C2%2C3%2C3%26gt%3B%3A%3ALockType%20%2B%200x1898%200x7ff7a3b75758%20C%3A%5CWindows%5CSystem32%5Cinetsrv%5Cappcmd.exe%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%20color%3D%22%230000FF%22%3E33%20appcmd.exe%20STRAU%3A%3ASafeCopy%20%2B%200x58d%200x7ff7a3b81f4d%20C%3A%5CWindows%5CSystem32%5Cinetsrv%5Cappcmd.exe%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E34%20kernel32.dll%20BaseThreadInitThunk%20%2B%200x14%200x7ffed14b6fd4%20C%3A%5CWindows%5CSystem32%5Ckernel32.dll%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E35%20ntdll.dll%20RtlUserThreadStart%20%2B%200x21%200x7ffed2c5cec1%20C%3A%5CWindows%5CSystem32%5Cntdll.dll%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22B4_2.JPG%22%20style%3D%22width%3A%20355px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F219260i543C4941F11C7E23%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22B4_2.JPG%22%20alt%3D%22B4_2.JPG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2250%25%22%20height%3D%221500px%22%3E%3CP%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E0%20ntoskrnl.exe%20SeOpenObjectAuditAlarmWithTransaction%20%2B%200x4ad8%200xfffff8064bed03c8%20C%3A%5CWINDOWS%5Csystem32%5Cntoskrnl.exe%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E1%20ntoskrnl.exe%20SeOpenObjectAuditAlarmWithTransaction%20%2B%200x16ac%200xfffff8064beccf9c%20C%3A%5CWINDOWS%5Csystem32%5Cntoskrnl.exe%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E2%20ntoskrnl.exe%20SeOpenObjectAuditAlarmWithTransaction%20%2B%200x57ee%200xfffff8064bed10de%20C%3A%5CWINDOWS%5Csystem32%5Cntoskrnl.exe%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E3%20ntoskrnl.exe%20ObOpenObjectByNameEx%20%2B%200x1fa%200xfffff8064beda39a%20C%3A%5CWINDOWS%5Csystem32%5Cntoskrnl.exe%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E4%20ntoskrnl.exe%20ObOpenObjectByName%20%2B%200x5c%200xfffff8064beda17c%20C%3A%5CWINDOWS%5Csystem32%5Cntoskrnl.exe%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E5%20ntoskrnl.exe%20SeQueryInformationToken%20%2B%200xcf1%200xfffff8064bed9ca1%20C%3A%5CWINDOWS%5Csystem32%5Cntoskrnl.exe%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E6%20ntoskrnl.exe%20NtFsControlFile%20%2B%200x582%200xfffff8064be4f2a2%20C%3A%5CWINDOWS%5Csystem32%5Cntoskrnl.exe%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E7%20ntoskrnl.exe%20setjmpex%20%2B%200x7cc5%200xfffff8064bc058b5%20C%3A%5CWINDOWS%5Csystem32%5Cntoskrnl.exe%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E8%20ntdll.dll%20ZwOpenKey%20%2B%200x14%200x7ffed2cac004%20C%3A%5CWindows%5CSystem32%5Cntdll.dll%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E9%20bcryptprimitives.dll%20ProcessPrng%20%2B%200x3b5c%200x7ffed08285ec%20C%3A%5CWindows%5CSystem32%5Cbcryptprimitives.dll%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E10%20bcryptprimitives.dll%20ProcessPrng%20%2B%200x39dd%200x7ffed082846d%20C%3A%5CWindows%5CSystem32%5Cbcryptprimitives.dll%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E11%20bcryptprimitives.dll%20ProcessPrng%20%2B%200x3934%200x7ffed08283c4%20C%3A%5CWindows%5CSystem32%5Cbcryptprimitives.dll%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E12%20bcryptprimitives.dll%20GetKeyDerivationInterface%20%2B%200x13b3e%200x7ffed08474de%20C%3A%5CWindows%5CSystem32%5Cbcryptprimitives.dll%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E13%20ntdll.dll%20RtlActivateActivationContextUnsafeFast%20%2B%200x11d%200x7ffed2c47b3d%20C%3A%5CWindows%5CSystem32%5Cntdll.dll%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E14%20ntdll.dll%20RtlGetThreadErrorMode%20%2B%200x313%200x7ffed2c73403%20C%3A%5CWindows%5CSystem32%5Cntdll.dll%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E15%20ntdll.dll%20RtlGetThreadErrorMode%20%2B%200xa6%200x7ffed2c73196%20C%3A%5CWindows%5CSystem32%5Cntdll.dll%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E16%20ntdll.dll%20TpAllocTimer%20%2B%200x1c3%200x7ffed2c50d13%20C%3A%5CWindows%5CSystem32%5Cntdll.dll%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E17%20ntdll.dll%20LdrGetDllHandleEx%20%2B%200x4f6%200x7ffed2c44ca6%20C%3A%5CWindows%5CSystem32%5Cntdll.dll%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E18%20ntdll.dll%20ApiSetQueryApiSetPresenceEx%20%2B%200x5a4%200x7ffed2c4c414%20C%3A%5CWindows%5CSystem32%5Cntdll.dll%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E19%20ntdll.dll%20RtlDosPathNameToRelativeNtPathName_U%20%2B%200xd2%200x7ffed2c4c612%20C%3A%5CWindows%5CSystem32%5Cntdll.dll%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E20%20ntdll.dll%20RtlVirtualUnwind%20%2B%200xae7%200x7ffed2c32b97%20C%3A%5CWindows%5CSystem32%5Cntdll.dll%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E21%20ntdll.dll%20LdrResolveDelayLoadedAPI%20%2B%200xc6%200x7ffed2c44196%20C%3A%5CWindows%5CSystem32%5Cntdll.dll%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E22%20rpcrt4.dll%20RpcErrorGetNextRecord%20%2B%200x242%200x7ffed2b04572%20C%3A%5CWindows%5CSystem32%5Crpcrt4.dll%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E23%20rpcrt4.dll%20I_RpcServerSetAddressChangeFn%20%2B%200xc71%200x7ffed2b11c81%20C%3A%5CWindows%5CSystem32%5Crpcrt4.dll%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E24%20rpcrt4.dll%20UuidCreate%20%2B%200x15%200x7ffed2af6945%20C%3A%5CWindows%5CSystem32%5Crpcrt4.dll%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E25%20combase.dll%20CoInitializeEx%20%2B%200x1688%200x7ffed2132588%20C%3A%5CWindows%5CSystem32%5Ccombase.dll%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E26%20combase.dll%20CoInitializeEx%20%2B%200xdf3%200x7ffed2131cf3%20C%3A%5CWindows%5CSystem32%5Ccombase.dll%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E27%20combase.dll%20CoInitializeEx%20%2B%200xd95%200x7ffed2131c95%20C%3A%5CWindows%5CSystem32%5Ccombase.dll%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E28%20combase.dll%20CoInitializeEx%20%2B%200x750%200x7ffed2131650%20C%3A%5CWindows%5CSystem32%5Ccombase.dll%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E29%20combase.dll%20RoGetActivatableClassRegistration%20%2B%200x45ca%200x7ffed213080a%20C%3A%5CWindows%5CSystem32%5Ccombase.dll%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E30%20combase.dll%20CoInitializeEx%20%2B%200x268%200x7ffed2131168%20C%3A%5CWindows%5CSystem32%5Ccombase.dll%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E31%20combase.dll%20CoInitializeEx%20%2B%200x58%200x7ffed2130f58%20C%3A%5CWindows%5CSystem32%5Ccombase.dll%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%20color%3D%22%230000FF%22%3E32%20w3wp.exe%20w3wp.exe%20%2B%200x12dd%200x7ff6b36012dd%20C%3A%5CWindows%5CSystem32%5Cinetsrv%5Cw3wp.exe%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%20color%3D%22%230000FF%22%3E33%20w3wp.exe%20w3wp.exe%20%2B%200x363d%200x7ff6b360363d%20C%3A%5CWindows%5CSystem32%5Cinetsrv%5Cw3wp.exe%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E34%20kernel32.dll%20BaseThreadInitThunk%20%2B%200x14%200x7ffed14b6fd4%20C%3A%5CWindows%5CSystem32%5Ckernel32.dll%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E35%20ntdll.dll%20RtlUserThreadStart%20%2B%200x21%200x7ffed2c5cec1%20C%3A%5CWindows%5CSystem32%5Cntdll.dll%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22B4_3.JPG%22%20style%3D%22width%3A%20353px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F219261i80C052103227260F%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22B4_3.JPG%22%20alt%3D%22B4_3.JPG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3C%2FTBODY%3E%0A%3C%2FTABLE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAt%20some%20point%20we%20have%20to%20decrypt%20the%20password%20to%20hand%20it%20off%20to%20LSA%20to%20log%20in%20the%20account%20and%20both%20WAS%20and%20AppCmd%20can%20do%20this%2C%20but%20it%20is%20dependent%20on%20running%20as%20either%20Local%20System%20or%20a%20local%20administrator.%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3EIf%20we%20run%20the%20same%20command%20using%20an%20account%20that%20is%20not%20a%20local%20administrator%2C%20it%20will%20fail.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-left%22%20image-alt%3D%22B4_1.JPG%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F219262i35A53B7E56B62BA2%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22B4_1.JPG%22%20alt%3D%22B4_1.JPG%22%20%2F%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-family%3A%20inherit%3B%22%3EBy%20design%2C%20it%20is%20architecturally%20infeasible%20to%20prevent%20an%20administrator%20from%20being%20able%20to%20read%20the%20password%20in%20this%20manner.%3C%2FSPAN%3E%3CBR%20%2F%3E%26nbsp%3B%3CBR%20%2F%3EAppCmd%20is%20an%20IIS%20admin%20tool%20that%20requires%20admin%20privilege%20to%20run.%20Therefore%2C%20showing%20the%20password%20doesn%E2%80%99t%20break%20the%20security%20boundary.%20On%20the%20other%20hand%2C%20if%20the%20goal%20is%20to%20prevent%20%E2%80%9Cpeeking%20over%20the%20shoulder%E2%80%9D%20or%20%E2%80%9Cleaking%20password%20from%20the%20admin%20script%20logs%E2%80%9D%2C%20it%20might%20be%20helpful%20to%20have%20a%20switch%20for%20the%20command%20line%20to%20mask%20the%20passwords.%20Unfortunately%2C%20such%20an%20option%20was%20never%20added.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Microsoft

In IIS Manager, the application pool identity set to a custom service account will always display it’s password in encrypted (masked) format. In applicationHost.config file also the password will show as encrypted.

 

But when you run the below command in a command line tool then the password is visible.

 

%systemroot%\system32\inetsrv\appcmd list config /section:applicationpools

B4.JPGIs there a way to encrypt the password in the command line?

 

The AppCmd tool uses the same interfaces to read the configuration data that the Windows Process Activation Service uses to read the same configuration data. 

 

Sample dll stack: (Collected using Procmon)

 

AppCmd tool Windows Process Activation Service

0 ntoskrnl.exe SeOpenObjectAuditAlarmWithTransaction + 0x4ad8 0xfffff8064bed03c8 C:\WINDOWS\system32\ntoskrnl.exe
1 ntoskrnl.exe SeOpenObjectAuditAlarmWithTransaction + 0x16ac 0xfffff8064beccf9c C:\WINDOWS\system32\ntoskrnl.exe
2 ntoskrnl.exe SeOpenObjectAuditAlarmWithTransaction + 0x57ee 0xfffff8064bed10de C:\WINDOWS\system32\ntoskrnl.exe
3 ntoskrnl.exe ObOpenObjectByNameEx + 0x1fa 0xfffff8064beda39a C:\WINDOWS\system32\ntoskrnl.exe
4 ntoskrnl.exe ObOpenObjectByName + 0x5c 0xfffff8064beda17c C:\WINDOWS\system32\ntoskrnl.exe
5 ntoskrnl.exe SeQueryInformationToken + 0xcf1 0xfffff8064bed9ca1 C:\WINDOWS\system32\ntoskrnl.exe
6 ntoskrnl.exe NtFsControlFile + 0x582 0xfffff8064be4f2a2 C:\WINDOWS\system32\ntoskrnl.exe
7 ntoskrnl.exe setjmpex + 0x7cc5 0xfffff8064bc058b5 C:\WINDOWS\system32\ntoskrnl.exe
8 ntdll.dll ZwOpenKey + 0x14 0x7ffed2cac004 C:\Windows\System32\ntdll.dll
9 bcryptprimitives.dll ProcessPrng + 0x3b5c 0x7ffed08285ec C:\Windows\System32\bcryptprimitives.dll
10 bcryptprimitives.dll ProcessPrng + 0x39dd 0x7ffed082846d C:\Windows\System32\bcryptprimitives.dll
11 bcryptprimitives.dll ProcessPrng + 0x3934 0x7ffed08283c4 C:\Windows\System32\bcryptprimitives.dll
12 bcryptprimitives.dll GetKeyDerivationInterface + 0x13b3e 0x7ffed08474de C:\Windows\System32\bcryptprimitives.dll
13 ntdll.dll RtlActivateActivationContextUnsafeFast + 0x11d 0x7ffed2c47b3d C:\Windows\System32\ntdll.dll
14 ntdll.dll RtlGetThreadErrorMode + 0x313 0x7ffed2c73403 C:\Windows\System32\ntdll.dll
15 ntdll.dll RtlGetThreadErrorMode + 0xa6 0x7ffed2c73196 C:\Windows\System32\ntdll.dll
16 ntdll.dll TpAllocTimer + 0x1c3 0x7ffed2c50d13 C:\Windows\System32\ntdll.dll
17 ntdll.dll LdrGetDllHandleEx + 0x4f6 0x7ffed2c44ca6 C:\Windows\System32\ntdll.dll
18 ntdll.dll ApiSetQueryApiSetPresenceEx + 0x5a4 0x7ffed2c4c414 C:\Windows\System32\ntdll.dll
19 ntdll.dll RtlDosPathNameToRelativeNtPathName_U + 0xd2 0x7ffed2c4c612 C:\Windows\System32\ntdll.dll
20 ntdll.dll RtlVirtualUnwind + 0xae7 0x7ffed2c32b97 C:\Windows\System32\ntdll.dll
21 ntdll.dll LdrResolveDelayLoadedAPI + 0xc6 0x7ffed2c44196 C:\Windows\System32\ntdll.dll
22 rpcrt4.dll RpcErrorGetNextRecord + 0x242 0x7ffed2b04572 C:\Windows\System32\rpcrt4.dll
23 rpcrt4.dll I_RpcServerSetAddressChangeFn + 0xc71 0x7ffed2b11c81 C:\Windows\System32\rpcrt4.dll
24 rpcrt4.dll UuidCreate + 0x15 0x7ffed2af6945 C:\Windows\System32\rpcrt4.dll
25 combase.dll CoInitializeEx + 0x1688 0x7ffed2132588 C:\Windows\System32\combase.dll
26 combase.dll CoInitializeEx + 0xdf3 0x7ffed2131cf3 C:\Windows\System32\combase.dll
27 combase.dll CoInitializeEx + 0xd95 0x7ffed2131c95 C:\Windows\System32\combase.dll
28 combase.dll CoInitializeEx + 0x750 0x7ffed2131650 C:\Windows\System32\combase.dll
29 combase.dll RoGetActivatableClassRegistration + 0x45ca 0x7ffed213080a C:\Windows\System32\combase.dll
30 combase.dll CoInitializeEx + 0x268 0x7ffed2131168 C:\Windows\System32\combase.dll
31 combase.dll CoInitializeEx + 0x58 0x7ffed2130f58 C:\Windows\System32\combase.dll
32 appcmd.exe CLockBase<4,1,1,2,3,3>::LockType + 0x1898 0x7ff7a3b75758 C:\Windows\System32\inetsrv\appcmd.exe
33 appcmd.exe STRAU::SafeCopy + 0x58d 0x7ff7a3b81f4d C:\Windows\System32\inetsrv\appcmd.exe
34 kernel32.dll BaseThreadInitThunk + 0x14 0x7ffed14b6fd4 C:\Windows\System32\kernel32.dll
35 ntdll.dll RtlUserThreadStart + 0x21 0x7ffed2c5cec1 C:\Windows\System32\ntdll.dll

 

B4_2.JPG

0 ntoskrnl.exe SeOpenObjectAuditAlarmWithTransaction + 0x4ad8 0xfffff8064bed03c8 C:\WINDOWS\system32\ntoskrnl.exe
1 ntoskrnl.exe SeOpenObjectAuditAlarmWithTransaction + 0x16ac 0xfffff8064beccf9c C:\WINDOWS\system32\ntoskrnl.exe
2 ntoskrnl.exe SeOpenObjectAuditAlarmWithTransaction + 0x57ee 0xfffff8064bed10de C:\WINDOWS\system32\ntoskrnl.exe
3 ntoskrnl.exe ObOpenObjectByNameEx + 0x1fa 0xfffff8064beda39a C:\WINDOWS\system32\ntoskrnl.exe
4 ntoskrnl.exe ObOpenObjectByName + 0x5c 0xfffff8064beda17c C:\WINDOWS\system32\ntoskrnl.exe
5 ntoskrnl.exe SeQueryInformationToken + 0xcf1 0xfffff8064bed9ca1 C:\WINDOWS\system32\ntoskrnl.exe
6 ntoskrnl.exe NtFsControlFile + 0x582 0xfffff8064be4f2a2 C:\WINDOWS\system32\ntoskrnl.exe
7 ntoskrnl.exe setjmpex + 0x7cc5 0xfffff8064bc058b5 C:\WINDOWS\system32\ntoskrnl.exe
8 ntdll.dll ZwOpenKey + 0x14 0x7ffed2cac004 C:\Windows\System32\ntdll.dll
9 bcryptprimitives.dll ProcessPrng + 0x3b5c 0x7ffed08285ec C:\Windows\System32\bcryptprimitives.dll
10 bcryptprimitives.dll ProcessPrng + 0x39dd 0x7ffed082846d C:\Windows\System32\bcryptprimitives.dll
11 bcryptprimitives.dll ProcessPrng + 0x3934 0x7ffed08283c4 C:\Windows\System32\bcryptprimitives.dll
12 bcryptprimitives.dll GetKeyDerivationInterface + 0x13b3e 0x7ffed08474de C:\Windows\System32\bcryptprimitives.dll
13 ntdll.dll RtlActivateActivationContextUnsafeFast + 0x11d 0x7ffed2c47b3d C:\Windows\System32\ntdll.dll
14 ntdll.dll RtlGetThreadErrorMode + 0x313 0x7ffed2c73403 C:\Windows\System32\ntdll.dll
15 ntdll.dll RtlGetThreadErrorMode + 0xa6 0x7ffed2c73196 C:\Windows\System32\ntdll.dll
16 ntdll.dll TpAllocTimer + 0x1c3 0x7ffed2c50d13 C:\Windows\System32\ntdll.dll
17 ntdll.dll LdrGetDllHandleEx + 0x4f6 0x7ffed2c44ca6 C:\Windows\System32\ntdll.dll
18 ntdll.dll ApiSetQueryApiSetPresenceEx + 0x5a4 0x7ffed2c4c414 C:\Windows\System32\ntdll.dll
19 ntdll.dll RtlDosPathNameToRelativeNtPathName_U + 0xd2 0x7ffed2c4c612 C:\Windows\System32\ntdll.dll
20 ntdll.dll RtlVirtualUnwind + 0xae7 0x7ffed2c32b97 C:\Windows\System32\ntdll.dll
21 ntdll.dll LdrResolveDelayLoadedAPI + 0xc6 0x7ffed2c44196 C:\Windows\System32\ntdll.dll
22 rpcrt4.dll RpcErrorGetNextRecord + 0x242 0x7ffed2b04572 C:\Windows\System32\rpcrt4.dll
23 rpcrt4.dll I_RpcServerSetAddressChangeFn + 0xc71 0x7ffed2b11c81 C:\Windows\System32\rpcrt4.dll
24 rpcrt4.dll UuidCreate + 0x15 0x7ffed2af6945 C:\Windows\System32\rpcrt4.dll
25 combase.dll CoInitializeEx + 0x1688 0x7ffed2132588 C:\Windows\System32\combase.dll
26 combase.dll CoInitializeEx + 0xdf3 0x7ffed2131cf3 C:\Windows\System32\combase.dll
27 combase.dll CoInitializeEx + 0xd95 0x7ffed2131c95 C:\Windows\System32\combase.dll
28 combase.dll CoInitializeEx + 0x750 0x7ffed2131650 C:\Windows\System32\combase.dll
29 combase.dll RoGetActivatableClassRegistration + 0x45ca 0x7ffed213080a C:\Windows\System32\combase.dll
30 combase.dll CoInitializeEx + 0x268 0x7ffed2131168 C:\Windows\System32\combase.dll
31 combase.dll CoInitializeEx + 0x58 0x7ffed2130f58 C:\Windows\System32\combase.dll
32 w3wp.exe w3wp.exe + 0x12dd 0x7ff6b36012dd C:\Windows\System32\inetsrv\w3wp.exe
33 w3wp.exe w3wp.exe + 0x363d 0x7ff6b360363d C:\Windows\System32\inetsrv\w3wp.exe
34 kernel32.dll BaseThreadInitThunk + 0x14 0x7ffed14b6fd4 C:\Windows\System32\kernel32.dll
35 ntdll.dll RtlUserThreadStart + 0x21 0x7ffed2c5cec1 C:\Windows\System32\ntdll.dll

 

B4_3.JPG

 

At some point we have to decrypt the password to hand it off to LSA to log in the account and both WAS and AppCmd can do this, but it is dependent on running as either Local System or a local administrator.


If we run the same command using an account that is not a local administrator, it will fail.

 

B4_1.JPGBy design, it is architecturally infeasible to prevent an administrator from being able to read the password in this manner.
 
AppCmd is an IIS admin tool that requires admin privilege to run. Therefore, showing the password doesn’t break the security boundary. On the other hand, if the goal is to prevent “peeking over the shoulder” or “leaking password from the admin script logs”, it might be helpful to have a switch for the command line to mask the passwords. Unfortunately, such an option was never added.