help with password.exe file

Pages: 12
May 4, 2011 at 2:26pm
Hi every one
i have a file called password.exe , i have to use the CMD.exe command to run it. The way that this program work is to write this command in command prompt like this "c:\>password 123456789" there should be "one space only" between the "password" and the nine digits "123456789" then click Enter to run. The result will be either "Password failed" if wrong or "Password accepted" if correct .My mission is to find the correct password through trying all the possibilities which means 999999999 times. But run the program through MS-Dos=CMD.exe is hard, and no way to write a code in "MS-dos" to solve this problem.

I have no source code just the password.exe file.
in C++ i have tried this
1- i used system("c:\password 123456789"); it is OK but i still cannot do a comparison between the results that i got!!
2- Can i write the result to a .txt file after execution the the program?
3- How can i make a while loop that try all possible passwords and once it finds the correct password present the correct password?

I uploaded the password.exe as .zip to this site, if someone want to try?
http://www.mediafire.com/?vupkfxcwhdiuk1w

can anyone help with that??

Thanks
Last edited on May 4, 2011 at 7:59pm
May 4, 2011 at 2:30pm
Why are you trying to crack the password?
May 4, 2011 at 8:04pm
It is a homework .. Nothing to worry about .. And The aim of this is to find the password only .. Once you get the pass you will get a message says "password accepted" ... That's it.
May 4, 2011 at 8:19pm
Hmm... 9 digits... Social Security Numbers use 9 digits. I actually have an algorithm for this :) but I don't think I'll be handing it over.
May 4, 2011 at 8:33pm
no way to write a code in "MS-dos" to solve this problem.

I call BS, http://ss64.com/nt/for_cmd.html.

Can i write the result to a .txt file after execution the the program?

Yes, this is called a redirect and in CMD.exe it's "> filename.txt"
May 4, 2011 at 9:09pm
closed account (zwA4jE8b)
get CFF Explorer, it has a decompiler. You might be able to get it out of there if the pw is hardcoded in.
May 5, 2011 at 12:28am
I can see some miss understanding, let me explain what I meant again
let assume I have this following code :

#include <cstdlib>
#include <iostream>

using namespace std;

int main(int argc, char *argv[])
{

int correct_pass=112233445;
int password;

start:

cout<<"Place enter the password which contain nine digits: ";
cin>> password;

if (correct_pass!=password){
cout<<"password failed" << endl;
goto start;

}else{

cout<<"password accepted" << endl;
goto end;

}
end:
system("PAUSE");
return EXIT_SUCCESS;
}

After we compile the code we will get password.exe file which you have to use CMD.exe to run it . Now if you want to solve this problem you have to try every number consist of nine digits to get the right password. My question is how to solve such problem using CMD.exe??
May 5, 2011 at 4:24am
I don't know how many of us laughed or rolled our eyes at your last reply.

Cmd.exe is known as a shell, and you wrote a console application, which needs to run in a shell of some form. This isn't a problem it how things work since we aren't running DOS anymore.

May 5, 2011 at 7:38am
I doubt this is homework, I'm surprised you're getting any help at all with this.
May 5, 2011 at 4:01pm
@ OP: If that's the program that you have to work with, then we have to start from the begginning. Your first post had me under the impression that this program took the first argument as input, but that isn't what you wrote the second time around. Which one is it? Either way this can be done but the two situations require different approaches.

Also I should mention that I'm becoming a little suspicious of this myself. No teacher would assign this project simply because of how long it would take to process. Now if you're straight with us, I might still give you an answer. But I do not appreciate being lied to, especially when so little effort is put into the lie.

EDIT: I'm going to add that the answers you get from this site are going to be infinitely more effective and much simplier to implement then the script kiddie garbage you'll find online, I just googled a few variations of your question and I can say this for certain.
Last edited on May 5, 2011 at 4:11pm
May 5, 2011 at 6:58pm
closed account (zwA4jE8b)
I must say, I am interested in the answer to this. I tried to write an algorithm that filled an array 9 ints long, starting at 000000000 up to 999999999. But I have not yet succeeded.
May 5, 2011 at 7:20pm
So you're teacher wants you to write a brute force program to steal someones password? Did I misunderstand? lol...
Last edited on May 5, 2011 at 7:20pm
May 5, 2011 at 7:34pm
@ OP: You still didn't clarify which one of your posts is correct for submitting the answer, so even if we wanted to help we wouldn't be able to.
May 5, 2011 at 9:34pm
sorry for delay .. i was so busy solving other problem which is much

harder than this ..

let my first thanks every person participate in this topic :)

1- Computergeek01 (1408)
Yes, this is called a redirect and in CMD.exe it's "> filename.txt" .

@@it's work but it needs a while of for loop to write every feedback

to a .txt file then an other loop to open that file and put a

condition to search about " password accepted" .. then it might work.

2- CreativeMFS (204) : get CFF Explorer, it has a decompiler. You

might be able to get it out of there if the pw is hardcoded in
@@ sorry mate i did not understand what you mean !!

3- Azagaros (82) : Cmd.exe is known as a shell, and you wrote a

console application, which needs to run in a shell of some form. This

isn't a problem it how things work since we aren't running DOS

anymore.

@@ for my i know that cmd.exe = MS-Dos = command prompt=consol=the

black screen>> so i thing they are all same for my.. i have no idea

if they are different .. unfortunately people think that i am smart ..

4- kbw (3129): I doubt this is homework, I'm surprised you're getting

any help at all with this.

@@ why i gave you the original file "password.exe" ?? if i'm doing

something wrong!! ask your self that. i'm clear enough
the code that i posted is what i thing is the password.exe source

code.. and as you know once you compile the code it encrypted so you

have no more access to the source !

5- Computergeek01 (1408): No teacher would assign this project simply

because of how long it would take to process.

@@ here is the original question >> You have been provided with a

password program pinNeeded.exe. You can run it in Windows
from a command prompt. Find the pin-number. The utility ptime. exe

has been provided for this
exercise. Use it. You need to describe how you found the solution and

state what the solution is. 3
Marks

The aim of this q is to to use the "Brute Force" principal and ptime.

exe will get the time of the whole process ... which my take hours.

6- CreativeMFS (204) : I must say, I am interested in the answer to this. I tried to write an algorithm that filled an array 9 ints long, starting at 000000000 up to 999999999. But I have not yet succeeded.

good luke >> if use a string variable that will work i think.

7- TheNoobie (144) : So you're teacher wants you to write a brute force program to steal someones password? Did I misunderstand? lol...
@@yes you did misunderstood ... it is a homework see above the q ..

8- Computergeek01 (1408): @ OP: You still didn't clarify which one of your posts is correct for submitting the answer, so even if we wanted to help we wouldn't be able to.

@@here i am .. :)

finaly if i get the correct answer i will add this site to my reference as faithfulness from me to this site and people how help me.


May 5, 2011 at 9:58pm
closed account (zwA4jE8b)
can the password have leading 0's i.e. 000000001? must it be 9 digits or can it be less digits.
May 5, 2011 at 10:05pm
The password is must consist from nine digits which means the first probability is 000000000 and the last will be 999999999 . So 000000001 not equal to 1.

Thnks
May 6, 2011 at 12:21am
kaa999 wrote:
The utility ptime. exe has been provided for this exercise. Use it.

What's ptime.exe?
May 6, 2011 at 12:37am
It is a little program that measure the time of execution of any program.
to use it ..
open a command prompt then write
c:\>ptime Hello.exe
c:\>ptime Hello.pdf
c:\>ptime "file name"

the out put will be something like this

ptime 1.0 for Win32, Freeware - http://www.pc-tools.net/
Copyright(C) 2002, Jem Berkes <jberkes@pc-tools.net>

=== Hello.exe ===

Execution time: 1.876 s

download from this link
1-ptime.zip
http://www.mediafire.com/?3hxohmcoe2j2ryl
2-pinNeeded.zip
http://www.mediafire.com/?ecbwllrrgpg2ja5

:)
May 6, 2011 at 1:56am
closed account (zwA4jE8b)
I think I finally got it. I will let you all know when the program terminates! Im only on 000000400
Last edited on May 6, 2011 at 1:57am
May 6, 2011 at 1:59am
good Luck
i'm waiting :)
Pages: 12