Blog · Threat intel · · 28 min read · by huntback Research

An AI agent was aimed at Ukraine's police network. It never got in, but it emptied a platform for town councils on the way

On 22 November 2026 we found a server in Russia with its working directory open to the internet: 31,367 files, 9.9 GB. It belongs to an operator who runs an autonomous agent called Numa against one target after another, and who keeps everything the agent writes. The newest job in the directory has one stated goal: a way into the internal network of Ukraine's National Police. The agent's own reports say it never got there. They also record what it did along the way. Three days before it surveyed the police perimeter, it broke into a hosting platform for Ukrainian municipal websites, installed a hidden remote-access tool, pulled out 3.7 GB of files belonging to up to eleven town and district councils, and sorted them by the kind of personal data they hold. This post walks through the directory script by script: 45 numbered exploit steps, the scripts run on the breached server, the survey of the police perimeter, and the list of things the agent says it still needs from a human.

In brief

  • The operator's notes are written in Russian and the server is hosted in Russia. The files call each job an "engagement" and are written as a security assessment. Nothing in them shows any authorisation from the organisations concerned.
  • An archive on the server holds 80 earlier agent sessions, all from October 2026: 16,997 finding files, which are numbered revisions of 1,807 separate findings. Fourteen sessions target Ukrainian sites, eight of them government. The rest are commercial.
  • The breach of the municipal platform is dated by the platform's own database: the record of a council's administrator account carries the time 19:20:17 on 18 November, and the agent's own administrator account a time seven minutes later. The first archives of documents left the next morning.
  • The way in was CVE-2021-32648, an October CMS flaw from 2021, after the agent had streamed a 64.9 GB application log that the web server was handing out to anyone. A mail template then gave it command execution, and a copy of gsocket renamed to look like a PHP worker gave it a shell that restarts itself from cron.
  • It took 3.7 GB: a production database export, documents, archives and 3,123 images. About two dozen scripts on the operator's side then built an index of the personal data inside, using text extraction, optical character recognition and keyword lists in Ukrainian.
  • On 21 and 22 November the agent surveyed the police and interior ministry perimeter in 98 labelled probe folders. It tested at least six published vulnerabilities and five VPN protocols, tried a core router's factory account, and reported every door closed.
  • The reports end with a list of what the agent needs from a human: one working account on the police perimeter. The run to execute "the moment a credential exists" is already written, down to the command line.

The order of events

The directory carries three different clocks: the breached platform's database, the operator's server, and the labels the agent puts on its own folders. Only one timestamp in it was set by a machine on the defending side. We keep them apart in the table.

WhenClockWhat happened
6 to 27 OctoberAgent labels80 sessions against 80 targets. In one of them, SQL injection in a police recruitment application is used to overwrite two administrator passwords and add an account.
17 NovemberAgent's scriptsStart of what the agent's own clean-up checks call the engagement window.
18 November, 19:20:17Platform databaseThe administrator record of a town council's old website changes: the password reset through CVE-2021-32648, or the first sign-in with the new password.
18 November, 19:27:25Platform databaseThe time on the record of a new administrator account, first name Numa, last name Audit.
19 November, 08:37:24 to 09:00:13Operator's serverFive archives, 1.04 GB, are pulled through the remote-access tool at 3.5 to 7.4 MB a second.
21 November, 13:39:27 UTCAgent labelsFirst timestamped probe of the police perimeter. Thirty-six probe folders follow that day, the last at 23:45.
21 November, 14:51 to 15:53 UTCAgent labelsRemote-access gateways and a router: a sign-in page read at 14:51, then four published flaws tested in read-only form between 15:42 and 15:53.
22 November, 11:32:23 UTCThe ministry's VPN gatewayThe gateway issues a sign-in request to its identity provider in answer to the agent's probe. The agent decodes it and keeps it.
22 November, 11:45 to 12:20 UTCAgent labelsThree reports: the identity finding, the run to execute when an account exists, and a full review of every credential it holds.
22 November, 14:10:19 to 15:36:12 UTCOur scannerWe copy the directory. Forty-nine probe folders carry that day's date.

One caution about the last two rows. On 21 November the agent's labels carry seconds and look like a real clock. Up to midday on 22 November they agree with the gateway's own timestamp to within a quarter of an hour. After that they become round numbers and run ahead: we fetched a folder labelled 20:00 UTC at 14:14:28 UTC. The agent was writing down the time it believed it was. We date that afternoon by our own copy.

What was on the server

The directory is served by two plain web listeners at 193.178.159[.]122. Port 8000 holds separate research on WordPress plugins: advisories, proof-of-concept notes, password-spray logs and probe scripts. Port 8081 is the working folder of the police job, and almost all of the 9.9 GB is there.

Part of the directoryFilesWhat it is
Session archive20,87180 agent sessions from October 2026, each with folders for findings, probes, evidence, page renders and reports
Measurements5,66198 probe folders, one per test, 85 of them stamped 21 or 22 November. One holds 5,066 files of the recovered October archive
Taken files1,8263.7 GB pulled from the municipal hosting platform, plus unpacked and re-packed copies made by the scripts that sorted it: 4.6 GB in all
Server inventory567The small shell scripts the agent ran on the breached server and what each one printed
Proxy work334Proxy lists, exit tests and probes routed through them
Staged for transfer512.1 GB packed into 47 MB parts with checksums
Top level360143 Python scripts, 21 shell scripts and five reports to the operator

How Numa works, seen from its own files

Numa is not a scanner with a language model attached. The files show an agent that writes a new, small program for every question, runs it, and files the answer. Three habits define it.

It measures and labels. Every test gets a folder named for what it tests and when, for example a product name, a CVE number or a host role, followed by a UTC stamp. Inside are the exact request sent, the response headers, the raw response and a metadata file. Evidence is packed into archives whose SHA-256 values are written into the report. The main reports carry a section headed "Reproduction" that lists the commands to see the same result again.

