exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

imp-range.c

imp-range.c
Posted Jan 4, 2000
Authored by Shake

Tool for scanning networks which generates an list of IP addresses between a starting and ending ip.

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

imp-range.c

Change Mirror Download
/*
2000 .[.I.m.p.e.r.f.e.c.t.i.o.n.]. 2000

Imperfection Security Team presents range.
A tool that outputs every IP per IP range.
A gift from shake (shake@linuxstart.com)
Usage: ./range 127.0.0.0 127.2.0.255 >file

Hellos: unknown, dayve, syntax, tom, blitz,
justin, vicci, wolf, punish, kindred, alg.

Can be used with stdin scanners, or other fine tools.

*/
#include <stdio.h>
#include <string.h>

void usage(void) {
fprintf(stderr, "\n.[.I.m.p.e.r.f.e.c.t.i.o.n.].\n");
fprintf(stderr, "imp-range.c (v1.0) by shake\n");
fprintf(stderr, "Echos every IP in a specified range.\n\n");
fprintf(stderr, "Usage:\t./range <LowerIpRange> <HigherIpRange>\n");
fprintf(stderr, "E.G.:\t./range 3.1.33.7 3.1.35.255 >ipdb.txt\n\n");
fflush(stderr);
}

int main(int argc, char *argv[])
{
char *lowhost, *hihost;

/* option parsing */
unsigned int la, lb, lc, ld, ln;
unsigned int ha, hb, hc, hd, hn;
unsigned int laddr[4], haddr[4];

if (argc != 3) {
usage();
return 1;
}

lowhost = argv[1];
hihost = argv[2];

ln=sscanf(lowhost, "%u.%u.%u.%u", &la, &lb, &lc, &ld);
hn=sscanf(hihost, "%u.%u.%u.%u", &ha, &hb, &hc, &hd);

if (ln != 4 || hn != 4) {
fprintf(stderr, "WTF KIND OF IP ADDRESS IS THAT?!?!? (%s :: %s)", lowhost, hihost);
return 1;
}

laddr[0] = la; haddr[0] = ha;
laddr[1] = lb; haddr[1] = hb;
laddr[2] = lc; haddr[2] = hc;
laddr[3] = ld; haddr[3] = hd;

while (laddr[0] <= haddr[0]) {
while (laddr[1] <= haddr[1]) {
while (laddr[2] <= haddr[2]) {
if ((const int)haddr[3] == 255) {
while ((const int)laddr[3] <= 255) {
/* output class c's .. */
printf("%u.%u.%u.%u\n", laddr[0], laddr[1], laddr[2], laddr[3]);
++laddr[3];
}
fflush(stdout);
}
else if (laddr[3] <= haddr[3]) {
while (laddr[3] <= haddr[3]) {
printf("%u.%u.%u.%u\n", laddr[0], laddr[1], laddr[2], laddr[3]);
++laddr[3];
}
}
laddr[3]=0;
++laddr[2];
}
laddr[2]=0;
++laddr[1];
}
laddr[1]=0;
++laddr[0];
}

fflush(stdout);
return 0;
}
Login or Register to add favorites

File Archive:

July 2024

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