Skip to content
Extraits de code Groupes Projets

Resolve "Create a "fake ssh" binary for proxies"

1 fichier
+ 19
0
Comparer les modifications
  • Côte à côte
  • En ligne
+ 19
0
// Must be renamed as "ssh" and installed on machines not meant to have LAN redirection capability
// In particular, public proxies for the "ssh rental" missions
if params.len < 2 or params.len > 3 then exit(command_info("ssh_usage"))
// Only modification : blocking LAN adresses
if active_user != "root" and is_lan_ip(params[1]) then exit("Access refused: this server is intended as a WAN proxy")
credentials = params[0].split("@")
user = credentials[0]
password = credentials[1]
port = 22
// params is a list of strings, so you have to convert it to integer, which is what connect_service accepts
if params.len == 3 then port = params[2].to_int
if typeof(port) != "number" then exit("Invalid port: " + port)
print("Connecting...")
shell = get_shell.connect_service(params[1], port, user, password, "ssh")
if shell then shell.start_terminal
\ No newline at end of file
Chargement en cours