Metasploit automatically connect PostgreSQL

Source: Internet
Author: User

1. Start PostgreSQL
[email protected]:~# service PostgreSQL start
2. Setting up Users and databases
[Email protected]:~# su Postgres[email protected]:/root$ createuser msf4- for new Role:enter it Again:[email Protected]:/root$ createdb--owner=msf4 MSF4
[Email protected]:/root$ exit
Exit
3. Test Database Connection Status
[Email protected]:~ #> Db_connect msf4:[email protected]/msf4[in > db_status[*   -0531[!
4. Set up automatic connection

Automatic connection can be done through configuration file /usr/share/metasploit-framework/config/database.yml , Content can be set by copying database.yml.example and modifying content.

[Email protected]:/usr/share/metasploit-framework/config# CPdatabase.yml.example database.yml[email protected]: /usr/share/metasploit-framework/config# VIdatabase.yml[email protected]: /usr/share/metasploit-framework/config# Catdatabase.yml# bound to a TCP port.# only PostgreSQL is supportable formetasploit-framework# these days. (No SQLite, no MySQL). # To set up a Metasploit database, follow the directions hosted at:# http://R-7.co/msf-dev#set-up-postgresqlDevelopment: &pgsql adapter:postgresql Database: msf3 #主要该红色的这三个值 username:  msf3 Password: jinch Angkun host:localhost Port:5432Pool:5Timeout:5# You'll often want to seperate your databases between dev# mode and prod mode. Absent a production db, though, defaulting# to Dev is pretty sensible forMany developer-users.production:&Production<<: *pgsql# warning:the database defined as"Test"'ll be erased and# re-generated from your development database when you run"Rake". # do not set this db to the same as development or production.## Note Also, sqlite3 are totally unsupported by METASPL OIT now.test:<<: *pgsql database:metasploit_framework_test username:metasploit_framework_test Password: ________________________ ___

The database can be linked directly by re-executing msfconsole

[Email protected]:~ # msfconsole### # # #msf>db_status[*] PostgreSQL connected to MSF4MSF> Search cve- --0311Matching Modules================Name Disclosure Date Rank Description----                                                   ---------------  ----   -----------Exploit/multi/browser/adobe_flash_uncompress_zlib_uaf the-Geneva- -great Adobe Flash Player ByteArray uncompressviazlibvariant use after FREEMSF>
5.. .

Previously encountered the DATABASE.YML content is invalid version, is through the user's home directory to create the configuration file completed, etc. encountered a similar supplement.

Metasploit automatically connect 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.