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

Resume support #61

Open
ss23 opened this issue Sep 21, 2021 · 3 comments
Open

Resume support #61

ss23 opened this issue Sep 21, 2021 · 3 comments
Labels
enhancement New feature or request

Comments

@ss23
Copy link

ss23 commented Sep 21, 2021

Got this error while running the new ACLCrimes branch:

Unhandled Exception: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
   at SnaffCore.Classifiers.EffectiveAccess.Win32.AuthzInitializeRemoteResourceManager(IntPtr rpcInitInfo, SafeAuthzRMHandle& authRM)
   at SnaffCore.Classifiers.EffectiveAccess.Win32.GetEffectivePermissions_AuthzInitializeResourceManager(String serverName, Boolean& remoteServerAvailable) in Z:\tcfox On My Mac\Source\Repos\github.com\SnaffCon\Snaffler\SnaffCore\Classifiers\EffectiveAccess\EffectiveAccess.cs:line 479
   at SnaffCore.Classifiers.EffectiveAccess.Win32.GetEffectiveAccess(ObjectSecurity sd, IdentityReference2 identity, String serverName, Boolean& remoteServerAvailable, Exception& authzException) in Z:\tcfox On My Mac\Source\Repos\github.com\SnaffCon\Snaffler\SnaffCore\Classifiers\EffectiveAccess\EffectiveAccess.cs:line 453
   at SnaffCore.Classifiers.EffectiveAccess.EffectiveAccess.GetEffectiveAccess(FileSystemInfo item, IdentityReference2 id, String serverName) in Z:\tcfox On My Mac\Source\Repos\github.com\SnaffCon\Snaffler\SnaffCore\Classifiers\EffectiveAccess\EffectiveAccess.cs:line 113
   at SnaffCore.Classifiers.EffectiveAccess.EffectivePermissions.GetEffectivePermissions(FileSystemInfo filesysInfo, String username) in Z:\tcfox On My Mac\Source\Repos\github.com\SnaffCon\Snaffler\SnaffCore\Classifiers\EffectiveAccess\EffectiveAccess.cs:line 93
   at SnaffCore.Classifiers.EffectiveAccess.EffectivePermissions.CanRw(FileSystemInfo filesysInfo) in Z:\tcfox On My Mac\Source\Repos\github.com\SnaffCon\Snaffler\SnaffCore\Classifiers\EffectiveAccess\EffectiveAccess.cs:line 39
   at Classifiers.FileResult..ctor(FileInfo fileInfo) in Z:\tcfox On My Mac\Source\Repos\github.com\SnaffCon\Snaffler\SnaffCore\Classifiers\FileClassifier.cs:line 361
   at Classifiers.FileClassifier.ClassifyFile(FileInfo fileInfo) in Z:\tcfox On My Mac\Source\Repos\github.com\SnaffCon\Snaffler\SnaffCore\Classifiers\FileClassifier.cs:line 97
   at SnaffCore.FileScan.FileScanner.ScanFile(String file) in Z:\tcfox On My Mac\Source\Repos\github.com\SnaffCon\Snaffler\SnaffCore\FileScan\FileScanner.cs:line 26
   at SnaffCore.TreeWalk.TreeWalker.<>c__DisplayClass17_0.<WalkTree>b__0() in Z:\tcfox On My Mac\Source\Repos\github.com\SnaffCon\Snaffler\SnaffCore\TreeWalk\TreeWalker.cs:line 45
   at System.Threading.Tasks.Task.Execute()
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
   at System.Threading.Tasks.Task.ExecuteEntry(Boolean bPreventDoubleExecution)
   at SnaffCore.Concurrency.LimitedConcurrencyLevelTaskScheduler.<NotifyThreadPoolOfPendingWork>b__12_0(Object _) in Z:\tcfox On My Mac\Source\Repos\github.com\SnaffCon\Snaffler\SnaffCore\Concurrency\BlockingTaskScheduler.cs:line 171
   at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()

No idea what caused it unfortunately.

@ss23 ss23 changed the title "Attempted to read or write protected memory" error Snaffler triggered AV and died with no resume support Sep 21, 2021
@ss23
Copy link
Author

ss23 commented Sep 21, 2021

After looking into this some more, I believe what happened is Snaffler triggered AV and was killed. It might be good to include resume support or something to recover from this situation

@l0ss
Copy link
Contributor

l0ss commented Sep 21, 2021

Yeah i think we might be able to do something for a resume function but it would likely involve writing a fairly large file out to disk that contained the contents of the task queues. In order to recover from an unexpected interruption like this we'd need to be doing that on a regular interval. Certainly not impossible but not gonna lie, it's not super far up the TODO list.

@l0ss l0ss added the enhancement New feature or request label Sep 21, 2021
@l0ss l0ss changed the title Snaffler triggered AV and died with no resume support Resume support Sep 21, 2021
@l0ss
Copy link
Contributor

l0ss commented Nov 27, 2021

FYI the code that caused the original bug here has since been torn out in favour of a much simpler/faster approach. Resume functionality is something I'd still like to add at some point though so I'll leave this issue open as a reminder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants