--- rpcscan-cli-03.c Mon Sep 15 11:46:44 2003 +++ rpcscan-cli-03a.c Mon Sep 15 11:58:31 2003 @@ -189,6 +189,7 @@ printf ("\nUsage: %s [options] (Single IP)\n", proggie); printf ("Usage: %s -c [options] (Class C - 256 addresses from start-ip, will wrap around)\n", proggie); printf ("Usage: %s -b [options] (Class B - 65536 addresses from start-ip, will wrap around)\n", proggie); + printf ("Usage: %s -f [options] (Addresses listed in ip-file\n", proggie); printf ("Usage: %s -h (displays help)\n\n", proggie); printf (" [options]\t-t (set timeout on socket connection, default 300 ms)\n\n"); printf ("Example: '%s -c 10.1.1.0 -t 20' to scan 10.1.1.0 - 10.1.1.255 with a timeout of 20 ms\n", proggie); @@ -624,9 +625,12 @@ { char *optflag_range = "-c"; char *optflag_range2 = "-b"; + char *optflag_file = "-f"; char *optflag_help = "-h"; char *optflag_timeout = "-t"; char *firstAddr; + char buf[BUFSIZ]; + FILE *ffd; timeout_timeval.tv_usec = 0; recvtimeout_timeval.tv_usec = 3000000; @@ -702,7 +706,31 @@ j++; } } - + + else if (strcmp(optflag_file, argv[1])==0) { + if ( (ffd = fopen(argv[2], "r")) == NULL) { + printf("error opening file\n"); + return(1); + } + if (argc > 3){ + if ((strcmp(optflag_timeout, argv[3])==0)&&(argc == 5)) { + timeout_timeval.tv_usec = (atoi(argv[4])*1000); + } + else { + usage(argv[0]); + return(1); + } + } + else { + timeout_timeval.tv_usec = 300000; + } + while (fscanf(ffd, "%s", buf) > 0) { + RemoteAddr = inet_addr(buf); + checkVulnerable(RemoteAddr); + } + fclose(ffd); + } + else { RemoteAddr = inet_addr(argv[1]); if (argc > 2){