File size: 2,659 Bytes
faf2af6
 
de1de0f
 
 
 
 
faf2af6
 
 
de1de0f
 
 
 
 
faf2af6
 
 
 
 
 
 
 
 
 
 
 
 
 
de1de0f
faf2af6
 
de1de0f
 
 
 
 
 
 
faf2af6
 
 
de1de0f
 
 
 
faf2af6
de1de0f
faf2af6
 
 
 
de1de0f
faf2af6
 
 
 
 
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
Write-Host "`n--- 1) Kiểm tra hosts file (tìm 'kms') ---" -ForegroundColor Cyan
$hosts = Get-Content -Path "$env:SystemRoot\System32\drivers\etc\hosts" -ErrorAction SilentlyContinue
if ($hosts -match 'kms') { 
    $hosts | Select-String -Pattern 'kms' 
} else { 
    Write-Host "No kms entries in hosts file." 
}

Write-Host "`n--- 2) Kiểm tra scheduled tasks có chứa 'activate|aio|office|kms' ---" -ForegroundColor Cyan
$tasks = Get-ScheduledTask | Where-Object { $_.TaskName -match 'activate|aio|office|kms' -or $_.TaskPath -match 'activate|aio|office|kms' }
if ($tasks) { 
    $tasks | Format-Table TaskName, @{n='Path';e={$_.TaskPath}}, State -AutoSize 
} else { 
    Write-Host "No suspicious scheduled tasks found." 
}

Write-Host "`n--- 3) Kiểm tra service sppsvc (Software Protection) ---" -ForegroundColor Cyan
Get-Service -Name sppsvc -ErrorAction SilentlyContinue | Format-List Name, Status, StartType

Write-Host "`n--- 4) Tìm file OSPP.VBS trong hệ thống (report only) ---" -ForegroundColor Cyan
Get-ChildItem -Path "C:\Users\*" -Filter OSPP.VBS -Recurse -ErrorAction SilentlyContinue | Select-Object FullName
Get-ChildItem -Path "C:\Program Files*" -Filter OSPP.VBS -Recurse -ErrorAction SilentlyContinue | Select-Object FullName

Write-Host "`n--- 5) Tìm chuỗi 'kms' trong registry (chỉ các chỗ phổ biến) ---" -ForegroundColor Cyan
$pathsToCheck = @(
  "HKLM:\SOFTWARE",
  "HKLM:\SOFTWARE\WOW6432Node",
  "HKLM:\SYSTEM\CurrentControlSet\Services"
)

foreach ($p in $pathsToCheck) {
  try {
    Get-ChildItem -Path $p -Recurse -ErrorAction SilentlyContinue | ForEach-Object {
      $props = Get-ItemProperty -Path $_.PSPath -ErrorAction SilentlyContinue
      if ($props) {
        foreach ($prop in $props.PSObject.Properties) {
          $val = $prop.Value
          if ($val -and ($val -is [string]) -and ($val -match 'kms|kms\.srv|crsoo')) {
            Write-Output "Found in Registry Path: $($_.PSPath) | Property: $($prop.Name) | Value: $val"
          }
        }
      }
    }
  } catch {
    # ignore permission errors
  }
}

Write-Host "`n--- 6) Kiểm tra trạng thái Office (nếu có OSPP.VBS) ---" -ForegroundColor Cyan
$ospp = Get-ChildItem -Path "C:\Program Files","C:\Program Files (x86)" -Filter OSPP.VBS -Recurse -ErrorAction SilentlyContinue | Select-Object -First 1
if ($ospp) {
  Write-Host "Found OSPP.VBS at: $($ospp.FullName)"
  Write-Host "Nếu muốn kiểm tra trạng thái: cd tới thư mục đó rồi chạy `cscript OSPP.VBS /dstatus`"
} else {
  Write-Host "No OSPP.VBS found in Program Files (official location)."
}

Write-Host "`n--- End of report ---" -ForegroundColor Green