Schlagwort-Archive: FortiGate Appliance

Die FortiGate Next Generation Firewall nutzt spezielle Security-Prozessoren und Threat Intelligence Security Services von den FortiGuard.

FortiClient VPN Post Login Script

FortiClient SSL VPN aus CLI und Scripts ausführen

Dieser Artikel beschreibt die Verwendung des FortiClient SSL VPN über die Windows Befehlszeile, und der Anwendung aus Batch-Scripts. Der zur FortiGate gehörende FortiClient ist zu jedem gängigen Betriebssystem verfügbar, und kann aus dem Fortinet Support Bereich heruntergeladen werden. Zu dem hier verwendeten FortiClient 6.4.2.1580 für Windows, kommen zusätzlich die FortiClientTools 6.0.9.0277 zum Einsatz.

FortiClient VPN

Nachdem der FortiClient Installiert ist, lässt man die VPN Konfiguration leer. Nun werden die FortiClientTools in ein Verzeichnis entpackt, von Interesse ist der Ordner Inhalt von SSLVPNcmdline, hier die Datei FortiSSLVPNclient.exe zu finden ist, dazu die Microsoft Visual C++ Redistributable mfc140.dll, msvcp140.dll, vcruntime140.dll Laufzeitkomponenten.

Inhalt von SSLVPNcmdline FortiClientTools_6.0.9.0277.zip.

Ausführen von FortiSSLVPNclient.exe öffnet das GUI.

FortiClient SSLVPN

Wir entscheiden uns das unter Settings gespeicherte VPN Verbindungsprofil nicht zu nutzen, stattdessen wird die Verbindung aus dem CLI mit Parameter Übergabe ausgeführt.

FortiSSLVPNclient connect -h 226.62.42.81:10443 -u homer:password123 -i -q -m

Es bietet sich nun an, die VPN Verbindung mit Anmeldung und Netzlaufwerk mapping aus dem Script zu starten, die folgende Batchdatei soll dies ermöglichen.

@echo off
START "" /I FortiSSLVPNclient connect -h 226.62.42.81:10443 -u homer:password123 -i -q -m
timeout 10
net use * /delete /yes
net use R: \\10.10.10.10\data /user:homer password123 /persistent:no
REM weitere Anweisungen!

Mit connect -h wird zum VPN Gateway verbunden, mit der IP Adresse und durch Doppelpunkt getrennt die Portnummer. Der Benutzer -u der sich beim Gateway anmelden soll und dem Passwort nach dem Doppelpunkt. Mit timeout wird 10 Sekunden gewartet, damit die VPN Verbindung steht, bevor das Netzlaufwerk gemappt wird, mglicherweise kann der Wert verkleinert werden, oder er muss erhöht werden.

In der Taskleiste das Symbol, über diesem mit Rechtsklick sich das Kontextmenü öffnet.

Die VPN Verbindung wird getrennt mit folgendem Script.

@echo off
START "" /I FortiSSLVPNclient disconnect

FortiSSLVPNclient Command Line Usage
Usage: FortiSSLVPNclient.exe [options] [args]

Quellenlink: Fortinet Knowledge Base

FortiOS CVE-2018-13379 Advisory FG-IR-18-384

Allegedly, many admins did not update their FortiGate VPNs, so that attackers attack systems. The reason is the exploit code for the vulnerability (CVE-2018-13379) from 2019 that has now emerged.

Successful attacks on the SSL-VPN configured FortiOS should be made possible by sending prepared HTTP requests. Attackers could access system files and thus gain access to unencrypted access data, for example. They could then log into vulnerable VPN firewalls and compromise them.

FortiOS, which is used on FortiGate firewalls, has a total of six security holes in several versions of the Security Network operating system that affect the SSL-VPN web portal. Fortinet has published the FortiGuard Security Advisories with update notes.

FortiGuard PSIRT Advisory

Der original Textauszug:

FortiOS system file leak through SSL VPN via specially crafted HTTP resource requests

Summary

A path traversal vulnerability in the FortiOS SSL VPN web portal may allow an unauthenticated attacker to download FortiOS system files through specially crafted HTTP resource requests.
Impact

Information Disclosure
Affected Products
FortiOS 6.0 – 6.0.0 to 6.0.4
FortiOS 5.6 – 5.6.3 to 5.6.7
FortiOS 5.4 – 5.4.6 to 5.4.12
(other branches and versions than above are not impacted)
ONLY if the SSL VPN service (web-mode or tunnel-mode) is enabled.
Solutions

Upgrade to FortiOS 5.4.13, 5.6.8, 6.0.5 or 6.2.0 and above.

Workarounds:

As a temporary solution, the only workaround is to totally disable the SSL-VPN service (both web-mode and tunnel-mode) by applying the following CLI commands:

config vpn ssl settings
unset source-interface
end

Note that firewall policies tied to SSL VPN will need to be unset first for the above sequence to execute successfully.

As an example, when source-interface is „port1“ and SSL VPN interface is „ssl.root“, the following CLI commands would be needed to ensure „unset source-interface“ executes successfully:

config vpn ssl settings
config authentication-rule
purge (purge all authentication-rules)
end
end

config firewall policy
delete [policy-id] (SSL VPN policy ID(s) that srcintf is „ssl.root“ and dstintf is „port1“)
end

Note that code to exploit this vulnerability in order to obtain the credentials of logged in SSL VPN users was disclosed. In absence of upgrading to the versions listed above, mitigating the impact of this exploit can be done by enabling two-factor authentication for SSL VPN users. An attacker would then not be able to use stolen credentials to impersonate SSL VPN users.