An open API service indexing awesome lists of open source software.

https://github.com/0xsuk/kop

Shell command manager: Remember, Search, Copy, Execute long command
https://github.com/0xsuk/kop

cli command-line ctf ctf-tools

Last synced: 6 months ago
JSON representation

Shell command manager: Remember, Search, Copy, Execute long command

Awesome Lists containing this project

README

          

# kop
kop is a cli tool that I personally use for daily CTF(Capture the flag).




**Concept: Do not type same commands**




If you are CTF player, you are probably typing same shell commands everyday, like `nmap `, or `gobuster dir -u http:// -w directory-list-2.3-medium.txt`... and so on.
You don't want to type these long command for every machine with different IP addresses, right?
The problem is that these commands slightly change every time because of the "variable" factors like IP address, so just a simple shell alias does not lessen your job.

kop was made to address this problem.




Here's a quick example usage.
![image](https://github.com/0xsuk/kop/blob/main/.github/example1.png)

brief explanation:
- `kop ac`: `ac` stands for "add command".
Adding nmap command with IP variable ${IP}. ${} is a variable notation.
- `kop av`: `av` stands for "add variable".
Setting IP variable to 10.11.12.13.
- `kop sc`: `sc` stands for "search command".
Searching commands that contains string "nmap", and kop shows match and its index which turns to be 0 (since this is the first command added)
- `kop cc`: `cc` stands for "copy command".
Copying a command at index 0, to my **system clipboard**.

The nmap command was copied to my clipboard, **replacing IP variable with its value.**
You can paste the command, without typing loooong shell command again.

Commands and variables added by `ac` and `av` remain in json files, so you don't have to type them again.

# Install
You must have `xclip` for Linux, `pbcopy` for OSX to make full use of kop.
```
go install github.com/0xsuk/kop@latest
```

Or install from [releases](https://github.com/0xsuk/kop/releases)

# Usage

```
Available Commands:
help [] help about any command

[Variable related]
av add pair
cv copy 's to system clipboard
rv ... remove variables. If no provided, remove all variables
sv [] search variable that contains . If no query provided, print all variables

[Command related]
ac [] add command with specified key. Key is optional
cc copy a command replacing with its
ec execute a command replacing with its
rc ... remove commands specified by keys or ids
sc [] search commands. If no query, get all commands

Available Flags:
kop [] -h help about any command
```

Detail

  • <key>: Key is a string id that can be used as an argument to specify a command.

  • <key|index>: Key or Index. Index is an index of a command. All commands are assigned an index when added with `kop ac`, no matter <key> is provided or not. Check indexes of commands by `kop sc`.
  • CTF Life is so much better with kop!
    ![image](https://github.com/0xsuk/kop/blob/main/.github/example3.png)

    # TODO
    - [x] Adding command with string id
    - [x] Executing command with kop
    - [ ] Multiple sessions