目录

  1. 1. 前言
  2. 2. Task1
  3. 3. Task2
  4. 4. Task3
  5. 5. Task4
  6. 6. Task5
  7. 7. Task6
  8. 8. Task7
  9. 9. Submit Flag
↑

LOADING

第一次加载文章图片可能会花费较长时间

要不挂个梯子试试?(x

加载过慢请开启缓存 浏览器默认开启

HTB Dancing

2023/9/18 渗透 HackTheBox
  |     |   总文章阅读量:次

前言

第0层 Dancing

本篇主要是SMB协议

Task1

What does the 3-letter acronym SMB stand for?
3 个字母的首字母缩略词 SMB 代表什么?

A:Server Message Block

SMB即Server Message Block(服务器消息块),是一种文件共享协议。 当文件原件在你的A电脑上,而你想在局域网下用你的手机、iPad或是另一台电脑来访问A电脑上的该文件时,你可能需要用到SMB共享。


Task2

What port does SMB use to operate at?
SMB 使用哪个端口进行操作?

A:445

nmap扫描

nmap -sV 10.129.33.169

使用-sV选项,Nmap将执行以下操作:

  1. 端口扫描:Nmap将扫描目标主机上的开放端口,确定哪些端口正在运行服务。
  2. 服务版本探测:Nmap将尝试识别目标主机上运行的服务的版本信息。

image-20230918193312064

SMB(服务器消息块)协议的一项核心任务是文件共享。

在Windows NT 中,它运行在 NBT(TCP/IP 上的 NetBIOS)之上,它使用著名的端口UDP 137和138以及TCP 139。

在Windows 2000中,Microsoft添加了直接通过TCP/IP运行SMB的选项(TCP端口445),而没有额外的NBT层。

简言之:有两种SMB,TCP端口139是NETBIOS(网络基本输入/输出系统协议)上的SMB。而TCP 445是基于TCP/IP的SMB,是较新的版本的SMB。


Task3

What is the service name for port 445 that came up in our Nmap scan?
在我们的 Nmap 扫描中出现的端口 445 的服务名称是什么?

A:microsoft-ds

由上面的扫描结果可知


Task4

What is the 'flag' or 'switch' that we can use with the smbclient utility to 'list' the available shares on Dancing?
我们可以使用 SMB 工具“列出”共享内容的“标志”或“开关”是什么?

A:-L

在 linux 中,可以使用命令行工具smbclient对目标机器进行SMB服务的连接,smbclient将尝试连接到远程主机,并检查是否需要任何身份验证

查看smbclient命令的具体用法

smbclient --help

image-20230918194939608

其中-L命令用于显示服务器端分享的资源


Task5

How many shares are there on Dancing?
Dancing有多少分享?

A:4

直接显示服务端分享的资源

smbclient -L 10.129.33.169

连接后因为密码为空,直接回车

image-20230918195443866

可以看到有4个sharename,即分享数为4


Task6

What is the name of the share we are able to access in the end with a blank password?
我们最终可以使用空白密码访问的共享的名称是什么?

A:WorkShares

上面我们smbclient -L得到了sharename,即共享的账户名称

在列出的用户里,后面有美元符号$的都是管理员权限的,所以我们只能连接WorkShares这个用户

除了WorkShares之外,其他三个都是默认共享的,可以用自己物理机输入命令net share就知道了

image-20230918200107396


Task7

What is the command we can use within the SMB shell to download the files we find?
我们可以在 SMB shell 中使用什么命令来下载我们找到的文件?

A:get

和ftp一样


Submit Flag

综合上面的信息,进行连接

smbclient \\\\10.129.33.169\\WorkShares

没有密码

image-20230918201002017

找到flag下载到本地

image-20230918200934574

A:5f61c10dffbc77a704d76016a22f1664

image-20230918201101535