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

Use tmux for managing multiple connections #258

Open
axman6 opened this issue Jun 18, 2022 · 0 comments
Open

Use tmux for managing multiple connections #258

axman6 opened this issue Jun 18, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@axman6
Copy link

axman6 commented Jun 18, 2022

Is the feature related to a problem? Please describe.

Session management is good but limits concurrency with only the ability to interact with one session/pwncat command line at a time. Handling long running processed on the remote host can lead to time out errors from pwncat.

Feature Description

#68 mentioned briefly that a user could use something like tmux to manage multiple instances of pwncat. I would love to see pwncat run inside tmux by default, and manage multiple panes at once to avoid switching between the pwncat cli and the various open sessions. By default the pwncat cli would be open in a pane inside tmux. Once a remote connection is made, initialising that connection would crate a new tmux pane, while keeping the pwncat pane open (my idea would be to keep the pwncat pane at the bottom of the window, and add new session panes above horizontally, but of course a user could configure this using tmux.

The main benefit of this is being able to run commands concurrently in different sessions and keep track of their progress - currently this can be quite problematic; running, say, nmap on the remote system can lead to pwncat timing out when trying to use ^d to switch back to the pwncat cli.

As far as I understand, the current implementation will run enumeration etc. in the same shell you are connected to, which might make implementing this more difficult, but potentially run could take an argument to specify which session to run with (and disable the use of that session pane while it's executing).

I haven't looked too deeply into whether it would be feasible to use, but tmuxp appears to offer python bindings for managing tmux sessions from the command line - hopefully it can also be used programmatically as apython library inside pwncat - https://tmuxp.git-pull.com/api.html seems to suggest it can be, though I can't see how to open a new pane with a pty that has been crated by pwncat.

Alternatives

It would be possible to implement this without tmux using something like ncurses, but that feels llike far more trouble than its worth. This also adds an external dependency on tmux, so may not be ideal, but if the old interface is retained, using tmux may be accessivle through a pwncat command line flag.

Additional Context

@axman6 axman6 added the enhancement New feature or request label Jun 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant