root@kali:~# /etc/init.d/mysql status [info] MySQL is stopped..
然后启动MySQL的server/daemon process
1
root@kali:~# mysqld_safe –skip-grant-tables &
使用root用户连接MySQL
1 2 3 4 5 6 7 8 9 10
root@kali:~# mysql -u root Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 Server version: 5.5.44–0+deb7u1 (Debian) Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement. mysql>
更改root用户的密码为admin
1 2 3 4 5 6 7
mysql> use mysql Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed mysql> update user set password=PASSWORD(‘admin’) where User=‘root’; Query OK, 4 rows affected (0.01 sec) Rows matched: 4 Changed: 4 Warnings: 0
root@kali:~# /etc/init.d/mysql restart [ ok ] Stopping MySQL database server: mysqld. [….] Starting MySQL database server: mysqld151015 11:41:36 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended [ .k [info] Checking for tables which need an upgrade, are corrupt or were not closed cleanly.. [1]+ 完成 mysqld_safe –skip-grant-tables
使用root用户连接MySQL
1 2 3 4 5 6 7 8 9 10 11
root@kali:~# mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 43 Server version: 5.5.44–0+deb7u1 (Debian) Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement. mysql>
metasploit Database not connect问题解决
1、postgresql是本身没有启动的。所以需要启动。
1
service postgresql start
2、通过命令进入配置
1 2
sudo -u postgres psql ALTER USER postgres WITH PASSWORD ‘123.com’;
root@kali:~# vi /etc/postgresql/9.4/main/postgresql.conf 更改#listen_addresses = ‘localhost’为 listen_addresses = ‘*’ 更改#password_encryption = on为password_encryption = on root@kali:~# vi /etc/postgresql/9.4/main/pg_hba.conf 在文档末尾加上以下内容 # to allow your client visiting postgresql server host all all 0.0.0.0 0.0.0.0 md5 root@kali:~# service postgresql restart
postgres=# create user “msf123” with password ‘123456’ nocreatedb; CREATE ROLE postgres=# create database “msf1” with owner=”msf123”; ERROR: role “”msf123”” does not exist postgres=# create database “msf1″ with owner=”msf123”; CREATE DATABASE postgres=# \q
root@kali:~# msfconsole msf > db_status [*] postgresql selected, no connection msf > db_connect msf123:123456@127.0.0.1/msf1 [*] Rebuilding the module cache in the background… msf > db_status [*] postgresql connected to msf1 msf >
在msf启动后连接数据库就好。 注意1:“msf123:123456”这个是步骤5中的 “create user “msf123” with password ‘123456’ nocreatedb;”所建立的。 “127.0.0.1”是指本机。 “msf1”这个是库名。 注意2:“[*] postgresql connected to msf1”这个是说明以链接成功数据库。
kali linux apt-get 证书校验错误
错误信息
1 2 3 4 5 6 7 8 9
root@teamserver:~# apt-get update Get:1 http://mirror.neostrada.nl/kali kali-rolling InRelease [30.5 kB] Err:1 http://mirror.neostrada.nl/kali kali-rolling InRelease The following signatures were invalid: EXPKEYSIG ED444FF07D8D0BF6 Kali Linux Repository <devel@kali.org> Fetched 30.5 kB in 1s (25.5 kB/s) Reading package lists... Done W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://mirror.neostrada.nl/kali kali-rolling InRelease: The following signatures were invalid: EXPKEYSIG ED444FF07D8D0BF6 Kali Linux Repository <devel@kali.org> W: Failed to fetch http://http.kali.org/kali/dists/kali-rolling/InRelease The following signatures were invalid: EXPKEYSIG ED444FF07D8D0BF6 Kali Linux Repository <devel@kali.org> W: Some index files failed to download. They have been ignored, or old ones used instead.