
Strumento C# per interagire con MS Exchange basato sulla documentazione MS
Questo POC da riga di comando mostra come C# può essere utilizzato per interagire con Microsoft Exchange (EWS), dimostrando che può essere fatto con strumenti diversi da PowerShell. Sì, è un semplice POC per mostrare come si potrebbe fare. Non è perfetto al 100%. Se vuoi mettere in mostra le tue abilità da programmatore C# l33t o da red teamer, apri una pull request per favore :) Questo è solo a scopo educativo. Non usarlo per scopi malvagi o illegali.
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
È in C#, quindi AMSI è probabilmente in gioco sui sistemi moderni dove è abilitato
Può scrivere file di testo su disco
Usa la stringa user agent .NET predefinita (Per esempio: ... .NET CLR ...)
Quando viene eseguito, l'exe .NET potrebbe creare il file temporaneo nella struttura di cartelle dell'account utente con il suo nome.
GUID dell'app
Ci sono molte altre opportunità se il codice viene revisionato