Pentest Handwritten Notes: Essential Tools and Commands for Ethical Hacking

2025-02-10

In the realm of cybersecurity, penetration testing (pentesting) is a critical practice for identifying vulnerabilities in systems. Below are some essential tools and commands that every ethical hacker should be familiar with, along with practical examples.

Nmap: Network Mapper

Nmap is a powerful network scanning tool used to discover hosts and services on a computer network.


<h1>Basic scan to discover live hosts</h1>

nmap -sP 192.168.1.0/24

<h1>Scan for open ports on a specific host</h1>

nmap -p 1-65535 192.168.1.1

<h1>OS detection and version detection</h1>

nmap -A 192.168.1.1

Metasploit: Exploitation Framework

Metasploit is a widely-used framework for developing and executing exploit code against a remote target.


<h1>Start Metasploit console</h1>

msfconsole

<h1>Search for exploits related to a specific service</h1>

search exploit/windows/smb/ms17_010_eternalblue

<h1>Use an exploit</h1>

use exploit/windows/smb/ms17_010_eternalblue

<h1>Set the target IP</h1>

set RHOSTS 192.168.1.2

<h1>Run the exploit</h1>

exploit

Wireshark: Network Protocol Analyzer

Wireshark is used for network troubleshooting, analysis, and protocol development.


<h1>Start Wireshark from the terminal</h1>

wireshark

<h1>Capture packets on a specific interface</h1>

wireshark -i eth0

<h1>Filter HTTP traffic</h1>

http

Burp Suite: Web Application Security Testing

Burp Suite is an integrated platform for performing security testing of web applications.


<h1>Start Burp Suite from the terminal</h1>

burpsuite

<h1>Configure your browser to use Burp Suite as a proxy</h1>

<h1>Default proxy settings: 127.0.0.1:8080</h1>

Hydra: Password Cracking Tool

Hydra is a fast and flexible password cracking tool.


<h1>Brute force SSH login</h1>

hydra -l username -P /path/to/passwords.txt ssh://192.168.1.1

<h1>Brute force HTTP POST login</h1>

hydra -l admin -P /path/to/passwords.txt 192.168.1.1 http-post-form "/login.php:user=^USER^&pass=^PASS^:Invalid credentials"

John the Ripper: Password Cracking

John the Ripper is a fast password cracker, currently available for many flavors of Unix, Windows, DOS, and OpenVMS.


<h1>Crack a password file</h1>

john /path/to/passwords.txt

<h1>Show cracked passwords</h1>

john --show /path/to/passwords.txt

Conclusion: What Undercode Say

Penetration testing is an essential aspect of cybersecurity, and mastering the tools and commands mentioned above can significantly enhance your ability to identify and mitigate vulnerabilities. Here are some additional Linux commands and resources to further your knowledge:


<h1>Check for open ports using netstat</h1>

netstat -tuln

<h1>Monitor network traffic in real-time</h1>

iftop

<h1>Analyze system logs for suspicious activity</h1>

cat /var/log/auth.log | grep "Failed password"

<h1>Secure SSH by disabling root login</h1>

sudo nano /etc/ssh/sshd_config

<h1>Change PermitRootLogin to no</h1>

PermitRootLogin no

<h1>Restart SSH service</h1>

sudo systemctl restart sshd

For more advanced techniques, consider exploring the following resources:
OWASP Penetration Testing Guide
Kali Linux Documentation
Metasploit Unleashed

By continuously practicing and staying updated with the latest tools and techniques, you can become a proficient ethical hacker, capable of securing systems against potential threats. Remember, the key to successful penetration testing lies in thorough preparation, meticulous execution, and continuous learning.

References:

Hackers Feeds, Undercode AIFeatured Image

Scroll to Top