Accessing VoIP Internal service via Port 8009: Routing traffic through local Apache proxy
An internal VoIP service was exposed on port 8009 using the Apache JServ Protocol (AJP), which is normally not accessible from the internet. By setting up a local Apache proxy, the attacker could route HTTP requests to the AJP port and access the service's web interface, revealing sensitive information before authentication.
Published on medium.com
{{media:0}}
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Context
This is a write-up of a private bug bounty program, so the site is referred to throughout as example.com. The program had recently added a wildcard to its scope covering all of its sub-domains. The target of interest turned out to be a host running a VOS3000 VoIP service, reachable through an Apache JServ Protocol (AJP) connector on port 8009.
AJP is the binary protocol Apache Tomcat uses to talk to a front-end web server such as Apache httpd. The connector on port 8009 exposes the same application functionality as the HTTP connector on port 8080; the difference is the wire protocol. That is the property the whole write-up turns on: if you can speak AJP, or get something else to speak it for you, you reach the application without going through whatever sits in front of port 8080.
Setup
The only tooling described is reconnaissance tooling and a local Apache install:
- Sublist3r, used to enumerate sub-domains of the in-scope wildcard.
nmap -sVagainst the extracted sub-domain list, to find open ports and the services behind them.- A local Apache server with the
mod-jkpackage and theproxy_ajpmodule, configured to forward requests to the remote AJP port.
Finding it
Sub-domain enumeration with Sublist3r produced a list, and the next step was a version scan of each host to see which had open ports and what was listening. One host stood out:
Nmap scan report for preview.example.comHost is up (0.20s latency).Not shown: 995 closed ports PORT STATE SERVICE VERSION 25/tcp filtered smtp 1300/tcp open h323hostcallsc? 1720/tcp open h323q931? 3306/tcp open mysql MySQL (unauthorized) 8009/tcp open ajp13 Apache Jserv (Protocol v1.3)
The MySQL port on 3306 was open but refused connections because it whitelists source IPs, so that was a dead end. Port 8009 was the interesting one: ajp13 Apache Jserv (Protocol v1.3). Tomcat by default listens on 8005, 8009 and 8080, so an exposed 8009 is a Tomcat AJP connector.
The researcher then found an article by Michael Bielenberg on exploiting Tomcat port 8009 over the Apache JServ protocol, which explains the key point: port 8009 hosts the exact same functionality as port 8080, the only difference being that 8009 communicates with the Apache JServ Protocol while 8080 uses HTTP. The article also explains how to turn that traffic into something readable, by proxying through a local Apache instance.
Exploitation
Step 1: install the dependencies
The first command installs the mod-jk package, which lets Apache forward requests to Tomcat over AJP, locally or to a remote instance. The second enables the proxy_ajp module and its dependencies.
apt-get install libapache2-mod-jka2enmod proxy_ajp
Step 2: configure Apache
A configuration file is created in /etc/apache2/sites-enabled/, named ajp.conf in the article, holding the proxy setup:
ProxyRequests Off# Only allow localhost to proxy requests<Proxy *>Order deny,allowDeny from allAllow from localhost</Proxy># Change the IP address in the below lines to the remote servers IP address hosting the Tomcat instanceProxyPass / ajp://[redacted]:8009/ProxyPassReverse / ajp://[redacted]:8009/
The ProxyRequests Off line keeps Apache from acting as a general forward proxy. The <Proxy *> block denies proxying to everyone except localhost, so only requests originating on the local machine are forwarded. ProxyPass and ProxyPassReverse map the local root path onto the remote AJP endpoint, which is where the target's address goes.
Step 3: start Apache
systemctl start apache2
Step 4: browse through the proxy
Visiting [redacted] causes Apache to forward the request to the server named in ajp.conf over AJP. The article states that it did exactly that.

The response was a VOS3000 VoIP instance, reached through the local proxy. The researcher had not known what VOS3000 was beforehand and looked it up, learning it was a VoIP service.
Step 5: fingerprint the Tomcat version
With the application reachable, the next check was the Tomcat version.

The banner read Apache Tomcat/5.5.15, an outdated release with numerous known vulnerabilities.
Step 6: look at the authentication flow
The researcher also started checking the flow of the VOS3000 service system. Its invalid-authentication redirection is done in JavaScript: the page loads before the redirect to the login screen happens, so content that should not be visible was rendered first. That is how material the researcher was not allowed to see became visible.
At that point the testing stopped and the issue was reported, specifically to avoid forfeiting the bounty by breaking the program's policy.
Root cause
The AJP connector on port 8009 was open. Because AJP exposes the same application functionality as the HTTP connector, anyone who can speak the protocol, or route through something that does, reaches the application directly. The local Apache proxy is only a convenience for turning AJP into ordinary HTTP in the browser; it does not add any access that the exposed port did not already grant.
On top of that, the application's authentication enforcement was client-side: the invalid-authentication redirect is performed in JavaScript, so the page is delivered and rendered before the redirect to the login screen runs. A client that does not execute or honour that redirect sees the underlying content. The report does not describe any server-side check that would have prevented this.
Impact
The researcher, without authenticating, reached the internal VoIP service (VOS3000) behind the AJP connector and saw content that should not have been visible, because the redirect to the login screen happens in JavaScript after the page loads. The exposed Tomcat version, 5.5.15, is outdated and has numerous vulnerabilities. The report does not quantify how many hosts or users were affected, and the MySQL port on the same host was not reachable because of its IP whitelist.
Fix
The report does not describe the fix that was applied.
Variants to test
- Scan in-scope sub-domains with
nmap -sVand look forajp13on 8009, or other Tomcat default ports (8005, 8080). A positive result is an AJP service banner on a host that should not expose it. - Point a local Apache
ProxyPassat the AJP port and browse[redacted]. A positive result is an application page rendered through the proxy without any login. - Check the Tomcat version banner. A positive result is an old release such as 5.5.x with published vulnerabilities.
- Load protected pages with JavaScript disabled or intercept the response before the redirect runs. A positive result is content that should require authentication appearing in the response body.
Timeline
| Date | Event |
|---|---|
| 11/12/2018 | Discovered and reported the bug |
| 11/12/2018 | Bug triaged |
| 13/12/2018 | Bug resolved and bounty rewarded |
Lessons learned
- Reconnaissance matters in every aspect of bug hunting, not only port scanning, so do not ignore it.
- If something looks suspicious, dig deeper.
What happened, in plain words
A security researcher was testing a private bug bounty program, which is a scheme where a company invites people to look for weaknesses in its systems and pays for the ones they find. The company had recently widened the rules of the game (the "scope") so that every one of its sub-domains was fair game. A sub-domain is a smaller address under the main one, like shop.example.com under example.com.
The researcher found a machine belonging to the company that was running a phone service (a VoIP service, meaning calls carried over the internet) called VOS3000. That service was reachable through a different door, port 8009, which speaks a special language called AJP. By setting up a small web server on his own computer and telling it to translate his browser's ordinary requests into that special language, he could browse the internal service as if it were a normal website. He also noticed that the service's login check was done in the browser with JavaScript, so the page was shown before the redirect to the login screen happened, and he could see things he was not supposed to see.
He stopped as soon as he had confirmed this and reported it; the timeline records that the bug was resolved and a bounty rewarded.
The starting point: a wider scope and a list of sub-domains
The program is private, so throughout the write-up the site is called example.com instead of its real name. The program had lately added a wildcard to its scope covering all of its sub-domains. A wildcard is the * symbol meaning "anything here", so a scope of *.example.com means every possible sub-domain is allowed to be tested.
Because of that, the first job was to find out which sub-domains exist. You cannot test what you cannot name, so the researcher used a tool called Sublist3r to enumerate them. Sublist3r is a tool for enumerating sub-domain names.
Scanning the hosts: what is listening on which door
Once you have a list of names, the next question is which of those machines are actually running something, and what. A port is a numbered door on a computer: one machine can run many services, each answering on its own number. A port scan knocks on many doors in turn to see which ones answer.
The tool used was nmap -sV run against the list of extracted sub-domains. nmap is the scanner; -sV tells it to also try to identify the version of the service behind each open door, not just whether the door is open. The purpose of this step was to check which hosts had open ports and which services were running behind them.
One host caught the researcher's attention:
Nmap scan report for preview.example.comHost is up (0.20s latency).Not shown: 995 closed ports PORT STATE SERVICE VERSION 25/tcp filtered smtp 1300/tcp open h323hostcallsc? 1720/tcp open h323q931? 3306/tcp open mysql MySQL (unauthorized) 8009/tcp open ajp13 Apache Jserv (Protocol v1.3)
Line by line, in plain words:
Nmap scan report for preview.example.comsays which machine this result is about: a sub-domain calledpreview.Host is up (0.20s latency)means the machine answered, and it took about a fifth of a second to reply.Not shown: 995 closed portsmeans the scanner checked a thousand doors and left out the 995 that were shut, to keep the output short.25/tcp filtered smtpis the mail-sending door.filteredmeans something in between (a firewall) is silently dropping the traffic, so the scanner cannot tell whether anything is behind it.1300/tcp open h323hostcallsc?and1720/tcp open h323q931?are two open doors that look like they belong to H.323, a family of protocols used for internet telephony. The question marks mean the scanner is guessing.3306/tcp open mysql MySQL (unauthorized)is the database door. It is open, and the service identifies itself as MySQL, but the scanner could not get in (unauthorized).8009/tcp open ajp13 Apache Jserv (Protocol v1.3)is the door that matters for this story. It is open, and the service behind it identifies itself asajp13, the Apache JServ Protocol, version 1.3.
So far so good: the MySQL port on 3306 was open, but it would not let the researcher connect because it whitelists IPs. A whitelist is a list of addresses that are allowed in, and everyone else is refused, like a guest list at a door. That was a dead end.
Port 8009 was the interesting one. Apache Tomcat, the software that runs Java web applications, by default listens on ports 8005, 8009 and 8080. So an exposed 8009 is a Tomcat AJP connector, and the researcher's reaction was simply: YES!
What AJP is, and why port 8009 matters
To understand the rest, you need one idea. A web application is a program that answers requests. Normally your browser talks to it in HTTP, the ordinary language of the web. But Tomcat can also be reached in a second language, AJP, which is a binary protocol that a front-end web server such as Apache httpd uses to pass requests on to Tomcat.
A useful comparison: HTTP is like talking to a shop assistant in English, while AJP is the same conversation in a private staff shorthand. The shop is the same, the goods are the same, only the language differs.
The connector on port 8009 exposes the same application functionality as the HTTP connector on port 8080. The only difference is the wire protocol. That is the property the whole write-up turns on: if you can speak AJP, or get something else to speak it for you, you reach the application without going through whatever sits in front of port 8080.
Finding out how to read AJP traffic
Knowing that 8009 is a Tomcat connector is not enough. The researcher's next question was how to get that traffic into a readable form so he could access whatever was running on that port. AJP is binary, so a browser cannot talk to it directly; the browser only speaks HTTP.
After some digging he found an article by Michael Bielenberg on exploiting Apache Tomcat port 8009 using the Apache JServ protocol, which explains the key point. The researcher quoted it:
" 8009 hosts the exact same functionality as port 8080. The only difference being that port 8009 communicates with the Apache JServ Protocol while port 8080 uses HTTP."
Luckily, the article did not leave out the practical part either: it explains how to turn that traffic into something readable, by proxying through a local Apache instance. A proxy is a middleman: your browser asks the proxy, and the proxy asks the real server on your behalf, then hands the answer back. Here the middleman is a small web server on your own computer that understands both languages, so it can take your browser's HTTP and re-say it in AJP.
The steps below are quoted from that article, and all credit goes to Michael Bielenberg.
Step 1: install the dependencies
The first line installs the mod-jk package, which allows Apache to forward requests to Tomcat using the AJP protocol. It can communicate with Tomcat on the local machine or with a remote instance. The second line enables the proxy_ajp module and its required dependencies automatically.
apt-get install libapache2-mod-jka2enmod proxy_ajp
In plain words:
apt-get install libapache2-mod-jkis the package manager on Debian-style Linux asking to install a piece of software calledlibapache2-mod-jk. That package is the Apache module that knows how to speak AJP to Tomcat. Think of it as buying the translation headset before a meeting.a2enmod proxy_ajpis a helper command that switches on Apache'sproxy_ajpmodule, which is the part of Apache that handles AJP proxying, and turns on whatever other modules it needs at the same time. Think of it as flipping the switch that powers the headset.
Note that in the quoted text the two commands appear run together on one line, exactly as in the source article.
Step 2: configure Apache
Next, a configuration file is created in /etc/apache2/sites-enabled/, which holds the proxy setup. The article names it ajp.conf. A configuration file is a plain text file of settings that a program reads when it starts, like a recipe card the program follows.
ProxyRequests Off# Only allow localhost to proxy requests<Proxy *>Order deny,allowDeny from allAllow from localhost</Proxy># Change the IP address in the below lines to the remote servers IP address hosting the Tomcat instanceProxyPass / ajp://[redacted]:8009/ProxyPassReverse / ajp://[redacted]:8009/
Line by line:
ProxyRequests Offkeeps Apache from acting as a general forward proxy. A forward proxy is one that will fetch any site on the internet for anyone who asks; leaving that on would turn the researcher's server into an open relay, which is both a security problem and unnecessary here.# Only allow localhost to proxy requestsis a comment. The#means the rest of the line is a note for humans and is ignored by Apache.<Proxy *>opens a block of rules that applies to all proxying. The*means "everything".Order deny,allowsets the order in which the next two rules are evaluated: first the deny rules, then the allow rules, with the later match winning.Deny from allrefuses everyone by default.Allow from localhostthen lets back in only requests that come from the same machine,localhost. The net effect is that only requests originating on the local machine are forwarded, so nobody else can use this proxy.</Proxy>closes the block.# Change the IP address in the below lines to the remote servers IP address hosting the Tomcat instanceis another comment, telling the reader to put the target's address in the next two lines.ProxyPass / ajp://[redacted]:8009/maps the local root path/onto the remote AJP endpoint. In other words: anything asked for at the root of this local server should be fetched from that address on port 8009 using AJP. This is where the target's address goes.ProxyPassReverse / ajp://[redacted]:8009/does the matching rewrite in the other direction, so that any redirects the remote server sends back are adjusted to point at the local proxy rather than at the remote address. Without it, a redirect would send your browser straight to the internal address, which your browser cannot reach.
Step 3: start Apache
systemctl start apache2
systemctl is the tool that manages background services on modern Linux, and start apache2 tells it to start the Apache web server. The configuration file just written is read at this point, so the proxy only becomes active now. Think of it as switching the machine on after wiring it up.
Step 4: browse through the proxy
Visiting [redacted] causes Apache to forward the request to the server named in ajp.conf over AJP. [redacted] is the address a computer uses to refer to itself, also called localhost, so typing it in the browser means "talk to the Apache server running on my own machine". Apache then re-says the request in AJP to the remote host, and hands the answer back.
The article states that it did exactly that.