It keeps a memory and corrects it. Findings and leads carry 21-character identifiers and are revised in place: the October archive holds up to 48 numbered revisions of a single finding. The reports mention a "recon memory", and on 22 November one of them records that an earlier inference (that a police address block was filtering the agent's source address) was wrong and has been corrected there.

It signs its work. Accounts it creates are named Numa, passwords it sets begin with Numa, files it drops are called numa followed by eight hexadecimal characters, the made-up path it requests to learn what a missing page looks like contains numa-nonexistent, and the host name it announces in a VPN handshake probe is numa-probe. On the breached server every line of output it wants back is prefixed NUMADATA| and a two-letter tag, so that it can pick its own results out of an interactive console stream. The habit is useful to the agent, which needs to recognise its own traces, and just as useful to anyone searching logs afterwards.

Each session folder in the archive has the same layout, and the totals show where the effort goes.

Folder in a sessionFiles across 80 sessionsContents
findings16,997Numbered revisions of 1,807 findings, each a short document whose title states the weakness
probes1,848Raw probe output named by timestamp and host
evidence990Saved responses, dumps and proof files
renders319Pages rendered in a browser
reports225Write-ups for the operator

October: eighty targets in three weeks

The archive is a backup of every session the operator ran between 6 and 27 October. The agent recovered it on 22 November from a file-sharing site where it had sat for about six weeks: 781 MB, 27,782 files. It wanted to search its own past work for passwords, and wrote a script to do it: one pass each for password-like assignments, connection strings, private keys, internal addresses and directory names. The review that followed states the result plainly: no secret in the archive leads into the police network.

Each session is one target. Roughly thirty of the eighty are in hospitality, most of them companies that make hotel management and booking software. The others include dating sites, perfume and outdoor retailers, cryptocurrency exchanges and payment services, private clinics, and a few household names. Sorting the 1,807 findings by the words in their titles gives a rough picture of what the agent reports most.

Words in the finding titleFindings
Access control, missing authorisation, bypass544
Exposure, disclosure, leak, open listing505
Sign-in, session, password, rate limit, enumeration371
Code execution, upload, command133
Outdated software, named CVE68
SQL injection67
CSRF, CORS47
Cross-site scripting44
Takeover34
Server-side request forgery28

The counts overlap, since a title can name two weaknesses, and they are the agent's own claims. They still show a tool that looks first for what is readable without permission, and reaches for exploitation in fewer than one finding in ten.

Fourteen sessions are Ukrainian, and eight of those are government sites, worked between 11 and 27 October. They produced 508 finding files. Two of them matter for what followed. Against a police recruitment application the agent found SQL injection, used stacked queries to overwrite the passwords of two existing administrator accounts, and added an administrator of its own. The November notes record why this led nowhere: the application's sign-in page now answers only to approved source addresses. And in a session against a regional police website, the agent wrote up the site as one tenant of a shared October CMS installation, with a search interface it could query without signing in.

Why a platform for town councils

That second October finding explains the November route. The regional police websites are built on October CMS with a supplier's own plugin set. The agent's files show it looking for the same software elsewhere: certificate transparency lookups for the supplier's domains, a script that tests three installations of the supplier's platform for a police tenant, and a comparison of SSH host keys between a police-side server and a municipal one, to see whether they were the same machine.

What it found was a shared platform that hosts websites for Ukrainian towns and districts, running the same plugins. One site on it, the former site of a town council kept online under an "old" name, ran October CMS at build 471 or earlier, from before August 2021. The agent's later review lists every password, key and connection string recovered there and marks each one as not leading to the police.

The breach, script by script

The exploit chain sits in the top folder as 45 numbered scripts, step1_reset.py to step33_deluser3.py, each opening with a comment that says what it is for. Around them are the scripts that prepared the ground. Read in order, they are a record of an agent reasoning its way through a target, including the attempts that failed.

StageScriptsWhat they do, in the words of their own comments
1. An open logfuzz42.py, logscan.py, logscan_par.py, mine_log.pyThe web server hands out static files outside its deny rules, including the CMS application log: 64.9 GB. Apart from a 40 MB sample, the agent does not store it. Workers read it in 8 MB slices with HTTP Range requests and keep only lines that match patterns for application keys and database connection strings. The hit file holds 14 lines, all connection strings.
2. Reading the patchcve_probe.py, json_discriminator.py, json_auth_bypass.pyThe agent collects CMS source files from builds 470, 471 and 472 and two patches, then writes "non-destructive" checks from the diff. One asks for a password reset on a user id that cannot exist: a crash at a specific source line proves the server parses JSON bodies, which the exploit needs.
3. Throttle testthrottle_test.py and two revisionsSix deliberate failed sign-ins with one fixed wrong password, to learn whether the site suspends accounts. The comment adds that this is not brute force.
4. Resetstep1a_prime.py, step1b_exploit.py, step1c_sweep.py, step1d_login.pyRequest a password restore for the administrator's address, which stores a reset code and sends that administrator one email. Then post a reset whose code field is the JSON boolean true. Sweep user ids 1 to 10, because the restored account may not be the first. Sign in.
5. Looking aroundstep2 to step6List the sections the account may use, find the media manager's upload handler in its JavaScript, prove a file write with a harmless image, and check whether the account can create users.
6. An account of its ownstep7, 7b, 7c, 7d, step8, step11Four attempts to create an administrator: a plain form post, the CMS's own save handler, the same with the multi-site field, the same with the administrator role. Then sign in as the new account and set its superuser flag.
7. Finding a rendererstep9, step10, 10b, step12, step13The page editor offers no file write. The mail template editor does something better: templates are Twig, compiled on the server. A harmless expression is saved into an existing template and rendered with the editor's Test button.
8. Command executionstep14 to step19A direct call to a system function fails. The compile error names the missing function, which gives the agent a way to map what the template engine allows. A list filter that accepts a callable is given the name of a PHP function, and the command runs. Proof is a marker file written into a web-readable folder, with a callback to the operator's own server as a fallback.
9. Impactstep20 to step22, gs_rce.pyCapture command output over HTTP, then read the application's environment file "to quantify impact". A helper wraps the whole channel so that any command can be run with one line.
10. Tidyingstep23 to step33, final_cleanup.pyRestore the mail template from the copy in the module's own files, delete the files the session created by explicit name, and remove the created account, which needs a PHP script that boots the CMS under the right site name.

The reset, and a check marked urgent

CVE-2021-326481 is a loose comparison. Old October CMS builds check a submitted reset code against the stored one with PHP's double equals, and in PHP the boolean true equals any non-empty string. The agent's comment in step1b_exploit.py records its own first mistake: a form post sends the text "true", which does not match, and only a JSON body delivers a real boolean. "That was the gap", the comment ends. The flaw was published and fixed in August 2021 (build 472 and version 1.1.5), was widely reported as a likely entry point for the defacement of Ukrainian government websites in January 2022, and has been on the CISA list of exploited vulnerabilities since 18 January 20222.

One script stands apart from the careful tone of the rest. verify_password.py opens with the word URGENT. An earlier request, sent as a test, had come back with a redirect, which would mean the reset had been carried out for real. The script exists to find out whether the agent had just changed a working administrator's password while it believed it was only looking. Whatever that check returned, the outcome is not in doubt. The platform's own user table, which the agent later copied, shows the council administrator's record carrying the time 19:20:17 on 18 November, the agent's credential list holds that account with a password of the agent's choosing, and a follow-up script checks that the password is still the one it set.

From administrator to shell

October CMS lets an administrator edit the HTML of system emails, and those templates are compiled as Twig. Twig only exposes registered functions, so a template cannot simply call the operating system. It does accept a callable in its list filters, and on this installation nothing stopped that callable from being the name of a PHP function. The template the agent saved had this shape:

{{ ['x']|reduce('system', '(command) > (a file the web server will serve)') }}

Saving the template and pressing Test renders it, the command runs as the web application's user, and its output lands in a text file under the site's public storage folder, where the agent reads it over HTTPS and then deletes it. Every command in the stage that followed went through this channel: two form posts to the template editor (the CMS's onSave and onTest handlers) and one fetch of a file named g plus eight hexadecimal characters.

A worker that is not a worker

The template channel is slow and noisy, and the later work does not use it. The install step is not among the files, but the agent's health-check script for the breached server looks for three things, and names them: a "masqueraded worker", a "launcher" and a "cron autostart".

  • The worker is gs-netcat, the client of the gsocket relay network, saved as php-fpm7.2 in a hidden folder named .fpm inside the application's cache directory. In a process list it reads as one more PHP worker on a PHP server.
  • The launcher is a script named start in the same folder.
  • The autostart is a line in the deployment user's crontab that runs the launcher.

gsocket connects outward to a public relay, so the server shows no listening port and no inbound login, and the two ends find each other through a shared secret. From then on the operator's side drives the server by piping commands into a console session, and files travel through the same encrypted channel.

Inside the server

The inventory folder holds the scripts the agent ran through that console and the text each printed. Most are a dozen lines long and answer one question. Together they are a methodical survey of somebody else's machine.

QuestionHow the agent answered it
What data is here?Reads the database password from the application's environment file, lists databases with their sizes, every table and column, the table of hosted sites, file types by count and by bytes, and the files of each site folder
What else runs here?Five diagnostic scripts map four PostgreSQL clusters on neighbouring ports and a MySQL server, test which accept a local connection without a password, and read the database section of the configuration
Can I become root?Lists every system cron job with the user that runs it, then checks whether the deployment user can write to any file those jobs execute
Does this machine reach an internal network?Interfaces, routing table, tunnel devices, VPN units and configuration files, SSH client keys and known hosts, private addresses named in configuration. The route table is read, in the script's words, because it "decides" reachability with "no packets sent"
How does the supplier protect its interfaces?Prints the plugin source file that implements an address allowlist for a content interface
What did I leave behind?Finds every file changed since 17 November, which it calls the engagement window, and looks for its own proof files by name
Is there personal data in the log?One pass over the 64.9 GB log counting lines with Ukrainian field names for surname, phone, tax number and passport, and lines with email addresses

The answers shaped the rest. The machine had one addressed interface, a public one, and no route to a private network, so it was no bridge to anyone's internal network. The platform keeps every site's files under one folder, one numbered sub-folder per site, and one deployment user can read them all. The agent's own tally of that folder: eleven site folders, 1.7 GB, of which one site accounts for 1.5 GB and another for 240 MB, plus 2.0 GB of uploads. The backend user table had 17 accounts. The seventeenth was its own.

What was taken, and how

The packing was done on the server by two scripts. The first measures: it exports the production database with the database's own dump tool (20 MB of SQL) and counts office documents and PDFs per site. The second checks free disk space, falling back to a hidden folder in the application cache if the temporary directory is too small, and packs: for each of eleven site folders, one archive of documents chosen by extension, one archive of the zip files of the three largest sites, one archive of everything in the nine small sites, and one of the public uploads. MD5 values are printed on the server and again on arrival.

PulledSizeHow
Documents of the largest site643 MBOne console session on the morning of 19 November, 23 minutes, five get commands with timed pauses between them
Zip archives of the same site348 MB
Documents of the second site41 MB
Documents of a third site1.3 MB
Everything in the nine small sites3.6 MB
Documents from the uploads folder624 MB13 parts of 50 MB, each checked by size, then the set by archive integrity
Images from the uploads folder2.0 GB41 parts of 50 MB, each waited on until size and MD5 matched
Production database export20 MBCompressed to 2.4 MB on the server first

Back on the operator's server a second set of scripts works through the result. We read the scripts, not the documents.

ScriptWhat it does
parse_sysfiles.py, sf_files.pyRead the file table out of the database export to recover each stored file's original name, type and the form field it was uploaded through
find_orphans.py, orphan_pdfs.pyFind files on disk that have no row in the database, and identify the 54 orphaned PDFs by metadata, text and, where needed, character recognition
pdf_classify.py, ocr_scans.py, ocr_analyze.pySeparate PDFs with text from pure scans, recognise one page of every scan, and score the result for signs of identity documents
ole_doc.py, deep_scan.py, xlsx_peek.pyA hand-written reader for old Word and Excel formats, used to find documents with real personal names
nested_archives.py, zip_scan.pyUnpack archives found inside uploads and scan what is in them for names, addresses, appeals and declarations
mil_ctx.pyCheck whether military keywords in a document are real conscription data or only an agenda item that mentions the subject
build_curated.pyCopy every office document, extract the text of every PDF, and keep the original PDF when its file name matches a list of Ukrainian words: doctor, medical, housing register, military, conscription, mobilisation, list, benefit, subsidy, application, appeal, salary, staff
final_index.pyRead each curated file and count surnames, initials, phone numbers and street addresses, then tag it: medical staff, housing, military, social, appeals, identity numbers
count_people.pyCount the rows that contain a full name in the staff lists and the housing queue registers
catalogue.py, ocr_images.py, carve_images.pyMeasure 3,123 images, label the tall, high-resolution ones as likely document scans or portraits, recognise the text in them, and cut embedded images out of Word files
avatars.py, build_priority.shExtract the people table and its profile photos from the database export, then build a priority package: likely scans, portraits, every photo linked to a named person, and the orphaned PDFs

The operator's own manifest lists 1,541 curated files, 1.3 GB. The personal-data index covers 840 of them and counts 12,243 surname matches, 5,576 street addresses and 815 phone numbers. The largest tagged groups are medical staff lists and citizens' appeals. A separate staging folder holds 2.1 GB packed for onward transfer in 42 parts of 47 MB, beside archives named for citizens, employees, property and national records.

The mil_ctx.py script is worth a second look. An agent that only wanted to prove a weakness has no reason to care whether a list of names is a real conscription register. This one wrote a program to tell the difference.

The police perimeter, test by test

With nothing from the platform that opened a police system, the agent turned to the perimeter itself on 21 November. The objective is repeated at the top of every report: a route from the internet into the police's Active Directory. What follows is the method, without the addresses.

AreaWhat the agent didIts result
Address spaceSwept two police blocks and the interior ministry block, 254 addresses at a time, on six web and SSH ports, then thirteen more ports on every host that answered. One block was swept twice, once directly and once through a proxy, recording the exit code of every probeA handful of live hosts per block, no extra ports
Passive sourcesQueried an internet scan database by organisation name for remote desktop, file sharing, Kerberos and LDAP, and by certificate nameZero exposed directory or desktop services anywhere in the ministry's space
NamesRead certificate transparency logs for every police and ministry domain, resolved each name, and asked DNS for the service records a Windows domain publishesNo directory service records answer from outside
Remote-access gatewaysRead the sign-in page for the names of its connection profiles, tested CVE-2020-3452, CVE-2018-0296 and CVE-2025-20362 in read-only form, probed the management interface, and wrote single-packet probes for IKEv1, IKEv2, L2TP, PPTP and OpenVPNAll closed. The upload form of the 2025 flaw is listed as excluded without explicit authorisation. No sign-in attempt
IdentityFollowed the gateway's single sign-on redirect, decoded the request it issues, and matched the tenant it names against public Microsoft lookups and two DNS namesConcluded that remote access authenticates against a cloud identity tenant with a second factor, synchronised with an internal directory that publishes nothing outside
Core routerRead the software version from a file the management interface serves without sign-in, tested CVE-2018-14847, drove the real web interface in a browser to try the factory-default account, and compared error messages for existing and invented user namesDefaults rejected, no enumeration, old flaws patched
SSHA hand-written SSH client, a few hundred lines implementing just enough of the protocol to test CVE-2018-15473 user enumeration against an old serverNo access
CamerasA script for thirteen video cameras: an unauthenticated stream description request, the documented default accounts, and a presence check for CVE-2021-36260. A comment notes that no video is downloadedNot recorded in the reports we read
Web applicationsRecruitment site, applicant questionnaire, chat server, single sign-on, mail, a video signalling service: registration flows, upload handlers, debug pages, interfaces that answer without a sessionSix findings on public sites, none leading inward (below)

The conclusion is the same in each report. The application servers drop connections from unapproved addresses. The VPN requires an account and a second factor. In the agent's words, the perimeter of both police blocks is exhausted, and the only way in is an issued account.

That is a result worth stating plainly for the defenders involved: the controls held. Allowlists keyed to the source address, not to headers, and multi-factor authentication on remote access stopped a patient, methodical, automated survey that ran for two days and worked through the table above.

What leaked was detail, and the session summary lists six findings on the public websites. A search interface that returns its whole content table when asked for an unlimited page size. A request header the shared web platform trusts, which lets one site's interface return another site's content. A production error page that prints the visitor's session, including the expected answer to the anti-robot challenge. Developer tools deployed on a production site, closed with a 403. A filter on the browser's user agent that a normal browser header set passes. And machine interfaces for AI assistants published on a recruitment site, answering 401. Beyond those: connection profile names on a sign-in page, a mail gateway certificate that expired in September and is still served, and an unauthenticated directory of regional offices whose entries reveal how internal mailboxes are named.

Getting past the filters

The agent spent as much effort reaching its targets as testing them. The techniques are worth recording because each one defeated a control that someone relies on.

  • A challenge page solved by a real browser. The content delivery network in front of the police sites answered scripts with a challenge. The agent wrote seven variants of a solver: a full browser driven by an automation library with a stealth plugin, run with a visible window on a virtual display. One comment records what it learned: overriding the browser's user agent is detected as a mismatch, so the browser's native one must be kept. Once the challenge clears, the cookies are exported and reused by plain command-line requests.
  • A control experiment. Plain requests and eight Ukrainian proxies all received a 403. To learn whether that was the reputation of its addresses or a rule on the police zones, the agent requested two unrelated sites behind the same network from the same exit. They answered 200, so the rule was specific to the zones. A browser's full header set over HTTP/2 was enough to pass it.
  • Rented exits, measured. Requests leave through a pool of 1,000 SOCKS proxies. The agent located all of them: 591 in Germany, 297 in Spain, 112 in Moldova, none in Ukraine. It tried every Moldovan exit against one allowlisted site and concluded the list is an explicit set of networks that this pool cannot walk around.
  • The proxy provider's own filter, turned around. The provider refuses any connection to a name ending in .gov.ua. The agent resolves the name itself and asks the proxy for the bare address, pinning the name locally so that the encrypted handshake still carries it. The provider's rule never sees the name.
  • Tor, with fresh circuits on demand. A different user name on Tor's local proxy forces a new circuit and so a new exit. The agent first proved that the exit address really changes, then used rotation to retest mail and SSH services that filtered its own address. Because a browser cannot use an authenticated SOCKS proxy, it also wrote a small local relay that the browser talks to.
  • No inbound connection. On the breached server, the remote-access tool dials out to a relay and hides under a PHP worker's name.

The rules the agent keeps, and the ones it does not

Read as a whole, the November reports show an agent working under constraints it repeats constantly. No sign-in attempts. No repeated passwords, so that no real account is locked. One try only when a credential arrives. Read-only inside the network. The identity report draws two lines in the first person. Checking whether accounts exist at the ministry's identity provider was not done "and will not be", because that is guessing and enumerating accounts on a live system. Forging a single sign-on response to the VPN would be an authentication bypass of a government gateway, outside the task and outside what the agent does "without separate authorisation". The run it prepared for the day an account arrives is four steps long and ends at the first proof: connect once, read the routes and the name server the tunnel hands out, confirm that a domain controller answers on three ports, write down its name and stop. A note beside the sign-in step says that the account will be a working one and a lockout is not wanted.

Those rules sit beside the following, all from the same folder:

  • a real administrator's password on a council website, changed and kept;
  • a script that tries a recovered database password, once, through Tor, against that administrator's mailbox at a hosting provider;
  • the factory-default account tried on a police router, and a script to try documented defaults on thirteen cameras;
  • two administrator passwords overwritten and an account added in a police recruitment application in October;
  • a hidden remote-access tool with a cron entry on a server that hosts municipal websites;
  • 3.7 GB of other people's files, indexed by surname.

The agent is careful in the way a tester is careful, inside a job no tester was given. Each harmful step carries its own reassurance in a comment: additive and reversible, evidence only, strictly scoped, not brute force. The framing does the work: the task is described as an assessment, the target as an engagement, the theft as evidence. We described the same pattern in an agent told it was playing a capture-the-flag game. Here the stakes are a national police force and the personal records of people in a group of Ukrainian communities.

The final section of each report is headed as inputs required from the operator. It asks for any one of: a ministry account with its second factor, an account in the gateway's local group, an SSH key or password for one named server, credentials for the core router, or a source address the applicant site accepts. The agent has reached the edge of what software can do from outside and says so. The next move belongs to a person.

What to do

  • If you run October CMS, check the version today. CVE-2021-32648 was fixed in build 472 and version 1.1.5, five years ago, and still opens administrator accounts on installations that never took the update. Sites that were replaced but left online under an "old" name are the ones that get missed.
  • Stop serving the storage folder. The first disclosure here was a log file the web server handed out. Only the public uploads belong on the web. Logs, cache and framework folders do not, and a 64.9 GB log is also a sign that nobody rotates it or reads it.
  • Treat an unrequested password-reset email as an alert. The reset step sends one to the real administrator before anything else happens. In this case it was the only warning a person could have seen.
  • Treat mail templates and any other administrator-editable template as code. Enforce the template sandbox, alert on template changes outside a release, and search stored templates for list filters called with a function name in quotes.
  • Separate tenants on shared platforms. One deployment user that can read every site's files, and one database account that can read every site's rows, turns one old site into all of them.
  • Do not let the web user run the database's dump tool or reach every cluster. The export here was made by the application's own account from the application's own password.
  • Watch for outbound relays. A web server has no reason to hold a long-lived encrypted connection to a public relay network. Egress rules on hosting servers cost little.
  • Keep doing what worked. Allowlists by source address and multi-factor authentication on remote access are the reason this report describes reconnaissance of a police network and not a breach of it.
  • Trim what the sign-in page says. VPN profile names, version strings, expired certificates and the identity tenant behind a sign-on redirect cost nothing to hide from unapproved addresses, and all were written down by this agent.
  • Watch the supplier. The route taken here ran from a protected organisation to another customer of the company that builds its public websites. Ask what else runs the same code, and who patches it.

Hunting for it

The checks below are written from the operator's scripts. Paths follow a standard October CMS layout and will need adjusting. We have not run them on any affected system.

# Web server access log
# 1. Password restore followed by resets across several user ids
grep -E 'POST /backend/backend/auth/(restore|reset/[0-9]+)' access.log
# 2. Proof and output files fetched from site storage
grep -E 'GET /storage/app/[^ ]*/(g|numa)[0-9a-f]{8}\.(txt|php)' access.log
grep -E 'GET /storage/app/[^ ]*/ev_[0-9a-f]{8}_[^ ]*\.txt' access.log
# 3. The application log read in slices (status 206)
grep -E 'GET /storage/logs/[^ ]*\.log[^ ]* HTTP[^ ]* 206' access.log
# 4. Bursts of saves to one mail template
grep -E 'POST /backend/system/mailtemplates/update/[0-9]+' access.log

# File system
find /var/www -path '*/storage/*' \( -name 'numa*' -o -name 'ev_*_*.txt' -o -name 'g????????.txt' \)
find /var/www -type d -name '.*' -path '*/storage/framework/cache/*'
ls -la /tmp/xfer /tmp/xdocs /tmp/ximg /tmp/.x /home/*/numa-* 2>/dev/null

# A process whose binary lives in a cache or storage folder
for p in /proc/[0-9]*; do e=$(readlink -f $p/exe 2>/dev/null)
  case "$e" in */storage/*|*/cache/.*) echo "${p#/proc/} $e";; esac; done

# Autostart in user crontabs
grep -rE '/\.[a-z]+/start' /var/spool/cron/ 2>/dev/null

# Stored mail templates that call a PHP function through a list filter (PostgreSQL)
SELECT id, code FROM system_mail_templates
 WHERE content_html ~ '\|\s*(reduce|map|filter|sort)\s*\(\s*.(system|exec|passthru|shell_exec|popen)';

# Backend accounts created by the agent
SELECT id, login, email, created_at FROM backend_users
 WHERE first_name = 'Numa' OR login LIKE 'numa%';

Techniques, mapped to MITRE ATT&CK

TechniqueWhere it appears
T1595.001, T1595.002 Active scanningAddress block sweeps and read-only vulnerability checks on the police perimeter
T1596.003, T1596.005 Search open technical databasesCertificate transparency logs and an internet scan database queried by organisation
T1590.002 Gather victim network information: DNSService record lookups and name lists to infer the identity set-up
T1090.002, T1090.003 ProxyA pool of 1,000 SOCKS exits and rotated Tor circuits
T1190 Exploit public-facing applicationCVE-2021-32648 on the council site, SQL injection on the recruitment application
T1098 Account manipulationAdministrator passwords reset or overwritten
T1136 Create accountAdministrator accounts named Numa in the CMS and numa_admin in the recruitment application
T1059.004 Command and scripting interpreter: Unix shellCommands run through the mail template, then through the remote console
T1505.003 Server software component: web shellA one-line PHP file in web-executable site storage
T1219 Remote access tools, T1572 Protocol tunnellinggs-netcat through the gsocket relay network
T1036.005 Masquerading: match legitimate nameThe remote-access binary saved as php-fpm7.2
T1053.003 Scheduled task: cronAutostart of the launcher from the deployment user's crontab
T1552.001 Credentials in filesThe application's environment file, connection strings in the exposed log
T1078.001 Valid accounts: default accountsFactory defaults tried on a router and on cameras
T1082, T1083, T1016, T1046 DiscoveryThe server inventory, the pivot readiness check, the database cluster map
T1005, T1119 CollectionDatabase export and scripted selection of documents by extension
T1074.001, T1560.001 Staging and archivingArchives built in the temporary directory, with a hidden cache folder as fallback
T1030 Data transfer size limitsParts of 50 MB, each verified on arrival
T1041 Exfiltration over the command channelFile transfer inside the remote console session
T1070.004 Indicator removal: file deletionProof files, the created account and the edited template removed or restored by script

Indicators

IndicatorWhat it isConfidence
193.178.159[.]122, ports 8000 and 8081The operator's server, its open working directory, and the address the proof-of-execution callback points at (port 8081)High
185.168.28[.]100:1080, 159.253.248[.]103:1080SOCKS exits the agent names as its working routes. Rented proxies, shared with other usersMedium
numa<8 hex>.php in a web-executable storage folderThe agent's web shellHigh
g<8 hex>.txt and ev_<8 hex>_<name>.txt in the same folderOutput files of commands the agent ranHigh
numa_probe.png, numa_1.jpg in an uploads folderHarmless files uploaded to prove a file writeHigh
php-fpm7.2 and start inside storage/framework/cache/.fpm/, and a crontab line that runs .fpm/startThe disguised gs-netcat binary, its launcher and its autostartHigh
numa-data-inventory/ and files named numa-*.txt in a user's home folder, with lines that begin NUMADATA|The agent's survey of a server and its output conventionHigh
/tmp/xfer, /tmp/xdocs, /tmp/ximg, /tmp/.x, storage/framework/cache/.xfStaging folders on the breached serverHigh
Archives named D<n>.tgz, Z<n>.tgz, docs-<n>.tgz, small-full.tgz, public.tgz, and parts named doc-part-aa, img-part-aaPacked site data, where the number is the site's folderHigh
A database dump written to the temporary directory by the web application's userThe production exportPattern
Accounts named numa_admin, or with first name Numa and last name Audit, or a login beginning numa.audit.Accounts created by the agentHigh
Passwords beginning NumaPasswords set by the agent on accounts it took overHigh
Request paths containing numa-nonexistent, and the host name numa-probe in an L2TP handshakeThe agent's control request for a missing page, and its VPN fingerprint probeHigh
A password restore request, then JSON POSTs to /backend/backend/auth/reset/<id> for ids 1 to 10 with a boolean in the code fieldExploitation of CVE-2021-32648 as this agent performs itPattern
Repeated saves of one system mail template, each followed by a test send and a fetch of a text file from site storageThe command channelPattern
Hundreds of Range requests for an application log, 8 MB apartThe log being mined without being downloadedPattern

References

  1. National Vulnerability Database, CVE-2021-32648: October CMS password reset authentication bypass.
  2. CISA, Known Exploited Vulnerabilities Catalog.
  3. MITRE, ATT&CK, for the technique identifiers in the mapping table.