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

0x90-net.c

0x90-net.c
Posted Apr 28, 2005
Authored by un10x | Site 0x90sec.tk

This is a fast banner scanner which uses fork().

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

0x90-net.c

Change Mirror Download
/****************************************************************************

0x90-net.c
fast banner scanner
by un10x // 0x90
IRC: irc.efnet.pl
http://www.0x90sec.tk

*****************************************************************************/
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <stdlib.h>
#include <netdb.h>
#include <signal.h>
#include <netinet/in.h>
#include <string.h>

#define TIME 5

FILE *fp;
FILE *pf;

int sockett, a, b, c, d;
struct hostent *he;
int MAXCHILDS;
int porta, childs = 0;
char host[BUFSIZ];
char banner[1024];

int
main (int argc, char *argv[])
{
if (argc != 6)
{
printf(" 0x90-net.c\n");
printf("released by un10x / 0x90security\n");
printf("mif88[at]inbox.ru\n");
printf("usage:%s [options] [mask] [port] [banner] [maxchilds]\n", argv[0]);
printf("options:\n\t-c scan net C\n");
printf("\t-b scan net B\n");
printf("ex:\n");
printf(" %s -b 127.0 22 SSH-1.99-OpenSSH_3.5p1 70\n", argv[0]);
printf(" %s -c 127.0.0 22 SSH-1.99-OpenSSH_3.5p1 100\n", argv[0]);
exit (0);
}
else
{
porta = atoi (argv[3]);
strcpy(banner, argv[4]);
MAXCHILDS=atoi(argv[5]);
int i;
for(i=0;i<argc;i++) {
if(argv[i][1]=='b') {
for (c = 0; c <= 255; c++)
for (d = 0; d <= 255; d++) {
sprintf (host, "%s.%d.%d", argv[2], c, d);
child ();
}
}

if(argv[i][1]=='c') {
for (a = 0; a <= 255; a++) {
sprintf (host, "%s.%d", argv[2], a);
child ();
}
}
}
}
}


int sock3 (int porta, char host[BUFSIZ])
{
int lola;
char log[512];
char buf[1024];
struct sockaddr_in sin;

void timeout ()
{
close (sockett);
}

signal (SIGALRM, (void *) timeout);
alarm (TIME);
he = gethostbyname (host);
lola = inet_addr (host);

sockett = socket (AF_INET, SOCK_STREAM, 0);
sin.sin_family = AF_INET;
sin.sin_port = htons (porta);
bcopy (he->h_addr, (char *) &sin.sin_addr, he->h_length);

if (connect (sockett, (struct sockaddr *) &sin, sizeof (sin)) == 0) {

read(sockett, buf, sizeof(buf));
if (strstr(buf, banner)) {
printf("%s:%s\n", host, buf);
}
close (sockett);
return;
}
}


int
child ()
{

if (childs >= MAXCHILDS)
{
(void) wait (NULL);
--childs;
}

switch (fork ())
{
case 0:
sock3 (porta, host);
exit (0);
break;
case -1:
printf ("[*] Error creating childs\n");
exit (-1);
break;
default:
childs++;
break;
}

}
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
    0 Files
  • 19
    Apr 19th
    0 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 Files
  • 22
    Apr 22nd
    0 Files
  • 23
    Apr 23rd
    0 Files
  • 24
    Apr 24th
    0 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