Home  /  Blog  /  Anatomy of an Attack Chain: From Anonymous FTP to Domain Adm

● Red Team

Anatomy of an Attack Chain: From Anonymous FTP to Domain Admin

No zero-day. No malware. On this engagement we started with nothing, an IP range and a scope document, and ended as Domain Admin. The path was six small misconfigurations, each harmless on its own, chained into a full domain compromise. This is the walkthrough, link by link, the way a penetration tester actually moves, with the fix that would have broken the chain at every step.

Published 15 November 2026 14 min read Codesecure Offensive Security Red Team

Key Takeaways

  • A full domain compromise rarely comes from one big hole. It comes from a chain of small, boring misconfigurations, each of which looks acceptable in isolation.
  • This chain used six links: anonymous FTP, a leaked username, a reused password, a world-writable scheduled task, cached domain credentials, and a Kerberoastable service account with DCSync rights.
  • Breaking any single link stops the whole chain. That is the good news: you do not have to be perfect, you have to break the path.
  • Every step in this story is detectable. Password spraying, a modified scheduled-task binary, LSASS access, Kerberoast requests and DCSync all leave signals a SIEM can catch.
  • A penetration test finds the chain before an attacker does. A vulnerability scanner would have flagged maybe two of these six items, and none of the way they connect.

Starting From Nothing

Every good attack-chain story starts the way a real attacker starts: with almost nothing. On this internal engagement we were given an IP range, a start date and a scope document. No credentials, no inside knowledge, no assumed breach. The goal was the one every red team engagement comes down to: show how far an attacker who gets a toehold on the network can actually go.

The environment looked healthy from a distance. Patching was reasonable, there was antivirus on the endpoints, and the obvious external services were locked down. That is the point of this story. The compromise did not come from a missing patch or a famous CVE. It came from six ordinary misconfigurations that nobody had ever looked at together. Here is how they connected.

Link 1: An Anonymous FTP Server Nobody Remembered

Enumeration is where pentests are won. A full port sweep across the range turned up the usual web and file services, and one quiet outlier: an FTP server on an old utility host, still accepting anonymous login. It was almost certainly set up years ago for a one-off file transfer and never turned off.

Anonymous FTP by itself is often dismissed as low risk, "there is nothing sensitive on it". But an attacker does not read the share for secrets, they read it for context. In this case the share held a handful of old operational files, including a backup of a batch script. We were not interested in the script's logic. We were interested in one line near the top.

  • nmap -sV -p- 10.0.0.0/24 to find every service, not just the common ports. The FTP server was on a non-standard host that a quick scan would have skipped.
  • ftp 10.0.0.37, log in as anonymous with any email, and mget * to pull everything down for offline review.
  • Read every file for usernames, hostnames, paths and service names, the breadcrumbs that feed the next step. Loot is rarely the password; it is the context.

Want to Know Your Real Attack Chain?

Codesecure runs red team and internal penetration tests that start where a real attacker starts: an unauthenticated foothold, and chain the misconfigurations until something breaks. You get the full attack path, mapped to MITRE ATT&CK, with the exact fixes that break each link. ISO/IEC 27001:2022 certified delivery, named OSCP, CEH and CISSP consultants, across India, Singapore, UAE and Malaysia.

See Red Team and VAPT Services →

Link 2: A Filename and a Script Leak a Username

The backup script was scheduled to run as a service account, and whoever wrote it had helpfully left a comment: the account name it was meant to run under, something like svc-backup, and the hostname of the internal server it copied files to. One comment, two priceless facts: a valid username, and a target.

This is the quiet pivot that scanners never make. A tool sees "anonymous FTP enabled" and "a text file". A human sees a username that almost certainly exists in Active Directory, because service accounts nearly always do, and a specific host to point it at. We now had something to attack, and someone to attack it as.

Link 3: A Reused, Weak Password Gets Us In

With a likely-valid username, the next question is the password. We did not brute force, which is noisy and locks accounts. We did something quieter and far more effective: a careful, slow password spray, trying a small number of common and seasonal passwords across the one account, staying under the lockout threshold.

The service account's password was a weak, guessable one that had clearly been set once and never rotated, the kind of password a human picks for "just a service account". It worked. Those credentials let us authenticate to the internal server named in the script and land our first interactive foothold: a low-privilege session on a Windows member server. We were in, but as nobody important. Yet.

  • Validate the username first with a tool like kerbrute so you only spray accounts that exist, which keeps the noise and lockout risk down.
  • Spray a handful of likely passwords across the single account, well under the lockout policy, rather than many passwords against one account.
  • Service accounts are the softest target: their passwords are often weak, rarely rotated, and frequently reused across systems.

