Advertisement
yayatpy29

Script Host UMTX2

Apr 7th, 2025 (edited)
424
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 6.75 KB | None | 0 0
  1. #Install Dependensi yang Dibutuhkan
  2. sudo apt update
  3. sudo apt install dnsmasq hostapd net-tools -y
  4.  
  5. #==================================================
  6.  
  7. #Matikan dan disable systemd-resolved
  8. sudo systemctl stop systemd-resolved
  9. sudo systemctl disable systemd-resolved
  10.  
  11. #==================================================
  12.  
  13. #Download File yang Diperlukan
  14. git clone https://github.com/idlesauce/umtx2.git umtx2/
  15.  
  16. #==================================================
  17.  
  18. #Konfigurasi Static IP
  19. sudo nano /etc/systemd/system/static-ip.service
  20.  
  21. #Isi dengan:
  22. [Unit]
  23. Description=Set Static IP Address and restart services
  24. After=network-online.target hostapd.service
  25. Wants=network-online.target
  26.  
  27. [Service]
  28. Type=oneshot
  29. ExecStart=/usr/local/bin/set-static-ip.sh
  30. RemainAfterExit=yes
  31.  
  32. [Install]
  33. WantedBy=multi-user.target
  34.  
  35. #==================================================
  36.  
  37. #Buat skrip konfigurasi IP statis:
  38. sudo nano /usr/local/bin/set-static-ip.sh
  39.  
  40. #Isi dengan:
  41.  
  42. #!/bin/bash
  43.  
  44. # Wait until wlan0 is available (max 10 seconds)
  45. for i in {1..10}; do
  46.   if ip link show wlan0 > /dev/null 2>&1; then
  47.     break
  48.   fi
  49.   sleep 1
  50. done
  51.  
  52. # Ensure wlan0 is up
  53. ip link set wlan0 up
  54.  
  55. # Assign static IP to wlan0
  56. ifconfig wlan0 10.1.1.1 netmask 255.255.255.0 up
  57.  
  58. # Restart hostapd & dnsmasq services
  59. systemctl restart hostapd
  60. systemctl restart dnsmasq
  61.  
  62. # Log process for debugging
  63. echo "[\$(date)] Static IP & routing set for wlan0" >> /var/log/wifi-fix.log
  64.  
  65. #==================================================
  66.  
  67. #Beri izin eksekusi pada skrip:
  68. sudo chmod +x /usr/local/bin/set-static-ip.sh
  69.  
  70. #Aktifkan service:
  71. sudo systemctl daemon-reload
  72. sudo systemctl enable static-ip.service
  73. sudo systemctl start static-ip.service
  74.  
  75. #==================================================
  76.  
  77. #Konfigurasi Hostapd (WiFi AP)
  78. sudo nano /etc/hostapd/hostapd.conf
  79.  
  80. #Isi dengan:
  81. interface=wlan0
  82. ssid=PS5_JB
  83. hw_mode=g
  84. channel=6
  85. auth_algs=1
  86. wpa=2
  87. wpa_passphrase=12345678
  88. wpa_key_mgmt=WPA-PSK
  89. rsn_pairwise=CCMP
  90.  
  91. #Atur lokasi file konfigurasi:
  92. sudo nano /etc/default/hostapd
  93.  
  94. #Tambahkan:
  95. DAEMON_CONF="/etc/hostapd/hostapd.conf"
  96.  
  97. #Aktifkan dan jalankan hostapd:
  98. sudo systemctl unmask hostapd
  99. sudo systemctl enable hostapd
  100. sudo systemctl restart hostapd
  101.  
  102. #==================================================
  103.  
  104. #Konfigurasi dnsmasq (DHCP & DNS)
  105. sudo nano /etc/dnsmasq.conf
  106.  
  107. #Isi dengan:
  108. interface=wlan0
  109. bind-interfaces
  110. port=0
  111. dhcp-range=10.1.1.2,10.1.1.9,7d
  112. dhcp-option=3,10.1.1.1
  113. dhcp-option=6,10.1.1.1
  114. bogus-priv
  115. no-resolv
  116. no-hosts
  117. no-poll
  118. log-dhcp
  119. log-queries
  120.  
  121. #Restart dnsmasq:
  122. sudo systemctl restart dnsmasq
  123.  
  124. #==================================================
  125.  
  126. #host.py – HTTP/HTTPS Server
  127. sudo nano host.py
  128.  
  129. #Paste:
  130. import http.server, ssl, time, re, threading
  131. from http.server import SimpleHTTPRequestHandler, HTTPServer
  132.  
  133. class RequestHandler(SimpleHTTPRequestHandler):
  134.     def replace_locale(self):
  135.         self.path = re.sub(r'^/document/\w{2}/ps5', '/document/en/ps5', self.path)
  136.  
  137.     def do_GET(self):
  138.         if self.path in ['/', '', '/index.html']:
  139.             self.send_response(302)
  140.             self.send_header('Location', '/document/en/ps5/')
  141.             self.end_headers()
  142.             return
  143.         self.replace_locale()
  144.         return super().do_GET()
  145.  
  146.     def do_POST(self):
  147.         self.replace_locale()
  148.         tn = self.path.lstrip('/document/en/ps5/')
  149.         print('!POST!: tn:\n'  + tn)
  150.         fn = tn
  151.         if not tn.startswith("T_"):
  152.             if fn != "a.bin":
  153.                 print('!POST!: INFO: '  + str(self.rfile.read(int(self.headers['Content-length']))), "utf-8")
  154.                 return
  155.             else:
  156.                 fn = time.strftime("%Y%m%d-%H%M%S") + ".bin"
  157.         print('!POST!: ' + self.path + ' -->> ' + fn)
  158.         print('test: %d' % int(self.headers['Content-length']))
  159.         data = self.rfile.read(int(self.headers['Content-length']))
  160.         open(fn, "wb").write(data)
  161.  
  162.         self.send_response(200)
  163.         self.send_header("Content-type", "text/html")
  164.         self.end_headers()
  165.  
  166. def run_http():
  167.     server_address = ('0.0.0.0', 80)
  168.     httpd = HTTPServer(server_address, RequestHandler)
  169.     print('Running HTTP server on port 80')
  170.     httpd.serve_forever()
  171.  
  172. def run_https():
  173.     server_address = ('0.0.0.0', 443)
  174.     context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
  175.     context.load_cert_chain(certfile='localhost.pem')
  176.     httpd = HTTPServer(server_address, RequestHandler)
  177.     httpd.socket = context.wrap_socket(httpd.socket, server_side=True)
  178.     print('Running HTTPS server on port 443')
  179.     httpd.serve_forever()
  180.  
  181. # Jalankan HTTP dan HTTPS secara paralel
  182. threading.Thread(target=run_http, daemon=True).start()
  183. run_https()  # Biarkan HTTPS di foreground agar log tampil dan systemd bisa monitor
  184.  
  185. #==================================================
  186.  
  187. #Service untuk HTTP (tanpa SSL)
  188. sudo nano /etc/systemd/system/ps5-host.service
  189.  
  190. #Isi file:
  191. [Unit]
  192. Description=PS5 Exploit Host HTTP
  193. After=network.target
  194.  
  195. [Service]
  196. ExecStart=/usr/bin/python3 /root/umtx2/host.py
  197. WorkingDirectory=/root/umtx2
  198. Restart=always
  199. User=root
  200.  
  201. [Install]
  202. WantedBy=multi-user.target
  203.  
  204. #==================================================
  205.  
  206. #Service untuk HTTPS (dengan SSL)
  207. sudo nano /etc/systemd/system/ps5-host-ssl.service
  208.  
  209. #Isi file:
  210. [Unit]
  211. Description=PS5 Exploit Host HTTPS
  212. After=network.target
  213.  
  214. [Service]
  215. ExecStart=/usr/bin/python3 /root/umtx2/host_ssl.py
  216. WorkingDirectory=/root/umtx2
  217. Restart=always
  218. User=root
  219.  
  220. [Install]
  221. WantedBy=multi-user.target
  222.  
  223. #==================================================
  224.  
  225.  
  226.  
  227. #Fakedns service
  228. sudo nano /etc/systemd/system/fakedns.service
  229.  
  230. #Isi dengan :
  231. [Unit]
  232. Description=Fake DNS Server
  233. After=network.target
  234.  
  235. [Service]
  236. ExecStart=/usr/bin/python3 /root/umtx2/fakedns.py -c /root/umtx2/dns.conf
  237. WorkingDirectory=/root/umtx2
  238. Restart=always
  239.  
  240. [Install]
  241. WantedBy=multi-user.target
  242.  
  243. #ubah dns.conf
  244. nano dns.conf
  245.  
  246. #Isi dengan :
  247. A manuals.playstation.net 10.1.1.1
  248.  
  249. #==================================================
  250.  
  251. #Jalankan semua:
  252. sudo systemctl daemon-reexec
  253. sudo systemctl daemon-reload
  254. sudo systemctl enable ps5-host.service
  255. sudo systemctl enable ps5-host-ssl.service
  256. sudo systemctl enable fakedns.service
  257. sudo systemctl start ps5-host.service
  258. sudo systemctl start ps5-host-ssl.service
  259. sudo systemctl start fakedns.service
  260.  
  261. #==================================================
  262.  
  263. #Reboot
  264. sudo reboot
  265.  
  266. #==================================================
  267.  
  268. #Check status semua:
  269. sudo systemctl status ps5-host.service
  270. sudo systemctl status ps5-host-ssl.service
  271. sudo systemctl status fakedns.service
  272. sudo systemctl status dnsmasq.service
  273. sudo systemctl status static-ip.service
  274.  
  275. #==================================================
  276.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement