Kali Linux Series tutorial Metasploit connecting PostgreSQL

Source: Internet
Author: User
Tags postgresql kali linux

Objective

Because of the different versions of Kali Linux, the configuration of Metasploit and PostgreSQL is not the same by default, which causes us to connect to the PostgreSQL database when we start the Metasploit. Below are three kinds of situations, simple to describe to you, as well as the solution to the problem.

Ideal State

Ideally, only two steps are required.

    1. Start PostgreSQL

Service PostgreSQL Start

    1. Start Mestasploit

Service Metasploit Start

In Metasploit, enter Db_status to view the database connection status as connected.

Manual connection

When you start Metasploit, you will need to connect manually when you find that the PostgreSQL database is not automatically connected.

The connected command is the Db_connect user name: password @ip/the database name. The actual situation may be:

Msf>db_connect Msf3:[email PROTECTED]/MSF3

So where to find the user name and password?

Open this file:/opt/metasploit/apps/pro/ui/config/database.yml.

The contents of the file may be as follows:

Development:
Adapter:postgresql
Database: "MSF3"
Username: "MSF3"
Password: "Zfhyomttrt4p8zf868kuyhmkvqqkvje"
Host:localhost
port:5432
Pool:5
Timeout:5

In the configuration file of the example above we can see the database name, user name and password, and replace these options with the Db_connect command above.

Start from scratch

If your luck is really poor, and found that even database.yml files can not find, do not lose heart, God wants you to learn something more.

First open the terminal, make sure the PostgreSQL service is started, and then switch the current account to the Postgre account.

Su Postgres

The second step is to create a PostgreSQL database account by entering the following command.

Create User Msf3–p

The MSF3 in the command is the user to create, and of course you can enter any other user name.

Next, the terminal will prompt you to enter the password, and then confirm the password, here I set the password for "MSF".

Then ask you for the account permissions, enter Y or n is irrelevant.

The third step is to create the database.

Createdb--OWNER=MSF3 MSF3

The owner parameter specifies the name of the database, this is MSF3, and the last parameter is the database, which is also set to MSF3.

Fourth, enter exit to exit the current user and return to the root context. To return to the manual connection step

[Email protected]: msfconsole

MSF > Db_connect msf3:[email protected]/msf3

Congratulations, you've succeeded. If there are other problems, welcome to find me in the QQ group, common exchange.

PS: Readers interested in this article, can add QQ Group: hacking:303242737 (full); Hacking-2 Group: 147098303;hacking-3 Group: 31371755;hacking-4 Group: 201891680; HACKING-5 Group: 316885176


Xuan Soul
Source: http://www.cnblogs.com/xuanhun/
Original link: http://www.cnblogs.com/xuanhun/more content, please visit my personal site on programming, security interests, add QQ Group: HACKING-1 Group: 303242737,hacking-2 Group: 147098303, Nw.js,electron AC group 313717550.
This article is copyright to the author and the blog Park, Welcome to reprint, but without the consent of the author must retain this paragraph, and in the article page obvious location to the original link, otherwise reserves the right to pursue legal responsibility.

Kali Linux Series tutorial Metasploit connecting PostgreSQL

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.