hackdic 1.6.4
作者:Neil.Ton
MSN:neil_ton@msn.com
MAIL:neilton1987@gmail.com
今天天气很差啊,雨一直下,后天就要开学了,今天和班长一起去搬这个学期的书。好家伙,一共7门课程:数据结构、ASP。NET、微机原理与汇编语言程序设计、数据库SQL、英语,这几门课程我都挺喜欢的,可是我还要学邓小平理论、现代企业管理,我是在不懂这和网络安全有什么大的关系,没办法了。。。。。。
这个学期一定很忙了。。。。
昨天答应了把密码字典生成器的源码发布出来,今天趁我有空,把它贴出来吧!
一共11个文件
/****************************************
*
* FileName: hackdic.c
* Author: Neil.Ton (neilton1987@gmail.com)
*
* 黑客字典,可以完成生日字典,穷举,自定义,电话,手机
* 等密码的设置,最多生成20位密码
*
*****************************************/
#include "hackdic.h"
char pwfile[256],dayfile[256],viofile[256];
char kw[100];
int main()
{
char choose;
redcfg();
CLS;
while(1){
CLS;
printf("Hackdic version %s, Copyright (C) 2006 Neil.Ton\n",VER);
printf("Hackdic comes with ABSOLUTELY NO WA R R A N T Y; for details press 'h'\n");
printf("This is free software, and you are welcome to redistribute it under certain conditions;press 'h' for details.\n");
printf("\n Hacker Dictionary ");
printf("\n\n 1.Violence and define\n");
printf(" 2.mobile or telphone\n");
printf(" 3.birthday\n");
printf(" 4.Txt2Dic.\n");
printf(" 5.SpecialMan\n");
printf(" 6.Password Counter\n");
printf(" 7.See Dictionary\n\n");
printf(" h.help\n");
printf("\n ESC.exit\n");
printf("\n Press:");
choose=getch();
if(choose==27)
exit(0);
switch(choose){
case '1':violence();getch();break;
case '2':phonenum();getch();break;
case '3':birthday();getch();break;
case '4':txt2dic();break;
case '5':spcman();getch();break;
case '6':num();getch();break;
case '7':seedic();break;
case 'h':help();getch();break;
default:printf("\nPlease Press:1,2,3,4,5,6 or 7");getch();
}
}
return 0;
}
/*************************************************
*
*
* FileName:hackdic.h
*
*************************************************/
#include
#include
#include
#include
#define CLS system("cls")
#define PCT {printf("The dictionary will has %ld line.\n",total_line);}
#define VER "1.6.4"
void violence(void);
void phonenum(void);
void birthday(void);
void txt2dic(void);
void help(void);
void redcfg(void);
void spcman(void);
void num(void);
void seedic(void);
long mult(long,int);
extern char pwfile[256],dayfile[256],viofile[256];
extern char kw[100];
/*******************************************
*
* FileName: birthday.c
*
*
*******************************************/
#include "hackdic.h"
void birthday(void)
{
FILE *fp;
if((fp=fopen(dayfile,"a"))==NULL){
printf("Can’t open the file.\n");
exit(0);
}
int a,b,c,d,e,f;
char ch,zero_yn;
CLS;
printf("\n\n Birthday dic make:\n\n");
printf("\n\n");
printf("[opinos]:SEP(/,*,-,:,#....) Zero(y/n)\n");
printf("EXP:1985 1 2 1989 1 2 - y\n\n");
printf(" 85 1 2 89 1 12 * n\n\n");
printf(" 1985 1 2 89 1 11 0(means no space) y\n\n");
printf("Input:\n");
while(1){
scanf("%d %d %d %d %d %d %c %c",&a,&b,&c,&d,&e,&f,&ch,&zero_yn);
if(a>d)
printf("error.check it again.\n");
else break;
}
printf("waiting...\n");
while(a<=d){
if(ch=='0'){
if(zero_yn=='n') fprintf(fp,"%d%d%d\n",a,b,c);
else{
fprintf(fp,"%d",a);
if(b<10) fprintf(fp,"0%d",b);
else fprintf(fp,"%d",b);
if(c<10) fprintf(fp,"0%d\n",c);
else fprintf(fp,"%d\n",c);
}
}
else{
if(zero_yn=='n') fprintf(fp,"%d%c%d%c%d\n",a,ch,b,ch,c);
else{
fprintf(fp,"%d%c",a,ch);
if(b<10) fprintf(fp,"0%d%c",b,ch);
else fprintf(fp,"%d%c",b,ch);
if(c<10) fprintf(fp,"0%d\n",c);
else fprintf(fp,"%d\n",c);
}
}
c++;
if(a==d&&b==e&&c>f) break;
if(c>31){b++;c=1;}
if(b>12){a++;b=1;}
}
printf("\n\adone.\nThe file is %s\n",dayfile);
fclose(fp);
}
/*******************************************
*
* FileName: help.c
*
*
*******************************************/
#include "hackdic.h"
void help(void)
{
CLS;
printf(" Copyright (C) 2006 (Neil.Ton)\n");
printf(" This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.\n");
printf(" This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\n");
printf("\n\nWritten by Neil.Ton (P.R.C) \nE-Mail: neilton1987@gmail.com\nMSN: neil_ton@msn.com\n");
printf("(W.Z.T finished the base version.I am not know him,but I think he is a nice guy!he opinion is DON'T BE a scripts boy! his source code are in the 'W.Z.T' folder.)\n");
}
/*******************************************
*
* FileName: num.c
*
*
*******************************************/
#include "hackdic.h"
void num()
{
FILE *pw;
char filename[256],ch;
long count=0;
CLS;
printf("\n\nPassword Number Counter\n");
printf("\nFileName:");scanf("%s",filename);
if((pw=fopen(filename,"rt"))==NULL){
printf("Can't find the password dictionary: %s",filename);
exit(6);
}
printf("wait...\n");
while(!feof(pw)){
ch=fgetc(pw);
if(ch=='\n')
++count;
}
printf("Okey!The File:%s has %ld password.",filename,count);
}
/*******************************************
*
* FileName: phonenum.c
*
*
*******************************************/
#include "hackdic.h"
void phonenum(void)
{
FILE *fp;
fp=fopen(pwfile,"w+");
int p,q,j,w=0;
char ch,op;
long m,n,i,lenth=0;
long total_line=0,now_line=0;
float percent;
CLS;
printf("\n\n PHONE NUMBER PASSWORD DICTIONARY MAKER\n\n1.mobile_num\n2.telphone_num\n");
op=getch();
/********************MOBILE PHONE NUMBER MAKER********************/
if(op=='1'){
CLS;
printf("\nMOBILE PHONE NUMBER MAKER:\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||p<130||q>139){
printf("error,p must <= q or m <= n please and p < 130 q > 139 input again:\n");
}
else break;
}
printf("waiting...\n\n");
for(j=p;j<=q;j++){
printf("Now making %d\n",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("\ndone.the file has %ld words in %s\n",lenth,pwfile);
fclose(fp);
}
/************Phone Number password DIc Maker************/
if(op=='2')
{
CLS;
printf("\nTELNEL PHONE NUMBER MAKER:\n\n");
printf("EXP:country_num city_num start_number end_number:\n");
printf(" 86 021 68027500 68028000\n");
printf("(China)(ShangHai)(start_num)(end_num)\n\n");
printf("Input:\n");
while(1)
{
scanf("%d%d%ld%ld",&p,&q,&m,&n);
if(m>=n)
printf("error.start_n must <= end_n\n");
else break;
}
printf("waiting...\n\n");
if(p=='-'||q=='-'){
for(i=m;i<=n;i++)
fprintf(fp,"%ld\n",i);
}
else {
for(i=m;i<=n;i++)
fprintf(fp,"%d%d%ld\n",p,q,i);
}
rewind(fp);
while((ch=fgetc(fp))!=EOF)
if(ch=='\n') ++lenth;
fclose(fp);
printf("\n\aDone.\nThe file is %s.\n",pwfile);
}
}
/*****************************************
*
*
* FileName: redcfg.c
*
*
******************************************/
#include "hackdic.h"
void redcfg()
{
FILE *cfg;
if((cfg=fopen("hackdic.ini","rt"))==NULL){
printf("\nSomething wrong with the configure file:hackdic.ini!");
exit(2);
}
int i;
fscanf(cfg,"%*s %*s %s",pwfile);
fscanf(cfg,"%*s %s",dayfile);
fscanf(cfg,"%*s %s",viofile);
fscanf(cfg,"%*s %*s ");
for(i=0;i<80 && !feof(cfg);i++)
fscanf(cfg,"%c ",&kw[i]);
fclose(cfg);
}
/*******************************************
*
* FileName: seedic.c
*
*
*******************************************/
#include "hackdic.h"
#define BUF_SIZE 800
void seedic()
{
FILE *dic;
long lenth,back,str_len,count=0,total_line=0,line_num=0,word_num=0;
char file[256],str[BUF_SIZE],find[BUF_SIZE],command[256],op,ch;
int i;
float rest;
CLS;
while(1){
printf("\nDictionary File Name:");scanf("%s",file);
if((dic=fopen(file,"rt"))==NULL)
printf("Can't find the file:%s",file);
else break;
}
/********************** Interface ******************/
printf("1.Read dic file\n2.Find words in dic\n\nPress:");op=getch();
if(op=='2'){
printf("\nInput find words:");scanf("%s",find);
strcpy(command,"find /n /i \"");
strcat(command,find);
strcat(command,"\" " );
strcat(command,file);
printf("\n");
system(command);
printf("--------------- END");
getch();
}
else{
/********* Read dictionary lenth *******/
printf("Wait...Count line number of the dictionary...");
while(!feof(dic)){
ch=fgetc(dic);
if(ch=='\n')
++count;
}
rewind(dic);
while(!feof(dic)){
//CLS;
for(i=0;i str[i]=fgetc(dic);
if(str[i]=='\n'){
++line_num;
word_num=0;
++total_line;
}
else if(word_num>80){
++line_num;
word_num=0;
++total_line;
}
else ++word_num;
}
str[i]='\0';
str_len=strlen(str);
for(i=0;i printf("%c",str[i]);
printf("\nNow_line:%ld Count:%ld",total_line,count);
rest=(float)total_line/count*100;
printf("\nRead: %.2f %c '>':next page q:quit ",rest,37);
while(1){
op=getch();
if(op=='q' || op==46) break;
}
if(op=='q') break;
switch(op){
case 46:
line_num=0;
word_num=0;
break;
}
}
}
}
/*******************************************
*
* FileName: spcman.c
*
*
*******************************************/
#include "hackdic.h"
#define NUM 7
void spcman()
{
FILE *sm,*info;
char *in[NUM]={"cf_name","cs_name",
"ef_name","es_name",
"bir_year","bir_mon","bir_day"};
char file[256],y_n;
int lenth,a,b,c,d,e,f,g;
long total_line=0,now_line=0;
float percent;
CLS;
/*************** Display some settings *****************************************/
printf("\nHack Dictionary For Special Man\n");
printf("\nOutput FileName:");scanf("%s",file);
sm=fopen(file,"at");
printf("If you wanna a special dic,please modify the SPCMAN.ini\nModify the file now?(y/n): ");
y_n=getch();
if(y_n=='y'){
system("SPCMAN.ini");
}
printf("\nPassword Complex Quotiety(1~7):");scanf("%d",&lenth);
/*************** Read information of special man from SPCMAN.ini ******************/
if((info=fopen("SPCMAN.ini","rt"))==NULL){
printf("\nCan't find the configure file");
exit(6);
}
fscanf(info,"%*s %*s %s",in[0]); /*ChineseSecondName*/
fscanf(info,"%*s %s",in[1]); /*ChineseFirstName*/
fscanf(info,"%*s %s",in[2]); /*EnglishFirstName*/
fscanf(info,"%*s %s",in[3]); /*EnglishSecondName*/
fscanf(info,"%*s %s",in[4]); /*BirthYear*/
fscanf(info,"%*s %s",in[5]); /*BirthMonth*/
fscanf(info,"%*s %s",in[6]); /*BirthDay*/
/*for(a=0;a printf("\n%s",in[a]);*/
/*************** Start write to password dictionary file *************/
total_line=mult(7,lenth);
printf("The dictionary will has %ld line.\n",total_line);
printf("\nWait....");
for(a=0;a if(lenth==1){
fprintf(sm,"%s\n",in[a]);
continue;
}
for(b=0;b if(lenth==2){
fprintf(sm,"%s%s\n",in[a],in[b]);
continue;
}
for(c=0;c if(lenth==3){
fprintf(sm,"%s%s%s\n",in[a],in[b],in[c]);
continue;
}
for(d=0;d if(lenth==4){
fprintf(sm,"%s%s%s%s\n",in[a],in[b],in[c],in[d]);
continue;
}
for(e=0;e if(lenth==5){
fprintf(sm,"%s%s%s%s%s\n",in[a],in[b],in[c],in[d],in[e]);
continue;
}
for(f=0;f if(lenth==6){
fprintf(sm,"%s%s%s%s%s%s\n",in[a],in[b],in[c],in[d],in[e],in[f]);
continue;
}
for(g=0;g if(lenth==7){
fprintf(sm,"%s%s%s%s%s%s%s\n",in[a],in[b],in[c],in[d],in[e],in[f],in[g]);
continue;
}
}
}
}
}
}
}
}
printf("\n\adone.The File is %s",file);
fclose(sm);
}
/*******************************************
*
* FileName: txt2dic.c
*
*
*******************************************/
#include "hackdic.h"
void txt2dic(void)
{
printf("Sorry, this function is not ready!");
}
/*******************************************
*
* FileName: violence.c
*
*
*******************************************/
#include "hackdic.h"
void violence(void)
{
FILE *pw;
pw=fopen(pwfile,"at");
char y_n;
int lenth=0,kl=0,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;
long total_line=0,now_line=0;
float percent;
CLS;
printf("\n\nViolence Hack Password Dictionary Maker\n");
printf("\nNOTICE: If digit is big,please be chary of include character's range.Cause which dictionary file is very huge.");
printf("\nIf you wanna a special dic,please modify the hackdic.ini\nModify the file now?(y/n): ");
y_n=getch();
if(y_n=='y'){
system("hackdic.ini");
}
redcfg();
kl=strlen(kw);
printf("\nPassword lenth(4-21): ");scanf("%d",&lenth);
total_line=mult(kl,lenth);
printf("The dictionary will has %ld line.\n",total_line);
printf("Wait....\n");
for(a=0;a for(b=0;b for(c=0;c for(d=0;d if(lenth==4){
fprintf(pw,"%c%c%c%c\n",
kw[a],kw[b],kw[c],kw[d]);
continue;
}
for(e=0;e if(lenth==5){
fprintf(pw,"%c%c%c%c%c\n",
kw[a],kw[b],kw[c],kw[d],kw[e]);
continue;
}
for(f=0;f if(lenth==6){
fprintf(pw,"%c%c%c%c%c%c\n",
kw[a],kw[b],kw[c],kw[d],kw[e],
kw[f]);
continue;
}
for(g=0;g if(lenth==7){
fprintf(pw,"%c%c%c%c%c%c%c\n",
kw[a],kw[b],kw[c],kw[d],kw[e],
kw[f],kw[g]);
continue;
}
for(h=0;h if(lenth==8){
fprintf(pw,"%c%c%c%c%c%c%c%c\n",
kw[a],kw[b],kw[c],kw[d],kw[e],
kw[f],kw[g],kw[h]);
continue;
}
for(i=0;i if(lenth==9){
fprintf(pw,"%c%c%c%c%c%c%c%c%c\n",
kw[a],kw[b],kw[c],kw[d],kw[e],
kw[f],kw[g],kw[h],kw[i]);
continue;
}
for(j=0;j if(lenth==10){
fprintf(pw,"%c%c%c%c%c%c%c%c%c%c\n",
kw[a],kw[b],kw[c],kw[d],kw[e],
kw[f],kw[g],kw[h],kw[i],kw[j]);continue;
}
for(k=0;k if(lenth==11){
fprintf(pw,"%c%c%c%c%c%c%c%c%c%c%c\n",
kw[a],kw[b],kw[c],kw[d],kw[e],
kw[f],kw[g],kw[h],kw[i],kw[j],
kw[k]);continue;
}
for(l=0;l if(lenth==12){
fprintf(pw,"%c%c%c%c%c%c%c%c%c%c%c%c\n",
kw[a],kw[b],kw[c],kw[d],kw[e],
kw[f],kw[g],kw[h],kw[i],kw[j],
kw[k],kw[l]);continue;
}
for(m=0;m if(lenth==13){
fprintf(pw,"%c%c%c%c%c%c%c%c%c%c%c%c%c\n",
kw[a],kw[b],kw[c],kw[d],kw[e],
kw[f],kw[g],kw[h],kw[i],kw[j],
kw[k],kw[l],kw[m]);continue;
}
for(n=0;n if(lenth==14){
fprintf(pw,"%c%c%c%c%c%c%c%c%c%c%c%c%c%c\n",
kw[a],kw[b],kw[c],kw[d],kw[e],
kw[f],kw[g],kw[h],kw[i],kw[j],
kw[k],kw[l],kw[m],kw[n]);continue;
}
for(o=0;o if(lenth==15){
fprintf(pw,"%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c\n",
kw[a],kw[b],kw[c],kw[d],kw[e],
kw[f],kw[g],kw[h],kw[i],kw[j],
kw[k],kw[l],kw[m],kw[n],kw[o]);continue;
}
for(p=0;p if(lenth==16){
fprintf(pw,"%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c\n",
kw[a],kw[b],kw[c],kw[d],kw[e],
kw[f],kw[g],kw[h],kw[i],kw[j],
kw[k],kw[l],kw[m],kw[n],kw[o],
kw[p]);continue;
}
for(q=0;q if(lenth==17){
fprintf(pw,"%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c\n",
kw[a],kw[b],kw[c],kw[d],kw[e],
kw[f],kw[g],kw[h],kw[i],kw[j],
kw[k],kw[l],kw[m],kw[n],kw[o],
kw[p],kw[q]);continue;
}
for(r=0;r if(lenth==18){
fprintf(pw,"%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c\n",
kw[a],kw[b],kw[c],kw[d],kw[e],
kw[f],kw[g],kw[h],kw[i],kw[j],
kw[k],kw[l],kw[m],kw[n],kw[o],
kw[p],kw[q],kw[r]);continue;
}
for(s=0;s if(lenth==19){
fprintf(pw,"%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c\n",
kw[a],kw[b],kw[c],kw[d],kw[e],
kw[f],kw[g],kw[h],kw[i],kw[j],
kw[k],kw[l],kw[m],kw[n],kw[o],
kw[p],kw[q],kw[r],kw[s]);continue;
}
for(t=0;t if(lenth==20){
fprintf(pw,"%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c\n",
kw[a],kw[b],kw[c],kw[d],kw[e],
kw[f],kw[g],kw[h],kw[i],kw[j],
kw[k],kw[l],kw[m],kw[n],kw[o],
kw[p],kw[q],kw[r],kw[s],kw[t]);continue;
}
for(u=0;u if(lenth==21){
fprintf(pw,"%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c\n",
kw[a],kw[b],kw[c],kw[d],kw[e],
kw[f],kw[g],kw[h],kw[i],kw[j],
kw[k],kw[l],kw[m],kw[n],kw[o],
kw[p],kw[q],kw[r],kw[s],kw[t],
kw[u]);continue;
}
}}}}}}}}}}}}}}}}}}}}}
printf("\adone.The file is %s",pwfile);
fclose(pw);
}
/*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/
下面的字段存为hackdic.ini
[PATH] OutTxtFile= X:\dic\pass.txt BirthdayFile= X:\dic\birth.txt ViolenceFile= X:\dic\vio.txt [PARAMETER] Key_Num= a b c d e 2 4 6 * / ?
|
下面的字段存为SPCMAN.ini
[SPCMAN] ChineseSecondName= zhang ChineseFirstName= san EnglishFirstName= bill EnglishSecondName= gates BirthYear= 1967 BirthMonth= 11 BirthDay= 5
|
以上的代码编译后肯定能稳定运行,可以些3-21位的密码。还可以自定义密码中的字符,甚至我自己想出了一个特定人物密码(即spceial man 特别人物),可以生成针对某人的
密码字典。
希望各位将这个程序用在正途上,自重。。。。
Neil.Ton
PS:
自定义字符模板:
0 1 2 3 4 5 6 7 8 9 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 ~ @ # $ % ^ & * - + < > { } [ ] ( )
原文:http://www.cublog.cn/u/18158/showart_167696.html