Skip to content

Commit

Permalink
updated readme
Browse files Browse the repository at this point in the history
Signed-off-by: wadeking98 <wkingnumber2@gmail.com>
  • Loading branch information
wadeking98 committed Oct 25, 2023
1 parent efb3464 commit a03b536
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 3 deletions.
24 changes: 23 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,33 @@ other cool features:
- shell verification: crab_trap automatically verifies that a tcp connection is a shell before it adds it to your list
- shell aliasing, easily rename your shells
- ignores CTRL+c in non-interactive mode to stop you from accidentally closing your shell
- notifies when a new shell is received
- command history completion
- file/folder completion (except in non-interactive shell)



This project is still under active development, PRs are welcome

## Note about text editors:
When in raw mode nano works fine but other editors like vi and vim don't
I'm unsure as to why, some help here would be appreciated

## Main menu functionality:
The crab_trap main menu is fully interactive and supports any os command as well as file and history completion:
![main menu](assets/crab_trab_fully_interactive.gif)

## Shell capture functionality:
crab_trap by default listens for shells on port 4545, this can be changed by `crab_trap <INTERFACE> <PORT>`. Once it receives a tcp connection, it sends an echo command, if the connection responds then it is likely a shell and it gets added to the list.
Once a shell is added, a notification will display in the top left corner of the menu screen. To interact with the shell list, simply enter `l` into the menu.
![shell capture](assets/non_interactive_shell.gif)

## Interactive mode:
Once you have a tty go back to the shell list screen and highlight the shell with your tty. Press `r` on the highlighted shell and it will automatically set the tty rows and columns and then start raw mode
![interactive shell](assets/interactive.gif)

## TODO:
- Add support for multiple running instances (maybe a client/server architecture)
- Notifications when new shell is caught
- Increase test coverage
- Fix rustyline prompt being erased in non-interactive mode
- Fix vim support in raw mode
Binary file added assets/crab_trab_fully_interactive.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/interactive.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/non_interactive_shell.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 4 additions & 2 deletions src/input/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,13 @@ impl CompletionHelper {
pub fn display_notification(text: String) {
let mut stdout = stdout();
let notification = format!(
"{goto}{clear}{success}{text}{reset}",
"{goto}{clear}{success_bg}{success}{text}{reset}{reset_bg}",
goto = cursor::Goto(1, 1),
clear = clear::CurrentLine,
success = color::Fg(color::LightGreen),
success = color::Fg(color::Red),
success_bg = color::Bg(color::Rgb(255, 200, 0)),
reset = color::Fg(color::Reset),
reset_bg = color::Bg(color::Reset),
);

// save cursor position
Expand Down

0 comments on commit a03b536

Please sign in to comment.