CC536 Cyber Security: Web Attacks and SQL Injection
16 Questions
5 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

What is the primary function of a web browser?

  • To interface with the client
  • To request a resource and render it for the user (correct)
  • To keep 'state' using session cookies
  • To transmit resources to the client

What is the purpose of session cookies in a web application?

  • To transmit resources to the client
  • To render dynamic content
  • To keep 'state' in a stateless communication (correct)
  • To interface with the client

What is the main difference between stateless and stateful communication?

  • Stateless communication does not retain user information (correct)
  • Stateless communication retains user information
  • Stateful communication uses session cookies
  • Stateless communication uses session cookies

What is the purpose of SQL queries?

<p>To ask questions to the database (D)</p> Signup and view all the answers

What is the potential risk of using user input in SQL queries?

<p>It may allow an attacker to change the meaning of the query (A)</p> Signup and view all the answers

What would happen if the 'user' variable in the given PHP code is a malicious string?

<p>The query would change the meaning of the query (D)</p> Signup and view all the answers

What is the main vulnerability exploited in SQL injection attacks?

<p>Unsanitized user input in SQL queries (C)</p> Signup and view all the answers

What is the purpose of input validation in preventing SQL injection?

<p>To prevent malicious code from being executed (C)</p> Signup and view all the answers

What is the result of injecting NULL UNION SELECT * FROM users in an SQL query?

<p>The query returns the full list of users in the database (C)</p> Signup and view all the answers

What is the purpose of using comments in SQL injection attacks?

<p>To discard remaining clauses of the query (C)</p> Signup and view all the answers

How can an attacker bypass string escaping in an SQL query?

<p>By adding two single quotes at the end of the input (A)</p> Signup and view all the answers

What is the effect of injecting anything' = ' in an SQL query?

<p>The query always evaluates to TRUE (D)</p> Signup and view all the answers

What is the recommended approach to preventing SQL injection attacks?

<p>Whitelisting known good characters (A)</p> Signup and view all the answers

What is the purpose of input filtering in preventing SQL injection?

<p>To sanitize user input and prevent code injection (D)</p> Signup and view all the answers

What is the result of injecting ’; DROP TABLE USERS; -- in an SQL query?

<p>The query deletes the USERS table (C)</p> Signup and view all the answers

What is the primary difference between SQL injection and command injection?

<p>SQL injection targets databases, while command injection targets operating systems (C)</p> Signup and view all the answers

More Like This

Web Security Quiz on SQL Injection
1 questions

Web Security Quiz on SQL Injection

RevolutionaryDiscernment484 avatar
RevolutionaryDiscernment484
Web Security Vulnerabilities Quiz
38 questions
Use Quizgecko on...
Browser
Browser