Question

While reviewing web server logs, a security analyst notices the following code:

GET http://testphp.comptia.org/profiles.php?id=-1 UNION SELECT 1, 2, 3 HTTP/1.1 Host: testphp.comptia.org

Which of the following would prevent this code from performing malicious actions?

(choose one and why)

  1. Performing web application penetration testing
  2. Requiring the application to use input validation
  3. Disabling the use of HTTP and requiring the use of HTTPS
  4. Installing a network firewall in front of the application
0 0
Add a comment Improve this question Transcribed image text
Answer #1

The given code queries the profiles.php page with malicious script added with the id.

This would give access to the attacker, to manipulate the database at the backend. As we can see in the query string where the attacker is passing the UNION database query to get access to other elements of the database. This is a very common attack called SQL injection where the attacker passes SQL malicious code to backend database and access the database.

This should be avoided at application end only where it can validate the user input and restrict unauthorized access to the backend so that it doesn't pass any SQL injection to the database.

So to avoid this, the application requires user input validation.

Web application penetration testing, using HTTPS, and network firewall won't work in this case because the attacker is injecting SQL code in the query itself very smartly and it will go undetected in these methods.

Hence, the correct answer is:

B.Requiring the application to use input validation

This completes the requirement. Let me know if you have any queries.

Thanks!

Add a comment
Know the answer?
Add Answer to:
While reviewing web server logs, a security analyst notices the following code: Which of the following...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT