Skip to content
Turn copied code into a chaotic mess
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
chaos
config
.gitignore
LICENSE
README.md
build.sh
poetry.lock
pyproject.toml

README.md

chaos

Gitter chat Code style


MT: Replace a semicolon (;) with a greek question mark (;) in your friend's C# code and watch them pull their hair out over the syntax error

— Peter Ritchie (@peterritchie) November 16, 2014

chaos is a pastejacking tool for GNU/Linux which modifies text copied to the operating system clipboard. The idea is to replace the ASCII character semicolon (;) with an identical looking Unicode character Greek question mark (;) as soon as any text is copied to the clipboard, so that when a user tries to compile some copied code, their life becomes harder.

Click here for a small demo showing what happens when chaos is running in the background.


Warning - Please read before proceeding

Running chaos is a potentially destructive action, and it can cause irreversible damage when important text (say a password, or a cryptographic key) is copied to clipboard without any visible indication that the text was modified.

I wrote it as a proof-of-concept tool to show how easy it is for a rogue program to manipulate your system clipboard (after reading about a malicious clipboard hijacker discovered in PyPI), as well as a tool which can be used to play practical jokes on people, if that's your thing.

As the name signifies, it is an agent of chaos. Please use it judiciously, if you decide to do so.


Installation

Download the pre-built binary

Download the latest release from the releases page and unarchive it. No further installation is required.

Build from source

Before building, make sure the following software is installed and added to the PATH-

To build chaos from source, execute the Bash script build.sh with necessary privileges-

./build.sh

Note that this will remove all the source code as well, so if you are working on the code, you might want to modify the build script (see the comments inside the script).


Usage

Execution

chaos runs in the background as a Unix-style deamon process, and does not require any superuser privileges. To run it, execute the binary chaosd present inside the directory chaos/-

./chaosd

To stop it, kill the daemon-

kill $(cat $(echo /tmp/chaos-$(id -u).pid))

Configuration

An optional configuration file daemon.json can be placed inside a parallel directory config/ before starting the daemon to control its behaviour. Following options are currently supported-

Flag Description
plaintext_only Only plaintext is modified, and all formatted text is ignored
random_hit_chance Cut/copy events will be ignored entirely with a probability of 0.5
random_instances Random instances of target character (;) will be modified throughout the copied text. This flag can be set if and only if plaintext_only is also set.

If no configuration file is provided, every flag is assumed to be unset.


Notes

  • This tool could be used as a general purpose pastejacker by setting TGT and GQM in chaosd.py as required (see the comments) and rebuilding the binary. This might be generalized in a future release.

  • The only platform currently supported is GNU/Linux. macOS support won't be particularly useful due to this limitation, but Windows and BSD support are in the pipeline.

  • There is no logging of any kind at the moment. This might change in the future. Remember, this is the first release and a lot can be added. If you wish to ask/discuss anything, hop on to the Gitter room. Any contributions are welcome.

  • This project is partially inspired by Greg Toombs' mimic. Check that out for even more fun.

You can’t perform that action at this time.