Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PE Net exception on Google drive files #591

Open
slaurel opened this issue Jun 23, 2021 · 1 comment
Open

PE Net exception on Google drive files #591

slaurel opened this issue Jun 23, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@slaurel
Copy link

slaurel commented Jun 23, 2021

To reproduce: Install "Google Drive for Desktop". You should now have a virtual drive letter (e.g. G:) mapped to Google Drive.

Run: asa collect -a

Get the following error once it gets to scanning the virtual drive:

[10:16:01 INF] Scanning root G:
Fatal error. Fatal error. System.Runtime.InteropServices.SEHException (0x80004005): External component has thrown an exception.
System.Runtime.InteropServices.SEHException (0x80004005): External component has thrown an exception.
at System.IO.UnmanagedMemoryAccessor.ReadInt32(Int64)
at System.Buffer.Memmove(Byte*, Byte*, UIntPtr)
at PeNet.Header.Pe.WinCertificate.get_BCertificate()
at System.Runtime.InteropServices.SafeBuffer.ReadArray[[System.Byte, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](UInt64, Byte[], Int32, Int32)
at PeNet.Header.Authenticode.AuthenticodeInfo..ctor(PeNet.PeFile)
at System.IO.UnmanagedMemoryAccessor.ReadArray[[System.Byte, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](Int64, Byte[], Int32, Int32)
at PeNet.HeaderParser.Authenticode.AuthenticodeParser.ParseTarget()
at PeNet.FileParser.MMFile.ToArray()
at Microsoft.CST.AttackSurfaceAnalyzer.Collectors.WindowsFileSystemUtils.GetSignatureStatus(System.String)
at PeNet.Header.Authenticode.AuthenticodeInfo.ComputeAuthenticodeHashFromPeFile(System.Security.Cryptography.HashAlgorithm)
at Microsoft.CST.AttackSurfaceAnalyzer.Collectors.FileSystemCollector.FilePathToFileSystemObject(System.String)
at PeNet.Header.Authenticode.AuthenticodeInfo.VerifyHash()
at Microsoft.CST.AttackSurfaceAnalyzer.Collectors.FileSystemCollector.ParseFile(System.String)
at PeNet.Header.Authenticode.AuthenticodeInfo..ctor(PeNet.PeFile)
at System.Threading.Tasks.Parallel+<>c__DisplayClass44_02[[System.__Canon, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].<PartitionerForEachWorker>b__1(System.Collections.IEnumerator ByRef, Int32, Boolean ByRef) at PeNet.HeaderParser.Authenticode.AuthenticodeParser.ParseTarget() at System.Threading.Tasks.TaskReplicator+Replica.Execute() at Microsoft.CST.AttackSurfaceAnalyzer.Collectors.WindowsFileSystemUtils.GetSignatureStatus(System.String) at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(System.Threading.Thread, System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object) at Microsoft.CST.AttackSurfaceAnalyzer.Collectors.FileSystemCollector.FilePathToFileSystemObject(System.String) at System.Threading.Tasks.Task.ExecuteWithThreadLocal(System.Threading.Tasks.Task ByRef, System.Threading.Thread) at Microsoft.CST.AttackSurfaceAnalyzer.Collectors.FileSystemCollector.ParseFile(System.String) at System.Threading.ThreadPoolWorkQueue.Dispatch() at System.Threading.Tasks.Parallel+<>c__DisplayClass44_02[[System.__Canon, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].b__1(System.Collections.IEnumerator ByRef, Int32, Boolean ByRef)
at System.Threading.Tasks.TaskReplicator+Replica.Execute()
at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(System.Threading.Thread, System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(System.Threading.Tasks.Task ByRef, System.Threading.Thread)
at System.Threading.ThreadPoolWorkQueue.Dispatch()

A potential workaround would be to allow specifying a list of drive letters to exclude.

@slaurel slaurel added the bug Something isn't working label Jun 23, 2021
@gfs
Copy link
Contributor

gfs commented Jun 24, 2021

Thanks for the report. We did (attempt) to exclude "Cloud" files by default but the implementation may only work for OneDrive.

You can use --skip-directories to skip the Google Drive

For example: asa collect -a --skip-directories G:/

Use asa collect --help for a full list of options.

@gfs gfs changed the title Need to be able to exclude drives (or fix the included Google Drive virtual disk issue) PE Net exception on Google drive files Jun 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants