Archive

Archive for Kwiecień 2012

VMware – Metasploit,Back Track 5 And PostgreSQL.

Kwiecień 30, 2012 Dodaj komentarz

Back Track 5 And PostgreSQL.

PostgreSQL – Create New User  „bt”


root@bt:~# sudo su postgres

sh-4.1$ createuser bt -P

could not change directory to "/root"

Enter password for new role:

Enter it again:

Shall the new role be a superuser? (y/n) n

Shall the new role be allowed to create databases? (y/n) n

Shall the new role be allowed to create more new roles? (y/n) n

sh-4.1$ exit

exit

root@bt:~#

Create Database msf3


root@bt:~# sudo su postgres

sh-4.1$ createdb --owner=bt msf3

could not change directory to "/root"

sh-4.1$ ls

ls: cannot open directory .: Permission denied

sh-4.1$ psql -l

                                List of databases

Name    |  Owner   | Encoding |  Collation  |    Ctype    |   Access privileges

———–+———-+———-+————-+————-+———————–

msf3      | bt       | UTF8     | en_US.UTF-8 | en_US.UTF-8 |

postgres  | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 |

template0 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres : postgres=CTc/postgres

template1 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres  : postgres=CTc/postgres

(4 rows)

MSFConsole

msf > db_status

[*] postgresql selected, no connection

msf > db_connect bt:password@127.0.0.1:5432/msf3

msf > db_status

[*] postgresql connected to msf3