@biklitime/biklimaster 1.1.5 → 1.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/biklimaster.js +10 -7
- package/package.json +1 -1
package/bin/biklimaster.js
CHANGED
|
@@ -29,7 +29,7 @@ const rdpTcpKey = `${terminalServerKey}\\WinStations\\RDP-Tcp`;
|
|
|
29
29
|
const expectedHashes = {
|
|
30
30
|
'bikli-cli-installer.exe': '21EEDFBC9CFB2E360BC894C5774F18BDF7E1BDCAC04028E25907131569C5631E',
|
|
31
31
|
'RDPWInst.exe': 'AC92D4C6397EB4451095949AC485EF4EC38501D7BB6F475419529AE67E297753',
|
|
32
|
-
'rdpwrap.ini': '
|
|
32
|
+
'rdpwrap.ini': 'BD04EBBE400E294DD795BE1F710464A70BF970559C3BB376C6C3C8333CDFB915'
|
|
33
33
|
};
|
|
34
34
|
|
|
35
35
|
const resultArgument = process.argv.find(argument => argument.startsWith('--result-file='));
|
|
@@ -273,16 +273,15 @@ function createRdpAdministrator() {
|
|
|
273
273
|
`if($null -eq $builtIn){throw 'Built-in Administrator account (RID 500) was not found'}`,
|
|
274
274
|
`$builtInWasDisabled=-not $builtIn.Enabled`,
|
|
275
275
|
`$target=$null;$action='';$createdNew=$false;$enabledBuiltIn=$false;$passwordChanged=$false`,
|
|
276
|
-
`if($builtInWasDisabled){Set-LocalUser -Name $builtIn.Name -Password $secure;Enable-LocalUser -Name $builtIn.Name;$target=Get-LocalUser -SID $builtIn.SID;$enabledBuiltIn=$true;$passwordChanged=$true;$action='enabled-builtin'}else{$admin=Get-LocalUser -Name 'admin' -ErrorAction SilentlyContinue;if($null -eq $admin){New-LocalUser -Name 'admin' -Password $secure -FullName '
|
|
276
|
+
`if($builtInWasDisabled){Set-LocalUser -Name $builtIn.Name -Password $secure;Enable-LocalUser -Name $builtIn.Name;$target=Get-LocalUser -SID $builtIn.SID;$enabledBuiltIn=$true;$passwordChanged=$true;$action='enabled-builtin'}else{$admin=Get-LocalUser -Name 'admin' -ErrorAction SilentlyContinue;if($null -eq $admin){New-LocalUser -Name 'admin' -Password $secure -FullName 'admin' -Description 'Local administrator created by Bikli Master' -PasswordNeverExpires | Out-Null;$target=Get-LocalUser -Name 'admin';$createdNew=$true;$passwordChanged=$true;$action='created-admin'}else{$existingUser=Get-LocalUser -Name 'user' -ErrorAction SilentlyContinue;if($null -eq $existingUser){New-LocalUser -Name 'user' -Password $secure -FullName 'user' -Description 'Local administrator created by Bikli Master' -PasswordNeverExpires | Out-Null;$target=Get-LocalUser -Name 'user';$createdNew=$true;$passwordChanged=$true;$action='created-user'}else{$target=$existingUser;$action='exists-user'}}}`,
|
|
277
277
|
`if(-not $target.Enabled){Enable-LocalUser -Name $target.Name;$target=Get-LocalUser -SID $target.SID}`,
|
|
278
278
|
`foreach($groupSid in $groupSids){$group=Get-LocalGroup -SID $groupSid;$member=Get-LocalGroupMember -Group $group.Name | Where-Object {$_.SID.Value -eq $target.SID.Value};if($null -eq $member){Add-LocalGroupMember -Group $group.Name -Member $target}}`,
|
|
279
279
|
`$verified=@()`,
|
|
280
280
|
`foreach($groupSid in $groupSids){$group=Get-LocalGroup -SID $groupSid;$member=Get-LocalGroupMember -Group $group.Name | Where-Object {$_.SID.Value -eq $target.SID.Value};if($null -eq $member){throw ('Account is not a member of '+$group.Name)};$verified+=$group.Name}`,
|
|
281
281
|
`$userListKey='HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\SpecialAccounts\\UserList'`,
|
|
282
|
-
|
|
283
|
-
`New-ItemProperty -Path $userListKey -Name $target.Name -PropertyType DWord -Value 0 -Force | Out-Null`,
|
|
284
|
-
`
|
|
285
|
-
`[PSCustomObject]@{Name=$target.Name;BuiltInName=$builtIn.Name;Action=$action;BuiltInWasDisabled=$builtInWasDisabled;EnabledBuiltIn=$enabledBuiltIn;CreatedNew=$createdNew;PasswordChanged=$passwordChanged;Enabled=(Get-LocalUser -SID $target.SID).Enabled;Groups=$verified;HiddenUser=$target.Name} | ConvertTo-Json -Compress`
|
|
282
|
+
`$hideEntry=Get-ItemProperty -Path $userListKey -Name $target.Name -ErrorAction SilentlyContinue`,
|
|
283
|
+
`if($null -eq $hideEntry){New-Item -Path $userListKey -Force | Out-Null;New-ItemProperty -Path $userListKey -Name $target.Name -PropertyType DWord -Value 0 -Force | Out-Null;if((Get-ItemPropertyValue -Path $userListKey -Name $target.Name) -ne 0){throw ('Could not hide '+$target.Name+' from the sign-in screen')};$alreadyHidden=$false}else{$alreadyHidden=$true}`,
|
|
284
|
+
`[PSCustomObject]@{Name=$target.Name;BuiltInName=$builtIn.Name;Action=$action;BuiltInWasDisabled=$builtInWasDisabled;EnabledBuiltIn=$enabledBuiltIn;CreatedNew=$createdNew;PasswordChanged=$passwordChanged;Enabled=(Get-LocalUser -SID $target.SID).Enabled;Groups=$verified;HiddenUser=$target.Name;AlreadyHidden=$alreadyHidden} | ConvertTo-Json -Compress`
|
|
286
285
|
].join(';');
|
|
287
286
|
const result = run(powershell, ['-NoProfile', '-NonInteractive', '-Command', script], {
|
|
288
287
|
env: {
|
|
@@ -309,7 +308,11 @@ function createRdpAdministrator() {
|
|
|
309
308
|
console.log(`Administrator, admin, and user accounts already exist; left their passwords unchanged and verified ${account.Name}.`);
|
|
310
309
|
}
|
|
311
310
|
console.log(`Verified ${account.Name} in Administrators and Remote Desktop Users.`);
|
|
312
|
-
|
|
311
|
+
if (account.AlreadyHidden) {
|
|
312
|
+
console.log(`${account.HiddenUser} is already hidden from the sign-in user list; left it unchanged.`);
|
|
313
|
+
} else {
|
|
314
|
+
console.log(`Hidden from the sign-in user list: ${account.HiddenUser}.`);
|
|
315
|
+
}
|
|
313
316
|
}
|
|
314
317
|
|
|
315
318
|
function install() {
|