-
Notifications
You must be signed in to change notification settings - Fork 471
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
Added type check disable to ActivitySurrogateSelector generators #41
Conversation
I think perhaps adding a note would be suffice otherwise this may break some of the plugins that rely on this gadget too? Or maybe we should disable them too? |
IMHO, |
Thanks for the PR! I think it would make sense to create two new separate generators, something such as |
I'm in agreement there, might be worth adding a note at the very least for user edification.
Creating two more generators might be the cleanest way to go for now. Minimal core code changes and disambiguation between functionality. The Really the worst con is excessive/repetitive information while printing the gadgets. The help text gets quite a bit longer to show very similar information. Also worth noting that pairing/augmenting existing gadgets might become a more common occurrence. For that it might be best to consider some kind of "inheritance respect" for the An even larger consideration might be to expand gadgets out like sub-commands, and allow them to have contextually different arguments and help text. I'd be happy to help with any of this. |
After some additional testing, it appears my initial assumption was incorrect regarding the ability to stack the objects in a list. I erroneously assumed that I could flip the AppSetting To actually reset the setting, you have to add reflection: ConfigurationManager.AppSettings.Set("microsoft:WorkflowComponentModel:DisableActivitySurrogateSelectorTypeCheck", "false");
Type appSettings = Type.GetType("System.Workflow.ComponentModel.AppSettings, System.Workflow.ComponentModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35");
if (appSettings != null)
{
var disableTypeCheckFlag = appSettings.GetField("disableActivitySurrogateSelectorTypeCheck", BindingFlags.NonPublic | BindingFlags.Static);
disableTypeCheckFlag.SetValue(null, false);
var initializedFlag = appSettings.GetField("settingsInitialized", BindingFlags.NonPublic | BindingFlags.Static);
initializedFlag.SetValue(null, false);
} The disable payload still works correctly, but only when triggered first via I'll keep working on this to try and get a single "wrapped" payload. If anyone has any ideas, let me know. |
That sounds good, I dont see any problems doing that.
This sounds similar to plugins, but I think in this case it makes more sense to use raw generators, even if two more are added to the help text.
Im not sure I followed correctly, so I may be saying something stupid here, but what about adding the resting flag reflective code as part of the ActivitySurrogate payload class? |
In essence, I was hoping to avoid requiring that multiple payloads be used sequentially (separate calls to I might be missing something here myself, but provided there is no workaround, it might be best to create a separate generator called |
Ok, then it would make more sense to create the |
Expanded disable payload to support more situations
Alright, changes are complete, this should be good for the time being. I also expanded the gadget to use reflection to support situations where the setting has already been loaded into the |
Awesome, thanks! Can you also edit the README.md? |
Reference: https://silentbreaksecurity.com/re-animating-activitysurrogateselector/
The current changes are very minimal in terms of "integration". I had some additional thoughts that might be good to discuss before merging:
Generate(input, fmt, test)
format. If you are okay with this, maybe a flag for either version support or "mitigation bypasses". I'm happy to go any direction.fmt.Serialize
call, but this would be repetitive due to the way the internalSerialize()
function is currently layed out.