# Red team vs blue team: what is the difference?

Canonical: https://hackergpt.org/learn/red-team-vs-blue-team/

**A red team is a group authorised to act like a real attacker against an organisation, to show what an attack could achieve and whether defenders notice. A blue team is the group that defends: it monitors systems, detects attacks and responds to them. The terms come from military exercises and are now used across cybersecurity.**

Part of the roadmap: [Stage 7, Choose a direction](https://hackergpt.org/learn/roadmap/#specialise)

## Why it matters

NIST's glossary, quoting the US Committee on National Security Systems, defines a red team as a group 'authorized and organized to emulate a potential adversary's attack or exploitation capabilities', whose aim is to improve security by showing the impact of successful attacks and what works for the defenders. The blue team is the group responsible for defending against those mock attackers. A third, the white team, referees the exercise and sets its rules.

A red team exercise is not the same as a penetration test. A pentest tries to find as many weaknesses as it can in an agreed scope and reports them. A red team picks an objective, such as reaching one database, uses only what it needs to get there, often quietly, and tests whether the blue team sees and stops it. Both need written permission.

Purple teaming is the practice of the two working together in the same room: the red side runs one technique, the blue side checks whether it was logged and alerted, and both fix the gap before moving on. It is a way of working rather than a separate job.

## Example: a small purple-team round on your own site

You can run both sides alone, on your own site or on CyberGym, the legal practice target. On the red side, make three harmless requests; on the blue side, look for each in the access log of a site you run, or of a local copy of Juice Shop:

```
Red (what you send)                          Blue (what you look for)
GET /admin, /backup.zip, /.env (wordlist)    a burst of 404s from one address    T1595.003
GET /rest/products/search?q=energy'          one 500 on an endpoint that is      T1190
                                             normally 200
10 x POST /rest/user/login, wrong password   ten 401s in ten seconds, no block   T1110.001
```

Each row ends in one of three answers: the log shows it and someone would be alerted, the log shows it and nobody would know, or it is not in the log at all. The second and third are the blue team's findings, as real as any bug the red side finds. Naming each row with its MITRE ATT&CK technique ID makes the exercise easy to repeat and compare.

## Common mistakes

- **Calling a pentest a red team exercise.** A pentest lists weaknesses in scope. A red team works towards an objective and tests detection.
- **Thinking red is the more skilled side.** Detection and response need as much knowledge of attacks as attacking does. Each side learns from the other.
- **Running red team actions without written permission.** Acting like an attacker is legal only with the system owner's written authorisation and agreed rules.
- **Picking a side before trying both.** A beginner learns faster by attacking a lab and then reading the logs it left.

## Related terms

- [Penetration testing](https://hackergpt.org/learn/penetration-testing/)
- [MITRE ATT&CK](https://hackergpt.org/learn/mitre-attack/)
- [Bug bounty](https://hackergpt.org/learn/bug-bounty/)
- [CTF (capture the flag)](https://hackergpt.org/learn/ctf/)

## Go deeper

- [AI pentest vs manual pentest: what each one finds](https://hackergpt.org/blog/ai-pentest-vs-manual-pentest/)
- [What an attack looks like in your web server logs](https://hackergpt.org/blog/detect-attacks-in-web-server-logs/)
- [How to learn hacking on a real target, legally](https://hackergpt.org/blog/how-to-learn-hacking/)
- [HackerGPT features: an AI agent that pentests your own website](https://hackergpt.org/features/)

## Sources

- [NIST CSRC Glossary: red team](https://csrc.nist.gov/glossary/term/red_team)
- [NIST CSRC Glossary: blue team](https://csrc.nist.gov/glossary/term/blue_team)
- [NIST SP 800-115: Technical Guide to Information Security Testing and Assessment](https://csrc.nist.gov/pubs/sp/800/115/final)
- [MITRE ATT&CK](https://attack.mitre.org/)

Test only sites you own or have written permission to test. To practise without one, use CyberGym, a legal, deliberately vulnerable target. [Practise on CyberGym](https://cybergym.hackergpt.app).
