Cheat Sheets
MAG212 CYBER · Learn
Cheat sheets for defenders.
Quick references to keep open during an incident or a security review.
🚨 Incident response: the first hour
- Stay calm and start a log. Write down times, what you saw and every action taken.
- Contain, don’t destroy. Isolate affected machines from the network. Avoid switching them off if you can, because memory holds evidence.
- Escalate. Inform your incident lead, IT/security provider and management. Use a channel the attacker can’t read if email may be compromised.
- Preserve evidence. Keep logs, suspicious emails and files. Don’t wipe or reinstall yet.
- Protect accounts. Reset passwords and revoke sessions for affected and privileged accounts, from a clean device.
- Assess scope. Which systems, data and people are affected? Is data leaving the network?
- Check obligations. Contracts, regulators, insurers and law enforcement may need to be told within strict deadlines.
🔌 Common ports
Ports marked ⚠️ should rarely, if ever, be exposed directly to the internet.
| Port | Service | Note |
|---|---|---|
| 20/21 | FTP | ⚠️ Unencrypted. Prefer SFTP. |
| 22 | SSH | Use keys, disable password and root login. |
| 23 | Telnet | ⚠️ Unencrypted. Disable. |
| 25 / 587 | SMTP / submission | Mail sending. 587 for authenticated clients. |
| 53 | DNS | Don’t run open resolvers. |
| 80 / 443 | HTTP / HTTPS | Redirect 80 to 443. |
| 110 / 143 | POP3 / IMAP | Use 995 / 993 (TLS) instead. |
| 161 | SNMP | ⚠️ Avoid v1/v2c with default communities. |
| 389 / 636 | LDAP / LDAPS | ⚠️ Directory data. Internal only. |
| 445 | SMB | ⚠️ File sharing. Never internet-facing. |
| 1433 | Microsoft SQL Server | ⚠️ Database. Internal only. |
| 3306 | MySQL / MariaDB | ⚠️ Database. Internal only. |
| 3389 | RDP | ⚠️ Prime ransomware entry point. Put behind VPN with MFA. |
| 5432 | PostgreSQL | ⚠️ Database. Internal only. |
| 5900 | VNC | ⚠️ Remote desktop. Behind VPN only. |
| 6379 | Redis | ⚠️ Often deployed without authentication. |
| 8080 / 8443 | Alternate web / admin panels | Check for exposed admin interfaces. |
| 27017 | MongoDB | ⚠️ Frequently leaked when exposed. |
🪟 Windows Security event IDs worth watching
| ID | Meaning | Why it matters |
|---|---|---|
| 4624 | Successful logon | Check logon type and source for unusual access. |
| 4625 | Failed logon | Bursts suggest brute force or password spraying. |
| 4648 | Logon with explicit credentials | Can indicate lateral movement. |
| 4672 | Special privileges assigned | Administrator-level logon. |
| 4688 | New process created | Enable command-line logging to see what ran. |
| 4720 | User account created | Unexpected accounts are a persistence red flag. |
| 4728 / 4732 | Member added to a security group | Watch Domain Admins and local Administrators. |
| 4740 | Account locked out | Possible guessing attack. |
| 7045 | Service installed (System log) | Common malware and remote-tool persistence. |
| 1102 | Security log cleared | Attackers cover their tracks. Investigate always. |
| 4104 | PowerShell script block (PowerShell log) | Shows the actual script content that ran. |
🐧 Linux logs and quick checks
| Where | What |
|---|---|
/var/log/auth.log | Logins, sudo, SSH (Debian, Ubuntu) |
/var/log/secure | Logins, sudo, SSH (RHEL, Fedora, Amazon Linux) |
/var/log/syslog or /var/log/messages | General system events |
journalctl | systemd journal on most modern distributions |
last -a | head # recent logins and source sudo lastb | head # recent failed logins who # who is logged in now sudo ss -tulpn # listening ports and owning processes sudo journalctl -u ssh --since "24 hours ago" # SSH activity (unit may be sshd) ls -la /etc/cron.* ; crontab -l # scheduled tasks (persistence) find / -xdev -mtime -2 -type f -perm -u+x 2>/dev/null | head # new executables
Read-only commands for systems you own or administer. Unusual results are clues, not proof.
🔒 Small-business hardening basics
- Turn on MFA everywhere, starting with email, admin accounts and remote access. Prefer passkeys or authenticator apps.
- Patch operating systems, browsers and internet-facing apps quickly. Prioritise anything in CISA KEV.
- Remove direct internet exposure of RDP, SMB and databases. Use a VPN or zero-trust access.
- Use separate admin accounts and remove local admin rights from everyday users.
- Keep 3-2-1 backups: three copies, two media, one offline or immutable. Test restores.
- Deploy EDR on every endpoint and send logs somewhere attackers can’t delete them.
- Configure SPF, DKIM and DMARC to stop others sending email as your domain.
- Run phishing awareness training and agree a verification step for payment changes.
- Keep an asset inventory. You can’t protect what you don’t know you have.
Need expert help?
MAG212 CYBER offers network and cybersecurity consultation, plus security seminars for organisations around the world.
