Skip to content

Commit 019d470

Browse files
committed
Add HTML menu rather than CLI
1 parent 5be5fa4 commit 019d470

File tree

3 files changed

+111
-30
lines changed

3 files changed

+111
-30
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
exploit/index.html linguist-generated=true
12
updates/ps4-updatefeature.html linguist-generated=true

exploit/index.html

Lines changed: 72 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

start.py

Lines changed: 38 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def network_test(self, size):
9090
data = b'\0' * size
9191
self.my_sender('text/plain', data)
9292

93-
def exploit_match(self):
93+
def exploit_matcher(self):
9494
path = self.path.rsplit('/', 1)[-1]
9595
if not path or path == '/':
9696
path = 'index.html'
@@ -100,7 +100,21 @@ def exploit_match(self):
100100
with open(os.path.join(EXPLOIT_LOC, path), 'rb') as buf:
101101
data = buf.read()
102102
if path == 'index.html':
103-
data = inject_credits(data)
103+
data = self.inject_exploit_html(data)
104+
self.my_sender(mime[0], data)
105+
106+
def exploit(self):
107+
path = self.path.rsplit('/', 1)[-1]
108+
if not path or path == '/':
109+
path = 'index.html'
110+
which = self.path.rsplit('/')[-2]
111+
mime = mimetypes.guess_type(path)
112+
if not mime[0]:
113+
mime[0] = 'application/octet-stream'
114+
with open(os.path.join(EXPLOIT_LOC, which, path), 'rb') as buf:
115+
data = buf.read()
116+
if path == 'index.html':
117+
data = self.inject_credits(data)
104118
self.my_sender(mime[0], data)
105119

106120
def payload_launcher(self):
@@ -117,6 +131,24 @@ def payload_launcher(self):
117131
daemon=True)
118132
thread.start()
119133

134+
def inject_exploit_html(self, html):
135+
inject = b'<li><a href="/exploits/{EXP}/">{EXP}</a></li>\n'
136+
data = b''
137+
try:
138+
for exploit in os.listdir(EXPLOIT_LOC):
139+
if exploit != 'index.html':
140+
data += inject.replace(b'{EXP}', bytes(exploit, 'utf-8'))
141+
except IOError:
142+
pass
143+
144+
return html.replace(b'{EXPLOITS}', data)
145+
146+
def inject_credits(self, html):
147+
inject = b'<center><h1 id=clck>...</h1>PS4 Exploit Host by ' + \
148+
b'<a href="https://twitter.com/_AlAzif">Al Azif</a><br/>'
149+
150+
return html.replace(b'<center><h1 id=clck>...</h1>', inject)
151+
120152
def do_GET(self):
121153
"""Determines how to handle HTTP requests"""
122154
try:
@@ -130,8 +162,10 @@ def do_GET(self):
130162
self.network_test(2097152)
131163
elif re.match('^/networktest/get_6m', self.path):
132164
self.network_test(6291456)
133-
elif re.match('^/document/[a-zA-Z\-]{2,5}/ps4/', self.path):
134-
self.exploit_match()
165+
elif re.match('^/document/[a-zA-Z\-]{2,5}/ps4/index.html', self.path):
166+
self.exploit_matcher()
167+
elif re.match('^/exploits/[a-zA-Z0-9\-\_]*/', self.path):
168+
self.exploit()
135169
else:
136170
self.send_error(404)
137171
except IOError:
@@ -380,13 +414,6 @@ def menu_header():
380414
print('└────────────────────────────────────────────────────────┘')
381415

382416

383-
def inject_credits(html):
384-
inject = b'<center><h1 id=clck>...</h1>PS4 Exploit Host by ' + \
385-
b'<a href="https://twitter.com/_AlAzif">Al Azif</a><br/>'
386-
387-
return html.replace(b'<center><h1 id=clck>...</h1>', inject)
388-
389-
390417
def main():
391418
"""The main logic"""
392419
global DEBUG
@@ -399,9 +426,6 @@ def main():
399426
closer('ERROR: This must be run by root as it requires port 53 & 80')
400427

401428
parser = argparse.ArgumentParser(description='PS4 Exploit Host')
402-
parser.add_argument('--exploit', dest='e_type', action='store',
403-
default='', required=False,
404-
help='Select which exploit to host')
405429
parser.add_argument('--autosend', dest='autosend', action='store',
406430
default='', required=False,
407431
help='Automatically send payload when exploit loads')
@@ -424,22 +448,6 @@ def main():
424448
check_update_pup('SYSTEM', '203C76C97F7BE5B881DD0C77C8EDF385')
425449
check_update_pup('RECOVERY', '741CFE2F0DEC1BB4663571DE78AE31CF')
426450

427-
if not args.e_type:
428-
try:
429-
exploits = os.listdir(EXPLOIT_LOC)
430-
except IOError:
431-
closer('ERROR: No exploit directory found')
432-
if not exploits:
433-
closer('ERROR: No exploits found')
434-
exploit = menu('Exploit', exploits)
435-
args.e_type = exploits[exploit]
436-
437-
if os.path.isdir(os.path.join(EXPLOIT_LOC, args.e_type)) \
438-
and args.e_type:
439-
EXPLOIT_LOC = os.path.join(EXPLOIT_LOC, args.e_type)
440-
else:
441-
closer('ERROR: Could not find exploit specified')
442-
443451
lan = get_lan()
444452

445453
rules = generate_dns_rules(lan)

0 commit comments

Comments
 (0)