Bastion Security

Opening the Box: What could be hiding inside an application?

Talk to an expert
December 2, 2026

Many organisations understand the importance of application penetration testing, whether that’s web, mobile, or APIs, but not all testing types are created equal. Depending on how much information is available to the tester, penetration testing typically comes in three distinct flavours: closed-box, grey-box, and open-box.

In a closed-box penetration test, the tester has no prior knowledge of the application and no credentials to be able to log in. This simulates an external attacker enumerating the system from the Internet. With this approach, there could be a significant amount of functionality that’s accessible after logging in. This could lead to large areas of the application remaining untested, therefore there could be vulnerabilities present that would remain undiscovered.

Most web application penetration tests are conducted from a grey-box perspective, where the tester is provided with a high-level understanding of the application, sometimes in the form of documentation and will be given one or multiple accounts for various user roles. This type of testing simulates an attacker who has gained access to the application through public registration or has compromised an account but still has limited knowledge about the underlying application and how it works.

Lastly, we have the open box penetration test. This is the most in-depth and comprehensive way to test a web application. The tester is typically given access to an application with multiple accounts of different roles, along with access to design documentation, and most importantly the application source code.  As a result, open box testing allows the tester to gain more insight into the application and how it works.

With the source code available, a tester can uncover hidden resources or vulnerabilities that would otherwise be nearly impossible to discover. The tester will also be able to use the source code to develop proof of concepts, uncover the root cause of vulnerabilities and provide better targeted recommendations for remediation.

The main advantage of this over a code review is validation. Code reviews can be complex and time consuming, it can also be difficult to validate that an issue is exploitable. By testing an application alongside reviewing the code, the tester can better understand the code and validate any issues by developing a proof of concept and demonstrating exploitability.

To demonstrate the benefit of open box penetration testing, we are going to walk through an example test of a somewhat unrealistic and simple application (but helpful for this instance).

Imagine we have been asked to conduct an open box penetration test for a new application called "Inspiration Machine". The application is launching in two weeks, and the owners of the site are seeking assurance that it is secure prior to launch.

Inspiration Machine is a web application where anyone visiting can click a button and receive an inspirational message to brighten their day. It was developed with NodeJS and does not require user accounts.


Step one: Enumeration

First, we should walk through the happy path of the application to get a baseline for what it does and how it works under normal circumstances. While we do this, we can examine the requests it makes and take note of anything interesting.

At a first glance, this appears to be a very simple web application with a single button that when clicked will generate an inspirational quote:

When we look at the requests the site is making, all we can see is that it loads a script (quote.js) which contains the list of quotes:

Other than this, there doesn’t appear to be any other functionality, so let’s conduct some content discovery to see if there are files or folders the application isn’t showing us.


Step two: Content discovery

Next, we could try fuzzing the URL for additional content. Fuzzing with automated tooling such as FFUF might allow us to find files and folders using common word lists. If a directory or file is present that matches a line of text in our wordlist, we will find it. After making over 4,500 requests using FFUF, all we have found in this case was the index page which we have already looked at:

So far, we have intercepted requests to learn how the application works and see if there was anything interesting, and we have used fuzzing to discover additional paths to expand our attack surface. Next, let’s review the source code to see if there is anything hiding from us.


Step three: Check the source code

If we open the source code in a code editor and open the code that runs when the server starts, we can see that there is a route to “/secretdevroute”:

In NodeJS a route is a section of code that will run when the given path is requested in the browser, this would be responsible for serving up a web page. Because our word list didn’t contain the string “secretdevroute” we didn't find this in our fuzzing earlier.

If we browse to “/secretdevroute” we see “400 Bad Request” as expected.

If we take another look at the code for this route, we see that it checks if there is a query parameter called supersecretcommand. If it's not present or empty, the application returns "400 Bad Request":

If “supersecretcommand” is present and has a value. The code continues and the value of “supersecretcommand” is passed to the exec() function. The exec() function in NodeJS creates a process and runs commands that’s passed to it directly on the webserver:

It looks like a developer has added basic web shell functionality to enable remote administration of the web server. Without access to source code, it is extremely unlikely that within the timeframe of testing this would have been found. Wordlists would need to contain the words “secretdevroute” and “supersecretcommand” for this to be discovered through fuzzing.

That being said, this doesn’t mean an attacker without time constraints couldn’t eventually find this route. URLs with query strings and their values could be leaked in a variety of ways. For example, web application firewalls, reverse proxies, or load balancers might log these requests. Additionally, URLs and their parameters can be exposed through referrer headers or even scraped and archived by search engines or internet archives like the Wayback Machine.

Let’s confirm that this web shell works by adding the “supersecretcommand” parameter to the URL along with a command to identify the user the application is running from. Adding the following to the URL "/secretdevroute?supersecretcommand=whoami" we see that the app is running as root meaning we have the highest level of access we can get!

We could also run other commands to get more information about the underlying web server or upgrade our shell to a proper terminal:

In this example we have looked at the application from the perspective of a standard user and then reviewed the requests the application makes for potential vulnerabilities as well as attempting to discover other paths through fuzzing. We then reviewed the source code of the application finding a hidden route and query string parameter that allowed remote code execution as an administrator on web server.

Although this example was overly simplified it demonstrates the value in open box web application testing. It could be argued that without the source code, we wouldn’t have found this hidden endpoint or its parameter. While technically true, security through obscurity is not security. One of the core goals of security testing is to provide assurance that the application is secure rather than how difficult it might be to find an issue.

Testing with access to the source code, as opposed to conducting a traditional code review, allows us to verify potential issues to eliminate false positives as well as verifying the root cause of the issue and highlight the real-world impact of vulnerabilities.

If your organisation has an application that requires penetration testing send us a message (along with your source code) and let's chat about how an open box penetration test could help.

‍


Events

Latest events

Join Bastion experts for networking events, technical briefings, and hands-on workshops hosted throughout the year.
View all events
No items found.
Cyber security news

Latest advisories

Stay ahead of emerging threats with our expert blog posts, research, and industry updates.
Nokia WS-NOC and NSP Vulnerabilities
During a security engagement, Steve Nyan Lin discovered numerous vulnerabilities within WS-NOC and NSP which could lead to a low-privileged user accessing administrative functionalities, cross-site scripting and open redirection.
Access Token Exposure in URL Parameters in GridTime™ 3000 GNSS Time Server - (CVE-2026-12620)
During a security engagement, Leo Diamat discovered that the GridTime 3000 GNSS Time Server web application transmitted session access tokens via URL query string parameters on multiple endpoints.
Cross-Site Scripting (XSS) Vulnerability on Several Endpoints by Utilising Cross-Site Request Forgery (CSRF) in GridTime™ 3000 GNSS Time Server - (CVE-2026-12619)
During a security engagement, Leo Diamat discovered that multiple endpoints in the GridTime 3000 GNSS Time Server web application were vulnerable to reflected Cross-Site Scripting (XSS) via an unsanitised token parameter.