PRTG: When Good Patches Go Bad

Through regression testing, we identify a case in which a seemingly patched version of PRTG Network Monitor is still vulnerable to an old exploit. See the process and the result.

By Jeremy Burroughs | Red Team Operator


Patched bugs and vulnerabilities may sometimes rematerialize in later versions of a product. Through regression testing, we identify a case in which a seemingly patched version of PRTG Network Monitor is still vulnerable to an old exploit. Cases like this demonstrate why vulnerability scanning and patch management are not a replacement for defense-in-depth and assumed-breach cybersecurity strategies. 

We responsibly disclosed our finding to the vendor, Paessler. Paessler fixed the vulnerability starting in version 21.2.68. 


PRTG Network Monitor is a commonly used on-premises software product by Paessler used to monitor devices, applications, network traffic, and other IT infrastructure. Management and monitoring systems are frequently a target of attackers due to their tendency to enjoy privileged access to a variety of systems on the network in the form of either stored credentials, permissive firewall rules, installed remote agents, or other forms of access. In our case, we will be exploring an issue with the PRTG Network Monitor application itself which can lead to a compromise of the underlying operating system. 


This CVE, which was originally discovered and reported back in 2018 by a researcher at CodeWatch named Josh Berry, pertains to a feature called Notification Templates.  Notification Templates in PRTG have several interesting features, but the one we will be focusing on is the Notification Method called “Execute Program.” This Notification Method allows for a user to specify an executable file, batch script, or PowerShell script to be executed upon the activation of a specific Sensor state. As we can see from reviewing the Paessler documentation, we can also trigger a Notification Template’s configured Notification Method manually using the “Send test notification” function.  

Unfortunately, we are not able to specify an arbitrary file to be executed and are instead limited to what is present within the PRTG Network Monitor installation subdirectory “\notifications\exe,” which by default only contains one example batch script and one example PowerShell script. 

Figure 1 – Default scripts for PRTG’s “Execute Program” Notification Method

However, the Notification Method options allow us to pass arbitrary parameters to the executed binary or script file. Additionally, not all characters entered by the user are properly encoded or sanitized by the PRTG web application. This is the vulnerable vector which allows us to achieve OS command injection on the PRTG Network Monitor server. 

Figure 2 – Configuration options for PRTG’s “Execute Program” Notification Method 

According to CVE-2018-9276 (as of 10/26/22), this vulnerability applies to releases of PRTG Network Monitor prior to v18.2.39; however, as we will see, this vulnerability was later reintroduced to the PRTG codebase.  

Exploiting on v20.4.63  

First, let’s log in to our PRTG instance and set up a Notification Template. It’s always nice when the credentials are set to defaults! If not, you may be out of luck, as this vulnerability is the authenticated sort.   

Figure 3 – Logging in to PRTG with default credentials

Next, we navigate to Setup > Account Settings > Notification Templates, and then add a new template. Let’s name this guy “icebreaker,” enable the “Execute Program” Notification Method, select the default PowerShell script, and load up the “Parameters” input with a variety of characters we might want to use in a PowerShell payload.

Figure 4 – Creating a Notification Template to test character encoding

Checking the contents of the configuration file located in the PRTG ProgramData folder, we can see that while single quote and double quote characters are encoded, many others (such as parentheses) are not. This is a good sign and may indicate that we can inject some PowerShell cmdlets.

Figure 5 – Checking for encoded characters in the PRTG configuration file

Let’s do another test to see if we can leverage some of these characters to execute PowerShell code within the script parameters.

Figure 6 – Configuring Notification Template to execute test code

We then manually trigger this Notification Template using the “Send test notification” function we noted earlier. Checking the server, we can see that our test file was created successfully! It is worth noting at this point that because the PRTG Network Monitor services run as SYSTEM by default, our PowerShell code is executing in the same context.

Figure 7 – Confirming successful OS command injection via Notification Templates

Now that we have a way to execute commands on the system, let’s see if we can craft a more interesting payload. First, let’s adjust the Parameters data in our Notification Template so that PowerShell will execute the contents of a remotely hosted file.

Figure 8 – Configuring Notification Template to execute contents of remote file

Next, we will create a small script to be hosted on our remote attacker machine which we will name “prtg.log.” In this case, we will perform local file system enumeration to see if we can find any interesting files. Using this technique, we don’t need to worry about avoiding characters which are encoded by PRTG.

Figure 9 – Creating a PowerShell payload file for PRTG to execute

At this point we will fire up a Python HTTP server on port 80 and manually execute our malicious Notification Template as we did before. As we can see in the web log, we have successfully enumerated local disks as well as files within the Administrator account user profile directories.

Figure 10 – Receiving output from the PowerShell payload file executed by PRTG

Let’s go ahead and exfiltrate that, erm, interesting binary. First, we will need to update our “prtg.log” payload file to send the binary file to our attacker machine via HTTP. Below is the updated code.

Figure 11 – Updated PowerShell payload file for PRTG to execute

Next, we will need a way to handle the PUT requests and save the uploaded files to disk, as this is not something the Python2 SimpleHTTPServer module will do for us out-of-the-box. We quickly put together (or… PUT together) a Python3 script which will handle incoming PUT requests and write uploaded files to disk. With this running, we can now handle the GET requests for our “prtg.log” PowerShell payload file as well as handle PUT requests to save the uploaded files to disk.

Figure 12 – Handling PUT request to save uploaded file from PRTG to disk

Voila! We now have a successful data exfiltration mechanism and can continue to pillage the PRTG server file system to our heart’s content. Of course, if you tire of this and have other services available such as RDP/SMB/WinRM, you can always create yourself a local user account on the PRTG server and use that channel instead.

Figure 13 – Successful exfiltration of file from PRTG server file system

We responsibly disclosed our finding to Paessler on 9/19/2022, which their team confirmed on 10/14/2022 as a reintroduction of the CVE-2018-9276 vulnerability to the PRTG Network Monitor code. Per their analysis, the additional affected versions include releases after v19.3.52 and before v21.2.68. This fix is noted in the v21.2.68 release notes.

Figure 14 – PRTG Network Monitor v21.2.68 release notes confirming the fix

In Summary 

While the v20.4.63 release of PRTG Network Monitor did not contain any significant vulnerabilities according to public vulnerability databases at the time of testing, we covered how regression testing can identify cases in which a previously patched vulnerability rematerializes in a later release of a given product.

Additionally, we worked through identifying escaped and unescaped characters to create a working proof-of-concept payload to exploit the vulnerability. Furthermore, we demonstrated a way to execute code containing properly escaped characters by fetching a remote payload file and demonstrated a way to weaponize this approach in a practical manner to exfiltrate files from the PRTG server operating system.

Give the Icebreaker team a shout to learn more.