Link 4: A World-Writable Scheduled Task to Local Admin

A low-privilege shell is a starting point, not a win. The next job is local privilege escalation: become an administrator on this machine. We ran standard local enumeration (manually and with a tool like WinPEAS) and asked the questions privesc always asks: what runs automatically, and can I tamper with it?

The answer was a scheduled task that ran a maintenance script every few minutes, as SYSTEM, from a directory that the Users group could write to. That is the whole vulnerability: a high-privilege task executing a file that a low-privilege user can replace. We replaced the script's contents with our own, waited for the task to fire, and it ran our code as SYSTEM. We were now local administrator on the server.

  • Enumerate scheduled tasks, services and their binary paths, and check the file and folder permissions on each: icacls on the target path reveals who can write to it.
  • A privileged process (SYSTEM, local admin) running a file that a normal user can modify is a direct escalation. The same pattern applies to unquoted service paths and weak service permissions.
  • WinPEAS, PowerUp and manual checks all surface this class of issue; it is one of the most common Windows local privesc findings.

Not Sure Where Your Chain Starts?

Most compromises begin with something small: an anonymous share, a reused password, a writable script. On a free 30-minute call our lead will map the most likely first links in your environment and how we would test them.

Book a Free Scoping Call →

Link 5: Local Admin Hands Us a Domain User's Credentials

Local administrator on one server is still not domain compromise. But local admin gives you memory, and memory holds credentials. A domain administrator, or any privileged domain user, who had logged into this server left credential material behind in the LSASS process and the local secrets.

With SYSTEM rights we harvested that material (the technique the tooling is known for, dumping LSASS and the local secrets, is standard post-exploitation). Among the cached credentials was a domain account, more privileged than our service account and, crucially, a member of a group we would come to care about. We had crossed from "local admin on one box" to "a real domain user's credentials". This is the lateral-movement pivot that turns a single-machine compromise into a domain problem.

Link 6: Kerberoasting and DCSync to Domain Admin

Now we enumerated the domain itself. BloodHound maps who can do what to whom, and it turned the final steps from guesswork into a shortest-path problem. Two things stood out. First, several service accounts had a Service Principal Name set, which makes them Kerberoastable: any domain user can request a service ticket for them and crack it offline. Second, the account we had stolen in Link 5 had been granted replication rights on the domain, the permission that enables DCSync.

We requested the Kerberoast tickets, cracked the weakest service account's password offline, and found it was over-privileged. Then, using the replication rights, we performed a DCSync: asked a domain controller to replicate account secrets to us, including the hash of krbtgt and the Domain Admin accounts. At that point it was over. With those hashes we could authenticate as any user in the domain. Six small mistakes, and we were Domain Admin.

  • Kerberoasting: GetUserSPNs (impacket) or Rubeus to request service tickets, then crack offline with hashcat. Only weak service-account passwords fall, which is exactly why Link 3's lesson matters again here.
  • DCSync: with replication rights (DS-Replication-Get-Changes), secretsdump pulls account hashes straight from a domain controller, no code run on the DC required.
  • BloodHound turns a pile of permissions into an attack path, which is why defenders should run it too, to see the same shortest paths and cut them.

The Whole Chain, in One Breath

Stand back and look at the path. Not one of these was a critical, screaming vulnerability. Each was a configuration choice that, reviewed on its own, might have been waved through. The compromise lived in the connections:

  • 1. Anonymous FTP gave us files.
  • 2. A script comment gave us a username and a target.
  • 3. A reused weak password gave us a foothold.
  • 4. A writable scheduled task gave us local admin.
  • 5. Cached domain credentials gave us a real domain user.
  • 6. Kerberoasting plus DCSync rights gave us the domain.

Every Step Was Detectable

The second lesson is for the blue team. An attacker moving through this chain is noisy if anyone is listening. The password spray in Link 3 generates a burst of failed logons across a short window. The scheduled-task tampering in Link 4 changes a file on disk and spawns an unusual child process as SYSTEM. The credential theft in Link 5 means a non-system process reading LSASS. The Kerberoasting in Link 6 shows up as a spike in service-ticket requests, and the DCSync is a replication request from a host that is not a domain controller, which should never happen.

