pf100

MS-DEFCON script

Apr 2nd, 2019
380
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.33 KB | None | 0 0
  1. @echo off
  2. mode con cols=89 lines=34
  3. Title MS-DEFCON from askwoody.com
  4. Color 1F
  5. ::::::::::::::::::::::::::::
  6. :: pf100 @ MDL, rpo @ MDL, RetiredGeek at www.askwoody.com forum.
  7. :: Get MS-Defcon from askwoody.com
  8. (
  9. echo # Get MS-Defcon from askwoody.com
  10. echo $progressPreference = 'silentlyContinue'
  11. echo "`r`nSledgehammer is attempting to retrieve MS-DEFCON rating from askwoody.com...`r`n"
  12. echo Try {$WebResponse = Invoke-WebRequest "https://www.askwoody.com/" -UseBasicParsing -TimeoutSec 10} Catch {$WebResponse=""}
  13. echo clear-host
  14. echo if ^($WebResponse.Statuscode -ne 200^){write-host "";"Unable to retrieve MS-DEFCON rating from askwoody.com"; exit}
  15. echo ForEach ^($Image in $WebResponse.Images^) {
  16. echo $x = $Image.OuterHTML.ToString^(^)
  17. echo If ^($x -like "*MS-DEFCON-*"^) {
  18. echo "`r`n MS-DEFCON = " + $x.split^('/'^)[8].split^('.'^)[0].SubString^(10,1^)
  19. echo "`r`n:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::"
  20. echo "`r`nMS-DEFCON 1: Current Microsoft patches are causing havoc. Don't patch.`r`n" + `
  21. echo "`r`nMS-DEFCON 2: Patch reliability is unclear. Unless you have an immediate, pressing need" + `
  22. echo "`r`n to install a specific patch, don't do it.`r`n" + `
  23. echo "`r`nMS-DEFCON 3: Patch reliability is unclear, but widespread attacks make patching prudent." + `
  24. echo "`r`n Go ahead and patch, but watch out for potential problems.`r`n" + `
  25. echo "`r`nMS-DEFCON 4: There are isolated problems with current patches, but they are well-known" + `
  26. echo "`r`n and documented here. Check this site to see if you're affected and if" + `
  27. echo "`r`n things look OK, go ahead and patch.`r`n" + `
  28. echo "`r`nMS-DEFCON 5: All's clear. Patch while it's safe.`r`n" + `
  29. echo "`r`n:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::`r`n" + `
  30. echo "`r`nMore info at https://www.askwoody.com`r`n" + `
  31. echo "`r`n:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::"
  32. echo exit
  33. echo }
  34. echo }
  35. )>"%temp%\awmsdc.ps1"
  36. PowerShell.exe -Nologo -NoProfile -ExecutionPolicy Bypass -command "%temp%\awmsdc.ps1"
  37. del "%temp%\awmsdc.ps1"
  38. ::::::::::::::::::::::::::::
  39. echo. & echo Press any key to exit...
  40. pause > nul
Advertisement
Add Comment
Please, Sign In to add comment