본문 바로가기
모의해킹 및 악성코드 분석/Try Hack Me

TryHackMe - Wireshark: The Basics - Task 3 Packet Dissection & Task 4 Packet Navigation

by kkmin93 2024. 8. 18.
반응형

TryHackMe - Wireshark: The Basics - Task 3 Packet Dissection & Task 4 Packet Navigation

 

Task 3 Packet Dissection

Packet *dissection is also known as protocol dissection, which investigates packet details by decoding available protocols and fields. Wireshark supports a long list of protocols for dissection, and you can also write your dissection scripts.

 

# Dissection : 분석

 

Note: This section covers how Wireshark uses OSI layers to break down packets and how to use these layers for analysis. It is expected that you already have background knowledge of the OSI model and how it works. 

 

Packet Details

You can click on a packet in the packet list pane to open its details (double-click will open details in a new window). Packets consist of 5 to 7 layers based on the OSI model. We will go over all of them in an HTTP packet from a sample capture. The picture below shows viewing packet number 27.

 

Each time you click a detail, it will highlight the corresponding part in the packet bytes pane.

 

Let's have a closer view of the details pane.

 

We can see seven distinct layers to the packet: frame/packet, source [MAC], source [IP], protocol, protocol errors, application protocol, and application data. Below we will go over the layers in more detail.

 

The Frame (Layer 1): This will show you what frame/packet you are looking at and details specific to the Physical layer of the OSI model.

 

Source [MAC] (Layer 2): This will show you the source and destination MAC Addresses; from the Data Link layer of the OSI model.

 

Source [IP] (Layer 3): This will show you the source and destination IPv4 Addresses; from the Network layer of the OSI model.

 

Protocol (Layer 4): This will show you details of the protocol used (UDP/TCP) and source and destination ports; from the Transport layer of the OSI model.

 

Protocol Errors: This continuation of the 4th layer shows specific segments from TCP that needed to be reassembled.

 

Application Protocol (Layer 5): This will show details specific to the protocol used, such as HTTPFTP,  and SMB. From the Application layer of the OSI model.

 

Application Data: This extension of the 5th layer can show the application-specific data.

 

Answer the questions below

Use the "Exercise.pcapng" file to answer the questions.


Q. View packet number 38.Which markup language is used under the HTTP protocol?

Click "Go" in the menu bar at the top of the Wireshark window, then select "Go to Packet..." from the dropdown menu that appears.

 

Then, a packet search bar will appear on the right side of the window. Enter "38" in the field and press the Enter key or click the "Go To Packet" button to jump to packet 38. 

 

You will see the answer located just below the Hypertext Transfer Protocol section.

eXtensible Markup Language

 

Q. What is the arrival date of the packet? (Answer format: Month/Day/Year)

Click the dropdown icon for the Frame (Layer 1) section to view the details, where you can find the arrival time of the packet.

05/13/2004

 

Q. What is the TTL value?

Click the dropdown icon for the IP layer (Layer 3) section to view the details of that layer. In the details, you can find the Time to Live (TTL) value.

47

 

Q. What is the TCP payload size?

Click the dropdown icon for the protocol layer (Layer 4) section to view the details, where you can find the TCP payload size under the TCP Segment Len field.

424

 


Task 4 Packet Navigation

Packet Numbers

Wireshark calculates the number of investigated packets and assigns a unique number for each packet. This helps the analysis process for big captures and makes it easy to go back to a specific point of an event. 

Go to Packet

Packet numbers do not only help to count the total number of packets or make it easier to find/investigate specific packets. This feature not only navigates between packets up and down; it also provides in-frame packet tracking and finds the next packet in the particular part of the conversation. You can use the "Go" menu and toolbar to view specific packets.

 

Find Packets

Apart from packet number, Wireshark can find packets by packet content. You can use the "Edit --> Find Packet" menu to make a search inside the packets for a particular event of interest. This helps analysts and administrators to find specific intrusion patterns or failure traces.

 

There are two crucial points in finding packets. The first is knowing the input type. This functionality accepts four types of inputs (Display filter, Hex, String and Regex). String and regex searches are the most commonly used search types. Searches are case insensitive, but you can set the case sensitivity in your search by clicking the radio button.

 

The second point is choosing the search field. You can conduct searches in the three panes (packet list, packet details, and packet bytes), and it is important to know the available information in each pane to find the event of interest. For example, if you try to find the information available in the packet details pane and conduct the search in the packet list pane, Wireshark won't find it even if it exists.

 

Mark Packets

Marking packets is another helpful functionality for analysts. You can find/point to a specific packet for further investigation by marking it. It helps analysts point to an event of interest or export particular packets from the capture. You can use the "Edit" or the "right-click" menu to mark/unmark packets.

 

Marked packets will be shown in black regardless of the original colour representing the connection type. Note that marked packet information is renewed every file session, so marked packets will be lost after closing the capture file. 

 

Packet Comments

Similar to packet marking, commenting is another helpful feature for analysts. You can add comments for particular packets that will help the further investigation or remind and point out important/suspicious points for other layer analysts. Unlike packet marking, the comments can stay within the capture file until the operator removes them.

 

Export Packets

Capture files can contain thousands of packets in a single file. As mentioned earlier, Wireshark is not an IDS, so sometimes, it is necessary to separate specific packages from the file and dig deeper to resolve an incident. This functionality helps analysts share the only suspicious packages (decided scope). Thus redundant information is not included in the analysis process. You can use the "File" menu to export packets.

 

Export Objects (Files)

Wireshark can extract files transferred through the wire. For a security analyst, it is vital to discover shared files and save them for further investigation. Exporting objects are available only for selected protocol's streams (DICOM, HTTP, IMF, SMB and TFTP).

 

Time Display Format

Wireshark lists the packets as they are captured, so investigating the default flow is not always the best option. By default, Wireshark shows the time in "Seconds Since Beginning of Capture", the common usage is using the UTC Time Display Format for a better view. You can use the "View --> Time Display Format" menu to change the time display format.

 

Expert Info

Wireshark also detects specific states of protocols to help analysts easily spot possible anomalies and problems. Note that these are only suggestions, and there is always a chance of having false positives/negatives. Expert info can provide a group of categories in three different severities. Details are shown in the table below.

Severity Colour Info
Chat Blue Information on usual workflow.
Note Cyan Notable events like application error codes.
Warn Yellow Warnings like unusual error codes or problem statements.
Error Red Problems like malformed packets.

 

Frequently encountered information groups are listed in the table below. You can refer to Wireshark's official documentation for more information on the expert information entries.

 

Group Info Group Info
Checksum Checksum errors. Deprecated Deprecated protocol usage.
Comment Packet comment detection. Malformed Malformed packet detection.

 

You can use the "lower left bottom section" in the status bar or "Analyse → Expert Information" menu to view all available information entries via a dialogue box. It will show the packet number, summary, group protocol and total occurrence.

반응형