{"id":6363,"date":"2024-04-02T14:46:35","date_gmt":"2024-04-02T21:46:35","guid":{"rendered":"https:\/\/objectsecurity.com\/?p=6363"},"modified":"2024-11-15T15:08:05","modified_gmt":"2024-11-15T23:08:05","slug":"automating-binary-exploit-detection","status":"publish","type":"post","link":"https:\/\/objectsecurity.com\/automating-binary-exploit-detection\/","title":{"rendered":"Automating Binary Exploit Detection using BinLens"},"content":{"rendered":"<p><div class=\"fusion-fullwidth fullwidth-box fusion-builder-row-1 fusion-flex-container has-pattern-background has-mask-background nonhundred-percent-fullwidth non-hundred-percent-height-scrolling\" style=\"--awb-border-radius-top-left:0px;--awb-border-radius-top-right:0px;--awb-border-radius-bottom-right:0px;--awb-border-radius-bottom-left:0px;--awb-flex-wrap:wrap;\" ><div class=\"fusion-builder-row fusion-row fusion-flex-align-items-flex-start fusion-flex-content-wrap\" style=\"max-width:1872px;margin-left: calc(-4% \/ 2 );margin-right: calc(-4% \/ 2 );\"><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-0 fusion_builder_column_1_1 1_1 fusion-flex-column\" style=\"--awb-bg-size:cover;--awb-width-large:100%;--awb-margin-top-large:0px;--awb-spacing-right-large:1.92%;--awb-margin-bottom-large:20px;--awb-spacing-left-large:1.92%;--awb-width-medium:100%;--awb-order-medium:0;--awb-spacing-right-medium:1.92%;--awb-spacing-left-medium:1.92%;--awb-width-small:100%;--awb-order-small:0;--awb-spacing-right-small:1.92%;--awb-spacing-left-small:1.92%;\"><div class=\"fusion-column-wrapper fusion-column-has-shadow fusion-flex-justify-content-flex-start fusion-content-layout-column\"><div class=\"fusion-text fusion-text-1\"><p><span style=\"font-size: 16.0pt;\"><strong>Binary analysis is essential for protecting software, running on various devices, when you do not have access to resources such as source code, open communications with the manufacturer, and otherwise private information that has not been made public. In each of these cases, traditional cybersecurity measures such as static source code analysis and applying the latest patch are not an option.<\/strong><\/span><\/p>\n<p>Most firmware analysis and SBOM generation vendors only report known and\/or publicly published vulnerabilities (i.e., CVEs). These vendors do not deeply inspect the ground truth of a program\u2019s behavior; they do not analyze the machine code being executed as defined at the binary level. This leaves much to be desired, as novel exploits that are not yet published in the National Vulnerability Database still pose a daily threat to the client organizations.<\/p>\n<p>This poses the following question: to what extent can novel binary exploit detection be automated? In this blog post, we will explore this problem through the lens of a user of <a href=\"https:\/\/objectsecurity.com\">ObjectSecurity&#8217;s BinLens\u2122<\/a> (formerly ObjectSecurity OT.AI Platform)\u00a0and walk through the steps they would take to detect a novel exploit in a binary executable program.<\/p>\n<\/div><\/div><\/div><\/div><\/div><div class=\"fusion-fullwidth fullwidth-box fusion-builder-row-2 fusion-flex-container has-pattern-background has-mask-background nonhundred-percent-fullwidth non-hundred-percent-height-scrolling\" style=\"--awb-border-radius-top-left:0px;--awb-border-radius-top-right:0px;--awb-border-radius-bottom-right:0px;--awb-border-radius-bottom-left:0px;--awb-flex-wrap:wrap;\" ><div class=\"fusion-builder-row fusion-row fusion-flex-align-items-flex-start fusion-flex-content-wrap\" style=\"max-width:1872px;margin-left: calc(-4% \/ 2 );margin-right: calc(-4% \/ 2 );\"><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-1 fusion_builder_column_1_1 1_1 fusion-flex-column\" style=\"--awb-bg-size:cover;--awb-width-large:100%;--awb-margin-top-large:0px;--awb-spacing-right-large:1.92%;--awb-margin-bottom-large:20px;--awb-spacing-left-large:1.92%;--awb-width-medium:100%;--awb-order-medium:0;--awb-spacing-right-medium:1.92%;--awb-spacing-left-medium:1.92%;--awb-width-small:100%;--awb-order-small:0;--awb-spacing-right-small:1.92%;--awb-spacing-left-small:1.92%;\"><div class=\"fusion-column-wrapper fusion-column-has-shadow fusion-flex-justify-content-flex-start fusion-content-layout-column\"><div class=\"fusion-title title fusion-title-1 fusion-sep-none fusion-title-text fusion-title-size-two\" style=\"--awb-margin-bottom:-5px;\"><h2 class=\"fusion-title-heading title-heading-left fusion-responsive-typography-calculated\" style=\"margin:0;--fontSize:40;line-height:var(--awb-typography1-line-height);\"><strong>Creating a Target Binary Executable<\/strong><\/h2><\/div><\/div><\/div><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-2 fusion_builder_column_1_2 1_2 fusion-flex-column\" style=\"--awb-bg-size:cover;--awb-width-large:50%;--awb-margin-top-large:0px;--awb-spacing-right-large:3.84%;--awb-margin-bottom-large:20px;--awb-spacing-left-large:3.84%;--awb-width-medium:100%;--awb-order-medium:0;--awb-spacing-right-medium:1.92%;--awb-spacing-left-medium:1.92%;--awb-width-small:100%;--awb-order-small:0;--awb-spacing-right-small:1.92%;--awb-spacing-left-small:1.92%;\"><div class=\"fusion-column-wrapper fusion-column-has-shadow fusion-flex-justify-content-flex-start fusion-content-layout-column\"><div class=\"fusion-text fusion-text-2\"><p>Imagine you have a program that reads some form of user input. Although the source of this user input may vary (e.g., from the terminal, over the network, from a UI form, etc.), in most cases the program will define an internal function to parse the input and perform some operation. The previous statement is quite general, so let\u2019s provide a concrete example.<\/p>\n<\/div><div class=\"fusion-text fusion-text-3\"><p>When compiled, the source code produces a binary that takes as input a single command line argument, and then performs one of two operations depending upon it.<\/p>\n<ol>\n<li>If the argument is not equal to the value <em>123<\/em>, the program performs a safe operation that causes no issues (<em>heap_safe())<\/em>.<\/li>\n<li>If the argument is equal to the value <em>123<\/em>, the program performs an unsafe operation that causes a heap overflow, segmentation fault, and program crash (<em>heap_overflow()<\/em>).<\/li>\n<\/ol>\n<\/div><div class=\"fusion-text fusion-text-4\"><p>This behavior is demonstrated in the screenshot below:<\/p>\n<\/div><div class=\"fusion-image-element \" style=\"text-align:left;--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><span class=\" fusion-imageframe imageframe-none imageframe-1 hover-type-none\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"624\" height=\"96\" title=\"Picture2\" src=\"https:\/\/i0.wp.com\/objectsecurity.com\/wp-content\/uploads\/2024\/04\/Picture2.png?resize=624%2C96&#038;ssl=1\" alt class=\"img-responsive wp-image-4436\" srcset=\"https:\/\/i0.wp.com\/objectsecurity.com\/wp-content\/uploads\/2024\/04\/Picture2.png?resize=200%2C31&amp;ssl=1 200w, https:\/\/i0.wp.com\/objectsecurity.com\/wp-content\/uploads\/2024\/04\/Picture2.png?resize=300%2C46&amp;ssl=1 300w, https:\/\/i0.wp.com\/objectsecurity.com\/wp-content\/uploads\/2024\/04\/Picture2.png?resize=400%2C62&amp;ssl=1 400w, https:\/\/i0.wp.com\/objectsecurity.com\/wp-content\/uploads\/2024\/04\/Picture2.png?resize=500%2C77&amp;ssl=1 500w, https:\/\/i0.wp.com\/objectsecurity.com\/wp-content\/uploads\/2024\/04\/Picture2.png?resize=600%2C92&amp;ssl=1 600w, https:\/\/i0.wp.com\/objectsecurity.com\/wp-content\/uploads\/2024\/04\/Picture2.png?fit=624%2C96&amp;ssl=1 624w\" sizes=\"(max-width: 1075px) 100vw, (max-width: 640px) 100vw, 624px\" \/><\/span><\/div><\/div><\/div><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-3 fusion_builder_column_1_2 1_2 fusion-flex-column\" style=\"--awb-bg-size:cover;--awb-width-large:50%;--awb-margin-top-large:0px;--awb-spacing-right-large:3.84%;--awb-margin-bottom-large:20px;--awb-spacing-left-large:3.84%;--awb-width-medium:100%;--awb-order-medium:0;--awb-spacing-right-medium:1.92%;--awb-spacing-left-medium:1.92%;--awb-width-small:100%;--awb-order-small:0;--awb-spacing-right-small:1.92%;--awb-spacing-left-small:1.92%;\"><div class=\"fusion-column-wrapper fusion-column-has-shadow fusion-flex-justify-content-flex-start fusion-content-layout-column\"><div class=\"fusion-image-element \" style=\"text-align:center;--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><span class=\" fusion-imageframe imageframe-none imageframe-2 hover-type-none\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"326\" height=\"704\" title=\"Picture1\" src=\"https:\/\/i0.wp.com\/objectsecurity.com\/wp-content\/uploads\/2024\/04\/Picture1.png?resize=326%2C704&#038;ssl=1\" alt class=\"img-responsive wp-image-4434\" srcset=\"https:\/\/i0.wp.com\/objectsecurity.com\/wp-content\/uploads\/2024\/04\/Picture1.png?resize=139%2C300&amp;ssl=1 139w, https:\/\/i0.wp.com\/objectsecurity.com\/wp-content\/uploads\/2024\/04\/Picture1.png?resize=200%2C432&amp;ssl=1 200w, https:\/\/i0.wp.com\/objectsecurity.com\/wp-content\/uploads\/2024\/04\/Picture1.png?fit=326%2C704&amp;ssl=1 326w\" sizes=\"(max-width: 1075px) 100vw, (max-width: 640px) 100vw, 326px\" \/><\/span><\/div><\/div><\/div><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-4 fusion_builder_column_1_1 1_1 fusion-flex-column\" style=\"--awb-bg-size:cover;--awb-width-large:100%;--awb-margin-top-large:0px;--awb-spacing-right-large:1.92%;--awb-margin-bottom-large:20px;--awb-spacing-left-large:1.92%;--awb-width-medium:100%;--awb-order-medium:0;--awb-spacing-right-medium:1.92%;--awb-spacing-left-medium:1.92%;--awb-width-small:100%;--awb-order-small:0;--awb-spacing-right-small:1.92%;--awb-spacing-left-small:1.92%;\"><div class=\"fusion-column-wrapper fusion-column-has-shadow fusion-flex-justify-content-flex-start fusion-content-layout-column\"><div class=\"fusion-text fusion-text-5\"><p>Although this example is contrived, it does mimic a simplified version of how vulnerable programs typically behave. Vulnerable programs read input data from an external source (in our case, a command line argument), and perform different operations depending on this input. These operations may contain certain weaknesses, some of which can be exploited if the program\u2019s developer wasn\u2019t careful enough.<\/p>\n<p>In a real-world example, these unsafe operations are hidden deep within a binary file, only occurring in certain obtuse cases. Many times, developers might lack the knowledge, time, or resources to account for every possible edge case. This makes automating the detection of unsafe operations critical.<\/p>\n<p>Let\u2019s assume that we don\u2019t have the source code for this binary (called <em>sample_1<\/em>), and that we don\u2019t know what inputs cause it to crash. How then could we determine if the binary is exploitable? More specifically, how can we reliably determine that input <em>123<\/em> causes the program to crash, if we were never told this information?<\/p>\n<\/div><\/div><\/div><\/div><\/div><div class=\"fusion-fullwidth fullwidth-box fusion-builder-row-3 fusion-flex-container has-pattern-background has-mask-background nonhundred-percent-fullwidth non-hundred-percent-height-scrolling\" style=\"--awb-border-radius-top-left:0px;--awb-border-radius-top-right:0px;--awb-border-radius-bottom-right:0px;--awb-border-radius-bottom-left:0px;--awb-flex-wrap:wrap;\" ><div class=\"fusion-builder-row fusion-row fusion-flex-align-items-flex-start fusion-flex-content-wrap\" style=\"max-width:1872px;margin-left: calc(-4% \/ 2 );margin-right: calc(-4% \/ 2 );\"><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-5 fusion_builder_column_1_1 1_1 fusion-flex-column\" style=\"--awb-bg-size:cover;--awb-width-large:100%;--awb-margin-top-large:0px;--awb-spacing-right-large:1.92%;--awb-margin-bottom-large:20px;--awb-spacing-left-large:1.92%;--awb-width-medium:100%;--awb-order-medium:0;--awb-spacing-right-medium:1.92%;--awb-spacing-left-medium:1.92%;--awb-width-small:100%;--awb-order-small:0;--awb-spacing-right-small:1.92%;--awb-spacing-left-small:1.92%;\"><div class=\"fusion-column-wrapper fusion-column-has-shadow fusion-flex-justify-content-flex-start fusion-content-layout-column\"><div class=\"fusion-title title fusion-title-2 fusion-sep-none fusion-title-text fusion-title-size-two\" style=\"--awb-margin-bottom:-5px;\"><h2 class=\"fusion-title-heading title-heading-left fusion-responsive-typography-calculated\" style=\"margin:0;--fontSize:40;line-height:var(--awb-typography1-line-height);\"><strong>A Primer on Fuzzing<\/strong><\/h2><\/div><\/div><\/div><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-6 fusion_builder_column_1_1 1_1 fusion-flex-column\" style=\"--awb-bg-size:cover;--awb-width-large:100%;--awb-margin-top-large:0px;--awb-spacing-right-large:1.92%;--awb-margin-bottom-large:20px;--awb-spacing-left-large:1.92%;--awb-width-medium:100%;--awb-order-medium:0;--awb-spacing-right-medium:1.92%;--awb-spacing-left-medium:1.92%;--awb-width-small:100%;--awb-order-small:0;--awb-spacing-right-small:1.92%;--awb-spacing-left-small:1.92%;\"><div class=\"fusion-column-wrapper fusion-column-has-shadow fusion-flex-justify-content-flex-start fusion-content-layout-column\"><div class=\"fusion-text fusion-text-6\"><p>Fuzzing is an automated testing method that feeds pseudo-random input into a target program to generate exploits. This input is typically malformed, invalid, and\/or unexpected. Fuzzing a vulnerable program sometimes results in the exploitation of one or more weaknesses, causing the program to crash or perform some other kind of unintended behavior. Some weaknesses include:<\/p>\n<ul>\n<li>Buffer overflows<\/li>\n<li>Use-after-free<\/li>\n<li>Memory leaks<\/li>\n<li>Divide by zero errors<\/li>\n<li>Integer and floating-point overflows<\/li>\n<li>NULL dereferences<\/li>\n<\/ul>\n<p>Each of these weaknesses, and many others, are detectable by <a href=\"https:\/\/objectsecurity.com\">ObjectSecurity&#8217;s BinLens\u2122<\/a> (formerly ObjectSecurity OT.AI Platform). We can use fuzzing in conjunction with the assessment information produced by <a href=\"https:\/\/objectsecurity.com\">ObjectSecurity&#8217;s BinLens\u2122<\/a> (formerly ObjectSecurity OT.AI Platform)\u00a0to prove or disprove if any detected weakness is exploitable. In the case of <em>sample_1<\/em>, our binary contains a heap overflow. A heap overflow occurs when memory on the program\u2019s heap is written to memory outside of the bounds that were allocated on the heap. Heap overflows can lead to segmentation faults, program crashes, data leaks, and data corruption.<\/p>\n<p>Fuzzing is useful when a program consumes untrusted inputs. For example:<\/p>\n<ul>\n<li>Devices that receive input from peripherals<\/li>\n<li>Network protocols<\/li>\n<li>Network scanners<\/li>\n<li>Browsers<\/li>\n<li>Text editors or parsers<\/li>\n<li>Databases<\/li>\n<\/ul>\n<p>Once again, our trivial <em>sample_1<\/em> case receives input from the command line, but you could imagine a more general case where the input is received from another source. The approach we will take to exploit the heap overflow weakness in <em>sample_1<\/em> will involve in-memory fuzzing. In-memory fuzzing alleviates the need to know where the input to a program is coming from, making it more generally applicable than something like interface fuzzing.<\/p>\n<\/div><\/div><\/div><\/div><\/div><div class=\"fusion-fullwidth fullwidth-box fusion-builder-row-4 fusion-flex-container has-pattern-background has-mask-background nonhundred-percent-fullwidth non-hundred-percent-height-scrolling\" style=\"--awb-border-radius-top-left:0px;--awb-border-radius-top-right:0px;--awb-border-radius-bottom-right:0px;--awb-border-radius-bottom-left:0px;--awb-flex-wrap:wrap;\" ><div class=\"fusion-builder-row fusion-row fusion-flex-align-items-flex-start fusion-flex-content-wrap\" style=\"max-width:1872px;margin-left: calc(-4% \/ 2 );margin-right: calc(-4% \/ 2 );\"><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-7 fusion_builder_column_1_1 1_1 fusion-flex-column\" style=\"--awb-bg-size:cover;--awb-width-large:100%;--awb-margin-top-large:0px;--awb-spacing-right-large:1.92%;--awb-margin-bottom-large:20px;--awb-spacing-left-large:1.92%;--awb-width-medium:100%;--awb-order-medium:0;--awb-spacing-right-medium:1.92%;--awb-spacing-left-medium:1.92%;--awb-width-small:100%;--awb-order-small:0;--awb-spacing-right-small:1.92%;--awb-spacing-left-small:1.92%;\"><div class=\"fusion-column-wrapper fusion-column-has-shadow fusion-flex-justify-content-flex-start fusion-content-layout-column\"><div class=\"fusion-title title fusion-title-3 fusion-sep-none fusion-title-text fusion-title-size-two\" style=\"--awb-margin-bottom:-5px;\"><h2 class=\"fusion-title-heading title-heading-left fusion-responsive-typography-calculated\" style=\"margin:0;--fontSize:40;line-height:var(--awb-typography1-line-height);\"><strong>In Memory Fuzzing using GDB<\/strong><\/h2><\/div><\/div><\/div><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-8 fusion_builder_column_1_1 1_1 fusion-flex-column\" style=\"--awb-bg-size:cover;--awb-width-large:100%;--awb-margin-top-large:0px;--awb-spacing-right-large:1.92%;--awb-margin-bottom-large:20px;--awb-spacing-left-large:1.92%;--awb-width-medium:100%;--awb-order-medium:0;--awb-spacing-right-medium:1.92%;--awb-spacing-left-medium:1.92%;--awb-width-small:100%;--awb-order-small:0;--awb-spacing-right-small:1.92%;--awb-spacing-left-small:1.92%;\"><div class=\"fusion-column-wrapper fusion-column-has-shadow fusion-flex-justify-content-flex-start fusion-content-layout-column\"><div class=\"fusion-text fusion-text-7\"><p>Our approach to determine if <em>sample_1<\/em> is exploitable consists of the following steps:<\/p>\n<ol>\n<li>Identify the program counter (PC) address containing the weakness that we wish to exploit.<\/li>\n<li>Identify the function which contains this weakness, and its corresponding PC address.<\/li>\n<li>Identify the arguments to this function, including their type, count, and possible variations.<\/li>\n<li>Fuzz the arguments to this function by iteratively mutating their values in memory.<\/li>\n<li>Crash the program and report the details as an exploit.<\/li>\n<\/ol>\n<p>Each step in this process can be generalized to varying degrees for other binary programs outside of just <em>sample_1<\/em>. Although how step 3 is accomplished depends highly on the CPU architecture, compiler, and other factors, step 3 can be completed for pretty much any binary program you could envision. The same is true for the other steps. For the sake of simplicity, this article will stick to how the steps apply to <em>sample_1<\/em>, and not focus too much on how each step applies to other binaries in general. That is a focus for another time.<\/p>\n<p>Steps 1 and 2 are fully automated by <a href=\"https:\/\/objectsecurity.com\">ObjectSecurity&#8217;s BinLens\u2122<\/a> (formerly ObjectSecurity OT.AI Platform). When scanned, various assessments performed by the platform identified PC address <em>0x1220<\/em> as the location of a weakness. For example, the Weak Pointers assessment reported <em>0x1220<\/em> as a containing a weak pointer:<\/p>\n<\/div><div class=\"fusion-image-element \" style=\"text-align:center;--awb-margin-top:0px;--awb-margin-bottom:20px;--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><span class=\" fusion-imageframe imageframe-none imageframe-3 hover-type-none\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"609\" height=\"362\" title=\"Picture3\" src=\"https:\/\/i0.wp.com\/objectsecurity.com\/wp-content\/uploads\/2024\/04\/Picture3.png?resize=609%2C362&#038;ssl=1\" alt class=\"img-responsive wp-image-4441\" srcset=\"https:\/\/i0.wp.com\/objectsecurity.com\/wp-content\/uploads\/2024\/04\/Picture3.png?resize=200%2C119&amp;ssl=1 200w, https:\/\/i0.wp.com\/objectsecurity.com\/wp-content\/uploads\/2024\/04\/Picture3.png?resize=300%2C178&amp;ssl=1 300w, https:\/\/i0.wp.com\/objectsecurity.com\/wp-content\/uploads\/2024\/04\/Picture3.png?resize=400%2C238&amp;ssl=1 400w, https:\/\/i0.wp.com\/objectsecurity.com\/wp-content\/uploads\/2024\/04\/Picture3.png?resize=500%2C297&amp;ssl=1 500w, https:\/\/i0.wp.com\/objectsecurity.com\/wp-content\/uploads\/2024\/04\/Picture3.png?resize=600%2C357&amp;ssl=1 600w, https:\/\/i0.wp.com\/objectsecurity.com\/wp-content\/uploads\/2024\/04\/Picture3.png?fit=609%2C362&amp;ssl=1 609w\" sizes=\"(max-width: 1075px) 100vw, (max-width: 640px) 100vw, 609px\" \/><\/span><\/div><div class=\"fusion-text fusion-text-8\"><p>The Dangerous Functions assessment reported a potentially dangerous instance of <em>memcpy()<\/em> at <em>0x1220<\/em>.<\/p>\n<\/div><div class=\"fusion-image-element \" style=\"text-align:center;--awb-margin-bottom:20px;--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><span class=\" fusion-imageframe imageframe-none imageframe-4 hover-type-none\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"617\" height=\"215\" title=\"Picture4\" src=\"https:\/\/i0.wp.com\/objectsecurity.com\/wp-content\/uploads\/2024\/04\/Picture4.png?resize=617%2C215&#038;ssl=1\" alt class=\"img-responsive wp-image-4442\" srcset=\"https:\/\/i0.wp.com\/objectsecurity.com\/wp-content\/uploads\/2024\/04\/Picture4.png?resize=200%2C70&amp;ssl=1 200w, https:\/\/i0.wp.com\/objectsecurity.com\/wp-content\/uploads\/2024\/04\/Picture4.png?resize=300%2C105&amp;ssl=1 300w, https:\/\/i0.wp.com\/objectsecurity.com\/wp-content\/uploads\/2024\/04\/Picture4.png?resize=400%2C139&amp;ssl=1 400w, https:\/\/i0.wp.com\/objectsecurity.com\/wp-content\/uploads\/2024\/04\/Picture4.png?resize=500%2C174&amp;ssl=1 500w, https:\/\/i0.wp.com\/objectsecurity.com\/wp-content\/uploads\/2024\/04\/Picture4.png?resize=600%2C209&amp;ssl=1 600w, https:\/\/i0.wp.com\/objectsecurity.com\/wp-content\/uploads\/2024\/04\/Picture4.png?fit=617%2C215&amp;ssl=1 617w\" sizes=\"(max-width: 1075px) 100vw, (max-width: 640px) 100vw, 617px\" \/><\/span><\/div><div class=\"fusion-text fusion-text-9\"><p>Other CWE-120 assessments also reported <em>memcpy()<\/em> at <em>0x1220<\/em>, including a general buffer overflow detection assessment:<\/p>\n<\/div><div class=\"fusion-image-element \" style=\"text-align:center;--awb-margin-bottom:20px;--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><span class=\" fusion-imageframe imageframe-none imageframe-5 hover-type-none\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"624\" height=\"345\" title=\"Picture5\" src=\"https:\/\/i0.wp.com\/objectsecurity.com\/wp-content\/uploads\/2024\/04\/Picture5.png?resize=624%2C345&#038;ssl=1\" alt class=\"img-responsive wp-image-4443\" srcset=\"https:\/\/i0.wp.com\/objectsecurity.com\/wp-content\/uploads\/2024\/04\/Picture5.png?resize=200%2C111&amp;ssl=1 200w, https:\/\/i0.wp.com\/objectsecurity.com\/wp-content\/uploads\/2024\/04\/Picture5.png?resize=300%2C166&amp;ssl=1 300w, https:\/\/i0.wp.com\/objectsecurity.com\/wp-content\/uploads\/2024\/04\/Picture5.png?resize=400%2C221&amp;ssl=1 400w, https:\/\/i0.wp.com\/objectsecurity.com\/wp-content\/uploads\/2024\/04\/Picture5.png?resize=500%2C276&amp;ssl=1 500w, https:\/\/i0.wp.com\/objectsecurity.com\/wp-content\/uploads\/2024\/04\/Picture5.png?resize=600%2C332&amp;ssl=1 600w, https:\/\/i0.wp.com\/objectsecurity.com\/wp-content\/uploads\/2024\/04\/Picture5.png?fit=624%2C345&amp;ssl=1 624w\" sizes=\"(max-width: 1075px) 100vw, (max-width: 640px) 100vw, 624px\" \/><\/span><\/div><div class=\"fusion-text fusion-text-10\"><p>Viewing the <em>0x1220<\/em> address in BinLens&#8217; disassembler\/decompiler showed that the function containing the weakness is called <em>heap_overflow()<\/em>,and that <em>heap_overflow()<\/em> is called from <em>memory_operation()<\/em>.<\/p>\n<\/div><div class=\"fusion-image-element \" style=\"text-align:center;--awb-margin-bottom:20px;--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><span class=\" fusion-imageframe imageframe-none imageframe-6 hover-type-none\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"607\" height=\"520\" title=\"Picture6\" src=\"https:\/\/i0.wp.com\/objectsecurity.com\/wp-content\/uploads\/2024\/04\/Picture6.png?resize=607%2C520&#038;ssl=1\" alt class=\"img-responsive wp-image-4444\" srcset=\"https:\/\/i0.wp.com\/objectsecurity.com\/wp-content\/uploads\/2024\/04\/Picture6.png?resize=200%2C171&amp;ssl=1 200w, https:\/\/i0.wp.com\/objectsecurity.com\/wp-content\/uploads\/2024\/04\/Picture6.png?resize=300%2C257&amp;ssl=1 300w, https:\/\/i0.wp.com\/objectsecurity.com\/wp-content\/uploads\/2024\/04\/Picture6.png?resize=400%2C343&amp;ssl=1 400w, https:\/\/i0.wp.com\/objectsecurity.com\/wp-content\/uploads\/2024\/04\/Picture6.png?resize=500%2C428&amp;ssl=1 500w, https:\/\/i0.wp.com\/objectsecurity.com\/wp-content\/uploads\/2024\/04\/Picture6.png?resize=600%2C514&amp;ssl=1 600w, https:\/\/i0.wp.com\/objectsecurity.com\/wp-content\/uploads\/2024\/04\/Picture6.png?fit=607%2C520&amp;ssl=1 607w\" sizes=\"(max-width: 1075px) 100vw, (max-width: 640px) 100vw, 607px\" \/><\/span><\/div><div class=\"fusion-image-element \" style=\"text-align:center;--awb-margin-top:10px;--awb-margin-bottom:20px;--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><span class=\" fusion-imageframe imageframe-none imageframe-7 hover-type-none\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"452\" height=\"661\" title=\"Picture7\" src=\"https:\/\/i0.wp.com\/objectsecurity.com\/wp-content\/uploads\/2024\/04\/Picture7.png?resize=452%2C661&#038;ssl=1\" alt class=\"img-responsive wp-image-4445\" srcset=\"https:\/\/i0.wp.com\/objectsecurity.com\/wp-content\/uploads\/2024\/04\/Picture7.png?resize=200%2C292&amp;ssl=1 200w, https:\/\/i0.wp.com\/objectsecurity.com\/wp-content\/uploads\/2024\/04\/Picture7.png?resize=205%2C300&amp;ssl=1 205w, https:\/\/i0.wp.com\/objectsecurity.com\/wp-content\/uploads\/2024\/04\/Picture7.png?resize=400%2C585&amp;ssl=1 400w, https:\/\/i0.wp.com\/objectsecurity.com\/wp-content\/uploads\/2024\/04\/Picture7.png?fit=452%2C661&amp;ssl=1 452w\" sizes=\"(max-width: 1075px) 100vw, (max-width: 640px) 100vw, 452px\" \/><\/span><\/div><div class=\"fusion-text fusion-text-11\"><p>BinLens took under 5 minutes to fully reverse engineer <em>sample_1<\/em> (both disassembly and decompilation) and to produce these results.<\/p>\n<\/div><\/div><\/div><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-9 fusion_builder_column_1_2 1_2 fusion-flex-column\" style=\"--awb-bg-size:cover;--awb-width-large:50%;--awb-margin-top-large:0px;--awb-spacing-right-large:3.84%;--awb-margin-bottom-large:20px;--awb-spacing-left-large:3.84%;--awb-width-medium:100%;--awb-order-medium:0;--awb-spacing-right-medium:1.92%;--awb-spacing-left-medium:1.92%;--awb-width-small:100%;--awb-order-small:0;--awb-spacing-right-small:1.92%;--awb-spacing-left-small:1.92%;\"><div class=\"fusion-column-wrapper fusion-column-has-shadow fusion-flex-justify-content-flex-start fusion-content-layout-column\"><div class=\"fusion-text fusion-text-12\"><p>For step 3, the GNU Project Debugger (GDB) can be used to determine the argument(s) to the <em>memory_operation()<\/em> function. GDB lets you see what is going on \u2018inside\u2019 another program while it executes (in this case, \u2018inside\u2019 <em>sample_1<\/em>). GDB is typically used during the development process to find and address problems in source code but can also be used on binaries exclusively.<\/p>\n<\/div><\/div><\/div><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-10 fusion_builder_column_1_2 1_2 fusion-flex-column\" style=\"--awb-bg-size:cover;--awb-width-large:50%;--awb-margin-top-large:0px;--awb-spacing-right-large:3.84%;--awb-margin-bottom-large:20px;--awb-spacing-left-large:3.84%;--awb-width-medium:100%;--awb-order-medium:0;--awb-spacing-right-medium:1.92%;--awb-spacing-left-medium:1.92%;--awb-width-small:100%;--awb-order-small:0;--awb-spacing-right-small:1.92%;--awb-spacing-left-small:1.92%;\"><div class=\"fusion-column-wrapper fusion-column-has-shadow fusion-flex-justify-content-flex-start fusion-content-layout-column\"><div class=\"fusion-image-element \" style=\"--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><span class=\" fusion-imageframe imageframe-none imageframe-8 hover-type-none\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"367\" height=\"65\" title=\"Picture8\" src=\"https:\/\/i0.wp.com\/objectsecurity.com\/wp-content\/uploads\/2024\/04\/Picture8.png?resize=367%2C65&#038;ssl=1\" alt class=\"img-responsive wp-image-4448\" srcset=\"https:\/\/i0.wp.com\/objectsecurity.com\/wp-content\/uploads\/2024\/04\/Picture8.png?resize=200%2C35&amp;ssl=1 200w, https:\/\/i0.wp.com\/objectsecurity.com\/wp-content\/uploads\/2024\/04\/Picture8.png?resize=300%2C53&amp;ssl=1 300w, https:\/\/i0.wp.com\/objectsecurity.com\/wp-content\/uploads\/2024\/04\/Picture8.png?fit=367%2C65&amp;ssl=1 367w\" sizes=\"(max-width: 1075px) 100vw, (max-width: 640px) 100vw, 367px\" \/><\/span><\/div><\/div><\/div><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-11 fusion_builder_column_1_2 1_2 fusion-flex-column\" style=\"--awb-bg-size:cover;--awb-width-large:50%;--awb-margin-top-large:0px;--awb-spacing-right-large:3.84%;--awb-margin-bottom-large:20px;--awb-spacing-left-large:3.84%;--awb-width-medium:100%;--awb-order-medium:0;--awb-spacing-right-medium:1.92%;--awb-spacing-left-medium:1.92%;--awb-width-small:100%;--awb-order-small:0;--awb-spacing-right-small:1.92%;--awb-spacing-left-small:1.92%;\"><div class=\"fusion-column-wrapper fusion-column-has-shadow fusion-flex-justify-content-flex-start fusion-content-layout-column\"><div class=\"fusion-text fusion-text-13\"><p>A breakpoint at the <em>memory_operation()<\/em> function can be set using the <em>break memory_operation<\/em> command. This breakpoint will halt <em>sample_1<\/em>\u2019s execution and allow us to run other GDB command at that time.<\/p>\n<\/div><\/div><\/div><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-12 fusion_builder_column_1_2 1_2 fusion-flex-column\" style=\"--awb-bg-size:cover;--awb-width-large:50%;--awb-margin-top-large:0px;--awb-spacing-right-large:3.84%;--awb-margin-bottom-large:20px;--awb-spacing-left-large:3.84%;--awb-width-medium:100%;--awb-order-medium:0;--awb-spacing-right-medium:1.92%;--awb-spacing-left-medium:1.92%;--awb-width-small:100%;--awb-order-small:0;--awb-spacing-right-small:1.92%;--awb-spacing-left-small:1.92%;\"><div class=\"fusion-column-wrapper fusion-column-has-shadow fusion-flex-justify-content-flex-start fusion-content-layout-column\"><div class=\"fusion-image-element \" style=\"--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><span class=\" fusion-imageframe imageframe-none imageframe-9 hover-type-none\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"265\" height=\"45\" title=\"Picture9\" src=\"https:\/\/i0.wp.com\/objectsecurity.com\/wp-content\/uploads\/2024\/04\/Picture9.png?resize=265%2C45&#038;ssl=1\" alt class=\"img-responsive wp-image-4449\" srcset=\"https:\/\/i0.wp.com\/objectsecurity.com\/wp-content\/uploads\/2024\/04\/Picture9.png?resize=200%2C34&amp;ssl=1 200w, https:\/\/i0.wp.com\/objectsecurity.com\/wp-content\/uploads\/2024\/04\/Picture9.png?fit=265%2C45&amp;ssl=1 265w\" sizes=\"(max-width: 1075px) 100vw, (max-width: 640px) 100vw, 265px\" \/><\/span><\/div><\/div><\/div><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-13 fusion_builder_column_1_2 1_2 fusion-flex-column\" style=\"--awb-bg-size:cover;--awb-width-large:50%;--awb-margin-top-large:0px;--awb-spacing-right-large:3.84%;--awb-margin-bottom-large:20px;--awb-spacing-left-large:3.84%;--awb-width-medium:100%;--awb-order-medium:0;--awb-spacing-right-medium:1.92%;--awb-spacing-left-medium:1.92%;--awb-width-small:100%;--awb-order-small:0;--awb-spacing-right-small:1.92%;--awb-spacing-left-small:1.92%;\"><div class=\"fusion-column-wrapper fusion-column-has-shadow fusion-flex-justify-content-flex-start fusion-content-layout-column\"><div class=\"fusion-text fusion-text-14\"><p>We can then begin program execution. Because <em>sample_1<\/em> requires us to input a command line argument, we include the command line argument as \u201c<em>arg\u201d<\/em>:<\/p>\n<\/div><\/div><\/div><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-14 fusion_builder_column_1_2 1_2 fusion-flex-column\" style=\"--awb-bg-size:cover;--awb-width-large:50%;--awb-margin-top-large:0px;--awb-spacing-right-large:3.84%;--awb-margin-bottom-large:20px;--awb-spacing-left-large:3.84%;--awb-width-medium:100%;--awb-order-medium:0;--awb-spacing-right-medium:1.92%;--awb-spacing-left-medium:1.92%;--awb-width-small:100%;--awb-order-small:0;--awb-spacing-right-small:1.92%;--awb-spacing-left-small:1.92%;\"><div class=\"fusion-column-wrapper fusion-column-has-shadow fusion-flex-justify-content-flex-start fusion-content-layout-column\"><div class=\"fusion-image-element \" style=\"--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><span class=\" fusion-imageframe imageframe-none imageframe-10 hover-type-none\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"624\" height=\"106\" title=\"Picture10\" src=\"https:\/\/i0.wp.com\/objectsecurity.com\/wp-content\/uploads\/2024\/04\/Picture10.png?resize=624%2C106&#038;ssl=1\" alt class=\"img-responsive wp-image-4452\" srcset=\"https:\/\/i0.wp.com\/objectsecurity.com\/wp-content\/uploads\/2024\/04\/Picture10.png?resize=200%2C34&amp;ssl=1 200w, https:\/\/i0.wp.com\/objectsecurity.com\/wp-content\/uploads\/2024\/04\/Picture10.png?resize=300%2C51&amp;ssl=1 300w, https:\/\/i0.wp.com\/objectsecurity.com\/wp-content\/uploads\/2024\/04\/Picture10.png?resize=400%2C68&amp;ssl=1 400w, https:\/\/i0.wp.com\/objectsecurity.com\/wp-content\/uploads\/2024\/04\/Picture10.png?resize=500%2C85&amp;ssl=1 500w, https:\/\/i0.wp.com\/objectsecurity.com\/wp-content\/uploads\/2024\/04\/Picture10.png?resize=600%2C102&amp;ssl=1 600w, https:\/\/i0.wp.com\/objectsecurity.com\/wp-content\/uploads\/2024\/04\/Picture10.png?fit=624%2C106&amp;ssl=1 624w\" sizes=\"(max-width: 1075px) 100vw, (max-width: 640px) 100vw, 624px\" \/><\/span><\/div><\/div><\/div><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-15 fusion_builder_column_1_2 1_2 fusion-flex-column\" style=\"--awb-bg-size:cover;--awb-width-large:50%;--awb-margin-top-large:0px;--awb-spacing-right-large:3.84%;--awb-margin-bottom-large:20px;--awb-spacing-left-large:3.84%;--awb-width-medium:100%;--awb-order-medium:0;--awb-spacing-right-medium:1.92%;--awb-spacing-left-medium:1.92%;--awb-width-small:100%;--awb-order-small:0;--awb-spacing-right-small:1.92%;--awb-spacing-left-small:1.92%;\"><div class=\"fusion-column-wrapper fusion-column-has-shadow fusion-flex-justify-content-flex-start fusion-content-layout-column\"><div class=\"fusion-text fusion-text-15\"><p>As shown above, GDB pauses the binary&#8217;s execution at the start of the <em>memory_operation()<\/em> function. At this point, we can determine the arguments to this function:<\/p>\n<\/div><\/div><\/div><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-16 fusion_builder_column_1_2 1_2 fusion-flex-column\" style=\"--awb-bg-size:cover;--awb-width-large:50%;--awb-margin-top-large:0px;--awb-spacing-right-large:3.84%;--awb-margin-bottom-large:20px;--awb-spacing-left-large:3.84%;--awb-width-medium:100%;--awb-order-medium:0;--awb-spacing-right-medium:1.92%;--awb-spacing-left-medium:1.92%;--awb-width-small:100%;--awb-order-small:0;--awb-spacing-right-small:1.92%;--awb-spacing-left-small:1.92%;\"><div class=\"fusion-column-wrapper fusion-column-has-shadow fusion-flex-justify-content-flex-start fusion-content-layout-column\"><div class=\"fusion-image-element \" style=\"--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><span class=\" fusion-imageframe imageframe-none imageframe-11 hover-type-none\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"201\" height=\"46\" title=\"Picture11\" src=\"https:\/\/i0.wp.com\/objectsecurity.com\/wp-content\/uploads\/2024\/04\/Picture11.png?resize=201%2C46&#038;ssl=1\" alt class=\"img-responsive wp-image-4454\"\/><\/span><\/div><\/div><\/div><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-17 fusion_builder_column_1_1 1_1 fusion-flex-column\" style=\"--awb-bg-size:cover;--awb-width-large:100%;--awb-margin-top-large:0px;--awb-spacing-right-large:1.92%;--awb-margin-bottom-large:20px;--awb-spacing-left-large:1.92%;--awb-width-medium:100%;--awb-order-medium:0;--awb-spacing-right-medium:1.92%;--awb-spacing-left-medium:1.92%;--awb-width-small:100%;--awb-order-small:0;--awb-spacing-right-small:1.92%;--awb-spacing-left-small:1.92%;\"><div class=\"fusion-column-wrapper fusion-column-has-shadow fusion-flex-justify-content-flex-start fusion-content-layout-column\"><div class=\"fusion-text fusion-text-16\"><p>The command above prints the value of the RDI register (in this case, the memory address <em>0x7fffffffdeda<\/em>) and the value found at memory address pointed to by the RDI register (in this case, <em>&#8220;arg&#8221;<\/em>). As you can see, the RDI register points to memory containing the command line argument we gave to the program when we began running it.<\/p>\n<p><em>(NOTE: This could have been in any register. Arguments are not always stored exclusively in the RDI register. This behavior varies between CPUs, compilers, and programming languages.)<\/em><\/p>\n<p>For step 4, we want to fuzz the arguments to the <em>memory_operation()<\/em> function by manipulating the value found at memory address <em>0x7fffffffdeda<\/em>: the memory address pointed to by the RDI register. To do this, I have provided a Python script called <a class=\"fusion-one-page-text-link\" href=\"#function_fuzzer\">function_fuzzer.py<\/a> which makes use Python\u2019s GDB library to instrument GDB. The source code for this script can be found at the bottom of this article. The gist of this script is as follows:<\/p>\n<p style=\"padding-left: 40px;\">[4.1]\u00a0\u00a0 Set a breakpoint at the start of the <em>memory_operation() <\/em>function.<\/p>\n<p style=\"padding-left: 40px;\">[4.2]\u00a0 Start executing the binary.<\/p>\n<p style=\"padding-left: 40px;\">[4.3]\u00a0 Once at the breakpoint, create a checkpoint. This checkpoint allows GDB to rewind the binary&#8217;s state (e.g., current PC address, all register values, values stored in memory, etc.) to how it was at the time the checkpoint was created.<\/p>\n<p style=\"padding-left: 40px;\">[4.4] Overwrite the value at the memory address pointed to by the RDI register with a random value.<\/p>\n<p style=\"padding-left: 40px;\">[4.5] Finish executing the <em>memory_operation()<\/em> function. If the program does not crash, rewind to the checkpoint created in [4.3]. If the program crashes, report the exploit.<\/p>\n<p><em>(NOTE: In [4.4], you could alternatively allocate the random value to a different memory address and mutate the RDI register to point to this different memory address. This approach may be more applicable in certain scenarios.)<\/em><\/p>\n<p>Running this script produced the follow output, some of which has been condensed as to not bloat the content of this article:<\/p>\n<\/div><div class=\"fusion-image-element \" style=\"text-align:center;--awb-margin-bottom:20px;--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><span class=\" fusion-imageframe imageframe-none imageframe-12 hover-type-none\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"494\" height=\"425\" title=\"Picture12\" src=\"https:\/\/i0.wp.com\/objectsecurity.com\/wp-content\/uploads\/2024\/04\/Picture12.png?resize=494%2C425&#038;ssl=1\" alt class=\"img-responsive wp-image-4456\" srcset=\"https:\/\/i0.wp.com\/objectsecurity.com\/wp-content\/uploads\/2024\/04\/Picture12.png?resize=200%2C172&amp;ssl=1 200w, https:\/\/i0.wp.com\/objectsecurity.com\/wp-content\/uploads\/2024\/04\/Picture12.png?resize=300%2C258&amp;ssl=1 300w, https:\/\/i0.wp.com\/objectsecurity.com\/wp-content\/uploads\/2024\/04\/Picture12.png?resize=400%2C344&amp;ssl=1 400w, https:\/\/i0.wp.com\/objectsecurity.com\/wp-content\/uploads\/2024\/04\/Picture12.png?fit=494%2C425&amp;ssl=1 494w\" sizes=\"(max-width: 1075px) 100vw, (max-width: 640px) 100vw, 494px\" \/><\/span><\/div><div class=\"fusion-text fusion-text-17\"><p>As you can see, on iteration 1180 the input <em>123<\/em> was attempted. This input caused the program to perform a heap overflow, segmentation fault, and ultimately crash. The script took under a minute to find the exploit, although this speed was hastened because we only fuzzed with 3-byte long numeric values.<\/p>\n<\/div><div class=\"fusion-image-element \" style=\"text-align:center;--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><span class=\" fusion-imageframe imageframe-none imageframe-13 hover-type-none\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"505\" height=\"137\" title=\"Picture13\" src=\"https:\/\/i0.wp.com\/objectsecurity.com\/wp-content\/uploads\/2024\/04\/Picture13.png?resize=505%2C137&#038;ssl=1\" alt class=\"img-responsive wp-image-4458\" srcset=\"https:\/\/i0.wp.com\/objectsecurity.com\/wp-content\/uploads\/2024\/04\/Picture13.png?resize=200%2C54&amp;ssl=1 200w, https:\/\/i0.wp.com\/objectsecurity.com\/wp-content\/uploads\/2024\/04\/Picture13.png?resize=300%2C81&amp;ssl=1 300w, https:\/\/i0.wp.com\/objectsecurity.com\/wp-content\/uploads\/2024\/04\/Picture13.png?resize=400%2C109&amp;ssl=1 400w, https:\/\/i0.wp.com\/objectsecurity.com\/wp-content\/uploads\/2024\/04\/Picture13.png?resize=500%2C136&amp;ssl=1 500w, https:\/\/i0.wp.com\/objectsecurity.com\/wp-content\/uploads\/2024\/04\/Picture13.png?fit=505%2C137&amp;ssl=1 505w\" sizes=\"(max-width: 1075px) 100vw, (max-width: 640px) 100vw, 505px\" \/><\/span><\/div><\/div><\/div><\/div><\/div><div class=\"fusion-fullwidth fullwidth-box fusion-builder-row-5 fusion-flex-container has-pattern-background has-mask-background nonhundred-percent-fullwidth non-hundred-percent-height-scrolling\" style=\"--awb-border-radius-top-left:0px;--awb-border-radius-top-right:0px;--awb-border-radius-bottom-right:0px;--awb-border-radius-bottom-left:0px;--awb-flex-wrap:wrap;\" ><div class=\"fusion-builder-row fusion-row fusion-flex-align-items-flex-start fusion-flex-content-wrap\" style=\"max-width:1872px;margin-left: calc(-4% \/ 2 );margin-right: calc(-4% \/ 2 );\"><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-18 fusion_builder_column_1_1 1_1 fusion-flex-column\" style=\"--awb-bg-size:cover;--awb-width-large:100%;--awb-margin-top-large:0px;--awb-spacing-right-large:1.92%;--awb-margin-bottom-large:20px;--awb-spacing-left-large:1.92%;--awb-width-medium:100%;--awb-order-medium:0;--awb-spacing-right-medium:1.92%;--awb-spacing-left-medium:1.92%;--awb-width-small:100%;--awb-order-small:0;--awb-spacing-right-small:1.92%;--awb-spacing-left-small:1.92%;\"><div class=\"fusion-column-wrapper fusion-column-has-shadow fusion-flex-justify-content-flex-start fusion-content-layout-column\"><div class=\"fusion-title title fusion-title-4 fusion-sep-none fusion-title-text fusion-title-size-two\" style=\"--awb-margin-bottom:-5px;\"><h2 class=\"fusion-title-heading title-heading-left fusion-responsive-typography-calculated\" style=\"margin:0;--fontSize:40;line-height:var(--awb-typography1-line-height);\"><strong>Conclusion<\/strong><\/h2><\/div><\/div><\/div><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-19 fusion_builder_column_1_1 1_1 fusion-flex-column\" style=\"--awb-bg-size:cover;--awb-width-large:100%;--awb-margin-top-large:0px;--awb-spacing-right-large:1.92%;--awb-margin-bottom-large:20px;--awb-spacing-left-large:1.92%;--awb-width-medium:100%;--awb-order-medium:0;--awb-spacing-right-medium:1.92%;--awb-spacing-left-medium:1.92%;--awb-width-small:100%;--awb-order-small:0;--awb-spacing-right-small:1.92%;--awb-spacing-left-small:1.92%;\"><div class=\"fusion-column-wrapper fusion-column-has-shadow fusion-flex-justify-content-flex-start fusion-content-layout-column\"><div class=\"fusion-text fusion-text-18\"><p>This article demonstrates how parts of the novel binary exploit generation process can be automated using <a href=\"https:\/\/objectsecurity.com\">ObjectSecurity&#8217;s BinLens\u2122<\/a> (formerly ObjectSecurity OT.AI Platform), most notably target weakness detection. Because fuzzing is a time-consuming and computationally intensive process, we hope that the time saved by <a href=\"https:\/\/objectsecurity.com\">ObjectSecurity&#8217;s BinLens\u2122<\/a> (formerly ObjectSecurity OT.AI Platform)\u00a0in detecting and cataloging binary weaknesses allows for faster and more informed threat hunting. In the future, we plan on further automating the novel exploit detection process and improving our automated binary reverse engineering capabilities.<\/p>\n<\/div><\/div><\/div><\/div><\/div><div class=\"fusion-fullwidth fullwidth-box fusion-builder-row-6 fusion-flex-container has-pattern-background has-mask-background nonhundred-percent-fullwidth non-hundred-percent-height-scrolling\" style=\"--awb-border-radius-top-left:0px;--awb-border-radius-top-right:0px;--awb-border-radius-bottom-right:0px;--awb-border-radius-bottom-left:0px;--awb-flex-wrap:wrap;\" ><div class=\"fusion-builder-row fusion-row fusion-flex-align-items-flex-start fusion-flex-content-wrap\" style=\"max-width:1872px;margin-left: calc(-4% \/ 2 );margin-right: calc(-4% \/ 2 );\"><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-20 fusion_builder_column_1_1 1_1 fusion-flex-column\" style=\"--awb-bg-size:cover;--awb-width-large:100%;--awb-margin-top-large:0px;--awb-spacing-right-large:1.92%;--awb-margin-bottom-large:20px;--awb-spacing-left-large:1.92%;--awb-width-medium:100%;--awb-order-medium:0;--awb-spacing-right-medium:1.92%;--awb-spacing-left-medium:1.92%;--awb-width-small:100%;--awb-order-small:0;--awb-spacing-right-small:1.92%;--awb-spacing-left-small:1.92%;\"><div class=\"fusion-column-wrapper fusion-column-has-shadow fusion-flex-justify-content-flex-start fusion-content-layout-column\"><div class=\"fusion-title title fusion-title-5 fusion-sep-none fusion-title-text fusion-title-size-three\" style=\"--awb-margin-bottom:-15px;\"><h3 class=\"fusion-title-heading title-heading-left fusion-responsive-typography-calculated\" style=\"margin:0;--fontSize:24;--minFontSize:24;line-height:var(--awb-typography1-line-height);\"><strong>Caveats<\/strong><\/h3><\/div><\/div><\/div><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-21 fusion_builder_column_1_1 1_1 fusion-flex-column\" style=\"--awb-bg-size:cover;--awb-width-large:100%;--awb-margin-top-large:0px;--awb-spacing-right-large:1.92%;--awb-margin-bottom-large:20px;--awb-spacing-left-large:1.92%;--awb-width-medium:100%;--awb-order-medium:0;--awb-spacing-right-medium:1.92%;--awb-spacing-left-medium:1.92%;--awb-width-small:100%;--awb-order-small:0;--awb-spacing-right-small:1.92%;--awb-spacing-left-small:1.92%;\"><div class=\"fusion-column-wrapper fusion-column-has-shadow fusion-flex-justify-content-flex-start fusion-content-layout-column\"><div class=\"fusion-text fusion-text-19\"><ul>\n<li>This approach assumes that the targeted binary is unstripped. When a binary is unstripped, it retains function names and other metadata. Knowing the exact function name isn&#8217;t too important, as GDB can set breakpoints at PC addresses, although the procedure outlined in this article would need to be altered slightly to work with stripped binaries.<\/li>\n<li>This approach assumes the binary is compiled for an x86 instruction set. Different instruction sets would require different methods for determining function arguments and other factors, although the broad strokes of this article still apply.<\/li>\n<li>This approach assumes that the host environment running GDB has the same CPU architecture and operating system as the target binary; the target binary was compiled on the same host that is running GDB. There are work arounds for this as well, including binary rehosting and\/or various other methods.<\/li>\n<\/ul>\n<\/div><\/div><\/div><\/div><\/div><div class=\"fusion-fullwidth fullwidth-box fusion-builder-row-7 fusion-flex-container has-pattern-background has-mask-background nonhundred-percent-fullwidth non-hundred-percent-height-scrolling\" style=\"--awb-border-radius-top-left:0px;--awb-border-radius-top-right:0px;--awb-border-radius-bottom-right:0px;--awb-border-radius-bottom-left:0px;--awb-flex-wrap:wrap;\" ><div class=\"fusion-builder-row fusion-row fusion-flex-align-items-flex-start fusion-flex-content-wrap\" style=\"max-width:1872px;margin-left: calc(-4% \/ 2 );margin-right: calc(-4% \/ 2 );\"><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-22 fusion_builder_column_1_1 1_1 fusion-flex-column\" style=\"--awb-bg-size:cover;--awb-width-large:100%;--awb-margin-top-large:0px;--awb-spacing-right-large:1.92%;--awb-margin-bottom-large:20px;--awb-spacing-left-large:1.92%;--awb-width-medium:100%;--awb-order-medium:0;--awb-spacing-right-medium:1.92%;--awb-spacing-left-medium:1.92%;--awb-width-small:100%;--awb-order-small:0;--awb-spacing-right-small:1.92%;--awb-spacing-left-small:1.92%;\"><div class=\"fusion-column-wrapper fusion-column-has-shadow fusion-flex-justify-content-flex-start fusion-content-layout-column\"><div class=\"fusion-title title fusion-title-6 fusion-sep-none fusion-title-text fusion-title-size-two\" style=\"--awb-margin-bottom:-15px;\"><h2 class=\"fusion-title-heading title-heading-left fusion-responsive-typography-calculated\" style=\"margin:0;--fontSize:40;line-height:var(--awb-typography1-line-height);\"><strong>Resources<\/strong><\/h2><\/div><\/div><\/div><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-23 fusion_builder_column_1_1 1_1 fusion-flex-column\" style=\"--awb-bg-size:cover;--awb-width-large:100%;--awb-margin-top-large:0px;--awb-spacing-right-large:1.92%;--awb-margin-bottom-large:20px;--awb-spacing-left-large:1.92%;--awb-width-medium:100%;--awb-order-medium:0;--awb-spacing-right-medium:1.92%;--awb-spacing-left-medium:1.92%;--awb-width-small:100%;--awb-order-small:0;--awb-spacing-right-small:1.92%;--awb-spacing-left-small:1.92%;\"><div class=\"fusion-column-wrapper fusion-column-has-shadow fusion-flex-justify-content-flex-start fusion-content-layout-column\"><div class=\"fusion-text fusion-text-20\"><ul>\n<li><a href=\"https:\/\/objectsecurity.com\">ObjectSecurity&#8217;s BinLens\u2122<\/a> (formerly ObjectSecurity OT.AI Platform) can be found here: <a href=\"https:\/\/objectsecurity.com\/objectsecurity_ot_ai_platform\/\">https:\/\/objectsecurity.com\/objectsecurity_ot_ai_platform\/<\/a><\/li>\n<li>GDB can be found here: <a href=\"https:\/\/sourceware.org\/gdb\/\">https:\/\/sourceware.org\/gdb\/<\/a><\/li>\n<li>Documentation for the Python GDB library can be found here: <a href=\"https:\/\/sourceware.org\/gdb\/current\/onlinedocs\/gdb.html\/Python-API.html\">https:\/\/sourceware.org\/gdb\/current\/onlinedocs\/gdb.html\/Python-API.html<\/a><\/li>\n<li>Parts of the approach were greatly inspired by the article written here: <a href=\"https:\/\/crossbowerbt.github.io\/in_memory_fuzzing.html\">https:\/\/crossbowerbt.github.io\/in_memory_fuzzing.html<\/a><\/li>\n<\/ul>\n<\/div><\/div><\/div><\/div><\/div><div id=\"function_fuzzer\" class=\"fusion-container-anchor\"><div class=\"fusion-fullwidth fullwidth-box fusion-builder-row-8 fusion-flex-container has-pattern-background has-mask-background nonhundred-percent-fullwidth non-hundred-percent-height-scrolling\" style=\"--awb-border-radius-top-left:0px;--awb-border-radius-top-right:0px;--awb-border-radius-bottom-right:0px;--awb-border-radius-bottom-left:0px;--awb-flex-wrap:wrap;\" ><div class=\"fusion-builder-row fusion-row fusion-flex-align-items-flex-start fusion-flex-content-wrap\" style=\"max-width:1872px;margin-left: calc(-4% \/ 2 );margin-right: calc(-4% \/ 2 );\"><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-24 fusion_builder_column_1_1 1_1 fusion-flex-column\" style=\"--awb-bg-size:cover;--awb-width-large:100%;--awb-margin-top-large:0px;--awb-spacing-right-large:1.92%;--awb-margin-bottom-large:20px;--awb-spacing-left-large:1.92%;--awb-width-medium:100%;--awb-order-medium:0;--awb-spacing-right-medium:1.92%;--awb-spacing-left-medium:1.92%;--awb-width-small:100%;--awb-order-small:0;--awb-spacing-right-small:1.92%;--awb-spacing-left-small:1.92%;\"><div class=\"fusion-column-wrapper fusion-column-has-shadow fusion-flex-justify-content-flex-start fusion-content-layout-column\"><div class=\"fusion-title title fusion-title-7 fusion-sep-none fusion-title-text fusion-title-size-four\" style=\"--awb-margin-bottom:-15px;\"><h4 class=\"fusion-title-heading title-heading-left fusion-responsive-typography-calculated\" style=\"margin:0;--fontSize:24;--minFontSize:24;line-height:var(--awb-typography1-line-height);\"><a href=\"function_fuzzer.py\" class=\"awb-custom-text-color awb-custom-text-hover-color\" target=\"_self\"><em>function_fuzzer.py Source Code<\/em><\/a><\/h4><\/div><\/div><\/div><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-25 fusion_builder_column_1_1 1_1 fusion-flex-column\" style=\"--awb-bg-size:cover;--awb-width-large:100%;--awb-margin-top-large:0px;--awb-spacing-right-large:1.92%;--awb-margin-bottom-large:20px;--awb-spacing-left-large:1.92%;--awb-width-medium:100%;--awb-order-medium:0;--awb-spacing-right-medium:1.92%;--awb-spacing-left-medium:1.92%;--awb-width-small:100%;--awb-order-small:0;--awb-spacing-right-small:1.92%;--awb-spacing-left-small:1.92%;\"><div class=\"fusion-column-wrapper fusion-column-has-shadow fusion-flex-justify-content-flex-start fusion-content-layout-column\"><div class=\"fusion-text fusion-text-21\"><div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-python\" data-lang=\"Python\"><code>\"\"\"\r\n(c) 2024 ObjectSecurity LLC\r\n\r\nThis script performs in-memory fuzzing of the \r\narguments to the `memory_operation` function in \r\nthe `sample_1` binary. It uses GDB.\r\n\r\nThe `memory_operation` function takes one argument.\r\nThis argument is a char* to the commandline arg\r\npassed into the binary from `main`. This script\r\npauses program execution at the start of the\r\n`memory_operation` function, and overwrites\r\nthis argument by writing to the memory address\r\npointed to by the RDI register. It does this\r\niteratively, until the program segfaults and \r\ncrashes.\r\n\r\nUsage: `gdb --command function_fuzzer.py`\r\n\"\"\"\r\n\r\nimport gdb\r\nimport string\r\nimport random\r\n\r\nBINARY_FILE = \"sample_1\"\r\nFUNCTION_NAME = \"memory_operation\"\r\nINPUT_SIZE = 3\r\n\r\ndef main():\r\n   print(f\"nnFuzzing binary `{BINARY_FILE}` at function `{FUNCTION_NAME}`.nn---n\")\r\n\r\n   # select binary file to fuzz\r\n   gdb.execute(f\"file {BINARY_FILE}\")\r\n\r\n   # set breakpoint a function to fuzz\r\n   gdb.execute(f\"break {FUNCTION_NAME}\")\r\n\r\n   # turn off things that require user input\r\n   gdb.execute(\"set confirm off\")\r\n   gdb.execute(\"set pagination off\")\r\n\r\n   # begin executing the binary\r\n   gdb.execute(\"run cmd\")\r\n   fuzz_func()\r\n\r\n   # exit GDB\r\n   gdb.execute(\"quit\")\r\n\r\n   \r\ndef fuzz_func():\r\n   iteration = 1\r\n   while True:\r\n      fuzzed_input = gen_rand_input(INPUT_SIZE)\r\n      print(f\"nnPerforming iteration {iteration} with input {fuzzed_input}.\")\r\n\r\n      # save current program state, such that we can return\r\n      # to it at the start of each loop\r\n      gdb.execute(\"checkpoint\")\r\n      gdb.execute(\"restart 1\")\r\n\r\n      # overwrite memory address stored in RDI register \r\n      # (e.g., the first argument to the function)\r\n      rdi_address = gdb.parse_and_eval(\"$rdi\")\r\n      gdb.inferiors()[0].write_memory(rdi_address, fuzzed_input, INPUT_SIZE)\r\n      gdb.execute(\"finish\")\r\n\r\n      # restore program state from checkpoint\r\n      try:\r\n         gdb.execute(\"restart 0\")\r\n         gdb.execute(\"delete checkpoint 1\")\r\n         iteration += 1\r\n      except:\r\n         break\r\n\r\ndef gen_rand_input(size: int):\r\n   return \"\".join(random.choices(string.digits, k=size))\r\n\r\nif __name__ == \"__main__\": \r\n   main()\r\n<\/code><\/pre>\n<\/div>\n<\/div><\/div><\/div><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-26 fusion_builder_column_1_3 1_3 fusion-flex-column\" style=\"--awb-bg-size:cover;--awb-width-large:33.333333333333%;--awb-margin-top-large:0px;--awb-spacing-right-large:5.76%;--awb-margin-bottom-large:20px;--awb-spacing-left-large:5.76%;--awb-width-medium:100%;--awb-order-medium:0;--awb-spacing-right-medium:1.92%;--awb-spacing-left-medium:1.92%;--awb-width-small:100%;--awb-order-small:0;--awb-spacing-right-small:1.92%;--awb-spacing-left-small:1.92%;\"><div class=\"fusion-column-wrapper fusion-column-has-shadow fusion-flex-justify-content-flex-start fusion-content-layout-column\"><div style=\"text-align:center;\"><a class=\"fusion-button button-flat button-xlarge button-default fusion-button-default button-1 fusion-button-default-span fusion-button-default-type\" style=\"--button-border-radius-top-left:2px;--button-border-radius-top-right:2px;--button-border-radius-bottom-right:2px;--button-border-radius-bottom-left:2px;\" target=\"_self\" href=\"https:\/\/objectsecurity.com\/objectsecurity_ot_ai_platform\/\"><span class=\"fusion-button-text\">BinLens<\/span><\/a><\/div><\/div><\/div><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-27 fusion_builder_column_1_3 1_3 fusion-flex-column\" style=\"--awb-bg-size:cover;--awb-width-large:33.333333333333%;--awb-margin-top-large:0px;--awb-spacing-right-large:5.76%;--awb-margin-bottom-large:20px;--awb-spacing-left-large:5.76%;--awb-width-medium:100%;--awb-order-medium:0;--awb-spacing-right-medium:1.92%;--awb-spacing-left-medium:1.92%;--awb-width-small:100%;--awb-order-small:0;--awb-spacing-right-small:1.92%;--awb-spacing-left-small:1.92%;\"><div class=\"fusion-column-wrapper fusion-column-has-shadow fusion-flex-justify-content-flex-start fusion-content-layout-column\"><div style=\"text-align:center;\"><a class=\"fusion-button button-flat button-xlarge button-default fusion-button-default button-2 fusion-button-default-span fusion-button-default-type\" style=\"--button-border-radius-top-left:2px;--button-border-radius-top-right:2px;--button-border-radius-bottom-right:2px;--button-border-radius-bottom-left:2px;\" target=\"_self\" href=\"https:\/\/objectsecurity.com\/contact-us\/\"><span class=\"fusion-button-text\">Contact Us<\/span><\/a><\/div><\/div><\/div><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-28 fusion_builder_column_1_3 1_3 fusion-flex-column\" style=\"--awb-bg-size:cover;--awb-width-large:33.333333333333%;--awb-margin-top-large:0px;--awb-spacing-right-large:5.76%;--awb-margin-bottom-large:20px;--awb-spacing-left-large:5.76%;--awb-width-medium:100%;--awb-order-medium:0;--awb-spacing-right-medium:1.92%;--awb-spacing-left-medium:1.92%;--awb-width-small:100%;--awb-order-small:0;--awb-spacing-right-small:1.92%;--awb-spacing-left-small:1.92%;\"><div class=\"fusion-column-wrapper fusion-column-has-shadow fusion-flex-justify-content-flex-start fusion-content-layout-column\"><div style=\"text-align:center;\"><a class=\"fusion-button button-flat button-large button-default fusion-button-default button-3 fusion-button-default-span fusion-button-default-type\" style=\"--button-border-radius-top-left:2px;--button-border-radius-top-right:2px;--button-border-radius-bottom-right:2px;--button-border-radius-bottom-left:2px;\" target=\"_self\" href=\"https:\/\/objectsecurity.com\/tech-blog\/#followblog\"><span class=\"fusion-button-text\">Follow Our Blog<\/span><\/a><\/div><\/div><\/div><\/div><\/div><\/div><\/p>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":8,"featured_media":4473,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[63,39,34,87],"tags":[],"class_list":["post-6363","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-binlens","category-ot-ics-cybersecurity","category-reverse-engineering","category-tech"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Automating Binary Exploit Detection using BinLens - ObjectSecurity<\/title>\n<meta name=\"robots\" content=\"noindex, follow\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/objectsecurity.com\\\/automating-binary-exploit-detection\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/objectsecurity.com\\\/automating-binary-exploit-detection\\\/\"},\"author\":{\"name\":\"ObjectSecurity LLC\",\"@id\":\"https:\\\/\\\/objectsecurity.com\\\/#\\\/schema\\\/person\\\/b95c5e028381014293b246279d5006bb\"},\"headline\":\"Automating Binary Exploit Detection using BinLens\",\"datePublished\":\"2024-04-02T21:46:35+00:00\",\"dateModified\":\"2024-11-15T23:08:05+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/objectsecurity.com\\\/automating-binary-exploit-detection\\\/\"},\"wordCount\":21674,\"image\":{\"@id\":\"https:\\\/\\\/objectsecurity.com\\\/automating-binary-exploit-detection\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/objectsecurity.com\\\/wp-content\\\/uploads\\\/2024\\\/04\\\/osarugue-igbinoba-hVm4zmZYnYg-unsplash-scaled.jpg?fit=2560%2C1440&ssl=1\",\"articleSection\":[\"BinLens\",\"OT\\\/ICS Cybersecurity\",\"Reverse Engineering\",\"Technical\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/objectsecurity.com\\\/automating-binary-exploit-detection\\\/\",\"url\":\"https:\\\/\\\/objectsecurity.com\\\/automating-binary-exploit-detection\\\/\",\"name\":\"Automating Binary Exploit Detection using BinLens - ObjectSecurity\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/objectsecurity.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/objectsecurity.com\\\/automating-binary-exploit-detection\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/objectsecurity.com\\\/automating-binary-exploit-detection\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/objectsecurity.com\\\/wp-content\\\/uploads\\\/2024\\\/04\\\/osarugue-igbinoba-hVm4zmZYnYg-unsplash-scaled.jpg?fit=2560%2C1440&ssl=1\",\"datePublished\":\"2024-04-02T21:46:35+00:00\",\"dateModified\":\"2024-11-15T23:08:05+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/objectsecurity.com\\\/#\\\/schema\\\/person\\\/b95c5e028381014293b246279d5006bb\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/objectsecurity.com\\\/automating-binary-exploit-detection\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/objectsecurity.com\\\/automating-binary-exploit-detection\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/objectsecurity.com\\\/automating-binary-exploit-detection\\\/#primaryimage\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/objectsecurity.com\\\/wp-content\\\/uploads\\\/2024\\\/04\\\/osarugue-igbinoba-hVm4zmZYnYg-unsplash-scaled.jpg?fit=2560%2C1440&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/objectsecurity.com\\\/wp-content\\\/uploads\\\/2024\\\/04\\\/osarugue-igbinoba-hVm4zmZYnYg-unsplash-scaled.jpg?fit=2560%2C1440&ssl=1\",\"width\":2560,\"height\":1440},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/objectsecurity.com\\\/automating-binary-exploit-detection\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/objectsecurity.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Automating Binary Exploit Detection using BinLens\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/objectsecurity.com\\\/#website\",\"url\":\"https:\\\/\\\/objectsecurity.com\\\/\",\"name\":\"ObjectSecurity\",\"description\":\"OT\\\/ICS Asset Binary Vulnerability Analysis and Reporting\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/objectsecurity.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/objectsecurity.com\\\/#\\\/schema\\\/person\\\/b95c5e028381014293b246279d5006bb\",\"name\":\"ObjectSecurity LLC\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/be2a06226a4b21354a1205403b77c97bbc16034deb14ef458f64ac034957bf3a?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/be2a06226a4b21354a1205403b77c97bbc16034deb14ef458f64ac034957bf3a?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/be2a06226a4b21354a1205403b77c97bbc16034deb14ef458f64ac034957bf3a?s=96&d=mm&r=g\",\"caption\":\"ObjectSecurity LLC\"},\"description\":\"ObjectSecurity LLC is a leader in solving complex, evolving defense and industrial cybersecurity and supply chain risk challenges that threaten national security and production downtime.\",\"sameAs\":[\"https:\\\/\\\/objectsecurity.com\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Automating Binary Exploit Detection using BinLens - ObjectSecurity","robots":{"index":"noindex","follow":"follow"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/objectsecurity.com\/automating-binary-exploit-detection\/#article","isPartOf":{"@id":"https:\/\/objectsecurity.com\/automating-binary-exploit-detection\/"},"author":{"name":"ObjectSecurity LLC","@id":"https:\/\/objectsecurity.com\/#\/schema\/person\/b95c5e028381014293b246279d5006bb"},"headline":"Automating Binary Exploit Detection using BinLens","datePublished":"2024-04-02T21:46:35+00:00","dateModified":"2024-11-15T23:08:05+00:00","mainEntityOfPage":{"@id":"https:\/\/objectsecurity.com\/automating-binary-exploit-detection\/"},"wordCount":21674,"image":{"@id":"https:\/\/objectsecurity.com\/automating-binary-exploit-detection\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/objectsecurity.com\/wp-content\/uploads\/2024\/04\/osarugue-igbinoba-hVm4zmZYnYg-unsplash-scaled.jpg?fit=2560%2C1440&ssl=1","articleSection":["BinLens","OT\/ICS Cybersecurity","Reverse Engineering","Technical"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/objectsecurity.com\/automating-binary-exploit-detection\/","url":"https:\/\/objectsecurity.com\/automating-binary-exploit-detection\/","name":"Automating Binary Exploit Detection using BinLens - ObjectSecurity","isPartOf":{"@id":"https:\/\/objectsecurity.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/objectsecurity.com\/automating-binary-exploit-detection\/#primaryimage"},"image":{"@id":"https:\/\/objectsecurity.com\/automating-binary-exploit-detection\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/objectsecurity.com\/wp-content\/uploads\/2024\/04\/osarugue-igbinoba-hVm4zmZYnYg-unsplash-scaled.jpg?fit=2560%2C1440&ssl=1","datePublished":"2024-04-02T21:46:35+00:00","dateModified":"2024-11-15T23:08:05+00:00","author":{"@id":"https:\/\/objectsecurity.com\/#\/schema\/person\/b95c5e028381014293b246279d5006bb"},"breadcrumb":{"@id":"https:\/\/objectsecurity.com\/automating-binary-exploit-detection\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/objectsecurity.com\/automating-binary-exploit-detection\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/objectsecurity.com\/automating-binary-exploit-detection\/#primaryimage","url":"https:\/\/i0.wp.com\/objectsecurity.com\/wp-content\/uploads\/2024\/04\/osarugue-igbinoba-hVm4zmZYnYg-unsplash-scaled.jpg?fit=2560%2C1440&ssl=1","contentUrl":"https:\/\/i0.wp.com\/objectsecurity.com\/wp-content\/uploads\/2024\/04\/osarugue-igbinoba-hVm4zmZYnYg-unsplash-scaled.jpg?fit=2560%2C1440&ssl=1","width":2560,"height":1440},{"@type":"BreadcrumbList","@id":"https:\/\/objectsecurity.com\/automating-binary-exploit-detection\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/objectsecurity.com\/"},{"@type":"ListItem","position":2,"name":"Automating Binary Exploit Detection using BinLens"}]},{"@type":"WebSite","@id":"https:\/\/objectsecurity.com\/#website","url":"https:\/\/objectsecurity.com\/","name":"ObjectSecurity","description":"OT\/ICS Asset Binary Vulnerability Analysis and Reporting","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/objectsecurity.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/objectsecurity.com\/#\/schema\/person\/b95c5e028381014293b246279d5006bb","name":"ObjectSecurity LLC","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/be2a06226a4b21354a1205403b77c97bbc16034deb14ef458f64ac034957bf3a?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/be2a06226a4b21354a1205403b77c97bbc16034deb14ef458f64ac034957bf3a?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/be2a06226a4b21354a1205403b77c97bbc16034deb14ef458f64ac034957bf3a?s=96&d=mm&r=g","caption":"ObjectSecurity LLC"},"description":"ObjectSecurity LLC is a leader in solving complex, evolving defense and industrial cybersecurity and supply chain risk challenges that threaten national security and production downtime.","sameAs":["https:\/\/objectsecurity.com"]}]}},"jetpack_featured_media_url":"https:\/\/i0.wp.com\/objectsecurity.com\/wp-content\/uploads\/2024\/04\/osarugue-igbinoba-hVm4zmZYnYg-unsplash-scaled.jpg?fit=2560%2C1440&ssl=1","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/objectsecurity.com\/wp-json\/wp\/v2\/posts\/6363","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/objectsecurity.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/objectsecurity.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/objectsecurity.com\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/objectsecurity.com\/wp-json\/wp\/v2\/comments?post=6363"}],"version-history":[{"count":3,"href":"https:\/\/objectsecurity.com\/wp-json\/wp\/v2\/posts\/6363\/revisions"}],"predecessor-version":[{"id":6598,"href":"https:\/\/objectsecurity.com\/wp-json\/wp\/v2\/posts\/6363\/revisions\/6598"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/objectsecurity.com\/wp-json\/wp\/v2\/media\/4473"}],"wp:attachment":[{"href":"https:\/\/objectsecurity.com\/wp-json\/wp\/v2\/media?parent=6363"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/objectsecurity.com\/wp-json\/wp\/v2\/categories?post=6363"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/objectsecurity.com\/wp-json\/wp\/v2\/tags?post=6363"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}