Comments (3)
I have also attempted to use reflection to load the DLL as well but am getting an exception:
New-Object : Exception calling ".ctor" with "1" argument(s): "The type initializer for 'Microsoft.Exchange.WebServices.Data.ExchangeServiceBase' threw an exception."
At C:\temp\MailSniper.ps1:361 char:22
+ $service = New-Object <<<< Microsoft.Exchange.WebServices.Data.ExchangeService($ServiceExchangeVersion)
from mailsniper.
I have implemented a temporary work around to delete the EWS DLL but I'm leaving the issue open because I want to get this to work completely in memory, and not write the DLL to disk.
To delete the DLL I had to kill the primary PowerShell process before trying to delete the file. To do this I started a new PowerShell process, had it sleep for 250 milliseconds, exit the main process, then have the new process delete the DLL.
Relevant code (at the end both Invoke-GlobalMailSearch and Invoke-SelfSearch):
#Removing EWS DLL
Start-Process -NoNewWindow powershell.exe -argument "-command Start-Sleep -m 250; Remove-Item $env:temp\ews.dll -Force"
exit
from mailsniper.
This issue has been fixed with PR #38.
With much help from @HarmJ0y and @mattifestation the Exchange Web
Services DLL has been patched to prevent it from erroring out when
loaded via Reflective Assembly. All of the modules that used to write
it to disk now load it in memory.
The Exchange Web Services DLL used by MailSniper was patched to remove the implicit call to GetExecutingAssembly().Location in Microsoft.Exchange.WebServices.Data.EwsUtilities.<.cctor>b__9() that's called by the ExchangeServiceBase constructor when building the user agent string.
from mailsniper.
Related Issues (20)
- Key word synonym's
- The underlying connection was closed: An unexpected error occurred on a send. HOT 1
- Feature Request - Proxy support HOT 1
- Feature Request - Ignore SSL errors HOT 3
- Feature Request : Check userlist with specific password for each
- Exception calling Bind: ID property must be set
- Trouble with module?
- Problems running Invoke-SelfSearch and Invoke-GlobalMailSearch HOT 2
- Exception calling ".ctor" with "2" argument(s): "Cannot process argument because the value of argument "userName" is not valid HOT 1
- Exception: The Autodiscover service couldn't be located.
- Latest version: "reserved for future use" and other errors HOT 1
- HTTP 400 with Invoke-InjectGEventAPI
- i need to testing the Invoke-PasswordSprayEWS
- Impersonation Account Credential HOT 2
- Credentials HOT 2
- Invoke-PasswordSprayEWS threads
- The request failed. The remote server returned an error : Forbidden HOT 3
- The Gmail spray module HOT 2
- Typo: Invoke-GlobalO365MailSearch -UsePrtImperonsationAccount HOT 2
- Feature Request - Rate Limiter
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mailsniper.