home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Hackers Toolkit v2.0
/
Hackers_Toolkit_v2.0.iso
/
HTML
/
archive
/
Unix
/
c-src
/
broadscan.c
< prev
next >
Wrap
C/C++ Source or Header
|
1999-11-04
|
2KB
|
110 lines
/* Broadscan v 0.51
DUP Broadcast IP scanner
by Vacuum http://www.technotronic.com
11.24.98
This is a very lame scanner written to
stop people from asking how to find
DUP broadcast ip addresses. Use this in
conjunction with smurf, fraggle,
or papasmurf. DoS kiddies enjoy!
Revision history:
0.31 really lame: implementation broadscan <octet> <octet>
0.50 not quite as lame: now implemented as broadscan www.xxx.yyy.zzz
however .yyy was ignored and started scan at 1
0.51 still lame: now recognizes .yyy cleaned up some of the sloppy code
Greets to horizon and bodhidarm
*/
#include <stdlib.h>
#include <stdio.h>
#include <sys/wait.h>
#include <errno.h>
#include <netdb.h>
#include <signal.h>
FILE *stream;
#define DEBUG 1
void pingz0r(int first, int second, int start, int end)
{
int counter,flag;
FILE *stream;
char tempstring[2048];
char parse[2048];
for (counter=start; counter <end; counter++)
{
flag=0;
sprintf(tempstring,"ping -c 2 -n %d.%d.%d.255 2>/dev/null",first,
second, counter);
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("broadcast.txt", "a");
fprintf(stream, "%d.%d.%d.255\n",first,second,counter);
fclose( stream);
}
}
main(int argc, char *argv[])
{
char *curr_ip, *del, *cm[100];
int first, second, third, A4;
if (argc!=2)
{
printf("\nusage : %s <ipaddress>\n\n",argv[0]);
exit(0);
}
curr_ip=argv[1];
del=(char *)strtok(curr_ip, ".");
first=atoi(del);
del=(char *)strtok(NULL, ".");
second=atoi(del);
del=(char *)strtok(NULL, ".");
third=atoi(del);
del=(char *)strtok(NULL, ".");
A4=atoi(del);
if (first==127)
{
printf("%d is a localhost. You have no clue or are trying to break this program",first);
exit(0);
}
if (first>254 || first <0)
{
printf("First octet is: %d. It must be between <1-254>",first);
exit(0);
}
if (second>254 || second<0)
{
printf("Second octet is: %d. It must be <1-254>",second);
exit(0);
}
if (third>254 || third<0)
{
printf("Third octet is: %d. It must be <1-254>",second);
exit(0);
}
printf("Scanning for DUP broadcast ip addresses\n");
printf("Results output to broadcast.txt\n");
pingz0r(first,second,third,255);
}