A simple brute-force simulation tool written in C for learning and testing purposes.
This program allows you to generate passwords, save them to a file, and attempt to find a target password either from the file or from randomly generated guesses.
| Option | Description |
|---|---|
| 1 | Brute force search for a password stored inside passwords.txt |
| 2 | Generate multiple 6-digit passwords in memory and brute force search for a target |
| 3 | Create 6-digit passwords and save them to passwords.txt |
| 4 | Exit the program |
- When using Option 1, you must have a file named:
passwords.txt
- It must contain one 6-digit password per line, example:
123456 654321 111111
Compile using GCC (works on Windows, Linux, Kali, etc.):
gcc brute_force_lab.c -o brute_force_lab
Run the compiled program:
./brute_force_lab (Linux / Kali) brute_force_lab.exe (Windows) π Usage Example
Welcome to brute force lab program.
1- Brute Force without creating password 2- Brute Force with creating password 3- Create passwords 4- Exit
3 How many number are you want >> 5 Created Password, Line: 1, Password: 483920 Created Password, Line: 2, Password: 192837 ... Then brute force it:
1 Enter target password >> 192837
- try X, it isn't 483920
- try X, it isn't 192837
Your password is found in 2. line and it is > 192837
β οΈ Notes Passwords are always 6 digits
Option 2 & 3 use malloc() for dynamic memory allocation
Uses srand(time(NULL)) to randomize guesses
This is NOT a real password cracker, only a lab simulation
π§ Learning Concepts Used β File handling (fopen, fscanf, fprintf) β Dynamic memory (malloc, free) β Random number generation (rand, srand) β Loops and input validation β Basic brute-force logic