exam questions

Exam CAS-004 All Questions

View all questions & answers for the CAS-004 exam

Exam CAS-004 topic 1 question 340 discussion

Actual exam question from CompTIA's CAS-004
Question #: 340
Topic #: 1
[All CAS-004 Questions]

A systems administrator was given the following IOC to detect the presence of a malicious piece of software communicating with its command-and-control server:


POST /malicious.php -
User-Agent: Malicious Tool V 1.0

Host: www.malicious.com -

The IOC documentation suggests the URL is the only part that could change. Which of the following regular expressions would allow the systems administrator to determine if any of the company hosts are compromised, while reducing false positives?

  • A. User-Agent: Malicious Tool.*
  • B. www\.malicious\.com\/malicious.php
  • C. Post /malicious\.php
  • D. Host: [a-z]*\.malicious\.com
  • E. malicious.*
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️

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
ThatGuyOverThere
Highly Voted 1 year, 5 months ago
Selected Answer: A
It's definitely A. "The IOC documentation suggests the URL is the only part that could change." Therefore we would not try to check any part of the URL because it could change to something else and we'd miss detecting on other hosts. The URL will include both the host information and /malicious.php. Therefore we will look at the user-agent section which should not change. We will use regex for the version number portion in case a different version number is utilized.
upvoted 5 times
...
OdinAtlasSteel
Highly Voted 1 year, 4 months ago
Selected Answer: A
The URL is subject to change. Eliminate that from the equation and the only answer that makes any sense whatsoever is A.
upvoted 5 times
...
Steel16
Most Recent 1 month, 3 weeks ago
Selected Answer: D
o Focus on the Host header: The IOC specifies that the Host header is the only part that might change. By targeting the hostname with a regular expression, we can effectively catch variations in the URL path or User-Agent header while still isolating malicious connections. o [a-z]* : This part matches any sequence of lowercase letters. It accounts for potential variations in the domain name (e.g., "www.malicious.com" or "malicious.com"). o \.malicious\.com: This matches the literal string ".malicious.com", ensuring that the detected hostname always contains this specific domain.
upvoted 2 times
Steel16
1 month, 3 weeks ago
o A. User-Agent: Malicious Tool.:* This would match any request with the User-Agent header containing "Malicious Tool", which could lead to numerous false positives from legitimate software or browser extensions that might use this string. o B. www\.malicious\.com\/malicious.php: This matches the entire URL, including the path. If the malicious software changes its URL, this regex would no longer detect it. It also wouldn't catch variations in the Host header.
upvoted 1 times
...
Steel16
1 month, 3 weeks ago
o C. Post /malicious\.php: This matches the HTTP method and URL, but ignores the Host header. Since the IOC specifies that the URL can change, focusing only on the request method and URL would be ineffective. o E. malicious.:* This is too broad. It would match anything containing the string "malicious", leading to a high number of false positives from legitimate traffic that might include the word "malicious" in various contexts (e.g., website content, error messages).
upvoted 1 times
...
...
1c7fe0b
3 months, 1 week ago
Selected Answer: A
According to Chat GPT The User-Agent header is an attribute attackers are less likely to change frequently, as it identifies the malicious tool. A. User-Agent: Malicious Tool.* This matches the User-Agent header, which is less likely to vary unless specifically modified by the attacker. The use of .* allows for minor variations, such as updated versions of the tool (e.g., "Malicious Tool V 1.1"). This is specific enough to reduce false positives while accounting for minor changes in the tool.
upvoted 1 times
...
3c12b86
3 months, 4 weeks ago
Selected Answer: A
The User-Agent string ("Malicious Tool V 1.0") is a reliable IOC (Indicator of Compromise) in this scenario because it is highly specific to the malicious software. Even if the URL changes (as mentioned in the IOC documentation), the User-Agent is more likely to remain consistent, as malicious software often hardcodes its User-Agent.
upvoted 1 times
...
Bright07
4 months, 2 weeks ago
Selected Answer: B
B. www.malicious.com/malicious.php: This regular expression is very specific and matches the exact structure of the URL in the IOC. It looks for www.malicious.com/malicious.php, ensuring that it specifically targets the malicious URL path and domain. This reduces false positives because it focuses only on that exact part of the URL, as the IOC documentation suggests that only the URL might change. Using this approach ensures that you are detecting the exact malicious communication without being too broad. NOT A. User-Agent: Malicious Tool.*: This matches any "User-Agent" string starting with "Malicious Tool," followed by any characters. While this may be useful in detecting the User-Agent, it would not be as effective as option B, because it could result in false positives from other tools or legitimate software that may have similar User-Agent strings. It is not as focused as B.
upvoted 1 times
...
CraZee
1 year, 3 months ago
Question...why not C? In essence, A (User-Agent: Malicious Tool.*) and C (Post /malicious.php) are similar in that they are referencing a piece of the IoC that will not change (per the question, only the URL). With that being said, can someone explain why C (an exact match for the IoC) is not a better choice than A (allows for version changes, but per the question, that is not something requiring consideration)? To me, the exact match will produce less false positives. I get that there is a HIGH probability that there will not be a non-malicious entry with V2.0. Something else I just noticed...and may be a typo, but if option A is NOT a typo, then it will NOT match ever... From the IoC: User-Agent: Malicious Tool V 1.0 Answer A: User-Agent: Malicious Tool.* There is no '.' after Tool in the IoC entry...
upvoted 1 times
b49eb27
1 year ago
This regular expression is used to match a User-Agent string that starts with "User-Agent: Malicious Tool" followed by any number of characters (represented by .*), including zero or more occurrences of any character. In other words, this regular expression is designed to match User-Agent strings that contain "Malicious Tool" at the beginning, allowing for any additional characters to follow.
upvoted 1 times
...
...
weaponxcel
1 year, 6 months ago
Selected Answer: D
D. Host: [a-z]*.malicious.com This regular expression matches any hostname that ends with .malicious.com, regardless of the subdomain. This would allow the systems administrator to detect if any of the company hosts are compromised, even if the attacker is using a different subdomain than the one specified in the IOC. Why not option B. www.malicious.com/malicious.php ? B option matches the exact URL specified in the IOC. BUT this is too specific, as the attacker may be using a different URL, such as https://www.malicious.com/malicious.php https://attack.malicious.com/malicious.php https://malicious.com/malicious.php It doesn't account for potential subdomains or paths other than "www", so it might miss some malicious requests if the URL changes.
upvoted 5 times
Trap_D0_r
1 year, 3 months ago
Host: [a-z]*\.malicious\.com is a regex string that will match exactly 1 string of characters (any length) followed by malicious.com. This means it will match: www.malicious.com comptia.malicious.com anystring.malicious.com but would NOT match: www.comptia.malicious.com comp-tia.malicious.com So it's actually a stupendously bad regex match to search for subdomains--test yourself at regex101. The answer is A.
upvoted 5 times
...
...
CoinUmbrella
1 year, 7 months ago
Selected Answer: B
www\.malicious\.com\/malicious.php
upvoted 3 times
...
CXSSP
1 year, 7 months ago
Selected Answer: B
B. www.malicious.com/malicious.php The regular expression in option B is the most specific and accurate for detecting the presence of the malicious software communicating with its command-and-control server. It matches the specific URL "/malicious.php" on the domain "www.malicious.com". Options A, C, D, and E are not as specific and may result in false positives or fail to accurately detect the presence of the malicious software:
upvoted 5 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