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

Adding readline capabilities to shell (like keyboard shortcuts for editing text, history, and auto-completion) #1625

Open
n3rada opened this issue Apr 7, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@n3rada
Copy link
Contributor

n3rada commented Apr 7, 2024

I would very much like to improve the shell command interface in Sliver to allow easier editing of pasted commands. Currently, when a command is pasted into the shell interface, making changes, particularly towards the beginning or middle of the command, can be tedious.

This feature would be particularly useful for commands requiring only minor modification, such as changing a file name or path.

sliver (BIG_ATHLETE) > shell

? This action is bad OPSEC, are you an adult? Yes

[*] Wait approximately 10 seconds after exit, and press <enter> to continue
[*] Opening shell tunnel (EOF to exit) ...

[*] Started remote shell with pid 10608

PS C:\Windows\system32> ^[[A^[[D^[[C^[[B

Consider the following scenario where the user pastes a PowerShell command and needs to modify it:

PS C:\Windows\system32> gci C:\ -filter local.txt -rec -ea 0 | % { "$($_.FullName) -> $((gc $_.FullName) -join ' ')" }

If the user needs to change local.txt to config.txt, it currently could not to this because it is even not able to move character by character.

Isn't it possible to use the same behavior as rlwrap in this context? Or a special go plugin?

@moloch-- moloch-- added the enhancement New feature or request label Apr 16, 2024
@moloch--
Copy link
Member

PTYs already work on Linux, I'm not familiar enough with Windows consoles to implement something myself but should be possible if we find a good Golang/Windows virtual console, but I'm not sure one exists today.

@n3rada
Copy link
Contributor Author

n3rada commented May 9, 2024

What about implementing a behaviour like ConPtyShell? Would it be feasible?

@moloch--
Copy link
Member

We'd need to port it to Golang to use it, so while possible it won't be a priority.

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

2 participants