forked from Al-Azif/psfree-lapse
-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathexploit.html
More file actions
206 lines (177 loc) · 6.4 KB
/
Copy pathexploit.html
File metadata and controls
206 lines (177 loc) · 6.4 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
197
198
199
200
201
202
203
204
205
206
<!-- Copyright (C) 2023-2025 anonymous
This file is part of PSFree.
PSFree is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
PSFree is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
-->
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>PSFree Barebone Exploit</title>
<style>
body {
background-color: #111827;
color: white;
}
@font-face {
font-family: "logging";
src: url("./src/fonts/LiberationMono-Regular.ttf");
}
#console {
font-family: "logging";
color: white;
}
button {
border-radius: 12px;
color: white;
background-color: #1d4ed8;
border: none;
padding: 12px 9px;
}
a {
float: left;
}
</style>
</head>
<body>
<a href="./"><button>Return</button></a>
<h2>PSFree: A PS4 Exploit Chain</h2>
<pre id="console"></pre>
<script>
// --- Define Globals
window.entrypoint672_result = 0;
window.exploitsetup672_result = 0;
var consoleElement = document.getElementById('console');
var ua = navigator.userAgent;
var isPS4 = ua.indexOf("PlayStation 4") !== -1;
var is67x = ((ua.indexOf(" 6.70") !== -1) || (ua.indexOf(" 6.71") !== -1) || (ua.indexOf(" 6.72") !== -1));
var fwVersion = navigator.userAgent.substring(navigator.userAgent.indexOf('5.0 (') + 19, navigator.userAgent.indexOf(') Apple')).replace("layStation 4/", "");
// --- Check if 6.72 to load the entrypoint already
if (isPS4 && is67x && localStorage.getItem('bareboneJB') === 'true' && sessionStorage.getItem('payload_path') != null) {
try {
var xhr = new XMLHttpRequest();
xhr.open('GET', 'includes/js/exploits/672entrypoint.js', false); // Blocks thread until parsed
xhr.send('');
if (xhr.status === 200) {
eval.call(top.window, xhr.responseText);
}
} catch (e) {
console.error("Critical early sync hook failure: " + e.message);
}
}
function sleep(ms = 0) {
return new Promise(resolve => setTimeout(resolve, ms));
}
function log(message, color) {
const span = document.createElement('span');
span.textContent = message + '\n';
if (color) span.style.color = color;
consoleElement.appendChild(span);
}
// Taken from Feyzee61's ps4jb
function loadScript(source) {
return new Promise((resolve, reject) => {
const script = document.createElement('script');
script.src = source;
script.async = false;
script.onload = () => resolve();
script.onerror = () => reject(new Error("Failed to load script: " + source));
document.body.appendChild(script);
});
}
function updateJbStats(attemp, isSuccess) {
var total = parseInt(localStorage.getItem('jbTotal') || 0);
var success = parseInt(localStorage.getItem('jbSuccess') || 0);
if (attemp) {
total++;
localStorage.setItem('jbTotal', total);
}
if (isSuccess) {
success++;
localStorage.setItem('jbSuccess', success);
}
}
function jailbreakSuccess() {
sessionStorage.setItem('autoJbRetry', 'false');
updateJbStats(0, 1);
log("It is recommended to relaunch the web browser.", "blue");
log("\nRedirecting back to homepage in 5 seconds...", "gray");
setTimeout(() => { window.location.href = "./"; }, 5000);
}
async function run672ExploitChain() {
try {
log("Verifying early entrypoint hook state...");
updateJbStats(1, 0); // Add one attempt
await sleep(150);
if (window.entrypoint672_result < 1) {
location.reload();
return;
}
log("6.72 entrypoint hooked successfully.", "green");
if (window.exploitsetup672_result < 1) {
log("Error occurred during setup phase. Refresh and try again.", "red");
return;
}
log("Exploit setup complete.");
log("Triggering kernel exploit...", "yellow");
await sleep(200);
await loadScript('./includes/js/exploits/672kexploit.js');
var result = KernelExploit672();
if (result === 0 || result === 91) {
log("\nKernel exploit successful.", "green");
getPayload672(sessionStorage.getItem('payload_path'));
jailbreakSuccess();
} else if (result === 179) {
log("\nAlready jailbroken..", "green");
jailbreakSuccess();
getPayload672(sessionStorage.getItem('payload_path'));
} else {
log("\nKernel execution error code: " + result + ". Please restart the host console.", "red");
}
} catch (err) {
log("Staging failure: " + err.message, "red");
}
}
// Feyzee61's PSFree lapse implementation
async function loadPSFreeLapseBundle() {
await loadScript("./includes/js/exploits/bundle.js");
log("Loading PSFree lapse bundle");
doJailBreak();
}
async function loadPSFreeLapse() {
await loadScript("./src/alert.mjs");
log("loading modular PSFree Lapse");
}
// Redirect back if payload isn't chosen
document.addEventListener('DOMContentLoaded', function() {
if (sessionStorage.getItem('payload_path') == null) {
window.location.href = "./";
return;
}
// Choose exploit chain based on console firmware and user settings
if (isPS4 && is67x && localStorage.getItem('bareboneJB') === 'true') {
run672ExploitChain();
}
else if (isPS4 && fwVersion >= 7.00 && fwVersion <= 9.60) {
if (localStorage.getItem('secondLapse') == 'true') {
loadPSFreeLapse();
} else if (localStorage.getItem('secondLapse') == 'false') {
loadPSFreeLapseBundle();
}
}
else {
log("Host platform or environment version mismatch.", "yellow");
log("User-Agent context: " + ua, "gray");
}
});
</script>
</body>
</html>