Broadcast address list cleaner. Takes a list of broadcast addresses as input, pings them all, and returns the addresses that give multiple responses.
131a00118dcf7be4f10930890886f39a6273e53cded0713ac463504a863e07a1
/*
_______ __ .__
_____________ \ _ \_/ |_ ____ ____ ____ | |
\____ \_ __ \/ /_\ \ __\/ _ \_/ ___\/ _ \| |
| |_> > | \/\ \_/ \ | ( <_> ) \__( <_> ) |__
| __/|__| \_____ /__| \____/ \___ >____/|____/
|__| \/ \/
-misteri0@unet
*/
/**************************************************************************************************
* [pr0tocol] *
* Name : zipp0.c
* Author: misteri0 [leet@ibw.com.ni] *
* Description: Opens a broadcast file & checks each of the addresses if they answer DUP's. *
* Very effective when you have those old bcast files. *
* Greets: Well to start off I don't wanna look like a code ripper as some fags would call me in *
* #linuxsex, I would start off by giving credit to Vacuum from Technotronic for *
* broadscan.c which has some of his code. Then greets go out to people from #bitchx@unet *
* #outlaw@unet, #slackware@unet, pr0tocol's channel <-- [e-mail: leet@ibw.com.ni for info*
* on how to join], thanx to everyone who has helped me with every single problem I've had*
* in linux. Packetstorm Security, *
* Fuck youz: *
* #linuxsex@unet for juping my nick (and I'm lame?), fags that took over #pr0tocol. *
* (amazingly these are the only fuckheads that I truly hate). *
**************************************************************************************************
*/
#include <stdlib.h>
#include <stdio.h>
#include <sys/wait.h>
#include <errno.h>
#include <netdb.h>
#include <signal.h>
#define DEBUG 1 /* messy code from here down! */
FILE *stream; /* very messy declarations, don't gross out... */
FILE *fp1;
char oneword[100];
char *c;
int counter,flag;
char *streamer, *streamer2;
FILE *stream;
char tempstring[2048];
char parse[2048];
void pingemup();
readline()
{
fp1 = fopen(streamer, "r");
if (fp1 == NULL)
{
printf("Fail to Open...\n");
exit (EXIT_FAILURE);
}
do
{
c = fgets(oneword, 100, fp1); /* get one line from the file */
if (c != NULL)
printf("[*] Scanning: %s", oneword);
pingemup();
} while (c != NULL); /* repeat until NULL */
fclose(fp1);
}
/* stolen from broadscan.c */
void pingemup()
{
flag=0;
sprintf(tempstring,"ping -c 2 -n %s",oneword);
stream=popen(tempstring,"r");
while (fgets(parse,sizeof(parse),stream)!=NULL)
{
if (DEBUG) /* printf("Results:%s",parse); */
if (strstr(parse,"DUP"))
{
flag=1;
fclose(stream);
break;
}
}
if (flag==1)
stream=fopen(streamer2, "a");
fprintf(stream,"%s",oneword);
fclose(stream);
}
main(int argc, char *argv[])
{
if (argc!=3)
{
printf("\t zipp0.c - coded by misteri0@unet [pr0tocol]\n");
printf("\nusage : %s <input.txt> <output.txt>\n\n",argv[0]);
exit(0);
}
printf("[*] Scanning addresses from --> [%s]\n",argv[1]);
printf("[*] Output of addresses will go to ---> [%s]\n",argv[2]);
printf("+------------------------------------------------------------------------+\n");
streamer=argv[1];
streamer2=argv[2];
readline();
}