问题: 无法联接到服务器: 没有那个文件或目录 服务器是否在本地运行并且在 Unix 域套接字 "/var/run/postgresql/.s.PGSQL.5432"上准备接受联接?
psql: could not connect to server: 没有那个文件或目录
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
解决方法: /sbin/chkconfig postgresql on
service postgresql start
初始化:
passwd postgres 修改postgres密码
su postgres 进入数据库
createuser xxx -P 创建xxx用户(然后输入密码,Y/N一直选择N即可)
createdb --owner=user xxx 创建一个XXX数据库
psql xxx 进入xxx数据库
psql -l 列出数据库
dropuser 删除用户
dropdb 删除数据库
连接 db_connect zql:zql@127.0.0.1/msfbook
tcp端口扫描:
msf > use auxiliary/scanner/portscan/tcp
msf auxiliary(tcp) > show options
Module options (auxiliary/scanner/portscan/tcp):
Name Current Setting Required Description
---- --------------- -------- -----------
CONCURRENCY 10 yes The number of concurrent ports to check per host
PORTS 1-10000 yes Ports to scan (e.g. 22-25,80,110-900)
RHOSTS yes The target address range or CIDR identifier
THREADS 1 yes The number of concurrent threads
TIMEOUT 1000 yes The socket connect timeout in milliseconds
msf auxiliary(tcp) > set rhosts 192.168.123.12
rhosts => 192.168.123.12
msf auxiliary(tcp) > set threads 8
threads => 8
msf auxiliary(tcp) > show options
Module options (auxiliary/scanner/portscan/tcp):
Name Current Setting Required Description
---- --------------- -------- -----------
CONCURRENCY 10 yes The number of concurrent ports to check per host
PORTS 1-10000 yes Ports to scan (e.g. 22-25,80,110-900)
RHOSTS 192.168.123.12 yes The target address range or CIDR identifier
THREADS 8 yes The number of concurrent threads
TIMEOUT 1000 yes The socket connect timeout in milliseconds
msf auxiliary(tcp) > run
[*] 192.168.123.12:139 - TCP OPEN
[*] 192.168.123.12:135 - TCP OPEN
[*] 192.168.123.12:445 - TCP OPEN
[*] 192.168.123.12:1110 - TCP OPEN
[*] 192.168.123.12:7504 - TCP OPEN
[*] 192.168.123.12:7514 - TCP OPEN
[*] 192.168.123.12:7513 - TCP OPEN
[*] 192.168.123.12:8082 - TCP OPEN
[*] 192.168.123.12:9535 - TCP OPEN
[*] 192.168.123.12:9595 - TCP OPEN
[*] 192.168.123.12:9594 - TCP OPEN
[*] 192.168.123.12:9593 - TCP OPEN
[*] Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completed
load db_autopwn 自动化攻击
msf > load db_autopwn
[
-
] Failed to load plugin
from
/
opt
/
framework3
/
msf3
/
plugins
/
db_autopwn: no such
file
to load
-
-
/
opt
/
framework3
/
msf3
/
plugins
/
db_autopwn
http://download.csdn.net/detail/terrying/5063334
Windows→[metasploit]/apps/pro/msf3/plugins/db_autopwn.rb
http://www.2cto.com/Article/201212/177736.html
http://www.freebuf.com/articles/web/5628.html?zplnrzfumynzriqe
db_autopwn -t -p -r -e