




















































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





















































































Question 1. Which Google dork would be most effective for locating publicly exposed configuration files that end with the extension “.env”? A) intitle:index.of “.env” B) inurl:admin “.env” C) filetype:env “config” D) ext:env “password” Answer: D Explanation: The ext: operator searches for files with a specific extension. Combining it with a keyword like “password” narrows results to .env files that likely contain credentials. Question 2. When performing passive DNS enumeration, which record type is most useful for discovering subdomains that are used for mail services? A) A B) MX C) TXT D) CNAME Answer: B Explanation: MX records specify mail exchange servers and often include hostnames of subdomains, revealing additional sub‑domains not listed elsewhere. Question 3. The Wayback Machine can help an attacker identify which of the following? A) Real‑time API keys B) Historical admin panel URLs that may no longer be protected C) Current SSL certificate details D) Open ports on the target host Answer: B
Explanation: The Wayback Machine archives snapshots of web pages, allowing attackers to see old URLs such as admin panels that may have been removed or re‑secured later. Question 4. Which tool is primarily used to fingerprint the web technologies (e.g., CMS, JavaScript libraries) of a target website? A) Nmap B) Wappalyzer C) Burp Suite Intruder D) Metasploit auxiliary/scanner/http/http_version Answer: B Explanation: Wappalyzer analyses HTTP responses and page content to identify the underlying technologies and versions. Question 5. In directory brute‑forcing, which of the following payload formats is most likely to bypass a basic “/admin/” path filter? A) admin/.. B) admin%2F C) admin/. D) admin/.%2e%2e/ Answer: D Explanation: URL‑encoded path traversal (%2e%2e) can bypass simple string checks that only look for “admin/”. Question 6. Which Nmap scan type is best suited for discovering services on a target without completing a full TCP handshake? A) SYN scan (-sS) B) UDP scan (-sU) C) TCP connect scan (-sT)
A) ; cat /etc/passwd B) <script>alert(1)</script> C) ../etc/passwd D) ?id=1 Answer: A Explanation: The semicolon terminates the original command and injects a new command (cat /etc/passwd), typical of command injection. Question 10. Which of the following PHP functions, when misused, is a classic example of code injection vulnerability? A) strlen() B) eval() C) array_push() D) htmlspecialchars() Answer: B Explanation: eval() executes a string as PHP code; if user input reaches it without sanitization, arbitrary code execution is possible. Question 11. An attacker wants to read /etc/passwd via an XXE vulnerability. Which XML entity definition should they use? A) <!ENTITY xxe SYSTEM "file:///etc/passwd"> B) <!ENTITY xxe SYSTEM "http://attacker.com/xxe"> C) <!ENTITY xxe PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "file:///etc/passwd"> D) <!ENTITY xxe SYSTEM "ldap://example.com"> Answer: A Explanation: The SYSTEM identifier with a file:// URI tells the parser to load the local file, enabling the XXE to retrieve its contents.
Question 12. Which technique allows an attacker to exploit an XXE vulnerability to perform a Server‑Side Request Forgery (SSRF) against an internal service? A) Using a <!ENTITY> that points to http://169.254.169.254/latest/meta-data/ B) Injecting a JavaScript payload in the XML C) Changing the XML encoding to UTF‑ 16 D) Adding a CDATA section with a URL Answer: A Explanation: The internal metadata service URL is only reachable from the server; an XXE that references it causes the server to make the request, achieving SSRF. Question 13. When testing for reflected XSS, which of the following payloads is most likely to bypass a basic HTML‑entity encoder that only converts < and >? A) <script>alert(1)</script> B) <script>alert(1)</script> C) "><svg/onload=alert(1)> D) <script>alert(1)</script> Answer: C Explanation: The payload uses an attribute injection (onload) within a tag that does not require < or > to be encoded, bypassing simple entity encoders. Question 14. Which of the following is a reliable method to store a malicious payload for a stored XSS attack in a forum comment field? A) "><img src=x onerror=alert(1)> B) <img src=x onerror=alert(1)> C) <%-- comment --%> D) {{7*7}}
C) Changing the alg to “none” D) Using a JWT “kid” injection to load a public key Answer: A Explanation: A secret of “password” is trivially guessable; an attacker can brute‑force the HMAC key and forge valid tokens. Question 18. In an IDOR scenario, which change to the request is typically sufficient to access another user’s data? A) Modifying the HTTP method from GET to POST B) Changing the value of a numeric identifier parameter (e.g., user_id=5) C) Adding a custom header X-Admin: true D) Encrypting the request body with a different key Answer: B Explanation: IDOR vulnerabilities arise when the server trusts a user‑supplied identifier without proper authorization checks; altering the ID reveals other users’ data. Question 19. Which of the following best describes a vertical privilege escalation attack? A) Accessing another user’s data at the same privilege level B) Escalating from a normal user to an administrator role C) Manipulating timestamps to bypass rate limits D) Using a race condition to duplicate a coupon code Answer: B Explanation: Vertical escalation moves a user to a higher privilege tier (e.g., user → admin), whereas horizontal moves within the same level. Question 20. An application validates JWT signatures using a public RSA key but accepts the alg value supplied in the token. What vulnerability does this present?
A) Signature stripping B) Algorithm confusion (accepting “HS256” with the public key) C) Token replay D) Header injection Answer: B Explanation: If the server uses the same key for both RSA and HMAC algorithms, an attacker can switch alg to “HS256” and sign the token with the public key, which is known, bypassing verification. Question 21. Which of the following is a characteristic of a blind SSRF vulnerability? A) The attacker receives immediate HTTP response bodies B) The attacker must rely on out‑of‑band (OOB) channels to observe the effect C) The vulnerable parameter only accepts internal IP addresses D) The server returns a 302 redirect to the attacker’s URL Answer: B Explanation: Blind SSRF does not return response data to the attacker; they must use OOB techniques (e.g., DNS callbacks) to infer success. Question 22. When attempting to exploit an internal Redis instance via SSRF, which command is most useful for retrieving the configuration file path? A) CONFIG GET dir B) INFO SERVER C) GET * D) SET key value Answer: A Explanation: CONFIG GET dir returns the directory where Redis stores its data files, which can be leveraged for further exploitation.
Answer: A Explanation: By issuing concurrent requests, the attacker can bypass the decrement check, allowing the coupon to be used multiple times. Question 26. Which of the following is a typical sign of a weak TLS cipher suite configuration? A) Only TLS 1.3 is enabled B) Use of ECDHE-RSA-AES256-GCM-SHA384 C) Support for TLS_RSA_WITH_3DES_EDE_CBC_SHA D) Preference for forward‑secrecy ciphers Answer: C Explanation: TLS_RSA_WITH_3DES_EDE_CBC_SHA is an outdated suite lacking forward secrecy and is considered weak. Question 27. An HTTPS website is missing the Strict-Transport-Security header. Which risk does this expose the site to? A) Man‑in‑the‑middle downgrade attacks via HTTP B) Certificate pinning bypasses C) Clickjacking attacks D) DNS cache poisoning Answer: A Explanation: Without HSTS, browsers may accept HTTP connections and are vulnerable to downgrade attacks that strip TLS. Question 28. When assessing a cloud environment, which S3 bucket permission would indicate a critical misconfiguration? A) ListBucket denied for all users B) PutObject allowed for AuthenticatedUsers only
C) GetObject allowed for Everyone (*) D) DeleteObject allowed for the bucket owner only Answer: C Explanation: Public read (GetObject) for everyone exposes all bucket contents to the internet, a severe misconfiguration. Question 29. Which IAM policy statement is most likely to grant overly permissive access in AWS? A) "Effect": "Allow", "Action": "s3:GetObject", "Resource": "arn:aws:s3:::mybucket/*" B) "Effect": "Allow", "Action": "*", "Resource": "*" C) "Effect": "Deny", "Action": "ec2:TerminateInstances", "Resource": "*" D) "Effect": "Allow", "Action": ["dynamodb:Query"], "Resource": "arn:aws:dynamodb:us-east- 1:123456789012:table/Orders" Answer: B Explanation: Allowing all actions on all resources ("*" for both) gives the principal unrestricted control over the entire AWS account. Question 30. Which security header helps mitigate MIME‑type sniffing attacks? A) X-Frame-Options B) X-Content-Type-Options: nosniff C) Content-Security-Policy D) Referrer-Policy Answer: B Explanation: X-Content-Type-Options: nosniff tells browsers not to guess the MIME type, preventing execution of malicious files disguised as benign types. Question 31. A web application returns detailed stack traces in HTTP responses. Which OWASP security control addresses this issue?
Question 34. An attacker wants to enumerate hidden directories by leveraging the robots.txt file. Which statement is true? A) robots.txt is only used for SEO and never contains useful paths. B) It can list disallowed paths that may correspond to admin or backup directories. C) Modern browsers block access to robots.txt. D) The file is always encrypted. Answer: B Explanation: Developers often list sensitive directories in robots.txt to prevent indexing, inadvertently exposing them to attackers. Question 35. Which of the following is a typical sign that a web application is vulnerable to path traversal via a file parameter? A) The server returns HTTP 404 for any unknown file. B) Supplying ../../../../etc/passwd returns the contents of the password file. C) The application only accepts files with a .txt extension. D) The parameter is validated using a whitelist of allowed filenames. Answer: B Explanation: Successful retrieval of /etc/passwd after sending a traversal payload demonstrates a path traversal vulnerability. Question 36. In a CSRF attack, which of the following conditions must be true for the attack to succeed? A) The victim must be logged into the target site and the request must include the victim’s authentication cookies. B) The attacker must know the victim’s password. C) The target site must have no SSL/TLS. D) The attacker must have admin privileges on the target site. Answer: A
Explanation: CSRF exploits the browser’s automatic inclusion of authentication cookies when the victim visits a malicious page. Question 37. Which of the following HTTP status codes is most commonly returned by a web application when an IDOR attempt is blocked by proper authorization checks? A) 200 OK B) 302 Found C) 403 Forbidden D) 404 Not Found Answer: C Explanation: A 403 response indicates that the server understood the request but refuses to authorize it, typical for enforced access controls. Question 38. Which of the following is an effective mitigation against time‑based blind SQL injection? A) Disabling error messages only B) Using prepared statements with parameterized queries C) Enabling verbose debugging in production D) Limiting the length of input fields Answer: B Explanation: Parameterized queries separate code from data, preventing the interpreter from executing injected SQL regardless of timing techniques. Question 39. A web application uses the eval() function on data received from a query string parameter code. Which mitigation should be applied? A) Encode the output with htmlspecialchars() B) Replace eval() with a safe parsing library or whitelist allowed commands C) Increase the PHP max_execution_time
Answer: D Explanation: PUT is intended for uploading or replacing resources; if not properly authorized, it can modify data. Question 43. In the context of business logic flaws, which scenario illustrates a “price manipulation” vulnerability? A) Changing a hidden price field from $10 to $1 in a checkout form and completing the purchase. B) Submitting a malformed credit‑card number. C) Injecting JavaScript into a product description. D) Using a known admin account to delete a product. Answer: A Explanation: Allowing client‑side modification of price fields without server‑side verification enables the attacker to purchase items at a reduced cost. Question 44. Which of the following is a reliable indicator that an application is vulnerable to insecure direct object reference (IDOR) in its REST API? A) The API returns a generic “Invalid request” message for all IDs. B) Changing the order_id in the JSON payload returns a different user’s order details. C) The API requires an OAuth token for every request. D) The endpoint uses HTTPS. Answer: B Explanation: Successful retrieval of another user’s order by altering the identifier demonstrates an IDOR flaw.
Question 45. Which of the following cloud metadata services is commonly targeted in SSRF attacks against AWS EC2 instances? A) http://metadata.google.internal/ B) http://169.254.169.254/latest/meta-data/ C) http://metadata.azure.com/ D) http://metadata.digitalocean.com/ Answer: B Explanation: AWS exposes instance metadata at the link‑local address 169.254.169.254; SSRF can be used to retrieve credentials. Question 46. Which of the following is a primary reason why enabling TLS 1.0 is considered insecure? A) It does not support forward secrecy. B) It requires large key sizes. C) It is vulnerable to POODLE attacks. D) It uses RC4 as the only cipher. Answer: A Explanation: TLS 1.0 lacks built‑in forward secrecy and does not support modern, secure cipher suites, making it vulnerable to downgrade attacks. Question 47. A penetration tester discovers that a web application returns the following header: Server: Apache/2.4.1 (Unix). Which security recommendation directly addresses this disclosure? A) Enable HTTP Strict Transport Security. B) Remove or obscure the Server header via server configuration. C) Upgrade to Apache 2.6. D) Enable TLS 1.3. Answer: B
D) Replace <script> with <svg/onload=alert(1)> Answer: D Explanation: Replacing the blocked tag with an alternative vector that still executes JavaScript evades simple pattern‑based WAF rules. Question 51. An attacker discovers that a web application uses the following PHP code to include files: include($_GET['page']. '.php');. Which mitigation will best prevent file inclusion attacks? A) Append .php after sanitizing the user input. B) Use a whitelist of allowed page names and map them to file paths. C) Disable allow_url_include in php.ini. D) Encode the output with htmlspecialchars(). Answer: B Explanation: A whitelist ensures only intended files can be included, eliminating arbitrary file inclusion. Question 52. Which of the following is a common indicator of a vulnerable XML parser that can be exploited for XXE? A) The parser validates XML against an XSD schema. B) The parser has external entity processing enabled (externalEntityReferences). C) The parser uses a streaming API (StAX). D) The parser rejects documents larger than 1 MB. Answer: B Explanation: Allowing external entity resolution is the core condition that enables XXE attacks. Question 53. Which of the following AWS S3 bucket policies would prevent public read access while still allowing the bucket owner to read objects? A) "Effect":"Allow","Principal":"*","Action":"s3:GetObject","Resource":"arn:aws:s3:::bucket/*"
B) "Effect":"Deny","Principal":"*","Action":"s3:GetObject","Resource":"arn:aws:s3:::bucket/*" C) "Effect":"Allow","Principal":{"AWS":"arn:aws:iam::account- id:root"},"Action":"s3:GetObject","Resource":"arn:aws:s3:::bucket/*" D) "Effect":"Allow","Principal":"*","Action":"s3:PutObject","Resource":"arn:aws:s3:::bucket/*" Answer: C Explanation: Granting GetObject only to the bucket owner’s root ARN restricts public reads while preserving owner access. Question 54. Which of the following is the most effective way to mitigate a reflected XSS vulnerability in a web application? A) Encode all user‑supplied data before inserting it into HTML context. B) Use a content security policy that blocks all scripts. C) Disable JavaScript in the browser. D) Change the HTTP method from GET to POST. Answer: A Explanation: Proper output encoding (HTML entity encoding) neutralizes malicious scripts before they are rendered by the browser. Question 55. An API endpoint validates a JWT token’s signature using a hard‑coded secret “secret”. Which of the following attacks is most feasible? A) Changing the token’s alg to “none”. B) Brute‑forcing the secret to forge a valid token. C) Using a JWK URL to supply a new key. D) Replaying an old token. Answer: B Explanation: A predictable secret like “secret” can be quickly brute‑forced, allowing the attacker to generate valid signatures.