-5

My friend wanted to learn how to hack , so he asked me to create an application that generates random passwords and convert it into a hash. Our problem is : How do we brute force a console input screen?

Any help is greatly appreciated Thank you

  • You want to generate random passwords, and "brute force" your way into finding them? – Saurabh Shirodkar May 04 '17 at 02:31
  • What do you mean by "How do we brute force a console input screen?". Please provide more detail. – Code-Apprentice May 04 '17 at 02:42
  • @SaurabhShirodkar, I think what the OP wants to do is to generate a bunch of passwords, then programmatically attempt to use those passwords to gain access as superuser or something. So some command like `su - admin`, then programmatically send the generated passwords to that command to see which one allows you access as `admin` – smac89 May 04 '17 at 02:44
  • Possible duplicate of [How to provide password to a command that prompts for one in bash?](http://stackoverflow.com/questions/4857702/how-to-provide-password-to-a-command-that-prompts-for-one-in-bash) – smac89 May 04 '17 at 02:46

2 Answers2

0

The default goto when automating user interaction is Expect, but it's TCL based.

You can call expect scripts from C/C++ via libexpect. It also allows to (sometimes) skip using TCL and make direct calls to expect, but that might make the final code less readable.

xvan
  • 4,554
  • 1
  • 22
  • 37
0

You should figure out your end goal. If it's to 'crack' a pre-known password that's of a small finite length, and restricted character-set, then brute force works. But, in real world situation passwords, of lengths now a-days 10 characters, it will take a lifetime to brute-force the password. Doing enough combinations up to 10 characters, and including the entire type-able characterset, is simply too many computations.

But, as for coming up with a password and hashing it, there's free libraries you can google for, for that. Just figure out the hash type you need first, as there are lots of types.

To brute force, you need a characterset, a cut-off length, and a lot of computing power.

Hope this helps a little. You probably are going to refine your end goal I'm guessing.