text
stringlengths
1
93.6k
print("ERROR: Payload sender timed out")
timed_out = True
break
if not timed_out:
try:
soc.sendall(content)
soc.shutdown(socket.SHUT_WR)
while True:
data = soc.recv(1024)
if not data:
break
print(">> Payload Sent!")
except socket.error:
print("ERROR: Broken Pipe")
soc.close()
# https://www.geeksforgeeks.org/compare-two-version-numbers/
# Return 1 if v2 is smaller, -1 if v1 is smaller, 0 if equal
def version_compare(v1, v2):
arr1 = v1.split(".")
arr2 = v2.split(".")
n = len(arr1)
m = len(arr2)
arr1 = [int(i) for i in arr1]
arr2 = [int(i) for i in arr2]
if n > m:
for i in range(m, n):
arr2.append(0)
elif m > n:
for i in range(n, m):
arr1.append(0)
for i in range(len(arr1)):
if arr1[i] > arr2[i]:
return 1
elif arr2[i] > arr1[i]:
return -1
return 0
def version_check():
try:
with urllib.request.urlopen(API_URL) as buf: # nosec B310
response = buf.read()
response = json.loads(response.decode("utf-8"))
checked_version = response["tag_name"].replace("v", "")
if version_compare(checked_version, VERSION) == 1:
print("WARNING: There is an update availible")
print(" ^^ Visit https://github.com/Al-Azif/ps4-exploit-host/releases/latest")
except urllib.error.URLError:
print("ERROR: Unable to check GitHub for updates")
print(" ^^ Visit https://github.com/Al-Azif/ps4-exploit-host/releases/latest")
except ValueError:
print("WARNING: Unable to check GitHub for updates")
print(" ^^ Visit https://github.com/Al-Azif/ps4-exploit-host/releases/latest")
def main():
parser = argparse.ArgumentParser(description="Exploit Host")
parser.add_argument("--settings", dest="settings", action="store",
default=os.path.join(CWD, "settings.json"),
required=False, help="Specify a settings file")
args = parser.parse_args()
menu_header()
try:
version_check()
default_settings()
import_settings(args.settings)
if not check_root():
closer("ERROR: This must be run by root")
try:
start_servers()
except ConnectionAbortedError:
pass
ip_display()
while True:
time.sleep(24 * 60 * 60)
except KeyboardInterrupt:
closer("\r>> Exiting... ")
if __name__ == "__main__":
main()
# Copyright (c) 2017-2024 Al Azif, https://github.com/Al-Azif/ps4-exploit-host
# Permission is hereby granted, free of charge, to any person obtaining