Skip to content

Commit

Permalink
Block binaries on SSH
Browse files Browse the repository at this point in the history
stdout/stdin is very broken over BadBandSSH currently
  • Loading branch information
logandhillon committed Jul 12, 2024
1 parent 8d97b9e commit 7d95fc2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bdsh.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ def run_line(self, line: str):
except Exception as e:
self.print(f"{args[0]}: {e}")
elif os.path.exists(bin := self.get_path("exec", args[0])):
if self.is_ssh:
self.print(f"{args[0]} is unsupported over SSH")
return

subprocess.run([sys.executable, bin] + args[1:], stdout=self.stdout, stderr=subprocess.STDOUT, stdin=self.stdin, text=True, env=self.env)
else:
self.print(f"Invalid command: {args[0]}")
Expand Down

0 comments on commit 7d95fc2

Please sign in to comment.