Dollars BBS | Technology

feed-icon

Main

News

Animation

Art

Comics

Films

Food

Games

Literature

Music

Personal

Sports

Technology

Random

Help with coding (10)

1 Name: Sandman the endless : 2015-10-29 10:04 ID:5zex3DoZ [Del]

I am trying to crack a password and I know that it is #####wolves. How would I change my brute force code to work knowing the last 6 letters. This is very similar to the code I use - http://pastebin.com/ZT373674/

2 Name: Hiroki : 2015-10-29 13:10 ID:2TER2+K8 [Del]

Password for what ?

3 Name: Sandman the Endless : 2015-10-29 22:35 ID:5zex3DoZ [Del]

My school gmail account.

4 Name: Hiroki : 2015-10-30 04:36 ID:vP48JZtp [Del]

And can't you reset it with forgotten passwords ? (or email the NSA to have a back up ^^)

I'll think about it.
Which groups of characters do you have in your password ?

5 Name: Sandman the Endless : 2015-10-30 06:34 ID:0UKw99+C [Del]

only numbers and lower case letters (I know the letters though). it is 5 numbers and then "wolves", for that is our mascot. And I can't reset it because our administration is in over there head and failing at everything.

6 Name: Hiroki : 2015-10-30 14:22 ID:vP48JZtp [Del]

Only numbers is an important information : that makes 10 000 possibilities instead of 492 359 665 568 (218^5).

7 Name: Hiroki : 2015-10-30 19:31 ID:vP48JZtp [Del]

C code to check (Idk why but I can't compile them on my PC)

And I hope that Google doesn't limit the number of tries by span of time :/

And we still have to implement an API to test the password.

But the best way to fix your problem will be to tell your administration that it's not a game and you NEED a quick reset.


#include
#include
#include
#include

#define LEN 5
#define LENlessONE 4
#define CONSTANTPART "wolves"
#define LENofCONSTANTPART 6

typedef enum flag {negative,positive};
typedef enum status {wrong,networkError,invalidInput,sucessful};

status envoie(char[] essaie)
{
//please make a printf if error
}


flag makeChain(char[] chain,long int progression)
{
int i;
flag validity=positive;//I'd like the function to tell the main programm not to test strings with 3 adjacent identical numbers


// Convertion of the progression to the chain:
for(i=0;i<LEN;i++)
{
chain[i]=(progression/pow(10,LEN-i))&10;//division to "allign" the number, then modulo 10 to delete the left numbers
}

chain[LEN]='\0'; //to check

//Checking the validity of the chain:
i=2;
do
{
if((chain[i]==chain[i-1])&&(chain[i-2]==chain[i-1])) validity=negative;
i++;
}
while((validity=positive)&&(i<LENlessONE));

return validity;

}

int main()
{
char password[LEN+1+LENofCONSTANTPART];
long int i=0;
status testResult=wrong;
flag tosend;
long int plage;

//initialisation
plage=pow(10,LEN);//Required to know how long the test should last

//searching for the password
do
{
tosend=makeChain(password,i);//the makeChain() function generates the first part with the numbers only

if (tosend=positive)
{
strcat(password;CONSTANTPART);//iff the number is valid, "wolves" is appended at the end of the chain
testResult=envoie(password)
}

i++;
}
while((testResult=wrong)&&(i<plage));


//conclusion
if(password==sucessful) printf("The password was %c",password);
else printf("error at try %li",i-1);

return 0;

8 Name: Hiroki : 2015-10-30 19:33 ID:vP48JZtp [Del]

Uh Uh, sorry but the last } and the alignments were lost during the copy-past.

9 Name: Sandman the Endless : 2015-10-30 21:09 ID:MnHTkUGd [Del]

Thanks for your help! It is fixed!

10 Name: Hiroki : 2015-10-31 06:32 ID:vP48JZtp [Del]

Oh, great !

T.T But there're so many errors in this simple code.