Ricerca nel sito web

Installa Metasploit Framework su CentOS 8/CentOS 7


In questo articolo discuteremo come installare Metasploit Framework sulla distribuzione Linux CentOS 8/CentOS 7. Se sei nuovo nel mondo dei test di penetrazione, Metasploit Framework è uno strumento creato da Rapid7 per i test di penetrazione e la scoperta di vulnerabilità della sicurezza negli ambienti e nelle risorse IT. Fornisce l'infrastruttura, i contenuti e gli strumenti per eseguire controlli approfonditi di sicurezza e test di penetrazione.

Requisiti del framework Metasploit

Questi sono i requisiti hardware minimi per eseguire Metasploit Framework su qualsiasi macchina Linux.

  • CPU: processore da 2 GHz+
  • RAM – 4 GB di RAM disponibili (8 GB consigliati)
  • Spazio su disco: 1 GB di spazio disponibile su disco (50 GB consigliati)

Di seguito sono riportati i servizi principali di Metasploit Framework.

  • Server del database PostgreSQLr: utilizzato da Metasploit per archiviare dati da un progetto.
  • Rubino sui binari
  • Servizio Metaploit

Installa Metasploit Framework su CentOS 8/CentOS 7

Seguire i passaggi seguenti per installare Metasploit Framework sulla distribuzione Linux CentOS 8/CentOS 7.

Scarica il programma di installazione di Metasploit utilizzando il comando wget o curl.

curl https://raw.githubusercontent.com/rapid7/metasploit-omnibus/master/config/templates/metasploit-framework-wrappers/msfupdate.erb > msfinstall

Fornire i bit di esecuzione dello script di installazione.

chmod +x msfinstall

Quindi esegui il programma di installazione per installare Metasploit Framework su CentOS 8/CentOS 7.

$ ./msfinstall

Output di installazione di esempio:

$ ./msfinstall
Switching to root user to update the package
Checking for and installing update..
Adding metasploit-framework to your repository list..Metasploit                                                   [===                                  Metasploit                                                                                                              153 kB/s | 246 kB     00:01    
Dependencies resolved.
========================================================================================================================================================
 Package                               Arch                    Version                                                Repository                   Size
========================================================================================================================================================
Installing:
 metasploit-framework                  x86_64                  5.0.77+20200224112600~1rapid7-1.el6                    metasploit                  206 M

Transaction Summary
========================================================================================================================================================
Install  1 Package

Total download size: 206 M
Installed size: 462 M
Downloading Packages:

Lo script di installazione aggiungerà il repository Metasploit Framework all'elenco dei repository e installerà tutti gli strumenti richiesti. Se la tua connessione Internet è lenta, il download potrebbe richiedere del tempo.

Esegui il comando per iniziare la configurazione iniziale.

$ msfdb init 

 ** Welcome to Metasploit Framework Initial Setup **
    Please answer a few questions to get started.


Would you like to use and setup a new database (recommended)? yes
Creating database at /home/cloud-user/.msf4/db
Starting database at /home/cloud-user/.msf4/db...success
Creating database users
Writing client authentication configuration file /home/cloud-user/.msf4/db/pg_hba.conf
Stopping database at /home/cloud-user/.msf4/db
Starting database at /home/cloud-user/.msf4/db...success
Creating initial database schema
[?] Initial MSF web service account username? [cloud-user]: admin
[?] Initial MSF web service account password? (Leave blank for random password): 
Generating SSL key and certificate for MSF web service
Attempting to start MSF web service...success
MSF web service started and online
Creating MSF web service user admin
....

Archiviare le credenziali del servizio Web MSF mostrate nell'output di configurazione:

Creating MSF web service user admin

    ############################################################
    ##              MSF Web Service Credentials               ##
    ##                                                        ##
    ##        Please store these credentials securely.        ##
    ##    You will need them to connect to the webservice.    ##
    ############################################################

MSF web service username: admin
MSF web service password: password
MSF web service user API token: eee4cda702f0bdc0625c828cf56817dfd07a13c23e55000230f23fe33340ab0ef9e28f483e11312f


MSF web service configuration complete
The web service has been configured as your default data service in msfconsole with the name "local-https-data-service"

If needed, manually reconnect to the data service in msfconsole using the command:
db_connect --token eee4cda702f0bdc0625c828cf56817dfd07a13c23e55000230f23fe33340ab0ef9e28f483e11312f --cert /home/cloud-user/.msf4/msf-ws-cert.pem --skip-verify https://localhost:5443

The username and password are credentials for the API account:
https://localhost:5443/api/v1/auth/account


 ** Metasploit Framework Initial Setup Complete **

L'installazione di Metasploit Framework dovrebbe essere completata:

Controlla la versione del tuo Framework utilizzando:

$ msfconsole --version
Framework Version: 5.0.77-dev-

Avvio di msfconsole

Ora che il database è inizializzato, puoi avviare msfconsole

$ msfconsole
                                                  

MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMM                MMMMMMMMMM
MMMN$                           vMMMM
MMMNl  MMMMM             MMMMM  JMMMM
MMMNl  MMMMMMMN       NMMMMMMM  JMMMM
MMMNl  MMMMMMMMMNmmmNMMMMMMMMM  JMMMM
MMMNI  MMMMMMMMMMMMMMMMMMMMMMM  jMMMM
MMMNI  MMMMMMMMMMMMMMMMMMMMMMM  jMMMM
MMMNI  MMMMM   MMMMMMM   MMMMM  jMMMM
MMMNI  MMMMM   MMMMMMM   MMMMM  jMMMM
MMMNI  MMMNM   MMMMMMM   MMMMM  jMMMM
MMMNI  WMMMM   MMMMMMM   MMMM#  JMMMM
MMMMR  ?MMNM             MMMMM .dMMMM
MMMMNm `?MMM             MMMM` dMMMMM
MMMMMMN  ?MM             MM?  NMMMMMN
MMMMMMMMNe                 JMMMMMNMMM
MMMMMMMMMMNm,            eMMMMMNMMNMM
MMMMNNMNMMMMMNx        MMMMMMNMMNMMNM
MMMMMMMMNMMNMMMMm+..+MMNMMNMNMMNMMNMM
        https://metasploit.com


       =[ metasploit v5.0.77-dev-                         ]
+ -- --=[ 1973 exploits - 1087 auxiliary - 339 post       ]
+ -- --=[ 559 payloads - 45 encoders - 10 nops            ]
+ -- --=[ 7 evasion                                       ]

msf5 > 

Verifica la connettività del database con il comando db_status come mostrato di seguito.

$ db_status
[*] Connected to remote_data_service: (https://localhost:5443). Connection type: http. Connection name: local-https-data-service.

Aggiornamento del framework Metasploit

Per aggiornare il tuo Metasploit Framework su Debian 10/Debian 9. esegui il comando:

$ msfupdate
Switching to root user to update the package
Checking for and installing update..
Adding metasploit-framework to your repository list..Metasploit                                                   [===                                  Metasploit                                                                                                              3.0 kB/s | 3.0 kB     00:01    
Package metasploit-framework-5.0.77+20200224112600~1rapid7-1.el6.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!

Divertiti a utilizzare Metasploit Framework per le tue operazioni di test di penetrazione. Per ulteriori contenuti correlati, controlla:

Come installare Metasploit Framework su Debian

Avvia Metasploit Framework su Kali Linux

Installa e usa Linux Malware Detect su CentOS/Fedora/Ubuntu/Debian

Come installare Nessus Scanner su Ubuntu/Debian

Articoli correlati: