Includes 2 Basic Program :-
Here is Sample Code of CPP Program, that will need Password :-
Codes are messed up because of blogger. So Get a Code from here - https://github.com/krokite/basicBruteforce
Compile above program with g++
and now run program to understand what it will do,
So, Run with Arguments, and it takes password with '-p' arguments :-
Giving Wrong Password as "blackbuntu"
Now Running with Correct Password :-
But, Now what if you don't know the password of program, and you need to open it, how would you do that, here is basic python code that will help you do that :-
Save below file with name "bruteforce.py"
Now make another file which has list of password, Write 1 password in 1 line.
password.txt file :-
And now Run your python program :-
Note: Please Remember this is just basic idea and does not account exactly to your program, you might have to do more homework for your application with above bruteforce.py tool. With Few Changes above bruteforce.py tool may work with mysql [not tested]
bruteforce.py file reads 1 password at a time and than run your program with fetched password and checks the success of password, if it does, than it simply prints password and exit, so the very last line will be your password if it has successfully cracked it.
Also , all above Code is completely written by me, if you share it or modify it further, do include my credit. Thanks
Got Question ? Ask them below, and i believe this simple demo will clear doubts.
- Basic "C++" program.
- BruteForce Script in Python.
Here is Sample Code of CPP Program, that will need Password :-
Codes are messed up because of blogger. So Get a Code from here - https://github.com/krokite/basicBruteforce
PHP Code:
/*
Author: KroKite
Description: Basic Bruteforcing Tools
URI: http://www.fb.me/r0ckysharma
*/
#include
#include
#include
using namespace std;// When passing char arrays as parameters they must be pointersint main(int argc, char** argv) {
if (argc < 4) { // Check the value of argc. If not enough parameters than, inform user and exit.
cout << "Usage is -f input_filename -p password\n";
exit(0);
} else { // if we got enough parameters..
int i=1;
while(i<=argc) {
if (strcmp(argv[i],"-f") == 0) {
cout << "File to Open: " << argv[i + 1] << endl;
}
if (strcmp(argv[i],"-p") == 0) {
cout <<"Password is : " << argv[i + 1] << endl;
if(strcmp(argv[i+1], "KroKite") == 0) {
cout << "File Opening SuccessFul"<< endl;
} else {
cout << "Wrong Password"<< endl;
}
}
i++;
}
}
return 0;
}
Code:
root@blackbuntu# g++ blackbuntu.cpp -o blackbuntu
Code:
root@blackbuntu# ./blackbuntu
Usage is -f input_filename -p password
Giving Wrong Password as "blackbuntu"
Code:
root@blackbuntu# ./blackbuntu -f blackbuntu.txt -p blackbuntu
File to Open: blackbuntu.txt
Password is : blackbuntu
Wrong Password
Code:
root@blackbuntu# ./blackbuntu -f blackbuntu.txt -p KroKite
File to Open: blackbuntu.txt
Password is : KroKite
File Opening SuccessFul
Save below file with name "bruteforce.py"
PHP Code:
#!/usr/bin/python
# Author : KroKite
# Description: Basic Password Bruteforcing Tool
# URL: http://www.fb.me/r0ckysharma
# Python Version 2.7import subprocess
import re
fo = open("password.txt", 'r');
for lines in fo:
password = lines.split('\n')
brute = subprocess.Popen(["./blackbuntu", "-f", "foo.txt", "-p", password[0]], stdout=subprocess.PIPE)
if(re.search("Success", brute.communicate()[0])):
print "Password Cracked and your Password is ", password[0]
exit()
else:
print password[0], " is not Password"
password.txt file :-
Code:
abcdef
123456
hacker
bullshit
wtf
blackbuntu
facebook
twitter
metallica
KroKite
shit
password
pass
Code:
root@blackbuntu# python bruteforce.py
abcdef is not Password
123456 is not Password
hacker is not Password
bullshit is not Password
wtf is not Password
blackbuntu is not Password
facebook is not Password
twitter is not Password
metallica is not Password
Password Cracked and your Password is KroKite
bruteforce.py file reads 1 password at a time and than run your program with fetched password and checks the success of password, if it does, than it simply prints password and exit, so the very last line will be your password if it has successfully cracked it.
Also , all above Code is completely written by me, if you share it or modify it further, do include my credit. Thanks
Got Question ? Ask them below, and i believe this simple demo will clear doubts.