Security Questions Answers
Security Questions Answers
Chapter: IDS/IPS
Chapter: Snort
11. What is the most valuable information stored on the stack during a stack overflow
attack? (Open-ended)
12. Identify the function in this code snippet prone to a buffer overflow: (Code Review)
c
نسختحرير
char input[10];
gets(input);
13. What does “return to libc” refer to in buffer overflow attacks? (Open-ended)
14. Which of the following functions is considered unsafe due to buffer overflow risks?
(Multiple-choice)
o a) printf
o b) fgets
o c) strcpy
o d) memcpy
15. What are two key defenses against buffer overflow attacks? (Open-ended)
sql
نسختحرير
SELECT * FROM users WHERE username = '$username';
(Open-ended)
25. True or False: Prepared statements can prevent SQL injection. (True/False)
Chapter: Blockchain
51. Compare public and private blockchains in terms of transaction speed and
scalability. (Open-ended)
52. What role does redundancy play in the security of public blockchains? (Open-ended)
53. Describe a use case for consortium blockchains. (Open-ended)
54. Why might a private blockchain be preferable for government applications? (Open-
ended)
55. Which blockchain type is suitable for business-to-business interactions? (Multiple-
choice)
o a) Public blockchain
o b) Private blockchain
o c) Consortium blockchain
56. List the methods used for anomaly detection in IDS systems. (Open-ended)
57. How does misuse detection differ from anomaly detection? (Open-ended)
58. What are the limitations of misuse detection? (Open-ended)
59. True or False: Anomaly detection relies on pre-defined signatures to detect threats.
(True/False)
60. Explain the concept of "false positives" in IDS systems. (Open-ended)
61. Write a SQL query that is safe from SQL injection using prepared statements. (Code
Writing)
62. What is the main goal of input sanitization in preventing SQL injection? (Open-
ended)
63. Which of the following is a common SQL injection attack vector? (Multiple-choice)
o a) URL parameters
o b) User input fields
o c) Cookies
o d) All of the above
64. Provide an example of a "blind SQL injection" attack. (Open-ended)
65. Why are dynamic SQL queries more vulnerable to injection attacks? (Open-ended)
66. What are the main challenges of securing statistical databases? (Open-ended)
67. How does a tracker attack exploit statistical queries? (Open-ended)
68. Match the statistical function with its purpose: (Matching)
o COUNT
o AVG
o MAX
o MIN
69. What is the importance of query constraints in statistical databases? (Open-ended)
70. True or False: Statistical queries with fewer than three records should always be
denied to protect privacy. (True/False)
71. What is the role of the return address in a stack overflow attack? (Open-ended)
72. Name two programming functions that should be avoided to prevent buffer
overflow vulnerabilities. (Open-ended)
73. How does Address Space Layout Randomization (ASLR) defend against buffer
overflow attacks? (Open-ended)
74. Write a secure version of the following code snippet to prevent buffer
overflow:
char buffer[10];
gets(buffer);
75. True or False: Integer overflows can also lead to buffer overflow vulnerabilities.
(True/False)
76. Explain the term "TOCTTOU" in the context of race conditions. (Open-ended)
77. Why is atomicity important in preventing race conditions? (Open-ended)
78. Which of the following is NOT a common strategy to mitigate race conditions?
(Multiple-choice)
o a) Locking mechanisms
o b) Using faster processors
o c) Avoiding shared resources
o d) Implementing transactions
79. Provide an example of a race condition in file handling. (Open-ended)
80. True or False: Time-of-check to time-of-use vulnerabilities are unique to multi-
threaded systems. (True/False)
Miscellaneous Topics
81. What is the role of cryptographic hash functions in ensuring data integrity? (Open-
ended)
82. Define "nonce" and its significance in the proof-of-work model. (Open-ended)
83. How do digital signatures enhance the security of blockchain transactions? (Open-
ended)
84. What are the three primary properties of cryptographic hash functions? (Open-
ended)
85. True or False: A blockchain with tampered blocks can still maintain its integrity.
(True/False)
86. What is the main purpose of Snort as a network security tool? (Open-ended)
87. Explain the difference between Sniffer mode and Packet Logger mode in Snort.
(Open-ended)
88. Which of the following command-line switches puts Snort into NIDS mode?
(Multiple-choice)
o a) -s
o b) -c <config file>
o c) -l <log directory>
o d) No switches; it's the default mode
89. Write a Snort rule to detect incoming traffic on port 22 (SSH) from an external
network. (Code Writing)
90. What is the role of the "Preprocessor" in the Snort architecture? (Open-ended)
91. True or False: Snort rules consist of two main parts—header and options.
(True/False)
92. What type of data does the "Detection Engine" in Snort analyze? (Open-ended)
93. Match the Snort rule components with their function: (Matching)
o msg
o content
o sid
o flags
94. Explain the purpose of the following Snort rule snippet:
alert tcp any any -> any 80 (msg: "HTTP traffic detected"; sid:
1001;)
(Open-ended)
95. How does Snort handle output, and what are the common output formats? (Open-
ended)
96. Which of these is a valid Snort rule action? (Multiple-choice)
o a) block
o b) alert
o c) log
o d) Both b and c
97. True or False: Snort can integrate with third-party tools for enhanced data
visualization and management. (True/False)
98. What is the function of the "sid" field in a Snort rule? (Open-ended)
99. Why is it important to use variables (e.g., $HOME_NET) in Snort rules? (Open-ended)
100. Write a Snort rule that generates an alert for any ICMP traffic. (Code Writing)
101. Explain the purpose of the "nocase" option in content-based Snort rules.
(Open-ended)
102. What does the following Snort rule detect, and why is it useful? (Scenario-
based)
plaintext alert tcp $EXTERNAL_NET any -> $HOME_NET 1433 (msg:"SQL
Server access attempt"; content:"|73 71 6c 20|"; sid:2001;)
103. What is the primary role of the "Rules Header" in a Snort rule? (Open-ended)
104. List three types of Snort rule categories (e.g., exploit.rules) and their
purpose. (Open-ended)
105. True or False: Snort’s plug-in system allows users to extend its capabilities
without modifying its core. (True/False)
106. Describe how statistical anomaly detection differs from signature-based
detection in Snort. (Open-ended)
107. What is the significance of setting thresholds in Snort rules? (Open-ended)
108. How does Snort use BPF (Berkeley Packet Filter) in Sniffer mode? (Open-
ended)
109. Provide an example of a multi-mode packet logging option in Snort. (Open-
ended)
110. Why is Snort considered a "lightweight" network intrusion detection
system? (Open-ended)
ANSWERS
Chapter: IDS/IPS
Chapter: Snort
plaintext
نسختحرير
alert tcp any any -> any 80 (msg: "HTTP traffic detected"; sid:
1001;)
This rule detects any TCP traffic directed to port 80 (HTTP) and logs it with a
specific message and ID.
15. How does Snort handle output, and what are the common output formats?
Snort outputs logs/alerts in formats such as plain text, tcpdump, or database
entries.
16. Which of these is a valid Snort rule action?
Answer: d) Both b (alert) and c (log).
17. True or False: Snort can integrate with third-party tools for enhanced data
visualization and management.
Answer: True.
18. What is the function of the "sid" field in a Snort rule?
It provides a unique identifier for the rule.
19. Why is it important to use variables (e.g., $HOME_NET) in Snort rules?
Variables allow flexibility and easier rule management for different environments.
20. Write a Snort rule that generates an alert for any ICMP traffic.
Answer: alert icmp any any -> any any (msg:"ICMP traffic
detected"; sid:2001;)
21. What is the most valuable information stored on the stack during a stack
overflow attack?
The return address.
22. Identify the function in this code snippet prone to a buffer overflow:
c
نسختحرير
char input[10];
gets(input);
sql
نسختحرير
SELECT * FROM users WHERE username = '$username';
Chapter: Blockchain
61. What is the role of the return address in a stack overflow attack?
It determines where the system executes code after a function call.
62. Name two programming functions that should be avoided to prevent buffer
overflow vulnerabilities.
gets() and strcpy().
63. How does Address Space Layout Randomization (ASLR) defend against
buffer overflow attacks?
It randomizes memory addresses to make it harder for attackers to predict
locations.
64. Write a secure version of the following code snippet to prevent buffer
overflow:
c
نسختحرير
char buffer[10];
fgets(buffer, sizeof(buffer), stdin);
65. True or False: Integer overflows can also lead to buffer overflow
vulnerabilities.
Answer: True.
Miscellaneous
71. What is the role of cryptographic hash functions in ensuring data integrity?
They generate unique outputs, making tampering easily detectable.
72. Define "nonce" and its significance in the proof-of-work model.
A nonce is a random number used to meet a blockchain's hashing difficulty target.
73. How do digital signatures enhance the security of blockchain transactions?
They verify the authenticity and integrity of a transaction using asymmetric
cryptography.
74. What are the three primary properties of cryptographic hash functions?
Collision resistance, hiding, and puzzle-friendliness.
75. True or False: A blockchain with tampered blocks can still maintain its
integrity.
Answer: False
76. Write a SQL query that is safe from SQL injection using prepared
statements.
sql
نسختحرير
SELECT * FROM users WHERE username = ? AND password = ?;
77. What is the main goal of input sanitization in preventing SQL injection?
To ensure user inputs do not alter the intended structure of SQL queries.
78. Which of the following is a common SQL injection attack vector?
Answer: d) All of the above.
79. Provide an example of a "blind SQL injection" attack.
Blind SQL injection occurs when the attacker extracts data by observing
responses to true/false queries, such as using:
sql
نسختحرير
' AND 1=1 --
80. Why are dynamic SQL queries more vulnerable to injection attacks?
Dynamic queries directly embed user input into the SQL code, making them
prone to manipulation.
81. Compare public and private blockchains in terms of transaction speed and
scalability.
Public blockchains are slower and less scalable due to their distributed nature and
consensus mechanisms. Private blockchains are faster and more scalable due to
centralized control.
82. What role does redundancy play in the security of public blockchains?
Redundancy ensures that multiple copies of the ledger exist, making it difficult
for attackers to alter the blockchain.
83. Describe a use case for consortium blockchains.
Consortium blockchains are ideal for industries where multiple organizations
collaborate, such as supply chain management or financial networks.
84. Why might a private blockchain be preferable for government applications?
Private blockchains offer controlled access, better privacy, and faster transaction
times suitable for sensitive government data.
85. Which blockchain type is suitable for business-to-business interactions?
Answer: c) Consortium blockchain.
86. List the methods used for anomaly detection in IDS systems.
Statistical methods, artificial intelligence, data mining, and biological system
abstractions (e.g., neural networks).
87. How does misuse detection differ from anomaly detection?
Misuse detection uses known signatures to detect specific attacks, while anomaly
detection identifies deviations from normal behavior.
88. What are the limitations of misuse detection?
It cannot detect new or unknown attacks and may require frequent updates to its
signature database.
89. True or False: Anomaly detection relies on pre-defined signatures to detect
threats.
Answer: False.
90. Explain the concept of "false positives" in IDS systems.
False positives occur when normal activities are incorrectly flagged as malicious.
Miscellaneous Topics