Unit 5: Session Hijacking, Web Servers and Applications, SQL Injection - Practice Quiz

INT244 — Securing Computing Systems 50 Questions
0 Correct 0 Wrong 50 Left
0/50

1 What is the primary definition of Session Hijacking?

A. Unauthorized encrypted communication between two servers
B. Crashing a web server by sending too many requests
C. The exploitation of a valid computer session to gain unauthorized access to information or services
D. Phishing a user to obtain their login credentials via email

2 Which of the following is a key difference between Session Hijacking and IP Spoofing?

A. Session Hijacking takes over an ongoing authenticated session; IP Spoofing creates unauthorized packets with a false source IP
B. There is no difference; they are synonymous
C. IP Spoofing takes over an active session; Hijacking initiates a new one
D. Session Hijacking only works on UDP; IP Spoofing works on TCP

3 In the context of TCP Session Hijacking, what must an attacker successfully predict to inject packets?

A. The User ID
B. The MAC address
C. The Sequence Number (SEQ)
D. The DNS server IP

4 What is 'Session Fixation'?

A. An attack where the attacker fixes the server errors
B. A defense mechanism to keep sessions stable
C. A method of fixing a static IP address to a session
D. An attack where the attacker sets a user's session ID to one known to the attacker before the user logs in

5 Which attack vector is commonly used to steal Session IDs stored in cookies?

A. Cross-Site Scripting (XSS)
B. Ping of Death
C. SQL Injection
D. Buffer Overflow

6 Which of the following acts as a countermeasure against Session Hijacking by encrypting data in transit?

A. Using simple HTTP
B. Disabling cookies
C. Using Telnet
D. Using SSL/TLS (HTTPS)

7 What is the purpose of the 'HttpOnly' flag in a Set-Cookie header?

A. To allow the cookie to be shared across different domains
B. To prevent client-side scripts (like JavaScript) from accessing the cookie
C. To ensure the cookie expires immediately
D. To ensure the cookie is only sent over HTTP, not HTTPS

8 In a Man-in-the-Middle (MITM) attack used for session hijacking, what tool is often used to manipulate the ARP cache?

A. ARP Spoofing/Poisoning
B. Nmap
C. Ping
D. Traceroute

9 Passive Session Hijacking involves:

A. Resetting the connection
B. Monitoring and capturing traffic without altering it
C. Injecting malicious packets into the stream
D. Crashing the server

10 A good defensive strategy regarding Session IDs after a successful login is to:

A. Keep the same Session ID used before login
B. Regenerate a new Session ID
C. Make the Session ID static for 24 hours
D. Use the user's username as the Session ID

11 In the Client-Server relationship, which entity is responsible for initiating the request?

A. Client
B. Firewall
C. Server
D. Database

12 Which HTTP method is generally considered less secure for transmitting sensitive data because parameters are shown in the URL?

A. CONNECT
B. GET
C. POST
D. HEAD

13 What is 'Directory Traversal' in the context of web server vulnerabilities?

A. Indexing the website on a search engine
B. Moving files from one folder to another
C. Accessing files outside the web root folder by manipulating input (e.g., ../)
D. Traversing the network topology

14 Which of the following is a common vulnerability where a web application fails to properly filter user input before sending it to a database?

A. DNS Spoofing
B. Session Timeout
C. SQL Injection
D. Denial of Service

15 Web Parameter Tampering involves:

A. Changing the physical server hardware
B. Updating the web browser version
C. Deleting web server logs
D. Modifying data within form fields, URLs, or cookies to manipulate application behavior

16 Which tool is commonly used for vulnerability scanning of web applications?

A. Windows Media Player
B. Microsoft Word
C. Photoshop
D. Nikto or OWASP ZAP

17 Why are hidden form fields dangerous if not validated by the server?

A. They make the HTML code messy
B. Users can view source, modify the hidden values, and submit them
C. They slow down the website
D. They cannot be seen by the browser

18 What does SQL stand for?

A. Simple Query Logic
B. Standard Query List
C. Structured Query Language
D. Structured Question Language

19 The core root cause of SQL Injection vulnerabilities is:

A. Using a firewall
B. The web server is running Linux
C. The database is too slow
D. Trusting user input and mixing code with data

20 In a SQL Injection attack, what is the significance of the single quote (') character?

A. It is used to delimit strings; inserting it can break the query structure
B. It encrypts the password
C. It starts a comment
D. It deletes the database

21 What does the injection OR 1=1 typically achieve in a login bypass attack?

A. It sets the password to 1
B. It deletes the user account
C. It creates a condition that is always true, bypassing the password check
D. It causes a syntax error

22 Which SQL comment symbol is often used to ignore the remainder of the original query in MySQL?

A. <!-- -->
B. //
C. # or --
D. %%

23 What is 'Blind SQL Injection'?

A. An attack where the attacker cannot see the screen
B. An attack using invisible ink
C. An attack where the database is offline
D. An attack where the database does not return data/errors to the screen, so the attacker infers data based on server behavior

24 Which SQL command is most dangerous regarding data loss if injected successfully?

A. INSERT
B. SELECT
C. UNION
D. DROP TABLE

25 What is a UNION-based SQL injection?

A. Injecting into the Union Bank website
B. Joining two databases physically
C. Using the UNION operator to combine the results of the original query with the results of an injected query
D. Creating a labor union for DBAs

26 What is the most effective defense against SQL Injection?

A. Input Sanitization only
B. Hiding the database name
C. Using complex passwords
D. Parameterized Queries (Prepared Statements)

27 How does 'Error-based SQL Injection' help an attacker?

A. It fixes errors in the code
B. It crashes the server immediately
C. It provides details about the database structure via verbose error messages
D. It creates a backup of the database

28 Which technique allows an attacker to evade basic pattern-matching detection systems (IDS) during SQL injection?

A. URL Encoding or Hex Encoding
B. Sending the query via email
C. Writing the query in capital letters
D. Using a faster internet connection

29 What is the 'Principle of Least Privilege' in the context of database security?

A. Giving every user admin rights
B. Ensuring the database application connects with an account that has only the minimum necessary permissions
C. Using the oldest version of SQL
D. Blocking all users from the database

30 What is the role of a Web Application Firewall (WAF) regarding SQL Injection?

A. It encrypts the database
B. It inspects incoming HTTP traffic and blocks patterns that look like SQL injection attacks
C. It fixes the code automatically
D. It creates user backups

31 When testing for SQL injection, what is 'Fuzzing'?

A. Downloading the database
B. Sending random, invalid, or unexpected data to inputs to see how the application reacts
C. Encrypting the connection
D. Cleaning the screen

32 Which of the following represents a 'Time-based' Blind SQL Injection?

A. DROP TABLE Users
B. SELECT * FROM Users
C. UNION ALL SELECT
D. WAITFOR DELAY '0:0:10'

33 In a web application, what is Input Validation?

A. Validating that the keyboard is connected
B. Checking if the user is an admin
C. Validating the server license
D. Ensuring input data meets expected criteria (type, length, format) before processing

34 What is the danger of enabling 'xp_cmdshell' in MS SQL Server?

A. It slows down queries
B. It changes the language to Spanish
C. It allows the execution of Operating System commands via SQL
D. It prevents tables from being created

35 Which character is often used to chain multiple SQL queries together in a single injection (Stacking Queries)?

A. Colon (:)
B. Period (.)
C. Comma (,)
D. Semicolon (;)

36 What is Whitespace Manipulation in the context of evading SQLi detection?

A. Deleting all spaces in the code
B. Using a larger monitor
C. Replacing spaces with other whitespace characters (like tabs or newlines) to bypass filters
D. Adding spaces to make the website look better

37 Which of the following is an example of an 'In-band' SQL Injection?

A. The data is retrieved using the same channel (e.g., displayed on the webpage)
B. The attack is performed over the phone
C. The attacker uses a different channel to retrieve data
D. The attack relies solely on time delays

38 What is a 'stored' SQL injection?

A. The malicious code is permanently stored in the database (e.g., in a forum post) and executes later
B. The code is stored in the browser cache
C. The injection only happens once
D. The injection is stored on a USB drive

39 To secure cookies against session hijacking, the 'Secure' flag should be set to:

A. Ensure cookies are sent only over encrypted (HTTPS) connections
B. Allow the cookie on HTTP only
C. Encrypt the cookie content with ROT13
D. Make the cookie invisible

40 Which of these is NOT a valid method to test for SQL Injection?

A. Running a vulnerability scanner
B. Inputting 1=1 logic
C. Physical inspection of the server hard drive
D. Inputting a single quote into a search box

41 In a client-server architecture, where should security validation be most rigorously applied?

A. Server-side
B. Client-side only (JavaScript)
C. Neither
D. On the router only

42 How can 'Stored Procedures' help prevent SQL Injection?

A. They encapsulate queries and can accept parameters, functioning similarly to parameterized queries
B. They encrypt the hard drive
C. They make the database slower
D. They delete all data periodically

43 What does an attacker typically look for in a URL to attempt SQL Injection?

A. Query strings with parameters (e.g., ?id=5)
B. Static HTML pages
C. Images (.jpg)
D. CSS files

44 Which of the following best describes 'Session Timeout' as a defensive strategy?

A. Slowing down the internet connection
B. Banning the user forever
C. Closing the session automatically after a period of inactivity
D. Turning off the server at night

45 What is the risk of having 'Verbose Error Messages' enabled on a live production server?

A. It fills up the hard drive
B. It uses too much bandwidth
C. It looks unprofessional
D. It aids attackers in understanding the technology stack and database structure (Information Leakage)

46 Why is 'Allow-listing' (White-listing) input validation superior to 'Block-listing' (Black-listing)?

A. It is faster to write
B. Block-listing is illegal
C. Allow-listing accepts everything
D. Block-listing often fails because attackers can find variations or encodings that aren't on the list

47 In network session hijacking, what is 'Ack Storm'?

A. A weather condition affecting Wi-Fi
B. A hacking tool
C. A burst of traffic caused by desynchronized sequence numbers where devices repeatedly try to synchronize
D. A type of firewall

48 Using an ORM (Object-Relational Mapping) framework generally reduces SQL injection risks because:

A. It automatically uses parameterized queries under the hood
B. It doesn't use SQL
C. It requires biometric authentication
D. It uses a special firewall

49 Which header helps protect against clickjacking, which can be related to session manipulation?

A. User-Agent
B. Content-Type
C. X-Frame-Options
D. Host

50 When an attacker uses HAVING 1=1 in an injection, they are often trying to:

A. Force an error to reveal the table or column name in the error message
B. Login as admin
C. Delete the table
D. Speed up the query