Post

L1 Week 2: Social Engineering, Malware, Cryptographic Concepts and Nmap Cheat Sheet

Covers social engineering attacks, malware classification, and foundational cryptographic concepts from the Security+ (SY0-601) course.

L1 Week 2: Social Engineering, Malware, Cryptographic Concepts and Nmap Cheat Sheet

Playlist: Security+ Video Series (11–19)


1. Social Engineering

Social engineering exploits human psychology rather than technical vulnerabilities. It is often called “hacking the human” because it bypasses technical controls by targeting trust, authority, and urgency.

1.1 Core Techniques

TechniqueDescription
ImpersonationPretending to be someone else (e.g., IT support, a manager) to extract credentials or access. Most effective when identity cannot be easily verified.
Shoulder SurfingObserving a target’s screen or keyboard input to steal PINs, passwords, or sensitive data. Can be done remotely using binoculars or CCTV.
Dumpster DivingSearching discarded documents, drives, or hardware for sensitive information. Countered by shredding and proper media disposal policies.
TailgatingEntering a secured area by following an authorized person through a door — without their awareness.
PiggybackingLike tailgating, but the authorized employee knowingly allows the attacker entry, bypassing the entry log.
Lunchtime AttackAccessing an unattended, logged-in workstation. Mitigated by screen lock policies and user training.
Identity FraudUsing another person’s specific identity details to commit fraud (e.g., opening accounts, applying for loans).
Identity TheftStealing another person’s real identity — distinct from fraud in that the victim’s actual identity is taken, not just mimicked.

Exam tip: Know the difference between tailgating (unauthorized, without permission) and piggybacking (with the employee’s knowledge/consent).

1.2 Phishing Variants

Phishing combines social engineering and spoofing to trick targets into revealing credentials or executing malicious payloads.

VariantTargetVector
PhishingGeneral / mass audienceEmail with malicious links or spoofed login pages
Spear PhishingSpecific individualPersonalized email using known details (name, job title, recent activity)
WhalingC-level executives (CEO, CFO)Highly tailored spear phishing; high value targets
VishingAnyoneVoice call or VoIP — harder for targets to refuse live requests
SmishingMobile usersSMS-based phishing

How a phishing site attack works:

  1. Attacker clones a trusted site (bank, webmail, SaaS app).
  2. Target receives an email with a spoofed link pointing to the fake site.
  3. Target authenticates on the fake site — credentials are captured.

1.3 Other Delivery Methods

  • Spam: Mass email used to deliver phishing links, malicious attachments, or credential-harvesting campaigns. Attacker builds target lists from breached databases or marketing data.
  • Hoaxes: Fake security alerts (pop-ups or emails) claiming virus infection, offering a “fix” that is actually a Trojan. Designed to create panic and prompt reckless action.

2. Malware

Malware (malicious software) is any code designed to cause harm, gain unauthorized access, or disrupt systems. The vector is how the malware executes and spreads.

2.1 Malware Classifications

TypeKey Characteristic
VirusRequires a host file; spreads when user executes infected code
WormSelf-replicating; spreads across networks without user interaction
TrojanDisguised as legitimate software; no replication, but delivers a payload
PUP / GraywareInstalled without clear consent; not automatically malicious
SpywareCovert monitoring — keystrokes, screenshots, webcam/microphone
AdwareBrowser hijacking, unsolicited ads; often bundled with free software
RansomwareLocks files or system; demands payment for recovery
RootkitOperates at elevated privilege; hides its presence from the OS
RATRemote Access Trojan; gives attacker covert remote control
BackdoorPersistent unauthorized access mechanism
BotnetNetwork of compromised hosts controlled by a threat actor

2.2 Viruses vs. Worms

Viruses must infect a host and require user action to execute (opening a file, running a macro, attaching a USB drive). Common virus types:

  • File infector (non-resident): Attaches to executables; runs alongside the host process, then returns control.
  • Memory-resident: Launches a persistent process in memory even after the host program closes.
  • Boot sector virus: Infects the MBR or partition table; runs before the OS loads.
  • Macro / Script virus: Abuses scripting environments — VBA in Office documents, JavaScript in PDFs, PowerShell, WMI.

Worms are memory-resident and self-propagating. They do not need a host file and can spread by exploiting network vulnerabilities without any user interaction.

 VirusWorm
Requires host fileYesNo
User action neededYesNo
Spreads via networkIndirectlyDirectly
Primary behaviorInfect & replicateReplicate & consume bandwidth

2.3 Spyware, Keyloggers & Adware

  • Spyware: Records user activity — screenshots, microphone, webcam, application usage — and exfiltrates data covertly.
  • Keylogger: A subcategory of spyware focused on capturing keystrokes to steal passwords, credit card numbers, and other sensitive input.
  • Adware: A PUP/grayware class that reconfigures the browser (hijacks search engine, adds bookmarks, opens sponsor pages). Can arrive as a standalone install or a browser extension.

2.4 Backdoors, RATs & Botnets

Backdoor: Any mechanism that allows remote administrative access while bypassing normal authentication. Backdoors are not always malware-installed — they can also result from:

  • Developer debug code left in production.
  • Misconfigured services (e.g., default router credentials, unsecured RDP).
  • Open modems accepting dial-up connections.

Remote Access Trojan (RAT): Malware that mimics legitimate remote control software but operates covertly. Once installed, it allows the attacker to:

  • Browse and exfiltrate the file system.
  • Upload and execute additional payloads.
  • Use the host as a pivot point for further attacks.

Botnet:

  • A compromised host can be loaded with one or more bots — automated scripts performing malicious tasks.
  • Multiple bots under unified command form a botnet, controlled through a C2 (Command and Control) server.
  • Botnet uses: DDoS attacks, spam campaigns, cryptomining, credential stuffing.

2.5 Rootkits

A rootkit is malware that achieves elevated (kernel-level) privilege on the system, allowing it to hide its presence from the operating system, antivirus tools, and administrators.

  • The name derives from Unix/Linux: a process running as root has unrestricted access to the entire file system.
  • On Windows, rootkits exploit privilege escalation vulnerabilities to gain SYSTEM-level access — above standard Administrator.
  • Because they operate below the OS layer, rootkits can intercept and manipulate system calls, making detection difficult without specialized tools (offline scanning, hypervisor-based detection).

How Trojans evade detection before privilege escalation:

  • Name executables to mimic system files (e.g., run32d11.exe instead of rundll32.exe).
  • Register themselves as services or add registry persistence keys.

2.6 Ransomware & Crypto-Malware

Ransomware extorts victims by restricting access to their system or data.

Two main classes:

ClassBehavior
Locker ransomwareLocks the desktop/shell interface; usually easier to remediate
Crypto-malwareEncrypts files on local, removable, and network drives using strong asymmetric encryption

Crypto-malware attack flow:

  1. Ransomware infects host (often via phishing attachment or drive-by download).
  2. Malware enumerates and encrypts files — fixed drives, USB, mapped network shares.
  3. Victim is presented with a ransom demand and countdown timer.
  4. Attacker holds the private decryption key; without payment (usually in cryptocurrency), files are unrecoverable.
  5. If the timer expires (as in CryptoLocker), the key is destroyed.

Mitigation: Offline, tested, and current backups are the only reliable defense. If encrypted backups exist or shares are mapped at time of infection, they will also be encrypted.

2.7 Malware Indicators

Indicator TypeWhat to Look For
Antivirus / EPP alertsSignature-based or behavioral detection from endpoint protection platforms
Sandbox analysisIsolated execution environment records file, registry, and network activity; tools include Cuckoo Sandbox
Resource consumptionUnexplained CPU spikes, memory leaks, unusual disk I/O (common in cryptominers, DDoS bots)
File system anomaliesUnexpected files in %TEMP%, modified timestamps, new services or registry autorun entries
Network behaviorUnusual outbound connections, beaconing, large data transfers to unknown IPs

Note: Resource-based indicators are suggestive, not definitive. Poorly written malware or high-intensity malware (DDoS bots, ransomware) will show these symptoms more clearly.


3. Cryptographic Concepts

Cryptography is the practice of securing information by encoding it so that only authorized parties can read it. Unlike security through obscurity (hiding that a secret exists), cryptography allows the existence of the secret to be public — only the key must remain protected.

3.1 Core Terminology

TermDefinition
Plaintext / CleartextUnencrypted, readable data
CiphertextEncrypted, unreadable data
CipherThe algorithm used to encrypt and decrypt
KeyThe secret value that controls the cipher’s output
CryptanalysisThe study of breaking cryptographic systems
Digest / HashFixed-length output of a hash function

Standard characters in cryptography examples:

  • Alice — the sender
  • Bob — the intended recipient
  • Mallory — the malicious attacker

3.2 Hashing

A hash function takes an input of any length and produces a fixed-length output (digest). It is a one-way function — the original input cannot be recovered from the hash.

Key properties of a secure hash function:

  • Deterministic: Same input always produces the same output.
  • One-way (preimage resistance): Cannot reverse the digest back to plaintext.
  • Collision resistant: Different inputs should not produce the same digest.
  • Avalanche effect: A tiny change in input produces a completely different digest.

Use cases:

  • Password storage: Passwords are stored as hashes; on login, the entered password is hashed and compared.
  • File integrity verification: Hash a file before and after transfer; a mismatch indicates tampering.
  • Digital signatures: Combined with asymmetric encryption to prove authenticity and integrity.
AlgorithmDigest SizeStatus
MD5128-bitWeak — vulnerable to collision attacks; use only for legacy compatibility
SHA-1160-bitDeprecated — collision demonstrated in 2017
SHA-256256-bitRecommended — part of the SHA-2 family
SHA-3Variable (224–512-bit)Newest standard; different internal design from SHA-2

Exam tip: SHA-256 is the most commonly referenced secure hash on the Security+ exam. MD5 is referenced as weak/legacy.

3.3 Symmetric Encryption

In symmetric encryption, the same key is used for both encryption and decryption. Both parties must possess a copy of the secret key before any communication takes place.

Characteristics:

PropertyDetail
Also calledSingle-key, private-key, or shared-secret encryption
SpeedVery fast; suitable for bulk data encryption
Use caseEncrypting large files, disk encryption, VPN data tunnels
WeaknessSecure key distribution — how do two parties share the key without it being intercepted?
Cannot provideAuthentication or non-repudiation (both parties know the same key)

Common symmetric algorithms:

AlgorithmKey SizeNotes
AES128, 192, 256-bitCurrent standard; used in WPA2, TLS, disk encryption
3DES112 / 168-bitLegacy; deprecated but still tested on Security+
DES56-bitBroken; do not use
RC4VariableDeprecated (used in old WEP/SSL)

3.4 Asymmetric Encryption

Asymmetric encryption uses a mathematically linked key pair: a public key and a private key. What one key encrypts, only the other can decrypt.

How it works for confidentiality:

  1. Bob generates a key pair and keeps the private key secret.
  2. Bob publishes his public key freely.
  3. Alice encrypts a message using Bob’s public key.
  4. Only Bob can decrypt it — using his private key.
  5. Even if Mallory intercepts the ciphertext and the public key, he cannot decrypt the message.

Characteristics:

PropertyDetail
Also calledPublic key cryptography
SpeedSignificantly slower than symmetric encryption
Use caseKey exchange, digital signatures, authentication
AdvantageNo need to share a secret key beforehand
Can provideConfidentiality, authentication, non-repudiation

Symmetric vs. Asymmetric — Comparison:

 SymmetricAsymmetric
KeysOne shared keyKey pair (public + private)
SpeedFastSlow
Key distribution problemYesNo
AuthenticationNoYes
Use in TLSBulk data encryptionInitial key exchange

In practice (e.g., TLS/HTTPS): Asymmetric encryption is used to securely exchange a symmetric session key. All bulk data is then encrypted with the faster symmetric key. This hybrid approach is called a key encapsulation mechanism.

3.5 Public Key Algorithms

AlgorithmTypeNotes
RSAAsymmetricBased on difficulty of factoring large integers (trapdoor function); widely used
ECC (Elliptic Curve Cryptography)AsymmetricBased on elliptic curve discrete logarithm problem; smaller keys for equivalent security
Diffie-Hellman (DH)Key exchangeAllows two parties to derive a shared secret over an insecure channel; not encryption itself
DSADigital signaturesUsed for signing only, not encryption

ECC vs. RSA key size equivalence:

RSA Key SizeEquivalent ECC Key Size
1024-bit~160-bit
2048-bit~256-bit
3072-bit~384-bit

ECC’s smaller key sizes mean faster computation and lower power consumption — important for mobile and IoT devices.


4. Public Key Infrastructure (PKI)

PKI is the framework that makes public key cryptography trustworthy at scale — solving the core problem of “how do I know this public key really belongs to who it claims to?”

4.1 Public and Private Key Usage

Public key cryptography serves two distinct purposes:

GoalHow it works
ConfidentialitySender encrypts with the recipient’s public key; only the recipient’s private key can decrypt
Authentication / Non-repudiationSender signs with their private key; anyone with the public key can verify the signature

The fundamental weakness: you cannot inherently verify that a public key belongs to the claimed entity. This opens the door to man-in-the-middle (MITM) attacks — an attacker intercepts communications and substitutes their own public key. PKI exists to close this gap.

4.2 Certificate Authorities

A Certificate Authority (CA) is the trusted third party that vouches for the binding between a public key and an identity by issuing digitally signed certificates.

Types of CAs:

  • Private / Internal CA: Set up within an organization (e.g., via Windows Active Directory Certificate Services) for internal communications only.
  • Public / Commercial CA: Trusted by browsers and operating systems globally. Examples: IdenTrust, DigiCert, Sectigo/Comodo, GoDaddy, GlobalSign.

Core CA responsibilities:

  1. Provide a range of certificate services to its user community.
  2. Verify the identity of certificate applicants (registration).
  3. Maintain trust with users, regulators, and enterprises (e.g., financial institutions).

4.3 PKI Trust Models

The trust model defines how users and CAs establish trust with one another.

Single CA

  • All certificates are issued by one CA; clients trust only that CA.
  • Problem: Single point of failure — if the CA is compromised, the entire PKI collapses.

Hierarchical (Intermediate CA) — most common

  • A Root CA issues certificates to one or more Intermediate CAs.
  • Intermediate CAs issue certificates to end entities (leaf certificates).
  • Each leaf certificate traces back to the root via a certification path (also called a chain of trust or certificate chaining).
  • The root CA’s certificate is self-signed.
  • Advantage: Different intermediate CAs can enforce different policies (e.g., internal vs. public-facing services).
  • Problem: Root is still a single point of failure.

Online vs. Offline CAs

TypeDescription
Online CAAvailable on the network to accept CSRs, publish CRLs, and manage certificates in real time
Offline CADisconnected from all networks, usually powered down; used for root CAs to reduce compromise risk

Best practice: Keep the root CA offline. Bring it online only to issue or update intermediate CA certificates.

4.4 Registration Authorities and CSRs

Registration is the process by which subjects (users or devices) enroll with a CA and become authorized to request certificates.

The workflow for obtaining a certificate:

  1. Subject generates a key pair.
  2. Subject creates a Certificate Signing Request (CSR) — a Base64 ASCII file containing the subject’s identity information and public key.
  3. Subject submits the CSR to the CA (or a Registration Authority (RA) that acts on the CA’s behalf).
  4. CA validates the CSR (e.g., verifying FQDN matches WHOIS records for a web server certificate).
  5. If approved, the CA signs the certificate and returns it to the subject.

Note: In Windows Active Directory environments, domain-joined machines and users can often auto-enroll by authenticating to AD — no manual CSR needed.

4.5 Digital Certificates

A digital certificate is essentially a container for a subject’s public key, signed by a CA to prove authenticity.

Based on the X.509 standard (ITU / IETF RFC 5280). RSA’s PKCS (Public Key Cryptography Standards) complement X.509 for implementation details.

Key X.509 certificate fields:

FieldPurpose
Serial NumberUniquely identifies the certificate within the CA’s domain
Signature AlgorithmAlgorithm the CA used to sign the certificate (e.g., sha256RSA)
IssuerName of the issuing CA
Valid From / ToCertificate validity window
SubjectIdentity of the certificate holder — expressed as a Distinguished Name (DN); the Common Name (CN) typically matches the FQDN or user email
Public KeyThe subject’s public key and the algorithm it uses
Extensions (v3)Optional fields: friendly names, contact email, key usage constraints
Subject Alternative Name (SAN)Preferred field for listing the DNS name(s) the certificate is valid for; supports multi-domain certs

4.6 Certificate and Key Management

A key’s life cycle involves these stages:

  1. Key Generation — Create a key pair of appropriate strength using the chosen cipher.
  2. Certificate Generation — Submit the public key to the CA as a CSR; the CA issues a signed certificate after identity verification.
  3. Storage — The private key must be stored securely to prevent unauthorized access or loss.
  4. Expiration and Renewal — Certificates have a defined validity period. Root certificates may last 10+ years; web server and user certificates are typically 1 year.

When renewing:

  • Key renewal: Reuse the existing key pair with a new certificate.
  • Rekeying: Generate a fresh key pair along with the new certificate.

4.7 Certificate Revocation

A certificate may need to be invalidated before its natural expiration date.

Revocation vs. Suspension:

 RevokedSuspended
Permanent?Yes — cannot be reinstatedNo — can be re-enabled

Common revocation reasons:

  • Private key compromised.
  • Business closed or domain changed.
  • Employee left the organization.
  • Certificate misused.

Revocation mechanisms:

MechanismDescription
CRL (Certificate Revocation List)A published list of serial numbers for revoked certificates; clients download and check it
OCSP (Online Certificate Status Protocol)Real-time per-certificate status check; more efficient than downloading full CRLs

Tooling:

PlatformTool
WindowsActive Directory Certificate Services (certsrv), certutil, PowerShell
LinuxOpenSSL (openssl.org)

5. Authentication Controls

Authentication is the mechanism that proves a subject is who or what it claims to be. This module covers the full stack: IAM concepts, authentication factors, common protocols, password attacks, and biometrics.

5.1 Identity and Access Management (IAM)

An access control system governs how subjects (users, devices, processes) interact with objects (networks, servers, files, databases).

IAM is described through four sequential processes:

ProcessDescription
IdentificationCreating an account or ID that uniquely represents the subject on the network
AuthenticationProving the subject is who it claims to be when requesting access
AuthorizationDetermining and enforcing what rights the subject has on each resource (via ACLs)
AccountingTracking authorized usage and alerting on unauthorized access attempts (audit logs)

Exam tip: The four IAM processes are sometimes called AAA — Authentication, Authorization, and Accounting — with Identification as the prerequisite.

5.2 Authentication Factors

Authentication credentials are categorized into three factor types:

FactorCategoryExamples
Something you knowKnowledgePassword, PIN, swipe pattern
Something you haveOwnershipSmart card, hardware fob, wristband (hard tokens); OTP via smartphone (soft token)
Something you are/doBiometricFingerprint, iris scan, gait, voice (physiological or behavioral)

Key points:

  • Hard tokens (smart cards, fobs) are programmed with a unique identity certificate or account number.
  • Soft tokens (smartphone OTP codes) are valid for a single use within a short time window.
  • Passwords are not transmitted or stored in plaintext — they are stored as cryptographic hashes and compared at login time.

5.3 Multifactor Authentication (MFA)

Authentication is considered strong when it combines more than one factor type. Single-factor authentication is vulnerable: a password can be written down, a smart card can be stolen, biometrics can be spoofed.

TypeFactors CombinedExample
2FAKnowledge + Ownership or Knowledge + BiometricPassword + OTP code; PIN + smart card
3FAAll threeSmart card (have) + fingerprint (are) + PIN (know)

Location can also be used as an additional attribute (e.g., only allow logins from a certain geographic region).

5.4 Local, Network, and Remote Authentication

Authentication provider = the software architecture that authenticates a user before starting a shell (login on Linux, logon/sign-in on Windows).

Windows Authentication

ScenarioMechanism
Local sign-inLSA compares submitted credential hash to the SAM database (part of the registry)
Network sign-inLSA passes credentials to a network auth service — preferred: Kerberos; legacy: NTLM
Remote sign-inAuthentication over VPN or web portal

Linux Authentication

  • Local user accounts stored in /etc/passwd; password hashes in /etc/shadow.
  • Network interactive login uses SSH — authentication can be done via cryptographic keys instead of a password.

Single Sign-On (SSO)

SSO allows a user to authenticate once to their local device and be automatically authenticated to compatible application servers without re-entering credentials. In Windows environments, SSO is implemented via Kerberos.

5.5 Kerberos

Kerberos is a network SSO authentication and authorization protocol — the backbone of Microsoft Active Directory. Named after the three-headed dog Cerberus, it has three main components.

Key Distribution Center (KDC) — runs on port 88 (TCP/UDP), contains two services:

  • Authentication Service (AS)
  • Ticket Granting Service (TGS)

Authentication flow:

  1. Client sends the AS a request for a Ticket Granting Ticket (TGT) — the request is encrypted using the user’s password hash.
  2. The AS validates the request against the AD database. If valid, it responds with:
    • A TGT (encrypted with the KDC’s secret key) containing the client identity, IP, timestamp, and validity period.
    • A TGS session key (encrypted with the user’s password hash) for communicating with the TGS.
  3. The client presents the TGT to the TGS to request a service ticket for a specific application server.
  4. The client presents the service ticket to the application server to gain access — no password is sent over the network at any point.

Key security property: Kerberos never transmits passwords. Tickets have short validity windows, making replay attacks impractical.

5.6 PAP, CHAP, and MS-CHAP

These protocols were designed for remote access (serial links, dial-up, VPN) where Kerberos (designed for trusted LANs) is not applicable.

ProtocolSecurity LevelNotes
PAP (Password Authentication Protocol)❌ CleartextSends password in plaintext; obsolete except inside an encrypted tunnel
CHAP (Challenge Handshake Authentication Protocol)✅ Challenge-responseThree-way handshake; password never sent directly; challenge repeated periodically to prevent replay attacks
MS-CHAPv2⚠️ Use with tunnelMicrosoft’s CHAP implementation; uses vulnerable NTLM hashes — must be wrapped in an encrypted tunnel (e.g., PEAP)

CHAP three-way handshake:

  1. Challenge — server sends a random challenge message to the client.
  2. Response — client hashes the challenge + shared secret and sends the result.
  3. Verification — server independently computes the same hash; grants access if it matches.

5.7 Password Attacks

Passwords are stored as hashes, not plaintext. Attackers target the hash to recover the original password.

Attack Types by Access Method

TypeDescription
Plaintext/UnencryptedExploits protocols that transmit credentials in cleartext (PAP, basic HTTP/FTP, Telnet). Also includes credentials hardcoded in source code pushed to public repos.
OnlineAttacker submits password guesses directly to a live authentication service (web login, VPN gateway) using known password lists or credential databases (e.g., haveibeenpwned.com).
OfflineAttacker has already obtained a hash database (SAM, NTDS.DIT, /etc/shadow, or memory dump). Cracking happens locally with no interaction with the auth system — only detectable via file system audit logs.

Cracking Techniques

TechniqueHow it worksWeakness targeted
Brute-forceTries every possible character combination; constrained by compute time; effective against short passwords; can be accelerated with GPU clustersKey space size
DictionaryGenerates hashes from a wordlist and compares to captured hashPredictable/common passwords
Rainbow tableUses precomputed hash→plaintext lookup tables; chains of values stored to save spaceUnsalted hash storage
HybridCombines dictionary words with brute-force mutations (e.g., james1)Naive complexity additions

Defense against rainbow tables: Add a salt (random value appended to the plaintext before hashing) — this forces unique hashes even for identical passwords and renders precomputed tables useless. Linux/Unix use salted hashes; Windows does not, making strong password policies especially critical on Windows systems.

Common tooling: Hashcat (hashcat -m HashType -a AttackMode -o OutputFile InputHashFile), L0phtCrack, Cain & Abel (Windows).

5.8 Biometric Authentication

Biometrics use physical or behavioral characteristics to verify identity.

Enrollment process:

  1. Sensor module acquires the biometric sample.
  2. Feature extraction module identifies and records the unique characteristics as a template stored in the authentication server’s database.
  3. On login, a new scan is taken and compared to the stored template; access is granted if it matches within a defined tolerance threshold.

Physiological Biometrics (“Something You Are”)

MethodHow it worksNotes
FingerprintScans ridge patternsMost widely deployed; inexpensive; can fail with moisture/dirt; can be spoofed with a mold
Vascular / Vein matchingInfrared light maps blood vessel patterns in finger or palmAddresses spoofing weakness of fingerprints; harder to fake
Facial recognitionRecords distances between facial featuresHigh false acceptance/rejection rates; vulnerable to spoofing; popular for smartphones
Retinal scanInfrared light maps blood vessel pattern on the retinaMost accurate biometric; highly stable (doesn’t change from birth to death except via injury/disease); expensive and intrusive; false negatives from cataracts
Iris scanNear-infrared imaging of the eye surfaceSimilar accuracy to retina; less intrusive (works with glasses); less disease-sensitive; scalable for high-volume use (e.g., airports); can be fooled by a high-res photo

Behavioral Biometrics (“Something You Do”)

MethodHow it worksNotes
Voice recognitionAnalyzes vocal characteristicsInexpensive (built-in hardware); hard to template accurately; affected by background noise; vulnerable to impersonation
Gait analysisAnalyzes walking pattern via camera or accelerometer/gyroscopeEmerging technology; can be camera-based or phone sensor-based
Signature recognitionRecords stroke, speed, and pressure during signingHarder to fake than copying a static signature
Typing patternAnalyzes speed and rhythm of typing a passphrasePassive, continuous authentication potential

Behavioral biometrics generally have higher error rates and are more difficult for subjects to perform consistently compared to physiological methods.


6. Nmap Reference

Nmap (Network Mapper) is the standard tool for network reconnaissance and port scanning. General syntax:

1
nmap [scan type] [options] {target specification}

6.1 Scan Types

SwitchDescription
-sSTCP SYN scan (stealth/half-open) — default; sends SYN, doesn’t complete handshake
-sTTCP connect scan — full three-way handshake; noisier; used when SYN scan isn’t available
-sATCP ACK scan — maps firewall rules; determines filtered vs. unfiltered ports
-sUUDP scan — slower; targets DNS (53), SNMP (161), DHCP (67/68) etc.
-sFTCP FIN scan — sends FIN packet; useful for bypassing simple firewalls
-sXXMAS scan — sets FIN, PSH, URG flags simultaneously
-snPing scan — host discovery only, no port scanning
-sLList scan — lists targets without sending any packets

6.2 Port Specification

SwitchExampleDescription
-pnmap -p 23 192.168.1.1Scan a specific port
-pnmap -p 23-100 192.168.1.1Scan a port range
-pnmap -pU:110,T:23-25,443 192.168.1.1Scan specific UDP and TCP ports
-p-nmap -p- 192.168.1.1Scan all 65535 ports
-pnmap -p smtp,https 192.168.1.1Scan by protocol name
-Fnmap -F 192.168.1.1Fast scan — top 100 ports only
-rnmap -r 192.168.1.1Sequential (non-random) port scan

6.3 Host Discovery

SwitchExampleDescription
-sLnmap 192.168.1.1-5 -sLList targets without scanning
-snnmap 192.168.1.1/8 -snPing scan only — disable port scan
-Pnnmap 192.168.1.1-8 -PnSkip host discovery; treat all as online
-PSnmap 192.168.1.185 -PS22-25,80TCP SYN discovery on specified ports
-PAnmap 192.168.1.185 -PA22-25,80TCP ACK discovery on specified ports
-PUnmap 192.168.1.1-8 -PU53UDP discovery on specified port
-PRnmap 192.168.1.1-1/8 -PRARP discovery within local network
-nnmap 192.168.1.1 -nDisable DNS resolution

6.4 Version and OS Detection

SwitchExampleDescription
-sVnmap 192.168.1.1 -sVDetect service version on open ports
-sV --version-intensitynmap 192.168.1.1 -sV --version-intensity 6Intensity 0 (light) to 9 (all probes)
-sV --version-allnmap 192.168.1.1 -sV --version-allMaximum intensity (equivalent to level 9)
-sV --version-lightnmap 192.168.1.1 -sV --version-lightLight mode — faster, less accurate
-Onmap 192.168.1.1 -ORemote OS detection
-Anmap 192.168.1.1 -AAggressive: OS detection + version detection + script scanning + traceroute

6.5 NSE Scripts

Nmap Scripting Engine (NSE) allows automation of complex tasks using Lua scripts.

CommandDescription
nmap --script= test_script 192.168.1.0/24Run a named script against a target range
nmap --script-update-dbUpdate the local script database
nmap -sV -sC 192.168.1.1Run safe default scripts
nmap --script-help="Test Script"Get help/description for a specific script

6.6 Output Formats

FormatCommandNotes
Normalnmap -oN scan.txt 192.168.1.1Human-readable text
XMLnmap -oX scanr.xml 192.168.1.1Machine-parseable; useful for importing into tools
Grepablenmap -oG grep.txt 192.168.1.1Easy to filter with grep/awk
All formatsnmap -oA 192.168.1.1Saves normal, XML, and grepable simultaneously

6.7 Timing, Firewall Evasion & Misc

Timing templates (-T0 to -T5):

SwitchDescription
-T0Paranoid — slowest; avoids IDS
-T1Sneaky — tricky; avoids IDS
-T2Polite — timely; reduces bandwidth
-T3Normal — default scan speed
-T4Aggressive — faster on reliable networks
-T5Insane — very fast; may miss results

Firewall / IDS evasion:

CommandDescription
nmap -f 192.168.1.1Fragment packets to evade packet inspection
nmap -mtu [MTU] 192.168.1.1Specify custom MTU for fragmentation
nmap -sI [zombie] 192.168.1.1Idle scan using a zombie host
nmap --source-port [port] 192.168.1.1Spoof source port
nmap --data-length [size] 192.168.1.1Append random data to packets
nmap --randomize-hosts 192.168.1.1Randomize scan order
nmap --badsum 192.168.1.1Send packets with bad checksums (firewall fingerprinting)

Useful miscellaneous:

1
2
3
4
5
6
nmap -6 192.168.1.1           # Scan IPv6 targets
nmap --open 192.168.1.1       # Show only open ports
nmap --proxies proxy1,proxy2  # Route scan through proxies
nmap -iL scan.txt             # Read targets from a file
nmap --exclude 192.168.1.1    # Exclude specific IP from scan
nmap -traceroute 192.168.1.1  # Run traceroute alongside scan

Target specification examples:

1
2
3
4
5
nmap 192.168.1.1              # Single IP
nmap 192.168.1.1 192.168.100.1  # Multiple IPs
nmap 192.168.1.1-254          # IP range
nmap xyz.org                  # Domain
nmap 10.1.1.0/8               # CIDR notation

7. Quick Review / Exam Cheat Sheet

Social Engineering — Attack Types

1
2
3
4
5
6
7
8
9
10
Phishing       → Mass email, spoofed links/sites
Spear Phishing → Targeted, personalized email
Whaling        → Targeting C-suite executives
Vishing        → Voice-based phishing
Smishing       → SMS-based phishing
Tailgating     → Physical entry, no consent
Piggybacking   → Physical entry, with employee consent
Shoulder Surf  → Observing credentials being entered
Dumpster Dive  → Physical — garbage/discarded media
Hoax           → Fake security alert → Trojan delivery

Malware — Quick Reference

1
2
3
4
5
6
7
8
9
Virus          → Needs host file + user action to spread
Worm           → Self-replicating, no user action, network spread
Trojan         → Disguised as legit software, no self-replication
RAT            → Covert remote access + file upload capability
Rootkit        → Kernel/SYSTEM-level privilege, hides itself
Ransomware     → Locker (UI) or Crypto (files encrypted)
Botnet         → Many RAT-infected hosts under one C2 controller
Keylogger      → Subtype of spyware; captures keystrokes
Adware         → Browser hijacking; PUP/grayware category

Cryptography — Core Concepts

1
2
3
4
Hashing         → One-way, integrity only (cannot recover plaintext)
Symmetric       → Same key both sides; fast; key distribution problem
Asymmetric      → Key pair; slow; solves key distribution; enables auth
Hybrid (TLS)    → Asymmetric for key exchange → Symmetric for data

Hash Algorithms

1
2
3
MD5     → 128-bit  → Weak / legacy only
SHA-1   → 160-bit  → Deprecated
SHA-256 → 256-bit  → Recommended (SHA-2 family)

Symmetric Algorithms

1
2
3
AES     → 128/192/256-bit → Current standard
3DES    → 112/168-bit     → Legacy / deprecated
DES     → 56-bit          → Broken, do not use

