Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function WriteInfo {
- $OSdescription = (Get-WmiObject -Class win32_operatingsystem | Select-Object Description).Description
- $OSSplit = $OSdescription.Replace("Microsoft ","")
- $CurrentUser = $env:UserName
- mkdir C:\Fake_CCS | Out-Null
- $url = "https://raw.githubusercontent.com/lighthouse64/Powershell-Scoring-Engine-for-Cyberpatriot/master/kappa.ico"
- $wc = New-Object System.Net.WebClient
- $wc.DownloadFile($url, "C:\Fake_CCS\kappa.ico")
- $Desktop = "C:\Users\$CurrentUser\Desktop"
- Write-Host "[*] Writing Base Scoring Report..." -foregroundcolor Yellow
- $htmlFile = "C:\Fake_CCS\Scoring Report.html"
- echo "<!DOCTYPE html>" | Out-File $htmlFile | Out-Null
- echo "<html>" | Out-File $htmlFile -Append | Out-Null
- echo "<head>" | Out-File $htmlFile -Append| Out-Null
- echo "<title>Scoring Report</title>" | Out-File $htmlFile -Append | Out-Null
- echo "</head>" | Out-File $htmlFile -Append | Out-Null
- echo "<style>" | Out-File $htmlFile -Append| Out-Null
- echo "body {" | Out-File $htmlFile -Append| Out-Null
- echo "font-family:verdana;" | Out-File $htmlFile -Append | Out-Null
- echo "}" | Out-File $htmlFile -Append | Out-Null
- echo "</style>" | Out-File $htmlFile -Append | Out-Null
- echo "<body>" | Out-File $htmlFile -Append | Out-Null
- echo '<img src="cp-logo.png"/>' | Out-File $htmlFile -Append | Out-Null
- echo "<br>" | Out-File $htmlFile -Append | Out-Null
- echo "<h1><center>$OSSplit</center></h1>" | Out-File $htmlFile -Append | Out-Null
- echo "<p><center>Report Generated At: N/A</center></p>" | Out-File $htmlFile -Append | Out-Null
- echo "<p><center>Approximate Running Time: N/A</center></p>" | Out-File $htmlFile -Append | Out-Null
- echo "<br>" | Out-File $htmlFile -Append | Out-Null
- echo "<p>X out of Y scored security issues fixed</p>" | Out-File $htmlFile -Append | Out-Null
- echo "</body>" | Out-File $htmlFile -Append | Out-Null
- echo "</html>" | Out-File $htmlFile -Append | Out-Null
- $AppLocation = "C:\Fake_CCS\Scoring Report.html"
- $WshShell = New-Object -ComObject WScript.Shell
- $Shortcut = $WshShell.CreateShortcut("$Desktop\Scoring Report.lnk")
- $Shortcut.TargetPath = $AppLocation
- $Shortcut.IconLocation = "C:\Fake_CCS\kappa.ico"
- $Shortcut.Description ="Scoring"
- $Shortcut.WorkingDirectory ="C:\Fake_CCS"
- $Shortcut.Save()
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement