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

propecia2.c

propecia2.c
Posted Apr 17, 2007
Authored by John Martinelli from ISRD.com | Site redlevel.org

A hack of propecia.c to include class A domain scanning and banner grabbing.

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

propecia2.c

Change Mirror Download
/* * * * * * * * * * * * * * * * * *
*
* propecia2.c - a fast class A port scanner
*
* usage: ./propecia2 <x> <port>
*
* * * *
*
* This is a hack of propecia.c to include class A domain scanning
* and banner grabbing. Originally, propecia.c was coded with only
* class C domain scanning.
*
* by John Martinelli
* john@martinelli.com
* john-martinelli.com
*
* * * * *
*
* April 15, 2007
*
*/

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

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

int sockfd, result, counter1, counter2, counter3;
char host[15], banner[512];
char *classa;
int port;

struct sockaddr_in address;

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

port = atoi(argv[2]);
classa = argv[1];
sprintf(host, "%s.255.255.255", classa);
printf("\n");
if(!inet_aton(host, &address.sin_addr))
{
printf("Invalid Class A Address\n");
exit(1);
}

for (counter1 = 1; counter1 <= 255; counter1++)
{
counter2 = 1;
for (counter2 = 1; counter2 <= 255; counter2++)
{
counter3 = 1;
for (counter3 = 1; counter3 <= 255; counter3++)
{
sprintf (host, "%s.%d.%d.%d\n", classa, counter1, counter2, counter3);
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)
{
memset(banner, 0, sizeof(banner));
read(sockfd, &banner, 512);
printf ("[$] Port %s open on %s Banner: %s\n", argv[2], host, banner);
close (sockfd);
exit (0);
} } } }

sleep(1);
close (sockfd);
exit (0);
} }
Login or Register to add favorites

File Archive:

April 2024

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