{"id":11894561,"url":"https://github.com/pyjabox/TunnelOverTerminal","last_synced_at":"2025-10-13T11:31:40.733Z","repository":{"id":246716793,"uuid":"205558998","full_name":"pyjabox/TunnelOverTerminal","owner":"pyjabox","description":"Tunnel TCP or UDP data stream over a terminal session which has been established by Expect script","archived":false,"fork":false,"pushed_at":"2019-09-02T15:33:49.000Z","size":21,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-30T11:34:14.561Z","etag":null,"topics":["expect","ssh","tcp","terminal","tunnel"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pyjabox.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-08-31T15:02:56.000Z","updated_at":"2024-06-25T11:07:16.000Z","dependencies_parsed_at":"2024-07-09T08:47:32.246Z","dependency_job_id":null,"html_url":"https://github.com/pyjabox/TunnelOverTerminal","commit_stats":null,"previous_names":["pyjabox/tunneloverterminal"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/pyjabox/TunnelOverTerminal","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyjabox%2FTunnelOverTerminal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyjabox%2FTunnelOverTerminal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyjabox%2FTunnelOverTerminal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyjabox%2FTunnelOverTerminal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pyjabox","download_url":"https://codeload.github.com/pyjabox/TunnelOverTerminal/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyjabox%2FTunnelOverTerminal/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279014793,"owners_count":26085594,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["expect","ssh","tcp","terminal","tunnel"],"created_at":"2024-06-30T04:06:37.072Z","updated_at":"2025-10-13T11:31:40.438Z","avatar_url":"https://github.com/pyjabox.png","language":"Python","funding_links":[],"categories":["HarmonyOS"],"sub_categories":["Windows Manager"],"readme":"# Tunnel Over Terminal (ToT)\nTunnel TCP data stream over a terminal session (UDP evaluated for an upcoming release)\n\n# Use cases\nContext : you have a terminal access to a remote linux box, but going through multiple bastion hosts which have custom prompt and would never allow whatever sort of tunneling\n\nWith ToT, you can :\n- Go through bastion hosts which prevent any kind of tunneling. As long as the connection can be done through a traditional Expect script and you land on a terminal, you are good to go.\n\n- Do port redirection from remote network to a local port in local network over this tunnel. Thanks to that you can access web application, Java application, create a Reverse SSH connection...\n\n- Transfer files over this tunnel. SCP will work fine and at a decent rate (~200KB/s)\n\n# Requirements\n\nOn local host:\n- Python 2.7.16\n- Standard Linux binaries (mkfifo, xxd, netcat, expect)\n- pv utility if you want statistics\n\nOn bastion intermediate hosts:\n- whatever as long as information is carried in reliable way\n\nOn remote host:\n- Standard Linux binaries (mkfifo, xxd, netcat)\n- optional but preferable : allowing SSH port forwarding. This, in order to bring a SSH session over ToT and use the already powerful possibility of SSH port-forwarding\n\n# Setup\n1/ On source machine, create named pipes (FIFO) :\n- mkfifo fromN\n- mkfifo toN\n- mkfifo fromNC-HEX\n- mkfifo fromN-HEX\n\n2/ On target machine, create named pipes (FIFO) :\n- mkfifo fromNC\n- mkfifo toNC\n\n3/ On source machine, modify the three Expect scripts (connect.exp ; remote-read.exp ; remote-write.exp) to let them connect to target machine automatically. Leave the last \"send\", \"expect\" and \"interact\" functions as is. Don't forget to \"chmod +x\" them.\n\n# Usage\n```\nusage: ToT.py [-h] [-s PORT_SOURCE] [-ip IP_DESTINATION] [-d PORT_DESTINATION]  \n              [-f FORCE] [--clean CLEAN] [--stats STATS]  \n\noptional arguments:  \n  -h, --help            show this help message and exit  \n  -s PORT_SOURCE, --port_source PORT_SOURCE  \n                        provide an integer (default: 8765)  \n  -ip IP_DESTINATION, --ip_destination IP_DESTINATION  \n                        provide an ip (default: 127.0.0.1)  \n  -d PORT_DESTINATION, --port_destination PORT_DESTINATION  \n                        provide an integer (default: 22)  \n  -f FORCE, --force FORCE  \n                        provide yes or no (default: no)  \n  --clean CLEAN         provide brutal or no (default: no)  \n  --stats STATS         provide yes or no (default: no)  \n```\n# Example\n\nTerminal 1 :  \n```\nuser@mylocalhost:~$ python ./ToT.py -s 8765 -ip 127.0.0.1 -d 22 --stats yes  \nPress CTRL-C to exit...  \nTraffic in tunnel (in HEX + Overhead)  \nInput bytes= 164 ; Output bytes= 0  \n```\nTerminal 2 :  \n```\nuser@mylocalhost:~$ ssh remoteuser@localhost -p 8765  \ncisco@localhost's password:  \nWelcome to Remote Host Server  \n\nLast login: Sat Aug 31 17:28:05 2019 from 10.60.2.100  \nremoteuser@remotehost:~$\n```\nIn this simple scenario, SSH connection will be encapsulated over ToT, whatever is in the middle (bastion hosts, telnet connection...).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpyjabox%2FTunnelOverTerminal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpyjabox%2FTunnelOverTerminal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpyjabox%2FTunnelOverTerminal/lists"}