exam questions

Exam PT0-001 All Questions

View all questions & answers for the PT0-001 exam

Exam PT0-001 topic 1 question 120 discussion

Actual exam question from CompTIA's PT0-001
Question #: 120
Topic #: 1
[All PT0-001 Questions]

A recently concluded penetration test revealed that a legacy web application is vulnerable to SQL injection. Research indicates that completely remediating the vulnerability would require an architectural change, and the stakeholders are not in a position to risk the availability on the application. Under such circumstances, which of the following controls are low-effort, short-term solutions to minimize the SQL injection risk? (Choose two.)

  • A. Identity and eliminate inline SQL statements from the code.
  • B. Identify and eliminate dynamic SQL from stored procedures.
  • C. Identify and sanitize all user inputs.
  • D. Use a whitelist approach for SQL statements.
  • E. Use a blacklist approach for SQL statements.
  • F. Identify the source of malicious input and block the IP address.
Show Suggested Answer Hide Answer
Suggested Answer: CD 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
boblee
Highly Voted 4 years, 10 months ago
C&D is correct. that sybex book is not good.
upvoted 11 times
MrRiver
3 years, 7 months ago
I dissagree ... The Quetions states: low-effort, short-term solutions to minimize the SQL So i think it's C and E. Because the blacklist approach isn't perfect but much easier to implement then a whitelist aproach.
upvoted 1 times
Ariel235788
3 years, 5 months ago
how would blacklisting be easier? Whitelisting will go explicit allow, giving you the option for implicit deny; thus preventing unauthorized commands
upvoted 1 times
...
...
...
miabe
Most Recent 2 years, 9 months ago
Selected Answer: CD
looks good to me
upvoted 1 times
...
Cock
3 years, 2 months ago
It was on the exam
upvoted 2 times
...
mr_robot
5 years ago
PenTest+ Practice Tests Book D and E. - Given this scenario, the client will want to use a blacklist and whitelist validation for the SQL statements. SQL injection is a common attack route that uses malicious SQL code for backend database manipulation to access information that was not intended to be displayed. SQL injections are one of the most common web hacking techniques. Blacklist validation tests the external input against a set of known malicious inputs. Whitelist validation tests an external input against a set of known, approved input. With whitelist input validation, the application knows exactly what is wanted and rejects other input.
upvoted 2 times
D1960
4 years, 11 months ago
Does it make sense to use a blacklist, if you are already using a whitelist? With a whitelist, you already know that every input is acceptable. The problem with a whitelist is: you have to be able to anticipate anything that will be input. So if you are asking for a name and address for a new user, you might run into trouble.
upvoted 4 times
Acidscars
4 years, 4 months ago
Conversely the problem with a blacklist is new networks may show up and need to be added in. Take the same approach you do with NTFS permissions: allow only that which is needed and very rarely deny access.
upvoted 1 times
...
...
mr_robot
4 years, 11 months ago
Researching further on this one, I believe C and D would be correct: "Within an application itself, there are two approaches to input validation that can defend against SQL injection attacks: blacklisting and whitelisting. With blacklisting, specific, known malicious characters are removed from or replaced in user input. Although this approach is often implemented, largely due to the ease at which it can be accomplished, it is not effective when compared to whitelisting. Blacklisting can fail to properly handle complex obfuscation, which could allow an attacker to subvert filters and potentially inject SQL statements. This failure often occurs as a result of evolving attack techniques and filters that are not comprehensive or not implemented correctly." https://tools.cisco.com/security/center/resources/sql_injection#8 https://www.synopsys.com/glossary/what-is-sql-injection.html https://cheatsheetseries.owasp.org/cheatsheets/SQL_Injection_Prevention_Cheat_Sheet.html https://owasp.org/www-community/attacks/SQL_Injection
upvoted 9 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago