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?
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.
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??
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.
@ 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.
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.
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.
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.
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"