Extracting IPv4 IoCs from unstructured text

CS0-004 By islever Editorial Last updated

Given a scenario, analyze indicators of potential malicious activity. Given a scenario, use tools to determine malicious activity.

Short answer

A CyberChef applies regular-expression extraction to unstructured text so the analyst can pull IPv4 IoCs from the APT document.

Question

A cybersecurity analyst receives an unstructured text document that contains advanced persistent threat (APT)-related indicators of compromise (IoCs). The analyst needs to extract the IPv4 addresses. Which of the following is the best tool to accomplish this task?
  1. CyberChef Correct Answer
  2. Wireshark
  3. Zeek
  4. Open Cyber Threat Intelligence (OpenCTI)

Key Takeaways

Extracting IPv4 indicators of compromise from unstructured APT text is a parsing job, and CyberChef is the tool that fits: its regular-expression and extract operations lift IPv4 patterns straight out of a document. Wireshark and Zeek only analyze packet captures and live traffic, while OpenCTI stores and correlates indicators after extraction rather than parsing raw text. CyberChef wins because the scenario's input is a static text file, not network traffic.

Expert Analysis

CyberChef is the CS0-004 decoding/parsing tool for exactly this job: it applies regular expressions, extraction, and transform operations to unstructured text, so an analyst can pull IPv4 patterns out of a document without manual review. Wireshark and Zeek are wrong because they analyze packets and network traffic, not a static text file. OpenCTI is wrong because it stores, correlates, and manages intelligence objects after extraction — it is a destination for IoCs, not a parser for raw text.

The deciding constraint is the input format: an unstructured text document holding APT-related IoCs. CyberChef is built for exactly that shape of work — it composes operations such as Extract with a regular-expression pattern, so the analyst can craft an operation chain like Regular Expression → Extract IP addresses against the file contents and receive only the IPv4 strings, no packet capture or live traffic required. Its Recipes, Bake and Steal model lets the same extraction be saved and replayed against the next document the team receives, which matters when APT IoC drops arrive as recurring blobs of prose.

Wireshark fails on the medium, not on capability. Wireshark is a packet-capture analyzer: it reads pcap/pcapng files and renders frames, protocols, and stream conversations. Given a static document with no captured packets, Wireshark has nothing to decode — there is no capture file to open and no traffic to filter with a display filter such as ip.addr ==.... Applying it here would mean first generating traffic that does not exist in this scenario.

Zeek fails for the same reason plus a timing reason. Zeek is a network monitoring framework that generates connection and protocol logs from live or recorded traffic; its conn.log and related outputs are produced by observing packets, not by reading a text file. Even the APT-related indicator strings inside the document would never reach Zeek's parsers unless they were extracted and then re-injected into a monitored flow.

OpenCTI fails in the opposite direction. It is a threat-intelligence platform whose role is to store, model and correlate STIX objects — indicators, campaigns, malware families — after they have been parsed out. It is the downstream repository where the extracted IPv4 addresses would be registered, not the upstream tool that lifts them from raw prose. Choosing it confuses the destination of IoCs with their extraction.

One mechanism this scenario relies on without stating it: IPv4 addresses match a specific numeric pattern (four dot-separated octets in the 0-255 range), and a regular expression engine is what converts that pattern into an extraction rule. A general-purpose regex such as (?:\d{1,3}\.){3}\d{1,3} applied over the document text is precisely the operation CyberChef wraps as a reusable recipe; neither Wireshark's packet dissectors nor Zeek's protocol analyzers nor OpenCTI's graph queries perform text-level regex extraction from an unstructured file.

The option letter is therefore A: CyberChef, chosen because it parses unstructured text with regex-based extraction, while Wireshark and Zeek require packet traffic and OpenCTI serves as the post-extraction intelligence store.

Official Reference

https://docs.gchq.github.io/CyberChef/

This link opens the official vendor documentation in a new tab.

Exam Strategy

When a tool question names a static input (document, log file, image) versus a live one (traffic, packets), filter options by what they consume before judging capability. Wireshark and Zeek always imply packets; a repository tool like OpenCTI implies storage after parsing. For CS0-004, remember CyberChef as the regex/decode Swiss army knife for any 'parse, extract, decode this file' task.

Practice All CS0-004 Questions

Access 101 questions with complete answers and detailed explanations.

View Full CS0-004 Practice Test →

← Back to CS0-004 Study Guide