The SecOps Group secops-CAP Practice Exams
Last updated on Oct 22,2026- Exam Code: secops-CAP
- Exam Name: Certified AppSec Practitioner Exam
- Certification Provider: The SecOps Group
- Latest update: Oct 22,2026
Null Byte Injection is an active exploitation technique used to bypass sanity-checking filters in web applications by adding a URL-encoded null byte character to the user-supplied data.
Which of the following is a URL-encoded representation of a null byte?
- A . %01
- B . %10
- C . %25
- D . %00
D
Explanation:
Null Byte Injection is a vulnerability where a null byte character ( or ASCII 0) is injected into user-supplied input to manipulate application behavior, often bypassing filters or terminating strings prematurely in languages like C or C++ that rely on null-terminated strings. In web applications, this is typically encoded in URLs using percent-encoding (e.g., %xx, where xx is the hexadecimal value). The ASCII value of a null byte is 0, which is represented as %00 in URL encoding.
Option A ("%01"): Represents the ASCII character with value 1 (Start of Heading), not a null byte.
Option B ("%10"): Represents the ASCII character with value 16 (Data Link Escape), not a null byte.
Option C ("%25"): Represents the % character itself (ASCII 37), not a null byte.
Option D ("%00"): Represents the null byte (ASCII 0), which is the correct URL-encoded form used in Null Byte Injection attacks.
The correct answer is D, aligning with the CAP syllabus under "Injection Attacks" and "Input Validation Bypasses."
Reference: SecOps Group CAP Documents – "Null Byte Injection," "URL Encoding," and "OWASP Injection Prevention" sections.
In the context of the following JWT token, which of the following statements is true?
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.ey
JUYW1I1joiU2vjbB3ZiNo_mn0vNWT4G1-
ATqOTmo7rm70VI12WCdkMI_S1_bPg_G8
- A . The highlighted segment of the token represents a JWT Header.
- B . The highlighted segment of the token represents a JWT Payload.
- C . Both A and B are correct.
- D . None of the above.
B
Explanation:
A JSON Web Token (JWT) consists of three parts separated by dots (.): Header, Payload, and Signature. Each part is Base64Url-encoded.
The given JWT is:
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJUYW1I1joiU2vjbB3ZiNo_mn0vNWT4G1-ATqOTmo7rm70VI12WCdkMI_S1_bPg_G8
The first part (eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9) is the Header, which typically includes metadata like the algorithm (alg) and type (typ). Decoding it gives: {"alg":"HS256","typ":"JWT"}.
The second part (eyJUYW1I1joiU2vjbB3ZiNo_mn0vNWT4G1-ATqOTmo7rm70VI12WCdkMI_S1_bPg_G8) is the Payload, which contains claims (e.g., user data, expiration). The highlighted segment corresponds to this second part, making it the Payload.
Decoding it (though incomplete due to truncation) would reveal claims in JSON format. The third part (not fully shown) would be the Signature, used to verify the token’s integrity. Option A ("The highlighted segment of the token represents a JWT Header"): Incorrect, as the highlighted segment is the second part, which is the Payload.
Option B ("The highlighted segment of the token represents a JWT Payload"): Correct, as the highlighted segment is the Payload portion of the JWT.
Option C ("Both A and B are correct"): Incorrect, as only B is correct.
Option D ("None of the above"): Incorrect, as B is correct.
The correct answer is B, aligning with the CAP syllabus under "JWT Security" and "Token-Based Authentication."
Reference: SecOps Group CAP Documents – "JSON Web Tokens (JWT)," "Authentication Security," and "OWASP JWT Cheat Sheet" sections.
In the screenshot below, an attacker is attempting to exploit which vulnerability?
POST /upload.php HTTP/1.1
Host: example.com
Cookie: session=xyz123;JSESSIONID=abc123
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) rv:107.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Content-Type: multipart/form-data; boundary=—-WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Length: 12345
Connection: keep-alive
Content-Disposition: form-data; name="avatar"; filename="malicious.php"
Content-Type: image/jpeg
<?php
phpinfo();
?>
- A . HTTP Desync Attack
- B . File Path Traversal Attack
- C . File Upload Vulnerability
- D . Server-Side Request Forgery
C
Explanation:
The screenshot shows an HTTP POST request to /upload.php with a multipart/form-data payload, where the attacker uploads a file named malicious.php disguised as an image/jpeg but containing PHP code (<?php phpinfo(); ?>). This indicates an attempt to exploit a File Upload Vulnerability. Such vulnerabilities occur when an application allows users to upload files without proper validation or sanitization, enabling attackers to upload malicious scripts (e.g., PHP) that can be executed on the server. In this case, if the server executes the uploaded malicious.php, it could expose server information via phpinfo() or perform other malicious actions.
Option A ("HTTP Desync Attack") involves manipulating HTTP request pipelines, which is not relevant here as the request appears standard. Option B ("File Path Traversal Attack") involves accessing unauthorized files using ../, which is not evident in this request. Option D ("Server-Side Request Forgery") involves tricking the server into making unintended requests, which does not apply to file uploads. Thus, C is the correct answer, aligning with the CAP syllabus under "File Handling Security" and "OWASP Top 10 (A05:2021 – Security Misconfiguration)."
Reference: SecOps Group CAP Documents – "File Upload Vulnerabilities," "Input Validation," and "OWASP Top 10" sections.
What is the name of the WordPress file that contains the database connection information, including the database name, username, and password?
- A . wp-configuration.php
- B . wp-conf.php
- C . wp-secret.php
- D . wp-config.php
D
Explanation:
In WordPress, the file that stores database connection details, including the database name, username, password, and host, is wp-config.php. This file is located in the root directory of a WordPress installation and is critical for configuring the connection to the MySQL database. It contains constants like DB_NAME, DB_USER, DB_PASSWORD, and DB_HOST, which must be protected from unauthorized access to prevent database compromise.
Option A ("wp-configuration.php"): A common misspelling; the correct file name lacks the extra "ation."
Option B ("wp-conf.php"): This is not a valid WordPress file name.
Option C ("wp-secret.php"): This is not a standard WordPress file.
Option D ("wp-config.php"): The correct and official file name used by WordPress.
The correct answer is D, aligning with the CAP syllabus under "Configuration Management" and "Application Security."
Reference: SecOps Group CAP Documents – "Application Configuration," "WordPress Security," and "Database Security" sections.
In the context of the CORS (Cross-origin resource sharing) misconfiguration, which of the following statements is true?
- A . CORS is exploitable if the value of the HTTP headers are Access-Control-Allow-Origin: * and Access-Control-Allow-Credentials: true
- B . CORS is exploitable if the value of the HTTP headers are Access-Control-Allow-Origin: * and Access-Control-Allow-Credentials: false
- C . CORS is exploitable if the value of the HTTP headers is Access-Control-Allow-Origin: * and the value of the Access-Control-Allow-Credentials header is irrelevant
- D . All of the above
A
Explanation:
CORS (Cross-Origin Resource Sharing) is a mechanism that allows servers to specify which origins can access their resources, enhancing security for cross-origin requests. A common misconfiguration occurs with the Access-Control-Allow-Origin and Access-Control-Allow-Credentials headers. When Access-Control-Allow-Origin is set to * (wildcard, allowing all origins), it permits any domain to make requests. However, if Access-Control-Allow-Credentials is set to true (allowing credentials like cookies or HTTP authentication), this creates a security risk. Browsers will block such requests because sending credentials with a wildcard origin violates CORS security policies, but an attacker could exploit this misconfiguration to trick a victim’s browser into making unauthorized requests if other controls are absent.
Option A is correct because the combination of Access-Control-Allow-Origin: * and Access-Control-Allow-Credentials: true is exploitable, as it enables potential credential leakage or unauthorized access. Option B is incorrect because Access-Control-Allow-Credentials: false disables credential sending, reducing exploitability. Option C is incorrect because the value of Access-Control-Allow-Credentials is not irrelevant; it must be false with a wildcard origin to comply with security standards. Option D ("All of the above") is incorrect as only A holds true. This is a key topic in the CAP syllabus under "CORS Misconfiguration" and "Client-Side Security."
Reference: SecOps Group CAP Documents – "CORS Configuration," "Security Misconfigurations," and "OWASP Secure Headers" sections.
After purchasing an item on an e-commerce website, a user can view his order details by visiting the
URL:
https://example.com/order_id=53870
A security researcher pointed out that by manipulating the order_id value in the URL, a user can view arbitrary orders and sensitive information associated with that order_id.
Which of the following is correct?
- A . The root cause of the problem is a lack of input validation and by implementing a strong whitelisting, the problem can be solved
- B . The root cause of the problem is a weak authorization (Session Management) and by validating a user’s privileges, the issue can be fixed
- C . The problem can be solved by implementing a Web Application Firewall (WAF)
- D . None of the above
B
Explanation:
The scenario describes an e-commerce website where a user can view order details by manipulating the order_id parameter in the URL (e.g., https://example.com/order_id=53870). A security researcher found that changing the order_id allows access to arbitrary orders and sensitive data, indicating an authorization issue. This is not a simple input validation problem (e.g., SQL injection or path traversal), as the input (order_id) is processed, but the system fails to enforce proper access controls. This is a classic case of Insecure Direct Object Reference (IDOR), where an attacker can access resources by guessing or manipulating identifiers without proper authorization checks. The root cause is a weak authorization mechanism, likely tied to poor session management or privilege validation, allowing unauthorized users to view others’ data.
Option A ("The root cause of the problem is a lack of input validation…"): Incorrect, as the issue is not about invalid input (e.g., malicious code) but about unauthorized access to valid data. Whitelisting might help sanitize input, but it doesn’t address authorization.
Option B ("The root cause of the problem is a weak authorization (Session Management)…"): Correct, as the problem stems from inadequate authorization checks. Validating user privileges (e.g., ensuring the user can only access their own orders) or improving session management (e.g., tying orders to user sessions) can fix this IDOR vulnerability.
Option C ("The problem can be solved by implementing a Web Application Firewall (WAF)"): Incorrect as a standalone solution, as WAFs mitigate certain attacks (e.g., SQLi, XSS) but are not a substitute for fixing authorization logic. A WAF might detect patterns but won’t enforce proper access control.
Option D ("None of the above"): Incorrect, as Option B accurately identifies the root cause and solution.
The correct answer is B, aligning with the CAP syllabus under "Authorization and Access Control" and "OWASP Top 10 (A04:2021 – Insecure Design)."
Reference: SecOps Group CAP Documents – "Session Management," "Insecure Direct Object Reference (IDOR)," and "OWASP Top 10" sections.
Which of the following is correct?
- A . The browser contains the private key of all known Certifying Authorities (CA) and based on that, it differentiates between a valid and an invalid TLS Certificate
- B . The browser contains the public key of all known Certifying Authorities (CA) and based on that it is able to differentiate between a valid and an invalid TLS Certificate
- C . The browser contains both the public and private key of all known Certifying Authorities (CA) and based on that it is able to differentiate between a valid and an invalid TLS Certificate
- D . The browser does not have any mechanism to validate the TLS Certificate
B
Explanation:
TLS (Transport Layer Security) certificates are validated by browsers to ensure secure communication. Browsers maintain a trusted store of public keys from known Certifying Authorities (CAs), which are used to verify the digital signature of a TLS certificate presented by a server. This process involves checking the certificate’s signature against the CA’s public key to confirm its authenticity and validity. If the signature matches and other criteria (e.g., expiration, revocation) are met, the certificate is deemed valid.
Option A ("The browser contains the private key…"): Incorrect, as browsers do not contain private keys of CAs; private keys are kept secret by the CAs themselves.
Option B ("The browser contains the public key…"): Correct, as browsers use CA public keys to validate certificates, enabling differentiation between valid and invalid TLS certificates.
Option C ("The browser contains both the public and private key…"): Incorrect, as browsers only store public keys, not private keys, for security reasons.
Option D ("The browser does not have any mechanism…"): Incorrect, as browsers have robust mechanisms (via CA public keys) to validate TLS certificates.
The correct answer is B, aligning with the CAP syllabus under "Secure Communication" and "TLS Configuration."
Reference: SecOps Group CAP Documents – "TLS/SSL Security," "Certificate Validation," and "OWASP Cryptographic Practices" sections.
Determine the primary defense against a SQL injection vulnerability
- A . Using a Web Application Firewall (WAF)
- B . Prepared Statements with Parameterized Queries
- C . Use of NoSQL Database
- D . Blacklisting Single Quote Character (‘)
B
Explanation:
SQL Injection (SQLi) occurs when an attacker injects malicious SQL code into a query by manipulating user input (e.g., ‘ OR ‘1’=’1′), allowing unauthorized data access or manipulation.
Let’s evaluate the defenses:
Option A ("Using a Web Application Firewall (WAF)"): A WAF can detect and block SQL injection attempts by filtering malicious patterns (e.g., ‘ OR ‘1’=’1′), but it is not the primary defense. WAFs can be bypassed with sophisticated attacks (e.g., encoded payloads), and they are a secondary layer, not a fix for the root cause in the application code.
Option B ("Prepared Statements with Parameterized Queries"): Correct. Prepared statements with parameterized queries separate SQL code from user input by using placeholders (e.g., ? in SELECT * FROM users WHERE username = ?). The database engine handles the input as data, not executable code, preventing SQL injection. This is the industry-standard primary defense (recommended by OWASP and NIST) because it addresses the root cause by ensuring user input cannot alter the query structure.
Option C ("Use of NoSQL Database"): Switching to a NoSQL database (e.g., MongoDB) does not inherently prevent injection vulnerabilities. NoSQL databases can still be vulnerable to injection (e.g., MongoDB’s $where operator), and SQL injection applies to relational databases. This is not a defense against SQLi.
Option D ("Blacklisting Single Quote Character (‘)"): Blacklisting specific characters (e.g., ‘) attempts
to block known malicious input, but it is ineffective as a primary defense. Attackers can bypass blacklists using alternate encodings (e.g., %27 for ‘), comments (e.g., –), or other techniques. Blacklisting is reactive and prone to evasion, unlike prepared statements.
The correct answer is B, aligning with the CAP syllabus under "SQL Injection Prevention" and "OWASP Top 10 (A03:2021 – Injection)."
Reference: SecOps Group CAP Documents – "SQL Injection Defense," "Secure Coding Practices," and "OWASP SQL Injection Prevention Cheat Sheet" sections.
What is the full form of SAML?
- A . Security Assertion Markup Language
- B . Security Authorization Markup Language
- C . Security Assertion Management Language
- D . Secure Authentication Markup Language
A
Explanation:
SAML (Security Assertion Markup Language) is an open standard for exchanging authentication and authorization data between parties, particularly in the context of single sign-on (SSO). It is based on XML and is widely used to enable secure web-based authentication and authorization across different domains. The correct full form is Security Assertion Markup Language, where "Assertion" refers to statements about a subject (e.g., identity, attributes), "Markup" indicates the XML-based structure, and "Language" denotes the defined syntax.
Option A ("Security Assertion Markup Language"): This is the correct and official full form of SAML as defined by OASIS (Organization for the Advancement of Structured Information Standards).
Option B ("Security Authorization Markup Language"): Incorrect, as "Authorization" is not part of the acronym; SAML focuses on both authentication and authorization assertions.
Option C ("Security Assertion Management Language"): Incorrect, as "Management" is not part of the acronym; SAML is about markup, not management.
Option D ("Secure Authentication Markup Language"): Incorrect, as "Secure" is not part of the acronym, and SAML covers more than just authentication.
The correct answer is A, aligning with the CAP syllabus under "Authentication and Authorization" and "Single Sign-On (SSO) Standards."
Reference: SecOps Group CAP Documents – "SAML Overview," "Authentication Protocols," and "OWASP Identity Management" sections.
Based on the screenshot above, which of the following is the most true?
Screenshot
![Login Form]
coder@viewer
User does not exist
[Password field]
Forget password?
[Login button]
Not yet member? Sign now
- A . The application is vulnerable to username enumeration
- B . The application is vulnerable to brute-force attacks
- C . The application does not enforce a strong password policy
- D . None of the above
A
Explanation:
The screenshot shows a login form where the user coder@viewer attempts to log in, and the application responds with "User does not exist." Let’s evaluate the statements:
Option A ("The application is vulnerable to username enumeration"): Correct. Username enumeration occurs when an application reveals whether a username exists in the system, often through distinct error messages. Here, the message "User does not exist" for coder@viewer directly indicates that the username is invalid, allowing an attacker to enumerate valid usernames by testing different inputs and observing the responses (e.g., "Invalid password" for existing users vs. "User does not exist"). Best practice is to use generic error messages like "Invalid username or password" to prevent enumeration.
Option B ("The application is vulnerable to brute-force attacks"): Incorrect. There’s no evidence in the screenshot of a lack of brute-force protections (e.g., rate limiting, account lockout). Brute-force vulnerability would require additional context, such as no CAPTCHA or no lockout mechanism, which is not shown.
Option C ("The application does not enforce a strong password policy"): Incorrect. The screenshot does not provide information about password requirements (e.g., length, complexity), so we cannot conclude whether a strong password policy is enforced. Option D ("None of the above"): Incorrect, as A is true.
The correct answer is A, aligning with the CAP syllabus under "Username Enumeration" and "Authentication Security."
Reference: SecOps Group CAP Documents – "Authentication Best Practices," "Enumeration Attacks," and "OWASP Authentication Cheat Sheet" sections.