-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrshell_interface.src
More file actions
39 lines (35 loc) · 1.23 KB
/
rshell_interface.src
File metadata and controls
39 lines (35 loc) · 1.23 KB
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
36
37
38
39
// rshell_interface
// changes:
// now closes the pid of the rshell-server on terminal connection
metaxploit = include_lib("/lib/metaxploit.so")
if not metaxploit then
metaxploit = include_lib(current_path + "/metaxploit.so")
end if
if not metaxploit then exit("Error: Can't find metaxploit library in the /lib path or the current folder")
print("Listening for upcoming connections...")
shells = []
while shells.len == 0
shells = metaxploit.rshell_server
if(typeof(shells) == "string") then exit(shells)
if(shells.len == 0) then wait(2)
end while
option = 0
while typeof(option) != "number" or (option < 1 or option > shells.len)
print(shells.len + " shell(s) connected!\n<b>Select a shell to start a terminal:</b>")
for i in range(0, shells.len - 1)
print("\n<b>Shell (" + (i + 1) + ")</b>\nPublic IP: " + shells[i].host_computer.public_ip + "\nLocal IP: " + shells[i].host_computer.local_ip)
end for
print("-----------")
option = user_input("Select shell>").to_int
end while
print("Starting shell #" + option)
rpc = shells[option - 1].host_computer
procs = rpc.show_procs
a = procs.split("\n")
for b in a
if b.indexOf("rshell_client") then
c = b.split(" ")
rpc.close_program(c[1].to_int)
end if
end for
shells[option - 1].start_terminal