Metasploit connects to postgresql database
Metasploit connects to the postgresql database:
Open the postgresql service: service postgresql start
Enter the postgresql database, set the default user password, create a new user, set new user permissions, and create a database:
Shell # sudo-u postgres psql # enter the default user of postgresql
Postgres=# alter user postgres with password 'password'; # set the default user's login password (optional, must be a single quotation mark)
Postgres=# create user username with password 'password' nocreatedb; # create a new user with a password
Postgres=# create database database name with owner = 'user name'; # create the database and specify the user to which the database belongs
Postgres=#\ Q # exit psql
Enter metasploit and connect to the database:
Shell # msfconsole
Msf > db_status # View the status of msf's database
Msf > db_connect username: password @ host address\ database name # connect to psql via username and password
Msf > db_status # check the status of msf's database
4. Configured through the database.yml configuration file, at\ usr\ share\ metasploit-frameword\ config\ database.yml
* * how msf connects to psql database * * personal thoughts * *
Personal thinking:
Why does 1.msf connect to postgresql?
A: first of all, the speed of searching modules in msf after connecting to the database can be greatly improved.
Second, after connecting to the database, the traces of using msf will be saved to facilitate the export and writing of the test report.
Therefore, connecting to the psql database is not a necessary operation, but in order to improve the efficiency of the test and facilitate the writing of reports in the future, you should connect to the database and create a cache.