Installa Metasploit Framework su Ubuntu/Debian
In questo articolo parleremo di come installare Metasploit Framework su Ubuntu/Debian. Metasploit Framework è un progetto open source che fornisce l'infrastruttura, i contenuti e gli strumenti per eseguire controlli di sicurezza e test di penetrazione approfonditi.
Le edizioni commerciali di Metasploit sono disponibili per gli utenti che preferiscono utilizzare un'interfaccia web per eseguire pentest. Il Metasploit Framework esegue i seguenti servizi.
- Server del database PostgreSQLr: utilizzato da Metasploit per archiviare dati da un progetto.
- Rubino sui binari
- Servizio Metaploit
Requisiti del framework Metasploit
Di seguito sono riportati i requisiti hardware minimi per l'esecuzione di Metasploit Framework su Ubuntu/Debian.
- Processore da 2GHz+
- 4 GB di RAM disponibili (8 GB consigliati)
- 1 GB di spazio disponibile su disco (consigliati 50 GB)
- Versione a 64 bit di Ubuntu/Debian
Installa Metasploit Framework su Ubuntu/Debian
Il modo più semplice per installare Metasploit Framework su Ubuntu/Debian è tramite il programma di installazione Metasploit. Questo programma di installazione viene fornito con tutte le dipendenze e gli strumenti necessari per eseguire Metasploit Framework.
Scarica il programma di installazione di Metasploit eseguendo i comandi seguenti nel tuo terminale.
curl https://raw.githubusercontent.com/rapid7/metasploit-omnibus/master/config/templates/metasploit-framework-wrappers/msfupdate.erb > msfinstall
Una volta scaricato lo script, renderlo eseguibile
chmod 755 msfinstall
Quindi esegui:
$ ./msfinstall
Adding metasploit-framework to your repository list..Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
OK
Updating package cache..W: http://downloads.metasploit.com/data/releases/metasploit-framework/apt/dists/lucid/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
OK
Checking for and installing update..
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
metasploit-framework
0 upgraded, 1 newly installed, 0 to remove and 8 not upgraded.
Need to get 300 MB of archives.
After this operation, 724 MB of additional disk space will be used.
Get:1 http://downloads.metasploit.com/data/releases/metasploit-framework/apt lucid/main amd64 metasploit-framework amd64 6.3.19+20230601103236~1rapid7-1 [300 MB]
Fetched 300 MB in 3s (94.8 MB/s)
Selecting previously unselected package metasploit-framework.
(Reading database ... 39082 files and directories currently installed.)
Preparing to unpack .../metasploit-framework_6.3.19+20230601103236~1rapid7-1_amd64.deb ...
Unpacking metasploit-framework (6.3.19+20230601103236~1rapid7-1) ...
Setting up metasploit-framework (6.3.19+20230601103236~1rapid7-1) ...
update-alternatives: using /opt/metasploit-framework/bin/msfbinscan to provide /usr/bin/msfbinscan (msfbinscan) in auto mode
update-alternatives: using /opt/metasploit-framework/bin/msfconsole to provide /usr/bin/msfconsole (msfconsole) in auto mode
update-alternatives: using /opt/metasploit-framework/bin/msfd to provide /usr/bin/msfd (msfd) in auto mode
update-alternatives: using /opt/metasploit-framework/bin/msfdb to provide /usr/bin/msfdb (msfdb) in auto mode
update-alternatives: using /opt/metasploit-framework/bin/msfelfscan to provide /usr/bin/msfelfscan (msfelfscan) in auto mode
update-alternatives: using /opt/metasploit-framework/bin/msfmachscan to provide /usr/bin/msfmachscan (msfmachscan) in auto mode
update-alternatives: using /opt/metasploit-framework/bin/msfpescan to provide /usr/bin/msfpescan (msfpescan) in auto mode
update-alternatives: using /opt/metasploit-framework/bin/msfrop to provide /usr/bin/msfrop (msfrop) in auto mode
update-alternatives: using /opt/metasploit-framework/bin/msfrpc to provide /usr/bin/msfrpc (msfrpc) in auto mode
update-alternatives: using /opt/metasploit-framework/bin/msfrpcd to provide /usr/bin/msfrpcd (msfrpcd) in auto mode
update-alternatives: using /opt/metasploit-framework/bin/msfupdate to provide /usr/bin/msfupdate (msfupdate) in auto mode
update-alternatives: using /opt/metasploit-framework/bin/msfvenom to provide /usr/bin/msfvenom (msfvenom) in auto mode
Run msfconsole to get started
Scanning processes...
Scanning linux images...
Crea e inizializza il database msf.
$ msfdb init
Clearing http web data service credentials in msfconsole
Running the 'init' command for the database:
Creating database at /home/devops/.msf4/db
Creating db socket file at /tmp
Starting database at /home/devops/.msf4/db...success
Creating database users
Writing client authentication configuration file /home/devops/.msf4/db/pg_hba.conf
Stopping database at /home/devops/.msf4/db
Starting database at /home/devops/.msf4/db...success
Creating initial database schema
Database initialization successful
Avvia msfconsole
Ora che il database è inizializzato, puoi avviare msfconsole
msfconsole
Output di esempio:
Metasploit Park, System Security Interface
Version 4.0.5, Alpha E
Ready...
> access security
access: PERMISSION DENIED.
> access security grid
access: PERMISSION DENIED.
> access main security grid
access: PERMISSION DENIED....and...
YOU DIDN'T SAY THE MAGIC WORD!
YOU DIDN'T SAY THE MAGIC WORD!
YOU DIDN'T SAY THE MAGIC WORD!
YOU DIDN'T SAY THE MAGIC WORD!
YOU DIDN'T SAY THE MAGIC WORD!
YOU DIDN'T SAY THE MAGIC WORD!
YOU DIDN'T SAY THE MAGIC WORD!
=[ metasploit v6.3.19-dev- ]
+ -- --=[ 2318 exploits - 1213 auxiliary - 412 post ]
+ -- --=[ 1230 payloads - 46 encoders - 11 nops ]
+ -- --=[ 9 evasion ]
Metasploit tip: Open an interactive Ruby terminal with
irb
Metasploit Documentation: https://docs.metasploit.com/
Verifica la connettività del database con il comando db_status
come mostrato di seguito.
msf > db_status
[*] postgresql connected to msf
msf >
Aggiornamento del framework Metasploit
Per aggiornare il tuo Metasploit Framework su Ubuntu/Debian. eseguire il comando:
# msfupdate
Updating package cache..OK
Checking for and installing update..
Reading package lists… Done
Building dependency tree
Reading state information… Done
metasploit-framework is already the newest version (6.3.19+20230601103236~1rapid7-1).
0 upgraded, 0 newly installed, 0 to remove and 8 not upgraded.
Puoi verificare la versione del tuo Framework utilizzando:
# msfconsole --version
Framework Version: 6.3.19-dev-
Saluti!. Ora hai Metasploit Framework installato sul sistema Ubuntu/Debian.
Libri sulla sicurezza da leggere:
- I migliori libri sulla sicurezza informatica da leggere