From 6fb080f913484176640237d223502cdfaf45f66b Mon Sep 17 00:00:00 2001 From: hc Date: Mon, 3 Feb 2025 18:30:37 +0800 Subject: udpaye --- client_manager.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'client_manager.py') diff --git a/client_manager.py b/client_manager.py index ab29e16..016e76d 100644 --- a/client_manager.py +++ b/client_manager.py @@ -47,6 +47,10 @@ def get_ssh_port(pid): if i in l[1] and "*:" in l[8]: port = l[8][2:] ''' + # using the pid of the ssh connection, get the string of the connection 45.32.108.159:ssh->210.10.76.5:45460 + # then get the other pid with the same string + # then get the other pid + # then get the publicly forwarded port try: lines = subprocess.check_output("lsof -i -n | grep sshd", shell=True, text=True).splitlines() pid = str(pid) -- cgit v1.2.3-70-g09d2