This blog is here to help those preparing for CompTIA exams. This is designed to help the exam candidate to understand the concepts, rather than trust a brain dump. CHECK OUT THE BLOG INDEXES!!!
CompTIA Security+ Exam Notes

Let Us Help You Pass
Saturday, May 20, 2023
Email-based attacks
Tuesday, May 16, 2023
Wednesday, May 10, 2023
SQL Injection Attack
SQLi
SQLi (SQL
Injection)
·
Server-side attack
·
A query formatted: ‘ or ‘1’=’1’ -- is a SQL injection attack.
·
SELECT * FROM
·
Prevented
by
o Input
validation
o Removing
semi-colons, dashes, quotations, & commas
o Stored
procedures
Saturday, April 22, 2023
XSS (Cross-Site Scripting) Attack
XSS (Cross-Site Scripting)
- Client-side attack
- JavaScript
- HTML iFrame
- URL ends in .js
- Percent encoding %C (<) & %3E (>)
HTTP Strict Transport Security (HSTS): Protecting Your Website with HTTPS
HSTS
HTTP Strict Transport Security (HSTS) is a web security policy mechanism that forces web browsers to interact with a website using only HTTPS (secure HTTP) connections, preventing man-in-the-middle attacks and protocol downgrade attacks. It achieves this by sending a "Strict-Transport-Security" HTTP response header from the server to the browser, instructing it to always use HTTPS for future visits to that site and its subdomains (if specified).
Here's a more detailed explanation:
How HSTS Works:
1. Initial HTTPS Connection: The first time a user accesses a website with HSTS enabled, they must connect using HTTPS, and the server sends back an HSTS header.
2. HSTS Header: The header includes a max-age directive, specifying how long (in seconds) the browser should remember to use HTTPS for that domain. It may also include includeSubDomains to apply the rule to all subdomains, and preload to allow the site to be included in a browser's built-in list of HSTS sites.
3. Browser Enforcement: For the duration specified by max-age, the browser will automatically convert any HTTP requests for that domain (even if typed as HTTP or accessed via an HTTP link) into HTTPS requests before sending them.
4. Preventing Browser Warnings: HSTS also prevents users from bypassing browser warnings about invalid or self-signed certificates, ensuring that secure connections are maintained.
Benefits of HSTS:
Protection against downgrade attacks: HSTS prevents attackers from forcing a browser to use the insecure HTTP protocol, protecting against attacks that try to intercept or manipulate communication.
Protection against cookie hijacking: By enforcing HTTPS, HSTS helps protect sensitive data like session cookies from being intercepted and misused by attackers.
Improved user experience: By automatically upgrading to HTTPS, HSTS eliminates the need for users to manually type "https://" or deal with browser security warnings.
Enhanced security posture: HSTS strengthens the overall security of a website by reducing the attack surface and preventing potential vulnerabilities.
Key Directives:
- max-age: Specifies the duration (in seconds) for which the browser should enforce HTTPS.
- includeSubDomains: Applies the HSTS policy to all subdomains of the domain.
- preload: Allows a website to be included in a browser's built-in list of HSTS websites, ensuring that HTTPS is enforced from the very first visit.
Limitations:
Initial HTTPS requirement: HSTS relies on the user agent receiving the HSTS header during an HTTPS connection, meaning the first connection to the website is still vulnerable.
Potential for site unavailability: If a website is not accessible over HTTPS, users will be unable to access it if they have HSTS enabled.
Complexities with subdomains and CDNs: Configuring HSTS correctly, especially with subdomains and content delivery networks (CDNs), can be complex.
Example Header: Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
This example sets the HSTS policy for one year, includes all subdomains, and allows for preloading.
Friday, September 2, 2022
USB Data Blockers: Safeguarding Your Devices Against Juice Jacking
USB Data Blocker / Prevent Juice Jacking
- USB-A Data Blockers: These have a USB-A socket on one side and a USB-A plug on the other.
- USB-C Data Blockers: These are designed for devices that use USB-C connections.
- Micro-USB Data Blockers: These are less common but still available for devices that use micro-USB connections.
- Security: Protects your device from data theft and malware.
- Portability: Small and easy to carry, making them convenient for travel.
- Ease of Use: Simple to use; just plug it in between your device and the charging port.
- Reduced Charging Speed: Some USB data blockers may slightly reduce the charging speed.
- Compatibility: Not all USB data blockers are compatible with every device or charging port.
Juice Jacking: Understanding the Threat of Public USB Charging
Juice Jacking
- Install Malware: Malicious software can be installed on your device, which can then be used to steal data, track your activities, or even take control of your device.
- Steal Data: Sensitive information such as contacts, emails, photos, and passwords can be copied from your device without your knowledge.
- Data Theft: The attacker copies data from your device while it is charging.
- Malware Installation: The attacker installs malicious software on your device, which can then be used for various nefarious purposes.
- Public Charging Stations: Airports, hotels, and cafes often provide USB charging stations. These can be compromised by attackers to carry out juice-jacking attacks.
- Infected USB Cables: Attackers can distribute infected USB cables that look like regular charging cables but are designed to steal data or install malware.
- Data Theft: Sensitive information can be stolen, leading to identity theft or financial loss.
- Device Compromise: Malware can take control of your device, track your activities, or lock you out of your own device.
- Privacy Invasion: Personal data and activities can be monitored without your consent.
- Use AC Power Outlets: Always prefer using an AC power outlet with your own charger and USB cable.
- Carry a Power Bank: Use a portable power bank to charge your devices on the go.
- Use a USB Data Blocker: A USB data blocker, also known as a "USB condom," prevents data transfer while allowing power to pass through.
- Avoid Public USB Ports: Refrain from using public USB charging stations whenever possible.
- Use Charging-Only Cables: These cables are designed to only transfer power and not data.