<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Chen Levy Ben Aroy on Medium]]></title>
        <description><![CDATA[Stories by Chen Levy Ben Aroy on Medium]]></description>
        <link>https://medium.com/@ChenLevyBA?source=rss-e3a03604d20e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*SXLdHN3DgOJpKg7ZFm5gSQ.jpeg</url>
            <title>Stories by Chen Levy Ben Aroy on Medium</title>
            <link>https://medium.com/@ChenLevyBA?source=rss-e3a03604d20e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 02:01:57 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ChenLevyBA/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[No Portals Needed]]></title>
            <link>https://medium.com/cyesec/no-portals-needed-79995d8f7e62?source=rss-e3a03604d20e------2</link>
            <guid isPermaLink="false">https://medium.com/p/79995d8f7e62</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[mfa-bypass]]></category>
            <category><![CDATA[global-protect]]></category>
            <category><![CDATA[red-team]]></category>
            <dc:creator><![CDATA[Chen Levy Ben Aroy]]></dc:creator>
            <pubDate>Mon, 24 Apr 2023 13:00:21 GMT</pubDate>
            <atom:updated>2023-04-30T12:09:06.371Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*04eeAM35DqADE0urwPmT8Q.png" /></figure><h4>Abusing a misconfiguration to bypass Palo Alto GlobalProtect VPN multi-factor-authentication.</h4><h3>Introduction</h3><p>The adversary mindset is a must-have quality for offensive operators in a Red Team. Every assessment brings its own limitations and “trophies.” The operators have to align with the environment’s limitations such as: secure tiering models, cutting-edge endpoint detection and response solutions, etc. Having the ability to adapt and embrace these so-called “obstacles” let the team members operate in the best and most creative ways possible to achieve control over critical assets and environments.</p><p>In a recent assessment, as in any other Red Team engagement, it started with the reconnaissance phase. During this phase, we gather internet-facing assets that are associated with the customers’ organization. After collecting and analyzing the recon data, we realized that the attack surface was pretty narrow, with no exploitable versions of internet facing software, and social engineering was reserved as the last resort. Some assets we found were determined as GlobalProtect VPN portals. After multiple tries of connection and authentication, it was determined that the authentication to the GlobalProtect portal was enforced with multi-factor authentication. As this was our only way to gain a foothold in the organization’s internal environment, we decided to further investigate the GlobalProtect interfaces.</p><h3>GlobalProtect VPN Basics</h3><p>Palo Alto’s GlobalProtect VPN is based on HTTPS requests and responses and XML data sets of configurations. The VPN has two main components that are engaged by an end user: the <strong>portal</strong> and the <strong>gateway</strong>. The portal’s job is: first, to act as a web-server that hosts the GlobalProtect’s client for Windows and MacOS. Second, it provides the official Palo Alto’s client configurations and the list of available gateways. The gateway’s purpose is to provide the raw SSLVPN tunnel we know and love, to secure the end user session to the enterprise.</p><p>The official Palo Alto’s client’s flow is:</p><ol><li>Login to the portal</li><li>Get a configuration and a list of gateways</li><li>The gateway is selected automatically or by the user’s manual selection</li><li>Login to the gateway</li><li>Provide Host Information Profile (HIP) report</li><li>If all goes right, connect to VPN and secure session</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/843/1*KMQcy2JExHJxpf9mBZycVQ.png" /><figcaption>GlobalProtect connection flow (Source: docs.paloaltonetworks.com)</figcaption></figure><p>When trying to connect to the customer’s environment with the official client, we were prompted for an MFA token. But what if we tried to connect to the gateway, while bypassing the portal?</p><p>TL;DR <strong>It seems that enforcing MFA is crucial in both the portal and gateway as these are independent components</strong>.</p><h3>Diving In to the Authentication Flow</h3><p>When first connecting with the <strong>official</strong> GlobalProtect’s client, we see the first POST request being sent to the portal by its URL which points to /global-protect/prelogin.esp</p><p>The requests will be appended with the client’s environment variables such as: ”kerberos-support”, ”client-os”,“os-version”, “ipv6-support”, etc.</p><p>The server will then respond with a “PHPSESSID” cookie and an XML data-set with the status of the request, and if successful, it will also attach the login labels for the client, such as: “Enter MFA token” or “Enter Password.”</p><figure><img alt="First request made by the official GlobalProtect client" src="https://cdn-images-1.medium.com/max/1024/1*O6YXLoR3FkHefBNegFiBSg.png" /><figcaption>First request made by the official GlobalProtect client</figcaption></figure><p>After the user enters credentials, the client will send the next request to /global-protect/getconfig.esp, sending the same information as the previous request with the credentials attached to it.</p><p>If authentication is successful, the server will send an XML data-set that includes: the server configuration, version, the client’s host information to collect, and if it exists - custom checks to perform. Custom checks are special compliance checks created by the VPN administrators, such as special registry keys the machine has to set to be compliant. Also included in the response is the list of gateways and their configurations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-enzJq4XnpiNDxpjRR0ybQ.png" /><figcaption>The server’s response to the second request results in a list of gateways and other configuration variables</figcaption></figure><p>The next request aims for the gateway, and the same authentication sequence as when the portal begins, but this time to the gateway’s endpoint: /ssl-vpn/prelogin.esp.</p><p>The pre-login phase is the same as with the portal, sending the client’s environment variables to the server. The server responds with a status, the authentication form’s labels and sets a “PHPSESSID” cookie.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NunEXBGj7pndk8GGy3bbxQ.png" /><figcaption>A successful request to the gateway yields a Success status and login labels</figcaption></figure><p>After receiving a session ID and authenticating, the next request is what differentiates between the portal and gateway authentication. The request is sent to /ssl-vpn/login.esp, with the user’s credentials appended, and in response the server sends multiple untitled arguments that look like: MTU, DNS domain, the “authcookie” that will be used in the next request, and more configuration variables.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UxiqP30zcyTvOdFkqbt0jQ.png" /><figcaption>The login request to the gateway results in the server responding in multiple unknown arguments</figcaption></figure><p>The client then parses the XML data set correctly and append these variables, including the “authcookie”, to its next request to /ssl-vpn/getconfig.esp. The server responds with a response status and more configuration variables, but this time these are all titled and more variables are sent, such as ciphers to use, protocols of the gateway, preferred tunnel IP to use, etc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pPBhdPOKNlmUzSf8Ggyk7g.png" /><figcaption>The request contains the “authcookie” received in the last server response (in red) and results in multiple configuration arguments</figcaption></figure><p>The final phase is a GET request to /ssl-tunnel-connect.sslvpn, with the user name and “authcookie” appended. This initiates the VPN session with a server response of “START_TUNNEL”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pHzPFBjhYacRIVZgn3vfeg.png" /><figcaption>A successful connection was made and a tunnel interface was set up</figcaption></figure><h3>One Misconfiguration Away from Bypassing MFA</h3><p>As we saw in the previous chapter, the VPN sequence relies on two independent components that require two separate authentication flows. <br>Because these are independent, each of the authentication sequences could be engaged manually. This means that if we already know the gateway’s information, there is no need to pass-through the portal to get a list of gateways, we could only authenticate once, with valid credentials, and still be able to get a VPN connection.</p><p>In this recent assessment, we found that <strong>an MFA token is requested by the portal only</strong>, while the gateway asks for domain credentials. The IT department and Palo Alto GlobalProtect developers, counted on their in-house client use only, with no external adaptation in mind. While not enforcing MFA at the gateway is safe when using the official client, it is not safe when using other open-source or self-built clients. This is the part where it is also important to mention that this is caused by a misconfiguration only, rather than a vulnerability in Palo Alto’s VPN solution.</p><p>Luckily, the guys from <a href="https://www.infradead.org/">InfraDead</a> already did their research on GlobalProtect while they developed the open-source VPN client <a href="https://www.infradead.org/openconnect/">OpenConnect</a> which supports multiple VPN vendors and technologies, which among them is Palo Alto <a href="https://www.infradead.org/openconnect/globalprotect.html">GlobalProtect</a>. In their documentation they elaborate:</p><blockquote>“GlobalProtect VPNs actually contain two different server interfaces: portals and gateways. Most VPNs have one portal server and one or more gateway servers; <strong>the server hosting the portal interface often hosts a gateway interface as well</strong>, but not always. The portal interface mostly sends centrally-imposed security/lockdown settings for the official client software to follow. <strong>The only information sent by the portal that’s clearly useful to a VPN client like OpenConnect (which tries to give full control to the end user) is the list of gateways</strong>.</blockquote><blockquote>Some GlobalProtect VPNs are configured in such a way that the client must authenticate to the portal before it can access the gateway, <strong>while with other VPNs no interaction with the portal is necessary</strong>. In order to replicate the behavior of the official clients, OpenConnect first attempts to connect to the portal interface of the specified server.</blockquote><blockquote><strong>If</strong><strong>--usergroup=gateway is specified (or, equivalently, </strong><strong>/gateway is appended to the server URL, e.g. https://vpn.company.com/gateway), then OpenConnect will attempt to skip the portal interface and connect immediately to the gateway interface</strong>. This is useful if the GlobalProtect VPN portal is misconfigured, such as by not offering the desired gateway server in the list it provides.”</blockquote><p>This OpenConnect feature was magical to find as it saved us expensive research and coding time.</p><h3>No Need for Portals Here…</h3><p>Because the portal and the gateway were running on the same interface, there was no need to find other gateways (such as other ports on the same server or other external assets).</p><p>We used the OpenConnect client to bypass the portal and connect to the gateway first:<br>openconnect --protocol=gp --user=user_name https://vpn.company.com<strong>/gateway</strong></p><p>The /gateway endpoint probably does not exist on the server, though it is discarded while the client runs and only serves as a flag so it will start communicating the /ssl-vpn/ endpoint rather than the /global-protect/ ones.</p><p>The VPN client prompts us for domain credentials:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/909/1*vKtbizXO5BZ5A_QcYbs8iw.png" /><figcaption>Connecting to the GlobalProtect gateway, prompts us with domain credentials only</figcaption></figure><p>Success! We are successfully connected to the internal network!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3pyq0ngPTOUJ-KpuzhhCag.png" /><figcaption>Connection to the VPN is successful, though there is no connection to some internal machines</figcaption></figure><p>In this assessment, although it was possible to connect and communicate with the organization’s domain controllers, we couldn’t communicate with many services and domain machines as we could from the official client. After researching the different behaviors between different operating systems and clients, we realized that a valid HIP report should be submitted. The OpenConnect developers, here too, were genius enough to automate a shell script that creates a fake HIP report. We copied the one from our Windows machine (By entering to the settings pane of the official client, in the Troubleshooting tab, click the “Collect Logs” button. It will create a GlobalProtectLogs.zip file in the User directory. Inside the compressed folder the HIP report could be found as pan_gp_hrpt.xml”)<br>to our ../openconnect/trojans/hipreport.sh.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lwJBxr-OAlZn2mpcMDEgkQ.png" /><figcaption>Copied a benign HIP report from a Windows machine</figcaption></figure><p>Trying to submit our fake report:<br>openconnect --protocol=gp --user=username --csd-wrapper=trojans/hipreport.sh <a href="https://vpn.company.com/gateway">https://vpn.company.com/gateway</a> and trying to reach the segmented service:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BoO5CD0aR0UTDPTD0qa4Zw.png" /><figcaption>HIP report was submitted successfully and connection to segmented resources is now available</figcaption></figure><p>We successfully bypassed both MFA and machine segregation!</p><p>From here, connecting to Active Directory, and further exploitation of the organization’s internal environment was possible.</p><h3>Quick Fix</h3><p>Mitigation of this misconfiguration is quite easy:</p><ol><li>MFA should be enforced on both the portal AND gateway(s)</li><li>Monitor direct SSLVPN connections to the gateway</li><li>Separate the portal and gateway(s) to different interfaces and ports</li><li>If possible, allow SAML authentication only</li></ol><h3>Summary</h3><p>As Red Team operators, we always aim to give our customers an added value. Every assessment has its own obstacles, but being extra vigilant when everything seems secure goes a long way. At first, it seemed like there was no external asset to attack and MFA was enforced on every interface exposed to the internet, including the GlobalProtect VPN. However, diving deeper into the interface revealed that <strong>relying on a “peace-time” user-interaction is dangerous</strong>.</p><p>Although GlobalProtect’s client is safe and could not be altered to be used differently, other VPN programs can be. The portal and gateways are independent components, which means we can authenticate each component individually, while not enforcing MFA on the gateway could lead an attacker to a foothold in the internal enterprise environment.</p><p><em>Written as part of the CYE “</em><strong><em>CyberTalks</em></strong><em>” series, to share personal knowledge gained from our real-world experience.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=79995d8f7e62" width="1" height="1" alt=""><hr><p><a href="https://medium.com/cyesec/no-portals-needed-79995d8f7e62">No Portals Needed</a> was originally published in <a href="https://medium.com/cyesec">CYESEC</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>