Kali Linux Cheat Sheet for Penetration Testing

🤖 AI Prompts Cheatsheet

Daniel Osei — AI-Assisted Security Engineer

What is Kali Linux?

Kali Linux is a Debian-based operating system designed for penetration testing, security research, and digital forensics. It comes pre-installed with numerous security tools that cover a wide range of applications, from network scanning to exploitation.

Installation

Kali Linux can be installed on a variety of platforms, including as a standalone operating system or as a virtual machine. You can download it from the official website: https://www.kali.org/downloads/.

Basic Syntax

The basic structure for using tools in Kali is typically:

tool_name [options] [targets]

Discovery

Network Scanning

Discovering hosts in a network can be done using tools like Nmap.

nmap -sn 192.168.1.0/24

This command performs a ping scan to discover active hosts in the 192.168.1.0/24 subnet.

Web Application Discovery

Use Dirb to find hidden directories on a web server:

dirb http://target.com/

Scanning

Port Scanning

Identify open ports using Nmap to get more details:

nmap -sS -p- target.com

This command performs a stealth scan of all ports on the target.

Exploitation

Using Metasploit

The Metasploit Framework is an essential tool for exploitation:

msfconsole

Launches the Metasploit console. Use it to search for exploits:

search type:exploit name:target

Analysis

Analyzing Vulnerabilities

Run Nikto to scan web servers for vulnerabilities:

nikto -h http://target.com

Evasion

Bypassing Security

Using SSLStrip to intercept SSL connections:

sslstrip -l 10000

Reporting

Generating Reports

After assessments, generating a report is crucial. Use Dradis for report management:

dradis

Quick Reference Table

Flag Description
-sS Stealth SYN scan
-sn Ping scan

Pro Tips

  • Combine Nmap scans with -A for OS detection: nmap -A target.com
  • Use –script with Nmap for specific vulnerabilities: nmap --script=vuln target.com

Real-World Examples

Running a penetration test often requires multiple tools and strategies. Here’s a quick rundown:

1. Start with Nmap to gather assets.
2. Use Dirb for hidden files.
3. Identify vulnerabilities with Nikto.
4. Exploit identified vulnerabilities with Metasploit.