You are on page 1of 1

//Source code in C language for detection wifi password

#include <stdio.h>
#include <stdlib.h>
char cmd[100],nimic[100],wireless[1000][1000],name[100];
int main()
{
strcat(cmd,"netsh wlan show profiles | findstr /c:\"All\" > Wireless.ini");
system(cmd);

FILE *fin;
fin=fopen("Wireless.ini","r");
if(fin==NULL)
{
printf("Fisierul Wireless.ini nu a fost gasit!");
exit(EXIT_FAILURE);
}
int nr=0,i=0;

while(!feof(fin)) //! DETECT WIRELESS NETWORKS


{
fscanf(fin,"%s : %30[^\n]\n",nimic,name);
if((strcmp(name,"")!=0)&&(strcmp(name,wireless[nr-1])!=0))
{
strcpy(wireless[nr++],name);
}
i++;
}

int j=0;
system("mkdir PassKey");
for(j=0; j<nr; j++)
{

char pass[1000][1000],filepass[100][100];
strcat(filepass[j],"PassKey/");
strcat(filepass[j],j);
strcat(filepass[j],".ini");
strcat(pass[j],"netsh wlan show profile ");
strcat(pass[j],wireless[j]);
strcat(pass[j]," key=clear | findstr /c:\"Key Content\" > ");
strcat(pass[j],filepass[j]);
printf("Wireless : %s \nFile : %s \nCDM :
%s\n",wireless[j],filepass[j],pass[j]);
int k=0;

system(pass[j]);

return 0;
}

You might also like