Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/b23r0/cliws
Cross platform interactive bind/reverse PTY shell
https://github.com/b23r0/cliws
interactive-shell pentest reverse-shell terminal websocket
Last synced: 5 days ago
JSON representation
Cross platform interactive bind/reverse PTY shell
- Host: GitHub
- URL: https://github.com/b23r0/cliws
- Owner: b23r0
- License: mit
- Created: 2021-10-24T04:10:07.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-11-06T02:19:16.000Z (about 1 year ago)
- Last Synced: 2024-08-10T10:19:30.900Z (3 months ago)
- Topics: interactive-shell, pentest, reverse-shell, terminal, websocket
- Language: Rust
- Homepage:
- Size: 1.89 MB
- Stars: 151
- Watchers: 2
- Forks: 25
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Cliws [![Build Status](https://img.shields.io/github/workflow/status/b23r0/cliws/Rust)](https://app.travis-ci.com/b23r0/Cliws) [![ChatOnDiscord](https://img.shields.io/badge/chat-on%20discord-blue)](https://discord.gg/ZKtYMvDFN4) [![LastCommit](https://img.shields.io/github/last-commit/b23r0/cliws)](https://github.com/b23r0/Cliws/) [![Crate](https://img.shields.io/crates/v/cliws)](https://crates.io/crates/cliws)
Lightweight interactive bind/reverse PTY shell implementation by Rust.# Features
* WebSocket
* Full pty support: VIM, SSH, readline, Ctrl+X
* Auto set terminal window size.
* Reverse connection / Bind port
* Support Win10+(Windows Server 2019+) & Linux & BSD & OSX# Build & Run
`$> cargo build --release`
`$> ./target/release/cliws`
# Installation
`$> cargo install cliws`
# Usage
## Bind Mode
You can run a bash and listen port at 8000
`$> ./cliws -p 8000 bash -i`
then connect and get a comfortable shell.
`$> ./cliws -c ws://127.0.0.1:8000`
## Reverse Mode
First listen a port wait for shell
`$> ./cliws -l 8000`
then build a reverse connection
`$> ./cliws -r ws://127.0.0.1:8000 bash -i`
# Example
## Linux
![image]( https://github.com/b23r0/Cliws/blob/main/example/cliws-vim.gif)
## Windows(Reverse Mode)
![image]( https://github.com/b23r0/Cliws/blob/main/example/cliws-windows.gif)
# Invalid Characters
In Windows(Windows Terminal), the default `CodePage` encoding is UTF-8. When encountering the target of other language operating systems, invalid characters may occur. You can try the following methods to solve it.
Open Regedit and modified `[Machine]\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Nls\CodePage\OEMCP` value is 65001(DEC).
# Reference
* https://github.com/t57root/amcsh
* https://github.com/philippkeller/rexpect
* https://github.com/zhiburt/conpty
* https://securityonline.info/conptyshell-interactive-reverse-shell/