Class
Nothing here yet — start typing.

Nothing here yet — start typing.
Nothing here yet — start typing.
Nothing here yet — start typing.
Bounty Hawk is a local-first attack-surface management and authorized security-testing platform.
Its purpose is to bring the complete bug-bounty and penetration-testing workflow into one application:
Bounty Hawk is not intended to blindly scan arbitrary public systems. Every live scan should be restricted to domains that the user owns or is explicitly authorized to test.
Bounty Hawk currently uses four primary services.
| Service | Technology | Default Port | Purpose |
|---|---|---|---|
| Frontend | React | 3000 | Dashboard, target management, scan controls, results, reporting |
| Main API | Express / Node.js | 8000 | MongoDB access, target data, findings, logs, application APIs |
| Scanner API | Flask / Python | 5000 | Scan validation, process execution, background jobs, scanner health |
| Database | MongoDB | 27017 | Persistent targets, findings, logs, scan data, application state |
Optional integrations can include Burp Suite, external reconnaissance utilities, screenshots, Nuclei, Amass, Subfinder, Assetfinder, GAU, ShuffleDNS, and other authorized testing tools.
React frontend
|
|-- application data --------------------> Express API --> MongoDB
|
|-- scanner commands --------------------> Flask API
|
|-- Wildfire orchestrator
|-- Fire Starter
|-- Additional scanner modules
|-- External tools
The target workspace allows the user to add a domain or fully qualified domain name, select it as the active workspace, import scope data, and delete or restore target information.
Example target:
bounty-hawk.test
Every scan, finding, endpoint, screenshot, log entry, and report must belong to a specific authorized target. Without a central target workspace, results become difficult to organize and scope mistakes become more likely.
The domain stored in the workspace and the domain present in authorized-scopes.json must match before a live scan can begin.
The Overview page summarizes the current target and the most important testing data.
A security tester should be able to understand the current state of a target without opening every module individually.
The interface has been modernized with a consistent dark design, Poppins typography, responsive layouts, and larger readable text.
Reconnaissance collects public and target-related information before deeper testing begins.
Good vulnerability research starts with understanding the target's public footprint. Reconnaissance identifies systems, technologies, repositories, archived content, and information that may expand the authorized attack surface.
Recon results should be normalized into reusable assets rather than remaining only as raw command output.
Enumeration converts the broad recon data into specific, testable assets.
Recon may produce hundreds or thousands of records. Enumeration determines which hosts are alive, what services they expose, and which URLs or endpoints deserve manual testing.
{
"target": "bounty-hawk.test",
"hostname": "bounty-hawk.test",
"url": "http://bounty-hawk.test:8001",
"ip": "127.0.0.1",
"ports": [8001],
"status": "live"
}
The CVE Testing area displays automated vulnerability-template results and known-vulnerability checks.
Known vulnerabilities are only one part of security testing, but they provide fast validation of outdated software, exposed administrative services, and common misconfigurations.
Automated matches are leads, not automatically valid vulnerabilities. Findings must be manually verified before reporting.
Operations Testing covers practical application and infrastructure checks that do not belong only to one CVE.
Many important security issues are caused by deployment mistakes, access-control failures, unsafe operational behavior, or insecure configuration rather than a published CVE.
Core Testing contains the main web-application security methodology.
A repeatable checklist reduces missed test cases and provides structure for manual investigation.
Each test should support:
Creative Testing is used for hypotheses and non-standard attack ideas that do not fit a fixed checklist.
The highest-value findings are often discovered by understanding how multiple features interact rather than by running a known template.
Chaining connects multiple low- or medium-impact weaknesses into one complete attack path.
One issue may appear minor by itself but become critical when combined with another weakness.
Public endpoint disclosure
-> weak authorization
-> access to another user's object
-> sensitive account data exposure
Resources stores target-specific reference material.
During testing, the user may need to keep program rules, documentation, credentials for a lab account, API references, wordlists, useful URLs, and notes in one location.
Sensitive values should not be committed to Git or stored as plaintext without protection.
Logging records scanner activity and manual actions.
Logs are required for troubleshooting, reproducibility, and understanding exactly what was executed against an authorized target.
The Report Builder converts verified findings into a professional security report.
A finding is only useful when the affected organization can clearly understand, reproduce, prioritize, and fix it.
The Flask service acts as a security boundary between the React application and operating-system commands.
GET /health
GET /status
GET /jobs
GET /jobs/<job_id>
POST /wildfire
POST /terminate-subprocesses
Wildfire is the main scan orchestrator.
completed
completed_with_warnings
failed
cancelled
Automatically chooses the correct profile based on the target.
Used for .test, .invalid, .local, localhost, and private laboratory systems.
Local scans should avoid public OSINT and DNS brute forcing.
Typical local modules:
Used for normal authorized public-domain testing.
Typical modules:
Used only when broader, slower, and more intrusive discovery has been explicitly approved.
Typical additions:
The /health endpoint currently detects major installed tools such as:
Tool health should eventually include:
A scan request returns immediately with a job ID. The scanner continues in a background process.
Example:
{
"message": "Scan queued",
"job_id": "38dcfb86-d26d-4519-9726-68395b3d6b8e",
"status": "queued",
"target": "bounty-hawk.test"
}
queued -> running -> completed
-> completed_with_warnings
-> failed
-> cancelled
Jobs are held in Flask memory. Restarting Flask removes the in-memory job history.
Persist jobs in MongoDB so that:
The following functionality has been confirmed working:
bounty-hawk.test completed successfully.Restarting Flask removes current job records.
Some existing database fields contain mixed value types, such as strings in older records and objects in newer records. React components must normalize data before rendering.
When a hostname resolves to 127.0.0.1, a broad local port probe may discover Bounty Hawk's own services. When an exact target URL is supplied, the scanner should default to scanning only that URL and port.
Some integrated tools use old command-line formats or old Python dependencies. Every tool needs a compatibility adapter and independent health status.
The current job implementation may store complete stdout and stderr after the process exits instead of streaming all output live.
Automated findings still require manual validation and lifecycle states.
Environment files, tokens, API keys, and private credentials must never be exposed through a test web server or committed to Git.
Status: mostly completed.
completed_with_warnings handling everywhere.Proposed asset structure:
{
"targetId": "...",
"type": "url",
"value": "https://api.example.com/v1/users",
"hostname": "api.example.com",
"ipAddresses": ["203.0.113.10"],
"ports": [443],
"sources": ["subfinder", "http_probe"],
"firstSeen": "...",
"lastSeen": "...",
"status": "live"
}
Proposed finding states:
new
reviewing
needs_verification
valid
false_positive
duplicate
reported
resolved
retest_required
closed
docker-compose.yml.Target command:
./start-local.sh
or:
docker compose up
.env, tokens, cookies, credentials, or private scan data.sudo systemctl start docker
docker start bounty-hawk-mongo
cd ~/Scripts/Bounty-Hawk/server
npm start
cd ~/Scripts/Bounty-Hawk/toolkit
source .venv/bin/activate
python toolkit-service.py
cd ~/Scripts/Bounty-Hawk/client
npm start
cd ~/bounty-hawk-test-site
python3 -m http.server 8001 --bind 127.0.0.1
curl -s http://127.0.0.1:5000/health | python3 -m json.tool
curl -s -X POST http://127.0.0.1:8000/api/fqdn/all \
-H 'Content-Type: application/json' \
-d '{}' | python3 -m json.tool
Development is paused after the following milestones:
The next engineering discussion should focus on the complete product functionality and data flow before adding more code.
The recommended next decision is to define the permanent data models for:
Once these models are agreed upon, the implementation can continue without repeated frontend and backend restructuring.
Bounty Hawk v1 will be considered complete when a user can:
focus beyond pure protection).
CIA.
Threat actors include cybercriminals, hacktivists, state-sponsored/APTs, insiders, and hobbyists.
Cybercriminals are financially motivated (credential theft, ransomware, fraud).
Hacktivists pursue ideological goals (defacements, leaks, DDoS for awareness).
State-sponsored groups conduct espionage/sabotage with persistence and resources (APTs).
Insiders may be malicious or negligent; they bypass perimeter and know internal processes.
Hobbyists/script kiddies leverage toolkits; capability varies but volume creates risk.
Social engineering exploits human trust; technologies can’t fully prevent it.
Phishing/vishing/smishing are common social-engineering modalities.
Malware classes: virus, worm, trojan, rootkit, spyware, ransomware, adware.
Rootkits aim for stealth and privilege (kernel/firmware/boot-level persistence).
Attack surface expands with complexity, interconnections, and unknown perimeters.
Security posture depends on layered defenses across physical, personnel, operations, network,
information.
small/verifiable.
Least privilege: give subjects only the access necessary to perform tasks, no more.
Separation of duties: split critical tasks so one person cannot commit undetected fraud.
Need-to-know: restrict access to data strictly to those requiring it for duties.
Fail-safe defaults: deny by default; permit only explicitly authorized actions.
Open design: rely on secrecy of keys not algorithms (Kerckhoffs’ principle).
Complete mediation: every access must be checked; no caching of authorization that can be bypassed.
Auditability: log security-relevant events; necessary for accountability and forensics.
Security vs usability trade-offs must be explicit; excessive friction leads to insecure workarounds.
Policy → standards → procedures → guidelines: governance hierarchy for coherent security practice.
Asset inventory is prerequisite to protection—“you can’t protect what you don’t know.”
Data classification schemes must be comprehensive and mutually exclusive.
Owners classify data; custodians enforce controls; users comply with handling rules.
Handling rules cover storage, distribution, portability, and destruction for each classification.
Risk thinking starts in Module 1: total risk combines likelihood and impact; later quantified in Module
Natural threats: fire, flood, earthquake; require DR/BC planning and insurance.
Human benign threats: error, misconfiguration; training and change control mitigate.
Human malicious threats: theft, sabotage, extortion; need technical and administrative controls.
Passive attacks (sniffing) observe; active attacks (DoS, injection) alter state or availability.
1969 ARPANET origins: early needs included user identification and connection traceability.
1988 Morris Worm catalyzed formal incident response; CERT/CC established.
Security incidents increased with internet scale; attacker motives shifted from curiosity to profit.
Zero-day market: researchers, governments, and criminals trade exploits; raises ethical/policy questions.
CVE growth trends illustrate expanding vulnerability landscape (need for patch/vuln management).
Security categorization (FIPS 199) informs control selection and certification/accreditation scope.
High.
of config.
Administrative controls: policies, training, background checks, sanctions.
Technical controls: access control, encryption, network filtering, EDR, logging.
Physical controls: locks, guards, cameras, cages, power/UPS, environmental sensors.
Preventive controls aim to stop incidents (e.g., firewall default-deny).
Detective controls discover incidents (e.g., IDS alerts, SIEM correlation).
Corrective controls restore normal operations (e.g., backups, patches, DR).
Deterrent controls discourage attempts (e.g., warnings, visible cameras).
Compensating controls provide alternative measures when primary controls aren’t feasible.
Security architecture aligns controls to data flows and trust boundaries.
Trust boundary violations (e.g., direct DB exposure to internet) are architectural vulnerabilities.
Attack trees help reason about attacker goals and required sub-steps.
Threat modeling (STRIDE, etc.) systematically enumerates threats by component.
Asset criticality depends on confidentiality needs, integrity sensitivity, and availability demands.
Security testing spectrum: vulnerability scanning, penetration testing, red teaming, purple teaming.
Patch management cadence must balance risk of exploitation vs operational impact of change.
Configuration management (baselines, hardening guides) reduces misconfigurations.
Principle of minimal attack surface: remove unused services, close ports, uninstall defaults.
Data lifecycle: create, store, use, share, archive, destroy—controls at each phase differ.
Secure destruction (crypto-erase/shredding) is essential for decommissioned media.
Logging scope should include auth events, admin actions, security alerts, and data access.
Time synchronization (NTP) supports coherent logs and forensic timelines.
Incident response basics: detect, analyze, contain, eradicate, recover, lessons learned.
Business continuity focuses on continued operations; disaster recovery on restoring IT services.
Legal/regulatory drivers (privacy laws, contractual duties) influence controls selection.
Third-party risk: vendors/partners add attack paths; require assessments and controls.
threats, vulnerabilities, and controls succinctly.
Module 2 – Risk Analysis (100 Key Points for Exam-Level Understanding)
policies).
Vulnerabilities are discovered through scanning, auditing, or testing.
Zero-day vulnerabilities are unknown to vendors and have no patches.
CVSS (Common Vulnerability Scoring System) is used to rank vulnerabilities.
The higher the vulnerability severity, the higher the risk.
Impact (Loss) Assessment
Impact is measured in terms of financial loss, legal consequences, reputational damage, safety risks.
Impact = Asset Value × Exposure Factor.
Exposure Factor = percentage of asset lost in a single incident.
Single Loss Expectancy (SLE) = Asset Value × Exposure Factor.
Impact can be tangible (money) or intangible (public trust).
Likelihood & Probability
Likelihood = how often a threat is expected to occur.
Annual Rate of Occurrence (ARO) = estimated number of times per year a threat occurs.
ARO can be based on historical data or expert judgment.
Likelihood may be qualitative (High/Medium/Low) or quantitative (0.1, 1, 10).
The more exposed a system is, the higher the likelihood.
Risk Calculation
Annualized Loss Expectancy (ALE) = SLE × ARO.
ALE estimates expected yearly financial loss due to a risk.
If ARO = 0, ALE = 0 (risk is negligible).
Total risk accumulates for all identified threats.
Risks are ranked from highest to lowest to prioritize mitigation.
Risk Treatment Strategies
Mitigate (reduce risk using security controls).
Transfer (shift risk to third party, e.g., insurance).
Avoid (stop performing risky activity).
Accept (acknowledge and tolerate risk if low or unavoidable).
Different risks may require different strategies.
Types of Controls
Preventive controls stop incidents before they happen (firewalls, encryption).
Detective controls identify incidents after they happen (IDS, logs).
Corrective controls recover systems after incidents (backups, incident response).
Module 3 – Cryptography 100 Key Points (High-Difficulty, Exam-Focused, No Repetition, No Explanations Added unless needed for precision) No citations, as you requested.
Foundations of Cryptography
Cryptography is the science of securing information through mathematical techniques.
Cryptanalysis is the study of breaking cryptographic systems.
Cryptology = Cryptography + Cryptanalysis.
Purpose of cryptography: confidentiality, integrity, authentication, non-repudiation.
Kerckhoffs's Principle: security must depend only on secrecy of the key, not the algorithm.
Plaintext = original readable message.
Ciphertext = scrambled form of plaintext.
Encryption transforms plaintext into ciphertext using a key.
Decryption transforms ciphertext back to plaintext.
Keyspace is the total number of possible keys.
Symmetric Key Cryptography
Symmetric encryption uses the same key for encryption and decryption.
Major issue: secure key distribution.
Key count in symmetric systems = n(n-1)/2 for n users.
Block ciphers process fixed-size blocks of data.
Stream ciphers process data bit-by-bit or byte-by-byte.
DES: 64-bit block size, 56-bit key, 16 rounds, Feistel structure.
3DES = Encrypt-Decrypt-Encrypt using DES, key sizes 112 or 168 bits.
AES: block size 128 bits, key sizes 128/192/256 bits.
AES rounds: 10 for 128-bit, 12 for 192-bit, 14 for 256-bit keys.
AES steps: SubBytes, ShiftRows, MixColumns, AddRoundKey.
Block Cipher Modes
ECB (Electronic Codebook): same plaintext = same ciphertext.
CBC (Cipher Block Chaining): each block depends on previous block.
CFB (Cipher Feedback): converts block cipher into a stream cipher.
OFB (Output Feedback): similar to CFB but more error-resistant.
CTR (Counter Mode): transforms block cipher into parallelizable stream cipher.
IV (Initialization Vector): required for CBC, CFB, OFB, CTR.
IV must be unique and unpredictable.
ECB must never be used for sensitive data.
Padding schemes like PKCS#7 handle non-exact block-size plaintext.
Module 4 – Authentication, Passwords, Access Control 100 Advanced, Exam-Level Points (No repetitions, no filler, no sources attached)
Foundations of Authentication & Identity
Authentication = verifying identity of a user or system.
Identification = claiming an identity (e.g., entering a username).
Authorization = deciding what an authenticated user is allowed to do.
Accounting (AAA model) = logging actions performed after authentication.
Authentication factors: something you know, have, are.
Strong authentication uses at least two different factors.
Re-authentication is required for critical actions (bank transfers, sudo in Linux).
Session tokens/cookies maintain authentication state in web applications.
Kerberos uses tickets for mutual authentication over untrusted networks.
Mutual authentication verifies both client and server (seen in Kerberos, TLS).
Types of Authentication Factors
Something you know: password, PIN, answer to security question.
Something you have: smart card, token, phone OTP, hardware key (YubiKey).
Something you are: biometrics (fingerprint, face, iris).
Multi-factor authentication succeeds only when factors come from different categories.
Two passwords do not count as multi-factor authentication.
Password-Based Authentication
Passwords are the most widely used authentication method.
Good password policies enforce minimum length + complexity + history.
Password aging forces periodic change (e.g., chage command).
Linux stores hashed passwords in /etc/shadow, not /etc/passwd.
/etc/passwd retains username, UID, GID, home directory, shell.
Password hashing uses one-way functions.
Salt is added to prevent identical hashes for identical passwords.
Pepper is a site-wide secret added to all passwords before hashing.
Shadow file access is restricted to root.
Never store plaintext passwords.
Password Hashing Algorithms
MD5 and SHA-1 are insecure for password hashing.
bcrypt adds salt and uses multiple rounds.
Module 6 – Network Security (100 Hard-Level Points)
Basics of Network Security
Network security is the protection of data during transmission and the protection of networked systems.
Security goals in networking still map to CIA: confidentiality, integrity, availability.
Data-in-transit refers to data moving across communication channels.
Data-at-rest refers to stored data on physical or cloud systems.
Attack surface increases as network complexity, devices, and exposure increase.
Network Attacker Capabilities
An attacker on the same LAN can sniff unencrypted traffic using tools like Wireshark/tcpdump.
ARP spoofing enables an attacker to redirect network traffic to their system (MITM).
DNS spoofing poisons DNS cache to redirect users to malicious websites.
Port scanning (e.g. nmap) identifies open ports/services on target hosts.
Banner grabbing retrieves service versions to identify possible exploits.
Ping sweeps identify live hosts using ICMP echo requests.
DoS (Denial of Service) makes services unavailable by exhausting resources.
DDoS uses distributed systems or botnets to flood target with traffic.
SYN flood attack sends many SYN packets but never completes TCP handshake.
Man-in-the-Middle attack intercepts communication between two systems silently.
Firewalls and Packet Filtering
Firewalls enforce network traffic rules at network boundaries.
Stateless packet filters inspect only headers of each packet.
Stateless firewalls cannot track TCP session states.
Stateful firewalls track connection states (NEW, ESTABLISHED, RELATED).
Default firewall rule principle: deny all, allow specific.
In iptables, INPUT chain handles traffic to local system.
OUTPUT chain handles traffic leaving local system.
FORWARD chain handles traffic routed through the system (used in proxy/gateway).
NAT table is responsible for address translation (source NAT/destination NAT).
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE hides internal IPs.
Secure Proxy Lab Concepts
For each information type, determine potential impact on mission, legal duties, ops, and individuals.
Overall system categorization often equals the highest impact among its CIA ratings.
Example: medical record system typically High for confidentiality and integrity; availability may also be
Supply-chain compromises (software/hardware) can bypass perimeter and endpoint defenses.
Security metrics should be meaningful (patch latency, detection time, incident rate).
Security awareness training must be continuous and realistic (phishing drills, policy refreshers).
Shadow IT expands risk; governance must enable safe alternatives and visibility.
Cloud changes threat model: shared responsibility, identity-centric perimeters, data residency.
Zero Trust mindset: verify explicitly, least privilege, assume breach—applies across modules.
Module 1 ties terminology, CIA, actors, threats, and categorization—foundation for later modules.
Exam readiness: be able to categorize an information type by CIA (with justification) and map
Deterrent controls discourage threat actors (warning banners, legal notices).
Compensating controls are alternative mechanisms when primary controls cannot be implemented.
Cost-Benefit Analysis
Cost of control must be less than expected loss to justify implementation.
Risk Reduction Value = (Risk before control – Risk after control).
Risk Leverage = Risk Reduction / Control Cost.
High leverage means efficient control.
Avoiding unnecessary high-cost controls is important.
Qualitative vs Quantitative Risk Analysis
Qualitative uses subjective ratings (High, Medium, Low).
Quantitative uses numeric values (ALE, SLE).
Qualitative is faster but less precise.
Quantitative is more detailed but harder to perform.
Many organizations use a hybrid model.
Risk Matrix / Heat Map
Risk = Likelihood × Impact.
Risks are plotted in matrices: Low, Medium, High, Extreme.
High-likelihood, high-impact risks are top priority.
Low-likelihood, low-impact risks are monitored but often accepted.
Risk heat maps help in visual decision-making.
Risk Appetite and Tolerance
Risk appetite: maximum level of risk an organization is willing to accept.
Risk tolerance: acceptable variation around the appetite.
High-risk appetite industries include startups and military research.
Low-risk appetite industries include healthcare and aviation.
Risk decisions must align with organization's appetite.
Documentation & Reporting
Risk register stores all risk-related details.
Each risk entry includes asset, threat, vulnerability, impact, likelihood, control.
Risk reports must be communicated to management.
Documentation ensures accountability and auditability.
Policies and procedures must be updated after risk assessments.
Residual & Secondary Risks
Residual risk remains after controls are applied.
No control reduces risk to zero.
Secondary risk is introduced by applying a control (e.g., backup drives can be stolen).
Acceptable residual risk must be approved by management.
Ignoring residual risk is a major security failure.
Continuous Risk Monitoring
Risk analysis is not a one-time task.
Risks change due to new vulnerabilities or technologies.
Regular audits and assessments are required.
Threat intelligence helps in updating risk models.
Risk management is a continuous improvement process.
Real-World Risk Examples
Ransomware → High impact, high likelihood.
Fire in data center → High impact, low likelihood → disaster recovery required.
Weak employee passwords → high likelihood, medium impact → training + MFA.
Cloud vendor outage → risk transfer + SLA agreements.
If risk > appetite → organization must mitigate, transfer, or stop the activity.
In CBC mode, one bit error causes corruption in two blocks.
Asymmetric Cryptography
Asymmetric encryption uses a public key to encrypt, private key to decrypt.
Key pair = public + private key mathematically related.
Solves key distribution problem.
RSA is based on prime number factorization problem.
RSA key generation: choose primes p, q; n = pq; φ(n) = (p-1)(q-1); choose e; compute d.
RSA encryption: c = m^e mod n.
RSA decryption: m = c^d mod n.
Public key = (e, n), private key = (d, n).
RSA is slow for large data; only used to encrypt symmetric keys.
Typical RSA key sizes: 2048/3072/4096 bits.
Diffie-Hellman Key Exchange
Enables two parties to exchange symmetric keys over insecure channels.
Relies on discrete logarithm problem.
Vulnerable to man-in-the-middle if authentication not used.
Shared secret computed: (g^ab mod p).
DH does not provide encryption, only key exchange.
Ephemeral Diffie-Hellman (DHE) provides forward secrecy.
Elliptic Curve Cryptography (ECC)
ECC offers same security as RSA with smaller key sizes.
ECC is based on algebraic structures over elliptic curves.
Common curve: secp256k1 (used in Bitcoin).
ECC key sizes: 256-bit ECC ≈ 3072-bit RSA security.
ECDH = Diffie-Hellman using ECC.
ECDSA = Digital signature using ECC.
Hash Functions
A hash function maps variable-length input to fixed-length output.
Must be deterministic.
Must be pre-image resistant.
Must be second pre-image resistant.
Must resist collisions (same output from two different inputs).
Birthday attack exploits collision probability.
MD5 is broken (collision-prone).
SHA-1 is deprecated.
SHA-256 is widely used and secure.
SHA-3 is based on Keccak algorithm.
Hashes are irreversible.
Message Authentication Codes (MAC & HMAC)
MAC ensures integrity and authenticity using symmetric keys.
HMAC = Hash + Secret key.
HMAC formula: H[(K ⊕ opad) || H((K ⊕ ipad) || message)].
HMAC prevents message tampering.
MAC does not provide non-repudiation.
Used in TLS, IPSec.
Digital Signatures
Ensures authenticity, integrity, and non-repudiation.
Private key signs the hash of the message.
Public key verifies the signature.
Digital signature ≠ encryption.
Structure: Hash(message) → Sign with private key.
RSA Signature: s = H(m)^d mod n.
Verification: H(m) ?= s^e mod n.
DSA (Digital Signature Algorithm) is US standard.
ECDSA provides same signatures with shorter keys.
Timestamping adds proof-of-time to signatures.
Certificates & PKI
PKI = Public Key Infrastructure.
Certificate Authority (CA) issues digital certificates.
X.509 is the format for digital certificates.
Certificate binds public key to identity.
Certificate Revocation List (CRL) lists invalid certificates.
OCSP is used for real-time certificate verification.
Root CA is trusted implicitly by operating systems and browsers.
Intermediate CA signs subordinate certificates.
TLS uses certificates for server authentication.
Self-signed certificates are not trusted by browsers.
Hybrid Encryption
Encrypt data with symmetric key (AES).
Encrypt symmetric key with public key (RSA/ECC).
Receiver decrypts symmetric key with private key.
Receiver decrypts ciphertext using symmetric key.
Used in SSL/TLS, PGP, secure email.
Ensures confidentiality and performance.
Additional Cryptographic Concepts
Perfect Forward Secrecy: compromise of long-term keys does not expose past session keys.
Key escrow: third-party holds a copy of encryption keys.
Side-channel attacks target timing, power consumption.
Cryptographic salt prevents pre-computed hash attacks.
Key rotation reduces exposure window if key is compromised.
PBKDF2 uses stretching with HMAC + iterations.
scrypt adds memory hardness to resist GPU/ASIC cracking.
Argon2 is the modern recommended standard (winner of PHC).
Hashing should be slow to defend against brute-force and dictionary attacks.
GPU cracking is feasible for MD5, SHA1, SHA256 without stretching.
Rainbow tables = precomputed hash datasets to crack unsalted hashes.
Salting defeats rainbow tables by making each password hash unique.
Pepper is stored in application code; if lost, all hashes become invalid.
Windows Password Storage
Windows stores password hashes in SAM (Security Accounts Manager) database.
LM Hash (LAN Manager) is old and extremely insecure.
LM hash splits password into 7-character blocks → uppercase only.
NTLM hash replaces LM, but still vulnerable to pass-the-hash.
Pass-the-hash attack = using stolen hashes directly without cracking.
Tools like mimikatz extract Windows hashes from memory.
Syskey was an older Windows technique to encrypt SAM database.
NTLMv2 is improved and uses HMAC-MD5 challenge-response.
Domain environments use Kerberos for authentication.
Offline vs Online Attacks
Online attacks → brute force over network (slow, detectable).
Online limits include rate limiting, account lockout, IP blocking.
Offline attacks → attacker steals hashes and cracks locally.
Offline attacks are faster, stealthier, and only limited by hardware.
Hydra is used for online brute-force over SSH, FTP, HTTP.
John the Ripper is used for offline hash cracking.
Hashcat is GPU-based password cracker.
unshadow merges /etc/passwd and /etc/shadow for JTR cracking.
Wordlists like rockyou.txt are used for dictionary attacks.
Mask attacks assume pattern (e.g., Summer2024!).
Hybrid attacks = dictionary + mutation rules.
Access Control Models
DAC (Discretionary Access Control): resource owner defines access (Linux chmod).
MAC (Mandatory Access Control): system-enforced (SELinux, military classification).
RBAC (Role-Based Access Control): access based on job role.
ABAC (Attribute-Based Access Control): access based on attributes (user, resource, environment).
Linux permissions model is DAC.
RBAC is used in databases and cloud (AWS IAM).
MAC is used when confidentiality is priority (government systems).
Least privilege = grant the minimum permissions required.
Privilege escalation is when a user gains higher-level privileges.
Horizontal privilege escalation = accessing another user's data.
Vertical privilege escalation = gaining admin/root rights.
Linux Permission System
File permissions: read (r), write (w), execute (x).
Permission categories: owner, group, others.
chmod modifies permissions (numeric or symbolic).
chown changes file ownership.
Sticky bit on directories prevents users from deleting other users' files.
SUID bit allows execution with file owner's effective UID.
SGID bit applies group ID during execution.
/etc/sudoers controls delegated root access.
sudo logs commands for accountability.
Authentication Protocols & Advanced Concepts
PAP (Password Authentication Protocol) sends passwords in plaintext.
CHAP uses challenge-response mechanism to avoid cleartext passwords.
Kerberos uses tickets and symmetric cryptography for mutual authentication.
Kerberos relies on a trusted 3rd party: Key Distribution Center (KDC).
Kerberos tickets have expiration times (TGT, TGS).
RADIUS centralizes authentication for networks (Wi-Fi, VPN).
TACACS+ is similar but encrypts full content and used for routers/switches.
OAuth allows third-party login (Login with Google).
SAML is identity federation standard used in enterprises.
OpenID Connect extends OAuth with authentication.
Biometric Authentication
Biometrics rely on physical traits (fingerprints, iris, voice).
FAR (False Acceptance Rate) = unauthorized user accepted.
FRR (False Rejection Rate) = valid user rejected.
Equal Error Rate (EER) = where FAR = FRR; lower is better.
Biometric templates must be securely stored.
Biometrics cannot be "reset"; if stolen, permanently compromised.
Multi-Factor Authentication
MFA resists phishing + password theft.
SMS OTP is vulnerable to SIM swap attacks.
TOTP uses time-based one-time password (Google Authenticator).
Hardware tokens (YubiKey) provide strongest security.
Push-based authentication is more user-friendly.
MFA still fails if device is root-compromised.
Session Security
After logging in, sessions are maintained via cookies or tokens.
Session hijacking occurs when tokens are stolen.
Secure session cookies must use flags: HttpOnly + Secure + SameSite.
Proxy/gateway machine routes traffic between internal machine and internet.
IP forwarding must be enabled (/proc/sys/net/ipv4/ip_forward = 1) for routing.
NAT (Network Address Translation) allows private IP devices to access internet using one public IP.
MASQUERADE makes source IP of outgoing packet appear as external interface IP.
Transparent proxy means internal devices do not know traffic is routed through proxy.
Firewall rules must allow forwarding from internal interface to external.
DNS must be configured correctly for client to resolve domain names through proxy.
Packet forwarding + NAT effectively makes Linux machine act like a router.
VPN, IPSec, and Tunneling
VPNs create encrypted tunnels over public networks.
IPSec operates at Layer 3 (Network Layer).
IPSec modes: Transport mode (encrypts payload only), Tunnel mode (encrypts full IP packet).
ESP (Encapsulating Security Payload) provides confidentiality and integrity.
AH (Authentication Header) provides integrity only.
VPN uses encryption + authentication to create secure remote access.
SSL/TLS VPNs operate at Transport Layer instead of Network Layer.
TLS / HTTPS
HTTPS = HTTP + TLS.
TLS handshake establishes symmetric session keys using asymmetric encryption.
Server sends SSL certificate to client; client verifies using CA public keys.
Certificate must match domain (CN/SAN field).
If certificate signature is invalid or expired, browser warns user.
TLS provides confidentiality, integrity, and authentication.
Uses symmetric encryption after handshake for speed.
Uses HMAC for message integrity.
TLS versions: TLS 1.0, 1.1 (deprecated), 1.2 (widely used), 1.3 (enhanced security & speed).
TLS 1.3 removes RSA key exchange; only ECDHE (provides forward secrecy).
SSH and Secure Access
SSH uses asymmetric encryption to establish secure sessions.
Default port for SSH is 22.
SSH supports password-based and public-key authentication.
Public keys are stored in ~/.ssh/authorized_keys on server side.
SSH commands can be tunneled using port forwarding.
SSH encrypts entire session including passwords.
SSH keys (RSA, Ed25519) are more secure than passwords.
Brute-force SSH attacks can be done via Hydra.
Disabling password login and allowing only key-based login increases SSH security.
SSH config file /etc/ssh/sshd_config controls authentication methods.
TCP/IP Protocol Attacks
TCP 3-way handshake: SYN, SYN-ACK, ACK.
TCP reset attack sends forged RST packet to terminate connection.
Session hijacking takes over established TCP sessions.
Sequence number prediction is used in hijacking.
IP spoofing involves faking source IP in packets.
ARP spoofing poisons ARP tables, redirecting packets to attacker.
DHCP spoofing provides attacker-controlled gateway/DNS settings.
ICMP redirect can alter routing table to send traffic to attacker.
Smurf attack sends ICMP requests to broadcast address with spoofed victim IP.
Ping of Death sends oversized ICMP packets causing buffer overflow.
DNS Security
DNS resolves domain names to IP addresses.
DNS cache poisoning inserts malicious IP into resolver cache.
DNSSEC adds digital signatures to DNS responses.
Recursive DNS resolver fetches answers from authoritative servers.
dig and nslookup are used for DNS troubleshooting.
Attackers can use subdomain enumeration for reconnaissance.
Internal DNS leakage can expose internal hostnames.
Intrusion Detection & Prevention
IDS monitors network/system activity for malicious behavior.
NIDS monitors network traffic; HIDS monitors host-level logs and files.
Signature-based IDS compares traffic to known attack signatures.
Anomaly-based IDS detects unusual deviations from baseline traffic.
IPS (Intrusion Prevention System) can block or drop malicious traffic.
Snort is popular open-source IDS/IPS.
False positive = legitimate traffic flagged as attack.
False negative = missed attack.
Logging, Monitoring, Syslog
Syslog protocol standardizes logging for network devices.
Logs must be tamper-proof for accountability.
Tools like Splunk, ELK stack are used to analyze logs.
/var/log/auth.log in Linux stores authentication events.
/var/log/syslog stores kernel and system messages
Network Segmentation & Hardening
VLANs logically separate networks at Layer 2.
DMZ (Demilitarized Zone) isolates public-facing servers from internal network.
Bastion hosts are hardened systems exposed to public networks.
Network segmentation reduces lateral movement during compromise.
Default deny rule is essential in firewall design.
High Availability and Redundancy
Availability is protected using redundant systems like failover, clustering.
Load balancers distribute requests across multiple servers.
Hot standby means backup system is ready instantly.
Cold standby requires manual activation.
Heartbeat protocols monitor failure and trigger failover.