Advertisement
Guest User

sreport

a guest
Feb 13th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.25 KB | None | 0 0
  1. function WriteInfo {
  2. $OSdescription = (Get-WmiObject -Class win32_operatingsystem | Select-Object Description).Description
  3. $OSSplit = $OSdescription.Replace("Microsoft ","")
  4. $CurrentUser = $env:UserName
  5. mkdir C:\Fake_CCS | Out-Null
  6. $url = "https://raw.githubusercontent.com/lighthouse64/Powershell-Scoring-Engine-for-Cyberpatriot/master/kappa.ico"
  7. $wc = New-Object System.Net.WebClient
  8. $wc.DownloadFile($url, "C:\Fake_CCS\kappa.ico")
  9. $Desktop = "C:\Users\$CurrentUser\Desktop"
  10. Write-Host "[*] Writing Base Scoring Report..." -foregroundcolor Yellow
  11. $htmlFile = "C:\Fake_CCS\Scoring Report.html"
  12. echo "<!DOCTYPE html>" | Out-File $htmlFile | Out-Null
  13. echo "<html>" | Out-File $htmlFile -Append | Out-Null
  14. echo "<head>" | Out-File $htmlFile -Append| Out-Null
  15. echo "<title>Scoring Report</title>" | Out-File $htmlFile -Append | Out-Null
  16. echo "</head>" | Out-File $htmlFile -Append | Out-Null
  17. echo "<style>" | Out-File $htmlFile -Append| Out-Null
  18. echo "body {" | Out-File $htmlFile -Append| Out-Null
  19. echo "font-family:verdana;" | Out-File $htmlFile -Append | Out-Null
  20. echo "}" | Out-File $htmlFile -Append | Out-Null
  21. echo "</style>" | Out-File $htmlFile -Append | Out-Null
  22. echo "<body>" | Out-File $htmlFile -Append | Out-Null
  23. echo '<img src="cp-logo.png"/>' | Out-File $htmlFile -Append | Out-Null
  24. echo "<br>" | Out-File $htmlFile -Append | Out-Null
  25. echo "<h1><center>$OSSplit</center></h1>" | Out-File $htmlFile -Append | Out-Null
  26. echo "<p><center>Report Generated At: N/A</center></p>" | Out-File $htmlFile -Append | Out-Null
  27. echo "<p><center>Approximate Running Time: N/A</center></p>" | Out-File $htmlFile -Append | Out-Null
  28. echo "<br>" | Out-File $htmlFile -Append | Out-Null
  29. echo "<p>X out of Y scored security issues fixed</p>" | Out-File $htmlFile -Append | Out-Null
  30. echo "</body>" | Out-File $htmlFile -Append | Out-Null
  31. echo "</html>" | Out-File $htmlFile -Append | Out-Null
  32. $AppLocation = "C:\Fake_CCS\Scoring Report.html"
  33. $WshShell = New-Object -ComObject WScript.Shell
  34. $Shortcut = $WshShell.CreateShortcut("$Desktop\Scoring Report.lnk")
  35. $Shortcut.TargetPath = $AppLocation
  36. $Shortcut.IconLocation = "C:\Fake_CCS\kappa.ico"
  37. $Shortcut.Description ="Scoring"
  38. $Shortcut.WorkingDirectory ="C:\Fake_CCS"
  39. $Shortcut.Save()
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement