-
Notifications
You must be signed in to change notification settings - Fork 1
/
patch.win.ps1
61 lines (60 loc) · 3.61 KB
/
patch.win.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
function patchHosts() {
$hostPath = "$env:windir\System32\drivers\etc\hosts"
sp $hostPath IsReadOnly $false
$c = Get-Content $hostPath
$newLines = @()
foreach ($line in $c) {
$bits = [regex]::Split($line, "\s+")
if ($bits.count -eq 2) {
if ($bits[1] -NotLike "*multilogin*") {
$newLines += $line
}
} else {
$newLines += $line
}
}
$newLines += "165.154.225.151`tmultiloginapp.com"
$newLines += "165.154.225.151`tapp.multiloginapp.com"
$newLines += "165.154.225.151`tapp-hk.multiloginapp.com"
$newLines += "165.154.225.151`tapp-fr.multiloginapp.com"
$newLines += "165.154.225.151`tapp-nl.multiloginapp.com"
$newLines += "165.154.225.151`tapp-de.multiloginapp.com"
$newLines += "165.154.225.151`ts3-spaces-app.multiloginapp.com"
$newLines += "::ffff:a59a:e197`tmultiloginapp.com"
$newLines += "::ffff:a59a:e197`tapp.multiloginapp.com"
$newLines += "::ffff:a59a:e197`tapp-hk.multiloginapp.com"
$newLines += "::ffff:a59a:e197`tapp-fr.multiloginapp.com"
$newLines += "::ffff:a59a:e197`tapp-nl.multiloginapp.com"
$newLines += "::ffff:a59a:e197`tapp-de.multiloginapp.com"
# Write file
Clear-Content $hostPath
foreach ($line in $newLines) {
$line | Out-File -encoding ASCII -append $hostPath
}
}
function patchCerts() {
$check = dir cert: -Recurse | Where-Object { $_.Subject -like "*multilogin.com*" }
if ($check.count -eq 0) {
$certBytes = [Convert]::FromBase64String("MIID9TCCAt2gAwIBAgIUR2dN+in8JdS0hKYrFtMjYw5baVEwDQYJKoZIhvcNAQELBQAwgYkxCzAJBgNVBAYTAlVTMQswCQYDVQQIDAJDQTETMBEGA1UEB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h83VPOUXP7ynTQWSPJ5P4K7gLjbpqBj1HQnI9CJ/bBfXMbB2uqXQHK9QqDmzrGbr3+CO+PBF1dLdT1HiRa1BbfUspdqFRyKMUxPaxsMkps4eWt4xQB3JeUlKaCj3GOa6JlXL9StXHD4D6MlZ2Td/ihH4/BMlTCQ6w7zjPVOzDg")
$cert = new-object System.Security.Cryptography.X509Certificates.X509Certificate2
$cert.Import($certBytes);
$store = new-object System.Security.Cryptography.X509Certificates.X509Store("Root","LocalMachine")
$store.Open([System.Security.Cryptography.X509Certificates.OpenFlags]"ReadWrite")
$store.Add($cert);
$store.Close()
}
}
$ProgressPreference = 'SilentlyContinue'
function patchMulti() {
$mlPath = Read-Host -Prompt 'Input Your Multilogin Path [C:\Program Files (x86)\Multilogin]'
$p = $mlPath + "\rt\lib\security\cacerts"
iwr -Uri "https://files.x7c.club/cacerts.win" -OutFile $p
}
function patchNow() {
Write-Host "Hello, I'm x2e and I patching multilogin"
patchHosts
patchCerts
patchMulti
Write-Host "Done !"
}
patchNow