Beyond Risky Sign-Ins: Behavioural Analysis for AiTM Attack Detection

Social engineering attacks are at an all-time high, amplified by the accessibility of phishing toolkits and open-source Artificial Intelligence (AI) offerings. This is reflected in the fact that 98% of cyberattacks leverage social engineering techniques to exploit the human element to achieve their end objectives.[1]
What began as Business Email Compromise (BEC), campaigns that facilitated financial fraud, has since evolved considerably. The same techniques have been repurposed to target online identity itself. Threat actors seize authenticated access and operate undetected within an environment indefinitely, obtaining sensitive business data with the objectives of extortion and reputational damage. Adversary-in-the-Middle (AiTM) and various “Fix” techniques — often facilitated through sophisticated phishing kits such as Tycoon 2FA — are central to this shift, weaponised specifically for their ability to harvest session tokens and bypass Multi-Factor Authentication (MFA), turning a single credential into persistent, trusted access.
What makes these attacks especially dangerous is not just the initial compromise – it is what comes after. A single phishing email, once successful, can hand an adversary a master key to the modern enterprise. From that foothold, attackers have been observed silently consenting to malicious OAuth applications for persistent access, pivoting to SharePoint and Azure Blob Storage for data staging and exfiltration, spinning up cloud virtual machines for cryptocurrency mining at the victim’s expense, and exploiting unpatched vulnerabilities within the environment to escalate privileges and move laterally. What begins as one employee clicking one link can rapidly cascade into an enterprise-wide compromise.
Detection of post-compromise activity has become increasingly difficult. Threat actors operating on valid credentials and authenticated sessions generate activity that is indistinguishable from legitimate user behaviour at the log level. In our incident response experience, this has led us to model adversarial behaviour less as external intrusion and more as a compromised colleague or rogue insider — an actor operating with a fully authenticated identity and behaving consistently with the user they have impersonated.
Whilst Microsoft’s native detections have matured, our SecOps experience indicates they do not consistently surface this class of post-compromise behaviour in time. This blog shares our approach to modernising detection strategies by leveraging Microsoft’s detection mechanism and our lessons learnt to effectively identify and mitigate against these evolving threats in the early stages of the attack. Together, we can outsmart cybercriminals and protect our users more effectively.
Heart of the Problem
Email security gateways often suffer from limited detection capabilities, making them vulnerable to sophisticated evasion tactics. Traditional email gateways frequently fall short in identifying advanced and emerging threats, enabling threat actors to exploit legitimate inboxes to facilitate their phishing attacks.
This is further challenged by threat actors weaponizing trusted third-party platforms, such as job hunting platforms, or professional networking platforms, to execute indirect phishing attacks whereby credentials are stolen outside the perimeter defences. AiTM attacks and phishing kits (e.g., Tycoon 2FA) commonly leverage these email platforms, further concealing their infrastructure behind Content Delivery Networks (CDNs) like Cloudflare. Not to mention threat actors increasingly use dynamic, short-lived infrastructure – such as constantly rotating IPs, domains, and servers; reinforcing the need for defenders to move beyond simply detecting for static indicators to contextual behavioural analysis.
Imagine a scenario – 1000+ emails flooding a single inbox in a short timeframe. The chances of encountering numerous false positives are high and tedious to analysis one-by-one; leaving the handful of malicious emails undetected by outdated filtering mechanisms and content checks.
Our Approach

This scenario is a tactic we observed in the early stages of several BEC cases we handled last year. Pattern identified, our team studied these cases to determine how we could build or finetune detection rules to block these attacks before threat actors intrude.
Our innovative approach focuses on continuously monitoring user behaviour and building a baseline of what normal looks like for each user. This tailored profile enabled us to move beyond “Risky Sign-ins” to distinguishing anomalous (and potentially malicious) behaviours from normal user activity.
The idea is straightforward – we collect data points to flag out sustained activities that deviate from what a user normally does. Instead of single events, we look for patterns; an old iPhone that suddenly accesses the account behind commercial virtual private network, a strange login from a virtual private server using web access, …
Given enough data points, we are able to spot threat actors deeper into their attack – no matter how good they are at bypassing perimeter defences; we are defending the phished.
Detecting Anomalous Activity

To showcase our approach, we will use the example of analysing login activities to identify any abnormal behaviours, such as our beloved ‘impossible travel’ scenarios. By assessing geolocation, login frequency, and cross-referencing these datapoints against the users’ historical activities, we can categorise the behaviours into High, Medium, or Low risk levels.

In the simplified example above, we can infer that there are two (2) trusted user devices; their work laptop (MacOS) and their iPhone. We can further take note of their standard User-Agents and geolocation. These data points make up the user’s unique profile. These data points enable us to track patterns and gain a baseline of what ‘normal user behaviour’ looks like; thus, making it easier to identify anomalies.
By analysing how users typically interact with the environment and detecting deviations from established behavior baselines, we can uncover threats that may evade traditional signature‑ or rule‑based controls. This layered approach reflects our practical incident response experience and enables more contextual, accurate, and timely threat detection.
However, a factor worth considering in the development of this detection rule is the normalcy of remote and/or travelling workers, as well as the widespread use of personal Virtual Private Networks (VPNs). Relying solely on the aforementioned single indicators could lead to unreliable assessments and trigger false positives – emphasising the need for a more detailed, contextual approach to user activity pattern analysis.

Conclusion
The limitations of our security measures are only bound by our imagination. As attack campaigns continue to evolve and grow in sophistication, it’s imperative that we think outside the box and consider innovative approaches beyond merely hardening existing systems. Instead of solely focusing on traditional defences, we should explore proactive and adaptive strategies that anticipate potential threats. This calls for a commitment to continuous improvement and a willingness to embrace new ideas and technologies.
By fostering a culture of innovation in email security, we can better equip ourselves to confront the dynamic landscape of cyber threats and safeguard our users effectively. The future of email security lies not just in defence but in reimagining how we protect our digital footprint.
Recommendations
In addition to strengthening detection capabilities, enhancing your response mechanisms is equally vital. For instance, leveraging Microsoft 365’s conditional access policies can significantly improve your organisation’s security posture. Here are several recommendations to consider:
- Token Revocation: Instantly revoke user tokens or enforce password resets for identified high-risk users or suspicious sign-in sessions to mitigate potential threats.
- Re-authentication Requirements: Implement policies that require users to re-authenticate frequently, especially during sensitive transactions or when accessing critical applications.
- Risk-Based Access Control: Set up conditions that block user access from known malicious geolocations, helping to prevent unauthorized access stemming from compromised accounts.
- Adaptive Risk Policies: Adopt adaptive policies that analyse user behaviour and dynamically adjust access rights based on real-time risk assessments.
- Continuous Monitoring: Establish continuous monitoring practices to detect anomalies quickly and respond proactively before any potential breaches occur.
Further Information
We are committed to protecting our clients and the wider community against the latest threats through our dedicated research and the integrated efforts of our red team, blue team, incident response, and threat intelligence capabilities. Feel free to contact us at [darklab dot cti at hk dot pwc dot com] for any further information.












































































































































































































