Guest User

Untitled

a guest
Apr 25th, 2018
1,767
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ## 1. Start this script running in PowerShell
  2. ## 2. Close your laptop lid. The next time the lid opens, the script will send a mail.
  3.  
  4. $lastAwake = Get-Date; while($true) {
  5.     Start-Sleep -Seconds 1
  6.     $now = Get-Date
  7.     if(($now - $lastAwake).TotalSeconds -gt 3) {
  8.         $params = @{
  9.             To = 'user@example.com'
  10.             From = 'user@example.com'
  11.             Subject = 'Evil maid detected!'
  12.             Body = "Detected laptop opened at $now"
  13.             SmtpServer = 'smtp@example.com'
  14.         }
  15.         Send-MailMessage @params
  16.     }
  17.     $lastAwake = $now
  18. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×