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

  1. Stay calm and start a log. Write down times, what you saw and every action taken.
  2. Contain, don’t destroy. Isolate affected machines from the network. Avoid switching them off if you can, because memory holds evidence.
  3. Escalate. Inform your incident lead, IT/security provider and management. Use a channel the attacker can’t read if email may be compromised.
  4. Preserve evidence. Keep logs, suspicious emails and files. Don’t wipe or reinstall yet.
  5. Protect accounts. Reset passwords and revoke sessions for affected and privileged accounts, from a clean device.
  6. Assess scope. Which systems, data and people are affected? Is data leaving the network?
  7. 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.

PortServiceNote
20/21FTP⚠️ Unencrypted. Prefer SFTP.
22SSHUse keys, disable password and root login.
23Telnet⚠️ Unencrypted. Disable.
25 / 587SMTP / submissionMail sending. 587 for authenticated clients.
53DNSDon’t run open resolvers.
80 / 443HTTP / HTTPSRedirect 80 to 443.
110 / 143POP3 / IMAPUse 995 / 993 (TLS) instead.
161SNMP⚠️ Avoid v1/v2c with default communities.
389 / 636LDAP / LDAPS⚠️ Directory data. Internal only.
445SMB⚠️ File sharing. Never internet-facing.
1433Microsoft SQL Server⚠️ Database. Internal only.
3306MySQL / MariaDB⚠️ Database. Internal only.
3389RDP⚠️ Prime ransomware entry point. Put behind VPN with MFA.
5432PostgreSQL⚠️ Database. Internal only.
5900VNC⚠️ Remote desktop. Behind VPN only.
6379Redis⚠️ Often deployed without authentication.
8080 / 8443Alternate web / admin panelsCheck for exposed admin interfaces.
27017MongoDB⚠️ Frequently leaked when exposed.

🪟 Windows Security event IDs worth watching

IDMeaningWhy it matters
4624Successful logonCheck logon type and source for unusual access.
4625Failed logonBursts suggest brute force or password spraying.
4648Logon with explicit credentialsCan indicate lateral movement.
4672Special privileges assignedAdministrator-level logon.
4688New process createdEnable command-line logging to see what ran.
4720User account createdUnexpected accounts are a persistence red flag.
4728 / 4732Member added to a security groupWatch Domain Admins and local Administrators.
4740Account locked outPossible guessing attack.
7045Service installed (System log)Common malware and remote-tool persistence.
1102Security log clearedAttackers cover their tracks. Investigate always.
4104PowerShell script block (PowerShell log)Shows the actual script content that ran.

🐧 Linux logs and quick checks

WhereWhat
/var/log/auth.logLogins, sudo, SSH (Debian, Ubuntu)
/var/log/secureLogins, sudo, SSH (RHEL, Fedora, Amazon Linux)
/var/log/syslog or /var/log/messagesGeneral system events
journalctlsystemd 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.

Explore our services →