The response was a VOS3000 VoIP instance, reached through the local proxy. The screenshot shows the VOS3000 (VoIP) instance as it appeared through the proxy. The researcher had not known what VOS3000 was beforehand and looked it up, learning it was a VoIP service. VoIP means voice over IP: telephone calls carried over the internet instead of traditional phone lines. VOS3000 is a VoIP service.
At that moment he felt the rush of having access to something he should not have had access to.
Step 5: fingerprint the Tomcat version
With the application reachable, the next check was which Apache Tomcat version was running. Knowing the exact version matters because old versions have publicly known weaknesses, so the version number tells you what to look up next.

The banner read Apache Tomcat/5.5.15, as the screenshot shows. That is an outdated release with numerous known vulnerabilities. A banner, in this sense, is the version string a service announces about itself, like a shop sign stating which model of lock it uses.
Step 6: look at the authentication flow
The researcher also examined how the VOS3000 service handled the flow of its system. Its invalid-authentication redirection is done in JavaScript. JavaScript is the programming language that runs inside your browser to make pages interactive. A redirect is simply the browser being told to go to another page, here the login screen.
Because the redirect is done in JavaScript, the page loads before the redirect to the login screen happens, so content that should not be visible was rendered first. That is how material the researcher was not allowed to see became visible. A comparison: a receptionist who hands you the whole file and only then says "sorry, you are not on the list, please wait outside". You have already read the file.
At that point the testing stopped and the issue was reported, specifically to avoid forfeiting the bounty by breaking the program's policy. Bug bounty programs have rules about how far you may go, and going further than the rules allow can cost you the reward.
Why it worked
The AJP connector on port 8009 was open. Because AJP exposes the same application functionality as the HTTP connector, anyone who can speak the protocol, or route through something that does, reaches the application directly. The local Apache proxy is only a convenience for turning AJP into ordinary HTTP in the browser; it does not add any access that the exposed port did not already grant. It is a translator, not a key.
On top of that, the application's authentication enforcement was client-side: the invalid-authentication redirect is performed in JavaScript, so the page is delivered and rendered before the redirect to the login screen runs. A client that does not execute or honour that redirect sees the underlying content. The report does not describe any server-side check that would have prevented this.
What the impact was
The researcher, without authenticating, reached the internal VoIP service (VOS3000) behind the AJP connector and saw content that should not have been visible, because the redirect to the login screen happens in JavaScript after the page loads. The exposed Tomcat version, 5.5.15, is outdated and has numerous vulnerabilities. The report does not quantify how many hosts or users were affected, and the MySQL port on the same host was not reachable because of its IP whitelist.
How to fix it
The report does not describe the fix that was applied.
Things to try on your own targets
- Scan in-scope sub-domains with
nmap -sVand look forajp13on 8009, or other Tomcat default ports (8005, 8080). A positive result is an AJP service banner on a host that should not expose it. - Point a local Apache
ProxyPassat the AJP port and browse[redacted]. A positive result is an application page rendered through the proxy without any login. - Check the Tomcat version banner. A positive result is an old release such as 5.5.x with published vulnerabilities.
- Load protected pages with JavaScript disabled or intercept the response before the redirect runs. A positive result is content that should require authentication appearing in the response body.
Timeline
| Date | Event |
|---|---|
| 11/12/2018 | Discovered and reported the bug |
| 11/12/2018 | Bug triaged |
| 13/12/2018 | Bug resolved and bounty rewarded |
Lessons learned
- Reconnaissance matters in every aspect of bug hunting, not only port scanning, so do not ignore it.
- If something looks suspicious, dig deeper.
Glossary
- Bug bounty program: a scheme where a company invites people to find weaknesses in its systems and pays for the ones they report.
- Scope: the list of systems a program allows you to test.
- Wildcard: the
*symbol meaning "anything here", so*.example.comcovers every sub-domain. - Sub-domain: a smaller address under a main domain, such as
preview.example.comunderexample.com. - Sublist3r: a tool that gathers sub-domain names from public sources.
- Port: a numbered door on a computer through which a particular service answers.
- Port scan: knocking on many ports in turn to see which are open and what answers.
- nmap: a port scanner;
-sVmakes it also identify service versions. - Filtered port: a port where traffic is silently dropped, usually by a firewall, so the scanner cannot tell what is behind it.
- Firewall: software or hardware that decides which network traffic is allowed through.
- MySQL: a database server; here it was open on port 3306 but refused connections.
- IP whitelist: a list of addresses allowed in, with everyone else refused.
- Apache Tomcat: software that runs Java web applications.
- AJP (Apache JServ Protocol): a binary protocol Tomcat uses to talk to a front-end web server; it exposes the same application functionality as HTTP.
- Connector: the part of Tomcat that listens on a port and speaks a particular protocol.
- HTTP: the ordinary language of the web that browsers speak.
- H.323: a family of protocols used for internet telephony.
- VoIP: voice over IP, telephone calls carried over the internet.
- VOS3000: a VoIP softswitch, the software that routes internet calls.
- Softswitch: software that routes telephone calls in a VoIP network.
- Proxy: a middleman that takes your request and asks the real server on your behalf.
- Forward proxy: a proxy that will fetch any site on the internet for anyone who asks.
- mod-jk: an Apache module that lets Apache forward requests to Tomcat over AJP.
- proxy_ajp: the Apache module that handles AJP proxying.
- Configuration file: a plain text file of settings a program reads when it starts.
- localhost / [redacted]: the address a computer uses to refer to itself.
- ProxyPass / ProxyPassReverse: Apache settings that map a local path onto a remote endpoint and rewrite redirects back to the local proxy.
- systemctl: the tool that manages background services on Linux.
- Banner: the version string a service announces about itself.
- JavaScript: the programming language that runs inside the browser to make pages interactive.
- Redirect: the browser being told to go to another page.
- Client-side: done in the browser rather than on the server.
- Server-side: done on the server, where the user cannot bypass it.
- Information disclosure: a weakness where information that should be protected becomes visible.
- Unauthenticated: without logging in.
- Reconnaissance: the information-gathering phase before testing, such as finding sub-domains and open ports.
- Triaged: reviewed and confirmed as a valid issue by the program.