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

propecia.c

propecia.c
Posted Aug 17, 1999
Authored by Bind

A fast class C domain scanner that scans for a specified open port. 1.451 kb.

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

propecia.c

Change Mirror Download
/* 
* propecia.c
* 2-20-99
*
* A fast class C domain scanner that scans for a specified open port.
*
* Usage: ./propecia [X.X.X] <port>
*
*/

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <sys/signal.h>
#include <sys/socket.h>
#include <netinet/in.h>

#define DEFAULT_PORT 23

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

int sockfd, result, counter = 0;
char host[15];
char *ip;
int port;

struct sockaddr_in address;

if (argc < 2)
{
printf ("Usage: %s [X.X.X] <port>\n", argv[0]);
exit (1);
}

if(argv[2] != NULL)
port = atoi(argv[2]);
else
port = DEFAULT_PORT;

ip = argv[1];
sprintf(host, "%s.255", ip);
if(!inet_aton(host, &address.sin_addr))
{ printf("error: invalid class c\n"); exit(1); }

while (counter < 255)
{

++counter;

sprintf (host, "%s.%d\n", ip, counter);

if ((fork ()) == 0)
{

address.sin_family = AF_INET;
address.sin_port = htons (port);
address.sin_addr.s_addr = inet_addr (host);

sockfd = socket (AF_INET, SOCK_STREAM, 0);

if (sockfd < 0)
{
perror ("Socket");
exit (2);
}

alarm (3);

result = connect (sockfd, (struct sockaddr *) &address, sizeof (address));

if (result == 0)
{
printf ("%s", host);
close (sockfd);
exit (0);
continue;
}
exit (0);
}

}

sleep(1);
close (sockfd);
exit (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
    0 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