NO IMAGE
黑客字典原始碼
作者:未知 來源:CnXHacker.Net 加入時間:2005-6-30 閱讀次數:62118
這是為了輔助破解密碼才寫的,在破解密碼的時候需要建立個密碼檔,網上有很多類似的程式,但覺的功能還不完善,就用c寫了這個,命令列下的東西,主要是不會vc,也不想做人機的介面,反正是自己用,各位看看思路就可以了,挺簡單的東西,不要以為那都是些高手才可以做到的東西,自己不去做,就是永遠的scripts boy 

/*黑客字典,可以完成生日字典,窮舉,自定義,電話,手機等密碼的設定,最多生成20位密碼, 
功能還不是很完善,有空在完善它^_^*/ 

#include <conio.h> 
#include <stdio.h> 
#include <string.h> 
#include <dos.h> 
#include <stdlib.h> 
#define R ((T=(z==1)?m:(z==2)?0:m))       /*巨集定義,引數傳遞用*/ 
#define Q ((P=(z==1)?(n 1):(z==2)?lh:n)) 
#define Max 100 
#define M 600 

void crack(void); 
void crack4(void); 
void crack2(void); 
void Txt2Dic(void); 
void help(void); 

char a[]={’0’,’1’,’2’,’3’,’4’,’5’,’6’,’7’,’8’,’9’,’0’,’A’,’B’,’C’,’D’, 
    ’E’,’F’,’G’,’H’,’I’,’G’,’K’,’L’,’M’,’N’,’O’, 
    ’P’,’Q’,’R’,’S’,’T’,’U’,’V’,’W’,’X’,’Y’,’Z’,’a’,’b’,’c’,’d’, 
    ’e’,’f’,’g’,’h’,’i’,’j’,’k’,’l’,’m’,’n’,’o’,’p’,’q’,’r’,’s’, 
    ’t’,’u’,’v’,’w’,’x’,’y’,’z’,’~’,’@’,’#’,’$’,’%’,’^’,’&’,’*’,’-’,’ ’, 
      ’<’,’>’,’{’,’}’,’[’,’]’,’(’,’)’}; 

void help(void) 

  char aa[600]={“Written by W.Z.T Don’t be lazy,Just go ahead/n/n”}; 
  int i,k; 
  long int j=10000000; 
  for(i=0;i<strlen(aa);i ) 
  { 
for(k=0;k<4;k ) 
  delay(j); 
    printf(“%c”,aa); 
  } 

void crack(void) 

  FILE *fp; 
  int T,P,z,lh,ii,jj,i,j,k,l,o,p,q,r,s,t,u,v,m,n,kk,ll,mm,oo,pp,qq,rr,ww; 
  char ch,le[100]; 
  long int lenth=0; 
  printf(“1.Brute Force/t2.Custom Range/nchoice:”); 
  scanf(“%d”,&z); 
  printf(“password lenth(3-20):”); 
  scanf(“%d”,&lh); 
  fp=fopen(“c://pass.dic”,”w “); 
  if(z==1) 
  { 
    printf(“/nInput 0-9,will be numbers/n”); 
    printf(“Input 10-35,will be letters(A-Z)/n”); 
    printf(“Input 36-61,will be letters(a-z)/n”); 
    printf(“Input 62-89,will be other letters/n”); 
    printf(“/ninput m,n:/n”); 
    scanf(“%d%d”,&m,&n); 
  } 
  if(z==2) 
  { 
    printf(“Input chars:/n”); 
    scanf(“%s”,a); 
  } 
  for(i=R;i<Q;i )     /*一個程式段,完成了兩個功能,他上面巨集定義用到了*/ 
  { 
    for(j=R;j<Q;j ) 
  { 
    for(k=R;k<Q;k ) 
    { 
    if(lh==3) 
    { 
        fprintf(fp,”%c%c%c/n”,a,a[j],a[k]); 
        continue; 
    } 
    for(l=R;l<Q;l ) 
    { 
        if(lh==4) 
        { 
        fprintf(fp,”%c%c%c%c/n”,a,a[j],a[k],a[l]); 
          continue; 
        } 
        for(o=R;o<Q;o ) 
        { 
              if(lh==5) 
        { 
          fprintf(fp,”%c%c%c%c%c/n”,a,a[j],a[k],a[l],a[o]); 
          continue; 
        } 
        for(p=R;p<Q;p ) 
        { 
        if(lh==6) 
            { 
          fprintf(fp,”%c%c%c%c%c%c/n”,a,a[j],a[k],a[l],a[o],a[p]); 
          continue; 
                } 
        for(q=R;q<Q;q ) 
        { 
              if(lh==7) 
          { 
            fprintf(fp,”%c%c%c%c%c%c%c/n”,a,a[j],a[k],a[l],a[o],a[p],a[q]); 
            continue; 
          } 
          for(r=R;r<Q;r ) 
          { 
              if(lh==8) 
              { 
              fprintf(fp,”%c%c%c%c%c%c%c%c/n”,a,a[j],a[k],a[l],a[o],a[p],a[q],a[r]); 
              continue; 
              } 
              for(s=R;s<Q;s ) 
            { 
              if(lh==9) 
              { 
                        fprintf(fp,”%c%c%c%c%c%c%c%c%c/n”,a,a[j],a[k],a[l],a[o],a[p],a[q],a[r],a[s]); 
                continue; 
              } 
                for(t=R;t<Q;t ) 
              { 
                if(lh==10) 
                { 
                  fprintf(fp,”%c%c%c%c%c%c%c%c%c%c/n”,a,a[j],a[k],a[l],a[o],a[p],a[q],a[r],a[s],a[t]); 
                  continue; 
                } 
                for(u=R;u<Q;u ) 
                { 
                  if(lh==11) 
                  { 
                  fprintf(fp,”%c%c%c%c%c%c%c%c%c%c%c/n”,a,a[j],a[k],a[l],a[o],a[p],a[q],a[r],a[s],a[t],a); 
                  continue; 
                    } 
                  for(v=R;v<Q;v ) 
                  { 
                  if(lh==12) 
                  { 
                        fprintf(fp,”%c%c%c%c%c%c%c%c%c%c%c%c%/n”,a,a[j],a[k],a[l],a[o],a[p],a[q],a[r],a[s],a[t],a,a[v]); 
                        continue; 
                  } 
                  for(kk=R;kk<Q;kk ) 
                  { 
                      if(lh==13) 
                        { 
                          fprintf(fp,”%c%c%c%c%c%c%c%c%c%c%c%c%c%/n”,a,a[j],a[k],a[l],a[o],a[p],a[q],a[r],a[s],a[t],a,a[v],a[kk]); 
                          continue; 
                                          } 
                                          for(ll=R;ll<Q;ll ) 
                        { 
                            if(lh==14) 
                            { 
                              fprintf(fp,”%c%c%c%c%c%c%c%c%c%c%c%c%c%c%/n”,a,a[j],a[k],a[l],a[o],a[p],a[q],a[r],a[s],a[t],a,a[v],a[kk],a[ll]); 
                              continue; 
                                              } 
                                              for(mm=R;mm<Q;mm ) 
                            { 
                              if(lh==15) 
                              { 
                                                    fprintf(fp,”%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%/n”,a,a[j],a[k],a[l],a[o],a[p],a[q],a[r],a[s],a[t],a,a[v],a[kk],a[ll],a[mm]); 
                                    continue; 
                                                } 
                                                for(oo=R;oo<Q;oo ) 
                              { 
                                  if(lh==16) 
                                    { 
                                                        fprintf(fp,”%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%/n”,a,a[j],a[k],a[l],a[o],a[p],a[q],a[r],a[s],a[t],a,a[v],a[kk],a[ll],a[mm],a[oo]); 
                                        continue; 
                                                    } 
                                                    for(pp=R;pp<Q;pp ) 
                                  { 
                                      if(lh==17) 
                                        { 
                                                          fprintf(fp,”%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%/n”,a,a[j],a[k],a[l],a[o],a[p],a[q],a[r],a[s],a[t],a,a[v],a[kk],a[ll],a[mm],a[oo],a[pp]); 
                                                    continue; 
                                                        } 
                                                        for(rr=R;rr<Q;rr ) 
                                      { 
                                          if(lh==18) 
                                            { 
                                                              fprintf(fp,”%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%/n”,a,a[j],a[k],a[l],a[o],a[p],a[q],a[r],a[s],a[t],a,a[v],a[kk],a[ll],a[mm],a[oo],a[pp],a[rr]); 
                                                        continue; 
                                                            } 
                                                            for(qq=R;qq<Q;qq ) 
                                          { 
                                            if(lh==19) 
                                              { 
                                                                  fprintf(fp,”%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%/n”,a,a[j], 
                                                                    a[k],a[l],a[o],a[p],a[q],a[r],a[s],a[t],a,a[v],a[kk],a[ll],a[mm],a[oo],a[pp],a[rr],a[qq]); 
                                                            continue; 
                                                              } 
                                                              for(ww=R;ww<Q;ww ) 
                                            { 
                                                if(lh==20) 
                                                  { 
                                                                    fprintf(fp,”%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%/n”,a,a[j],a[k], 
                                                                      a[l],a[o],a[p],a[q],a[r],a[s],a[t],a,a[v],a[kk],a[ll],a[mm],a[oo],a[pp],a[rr],a[qq],a[ww]); 
                                                              continue; 
                                                                  } 
                                              } 
                                            } 
                                          } 
                                          } 
                                      } 
                                    } 
                                          } 
                                      } 
                                    } 
                                } 
                            } 
                        } 
                    } 
                  } 
        } 
            } 
          } 
      } 
  } 
  } 
  rewind(fp); 
  while((ch=fgetc(fp))!=EOF) 
  { 
if(ch==’/n’) 
     lenth; 
  } 
  fclose(fp); 
  printf(“/n”); 
  puts(a); 
  printf(“Done./nThe file has %ld hang in c://pass.txt./n”,lenth); 

void crack4(void) 

  FILE *fp; 
  int p,q,j,z,w=0; 
  char ch; 
  long m,n,i,lenth=0; 
  printf(“1.mobile_num/t2.telphone_num/n”); 
  scanf(“%d”,&z); 
  fp=fopen(“c://pass1.dic”,”w “); 
  if(z==1) 
  { 
      printf(“/nmobile phone number make:/n/n”); 
      printf(“EXP:130 137 start_number end_number:/n/n”); 
      printf(“Input:/n”); 
    while(1) 
    { 
      scanf(“%d%d%ld%ld”,&p,&q,&m,&n); 
        if(p>q||m>n) 
      { 
          printf(“error,p must <= q or m <= n please input again:/n”); 
        } 
        else 
            break; 
      } 
      printf(“waiting…/n/n”); 
    for(j=p;j<=q;j ) 
      for(i=m;i<=n;i ) 
        fprintf(fp,”%d%ld/n”,j,i); 
      rewind(fp); 
      while((ch=fgetc(fp))!=EOF) 
      { 
        if(ch==’/n’) 
           lenth; 
      }  
      printf(“done.the file has %ld words in c://pass1.dic/n”,lenth); 
      fclose(fp);  
    } 
  if(z==2) 
  { 
      printf(“/ntelnel phone number make:/n/n”); 
      printf(“If the local number <=1000,don’t input 0:/n/n”); 
    printf(“EXP:813 start_number end_number:/n”); 
      printf(”   0476 8442132 8442159/n/n”); 
      printf(“Input:/n”);  
    while(1) 
    { 
        scanf(“%d%ld%ld”,&p,&m,&n); 
        if(m>=n) 
            printf(“error.start_n must <= end_n/n”); 
        else 
            break; 
      } 
      printf(“waiting…/n/n”); 
    if(p>=1000) 
    { 
        for(i=m;i<=n;i ) 
        fprintf(fp,”%d%ld/n”,p,i); 
      } 
    else 
    { 
        for(i=m;i<=n;i ) 
      fprintf(fp,”%d%d%ld/n”,w,p,i); 
    } 
    } 
    rewind(fp); 
    while((ch=fgetc(fp))!=EOF) 
    { 
  if(ch==’/n’) 
     lenth; 
    } 
    fclose(fp); 

    printf(“/nDone./nThe file has %ld hang in c://pass1.txt./n”,lenth); 

         
——————————————————————————– 
  
  

void crack2(void) 

  FILE *fp; 
  long int lenth=0; 
  int a,b,c,d,e,f,h,k,m=0; 
  char ch,ch1=’//’,ch2=’:’,ch3=’.’,ch4=’-’,ch5=’//’; 
  if((fp=fopen(“c://day.txt”,”w “))==NULL) 
  { 
  printf(“Can’t open the file./n”); 
  exit(0); 
  } 
  printf(“/nBirthday dic make:/n/n”); 
  printf(“/n<Usage:Start_years month day End_year month day [opinons]:>/n”); 
  printf(“EXP:1985 1 2 1989 1 2 1/n/n”); 
  printf(”     85 1 2 89 1 12 1/n/n”); 
  printf(”   1985 1 2 89 1 11 1/n/n”); 
  printf(“[opinos]:h=1,19850102/t h=2,1985//0//02/n”); 
  printf(”       h=3,1985:01:02/th=4,1985.01.02/n”); 
  printf(”       h=5,1985-01-02/th=6,198512/n”); 
  printf(”       h=7,1985//1//2/th=8,1985:1:2/n”); 
  printf(”       h=9,1985.1.2/t h=10,1985-1-2/n”); 
  printf(”       h=11,1985//1//2/th=12,1985//01//02/n”); 
  printf(“Input:/n”); 
  while(1) 
  { 
    scanf(“%d%d%d%d%d%d%d”,&a,&b,&c,&d,&e,&f,&h); 
    if(a>d||b<e||c>f) 
        printf(“error.check it again./n”); 
    else 
        break; 
  } 
  printf(“waiting…/n”); 
  while(a<=d) 
  { 
  switch(h) 
  { 
  case 1: 
      if(b<10&&c<10) 
        fprintf(fp,”%d%d%d%d%d/n”,a,m,b,m,c); 
        if(b>=10&&c<10) 
        fprintf(fp,”%d%d%d%d/n”,a,b,m,c); 
      if(b<10&&c>=10) 
        fprintf(fp,”%d%d%d%d/n”,a,m,b,c); 
      if(b>=10&&c>=10) 
        fprintf(fp,”%d%d%d/n”,a,b,c); 
    break; 
  case 2: 
    if(b<10&&c<10) 
  fprintf(fp,”%d%c%d%d%c%d%d/n”,a,ch1,m,b,ch1,m,c); 
    if(b>=10&&c<10) 
  fprintf(fp,”%d%c%d%c%d%d/n”,a,ch1,b,ch1,m,c); 
    if(b<10&&c>=10) 
  fprintf(fp,”%d%c%d%d%c%d/n”,a,ch1,m,b,ch1,c); 
    if(b>=10&&c>=10) 
  fprintf(fp,”%d%c%d%c%d/n”,a,ch1,b,ch1,c); 
  break; 
  case 3: 
    if(b<10&&c<10) 
  fprintf(fp,”%d%c%d%d%c%d%d/n”,a,ch2,m,b,ch2,m,c); 
    if(b>=10&&c<10) 
  fprintf(fp,”%d%c%d%c%d%d/n”,a,ch2,b,ch2,m,c); 
    if(b<10&&c>=10) 
  fprintf(fp,”%d%c%d%d%c%d/n”,a,ch2,m,b,ch2,c); 
    if(b>=10&&c>=10) 
  fprintf(fp,”%d%c%d%c%d/n”,a,ch2,b,ch2,c); 
  break; 
  case 4: 
    if(b<10&&c<10) 
  fprintf(fp,”%d%c%d%d%c%d%d/n”,a,ch3,m,b,ch3,m,c); 
    if(b>=10&&c<10) 
  fprintf(fp,”%d%c%d%c%d%d/n”,a,ch3,b,ch3,m,c); 
    if(b<10&&c>=10) 
  fprintf(fp,”%d%c%d%d%c%d/n”,a,ch3,m,b,ch3,c); 
    if(b>=10&&c>=10) 
  fprintf(fp,”%d%c%d%c%d/n”,a,ch3,b,ch3,c); 
    break; 
  case 5: 
    if(b<10&&c<10) 
  fprintf(fp,”%d%c%d%d%c%d%d/n”,a,ch4,m,b,ch4,m,c); 
    if(b>=10&&c<10) 
  fprintf(fp,”%d%c%d%c%d%d/n”,a,ch4,b,ch4,m,c); 
    if(b<10&&c>=10) 
  fprintf(fp,”%d%c%d%d%c%d/n”,a,ch4,m,b,ch4,c); 
    if(b>=10&&c>=10) 
  fprintf(fp,”%d%c%d%c%d/n”,a,ch4,b,ch4,c); 
    break; 
  case 6: 
    fprintf(fp,”%d%d%d/n”,a,b,c); 
      break; 
  case 7: 
    fprintf(fp,”%d%c%d%c%d/n”,a,ch1,b,ch1,c); 
      break; 
  case 8: 
    fprintf(fp,”%d%c%d%c%d/n”,a,ch2,b,ch2,c); 
      break; 
  case 9: 
    fprintf(fp,”%d%c%d%c%d/n”,a,ch3,b,ch3,c); 
      break; 
  case 10: 
    fprintf(fp,”%d%c%d%c%d/n”,a,ch4,b,ch4,c); 
      break; 
  case 11: 
    fprintf(fp,”%d%c%d%c%d/n”,a,ch5,b,ch5,c); 
    break; 
  case 12: 
      if(b<10&&c<10) 
  fprintf(fp,”%d%c%d%d%c%d%d/n”,a,ch5,m,b,ch5,m,c); 
    if(b>=10&&c<10) 
  fprintf(fp,”%d%c%d%c%d%d/n”,a,ch5,b,ch5,m,c); 
    if(b<10&&c>=10) 
  fprintf(fp,”%d%c%d%d%c%d/n”,a,ch5,m,b,ch5,c); 
    if(b>=10&&c>=10) 
  fprintf(fp,”%d%c%d%c%d/n”,a,ch5,b,ch5,c); 
  break; 
  } 
  c ; 
  if(a==d) 
  { 
    if(b>=e&&c>f) 
      break; 
  } 
  if(c>31) 
  { 
    b ; 
    c=1; 
    if(b>12) 
    { 
      a ; 
      b=1; 
    } 
    } 
  } 
  rewind(fp); 
  while((ch=fgetc(fp))!=EOF) 
  { 
    if(ch==’/n’) 
  lenth ; 
  } 
  fclose(fp); 
  printf(“/ndone./nThe file has %ld hang in c://day.txt/n”,lenth 1); 

void Txt2Dic(void) 

  return 0; 

main() 

  char choose; 
  clrscr(); 
  gotoxy(20,2); 
  printf(” Hacker Dictionary <Protype 1.0>”); 
  gotoxy(8,4); 
  printf(“by W.Z.T,2005.03.06 http://www.suse.edu.cn [email protected]”); 
  gotoxy(18,6); 
  printf(“1.Violence and define/n”); 
  gotoxy(18,7); 
  printf(“2.mobile or telphone/n”); 
  gotoxy(18,8); 
  printf(“3.birthday/n”); 
  gotoxy(46,6); 
  printf(“4.Txt2Dic./n”); 
  gotoxy(46,7); 
  printf(“5.help/n”); 
  gotoxy(46,8); 
  printf(“6.exit/n”); 
  while(1) 
  { 
printf(“choice:”); 
scanf(“%c”,&choose); 
switch(choose) 

  case ’1’: 
  crack(); 
  break; 
  case ’2’: 
  crack4(); 
  break; 
  case ’3’: 
  crack2(); 
  break; 
  case ’4’: 
  Txt2Dic(); 
  break; 
  case ’5’: 
  help(); 
  break; 
  case ’6’: 
  exit(0); 
  break; 
  default: 
  printf(“choice:1,2,3,4 or 5”); 
  break; 

  } 
}