Блеск и нищета пентеста в режиме Red Team
Блеск и нищета пентеста в режиме Red Team
Качественное обеспечение ИБ становится все более актуальным для бизнеса. Сейчас одним из российских трендов в сфере ИБ является Red Teaming. Данная тематика активно обсуждается, и компании начали проявлять к Red Team практический интерес. Но все ли понимают сущность этого термина? Давайте разберемся, что такое Red Teaming и чем он отличается от пентестинга.
Проблема с терминологией
Для того чтобы все разложить по полочкам, необходимо разобраться в терминологии. Изначально понятие Red Team возникло в американской армии: так называли условную атакующую команду (защищавшуюся команду именовали Blue Team). Соответствующую активность в сфере ИБ принято называть Red Teaming (редтиминг).
При этом в России даже с базовыми понятиями и принципами обеспечения ИБ до сих пор царит неразбериха. Далеко не все знают, что такое pentest (пентест), каковы его цели и когда его стоит проводить. Ну а Red Team вообще кажется магией. Справедливости ради отметим, что неразбериха в терминологии отмечается и за рубежом – пентестом называют и Red Teaming, и vulnerability assessment. Эти термины, действительно, в чем-то пересекаются, но все же являются разными.
Кроме того, в каждой стране – своя специфика реализации ИБ-проектов. При одинаковом скоупе за границей пентест в среднем продолжается неделю-две, а в России – около месяца. При этом больший срок позволяет более качественно и глубоко проанализировать объект, а потому в ходе таких работ у нас чаще находят новые уязвимости (zero day, т.е. уязвимости, для которых нет патчей от производителя).
На основе опыта реализации многих десятков проектов у нас сложилось свое понимание ключевых терминов. Мы подразумеваем под пентестом процесс тестирования на проникновение, в ходе которого пентестеры за определенный срок находят в конкретной системе (или группе систем) максимальное количество уязвимостей, пытаются их подтвердить (выявить уязвимости без импакта и false-positive) и, если возможно, проникнуть максимально глубоко (каждый этап проникновения согласуется). А Red Teaming – это максимально глубокое и незаметное проникновение пентестеров за определенный срок в конкретную систему (цель предварительно оговаривается) с использованием разнообразных методов (тоже оговариваются).
Чего хочет заказчик?
В часто встречающемся описании Red Teaming говорится, что команда red изображает потенциального злоумышленника, и многие именно это считают главным отличием Red Teaming от пентестинга. Однако в процессе пентестинга исполнители также имитируют атакующего. Впрочем, проблема состоит даже не в этом.
У некоторых заказчиков сложилось неверное представление о Red Teaming как о максимально точном подражании злоумышленникам. И они нередко просят нас действовать абсолютно так же, как «плохие парни», т.е. взломать их систему, показать, что добрались до ERP, АБС или ДБО, и отправить в подтверждение, например, платежку. Разумеется, все должно происходить максимально незаметно, а заказчики будут нам мешать всеми доступными способами. Никакой вводной информации не дается.
Да-да, многие компании хотят проверять свои системы на устойчивость к вторжению именно реальных злоумышленников. И их вполне можно понять, ведь основная цель – обеспечение защиты вовсе не от пентестеров. К тому же это так захватывающе – наблюдать за «настоящими» взломами и проникновениями! Рискуем разочаровать: в подавляющем большинстве случаев заказчики рассчитывают на такой эффект лишь по неопытности.
Правда ли заказчик этого хочет?
Пробежимся по нескольким проблемным моментам, которые могут проявится в ходе выполнения проекта Red Teaming.
Легальность. Одним из ключевых условий реализации проекта является осведомленность о нем только топ-менеджеров и ИБ-руководителей. Заказчик должен увидеть, как осуществляются мониторинг и реагирование в «реальных» условиях, а не в тех, в которых сотрудники знают о работах и бдительно мониторят все и вся круглые сутки.
Чаще всего Red Teaming проводят крупные компании. А значит, ресурсов, через которые можно проникнуть в систему, у них достаточно много. Как понять скоуп работ, если пентестеру его не дают или его нельзя точно проверить? Компании могут принадлежать, например, несколько сетей в Интернете (автономная сеть), которые удастся согласовать, но что-то может бы передано в субаренду или принадлежать дочерней организации. А когда пентестер взламывает какой-нибудь сервер и распространяет атаку на другие хосты, то проверить, находятся ли они в скоупе, уже невозможно. И очень легко вылететь за границы дозволенного, взломав больше, чем нужно.
Аналогично может получиться с социальной инженерией и почтовой рассылкой. Пентестер выполняет рассылку по утвержденному заказчиком перечню адресов, вкладывая в сообщения троянское ПО, но поведение пользователей не всегда оказывается предсказуемым. Кто-то, например, запустит троян не с корпоративного, а с домашнего компьютера, переслав на него письмо. А если какое-то подразделение выявит взлом, то оно может и полицию вызвать, не обговорив свои действия с руководством. Все это может привести к проблемам и лишнему шуму.
Работоспособность. Пентестеры используют разные техники взлома и ПО. Одной из важных задач при проведении пентеста является максимальное снижение вероятности того, что будет нарушена работоспособность систем заказчика. Однако некоторой вероятности такого нарушения не избежать, поскольку сейчас используются очень сложные системы, и просчитать абсолютно все вариации попросту невозможно.
Пентестеры стараются согласовывать потенциально опасные действия с заказчиком и проводить их под присмотром ИТ-отдела, чтобы при необходимости быстро восстановить систему. Однако это не срабатывает в том случае, когда пентестер изображает «реального» злоумышленника. Еще раз напомним, что, взломав какой-то хост и куда-то попав через него, пентестер зачастую плохо представляет, в какой конкретно системе «роется». Значит, упасть (и порой надолго) может нечто критически важное.
Проблемы с людьми. Простой пример: вы получили по электронной почте письмо, прочитали его и лишь через некоторое время узнали, что посторонний проник на ваш ПК, отследил ваши действия и взломал несколько серверов компании. Может, это – даже не ваша вина, и причина состоит в отсутствии необходимых обновлений, устанавливаемых ИТ-отделом, но все же приятного мало. Социальная инженерия порой приносит болезненные для сотрудников последствия, а в ситуации с «реальным» злоумышленником контролировать рассылки пентестера непросто. В итоге это может повлиять на отношение сотрудников к их предприятию.
Другой пример – физическое проникновение. Подделать пропуск сотрудника легко, но как поведет себя охрана, выявив факт проникновения в здание постороннего с «левым» удостоверением? Опять вызовет полицию?
Итак, потенциальных рисков при реализации схемы «реальных» злоумышленников достаточно много. И предусмотреть их все практически невозможно из-за сложности систем и смешения как технических, так и организационно-административных моментов. Но давайте взглянем, так ли велик профит от таких работ?
Изображая злоумышленника, пентестер остается пентестером. Он использует часть технических методов и идейных подходов из арсенала истинных нарушителей, но остается специалистом с соответствующей мотивацией. А злоумышленник мотивирован выгодой, и ему все равно, из какого источника ее получать, лишь бы не попасться. Вероятность того, что он проникнет в банк через главный вход, чтобы украсть деньги из АБС/АРМ КБР, очень мала. Легче действовать через Интернет и «ломать» не конкретный банк, а первый попавшийся «на удочку». Кроме того, пентестер не будет задорого покупать специальные эксплойты под zero days уязвимости под продукты тестируемого предприятия, приобретать на черном рынке «доступы» (взломанные ПК с трояном) в крупные компании или подкупать сотрудников. А злоумышленник, коль возникнет необходимость, все это делать будет. Наконец, пентестера вы нанимаете на ограниченный срок, а злоумышленник временными рамками не ограничен.
Итак, «реальные» злоумышленники-имитаторы компаниям не нужны.
Что действительно нужно?
Большая часть наших пентестов показывает, что уровень защищенности внутри компаний – очень низкий. Не соблюдаются даже базовые принципы ИБ, и нередко «доверенная зона» корпоративной сети состоит из тысяч хостов. Так что же действительно нужно заказчикам?
В большинстве случаев – пентестинг. Специалисты анализируют любую систему (сайт, приложение, корпоративную сеть, Wi-Fi, СКУД и пр.) в течение ограниченного срока, выискивая максимум уязвимостей и неправильных конфигураций. В результате заказчик получает перечень уязвимостей и понимание того, что следует улучшить. В отличие от Red Teaming, рассматривается не один вектор (несколько критичных уязвимостей, связанных между собой для достижения необходимой цели), а множество. Понимая, что подкупить или обмануть сотрудника достаточно просто, можно провести пентест с наличием прав пользователя и проверить, насколько многослойна защита внутри предприятия.
Если в компании уже имеется многослойная защита, простроена большая часть ИБ-процессов и, главное, создана система мониторинга и реагирования, то имеет смысл проводить Red Teaming. В упрощенном виде задача сводится к проверке системы мониторинга: насколько быстро и точно компания может выявить действия злоумышленника, все ли существенные события атаки она отслеживает, какой и насколько оперативной является реакция ее ИБ-специалистов? Схема действий – примерно следующая. Команда Red Team различными способами скрытно анализирует систему компании, а blue team мониторит все что можно. Результаты сверяют: что найдено Red Team и что из этого обнаружено blue team. Затем blue team предлагает варианты противодействия, а Red Team пытается их обойти и добиться тех же результатов.
Максимизировать для компании КПД пентеста можно за счет предоставления пентестерам права доступа, информационной помощи и плотного взаимодействия с ними. Так удастся выявить максимум уязвимостей и потенциально слабых мест системы, устранить проблемы и не допустить их появления в будущем. То же самое относится к Red Teaming. И чем больше выявлено «дыр» в мониторинге и бессмысленных действий при реагировании, чем больше их исправлено, тем больше возможностей появляется для противодействия злоумышленникам уже на ранних этапах.
Red Teaming
Anticipate attackers’ movements to stay one step ahead
The problems are real
Unprepared
for reality
Security teams may understand how to defend against threat actors in theory but are unprepared to do so in practice.
Incomplete security controls
A company may often consider penetration testing sufficient and do not hire red teams for security testing.
Attackers
never sleep
Threat actors don’t work on a schedule and aim to launch unexpected attacks when the company is most vulnerable.
Unfamiliar
territory
A lack of knowledge of the cyber threat landscape and modern attacker TTPs will cripple blue teams.
How Red Teaming can help
Red team attacks offer the most realistic opportunity to test how a company can defend against security incidents.
The red team process teaches your team how to anticipate the movements of threat actors.
Attack simulations are effective in exposing deep gaps in organizations’ infrastructure.
The red teaming results allow security teams to work out problematic issues in key elements of the organization.
Red Teaming stages
Initial stage
- Create a working group
- Define the scope of work
- Sign cooperation protocols
- Form the Red Team
Target Intelligence
- Perform extensive reconnaissance
- Develop initial scenarios involving potential attacks
Engagement
- Conduct covert attacks on identified critical functions
- Develop alternative ways of achieving the objective
Final stage
- Assess how Blue Team responds to cyberthreats
- Draft a report with the actions taken and conclusions
- Analyze results and plan improvements
Why customers choose Group-IB
Team of certified experts
Team of qualified experts who have 10+ years of experience auditing various infrastructures and international certifications in the field of information security (OSCP, OSWP, CEH, and others).
Harmony of technology and human intelligence
The strong synergy between experts from Group-IB’s DFIR Lab, CERT-GIB, and proprietary Threat Intelligence & Attribution mean that our solutions are continuously enriched with up-to-date information about attacker TTPs.
Full-spectrum reporting
Reports contain an executive summary with an overview of the main threats as well as recommendations for businesses, detailed descriptions of vulnerabilities, and specific recommendations for technical specialists.
Full-scale inspection
Our full cycle of checks allow for a comprehensive assessment of the infrastructure, as evidenced by the more than 800 successfully conducted complex audit requests.
What Group-IB delivers
In-depth testing of multiple scenarios over a period of several months
Comprehensive reporting on the red team’s methods and attack vectors, with a list of compromised assets
Detailed recommendations on how to secure your company
Workshop with the blue team to review the red teaming scenarios and results
Using Machine Learning for Red Team Vs Blue Team Wargames
Deep in the DNA of threat detection firm Endgame is the twin concept of stealth and offense. This is contrary to the usual view of information security that often portrays itself as visible and defensive. Endgame, however, believes that defenders need to accept the methods of the modern adversary (the stealthy attack), and adapt as required.
That adversary looks for signs of defense and then alters its behavior to avoid or negate the defense. Examples include all of the malware that looks for signs of virtualization and then either tries to avoid sandboxes or simply cuts and runs to avoid analysis. Another example is Caspar, which would examine Windows 10’s AntiVirusProduct WMI Class to see what anti-malware products are registered; and would then take steps to bypass or avoid that anti-malware. Endgame suggests that only with defensive stealth can you prevent the adversary from recognizing and avoiding detection by hiding in similar security control blind-spots.
The offensive nature of Endgame is more common. Defenders should accept that traditional security defenses will not prevent targeted, stealthy, advanced attacks — and should therefor actively look for, or hunt out, subtle indicators of compromise on their networks. The purpose is to minimize the adversaries’ dwell time, or time-to-detection — which according to FireEye’s Mandiant currently stands at 146 days. The way to find them is through big data anomaly detection, which is a hugely labor-intensive task. In fact, it realistically best achieved by using machine learning (ML) techniques to allow the computer itself to detect and correlate those anomalies.
In short, threat detection should involve ML capabilities actively but stealthily hunting the adversary. But stealth itself is a process rather than a feature. The attacker doesn’t just attack, he also continuously reconnoiters and probes the defense looking for weaknesses. To beat the attacker, the defender needs to find its own weaknesses, and close them, before the attacker can find and use them. The problem is how to achieve this.
At the BSides Las Vegas gathering this week, Endgame’s principal data scientist Hyrum Anderson proposed a new approach in a presentation titled ‘Deep Adversarial Architectures for Detecting (and Generating!) Maliciousness‘ — or, as it could be subtitled, ‘Physician, heal thyself!’.
The concept is simple, although the mathematics is not. If ML can train your computer to detect subtle advanced threats then you can equally use ML to test and probe your own defense. Anderson describes the development and use of an ML Red Team designed to attack the ML Blue Team that is your in-house threat detection system.
In his presentation, Anderson explained how you can «use deep learning against itself in a red-team Vs blue-team adversarial game, by which both models improve The Red Team learns to generate maliciousness, and the Blue Team learns to differentiate malicious from benign events.»
It involves teaching the Red Team to understand how adversaries operate. With that understanding, the Red Team attacks the Blue Team. If any attack succeeds, then lessons learned are built into the Blue Team’s defensive algorithms, and a loophole or blind-spot is closed. Where attacks fail, lessons learned are built into the Red Team’s algorithms; and the process starts again.
Anderson describes it as a ‘non-cooperative game theoretic framework.’
«Through a series of rounds, the Red Team model generates malicious samples intended to find blind spots in the Blue Team detector model. In turn, the Blue Team detector model learns to patch the blind spots discovered by the Red Team model. As these two models compete, the generator’s ability to produce adversarial samples that bypass defenses improves. Meanwhile, the detector becomes more robust to adversarial attacks that are simulated by the generator.» In short, the best way to improve machine learning threat detection is through machine learning simulated attacks.
Separately, it was announced yesterday that Accenture and Endgame are combining to offer ‘threat detection as a service’. This service will use Accenture’s experienced threat hunters with Endgame’s technology. «Rather than building a taller defensive wall,» explained Accenture’s Vikram Desai, «we’re giving our clients the ability to strike first – to stop adversaries before they attack.»
«We need to compress adversary dwell time,» added Nate Fick, CEO of Endgame, «by vigorously hunting across the enterprise architecture and terminating malicious behavior before it can get too far. Endgame and Accenture’s joint solution [will] deliver an always on, end-to-end hunt solution that simply outsmarts traditional indicators of compromise and signature-based tools.»
Endgame, which historically has been known for selling tools and zero-day exploits to government customers for offensive purposes, began shifting its focus to sell its military-grade security intelligence and analytics platform to enterprise customers over the past few years.
Red Team VS Blue Team: What’s The Difference?
Be it a small organization or a large one, one of the most efficient and effective ways to detect system or infrastructure vulnerabilities and to prevent potent attacks is by employing red team and blue team strategies.
A red team is an offensive team that conducts penetration testing and vulnerability assessments tests to detect any risks or vulnerabilities in a system. A blue team is basically a response team that reacts and responds to the threats swiftly while upholding the organization’s defense.
Despite the differences, the red team and the blue team have a common goal that is to secure the organization’s security.
Red Team VS Blue Team: Understanding the Nitty Gritties?
To access the strength of the organization’s existing security system, simulated cyber-attacks are used. This exercise is called the Red Team/Blue Team exercise. It helps identify the areas in the system that need improvement in a low-risk environment.
The testing method helps prevent cyber-attacks and protects sensitive data like business communications, sensitive client data, or trade secrets. This exercise helps in strengthening a network’s security.
Inspired by army training techniques, this exercise is designed to have 2 teams, team red on the offense and team blue as a defense.
The teams comprise of highly trained cybersecurity personnel, the red team is tasked with simulating real-world adversary scenarios in an attempt to compromise the system security and the blue team works within the system to try and identify, respond and prevent the breach in the security firewalls.
These real-time exercises are vital in strengthening a system’s cybersecurity barriers. By engaging in such exercises, organizations can continuously evolve their system security based on their weaknesses and real-world attack techniques. It helps organizations identify,
Weak points in the security system- people, technology, or systems
Areas that require improvements throughout the process chain
Provide first-hand experience to organizations on identifying and containing targeted attacks.
Strengthen the security system and improve response time.
Preparing an action plan to help systems respond to the threat.
Red Team
In the simulated cyber-attacks, the red team acts as an adversary comprising highly-trained security professionals or ethical hackers tasked with identifying and exploiting the weak points of a system’s cybersecurity.
The attacks are designed based on real-world hacking scenarios focused on penetration testing. The team tries to enter into the system through weak points in processes and technology or by tricking or stealing user credentials.
The aim is to enter and penetrate into the system as deeply as possible, accessing confidential data without being detected. Based on the outcome of the attacks, the red team then makes recommendations on how to strengthen the system’s security.
The red team will use any means or tools to exploit weaknesses and vulnerabilities in your system. The examples of red team exercises include:
Penetration testing: Often known as ethical hacking wherein a tester tries to penetrate the system to detect system loopholes using different pen test tools and software.
Social engineering: In this type of test, the tester persuades or tricks an internal member of an organization into disclosing his personal credentials, which allows the tester access to restricted or protected data.
Phishing: Includes sending users or members suspicious emails laced with malware to gain access to their credentials
Using intercepting tools: Tools such as packet sniffers and protocol analyzers can map a network and intercept the flow of data through the network to gain valuable or sensitive information.
Blue Team
The blue team is the response team which comprises security professionals who guide the IT team of the organization on where and how to strengthen the system’s security to stop or prevent cyber-attacks.
The IT team is then tasked with the responsibility of maintaining the system network against any cyber-attacks. The blue team gathers all the information that needs to be protected and conduct risk assessments.
They then identify the key aspects that need to be protected and suggest or strengthen those areas’ security. They also recommend monitoring tools to check for unusual activities and conduct regular checks. Many consider prevention to be the best way to address cyber-attacks.
However, detection and remediation are also equally the three most important aspects of cybersecurity. An organization’s ability to quickly detect, access risk levels, and eject adversaries will prevent the loss of any sensitive information.
In addition, conducting regular team exercises will ensure that the security system is UpToDate, and all weak points are addressed timely.
Examples of blue team exercises:
Performing DNS audits, preventing phishing and DNS attacks.
Performing digital footprint analysis to track the activity of the users and detect anomalies.
Securing the endpoints of the system so that there is no data breach.
Proper configuration of servers and network security system so that there are no lapses in authentication and user verification.
Ensuring network segmentation so that the attackers cannot move laterally in the networks by keeping the compromised system as a pivot and preventing a data breach.
Analyzing logs and memory to check for suspicious activities and to identify risks and vulnerabilities.
Ensuring a robust firewall is used and securing systems by using strong anti-virus and anti-malware software.
Having a good recovery and disaster management system wherein the incident responses are filed swiftly and a combination of measures are taken quickly to thwart the attack or minimize the damage.
Develop remediation policies to return systems to normal as soon as possible after a breach has taken place.
To ensure that the organization’s software is all patched and updated to deal with evolving attacks.
Conclusion
There are many benefits of the Red vs. Blue team exercise. The red team vs. blue team strategy has two different approaches and enables the organization to benefit from two different approaches, thus gaining two perspectives on their network security system. The red team identifies risk and vulnerabilities, whereas the blue team ensures that the defenses are strong enough through constant monitoring. Having this strategy helps the organization improve its security posture by finding gaps and filling those gaps through appropriate measures.
Red Team vs. Blue Team Exercises for Web Security
Tomasz Andrzej Nidecki | September 17, 2019
One of the best ways to verify the security posture of a business is to perform a mock attack. This principle is behind the concept of penetration testing (manual mock attack) and vulnerability scanning (automatic mock attack). While penetration tests and vulnerability scans are performed regularly, there is a specific type of a wargaming activity that is quite effective for maintaining security: the red team vs. blue team exercise.
Red Team and Blue Team Concepts
In information security, the red team is a specialized team of external security professionals. The only purpose of this team is to compromise security controls of your business to show where their weaknesses are. The blue team is a specialized internal security team. Its purpose is real-time incident response – to prevent the red team from succeeding.
Some exercises also include a purple team that is more of a function than a team. The only goal of the purple team is to learn from the red team and pass the knowledge onto the blue team.
The terms red team and blue team are not limited to cybersecurity only – they come from the military. Red team vs. blue team exercises are performed in many environments and in many ways. For example, in national security, you can have a red team that attempts to spread false information and a blue team that attempts to eliminate that information and expose the falseness.
In some cases, the red team may be an internal security analyst team that is delegated to the outside to perform the attack. However, an external entity is preferred because it represents real attackers better.
Red and Blue Teams in Cybersecurity
In the world of cybersecurity, the difference between penetration testers and red teaming is that a penetration test is a one-time activity while red teaming is a continuous campaign. Red teaming exercises may last for months because such an approach simulates real attacks better.
Red team activities are also not limited to using penetration testing tools. They focus on continuously coming up with ideas on how the red team may get their hands on the sensitive data of the target. Since red teaming is not a limited-scope exercise (for example, it cannot be limited to web security only), it involves social engineering techniques, phishing, and many more attack techniques.
Red and Blue Team Compositions
The red team does not have to be limited to ethical hackers. Since the goal of the team is to breach the information security of a business, there are no holds barred. The red team might, for example, include someone who is very skilled at getting information via the phone by pretending to be someone else (just like the famous Kevin Mitnick) or even someone who is good with breaching physical security (for example, by delivering a rogue USB stick). The best red team members are those that are inquisitive, patient, and very creative.
The blue team also does not have to be limited to the employees of the security department. Very often blue team members from other departments come in very handy not because of their skills but because of their character traits. Someone who is very inquisitive, curious, notices even the smallest changes immediately, may be an extremely valuable resource for a blue team.
Vulnerability Scanning for Red and Blue Teams
A vulnerability scanner could be one of the tools that both teams use as part of their regular activities. The blue team could use a vulnerability scanner to continuously discover any new web threats. Of course, if the company is following best practices and uses a vulnerability scanner as part of DevSecOps, the blue team will have less to worry about. However, new vulnerabilities are often discovered in third-party applications (if the company uses such applications, for example, WordPress). A business-class vulnerability scanner also discovers other security system weaknesses such as common passwords, which may be introduced at any time and will not be picked up in the SDLC scans.
The red team could also use a vulnerability scanner regularly for exactly the same reasons. First of all, new threats will keep appearing during this long-term exercise. Second of all, the target may introduce weak spots in its security infrastructure such as misconfigurations. Therefore, it’s a good idea to use a professional vulnerability scanner such as Acunetix (which provides both web and network threat intelligence thanks to its integration with OpenVAS) during a red team vs. blue team wargame.