You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I suggest incorporating an additional flag when setting up a command for systems linked to specific target Group Policy Objects (GPOs). This would help narrow down the host range on which the command operates. Consider utilizing a straightforward conditional check.
For instance, if a command is scheduled to run across 1000+ systems via a particular GPO, it's likely that some systems should remain unaffected. By integrating an 'if' statement, the command would execute only if the system's hostname matches one within a predefined list.
Here's an enhanced example of how the PowerShell script might look when embedded into the GPO:
# Get the current hostname$hostname=$env:COMPUTERNAME# Define the hostnames to check against$targetHostnames=@("host2424","host2329")
# Check if the current hostname is in the list of target hostnamesif ($targetHostnames-contains$hostname) {
# Execute the command if the hostname matches
whoami
}
This method effectively narrows down the scope of impacted systems, providing a more controlled and secure execution environment.
P.S.: While it's possible to include these conditions directly within the command, this approach offers clarity and flexibility, which might prove beneficial.
The text was updated successfully, but these errors were encountered:
michiiii
changed the title
Adding an attribute to run the command
Adding an attribute to run the command on specific targets
Dec 21, 2023
Very sorry for the delay. Thank you for your suggestion. It has been on my TODO list for quite some months now, but I could not find the time to implement it, and will probably not be able to do so in the near future.
As you noted, restricting payload execution to certain target hosts can be performed in the payload logic itself, although it may be interesting to have an option performing this action for the user (by simply wrapping the payload in a condition such as the one you proposed in your issue).
If you are willing to implement it, please submit a pull request and I'Il gladly have a look at it and merge it :)
Hello,
Fantastic job on your current project!
I suggest incorporating an additional flag when setting up a command for systems linked to specific target Group Policy Objects (GPOs). This would help narrow down the host range on which the command operates. Consider utilizing a straightforward conditional check.
For instance, if a command is scheduled to run across 1000+ systems via a particular GPO, it's likely that some systems should remain unaffected. By integrating an 'if' statement, the command would execute only if the system's hostname matches one within a predefined list.
Here's an enhanced example of how the PowerShell script might look when embedded into the GPO:
This method effectively narrows down the scope of impacted systems, providing a more controlled and secure execution environment.
P.S.: While it's possible to include these conditions directly within the command, this approach offers clarity and flexibility, which might prove beneficial.
The text was updated successfully, but these errors were encountered: