当前位置:首页 > 软件开发 > net
firefox

黑客字典源码

这是为了辅助破解密码才写的,在破解密码的时候需要建立个密码档,网上有很多类似的程序,但觉的功能还不完善,就用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 dont 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>qm>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,dont 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);
}
下一篇:强制删除文件
 ↓相关文章:
© 2006-2008 All Rights Reserved