Log Entries and Security+

Posted by in Security+ | 0 comments

Several people have recently queried me about log entries related to the SY0-401 and SY0-501 Security+ exam. People that have worked in networking jobs for the past couple of years have likely seen log entries from many different sources.

However, many people are required to earn the Security+ certification that haven’t necessarily worked in networking jobs. Additionally, some IT jobs don’t require technicians to routinely review and analyze logs so they might be confused by them.

However, with some basic knowledge and applying some critical thinking skills, you should be able to figure many of them out.

Sample Log Entry Practice Test Question

As an example, consider the following Security+ practice test question that I recently added to the test banks on the gcgapremium.com site.

Q. Your IPS recently raised an alert from the following log entry on of your organization’s web servers:

04/23/18 23:13:50 httpd: GET /wp/forms/process.php?input=cd%20../../../etc;cat%20shadow

Based on this log entry, which of the following is MOST likely occurring

A. False negative

B. XSS attack

C. Command injection attack

D. Password attack

E. Buffer overflow attack

The answer (and full explanation) is at the end of this blog post.

Security+ Practice Test Questions

SYO-501 Practice Test Questions Now Available

SYO-401 Practice Test Questions

Over 440 realistic Security+ practice test questions

All questions include explanations so you'll know why the correct answers are correct,

and why the incorrect answers are incorrect.

Pass the Security+ Exam

the First Time You Take It

Multiple quiz formats to let you use these questions based on the way you learn.
  • Learn mode - randomized. View each of the questions in random order. Learn mode allows you to keep selecting answers until you select the correct answer. Once you select the correct answer, you'll see the explanation. Click here to see how learn mode works.
  • Learn mode - not randomized. View each of the questions in the same order. Use this if you want to make sure that you see all of the questions. Learn mode allows you to keep selecting answers until you select the correct answer. Once you select the correct answer, you'll see the explanation. Click here to see how learn mode works.
  • Test mode - randomized. View each of the questions in random order. In test mode, you can only see the correct answers and explanations after you complete the test. Click here to see how test mode works.
  • Test mode - not randomized. View each of the questions in the same order. In test mode, you can only see the correct answers and explanations after you complete the test. Click here to see how test mode works.
  • Test mode - 100 random questions. View 100 random questions from the full test bank similar to how the Security+ exam has a potential maximum of 100 multiple choice questions. In test mode, you can only see the correct answers and explanations after you complete the test. Click here to see how test mode works.

Get the full bank of Security+ (SYO-401) Practice Test Questions Here

 SYO-401 Practice Test Questions


INCLUDES QUESTIONS TO HELP YOU PREPARE

FOR THE NEW PERFORMANCE BASED QUESTIONS 

Bonus - Performance Based Questions

Additional Security+ questions to help you prepare for the new performance based questions. These are included with the full bank of Security+ practice test questions and are divided into different sections. For example, you'll have access to the following links:

- Performance Based Question - Set 1

You'll see a graphic explaining what you might be required to do on the actual exam to match different types of security to mobile devices and servers in a data center. You'll then have two questions that test your knowledge and ability to correctly answer the questions. This question also includes a link to a graphic showing the end solution for the overall performance based question simulation.

- Performance Based Question - Set 2

You'll see a graphic explaining what you might be required to do on the actual exam to match different types of attacks with the name of the attack type. You'll then have five questions that test your knowledge and ability to correctly answer the questions. This question also includes a link to a graphic showing the end solution for the overall performance based question simulation.

- Performance Based Question - Set 3

You'll see a graphic showing a network with computers and servers separated by a firewall. The firewall is used to control traffic between the computers and users using rules within an access control list (ACL).  You'll have three questions that test your knowledge and ability to correctly identify the relevant components of the rule. The incorrect answers and explanation provide you with insight into how to correctly answer this type of question on the actual exam.

- Performance Based Question - Set 4

You'll see a graphic explaining what you might be required to do on the actual exam related to what a forensic analyst would do during an investigation. You'll then have two questions that test your knowledge and ability to correctly answer the questions. This question also includes a link to a graphic showing the end solution for the overall performance based question simulation.

- Performance Based Question - Set 5

You'll see a graphic explaining what you might be required to do on the actual exam to match protocols and ports. You'll then have seven questions that test your knowledge and ability to correctly answer the questions. This question also includes a link to a graphic showing the end solution for the overall performance based question simulation.

- Performance Based Question - Set 6

You'll see a list of security controls along with a graphic showing devices and locations within an organization, along with instructions on what you might be required to do on the actual exam to match the controls with the devices and locations. You'll then have four questions that test your knowledge and ability to correctly answer the questions. This question also includes a link to a graphic showing the end solution for the overall performance based question simulation.

- Performance Based Question - Set 7

You'll see a list of authentication methods and authentication factors along with instructions on what you might be required to do on the actual exam to match the authentication methods with the authentication factors. You'll then have six questions that test your knowledge and ability to correctly answer the questions. This set also includes a link to a graphic showing the end solution for the overall performance based question simulation.

- Performance Based Question - Set 8

You'll see a graphic explaining what you might be required to do on the actual exam to match different types of attacks with the name of the attack type. You'll then have five questions that test your knowledge and ability to correctly answer the questions. This is similar to Set 2 but expands on the possibilities. The set also includes a link to a page showing the end solution for the overall performance based question simulation.

New - Performance Based Question - Set 9

New questions recently added using a different testing engine. See a demo here. This set includes drag and drop and matching questions on ports.

New - Performance Based Question - Set 10

A random set of 20 performance-based questions using drag and drop, matching, sorting, and fill in-the blank. This set includes performance-based questions on RAID.

Get the full bank of Security+ (SYO-401) Practice Test Questions Here

Get the full bank of Security+ Practice Test Questions

Click here if you're looking for SYO-501 Practice Test Questions

Analyzing the Log Entry

In most log entries (if not all), you will see a time stamp somewhere within the log entry. This entry indicates it was logged on April 23, 2018 (04/23/18) at about 50 seconds after 11:13 PM (23:13:50).  Note that the date could be entered as an easier to recognize date like this:

Apr 23 2018 23:13:50...

Log entries typically use a 24 hour clock instead of dividing time into AM and PM. One way of determining the actual time after 1 PM is to subtract 12 from the first number if it is greater than 12.  In this case, 23-12 is 11, indicating 11 PM.

Next, in the entry is httpd. Hopefully, you’ll recognize that this represents the Hypertext Transfer Protocol (HTTP) used on the Internet to serve up web pages.

04/23/18 23:13:50 httpd:

What about the extra D? It represents a daemon. A daemon is a process that runs in the background on a Linux systems, similar to how services run in the background on Windows systems. HTTPD indicates it is a daemon handling HTTP requests.

Next is the GET command.

04/23/18 23:13:50 httpd: GET

This is where CompTIA is making the Security+ exam more focused on programmers and developers. This is admittedly a little odd, considering that recommend experience says nothing about development experience, but only mentions “experience in IT administration with a security focus.”

Developers that have done web page development using common languages such as Python, PHP, and JavaScript understand that GET is an HTTP command used to retrieve something, such as a web page. However, for a Cisco expert that knows routers and switches inside and out, this isn’t common knowledge.

At any rate, you can think of GET as a simple read command. What is it trying to read? The answer is in the following section:

GET /wp/modules/process.php?input=cd%20../../../etc;cat%20shadow

There are a couple of things going in this part of the entry, but it’s important to realize that is a single line of code with multiple elements.

First, it is running a PHP program called process.php, which is a generic name for a PHP module typically used to process web page forms. The module would typically be within another directory, so the code adds the appropriate path (/wp/forms/ in this scenario) before the module name.

The next part (?input=cd%20../../../etc;cat%20shadow) is very likely the malicious code. It indicates that it is retrieving data and passing it back to the process.php module.

If you’ve done some work with the command line on Linux systems,  the commands should be familiar. The %20 indicates a space, so the this is essentially the following two commands:

cd ../../../etc

cat shadow

The first command (cd) changes the directory  to the etc directory.

The second command (cat shadow) attempts to read the shadow file, which is an encrypted form of the password file.

The code than passes the password file back to the process.php file as an input.

But here’s a question to ask. Why would a PHP module be retrieving the password file?

Hint: It shouldn’t.

Is This Normal?

A PHP module used to process forms would NOT be trying to retrieve the entire contents of the shadow file.

Additionally, it is NOT natural for an HTTP GET command to execute commands normally run at the Linux terminal or a Windows command line.

Command Injection Attack

Here’s a snippet from Chapter 7 of the CompTIA Security+ Get Certified Get Ahead: SY0-501 Study Guide.

“In some cases, attackers can inject operating system commands into an application using web page forms or text boxes. Any web page that accepts input from users is a potential threat. Directory traversal is a specific type of command injection attack that attempts to access a file by including the full directory path, or traversing the directory structure.”

In this scenario, the attacker used directory traversal to first access the /etc/ folder. It then used the cat shadow command to access the encrypted passwords.

Did it work? We don’t know.

Hopefully, the process.php file is using adequate input validation techniques to block this type of attack.

Sample Log Entry Practice Test Question Answer

Q. Your IPS recently raised an alert from the following log entry on of your organization’s web servers:

04/23/18 23:13:50 httpd: GET /wp/forms/process.php?input=cd%20../../../etc;cat%20shadow

Based on this log entry, which of the following is MOST likely occurring

A. False negative

B. XSS attack

C. Command injection attack

D. Password attack

E. Buffer overflow attack

Answer: This is a command injection attack because it is attempting to run the cd and cat commands.

A false negative indicates an attack is occurring, but a system such as the intrusion prevention system (IPS) is not detecting the attack. Because the IPS raised an alert, it is not a false negative.

A cross-site scripting (XSS) attack used embedded HTML or JavaScript code, not command-line commands.

A password attack attempts to discover passwords. While this looks like it may be trying to discover passwords, it is unlikely to do so if the process.php module is using adequate input validation.

A buffer overflow occurs if an application receives more data than it could handle. If the process.php module is not using adequate input validation techniques, this could result in a buffer overflow problem, but there isn’t any indication that it did cause a buffer overflow issue.

 

 

 

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

CompTIA Security+: Get Certified Get Ahead: SY0-401 Study Guide

Subscribe To Our Newsletter

Join our mailing list and get a free excerpt of the CompTIA Security+: Get Certified Get Ahead: SY0-401 Study Guide.  This excerpt includes the introduction and Chapter 1. 

You have Successfully Subscribed!

Get Certified Get Ahead is a participant in the Amazon Services LLC Associates Program,
an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to amazon.com.

Copyright © 2015 Get Certified Get Ahead. All Rights Reserved.