
Herramienta en C# para interactuar con MS Exchange basada en la documentación de MS
Este POC de línea de comandos demuestra cómo se puede usar C# para interactuar con Microsoft Exchange (EWS), mostrando que puede hacerse con otras herramientas además de PowerShell. Sí, es un POC simple para mostrar cómo podría hacerse. No es 100%. Si quieres lucir tus habilidades l33t de codificador C# o de red teamer, abre un pull request, por favor :) Esto es solo con fines educativos. No lo uses para cosas malvadas o ilegales.
Required Inputs (Must be in order shown):
ReadEmailExchange.exe WEBDomain DomainName Password InternalDomainName DUMPItem
Example WEBDomain: webmail.domain.com
Example DomainName: User1
Example Password: SecretPassword
Example InternalDomainName: domain
Options for DUMPItem:
Inbox
Sent
Drafts
Deleted
Skype
Attachments (Will Download Atatchments from the Inbox, DeletedItems, and Sent Items folders)
SendEmail ToEmailAddress~Subject~Body(Body can be file path)~AttachmentLocalFilePath(optional)
All (All == will try to dump all the items above)(I would default to this if unsure)
Optional Inputs:
ReadEmailExchange.exe WEBDomain DomainName Password InternalDomainName DUMPItem NumberOfSearchResultsToReturn
Example NumberOfSearchResultsToReturn (will return a maximum of the number,default 10): 10
Note: NumberOfSearchResultsToReturn must be a int/whole number
Optional Inputs:
ReadEmailExchange.exe WEBDomain DomainName Password InternalDomainName DUMPItem NumberOfSearchResultsToReturn OutputFileNameOrPath
Example OutputFileNameOrPath: C:\file.csv
Note: Program needs permission to write to location
Microsoft.Exchange.WebServices
Es C#, por lo que AMSI probablemente esté activo en sistemas modernos donde esté habilitado
Puede escribir archivos de texto en el disco
Usa la cadena de user agent predeterminada de .NET (Por ejemplo: ... .NET CLR ...)
Al ejecutarse, el exe de .NET podría crear el archivo temporal en la estructura de carpetas de la cuenta del usuario con su nombre.
GUID de la aplicación
Existen muchas más oportunidades si se revisa el código