orenma

Untitled

Jan 15th, 2026
855
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. # RDP Detection Validation Script
  2. # Target: xsiamclient02
  3. # Purpose: Generate telemetry for XDR validation
  4.  
  5. $target = ""
  6. $testUser = "SimulatedAttacker"
  7. $iterations = 5 # Small number for validation; avoids account lockout
  8.  
  9. Write-Host "Starting RDP validation telemetry generation for $target..." -ForegroundColor Cyan
  10.  
  11. for ($i = 1; $i -le $iterations; $i++) {
  12. Write-Host "Attempt $i: Initiating RDP connection signal..." -ForegroundColor Yellow
  13.  
  14. # 1. Simulates the process activity (mstsc.exe)
  15. # 2. Generates the network connection attempt to port 3389
  16. # Using 'cmdkey' allows the script to pass a "bad" credential without a GUI popup
  17. cmdkey /add:$target /user:$testUser /pass:"WrongPassword$i"
  18.  
  19. # Start the RDP process (it will fail authentication silently or show a prompt)
  20. Start-Process mstsc.exe -ArgumentList "/v:$target" -WindowStyle Hidden
  21.  
  22. # Brief pause to allow the agent to capture the session start
  23. Start-Sleep -Seconds 3
  24.  
  25. # Clean up the process and the cached "bad" credential
  26. Stop-Process -Name mstsc -ErrorAction SilentlyContinue
  27. cmdkey /delete:$target
  28. }
  29.  
  30. Write-Host "Validation complete. Check XSIAM for Event ID 4625 and mstsc.exe activity." -ForegroundColor Green
Advertisement