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

genlist.c

genlist.c
Posted Feb 19, 2001
Authored by Craig Cheetham

Genlist.c generates lists of IP addresses. Works on many platforms and has user definable start and stop IPs.

tags | tool, scanner
systems | unix
SHA-256 | ce16a06083e4ed22793e1aa44e4a45accd9618671a0efde2e2e0b0565c1583b9

genlist.c

Change Mirror Download
/* (Platform independant) IP lister (c)2000-1 Craig Cheetham 
* Released under the GNU Licence. - Spread the source, not
* the binaries! (ahem fixed)
*
* E-Mail: craig_cheetham@yahoo.co.uk
*
*/
#include <stdio.h>
#include <string.h>
#include <netinet/in.h>

union ipaddy
{
unsigned char c_num[4];
unsigned long l_num;
};

int parse(char *string, char *dest)
{
int i = 0;
unsigned long num;
char *p = string, *n;

strtok(p,".");

while(p && i<4) {
if((num = atol(p)) > 255) return 1;
dest[i++] = num;
p = strtok(0,".");
}

return 0;
}

int main (int argc, char **argv)
{
union ipaddy source, dest;

if(argc < 3) {
printf("Platform independant IP lister, by Craig Cheetham (c)2000-1\n");
printf("===========================================================\n\n");
printf("Usage: %s <start ip> <end ip>\n\n", argv[0]);
printf("Examples:\n");
printf("\t\t%s 205 206\t\t\t# Class A scan\n", argv[0]);
printf("\t\t%s 205.214 205.215\t\t# Class B scan\n", argv[0]);
printf("\t\t%s 205.214.14 205.214.56\t# Class C scan\n", argv[0]);
exit(0);
}

source.l_num = dest.l_num = 0;

if(parse(argv[1], source.c_num)) {
fprintf(stderr, "Error: Source IP is jarg.\n");
return 0;
}

if(parse(argv[2], dest.c_num)) {
fprintf(stderr, "Error: Dest IP is jarg.\n");
return 0;
}

while(htonl(source.l_num) < htonl(dest.l_num)) {

printf("%u.%u.%u.%u\n",
source.c_num[0],
source.c_num[1],
source.c_num[2],
source.c_num[3]);

source.l_num = htonl(htonl(source.l_num)+1);
}

return 0;
}
Login or Register to add favorites

File Archive:

August 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Aug 1st
    15 Files
  • 2
    Aug 2nd
    22 Files
  • 3
    Aug 3rd
    0 Files
  • 4
    Aug 4th
    0 Files
  • 5
    Aug 5th
    15 Files
  • 6
    Aug 6th
    11 Files
  • 7
    Aug 7th
    43 Files
  • 8
    Aug 8th
    0 Files
  • 9
    Aug 9th
    0 Files
  • 10
    Aug 10th
    0 Files
  • 11
    Aug 11th
    0 Files
  • 12
    Aug 12th
    0 Files
  • 13
    Aug 13th
    0 Files
  • 14
    Aug 14th
    0 Files
  • 15
    Aug 15th
    0 Files
  • 16
    Aug 16th
    0 Files
  • 17
    Aug 17th
    0 Files
  • 18
    Aug 18th
    0 Files
  • 19
    Aug 19th
    0 Files
  • 20
    Aug 20th
    0 Files
  • 21
    Aug 21st
    0 Files
  • 22
    Aug 22nd
    0 Files
  • 23
    Aug 23rd
    0 Files
  • 24
    Aug 24th
    0 Files
  • 25
    Aug 25th
    0 Files
  • 26
    Aug 26th
    0 Files
  • 27
    Aug 27th
    0 Files
  • 28
    Aug 28th
    0 Files
  • 29
    Aug 29th
    0 Files
  • 30
    Aug 30th
    0 Files
  • 31
    Aug 31st
    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