Asymmetric Algorithms

1
2
3
4
RSA     → Trapdoor (integer factorization) → Encryption + signatures
ECC     → Trapdoor (elliptic curve) → Smaller keys, efficient
DH/DHE  → Key exchange only (not encryption)
DSA     → Signing only

Key Security Properties

PropertyProvided By
ConfidentialitySymmetric or asymmetric encryption
IntegrityHashing (MD5, SHA)
AuthenticationAsymmetric encryption / digital signatures
Non-repudiationDigital signatures (asymmetric)

PKI — Quick Reference

1
2
3
4
5
6
CA            → Trusted third party that signs and issues certificates
Root CA       → Top of the chain; self-signed; keep OFFLINE
Intermediate  → Issued by root; issues leaf certs; online
CSR           → Certificate Signing Request — public key + identity info
X.509         → Standard defining certificate fields
SAN           → Subject Alternative Name — preferred DNS name field

Certificate Lifecycle

1
2
3
4
Generate Key  → Create secure key pair
Get Cert      → Submit CSR → CA verifies → CA signs → cert issued
Renew         → Key renewal (same key) or Rekey (new key)
Revoke        → CRL (list) or OCSP (real-time query)

Trust Models

1
2
3
Single CA       → Simple, single point of failure
Hierarchical    → Root → Intermediate → Leaf (chain of trust)
Offline Root    → Root CA powered down to reduce compromise risk

Authentication — IAM & Factors

1
2
3
4
5
6
7
8
9
Identification  → Create unique account/ID for the subject
Authentication  → Prove identity (credentials vs. stored hash)
Authorization   → Enforce rights via ACL
Accounting      → Audit log of all access events

Know            → Password, PIN, swipe pattern
Have            → Smart card, fob (hard token); OTP app (soft token)
Are/Do          → Fingerprint, iris, retina, gait, voice
MFA             → 2+ different factor types combined

Kerberos Flow

1
2
3
4
5
6
1. Client → AS: Request TGT (encrypted with password hash)
2. AS → Client: TGT (encrypted KDC key) + TGS session key
3. Client → TGS: Present TGT, request service ticket
4. TGS → Client: Service ticket for target application
5. Client → App: Present service ticket → access granted
KDC port: 88 TCP/UDP

Remote Auth Protocols

1
2
3
PAP      → Cleartext password → NEVER use unencrypted
CHAP     → Challenge-response 3-way handshake → replay-resistant
MS-CHAP  → Microsoft CHAP using NTLM hashes → must use encrypted tunnel

Password Attack Types

1
2
3
4
5
6
7
Plaintext    → Sniff unencrypted protocol or find hardcoded creds
Online       → Guess live against auth service (web, VPN)
Offline      → Crack obtained hash database locally (SAM, NTDS.DIT, /etc/shadow)
Brute-force  → Try all combinations; slow; GPU-accelerated
Dictionary   → Hash a wordlist; match to captured hash
Rainbow      → Precomputed hash→plaintext chains; defeated by salting
Hybrid       → Dictionary + brute-force mutations (e.g., james1)

Biometrics — Accuracy & Intrusiveness

1
2
3
4
5
Most accurate  → Retina scan (blood vessel pattern, stable lifetime)
Least intrusive→ Iris scan (near-IR, works with glasses, scalable)
Most deployed  → Fingerprint (cheap, easy, but spoofable)
Behavioral     → Voice, gait, signature, typing (higher error rates)
Salt           → Defeats rainbow tables; used by Linux, NOT Windows

Nmap — Essential Commands

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Scan types
nmap -sS 192.168.1.1       # SYN stealth (default)
nmap -sT 192.168.1.1       # TCP connect (full handshake)
nmap -sU 192.168.1.1       # UDP scan
nmap -sA 192.168.1.1       # ACK scan (firewall mapping)

# Port scope
nmap -p 80,443 192.168.1.1  # Specific ports
nmap -p- 192.168.1.1        # All 65535 ports
nmap -F 192.168.1.1         # Fast (top 100)

# Detection
nmap -sV 192.168.1.1        # Service version
nmap -O  192.168.1.1        # OS detection
nmap -A  192.168.1.1        # Aggressive (all detection + scripts)
nmap -sV -sC 192.168.1.1    # Default NSE scripts

# Evasion / timing
nmap -T0..T5                # T0=slowest/stealthy, T5=fastest/noisy
nmap -f 192.168.1.1         # Fragment packets
nmap -sI [zombie] target    # Idle scan (spoofed source)

# Output
nmap -oN out.txt            # Normal text
nmap -oX out.xml            # XML
nmap -oA out                # All formats

image image

TryHackMe — Rooms completed as part of Week 2 practical work.

CAT Reloaded Cybersecurity Circle — SOC & DFIR Track.

This post is licensed under CC BY 4.0 by the author.