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

v6scan.c

v6scan.c
Posted Jun 15, 2002
Authored by phased

V6scan is an ipv6 port scanner. Checks 14 different tcp ports which are commonly used by attackers.

tags | tcp
systems | unix
SHA-256 | f20f7d41f2f3d780f5e643237d1cde9cdee372b9796b8c4d71e3dd02efc239b0

v6scan.c

Change Mirror Download
/*
v6scan.c
by phased
phased@snosoft.com

ipv6 port scanner
06/02

"there be some deepmagic going on"

*/

#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h> /* sockaddr_in6 structure */
#include <netdb.h> /* gethostbyname2 */

#define VERSION "1.0"

int ports[] = {
21,
22,
23,
25,
79,
80,
110,
113,
139,
143,
515,
1433,
5000,
6000};

/* add more */

int main(int argc, char *argv[]) {
int delay, port, i;

printf ("v6scan version %s\n", VERSION);

if (argc < 3) {
usage(argv[0]);
}

delay = atoi(argv[2]);
printf(" scanning %s\n", argv[1]);
printf(" using %i second delay\n", delay);
printf(" checking %d ports\n", sizeof(ports)/sizeof(ports[0]));

for(i=0;i<sizeof(ports)/sizeof(ports[0]);i++) {
checkhost(argv[1], i, delay);
sleep(delay);
}
}

checkhost(char *host, int port) {
int sock;
struct sockaddr_in6 target;
struct hostent *hostname;

if (( sock = socket(AF_INET6, SOCK_STREAM, 0)) < 0 ) {
printf("error creating socket ipv6 may not be supported\n");
exit(0);
}

memset((char *)&target, 0, sizeof(target));
if ((hostname = gethostbyname2(host, AF_INET6)) == NULL) {
printf("error gethostbyname2\n");
exit(0);
}

target.sin6_port = htons(port);
target.sin6_family = AF_INET6;
memcpy((char *)&target.sin6_addr, hostname->h_addr, hostname->h_length);

if ((connect(sock,(struct sockaddr *)&target,
sizeof(struct sockaddr_in6))) < 0) {
close(sock);
return(0);
}
else {
printf (" connected to port %d\n", ports[port]);
}
close(sock);
}

int usage(char *progname) {
printf("%s <host> <delay>\n", progname);
exit(0);
}

Login or Register to add favorites

File Archive:

November 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Nov 1st
    30 Files
  • 2
    Nov 2nd
    0 Files
  • 3
    Nov 3rd
    0 Files
  • 4
    Nov 4th
    12 Files
  • 5
    Nov 5th
    44 Files
  • 6
    Nov 6th
    18 Files
  • 7
    Nov 7th
    9 Files
  • 8
    Nov 8th
    8 Files
  • 9
    Nov 9th
    3 Files
  • 10
    Nov 10th
    0 Files
  • 11
    Nov 11th
    14 Files
  • 12
    Nov 12th
    20 Files
  • 13
    Nov 13th
    63 Files
  • 14
    Nov 14th
    18 Files
  • 15
    Nov 15th
    0 Files
  • 16
    Nov 16th
    0 Files
  • 17
    Nov 17th
    0 Files
  • 18
    Nov 18th
    0 Files
  • 19
    Nov 19th
    0 Files
  • 20
    Nov 20th
    0 Files
  • 21
    Nov 21st
    0 Files
  • 22
    Nov 22nd
    0 Files
  • 23
    Nov 23rd
    0 Files
  • 24
    Nov 24th
    0 Files
  • 25
    Nov 25th
    0 Files
  • 26
    Nov 26th
    0 Files
  • 27
    Nov 27th
    0 Files
  • 28
    Nov 28th
    0 Files
  • 29
    Nov 29th
    0 Files
  • 30
    Nov 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close