The cyber kill chain: Moving laterally in Active Directory
Every company is susceptible to a data breach.
Given the number of endpoints an organisation usually has and how often employees are manipulated by social engineering and malware-laden emails, attackers can easily gain an initial foothold in a company's network.
This can happen even if a company performs extensive risk assessments and utilises perimeter protection devices like firewalls.
Perimeter protection has proven to be necessary, but not entirely sufficient for defence.
How else can we explain some of the biggest data breaches that large corporations have had to face?
More often than not, cybercriminals get into a network using malware.
They will then usually start compiling a list of target domain controllers with credential information, or database servers that hold valuable data assets.
In due course, they will develop an attack map that details a clear path of burrowing deeper.
Using different techniques, they will move laterally through the network, gaining more and more privileged access until they gain entry to their target domain controllers.
This lateral movement is the part of the cyber kill chain in which attackers are most vulnerable and exposed.
At this phase, they are actively trying to jump from one machine to another.
So how do cybercriminals move laterally through a network?
What exactly do they do after getting in?
And what can companies do to stop them in their tracks?
The anatomy of an attack
There are numerous ways an attacker can move through a network, and it's important to understand how this is generally done.
While the tools used to carry out an attack may be different, the steps are usually the same. Understanding how an attack progresses and getting into the criminal's mind will help companies better defend themselves.
Another key thing to remember is that companies can use the same tools hackers use to perform penetration tests.
After gaining an initial foothold, the first thing an attacker might do is a network scan.
A network scan will show them the list of active hosts on the network along with their IP addresses.
They can then use a technique called port scanning to send messages to each port on a machine one by one.
If they receive a response, the attacker will assume the port is in use and may decide to probe it further for vulnerabilities.
A port scan will also help the attacker figure out what services run on what machines.
Using this information, they may decide to exploit the known vulnerabilities of those services.
The next thing the attacker may do is attempt to figure out the logical and physical structure of the company's Active Directory (AD).
One of the simplest ways to do this is by using PowerShell, a tool that is provided by Microsoft itself. PowerShell is a task-based, command-line scripting language built on .NET that lets admins manage computers using cmdlets (pronounced "command lets").
Since PowerShell is trusted by the Windows environment, actions carried out using PowerShell scripting usually don't raise any alarms.
Using the right cmdlets, a threat actor can look at group memberships, observe service accounts, find out password policies, and identify important servers like domain controllers.
PowerShell also has the flexibility to work in remote desktop connections, which further complicates the problem.
Attackers may use tools like PowerSploit to make their attacks more sophisticated.
After all this investigating, the attacker will know exactly what machines to target to begin moving laterally.
Attackers also use tools like BloodHound that use graph theory to reveal hidden and often unintended relationships within AD environments.
BloodHound displays probable attack paths in its graph drawing area.
BloodHound, co-founder Andy Robbins says "An attacker would be interested in effective privileges for other users. BloodHound gives this information about every user in the domain. What local admin rights and group memberships does a particular user have?"
The tool is simple enough for the script novice yet suave enough for the more serious operator.
If the attacker gains access to a system where a user is a local admin and there are active sessions in that system, they can steal the credentials of those active sessions.
To steal credentials, attackers use popular tools like Mimikatz, which is used to perform pass-the-hash and pass-the-ticket attacks.
Using these techniques, they can move from one computer to the next and ultimately gain domain administrator privileges.
How can companies defend themselves against lateral movement?
Real-time event log correlation and augmented threat intelligence systems are critical to prevent attackers from moving laterally through a network.
These tools can process nearly 25,000 logs per second and detect attacks in real time.
These tools alert security professionals the moment certain risky conditions are detected.
For example, if there is an unusually high number of logon failures from a particular user, membership to an important organisational unit or privileged group changes, or GPOs or GPO links are modified, security professionals would instantly receive an alert, as these could be tell-tale signs of an attacker attempting to escalate privileges.
Another aspect that plays a critical role in defending against lateral movement is user behaviour analytics, or UEBA. UEBA tools apply machine learning to create a baseline of normal activities that are specific to each user and notify security personnel when there is a deviation from this norm.
For example, a user who consistently accesses a critical server outside of business hours won't trigger an alert for this activity, because that behaviour is typical for that user.
If they try to access that server during a time they've never accessed it before—even if it falls within business hours—this activity will be considered unusual and will raise an alert.
Apart from using the right tools, companies must educate users about the importance of security hygiene.
Conducting regular red team-blue team exercises is an important part of penetration testing and will allow security teams to get familiar with using some of the above tools.
And all of this needs to be a coordinated effort under the authority of a central risk team, who, in turn, works under the guidance of a chief risk officer.