Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ssh -L / ssh.connect_remote() workaround when AllowTcpForwarding is disabled #2538

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

peace-maker
Copy link
Member

@peace-maker peace-maker commented Jan 30, 2025

Use a netcat process on the remote to connect to the specified host:port and tunnel the traffic using normal ssh.process I/O.

This was inspired by the "Circumventing Disabled SSH Port-Forwarding with a Multiplexer" article by @guysv in the Paged Out! zine no. 5.

from pwn import *
io_ssh = ssh('hacker', 'pwn.college', keyfile=os.path.expanduser('~/.ssh/id_ed25519'), raw=True)
io = gdb.debug('/challenge/some_challenge', ssh=io_ssh)
io.interactive()

Debugging works now instead of throwing a paramiko.ssh_exception.ChannelException: ChannelException(1, 'Administratively prohibited') exception on pwn.college.

@peace-maker peace-maker force-pushed the ssh_connector_netcat branch 2 times, most recently from dc0ec3c to 1323dc5 Compare January 30, 2025 10:53
…ding` is disabled

Use a netcat process on the remote to connect to the specified host:port and tunnel the traffic using normal `ssh.process` I/O.

This was inspired by the "Circumventing Disabled SSH Port-Forwarding with a Multiplexer" article by @guysv in the Paged Out! zine no. 5.

It allows to use `gdb.debug(arg, ssh=ssh)` to debug processes on pwn.college.
pwnlib/tubes/ssh.py Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants