Ravindra BagaleCourses & study guides

49. Cheat Sheets

49.5 Metasploit Cheat Sheet (OWN lab only)

Metasploit = attacker framework awareness so Blue can detect, patch, and least-privilege. Workflow on Metasploitable 192.168.56.20 only. No exploit PoC recipes for phones, cafe, or client prod. check where available. Defensive takeaway: patch, close ports, monitor sessions. Aata pudhe jaauya.

High-level workflow (lab English)

Step / commandMeaningBlue note
msfconsoleStart consoleOnly on Kali aimed at OWN lab VMs
search name_or_cveFind modulesMaps to “known vuln exists – patch”
use path/to/moduleSelect module—
info / show optionsRead required optionsUnderstand what RHOSTS means before set
set RHOSTS 192.​168.​56.​20Target hostsMust be OWN Metasploitable / authorised lab
set LHOST 192.​168.​56.​10Your Kali listener IPHost-only IP – not public cafe IP
set RPORT …Target port when neededMatches open service from Nmap
checkNon-exploit probe when module supports itPrefer check mindset before exploit in learning
exploit / runLaunch module (lab only)Success = prove patch / disable service afterward
sessions / sessions -i NList / interactBlue: EDR / log odd processes; kill unneeded services
background / exitBg session / leaveDocument lab evidence; then FIX target

msfvenom awareness (one line – not a phone recipe)

Idea Lab framing Blue note
msfvenom builds payloads OWN lab VMs only – never real phones, never classmates’ devices, never client laptops App allow-listing mindset; do not run mystery binaries; mail/web filters; IR playbook

Defensive takeaways after any successful lab exploit

  1. Patch / update (sudo yum update -y on Amazon Linux targets you own).
  2. Disable or uninstall the vulnerable service.
  3. Least privilege – app and OS users.
  4. Network – SG/firewalld; no needless bind-all.
  5. Monitor – auth logs, web logs, unexpected listeners (ss -tulpn).
  6. Re-verify with gentle Nmap from Kali host-only.
Red team (attacker) does Blue team (defender) detects / stops
Runs Metasploit modules against cafe / neighbour IPs Scope paper; host-only; refuses; IT Act awareness
Treats “got shell” as portfolio flex on real orgs Caption OWN Metasploitable; shows FIX + re-scan
Skips patch after lab win sudo yum update; service stop; prove closed ports
Builds payloads “for friend’s Android” Never – OWN VM only; Blue: mobile MDM / store hygiene (ch44)

Ravindra Bagale's Tip

Metasploit cheat sheet ≠ 0-day cookbook. Module names rattun interview madhe dump karu naka – sanga: “I used Metasploit only on Metasploitable in host-only, then patched / closed the service and re-scanned.” Employer ethics baghto. msfvenom phone payload = hard no. Lakshat theva.

Lab

On Kali against only 192.168.56.20: open msfconsole, search a known Metasploitable lab service you already studied in ch23, use + set RHOSTS 192.168.56.20 + set LHOST 192.168.56.10, run check if available, then if in-scope for your class lab, exploit once for learning. Immediately write FIX notes (patch/disable/firewall). Re-scan with Nmap -T2. No internet targets. No inventing new exploits.