WireGuard PostUp script execution is safely disabled

jtroschke

Newbie
Registriert
März 2026
Beiträge
2
Hallo,
ich möchte nach dem Aufbau des VPN-Tunnels mit WireGuard ein Script aufführen und Laufwerke einzubinden.
Als ersten Test habe ich einen einfachen DOS-Befehl aufgerufen:
PostUp: echo hallo >>c:\tmp\test.log
Im Protokoll bekomme ich die Meldung:
Skipping execution of script, because dangerous script execution is safely disabled: echo hallo >>c:\tmp\test.log

Wie kann ich das Ausführen von DOS-Kommandos erlauben?
 
Quelle: https://github.com/WireGuard/wireguard-windows/blob/master/docs/adminregistry.md

HKLM\Software\WireGuard\DangerousScriptExecution​


When this key is set to DWORD(1), the tunnel service will execute the commands specified in the PreUp, PostUp, PreDown, and PostDown options of a tunnel configuration. Note that this execution is done as the Local System user,which runs with the highest permissions on the operating system, and is therefore a real target of malware. Therefore, you should enable this option only with the utmost trepidation. Rather than use %i, WireGuard for Windows instead sets the environment variable WIREGUARD_TUNNEL_NAME to the name of the tunnel when executing these scripts.


reg add HKLM\Software\WireGuard /v DangerousScriptExecution /t REG_DWORD /d 1 /f
 
  • Gefällt mir
Reaktionen: jtroschke
Habe den Key ergänzt und es funktkioniert siehe LOG. Werde mir aber noch überlegen, ob das sicher ist.
Vielen Dank.
 

Anhänge

  • wireguard-PostUp-log.jpg
    wireguard-PostUp-log.jpg
    98,9 KB · Aufrufe: 19
Zurück
Oben