{"id":107,"date":"2025-06-16T02:56:46","date_gmt":"2025-06-16T02:56:46","guid":{"rendered":"https:\/\/epbrtcybersecurityportfolio.xyz\/?p=107"},"modified":"2025-06-17T00:20:55","modified_gmt":"2025-06-17T00:20:55","slug":"fragmentation","status":"publish","type":"post","link":"https:\/\/epbrtcybersecurityportfolio.xyz\/?p=107","title":{"rendered":"Fragmentation"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\">IP Fragmentation Lab \u2013 Overview and Setup<\/h3>\n\n\n\n<p>This lab focused on exploring the behavior and structure of <strong>IP fragmentation<\/strong>. The exercises require close analysis of fragmented IP packets using either <strong>Wireshark<\/strong> or <strong>tcpdump<\/strong>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Exercise 1 \u2013 Analyzing the First Two IP Fragments<\/h3>\n\n\n\n<p><strong>Look at the first two records. They are related fragments and are the only ones associated with this pair of fragments. What do you think happens when they are sent?<\/strong><\/p>\n\n\n\n<p>After identifying the first two packets as related IP fragments, I needed to confirm whether the full set of fragments was present. I used the following <code>tcpdump<\/code> command to examine fragmentation details more closely:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"827\" height=\"119\" src=\"https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/06\/image-32.png\" alt=\"\" class=\"wp-image-109\" srcset=\"https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/06\/image-32.png 827w, https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/06\/image-32-300x43.png 300w, https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/06\/image-32-768x111.png 768w\" sizes=\"auto, (max-width: 827px) 100vw, 827px\" \/><\/figure>\n\n\n\n<p>Both packets showed <strong>more fragments flag set<\/strong> (flags [+]), but neither was marked as the <strong>last fragment<\/strong> (with offset and MF flag = 0). This means that the packet reassembly could not be completed, as at least one fragment was missing from the set.<\/p>\n\n\n\n<p>To see how the system reacts to this failed reassembly, I looked for an <strong>ICMP error message<\/strong> that might be triggered by this condition. I ran:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"577\" src=\"https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/06\/image-33-1024x577.png\" alt=\"\" class=\"wp-image-110\" srcset=\"https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/06\/image-33-1024x577.png 1024w, https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/06\/image-33-300x169.png 300w, https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/06\/image-33-768x433.png 768w, https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/06\/image-33.png 1061w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Sure enough, shortly after the two fragment packets, I found an <strong>ICMP \u201cTime Exceeded \u2013 Fragment Reassembly Time Exceeded\u201d<\/strong> message. This type of ICMP error is sent when the receiver cannot finish reassembling a fragmented IP packet within the allowed time window.<\/p>\n\n\n\n<p>The error response appeared in <strong>record 14<\/strong>, indicating the network&#8217;s handling of incomplete fragmentation and how it alerts the sender when reassembly fails.<\/p>\n\n\n\n<p><strong>Why didn\u2019t records 3 and 4 (a different pair of related fragments) generate the same type of ICMP error message?<\/strong><\/p>\n\n\n\n<p>To answer this, I examined the fragmentation details of <strong>records 3 and 4<\/strong>. Although they represent another pair of related fragments, neither one has a <strong>fragment offset of 0<\/strong>. The packet corresponding to the third record has an offset of 1480. This is important because only the <strong>first fragment (offset 0)<\/strong> contains the <strong>protocol field<\/strong>, which identifies the embedded protocol (like ICMP, TCP, etc.).<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"829\" height=\"85\" src=\"https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/06\/image-34.png\" alt=\"\" class=\"wp-image-111\" srcset=\"https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/06\/image-34.png 829w, https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/06\/image-34-300x31.png 300w, https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/06\/image-34-768x79.png 768w\" sizes=\"auto, (max-width: 829px) 100vw, 829px\" \/><\/figure>\n\n\n\n<p>Without that first fragment, the receiving system can\u2019t determine what protocol the original datagram was using. As a result, it <strong>doesn\u2019t send an ICMP \u201cFragment Reassembly Time Exceeded\u201d<\/strong> message, since it lacks the context needed to generate one.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Exercise 2 \u2013 Identifying Fragment Overlap and Suspicious Packet Behavior<\/h3>\n\n\n\n<p>In this exercise, I analyzed <strong>packets 5, 6, and 7<\/strong>, which appeared to be related fragments. At first glance, they looked like they might belong to a single fragmented IP packet, but something unusual stood out.<\/p>\n\n\n\n<p><strong>Fragment Overlap Issue<\/strong><br>Packets <strong>5 and 6<\/strong> both have a <strong>fragment offset of 0<\/strong>, meaning they are both marked as the <strong>first fragment<\/strong>. However, they have <strong>different total lengths<\/strong>, which would cause them to <strong>overlap<\/strong> if processed together. Packet <strong>7<\/strong> appears to be the final fragment in this set, but it overlaps with packet 6 based on its offset and length.<\/p>\n\n\n\n<p>This kind of fragment overlap can be interpreted differently depending on the <strong>operating system<\/strong>, making it a potential tactic for evasion or exploitation. Some systems may discard the entire packet, while others may accept whichever version arrives first or last.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"119\" src=\"https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/06\/image-35-1024x119.png\" alt=\"\" class=\"wp-image-113\" srcset=\"https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/06\/image-35-1024x119.png 1024w, https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/06\/image-35-300x35.png 300w, https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/06\/image-35-768x89.png 768w, https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/06\/image-35.png 1045w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><strong>Suspicious IP Options<\/strong><br>I also noticed that all three packets contained <strong>IP options<\/strong>, which are uncommon in typical traffic and can signal malicious activity. Specifically, the packets include <strong>type 131 IP options<\/strong>, which are often used to route packets through specific network paths. This could be an attempt to <strong>bypass firewalls, intrusion detection systems, or route traffic through an attacker-controlled device<\/strong>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Exercise 3 \u2013 Spotting Crafted Fragment Sets<\/h3>\n\n\n\n<p><strong>What makes you believe that the set of fragments in records 8\u201313 (IP ID 31026) have been crafted? Identify five abnormal traits.<\/strong><\/p>\n\n\n\n<p>Upon analyzing these packets, it became clear that these fragments were likely <strong>intentionally crafted<\/strong> rather than the result of legitimate fragmentation. I identified several suspicious traits that support this conclusion:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"826\" height=\"234\" src=\"https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/06\/image-36.png\" alt=\"\" class=\"wp-image-115\" srcset=\"https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/06\/image-36.png 826w, https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/06\/image-36-300x85.png 300w, https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/06\/image-36-768x218.png 768w\" sizes=\"auto, (max-width: 826px) 100vw, 826px\" \/><\/figure>\n\n\n\n<ol class=\"wp-block-list\">\n<li>The second packet does not have a More Fragment flag which would indicate that this is the last packet of this fragment train when in fact there are more packets that are part of this train following this packet. <\/li>\n\n\n\n<li>The second to last packet does not have the same payload size a nd total length size as the fragments before him. All fragments should be the exact same size outside of the last fragment. <\/li>\n\n\n\n<li>The 4th and 5th fragments are overlapping (they have the same offset of 24).<\/li>\n\n\n\n<li>All the packets have payloads of size 8 and 16 bytes and total length of 28 and 36 bytes. There should be no MTU that small and causing fragmentation to occur. <\/li>\n\n\n\n<li>There is a fragment missing before the last fragment. We go from offset 24 to offset 48 while the payload size is only of 8 bytes. We should have a fragment with an offset 32 that is missing. <\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">Exercise 4 \u2013 Filtering for ICMP Echo Request Fragments<\/h3>\n\n\n\n<p>In this exercise, I used a <strong>tcpdump<\/strong> filter to try and identify all fragments related to <strong>ICMP echo requests<\/strong> (type 8). The command provided was:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"996\" height=\"231\" src=\"https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/06\/image-37.png\" alt=\"\" class=\"wp-image-118\" srcset=\"https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/06\/image-37.png 996w, https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/06\/image-37-300x70.png 300w, https:\/\/epbrtcybersecurityportfolio.xyz\/wp-content\/uploads\/2025\/06\/image-37-768x178.png 768w\" sizes=\"auto, (max-width: 996px) 100vw, 996px\" \/><\/figure>\n\n\n\n<p><strong>Why don&#8217;t we see all the fragments associated with the echo requests ?<\/strong><\/p>\n\n\n\n<p>Only fragments with an <strong>offset of 0<\/strong> include the <strong>ICMP header<\/strong> (which contains the type field). Subsequent fragments\u2014those with a non-zero offset\u2014contain only <strong>payload data<\/strong>, not the protocol header. As a result, the filter doesn&#8217;t match those fragments, because the ICMP type field isn\u2019t present in their portion of the packet.<\/p>\n\n\n\n<p>To capture <strong>all fragments<\/strong> of a given ICMP echo request, I would need to filter by <strong>IP ID<\/strong> (the identifier field) rather than by protocol fields. That\u2019s because all fragments of a packet share the same IP ID, allowing me to track the complete set regardless of whether they include the ICMP header.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>IP Fragmentation Lab \u2013 Overview and Setup This lab focused on exploring the behavior and structure of IP fragmentation. The exercises require close analysis of fragmented IP packets using either Wireshark or tcpdump. Exercise 1 \u2013 Analyzing the First Two IP Fragments Look at the first two records. They are related fragments and are the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[7,6],"class_list":["post-107","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-ipv4","tag-wireshark"],"_links":{"self":[{"href":"https:\/\/epbrtcybersecurityportfolio.xyz\/index.php?rest_route=\/wp\/v2\/posts\/107","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/epbrtcybersecurityportfolio.xyz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/epbrtcybersecurityportfolio.xyz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/epbrtcybersecurityportfolio.xyz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/epbrtcybersecurityportfolio.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=107"}],"version-history":[{"count":5,"href":"https:\/\/epbrtcybersecurityportfolio.xyz\/index.php?rest_route=\/wp\/v2\/posts\/107\/revisions"}],"predecessor-version":[{"id":119,"href":"https:\/\/epbrtcybersecurityportfolio.xyz\/index.php?rest_route=\/wp\/v2\/posts\/107\/revisions\/119"}],"wp:attachment":[{"href":"https:\/\/epbrtcybersecurityportfolio.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=107"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/epbrtcybersecurityportfolio.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=107"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/epbrtcybersecurityportfolio.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=107"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}