This is a ipv6 banner grabber by c1zc0 Security
e85388d2e1be213c5e3ff508b15076266d49cb3ff37175580006ed793cf2433e
/*
* c1zc0-cb4n6.c - ipv6 banner grabber
* by rotor 2005 || http://c1zc0.com
* irc.efnet.org #c1zc0
*/
kirra_lee@msn.com
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
void usage(char *nme);
int main(int argc, char *argv[])
{
int sock;
struct sockaddr_in6 target;
struct hostent *hostname;
char buff[1024];
if (argc < 3) {
usage(argv[0]);
}
printf("%s %s\n", argv[1], argv[2]);
if (( sock = socket(AF_INET6, SOCK_STREAM, 0)) < 0 ) {
printf("error creating socket\n");
exit(0);
}
memset((char *)&target, 0, sizeof(target));
if ((hostname = gethostbyname2(argv[1], AF_INET6)) == NULL) {
printf("error gethostbyname2\n");
exit(0);
}
target.sin6_port = htons(argv[2]);
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);
exit(1);
}
else {
read(sock,&buff,910);
printf("cb4n6 by rotor - http://www.c1zc0.com\n");
printf("%s",buff);
return(0);
}
}
void usage(char *nme) {
printf("%s By r0t0r - http://www.c1zc0.com\n", nme);
printf("%s <host> <port>\n", nme);
exit(0);
}