Sample questions
Question 1Easy
- A government cyber police force
- An antivirus brand
- A web security community
- A cloud provider
Answer: C. A web security community
Explanation
The Open Worldwide Application Security Project publishes free guides and tools such as the Top 10.
Step-by-step solution
- OWASP stands for the Open Worldwide Application Security Project.
- It is a community that publishes free security guides and tools.
- The OWASP Top 10 is a well-known list.
- So OWASP is a web security community.
Why the other options are wrong
- A. OWASP is not a government police force.
- B. OWASP is not an antivirus brand.
- D. OWASP is not a cloud provider.
Tip: OWASP = open web security community; the Top 10 is its best-known list.
Question 2Easy
Which attack involves inserting malicious database commands through input fields?
- Phishing
- Clickjacking
- Tailgating
- SQL injection
Answer: D. SQL injection
Explanation
SQL injection manipulates database queries using crafted input.
Step-by-step solution
- The attack puts database commands into input fields.
- The application then runs them as part of a query.
- This is SQL injection.
- So the answer is SQL injection.
Why the other options are wrong
- A. Phishing tricks people into giving secrets through fake messages.
- B. Clickjacking hides a UI element under a visible one.
- C. Tailgating is physically following someone through a secure door.
Tip: Use parameterised queries to stop SQL injection.
Question 3Easy
Cross-Site Scripting (XSS) allows an attacker to:
- Read the server's source code directly
- Change the database schema
- Run malicious JavaScript in other users' browsers
- Overload the network
Answer: C. Run malicious JavaScript in other users' browsers
Explanation
XSS injects scripts into pages viewed by victims, which can steal cookies or perform actions as them.
Step-by-step solution
- XSS injects a script into a page.
- The script runs in the browser of other users who view the page.
- So it runs malicious JavaScript in other users' browsers: option C.
Why the other options are wrong
- A. XSS does not let an attacker read the server's source code.
- B. XSS does not change the database schema.
- D. XSS is a browser-side attack, not a network flood.
Tip: XSS runs in the victim's browser.
Question 4Easy
SQL injection occurs when:
- User input is executed as part of a database query
- The database server runs out of memory
- A user forgets their password
- Tables are not normalised
Answer: A. User input is executed as part of a database query
Explanation
Unsanitised input concatenated into SQL lets attackers change the query's logic.
Step-by-step solution
- SQL injection happens when input becomes part of an SQL query.
- The attacker's text changes the query's logic.
- So user input is executed as part of a database query: option A.
Why the other options are wrong
- B. Running out of memory is a resource problem, not injection.
- C. A forgotten password is not an injection.
- D. Table normalisation is a design topic, not an attack.
Tip: SQL injection = input that is treated as code in a query.
Question 5Medium
Which type of XSS is permanently saved on the server (e.g. in a comment) and served to every visitor?
- Blind SQLi
- Reflected XSS
- DOM-based XSS
- Stored XSS
Answer: D. Stored XSS
Explanation
Stored (persistent) XSS affects every user who views the infected content.
Step-by-step solution
- The script is saved on the server, for example in a comment.
- It is served to every visitor who views that content.
- That is stored XSS: option D.
Why the other options are wrong
- A. Blind SQL injection is an SQL attack, not an XSS type.
- B. Reflected XSS is not saved; it comes back in one response.
- C. DOM-based XSS happens in the browser's code, not saved on the server.
Tip: Stored = saved on the server; reflected = in the link; DOM = in the page script.
Question 6Medium
"Security misconfiguration" includes:
- Using parameterised queries
- Enabling MFA
- Unchanged default passwords
- Encrypting backups
Answer: C. Unchanged default passwords
Explanation
Unchanged defaults, open admin consoles and detailed stack traces are common misconfigurations.
Step-by-step solution
- Security misconfiguration means settings that are weak or left at defaults.
- Unchanged default passwords are a common example.
- So unchanged default passwords are a misconfiguration: option C.
Why the other options are wrong
- A. Parameterised queries are a defence, not a misconfiguration.
- B. Enabling MFA is a security improvement, not a misconfiguration.
- D. Encrypting backups is a good control, not a misconfiguration.
Tip: Change default credentials and turn off debug and admin features in production.
Question 7Medium
Clickjacking tricks users by:
- Recording every keystroke the user types
- Injecting SQL statements into URL parameters
- Hiding a frame under the user's click
- Flooding the server with fake requests
Answer: C. Hiding a frame under the user's click
Explanation
Defend with the frame-ancestors directive in Content-Security-Policy or the X-Frame-Options header.
Step-by-step solution
- The attacker loads the real site in a transparent frame.
- A decoy page lies above it.
- The user clicks the visible page but actually clicks the hidden frame.
Why the other options are wrong
- A. That is keylogging.
- B. That is SQL injection.
- D. That is a DoS flood.
Question 8Medium
Cross-Site Request Forgery (CSRF) tricks a victim's browser into:
- Revealing its saved passwords
- Running JavaScript from another domain
- Downloading a virus
- Sending a forged request
Answer: D. Sending a forged request
Explanation
Because browsers attach cookies automatically, a malicious page can trigger authenticated actions.
Step-by-step solution
- CSRF makes the victim's browser send a request the victim did not intend.
- The browser attaches the session cookie automatically.
- So CSRF tricks the browser into sending a forged request: option D.
Why the other options are wrong
- A. CSRF does not reveal saved passwords.
- B. Running JavaScript from another domain describes XSS or cross-origin attacks, not CSRF.
- C. Downloading a virus is malware, not CSRF.
Tip: CSRF relies on the browser sending cookies automatically.
Question 9Hard
Server-Side Request Forgery (SSRF) lets an attacker:
- Run scripts in a victim's browser
- Forge a user's signature
- Guess passwords faster
- Make the server fetch chosen URLs
Answer: D. Make the server fetch chosen URLs
Explanation
SSRF can reach internal services or cloud metadata endpoints that are not exposed to the internet.
Step-by-step solution
- SSRF tricks the server into making requests.
- The attacker chooses the URL the server fetches.
- This can reach internal services that are not exposed: option D.
Why the other options are wrong
- A. Running scripts in a victim's browser is XSS, not SSRF.
- B. Forging a user's signature is a different attack on signatures.
- C. Guessing passwords faster is a brute-force idea, not SSRF.
Tip: SSRF = the server is used to fetch what the attacker picks; block internal and metadata addresses.
Question 10Hard
A user changes /invoice?id=1001 to id=1002 in the URL and sees another customer's invoice. This is an example of:
- SQL injection
- Cross-site scripting
- Clickjacking
- Insecure direct object reference
Answer: D. Insecure direct object reference
Explanation
IDOR is a broken access control flaw: the server does not check that the object belongs to the requester.
Step-by-step solution
- The URL contains an object identifier, id=1001.
- Changing it to 1002 shows another customer's invoice, so the server does not check ownership.
- This is an insecure direct object reference: option D.
Why the other options are wrong
- A. SQL injection changes a query with input; here only the ID changes.
- B. Cross-site scripting injects a script, which is not happening here.
- C. Clickjacking tricks a user into clicking hidden content.
Tip: IDOR: always check that the requested object belongs to the user.
Practise all 31 questions free
The full question bank with timed practice, progress tracking and Vidya, your AI tutor. Free, no ads.
Open this topic in the app →