CNSP Certification cheat sheet
CNSP Certification · Keep the key ideas within reach.
Web Application Security
Same-origin policy compares scheme, host, and port; a mismatch in any one of the three blocks script access to the other origin's DOM.
CSRF defenses: synchronizer token tied to the session, double-submit cookie, and SameSite=Lax/Strict cookies; SameSite=None requires Secure.
SQL injection is prevented by parameterized queries; escaping functions are context-specific and do not substitute for bound parameters.
XSS types: reflected (payload in immediate response), stored (persisted server-side), DOM-based (sink reached without server round trip).
Content Security Policy directives: script-src, object-src 'none', base-uri 'none', frame-ancestors; nonce or hash values defeat inline-script injection.
SSRF mitigation: allowlist of resolvable destinations, block link-local 169.254.0.0/16 and metadata endpoints, disable unused URL schemes.
JWT verification requires checking signature algorithm against an expected value, rejecting alg=none, and validating exp, nbf, and aud.
Insecure deserialization risk is highest where user input reaches native object constructors; prefer signed, schema-validated data formats.
Internal Network Security
Kerberoasting targets service accounts with SPNs; the attacker requests a TGS ticket and cracks it offline, so detection relies on anomalous TGS request volume and RC4 encryption types.
AS-REP roasting applies to accounts with Kerberos pre-authentication disabled; the AS-REP is encrypted with the account's key and crackable offline.
NTLM relay is blocked by SMB signing, LDAP signing with channel binding, and disabling NTLM where feasible.
Pass-the-hash uses an NTLM hash directly for authentication; it does not require cracking the plaintext password.
LLMNR and NBT-NS poisoning intercept name resolution broadcasts; disabling both protocols removes the attack path.
Segmentation validation: test east-west reachability from workstation VLANs to server VLANs on management ports 445, 3389, 5985, and 22.
Active Directory tiering places Domain Admin credentials only on Tier 0 systems; lateral movement across tiers indicates control failure.
IPv6 router advertisements can reconfigure internal hosts even when IPv4 DHCP is locked down; disable IPv6 or enforce RA guard.
External Network Security
Reconnaissance order: passive OSINT, DNS enumeration (A, AAAA, MX, TXT, NS, CNAME), subdomain brute force, then port scanning of confirmed live hosts.
Certificate Transparency logs enumerate subdomains via the SAN field; crt.sh queries return historical certificates for a domain.
Scan speed tradeoff: a full TCP connect scan completes the handshake and is logged by the target; SYN scan does not complete the handshake.
TLS assessment checks protocol versions, cipher suites, certificate chain validity, HSTS header, and known vulnerability classes such as Heartbleed.
Attack surface inventory must include non-standard ports, cloud-hosted assets, third-party SaaS, and forgotten staging environments.
DNS zone transfer (AXFR) succeeds only when the nameserver permits it; a successful transfer discloses all records in the zone.
Port state interpretation: open means a service accepted a connection; filtered means no response or an ICMP unreachable; closed means RST.
Mobile Application Security
Android data storage tiers: internal storage is app-private, external storage is world-readable unless scoped, and SharedPreferences files are plaintext unless encrypted.
iOS keychain items are protected by accessibility classes such as WhenUnlocked, AfterFirstUnlock, and Always; Always is the weakest.
Certificate pinning implementations are bypassed at runtime with Frida or objection hooks; static pinning in code is removable by repackaging.
Android exported components (activity, service, receiver, provider) without permission checks are reachable by other apps via intents.
Root and jailbreak detection is client-side and therefore bypassable; it raises attacker cost but is not a security boundary.
Mobile backend APIs must enforce authorization server-side; client-side checks in the app binary are trivially patched.
Backup flags: android:allowBackup=true permits adb backup extraction of app data on debuggable or legacy configurations.
Source-Code Analysis
Taint analysis tracks sources (request parameters, headers, file reads) to sinks (SQL execution, command execution, template rendering, deserialization).
Sinks to flag: Runtime.exec, ProcessBuilder, eval, innerHTML, document.write, pickle.loads, yaml.load without SafeLoader.
Hardcoded secrets are detected by entropy heuristics and pattern matching for key prefixes; rotation is required once committed to history.
Dependency risk is scored by reachability of the vulnerable function, not by CVE severity alone.
SAST false positive rate drops when findings are triaged against data-flow reachability from an externally controlled entry point.
Race conditions in file handling follow check-then-use patterns (TOCTOU); atomic operations or file descriptors close the window.
Cryptographic review flags ECB mode, static IVs, MD5/SHA-1 for password storage, and custom random number generators.
Cloud Security
Shared responsibility: the provider secures physical infrastructure and managed service internals; the customer secures identity, configuration, data, and network policy.
IAM privilege escalation paths include iam:PassRole combined with compute creation, iam:CreatePolicyVersion, and sts:AssumeRole on overly permissive roles.
S3 exposure causes: bucket ACLs granting AllUsers, bucket policies with Principal *, and public access block disabled at account level.
Instance metadata service v2 requires a session token obtained via PUT with a TTL header; IMDSv1 is vulnerable to SSRF credential theft.
CloudTrail and equivalent audit logs record control-plane API calls; data-plane access such as S3 GetObject requires separate logging.
Storage encryption at rest uses provider-managed or customer-managed keys; key policy errors can lock out legitimate principals.
Cross-account trust is defined in resource policies and role trust policies; wildcard principals in trust policies are a critical finding.
Red Team Assessment
Kill chain phases: reconnaissance, initial access, execution, persistence, privilege escalation, credential access, lateral movement, exfiltration.
MITRE ATT&CK maps observed behavior to tactics and techniques; detection engineering uses the same matrix to build coverage.
C2 beacon jitter randomizes callback intervals to defeat periodic-traffic detection; sleep and jitter are configured per implant.
Operational security failures that expose red teams: reused infrastructure, unencrypted payloads, and artifacts matching known tool signatures.
Rules of engagement define scope, allowed techniques, blackout windows, and emergency stop contacts; out-of-scope testing is unauthorized.
Privilege escalation on Linux commonly follows SUID binaries, sudo misconfigurations, and writable cron or service files.
Credential dumping on Windows targets LSASS memory; protected process light and credential guard raise the required privilege level.
AI/ML Security
Prompt injection is direct when the user supplies the malicious instruction and indirect when it arrives through retrieved documents, tool output, or web content.
Training-data poisoning alters model behavior by inserting crafted samples; it requires access to the training pipeline or data source.
Model extraction (stealing) reconstructs a functionally similar model through repeated queries; rate limiting and query monitoring raise cost.
Membership inference determines whether a specific record was in the training set; differential privacy reduces this leakage.
Adversarial examples are inputs perturbed to change classification; transferability means perturbations crafted on one model often affect another.
OWASP LLM Top 10 categories include prompt injection, insecure output handling, training data poisoning, and excessive agency.
Model supply chain risk includes unverified pretrained weights and pickle-format model files that execute code on load.