From 38b873a22ce267f140193f68e8d594ca5785ce14 Mon Sep 17 00:00:00 2001 From: egieb <93350544+beigeworm@users.noreply.github.com> Date: Wed, 29 May 2024 18:54:10 +0000 Subject: [PATCH] Add files via upload --- MEMZ-In-Powershell/main.ps1 | 271 +++++++++++++++++++++++++++++++++++ Windows-Idiot-Prank/main.ps1 | 83 +++++++++++ 2 files changed, 354 insertions(+) create mode 100644 MEMZ-In-Powershell/main.ps1 create mode 100644 Windows-Idiot-Prank/main.ps1 diff --git a/MEMZ-In-Powershell/main.ps1 b/MEMZ-In-Powershell/main.ps1 new file mode 100644 index 0000000..d76614a --- /dev/null +++ b/MEMZ-In-Powershell/main.ps1 @@ -0,0 +1,271 @@ +<# ================================================ POWERSHELL MEMZ PRANK ======================================================== + +SYNOPSIS +This script plays random windows default sounds and various screen effects until it is closed (in task manager) + +USAGE +Run the script +stop in task manager (when console is hidden) + +#> + +# Hide the powershell console +$hide = 1 +if ($hide -eq 1){ + $Async = '[DllImport("user32.dll")] public static extern bool ShowWindowAsync(IntPtr hWnd, int nCmdShow);' + $Type = Add-Type -MemberDefinition $Async -name Win32ShowWindowAsync -namespace Win32Functions -PassThru + $hwnd = (Get-Process -PID $pid).MainWindowHandle + + if ($hwnd -ne [System.IntPtr]::Zero) { + $Type::ShowWindowAsync($hwnd, 0) + } + else { + $Host.UI.RawUI.WindowTitle = 'hideme' + $Proc = (Get-Process | Where-Object { $_.MainWindowTitle -eq 'hideme' }) + $hwnd = $Proc.MainWindowHandle + $Type::ShowWindowAsync($hwnd, 0) + } +} + +# Turn off screen for short period +$joboff = { + +Add-Type -TypeDefinition 'using System;using System.Runtime.InteropServices;public class Screen {[DllImport("user32.dll")]public static extern int SendMessage(int hWnd, uint Msg, int wParam, int lParam);public static void TurnOff() {SendMessage(0xFFFF, 0x0112, 0xF170, 2);}}' +[Screen]::TurnOff() + +} + +# Balloon popup +$job0 = { + +Add-Type -AssemblyName System.Drawing +Add-Type -AssemblyName System.Windows.Forms +$notify = New-Object System.Windows.Forms.NotifyIcon +$notify.Icon = [System.Drawing.SystemIcons]::Warning +$notify.Visible = $true +$balloonTipTitle = "System Error (0x00060066e)" +$balloonTipText = "WARNING! - System Breach Detected" +$notify.ShowBalloonTip(30000, $balloonTipTitle, $balloonTipText, [System.Windows.Forms.ToolTipIcon]::WARNING) + +} + +# Mouse error icon +$job1 = { + +Add-Type -AssemblyName System.Drawing +Add-Type -AssemblyName System.Windows.Forms + + +$desktopHandle = [System.IntPtr]::Zero +$graphics = [System.Drawing.Graphics]::FromHwnd($desktopHandle) +$icon = [System.Drawing.Icon]::ExtractAssociatedIcon("C:\Windows\System32\DFDWiz.exe") + +function Get-MousePosition { + $point = [System.Windows.Forms.Cursor]::Position + return $point +} + +while ($true) { + + $mousePosition = Get-MousePosition + $graphics.DrawIcon($icon, $mousePosition.X, $mousePosition.Y) + Start-Sleep -Milliseconds 50 +} + +$graphics.Clear([System.Drawing.Color]::Transparent) +$graphics.Dispose() +$icon.Dispose() + +} + +# Screen Glitches +$job2 = { + +Add-Type -AssemblyName System.Windows.Forms +Add-Type -AssemblyName System.Drawing + + +$Filett = "$env:temp\SC.png" +$Screen = [System.Windows.Forms.SystemInformation]::VirtualScreen +$Width = $Screen.Width +$Height = $Screen.Height +$Left = $Screen.Left +$Top = $Screen.Top +$bitmap = New-Object System.Drawing.Bitmap $Width, $Height +$graphic = [System.Drawing.Graphics]::FromImage($bitmap) +$graphic.CopyFromScreen($Left, $Top, 0, 0, $bitmap.Size) +$bitmap.Save($Filett, [System.Drawing.Imaging.ImageFormat]::png) +$savedImage = [System.Drawing.Image]::FromFile($Filett) + +$desktopHandle = [System.IntPtr]::Zero +$graphics = [System.Drawing.Graphics]::FromHwnd($desktopHandle) + +$random = New-Object System.Random + +function Get-RandomSize { + return $random.Next(100, 500) +} + +function Get-RandomPosition { + param ( + [int]$rectWidth, + [int]$rectHeight + ) + $x = $random.Next(0, $Width - $rectWidth) + $y = $random.Next(0, $Height - $rectHeight) + return [PSCustomObject]@{X = $x; Y = $y} +} + +while ($true) { + + $rectWidth = Get-RandomSize + $rectHeight = Get-RandomSize + + $srcX = $random.Next(0, $savedImage.Width - $rectWidth) + $srcY = $random.Next(0, $savedImage.Height - $rectHeight) + + $destPosition = Get-RandomPosition -rectWidth $rectWidth -rectHeight $rectHeight + + $srcRect = New-Object System.Drawing.Rectangle $srcX, $srcY, $rectWidth, $rectHeight + $destRect = New-Object System.Drawing.Rectangle $destPosition.X, $destPosition.Y, $rectWidth, $rectHeight + + $graphics.DrawImage($savedImage, $destRect, $srcRect, [System.Drawing.GraphicsUnit]::Pixel) + + Start-Sleep -Milliseconds 100 +} + +$savedImage.Dispose() +$graphics.Dispose() +$bitmap.Dispose() +$graphic.Dispose() +} + +# Circular spinning colors +$job3 = { + +Add-Type -AssemblyName System.Drawing +Add-Type -AssemblyName System.Windows.Forms + +$screen = [System.Windows.Forms.Screen]::PrimaryScreen +$Width = $screen.Bounds.Width +$Height = $screen.Bounds.Height +$X = [math]::Round($Width / 2) +$Y = [math]::Round($Height / 2) + +$desktopHandle = [System.IntPtr]::Zero +$graphics = [System.Drawing.Graphics]::FromHwnd($desktopHandle) + +function Get-RandomColor { + $random = New-Object System.Random + $r = $random.Next(0, 256) + $g = $random.Next(0, 256) + $b = $random.Next(0, 256) + return [System.Drawing.Color]::FromArgb($r, $g, $b) +} + +$angle = 0 +$length = 10 + +while ($true) { + $pen = New-Object System.Drawing.Pen((Get-RandomColor), 20) + + $endX1 = $X + [math]::Round($length * [math]::Cos([math]::PI * $angle / 180)) + $endY1 = $Y + [math]::Round($length * [math]::Sin([math]::PI * $angle / 180)) + + $oppositeAngle = $angle + 180 + $endX2 = $X + [math]::Round($length * [math]::Cos([math]::PI * $oppositeAngle / 180)) + $endY2 = $Y + [math]::Round($length * [math]::Sin([math]::PI * $oppositeAngle / 180)) + + $graphics.DrawLine($pen, $X, $Y, $endX1, $endY1) + $graphics.DrawLine($pen, $X, $Y, $endX2, $endY2) + + $random = New-Object System.Random + $angle += $random.Next(1, 90) + $length++ + + Start-Sleep -Milliseconds 10 + + if ($angle -ge 360) { + $angle = 0 + } + + if ($length -ge $height) { + $length = 10 + } +} + +$pen.Dispose() +$graphics.Dispose() + +} + +# Play random sounds +$job4 = { + +while($true){ + $Interval = 1 + Get-ChildItem C:\Windows\Media\ -File -Filter *.wav | Select-Object -ExpandProperty Name | Foreach-Object { + Start-Sleep -Seconds $Interval + (New-Object Media.SoundPlayer "C:\WINDOWS\Media\$_").Play() + } +} + +} + +# Display text +$job5 = { + +Add-Type -AssemblyName System.Drawing +Add-Type -AssemblyName System.Windows.Forms +$screen = [System.Windows.Forms.Screen]::PrimaryScreen +$Width = $screen.Bounds.Width +$Height = $screen.Bounds.Height +$desktopHandle = [System.IntPtr]::Zero +$graphics = [System.Drawing.Graphics]::FromHwnd($desktopHandle) +$random = New-Object System.Random +function Get-RandomFontSize { + return $random.Next(20, 101) +} +function Get-RandomPosition { + param ( + [int]$textWidth, + [int]$textHeight + ) + $x = $random.Next(0, $Width - $textWidth) + $y = $random.Next(0, $Height - $textHeight) + return [PSCustomObject]@{X = $x; Y = $y} +} +$text = "SYSTEM FAIL!" +$textColor = [System.Drawing.Color]::Red +while ($true) { + + $fontSize = Get-RandomFontSize + $font = New-Object System.Drawing.Font("Arial", $fontSize, [System.Drawing.FontStyle]::Bold) + $textSize = $graphics.MeasureString($text, $font) + $textWidth = [math]::Ceiling($textSize.Width) + $textHeight = [math]::Ceiling($textSize.Height) + $position = Get-RandomPosition -textWidth $textWidth -textHeight $textHeight + $graphics.DrawString($text, $font, (New-Object System.Drawing.SolidBrush($textColor)), $position.X, $position.Y) + $font.Dispose() + Start-Sleep -Milliseconds 500 + +} + +} + +# Start all jobs +Start-Job -ScriptBlock $job0 +sleep 5 +Start-Job -ScriptBlock $joboff +sleep 5 +Start-Job -ScriptBlock $job1 +sleep 10 +Start-Job -ScriptBlock $job4 +Start-Job -ScriptBlock $job2 +sleep 5 +Start-Job -ScriptBlock $job3 +sleep 5 +Start-Job -ScriptBlock $job5 + +# keep script alive +pause \ No newline at end of file diff --git a/Windows-Idiot-Prank/main.ps1 b/Windows-Idiot-Prank/main.ps1 new file mode 100644 index 0000000..a3d9637 --- /dev/null +++ b/Windows-Idiot-Prank/main.ps1 @@ -0,0 +1,83 @@ +<# ================================================ WINDOWS IDIOT PRANK ======================================================== + +SYNOPSIS +This script is a powershell interpretation of the famous windows idiot virus. + +USAGE +Run the script +stop in task manager (when console is hidden) + +#> + +Add-Type -AssemblyName System.Drawing +Add-Type -AssemblyName System.Windows.Forms + +# Hide the Powershell console +$hide = 1 +if ($hide -eq 1){ + $Async = '[DllImport("user32.dll")] public static extern bool ShowWindowAsync(IntPtr hWnd, int nCmdShow);' + $Type = Add-Type -MemberDefinition $Async -name Win32ShowWindowAsync -namespace Win32Functions -PassThru + $hwnd = (Get-Process -PID $pid).MainWindowHandle + + if ($hwnd -ne [System.IntPtr]::Zero) { + $Type::ShowWindowAsync($hwnd, 0) + } + else { + $Host.UI.RawUI.WindowTitle = 'hideme' + $Proc = (Get-Process | Where-Object { $_.MainWindowTitle -eq 'hideme' }) + $hwnd = $Proc.MainWindowHandle + $Type::ShowWindowAsync($hwnd, 0) + } +} + +# Download sounds and images +iwr -Uri 'https://i.ibb.co/gDVfZ0L/white.jpg' -OutFile "$env:TEMP\white.jpg" +iwr -Uri 'https://i.ibb.co/0nxjGzH/black.jpg' -OutFile "$env:TEMP\black.jpg" +iwr -Uri 'https://github.com/beigeworm/assets/raw/main/idiot.wav' -OutFile "$env:TEMP\sound.wav" +sleep 1 + +# Loop sound +$job1 = { + + while ($true){ + (New-Object Media.SoundPlayer "$env:TEMP\sound.wav").Play(); + sleep 5 + } + +} + +# Loop images +$job2 = { + Add-Type -AssemblyName System.Drawing + Add-Type -AssemblyName System.Windows.Forms + $image1 = [System.Drawing.Image]::FromFile("$env:TEMP\white.jpg") + $image2 = [System.Drawing.Image]::FromFile("$env:TEMP\black.jpg") + $screen = [System.Windows.Forms.Screen]::PrimaryScreen + $Width = $screen.Bounds.Width + $Height = $screen.Bounds.Height + $desktopHandle = [System.IntPtr]::Zero + $graphics = [System.Drawing.Graphics]::FromHwnd($desktopHandle) + + while ($true){ + $graphics.DrawImage($image1, 0, 0, $Width, $Height) + $graphics.DrawImage($image2, 0, 0, $Width, $Height) + } + +} + +# Volume up repeatedly +$job3 = { + + $wshell = New-Object -ComObject wscript.shell + while ($true){ + $wshell.SendKeys([char]175) + sleep -m 10 + } + +} + +# Start jobs +Start-Job -ScriptBlock $job1 +Start-Job -ScriptBlock $job2 +Start-Job -ScriptBlock $job3 +pause \ No newline at end of file