Skip to content

Commit e443767

Browse files
committedFeb 28, 2018
Change system to support multiple firmware versions
1 parent f39bd45 commit e443767

File tree

6 files changed

+198
-105
lines changed

6 files changed

+198
-105
lines changed
 

‎html/error.html

+23-23
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,3 @@
1-
<!--
2-
Copyright (c) 2017-2018 Al Azif, https://github.com/Al-Azif/ps4-exploit-host
3-
4-
Permission is hereby granted, free of charge, to any person obtaining
5-
a copy of this software and associated documentation files (the
6-
"Software"), to deal in the Software without restriction, including
7-
without limitation the rights to use, copy, modify, merge, publish,
8-
distribute, sublicense, and/or sell copies of the Software, and to
9-
permit persons to whom the Software is furnished to do so, subject to
10-
the following conditions:
11-
12-
The above copyright notice and this permission notice shall be
13-
included in all copies or substantial portions of the Software.
14-
15-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22-
-->
231
<!DOCTYPE html>
242
<html>
253
<head>
@@ -43,4 +21,26 @@
4321
<div class="message">%(explain)s</div>
4422
</div>
4523
</body>
46-
</html>
24+
</html>
25+
<!--
26+
Copyright (c) 2017-2018 Al Azif, https://github.com/Al-Azif/ps4-exploit-host
27+
28+
Permission is hereby granted, free of charge, to any person obtaining
29+
a copy of this software and associated documentation files (the
30+
"Software"), to deal in the Software without restriction, including
31+
without limitation the rights to use, copy, modify, merge, publish,
32+
distribute, sublicense, and/or sell copies of the Software, and to
33+
permit persons to whom the Software is furnished to do so, subject to
34+
the following conditions:
35+
36+
The above copyright notice and this permission notice shall be
37+
included in all copies or substantial portions of the Software.
38+
39+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
40+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
41+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
42+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
43+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
44+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
45+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
46+
-->

‎html/exploits.html

+13-17
Original file line numberDiff line numberDiff line change
@@ -2,38 +2,34 @@
22
<html>
33
<head>
44
<meta charset="utf-8">
5-
<title>Select Exploit | PS4 Exploit Host by Al Azif</title>
5+
<title>*</title>
66
<link rel="stylesheet" href="/static/style.css">
7+
<script src="/static/script.js"></script>
78
<script>
8-
var data = [{{EXPLOITS}}];
9+
var data = JSON.parse('{{EXPLOITS}}');
10+
var exploitBase = "/exploits/";
911

10-
var exploits = '';
11-
x = 0;
12-
for (var i = 0, len = data.length; i < len; i++) {
13-
x += 1;
14-
exploits += '<a href="/exploits/' + data[i] + '/"><button class="btn btn-main">' + data[i] + '</button></a>';
15-
if (x >= 3) {
16-
exploits += '<br>';
17-
x = 0;
18-
}
19-
}
12+
var firmwares = getFirmwares();
2013

2114
window.onload = function() {
22-
document.getElementById("buttons").innerHTML=exploits;
15+
if(window.location.hash) {
16+
firmwareSelected();
17+
} else {
18+
resetPage();
19+
}
2320
}
2421
</script>
2522
</head>
26-
<body>
23+
<body onhashchange="firmwareSelected()">
2724
<div id="wrapper">
2825
<div id="contentWrapper">
2926
<div id="contentHeader">
30-
<div><h1>PlayStation 4 Exploit Host</h1><a href="/static/about.html" class="about">About</a></div>
27+
<h1 id="title">*</h1>
3128
</div>
3229
<div id="content">
3330
<div id="contentBody">
34-
<h2>Exploits</h2>
31+
<h2 id="header">*</h2>
3532
<div id="buttons"></div>
36-
<iframe id="ifr"></iframe>
3733
</div>
3834
</div>
3935
</div>

‎html/ps4-updatefeature.html

+23-23
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,3 @@
1-
<!--
2-
Copyright (c) 2017-2018 Al Azif, https://github.com/Al-Azif/ps4-exploit-host
3-
4-
Permission is hereby granted, free of charge, to any person obtaining
5-
a copy of this software and associated documentation files (the
6-
"Software"), to deal in the Software without restriction, including
7-
without limitation the rights to use, copy, modify, merge, publish,
8-
distribute, sublicense, and/or sell copies of the Software, and to
9-
permit persons to whom the Software is furnished to do so, subject to
10-
the following conditions:
11-
12-
The above copyright notice and this permission notice shall be
13-
included in all copies or substantial portions of the Software.
14-
15-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22-
-->
231
<!DOCTYPE html>
242
<html>
253
<head>
@@ -45,4 +23,26 @@ <h3>Main features:</h3>
4523
</div>
4624
</div>
4725
</body>
48-
</html>
26+
</html>
27+
<!--
28+
Copyright (c) 2017-2018 Al Azif, https://github.com/Al-Azif/ps4-exploit-host
29+
30+
Permission is hereby granted, free of charge, to any person obtaining
31+
a copy of this software and associated documentation files (the
32+
"Software"), to deal in the Software without restriction, including
33+
without limitation the rights to use, copy, modify, merge, publish,
34+
distribute, sublicense, and/or sell copies of the Software, and to
35+
permit persons to whom the Software is furnished to do so, subject to
36+
the following conditions:
37+
38+
The above copyright notice and this permission notice shall be
39+
included in all copies or substantial portions of the Software.
40+
41+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
42+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
43+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
44+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
45+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
46+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
47+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
48+
-->

‎start.py

+37-20
Original file line numberDiff line numberDiff line change
@@ -137,24 +137,25 @@ def exploit_matcher(self):
137137
self.my_sender('text/html', data)
138138

139139
def exploit(self):
140-
path = unquote(self.path.rsplit('/', 1)[-1])
141-
if not path or path == '/':
142-
path = 'index.html'
143-
which = unquote(self.path.rsplit('/')[-2])
144-
mime = mimetypes.guess_type(path)
140+
path = unquote(self.path.split('/', 2)[-1])
141+
if path[-1:] == '/':
142+
path += 'index.html'
143+
mime = mimetypes.guess_type(self.path.rsplit('/', 1)[-1])
145144
if mime[0]:
146145
mime = mime[0]
147146
else:
148147
mime = 'application/octet-stream'
149-
with open(os.path.join(EXPLOIT_LOC, which, path), 'rb') as buf:
148+
with open(os.path.join(EXPLOIT_LOC, path), 'rb') as buf:
150149
data = buf.read()
151150
if path == 'index.html':
152151
data = data.replace(b'0.0.0.0', bytes(get_lan(), 'utf-8'))
153152
self.my_sender(mime, data)
154153

155154
def static_request(self):
156-
path = unquote(self.path.rsplit('/', 1)[-1])
157-
mime = mimetypes.guess_type(path)
155+
path = unquote(self.path.split('/', 2)[-1])
156+
if path[-1:] == '/':
157+
path += 'index.html'
158+
mime = mimetypes.guess_type(self.path.rsplit('/', 1)[-1])
158159
if mime[0]:
159160
mime = mime[0]
160161
else:
@@ -178,19 +179,31 @@ def payload_launcher(self):
178179

179180
def inject_exploit_html(self, html):
180181
try:
181-
exploits = os.listdir(EXPLOIT_LOC)
182-
if 'PUT EXPLOITS HERE' in exploits:
183-
exploits.remove('PUT EXPLOITS HERE')
184-
exploits.sort()
185-
if len(exploits) == 0:
186-
return html
187-
elif len(exploits) == 1:
188-
data = '"{}"'.format(exploits[0])
182+
firmwares = os.listdir(EXPLOIT_LOC)
183+
if 'PUT EXPLOITS HERE' in firmwares:
184+
firmwares.remove('PUT EXPLOITS HERE')
185+
firmwares.sort()
186+
if len(firmwares) == 0:
187+
return html.replace(b'{{EXPLOITS}}', '{"firmwares": ["No Exploits Found"]}')
188+
elif len(firmwares) == 1:
189+
data = '{"firmwares": ["{}"]}}'.format(firmwares[0])
189190
else:
190-
data = '"' + '", "'.join(exploits) + '"'
191+
data = '{"firmwares": ["' + '", "'.join(firmwares) + '"]}'
192+
193+
for firmware in firmwares:
194+
exploits = os.listdir(os.path.join(EXPLOIT_LOC, firmware))
195+
exploits.append('[Back]')
196+
if len(exploits) == 1:
197+
data = data[:-1]
198+
data += ', "{}": ["{}"]}}'.format(firmware, exploits[0])
199+
else:
200+
data = data[:-1]
201+
data += ', "{}": ["'.format(firmware)
202+
data += '", "'.join(exploits) + '"]}'
203+
191204
data = bytes(data, 'utf-8')
192205
except IOError:
193-
pass
206+
return html.replace(b'{{EXPLOITS}}', '{"firmwares": ["I/O Error on Host"]}')
194207

195208
return html.replace(b'{{EXPLOITS}}', data)
196209

@@ -201,7 +214,11 @@ def check_ua(self):
201214
'Mozilla/5.0 (PlayStation 4 4.05) AppleWebKit/537.78 (KHTML, like Gecko)',
202215
'Mozilla/5.0 (PlayStation 4 5.05) AppleWebKit/537.78 (KHTML, like Gecko)',
203216
'Mozilla/5.0 (PlayStation 4 4.55) AppleWebKit/601.2 (KHTML, like Gecko)',
204-
'Mozilla/5.0 (PlayStation 4 5.05) AppleWebKit/601.2 (KHTML, like Gecko)'
217+
'Mozilla/5.0 (PlayStation 4 5.05) AppleWebKit/601.2 (KHTML, like Gecko)',
218+
'Mozilla/5.0 (PlayStation 4 5.01) AppleWebKit/601.2 (KHTML, like Gecko)',
219+
'Mozilla/5.0 (PlayStation 4 5.03) AppleWebKit/601.2 (KHTML, like Gecko)',
220+
'Mozilla/5.0 (PlayStation 4 5.05) AppleWebKit/601.2 (KHTML, like Gecko)',
221+
'Mozilla/5.0 (PlayStation 4 5.50) AppleWebKit/601.2 (KHTML, like Gecko)'
205222
]
206223

207224
if self.headers['User-Agent'] in allowed:
@@ -241,7 +258,7 @@ def do_GET(self):
241258
except IOError:
242259
self.send_error(404)
243260

244-
if self.path.rsplit('/', 1)[-1] == 'kernel.js':
261+
if self.path.rsplit('/', 1)[-1] == 'rop.js':
245262
print('>> Exploit sent...')
246263
try:
247264
payloads_file = os.path.join(EXPLOIT_LOC, self.path.rsplit('/', 2)[-2], 'nopayloads')

‎static/script.js

+80
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
function isInArray(value, array) {
2+
return array.indexOf(value) > -1;
3+
}
4+
5+
function updatePage(title, header, buttons) {
6+
document.title = title + " | PS4 Exploit Host by Al-Azif";
7+
document.getElementById("title").innerHTML = title;
8+
document.getElementById("header").innerHTML = header;
9+
document.getElementById("buttons").innerHTML = buttons;
10+
}
11+
12+
function resetPage() {
13+
history.pushState("", document.title, window.location.pathname + window.location.search);
14+
updatePage("Firmware Selection", "Firmware", firmwares);
15+
}
16+
17+
function getFirmwares() {
18+
var firmwares = "";
19+
x = 0;
20+
for (var i = 0, len = data["firmwares"].length; i < len; i++) {
21+
x += 1;
22+
firmwares += "<a href=\"#" + data["firmwares"][i] + "\"><button class=\"btn btn-main\">" + data["firmwares"][i] + "</button></a>";
23+
if (x >= 3) {
24+
firmwares += "<br>";
25+
x = 0;
26+
}
27+
}
28+
return firmwares;
29+
}
30+
31+
function getExploits() {
32+
var hash = window.location.hash.substr(1);
33+
var exploits = "";
34+
x = 0;
35+
for (var i = 0, len = data[hash].length; i < len; i++) {
36+
x += 1;
37+
if (data[hash][i] == "[Back]") {
38+
exploits += "<a href=\"#back\"><button class=\"btn btn-main\">" + data[hash][i] + "</button></a>";
39+
} else {
40+
exploits += "<a href=\"" + exploitBase + hash + "/" + data[hash][i] + "/index.html\"><button class=\"btn btn-main\">" + data[hash][i] + "</button></a>";
41+
}
42+
if (x >= 3) {
43+
exploits += "<br>";
44+
x = 0;
45+
}
46+
}
47+
return exploits;
48+
}
49+
50+
function firmwareSelected() {
51+
var hash = window.location.hash.substr(1);
52+
if (!isInArray(hash, firmwares)) {
53+
resetPage();
54+
} else {
55+
var exploits = getExploits();
56+
updatePage("Exploit Selection", hash, exploits);
57+
}
58+
}
59+
/*
60+
Copyright (c) 2017-2018 Al Azif, https://github.com/Al-Azif/ps4-exploit-host
61+
62+
Permission is hereby granted, free of charge, to any person obtaining
63+
a copy of this software and associated documentation files (the
64+
"Software"), to deal in the Software without restriction, including
65+
without limitation the rights to use, copy, modify, merge, publish,
66+
distribute, sublicense, and/or sell copies of the Software, and to
67+
permit persons to whom the Software is furnished to do so, subject to
68+
the following conditions:
69+
70+
The above copyright notice and this permission notice shall be
71+
included in all copies or substantial portions of the Software.
72+
73+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
74+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
75+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
76+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
77+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
78+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
79+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
80+
*/

‎static/style.css

+22-22
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,3 @@
1-
/*
2-
Copyright (c) 2017-2018 Al Azif, https://github.com/Al-Azif/ps4-exploit-host
3-
4-
Permission is hereby granted, free of charge, to any person obtaining
5-
a copy of this software and associated documentation files (the
6-
"Software"), to deal in the Software without restriction, including
7-
without limitation the rights to use, copy, modify, merge, publish,
8-
distribute, sublicense, and/or sell copies of the Software, and to
9-
permit persons to whom the Software is furnished to do so, subject to
10-
the following conditions:
11-
12-
The above copyright notice and this permission notice shall be
13-
included in all copies or substantial portions of the Software.
14-
15-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22-
*/
231
html {
242
height: 100%;
253
}
@@ -109,3 +87,25 @@ ul.default li {
10987
color: white;
11088
border-radius: 8px;
11189
}
90+
/*
91+
Copyright (c) 2017-2018 Al Azif, https://github.com/Al-Azif/ps4-exploit-host
92+
93+
Permission is hereby granted, free of charge, to any person obtaining
94+
a copy of this software and associated documentation files (the
95+
"Software"), to deal in the Software without restriction, including
96+
without limitation the rights to use, copy, modify, merge, publish,
97+
distribute, sublicense, and/or sell copies of the Software, and to
98+
permit persons to whom the Software is furnished to do so, subject to
99+
the following conditions:
100+
101+
The above copyright notice and this permission notice shall be
102+
included in all copies or substantial portions of the Software.
103+
104+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
105+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
106+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
107+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
108+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
109+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
110+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
111+
*/

0 commit comments

Comments
 (0)
Please sign in to comment.