Monitor System Resources During Cracking
In this step, you will learn how to monitor system resources while John the Ripper is performing cracking operations. Monitoring CPU usage, memory usage, and disk I/O can help you identify bottlenecks and ensure that your system is being utilized efficiently. This is crucial for optimizing performance and troubleshooting issues.
First, let's start a John the Ripper cracking process in the background. We will use a simple dictionary attack on our passwords.txt file.
john --wordlist=~/project/wordlist.txt ~/project/passwords.txt &
The & at the end sends the process to the background, allowing you to continue using the terminal. Note the process ID (PID) that is displayed, for example: [1] 12345.
Now, let's monitor the CPU and memory usage of the system using the top command. top provides a dynamic real-time view of a running system.
top
In the top output, look for the john process. You will see its CPU usage (%CPU) and memory usage (%MEM). When John the Ripper is actively cracking, you should see its %CPU value high, especially if you are using multiple cores (it might exceed 100% for multi-core processes). Press q to exit top.
Another useful command for monitoring processes is htop. If htop is not installed, you can install it:
sudo apt install -y htop
Once installed, run htop:
htop
htop provides a more user-friendly and interactive view than top, showing CPU usage per core, memory usage, and process trees. You can easily sort processes by CPU or memory usage. Look for the john process and observe its resource consumption. Press F10 or q to exit htop.
To monitor disk I/O, you can use the iotop command. This is particularly useful if your wordlists or hash files are very large, as disk access can become a bottleneck. If iotop is not installed, install it:
sudo apt install -y iotop
Then run iotop:
sudo iotop
iotop shows real-time disk I/O activity. Look for john or related processes to see if they are heavily reading from or writing to disk. Press q to exit iotop.
Finally, let's bring the background john process back to the foreground and stop it, or simply kill it if it's still running.
fg
## Press Ctrl+C to stop the process
If fg doesn't work or you want to kill it by PID:
killall john
By regularly monitoring system resources, you can identify if John the Ripper is fully utilizing your hardware or if there are other processes consuming resources that could be allocated to cracking. This helps in fine-tuning your cracking setup for optimal performance.