A SIEM such as Wazuh, fed with domain controller and endpoint telemetry, can alert on every one of those. Detection does not assume you will stop the first mistake; it assumes the chain exists and tries to catch the attacker somewhere along it. A penetration test shows you the path; monitoring catches someone walking it. You want both.

Why a Scanner Would Have Missed This

A vulnerability scanner is a list-maker. Pointed at this network it might have flagged "anonymous FTP enabled" and perhaps "weak service-account password policy", and scored them low or medium. It would not have read the script comment, guessed the password reuse, noticed the writable task folder, understood the cached credentials, or mapped the DCSync rights. Above all, it would never have connected them, because connecting them requires an attacker's judgement, not a signature.

That is the difference between a scan and a penetration test, and between a penetration test and a red team. A test walks the chain the way a human adversary would, finds the path that actually leads to Domain Admin, and hands it to you with the single cheapest fix at each link. That is how you spend a limited security budget where it changes the outcome, rather than closing a hundred findings that lead nowhere.

SHARE

Frequently Asked Questions

What is an attack chain in penetration testing?

An attack chain is the sequence of steps an attacker links together to get from an initial, low-value foothold to a high-value goal such as Domain Admin. Each step exploits a separate weakness, and the output of one becomes the input to the next: a leaked username enables a password guess, which enables a foothold, which enables privilege escalation, and so on. The danger is not any single weakness but the way they connect, which is exactly what a real penetration test is designed to find.

How does a penetration tester get from a normal user to Domain Admin?

Usually through a chain, not a single exploit. A common path is: gain a low-privilege foothold (phishing, a weak password, an exposed service), escalate to local administrator on that machine (a writable service or scheduled task, an unquoted path), steal credentials from memory, move laterally using those credentials, then abuse Active Directory weaknesses such as Kerberoastable service accounts or excessive replication (DCSync) rights to reach Domain Admin. Breaking any link in that chain stops the escalation.

Is anonymous FTP really a security risk?

Yes, and it is routinely underestimated. Even if the share holds nothing obviously secret, attackers read it for context: usernames, hostnames, internal paths and service-account names hidden in scripts, configs and backups. That context is what makes the next step, such as a password spray against a valid account, possible. In the chain above, an anonymous FTP server was the first link that led all the way to Domain Admin. Disable anonymous access and inventory forgotten services.

What are Kerberoasting and DCSync?

Kerberoasting is an attack where any authenticated domain user requests a Kerberos service ticket for an account that has a Service Principal Name, then cracks that ticket offline to recover the account's password. It works when service-account passwords are weak. DCSync is a technique where an account with directory replication rights asks a domain controller to hand over account password hashes, including privileged accounts, without running code on the controller. Both are standard Active Directory attacks and both are detectable with the right monitoring.

How do we stop attack chains like this?

Break the links. Disable unneeded services like anonymous FTP, keep credentials and account names out of files, use unique strong passwords and group managed service accounts, fix permissions so no privileged task or service runs a user-writable file, enforce administrative tiering so privileged accounts never log into lower-tier machines, enable Credential Guard, remove unnecessary SPNs and replication rights, and monitor for spraying, LSASS access, Kerberoasting and DCSync. You do not need to fix everything; breaking any single link stops the chain.

Can Codesecure run a red team or internal penetration test for us?

Yes. Codesecure runs manual internal penetration tests and red team engagements that start from an unauthenticated position and chain real misconfigurations the way an attacker does, across Active Directory, cloud, network, web and mobile. You get the full attack path mapped to MITRE ATT&CK, the single cheapest fix at each link, and a retest. ISO/IEC 27001:2022 certified delivery with named OSCP, CEH and CISSP consultants across India, Singapore, UAE and Malaysia.

CS

Codesecure Offensive Security

OSCP / CEH / CISSP Certified Penetration Testers

Codesecure Solutions is ISO/IEC 27001:2022 certified and runs manual red team engagements and penetration tests across Active Directory, cloud (AWS and Azure), network, web and mobile, for businesses across India, Singapore, UAE and Malaysia. Named OSCP, CEH and CISSP consultants. We chain real misconfigurations the way an attacker does, then hand you the attack path and the fixes that break it.

✓ ISO/IEC 27001:2022 Certified

What Does Your Attack Chain Look Like?

Codesecure starts where an attacker starts and chains the misconfigurations until something breaks, then hands you the full path and the cheapest fix at every link. Internal pentest and red team by named OSCP, CEH and CISSP consultants, ISO/IEC 27001:2022 certified delivery across India, Singapore, UAE and Malaysia.