Get the App
SLTechnology News&Howtos  ›  Database  › 

Kali rolling's metasploit opens a database connection!

Shulou Source: shulou.com Published: 2022-06-01 13:35:18 10月29日 Update

The latest version of kali rolling has been released, using the debian kernel, with timely updates! But its built-in metasploit uses the metasploit-framework version! It's not the same as before. "bt5,kali linux" his latest service, no metasploit service! So service metasploit start is useless! And the service that starts postgresql also becomes "service postgresql start"! And will not automatically connect to the database! To do it manually, I'll write down the method here:

1. It is time to open the latest version of kali rolling:

Open the terminal: write "sevicer postgresql start" and kali will start the service

Next enter: "netstat-ntpl" query postgresql port is generally "5432"

2, enter "msfconsole" in the new port and wait for metasploit to start!

After startup:

Enter: help to see common commands!

Enter:

Msf > db_status

[*] postgresql selected, no connection

Description, no database connection! To do this, we are going to create a database!

Open a new terminal:

Then create a new database in "postgres"! We can first "\ l" check the database we have! "\ du" is to view users!

Enter:

Postgres=# create user "msf" with password '123456' nocreatedb

CREATE ROLE indicates that we have successfully created a user "msf" password "123456"

Next: create the database:

Postgres=# create database "msf2" with owner= "msf"

CREATE DATABASE, we created a database called "msf2". The user group is "msf".

And then back to metaspgresql.

Make a connection:

Sf > db_connect msf:123456@127.0.0.1/msf2

[*] Rebuilding the module cache in the background...

Before entering:

Msf > db_status

[*] postgresql connected to msf2

It means it's connected!

Let's test it:

Use db_nmap followed by the ip or domain name you want to test! The data will be released by nmap soon, so there will be no demonstration here!

Then use hosts, take a look!

Msf > hosts

Hosts

=

Address mac name os_name os_flavor os_sp purpose info comments

-

*. * Unknown device

Can also be used: services is not shown here!

Then we are disconnected in reconnection, and the data still shows that there is nothing wrong with our database!

If we want to delete the database! Disconnect the database first!

Sf > db_disconnect

Then go back to the database: do the following!

Postgres=# DROP DATABASE

Postgres-# msf2

The DROP DATABASE description has been deleted and can be viewed with "\ l"

Delete user name:

Postgres=# DROP ROLE msf

DROP ROLE can be viewed with "\ du"

Exit database "\ Q"

At the end of this article, "long Nuo production" newcomers, please understand more!

There are kali rolling installation files and database preservation files have been changed to: usr/share/metasploint/config/database.yml, pure memory hand!

Tags: Data database input user service file latest version port terminal test success for this kernel follow command domain name password commonly used manual newcomer Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info Xiaomi Apple Docker MySQL